From a1cc81790f8a04108ff56739ba284d600c9fd4e9 Mon Sep 17 00:00:00 2001 From: Anton Schubert Date: Sun, 28 May 2017 03:37:40 +0200 Subject: update dash-player to simultaneous dash/hls player --- assets/clapprio/dash-shaka-playback.js | 97 ++++++++++++++++++++++++++++++++-- 1 file changed, 92 insertions(+), 5 deletions(-) (limited to 'assets/clapprio/dash-shaka-playback.js') diff --git a/assets/clapprio/dash-shaka-playback.js b/assets/clapprio/dash-shaka-playback.js index fc12904..36e555c 100644 --- a/assets/clapprio/dash-shaka-playback.js +++ b/assets/clapprio/dash-shaka-playback.js @@ -1,5 +1,92 @@ -!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)}(this,function(t){return function(t){function e(n){if(i[n])return i[n].exports;var r=i[n]={exports:{},id:n,loaded:!1};return t[n].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}([function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(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 a=function(){function t(t,e){for(var i=0;i=720,this.trigger(u.Events.PLAYBACK_HIGHDEFINITIONUPDATE,this.highDefinition),this.trigger(u.Events.PLAYBACK_BITRATE,{bandwidth:t.bandwidth,width:t.width,height:t.height,level:t.id})}},{key:"_destroy",value:function(){o(Object.getPrototypeOf(e.prototype),"destroy",this).call(this),this._isShakaReadyState=!1,u.Log.debug("shaka was destroyed")}},{key:"_shakaReady",value:function(){o(Object.getPrototypeOf(e.prototype),"_ready",this).call(this)}},{key:"isReady",get:function(){return this._isShakaReadyState}},{key:"textTracks",get:function(){return this._player&&this._player.getTracks().filter(function(t){return"text"===t.type})}},{key:"audioTracks",get:function(){return this._player&&this._player.getTracks().filter(function(t){return"audio"===t.type})}},{key:"videoTracks",get:function(){return this._player&&this._player.getTracks().filter(function(t){return"video"===t.type})}}]),e}(u.HTML5Video);e["default"]=p,p.canPlay=function(t){var e=arguments.length<=1||void 0===arguments[1]?"":arguments[1];c["default"].polyfill.installAll();var i=c["default"].Player.isBrowserSupported(),n=t.split("?")[0].match(/.*\.(.*)$/)||[];return i&&("mpd"===n[1]||e.indexOf("application/dash+xml")>-1)},t.exports=e["default"]},function(t,e,i){var n;!function(){var r={};(function(t){function e(t,e){var i=t.split("."),n=Yr;i[0]in n||!n.execScript||n.execScript("var "+i[0]);for(var r;i.length&&(r=i.shift());)i.length||void 0===e?n=n[r]?n[r]:n[r]={}:n[r]=e}function i(t){function e(){}var i=je;e.prototype=i.prototype,t.md=i.prototype,t.prototype=new e,t.prototype.constructor=t,t.fd=function(t,e,n){return i.prototype[e].apply(t,Array.prototype.slice.call(arguments,2))}}function n(t){this.c=Math.exp(Math.log(.5)/t),this.b=this.a=0}function r(t,e,i){var n=Math.pow(t.c,e);i=i*(1-n)+n*t.a,isNaN(i)||(t.a=i,t.b+=e)}function s(t){return t.a/(1-Math.pow(t.c,t.b))}function a(){this.c=new n(2),this.f=new n(5),this.a=0,this.b=5e5}function o(){}function u(){}function h(){this.g=null,this.f=!1,this.b=new a,this.h={},this.a={},this.i=!1,this.c=null}function c(t){return(t=t.h.audio)?(t=f(t),t[Math.floor(t.length/2)]):null}function l(t){var e=t.h.video;if(!e)return null;var e=f(e),i=t.a.audio,i=i&&i.bandwidth||0;t=t.b.getBandwidthEstimate();for(var n=e[0],r=0;r=(s.bandwidth+i)/.95&&t<=a&&(n=s)}}return n}function f(t){return t.streams.slice(0).filter(function(t){return t.allowedByApplication&&t.allowedByKeySystem}).sort(function(t,e){return t.bandwidth-e.bandwidth})}function d(t){var e;t instanceof d?(p(this,t.R),this.ka=t.ka,this.T=t.T,m(this,t.wa),this.O=t.O,y(this,E(t.a)),this.ca=t.ca):t&&(e=String(t).match(Wr))?(p(this,e[1]||"",!0),this.ka=b(e[2]||""),this.T=b(e[3]||"",!0),m(this,e[4]),this.O=b(e[5]||"",!0),y(this,e[6]||"",!0),this.ca=b(e[7]||"")):this.a=new w(null)}function p(t,e,i){t.R=i?b(e,!0):e,t.R&&(t.R=t.R.replace(/:$/,""))}function m(t,e){if(e){if(e=Number(e),isNaN(e)||0>e)throw Error("Bad port number "+e);t.wa=e}else t.wa=null}function y(t,e,i){e instanceof w?t.a=e:(i||(e=g(e,Qr)),t.a=new w(e))}function b(t,e){return t?e?decodeURI(t):decodeURIComponent(t):""}function g(t,e,i){return"string"==typeof t?(t=encodeURI(t).replace(e,v),i&&(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 w(t){this.b=t||null}function E(t){var e=new w;if(e.b=t.b,t.a){var i,n={};for(i in t.a)n[i]=t.a[i].concat();e.a=n,e.c=t.c}return e}function S(t,e,i){this.category=t,this.code=e,this.data=Array.prototype.slice.call(arguments,2)}function T(t,e){return t.reduce(function(t,e,i){return e["catch"](t.bind(null,i))}.bind(null,e),Promise.reject())}function k(t,e){return t.concat(e)}function P(){}function A(t){return null!=t}function I(t){return function(e){return e!=t}}function _(){}function R(){var t,e,i=new Promise(function(i,n){t=i,e=n});return i.resolve=t,i.reject=e,i}function N(t){this.f=!1,this.a=[],this.b=[],this.c=[],this.g=t||null}function C(){return{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:0}}function M(t,e){return{uris:t,method:"GET",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:e}}function x(t,e,i){for(var n=0;n=t[e]}.bind(null,e);if(!e[0]&&!e[2])return H(t,!1);if(!e[1]&&!e[3])return H(t,!0);if(i(0)&&i(1)&&i(2)&&i(3))return q(t);throw new S(2,2003)}function z(t){t=unescape(encodeURIComponent(t));for(var e=new Uint8Array(t.length),i=0;i=e?null:new ss(t,e,i)}function wt(t,e,i,n){var r=t.g;return Promise.resolve().then(function(){if(this.c){var t=this.h(e,r,i,n,this.i);if(null!=i&&null!=n){for(var s=0;s=this.f);++s)this.c.addCue(t[s]);null==this.b&&(this.b=i),this.a=Math.min(n,this.f)}}}.bind(t))}function Et(t,e){return null==t.a||t.at.end(0)-t.start(0)?null:t.length?t.end(t.length-1):null}function kt(t,e){var i=0;if(!t||1==t.length&&1e-6>t.end(0)-t.start(0))return i;var n=!1,r=1e-4;e||(r=.25);for(var s=0;s=t.start(s)&&e=t.start(s)-t.end(s-1))i+=t.end(s)-t.start(s),i+=t.start(s)-t.end(s-1);else if(0=t.end(s-1)){if(!(.04>=t.start(s)-e))break;i+=t.end(s)-e,n=!0}else n=!1;return i}function Pt(t,e,i){this.f=t,this.h=e,this.j=i,this.c={},this.b=null,this.a={},this.g=new O,this.i=!1}function At(){var t={};return'video/mp4; codecs="avc1.42E01E",video/mp4; codecs="avc3.42E01E",video/mp4; codecs="hvc1.1.6.L93.90",audio/mp4; codecs="mp4a.40.2",audio/mp4; codecs="ac-3",audio/mp4; codecs="ec-3",video/webm; codecs="vp8",video/webm; codecs="vp9",video/webm; codecs="av1",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",video/mp2t; codecs="mp4a.40.2",text/vtt,application/mp4; codecs="wvtt",application/ttml+xml,application/mp4; codecs="stpp"'.split(",").forEach(function(e){t[e]=!!rs[e]||MediaSource.isTypeSupported(e);var i=e.split(";")[0];t[i]=t[i]||t[e]}),t}function It(t,e){var i;return"text"==e?i=t.b.b:(i=Rt(t,e),i=!i||1==i.length&&1e-6>i.end(0)-i.start(0)?null:1==i.length&&0>i.start(0)?0:i.length?i.start(0):null),i}function _t(t,e,i){return"text"==e?(e=Et(t.b,i),e||(e=Et(t.b,i+.1))&&(e+=.1)):(t=Rt(t,e),e=kt(t,i),e||(e=kt(t,i+.1))&&(e+=.1)),e}function Rt(t,e){try{return t.c[e].buffered}catch(i){return null}}function Nt(t,e,i,n,r){return"text"==e?wt(t.b,i,n,r):Dt(t,e,t.Tc.bind(t,e,i))}function Ct(t,e){return"text"==e?t.b.remove(0,1/0):Dt(t,e,t.Bb.bind(t,e,0,t.h.duration))}function Mt(t,e,i){return"text"==e?(t.b.g=i,Promise.resolve()):Dt(t,e,t.Jc.bind(t,e,i))}function xt(t,e,i){return"text"==e?(t.b.f=i,Promise.resolve()):Promise.all([Dt(t,e,t.Lb.bind(t,e)),Dt(t,e,t.Hc.bind(t,e,i))])}function Dt(t,e,i){if(t.i)return Promise.reject();if(i={start:i,p:new R},t.a[e].push(i),1==t.a[e].length)try{i.start()}catch(n){"QuotaExceededError"==n.name?i.p.reject(new S(3,3017,e)):i.p.reject(new S(3,3015,n)),Lt(t,e)}return i.p}function Ot(t,e){if(t.i)return Promise.reject();var i,n=[];for(i in t.c){var r=new R,s={start:function(t){t.resolve()}.bind(null,r),p:r};t.a[i].push(s),n.push(r),1==t.a[i].length&&s.start()}return Promise.all(n).then(function(){var t,i;try{e()}catch(n){i=Promise.reject(new S(3,3015,n))}for(t in this.c)Lt(this,t);return i}.bind(t),function(){return Promise.reject()}.bind(t))}function Lt(t,e){t.a[e].shift();var i=t.a[e][0];if(i)try{i.start()}catch(n){i.p.reject(new S(3,3015,n)),Lt(t,e)}}function jt(t,e,i){this.a=t,this.L=e,this.D=i}function Ut(t,e,i,n,r,s){this.position=t,this.startTime=e,this.endTime=i,this.a=n,this.L=r,this.D=s}function Bt(t,e){this.j=t,this.i=e,this.c=this.a=1/0,this.b=1,this.g=this.f=0,this.h=!0}function Ft(t,e,i,n,r,s){this.a=t,this.c=e,this.j=i,this.s=n,this.l=r,this.m=s,this.b=new O,this.h=!1,this.g=1,this.i=this.f=null,0t.c.da()?t.c.ra():Math.max(t.c.Ua(),t.c.ra())}function qt(t,e){e!=t.h&&(t.h=e,zt(t,t.g),t.l(e))}function Ht(e){Gt(e),e.i=t.setTimeout(e.pc.bind(e),250)}function Gt(e){e.i&&(t.clearTimeout(e.i),e.i=null)}function zt(e,i){null!=e.f&&(t.clearInterval(e.f),e.f=null),e.g=i,e.a.playbackRate=e.h||0>i?0:i,!e.h&&0>i&&(e.f=t.setInterval(function(){this.a.currentTime+=i/4}.bind(e),250))}function $t(t,e){var i=t.c,n=i.ra(),r=i.ea();return i.U()&&1/0!=i.c?(i=n+1,n=i+t.j,e>=n&&e<=r||kt(t.a.buffered,e)&&e>=i&&e<=r?e:e>r?r:r=i&&e<=r?e:Math.min(n+2,r)):er?r:e}function Yt(t,e,i){t.a.currentTime=i;var n=0,r=function(){!this.a||10<=n++||this.a.currentTime!=e||(this.a.currentTime=i,setTimeout(r,100))}.bind(t);setTimeout(r,100)}function Wt(t,e){var i=t.c.ra();return ei?i:e)}function Xt(t,e,i){return i==e||t>=as&&i==e.split("-")[0]||t>=os&&i.split("-")[0]==e.split("-")[0]}function Jt(t){t=t.toLowerCase().split("-");var e=us[t[0]];return e&&(t[0]=e),t.join("-")}function Zt(t,e,i){var n=!1;return t.streamSets.forEach(function(t){t.streams.forEach(function(r){var s=r.allowedByApplication;r.allowedByApplication=!0,"video"==t.type?(r.widthe.maxWidth||r.width>i.width||r.heighte.maxHeight||r.height>i.height||r.width*r.heighte.maxPixels||r.bandwidthe.maxVideoBandwidth)&&(r.allowedByApplication=!1):"audio"==t.type&&(r.bandwidthe.maxAudioBandwidth)&&(r.allowedByApplication=!1),s!=r.allowedByApplication&&(n=!0)})}),n}function Qt(t,e,i){var n="",r=null;for(t&&t.A&&(n=t.keySystem(),r=t.m),t=0;tr.indexOf(h)?(s.streams.splice(o,1),--o):!a||u.mimeType==a.mimeType&&u.codecs.split(".")[0]==a.codecs.split(".")[0]||(s.streams.splice(o,1),--o):(s.streams.splice(o,1),--o)}s.streams.length||(i.streamSets.splice(t,1),--t)}}}function te(t,e){return t.streamSets.map(function(t){var i=e?e[t.type]:null;return t.streams.filter(function(t){return t.allowedByApplication&&t.allowedByKeySystem}).map(function(e){return{id:e.id,active:i==e,type:t.type,bandwidth:e.bandwidth,language:t.language,kind:e.kind||null,width:e.width||null,height:e.height||null,frameRate:e.frameRate||void 0,codecs:e.codecs||null}})}).reduce(k,[])}function ee(t,e){for(var i=0;ir?(r=e,n.video=t):e==r&&re(t)t.streams.length?e:(t.streams.forEach(function(t){e+=t.bandwidth}),e/t.streams.length)}function se(t){var e=0;return t?(t.streams.forEach(function(t){t.height>e&&(e=t.height)}),e):e}function ae(t,e){var i=t;return e&&(i+='; codecs="'+e+'"'),i}function oe(t,e,i,n,r,s,a,o,u){this.m=t,this.c=e,this.S=i,this.a=n,this.G=r,this.v=s,this.j=a,this.w=o||null,this.A=u||null,this.h=null,this.i=1,this.C=Promise.resolve(),this.g=[],this.l={},this.b={},this.f=this.s=this.J=!1}function ue(t){return t.a.periods[Ie(t,Kt(t.m))]}function he(t){return K(t.b,function(t){return t.stream})}function ce(t,e){var i={};return i.text=e,fe(t,i)}function le(t,e,i,n){var r=t.b[e];!r&&"text"==e&&t.h.ignoreTextStreamFailures?ce(t,i):r&&(e=t.g[_e(t,i)])&&e.xa&&(e=t.l[i.id])&&e.xa&&r.stream!=i&&(r.stream=i,r.La=!0,n&&(r.aa?r.Pa=!0:r.ga?(r.la=!0,r.Pa=!0):(Me(r),Ne(t,r,!0))))}function fe(t,e){var i=Ie(t,Kt(t.m)),n=K(e,function(t){return ae(t.mimeType,t.codecs)});return t.c.init(n,t.h.useRelativeCueTimestamps),me(t),n=F(e),pe(t,n).then(function(){if(!this.f)for(var t in e){var n=e[t];this.b[t]||(this.b[t]={stream:n,type:t,ta:null,V:null,La:!0,Ma:i,endOfStream:!1,ga:!1,$:null,la:!1,Pa:!1,aa:!1,bb:!1},Ce(this,this.b[t],0))}}.bind(t))}function de(t,e){var i=t.g[e];if(i)return i.I;i={I:new R,xa:!1},t.g[e]=i;var n=t.a.periods[e].streamSets.map(function(t){return t.streams}).reduce(k,[]);return t.C=t.C.then(function(){if(!this.f)return pe(this,n)}.bind(t)).then(function(){this.f||(this.g[e].I.resolve(),this.g[e].xa=!0)}.bind(t))["catch"](function(t){this.f||(this.g[e].I.reject(),delete this.g[e],this.j(t))}.bind(t)),i.I}function pe(t,e){for(var i=[],n=0;ne?t.c.za(e):t.c.za(Math.pow(2,32))}function ye(t,e){var i,n,r=Kt(t.m);n=t.c;var s=e.type;n="text"==s?n.b.a:Tt(Rt(n,s));var s=e.ta&&e.V?t.a.periods[_e(t,e.ta)].startTime+e.V.endTime:r,a=_e(t,e.stream),o=Ie(t,s),u=t.a.periods[o];return i=a!=o?null:be(t,e,r,n,o),(i?u.startTime+i.startTime-r:_t(t.c,e.type,r))>=Math.max(t.i*Math.max(t.a.minBufferTime||0,t.h.rebufferingGoal),t.i*t.h.bufferingGoal)?.5:s>=t.a.presentationTimeline.da()?(e.endOfStream=!0,null):(e.endOfStream=!1,o!=a?(e.Ma=o,null):(i=be(t,e,r,n,a))?(ve(t,e,r,a,i),null):1)}function be(t,e,i,n,r){if(e.V&&e.stream==e.ta)return i=e.V.position+1,ge(t,e,r,i);if(i=e.V?e.stream.findSegmentPosition(Math.max(0,t.a.periods[_e(t,e.ta)].startTime+e.V.endTime-t.a.periods[r].startTime)):e.stream.findSegmentPosition(Math.max(0,(n||i)-t.a.periods[r].startTime)),null==i)return null;var s=null;return null==n&&(s=ge(t,e,r,Math.max(0,i-1))),s||ge(t,e,r,i)}function ge(t,e,i,n){return i=t.a.periods[i],(e=e.stream.getSegmentReference(n))?(t=t.a.presentationTimeline,n=t.ea(),i.startTime+e.endTimen?null:e):null}function ve(t,e,i,n,r){var s=t.a.periods[n],a=e.stream,o=t.a.periods[n+1],u=null,u=o?o.startTime:t.a.presentationTimeline.da();n=Ee(t,e,n,u),e.ga=!0,e.La=!1,o=Re(t,r),Promise.all([n,o]).then(function(t){if(!this.f&&!this.s)return Se(this,e,i,s,a,r,t[1])}.bind(t)).then(function(){this.f||this.s||(e.ga=!1,e.bb=!1,Ce(this,e,0),ke(this,a))}.bind(t))["catch"](function(t){this.f||this.s||(e.ga=!1,1001==t.code||1002==t.code||1003==t.code?"text"==e.type&&this.h.ignoreTextStreamFailures&&1001==t.code?delete this.b.text:(this.j(t),Ce(this,e,4)):3017==t.code?we(this,e,t):this.j(t))}.bind(t))}function we(t,e,i){if(!F(t.b).some(function(t){return t!=e&&t.bb})){var n=Math.round(100*t.i);if(20=i?Promise.resolve():t.c.remove(e.type,n,n+i).then(function(){}.bind(t)))}function ke(t,e){if(!t.J&&(t.J=F(t.b).every(function(t){return!t.la&&!t.aa&&t.V}),t.J)){var i=_e(t,e);for(t.g[i]||de(t,i).then(function(){this.v()}.bind(t))["catch"](P),i=0;i=t.a.periods[i].startTime)return i;return 0}function _e(t,e){for(var i=0;ie?"-Infinity":"Infinity":e;return n}})}function Ze(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__?Qe(e):e})}function Qe(t){return{length:t.length,start:function(e){return t.start[e]},end:function(e){return t.end[e]}}}function ti(t,e,i,n,r){this.C=t,this.l=e,this.w=i,this.A=n,this.s=r,this.f=this.j=this.g=!1,this.v="",this.a=this.i=null,this.b={video:{},player:{}},this.m=0,this.c={},this.h=null}function ei(t){for(var e in t.c){var i=t.c[e];delete t.c[e],i.reject(new S(7,7e3))}}function ii(t,e){var i=Je(e);t.a.sendMessage("urn:x-cast:com.google.shaka.v2",i,function(){},o)}function ni(t,e,i){je.call(this),this.c=t,this.b=e,this.i=this.f=this.g=this.j=this.l=null,this.a=new ti(i,this.Pc.bind(this),this.Qc.bind(this),this.Rc.bind(this),this.mb.bind(this)),ri(this)}function ri(t){t.a.init(),t.i=new O,cs.forEach(function(t){L(this.i,this.c,t,this.cd.bind(this))}.bind(t)),ps.forEach(function(t){L(this.i,this.b,t,this.xc.bind(this))}.bind(t)),t.l={};for(var e in t.c)Object.defineProperty(t.l,e,{configurable:!1,enumerable:!0,get:t.bd.bind(t,e),set:t.dd.bind(t,e)});t.j={};for(e in t.b)Object.defineProperty(t.j,e,{configurable:!1,enumerable:!0,get:t.wc.bind(t,e)});t.g=new je,t.g.S=t.l,t.f=new je,t.f.S=t.j}function si(t,e,i){je.call(this),this.b=t,this.a=e,this.j={video:t,player:e},this.l=i||function(){},this.i=!1,this.c=!0,this.f=this.g=null,ai(this)}function ai(e){var i=cast.receiver.CastReceiverManager.getInstance();i.onSenderConnected=e.vb.bind(e),i.onSenderDisconnected=e.vb.bind(e),i.onSystemVolumeChanged=e.Tb.bind(e),e.g=i.getCastMessageBus("urn:x-cast:com.google.shaka.v2"),e.g.onMessage=e.hc.bind(e),i.start(),cs.forEach(function(t){this.b.addEventListener(t,this.yb.bind(this,"video"))}.bind(e)),ps.forEach(function(t){this.a.addEventListener(t,this.yb.bind(this,"player"))}.bind(e)),e.a.Gb(1920,1080),e.a.addEventListener("loading",function(){this.c=!1,oi(this)}.bind(e)),e.b.addEventListener("playing",function(){this.c=!1,oi(this)}.bind(e)),e.a.addEventListener("unloading",function(){this.c=!0,oi(this)}.bind(e)),e.b.addEventListener("ended",function(){t.setTimeout(function(){this.b&&this.b.ended&&(this.c=!0,oi(this))}.bind(this),5e3)}.bind(e))}function oi(t){Promise.resolve().then(function(){this.dispatchEvent(new Le("caststatuschanged"))}.bind(t))}function ui(t,e,i){for(var n in e.player)t.a[n](e.player[n]);t.l(i),i=Promise.resolve();var r=t.b.autoplay;e.manifest&&(t.b.autoplay=!1,i=t.a.load(e.manifest,e.startTime),i["catch"](function(t){this.a.dispatchEvent(new Le("error",{detail:t}))}.bind(t))),i.then(function(){for(var t in e.video){var i=e.video[t];this.b[t]=i}for(t in e.playerAfterLoad)i=e.playerAfterLoad[t],this.a[t](i);this.b.autoplay=r,e.manifest&&this.b.play()}.bind(t))}function hi(t,e,i){t.i&&(e=Je(e),i?t.g.getCastChannel(i).send(e):t.g.broadcast(e))}function ci(t,e){var i=li(t,e);return 1!=i.length?null:i[0]}function li(t,e){return Array.prototype.filter.call(t.childNodes,function(t){return t.tagName==e})}function fi(t){var e=t.firstChild;return e&&e.nodeType==Node.TEXT_NODE?t.textContent.trim():null}function di(t,e,i,n){var r=null;return t=t.getAttribute(e),null!=t&&(r=i(t)),null==r?void 0!==n?n:null:r}function pi(t){return t?(t=Date.parse(t),isNaN(t)?null:Math.floor(t/1e3)):null}function mi(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 yi(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 bi(t){return t=Number(t),t%1?null:t}function gi(t){return t=Number(t),!(t%1)&&0e||(i[i.length-1]=new Ut(t.position,t.startTime,e,t.a,t.L,t.D)))}}function _i(t,e){if(!e.length)return t;var i=e.map(function(t){return new d(t)});return t.map(function(t){return new d(t)}).map(function(t){return i.map(t.resolve.bind(t))}).reduce(k,[]).map(function(t){return t.toString()})}function Ri(t,e){var i=Ni(t,e,"timescale"),n=1;i&&(n=gi(i)||1),i=Ni(t,e,"duration"),(i=gi(i||""))&&(i/=n);var r=Ni(t,e,"startNumber"),s=Ni(t,e,"presentationTimeOffset"),a=vi(r||"");null!=r&&null!=a||(a=1);var o=Ci(t,e,"SegmentTimeline"),r=null;if(o){for(var r=n,u=Number(s),h=t.H.duration||1/0,o=li(o,"S"),c=[],l=0,f=0;fd)if(f+1=d)break;d=Math.ceil((d-p)/m)-1}else{if(1/0==h)break;if(p/r>=h)break;d=Math.ceil((h*r-p)/m)-1}0t.b.byteLength&&Ki();var i=t.b.buffer.slice(t.a,t.a+e);return t.a+=e,new Uint8Array(i)}function Bi(t,e){t.a+e>t.b.byteLength&&Ki(),t.a+=e}function Fi(t){var e=t.a;try{for(;xi(t)&&t.b.getUint8(t.a);)t.a+=1}catch(i){Ki()}return e=t.b.buffer.slice(e,t.a),t.a+=1,q(e)}function Ki(){throw new S(3,3e3)}function Vi(t,e){for(;xi(e);){var i=e.a,n=Li(e),r=Li(e);if(1==n?n=ji(e):n||(n=e.b.byteLength-i),r==t)return n;Bi(e,n-(e.a-i))}return-1}function qi(t,e){for(var i=new Mi(new DataView(t)),n=[[1836019574,0],[1953653099,0],[1835297121,0],[1835626086,0],[1937007212,0],[1937011556,8],[e,0]],r=-1,s=0;s>>31,u&=2147483647;var c=Li(t);if(Bi(t,4),1==h)throw new S(3,3006);r.push(new Ut(r.length,n/o,(n+c)/o,function(){return i},e,e+u-1)),n+=c,e+=u}return r}function Gi(t){this.a=t}function zi(t){this.b=t,this.a=new Mi(t),Ts||(Ts=[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 $i(t){var e;if(e=Yi(t),7=e&&!(i&1<<8-e);e++);if(8t||i&&t>=i?null:Math.floor(t/n)},getSegmentReference:function(t){var e=t*n;return new Ut(t,e,e+n,function(){var i=Ai(a,u,t+r,o,e*s);return _i(h,[i])},0,null)}}}function ln(t,e){for(var i=[],n=0;ne.s||(e.f=t.setTimeout(e.Sc.bind(e),1e3*Math.max(Math.max(3,e.s)-i,0)))}function gn(t,e,i){e=e||{contentType:"",mimeType:"",codecs:"",frameRate:void 0},i=i||e.M;var n=li(t,"BaseURL").map(fi),r=t.getAttribute("contentType")||e.contentType,s=t.getAttribute("mimeType")||e.mimeType,a=t.getAttribute("codecs")||e.codecs,o=di(t,"frameRate",wi)||e.frameRate;return r||(r=Tn(s,a)),{M:_i(i,n),Ga:ci(t,"SegmentBase")||e.Ga,Y:ci(t,"SegmentList")||e.Y,Ha:ci(t,"SegmentTemplate")||e.Ha,width:di(t,"width",vi)||e.width,height:di(t,"height",vi)||e.height,contentType:r,mimeType:s,codecs:a,frameRate:o,id:t.getAttribute("id")}}function vn(t){var e={};t.forEach(function(t){e[t.id]=[t]}),t.forEach(function(t){var i=e[t.id];t.Yc.forEach(function(t){(t=e[t])&&t!=i&&(i.push.apply(i,t),t.forEach(function(t){e[t.id]=i}))})});var i=[],n=[];return F(e).forEach(function(t){if(!(0<=n.indexOf(t))){n.push(t);var e=new D;t.forEach(function(t){e.push(t.contentType||"",t)}),e.keys().forEach(function(t){var n=new D;e.get(t).forEach(function(t){n.push(t.language,t)}),n.keys().forEach(function(e){var r=n.get(e);e={language:e,type:t,primary:r.some(function(t){return t.cc}),drmInfos:r.map(function(t){return t.drmInfos}).reduce(k,[]),streams:r.map(function(t){return t.streams}).reduce(k,[])},i.push(e)})})}}),i}function wn(t){var e;return e=0+(t.Ga?1:0),e+=t.Y?1:0,(e+=t.Ha?1:0)?(1!=e&&(t.Ga&&(t.Y=null),t.Ha=null),!0):"text"==t.contentType||"application"==t.contentType}function En(t,e,i,n){return e=_i(e,[i]),e=M(e,t.c.retryParameters),e.method=n,t.a.request(0,e).then(function(t){if("HEAD"==n){if(!t.headers||!t.headers.date)return 0;t=t.headers.date}else t=q(t.data);return t=Date.parse(t),isNaN(t)?0:t-Date.now()})}function Sn(t,e,i,n){i=i.map(function(t){return{scheme:t.getAttribute("schemeIdUri"),value:t.getAttribute("value")}});var r=t.c.dash.clockSyncUri;return n&&!i.length&&r&&i.push({scheme:"urn:mpeg:dash:utc:http-head:2014",value:r}),T(i,function(t){var i=t.value;switch(t.scheme){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":return En(this,e,i,"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 En(this,e,i,"GET");case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":return t=Date.parse(i),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":return Promise.reject();default:return Promise.reject()}}.bind(t))["catch"](function(){return 0})}function Tn(t,e){return rs[ae(t,e)]?"text":t.split("/")[0]}function kn(t,e){var i=q(t),n=[],r=new DOMParser,s=null;try{s=r.parseFromString(i,"text/xml")}catch(a){throw new S(2,2005)}if(s){var o,u;if(!(i=s.getElementsByTagName("tt")[0]))throw new S(2,2006);for(r=i.getAttribute("ttp:frameRate"),s=i.getAttribute("ttp:subFrameRate"),o=i.getAttribute("ttp:frameRateMultiplier"),u=i.getAttribute("ttp:tickRate"),r=new Pn(r,s,o,u),s=kn.b(i.getElementsByTagName("styling")[0]),o=kn.b(i.getElementsByTagName("layout")[0]),i=kn.b(i.getElementsByTagName("body")[0]),u=0;un.length||"data"!=n[0])throw new S(1,1004,e);if(n=n.slice(1).join(":").split(","),2>n.length)throw new S(1,1004,e);var r=n[0],n=t.decodeURIComponent(n.slice(1).join(",")),r=r.split(";"),s=null;if(1=e.status){var r=e.getAllResponseHeaders().split("\r\n").reduce(function(t,e){var i=e.split(": ");return t[i[0].toLowerCase()]=i.slice(1).join(": "),t},{});e.responseURL&&(t=e.responseURL),i({uri:t,data:e.response,headers:r})}else{r=null;try{r=G(e.response)}catch(s){}n(new S(1,1001,t,e.status,r))}},r.onerror=function(){n(new S(1,1002,t))},r.ontimeout=function(){n(new S(1,1003,t))};for(var s in e.headers)r.setRequestHeader(s,e.headers[s]);r.send(e.body)})}function Dn(){this.a=null,this.c=[],this.b={}}function On(t,e,i){return Un(t,e,"readwrite",function(t){return t.put(i)})}function Ln(t,e){var i=[];return Un(t,"segment","readwrite",function(t){return t.openCursor()},function(t){if(t){if(e(t.value)){var n=t["delete"](),r=new R;n.onsuccess=r.resolve,n.onerror=Bn.bind(null,n,r),i.push(r)}t["continue"]()}}).then(function(){return Promise.all(i)}).then(function(){return i.length})}function jn(t,e){var i=0;return Un(t,e,"readonly",function(t){return t.openCursor(null,"prev")},function(t){t&&(i=t.key+1)}).then(function(){return i})}function Un(t,e,i,n,r){i=t.a.transaction([e],i);var s=n(i.objectStore(e)),a=new R;r&&(s.onsuccess=function(t){r(t.target.result)}),s.onerror=Bn.bind(null,s,a);var o={transaction:i,I:a};t.c.push(o);var u=function(){this.c.splice(this.c.indexOf(o),1)}.bind(t);return i.oncomplete=function(){u(),a.resolve(s.result)},i.onerror=function(t){u(),Bn(s,a,t)},a}function Bn(t,e,i){"AbortError"==t.error.name?e.reject(new S(9,9002)):e.reject(new S(9,9001,t.error)),i.preventDefault()}function Fn(t){return{offlineUri:"offline:"+t.key,originalManifestUri:t.originalManifestUri,duration:t.duration,size:t.size,tracks:t.periods[0].streams.map(function(t){return{id:t.id,active:!1,type:t.contentType,bandwidth:0,language:t.language,kind:t.kind||null,width:t.width,height:t.height,frameRate:t.frameRate,codecs:t.codecs}}),appMetadata:t.appMetadata}}function Kn(){}function Vn(t){var e=new Bt(null,0);e.za(t.duration);var i=t.drmInfo?[t.drmInfo]:[];return{presentationTimeline:e,minBufferTime:10,offlineSessionIds:t.sessionIds,periods:t.periods.map(function(t){return{startTime:t.startTime,streamSets:t.streams.map(function(n){var r=n.segments.map(function(t,e){return new Ut(e,t.startTime,t.endTime,function(){ -return[t.uri]},0,null)});return e.Fa(t.startTime,r),r=new Gi(r),{language:n.language,type:n.contentType,primary:n.primary,drmInfos:i,streams:[{id:n.id,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:r.find.bind(r),getSegmentReference:r.get.bind(r),initSegmentReference:n.initSegmentUri?new jt(function(){return[n.initSegmentUri]},0,null):null,presentationTimeOffset:n.presentationTimeOffset,mimeType:n.mimeType,codecs:n.codecs,bandwidth:0,width:n.width||void 0,height:n.height||void 0,kind:n.kind,encrypted:n.encrypted,keyId:n.keyId,allowedByApplication:!0,allowedByKeySystem:!0}]}})}})}}function qn(t){if(/^offline:([0-9]+)$/.exec(t)){var e={uri:t,data:new ArrayBuffer(0),headers:{"content-type":"application/x-offline-manifest"}};return Promise.resolve(e)}if(e=/^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(t)){var i=Number(e[1]),n=new Dn;return n.init(ks).then(function(){return n.get("segment",i)}).then(function(e){return n.o().then(function(){if(!e)throw new S(9,9003,i);return{uri:t,data:e.data,headers:{}}})})}return Promise.reject(new S(1,9004,t))}function Hn(t,e,i){this.b={},this.i=i,this.m=t,this.l=e,this.j=this.a=null,this.f=this.h=this.g=this.c=0}function Gn(t,e,i,n,r){t.b[e]=t.b[e]||[],t.b[e].push({uris:i.a(),L:i.L,D:i.D,ib:n,Da:r})}function zn(t,e){t.c=0,t.g=0,t.h=0,t.f=0,F(t.b).forEach(function(t){t.forEach(function(t){null!=t.D?this.c+=t.D-t.L+1:this.h+=t.ib}.bind(this))}.bind(t)),t.a=e,t.a.size=t.c;var i=F(t.b).map(function(t){var e=0,i=function(){if(!this.i)return Promise.reject(new S(9,9002));if(e>=t.length)return Promise.resolve();var n=t[e++];return $n(this,n).then(i)}.bind(this);return i()}.bind(t));return t.b={},t.j=Promise.all(i)}function $n(t,e){var i=M(e.uris,t.l);(e.L||null!=e.D)&&(i.headers.Range="bytes="+e.L+"-"+(null==e.D?"":e.D));var n;return t.m.request(1,i).then(function(t){return this.a?(n=t.data.byteLength,e.Da(t.data)):Promise.reject(new S(9,9002))}.bind(t)).then(function(){if(!this.a)return Promise.reject(new S(9,9002));null==e.D?(this.a.size+=n,this.f+=e.ib):this.g+=n;var t=(this.g+this.f)/(this.c+this.h),i=Fn(this.a);this.i.progressCallback(i,t)}.bind(t))}function Yn(t){this.a=new Dn,this.c=t,this.j=Jn(this),this.h=null,this.v=!1,this.i=null,this.l=[],this.f=-1,this.m=0,this.b=null,this.g=new Hn(t.i,t.getConfiguration().streaming.retryParameters,this.j)}function Wn(){return!!t.indexedDB}function Xn(t,e,i,n){function r(){}var s,a,o,u=t.c.i,h=t.c.getConfiguration();return bt(e,u,h.manifest.retryParameters,n).then(function(t){return ir(this),o=new t,o.configure(h.manifest),o.start(e,u,this.s.bind(this),i)}.bind(t)).then(function(t){return ir(this),s=t,a=new et(u,i,r),a.configure(h.drm),a.init(s,!0)}.bind(t)).then(function(){return ir(this),tr(s)}.bind(t)).then(function(){return ir(this),rt(a)}.bind(t)).then(function(){return ir(this),o.stop()}.bind(t)).then(function(){return ir(this),{manifest:s,Sb:a}}.bind(t))["catch"](function(t){if(o)return o.stop().then(function(){throw t});throw t})}function Jn(t){return{trackSelectionCallback:t.A.bind(t),progressCallback:function(t,e){if(t||e)return null}}}function Zn(t){return t.a.a?Promise.resolve():t.a.init(ks)}function Qn(t){var e=t.h?t.h.o():Promise.resolve();return t.h=null,t.b=null,t.v=!1,t.i=null,t.l=[],t.f=-1,e}function tr(t){return t=t.periods.map(function(t){return t.streamSets}).reduce(k,[]).map(function(t){return t.streams}).reduce(k,[]),Promise.all(t.map(function(t){return t.createSegmentIndex()}))}function er(t,e,i,n){for(var r=[],s=t.b.presentationTimeline.ra(),a=s,o=n.findSegmentPosition(s),u=null!=o?n.getSegmentReference(o):null;u;){var h=t.a.b.segment++;Gn(t.g,i.type,u,(u.endTime-u.startTime)*n.bandwidth/8,function(t,e,i,n){return e={key:t,data:n,manifestKey:this.f,streamNumber:i,segmentNumber:e},this.l.push(t),On(this.a,"segment",e)}.bind(t,h,u.position,n.id)),r.push({startTime:u.startTime,endTime:u.endTime,uri:"offline:"+t.f+"/"+n.id+"/"+h}),a=u.endTime+e.startTime,u=n.getSegmentReference(++o)}return t.m=Math.max(t.m,a-s),e=null,n.initSegmentReference&&(h=t.a.b.segment++,e="offline:"+t.f+"/"+n.id+"/"+h,Gn(t.g,i.type,n.initSegmentReference,0,function(t,e){var i={key:h,data:e,manifestKey:this.f,streamNumber:t,segmentNumber:-1};return this.l.push(h),On(this.a,"segment",i)}.bind(t,n.id))),{id:n.id,primary:i.primary,presentationTimeOffset:n.presentationTimeOffset||0,contentType:i.type,mimeType:n.mimeType,codecs:n.codecs,frameRate:n.frameRate,kind:n.kind,language:i.language,width:n.width||null,height:n.height||null,initSegmentUri:e,encrypted:n.encrypted,keyId:n.keyId,segments:r}}function ir(t){if(!t.c)throw new S(9,9002)}function nr(t){Ps.push(t)}function rr(t){var e=t.type.replace(/^(webkit|moz|MS)/,"").toLowerCase(),e=new Event(e,t);t.target.dispatchEvent(e)}function sr(t){for(this.c=[],this.b=[],this.a=[],t=new Mi(new DataView(t.buffer));xi(t);){var e=Vi(1886614376,t);if(-1==e)break;var i=t.a-8,n=Di(t);if(1=i.a.length)){for(var n=[],r=0;rthis.a?this.b:Math.min(s(this.c),s(this.f))},e("shaka.abr.SimpleAbrManager",h),h.prototype.stop=function(){this.g=null,this.f=!1,this.h={},this.a={},this.c=null},h.prototype.stop=h.prototype.stop,h.prototype.init=function(t){this.g=t},h.prototype.init=h.prototype.init,h.prototype.chooseStreams=function(t){for(var e in t)this.h[e]=t[e];if(e={},"audio"in t){var i=c(this);i?(e.audio=i,this.a.audio=i):delete this.a.audio}return"video"in t&&((i=l(this))?(e.video=i,this.a.video=i):delete this.a.video),"text"in t&&(e.text=t.text.streams[0]),this.c=Date.now(),e},h.prototype.chooseStreams=h.prototype.chooseStreams,h.prototype.enable=function(){this.f=!0},h.prototype.enable=h.prototype.enable,h.prototype.disable=function(){this.f=!1},h.prototype.disable=h.prototype.disable,h.prototype.segmentDownloaded=function(t,e,i){var n=this.b;if(e-=t,16e3>i||(t=8e3*i/e,e/=1e3,n.a+=i,r(n.c,e,t),r(n.f,e,t)),null!=this.c&&this.f)t:{if(this.i){if(8e3>Date.now()-this.c)break t}else{if(!(128e3<=this.b.a))break t;this.i=!0}i={},(n=c(this))&&(i.audio=n,this.a.audio=n),(n=l(this))&&(i.video=n,this.a.video=n),this.c=Date.now(),this.b.getBandwidthEstimate(),this.g(i)}},h.prototype.segmentDownloaded=h.prototype.segmentDownloaded,h.prototype.getBandwidthEstimate=function(){return this.b.getBandwidthEstimate()},h.prototype.getBandwidthEstimate=h.prototype.getBandwidthEstimate,h.prototype.setDefaultEstimate=function(t){this.b.setDefaultEstimate(t)},h.prototype.setDefaultEstimate=h.prototype.setDefaultEstimate;var Wr=/^(?:([^:\/?#.]+):)?(?:\/\/(?:([^\/?#]*)@)?([^\/#?]*?)(?::([0-9]+))?(?=[\/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/;$r=d.prototype,$r.R="",$r.ka="",$r.T="",$r.wa=null,$r.O="",$r.ca="",$r.toString=function(){var t=[],e=this.R;if(e&&t.push(g(e,Xr,!0),":"),e=this.T){t.push("//");var i=this.ka;i&&t.push(g(i,Xr,!0),"@"),t.push(encodeURIComponent(e).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e=this.wa,null!=e&&t.push(":",String(e))}return(e=this.O)&&(this.T&&"/"!=e.charAt(0)&&t.push("/"),t.push(g(e,"/"==e.charAt(0)?Zr:Jr,!0))),(e=this.a.toString())&&t.push("?",e),(e=this.ca)&&t.push("#",g(e,ts)),t.join("")},$r.resolve=function(t){var e=new d(this);"data"===e.R&&(e=new d);var i=!!t.R;i?p(e,t.R):i=!!t.ka,i?e.ka=t.ka:i=!!t.T,i?e.T=t.T:i=null!=t.wa;var n=t.O;if(i)m(e,t.wa);else if(i=!!t.O){if("/"!=n.charAt(0))if(this.T&&!this.O)n="/"+n;else{var r=e.O.lastIndexOf("/");-1!=r&&(n=e.O.substr(0,r+1)+n)}if(".."==n||"."==n)n="";else if(-1!=n.indexOf("./")||-1!=n.indexOf("/.")){for(var r=!n.lastIndexOf("/",0),n=n.split("/"),s=[],a=0;ai||n&&1e3>i)&&(this.a.splice(e,1),t.close()),W(this.v)}},$r.yc=function(){V(this.w,function(t,e){return"expired"==e})&&this.h(new S(6,6014)),this.J(this.w)};var is={},ns={};e("shaka.media.ManifestParser.registerParserByExtension",function(t,e){ns[t]=e}),e("shaka.media.ManifestParser.registerParserByMime",function(t,e){is[t]=e});var rs={};e("shaka.media.TextEngine.registerParser",function(t,e){rs[t]=e}),e("shaka.media.TextEngine.unregisterParser",function(t){delete rs[t]}),e("shaka.media.TextEngine.makeCue",vt);var ss=t.VTTCue||t.TextTrackCue;gt.prototype.o=function(){return this.c&&St(this,function(){return!0}),this.c=this.h=null,Promise.resolve()},gt.prototype.remove=function(t,e){return Promise.resolve().then(function(){this.c&&(St(this,function(i){return!(i.startTime>=e||i.endTime<=t)}),null==this.b||e<=this.b||t>=this.a||(t<=this.b&&e>=this.a?this.b=this.a=null:t<=this.b&&ethis.b&&e>=this.a&&(this.a=t)))}.bind(this))},$r=Pt.prototype,$r.o=function(){this.i=!0;var t,e=[];for(t in this.a){var i=this.a[t],n=i[0];for(this.a[t]=i.slice(0,1),n&&e.push(n.p["catch"](P)),n=1;n=this.a.duration-.05||this.a.ended;this.h?(e||t>=this.j)&&qt(this,!1):!e&&.5>t&&qt(this,!0)},$r.Ta=function(){return this.g},$r.lc=function(){this.a.playbackRate!=(this.h||0>this.g?0:this.g)&&zt(this,this.a.playbackRate)},$r.sb=function(){this.b.ja(this.a,"loadedmetadata");var t=Vt(this);.001>Math.abs(this.a.currentTime-t)?(L(this.b,this.a,"seeking",this.ub.bind(this)),L(this.b,this.a,"playing",this.tb.bind(this))):(L(this.b,this.a,"seeking",this.nc.bind(this)),this.a.currentTime=t)},$r.nc=function(){this.b.ja(this.a,"seeking"),L(this.b,this.a,"seeking",this.ub.bind(this)),L(this.b,this.a,"playing",this.tb.bind(this))},$r.ub=function(){var t=this.a.currentTime,e=$t(this,t);.001this.ma.indexOf(t.id)}.bind(this))},Ue.prototype.getTracks=Ue.prototype.getTracks,Ue.prototype.Gc=function(t,e){if(this.b){var i=ee(ue(this.b),t);if(i){var n=i.stream;n.allowedByApplication&&n.allowedByKeySystem&&(this.C.push({timestamp:Date.now()/1e3,id:n.id,type:t.type,fromAdaptation:!1}),i={},i[t.type]=n,"text"!=t.type&&(n=he(this.b).text,this.configure({abr:{enabled:!1}}),i.text=n),He(this,i,e))}}},Ue.prototype.selectTrack=Ue.prototype.Gc,Ue.prototype.bc=function(){return"showing"==this.s.mode},Ue.prototype.isTextTrackVisible=Ue.prototype.bc,Ue.prototype.Ic=function(t){this.s.mode=t?"showing":"hidden",Xe(this)},Ue.prototype.setTextTrackVisibility=Ue.prototype.Ic,Ue.prototype.getStats=function(){Ge(this);var t={},e={},i=this.f&&this.f.getVideoPlaybackQuality?this.f.getVideoPlaybackQuality():{};return this.b&&(e=he(this.b),t=e.video||{},e=e.audio||{}),{width:t.width||0,height:t.height||0,streamBandwidth:t.bandwidth+e.bandwidth||0,decodedFrames:Number(i.totalVideoFrames),droppedFrames:Number(i.droppedVideoFrames),estimatedBandwidth:this.a.abr.manager.getBandwidthEstimate(),playTime:this.pa,bufferingTime:this.J,switchHistory:this.C.slice(0)}},Ue.prototype.getStats=Ue.prototype.getStats,Ue.prototype.addTextTrack=function(t,e,i,n,r){if(!this.b)return Promise.reject();for(var s,a=ue(this.b),o=0;oe&&(e+=Math.pow(2,32)),e=e.toString(16)),this.Z(new S(3,3016,t,e))}}},$r.Mc=function(t){var e=["output-restricted","internal-error"],i=ue(this.b),n=!1;i.streamSets.forEach(function(i){i.streams.forEach(function(i){var r=i.allowedByKeySystem;i.keyId&&i.keyId in t&&(i.allowedByKeySystem=0>e.indexOf(t[i.keyId])),r!=i.allowedByKeySystem&&(n=!0)})}),$e(this,i),n&&We(this)};var cs="ended play playing pause pausing ratechange seeked seeking timeupdate volumechange".split(" "),ls="buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume".split(" "),fs=["loop","playbackRate"],ds=["pause","play"],ps=["adaptation","buffering","error","texttrackvisibility","trackschanged"],ms="getConfiguration getManifestUri getPlaybackRate getTracks getStats isBuffering isLive isTextTrackVisible seekRange".split(" "),ys=[["getConfiguration","configure"]],bs=[["isTextTrackVisible","setTextTrackVisibility"]],gs="configure resetConfiguration trickPlay cancelTrickPlay selectTrack setTextTrackVisibility addTextTrack".split(" "),vs=["load","unload"];$r=ti.prototype,$r.o=function(){return ei(this),this.a&&(this.a.stop(function(){},function(){}),this.a=null),this.A=this.w=this.l=null,this.f=this.j=this.g=!1,this.h=this.c=this.b=this.a=this.i=null,Promise.resolve()},$r.N=function(){return this.f},$r.ab=function(){return this.v},$r.init=function(){if(t.chrome&&chrome.cast&&chrome.cast.isAvailable){delete t.__onGCastApiAvailable,this.g=!0,this.l();var e=new chrome.cast.SessionRequest(this.C),e=new chrome.cast.ApiConfig(e,this.fc.bind(this),this.mc.bind(this),"origin_scoped");chrome.cast.initialize(e,function(){},function(){})}else t.__onGCastApiAvailable=function(t){t&&this.init()}.bind(this)},$r.cb=function(t){this.i=t,this.f&&ii(this,{type:"appData",appData:this.i})},$r.cast=function(t){return this.g?this.j?this.f?Promise.reject(new S(8,8002)):(this.h=new R,chrome.cast.requestSession(this.Za.bind(this,t),this.pb.bind(this)),this.h):Promise.reject(new S(8,8001)):Promise.reject(new S(8,8e3))},$r.get=function(t,e){if("video"==t){if(0<=ds.indexOf(e))return this.Ab.bind(this,t,e)}else if("player"==t){if(0<=gs.indexOf(e))return this.Ab.bind(this,t,e);if(0<=vs.indexOf(e))return this.Bc.bind(this,t,e);if(0<=ms.indexOf(e))return this.xb.bind(this,t,e)}return this.xb(t,e)},$r.set=function(t,e,i){this.b[t][e]=i,ii(this,{type:"set",targetName:t,property:e,value:i})},$r.Za=function(t,e){this.a=e,this.a.addUpdateListener(this.qb.bind(this)),this.a.addMessageListener("urn:x-cast:com.google.shaka.v2",this.gc.bind(this)),this.qb(),ii(this,{type:"init",initState:t,appData:this.i}),this.h.resolve()},$r.pb=function(t){var e=8003;switch(t.code){case"cancel":e=8004;break;case"timeout":e=8005;break;case"receiver_unavailable":e=8006}this.h.reject(new S(8,e,t))},$r.xb=function(t,e){return this.b[t][e]},$r.Ab=function(t,e){ii(this,{type:"call",targetName:t,methodName:e,args:Array.prototype.slice.call(arguments,2)})},$r.Bc=function(t,e){var i=Array.prototype.slice.call(arguments,2),n=new R,r=this.m.toString();return this.m++,this.c[r]=n,ii(this,{type:"asyncCall",targetName:t,methodName:e,args:i,id:r}),n},$r.fc=function(t){var e=this.s();this.h=new R,this.Za(e,t)},$r.mc=function(t){this.j="available"==t,this.l()},$r.qb=function(){var t=!!this.a&&"connected"==this.a.status;if(this.f&&!t){this.A();for(var e in this.b)this.b[e]={};ei(this)}this.v=(this.f=t)?this.a.receiver.friendlyName:"",this.l()},$r.gc=function(t,e){var i=Ze(e);switch(i.type){case"event":var n=i.targetName,r=i.event;this.w(n,new Le(r.type,r));break;case"update":r=i.update;for(n in r){var s,i=this.b[n]||{};for(s in r[n])i[s]=r[n][s]}break;case"asyncComplete":if(n=i.id,s=i.error,i=this.c[n],delete this.c[n],i)if(s){n=new S(s.category,s.code);for(r in s)n[r]=s[r];i.reject(n)}else i.resolve()}},i(ni),e("shaka.cast.CastProxy",ni),ni.prototype.o=function(){var t=[this.i?this.i.o():null,this.b?this.b.o():null,this.a?this.a.o():null];return this.a=this.i=this.j=this.l=this.b=this.c=null,Promise.all(t)},ni.prototype.destroy=ni.prototype.o,ni.prototype.Yb=function(){return this.l},ni.prototype.getVideo=ni.prototype.Yb,ni.prototype.Wb=function(){return this.j},ni.prototype.getPlayer=ni.prototype.Wb,ni.prototype.Mb=function(){return!!this.a&&(this.a.g&&this.a.j)},ni.prototype.canCast=ni.prototype.Mb,ni.prototype.N=function(){return!!this.a&&this.a.N()},ni.prototype.isCasting=ni.prototype.N,ni.prototype.ab=function(){return this.a?this.a.ab():""},ni.prototype.receiverName=ni.prototype.ab,ni.prototype.cast=function(){var t=this.mb();return this.a.cast(t).then(function(){return this.b.hb()}.bind(this))},ni.prototype.cast=ni.prototype.cast,ni.prototype.cb=function(t){this.a.cb(t)},ni.prototype.setAppData=ni.prototype.cb,ni.prototype.Xc=function(){var t=this.a;if(t.f){var e=t.s();chrome.cast.requestSession(t.Za.bind(t,e),t.pb.bind(t))}},ni.prototype.suggestDisconnect=ni.prototype.Xc,$r=ni.prototype,$r.mb=function(){var t={video:{},player:{},playerAfterLoad:{},manifest:this.b.na,startTime:null};return this.c.pause(),fs.forEach(function(e){t.video[e]=this.c[e]}.bind(this)),this.c.ended||(t.startTime=this.c.currentTime),ys.forEach(function(e){var i=e[1];e=this.b[e[0]](),t.player[i]=e}.bind(this)),bs.forEach(function(e){var i=e[1];e=this.b[e[0]](),t.playerAfterLoad[i]=e}.bind(this)),t},$r.Pc=function(){this.dispatchEvent(new Le("caststatuschanged"))},$r.Rc=function(){ys.forEach(function(t){var e=t[1];t=this.a.get("player",t[0])(),this.b[e](t)}.bind(this));var t=this.a.get("player","getManifestUri")(),e=this.a.get("video","ended"),i=Promise.resolve(),n=this.c.autoplay,r=null;e||(r=this.a.get("video","currentTime")),t&&(this.c.autoplay=!1,i=this.b.load(t,r),i["catch"](function(t){this.b.dispatchEvent(new Le("error",{detail:t}))}.bind(this)));var s={};fs.forEach(function(t){s[t]=this.a.get("video",t)}.bind(this)),i.then(function(){fs.forEach(function(t){this.c[t]=s[t]}.bind(this)),bs.forEach(function(t){var e=t[1];t=this.a.get("player",t[0])(),this.b[e](t)}.bind(this)),this.c.autoplay=n,t&&this.c.play()}.bind(this))},$r.bd=function(t){if("addEventListener"==t)return this.g.addEventListener.bind(this.g);if("removeEventListener"==t)return this.g.removeEventListener.bind(this.g);if(this.a.N()&&!Object.keys(this.a.b.video).length){var e=this.c[t];if("function"!=typeof e)return e}return this.a.N()?this.a.get("video",t):(e=this.c[t],"function"==typeof e&&(e=e.bind(this.c)),e)},$r.dd=function(t,e){this.a.N()?this.a.set("video",t,e):this.c[t]=e},$r.cd=function(t){this.a.N()||this.g.dispatchEvent(new Le(t.type,t))},$r.wc=function(t){return"addEventListener"==t?this.f.addEventListener.bind(this.f):"removeEventListener"==t?this.f.removeEventListener.bind(this.f):"getNetworkingEngine"==t?this.b.nb.bind(this.b):this.a.N()&&!Object.keys(this.a.b.video).length&&0<=ms.indexOf(t)||!this.a.N()?(t=this.b[t],t.bind(this.b)):this.a.get("player",t)},$r.xc=function(t){this.a.N()||this.f.dispatchEvent(t)},$r.Qc=function(t,e){this.a.N()&&("video"==t?this.g.dispatchEvent(e):"player"==t&&this.f.dispatchEvent(e))},i(si),e("shaka.cast.CastReceiver",si),si.prototype.$b=function(){return this.i},si.prototype.isConnected=si.prototype.$b,si.prototype.ac=function(){return this.c},si.prototype.isIdle=si.prototype.ac,si.prototype.o=function(){var e=this.a?this.a.o():Promise.resolve();return null!=this.f&&t.clearTimeout(this.f),this.l=this.j=this.a=this.b=null,this.i=!1,this.c=!0,this.f=this.g=null,e.then(function(){cast.receiver.CastReceiverManager.getInstance().stop()})},si.prototype.destroy=si.prototype.o,$r=si.prototype,$r.vb=function(){this.i=!!cast.receiver.CastReceiverManager.getInstance().getSenders().length,oi(this)},$r.yb=function(t,e){this.$a(),hi(this,{type:"event",targetName:t,event:e})},$r.$a=function(){null!=this.f&&t.clearTimeout(this.f),this.f=t.setTimeout(this.$a.bind(this),500);var e={video:{},player:{}};ls.forEach(function(t){e.video[t]=this.b[t]}.bind(this)),ms.forEach(function(t){e.player[t]=this.a[t]()}.bind(this));var i=cast.receiver.CastReceiverManager.getInstance().getSystemVolume();i&&(e.video.volume=i.level,e.video.muted=i.muted),hi(this,{type:"update",update:e})},$r.Tb=function(){var t=cast.receiver.CastReceiverManager.getInstance().getSystemVolume();t&&hi(this,{type:"update",update:{video:{volume:t.level,muted:t.muted}}}),hi(this,{type:"event",targetName:"video",event:{type:"volumechange"}})},$r.hc=function(t){var e=Ze(t.data);switch(e.type){case"init":ui(this,e.initState,e.appData),this.$a();break;case"appData":this.l(e.appData);break;case"set":var i=e.targetName,n=e.property,r=e.value;if("video"==i){if(e=cast.receiver.CastReceiverManager.getInstance(),"volume"==n){e.setSystemVolumeLevel(r);break}if("muted"==n){e.setSystemVolumeMuted(r);break}}this.j[i][n]=r;break;case"call":i=e.targetName,n=e.methodName,r=e.args,i=this.j[i],i[n].apply(i,r);break;case"asyncCall":i=e.targetName,n=e.methodName,r=e.args,e=e.id,t=t.senderId,i=this.j[i],i[n].apply(i,r).then(this.Eb.bind(this,t,e,null),this.Eb.bind(this,t,e))}},$r.Eb=function(t,e,i){hi(this,{type:"asyncComplete",id:e,error:i},t)};var ws={"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"},Es=1/15,Ss=1;e("shaka.media.SegmentIndex",Gi),Gi.prototype.o=function(){return this.a=null,Promise.resolve()},Gi.prototype.destroy=Gi.prototype.o,Gi.prototype.find=function(t){for(var e=this.a.length-1;0<=e;--e){var i=this.a[e];if(t>=i.startTime&&tt||t>=this.a.length?null:this.a[t]):null},Gi.prototype.get=Gi.prototype.get,Gi.prototype.Xa=function(t){for(var e=[],i=0,n=0;is.startTime||(.1t);++e);this.a.splice(0,e)},Gi.prototype.evict=Gi.prototype.Sa;var Ts;e("shaka.dash.DashParser",dn),$r=dn.prototype,$r.configure=function(t){this.c=t},$r.start=function(t,e,i,n,r){return this.h=[t],this.a=e,this.j=i,this.l=n,this.m=r,pn(this).then(function(){return this.a&&bn(this,0),this.b}.bind(this))},$r.stop=function(){return this.a&&this.a.Kb(this.Ka),this.c=this.m=this.l=this.j=this.a=null,this.h=[],this.b=null,this.g=[],this.i={},null!=this.f&&(t.clearTimeout(this.f),this.f=null),Promise.resolve()},$r.uc=function(t,e){t.P=gn(e,t.K,null);var i=!1,n=li(e,"Role"),r=void 0;"text"==t.P.contentType&&(r="subtitle");for(var s=0;si.length)return null;var n=null;if(t=kn.pa(t,e))for(e=0;et[0].indexOf("-->")&&(r=t[0],t.splice(0,1));var s=new In(t[0]),a=Nn.a(s),o=_n(s,/[ \t]+--\x3e[ \t]+/g),u=Nn.a(s);if(null==a||!o||null==u)throw new S(2,2001);if(a+=e,u+=e,n&&(a+=i,u+=i),t=vt(a,u,t.slice(1).join("\n").trim()),!t)return null;for(_n(s,/[ \t]+/gm),e=Rn(s);e;)Nn.j(t,e),_n(s,/[ \t]+/gm),e=Rn(s);return null!=r&&(t.id=r),t},Nn.j=function(t,e){var i;(i=/^align:(start|middle|center|end|left|right)$/.exec(e))?(t.align=i[1],"center"==i[1]&&"center"!=t.align&&(t.position="auto",t.align="middle")):(i=/^vertical:(lr|rl)$/.exec(e))?t.vertical=i[1]:(i=/^size:(\d{1,2}|100)%$/.exec(e))?t.size=Number(i[1]):(i=/^position:(\d{1,2}|100)%(?:,(line-left|line-right|center|start|end))?$/.exec(e))?(t.position=Number(i[1]),i[2]&&(t.positionAlign=i[2])):(i=/^line:(\d{1,2}|100)%(?:,(start|end|center))?$/.exec(e))?(t.snapToLines=!1,t.line=Number(i[1]),i[2]&&(t.lineAlign=i[2])):(i=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(e))&&(t.snapToLines=!0,t.line=Number(i[1]),i[2]&&(t.lineAlign=i[2]))},Nn.a=function(t){if(t=_n(t,/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3})/g),!t)return null;var e=Number(t[2]),i=Number(t[3]);return 59=t.height});i.sort(function(t,e){return e.bandwidth-t.bandwidth}),i.length&&e.push(i[0]);for(var n=Jt(this.c.getConfiguration().preferredAudioLanguage),i=[0,as,os],r=t.filter(function(t){return"audio"==t.type}),i=i.map(function(t){return r.filter(function(e){return e=Jt(e.language),Xt(t,n,e)})}),s=r,a=0;ae.indexOf("Apple")||(0<=i.indexOf("Version/8")?t.MediaSource=null:0<=i.indexOf("Version/9")?Mr():0<=i.indexOf("Version/10")&&(Mr(),xr()))}});var Rs=0;Lr.prototype.then=function(t,e){var i=new Lr;switch(this.ia){case 1:Kr(this,i,t);break;case 2:Kr(this,i,e);break;case Rs:this.c.push({I:i,Da:t}),this.b.push({I:i,Da:e})}return i},Lr.prototype["catch"]=function(t){return this.then(void 0,t)},Lr.prototype.W=function(t){if(this.ia==Rs){for(this.Oa=t,this.ia=1,t=0;t= 720;this.trigger(_clappr.Events.PLAYBACK_HIGHDEFINITIONUPDATE,this.highDefinition);this.trigger(_clappr.Events.PLAYBACK_BITRATE,{bandwidth:activeVideo.bandwidth,width:activeVideo.width,height:activeVideo.height,level:activeVideo.id});}},{key:'_destroy',value:function _destroy(){_get(Object.getPrototypeOf(DashShakaPlayback.prototype),'destroy',this).call(this);this._isShakaReadyState = false;_clappr.Log.debug('shaka was destroyed');}},{key:'_shakaReady',value:function _shakaReady(){_get(Object.getPrototypeOf(DashShakaPlayback.prototype),'_ready',this).call(this);}},{key:'isReady',get:function get(){return this._isShakaReadyState;}},{key:'textTracks',get:function get(){return this._player && this._player.getTracks().filter(function(t){return t.type === 'text';});}},{key:'audioTracks',get:function get(){return this._player && this._player.getTracks().filter(function(t){return t.type === 'audio';});}},{key:'videoTracks',get:function get(){return this._player && this._player.getTracks().filter(function(t){return t.type === 'video';});}}]);return DashShakaPlayback;})(_clappr.HTML5Video);exports['default'] = DashShakaPlayback;DashShakaPlayback.canPlay = function(resource){var mimeType=arguments.length <= 1 || arguments[1] === undefined?'':arguments[1];_shakaPlayer2['default'].polyfill.installAll();var browserSupported=_shakaPlayer2['default'].Player.isBrowserSupported();var resourceParts=resource.split('?')[0].match(/.*\.(.*)$/) || [];return browserSupported && ('mpd' === resourceParts[1] || mimeType.indexOf('application/dash+xml') > -1);};module.exports = exports['default']; + +/***/ }, +/* 1 */ +/***/ function(module, exports) { + + module.exports = __WEBPACK_EXTERNAL_MODULE_1__; + +/***/ }, +/* 2 */ +/***/ function(module, exports, __webpack_require__) { + + var __WEBPACK_AMD_DEFINE_RESULT__;"use strict";(function(){var g={};(function(window){var k,aa=this;aa.ed = !0;function m(a,b){var c=a.split("."),d=aa;c[0] in d || !d.execScript || d.execScript("var " + c[0]);for(var e;c.length && (e = c.shift());) c.length || void 0 === b?d[e]?d = d[e]:d = d[e] = {}:d[e] = b;}function ba(a){var b=p;function c(){}c.prototype = b.prototype;a.md = b.prototype;a.prototype = new c();a.prototype.constructor = a;a.fd = function(a,c,f){return b.prototype[c].apply(a,Array.prototype.slice.call(arguments,2));};}; /* + + Copyright 2016 Google Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */function ca(a){this.c = Math.exp(Math.log(.5) / a);this.b = this.a = 0;}function da(a,b,c){var d=Math.pow(a.c,b);c = c * (1 - d) + d * a.a;isNaN(c) || (a.a = c,a.b += b);}function ea(a){return a.a / (1 - Math.pow(a.c,a.b));};function fa(){this.c = new ca(2);this.f = new ca(5);this.a = 0;this.b = 5E5;}fa.prototype.setDefaultEstimate = function(a){this.b = a;};fa.prototype.getBandwidthEstimate = function(){return 128E3 > this.a?this.b:Math.min(ea(this.c),ea(this.f));};function ga(){}function ha(){};function q(){this.g = null;this.f = !1;this.b = new fa();this.h = {};this.a = {};this.i = !1;this.c = null;}m("shaka.abr.SimpleAbrManager",q);q.prototype.stop = function(){this.g = null;this.f = !1;this.h = {};this.a = {};this.c = null;};q.prototype.stop = q.prototype.stop;q.prototype.init = function(a){this.g = a;};q.prototype.init = q.prototype.init;q.prototype.chooseStreams = function(a){for(var b in a) this.h[b] = a[b];b = {};if("audio" in a){var c=ia(this);c?(b.audio = c,this.a.audio = c):delete this.a.audio;}"video" in a && ((c = ja(this))?(b.video = c,this.a.video = c):delete this.a.video);"text" in a && (b.text = a.text.streams[0]);this.c = Date.now();return b;};q.prototype.chooseStreams = q.prototype.chooseStreams;q.prototype.enable = function(){this.f = !0;};q.prototype.enable = q.prototype.enable;q.prototype.disable = function(){this.f = !1;};q.prototype.disable = q.prototype.disable;q.prototype.segmentDownloaded = function(a,b,c){var d=this.b;b -= a;16E3 > c || (a = 8E3 * c / b,b /= 1E3,d.a += c,da(d.c,b,a),da(d.f,b,a));if(null != this.c && this.f)a: {if(!this.i){if(!(128E3 <= this.b.a))break a;this.i = !0;}else if(8E3 > Date.now() - this.c)break a;c = {};if(d = ia(this))c.audio = d,this.a.audio = d;if(d = ja(this))c.video = d,this.a.video = d;this.c = Date.now();this.b.getBandwidthEstimate();this.g(c);}};q.prototype.segmentDownloaded = q.prototype.segmentDownloaded;q.prototype.getBandwidthEstimate = function(){return this.b.getBandwidthEstimate();};q.prototype.getBandwidthEstimate = q.prototype.getBandwidthEstimate;q.prototype.setDefaultEstimate = function(a){this.b.setDefaultEstimate(a);};q.prototype.setDefaultEstimate = q.prototype.setDefaultEstimate;function ia(a){a = a.h.audio;if(!a)return null;a = ka(a);return a[Math.floor(a.length / 2)];}function ja(a){var b=a.h.video;if(!b)return null;var b=ka(b),c=a.a.audio,c=c && c.bandwidth || 0;a = a.b.getBandwidthEstimate();for(var d=b[0],e=0;e < b.length;++e) {var f=b[e];if(f.bandwidth){var g=((e + 1 < b.length?b[e + 1]:{bandwidth:Infinity}).bandwidth + c) / .85;a >= (f.bandwidth + c) / .95 && a <= g && (d = f);}}return d;}function ka(a){return a.streams.slice(0).filter(function(a){return a.allowedByApplication && a.allowedByKeySystem;}).sort(function(a,c){return a.bandwidth - c.bandwidth;});};function t(a,b){var c=b || {},d;for(d in c) this[d] = c[d];this.defaultPrevented = this.cancelable = this.bubbles = !1;this.timeStamp = window.performance && window.performance.now?window.performance.now():Date.now();this.type = a;this.isTrusted = !1;this.target = this.currentTarget = null;this.a = !1;}t.prototype.preventDefault = function(){};t.prototype.stopImmediatePropagation = function(){this.a = !0;};t.prototype.stopPropagation = function(){};var la="ended play playing pause pausing ratechange seeked seeking timeupdate volumechange".split(" "),ma="buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume".split(" "),na=["loop","playbackRate"],oa=["pause","play"],pa="adaptation buffering emsg error loading unloading texttrackvisibility trackschanged".split(" "),qa="drmInfo getConfiguration getManifestUri getPlaybackRate getPlayheadTimeAsDate getTracks getStats isBuffering isInProgress isLive isTextTrackVisible keySystem seekRange".split(" "),ra=[["getConfiguration","configure"]],sa=[["isTextTrackVisible","setTextTrackVisibility"]],ta="addTextTrack cancelTrickPlay configure resetConfiguration selectTrack setTextTrackVisibility trickPlay".split(" "),ua=["load","unload"];function va(a){return JSON.stringify(a,function(a,c){if("manager" != a && "function" != typeof c){if(c instanceof Event || c instanceof t){var b={},e;for(e in c) {var f=c[e];f && "object" == typeof f || e in Event || (b[e] = f);}return b;}if(c instanceof TimeRanges)for(b = {__type__:"TimeRanges",length:c.length,start:[],end:[]},e = 0;e < c.length;++e) b.start.push(c.start(e)),b.end.push(c.end(e));else b = "number" == typeof c?isNaN(c)?"NaN":isFinite(c)?c:0 > c?"-Infinity":"Infinity":c;return b;}});}function wa(a){return JSON.parse(a,function(a,c){return "NaN" == c?NaN:"-Infinity" == c?-Infinity:"Infinity" == c?Infinity:c && "object" == typeof c && "TimeRanges" == c.__type__?xa(c):c;});}function xa(a){return {length:a.length,start:function start(b){return a.start[b];},end:function end(b){return a.end[b];}};};function w(a,b,c){this.category = a;this.code = b;this.data = Array.prototype.slice.call(arguments,2);}m("shaka.util.Error",w);w.prototype.toString = function(){return "shaka.util.Error " + JSON.stringify(this,null," ");};w.Category = {NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9};w.Code = {UNSUPPORTED_SCHEME:1E3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,UNKNOWN_DATA_URI_ENCODING:1005,INVALID_TEXT_HEADER:2E3,INVALID_TEXT_CUE:2001,UNABLE_TO_DETECT_ENCODING:2003,BAD_ENCODING:2004,INVALID_XML:2005,INVALID_TTML:2006,INVALID_MP4_TTML:2007,INVALID_MP4_VTT:2008,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,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,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,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,INDEXED_DB_NOT_SUPPORTED:9E3,INDEXED_DB_ERROR:9001,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};function ya(){}m("shaka.util.IDestroyable",ya);ya.prototype.o = function(){};ya.prototype.destroy = ya.prototype.o;function x(){var a,b,c=new Promise(function(c,e){a = c;b = e;});c.resolve = a;c.reject = b;return c;};function za(a,b,c,d,e){this.C = a;this.l = b;this.w = c;this.A = d;this.s = e;this.f = this.j = this.g = !1;this.v = "";this.a = this.i = null;this.b = {video:{},player:{}};this.m = 0;this.c = {};this.h = null;}k = za.prototype;k.o = function(){Aa(this);this.a && (this.a.stop(function(){},function(){}),this.a = null);this.A = this.w = this.l = null;this.f = this.j = this.g = !1;this.h = this.c = this.b = this.a = this.i = null;return Promise.resolve();};k.N = function(){return this.f;};k.ab = function(){return this.v;};k.init = function(){if(window.chrome && chrome.cast && chrome.cast.isAvailable){delete window.__onGCastApiAvailable;this.g = !0;this.l();var a=new chrome.cast.SessionRequest(this.C),a=new chrome.cast.ApiConfig(a,this.fc.bind(this),this.mc.bind(this),"origin_scoped");chrome.cast.initialize(a,function(){},function(){});}else window.__onGCastApiAvailable = (function(a){a && this.init();}).bind(this);};k.cb = function(a){this.i = a;this.f && Ba(this,{type:"appData",appData:this.i});};k.cast = function(a){if(!this.g)return Promise.reject(new w(8,8E3));if(!this.j)return Promise.reject(new w(8,8001));if(this.f)return Promise.reject(new w(8,8002));this.h = new x();chrome.cast.requestSession(this.Za.bind(this,a),this.qb.bind(this));return this.h;};k.get = function(a,b){if("video" == a){if(0 <= oa.indexOf(b))return this.Bb.bind(this,a,b);}else if("player" == a){if(0 <= ta.indexOf(b))return this.Bb.bind(this,a,b);if(0 <= ua.indexOf(b))return this.Bc.bind(this,a,b);if(0 <= qa.indexOf(b))return this.yb.bind(this,a,b);}return this.yb(a,b);};k.set = function(a,b,c){this.b[a][b] = c;Ba(this,{type:"set",targetName:a,property:b,value:c});};k.Za = function(a,b){this.a = b;this.a.addUpdateListener(this.rb.bind(this));this.a.addMessageListener("urn:x-cast:com.google.shaka.v2",this.gc.bind(this));this.rb();Ba(this,{type:"init",initState:a,appData:this.i});this.h.resolve();};k.qb = function(a){var b=8003;switch(a.code){case "cancel":b = 8004;break;case "timeout":b = 8005;break;case "receiver_unavailable":b = 8006;}this.h.reject(new w(8,b,a));};k.yb = function(a,b){return this.b[a][b];};k.Bb = function(a,b){Ba(this,{type:"call",targetName:a,methodName:b,args:Array.prototype.slice.call(arguments,2)});};k.Bc = function(a,b){var c=Array.prototype.slice.call(arguments,2),d=new x(),e=this.m.toString();this.m++;this.c[e] = d;Ba(this,{type:"asyncCall",targetName:a,methodName:b,args:c,id:e});return d;};k.fc = function(a){var b=this.s();this.h = new x();this.Za(b,a);};k.mc = function(a){this.j = "available" == a;this.l();};k.rb = function(){var a=this.a?"connected" == this.a.status:!1;if(this.f && !a){this.A();for(var b in this.b) this.b[b] = {};Aa(this);}this.v = (this.f = a)?this.a.receiver.friendlyName:"";this.l();};function Aa(a){for(var b in a.c) {var c=a.c[b];delete a.c[b];c.reject(new w(7,7E3));}}k.gc = function(a,b){var c=wa(b);switch(c.type){case "event":var d=c.targetName,e=c.event;this.w(d,new t(e.type,e));break;case "update":e = c.update;for(d in e) {var c=this.b[d] || {},f;for(f in e[d]) c[f] = e[d][f];}break;case "asyncComplete":if((d = c.id,f = c.error,c = this.c[d],delete this.c[d],c))if(f){d = new w(f.category,f.code);for(e in f) d[e] = f[e];c.reject(d);}else c.resolve();}};function Ba(a,b){var c=va(b);a.a.sendMessage("urn:x-cast:com.google.shaka.v2",c,function(){},ga);};function Ca(){this.a = {};}k = Ca.prototype;k.push = function(a,b){this.a.hasOwnProperty(a)?this.a[a].push(b):this.a[a] = [b];};k.set = function(a,b){this.a[a] = b;};k.has = function(a){return this.a.hasOwnProperty(a);};k.get = function(a){return (a = this.a[a])?a.slice():null;};k.remove = function(a,b){var c=this.a[a];if(c)for(var d=0;d < c.length;++d) c[d] == b && (c.splice(d,1),--d);};k.keys = function(){var a=[],b;for(b in this.a) a.push(b);return a;};function y(){this.a = new Ca();}y.prototype.o = function(){Da(this);this.a = null;return Promise.resolve();};function z(a,b,c,d){b = new Ea(b,c,d);a.a.push(c,b);}y.prototype.ja = function(a,b){for(var c=this.a.get(b) || [],d=0;d < c.length;++d) {var e=c[d];e.target == a && (e.ja(),this.a.remove(b,e));}};function Da(a){var b=a.a,c=[],d;for(d in b.a) c.push.apply(c,b.a[d]);for(b = 0;b < c.length;++b) c[b].ja();a.a.a = {};}function Ea(a,b,c){this.target = a;this.type = b;this.a = c;this.target.addEventListener(b,c,!1);}Ea.prototype.ja = function(){this.target && (this.target.removeEventListener(this.type,this.a,!1),this.a = this.target = null);};function p(){this.Ba = new Ca();this.X = this;}m("shaka.util.FakeEventTarget",p);p.prototype.addEventListener = function(a,b){this.Ba.push(a,b);};p.prototype.addEventListener = p.prototype.addEventListener;p.prototype.removeEventListener = function(a,b){this.Ba.remove(a,b);};p.prototype.removeEventListener = p.prototype.removeEventListener;p.prototype.dispatchEvent = function(a){for(var b=this.Ba.get(a.type) || [],c=0;c < b.length;++c) {a.target = this.X;a.currentTarget = this.X;var d=b[c];try{d.handleEvent?d.handleEvent(a):d.call(this,a);}catch(e) {}if(a.a)break;}return a.defaultPrevented;};p.prototype.dispatchEvent = p.prototype.dispatchEvent;function A(a,b,c){p.call(this);this.c = a;this.b = b;this.i = this.f = this.g = this.j = this.l = null;this.a = new za(c,this.Pc.bind(this),this.Qc.bind(this),this.Rc.bind(this),this.nb.bind(this));Fa(this);}ba(A);m("shaka.cast.CastProxy",A);A.prototype.o = function(){var a=[this.i?this.i.o():null,this.b?this.b.o():null,this.a?this.a.o():null];this.a = this.i = this.j = this.l = this.b = this.c = null;return Promise.all(a);};A.prototype.destroy = A.prototype.o;A.prototype.Yb = function(){return this.l;};A.prototype.getVideo = A.prototype.Yb;A.prototype.Wb = function(){return this.j;};A.prototype.getPlayer = A.prototype.Wb;A.prototype.Mb = function(){return this.a?this.a.g && this.a.j:!1;};A.prototype.canCast = A.prototype.Mb;A.prototype.N = function(){return this.a?this.a.N():!1;};A.prototype.isCasting = A.prototype.N;A.prototype.ab = function(){return this.a?this.a.ab():"";};A.prototype.receiverName = A.prototype.ab;A.prototype.cast = function(){var a=this.nb();return this.a.cast(a).then((function(){return this.b.ib();}).bind(this));};A.prototype.cast = A.prototype.cast;A.prototype.cb = function(a){this.a.cb(a);};A.prototype.setAppData = A.prototype.cb;A.prototype.Xc = function(){var a=this.a;if(a.f){var b=a.s();chrome.cast.requestSession(a.Za.bind(a,b),a.qb.bind(a));}};A.prototype.suggestDisconnect = A.prototype.Xc;function Fa(a){a.a.init();a.i = new y();la.forEach((function(a){z(this.i,this.c,a,this.cd.bind(this));}).bind(a));pa.forEach((function(a){z(this.i,this.b,a,this.xc.bind(this));}).bind(a));a.l = {};for(var b in a.c) Object.defineProperty(a.l,b,{configurable:!1,enumerable:!0,get:a.bd.bind(a,b),set:a.dd.bind(a,b)});a.j = {};for(b in a.b) Object.defineProperty(a.j,b,{configurable:!1,enumerable:!0,get:a.wc.bind(a,b)});a.g = new p();a.g.X = a.l;a.f = new p();a.f.X = a.j;}k = A.prototype;k.nb = function(){var a={video:{},player:{},playerAfterLoad:{},manifest:this.b.oa,startTime:null};this.c.pause();na.forEach((function(b){a.video[b] = this.c[b];}).bind(this));this.c.ended || (a.startTime = this.c.currentTime);ra.forEach((function(b){var c=b[1];b = this.b[b[0]]();a.player[c] = b;}).bind(this));sa.forEach((function(b){var c=b[1];b = this.b[b[0]]();a.playerAfterLoad[c] = b;}).bind(this));return a;};k.Pc = function(){this.dispatchEvent(new t("caststatuschanged"));};k.Rc = function(){ra.forEach((function(a){var b=a[1];a = this.a.get("player",a[0])();this.b[b](a);}).bind(this));var a=this.a.get("player","getManifestUri")(),b=this.a.get("video","ended"),c=Promise.resolve(),d=this.c.autoplay,e=null;b || (e = this.a.get("video","currentTime"));a && (this.c.autoplay = !1,c = this.b.load(a,e),c["catch"]((function(a){this.b.dispatchEvent(new t("error",{detail:a}));}).bind(this)));var f={};na.forEach((function(a){f[a] = this.a.get("video",a);}).bind(this));c.then((function(){na.forEach((function(a){this.c[a] = f[a];}).bind(this));sa.forEach((function(a){var b=a[1];a = this.a.get("player",a[0])();this.b[b](a);}).bind(this));this.c.autoplay = d;a && this.c.play();}).bind(this));};k.bd = function(a){if("addEventListener" == a)return this.g.addEventListener.bind(this.g);if("removeEventListener" == a)return this.g.removeEventListener.bind(this.g);if(this.a.N() && !Object.keys(this.a.b.video).length){var b=this.c[a];if("function" != typeof b)return b;}return this.a.N()?this.a.get("video",a):(b = this.c[a],"function" == typeof b && (b = b.bind(this.c)),b);};k.dd = function(a,b){this.a.N()?this.a.set("video",a,b):this.c[a] = b;};k.cd = function(a){this.a.N() || this.g.dispatchEvent(new t(a.type,a));};k.wc = function(a){return "addEventListener" == a?this.f.addEventListener.bind(this.f):"removeEventListener" == a?this.f.removeEventListener.bind(this.f):"getNetworkingEngine" == a?this.b.ob.bind(this.b):this.a.N() && !Object.keys(this.a.b.video).length && 0 <= qa.indexOf(a) || !this.a.N()?(a = this.b[a],a.bind(this.b)):this.a.get("player",a);};k.xc = function(a){this.a.N() || this.f.dispatchEvent(a);};k.Qc = function(a,b){this.a.N() && ("video" == a?this.g.dispatchEvent(b):"player" == a && this.f.dispatchEvent(b));};function B(a,b,c){p.call(this);this.b = a;this.a = b;this.j = {video:a,player:b};this.l = c || function(){};this.i = !1;this.c = !0;this.f = this.g = null;Ga(this);}ba(B);m("shaka.cast.CastReceiver",B);B.prototype.$b = function(){return this.i;};B.prototype.isConnected = B.prototype.$b;B.prototype.ac = function(){return this.c;};B.prototype.isIdle = B.prototype.ac;B.prototype.o = function(){var a=this.a?this.a.o():Promise.resolve();null != this.f && window.clearTimeout(this.f);this.l = this.j = this.a = this.b = null;this.i = !1;this.c = !0;this.f = this.g = null;return a.then(function(){cast.receiver.CastReceiverManager.getInstance().stop();});};B.prototype.destroy = B.prototype.o;function Ga(a){var b=cast.receiver.CastReceiverManager.getInstance();b.onSenderConnected = a.wb.bind(a);b.onSenderDisconnected = a.wb.bind(a);b.onSystemVolumeChanged = a.Tb.bind(a);a.g = b.getCastMessageBus("urn:x-cast:com.google.shaka.v2");a.g.onMessage = a.hc.bind(a);b.start();la.forEach((function(a){this.b.addEventListener(a,this.zb.bind(this,"video"));}).bind(a));pa.forEach((function(a){this.a.addEventListener(a,this.zb.bind(this,"player"));}).bind(a));cast.__platform__ && cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=3840; height=2160')?a.a.eb(3840,2160):a.a.eb(1920,1080);a.a.addEventListener("loading",(function(){this.c = !1;Ha(this);}).bind(a));a.b.addEventListener("playing",(function(){this.c = !1;Ha(this);}).bind(a));a.a.addEventListener("unloading",(function(){this.c = !0;Ha(this);}).bind(a));a.b.addEventListener("ended",(function(){window.setTimeout((function(){this.b && this.b.ended && (this.c = !0,Ha(this));}).bind(this),5E3);}).bind(a));}k = B.prototype;k.wb = function(){this.i = !!cast.receiver.CastReceiverManager.getInstance().getSenders().length;Ha(this);};function Ha(a){Promise.resolve().then((function(){this.dispatchEvent(new t("caststatuschanged"));}).bind(a));}function Ia(a,b,c){for(var d in b.player) a.a[d](b.player[d]);a.l(c);c = Promise.resolve();var e=a.b.autoplay;b.manifest && (a.b.autoplay = !1,c = a.a.load(b.manifest,b.startTime),c["catch"]((function(a){this.a.dispatchEvent(new t("error",{detail:a}));}).bind(a)));c.then((function(){for(var a in b.video) {var c=b.video[a];this.b[a] = c;}for(a in b.playerAfterLoad) c = b.playerAfterLoad[a],this.a[a](c);this.b.autoplay = e;b.manifest && this.b.play();}).bind(a));}k.zb = function(a,b){this.$a();Ja(this,{type:"event",targetName:a,event:b});};k.$a = function(){null != this.f && window.clearTimeout(this.f);this.f = window.setTimeout(this.$a.bind(this),500);var a={video:{},player:{}};ma.forEach((function(b){a.video[b] = this.b[b];}).bind(this));qa.forEach((function(b){a.player[b] = this.a[b]();}).bind(this));var b=cast.receiver.CastReceiverManager.getInstance().getSystemVolume();b && (a.video.volume = b.level,a.video.muted = b.muted);Ja(this,{type:"update",update:a});};k.Tb = function(){var a=cast.receiver.CastReceiverManager.getInstance().getSystemVolume();a && Ja(this,{type:"update",update:{video:{volume:a.level,muted:a.muted}}});Ja(this,{type:"event",targetName:"video",event:{type:"volumechange"}});};k.hc = function(a){var b=wa(a.data);switch(b.type){case "init":Ia(this,b.initState,b.appData);this.$a();break;case "appData":this.l(b.appData);break;case "set":var c=b.targetName,d=b.property,e=b.value;if("video" == c)if((b = cast.receiver.CastReceiverManager.getInstance(),"volume" == d)){b.setSystemVolumeLevel(e);break;}else if("muted" == d){b.setSystemVolumeMuted(e);break;}this.j[c][d] = e;break;case "call":c = b.targetName;d = b.methodName;e = b.args;c = this.j[c];c[d].apply(c,e);break;case "asyncCall":c = b.targetName,d = b.methodName,e = b.args,b = b.id,a = a.senderId,c = this.j[c],c[d].apply(c,e).then(this.Eb.bind(this,a,b,null),this.Eb.bind(this,a,b));}};k.Eb = function(a,b,c){Ja(this,{type:"asyncComplete",id:b,error:c},a);};function Ja(a,b,c){a.i && (b = va(b),c?a.g.getCastChannel(c).send(b):a.g.broadcast(b));};function Ka(a,b){return a.reduce((function(a,b,e){return b["catch"](a.bind(null,e));}).bind(null,b),Promise.reject());}function C(a,b){return a.concat(b);}function D(){}function La(a){return null != a;}function Ma(a){return function(b){return b != a;};};function Na(a){return !a || !Object.keys(a).length;}function F(a){return Object.keys(a).map(function(b){return a[b];});}function Oa(a,b){return Object.keys(a).reduce(function(c,d){c[d] = b(a[d],d);return c;},{});}function Pa(a,b){return Object.keys(a).every(function(c){return b(c,a[c]);});};function Qa(a){return window.btoa(String.fromCharCode.apply(null,a)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=*$/,"");}function Ra(a){a = window.atob(a.replace(/-/g,"+").replace(/_/g,"/"));for(var b=new Uint8Array(a.length),c=0;c < a.length;++c) b[c] = a.charCodeAt(c);return b;}function Sa(a){for(var b=new Uint8Array(a.length / 2),c=0;c < a.length;c += 2) b[c / 2] = window.parseInt(a.substr(c,2),16);return b;}function Ta(a){for(var b="",c=0;c < a.length;++c) {var d=a[c].toString(16);1 == d.length && (d = "0" + d);b += d;}return b;}function Ua(a,b){if(!a && !b)return !0;if(!a || !b || a.length != b.length)return !1;for(var c=0;c < a.length;++c) if(a[c] != b[c])return !1;return !0;};function Va(a,b){var c=G(a,b);return 1 != c.length?null:c[0];}function G(a,b){return Array.prototype.filter.call(a.childNodes,function(a){return a.tagName == b;});}function Wa(a){var b=a.firstChild;return b && b.nodeType == Node.TEXT_NODE?a.textContent.trim():null;}function I(a,b,c,d){var e=null;a = a.getAttribute(b);null != a && (e = c(a));return null == e?void 0 !== d?d:null:e;}function Xa(a){if(!a)return null;a = Date.parse(a);return isNaN(a)?null:Math.floor(a / 1E3);}function J(a){if(!a)return null;a = /^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$/.exec(a);if(!a)return null;a = 31536E3 * Number(a[1] || null) + 2592E3 * Number(a[2] || null) + 86400 * Number(a[3] || null) + 3600 * Number(a[4] || null) + 60 * Number(a[5] || null) + Number(a[6] || null);return isFinite(a)?a:null;}function Ya(a){var b=/([0-9]+)-([0-9]+)/.exec(a);if(!b)return null;a = Number(b[1]);if(!isFinite(a))return null;b = Number(b[2]);return isFinite(b)?{start:a,end:b}:null;}function Za(a){a = Number(a);return a % 1?null:a;}function $a(a){a = Number(a);return !(a % 1) && 0 < a?a:null;}function ab(a){a = Number(a);return !(a % 1) && 0 <= a?a:null;}function bb(a){var b;a = (b = a.match(/^(\d+)\/(\d+)$/))?Number(b[1] / b[2]):Number(a);return isNaN(a)?null:a;};var db={"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"};function eb(a,b){var c=fb(a),d=null,e=c.filter(function(a){return "urn:mpeg:dash:mp4protection:2011" == a.Db?(d = a.init || d,!1):!0;}),f=c.map(function(a){return a.keyId;}).filter(La),g=null;if(0 < f.length && (g = f[0],f.some(Ma(g))))throw new w(4,4010);f = [];0 < e.length?(f = gb(d,b,e),f.length || (f = [hb("",d)])):0 < c.length && (f = F(db).map(function(a){return hb(a,d);}));return {kb:g,gd:d,drmInfos:f,mb:!0};}function ib(a,b,c){var d=eb(a,b);if(c.mb){a = 1 == c.drmInfos.length && !c.drmInfos[0].keySystem;b = !d.drmInfos.length;if(!c.drmInfos.length || a && !b)c.drmInfos = d.drmInfos;c.mb = !1;}else if(0 < d.drmInfos.length && (c.drmInfos = c.drmInfos.filter(function(a){return d.drmInfos.some(function(b){return b.keySystem == a.keySystem;});}),!c.drmInfos.length))throw new w(4,4008);return d.kb || c.kb;}function hb(a,b){return {keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:b || [],keyIds:[]};}function gb(a,b,c){return c.map(function(c){var d=db[c.Db];return d?[hb(d,c.init || a)]:b(c.node) || [];}).reduce(C,[]);}function fb(a){return a.map(function(a){var b=a.getAttribute("schemeIdUri"),d=a.getAttribute("cenc:default_KID"),e=G(a,"cenc:pssh").map(Wa);if(!b)return null;b = b.toLowerCase();if(d && (d = d.replace(/-/g,"").toLowerCase(),0 <= d.indexOf(" ")))throw new w(4,4009);var f=[];try{f = e.map(function(a){return {initDataType:"cenc",initData:Ra(a)};});}catch(g) {throw new w(4,4007);}return {node:a,Db:b,keyId:d,init:0 < f.length?f:null};}).filter(La);};var jb=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/;function kb(a){var b;a instanceof kb?(lb(this,a.S),this.ka = a.ka,this.U = a.U,mb(this,a.xa),this.O = a.O,nb(this,ob(a.a)),this.ca = a.ca):a && (b = String(a).match(jb))?(lb(this,b[1] || "",!0),this.ka = pb(b[2] || ""),this.U = pb(b[3] || "",!0),mb(this,b[4]),this.O = pb(b[5] || "",!0),nb(this,b[6] || "",!0),this.ca = pb(b[7] || "")):this.a = new qb(null);}k = kb.prototype;k.S = "";k.ka = "";k.U = "";k.xa = null;k.O = "";k.ca = "";k.toString = function(){var a=[],b=this.S;b && a.push(rb(b,sb,!0),":");if(b = this.U){a.push("//");var c=this.ka;c && a.push(rb(c,sb,!0),"@");a.push(encodeURIComponent(b).replace(/%25([0-9a-fA-F]{2})/g,"%$1"));b = this.xa;null != b && a.push(":",String(b));}if(b = this.O)this.U && "/" != b.charAt(0) && a.push("/"),a.push(rb(b,"/" == b.charAt(0)?tb:ub,!0));(b = this.a.toString()) && a.push("?",b);(b = this.ca) && a.push("#",rb(b,vb));return a.join("");};k.resolve = function(a){var b=new kb(this);"data" === b.S && (b = new kb());var c=!!a.S;c?lb(b,a.S):c = !!a.ka;c?b.ka = a.ka:c = !!a.U;c?b.U = a.U:c = null != a.xa;var d=a.O;if(c)mb(b,a.xa);else if(c = !!a.O){if("/" != d.charAt(0))if(this.U && !this.O)d = "/" + d;else {var e=b.O.lastIndexOf("/");-1 != e && (d = b.O.substr(0,e + 1) + d);}if(".." == d || "." == d)d = "";else if(-1 != d.indexOf("./") || -1 != d.indexOf("/.")){for(var e=!d.lastIndexOf("/",0),d=d.split("/"),f=[],g=0;g < d.length;) {var h=d[g++];"." == h?e && g == d.length && f.push(""):".." == h?((1 < f.length || 1 == f.length && "" != f[0]) && f.pop(),e && g == d.length && f.push("")):(f.push(h),e = !0);}d = f.join("/");}}c?b.O = d:c = "" !== a.a.toString();c?nb(b,ob(a.a)):c = !!a.ca;c && (b.ca = a.ca);return b;};function lb(a,b,c){a.S = c?pb(b,!0):b;a.S && (a.S = a.S.replace(/:$/,""));}function mb(a,b){if(b){b = Number(b);if(isNaN(b) || 0 > b)throw Error("Bad port number " + b);a.xa = b;}else a.xa = null;}function nb(a,b,c){b instanceof qb?a.a = b:(c || (b = rb(b,wb)),a.a = new qb(b));}function pb(a,b){return a?b?decodeURI(a):decodeURIComponent(a):"";}function rb(a,b,c){return "string" == typeof a?(a = encodeURI(a).replace(b,xb),c && (a = a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null;}function xb(a){a = a.charCodeAt(0);return "%" + (a >> 4 & 15).toString(16) + (a & 15).toString(16);}var sb=/[#\/\?@]/g,ub=/[\#\?:]/g,tb=/[\#\?]/g,wb=/[\#\?@]/g,vb=/#/g;function qb(a){this.b = a || null;}qb.prototype.a = null;qb.prototype.c = null;qb.prototype.toString = function(){if(this.b)return this.b;if(!this.a)return "";var a=[],b;for(b in this.a) for(var c=encodeURIComponent(b),d=this.a[b],e=0;e < d.length;e++) {var f=c;"" !== d[e] && (f += "=" + encodeURIComponent(d[e]));a.push(f);}return this.b = a.join("&");};function ob(a){var b=new qb();b.b = a.b;if(a.a){var c={},d;for(d in a.a) c[d] = a.a[d].concat();b.a = c;b.c = a.c;}return b;};function yb(a,b,c){this.a = a;this.L = b;this.D = c;}m("shaka.media.InitSegmentReference",yb);function K(a,b,c,d,e,f){this.position = a;this.startTime = b;this.endTime = c;this.a = d;this.L = e;this.D = f;}m("shaka.media.SegmentReference",K);var zb=1 / 15;function Ab(a,b,c,d,e){null !== e && (e = Math.round(e));var f={RepresentationID:b,Number:c,Bandwidth:d,Time:e};return a.replace(/\$(RepresentationID|Number|Bandwidth|Time)?(?:%0([0-9]+)d)?\$/g,function(a,b,c){if("$$" == a)return "$";var d=f[b];if(null == d)return a;"RepresentationID" == b && c && (c = void 0);a = d.toString();c = window.parseInt(c,10) || 1;return Array(Math.max(0,c - a.length) + 1).join("0") + a;});}function Bb(a,b,c){if(c.length){var d=c[0];d.startTime <= zb && (c[0] = new K(d.position,0,d.endTime,d.a,d.L,d.D));a || (a = c[c.length - 1],a.startTime > b || (c[c.length - 1] = new K(a.position,a.startTime,b,a.a,a.L,a.D)));}}function L(a,b){if(!b.length)return a;var c=b.map(function(a){return new kb(a);});return a.map(function(a){return new kb(a);}).map(function(a){return c.map(a.resolve.bind(a));}).reduce(C,[]).map(function(a){return a.toString();});}function Cb(a,b){var c=M(a,b,"timescale"),d=1;c && (d = $a(c) || 1);c = M(a,b,"duration");(c = $a(c || "")) && (c /= d);var e=M(a,b,"startNumber"),f=M(a,b,"presentationTimeOffset"),g=ab(e || "");if(null == e || null == g)g = 1;var h=Db(a,b,"SegmentTimeline"),e=null;if(h){for(var e=d,l=Number(f),n=a.H.duration || Infinity,h=G(h,"S"),u=[],r=0,E=0;E < h.length;++E) {var v=h[E],H=I(v,"t",ab),cb=I(v,"d",ab),v=I(v,"r",Za);null != H && (H -= l);if(!cb)break;H = null != H?H:r;v = v || 0;if(0 > v)if(E + 1 < h.length){v = I(h[E + 1],"t",ab);if(null == v)break;else if(H >= v)break;v = Math.ceil((v - H) / cb) - 1;}else {if(Infinity == n)break;else if(H / e >= n)break;v = Math.ceil((n * e - H) / cb) - 1;}0 < u.length && H != r && (u[u.length - 1].end = H / e);for(var Yc=0;Yc <= v;++Yc) r = H + cb,u.push({start:H / e,end:r / e}),H = r;}e = u;}return {Ja:d,F:c,ha:g,presentationTimeOffset:Number(f) / d || 0,B:e};}function M(a,b,c){return [b(a.u),b(a.P),b(a.K)].filter(La).map(function(a){return a.getAttribute(c);}).reduce(function(a,b){return a || b;});}function Db(a,b,c){return [b(a.u),b(a.P),b(a.K)].filter(La).map(function(a){return Va(a,c);}).reduce(function(a,b){return a || b;});};function Eb(a){if(!a)return "";a = new Uint8Array(a);239 == a[0] && 187 == a[1] && 191 == a[2] && (a = a.subarray(3));a = escape(Fb(a));try{return decodeURIComponent(a);}catch(b) {throw new w(2,2004);}}function Gb(a,b){if(!a)return "";if(a.byteLength % 2)throw new w(2,2004);var c;if(a instanceof ArrayBuffer)c = a;else {var d=new Uint8Array(a.byteLength);d.set(new Uint8Array(a));c = d.buffer;}var d=a.byteLength / 2,e=new Uint16Array(d);c = new DataView(c);for(var f=0;f < d;f++) e[f] = c.getUint16(2 * f,b);return Fb(e);}function Hb(a){var b=new Uint8Array(a);if(239 == b[0] && 187 == b[1] && 191 == b[2])return Eb(b);if(254 == b[0] && 255 == b[1])return Gb(b.subarray(2),!1);if(255 == b[0] && 254 == b[1])return Gb(b.subarray(2),!0);var c=(function(a,b){return a.byteLength <= b || 32 <= a[b] && 126 >= a[b];}).bind(null,b);if(b[0] || b[2]){if(!b[1] && !b[3])return Gb(a,!0);if(c(0) && c(1) && c(2) && c(3))return Eb(a);}else return Gb(a,!1);throw new w(2,2003);}function Ib(a){a = unescape(encodeURIComponent(a));for(var b=new Uint8Array(a.length),c=0;c < a.length;++c) b[c] = a.charCodeAt(c);return b.buffer;}function Fb(a){for(var b="",c=0;c < a.length;c += 16E3) b += String.fromCharCode.apply(null,a.subarray(c,c + 16E3));return b;};function Jb(a){this.b = a;this.c = 0 == Kb;this.a = 0;}var Kb=1;function Lb(a){return a.a < a.b.byteLength;}function Mb(a){try{var b=a.b.getUint8(a.a);}catch(c) {Nb();}a.a += 1;return b;}function Ob(a){try{var b=a.b.getUint16(a.a,a.c);}catch(c) {Nb();}a.a += 2;return b;}function N(a){try{var b=a.b.getUint32(a.a,a.c);}catch(c) {Nb();}a.a += 4;return b;}function Pb(a){var b,c;try{a.c?(b = a.b.getUint32(a.a,!0),c = a.b.getUint32(a.a + 4,!0)):(c = a.b.getUint32(a.a,!1),b = a.b.getUint32(a.a + 4,!1));}catch(d) {Nb();}if(2097151 < c)throw new w(3,3001);a.a += 8;return c * Math.pow(2,32) + b;}function Qb(a,b){a.a + b > a.b.byteLength && Nb();var c=a.b.buffer.slice(a.a,a.a + b);a.a += b;return new Uint8Array(c);}function O(a,b){a.a + b > a.b.byteLength && Nb();a.a += b;}function Rb(a){var b=a.a;try{for(;Lb(a) && a.b.getUint8(a.a);) a.a += 1;}catch(c) {Nb();}b = a.b.buffer.slice(b,a.a);a.a += 1;return Eb(b);}function Nb(){throw new w(3,3E3);};function Sb(a,b){for(;Lb(b);) {var c=b.a,d=N(b),e=N(b);1 == d?d = Pb(b):d || (d = b.b.byteLength - c);if(e == a)return d;O(b,d - (b.a - c));}return -1;}function Tb(a,b){for(var c=new Jb(new DataView(a)),d=[[1836019574,0],[1953653099,0],[1835297121,0],[1835626086,0],[1937007212,0],[1937011556,8],[b,0]],e=-1,f=0;f < d.length;f++) {var g=d[f][1],e=Sb(d[f][0],c);if(-1 == e)return -1;O(c,g);}return e;};function Ub(a,b,c,d){var e=[];a = new Jb(new DataView(a));var f=Sb(1936286840,a);if(-1 == f)throw new w(3,3004);var g=Mb(a);O(a,3);O(a,4);var h=N(a);if(!h)throw new w(3,3005);var l,n;g?(l = Pb(a),n = Pb(a)):(l = N(a),n = N(a));O(a,2);g = Ob(a);d = l - d;b = b + f + n;for(f = 0;f < g;f++) {l = N(a);n = (l & 2147483648) >>> 31;l &= 2147483647;var u=N(a);O(a,4);if(1 == n)throw new w(3,3006);e.push(new K(e.length,d / h,(d + u) / h,function(){return c;},b,b + l - 1));d += u;b += l;}return e;};function P(a){this.a = a;}m("shaka.media.SegmentIndex",P);P.prototype.o = function(){this.a = null;return Promise.resolve();};P.prototype.destroy = P.prototype.o;P.prototype.find = function(a){for(var b=this.a.length - 1;0 <= b;--b) {var c=this.a[b];if(a >= c.startTime && a < c.endTime)return c.position;}return null;};P.prototype.find = P.prototype.find;P.prototype.get = function(a){if(!this.a.length)return null;a -= this.a[0].position;return 0 > a || a >= this.a.length?null:this.a[a];};P.prototype.get = P.prototype.get;P.prototype.Xa = function(a){for(var b=[],c=0,d=0;c < this.a.length && d < a.length;) {var e=this.a[c],f=a[d];e.startTime < f.startTime?(b.push(e),c++):(e.startTime > f.startTime || (.1 < Math.abs(e.endTime - f.endTime)?b.push(f):b.push(e),c++),d++);}for(;c < this.a.length;) b.push(this.a[c++]);if(b.length)for(c = b[b.length - 1].position + 1;d < a.length;) f = a[d++],f = new K(c++,f.startTime,f.endTime,f.a,f.L,f.D),b.push(f);else b = a;this.a = b;};P.prototype.merge = P.prototype.Xa;P.prototype.Sa = function(a){for(var b=0;b < this.a.length && !(this.a[b].endTime > a);++b);this.a.splice(0,b);};P.prototype.evict = P.prototype.Sa;function Vb(a){this.b = a;this.a = new Jb(a);Wb || (Wb = [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])]);}var Wb;function Xb(a){var b;b = Yb(a);if(7 < b.length)throw new w(3,3002);for(var c=0,d=0;d < b.length;d++) c = 256 * c + b[d];b = c;c = Yb(a);a: {for(d = 0;d < Wb.length;d++) if(Ua(c,Wb[d])){d = !0;break a;}d = !1;}if(d)c = a.b.byteLength - a.a.a;else {if(8 == c.length && c[1] & 224)throw new w(3,3001);for(var d=c[0] & (1 << 8 - c.length) - 1,e=1;e < c.length;e++) d = 256 * d + c[e];c = d;}c = a.a.a + c <= a.b.byteLength?c:a.b.byteLength - a.a.a;d = new DataView(a.b.buffer,a.b.byteOffset + a.a.a,c);O(a.a,c);return new Zb(b,d);}function Yb(a){var b=Mb(a.a),c;for(c = 1;8 >= c && !(b & 1 << 8 - c);c++);if(8 < c)throw new w(3,3002);var d=new Uint8Array(c);d[0] = b;for(b = 1;b < c;b++) d[b] = Mb(a.a);return d;}function Zb(a,b){this.id = a;this.a = b;}function $b(a){if(8 < a.a.byteLength)throw new w(3,3002);if(8 == a.a.byteLength && a.a.getUint8(0) & 224)throw new w(3,3001);for(var b=0,c=0;c < a.a.byteLength;c++) var d=a.a.getUint8(c),b=256 * b + d;return b;};function ac(a,b,c,d,e,f){function g(){return e;}var h=[];a = new Vb(a.a);for(var l=-1,n=-1;Lb(a.a);) {var u=Xb(a);if(187 == u.id){var r=bc(u);r && (u = c * (r.ad - f),r = b + r.Ac,0 <= l && h.push(new K(h.length,l,u,g,n,r - 1)),l = u,n = r);}}0 <= l && h.push(new K(h.length,l,d,g,n,null));return h;}function bc(a){var b=new Vb(a.a);a = Xb(b);if(179 != a.id)throw new w(3,3013);a = $b(a);b = Xb(b);if(183 != b.id)throw new w(3,3012);for(var b=new Vb(b.a),c=0;Lb(b.a);) {var d=Xb(b);if(241 == d.id){c = $b(d);break;}}return {ad:a,Ac:c};};function cc(a,b){var c=Db(a,b,"Initialization");if(!c)return null;var d=a.u.M,e=c.getAttribute("sourceURL");e && (d = L(a.u.M,[e]));var e=0,f=null;if(c = I(c,"range",Ya))e = c.start,f = c.end;return new yb(function(){return d;},e,f);}function dc(a,b){var c=M(a,ec,"presentationTimeOffset"),d=cc(a,ec),e;e = Number(c);var f=a.u.contentType,g=a.u.mimeType.split("/")[1];if("text" != f && "mp4" != g && "webm" != g)throw new w(4,4006);if("webm" == g && !d)throw new w(4,4005);var f=Db(a,ec,"RepresentationIndex"),h=M(a,ec,"indexRange"),l=a.u.M,h=Ya(h || "");if(f){var n=f.getAttribute("sourceURL");n && (l = L(a.u.M,[n]));h = I(f,"range",Ya,h);}if(!h)throw new w(4,4002);e = fc(a,b,d,l,h.start,h.end,g,e);return {createSegmentIndex:e.createSegmentIndex,findSegmentPosition:e.findSegmentPosition,getSegmentReference:e.getSegmentReference,initSegmentReference:d,presentationTimeOffset:Number(c) || 0};}function fc(a,b,c,d,e,f,g,h){var l=a.presentationTimeline,n=a.H.start,u=a.H.duration,r=b,E=null;return {createSegmentIndex:function createSegmentIndex(){var b=[r(d,e,f),"webm" == g?r(c.a(),c.L,c.D):null];r = null;return Promise.all(b).then(function(b){var c,f,r=b[0];b = b[1] || null;if("mp4" == g)r = Ub(r,e,d,h);else {b = new Vb(new DataView(b));if(440786851 != Xb(b).id)throw new w(3,3008);f = Xb(b);if(408125543 != f.id)throw new w(3,3009);b = f.a.byteOffset;f = new Vb(f.a);for(c = null;Lb(f.a);) {var v=Xb(f);if(357149030 == v.id){c = v;break;}}if(!c)throw new w(3,3010);c = new Vb(c.a);v = 1E6;for(f = null;Lb(c.a);) {var H=Xb(c);if(2807729 == H.id)v = $b(H);else if(17545 == H.id)if((f = H,4 == f.a.byteLength))f = f.a.getFloat32(0);else if(8 == f.a.byteLength)f = f.a.getFloat64(0);else throw new w(3,3003);}if(null == f)throw new w(3,3011);c = v /= 1E9;f *= v;r = Xb(new Vb(new DataView(r)));if(475249515 != r.id)throw new w(3,3007);r = ac(r,b,c,f,d,h);}Bb(a.Ra,u,r);l.Ga(n,r);E = new P(r);});},findSegmentPosition:function findSegmentPosition(a){return E.find(a);},getSegmentReference:function getSegmentReference(a){return E.get(a);}};}function ec(a){return a.Ha;};function gc(a,b){var c=cc(a,hc),d;d = ic(a);var e=Cb(a,hc),f=e.ha;f || (f = 1);var g=0;e.F?g = e.F * (f - 1) - e.presentationTimeOffset:e.B && 0 < e.B.length && (g = e.B[0].start);d = {F:e.F,startTime:g,ha:f,presentationTimeOffset:e.presentationTimeOffset,B:e.B,va:d};if(!d.F && !d.B && 1 < d.va.length)throw new w(4,4002);if(!d.F && !a.H.duration && !d.B && 1 == d.va.length)throw new w(4,4002);if(d.B && !d.B.length)throw new w(4,4002);f = e = null;a.K.id && a.u.id && (f = a.K.id + "," + a.u.id,e = b[f]);g = jc(a.H.duration,d.ha,a.u.M,d);Bb(a.Ra,a.H.duration,g);e?(e.Xa(g),e.Sa(a.presentationTimeline.ta() - a.H.start)):(a.presentationTimeline.Ga(a.H.start,g),e = new P(g),f && (b[f] = e));return {createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:e.find.bind(e),getSegmentReference:e.get.bind(e),initSegmentReference:c,presentationTimeOffset:d.presentationTimeOffset};}function hc(a){return a.Z;}function jc(a,b,c,d){var e=d.va.length;d.B && d.B.length != d.va.length && (e = Math.min(d.B.length,d.va.length));for(var f=[],g=d.startTime,h=0;h < e;h++) {var l=d.va[h],n=L(c,[l.dc]),u;u = null != d.F?g + d.F:d.B?d.B[h].end:g + a;f.push(new K(h + b,g,u,(function(a){return a;}).bind(null,n),l.start,l.end));g = u;}return f;}function ic(a){return [a.u.Z,a.P.Z,a.K.Z].filter(La).map(function(a){return G(a,"SegmentURL");}).reduce(function(a,c){return 0 < a.length?a:c;}).map(function(a){var b=a.getAttribute("media");a = I(a,"mediaRange",Ya,{start:0,end:null});return {dc:b,start:a.start,end:a.end};});};function kc(a,b,c,d){var e=lc(a),f;f = Cb(a,mc);var g=M(a,mc,"media"),h=M(a,mc,"index");f = {F:f.F,Ja:f.Ja,ha:f.ha,presentationTimeOffset:f.presentationTimeOffset,B:f.B,Wa:g,Fa:h};g = 0 + (f.Fa?1:0);g += f.B?1:0;g += f.F?1:0;if(!g)throw new w(4,4002);1 != g && (f.Fa && (f.B = null),f.F = null);if(!f.Fa && !f.Wa)throw new w(4,4002);if(f.Fa){c = a.u.mimeType.split("/")[1];if("mp4" != c && "webm" != c)throw new w(4,4006);if("webm" == c && !e)throw new w(4,4005);d = Ab(f.Fa,a.u.id,null,a.bandwidth || null,null);d = L(a.u.M,[d]);a = fc(a,b,e,d,0,null,c,f.presentationTimeOffset);}else f.F?(d || a.presentationTimeline.Ya(f.F),a = nc(a,f)):(d = b = null,a.K.id && a.u.id && (d = a.K.id + "," + a.u.id,b = c[d]),g = oc(a,f),Bb(a.Ra,a.H.duration,g),b?(b.Xa(g),b.Sa(a.presentationTimeline.ta() - a.H.start)):(a.presentationTimeline.Ga(a.H.start,g),b = new P(g),d && (c[d] = b)),a = {createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:b.find.bind(b),getSegmentReference:b.get.bind(b)});return {createSegmentIndex:a.createSegmentIndex,findSegmentPosition:a.findSegmentPosition,getSegmentReference:a.getSegmentReference,initSegmentReference:e,presentationTimeOffset:f.presentationTimeOffset};}function mc(a){return a.Ia;}function nc(a,b){var c=a.H.duration,d=b.F,e=b.ha,f=b.Ja,g=b.Wa,h=a.bandwidth || null,l=a.u.id,n=a.u.M;return {createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function findSegmentPosition(a){return 0 > a || c && a >= c?null:Math.floor(a / d);},getSegmentReference:function getSegmentReference(a){var b=a * d;return new K(a,b,b + d,function(){var c=Ab(g,l,a + e,h,b * f);return L(n,[c]);},0,null);}};}function oc(a,b){for(var c=[],d=0;d < b.B.length;d++) {var e=b.B[d].start,f=d + b.ha;c.push(new K(f,e,b.B[d].end,(function(a,b,c,d,e,f){a = Ab(a,b,e,c,f);return L(d,[a]).map(function(a){return a.toString();});}).bind(null,b.Wa,a.u.id,a.bandwidth || null,a.u.M,f,(e + b.presentationTimeOffset) * b.Ja),0,null));}return c;}function lc(a){var b=M(a,mc,"initialization");if(!b)return null;var c=a.u.id,d=a.bandwidth || null,e=a.u.M;return new yb(function(){var a=Ab(b,c,null,d,null);return L(e,[a]);},0,null);};function Q(a){this.f = !1;this.a = [];this.b = [];this.c = [];this.g = a || null;}m("shaka.net.NetworkingEngine",Q);Q.RequestType = {MANIFEST:0,SEGMENT:1,LICENSE:2};var pc={};Q.registerScheme = function(a,b){pc[a] = b;};Q.unregisterScheme = function(a){delete pc[a];};Q.prototype.zc = function(a){this.b.push(a);};Q.prototype.registerRequestFilter = Q.prototype.zc;Q.prototype.$c = function(a){var b=this.b;a = b.indexOf(a);0 <= a && b.splice(a,1);};Q.prototype.unregisterRequestFilter = Q.prototype.$c;Q.prototype.Pb = function(){this.b = [];};Q.prototype.clearAllRequestFilters = Q.prototype.Pb;Q.prototype.Ab = function(a){this.c.push(a);};Q.prototype.registerResponseFilter = Q.prototype.Ab;Q.prototype.Jb = function(a){var b=this.c;a = b.indexOf(a);0 <= a && b.splice(a,1);};Q.prototype.unregisterResponseFilter = Q.prototype.Jb;Q.prototype.Qb = function(){this.c = [];};Q.prototype.clearAllResponseFilters = Q.prototype.Qb;function qc(){return {maxAttempts:2,baseDelay:1E3,backoffFactor:2,fuzzFactor:.5,timeout:0};}function rc(a,b){return {uris:a,method:"GET",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:b};}Q.prototype.o = function(){this.f = !0;this.b = [];this.c = [];for(var a=[],b=0;b < this.a.length;++b) a.push(this.a[b]["catch"](D));return Promise.all(a);};Q.prototype.destroy = Q.prototype.o;Q.prototype.request = function(a,b){if(this.f)return Promise.reject();for(var c=Date.now(),d=this.b,e=0;e < d.length;e++) try{d[e](a,b);}catch(l) {return Promise.reject(l);}for(var e=b.retryParameters || {},d=e.maxAttempts || 1,f=e.backoffFactor || 2,g=null == e.baseDelay?1E3:e.baseDelay,h=this.h(a,b,0),e=1;e < d;e++) h = h["catch"](this.i.bind(this,a,b,g,e % b.uris.length)),g *= f;this.a.push(h);return h.then((function(b){0 <= this.a.indexOf(h) && this.a.splice(this.a.indexOf(h),1);var d=Date.now();this.g && 1 == a && this.g(c,d,b.data.byteLength);return b;}).bind(this))["catch"]((function(a){0 <= this.a.indexOf(h) && this.a.splice(this.a.indexOf(h),1);return Promise.reject(a);}).bind(this));};Q.prototype.request = Q.prototype.request;Q.prototype.h = function(a,b,c){if(this.f)return Promise.reject();var d=new kb(b.uris[c]),e=d.S;e || (e = location.protocol,e = e.slice(0,-1),lb(d,e),b.uris[c] = d.toString());return (e = pc[e])?e(b.uris[c],b).then((function(b){for(var c=this.c,d=0;d < c.length;d++) c[d](a,b);return b;}).bind(this)):Promise.reject(new w(1,1E3,d));};Q.prototype.i = function(a,b,c,d){var e=new x(),f=b.retryParameters || {};window.setTimeout(e.resolve,c * (1 + (2 * Math.random() - 1) * (null == f.fuzzFactor?.5:f.fuzzFactor)));return e.then(this.h.bind(this,a,b,d));};var sc={},tc={};m("shaka.media.ManifestParser.registerParserByExtension",function(a,b){tc[a] = b;});m("shaka.media.ManifestParser.registerParserByMime",function(a,b){sc[a] = b;});function uc(){var a={},b;for(b in sc) a[b] = !0;for(b in tc) a[b] = !0;["application/dash+xml","application/x-mpegurl","application/vnd.apple.mpegurl","application/vnd.ms-sstr+xml"].forEach(function(b){a[b] = !!sc[b];});["mpd","m3u8","ism"].forEach(function(b){a[b] = !!tc[b];});return a;}function vc(a,b,c,d){var e=d;e || (d = new kb(a).O.split("/").pop().split("."),1 < d.length && (d = d.pop().toLowerCase(),e = tc[d]));if(e)return Promise.resolve(e);c = rc([a],c);c.method = "HEAD";return b.request(0,c).then(function(b){(b = b.headers["content-type"]) && (b = b.toLowerCase());return (e = sc[b])?e:Promise.reject(new w(4,4E3,a));},function(a){return Promise.reject(a);});};function R(a,b){this.j = a;this.i = b;this.c = this.a = Infinity;this.b = 1;this.g = this.f = 0;this.h = !0;}m("shaka.media.PresentationTimeline",R);R.prototype.da = function(){return this.a;};R.prototype.getDuration = R.prototype.da;R.prototype.Aa = function(a){this.a = a;};R.prototype.setDuration = R.prototype.Aa;R.prototype.Fb = function(a){this.g = a;};R.prototype.setClockOffset = R.prototype.Fb;R.prototype.Hb = function(a){this.h = a;};R.prototype.setStatic = R.prototype.Hb;R.prototype.Xb = function(){return this.c;};R.prototype.getSegmentAvailabilityDuration = R.prototype.Xb;R.prototype.Gb = function(a){this.c = a;};R.prototype.setSegmentAvailabilityDuration = R.prototype.Gb;R.prototype.Ga = function(a,b){b.length && (this.b = b.reduce(function(a,b){return Math.max(a,b.endTime - b.startTime);},this.b),a || (this.f = Math.max(this.f,b[0].startTime)));};R.prototype.notifySegments = R.prototype.Ga;R.prototype.Ya = function(a){this.b = Math.max(this.b,a);};R.prototype.notifyMaxSegmentDuration = R.prototype.Ya;R.prototype.R = function(){return Infinity == this.a && !this.h;};R.prototype.isLive = R.prototype.R;R.prototype.ea = function(){return Infinity != this.a && !this.h;};R.prototype.isInProgress = R.prototype.ea;R.prototype.sa = function(){return Math.max(Math.min(this.f,this.Y()),this.ta());};R.prototype.getEarliestStart = R.prototype.sa;R.prototype.ta = function(){return Infinity == this.c?0:Math.max(0,this.Y() - this.c - this.i);};R.prototype.getSegmentAvailabilityStart = R.prototype.ta;R.prototype.Y = function(){return this.R() || this.ea()?Math.min(Math.max(0,(Date.now() + this.g) / 1E3 - this.b - this.j),this.a):this.a;};R.prototype.getSegmentAvailabilityEnd = R.prototype.Y;R.prototype.Ua = function(){return Math.max(0,this.Y() - (this.R() || this.ea()?this.i:0));};R.prototype.getSeekRangeEnd = R.prototype.Ua;function wc(a,b,c){this.h = S[b];this.c = a;this.g = 0;this.f = Infinity;this.a = this.b = null;this.i = c;}var S={};m("shaka.media.TextEngine.registerParser",function(a,b){S[a] = b;});m("shaka.media.TextEngine.unregisterParser",function(a){delete S[a];});function xc(a,b,c){return a >= b?null:new VTTCue(a,b,c);}m("shaka.media.TextEngine.makeCue",xc);wc.prototype.o = function(){this.c && yc(this,function(){return !0;});this.c = this.h = null;return Promise.resolve();};function zc(a,b,c,d){var e=a.g;return Promise.resolve().then((function(){if(this.c){var a=this.h(b,e,c,d,this.i);if(null != c && null != d){for(var g=0;g < a.length && !(a[g].startTime >= this.f);++g) this.c.addCue(a[g]);null == this.b && (this.b = c);this.a = Math.min(d,this.f);}}}).bind(a));}wc.prototype.remove = function(a,b){return Promise.resolve().then((function(){this.c && (yc(this,function(c){return c.startTime >= b || c.endTime <= a?!1:!0;}),null == this.b || b <= this.b || a >= this.a || (a <= this.b && b >= this.a?this.b = this.a = null:a <= this.b && b < this.a?this.b = b:a > this.b && b >= this.a && (this.a = a)));}).bind(this));};function Ac(a,b){return null == a.a || a.a < b || b < a.b?0:a.a - b;}function yc(a,b){for(var c=a.c.cues,d=[],e=0;e < c.length;++e) b(c[e]) && d.push(c[e]);for(e = 0;e < d.length;++e) a.c.removeCue(d[e]);};function Bc(a,b,c){return c == b || a >= Cc && c == b.split("-")[0] || a >= Dc && c.split("-")[0] == b.split("-")[0]?!0:!1;}var Cc=1,Dc=2;function Ec(a){a = a.toLowerCase().split("-");var b=Fc[a[0]];b && (a[0] = b);return a.join("-");}var Fc={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"};function Gc(a,b,c){for(var d=0;d < a.length;++d) if(c(a[d],b))return d;return -1;};function Hc(a){this.a = null;this.b = (function(){this.a = null;a();}).bind(this);}Hc.prototype.cancel = function(){null != this.a && (clearTimeout(this.a),this.a = null);};function Ic(a){a.cancel();a.a = setTimeout(a.b,100);};function Jc(a,b,c){this.l = this.g = this.s = null;this.A = !1;this.b = null;this.f = new y();this.a = [];this.m = [];this.j = new x();this.G = a;this.i = null;this.h = (function(a){this.j.reject(a);b(a);}).bind(this);this.w = {};this.J = c;this.v = new Hc(this.yc.bind(this));this.C = this.c = !1;this.j["catch"](function(){});}k = Jc.prototype;k.o = function(){this.c = !0;var a=this.a.map(function(a){a.za.close()["catch"](D);return a.za.closed;});this.j.reject();this.f && a.push(this.f.o());this.l && a.push(this.l.setMediaKeys(null)["catch"](D));this.v && this.v.cancel();this.f = this.l = this.g = this.s = this.b = this.v = null;this.a = [];this.m = [];this.h = this.i = this.G = null;return Promise.all(a);};k.configure = function(a){this.i = a;};k.init = function(a,b){var c={},d=[];this.C = b;this.m = a.offlineSessionIds;Kc(this,a,b || 0 < a.offlineSessionIds.length,c,d);return d.length?Lc(this,c,d):(this.A = !0,Promise.resolve());};function Mc(a,b){if(!a.g)return z(a.f,b,"encrypted",(function(){this.f.ja(b,"encrypted");this.h(new w(6,6010));}).bind(a)),Promise.resolve();a.l = b;var c=a.l.setMediaKeys(a.g),c=c["catch"](function(a){return Promise.reject(new w(6,6003,a.message));}),d=null;a.b.serverCertificate && (d = a.g.setServerCertificate(a.b.serverCertificate),d = d["catch"](function(a){return Promise.reject(new w(6,6004,a.message));}));return Promise.all([c,d]).then((function(){if(this.c)return Promise.reject();Nc(this);this.b.initData.length || this.m.length || z(this.f,this.l,"encrypted",this.ec.bind(this));}).bind(a))["catch"]((function(a){return this.c?Promise.resolve():Promise.reject(a);}).bind(a));}function Oc(a,b){return Promise.all(b.map((function(a){return Pc(this,a).then(function(a){if(a)return a.remove();});}).bind(a)));}function Nc(a){var b=a.b?a.b.initData:[];b.forEach((function(a){Qc(this,a.initDataType,a.initData);}).bind(a));a.m.forEach((function(a){Pc(this,a);}).bind(a));b.length || a.m.length || a.j.resolve();return a.j;}k.keySystem = function(){return this.b?this.b.keySystem:"";};function Rc(a){return a.a.map(function(a){return a.za.sessionId;});}function Kc(a,b,c,d,e){var f=Sc(a);b.periods.forEach((function(a){a.streamSets.forEach((function(a){"text" != a.type && (f && (a.drmInfos = [f]),a.drmInfos.forEach((function(b){Tc(this,b);var f=d[b.keySystem];f || (f = {audioCapabilities:[],videoCapabilities:[],distinctiveIdentifier:"optional",persistentState:c?"required":"optional",sessionTypes:[c?"persistent-license":"temporary"],label:b.keySystem,drmInfos:[]},d[b.keySystem] = f,e.push(b.keySystem));f.drmInfos.push(b);b.distinctiveIdentifierRequired && (f.distinctiveIdentifier = "required");b.persistentStateRequired && (f.persistentState = "required");var g="video" == a.type?f.videoCapabilities:f.audioCapabilities,h=("video" == a.type?b.videoRobustness:b.audioRobustness) || "";a.streams.forEach((function(a){var c=a.mimeType;a.codecs && (c += '; codecs="' + a.codecs + '"');a.keyId && b.keyIds.push(a.keyId);g.push({robustness:h,contentType:c});}).bind(this));}).bind(this)));}).bind(this));}).bind(a));}function Lc(a,b,c){if(1 == c.length && "" == c[0])return Promise.reject(new w(6,6E3));var d=new x(),e=d;[!0,!1].forEach((function(a){c.forEach((function(c){var d=b[c];d.drmInfos.some(function(a){return !!a.licenseServerUri;}) == a && (d.audioCapabilities.length || delete d.audioCapabilities,d.videoCapabilities.length || delete d.videoCapabilities,e = e["catch"]((function(){return this.c?Promise.reject():navigator.requestMediaKeySystemAccess(c,[d]);}).bind(this)));}).bind(this));}).bind(a));e = e["catch"](function(){return Promise.reject(new w(6,6001));});e = e.then((function(a){if(this.c)return Promise.reject();var c=0 <= navigator.userAgent.indexOf("Edge/"),d=a.getConfiguration();this.s = (d.audioCapabilities || []).concat(d.videoCapabilities || []).map(function(a){return a.contentType;});c && (this.s = null);c = b[a.keySystem];Uc(this,a.keySystem,c,c.drmInfos);return this.b.licenseServerUri?a.createMediaKeys():Promise.reject(new w(6,6012));}).bind(a)).then((function(a){if(this.c)return Promise.reject();this.g = a;this.A = !0;}).bind(a))["catch"]((function(a){if(this.c)return Promise.resolve();this.s = this.b = null;return a instanceof w?Promise.reject(a):Promise.reject(new w(6,6002,a.message));}).bind(a));d.reject();return e;}function Tc(a,b){var c=b.keySystem;if(c){if(!b.licenseServerUri){var d=a.i.servers[c];d && (b.licenseServerUri = d);}b.keyIds || (b.keyIds = []);if(c = a.i.advanced[c])b.distinctiveIdentifierRequired || (b.distinctiveIdentifierRequired = c.distinctiveIdentifierRequired),b.persistentStateRequired || (b.persistentStateRequired = c.persistentStateRequired),b.videoRobustness || (b.videoRobustness = c.videoRobustness),b.audioRobustness || (b.audioRobustness = c.audioRobustness),b.serverCertificate || (b.serverCertificate = c.serverCertificate);}}function Sc(a){if(Na(a.i.clearKeys))return null;var b=[],c=[],d;for(d in a.i.clearKeys) {var e=a.i.clearKeys[d],f=Sa(d),e=Sa(e),f={kty:"oct",kid:Qa(f),k:Qa(e)};b.push(f);c.push(f.kid);}a = JSON.stringify({keys:b});c = JSON.stringify({kids:c});c = [{initData:new Uint8Array(Ib(c)),initDataType:"keyids"}];return {keySystem:"org.w3.clearkey",licenseServerUri:"data:application/json;base64," + window.btoa(a),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:c,keyIds:[]};}function Uc(a,b,c,d){var e=[],f=[],g=[],h=[];Vc(d,e,f,g,h);a.b = {keySystem:b,licenseServerUri:e[0],distinctiveIdentifierRequired:"required" == c.distinctiveIdentifier,persistentStateRequired:"required" == c.persistentState,audioRobustness:c.audioCapabilities?c.audioCapabilities[0].robustness:"",videoRobustness:c.videoCapabilities?c.videoCapabilities[0].robustness:"",serverCertificate:f[0],initData:g,keyIds:h};}function Vc(a,b,c,d,e){function f(a,b){return a.initDataType == b.initDataType && Ua(a.initData,b.initData);}a.forEach(function(a){-1 == b.indexOf(a.licenseServerUri) && b.push(a.licenseServerUri);a.serverCertificate && -1 == Gc(c,a.serverCertificate,Ua) && c.push(a.serverCertificate);a.initData && a.initData.forEach(function(a){-1 == Gc(d,a,f) && d.push(a);});if(a.keyIds)for(var g=0;g < a.keyIds.length;++g) -1 == e.indexOf(a.keyIds[g]) && e.push(a.keyIds[g]);});}k.ec = function(a){for(var b=new Uint8Array(a.initData),c=0;c < this.a.length;++c) if(Ua(b,this.a[c].initData))return;Qc(this,a.initDataType,b);};function Pc(a,b){var c;try{c = a.g.createSession("persistent-license");}catch(f) {var d=new w(6,6005,f.message);a.h(d);return Promise.reject(d);}z(a.f,c,"message",a.xb.bind(a));z(a.f,c,"keystatuseschange",a.sb.bind(a));var e={initData:null,za:c,loaded:!1};a.a.push(e);return c.load(b).then((function(a){if(!this.c){if(a)return e.loaded = !0,this.a.every(function(a){return a.loaded;}) && this.j.resolve(),c;this.a.splice(this.a.indexOf(e),1);this.h(new w(6,6013));}}).bind(a),(function(a){this.c || (this.a.splice(this.a.indexOf(e),1),this.h(new w(6,6005,a.message)));}).bind(a));}function Qc(a,b,c){var d;try{d = a.C?a.g.createSession("persistent-license"):a.g.createSession();}catch(e) {a.h(new w(6,6005,e.message));return;}z(a.f,d,"message",a.xb.bind(a));z(a.f,d,"keystatuseschange",a.sb.bind(a));a.a.push({initData:c,za:d,loaded:!1});d.generateRequest(b,c.buffer)["catch"]((function(a){if(!this.c){for(var b=0;b < this.a.length;++b) if(this.a[b].za == d){this.a.splice(b,1);break;}this.h(new w(6,6006,a.message));}}).bind(a));}k.xb = function(a){var b=a.target,c=rc([this.b.licenseServerUri],this.i.retryParameters);c.body = a.message;c.method = "POST";"com.microsoft.playready" == this.b.keySystem && Wc(c);this.G.request(2,c).then((function(a){return this.c?Promise.reject():b.update(a.data);}).bind(this),(function(a){if(this.c)return Promise.resolve();this.h(new w(6,6007,a));}).bind(this))["catch"]((function(a){if(this.c)return Promise.resolve();this.h(new w(6,6008,a.message));}).bind(this));};function Wc(a){for(var b=Gb(a.body,!0),b=new DOMParser().parseFromString(b,"application/xml"),c=b.getElementsByTagName("HttpHeader"),d=0;d < c.length;++d) a.headers[c[d].querySelector("name").textContent] = c[d].querySelector("value").textContent;a.body = Ra(b.querySelector("Challenge").textContent).buffer;}k.sb = function(a){a = a.target;var b;for(b = 0;b < this.a.length && this.a[b].za != a;++b);if(b != this.a.length){var c=a.keyStatuses,d=!1;c.forEach || (c = []);c.forEach((function(a,c){if("string" == typeof c){var e=c;c = a;a = e;}if("com.microsoft.playready" == this.b.keySystem && 16 == c.byteLength){var e=new DataView(c),f=e.getUint32(0,!0),l=e.getUint16(4,!0),n=e.getUint16(6,!0);e.setUint32(0,f,!1);e.setUint16(4,l,!1);e.setUint16(6,n,!1);}"com.microsoft.playready" == this.b.keySystem && "status-pending" == a && (a = "usable");"status-pending" != a && (this.a[b].loaded = !0,this.a.every(function(a){return a.loaded;}) && this.j.resolve());"expired" == a && (d = !0);e = Ta(new Uint8Array(c));this.w[e] = a;}).bind(this));c = a.expiration - Date.now();if(0 > c || d && 1E3 > c)this.a.splice(b,1),a.close();Ic(this.v);}};k.yc = function(){Pa(this.w,function(a,b){return "expired" == b;}) && this.h(new w(6,6014));this.J(this.w);};function Xc(){var a=[],b=[{contentType:'video/mp4; codecs="avc1.42E01E"'},{contentType:'video/webm; codecs="vp8"'}],c=[{videoCapabilities:b,persistentState:"required",sessionTypes:["persistent-license"]},{videoCapabilities:b}],d={};"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(b){var e=navigator.requestMediaKeySystemAccess(b,c).then(function(a){return a.createMediaKeys();}).then(function(a){var c=!1;try{a.createSession("persistent-license"),c = !0;}catch(l) {}d[b] = {persistentState:c};},function(){d[b] = null;});a.push(e);});return Promise.all(a).then(function(){return d;});};function Zc(a){return !a || 1 == a.length && 1E-6 > a.end(0) - a.start(0)?null:a.length?a.end(a.length - 1):null;}function $c(a,b){var c=0;if(!a || 1 == a.length && 1E-6 > a.end(0) - a.start(0))return c;var d=!1,e=1E-4;b || (e = .25);for(var f=0;f < a.length;++f) if(b + e >= a.start(f) && b < a.end(f))c += a.end(f) - b,d = !0;else if(d && .04 >= a.start(f) - a.end(f - 1))c += a.end(f) - a.start(f),c += a.start(f) - a.end(f - 1);else if(0 < f && b + e < a.start(f) && b + e >= a.end(f - 1))if(.04 >= a.start(f) - b)c += a.end(f) - b,d = !0;else break;else d = !1;return c;};function ad(a,b,c){this.f = a;this.h = b;this.j = c;this.c = {};this.b = null;this.a = {};this.g = new y();this.i = !1;}function bd(){var a={};'video/mp4; codecs="avc1.42E01E",video/mp4; codecs="avc3.42E01E",video/mp4; codecs="hvc1.1.6.L93.90",audio/mp4; codecs="mp4a.40.2",audio/mp4; codecs="ac-3",audio/mp4; codecs="ec-3",video/webm; codecs="vp8",video/webm; codecs="vp9",video/webm; codecs="av1",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",video/mp2t; codecs="mp4a.40.2",text/vtt,application/mp4; codecs="wvtt",application/ttml+xml,application/mp4; codecs="stpp"'.split(",").forEach(function(b){a[b] = !!S[b] || MediaSource.isTypeSupported(b);var c=b.split(";")[0];a[c] = a[c] || a[b];});return a;}k = ad.prototype;k.o = function(){this.i = !0;var a=[],b;for(b in this.a) {var c=this.a[b],d=c[0];this.a[b] = c.slice(0,1);d && a.push(d.p["catch"](D));for(d = 1;d < c.length;++d) c[d].p["catch"](D),c[d].p.reject();}this.b && a.push(this.b.o());return Promise.all(a).then((function(){this.g.o();this.b = this.j = this.h = this.f = this.g = null;this.c = {};this.a = {};}).bind(this));};k.init = function(a,b){for(var c in a) {var d=a[c];"text" == c?this.b = new wc(this.j,d,b):(d = this.h.addSourceBuffer(d),z(this.g,d,"error",this.Uc.bind(this,c)),z(this.g,d,"updateend",this.wa.bind(this,c)),this.c[c] = d,this.a[c] = []);}};function cd(a,b){var c;"text" == b?c = a.b.b:(c = dd(a,b),c = !c || 1 == c.length && 1E-6 > c.end(0) - c.start(0)?null:1 == c.length && 0 > c.start(0)?0:c.length?c.start(0):null);return c;}function fd(a,b,c){"text" == b?(b = Ac(a.b,c),b || (b = Ac(a.b,c + .1)) && (b += .1)):(a = dd(a,b),b = $c(a,c),b || (b = $c(a,c + .1)) && (b += .1));return b;}function dd(a,b){try{return a.c[b].buffered;}catch(c) {return null;}}function gd(a,b,c,d,e){return "text" == b?zc(a.b,c,d,e):hd(a,b,a.Tc.bind(a,b,c));}k.remove = function(a,b,c){return "text" == a?this.b.remove(b,c):hd(this,a,this.Cb.bind(this,a,b,c));};function id(a,b){return "text" == b?a.b.remove(0,Infinity):hd(a,b,a.Cb.bind(a,b,0,a.h.duration));}function jd(a,b,c){return "text" == b?(a.b.g = c,Promise.resolve()):hd(a,b,a.Jc.bind(a,b,c));}function kd(a,b,c){return "text" == b?(a.b.f = c,Promise.resolve()):Promise.all([hd(a,b,a.Lb.bind(a,b)),hd(a,b,a.Hc.bind(a,b,c))]);}k.endOfStream = function(a){return ld(this,(function(){a?this.h.endOfStream(a):this.h.endOfStream();}).bind(this));};k.Aa = function(a){return ld(this,(function(){this.h.duration = a;}).bind(this));};k.da = function(){return this.h.duration;};k.Tc = function(a,b){this.c[a].appendBuffer(b);};k.Cb = function(a,b,c){c <= b?this.wa(a):this.c[a].remove(b,c);};k.Lb = function(a){var b=this.c[a].appendWindowEnd;this.c[a].abort();this.c[a].appendWindowEnd = b;this.wa(a);};k.Ub = function(a){this.f.currentTime -= .001;this.wa(a);};k.Jc = function(a,b){this.c[a].timestampOffset = b;this.wa(a);};k.Hc = function(a,b){this.c[a].appendWindowEnd = b + .04;this.wa(a);};k.Uc = function(a){this.a[a][0].p.reject(new w(3,3014,this.f.error?this.f.error.code:0));};k.wa = function(a){var b=this.a[a][0];b && (b.p.resolve(),md(this,a));};function hd(a,b,c){if(a.i)return Promise.reject();c = {start:c,p:new x()};a.a[b].push(c);if(1 == a.a[b].length)try{c.start();}catch(d) {"QuotaExceededError" == d.name?c.p.reject(new w(3,3017,b)):c.p.reject(new w(3,3015,d)),md(a,b);}return c.p;}function ld(a,b){if(a.i)return Promise.reject();var c=[],d;for(d in a.c) {var e=new x(),f={start:(function(a){a.resolve();}).bind(null,e),p:e};a.a[d].push(f);c.push(e);1 == a.a[d].length && f.start();}return Promise.all(c).then((function(){var a,c;try{b();}catch(l) {c = Promise.reject(new w(3,3015,l));}for(a in this.c) md(this,a);return c;}).bind(a),(function(){return Promise.reject();}).bind(a));}function md(a,b){a.a[b].shift();var c=a.a[b][0];if(c)try{c.start();}catch(d) {c.p.reject(new w(3,3015,d)),md(a,b);}};function nd(a,b,c){var d=!1;a.streamSets.forEach(function(a){a.streams.forEach(function(e){var f=e.allowedByApplication;e.allowedByApplication = !0;if("video" == a.type){if(e.width < b.minWidth || e.width > b.maxWidth || e.width > c.width || e.height < b.minHeight || e.height > b.maxHeight || e.height > c.height || e.width * e.height < b.minPixels || e.width * e.height > b.maxPixels || e.bandwidth < b.minVideoBandwidth || e.bandwidth > b.maxVideoBandwidth)e.allowedByApplication = !1;}else "audio" == a.type && (e.bandwidth < b.minAudioBandwidth || e.bandwidth > b.maxAudioBandwidth) && (e.allowedByApplication = !1);f != e.allowedByApplication && (d = !0);});});return d;}function od(a,b,c){var d="",e=null;a && a.A && (d = a.keySystem(),e = a.s);for(a = 0;a < c.streamSets.length;++a) {var f=c.streamSets[a];if(d && f.drmInfos.length && !f.drmInfos.some(function(a){return a.keySystem == d;}))c.streamSets.splice(a,1),--a;else {for(var g=b[f.type],h=0;h < f.streams.length;++h) {var l=f.streams[h],n=pd(l.mimeType,l.codecs);S[n] || MediaSource.isTypeSupported(n)?e && l.encrypted && 0 > e.indexOf(n)?(f.streams.splice(h,1),--h):!g || l.mimeType == g.mimeType && l.codecs.split(".")[0] == g.codecs.split(".")[0] || (f.streams.splice(h,1),--h):(f.streams.splice(h,1),--h);}f.streams.length || (c.streamSets.splice(a,1),--a);}}}function qd(a,b){return a.streamSets.map(function(a){var c=b?b[a.type]:null;return a.streams.filter(function(a){return a.allowedByApplication && a.allowedByKeySystem;}).map(function(b){return {id:b.id,active:c == b,type:a.type,bandwidth:b.bandwidth,language:a.language,kind:b.kind || null,width:b.width || null,height:b.height || null,frameRate:b.frameRate || void 0,codecs:b.codecs || null};});}).reduce(C,[]);}function rd(a,b){for(var c=0;c < a.streamSets.length;c++) for(var d=a.streamSets[c],e=0;e < d.streams.length;e++) {var f=d.streams[e];if(f.id == b.id)return {stream:f,Wc:d};}return null;}function sd(a){return a.streams.some(function(a){return a.allowedByApplication && a.allowedByKeySystem;});}function td(a,b,c){var d={};a.streamSets.forEach(function(a){!sd(a) || a.type in d || (d[a.type] = a);});var e=0;a.streamSets.forEach(function(a){if(sd(a) && "video" == a.type){var b=ud(a);b > e?(e = b,d.video = a):b == e && vd(a) < vd(d.video) && (d.video = a);}});a.streamSets.forEach(function(a){sd(a) && a.primary && (d[a.type].primary?vd(a) < vd(d[a.type]) && (d[a.type] = a):d[a.type] = a);});[Dc,Cc,0].forEach(function(e){a.streamSets.forEach(function(a){if(sd(a)){var f;"audio" == a.type?f = b.preferredAudioLanguage:"text" == a.type && (f = b.preferredTextLanguage);if(f){f = Ec(f);var g=Ec(a.language);Bc(e,f,g) && (a.language == d[a.type].language?vd(a) < vd(d[a.type]) && (d[a.type] = a):d[a.type] = a,c && (c[a.type] = !0));}}});});return d;}function vd(a){var b=0;if(!a || 1 > a.streams.length)return b;a.streams.forEach(function(a){b += a.bandwidth;});return b / a.streams.length;}function ud(a){var b=0;if(!a)return b;a.streams.forEach(function(a){a.height > b && (b = a.height);});return b;}function pd(a,b){var c=a;b && (c += '; codecs="' + b + '"');return c;};function wd(){this.m = this.l = this.j = this.c = this.a = null;this.h = [];this.b = null;this.g = [];this.v = 1;this.i = {};this.s = 0;this.f = null;this.La = this.La.bind(this);}m("shaka.dash.DashParser",wd);k = wd.prototype;k.configure = function(a){this.c = a;};k.start = function(a,b,c,d,e){this.h = [a];this.a = b;this.j = c;this.l = d;this.m = e;return xd(this).then((function(){this.a && yd(this,0);return this.b;}).bind(this));};k.stop = function(){this.a && this.a.Jb(this.La);this.c = this.m = this.l = this.j = this.a = null;this.h = [];this.b = null;this.g = [];this.i = {};null != this.f && (window.clearTimeout(this.f),this.f = null);return Promise.resolve();};function xd(a){return a.a.request(0,rc(a.h,a.c.retryParameters)).then((function(a){if(this.a)return zd(this,a.data,a.uri);}).bind(a));}function zd(a,b,c){var d=Eb(b),e=new DOMParser(),f=null;b = null;try{f = e.parseFromString(d,"text/xml");}catch(E) {}f && "MPD" == f.documentElement.tagName && (b = f.documentElement);if(!b)throw new w(4,4001);c = [c];d = G(b,"Location").map(Wa).filter(La);0 < d.length && (c = a.h = d);d = G(b,"BaseURL").map(Wa);c = L(c,d);var g=I(b,"minBufferTime",J);a.s = I(b,"minimumUpdatePeriod",J,-1);var h=I(b,"availabilityStartTime",Xa),d=I(b,"timeShiftBufferDepth",J),l=I(b,"suggestedPresentationDelay",J),e=I(b,"maxSegmentDuration",J),f=b.getAttribute("type") || "static",n;if(a.b)n = a.b.presentationTimeline;else {var u=Math.max(10,1.5 * g);n = new R(h,null != l?l:u);}var h=Ad(a,{Ra:"static" != f,presentationTimeline:n,K:null,H:null,P:null,u:null,bandwidth:void 0},c,b),l=h.duration,r=h.periods;n.Hb("static" == f);n.Aa(l || Infinity);n.Gb(null != d?d:Infinity);n.Ya(e || 1);if(a.b)return Promise.resolve();b = G(b,"UTCTiming");d = n.R();h.ba && a.a.Ab(a.La);return Bd(a,c,b,d).then((function(a){this.a && (n.Fb(a),this.b = {presentationTimeline:n,periods:r,offlineSessionIds:[],minBufferTime:g || 0});}).bind(a));}function Ad(a,b,c,d){var e=I(d,"mediaPresentationDuration",J),f=!1,g=[],h=0;d = G(d,"Period");for(var l=0;l < d.length;l++) {var n=d[l],h=I(n,"start",J,h),u=I(n,"duration",J);if(null == u)if(l + 1 != d.length){var r=I(d[l + 1],"start",J);null != r && (u = r - h);}else null != e && (u = e - h);var n={start:h,duration:u,node:n,ba:!1},E=a,v=b,r=n;v.K = Cd(r.node,null,c);v.H = r;v.K.id || (v.K.id = "__shaka_period_" + r.start);E = G(r.node,"AdaptationSet").map(E.uc.bind(E,v)).filter(La);if(!E.length)throw new w(4,4004);for(v = 0;v < E.length;v++) E[v].ba && (r.ba = !0);E = Dd(E);r = {startTime:r.start,streamSets:E};g.push(r);f = f || n.ba;n = b.K.id;a.g.every(Ma(n)) && (a.j(r),a.g.push(n),a.b && a.b.periods.push(r));if(null == u){h = null;break;}h += u;}return null != e?{periods:g,duration:e,ba:f}:{periods:g,duration:h,ba:f};}k.uc = function(a,b){a.P = Cd(b,a.K,null);var c=!1,d=G(b,"Role"),e=void 0;"text" == a.P.contentType && (e = "subtitle");for(var f=0;f < d.length;f++) {var g=d[f].getAttribute("schemeIdUri");if(null == g || "urn:mpeg:dash:role:2011" == g)switch((g = d[f].getAttribute("value"),g)){case "main":c = !0;break;case "caption":case "subtitle":e = g;}}var d=!!Va(b,"InbandEventStream"),h=[];G(b,"SupplementalProperty").forEach(function(a){var b=a.getAttribute("schemeIdUri");("urn:mpeg:dash:adaptation-set-switching:2016" == b || "http://dashif.org/guidelines/AdaptationSetSwitching" == b || "http://dashif.org/descriptor/AdaptationSetSwitching" == b) && (a = a.getAttribute("value")) && h.push.apply(h,a.split(","));});var l=null,n=!1;G(b,"EssentialProperty").forEach(function(a){"http://dashif.org/guidelines/trickmode" == a.getAttribute("schemeIdUri")?l = a.getAttribute("value"):n = !0;});if(null != l || n)return null;f = G(b,"ContentProtection");f = eb(f,this.c.dash.customScheme);g = Ec(b.getAttribute("lang") || "und");e = G(b,"Representation").map(this.vc.bind(this,a,f,e,g)).filter(function(a){return !!a;});if(!e.length)throw new w(4,4003);a.P.contentType || (a.P.contentType = Ed(e[0].mimeType,e[0].codecs));return {id:a.P.id || "__fake__" + this.v++,contentType:a.P.contentType,language:g,cc:c,streams:e,drmInfos:f.drmInfos,Yc:h,ba:d};};k.vc = function(a,b,c,d,e){a.u = Cd(e,a.P,null);if(!Fd(a.u))return null;a.bandwidth = I(e,"bandwidth",$a) || void 0;var f;f = this.Cc.bind(this);if(a.u.Ha)f = dc(a,f);else if(a.u.Z)f = gc(a,this.i);else if(a.u.Ia)f = kc(a,f,this.i,!!this.b);else {var g=a.u.M,h=a.H.duration || 0;f = {createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function findSegmentPosition(a){return 0 <= a && a < h?1:null;},getSegmentReference:function getSegmentReference(a){return 1 != a?null:new K(1,0,h,function(){return g;},0,null);},initSegmentReference:null,presentationTimeOffset:0};}e = G(e,"ContentProtection");e = ib(e,this.c.dash.customScheme,b);return {id:this.v++,createSegmentIndex:f.createSegmentIndex,findSegmentPosition:f.findSegmentPosition,getSegmentReference:f.getSegmentReference,initSegmentReference:f.initSegmentReference,presentationTimeOffset:f.presentationTimeOffset,mimeType:a.u.mimeType,codecs:a.u.codecs,frameRate:a.u.frameRate,bandwidth:a.bandwidth,width:a.u.width,height:a.u.height,kind:c,encrypted:0 < b.drmInfos.length,keyId:e,language:d,allowedByApplication:!0,allowedByKeySystem:!0};};k.Sc = function(){this.f = null;var a=Date.now();xd(this).then((function(){this.a && yd(this,(Date.now() - a) / 1E3);}).bind(this))["catch"]((function(a){this.l(a);this.a && yd(this,0);}).bind(this));};function yd(a,b){0 > a.s || (a.f = window.setTimeout(a.Sc.bind(a),1E3 * Math.max(Math.max(3,a.s) - b,0)));}function Cd(a,b,c){b = b || {contentType:"",mimeType:"",codecs:"",frameRate:void 0};c = c || b.M;var d=G(a,"BaseURL").map(Wa),e=a.getAttribute("contentType") || b.contentType,f=a.getAttribute("mimeType") || b.mimeType,g=a.getAttribute("codecs") || b.codecs,h=I(a,"frameRate",bb) || b.frameRate;e || (e = Ed(f,g));return {M:L(c,d),Ha:Va(a,"SegmentBase") || b.Ha,Z:Va(a,"SegmentList") || b.Z,Ia:Va(a,"SegmentTemplate") || b.Ia,width:I(a,"width",ab) || b.width,height:I(a,"height",ab) || b.height,contentType:e,mimeType:f,codecs:g,frameRate:h,id:a.getAttribute("id")};}function Dd(a){var b={};a.forEach(function(a){b[a.id] = [a];});a.forEach(function(a){var c=b[a.id];a.Yc.forEach(function(a){(a = b[a]) && a != c && (c.push.apply(c,a),a.forEach(function(a){b[a.id] = c;}));});});var c=[],d=[];F(b).forEach(function(a){if(!(0 <= d.indexOf(a))){d.push(a);var b=new Ca();a.forEach(function(a){b.push(a.contentType || "",a);});b.keys().forEach(function(a){var d=new Ca();b.get(a).forEach(function(a){d.push(a.language,a);});d.keys().forEach(function(b){var e=d.get(b);b = {language:b,type:a,primary:e.some(function(a){return a.cc;}),drmInfos:e.map(function(a){return a.drmInfos;}).reduce(C,[]),streams:e.map(function(a){return a.streams;}).reduce(C,[])};c.push(b);});});}});return c;}function Fd(a){var b;b = 0 + (a.Ha?1:0);b += a.Z?1:0;b += a.Ia?1:0;if(!b)return "text" == a.contentType || "application" == a.contentType?!0:!1;1 != b && (a.Ha && (a.Z = null),a.Ia = null);return !0;}function Gd(a,b,c,d){b = L(b,[c]);b = rc(b,a.c.retryParameters);b.method = d;return a.a.request(0,b).then(function(a){if("HEAD" == d){if(!a.headers || !a.headers.date)return 0;a = a.headers.date;}else a = Eb(a.data);a = Date.parse(a);return isNaN(a)?0:a - Date.now();});}function Bd(a,b,c,d){c = c.map(function(a){return {scheme:a.getAttribute("schemeIdUri"),value:a.getAttribute("value")};});var e=a.c.dash.clockSyncUri;d && !c.length && e && c.push({scheme:"urn:mpeg:dash:utc:http-head:2014",value:e});return Ka(c,(function(a){var c=a.value;switch(a.scheme){case "urn:mpeg:dash:utc:http-head:2014":case "urn:mpeg:dash:utc:http-head:2012":return Gd(this,b,c,"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 Gd(this,b,c,"GET");case "urn:mpeg:dash:utc:direct:2014":case "urn:mpeg:dash:utc:direct:2012":return a = Date.parse(c),isNaN(a)?0:a - Date.now();case "urn:mpeg:dash:utc:http-ntp:2014":case "urn:mpeg:dash:utc:ntp:2014":case "urn:mpeg:dash:utc:sntp:2014":return Promise.reject();default:return Promise.reject();}}).bind(a))["catch"](function(){return 0;});}k.Cc = function(a,b,c){a = rc(a,this.c.retryParameters);null != b && (a.headers.Range = "bytes=" + b + "-" + (null != c?c:""));return this.a.request(1,a).then(function(a){return a.data;});};k.La = function(a,b){if(1 == a){var c=new Jb(new DataView(b.data)),d=Sb(1701671783,c);if(-1 != d){var e=c.a - 8 + d;O(c,4);d = Rb(c);if("urn:mpeg:dash:event:2012" == d)xd(this);else {var f=Rb(c),g=N(c),h=N(c),l=N(c),n=N(c),c=Qb(c,e - c.a);this.m(new t("emsg",{detail:{ld:d,value:f,Ja:g,kd:h,hd:l,id:n,jd:c}}));}}}};function Ed(a,b){return S[pd(a,b)]?"text":a.split("/")[0];}tc.mpd = wd;sc["application/dash+xml"] = wd;function T(a,b){var c=Eb(a),d=[],e=new DOMParser(),f=null;try{f = e.parseFromString(c,"text/xml");}catch(n) {throw new w(2,2005);}if(f){var g,h;if(c = f.getElementsByTagName("tt")[0])e = c.getAttribute("ttp:frameRate"),f = c.getAttribute("ttp:subFrameRate"),g = c.getAttribute("ttp:frameRateMultiplier"),h = c.getAttribute("ttp:tickRate");else throw new w(2,2006);e = new Hd(e,f,g,h);f = T.b(c.getElementsByTagName("styling")[0]);g = T.b(c.getElementsByTagName("layout")[0]);c = T.b(c.getElementsByTagName("body")[0]);for(h = 0;h < c.length;h++) {var l=T.c(c[h],b,e,f,g);l && d.push(l);}}return d;}m("shaka.media.TtmlTextParser",T);T.m = /^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/;T.v = /^(?:(\d{2,}):)?(\d{2}):(\d{2})$/;T.s = /^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/;T.w = /^(\d*\.?\d*)f$/;T.C = /^(\d*\.?\d*)t$/;T.A = /^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/;T.l = /^(\d{1,2}|100)% (\d{1,2}|100)%$/;T.Da = {left:"start",center:"center",right:"end",start:"start",end:"end"};T.Ka = {left:"line-left",center:"center",right:"line-right"};T.b = function(a){var b=[];if(!a)return b;for(var c=a.childNodes,d=0;d < c.length;d++) {var e="span" == c[d].nodeName && "p" == a.nodeName;c[d].nodeType != Node.ELEMENT_NODE || "br" == c[d].nodeName || e || (e = T.b(c[d]),b = b.concat(e));}b.length || b.push(a);return b;};T.g = function(a){a = a.childNodes;for(var b=0;b < a.length;b++) "br" == a[b].nodeName && 0 < b?a[b - 1].textContent += "\n":0 < a[b].childNodes.length && T.g(a[b]);};T.c = function(a,b,c,d,e){if(!a.hasAttribute("begin") && !a.hasAttribute("end") && /^\s*$/.test(a.textContent))return null;T.g(a);var f=T.a(a.getAttribute("begin"),c),g=T.a(a.getAttribute("end"),c);c = T.a(a.getAttribute("dur"),c);var h=a.textContent;null == g && null != c && (g = f + c);if(null == f || null == g)throw new w(2,2001);b = xc(f + b,g + b,h);if(!b)return null;e = T.i(a,"region",e);T.oa(b,a,e,d);return b;};T.oa = function(a,b,c,d){var e,f=T.f(b,c,d,"tts:extent");f && (e = T.l.exec(f)) && (a.size = Number(e[1]));e = T.f(b,c,d,"tts:writingMode");f = !0;"tb" == e || "tblr" == e?a.vertical = "lr":"tbrl" == e?a.vertical = "rl":f = !1;if(e = T.f(b,c,d,"tts:origin"))if(e = T.l.exec(e))f?(a.position = Number(e[2]),a.line = Number(e[1])):(a.position = Number(e[1]),a.line = Number(e[2])),a.snapToLines = !1;if(b = T.f(b,c,d,"tts:textAlign"))a.align = b,"center" == b && ("center" != a.align && (a.align = "middle"),a.position = "auto"),a.positionAlign = T.Ka[b],a.lineAlign = T.Da[b];};T.f = function(a,b,c,d){for(var e=T.b(b),f=0;f < e.length;f++) {var g=e[f].getAttribute(d);if(g)return g;}e = T.i;return (a = e(b,"style",c) || e(a,"style",c))?a.getAttribute(d):null;};T.i = function(a,b,c){if(!a || 1 > c.length)return null;var d=null;if(a = T.pa(a,b))for(b = 0;b < c.length;b++) if(c[b].getAttribute("xml:id") == a){d = c[b];break;}return d;};T.pa = function(a,b){for(var c=null;a && !(c = a.getAttribute(b));) {var d=a.parentNode;if(d instanceof Element)a = d;else break;}return c;};T.a = function(a,b){var c=null;T.m.test(a)?c = T.qa(b,a):T.v.test(a)?c = T.h(T.v,a):T.s.test(a)?c = T.h(T.s,a):T.w.test(a)?c = T.Ba(b,a):T.C.test(a)?c = T.Ca(b,a):T.A.test(a) && (c = T.h(T.A,a));return c;};T.Ba = function(a,b){var c=T.w.exec(b);return Number(c[1]) / a.frameRate;};T.Ca = function(a,b){var c=T.C.exec(b);return Number(c[1]) / a.a;};T.qa = function(a,b){var c=T.m.exec(b),d=Number(c[1]),e=Number(c[2]),f=Number(c[3]),g=Number(c[4]),g=g + (Number(c[5]) || 0) / a.b,f=f + g / a.frameRate;return f + 60 * e + 3600 * d;};T.h = function(a,b){var c=a.exec(b);return c && "" != c[0]?(Number(c[4]) || 0) / 1E3 + (Number(c[3]) || 0) + 60 * (Number(c[2]) || 0) + 3600 * (Number(c[1]) || 0):null;};function Hd(a,b,c,d){this.frameRate = Number(a) || 30;this.b = Number(b) || 1;this.a = Number(d);this.a || (this.a = a?this.frameRate * this.b:1);c && (a = /^(\d+) (\d+)$/g.exec(c)) && (this.frameRate *= a[1] / a[2]);}S["application/ttml+xml"] = T;function Id(a,b){var c=new Jb(new DataView(a)),d=Sb(1835295092,c);if(-1 != d)return T(Qb(c,d - 8).buffer,b);if(-1 != Tb(a,Id.T))return [];throw new w(2,2007);}m("shaka.media.Mp4TtmlParser",Id);Id.T = 1937010800;S['application/mp4; codecs="stpp"'] = Id;function Jd(a){this.b = a;this.a = 0;}function Kd(a,b){var c;b.lastIndex = a.a;c = (c = b.exec(a.b))?{position:c.index,length:c[0].length,Ec:c}:null;if(a.a == a.b.length || !c || c.position != a.a)return null;a.a += c.length;return c.Ec;}function Ld(a){return a.a == a.b.length?null:(a = Kd(a,/[^ \t\n]*/gm))?a[0]:null;};function U(a,b,c,d,e){a = Eb(a);a = a.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");a = a.split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(a[0]))throw new w(2,2E3);d = [];for(var f=1;f < a.length;f++) {var g=a[f].split("\n");(g = U.c(g,b,c,e)) && d.push(g);}return d;}m("shaka.media.VttTextParser",U);U.c = function(a,b,c,d){if(1 == a.length && !a[0] || /^NOTE($|[ \t])/.test(a[0]))return null;var e=null;0 > a[0].indexOf("--\x3e") && (e = a[0],a.splice(0,1));var f=new Jd(a[0]),g=U.a(f),h=Kd(f,/[ \t]+--\x3e[ \t]+/g),l=U.a(f);if(null == g || !h || null == l)throw new w(2,2001);g += b;l += b;d && (g += c,l += c);a = xc(g,l,a.slice(1).join("\n").trim());if(!a)return null;Kd(f,/[ \t]+/gm);for(b = Ld(f);b;) U.j(a,b),Kd(f,/[ \t]+/gm),b = Ld(f);null != e && (a.id = e);return a;};U.j = function(a,b){var c;if(c = /^align:(start|middle|center|end|left|right)$/.exec(b))a.align = c[1],"center" == c[1] && "center" != a.align && (a.position = "auto",a.align = "middle");else if(c = /^vertical:(lr|rl)$/.exec(b))a.vertical = c[1];else if(c = /^size:(\d{1,2}|100)%$/.exec(b))a.size = Number(c[1]);else if(c = /^position:(\d{1,2}|100)%(?:,(line-left|line-right|center|start|end))?$/.exec(b))a.position = Number(c[1]),c[2] && (a.positionAlign = c[2]);else if(c = /^line:(\d{1,2}|100)%(?:,(start|end|center))?$/.exec(b))a.snapToLines = !1,a.line = Number(c[1]),c[2] && (a.lineAlign = c[2]);else if(c = /^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.snapToLines = !0,a.line = Number(c[1]),c[2] && (a.lineAlign = c[2]);};U.a = function(a){a = Kd(a,/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3})/g);if(!a)return null;var b=Number(a[2]),c=Number(a[3]);return 59 < b || 59 < c?null:Number(a[4]) / 1E3 + c + 60 * b + 3600 * (Number(a[1]) || 0);};S["text/vtt"] = U;S['text/vtt; codecs="vtt"'] = U;function V(a,b,c,d){var e=new Jb(new DataView(a)),f=Sb(1835295092,e);if(-1 != f)return V.ra(Qb(e,f - 8).buffer,b,c,d);if(-1 != Tb(a,V.na))return [];throw new w(2,2008);}m("shaka.media.Mp4VttParser",V);V.ra = function(a,b,c,d){a = new Jb(new DataView(a));c += b;d += b;for(b = [];Lb(a);) {var e=Sb(V.ma,a);if(-1 == e)break;(e = V.c(Qb(a,e - 8).buffer,c,d)) && b.push(e);}return b;};V.c = function(a,b,c){a = new Jb(new DataView(a));for(var d,e,f;Lb(a);) {var g=N(a),h=N(a),l=Eb(Qb(a,g - 8).buffer);1 == g && Pb(a);switch(h){case V.J:d = l;break;case V.G:f = l;break;case V.X:e = l;}}if(!d)throw new w(2,2008);b = xc(b,c,d);if(!b)return null;f && (b.id = f);if(e)for(e = new Jd(e),f = Ld(e);f;) U.j(b,f),Kd(e,/[ \t]+/gm),f = Ld(e);return b;};V.na = 2004251764;V.ma = 1987343459;V.J = 1885436268;V.G = 1768187247;V.X = 1937011815;S['application/mp4; codecs="wvtt"'] = V;function Md(a,b,c,d,e,f){this.a = a;this.c = b;this.j = c;this.s = d;this.l = e;this.m = f;this.b = new y();this.h = !1;this.g = 1;this.i = this.f = null;0 < a.readyState?this.tb():z(this.b,a,"loadedmetadata",this.tb.bind(this));z(this.b,a,"ratechange",this.lc.bind(this));Nd(this);}k = Md.prototype;k.o = function(){var a=this.b.o();this.b = null;Od(this);null != this.f && (window.clearInterval(this.f),this.f = null);this.m = this.l = this.c = this.a = null;return a;};function Pd(a){return 0 < a.a.readyState?Qd(a,a.a.currentTime):Rd(a);}function Rd(a){return a.s?Qd(a,a.s):Infinity > a.c.da()?a.c.sa():Math.max(a.c.Ua(),a.c.sa());}function Sd(a,b){b != a.h && (a.h = b,Td(a,a.g),a.l(b));}function Nd(a){Od(a);a.i = window.setTimeout(a.pc.bind(a),250);}function Od(a){a.i && (window.clearTimeout(a.i),a.i = null);}k.pc = function(){this.i = null;Nd(this);var a=$c(this.a.buffered,this.a.currentTime),b=Zc(this.a.buffered) >= (this.c.R()?this.c.Y() - .1:this.a.duration - .1) || this.a.ended;this.h?(b || a >= this.j) && Sd(this,!1):!b && .5 > a && Sd(this,!0);};k.Ta = function(){return this.g;};function Td(a,b){null != a.f && (window.clearInterval(a.f),a.f = null);a.g = b;a.a.playbackRate = a.h || 0 > b?0:b;!a.h && 0 > b && (a.f = window.setInterval((function(){this.a.currentTime += b / 4;}).bind(a),250));}k.lc = function(){this.a.playbackRate != (this.h || 0 > this.g?0:this.g) && Td(this,this.a.playbackRate);};k.tb = function(){this.b.ja(this.a,"loadedmetadata");var a=Rd(this);.001 > Math.abs(this.a.currentTime - a)?(z(this.b,this.a,"seeking",this.vb.bind(this)),z(this.b,this.a,"playing",this.ub.bind(this))):(z(this.b,this.a,"seeking",this.nc.bind(this)),this.a.currentTime = a);};k.nc = function(){this.b.ja(this.a,"seeking");z(this.b,this.a,"seeking",this.vb.bind(this));z(this.b,this.a,"playing",this.ub.bind(this));};k.vb = function(){var a=this.a.currentTime,b=Ud(this,a);.001 < Math.abs(b - a)?Vd(this,a,b):this.m();};k.ub = function(){var a=this.a.currentTime,b=Ud(this,a);.001 < Math.abs(b - a) && Vd(this,a,b);};function Ud(a,b){var c=a.c,d=c.sa(),e=c.Y();if(!c.R() || Infinity == c.c)return b < d?d:b > e?e:b;c = d + 1;d = c + a.j;return b >= d && b <= e || $c(a.a.buffered,b) && b >= c && b <= e?b:b > e?e:e < d && b >= c && b <= e?b:Math.min(d + 2,e);}function Vd(a,b,c){a.a.currentTime = c;var d=0,e=(function(){!this.a || 10 <= d++ || this.a.currentTime != b || (this.a.currentTime = c,setTimeout(e,100));}).bind(a);setTimeout(e,100);}function Qd(a,b){var c=a.c.sa();if(b < c)return c;c = a.c.Y();return b > c?c:b;};function Wd(a,b,c,d,e,f,g,h,l){this.m = a;this.f = b;this.T = c;this.a = d;this.G = e;this.v = f;this.j = g;this.w = h || null;this.A = l || null;this.h = null;this.i = 1;this.C = Promise.resolve();this.g = [];this.l = {};this.b = {};this.c = this.s = this.J = !1;}Wd.prototype.o = function(){for(var a in this.b) Xd(this.b[a]);this.h = this.b = this.l = this.g = this.A = this.w = this.j = this.v = this.G = this.C = this.a = this.T = this.f = this.m = null;this.c = !0;return Promise.resolve();};Wd.prototype.configure = function(a){this.h = a;this.m.j = this.i * Math.max(this.a.minBufferTime || 0,this.h.rebufferingGoal);};Wd.prototype.init = function(){var a=this.G(this.a.periods[Yd(this,Pd(this.m))]);return Na(a)?Promise.reject(new w(5,5005)):Zd(this,a).then((function(){this.w && this.w();}).bind(this));};function $d(a){return a.a.periods[Yd(a,Pd(a.m))];}function ae(a){return Oa(a.b,function(a){return a.stream;});}function be(a,b){var c={};c.text = b;return Zd(a,c);}function ce(a,b,c,d){var e=a.b[b];!e && "text" == b && a.h.ignoreTextStreamFailures?be(a,c):e && (b = a.g[de(a,c)]) && b.ya && (b = a.l[c.id]) && b.ya && e.stream != c && (e.stream = c,e.Ma = !0,d && (e.aa?e.Qa = !0:e.fa?(e.la = !0,e.Qa = !0):(Xd(e),ee(a,e,!0))));}function Zd(a,b){var c=Yd(a,Pd(a.m)),d=Oa(b,function(a){return pd(a.mimeType,a.codecs);});a.f.init(d,a.h.useRelativeCueTimestamps);fe(a);d = F(b);return ge(a,d).then((function(){if(!this.c)for(var a in b) {var d=b[a];this.b[a] || (this.b[a] = {stream:d,type:a,ua:null,V:null,Ma:!0,Na:c,endOfStream:!1,fa:!1,$:null,la:!1,Qa:!1,aa:!1,bb:!1},he(this,this.b[a],0));}}).bind(a));}function ie(a,b){var c=a.g[b];if(c)return c.I;c = {I:new x(),ya:!1};a.g[b] = c;var d=a.a.periods[b].streamSets.map(function(a){return a.streams;}).reduce(C,[]);a.C = a.C.then((function(){if(!this.c)return ge(this,d);}).bind(a)).then((function(){this.c || (this.g[b].I.resolve(),this.g[b].ya = !0);}).bind(a))["catch"]((function(a){this.c || (this.g[b].I.reject(),delete this.g[b],this.j(a));}).bind(a));return c.I;}function ge(a,b){for(var c=[],d=0;d < b.length;++d) {var e=b[d],f=a.l[e.id];f?c.push(f.I):(a.l[e.id] = {I:new x(),ya:!1},c.push(e.createSegmentIndex()));}return Promise.all(c).then((function(){if(!this.c)for(var a=0;a < b.length;++a) {var c=this.l[b[a].id];c.ya || (c.I.resolve(),c.ya = !0);}}).bind(a))["catch"]((function(a){if(!this.c)return this.l[e.id].I.reject(),delete this.l[e.id],Promise.reject(a);}).bind(a));}function fe(a){var b=a.a.presentationTimeline.da();Infinity > b?a.f.Aa(b):a.f.Aa(Math.pow(2,32));}Wd.prototype.X = function(a){if(!this.c && !a.fa && null != a.$ && !a.aa)if((a.$ = null,a.la))ee(this,a,a.Qa);else {try{var b=je(this,a);null != b && he(this,a,b);}catch(c) {this.j(c);return;}b = F(this.b);ke(this,a);b.every(function(a){return a.endOfStream;}) && this.f.endOfStream();}};function je(a,b){var c=Pd(a.m),d,e;e = a.f;var f=b.type;e = "text" == f?e.b.a:Zc(dd(e,f));var f=b.ua && b.V?a.a.periods[de(a,b.ua)].startTime + b.V.endTime:c,g=de(a,b.stream),h=Yd(a,f),l=a.a.periods[h];g != h?d = null:d = le(a,b,c,e,h);if((d?l.startTime + d.startTime - c:fd(a.f,b.type,c)) >= Math.max(a.i * Math.max(a.a.minBufferTime || 0,a.h.rebufferingGoal),a.i * a.h.bufferingGoal))return .5;if(f >= a.a.presentationTimeline.da())return b.endOfStream = !0,null;b.endOfStream = !1;if(h != g)return b.Na = h,null;d = le(a,b,c,e,g);if(!d)return 1;me(a,b,c,g,d);return null;}function le(a,b,c,d,e){if(b.V && b.stream == b.ua)return c = b.V.position + 1,ne(a,b,e,c);c = b.V?b.stream.findSegmentPosition(Math.max(0,a.a.periods[de(a,b.ua)].startTime + b.V.endTime - a.a.periods[e].startTime)):b.stream.findSegmentPosition(Math.max(0,(d || c) - a.a.periods[e].startTime));if(null == c)return null;var f=null;null == d && (f = ne(a,b,e,Math.max(0,c - 1)));return f || ne(a,b,e,c);}function ne(a,b,c,d){c = a.a.periods[c];b = b.stream.getSegmentReference(d);if(!b)return null;a = a.a.presentationTimeline;d = a.Y();return c.startTime + b.endTime < a.ta() || c.startTime + b.startTime > d?null:b;}function me(a,b,c,d,e){var f=a.a.periods[d],g=b.stream,h=a.a.periods[d + 1],l=null,l=h?h.startTime:a.a.presentationTimeline.da();d = oe(a,b,d,l);b.fa = !0;b.Ma = !1;h = pe(a,e);Promise.all([d,h]).then((function(a){if(!this.c && !this.s)return qe(this,b,c,f,g,e,a[1]);}).bind(a)).then((function(){this.c || this.s || (b.fa = !1,b.bb = !1,he(this,b,0),re(this,g));}).bind(a))["catch"]((function(a){this.c || this.s || (b.fa = !1,1001 == a.code || 1002 == a.code || 1003 == a.code?"text" == b.type && this.h.ignoreTextStreamFailures && 1001 == a.code?delete this.b.text:(this.j(a),he(this,b,4)):3017 == a.code?se(this,b,a):"text" == b.type && this.h.ignoreTextStreamFailures?delete this.b.text:this.j(a));}).bind(a));}function se(a,b,c){if(!F(a.b).some(function(a){return a != b && a.bb;})){var d=Math.round(100 * a.i);if(20 < d)a.i -= .2;else if(4 < d)a.i -= .04;else {a.s = !0;a.j(c);return;}b.bb = !0;}he(a,b,4);}function oe(a,b,c,d){if(!b.Ma)return Promise.resolve();c = jd(a.f,b.type,a.a.periods[c].startTime - b.stream.presentationTimeOffset);d = null != d?kd(a.f,b.type,d):Promise.resolve();if(!b.stream.initSegmentReference)return Promise.all([c,d]);a = pe(a,b.stream.initSegmentReference).then((function(a){if(!this.c)return gd(this.f,b.type,a,null,null);}).bind(a))["catch"](function(a){b.Ma = !0;return Promise.reject(a);});return Promise.all([c,d,a]);}function qe(a,b,c,d,e,f,g){return te(a,b,c).then((function(){if(!this.c)return gd(this.f,b.type,g,f.startTime + d.startTime,f.endTime + d.startTime);}).bind(a)).then((function(){if(!this.c)return b.ua = e,b.V = f,Promise.resolve();}).bind(a));}function te(a,b,c){var d=cd(a.f,b.type);if(null == d)return Promise.resolve();c = c - d - a.h.bufferBehind;return 0 >= c?Promise.resolve():a.f.remove(b.type,d,d + c).then((function(){}).bind(a));}function re(a,b){if(!a.J && (a.J = F(a.b).every(function(a){return "text" == a.type?!0:!a.la && !a.aa && a.V;}),a.J)){var c=de(a,b);a.g[c] || ie(a,c).then((function(){this.v();}).bind(a))["catch"](D);for(c = 0;c < a.a.periods.length;++c) ie(a,c)["catch"](D);a.A && a.A();}}function ke(a,b){if(b.Na != de(a,b.stream)){var c=b.Na,d=F(a.b);d.every(function(a){return a.Na == c;}) && d.every(ue) && ie(a,c).then((function(){if(!this.c){var a=this.G(this.a.periods[c]),b;for(b in this.b) if(!a[b]){this.j(new w(5,5005));return;}for(b in a) if(!(this.b[b] || "text" == b && this.h.ignoreTextStreamFailures)){this.j(new w(5,5005));return;}for(b in this.b) {ce(this,b,a[b],!1);var d=this.b[b];ue(d) && he(this,d,0);}this.v();}}).bind(a))["catch"](D);}}function ue(a){return !a.fa && null == a.$ && !a.la && !a.aa;}function Yd(a,b){for(var c=a.a.periods.length - 1;0 < c;--c) if(b >= a.a.periods[c].startTime)return c;return 0;}function de(a,b){for(var c=0;c < a.a.periods.length;++c) for(var d=a.a.periods[c],e=0;e < d.streamSets.length;++e) if(0 <= d.streamSets[e].streams.indexOf(b))return c;return -1;}function pe(a,b){var c=rc(b.a(),a.h.retryParameters);if(b.L || null != b.D){var d="bytes=" + b.L + "-";null != b.D && (d += b.D);c.headers.Range = d;}return a.T.request(1,c).then(function(a){return a.data;});}function ee(a,b,c){b.la = !1;b.Qa = !1;b.aa = !0;id(a.f,b.type).then((function(){if(!this.c && c){var a=this.f,e=b.type;return "text" == e?Promise.resolve():hd(a,e,a.Ub.bind(a,e));}}).bind(a)).then((function(){this.c || (b.ua = null,b.V = null,b.aa = !1,he(this,b,0));}).bind(a));}function he(a,b,c){b.$ = window.setTimeout(a.X.bind(a,b),1E3 * c);}function Xd(a){null != a.$ && (window.clearTimeout(a.$),a.$ = null);};function ve(a){return new Promise(function(b){var c=a.split(":");if(2 > c.length || "data" != c[0])throw new w(1,1004,a);c = c.slice(1).join(":").split(",");if(2 > c.length)throw new w(1,1004,a);var d=c[0],c=window.decodeURIComponent(c.slice(1).join(",")),d=d.split(";"),e=null;1 < d.length && (e = d[1]);if("base64" == e)c = Ra(c).buffer;else {if(e)throw new w(1,1005,a);c = Ib(c);}b({uri:a,data:c,headers:{"content-type":d[0]}});});}m("shaka.net.DataUriPlugin",ve);pc.data = ve;function we(a,b){return new Promise(function(c,d){var e=new XMLHttpRequest();e.open(b.method,a,!0);e.responseType = "arraybuffer";e.timeout = b.retryParameters.timeout;e.withCredentials = b.allowCrossSiteCredentials;e.onload = function(b){b = b.target;if(200 <= b.status && 299 >= b.status && 202 != b.status){var e=b.getAllResponseHeaders().split("\r\n").reduce(function(a,b){var c=b.split(": ");a[c[0].toLowerCase()] = c.slice(1).join(": ");return a;},{});b.responseURL && (a = b.responseURL);c({uri:a,data:b.response,headers:e});}else {e = null;try{e = Hb(b.response);}catch(l) {}d(new w(1,1001,a,b.status,e));}};e.onerror = function(){d(new w(1,1002,a));};e.ontimeout = function(){d(new w(1,1003,a));};for(var f in b.headers) e.setRequestHeader(f,b.headers[f]);e.send(b.body);});}m("shaka.net.HttpPlugin",we);pc.http = we;pc.https = we;function xe(){this.a = null;this.c = [];this.b = {};}k = xe.prototype;k.init = function(a){if(!window.indexedDB)return Promise.reject(new w(9,9E3));var b=window.indexedDB.open("shaka_offline_db",1),c=new x();b.onupgradeneeded = function(b){b = b.target.result;for(var c in a) b.createObjectStore(c,{keyPath:a[c]});};b.onsuccess = (function(a){this.a = a.target.result;c.resolve();}).bind(this);b.onerror = ye.bind(null,b,c);return c.then((function(){var b=Object.keys(a);return Promise.all(b.map((function(a){return ze(this,a).then((function(b){this.b[a] = b;}).bind(this));}).bind(this)));}).bind(this));};k.o = function(){return Promise.all(this.c.map(function(a){try{a.transaction.abort();}catch(b) {}return a.I["catch"](D);})).then((function(){this.a && (this.a.close(),this.a = null);}).bind(this));};k.get = function(a,b){return Ae(this,a,"readonly",function(a){return a.get(b);});};k.forEach = function(a,b){return Ae(this,a,"readonly",function(a){return a.openCursor();},function(a){a && (b(a.value),a["continue"]());});};function Be(a,b,c){return Ae(a,b,"readwrite",function(a){return a.put(c);});}k.remove = function(a,b){return Ae(this,a,"readwrite",function(a){return a["delete"](b);});};function Ce(a,b){var c=[];return Ae(a,"segment","readwrite",function(a){return a.openCursor();},function(a){if(a){if(b(a.value)){var d=a["delete"](),f=new x();d.onsuccess = f.resolve;d.onerror = ye.bind(null,d,f);c.push(f);}a["continue"]();}}).then(function(){return Promise.all(c);}).then(function(){return c.length;});}function ze(a,b){var c=0;return Ae(a,b,"readonly",function(a){return a.openCursor(null,"prev");},function(a){a && (c = a.key + 1);}).then(function(){return c;});}function Ae(a,b,c,d,e){c = a.a.transaction([b],c);var f=d(c.objectStore(b)),g=new x();e && (f.onsuccess = function(a){e(a.target.result);});f.onerror = ye.bind(null,f,g);var h={transaction:c,I:g};a.c.push(h);var l=(function(){this.c.splice(this.c.indexOf(h),1);}).bind(a);c.oncomplete = function(){l();g.resolve(f.result);};c.onerror = function(a){l();ye(f,g,a);};return g;}function ye(a,b,c){"AbortError" == a.error.name?b.reject(new w(9,9002)):b.reject(new w(9,9001,a.error));c.preventDefault();};var De={manifest:"key",segment:"key"};function Ee(a){return {offlineUri:"offline:" + a.key,originalManifestUri:a.originalManifestUri,duration:a.duration,size:a.size,tracks:a.periods[0].streams.map(function(a){return {id:a.id,active:!1,type:a.contentType,bandwidth:0,language:a.language,kind:a.kind || null,width:a.width,height:a.height,frameRate:a.frameRate,codecs:a.codecs};}),appMetadata:a.appMetadata};};function Fe(a,b,c){this.b = {};this.i = c;this.m = a;this.l = b;this.j = this.a = null;this.f = this.h = this.g = this.c = 0;}Fe.prototype.o = function(){var a=this.j || Promise.resolve();this.b = {};this.j = this.a = this.l = this.m = this.i = null;return a;};function Ge(a,b,c,d,e){a.b[b] = a.b[b] || [];a.b[b].push({uris:c.a(),L:c.L,D:c.D,jb:d,Ea:e});}function He(a,b){a.c = 0;a.g = 0;a.h = 0;a.f = 0;F(a.b).forEach((function(a){a.forEach((function(a){null != a.D?this.c += a.D - a.L + 1:this.h += a.jb;}).bind(this));}).bind(a));a.a = b;a.a.size = a.c;var c=F(a.b).map((function(a){var b=0,c=(function(){if(!this.i)return Promise.reject(new w(9,9002));if(b >= a.length)return Promise.resolve();var d=a[b++];return Ie(this,d).then(c);}).bind(this);return c();}).bind(a));a.b = {};return a.j = Promise.all(c);}function Ie(a,b){var c=rc(b.uris,a.l);if(b.L || null != b.D)c.headers.Range = "bytes=" + b.L + "-" + (null == b.D?"":b.D);var d;return a.m.request(1,c).then((function(a){if(!this.a)return Promise.reject(new w(9,9002));d = a.data.byteLength;return b.Ea(a.data);}).bind(a)).then((function(){if(!this.a)return Promise.reject(new w(9,9002));null == b.D?(this.a.size += d,this.f += b.jb):this.g += d;var a=(this.g + this.f) / (this.c + this.h),c=Ee(this.a);this.i.progressCallback(c,a);}).bind(a));};function Je(){}m("shaka.offline.OfflineManifestParser",Je);Je.prototype.configure = function(){};Je.prototype.start = function(a){var b=/^offline:([0-9]+)$/.exec(a);if(!b)return Promise.reject(new w(1,9004,a));var c=Number(b[1]),d=new xe();return d.init(De).then(function(){return d.get("manifest",c);}).then(function(a){if(!a)throw new w(9,9003,c);return Ke(a);}).then(function(a){return d.o().then(function(){return a;});},function(a){return d.o().then(function(){throw a;});});};Je.prototype.stop = function(){return Promise.resolve();};function Ke(a){var b=new R(null,0);b.Aa(a.duration);var c=a.drmInfo?[a.drmInfo]:[];return {presentationTimeline:b,minBufferTime:10,offlineSessionIds:a.sessionIds,periods:a.periods.map(function(a){return {startTime:a.startTime,streamSets:a.streams.map(function(d){var e=d.segments.map(function(a,b){return new K(b,a.startTime,a.endTime,function(){return [a.uri];},0,null);});b.Ga(a.startTime,e);e = new P(e);return {language:d.language,type:d.contentType,primary:d.primary,drmInfos:c,streams:[{id:d.id,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:e.find.bind(e),getSegmentReference:e.get.bind(e),initSegmentReference:d.initSegmentUri?new yb(function(){return [d.initSegmentUri];},0,null):null,presentationTimeOffset:d.presentationTimeOffset,mimeType:d.mimeType,codecs:d.codecs,bandwidth:0,width:d.width || void 0,height:d.height || void 0,kind:d.kind,encrypted:d.encrypted,keyId:d.keyId,allowedByApplication:!0,allowedByKeySystem:!0}]};})};})};}sc["application/x-offline-manifest"] = Je;function Le(a){if(/^offline:([0-9]+)$/.exec(a)){var b={uri:a,data:new ArrayBuffer(0),headers:{"content-type":"application/x-offline-manifest"}};return Promise.resolve(b);}if(b = /^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(a)){var c=Number(b[1]),d=new xe();return d.init(De).then(function(){return d.get("segment",c);}).then(function(b){return d.o().then(function(){if(!b)throw new w(9,9003,c);return {uri:a,data:b.data,headers:{}};});});}return Promise.reject(new w(1,9004,a));}m("shaka.offline.OfflineScheme",Le);pc.offline = Le;function Me(){this.a = Promise.resolve();this.c = this.b = this.f = !1;this.h = new Promise((function(a){this.g = a;}).bind(this));}Me.prototype.then = function(a){this.a = this.a.then(a).then((function(a){return this.c?(this.g(),Promise.reject(this.i)):Promise.resolve(a);}).bind(this));return this;};function Ne(a){a.f || (a.a = a.a.then((function(a){this.b = !0;return Promise.resolve(a);}).bind(a),(function(a){this.b = !0;return Promise.reject(a);}).bind(a)));a.f = !0;return a.a;}Me.prototype.cancel = function(a){if(this.b)return Promise.resolve();this.c = !0;this.i = a;return this.h;};function Oe(a,b,c,d,e){var f=(e in d),g;for(g in b) {var h=e + "." + g,l=f?d[e]:c[g],n=!!({".abr.manager":!0})[h];if(f || g in a)void 0 === b[g]?void 0 === l || f?delete a[g]:a[g] = l:n?a[g] = b[g]:"object" == typeof a[g] && "object" == typeof b[g]?Oe(a[g],b[g],l,d,h):typeof b[g] == typeof l && (a[g] = b[g]);}};function W(a,b){p.call(this);this.A = !1;this.f = a;this.s = null;this.w = new y();this.Ka = new q();this.oa = this.c = this.m = this.b = this.j = this.pa = this.G = this.h = this.g = this.i = null;this.Kb = 1E9;this.na = [];this.Da = !1;this.ra = !0;this.J = this.l = null;this.v = {};this.a = Pe(this);this.Ca = {width:Infinity,height:Infinity};this.C = [];this.ma = this.T = this.qa = 0;b && b(this);this.i = new Q(this.Oc.bind(this));this.pa = Qe(this);for(var c=0;c < this.f.textTracks.length;++c) {var d=this.f.textTracks[c];d.mode = "disabled";"Shaka Player TextTrack" == d.label && (this.s = d);}this.s || (this.s = this.f.addTextTrack("subtitles","Shaka Player TextTrack"));this.s.mode = "hidden";z(this.w,this.f,"error",this.oc.bind(this));}ba(W);m("shaka.Player",W);W.prototype.o = function(){this.A = !0;var a=Promise.resolve();this.l && (a = this.l.cancel(new w(7,7E3)));return a.then((function(){var a=Promise.all([this.J,Re(this),this.w?this.w.o():null,this.i?this.i.o():null]);this.a = this.i = this.Ka = this.w = this.s = this.f = null;return a;}).bind(this));};W.prototype.destroy = W.prototype.o;W.version = "v2.0.3-16-g91ba1f3";var Se={};W.registerSupportPlugin = function(a,b){Se[a] = b;};W.isBrowserSupported = function(){return !!window.Promise && !!window.Uint8Array && !!Array.prototype.forEach && !!window.MediaSource && !!window.MediaKeys && !!window.navigator && !!window.navigator.requestMediaKeySystemAccess && !!window.MediaKeySystemAccess && !!window.MediaKeySystemAccess.prototype.getConfiguration;};W.probeSupport = function(){return Xc().then(function(a){var b=uc(),c=bd();a = {manifest:b,media:c,drm:a};for(var d in Se) a[d] = Se[d]();return a;});};W.prototype.load = function(a,b,c){var d=this.ib(),e=new Me();this.l = e;this.dispatchEvent(new t("loading"));return Ne(e.then(function(){return d;}).then((function(){return vc(a,this.i,this.a.manifest.retryParameters,c);}).bind(this)).then((function(b){this.m = new b();this.m.configure(this.a.manifest);return this.m.start(a,this.i,this.Oa.bind(this),this.ga.bind(this),this.Lc.bind(this));}).bind(this)).then((function(b){if(0 == b.periods.length)throw new w(4,4014);this.c = b;this.oa = a;this.g = new Jc(this.i,this.ga.bind(this),this.Mc.bind(this));this.g.configure(this.a.drm);return this.g.init(b,!1);}).bind(this)).then((function(){this.c.periods.forEach(this.Oa.bind(this));this.ma = Date.now() / 1E3;return Promise.all([Mc(this.g,this.f),this.pa]);}).bind(this)).then((function(){this.j = new Md(this.f,this.c.presentationTimeline,1 * Math.max(this.c.minBufferTime || 0,this.a.streaming.rebufferingGoal),b || null,this.Ib.bind(this),this.Nc.bind(this));this.G = new ad(this.f,this.h,this.s);this.b = new Wd(this.j,this.G,this.i,this.c,this.Kc.bind(this),this.Nb.bind(this),this.ga.bind(this));this.b.configure(this.a.streaming);return this.b.init();}).bind(this)).then((function(){this.c.periods.forEach(this.Oa.bind(this));Te(this);Ue(this);this.a.abr.manager.init(this.gb.bind(this));this.l = null;}).bind(this)))["catch"]((function(a){this.l == e && (this.l = null,this.dispatchEvent(new t("unloading")));return Promise.reject(a);}).bind(this));};W.prototype.load = W.prototype.load;function Qe(a){a.h = new MediaSource();var b=new x();z(a.w,a.h,"sourceopen",b.resolve);a.f.src = window.URL.createObjectURL(a.h);return b;}W.prototype.configure = function(a){a.abr && a.abr.manager && a.abr.manager != this.a.abr.manager && (this.a.abr.manager.stop(),a.abr.manager.init(this.gb.bind(this)));Oe(this.a,a,Pe(this),Ve(),"");We(this);};W.prototype.configure = W.prototype.configure;function We(a){a.m && a.m.configure(a.a.manifest);a.g && a.g.configure(a.a.drm);if(a.b){a.b.configure(a.a.streaming);try{a.c.periods.forEach(a.Oa.bind(a));}catch(b) {a.ga(b);}Xe(a,$d(a.b));}a.a.abr.enabled && !a.ra?a.a.abr.manager.enable():a.a.abr.manager.disable();a.a.abr.manager.setDefaultEstimate(a.a.abr.defaultBandwidthEstimate);}W.prototype.getConfiguration = function(){var a=Pe(this);Oe(a,this.a,Pe(this),Ve(),"");return a;};W.prototype.getConfiguration = W.prototype.getConfiguration;W.prototype.Dc = function(){var a=Pe(this);a.abr && a.abr.manager && a.abr.manager != this.a.abr.manager && (this.a.abr.manager.stop(),a.abr.manager.init(this.gb.bind(this)));this.a = Pe(this);We(this);};W.prototype.resetConfiguration = W.prototype.Dc;W.prototype.ob = function(){return this.i;};W.prototype.getNetworkingEngine = W.prototype.ob;W.prototype.Vb = function(){return this.oa;};W.prototype.getManifestUri = W.prototype.Vb;W.prototype.R = function(){return this.c?this.c.presentationTimeline.R():!1;};W.prototype.isLive = W.prototype.R;W.prototype.ea = function(){return this.c?this.c.presentationTimeline.ea():!1;};W.prototype.isInProgress = W.prototype.ea;W.prototype.Fc = function(){var a=0,b=0;this.c && (b = this.c.presentationTimeline,a = b.ta(),b = b.Ua());return {start:a,end:b};};W.prototype.seekRange = W.prototype.Fc;W.prototype.keySystem = function(){return this.g?this.g.keySystem():"";};W.prototype.keySystem = W.prototype.keySystem;W.prototype.drmInfo = function(){return this.g?this.g.b:null;};W.prototype.drmInfo = W.prototype.drmInfo;W.prototype.Zb = function(){return this.Da;};W.prototype.isBuffering = W.prototype.Zb;W.prototype.ib = function(){if(this.A)return Promise.resolve();this.dispatchEvent(new t("unloading"));var a=Promise.resolve();this.l && (a = new w(7,7E3),a = this.l.cancel(a));return a.then((function(){this.J || (this.J = Ye(this).then((function(){this.J = null;}).bind(this)));return this.J;}).bind(this));};W.prototype.unload = W.prototype.ib;W.prototype.Ta = function(){return this.j?this.j.Ta():0;};W.prototype.getPlaybackRate = W.prototype.Ta;W.prototype.Zc = function(a){this.j && Td(this.j,a);};W.prototype.trickPlay = W.prototype.Zc;W.prototype.Ob = function(){this.j && Td(this.j,1);};W.prototype.cancelTrickPlay = W.prototype.Ob;W.prototype.getTracks = function(){if(!this.b)return [];var a=ae(this.b);return qd($d(this.b),a).filter((function(a){return 0 > this.na.indexOf(a.id);}).bind(this));};W.prototype.getTracks = W.prototype.getTracks;W.prototype.Gc = function(a,b){if(this.b){var c=rd($d(this.b),a);if(c){var d=c.stream;d.allowedByApplication && d.allowedByKeySystem && (this.C.push({timestamp:Date.now() / 1E3,id:d.id,type:a.type,fromAdaptation:!1}),c = {},c[a.type] = d,"text" != a.type && (d = ae(this.b).text,this.configure({abr:{enabled:!1}}),d && (c.text = d)),Ze(this,c,b));}}};W.prototype.selectTrack = W.prototype.Gc;W.prototype.bc = function(){return "showing" == this.s.mode;};W.prototype.isTextTrackVisible = W.prototype.bc;W.prototype.Ic = function(a){this.s.mode = a?"showing":"hidden";$e(this);};W.prototype.setTextTrackVisibility = W.prototype.Ic;W.prototype.getStats = function(){af(this);var a={},b={},c=this.f && this.f.getVideoPlaybackQuality?this.f.getVideoPlaybackQuality():{};this.b && (b = ae(this.b),a = b.video || {},b = b.audio || {});return {width:a.width || 0,height:a.height || 0,streamBandwidth:a.bandwidth + b.bandwidth || 0,decodedFrames:Number(c.totalVideoFrames),droppedFrames:Number(c.droppedVideoFrames),estimatedBandwidth:this.a.abr.manager.getBandwidthEstimate(),playTime:this.qa,bufferingTime:this.T,switchHistory:this.C.slice(0)};};W.prototype.getStats = W.prototype.getStats;W.prototype.addTextTrack = function(a,b,c,d,e){if(!this.b)return Promise.reject();for(var f=$d(this.b),g,h=0;h < this.c.periods.length;h++) if(this.c.periods[h] == f){if(h == this.c.periods.length - 1){if((g = this.c.presentationTimeline.da() - f.startTime,Infinity == g))return Promise.reject();}else g = this.c.periods[h + 1].startTime - f.startTime;break;}var l={id:this.Kb++,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function findSegmentPosition(){return 1;},getSegmentReference:function getSegmentReference(b){return 1 != b?null:new K(1,0,g,function(){return [a];},0,null);},initSegmentReference:null,presentationTimeOffset:0,mimeType:d,codecs:e || "",bandwidth:0,kind:c,encrypted:!1,keyId:null,language:b,allowedByApplication:!0,allowedByKeySystem:!0};d = {language:b,type:"text",primary:!1,drmInfos:[],streams:[l]};this.na.push(l.id);f.streamSets.push(d);return be(this.b,l).then((function(){if(!this.A)return this.na.splice(this.na.indexOf(l.id),1),Xe(this,f),Te(this),{id:l.id,active:!1,type:"text",bandwidth:0,language:b,kind:c,width:null,height:null};}).bind(this));};W.prototype.addTextTrack = W.prototype.addTextTrack;W.prototype.eb = function(a,b){this.Ca.width = a;this.Ca.height = b;};W.prototype.setMaxHardwareResolution = W.prototype.eb;function Re(a){a.w && a.w.ja(a.h,"sourceopen");a.f && (a.f.removeAttribute("src"),a.f.load());var b=Promise.all([a.a?a.a.abr.manager.stop():null,a.g?a.g.o():null,a.G?a.G.o():null,a.j?a.j.o():null,a.b?a.b.o():null,a.m?a.m.stop():null]);a.g = null;a.G = null;a.j = null;a.b = null;a.m = null;a.c = null;a.oa = null;a.pa = null;a.h = null;a.v = {};a.C = [];a.qa = 0;a.T = 0;return b;}function Ye(a){return a.m?Re(a).then((function(){this.A || (this.Ib(!1),this.pa = Qe(this));}).bind(a)):Promise.resolve();}function Ve(){return {".drm.servers":"",".drm.clearKeys":"",".drm.advanced":{distinctiveIdentifierRequired:!1,persistentStateRequired:!1,videoRobustness:"",audioRobustness:"",serverCertificate:null}};}function Pe(a){return {drm:{retryParameters:qc(),servers:{},clearKeys:{},advanced:{}},manifest:{retryParameters:qc(),dash:{customScheme:function customScheme(a){if(a)return null;},clockSyncUri:""}},streaming:{retryParameters:qc(),rebufferingGoal:2,bufferingGoal:10,bufferBehind:30,ignoreTextStreamFailures:!1,useRelativeCueTimestamps:!1},abr:{manager:a.Ka,enabled:!0,defaultBandwidthEstimate:5E5},preferredAudioLanguage:"",preferredTextLanguage:"",restrictions:{minWidth:0,maxWidth:Infinity,minHeight:0,maxHeight:Infinity,minPixels:0,maxPixels:Infinity,minAudioBandwidth:0,maxAudioBandwidth:Infinity,minVideoBandwidth:0,maxVideoBandwidth:Infinity}};}k = W.prototype;k.Oa = function(a){var b=this.b?ae(this.b):{};od(this.g,b,a);b = a.streamSets.some(sd);nd(a,this.a.restrictions,this.Ca) && !this.l && Te(this);a = !a.streamSets.some(sd);if(!b)throw new w(4,4011);if(a)throw new w(4,4012);};function Ze(a,b,c){for(var d in b) {var e=b[d],f=c || !1;"text" == d && (f = !0);a.ra?a.v[d] = {stream:e,Rb:f}:ce(a.b,d,e,f);}}function af(a){if(a.c){var b=Date.now() / 1E3;a.Da?a.T += b - a.ma:a.qa += b - a.ma;a.ma = b;}}k.Oc = function(a,b,c){this.a.abr.manager.segmentDownloaded(a,b,c);};k.Ib = function(a){af(this);this.Da = a;this.dispatchEvent(new t("buffering",{buffering:a}));};k.Nc = function(){if(this.b){var a=this.b,b;for(b in a.b) {var c=a.b[b];c.aa || 0 < fd(a.f,b,Pd(a.m)) || c.la || (c.fa?c.la = !0:null == cd(a.f,b)?null == c.$ && he(a,c,0):(Xd(c),ee(a,c,!1)));}}};function bf(a,b,c){if(!F(b).some(sd))return a.ga(new w(4,4012)),{};var d={};if(c)["video","audio","text"].forEach(function(a){a in b && (d[a] = b[a]);});else {c = ae(a.b);for(var e in c) {var f=c[e];f.allowedByApplication && f.allowedByKeySystem && b[e].language == f.language || (d[e] = b[e]);}}if(Na(d))return {};ha(Object.keys(d));var g=a.a.abr.manager.chooseStreams(d);return Pa(d,function(a){return !!g[a];})?g:(a.ga(new w(4,4012)),{});}function Xe(a,b){var c={audio:!1,text:!1},d=td(b,a.a,c),e=bf(a,d),f;for(f in e) a.C.push({timestamp:Date.now() / 1E3,id:e[f].id,type:f,fromAdaptation:!0});Ze(a,e,!0);Ue(a);d.text && d.audio && c.text && d.text.language != d.audio.language && (a.s.mode = "showing",$e(a));}k.Kc = function(a){this.ra = !0;this.a.abr.manager.disable();a = td(a,this.a);a = bf(this,a,!0);for(var b in this.v) a[b] = this.v[b].stream;this.v = {};for(b in a) this.C.push({timestamp:Date.now() / 1E3,id:a[b].id,type:b,fromAdaptation:!0});this.l || Te(this);return a;};k.Nb = function(){this.ra = !1;this.a.abr.enabled && this.a.abr.manager.enable();for(var a in this.v) {var b=this.v[a];ce(this.b,a,b.stream,b.Rb);}this.v = {};};k.gb = function(a,b){var c=ae(this.b),d;for(d in a) {var e=a[d];c[d] != e?this.C.push({timestamp:Date.now() / 1E3,id:e.id,type:d,fromAdaptation:!0}):delete a[d];}if(!Na(a) && this.b){for(d in a) ce(this.b,d,a[d],b || !1);Ue(this);}};function Ue(a){Promise.resolve().then((function(){this.A || this.dispatchEvent(new t("adaptation"));}).bind(a));}function Te(a){Promise.resolve().then((function(){this.A || this.dispatchEvent(new t("trackschanged"));}).bind(a));}function $e(a){a.dispatchEvent(new t("texttrackvisibility"));}k.ga = function(a){this.dispatchEvent(new t("error",{detail:a}));};k.Lc = function(a){this.dispatchEvent(a);};k.oc = function(){if(this.f.error){var a=this.f.error.code;if(1 != a){var b=this.f.error.msExtendedCode;b && (0 > b && (b += Math.pow(2,32)),b = b.toString(16));this.ga(new w(3,3016,a,b));}}};k.Mc = function(a){var b=["output-restricted","internal-error"],c=$d(this.b),d=!1;c.streamSets.forEach(function(c){c.streams.forEach(function(c){var e=c.allowedByKeySystem;c.keyId && c.keyId in a && (c.allowedByKeySystem = 0 > b.indexOf(a[c.keyId]));e != c.allowedByKeySystem && (d = !0);});});Xe(this,c);d && Te(this);};function X(a){this.a = new xe();this.c = a;this.j = cf(this);this.h = null;this.v = !1;this.i = null;this.l = [];this.f = -1;this.m = 0;this.b = null;this.g = new Fe(a.i,a.getConfiguration().streaming.retryParameters,this.j);}m("shaka.offline.Storage",X);function df(){return !!window.indexedDB;}X.support = df;X.prototype.o = function(){var a=this.l,b=this.a,c=this.g?this.g.o()["catch"](function(){}).then(function(){return Promise.all(a.map(function(a){return b.remove("segment",a);}));}).then(function(){return b.o();}):Promise.resolve();this.j = this.c = this.g = this.a = null;return c;};X.prototype.destroy = X.prototype.o;X.prototype.configure = function(a){Oe(this.j,a,cf(this),{},"");};X.prototype.configure = X.prototype.configure;X.prototype.Vc = function(a,b,c){function d(a){f = a;}if(this.v)return Promise.reject(new w(9,9006));this.v = !0;var e,f=null;return ef(this).then((function(){Y(this);return ff(this,a,d,c);}).bind(this)).then((function(c){Y(this);this.b = c.manifest;this.h = c.Sb;if(this.b.presentationTimeline.R() || this.b.presentationTimeline.ea())throw new w(9,9005,a);this.b.periods.forEach(this.s.bind(this));this.f = this.a.b.manifest++;this.m = 0;c = this.b.periods.map(this.w.bind(this));var d=this.h.b,f=Rc(this.h);if(d){if(!f.length)throw new w(9,9007,a);d.initData = [];}e = {key:this.f,originalManifestUri:a,duration:this.m,size:0,periods:c,sessionIds:f,drmInfo:d,appMetadata:b};return He(this.g,e);}).bind(this)).then((function(){Y(this);if(f)throw f;return Be(this.a,"manifest",e);}).bind(this)).then((function(){return gf(this);}).bind(this)).then((function(){return Ee(e);}).bind(this))["catch"]((function(a){return gf(this)["catch"](D).then(function(){throw a;});}).bind(this));};X.prototype.store = X.prototype.Vc;X.prototype.remove = function(a){function b(a){6013 != a.code && (e = a);}var c=a.offlineUri,d=/^offline:([0-9]+)$/.exec(c);if(!d)return Promise.reject(new w(9,9004,c));var e=null,f,g,h=Number(d[1]);return ef(this).then((function(){Y(this);return this.a.get("manifest",h);}).bind(this)).then((function(a){Y(this);if(!a)throw new w(9,9003,c);f = a;a = Ke(f);g = new Jc(this.c.i,b,function(){});g.configure(this.c.getConfiguration().drm);return g.init(a,!0);}).bind(this)).then((function(){return Oc(g,f.sessionIds);}).bind(this)).then((function(){return g.o();}).bind(this)).then((function(){Y(this);if(e)throw e;var b=f.periods.map(function(a){return a.streams.map(function(a){var b=a.segments.map(function(a){a = /^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(a.uri);return Number(a[1]);});a.initSegmentUri && (a = /^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(a.initSegmentUri),b.push(Number(a[1])));return b;}).reduce(C,[]);}).reduce(C,[]),c=0,d=b.length,g=this.j.progressCallback;return Ce(this.a,(function(e){e = b.indexOf(e.key);0 <= e && (g(a,c / d),c++);return 0 <= e;}).bind(this));}).bind(this)).then((function(){Y(this);this.j.progressCallback(a,1);return this.a.remove("manifest",h);}).bind(this));};X.prototype.remove = X.prototype.remove;X.prototype.list = function(){var a=[];return ef(this).then((function(){Y(this);return this.a.forEach("manifest",function(b){a.push(Ee(b));});}).bind(this)).then(function(){return a;});};X.prototype.list = X.prototype.list;function ff(a,b,c,d){function e(){}var f=a.c.i,g=a.c.getConfiguration(),h,l,n;return vc(b,f,g.manifest.retryParameters,d).then((function(a){Y(this);n = new a();n.configure(g.manifest);return n.start(b,f,this.s.bind(this),c);}).bind(a)).then((function(a){Y(this);h = a;l = new Jc(f,c,e);l.configure(g.drm);return l.init(h,!0);}).bind(a)).then((function(){Y(this);return hf(h);}).bind(a)).then((function(){Y(this);return Nc(l);}).bind(a)).then((function(){Y(this);return n.stop();}).bind(a)).then((function(){Y(this);return {manifest:h,Sb:l};}).bind(a))["catch"](function(a){if(n)return n.stop().then(function(){throw a;});throw a;});}X.prototype.A = function(a){var b=[],c=a.filter(function(a){return "video" == a.type && 480 >= a.height;});c.sort(function(a,b){return b.bandwidth - a.bandwidth;});c.length && b.push(c[0]);for(var d=Ec(this.c.getConfiguration().preferredAudioLanguage),c=[0,Cc,Dc],e=a.filter(function(a){return "audio" == a.type;}),c=c.map(function(a){return e.filter(function(b){b = Ec(b.language);return Bc(a,d,b);});}),f=e,g=0;g < c.length;g++) c[g].length && (f = c[g]);f.sort(function(a,b){return a.bandwidth - b.bandwidth;});f.length && b.push(f[Math.floor(f.length / 2)]);var c=Ec(this.c.getConfiguration().preferredTextLanguage),h=Bc.bind(null,Dc,c);b.push.apply(b,a.filter(function(a){var b=Ec(a.language);return "text" == a.type && h(b);}));return b;};function cf(a){return {trackSelectionCallback:a.A.bind(a),progressCallback:function progressCallback(a,c){if(a || c)return null;}};}function ef(a){return a.a.a?Promise.resolve():a.a.init(De);}X.prototype.s = function(a){function b(a,b,c){b = b.filter(function(a){return a.type == c;});return 0 == b.length?null:rd(a,b[0]).stream;}var c={};this.i && (c = {video:b(this.b.periods[0],this.i,"video"),audio:b(this.b.periods[0],this.i,"audio")});od(this.h,c,a);nd(a,this.c.getConfiguration().restrictions,{width:Infinity,height:Infinity});};function gf(a){var b=a.h?a.h.o():Promise.resolve();a.h = null;a.b = null;a.v = !1;a.i = null;a.l = [];a.f = -1;return b;}function hf(a){a = a.periods.map(function(a){return a.streamSets;}).reduce(C,[]).map(function(a){return a.streams;}).reduce(C,[]);return Promise.all(a.map(function(a){return a.createSegmentIndex();}));}X.prototype.w = function(a){var b=qd(a,null),b=this.j.trackSelectionCallback(b);this.i || (this.i = b,this.b.periods.forEach(this.s.bind(this)));for(var c=b.length - 1;0 < c;--c) {for(var d=!1,e=c - 1;0 <= e;--e) if(b[c].type == b[e].type && b[c].kind == b[e].kind && b[c].language == b[e].language){d = !0;break;}if(d)break;}b = b.map((function(b){b = rd(a,b);return jf(this,a,b.Wc,b.stream);}).bind(this));return {startTime:a.startTime,streams:b};};function jf(a,b,c,d){for(var e=[],f=a.b.presentationTimeline.sa(),g=f,h=d.findSegmentPosition(f),l=null != h?d.getSegmentReference(h):null;l;) {var n=a.a.b.segment++;Ge(a.g,c.type,l,(l.endTime - l.startTime) * d.bandwidth / 8,(function(a,b,c,d){b = {key:a,data:d,manifestKey:this.f,streamNumber:c,segmentNumber:b};this.l.push(a);return Be(this.a,"segment",b);}).bind(a,n,l.position,d.id));e.push({startTime:l.startTime,endTime:l.endTime,uri:"offline:" + a.f + "/" + d.id + "/" + n});g = l.endTime + b.startTime;l = d.getSegmentReference(++h);}a.m = Math.max(a.m,g - f);b = null;d.initSegmentReference && (n = a.a.b.segment++,b = "offline:" + a.f + "/" + d.id + "/" + n,Ge(a.g,c.type,d.initSegmentReference,0,(function(a,b){var c={key:n,data:b,manifestKey:this.f,streamNumber:a,segmentNumber:-1};this.l.push(n);return Be(this.a,"segment",c);}).bind(a,d.id)));return {id:d.id,primary:c.primary,presentationTimeOffset:d.presentationTimeOffset || 0,contentType:c.type,mimeType:d.mimeType,codecs:d.codecs,frameRate:d.frameRate,kind:d.kind,language:c.language,width:d.width || null,height:d.height || null,initSegmentUri:b,encrypted:d.encrypted,keyId:d.keyId,segments:e};}function Y(a){if(!a.c)throw new w(9,9002);}Se.offline = df;m("shaka.polyfill.installAll",function(){for(var a=0;a < kf.length;++a) kf[a]();});var kf=[];function lf(a){kf.push(a);}m("shaka.polyfill.register",lf);function mf(a){var b=a.type.replace(/^(webkit|moz|MS)/,"").toLowerCase(),b=new Event(b,a);a.target.dispatchEvent(b);}lf(function(){if(window.Document){var a=Element.prototype;a.requestFullscreen = a.requestFullscreen || a.mozRequestFullScreen || a.msRequestFullscreen || a.webkitRequestFullscreen;a = Document.prototype;a.exitFullscreen = a.exitFullscreen || a.mozCancelFullScreen || a.msExitFullscreen || a.webkitExitFullscreen;"fullscreenElement" in document || Object.defineProperty(document,"fullscreenElement",{get:function get(){return document.mozFullScreenElement || document.msFullscreenElement || document.webkitFullscreenElement;}});document.addEventListener("webkitfullscreenchange",mf);document.addEventListener("webkitfullscreenerror",mf);document.addEventListener("mozfullscreenchange",mf);document.addEventListener("mozfullscreenerror",mf);document.addEventListener("MSFullscreenChange",mf);document.addEventListener("MSFullscreenError",mf);}});function nf(a){this.c = [];this.b = [];this.a = [];for(a = new Jb(new DataView(a.buffer));Lb(a);) {var b=Sb(1886614376,a);if(-1 == b)break;var c=a.a - 8,d=Mb(a);if(1 < d)O(a,b - (a.a - c));else {O(a,3);var e=Ta(Qb(a,16)),f=[];if(0 < d)for(var d=N(a),g=0;g < d;++g) {var h=Ta(Qb(a,16));f.push(h);}d = N(a);O(a,d);this.b.push.apply(this.b,f);this.c.push(e);this.a.push({start:c,end:a.a - 1});a.a != c + b && O(a,b - (a.a - c));}}};function of(a,b){try{var c=new pf(a,b);return Promise.resolve(c);}catch(d) {return Promise.reject(d);}}function pf(a,b){this.keySystem = a;for(var c=!1,d=0;d < b.length;++d) {var e=b[d],f={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:e.initDataTypes,sessionTypes:["temporary"],label:e.label},g=!1;if(e.audioCapabilities)for(var h=0;h < e.audioCapabilities.length;++h) {var l=e.audioCapabilities[h];if(l.contentType){var g=!0,n=l.contentType.split(";")[0];MSMediaKeys.isTypeSupported(this.keySystem,n) && (f.audioCapabilities.push(l),c = !0);}}if(e.videoCapabilities)for(h = 0;h < e.videoCapabilities.length;++h) l = e.videoCapabilities[h],l.contentType && (g = !0,n = l.contentType.split(";")[0],MSMediaKeys.isTypeSupported(this.keySystem,n) && (f.videoCapabilities.push(l),c = !0));g || (c = MSMediaKeys.isTypeSupported(this.keySystem,"video/mp4"));"required" == e.persistentState && (f.persistentState = "required",f.sessionTypes = ["persistent-license"]);if(c){this.a = f;return;}}c = Error("Unsupported keySystem");c.name = "NotSupportedError";c.code = DOMException.NOT_SUPPORTED_ERR;throw c;}pf.prototype.createMediaKeys = function(){var a=new qf(this.keySystem);return Promise.resolve(a);};pf.prototype.getConfiguration = function(){return this.a;};function rf(a){var b=this.mediaKeys;b && b != a && sf(b,null);delete this.mediaKeys;return (this.mediaKeys = a)?sf(a,this):Promise.resolve();}function qf(a){this.a = new MSMediaKeys(a);this.b = new y();}qf.prototype.createSession = function(a){if("temporary" != (a || "temporary"))throw new TypeError("Session type " + a + " is unsupported on this platform.");return new tf(this.a);};qf.prototype.setServerCertificate = function(){return Promise.reject(Error("setServerCertificate not supported on this platform."));};function sf(a,b){function c(){b.msSetMediaKeys(d.a);b.removeEventListener("loadedmetadata",c);}Da(a.b);if(!b)return Promise.resolve();z(a.b,b,"msneedkey",uf);var d=a;try{return 1 <= b.readyState?b.msSetMediaKeys(a.a):b.addEventListener("loadedmetadata",c),Promise.resolve();}catch(e) {return Promise.reject(e);}}function tf(a){p.call(this);this.c = null;this.g = a;this.b = this.a = null;this.f = new y();this.sessionId = "";this.expiration = NaN;this.closed = new x();this.keyStatuses = new vf();}ba(tf);k = tf.prototype;k.generateRequest = function(a,b){this.a = new x();try{this.c = this.g.createSession("video/mp4",new Uint8Array(b),null),z(this.f,this.c,"mskeymessage",this.kc.bind(this)),z(this.f,this.c,"mskeyadded",this.ic.bind(this)),z(this.f,this.c,"mskeyerror",this.jc.bind(this)),wf(this,"status-pending");}catch(c) {this.a.reject(c);}return this.a;};k.load = function(){return Promise.reject(Error("MediaKeySession.load not yet supported"));};k.update = function(a){this.b = new x();try{this.c.update(new Uint8Array(a));}catch(b) {this.b.reject(b);}return this.b;};k.close = function(){try{this.c.close(),this.closed.resolve(),Da(this.f);}catch(a) {this.closed.reject(a);}return this.closed;};k.remove = function(){return Promise.reject(Error("MediaKeySession.remove is only applicable for persistent licenses, which are not supported on this platform"));};function uf(a){var b=document.createEvent("CustomEvent");b.initCustomEvent("encrypted",!1,!1,null);b.initDataType = "cenc";if(a = a.initData){var c=new nf(a);if(!(1 >= c.a.length)){for(var d=[],e=0;e < c.a.length;e++) d.push(a.subarray(c.a[e].start,c.a[e].end + 1));e = xf;a = [];for(c = 0;c < d.length;++c) {for(var f=!1,g=0;g < a.length && !(f = e?e(d[c],a[g]):d[c] === a[g]);++g);f || a.push(d[c]);}for(e = d = 0;e < a.length;e++) d += a[e].length;d = new Uint8Array(d);for(e = c = 0;e < a.length;e++) d.set(a[e],c),c += a[e].length;a = d;}}b.initData = a;this.dispatchEvent(b);}function xf(a,b){return Ua(a,b);}k.kc = function(a){this.a && (this.a.resolve(),this.a = null);this.dispatchEvent(new t("message",{messageType:void 0 == this.keyStatuses.Va()?"licenserequest":"licenserenewal",message:a.message.buffer}));};k.ic = function(){this.a?(wf(this,"usable"),this.a.resolve(),this.a = null):this.b && (wf(this,"usable"),this.b.resolve(),this.b = null);};k.jc = function(){var a=Error("EME PatchedMediaKeysMs key error");a.errorCode = this.c.error;if(this.a)this.a.reject(a),this.a = null;else if(this.b)this.b.reject(a),this.b = null;else switch(this.c.error.code){case MSMediaKeyError.MS_MEDIA_KEYERR_OUTPUT:case MSMediaKeyError.MS_MEDIA_KEYERR_HARDWARECHANGE:wf(this,"output-not-allowed");default:wf(this,"internal-error");}};function wf(a,b){a.keyStatuses.fb(b);a.dispatchEvent(new t("keystatuseschange"));}function vf(){this.size = 0;this.a = void 0;}var yf;k = vf.prototype;k.fb = function(a){this.size = void 0 == a?0:1;this.a = a;};k.Va = function(){return this.a;};k.forEach = function(a){this.a && a(this.a,yf);};k.get = function(a){if(this.has(a))return this.a;};k.has = function(a){var b=yf;return this.a && Ua(new Uint8Array(a),new Uint8Array(b))?!0:!1;};k.keys = function(){};function zf(){return Promise.reject(Error("The key system specified is not supported."));}function Af(a){return a?Promise.reject(Error("MediaKeys not supported.")):Promise.resolve();}function Bf(){throw new TypeError("Illegal constructor.");}Bf.prototype.createSession = function(){};Bf.prototype.setServerCertificate = function(){};function Cf(){throw new TypeError("Illegal constructor.");}Cf.prototype.getConfiguration = function(){};Cf.prototype.createMediaKeys = function(){};var Df="";function Ef(a){Df = a;Ff = new Uint8Array([0]).buffer;navigator.requestMediaKeySystemAccess = Gf;delete HTMLMediaElement.prototype.mediaKeys;HTMLMediaElement.prototype.mediaKeys = null;HTMLMediaElement.prototype.setMediaKeys = Hf;window.MediaKeys = If;window.MediaKeySystemAccess = Jf;}function Kf(a){var b=Df;return b?b + a.charAt(0).toUpperCase() + a.slice(1):a;}function Gf(a,b){try{var c=new Jf(a,b);return Promise.resolve(c);}catch(d) {return Promise.reject(d);}}function Hf(a){var b=this.mediaKeys;b && b != a && Lf(b,null);delete this.mediaKeys;(this.mediaKeys = a) && Lf(a,this);return Promise.resolve();}function Jf(a,b){this.a = this.keySystem = a;var c=!0;"org.w3.clearkey" == a && (this.a = "webkit-org.w3.clearkey",c = !1);var d=!1,e;e = document.getElementsByTagName("video");e = e.length?e[0]:document.createElement("video");for(var f=0;f < b.length;++f) {var g=b[f],h={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:g.initDataTypes,sessionTypes:["temporary"],label:g.label},l=!1;if(g.audioCapabilities)for(var n=0;n < g.audioCapabilities.length;++n) {var u=g.audioCapabilities[n];if(u.contentType){var l=!0,r=u.contentType.split(";")[0];e.canPlayType(r,this.a) && (h.audioCapabilities.push(u),d = !0);}}if(g.videoCapabilities)for(n = 0;n < g.videoCapabilities.length;++n) u = g.videoCapabilities[n],u.contentType && (l = !0,e.canPlayType(u.contentType,this.a) && (h.videoCapabilities.push(u),d = !0));l || (d = e.canPlayType("video/mp4",this.a) || e.canPlayType("video/webm",this.a));"required" == g.persistentState && (c?(h.persistentState = "required",h.sessionTypes = ["persistent-license"]):d = !1);if(d){this.b = h;return;}}c = "Unsupported keySystem";if("org.w3.clearkey" == a || "com.widevine.alpha" == a)c = "None of the requested configurations were supported.";c = Error(c);c.name = "NotSupportedError";c.code = DOMException.NOT_SUPPORTED_ERR;throw c;}Jf.prototype.createMediaKeys = function(){var a=new If(this.a);return Promise.resolve(a);};Jf.prototype.getConfiguration = function(){return this.b;};function If(a){this.h = a;this.b = null;this.a = new y();this.c = [];this.f = {};}function Lf(a,b){a.b = b;Da(a.a);var c=Df;b && (z(a.a,b,c + "needkey",a.tc.bind(a)),z(a.a,b,c + "keymessage",a.sc.bind(a)),z(a.a,b,c + "keyadded",a.qc.bind(a)),z(a.a,b,c + "keyerror",a.rc.bind(a)));}k = If.prototype;k.createSession = function(a){var b=a || "temporary";if("temporary" != b && "persistent-license" != b)throw new TypeError("Session type " + a + " is unsupported on this platform.");a = this.b || document.createElement("video");a.src || (a.src = "about:blank");b = new Mf(a,this.h,b);this.c.push(b);return b;};k.setServerCertificate = function(){return Promise.reject(Error("setServerCertificate not supported on this platform."));};k.tc = function(a){var b=document.createEvent("CustomEvent");b.initCustomEvent("encrypted",!1,!1,null);b.initDataType = "webm";b.initData = a.initData;this.b.dispatchEvent(b);};k.sc = function(a){var b=Nf(this,a.sessionId);b && (a = new t("message",{messageType:void 0 == b.keyStatuses.Va()?"licenserequest":"licenserenewal",message:a.message}),b.b && (b.b.resolve(),b.b = null),b.dispatchEvent(a));};k.qc = function(a){if(a = Nf(this,a.sessionId))Of(a,"usable"),a.a && a.a.resolve(),a.a = null;};k.rc = function(a){var b=Nf(this,a.sessionId);if(b){var c=Error("EME v0.1b key error");c.errorCode = a.errorCode;c.errorCode.systemCode = a.systemCode;!a.sessionId && b.b?(c.method = "generateRequest",45 == a.systemCode && (c.message = "Unsupported session type."),b.b.reject(c),b.b = null):a.sessionId && b.a?(c.method = "update",b.a.reject(c),b.a = null):(c = a.systemCode,a.errorCode.code == MediaKeyError.MEDIA_KEYERR_OUTPUT?Of(b,"output-restricted"):1 == c?Of(b,"expired"):Of(b,"internal-error"));}};function Nf(a,b){var c=a.f[b];return c?c:(c = a.c.shift())?(c.sessionId = b,a.f[b] = c):null;}function Mf(a,b,c){p.call(this);this.f = a;this.i = !1;this.a = this.b = null;this.c = b;this.g = c;this.sessionId = "";this.expiration = NaN;this.closed = new x();this.keyStatuses = new Pf();}ba(Mf);function Qf(a,b,c){if(a.i)return Promise.reject(Error("The session is already initialized."));a.i = !0;var d;try{if("persistent-license" == a.g)if(c)d = new Uint8Array(Ib("LOAD_SESSION|" + c));else {var e=Ib("PERSISTENT|"),f=new Uint8Array(e.byteLength + b.byteLength);f.set(new Uint8Array(e),0);f.set(new Uint8Array(b),e.byteLength);d = f;}else d = new Uint8Array(b);}catch(h) {return Promise.reject(h);}a.b = new x();var g=Kf("generateKeyRequest");try{a.f[g](a.c,d);}catch(h) {if("InvalidStateError" != h.name)return a.b = null,Promise.reject(h);setTimeout((function(){try{this.f[g](this.c,d);}catch(l) {this.b.reject(l),this.b = null;}}).bind(a),10);}return a.b;}k = Mf.prototype;k.hb = function(a,b){if(this.a)this.a.then(this.hb.bind(this,a,b))["catch"](this.hb.bind(this,a,b));else {this.a = a;var c,d;"webkit-org.w3.clearkey" == this.c?(c = Eb(b),d = JSON.parse(c),"oct" != d.keys[0].kty && (this.a.reject(Error("Response is not a valid JSON Web Key Set.")),this.a = null),c = Ra(d.keys[0].k),d = Ra(d.keys[0].kid)):(c = new Uint8Array(b),d = null);var e=Kf("addKey");try{this.f[e](this.c,c,d,this.sessionId);}catch(f) {this.a.reject(f),this.a = null;}}};function Of(a,b){a.keyStatuses.fb(b);a.dispatchEvent(new t("keystatuseschange"));}k.generateRequest = function(a,b){return Qf(this,b,null);};k.load = function(a){return "persistent-license" == this.g?Qf(this,null,a):Promise.reject(Error("Not a persistent session."));};k.update = function(a){var b=new x();this.hb(b,a);return b;};k.close = function(){if("persistent-license" != this.g){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),this.closed;var a=Kf("cancelKeyRequest");try{this.f[a](this.c,this.sessionId);}catch(b) {}}this.closed.resolve();return this.closed;};k.remove = function(){return "persistent-license" != this.g?Promise.reject(Error("Not a persistent session.")):this.close();};function Pf(){this.size = 0;this.a = void 0;}var Ff;k = Pf.prototype;k.fb = function(a){this.size = void 0 == a?0:1;this.a = a;};k.Va = function(){return this.a;};k.forEach = function(a){this.a && a(this.a,Ff);};k.get = function(a){if(this.has(a))return this.a;};k.has = function(a){var b=Ff;return this.a && Ua(new Uint8Array(a),new Uint8Array(b))?!0:!1;};k.keys = function(){};lf(function(){!window.HTMLVideoElement || navigator.requestMediaKeySystemAccess && MediaKeySystemAccess.prototype.getConfiguration || (HTMLMediaElement.prototype.webkitGenerateKeyRequest?Ef("webkit"):HTMLMediaElement.prototype.generateKeyRequest?Ef(""):window.MSMediaKeys?(yf = new Uint8Array([0]).buffer,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys = null,HTMLMediaElement.prototype.setMediaKeys = rf,window.MediaKeys = qf,window.MediaKeySystemAccess = pf,navigator.requestMediaKeySystemAccess = of):(navigator.requestMediaKeySystemAccess = zf,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys = null,HTMLMediaElement.prototype.setMediaKeys = Af,window.MediaKeys = Bf,window.MediaKeySystemAccess = Cf));});function Rf(){var a=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer = function(){var b=a.apply(this,arguments);b.abort = function(){};return b;};}function Sf(){var a=MediaSource.prototype.endOfStream;MediaSource.prototype.endOfStream = function(){for(var b=0,d=0;d < this.sourceBuffers.length;++d) var e=this.sourceBuffers[d],e=e.buffered.end(e.buffered.length - 1),b=Math.max(b,e);if(!isNaN(this.duration) && b < this.duration)for(this.pb = !0,d = 0;d < this.sourceBuffers.length;++d) e = this.sourceBuffers[d],e.lb = !1;return a.apply(this,arguments);};var b=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer = function(){var a=b.apply(this,arguments);a.h = this;a.addEventListener("updateend",Tf,!1);this.a || (this.addEventListener("sourceclose",Uf,!1),this.a = !0);return a;};}function Tf(a){var b=a.target,c=b.h;if(c.pb){a.preventDefault();a.stopPropagation();a.stopImmediatePropagation();b.lb = !0;for(a = 0;a < c.sourceBuffers.length;++a) if(0 == c.sourceBuffers[a].lb)return;c.pb = !1;}}function Uf(a){a = a.target;for(var b=0;b < a.sourceBuffers.length;++b) a.sourceBuffers[b].removeEventListener("updateend",Tf,!1);a.removeEventListener("sourceclose",Uf,!1);}lf(function(){if(window.MediaSource){var a=navigator.vendor,b=navigator.appVersion;!a || !b || 0 > a.indexOf("Apple") || (0 <= b.indexOf("Version/8")?window.MediaSource = null:0 <= b.indexOf("Version/9")?Rf():0 <= b.indexOf("Version/10") && (Rf(),Sf()));}});function Z(a){this.c = [];this.b = [];this.ia = Vf;if(a)try{a(this.W.bind(this),this.a.bind(this));}catch(b) {this.a(b);}}var Vf=0;function Wf(a){var b=new Z();b.W(void 0);return b.then(function(){return a;});}function Xf(a){var b=new Z();b.a(a);return b;}function Yf(a){function b(a,b,c){a.ia == Vf && (e[b] = c,d++,d == e.length && a.W(e));}var c=new Z();if(!a.length)return c.W([]),c;for(var d=0,e=Array(a.length),f=c.a.bind(c),g=0;g < a.length;++g) a[g] && a[g].then?a[g].then(b.bind(null,c,g),f):b(c,g,a[g]);return c;}function Zf(a){for(var b=new Z(),c=b.W.bind(b),d=b.a.bind(b),e=0;e < a.length;++e) a[e] && a[e].then?a[e].then(c,d):c(a[e]);return b;}Z.prototype.then = function(a,b){var c=new Z();switch(this.ia){case 1:$f(this,c,a);break;case 2:$f(this,c,b);break;case Vf:this.c.push({I:c,Ea:a}),this.b.push({I:c,Ea:b});}return c;};Z.prototype["catch"] = function(a){return this.then(void 0,a);};Z.prototype.W = function(a){if(this.ia == Vf){this.Pa = a;this.ia = 1;for(a = 0;a < this.c.length;++a) $f(this,this.c[a].I,this.c[a].Ea);this.c = [];this.b = [];}};Z.prototype.a = function(a){if(this.ia == Vf){this.Pa = a;this.ia = 2;for(a = 0;a < this.b.length;++a) $f(this,this.b[a].I,this.b[a].Ea);this.c = [];this.b = [];}};function $f(a,b,c){ag.push((function(){if(c && "function" == typeof c){try{var a=c(this.Pa);}catch(f) {b.a(f);return;}var e;try{e = a && a.then;}catch(f) {b.a(f);return;}a instanceof Z?a == b?b.a(new TypeError("Chaining cycle detected")):a.then(b.W.bind(b),b.a.bind(b)):e?bg(a,e,b):b.W(a);}else 1 == this.ia?b.W(this.Pa):b.a(this.Pa);}).bind(a));null == cg && (cg = dg(eg));}function bg(a,b,c){try{var d=!1;b.call(a,function(a){if(!d){d = !0;var b;try{b = a && a.then;}catch(g) {c.a(g);return;}b?bg(a,b,c):c.W(a);}},c.a.bind(c));}catch(e) {c.a(e);}}function eg(){for(;ag.length;) {null != cg && (fg(cg),cg = null);var a=ag;ag = [];for(var b=0;b < a.length;++b) a[b]();}}function dg(){return 0;}function fg(){}var cg=null,ag=[];lf(function(a){window.setImmediate?(dg = function(a){return window.setImmediate(a);},fg = function(a){return window.clearImmediate(a);}):(dg = function(a){return window.setTimeout(a,0);},fg = function(a){return window.clearTimeout(a);});if(!window.Promise || a)window.Promise = Z,window.Promise.resolve = Wf,window.Promise.reject = Xf,window.Promise.all = Yf,window.Promise.race = Zf,window.Promise.prototype.then = Z.prototype.then,window.Promise.prototype["catch"] = Z.prototype["catch"];});function gg(){return {droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0};}lf(function(){if(window.HTMLVideoElement){var a=HTMLVideoElement.prototype;!a.getVideoPlaybackQuality && "webkitDroppedFrameCount" in a && (a.getVideoPlaybackQuality = gg);}});function hg(a,b,c){return new window.TextTrackCue(a,b,c);}function ig(a,b,c){return new window.TextTrackCue(a + "-" + b + "-" + c,a,b,c);}lf(function(){if(!window.VTTCue && window.TextTrackCue){var a=TextTrackCue.length;if(3 == a)window.VTTCue = hg;else if(6 == a)window.VTTCue = ig;else {var b;try{b = !!hg(1,2,"");}catch(c) {b = !1;}b && (window.VTTCue = hg);}}});}).call(g,this);if(typeof module != "undefined" && module.exports)module.exports = g.shaka;else if(true)!(__WEBPACK_AMD_DEFINE_RESULT__ = function(){return g.shaka;}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else this.shaka = g.shaka;})(); + +/***/ } +/******/ ]) +}); +; \ No newline at end of file -- cgit v1.2.3