cloudinary-video-player 3.6.3-edge.8 → 3.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adaptive-streaming.js +50 -50
- package/dist/adaptive-streaming.min.js +5 -5
- package/dist/chapters.js +10 -10
- package/dist/chapters.min.js +3 -3
- package/dist/cld-video-player.css +2 -2
- package/dist/cld-video-player.js +1861 -1866
- package/dist/cld-video-player.light.js +1861 -1866
- package/dist/cld-video-player.light.min.js +4 -4
- package/dist/cld-video-player.min.css +2 -2
- package/dist/cld-video-player.min.js +4 -4
- package/dist/colors.js +10 -10
- package/dist/colors.min.js +3 -3
- package/dist/dash.js +18 -18
- package/dist/dash.min.js +4 -4
- package/dist/debug.js +38 -38
- package/dist/debug.min.js +3 -3
- package/dist/ima.js +44 -44
- package/dist/ima.min.js +3 -3
- package/dist/interaction-areas.js +58 -58
- package/dist/interaction-areas.min.js +3 -3
- package/dist/node_modules_lodash_throttle_js.js +26 -26
- package/dist/playlist.js +182 -182
- package/dist/playlist.min.js +3 -3
- package/dist/recommendations-overlay.js +34 -34
- package/dist/recommendations-overlay.min.js +3 -3
- package/dist/share.js +14 -14
- package/dist/share.min.js +3 -3
- package/dist/shoppable.js +48 -48
- package/dist/shoppable.min.js +3 -3
- package/dist/visual-search.js +22 -22
- package/dist/visual-search.min.js +3 -3
- package/lib/adaptive-streaming.js +1 -1
- package/lib/all.js +1 -1
- package/lib/chapters.js +1 -1
- package/lib/cld-video-player.js +1 -1
- package/lib/colors.js +1 -1
- package/lib/dash.js +1 -1
- package/lib/debug.js +1 -1
- package/lib/ima.js +1 -1
- package/lib/interaction-areas.js +1 -1
- package/lib/player.js +1 -1
- package/lib/playlist.js +1 -1
- package/lib/recommendations-overlay.js +1 -1
- package/lib/share.js +1 -1
- package/lib/shoppable.js +1 -1
- package/lib/videoPlayer.js +1 -1
- package/lib/visual-search.js +1 -1
- package/package.json +2 -2
package/lib/dash.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see dash.js.LICENSE.txt */
|
|
2
|
-
export const __webpack_esm_id__=367;export const __webpack_esm_ids__=[367];export const __webpack_esm_modules__={4626(){},5204(e,t,r){var n;n="undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:{},e.exports=n},6604(e,t,r){r.r(t),r.d(t,{default:()=>N});var n,i,o,u=r(6673),l=r.n(u),c=r(5204),f=r.n(c),d=r(7509),h=r.n(d),g=(n=function(e,t){var r;window,r=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/dist/",r(r.s="./index.js")}({"./externals/base64.js":function(e,t,r){var n,i,o,u,l,c=function(e){for(var t=[],r=0;r<e.length;++r){var n=e.charCodeAt(r);n<128?t.push(n):n<2048?(t.push(192|n>>6),t.push(128|63&n)):n<65536?(t.push(224|n>>12),t.push(128|63&n>>6),t.push(128|63&n)):(t.push(240|n>>18),t.push(128|63&n>>12),t.push(128|63&n>>6),t.push(128|63&n))}return t},f=function(e){for(var t=[],r=0;r<e.length;){var n=e[r++];n<128||(n<224?(n=(31&n)<<6,n|=63&e[r++]):n<240?(n=(15&n)<<12,n|=(63&e[r++])<<6,n|=63&e[r++]):(n=(7&n)<<18,n|=(63&e[r++])<<12,n|=(63&e[r++])<<6,n|=63&e[r++])),t.push(String.fromCharCode(n))}return t.join("")},d={};n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=function(e){for(var t=0,r=[],a=0|e.length/3;0<a--;){var i=(e[t]<<16)+(e[t+1]<<8)+e[t+2];t+=3,r.push(n.charAt(63&i>>18)),r.push(n.charAt(63&i>>12)),r.push(n.charAt(63&i>>6)),r.push(n.charAt(63&i))}return 2==e.length-t?(i=(e[t]<<16)+(e[t+1]<<8),r.push(n.charAt(63&i>>18)),r.push(n.charAt(63&i>>12)),r.push(n.charAt(63&i>>6)),r.push("=")):1==e.length-t&&(i=e[t]<<16,r.push(n.charAt(63&i>>18)),r.push(n.charAt(63&i>>12)),r.push("==")),r.join("")},o=function(){for(var e=[],t=0;t<64;++t)e[n.charCodeAt(t)]=t;return e["=".charCodeAt(0)]=0,e}(),u=function(e){for(var t=0,r=[],n=0|e.length/4;0<n--;){var a=(o[e.charCodeAt(t)]<<18)+(o[e.charCodeAt(t+1)]<<12)+(o[e.charCodeAt(t+2)]<<6)+o[e.charCodeAt(t+3)];r.push(255&a>>16),r.push(255&a>>8),r.push(255&a),t+=4}return r&&("="==e.charAt(t-2)?(r.pop(),r.pop()):"="==e.charAt(t-1)&&r.pop()),r},l={encode:function(e){for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t},decode:function(e){for(var t=0;t<s.length;++t)a[t]=String.fromCharCode(a[t]);return a.join("")}},d.decodeArray=function(e){var t=u(e);return new Uint8Array(t)},d.encodeASCII=function(e){var t=l.encode(e);return i(t)},d.decodeASCII=function(e){var t=u(e);return l.decode(t)},d.encode=function(e){var t=c(e);return i(t)},d.decode=function(e){var t=u(e);return f(t)},t.decode=d.decode,t.decodeArray=d.decodeArray,t.encode=d.encode,t.encodeASCII=d.encodeASCII},"./externals/cea608-parser.js":function(e,t,r){!function(e){var t={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},r=function(e){var r=e;return t.hasOwnProperty(e)&&(r=t[e]),String.fromCharCode(r)},n=15,a=32,i={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},s={17:2,18:4,21:6,22:8,23:10,19:13,20:15},o={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},u={25:2,26:4,29:6,30:8,31:10,27:13,28:15},l=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],c={verboseFilter:{DATA:3,DEBUG:3,INFO:2,WARNING:2,TEXT:1,ERROR:0},time:null,verboseLevel:0,setTime:function(e){this.time=e},log:function(e,t){var r=this.verboseFilter[e];this.verboseLevel>=r&&console.log(this.time+" ["+e+"] "+t)}},f=function(e){for(var t=[],r=0;r<e.length;r++)t.push(e[r].toString(16));return t},d=function(e,t,r,n,a){this.foreground=e||"white",this.underline=t||!1,this.italics=r||!1,this.background=n||"black",this.flash=a||!1};d.prototype={reset:function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},setStyles:function(e){for(var t=["foreground","underline","italics","background","flash"],r=0;r<t.length;r++){var n=t[r];e.hasOwnProperty(n)&&(this[n]=e[n])}},isDefault:function(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash},equals:function(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash},copy:function(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash},toString:function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}};var h=function(e,t,r,n,a,i){this.uchar=e||" ",this.penState=new d(t,r,n,a,i)};h.prototype={reset:function(){this.uchar=" ",this.penState.reset()},setChar:function(e,t){this.uchar=e,this.penState.copy(t)},setPenState:function(e){this.penState.copy(e)},equals:function(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)},copy:function(e){this.uchar=e.uchar,this.penState.copy(e.penState)},isEmpty:function(){return" "===this.uchar&&this.penState.isDefault()}};var g=function(){this.chars=[];for(var e=0;e<a;e++)this.chars.push(new h);this.pos=0,this.currPenState=new d};g.prototype={equals:function(e){for(var t=!0,r=0;r<a;r++)if(!this.chars[r].equals(e.chars[r])){t=!1;break}return t},copy:function(e){for(var t=0;t<a;t++)this.chars[t].copy(e.chars[t])},isEmpty:function(){for(var e=!0,t=0;t<a;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e},setCursor:function(e){this.pos!==e&&(this.pos=e),this.pos<0?(c.log("ERROR","Negative cursor position "+this.pos),this.pos=0):this.pos>a&&(c.log("ERROR","Too large cursor position "+this.pos),this.pos=a)},moveCursor:function(e){var t=this.pos+e;if(e>1)for(var r=this.pos+1;r<t+1;r++)this.chars[r].setPenState(this.currPenState);this.setCursor(t)},backSpace:function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},insertChar:function(e){e>=144&&this.backSpace();var t=r(e);this.pos>=a?c.log("ERROR","Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!"):(this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1))},clearFromPos:function(e){var t;for(t=e;t<a;t++)this.chars[t].reset()},clear:function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},clearToEndOfRow:function(){this.clearFromPos(this.pos)},getTextString:function(){for(var e=[],t=!0,r=0;r<a;r++){var n=this.chars[r].uchar;" "!==n&&(t=!1),e.push(n)}return t?"":e.join("")},setPenStyles:function(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}};var p=function(){this.rows=[];for(var e=0;e<n;e++)this.rows.push(new g);this.currRow=14,this.nrRollUpRows=null,this.reset()};p.prototype={reset:function(){for(var e=0;e<n;e++)this.rows[e].clear();this.currRow=14},equals:function(e){for(var t=!0,r=0;r<n;r++)if(!this.rows[r].equals(e.rows[r])){t=!1;break}return t},copy:function(e){for(var t=0;t<n;t++)this.rows[t].copy(e.rows[t])},isEmpty:function(){for(var e=!0,t=0;t<n;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e},backSpace:function(){this.rows[this.currRow].backSpace()},clearToEndOfRow:function(){this.rows[this.currRow].clearToEndOfRow()},insertChar:function(e){this.rows[this.currRow].insertChar(e)},setPen:function(e){this.rows[this.currRow].setPenStyles(e)},moveCursor:function(e){this.rows[this.currRow].moveCursor(e)},setCursor:function(e){c.log("INFO","setCursor: "+e),this.rows[this.currRow].setCursor(e)},setPAC:function(e){c.log("INFO","pacData = "+JSON.stringify(e));var t=e.row-1;this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.currRow=t;var r=this.rows[this.currRow];if(null!==e.indent){var n=e.indent,a=Math.max(n-1,0);r.setCursor(e.indent),e.color=r.chars[a].penState.foreground}var i={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(i)},setBkgData:function(e){c.log("INFO","bkgData = "+JSON.stringify(e)),this.backSpace(),this.setPen(e),this.insertChar(32)},setRollUpRows:function(e){this.nrRollUpRows=e},rollUp:function(){if(null!==this.nrRollUpRows){c.log("TEXT",this.getDisplayText());var e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),c.log("INFO","Rolling up")}else c.log("DEBUG","roll_up but nrRollUpRows not set yet")},getDisplayText:function(e){e=e||!1;for(var t=[],r="",a=-1,i=0;i<n;i++){var s=this.rows[i].getTextString();s&&(a=i+1,e?t.push("Row "+a+': "'+s+'"'):t.push(s.trim()))}return t.length>0&&(r=e?"["+t.join(" | ")+"]":t.join("\n")),r},getTextAndFormat:function(){return this.rows}};var m=function(e,t){this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new p,this.nonDisplayedMemory=new p,this.lastOutputScreen=new p,this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null};m.prototype={modes:["MODE_ROLL-UP","MODE_POP-ON","MODE_PAINT-ON","MODE_TEXT"],reset:function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.lastCueEndTime=null},getHandler:function(){return this.outputFilter},setHandler:function(e){this.outputFilter=e},setPAC:function(e){this.writeScreen.setPAC(e)},setBkgData:function(e){this.writeScreen.setBkgData(e)},setMode:function(e){e!==this.mode&&(this.mode=e,c.log("INFO","MODE="+e),"MODE_POP-ON"==this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)},insertChars:function(e){for(var t=0;t<e.length;t++)this.writeScreen.insertChar(e[t]);var r=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";c.log("INFO",r+": "+this.writeScreen.getDisplayText(!0)),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(c.log("TEXT","DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},cc_RCL:function(){c.log("INFO","RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},cc_BS:function(){c.log("INFO","BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())},cc_AOF:function(){},cc_AON:function(){},cc_DER:function(){c.log("INFO","DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},cc_RU:function(e){c.log("INFO","RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)},cc_FON:function(){c.log("INFO","FON - Flash On"),this.writeScreen.setPen({flash:!0})},cc_RDC:function(){c.log("INFO","RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},cc_TR:function(){c.log("INFO","TR"),this.setMode("MODE_TEXT")},cc_RTD:function(){c.log("INFO","RTD"),this.setMode("MODE_TEXT")},cc_EDM:function(){c.log("INFO","EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate()},cc_CR:function(){c.log("CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate()},cc_ENM:function(){c.log("INFO","ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},cc_EOC:function(){if(c.log("INFO","EOC - End Of Caption"),"MODE_POP-ON"===this.mode){var e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,c.log("TEXT","DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate()},cc_TO:function(e){c.log("INFO","TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)},cc_MIDROW:function(e){var t={flash:!1};if(t.underline=e%2==1,t.italics=e>=46,t.italics)t.foreground="white";else{var r=Math.floor(e/2)-16;t.foreground=["white","green","blue","cyan","red","yellow","magenta"][r]}c.log("INFO","MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)},outputDataUpdate:function(){var e=c.time;null!==e&&this.outputFilter&&(this.outputFilter.updateData&&this.outputFilter.updateData(e,this.displayedMemory),null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory))},cueSplitAtTime:function(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}};var y=function(e,t,r){this.field=e||1,this.outputs=[t,r],this.channels=[new m(1,t),new m(2,r)],this.currChNr=-1,this.lastCmdA=null,this.lastCmdB=null,this.bufferedData=[],this.startTime=null,this.lastTime=null,this.dataCounters={padding:0,char:0,cmd:0,other:0}};y.prototype={getHandler:function(e){return this.channels[e].getHandler()},setHandler:function(e,t){this.channels[e].setHandler(t)},addData:function(e,t){var r,n,a,i=!1;this.lastTime=e,c.setTime(e);for(var s=0;s<t.length;s+=2)n=127&t[s],a=127&t[s+1],n>=16&&n<=31&&n===this.lastCmdA&&a===this.lastCmdB?(this.lastCmdA=null,this.lastCmdB=null,c.log("DEBUG","Repeated command ("+f([n,a])+") is dropped")):0!==n||0!==a?(c.log("DATA","["+f([t[s],t[s+1]])+"] -> ("+f([n,a])+")"),(r=this.parseCmd(n,a))||(r=this.parseMidrow(n,a)),r||(r=this.parsePAC(n,a)),r||(r=this.parseBackgroundAttributes(n,a)),r||(i=this.parseChars(n,a))&&(this.currChNr&&this.currChNr>=0?this.channels[this.currChNr-1].insertChars(i):c.log("WARNING","No channel found yet. TEXT-MODE?")),r?this.dataCounters.cmd+=2:i?this.dataCounters.char+=2:(this.dataCounters.other+=2,c.log("WARNING","Couldn't parse cleaned data "+f([n,a])+" orig: "+f([t[s],t[s+1]])))):this.dataCounters.padding+=2},parseCmd:function(e,t){var r;if(!((20===e||21===e||28===e||29===e)&&32<=t&&t<=47||(23===e||31===e)&&33<=t&&t<=35))return!1;r=20===e||21===e||23===e?1:2;var n=this.channels[r-1];return 20===e||21===e||28===e||29===e?32===t?n.cc_RCL():33===t?n.cc_BS():34===t?n.cc_AOF():35===t?n.cc_AON():36===t?n.cc_DER():37===t?n.cc_RU(2):38===t?n.cc_RU(3):39===t?n.cc_RU(4):40===t?n.cc_FON():41===t?n.cc_RDC():42===t?n.cc_TR():43===t?n.cc_RTD():44===t?n.cc_EDM():45===t?n.cc_CR():46===t?n.cc_ENM():47===t&&n.cc_EOC():n.cc_TO(t-32),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=r,!0},parseMidrow:function(e,t){var r=null;if((17===e||25===e)&&32<=t&&t<=47){if((r=17===e?1:2)!==this.currChNr)return c.log("ERROR","Mismatch channel in midrow parsing"),!1;var n=this.channels[r-1];return n.insertChars([32]),n.cc_MIDROW(t),c.log("DEBUG","MIDROW ("+f([e,t])+")"),this.lastCmdA=e,this.lastCmdB=t,!0}return!1},parsePAC:function(e,t){var r,n;if(!((17<=e&&e<=23||25<=e&&e<=31)&&64<=t&&t<=127||(16===e||24===e)&&64<=t&&t<=95))return!1;r=e<=23?1:2,n=64<=t&&t<=95?1===r?i[e]:o[e]:1===r?s[e]:u[e];var a=this.interpretPAC(n,t);return this.channels[r-1].setPAC(a),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=r,!0},interpretPAC:function(e,t){var r,n={color:null,italics:!1,indent:null,underline:!1,row:e};return r=t>95?t-96:t-64,n.underline=!(1&~r),r<=13?n.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(r/2)]:r<=15?(n.italics=!0,n.color="white"):n.indent=4*Math.floor((r-16)/2),n},parseChars:function(e,t){var n=null,a=null,i=null;if(e>=25?(n=2,i=e-8):(n=1,i=e),17<=i&&i<=19){var s;s=17===i?t+80:18===i?t+112:t+144,c.log("INFO","Special char '"+r(s)+"' in channel "+n),a=[s],this.lastCmdA=e,this.lastCmdB=t}else 32<=e&&e<=127&&(a=0===t?[e]:[e,t],this.lastCmdA=null,this.lastCmdB=null);if(a){var o=f(a);c.log("DEBUG","Char codes = "+o.join(","))}return a},parseBackgroundAttributes:function(e,t){var r,n,a;return((16===e||24===e)&&32<=t&&t<=47||(23===e||31===e)&&45<=t&&t<=47)&&(r={},16===e||24===e?(n=Math.floor((t-32)/2),r.background=l[n],t%2==1&&(r.background=r.background+"_semi")):45===t?r.background="transparent":(r.foreground="black",47===t&&(r.underline=!0)),a=e<24?1:2,this.channels[a-1].setBkgData(r),this.lastCmdA=e,this.lastCmdB=t,!0)},reset:function(){for(var e=0;e<this.channels.length;e++)this.channels[e]&&this.channels[e].reset();this.lastCmdA=null,this.lastCmdB=null},cueSplitAtTime:function(e){for(var t=0;t<this.channels.length;t++)this.channels[t]&&this.channels[t].cueSplitAtTime(e)}},e.logger=c,e.PenState=d,e.CaptionScreen=p,e.Cea608Parser=y,e.findCea608Nalus=function(e,t,r){for(var n=0,a=t,i=[],s=function(e,t,r,n){if(4!==e||t<8)return null;var a=r.getUint8(n),i=r.getUint16(n+1),s=r.getUint32(n+3),o=r.getUint8(n+7);return 181==a&&49==i&&1195456820==s&&3==o};a<t+r;){if(n=e.getUint32(a),6==(31&e.getUint8(a+4)))for(var o=a+5,u=-1;o<a+4+n-1;){u=0;for(var l=255;255===l;)u+=l=e.getUint8(o),o++;var c=0;for(l=255;255===l;)c+=l=e.getUint8(o),o++;s(u,c,e,o)&&i.push([o,c]),o+=c}a+=n+4}return i},e.extractCea608DataFromRange=function(e,t){var r=t[0],n=[[],[]];r+=8;var a=31&e.getUint8(r);r+=2;for(var i=0;i<a;i++){var s=e.getUint8(r),o=4&s,u=3&s;r++;var l=e.getUint8(r);r++;var c=e.getUint8(r);r++,o&&(127&l)+(127&c)!=0&&(0===u?(n[0].push(l),n[0].push(c)):1===u&&(n[1].push(l),n[1].push(c)))}return n}}(t)},"./externals/xml2json.js":function(e,t,r){r.r(t),t.default=function(e){void 0===(e=e||{}).escapeMode&&(e.escapeMode=!0),void 0===e.attributePrefix&&(e.attributePrefix="_"),e.arrayAccessForm=e.arrayAccessForm||"none",e.emptyNodeForm=e.emptyNodeForm||"text",void 0===e.enableToStringFunc&&(e.enableToStringFunc=!0),e.arrayAccessFormPaths=e.arrayAccessFormPaths||[],void 0===e.skipEmptyTextNodesForObj&&(e.skipEmptyTextNodesForObj=!0),void 0===e.stripWhitespaces&&(e.stripWhitespaces=!0),e.datetimeAccessFormPaths=e.datetimeAccessFormPaths||[],void 0===e.useDoubleQuotes&&(e.useDoubleQuotes=!1),e.xmlElementsFilter=e.xmlElementsFilter||[],e.jsonPropertiesFilter=e.jsonPropertiesFilter||[],void 0===e.keepCData&&(e.keepCData=!1),void 0===e.ignoreRoot&&(e.ignoreRoot=!1);function t(e){var t=e.localName;return null==t&&(t=e.baseName),null!=t&&""!=t||(t=e.nodeName),t}function r(e){return"string"==typeof e?e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):e}function n(e,t,r,n){for(var a=0;a<e.length;a++){var i=e[a];if("string"==typeof i){if(i==n)break}else if(i instanceof RegExp){if(i.test(n))break}else if("function"==typeof i&&i(t,r,n))break}return a!=e.length}function a(t,r,a){"property"===e.arrayAccessForm&&(t[r]instanceof Array?t[r+"_asArray"]=t[r]:t[r+"_asArray"]=[t[r]]),!(t[r]instanceof Array)&&e.arrayAccessFormPaths.length>0&&n(e.arrayAccessFormPaths,t,r,a)&&(t[r]=[t[r]])}function i(e){var t=e.split(/[-T:+Z]/g),r=new Date(t[0],t[1]-1,t[2]),n=t[5].split(".");if(r.setHours(t[3],t[4],n[0]),n.length>1&&r.setMilliseconds(n[1]),t[6]&&t[7]){var a=60*t[6]+Number(t[7]);a=0+("-"==(/\d\d-\d\d:\d\d$/.test(e)?"-":"+")?-1*a:a),r.setMinutes(r.getMinutes()-a-r.getTimezoneOffset())}else-1!==e.indexOf("Z",e.length-1)&&(r=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds())));return r}function s(t,r,a,i){return!(1==r&&e.xmlElementsFilter.length>0)||n(e.xmlElementsFilter,t,a,i)}function o(r,u){if(9==r.nodeType){for(var l=new Object,c=r.childNodes,f=0;f<c.length;f++)1==(h=c[f]).nodeType&&(e.ignoreRoot?l=o(h):(l={})[g=t(h)]=o(h));return l}if(1==r.nodeType){(l=new Object).__cnt=0;var d=[];for(c=r.childNodes,f=0;f<c.length;f++){var h,g=t(h=c[f]);if(8!=h.nodeType){var p=u+"."+g;if(s(l,h.nodeType,g,p))if(l.__cnt++,null==l[g]){var m=o(h,p);("#text"!=g||/[^\s]/.test(m))&&((y={})[g]=m,d.push(y)),l[g]=m,a(l,g,p)}else{var y;null!=l[g]&&(l[g]instanceof Array||(l[g]=[l[g]],a(l,g,p))),m=o(h,p),("#text"!=g||/[^\s]/.test(m))&&((y={})[g]=m,d.push(y)),l[g][l[g].length]=m}}}l.__children=d;for(var E=t(r),_=0;_<r.attributes.length;_++){var v=r.attributes[_];l.__cnt++;for(var T=v.value,S=0,b=e.matchers.length;S<b;S++){var A=e.matchers[S];A.test(v,E)&&(T=A.converter(v.value))}l[e.attributePrefix+v.name]=T}var R=function(e){return e.prefix}(r);return null!=R&&""!=R&&(l.__cnt++,l.__prefix=R),null!=l["#text"]&&(l.__text=l["#text"],l.__text instanceof Array&&(l.__text=l.__text.join("\n")),e.stripWhitespaces&&(l.__text=l.__text.trim()),delete l["#text"],"property"==e.arrayAccessForm&&delete l["#text_asArray"],l.__text=function(t,r,a){if(e.datetimeAccessFormPaths.length>0){var s=a.split(".#")[0];return n(e.datetimeAccessFormPaths,t,r,s)?i(t):t}return t}(l.__text,g,u+"."+g)),null!=l["#cdata-section"]&&(l.__cdata=l["#cdata-section"],delete l["#cdata-section"],"property"==e.arrayAccessForm&&delete l["#cdata-section_asArray"]),0==l.__cnt&&"text"==e.emptyNodeForm?l="":1==l.__cnt&&null!=l.__text?l=l.__text:1!=l.__cnt||null==l.__cdata||e.keepCData?l.__cnt>1&&null!=l.__text&&e.skipEmptyTextNodesForObj&&(e.stripWhitespaces&&""==l.__text||""==l.__text.trim())&&delete l.__text:l=l.__cdata,delete l.__cnt,!e.enableToStringFunc||null==l.__text&&null==l.__cdata||(l.toString=function(){return(null!=this.__text?this.__text:"")+(null!=this.__cdata?this.__cdata:"")}),l}if(3==r.nodeType||4==r.nodeType)return r.nodeValue}function u(t,n,a,i){var s="<"+(null!=t&&null!=t.__prefix?t.__prefix+":":"")+n;if(null!=a)for(var o=0;o<a.length;o++){var u=a[o],l=t[u];e.escapeMode&&(l=r(l)),s+=" "+u.substr(e.attributePrefix.length)+"=",e.useDoubleQuotes?s+='"'+l+'"':s+="'"+l+"'"}return s+(i?"/>":">")}function l(e,t){return"</"+(null!=e.__prefix?e.__prefix+":":"")+t+">"}function c(t,r){return"property"==e.arrayAccessForm&&(a="_asArray",-1!==(n=r.toString()).indexOf(a,n.length-8))||0==r.toString().indexOf(e.attributePrefix)||0==r.toString().indexOf("__")||t[r]instanceof Function;var n,a}function f(e){var t=0;if(e instanceof Object)for(var r in e)c(e,r)||t++;return t}function d(t,r,a){return 0==e.jsonPropertiesFilter.length||""==a||n(e.jsonPropertiesFilter,t,r,a)}function h(t){var r=[];if(t instanceof Object)for(var n in t)-1==n.toString().indexOf("__")&&0==n.toString().indexOf(e.attributePrefix)&&r.push(n);return r}function g(t){var n="";return t instanceof Object?n+=function(t){var n="";return null!=t.__cdata&&(n+="<![CDATA["+t.__cdata+"]]>"),null!=t.__text&&(e.escapeMode?n+=r(t.__text):n+=t.__text),n}(t):null!=t&&(e.escapeMode?n+=r(t):n+=t),n}function p(e,t){return""===e?t:e+"."+t}function m(e,t,r,n){var a="";if(0==e.length)a+=u(e,t,r,!0);else for(var i=0;i<e.length;i++)a+=u(e[i],t,h(e[i]),!1),a+=y(e[i],p(n,t)),a+=l(e[i],t);return a}function y(e,t){var r="";if(f(e)>0)for(var n in e)if(!c(e,n)&&(""==t||d(e,n,p(t,n)))){var a=e[n],i=h(a);null==a||null==a?r+=u(a,n,i,!0):a instanceof Object?a instanceof Array?r+=m(a,n,i,t):a instanceof Date?(r+=u(a,n,i,!1),r+=a.toISOString(),r+=l(a,n)):f(a)>0||null!=a.__text||null!=a.__cdata?(r+=u(a,n,i,!1),r+=y(a,p(t,n)),r+=l(a,n)):r+=u(a,n,i,!0):(r+=u(a,n,i,!1),r+=g(a),r+=l(a,n))}return r+g(e)}this.parseXmlString=function(e){var t;if(window.ActiveXObject||window,void 0===e)return null;if(window.DOMParser){var r=new window.DOMParser;try{(t=r.parseFromString(e,"text/xml")).getElementsByTagNameNS("*","parsererror").length>0&&(t=null)}catch(e){t=null}}else 0==e.indexOf("<?")&&(e=e.substr(e.indexOf("?>")+2)),(t=new ActiveXObject("Microsoft.XMLDOM")).async="false",t.loadXML(e);return t},this.asArray=function(e){return void 0===e||null==e?[]:e instanceof Array?e:[e]},this.toXmlDateTime=function(e){return e instanceof Date?e.toISOString():"number"==typeof e?new Date(e).toISOString():null},this.asDateTime=function(e){return"string"==typeof e?i(e):e},this.xml2json=function(e){return o(e)},this.xml_str2json=function(e){var t=this.parseXmlString(e);return null!=t?this.xml2json(t):null},this.json2xml_str=function(e){return y(e,"")},this.json2xml=function(e){var t=this.json2xml_str(e);return this.parseXmlString(t)},this.getVersion=function(){return"1.2.0"}}},"./index.js":function(e,t,r){r.r(t);var n=r("./index_mediaplayerOnly.js");r.d(t,"MediaPlayer",function(){return n.MediaPlayer});var a=r("./src/streaming/utils/Capabilities.js");r.d(t,"supportsMediaSource",function(){return a.supportsMediaSource});var i=r("./src/streaming/metrics/MetricsReporting.js");r.d(t,"MetricsReporting",function(){return i.default});var s=r("./src/streaming/protection/Protection.js");r.d(t,"Protection",function(){return s.default});var o=r("./src/streaming/MediaPlayerFactory.js");r.d(t,"MediaPlayerFactory",function(){return o.default});var u=r("./src/core/Debug.js");r.d(t,"Debug",function(){return u.default}),dashjs.Protection=s.default,dashjs.MetricsReporting=i.default,dashjs.MediaPlayerFactory=o.default,dashjs.Debug=u.default,dashjs.supportsMediaSource=a.supportsMediaSource,t.default=dashjs},"./index_mediaplayerOnly.js":function(e,t,r){r.r(t),function(e){var n=r("./src/streaming/MediaPlayer.js");r.d(t,"MediaPlayer",function(){return n.default});var a=r("./src/core/FactoryMaker.js");r.d(t,"FactoryMaker",function(){return a.default});var i=r("./src/core/Debug.js");r.d(t,"Debug",function(){return i.default});var s=r("./src/core/Version.js"),o=(r("./node_modules/es6-promise/auto.js"),"undefined"!=typeof window&&window||e),u=o.dashjs;u||(u=o.dashjs={}),u.MediaPlayer=n.default,u.FactoryMaker=a.default,u.Debug=i.default,u.Version=Object(s.getVersionString)(),t.default=u}.call(this,r("./node_modules/webpack/buildin/global.js"))},"./node_modules/base64-js/index.js":function(e,t,r){t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){for(var t,r=u(e),n=r[0],s=r[1],o=new i(function(e,t,r){return 3*(t+r)/4-r}(0,n,s)),l=0,c=s>0?n-4:n,f=0;f<c;f+=4)t=a[e.charCodeAt(f)]<<18|a[e.charCodeAt(f+1)]<<12|a[e.charCodeAt(f+2)]<<6|a[e.charCodeAt(f+3)],o[l++]=t>>16&255,o[l++]=t>>8&255,o[l++]=255&t;return 2===s&&(t=a[e.charCodeAt(f)]<<2|a[e.charCodeAt(f+1)]>>4,o[l++]=255&t),1===s&&(t=a[e.charCodeAt(f)]<<10|a[e.charCodeAt(f+1)]<<4|a[e.charCodeAt(f+2)]>>2,o[l++]=t>>8&255,o[l++]=255&t),o},t.fromByteArray=function(e){for(var t,r=e.length,a=r%3,i=[],s=16383,o=0,u=r-a;o<u;o+=s)i.push(c(e,o,o+s>u?u:o+s));return 1===a?(t=e[r-1],i.push(n[t>>2]+n[t<<4&63]+"==")):2===a&&(t=(e[r-2]<<8)+e[r-1],i.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),i.join("")};for(var n=[],a=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)n[o]=s[o],a[s.charCodeAt(o)]=o;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function c(e,t,r){for(var n,a=[],i=t;i<r;i+=3)n=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),a.push(l(n));return a.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},"./node_modules/codem-isoboxer/dist/iso_boxer.js":function(e,t,r){var n={parseBuffer:function(e){return new a(e).parse()},addBoxProcessor:function(e,t){"string"==typeof e&&"function"==typeof t&&(i.prototype._boxProcessors[e]=t)},createFile:function(){return new a},createBox:function(e,t,r){var n=i.create(e);return t&&t.append(n,r),n},createFullBox:function(e,t,r){var a=n.createBox(e,t,r);return a.version=0,a.flags=0,a},Utils:{}};n.Utils.dataViewToString=function(e,t){var r=t||"utf-8";if("undefined"!=typeof TextDecoder)return new TextDecoder(r).decode(e);var n=[],a=0;if("utf-8"===r)for(;a<e.byteLength;){var i=e.getUint8(a++);i<128||(i<224?(i=(31&i)<<6,i|=63&e.getUint8(a++)):i<240?(i=(15&i)<<12,i|=(63&e.getUint8(a++))<<6,i|=63&e.getUint8(a++)):(i=(7&i)<<18,i|=(63&e.getUint8(a++))<<12,i|=(63&e.getUint8(a++))<<6,i|=63&e.getUint8(a++))),n.push(String.fromCharCode(i))}else for(;a<e.byteLength;)n.push(String.fromCharCode(e.getUint8(a++)));return n.join("")},n.Utils.utf8ToByteArray=function(e){var t,r;if("undefined"!=typeof TextEncoder)t=(new TextEncoder).encode(e);else for(t=[],r=0;r<e.length;++r){var n=e.charCodeAt(r);n<128?t.push(n):n<2048?(t.push(192|n>>6),t.push(128|63&n)):n<65536?(t.push(224|n>>12),t.push(128|63&n>>6),t.push(128|63&n)):(t.push(240|n>>18),t.push(128|63&n>>12),t.push(128|63&n>>6),t.push(128|63&n))}return t},n.Utils.appendBox=function(e,t,r){if(t._offset=e._cursor.offset,t._root=e._root?e._root:e,t._raw=e._raw,t._parent=e,-1!==r)if(null!=r){var n,a=-1;if("number"==typeof r)a=r;else{if("string"==typeof r)n=r;else{if("object"!=typeof r||!r.type)return void e.boxes.push(t);n=r.type}for(var i=0;i<e.boxes.length;i++)if(n===e.boxes[i].type){a=i+1;break}}e.boxes.splice(a,0,t)}else e.boxes.push(t)},t.parseBuffer=n.parseBuffer,t.addBoxProcessor=n.addBoxProcessor,t.createFile=n.createFile,t.createBox=n.createBox,t.createFullBox=n.createFullBox,t.Utils=n.Utils,n.Cursor=function(e){this.offset=void 0===e?0:e};var a=function(e){this._cursor=new n.Cursor,this.boxes=[],e&&(this._raw=new DataView(e))};a.prototype.fetch=function(e){var t=this.fetchAll(e,!0);return t.length?t[0]:null},a.prototype.fetchAll=function(e,t){var r=[];return a._sweep.call(this,e,r,t),r},a.prototype.parse=function(){for(this._cursor.offset=0,this.boxes=[];this._cursor.offset<this._raw.byteLength;){var e=i.parse(this);if(void 0===e.type)break;this.boxes.push(e)}return this},a._sweep=function(e,t,r){for(var n in this.type&&this.type==e&&t.push(this),this.boxes){if(t.length&&r)return;a._sweep.call(this.boxes[n],e,t,r)}},a.prototype.write=function(){var e,t=0;for(e=0;e<this.boxes.length;e++)t+=this.boxes[e].getLength(!1);var r=new Uint8Array(t);for(this._rawo=new DataView(r.buffer),this.bytes=r,this._cursor.offset=0,e=0;e<this.boxes.length;e++)this.boxes[e].write();return r.buffer},a.prototype.append=function(e,t){n.Utils.appendBox(this,e,t)};var i=function(){this._cursor=new n.Cursor};i.parse=function(e){var t=new i;return t._offset=e._cursor.offset,t._root=e._root?e._root:e,t._raw=e._raw,t._parent=e,t._parseBox(),e._cursor.offset=t._raw.byteOffset+t._raw.byteLength,t},i.create=function(e){var t=new i;return t.type=e,t.boxes=[],t},i.prototype._boxContainers=["dinf","edts","mdia","meco","mfra","minf","moof","moov","mvex","stbl","strk","traf","trak","tref","udta","vttc","sinf","schi","encv","enca"],i.prototype._boxProcessors={},i.prototype._procField=function(e,t,r){this._parsing?this[e]=this._readField(t,r):this._writeField(t,r,this[e])},i.prototype._procFieldArray=function(e,t,r,n){var a;if(this._parsing)for(this[e]=[],a=0;a<t;a++)this[e][a]=this._readField(r,n);else for(a=0;a<this[e].length;a++)this._writeField(r,n,this[e][a])},i.prototype._procFullBox=function(){this._procField("version","uint",8),this._procField("flags","uint",24)},i.prototype._procEntries=function(e,t,r){var n;if(this._parsing)for(this[e]=[],n=0;n<t;n++)this[e].push({}),r.call(this,this[e][n]);else for(n=0;n<t;n++)r.call(this,this[e][n])},i.prototype._procSubEntries=function(e,t,r,n){var a;if(this._parsing)for(e[t]=[],a=0;a<r;a++)e[t].push({}),n.call(this,e[t][a]);else for(a=0;a<r;a++)n.call(this,e[t][a])},i.prototype._procEntryField=function(e,t,r,n){this._parsing?e[t]=this._readField(r,n):this._writeField(r,n,e[t])},i.prototype._procSubBoxes=function(e,t){var r;if(this._parsing)for(this[e]=[],r=0;r<t;r++)this[e].push(i.parse(this));else for(r=0;r<t;r++)this._rawo?this[e][r].write():this.size+=this[e][r].getLength()},i.prototype._readField=function(e,t){switch(e){case"uint":return this._readUint(t);case"int":return this._readInt(t);case"template":return this._readTemplate(t);case"string":return-1===t?this._readTerminatedString():this._readString(t);case"data":return this._readData(t);case"utf8":return this._readUTF8String();default:return-1}},i.prototype._readInt=function(e){var t=null,r=this._cursor.offset-this._raw.byteOffset;switch(e){case 8:t=this._raw.getInt8(r);break;case 16:t=this._raw.getInt16(r);break;case 32:t=this._raw.getInt32(r);break;case 64:var n=this._raw.getInt32(r),a=this._raw.getInt32(r+4);t=n*Math.pow(2,32)+a}return this._cursor.offset+=e>>3,t},i.prototype._readUint=function(e){var t,r,n=null,a=this._cursor.offset-this._raw.byteOffset;switch(e){case 8:n=this._raw.getUint8(a);break;case 16:n=this._raw.getUint16(a);break;case 24:n=((t=this._raw.getUint16(a))<<8)+(r=this._raw.getUint8(a+2));break;case 32:n=this._raw.getUint32(a);break;case 64:t=this._raw.getUint32(a),r=this._raw.getUint32(a+4),n=t*Math.pow(2,32)+r}return this._cursor.offset+=e>>3,n},i.prototype._readString=function(e){for(var t="",r=0;r<e;r++){var n=this._readUint(8);t+=String.fromCharCode(n)}return t},i.prototype._readTemplate=function(e){return this._readUint(e/2)+this._readUint(e/2)/Math.pow(2,e/2)},i.prototype._readTerminatedString=function(){for(var e="";this._cursor.offset-this._offset<this._raw.byteLength;){var t=this._readUint(8);if(0===t)break;e+=String.fromCharCode(t)}return e},i.prototype._readData=function(e){var t=e>0?e:this._raw.byteLength-(this._cursor.offset-this._offset);if(t>0){var r=new Uint8Array(this._raw.buffer,this._cursor.offset,t);return this._cursor.offset+=t,r}return null},i.prototype._readUTF8String=function(){var e=this._raw.byteLength-(this._cursor.offset-this._offset),t=null;return e>0&&(t=new DataView(this._raw.buffer,this._cursor.offset,e),this._cursor.offset+=e),t?n.Utils.dataViewToString(t):t},i.prototype._parseBox=function(){if(this._parsing=!0,this._cursor.offset=this._offset,this._offset+8>this._raw.buffer.byteLength)this._root._incomplete=!0;else{switch(this._procField("size","uint",32),this._procField("type","string",4),1===this.size&&this._procField("largesize","uint",64),"uuid"===this.type&&this._procFieldArray("usertype",16,"uint",8),this.size){case 0:this._raw=new DataView(this._raw.buffer,this._offset,this._raw.byteLength-this._cursor.offset+8);break;case 1:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.largesize);break;default:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.size)}this._incomplete||(this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type)?this._parseContainerBox():this._data=this._readData())}},i.prototype._parseFullBox=function(){this.version=this._readUint(8),this.flags=this._readUint(24)},i.prototype._parseContainerBox=function(){for(this.boxes=[];this._cursor.offset-this._raw.byteOffset<this._raw.byteLength;)this.boxes.push(i.parse(this))},i.prototype.append=function(e,t){n.Utils.appendBox(this,e,t)},i.prototype.getLength=function(){if(this._parsing=!1,this._rawo=null,this.size=0,this._procField("size","uint",32),this._procField("type","string",4),1===this.size&&this._procField("largesize","uint",64),"uuid"===this.type&&this._procFieldArray("usertype",16,"uint",8),this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type))for(var e=0;e<this.boxes.length;e++)this.size+=this.boxes[e].getLength();return this._data&&this._writeData(this._data),this.size},i.prototype.write=function(){switch(this._parsing=!1,this._cursor.offset=this._parent._cursor.offset,this.size){case 0:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.parent._rawo.byteLength-this._cursor.offset);break;case 1:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.largesize);break;default:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.size)}if(this._procField("size","uint",32),this._procField("type","string",4),1===this.size&&this._procField("largesize","uint",64),"uuid"===this.type&&this._procFieldArray("usertype",16,"uint",8),this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type))for(var e=0;e<this.boxes.length;e++)this.boxes[e].write();return this._data&&this._writeData(this._data),this._parent._cursor.offset+=this.size,this.size},i.prototype._writeInt=function(e,t){if(this._rawo){var r=this._cursor.offset-this._rawo.byteOffset;switch(e){case 8:this._rawo.setInt8(r,t);break;case 16:this._rawo.setInt16(r,t);break;case 32:this._rawo.setInt32(r,t);break;case 64:var n=Math.floor(t/Math.pow(2,32)),a=t-n*Math.pow(2,32);this._rawo.setUint32(r,n),this._rawo.setUint32(r+4,a)}this._cursor.offset+=e>>3}else this.size+=e>>3},i.prototype._writeUint=function(e,t){if(this._rawo){var r,n,a=this._cursor.offset-this._rawo.byteOffset;switch(e){case 8:this._rawo.setUint8(a,t);break;case 16:this._rawo.setUint16(a,t);break;case 24:r=(16776960&t)>>8,n=255&t,this._rawo.setUint16(a,r),this._rawo.setUint8(a+2,n);break;case 32:this._rawo.setUint32(a,t);break;case 64:n=t-(r=Math.floor(t/Math.pow(2,32)))*Math.pow(2,32),this._rawo.setUint32(a,r),this._rawo.setUint32(a+4,n)}this._cursor.offset+=e>>3}else this.size+=e>>3},i.prototype._writeString=function(e,t){for(var r=0;r<e;r++)this._writeUint(8,t.charCodeAt(r))},i.prototype._writeTerminatedString=function(e){if(0!==e.length){for(var t=0;t<e.length;t++)this._writeUint(8,e.charCodeAt(t));this._writeUint(8,0)}},i.prototype._writeTemplate=function(e,t){var r=Math.floor(t),n=(t-r)*Math.pow(2,e/2);this._writeUint(e/2,r),this._writeUint(e/2,n)},i.prototype._writeData=function(e){if(e)if(this._rawo){if(e instanceof Array){for(var t=this._cursor.offset-this._rawo.byteOffset,r=0;r<e.length;r++)this._rawo.setInt8(t+r,e[r]);this._cursor.offset+=e.length}e instanceof Uint8Array&&(this._root.bytes.set(e,this._cursor.offset),this._cursor.offset+=e.length)}else this.size+=e.length},i.prototype._writeUTF8String=function(e){var t=n.Utils.utf8ToByteArray(e);if(this._rawo)for(var r=new DataView(this._rawo.buffer,this._cursor.offset,t.length),a=0;a<t.length;a++)r.setUint8(a,t[a]);else this.size+=t.length},i.prototype._writeField=function(e,t,r){switch(e){case"uint":this._writeUint(t,r);break;case"int":this._writeInt(t,r);break;case"template":this._writeTemplate(t,r);break;case"string":-1==t?this._writeTerminatedString(r):this._writeString(t,r);break;case"data":this._writeData(r);break;case"utf8":this._writeUTF8String(r)}},i.prototype._boxProcessors.avc1=i.prototype._boxProcessors.encv=function(){this._procFieldArray("reserved1",6,"uint",8),this._procField("data_reference_index","uint",16),this._procField("pre_defined1","uint",16),this._procField("reserved2","uint",16),this._procFieldArray("pre_defined2",3,"uint",32),this._procField("width","uint",16),this._procField("height","uint",16),this._procField("horizresolution","template",32),this._procField("vertresolution","template",32),this._procField("reserved3","uint",32),this._procField("frame_count","uint",16),this._procFieldArray("compressorname",32,"uint",8),this._procField("depth","uint",16),this._procField("pre_defined3","int",16),this._procField("config","data",-1)},i.prototype._boxProcessors.dref=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},i.prototype._boxProcessors.elst=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,function(e){this._procEntryField(e,"segment_duration","uint",1===this.version?64:32),this._procEntryField(e,"media_time","int",1===this.version?64:32),this._procEntryField(e,"media_rate_integer","int",16),this._procEntryField(e,"media_rate_fraction","int",16)})},i.prototype._boxProcessors.emsg=function(){this._procFullBox(),1==this.version?(this._procField("timescale","uint",32),this._procField("presentation_time","uint",64),this._procField("event_duration","uint",32),this._procField("id","uint",32),this._procField("scheme_id_uri","string",-1),this._procField("value","string",-1)):(this._procField("scheme_id_uri","string",-1),this._procField("value","string",-1),this._procField("timescale","uint",32),this._procField("presentation_time_delta","uint",32),this._procField("event_duration","uint",32),this._procField("id","uint",32)),this._procField("message_data","data",-1)},i.prototype._boxProcessors.free=i.prototype._boxProcessors.skip=function(){this._procField("data","data",-1)},i.prototype._boxProcessors.frma=function(){this._procField("data_format","uint",32)},i.prototype._boxProcessors.ftyp=i.prototype._boxProcessors.styp=function(){this._procField("major_brand","string",4),this._procField("minor_version","uint",32);var e=-1;this._parsing&&(e=(this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset))/4),this._procFieldArray("compatible_brands",e,"string",4)},i.prototype._boxProcessors.hdlr=function(){this._procFullBox(),this._procField("pre_defined","uint",32),this._procField("handler_type","string",4),this._procFieldArray("reserved",3,"uint",32),this._procField("name","string",-1)},i.prototype._boxProcessors.mdat=function(){this._procField("data","data",-1)},i.prototype._boxProcessors.mdhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("timescale","uint",32),this._procField("duration","uint",1==this.version?64:32),this._parsing||"string"!=typeof this.language||(this.language=this.language.charCodeAt(0)-96<<10|this.language.charCodeAt(1)-96<<5|this.language.charCodeAt(2)-96),this._procField("language","uint",16),this._parsing&&(this.language=String.fromCharCode(96+(this.language>>10&31),96+(this.language>>5&31),96+(31&this.language))),this._procField("pre_defined","uint",16)},i.prototype._boxProcessors.mehd=function(){this._procFullBox(),this._procField("fragment_duration","uint",1==this.version?64:32)},i.prototype._boxProcessors.mfhd=function(){this._procFullBox(),this._procField("sequence_number","uint",32)},i.prototype._boxProcessors.mfro=function(){this._procFullBox(),this._procField("mfra_size","uint",32)},i.prototype._boxProcessors.mp4a=i.prototype._boxProcessors.enca=function(){this._procFieldArray("reserved1",6,"uint",8),this._procField("data_reference_index","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procField("channelcount","uint",16),this._procField("samplesize","uint",16),this._procField("pre_defined","uint",16),this._procField("reserved3","uint",16),this._procField("samplerate","template",32),this._procField("esds","data",-1)},i.prototype._boxProcessors.mvhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("timescale","uint",32),this._procField("duration","uint",1==this.version?64:32),this._procField("rate","template",32),this._procField("volume","template",16),this._procField("reserved1","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procFieldArray("matrix",9,"template",32),this._procFieldArray("pre_defined",6,"uint",32),this._procField("next_track_ID","uint",32)},i.prototype._boxProcessors.payl=function(){this._procField("cue_text","utf8")},i.prototype._boxProcessors.pssh=function(){this._procFullBox(),this._procFieldArray("SystemID",16,"uint",8),this._procField("DataSize","uint",32),this._procFieldArray("Data",this.DataSize,"uint",8)},i.prototype._boxProcessors.schm=function(){this._procFullBox(),this._procField("scheme_type","uint",32),this._procField("scheme_version","uint",32),1&this.flags&&this._procField("scheme_uri","string",-1)},i.prototype._boxProcessors.sdtp=function(){this._procFullBox();var e=-1;this._parsing&&(e=this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset)),this._procFieldArray("sample_dependency_table",e,"uint",8)},i.prototype._boxProcessors.sidx=function(){this._procFullBox(),this._procField("reference_ID","uint",32),this._procField("timescale","uint",32),this._procField("earliest_presentation_time","uint",1==this.version?64:32),this._procField("first_offset","uint",1==this.version?64:32),this._procField("reserved","uint",16),this._procField("reference_count","uint",16),this._procEntries("references",this.reference_count,function(e){this._parsing||(e.reference=(1&e.reference_type)<<31,e.reference|=2147483647&e.referenced_size,e.sap=(1&e.starts_with_SAP)<<31,e.sap|=(3&e.SAP_type)<<28,e.sap|=268435455&e.SAP_delta_time),this._procEntryField(e,"reference","uint",32),this._procEntryField(e,"subsegment_duration","uint",32),this._procEntryField(e,"sap","uint",32),this._parsing&&(e.reference_type=e.reference>>31&1,e.referenced_size=2147483647&e.reference,e.starts_with_SAP=e.sap>>31&1,e.SAP_type=e.sap>>28&7,e.SAP_delta_time=268435455&e.sap)})},i.prototype._boxProcessors.smhd=function(){this._procFullBox(),this._procField("balance","uint",16),this._procField("reserved","uint",16)},i.prototype._boxProcessors.ssix=function(){this._procFullBox(),this._procField("subsegment_count","uint",32),this._procEntries("subsegments",this.subsegment_count,function(e){this._procEntryField(e,"ranges_count","uint",32),this._procSubEntries(e,"ranges",e.ranges_count,function(e){this._procEntryField(e,"level","uint",8),this._procEntryField(e,"range_size","uint",24)})})},i.prototype._boxProcessors.stsd=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},i.prototype._boxProcessors.subs=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,function(e){this._procEntryField(e,"sample_delta","uint",32),this._procEntryField(e,"subsample_count","uint",16),this._procSubEntries(e,"subsamples",e.subsample_count,function(e){this._procEntryField(e,"subsample_size","uint",1===this.version?32:16),this._procEntryField(e,"subsample_priority","uint",8),this._procEntryField(e,"discardable","uint",8),this._procEntryField(e,"codec_specific_parameters","uint",32)})})},i.prototype._boxProcessors.tenc=function(){this._procFullBox(),this._procField("default_IsEncrypted","uint",24),this._procField("default_IV_size","uint",8),this._procFieldArray("default_KID",16,"uint",8)},i.prototype._boxProcessors.tfdt=function(){this._procFullBox(),this._procField("baseMediaDecodeTime","uint",1==this.version?64:32)},i.prototype._boxProcessors.tfhd=function(){this._procFullBox(),this._procField("track_ID","uint",32),1&this.flags&&this._procField("base_data_offset","uint",64),2&this.flags&&this._procField("sample_description_offset","uint",32),8&this.flags&&this._procField("default_sample_duration","uint",32),16&this.flags&&this._procField("default_sample_size","uint",32),32&this.flags&&this._procField("default_sample_flags","uint",32)},i.prototype._boxProcessors.tfra=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._parsing||(this.reserved=0,this.reserved|=(48&this.length_size_of_traf_num)<<4,this.reserved|=(12&this.length_size_of_trun_num)<<2,this.reserved|=3&this.length_size_of_sample_num),this._procField("reserved","uint",32),this._parsing&&(this.length_size_of_traf_num=(48&this.reserved)>>4,this.length_size_of_trun_num=(12&this.reserved)>>2,this.length_size_of_sample_num=3&this.reserved),this._procField("number_of_entry","uint",32),this._procEntries("entries",this.number_of_entry,function(e){this._procEntryField(e,"time","uint",1===this.version?64:32),this._procEntryField(e,"moof_offset","uint",1===this.version?64:32),this._procEntryField(e,"traf_number","uint",8*(this.length_size_of_traf_num+1)),this._procEntryField(e,"trun_number","uint",8*(this.length_size_of_trun_num+1)),this._procEntryField(e,"sample_number","uint",8*(this.length_size_of_sample_num+1))})},i.prototype._boxProcessors.tkhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("track_ID","uint",32),this._procField("reserved1","uint",32),this._procField("duration","uint",1==this.version?64:32),this._procFieldArray("reserved2",2,"uint",32),this._procField("layer","uint",16),this._procField("alternate_group","uint",16),this._procField("volume","template",16),this._procField("reserved3","uint",16),this._procFieldArray("matrix",9,"template",32),this._procField("width","template",32),this._procField("height","template",32)},i.prototype._boxProcessors.trex=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._procField("default_sample_description_index","uint",32),this._procField("default_sample_duration","uint",32),this._procField("default_sample_size","uint",32),this._procField("default_sample_flags","uint",32)},i.prototype._boxProcessors.trun=function(){this._procFullBox(),this._procField("sample_count","uint",32),1&this.flags&&this._procField("data_offset","int",32),4&this.flags&&this._procField("first_sample_flags","uint",32),this._procEntries("samples",this.sample_count,function(e){256&this.flags&&this._procEntryField(e,"sample_duration","uint",32),512&this.flags&&this._procEntryField(e,"sample_size","uint",32),1024&this.flags&&this._procEntryField(e,"sample_flags","uint",32),2048&this.flags&&this._procEntryField(e,"sample_composition_time_offset",1===this.version?"int":"uint",32)})},i.prototype._boxProcessors["url "]=i.prototype._boxProcessors["urn "]=function(){this._procFullBox(),"urn "===this.type&&this._procField("name","string",-1),this._procField("location","string",-1)},i.prototype._boxProcessors.vlab=function(){this._procField("source_label","utf8")},i.prototype._boxProcessors.vmhd=function(){this._procFullBox(),this._procField("graphicsmode","uint",16),this._procFieldArray("opcolor",3,"uint",16)},i.prototype._boxProcessors.vttC=function(){this._procField("config","utf8")},i.prototype._boxProcessors.vtte=function(){}},"./node_modules/core-util-is/lib/util.js":function(e,t,r){(function(e){function r(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===r(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===r(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===r(e)},t.isError=function(e){return"[object Error]"===r(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,r("./node_modules/node-libs-browser/node_modules/buffer/index.js").Buffer)},"./node_modules/es6-promise/auto.js":function(e,t,r){e.exports=r("./node_modules/es6-promise/dist/es6-promise.js").polyfill()},"./node_modules/es6-promise/dist/es6-promise.js":function(e,t,r){(function(t,r){var n;n=function(){function e(e){return"function"==typeof e}var n=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},a=0,i=void 0,s=void 0,o=function(e,t){g[a]=e,g[a+1]=t,2===(a+=2)&&(s?s(p):v())},u="undefined"!=typeof window?window:void 0,l=u||{},c=l.MutationObserver||l.WebKitMutationObserver,f="undefined"==typeof self&&void 0!==t&&"[object process]"==={}.toString.call(t),d="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function h(){var e=setTimeout;return function(){return e(p,1)}}var g=new Array(1e3);function p(){for(var e=0;e<a;e+=2)(0,g[e])(g[e+1]),g[e]=void 0,g[e+1]=void 0;a=0}var m,y,E,_,v=void 0;function T(e,t){var r=this,n=new this.constructor(A);void 0===n[b]&&x(n);var a=r._state;if(a){var i=arguments[a-1];o(function(){return F(a,n,i,r._result)})}else P(r,n,e,t);return n}function S(e){if(e&&"object"==typeof e&&e.constructor===this)return e;var t=new this(A);return N(t,e),t}f?v=function(){return t.nextTick(p)}:c?(y=0,E=new c(p),_=document.createTextNode(""),E.observe(_,{characterData:!0}),v=function(){_.data=y=++y%2}):d?((m=new MessageChannel).port1.onmessage=p,v=function(){return m.port2.postMessage(0)}):v=void 0===u?function(){try{var e=Function("return this")().require("vertx");return void 0!==(i=e.runOnLoop||e.runOnContext)?function(){i(p)}:h()}catch(e){return h()}}():h();var b=Math.random().toString(36).substring(2);function A(){}var R=void 0,I=1,C=2;function w(t,r,n){r.constructor===t.constructor&&n===T&&r.constructor.resolve===S?function(e,t){t._state===I?M(e,t._result):t._state===C?O(e,t._result):P(t,void 0,function(t){return N(e,t)},function(t){return O(e,t)})}(t,r):void 0===n?M(t,r):e(n)?function(e,t,r){o(function(e){var n=!1,a=function(r,a){try{r.call(a,function(r){n||(n=!0,t!==r?N(e,r):M(e,r))},function(t){n||(n=!0,O(e,t))})}catch(e){return e}}(r,t,0,0,e._label);!n&&a&&(n=!0,O(e,a))},e)}(t,r,n):M(t,r)}function N(e,t){if(e===t)O(e,new TypeError("You cannot resolve a promise with itself"));else if(a=typeof(n=t),null===n||"object"!==a&&"function"!==a)M(e,t);else{var r=void 0;try{r=t.then}catch(t){return void O(e,t)}w(e,t,r)}var n,a}function D(e){e._onerror&&e._onerror(e._result),L(e)}function M(e,t){e._state===R&&(e._result=t,e._state=I,0!==e._subscribers.length&&o(L,e))}function O(e,t){e._state===R&&(e._state=C,e._result=t,o(D,e))}function P(e,t,r,n){var a=e._subscribers,i=a.length;e._onerror=null,a[i]=t,a[i+I]=r,a[i+C]=n,0===i&&e._state&&o(L,e)}function L(e){var t=e._subscribers,r=e._state;if(0!==t.length){for(var n=void 0,a=void 0,i=e._result,s=0;s<t.length;s+=3)n=t[s],a=t[s+r],n?F(r,n,a,i):a(i);e._subscribers.length=0}}function F(t,r,n,a){var i=e(n),s=void 0,o=void 0,u=!0;if(i){try{s=n(a)}catch(e){u=!1,o=e}if(r===s)return void O(r,new TypeError("A promises callback cannot return that same promise."))}else s=a;r._state!==R||(i&&u?N(r,s):!1===u?O(r,o):t===I?M(r,s):t===C&&O(r,s))}var j=0;function x(e){e[b]=j++,e._state=void 0,e._result=void 0,e._subscribers=[]}var k=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(A),this.promise[b]||x(this.promise),n(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?M(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&M(this.promise,this._result))):O(this.promise,new Error("Array Methods must be provided an Array"))}return e.prototype._enumerate=function(e){for(var t=0;this._state===R&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var r=this._instanceConstructor,n=r.resolve;if(n===S){var a=void 0,i=void 0,s=!1;try{a=e.then}catch(e){s=!0,i=e}if(a===T&&e._state!==R)this._settledAt(e._state,t,e._result);else if("function"!=typeof a)this._remaining--,this._result[t]=e;else if(r===B){var o=new r(A);s?O(o,i):w(o,e,a),this._willSettleAt(o,t)}else this._willSettleAt(new r(function(t){return t(e)}),t)}else this._willSettleAt(n(e),t)},e.prototype._settledAt=function(e,t,r){var n=this.promise;n._state===R&&(this._remaining--,e===C?O(n,r):this._result[t]=r),0===this._remaining&&M(n,this._result)},e.prototype._willSettleAt=function(e,t){var r=this;P(e,void 0,function(e){return r._settledAt(I,t,e)},function(e){return r._settledAt(C,t,e)})},e}(),B=function(){function t(e){this[b]=j++,this._result=this._state=void 0,this._subscribers=[],A!==e&&("function"!=typeof e&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof t?function(e,t){try{t(function(t){N(e,t)},function(t){O(e,t)})}catch(t){O(e,t)}}(this,e):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return t.prototype.catch=function(e){return this.then(null,e)},t.prototype.finally=function(t){var r=this,n=r.constructor;return e(t)?r.then(function(e){return n.resolve(t()).then(function(){return e})},function(e){return n.resolve(t()).then(function(){throw e})}):r.then(t,t)},t}();return B.prototype.then=T,B.all=function(e){return new k(this,e).promise},B.race=function(e){var t=this;return n(e)?new t(function(r,n){for(var a=e.length,i=0;i<a;i++)t.resolve(e[i]).then(r,n)}):new t(function(e,t){return t(new TypeError("You must pass an array to race."))})},B.resolve=S,B.reject=function(e){var t=new this(A);return O(t,e),t},B._setScheduler=function(e){s=e},B._setAsap=function(e){o=e},B._asap=o,B.polyfill=function(){var e=void 0;if(void 0!==r)e=r;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var n=null;try{n=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===n&&!t.cast)return}e.Promise=B},B.Promise=B,B},e.exports=n()}).call(this,r("./node_modules/process/browser.js"),r("./node_modules/webpack/buildin/global.js"))},"./node_modules/fast-deep-equal/index.js":function(e,t,r){var n=Array.isArray,a=Object.keys,i=Object.prototype.hasOwnProperty;e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){var s,o,u,l=n(t),c=n(r);if(l&&c){if((o=t.length)!=r.length)return!1;for(s=o;0!==s--;)if(!e(t[s],r[s]))return!1;return!0}if(l!=c)return!1;var f=t instanceof Date,d=r instanceof Date;if(f!=d)return!1;if(f&&d)return t.getTime()==r.getTime();var h=t instanceof RegExp,g=r instanceof RegExp;if(h!=g)return!1;if(h&&g)return t.toString()==r.toString();var p=a(t);if((o=p.length)!==a(r).length)return!1;for(s=o;0!==s--;)if(!i.call(r,p[s]))return!1;for(s=o;0!==s--;)if(!e(t[u=p[s]],r[u]))return!1;return!0}return t!=t&&r!=r}},"./node_modules/ieee754/index.js":function(e,t){t.read=function(e,t,r,n,a){var i,s,o=8*a-n-1,u=(1<<o)-1,l=u>>1,c=-7,f=r?a-1:0,d=r?-1:1,h=e[t+f];for(f+=d,i=h&(1<<-c)-1,h>>=-c,c+=o;c>0;i=256*i+e[t+f],f+=d,c-=8);for(s=i&(1<<-c)-1,i>>=-c,c+=n;c>0;s=256*s+e[t+f],f+=d,c-=8);if(0===i)i=1-l;else{if(i===u)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,n),i-=l}return(h?-1:1)*s*Math.pow(2,i-n)},t.write=function(e,t,r,n,a,i){var s,o,u,l=8*i-a-1,c=(1<<l)-1,f=c>>1,d=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,g=n?1:-1,p=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=c?(o=0,s=c):s+f>=1?(o=(t*u-1)*Math.pow(2,a),s+=f):(o=t*Math.pow(2,f-1)*Math.pow(2,a),s=0));a>=8;e[r+h]=255&o,h+=g,o/=256,a-=8);for(s=s<<a|o,l+=a;l>0;e[r+h]=255&s,h+=g,s/=256,l-=8);e[r+h-g]|=128*p}},"./node_modules/imsc/src/main/js/doc.js":function(e,t,r){!function(e,t,r,n,a){function i(e,t,r,n){var a=n&&"seq"===n.timeContainer,s=0;n&&(s=a&&r?r.end:n.begin),t.begin=t.explicit_begin?t.explicit_begin+s:s;var o=t.begin,u=null;for(var l in t.sets)i(e,t.sets[l],u,t),o="seq"===t.timeContainer?t.sets[l].end:Math.max(o,t.sets[l].end),u=t.sets[l];if("contents"in t)for(var c in t.contents)i(e,t.contents[c],u,t),o="seq"===t.timeContainer?t.contents[c].end:Math.max(o,t.contents[c].end),u=t.contents[c];else o=a?t.begin:Number.POSITIVE_INFINITY;null!==t.explicit_end&&null!==t.explicit_dur?t.end=Math.min(t.begin+t.explicit_dur,s+t.explicit_end):null===t.explicit_end&&null!==t.explicit_dur?t.end=t.begin+t.explicit_dur:null!==t.explicit_end&&null===t.explicit_dur?t.end=s+t.explicit_end:t.end=o,delete t.explicit_begin,delete t.explicit_dur,delete t.explicit_end,e._registerEvent(t)}function s(e){this.node=e}function o(){this.events=[],this.head=null,this.body=null}function u(){this.styling=null,this.layout=null}function l(){this.styles={}}function c(){this.id=null,this.styleAttrs=null,this.styleRefs=null}function f(){this.regions={}}function d(e){this.kind=e}function h(e){this.id=e}function g(e){this.regionID=e}function p(e){this.styleAttrs=e}function m(e){this.sets=e}function y(e){this.contents=e}function E(e,t,r){this.explicit_begin=e,this.explicit_end=t,this.explicit_dur=r}function _(){d.call(this,"body")}function v(){d.call(this,"div")}function T(){d.call(this,"p")}function S(){d.call(this,"span")}function b(){d.call(this,"span")}function A(){d.call(this,"br")}function R(){}function I(){}function C(e){return e&&"xml:id"in e.attributes&&e.attributes["xml:id"].value||null}function w(e){return e&&"style"in e.attributes?e.attributes.style.value.split(" "):[]}function N(e,t){var r={};if(null!==e)for(var a in e.attributes){var i=e.attributes[a].uri+" "+e.attributes[a].local,s=n.byQName[i];if(void 0!==s){var o=s.parse(e.attributes[a].value);null!==o?(r[i]=o,s===n.byName.zIndex&&F(t,"zIndex attribute present but not used by IMSC1 since regions do not overlap")):j(t,"Cannot parse styling attribute "+i+" --\x3e "+e.attributes[a].value)}}return r}function D(e,t,r){for(var n in e.attributes)if(e.attributes[n].uri===t&&e.attributes[n].local===r)return e.attributes[n].value;return null}function M(e,t,r){var n,a=null;return null!==(n=/^(\d+(?:\.\d+)?)f$/.exec(r))?null!==t&&(a=parseFloat(n[1])/t):null!==(n=/^(\d+(?:\.\d+)?)t$/.exec(r))?null!==e&&(a=parseFloat(n[1])/e):null!==(n=/^(\d+(?:\.\d+)?)ms$/.exec(r))?a=parseFloat(n[1])/1e3:null!==(n=/^(\d+(?:\.\d+)?)s$/.exec(r))?a=parseFloat(n[1]):null!==(n=/^(\d+(?:\.\d+)?)h$/.exec(r))?a=3600*parseFloat(n[1]):null!==(n=/^(\d+(?:\.\d+)?)m$/.exec(r))?a=60*parseFloat(n[1]):null!==(n=/^(\d{2,}):(\d\d):(\d\d(?:\.\d+)?)$/.exec(r))?a=3600*parseInt(n[1])+60*parseInt(n[2])+parseFloat(n[3]):null!==(n=/^(\d{2,}):(\d\d):(\d\d)\:(\d{2,})$/.exec(r))&&null!==t&&(a=3600*parseInt(n[1])+60*parseInt(n[2])+parseInt(n[3])+(null===n[4]?0:parseInt(n[4])/t)),a}function O(e,t,r){for(;t.styleRefs.length>0;){var n=t.styleRefs.pop();n in e.styles?(O(e,e.styles[n],r),L(e.styles[n].styleAttrs,t.styleAttrs)):j(r,"Non-existant style id referenced")}}function P(e,t,r,n){for(var a=t.length-1;a>=0;a--){var i=t[a];i in e.styles?L(e.styles[i].styleAttrs,r):j(n,"Non-existant style id referenced")}}function L(e,t){for(var r in e)r in t||(t[r]=e[r])}function F(e,t){if(e&&e.warn&&e.warn(t))throw t}function j(e,t){if(e&&e.error&&e.error(t))throw t}function x(e,t){throw e&&e.fatal&&e.fatal(t),t}function k(e,t){for(var r,n=0,a=e.length-1;n<=a;){var i=e[r=Math.floor((n+a)/2)];if(i<t)n=r+1;else{if(!(i>t))return{found:!0,index:r};a=r-1}}return{found:!1,index:n}}e.fromXML=function(e,n,a){var d=t.parser(!0,{xmlns:!0}),h=[],g=[],p=[],m=0,y=null;d.onclosetag=function(e){if(h[0]instanceof l)for(var t in h[0].styles)O(h[0],h[0].styles[t],n);else if(h[0]instanceof T||h[0]instanceof S){if(h[0].contents.length>1){var i,o=[h[0].contents[0]];for(i=1;i<h[0].contents.length;i++)h[0].contents[i]instanceof b&&o[o.length-1]instanceof b?o[o.length-1].text+=h[0].contents[i].text:o.push(h[0].contents[i]);h[0].contents=o}h[0]instanceof S&&1===h[0].contents.length&&h[0].contents[0]instanceof b&&(h[0].text=h[0].contents[0].text,delete h[0].contents)}else h[0]instanceof s&&(h[0].node.uri===r.ns_tt&&"metadata"===h[0].node.local?m--:m>0&&a&&"onCloseTag"in a&&a.onCloseTag());p.shift(),g.shift(),h.shift()},d.ontext=function(e){if(void 0===h[0]);else if(h[0]instanceof S||h[0]instanceof T){var t=new b;t.initFromText(y,h[0],e,p[0],n),h[0].contents.push(t)}else h[0]instanceof s&&m>0&&a&&"onText"in a&&a.onText(e)},d.onopentag=function(e){var t=e.attributes["xml:space"];t?p.unshift(t.value):0===p.length?p.unshift("default"):p.unshift(p[0]);var i=e.attributes["xml:lang"];if(i?g.unshift(i.value):0===g.length?g.unshift(""):g.unshift(g[0]),e.uri===r.ns_tt)if("tt"===e.local)null!==y&&x(n,"Two <tt> elements at ("+this.line+","+this.column+")"),(y=new o).initFromNode(e,n),h.unshift(y);else if("head"===e.local)h[0]instanceof o||x(n,"Parent of <head> element is not <tt> at ("+this.line+","+this.column+")"),null!==y.head&&x("Second <head> element at ("+this.line+","+this.column+")"),y.head=new u,h.unshift(y.head);else if("styling"===e.local)h[0]instanceof u||x(n,"Parent of <styling> element is not <head> at ("+this.line+","+this.column+")"),null!==y.head.styling&&x("Second <styling> element at ("+this.line+","+this.column+")"),y.head.styling=new l,h.unshift(y.head.styling);else if("style"===e.local){var d;h[0]instanceof l?((d=new c).initFromNode(e,n),d.id?y.head.styling.styles[d.id]=d:j(n,"<style> element missing @id attribute"),h.unshift(d)):h[0]instanceof R?((d=new c).initFromNode(e,n),L(d.styleAttrs,h[0].styleAttrs),h.unshift(d)):x(n,"Parent of <style> element is not <styling> or <region> at ("+this.line+","+this.column+")")}else if("layout"===e.local)h[0]instanceof u||x(n,"Parent of <layout> element is not <head> at "+this.line+","+this.column+")"),null!==y.head.layout&&x(n,"Second <layout> element at "+this.line+","+this.column+")"),y.head.layout=new f,h.unshift(y.head.layout);else if("region"===e.local){h[0]instanceof f||x(n,"Parent of <region> element is not <layout> at "+this.line+","+this.column+")");var E=new R;E.initFromNode(y,e,n),!E.id||E.id in y.head.layout.regions?j(n,"Ignoring <region> with duplicate or missing @id at "+this.line+","+this.column+")"):y.head.layout.regions[E.id]=E,h.unshift(E)}else if("body"===e.local){h[0]instanceof o||x(n,"Parent of <body> element is not <tt> at "+this.line+","+this.column+")"),null!==y.body&&x(n,"Second <body> element at "+this.line+","+this.column+")");var b=new _;b.initFromNode(y,e,n),y.body=b,h.unshift(b)}else if("div"===e.local){h[0]instanceof v||h[0]instanceof _||x(n,"Parent of <div> element is not <body> or <div> at "+this.line+","+this.column+")");var C=new v;C.initFromNode(y,h[0],e,n),h[0].contents.push(C),h.unshift(C)}else if("p"===e.local){h[0]instanceof v||x(n,"Parent of <p> element is not <div> at "+this.line+","+this.column+")");var w=new T;w.initFromNode(y,h[0],e,n),h[0].contents.push(w),h.unshift(w)}else if("span"===e.local){h[0]instanceof S||h[0]instanceof T||x(n,"Parent of <span> element is not <span> or <p> at "+this.line+","+this.column+")");var N=new S;N.initFromNode(y,h[0],e,p[0],n),h[0].contents.push(N),h.unshift(N)}else if("br"===e.local){h[0]instanceof S||h[0]instanceof T||x(n,"Parent of <br> element is not <span> or <p> at "+this.line+","+this.column+")");var D=new A;D.initFromNode(y,h[0],e,n),h[0].contents.push(D),h.unshift(D)}else if("set"===e.local){h[0]instanceof S||h[0]instanceof T||h[0]instanceof v||h[0]instanceof _||h[0]instanceof R||h[0]instanceof A||x(n,"Parent of <set> element is not a content element or a region at "+this.line+","+this.column+")");var M=new I;M.initFromNode(y,h[0],e,n),h[0].sets.push(M),h.unshift(M)}else h.unshift(new s(e));else h.unshift(new s(e));if(h[0]instanceof s)if(e.uri===r.ns_tt&&"metadata"===e.local)m++;else if(m>0&&a&&"onOpenTag"in a){var O=[];for(var P in e.attributes)O[e.attributes[P].uri+" "+e.attributes[P].local]={uri:e.attributes[P].uri,local:e.attributes[P].local,value:e.attributes[P].value};a.onOpenTag(e.uri,e.local,O)}},d.write(e).close(),null!==y.head?delete y.head.styling:y.head=new u,null===y.head.layout&&(y.head.layout=new f);var E=!1;for(var C in y.head.layout.regions){E=!0;break}if(!E){var w=R.prototype.createDefaultRegion();y.head.layout.regions[w.id]=w}for(var N in y.head.layout.regions)i(y,y.head.layout.regions[N],null,null);return y.body&&i(y,y.body,null,null),y},o.prototype.initFromNode=function(e,t){this.cellResolution=function(e,t){var n=D(e,r.ns_ttp,"cellResolution"),a=15,i=32;if(null!==n){var s=/(\d+) (\d+)/.exec(n);null!==s?(i=parseInt(s[1]),a=parseInt(s[2])):F(t,"Malformed cellResolution value (using initial value instead)")}return{w:i,h:a}}(e,t);var n=function(e,t){var n,a=D(e,r.ns_ttp,"frameRate"),i=30;null!==a&&(null!==(n=/(\d+)/.exec(a))?i=parseInt(n[1]):F(t,"Malformed frame rate attribute (using initial value instead)"));var s=D(e,r.ns_ttp,"frameRateMultiplier"),o=1;null!==s&&(null!==(n=/(\d+) (\d+)/.exec(s))?o=parseInt(n[1])/parseInt(n[2]):F(t,"Malformed frame rate multiplier attribute (using initial value instead)"));var u=o*i,l=1,c=D(e,r.ns_ttp,"tickRate");return null===c?null!==a&&(l=u):null!==(n=/(\d+)/.exec(c))?l=parseInt(n[1]):F(t,"Malformed tick rate attribute (using initial value instead)"),{effectiveFrameRate:u,tickRate:l}}(e,t);this.effectiveFrameRate=n.effectiveFrameRate,this.tickRate=n.tickRate,this.aspectRatio=function(e,t){var n=D(e,r.ns_ittp,"aspectRatio"),a=null;if(null!==n){var i=/(\d+) (\d+)/.exec(n);if(null!==i){var s=parseInt(i[1]),o=parseInt(i[2]);0!==s&&0!==o?a=s/o:j(t,"Illegal aspectRatio values (ignoring)")}else j(t,"Malformed aspectRatio attribute (ignoring)")}return a}(e,t);var i=D(e,r.ns_ttp,"timeBase");null!==i&&"media"!==i&&x(t,"Unsupported time base");var s=function(e,t){var n=D(e,r.ns_tts,"extent");if(null===n)return null;var i=n.split(" ");if(2!==i.length)return F(t,"Malformed extent (ignoring)"),null;var s=a.parseLength(i[0]),o=a.parseLength(i[1]);return o&&s?{h:o,w:s}:(F(t,"Malformed extent values (ignoring)"),null)}(e,t);null===s?this.pxDimensions={h:480,w:640}:("px"===s.h.unit&&"px"===s.w.unit||x(t,"Extent on TT must be in px or absent"),this.pxDimensions={h:s.h.value,w:s.w.value})},o.prototype._registerEvent=function(e){if(!(e.end<=e.begin)){var t=k(this.events,e.begin);if(t.found||this.events.splice(t.index,0,e.begin),e.end!==Number.POSITIVE_INFINITY){var r=k(this.events,e.end);r.found||this.events.splice(r.index,0,e.end)}}},o.prototype.getMediaTimeRange=function(){return[this.events[0],this.events[this.events.length-1]]},o.prototype.getMediaTimeEvents=function(){return this.events},c.prototype.initFromNode=function(e,t){this.id=C(e),this.styleAttrs=N(e,t),this.styleRefs=w(e)},h.prototype.initFromNode=function(e,t,r,n){this.id=C(r)},g.prototype.initFromNode=function(e,t,r,n){this.regionID=function(e){return e&&"region"in e.attributes?e.attributes.region.value:""}(r)},p.prototype.initFromNode=function(e,t,r,n){this.styleAttrs=N(r,n),null!==e.head&&null!==e.head.styling&&P(e.head.styling,w(r),this.styleAttrs,n)},m.prototype.initFromNode=function(e,t,r,n){this.sets=[]},y.prototype.initFromNode=function(e,t,r,n){this.contents=[]},E.prototype.initFromNode=function(e,t,r,n){var a=function(e,t,r,n){var a=null;r&&"begin"in r.attributes&&null===(a=M(e.tickRate,e.effectiveFrameRate,r.attributes.begin.value))&&F(n,"Malformed begin value "+r.attributes.begin.value+" (using 0)");var i=null;r&&"dur"in r.attributes&&null===(i=M(e.tickRate,e.effectiveFrameRate,r.attributes.dur.value))&&F(n,"Malformed dur value "+r.attributes.dur.value+" (ignoring)");var s=null;return r&&"end"in r.attributes&&null===(s=M(e.tickRate,e.effectiveFrameRate,r.attributes.end.value))&&F(n,"Malformed end value (ignoring)"),{explicit_begin:a,explicit_end:s,explicit_dur:i}}(e,0,r,n);this.explicit_begin=a.explicit_begin,this.explicit_end=a.explicit_end,this.explicit_dur=a.explicit_dur,this.timeContainer=function(e,t){var r=e&&"timeContainer"in e.attributes?e.attributes.timeContainer.value:null;return r&&"par"!==r?"seq"===r?"seq":(j(t,"Illegal value of timeContainer (assuming 'par')"),"par"):"par"}(r,n)},_.prototype.initFromNode=function(e,t,r){p.prototype.initFromNode.call(this,e,null,t,r),E.prototype.initFromNode.call(this,e,null,t,r),m.prototype.initFromNode.call(this,e,null,t,r),g.prototype.initFromNode.call(this,e,null,t,r),y.prototype.initFromNode.call(this,e,null,t,r)},v.prototype.initFromNode=function(e,t,r,n){p.prototype.initFromNode.call(this,e,t,r,n),E.prototype.initFromNode.call(this,e,t,r,n),m.prototype.initFromNode.call(this,e,t,r,n),g.prototype.initFromNode.call(this,e,t,r,n),y.prototype.initFromNode.call(this,e,t,r,n)},T.prototype.initFromNode=function(e,t,r,n){p.prototype.initFromNode.call(this,e,t,r,n),E.prototype.initFromNode.call(this,e,t,r,n),m.prototype.initFromNode.call(this,e,t,r,n),g.prototype.initFromNode.call(this,e,t,r,n),y.prototype.initFromNode.call(this,e,t,r,n)},S.prototype.initFromNode=function(e,t,r,n,a){p.prototype.initFromNode.call(this,e,t,r,a),E.prototype.initFromNode.call(this,e,t,r,a),m.prototype.initFromNode.call(this,e,t,r,a),g.prototype.initFromNode.call(this,e,t,r,a),y.prototype.initFromNode.call(this,e,t,r,a),this.space=n},b.prototype.initFromText=function(e,t,r,n,a){E.prototype.initFromNode.call(this,e,t,null,a),this.text=r,this.space=n},A.prototype.initFromNode=function(e,t,r,n){g.prototype.initFromNode.call(this,e,t,r,n),E.prototype.initFromNode.call(this,e,t,r,n)},R.prototype.createDefaultRegion=function(){var e=new R;return h.call(e,""),p.call(e,{}),m.call(e,[]),E.call(e,0,Number.POSITIVE_INFINITY,null),e},R.prototype.initFromNode=function(e,t,r){h.prototype.initFromNode.call(this,e,null,t,r),p.prototype.initFromNode.call(this,e,null,t,r),E.prototype.initFromNode.call(this,e,null,t,r),m.prototype.initFromNode.call(this,e,null,t,r),null!==e.head&&null!==e.head.styling&&P(e.head.styling,w(t),this.styleAttrs,r)},I.prototype.initFromNode=function(e,t,r,n){E.prototype.initFromNode.call(this,e,t,r,n);var a=N(r,n);for(var i in this.qname=null,this.value=null,a){if(this.qname){j(n,"More than one style specified on set");break}this.qname=i,this.value=a[i]}}}(t,"undefined"==typeof sax?r("./node_modules/sax/lib/sax.js"):sax,"undefined"==typeof imscNames?r("./node_modules/imsc/src/main/js/names.js"):imscNames,"undefined"==typeof imscStyles?r("./node_modules/imsc/src/main/js/styles.js"):imscStyles,"undefined"==typeof imscUtils?r("./node_modules/imsc/src/main/js/utils.js"):imscUtils)},"./node_modules/imsc/src/main/js/html.js":function(e,t,r){!function(e,t,r){function n(e,t,o){var l;if("region"===o.kind?(l=document.createElement("div")).style.position="absolute":"body"===o.kind||"div"===o.kind?l=document.createElement("div"):"p"===o.kind?l=document.createElement("p"):"span"===o.kind?l=document.createElement("span"):"br"===o.kind&&(l=document.createElement("br")),l){for(var c in l.style.margin="0",u){var f=u[c],d=o.styleAttrs[f.qname];void 0!==d&&null!==f.map&&f.map(e,l,o,d)}var h=l;if("region"===o.kind){var g=o.styleAttrs[r.byName.writingMode.qname];"lrtb"===g||"lr"===g?(e.ipd="lr",e.bpd="tb"):"rltb"===g||"rl"===g?(e.ipd="rl",e.bpd="tb"):"tblr"===g?(e.ipd="tb",e.bpd="lr"):"tbrl"!==g&&"tb"!==g||(e.ipd="tb",e.bpd="rl")}var p=o.styleAttrs[r.byName.linePadding.qname];if(p&&p>0){var m=Math.ceil(p*e.h)+"px";"tb"===e.bpd?(h.style.paddingLeft=m,h.style.paddingRight=m):(h.style.paddingTop=m,h.style.paddingBottom=m),e.lp=p}var y=o.styleAttrs[r.byName.multiRowAlign.qname];if(y&&"auto"!==y){var E=document.createElement("span");E.style.display="inline-block",E.style.textAlign=y,l.appendChild(E),h=E,e.mra=y}if(o.styleAttrs[r.byName.fillLineGap.qname]&&(e.flg=!0),"span"===o.kind&&o.text)if(e.lp||e.mra||e.flg)for(var _="",v=0;v<o.text.length;v++){_+=o.text.charAt(v);var T=o.text.charCodeAt(v);if(T<55296||T>56319||v===o.text.length){var S=document.createElement("span");S.textContent=_,l.appendChild(S),_=""}}else l.textContent=o.text;for(var b in t.appendChild(l),o.contents)n(e,h,o.contents[b]);var A=[];if((e.lp||e.mra||e.flg)&&"p"===o.kind&&(s(e,h,A,null),e.mra&&(function(e){for(var t=0;t<e.length-1;t++){var r=e[t].elements.length;if(0!==r&&!1===e[t].br){var n=document.createElement("br"),a=e[t].elements[r-1].node;a.parentElement.insertBefore(n,a.nextSibling)}}}(A),e.mra=null),e.lp&&(function(e,t,r){for(var n in e){var a=e[n].elements.length,i=e[n].elements[e[n].start_elem],s=e[n].elements[e[n].end_elem],o=Math.ceil(t)+"px",u="-"+Math.ceil(t)+"px";0!==a&&("lr"===r.ipd?(i.node.style.borderLeftColor=i.bgcolor||"#00000000",i.node.style.borderLeftStyle="solid",i.node.style.borderLeftWidth=o,i.node.style.marginLeft=u):"rl"===r.ipd?(i.node.style.borderRightColor=i.bgcolor||"#00000000",i.node.style.borderRightStyle="solid",i.node.style.borderRightWidth=o,i.node.style.marginRight=u):"tb"===r.ipd&&(i.node.style.borderTopColor=i.bgcolor||"#00000000",i.node.style.borderTopStyle="solid",i.node.style.borderTopWidth=o,i.node.style.marginTop=u),"lr"===r.ipd?(s.node.style.borderRightColor=s.bgcolor||"#00000000",s.node.style.borderRightStyle="solid",s.node.style.borderRightWidth=o,s.node.style.marginRight=u):"rl"===r.ipd?(s.node.style.borderLeftColor=s.bgcolor||"#00000000",s.node.style.borderLeftStyle="solid",s.node.style.borderLeftWidth=o,s.node.style.marginLeft=u):"tb"===r.ipd&&(s.node.style.borderBottomColor=s.bgcolor||"#00000000",s.node.style.borderBottomStyle="solid",s.node.style.borderBottomWidth=o,s.node.style.marginBottom=u))}}(A,e.lp*e.h,e),e.lp=null),e.flg)){var R=i(h.getBoundingClientRect(),e);!function(e,t,r,n){for(var a=Math.sign(r-t),i=0;i<=e.length;i++){var s,o,u;if(s=0===i?t:i===e.length?r:(e[i].before+e[i-1].after)/2,i>0)for(var l=0;l<e[i-1].elements.length;l++)null!==e[i-1].elements[l].bgcolor&&a*((u=e[i-1].elements[l]).after-s)<0&&(o=Math.ceil(Math.abs(s-u.after))+"px",u.node.style.backgroundColor=u.bgcolor,"lr"===n.bpd?u.node.style.paddingRight=o:"rl"===n.bpd?u.node.style.paddingLeft=o:"tb"===n.bpd&&(u.node.style.paddingBottom=o));if(i<e.length)for(var c=0;c<e[i].elements.length;c++)null!==(u=e[i].elements[c]).bgcolor&&a*(u.before-s)>0&&(o=Math.ceil(Math.abs(u.before-s))+"px",u.node.style.backgroundColor=u.bgcolor,"lr"===n.bpd?u.node.style.paddingLeft=o:"rl"===n.bpd?u.node.style.paddingRight=o:"tb"===n.bpd&&(u.node.style.paddingTop=o))}}(A,R.before,R.after,e),e.flg=null}if("region"===o.kind&&(s(e,h,A),"tb"===e.bpd&&e.enableRollUp&&o.contents.length>0&&"after"===o.styleAttrs[r.byName.displayAlign.qname])){var I=new a(""===o.id?"_":o.id,A);if(e.currentISDState[I.id]=I,e.previousISDState&&I.id in e.previousISDState&&e.previousISDState[I.id].plist.length>0&&I.plist.length>1&&I.plist[I.plist.length-2].text===e.previousISDState[I.id].plist[e.previousISDState[I.id].plist.length-1].text){var C=l.firstElementChild,w=I.plist[I.plist.length-1].after-I.plist[I.plist.length-1].before;C.style.bottom="-"+w+"px",C.style.transition="transform 0.4s",C.style.position="relative",C.style.transform="translateY(-"+w+"px)"}}}else!function(e,t){if(e&&e.error&&e.error(t))throw t}(e.errorHandler,"Error processing ISD element kind: "+o.kind)}function a(e,t){this.id=e,this.plist=t}function i(e,t){var r={before:null,after:null,start:null,end:null};return"tb"===t.bpd?(r.before=e.top,r.after=e.bottom,"lr"===t.ipd?(r.start=e.left,r.end=e.right):(r.start=e.right,r.end=e.left)):"lr"===t.bpd?(r.before=e.left,r.after=e.right,r.start=e.top,r.end=e.bottom):"rl"===t.bpd&&(r.before=e.right,r.after=e.left,r.start=e.top,r.end=e.bottom),r}function s(e,t,r,n){var a,o,u,l,c=t.style.backgroundColor||n;if(0===t.childElementCount)if("span"===t.localName){var f=t.getBoundingClientRect();if(0===f.height||0===f.width)return;var d=i(f,e);if(0!==r.length&&(a=d.before,o=d.after,u=r[r.length-1].before,o<(l=r[r.length-1].after)&&a>u||l<=o&&u>=a)){var h=Math.sign(d.after-d.before),g=Math.sign(d.end-d.start);h*(d.before-r[r.length-1].before)<0&&(r[r.length-1].before=d.before),h*(d.after-r[r.length-1].after)>0&&(r[r.length-1].after=d.after),g*(d.start-r[r.length-1].start)<0&&(r[r.length-1].start=d.start,r[r.length-1].start_elem=r[r.length-1].elements.length),g*(d.end-r[r.length-1].end)>0&&(r[r.length-1].end=d.end,r[r.length-1].end_elem=r[r.length-1].elements.length)}else r.push({before:d.before,after:d.after,start:d.start,end:d.end,start_elem:0,end_elem:0,elements:[],text:"",br:!1});r[r.length-1].text+=t.textContent,r[r.length-1].elements.push({node:t,bgcolor:c,before:d.before,after:d.after})}else"br"===t.localName&&0!==r.length&&(r[r.length-1].br=!0);else for(var p=t.firstChild;p;)p.nodeType===Node.ELEMENT_NODE&&s(e,p,r,c),p=p.nextSibling}function o(e,t){this.qname=e,this.map=t}e.render=function(e,t,r,a,i,s,o,u,l){var c=a||t.clientHeight,f=i||t.clientWidth;if(null!==e.aspectRatio){var d=c*e.aspectRatio;d>f?c=Math.round(f/e.aspectRatio):f=d}var h=document.createElement("div");h.style.position="relative",h.style.width=f+"px",h.style.height=c+"px",h.style.margin="auto",h.style.top=0,h.style.bottom=0,h.style.left=0,h.style.right=0,h.style.zIndex=0;var g={h:c,w:f,regionH:null,regionW:null,imgResolver:r,displayForcedOnlyMode:s||!1,isd:e,errorHandler:o,previousISDState:u,enableRollUp:l||!1,currentISDState:{},flg:null,lp:null,mra:null,ipd:null,bpd:null};for(var p in t.appendChild(h),e.contents)n(g,h,e.contents[p]);return g.currentISDState};var u=[new o("http://www.w3.org/ns/ttml#styling backgroundColor",function(e,t,r,n){0!==n[3]&&(t.style.backgroundColor="rgba("+n[0].toString()+","+n[1].toString()+","+n[2].toString()+","+(n[3]/255).toString()+")")}),new o("http://www.w3.org/ns/ttml#styling color",function(e,t,r,n){t.style.color="rgba("+n[0].toString()+","+n[1].toString()+","+n[2].toString()+","+(n[3]/255).toString()+")"}),new o("http://www.w3.org/ns/ttml#styling direction",function(e,t,r,n){t.style.direction=n}),new o("http://www.w3.org/ns/ttml#styling display",function(e,t,r,n){}),new o("http://www.w3.org/ns/ttml#styling displayAlign",function(e,t,r,n){t.style.display="flex",t.style.flexDirection="column","before"===n?t.style.justifyContent="flex-start":"center"===n?t.style.justifyContent="center":"after"===n&&(t.style.justifyContent="flex-end")}),new o("http://www.w3.org/ns/ttml#styling extent",function(e,t,r,n){e.regionH=n.h*e.h,e.regionW=n.w*e.w;var a=0,i=0,s=r.styleAttrs["http://www.w3.org/ns/ttml#styling padding"];s&&(a=(s[0]+s[2])*e.h,i=(s[1]+s[3])*e.w),t.style.height=e.regionH-a+"px",t.style.width=e.regionW-i+"px"}),new o("http://www.w3.org/ns/ttml#styling fontFamily",function(e,t,r,n){var a=[];for(var i in n)"monospaceSerif"===n[i]?(a.push("Courier New"),a.push('"Liberation Mono"'),a.push("Courier"),a.push("monospace")):"proportionalSansSerif"===n[i]?(a.push("Arial"),a.push("Helvetica"),a.push('"Liberation Sans"'),a.push("sans-serif")):"monospace"===n[i]?a.push("monospace"):"sansSerif"===n[i]?a.push("sans-serif"):"serif"===n[i]?a.push("serif"):"monospaceSansSerif"===n[i]?(a.push("Consolas"),a.push("monospace")):"proportionalSerif"===n[i]?a.push("serif"):a.push(n[i]);t.style.fontFamily=a.join(",")}),new o("http://www.w3.org/ns/ttml#styling fontSize",function(e,t,r,n){t.style.fontSize=n*e.h+"px"}),new o("http://www.w3.org/ns/ttml#styling fontStyle",function(e,t,r,n){t.style.fontStyle=n}),new o("http://www.w3.org/ns/ttml#styling fontWeight",function(e,t,r,n){t.style.fontWeight=n}),new o("http://www.w3.org/ns/ttml#styling lineHeight",function(e,t,r,n){t.style.lineHeight="normal"===n?"normal":n*e.h+"px"}),new o("http://www.w3.org/ns/ttml#styling opacity",function(e,t,r,n){t.style.opacity=n}),new o("http://www.w3.org/ns/ttml#styling origin",function(e,t,r,n){t.style.top=n.h*e.h+"px",t.style.left=n.w*e.w+"px"}),new o("http://www.w3.org/ns/ttml#styling overflow",function(e,t,r,n){t.style.overflow=n}),new o("http://www.w3.org/ns/ttml#styling padding",function(e,t,r,n){var a=[];a[0]=n[0]*e.h+"px",a[1]=n[3]*e.w+"px",a[2]=n[2]*e.h+"px",a[3]=n[1]*e.w+"px",t.style.padding=a.join(" ")}),new o("http://www.w3.org/ns/ttml#styling showBackground",null),new o("http://www.w3.org/ns/ttml#styling textAlign",function(e,t,n,a){var i,s=n.styleAttrs[r.byName.direction.qname];i="start"===a?"rtl"===s?"right":"left":"end"===a?"rtl"===s?"left":"right":a,t.style.textAlign=i}),new o("http://www.w3.org/ns/ttml#styling textDecoration",function(e,t,r,n){t.style.textDecoration=n.join(" ").replace("lineThrough","line-through")}),new o("http://www.w3.org/ns/ttml#styling textOutline",function(e,t,r,n){t.style.textShadow="none"===n?"":"rgba("+n.color[0].toString()+","+n.color[1].toString()+","+n.color[2].toString()+","+(n.color[3]/255).toString()+") 0px 0px "+n.thickness*e.h+"px"}),new o("http://www.w3.org/ns/ttml#styling unicodeBidi",function(e,t,r,n){var a;a="bidiOverride"===n?"bidi-override":n,t.style.unicodeBidi=a}),new o("http://www.w3.org/ns/ttml#styling visibility",function(e,t,r,n){t.style.visibility=n}),new o("http://www.w3.org/ns/ttml#styling wrapOption",function(e,t,r,n){"wrap"===n?"preserve"===r.space?t.style.whiteSpace="pre-wrap":t.style.whiteSpace="normal":"preserve"===r.space?t.style.whiteSpace="pre":t.style.whiteSpace="noWrap"}),new o("http://www.w3.org/ns/ttml#styling writingMode",function(e,t,r,n){"lrtb"===n||"lr"===n||"rltb"===n||"rl"===n?t.style.writingMode="horizontal-tb":"tblr"===n?t.style.writingMode="vertical-lr":"tbrl"!==n&&"tb"!==n||(t.style.writingMode="vertical-rl")}),new o("http://www.w3.org/ns/ttml#styling zIndex",function(e,t,r,n){t.style.zIndex=n}),new o("http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt backgroundImage",function(e,t,r,n){if(null!==e.imgResolver&&null!==n){var a=document.createElement("img"),i=e.imgResolver(n,a);i&&(a.src=i),a.height=e.regionH,a.width=e.regionW,t.appendChild(a)}}),new o("http://www.w3.org/ns/ttml/profile/imsc1#styling forcedDisplay",function(e,t,r,n){e.displayForcedOnlyMode&&!1===n&&(t.style.visibility="hidden")})],l={};for(var c in u)l[u[c].qname]=u[c]}(t,"undefined"==typeof imscNames?r("./node_modules/imsc/src/main/js/names.js"):imscNames,"undefined"==typeof imscStyles?r("./node_modules/imsc/src/main/js/styles.js"):imscStyles)},"./node_modules/imsc/src/main/js/isd.js":function(e,t,r){!function(e,t,r){function n(e,t,s,l,c,f,d,h,g){if(t<d.begin||t>=d.end)return null;var p="regionID"in d&&""!==d.regionID?d.regionID:f;if(null!==c&&p!==s.id&&(!("contents"in d)||"contents"in d&&0===d.contents.length||""!==p))return null;var m=new o(d);for(var y in d.sets)t<d.sets[y].begin||t>=d.sets[y].end||(m.styleAttrs[d.sets[y].qname]=d.sets[y].value);var E,_={};for(var v in m.styleAttrs)if(_[v]=!0,v===r.byName.writingMode.qname&&!(r.byName.direction.qname in m.styleAttrs)){var T=m.styleAttrs[v];"lrtb"===T||"lr"===T?m.styleAttrs[r.byName.direction.qname]="ltr":"rltb"!==T&&"rl"!==T||(m.styleAttrs[r.byName.direction.qname]="rtl")}if(null!==c)for(var S in r.all){var b=r.all[S];if(b.qname===r.byName.textDecoration.qname){var A=c.styleAttrs[b.qname],R=m.styleAttrs[b.qname],I=[];void 0===R?I=A:-1===R.indexOf("none")?((-1===R.indexOf("noUnderline")&&-1!==A.indexOf("underline")||-1!==R.indexOf("underline"))&&I.push("underline"),(-1===R.indexOf("noLineThrough")&&-1!==A.indexOf("lineThrough")||-1!==R.indexOf("lineThrough"))&&I.push("lineThrough"),(-1===R.indexOf("noOverline")&&-1!==A.indexOf("overline")||-1!==R.indexOf("overline"))&&I.push("overline")):I.push("none"),m.styleAttrs[b.qname]=I}else b.inherit&&b.qname in c.styleAttrs&&!(b.qname in m.styleAttrs)&&(m.styleAttrs[b.qname]=c.styleAttrs[b.qname])}for(var C in r.all){var w=r.all[C];w.qname in m.styleAttrs||("region"===m.kind||!1===w.inherit&&null!==w.initial)&&(m.styleAttrs[w.qname]=w.parse(w.initial),_[w.qname]=!0)}for(var N in r.all){var D=r.all[N];if(D.qname in _&&null!==D.compute){var M=D.compute(e,c,m,m.styleAttrs[D.qname],g);null!==M?m.styleAttrs[D.qname]=M:u(h,"Style '"+D.qname+"' on element '"+m.kind+"' cannot be computed")}}if("none"===m.styleAttrs[r.byName.display.qname])return null;for(var O in null===c?E=null===l?[]:[l]:"contents"in d&&(E=d.contents),E){var P=n(e,t,s,l,m,p,E[O],h,g);null!==P&&m.contents.push(P.element)}for(var L in m.styleAttrs)-1===r.byQName[L].applies.indexOf(m.kind)&&delete m.styleAttrs[L];if("span"===m.kind&&m.text&&"default"===m.space){var F=m.text.replace(/\s+/g," ");m.text=F}if("p"===m.kind){var j=[];a(m,j);for(var x=0,k="after_br",B=0;;)if("after_br"===k)x>=j.length||"br"===j[x].kind?(k="before_br",B=x,x--):("preserve"!==j[x].space&&(j[x].text=j[x].text.replace(/^\s+/g,"")),j[x].text.length>0?(k="looking_br",x++):j.splice(x,1));else if("before_br"===k)if(x<0||"br"===j[x].kind){if(k="after_br",(x=B+1)>=j.length)break}else if("preserve"!==j[x].space&&(j[x].text=j[x].text.replace(/\s+$/g,"")),j[x].text.length>0){if(k="after_br",(x=B+1)>=j.length)break}else j.splice(x,1),x--;else x>=j.length||"br"===j[x].kind?(k="before_br",B=x,x--):x++;i(m)}return"div"===m.kind&&r.byName.backgroundImage.qname in m.styleAttrs||"br"===m.kind||"contents"in m&&m.contents.length>0||"span"===m.kind&&null!==m.text||"region"===m.kind&&"always"===m.styleAttrs[r.byName.showBackground.qname]?{region_id:p,element:m}:null}function a(e,t){if("contents"in e)for(var r in e.contents)a(e.contents[r],t);else t.push(e)}function i(e){if("br"===e.kind)return!1;if("text"in e)return 0===e.text.length;if("contents"in e){for(var t=e.contents.length;t--;)i(e.contents[t])&&e.contents.splice(t,1);return 0===e.contents.length}}function s(e){this.contents=[],this.aspectRatio=e.aspectRatio}function o(e){for(var t in this.kind=e.kind||"region",e.id&&(this.id=e.id),this.styleAttrs={},e.styleAttrs)this.styleAttrs[t]=e.styleAttrs[t];"text"in e?this.text=e.text:"br"!==e.kind&&(this.contents=[]),"space"in e&&(this.space=e.space)}function u(e,t){if(e&&e.error&&e.error(t))throw t}e.generateISD=function(e,t,r){var a=new s(e),i={};for(var o in e.head.layout.regions){var u=n(e,t,e.head.layout.regions[o],e.body,null,"",e.head.layout.regions[o],r,i);null!==u&&a.contents.push(u.element)}return a}}(t,"undefined"==typeof imscNames?r("./node_modules/imsc/src/main/js/names.js"):imscNames,"undefined"==typeof imscStyles?r("./node_modules/imsc/src/main/js/styles.js"):imscStyles)},"./node_modules/imsc/src/main/js/main.js":function(e,t,r){t.generateISD=r("./node_modules/imsc/src/main/js/isd.js").generateISD,t.fromXML=r("./node_modules/imsc/src/main/js/doc.js").fromXML,t.renderHTML=r("./node_modules/imsc/src/main/js/html.js").render},"./node_modules/imsc/src/main/js/names.js":function(e,t,r){!function(e){e.ns_tt="http://www.w3.org/ns/ttml",e.ns_tts="http://www.w3.org/ns/ttml#styling",e.ns_ttp="http://www.w3.org/ns/ttml#parameter",e.ns_xml="http://www.w3.org/XML/1998/namespace",e.ns_itts="http://www.w3.org/ns/ttml/profile/imsc1#styling",e.ns_ittp="http://www.w3.org/ns/ttml/profile/imsc1#parameter",e.ns_smpte="http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt",e.ns_ebutts="urn:ebu:tt:style"}(t)},"./node_modules/imsc/src/main/js/styles.js":function(e,t,r){!function(e,t,r){function n(e,t,r,n,a,i,s,o){this.name=t,this.ns=e,this.qname=e+" "+t,this.inherit=a,this.animatable=i,this.initial=r,this.applies=n,this.parse=s,this.compute=o}for(var a in e.all=[new n(t.ns_tts,"backgroundColor","transparent",["body","div","p","region","span"],!1,!0,r.parseColor,null),new n(t.ns_tts,"color","white",["span"],!0,!0,r.parseColor,null),new n(t.ns_tts,"direction","ltr",["p","span"],!0,!0,function(e){return e},null),new n(t.ns_tts,"display","auto",["body","div","p","region","span"],!1,!0,function(e){return e},null),new n(t.ns_tts,"displayAlign","before",["region"],!1,!0,function(e){return e},null),new n(t.ns_tts,"extent","auto",["tt","region"],!1,!0,function(e){if("auto"===e)return e;var t=e.split(" ");if(2!==t.length)return null;var n=r.parseLength(t[0]),a=r.parseLength(t[1]);return a&&n?{h:a,w:n}:null},function(e,t,r,n,a){var i,s;if("auto"===n)i=1;else if("%"===n.h.unit)i=n.h.value/100;else{if("px"!==n.h.unit)return null;i=n.h.value/e.pxDimensions.h}if("auto"===n)s=1;else if("%"===n.w.unit)s=n.w.value/100;else{if("px"!==n.w.unit)return null;s=n.w.value/e.pxDimensions.w}return{h:i,w:s}}),new n(t.ns_tts,"fontFamily","default",["span"],!0,!0,function(e){var t=e.split(","),r=[];for(var n in t)"'"!==t[n].charAt(0)&&'"'!==t[n].charAt(0)&&"default"===t[n]?r.push("monospaceSerif"):r.push(t[n]);return r},null),new n(t.ns_tts,"fontSize","1c",["span"],!0,!0,r.parseLength,function(t,r,n,a,i){var s;if("%"===a.unit)s=null!==r?r.styleAttrs[e.byName.fontSize.qname]*a.value/100:a.value/100/t.cellResolution.h;else if("em"===a.unit)s=null!==r?r.styleAttrs[e.byName.fontSize.qname]*a.value:a.value/t.cellResolution.h;else if("c"===a.unit)s=a.value/t.cellResolution.h;else{if("px"!==a.unit)return null;s=a.value/t.pxDimensions.h}return s}),new n(t.ns_tts,"fontStyle","normal",["span"],!0,!0,function(e){return e},null),new n(t.ns_tts,"fontWeight","normal",["span"],!0,!0,function(e){return e},null),new n(t.ns_tts,"lineHeight","normal",["p"],!0,!0,function(e){return"normal"===e?e:r.parseLength(e)},function(t,r,n,a,i){var s;if("normal"===a)s=a;else if("%"===a.unit)s=n.styleAttrs[e.byName.fontSize.qname]*a.value/100;else if("em"===a.unit)s=n.styleAttrs[e.byName.fontSize.qname]*a.value;else if("c"===a.unit)s=a.value/t.cellResolution.h;else{if("px"!==a.unit)return null;s=a.value/t.pxDimensions.h}return s}),new n(t.ns_tts,"opacity",1,["region"],!1,!0,parseFloat,null),new n(t.ns_tts,"origin","auto",["region"],!1,!0,function(e){if("auto"===e)return e;var t=e.split(" ");if(2!==t.length)return null;var n=r.parseLength(t[0]),a=r.parseLength(t[1]);return a&&n?{h:a,w:n}:null},function(e,t,r,n,a){var i,s;if("auto"===n)i=0;else if("%"===n.h.unit)i=n.h.value/100;else{if("px"!==n.h.unit)return null;i=n.h.value/e.pxDimensions.h}if("auto"===n)s=0;else if("%"===n.w.unit)s=n.w.value/100;else{if("px"!==n.w.unit)return null;s=n.w.value/e.pxDimensions.w}return{h:i,w:s}}),new n(t.ns_tts,"overflow","hidden",["region"],!1,!0,function(e){return e},null),new n(t.ns_tts,"padding","0px",["region"],!1,!0,function(e){var t=e.split(" ");if(t.length>4)return null;var n=[];for(var a in t){var i=r.parseLength(t[a]);if(!i)return null;n.push(i)}return n},function(t,r,n,a,i){var s;if(1===a.length)s=[a[0],a[0],a[0],a[0]];else if(2===a.length)s=[a[0],a[1],a[0],a[1]];else if(3===a.length)s=[a[0],a[1],a[2],a[1]];else{if(4!==a.length)return null;s=[a[0],a[1],a[2],a[3]]}var o=n.styleAttrs[e.byName.writingMode.qname];if("lrtb"===o||"lr"===o)s=[s[0],s[3],s[2],s[1]];else if("rltb"===o||"rl"===o)s=[s[0],s[1],s[2],s[3]];else if("tblr"===o)s=[s[3],s[0],s[1],s[2]];else{if("tbrl"!==o&&"tb"!==o)return null;s=[s[3],s[2],s[1],s[0]]}var u=[];for(var l in s)if(0===s[l].value)u[l]=0;else if("%"===s[l].unit)u[l]="0"===l||"2"===l?n.styleAttrs[e.byName.extent.qname].h*s[l].value/100:n.styleAttrs[e.byName.extent.qname].w*s[l].value/100;else if("em"===s[l].unit)u[l]=n.styleAttrs[e.byName.fontSize.qname]*s[l].value;else if("c"===s[l].unit)u[l]=s[l].value/t.cellResolution.h;else{if("px"!==s[l].unit)return null;u[l]="0"===l||"2"===l?s[l].value/t.pxDimensions.h:s[l].value/t.pxDimensions.w}return u}),new n(t.ns_tts,"showBackground","always",["region"],!1,!0,function(e){return e},null),new n(t.ns_tts,"textAlign","start",["p"],!0,!0,function(e){return e},function(e,t,r,n,a){return"left"===n?"start":"right"===n?"end":n}),new n(t.ns_tts,"textDecoration","none",["span"],!0,!0,function(e){return e.split(" ")},null),new n(t.ns_tts,"textOutline","none",["span"],!0,!0,function(e){if("none"===e)return e;var t={},n=e.split(" ");if(0===n.length||n.length>2)return null;var a=r.parseColor(n[0]);if(t.color=a,null!==a&&n.shift(),1!==n.length)return null;var i=r.parseLength(n[0]);return i?(t.thickness=i,t):null},function(t,r,n,a,i){if("none"===a)return a;var s={};if(null===a.color?s.color=n.styleAttrs[e.byName.color.qname]:s.color=a.color,"%"===a.thickness.unit)s.thickness=n.styleAttrs[e.byName.fontSize.qname]*a.thickness.value/100;else if("em"===a.thickness.unit)s.thickness=n.styleAttrs[e.byName.fontSize.qname]*a.thickness.value;else if("c"===a.thickness.unit)s.thickness=a.thickness.value/t.cellResolution.h;else{if("px"!==a.thickness.unit)return null;s.thickness=a.thickness.value/t.pxDimensions.h}return s}),new n(t.ns_tts,"unicodeBidi","normal",["span","p"],!1,!0,function(e){return e},null),new n(t.ns_tts,"visibility","visible",["body","div","p","region","span"],!0,!0,function(e){return e},null),new n(t.ns_tts,"wrapOption","wrap",["span"],!0,!0,function(e){return e},null),new n(t.ns_tts,"writingMode","lrtb",["region"],!1,!0,function(e){return e},null),new n(t.ns_tts,"zIndex","auto",["region"],!1,!0,function(e){var t;return"auto"===e?t=e:(t=parseInt(e),isNaN(t)&&(t=null)),t},null),new n(t.ns_ebutts,"linePadding","0c",["p"],!0,!1,r.parseLength,function(e,t,r,n,a){return"c"===n.unit?n.value/e.cellResolution.h:null}),new n(t.ns_ebutts,"multiRowAlign","auto",["p"],!0,!1,function(e){return e},null),new n(t.ns_smpte,"backgroundImage",null,["div"],!1,!1,function(e){return e},null),new n(t.ns_itts,"forcedDisplay","false",["body","div","p","region","span"],!0,!0,function(e){return"true"===e},null),new n(t.ns_itts,"fillLineGap","false",["p"],!0,!0,function(e){return"true"===e},null)],e.byQName={},e.all)e.byQName[e.all[a].qname]=e.all[a];for(var i in e.byName={},e.all)e.byName[e.all[i].name]=e.all[i]}(t,"undefined"==typeof imscNames?r("./node_modules/imsc/src/main/js/names.js"):imscNames,"undefined"==typeof imscUtils?r("./node_modules/imsc/src/main/js/utils.js"):imscUtils)},"./node_modules/imsc/src/main/js/utils.js":function(e,t,r){!function(e){var t=/#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})?/,r=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,n=/rgba\(\s*(\d+),\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,a={transparent:[0,0,0,0],black:[0,0,0,255],silver:[192,192,192,255],gray:[128,128,128,255],white:[255,255,255,255],maroon:[128,0,0,255],red:[255,0,0,255],purple:[128,0,128,255],fuchsia:[255,0,255,255],magenta:[255,0,255,255],green:[0,128,0,255],lime:[0,255,0,255],olive:[128,128,0,255],yellow:[255,255,0,255],navy:[0,0,128,255],blue:[0,0,255,255],teal:[0,128,128,255],aqua:[0,255,255,255],cyan:[0,255,255,255]};e.parseColor=function(e){var i,s=null,o=a[e.toLowerCase()];return void 0!==o?s=o:null!==(i=t.exec(e))?s=[parseInt(i[1],16),parseInt(i[2],16),parseInt(i[3],16),void 0!==i[4]?parseInt(i[4],16):255]:null!==(i=r.exec(e))?s=[parseInt(i[1]),parseInt(i[2]),parseInt(i[3]),255]:null!==(i=n.exec(e))&&(s=[parseInt(i[1]),parseInt(i[2]),parseInt(i[3]),parseInt(i[4])]),s};var i=/^((?:\+|\-)?\d*(?:\.\d+)?)(px|em|c|%)$/;e.parseLength=function(e){var t,r=null;return null!==(t=i.exec(e))&&(r={value:parseFloat(t[1]),unit:t[2]}),r}}(t)},"./node_modules/inherits/inherits_browser.js":function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},"./node_modules/isarray/index.js":function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},"./node_modules/node-libs-browser/node_modules/buffer/index.js":function(e,t,r){(function(e){var n=r("./node_modules/base64-js/index.js"),a=r("./node_modules/ieee754/index.js"),i=r("./node_modules/isarray/index.js");function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(e,t){if(s()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,r){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return f(this,e)}return l(this,e,t,r)}function l(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n),u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=d(e,t),e}(e,t,r,n):"string"==typeof t?function(e,t,r){if("string"==typeof r&&""!==r||(r="utf8"),!u.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|g(t,r),a=(e=o(e,n)).write(t,r);return a!==n&&(e=e.slice(0,a)),e}(e,t,r):function(e,t){if(u.isBuffer(t)){var r=0|h(t.length);return 0===(e=o(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?o(e,0):d(e,t);if("Buffer"===t.type&&i(t.data))return d(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function f(e,t){if(c(t),e=o(e,t<0?0:0|h(t)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function d(e,t){var r=t.length<0?0:0|h(t.length);e=o(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function h(e){if(e>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function g(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(e).length;default:if(n)return G(e).length;t=(""+t).toLowerCase(),n=!0}}function p(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return D(this,t,r);case"utf8":case"utf-8":return I(this,t,r);case"ascii":return w(this,t,r);case"latin1":case"binary":return N(this,t,r);case"base64":return R(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function m(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,a){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=a?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(a)return-1;r=e.length-1}else if(r<0){if(!a)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:E(e,t,r,n,a);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):E(e,[t],r,n,a);throw new TypeError("val must be string, number or Buffer")}function E(e,t,r,n,a){var i,s=1,o=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,o/=2,u/=2,r/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(a){var c=-1;for(i=r;i<o;i++)if(l(e,i)===l(t,-1===c?0:i-c)){if(-1===c&&(c=i),i-c+1===u)return c*s}else-1!==c&&(i-=i-c),c=-1}else for(r+u>o&&(r=o-u),i=r;i>=0;i--){for(var f=!0,d=0;d<u;d++)if(l(e,i+d)!==l(t,d)){f=!1;break}if(f)return i}return-1}function _(e,t,r,n){r=Number(r)||0;var a=e.length-r;n?(n=Number(n))>a&&(n=a):n=a;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var s=0;s<n;++s){var o=parseInt(t.substr(2*s,2),16);if(isNaN(o))return s;e[r+s]=o}return s}function v(e,t,r,n){return q(G(t,e.length-r),e,r,n)}function T(e,t,r,n){return q(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function S(e,t,r,n){return T(e,t,r,n)}function b(e,t,r,n){return q(H(t),e,r,n)}function A(e,t,r,n){return q(function(e,t){for(var r,n,a,i=[],s=0;s<e.length&&!((t-=2)<0);++s)n=(r=e.charCodeAt(s))>>8,a=r%256,i.push(a),i.push(n);return i}(t,e.length-r),e,r,n)}function R(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function I(e,t,r){r=Math.min(e.length,r);for(var n=[],a=t;a<r;){var i,s,o,u,l=e[a],c=null,f=l>239?4:l>223?3:l>191?2:1;if(a+f<=r)switch(f){case 1:l<128&&(c=l);break;case 2:128==(192&(i=e[a+1]))&&(u=(31&l)<<6|63&i)>127&&(c=u);break;case 3:i=e[a+1],s=e[a+2],128==(192&i)&&128==(192&s)&&(u=(15&l)<<12|(63&i)<<6|63&s)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:i=e[a+1],s=e[a+2],o=e[a+3],128==(192&i)&&128==(192&s)&&128==(192&o)&&(u=(15&l)<<18|(63&i)<<12|(63&s)<<6|63&o)>65535&&u<1114112&&(c=u)}null===c?(c=65533,f=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),a+=f}return function(e){var t=e.length;if(t<=C)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=C));return r}(n)}t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=s(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,r){return l(null,e,t,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,r){return function(e,t,r,n){return c(t),t<=0?o(e,t):void 0!==r?"string"==typeof n?o(e,t).fill(r,n):o(e,t).fill(r):o(e,t)}(null,e,t,r)},u.allocUnsafe=function(e){return f(null,e)},u.allocUnsafeSlow=function(e){return f(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,a=0,i=Math.min(r,n);a<i;++a)if(e[a]!==t[a]){r=e[a],n=t[a];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!i(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=u.allocUnsafe(t),a=0;for(r=0;r<e.length;++r){var s=e[r];if(!u.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,a),a+=s.length}return n},u.byteLength=g,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?I(this,0,e):p.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,r,n,a){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===a&&(a=this.length),t<0||r>e.length||n<0||a>this.length)throw new RangeError("out of range index");if(n>=a&&t>=r)return 0;if(n>=a)return-1;if(t>=r)return 1;if(this===e)return 0;for(var i=(a>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),o=Math.min(i,s),l=this.slice(n,a),c=e.slice(t,r),f=0;f<o;++f)if(l[f]!==c[f]){i=l[f],s=c[f];break}return i<s?-1:s<i?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return y(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return y(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var a=this.length-t;if((void 0===r||r>a)&&(r=a),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return _(this,e,t,r);case"utf8":case"utf-8":return v(this,e,t,r);case"ascii":return T(this,e,t,r);case"latin1":case"binary":return S(this,e,t,r);case"base64":return b(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var C=4096;function w(e,t,r){var n="";r=Math.min(e.length,r);for(var a=t;a<r;++a)n+=String.fromCharCode(127&e[a]);return n}function N(e,t,r){var n="";r=Math.min(e.length,r);for(var a=t;a<r;++a)n+=String.fromCharCode(e[a]);return n}function D(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var a="",i=t;i<r;++i)a+=U(e[i]);return a}function M(e,t,r){for(var n=e.slice(t,r),a="",i=0;i<n.length;i+=2)a+=String.fromCharCode(n[i]+256*n[i+1]);return a}function O(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function P(e,t,r,n,a,i){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>a||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function L(e,t,r,n){t<0&&(t=65535+t+1);for(var a=0,i=Math.min(e.length-r,2);a<i;++a)e[r+a]=(t&255<<8*(n?a:1-a))>>>8*(n?a:1-a)}function F(e,t,r,n){t<0&&(t=4294967295+t+1);for(var a=0,i=Math.min(e.length-r,4);a<i;++a)e[r+a]=t>>>8*(n?a:3-a)&255}function j(e,t,r,n,a,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function x(e,t,r,n,i){return i||j(e,0,r,4),a.write(e,t,r,n,23,4),r+4}function k(e,t,r,n,i){return i||j(e,0,r,8),a.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=u.prototype;else{var a=t-e;r=new u(a,void 0);for(var i=0;i<a;++i)r[i]=this[i+e]}return r},u.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||O(e,t,this.length);for(var n=this[e],a=1,i=0;++i<t&&(a*=256);)n+=this[e+i]*a;return n},u.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||O(e,t,this.length);for(var n=this[e+--t],a=1;t>0&&(a*=256);)n+=this[e+--t]*a;return n},u.prototype.readUInt8=function(e,t){return t||O(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||O(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||O(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||O(e,t,this.length);for(var n=this[e],a=1,i=0;++i<t&&(a*=256);)n+=this[e+i]*a;return n>=(a*=128)&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||O(e,t,this.length);for(var n=t,a=1,i=this[e+--n];n>0&&(a*=256);)i+=this[e+--n]*a;return i>=(a*=128)&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||O(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){t||O(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||O(e,4,this.length),a.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||O(e,4,this.length),a.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||O(e,8,this.length),a.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||O(e,8,this.length),a.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t|=0,r|=0,n||P(this,e,t,r,Math.pow(2,8*r)-1,0);var a=1,i=0;for(this[t]=255&e;++i<r&&(a*=256);)this[t+i]=e/a&255;return t+r},u.prototype.writeUIntBE=function(e,t,r,n){e=+e,t|=0,r|=0,n||P(this,e,t,r,Math.pow(2,8*r)-1,0);var a=r-1,i=1;for(this[t+a]=255&e;--a>=0&&(i*=256);)this[t+a]=e/i&255;return t+r},u.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):L(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):L(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):F(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):F(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var a=Math.pow(2,8*r-1);P(this,e,t,r,a-1,-a)}var i=0,s=1,o=0;for(this[t]=255&e;++i<r&&(s*=256);)e<0&&0===o&&0!==this[t+i-1]&&(o=1),this[t+i]=(e/s|0)-o&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var a=Math.pow(2,8*r-1);P(this,e,t,r,a-1,-a)}var i=r-1,s=1,o=0;for(this[t+i]=255&e;--i>=0&&(s*=256);)e<0&&0===o&&0!==this[t+i+1]&&(o=1),this[t+i]=(e/s|0)-o&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):L(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):L(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):F(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):F(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,r){return x(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return x(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return k(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return k(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var a,i=n-r;if(this===e&&r<t&&t<n)for(a=i-1;a>=0;--a)e[a+t]=this[a+r];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(a=0;a<i;++a)e[a+t]=this[a+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+i),t);return i},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var a=e.charCodeAt(0);a<256&&(e=a)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{var s=u.isBuffer(e)?e:G(new u(e,n).toString()),o=s.length;for(i=0;i<r-t;++i)this[i+t]=s[i%o]}return this};var B=/[^+\/0-9A-Za-z-_]/g;function U(e){return e<16?"0"+e.toString(16):e.toString(16)}function G(e,t){var r;t=t||1/0;for(var n=e.length,a=null,i=[],s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!a){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&i.push(239,191,189);continue}a=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),a=r;continue}r=65536+(a-55296<<10|r-56320)}else a&&(t-=3)>-1&&i.push(239,191,189);if(a=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function H(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(B,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function q(e,t,r,n){for(var a=0;a<n&&!(a+r>=t.length||a>=e.length);++a)t[a+r]=e[a];return a}}).call(this,r("./node_modules/webpack/buildin/global.js"))},"./node_modules/node-libs-browser/node_modules/events/events.js":function(e,t,r){var n,a="object"==typeof Reflect?Reflect:null,i=a&&"function"==typeof a.apply?a.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};n=a&&"function"==typeof a.ownKeys?a.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise(function(r,n){function a(r){e.removeListener(t,i),n(r)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",a),r([].slice.call(arguments))}y(e,t,i,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&y(e,"error",t,{once:!0})}(e,a)})},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var u=10;function l(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function f(e,t,r,n){var a,i,s,o;if(l(r),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),i=e._events),s=i[t]),void 0===s)s=i[t]=r,++e._eventsCount;else if("function"==typeof s?s=i[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(a=c(e))>0&&s.length>a&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,o=u,console&&console.warn&&console.warn(o)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},a=d.bind(n);return a.listener=r,n.wrapFn=a,a}function g(e,t,r){var n=e._events;if(void 0===n)return[];var a=n[t];return void 0===a?[]:"function"==typeof a?r?[a.listener||a]:[a]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(a):m(a,a.length)}function p(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function m(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function y(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function a(i){n.once&&e.removeEventListener(t,a),r(i)})}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");u=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return c(this)},o.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,a=this._events;if(void 0!==a)n=n&&void 0===a.error;else if(!n)return!1;if(n){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var u=a[e];if(void 0===u)return!1;if("function"==typeof u)i(u,this,t);else{var l=u.length,c=m(u,l);for(r=0;r<l;++r)i(c[r],this,t)}return!0},o.prototype.addListener=function(e,t){return f(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return f(this,e,t,!0)},o.prototype.once=function(e,t){return l(t),this.on(e,h(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,h(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,n,a,i,s;if(l(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(a=-1,i=r.length-1;i>=0;i--)if(r[i]===t||r[i].listener===t){s=r[i].listener,a=i;break}if(a<0)return this;0===a?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,a),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var a,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(a=i[n])&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return g(this,e,!0)},o.prototype.rawListeners=function(e){return g(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},"./node_modules/node-libs-browser/node_modules/timers-browserify/main.js":function(e,t,r){(function(e){var n=void 0!==e&&e||"undefined"!=typeof self&&self||window,a=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(a.call(setTimeout,n,arguments),clearTimeout)},t.setInterval=function(){return new i(a.call(setInterval,n,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(n,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},r("./node_modules/setimmediate/setImmediate.js"),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r("./node_modules/webpack/buildin/global.js"))},"./node_modules/path-browserify/index.js":function(e,t,r){(function(e){function r(e,t){for(var r=0,n=e.length-1;n>=0;n--){var a=e[n];"."===a?e.splice(n,1):".."===a?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function n(e,t){if(e.filter)return e.filter(t);for(var r=[],n=0;n<e.length;n++)t(e[n],n,e)&&r.push(e[n]);return r}t.resolve=function(){for(var t="",a=!1,i=arguments.length-1;i>=-1&&!a;i--){var s=i>=0?arguments[i]:e.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(t=s+"/"+t,a="/"===s.charAt(0))}return(a?"/":"")+(t=r(n(t.split("/"),function(e){return!!e}),!a).join("/"))||"."},t.normalize=function(e){var i=t.isAbsolute(e),s="/"===a(e,-1);return(e=r(n(e.split("/"),function(e){return!!e}),!i).join("/"))||i||(e="."),e&&s&&(e+="/"),(i?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(n(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},t.relative=function(e,r){function n(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=t.resolve(e).substr(1),r=t.resolve(r).substr(1);for(var a=n(e.split("/")),i=n(r.split("/")),s=Math.min(a.length,i.length),o=s,u=0;u<s;u++)if(a[u]!==i[u]){o=u;break}var l=[];for(u=o;u<a.length;u++)l.push("..");return(l=l.concat(i.slice(o))).join("/")},t.sep="/",t.delimiter=":",t.dirname=function(e){if("string"!=typeof e&&(e+=""),0===e.length)return".";for(var t=e.charCodeAt(0),r=47===t,n=-1,a=!0,i=e.length-1;i>=1;--i)if(47===(t=e.charCodeAt(i))){if(!a){n=i;break}}else a=!1;return-1===n?r?"/":".":r&&1===n?"/":e.slice(0,n)},t.basename=function(e,t){var r=function(e){"string"!=typeof e&&(e+="");var t,r=0,n=-1,a=!0;for(t=e.length-1;t>=0;--t)if(47===e.charCodeAt(t)){if(!a){r=t+1;break}}else-1===n&&(a=!1,n=t+1);return-1===n?"":e.slice(r,n)}(e);return t&&r.substr(-1*t.length)===t&&(r=r.substr(0,r.length-t.length)),r},t.extname=function(e){"string"!=typeof e&&(e+="");for(var t=-1,r=0,n=-1,a=!0,i=0,s=e.length-1;s>=0;--s){var o=e.charCodeAt(s);if(47!==o)-1===n&&(a=!1,n=s+1),46===o?-1===t?t=s:1!==i&&(i=1):-1!==t&&(i=-1);else if(!a){r=s+1;break}}return-1===t||-1===n||0===i||1===i&&t===n-1&&t===r+1?"":e.slice(t,n)};var a=function(e,t,r){return e.substr(t,r)}}).call(this,r("./node_modules/process/browser.js"))},"./node_modules/process-nextick-args/index.js":function(e,t,r){(function(t){!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,r,n,a){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var i,s,o=arguments.length;switch(o){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick(function(){e.call(null,r)});case 3:return t.nextTick(function(){e.call(null,r,n)});case 4:return t.nextTick(function(){e.call(null,r,n,a)});default:for(i=new Array(o-1),s=0;s<i.length;)i[s++]=arguments[s];return t.nextTick(function(){e.apply(null,i)})}}}:e.exports=t}).call(this,r("./node_modules/process/browser.js"))},"./node_modules/process/browser.js":function(e,t){var r,n,a=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function o(e){if(r===setTimeout)return setTimeout(e,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(e){r=i}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(e){n=s}}();var u,l=[],c=!1,f=-1;function d(){c&&u&&(c=!1,u.length?l=u.concat(l):f=-1,l.length&&h())}function h(){if(!c){var e=o(d);c=!0;for(var t=l.length;t;){for(u=l,l=[];++f<t;)u&&u[f].run();f=-1,t=l.length}u=null,c=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{return n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function g(e,t){this.fun=e,this.array=t}function p(){}a.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new g(e,t)),1!==l.length||c||o(h)},g.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=p,a.addListener=p,a.once=p,a.off=p,a.removeListener=p,a.removeAllListeners=p,a.emit=p,a.prependListener=p,a.prependOnceListener=p,a.listeners=function(e){return[]},a.binding=function(e){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(e){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},"./node_modules/readable-stream/duplex-browser.js":function(e,t,r){e.exports=r("./node_modules/readable-stream/lib/_stream_duplex.js")},"./node_modules/readable-stream/lib/_stream_duplex.js":function(e,t,r){var n=r("./node_modules/process-nextick-args/index.js"),a=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=f;var i=r("./node_modules/core-util-is/lib/util.js");i.inherits=r("./node_modules/inherits/inherits_browser.js");var s=r("./node_modules/readable-stream/lib/_stream_readable.js"),o=r("./node_modules/readable-stream/lib/_stream_writable.js");i.inherits(f,s);for(var u=a(o.prototype),l=0;l<u.length;l++){var c=u[l];f.prototype[c]||(f.prototype[c]=o.prototype[c])}function f(e){if(!(this instanceof f))return new f(e);s.call(this,e),o.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",d)}function d(){this.allowHalfOpen||this._writableState.ended||n.nextTick(h,this)}function h(e){e.end()}Object.defineProperty(f.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(f.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),f.prototype._destroy=function(e,t){this.push(null),this.end(),n.nextTick(t,e)}},"./node_modules/readable-stream/lib/_stream_passthrough.js":function(e,t,r){e.exports=i;var n=r("./node_modules/readable-stream/lib/_stream_transform.js"),a=r("./node_modules/core-util-is/lib/util.js");function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}a.inherits=r("./node_modules/inherits/inherits_browser.js"),a.inherits(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},"./node_modules/readable-stream/lib/_stream_readable.js":function(e,t,r){(function(t,n){var a=r("./node_modules/process-nextick-args/index.js");e.exports=_;var i,s=r("./node_modules/isarray/index.js");_.ReadableState=E,r("./node_modules/node-libs-browser/node_modules/events/events.js").EventEmitter;var o=function(e,t){return e.listeners(t).length},u=r("./node_modules/readable-stream/lib/internal/streams/stream-browser.js"),l=r("./node_modules/safe-buffer/index.js").Buffer,c=t.Uint8Array||function(){},f=r("./node_modules/core-util-is/lib/util.js");f.inherits=r("./node_modules/inherits/inherits_browser.js");var d=r(0),h=void 0;h=d&&d.debuglog?d.debuglog("stream"):function(){};var g,p=r("./node_modules/readable-stream/lib/internal/streams/BufferList.js"),m=r("./node_modules/readable-stream/lib/internal/streams/destroy.js");f.inherits(_,u);var y=["error","close","destroy","pause","resume"];function E(e,t){e=e||{};var n=t instanceof(i=i||r("./node_modules/readable-stream/lib/_stream_duplex.js"));this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var a=e.highWaterMark,s=e.readableHighWaterMark,o=this.objectMode?16:16384;this.highWaterMark=a||0===a?a:n&&(s||0===s)?s:o,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(g||(g=r("./node_modules/string_decoder/lib/string_decoder.js").StringDecoder),this.decoder=new g(e.encoding),this.encoding=e.encoding)}function _(e){if(i=i||r("./node_modules/readable-stream/lib/_stream_duplex.js"),!(this instanceof _))return new _(e);this._readableState=new E(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),u.call(this)}function v(e,t,r,n,a){var i,s=e._readableState;return null===t?(s.reading=!1,function(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,A(e)}}(e,s)):(a||(i=function(e,t){var r,n;return n=t,l.isBuffer(n)||n instanceof c||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}(s,t)),i?e.emit("error",i):s.objectMode||t&&t.length>0?("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===l.prototype||(t=function(e){return l.from(e)}(t)),n?s.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):T(e,s,t,!0):s.ended?e.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||0!==t.length?T(e,s,t,!1):I(e,s)):T(e,s,t,!1))):n||(s.reading=!1)),function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(s)}function T(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&A(e)),I(e,t)}Object.defineProperty(_.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),_.prototype.destroy=m.destroy,_.prototype._undestroy=m.undestroy,_.prototype._destroy=function(e,t){this.push(null),t(e)},_.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=l.from(e,t),t=""),r=!0),v(this,e,t,!1,r)},_.prototype.unshift=function(e){return v(this,e,null,!0,!1)},_.prototype.isPaused=function(){return!1===this._readableState.flowing},_.prototype.setEncoding=function(e){return g||(g=r("./node_modules/string_decoder/lib/string_decoder.js").StringDecoder),this._readableState.decoder=new g(e),this._readableState.encoding=e,this};var S=8388608;function b(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=S?e=S:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function A(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?a.nextTick(R,e):R(e))}function R(e){h("emit readable"),e.emit("readable"),D(e)}function I(e,t){t.readingMore||(t.readingMore=!0,a.nextTick(C,e,t))}function C(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(h("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function w(e){h("readable nexttick read 0"),e.read(0)}function N(e,t){t.reading||(h("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),D(e),t.flowing&&!t.reading&&e.read(0)}function D(e){var t=e._readableState;for(h("flow",t.flowing);t.flowing&&null!==e.read(););}function M(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;return e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):n=e===t.head.data.length?t.shift():r?function(e,t){var r=t.head,n=1,a=r.data;for(e-=a.length;r=r.next;){var i=r.data,s=e>i.length?i.length:e;if(s===i.length?a+=i:a+=i.slice(0,e),0===(e-=s)){s===i.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=i.slice(s));break}++n}return t.length-=n,a}(e,t):function(e,t){var r=l.allocUnsafe(e),n=t.head,a=1;for(n.data.copy(r),e-=n.data.length;n=n.next;){var i=n.data,s=e>i.length?i.length:e;if(i.copy(r,r.length-e,0,s),0===(e-=s)){s===i.length?(++a,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=i.slice(s));break}++a}return t.length-=a,r}(e,t),n}(e,t.buffer,t.decoder),r);var r}function O(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,a.nextTick(P,t,e))}function P(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function L(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}_.prototype.read=function(e){h("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?O(this):A(this),null;if(0===(e=b(e,t))&&t.ended)return 0===t.length&&O(this),null;var n,a=t.needReadable;return h("need readable",a),(0===t.length||t.length-e<t.highWaterMark)&&h("length less than watermark",a=!0),t.ended||t.reading?h("reading or ended",a=!1):a&&(h("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=b(r,t))),null===(n=e>0?M(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&O(this)),null!==n&&this.emit("data",n),n},_.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},_.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,h("pipe count=%d opts=%j",i.pipesCount,t);var u=t&&!1===t.end||e===n.stdout||e===n.stderr?E:l;function l(){h("onend"),e.end()}i.endEmitted?a.nextTick(u):r.once("end",u),e.on("unpipe",function t(n,a){h("onunpipe"),n===r&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,h("cleanup"),e.removeListener("close",m),e.removeListener("finish",y),e.removeListener("drain",c),e.removeListener("error",p),e.removeListener("unpipe",t),r.removeListener("end",l),r.removeListener("end",E),r.removeListener("data",g),f=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||c())});var c=function(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,D(e))}}(r);e.on("drain",c);var f=!1,d=!1;function g(t){h("ondata"),d=!1,!1!==e.write(t)||d||((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==L(i.pipes,e))&&!f&&(h("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,d=!0),r.pause())}function p(t){h("onerror",t),E(),e.removeListener("error",p),0===o(e,"error")&&e.emit("error",t)}function m(){e.removeListener("finish",y),E()}function y(){h("onfinish"),e.removeListener("close",m),E()}function E(){h("unpipe"),r.unpipe(e)}return r.on("data",g),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?s(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",p),e.once("close",m),e.once("finish",y),e.emit("pipe",r),i.flowing||(h("pipe resume"),r.resume()),e},_.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,a=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<a;i++)n[i].emit("unpipe",this,r);return this}var s=L(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},_.prototype.on=function(e,t){var r=u.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var n=this._readableState;n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&A(this):a.nextTick(w,this))}return r},_.prototype.addListener=_.prototype.on,_.prototype.resume=function(){var e=this._readableState;return e.flowing||(h("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,a.nextTick(N,e,t))}(this,e)),this},_.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this},_.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var a in e.on("end",function(){if(h("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(a){h("wrapped data"),r.decoder&&(a=r.decoder.write(a)),r.objectMode&&null==a||(r.objectMode||a&&a.length)&&(t.push(a)||(n=!0,e.pause()))}),e)void 0===this[a]&&"function"==typeof e[a]&&(this[a]=function(t){return function(){return e[t].apply(e,arguments)}}(a));for(var i=0;i<y.length;i++)e.on(y[i],this.emit.bind(this,y[i]));return this._read=function(t){h("wrapped _read",t),n&&(n=!1,e.resume())},this},Object.defineProperty(_.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),_._fromList=M}).call(this,r("./node_modules/webpack/buildin/global.js"),r("./node_modules/process/browser.js"))},"./node_modules/readable-stream/lib/_stream_transform.js":function(e,t,r){e.exports=s;var n=r("./node_modules/readable-stream/lib/_stream_duplex.js"),a=r("./node_modules/core-util-is/lib/util.js");function i(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var a=this._readableState;a.reading=!1,(a.needReadable||a.length<a.highWaterMark)&&this._read(a.highWaterMark)}function s(e){if(!(this instanceof s))return new s(e);n.call(this,e),this._transformState={afterTransform:i.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",o)}function o(){var e=this;"function"==typeof this._flush?this._flush(function(t,r){u(e,t,r)}):u(this,null,null)}function u(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}a.inherits=r("./node_modules/inherits/inherits_browser.js"),a.inherits(s,n),s.prototype.push=function(e,t){return this._transformState.needTransform=!1,n.prototype.push.call(this,e,t)},s.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")},s.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var a=this._readableState;(n.needTransform||a.needReadable||a.length<a.highWaterMark)&&this._read(a.highWaterMark)}},s.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},s.prototype._destroy=function(e,t){var r=this;n.prototype._destroy.call(this,e,function(e){t(e),r.emit("close")})}},"./node_modules/readable-stream/lib/_stream_writable.js":function(e,t,r){(function(t,n,a){var i=r("./node_modules/process-nextick-args/index.js");function s(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t){var r=e.entry;for(e.entry=null;r;){var n=r.callback;t.pendingcb--,n(undefined),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=E;var o,u=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?n:i.nextTick;E.WritableState=y;var l=r("./node_modules/core-util-is/lib/util.js");l.inherits=r("./node_modules/inherits/inherits_browser.js");var c,f={deprecate:r("./node_modules/util-deprecate/browser.js")},d=r("./node_modules/readable-stream/lib/internal/streams/stream-browser.js"),h=r("./node_modules/safe-buffer/index.js").Buffer,g=a.Uint8Array||function(){},p=r("./node_modules/readable-stream/lib/internal/streams/destroy.js");function m(){}function y(e,t){o=o||r("./node_modules/readable-stream/lib/_stream_duplex.js"),e=e||{};var n=t instanceof o;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var a=e.highWaterMark,l=e.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=a||0===a?a:n&&(l||0===l)?l:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var f=!1===e.decodeStrings;this.decodeStrings=!f,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,a=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,a){--t.pendingcb,r?(i.nextTick(a,n),i.nextTick(A,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(a(n),e._writableState.errorEmitted=!0,e.emit("error",n),A(e,t))}(e,r,n,t,a);else{var s=S(r);s||r.corked||r.bufferProcessing||!r.bufferedRequest||T(e,r),n?u(v,e,r,s,a):v(e,r,s,a)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}function E(e){if(o=o||r("./node_modules/readable-stream/lib/_stream_duplex.js"),!(c.call(E,this)||this instanceof o))return new E(e);this._writableState=new y(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),d.call(this)}function _(e,t,r,n,a,i,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,r?e._writev(a,t.onwrite):e._write(a,i,t.onwrite),t.sync=!1}function v(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),A(e,t)}function T(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,a=new Array(n),i=t.corkedRequestsFree;i.entry=r;for(var o=0,u=!0;r;)a[o]=r,r.isBuf||(u=!1),r=r.next,o+=1;a.allBuffers=u,_(e,t,!0,t.length,a,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new s(t),t.bufferedRequestCount=0}else{for(;r;){var l=r.chunk,c=r.encoding,f=r.callback;if(_(e,t,!1,t.objectMode?1:l.length,l,c,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function S(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function b(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),A(e,t)})}function A(e,t){var r=S(t);return r&&(function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,i.nextTick(b,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}l.inherits(E,d),y.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(y.prototype,"buffer",{get:f.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(c=Function.prototype[Symbol.hasInstance],Object.defineProperty(E,Symbol.hasInstance,{value:function(e){return!!c.call(this,e)||this===E&&e&&e._writableState instanceof y}})):c=function(e){return e instanceof this},E.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},E.prototype.write=function(e,t,r){var n,a=this._writableState,s=!1,o=!a.objectMode&&(n=e,h.isBuffer(n)||n instanceof g);return o&&!h.isBuffer(e)&&(e=function(e){return h.from(e)}(e)),"function"==typeof t&&(r=t,t=null),o?t="buffer":t||(t=a.defaultEncoding),"function"!=typeof r&&(r=m),a.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),i.nextTick(t,r)}(this,r):(o||function(e,t,r,n){var a=!0,s=!1;return null===r?s=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),s&&(e.emit("error",s),i.nextTick(n,s),a=!1),a}(this,a,e,r))&&(a.pendingcb++,s=function(e,t,r,n,a,i){if(!r){var s=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=h.from(t,r)),t}(t,n,a);n!==s&&(r=!0,a="buffer",n=s)}var o=t.objectMode?1:n.length;t.length+=o;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:a,isBuf:r,callback:i,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else _(e,t,!1,o,n,a,i);return u}(this,a,o,e,t,r)),s},E.prototype.cork=function(){this._writableState.corked++},E.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||T(this,e))},E.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(E.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),E.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},E.prototype._writev=null,E.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,A(e,t),r&&(t.finished?i.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r)},Object.defineProperty(E.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),E.prototype.destroy=p.destroy,E.prototype._undestroy=p.undestroy,E.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,r("./node_modules/process/browser.js"),r("./node_modules/node-libs-browser/node_modules/timers-browserify/main.js").setImmediate,r("./node_modules/webpack/buildin/global.js"))},"./node_modules/readable-stream/lib/internal/streams/BufferList.js":function(e,t,r){var n=r("./node_modules/safe-buffer/index.js").Buffer,a=r(1);function i(e,t,r){e.copy(t,r)}e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var t=n.allocUnsafe(e>>>0),r=this.head,a=0;r;)i(r.data,t,a),a+=r.data.length,r=r.next;return t},e}(),a&&a.inspect&&a.inspect.custom&&(e.exports.prototype[a.inspect.custom]=function(){var e=a.inspect({length:this.length});return this.constructor.name+" "+e})},"./node_modules/readable-stream/lib/internal/streams/destroy.js":function(e,t,r){var n=r("./node_modules/process-nextick-args/index.js");function a(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return i||s?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||n.nextTick(a,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(n.nextTick(a,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},"./node_modules/readable-stream/lib/internal/streams/stream-browser.js":function(e,t,r){e.exports=r("./node_modules/node-libs-browser/node_modules/events/events.js").EventEmitter},"./node_modules/readable-stream/passthrough.js":function(e,t,r){e.exports=r("./node_modules/readable-stream/readable-browser.js").PassThrough},"./node_modules/readable-stream/readable-browser.js":function(e,t,r){(t=e.exports=r("./node_modules/readable-stream/lib/_stream_readable.js")).Stream=t,t.Readable=t,t.Writable=r("./node_modules/readable-stream/lib/_stream_writable.js"),t.Duplex=r("./node_modules/readable-stream/lib/_stream_duplex.js"),t.Transform=r("./node_modules/readable-stream/lib/_stream_transform.js"),t.PassThrough=r("./node_modules/readable-stream/lib/_stream_passthrough.js")},"./node_modules/readable-stream/transform.js":function(e,t,r){e.exports=r("./node_modules/readable-stream/readable-browser.js").Transform},"./node_modules/readable-stream/writable-browser.js":function(e,t,r){e.exports=r("./node_modules/readable-stream/lib/_stream_writable.js")},"./node_modules/safe-buffer/index.js":function(e,t,r){var n=r("./node_modules/node-libs-browser/node_modules/buffer/index.js"),a=n.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return a(e,t,r)}a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?e.exports=n:(i(n,t),t.Buffer=s),i(a,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return a(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=a(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return a(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},"./node_modules/sax/lib/sax.js":function(e,t,r){(function(e){!function(t){t.parser=function(e,t){return new i(e,t)},t.SAXParser=i,t.SAXStream=o,t.createStream=function(e,t){return new o(e,t)},t.MAX_BUFFER_LENGTH=65536;var n,a=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];function i(e,r){if(!(this instanceof i))return new i(e,r);var n=this;!function(e){for(var t=0,r=a.length;t<r;t++)e[a[t]]=""}(n),n.q=n.c="",n.bufferCheckPosition=t.MAX_BUFFER_LENGTH,n.opt=r||{},n.opt.lowercase=n.opt.lowercase||n.opt.lowercasetags,n.looseCase=n.opt.lowercase?"toLowerCase":"toUpperCase",n.tags=[],n.closed=n.closedRoot=n.sawRoot=!1,n.tag=n.error=null,n.strict=!!e,n.noscript=!(!e&&!n.opt.noscript),n.state=w.BEGIN,n.strictEntities=n.opt.strictEntities,n.ENTITIES=n.strictEntities?Object.create(t.XML_ENTITIES):Object.create(t.ENTITIES),n.attribList=[],n.opt.xmlns&&(n.ns=Object.create(y)),n.trackPosition=!1!==n.opt.position,n.trackPosition&&(n.position=n.line=n.column=0),D(n,"onready")}t.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],Object.create||(Object.create=function(e){function t(){}return t.prototype=e,new t}),Object.keys||(Object.keys=function(e){var t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(r);return t}),i.prototype={end:function(){F(this)},write:function(e){var r=this;if(this.error)throw this.error;if(r.closed)return L(r,"Cannot write after close. Assign an onready handler.");if(null===e)return F(r);"object"==typeof e&&(e=e.toString());for(var n=0,i="";i=Y(e,n++),r.c=i,i;)switch(r.trackPosition&&(r.position++,"\n"===i?(r.line++,r.column=0):r.column++),r.state){case w.BEGIN:if(r.state=w.BEGIN_WHITESPACE,"\ufeff"===i)continue;q(r,i);continue;case w.BEGIN_WHITESPACE:q(r,i);continue;case w.TEXT:if(r.sawRoot&&!r.closedRoot){for(var s=n-1;i&&"<"!==i&&"&"!==i;)(i=Y(e,n++))&&r.trackPosition&&(r.position++,"\n"===i?(r.line++,r.column=0):r.column++);r.textNode+=e.substring(s,n-1)}"<"!==i||r.sawRoot&&r.closedRoot&&!r.strict?(!A(u,i)||r.sawRoot&&!r.closedRoot||j(r,"Text data outside of root node."),"&"===i?r.state=w.TEXT_ENTITY:r.textNode+=i):(r.state=w.OPEN_WAKA,r.startTagPosition=r.position);continue;case w.SCRIPT:"<"===i?r.state=w.SCRIPT_ENDING:r.script+=i;continue;case w.SCRIPT_ENDING:"/"===i?r.state=w.CLOSE_TAG:(r.script+="<"+i,r.state=w.SCRIPT);continue;case w.OPEN_WAKA:if("!"===i)r.state=w.SGML_DECL,r.sgmlDecl="";else if(b(u,i));else if(b(E,i))r.state=w.OPEN_TAG,r.tagName=i;else if("/"===i)r.state=w.CLOSE_TAG,r.tagName="";else if("?"===i)r.state=w.PROC_INST,r.procInstName=r.procInstBody="";else{if(j(r,"Unencoded <"),r.startTagPosition+1<r.position){var o=r.position-r.startTagPosition;i=new Array(o).join(" ")+i}r.textNode+="<"+i,r.state=w.TEXT}continue;case w.SGML_DECL:(r.sgmlDecl+i).toUpperCase()===h?(M(r,"onopencdata"),r.state=w.CDATA,r.sgmlDecl="",r.cdata=""):r.sgmlDecl+i==="--"?(r.state=w.COMMENT,r.comment="",r.sgmlDecl=""):(r.sgmlDecl+i).toUpperCase()===g?(r.state=w.DOCTYPE,(r.doctype||r.sawRoot)&&j(r,"Inappropriately located doctype declaration"),r.doctype="",r.sgmlDecl=""):">"===i?(M(r,"onsgmldeclaration",r.sgmlDecl),r.sgmlDecl="",r.state=w.TEXT):b(f,i)?(r.state=w.SGML_DECL_QUOTED,r.sgmlDecl+=i):r.sgmlDecl+=i;continue;case w.SGML_DECL_QUOTED:i===r.q&&(r.state=w.SGML_DECL,r.q=""),r.sgmlDecl+=i;continue;case w.DOCTYPE:">"===i?(r.state=w.TEXT,M(r,"ondoctype",r.doctype),r.doctype=!0):(r.doctype+=i,"["===i?r.state=w.DOCTYPE_DTD:b(f,i)&&(r.state=w.DOCTYPE_QUOTED,r.q=i));continue;case w.DOCTYPE_QUOTED:r.doctype+=i,i===r.q&&(r.q="",r.state=w.DOCTYPE);continue;case w.DOCTYPE_DTD:r.doctype+=i,"]"===i?r.state=w.DOCTYPE:b(f,i)&&(r.state=w.DOCTYPE_DTD_QUOTED,r.q=i);continue;case w.DOCTYPE_DTD_QUOTED:r.doctype+=i,i===r.q&&(r.state=w.DOCTYPE_DTD,r.q="");continue;case w.COMMENT:"-"===i?r.state=w.COMMENT_ENDING:r.comment+=i;continue;case w.COMMENT_ENDING:"-"===i?(r.state=w.COMMENT_ENDED,r.comment=P(r.opt,r.comment),r.comment&&M(r,"oncomment",r.comment),r.comment=""):(r.comment+="-"+i,r.state=w.COMMENT);continue;case w.COMMENT_ENDED:">"!==i?(j(r,"Malformed comment"),r.comment+="--"+i,r.state=w.COMMENT):r.state=w.TEXT;continue;case w.CDATA:"]"===i?r.state=w.CDATA_ENDING:r.cdata+=i;continue;case w.CDATA_ENDING:"]"===i?r.state=w.CDATA_ENDING_2:(r.cdata+="]"+i,r.state=w.CDATA);continue;case w.CDATA_ENDING_2:">"===i?(r.cdata&&M(r,"oncdata",r.cdata),M(r,"onclosecdata"),r.cdata="",r.state=w.TEXT):"]"===i?r.cdata+="]":(r.cdata+="]]"+i,r.state=w.CDATA);continue;case w.PROC_INST:"?"===i?r.state=w.PROC_INST_ENDING:b(u,i)?r.state=w.PROC_INST_BODY:r.procInstName+=i;continue;case w.PROC_INST_BODY:if(!r.procInstBody&&b(u,i))continue;"?"===i?r.state=w.PROC_INST_ENDING:r.procInstBody+=i;continue;case w.PROC_INST_ENDING:">"===i?(M(r,"onprocessinginstruction",{name:r.procInstName,body:r.procInstBody}),r.procInstName=r.procInstBody="",r.state=w.TEXT):(r.procInstBody+="?"+i,r.state=w.PROC_INST_BODY);continue;case w.OPEN_TAG:b(_,i)?r.tagName+=i:(x(r),">"===i?U(r):"/"===i?r.state=w.OPEN_TAG_SLASH:(A(u,i)&&j(r,"Invalid character in tag name"),r.state=w.ATTRIB));continue;case w.OPEN_TAG_SLASH:">"===i?(U(r,!0),G(r)):(j(r,"Forward-slash in opening tag not followed by >"),r.state=w.ATTRIB);continue;case w.ATTRIB:if(b(u,i))continue;">"===i?U(r):"/"===i?r.state=w.OPEN_TAG_SLASH:b(E,i)?(r.attribName=i,r.attribValue="",r.state=w.ATTRIB_NAME):j(r,"Invalid attribute name");continue;case w.ATTRIB_NAME:"="===i?r.state=w.ATTRIB_VALUE:">"===i?(j(r,"Attribute without value"),r.attribValue=r.attribName,B(r),U(r)):b(u,i)?r.state=w.ATTRIB_NAME_SAW_WHITE:b(_,i)?r.attribName+=i:j(r,"Invalid attribute name");continue;case w.ATTRIB_NAME_SAW_WHITE:if("="===i)r.state=w.ATTRIB_VALUE;else{if(b(u,i))continue;j(r,"Attribute without value"),r.tag.attributes[r.attribName]="",r.attribValue="",M(r,"onattribute",{name:r.attribName,value:""}),r.attribName="",">"===i?U(r):b(E,i)?(r.attribName=i,r.state=w.ATTRIB_NAME):(j(r,"Invalid attribute name"),r.state=w.ATTRIB)}continue;case w.ATTRIB_VALUE:if(b(u,i))continue;b(f,i)?(r.q=i,r.state=w.ATTRIB_VALUE_QUOTED):(j(r,"Unquoted attribute value"),r.state=w.ATTRIB_VALUE_UNQUOTED,r.attribValue=i);continue;case w.ATTRIB_VALUE_QUOTED:if(i!==r.q){"&"===i?r.state=w.ATTRIB_VALUE_ENTITY_Q:r.attribValue+=i;continue}B(r),r.q="",r.state=w.ATTRIB_VALUE_CLOSED;continue;case w.ATTRIB_VALUE_CLOSED:b(u,i)?r.state=w.ATTRIB:">"===i?U(r):"/"===i?r.state=w.OPEN_TAG_SLASH:b(E,i)?(j(r,"No whitespace between attributes"),r.attribName=i,r.attribValue="",r.state=w.ATTRIB_NAME):j(r,"Invalid attribute name");continue;case w.ATTRIB_VALUE_UNQUOTED:if(A(d,i)){"&"===i?r.state=w.ATTRIB_VALUE_ENTITY_U:r.attribValue+=i;continue}B(r),">"===i?U(r):r.state=w.ATTRIB;continue;case w.CLOSE_TAG:if(r.tagName)">"===i?G(r):b(_,i)?r.tagName+=i:r.script?(r.script+="</"+r.tagName,r.tagName="",r.state=w.SCRIPT):(A(u,i)&&j(r,"Invalid tagname in closing tag"),r.state=w.CLOSE_TAG_SAW_WHITE);else{if(b(u,i))continue;A(E,i)?r.script?(r.script+="</"+i,r.state=w.SCRIPT):j(r,"Invalid tagname in closing tag."):r.tagName=i}continue;case w.CLOSE_TAG_SAW_WHITE:if(b(u,i))continue;">"===i?G(r):j(r,"Invalid characters in closing tag");continue;case w.TEXT_ENTITY:case w.ATTRIB_VALUE_ENTITY_Q:case w.ATTRIB_VALUE_ENTITY_U:var l,c;switch(r.state){case w.TEXT_ENTITY:l=w.TEXT,c="textNode";break;case w.ATTRIB_VALUE_ENTITY_Q:l=w.ATTRIB_VALUE_QUOTED,c="attribValue";break;case w.ATTRIB_VALUE_ENTITY_U:l=w.ATTRIB_VALUE_UNQUOTED,c="attribValue"}";"===i?(r[c]+=H(r),r.entity="",r.state=l):b(r.entity.length?T:v,i)?r.entity+=i:(j(r,"Invalid character in entity name"),r[c]+="&"+r.entity+i,r.entity="",r.state=l);continue;default:throw new Error(r,"Unknown state: "+r.state)}return r.position>=r.bufferCheckPosition&&function(e){for(var r=Math.max(t.MAX_BUFFER_LENGTH,10),n=0,i=0,s=a.length;i<s;i++){var o=e[a[i]].length;if(o>r)switch(a[i]){case"textNode":O(e);break;case"cdata":M(e,"oncdata",e.cdata),e.cdata="";break;case"script":M(e,"onscript",e.script),e.script="";break;default:L(e,"Max buffer length exceeded: "+a[i])}n=Math.max(n,o)}var u=t.MAX_BUFFER_LENGTH-n;e.bufferCheckPosition=u+e.position}(r),r},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){var e;O(e=this),""!==e.cdata&&(M(e,"oncdata",e.cdata),e.cdata=""),""!==e.script&&(M(e,"onscript",e.script),e.script="")}};try{n=r("./node_modules/stream-browserify/index.js").Stream}catch(e){n=function(){}}var s=t.EVENTS.filter(function(e){return"error"!==e&&"end"!==e});function o(e,t){if(!(this instanceof o))return new o(e,t);n.apply(this),this._parser=new i(e,t),this.writable=!0,this.readable=!0;var r=this;this._parser.onend=function(){r.emit("end")},this._parser.onerror=function(e){r.emit("error",e),r._parser.error=null},this._decoder=null,s.forEach(function(e){Object.defineProperty(r,"on"+e,{get:function(){return r._parser["on"+e]},set:function(t){if(!t)return r.removeAllListeners(e),r._parser["on"+e]=t,t;r.on(e,t)},enumerable:!0,configurable:!1})})}o.prototype=Object.create(n.prototype,{constructor:{value:o}}),o.prototype.write=function(t){if("function"==typeof e&&"function"==typeof e.isBuffer&&e.isBuffer(t)){if(!this._decoder){var n=r("./node_modules/string_decoder/lib/string_decoder.js").StringDecoder;this._decoder=new n("utf8")}t=this._decoder.write(t)}return this._parser.write(t.toString()),this.emit("data",t),!0},o.prototype.end=function(e){return e&&e.length&&this.write(e),this._parser.end(),!0},o.prototype.on=function(e,t){var r=this;return r._parser["on"+e]||-1===s.indexOf(e)||(r._parser["on"+e]=function(){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),r.emit.apply(r,t)}),n.prototype.on.call(r,e,t)};var u="\r\n\t ",l="0124356789",c="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",f="'\"",d=u+">",h="[CDATA[",g="DOCTYPE",p="http://www.w3.org/XML/1998/namespace",m="http://www.w3.org/2000/xmlns/",y={xml:p,xmlns:m};u=S(u),l=S(l),c=S(c);var E=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,_=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/,v=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,T=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;function S(e){return e.split("").reduce(function(e,t){return e[t]=!0,e},{})}function b(e,t){return function(e){return"[object RegExp]"===Object.prototype.toString.call(e)}(e)?!!t.match(e):e[t]}function A(e,t){return!b(e,t)}f=S(f),d=S(d);var R,I,C,w=0;for(var N in t.STATE={BEGIN:w++,BEGIN_WHITESPACE:w++,TEXT:w++,TEXT_ENTITY:w++,OPEN_WAKA:w++,SGML_DECL:w++,SGML_DECL_QUOTED:w++,DOCTYPE:w++,DOCTYPE_QUOTED:w++,DOCTYPE_DTD:w++,DOCTYPE_DTD_QUOTED:w++,COMMENT_STARTING:w++,COMMENT:w++,COMMENT_ENDING:w++,COMMENT_ENDED:w++,CDATA:w++,CDATA_ENDING:w++,CDATA_ENDING_2:w++,PROC_INST:w++,PROC_INST_BODY:w++,PROC_INST_ENDING:w++,OPEN_TAG:w++,OPEN_TAG_SLASH:w++,ATTRIB:w++,ATTRIB_NAME:w++,ATTRIB_NAME_SAW_WHITE:w++,ATTRIB_VALUE:w++,ATTRIB_VALUE_QUOTED:w++,ATTRIB_VALUE_CLOSED:w++,ATTRIB_VALUE_UNQUOTED:w++,ATTRIB_VALUE_ENTITY_Q:w++,ATTRIB_VALUE_ENTITY_U:w++,CLOSE_TAG:w++,CLOSE_TAG_SAW_WHITE:w++,SCRIPT:w++,SCRIPT_ENDING:w++},t.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},t.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(t.ENTITIES).forEach(function(e){var r=t.ENTITIES[e],n="number"==typeof r?String.fromCharCode(r):r;t.ENTITIES[e]=n}),t.STATE)t.STATE[t.STATE[N]]=N;function D(e,t,r){e[t]&&e[t](r)}function M(e,t,r){e.textNode&&O(e),D(e,t,r)}function O(e){e.textNode=P(e.opt,e.textNode),e.textNode&&D(e,"ontext",e.textNode),e.textNode=""}function P(e,t){return e.trim&&(t=t.trim()),e.normalize&&(t=t.replace(/\s+/g," ")),t}function L(e,t){return O(e),e.trackPosition&&(t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c),t=new Error(t),e.error=t,D(e,"onerror",t),e}function F(e){return e.sawRoot&&!e.closedRoot&&j(e,"Unclosed root tag"),e.state!==w.BEGIN&&e.state!==w.BEGIN_WHITESPACE&&e.state!==w.TEXT&&L(e,"Unexpected end"),O(e),e.c="",e.closed=!0,D(e,"onend"),i.call(e,e.strict,e.opt),e}function j(e,t){if("object"!=typeof e||!(e instanceof i))throw new Error("bad call to strictFail");e.strict&&L(e,t)}function x(e){e.strict||(e.tagName=e.tagName[e.looseCase]());var t=e.tags[e.tags.length-1]||e,r=e.tag={name:e.tagName,attributes:{}};e.opt.xmlns&&(r.ns=t.ns),e.attribList.length=0,M(e,"onopentagstart",r)}function k(e,t){var r=e.indexOf(":")<0?["",e]:e.split(":"),n=r[0],a=r[1];return t&&"xmlns"===e&&(n="xmlns",a=""),{prefix:n,local:a}}function B(e){if(e.strict||(e.attribName=e.attribName[e.looseCase]()),-1!==e.attribList.indexOf(e.attribName)||e.tag.attributes.hasOwnProperty(e.attribName))e.attribName=e.attribValue="";else{if(e.opt.xmlns){var t=k(e.attribName,!0),r=t.prefix,n=t.local;if("xmlns"===r)if("xml"===n&&e.attribValue!==p)j(e,"xml: prefix must be bound to "+p+"\nActual: "+e.attribValue);else if("xmlns"===n&&e.attribValue!==m)j(e,"xmlns: prefix must be bound to "+m+"\nActual: "+e.attribValue);else{var a=e.tag,i=e.tags[e.tags.length-1]||e;a.ns===i.ns&&(a.ns=Object.create(i.ns)),a.ns[n]=e.attribValue}e.attribList.push([e.attribName,e.attribValue])}else e.tag.attributes[e.attribName]=e.attribValue,M(e,"onattribute",{name:e.attribName,value:e.attribValue});e.attribName=e.attribValue=""}}function U(e,t){if(e.opt.xmlns){var r=e.tag,n=k(e.tagName);r.prefix=n.prefix,r.local=n.local,r.uri=r.ns[n.prefix]||"",r.prefix&&!r.uri&&(j(e,"Unbound namespace prefix: "+JSON.stringify(e.tagName)),r.uri=n.prefix);var a=e.tags[e.tags.length-1]||e;r.ns&&a.ns!==r.ns&&Object.keys(r.ns).forEach(function(t){M(e,"onopennamespace",{prefix:t,uri:r.ns[t]})});for(var i=0,s=e.attribList.length;i<s;i++){var o=e.attribList[i],u=o[0],l=o[1],c=k(u,!0),f=c.prefix,d=c.local,h=""===f?"":r.ns[f]||"",g={name:u,value:l,prefix:f,local:d,uri:h};f&&"xmlns"!==f&&!h&&(j(e,"Unbound namespace prefix: "+JSON.stringify(f)),g.uri=f),e.tag.attributes[u]=g,M(e,"onattribute",g)}e.attribList.length=0}e.tag.isSelfClosing=!!t,e.sawRoot=!0,e.tags.push(e.tag),M(e,"onopentag",e.tag),t||(e.noscript||"script"!==e.tagName.toLowerCase()?e.state=w.TEXT:e.state=w.SCRIPT,e.tag=null,e.tagName=""),e.attribName=e.attribValue="",e.attribList.length=0}function G(e){if(!e.tagName)return j(e,"Weird empty close tag."),e.textNode+="</>",void(e.state=w.TEXT);if(e.script){if("script"!==e.tagName)return e.script+="</"+e.tagName+">",e.tagName="",void(e.state=w.SCRIPT);M(e,"onscript",e.script),e.script=""}var t=e.tags.length,r=e.tagName;e.strict||(r=r[e.looseCase]());for(var n=r;t--&&e.tags[t].name!==n;)j(e,"Unexpected close tag");if(t<0)return j(e,"Unmatched closing tag: "+e.tagName),e.textNode+="</"+e.tagName+">",void(e.state=w.TEXT);e.tagName=r;for(var a=e.tags.length;a-- >t;){var i=e.tag=e.tags.pop();e.tagName=e.tag.name,M(e,"onclosetag",e.tagName);var s={};for(var o in i.ns)s[o]=i.ns[o];var u=e.tags[e.tags.length-1]||e;e.opt.xmlns&&i.ns!==u.ns&&Object.keys(i.ns).forEach(function(t){var r=i.ns[t];M(e,"onclosenamespace",{prefix:t,uri:r})})}0===t&&(e.closedRoot=!0),e.tagName=e.attribValue=e.attribName="",e.attribList.length=0,e.state=w.TEXT}function H(e){var t,r=e.entity,n=r.toLowerCase(),a="";return e.ENTITIES[r]?e.ENTITIES[r]:e.ENTITIES[n]?e.ENTITIES[n]:("#"===(r=n).charAt(0)&&("x"===r.charAt(1)?(r=r.slice(2),a=(t=parseInt(r,16)).toString(16)):(r=r.slice(1),a=(t=parseInt(r,10)).toString(10))),r=r.replace(/^0+/,""),a.toLowerCase()!==r?(j(e,"Invalid character entity"),"&"+e.entity+";"):String.fromCodePoint(t))}function q(e,t){"<"===t?(e.state=w.OPEN_WAKA,e.startTagPosition=e.position):A(u,t)&&(j(e,"Non-whitespace before first tag."),e.textNode=t,e.state=w.TEXT)}function Y(e,t){var r="";return t<e.length&&(r=e.charAt(t)),r}w=t.STATE,String.fromCodePoint||(R=String.fromCharCode,I=Math.floor,C=function(){var e,t,r=[],n=-1,a=arguments.length;if(!a)return"";for(var i="";++n<a;){var s=Number(arguments[n]);if(!isFinite(s)||s<0||s>1114111||I(s)!==s)throw RangeError("Invalid code point: "+s);s<=65535?r.push(s):(e=55296+((s-=65536)>>10),t=s%1024+56320,r.push(e,t)),(n+1===a||r.length>16384)&&(i+=R.apply(null,r),r.length=0)}return i},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:C,configurable:!0,writable:!0}):String.fromCodePoint=C)}(t)}).call(this,r("./node_modules/node-libs-browser/node_modules/buffer/index.js").Buffer)},"./node_modules/setimmediate/setImmediate.js":function(e,t,r){(function(e,t){!function(e){if(!e.setImmediate){var r,n,a,i,s,o=1,u={},l=!1,c=e.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(e);f=f&&f.setTimeout?f:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick(function(){h(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?(i="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(i)&&h(+t.data.slice(i.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(i+t,"*")}):e.MessageChannel?((a=new MessageChannel).port1.onmessage=function(e){h(e.data)},r=function(e){a.port2.postMessage(e)}):c&&"onreadystatechange"in c.createElement("script")?(n=c.documentElement,r=function(e){var t=c.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,n.removeChild(t),t=null},n.appendChild(t)}):r=function(e){setTimeout(h,0,e)},f.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var a={callback:e,args:t};return u[o]=a,r(o),o++},f.clearImmediate=d}function d(e){delete u[e]}function h(e){if(l)setTimeout(h,0,e);else{var t=u[e];if(t){l=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(void 0,r)}}(t)}finally{d(e),l=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,r("./node_modules/webpack/buildin/global.js"),r("./node_modules/process/browser.js"))},"./node_modules/stream-browserify/index.js":function(e,t,r){e.exports=a;var n=r("./node_modules/node-libs-browser/node_modules/events/events.js").EventEmitter;function a(){n.call(this)}r("./node_modules/inherits/inherits_browser.js")(a,n),a.Readable=r("./node_modules/readable-stream/readable-browser.js"),a.Writable=r("./node_modules/readable-stream/writable-browser.js"),a.Duplex=r("./node_modules/readable-stream/duplex-browser.js"),a.Transform=r("./node_modules/readable-stream/transform.js"),a.PassThrough=r("./node_modules/readable-stream/passthrough.js"),a.Stream=a,a.prototype.pipe=function(e,t){var r=this;function a(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function i(){r.readable&&r.resume&&r.resume()}r.on("data",a),e.on("drain",i),e._isStdio||t&&!1===t.end||(r.on("end",o),r.on("close",u));var s=!1;function o(){s||(s=!0,e.end())}function u(){s||(s=!0,"function"==typeof e.destroy&&e.destroy())}function l(e){if(c(),0===n.listenerCount(this,"error"))throw e}function c(){r.removeListener("data",a),e.removeListener("drain",i),r.removeListener("end",o),r.removeListener("close",u),r.removeListener("error",l),e.removeListener("error",l),r.removeListener("end",c),r.removeListener("close",c),e.removeListener("close",c)}return r.on("error",l),e.on("error",l),r.on("end",c),r.on("close",c),e.on("close",c),e.emit("pipe",r),e}},"./node_modules/string_decoder/lib/string_decoder.js":function(e,t,r){var n=r("./node_modules/safe-buffer/index.js").Buffer,a=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===a||!a(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=l,t=4;break;case"utf8":this.fillLast=o,t=4;break;case"base64":this.text=c,this.end=f,t=3;break;default:return this.write=d,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function o(e){var t=this.lastTotal-this.lastNeed,r=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function c(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},i.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},i.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var a=s(t[n]);return a>=0?(a>0&&(e.lastNeed=a-1),a):--n<r||-2===a?0:(a=s(t[n]))>=0?(a>0&&(e.lastNeed=a-2),a):--n<r||-2===a?0:(a=s(t[n]))>=0?(a>0&&(2===a?a=0:e.lastNeed=a-3),a):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},"./node_modules/util-deprecate/browser.js":function(e,t,r){(function(t){function r(e){try{if(!t.localStorage)return!1}catch(e){return!1}var r=t.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}e.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this,r("./node_modules/webpack/buildin/global.js"))},"./node_modules/webpack/buildin/global.js":function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},"./src/core/Debug.js":function(e,t,r){r.r(t);var n=r("./src/core/EventBus.js"),a=r("./src/core/events/Events.js"),i=r("./src/core/FactoryMaker.js"),s=1,o=2,u=3,l=4,c=5;function f(e){e=e||{};var t,r,i,f,d=this.context,h=Object(n.default)(d).getInstance(),g=e.settings,p=[];function m(e){return e&&e.bind?e.bind(window.console):window.console.log.bind(window.console)}function y(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];S.apply(void 0,[s,this].concat(t))}function E(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];S.apply(void 0,[o,this].concat(t))}function _(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];S.apply(void 0,[u,this].concat(t))}function v(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];S.apply(void 0,[l,this].concat(t))}function T(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];S.apply(void 0,[c,this].concat(t))}function S(e,t){var n="",s=null;r&&(s=(new Date).getTime(),n+="["+(s-f)+"]"),i&&t&&t.getClassName&&(n+="["+t.getClassName()+"]",t.getType&&(n+="["+t.getType()+"]")),n.length>0&&(n+=" ");for(var o=arguments.length,u=new Array(o>2?o-2:0),l=2;l<o;l++)u[l-2]=arguments[l];Array.apply(null,u).forEach(function(e){n+=e+" "}),p[e]&&g.get().debug.logLevel>=e&&p[e](n),g&&g.get().debug.dispatchEvent&&h.trigger(a.default.LOG,{message:n,level:e})}return t={getLogger:function(e){return{fatal:y.bind(e),error:E.bind(e),warn:_.bind(e),info:v.bind(e),debug:T.bind(e)}},setLogTimestampVisible:function(e){r=e},setCalleeNameVisible:function(e){i=e}},r=!0,i=!0,f=(new Date).getTime(),"undefined"!=typeof window&&window.console&&(p[s]=m(window.console.error),p[o]=m(window.console.error),p[u]=m(window.console.warn),p[l]=m(window.console.info),p[c]=m(window.console.debug)),t}f.__dashjs_factory_name="Debug";var d=i.default.getSingletonFactory(f);d.LOG_LEVEL_NONE=0,d.LOG_LEVEL_FATAL=s,d.LOG_LEVEL_ERROR=o,d.LOG_LEVEL_WARNING=u,d.LOG_LEVEL_INFO=l,d.LOG_LEVEL_DEBUG=c,i.default.updateSingletonFactory(f.__dashjs_factory_name,d),t.default=d},"./src/core/EventBus.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/streaming/MediaPlayerEvents.js");function i(){var e={};function t(t,r,n){var a=-1;return e[t]?(e[t].some(function(e,t){if(e&&e.callback===r&&(!n||n===e.scope))return a=t,!0}),a):a}var r={on:function(r,n,a){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!r)throw new Error("event type cannot be null or undefined");if(!n||"function"!=typeof n)throw new Error("listener must be a function: "+n);var s=i.priority||0;if(!(t(r,n,a)>=0)){e[r]=e[r]||[];var o={callback:n,scope:a,priority:s};a&&a.getStreamId&&(o.streamId=a.getStreamId()),a&&a.getType&&(o.mediaType=a.getType()),i&&i.mode&&(o.mode=i.mode),e[r].some(function(t,n){if(t&&s>t.priority)return e[r].splice(n,0,o),!0})||e[r].push(o)}},off:function(r,n,a){if(r&&n&&e[r]){var i=t(r,n,a);i<0||(e[r][i]=null)}},trigger:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t&&e[t]){if((r=r||{}).hasOwnProperty("type"))throw new Error("'type' is a reserved word for event dispatching");r.type=t,n.streamId&&(r.streamId=n.streamId),n.mediaType&&(r.mediaType=n.mediaType),e[t].filter(function(e){return!(!e||n.streamId&&e.streamId&&e.streamId!==n.streamId||n.mediaType&&e.mediaType&&e.mediaType!==n.mediaType||n.mode&&e.mode&&e.mode!==n.mode||!e.mode&&n.mode&&n.mode===a.default.EVENT_MODE_ON_RECEIVE)}).forEach(function(e){return e&&e.callback.call(e.scope,r)})}},reset:function(){e={}}};return r}i.__dashjs_factory_name="EventBus";var s=n.default.getSingletonFactory(i);s.EVENT_PRIORITY_LOW=0,s.EVENT_PRIORITY_HIGH=5e3,n.default.updateSingletonFactory(i.__dashjs_factory_name,s),t.default=s},"./src/core/FactoryMaker.js":function(e,t,r){r.r(t);var n=function(){var e,t=[],r={},n={};function a(e,r){for(var n in t){var a=t[n];if(a.context===e&&a.name===r)return a.instance}return null}function i(e,t){return t[e]}function s(e,t,r){e in r&&(r[e]=t)}function o(t,r,n){var a,i=t.__dashjs_factory_name,s=r[i];if(s){var o=s.instance;if(!s.override)return o.apply({context:r,factory:e},n);for(var u in a=t.apply({context:r},n),o=o.apply({context:r,factory:e,parent:a},n))a.hasOwnProperty(u)&&(a[u]=o[u])}else a=t.apply({context:r},n);return a.getClassName=function(){return i},a}return e={extend:function(e,t,r,n){!n[e]&&t&&(n[e]={instance:t,override:r})},getSingletonInstance:a,setSingletonInstance:function(e,r,n){for(var a in t){var i=t[a];if(i.context===e&&i.name===r)return void(t[a].instance=n)}t.push({name:r,context:e,instance:n})},deleteSingletonInstances:function(e){t=t.filter(function(t){return t.context!==e})},getSingletonFactory:function(e){var n=i(e.__dashjs_factory_name,r);return n||(n=function(r){var n;return void 0===r&&(r={}),{getInstance:function(){return n||(n=a(r,e.__dashjs_factory_name)),n||(n=o(e,r,arguments),t.push({name:e.__dashjs_factory_name,context:r,instance:n})),n}}},r[e.__dashjs_factory_name]=n),n},getSingletonFactoryByName:function(e){return i(e,r)},updateSingletonFactory:function(e,t){s(e,t,r)},getClassFactory:function(e){var t=i(e.__dashjs_factory_name,n);return t||(t=function(t){return void 0===t&&(t={}),{create:function(){return o(e,t,arguments)}}},n[e.__dashjs_factory_name]=t),t},getClassFactoryByName:function(e){return i(e,n)},updateClassFactory:function(e,t){s(e,t,n)}},e}();t.default=n},"./src/core/Settings.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/core/Utils.js"),i=r("./src/core/Debug.js"),s=r("./src/streaming/constants/Constants.js"),o=r("./src/streaming/vo/metrics/HTTPRequest.js");function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(){var e,t,r={debug:{logLevel:i.default.LOG_LEVEL_WARNING,dispatchEvent:!1},streaming:{abandonLoadTimeout:1e4,wallclockTimeUpdateInterval:100,lowLatencyEnabled:!1,lowLatencyEnabledByManifest:!0,manifestUpdateRetryInterval:100,cacheInitSegments:!1,eventControllerRefreshDelay:150,capabilities:{filterUnsupportedEssentialProperties:!0,useMediaCapabilitiesApi:!1},timeShiftBuffer:{calcFromSegmentTimeline:!1,fallbackToSegmentTimeline:!0},metrics:{maxListDepth:100},delay:{liveDelayFragmentCount:NaN,liveDelay:NaN,useSuggestedPresentationDelay:!0,applyServiceDescription:!0},protection:{keepProtectionMediaKeys:!1,ignoreEmeEncryptedEvent:!1},buffer:{enableSeekDecorrelationFix:!1,fastSwitchEnabled:!0,flushBufferAtTrackSwitch:!1,reuseExistingSourceBuffers:!0,bufferPruningInterval:10,bufferToKeep:20,bufferTimeAtTopQuality:30,bufferTimeAtTopQualityLongForm:60,initialBufferLevel:NaN,stableBufferTime:12,longFormContentDurationThreshold:600,stallThreshold:.3,useAppendWindow:!0,setStallState:!0},gaps:{jumpGaps:!0,jumpLargeGaps:!0,smallGapLimit:1.5,threshold:.3,enableSeekFix:!1},utcSynchronization:{enabled:!0,useManifestDateHeaderTimeSource:!0,backgroundAttempts:2,timeBetweenSyncAttempts:30,maximumTimeBetweenSyncAttempts:600,minimumTimeBetweenSyncAttempts:2,timeBetweenSyncAttemptsAdjustmentFactor:2,maximumAllowedDrift:100,enableBackgroundSyncAfterSegmentDownloadError:!0,defaultTimingSource:{scheme:"urn:mpeg:dash:utc:http-xsdate:2014",value:"https://time.akamai.com/?iso&ms"}},scheduling:{defaultTimeout:500,lowLatencyTimeout:0,scheduleWhilePaused:!0},text:{defaultEnabled:!0},liveCatchup:{minDrift:.02,maxDrift:12,playbackRate:.5,latencyThreshold:60,playbackBufferMin:.5,enabled:!1,mode:s.default.LIVE_CATCHUP_MODE_DEFAULT},lastBitrateCachingInfo:{enabled:!0,ttl:36e4},lastMediaSettingsCachingInfo:{enabled:!0,ttl:36e4},cacheLoadThresholds:{video:50,audio:5},trackSwitchMode:{audio:s.default.TRACK_SWITCH_MODE_ALWAYS_REPLACE,video:s.default.TRACK_SWITCH_MODE_NEVER_REPLACE},selectionModeForInitialTrack:s.default.TRACK_SELECTION_MODE_HIGHEST_SELECTION_PRIORITY,fragmentRequestTimeout:0,retryIntervals:(e={},l(e,o.HTTPRequest.MPD_TYPE,500),l(e,o.HTTPRequest.XLINK_EXPANSION_TYPE,500),l(e,o.HTTPRequest.MEDIA_SEGMENT_TYPE,1e3),l(e,o.HTTPRequest.INIT_SEGMENT_TYPE,1e3),l(e,o.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE,1e3),l(e,o.HTTPRequest.INDEX_SEGMENT_TYPE,1e3),l(e,o.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE,1e3),l(e,o.HTTPRequest.LICENSE,1e3),l(e,o.HTTPRequest.OTHER_TYPE,1e3),l(e,"lowLatencyReductionFactor",10),e),retryAttempts:(t={},l(t,o.HTTPRequest.MPD_TYPE,3),l(t,o.HTTPRequest.XLINK_EXPANSION_TYPE,1),l(t,o.HTTPRequest.MEDIA_SEGMENT_TYPE,3),l(t,o.HTTPRequest.INIT_SEGMENT_TYPE,3),l(t,o.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE,3),l(t,o.HTTPRequest.INDEX_SEGMENT_TYPE,3),l(t,o.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE,3),l(t,o.HTTPRequest.LICENSE,3),l(t,o.HTTPRequest.OTHER_TYPE,3),l(t,"lowLatencyMultiplyFactor",5),t),abr:{movingAverageMethod:s.default.MOVING_AVERAGE_SLIDING_WINDOW,ABRStrategy:s.default.ABR_STRATEGY_DYNAMIC,additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0,abandonRequestsRule:!1},bandwidthSafetyFactor:.9,useDefaultABRRules:!0,useDeadTimeLatency:!0,limitBitrateByPortal:!1,usePixelRatioInLimitBitrateByPortal:!1,maxBitrate:{audio:-1,video:-1},minBitrate:{audio:-1,video:-1},maxRepresentationRatio:{audio:1,video:1},initialBitrate:{audio:-1,video:-1},initialRepresentationRatio:{audio:-1,video:-1},autoSwitchBitrate:{audio:!0,video:!0},fetchThroughputCalculationMode:s.default.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING},cmcd:{enabled:!1,sid:null,cid:null,rtp:null,rtpSafetyFactor:5,mode:s.default.CMCD_MODE_QUERY}},errors:{recoverAttempts:{mediaErrorDecode:5}}},n=a.default.clone(r);function c(e,t,r){for(var n in e)e.hasOwnProperty(n)&&t.hasOwnProperty(n)&&("object"===u(e[n])&&null!==e[n]?c(e[n],t[n],r.slice()+n+"."):t[n]=a.default.clone(e[n]))}return{get:function(){return n},update:function(e){"object"===u(e)&&c(e,n,"")},reset:function(){n=a.default.clone(r)}}}c.__dashjs_factory_name="Settings";var f=n.default.getSingletonFactory(c);t.default=f},"./src/core/Utils.js":function(e,t,r){r.r(t);var n=r("./node_modules/path-browserify/index.js"),a=r.n(n);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,r;return t=e,r=[{key:"mixin",value:function(t,r,n){var a,s={};if(t)for(var o in r)r.hasOwnProperty(o)&&(a=r[o],o in t&&(t[o]===a||o in s&&s[o]===a)||("object"===i(t[o])&&null!==t[o]?t[o]=e.mixin(t[o],a,n):t[o]=n(a)));return t}},{key:"clone",value:function(t){if(!t||"object"!==i(t))return t;var r;if(t instanceof Array){r=[];for(var n=0,a=t.length;n<a;++n)n in t&&r.push(e.clone(t[n]))}else r={};return e.mixin(r,t,e.clone)}},{key:"addAditionalQueryParameterToUrl",value:function(e,t){try{if(!t||0===t.length)return e;var r=new URL(e);return t.forEach(function(e){e.key&&e.value&&r.searchParams.set(e.key,e.value)}),r.href}catch(t){return e}}},{key:"parseHttpHeaders",value:function(e){var t={};if(!e)return t;for(var r=e.trim().split("\r\n"),n=0,a=r.length;n<a;n++){var i=r[n],s=i.indexOf(": ");s>0&&(t[i.substring(0,s)]=i.substring(s+2))}return t}},{key:"generateUuid",value:function(){var e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var r=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?r:3&r|8).toString(16)})}},{key:"generateHashCode",value:function(e){var t=0;if(0===e.length)return t;for(var r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return t}},{key:"getRelativeUrl",value:function(e,t){try{var r=new URL(e),n=new URL(t);if(r.protocol=n.protocol,r.origin!==n.origin)return t;var i=a.a.relative(r.pathname.substr(0,r.pathname.lastIndexOf("/")),n.pathname.substr(0,n.pathname.lastIndexOf("/"))),s=0===i.length?1:0;return i+=n.pathname.substr(n.pathname.lastIndexOf("/")+s,n.pathname.length-1),n.pathname.length<i.length?n.pathname:i}catch(e){return t}}}],null&&s(t.prototype,null),r&&s(t,r),e}();t.default=o},"./src/core/Version.js":function(e,t,r){r.r(t),r.d(t,"getVersionString",function(){return a});var n="4.2.0";function a(){return n}},"./src/core/errors/Errors.js":function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}r.r(t);var s=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(o,e);var t,r,s=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,a=i(t);if(r){var s=i(this).constructor;e=Reflect.construct(a,arguments,s)}else e=a.apply(this,arguments);return function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function o(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=s.call(this)).MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE=10,e.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE=11,e.XLINK_LOADER_LOADING_FAILURE_ERROR_CODE=12,e.SEGMENT_BASE_LOADER_ERROR_CODE=15,e.TIME_SYNC_FAILED_ERROR_CODE=16,e.FRAGMENT_LOADER_LOADING_FAILURE_ERROR_CODE=17,e.FRAGMENT_LOADER_NULL_REQUEST_ERROR_CODE=18,e.URL_RESOLUTION_FAILED_GENERIC_ERROR_CODE=19,e.APPEND_ERROR_CODE=20,e.REMOVE_ERROR_CODE=21,e.DATA_UPDATE_FAILED_ERROR_CODE=22,e.CAPABILITY_MEDIASOURCE_ERROR_CODE=23,e.CAPABILITY_MEDIAKEYS_ERROR_CODE=24,e.DOWNLOAD_ERROR_ID_MANIFEST_CODE=25,e.DOWNLOAD_ERROR_ID_SIDX_CODE=26,e.DOWNLOAD_ERROR_ID_CONTENT_CODE=27,e.DOWNLOAD_ERROR_ID_INITIALIZATION_CODE=28,e.DOWNLOAD_ERROR_ID_XLINK_CODE=29,e.MANIFEST_ERROR_ID_PARSE_CODE=31,e.MANIFEST_ERROR_ID_NOSTREAMS_CODE=32,e.TIMED_TEXT_ERROR_ID_PARSE_CODE=33,e.MANIFEST_ERROR_ID_MULTIPLEXED_CODE=34,e.MEDIASOURCE_TYPE_UNSUPPORTED_CODE=35,e.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE="parsing failed for ",e.MANIFEST_LOADER_LOADING_FAILURE_ERROR_MESSAGE="Failed loading manifest: ",e.XLINK_LOADER_LOADING_FAILURE_ERROR_MESSAGE="Failed loading Xlink element: ",e.SEGMENTS_UPDATE_FAILED_ERROR_MESSAGE="Segments update failed",e.SEGMENTS_UNAVAILABLE_ERROR_MESSAGE="no segments are available yet",e.SEGMENT_BASE_LOADER_ERROR_MESSAGE="error loading segment ranges from sidx",e.TIME_SYNC_FAILED_ERROR_MESSAGE="Failed to synchronize client and server time",e.FRAGMENT_LOADER_NULL_REQUEST_ERROR_MESSAGE="request is null",e.URL_RESOLUTION_FAILED_GENERIC_ERROR_MESSAGE="Failed to resolve a valid URL",e.APPEND_ERROR_MESSAGE="chunk is not defined",e.REMOVE_ERROR_MESSAGE="Removing data from the SourceBuffer",e.DATA_UPDATE_FAILED_ERROR_MESSAGE="Data update failed",e.CAPABILITY_MEDIASOURCE_ERROR_MESSAGE="mediasource is not supported",e.CAPABILITY_MEDIAKEYS_ERROR_MESSAGE="mediakeys is not supported",e.TIMED_TEXT_ERROR_MESSAGE_PARSE="parsing error :",e.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE="Error creating source buffer of type : ",e}return o}(r("./src/core/errors/ErrorsBase.js").default));t.default=s},"./src/core/errors/ErrorsBase.js":function(e,t,r){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}r.r(t);var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,r;return t=e,(r=[{key:"extend",value:function(e,t){if(e){var r=!!t&&t.override,n=!!t&&t.publicOnly;for(var a in e)!e.hasOwnProperty(a)||this[a]&&!r||n&&-1===e[a].indexOf("public_")||(this[a]=e[a])}}}])&&n(t.prototype,r),e}();t.default=a},"./src/core/events/CoreEvents.js":function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}r.r(t);var s=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(o,e);var t,r,s=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,a=i(t);if(r){var s=i(this).constructor;e=Reflect.construct(a,arguments,s)}else e=a.apply(this,arguments);return function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function o(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=s.call(this)).ATTEMPT_BACKGROUND_SYNC="attemptBackgroundSync",e.BUFFERING_COMPLETED="bufferingCompleted",e.BUFFER_CLEARED="bufferCleared",e.BYTES_APPENDED_END_FRAGMENT="bytesAppendedEndFragment",e.BUFFER_REPLACEMENT_STARTED="bufferReplacementStarted",e.CHECK_FOR_EXISTENCE_COMPLETED="checkForExistenceCompleted",e.CURRENT_TRACK_CHANGED="currentTrackChanged",e.DATA_UPDATE_COMPLETED="dataUpdateCompleted",e.INBAND_EVENTS="inbandEvents",e.INITIAL_STREAM_SWITCH="initialStreamSwitch",e.INIT_FRAGMENT_LOADED="initFragmentLoaded",e.INIT_FRAGMENT_NEEDED="initFragmentNeeded",e.INTERNAL_MANIFEST_LOADED="internalManifestLoaded",e.ORIGINAL_MANIFEST_LOADED="originalManifestLoaded",e.LOADING_COMPLETED="loadingCompleted",e.LOADING_PROGRESS="loadingProgress",e.LOADING_DATA_PROGRESS="loadingDataProgress",e.LOADING_ABANDONED="loadingAborted",e.MANIFEST_UPDATED="manifestUpdated",e.MEDIA_FRAGMENT_LOADED="mediaFragmentLoaded",e.MEDIA_FRAGMENT_NEEDED="mediaFragmentNeeded",e.QUOTA_EXCEEDED="quotaExceeded",e.SEGMENT_LOCATION_BLACKLIST_ADD="segmentLocationBlacklistAdd",e.SEGMENT_LOCATION_BLACKLIST_CHANGED="segmentLocationBlacklistChanged",e.SERVICE_LOCATION_BLACKLIST_ADD="serviceLocationBlacklistAdd",e.SERVICE_LOCATION_BLACKLIST_CHANGED="serviceLocationBlacklistChanged",e.SET_FRAGMENTED_TEXT_AFTER_DISABLED="setFragmentedTextAfterDisabled",e.SET_NON_FRAGMENTED_TEXT="setNonFragmentedText",e.SOURCE_BUFFER_ERROR="sourceBufferError",e.STREAMS_COMPOSED="streamsComposed",e.STREAM_BUFFERING_COMPLETED="streamBufferingCompleted",e.STREAM_REQUESTING_COMPLETED="streamRequestingCompleted",e.TEXT_TRACKS_QUEUE_INITIALIZED="textTracksQueueInitialized",e.TIME_SYNCHRONIZATION_COMPLETED="timeSynchronizationComplete",e.UPDATE_TIME_SYNC_OFFSET="updateTimeSyncOffset",e.URL_RESOLUTION_FAILED="urlResolutionFailed",e.VIDEO_CHUNK_RECEIVED="videoChunkReceived",e.WALLCLOCK_TIME_UPDATED="wallclockTimeUpdated",e.XLINK_ELEMENT_LOADED="xlinkElementLoaded",e.XLINK_READY="xlinkReady",e.SEEK_TARGET="seekTarget",e}return o}(r("./src/core/events/EventsBase.js").default);t.default=s},"./src/core/events/Events.js":function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}r.r(t);var s=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(o,e);var t,r,s=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,a=i(t);if(r){var s=i(this).constructor;e=Reflect.construct(a,arguments,s)}else e=a.apply(this,arguments);return function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),s.apply(this,arguments)}return o}(r("./src/core/events/CoreEvents.js").default),o=new s;t.default=o},"./src/core/events/EventsBase.js":function(e,t,r){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}r.r(t);var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,r;return t=e,(r=[{key:"extend",value:function(e,t){if(e){var r=!!t&&t.override,n=!!t&&t.publicOnly;for(var a in e)!e.hasOwnProperty(a)||this[a]&&!r||n&&-1===e[a].indexOf("public_")||(this[a]=e[a])}}}])&&n(t.prototype,r),e}();t.default=a},"./src/dash/DashAdapter.js":function(e,t,r){r.r(t);var n=r("./src/dash/constants/DashConstants.js"),a=r("./src/dash/vo/RepresentationInfo.js"),i=r("./src/dash/vo/MediaInfo.js"),s=r("./src/dash/vo/StreamInfo.js"),o=r("./src/dash/vo/ManifestInfo.js"),u=r("./src/dash/vo/Event.js"),l=r("./src/core/FactoryMaker.js"),c=r("./src/dash/models/DashManifestModel.js"),f=r("./src/dash/models/PatchManifestModel.js");function d(){var e,t,r,l,d,h,g,p=this.context;function m(e){return t.getRolesForAdaptation(e).filter(function(e){return e.value===n.default.MAIN})[0]}function y(e,r,n){var a=t.getAdaptationsForType(l[0].mpd.manifest,e,r);if(!a||0===a.length)return null;if(a.length>1&&n){var i=v(n,r);if(d[n.id]&&d[n.id][r])for(var s=0,o=a.length;s<o;s++)if(E(d[n.id][r],i[s]))return a[s];for(var u=0,c=a.length;u<c;u++)if(m(a[u]))return a[u]}return a[0]}function E(e,t){if(!e||!t)return!1;var r=e.id===t.id,n=e.codec===t.codec,a=e.viewpoint===t.viewpoint,i=e.lang===t.lang,s=e.roles.toString()===t.roles.toString(),o=e.accessibility.toString()===t.accessibility.toString(),u=e.audioChannelConfiguration.toString()===t.audioChannelConfiguration.toString();return r&&n&&a&&i&&s&&o&&u}function _(e,r,n,a,i,s){var o,u,l,c,f,d,g=[];if(!a||0===a.length)return[];var p=t.getAdaptationsForPeriod(r);for(c=0,d=a.length;c<d;c++)if(o=a[c],u=C(p[l=t.getIndexForAdaptation(o,e,n.index)]),s){var m=u.accessibility.length;for(f=0;f<m;f++)if(u){var y=u.accessibility[f];if(0===y.indexOf("cea-608:")){var E=y.substring(8).split(";");if("CC"===E[0].substring(0,2))for(f=0;f<E.length;f++)u||(u=C.call(this,p[l])),w(u,E[f].substring(0,3),E[f].substring(4)),g.push(u),u=null;else for(f=0;f<E.length;f++)u||(u=C.call(this,p[l])),w(u,"CC"+(f+1),E[f]),g.push(u),u=null}else 0===y.indexOf("cea-608")&&(w(u,h.CC1,"eng"),g.push(u),u=null)}}else i===h.IMAGE?(N(u),g.push(u),u=null):u&&g.push(u);return g}function v(e,r,n){var a=l,i=n,s=[];if(i)M(),a=T(i);else{if(!(l.length>0))return s;i=l[0].mpd.manifest}var o=I(e,a),u=t.getAdaptationsForType(i,e?e.index:null,r);return s=_(i,o,e,u,r),r===h.TEXT&&(u=t.getAdaptationsForType(i,e?e.index:null,h.VIDEO),s=s.concat(_(i,o,e,u,r,!0))),s}function T(e){var r=S(e);return t.getRegularPeriods(r)}function S(e){var r=A(e);return t.getMpd(r)}function b(){l=[],d={}}function A(e){return e||(l.length>0?l[0].mpd.manifest:null)}function R(e){try{var r=I(e.streamInfo,l),n=t.getAdaptationsForPeriod(r);return e&&e.streamInfo&&void 0!==e.streamInfo.id&&n?n[e.index]:null}catch(e){return null}}function I(e,t){for(var r=t.length,n=0;n<r;n++){var a=t[n];if(e&&e.id===a.id)return a}return null}function C(e){if(!e)return null;var r,n=new i.default,a=e.period.mpd.manifest.Period_asArray[e.period.index].AdaptationSet_asArray[e.index];if(n.id=e.id,n.index=e.index,n.type=e.type,n.streamInfo=D(e.period),n.representationCount=t.getRepresentationCount(a),n.labels=t.getLabelsForAdaptation(a),n.lang=t.getLanguageForAdaptation(a),r=t.getViewpointForAdaptation(a),n.viewpoint=r?r.value:void 0,n.accessibility=t.getAccessibilityForAdaptation(a).map(function(e){var t=e.value,r=t;return e.schemeIdUri&&e.schemeIdUri.search("cea-608")>=0&&void 0!==g&&(r=t?"cea-608:"+t:"cea-608",n.embeddedCaptions=!0),r}),n.audioChannelConfiguration=t.getAudioChannelConfigurationForAdaptation(a).map(function(e){return e.value}),0===n.audioChannelConfiguration.length&&Array.isArray(a.Representation_asArray)&&a.Representation_asArray.length>0&&(n.audioChannelConfiguration=t.getAudioChannelConfigurationForRepresentation(a.Representation_asArray[0]).map(function(e){return e.value})),n.roles=t.getRolesForAdaptation(a).map(function(e){return e.value}),n.codec=t.getCodec(a),n.mimeType=t.getMimeType(a),n.contentProtection=t.getContentProtectionData(a),n.bitrateList=t.getBitrateListForAdaptation(a),n.selectionPriority=t.getSelectionPriority(a),n.contentProtection){var s=n.contentProtection.map(function(e){return t.getKID(e)}).filter(function(e){return null!==e});if(s.length){var o=s[0];n.contentProtection.forEach(function(e){e.keyId=o})}}return n.isText=t.getIsText(a),n.supplementalProperties=t.getSupplementalProperties(a),n.isFragmented=t.getIsFragmented(a),n.isEmbedded=!1,n}function w(e,t,r){e.id=t,e.index=100+parseInt(t.substring(2,3)),e.type=h.TEXT,e.codec="cea-608-in-SEI",e.isEmbedded=!0,e.isFragmented=!1,e.lang=r,e.roles=["caption"]}function N(e){e.type=h.IMAGE}function D(e){var r,n,a=new s.default;return a.id=e.id,a.index=e.index,a.start=e.start,a.duration=e.duration,a.manifestInfo=(r=e.mpd,(n=new o.default).dvrWindowSize=r.timeShiftBufferDepth,n.loadedTime=r.manifest.loadedTime,n.availableFrom=r.availabilityStartTime,n.minBufferTime=r.manifest.minBufferTime,n.maxFragmentDuration=r.maxSegmentDuration,n.duration=t.getDuration(r.manifest),n.isDynamic=t.getIsDynamic(r.manifest),n.serviceDescriptions=t.getServiceDescriptions(r.manifest),n.protocol=r.manifest.protocol,n),a.isLast=1===e.mpd.manifest.Period_asArray.length||Math.abs(a.start+a.duration-a.manifestInfo.duration)<1,a}function M(){if(!h)throw new Error("setConfig function has to be called previously")}function O(e){return l.length>0?l[0].mpd.manifest.Period_asArray[e]:null}function P(e,t,r){var n,a,i,s,o;if(e)for(n=e.AdaptationSet_asArray,s=0;s<n.length;s+=1)for(i=n[s].Representation_asArray,o=0;o<i.length;o+=1)if(t===(a=i[o]).id)return r?o:a;return null}return e={getBandwidthForRepresentation:function(e,t){var r;return(r=P(O(t),e))?r.bandwidth:null},getIndexForRepresentation:function(e,t){return function(e,t){var r=P(e,t,!0);return null!==r?r:-1}(O(t),e)},getMaxIndexForBufferType:function(e,r){return function(e,r){var n,a,i,s;if(!e||!r)return-1;for(a=e.AdaptationSet_asArray,s=0;s<a.length;s+=1)if(i=(n=a[s]).Representation_asArray,t.getIsTypeOf(n,r))return i.length;return-1}(O(r),e)},convertRepresentationToRepresentationInfo:function(e){if(e){var r=new a.default,n=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index],i=t.getRepresentationFor(e.index,n);return r.id=e.id,r.quality=e.index,r.bandwidth=t.getBandwidth(i),r.fragmentDuration=e.segmentDuration||(e.segments&&e.segments.length>0?e.segments[0].duration:NaN),r.MSETimeOffset=e.MSETimeOffset,r.mediaInfo=C(e.adaptation),r}return null},getStreamsInfo:function(e,t){var r=[],n=l;if(e&&(M(),n=T(e)),n.length>0){(!t||t>n.length)&&(t=n.length);for(var a=0;a<t;a++)r.push(D(n[a]))}return r},getMediaInfoForType:function(e,r){if(0===l.length||!e)return null;var n=I(e,l);if(!n)return null;var a=t.getAdaptationsForPeriod(n),i=y(e.index,r,e);return i?C(a[t.getIndexForAdaptation(i,l[0].mpd.manifest,e.index)]):null},getAllMediaInfoForType:v,getAdaptationForType:y,getRealAdaptation:function(e,r){var n,a,i=I(e,l);return n=r?r.id:null,l.length>0&&i&&(a=n?t.getAdaptationForId(n,l[0].mpd.manifest,i.index):t.getAdaptationForIndex(r?r.index:null,l[0].mpd.manifest,i.index)),a},getRealPeriodByIndex:function(e){return t.getRealPeriodForIndex(e,l[0].mpd.manifest)},getEssentialPropertiesForRepresentation:function(e){try{return t.getEssentialPropertiesForRepresentation(e)}catch(e){return[]}},getVoRepresentations:function(e){var r=R(e);return t.getRepresentationsForAdaptation(r)},getEventsFor:function(e,r){var n=[];if(l.length>0){var o=l[0].mpd.manifest;e instanceof s.default?n=t.getEventsForPeriod(I(e,l)):e instanceof i.default?n=t.getEventStreamForAdaptationSet(o,R(e)):e instanceof a.default&&(n=t.getEventStreamForRepresentation(o,r))}return n},getEvent:function(e,t,r,n){try{if(!e||!t||isNaN(r)||!n)return null;var a=e.scheme_id_uri,i=e.value;if(!t[a+"/"+i])return null;var s,o=new u.default,l=e.timescale||1,c=n.adaptation.period.start,f=t[a+"/"+i],d=isNaN(n.presentationTimeOffset)?isNaN(f.presentationTimeOffset)?0:f.presentationTimeOffset:n.presentationTimeOffset,h=e.presentation_time_delta/l;s=0===e.version?c+r-d+h:c-d+h;var g=e.event_duration,p=e.id,m=e.message_data;return o.eventStream=f,o.eventStream.value=i,o.eventStream.timescale=l,o.duration=g,o.id=p,o.calculatedPresentationTime=s,o.messageData=m,o.presentationTimeDelta=h,o}catch(e){return null}},getMpd:S,setConfig:function(e){e&&(e.constants&&(h=e.constants),e.cea608parser&&(g=e.cea608parser),e.errHandler&&t.setConfig({errHandler:e.errHandler}),e.BASE64&&t.setConfig({BASE64:e.BASE64}))},updatePeriods:function(e){if(!e)return null;M(),l=T(e)},getIsTextTrack:function(e){return t.getIsText(e)},getUTCTimingSources:function(){var e=A();return t.getUTCTimingSources(e)},getSuggestedPresentationDelay:function(){var e=l.length>0?l[0].mpd:null;return t.getSuggestedPresentationDelay(e)},getAvailabilityStartTime:function(e){var r=S(e);return t.getAvailabilityStartTime(r)},getIsTypeOf:function(e,r){return t.getIsTypeOf(e,r)},getIsDynamic:function(e){var r=A(e);return t.getIsDynamic(r)},getDuration:function(e){var r=A(e);return t.getDuration(r)},getRegularPeriods:T,getLocation:function(e){return t.getLocation(e)},getPatchLocation:function(e){var r=t.getPatchLocation(e),n=t.getPublishTime(e);if(!r||!n)return null;if(r.hasOwnProperty("ttl")&&n){var a=1e3*parseFloat(r.ttl);if(n.getTime()+a<=(new Date).getTime())return null}return r.__text},getManifestUpdatePeriod:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t.getManifestUpdatePeriod(e,r)},getPublishTime:function(e){return t.getPublishTime(e)},getIsDVB:function(e){return t.hasProfile(e,"urn:dvb:dash:profile:dvb-dash:2014")},getIsPatch:function(e){return r.getIsPatch(e)},getBaseURLsFromElement:function(e){return t.getBaseURLsFromElement(e)},getRepresentationSortFunction:function(){return t.getRepresentationSortFunction()},getCodec:function(e,r,n){return t.getCodec(e,r,n)},getPeriodById:function(e){if(!e||0===l.length)return null;var t=l.filter(function(t){return t.id===e});return t&&t.length>0?t[0]:null},setCurrentMediaInfo:function(e,t,r){d[e]=d[e]||{},d[e][t]=d[e][t]||{},d[e][t]=r},isPatchValid:function(e,n){var a=t.getId(e),i=r.getMpdId(n),s=t.getPublishTime(e),o=r.getPublishTime(n),u=r.getOriginalPublishTime(n);return!!(a&&i&&a==i&&s&&u&&s.getTime()==u.getTime()&&o&&s.getTime()<o.getTime())},applyPatchToManifest:function(e,t){r.getPatchOperations(t).forEach(function(t){var r=t.getMpdTarget(e);if(null!==r){var n=r.name,a=r.target,i=r.leaf;if(t.xpath.findsAttribute())switch(t.action){case"add":case"replace":a[n]=t.value;break;case"remove":delete a[n]}else{var s=(a[n+"_asArray"]||[]).indexOf(i),o="prepend"===t.position||"before"===t.position;if(("remove"===t.action||"replace"===t.action)&&(delete a[n],-1!=s)){var u=a[n+"_asArray"];u.splice(s,1),u.length>1?a[n]=u:1==u.length?a[n]=u[0]:delete a[n+"_asArray"]}"add"!==t.action&&"replace"!==t.action||Object.keys(t.value).forEach(function(e){var r=t.value[e],i=a[e+"_asArray"]||[];if(0===i.length&&a[e]&&i.push(a[e]),0===i.length)i=r;else{var u=i.length;u=e==n&&-1!=s?s+(o?0:1)+("replace"==t.action?-1:0):o?0:i.length,i.splice.apply(i,[u,0].concat(r))}a[e+"_asArray"]=i,a[e]=1==i.length?i[0]:i})}}})},areMediaInfosEqual:E,reset:b},t=Object(c.default)(p).getInstance(),r=Object(f.default)(p).getInstance(),b(),e}d.__dashjs_factory_name="DashAdapter",t.default=l.default.getSingletonFactory(d)},"./src/dash/DashHandler.js":function(e,t,r){r.r(t);var n=r("./src/streaming/vo/FragmentRequest.js"),a=r("./src/streaming/vo/metrics/HTTPRequest.js"),i=r("./src/core/FactoryMaker.js"),s=r("./src/streaming/MediaPlayerEvents.js"),o=r("./src/dash/utils/SegmentsUtils.js"),u=r("./src/dash/constants/DashConstants.js");function l(e){var t,r,i,l,c,f=(e=e||{}).eventBus,d=e.debug,h=e.urlUtils,g=e.type,p=e.streamInfo,m=e.segmentsController,y=e.timelineConverter,E=e.baseURLController;function _(){return g}function v(){i=null}function T(e,t,r){var n,a,i=E.resolve(r.path);return i&&t!==i.url&&h.isRelative(t)?(n=i.url,a=i.serviceLocation,t&&(n=h.resolve(t,n))):n=t,!h.isRelative(n)&&(e.url=n,e.serviceLocation=a,!0)}function S(e,t){if(null==t)return null;var r=new n.default,i=t.representation,s=i.adaptation.period.mpd.manifest.Period_asArray[i.adaptation.period.index].AdaptationSet_asArray[i.adaptation.index].Representation_asArray[i.index].bandwidth,u=t.media;return u=Object(o.replaceTokenForTemplate)(u,"Number",t.replacementNumber),u=Object(o.replaceTokenForTemplate)(u,"Time",t.replacementTime),u=Object(o.replaceTokenForTemplate)(u,"Bandwidth",s),u=Object(o.replaceIDForTemplate)(u,i.id),u=Object(o.unescapeDollarsInTemplate)(u),r.mediaType=_(),r.type=a.HTTPRequest.MEDIA_SEGMENT_TYPE,r.range=t.mediaRange,r.startTime=t.presentationStartTime,r.mediaStartTime=t.mediaStartTime,r.duration=t.duration,r.timescale=i.timescale,r.availabilityStartTime=t.availabilityStartTime,r.availabilityEndTime=t.availabilityEndTime,r.wallStartTime=t.wallStartTime,r.quality=i.index,r.index=t.index,r.mediaInfo=e,r.adaptationIndex=i.adaptation.index,r.representationId=i.id,T(r,u,i)?r:void 0}function b(e,t,n){var a=null;if(!t||!t.segmentInfoType)return a;var s=m.getSegmentByTime(t,n);return s&&(i=s,r.debug("Index for time "+n+" is "+s.index),a=S(e,s)),a}function A(){r.debug("Dynamic stream complete"),c=!0}return t={initialize:function(e){l=e,c=!1,m.initialize(e)},getStreamId:function(){return p.id},getType:_,getStreamInfo:function(){return p},getInitRequest:function(e,t){return t?function(e,t,r){var i=new n.default,s=t.adaptation.period,u=s.start;if(i.mediaType=r,i.type=a.HTTPRequest.INIT_SEGMENT_TYPE,i.range=t.range,i.availabilityStartTime=y.calcAvailabilityStartTimeFromPresentationTime(u,t,l),i.availabilityEndTime=y.calcAvailabilityEndTimeFromPresentationTime(u+s.duration,t,l),i.quality=t.index,i.mediaInfo=e,i.representationId=t.id,T(i,t.initialization,t))return i.url=Object(o.replaceTokenForTemplate)(i.url,"Bandwidth",t.bandwidth),i}(e,t,_()):null},getSegmentRequestForTime:b,getCurrentIndex:function(){return i?i.index:-1},getNextSegmentRequest:function(e,t){var n=null;if(!t||!t.segmentInfoType)return null;var a=i?i.index+1:0,s=m.getSegmentByIndex(t,a,i?i.mediaStartTime:-1);if(s)n=S(e,s),i=s;else{if(l&&!c)return r.debug(_()+" No segment found at index: "+a+". Wait for next loop"),null;c=!0}return n},isLastSegmentRequested:function(e,t){if(!e||!i)return!1;if(c)return!0;if(!isFinite(e.adaptation.period.duration))return!1;if(i.presentationStartTime+i.duration>t)return!1;if(e.mediaFinishedInformation&&!isNaN(e.mediaFinishedInformation.numberOfSegments)&&!isNaN(i.index)&&i.index>=e.mediaFinishedInformation.numberOfSegments-1){if(!l||e.segmentInfoType===u.default.SEGMENT_TEMPLATE)return!0;if(l&&e.segmentInfoType===u.default.SEGMENT_LIST&&e.adaptation.period.nextPeriodId)return!0}return!!(l&&e.adaptation.period.nextPeriodId&&e.segmentInfoType===u.default.SEGMENT_TIMELINE&&e.mediaFinishedInformation&&!isNaN(e.mediaFinishedInformation.mediaTimeOfLastSignaledSegment)&&i&&!isNaN(i.mediaStartTime)&&!isNaN(i.duration)&&i.mediaStartTime+i.duration>=e.mediaFinishedInformation.mediaTimeOfLastSignaledSegment-.05)},reset:function(){v(),f.off(s.default.DYNAMIC_TO_STATIC,A,t)},getNextSegmentRequestIdempotent:function(e,t){var r=i?i.index+1:0,n=m.getSegmentByIndex(t,r,i?i.mediaStartTime:-1);return n?S(e,n):null},getValidSeekTimeCloseToTargetTime:function(e,t,r,n){try{if(isNaN(e)||!t||!r)return NaN;if(e<0&&(e=0),isNaN(n)&&(n=.5),b(t,r,e))return e;for(var a=r.adaptation.period.start,i=r.adaptation.period.start+r.adaptation.period.duration,s=Math.min(e+n,i),o=Math.max(e-n,a),u=NaN,l=null;s<=i||o>=a;){var c=null,f=null;if(s<=i&&(c=b(t,r,s)),o>=a&&(f=b(t,r,o)),f){u=o,l=f;break}if(c){u=s,l=c;break}s+=n,o-=n}if(l){var d=l.startTime+l.duration;return e>=l.startTime&&d-e>n?e:e<l.startTime?l.startTime:Math.min(d-n,u)}return u}catch(e){return NaN}}},r=d.getLogger(t),v(),f.on(s.default.DYNAMIC_TO_STATIC,A,t),t}l.__dashjs_factory_name="DashHandler",t.default=i.default.getClassFactory(l)},"./src/dash/DashMetrics.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/Constants.js"),a=r("./src/streaming/vo/metrics/HTTPRequest.js"),i=r("./src/core/FactoryMaker.js"),s=r("./src/streaming/constants/MetricsConstants.js"),o=r("./src/dash/utils/Round10.js"),u=r("./src/streaming/models/MetricsModel.js"),l=r("./src/core/Utils.js"),c=r("./src/streaming/vo/metrics/PlayList.js");function f(e){e=e||{};var t,r,i,f,d=this.context,h=e.metricsModel;function g(e){var t=h.getMetricsFor(e,!0);if(!t)return null;var r,n=t.HttpList,a=null;if(!n||n.length<=0)return null;for(r=n.length-1;r>=0;){if(n[r].responsecode){a=n[r];break}r--}return a}function p(e){var t=h.getMetricsFor(e,!0);return t&&t.HttpList?t.HttpList:[]}function m(e,t){if(!e)return null;var r=e[t];return r&&0!==r.length?r[r.length-1]:null}return t={getCurrentRepresentationSwitch:function(e){return m(h.getMetricsFor(e,!0),s.default.TRACK_SWITCH)},getCurrentBufferState:function(e){return m(h.getMetricsFor(e,!0),s.default.BUFFER_STATE)},getCurrentBufferLevel:function(e){var t=m(h.getMetricsFor(e,!0),s.default.BUFFER_LEVEL);return t?o.default.round10(t.level/1e3,-3):0},getCurrentHttpRequest:g,getHttpRequests:p,getCurrentDroppedFrames:function(){return m(h.getMetricsFor(n.default.VIDEO,!0),s.default.DROPPED_FRAMES)},getCurrentSchedulingInfo:function(e){return m(h.getMetricsFor(e,!0),s.default.SCHEDULING_INFO)},getCurrentDVRInfo:function(e){return m(e?h.getMetricsFor(e,!0):h.getMetricsFor(n.default.VIDEO,!0)||h.getMetricsFor(n.default.AUDIO,!0),s.default.DVR_INFO)},getCurrentManifestUpdate:function(){return m(h.getMetricsFor(n.default.STREAM),s.default.MANIFEST_UPDATE)},getLatestFragmentRequestHeaderValueByID:function(e,t){if(!t)return null;var r={},n=g(e);n&&(r=l.default.parseHttpHeaders(n._responseHeaders));var a=r[t.toLowerCase()];return void 0===a?null:a},getLatestMPDRequestHeaderValueByID:function(e){if(!e)return null;var t,r,i,s={};for(i=(t=p(n.default.STREAM)).length-1;i>=0;i--)if((r=t[i]).type===a.HTTPRequest.MPD_TYPE){s=l.default.parseHttpHeaders(r._responseHeaders);break}var o=s[e.toLowerCase()];return void 0===o?null:o},addRepresentationSwitch:function(e,t,r,n,a){h.addRepresentationSwitch(e,t,r,n,a)},addDVRInfo:function(e,t,r,n){h.addDVRInfo(e,t,r,n)},updateManifestUpdateInfo:function(e){var t=this.getCurrentManifestUpdate();h.updateManifestUpdateInfo(t,e)},addManifestUpdateStreamInfo:function(e){if(e){var t=this.getCurrentManifestUpdate();h.addManifestUpdateStreamInfo(t,e.id,e.index,e.start,e.duration)}},addManifestUpdateRepresentationInfo:function(e,t){if(e){var r=this.getCurrentManifestUpdate();h.addManifestUpdateRepresentationInfo(r,e.id,e.index,e.streamIndex,t,e.presentationTimeOffset,e.startNumber,e.fragmentInfoType)}},addManifestUpdate:function(e){h.addManifestUpdate(n.default.STREAM,e.type,e.requestStartDate,e.requestEndDate)},addHttpRequest:function(e,t,r,n,a){h.addHttpRequest(e.mediaType,null,e.type,e.url,e.quality,t,e.serviceLocation||null,e.range||null,e.requestStartDate,e.firstByteDate,e.requestEndDate,r,e.duration,n,a)},addSchedulingInfo:function(e,t){h.addSchedulingInfo(e.mediaType,new Date,e.type,e.startTime,e.availabilityStartTime,e.duration,e.quality,e.range,t)},addRequestsQueue:function(e,t,r){h.addRequestsQueue(e,t,r)},addBufferLevel:function(e,t,r){h.addBufferLevel(e,t,r)},addBufferState:function(e,t,r){h.addBufferState(e,t,r)},addDroppedFrames:function(e){h.addDroppedFrames(n.default.VIDEO,e)},addPlayList:function(){f&&(h.addPlayList(f),f=null)},addDVBErrors:function(e){h.addDVBErrors(e)},createPlaylistMetrics:function(e,t){(f=new c.PlayList).start=new Date,f.mstart=e,f.starttype=t},createPlaylistTraceMetrics:function(e,t,n){!0===r&&(r=!1,(i=new c.PlayListTrace).representationid=e,i.start=new Date,i.mstart=t,i.playbackspeed=null!==n?n.toString():null)},updatePlayListTraceMetrics:function(e){if(i)for(var t in i)i[t]=e[t]},pushPlayListTraceMetrics:function(e,t){if(!1===r&&f&&i&&i.start){var n=i.start,a=e.getTime()-n.getTime();i.duration=a,i.stopreason=t,f.trace.push(i),r=!0}},clearAllCurrentMetrics:function(){h.clearAllCurrentMetrics()}},h=h||Object(u.default)(d).getInstance({settings:e.settings}),r=!0,i=null,f=null,t}f.__dashjs_factory_name="DashMetrics",t.default=i.default.getSingletonFactory(f)},"./src/dash/SegmentBaseLoader.js":function(e,t,r){r.r(t);var n=r("./src/dash/vo/Segment.js"),a=r("./src/streaming/vo/DashJSError.js"),i=r("./src/core/FactoryMaker.js"),s=r("./src/streaming/vo/FragmentRequest.js"),o=r("./src/streaming/net/URLLoader.js");function u(){var e,t,r,i,u,l,c,f,d,h,g,p,m,y=this.context;function E(e,r,n,a){var s=null,o=e?m.resolve(e.path):null,u=a||{init:!0,url:o?o.url:void 0,range:{start:0,end:1500},searching:!1,bytesLoaded:0,bytesToLoad:1500,mediaType:r};t.debug("Start searching for initialization.");var l=T(u);f.load({request:l,success:function(t){if(u.bytesLoaded=u.range.end,!(s=i.findInitRange(t)))return u.range.end=u.bytesLoaded+u.bytesToLoad,E(e,r,n,u);e.range=s,n(e)},error:function(){n(e)}}),t.debug("Perform init search: "+u.url)}function _(e,r,a,s,o,u){if(a&&(void 0===a.start||void 0===a.end)){var l=a?a.toString().split("-"):null;a=l?{start:parseFloat(l[0]),end:parseFloat(l[1])}:null}o=o||v;var c=null,d=null,h=!!a,g=e?m.resolve(e.path):null,p={init:!1,url:g?g.url:void 0,range:h?a:{start:0,end:1500},searching:!h,bytesLoaded:u?u.bytesLoaded:0,bytesToLoad:1500,mediaType:r},y=T(p);f.load({request:y,success:function(a){var u=p.bytesToLoad,l=a.byteLength;if(p.bytesLoaded=p.range.end-p.range.start,c=i.parse(a),(d=c.getBox("sidx"))&&d.isComplete){var f,h,g=d.references;if(null!=g&&g.length>0&&(f=1===g[0].reference_type),f){var m,y,E,v;t.debug("Initiate multiple SIDX load."),p.range.end=p.range.start+d.size;var T=[],S=0,b=(d.offset||p.range.start)+d.size,A=function(t){t?(T=T.concat(t),++S>=y&&(T.sort(function(e,t){return e.startTime-t.startTime<0?-1:0}),o(T,e,s))):o(null,e,s)};for(m=0,y=g.length;m<y;m++)E=b,v=b+g[m].referenced_size-1,b+=g[m].referenced_size,_(e,r,{start:E,end:v},s,A,p)}else t.debug("Parsing segments from SIDX. representation "+r+" - id: "+e.id+" for range : "+p.range.start+" - "+p.range.end),h=function(e,t){for(var r,a,i,s,o=e.references,u=o.length,l=e.timescale,c=e.earliest_presentation_time,f=t.range.start+e.offset+e.first_offset+e.size,d=[],h=0;h<u;h++)i=o[h].subsegment_duration,s=o[h].referenced_size,(r=new n.default).duration=i,r.startTime=c,r.timescale=l,a=f+s-1,r.mediaRange=f+"-"+a,d.push(r),c+=i,f+=s;return d}(d,p),o(h,e,s)}else{if(d)p.range.start=d.offset||p.range.start,p.range.end=p.range.start+(d.size||u);else{if(l<p.bytesLoaded)return void o(null,e,s);var R=c.getLastBox();R&&R.size?(p.range.start=R.offset+R.size,p.range.end=p.range.start+u):p.range.end+=u}_(e,r,p.range,s,null,p)}},error:function(){o(null,e,s)}}),t.debug("Perform SIDX load for type ".concat(r," : ").concat(p.url," with range ").concat(p.range.start," - ").concat(p.range.end))}function v(e,t,r){r({segments:e,representation:t,error:e?void 0:new a.default(d.SEGMENT_BASE_LOADER_ERROR_CODE,d.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})}function T(e){if(e.url){var t=new s.default;return t.setInfo(e),t}}return e={setConfig:function(n){n.baseURLController&&(m=n.baseURLController),n.dashMetrics&&(l=n.dashMetrics),n.mediaPlayerModel&&(c=n.mediaPlayerModel),n.errHandler&&(r=n.errHandler),n.boxParser&&(i=n.boxParser),n.debug&&(t=n.debug.getLogger(e)),n.requestModifier&&(u=n.requestModifier),n.errors&&(d=n.errors),n.urlUtils&&(p=n.urlUtils),n.constants&&(h=n.constants),n.dashConstants&&(g=n.dashConstants)},initialize:function(){f=Object(o.default)(y).create({errHandler:r,dashMetrics:l,mediaPlayerModel:c,requestModifier:u,boxParser:i,errors:d,urlUtils:p,constants:h,dashConstants:g})},loadInitialization:function(e,t){return new Promise(function(r){E(e,t,r)})},loadSegments:function(e,t,r){return new Promise(function(n){_(e,t,r,n)})},reset:function(){f&&(f.abort(),f=null)}}}u.__dashjs_factory_name="SegmentBaseLoader",t.default=i.default.getSingletonFactory(u)},"./src/dash/WebmSegmentBaseLoader.js":function(e,t,r){r.r(t);var n=r("./src/streaming/utils/EBMLParser.js"),a=r("./src/streaming/constants/Constants.js"),i=r("./src/core/FactoryMaker.js"),s=r("./src/dash/vo/Segment.js"),o=r("./src/streaming/vo/FragmentRequest.js"),u=r("./src/streaming/net/URLLoader.js"),l=r("./src/streaming/vo/DashJSError.js");function c(){var e,t,r,i,c,f,d,h,g,p,m=this.context;function y(e){var t=new o.default;return t.setInfo(e),t}return e={setConfig:function(r){if(!(r.baseURLController&&r.dashMetrics&&r.mediaPlayerModel&&r.errHandler))throw new Error(a.default.MISSING_CONFIG_ERROR);p=r.baseURLController,f=r.dashMetrics,d=r.mediaPlayerModel,i=r.errHandler,g=r.errors,t=r.debug.getLogger(e),c=r.requestModifier},initialize:function(){h=Object(u.default)(m).create({errHandler:i,dashMetrics:f,mediaPlayerModel:d,requestModifier:c,errors:g})},loadInitialization:function(e,r){return new Promise(function(n){var a=null,i=e?p.resolve(e.path):null,s=e?e.range.split("-"):null,o={range:{start:s?parseFloat(s[0]):null,end:s?parseFloat(s[1]):null},request:a,url:i?i.url:void 0,init:!0,mediaType:r};t.info("Start loading initialization."),a=y(o),h.load({request:a,success:function(){n(e)},error:function(){n(e)}}),t.debug("Perform init load: "+o.url)})},loadSegments:function(e,a,i){return new Promise(function(o){var u=null,c=e?p.resolve(e.path):null,f=c?c.url:void 0;u=y({bytesLoaded:0,bytesToLoad:8192,range:{start:0,end:8192},request:u,url:f,init:!1,mediaType:a}),t.debug("Parsing ebml header"),h.load({request:u,success:function(a){!function(e,a,i,o){if(e&&0!==e.byteLength){var u,l,c,f,d=Object(n.default)(m).create({data:e}),g=i?i.split("-"):null,p=null,E={url:a,range:{start:g?parseFloat(g[0]):null,end:g?parseFloat(g[1]):null},request:p};for(t.debug("Parse EBML header: "+E.url),d.skipOverElement(r.EBML),d.consumeTag(r.Segment),c=d.getMatroskaCodedNum(),c+=d.getPos(),f=d.getPos();d.moreData()&&!d.consumeTagAndSize(r.Segment.Info,!0);)if(!(d.skipOverElement(r.Segment.SeekHead,!0)||d.skipOverElement(r.Segment.Tracks,!0)||d.skipOverElement(r.Segment.Cues,!0)||d.skipOverElement(r.Void,!0)))throw new Error("no valid top level element found");for(;void 0===u;){var _=d.getMatroskaCodedNum(!0),v=d.getMatroskaCodedNum();_===r.Segment.Info.Duration.tag?u=d[r.Segment.Info.Duration.parse](v):d.setPos(d.getPos()+v)}p=y(E),h.load({request:p,success:function(e){l=function(e,a,i,o){var u,l,c,f,d,h,g,p;for(c=[],d=0,h=(l=function(e){var t,a,i=[],s=Object(n.default)(m).create({data:e});for(s.consumeTagAndSize(r.Segment.Cues);s.moreData()&&s.consumeTagAndSize(r.Segment.Cues.CuePoint,!0);){for((t={}).CueTime=s.parseTag(r.Segment.Cues.CuePoint.CueTime),t.CueTracks=[];s.moreData()&&s.consumeTag(r.Segment.Cues.CuePoint.CueTrackPositions,!0);){var o=s.getMatroskaCodedNum(),u=s.getPos();if((a={}).Track=s.parseTag(r.Segment.Cues.CuePoint.CueTrackPositions.CueTrack),0===a.Track)throw new Error("Cue track cannot be 0");a.ClusterPosition=s.parseTag(r.Segment.Cues.CuePoint.CueTrackPositions.CueClusterPosition),t.CueTracks.push(a),s.setPos(u+o)}if(0===t.CueTracks.length)throw new Error("Mandatory cuetrack not found");i.push(t)}if(0===i.length)throw new Error("mandatory cuepoint not found");return i}(e)).length;d<h;d+=1)f=new s.default,u=d<l.length-1?l[d+1].CueTime-l[d].CueTime:o-l[d].CueTime,f.duration=u,f.startTime=l[d].CueTime,f.timescale=1e3,g=l[d].CueTracks[0].ClusterPosition+a,p=d<l.length-1?l[d+1].CueTracks[0].ClusterPosition+a-1:i-1,f.mediaRange=g+"-"+p,c.push(f);return t.debug("Parsed cues: "+c.length+" cues."),c}(e,f,c,u),o(l)},error:function(){t.error("Download Error: Cues "+E.url),o(null)}}),t.debug("Perform cues load: "+E.url+" bytes="+E.range.start+"-"+E.range.end)}else o(null)}(a,f,i,function(t){o({segments:t,representation:e,error:t?void 0:new l.default(g.SEGMENT_BASE_LOADER_ERROR_CODE,g.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})})},error:function(){o({representation:e,error:new l.default(g.SEGMENT_BASE_LOADER_ERROR_CODE,g.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})}})})},reset:function(){h&&(h.abort(),h=null)}},r={EBML:{tag:440786851,required:!0},Segment:{tag:408125543,required:!0,SeekHead:{tag:290298740,required:!0},Info:{tag:357149030,required:!0,TimecodeScale:{tag:2807729,required:!0,parse:"getMatroskaUint"},Duration:{tag:17545,required:!0,parse:"getMatroskaFloat"}},Tracks:{tag:374648427,required:!0},Cues:{tag:475249515,required:!0,CuePoint:{tag:187,required:!0,CueTime:{tag:179,required:!0,parse:"getMatroskaUint"},CueTrackPositions:{tag:183,required:!0,CueTrack:{tag:247,required:!0,parse:"getMatroskaUint"},CueClusterPosition:{tag:241,required:!0,parse:"getMatroskaUint"}}}}},Void:{tag:236,required:!0}},e}c.__dashjs_factory_name="WebmSegmentBaseLoader",t.default=i.default.getSingletonFactory(c)},"./src/dash/constants/DashConstants.js":function(e,t,r){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}r.r(t);var a=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}var t,r;return t=e,(r=[{key:"init",value:function(){this.BASE_URL="BaseURL",this.SEGMENT_BASE="SegmentBase",this.SEGMENT_TEMPLATE="SegmentTemplate",this.SEGMENT_LIST="SegmentList",this.SEGMENT_URL="SegmentURL",this.SEGMENT_TIMELINE="SegmentTimeline",this.SEGMENT_PROFILES="segmentProfiles",this.ADAPTATION_SET="AdaptationSet",this.REPRESENTATION="Representation",this.REPRESENTATION_INDEX="RepresentationIndex",this.SUB_REPRESENTATION="SubRepresentation",this.INITIALIZATION="Initialization",this.INITIALIZATION_MINUS="initialization",this.MPD="MPD",this.PERIOD="Period",this.ASSET_IDENTIFIER="AssetIdentifier",this.EVENT_STREAM="EventStream",this.ID="id",this.PROFILES="profiles",this.SERVICE_LOCATION="serviceLocation",this.RANGE="range",this.INDEX="index",this.MEDIA="media",this.BYTE_RANGE="byteRange",this.INDEX_RANGE="indexRange",this.MEDIA_RANGE="mediaRange",this.VALUE="value",this.CONTENT_TYPE="contentType",this.MIME_TYPE="mimeType",this.BITSTREAM_SWITCHING="BitstreamSwitching",this.BITSTREAM_SWITCHING_MINUS="bitstreamSwitching",this.CODECS="codecs",this.DEPENDENCY_ID="dependencyId",this.MEDIA_STREAM_STRUCTURE_ID="mediaStreamStructureId",this.METRICS="Metrics",this.METRICS_MINUS="metrics",this.REPORTING="Reporting",this.WIDTH="width",this.HEIGHT="height",this.SAR="sar",this.FRAMERATE="frameRate",this.AUDIO_SAMPLING_RATE="audioSamplingRate",this.MAXIMUM_SAP_PERIOD="maximumSAPPeriod",this.START_WITH_SAP="startWithSAP",this.MAX_PLAYOUT_RATE="maxPlayoutRate",this.CODING_DEPENDENCY="codingDependency",this.SCAN_TYPE="scanType",this.FRAME_PACKING="FramePacking",this.AUDIO_CHANNEL_CONFIGURATION="AudioChannelConfiguration",this.CONTENT_PROTECTION="ContentProtection",this.ESSENTIAL_PROPERTY="EssentialProperty",this.SUPPLEMENTAL_PROPERTY="SupplementalProperty",this.INBAND_EVENT_STREAM="InbandEventStream",this.ACCESSIBILITY="Accessibility",this.ROLE="Role",this.RATING="Rating",this.CONTENT_COMPONENT="ContentComponent",this.SUBSET="Subset",this.LANG="lang",this.VIEWPOINT="Viewpoint",this.ROLE_ASARRAY="Role_asArray",this.ACCESSIBILITY_ASARRAY="Accessibility_asArray",this.AUDIOCHANNELCONFIGURATION_ASARRAY="AudioChannelConfiguration_asArray",this.CONTENTPROTECTION_ASARRAY="ContentProtection_asArray",this.MAIN="main",this.DYNAMIC="dynamic",this.STATIC="static",this.MEDIA_PRESENTATION_DURATION="mediaPresentationDuration",this.MINIMUM_UPDATE_PERIOD="minimumUpdatePeriod",this.CODEC_PRIVATE_DATA="codecPrivateData",this.BANDWITH="bandwidth",this.SOURCE_URL="sourceURL",this.TIMESCALE="timescale",this.DURATION="duration",this.START_NUMBER="startNumber",this.PRESENTATION_TIME_OFFSET="presentationTimeOffset",this.AVAILABILITY_START_TIME="availabilityStartTime",this.AVAILABILITY_END_TIME="availabilityEndTime",this.TIMESHIFT_BUFFER_DEPTH="timeShiftBufferDepth",this.MAX_SEGMENT_DURATION="maxSegmentDuration",this.PRESENTATION_TIME="presentationTime",this.MIN_BUFFER_TIME="minBufferTime",this.MAX_SUBSEGMENT_DURATION="maxSubsegmentDuration",this.START="start",this.AVAILABILITY_TIME_OFFSET="availabilityTimeOffset",this.AVAILABILITY_TIME_COMPLETE="availabilityTimeComplete",this.CENC_DEFAULT_KID="cenc:default_KID",this.DVB_PRIORITY="dvb:priority",this.DVB_WEIGHT="dvb:weight",this.SUGGESTED_PRESENTATION_DELAY="suggestedPresentationDelay",this.SERVICE_DESCRIPTION="ServiceDescription",this.SERVICE_DESCRIPTION_SCOPE="Scope",this.SERVICE_DESCRIPTION_LATENCY="Latency",this.SERVICE_DESCRIPTION_PLAYBACK_RATE="PlaybackRate",this.PATCH_LOCATION="PatchLocation",this.PUBLISH_TIME="publishTime",this.ORIGINAL_PUBLISH_TIME="originalPublishTime",this.ORIGINAL_MPD_ID="mpdId"}}])&&n(t.prototype,r),e}());t.default=a},"./src/dash/controllers/RepresentationController.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/Constants.js"),a=r("./src/core/FactoryMaker.js"),i=r("./src/streaming/MediaPlayerEvents.js"),s=r("./src/dash/utils/SegmentsUtils.js");function o(e){var t,r,a,o,u,l=(e=e||{}).eventBus,c=e.events,f=e.abrController,d=e.dashMetrics,h=e.playbackController,g=e.timelineConverter,p=e.type,m=e.streamInfo,y=e.dashConstants,E=e.segmentsController,_=e.isDynamic;function v(){return p}function T(){if(!(f&&d&&h&&g))throw new Error(n.default.MISSING_CONFIG_ERROR)}function S(){return a}function b(){return u}function A(){r=null,a=!0,o=[]}function R(e){return new Promise(function(t,r){var n=e.hasInitialization(),a=e.hasSegments(),i=[];i.push(E.updateInitData(e,n)),i.push(E.updateSegmentData(e,a)),Promise.all(i).then(function(r){var n;r[0]&&!r[0].error&&(e=function(e,t){return t&&!t.error&&t.representation?t.representation:e}(e,r[0])),r[1]&&!r[1].error&&(e=function(e,t){if(t&&!t.error){var r,n,a,i,o=t.segments,u=[],l=0;for(r=0,n=o?o.length:0;r<n;r++)a=o[r],(i=Object(s.getTimeBasedSegment)(g,_,e,a.startTime,a.duration,a.timescale,a.media,a.mediaRange,l))&&(u.push(i),i=null,l++);return u.length>0&&(e.segments=u),e}}(e,r[1])),(n=e).mediaFinishedInformation=E.getMediaFinishedInformation(n),function(e){if(S()){var t,r,n=d.getCurrentManifestUpdate(),a=!1;if(n){for(var i=0;i<n.representationInfo.length;i++)if((t=n.representationInfo[i]).index===e.index&&t.mediaType===v()){a=!0;break}a||d.addManifestUpdateRepresentationInfo(e,v())}if(function(){for(var e=0,t=o.length;e<t;e++){var r=o[e].segmentInfoType;if(!o[e].hasInitialization()||(r===y.SEGMENT_BASE||r===y.BASE_URL)&&!o[e].segments)return!1}return!0}()){f.setPlaybackQuality(p,m,(r=u,o.indexOf(r)));var s=d.getCurrentDVRInfo(p);s&&d.updateManifestUpdateInfo({latency:s.range.end-h.getTime()}),d.getCurrentRepresentationSwitch(b().adaptation.type)||I(),w()}}}(e),t()}).catch(function(e){r(e)})})}function I(){T();var e=new Date,t=b(),r=1e3*h.getTime();t&&d.addRepresentationSwitch(t.adaptation.type,e,r,t.id),l.trigger(i.default.REPRESENTATION_SWITCH,{mediaType:p,streamId:m.id,currentRepresentation:t,numberOfRepresentations:o.length},{streamId:m.id,mediaType:p})}function C(e){return null==e||e>=o.length?null:o[e]}function w(e){a=!1,l.trigger(c.DATA_UPDATE_COMPLETED,{data:r,currentRepresentation:u,error:e},{streamId:m.id,mediaType:p})}function N(e){u=e}function D(e){if(e.newDuration){var t=b();t&&t.adaptation.period&&(t.adaptation.period.duration=e.newDuration)}}return t={getStreamId:function(){return m.id},getType:v,getData:function(){return r},isUpdating:S,updateData:function(e,t,i,s,u){if(T(),a=!0,o=t,N(C(u)),r=e,i!==n.default.VIDEO&&i!==n.default.AUDIO&&(i!==n.default.TEXT||!s))return w(),Promise.resolve();for(var l=[],c=0,f=o.length;c<f;c++){var d=o[c];l.push(R(d))}return Promise.all(l)},getCurrentRepresentation:b,getRepresentationForQuality:C,prepareQualityChange:function(e){N(C(e)),I()},reset:function(){l.off(i.default.MANIFEST_VALIDITY_CHANGED,D,t),A()}},A(),l.on(i.default.MANIFEST_VALIDITY_CHANGED,D,t),t}o.__dashjs_factory_name="RepresentationController",t.default=a.default.getClassFactory(o)},"./src/dash/controllers/SegmentBaseController.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/dash/SegmentBaseLoader.js"),i=r("./src/dash/WebmSegmentBaseLoader.js");function s(e){e=e||{};var t,r,n,s=this.context,o=e.eventBus,u=e.events,l=e.dashMetrics,c=e.mediaPlayerModel,f=e.errHandler,d=e.baseURLController,h=e.debug,g=e.boxParser,p=e.requestModifier,m=e.errors;function y(e){return"webm"===(e?e.split("/")[1]:"").toLowerCase()}return t={initialize:function(){r.initialize(),n.initialize()},getSegmentBaseInitSegment:function(e){return y(e.representation.mimeType)?n.loadInitialization(e.representation,e.mediaType):r.loadInitialization(e.representation,e.mediaType)},getSegmentList:function(e){return y(e.mimeType)?n.loadSegments(e.representation,e.mediaType,e.representation?e.representation.indexRange:null):r.loadSegments(e.representation,e.mediaType,e.representation?e.representation.indexRange:null)},reset:function(){r.reset(),n.reset()}},r=Object(a.default)(s).getInstance(),n=Object(i.default)(s).getInstance(),r.setConfig({baseURLController:d,dashMetrics:l,mediaPlayerModel:c,errHandler:f,eventBus:o,events:u,errors:m,debug:h,boxParser:g,requestModifier:p}),n.setConfig({baseURLController:d,dashMetrics:l,mediaPlayerModel:c,errHandler:f,eventBus:o,events:u,errors:m,debug:h,requestModifier:p}),t}s.__dashjs_factory_name="SegmentBaseController";var o=n.default.getSingletonFactory(s);t.default=o},"./src/dash/controllers/SegmentsController.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/dash/utils/TimelineSegmentsGetter.js"),i=r("./src/dash/utils/TemplateSegmentsGetter.js"),s=r("./src/dash/utils/ListSegmentsGetter.js"),o=r("./src/dash/utils/SegmentBaseGetter.js");function u(e){e=e||{};var t,r,n=this.context,u=e.dashConstants,l=e.type,c=e.segmentBaseController;function f(e){return e?e.segments?r[u.SEGMENT_BASE]:r[e.segmentInfoType]:null}return t={initialize:function(t){r[u.SEGMENT_TIMELINE]=Object(a.default)(n).create(e,t),r[u.SEGMENT_TEMPLATE]=Object(i.default)(n).create(e,t),r[u.SEGMENT_LIST]=Object(s.default)(n).create(e,t),r[u.SEGMENT_BASE]=Object(o.default)(n).create(e,t)},updateInitData:function(e,t){return t?Promise.resolve():c.getSegmentBaseInitSegment({representation:e,mediaType:l})},updateSegmentData:function(e,t){return t?Promise.resolve():c.getSegmentList({mimeType:e.mimeType,representation:e,mediaType:l})},getSegmentByIndex:function(e,t,r){var n=f(e);return n?n.getSegmentByIndex(e,t,r):null},getSegmentByTime:function(e,t){var r=f(e);return r?r.getSegmentByTime(e,t):null},getMediaFinishedInformation:function(e){var t=f(e);return t?t.getMediaFinishedInformation(e):{numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN}}},r={},t}u.__dashjs_factory_name="SegmentsController";var l=n.default.getClassFactory(u);t.default=l},"./src/dash/models/DashManifestModel.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/Constants.js"),a=r("./src/dash/constants/DashConstants.js"),i=r("./src/dash/vo/Representation.js"),s=r("./src/dash/vo/AdaptationSet.js"),o=r("./src/dash/vo/Period.js"),u=r("./src/dash/vo/Mpd.js"),l=r("./src/dash/vo/UTCTiming.js"),c=r("./src/dash/vo/Event.js"),f=r("./src/dash/vo/BaseURL.js"),d=r("./src/dash/vo/EventStream.js"),h=r("./src/streaming/utils/ObjectUtils.js"),g=r("./src/streaming/utils/URLUtils.js"),p=r("./src/core/FactoryMaker.js"),m=r("./src/core/Debug.js"),y=r("./src/streaming/vo/DashJSError.js"),E=r("./src/core/errors/Errors.js"),_=r("./src/streaming/thumbnail/ThumbnailTracks.js");function v(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return T(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?T(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,o=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return s=e.done,e},e:function(e){o=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(o)throw i}}}}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function S(){var e,t,r,p,T=this.context,S=Object(g.default)(T).getInstance(),b=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};function A(e,t){if(!e)throw new Error("adaptation is not defined");if(!t)throw new Error("type is not defined");if(e.Representation_asArray&&e.Representation_asArray.length){var r=F(e.Representation_asArray[0]);if(r&&r.length>0&&_.THUMBNAILS_SCHEME_ID_URIS.indexOf(r[0].schemeIdUri)>=0)return t===n.default.IMAGE}if(e.ContentComponent_asArray&&e.ContentComponent_asArray.length>0){if(e.ContentComponent_asArray.length>1)return t===n.default.MUXED;if(e.ContentComponent_asArray[0].contentType===t)return!0}var i=t===n.default.TEXT?new RegExp("(ttml|vtt|wvtt|stpp)"):new RegExp(t);if(e.Representation_asArray&&e.Representation_asArray.length){var s=e.Representation_asArray[0].codecs;if(i.test(s))return!0}if(e.hasOwnProperty(a.default.MIME_TYPE))return i.test(e.mimeType);if(e.Representation_asArray)for(var o,u=0;u<e.Representation_asArray.length;u++)if((o=e.Representation_asArray[u]).hasOwnProperty(a.default.MIME_TYPE))return i.test(o.mimeType);return!1}function R(e){if(!e)throw new Error("adaptation is not defined");if(e.hasOwnProperty(a.default.SEGMENT_TEMPLATE)||e.hasOwnProperty(a.default.SEGMENT_TIMELINE)||e.hasOwnProperty(a.default.SEGMENT_LIST)||e.hasOwnProperty(a.default.SEGMENT_BASE))return!0;if(e.Representation_asArray&&e.Representation_asArray.length>0){var t=e.Representation_asArray[0];if(t.hasOwnProperty(a.default.SEGMENT_TEMPLATE)||t.hasOwnProperty(a.default.SEGMENT_TIMELINE)||t.hasOwnProperty(a.default.SEGMENT_LIST)||t.hasOwnProperty(a.default.SEGMENT_BASE))return!0}return!1}function I(e){return A(e,n.default.AUDIO)}function C(e){return A(e,n.default.VIDEO)}function w(e){return A(e,n.default.TEXT)}function N(e){return A(e,n.default.MUXED)}function D(e){return A(e,n.default.IMAGE)}function M(e){return e&&Array.isArray(e.Representation_asArray)&&e.Representation_asArray.sort(function(e,t){return e.bandwidth-t.bandwidth}),e}function O(e,t){return e&&e.Period_asArray&&b(t)&&e.Period_asArray[t]?e.Period_asArray[t].AdaptationSet_asArray:[]}function P(e){return e&&e.Period_asArray?e.Period_asArray:[]}function L(e){var t=!1;return e&&e.hasOwnProperty("type")&&(t=e.type===a.default.DYNAMIC),t}function F(e){return e&&e.EssentialProperty_asArray&&e.EssentialProperty_asArray.length?e.EssentialProperty_asArray.map(function(e){return{schemeIdUri:e.schemeIdUri,value:e.value}}):null}function j(e){if(!e||!e.S_asArray)return NaN;var t=e.S_asArray[0],r=e.S_asArray[1];return t.hasOwnProperty("d")?t.d:r.t-t.t}function x(e){var t=e.presentationTimeOffset;return e.adaptation.period.start-t}function k(e,t){if(!e)throw new Error("Period cannot be null or undefined");var r=o.default.DEFAULT_ID+"_"+t;return e.hasOwnProperty(a.default.ID)&&e.id.length>0&&"__proto__"!==e.id&&(r=e.id),r}function B(e,t){var r,i=[];if(!e)return i;for(r=0;r<e.length;r++){var s=new d.default;if(s.timescale=1,s.representation=t,!e[r].hasOwnProperty(n.default.SCHEME_ID_URI))throw new Error("Invalid EventStream. SchemeIdUri has to be set");s.schemeIdUri=e[r].schemeIdUri,e[r].hasOwnProperty(a.default.TIMESCALE)&&(s.timescale=e[r].timescale),e[r].hasOwnProperty(a.default.VALUE)&&(s.value=e[r].value),i.push(s)}return i}function U(e){var t=[],r=e.BaseURL_asArray||[e.baseUri],n=!1;return r.some(function(r){if(r){var i=new f.default,s=r.__text||r;return S.isRelative(s)&&(n=!0,e.baseUri&&(s=S.resolve(s,e.baseUri))),i.url=s,r.hasOwnProperty(a.default.SERVICE_LOCATION)&&r.serviceLocation.length?i.serviceLocation=r.serviceLocation:i.serviceLocation=s,r.hasOwnProperty(a.default.DVB_PRIORITY)&&(i.dvb_priority=r[a.default.DVB_PRIORITY]),r.hasOwnProperty(a.default.DVB_WEIGHT)&&(i.dvb_weight=r[a.default.DVB_WEIGHT]),r.hasOwnProperty(a.default.AVAILABILITY_TIME_OFFSET)&&(i.availabilityTimeOffset=r[a.default.AVAILABILITY_TIME_OFFSET]),r.hasOwnProperty(a.default.AVAILABILITY_TIME_COMPLETE)&&(i.availabilityTimeComplete="false"!==r[a.default.AVAILABILITY_TIME_COMPLETE]),t.push(i),n}}),t}return e={getIsTypeOf:A,getIsText:w,getIsFragmented:R,getLanguageForAdaptation:function(e){var t="";return e&&e.hasOwnProperty(a.default.LANG)&&(t=e.lang.replace(/[^A-Za-z0-9-]/g,"")),t},getViewpointForAdaptation:function(e){return e&&e.hasOwnProperty(a.default.VIEWPOINT)?e.Viewpoint:null},getRolesForAdaptation:function(e){return e&&e.hasOwnProperty(a.default.ROLE_ASARRAY)?e.Role_asArray:[]},getAccessibilityForAdaptation:function(e){return e&&e.hasOwnProperty(a.default.ACCESSIBILITY_ASARRAY)?e.Accessibility_asArray:[]},getAudioChannelConfigurationForAdaptation:function(e){return e&&e.hasOwnProperty(a.default.AUDIOCHANNELCONFIGURATION_ASARRAY)?e.AudioChannelConfiguration_asArray:[]},getAudioChannelConfigurationForRepresentation:function(e){return e&&e.hasOwnProperty(a.default.AUDIOCHANNELCONFIGURATION_ASARRAY)?e.AudioChannelConfiguration_asArray:[]},getAdaptationForIndex:function(e,t,r){var n=O(t,r);return n.length>0&&b(e)?n[e]:null},getIndexForAdaptation:function(e,t,r){if(!e)return-1;for(var n=O(t,r),a=0;a<n.length;a++)if(Object(h.default)(T).getInstance().areEqual(n[a],e))return a;return-1},getAdaptationForId:function(e,t,r){var n,i,s=O(t,r);for(n=0,i=s.length;n<i;n++)if(s[n].hasOwnProperty(a.default.ID)&&s[n].id===e)return s[n];return null},getAdaptationsForType:function(e,t,r){var n,a,i=O(e,t),s=[];for(n=0,a=i.length;n<a;n++)A(i[n],r)&&s.push(M(i[n]));return s},getRealPeriods:P,getRealPeriodForIndex:function(e,t){var r=P(t);return r.length>0&&b(e)?r[e]:null},getCodec:function(e,t,r){var n=null;if(e&&e.Representation_asArray&&e.Representation_asArray.length>0){var a=b(t)&&t>=0&&t<e.Representation_asArray.length?e.Representation_asArray[t]:e.Representation_asArray[0];a&&(n=a.mimeType+';codecs="'+a.codecs+'"',r&&void 0!==a.width&&(n+=';width="'+a.width+'";height="'+a.height+'"'))}return n&&(n=n.replace(/\sprofiles=[^;]*/g,"")),n},getSelectionPriority:function(e){try{var t=e&&void 0!==e.selectionPriority?parseInt(e.selectionPriority):1;return isNaN(t)?1:t}catch(e){return 1}},getMimeType:function(e){return e&&e.Representation_asArray&&e.Representation_asArray.length>0?e.Representation_asArray[0].mimeType:null},getKID:function(e){return e&&e.hasOwnProperty(a.default.CENC_DEFAULT_KID)?e[a.default.CENC_DEFAULT_KID]:null},getLabelsForAdaptation:function(e){if(!e||!Array.isArray(e.Label_asArray))return[];for(var t=[],r=0;r<e.Label_asArray.length;r++)t.push({lang:e.Label_asArray[r].lang,text:e.Label_asArray[r].__text||e.Label_asArray[r]});return t},getContentProtectionData:function(e){return e&&e.hasOwnProperty(a.default.CONTENTPROTECTION_ASARRAY)&&0!==e.ContentProtection_asArray.length?e.ContentProtection_asArray:null},getIsDynamic:L,getId:function(e){return e&&e[a.default.ID]||null},hasProfile:function(e,t){var r=!1;return e&&e.profiles&&e.profiles.length>0&&(r=-1!==e.profiles.indexOf(t)),r},getDuration:function(e){return e&&e.hasOwnProperty(a.default.MEDIA_PRESENTATION_DURATION)?e.mediaPresentationDuration:e&&"dynamic"==e.type?Number.POSITIVE_INFINITY:Number.MAX_SAFE_INTEGER||Number.MAX_VALUE},getBandwidth:function(e){return e&&e.bandwidth?e.bandwidth:NaN},getManifestUpdatePeriod:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=NaN;return e&&e.hasOwnProperty(a.default.MINIMUM_UPDATE_PERIOD)&&(r=e.minimumUpdatePeriod),isNaN(r)?r:Math.max(r-t,1)},getPublishTime:function(e){return e&&e.hasOwnProperty(a.default.PUBLISH_TIME)?new Date(e[a.default.PUBLISH_TIME]):null},getRepresentationCount:function(e){return e&&Array.isArray(e.Representation_asArray)?e.Representation_asArray.length:0},getBitrateListForAdaptation:function(e){var t=M(e);return(t&&Array.isArray(t.Representation_asArray)?t.Representation_asArray:[]).map(function(e){return{bandwidth:e.bandwidth,width:e.width||0,height:e.height||0,scanType:e.scanType||null,id:e.id||null}})},getRepresentationFor:function(e,t){return t&&t.Representation_asArray&&t.Representation_asArray.length>0&&b(e)?t.Representation_asArray[e]:null},getRepresentationsForAdaptation:function(e){var t,r,n=[],s=function(e){if(e&&e.period&&b(e.period.index)){var t=e.period.mpd.manifest.Period_asArray[e.period.index];if(t&&t.AdaptationSet_asArray&&b(e.index))return M(t.AdaptationSet_asArray[e.index])}}(e);if(s&&s.Representation_asArray){if(e&&e.period&&b(e.period.index)){var o=U(e.period.mpd.manifest);o&&(r=o[0])}for(var u=0,l=s.Representation_asArray.length;u<l;++u){var c=s.Representation_asArray[u],f=new i.default;if(f.index=u,f.adaptation=e,c.hasOwnProperty(a.default.ID)&&(f.id=c.id),c.hasOwnProperty(a.default.CODECS)&&(f.codecs=c.codecs),c.hasOwnProperty(a.default.MIME_TYPE)&&(f.mimeType=c[a.default.MIME_TYPE]),c.hasOwnProperty(a.default.CODEC_PRIVATE_DATA)&&(f.codecPrivateData=c.codecPrivateData),c.hasOwnProperty(a.default.BANDWITH)&&(f.bandwidth=c.bandwidth),c.hasOwnProperty(a.default.WIDTH)&&(f.width=c.width),c.hasOwnProperty(a.default.HEIGHT)&&(f.height=c.height),c.hasOwnProperty(a.default.SCAN_TYPE)&&(f.scanType=c.scanType),c.hasOwnProperty(a.default.MAX_PLAYOUT_RATE)&&(f.maxPlayoutRate=c.maxPlayoutRate),c.hasOwnProperty(a.default.SEGMENT_BASE)?(t=c.SegmentBase,f.segmentInfoType=a.default.SEGMENT_BASE):c.hasOwnProperty(a.default.SEGMENT_LIST)?(t=c.SegmentList).hasOwnProperty(a.default.SEGMENT_TIMELINE)?f.segmentInfoType=a.default.SEGMENT_TIMELINE:f.segmentInfoType=a.default.SEGMENT_LIST:c.hasOwnProperty(a.default.SEGMENT_TEMPLATE)?((t=c.SegmentTemplate).hasOwnProperty(a.default.SEGMENT_TIMELINE)?f.segmentInfoType=a.default.SEGMENT_TIMELINE:f.segmentInfoType=a.default.SEGMENT_TEMPLATE,t.hasOwnProperty(a.default.INITIALIZATION_MINUS)&&(f.initialization=t.initialization.split("$Bandwidth$").join(c.bandwidth).split("$RepresentationID$").join(c.id))):f.segmentInfoType=a.default.BASE_URL,f.essentialProperties=F(c),t){if(t.hasOwnProperty(a.default.INITIALIZATION)){var d=t.Initialization;d.hasOwnProperty(a.default.SOURCE_URL)&&(f.initialization=d.sourceURL),d.hasOwnProperty(a.default.RANGE)&&(f.range=d.range)}else w(s)&&R(s)&&s.mimeType&&-1===s.mimeType.indexOf("application/mp4")&&(f.range=0);t.hasOwnProperty(a.default.TIMESCALE)&&(f.timescale=t.timescale),t.hasOwnProperty(a.default.DURATION)?f.segmentDuration=t.duration/f.timescale:c.hasOwnProperty(a.default.SEGMENT_TEMPLATE)&&(t=c.SegmentTemplate).hasOwnProperty(a.default.SEGMENT_TIMELINE)&&(f.segmentDuration=j(t.SegmentTimeline)/f.timescale),t.hasOwnProperty(a.default.MEDIA)&&(f.media=t.media),t.hasOwnProperty(a.default.START_NUMBER)&&(f.startNumber=t.startNumber),t.hasOwnProperty(a.default.INDEX_RANGE)&&(f.indexRange=t.indexRange),t.hasOwnProperty(a.default.PRESENTATION_TIME_OFFSET)&&(f.presentationTimeOffset=t.presentationTimeOffset/f.timescale),t.hasOwnProperty(a.default.AVAILABILITY_TIME_OFFSET)?f.availabilityTimeOffset=t.availabilityTimeOffset:r&&void 0!==r.availabilityTimeOffset&&(f.availabilityTimeOffset=r.availabilityTimeOffset),t.hasOwnProperty(a.default.AVAILABILITY_TIME_COMPLETE)?f.availabilityTimeComplete="false"!==t.availabilityTimeComplete:r&&void 0!==r.availabilityTimeComplete&&(f.availabilityTimeComplete=r.availabilityTimeComplete)}f.MSETimeOffset=x(f),f.path=[e.period.index,e.index,u],n.push(f)}}return n},getAdaptationsForPeriod:function(e){var r,i,o,u=e&&b(e.index)?e.mpd.manifest.Period_asArray[e.index]:null,l=[];if(u&&u.AdaptationSet_asArray)for(o=0;o<u.AdaptationSet_asArray.length;o++)i=u.AdaptationSet_asArray[o],r=new s.default,i.hasOwnProperty(a.default.ID)&&(r.id=i.id),r.index=o,r.period=e,N(i)?r.type=n.default.MUXED:I(i)?r.type=n.default.AUDIO:C(i)?r.type=n.default.VIDEO:w(i)?r.type=n.default.TEXT:D(i)?r.type=n.default.IMAGE:t.warn("Unknown Adaptation stream type"),l.push(r);return l},getRegularPeriods:function(e){var i,s,u=!!e&&L(e.manifest),l=[],c=null,f=null,d=null,h=null;for(s=0,i=e&&e.manifest&&e.manifest.Period_asArray?e.manifest.Period_asArray.length:0;s<i;s++)(f=e.manifest.Period_asArray[s]).hasOwnProperty(a.default.START)?(h=new o.default).start=f.start:null!==c&&c.hasOwnProperty(a.default.DURATION)&&null!==d?(h=new o.default).start=parseFloat((d.start+d.duration).toFixed(5)):0!==s||u||((h=new o.default).start=0),null!==d&&isNaN(d.duration)&&(null!==h?d.duration=parseFloat((h.start-d.start).toFixed(5)):t.warn("First period duration could not be calculated because lack of start and duration period properties. This will cause timing issues during playback")),null!==h&&(h.id=k(f,s),h.index=s,h.mpd=e,f.hasOwnProperty(a.default.DURATION)&&(h.duration=f.duration),d&&(d.nextPeriodId=h.id),l.push(h),c=f,d=h),f=null,h=null;return 0===l.length||null!==d&&isNaN(d.duration)&&(d.duration=parseFloat((function(e){!function(){if(!r||!r.hasOwnProperty("error"))throw new Error(n.default.MISSING_CONFIG_ERROR)}();var t,a=L(e.mpd.manifest);return e.mpd.manifest.mediaPresentationDuration?t=e.mpd.manifest.mediaPresentationDuration:e.duration?t=e.duration:a?t=Number.POSITIVE_INFINITY:r.error(new y.default(E.default.MANIFEST_ERROR_ID_PARSE_CODE,"Must have @mediaPresentationDuration on MPD or an explicit @duration on the last period.",e)),t}(d)-d.start).toFixed(5))),l},getMpd:function(e){var t=new u.default;return e&&(t.manifest=e,e.hasOwnProperty(a.default.AVAILABILITY_START_TIME)?t.availabilityStartTime=new Date(e.availabilityStartTime.getTime()):e.loadedTime&&(t.availabilityStartTime=new Date(e.loadedTime.getTime())),e.hasOwnProperty(a.default.AVAILABILITY_END_TIME)&&(t.availabilityEndTime=new Date(e.availabilityEndTime.getTime())),e.hasOwnProperty(a.default.MINIMUM_UPDATE_PERIOD)&&(t.minimumUpdatePeriod=e.minimumUpdatePeriod),e.hasOwnProperty(a.default.MEDIA_PRESENTATION_DURATION)&&(t.mediaPresentationDuration=e.mediaPresentationDuration),e.hasOwnProperty(a.default.SUGGESTED_PRESENTATION_DELAY)&&(t.suggestedPresentationDelay=e.suggestedPresentationDelay),e.hasOwnProperty(a.default.TIMESHIFT_BUFFER_DEPTH)&&(t.timeShiftBufferDepth=e.timeShiftBufferDepth),e.hasOwnProperty(a.default.MAX_SEGMENT_DURATION)&&(t.maxSegmentDuration=e.maxSegmentDuration),e.hasOwnProperty(a.default.PUBLISH_TIME)&&(t.publishTime=new Date(e.publishTime))),t},getEventsForPeriod:function(e){var t,r,i=e&&e.mpd&&e.mpd.manifest?e.mpd.manifest:null,s=i?i.Period_asArray:null,o=s&&e&&b(e.index)?s[e.index].EventStream_asArray:null,u=[];if(o)for(t=0;t<o.length;t++){var l=new d.default;if(l.period=e,l.timescale=1,!o[t].hasOwnProperty(n.default.SCHEME_ID_URI))throw new Error("Invalid EventStream. SchemeIdUri has to be set");for(l.schemeIdUri=o[t][n.default.SCHEME_ID_URI],o[t].hasOwnProperty(a.default.TIMESCALE)&&(l.timescale=o[t][a.default.TIMESCALE]),o[t].hasOwnProperty(a.default.VALUE)&&(l.value=o[t][a.default.VALUE]),o[t].hasOwnProperty(a.default.PRESENTATION_TIME_OFFSET)&&(l.presentationTimeOffset=o[t][a.default.PRESENTATION_TIME_OFFSET]),r=0;o[t].Event_asArray&&r<o[t].Event_asArray.length;r++){var f=o[t].Event_asArray[r],h=new c.default;if(h.presentationTime=0,h.eventStream=l,f.hasOwnProperty(a.default.PRESENTATION_TIME)){h.presentationTime=f.presentationTime;var g=l.presentationTimeOffset?l.presentationTimeOffset/l.timescale:0;h.calculatedPresentationTime=h.presentationTime/l.timescale+e.start-g}f.hasOwnProperty(a.default.DURATION)&&(h.duration=f.duration/l.timescale),f.hasOwnProperty(a.default.ID)&&(h.id=f.id),f.Signal&&f.Signal.Binary?h.messageData=p.decodeArray(f.Signal.Binary.toString()):h.messageData=f.messageData||f.__text,u.push(h)}}return u},getEssentialPropertiesForRepresentation:F,getEventStreamForAdaptationSet:function(e,t){var r,n,a;return e&&e.Period_asArray&&t&&t.period&&b(t.period.index)&&(n=e.Period_asArray[t.period.index])&&n.AdaptationSet_asArray&&b(t.index)&&(a=n.AdaptationSet_asArray[t.index])&&(r=a.InbandEventStream_asArray),B(r,null)},getEventStreamForRepresentation:function(e,t){var r,n,a,i;return e&&e.Period_asArray&&t&&t.adaptation&&t.adaptation.period&&b(t.adaptation.period.index)&&(n=e.Period_asArray[t.adaptation.period.index])&&n.AdaptationSet_asArray&&b(t.adaptation.index)&&(a=n.AdaptationSet_asArray[t.adaptation.index])&&a.Representation_asArray&&b(t.index)&&(i=a.Representation_asArray[t.index])&&(r=i.InbandEventStream_asArray),B(r,t)},getUTCTimingSources:function(e){var t=L(e),r=!!e&&e.hasOwnProperty(a.default.AVAILABILITY_START_TIME),i=e?e.UTCTiming_asArray:null,s=[];return(t||r)&&i&&i.forEach(function(e){var t=new l.default;e.hasOwnProperty(n.default.SCHEME_ID_URI)&&(t.schemeIdUri=e.schemeIdUri,e.hasOwnProperty(a.default.VALUE)&&(t.value=e.value.toString(),s.push(t)))}),s},getBaseURLsFromElement:U,getRepresentationSortFunction:function(){return function(e,t){return e.bandwidth-t.bandwidth}},getLocation:function(e){if(e&&e.hasOwnProperty(n.default.LOCATION))return e.Location=e.Location_asArray[0],e.Location},getPatchLocation:function(e){if(e&&e.hasOwnProperty(a.default.PATCH_LOCATION))return e.PatchLocation=e.PatchLocation_asArray[0],e.PatchLocation},getSuggestedPresentationDelay:function(e){return e&&e.hasOwnProperty(a.default.SUGGESTED_PRESENTATION_DELAY)?e.suggestedPresentationDelay:null},getAvailabilityStartTime:function(e){return e&&e.hasOwnProperty(a.default.AVAILABILITY_START_TIME)&&null!==e.availabilityStartTime?e.availabilityStartTime.getTime():null},getServiceDescriptions:function(e){var t=[];if(e&&e.hasOwnProperty(a.default.SERVICE_DESCRIPTION)){var r,i=v(e.ServiceDescription_asArray);try{for(i.s();!(r=i.n()).done;){var s=r.value,o=void 0,u=void 0,l=void 0,c=void 0;for(var f in s)s.hasOwnProperty(f)&&(f===a.default.ID?o=s[f]:f===a.default.SERVICE_DESCRIPTION_SCOPE?u=s[f].schemeIdUri:f===a.default.SERVICE_DESCRIPTION_LATENCY?l={target:s[f].target,max:s[f].max,min:s[f].min}:f===a.default.SERVICE_DESCRIPTION_PLAYBACK_RATE&&(c={max:s[f].max,min:s[f].min}));u===n.default.SERVICE_DESCRIPTION_LL_SCHEME&&(l||c)&&t.push({id:o,schemeIdUri:u,latency:l,playbackRate:c})}}catch(e){i.e(e)}finally{i.f()}}return t},getSupplementalProperties:function(e){var t={};if(e&&e.hasOwnProperty(a.default.SUPPLEMENTAL_PROPERTY)){var r,i=v(e.SupplementalProperty_asArray);try{for(i.s();!(r=i.n()).done;){var s=r.value;s.hasOwnProperty(n.default.SCHEME_ID_URI)&&s.hasOwnProperty(a.default.VALUE)&&(t[s[n.default.SCHEME_ID_URI]]=s[a.default.VALUE])}}catch(e){i.e(e)}finally{i.f()}}return t},setConfig:function(e){e&&(e.errHandler&&(r=e.errHandler),e.BASE64&&(p=e.BASE64))}},t=Object(m.default)(T).getInstance().getLogger(e),e}S.__dashjs_factory_name="DashManifestModel",t.default=p.default.getSingletonFactory(S)},"./src/dash/models/PatchManifestModel.js":function(e,t,r){r.r(t);var n=r("./src/dash/constants/DashConstants.js"),a=r("./src/core/FactoryMaker.js"),i=r("./src/core/Debug.js"),s=r("./src/dash/vo/SimpleXPath.js"),o=r("./src/dash/vo/PatchOperation.js");function u(){var e,t,r=this.context;return e={getIsPatch:function(e){return e&&e.hasOwnProperty(n.default.ORIGINAL_MPD_ID)||!1},getPublishTime:function(e){return e&&e.hasOwnProperty(n.default.PUBLISH_TIME)?new Date(e[n.default.PUBLISH_TIME]):null},getOriginalPublishTime:function(e){return e&&e.hasOwnProperty(n.default.ORIGINAL_PUBLISH_TIME)?new Date(e[n.default.ORIGINAL_PUBLISH_TIME]):null},getMpdId:function(e){return e&&e[n.default.ORIGINAL_MPD_ID]||null},getPatchOperations:function(e){return e?(e.__children||[]).map(function(e){var r=Object.keys(e)[0];if("add"!==r&&"remove"!==r&&"replace"!==r)return t.warn("Ignoring node of invalid action: ".concat(r)),null;var n=e[r],a=n.sel;if("add"===r&&n.type){if(!n.type.startsWith("@"))return t.warn("Ignoring add action for prefixed namespace declaration: ".concat(n.type,"=").concat(n.__text)),null;a="".concat(a,"/").concat(n.type)}var i=new s.default(a);if(!i.isValid())return t.warn("Ignoring action with invalid selector: ".concat(r," - ").concat(a)),null;var u=null;i.findsAttribute()?u=n.__text||"":"remove"!==r&&(u=n.__children.reduce(function(e,t){var r=Object.keys(t)[0];return"#text"!==r&&(e[r]=e[r]||[],e[r].push(t[r])),e},{}));var l=new o.default(r,i,u);return"add"===r&&(l.position=n.pos),l}).filter(function(e){return!!e}):[]}},t=Object(i.default)(r).getInstance().getLogger(e),e}u.__dashjs_factory_name="PatchManifestModel",t.default=a.default.getSingletonFactory(u)},"./src/dash/parser/DashParser.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/dash/parser/objectiron.js"),i=r("./externals/xml2json.js"),s=r("./src/dash/parser/matchers/StringMatcher.js"),o=r("./src/dash/parser/matchers/DurationMatcher.js"),u=r("./src/dash/parser/matchers/DateTimeMatcher.js"),l=r("./src/dash/parser/matchers/NumericMatcher.js"),c=r("./src/dash/parser/maps/RepresentationBaseValuesMap.js"),f=r("./src/dash/parser/maps/SegmentValuesMap.js");function d(e){e=e||{};var t,r,n,d,h,g=this.context,p=e.debug;return t={parse:function(e){var t,n=window.performance.now();if(!(t=d.xml_str2json(e)))throw new Error("parsing the manifest failed");var a=window.performance.now();t.Patch?((t=t.Patch).add_asArray&&t.add_asArray.forEach(function(e){return h.run(e)}),t.replace_asArray&&t.replace_asArray.forEach(function(e){return h.run(e)})):(t=t.MPD,h.run(t));var i=window.performance.now();return r.info("Parsing complete: ( xml2json: "+(a-n).toPrecision(3)+"ms, objectiron: "+(i-a).toPrecision(3)+"ms, total: "+((i-n)/1e3).toPrecision(3)+"s)"),t.protocol="DASH",t},getMatchers:function(){return n},getIron:function(){return h}},r=p.getLogger(t),n=[new o.default,new u.default,new l.default,new s.default],d=new i.default({escapeMode:!1,attributePrefix:"",arrayAccessForm:"property",emptyNodeForm:"object",stripWhitespaces:!1,enableToStringFunc:!0,ignoreRoot:!1,matchers:n}),h=Object(a.default)(g).create({adaptationset:new c.default,period:new f.default}),t}d.__dashjs_factory_name="DashParser",t.default=n.default.getClassFactory(d)},"./src/dash/parser/maps/CommonProperty.js":function(e,t,r){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}r.r(t);var a=function(){function e(t){var r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._name=t,this._merge=(r=t)&&r.length&&r.charAt(0)===r.charAt(0).toUpperCase()}var t,r;return t=e,(r=[{key:"name",get:function(){return this._name}},{key:"merge",get:function(){return this._merge}}])&&n(t.prototype,r),e}();t.default=a},"./src/dash/parser/maps/MapNode.js":function(e,t,r){r.r(t);var n=r("./src/dash/parser/maps/CommonProperty.js");function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var i=function(){function e(t,r,a){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._name=t||"",this._properties=[],this._children=a||[],Array.isArray(r)&&r.forEach(function(e){i._properties.push(new n.default(e))})}var t,r;return t=e,(r=[{key:"name",get:function(){return this._name}},{key:"children",get:function(){return this._children}},{key:"properties",get:function(){return this._properties}}])&&a(t.prototype,r),e}();t.default=i},"./src/dash/parser/maps/RepresentationBaseValuesMap.js":function(e,t,r){r.r(t);var n=r("./src/dash/parser/maps/MapNode.js"),a=r("./src/dash/constants/DashConstants.js");function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function s(e,t){return s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},s(e,t)}function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}var u=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(l,e);var t,r,u=(t=l,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=o(t);if(r){var a=o(this).constructor;e=Reflect.construct(n,arguments,a)}else e=n.apply(this,arguments);return function(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function l(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l);var e=[a.default.PROFILES,a.default.WIDTH,a.default.HEIGHT,a.default.SAR,a.default.FRAMERATE,a.default.AUDIO_SAMPLING_RATE,a.default.MIME_TYPE,a.default.SEGMENT_PROFILES,a.default.CODECS,a.default.MAXIMUM_SAP_PERIOD,a.default.START_WITH_SAP,a.default.MAX_PLAYOUT_RATE,a.default.CODING_DEPENDENCY,a.default.SCAN_TYPE,a.default.FRAME_PACKING,a.default.AUDIO_CHANNEL_CONFIGURATION,a.default.CONTENT_PROTECTION,a.default.ESSENTIAL_PROPERTY,a.default.SUPPLEMENTAL_PROPERTY,a.default.INBAND_EVENT_STREAM];return u.call(this,a.default.ADAPTATION_SET,e,[new n.default(a.default.REPRESENTATION,e,[new n.default(a.default.SUB_REPRESENTATION,e)])])}return l}(n.default);t.default=u},"./src/dash/parser/maps/SegmentValuesMap.js":function(e,t,r){r.r(t);var n=r("./src/dash/parser/maps/MapNode.js"),a=r("./src/dash/constants/DashConstants.js");function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function s(e,t){return s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},s(e,t)}function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}var u=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(l,e);var t,r,u=(t=l,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=o(t);if(r){var a=o(this).constructor;e=Reflect.construct(n,arguments,a)}else e=n.apply(this,arguments);return function(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function l(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l);var e=[a.default.SEGMENT_BASE,a.default.SEGMENT_TEMPLATE,a.default.SEGMENT_LIST];return u.call(this,a.default.PERIOD,e,[new n.default(a.default.ADAPTATION_SET,e,[new n.default(a.default.REPRESENTATION,e)])])}return l}(n.default);t.default=u},"./src/dash/parser/matchers/BaseMatcher.js":function(e,t,r){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}r.r(t);var a=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._test=t,this._converter=r}var t,r;return t=e,(r=[{key:"test",get:function(){return this._test}},{key:"converter",get:function(){return this._converter}}])&&n(t.prototype,r),e}();t.default=a},"./src/dash/parser/matchers/DateTimeMatcher.js":function(e,t,r){r.r(t);var n=r("./src/dash/parser/matchers/BaseMatcher.js");function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}var o=/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2})(?::([0-9]*)(\.[0-9]*)?)?(?:([+-])([0-9]{2})(?::?)([0-9]{2}))?/,u=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(u,e);var t,r,n=(t=u,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=s(t);if(r){var i=s(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return function(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function u(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),n.call(this,function(e){return o.test(e.value)},function(e){var t,r=o.exec(e);if(t=Date.UTC(parseInt(r[1],10),parseInt(r[2],10)-1,parseInt(r[3],10),parseInt(r[4],10),parseInt(r[5],10),r[6]&&parseInt(r[6],10)||0,r[7]&&1e3*parseFloat(r[7])||0),r[9]&&r[10]){var n=60*parseInt(r[9],10)+parseInt(r[10],10);t+=("+"===r[8]?-1:1)*n*60*1e3}return new Date(t)})}return u}(n.default);t.default=u},"./src/dash/parser/matchers/DurationMatcher.js":function(e,t,r){r.r(t);var n=r("./src/dash/parser/matchers/BaseMatcher.js"),a=r("./src/streaming/constants/Constants.js"),i=r("./src/dash/constants/DashConstants.js");function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function o(e,t){return o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},o(e,t)}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}var l=/^([-])?P(([\d.]*)Y)?(([\d.]*)M)?(([\d.]*)D)?T?(([\d.]*)H)?(([\d.]*)M)?(([\d.]*)S)?/,c=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(c,e);var t,r,n=(t=c,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=u(t);if(r){var a=u(this).constructor;e=Reflect.construct(n,arguments,a)}else e=n.apply(this,arguments);return function(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function c(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),n.call(this,function(e){for(var t=[i.default.MIN_BUFFER_TIME,i.default.MEDIA_PRESENTATION_DURATION,i.default.MINIMUM_UPDATE_PERIOD,i.default.TIMESHIFT_BUFFER_DEPTH,i.default.MAX_SEGMENT_DURATION,i.default.MAX_SUBSEGMENT_DURATION,i.default.SUGGESTED_PRESENTATION_DELAY,i.default.START,a.default.START_TIME,i.default.DURATION],r=t.length,n=0;n<r;n++)if(e.nodeName===t[n])return l.test(e.value);return!1},function(e){var t=l.exec(e),r=31536e3*parseFloat(t[3]||0)+2592e3*parseFloat(t[5]||0)+86400*parseFloat(t[7]||0)+3600*parseFloat(t[9]||0)+60*parseFloat(t[11]||0)+parseFloat(t[13]||0);return void 0!==t[1]&&(r=-r),r})}return c}(n.default);t.default=c},"./src/dash/parser/matchers/NumericMatcher.js":function(e,t,r){r.r(t);var n=r("./src/dash/parser/matchers/BaseMatcher.js");function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}var o=/^[-+]?[0-9]+[.]?[0-9]*([eE][-+]?[0-9]+)?$/,u=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(u,e);var t,r,n=(t=u,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=s(t);if(r){var i=s(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return function(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function u(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),n.call(this,function(e){return o.test(e.value)},function(e){return parseFloat(e)})}return u}(n.default);t.default=u},"./src/dash/parser/matchers/StringMatcher.js":function(e,t,r){r.r(t);var n=r("./src/dash/parser/matchers/BaseMatcher.js"),a=r("./src/dash/constants/DashConstants.js");function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){return o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},o(e,t)}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}var l=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(l,e);var t,r,n=(t=l,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=u(t);if(r){var a=u(this).constructor;e=Reflect.construct(n,arguments,a)}else e=n.apply(this,arguments);return function(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function l(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),n.call(this,function(e,t){var r,n=(s(r={},a.default.MPD,[a.default.ID,a.default.PROFILES]),s(r,a.default.PERIOD,[a.default.ID]),s(r,a.default.BASE_URL,[a.default.SERVICE_LOCATION,a.default.BYTE_RANGE]),s(r,a.default.SEGMENT_BASE,[a.default.INDEX_RANGE]),s(r,a.default.INITIALIZATION,[a.default.RANGE]),s(r,a.default.REPRESENTATION_INDEX,[a.default.RANGE]),s(r,a.default.SEGMENT_LIST,[a.default.INDEX_RANGE]),s(r,a.default.BITSTREAM_SWITCHING,[a.default.RANGE]),s(r,a.default.SEGMENT_URL,[a.default.MEDIA_RANGE,a.default.INDEX_RANGE]),s(r,a.default.SEGMENT_TEMPLATE,[a.default.INDEX_RANGE,a.default.MEDIA,a.default.INDEX,a.default.INITIALIZATION_MINUS,a.default.BITSTREAM_SWITCHING_MINUS]),s(r,a.default.ASSET_IDENTIFIER,[a.default.VALUE,a.default.ID]),s(r,a.default.EVENT_STREAM,[a.default.VALUE]),s(r,a.default.ADAPTATION_SET,[a.default.PROFILES,a.default.MIME_TYPE,a.default.SEGMENT_PROFILES,a.default.CODECS,a.default.CONTENT_TYPE]),s(r,a.default.FRAME_PACKING,[a.default.VALUE,a.default.ID]),s(r,a.default.AUDIO_CHANNEL_CONFIGURATION,[a.default.VALUE,a.default.ID]),s(r,a.default.CONTENT_PROTECTION,[a.default.VALUE,a.default.ID]),s(r,a.default.ESSENTIAL_PROPERTY,[a.default.VALUE,a.default.ID]),s(r,a.default.SUPPLEMENTAL_PROPERTY,[a.default.VALUE,a.default.ID]),s(r,a.default.INBAND_EVENT_STREAM,[a.default.VALUE,a.default.ID]),s(r,a.default.ACCESSIBILITY,[a.default.VALUE,a.default.ID]),s(r,a.default.ROLE,[a.default.VALUE,a.default.ID]),s(r,a.default.RATING,[a.default.VALUE,a.default.ID]),s(r,a.default.VIEWPOINT,[a.default.VALUE,a.default.ID]),s(r,a.default.CONTENT_COMPONENT,[a.default.CONTENT_TYPE]),s(r,a.default.REPRESENTATION,[a.default.ID,a.default.DEPENDENCY_ID,a.default.MEDIA_STREAM_STRUCTURE_ID]),s(r,a.default.SUBSET,[a.default.ID]),s(r,a.default.METRICS,[a.default.METRICS_MINUS]),s(r,a.default.REPORTING,[a.default.VALUE,a.default.ID]),r);if(n.hasOwnProperty(t)){var i=n[t];return void 0!==i&&i.indexOf(e.name)>=0}return!1},function(e){return String(e)})}return l}(n.default);t.default=l},"./src/dash/parser/objectiron.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js");function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function i(e){function t(e,t){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}function r(e,r,n){for(var i=0,s=e.length;i<s;++i){var o=e[i];if(r[o.name])if(n[o.name]){if(o.merge){var u=r[o.name],l=n[o.name];"object"===a(u)&&"object"===a(l)?t(u,l):n[o.name]=u+l}}else n[o.name]=r[o.name]}}function n(e,t){for(var a=0,i=e.children.length;a<i;++a){var s=e.children[a],o=t[s.name+"_asArray"];if(o)for(var u=0,l=o.length;u<l;++u){var c=o[u];r(e.properties,t,c),n(s,c)}}}return{run:function(t){if(null===t||"object"!==a(t))return t;if(t.Period_asArray&&"period"in e)for(var r=e.period,i=t.Period_asArray,s=0,o=i.length;s<o;++s){var u=i[s];if(n(r,u),"adaptationset"in e){var l=u.AdaptationSet_asArray;if(l)for(var c=e.adaptationset,f=0,d=l.length;f<d;++f)n(c,l[f])}}return t}}}i.__dashjs_factory_name="ObjectIron";var s=n.default.getClassFactory(i);t.default=s},"./src/dash/utils/ListSegmentsGetter.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/streaming/constants/Constants.js"),i=r("./src/dash/utils/SegmentsUtils.js");function s(e,t){var r=(e=e||{}).timelineConverter;function n(){if(!r||!r.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(a.default.MISSING_CONFIG_ERROR)}function s(e,a){if(n(),!e)return null;var s=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList,o=s.SegmentURL_asArray.length,u=e&&!isNaN(e.startNumber)?e.startNumber:1,l=Math.max(u-1,0),c=Math.max(a-l,0),f=null;if(c<o){var d=s.SegmentURL_asArray[c];(f=Object(i.getIndexBasedSegment)(r,t,e,a))&&(f.replacementTime=(u+a-1)*e.segmentDuration,f.media=d.media?d.media:"",f.mediaRange=d.mediaRange,f.indexRange=d.indexRange)}return f}return{getSegmentByIndex:s,getSegmentByTime:function(e,t){if(n(),!e)return null;var a=e.segmentDuration;if(isNaN(a))return null;var i=r.calcPeriodRelativeTimeFromMpdRelativeTime(e,t);return s(e,Math.floor(i/a))},getMediaFinishedInformation:function(e){var t={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};if(!e)return t;var r=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList,n=e&&!isNaN(e.startNumber)?e.startNumber:1,a=Math.max(n-1,0);return t.numberOfSegments=a+r.SegmentURL_asArray.length,t}}}s.__dashjs_factory_name="ListSegmentsGetter";var o=n.default.getClassFactory(s);t.default=o},"./src/dash/utils/Round10.js":function(e,t,r){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}r.r(t),r.d(t,"default",function(){return a});var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,r;return t=e,r=[{key:"round10",value:function(e,t){return function(e,t,r){return void 0===r||0===+r?Math[e](t):(r=+r,null===(t=+t)||isNaN(t)||"number"!=typeof r||r%1!=0?NaN:(t=t.toString().split("e"),+((t=(t=Math[e](+(t[0]+"e"+(t[1]?+t[1]-r:-r)))).toString().split("e"))[0]+"e"+(t[1]?+t[1]+r:r))))}("round",e,t)}}],null&&n(t.prototype,null),r&&n(t,r),e}()},"./src/dash/utils/SegmentBaseGetter.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/streaming/constants/Constants.js");function i(e){var t=(e=e||{}).timelineConverter;function r(){if(!t||!t.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(a.default.MISSING_CONFIG_ERROR)}function n(e,t){if(r(),!e)return null;var n,a=e.segments?e.segments.length:-1;if(t<a&&(n=e.segments[t])&&n.index===t)return n;for(var i=0;i<a;i++)if((n=e.segments[i])&&n.index===t)return n;return null}return{getSegmentByIndex:n,getSegmentByTime:function(e,t){r();var a=function(e,t){if(!e)return-1;var r,n,a,i,s,o=e.segments,u=o?o.length:null,l=-1;if(o&&u>0)for(s=0;s<u;s++)if(a=(n=o[s]).presentationStartTime,t+(r=(i=n.duration)/2)>=a&&t-r<a+i){l=n.index;break}return l}(e,t);return n(e,a)},getMediaFinishedInformation:function(e){var t={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};return e&&e.segments?(t.numberOfSegments=e.segments.length,t):t}}}i.__dashjs_factory_name="SegmentBaseGetter";var s=n.default.getClassFactory(i);t.default=s},"./src/dash/utils/SegmentsUtils.js":function(e,t,r){r.r(t),r.d(t,"unescapeDollarsInTemplate",function(){return i}),r.d(t,"replaceIDForTemplate",function(){return s}),r.d(t,"replaceTokenForTemplate",function(){return o}),r.d(t,"getIndexBasedSegment",function(){return c}),r.d(t,"getTimeBasedSegment",function(){return f});var n=r("./src/dash/vo/Segment.js");function a(e,t){for(;e.length<t;)e="0"+e;return e}function i(e){return e?e.split("$$").join("$"):e}function s(e,t){if(!t||!e||-1===e.indexOf("$RepresentationID$"))return e;var r=t.toString();return e.split("$RepresentationID$").join(r)}function o(e,t,r){var n,i,s,o,u,l,c=t.length;if(!e)return e;for(;;){if((n=e.indexOf("$"+t))<0)return e;if((i=e.indexOf("$",n+c))<0)return e;if((s=e.indexOf("%0",n+c))>n&&s<i)switch(o=e.charAt(i-1),u=parseInt(e.substring(s+2,i-1),10),o){case"d":case"i":case"u":l=a(r.toString(),u);break;case"x":l=a(r.toString(16),u);break;case"X":l=a(r.toString(16),u).toUpperCase();break;case"o":l=a(r.toString(8),u);break;default:return e}else l=r;e=e.substring(0,n)+l+e.substring(i+1)}}function u(e,t,r,a,i,s,o,u){var l,c=new n.default;return c.representation=e,c.duration=t,c.presentationStartTime=r,c.mediaStartTime=a,c.availabilityStartTime=i.calcAvailabilityStartTimeFromPresentationTime(s,e,o),c.availabilityEndTime=i.calcAvailabilityEndTimeFromPresentationTime(s+t,e,o),c.wallStartTime=i.calcWallTimeForSegment(c,o),c.replacementNumber=(l=u,c.representation.startNumber+l),c.index=u,c}function l(e,t,r,n){var a=t.adaptation.period;if(isFinite(a.duration)&&a.start+a.duration<=r.presentationStartTime)return!1;if(n){if("INF"===t.availabilityTimeOffset)return!0;var i=e.getClientReferenceTime();return r.availabilityStartTime.getTime()<=i&&(!isFinite(r.availabilityEndTime)||r.availabilityEndTime.getTime()>=i)}return!0}function c(e,t,r,n){var a,i,s;a=r.segmentDuration,isNaN(a)&&(a=r.adaptation.period.duration),i=parseFloat((r.adaptation.period.start+n*a).toFixed(5)),s=parseFloat((i+a).toFixed(5));var o=u(r,a,i,e.calcMediaTimeFromPresentationTime(i,r),e,s,t,n);return l(e,r,o,t)?o:null}function f(e,t,r,n,a,i,s,c,f,d){var h,g,p=n/i,m=a/i;return h=e.calcPresentationTimeFromMediaTime(p,r),l(e,r,g=u(r,m,h,p,e,h+m,t,f),t)?(g.replacementTime=d||n,s=o(s,"Number",g.replacementNumber),s=o(s,"Time",g.replacementTime),g.media=s,g.mediaRange=c,g):null}},"./src/dash/utils/TemplateSegmentsGetter.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/streaming/constants/Constants.js"),i=r("./src/dash/utils/SegmentsUtils.js");function s(e,t){var r=(e=e||{}).timelineConverter;function n(){if(!r||!r.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(a.default.MISSING_CONFIG_ERROR)}function s(e,a){if(n(),!e)return null;var s=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentTemplate;a=Math.max(a,0);var o=Object(i.getIndexBasedSegment)(r,t,e,a);if(o){o.replacementTime=Math.round((a-1)*e.segmentDuration*e.timescale,10);var u=s.media;u=Object(i.replaceTokenForTemplate)(u,"Number",o.replacementNumber),u=Object(i.replaceTokenForTemplate)(u,"Time",o.replacementTime),o.media=u}return o}return{getSegmentByIndex:s,getSegmentByTime:function(e,t){if(n(),!e)return null;var a=e.segmentDuration;if(isNaN(a))return null;var i=r.calcPeriodRelativeTimeFromMpdRelativeTime(e,t);return s(e,Math.floor(i/a))},getMediaFinishedInformation:function(e){var t={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};if(!e)return t;var r=e.segmentDuration;return isNaN(r)?t.numberOfSegments=1:t.numberOfSegments=Math.ceil(e.adaptation.period.duration/r),t}}}s.__dashjs_factory_name="TemplateSegmentsGetter";var o=n.default.getClassFactory(s);t.default=o},"./src/dash/utils/TimelineConverter.js":function(e,t,r){r.r(t);var n=r("./src/core/EventBus.js"),a=r("./src/core/events/Events.js"),i=r("./src/core/FactoryMaker.js"),s=r("./src/dash/constants/DashConstants.js"),o=r("./src/dash/models/DashManifestModel.js"),u=r("./src/core/Settings.js"),l=r("./src/streaming/constants/Constants.js"),c=r("./src/streaming/MediaPlayerEvents.js"),f=r("./src/streaming/constants/ConformanceViolationConstants.js");function d(){var e,t,r,i,d=this.context,h=Object(n.default)(d).getInstance(),g=Object(u.default)(d).getInstance();function p(e){i=e}function m(e,t,r,n){var a,i=t.adaptation.period.mpd,s=i.availabilityStartTime;if(n)a=r&&i.timeShiftBufferDepth!==Number.POSITIVE_INFINITY?new Date(s.getTime()+1e3*(e+i.timeShiftBufferDepth)):i.availabilityEndTime;else if(r){var o=t.availabilityTimeOffset;a=new Date(s.getTime()+1e3*(e-o))}else a=s;return a}function y(e,t){return(e.getTime()-t.mpd.availabilityStartTime.getTime()+1e3*i)/1e3}function E(e,t){return e+(t.adaptation.period.start-t.presentationTimeOffset)}function _(e){var r={start:NaN,end:NaN},n=e[0].getAdapter().getRegularPeriods()[0],a=y(new Date,n);if(!e||0===e.length)return{range:r,now:a};e.forEach(function(e){var n=e.getAdapter(),i=n.getMediaInfoForType(e.getStreamInfo(),l.default.VIDEO)||n.getMediaInfoForType(e.getStreamInfo(),l.default.AUDIO),o=n.getVoRepresentations(i)[0],u={start:NaN,end:NaN};if(o)if(o.segmentInfoType===s.default.SEGMENT_TIMELINE)u=function(e){var r,n,a,i,s=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index],o=t.getRepresentationFor(e.index,s),u=o.SegmentTemplate.SegmentTimeline,l=o.SegmentTemplate.timescale,c=u.S_asArray,f={start:0,end:0},d=0;for(f.start=E(c[0].t/l,e),a=0,i=c.length;a<i;a++)n=0,(r=c[a]).hasOwnProperty("r")&&(n=r.r),d+=r.d/l*(1+n);return f.end=f.start+d,f}(o);else{var c=o.adaptation.period;u.start=c.start,u.end=Math.max(a,c.start+c.duration)}!isNaN(u.start)&&(isNaN(r.start)||r.start>u.start)&&(r.start=u.start),!isNaN(u.end)&&(isNaN(r.end)||r.end<u.end)&&(r.end=u.end)}),r.end=Math.min(a,r.end);var i=T(e,r.end,!0);return r.end=isNaN(i)?r.end:i,r.start=n&&n.mpd&&n.mpd.timeShiftBufferDepth&&!isNaN(n.mpd.timeShiftBufferDepth)&&!isNaN(r.end)?Math.max(r.end-n.mpd.timeShiftBufferDepth,r.start):r.start,r.start=T(e,r.start),{range:r,now:a}}function v(e,t){r=e-t.end}function T(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{for(var n=0,a=!1,i=NaN;!a&&n<e.length;){var s=e[n].getStreamInfo();s.start<=t&&(!isFinite(s.duration)||s.start+s.duration>=t)?(i=t,a=!0):!r&&s.start>t&&(isNaN(i)||s.start<i)?i=s.start:r&&s.start+s.duration<t&&(isNaN(i)||s.start+s.duration>i)&&(i=s.start+s.duration),n+=1}return i}catch(e){return t}}function S(e){void 0===e.offset||isNaN(e.offset)||p(e.offset/1e3)}function b(){i=0,r=0}function A(){h.off(a.default.UPDATE_TIME_SYNC_OFFSET,S,this),b()}return e={initialize:function(){b(),h.on(a.default.UPDATE_TIME_SYNC_OFFSET,S,this)},getClientTimeOffset:function(){return i},setClientTimeOffset:p,getClientReferenceTime:function(){return Date.now()-1e3*r+1e3*i},calcAvailabilityStartTimeFromPresentationTime:function(e,t,r){return m(e,t,r)},calcAvailabilityEndTimeFromPresentationTime:function(e,t,r){return m(e,t,r,!0)},calcPresentationTimeFromWallTime:y,calcPresentationTimeFromMediaTime:E,calcPeriodRelativeTimeFromMpdRelativeTime:function(e,t){return t-e.adaptation.period.start},calcMediaTimeFromPresentationTime:function(e,t){return e-t.adaptation.period.start+t.presentationTimeOffset},calcWallTimeForSegment:function(e,t){var r,n,a;return t&&(r=e.representation.adaptation.period.mpd.suggestedPresentationDelay,n=e.presentationStartTime+r,a=new Date(e.availabilityStartTime.getTime()+1e3*n)),a},calcTimeShiftBufferWindow:function(e,t){if(!t)return function(e){var t={start:NaN,end:NaN},r=0,n=NaN;return e.forEach(function(e){var t=e.getStreamInfo();r+=t.duration,(isNaN(n)||t.start<n)&&(n=t.start)}),t.start=n,t.end=n+r,t}(e);if(g.get().streaming.timeShiftBuffer.calcFromSegmentTimeline){var r=_(e);return v(r.now,r.range),r.range}return function(e){var t={start:NaN,end:NaN};if(!e||0===e.length)return t;var r=e[0].getAdapter().getRegularPeriods()[0],n=y(new Date,r),a=r.mpd.timeShiftBufferDepth,i=isNaN(a)?0:n-a;if(t.start=T(e,i),t.end=!isNaN(t.start)&&n<t.start?n:T(e,n,!0),!isNaN(a)&&t.end<n-a&&(t.end=NaN),g.get().streaming.timeShiftBuffer.fallbackToSegmentTimeline){var s=_(e);if(s.range.end<t.start)return h.trigger(c.default.CONFORMANCE_VIOLATION,{level:f.default.LEVELS.WARNING,event:f.default.EVENTS.INVALID_DVR_WINDOW}),v(s.now,s.range),s.range}return t}(e)},reset:A},t=Object(o.default)(d).getInstance(),A(),e}d.__dashjs_factory_name="TimelineConverter",t.default=i.default.getSingletonFactory(d)},"./src/dash/utils/TimelineSegmentsGetter.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/streaming/constants/Constants.js"),i=r("./src/dash/utils/SegmentsUtils.js");function s(e,t){var r=(e=e||{}).timelineConverter,n=e.dashMetrics;function s(){if(!r)throw new Error(a.default.MISSING_CONFIG_ERROR)}function o(e,t){var r,n,a,i,s,o,l,c=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentTemplate||e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList,f=c.SegmentTimeline,d=c.SegmentURL_asArray,h=0,g=0,p=-1;l=e.timescale;var m=!1;for(a=0,i=(r=f.S_asArray).length;a<i&&!m;a++)for(o=0,(n=r[a]).hasOwnProperty("r")&&(o=n.r),n.hasOwnProperty("t")&&(g=(h=n.t)/l),o<0&&(o=u(e,r[a+1],n,l,g)),s=0;s<=o&&!m;s++)(m=t(h,g,c,d,n,l,++p,a))&&(e.segmentDuration=n.d/l),g=(h+=n.d)/l}function u(e,t,a,i,s){var o;if(t&&t.hasOwnProperty("t"))o=t.t/i;else try{var u=0;if(isNaN(e.adaptation.period.start)||isNaN(e.adaptation.period.duration)||!isFinite(e.adaptation.period.duration)){var l=n.getCurrentDVRInfo();u=isNaN(l.end)?0:l.end}else u=e.adaptation.period.start+e.adaptation.period.duration;o=r.calcMediaTimeFromPresentationTime(u,e),e.segmentDuration=a.d/i}catch(e){o=0}return Math.max(Math.ceil((o-s)/(a.d/i))-1,0)}return{getSegmentByIndex:function(e,n,a){if(s(),!e)return null;var u=null,l=!1;return o(e,function(n,s,o,c,f,d,h,g){if(l||a<0){var p=o.media,m=f.mediaRange;return c&&(p=c[g].media||"",m=c[g].mediaRange),u=Object(i.getTimeBasedSegment)(r,t,e,n,f.d,d,p,m,h,f.tManifest),!0}return s>=a-.5*f.d/d&&(l=!0),!1}),u},getSegmentByTime:function(e,n){if(s(),!e)return null;void 0===n&&(n=null);var a=null,u=r.calcMediaTimeFromPresentationTime(n,e);return o(e,function(n,s,o,l,c,f,d,h){if(u<s+c.d/f){var g=o.media,p=c.mediaRange;return l&&(g=l[h].media||"",p=l[h].mediaRange),a=Object(i.getTimeBasedSegment)(r,t,e,n,c.d,f,g,p,d,c.tManifest),!0}return!1}),a},getMediaFinishedInformation:function(e){if(!e)return 0;var t,r,n,a,i,s,o,l=(e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentTemplate||e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList).SegmentTimeline,c=0,f=0,d=0;for(o=e.timescale,a=(t=l.S_asArray).length,n=0;n<a;n++)for(s=0,(r=t[n]).hasOwnProperty("r")&&(s=r.r),r.hasOwnProperty("t")&&(f=(c=r.t)/o),s<0&&(s=u(e,t[n+1],r,o,f)),i=0;i<=s;i++)d++,f=(c+=r.d)/o;return{numberOfSegments:d,mediaTimeOfLastSignaledSegment:f}}}}s.__dashjs_factory_name="TimelineSegmentsGetter";var o=n.default.getClassFactory(s);t.default=o},"./src/dash/vo/AdaptationSet.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.period=null,this.index=-1,this.type=null}},"./src/dash/vo/BaseURL.js":function(e,t,r){r.r(t);var n=function e(t,r,n,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t||"",this.serviceLocation=r||t||"",this.dvb_priority=n||1,this.dvb_weight=a||1,this.availabilityTimeOffset=0,this.availabilityTimeComplete=!0};n.DEFAULT_DVB_PRIORITY=1,n.DEFAULT_DVB_WEIGHT=1,t.default=n},"./src/dash/vo/Event.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.duration=NaN,this.presentationTime=NaN,this.id=NaN,this.messageData="",this.eventStream=null,this.presentationTimeDelta=NaN}},"./src/dash/vo/EventStream.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.adaptionSet=null,this.representation=null,this.period=null,this.timescale=1,this.value="",this.schemeIdUri="",this.presentationTimeOffset=0}},"./src/dash/vo/ManifestInfo.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.dvrWindowSize=NaN,this.loadedTime=null,this.availableFrom=null,this.minBufferTime=NaN,this.duration=NaN,this.isDynamic=!1,this.maxFragmentDuration=null}},"./src/dash/vo/MediaInfo.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=null,this.type=null,this.streamInfo=null,this.representationCount=0,this.labels=null,this.lang=null,this.viewpoint=null,this.accessibility=null,this.audioChannelConfiguration=null,this.roles=null,this.codec=null,this.mimeType=null,this.contentProtection=null,this.KID=null,this.bitrateList=null,this.isFragmented=null,this.isEmbedded=null,this.selectionPriority=1}},"./src/dash/vo/Mpd.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.manifest=null,this.suggestedPresentationDelay=0,this.availabilityStartTime=null,this.availabilityEndTime=Number.POSITIVE_INFINITY,this.timeShiftBufferDepth=Number.POSITIVE_INFINITY,this.maxSegmentDuration=Number.POSITIVE_INFINITY,this.publishTime=null,this.minimumUpdatePeriod=NaN,this.mediaPresentationDuration=NaN}},"./src/dash/vo/PatchOperation.js":function(e,t,r){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}r.r(t);var a=function(){function e(t,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.action=t,this.xpath=r,this.value=n,this.position=null}var t,r;return t=e,(r=[{key:"getMpdTarget",value:function(e){var t="remove"===this.action||"replace"===this.action||"before"===this.position||"after"===this.position;return this.xpath.getMpdTarget(e,t)}}])&&n(t.prototype,r),e}();t.default=a},"./src/dash/vo/Period.js":function(e,t,r){r.r(t);var n=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=-1,this.duration=NaN,this.start=NaN,this.mpd=null,this.nextPeriodId=null};n.DEFAULT_ID="defaultId",t.default=n},"./src/dash/vo/Representation.js":function(e,t,r){r.r(t);var n=r("./src/dash/constants/DashConstants.js");function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=-1,this.adaptation=null,this.segmentInfoType=null,this.initialization=null,this.codecs=null,this.mimeType=null,this.codecPrivateData=null,this.segmentDuration=NaN,this.timescale=1,this.startNumber=1,this.indexRange=null,this.range=null,this.presentationTimeOffset=0,this.MSETimeOffset=NaN,this.mediaFinishedInformation={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN},this.bandwidth=NaN,this.width=NaN,this.height=NaN,this.scanType=null,this.maxPlayoutRate=NaN,this.availabilityTimeOffset=0,this.availabilityTimeComplete=!0}var t,r;return t=e,(r=[{key:"hasInitialization",value:function(){return null!==this.initialization||null!==this.range}},{key:"hasSegments",value:function(){return this.segmentInfoType!==n.default.BASE_URL&&this.segmentInfoType!==n.default.SEGMENT_BASE&&!this.indexRange}}])&&a(t.prototype,r),e}();t.default=i},"./src/dash/vo/RepresentationInfo.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.quality=null,this.fragmentDuration=null,this.mediaInfo=null,this.MSETimeOffset=null}},"./src/dash/vo/Segment.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.indexRange=null,this.index=null,this.mediaRange=null,this.media=null,this.duration=NaN,this.replacementTime=null,this.replacementNumber=NaN,this.mediaStartTime=NaN,this.presentationStartTime=NaN,this.availabilityStartTime=NaN,this.availabilityEndTime=NaN,this.wallStartTime=NaN,this.representation=null}},"./src/dash/vo/SimpleXPath.js":function(e,t,r){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}r.r(t);var a=function(){function e(t){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.valid="/"==t[0],this.path=t.split("/").filter(function(e){return 0!==e.length}).map(function(e){var t={name:e},n=e.indexOf("[");if(-1!=n){t.name=e.substring(0,n);var a=e.substring(n+1,e.length-1);r.valid=r.valid&&-1==a.indexOf("[");var i=a.indexOf("=");-1!=i?(t.attribute={name:a.substring(1,i),value:a.substring(i+1)},-1!=["'",'"'].indexOf(t.attribute.value[0])&&(t.attribute.value=t.attribute.value.substring(1,t.attribute.value.length-1))):t.position=parseInt(a,10)-1}return t})}var t,r;return t=e,(r=[{key:"isValid",value:function(){return this.valid}},{key:"findsElement",value:function(){return!this.findsAttribute()}},{key:"findsAttribute",value:function(){return this.path[this.path.length-1].name.startsWith("@")}},{key:"getMpdTarget",value:function(e,t){for(var r=null,n=e,a=1,i="MPD";a<this.path.length&&null!==n;){r=n;var s=this.path[a];if(i=s.name,a!==this.path.length-1||!i.startsWith("@")){var o=r[i+"_asArray"]||[];0===o.length&&r[i]&&o.push(r[i]),s.position?n=o[s.position]||null:s.attribute?function(){var e=s.attribute;n=o.filter(function(t){return t[e.name]==e.value})[0]||null}():n=o[0]||null}a++}return null===n?null:i.startsWith("@")?{name:i.substring(1),leaf:n,target:n}:{name:i,leaf:n,target:t?r:n}}}])&&n(t.prototype,r),e}();t.default=a},"./src/dash/vo/StreamInfo.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=null,this.start=NaN,this.duration=NaN,this.manifestInfo=null,this.isLast=!0}},"./src/dash/vo/UTCTiming.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.schemeIdUri="",this.value=""}},"./src/streaming/FragmentLoader.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/Constants.js"),a=r("./src/streaming/net/URLLoader.js"),i=r("./src/streaming/vo/HeadRequest.js"),s=r("./src/streaming/vo/DashJSError.js"),o=r("./src/core/FactoryMaker.js");function u(e){e=e||{};var t,r,o=this.context,u=e.eventBus,l=e.events,c=e.urlUtils,f=e.errors,d=e.streamId;return t={checkForExistence:function(e){var t=function(t){u.trigger(l.CHECK_FOR_EXISTENCE_COMPLETED,{request:e,exists:t})};if(e){var n=new i.default(e.url);r.load({request:n,success:function(){t(!0)},error:function(){t(!1)}})}else t(!1)},load:function(e){var n=function(r,n){u.trigger(l.LOADING_COMPLETED,{request:e,response:r||null,error:n||null,sender:t})};e?r.load({request:e,progress:function(r){u.trigger(l.LOADING_PROGRESS,{request:e,stream:r.stream,streamId:d}),r.data&&u.trigger(l.LOADING_DATA_PROGRESS,{request:e,response:r.data||null,error:null,sender:t})},success:function(e){n(e)},error:function(e,t,r){n(void 0,new s.default(f.FRAGMENT_LOADER_LOADING_FAILURE_ERROR_CODE,r,t))},abort:function(e){e&&u.trigger(l.LOADING_ABANDONED,{mediaType:e.mediaType,request:e,sender:t})}}):n(void 0,new s.default(f.FRAGMENT_LOADER_NULL_REQUEST_ERROR_CODE,f.FRAGMENT_LOADER_NULL_REQUEST_ERROR_MESSAGE))},abort:function(){r&&r.abort()},reset:function(){r&&(r.abort(),r=null)}},r=Object(a.default)(o).create({errHandler:e.errHandler,errors:f,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,urlUtils:c,constants:n.default,boxParser:e.boxParser,dashConstants:e.dashConstants,requestTimeout:e.settings.get().streaming.fragmentRequestTimeout}),t}u.__dashjs_factory_name="FragmentLoader",t.default=o.default.getClassFactory(u)},"./src/streaming/ManifestLoader.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/Constants.js"),a=r("./src/dash/constants/DashConstants.js"),i=r("./src/streaming/controllers/XlinkController.js"),s=r("./src/streaming/net/URLLoader.js"),o=r("./src/streaming/utils/URLUtils.js"),u=r("./src/streaming/vo/TextRequest.js"),l=r("./src/streaming/vo/DashJSError.js"),c=r("./src/streaming/vo/metrics/HTTPRequest.js"),f=r("./src/core/EventBus.js"),d=r("./src/core/events/Events.js"),h=r("./src/core/errors/Errors.js"),g=r("./src/core/FactoryMaker.js"),p=r("./src/dash/parser/DashParser.js");function m(e){e=e||{};var t,r,g,m,y,E=this.context,_=e.debug,v=Object(f.default)(E).getInstance(),T=Object(o.default)(E).getInstance(),S=e.mssHandler,b=e.errHandler;function A(e){v.trigger(d.default.INTERNAL_MANIFEST_LOADED,{manifest:e.manifest})}return t={load:function(e){var t=new u.default(e,c.HTTPRequest.MPD_TYPE);g.load({request:t,success:function(t,a,i){var s,o,u;if(m)if(i&&i!==e?(o=T.parseBaseUrl(i),s=i):(T.isRelative(e)&&(e=T.resolve(e,window.location.href)),o=T.parseBaseUrl(e)),"No Content"!=a)if(null===y&&(y=function(e){var t=null;return e.indexOf("SmoothStreamingMedia")>-1?(S&&(t=S.createMssParser(),S.registerEvents()),t):e.indexOf("MPD")>-1||e.indexOf("Patch")>-1?Object(p.default)(E).create({debug:_}):t}(t)),null!==y){m.setMatchers(y.getMatchers()),m.setIron(y.getIron());try{u=y.parse(t)}catch(t){return void v.trigger(d.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new l.default(h.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,h.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+"".concat(e))})}u?(u.url=s||e,u.originalUrl||(u.originalUrl=u.url),u.hasOwnProperty(n.default.LOCATION)&&(o=T.parseBaseUrl(u.Location_asArray[0]),r.debug("BaseURI set by Location to: "+o)),u.baseUri=o,u.loadedTime=new Date,m.resolveManifestOnLoad(u),v.trigger(d.default.ORIGINAL_MANIFEST_LOADED,{originalManifest:t})):v.trigger(d.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new l.default(h.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,h.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+"".concat(e))})}else v.trigger(d.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new l.default(h.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,h.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+"".concat(e))});else v.trigger(d.default.INTERNAL_MANIFEST_LOADED,{manifest:null})},error:function(t,r,n){v.trigger(d.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new l.default(h.default.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE,h.default.MANIFEST_LOADER_LOADING_FAILURE_ERROR_MESSAGE+"".concat(e,", ").concat(n))})}})},reset:function(){v.off(d.default.XLINK_READY,A,t),S&&S.reset(),m&&(m.reset(),m=null),g&&(g.abort(),g=null)}},r=_.getLogger(t),v.on(d.default.XLINK_READY,A,t),g=Object(s.default)(E).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,urlUtils:T,constants:n.default,dashConstants:a.default,errors:h.default}),m=Object(i.default)(E).create({errHandler:b,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,settings:e.settings}),y=null,t}m.__dashjs_factory_name="ManifestLoader";var y=g.default.getClassFactory(m);t.default=y},"./src/streaming/ManifestUpdater.js":function(e,t,r){r.r(t);var n=r("./src/core/EventBus.js"),a=r("./src/core/events/Events.js"),i=r("./src/streaming/MediaPlayerEvents.js"),s=r("./src/core/FactoryMaker.js"),o=r("./src/core/Debug.js"),u=r("./src/core/errors/Errors.js"),l=r("./src/dash/constants/DashConstants.js"),c=r("./src/streaming/utils/URLUtils.js");function f(){var e,t,r,s,f,d,h,g,p,m,y,E,_=this.context,v=Object(n.default)(_).getInstance(),T=Object(c.default)(_).getInstance();function S(){r=NaN,h=!1,f=!0,d=!1,b()}function b(){null!==s&&(clearTimeout(s),s=null)}function A(e){b(),d||(isNaN(e)&&!isNaN(r)&&(e=1e3*r),isNaN(e)||(t.debug("Refresh manifest in "+e+" milliseconds."),s=setTimeout(C,e)))}function R(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];h=!0;var t=p.getValue(),r=t.url,n=m.getPatchLocation(t),a=m.getLocation(t);n&&!e?r=n:a&&(r=a),T.isRelative(r)&&(r=T.resolve(r,t.url)),g.load(r)}function I(e){if(e){if(m.getIsPatch(e)){var n=e;e=p.getValue();var i=m.isPatchValid(e,n),s=i;if(i){var o=m.getPublishTime(e);s=m.applyPatchToManifest(e,n);var u=m.getPublishTime(e);s=o.getTime()!=u.getTime()}if(!s)return t.debug("Patch provided is invalid, performing full manifest refresh"),void R(!0);e.loadedTime=new Date}}else(e=p.getValue()).loadedTime=new Date;if(p.getValue()&&p.getValue().type===l.default.DYNAMIC&&e.type===l.default.STATIC)return v.trigger(a.default.DYNAMIC_TO_STATIC),h=!1,void(d=!0);p.setValue(e);var c=new Date,g=(c.getTime()-e.loadedTime.getTime())/1e3;1e3*(r=m.getManifestUpdatePeriod(e,g))>2147483647&&(r=2147483.647),v.trigger(a.default.MANIFEST_UPDATED,{manifest:e}),t.info("Manifest has been refreshed at "+c+"["+c.getTime()/1e3+"] "),f||A()}function C(){f||(h?A(E.get().streaming.manifestUpdateRetryInterval):R())}function w(e){e.error?e.error.code===u.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE&&y.error(e.error):I(e.manifest)}function N(){f=!1,A()}function D(){(f=!E.get().streaming.scheduling.scheduleWhilePaused)&&b()}function M(){h=!1}return e={initialize:function(){S(),v.on(a.default.STREAMS_COMPOSED,M,this),v.on(i.default.PLAYBACK_STARTED,N,this),v.on(i.default.PLAYBACK_PAUSED,D,this),v.on(a.default.INTERNAL_MANIFEST_LOADED,w,this)},setManifest:function(e){I(e)},refreshManifest:R,getIsUpdating:function(){return h},setConfig:function(e){e&&(e.manifestModel&&(p=e.manifestModel),e.adapter&&(m=e.adapter),e.manifestLoader&&(g=e.manifestLoader),e.errHandler&&(y=e.errHandler),e.settings&&(E=e.settings))},reset:function(){v.off(i.default.PLAYBACK_STARTED,N,this),v.off(i.default.PLAYBACK_PAUSED,D,this),v.off(a.default.STREAMS_COMPOSED,M,this),v.off(a.default.INTERNAL_MANIFEST_LOADED,w,this),S()}},t=Object(o.default)(_).getInstance().getLogger(e),e}f.__dashjs_factory_name="ManifestUpdater",t.default=s.default.getClassFactory(f)},"./src/streaming/MediaPlayer.js":function(e,t,r){r.r(t);var n=r("./externals/cea608-parser.js"),a=r.n(n),i=r("./src/streaming/constants/Constants.js"),s=r("./src/dash/constants/DashConstants.js"),o=r("./src/streaming/constants/MetricsConstants.js"),u=r("./src/streaming/controllers/PlaybackController.js"),l=r("./src/streaming/controllers/StreamController.js"),c=r("./src/streaming/controllers/GapController.js"),f=r("./src/streaming/controllers/MediaController.js"),d=r("./src/streaming/controllers/BaseURLController.js"),h=r("./src/streaming/ManifestLoader.js"),g=r("./src/streaming/utils/ErrorHandler.js"),p=r("./src/streaming/utils/Capabilities.js"),m=r("./src/streaming/utils/CapabilitiesFilter.js"),y=r("./src/streaming/utils/RequestModifier.js"),E=r("./src/streaming/models/URIFragmentModel.js"),_=r("./src/streaming/models/ManifestModel.js"),v=r("./src/streaming/models/MediaPlayerModel.js"),T=r("./src/streaming/controllers/AbrController.js"),S=r("./src/streaming/net/SchemeLoaderFactory.js"),b=r("./src/streaming/models/VideoModel.js"),A=r("./src/streaming/models/CmcdModel.js"),R=r("./src/streaming/utils/DOMStorage.js"),I=r("./src/core/Debug.js"),C=r("./src/core/errors/Errors.js"),w=r("./src/core/EventBus.js"),N=r("./src/core/events/Events.js"),D=r("./src/streaming/MediaPlayerEvents.js"),M=r("./src/core/FactoryMaker.js"),O=r("./src/core/Settings.js"),P=r("./src/core/Version.js"),L=r("./src/dash/controllers/SegmentBaseController.js"),F=r("./src/dash/DashAdapter.js"),j=r("./src/dash/DashMetrics.js"),x=r("./src/dash/utils/TimelineConverter.js"),k=r("./src/streaming/vo/metrics/HTTPRequest.js"),B=r("./externals/base64.js"),U=r.n(B),G=r("./node_modules/codem-isoboxer/dist/iso_boxer.js"),H=r.n(G),q=r("./src/streaming/vo/DashJSError.js"),Y=r("./src/streaming/utils/SupervisorTools.js"),K=r("./src/streaming/ManifestUpdater.js"),V=r("./src/streaming/utils/URLUtils.js"),W=r("./src/streaming/utils/BoxParser.js"),z=r("./src/streaming/text/TextController.js");function X(){var e,t,r,n,B,G,X,Q,J,$,Z,ee,te,re,ne,ae,ie,se,oe,ue,le,ce,fe,de,he,ge,pe,me,ye,Ee,_e,ve,Te,Se,be,Ae,Re="You must first call initialize() and set a source before calling this method",Ie="You must first call initialize() and set a valid source and view before calling this method",Ce="You must first call attachView() to set the video element before calling this method",we="MediaPlayer not initialized!",Ne=this.context,De=Object(w.default)(Ne).getInstance(),Me=Object(O.default)(Ne).getInstance(),Oe=Object(I.default)(Ne).getInstance({settings:Me});function Pe(){We(null),Ye(null),n=null,te&&(te.reset(),te=null),re&&(re.reset(),re=null),Me.reset(),ae&&(ae.reset(),ae=null)}function Le(){return!!r&&!!Ee.getElement()}function Fe(){return Object(P.getVersionString)()}function je(){if(!X)throw Ie;return ge.isPaused()}function xe(e){var t=fe&&fe.hasVideoTrack()?i.default.VIDEO:i.default.AUDIO,r=pe.getCurrentDVRInfo(t);if(!r)return 0;var n=ge.getLiveDelay(),a=r.range.start+e;return a>r.range.end-n&&(a=r.range.end-n),a}function ke(e){if(!X)throw Ie;var t=qe().currentTime;if(void 0!==e)t=fe.getTimeRelativeToStreamId(t,e);else if(ge.getIsDynamic()){var r=fe&&fe.hasVideoTrack()?i.default.VIDEO:i.default.AUDIO,n=pe.getCurrentDVRInfo(r);t=null===n||0===t?0:Math.max(0,t-n.range.start)}return t}function Be(){if(!X)throw Ie;var e=qe().duration;if(ge.getIsDynamic()){var t=fe&&fe.hasVideoTrack()?i.default.VIDEO:i.default.AUDIO,r=pe.getCurrentDVRInfo(t);e=r?r.range.end-r.range.start:0}return e}function Ue(e){Object(Y.checkParameterType)(e,"boolean"),Q=e}function Ge(){se.restoreDefaultUTCTimingSources()}function He(){return pe}function qe(){if(!Ee.getElement())throw Ce;return Ee.getElement()}function Ye(e){if(!B)throw we;Ee.setElement(e),e&&(Je(),function(){if(!re){var e=dashjs.MetricsReporting;if("function"==typeof e){var t=e(Ne).create();re=t.createMetricsReporting({debug:Oe,eventBus:De,mediaElement:qe(),adapter:ie,dashMetrics:pe,events:N.default,constants:i.default,metricsConstants:o.default})}}}(),function(){if(!ne){var e=dashjs.MssHandler;"function"==typeof e&&(C.default.extend(e.errors),ne=e(Ne).create({eventBus:De,mediaPlayerModel:se,dashMetrics:pe,manifestModel:me,playbackController:ge,streamController:fe,protectionController:te,baseURLController:ue,errHandler:oe,events:N.default,constants:i.default,debug:Oe,initSegmentType:k.HTTPRequest.INIT_SEGMENT_TYPE,BASE64:U.a,ISOBoxer:H.a,settings:Me}))}}(),fe&&fe.switchToVideoElement()),X&&Xe(),et()}function Ke(e){if(!G)throw Re;var t=fe.getActiveStreamInfo();return t?ee.getTracksFor(e,t.id):[]}function Ve(e,t){var r=-1;e.some(function(e,n){if(e===t)return r=n,!0}),r<0||e.splice(r,1)}function We(e){if(!B)throw we;"string"==typeof e&&_e.initialize(e),r=e,(G||X)&&Xe(),Le()&&et()}function ze(){if(!G)throw Re;var e=fe.getActiveStreamInfo();return e?fe.getStreamById(e.id):null}function Xe(){X=!1,G=!1,ie.reset(),fe.reset(),he.reset(),ge.reset(),J.reset(),ee.reset(),Te.reset(),te&&(Me.get().streaming.protection.keepProtectionMediaKeys?te.stop():(te.reset(),te=null,Je())),de.reset(),ye.reset()}function Qe(){return Object(h.default)(Ne).create({debug:Oe,errHandler:oe,dashMetrics:pe,mediaPlayerModel:se,requestModifier:Object(y.default)(Ne).getInstance(),mssHandler:ne,settings:Me})}function Je(){if(te)return te;var e=dashjs.Protection;if("function"==typeof e){var t=e(Ne).create();return N.default.extend(e.events),D.default.extend(e.events,{publicOnly:!0}),C.default.extend(e.errors),le||(le=Object(p.default)(Ne).getInstance()),(te=t.createProtectionSystem({debug:Oe,errHandler:oe,videoModel:Ee,capabilities:le,eventBus:De,events:N.default,BASE64:U.a,constants:i.default,cmcdModel:ye,settings:Me}))&&(te.setLicenseRequestFilters(Se),te.setLicenseResponseFilters(be)),te}return null}function $e(){if(!B)throw we;if(ae)return ae;var e=dashjs.OfflineController;if("function"==typeof e){N.default.extend(e.events),D.default.extend(e.events,{publicOnly:!0}),C.default.extend(e.errors);var t=Qe(),r=Object(K.default)(Ne).create();return r.setConfig({manifestModel:me,adapter:ie,manifestLoader:t,errHandler:oe}),ae=e(Ne).create({debug:Oe,manifestUpdater:r,baseURLController:ue,manifestLoader:t,manifestModel:me,mediaPlayerModel:se,abrController:J,playbackController:ge,adapter:ie,errHandler:oe,dashMetrics:pe,timelineConverter:Z,segmentBaseController:Te,schemeLoaderFactory:$,eventBus:De,events:N.default,errors:C.default,constants:i.default,settings:Me,dashConstants:s.default,urlUtils:Object(V.default)(Ne).getInstance()})}return null}function Ze(e){var t=fe&&fe.hasVideoTrack()?i.default.VIDEO:i.default.AUDIO,r=pe.getCurrentDVRInfo(t);return r?e+(r.manifestInfo.availableFrom.getTime()/1e3+r.range.start):0}function et(){var e;ae&&ae.resetRecords(),!G&&r&&(G=!0,t.info("Streaming Initialized"),e=Qe(),fe||(fe=Object(l.default)(Ne).getInstance()),de||(de=Object(z.default)(Ne).create({errHandler:oe,manifestModel:me,adapter:ie,mediaController:ee,videoModel:Ee,settings:Me})),ce.setConfig({capabilities:le,adapter:ie,settings:Me,manifestModel:me,errHandler:oe}),ce.setCustomCapabilitiesFilters(Ae),fe.setConfig({capabilities:le,capabilitiesFilter:ce,manifestLoader:e,manifestModel:me,mediaPlayerModel:se,protectionController:te,textController:de,adapter:ie,dashMetrics:pe,errHandler:oe,timelineConverter:Z,videoModel:Ee,playbackController:ge,abrController:J,mediaController:ee,settings:Me,baseURLController:ue,uriFragmentModel:_e,segmentBaseController:Te}),he.setConfig({settings:Me,playbackController:ge,streamController:fe,videoModel:Ee,timelineConverter:Z,adapter:ie}),ge.setConfig({streamController:fe,dashMetrics:pe,mediaPlayerModel:se,adapter:ie,videoModel:Ee,timelineConverter:Z,settings:Me}),J.setConfig({streamController:fe,domStorage:ve,mediaPlayerModel:se,dashMetrics:pe,adapter:ie,videoModel:Ee,settings:Me}),ye.setConfig({abrController:J,dashMetrics:pe,playbackController:ge}),J.initialize(),fe.initialize(Q,n),de.initialize(),he.initialize(),ye.initialize(),Te.initialize(),"string"==typeof r?fe.load(r):fe.loadWithManifest(r)),!X&&Le()&&(X=!0,t.info("Playback Initialized"))}return e={initialize:function(e,r,n){le||(le=Object(p.default)(Ne).getInstance()).setConfig({settings:Me}),oe||(oe=Object(g.default)(Ne).getInstance()),le.supportsMediaSource()?(B||(B=!0,Z=Object(x.default)(Ne).getInstance(),J||(J=Object(T.default)(Ne).getInstance()).setConfig({settings:Me}),$||($=Object(S.default)(Ne).getInstance()),ge||(ge=Object(u.default)(Ne).getInstance()),ee||(ee=Object(f.default)(Ne).getInstance()),fe||(fe=Object(l.default)(Ne).getInstance()),he||(he=Object(c.default)(Ne).getInstance()),ce||(ce=Object(m.default)(Ne).getInstance()),ie=Object(F.default)(Ne).getInstance(),me=Object(_.default)(Ne).getInstance(),ye=Object(A.default)(Ne).getInstance(),pe=Object(j.default)(Ne).getInstance({settings:Me}),ve=Object(R.default)(Ne).getInstance({settings:Me}),ie.setConfig({constants:i.default,cea608parser:a.a,errHandler:oe,BASE64:U.a}),ue||(ue=Object(d.default)(Ne).create()),ue.setConfig({adapter:ie}),Te||(Te=Object(L.default)(Ne).getInstance({dashMetrics:pe,mediaPlayerModel:se,errHandler:oe,baseURLController:ue,events:N.default,eventBus:De,debug:Oe,boxParser:Object(W.default)(Ne).getInstance(),requestModifier:Object(y.default)(Ne).getInstance(),errors:C.default})),ee.setConfig({domStorage:ve,settings:Me}),Ge(),Ue(void 0===n||n),$e()),e&&Ye(e),r&&We(r),t.info("[dash.js "+Fe()+"] MediaPlayer has been initialized")):oe.error(new q.default(C.default.CAPABILITY_MEDIASOURCE_ERROR_CODE,C.default.CAPABILITY_MEDIASOURCE_ERROR_MESSAGE))},setConfig:function(e){e&&(e.capabilities&&(le=e.capabilities),e.capabilitiesFilter&&(ce=e.capabilitiesFilter),e.streamController&&(fe=e.streamController),e.textController&&(de=e.textController),e.gapController&&(he=e.gapController),e.playbackController&&(ge=e.playbackController),e.mediaPlayerModel&&(se=e.mediaPlayerModel),e.abrController&&(J=e.abrController),e.schemeLoaderFactory&&($=e.schemeLoaderFactory),e.mediaController&&(ee=e.mediaController),e.settings&&(Me=e.settings))},on:function(e,t,r,n){De.on(e,t,r,n)},off:function(e,t,r){De.off(e,t,r)},extend:function(e,t,r){M.default.extend(e,t,r,Ne)},attachView:Ye,attachSource:We,isReady:Le,play:function(){if(!X)throw Ie;(!Q||je()&&X)&&ge.play()},isPaused:je,pause:function(){if(!X)throw Ie;ge.pause()},isSeeking:function(){if(!X)throw Ie;return ge.isSeeking()},isDynamic:function(){if(!X)throw Ie;return ge.getIsDynamic()},seek:function(e){if(!X)throw Ie;if(Object(Y.checkParameterType)(e,"number"),isNaN(e))throw i.default.BAD_ARGUMENT_ERROR;var t=ge.getIsDynamic()?xe(e):e;ge.seek(t)},setPlaybackRate:function(e){qe().playbackRate=e},getPlaybackRate:function(){return qe().playbackRate},setMute:function(e){Object(Y.checkParameterType)(e,"boolean"),qe().muted=e},isMuted:function(){return qe().muted},setVolume:function(e){if("number"!=typeof e||isNaN(e)||e<0||e>1)throw i.default.BAD_ARGUMENT_ERROR;qe().volume=e},getVolume:function(){return qe().volume},time:ke,duration:Be,timeAsUTC:function(){if(!X)throw Ie;return ke()<0?NaN:Ze(ke())},durationAsUTC:function(){if(!X)throw Ie;return Ze(Be())},getActiveStream:ze,getDVRWindowSize:function(){var e=fe&&fe.hasVideoTrack()?i.default.VIDEO:i.default.AUDIO,t=pe.getCurrentDVRInfo(e);return t?t.manifestInfo.dvrWindowSize:0},getDVRSeekOffset:xe,convertToTimeCode:function(e){e=Math.max(e,0);var t=Math.floor(e/3600),r=Math.floor(e%3600/60),n=Math.floor(e%3600%60);return(0===t?"":t<10?"0"+t.toString()+":":t.toString()+":")+(r<10?"0"+r.toString():r.toString())+":"+(n<10?"0"+n.toString():n.toString())},formatUTC:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=new Date(1e3*e),i=a.toLocaleDateString(t),s=a.toLocaleTimeString(t,{hour12:r});return n?s+" "+i:s},getVersion:Fe,getDebug:function(){return Oe},getBufferLength:function(e){var r=[i.default.VIDEO,i.default.AUDIO,i.default.TEXT];if(e)return-1!==r.indexOf(e)?He().getCurrentBufferLevel(e)||NaN:(t.warn("getBufferLength requested for invalid type"),NaN);var n=r.map(function(e){return Ke(e).length>0?He().getCurrentBufferLevel(e):Number.MAX_VALUE}).reduce(function(e,t){return Math.min(e,t)});return n===Number.MAX_VALUE?NaN:n},getTTMLRenderingDiv:function(){return Ee?Ee.getTTMLRenderingDiv():null},getVideoElement:qe,getSource:function(){if(!r)throw"You must first call attachSource() with a valid source before calling this method";return r},getCurrentLiveLatency:function(){if(!B)throw we;return X?ge.getCurrentLiveLatency():NaN},getTopBitrateInfoFor:function(e){if(!G)throw Re;return J.getTopBitrateInfoFor(e)},setAutoPlay:Ue,getAutoPlay:function(){return Q},getDashMetrics:He,getQualityFor:function(e){if(!G)throw Re;if(e===i.default.IMAGE){var t=ze();if(!t)return-1;var r=t.getThumbnailController();return r?r.getCurrentTrackIndex():-1}return J.getQualityFor(e)},setQualityFor:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!G)throw Re;if(e===i.default.IMAGE){var n=ze();if(!n)return;var a=n.getThumbnailController();a&&a.setTrackByIndex(t)}J.setPlaybackQuality(e,fe.getActiveStreamInfo(),t,{forceReplace:r})},updatePortalSize:function(){J.setElementSize(),J.setWindowResizeEventCalled(!0)},enableText:function(e){var t=fe.getActiveStreamInfo();return!(!t||!de)&&de.enableText(t.id,e)},enableForcedTextStreaming:function(e){return!(!fe.getActiveStreamInfo()||!de)&&de.enableForcedTextStreaming(e)},isTextEnabled:function(){var e=fe.getActiveStreamInfo();return!(!e||!de)&&de.isTextEnabled(e)},setTextTrack:function(e){if(!X)throw Ie;var t=fe.getActiveStreamInfo();t&&de&&de.setTextTrack(t.id,e)},getBitrateInfoListFor:function(e){if(!G)throw Re;var t=ze();return t?t.getBitrateListFor(e):[]},getStreamsFromManifest:function(e){if(!G)throw Re;return ie.getStreamsInfo(e)},getTracksFor:Ke,getTracksForTypeFromManifest:function(e,t,r){if(!G)throw Re;return(r=r||ie.getStreamsInfo(t,1)[0])?ie.getAllMediaInfoForType(r,e,t):[]},getCurrentTrackFor:function(e){if(!G)throw Re;var t=fe.getActiveStreamInfo();return ee.getCurrentTrackFor(e,t.id)},setInitialMediaSettingsFor:function(e,t){if(!B)throw we;ee.setInitialSettings(e,t)},getInitialMediaSettingsFor:function(e){if(!B)throw we;return ee.getInitialSettings(e)},setCurrentTrack:function(e){if(!G)throw Re;ee.setTrack(e)},addABRCustomRule:function(e,t,r){se.addABRCustomRule(e,t,r)},removeABRCustomRule:function(e){se.removeABRCustomRule(e)},removeAllABRCustomRule:function(){se.removeABRCustomRule()},getAverageThroughput:function(e){var t=J.getThroughputHistory(),r=ge.getIsDynamic();return t?t.getAverageThroughput(e,r):0},retrieveManifest:function(e,t){var r=Qe(),n=this;De.on(N.default.INTERNAL_MANIFEST_LOADED,function e(a){a.error?t(null,a.error):t(a.manifest),De.off(N.default.INTERNAL_MANIFEST_LOADED,e,n),r.reset()},n),_e.initialize(e),r.load(e)},addUTCTimingSource:function(e,t){se.addUTCTimingSource(e,t)},removeUTCTimingSource:function(e,t){se.removeUTCTimingSource(e,t)},clearDefaultUTCTimingSources:function(){se.clearDefaultUTCTimingSources()},restoreDefaultUTCTimingSources:Ge,setXHRWithCredentialsForType:function(e,t){se.setXHRWithCredentialsForType(e,t)},getXHRWithCredentialsForType:function(e){return se.getXHRWithCredentialsForType(e)},getProtectionController:function(){return Je()},attachProtectionController:function(e){te=e},setProtectionData:function(e){n=e,fe&&fe.setProtectionData(n)},registerLicenseRequestFilter:function(e){Se.push(e),te&&te.setLicenseRequestFilters(Se)},registerLicenseResponseFilter:function(e){be.push(e),te&&te.setLicenseResponseFilters(be)},unregisterLicenseRequestFilter:function(e){Ve(Se,e),te&&te.setLicenseRequestFilters(Se)},unregisterLicenseResponseFilter:function(e){Ve(be,e),te&&te.setLicenseResponseFilters(be)},registerCustomCapabilitiesFilter:function(e){Ae.push(e),ce&&ce.setCustomCapabilitiesFilters(Ae)},unregisterCustomCapabilitiesFilter:function(e){Ve(Ae,e),ce&&ce.setCustomCapabilitiesFilters(Ae)},setCustomInitialTrackSelectionFunction:function(e){ee&&ee.setCustomInitialTrackSelectionFunction(e)},resetCustomInitialTrackSelectionFunction:function(){ee&&ee.setCustomInitialTrackSelectionFunction(null)},attachTTMLRenderingDiv:function(e){if(!Ee.getElement())throw Ce;Ee.setTTMLRenderingDiv(e)},getCurrentTextTrackIndex:function(){var e=fe.getActiveStreamInfo();if(e&&de)return de.getCurrentTrackIdx(e.id)},provideThumbnail:function(e,t){if("function"==typeof t)if(e<0)t(null);else{var r=ge.getIsDynamic()?xe(e):e,n=fe.getStreamForTime(r);if(null!==n){var a=n.getThumbnailController();if(a){var i=fe.getTimeRelativeToStreamId(r,n.getId());return a.provide(i,t)}t(null)}else t(null)}},getDashAdapter:function(){return ie},getOfflineController:function(){return $e()},getSettings:function(){return Me.get()},updateSettings:function(e){Me.update(e)},resetSettings:function(){Me.reset()},reset:Pe,destroy:function(){Pe(),Se=[],be=[],Ae=[],M.default.deleteSingletonInstances(Ne)}},t=Oe.getLogger(e),B=!1,X=!1,G=!1,Q=!0,te=null,ae=null,n=null,ie=null,Te=null,N.default.extend(D.default),se=Object(v.default)(Ne).getInstance(),Ee=Object(b.default)(Ne).getInstance(),_e=Object(E.default)(Ne).getInstance(),Se=[],be=[],Ae=[],e}X.__dashjs_factory_name="MediaPlayer";var Q=M.default.getClassFactory(X);Q.events=D.default,Q.errors=C.default,M.default.updateClassFactory(X.__dashjs_factory_name,Q),t.default=Q},"./src/streaming/MediaPlayerEvents.js":function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}r.r(t);var s=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(o,e);var t,r,s=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,a=i(t);if(r){var s=i(this).constructor;e=Reflect.construct(a,arguments,s)}else e=a.apply(this,arguments);return function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function o(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=s.call(this)).AST_IN_FUTURE="astInFuture",e.BUFFER_EMPTY="bufferStalled",e.BUFFER_LOADED="bufferLoaded",e.BUFFER_LEVEL_STATE_CHANGED="bufferStateChanged",e.BUFFER_LEVEL_UPDATED="bufferLevelUpdated",e.DYNAMIC_TO_STATIC="dynamicToStatic",e.ERROR="error",e.FRAGMENT_LOADING_COMPLETED="fragmentLoadingCompleted",e.FRAGMENT_LOADING_PROGRESS="fragmentLoadingProgress",e.FRAGMENT_LOADING_STARTED="fragmentLoadingStarted",e.FRAGMENT_LOADING_ABANDONED="fragmentLoadingAbandoned",e.LOG="log",e.MANIFEST_LOADED="manifestLoaded",e.METRICS_CHANGED="metricsChanged",e.METRIC_CHANGED="metricChanged",e.METRIC_ADDED="metricAdded",e.METRIC_UPDATED="metricUpdated",e.PERIOD_SWITCH_STARTED="periodSwitchStarted",e.PERIOD_SWITCH_COMPLETED="periodSwitchCompleted",e.QUALITY_CHANGE_REQUESTED="qualityChangeRequested",e.QUALITY_CHANGE_RENDERED="qualityChangeRendered",e.TRACK_CHANGE_RENDERED="trackChangeRendered",e.STREAM_INITIALIZING="streamInitializing",e.STREAM_UPDATED="streamUpdated",e.STREAM_ACTIVATED="streamActivated",e.STREAM_DEACTIVATED="streamDeactivated",e.STREAM_INITIALIZED="streamInitialized",e.STREAM_TEARDOWN_COMPLETE="streamTeardownComplete",e.TEXT_TRACKS_ADDED="allTextTracksAdded",e.TEXT_TRACK_ADDED="textTrackAdded",e.TTML_PARSED="ttmlParsed",e.TTML_TO_PARSE="ttmlToParse",e.CAPTION_RENDERED="captionRendered",e.CAPTION_CONTAINER_RESIZE="captionContainerResize",e.CAN_PLAY="canPlay",e.CAN_PLAY_THROUGH="canPlayThrough",e.PLAYBACK_ENDED="playbackEnded",e.PLAYBACK_ERROR="playbackError",e.PLAYBACK_NOT_ALLOWED="playbackNotAllowed",e.PLAYBACK_METADATA_LOADED="playbackMetaDataLoaded",e.PLAYBACK_LOADED_DATA="playbackLoadedData",e.PLAYBACK_PAUSED="playbackPaused",e.PLAYBACK_PLAYING="playbackPlaying",e.PLAYBACK_PROGRESS="playbackProgress",e.PLAYBACK_RATE_CHANGED="playbackRateChanged",e.PLAYBACK_SEEKED="playbackSeeked",e.PLAYBACK_SEEKING="playbackSeeking",e.PLAYBACK_SEEK_ASKED="playbackSeekAsked",e.PLAYBACK_STALLED="playbackStalled",e.PLAYBACK_STARTED="playbackStarted",e.PLAYBACK_TIME_UPDATED="playbackTimeUpdated",e.PLAYBACK_WAITING="playbackWaiting",e.MANIFEST_VALIDITY_CHANGED="manifestValidityChanged",e.EVENT_MODE_ON_START="eventModeOnStart",e.EVENT_MODE_ON_RECEIVE="eventModeOnReceive",e.CONFORMANCE_VIOLATION="conformanceViolation",e.REPRESENTATION_SWITCH="representationSwitch",e}return o}(r("./src/core/events/EventsBase.js").default));t.default=s},"./src/streaming/MediaPlayerFactory.js":function(e,t,r){r.r(t);var n,a=r("./src/streaming/MediaPlayer.js"),i=function(){var e,t="application/dash+xml";function r(r,n,i){if(!r||!/^VIDEO$/i.test(r.nodeName))return null;if(r._dashjs_player)return r._dashjs_player;var s,o=r.id||r.name||"video element";if(!(n=n||[].slice.call(r.querySelectorAll("source")).filter(function(e){return e.type==t})[0])&&r.src)(n=document.createElement("source")).src=r.src;else if(!n&&!r.src)return null;return i=i||{},(s=Object(a.default)(i).create()).initialize(r,n.src,r.autoplay),e||(e=s.getDebug().getLogger()),e.debug("Converted "+o+" to dash.js player and added content: "+n.src),r._dashjs_player=s,s}function n(e){return/^VIDEO$/i.test(e.nodeName)?e:n(e.parentNode)}return{create:r,createAll:function(e,a){var i=[];e=e||"[data-dashjs-player]";for(var s=(a=a||document).querySelectorAll(e),o=0;o<s.length;o++){var u=r(s[o],null);i.push(u)}for(var l=a.querySelectorAll('source[type="'+t+'"]'),c=0;c<l.length;c++){var f=r(n(l[c]),null);i.push(f)}return i}}}();!("undefined"!=typeof window&&window&&window.dashjs&&window.dashjs.skipAutoCreate)&&"undefined"!=typeof window&&window&&window.addEventListener&&("complete"===window.document.readyState?window.dashjs?i.createAll():n=window.setInterval(function(){window.dashjs&&(window.clearInterval(n),i.createAll())},500):window.addEventListener("load",function e(){window.removeEventListener("load",e),i.createAll()})),t.default=i},"./src/streaming/SourceBufferSink.js":function(e,t,r){r.r(t);var n=r("./src/core/Debug.js"),a=r("./src/streaming/vo/DashJSError.js"),i=r("./src/core/FactoryMaker.js"),s=r("./src/core/errors/Errors.js"),o=r("./src/core/Settings.js"),u=r("./src/streaming/constants/Constants.js"),l=r("./src/streaming/vo/metrics/HTTPRequest.js"),c=r("./src/core/events/Events.js");function f(e){var t,r,i,f,d,h,g=this.context,p=Object(o.default)(g).getInstance(),m=e.textController,y=e.eventBus,E=[],_=[],v=!1,T=e.mediaSource,S=null;function b(e){return new Promise(function(t){P(function(){f.changeType&&f.changeType(e),t()})})}function A(e){return f=m.getTextSourceBuffer(e),Promise.resolve()}function R(){if("function"==typeof f.addEventListener)try{f.addEventListener("updateend",M,!1),f.addEventListener("error",O,!1),f.addEventListener("abort",O,!1)}catch(e){h=setInterval(M,50)}else h=setInterval(M,50)}function I(e){return new Promise(function(t){f&&p.get().streaming.buffer.useAppendWindow?P(function(){try{if(!f)return void t();var r=T.duration,n=0;e&&!isNaN(e.start)&&!isNaN(e.duration)&&isFinite(e.duration)&&(r=e.start+e.duration),e&&!isNaN(e.start)&&(n=e.start),f.appendWindowEnd===r&&f.appendWindowStart===n||(f.appendWindowStart=0,f.appendWindowEnd=r+.01,f.appendWindowStart=Math.max(n-.1,0),i.debug("Updated append window for ".concat(d.type,". Set start to ").concat(f.appendWindowStart," and end to ").concat(f.appendWindowEnd))),t()}catch(e){i.warn("Failed to set append window"),t()}}):t()})}function C(e){return new Promise(function(t){f?P(function(){try{f.timestampOffset===e||isNaN(e)||(f.timestampOffset=e,i.debug("Set MSE timestamp offset to ".concat(e))),t()}catch(e){t()}}):t()})}function w(){return new Promise(function(e){P(function(){var t=f.appendWindowStart,r=f.appendWindowEnd;f&&(f.abort(),f.appendWindowStart=t,f.appendWindowEnd=r),e()})})}function N(){if(!v&&_.length>0){v=!0;var e=_[0];_.splice(0,1);var t=function(){v=!1,_.length>0&&N.call(this),e&&e.data&&e.data.segmentType&&e.data.segmentType!==l.HTTPRequest.INIT_SEGMENT_TYPE&&delete e.data.bytes,e.promise.resolve({chunk:e.data})};try{S=e.request,0===e.data.bytes.byteLength?t.call(this):(f.appendBuffer?f.appendBuffer(e.data.bytes):f.append(e.data.bytes,e.data),P(t.bind(this)))}catch(t){i.fatal('SourceBuffer append failed "'+t+'"'),_.length>0?N():v=!1,delete e.data.bytes,e.promise.reject({chunk:e.data,error:new a.default(t.code,t.message)})}}}function D(){E.length>0&&(f.updating||(E.shift()(),D()))}function M(){f.updating||D()}function O(e){var t,n,a=e.target||{};t=c.default.SOURCE_BUFFER_ERROR,n={error:a,lastRequestAppended:S}||{},y.trigger(t,n,{streamId:d.streamInfo.id,mediaType:r})}function P(e){E.push(e),f.updating||D()}return t={getType:function(){return r},getAllBufferRanges:function(){try{return f.buffered}catch(e){return i.error("getAllBufferRanges exception: "+e.message),null}},getBuffer:function(){return f},append:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new Promise(function(n,i){e?(_.push({data:e,promise:{resolve:n,reject:i},request:r}),P(N.bind(t))):i({chunk:e,error:new a.default(s.default.APPEND_ERROR_CODE,s.default.APPEND_ERROR_MESSAGE)})})},remove:function(e){return new Promise(function(t,r){var n=e.start,i=e.end;n>=0&&i>n?P(function(){try{f.remove(n,i),P(function(){t({from:n,to:i,unintended:!1}),e.resolve&&e.resolve()})}catch(t){r({from:n,to:i,unintended:!1,error:new a.default(s.default.REMOVE_ERROR_CODE,s.default.REMOVE_ERROR_MESSAGE)}),e.reject&&e.reject(t)}}):t()})},abort:function(){return new Promise(function(e){try{_=[],"open"===T.readyState?P(function(){try{f&&f.abort(),e()}catch(t){e()}}):f&&f.setTextTrack&&"ended"===T.readyState?(f.abort(),e()):e()}catch(t){e()}})},reset:function(){if(f){try{E=[],function(){try{"function"==typeof f.removeEventListener&&(f.removeEventListener("updateend",M,!1),f.removeEventListener("error",O,!1),f.removeEventListener("abort",O,!1)),clearInterval(h)}catch(e){i.error(e)}}(),v=!1,_=[],f.getClassName&&"TextSourceBuffer"===f.getClassName()||(i.debug("Removing sourcebuffer from media source"),T.removeSourceBuffer(f))}catch(e){}f=null}S=null},updateTimestampOffset:C,initializeForStreamSwitch:function(e,t,n){r=(d=e).type;var a=d.codec;!function(e){f=e.getBuffer()}(n),R();var i=[];return i.push(w),i.push(I(d.streamInfo)),i.push(b(a)),t&&void 0!==t.MSETimeOffset&&i.push(C(t.MSETimeOffset)),Promise.all(i)},initializeForFirstUse:function(e,t,n){r=(d=t).type;var a=d.codec;try{if(a.match(/application\/mp4;\s*codecs="(stpp|wvtt).*"/i))return A(e);f=T.addSourceBuffer(a),R();var i=[];return i.push(I(d.streamInfo)),n&&void 0!==n.MSETimeOffset&&i.push(C(n.MSETimeOffset)),Promise.all(i)}catch(t){return d.type==u.default.TEXT&&!d.isFragmented||-1!==a.indexOf('codecs="stpp')||-1!==a.indexOf('codecs="vtt')?A(e):Promise.reject(t)}},updateAppendWindow:I,changeType:b},i=Object(n.default)(g).getInstance().getLogger(t),t}f.__dashjs_factory_name="SourceBufferSink";var d=i.default.getClassFactory(f);t.default=d},"./src/streaming/Stream.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/Constants.js"),a=r("./src/dash/constants/DashConstants.js"),i=r("./src/streaming/StreamProcessor.js"),s=r("./src/streaming/controllers/FragmentController.js"),o=r("./src/streaming/thumbnail/ThumbnailController.js"),u=r("./src/core/EventBus.js"),l=r("./src/core/events/Events.js"),c=r("./src/core/Debug.js"),f=r("./src/core/errors/Errors.js"),d=r("./src/core/FactoryMaker.js"),h=r("./src/streaming/vo/DashJSError.js"),g=r("./src/streaming/utils/BoxParser.js"),p=r("./src/streaming/utils/URLUtils.js"),m=r("./src/streaming/controllers/BlacklistController.js"),y=[n.default.VIDEO,n.default.AUDIO,n.default.TEXT,n.default.MUXED,n.default.IMAGE];function E(e){e=e||{};var t,r,d,E,_,v,T,S,b,A,R,I,C,w,N,D,M,O,P=this.context,L=Object(u.default)(P).getInstance(),F=Object(p.default)(P).getInstance(),j=e.manifestModel,x=e.mediaPlayerModel,k=e.dashMetrics,B=e.manifestUpdater,U=e.adapter,G=e.timelineConverter,H=e.capabilities,q=e.errHandler,Y=e.abrController,K=e.playbackController,V=e.eventController,W=e.mediaController,z=e.protectionController,X=e.textController,Q=e.videoModel,J=e.streamInfo,$=e.settings;function Z(t,s){return new Promise(function(u,c){oe(),A=!0,le();var g,p=Q.getElement();y.forEach(function(s){(s!==n.default.VIDEO||!p||p&&/^VIDEO$/i.test(p.nodeName))&&function(t,s){var u,c=U.getAllMediaInfoForType(J,t),f=[],h=null;if(c&&0!==c.length){t===n.default.VIDEO&&(T=!0),t===n.default.AUDIO&&(S=!0);for(var g=0,p=c.length;g<p;g++)h=c[g],t===n.default.TEXT&&h.isEmbedded&&(X.addEmbeddedTrack(J,h),f.push(h)),ee(h)&&W.addTrack(h);if(f.length>0&&(W.setInitialMediaSettingsForType(t,J),X.setInitialSettings(W.getInitialSettings(t)),X.addMediaInfosToBuffer(J,t,f)),0!==(c=c.filter(function(e){return!e.isEmbedded})).length)if(t!==n.default.IMAGE){L.trigger(l.default.STREAM_INITIALIZING,{streamInfo:J,mediaInfo:h}),W.setInitialMediaSettingsForType(t,J);var m=function(t,r){var a=t&&t.length>0?t[0]:null,s=R.getModel(a?a.type:null),o=a?a.type:null,u=a?a.mimeType:null,l=a?a.isFragmented:null,c=Object(i.default)(P).create({streamInfo:J,type:o,mimeType:u,timelineConverter:G,adapter:U,manifestModel:j,mediaPlayerModel:x,fragmentModel:s,dashMetrics:e.dashMetrics,baseURLController:e.baseURLController,segmentBaseController:e.segmentBaseController,abrController:Y,playbackController:K,mediaController:W,textController:X,errHandler:q,settings:$,boxParser:N,segmentBlacklistController:C});c.initialize(r,T,l),d.push(c);for(var f=0;f<t.length;f++)c.addMediaInfo(t[f]);return o===n.default.TEXT&&X.addMediaInfosToBuffer(J,o,t,s),c}(c,s);(u=W.getCurrentTrackFor(t,J.id))&&(Y.updateTopQualityIndex(u),m.selectMediaInfo(t===n.default.TEXT&&u.isEmbedded?c[0]:u))}else(I=Object(o.default)(P).create({streamInfo:J,adapter:U,baseURLController:e.baseURLController,timelineConverter:e.timelineConverter,debug:D,eventBus:L,events:l.default,dashConstants:a.default,dashMetrics:e.dashMetrics,segmentBaseController:e.segmentBaseController})).initialize()}else r.info("No "+t+" data.")}(s,t)}),(g=s,new Promise(function(e){var t={},r=d.map(function(e){return e.createBufferSinks(g)});Promise.all(r).then(function(r){r.forEach(function(e){e&&(t[e.getType()]=e)}),e(t)}).catch(function(){e(t)})})).then(function(e){if(A=!1,0===d.length){var t="No streams to play.";q.error(new h.default(f.default.MANIFEST_ERROR_ID_NOSTREAMS_CODE,t,j.getValue())),r.fatal(t)}else ce();X.createTracks(J),u(e)}).catch(function(e){c(e)})})}function ee(e){var t,a=e?e.type:null;return a===n.default.MUXED?(t="Multiplexed representations are intentionally not supported, as they are not compliant with the DASH-AVC/264 guidelines",r.fatal(t),q.error(new h.default(f.default.MANIFEST_ERROR_ID_MULTIPLEXED_CODE,t,j.getValue())),!1):!(a!==n.default.TEXT&&a!==n.default.IMAGE&&e.contentProtection&&!H.supportsEncryptedMedia()&&(q.error(new h.default(f.default.CAPABILITY_MEDIAKEYS_ERROR_CODE,f.default.CAPABILITY_MEDIAKEYS_ERROR_MESSAGE)),1))}function te(e){for(var t=d?d.length:0,r=0;r<t;r++){var n=d[r].getFragmentModel();n.abortRequests(),n.resetInitialSettings(),d[r].reset(!1,e)}X&&X.deactivateStream(J),d=[],_=!1,v=!1,ve(!1),ne(!1),L.trigger(l.default.STREAM_DEACTIVATED,{streamInfo:J})}function re(e){te(e),E=!1,T=!1,S=!1,b={},A=!1,M=!1,O=[]}function ne(e){M=e}function ae(){return J?J.start:NaN}function ie(){return J?J.id:null}function se(){return J}function oe(){if(!Q||!Y)throw new Error(n.default.MISSING_CONFIG_ERROR)}function ue(e){e.error&&(q.error(e.error),r.fatal(e.error.message))}function le(){if(V){var e=U.getEventsFor(J);V.addInlineEvents(e)}}function ce(){for(var e=d.length,t=b.audio||b.video?new h.default(f.default.DATA_UPDATE_FAILED_ERROR_CODE,f.default.DATA_UPDATE_FAILED_ERROR_MESSAGE):null,r=0;r<e;r++)if(d[r].isUpdating()||A)return;if(z){z.clearMediaInfoArray();for(var a=0;a<e&&d[a];a++){var i=d[a].getType(),s=d[a].getMediaInfo();if(i===n.default.AUDIO||i===n.default.VIDEO||i===n.default.TEXT&&s.isFragmented){var o=d[a].getMediaInfo();o&&z.initializeForMedia(o)}}}t?q.error(t):E||(E=!0,L.trigger(l.default.STREAM_INITIALIZED,{streamInfo:J}))}function fe(){var e=me(),t=e.length;if(0!==t){for(var a=0;a<t;a++)if(!e[a].isBufferingCompleted()&&(e[a].getType()===n.default.AUDIO||e[a].getType()===n.default.VIDEO))return void r.debug("onBufferingCompleted - One streamProcessor has finished but",e[a].getType(),"one is not buffering completed");r.debug("onBufferingCompleted - trigger STREAM_BUFFERING_COMPLETED"),v=!0,L.trigger(l.default.STREAM_BUFFERING_COMPLETED,{streamInfo:J},{streamInfo:J})}else r.warn("onBufferingCompleted - can't trigger STREAM_BUFFERING_COMPLETED because no streamProcessor is defined")}function de(e){b[e.mediaType]=e.error,ce()}function he(e){V&&V.addInbandEvents(e.events)}function ge(e){return e&&e.type?pe(e.type):null}function pe(e){return e?me().filter(function(t){return t.getType()===e})[0]:null}function me(){for(var e,t,r=[],a=0;a<d.length;a++)(e=(t=d[a]).getType())!==n.default.AUDIO&&e!==n.default.VIDEO&&e!==n.default.TEXT||r.push(t);return r}function ye(e,t){var r=se(),n=t.getStreamInfo();if(!n||!r)return!0;var a=U.getAdaptationForType(n.index,e,n),i=U.getAdaptationForType(r.index,e,r);return a&&i?!(!Ee(i)&&Ee(a)):!a&&!i}function Ee(e){return!!e&&!!(e.ContentProtection||e.Representation&&e.Representation.length>0&&e.Representation[0].ContentProtection)}function _e(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e||!e.hasOwnProperty("getStreamInfo"))return!1;var n=e.getStreamInfo(),a=r?r.getStreamInfo():se();if(!n||!a)return!1;var i=U.getAdaptationForType(n.index,t,n),s=U.getAdaptationForType(a.index,t,a);if(!i||!s)return!i&&!s;var o=i&&s&&i.mimeType===s.mimeType,u=s.Representation_asArray.map(function(e){return e.codecs}),l=i.Representation_asArray.map(function(e){return e.codecs}),c=l.some(function(e){return u.indexOf(e)>-1}),f=l.some(function(e){return u.some(function(t){return H.codecRootCompatibleWithCodec(t,e)})});return c||f&&o}function ve(e){w=e}function Te(){return w}return t={initialize:function(){L.on(l.default.BUFFERING_COMPLETED,fe,t),L.on(l.default.DATA_UPDATE_COMPLETED,de,t),L.on(l.default.INBAND_EVENTS,he,t),z&&(L.on(l.default.KEY_ERROR,ue,t),L.on(l.default.SERVER_CERTIFICATE_UPDATED,ue,t),L.on(l.default.LICENSE_REQUEST_COMPLETE,ue,t),L.on(l.default.KEY_SYSTEM_SELECTED,ue,t),L.on(l.default.KEY_SESSION_CREATED,ue,t),L.on(l.default.KEY_STATUSES_CHANGED,ue,t)),X.initializeForStream(J),L.trigger(l.default.STREAM_UPDATED,{streamInfo:J})},getStreamId:function(){return J?J.id:null},activate:function(e,t){return new Promise(function(r,n){if(!_)return Te()?(_=!0,L.trigger(l.default.STREAM_ACTIVATED,{streamInfo:J}),void r(t)):void function(e,t){return Z(e,t)}(e,t).then(function(e){_=!0,L.trigger(l.default.STREAM_ACTIVATED,{streamInfo:J}),r(e)}).catch(function(e){n(e)});r(t)})},deactivate:te,getIsActive:function(){return _},getDuration:function(){return J?J.duration:NaN},getStartTime:ae,getId:ie,getStreamInfo:se,getHasAudioTrack:function(){return S},getHasVideoTrack:function(){return T},startPreloading:function(e,t){return new Promise(function(n,a){Te()?a():(r.info("[startPreloading] Preloading next stream with id ".concat(ie())),ve(!0),Z(e,t).then(function(){for(var e=0;e<d.length&&d[e];e++)d[e].setExplicitBufferingTime(ae()),d[e].getScheduleController().startScheduleTimer();n()}).catch(function(){ve(!1),a()}))})},getThumbnailController:function(){return I},getBitrateListFor:function(e){if(oe(),e===n.default.IMAGE)return I?I.getBitrateList():[];var t=function(e){for(var t=null,r=0;r<d.length;r++)if((t=d[r]).getType()===e)return t.getMediaInfo();return null}(e);return Y.getBitrateList(t)},updateData:function(e){return new Promise(function(t){A=!0,J=e,V&&le();for(var r=[],n=0,a=d.length;n<a;n++){var i=d[n],s=i.getMediaInfo();r.push(i.updateStreamInfo(J));var o=U.getAllMediaInfoForType(J,i.getType());if(o){i.clearMediaInfoArray();for(var u=0;u<o.length;u++){var c=o[u];i.addMediaInfo(o[u]),U.areMediaInfosEqual(s,c)&&(Y.updateTopQualityIndex(c),r.push(i.selectMediaInfo(c)))}}}Promise.all(r).then(function(){for(r=[];O.length>0;){var e=O.pop(),t=e.newMediaInfo,n=ge(e.oldMediaInfo);if(!n)return;r.push(n.prepareTrackSwitch()),n.selectMediaInfo(t)}return Promise.all(r)}).then(function(){A=!1,ce(),L.trigger(l.default.STREAM_UPDATED,{streamInfo:J}),t()})})},reset:function(e){R&&(R.reset(),R=null),Y&&J&&Y.clearDataForStream(J.id),C&&(C.reset(),C=null),re(e),J=null,L.off(l.default.DATA_UPDATE_COMPLETED,de,t),L.off(l.default.BUFFERING_COMPLETED,fe,t),L.off(l.default.INBAND_EVENTS,he,t),z&&(L.off(l.default.KEY_ERROR,ue,t),L.off(l.default.SERVER_CERTIFICATE_UPDATED,ue,t),L.off(l.default.LICENSE_REQUEST_COMPLETE,ue,t),L.off(l.default.KEY_SYSTEM_SELECTED,ue,t),L.off(l.default.KEY_SESSION_CREATED,ue,t),L.off(l.default.KEY_STATUSES_CHANGED,ue,t))},getProcessors:me,setMediaSource:function(e){for(var t=0;t<d.length;)ee(d[t].getMediaInfo())?(d[t].setMediaSource(e),t++):(d[t].reset(),d.splice(t,1));if(0===d.length){var n="No streams to play.";q.error(new h.default(f.default.MANIFEST_ERROR_ID_NOSTREAMS_CODE,n+"nostreams",j.getValue())),r.fatal(n)}},isMediaCodecCompatible:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return _e(e,n.default.VIDEO,t)&&_e(e,n.default.AUDIO,t)},isProtectionCompatible:function(e){return!e||ye(n.default.VIDEO,e)&&ye(n.default.AUDIO,e)},getPreloaded:Te,getIsEndedEventSignaled:function(){return M},setIsEndedEventSignaled:ne,getAdapter:function(){return U},getHasFinishedBuffering:function(){return v},setPreloaded:ve,startScheduleControllers:function(){for(var e=d.length,t=0;t<e&&d[t];t++)d[t].getScheduleController().startScheduleTimer()},prepareTrackChange:function(e){if(_&&J){v=!1;var t=e.newMediaInfo,a=j.getValue();U.setCurrentMediaInfo(J.id,t.type,t);var i=ge(t);if(i){var s=K.getTime();r.info("Stream - Process track changed at current time "+s),a.refreshManifestOnSwitchTrack?(O.push(e),B.getIsUpdating()||(r.debug("Stream - Refreshing manifest for switch track"),B.refreshManifest())):i.selectMediaInfo(t).then(function(){t.type!==n.default.VIDEO&&t.type!==n.default.AUDIO||Y.updateTopQualityIndex(t),i.prepareTrackSwitch()})}}},prepareQualityChange:function(e){var t=pe(e.mediaType);t&&t.prepareQualityChange(e)}},function(){try{D=Object(c.default)(P).getInstance(),r=D.getLogger(t),re(),N=Object(g.default)(P).getInstance(),C=Object(m.default)(P).create({updateEventName:l.default.SEGMENT_LOCATION_BLACKLIST_CHANGED,addBlacklistEventName:l.default.SEGMENT_LOCATION_BLACKLIST_ADD}),R=Object(s.default)(P).create({streamInfo:J,mediaPlayerModel:x,dashMetrics:k,errHandler:q,settings:$,boxParser:N,dashConstants:a.default,urlUtils:F})}catch(e){throw e}}(),t}E.__dashjs_factory_name="Stream",t.default=d.default.getClassFactory(E)},"./src/streaming/StreamProcessor.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/Constants.js"),a=r("./src/dash/constants/DashConstants.js"),i=r("./src/streaming/constants/MetricsConstants.js"),s=r("./src/streaming/models/FragmentModel.js"),o=r("./src/streaming/controllers/BufferController.js"),u=r("./src/streaming/text/NotFragmentedTextBufferController.js"),l=r("./src/streaming/controllers/ScheduleController.js"),c=r("./src/dash/controllers/RepresentationController.js"),f=r("./src/core/FactoryMaker.js"),d=r("./src/streaming/utils/SupervisorTools.js"),h=r("./src/core/EventBus.js"),g=r("./src/core/events/Events.js"),p=r("./src/dash/DashHandler.js"),m=r("./src/core/errors/Errors.js"),y=r("./src/streaming/vo/DashJSError.js"),E=r("./src/core/Debug.js"),_=r("./src/streaming/utils/RequestModifier.js"),v=r("./src/streaming/utils/URLUtils.js"),T=r("./src/streaming/utils/BoxParser.js"),S=r("./src/streaming/vo/metrics/PlayList.js"),b=r("./src/dash/controllers/SegmentsController.js"),A=r("./src/streaming/vo/metrics/HTTPRequest.js");function R(e){e=e||{};var t,r,f,R,I,C,w,N,D,M,O,P,L,F=this.context,j=Object(h.default)(F).getInstance(),x=e.streamInfo,k=e.type,B=e.errHandler,U=e.mimeType,G=e.timelineConverter,H=e.adapter,q=e.manifestModel,Y=e.mediaPlayerModel,K=e.fragmentModel,V=e.abrController,W=e.playbackController,z=e.mediaController,X=e.textController,Q=e.dashMetrics,J=e.settings,$=e.boxParser,Z=e.segmentBlacklistController;function ee(){return x.id}function te(){return k}function re(){return H.getIsTextTrack(N.getData())}function ne(){I=[],R=null,L=0,D=!1,M=!1}function ae(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e.sender)if(W.getIsManifestUpdateInProgress())se();else if((!re()||X.isTextEnabled())&&C&&e.representationId&&!C.appendInitSegmentFromCache(e.representationId)){var r=N.getCurrentRepresentation();if(0===r.range)return void ie();var n=O?O.getInitRequest(R,r):null;n?K.executeRequest(n):t&&(w.setInitSegmentRequired(!0),se())}}function ie(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(W.getIsManifestUpdateInProgress()||C.getIsPruningInProgress())se();else{var a=function(){var e,t=ve();if(isNaN(L)||te()===n.default.TEXT&&!X.isTextEnabled())return null;var r=D;if(O){var a=N&&t?N.getRepresentationForQuality(t.quality):null;e=r?O.getSegmentRequestForTime(R,a,L):O.getNextSegmentRequest(R,a)}return e}();a?(D=!1,function(e){isNaN(e.startTime+e.duration)||(L=e.startTime+e.duration),e.delayLoadingTime=(new Date).getTime()+w.getTimeToLoadDelay(),w.setTimeToLoadDelay(0),function(e){var t=e.url;return e.range&&(t=t.concat("_",e.range)),Z.contains(t)}(e)?(r.warn("Fragment request url ".concat(e.url," for stream id ").concat(x.id," and media type ").concat(k," is on the ignore list and will be skipped")),se()):(r.debug("Next fragment request url for stream id ".concat(x.id," and media type ").concat(k," is ").concat(e.url)),K.executeRequest(e))}(a)):function(e){var t=N.getCurrentRepresentation();if(J.get().streaming.gaps.enableSeekFix&&!f&&D&&W.isSeeking()){var n=O.getValidSeekTimeCloseToTargetTime(L,R,t,J.get().streaming.gaps.threshold);if(!isNaN(n))return void W.seek(n,!1,!1)}if(O.isLastSegmentRequested(t,L)){var a=O.getCurrentIndex();return r.debug("Segment requesting for stream ".concat(x.id," has finished")),j.trigger(g.default.STREAM_REQUESTING_COMPLETED,{segmentIndex:a},{streamId:x.id,mediaType:k}),C.segmentRequestingCompleted(a),void w.clearScheduleTimer()}e&&se()}(t)}}function se(){w.startScheduleTimer(J.get().streaming.lowLatencyEnabled?J.get().streaming.scheduling.lowLatencyTimeout:J.get().streaming.scheduling.defaultTimeout)}function oe(e){e.error||(w.setCurrentRepresentation(H.convertRepresentationToRepresentationInfo(e.currentRepresentation)),C.getIsBufferingCompleted()||C.updateBufferTimestampOffset(e.currentRepresentation))}function ue(e){Q.addBufferState(k,e.state,w.getBufferTarget()),e.state!==i.default.BUFFER_EMPTY||W.isSeeking()||(r.info("Buffer is empty! Stalling!"),Q.pushPlayListTraceMetrics(new Date,S.PlayListTrace.REBUFFERING_REASON))}function le(e){K.syncExecutedRequestsWithBufferedRange(C.getBuffer().getAllBufferRanges(),x.duration),e.quotaExceeded&&e.from>W.getTime()&&Ie(e.from),e.hasEnoughSpaceToAppend&&e.quotaExceeded&&w.startScheduleTimer()}function ce(e){if(e&&e.lastRequestAppended&&e.lastRequestAppended.url){var t=e.lastRequestAppended.url;e.lastRequestAppended.range&&(t=t.concat("_",e.lastRequestAppended.range)),r.warn("Blacklisting segment with url ".concat(t)),Z.add(t)}}function fe(){Ae(),M=!1}function de(e){r.info("onFragmentLoadingAbandoned request: "+e.request.url+" has been aborted"),W.isSeeking()||w.getSwitchStrack()||M||(r.info("onFragmentLoadingAbandoned request: "+e.request.url+" has to be downloaded again, origin is not seeking process or switch track call"),e.request&&e.request.isInitializationRequest()?w.setInitSegmentRequired(!0):Ie(e.request.startTime+e.request.duration/2),w.startScheduleTimer(0))}function he(e){r.info("OnFragmentLoadingCompleted for stream id "+x.id+" and media type "+k+" - Url:",e.request?e.request.url:"undefined",e.request.range?", Range:"+e.request.range:""),re()&&w.startScheduleTimer(0),e.error&&e.request.serviceLocation&&function(e){r.info("Fragment loading completed with an error"),e&&e.request&&e.request.type&&(e.request.type===A.HTTPRequest.INIT_SEGMENT_TYPE?ae({representationId:e.request.representationId,sender:{}},!1):e.request.type===A.HTTPRequest.MEDIA_SEGMENT_TYPE&&(Ie(e.request.startTime+e.request.duration/2),ie({},!1)))}(e)}function ge(){Ie(W.getTime()),_e().startScheduleTimer()}function pe(e){var t=e.currentTrackInfo;if(t){var r=I.find(function(e){return e.index===t.index&&e.lang===t.lang});r&&Ee(r).then(function(){C.setIsBufferingCompleted(!1),Ie(W.getTime()),w.setInitSegmentRequired(!0),w.startScheduleTimer()})}}function me(e){Ie(e.quotaExceededTime),w.clearScheduleTimer()}function ye(){return C?C.getBuffer():null}function Ee(e){e===R||e&&R&&e.type!==R.type||(R=e);var t=H.getRealAdaptation(x,R),r=H.getVoRepresentations(R);if(N){var a,i=N.getData(),s=V.getMaxAllowedIndexFor(k,x.id),o=V.getMinAllowedIndexFor(k,x.id),u=null;return null!==i&&i.id===t.id||k===n.default.TEXT?a=V.getQualityFor(k,x.id):(u=V.getThroughputHistory().getAverageThroughput(k,f)||V.getInitialBitrateFor(k,x.id),a=V.getQualityForBitrate(R,u,x.id)),void 0!==o&&a<o&&(a=o),a>s&&(a=s),N.updateData(t,r,k,R.isFragmented,a)}return Promise.resolve()}function _e(){return w}function ve(e){var t;return void 0!==e?(Object(d.checkInteger)(e),t=N?N.getRepresentationForQuality(e):null):t=N?N.getCurrentRepresentation():null,H.convertRepresentationToRepresentationInfo(t)}function Te(){return!!C&&C.getIsBufferingCompleted()}function Se(e){var t=e.chunk,r=t.bytes,n=t.quality,a=ve(n),i=N&&a?N.getRepresentationForQuality(a.quality):null;if(a&&i){var o=H.getEventsFor(a.mediaInfo),u=H.getEventsFor(a,i);if(o&&o.length>0||u&&u.length>0){var l=function(e,t,r,n){try{for(var a={},i=[],s=r.concat(n),o=0,u=s.length;o<u;o++)a[s[o].schemeIdUri+"/"+s[o].value]=s[o];var l=Object(T.default)(F).getInstance().parse(e),c=l.getBoxes("emsg");if(!c||0===c.length)return i;for(var f=l.getBox("sidx"),d=!f||isNaN(f.earliest_presentation_time)||isNaN(f.timescale)?t&&!isNaN(t.mediaStartTime)?t.mediaStartTime:0:f.earliest_presentation_time/f.timescale,h=Math.max(d,0),g=N.getCurrentRepresentation(),p=0,m=c.length;p<m;p++){var y=H.getEvent(c[p],a,h,g);y&&i.push(y)}return i}catch(e){return[]}}(r,K.getRequests({state:s.default.FRAGMENT_MODEL_EXECUTED,quality:n,index:t.index})[0],o,u);j.trigger(g.default.INBAND_EVENTS,{events:l},{streamId:x.id})}}}function be(){var e=W.getTime();J.get().streaming.buffer.flushBufferAtTrackSwitch&&W.seek(e+.001,!1,!0),Ie(e),C.setSeekTarget(e),w.startScheduleTimer()}function Ae(){var e=W.getTime();Ie(C.getContinuousBufferTimeForTargetTime(e)),w.startScheduleTimer()}function Re(e){e&&!isNaN(e.time)&&(Ie(e.time),C.setSeekTarget(e.time))}function Ie(e){L=e,D=!0}return t={initialize:function(r,i,s){P=Object(b.default)(F).create({events:g.default,eventBus:j,streamInfo:x,timelineConverter:G,dashConstants:a.default,segmentBaseController:e.segmentBaseController,type:k}),O=Object(p.default)(F).create({streamInfo:x,type:k,timelineConverter:G,dashMetrics:Q,mediaPlayerModel:Y,baseURLController:e.baseURLController,errHandler:B,segmentsController:P,settings:J,boxParser:$,events:g.default,eventBus:j,errors:m.default,debug:Object(E.default)(F).getInstance(),requestModifier:Object(_.default)(F).getInstance(),dashConstants:a.default,constants:n.default,urlUtils:Object(v.default)(F).getInstance()}),f=x.manifestInfo.isDynamic,O.initialize(f),V.registerStreamType(k,t),N=Object(c.default)(F).create({streamInfo:x,type:k,abrController:V,dashMetrics:Q,playbackController:W,timelineConverter:G,dashConstants:a.default,events:g.default,eventBus:j,errors:m.default,isDynamic:f,segmentsController:P}),C=function(e,t){return e?e!==n.default.TEXT||t?Object(o.default)(F).create({streamInfo:x,type:e,mediaPlayerModel:Y,manifestModel:q,fragmentModel:K,errHandler:B,mediaController:z,representationController:N,adapter:H,textController:X,abrController:V,playbackController:W,settings:J}):Object(u.default)(F).create({streamInfo:x,type:e,mimeType:U,fragmentModel:K,textController:X,errHandler:B,settings:J}):(B.error(new y.default(m.default.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,m.default.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+"not properly defined")),null)}(k,s),C&&C.initialize(r),(w=Object(l.default)(F).create({streamInfo:x,type:k,mimeType:U,adapter:H,dashMetrics:Q,mediaPlayerModel:Y,fragmentModel:K,abrController:V,playbackController:W,textController:X,mediaController:z,bufferController:C,settings:J})).initialize(i),L=0,D=!1},getStreamId:ee,getType:te,isUpdating:function(){return!!N&&N.isUpdating()},getBufferController:function(){return C},getFragmentModel:function(){return K},getScheduleController:_e,getRepresentationController:function(){return N},getRepresentationInfo:ve,getBufferLevel:function(){return C?C.getBufferLevel():0},isBufferingCompleted:Te,createBufferSinks:function(e){var t=ye();return t?Promise.resolve(t):C?C.createBufferSink(R,e):Promise.resolve(null)},updateStreamInfo:function(e){return x=e,Te()?Promise.resolve():C.updateAppendWindow()},getStreamInfo:function(){return x},selectMediaInfo:Ee,clearMediaInfoArray:function(){I=[]},addMediaInfo:function(e){-1===I.indexOf(e)&&I.push(e)},prepareTrackSwitch:function(){return new Promise(function(e){r.debug("Preparing track switch for type ".concat(k));var t=k===n.default.TEXT||J.get().streaming.trackSwitchMode[k]===n.default.TRACK_SWITCH_MODE_ALWAYS_REPLACE&&W.getTimeToStreamEnd(x)>J.get().streaming.buffer.stallThreshold;if(C.getIsBufferingCompleted()&&!t)return C.prepareForNonReplacementTrackSwitch(R.codec).then(function(){j.trigger(g.default.BUFFERING_COMPLETED,{},{streamId:x.id,mediaType:k})}).catch(function(){j.trigger(g.default.BUFFERING_COMPLETED,{},{streamId:x.id,mediaType:k})}),void e();w.clearScheduleTimer(),w.setSwitchTrack(!0),t?(j.trigger(g.default.BUFFER_REPLACEMENT_STARTED,{mediaType:k,streamId:x.id},{mediaType:k,streamId:x.id}),K.abortRequests(),C.prepareForReplacementTrackSwitch(R.codec).then(function(){var e=ve();return C.updateBufferTimestampOffset(e)}).then(function(){be(),e()}).catch(function(){be(),e()})):C.prepareForNonReplacementTrackSwitch(R.codec).then(function(){Ae(),e()}).catch(function(){Ae(),e()})})},prepareQualityChange:function(e){r.debug("Preparing quality switch for type ".concat(k));var t=e.newQuality;M=!0,w.clearScheduleTimer();var n=ve(t);w.setCurrentRepresentation(n),N.prepareQualityChange(t),K.abortRequests(),C.updateBufferTimestampOffset(n).then(function(){e.reason&&e.reason.forceReplace?(j.trigger(g.default.BUFFER_REPLACEMENT_STARTED,{mediaType:k,streamId:x.id},{mediaType:k,streamId:x.id}),C.prepareForReplacementQualitySwitch().then(function(){be(),M=!1}).catch(function(){be(),M=!1})):J.get().streaming.buffer.fastSwitchEnabled?function(e){var t=W.getTime(),r=K.getRequests({state:s.default.FRAGMENT_MODEL_EXECUTED,time:t+1.5,threshold:0})[0];if(r&&!re()){var n=C.getBufferLevel(),a=V.getAbandonmentStateFor(x.id,k);r.quality<e.quality&&n>=1.5&&a!==i.default.ABANDON_LOAD?(Ie(t+1.5),w.setCheckPlaybackQuality(!1),w.startScheduleTimer()):fe()}else w.startScheduleTimer();M=!1}(n):fe(),Q.pushPlayListTraceMetrics(new Date,S.PlayListTrace.REPRESENTATION_SWITCH_STOP_REASON),Q.createPlaylistTraceMetrics(n.id,1e3*W.getTime(),W.getPlaybackRate())})},getMediaInfo:function(){return R},getMediaSource:function(){return C.getMediaSource()},setMediaSource:function(e){C.setMediaSource(e)},getBuffer:ye,setExplicitBufferingTime:Ie,finalisePlayList:function(e,t){Q.pushPlayListTraceMetrics(e,t)},probeNextRequest:function(){var e=ve(),t=N&&e?N.getRepresentationForQuality(e.quality):null;return O.getNextSegmentRequestIdempotent(R,t)},prepareInnerPeriodPlaybackSeeking:function(e){return new Promise(function(t){w.clearScheduleTimer(),K.abortRequests(),C.prepareForPlaybackSeek().then(function(){var t=C.getAllRangesWithSafetyFactor(e.seekTime);return C.clearBuffers(t)}).then(function(){var r=C.getContinuousBufferTimeForTargetTime(e.seekTime);if(!isNaN(x.duration)&&isFinite(x.duration)&&r>=x.start+x.duration)C.setIsBufferingCompleted(!0),t();else{Ie(r),C.setSeekTarget(r);var n=[];n.push(C.updateAppendWindow());var a=ve();n.push(C.updateBufferTimestampOffset(a)),Promise.all(n).then(function(){w.setInitSegmentRequired(!0),w.setCheckPlaybackQuality(!1),w.startScheduleTimer(),t()})}}).catch(function(e){r.error(e)})})},prepareOuterPeriodPlaybackSeeking:function(){return new Promise(function(e,t){try{w.clearScheduleTimer(),K.abortRequests(),C.prepareForPlaybackSeek().then(function(){return C.pruneAllSafely()}).then(function(){e()})}catch(e){t(e)}})},reset:function(e,r){O&&O.reset(),C&&(C.reset(e,r),C=null),w&&(w.reset(),w=null),N&&(N.reset(),N=null),P&&(P=null),V&&V.unRegisterStreamType(ee(),k),j.off(g.default.DATA_UPDATE_COMPLETED,oe,t),j.off(g.default.INIT_FRAGMENT_NEEDED,ae,t),j.off(g.default.MEDIA_FRAGMENT_NEEDED,ie,t),j.off(g.default.MEDIA_FRAGMENT_LOADED,Se,t),j.off(g.default.BUFFER_LEVEL_STATE_CHANGED,ue,t),j.off(g.default.BUFFER_CLEARED,le,t),j.off(g.default.SEEK_TARGET,Re,t),j.off(g.default.FRAGMENT_LOADING_ABANDONED,de,t),j.off(g.default.FRAGMENT_LOADING_COMPLETED,he,t),j.off(g.default.SET_FRAGMENTED_TEXT_AFTER_DISABLED,ge,t),j.off(g.default.SET_NON_FRAGMENTED_TEXT,pe,t),j.off(g.default.QUOTA_EXCEEDED,me,t),j.off(g.default.SOURCE_BUFFER_ERROR,ce,t),ne(),k=null,x=null}},r=Object(E.default)(F).getInstance().getLogger(t),ne(),j.on(g.default.DATA_UPDATE_COMPLETED,oe,t,{priority:h.default.EVENT_PRIORITY_HIGH}),j.on(g.default.INIT_FRAGMENT_NEEDED,ae,t),j.on(g.default.MEDIA_FRAGMENT_NEEDED,ie,t),j.on(g.default.MEDIA_FRAGMENT_LOADED,Se,t),j.on(g.default.BUFFER_LEVEL_STATE_CHANGED,ue,t),j.on(g.default.BUFFER_CLEARED,le,t),j.on(g.default.SEEK_TARGET,Re,t),j.on(g.default.FRAGMENT_LOADING_ABANDONED,de,t),j.on(g.default.FRAGMENT_LOADING_COMPLETED,he,t),j.on(g.default.QUOTA_EXCEEDED,me,t),j.on(g.default.SET_FRAGMENTED_TEXT_AFTER_DISABLED,ge,t),j.on(g.default.SET_NON_FRAGMENTED_TEXT,pe,t),j.on(g.default.SOURCE_BUFFER_ERROR,ce,t),t}R.__dashjs_factory_name="StreamProcessor",t.default=f.default.getClassFactory(R)},"./src/streaming/XlinkLoader.js":function(e,t,r){r.r(t);var n=r("./src/streaming/vo/DashJSError.js"),a=r("./src/streaming/net/URLLoader.js"),i=r("./src/streaming/vo/metrics/HTTPRequest.js"),s=r("./src/streaming/vo/TextRequest.js"),o=r("./src/core/EventBus.js"),u=r("./src/core/events/Events.js"),l=r("./src/core/FactoryMaker.js"),c=r("./src/core/errors/Errors.js");function f(e){e=e||{};var t=this.context,r=Object(o.default)(t).getInstance(),l=Object(a.default)(t).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,errors:c.default});return{load:function(e,t,a){var o=function(i,s){t.resolved=!0,t.resolvedContent=i||null,r.trigger(u.default.XLINK_ELEMENT_LOADED,{element:t,resolveObject:a,error:i||s?null:new n.default(c.default.XLINK_LOADER_LOADING_FAILURE_ERROR_CODE,c.default.XLINK_LOADER_LOADING_FAILURE_ERROR_MESSAGE+e)})};if("urn:mpeg:dash:resolve-to-zero:2013"===e)o(null,!0);else{var f=new s.default(e,i.HTTPRequest.XLINK_EXPANSION_TYPE);l.load({request:f,success:function(e){o(e)},error:function(){o(null)}})}},reset:function(){l&&(l.abort(),l=null)}}}f.__dashjs_factory_name="XlinkLoader",t.default=l.default.getClassFactory(f)},"./src/streaming/constants/ConformanceViolationConstants.js":function(e,t,r){r.r(t),t.default={LEVELS:{SUGGESTION:"Suggestion",WARNING:"Warning",ERROR:"Error"},EVENTS:{NO_UTC_TIMING_ELEMENT:{key:"NO_UTC_TIMING_ELEMENT",message:"No UTCTiming element is present in the manifest. You may experience playback failures. For a detailed validation use https://conformance.dashif.org/"},NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE:{key:"NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE",message:'SMPTE 2052-1:2013 defines the attribute name as "imageType" and does not define "imagetype"'},INVALID_DVR_WINDOW:{key:"INVALID_DVR_WINDOW",message:"No valid segment found when applying a specification compliant DVR window calculation. Using SegmentTimeline entries as a fallback."}}}},"./src/streaming/constants/Constants.js":function(e,t,r){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}r.r(t);var a=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}var t,r;return t=e,(r=[{key:"init",value:function(){this.STREAM="stream",this.VIDEO="video",this.AUDIO="audio",this.TEXT="text",this.MUXED="muxed",this.IMAGE="image",this.STPP="stpp",this.TTML="ttml",this.VTT="vtt",this.WVTT="wvtt",this.ABR_STRATEGY_DYNAMIC="abrDynamic",this.ABR_STRATEGY_BOLA="abrBola",this.ABR_STRATEGY_L2A="abrL2A",this.ABR_STRATEGY_LoLP="abrLoLP",this.ABR_STRATEGY_THROUGHPUT="abrThroughput",this.ABR_FETCH_THROUGHPUT_CALCULATION_DOWNLOADED_DATA="abrFetchThroughputCalculationDownloadedData",this.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING="abrFetchThroughputCalculationMoofParsing",this.ABR_FETCH_THROUGHPUT_CALCULATION_AAST="abrFetchThroughputCalculationAAST",this.LIVE_CATCHUP_MODE_DEFAULT="liveCatchupModeDefault",this.LIVE_CATCHUP_MODE_LOLP="liveCatchupModeLoLP",this.MOVING_AVERAGE_SLIDING_WINDOW="slidingWindow",this.MOVING_AVERAGE_EWMA="ewma",this.BAD_ARGUMENT_ERROR="Invalid Arguments",this.MISSING_CONFIG_ERROR="Missing config parameter(s)",this.TRACK_SWITCH_MODE_ALWAYS_REPLACE="alwaysReplace",this.TRACK_SWITCH_MODE_NEVER_REPLACE="neverReplace",this.TRACK_SELECTION_MODE_FIRST_TRACK="firstTrack",this.TRACK_SELECTION_MODE_HIGHEST_BITRATE="highestBitrate",this.TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY="highestEfficiency",this.TRACK_SELECTION_MODE_WIDEST_RANGE="widestRange",this.TRACK_SELECTION_MODE_HIGHEST_SELECTION_PRIORITY="highestSelectionPriority",this.CMCD_MODE_QUERY="query",this.CMCD_MODE_HEADER="header",this.LOCATION="Location",this.INITIALIZE="initialize",this.TEXT_SHOWING="showing",this.TEXT_HIDDEN="hidden",this.CC1="CC1",this.CC3="CC3",this.UTF8="utf-8",this.SCHEME_ID_URI="schemeIdUri",this.START_TIME="starttime",this.SERVICE_DESCRIPTION_LL_SCHEME="urn:dvb:dash:lowlatency:scope:2019",this.SUPPLEMENTAL_PROPERTY_LL_SCHEME="urn:dvb:dash:lowlatency:critical:2019",this.XML="XML",this.ARRAY_BUFFER="ArrayBuffer",this.DVB_REPORTING_URL="dvb:reportingUrl",this.DVB_PROBABILITY="dvb:probability",this.VIDEO_ELEMENT_READY_STATES={HAVE_NOTHING:0,HAVE_METADATA:1,HAVE_CURRENT_DATA:2,HAVE_FUTURE_DATA:3,HAVE_ENOUGH_DATA:4}}}])&&n(t.prototype,r),e}());t.default=a},"./src/streaming/constants/MetricsConstants.js":function(e,t,r){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}r.r(t);var a=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}var t,r;return t=e,(r=[{key:"init",value:function(){this.TCP_CONNECTION="TcpList",this.HTTP_REQUEST="HttpList",this.TRACK_SWITCH="RepSwitchList",this.BUFFER_LEVEL="BufferLevel",this.BUFFER_LOADED="bufferLoaded",this.ABANDON_LOAD="abandonload",this.ALLOW_LOAD="allowload",this.BUFFER_EMPTY="bufferStalled",this.BUFFER_STATE="BufferState",this.DVR_INFO="DVRInfo",this.DROPPED_FRAMES="DroppedFrames",this.SCHEDULING_INFO="SchedulingInfo",this.REQUESTS_QUEUE="RequestsQueue",this.MANIFEST_UPDATE="ManifestUpdate",this.MANIFEST_UPDATE_STREAM_INFO="ManifestUpdatePeriodInfo",this.MANIFEST_UPDATE_TRACK_INFO="ManifestUpdateRepresentationInfo",this.PLAY_LIST="PlayList",this.DVB_ERRORS="DVBErrors"}}])&&n(t.prototype,r),e}());t.default=a},"./src/streaming/constants/ProtectionConstants.js":function(e,t,r){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}r.r(t);var a=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}var t,r;return t=e,(r=[{key:"init",value:function(){this.CLEARKEY_KEYSTEM_STRING="org.w3.clearkey",this.WIDEVINE_KEYSTEM_STRING="com.widevine.alpha",this.PLAYREADY_KEYSTEM_STRING="com.microsoft.playready",this.INITIALIZATION_DATA_TYPE_CENC="cenc",this.INITIALIZATION_DATA_TYPE_KEYIDS="keyids",this.INITIALIZATION_DATA_TYPE_WEBM="webm"}}])&&n(t.prototype,r),e}());t.default=a},"./src/streaming/controllers/AbrController.js":function(e,t,r){r.r(t);var n=r("./src/streaming/rules/abr/ABRRulesCollection.js"),a=r("./src/streaming/constants/Constants.js"),i=r("./src/streaming/constants/MetricsConstants.js"),s=r("./src/streaming/vo/BitrateInfo.js"),o=r("./src/streaming/models/FragmentModel.js"),u=r("./src/core/EventBus.js"),l=r("./src/core/events/Events.js"),c=r("./src/core/FactoryMaker.js"),f=r("./src/streaming/rules/RulesContext.js"),d=r("./src/streaming/rules/SwitchRequest.js"),h=r("./src/streaming/rules/SwitchRequestHistory.js"),g=r("./src/streaming/rules/DroppedFramesHistory.js"),p=r("./src/streaming/rules/ThroughputHistory.js"),m=r("./src/core/Debug.js"),y=r("./src/streaming/vo/metrics/HTTPRequest.js"),E=r("./src/streaming/utils/SupervisorTools.js"),_=r("./src/streaming/MediaPlayerEvents.js");function v(){var e,t,r,c,v,T,S,b,A,R,I,C,w,N,D,M,O,P,L,F,j,x,k,B,U,G=this.context,H=Object(m.default)(G).getInstance(),q=Object(u.default)(G).getInstance();function Y(){v={},T={},b={},S={},P={},j={},x={},k={},void 0===R&&(R=!1),L&&L.reset(),O=void 0,L=void 0,F=void 0,clearTimeout(A),A=null}function K(t){var n=t.request.mediaType,a=t.streamId;if(n&&a&&S[a]&&U.get().streaming.abr.autoSwitchBitrate[n]){var s=S[a][n];if(s){var u=Object(f.default)(G).create({abrController:e,streamProcessor:s,currentRequest:t.request,useBufferOccupancyABR:j[n],useL2AABR:x[n],useLoLPABR:k[n],videoModel:N}),l=r.shouldAbandonFragment(u,a);if(l.quality>d.default.NO_CHANGE){var h=s.getFragmentModel();h.getRequests({state:o.default.FRAGMENT_MODEL_LOADING,index:t.request.index})[0]&&(h.abortRequests(),b[a][n].state=i.default.ABANDON_LOAD,P[a][n].reset(),P[a][n].push({oldValue:Q(n,a),newValue:l.quality,confidence:1,reason:l.reason}),J(n,c.getActiveStreamInfo(),l.quality,l.reason),clearTimeout(A),A=setTimeout(function(){b[a][n].state=i.default.ALLOW_LOAD,A=null},U.get().streaming.abandonLoadTimeout))}}}}function V(e){e.mediaType===a.default.VIDEO&&(void 0!==O&&L.push(e.streamId,O,N.getPlaybackQuality()),O=e.newQuality)}function W(e){var r,n;e.metric!==i.default.HTTP_REQUEST||!e.value||e.value.type!==y.HTTPRequest.MEDIA_SEGMENT_TYPE||e.mediaType!==a.default.AUDIO&&e.mediaType!==a.default.VIDEO||F.push(e.mediaType,e.value,U.get().streaming.abr.useDeadTimeLatency),e.metric!==i.default.BUFFER_LEVEL||e.mediaType!==a.default.AUDIO&&e.mediaType!==a.default.VIDEO||(r=e.mediaType,n=.001*e.value.level,U.get().streaming.abr.ABRStrategy===a.default.ABR_STRATEGY_DYNAMIC&&function(e,r){var n=D.getStableBufferTime(),a=n,i=.5*n,s=j[e],o=r>(s?i:a);j[e]=o,o!==s&&(o?t.info("["+e+"] switching from throughput to buffer occupancy ABR rule (buffer: "+r.toFixed(3)+")."):t.info("["+e+"] switching from buffer occupancy to throughput ABR rule (buffer: "+r.toFixed(3)+")."))}(r,n))}function z(e,t){try{var r;return v[t]=v[t]||{},v[t].hasOwnProperty(e)||(v[t][e]=0),r=function(e,t){var r=v[t][e],n=r;if(!S[t]||!S[t][e])return n;var a=X(e,t);void 0!==a&&(n=Math.max(r,a));var i=function(e,t){try{var r=U.get().streaming.abr.maxBitrate[e];return r>-1?Z(S[t][e].getMediaInfo(),r,t):void 0}catch(e){return}}(e,t);return void 0!==i&&(n=Math.min(n,i)),n}(e,t),r=function(e,t,r){var n=v[r][t],a=U.get().streaming.abr.maxRepresentationRatio[t];return isNaN(a)||a>=1||a<0?e:Math.min(e,Math.round(n*a))}(r,e,t),r=function(e,t,r){if(t!==a.default.VIDEO||!U.get().streaming.abr.limitBitrateByPortal||!S[r]||!S[r][t])return e;R||te();var n=S[r][t].getStreamInfo(),i=w.getAdaptationForType(n.index,t,n).Representation,s=e;if(I>0&&C>0){for(;s>0&&i[s]&&I<i[s].width&&I-i[s-1].width<i[s].width-I;)s-=1;for(;s<i.length-1&&i[s].width===i[s+1].width;)s+=1}return s}(r,e,t),r}catch(e){return}}function X(e,t){try{return function(e,t){try{var r=U.get().streaming.abr.minBitrate[e];if(r>-1){var n=S[t][e].getMediaInfo(),a=ee(n),i=Z(n,r,t);return a[i]&&i<a.length-1&&a[i].bitrate<1e3*r&&i++,i}return}catch(e){return}}(e,t)}catch(e){return}}function Q(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;try{return t||(t=c.getActiveStreamInfo().id),e&&S[t]&&S[t][e]&&t?(T[t]=T[t]||{},T[t].hasOwnProperty(e)||(T[t][e]=0),T[t][e]):0}catch(e){return 0}}function J(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(t&&t.id&&e){var a=t.id,i=Q(e,a);Object(E.checkInteger)(r);var s=z(e,a);r!==i&&r>=0&&r<=s&&$(e,i,r,s,n,a)}}function $(e,r,n,a,i,s){if(e&&S[s]&&S[s][e]){var o=S[s][e].getStreamInfo(),u=o&&o.manifestInfo&&o.manifestInfo.isDynamic,c=B.getCurrentBufferLevel(e);t.info("Stream ID: "+s+" ["+e+"] switch from "+r+" to "+n+"/"+a+" (buffer: "+c+") "+(i?JSON.stringify(i):".")),T[s]=T[s]||{},T[s][e]=n;var f=function(e,t,r){if(t&&S&&S[e]&&S[e][t]){var n=ee(S[e][t].getMediaInfo());return n[r]?n[r]:null}return null}(s,e,n);q.trigger(l.default.QUALITY_CHANGE_REQUESTED,{oldQuality:r,newQuality:n,reason:i,streamInfo:o,bitrateInfo:f,maxIdx:a,mediaType:e},{streamId:o.id,mediaType:e});var d=F.getAverageThroughput(e,u);isNaN(d)||M.setSavedBitrateSettings(e,d)}}function Z(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=e&&e.type?S[r][e.type].getRepresentationInfo():null;if(U.get().streaming.abr.useDeadTimeLatency&&n&&a&&a.fragmentDuration){n/=1e3;var i=a.fragmentDuration;if(n>i)return 0;t*=1-n/i}for(var s=ee(e),o=s.length-1;o>=0;o--)if(1e3*t>=s[o].bitrate)return o;return 0}function ee(e){var t=[];if(!e||!e.bitrateList)return t;for(var r,n=e.bitrateList,a=e.type,i=0,o=n.length;i<o;i++)(r=new s.default).mediaType=a,r.qualityIndex=i,r.bitrate=n[i].bandwidth,r.width=n[i].width,r.height=n[i].height,r.scanType=n[i].scanType,t.push(r);return t}function te(){if(N){var e=U.get().streaming.abr.usePixelRatioInLimitBitrateByPortal&&window.hasOwnProperty("devicePixelRatio")?window.devicePixelRatio:1;I=N.getClientWidth()*e,C=N.getClientHeight()*e}}return e={initialize:function(){L=Object(g.default)(G).create(),F=Object(p.default)(G).create({settings:U}),(r=Object(n.default)(G).create({dashMetrics:B,mediaPlayerModel:D,settings:U})).initialize(),q.on(_.default.QUALITY_CHANGE_RENDERED,V,e),q.on(_.default.METRIC_ADDED,W,e),q.on(l.default.LOADING_PROGRESS,K,e)},isPlayingAtTopQuality:function(e){var t=e?e.id:null,r=Q(a.default.AUDIO,t),n=Q(a.default.VIDEO,t);return r===z(a.default.AUDIO,t)&&n===z(a.default.VIDEO,t)},updateTopQualityIndex:function(e){var t=e.type,r=e.streamInfo.id,n=e.representationCount-1;return v[r]=v[r]||{},v[r][t]=n,n},clearDataForStream:function(e){L&&L.clearForStream(e),S[e]&&delete S[e],P[e]&&delete P[e],b[e]&&delete b[e]},getThroughputHistory:function(){return F},getBitrateList:ee,getQualityForBitrate:Z,getTopBitrateInfoFor:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t||(t=c.getActiveStreamInfo().id),e&&S&&S[t]&&S[t][e]){var r=z(e,t),n=ee(S[t][e].getMediaInfo());return n[r]?n[r]:null}return null},getMinAllowedIndexFor:X,getMaxAllowedIndexFor:z,getInitialBitrateFor:function(e,t){if(function(){if(!M||!M.hasOwnProperty("getSavedBitrateSettings"))throw new Error(a.default.MISSING_CONFIG_ERROR)}(),e===a.default.TEXT)return NaN;var r=M.getSavedBitrateSettings(e),n=U.get().streaming.abr.initialBitrate[e],i=U.get().streaming.abr.initialRepresentationRatio[e];if(-1===n)if(i>-1){var s=S[t][e].getStreamInfo(),o=w.getAdaptationForType(s.index,e,s).Representation;n=Array.isArray(o)?o[Math.max(Math.round(o.length*i)-1,0)].bandwidth/1e3:0}else n=isNaN(r)?e===a.default.VIDEO?1e3:100:r;return n},getQualityFor:Q,getAbandonmentStateFor:function(e,t){return b[e]&&b[e][t]?b[e][t].state:null},setPlaybackQuality:J,checkPlaybackQuality:function(t,n){try{if(!(t&&S&&S[n]&&S[n][t]))return!1;if(L){var a=N.getPlaybackQuality();a&&L.push(n,O,a)}if(!U.get().streaming.abr.autoSwitchBitrate[t])return!1;var s=Q(t,n),o=Object(f.default)(G).create({abrController:e,switchHistory:P[n][t],droppedFramesHistory:L,streamProcessor:S[n][t],currentValue:s,useBufferOccupancyABR:j[t],useL2AABR:x[t],useLoLPABR:k[t],videoModel:N}),u=X(t,n),l=z(t,n),c=r.getMaxQuality(o),h=c.quality;return void 0!==u&&(h>d.default.NO_CHANGE?h:s)<u&&(h=u),h>l&&(h=l),P[n][t].push({oldValue:s,newValue:h}),h>d.default.NO_CHANGE&&h!==s&&(b[n][t].state===i.default.ALLOW_LOAD||h>s)&&($(t,s,h,l,c.reason,n),!0)}catch(e){return!1}},setElementSize:te,setWindowResizeEventCalled:function(e){R=e},registerStreamType:function(e,t){var r=t.getStreamInfo().id;S[r]||(S[r]={}),P[r]||(P[r]={}),b[r]||(b[r]={}),P[r][e]=Object(h.default)(G).create(),S[r][e]=t,b[r][e]={},b[r][e].state=i.default.ALLOW_LOAD,function(e){var t=U.get().streaming.abr.ABRStrategy;t===a.default.ABR_STRATEGY_L2A?(j[e]=!1,k[e]=!1,x[e]=!0):t===a.default.ABR_STRATEGY_LoLP?(j[e]=!1,k[e]=!0,x[e]=!1):t===a.default.ABR_STRATEGY_BOLA?(j[e]=!0,k[e]=!1,x[e]=!1):t===a.default.ABR_STRATEGY_THROUGHPUT?(j[e]=!1,k[e]=!1,x[e]=!1):t===a.default.ABR_STRATEGY_DYNAMIC&&(j[e]=!(!j||!j[e])&&j[e],k[e]=!1,x[e]=!1)}(e),e===a.default.VIDEO&&te()},unRegisterStreamType:function(e,t){try{S[e]&&S[e][t]&&delete S[e][t],P[e]&&P[e][t]&&delete P[e][t],b[e]&&b[e][t]&&delete b[e][t]}catch(e){}},setConfig:function(e){e&&(e.streamController&&(c=e.streamController),e.domStorage&&(M=e.domStorage),e.mediaPlayerModel&&(D=e.mediaPlayerModel),e.dashMetrics&&(B=e.dashMetrics),e.adapter&&(w=e.adapter),e.videoModel&&(N=e.videoModel),e.settings&&(U=e.settings))},reset:function(){Y(),q.off(l.default.LOADING_PROGRESS,K,e),q.off(_.default.QUALITY_CHANGE_RENDERED,V,e),q.off(_.default.METRIC_ADDED,W,e),r&&r.reset()}},t=H.getLogger(e),Y(),e}v.__dashjs_factory_name="AbrController";var T=c.default.getSingletonFactory(v);T.QUALITY_DEFAULT=0,c.default.updateSingletonFactory(v.__dashjs_factory_name,T),t.default=T},"./src/streaming/controllers/BaseURLController.js":function(e,t,r){r.r(t);var n=r("./src/streaming/models/BaseURLTreeModel.js"),a=r("./src/streaming/utils/BaseURLSelector.js"),i=r("./src/streaming/utils/URLUtils.js"),s=r("./src/dash/vo/BaseURL.js"),o=r("./src/core/FactoryMaker.js"),u=r("./src/core/EventBus.js"),l=r("./src/core/events/Events.js");function c(){var e,t,r,o,c=this.context,f=Object(u.default)(c).getInstance(),d=Object(i.default)(c).getInstance();return e={reset:function(){r.reset(),o.reset()},initialize:function(e){var n;r.setConfig({adapter:t}),n=e,r.update(n),o.chooseSelector(t.getIsDVB(n))},resolve:function(e){var t=r.getForPath(e).reduce(function(e,t){var r=o.select(t);return r?(d.isRelative(r.url)?e.url=d.resolve(r.url,e.url):(e.url=r.url,e.serviceLocation=r.serviceLocation),e.availabilityTimeOffset=r.availabilityTimeOffset,e.availabilityTimeComplete=r.availabilityTimeComplete,e):new s.default},new s.default);if(!d.isRelative(t.url))return t},setConfig:function(e){e.baseURLTreeModel&&(r=e.baseURLTreeModel),e.baseURLSelector&&(o=e.baseURLSelector),e.adapter&&(t=e.adapter)}},r=Object(n.default)(c).create(),o=Object(a.default)(c).create(),f.on(l.default.SERVICE_LOCATION_BLACKLIST_CHANGED,function(e){r.invalidateSelectedIndexes(e.entry)},e),e}c.__dashjs_factory_name="BaseURLController",t.default=o.default.getClassFactory(c)},"./src/streaming/controllers/BlacklistController.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/core/EventBus.js");function i(e){var t;e=e||{};var r=[],n=Object(a.default)(this.context).getInstance(),i=e.updateEventName,s=e.addBlacklistEventName;function o(e){-1===r.indexOf(e)&&(r.push(e),n.trigger(i,{entry:e}))}return t={add:o,contains:function(e){return!!(r.length&&e&&e.length)&&-1!==r.indexOf(e)},reset:function(){r=[]}},s&&n.on(s,function(e){o(e.entry)},t),t}i.__dashjs_factory_name="BlackListController",t.default=n.default.getClassFactory(i)},"./src/streaming/controllers/BufferController.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/Constants.js"),a=r("./src/streaming/constants/MetricsConstants.js"),i=r("./src/streaming/models/FragmentModel.js"),s=r("./src/streaming/SourceBufferSink.js"),o=r("./src/core/EventBus.js"),u=r("./src/core/events/Events.js"),l=r("./src/core/FactoryMaker.js"),c=r("./src/core/Debug.js"),f=r("./src/streaming/utils/InitCache.js"),d=r("./src/streaming/vo/DashJSError.js"),h=r("./src/core/errors/Errors.js"),g=r("./src/streaming/vo/metrics/HTTPRequest.js"),p=r("./src/streaming/MediaPlayerEvents.js"),m=.01,y="BufferController";function E(e){e=e||{};var t,r,l,E,_,v,T,S,b,A,R,I,C,w,N,D,M,O,P=this.context,L=Object(o.default)(P).getInstance(),F=e.errHandler,j=e.fragmentModel,x=e.representationController,k=e.adapter,B=e.textController,U=e.abrController,G=e.playbackController,H=e.streamInfo,q=e.type,Y=e.settings;function K(e){v=e}function V(e){return k.convertRepresentationToRepresentationInfo(x.getRepresentationForQuality(e))}function W(e){Y.get().streaming.cacheInitSegments&&(r.info("Init fragment finished loading saving to",q+"'s init cache"),N.save(e.chunk)),r.debug("Append Init fragment",q," with representationId:",e.chunk.representationId," and quality:",e.chunk.quality,", data size:",e.chunk.bytes.byteLength),X(e.chunk)}function z(e){X(e.chunk,e.request)}function X(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;b.append(e,t).then(function(e){J(e)}).catch(function(e){J(e)}),e.mediaInfo.type===n.default.VIDEO&&_e(u.default.VIDEO_CHUNK_RECEIVED,{chunk:e})}function Q(e){if(e&&e.length>0)for(var t=0,n=e.length;t<n;t++)r.debug("Buffered range: "+e.start(t)+" - "+e.end(t)+", currentTime = ",G.getTime())}function J(e){if(e.error)return 22===e.error.code&&function(){if(w=!0,_=.8*ye(),r.warn("Quota exceeded, Critical Buffer: "+_),_>0){var e=Math.max(.2*_,1),t=_-e,n=Math.min(Y.get().streaming.buffer.bufferTimeAtTopQuality,.9*t),a=Math.min(Y.get().streaming.buffer.bufferTimeAtTopQualityLongForm,.9*t),i={streaming:{buffer:{bufferToKeep:parseFloat(e.toFixed(5)),bufferTimeAtTopQuality:parseFloat(n.toFixed(5)),bufferTimeAtTopQualityLongForm:parseFloat(a.toFixed(5))}}};Y.update(i)}}(),void(22!==e.error.code&&Ee()||(r.warn("Clearing playback buffer to overcome quota exceed situation"),_e(u.default.QUOTA_EXCEEDED,{criticalBufferLevel:_,quotaExceededTime:e.chunk.start}),le(ue())));if(b&&(ae(),w=!1,(R=e.chunk)&&R.endFragment)){R&&!isNaN(R.index)&&(T=Math.max(R.index,T),ie());var t=b.getAllBufferRanges();R.segmentType===g.HTTPRequest.MEDIA_SEGMENT_TYPE&&(Q(t),ee(),function(){if(!isNaN(O))if(q===n.default.AUDIO||q===n.default.VIDEO){var e=G.getTime(),t=ne(O,0);if(e===O&&t)O=NaN;else{var r=x.getCurrentRepresentation().segmentDuration;(t=ne(O,r))&&(Y.get().streaming.buffer.enableSeekDecorrelationFix&&Math.abs(e-O)>r?O<=t.end&&(G.seek(Math.max(O,t.start),!1,!0),O=NaN):e<t.start&&(G.seek(t.start,!1,!0),O=NaN))}}else O=NaN}()),R&&_e(u.default.BYTES_APPENDED_END_FRAGMENT,{quality:R.quality,startTime:R.start,index:R.index,bufferedRanges:t,segmentType:R.segmentType,mediaType:q})}}function $(){return new Promise(function(e,t){var r=Z();if(!r||0===r.length)return ee(),void e();le(r).then(function(){e()}).catch(function(e){t(e)})})}function Z(e){var t=[],r=b.getAllBufferRanges();if(!r||0===r.length)return t;if(!e&&0!==e||isNaN(e))t.push({start:r.start(0),end:r.end(r.length-1)+.5});else{var n=function(e,t){var r=Y.get().streaming.buffer.bufferToKeep,n=t.start(0);if(e-n>r){var a=Math.max(0,e-r),s=j.getRequests({state:i.default.FRAGMENT_MODEL_EXECUTED,time:e,threshold:m})[0];if(s&&(a=Math.min(s.startTime,a)),a>0)return{start:n,end:a}}return null}(e,r),a=function(e,t){var r=t.end(t.length-1)+.5,n=H.manifestInfo.duration>=Y.get().streaming.buffer.longFormContentDurationThreshold?Y.get().streaming.buffer.bufferTimeAtTopQualityLongForm:Y.get().streaming.buffer.bufferTimeAtTopQuality;if(r-e>n){var a=e+n,s=j.getRequests({state:i.default.FRAGMENT_MODEL_EXECUTED,time:e,threshold:m})[0];if(s&&(a=Math.max(s.startTime+s.duration,a)),a<r)return{start:a,end:r}}return null}(e,r);n&&t.push(n),a&&t.push(a)}return t}function ee(){(!M||q===n.default.TEXT&&B.isTextEnabled())&&ae()}function te(){se()}function re(){se(),O=NaN}function ne(e,t){var r,n,a=b.getAllBufferRanges(),i=0,s=0,o=null,u=null,l=0,c=isNaN(t)?.15:t;if(null!=a){for(n=0,r=a.length;n<r;n++)if(i=a.start(n),s=a.end(n),null===o)l=Math.abs(i-e),(e>=i&&e<s||l<=c)&&(o=i,u=s);else{if(!((l=i-u)<=c))break;u=s}if(null!==o)return{start:o,end:u}}return null}function ae(){if(G){var e=Y.get().streaming.gaps.jumpGaps&&!isNaN(Y.get().streaming.gaps.smallGapLimit)?Y.get().streaming.gaps.smallGapLimit:NaN;E=Math.max(function(e,t){var r;return Y.get().streaming.gaps.jumpGaps&&(t=Y.get().streaming.gaps.smallGapLimit),null===(r=ne(e,t))?0:r.end-e}(G.getTime()||0,e),0),_e(u.default.BUFFER_LEVEL_UPDATED,{mediaType:q,bufferLevel:E}),se()}}function ie(){var e=T>=S-1,t=G.getTimeToStreamEnd(H)-E<=0;!e&&!t||l||(me(!0),r.debug("checkIfBufferingCompleted trigger BUFFERING_COMPLETED for stream id ".concat(H.id," and type ").concat(q)))}function se(){q!==n.default.AUDIO&&q!==n.default.VIDEO||((!Y.get().streaming.lowLatencyEnabled&&E<Y.get().streaming.buffer.stallThreshold||0===E)&&!l?oe(a.default.BUFFER_EMPTY):(l||E>=Y.get().streaming.buffer.stallThreshold||Y.get().streaming.lowLatencyEnabled&&E>0)&&oe(a.default.BUFFER_LOADED))}function oe(e){A===e||e===a.default.BUFFER_EMPTY&&0===G.getTime()||q===n.default.TEXT&&!B.isTextEnabled()||(A=e,_e(u.default.BUFFER_LEVEL_STATE_CHANGED,{state:e}),_e(e===a.default.BUFFER_LOADED?u.default.BUFFER_LOADED:u.default.BUFFER_EMPTY),r.debug(e===a.default.BUFFER_LOADED?"Got enough buffer to start":"Waiting for more buffer before starting playback"))}function ue(){var e=[],t=b.getAllBufferRanges();if(!t||0===t.length)return e;var r=G.getTime(),n=Math.max(0,r-Y.get().streaming.buffer.bufferToKeep),a=j.getRequests({state:i.default.FRAGMENT_MODEL_EXECUTED,time:r,threshold:m})[0];if(a)n=Math.min(a.startTime,n);else if(0===r&&G.getIsDynamic())return[];if(t.start(0)<=n){for(var s={start:0,end:n},o=0;o<t.length&&t.end(o)<=n;o++)s.end=t.end(o);s.start<s.end&&e.push(s)}return e}function le(e){return new Promise(function(t,r){if(e&&b&&0!==e.length){var n=[];e.forEach(function(e){n.push(function(e){return new Promise(function(t,r){e.resolve=t,e.reject=r,D.push(e)})}(e))}),C||ce(),Promise.all(n).then(function(){t()}).catch(function(e){r(e)})}else t()})}function ce(){try{if(0===D.length||!b)return r.debug("Nothing to prune, halt pruning"),D=[],void(C=!1);var e=b.getBuffer();if(!e||!e.buffered||0===e.buffered.length)return r.debug("SourceBuffer is empty (or does not exist), halt pruning"),D=[],void(C=!1);var t=D.shift();r.debug("".concat(q,": Removing buffer from: ").concat(t.start," to ").concat(t.end)),C=!0,G.getTime()<t.end&&me(!1),b.remove(t).then(function(e){fe(e)}).catch(function(e){fe(e)})}catch(e){C=!1}}function fe(e){r.debug("onRemoved buffer from:",e.from,"to",e.to),Q(b.getAllBufferRanges()),0===D.length&&(C=!1,ae()),e.unintended&&(r.warn("Detected unintended removal from:",e.from,"to",e.to,"setting streamprocessor time to",e.from),_e(u.default.SEEK_TARGET,{time:e.from})),C?ce():(M?M=!1:ae(),_e(u.default.BUFFER_CLEARED,{from:e.from,to:e.to,unintended:e.unintended,hasEnoughSpaceToAppend:Ee(),quotaExceeded:w}))}function de(e){return new Promise(function(t){e&&void 0!==e.MSETimeOffset&&b&&b.updateTimestampOffset?b.updateTimestampOffset(e.MSETimeOffset).then(function(){t()}).catch(function(){t()}):t()})}function he(){return b&&!l?b.updateAppendWindow(H):Promise.resolve()}function ge(){++I*(Y.get().streaming.wallclockTimeUpdateInterval/1e3)>=Y.get().streaming.buffer.bufferPruningInterval&&(I=0,b&&q!==n.default.TEXT&&(l||le(ue())))}function pe(){se()}function me(e){l!==e&&((l=e)?_e(u.default.BUFFERING_COMPLETED):S=Number.POSITIVE_INFINITY)}function ye(){try{var e,t,r=b.getAllBufferRanges(),n=0;if(!r)return n;for(t=0,e=r.length;t<e;t++)n+=r.end(t)-r.start(t);return n}catch(e){return 0}}function Ee(){var e=ye();return isNaN(e)||e<_}function _e(e,t){var r=t||{};L.trigger(e,r,{streamId:H.id,mediaType:q})}function ve(e,t){_=Number.POSITIVE_INFINITY,A=void 0,S=Number.POSITIVE_INFINITY,T=0,R=null,l=!1,C=!1,w=!1,E=0,I=0,D=[],O=NaN,b&&(e||t?b=null:b.abort().then(function(){b.reset(t),b=null})),M=!1}return t={initialize:function(e){K(e),L.on(u.default.INIT_FRAGMENT_LOADED,W,t),L.on(u.default.MEDIA_FRAGMENT_LOADED,z,t),L.on(u.default.WALLCLOCK_TIME_UPDATED,ge,t),L.on(p.default.PLAYBACK_PLAYING,re,t),L.on(p.default.PLAYBACK_PROGRESS,ee,t),L.on(p.default.PLAYBACK_TIME_UPDATED,ee,t),L.on(p.default.PLAYBACK_RATE_CHANGED,pe,t),L.on(p.default.PLAYBACK_STALLED,te,t)},getStreamId:function(){return H.id},getType:function(){return q},getBufferControllerType:function(){return y},createBufferSink:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return new Promise(function(a,i){if(N&&e&&v){var o=U.getQualityFor(q,H.id);b=Object(s.default)(P).create({mediaSource:v,textController:B,eventBus:L}),function(e,t,r){var a=V(r);return t&&t[q]&&(q===n.default.VIDEO||q===n.default.AUDIO)?b.initializeForStreamSwitch(e,a,t[q]):b.initializeForFirstUse(H,e,a)}(e,t,o).then(function(){return de(V(o))}).then(function(){a(b)}).catch(function(e){r.fatal("Caught error on create SourceBuffer: "+e),F.error(new d.default(h.default.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,h.default.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+q)),i(e)})}else a(null)})},getBuffer:function(){return b},getBufferLevel:function(){return E},getRangeAt:ne,setMediaSource:K,getMediaSource:function(){return v},appendInitSegmentFromCache:function(e){var t=N.extract(H.id,e);return!!t&&(r.info("Append Init fragment",q," with representationId:",t.representationId," and quality:",t.quality,", data size:",t.bytes.byteLength),X(t),!0)},getIsBufferingCompleted:function(){return l},setIsBufferingCompleted:me,getIsPruningInProgress:function(){return C},reset:function(e,t){L.off(u.default.INIT_FRAGMENT_LOADED,W,this),L.off(u.default.MEDIA_FRAGMENT_LOADED,z,this),L.off(u.default.WALLCLOCK_TIME_UPDATED,ge,this),L.off(p.default.PLAYBACK_PLAYING,re,this),L.off(p.default.PLAYBACK_PROGRESS,ee,this),L.off(p.default.PLAYBACK_TIME_UPDATED,ee,this),L.off(p.default.PLAYBACK_RATE_CHANGED,pe,this),L.off(p.default.PLAYBACK_STALLED,te,this),ve(e,t)},prepareForPlaybackSeek:function(){return l&&me(!1),b.abort()},prepareForReplacementTrackSwitch:function(e){return new Promise(function(t,r){b.abort().then(function(){return he()}).then(function(){return b.changeType(e)}).then(function(){return $()}).then(function(){me(!1),t()}).catch(function(e){r(e)})})},prepareForNonReplacementTrackSwitch:function(e){return new Promise(function(t,r){he().then(function(){return b.changeType(e)}).then(function(){t()}).catch(function(e){r(e)})})},prepareForReplacementQualitySwitch:function(){return new Promise(function(e,t){b.abort().then(function(){return he()}).then(function(){return $()}).then(function(){me(!1),e()}).catch(function(e){t(e)})})},updateAppendWindow:he,getAllRangesWithSafetyFactor:Z,getContinuousBufferTimeForTargetTime:function(e){try{var t=e,r=b.getAllBufferRanges();if(!r||0===r.length)return e;for(var n=0;t===e&&n<r.length;){var a=r.start(n),i=r.end(n);t>=a&&t<=i&&(t=i),n+=1}return t}catch(e){}},clearBuffers:le,pruneAllSafely:$,updateBufferTimestampOffset:de,setSeekTarget:function(e){O=e},segmentRequestingCompleted:function(e){isNaN(e)||(S=e,ie())}},r=Object(c.default)(P).getInstance().getLogger(t),N=Object(f.default)(P).getInstance(),ve(),t}E.__dashjs_factory_name=y,t.default=l.default.getClassFactory(E)},"./src/streaming/controllers/EventController.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/core/Debug.js"),i=r("./src/core/EventBus.js"),s=r("./src/streaming/MediaPlayerEvents.js"),o=r("./src/streaming/net/XHRLoader.js");function u(){var e,t,r,n,u,l,c,f,d,h,g,p="urn:mpeg:dash:event:2012",m="updated",y="added",E=this.context,_=Object(i.default)(E).getInstance();function v(){if(!c||!f)throw new Error("setConfig function has to be called previously")}function T(){g=!1,r={},n={},u=null,h=!1,l=Date.now()/1e3}function S(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e.eventStream.schemeIdUri,a=e.eventStream.value,i=e.id,s="discarded";t[n]||(t[n]=[]);var o=t[n].findIndex(function(e){return(!a||e.eventStream.value&&e.eventStream.value===a)&&e.id===i});return-1===o?(t[n].push(e),s=y):r&&(t[n][o]=e,s=m),s}function b(e){try{if(1==e.eventStream.value){var t,r=e.calculatedPresentationTime;t=4294967295==e.calculatedPresentationTime?NaN:e.calculatedPresentationTime+e.duration,_.trigger(s.default.MANIFEST_VALIDITY_CHANGED,{id:e.id,validUntil:r,newDuration:t,newManifestValidAfter:NaN},{mode:s.default.EVENT_MODE_ON_START})}}catch(e){}}function A(){try{if(!h){h=!0;var e=f.getTime(),t=e-l;t=l>0?Math.max(0,t):0,R(n,t,e),R(r,t,e),l=e,h=!1}}catch(e){h=!1}}function R(e,r,n){try{C(e,function(a){if(void 0!==a){var i=isNaN(a.duration)?0:a.duration;a.calculatedPresentationTime<=n&&a.calculatedPresentationTime+r+i>=n?w(a,e,s.default.EVENT_MODE_ON_START):(function(e,t,r){try{return e-t>r}catch(e){return!1}}(n,i+r,a.calculatedPresentationTime)||function(e){try{var t=e.eventStream.period.start+e.eventStream.period.duration;return e.calculatedPresentationTime>t}catch(e){return!1}}(a))&&(t.debug("Deleting event ".concat(a.id," as it is expired or invalid")),N(e,a))}})}catch(e){}}function I(e){try{var t=f.getTime();C(e,function(r){var n=r.eventStream&&r.eventStream.period&&!isNaN(r.eventStream.period.duration)?r.eventStream.period.duration:NaN,a=r.eventStream&&r.eventStream.period&&!isNaN(r.eventStream.period.start)?r.eventStream.period.start:NaN;if(!isNaN(n)&&!isNaN(a)){var i=r.calculatedPresentationTime;Math.abs(i-t)<300&&w(r,e,s.default.EVENT_MODE_ON_START)}})}catch(e){}}function C(e,t){try{if(e)for(var r=Object.keys(e),n=0;n<r.length;n++)e[r[n]].forEach(function(e){void 0!==e&&t(e)})}catch(e){}}function w(e,r,n){try{var a=f.getTime(),i=e.id;if(n===s.default.EVENT_MODE_ON_RECEIVE)return t.debug("Received event ".concat(i)),void _.trigger(e.eventStream.schemeIdUri,{event:e},{mode:n});e.eventStream.schemeIdUri===p&&1==e.eventStream.value?0===e.duration&&0===e.presentationTimeDelta||(t.debug("Starting manifest refresh event ".concat(i," at ").concat(a)),N(r,e),function(){try{v(),c.refreshManifest()}catch(e){}}()):"urn:mpeg:dash:event:callback:2015"===e.eventStream.schemeIdUri&&1==e.eventStream.value?(t.debug("Starting callback event ".concat(i," at ").concat(a)),N(r,e),function(e){try{Object(o.default)(E).create({}).load({method:"get",url:e,request:{responseType:"arraybuffer"}})}catch(e){throw e}}(e.messageData)):(t.debug("Starting event ".concat(i," at ").concat(a)),N(r,e),_.trigger(e.eventStream.schemeIdUri,{event:e},{mode:n}))}catch(e){}}function N(e,t){var r=t.eventStream.schemeIdUri,n=t.eventStream.value,a=t.id;e[r]=e[r].filter(function(e){return n&&e.eventStream.value&&e.eventStream.value!==n||e.id!==a}),0===e[r].length&&delete e[r]}return e={addInlineEvents:function(e){try{if(v(),e)for(var n=0;n<e.length;n++){var a=e[n],i=S(a,r,!0);i===y?(t.debug("Added inline event with id ".concat(a.id)),w(a,e,s.default.EVENT_MODE_ON_RECEIVE)):i===m&&t.debug("Updated inline event with id ".concat(a.id))}}catch(e){throw e}},addInbandEvents:function(e){try{v();for(var r=0;r<e.length;r++){var a=e[r];S(a,n,!1)===y?(a.eventStream.schemeIdUri===p&&void 0===n[a.id]&&b(a),t.debug("Added inband event with id "+a.id),w(a,e,s.default.EVENT_MODE_ON_RECEIVE)):t.debug("Inband event with scheme_id_uri ".concat(a.eventStream.schemeIdUri,", value ").concat(a.eventStream.value," and id ").concat(a.id," was ignored because it has been added before."))}A()}catch(e){throw e}},getInbandEvents:function(){return n},getInlineEvents:function(){return r},start:function(){try{v(),t.debug("Start Event Controller");var e=d.get().streaming.eventControllerRefreshDelay;g||isNaN(e)||(g=!0,u=setInterval(A,e))}catch(e){throw e}},setConfig:function(e){try{if(!e)return;e.manifestUpdater&&(c=e.manifestUpdater),e.playbackController&&(f=e.playbackController),e.settings&&(d=e.settings)}catch(e){throw e}},reset:function(){(function(){try{null!==u&&g&&(clearInterval(u),u=null,g=!1,function(){try{I(n),I(r)}catch(e){}}())}catch(e){throw e}})(),T()}},t=Object(a.default)(E).getInstance().getLogger(e),T(),e}u.__dashjs_factory_name="EventController",t.default=n.default.getSingletonFactory(u)},"./src/streaming/controllers/FragmentController.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/Constants.js"),a=r("./src/streaming/vo/DataChunk.js"),i=r("./src/streaming/models/FragmentModel.js"),s=r("./src/streaming/FragmentLoader.js"),o=r("./src/streaming/utils/RequestModifier.js"),u=r("./src/core/EventBus.js"),l=r("./src/core/events/Events.js"),c=r("./src/streaming/MediaPlayerEvents.js"),f=r("./src/core/errors/Errors.js"),d=r("./src/core/FactoryMaker.js"),h=r("./src/core/Debug.js");function g(e){e=e||{};var t,r,d,g=this.context,p=Object(u.default)(g).getInstance(),m=e.errHandler,y=e.mediaPlayerModel,E=e.dashMetrics,_=Object(h.default)(g).getInstance(),v=e.streamInfo;function T(){return v.id}function S(){for(var e in d)d[e].reset();d={}}function b(e){if(e.sender){var t=e.request,i=e.response,s=t.isInitializationRequest(),o=t.mediaInfo.streamInfo;if(e.error&&(t.mediaType===n.default.AUDIO||t.mediaType===n.default.VIDEO||t.mediaType===n.default.TEXT&&t.mediaInfo.isFragmented)&&p.trigger(l.default.SERVICE_LOCATION_BLACKLIST_ADD,{entry:e.request.serviceLocation}),i&&o){var u=function(e,t,r,n){var i=new a.default;return i.streamId=r,i.mediaInfo=t.mediaInfo,i.segmentType=t.type,i.start=t.startTime,i.duration=t.duration,i.end=i.start+i.duration,i.bytes=e,i.index=t.index,i.quality=t.quality,i.representationId=t.representationId,i.endFragment=n,i}(i,t,v.id,e.type!==l.default.FRAGMENT_LOADING_PROGRESS);p.trigger(s?l.default.INIT_FRAGMENT_LOADED:l.default.MEDIA_FRAGMENT_LOADED,{chunk:u,request:t},{streamId:o.id,mediaType:t.mediaType})}else r.warn("No "+t.mediaType+" bytes to push or stream is inactive.")}}return t={getStreamId:T,getModel:function(t){var r=d[t];return r||(r=Object(i.default)(g).create({streamInfo:v,type:t,dashMetrics:E,fragmentLoader:Object(s.default)(g).create({dashMetrics:E,mediaPlayerModel:y,errHandler:m,requestModifier:Object(o.default)(g).getInstance(),settings:e.settings,boxParser:e.boxParser,eventBus:p,events:l.default,errors:f.default,dashConstants:e.dashConstants,urlUtils:e.urlUtils,streamId:T()}),debug:_,eventBus:p,events:l.default}),d[t]=r),r},reset:function(){p.off(c.default.FRAGMENT_LOADING_COMPLETED,b,this),p.off(c.default.FRAGMENT_LOADING_PROGRESS,b,this),S()}},r=_.getLogger(t),S(),p.on(c.default.FRAGMENT_LOADING_COMPLETED,b,t),p.on(c.default.FRAGMENT_LOADING_PROGRESS,b,t),t}g.__dashjs_factory_name="FragmentController",t.default=d.default.getClassFactory(g)},"./src/streaming/controllers/GapController.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/core/Debug.js"),i=r("./src/core/events/Events.js"),s=r("./src/core/EventBus.js");function o(){var e,t,r,n,o,u,l,c,f,d,h,g,p=this.context,m=Object(s.default)(p).getInstance();function y(){g.debug("Stopping the gap controller"),o&&(clearInterval(o),o=null),function(){m.off(i.default.WALLCLOCK_TIME_UPDATED,S,this),m.off(i.default.INITIAL_STREAM_SWITCH,T,this),m.off(i.default.PLAYBACK_SEEKING,E,this),m.off(i.default.BUFFER_REPLACEMENT_STARTED,_,e),m.off(i.default.TRACK_CHANGE_RENDERED,v,e)}(),o=null,u=NaN,n=0,d=null,h={}}function E(){d&&(clearTimeout(d),d=null)}function _(e){try{if(e.streamId!==c.getActiveStreamInfo().id||!e.mediaType)return;e.streamId===c.getActiveStreamInfo().id&&(h[e.mediaType]=!0)}catch(e){g.error(e)}}function v(e){e&&e.mediaType&&(h[e.mediaType]=!1)}function T(){o||function(){try{o||(g.debug("Starting the gap controller"),o=setInterval(function(){b()&&A(l.getTime())},100))}catch(e){}}()}function S(){if(b(r.get().streaming.gaps.enableSeekFix)&&++n>=10){var e=l.getTime();t===e?A(e,!0):(t=e,u=NaN),n=0}}function b(){var e,t,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],a=Object.keys(h).some(function(e){return h[e]}),i=!!n&&(e=c.getActiveStream(),t=parseFloat((e.getStartTime()+e.getDuration()).toFixed(5)),l.getTime()+r.get().streaming.gaps.threshold>=t);return!a&&r.get().streaming.gaps.jumpGaps&&c.getActiveStreamProcessors().length>0&&(!l.isSeeking()||i)&&!l.isPaused()&&!c.getIsStreamSwitchInProgress()&&!c.getHasMediaOrInitialisationError()}function A(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=r.get().streaming.gaps.smallGapLimit,i=r.get().streaming.gaps.jumpLargeGaps,s=f.getBufferRange(),o=NaN,h=!1;if(t=function(e,t){try{if(!e||e.length<=1&&t>0)return NaN;for(var n=NaN,a=0;isNaN(n)&&a<e.length;){var i=a>0?e.end(a-1):0;t<e.start(a)&&i-t<r.get().streaming.gaps.threshold&&(n=a),a+=1}return n}catch(e){return null}}(s,e),!isNaN(t)){var p=s.start(t),m=p-e;m>0&&(m<=a||i)&&(o=p)}var y=l.getTimeToStreamEnd();if(isNaN(o)&&n&&isFinite(y)&&!isNaN(y)&&y<a&&(o=parseFloat(l.getStreamEndTime().toFixed(5)),h=!0),o>0&&u!==o&&o>e&&!d){var E=o-e;if(h){var _=c.getStreamForTime(o),v=_&&!!_.getPreloaded();g.warn("Jumping to end of stream because of gap from ".concat(e," to ").concat(o,". Gap duration: ").concat(E)),l.seek(o,!0,v)}else{var T=l.getIsDynamic(),S=t>0?s.end(t-1):e,b=T?1e3*Math.max(0,E-.1):0;d=window.setTimeout(function(){l.seek(o,!0,!0),g.warn("Jumping gap occuring in period ".concat(c.getActiveStream().getStreamId()," starting at ").concat(S," and ending at ").concat(o,". Jumping by: ").concat(E-b/1e3)),d=null},b)}u=o}}return e={reset:y,setConfig:function(e){e&&(e.settings&&(r=e.settings),e.playbackController&&(l=e.playbackController),e.streamController&&(c=e.streamController),e.videoModel&&(f=e.videoModel))},initialize:function(){!function(){m.on(i.default.WALLCLOCK_TIME_UPDATED,S,this),m.on(i.default.INITIAL_STREAM_SWITCH,T,this),m.on(i.default.PLAYBACK_SEEKING,E,this),m.on(i.default.BUFFER_REPLACEMENT_STARTED,_,e),m.on(i.default.TRACK_CHANGE_RENDERED,v,e)}()}},g=Object(a.default)(p).getInstance().getLogger(e),y(),e}o.__dashjs_factory_name="GapController",t.default=n.default.getSingletonFactory(o)},"./src/streaming/controllers/MediaController.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/Constants.js"),a=r("./src/core/events/Events.js"),i=r("./src/core/EventBus.js"),s=r("./src/core/FactoryMaker.js"),o=r("./src/core/Debug.js");function u(){var e,t,r,s,u,l,c,f,d=this.context,h=Object(i.default)(d).getInstance();function g(e,t){return e&&r[t]&&r[t][e]?r[t][e].list:[]}function p(e,t){return e&&r[t]&&r[t][e]?r[t][e].current:null}function m(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e&&e.streamInfo){var i=e.type,o=e.streamInfo.id,u=p(i,o);if(r[o]&&r[o][i]&&!_(e,u)&&(r[o][i].current=e,r[o][i].current&&(i!==n.default.TEXT||i===n.default.TEXT&&e.isFragmented)&&h.trigger(a.default.CURRENT_TRACK_CHANGED,{oldMediaInfo:u,newMediaInfo:e,switchMode:s.get().streaming.trackSwitchMode[i]},{streamId:o}),!t)){var f=function(e){var t={lang:e.lang,viewpoint:e.viewpoint,roles:e.roles,accessibility:e.accessibility,audioChannelConfiguration:e.audioChannelConfiguration};return t.lang||t.viewpoint||t.role&&t.role.length>0||t.accessibility&&t.accessibility.length>0||t.audioChannelConfiguration&&t.audioChannelConfiguration.length>0?t:null}(e);if(!f||!r[o][i].storeLastSettings)return;f.roles&&(f.role=f.roles[0],delete f.roles),f.accessibility&&(f.accessibility=f.accessibility[0]),f.audioChannelConfiguration&&(f.audioChannelConfiguration=f.audioChannelConfiguration[0]),l[i]=f,c.setSavedMediaSettings(i,f)}}}function y(e,t){e&&t&&(u[e]=t)}function E(e){return e?u[e]:null}function _(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;var r=e.id===t.id,n=e.viewpoint===t.viewpoint,a=e.lang===t.lang,i=e.codec===t.codec,s=e.roles.toString()===t.roles.toString(),o=e.accessibility.toString()===t.accessibility.toString(),u=e.audioChannelConfiguration.toString()===t.audioChannelConfiguration.toString();return r&&i&&n&&a&&s&&o&&u}function v(){r={},l={},f=null,u={audio:null,video:null,text:null}}function T(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=!e.lang||t.lang.match(e.lang),i=void 0===e.index||null===e.index||t.index===e.index,s=!e.viewpoint||e.viewpoint===t.viewpoint,o=!e.role||!!t.roles.filter(function(t){return t===e.role})[0],u=!e.accessibility||!!t.accessibility.filter(function(t){return t===e.accessibility})[0],l=!e.audioChannelConfiguration||!!t.audioChannelConfiguration.filter(function(t){return t===e.audioChannelConfiguration})[0];return a&&i&&s&&(o||t.type===n.default.AUDIO&&r)&&u&&l}function S(e){var t,r=0,n=[];return e.forEach(function(e){(t=Math.max.apply(Math,e.bitrateList.map(function(e){return e.bandwidth})))>r?(r=t,n=[e]):t===r&&n.push(e)}),n}function b(e){var t,r=1/0,n=[];return e.forEach(function(e){var a=e.bitrateList.reduce(function(e,t){var r=Math.max(1,t.width*t.height);return e+t.bandwidth/r},0);(t=a/e.bitrateList.length)<r?(r=t,n=[e]):t===r&&n.push(e)}),n}function A(e){var t,r=0,n=[];return e.forEach(function(e){(t=e.representationCount)>r?(r=t,n=[e]):t===r&&n.push(e)}),n}function R(e,r){if(e===n.default.TEXT)return r[0];var a,i=s.get().streaming.selectionModeForInitialTrack;if(f&&"function"==typeof f)a=f(r);else switch(i){case n.default.TRACK_SELECTION_MODE_HIGHEST_SELECTION_PRIORITY:a=function(e){var t,r,n=(t=0,r=[],e.forEach(function(e){isNaN(e.selectionPriority)||(e.selectionPriority>t?(t=e.selectionPriority,r=[e]):e.selectionPriority===t&&r.push(e))}),r);return n.length>1&&(n=S(n)),n.length>1&&(n=A(n)),n}(r);break;case n.default.TRACK_SELECTION_MODE_HIGHEST_BITRATE:a=function(e){var t=S(e);return t.length>1&&(t=A(t)),t}(r);break;case n.default.TRACK_SELECTION_MODE_FIRST_TRACK:a=I(r);break;case n.default.TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY:a=function(e){var t=b(e);return t.length>1&&(t=S(t)),t}(r);break;case n.default.TRACK_SELECTION_MODE_WIDEST_RANGE:a=function(e){var t=A(e);return t.length>1&&(t=S(e)),t}(r);break;default:t.warn("Track selection mode ".concat(i," is not supported. Falling back to TRACK_SELECTION_MODE_FIRST_TRACK")),a=I(r)}return a.length>0?a[0]:r[0]}function I(e){return e[0]}return e={setInitialMediaSettingsForType:function(e,t){var r=l[e]||E(e),n=g(e,t.id),a=[];r||(r=c.getSavedMediaSettings(e),y(e,r)),n&&0!==n.length&&(r&&n.forEach(function(t){T(r,t,!!l[e])&&a.push(t)}),0===a.length?m(R(e,n),!0):a.length>1?m(R(e,a,l[e])):m(a[0]))},addTrack:function(e){if(e){var t=e.type;if((a=t)===n.default.AUDIO||a===n.default.VIDEO||a===n.default.TEXT||a===n.default.IMAGE){var a,i=e.streamInfo.id;r[i]||(r[i]={audio:{list:[],storeLastSettings:!0,current:null},video:{list:[],storeLastSettings:!0,current:null},text:{list:[],storeLastSettings:!0,current:null},image:{list:[],storeLastSettings:!0,current:null}});for(var s=r[i][t].list,o=0,u=s.length;o<u;++o)if(_(s[o],e))return;s.push(e)}}},getTracksFor:g,getCurrentTrackFor:p,isCurrentTrack:function(e){if(!e)return!1;var t=e.type,n=e.streamInfo.id;return r[n]&&r[n][t]&&_(r[n][t].current,e)},setTrack:m,selectInitialTrack:R,setCustomInitialTrackSelectionFunction:function(e){f=e},setInitialSettings:y,getInitialSettings:E,getTracksWithHighestBitrate:S,getTracksWithHighestEfficiency:b,getTracksWithWidestRange:A,isTracksEqual:_,matchSettings:T,saveTextSettingsDisabled:function(){c.setSavedMediaSettings(n.default.TEXT,null)},setConfig:function(e){e&&(e.domStorage&&(c=e.domStorage),e.settings&&(s=e.settings))},reset:v},t=Object(o.default)(d).getInstance().getLogger(e),v(),e}u.__dashjs_factory_name="MediaController";var l=s.default.getSingletonFactory(u);s.default.updateSingletonFactory(u.__dashjs_factory_name,l),t.default=l},"./src/streaming/controllers/MediaSourceController.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/core/Debug.js");function i(){var e,t,r,n=this.context;return e={createMediaSource:function(){var e="WebKitMediaSource"in window;return"MediaSource"in window?t=new MediaSource:e&&(t=new WebKitMediaSource),t},attachMediaSource:function(e){var r=window.URL.createObjectURL(t);return e.setSource(r),r},detachMediaSource:function(e){e.setSource(null)},setDuration:function e(n){t&&"open"===t.readyState&&(null===n&&isNaN(n)||t.duration!==n&&(function(e){for(var t=e.sourceBuffers,r=0;r<t.length;r++)if(t[r].updating)return!0;return!1}(t)?setTimeout(e.bind(null,n),50):(r.info("Set MediaSource duration:"+n),t.duration=n)))},setSeekable:function(e,r){t&&"function"==typeof t.setLiveSeekableRange&&"function"==typeof t.clearLiveSeekableRange&&"open"===t.readyState&&e>=0&&e<r&&(t.clearLiveSeekableRange(),t.setLiveSeekableRange(e,r))},signalEndOfStream:function(e){if(e&&"open"===e.readyState){for(var t=e.sourceBuffers,n=0;n<t.length;n++){if(t[n].updating)return;if(0===t[n].buffered.length)return}r.info("call to mediaSource endOfStream"),e.endOfStream()}}},r=Object(a.default)(n).getInstance().getLogger(e),e}i.__dashjs_factory_name="MediaSourceController",t.default=n.default.getSingletonFactory(i)},"./src/streaming/controllers/PlaybackController.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/Constants.js"),a=r("./src/streaming/constants/MetricsConstants.js"),i=r("./src/core/EventBus.js"),s=r("./src/core/events/Events.js"),o=r("./src/core/FactoryMaker.js"),u=r("./src/core/Debug.js"),l=r("./src/streaming/MediaPlayerEvents.js");function c(){var e,t,r,o,c,f,d,h,g,p,m,y,E,_,v,T,S,b,A,R,I,C,w=this.context,N=Object(i.default)(w).getInstance();function D(){return parseFloat((M(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)-x()).toFixed(5))}function M(e){var t=e||p;return t.start+t.duration}function O(){p&&f&&f.getElement()?f.play():E=!0}function P(){return p&&f?f.isPaused():null}function L(){p&&f&&f.pause()}function F(){return p&&f?f.isSeeking():null}function j(e,r,n){p&&f&&e!==(isNaN(T)?f.getTime():T)&&((S=!0===n)||(T=e,N.trigger(s.default.PLAYBACK_SEEK_ASKED)),t.info("Requesting seek to time: "+e+(S?" (internal)":"")),f.setCurrentTime(e,r))}function x(){return p&&f?f.getTime():null}function k(){var e=x();if(m&&!isNaN(v)){var t=v/1e3;e>t&&(e-=t)}return e}function B(){return p&&f?f.getPlaybackRate():null}function U(){return p&&f?f.getEnded():null}function G(){return m}function H(){if(!m||isNaN(v))return NaN;var e=k();if(isNaN(e)||0===e)return 0;var t=(new Date).getTime()+1e3*d.getClientTimeOffset();return Math.max(((t-v-1e3*e)/1e3).toFixed(3),0)}function q(){L(),E=!1,g=0,v=0,I=!1,T=NaN,f&&(N.off(s.default.DATA_UPDATE_COMPLETED,W,e),N.off(s.default.LOADING_PROGRESS,pe,e),N.off(s.default.MANIFEST_UPDATED,ve,e),N.off(s.default.STREAMS_COMPOSED,Te,e),N.off(l.default.BUFFER_LEVEL_STATE_CHANGED,me,e),N.off(l.default.PLAYBACK_PROGRESS,ce,e),N.off(l.default.PLAYBACK_TIME_UPDATED,ce,e),N.off(l.default.PLAYBACK_ENDED,ue,e),N.off(l.default.STREAM_INITIALIZING,Ee,e),N.off(l.default.REPRESENTATION_SWITCH,_e,e),f.setPlaybackRate(1,!0),K(),f.removeEventListener("canplay",z),f.removeEventListener("canplaythrough",X),f.removeEventListener("play",Q),f.removeEventListener("waiting",J),f.removeEventListener("playing",$),f.removeEventListener("pause",Z),f.removeEventListener("error",le),f.removeEventListener("seeking",ee),f.removeEventListener("seeked",te),f.removeEventListener("timeupdate",re),f.removeEventListener("progress",ne),f.removeEventListener("ratechange",ae),f.removeEventListener("loadedmetadata",ie),f.removeEventListener("loadeddata",se),f.removeEventListener("stalled",ye),f.removeEventListener("ended",oe)),h=null,f=null,p=null,m=null}function Y(){null===h&&(h=setInterval(function(){var e;N.trigger(s.default.WALLCLOCK_TIME_UPDATED,{isDynamic:m,time:new Date}),G()&&(r.addDVRMetric(),P()?(e=Date.now(),(!_||e>_+500)&&(_=e,re())):V())},C.get().streaming.wallclockTimeUpdateInterval))}function K(){clearInterval(h),h=null}function V(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!P()&&m&&0!==f.getReadyState()&&!F()&&!I){e||(e=r.hasVideoTrack()?n.default.VIDEO:n.default.AUDIO);var a=k(),i=function(e,t){var r=o.getCurrentDVRInfo(t),n=r?r.range:null;return n?e>n.end?Math.max(n.end-g,n.start):e>0&&e+.25<n.start&&Math.abs(e-n.start)<31536e4?C.get().streaming.lowLatencyEnabled?Math.max(n.end-g,n.start):n.start:e:NaN}(a,e);!isNaN(i)&&i!==a&&!F()&&(p&&f&&f.isStalled()||A||1===f.getReadyState())&&(t.debug("UpdateCurrentTime: Seek to actual time: ".concat(i," from currentTime: ").concat(a)),j(i))}}function W(e){var t=c.convertRepresentationToRepresentationInfo(e.currentRepresentation),r=t?t.mediaInfo.streamInfo:null;null!==r&&p.id===r.id&&(p=r)}function z(){N.trigger(s.default.CAN_PLAY)}function X(){N.trigger(s.default.CAN_PLAY_THROUGH)}function Q(){t.info("Native video element event: play"),V(),Y(),N.trigger(s.default.PLAYBACK_STARTED,{startTime:x()})}function J(){t.info("Native video element event: waiting"),N.trigger(s.default.PLAYBACK_WAITING,{playingTime:x()})}function $(){t.info("Native video element event: playing"),N.trigger(s.default.PLAYBACK_PLAYING,{playingTime:x()})}function Z(){t.info("Native video element event: pause"),N.trigger(s.default.PLAYBACK_PAUSED,{ended:U()})}function ee(){if(S)S=!1;else{var e=x();isNaN(T)||T===e||(e=T),T=NaN,t.info("Seeking to: "+e),Y(),N.trigger(s.default.PLAYBACK_SEEKING,{seekTime:e,streamId:p.id})}}function te(){t.info("Native video element event: seeked"),N.trigger(s.default.PLAYBACK_SEEKED)}function re(){p&&N.trigger(s.default.PLAYBACK_TIME_UPDATED,{timeToEnd:D(),time:x(),streamId:p.id})}function ne(){N.trigger(s.default.PLAYBACK_PROGRESS,{streamId:p.id})}function ae(){var e=B();t.info("Native video element event: ratechange: ",e),N.trigger(s.default.PLAYBACK_RATE_CHANGED,{playbackRate:e})}function ie(){t.info("Native video element event: loadedmetadata"),N.trigger(s.default.PLAYBACK_METADATA_LOADED),Y()}function se(){t.info("Native video element event: loadeddata"),N.trigger(s.default.PLAYBACK_LOADED_DATA)}function oe(){t.info("Native video element event: ended"),L(),K();var e=r?r.getActiveStreamInfo():null;e&&N.trigger(s.default.PLAYBACK_ENDED,{isLast:e.isLast})}function ue(e){if(h&&e.isLast){t.info("onPlaybackEnded -- PLAYBACK_ENDED but native video element didn't fire ended");var r=e.seekTime?e.seekTime:M();f.setCurrentTime(r),L(),K()}}function le(e){var t=e.target||e.srcElement;N.trigger(s.default.PLAYBACK_ERROR,{error:t.error})}function ce(){m&&fe()&&C.get().streaming.liveCatchup.playbackRate>0&&!P()&&!F()&&(function(){try{if(fe()&&C.get().streaming.liveCatchup.playbackRate>0&&x()>0){var e=he(),t=H(),r=y.getLiveDelay(),a=y.getLiveCatchupLatencyThreshold(),i=C.get().streaming.liveCatchup.minDrift;return e===n.default.LIVE_CATCHUP_MODE_LOLP?function(e,t,r,n,a,i){try{var s=Math.abs(e-t);return(isNaN(i)||e<=i)&&(s>r||n<a)}catch(e){return!1}}(t,r,i,de(),C.get().streaming.liveCatchup.playbackBufferMin,a):function(e,t,r,n){try{return Math.abs(e-t)>n&&(isNaN(r)||e<=r)}catch(e){return!1}}(t,r,a,i)}}catch(e){return!1}}()?function(){if(f){var e,a=f.getPlaybackRate(),i=C.get().streaming.liveCatchup.playbackRate,s=H(),u=y.getLiveDelay(),l=de();he()===n.default.LIVE_CATCHUP_MODE_LOLP?(C.get().streaming.liveCatchup.minDrift,e=function(e,r,n,a,i,s,o){var u,l=e;if(s<i){var c=5*(s-i);u=1-l+2*l/(1+Math.pow(Math.E,-c)),t.debug("[LoL+ playback control_buffer-based] bufferLevel: "+s+", newRate: "+u)}else{if(Math.abs(r-n)<=.02*n)u=1;else{var f=5*(r-n);u=1-l+2*l/(1+Math.pow(Math.E,-f))}t.debug("[LoL+ playback control_latency-based] latency: "+r+", newRate: "+u)}return A&&s>n/2&&(A=!1),Math.abs(o-u)<=R&&(u=null),{newRate:u}}(i,s,u,0,C.get().streaming.liveCatchup.playbackBufferMin,l,a)):e=function(e,t,r,n,a){var i=t-r,s=5*i,o=1-e+2*e/(1+Math.pow(Math.E,-s));return A&&(n>r/2?A=!1:i>0&&(o=1)),Math.abs(a-o)<=R&&(o=null),{newRate:o}}(i,s,u,l,a);var c=e.newRate;c&&f.setPlaybackRate(c);var d=s-u;C.get().streaming.liveCatchup.maxDrift>0&&!b&&d>C.get().streaming.liveCatchup.maxDrift?(t.info("Low Latency catchup mechanism. Latency too high, doing a seek to live point"),b=!0,h=r&&r.hasVideoTrack()?n.default.VIDEO:n.default.AUDIO,(p=(g=o.getCurrentDVRInfo(h))?g.range:null)&&!isNaN(p.end)&&j(p.end-y.getLiveDelay(),!0,!1)):b=!1}var h,g,p}():ge())}function fe(){return C.get().streaming.liveCatchup.enabled||C.get().streaming.lowLatencyEnabled}function de(){var e=null;return r.getActiveStreamProcessors().forEach(function(t){var r=t.getBufferLevel();e=null===e?r:Math.min(e,r)}),e}function he(){var e=C.get().streaming.liveCatchup.playbackBufferMin;return C.get().streaming.liveCatchup.mode!==n.default.LIVE_CATCHUP_MODE_LOLP||null===e||isNaN(e)?n.default.LIVE_CATCHUP_MODE_DEFAULT:n.default.LIVE_CATCHUP_MODE_LOLP}function ge(){f&&f.setPlaybackRate(1)}function pe(e){if(!1===e.stream&&C.get().streaming.lowLatencyEnabled&&!isNaN(e.request.duration)){var r=1.2*e.request.duration;r>y.getLiveDelay()&&(t.warn("Browser does not support fetch API with StreamReader. Increasing live delay to be 20% higher than segment duration:",r.toFixed(2)),C.update({streaming:{delay:{liveDelay:r}}}))}}function me(e){e.streamId===p.id&&(fe()?e.state!==a.default.BUFFER_EMPTY||F()||A||(A=!0,ge()):C.get().streaming.buffer.setStallState&&f.setStallState(e.mediaType,e.state===a.default.BUFFER_EMPTY))}function ye(e){N.trigger(s.default.PLAYBACK_STALLED,{e})}function Ee(e){var r;(r=e.mediaInfo)&&r.supplementalProperties&&"true"===r.supplementalProperties[n.default.SUPPLEMENTAL_PROPERTY_LL_SCHEME]&&(t.debug("Low Latency critical SupplementalProperty set: Enabling low Latency"),C.update({streaming:{lowLatencyEnabled:!0}}))}function _e(e){var t=r.getActiveStreamInfo();if(C.get().streaming.lowLatencyEnabledByManifest&&e&&t&&e.currentRepresentation&&e.streamId&&e.streamId===t.id&&e.mediaType&&(e.mediaType===n.default.VIDEO||e.mediaType===n.default.AUDIO)){var a=!e.currentRepresentation.availabilityTimeComplete;a&&C.update({streaming:{lowLatencyEnabled:a}})}}function ve(){I=!0}function Te(){I=!1}return e={initialize:function(t,r){p=t,!0!==r&&function(){f.addEventListener("canplay",z),f.addEventListener("canplaythrough",X),f.addEventListener("play",Q),f.addEventListener("waiting",J),f.addEventListener("playing",$),f.addEventListener("pause",Z),f.addEventListener("error",le),f.addEventListener("seeking",ee),f.addEventListener("seeked",te),f.addEventListener("timeupdate",re),f.addEventListener("progress",ne),f.addEventListener("ratechange",ae),f.addEventListener("loadedmetadata",ie),f.addEventListener("loadeddata",se),f.addEventListener("stalled",ye),f.addEventListener("ended",oe),m=p.manifestInfo.isDynamic,b=!1,A=!1,S=!1;var t="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",r=/safari/.test(t)&&!/chrome/.test(t);R=r?.25:.02,N.on(s.default.DATA_UPDATE_COMPLETED,W,e),N.on(s.default.LOADING_PROGRESS,pe,e),N.on(s.default.MANIFEST_UPDATED,ve,e),N.on(s.default.STREAMS_COMPOSED,Te,e),N.on(l.default.BUFFER_LEVEL_STATE_CHANGED,me,e),N.on(l.default.PLAYBACK_PROGRESS,ce,e),N.on(l.default.PLAYBACK_TIME_UPDATED,ce,e),N.on(l.default.PLAYBACK_ENDED,ue,e,{priority:i.default.EVENT_PRIORITY_HIGH}),N.on(l.default.STREAM_INITIALIZING,Ee,e),N.on(l.default.REPRESENTATION_SWITCH,_e,e),E&&(E=!1,O())}()},setConfig:function(e){e&&(e.streamController&&(r=e.streamController),e.dashMetrics&&(o=e.dashMetrics),e.mediaPlayerModel&&(y=e.mediaPlayerModel),e.adapter&&(c=e.adapter),e.videoModel&&(f=e.videoModel),e.timelineConverter&&(d=e.timelineConverter),e.settings&&(C=e.settings))},getTimeToStreamEnd:D,getBufferLevel:de,getTime:x,getNormalizedTime:k,getIsManifestUpdateInProgress:function(){return I},getPlaybackRate:B,getPlayedRanges:function(){return p&&f?f.getPlayedRanges():null},getEnded:U,getIsDynamic:G,getStreamController:function(){return r},computeAndSetLiveDelay:function(e,r){var a,i,s,o=!isNaN(e)&&isFinite(e)?e:NaN,u=c.getSuggestedPresentationDelay();if(C.get().streaming.delay.applyServiceDescription&&isNaN(C.get().streaming.delay.liveDelay)&&isNaN(C.get().streaming.delay.liveDelayFragmentCount)&&function(e){if(e&&e.serviceDescriptions){for(var r=null,a=0;a<e.serviceDescriptions.length;a++){var i=e.serviceDescriptions[a];if(i.schemeIdUri===n.default.SERVICE_DESCRIPTION_LL_SCHEME){r=i;break}}r&&(r.latency&&r.latency.target>0&&(t.debug("Apply LL properties coming from service description. Target Latency (ms):",r.latency.target),C.update({streaming:{delay:{liveDelay:r.latency.target/1e3},liveCatchup:{minDrift:(r.latency.target+500)/1e3,maxDrift:r.latency.max>r.latency.target?(r.latency.max-r.latency.target+500)/1e3:void 0}}})),r.playbackRate&&r.playbackRate.max>1&&(t.debug("Apply LL properties coming from service description. Max PlaybackRate:",r.playbackRate.max),C.update({streaming:{liveCatchup:{playbackRate:r.playbackRate.max-1}}})))}}(r),a=y.getLiveDelay()?y.getLiveDelay():null===C.get().streaming.delay.liveDelayFragmentCount||isNaN(C.get().streaming.delay.liveDelayFragmentCount)||isNaN(o)?!0===C.get().streaming.delay.useSuggestedPresentationDelay&&null!==u&&!isNaN(u)&&u>0?u:isNaN(o)?r&&!isNaN(r.minBufferTime)?4*r.minBufferTime:4*p.manifestInfo.minBufferTime:4*o:o*C.get().streaming.delay.liveDelayFragmentCount,null!==(s=c.getAvailabilityStartTime())&&(v=s),r&&r.dvrWindowSize>0){var l=Math.max(r.dvrWindowSize-10,r.dvrWindowSize/2);i=Math.min(a,l)}else i=a;return g=i,i},getLiveDelay:function(){return g},getCurrentLiveLatency:H,play:O,isPaused:P,pause:L,isSeeking:F,getStreamEndTime:M,seek:j,reset:q,updateCurrentTime:V,getAvailabilityStartTime:function(){return v}},t=Object(u.default)(w).getInstance().getLogger(e),q(),e}c.__dashjs_factory_name="PlaybackController",t.default=o.default.getSingletonFactory(c)},"./src/streaming/controllers/ScheduleController.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/Constants.js"),a=r("./src/streaming/models/FragmentModel.js"),i=r("./src/core/EventBus.js"),s=r("./src/core/events/Events.js"),o=r("./src/core/FactoryMaker.js"),u=r("./src/core/Debug.js"),l=r("./src/streaming/constants/MetricsConstants.js"),c=r("./src/streaming/MediaPlayerEvents.js");function f(e){e=e||{};var t,r,o,f,d,h,g,p,m,y,E,_,v,T=this.context,S=Object(i.default)(T).getInstance(),b=e.dashMetrics,A=e.mediaPlayerModel,R=e.fragmentModel,I=e.abrController,C=e.playbackController,w=e.textController,N=e.type,D=e.bufferController,M=e.settings;function O(e){if(!D.getIsBufferingCompleted()){P();var t=isNaN(e)?0:e;h=setTimeout(L,t)}}function P(){h&&(clearTimeout(h),h=null)}function L(){try{if(function(){try{return N===n.default.TEXT&&!w.isTextEnabled()||C.isPaused()&&(!C.getStreamController().getInitialPlayback()||!C.getStreamController().getAutoPlay())&&!M.get().streaming.scheduling.scheduleWhilePaused}catch(e){return!1}}())return void P();if(function(){try{return f&&(isNaN(y)||E||(e=r.id,t=I.getMaxAllowedIndexFor(N,e),!(!isNaN(m)&&m==t||(o.info("Top quality "+N+" index has changed from "+m+" to "+t),m=t,0)))||!N||!f||b.getCurrentBufferLevel(N)<F())}catch(e){return!1}var e,t}()){var e=!1;v&&(e=I.checkPlaybackQuality(N,r.id)),e||(_||f.quality!==y||E?(E?(o.debug("Switch track for "+N+", representation id = "+f.id),E=!1):o.debug("Quality has changed, get init request for representationid = "+f.id),S.trigger(s.default.INIT_FRAGMENT_NEEDED,{representationId:f.id,sender:t},{streamId:r.id,mediaType:N}),v=!1,_=!1):(o.debug("Media segment needed for ".concat(N," and stream id ").concat(r.id)),S.trigger(s.default.MEDIA_FRAGMENT_NEEDED,{},{streamId:r.id,mediaType:N}),v=!0))}else O(M.get().streaming.lowLatencyEnabled?M.get().streaming.scheduling.lowLatencyTimeout:M.get().streaming.scheduling.defaultTimeout)}catch(e){O(M.get().streaming.lowLatencyEnabled?M.get().streaming.scheduling.lowLatencyTimeout:M.get().streaming.scheduling.defaultTimeout)}}function F(){var e=NaN;return N&&f?e=N===n.default.TEXT?function(){try{if(w.isTextEnabled()){if(isNaN(f.fragmentDuration)){var e=b.getCurrentSchedulingInfo(l.default.SCHEDULING_INFO);return e?e.duration:0}return f.fragmentDuration}return 0}catch(e){return 0}}():N===n.default.AUDIO&&g?function(){try{var e=b.getCurrentBufferLevel(n.default.VIDEO);return isNaN(f.fragmentDuration)?e+1:Math.max(e+1,f.fragmentDuration)}catch(e){return 0}}():function(){try{var e=f.mediaInfo.streamInfo;return I.isPlayingAtTopQuality(e)?e.manifestInfo.duration>=M.get().streaming.buffer.longFormContentDurationThreshold?M.get().streaming.buffer.bufferTimeAtTopQualityLongForm:M.get().streaming.buffer.bufferTimeAtTopQuality:A.getStableBufferTime()}catch(e){return A.getStableBufferTime()}}():e}function j(){x(!0)}function x(e){if(C&&R){var t=R.getRequests({state:a.default.FRAGMENT_MODEL_EXECUTED,time:C.getTime(),threshold:0})[0];t&&C.getTime()>=t.startTime&&((!p.mediaInfo||t.mediaInfo.type===p.mediaInfo.type&&t.mediaInfo.id!==p.mediaInfo.id)&&e&&S.trigger(s.default.TRACK_CHANGE_RENDERED,{mediaType:N,oldMediaInfo:p.mediaInfo,newMediaInfo:t.mediaInfo,streamId:r.id}),t.quality===p.quality&&t.adaptationIndex===p.adaptationIndex||!e||(o.debug("Quality change rendered for streamId ".concat(r.id," and type ").concat(N)),S.trigger(s.default.QUALITY_CHANGE_RENDERED,{mediaType:N,oldQuality:p.quality,newQuality:t.quality,streamId:r.id})),p={mediaInfo:t.mediaInfo,quality:t.quality,adaptationIndex:t.adaptationIndex})}}function k(e){o.debug("Appended bytes for ".concat(e.mediaType," and stream id ").concat(r.id)),(isNaN(e.index)||isNaN(y))&&(y=e.quality,o.info("["+N+"] lastInitializedRepresentationInfo changed to "+e.quality)),O(0)}function B(){R.abortRequests(),P()}function U(){M.get().streaming.scheduling.scheduleWhilePaused||O()}function G(e){b.updatePlayListTraceMetrics({playbackspeed:e.playbackRate.toString()})}function H(){v=!0,d=0,y=NaN,p={mediaInfo:void 0,quality:NaN,adaptationIndex:NaN},m=NaN,E=!1,_=!1}return t={initialize:function(e){g=e,S.on(s.default.BYTES_APPENDED_END_FRAGMENT,k,t),S.on(s.default.URL_RESOLUTION_FAILED,B,t),S.on(c.default.PLAYBACK_STARTED,U,t),S.on(c.default.PLAYBACK_RATE_CHANGED,G,t),S.on(c.default.PLAYBACK_TIME_UPDATED,j,t)},getType:function(){return N},getStreamId:function(){return r.id},setCurrentRepresentation:function(e){f=e},setTimeToLoadDelay:function(e){d=e},getTimeToLoadDelay:function(){return d},setSwitchTrack:function(e){E=e},getSwitchStrack:function(){return E},startScheduleTimer:O,clearScheduleTimer:P,reset:function(){S.off(s.default.BYTES_APPENDED_END_FRAGMENT,k,t),S.off(s.default.URL_RESOLUTION_FAILED,B,t),S.off(c.default.PLAYBACK_STARTED,U,t),S.off(c.default.PLAYBACK_RATE_CHANGED,G,t),S.off(c.default.PLAYBACK_TIME_UPDATED,j,t),P(),x(!1),H(),r=null},getBufferTarget:F,getPlaybackController:function(){return C},setCheckPlaybackQuality:function(e){v=e},setInitSegmentRequired:function(e){_=e}},o=Object(u.default)(T).getInstance().getLogger(t),H(),r=e.streamInfo,t}f.__dashjs_factory_name="ScheduleController",t.default=o.default.getClassFactory(f)},"./src/streaming/controllers/StreamController.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/Constants.js"),a=r("./src/streaming/constants/MetricsConstants.js"),i=r("./src/streaming/Stream.js"),s=r("./src/streaming/ManifestUpdater.js"),o=r("./src/core/EventBus.js"),u=r("./src/core/events/Events.js"),l=r("./src/core/FactoryMaker.js"),c=r("./src/streaming/vo/metrics/PlayList.js"),f=r("./src/core/Debug.js"),d=r("./src/streaming/utils/InitCache.js"),h=r("./src/streaming/utils/URLUtils.js"),g=r("./src/streaming/MediaPlayerEvents.js"),p=r("./src/streaming/controllers/TimeSyncController.js"),m=r("./src/streaming/controllers/MediaSourceController.js"),y=r("./src/streaming/vo/DashJSError.js"),E=r("./src/core/errors/Errors.js"),_=r("./src/streaming/controllers/EventController.js"),v=r("./src/streaming/constants/ConformanceViolationConstants.js");function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function S(){var e,t,r,l,S,b,A,R,I,C,w,N,D,M,O,P,L,F,j,x,k,B,U,G,H,q,Y,K,V,W,z,X,Q,J,$,Z,ee,te,re,ne,ae,ie,se,oe,ue=this.context,le=Object(o.default)(ue).getInstance();function ce(){!function(){try{var e=R.getStreamsInfo();if(!U&&0===e.length)throw new Error("There are no streams");U&&I.updateManifestUpdateInfo({currentTime:Q.getTime(),buffered:X.getBufferRange(),presentationStartTime:e[0].start,clientTimeOffset:k.getClientTimeOffset()}),B.length>0&&function(e){B=B.filter(function(r){var n=e.filter(function(e){return e.id===r.getId()}).length>0||r.getId()===U.getId();return n||(t.debug("Removing stream ".concat(r.getId())),r.reset(!0)),n})}(e);for(var r=[],n=0,a=e.length;n<a;n++){var i=e[n];r.push(de(i)),I.addManifestUpdateStreamInfo(i)}Promise.all(r).then(function(){U||he(e),le.trigger(u.default.STREAMS_COMPOSED),Me()}).catch(function(e){throw e})}catch(e){x.error(new y.default(E.default.MANIFEST_ERROR_ID_NOSTREAMS_CODE,e.message+"nostreamscomposed",A.getValue())),W=!0,ze()}}()}function fe(){ie=!0}function de(e){var t=Ye(e.id);return t?t.updateData(e):(t=Object(i.default)(ue).create({manifestModel:A,mediaPlayerModel:J,dashMetrics:I,manifestUpdater:S,adapter:R,timelineConverter:k,capabilities:r,capabilitiesFilter:l,errHandler:x,baseURLController:N,segmentBaseController:D,textController:H,abrController:O,playbackController:Q,eventController:L,mediaController:P,protectionController:G,videoModel:X,streamInfo:e,settings:ae}),B.push(t),t.initialize(),Promise.resolve())}function he(e){Ae();var r=I.getCurrentDVRInfo().range;if(r.end<r.start){se&&clearTimeout(se);var a=Math.min(1e3*(-1*(r.end-r.start)+2),2147483647);return t.debug("Waiting for ".concat(a," ms before playback can start")),le.trigger(u.default.AST_IN_FUTURE,{delay:a}),void(se=setTimeout(function(){he(e)},a))}if(R.getIsDynamic()&&B.length){var i=e[0].manifestInfo,s=function(e,t){try{var r=NaN;if(t&&!isNaN(t.maxFragmentDuration)&&isFinite(t.maxFragmentDuration))return t.maxFragmentDuration;if(e&&1===e.length){var a=e[0],i=[n.default.VIDEO,n.default.AUDIO,n.default.TEXT].reduce(function(e,t){var r=R.getMediaInfoForType(a,t);return r&&!1!==r.isFragmented&&e.push(r),e},[]).reduce(function(e,t){var r=R.getVoRepresentations(t);return r&&r.length>0&&r.forEach(function(t){t&&e.push(t)}),e},[]).reduce(function(e,t){var r=R.convertRepresentationToRepresentationInfo(t);return r&&r.fragmentDuration&&!isNaN(r.fragmentDuration)&&e.push(r.fragmentDuration),e},[]);r=Math.max.apply(Math,function(e){if(Array.isArray(e))return T(e)}(s=i)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(s)||function(e,t){if(e){if("string"==typeof e)return T(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?T(e,t):void 0}}(s)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}return isFinite(r)?r:NaN}catch(e){return NaN}var s}(e,i);Q.computeAndSetLiveDelay(s,i)}var o=function(){var e;if(R.getIsDynamic()){var r=I.getCurrentDVRInfo();e=(r&&r.range?r.range.end:0)-Q.getLiveDelay();var n=r?r.range:null;if(n){var a=je(!0);isNaN(a)||(t.info("Start time from URI parameters: "+a),e=Math.max(Math.min(e,a),n.start))}}else{e=Qe()[0].getStreamInfo().start;var i=je(!1);isNaN(i)||(t.info("Start time from URI parameters: "+i),e=Math.max(e,i))}return e}(),l=be(o),c=null!==l?l:B[0];le.trigger(u.default.INITIAL_STREAM_SWITCH,{startTime:o}),ge(c,null,o),ee||(ee=setInterval(function(){!K&&Q.getTimeToStreamEnd()<=0&&!Q.isSeeking()&&le.trigger(u.default.PLAYBACK_ENDED,{isLast:qe().isLast})},200))}function ge(e,r,n){try{if(K||!e||r===e&&e.getIsActive())return;K=!0,le.trigger(u.default.PERIOD_SWITCH_STARTED,{fromStreamInfo:r?r.getStreamInfo():null,toStreamInfo:e.getStreamInfo()});var a=!1;U=e,r&&(a=Te(e,r),r.deactivate(a)),n=isNaN(n)?!a&&r?e.getStreamInfo().start:NaN:n,t.info("Switch to stream ".concat(e.getId(),". Seektime is ").concat(n,", current playback time is ").concat(Q.getTime(),". Seamless period switch is set to ").concat(a)),re=re.filter(function(e){return e.getId()!==U.getId()}),Q.initialize(qe(),!!r),X.getElement()&&pe(n,a)}catch(e){K=!1}}function pe(e,r){var n;function a(){if(z&&"open"===z.readyState){t.debug("MediaSource is open!"),window.URL.revokeObjectURL(n),z.removeEventListener("sourceopen",a),z.removeEventListener("webkitsourceopen",a),Fe();var i=I.getCurrentDVRInfo();C.setSeekable(i.range.start,i.range.end),me(e,r)}}function i(){z.addEventListener("sourceopen",a,!1),z.addEventListener("webkitsourceopen",a,!1),n=C.attachMediaSource(X),t.debug("MediaSource attached to element. Waiting on open...")}z?r?me(e,r):(C.detachMediaSource(X),i()):(z=C.createMediaSource(),i())}function me(e,t){U.activate(z,t?te:void 0,e).then(function(t){if(t){var r=Object.keys(t);r.length>0&&t[r[0]].getBuffer().changeType&&(ne=!0),te=t}isNaN(e)||(le.trigger(u.default.SEEK_TARGET,{time:e},{streamId:U.getId()}),Q.seek(e,!1,!0),U.startScheduleControllers()),K=!1,le.trigger(u.default.PERIOD_SWITCH_COMPLETED,{toStreamInfo:qe()})})}function ye(e){var t=Q.getTime(),r=e.seekTime,n=be(r);n&&n!==U?n&&n!==U&&(Ee(t,r),function(e,t){var r=e&&!isNaN(e.seekTime)?e.seekTime:NaN,n=U.getProcessors().map(function(t){return t.prepareOuterPeriodPlaybackSeeking(e)});Promise.all(n).then(function(){ge(t,U,r)}).catch(function(e){x.error(e)})}(e,n)):(Ee(t,r),function(e){U.getProcessors().forEach(function(t){return t.prepareInnerPeriodPlaybackSeeking(e)}),Ue(c.PlayListTrace.USER_REQUEST_STOP_REASON)}(e)),Ge(c.PlayList.SEEK_START_REASON)}function Ee(e,t){_e()}function _e(){re&&re.length>0&&(re.forEach(function(e){e.deactivate(!0)}),re=[])}function ve(e){e.newMediaInfo.streamInfo.id===U.getId()&&(_e(),U.prepareTrackChange(e))}function Te(e,t){try{return ae.get().streaming.buffer.reuseExistingSourceBuffers&&(t.isProtectionCompatible(e)||ie)&&(ne||t.isMediaCodecCompatible(e,t))}catch(e){return!1}}function Se(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;z&&!e.getPreloaded()&&Te(e,t)&&e.startPreloading(z,te).then(function(){re.push(e)})}function be(e){if(isNaN(e))return null;for(var t=B.length,r=0;r<t;r++){var n=B[r];if(e<parseFloat((n.getStartTime()+n.getDuration()).toFixed(5)))return n}return null}function Ae(){try{var e=R.getIsDynamic(),t=R.getStreamsInfo()[0].manifestInfo,r=Q.getTime(),a=k.calcTimeShiftBufferWindow(B,e),i=Pe();if(void 0===a.start||void 0===a.end)return;i&&0!==i.length?i.forEach(function(e){I.addDVRInfo(e.getType(),r,t,a)}):I.addDVRInfo(n.default.VIDEO,r,t,a)}catch(e){}}function Re(e){if(Z&&Y){var t=J.getInitialBufferLevel();(isNaN(t)||t<=Q.getBufferLevel()||R.getIsDynamic()&&t>Q.getLiveDelay())&&(Z=!1,Ge(c.PlayList.INITIAL_PLAYOUT_START_REASON),Q.play())}e&&e.mediaType&&I.addBufferLevel(e.mediaType,new Date,1e3*e.bufferLevel)}function Ie(e){e.streamInfo.id===U.getId()&&e.reason&&e.reason.forceReplace&&_e(),Ye(e.streamInfo.id).prepareQualityChange(e)}function Ce(){if(ke()){var e=X.getPlaybackQuality();e&&I.addDroppedFrames(e)}}function we(){t.debug("[onPlaybackStarted]"),!Z&&$&&Ge(c.PlayList.RESUME_FROM_PAUSE_START_REASON),Z&&(Z=!1),$=!1}function Ne(e){t.debug("[onPlaybackPaused]"),e.ended||($=!0,Ue(c.PlayListTrace.USER_REQUEST_STOP_REASON))}function De(e){t.debug("Stream with id ".concat(e.streamInfo.id," finished buffering"));var r=e.streamInfo.isLast;z&&r?(t.info("[onStreamBufferingCompleted] calls signalEndOfStream of mediaSourceController."),C.signalEndOfStream(z)):Me()}function Me(){if(U&&U.getHasFinishedBuffering())for(var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;try{var t=e||U||null;if(t){var r=t.getStreamInfo();return B.filter(function(e){var t=e.getStreamInfo();return t.start>r.start&&r.id!==t.id})}}catch(e){return[]}}(U),t=0;t<e.length;){var r=e[t],n=0===t?U:e[t-1];!r.getPreloaded()&&n.getHasFinishedBuffering()&&z&&Se(r,n),t+=1}}function Oe(){ee&&(clearInterval(ee),ee=null)}function Pe(){return U?U.getProcessors():[]}function Le(e){if(U&&!U.getIsEndedEventSignaled()){U.setIsEndedEventSignaled(!0);var r=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)||U||null;if(!e)return null;for(var t=e.getStreamInfo(),r=t.start,n=0,a=-1,i=NaN;n<B.length;){var s=B[n].getStreamInfo(),o=s.start-r;o>0&&(isNaN(i)||o<i)&&t.id!==s.id&&(i=o,a=n),n+=1}return a>=0?B[a]:null}();r?(t.debug("StreamController onEnded, found next stream with id ".concat(r.getStreamInfo().id,". Switching from ").concat(U.getStreamInfo().id," to ").concat(r.getStreamInfo().id)),ge(r,U,NaN)):(t.debug("StreamController no next stream found"),U.setIsEndedEventSignaled(!1)),Ue(r?c.PlayListTrace.END_OF_PERIOD_STOP_REASON:c.PlayListTrace.END_OF_CONTENT_STOP_REASON)}e&&e.isLast&&Oe()}function Fe(e){var t=e||qe().manifestInfo.duration;C.setDuration(t)}function je(e){var t=M.getURIFragmentData();if(!t||!t.t)return NaN;var r=Qe()[0].getStreamInfo().start;t.t=t.t.split(",")[0];var n=-1!==t.t.indexOf("posix:")?"now"===t.t.substring(6)?Date.now()/1e3:parseInt(t.t.substring(6)):NaN;return e&&!isNaN(n)?n-Q.getAvailabilityStartTime()/1e3:parseInt(t.t)+r}function xe(e){if(e.error)W=!0,ze();else{t.info("Manifest updated... updating data system wide.");var r=e.manifest;R.updatePeriods(r);var n=R.getUTCTimingSources();!R.getIsDynamic()||n&&0!==n.length||le.trigger(g.default.CONFORMANCE_VIOLATION,{level:v.default.LEVELS.WARNING,event:v.default.EVENTS.NO_UTC_TIMING_ELEMENT});var a=R.getIsDynamic()?n.concat(J.getUTCTimingSources()):n,i=j.isHTTPS(e.manifest.url);a.forEach(function(e){e.value.replace(/.*?:\/\//g,"")===J.getDefaultUtcTimingSource().value.replace(/.*?:\/\//g,"")&&(e.value=e.value.replace(i?new RegExp(/^(http:)?\/\//i):new RegExp(/^(https:)?\/\//i),i?"https://":"http://"),t.debug("Matching default timing source protocol to manifest protocol: ",e.value))}),l.filterUnsupportedFeatures(r).then(function(){N.initialize(r),w.attemptSync(a,R.getIsDynamic())})}}function ke(){return!!U&&U.getHasVideoTrack()}function Be(){return!!U&&U.getHasAudioTrack()}function Ue(e,t){t=t||new Date,Pe().forEach(function(r){r.finalisePlayList(t,e)}),I.addPlayList()}function Ge(e){I.createPlaylistMetrics(1e3*Q.getTime(),e)}function He(e){if(e.error){var r="";switch(e.error.code){case 1:r="MEDIA_ERR_ABORTED";break;case 2:r="MEDIA_ERR_NETWORK";break;case 3:r="MEDIA_ERR_DECODE",oe.counts.mediaErrorDecode+=1;break;case 4:r="MEDIA_ERR_SRC_NOT_SUPPORTED";break;case 5:r="MEDIA_ERR_ENCRYPTED";break;default:r="UNKNOWN"}"MEDIA_ERR_DECODE"===r&&ae.get().errors.recoverAttempts.mediaErrorDecode>=oe.counts.mediaErrorDecode?function(){t.warn("A MEDIA_ERR_DECODE occured: Resetting the MediaSource");var e=Q.getTime();U.deactivate(!1),t.warn("MediaSource has been resetted. Resuming playback from time ".concat(e)),pe(e,!1)}():(V=!0,e.error.message&&(r+=" ("+e.error.message+")"),e.error.msExtendedCode&&(r+=" (0x"+(e.error.msExtendedCode>>>0).toString(16).toUpperCase()+")"),t.fatal("Video Element Error: "+r),e.error&&t.fatal(e.error),x.error(new y.default(e.error.code,r)),ze())}}function qe(){return U?U.getStreamInfo():null}function Ye(e){for(var t=0,r=B.length;t<r;t++)if(B[t].getId()===e)return B[t];return null}function Ke(){if(!(b&&b.hasOwnProperty("load")&&k&&k.hasOwnProperty("initialize")&&k.hasOwnProperty("reset")&&k.hasOwnProperty("getClientTimeOffset")&&A&&x&&I&&Q))throw new Error(n.default.MISSING_CONFIG_ERROR)}function Ve(e){isNaN(e.newDuration)||Fe(e.newDuration)}function We(){B=[],G=null,K=!1,U=null,V=!1,W=!1,Z=!0,$=!1,Y=!0,ee=null,ie=!1,ne=!1,re=[],se=null,oe={counts:{mediaErrorDecode:0}}}function ze(){Ke(),w.reset(),Ue(V||W?c.PlayListTrace.FAILURE_STOP_REASON:c.PlayListTrace.USER_REQUEST_STOP_REASON);for(var t=0,r=B?B.length:0;t<r;t++)B[t].reset(V);le.off(g.default.PLAYBACK_TIME_UPDATED,Ce,e),le.off(g.default.PLAYBACK_SEEKING,ye,e),le.off(g.default.PLAYBACK_ERROR,He,e),le.off(g.default.PLAYBACK_STARTED,we,e),le.off(g.default.PLAYBACK_PAUSED,Ne,e),le.off(g.default.PLAYBACK_ENDED,Le,e),le.off(g.default.METRIC_ADDED,Xe,e),le.off(g.default.MANIFEST_VALIDITY_CHANGED,Ve,e),le.off(g.default.BUFFER_LEVEL_UPDATED,Re,e),le.off(g.default.QUALITY_CHANGE_REQUESTED,Ie,e),u.default.KEY_SESSION_UPDATED&&le.off(u.default.KEY_SESSION_UPDATED,fe,e),le.off(u.default.MANIFEST_UPDATED,xe,e),le.off(u.default.STREAM_BUFFERING_COMPLETED,De,e),le.off(u.default.TIME_SYNCHRONIZATION_COMPLETED,ce,e),le.off(u.default.CURRENT_TRACK_CHANGED,ve,e),N.reset(),S.reset(),L.reset(),I.clearAllCurrentMetrics(),A.setValue(null),b.reset(),k.reset(),F.reset(),z&&(C.detachMediaSource(X),z=null),X=null,G&&(G=null,q=null,A.getValue()&&le.trigger(u.default.PROTECTION_DESTROYED,{data:A.getValue().url})),Oe(),le.trigger(u.default.STREAM_TEARDOWN_COMPLETE),We()}function Xe(e){if(e.metric===a.default.DVR_INFO){var t=Be()?n.default.AUDIO:n.default.VIDEO;e.mediaType===t&&C.setSeekable(e.value.range.start,e.value.range.end)}}function Qe(){return B}return e={initialize:function(t,r){Ke(),Y=t,q=r,k.initialize(),(S=Object(s.default)(ue).create()).setConfig({manifestModel:A,adapter:R,manifestLoader:b,errHandler:x,settings:ae}),S.initialize(),(L=Object(_.default)(ue).getInstance()).setConfig({manifestUpdater:S,playbackController:Q,settings:ae}),L.start(),w.setConfig({dashMetrics:I,baseURLController:N,errHandler:x,settings:ae}),w.initialize(),G&&(le.trigger(u.default.PROTECTION_CREATED,{controller:G}),G.setMediaElement(X.getElement()),q&&G.setProtectionData(q)),le.on(g.default.PLAYBACK_TIME_UPDATED,Ce,e),le.on(g.default.PLAYBACK_SEEKING,ye,e),le.on(g.default.PLAYBACK_ERROR,He,e),le.on(g.default.PLAYBACK_STARTED,we,e),le.on(g.default.PLAYBACK_PAUSED,Ne,e),le.on(g.default.PLAYBACK_ENDED,Le,e),le.on(g.default.METRIC_ADDED,Xe,e),le.on(g.default.MANIFEST_VALIDITY_CHANGED,Ve,e),le.on(g.default.BUFFER_LEVEL_UPDATED,Re,e),le.on(g.default.QUALITY_CHANGE_REQUESTED,Ie,e),u.default.KEY_SESSION_UPDATED&&le.on(u.default.KEY_SESSION_UPDATED,fe,e),le.on(u.default.MANIFEST_UPDATED,xe,e),le.on(u.default.STREAM_BUFFERING_COMPLETED,De,e),le.on(u.default.TIME_SYNCHRONIZATION_COMPLETED,ce,e),le.on(u.default.CURRENT_TRACK_CHANGED,ve,e)},getActiveStreamInfo:qe,addDVRMetric:Ae,hasVideoTrack:ke,hasAudioTrack:Be,getStreamById:Ye,getStreamForTime:be,getTimeRelativeToStreamId:function(e,t){for(var r=null,n=0,a=0,i=null,s=0;s<B.length;s++){if(a=(r=B[s]).getStartTime(),i=r.getDuration(),Number.isFinite(a)&&(n=a),r.getId()===t)return e-n;Number.isFinite(i)&&(n+=i)}return null},load:function(e){Ke(),b.load(e)},loadWithManifest:function(e){!function(){if(!S||!S.hasOwnProperty("setManifest"))throw new Error("initialize function has to be called previously")}(),S.setManifest(e)},getActiveStreamProcessors:Pe,setConfig:function(e){e&&(e.capabilities&&(r=e.capabilities),e.capabilitiesFilter&&(l=e.capabilitiesFilter),e.manifestLoader&&(b=e.manifestLoader),e.manifestModel&&(A=e.manifestModel),e.mediaPlayerModel&&(J=e.mediaPlayerModel),e.protectionController&&(G=e.protectionController),e.adapter&&(R=e.adapter),e.dashMetrics&&(I=e.dashMetrics),e.errHandler&&(x=e.errHandler),e.timelineConverter&&(k=e.timelineConverter),e.videoModel&&(X=e.videoModel),e.playbackController&&(Q=e.playbackController),e.textController&&(H=e.textController),e.abrController&&(O=e.abrController),e.mediaController&&(P=e.mediaController),e.settings&&(ae=e.settings),e.baseURLController&&(N=e.baseURLController),e.uriFragmentModel&&(M=e.uriFragmentModel),e.segmentBaseController&&(D=e.segmentBaseController))},setProtectionData:function(e){q=e,G&&G.setProtectionData(q)},getIsStreamSwitchInProgress:function(){return K},switchToVideoElement:function(e){U&&(Q.initialize(qe()),pe(e,!1))},getHasMediaOrInitialisationError:function(){return V||W},getStreams:Qe,getActiveStream:function(){return U},getInitialPlayback:function(){return Z},getAutoPlay:function(){return Y},reset:ze},t=Object(f.default)(ue).getInstance().getLogger(e),w=Object(p.default)(ue).getInstance(),C=Object(m.default)(ue).getInstance(),F=Object(d.default)(ue).getInstance(),j=Object(h.default)(ue).getInstance(),We(),e}S.__dashjs_factory_name="StreamController",t.default=l.default.getSingletonFactory(S)},"./src/streaming/controllers/TimeSyncController.js":function(e,t,r){r.r(t);var n=r("./src/streaming/vo/DashJSError.js"),a=r("./src/streaming/vo/metrics/HTTPRequest.js"),i=r("./src/core/EventBus.js"),s=r("./src/core/events/Events.js"),o=r("./src/core/errors/Errors.js"),u=r("./src/core/FactoryMaker.js"),l=r("./src/core/Debug.js"),c=r("./src/streaming/utils/URLUtils.js");function f(){var e,t,r,u,f,d,h,g,p,m,y,E,_,v,T,S,b=this.context,A=Object(i.default)(b).getInstance(),R=Object(c.default)(b).getInstance();function I(){g=[],p=[],m=null,y=null,_=null,E=NaN,r=!1,u=!1,v=f.get().streaming.utcSynchronization.timeBetweenSyncAttempts}function C(){f.get().streaming.utcSynchronization.enabled&&!r&&!u&&_&&_.value&&_.schemeIdUri&&!isNaN(E)&&!isNaN(f.get().streaming.utcSynchronization.backgroundAttempts)&&(y&&(Date.now()-y)/1e3<30||(g=[],u=!0,w(isNaN(f.get().streaming.utcSynchronization.backgroundAttempts)?2:f.get().streaming.utcSynchronization.backgroundAttempts)))}function w(e){try{if(e<=0)return void U();var t=Date.now();d[_.schemeIdUri](_.value,function(r){var n=Date.now(),a=D(t,n,r);g.push(a),w(e-1)},function(){U()})}catch(e){U()}}function N(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)||0;if(!p||0===p.length||e>=p.length)M();else{var t=p[e];if(t)if(d.hasOwnProperty(t.schemeIdUri)){var r=(new Date).getTime();d[t.schemeIdUri](t.value,function(e){var n=(new Date).getTime(),a=D(r,n,e);_=t,M(a)},function(){N(e+1)})}else N(e+1);else M()}}function D(e,t,r){return r-(t-(t-e)/2)}function M(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:NaN,n=isNaN(r);n&&f.get().streaming.utcSynchronization.useManifestDateHeaderTimeSource?(t=null!==(e=h.getLatestMPDRequestHeaderValueByID("Date"))?new Date(e).getTime():Number.NaN,isNaN(t)?B(!0):B(!1,t-Date.now())):B(n,r)}function O(e){var t=Date.parse(e);return isNaN(t)&&(t=function(e){var t,r,n=/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2})(?::([0-9]*)(\.[0-9]*)?)?(?:([+\-])([0-9]{2})([0-9]{2}))?/.exec(e);return t=Date.UTC(parseInt(n[1],10),parseInt(n[2],10)-1,parseInt(n[3],10),parseInt(n[4],10),parseInt(n[5],10),n[6]&&(parseInt(n[6],10)||0),n[7]&&1e3*parseFloat(n[7])||0),n[9]&&n[10]&&(r=60*parseInt(n[9],10)+parseInt(n[10],10),t+=("+"===n[8]?-1:1)*r*60*1e3),new Date(t).getTime()}(e)),t}function P(e){return Date.parse(e)}function L(e){return Date.parse(e)}function F(e,t,r){r()}function j(e,t,r){var n=O(e);isNaN(n)?r():t(n)}function x(e,t,r,n,i){var s,o,u=!1,l=new XMLHttpRequest,c=i?a.HTTPRequest.HEAD:a.HTTPRequest.GET,f=t.match(/\S+/g);if(t=f.shift(),s=function(){u||(u=!0,f.length?x(e,f.join(" "),r,n,i):n())},o=function(){var t,n;200===l.status&&(t=i?l.getResponseHeader("Date"):l.response,n=e(t),isNaN(n)||(r(n),u=!0))},R.isRelative(t)){var d=S.resolve();d&&(t=R.resolve(t,d.url))}l.open(c,t),l.timeout=5e3,l.onload=o,l.onloadend=s,l.send()}function k(e,t,r){x(L,e,t,r,!0)}function B(e,a){if(isNaN(E)||isNaN(a)||e||function(e){try{var r,n=G(e),a=isNaN(v)?30:v,i=isNaN(f.get().streaming.utcSynchronization.timeBetweenSyncAttemptsAdjustmentFactor)?2:f.get().streaming.utcSynchronization.timeBetweenSyncAttemptsAdjustmentFactor,s=isNaN(f.get().streaming.utcSynchronization.maximumTimeBetweenSyncAttempts)?600:f.get().streaming.utcSynchronization.maximumTimeBetweenSyncAttempts,o=isNaN(f.get().streaming.utcSynchronization.minimumTimeBetweenSyncAttempts)?2:f.get().streaming.utcSynchronization.minimumTimeBetweenSyncAttempts;n?(r=Math.min(a*i,s),t.debug("Increasing timeBetweenSyncAttempts to ".concat(r))):(r=Math.max(a/i,o),t.debug("Decreasing timeBetweenSyncAttempts to ".concat(r))),v=r}catch(e){}}(a),!e&&!isNaN(a)){m=Date.now(),r=!1;var i=isNaN(E);E=a,i&&C(),t.debug("Completed UTC sync. Setting client - server offset to ".concat(a))}e&&(_=null,r=!1,T.error(new n.default(o.default.TIME_SYNC_FAILED_ERROR_CODE,o.default.TIME_SYNC_FAILED_ERROR_MESSAGE))),A.trigger(s.default.UPDATE_TIME_SYNC_OFFSET,{offset:a}),A.trigger(s.default.TIME_SYNCHRONIZATION_COMPLETED)}function U(){if(g&&0!==g.length){var e=g.reduce(function(e,t){return e+t},0)/g.length;G(e)?t.debug("Completed background UTC sync. Offset is within allowed threshold and is not adjusted."):(t.debug("Completed background UTC sync. Setting client - server offset to ".concat(e)),E=e,A.trigger(s.default.UPDATE_TIME_SYNC_OFFSET,{offset:E})),u=!1,y=Date.now()}}function G(e){try{if(isNaN(E))return!0;var t=f.get().streaming.utcSynchronization.maximumAllowedDrift&&!isNaN(f.get().streaming.utcSynchronization.maximumAllowedDrift)?f.get().streaming.utcSynchronization.maximumAllowedDrift:100;return e>=E-t&&e<=E+t}catch(e){return!0}}return e={initialize:function(){I(),d={"urn:mpeg:dash:utc:http-head:2014":k,"urn:mpeg:dash:utc:http-xsdate:2014":x.bind(null,O),"urn:mpeg:dash:utc:http-iso:2014":x.bind(null,P),"urn:mpeg:dash:utc:direct:2014":j,"urn:mpeg:dash:utc:http-head:2012":k,"urn:mpeg:dash:utc:http-xsdate:2012":x.bind(null,O),"urn:mpeg:dash:utc:http-iso:2012":x.bind(null,P),"urn:mpeg:dash:utc:direct:2012":j,"urn:mpeg:dash:utc:http-ntp:2014":F,"urn:mpeg:dash:utc:ntp:2014":F,"urn:mpeg:dash:utc:sntp:2014":F}},attemptSync:function(e,t){p=e,r||(function(e){try{if(!e||!f.get().streaming.utcSynchronization.enabled)return!1;var t=isNaN(v)?30:v;return!(m&&t&&!isNaN(t))||(Date.now()-m)/1e3>=t}catch(e){return!0}}(t)?(r=!0,N()):A.trigger(s.default.TIME_SYNCHRONIZATION_COMPLETED))},setConfig:function(e){e&&(e.dashMetrics&&(h=e.dashMetrics),e.baseURLController&&(S=e.baseURLController),e.errHandler&&(T=e.errHandler),e.settings&&(f=e.settings))},reset:function(){I(),A.off(s.default.ATTEMPT_BACKGROUND_SYNC,C,e)}},t=Object(l.default)(b).getInstance().getLogger(e),A.on(s.default.ATTEMPT_BACKGROUND_SYNC,C,e),e}f.__dashjs_factory_name="TimeSyncController";var d=u.default.getSingletonFactory(f);d.HTTP_TIMEOUT_MS=5e3,u.default.updateSingletonFactory(f.__dashjs_factory_name,d),t.default=d},"./src/streaming/controllers/XlinkController.js":function(e,t,r){r.r(t);var n=r("./src/streaming/XlinkLoader.js"),a=r("./src/core/EventBus.js"),i=r("./src/core/events/Events.js"),s=r("./src/core/FactoryMaker.js"),o=r("./externals/xml2json.js"),u=r("./src/streaming/utils/URLUtils.js"),l=r("./src/dash/constants/DashConstants.js"),c="onLoad";function f(e){e=e||{};var t,r,s,f,d,h,g=this.context,p=Object(a.default)(g).getInstance(),m=Object(u.default)(g).getInstance();function y(e,t,r){var n,a,i={};i.elements=e,i.type=t,i.resolveType=r,0===i.elements.length&&_(i);for(var s=0;s<i.elements.length;s++)n=i.elements[s],a=m.isHTTPURL(n.url)?n.url:n.originalContent.BaseURL+n.url,h.load(a,n,i)}function E(e){var t,r,n="";if(t=e.element,r=e.resolveObject,t.resolvedContent){var a=0;0===t.resolvedContent.indexOf("<?xml")&&(a=t.resolvedContent.indexOf("?>")+2),n=t.resolvedContent.substr(0,a)+"<response>"+t.resolvedContent.substr(a)+"</response>",t.resolvedContent=d.xml_str2json(n)}(function(e){var t;for(t=0;t<e.elements.length;t++)if(!1===e.elements[t].resolved)return!1;return!0})(r)&&_(r)}function _(e){var t,r,n=[];if(function(e){var t,r,n,a,i,o,u=[];for(a=e.elements.length-1;a>=0;a--){if(r=(t=e.elements[a]).type+"_asArray",!t.resolvedContent||S())delete t.originalContent["xlink:actuate"],delete t.originalContent["xlink:href"],u.push(t.originalContent);else if(t.resolvedContent)for(i=0;i<t.resolvedContent[r].length;i++)n=t.resolvedContent[r][i],u.push(n);for(t.parentElement[r].splice(t.index,1),o=0;o<u.length;o++)t.parentElement[r].splice(t.index+o,0,u[o]);u=[]}e.elements.length>0&&s.run(f)}(e),"onActuate"===e.resolveType&&p.trigger(i.default.XLINK_READY,{manifest:f}),e.resolveType===c)switch(e.type){case l.default.PERIOD:for(t=0;t<f[l.default.PERIOD+"_asArray"].length;t++)(r=f[l.default.PERIOD+"_asArray"][t]).hasOwnProperty(l.default.ADAPTATION_SET+"_asArray")&&(n=n.concat(v(r[l.default.ADAPTATION_SET+"_asArray"],r,l.default.ADAPTATION_SET,c))),r.hasOwnProperty(l.default.EVENT_STREAM+"_asArray")&&(n=n.concat(v(r[l.default.EVENT_STREAM+"_asArray"],r,l.default.EVENT_STREAM,c)));y(n,l.default.ADAPTATION_SET,c);break;case l.default.ADAPTATION_SET:p.trigger(i.default.XLINK_READY,{manifest:f})}}function v(e,t,r,n){var a,i,s,o=[];for(i=e.length-1;i>=0;i--)(a=e[i]).hasOwnProperty("xlink:href")&&"urn:mpeg:dash:resolve-to-zero:2013"===a["xlink:href"]&&e.splice(i,1);for(i=0;i<e.length;i++)(a=e[i]).hasOwnProperty("xlink:href")&&a.hasOwnProperty("xlink:actuate")&&a["xlink:actuate"]===n&&(s=T(a["xlink:href"],t,r,i,n,a),o.push(s));return o}function T(e,t,r,n,a,i){return{url:e,parentElement:t,type:r,index:n,resolveType:a,originalContent:i,resolvedContent:null,resolved:!1}}function S(){return!1}return t={resolveManifestOnLoad:function(e){d=new o.default({escapeMode:!1,attributePrefix:"",arrayAccessForm:"property",emptyNodeForm:"object",stripWhitespaces:!1,enableToStringFunc:!1,ignoreRoot:!0,matchers:r}),(f=e).Period_asArray?y(v(f.Period_asArray,f,l.default.PERIOD,c),l.default.PERIOD,c):p.trigger(i.default.XLINK_READY,{manifest:f})},setMatchers:function(e){e&&(r=e)},setIron:function(e){e&&(s=e)},reset:function(){p.off(i.default.XLINK_ELEMENT_LOADED,E,t),h&&(h.reset(),h=null)}},p.on(i.default.XLINK_ELEMENT_LOADED,E,t),h=Object(n.default)(g).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,settings:e.settings}),t}f.__dashjs_factory_name="XlinkController",t.default=s.default.getClassFactory(f)},"./src/streaming/metrics/MetricsReporting.js":function(e,t,r){r.r(t);var n=r("./src/streaming/metrics/utils/DVBErrorsTranslator.js"),a=r("./src/streaming/metrics/MetricsReportingEvents.js"),i=r("./src/streaming/metrics/controllers/MetricsCollectionController.js"),s=r("./src/streaming/metrics/metrics/MetricsHandlerFactory.js"),o=r("./src/streaming/metrics/reporting/ReportingFactory.js");function u(){var e=this.context;return{createMetricsReporting:function(t){return Object(n.default)(e).getInstance({eventBus:t.eventBus,dashMetrics:t.dashMetrics,metricsConstants:t.metricsConstants,events:t.events}).initialise(),Object(i.default)(e).create(t)},getReportingFactory:function(){return Object(o.default)(e).getInstance()},getMetricsHandlerFactory:function(){return Object(s.default)(e).getInstance()}}}u.__dashjs_factory_name="MetricsReporting";var l=dashjs.FactoryMaker.getClassFactory(u);l.events=a.default,dashjs.FactoryMaker.updateClassFactory(u.__dashjs_factory_name,l),t.default=l},"./src/streaming/metrics/MetricsReportingEvents.js":function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}r.r(t);var s=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(o,e);var t,r,s=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,a=i(t);if(r){var s=i(this).constructor;e=Reflect.construct(a,arguments,s)}else e=a.apply(this,arguments);return function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function o(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=s.call(this)).METRICS_INITIALISATION_COMPLETE="internal_metricsReportingInitialized",e.BECAME_REPORTING_PLAYER="internal_becameReportingPlayer",e.CMCD_DATA_GENERATED="cmcdDataGenerated",e}return o}(r("./src/core/events/EventsBase.js").default));t.default=s},"./src/streaming/metrics/controllers/MetricsCollectionController.js":function(e,t,r){r.r(t);var n=r("./src/streaming/metrics/controllers/MetricsController.js"),a=r("./src/streaming/metrics/utils/ManifestParsing.js"),i=r("./src/streaming/metrics/MetricsReportingEvents.js");function s(e){var t;e=e||{};var r={},s=this.context,o=e.eventBus,u=e.events;function l(t){if(!t.error){var u=Object.keys(r);Object(a.default)(s).getInstance({adapter:e.adapter,constants:e.constants}).getMetrics(t.manifest).forEach(function(t){var a=JSON.stringify(t);if(r.hasOwnProperty(a))u.splice(a,1);else try{var i=Object(n.default)(s).create(e);i.initialize(t),r[a]=i}catch(e){}}),u.forEach(function(e){r[e].reset(),delete r[e]}),o.trigger(i.default.METRICS_INITIALISATION_COMPLETE)}}function c(){Object.keys(r).forEach(function(e){r[e].reset()}),r={}}return t={reset:function(){o.off(u.MANIFEST_UPDATED,l,t),o.off(u.STREAM_TEARDOWN_COMPLETE,c,t)}},o.on(u.MANIFEST_UPDATED,l,t),o.on(u.STREAM_TEARDOWN_COMPLETE,c,t),t}s.__dashjs_factory_name="MetricsCollectionController",t.default=dashjs.FactoryMaker.getClassFactory(s)},"./src/streaming/metrics/controllers/MetricsController.js":function(e,t,r){r.r(t);var n=r("./src/streaming/metrics/controllers/RangeController.js"),a=r("./src/streaming/metrics/controllers/ReportingController.js"),i=r("./src/streaming/metrics/controllers/MetricsHandlersController.js");function s(e){var t,r,s;e=e||{};var o=this.context;function u(){t&&t.reset(),r&&r.reset(),s&&s.reset()}return{initialize:function(l){try{(s=Object(n.default)(o).create({mediaElement:e.mediaElement})).initialize(l.Range),(r=Object(a.default)(o).create({debug:e.debug,metricsConstants:e.metricsConstants})).initialize(l.Reporting,s),(t=Object(i.default)(o).create({debug:e.debug,eventBus:e.eventBus,metricsConstants:e.metricsConstants,events:e.events})).initialize(l.metrics,r)}catch(e){throw u(),e}},reset:u}}s.__dashjs_factory_name="MetricsController",t.default=dashjs.FactoryMaker.getClassFactory(s)},"./src/streaming/metrics/controllers/MetricsHandlersController.js":function(e,t,r){r.r(t);var n=r("./src/streaming/metrics/metrics/MetricsHandlerFactory.js");function a(e){e=e||{};var t,r=[],a=this.context,i=e.eventBus,s=e.events,o=Object(n.default)(a).getInstance({debug:e.debug,eventBus:e.eventBus,metricsConstants:e.metricsConstants});function u(e){r.forEach(function(t){t.handleNewMetric(e.metric,e.value,e.mediaType)})}return t={initialize:function(e,n){e.split(",").forEach(function(e,t,a){var i;if(-1!==e.indexOf("(")&&-1===e.indexOf(")")){var s=a[t+1];s&&-1===s.indexOf("(")&&-1!==s.indexOf(")")&&(e+=","+s,delete a[t+1])}(i=o.create(e,n))&&r.push(i)}),i.on(s.METRIC_ADDED,u,t),i.on(s.METRIC_UPDATED,u,t)},reset:function(){i.off(s.METRIC_ADDED,u,t),i.off(s.METRIC_UPDATED,u,t),r.forEach(function(e){return e.reset()}),r=[]}}}a.__dashjs_factory_name="MetricsHandlersController",t.default=dashjs.FactoryMaker.getClassFactory(a)},"./src/streaming/metrics/controllers/RangeController.js":function(e,t,r){r.r(t);var n=r("./src/streaming/utils/CustomTimeRanges.js");function a(e){e=e||{};var t,r,a=!1,i=this.context,s=e.mediaElement;return t={initialize:function(e){e&&e.length&&(e.forEach(function(e){var t=e.starttime,n=t+e.duration;r.add(t,n)}),a=!!e[0]._useWallClockTime)},reset:function(){r.clear()},isEnabled:function(){var e,t=r.length;if(!t)return!0;e=a?(new Date).getTime()/1e3:s.currentTime;for(var n=0;n<t;n+=1){var i=r.start(n),o=r.end(n);if(i<=e&&e<o)return!0}return!1}},r=Object(n.default)(i).create(),t}a.__dashjs_factory_name="RangeController",t.default=dashjs.FactoryMaker.getClassFactory(a)},"./src/streaming/metrics/controllers/ReportingController.js":function(e,t,r){r.r(t);var n=r("./src/streaming/metrics/reporting/ReportingFactory.js");function a(e){var t=[],r=Object(n.default)(this.context).getInstance(e);return{initialize:function(e,n){e.some(function(e){var a=r.create(e,n);if(a)return t.push(a),!0})},reset:function(){t.forEach(function(e){return e.reset()}),t=[]},report:function(e,r){t.forEach(function(t){return t.report(e,r)})}}}a.__dashjs_factory_name="ReportingController",t.default=dashjs.FactoryMaker.getClassFactory(a)},"./src/streaming/metrics/metrics/MetricsHandlerFactory.js":function(e,t,r){r.r(t);var n=r("./src/streaming/metrics/metrics/handlers/BufferLevelHandler.js"),a=r("./src/streaming/metrics/metrics/handlers/DVBErrorsHandler.js"),i=r("./src/streaming/metrics/metrics/handlers/HttpListHandler.js"),s=r("./src/streaming/metrics/metrics/handlers/GenericMetricHandler.js");function o(e){var t,r=(e=e||{}).debug?e.debug.getLogger(t):{},o=/([a-zA-Z]*)(\(([0-9]*)(\,\s*([a-zA-Z]*))?\))?/,u=this.context,l={BufferLevel:n.default,DVBErrors:a.default,HttpList:i.default,PlayList:s.default,RepSwitchList:s.default,TcpList:s.default};return{create:function(t,n){var a,i=t.match(o);if(i){try{(a=l[i[1]](u).create({eventBus:e.eventBus,metricsConstants:e.metricsConstants})).initialize(i[1],n,i[3],i[5])}catch(e){a=null,r.error("MetricsHandlerFactory: Could not create handler for type ".concat(i[1]," with args ").concat(i[3],", ").concat(i[5]," (").concat(e.message,")"))}return a}},register:function(e,t){l[e]=t},unregister:function(e){delete l[e]}}}o.__dashjs_factory_name="MetricsHandlerFactory",t.default=dashjs.FactoryMaker.getSingletonFactory(o)},"./src/streaming/metrics/metrics/handlers/BufferLevelHandler.js":function(e,t,r){r.r(t);var n=r("./src/streaming/metrics/utils/HandlerHelpers.js");function a(e){var t,r,a,i,s;e=e||{};var o=this.context,u=Object(n.default)(o).getInstance(),l=[],c=e.metricsConstants;function f(){var e=function(){try{return Object.keys(l).map(function(e){return l[e]}).reduce(function(e,t){return e.level<t.level?e:t})}catch(e){return}}();e&&s!==e.t&&(s=e.t,t.report(a,e))}return{initialize:function(e,n,s){n&&(r=u.validateN(s),t=n,a=u.reconstructFullMetricName(e,s),i=setInterval(f,r))},reset:function(){clearInterval(i),i=null,r=0,t=null,s=null},handleNewMetric:function(e,t,r){e===c.BUFFER_LEVEL&&(l[r]=t)}}}a.__dashjs_factory_name="BufferLevelHandler",t.default=dashjs.FactoryMaker.getClassFactory(a)},"./src/streaming/metrics/metrics/handlers/DVBErrorsHandler.js":function(e,t,r){r.r(t);var n=r("./src/streaming/metrics/MetricsReportingEvents.js");t.default=dashjs.FactoryMaker.getClassFactory(function(e){var t,r=(e=e||{}).eventBus,a=e.metricsConstants;function i(){r.off(n.default.METRICS_INITIALISATION_COMPLETE,i,this),r.trigger(n.default.BECAME_REPORTING_PLAYER)}return{initialize:function(e,a){a&&(t=a,r.on(n.default.METRICS_INITIALISATION_COMPLETE,i,this))},reset:function(){t=null},handleNewMetric:function(e,r){e===a.DVB_ERRORS&&t&&t.report(e,r)}}})},"./src/streaming/metrics/metrics/handlers/GenericMetricHandler.js":function(e,t,r){function n(){var e,t;return{initialize:function(r,n){e=r,t=n},reset:function(){t=null,e=void 0},handleNewMetric:function(r,n){r===e&&t&&t.report(e,n)}}}r.r(t),n.__dashjs_factory_name="GenericMetricHandler",t.default=dashjs.FactoryMaker.getClassFactory(n)},"./src/streaming/metrics/metrics/handlers/HttpListHandler.js":function(e,t,r){r.r(t);var n=r("./src/streaming/metrics/utils/HandlerHelpers.js");function a(e){var t,r,a,i,s;e=e||{};var o=[],u=Object(n.default)(this.context).getInstance(),l=e.metricsConstants;function c(){var e=o;e.length&&t&&t.report(i,e),o=[]}return{initialize:function(e,n,o,l){n&&(r=u.validateN(o),t=n,l&&l.length&&(a=l),i=u.reconstructFullMetricName(e,o,l),s=setInterval(c,r))},reset:function(){clearInterval(s),s=null,r=null,a=null,o=[],t=null},handleNewMetric:function(e,t){e===l.HTTP_REQUEST&&(a&&a!==t.type||o.push(t))}}}a.__dashjs_factory_name="HttpListHandler",t.default=dashjs.FactoryMaker.getClassFactory(a)},"./src/streaming/metrics/reporting/ReportingFactory.js":function(e,t,r){r.r(t);var n=r("./src/streaming/metrics/reporting/reporters/DVBReporting.js");function a(e){e=e||{};var t,r={"urn:dvb:dash:reporting:2014":n.default},a=this.context,i=e.debug?e.debug.getLogger(t):{},s=e.metricsConstants;return{create:function(e,t){var n;try{(n=r[e.schemeIdUri](a).create({metricsConstants:s})).initialize(e,t)}catch(t){n=null,i.error("ReportingFactory: could not create Reporting with schemeIdUri ".concat(e.schemeIdUri," (").concat(t.message,")"))}return n},register:function(e,t){r[e]=t},unregister:function(e){delete r[e]}}}a.__dashjs_factory_name="ReportingFactory",t.default=dashjs.FactoryMaker.getSingletonFactory(a)},"./src/streaming/metrics/reporting/reporters/DVBReporting.js":function(e,t,r){r.r(t);var n=r("./src/streaming/metrics/utils/MetricSerialiser.js"),a=r("./src/streaming/metrics/utils/RNG.js");function i(e){var t;e=e||{};var r,i,s,o,u,l,c=this.context,f=[],d=e.metricsConstants;function h(){s=!1,o=!1,u=null,l=null}return t={report:function(e,t){Array.isArray(t)||(t=[t]),o&&l.isEnabled()&&t.forEach(function(t){var n=r.serialise(t);e!==d.DVB_ERRORS&&(n="metricname=".concat(e,"&").concat(n)),function(e,t,r){var n=new XMLHttpRequest,a=function(){var e=f.indexOf(n);-1!==e&&(f.splice(e,1),!(n.status>=200&&n.status<300)&&(r&&r()))};f.push(n);try{n.open("GET",e),n.onloadend=a,n.onerror=a,n.send()}catch(e){n.onerror()}}(n="".concat(u,"?").concat(n),0,function(){o=!1})})},initialize:function(e,t){var r;if(l=t,!(u=e.dvb_reportingUrl))throw new Error("required parameter missing (dvb:reportingUrl)");s||((r=e.dvb_probability)&&(1e3===r||r/1e3>=i.random())&&(o=!0),s=!0)},reset:function(){h()}},r=Object(n.default)(c).getInstance(),i=Object(a.default)(c).getInstance(),h(),t}i.__dashjs_factory_name="DVBReporting",t.default=dashjs.FactoryMaker.getClassFactory(i)},"./src/streaming/metrics/utils/DVBErrorsTranslator.js":function(e,t,r){r.r(t);var n=r("./src/streaming/metrics/vo/DVBErrors.js"),a=r("./src/streaming/metrics/MetricsReportingEvents.js");function i(e){var t,r,i=(e=e||{}).eventBus,s=e.dashMetrics,o=e.metricsConstants,u=e.events;function l(e){var t=new n.default;if(r){for(var a in e)e.hasOwnProperty(a)&&(t[a]=e[a]);t.mpdurl||(t.mpdurl=r.originalUrl||r.url),t.terror||(t.terror=new Date),s.addDVBErrors(t)}}function c(e){e.error||(r=e.manifest)}function f(e){l({errorcode:n.default.BASE_URL_CHANGED,servicelocation:e.entry})}function d(){l({errorcode:n.default.BECAME_REPORTER})}function h(e){var t;e.metric===o.HTTP_REQUEST&&(0===(t=e.value).responsecode||null==t.responsecode||t.responsecode>=400||t.responsecode<100||t.responsecode>=600)&&l({errorcode:t.responsecode||n.default.CONNECTION_ERROR,url:t.url,terror:t.tresponse,servicelocation:t._serviceLocation})}function g(e){var t;switch(e.error?e.error.code:0){case MediaError.MEDIA_ERR_NETWORK:t=n.default.CONNECTION_ERROR;break;case MediaError.MEDIA_ERR_DECODE:t=n.default.CORRUPT_MEDIA_OTHER;break;default:return}l({errorcode:t})}return t={initialise:function(){i.on(u.MANIFEST_UPDATED,c,t),i.on(u.SERVICE_LOCATION_BLACKLIST_CHANGED,f,t),i.on(u.METRIC_ADDED,h,t),i.on(u.METRIC_UPDATED,h,t),i.on(u.PLAYBACK_ERROR,g,t),i.on(a.default.BECAME_REPORTING_PLAYER,d,t)},reset:function(){i.off(u.MANIFEST_UPDATED,c,t),i.off(u.SERVICE_LOCATION_BLACKLIST_CHANGED,f,t),i.off(u.METRIC_ADDED,h,t),i.off(u.METRIC_UPDATED,h,t),i.off(u.PLAYBACK_ERROR,g,t),i.off(a.default.BECAME_REPORTING_PLAYER,d,t)}}}i.__dashjs_factory_name="DVBErrorsTranslator",t.default=dashjs.FactoryMaker.getSingletonFactory(i)},"./src/streaming/metrics/utils/HandlerHelpers.js":function(e,t,r){function n(){return{reconstructFullMetricName:function(e,t,r){var n=e;return t&&(n+="("+t,r&&r.length&&(n+=","+r),n+=")"),n},validateN:function(e){if(!e)throw new Error("missing n");if(isNaN(e))throw new Error("n is NaN");if(e<0)throw new Error("n must be positive");return e}}}r.r(t),n.__dashjs_factory_name="HandlerHelpers",t.default=dashjs.FactoryMaker.getSingletonFactory(n)},"./src/streaming/metrics/utils/ManifestParsing.js":function(e,t,r){r.r(t);var n=r("./src/streaming/metrics/vo/Metrics.js"),a=r("./src/streaming/metrics/vo/Range.js"),i=r("./src/streaming/metrics/vo/Reporting.js");function s(e){var t=(e=e||{}).adapter,r=e.constants;return{getMetrics:function(e){var s=[];return e&&e.Metrics_asArray&&e.Metrics_asArray.forEach(function(o){var u=new n.default,l=t.getIsDynamic(e);o.hasOwnProperty("metrics")&&(u.metrics=o.metrics,o.Range_asArray&&o.Range_asArray.forEach(function(n){var i=new a.default;i.starttime=function(e,n,a){var i,s,o=0;return n?o=t.getAvailabilityStartTime(e)/1e3:(i=t.getRegularPeriods(e)).length&&(o=i[0].start),s=o,a&&a.hasOwnProperty(r.START_TIME)&&(s+=a.starttime),s}(e,l,n),n.hasOwnProperty("duration")?i.duration=n.duration:i.duration=t.getDuration(e),i._useWallClockTime=l,u.Range.push(i)}),o.Reporting_asArray&&(o.Reporting_asArray.forEach(function(e){var t=new i.default;e.hasOwnProperty(r.SCHEME_ID_URI)&&(t.schemeIdUri=e.schemeIdUri,e.hasOwnProperty("value")&&(t.value=e.value),e.hasOwnProperty(r.DVB_REPORTING_URL)&&(t.dvb_reportingUrl=e[r.DVB_REPORTING_URL]),e.hasOwnProperty(r.DVB_PROBABILITY)&&(t.dvb_probability=e[r.DVB_PROBABILITY]),u.Reporting.push(t))}),s.push(u)))}),s}}}s.__dashjs_factory_name="ManifestParsing",t.default=dashjs.FactoryMaker.getSingletonFactory(s)},"./src/streaming/metrics/utils/MetricSerialiser.js":function(e,t,r){function n(){return{serialise:function e(t){var r,n,a=[],i=[];for(r in t)if(t.hasOwnProperty(r)&&0!==r.indexOf("_")){if(null==(n=t[r])&&(n=""),Array.isArray(n)){if(!n.length)continue;i=[],n.forEach(function(t){var r="Object"!==Object.prototype.toString.call(t).slice(8,-1);i.push(r?t:e(t))}),n=i.map(encodeURIComponent).join(",")}else"string"==typeof n?n=encodeURIComponent(n):n instanceof Date?n=n.toISOString():"number"==typeof n&&(n=Math.round(n));a.push(r+"="+n)}return a.join("&")}}}r.r(t),n.__dashjs_factory_name="MetricSerialiser",t.default=dashjs.FactoryMaker.getSingletonFactory(n)},"./src/streaming/metrics/utils/RNG.js":function(e,t,r){function n(){var e,t,r,n=window.crypto||window.msCrypto,a=Uint32Array,i=Math.pow(2,8*a.BYTES_PER_ELEMENT)-1;function s(){n&&(e||(e=new a(10)),n.getRandomValues(e),t=0)}return r={random:function(r,a){var o;return r||(r=0),a||(a=1),n?(t===e.length&&s(),o=e[t]/i,t+=1):o=Math.random(),o*(a-r)+r}},s(),r}r.r(t),n.__dashjs_factory_name="RNG",t.default=dashjs.FactoryMaker.getSingletonFactory(n)},"./src/streaming/metrics/vo/DVBErrors.js":function(e,t,r){r.r(t);var n=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mpdurl=null,this.errorcode=null,this.terror=null,this.url=null,this.ipaddress=null,this.servicelocation=null};n.SSL_CONNECTION_FAILED_PREFIX="SSL",n.DNS_RESOLUTION_FAILED="C00",n.HOST_UNREACHABLE="C01",n.CONNECTION_REFUSED="C02",n.CONNECTION_ERROR="C03",n.CORRUPT_MEDIA_ISOBMFF="M00",n.CORRUPT_MEDIA_OTHER="M01",n.BASE_URL_CHANGED="F00",n.BECAME_REPORTER="S00",t.default=n},"./src/streaming/metrics/vo/Metrics.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.metrics="",this.Range=[],this.Reporting=[]}},"./src/streaming/metrics/vo/Range.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.starttime=0,this.duration=1/0,this._useWallClockTime=!1}},"./src/streaming/metrics/vo/Reporting.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.schemeIdUri="",this.value="",this.dvb_reportingUrl="",this.dvb_probability=1e3}},"./src/streaming/models/BaseURLTreeModel.js":function(e,t,r){r.r(t);var n=r("./src/streaming/utils/ObjectUtils.js"),a=r("./src/core/FactoryMaker.js"),i=NaN,s=function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.data={baseUrls:t||null,selectedIdx:r||i},this.children=[]};function o(){var e,t,r,a=this.context,o=Object(n.default)(a).getInstance();function u(e,t,n){var a=r.getBaseURLsFromElement(n);e[t]?o.areEqual(a,e[t].data.baseUrls)||(e[t].data.baseUrls=a,e[t].data.selectedIdx=i):e[t]=new s(a)}function l(e,r){var n=r||t;e(n.data),n.children&&n.children.forEach(function(t){return l(e,t)})}function c(){t=new s}return e={reset:c,update:function(e){!function(e){!function(){if(!r||!r.hasOwnProperty("getBaseURLsFromElement")||!r.hasOwnProperty("getRepresentationSortFunction"))throw new Error("setConfig function has to be called previously")}();var n=r.getBaseURLsFromElement(e);o.areEqual(n,t.data.baseUrls)||(t.data.baseUrls=n,t.data.selectedIdx=i),e&&e.Period_asArray&&e.Period_asArray.forEach(function(e,n){u(t.children,n,e),e.AdaptationSet_asArray&&e.AdaptationSet_asArray.forEach(function(e,a){u(t.children[n].children,a,e),e.Representation_asArray&&e.Representation_asArray.sort(r.getRepresentationSortFunction()).forEach(function(e,r){u(t.children[n].children[a].children,r,e)})})})}(e)},getForPath:function(e){var r=t,n=[r.data];return e&&e.forEach(function(e){(r=r.children[e])&&n.push(r.data)}),n.filter(function(e){return e.baseUrls.length})},invalidateSelectedIndexes:function(e){l(function(t){isNaN(t.selectedIdx)||e===t.baseUrls[t.selectedIdx].serviceLocation&&(t.selectedIdx=i)})},setConfig:function(e){e.adapter&&(r=e.adapter)}},c(),e}o.__dashjs_factory_name="BaseURLTreeModel",t.default=a.default.getClassFactory(o)},"./src/streaming/models/CmcdModel.js":function(e,t,r){r.r(t);var n=r("./src/core/EventBus.js"),a=r("./src/streaming/MediaPlayerEvents.js"),i=r("./src/streaming/metrics/MetricsReportingEvents.js"),s=r("./src/core/FactoryMaker.js"),o=r("./src/core/Settings.js"),u=r("./src/streaming/constants/Constants.js"),l=r("./src/streaming/vo/metrics/HTTPRequest.js"),c=r("./src/dash/models/DashManifestModel.js"),f=r("./src/core/Utils.js");function d(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return h(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?h(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,o=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return s=e.done,e},e:function(e){o=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(o)throw i}}}}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function g(){var e,t,r,s,h,g,p,m,y,E,_=this.context,v=Object(n.default)(_).getInstance(),T=Object(o.default)(_).getInstance();function S(){r={pr:1,nor:null,st:null,sf:null,sid:"".concat(f.default.generateUuid()),cid:null},y={},m={},E={},A()}function b(){A()}function A(){if(g){var e=g.getStreamController();if(e&&"function"==typeof e.getActiveStream){var t=e.getActiveStream();t&&(p=t.getProcessors())}}}function R(e,t){var r,n={},a=d(t);try{for(a.s();!(r=a.n()).done;){var i=r.value;e[i]&&(n[i]=e[i])}}catch(e){a.e(e)}finally{a.f()}return n}function I(e){try{return e.type===l.HTTPRequest.MPD_TYPE?((n=C()).ot="m",n):e.type===l.HTTPRequest.MEDIA_SEGMENT_TYPE?(t=e.mediaType,E.hasOwnProperty(t)||(E[t]=!1),m.hasOwnProperty(t)||(m[t]=!1),y.hasOwnProperty(t)||(y[t]=!1),function(e){var t,n=C(),a=function(e){try{var t=e.quality,r=e.mediaInfo.bitrateList;return parseInt(r[t].bandwidth/1e3)}catch(e){return null}}(e),i=function(e){try{return isNaN(e.duration)?null:Math.round(1e3*e.duration)}catch(e){return null}}(e),o=function(e){try{return 100*parseInt(s.getThroughputHistory().getSafeAverageThroughput(e)/100)}catch(e){return null}}(e.mediaType),l=function(e){try{var t=r.pr,n=h.getCurrentBufferLevel(e);return isNaN(t)||isNaN(n)?null:100*parseInt(n/t*10)}catch(e){return null}}(e.mediaType),c=w(e.mediaType),_=function(e){try{var t=s.getTopBitrateInfoFor(e);return Math.round(t.bitrate/1e3)}catch(e){return null}}(e.mediaType),v=r.pr,S=function(e){if(p&&0!==p.length){var t,r=d(p);try{for(r.s();!(t=r.n()).done;){var n=t.value;if(n.getType()===e)return n.probeNextRequest()}}catch(e){r.e(e)}finally{r.f()}}}(e.mediaType);e.mediaType===u.default.VIDEO&&(t="v"),e.mediaType===u.default.AUDIO&&(t="a"),e.mediaType===u.default.TEXT&&(t="application/mp4"===e.mediaInfo.mimeType?"tt":"c");var b=T.get().streaming.cmcd.rtp;return b||(b=function(e){var t=g.getPlaybackRate();t||(t=1);var r=e.quality,n=e.mediaType,a=e.mediaInfo,i=e.duration,s=w(n);0===s&&(s=500);var o=a.bitrateList[r].bandwidth*i/1e3/(s/t/1e3),u=T.get().streaming.cmcd.rtpSafetyFactor&&!isNaN(T.get().streaming.cmcd.rtpSafetyFactor)?T.get().streaming.cmcd.rtpSafetyFactor:5;return 100*(parseInt(o*u/100)+1)}(e)),n.rtp=b,S&&(e.url!==S.url?n.nor=encodeURIComponent(f.default.getRelativeUrl(e.url,S.url)):S.range&&(n.nrr=S.range)),a&&(n.br=a),t&&(n.ot=t),isNaN(i)||(n.d=i),isNaN(o)||(n.mtp=o),isNaN(l)||(n.dl=l),isNaN(c)||(n.bl=c),isNaN(_)||(n.tb=_),isNaN(v)||1===v||(n.pr=v),y[e.mediaType]&&(n.bs=!0,y[e.mediaType]=!1),!m[e.mediaType]&&E[e.mediaType]||(n.su=!0,m[e.mediaType]=!1,E[e.mediaType]=!0),n}(e)):e.type===l.HTTPRequest.INIT_SEGMENT_TYPE?function(){var e=C();return e.ot="i",e.su=!0,e}():e.type===l.HTTPRequest.OTHER_TYPE||e.type===l.HTTPRequest.XLINK_EXPANSION_TYPE?function(){var e=C();return e.ot="o",e}():e.type===l.HTTPRequest.LICENSE?function(){var e=C();return e.ot="k",e}():null}catch(e){return null}var t,n}function C(){var e={},t=T.get().streaming.cmcd.cid?T.get().streaming.cmcd.cid:r.cid;return e.v=1,e.sid=T.get().streaming.cmcd.sid?T.get().streaming.cmcd.sid:r.sid,e.sid="".concat(e.sid),t&&(e.cid="".concat(t)),isNaN(r.pr)||1===r.pr||null===r.pr||(e.pr=r.pr),r.st&&(e.st=r.st),r.sf&&(e.sf=r.sf),e}function w(e){try{var t=h.getCurrentBufferLevel(e);return isNaN(t)?null:100*parseInt(10*t)}catch(e){return null}}function N(e){try{r.pr=e.playbackRate}catch(e){}}function D(t){try{var n=e.getIsDynamic(t.data)?"l":"v",a=t.protocol&&"MSS"===t.protocol?"s":"d";r.st="".concat(n),r.sf="".concat(a)}catch(e){}}function M(e){try{e.state&&e.mediaType&&e.state===a.default.BUFFER_EMPTY&&(y[e.mediaType]||(y[e.mediaType]=!0),m[e.mediaType]||(m[e.mediaType]=!0))}catch(e){}}function O(){for(var e in y)y.hasOwnProperty(e)&&(y[e]=!0);for(var t in m)m.hasOwnProperty(t)&&(m[t]=!0)}function P(e){try{if(!e)return null;var t=Object.keys(e).sort(function(e,t){return e.localeCompare(t)}),r=t.length,n=t.reduce(function(t,n,a){if("v"===n&&1===e[n])return t;if("string"==typeof e[n]&&"ot"!==n&&"sf"!==n&&"st"!==n){var i=e[n].replace(/"/g,'"');t+="".concat(n,'="').concat(i,'"')}else t+="".concat(n,"=").concat(e[n]);return a<r-1&&(t+=","),t},"");return(n=n.replace(/=true/g,"")).replace(/,\s*$/,"")}catch(e){return null}}return t={getQueryParameter:function(e){try{if(T.get().streaming.cmcd&&T.get().streaming.cmcd.enabled){var t=I(e),r=P(t);return v.trigger(i.default.CMCD_DATA_GENERATED,{url:e.url,mediaType:e.mediaType,cmcdData:t,cmcdString:r}),{key:"CMCD",value:r}}return null}catch(e){return null}},getHeaderParameters:function(e){try{if(T.get().streaming.cmcd&&T.get().streaming.cmcd.enabled){var t=I(e),r=R(t,["br","d","ot","tb"]),n=R(t,["bl","dl","mtp","nor","nrr","su"]),a=R(t,["bs","rtp"]),s=R(t,["cid","pr","sf","sid","st","v"]),o={"CMCD-Object":P(r),"CMCD-Request":P(n),"CMCD-Status":P(a),"CMCD-Session":P(s)};return v.trigger(i.default.CMCD_DATA_GENERATED,{url:e.url,mediaType:e.mediaType,cmcdData:t,headers:o}),o}return null}catch(e){return null}},setConfig:function(e){e&&(e.abrController&&(s=e.abrController),e.dashMetrics&&(h=e.dashMetrics),e.playbackController&&(g=e.playbackController))},reset:function(){v.off(a.default.PLAYBACK_RATE_CHANGED,N,this),v.off(a.default.MANIFEST_LOADED,D,this),v.off(a.default.BUFFER_LEVEL_STATE_CHANGED,M,t),v.off(a.default.PLAYBACK_SEEKED,O,t),S()},initialize:function(){v.on(a.default.PLAYBACK_RATE_CHANGED,N,t),v.on(a.default.MANIFEST_LOADED,D,t),v.on(a.default.BUFFER_LEVEL_STATE_CHANGED,M,t),v.on(a.default.PLAYBACK_SEEKED,O,t),v.on(a.default.PERIOD_SWITCH_COMPLETED,b,t)}},e=Object(c.default)(_).getInstance(),S(),t}g.__dashjs_factory_name="CmcdModel",t.default=s.default.getSingletonFactory(g)},"./src/streaming/models/FragmentModel.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/streaming/vo/FragmentRequest.js"),i="loading",s="executed",o="failed";function u(e){var t,r,n,u,l=(e=e||{}).eventBus,c=e.events,f=e.dashMetrics,d=e.fragmentLoader,h=e.debug,g=e.streamInfo,p=e.type;function m(e){var t;return!!e&&(t=!1,n.some(function(r){if(n=e,i=r,!isNaN(n.index)&&n.startTime===i.startTime&&n.adaptationIndex===i.adaptationIndex&&n.type===i.type||function(e,t){return isNaN(e.index)&&isNaN(t.index)&&e.quality===t.quality}(e,r)||function(e,t){return e.action===a.default.ACTION_COMPLETE&&e.action===t.action}(e,r))return t=!0;var n,i}),t)}function y(e){return isNaN(e.duration)?.25:Math.min(e.duration/8,.5)}function E(e){n=n.filter(function(t){var r=y(t);return isNaN(t.startTime)||void 0!==e&&t.startTime>=e-r})}function _(e,t){t<=e+.5||(n=n.filter(function(r){var n=y(r);return isNaN(r.startTime)||r.startTime>=t-n||isNaN(r.duration)||r.startTime+r.duration<=e+n}))}function v(e,t,r){for(var n=e.length-1;n>=0;n--){var a=e[n],i=a.startTime,s=i+a.duration;if(r=isNaN(r)?y(a):r,!isNaN(i)&&!isNaN(s)&&t+r>=i&&t-r<s||isNaN(i)&&isNaN(t))return a}return null}function T(e,t){f.addSchedulingInfo(e,t),f.addRequestsQueue(e.mediaType,u,n)}function S(e){e.sender===d&&(u.splice(u.indexOf(e.request),1),e.response&&!e.error&&n.push(e.request),T(e.request,e.error?o:s),l.trigger(c.FRAGMENT_LOADING_COMPLETED,{request:e.request,response:e.response,error:e.error,sender:this},{streamId:g.id,mediaType:p}))}function b(e){e.sender===d&&l.trigger(c.FRAGMENT_LOADING_PROGRESS,{request:e.request,response:e.response,error:e.error,sender:this},{streamId:g.id,mediaType:p})}function A(e){e.sender===d&&l.trigger(c.FRAGMENT_LOADING_ABANDONED,{request:e.request},{streamId:g.id,mediaType:p})}function R(){n=[],u=[]}return t={getStreamId:function(){return g.id},getType:function(){return p},getRequests:function(e){var t=e?e.state instanceof Array?e.state:[e.state]:[],r=[];return t.forEach(function(t){var a=function(e){var t;switch(e){case i:t=u;break;case s:t=n;break;default:t=[]}return t}(t);r=r.concat(function(e,t){return t.hasOwnProperty("time")?[v(e,t.time,t.threshold)]:e.filter(function(e){for(var r in t)if("state"!==r&&t.hasOwnProperty(r)&&e[r]!=t[r])return!1;return!0})}(a,e))}),r},isFragmentLoaded:m,isFragmentLoadedOrPending:function(e){var t,r=!1,n=0;if(!(r=m(e)))for(n=0;n<u.length;n++)t=u[n],e.url===t.url&&e.startTime===t.startTime&&(r=!0);return r},removeExecutedRequestsBeforeTime:E,removeExecutedRequestsAfterTime:function(e){n=n.filter(function(t){return isNaN(t.startTime)||void 0!==e&&t.startTime<e})},syncExecutedRequestsWithBufferedRange:function(e,t){if(e&&0!==e.length){for(var r=0,n=0,a=e.length;n<a;n++)_(r,e.start(n)),r=e.end(n);t>0&&_(r,t)}else E()},abortRequests:function(){r.debug("abort requests"),d.abort(),u=[]},executeRequest:function(e){e.action===a.default.ACTION_DOWNLOAD?(T(e,i),u.push(e),function(e){l.trigger(c.FRAGMENT_LOADING_STARTED,{request:e},{streamId:g.id,mediaType:p}),d.load(e)}(e)):r.warn("Unknown request action.")},reset:function(){l.off(c.LOADING_COMPLETED,S,this),l.off(c.LOADING_DATA_PROGRESS,b,this),l.off(c.LOADING_ABANDONED,A,this),d&&d.reset(),R()},resetInitialSettings:R,addExecutedRequest:function(e){n.push(e)}},r=h.getLogger(t),R(),l.on(c.LOADING_COMPLETED,S,t),l.on(c.LOADING_DATA_PROGRESS,b,t),l.on(c.LOADING_ABANDONED,A,t),t}u.__dashjs_factory_name="FragmentModel";var l=n.default.getClassFactory(u);l.FRAGMENT_MODEL_LOADING=i,l.FRAGMENT_MODEL_EXECUTED=s,l.FRAGMENT_MODEL_CANCELED="canceled",l.FRAGMENT_MODEL_FAILED=o,n.default.updateClassFactory(u.__dashjs_factory_name,l),t.default=l},"./src/streaming/models/LowLatencyThroughputModel.js":function(e,t,r){r.r(t);var n=r("./src/core/Debug.js"),a=r("./src/core/FactoryMaker.js");function i(){var e,t,r=this.context,a={};function i(){t=Object(n.default)(r).getInstance().getLogger(e)}function s(e){for(var t={},r=0,n=0,a=0,i=0,s=e.length,o=0;o<s;++o)r+=e[o].chunkDownloadTimeRelativeMS,n+=e[o].bufferLevel,a+=e[o].chunkDownloadTimeRelativeMS*e[o].bufferLevel,i+=e[o].chunkDownloadTimeRelativeMS*e[o].chunkDownloadTimeRelativeMS;return t.m=(a-r*n/s)/(i-r*r/s),t.b=n/s-t.m*r/s,function(e){return t.m*e+t.b}}function o(e){var t,r=!0,n=e.reduce(function(e,t){return e+t.bufferLevelAtSegmentEnd},0)/e.length;return e.forEach(function(e){Math.abs(e.bufferLevelAtSegmentEnd/e.bufferLevelAtSegmentStart)<.95&&(r=!1),e.bufferLevelAtSegmentEnd/n<.8&&(r=!1),t?t>e.bitrate&&(r=!1):t=e.bitrate}),r}return e={setup:i,addMeasurement:function(e,t,r,n,i){e&&e.mediaType&&!a[e.mediaType]&&(a[e.mediaType]=[]);var o=e.mediaInfo.bitrateList.find(function(t){return t.id===e.representationId});a[e.mediaType].push({index:e.index,repId:e.representationId,mediaType:e.mediaType,requestTimeMS:n,adjustedAvailabilityStartTimeMS:e.availabilityStartTime.getTime(),segDurationMS:1e3*e.duration,chunksDurationMS:r.reduce(function(e,t){return e+t.chunkDownloadDurationMS},0),segmentBytes:r.reduce(function(e,t){return e+t.chunkBytes},0),bitrate:o&&o.bandwidth,bitrateList:e.mediaInfo.bitrateList,chunkMeasurements:r,fetchDownloadDurationMS:t,throughputCapacityDelayMS:i,getEstimatedBufferLevel:s(r.slice(1))}),a[e.mediaType].length>10&&a[e.mediaType].shift()},getThroughputCapacityDelayMS:function(e,t){var r=a[e.mediaType]&&a[e.mediaType].slice(-3);return!r||r.length<3?0:o(r)?t/4>250?250:t/4:0},getEstimatedDownloadDurationMS:function(e){var r=a[e.mediaType].slice(-1).pop(),n=a[e.mediaType].slice(-3),i=r.chunkMeasurements.slice(-1).pop().chunkDownloadTimeRelativeMS;r.bufferLevelAtSegmentStart=r.getEstimatedBufferLevel(i/2),r.bufferLevelAtSegmentEnd=r.getEstimatedBufferLevel(i);var s=o(n),u=s?.6:.8;if(r.isBufferStable&&1.05*r.segDurationMS<r.fetchDownloadDurationMS)return r.fetchDownloadDurationMS;if(!s||r.segDurationMS<r.fetchDownloadDurationMS)return.8*r.fetchDownloadDurationMS;if(r.adjustedAvailabilityStartTimeMS<=r.requestTimeMS+r.throughputCapacityDelayMS-r.segDurationMS)return.8*r.fetchDownloadDurationMS;for(var l=r.requestTimeMS+r.throughputCapacityDelayMS-r.adjustedAvailabilityStartTimeMS,c=0,f=0,d=0,h=0;h<r.chunkMeasurements.length;h++){var g=r.chunkMeasurements[h];if(l<f+g.chunkDownloadDurationMS)break;f+=g.chunkDownloadDurationMS,c+=g.chunkBytes,d++}if(l<0&&t.warn("request time was before adjusted availibitly start time"),c&&f&&d>.2*r.chunkMeasurements.length){var p=c/f,m=r.segmentBytes/p;return r.fetchDownloadDurationMS<m?r.fetchDownloadDurationMS*u:m*u}var y=r.bitrate;return r.bitrateList.some(function(e){if(e.bandwidth>r.bitrate)return y=e.bandwidth,!0}),y===r.bitrate?r.fetchDownloadDurationMS*u:u*r.segmentBytes*8*1e3/y}},i(),e}i.__dashjs_factory_name="LowLatencyThroughputModel",t.default=a.default.getSingletonFactory(i)},"./src/streaming/models/ManifestModel.js":function(e,t,r){r.r(t);var n=r("./src/core/EventBus.js"),a=r("./src/core/events/Events.js"),i=r("./src/core/FactoryMaker.js");function s(){var e,t=this.context,r=Object(n.default)(t).getInstance();return{getValue:function(){return e},setValue:function(t){e=t,t&&r.trigger(a.default.MANIFEST_LOADED,{data:t})}}}s.__dashjs_factory_name="ManifestModel",t.default=i.default.getSingletonFactory(s)},"./src/streaming/models/MediaPlayerModel.js":function(e,t,r){r.r(t);var n=r("./src/dash/vo/UTCTiming.js"),a=r("./src/core/FactoryMaker.js"),i=r("./src/streaming/constants/Constants.js"),s=r("./src/streaming/rules/abr/ABRRulesCollection.js"),o=r("./src/core/Settings.js"),u=r("./src/streaming/utils/SupervisorTools.js");function l(){var e,t,r,a,l=this.context,c=Object(o.default)(l).getInstance();function f(e){var t;for(t=0;t<a.length;t++)if(a[t].rulename===e)return t;return-1}function d(){if(c.get().streaming.lowLatencyEnabled)return h();var e=c.get().streaming.buffer.stableBufferTime;return e>0?e:c.get().streaming.buffer.fastSwitchEnabled?20:12}function h(){return c.get().streaming.lowLatencyEnabled?c.get().streaming.delay.liveDelay||3:c.get().streaming.delay.liveDelay}function g(e,r){p(e,r);var a=new n.default;a.schemeIdUri=e,a.value=r,t.push(a)}function p(e,r){Object(u.checkParameterType)(e,"string"),Object(u.checkParameterType)(r,"string"),t.forEach(function(n,a){n.schemeIdUri===e&&n.value===r&&t.splice(a,1)})}return e={getABRCustomRules:function(){return a},addABRCustomRule:function(e,t,r){if("string"!=typeof e||e!==s.default.ABANDON_FRAGMENT_RULES&&e!==s.default.QUALITY_SWITCH_RULES||"string"!=typeof t)throw i.default.BAD_ARGUMENT_ERROR;var n=f(t);-1===n?a.push({type:e,rulename:t,rule:r}):(a[n].type=e,a[n].rule=r)},removeABRCustomRule:function(e){if(e){var t=f(e);-1!==t&&a.splice(t,1)}else a=[]},getStableBufferTime:d,getInitialBufferLevel:function(){var e=c.get().streaming.buffer.initialBufferLevel;return isNaN(e)||e<0?0:Math.min(d(),e)},getRetryAttemptsForType:function(e){var t=isNaN(c.get().streaming.retryAttempts.lowLatencyMultiplyFactor)?5:c.get().streaming.retryAttempts.lowLatencyMultiplyFactor;return c.get().streaming.lowLatencyEnabled?c.get().streaming.retryAttempts[e]*t:c.get().streaming.retryAttempts[e]},getRetryIntervalsForType:function(e){var t=isNaN(c.get().streaming.retryIntervals.lowLatencyReductionFactor)?10:c.get().streaming.retryIntervals.lowLatencyReductionFactor;return c.get().streaming.lowLatencyEnabled?c.get().streaming.retryIntervals[e]/t:c.get().streaming.retryIntervals[e]},getLiveDelay:h,getLiveCatchupLatencyThreshold:function(){try{var e=c.get().streaming.liveCatchup.latencyThreshold,t=h();if(null!==e&&!isNaN(e))return Math.max(e,t);var r=c.get().streaming.liveCatchup.minDrift,n=!isNaN(t)&&t?isNaN(r)?h():c.get().streaming.liveCatchup.minDrift+h():NaN;return n&&!isNaN(n)?Math.max(4*n,5):NaN}catch(e){return NaN}},addUTCTimingSource:g,removeUTCTimingSource:p,getUTCTimingSources:function(){return t},clearDefaultUTCTimingSources:function(){t=[]},restoreDefaultUTCTimingSources:function(){var e=c.get().streaming.utcSynchronization.defaultTimingSource;g(e.scheme,e.value)},setXHRWithCredentialsForType:function e(t,n){t?r[t]=!!n:Object.keys(r).forEach(function(t){e(t,n)})},getXHRWithCredentialsForType:function(e){var t=r[e];return void 0===t?r.default:t},getDefaultUtcTimingSource:function(){return c.get().streaming.utcSynchronization.defaultTimingSource},reset:function(){}},t=[],r={default:!1},a=[],e}l.__dashjs_factory_name="MediaPlayerModel",t.default=a.default.getSingletonFactory(l)},"./src/streaming/models/MetricsModel.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/Constants.js"),a=r("./src/streaming/constants/MetricsConstants.js"),i=r("./src/streaming/vo/MetricsList.js"),s=r("./src/streaming/vo/metrics/HTTPRequest.js"),o=r("./src/streaming/vo/metrics/RepresentationSwitch.js"),u=r("./src/streaming/vo/metrics/BufferLevel.js"),l=r("./src/streaming/vo/metrics/BufferState.js"),c=r("./src/streaming/vo/metrics/DVRInfo.js"),f=r("./src/streaming/vo/metrics/DroppedFrames.js"),d=r("./src/streaming/vo/metrics/ManifestUpdate.js"),h=r("./src/streaming/vo/metrics/SchedulingInfo.js"),g=r("./src/core/EventBus.js"),p=r("./src/streaming/vo/metrics/RequestsQueue.js"),m=r("./src/core/events/Events.js"),y=r("./src/core/FactoryMaker.js");function E(e){var t,r,y=(e=e||{}).settings,E=this.context,_=Object(g.default)(E).getInstance();function v(){_.trigger(m.default.METRICS_CHANGED)}function T(e){_.trigger(m.default.METRIC_CHANGED,{mediaType:e}),v()}function S(e,t,r){_.trigger(m.default.METRIC_UPDATED,{mediaType:e,metric:t,value:r}),T(e)}function b(e,t,r){_.trigger(m.default.METRIC_ADDED,{mediaType:e,metric:t,value:r}),T(e)}function A(e,t){var n=null;return e?(r.hasOwnProperty(e)?n=r[e]:t||(n=new i.default,r[e]=n),n):n}function R(e,t,r){var n=A(e);null!==n&&(n[t].push(r),n[t].length>y.get().streaming.metrics.maxListDepth&&n[t].shift())}function I(e,t,r){R(e,t,r),b(e,t,r)}return t={clearCurrentMetricsForType:function(e){delete r[e],T(e)},clearAllCurrentMetrics:function(){r={},v()},getMetricsFor:A,addHttpRequest:function e(t,r,n,i,o,u,l,c,f,d,h,g,p,m,y){var E=new s.HTTPRequest;u&&u!==i&&(e(t,null,n,i,o,null,null,c,f,null,null,null,p,null,null),E.actualurl=u),E.tcpid=r,E.type=n,E.url=i,E.range=c,E.trequest=f,E.tresponse=d,E.responsecode=g,E._tfinish=h,E._stream=t,E._mediaduration=p,E._quality=o,E._responseHeaders=m,E._serviceLocation=l,y?y.forEach(function(e){!function(e,t,r,n,a){var i=new s.HTTPRequestTrace;i.s=t,i.d=r,i.b=n,i.t=a,e.trace.push(i),e.interval||(e.interval=0),e.interval+=r}(E,e.s,e.d,e.b,e.t)}):(delete E.interval,delete E.trace),I(t,a.default.HTTP_REQUEST,E)},addRepresentationSwitch:function(e,t,r,n,i){var s=new o.default;s.t=t,s.mt=r,s.to=n,i?s.lto=i:delete s.lto,I(e,a.default.TRACK_SWITCH,s)},addBufferLevel:function(e,t,r){var n=new u.default;n.t=t,n.level=r,I(e,a.default.BUFFER_LEVEL,n)},addBufferState:function(e,t,r){var n=new l.default;n.target=r,n.state=t,I(e,a.default.BUFFER_STATE,n)},addDVRInfo:function(e,t,r,n){var i=new c.default;i.time=t,i.range=n,i.manifestInfo=r,I(e,a.default.DVR_INFO,i)},addDroppedFrames:function(e,t){var r=new f.default,n=A(e).DroppedFrames;t&&(r.time=t.creationTime,r.droppedFrames=t.droppedVideoFrames,n.length>0&&n[n.length-1]==r||I(e,a.default.DROPPED_FRAMES,r))},addSchedulingInfo:function(e,t,r,n,i,s,o,u,l){var c=new h.default;c.mediaType=e,c.t=t,c.type=r,c.startTime=n,c.availabilityStartTime=i,c.duration=s,c.quality=o,c.range=u,c.state=l,I(e,a.default.SCHEDULING_INFO,c)},addRequestsQueue:function(e,t,r){var n=new p.default;n.loadingRequests=t,n.executedRequests=r,A(e).RequestsQueue=n,b(e,a.default.REQUESTS_QUEUE,n)},addManifestUpdate:function(e,t,r,i,s,o,u,l,c,f){var h=new d.ManifestUpdate;h.mediaType=e,h.type=t,h.requestTime=r,h.fetchTime=i,h.availabilityStartTime=s,h.presentationStartTime=o,h.clientTimeOffset=u,h.currentTime=l,h.buffered=c,h.latency=f,R(n.default.STREAM,a.default.MANIFEST_UPDATE,h),b(e,a.default.MANIFEST_UPDATE,h)},updateManifestUpdateInfo:function(e,t){if(e){for(var r in t)e[r]=t[r];S(e.mediaType,a.default.MANIFEST_UPDATE,e)}},addManifestUpdateStreamInfo:function(e,t,r,n,i){if(e){var s=new d.ManifestUpdateStreamInfo;s.id=t,s.index=r,s.start=n,s.duration=i,e.streamInfo.push(s),S(e.mediaType,a.default.MANIFEST_UPDATE_STREAM_INFO,e)}},addManifestUpdateRepresentationInfo:function(e,t,r,n,i,s,o,u){if(e&&e.representationInfo){var l=new d.ManifestUpdateRepresentationInfo;l.id=t,l.index=r,l.streamIndex=n,l.mediaType=i,l.startNumber=o,l.fragmentInfoType=u,l.presentationTimeOffset=s,e.representationInfo.push(l),S(e.mediaType,a.default.MANIFEST_UPDATE_TRACK_INFO,e)}},addPlayList:function(e){e.trace&&Array.isArray(e.trace)?e.trace.forEach(function(e){e.hasOwnProperty("subreplevel")&&!e.subreplevel&&delete e.subreplevel}):delete e.trace,I(n.default.STREAM,a.default.PLAY_LIST,e)},addDVBErrors:function(e){I(n.default.STREAM,a.default.DVB_ERRORS,e)}},r={},t}E.__dashjs_factory_name="MetricsModel",t.default=y.default.getSingletonFactory(E)},"./src/streaming/models/URIFragmentModel.js":function(e,t,r){r.r(t);var n=r("./src/streaming/vo/URIFragmentData.js"),a=r("./src/core/FactoryMaker.js");function i(){var e;return{initialize:function(t){if(e=new n.default,!t)return null;var r=t.indexOf("#");if(-1!==r)for(var a=t.substr(r+1).split("&"),i=0,s=a.length;i<s;++i){var o=a[i],u=o.indexOf("=");if(-1!==u){var l=o.substring(0,u);e.hasOwnProperty(l)&&(e[l]=o.substr(u+1))}}},getURIFragmentData:function(){return e}}}i.__dashjs_factory_name="URIFragmentModel",t.default=a.default.getSingletonFactory(i)},"./src/streaming/models/VideoModel.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/core/EventBus.js"),i=r("./src/core/events/Events.js"),s=r("./src/core/Debug.js"),o=r("./src/streaming/constants/Constants.js"),u=new Map([[o.default.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,"loadedmetadata"],[o.default.VIDEO_ELEMENT_READY_STATES.HAVE_CURRENT_DATA,"loadeddata"],[o.default.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA,"canplay"],[o.default.VIDEO_ELEMENT_READY_STATES.HAVE_ENOUGH_DATA,"canplaythrough"]]);function l(){var e,t,r,n,l=this.context,c=Object(a.default)(l).getInstance(),f=[];function d(){r&&(r.playbackRate=1,r.removeEventListener("canplay",d))}function h(){return f.length>0}function g(){if(r&&h()&&0===r.playbackRate){var e=document.createEvent("Event");e.initEvent("waiting",!0,!1),r.dispatchEvent(e)}}function p(e,t){r&&r.addEventListener(e,t)}function m(e,t){r&&r.removeEventListener(e,t)}function y(){return r?r.readyState:NaN}function E(){return r?r.buffered:null}function _(e,t,n,a,i){if(r)for(var s=0;s<r.textTracks.length;s++)if(r.textTracks[s].kind===e&&(!t||r.textTracks[s].label==t)&&r.textTracks[s].language===n&&r.textTracks[s].isTTML===a&&r.textTracks[s].isEmbedded===i)return r.textTracks[s];return null}return e={initialize:function(){c.on(i.default.PLAYBACK_PLAYING,g,this)},setCurrentTime:function(e,t){var n,a;a=function(){if(r){if(r.currentTime===e)return;try{e=t?function(e){var t=E(),r=e,n=9999999999;if(t)for(var a=0;a<t.length;a++){var i=t.start(a),s=t.end(a),o=Math.abs(i-e),u=Math.abs(s-e);if(e>=i&&e<=s)return e;o<n&&(n=o,r=i),u<n&&(n=u,r=s)}return r}(e):e,r.currentTime=e}catch(t){0===r.readyState&&t.code===t.INVALID_STATE_ERR&&setTimeout(function(){r.currentTime=e},400)}}},(n=o.default.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA)===o.default.VIDEO_ELEMENT_READY_STATES.HAVE_NOTHING||y()>=n?a():function(e,t){p(e,function r(){m(e,r),t(e)})}(u.get(n),a)},play:function(){if(r){r.autoplay=!0;var e=r.play();e&&e.catch&&"undefined"!=typeof Promise&&e.catch(function(e){"NotAllowedError"===e.name&&c.trigger(i.default.PLAYBACK_NOT_ALLOWED),t.warn("Caught pending play exception - continuing (".concat(e,")"))})}},isPaused:function(){return r?r.paused:null},pause:function(){r&&(r.pause(),r.autoplay=!1)},isStalled:h,isSeeking:function(){return r?r.seeking:null},getTime:function(){return r?r.currentTime:null},getPlaybackRate:function(){return r?r.playbackRate:null},setPlaybackRate:function(e){r&&(!(arguments.length>1&&void 0!==arguments[1]&&arguments[1])&&r.readyState<=2&&e>0?r.addEventListener("canplay",d):r.playbackRate=e)},getPlayedRanges:function(){return r?r.played:null},getEnded:function(){return r?r.ended:null},setStallState:function(e,t){!function(e,t){t?function(e){null!==e&&r&&!r.seeking&&-1===f.indexOf(e)&&f.push(e)}(e):function(e){var t=f.indexOf(e);null!==e&&-1!==t&&f.splice(t,1)}(e)}(e,t)},getElement:function(){return r},setElement:function(e){if(!(null==e||e&&/^(VIDEO|AUDIO)$/i.test(e.nodeName)))throw"element is not video or audio DOM type!";(r=e)&&(r.preload="auto")},setSource:function(e){r&&(e?r.src=e:(r.removeAttribute("src"),r.load()))},getSource:function(){return r?r.src:null},getTTMLRenderingDiv:function(){return n},setTTMLRenderingDiv:function(e){(n=e).style.position="absolute",n.style.display="flex",n.style.overflow="hidden",n.style.pointerEvents="none",n.style.top=0,n.style.left=0},getPlaybackQuality:function(){if(!r)return null;var e="webkitDroppedFrameCount"in r&&"webkitDecodedFrameCount"in r,t=null;return"getVideoPlaybackQuality"in r?t=r.getVideoPlaybackQuality():e&&(t={droppedVideoFrames:r.webkitDroppedFrameCount,totalVideoFrames:r.webkitDroppedFrameCount+r.webkitDecodedFrameCount,creationTime:new Date}),t},addEventListener:p,removeEventListener:m,getReadyState:y,getBufferRange:E,getClientWidth:function(){return r?r.clientWidth:NaN},getClientHeight:function(){return r?r.clientHeight:NaN},getTextTracks:function(){return r?r.textTracks:[]},getTextTrack:_,addTextTrack:function(e,t,n,a,i){if(!r)return null;var s=_(e,t,n,a,i);return s||((s=r.addTextTrack(e,t,n)).isEmbedded=i,s.isTTML=a),s},appendChild:function(e){r&&(r.appendChild(e),void 0!==e.isTTML&&(r.textTracks[r.textTracks.length-1].isTTML=e.isTTML,r.textTracks[r.textTracks.length-1].isEmbedded=e.isEmbedded))},removeChild:function(e){r&&r.removeChild(e)},getVideoWidth:function(){return r?r.videoWidth:NaN},getVideoHeight:function(){return r?r.videoHeight:NaN},getVideoRelativeOffsetTop:function(){var e=r.parentNode.host||r.parentNode;return e?r.getBoundingClientRect().top-e.getBoundingClientRect().top:NaN},getVideoRelativeOffsetLeft:function(){var e=r.parentNode.host||r.parentNode;return e?r.getBoundingClientRect().left-e.getBoundingClientRect().left:NaN},reset:function(){c.off(i.default.PLAYBACK_PLAYING,g,this)}},t=Object(s.default)(l).getInstance().getLogger(e),e}l.__dashjs_factory_name="VideoModel",t.default=n.default.getSingletonFactory(l)},"./src/streaming/net/FetchLoader.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/core/Settings.js"),i=r("./src/streaming/constants/Constants.js");function s(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function u(e){e=e||{};var t,r,n=this.context,o=e.requestModifier,u=e.lowLatencyThroughputModel,l=e.boxParser,c=Object(a.default)(n).getInstance();function f(e,t){e.reader.read().then(t).catch(function(t){e.onerror&&200===e.response.status&&e.onerror(t)})}function d(e,t){try{if((e=e.filter(function(r){return r.bytes>t/4/e.length})).length>1){var r=0,n=(e[e.length-1].ts-e[0].ts)/e.length;return e.forEach(function(t,a){var i=e[a+1];if(i){var s=i.ts-t.ts;r+=s<n?s:0}}),r}return null}catch(e){return null}}return t={load:function(e){var t,n=new Date,a=e.request,h=new Headers;if(a.range&&h.append("Range","bytes="+a.range),e.headers)for(var g in e.headers){var p=e.headers[g];p&&h.append(g,p)}a.requestStartDate||(a.requestStartDate=n),o&&o.modifyRequestHeader({setRequestHeader:function(e,t){h.append(e,t)}}),"function"==typeof window.AbortController&&(t=new AbortController,e.abortController=t,t.signal.onabort=e.onabort);var m={method:e.method,headers:h,credentials:e.withCredentials?"include":void 0,signal:t?t.signal:void 0},y=c.get().streaming.abr.fetchThroughputCalculationMode,E=Date.now(),_=0;new Promise(function(e){if(y===i.default.ABR_FETCH_THROUGHPUT_CALCULATION_AAST&&u&&(_=u.getThroughputCapacityDelayMS(a,1e3*r.getCurrentBufferLevel(a.mediaType))))return setTimeout(e,_);e()}).then(function(){var t=Date.now();fetch(e.url,m).then(function(n){e.response||(e.response={}),e.response.status=n.status,e.response.statusText=n.statusText,e.response.responseURL=n.url,n.ok||e.onerror();var o,c="",h=function(e){var t;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(t=s(e))){t&&(e=t);var r=0,n=function(){};return{s:n,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,o=!1;return{s:function(){t=e[Symbol.iterator]()},n:function(){var e=t.next();return i=e.done,e},e:function(e){o=!0,a=e},f:function(){try{i||null==t.return||t.return()}finally{if(o)throw a}}}}(n.headers.keys());try{for(h.s();!(o=h.n()).done;){var g=o.value;c+=g+": "+n.headers.get(g)+"\r\n"}}catch(e){h.e(e)}finally{h.f()}if(e.response.responseHeaders=c,!n.body)return n.arrayBuffer().then(function(t){e.response.response=t;var r={loaded:t.byteLength,total:t.byteLength,stream:!1};e.progress(r),e.onload(),e.onend()});var p,m,v,T,S=parseInt(n.headers.get("Content-Length"),10),b=0,A=!1,R=new Uint8Array,I=0;if(y===i.default.ABR_FETCH_THROUGHPUT_CALCULATION_AAST&&u){var C=t,w=0,N=(v=n.body.tee(),T=2,function(e){if(Array.isArray(e))return e}(v)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,a=!1,i=void 0;try{for(var s,o=e[Symbol.iterator]();!(n=(s=o.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(e){a=!0,i=e}finally{try{n||null==o.return||o.return()}finally{if(a)throw i}}return r}}(v,T)||s(v,T)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),D=N[0],M=N[1];p=D.getReader(),m=[],p.read().then(function n(i){var s=i.value,o=i.done;if(w=Date.now(),s&&s.length){var l=w-C,f=s.length;m.push({chunkDownloadTimeRelativeMS:w-t,chunkDownloadDurationMS:l,chunkBytes:f,kbps:Math.round(8*f/(l/1e3)),bufferLevel:r.getCurrentBufferLevel(a.mediaType)})}if(o){var d=w-t,h=m.reduce(function(e,t){return e+t.chunkBytes},0);return u.addMeasurement(a,d,m,E,_,c),void e.progress({loaded:h,total:h,lengthComputable:!0,time:u.getEstimatedDownloadDurationMS(a),stream:!0})}return C=Date.now(),p.read().then(n)}),e.reader=M.getReader()}else e.reader=n.body.getReader();var O=[],P=[],L=[],F=!0;f(e,function t(r){var n=r.value;if(r.done){if(R){if(y!==i.default.ABR_FETCH_THROUGHPUT_CALCULATION_AAST){var a=null;y===i.default.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING&&(a=function(e,t){try{var r,n;r=e.filter(function(t,r){return r<e.length-1}),n=t.filter(function(e,r){return r<t.length-1});var a=[];if(r.length>1){for(var i=0,s=0,o=0;o<r.length;o++)if(r[o]&&n[o]){var u=n[o].ts-r[o].ts;if(u>1)a.push(8*n[o].bytes/u);else{0===s&&(s=r[o].ts);var l=n[o].ts-s;l>1?(a.push(8*i/l),i=0,s=0):i+=n[o].bytes}}if(a.length>0)return a.reduce(function(e,t){return e+t},0)/a.length}return null}catch(e){return null}}(P,L)),e.progress({loaded:b,total:isNaN(S)?b:S,lengthComputable:!0,time:d(O,b),throughput:a,stream:!0})}e.response.response=R.buffer}return e.onload(),void e.onend()}if(n&&n.length>0){R=function(e,t){if(0===e.length)return t;var r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}(R,n),b+=n.length,O.push({ts:Date.now(),bytes:n.length}),y===i.default.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING&&F&&l.findLastTopIsoBoxCompleted(["moof"],R,I).found&&(F=!1,P.push({ts:performance.now(),bytes:n.length}));var s=l.findLastTopIsoBoxCompleted(["moov","mdat"],R,I);if(s.found){var o,u=s.lastCompletedOffset+s.size;y!==i.default.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING||F||(F=!0,L.push({ts:performance.now(),bytes:R.length})),u===R.length?(o=R,R=new Uint8Array):(o=new Uint8Array(R.subarray(0,u)),R=R.subarray(u)),e.progress({data:o.buffer,lengthComputable:!1,noTrace:!0}),I=0}else I=s.lastCompletedOffset,A||(e.progress({lengthComputable:!1,noTrace:!0}),A=!0)}f(e,t)})}).catch(function(t){e.onerror&&e.onerror(t)})})},abort:function(e){if(e.abortController)e.abortController.abort();else if(e.reader)try{e.reader.cancel(),e.onabort()}catch(e){}},calculateDownloadedTime:d,setup:function(e){r=e.dashMetrics}},t}u.__dashjs_factory_name="FetchLoader";var l=n.default.getClassFactory(u);t.default=l},"./src/streaming/net/HTTPLoader.js":function(e,t,r){r.r(t);var n=r("./src/streaming/net/XHRLoader.js"),a=r("./src/streaming/net/FetchLoader.js"),i=r("./src/streaming/vo/metrics/HTTPRequest.js"),s=r("./src/core/FactoryMaker.js"),o=r("./src/streaming/vo/DashJSError.js"),u=r("./src/streaming/models/CmcdModel.js"),l=r("./src/core/Utils.js"),c=r("./src/core/Debug.js"),f=r("./src/core/EventBus.js"),d=r("./src/core/events/Events.js"),h=r("./src/core/Settings.js"),g=r("./src/streaming/constants/Constants.js"),p=r("./src/streaming/models/LowLatencyThroughputModel.js");function m(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function y(e){e=e||{};var t,r,s,y,E,_,v,T,S,b=this.context,A=e.errHandler,R=e.dashMetrics,I=e.mediaPlayerModel,C=e.requestModifier,w=e.boxParser,N=e.errors,D=e.requestTimeout||0,M=Object(f.default)(b).getInstance(),O=Object(h.default)(b).getInstance();function P(e,t){var u,c=e.request,f=[],h=!0,p=!0,m=new Date,S=m,N=0;if(!C||!R||!A)throw new Error("config object is not correct or missing");var L,F=function(e){if(p=!1,c.requestStartDate=m,c.requestEndDate=new Date,c.firstByteDate=c.firstByteDate||m,!c.checkExistenceOnly){var t=u.response?u.response.responseURL:null,r=u.response?u.response.status:null,n=u.response&&u.response.getAllResponseHeaders?u.response.getAllResponseHeaders():u.response?u.response.responseHeaders:[];R.addHttpRequest(c,t,r,n,e?f:null),c.type===i.HTTPRequest.MPD_TYPE&&R.addManifestUpdate(c)}},j=function(){if(-1!==r.indexOf(u)&&(r.splice(r.indexOf(u),1),p))if(F(!1),t>0){try{O.get().streaming.utcSynchronization.enableBackgroundSyncAfterSegmentDownloadError&&c.type===i.HTTPRequest.MEDIA_SEGMENT_TYPE&&I.getRetryAttemptsForType(i.HTTPRequest.MEDIA_SEGMENT_TYPE)===t&&M.trigger(d.default.ATTEMPT_BACKGROUND_SYNC)}catch(e){}t--;var n={config:e};y.push(n),n.timeout=setTimeout(function(){-1!==y.indexOf(n)&&(y.splice(y.indexOf(n),1),P(e,t))},I.getRetryIntervalsForType(c.type))}else{if(c.type===i.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE)return;A.error(new o.default(E[c.type],c.url+" is not available",{request:c,response:u.response})),e.error&&e.error(c,"error",u.response.statusText),e.complete&&e.complete(c,u.response.statusText)}};O.get().streaming.lowLatencyEnabled&&window.fetch&&"arraybuffer"===c.responseType&&c.type===i.HTTPRequest.MEDIA_SEGMENT_TYPE?(L=Object(a.default)(b).create({requestModifier:C,lowLatencyThroughputModel:v,boxParser:w})).setup({dashMetrics:R}):L=Object(n.default)(b).create({requestModifier:C});var x=null,k=C.modifyRequestURL(c.url);if(O.get().streaming.cmcd&&O.get().streaming.cmcd.enabled){var B=O.get().streaming.cmcd.mode;if(B===g.default.CMCD_MODE_QUERY){var U=function(e){try{var t=[],r=_.getQueryParameter(e);return r&&t.push(r),t}catch(e){return[]}}(c);k=l.default.addAditionalQueryParameterToUrl(k,U)}else B===g.default.CMCD_MODE_HEADER&&(x=_.getHeaderParameters(c))}c.url=k;var G=c.checkExistenceOnly?i.HTTPRequest.HEAD:i.HTTPRequest.GET,H=I.getXHRWithCredentialsForType(c.type);u={url:k,method:G,withCredentials:H,request:c,onload:function(){u.response.status>=200&&u.response.status<=299&&(F(!0),e.success&&e.success(u.response.response,u.response.statusText,u.response.responseURL),e.complete&&e.complete(c,u.response.statusText))},onend:j,onerror:j,progress:function(t){var r=new Date;h&&(h=!1,(!t.lengthComputable||t.lengthComputable&&t.total!==t.loaded)&&(c.firstByteDate=r)),t.lengthComputable&&(c.bytesLoaded=t.loaded,c.bytesTotal=t.total),t.noTrace||(f.push({s:S,d:t.time?t.time:r.getTime()-S.getTime(),b:[t.loaded?t.loaded-N:0],t:t.throughput}),S=r,N=t.loaded),e.progress&&t&&e.progress(t)},onabort:function(){e.abort&&e.abort(c)},ontimeout:function(e){var t;if(e.lengthComputable){var r=e.loaded/e.total*100;t="Request timeout: loaded: "+e.loaded+", out of: "+e.total+" : "+r.toFixed(3)+"% Completed"}else t="Request timeout: non-computable download size";T.warn(t)},loader:L,timeout:D,headers:x};var q=(new Date).getTime();if(isNaN(c.delayLoadingTime)||q>=c.delayLoadingTime)r.push(u),L.load(u);else{var Y={httpRequest:u};s.push(Y),Y.delayTimeout=setTimeout(function(){if(-1!==s.indexOf(Y)){s.splice(s.indexOf(Y),1);try{m=new Date,S=m,r.push(Y.httpRequest),L.load(Y.httpRequest)}catch(e){Y.httpRequest.onerror()}}},c.delayLoadingTime-q)}}return t={load:function(e){e.request?P(e,I.getRetryAttemptsForType(e.request.type)):e.error&&e.error(e.request,"error")},abort:function(){y.forEach(function(e){clearTimeout(e.timeout),e.config.request&&e.config.abort&&e.config.abort(e.config.request)}),y=[],s.forEach(function(e){return clearTimeout(e.delayTimeout)}),s=[],r.forEach(function(e){e.request.type!==i.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE&&(e.onloadend=e.onerror=e.onprogress=void 0,e.loader.abort(e))}),r=[]}},T=Object(c.default)(b).getInstance().getLogger(t),r=[],s=[],y=[],_=Object(u.default)(b).getInstance(),v=Object(p.default)(b).getInstance(),m(S={},i.HTTPRequest.MPD_TYPE,N.DOWNLOAD_ERROR_ID_MANIFEST_CODE),m(S,i.HTTPRequest.XLINK_EXPANSION_TYPE,N.DOWNLOAD_ERROR_ID_XLINK_CODE),m(S,i.HTTPRequest.INIT_SEGMENT_TYPE,N.DOWNLOAD_ERROR_ID_INITIALIZATION_CODE),m(S,i.HTTPRequest.MEDIA_SEGMENT_TYPE,N.DOWNLOAD_ERROR_ID_CONTENT_CODE),m(S,i.HTTPRequest.INDEX_SEGMENT_TYPE,N.DOWNLOAD_ERROR_ID_CONTENT_CODE),m(S,i.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE,N.DOWNLOAD_ERROR_ID_CONTENT_CODE),m(S,i.HTTPRequest.OTHER_TYPE,N.DOWNLOAD_ERROR_ID_CONTENT_CODE),E=S,t}y.__dashjs_factory_name="HTTPLoader";var E=s.default.getClassFactory(y);t.default=E},"./src/streaming/net/SchemeLoaderFactory.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/streaming/net/HTTPLoader.js");function i(){var e;function t(){e={}}function r(){t()}return r(),{getLoader:function(t){for(var r in e)if(e.hasOwnProperty(r)&&t.startsWith(r))return e[r];return a.default},registerLoader:function(t,r){e[t]=r},unregisterLoader:function(t){e[t]&&delete e[t]},unregisterAllLoader:t,reset:r}}i.__dashjs_factory_name="SchemeLoaderFactory";var s=n.default.getSingletonFactory(i);t.default=s},"./src/streaming/net/URLLoader.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/streaming/net/SchemeLoaderFactory.js");function i(e){e=e||{};var t,r,n=this.context;return t=Object(a.default)(n).getInstance(),{load:function(a){if(!r){var i=t.getLoader(a&&a.request?a.request.url:null);r=i(n).create({errHandler:e.errHandler,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,dashMetrics:e.dashMetrics,boxParser:e.boxParser?e.boxParser:null,constants:e.constants?e.constants:null,dashConstants:e.dashConstants?e.dashConstants:null,urlUtils:e.urlUtils?e.urlUtils:null,requestTimeout:isNaN(e.requestTimeout)?0:e.requestTimeout,errors:e.errors})}r.load(a)},abort:function(){r&&r.abort()}}}i.__dashjs_factory_name="URLLoader";var s=n.default.getClassFactory(i);t.default=s},"./src/streaming/net/XHRLoader.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js");function a(e){var t=(e=e||{}).requestModifier;return{load:function(e){var r=new Date,n=e.request,a=new XMLHttpRequest;if(a.open(e.method,e.url,!0),n.responseType&&(a.responseType=n.responseType),n.range&&a.setRequestHeader("Range","bytes="+n.range),n.requestStartDate||(n.requestStartDate=r),t&&(a=t.modifyRequestHeader(a)),e.headers)for(var i in e.headers){var s=e.headers[i];s&&a.setRequestHeader(i,s)}a.withCredentials=e.withCredentials,a.onload=e.onload,a.onloadend=e.onend,a.onerror=e.onerror,a.onprogress=e.progress,a.onabort=e.onabort,a.ontimeout=e.ontimeout,a.timeout=e.timeout,a.send(),e.response=a},abort:function(e){var t=e.response;t.onloadend=t.onerror=t.onprogress=void 0,t.abort()}}}a.__dashjs_factory_name="XHRLoader";var i=n.default.getClassFactory(a);t.default=i},"./src/streaming/protection/CommonEncryption.js":function(e,t,r){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}r.r(t);var a={attributes:["Laurl","laurl"],prefixes:["clearkey","dashif"]},i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,r;return t=e,r=[{key:"findCencContentProtection",value:function(e){for(var t=null,r=0;r<e.length;++r){var n=e[r];"urn:mpeg:dash:mp4protection:2011"!==n.schemeIdUri.toLowerCase()||"cenc"!==n.value.toLowerCase()&&"cbcs"!==n.value.toLowerCase()||(t=n)}return t}},{key:"getPSSHData",value:function(e){var t=8,r=new DataView(e),n=r.getUint8(t);return t+=20,n>0&&(t+=4+16*r.getUint32(t)),t+=4,e.slice(t)}},{key:"getPSSHForKeySystem",value:function(t,r){var n=e.parsePSSHList(r);return t&&n.hasOwnProperty(t.uuid.toLowerCase())?n[t.uuid.toLowerCase()]:null}},{key:"parseInitDataFromContentProtection",value:function(e,t){return"pssh"in e?(e.pssh.__text=e.pssh.__text.replace(/\r?\n|\r/g,"").replace(/\s+/g,""),t.decodeArray(e.pssh.__text).buffer):null}},{key:"parsePSSHList",value:function(e){if(null==e)return[];for(var t=new DataView(e.buffer||e),r={},n=0;;){var a,i,s=void 0,o=n;if(n>=t.buffer.byteLength)break;if(a=n+t.getUint32(n),n+=4,1886614376===t.getUint32(n))if(n+=4,0===(i=t.getUint8(n))||1===i){n++,n+=3,s="";var u=void 0,l=void 0;for(u=0;u<4;u++)s+=1===(l=t.getUint8(n+u).toString(16)).length?"0"+l:l;for(n+=4,s+="-",u=0;u<2;u++)s+=1===(l=t.getUint8(n+u).toString(16)).length?"0"+l:l;for(n+=2,s+="-",u=0;u<2;u++)s+=1===(l=t.getUint8(n+u).toString(16)).length?"0"+l:l;for(n+=2,s+="-",u=0;u<2;u++)s+=1===(l=t.getUint8(n+u).toString(16)).length?"0"+l:l;for(n+=2,s+="-",u=0;u<6;u++)s+=1===(l=t.getUint8(n+u).toString(16)).length?"0"+l:l;n+=6,n+=4,r[s=s.toLowerCase()]=t.buffer.slice(o,a),n=a}else n=a;else n=a}return r}},{key:"getLicenseServerUrlFromMediaInfo",value:function(e,t){try{if(!e||0===e.length)return null;for(var r=0,n=null;r<e.length&&!n;){var i=e[r];if(i&&i.contentProtection&&i.contentProtection.length>0){var s=i.contentProtection.filter(function(e){return e.schemeIdUri&&e.schemeIdUri===t});if(s&&s.length>0)for(var o=0;o<s.length&&!n;){for(var u=s[o],l=0;l<a.attributes.length&&!n;){for(var c=0,f=a.attributes[l];c<a.prefixes.length&&!n;){var d=a.prefixes[c];u[f]&&u[f].__prefix&&u[f].__prefix===d&&u[f].__text&&(n=u[f].__text),c+=1}l+=1}o+=1}}r+=1}return n}catch(e){return null}}}],null&&n(t.prototype,null),r&&n(t,r),e}();t.default=i},"./src/streaming/protection/Protection.js":function(e,t,r){r.r(t);var n=r("./src/streaming/protection/controllers/ProtectionController.js"),a=r("./src/streaming/protection/controllers/ProtectionKeyController.js"),i=r("./src/streaming/protection/ProtectionEvents.js"),s=r("./src/streaming/protection/errors/ProtectionErrors.js"),o=r("./src/streaming/protection/models/ProtectionModel_21Jan2015.js"),u=r("./src/streaming/protection/models/ProtectionModel_3Feb2014.js"),l=r("./src/streaming/protection/models/ProtectionModel_01b.js"),c=[{generateKeyRequest:"generateKeyRequest",addKey:"addKey",cancelKeyRequest:"cancelKeyRequest",needkey:"needkey",keyerror:"keyerror",keyadded:"keyadded",keymessage:"keymessage"},{generateKeyRequest:"webkitGenerateKeyRequest",addKey:"webkitAddKey",cancelKeyRequest:"webkitCancelKeyRequest",needkey:"webkitneedkey",keyerror:"webkitkeyerror",keyadded:"webkitkeyadded",keymessage:"webkitkeymessage"}],f=[{setMediaKeys:"setMediaKeys",MediaKeys:"MediaKeys",release:"close",needkey:"needkey",error:"keyerror",message:"keymessage",ready:"keyadded",close:"keyclose"},{setMediaKeys:"msSetMediaKeys",MediaKeys:"MSMediaKeys",release:"close",needkey:"msneedkey",error:"mskeyerror",message:"mskeymessage",ready:"mskeyadded",close:"mskeyclose"}];function d(){var e,t=this.context;function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];if("function"==typeof e[n[Object.keys(n)[0]]])return n}return null}return e={createProtectionSystem:function(i){var s=null,d=Object(a.default)(t).getInstance();d.setConfig({debug:i.debug,BASE64:i.BASE64}),d.initialize();var h=function(n){var a=n.debug,i=a.getLogger(e),s=n.eventBus,d=n.errHandler,h=n.videoModel?n.videoModel.getElement():null;return h&&void 0===h.onencrypted||h&&void 0===h.mediaKeys?r(h,f)?(i.info("EME detected on this user agent! (ProtectionModel_3Feb2014)"),Object(u.default)(t).create({debug:a,eventBus:s,events:n.events,api:r(h,f)})):r(h,c)?(i.info("EME detected on this user agent! (ProtectionModel_01b)"),Object(l.default)(t).create({debug:a,eventBus:s,errHandler:d,events:n.events,api:r(h,c)})):(i.warn("No supported version of EME detected on this user agent! - Attempts to play encrypted content will fail!"),null):(i.info("EME detected on this user agent! (ProtectionModel_21Jan2015)"),Object(o.default)(t).create({debug:a,eventBus:s,events:n.events}))}(i);return!s&&h&&(s=Object(n.default)(t).create({protectionModel:h,protectionKeyController:d,eventBus:i.eventBus,debug:i.debug,events:i.events,BASE64:i.BASE64,constants:i.constants,cmcdModel:i.cmcdModel,settings:i.settings}),i.capabilities.setEncryptedMediaSupported(!0)),s}}}d.__dashjs_factory_name="Protection";var h=dashjs.FactoryMaker.getClassFactory(d);h.events=i.default,h.errors=s.default,dashjs.FactoryMaker.updateClassFactory(d.__dashjs_factory_name,h),t.default=h},"./src/streaming/protection/ProtectionEvents.js":function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}r.r(t);var s=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(o,e);var t,r,s=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,a=i(t);if(r){var s=i(this).constructor;e=Reflect.construct(a,arguments,s)}else e=a.apply(this,arguments);return function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function o(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=s.call(this)).INTERNAL_KEY_MESSAGE="internalKeyMessage",e.INTERNAL_KEY_STATUS_CHANGED="internalkeyStatusChanged",e.KEY_ADDED="public_keyAdded",e.KEY_ERROR="public_keyError",e.KEY_MESSAGE="public_keyMessage",e.KEY_SESSION_CLOSED="public_keySessionClosed",e.KEY_SESSION_CREATED="public_keySessionCreated",e.KEY_SESSION_REMOVED="public_keySessionRemoved",e.KEY_STATUSES_CHANGED="public_keyStatusesChanged",e.KEY_SYSTEM_ACCESS_COMPLETE="public_keySystemAccessComplete",e.KEY_SYSTEM_SELECTED="public_keySystemSelected",e.LICENSE_REQUEST_COMPLETE="public_licenseRequestComplete",e.LICENSE_REQUEST_SENDING="public_licenseRequestSending",e.NEED_KEY="needkey",e.PROTECTION_CREATED="public_protectioncreated",e.PROTECTION_DESTROYED="public_protectiondestroyed",e.SERVER_CERTIFICATE_UPDATED="serverCertificateUpdated",e.TEARDOWN_COMPLETE="protectionTeardownComplete",e.VIDEO_ELEMENT_SELECTED="videoElementSelected",e.KEY_SESSION_UPDATED="public_keySessionUpdated",e}return o}(r("./src/core/events/EventsBase.js").default));t.default=s},"./src/streaming/protection/controllers/ProtectionController.js":function(e,t,r){r.r(t);var n=r("./src/streaming/protection/CommonEncryption.js"),a=r("./src/streaming/protection/vo/MediaCapability.js"),i=r("./src/streaming/protection/vo/KeySystemConfiguration.js"),s=r("./src/streaming/protection/errors/ProtectionErrors.js"),o=r("./src/streaming/vo/DashJSError.js"),u=r("./src/streaming/protection/vo/LicenseRequest.js"),l=r("./src/streaming/protection/vo/LicenseResponse.js"),c=r("./src/streaming/vo/metrics/HTTPRequest.js"),f=r("./src/core/Utils.js"),d=r("./src/streaming/constants/Constants.js"),h=r("./src/core/FactoryMaker.js");function g(e){return g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},g(e)}function p(e){var t,r,h,p,m,y,E,_,v,T,S,b=(e=e||{}).protectionKeyController,A=e.protectionModel,R=e.eventBus,I=e.events,C=e.debug,w=e.BASE64,N=e.constants,D=[],M=e.cmcdModel,O=e.settings;function P(){if(!(R&&R.hasOwnProperty("on")&&b&&b.hasOwnProperty("getSupportedKeySystemsFromContentProtection")))throw new Error("Missing config parameter(s)")}function L(e,t){v?h.push(e):_?_&&function(e){var t=e.findIndex(function(e){return e.ks===_}),r=e[t];-1!==t&&r.initData&&F(r)}(e):function(e,t){v=!0;var n,a=[];h.push(e);for(var i=0;i<e.length;i++){var u=G(e[i]);a.push({ks:e[i].ks,configs:[u]})}A.requestKeySystemAccess(a).then(function(e){return n=e.data,r.info("DRM: KeySystem Access Granted ("+n.keySystem.systemString+")! Selecting key system..."),A.selectKeySystem(n)}).then(function(e){if(_=e,v=!1,A){R.trigger(I.KEY_SYSTEM_SELECTED,{data:n});var t,r=k(_);r&&r.serverCertificate&&r.serverCertificate.length>0&&A.setServerCertificate(w.decodeArray(r.serverCertificate).buffer);for(var a=0;a<h.length;a++)for(t=0;t<h[a].length;t++)if(_===h[a][t].ks){F(h[a][t]);break}}}).catch(function(e){_=null,v=!1,t||R.trigger(I.KEY_SYSTEM_SELECTED,{data:null,error:new o.default(s.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE,s.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE+"Error selecting key system! -- "+e.error)})})}(e,t)}function F(e){if(b.isClearKey(_)&&e.protData&&e.protData.hasOwnProperty("clearkeys")){var t={kids:Object.keys(e.protData.clearkeys)};e.initData=(new TextEncoder).encode(JSON.stringify(t))}e.sessionId?j(e):null!==e.initData&&x(e)}function j(e){P(),A.loadKeySession(e)}function x(e){var t=n.default.getPSSHForKeySystem(_,e?e.initData:null);if(t){if(function(e){if(!e)return!1;try{for(var t=A.getSessions(),r=0;r<t.length;r++)if(t[r].getKeyId()===e)return!0;return!1}catch(e){return!1}}(e.keyId))return;if(B(t))return;try{e.initData=t,A.createKeySession(e)}catch(e){R.trigger(I.KEY_SESSION_CREATED,{data:null,error:new o.default(s.default.KEY_SESSION_CREATED_ERROR_CODE,s.default.KEY_SESSION_CREATED_ERROR_MESSAGE+e.message)})}}else e&&e.initData?A.createKeySession(e):R.trigger(I.KEY_SESSION_CREATED,{data:null,error:new o.default(s.default.KEY_SESSION_CREATED_ERROR_CODE,s.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Selected key system is "+(_?_.systemString:null)+". needkey/encrypted event contains no initData corresponding to that key system!")})}function k(e){if(e){var t=e.systemString;if(m)return t in m?m[t]:null}return null}function B(e){if(!e)return!1;try{for(var t=A.getAllInitData(),n=0;n<t.length;n++)if(b.initDataEquals(e,t[n]))return r.debug("DRM: Ignoring initData because we have already seen it!"),!0;return!1}catch(e){return!1}}function U(e){P(),e?(A.setMediaElement(e),R.on(I.NEED_KEY,X,t)):null===e&&(A.setMediaElement(e),R.off(I.NEED_KEY,X,t))}function G(e){var t=e.protData,r=[],n=[],s=t&&t.audioRobustness&&t.audioRobustness.length>0?t.audioRobustness:E,o=t&&t.videoRobustness&&t.videoRobustness.length>0?t.videoRobustness:E,u=e.sessionType,l=t&&t.distinctiveIdentifier?t.distinctiveIdentifier:"optional",c=t&&t.persistentState?t.persistentState:"temporary"===u?"optional":"required";return p.forEach(function(e){e.type===N.AUDIO?r.push(new a.default(e.codec,s)):e.type===N.VIDEO&&n.push(new a.default(e.codec,o))}),new i.default(r,n,l,c,[u])}function H(e){e.error?R.trigger(I.KEY_STATUSES_CHANGED,{data:null,error:e.error}):r.debug("DRM: key status = "+e.status)}function q(e){r.debug("DRM: onKeyMessage");var t=e.data;R.trigger(I.KEY_MESSAGE,{data:t});var a=t.messageType?t.messageType:"license-request",i=t.message,d=t.sessionToken,h=k(_),m=b.getLicenseServerModelInstance(_,h,a),y={sessionToken:d,messageType:a};if(i&&0!==i.byteLength){if(!m)return r.debug("DRM: License server request not required for this message (type = "+e.data.messageType+"). Session ID = "+d.getSessionId()),void Y(y);if(b.isClearKey(_)){var E=b.processClearKeyLicenseRequest(_,h,i);if(E)return r.debug("DRM: ClearKey license request handled by application!"),Y(y),void A.updateKeySession(d,E)}!function(e,t,r){var a=e.sessionToken,i=e.messageType?e.messageType:"license-request",d={sessionToken:a,messageType:i},h=_?_.systemString:null,m=function(e,t,r,a,i){var s=null,o=a.message;if(e&&e.serverURL){var u=e.serverURL;"string"==typeof u&&""!==u?s=u:"object"===g(u)&&u.hasOwnProperty(t)&&(s=u[t])}else if(e&&e.laURL&&""!==e.laURL)s=e.laURL;else if(!(s=n.default.getLicenseServerUrlFromMediaInfo(p,_.schemeIdURI))&&!b.isClearKey(_)){var l=n.default.getPSSHData(r.initData);(s=_.getLicenseServerURLFromInitData(l))||(s=a.laURL)}return i.getServerURLFromMessage(s,o,t)}(r,i,a,e,t);if(m){var y={},E=!1;r&&V(y,r.httpRequestHeaders);var v=e.message;V(y,_.getRequestHeadersFromMessage(v)),Object.keys(y).forEach(function(e){"authorization"===e.toLowerCase()&&(E=!0)}),r&&"boolean"==typeof r.withCredentials&&(E=r.withCredentials);var R=function(e){if(A)if(e.status>=200&&e.status<=299){var r=f.default.parseHttpHeaders(e.getAllResponseHeaders?e.getAllResponseHeaders():null),n=new l.default(e.responseURL,r,e.response);z(S,n).then(function(){var r=t.getLicenseMessage(n.data,h,i);null!==r?(Y(d),A.updateKeySession(a,r)):W(e,d,h,i,t)})}else W(e,d,h,i,t)},I=function(e){Y(d,new o.default(s.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,s.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+h+' update, XHR aborted. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState))},C=function(e){Y(d,new o.default(s.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,s.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+h+' update, XHR error. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState))},w=_.getLicenseRequestFromMessage(v),N=t.getHTTPMethod(i),D=t.getResponseType(h,i),M=r&&!isNaN(r.httpTimeout)?r.httpTimeout:8e3,P=a.getSessionId()||null,L=new u.default(m,N,D,y,E,i,P,w),F=isNaN(O.get().streaming.retryAttempts[c.HTTPRequest.LICENSE])?3:O.get().streaming.retryAttempts[c.HTTPRequest.LICENSE];z(T,L).then(function(){K(L,F,M,R,I,C)})}else Y(d,new o.default(s.default.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE,s.default.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE))}(t,m,h)}else Y(y,new o.default(s.default.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE,s.default.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE))}function Y(e,t){R.trigger(I.LICENSE_REQUEST_COMPLETE,{data:e,error:t})}function K(e,t,n,a,i,s){var o=new XMLHttpRequest;if(O.get().streaming.cmcd&&O.get().streaming.cmcd.enabled&&O.get().streaming.cmcd.mode===d.default.CMCD_MODE_QUERY){var u=M.getQueryParameter({url:e.url,type:c.HTTPRequest.LICENSE});u&&(e.url=f.default.addAditionalQueryParameterToUrl(e.url,[u]))}for(var l in o.open(e.method,e.url,!0),o.responseType=e.responseType,o.withCredentials=e.withCredentials,n>0&&(o.timeout=n),e.headers)o.setRequestHeader(l,e.headers[l]);if(O.get().streaming.cmcd&&O.get().streaming.cmcd.enabled&&O.get().streaming.cmcd.mode===d.default.CMCD_MODE_HEADER){var h=M.getHeaderParameters({url:e.url,type:c.HTTPRequest.LICENSE});if(h)for(var g in h){var p=h[g];p&&o.setRequestHeader(g,p)}}var m=function(){t--;var r=isNaN(O.get().streaming.retryIntervals[c.HTTPRequest.LICENSE])?1e3:O.get().streaming.retryIntervals[c.HTTPRequest.LICENSE];setTimeout(function(){K(e,t,n,a,i,s)},r)};o.onload=function(){this.status>=200&&this.status<=299||t<=0?a(this):(r.warn("License request failed ("+this.status+"). Retrying it... Pending retries: "+t),m())},o.ontimeout=o.onerror=function(){t<=0?s(this):(r.warn("License request network request failed . Retrying it... Pending retries: "+t),m())},o.onabort=function(){i(this)},R.trigger(I.LICENSE_REQUEST_SENDING,{url:e.url,headers:e.headers,payload:e.data,sessionId:e.sessionId}),o.send(e.data)}function V(e,t){if(t)for(var r in t)e[r]=t[r]}function W(e,t,r,n,a){var i=e.response?a.getErrorResponse(e.response,r,n):"NONE";Y(t,new o.default(s.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,s.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+r+' update, XHR complete. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState+". Response is "+i))}function z(e,t){return e?e.reduce(function(e,r){return e.then(function(){return r(t)})},Promise.resolve()):Promise.resolve()}function X(e,t){if(!O.get().streaming.protection.ignoreEmeEncryptedEvent){if(r.debug("DRM: onNeedKey"),"cenc"!==e.key.initDataType)return void r.warn("DRM: Only 'cenc' initData is supported! Ignoring initData of type: "+e.key.initDataType);if(0===p.length&&(r.warn("DRM: onNeedKey called before initializeForMedia, wait until initialized"),(t=void 0===t?1:t+1)<5))return void D.push(setTimeout(function(){X(e,t)},500));var a=e.key.initData;if(ArrayBuffer.isView(a)&&(a=a.buffer),_){var i=n.default.getPSSHForKeySystem(_,a);if(i&&B(i))return}r.debug("DRM: initData:",String.fromCharCode.apply(null,new Uint8Array(a)));var s=b.getSupportedKeySystemsFromSegmentPssh(a,m,y);if(0===s.length)return void r.debug("DRM: Received needkey event with initData, but we don't support any of the key systems!");L(s,!1)}}return t={initializeForMedia:function(e){if(!e)throw new Error("mediaInfo can not be null or undefined");P(),p.push(e);var t=b.getSupportedKeySystemsFromContentProtection(e.contentProtection,m,y);(t=t.sort(function(e,r){return(m&&m[e.ks.systemString]&&m[e.ks.systemString].priority>=0?m[e.ks.systemString].priority:t.length)-(m&&m[r.ks.systemString]&&m[r.ks.systemString].priority>=0?m[r.ks.systemString].priority:t.length)}))&&t.length>0&&L(t,!0)},clearMediaInfoArray:function(){p=[]},createKeySession:x,loadKeySession:j,removeKeySession:function(e){P(),A.removeKeySession(e)},closeKeySession:function(e){P(),A.closeKeySession(e)},setServerCertificate:function(e){P(),A.setServerCertificate(e)},setMediaElement:U,setSessionType:function(e){y=e},setRobustnessLevel:function(e){E=e},setProtectionData:function(e){m=e,b.setProtectionData(e)},getSupportedKeySystemsFromContentProtection:function(e){return P(),b.getSupportedKeySystemsFromContentProtection(e,m,y)},getKeySystems:function(){return b?b.getKeySystems():[]},setKeySystems:function(e){b&&b.setKeySystems(e)},setLicenseRequestFilters:function(e){T=e},setLicenseResponseFilters:function(e){S=e},stop:function(){A&&A.stop()},reset:function(){R.off(I.INTERNAL_KEY_MESSAGE,q,t),R.off(I.INTERNAL_KEY_STATUS_CHANGED,H,t),P(),T=[],S=[],U(null),_=null,v=!1,A&&(A.reset(),A=null),D.forEach(function(e){return clearTimeout(e)}),D=[],p=[],h=[]}},r=C.getLogger(t),h=[],p=[],y="temporary",E="",T=[],S=[],R.on(I.INTERNAL_KEY_MESSAGE,q,t),R.on(I.INTERNAL_KEY_STATUS_CHANGED,H,t),t}p.__dashjs_factory_name="ProtectionController",t.default=h.default.getClassFactory(p)},"./src/streaming/protection/controllers/ProtectionKeyController.js":function(e,t,r){r.r(t);var n=r("./src/streaming/protection/CommonEncryption.js"),a=r("./src/streaming/protection/drm/KeySystemClearKey.js"),i=r("./src/streaming/protection/drm/KeySystemW3CClearKey.js"),s=r("./src/streaming/protection/drm/KeySystemWidevine.js"),o=r("./src/streaming/protection/drm/KeySystemPlayReady.js"),u=r("./src/streaming/protection/servers/DRMToday.js"),l=r("./src/streaming/protection/servers/PlayReady.js"),c=r("./src/streaming/protection/servers/Widevine.js"),f=r("./src/streaming/protection/servers/ClearKey.js"),d=r("./src/streaming/constants/ProtectionConstants.js");function h(){var e,t,r,h,g,p,m,y=this.context;function E(e,t){return t&&e in t?t[e]:null}function _(e,t){return e&&e.sessionId?e.sessionId:t&&t.sessionId?t.sessionId:null}function v(e,t){return e&&e.sessionType?e.sessionType:t}return e={initialize:function(){var e;h=[],e=Object(o.default)(y).getInstance({BASE64:g}),h.push(e),e=Object(s.default)(y).getInstance({BASE64:g}),h.push(e),e=Object(a.default)(y).getInstance({BASE64:g}),h.push(e),p=e,e=Object(i.default)(y).getInstance({BASE64:g,debug:t}),h.push(e),m=e},setProtectionData:function(e){for(var t=function(t){var r=null;return e&&(r=t in e?e[t]:null),r},r=0;r<h.length;r++){var n=h[r];n.hasOwnProperty("init")&&n.init(t(n.systemString))}},isClearKey:function(e){return e===p||e===m},initDataEquals:function(e,t){if(e.byteLength===t.byteLength){for(var r=new Uint8Array(e),n=new Uint8Array(t),a=0;a<r.length;a++)if(r[a]!==n[a])return!1;return!0}return!1},getKeySystems:function(){return h},setKeySystems:function(e){h=e},getKeySystemBySystemString:function(e){for(var t=0;t<h.length;t++)if(h[t].systemString===e)return h[t];return null},getSupportedKeySystemsFromContentProtection:function(e,t,r){var a,i,s,o,u=[];if(e){var l=n.default.findCencContentProtection(e);for(s=0;s<h.length;++s){var c=E((i=h[s]).systemString,t);for(o=0;o<e.length;++o)if((a=e[o]).schemeIdUri.toLowerCase()===i.schemeIdURI){var f=i.getInitData(a,l);u.push({ks:h[s],keyId:a.keyId,initData:f,protData:c,cdmData:i.getCDMData(c?c.cdmData:null),sessionId:_(c,a),sessionType:v(c,r)})}}}return u},getSupportedKeySystemsFromSegmentPssh:function(e,t,r){for(var a,i=[],s=n.default.parsePSSHList(e),o=0;o<h.length;++o){var u=E((a=h[o]).systemString,t);a.uuid in s&&i.push({ks:a,initData:s[a.uuid],protData:u,cdmData:a.getCDMData(u?u.cdmData:null),sessionId:_(u),sessionType:v(u,r)})}return i},getLicenseServerModelInstance:function(e,t,r){if("license-release"===r||"individualization-request"===r)return null;var n=null;return t&&t.hasOwnProperty("drmtoday")?n=Object(u.default)(y).getInstance({BASE64:g}):e.systemString===d.default.WIDEVINE_KEYSTEM_STRING?n=Object(c.default)(y).getInstance():e.systemString===d.default.PLAYREADY_KEYSTEM_STRING?n=Object(l.default)(y).getInstance():e.systemString===d.default.CLEARKEY_KEYSTEM_STRING&&(n=Object(f.default)(y).getInstance()),n},processClearKeyLicenseRequest:function(e,t,n){try{return e.getClearKeysFromProtectionData(t,n)}catch(e){return r.error("Failed to retrieve clearkeys from ProtectionData"),null}},setConfig:function(n){n&&(n.debug&&(t=n.debug,r=t.getLogger(e)),n.BASE64&&(g=n.BASE64))}}}h.__dashjs_factory_name="ProtectionKeyController",t.default=dashjs.FactoryMaker.getSingletonFactory(h)},"./src/streaming/protection/drm/KeySystemClearKey.js":function(e,t,r){r.r(t);var n=r("./src/streaming/protection/vo/KeyPair.js"),a=r("./src/streaming/protection/vo/ClearKeyKeySet.js"),i=r("./src/streaming/protection/CommonEncryption.js"),s=r("./src/streaming/constants/ProtectionConstants.js"),o="e2719d58-a985-b3c9-781a-b030af78d30e",u=s.default.CLEARKEY_KEYSTEM_STRING,l="urn:uuid:"+o;function c(e){var t=(e=e||{}).BASE64;return{uuid:o,schemeIdURI:l,systemString:u,getInitData:function(e,r){try{var n=i.default.parseInitDataFromContentProtection(e,t);if(!n&&r){var a={kids:[function(e){try{var t=e.replace(/-/g,"");return(t=btoa(t.match(/\w{2}/g).map(function(e){return String.fromCharCode(parseInt(e,16))}).join(""))).replace(/=/g,"")}catch(e){return null}}(r["cenc:default_KID"])]};n=(new TextEncoder).encode(JSON.stringify(a))}return n}catch(e){return null}},getRequestHeadersFromMessage:function(){return{"Content-Type":"application/json"}},getLicenseRequestFromMessage:function(e){return JSON.parse(String.fromCharCode.apply(null,new Uint8Array(e)))},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getClearKeysFromProtectionData:function(e,t){var r=null;if(e){for(var i=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(t))),s=[],o=0;o<i.kids.length;o++){var u=i.kids[o],l=e.clearkeys&&e.clearkeys.hasOwnProperty(u)?e.clearkeys[u]:null;if(!l)throw new Error("DRM: ClearKey keyID ("+u+") is not known!");s.push(new n.default(u,l))}r=new a.default(s)}return r}}}c.__dashjs_factory_name="KeySystemClearKey",t.default=dashjs.FactoryMaker.getSingletonFactory(c)},"./src/streaming/protection/drm/KeySystemPlayReady.js":function(e,t,r){r.r(t);var n=r("./src/streaming/protection/CommonEncryption.js"),a=r("./src/streaming/constants/ProtectionConstants.js"),i="9a04f079-9840-4286-ab92-e65be0885f95",s=a.default.PLAYREADY_KEYSTEM_STRING,o="urn:uuid:"+i;function u(e){var t="utf-16",r=(e=e||{}).BASE64;function a(){if(!r||!r.hasOwnProperty("decodeArray")||!r.hasOwnProperty("decodeArray"))throw new Error("Missing config parameter(s)")}return{uuid:i,schemeIdURI:o,systemString:s,getInitData:function(e){var t,i,s,o,u,l=new Uint8Array([112,115,115,104,0,0,0,0]),c=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]),f=0,d=null;if(a(),!e)return null;if("pssh"in e)return n.default.parseInitDataFromContentProtection(e,r);if("pro"in e)d=r.decodeArray(e.pro.__text);else{if(!("prheader"in e))return null;d=r.decodeArray(e.prheader.__text)}return t=d.length,i=4+l.length+c.length+4+t,s=new ArrayBuffer(i),o=new Uint8Array(s),(u=new DataView(s)).setUint32(f,i),f+=4,o.set(l,f),f+=l.length,o.set(c,f),f+=c.length,u.setUint32(f,t),f+=4,o.set(d,f),f+=t,o.buffer},getRequestHeadersFromMessage:function(e){var r,n,a={},i=new DOMParser,s="utf-16"===t?new Uint16Array(e):new Uint8Array(e);r=String.fromCharCode.apply(null,s);for(var o=(n=i.parseFromString(r,"application/xml")).getElementsByTagName("name"),u=n.getElementsByTagName("value"),l=0;l<o.length;l++)a[o[l].childNodes[0].nodeValue]=u[l].childNodes[0].nodeValue;return a.hasOwnProperty("Content")&&(a["Content-Type"]=a.Content,delete a.Content),a.hasOwnProperty("Content-Type")||(a["Content-Type"]="text/xml; charset=utf-8"),a},getLicenseRequestFromMessage:function(e){var n=null,i=new DOMParser,s="utf-16"===t?new Uint16Array(e):new Uint8Array(e);a();var o=String.fromCharCode.apply(null,s),u=i.parseFromString(o,"application/xml");if(!u.getElementsByTagName("PlayReadyKeyMessage")[0])return e;var l=u.getElementsByTagName("Challenge")[0].childNodes[0].nodeValue;return l&&(n=r.decode(l)),n},getLicenseServerURLFromInitData:function(e){if(e)for(var t=new DataView(e),r=t.getUint16(4,!0),n=6,a=new DOMParser,i=0;i<r;i++){var s=t.getUint16(n,!0);n+=2;var o=t.getUint16(n,!0);if(n+=2,1===s){var u=e.slice(n,n+o),l=String.fromCharCode.apply(null,new Uint16Array(u)),c=a.parseFromString(l,"application/xml");if(c.getElementsByTagName("LA_URL")[0]){var f=c.getElementsByTagName("LA_URL")[0].childNodes[0].nodeValue;if(f)return f}if(c.getElementsByTagName("LUI_URL")[0]){var d=c.getElementsByTagName("LUI_URL")[0].childNodes[0].nodeValue;if(d)return d}}else n+=o}return null},getCDMData:function(e){var t,n,i,s;if(a(),!e)return null;for(t=[],s=0;s<e.length;++s)t.push(e.charCodeAt(s)),t.push(0);for(t=String.fromCharCode.apply(null,t),t=r.encode(t),n='<PlayReadyCDMData type="LicenseAcquisition"><LicenseAcquisition version="1.0" Proactive="false"><CustomData encoding="base64encoded">%CUSTOMDATA%</CustomData></LicenseAcquisition></PlayReadyCDMData>'.replace("%CUSTOMDATA%",t),i=[],s=0;s<n.length;++s)i.push(n.charCodeAt(s)),i.push(0);return new Uint8Array(i).buffer},setPlayReadyMessageFormat:function(e){if("utf-8"!==e&&"utf-16"!==e)throw new Error('Specified message format is not one of "utf-8" or "utf-16"');t=e}}}u.__dashjs_factory_name="KeySystemPlayReady",t.default=dashjs.FactoryMaker.getSingletonFactory(u)},"./src/streaming/protection/drm/KeySystemW3CClearKey.js":function(e,t,r){r.r(t);var n=r("./src/streaming/protection/vo/KeyPair.js"),a=r("./src/streaming/protection/vo/ClearKeyKeySet.js"),i=r("./src/streaming/protection/CommonEncryption.js"),s=r("./src/streaming/constants/ProtectionConstants.js"),o="1077efec-c0b2-4d02-ace3-3c1e52e2fb4b",u=s.default.CLEARKEY_KEYSTEM_STRING,l="urn:uuid:"+o;function c(e){var t,r=e.BASE64,s=e.debug.getLogger(t);return{uuid:o,schemeIdURI:l,systemString:u,getInitData:function(e){return i.default.parseInitDataFromContentProtection(e,r)},getRequestHeadersFromMessage:function(){return null},getLicenseRequestFromMessage:function(e){return new Uint8Array(e)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getClearKeysFromProtectionData:function(e,t){var r=null;if(e){for(var i=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(t))),o=[],u=0;u<i.kids.length;u++){var l=i.kids[u],c=e.clearkeys&&e.clearkeys.hasOwnProperty(l)?e.clearkeys[l]:null;if(!c)throw new Error("DRM: ClearKey keyID ("+l+") is not known!");o.push(new n.default(l,c))}r=new a.default(o),s.warn("ClearKey schemeIdURI is using W3C Common PSSH systemID (1077efec-c0b2-4d02-ace3-3c1e52e2fb4b) in Content Protection. See DASH-IF IOP v4.1 section 7.6.2.4")}return r}}}c.__dashjs_factory_name="KeySystemW3CClearKey",t.default=dashjs.FactoryMaker.getSingletonFactory(c)},"./src/streaming/protection/drm/KeySystemWidevine.js":function(e,t,r){r.r(t);var n=r("./src/streaming/protection/CommonEncryption.js"),a=r("./src/streaming/constants/ProtectionConstants.js"),i="edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",s=a.default.WIDEVINE_KEYSTEM_STRING,o="urn:uuid:"+i;function u(e){var t=(e=e||{}).BASE64;return{uuid:i,schemeIdURI:o,systemString:s,getInitData:function(e){return n.default.parseInitDataFromContentProtection(e,t)},getRequestHeadersFromMessage:function(){return null},getLicenseRequestFromMessage:function(e){return new Uint8Array(e)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null}}}u.__dashjs_factory_name="KeySystemWidevine",t.default=dashjs.FactoryMaker.getSingletonFactory(u)},"./src/streaming/protection/errors/ProtectionErrors.js":function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}r.r(t);var s=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(o,e);var t,r,s=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,a=i(t);if(r){var s=i(this).constructor;e=Reflect.construct(a,arguments,s)}else e=a.apply(this,arguments);return function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function o(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=s.call(this)).MEDIA_KEYERR_CODE=100,e.MEDIA_KEYERR_UNKNOWN_CODE=101,e.MEDIA_KEYERR_CLIENT_CODE=102,e.MEDIA_KEYERR_SERVICE_CODE=103,e.MEDIA_KEYERR_OUTPUT_CODE=104,e.MEDIA_KEYERR_HARDWARECHANGE_CODE=105,e.MEDIA_KEYERR_DOMAIN_CODE=106,e.MEDIA_KEY_MESSAGE_ERROR_CODE=107,e.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE=108,e.SERVER_CERTIFICATE_UPDATED_ERROR_CODE=109,e.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE=110,e.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE=111,e.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE=112,e.KEY_SESSION_CREATED_ERROR_CODE=113,e.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE=114,e.MEDIA_KEYERR_UNKNOWN_MESSAGE="An unspecified error occurred. This value is used for errors that don't match any of the other codes.",e.MEDIA_KEYERR_CLIENT_MESSAGE="The Key System could not be installed or updated.",e.MEDIA_KEYERR_SERVICE_MESSAGE="The message passed into update indicated an error from the license service.",e.MEDIA_KEYERR_OUTPUT_MESSAGE="There is no available output device with the required characteristics for the content protection system.",e.MEDIA_KEYERR_HARDWARECHANGE_MESSAGE="A hardware configuration change caused a content protection error.",e.MEDIA_KEYERR_DOMAIN_MESSAGE="An error occurred in a multi-device domain licensing configuration. The most common error is a failure to join the domain.",e.MEDIA_KEY_MESSAGE_ERROR_MESSAGE="Multiple key sessions were creates with a user-agent that does not support sessionIDs!! Unpredictable behavior ahead!",e.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE="DRM: Empty key message from CDM",e.SERVER_CERTIFICATE_UPDATED_ERROR_MESSAGE="Error updating server certificate -- ",e.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE="DRM: KeyStatusChange error! -- License has expired",e.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE="DRM: No license server URL specified!",e.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE="DRM: KeySystem Access Denied! -- ",e.KEY_SESSION_CREATED_ERROR_MESSAGE="DRM: unable to create session! --",e.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE="DRM: licenser error! --",e}return o}(r("./src/core/errors/ErrorsBase.js").default));t.default=s},"./src/streaming/protection/models/ProtectionModel_01b.js":function(e,t,r){r.r(t);var n=r("./src/streaming/protection/controllers/ProtectionKeyController.js"),a=r("./src/streaming/protection/vo/NeedKey.js"),i=r("./src/streaming/vo/DashJSError.js"),s=r("./src/streaming/protection/vo/KeyMessage.js"),o=r("./src/streaming/protection/vo/KeySystemConfiguration.js"),u=r("./src/streaming/protection/vo/KeySystemAccess.js"),l=r("./src/streaming/protection/errors/ProtectionErrors.js");function c(e){e=e||{};var t,r,c,f,d,h,g,p,m,y=this.context,E=e.eventBus,_=e.events,v=e.debug,T=e.api,S=e.errHandler;function b(){c&&I();for(var e=0;e<g.length;e++)A(g[e]);E.trigger(_.TEARDOWN_COMPLETE)}function A(e){try{c[T.cancelKeyRequest](f.systemString,e.sessionId)}catch(t){E.trigger(_.KEY_SESSION_CLOSED,{data:null,error:"Error closing session ("+e.sessionId+") "+t.message})}}function R(e,t){if(t&&e){for(var r=e.length,n=0;n<r;n++)if(e[n].sessionId==t)return e[n];return null}return null}function I(){c.removeEventListener(T.keyerror,m),c.removeEventListener(T.needkey,m),c.removeEventListener(T.keymessage,m),c.removeEventListener(T.keyadded,m)}return t={getAllInitData:function(){for(var e=[],t=0;t<h.length;t++)e.push(h[t].initData);for(var r=0;r<g.length;r++)e.push(g[r].initData);return e},getSessions:function(){return g.concat(h)},requestKeySystemAccess:function(e){return new Promise(function(t,r){var n=c;n||(n=document.createElement("video"));for(var a=!1,i=0;i<e.length;i++)for(var s=e[i].ks.systemString,l=e[i].configs,f=null,h=0;h<l.length;h++){var g=l[h].videoCapabilities;if(g&&0!==g.length){f=[];for(var p=0;p<g.length;p++)""!==n.canPlayType(g[p].contentType,s)&&f.push(g[p])}if(f&&(!f||0!==f.length)){a=!0;var m=new o.default(null,f),y=d.getKeySystemBySystemString(s),v=new u.default(y,m);E.trigger(_.KEY_SYSTEM_ACCESS_COMPLETE,{data:v}),t({data:v});break}}if(!a){var T="Key system access denied! -- No valid audio/video content configurations detected!";E.trigger(_.KEY_SYSTEM_ACCESS_COMPLETE,{error:T}),r({error:T})}})},selectKeySystem:function(e){return f=e.keySystem,Promise.resolve(f)},setMediaElement:function(e){if(c!==e){if(c){I();for(var t=0;t<g.length;t++)A(g[t]);g=[]}(c=e)&&(c.addEventListener(T.keyerror,m),c.addEventListener(T.needkey,m),c.addEventListener(T.keymessage,m),c.addEventListener(T.keyadded,m),E.trigger(_.VIDEO_ELEMENT_SELECTED))}},createKeySession:function(e){if(!f)throw new Error("Can not create sessions until you have selected a key system");if(p||0===g.length){var t={sessionId:null,keyId:e.keyId,initData:e.initData,getKeyId:function(){return this.keyId},getSessionId:function(){return this.sessionId},getExpirationTime:function(){return NaN},getSessionType:function(){return"temporary"}};return h.push(t),c[T.generateKeyRequest](f.systemString,new Uint8Array(e.initData)),t}throw new Error("Multiple sessions not allowed!")},updateKeySession:function(e,t){var r=e.sessionId;if(d.isClearKey(f))for(var n=0;n<t.keyPairs.length;n++)c[T.addKey](f.systemString,t.keyPairs[n].key,t.keyPairs[n].keyID,r);else c[T.addKey](f.systemString,new Uint8Array(t),new Uint8Array(e.initData),r);E.trigger(_.KEY_SESSION_UPDATED)},closeKeySession:A,setServerCertificate:function(){},loadKeySession:function(){},removeKeySession:function(){},stop:b,reset:b},r=v.getLogger(t),c=null,f=null,h=[],g=[],d=Object(n.default)(y).getInstance(),m={handleEvent:function(e){var t=null;switch(e.type){case T.needkey:var n=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;E.trigger(_.NEED_KEY,{key:new a.default(n,"cenc")});break;case T.keyerror:if((t=R(g,e.sessionId))||(t=R(h,e.sessionId)),t){var o=l.default.MEDIA_KEYERR_CODE,u="";switch(e.errorCode.code){case 1:o=l.default.MEDIA_KEYERR_UNKNOWN_CODE,u+="MEDIA_KEYERR_UNKNOWN - "+l.default.MEDIA_KEYERR_UNKNOWN_MESSAGE;break;case 2:o=l.default.MEDIA_KEYERR_CLIENT_CODE,u+="MEDIA_KEYERR_CLIENT - "+l.default.MEDIA_KEYERR_CLIENT_MESSAGE;break;case 3:o=l.default.MEDIA_KEYERR_SERVICE_CODE,u+="MEDIA_KEYERR_SERVICE - "+l.default.MEDIA_KEYERR_SERVICE_MESSAGE;break;case 4:o=l.default.MEDIA_KEYERR_OUTPUT_CODE,u+="MEDIA_KEYERR_OUTPUT - "+l.default.MEDIA_KEYERR_OUTPUT_MESSAGE;break;case 5:o=l.default.MEDIA_KEYERR_HARDWARECHANGE_CODE,u+="MEDIA_KEYERR_HARDWARECHANGE - "+l.default.MEDIA_KEYERR_HARDWARECHANGE_MESSAGE;break;case 6:o=l.default.MEDIA_KEYERR_DOMAIN_CODE,u+="MEDIA_KEYERR_DOMAIN - "+l.default.MEDIA_KEYERR_DOMAIN_MESSAGE}u+=" System Code = "+e.systemCode,E.trigger(_.KEY_ERROR,{error:new i.default(o,u,t)})}else r.error("No session token found for key error");break;case T.keyadded:(t=R(g,e.sessionId))||(t=R(h,e.sessionId)),t?(r.debug("DRM: Key added."),E.trigger(_.KEY_ADDED,{data:t})):r.debug("No session token found for key added");break;case T.keymessage:if((p=null!==e.sessionId&&void 0!==e.sessionId)?!(t=R(g,e.sessionId))&&h.length>0&&(t=h.shift(),g.push(t),t.sessionId=e.sessionId,E.trigger(_.KEY_SESSION_CREATED,{data:t})):h.length>0&&(t=h.shift(),g.push(t),0!==h.length&&S.error(new i.default(l.default.MEDIA_KEY_MESSAGE_ERROR_CODE,l.default.MEDIA_KEY_MESSAGE_ERROR_MESSAGE))),t){var c=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;t.keyMessage=c,E.trigger(_.INTERNAL_KEY_MESSAGE,{data:new s.default(t,c,e.defaultURL)})}else r.warn("No session token found for key message")}}},t}c.__dashjs_factory_name="ProtectionModel_01b",t.default=dashjs.FactoryMaker.getClassFactory(c)},"./src/streaming/protection/models/ProtectionModel_21Jan2015.js":function(e,t,r){r.r(t);var n=r("./src/streaming/protection/controllers/ProtectionKeyController.js"),a=r("./src/streaming/protection/vo/NeedKey.js"),i=r("./src/streaming/protection/errors/ProtectionErrors.js"),s=r("./src/streaming/vo/DashJSError.js"),o=r("./src/streaming/protection/vo/KeyMessage.js"),u=r("./src/streaming/protection/vo/KeySystemAccess.js"),l=r("./src/streaming/constants/ProtectionConstants.js");function c(e){e=e||{};var t,r,c,f,d,h,g,p,m=this.context,y=e.eventBus,E=e.events,_=e.debug;function v(e,t,r,n){if(void 0===navigator.requestMediaKeySystemAccess||"function"!=typeof navigator.requestMediaKeySystemAccess){var a="Insecure origins are not allowed";return y.trigger(E.KEY_SYSTEM_ACCESS_COMPLETE,{error:a}),void n({error:a})}var i=e[t].ks,s=e[t].configs,o=i.systemString;o===l.default.PLAYREADY_KEYSTEM_STRING&&"required"===s[0].persistentState&&(o+=".recommendation"),navigator.requestMediaKeySystemAccess(o,s).then(function(e){var t="function"==typeof e.getConfiguration?e.getConfiguration():null,n=new u.default(i,t);n.mksa=e,y.trigger(E.KEY_SYSTEM_ACCESS_COMPLETE,{data:n}),r({data:n})}).catch(function(a){if(t+1<e.length)v(e,t+1,r,n);else{var i="Key system access denied! ";y.trigger(E.KEY_SYSTEM_ACCESS_COMPLETE,{error:i+a.message}),n({error:i+a.message})}})}function T(e){var t=e.session;return t.removeEventListener("keystatuseschange",e),t.removeEventListener("message",e),t.close()}function S(e){for(var t=0;t<h.length;t++)if(h[t]===e){h.splice(t,1);break}}function b(e){var t,r;return e&&e.length>0&&(e[0]&&("string"==typeof e[0]?t=e[0]:r=e[0]),e[1]&&("string"==typeof e[1]?t=e[1]:r=e[1])),{status:t,keyId:r}}function A(e,t){var n={session:e,keyId:t.keyId,initData:t.initData,sessionId:t.sessionId,sessionType:t.sessionType,handleEvent:function(e){switch(e.type){case"keystatuseschange":y.trigger(E.KEY_STATUSES_CHANGED,{data:this}),e.target.keyStatuses.forEach(function(){var e=b(arguments);"expired"===e.status?y.trigger(E.INTERNAL_KEY_STATUS_CHANGED,{error:new s.default(i.default.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE,i.default.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE)}):y.trigger(E.INTERNAL_KEY_STATUS_CHANGED,e)});break;case"message":var t=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;y.trigger(E.INTERNAL_KEY_MESSAGE,{data:new o.default(this,t,void 0,e.messageType)})}},getKeyId:function(){return this.keyId},getSessionId:function(){return e.sessionId},getSessionType:function(){return this.sessionType},getExpirationTime:function(){return e.expiration},getKeyStatuses:function(){return e.keyStatuses},getUsable:function(){var t=!1;return e.keyStatuses.forEach(function(){"usable"===b(arguments).status&&(t=!0)}),t}};return e.addEventListener("keystatuseschange",n),e.addEventListener("message",n),e.closed.then(function(){S(n),r.debug("DRM: Session closed. SessionID = "+n.getSessionId()),y.trigger(E.KEY_SESSION_CLOSED,{data:n.getSessionId()})}),h.push(n),n}return t={getAllInitData:function(){for(var e=[],t=0;t<h.length;t++)h[t].initData&&e.push(h[t].initData);return e},getSessions:function(){return h},requestKeySystemAccess:function(e){return new Promise(function(t,r){v(e,0,t,r)})},selectKeySystem:function(e){return new Promise(function(t,r){e.mksa.createMediaKeys().then(function(t){return c=e.keySystem,d=t,f?f.setMediaKeys(d):Promise.resolve()}).then(function(){t(c)}).catch(function(){r({error:"Error selecting keys system ("+e.keySystem.systemString+")! Could not create MediaKeys -- TODO"})})})},setMediaElement:function(e){f!==e&&(f&&(f.removeEventListener("encrypted",g),f.setMediaKeys&&f.setMediaKeys(null)),(f=e)&&(f.addEventListener("encrypted",g),f.setMediaKeys&&d&&f.setMediaKeys(d)))},setServerCertificate:function(e){if(!c||!d)throw new Error("Can not set server certificate until you have selected a key system");d.setServerCertificate(e).then(function(){r.info("DRM: License server certificate successfully updated."),y.trigger(E.SERVER_CERTIFICATE_UPDATED)}).catch(function(e){y.trigger(E.SERVER_CERTIFICATE_UPDATED,{error:new s.default(i.default.SERVER_CERTIFICATE_UPDATED_ERROR_CODE,i.default.SERVER_CERTIFICATE_UPDATED_ERROR_MESSAGE+e.name)})})},createKeySession:function(e){if(!c||!d)throw new Error("Can not create sessions until you have selected a key system");var t=d.createSession(e.sessionType),n=A(t,e),a=c.systemString===l.default.CLEARKEY_KEYSTEM_STRING&&(e.initData||e.protData&&e.protData.clearkeys)?l.default.INITIALIZATION_DATA_TYPE_KEYIDS:l.default.INITIALIZATION_DATA_TYPE_CENC;t.generateRequest(a,e.initData).then(function(){r.debug("DRM: Session created. SessionID = "+n.getSessionId()),y.trigger(E.KEY_SESSION_CREATED,{data:n})}).catch(function(e){S(n),y.trigger(E.KEY_SESSION_CREATED,{data:null,error:new s.default(i.default.KEY_SESSION_CREATED_ERROR_CODE,i.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Error generating key request -- "+e.name)})})},updateKeySession:function(e,t){var r=e.session;p.isClearKey(c)&&(t=t.toJWK()),r.update(t).then(function(){y.trigger(E.KEY_SESSION_UPDATED)}).catch(function(t){y.trigger(E.KEY_ERROR,{error:new s.default(i.default.MEDIA_KEYERR_CODE,"Error sending update() message! "+t.name,e)})})},loadKeySession:function(e){if(!c||!d)throw new Error("Can not load sessions until you have selected a key system");for(var t=e.sessionId,n=0;n<h.length;n++)if(t===h[n].sessionId)return void r.warn("DRM: Ignoring session ID because we have already seen it!");var a=d.createSession(e.sessionType),o=A(a,e);a.load(t).then(function(e){e?(r.debug("DRM: Session loaded. SessionID = "+o.getSessionId()),y.trigger(E.KEY_SESSION_CREATED,{data:o})):(S(o),y.trigger(E.KEY_SESSION_CREATED,{data:null,error:new s.default(i.default.KEY_SESSION_CREATED_ERROR_CODE,i.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Could not load session! Invalid Session ID ("+t+")")}))}).catch(function(e){S(o),y.trigger(E.KEY_SESSION_CREATED,{data:null,error:new s.default(i.default.KEY_SESSION_CREATED_ERROR_CODE,i.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Could not load session ("+t+")! "+e.name)})})},removeKeySession:function(e){e.session.remove().then(function(){r.debug("DRM: Session removed. SessionID = "+e.getSessionId()),y.trigger(E.KEY_SESSION_REMOVED,{data:e.getSessionId()})},function(t){y.trigger(E.KEY_SESSION_REMOVED,{data:null,error:"Error removing session ("+e.getSessionId()+"). "+t.name})})},closeKeySession:function(e){T(e).catch(function(t){S(e),y.trigger(E.KEY_SESSION_CLOSED,{data:null,error:"Error closing session ("+e.getSessionId()+") "+t.name})})},stop:function(){for(var e,t=0;t<h.length;t++)(e=h[t]).getUsable()||T(e).catch(function(){S(e)})},reset:function(){var e,t=h.length;0!==t?function(){for(var r=function(e){S(e),0===h.length&&(f?(f.removeEventListener("encrypted",g),f.setMediaKeys(null).then(function(){y.trigger(E.TEARDOWN_COMPLETE)})):y.trigger(E.TEARDOWN_COMPLETE))},n=0;n<t;n++)(function(t){e.session.closed.then(function(){r(t)}),T(e).catch(function(){r(t)})})(e=h[n])}():y.trigger(E.TEARDOWN_COMPLETE)}},r=_.getLogger(t),c=null,f=null,d=null,h=[],p=Object(n.default)(m).getInstance(),g={handleEvent:function(e){if("encrypted"===e.type&&e.initData){var t=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;y.trigger(E.NEED_KEY,{key:new a.default(t,e.initDataType)})}}},t}c.__dashjs_factory_name="ProtectionModel_21Jan2015",t.default=dashjs.FactoryMaker.getClassFactory(c)},"./src/streaming/protection/models/ProtectionModel_3Feb2014.js":function(e,t,r){r.r(t);var n=r("./src/streaming/protection/controllers/ProtectionKeyController.js"),a=r("./src/streaming/protection/vo/NeedKey.js"),i=r("./src/streaming/vo/DashJSError.js"),s=r("./src/streaming/protection/errors/ProtectionErrors.js"),o=r("./src/streaming/protection/vo/KeyMessage.js"),u=r("./src/streaming/protection/vo/KeySystemConfiguration.js"),l=r("./src/streaming/protection/vo/KeySystemAccess.js");function c(e){e=e||{};var t,r,c,f,d,h,g,p,m,y=this.context,E=e.eventBus,_=e.events,v=e.debug,T=e.api;function S(){try{for(var e=0;e<g.length;e++)b(g[e]);c&&c.removeEventListener(T.needkey,p),E.trigger(_.TEARDOWN_COMPLETE)}catch(e){E.trigger(_.TEARDOWN_COMPLETE,{error:"Error tearing down key sessions and MediaKeys! -- "+e.message})}}function b(e){var t=e.session;t.removeEventListener(T.error,e),t.removeEventListener(T.message,e),t.removeEventListener(T.ready,e),t.removeEventListener(T.close,e);for(var r=0;r<g.length;r++)if(g[r]===e){g.splice(r,1);break}t[T.release]()}function A(){var e=null,t=function(){c.removeEventListener("loadedmetadata",e),c[T.setMediaKeys](d),E.trigger(_.VIDEO_ELEMENT_SELECTED)};c.readyState>=1?t():(e=t.bind(this),c.addEventListener("loadedmetadata",e))}return t={getAllInitData:function(){for(var e=[],t=0;t<g.length;t++)e.push(g[t].initData);return e},getSessions:function(){return g},requestKeySystemAccess:function(e){return new Promise(function(t,r){for(var n=!1,a=0;a<e.length;a++)for(var i=e[a].ks.systemString,s=e[a].configs,o=null,c=null,f=0;f<s.length;f++){var d=s[f].audioCapabilities,h=s[f].videoCapabilities;if(d&&0!==d.length){o=[];for(var g=0;g<d.length;g++)window[T.MediaKeys].isTypeSupported(i,d[g].contentType)&&o.push(d[g])}if(h&&0!==h.length){c=[];for(var p=0;p<h.length;p++)window[T.MediaKeys].isTypeSupported(i,h[p].contentType)&&c.push(h[p])}if(!(!o&&!c||o&&0===o.length||c&&0===c.length)){n=!0;var y=new u.default(o,c),v=m.getKeySystemBySystemString(i),S=new l.default(v,y);E.trigger(_.KEY_SYSTEM_ACCESS_COMPLETE,{data:S}),t({data:S});break}}if(!n){var b="Key system access denied! -- No valid audio/video content configurations detected!";E.trigger(_.KEY_SYSTEM_ACCESS_COMPLETE,{error:b}),r({error:b})}})},selectKeySystem:function(e){return new Promise(function(t,r){try{d=e.mediaKeys=new window[T.MediaKeys](e.keySystem.systemString),f=e.keySystem,h=e,c&&A(),t(f)}catch(e){r({error:"Error selecting keys system ("+f.systemString+")! Could not create MediaKeys -- TODO"})}})},setMediaElement:function(e){c!==e&&(c&&c.removeEventListener(T.needkey,p),(c=e)&&(c.addEventListener(T.needkey,p),d&&A()))},createKeySession:function(e){if(!f||!d||!h)throw new Error("Can not create sessions until you have selected a key system");var t=null;if(h.ksConfiguration.videoCapabilities&&h.ksConfiguration.videoCapabilities.length>0&&(t=h.ksConfiguration.videoCapabilities[0]),null===t&&h.ksConfiguration.audioCapabilities&&h.ksConfiguration.audioCapabilities.length>0&&(t=h.ksConfiguration.audioCapabilities[0]),null===t)throw new Error("Can not create sessions for unknown content types.");var n=t.contentType,a=d.createSession(n,new Uint8Array(e.initData),e.cdmData?new Uint8Array(e.cdmData):null),u=function(e,t){return{session:e,keyId:t.keyId,initData:t.initData,getKeyId:function(){return this.keyId},getSessionId:function(){return this.session.sessionId},getExpirationTime:function(){return NaN},getSessionType:function(){return"temporary"},handleEvent:function(e){switch(e.type){case T.error:E.trigger(_.KEY_ERROR,{error:new i.default(s.default.MEDIA_KEYERR_CODE,"KeyError",this)});break;case T.message:var t=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;E.trigger(_.INTERNAL_KEY_MESSAGE,{data:new o.default(this,t,e.destinationURL)});break;case T.ready:r.debug("DRM: Key added."),E.trigger(_.KEY_ADDED);break;case T.close:r.debug("DRM: Session closed. SessionID = "+this.getSessionId()),E.trigger(_.KEY_SESSION_CLOSED,{data:this.getSessionId()})}}}}(a,e);a.addEventListener(T.error,u),a.addEventListener(T.message,u),a.addEventListener(T.ready,u),a.addEventListener(T.close,u),g.push(u),r.debug("DRM: Session created. SessionID = "+u.getSessionId()),E.trigger(_.KEY_SESSION_CREATED,{data:u})},updateKeySession:function(e,t){var r=e.session;m.isClearKey(f)?r.update(new Uint8Array(t.toJWK())):r.update(new Uint8Array(t)),E.trigger(_.KEY_SESSION_UPDATED)},closeKeySession:b,setServerCertificate:function(){},loadKeySession:function(){},removeKeySession:function(){},stop:S,reset:S},r=v.getLogger(t),c=null,f=null,d=null,h=null,g=[],m=Object(n.default)(y).getInstance(),p={handleEvent:function(e){if(e.type===T.needkey&&e.initData){var t=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;E.trigger(_.NEED_KEY,{key:new a.default(t,"cenc")})}}},t}c.__dashjs_factory_name="ProtectionModel_3Feb2014",t.default=dashjs.FactoryMaker.getClassFactory(c)},"./src/streaming/protection/servers/ClearKey.js":function(e,t,r){r.r(t);var n=r("./src/streaming/protection/vo/KeyPair.js"),a=r("./src/streaming/protection/vo/ClearKeyKeySet.js");function i(){return{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"json"},getLicenseMessage:function(e){if(!e.hasOwnProperty("keys"))return null;for(var t=[],r=0;r<e.keys.length;r++){var i=e.keys[r],s=i.kid.replace(/=/g,""),o=i.k.replace(/=/g,"");t.push(new n.default(s,o))}return new a.default(t)},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}}}i.__dashjs_factory_name="ClearKey",t.default=dashjs.FactoryMaker.getSingletonFactory(i)},"./src/streaming/protection/servers/DRMToday.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/ProtectionConstants.js");function a(e){var t=(e=e||{}).BASE64,r={};return r[n.default.WIDEVINE_KEYSTEM_STRING]={responseType:"json",getLicenseMessage:function(e){return t.decodeArray(e.license)},getErrorResponse:function(e){return e}},r[n.default.PLAYREADY_KEYSTEM_STRING]={responseType:"arraybuffer",getLicenseMessage:function(e){return e},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}},{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(e){return r[e].responseType},getLicenseMessage:function(e,n){return function(){if(!t||!t.hasOwnProperty("decodeArray"))throw new Error("Missing config parameter(s)")}(),r[n].getLicenseMessage(e)},getErrorResponse:function(e,t){return r[t].getErrorResponse(e)}}}a.__dashjs_factory_name="DRMToday",t.default=dashjs.FactoryMaker.getSingletonFactory(a)},"./src/streaming/protection/servers/PlayReady.js":function(e,t,r){function n(){var e="http://schemas.xmlsoap.org/soap/envelope/";function t(e){var t=String.fromCharCode.apply(null,new Uint8Array(e));return decodeURIComponent(escape(t))}function r(r){if(window.DOMParser){var n=t(r),a=(new window.DOMParser).parseFromString(n,"text/xml"),i=a?a.getElementsByTagNameNS(e,"Envelope")[0]:null,s=i?i.getElementsByTagNameNS(e,"Body")[0]:null;if(s&&s.getElementsByTagNameNS(e,"Fault")[0])return null}return r}function n(r){var n="",a="",i="",s=-1,o=-1;if(window.DOMParser){var u=t(r),l=(new window.DOMParser).parseFromString(u,"text/xml"),c=l?l.getElementsByTagNameNS(e,"Envelope")[0]:null,f=c?c.getElementsByTagNameNS(e,"Body")[0]:null,d=f?f.getElementsByTagNameNS(e,"Fault")[0]:null,h=d?d.getElementsByTagName("detail")[0]:null,g=h?h.getElementsByTagName("Exception")[0]:null,p=null;if(null===d)return u;n=(p=d.getElementsByTagName("faultstring")[0].firstChild)?p.nodeValue:null,null!==g&&(a=(p=g.getElementsByTagName("StatusCode")[0])?p.firstChild.nodeValue:null,s=(i=(p=g.getElementsByTagName("Message")[0])?p.firstChild.nodeValue:null)?i.lastIndexOf("[")+1:-1,o=i?i.indexOf("]"):-1,i=i?i.substring(s,o):"")}var m="code: ".concat(a,", name: ").concat(n);return i&&(m+=", message: ".concat(i)),m}return{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"arraybuffer"},getLicenseMessage:function(e){return r.call(this,e)},getErrorResponse:function(e){return n.call(this,e)}}}r.r(t),n.__dashjs_factory_name="PlayReady",t.default=dashjs.FactoryMaker.getSingletonFactory(n)},"./src/streaming/protection/servers/Widevine.js":function(e,t,r){function n(){return{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"arraybuffer"},getLicenseMessage:function(e){return e},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}}}r.r(t),n.__dashjs_factory_name="Widevine",t.default=dashjs.FactoryMaker.getSingletonFactory(n)},"./src/streaming/protection/vo/ClearKeyKeySet.js":function(e,t,r){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}r.r(t);var a=function(){function e(t,r){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r&&"persistent"!==r&&"temporary"!==r)throw new Error("Invalid ClearKey key set type! Must be one of 'persistent' or 'temporary'");this.keyPairs=t,this.type=r}var t,r;return t=e,(r=[{key:"toJWK",value:function(){var e,t=this.keyPairs.length,r={keys:[]};for(e=0;e<t;e++){var n={kty:"oct",alg:"A128KW",kid:this.keyPairs[e].keyID,k:this.keyPairs[e].key};r.keys.push(n)}this.type&&(r.type=this.type);var a=JSON.stringify(r),i=a.length,s=new ArrayBuffer(i),o=new Uint8Array(s);for(e=0;e<i;e++)o[e]=a.charCodeAt(e);return s}}])&&n(t.prototype,r),e}();t.default=a},"./src/streaming/protection/vo/KeyMessage.js":function(e,t,r){r.r(t),t.default=function e(t,r,n,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.sessionToken=t,this.message=r,this.defaultURL=n,this.messageType=a||"license-request"}},"./src/streaming/protection/vo/KeyPair.js":function(e,t,r){r.r(t),t.default=function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.keyID=t,this.key=r}},"./src/streaming/protection/vo/KeySystemAccess.js":function(e,t,r){r.r(t),t.default=function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.keySystem=t,this.ksConfiguration=r}},"./src/streaming/protection/vo/KeySystemConfiguration.js":function(e,t,r){r.r(t),t.default=function e(t,r,n,a,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.initDataTypes=["cenc"],t&&t.length&&(this.audioCapabilities=t),r&&r.length&&(this.videoCapabilities=r),this.distinctiveIdentifier=n,this.persistentState=a,this.sessionTypes=i}},"./src/streaming/protection/vo/LicenseRequest.js":function(e,t,r){r.r(t),t.default=function e(t,r,n,a,i,s,o,u){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t,this.method=r,this.responseType=n,this.headers=a,this.withCredentials=i,this.messageType=s,this.sessionId=o,this.data=u}},"./src/streaming/protection/vo/LicenseResponse.js":function(e,t,r){r.r(t),t.default=function e(t,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t,this.headers=r,this.data=n}},"./src/streaming/protection/vo/MediaCapability.js":function(e,t,r){r.r(t),t.default=function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.contentType=t,this.robustness=r}},"./src/streaming/protection/vo/NeedKey.js":function(e,t,r){r.r(t),t.default=function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.initData=t,this.initDataType=r}},"./src/streaming/rules/DroppedFramesHistory.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js");function a(){var e={},t={},r={};return{push:function(n,a,i){if(a){e[n]||(e[n]=[],t[n]=0,r[n]=0);var s=i&&i.droppedVideoFrames?i.droppedVideoFrames:0,o=i&&i.totalVideoFrames?i.totalVideoFrames:0,u=s-t;t[n]=s;var l=o-r;r[n]=o;var c=e[n];isNaN(a)||(c[a]?(c[a].droppedVideoFrames+=u,c[a].totalVideoFrames+=l):c[a]={droppedVideoFrames:u,totalVideoFrames:l})}},getFrameHistory:function(t){return e[t]},clearForStream:function(n){try{delete e[n],delete t[n],delete r[n]}catch(e){}},reset:function(){e={},t={},r={}}}}a.__dashjs_factory_name="DroppedFramesHistory";var i=n.default.getClassFactory(a);t.default=i},"./src/streaming/rules/RulesContext.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js");function a(e){var t=(e=e||{}).abrController,r=e.switchHistory,n=e.droppedFramesHistory,a=e.currentRequest,i=e.useBufferOccupancyABR,s=e.useL2AABR,o=e.useLoLPABR,u=e.streamProcessor?e.streamProcessor.getScheduleController():null,l=e.streamProcessor?e.streamProcessor.getRepresentationInfo():null,c=e.videoModel?e.videoModel:null;function f(){return l?l.mediaInfo:null}return{getMediaType:function(){var e=f();return e?e.type:null},getMediaInfo:f,getDroppedFramesHistory:function(){return n},getCurrentRequest:function(){return a},getSwitchHistory:function(){return r},getStreamInfo:function(){var e=f();return e?e.streamInfo:null},getScheduleController:function(){return u},getAbrController:function(){return t},getRepresentationInfo:function(){return l},useBufferOccupancyABR:function(){return i},useL2AABR:function(){return s},useLoLPABR:function(){return o},getVideoModel:function(){return c}}}a.__dashjs_factory_name="RulesContext",t.default=n.default.getClassFactory(a)},"./src/streaming/rules/SwitchRequest.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a={DEFAULT:.5,STRONG:1,WEAK:0};function i(e,t,r){var n,i;return n=void 0===e?-1:e,i=function(e){var t=a.DEFAULT;return e!==a.DEFAULT&&e!==a.STRONG&&e!==a.WEAK||(t=e),t}(r),{quality:n,reason:void 0===t?null:t,priority:i}}i.__dashjs_factory_name="SwitchRequest";var s=n.default.getClassFactory(i);s.NO_CHANGE=-1,s.PRIORITY=a,n.default.updateClassFactory(i.__dashjs_factory_name,s),t.default=s},"./src/streaming/rules/SwitchRequestHistory.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/streaming/rules/SwitchRequest.js");function i(){var e=[],t=[];return{push:function(r){r.newValue===a.default.NO_CHANGE&&(r.newValue=r.oldValue),e[r.oldValue]||(e[r.oldValue]={noDrops:0,drops:0,dropSize:0});var n=r.newValue-r.oldValue,i=n<0?1:0,s=i?-n:0,o=i?0:1;if(e[r.oldValue].drops+=i,e[r.oldValue].dropSize+=s,e[r.oldValue].noDrops+=o,t.push({idx:r.oldValue,noDrop:o,drop:i,dropSize:s}),t.length>8){var u=t.shift();e[u.idx].drops-=u.drop,e[u.idx].dropSize-=u.dropSize,e[u.idx].noDrops-=u.noDrop}},getSwitchRequests:function(){return e},reset:function(){e=[],t=[]}}}i.__dashjs_factory_name="SwitchRequestHistory";var s=n.default.getClassFactory(i);t.default=s},"./src/streaming/rules/ThroughputHistory.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/Constants.js"),a=r("./src/core/FactoryMaker.js");function i(e){var t,r,a,i,s,o=(e=e||{}).settings;function u(e,t,r,n){var a=Math.pow(.5,r/n.fast);e.fastEstimate=(1-a)*t+a*e.fastEstimate;var i=Math.pow(.5,r/n.slow);e.slowEstimate=(1-i)*t+i*e.slowEstimate,e.totalWeight+=r}function l(e,u,l){return o.get().streaming.abr.movingAverageMethod!==n.default.MOVING_AVERAGE_SLIDING_WINDOW?function(e,t){var r=e?s.throughputHalfLife:s.latencyHalfLife,n=e?a[t]:i[t];if(!n||n.totalWeight<=0)return NaN;var o=n.fastEstimate/(1-Math.pow(.5,n.totalWeight/r.fast)),u=n.slowEstimate/(1-Math.pow(.5,n.totalWeight/r.slow));return e?Math.min(o,u):Math.max(o,u)}(e,u):function(e,n,a){var i=function(e,n,a){var i,s;if(e?(i=t[n],s=a?3:4):(i=r[n],s=4),i){if(s>=i.length)s=i.length;else if(e)for(var o=1;o<s;++o){var u=i[i.length-o]/i[i.length-o-1];if((u>=1.3||u<=1/1.3)&&(s+=1)===i.length)break}}else s=0;return s}(e,n,a),s=(e?t:r)[n];return 0!==i&&s&&0!==s.length?(s=s.slice(-i)).reduce(function(e,t){return e+t})/s.length:NaN}(e,u,l)}function c(e,t){return l(!0,e,t)}function f(e){t[e]=t[e]||[],r[e]=r[e]||[],a[e]=a[e]||{fastEstimate:0,slowEstimate:0,totalWeight:0},i[e]=i[e]||{fastEstimate:0,slowEstimate:0,totalWeight:0}}function d(){t={},r={},a={},i={}}var h={push:function(e,l,c){if(l.trace&&l.trace.length){var d=l.tresponse.getTime()-l.trequest.getTime()||1,h=l._tfinish.getTime()-l.tresponse.getTime()||1,g=l.trace.reduce(function(e,t){return e+t.b[0]},0),p=0,m=0;if(o.get().streaming.lowLatencyEnabled){if(o.get().streaming.abr.fetchThroughputCalculationMode===n.default.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING){var y=l.trace.reduce(function(e,t){return e+t.t},0);m=Math.round(y/l.trace.length)}0===m&&(p=l.trace.reduce(function(e,t){return e+t.d},0))}else p=c?h:d+h;if(0!==p&&(m=Math.round(8*g/p)),f(e),function(e,t,r){return e===n.default.VIDEO?r<o.get().streaming.cacheLoadThresholds[n.default.VIDEO]:e===n.default.AUDIO?r<o.get().streaming.cacheLoadThresholds[n.default.AUDIO]:void 0}(e,0,h)){if(t[e].length>0&&!t[e].hasCachedEntries)return;t[e].hasCachedEntries=!0}else t[e]&&t[e].hasCachedEntries&&function(e){delete t[e],delete r[e],delete a[e],delete i[e],f(e)}(e);t[e].push(m),t[e].length>20&&t[e].shift(),r[e].push(d),r[e].length>20&&r[e].shift(),u(a[e],m,.001*h,s.throughputHalfLife),u(i[e],d,1,s.latencyHalfLife)}},getAverageThroughput:c,getSafeAverageThroughput:function(e,t){var r=c(e,t);return isNaN(r)||(r*=o.get().streaming.abr.bandwidthSafetyFactor),r},getAverageLatency:function(e){return l(!1,e)},reset:d};return s={throughputHalfLife:{fast:3,slow:8},latencyHalfLife:{fast:1,slow:2}},d(),h}i.__dashjs_factory_name="ThroughputHistory",t.default=a.default.getClassFactory(i)},"./src/streaming/rules/abr/ABRRulesCollection.js":function(e,t,r){r.r(t);var n=r("./src/streaming/rules/abr/ThroughputRule.js"),a=r("./src/streaming/rules/abr/InsufficientBufferRule.js"),i=r("./src/streaming/rules/abr/AbandonRequestsRule.js"),s=r("./src/streaming/rules/abr/DroppedFramesRule.js"),o=r("./src/streaming/rules/abr/SwitchHistoryRule.js"),u=r("./src/streaming/rules/abr/BolaRule.js"),l=r("./src/streaming/rules/abr/L2ARule.js"),c=r("./src/streaming/rules/abr/lolp/LoLpRule.js"),f=r("./src/core/FactoryMaker.js"),d=r("./src/streaming/rules/SwitchRequest.js"),h=r("./src/streaming/constants/Constants.js"),g="qualitySwitchRules",p="abandonFragmentRules";function m(e){e=e||{};var t,r,f=this.context,m=e.mediaPlayerModel,y=e.dashMetrics,E=e.settings;function _(e){return e.filter(function(e){return e.quality>d.default.NO_CHANGE})}function v(e){var t,r,n,a,i,s={},o=null;if(0!==e.length){for(s[d.default.PRIORITY.STRONG]={quality:d.default.NO_CHANGE,reason:null},s[d.default.PRIORITY.WEAK]={quality:d.default.NO_CHANGE,reason:null},s[d.default.PRIORITY.DEFAULT]={quality:d.default.NO_CHANGE,reason:null},t=0,r=e.length;t<r;t+=1)(n=e[t]).quality!==d.default.NO_CHANGE&&(s[n.priority].quality===d.default.NO_CHANGE||s[n.priority].quality>n.quality)&&(s[n.priority].quality=n.quality,s[n.priority].reason=n.reason||null);return s[d.default.PRIORITY.WEAK].quality!==d.default.NO_CHANGE&&(o=s[d.default.PRIORITY.WEAK]),s[d.default.PRIORITY.DEFAULT].quality!==d.default.NO_CHANGE&&(o=s[d.default.PRIORITY.DEFAULT]),s[d.default.PRIORITY.STRONG].quality!==d.default.NO_CHANGE&&(o=s[d.default.PRIORITY.STRONG]),o&&(a=o.quality,i=o.reason),Object(d.default)(f).create(a,i)}}return{initialize:function(){t=[],r=[],E.get().streaming.abr.useDefaultABRRules&&(E.get().streaming.abr.ABRStrategy===h.default.ABR_STRATEGY_L2A?t.push(Object(l.default)(f).create({dashMetrics:y,mediaPlayerModel:m,settings:E})):E.get().streaming.abr.ABRStrategy===h.default.ABR_STRATEGY_LoLP?t.push(Object(c.default)(f).create({dashMetrics:y})):(t.push(Object(u.default)(f).create({dashMetrics:y,mediaPlayerModel:m,settings:E})),t.push(Object(n.default)(f).create({dashMetrics:y})),E.get().streaming.abr.additionalAbrRules.insufficientBufferRule&&t.push(Object(a.default)(f).create({dashMetrics:y,settings:E})),E.get().streaming.abr.additionalAbrRules.switchHistoryRule&&t.push(Object(o.default)(f).create()),E.get().streaming.abr.additionalAbrRules.droppedFramesRule&&t.push(Object(s.default)(f).create()),E.get().streaming.abr.additionalAbrRules.abandonRequestsRule&&r.push(Object(i.default)(f).create({dashMetrics:y,mediaPlayerModel:m,settings:E})))),m.getABRCustomRules().forEach(function(e){e.type===g&&t.push(e.rule(f).create()),e.type===p&&r.push(e.rule(f).create())})},reset:function(){[t,r].forEach(function(e){e&&e.length&&e.forEach(function(e){return e.reset&&e.reset()})}),t=[],r=[]},getMaxQuality:function(e){return v(_(t.map(function(t){return t.getMaxIndex(e)})))||Object(d.default)(f).create()},getMinSwitchRequest:v,shouldAbandonFragment:function(e,t){return v(_(r.map(function(r){return r.shouldAbandon(e,t)})))||Object(d.default)(f).create()},getQualitySwitchRules:function(){return t}}}m.__dashjs_factory_name="ABRRulesCollection";var y=f.default.getClassFactory(m);y.QUALITY_SWITCH_RULES=g,y.ABANDON_FRAGMENT_RULES=p,f.default.updateSingletonFactory(m.__dashjs_factory_name,y),t.default=y},"./src/streaming/rules/abr/AbandonRequestsRule.js":function(e,t,r){r.r(t);var n=r("./src/streaming/rules/SwitchRequest.js"),a=r("./src/core/FactoryMaker.js"),i=r("./src/core/Debug.js");function s(e){e=e||{};var t,r,a,o,u,l=this.context,c=e.mediaPlayerModel,f=e.dashMetrics,d=e.settings;function h(){a={},o={},u=[]}return t={shouldAbandon:function(e){var t=Object(n.default)(l).create(n.default.NO_CHANGE,{name:s.__dashjs_factory_name});if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getCurrentRequest")&&e.hasOwnProperty("getRepresentationInfo")&&e.hasOwnProperty("getAbrController")))return t;var i,h,g=e.getMediaInfo(),p=e.getMediaType(),m=e.getStreamInfo(),y=m?m.id:null,E=e.getCurrentRequest();if(!isNaN(E.index)){i=p,h=E.index,a[i]=a[i]||{},a[i][h]=a[i][h]||{};var _=c.getStableBufferTime();if(f.getCurrentBufferLevel(p)>_)return t;var v=a[p][E.index];if(null===v||null===E.firstByteDate||o.hasOwnProperty(v.id))return t;if(void 0===v.firstByteTime&&(u[p]=[],v.firstByteTime=E.firstByteDate.getTime(),v.segmentDuration=E.duration,v.bytesTotal=E.bytesTotal,v.id=E.index),v.bytesLoaded=E.bytesLoaded,v.elapsedTime=(new Date).getTime()-v.firstByteTime,v.bytesLoaded>0&&v.elapsedTime>0&&function(e,t){u[e]=u[e]||[],u[e].push(t)}(p,Math.round(8*v.bytesLoaded/v.elapsedTime)),u[p].length>=5&&v.elapsedTime>500&&v.bytesLoaded<v.bytesTotal){var T=u[p].reduce(function(e,t){return e+t},0);if(v.measuredBandwidthInKbps=Math.round(T/u[p].length),v.estimatedTimeOfDownload=+(8*v.bytesTotal/v.measuredBandwidthInKbps/1e3).toFixed(2),v.estimatedTimeOfDownload<1.8*v.segmentDuration||0===e.getRepresentationInfo().quality)return t;if(!o.hasOwnProperty(v.id)){var S=e.getAbrController(),b=v.bytesTotal-v.bytesLoaded,A=S.getBitrateList(g),R=S.getQualityForBitrate(g,v.measuredBandwidthInKbps*d.get().streaming.abr.bandwidthSafetyFactor,y),I=S.getMinAllowedIndexFor(p,y),C=void 0!==I?Math.max(I,R):R;b>v.bytesTotal*A[C].bitrate/A[S.getQualityFor(p,y)].bitrate&&(t.quality=C,t.reason.throughput=v.measuredBandwidthInKbps,t.reason.fragmentID=v.id,o[v.id]=v,r.debug("["+p+"] frag id",v.id," is asking to abandon and switch to quality to ",C," measured bandwidth was",v.measuredBandwidthInKbps),delete a[p][v.id])}}else v.bytesLoaded===v.bytesTotal&&delete a[p][v.id]}return t},reset:h},r=Object(i.default)(l).getInstance().getLogger(t),h(),t}s.__dashjs_factory_name="AbandonRequestsRule",t.default=a.default.getClassFactory(s)},"./src/streaming/rules/abr/BolaRule.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/MetricsConstants.js"),a=r("./src/streaming/rules/SwitchRequest.js"),i=r("./src/core/FactoryMaker.js"),s=r("./src/streaming/vo/metrics/HTTPRequest.js"),o=r("./src/core/EventBus.js"),u=r("./src/core/events/Events.js"),l=r("./src/core/Debug.js"),c=r("./src/streaming/MediaPlayerEvents.js"),f=10;function d(e){e=e||{};var t,r,i,d=this.context,h=e.dashMetrics,g=e.mediaPlayerModel,p=Object(o.default)(d).getInstance();function m(e,t,r){var n=r.reduce(function(e,t,n){return t>r[e]?n:e},0);if(0===n)return null;var a=Math.max(e,f+2*t.length),i=(r[n]-1)/(a/f-1);return{gp:i,Vp:f/i}}function y(e){e.placeholderBuffer=0,e.mostAdvancedSegmentStart=NaN,e.lastSegmentWasReplacement=!1,e.lastSegmentStart=NaN,e.lastSegmentDurationS=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN}function E(e,t){var r=g.getStableBufferTime();if(e.stableBufferTime!==r){var n=m(r,e.bitrates,e.utilities);if(n.Vp!==e.Vp||n.gp!==e.gp){var a=h.getCurrentBufferLevel(t),i=a+e.placeholderBuffer;i-=f,i*=n.Vp/e.Vp,i+=f,e.stableBufferTime=r,e.Vp=n.Vp,e.gp=n.gp,e.placeholderBuffer=Math.max(0,i-a)}}}function _(e,t){return e.Vp*(e.utilities[t]+e.gp)}function v(e,t){for(var r=e.bitrates[t],n=e.utilities[t],a=0,i=t-1;i>=0;--i)if(e.utilities[i]<e.utilities[t]){var s=e.bitrates[i],o=e.utilities[i],u=e.Vp*(e.gp+(r*o-s*n)/(r-s));a=Math.max(a,u)}return a}function T(){for(var e in i)i.hasOwnProperty(e)&&2===i[e].state&&(i[e].placeholderBuffer=0)}function S(){for(var e in i)if(i.hasOwnProperty(e)){var t=i[e];0!==t.state&&(t.state=1,y(t))}}function b(e){if(e&&e.chunk&&e.chunk.mediaInfo){var t=i[e.chunk.mediaInfo.type];if(t&&0!==t.state){var r=e.chunk.start;isNaN(t.mostAdvancedSegmentStart)||r>t.mostAdvancedSegmentStart?(t.mostAdvancedSegmentStart=r,t.lastSegmentWasReplacement=!1):t.lastSegmentWasReplacement=!0,t.lastSegmentStart=r,t.lastSegmentDurationS=e.chunk.duration,t.lastQuality=e.chunk.quality,R(t,e.chunk.mediaInfo.type)}}}function A(e){if(e&&e.metric===n.default.HTTP_REQUEST&&e.value&&e.value.type===s.HTTPRequest.MEDIA_SEGMENT_TYPE&&e.value.trace&&e.value.trace.length){var t=i[e.mediaType];t&&0!==t.state&&(t.lastSegmentRequestTimeMs=e.value.trequest.getTime(),t.lastSegmentFinishTimeMs=e.value._tfinish.getTime(),R(t,e.mediaType))}}function R(e,t){if(!isNaN(e.lastSegmentStart)&&!isNaN(e.lastSegmentRequestTimeMs)&&!isNaN(e.placeholderBuffer)){if(e.placeholderBuffer*=.99,!isNaN(e.lastSegmentFinishTimeMs)){var r=h.getCurrentBufferLevel(t)+.001*(e.lastSegmentFinishTimeMs-e.lastSegmentRequestTimeMs),n=_(e,e.lastQuality),a=Math.max(0,n-r);e.placeholderBuffer=Math.min(a,e.placeholderBuffer)}e.lastSegmentWasReplacement&&!isNaN(e.lastSegmentDurationS)&&(e.placeholderBuffer+=e.lastSegmentDurationS),e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN}}function I(e){if(e){var t=i[e.mediaType];t&&0!==t.state&&(t.abrQuality=e.newQuality)}}function C(e){if(e){var t=i[e.mediaType];if(t&&0!==t.state){var r,n=h.getCurrentBufferLevel(e.mediaType);r=t.abrQuality>0?v(t,t.abrQuality):f;var a=Math.max(0,r-n);t.placeholderBuffer=Math.min(t.placeholderBuffer,a)}}}function w(){i={}}return t={getMaxIndex:function(e){var t=Object(a.default)(d).create();if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getScheduleController")&&e.hasOwnProperty("getStreamInfo")&&e.hasOwnProperty("getAbrController")&&e.hasOwnProperty("useBufferOccupancyABR")))return t;var n=e.getMediaInfo(),s=e.getMediaType(),o=e.getScheduleController(),u=e.getStreamInfo(),l=e.getAbrController(),c=l.getThroughputHistory(),f=u?u.id:null,p=u&&u.manifestInfo&&u.manifestInfo.isDynamic,T=e.useBufferOccupancyABR();if(t.reason=t.reason||{},!T)return t;o.setTimeToLoadDelay(0);var S=function(e){var t=e.getMediaType(),r=i[t];return r?0!==r.state&&E(r,t):(r=function(e){var t={},r=e.getMediaInfo().bitrateList.map(function(e){return e.bandwidth}),n=function(e){return e.map(function(e){return Math.log(e)})}(r);n=n.map(function(e){return e-n[0]+1});var a=g.getStableBufferTime(),i=m(a,r,n);return i?(t.state=1,t.bitrates=r,t.utilities=n,t.stableBufferTime=a,t.Vp=i.Vp,t.gp=i.gp,t.lastQuality=0,y(t)):t.state=0,t}(e),i[t]=r),r}(e);if(0===S.state)return t;var b,A=h.getCurrentBufferLevel(s),R=c.getAverageThroughput(s,p),I=c.getSafeAverageThroughput(s,p),C=c.getAverageLatency(s);if(t.reason.state=S.state,t.reason.throughput=R,t.reason.latency=C,isNaN(R))return t;switch(S.state){case 1:b=l.getQualityForBitrate(n,I,f,C),t.quality=b,t.reason.throughput=I,S.placeholderBuffer=Math.max(0,v(S,b)-A),S.lastQuality=b,!isNaN(S.lastSegmentDurationS)&&A>=S.lastSegmentDurationS&&(S.state=2);break;case 2:!function(e,t){var r=Date.now();if(isNaN(e.lastSegmentFinishTimeMs)){if(!isNaN(e.lastCallTimeMs)){var n=.001*(r-e.lastCallTimeMs);e.placeholderBuffer+=Math.max(0,n)}}else{var a=.001*(r-e.lastSegmentFinishTimeMs);e.placeholderBuffer+=Math.max(0,a)}e.lastCallTimeMs=r,e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN,E(e,t)}(S,s),b=function(e,t){for(var r=e.bitrates.length,n=NaN,a=NaN,i=0;i<r;++i){var s=(e.Vp*(e.utilities[i]+e.gp)-t)/e.bitrates[i];(isNaN(a)||s>=a)&&(a=s,n=i)}return n}(S,A+S.placeholderBuffer);var w=l.getQualityForBitrate(n,I,f,C);b>S.lastQuality&&b>w&&(b=Math.max(w,S.lastQuality));var N=Math.max(0,A+S.placeholderBuffer-_(S,b));N<=S.placeholderBuffer?(S.placeholderBuffer-=N,N=0):(N-=S.placeholderBuffer,S.placeholderBuffer=0,b<l.getMaxAllowedIndexFor(s,f)?o.setTimeToLoadDelay(1e3*N):N=0),t.quality=b,t.reason.throughput=R,t.reason.latency=C,t.reason.bufferLevel=A,t.reason.placeholderBuffer=S.placeholderBuffer,t.reason.delay=N,S.lastQuality=b;break;default:r.debug("BOLA ABR rule invoked in bad state."),t.quality=l.getQualityForBitrate(n,I,f,C),t.reason.state=S.state,t.reason.throughput=I,t.reason.latency=C,S.state=1,y(S)}return t},reset:function(){w(),p.off(c.default.BUFFER_EMPTY,T,t),p.off(c.default.PLAYBACK_SEEKING,S,t),p.off(c.default.METRIC_ADDED,A,t),p.off(c.default.QUALITY_CHANGE_REQUESTED,I,t),p.off(c.default.FRAGMENT_LOADING_ABANDONED,C,t),p.off(u.default.MEDIA_FRAGMENT_LOADED,b,t)}},r=Object(l.default)(d).getInstance().getLogger(t),w(),p.on(c.default.BUFFER_EMPTY,T,t),p.on(c.default.PLAYBACK_SEEKING,S,t),p.on(c.default.METRIC_ADDED,A,t),p.on(c.default.QUALITY_CHANGE_REQUESTED,I,t),p.on(c.default.FRAGMENT_LOADING_ABANDONED,C,t),p.on(u.default.MEDIA_FRAGMENT_LOADED,b,t),t}d.__dashjs_factory_name="BolaRule",t.default=i.default.getClassFactory(d)},"./src/streaming/rules/abr/DroppedFramesRule.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/streaming/rules/SwitchRequest.js"),i=r("./src/core/Debug.js");function s(){var e,t,r=this.context;return e={getMaxIndex:function(e){var n=Object(a.default)(r).create();if(!e||!e.hasOwnProperty("getDroppedFramesHistory"))return n;var i=e.getDroppedFramesHistory(),s=e.getStreamInfo().id;if(i){var o=i.getFrameHistory(s);if(!o||0===o.length)return n;for(var u=0,l=0,c=a.default.NO_CHANGE,f=1;f<o.length;f++)if(o[f]&&(u=o[f].droppedVideoFrames,(l=o[f].totalVideoFrames)>375&&u/l>.15)){c=f-1,t.debug("index: "+c+" Dropped Frames: "+u+" Total Frames: "+l);break}return Object(a.default)(r).create(c,{droppedFrames:u})}return n}},t=Object(i.default)(r).getInstance().getLogger(e),e}s.__dashjs_factory_name="DroppedFramesRule",t.default=n.default.getClassFactory(s)},"./src/streaming/rules/abr/InsufficientBufferRule.js":function(e,t,r){r.r(t);var n=r("./src/core/EventBus.js"),a=r("./src/core/events/Events.js"),i=r("./src/core/FactoryMaker.js"),s=r("./src/core/Debug.js"),o=r("./src/streaming/rules/SwitchRequest.js"),u=r("./src/streaming/constants/Constants.js"),l=r("./src/streaming/constants/MetricsConstants.js"),c=r("./src/streaming/MediaPlayerEvents.js");function f(e){e=e||{};var t,r,i,f=this.context,d=Object(n.default)(f).getInstance(),h=e.dashMetrics,g=e.settings;function p(){(i={})[u.default.VIDEO]={ignoreCount:2},i[u.default.AUDIO]={ignoreCount:2}}function m(){p()}function y(e){isNaN(e.startTime)||e.mediaType!==u.default.AUDIO&&e.mediaType!==u.default.VIDEO||i[e.mediaType].ignoreCount>0&&i[e.mediaType].ignoreCount--}return t={getMaxIndex:function(e){var t=Object(o.default)(f).create();if(!e||!e.hasOwnProperty("getMediaType"))return t;!function(){if(!h||!h.hasOwnProperty("getCurrentBufferLevel")||!h.hasOwnProperty("getCurrentBufferState"))throw new Error(u.default.MISSING_CONFIG_ERROR)}();var n=e.getMediaType(),a=h.getCurrentBufferState(n),s=e.getRepresentationInfo().fragmentDuration,c=e.getStreamInfo(),d=c?c.id:null,p=c&&c.manifestInfo&&c.manifestInfo.isDynamic;if(function(e){return!g.get().streaming.lowLatencyEnabled&&i[e].ignoreCount>0}(n)||!s)return t;if(a&&a.state===l.default.BUFFER_EMPTY)r.debug("["+n+"] Switch to index 0; buffer is empty."),t.quality=0,t.reason="InsufficientBufferRule: Buffer is empty";else{var m=e.getMediaInfo(),y=e.getAbrController(),E=y.getThroughputHistory(),_=h.getCurrentBufferLevel(n),v=E.getAverageThroughput(n,p),T=E.getAverageLatency(n),S=v*(_/s)*.5;t.quality=y.getQualityForBitrate(m,S,d,T),t.reason="InsufficientBufferRule: being conservative to avoid immediate rebuffering"}return t},reset:function(){p(),d.off(c.default.PLAYBACK_SEEKING,m,t),d.off(a.default.BYTES_APPENDED_END_FRAGMENT,y,t)}},r=Object(s.default)(f).getInstance().getLogger(t),p(),d.on(c.default.PLAYBACK_SEEKING,m,t),d.on(a.default.BYTES_APPENDED_END_FRAGMENT,y,t),t}f.__dashjs_factory_name="InsufficientBufferRule",t.default=i.default.getClassFactory(f)},"./src/streaming/rules/abr/L2ARule.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/MetricsConstants.js"),a=r("./src/streaming/rules/SwitchRequest.js"),i=r("./src/core/FactoryMaker.js"),s=r("./src/streaming/vo/metrics/HTTPRequest.js"),o=r("./src/core/EventBus.js"),u=r("./src/core/events/Events.js"),l=r("./src/core/Debug.js"),c=r("./src/streaming/constants/Constants.js");function f(e){e=e||{};var t,r,i,f,d=this.context,h=e.dashMetrics,g=Object(o.default)(d).getInstance();function p(e){e.placeholderBuffer=0,e.mostAdvancedSegmentStart=NaN,e.lastSegmentWasReplacement=!1,e.lastSegmentStart=NaN,e.lastSegmentDurationS=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN}function m(){for(var e in r)if(r.hasOwnProperty(e)){var t=r[e];0!==t.state&&(t.state=1,p(t))}}function y(e){if(e&&e.chunk&&e.chunk.mediaInfo){var t=r[e.chunk.mediaInfo.type],n=i[e.chunk.mediaInfo.type];if(t&&0!==t.state){var a=e.chunk.start;isNaN(t.mostAdvancedSegmentStart)||a>t.mostAdvancedSegmentStart?(t.mostAdvancedSegmentStart=a,t.lastSegmentWasReplacement=!1):t.lastSegmentWasReplacement=!0,t.lastSegmentStart=a,t.lastSegmentDurationS=e.chunk.duration,t.lastQuality=e.chunk.quality,_(t,n)}}}function E(e){if(e&&e.metric===n.default.HTTP_REQUEST&&e.value&&e.value.type===s.HTTPRequest.MEDIA_SEGMENT_TYPE&&e.value.trace&&e.value.trace.length){var t=r[e.mediaType],a=i[e.mediaType];t&&0!==t.state&&(t.lastSegmentRequestTimeMs=e.value.trequest.getTime(),t.lastSegmentFinishTimeMs=e.value._tfinish.getTime(),_(t,a))}}function _(e,t){isNaN(e.lastSegmentStart)||isNaN(e.lastSegmentRequestTimeMs)||(t.segment_request_start_s=.001*e.lastSegmentRequestTimeMs,t.segment_download_finish_s=.001*e.lastSegmentFinishTimeMs,e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN)}function v(e){if(e&&e.mediaType){var t=r[e.mediaType];t&&0!==t.state&&(t.abrQuality=e.newQuality)}}function T(e,t){if(e.length!==t.length)return-1;for(var r=0,n=0;n<e.length;n++)r+=e[n]*t[n];return r}function S(){r={},i={}}return t={getMaxIndex:function(e){var t,n=Object(a.default)(d).create(),s=Math.pow(4,.99),o=Math.max(Math.pow(4,1),s*Math.sqrt(4)),u=e.getMediaInfo(),l=e.getMediaType(),g=u.bitrateList.map(function(e){return e.bandwidth}),m=g.length,y=e.getScheduleController(),E=e.getStreamInfo(),_=e.getAbrController(),v=_.getThroughputHistory(),S=E&&E.manifestInfo&&E.manifestInfo.isDynamic,b=e.useL2AABR(),A=h.getCurrentBufferLevel(l,!0),R=v.getSafeAverageThroughput(l,S),I=v.getAverageThroughput(l,S),C=v.getAverageLatency(l),w=e.getVideoModel().getPlaybackRate();if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getScheduleController")&&e.hasOwnProperty("getStreamInfo")&&e.hasOwnProperty("getAbrController")&&e.hasOwnProperty("useL2AABR")))return n;if(n.reason=n.reason||{},!b||l===c.default.AUDIO)return n;y.setTimeToLoadDelay(0);var N=function(e){var t=e.getMediaType(),n=r[t];return n||(n=function(e){var t={},r=e.getMediaInfo(),n=r.bitrateList.map(function(e){return e.bandwidth/1e3});return t.state=1,t.bitrates=n,t.lastQuality=0,function(e){e&&e.type&&(i[e.type]={},i[e.type].w=[],i[e.type].prev_w=[],i[e.type].Q=0,i[e.type].segment_request_start_s=0,i[e.type].segment_download_finish_s=0,i[e.type].B_target=1.5)}(r),p(t),t}(e),r[t]=n),n}(e);if(0===N.state)return n;var D=i[l];if(!D)return n;if(n.reason.state=N.state,n.reason.throughput=I,n.reason.latency=C,isNaN(I))return n;switch(N.state){case 1:if(t=_.getQualityForBitrate(u,R,E.id,C),n.quality=t,n.reason.throughput=R,N.lastQuality=t,!isNaN(N.lastSegmentDurationS)&&A>=D.B_target){N.state=2,D.Q=s;for(var M=0;M<m;++M)M===N.lastQuality?D.prev_w[M]=1:D.prev_w[M]=0}break;case 2:var O=[],P=h.getCurrentHttpRequest(l).trace.reduce(function(e,t){return e+t.d},0),L=h.getCurrentHttpRequest(l).trace.reduce(function(e,t){return e+t.b[0]},0),F=Math.round(8*L/P);F<1&&(F=1);for(var j=N.lastSegmentDurationS,x=1,k=0;k<m;++k)g[k]=g[k]/1e3,w*g[k]>F&&(x=-1),D.w[k]=D.prev_w[k]+x*(j/(2*o))*((D.Q+s)*(w*g[k]/F));D.w=function(e){for(var t=e.length,r=!1,n=[],a=0;a<t;++a)n[a]=e[a];for(var i=e.sort(function(e,t){return t-e}),s=0,o=0,u=[],l=0;l<t-1;++l)if((o=((s+=i[l])-1)/(l+1))>=i[l+1]){r=!0;break}r||(o=(s+i[t-1]-1)/t);for(var c=0;c<t;++c)u[c]=Math.max(n[c]-o,0);return u}(D.w);for(var B=0;B<m;++B)O[B]=D.w[B]-D.prev_w[B],D.prev_w[B]=D.w[B];D.Q=Math.max(0,D.Q-j+j*w*((T(g,D.prev_w)+T(g,O))/F));for(var U=[],G=0;G<m;++G)U[G]=Math.abs(g[G]-T(D.w,g));(t=U.indexOf(Math.min.apply(Math,U)))>N.lastQuality&&g[N.lastQuality+1]<=F&&(t=N.lastQuality+1),g[t]>=F&&(D.Q=2*Math.max(s,D.Q)),n.quality=t,n.reason.throughput=I,n.reason.latency=C,n.reason.bufferLevel=A,N.lastQuality=n.quality;break;default:f.debug("L2A ABR rule invoked in bad state."),n.quality=_.getQualityForBitrate(u,R,E.id,C),n.reason.state=N.state,n.reason.throughput=R,n.reason.latency=C,N.state=1,p(N)}return n},reset:function(){S(),g.off(u.default.PLAYBACK_SEEKING,m,t),g.off(u.default.MEDIA_FRAGMENT_LOADED,y,t),g.off(u.default.METRIC_ADDED,E,t),g.off(u.default.QUALITY_CHANGE_REQUESTED,v,t)}},f=Object(l.default)(d).getInstance().getLogger(t),S(),g.on(u.default.PLAYBACK_SEEKING,m,t),g.on(u.default.MEDIA_FRAGMENT_LOADED,y,t),g.on(u.default.METRIC_ADDED,E,t),g.on(u.default.QUALITY_CHANGE_REQUESTED,v,t),t}f.__dashjs_factory_name="L2ARule",t.default=i.default.getClassFactory(f)},"./src/streaming/rules/abr/SwitchHistoryRule.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/core/Debug.js"),i=r("./src/streaming/rules/SwitchRequest.js");function s(){var e,t,r=this.context;return e={getMaxIndex:function(e){for(var n=e?e.getSwitchHistory():null,a=n?n.getSwitchRequests():[],s=0,o=0,u=0,l=Object(i.default)(r).create(),c=0;c<a.length;c++)if(void 0!==a[c]&&(s+=a[c].drops,o+=a[c].noDrops,u+=a[c].dropSize,s+o>=6&&s/o>.075)){l.quality=c>0&&a[c].drops>0?c-1:c,l.reason={index:l.quality,drops:s,noDrops:o,dropSize:u},t.debug("Switch history rule index: "+l.quality+" samples: "+(s+o)+" drops: "+s);break}return l}},t=Object(a.default)(r).getInstance().getLogger(e),e}s.__dashjs_factory_name="SwitchHistoryRule",t.default=n.default.getClassFactory(s)},"./src/streaming/rules/abr/ThroughputRule.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/streaming/rules/SwitchRequest.js"),i=r("./src/streaming/constants/Constants.js"),s=r("./src/streaming/constants/MetricsConstants.js");function o(e){e=e||{};var t=this.context,r=e.dashMetrics;return{getMaxIndex:function(e){var n=Object(a.default)(t).create();if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("useBufferOccupancyABR")&&e.hasOwnProperty("getAbrController")&&e.hasOwnProperty("getScheduleController")))return n;!function(){if(!r||!r.hasOwnProperty("getCurrentBufferState"))throw new Error(i.default.MISSING_CONFIG_ERROR)}();var o=e.getMediaInfo(),u=e.getMediaType(),l=r.getCurrentBufferState(u),c=e.getScheduleController(),f=e.getAbrController(),d=e.getStreamInfo(),h=d?d.id:null,g=d&&d.manifestInfo?d.manifestInfo.isDynamic:null,p=f.getThroughputHistory(),m=p.getSafeAverageThroughput(u,g),y=p.getAverageLatency(u),E=e.useBufferOccupancyABR();return isNaN(m)||!l||E||f.getAbandonmentStateFor(h,u)!==s.default.ABANDON_LOAD&&(l.state===s.default.BUFFER_LOADED||g)&&(n.quality=f.getQualityForBitrate(o,m,h,y),c.setTimeToLoadDelay(0),n.reason={throughput:m,latency:y}),n},reset:function(){}}}o.__dashjs_factory_name="ThroughputRule",t.default=n.default.getClassFactory(o)},"./src/streaming/rules/abr/lolp/LearningAbrController.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/core/Debug.js");function i(){var e,t,r,n,i,s,o,u,l,c=this.context;function f(){r=null,n=1,i=100,s=0,o=null,u=null,l="dynamic_weight_selection"}function d(){var e=0;if(r)for(var t=0;t<r.length;t++){var n=r[t];n.state.throughput>e&&(e=n.state.throughput)}return e}function h(e,t,r){var n=e.map(function(e,n){return r[n]*Math.pow(e-t[n],2)}).reduce(function(e,t){return e+t});return(n<0?-1:1)*Math.sqrt(Math.abs(n))}function g(e,t){return h([e.state.throughput,e.state.latency,e.state.rebuffer,e.state.switch],[t.state.throughput,t.state.latency,t.state.rebuffer,t.state.switch],[1,1,1,1])}function p(e,t,r){for(var n=0;n<t.length;n++){var a=t[n],i=g(a,e);m(a,r,Math.exp(-1*Math.pow(i,2)/(2*Math.pow(.1,2))))}}function m(e,t,r){var n=e.state,a=[.01,.01,.01,.01];n.throughput=n.throughput+(t[0]-n.throughput)*a[0]*r,n.latency=n.latency+(t[1]-n.latency)*a[1]*r,n.rebuffer=n.rebuffer+(t[2]-n.rebuffer)*a[2]*r,n.switch=n.switch+(t[3]-n.switch)*a[3]*r}return e={getNextQuality:function(e,a,c,f,g,m,y){var E=c,_=f,v=a,T=function(e){if(!r){r=[];var t=e.bitrateList,a=[];s=t[0].bandwidth,t.forEach(function(e){a.push(e.bandwidth),e.bandwidth<s&&(s=e.bandwidth)}),l=a.map(function(e){return Math.pow(e,2)}).reduce(function(e,t){return e+t}),n=Math.sqrt(l);for(var i=0;i<t.length;i++){var o={qualityIndex:i,bitrate:t[i].bandwidth,state:{throughput:t[i].bandwidth/n,latency:0,rebuffer:0,switch:0}};r.push(o)}u=function(e){var t=[],r=function(e){for(var t=[],r=0;r<e;r++){var n=[Math.random()*d(),Math.random(),Math.random(),Math.random()];t.push(n)}return t}(Math.pow(e.length,2));t.push(r[0]);for(var n=[1,1,1,1],a=1;a<e.length;a++){for(var i=null,s=null,o=0;o<r.length;o++){for(var u=r[o],l=null,c=0;c<t.length;c++){var f=h(u,t[c],n);(null===l||f<l)&&(l=f)}(null===s||l>s)&&(i=u,s=l)}t.push(i)}for(var g=null,p=null,m=0;m<t.length;m++){for(var y=0,E=0;E<t.length;E++)m!==E&&(y+=h(t[m],t[E],n));(null===g||y>g)&&(g=y,p=m)}var _=[];for(_.push(t[p]),t.splice(p,1);t.length>0;){for(var v=null,T=null,S=0;S<t.length;S++){var b=h(_[0],t[S],n);(null===v||b<v)&&(v=b,T=S)}_.push(t[T]),t.splice(T,1)}return _}(r)}var l;return r}(e),S=a/n;S>1&&(S=d()),c/=i,t.debug("getNextQuality called throughput:".concat(S," latency:").concat(c," bufferSize:").concat(f," currentQualityIndex:").concat(m," playbackRate:").concat(g));var b=T[m],A=b.bitrate*y.getSegmentDuration()/v,R=Math.max(0,A-_);if(_-A<y.getMinBuffer())return t.debug("Buffer is low for bitrate= ".concat(b.bitrate," downloadTime=").concat(A," currentBuffer=").concat(_," rebuffer=").concat(R)),function(e,t){var n=0,a=e;if(r)for(var i=0;i<r.length;i++){var s=r[i];s.bitrate<e.bitrate&&s.bitrate>n&&t>s.bitrate&&(n=s.bitrate,a=s)}return a}(b,v).qualityIndex;switch(l){case"manual_weight_selection":o=[.4,.4,.4,.4];break;case"random_weight_selection":!function(e){o=function(e){for(var t=[],r=Math.sqrt(2/e),n=0;n<4;n++)t.push(Math.random()*r);return o=t}(e.length)}(T);break;default:!function(e,t,r,n,a,i,s){o||(o=u[u.length-1]);var l=e.findWeightVector(t,r,n,a,i,s);null!==l&&-1!==l&&(o=l)}(y,T,E,_,R,v,g)}for(var I=null,C=null,w=null,N=0;N<T.length;N++){var D=T[N],M=D.state,O=[M.throughput,M.latency,M.rebuffer,M.switch],P=o.slice(),L=y.getNextBufferWithBitrate(D.bitrate,_,v),F=L<y.getMinBuffer();F&&t.debug("Buffer is low for bitrate=".concat(D.bitrate," downloadTime=").concat(A," currentBuffer=").concat(_," nextBuffer=").concat(L)),(D.bitrate>a-1e4||F)&&D.bitrate!==s&&(P[0]=100);var j=h(O,[S,0,0,0],P);(null===I||j<I)&&(I=j,C=D.qualityIndex,w=D)}var x=Math.abs(b.bitrate-w.bitrate)/n;return p(b,T,[S,c,R,x]),p(w,T,[S,0,0,x]),C},reset:function(){f()}},t=Object(a.default)(c).getInstance().getLogger(e),f(),e}i.__dashjs_factory_name="LearningAbrController",t.default=n.default.getClassFactory(i)},"./src/streaming/rules/abr/lolp/LoLpQoEEvaluator.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/streaming/rules/abr/lolp/QoeInfo.js");function i(){var e,t,r,n,i;function s(){t=null,r=null,n=null,i=null}function o(e,t,r,n){var i=new a.default;return i.type=e,i.weights.bitrateReward=t||1,i.weights.bitrateSwitchPenalty=1,i.weights.rebufferPenalty=r||1e3,i.weights.latencyPenalty=[],i.weights.latencyPenalty.push({threshold:1.1,penalty:.05*n}),i.weights.latencyPenalty.push({threshold:1e8,penalty:.1*r}),i.weights.playbackSpeedPenalty=n||200,i}function u(e,t,r,n,a){a.bitrateWSum+=a.weights.bitrateReward*e,a.lastBitrate&&(a.bitrateSwitchWSum+=a.weights.bitrateSwitchPenalty*Math.abs(e-a.lastBitrate)),a.lastBitrate=e,a.rebufferWSum+=a.weights.rebufferPenalty*t;for(var i=0;i<a.weights.latencyPenalty.length;i++){var s=a.weights.latencyPenalty[i];if(r<=s.threshold){a.latencyWSum+=s.penalty*r;break}}a.playbackSpeedWSum+=a.weights.playbackSpeedPenalty*Math.abs(1-n),a.totalQoe=a.bitrateWSum-a.bitrateSwitchWSum-a.rebufferWSum-a.latencyWSum-a.playbackSpeedWSum}return e={setupPerSegmentQoe:function(e,a,s){t=o("segment",e,a,s),r=e,n=a,i=s},logSegmentMetrics:function(e,r,n,a){t&&u(e,r,n,a,t)},getPerSegmentQoe:function(){return t},calculateSingleUseQoe:function(e,t,a,s){var l=null;return r&&n&&i&&(l=o("segment",r,n,i)),l?(u(e,t,a,s,l),l.totalQoe):0},reset:function(){s()}},s(),e}i.__dashjs_factory_name="LoLpQoeEvaluator",t.default=n.default.getClassFactory(i)},"./src/streaming/rules/abr/lolp/LoLpRule.js":function(e,t,r){r.r(t);var n=r("./src/core/Debug.js"),a=r("./src/core/FactoryMaker.js"),i=r("./src/streaming/rules/abr/lolp/LearningAbrController.js"),s=r("./src/streaming/rules/abr/lolp/LoLpQoEEvaluator.js"),o=r("./src/streaming/rules/SwitchRequest.js"),u=r("./src/streaming/constants/MetricsConstants.js"),l=r("./src/streaming/rules/abr/lolp/LoLpWeightSelector.js"),c=r("./src/streaming/constants/Constants.js");function f(e){var t,r,a,f,d=(e=e||{}).dashMetrics,h=this.context;return r={getMaxIndex:function(e){try{var r=Object(o.default)(h).create(),n=e.getMediaInfo().type,i=e.getAbrController(),s=e.getStreamInfo(),g=i.getQualityFor(n,s.id),p=e.getMediaInfo(),m=d.getCurrentBufferState(n),y=e.getScheduleController(),E=d.getCurrentBufferLevel(n,!0),_=s&&s.manifestInfo?s.manifestInfo.isDynamic:null,v=y.getPlaybackController(),T=v.getCurrentLiveLatency();if(!e.useLoLPABR()||n===c.default.AUDIO)return r;T||(T=0);var S=v.getPlaybackRate(),b=i.getThroughputHistory().getSafeAverageThroughput(n,_);if(t.debug("Throughput ".concat(Math.round(b)," kbps")),isNaN(b)||!m)return r;if(i.getAbandonmentStateFor(s.id,n)===u.default.ABANDON_LOAD)return r;for(var A=p.bitrateList,R=e.getRepresentationInfo().fragmentDuration,I=A[0].bandwidth/1e3,C=A[A.length-1].bandwidth/1e3,w=0;w<A.length;w++){var N=A[w].bandwidth/1e3;N>C?C=N:N<I&&(I=N)}var D=A[g].bandwidth/1e3,M=d.getCurrentHttpRequest(n,!0),O=(M.tresponse.getTime()-M.trequest.getTime())/1e3,P=O>R?O-R:0;f.setupPerSegmentQoe(R,C,I),f.logSegmentMetrics(D,P,T,S);var L=Object(l.default)(h).create({targetLatency:1.5,bufferMin:.3,segmentDuration:R,qoeEvaluator:f});return r.quality=a.getNextQuality(p,1e3*b,T,E,S,g,L),r.reason={throughput:b,latency:T},r.priority=o.default.PRIORITY.STRONG,y.setTimeToLoadDelay(0),r.quality!==g&&console.log("[TgcLearningRule]["+n+"] requesting switch to index: ",r.quality,"Average throughput",Math.round(b),"kbps"),r}catch(e){throw e}},reset:function(){a.reset(),f.reset()}},t=Object(n.default)(h).getInstance().getLogger(r),a=Object(i.default)(h).create(),f=Object(s.default)(h).create(),r}f.__dashjs_factory_name="LoLPRule",t.default=a.default.getClassFactory(f)},"./src/streaming/rules/abr/lolp/LoLpWeightSelector.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js");function a(e){var t,r,n,a,i=e.targetLatency,s=e.bufferMin,o=e.segmentDuration,u=e.qoeEvaluator;function l(){return o}function c(e,t){var r=l();return t>r?e-r:e+r-t}return t={getMinBuffer:function(){return s},getSegmentDuration:l,getNextBufferWithBitrate:function(e,t,r){return c(t,e*o/r)},getNextBuffer:c,findWeightVector:function(e,t,a,l,f,d){var h=null,g=null,p=null,m=Math.abs(t-n);return e.forEach(function(e){r.forEach(function(r){r[0];var n=r[1],l=r[2],y=(r[3],e.bitrate*o/f),E=c(a,y),_=(0===l?10:1/l)*Math.max(1e-5,y-E),v=(0===n?10:1/n)*e.state.latency,T=u.calculateSingleUseQoe(e.bitrate,_,v,d);(null===h||T>h)&&function(e,t,r){return!(e>i+r)&&t>=s}(t,E,m)&&(h=T,g=r,p=e.bitrate)})}),null===g&&null===p&&(g=-1),n=t,g}},r=function e(t,r,n){if(n===r)return t;for(var i=t.length,s=0;s<i;s++)for(var o=t.shift(),u=0;u<a.length;u++)t.push(o.concat(a[u]));return e(t,r,n+1)}((a=[.2,.4,.6,.8,1]).map(function(e){return[e]}),4,1),n=0,t}a.__dashjs_factory_name="LoLpWeightSelector",t.default=n.default.getClassFactory(a)},"./src/streaming/rules/abr/lolp/QoeInfo.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.type=null,this.lastBitrate=null,this.weights={},this.weights.bitrateReward=null,this.weights.bitrateSwitchPenalty=null,this.weights.rebufferPenalty=null,this.weights.latencyPenalty=null,this.weights.playbackSpeedPenalty=null,this.bitrateWSum=0,this.bitrateSwitchWSum=0,this.rebufferWSum=0,this.latencyWSum=0,this.playbackSpeedWSum=0,this.totalQoe=0}},"./src/streaming/text/EmbeddedTextHtmlRender.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js");function a(){var e=0;function t(e){for(var t="",r=0;r<e.length;++r)t+=e[r].uchar;return t.length-t.replace(/^\s+/,"").length}function r(e){return"left: "+3.125*e.x+"%; top: "+6.66*e.y1+"%; width: "+(100-3.125*e.x)+"%; height: "+6.66*Math.max(e.y2-1-e.y1,1)+"%; align-items: flex-start; overflow: visible; -webkit-writing-mode: horizontal-tb;"}function n(e){return"red"===e?"rgb(255, 0, 0)":"green"===e?"rgb(0, 255, 0)":"blue"===e?"rgb(0, 0, 255)":"cyan"===e?"rgb(0, 255, 255)":"magenta"===e?"rgb(255, 0, 255)":"yellow"===e?"rgb(255, 255, 0)":"white"===e?"rgb(255, 255, 255)":"black"===e?"rgb(0, 0, 0)":e}function a(e,t){var r=e.videoHeight/15;return t?"font-size: "+r+"px; font-family: Menlo, Consolas, 'Cutive Mono', monospace; color: "+(t.foreground?n(t.foreground):"rgb(255, 255, 255)")+"; font-style: "+(t.italics?"italic":"normal")+"; text-decoration: "+(t.underline?"underline":"none")+"; white-space: pre; background-color: "+(t.background?n(t.background):"transparent")+";":"font-size: "+r+"px; font-family: Menlo, Consolas, 'Cutive Mono', monospace; justify-content: flex-start; text-align: left; color: rgb(255, 255, 255); font-style: normal; white-space: pre; line-height: normal; font-weight: normal; text-decoration: none; width: 100%; display: flex;"}function i(e){return e.replace(/^\s+/g,"")}function s(e){return e.replace(/\s+$/g,"")}return{createHTMLCaptionsFromScreen:function(n,o,u,l){var c,f,d=null,h=!1,g=-1,p={start:o,end:u,spans:[]},m="style_cea608_white_black",y={},E={},_=[];for(c=0;c<15;++c){var v=l.rows[c],T="",S=null;if(!1===v.isEmpty()){var b=t(v.chars);null===d&&(d={x:b,y1:c,y2:c+1,p:[]}),b!==g&&h&&(d.p.push(p),p={start:o,end:u,spans:[]},d.y2=c,d.name="region_"+d.x+"_"+d.y1+"_"+d.y2,!1===y.hasOwnProperty(d.name)?(_.push(d),y[d.name]=d):y[d.name].p.contat(d.p),d={x:b,y1:c,y2:c+1,p:[]});for(var A=0;A<v.chars.length;++A){var R=v.chars[A],I=R.penState;if(null===S||!I.equals(S)){T.trim().length>0&&(p.spans.push({name:m,line:T,row:c}),T="");var C="style_cea608_"+I.foreground+"_"+I.background;I.underline&&(C+="_underline"),I.italics&&(C+="_italics"),E.hasOwnProperty(C)||(E[C]=JSON.parse(JSON.stringify(I))),S=I,m=C}T+=R.uchar}T.trim().length>0&&p.spans.push({name:m,line:T,row:c}),h=!0,g=b}else h=!1,g=-1,d&&(d.p.push(p),p={start:o,end:u,spans:[]},d.y2=c,d.name="region_"+d.x+"_"+d.y1+"_"+d.y2,!1===y.hasOwnProperty(d.name)?(_.push(d),y[d.name]=d):y[d.name].p.contat(d.p),d=null)}d&&(d.p.push(p),d.y2=c+1,d.name="region_"+d.x+"_"+d.y1+"_"+d.y2,!1===y.hasOwnProperty(d.name)?(_.push(d),y[d.name]=d):y[d.name].p.contat(d.p),d=null);var w=[];for(c=0;c<_.length;++c){var N=_[c],D="sub_cea608_"+e++,M=document.createElement("div");M.id=D;var O=r(N);M.style.cssText="position: absolute; margin: 0; display: flex; box-sizing: border-box; pointer-events: none;"+O;var P=document.createElement("div");P.className="paragraph bodyStyle",P.style.cssText=a(n);var L=document.createElement("div");L.className="cueUniWrapper",L.style.cssText="unicode-bidi: normal; direction: ltr;";for(var F=0;F<N.p.length;++F){var j=N.p[F],x=0;for(f=0;f<j.spans.length;++f){var k=j.spans[f];if(k.line.length>0){if(0!==f&&x!=k.row){var B=document.createElement("br");B.className="lineBreak",L.appendChild(B)}var U=!1;x===k.row&&(U=!0),x=k.row;var G=E[k.name],H=document.createElement("span");H.className="spanPadding "+k.name+" customSpanColor",H.style.cssText=a(n,G),0!==f&&U?f===j.spans.length-1?H.textContent=s(k.line):H.textContent=k.line:j.spans.length>1&&f<j.spans.length-1&&k.row===j.spans[f+1].row?H.textContent=i(k.line):H.textContent=k.line.trim(),L.appendChild(H)}}}P.appendChild(L),M.appendChild(P);var q={bodyStyle:["%",90]};for(var Y in E)E.hasOwnProperty(Y)&&(q[Y]=["%",90]);w.push({type:"html",start:o,end:u,cueHTMLElement:M,cueID:D,cellResolution:[32,15],isFromCEA608:!0,fontSize:q,lineHeight:{},linePadding:{}})}return w}}}a.__dashjs_factory_name="EmbeddedTextHtmlRender",t.default=n.default.getSingletonFactory(a)},"./src/streaming/text/NotFragmentedTextBufferController.js":function(e,t,r){r.r(t);var n=r("./src/core/EventBus.js"),a=r("./src/core/events/Events.js"),i=r("./src/core/FactoryMaker.js"),s=r("./src/streaming/utils/InitCache.js"),o=r("./src/streaming/SourceBufferSink.js"),u=r("./src/streaming/vo/DashJSError.js"),l=r("./src/core/errors/Errors.js"),c="NotFragmentedTextBufferController";function f(e){e=e||{};var t,r,i,f,d,h,g=this.context,p=Object(n.default)(g).getInstance(),m=e.textController,y=e.errHandler,E=e.streamInfo,_=e.type;function v(e){f=e}function T(e){var t,n;r!==e&&(r=e)&&(t=a.default.BUFFERING_COMPLETED,n={},p.trigger(t,n,{streamId:E.id,mediaType:_}))}function S(e){e.chunk.bytes&&!r&&(h.save(e.chunk),d.append(e.chunk),T(!0))}return t={initialize:function(e){v(e)},getStreamId:function(){return E.id},getType:function(){return _},getBufferControllerType:function(){return c},createBufferSink:function(e){return new Promise(function(t,r){try{(d=Object(o.default)(g).create({mediaSource:f,textController:m,eventBus:p})).initializeForFirstUse(E,e),i||(d.getBuffer()&&"function"==typeof d.getBuffer().initialize&&d.getBuffer().initialize(),i=!0),t(d)}catch(e){y.error(new u.default(l.default.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,l.default.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+_)),r(e)}})},getBuffer:function(){return d},getBufferLevel:function(){return 0},getRangeAt:function(){return null},getAllRangesWithSafetyFactor:function(){return[]},getContinuousBufferTimeForTargetTime:function(){return Number.POSITIVE_INFINITY},setMediaSource:v,getMediaSource:function(){return f},appendInitSegmentFromCache:function(e){return null!==h.extract(E.id,e)},getIsBufferingCompleted:function(){return r},setIsBufferingCompleted:T,getIsPruningInProgress:function(){return!1},reset:function(e){p.off(a.default.INIT_FRAGMENT_LOADED,S,t),!e&&d&&(d.abort(),d.reset(),d=null)},clearBuffers:function(){return Promise.resolve()},prepareForPlaybackSeek:function(){return Promise.resolve()},prepareForReplacementTrackSwitch:function(){return r=!1,Promise.resolve()},setSeekTarget:function(){},updateAppendWindow:function(){return Promise.resolve()},pruneAllSafely:function(){return Promise.resolve()},updateBufferTimestampOffset:function(){return Promise.resolve()},segmentRequestingCompleted:function(){}},i=!1,f=null,r=!1,h=Object(s.default)(g).getInstance(),p.on(a.default.INIT_FRAGMENT_LOADED,S,t),t}f.__dashjs_factory_name=c,t.default=i.default.getClassFactory(f)},"./src/streaming/text/TextController.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/Constants.js"),a=r("./src/core/FactoryMaker.js"),i=r("./src/streaming/text/TextSourceBuffer.js"),s=r("./src/streaming/text/TextTracks.js"),o=r("./src/streaming/utils/VTTParser.js"),u=r("./src/streaming/utils/TTMLParser.js"),l=r("./src/core/EventBus.js"),c=r("./src/core/events/Events.js"),f=r("./src/streaming/MediaPlayerEvents.js"),d=r("./src/streaming/utils/SupervisorTools.js");function h(e){var t,r,a,h,g,p,m,y,E,_,v,T,S,b=this.context,A=e.adapter,R=e.errHandler,I=e.manifestModel,C=e.mediaController,w=e.videoModel,N=e.settings;function D(e){var t=e.tracks,n=e.index,a=e.streamId;!1===N.get().streaming.text.defaultEnabled&&!O()||S?P(a,-1):(y&&t.some(function(e,t){if(C.matchSettings(y,e))return P(a,t),n=t,!0}),_=!1),r[a].lastEnabledIndex=n,m.trigger(f.default.TEXT_TRACKS_ADDED,{enabled:O(),index:n,tracks:t,streamId:a}),T=!0}function M(e){if(!E&&e&&e.newMediaInfo){var t=e.newMediaInfo;t.type===n.default.TEXT&&(y={lang:t.lang,role:t.roles[0],index:t.index,codec:t.codec,accessibility:t.accessibility[0]})}}function O(){var e=!0;return _&&!v&&(e=!1),e}function P(e,t){(_=-1===t)&&C&&C.saveTextSettingsDisabled();var r=L(e);if(r!==t&&h[e]){h[e].setModeForTrackIdx(r,n.default.TEXT_HIDDEN),h[e].setCurrentTrackIdx(t),h[e].setModeForTrackIdx(t,n.default.TEXT_SHOWING);var i=h[e].getCurrentTrackInfo();i&&i.isFragmented&&!i.isEmbedded?function(e,t,r){if(a[e])for(var i=a[e].getConfig().fragmentedTracks,s=0;s<i.length;s++){var o=i[s];if(t.lang===o.lang&&(o.id?t.id===o.id:t.index===o.index)){var u=C.getCurrentTrackFor(n.default.TEXT,e);(o.id?u.id!==o.id:u.index!==o.index)?(h[e].deleteCuesFromTrackIdx(r),a[e].setCurrentFragmentedTrackIdx(s)):-1===r&&m.trigger(c.default.SET_FRAGMENTED_TEXT_AFTER_DISABLED,{},{streamId:e,mediaType:n.default.TEXT})}}}(e,i,r):i&&!i.isFragmented&&function(e,t){m.trigger(c.default.SET_NON_FRAGMENTED_TEXT,{currentTrackInfo:t},{streamId:e,mediaType:n.default.TEXT})}(e,i),C.setTrack(i)}}function L(e){return h[e].getCurrentTrackIdx()}function F(){a={},h={},r={},_=!0,T=!1,S=!1}return t={deactivateStream:function(e){if(e){var t=e.id;a[t]&&a[t].resetMediaInfos(),h[t]&&h[t].deleteAllTextTracks()}},initialize:function(){m.on(c.default.CURRENT_TRACK_CHANGED,M,t),m.on(c.default.TEXT_TRACKS_QUEUE_INITIALIZED,D,t)},initializeForStream:function(e){var t=e.id,n=Object(s.default)(b).create({videoModel:w,streamInfo:e});n.initialize(),h[t]=n;var o=Object(i.default)(b).create({errHandler:R,adapter:A,manifestModel:I,mediaController:C,videoModel:w,textTracks:n,vttParser:g,ttmlParser:p,streamInfo:e});o.initialize(),a[t]=o,r[t]={},r[t].lastEnabledIndex=-1},createTracks:function(e){var t=e.id;h[t]&&h[t].createTracks()},getTextSourceBuffer:function(e){var t=e.id;if(a&&a[t])return a[t]},getAllTracksAreDisabled:function(){return _},addEmbeddedTrack:function(e,t){var r=e.id;a[r]&&a[r].addEmbeddedTrack(t)},setInitialSettings:function(e){y=e,E=!0},enableText:function(e,t){Object(d.checkParameterType)(t,"boolean"),O()!==t&&(t&&P(e,r[e].lastEnabledIndex),t||(r[e].lastEnabledIndex=L(e),T?P(e,-1):S=!0))},isTextEnabled:O,setTextTrack:P,getCurrentTrackIdx:L,enableForcedTextStreaming:function(e){Object(d.checkParameterType)(e,"boolean"),v=e},addMediaInfosToBuffer:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=e.id;a[i]&&a[i].addMediaInfos(t,r,n)},reset:function(){F(),m.off(c.default.CURRENT_TRACK_CHANGED,M,t),m.off(c.default.TEXT_TRACKS_QUEUE_INITIALIZED,D,t),Object.keys(a).forEach(function(e){a[e].resetEmbedded(),a[e].reset()})}},y=null,v=!1,T=!1,E=!1,S=!1,g=Object(o.default)(b).getInstance(),p=Object(u.default)(b).getInstance(),m=Object(l.default)(b).getInstance(),F(),t}h.__dashjs_factory_name="TextController",t.default=a.default.getClassFactory(h)},"./src/streaming/text/TextSourceBuffer.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/Constants.js"),a=r("./src/streaming/vo/metrics/HTTPRequest.js"),i=r("./src/streaming/vo/TextTrackInfo.js"),s=r("./src/streaming/utils/BoxParser.js"),o=r("./src/streaming/utils/CustomTimeRanges.js"),u=r("./src/core/FactoryMaker.js"),l=r("./src/core/Debug.js"),c=r("./src/streaming/text/EmbeddedTextHtmlRender.js"),f=r("./node_modules/codem-isoboxer/dist/iso_boxer.js"),d=r.n(f),h=r("./externals/cea608-parser.js"),g=r.n(h),p=r("./src/core/EventBus.js"),m=r("./src/core/events/Events.js"),y=r("./src/streaming/vo/DashJSError.js"),E=r("./src/core/errors/Errors.js");function _(e){var t,r,u,f,h,_,v,T,S,b,A,R,I,C,w,N,D=e.errHandler,M=e.manifestModel,O=e.mediaController,P=e.videoModel,L=e.textTracks,F=e.vttParser,j=e.ttmlParser,x=e.streamInfo,k=this.context,B=Object(p.default)(k).getInstance(),U=!1;function G(){_=null,T=NaN,S=[],b=null,v=!1,h=[],f=null}function H(e){var t=new i.default;for(var r in e)t[r]=e[r];t.labels=e.labels,t.defaultTrack=function(e){var t=!1;return R.length>1&&e.isEmbedded?t=e.id&&e.id===n.default.CC1:1===R.length?e.id&&"string"==typeof e.id&&"CC"===e.id.substring(0,2)&&(t=!0):0===R.length&&(t=e.index===h[0].index),t}(e),t.isFragmented=e.isFragmented,t.isEmbedded=!!e.isEmbedded,t.isTTML=function(e){return e.codec&&e.codec.search(n.default.STPP)>=0||e.mimeType&&e.mimeType.search(n.default.TTML)>=0}(e),t.kind=function(e,t){var r=e.roles&&e.roles.length>0?t[e.roles[0]]:t.caption;return r===t.caption||r===t.subtitle?r:t.caption}(e,{subtitle:"subtitles",caption:"captions"}),L.addTextTrack(t)}function q(e){var t=e.chunk;t.mediaInfo.embeddedCaptions&&K(t.bytes,t)}function Y(e){A=e}function K(e,i){var s=i.mediaInfo,o=s.type,l=s.mimeType,c=s.codec||l;c?-1!==s.codec.indexOf("application/mp4")?function(e,a,i){var s;if("InitializationSegment"===a.segmentType)v=!0,T=u.getMediaTimescaleFromMoov(e);else{if(!v)return;(s=u.getSamplesInfo(e).sampleList).length>0&&(b=s[0].cts-a.start*T),i.search(n.default.STPP)>=0?function(e,a,i){var s,o;for(f=null!==f?f:z(i),s=0;s<a.length;s++){var u=a[s],l=u.cts,c=W(),h=c+l/T,g=h+u.duration/T;t.buffered.add(h,g);var p=new DataView(e,u.offset,u.subSizes[0]),m=d.a.Utils.dataViewToString(p,n.default.UTF8),y=[],E=u.offset+u.subSizes[0];for(o=1;o<u.subSizes.length;o++){var v=new Uint8Array(e,E,u.subSizes[o]),S=String.fromCharCode.apply(null,v);y.push(S),E+=u.subSizes[o]}try{var b=M.getValue().ttmlTimeIsRelative?l/T:0,R=f.parse(m,b,l/T,(l+u.duration)/T,y);L.addCaptions(A,c,R)}catch(e){_.removeExecutedRequestsBeforeTime(),this.remove(),r.error("TTML parser error: "+e.message)}}}(e,s,i):function(e,n){var a,i,s,o=[];for(a=0;a<n.length;a++){var u=n[a];u.cts-=b;var l=W()+u.cts/T,c=l+u.duration/T;t.buffered.add(l,c);var f=e.slice(u.offset,u.offset+u.size),h=d.a.parseBuffer(f);for(i=0;i<h.boxes.length;i++){var g=h.boxes[i];if(r.debug("VTT box1: "+g.type),"vtte"!==g.type&&"vttc"===g.type)for(r.debug("VTT vttc boxes.length = "+g.boxes.length),s=0;s<g.boxes.length;s++){var p=g.boxes[s];if(r.debug("VTT box2: "+p.type),"payl"===p.type){var m=p.cue_text;r.debug("VTT cue_text = "+m);var y=u.cts/T,E=(u.cts+u.duration)/T;o.push({start:y,end:E,data:m,styles:{}}),r.debug("VTT "+y+"-"+E+" : "+m)}}}}o.length>0&&L.addCaptions(A,0,o)}(e,s)}}(e,i,c):o===n.default.VIDEO?function(e,t){var n,i;if(t.segmentType===a.HTTPRequest.INIT_SEGMENT_TYPE)0===I&&(I=u.getMediaTimescaleFromMoov(e));else if(t.segmentType===a.HTTPRequest.MEDIA_SEGMENT_TYPE){if(0===I)return void r.warn("CEA-608: No timescale for embeddedTextTrack yet");var s=(i=u.getSamplesInfo(e)).lastSequenceNumber;if(w[0]||w[1]||function(){for(var e,t=0;t<R.length;t++){if(-1===(e=L.getTrackIdxForId(R[t].id)))return void r.warn("CEA-608: data before track is ready.");var n=V(e);w[t]=new g.a.Cea608Parser(t+1,{newCue:n},null)}}(),I){if(null!==C&&s!==C+i.numSequences)for(n=0;n<w.length;n++)w[n]&&w[n].reset();for(var o=function(e,t){if(0===t.length)return null;for(var r={splits:[],fields:[[],[]]},n=new DataView(e),a=0;a<t.length;a++)for(var i=t[a],s=g.a.findCea608Nalus(n,i.offset,i.size),o=null,u=0,l=0;l<s.length;l++)for(var c=g.a.extractCea608DataFromRange(n,s[l]),f=0;f<2;f++)if(c[f].length>0){i.cts!==o?u=0:u+=1;var d=W();r.fields[f].push([i.cts+d*I,c[f],u]),o=i.cts}return r.fields.forEach(function(e){e.sort(function(e,t){return e[0]===t[0]?e[2]-t[2]:e[0]-t[0]})}),r}(e,i.sampleList),l=0;l<w.length;l++){var c=o.fields[l],f=w[l];if(f)for(n=0;n<c.length;n++)f.addData(c[n][0]/I,c[n][1])}C=s}}}(e,i):function(e,r,a){var i,s,o=new DataView(e,0,e.byteLength);s=d.a.Utils.dataViewToString(o,n.default.UTF8);try{i=z(a).parse(s,0),L.addCaptions(L.getCurrentTrackIdx(),0,i),t.buffered&&t.buffered.add(r.start,r.end)}catch(e){D.error(new y.default(E.default.TIMED_TEXT_ERROR_ID_PARSE_CODE,E.default.TIMED_TEXT_ERROR_MESSAGE_PARSE+e.message,s))}}(e,i,c):r.error("No text type defined")}function V(e){return function(t,r,n){var a;(a=P.getTTMLRenderingDiv()?N.createHTMLCaptionsFromScreen(P.getElement(),t,r,n):[{start:t,end:r,data:n.getDisplayText(),styles:{}}])&&L.addCaptions(e,0,a)}}function W(){return isNaN(t.timestampOffset)?0:t.timestampOffset}function z(e){var t;return e.search(n.default.VTT)>=0?t=F:(e.search(n.default.TTML)>=0||e.search(n.default.STPP)>=0)&&(t=j),t}function X(e){R.forEach(function(t){var r=L.getTrackIdxForId(t.id);r>=0&&L.deleteCuesFromTrackIdx(r,e.from,e.to)})}return t={initialize:function(){U||(R=[],A=null,I=0,w=[],C=null,U=!0,N=Object(c.default)(k).getInstance(),B.on(m.default.VIDEO_CHUNK_RECEIVED,q,t),B.on(m.default.BUFFER_CLEARED,X,t))},addMediaInfos:function(e,r,a){if(h=h.concat(r),e===n.default.TEXT&&r[0].isFragmented&&!r[0].isEmbedded){_=a,t.buffered=Object(o.default)(k).create(),S=O.getTracksFor(n.default.TEXT,x.id).filter(function(e){return e.isFragmented});for(var i=O.getCurrentTrackFor(n.default.TEXT,x.id),s=0;s<S.length;s++)if(S[s]===i){Y(s);break}}for(var u=0;u<r.length;u++)H(r[u])},resetMediaInfos:function(){h=[]},getStreamId:function(){return x.id},append:K,abort:function(){},addEmbeddedTrack:function(e){if(U&&e)if(e.id===n.default.CC1||e.id===n.default.CC3){for(var t=0;t<R.length;t++)if(R[t].id===e.id)return;R.push(e)}else r.warn("Embedded track "+e.id+" not supported!")},resetEmbedded:function(){B.off(m.default.VIDEO_CHUNK_RECEIVED,q,t),B.off(m.default.BUFFER_CLEARED,X,t),L&&L.deleteAllTextTracks(),U=!1,R=[],w=[null,null],C=null},getConfig:function(){return{fragmentModel:_,fragmentedTracks:S,videoModel:P}},setCurrentFragmentedTrackIdx:Y,remove:function(e,r){void 0===e&&e===r&&(e=t.buffered.start(0),r=t.buffered.end(t.buffered.length-1)),t.buffered.remove(e,r),L.deleteCuesFromTrackIdx(A,e,r)},reset:function(){G(),h=[],u=null}},r=Object(l.default)(k).getInstance().getLogger(t),u=Object(s.default)(k).getInstance(),G(),t}_.__dashjs_factory_name="TextSourceBuffer",t.default=u.default.getClassFactory(_)},"./src/streaming/text/TextTracks.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/Constants.js"),a=r("./src/core/EventBus.js"),i=r("./src/core/events/Events.js"),s=r("./src/streaming/MediaPlayerEvents.js"),o=r("./src/core/FactoryMaker.js"),u=r("./src/core/Debug.js"),l=r("./node_modules/imsc/src/main/js/main.js");function c(e){var t,r,o,c,f,d,h,g,p,m,y,E,_,v,T,S,b,A=this.context,R=Object(a.default)(A).getInstance(),I=e.videoModel,C=e.streamInfo;function w(e){var t=e.kind,r=void 0!==e.id?e.id:e.lang,n=e.lang,a=e.isTTML,i=e.isEmbedded;return I.addTextTrack(t,r,n,a,i)}function N(e,t,r,n,a,i){var s=0,o=0;e/t>r/n?s=(o=t)/n*r:o=(s=e)/r*n;var u,l,c=0,f=0;return s/o>a?(f=o,c=o*a):(c=s,f=s/a),u=(e-c)/2,l=(t-f)/2,i?{x:u+.1*c,y:l+.1*f,w:.8*c,h:.8*f}:{x:u,y:l,w:c,h:f}}function D(e,t){var r=I.getClientWidth(),n=I.getClientHeight(),a=I.getVideoWidth(),i=I.getVideoHeight(),o=I.getVideoRelativeOffsetTop(),u=I.getVideoRelativeOffsetLeft();if(0!==a&&0!==i){var l=a/i,c=!1;e.isFromCEA608&&(l=3.5/3,c=!0);var f=N.call(this,r,n,a,i,l,c),d=f.w,E=f.h,T=f.x,b=f.y;if(d!=p||E!=m||T!=h||b!=g||t){if(h=T+u,g=b+o,p=d,m=E,y){var A=y.style;A&&(A.left=h+"px",A.top=g+"px",A.width=p+"px",A.height=m+"px",A.zIndex=_&&document[_]||v?S:null,R.trigger(s.default.CAPTION_CONTAINER_RESIZE))}var C=e.activeCues;if(C)for(var w=C.length,D=0;D<w;++D){var M=C[D];M.scaleCue(M)}}}}function M(e){var t,r,n,a,i,s=p,o=m;if(e.cellResolution){var u=[s/e.cellResolution[0],o/e.cellResolution[1]];if(e.linePadding)for(t in e.linePadding)if(e.linePadding.hasOwnProperty(t)){r=(e.linePadding[t]*u[0]).toString();for(var l=document.getElementsByClassName("spanPadding"),c=0;c<l.length;c++)l[c].style.cssText=l[c].style.cssText.replace(/(padding-left\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+r),l[c].style.cssText=l[c].style.cssText.replace(/(padding-right\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+r)}if(e.fontSize){for(t in e.fontSize)if(e.fontSize.hasOwnProperty(t)){"%"===e.fontSize[t][0]?n=e.fontSize[t][1]/100:"c"===e.fontSize[t][0]&&(n=e.fontSize[t][1]),r=(n*u[1]).toString(),i="defaultFontSize"!==t?document.getElementsByClassName(t):document.getElementsByClassName("paragraph");for(var f=0;f<i.length;f++)i[f].style.cssText=i[f].style.cssText.replace(/(font-size\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+r)}if(e.lineHeight)for(t in e.lineHeight)if(e.lineHeight.hasOwnProperty(t)){"%"===e.lineHeight[t][0]?a=e.lineHeight[t][1]/100:"c"===e.fontSize[t][0]&&(a=e.lineHeight[t][1]),r=(a*u[1]).toString(),i=document.getElementsByClassName(t);for(var d=0;d<i.length;d++)i[d].style.cssText=i[d].style.cssText.replace(/(line-height\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+r)}}}if(e.isd){var h=document.getElementById(e.cueID);h&&y.removeChild(h),O(e)}}function O(e){if(y){var t=document.createElement("div");y.appendChild(t),T=Object(l.renderHTML)(e.isd,t,function(t){var r=/^(urn:)(mpeg:[a-z0-9][a-z0-9-]{0,31}:)(subs:)([0-9]+)$/,n=/^#(.*)$/;if(r.test(t)){var a=r.exec(t),i=parseInt(a[4],10)-1;return"data:image/png;base64,"+btoa(e.images[i])}if(n.test(t)){var s=n.exec(t)[1];return"data:image/png;base64,"+e.embeddedImages[s]}return null},y.clientHeight,y.clientWidth,!1,function(e){r.info("renderCaption :",e)},T,!0),t.id=e.cueID,R.trigger(s.default.CAPTION_RENDERED,{captionDiv:t,currentTrackIdx:d})}}function P(e,t,a){var i=L(e),u=this;if(i&&Array.isArray(a)&&0!==a.length)for(var l=0;l<a.length;l++){var c=void 0,f=a[l];i.cellResolution=f.cellResolution,i.isFromCEA608=f.isFromCEA608,"html"!==f.type||!y||isNaN(f.start)||isNaN(f.end)?!f.data||isNaN(f.start)||isNaN(f.end)||(c=new o(f.start-t,f.end-t,f.data),f.styles&&(void 0!==f.styles.align&&"align"in c&&(c.align=f.styles.align),void 0!==f.styles.line&&"line"in c&&(c.line=f.styles.line),void 0!==f.styles.position&&"position"in c&&(c.position=f.styles.position),void 0!==f.styles.size&&"size"in c&&(c.size=f.styles.size)),c.onenter=function(){i.mode===n.default.TEXT_SHOWING&&R.trigger(s.default.CAPTION_RENDERED,{currentTrackIdx:d})}):((c=new o(f.start+t,f.end+t,"")).cueHTMLElement=f.cueHTMLElement,c.isd=f.isd,c.images=f.images,c.embeddedImages=f.embeddedImages,c.cueID=f.cueID,c.scaleCue=M.bind(u),c.cellResolution=f.cellResolution,c.lineHeight=f.lineHeight,c.linePadding=f.linePadding,c.fontSize=f.fontSize,y.style.left=h+"px",y.style.top=g+"px",y.style.width=p+"px",y.style.height=m+"px",c.onenter=function(){i.mode===n.default.TEXT_SHOWING&&(this.isd?(O(this),r.debug("Cue enter id:"+this.cueID)):(y.appendChild(this.cueHTMLElement),M.call(u,this),R.trigger(s.default.CAPTION_RENDERED,{captionDiv:this.cueHTMLElement,currentTrackIdx:d})))},c.onexit=function(){if(y)for(var e=y.childNodes,t=0;t<e.length;++t)e[t].id===this.cueID&&(r.debug("Cue exit id:"+e[t].id),y.removeChild(e[t]),--t)});try{c?x(i,c)||i.addCue(c):r.error("impossible to display subtitles.")}catch(e){throw B(i),i.addCue(c),e}}}function L(e){return e>=0&&c[e]?I.getTextTrack(c[e].kind,c[e].id,c[e].lang,c[e].isTTML,c[e].isEmbedded):null}function F(e){var t=this;if(e!==d){var r=L(d=e);j.call(this,r),E&&(clearInterval(E),E=null),r&&"html"===r.renderingType&&(D.call(this,r,!0),window.ResizeObserver?(b=new window.ResizeObserver(function(){D.call(t,r,!0)})).observe(I.getElement()):E=setInterval(D.bind(this,r),500))}}function j(e){H.call(this),e&&"html"===e.renderingType?U.call(this):G.call(this)}function x(e,t){if(!e.cues)return!1;for(var r=0;r<e.cues.length;r++)if(e.cues[r].startTime===t.startTime&&e.cues[r].endTime===t.endTime)return!0;return!1}function k(e,t,r){return(isNaN(t)||e.startTime>=t)&&(isNaN(r)||e.endTime<=r)}function B(e,t,r){if(e.cues)for(var n=e.cues,a=n.length-1;a>=0;a--)k(n[a],t,r)&&(n[a].onexit&&n[a].onexit(),e.removeCue(n[a]))}function U(){var e=document.getElementById("native-cue-style");if(!e){(e=document.createElement("style")).id="native-cue-style",document.head.appendChild(e);var t=e.sheet,n=I.getElement();try{n&&(n.id?t.insertRule("#"+n.id+"::cue {background: transparent}",0):0!==n.classList.length?t.insertRule("."+n.className+"::cue {background: transparent}",0):t.insertRule("video::cue {background: transparent}",0))}catch(e){r.info(""+e.message)}}}function G(){var e=document.getElementById("native-cue-style");e&&document.head.removeChild(e)}function H(){if(y)for(;y.firstChild;)y.removeChild(y.firstChild)}return t={initialize:function(){"undefined"!=typeof window&&"undefined"!=typeof navigator&&(o=window.VTTCue||window.TextTrackCue,c=[],f=[],d=-1,h=0,g=0,p=0,m=0,y=null,E=null,v=!1,S=2147483647,T=null,void 0!==document.fullscreenElement?_="fullscreenElement":void 0!==document.webkitIsFullScreen?_="webkitIsFullScreen":document.msFullscreenElement?_="msFullscreenElement":document.mozFullScreen&&(_="mozFullScreen"))},getStreamId:function(){return C.id},addTextTrack:function(e){c.push(e)},addCaptions:P,createTracks:function(){c.sort(function(e,t){return e.index-t.index}),y=I.getTTMLRenderingDiv();for(var e=-1,t=0;t<c.length;t++){var r=w(c[t]);f.push(r),c[t].defaultTrack&&(r.default=!0,e=t);var a=L(t);a&&(a.mode=n.default.TEXT_SHOWING,y&&(c[t].isTTML||c[t].isEmbedded)?a.renderingType="html":a.renderingType="default"),P(t,0,c[t].captionData),R.trigger(s.default.TEXT_TRACK_ADDED)}if(F.call(this,e),e>=0){R.on(s.default.PLAYBACK_METADATA_LOADED,function t(){var r=L(e);r&&"html"===r.renderingType&&D.call(this,r,!0),R.off(s.default.PLAYBACK_METADATA_LOADED,t,this)},this);for(var o=0;o<c.length;o++){var u=L(o);u&&(u.mode=o===e?n.default.TEXT_SHOWING:n.default.TEXT_HIDDEN)}}R.trigger(i.default.TEXT_TRACKS_QUEUE_INITIALIZED,{index:d,tracks:c,streamId:C.id})},getCurrentTrackIdx:function(){return d},setCurrentTrackIdx:F,getTrackIdxForId:function(e){for(var t=-1,r=0;r<c.length;r++)if(c[r].id===e){t=r;break}return t},getCurrentTrackInfo:function(){return c[d]},setModeForTrackIdx:function(e,t){var r=L(e);r&&r.mode!==t&&(r.mode=t)},deleteCuesFromTrackIdx:function(e,t,r){var n=L(e);n&&B(n,t,r)},deleteAllTextTracks:function(){for(var e=f?f.length:0,t=0;t<e;t++){var r=L(t);r&&B.call(this,r,C.start,C.start+C.duration)}f=[],c=[],E&&(clearInterval(E),E=null),b&&I&&(b.unobserve(I.getElement()),b=null),d=-1,H.call(this)},deleteTextTrack:function(e){I.removeChild(f[e]),f.splice(e,1)}},r=Object(u.default)(A).getInstance().getLogger(t),t}c.__dashjs_factory_name="TextTracks",t.default=o.default.getClassFactory(c)},"./src/streaming/thumbnail/ThumbnailController.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/streaming/constants/Constants.js"),i=r("./src/streaming/vo/Thumbnail.js"),s=r("./src/streaming/thumbnail/ThumbnailTracks.js"),o=r("./src/streaming/vo/BitrateInfo.js"),u=r("./src/dash/utils/SegmentsUtils.js");function l(e){var t,r,n=this.context,l=e.streamInfo;function c(e){r.setTrackByIndex(e)}function f(){r&&r.reset()}return t={getStreamId:function(){return l.id},initialize:function(){r.addTracks();var e=r.getTracks();e&&e.length>0&&c(0)},provide:function(e,t){if("function"==typeof t){var n,a,s=r.getCurrentTrack();if(!s||s.segmentDuration<=0||null==e)t(null);else{(a=r.getThumbnailRequestForTime(e))&&(s.segmentDuration=a.duration),n=e%s.segmentDuration;var o=Math.floor(n*s.tilesHor*s.tilesVert/s.segmentDuration),l=new i.default;if(l.width=Math.floor(s.widthPerTile),l.height=Math.floor(s.heightPerTile),l.x=Math.floor(o%s.tilesHor)*s.widthPerTile,l.y=Math.floor(o/s.tilesHor)*s.heightPerTile,"readThumbnail"in s)return s.readThumbnail(e,function(e){l.url=e,t(l)});if(a)l.url=a.url,s.segmentDuration=NaN;else{var c=Math.floor(e/s.segmentDuration);l.url=function(e,t){var r=t+e.startNumber,n=Object(u.replaceTokenForTemplate)(e.templateUrl,"Number",r);return n=Object(u.replaceTokenForTemplate)(n,"Time",(r-1)*e.segmentDuration*e.timescale),n=Object(u.replaceTokenForTemplate)(n,"Bandwidth",e.bandwidth),Object(u.unescapeDollarsInTemplate)(n)}(s,c)}t(l)}}},setTrackByIndex:c,getCurrentTrackIndex:function(){return r.getCurrentTrackIndex()},getBitrateList:function(){var e=r.getTracks(),t=0;return e.map(function(e){var r=new o.default;return r.mediaType=a.default.IMAGE,r.qualityIndex=t++,r.bitrate=e.bitrate,r.width=e.width,r.height=e.height,r})},reset:f},f(),r=Object(s.default)(n).create({streamInfo:l,adapter:e.adapter,baseURLController:e.baseURLController,timelineConverter:e.timelineConverter,debug:e.debug,eventBus:e.eventBus,events:e.events,dashConstants:e.dashConstants,dashMetrics:e.dashMetrics,segmentBaseController:e.segmentBaseController}),t}l.__dashjs_factory_name="ThumbnailController",t.default=n.default.getClassFactory(l)},"./src/streaming/thumbnail/ThumbnailTracks.js":function(e,t,r){r.r(t),r.d(t,"THUMBNAILS_SCHEME_ID_URIS",function(){return h});var n=r("./src/streaming/constants/Constants.js"),a=r("./src/dash/constants/DashConstants.js"),i=r("./src/core/FactoryMaker.js"),s=r("./src/streaming/vo/ThumbnailTrackInfo.js"),o=r("./src/streaming/utils/URLUtils.js"),u=r("./src/dash/utils/SegmentsUtils.js"),l=r("./src/streaming/utils/BoxParser.js"),c=r("./src/streaming/net/XHRLoader.js"),f=r("./src/dash/DashHandler.js"),d=r("./src/dash/controllers/SegmentsController.js"),h=["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"];function g(e){var t,r,i,g,p,m,y,E,_=this.context,v=e.adapter,T=e.baseURLController,S=e.streamInfo,b=e.timelineConverter,A=e.debug,R=e.eventBus,I=e.events,C=e.dashConstants,w=Object(o.default)(_).getInstance();function N(e,t){var n=new s.default;n.id=e.id,n.bitrate=e.bandwidth,n.width=e.width,n.height=e.height,n.tilesHor=1,n.tilesVert=1,e.essentialProperties&&e.essentialProperties.forEach(function(e){if(h.indexOf(e.schemeIdUri)>=0&&e.value){var t=e.value.split("x");2!==t.length||isNaN(t[0])||isNaN(t[1])||(n.tilesHor=parseInt(t[0],10),n.tilesVert=parseInt(t[1],10))}}),t?m.updateSegmentData(e).then(function(t){!function(e,t,r){var n=[],a=function(e,t){var r,n,a,i,s=[],o=0;for(r=0,n=e.segments.length;r<n;r++)a=e.segments[r],(i=Object(u.getTimeBasedSegment)(b,v.getIsDynamic(),t,a.startTime,a.duration,a.timescale,a.media,a.mediaRange,o))&&(s.push(i),i=null,o++);return s}(r,t);t.segments=a,e.segmentDuration=t.segments[0].duration,e.readThumbnail=function(e,r){var a=null;n.some(function(t){if(t.start<=e&&t.end>e)return a=t.url,!0}),a?r(a):t.segments.some(function(a){if(a.mediaStartTime<=e&&a.mediaStartTime+a.duration>e){var i=T.resolve(t.path);return y.load({method:"get",url:i.url,request:{range:a.mediaRange,responseType:"arraybuffer"},onload:function(e){var t=E.getSamplesInfo(e.target.response),i=new Blob([e.target.response.slice(t.sampleList[0].offset,t.sampleList[0].offset+t.sampleList[0].size)],{type:"image/jpeg"}),s=window.URL.createObjectURL(i);n.push({start:a.mediaStartTime,end:a.mediaStartTime+a.duration,url:s}),r&&r(s)}}),!0}})}}(n,e,t)}):(n.startNumber=e.startNumber,n.segmentDuration=e.segmentDuration,n.timescale=e.timescale,n.templateUrl=function(e){var t=w.isRelative(e.media)?w.resolve(e.media,T.resolve(e.path).url):e.media;return t?Object(u.replaceIDForTemplate)(t,e.id):""}(e)),n.tilesHor>0&&n.tilesVert>0&&(n.widthPerTile=n.width/n.tilesHor,n.heightPerTile=n.height/n.tilesVert,r.push(n))}function D(){r=[],g=-1,p=null}return t={getTracks:function(){return r},addTracks:function(){if(S&&v&&(p=v.getMediaInfoForType(S,n.default.IMAGE))){var e=v.getVoRepresentations(p);e&&e.length>0&&e.forEach(function(e){(e.segmentInfoType===a.default.SEGMENT_TEMPLATE&&e.segmentDuration>0&&e.media||e.segmentInfoType===a.default.SEGMENT_TIMELINE)&&N(e),e.segmentInfoType===a.default.SEGMENT_BASE&&N(e,!0)}),r.length>0&&r.sort(function(e,t){return e.bitrate-t.bitrate})}},reset:D,setTrackByIndex:function(e){r&&0!==r.length&&(e>=r.length&&(e=r.length-1),g=e)},getCurrentTrack:function(){return g<0?null:r[g]},getCurrentTrackIndex:function(){return g},getThumbnailRequestForTime:function(e){for(var t,n=v.getVoRepresentations(p),a=0;a<n.length;a++)if(r[g].id===n[a].id){t=n[a];break}return i.getSegmentRequestForTime(p,t,e)}},D(),y=Object(c.default)(_).create({}),E=Object(l.default)(_).getInstance(),m=Object(d.default)(_).create({events:I,eventBus:R,streamInfo:S,timelineConverter:b,dashConstants:C,dashMetrics:e.dashMetrics,segmentBaseController:e.segmentBaseController,type:n.default.IMAGE}),(i=Object(f.default)(_).create({streamInfo:S,type:n.default.IMAGE,timelineConverter:b,segmentsController:m,baseURLController:T,debug:A,eventBus:R,events:I,dashConstants:C,urlUtils:w})).initialize(!!v&&v.getIsDynamic()),t}g.__dashjs_factory_name="ThumbnailTracks",t.default=i.default.getClassFactory(g)},"./src/streaming/utils/BaseURLSelector.js":function(e,t,r){r.r(t);var n=r("./src/core/errors/Errors.js"),a=r("./src/core/EventBus.js"),i=r("./src/core/events/Events.js"),s=r("./src/streaming/controllers/BlacklistController.js"),o=r("./src/streaming/utils/baseUrlResolution/DVBSelector.js"),u=r("./src/streaming/utils/baseUrlResolution/BasicSelector.js"),l=r("./src/core/FactoryMaker.js"),c=r("./src/streaming/vo/DashJSError.js"),f=r("./src/streaming/utils/SupervisorTools.js");function d(){var e,t,r,l,d,h=this.context,g=Object(a.default)(h).getInstance();function p(){t.reset()}return e={chooseSelector:function(e){Object(f.checkParameterType)(e,"boolean"),d=e?l:r},select:function(e){if(e){var t=e.baseUrls,a=e.selectedIdx;if(!isNaN(a))return t[a];var s=d.select(t);return s?(e.selectedIdx=t.indexOf(s),s):(g.trigger(i.default.URL_RESOLUTION_FAILED,{error:new c.default(n.default.URL_RESOLUTION_FAILED_GENERIC_ERROR_CODE,n.default.URL_RESOLUTION_FAILED_GENERIC_ERROR_MESSAGE)}),void(d===r&&p()))}},reset:p,setConfig:function(e){e.selector&&(d=e.selector)}},t=Object(s.default)(h).create({updateEventName:i.default.SERVICE_LOCATION_BLACKLIST_CHANGED,addBlacklistEventName:i.default.SERVICE_LOCATION_BLACKLIST_ADD}),r=Object(u.default)(h).create({blacklistController:t}),l=Object(o.default)(h).create({blacklistController:t}),d=r,e}d.__dashjs_factory_name="BaseURLSelector",t.default=l.default.getClassFactory(d)},"./src/streaming/utils/BoxParser.js":function(e,t,r){r.r(t);var n=r("./src/core/Debug.js"),a=r("./src/streaming/utils/IsoFile.js"),i=r("./src/core/FactoryMaker.js"),s=r("./node_modules/codem-isoboxer/dist/iso_boxer.js"),o=r.n(s),u=r("./src/streaming/vo/IsoBoxSearchInfo.js");function l(){var e,t,r=this.context;function i(e){if(!e)return null;void 0===e.fileStart&&(e.fileStart=0);var t=o.a.parseBuffer(e),n=Object(a.default)(r).create();return n.setData(t),n}function s(e,t){return e[t+3]>>>0|e[t+2]<<8>>>0|e[t+1]<<16>>>0|e[t]<<24>>>0}function l(e,t){return String.fromCharCode(e[t++])+String.fromCharCode(e[t++])+String.fromCharCode(e[t++])+String.fromCharCode(e[t])}return t={parse:i,findLastTopIsoBoxCompleted:function(e,t,r){if(void 0===r&&(r=0),!t||r+8>=t.byteLength)return new u.default(0,!1);for(var n,a=t instanceof ArrayBuffer?new Uint8Array(t):t,i=0;r<a.byteLength;){var o=s(a,r),c=l(a,r+4);if(0===o)break;r+o<=a.byteLength&&(e.indexOf(c)>=0?n=new u.default(r,!0,o):i=r+o),r+=o}return n||new u.default(i,!1)},getMediaTimescaleFromMoov:function(e){var t=i(e),r=t?t.getBox("mdhd"):void 0;return r?r.timescale:NaN},getSamplesInfo:function(e){if(!e||0===e.byteLength)return{sampleList:[],lastSequenceNumber:NaN,totalDuration:NaN,numSequences:NaN};var t,r,n,a,s,o,u,l,c,f,d,h,g,p,m,y,E=i(e),_=E.getBoxes("moof"),v=E.getBoxes("mfhd");m=E.getBoxes("moof").length,p=v[v.length-1].sequence_number,r=0,s=[];var T=-1,S=-1;for(f=0;f<_.length;f++){var b=_[f],A=b.getChildBoxes("traf");for(l=0;l<A.length;l++){var R=A[l],I=R.getChildBox("tfhd"),C=R.getChildBox("tfdt");a=C.baseMediaDecodeTime;var w=R.getChildBoxes("trun"),N=R.getChildBoxes("subs");for(c=0;c<w.length;c++){var D=w[c];for(r=D.sample_count,g=(I.base_data_offset||0)+(D.data_offset||0),u=0;u<r;u++){t=void 0!==(o=D.samples[u]).sample_duration?o.sample_duration:I.default_sample_duration,n=void 0!==o.sample_size?o.sample_size:I.default_sample_size;var M={dts:a,cts:a+(void 0!==o.sample_composition_time_offset?o.sample_composition_time_offset:0),duration:t,offset:b.offset+g,size:n,subSizes:[n]};if(N)for(d=0;d<N.length;d++){var O=N[d];if(T<O.entry_count-1&&u>S&&(T++,S+=O.entries[T].sample_delta),u==S){M.subSizes=[];var P=O.entries[T];for(h=0;h<P.subsample_count;h++)M.subSizes.push(P.subsamples[h].subsample_size)}}s.push(M),g+=n,a+=t}}y=a-C.baseMediaDecodeTime}}return{sampleList:s,lastSequenceNumber:p,totalDuration:y,numSequences:m}},findInitRange:function(t){var r=null,n=i(t);if(!n)return r;var a=n.getBox("ftyp"),s=n.getBox("moov");return e.debug("Searching for initialization."),s&&s.isComplete&&(r=(a?a.offset:s.offset)+"-"+(s.offset+s.size-1),e.debug("Found the initialization. Range: "+r)),r},parsePayload:function(e,t,r){if(void 0===r&&(r=0),!t||r+8>=t.byteLength)return new u.default(0,!1);for(var n,a=t instanceof ArrayBuffer?new Uint8Array(t):t,i=0;r<a.byteLength;){var o=s(a,r),c=l(a,r+4);if(0===o)break;r+o<=a.byteLength&&(e.indexOf(c)>=0?n=new u.default(r,!0,o,c):i=r+o),r+=o}return n||new u.default(i,!1)}},e=Object(n.default)(r).getInstance().getLogger(t),t}l.__dashjs_factory_name="BoxParser",t.default=i.default.getSingletonFactory(l)},"./src/streaming/utils/Capabilities.js":function(e,t,r){r.r(t),r.d(t,"supportsMediaSource",function(){return o});var n=r("./src/core/FactoryMaker.js"),a=r("./src/streaming/thumbnail/ThumbnailTracks.js"),i=r("./src/streaming/constants/Constants.js"),s=[{codec:"avc1",compatibleCodecs:["avc3"]},{codec:"avc3",compatibleCodecs:["avc1"]}];function o(){var e="WebKitMediaSource"in window,t="MediaSource"in window;return e||t}function u(){var e,t,r;return e={setConfig:function(e){e&&e.settings&&(t=e.settings)},supportsMediaSource:o,supportsEncryptedMedia:function(){return r},supportsCodec:function(e,r){return r!==i.default.AUDIO&&r!==i.default.VIDEO?Promise.resolve(!0):function(e,r){return t.get().streaming.capabilities.useMediaCapabilitiesApi&&navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo&&(e.codec&&r===i.default.AUDIO||r===i.default.VIDEO&&e.codec&&e.width&&e.height&&e.bitrate&&e.framerate)}(e,r)?function(e,t){return new Promise(function(r){if(e&&e.codec){var n={type:"media-source"};n[t]={},n[t].contentType=e.codec,n[t].width=e.width,n[t].height=e.height,n[t].bitrate=parseInt(e.bitrate),n[t].framerate=parseFloat(e.framerate),navigator.mediaCapabilities.decodingInfo(n).then(function(e){r(e.supported)}).catch(function(){r(!1)})}else r(!1)})}(e,r):function(e){return new Promise(function(t){if(e&&e.codec){var r=e.codec;e.width&&e.height&&(r+=';width="'+e.width+'";height="'+e.height+'"'),"MediaSource"in window&&MediaSource.isTypeSupported(r)||"WebKitMediaSource"in window&&WebKitMediaSource.isTypeSupported(r)?t(!0):t(!1)}else t(!1)})}(e)},setEncryptedMediaSupported:function(e){r=e},supportsEssentialProperty:function(e){try{return-1!==a.THUMBNAILS_SCHEME_ID_URIS.indexOf(e.schemeIdUri)}catch(e){return!0}},codecRootCompatibleWithCodec:function(e,t){for(var r,n=e.split(".")[0],a=0===t.indexOf(n),i=0;i<s.length;i++)if(s[i].codec===n){r=s[i];break}return r?a||r.compatibleCodecs.some(function(e){return 0===t.indexOf(e)}):a}},r=!1,e}u.__dashjs_factory_name="Capabilities",t.default=n.default.getSingletonFactory(u)},"./src/streaming/utils/CapabilitiesFilter.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/core/Debug.js"),i=r("./src/streaming/constants/Constants.js");function s(){var e,t,r,n,s,o,u=this.context;function l(e,n){if(!n||!n.Period_asArray||0===n.Period_asArray.length)return Promise.resolve();var a=[];return n.Period_asArray.forEach(function(n){a.push(function(e,n){return new Promise(function(a){if(e&&e.AdaptationSet_asArray&&0!==e.AdaptationSet_asArray.length){var o=[];e.AdaptationSet_asArray.forEach(function(e){t.getIsTypeOf(e,n)&&o.push(function(e,n){return new Promise(function(a){if(e.Representation_asArray&&0!==e.Representation_asArray.length){var o=[],u=[];e.Representation_asArray.forEach(function(a,s){var l=t.getCodec(e,s,!1),c=function(e,t,r){switch(e){case i.default.VIDEO:return function(e,t){return{codec:t,width:e.width||null,height:e.height||null,framerate:e.frameRate||null,bitrate:e.bandwidth||null}}(t,r);case i.default.AUDIO:return function(e,t){var r=e.audioSamplingRate||null;return{codec:t,bitrate:e.bandwidth||null,samplerate:r}}(t,r);default:return null}}(n,a,l);u.push(c),o.push(r.supportsCodec(c,n))}),Promise.all(o).then(function(t){e.Representation_asArray=e.Representation_asArray.filter(function(e,r){return t[r]||s.debug("[Stream] Codec ".concat(u[r].codec," not supported ")),t[r]}),a()}).catch(function(){a()})}else a()})}(e,n))}),Promise.all(o).then(function(){e.AdaptationSet_asArray=e.AdaptationSet_asArray.filter(function(e){var t=e.Representation_asArray&&e.Representation_asArray.length>0;return t||s.warn("AdaptationSet has been removed because of no supported Representation"),t}),a()}).catch(function(){a()})}else a()})}(n,e))}),Promise.all(a)}return e={setConfig:function(e){e&&(e.adapter&&(t=e.adapter),e.capabilities&&(r=e.capabilities),e.settings&&(n=e.settings))},filterUnsupportedFeatures:function(e){return new Promise(function(a){var u=[];u.push(l(i.default.VIDEO,e)),u.push(l(i.default.AUDIO,e)),Promise.all(u).then(function(){n.get().streaming.capabilities.filterUnsupportedEssentialProperties&&function(e){e&&e.Period_asArray&&0!==e.Period_asArray.length&&e.Period_asArray.forEach(function(e){e.AdaptationSet_asArray=e.AdaptationSet_asArray.filter(function(e){return!e.Representation_asArray||0===e.Representation_asArray.length||(e.Representation_asArray=e.Representation_asArray.filter(function(e){var n=t.getEssentialPropertiesForRepresentation(e);if(n&&n.length>0)for(var a=0;a<n.length;){if(!r.supportsEssentialProperty(n[a]))return s.debug("[Stream] EssentialProperty not supported: "+n[a].schemeIdUri),!1;a+=1}return!0}),e.Representation_asArray&&e.Representation_asArray.length>0)})})}(e),function(e){o&&0!==o.length&&e&&e.Period_asArray&&0!==e.Period_asArray.length&&e.Period_asArray.forEach(function(e){e.AdaptationSet_asArray=e.AdaptationSet_asArray.filter(function(e){return!e.Representation_asArray||0===e.Representation_asArray.length||(e.Representation_asArray=e.Representation_asArray.filter(function(e){return!o.some(function(t){return!t(e)})}),e.Representation_asArray&&e.Representation_asArray.length>0)})})}(e),a()}).catch(function(){a()})})},setCustomCapabilitiesFilters:function(e){o=e}},s=Object(a.default)(u).getInstance().getLogger(e),e}s.__dashjs_factory_name="CapabilitiesFilter",t.default=n.default.getSingletonFactory(s)},"./src/streaming/utils/CustomTimeRanges.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/streaming/utils/SupervisorTools.js");function i(){return{customTimeRangeArray:[],length:0,add:function(e,t){var r=0;for(r=0;r<this.customTimeRangeArray.length&&e>this.customTimeRangeArray[r].start;r++);for(this.customTimeRangeArray.splice(r,0,{start:e,end:t}),r=0;r<this.customTimeRangeArray.length-1;r++)this.mergeRanges(r,r+1)&&r--;this.length=this.customTimeRangeArray.length},clear:function(){this.customTimeRangeArray=[],this.length=0},remove:function(e,t){for(var r=0;r<this.customTimeRangeArray.length;r++)if(e<=this.customTimeRangeArray[r].start&&t>=this.customTimeRangeArray[r].end)this.customTimeRangeArray.splice(r,1),r--;else{if(e>this.customTimeRangeArray[r].start&&t<this.customTimeRangeArray[r].end){this.customTimeRangeArray.splice(r+1,0,{start:t,end:this.customTimeRangeArray[r].end}),this.customTimeRangeArray[r].end=e;break}e>this.customTimeRangeArray[r].start&&e<this.customTimeRangeArray[r].end?this.customTimeRangeArray[r].end=e:t>this.customTimeRangeArray[r].start&&t<this.customTimeRangeArray[r].end&&(this.customTimeRangeArray[r].start=t)}this.length=this.customTimeRangeArray.length},mergeRanges:function(e,t){var r=this.customTimeRangeArray[e],n=this.customTimeRangeArray[t];return r.start<=n.start&&n.start<=r.end&&r.end<=n.end?(r.end=n.end,this.customTimeRangeArray.splice(t,1),!0):n.start<=r.start&&r.start<=n.end&&n.end<=r.end?(r.start=n.start,this.customTimeRangeArray.splice(t,1),!0):n.start<=r.start&&r.start<=n.end&&r.end<=n.end?(this.customTimeRangeArray.splice(e,1),!0):r.start<=n.start&&n.start<=r.end&&n.end<=r.end&&(this.customTimeRangeArray.splice(t,1),!0)},start:function(e){return Object(a.checkInteger)(e),e>=this.customTimeRangeArray.length||e<0?NaN:this.customTimeRangeArray[e].start},end:function(e){return Object(a.checkInteger)(e),e>=this.customTimeRangeArray.length||e<0?NaN:this.customTimeRangeArray[e].end}}}i.__dashjs_factory_name="CustomTimeRanges",t.default=n.default.getClassFactory(i)},"./src/streaming/utils/DOMStorage.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/core/Debug.js"),i=r("./src/streaming/constants/Constants.js"),s=[{oldKey:"dashjs_vbitrate",newKey:"dashjs_video_bitrate"},{oldKey:"dashjs_abitrate",newKey:"dashjs_audio_bitrate"},{oldKey:"dashjs_vsettings",newKey:"dashjs_video_settings"},{oldKey:"dashjs_asettings",newKey:"dashjs_audio_settings"}],o="dashjs_?_bitrate",u="dashjs_?_settings",l="localStorage",c="lastBitrate",f="lastMediaSettings";function d(e){e=e||{};var t,r,n,d=this.context,h=e.settings;function g(e){if(void 0!==n)return n;var t;n=!1;try{"undefined"!=typeof window&&(t=window[e])}catch(e){return r.warn("DOMStorage access denied: "+e.message),n}if(!t||e!==l&&"sessionStorage"!==e)return n;try{t.setItem("1","1"),t.removeItem("1"),n=!0}catch(e){r.warn("DOMStorage is supported, but cannot be used: "+e.message)}return n}function p(){var e=6e5;return Math.round((new Date).getTime()/e)*e}function m(e,t){return g(e)&&h.get().streaming[t+"CachingInfo"].enabled}function y(){if(!h)throw new Error(i.default.MISSING_CONFIG_ERROR)}return t={getSavedBitrateSettings:function(e){var t=NaN;if(y(),m(l,c)){var n=o.replace(/\?/,e);try{var a=JSON.parse(localStorage.getItem(n))||{},i=(new Date).getTime()-parseInt(a.timestamp,10)>=h.get().streaming.lastBitrateCachingInfo.ttl||!1,s=parseFloat(a.bitrate);isNaN(s)||i?i&&localStorage.removeItem(n):(t=s,r.debug("Last saved bitrate for "+e+" was "+s))}catch(e){return null}}return t},setSavedBitrateSettings:function(e,t){if(m(l,c)&&t){var n=o.replace(/\?/,e);try{localStorage.setItem(n,JSON.stringify({bitrate:t.toFixed(3),timestamp:p()}))}catch(e){r.error(e.message)}}},getSavedMediaSettings:function(e){var t=null;if(y(),m(l,f)){var r=u.replace(/\?/,e);try{var n=JSON.parse(localStorage.getItem(r))||{},a=(new Date).getTime()-parseInt(n.timestamp,10)>=h.get().streaming.lastMediaSettingsCachingInfo.ttl||!1;t=n.settings,a&&(localStorage.removeItem(r),t=null)}catch(e){return null}}return t},setSavedMediaSettings:function(e,t){if(m(l,f)){var n=u.replace(/\?/,e);try{localStorage.setItem(n,JSON.stringify({settings:t,timestamp:p()}))}catch(e){r.error(e.message)}}}},r=Object(a.default)(d).getInstance().getLogger(t),g(l)&&s.forEach(function(e){var t=localStorage.getItem(e.oldKey);if(t){localStorage.removeItem(e.oldKey);try{localStorage.setItem(e.newKey,t)}catch(e){r.error(e.message)}}}),t}d.__dashjs_factory_name="DOMStorage";var h=n.default.getSingletonFactory(d);t.default=h},"./src/streaming/utils/DefaultURLUtils.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js");function a(){var e,t=/^[a-z][a-z0-9+\-_.]*:/i,r=/^https?:\/\//i,n=/^https:\/\//i,a=/^([a-z][a-z0-9+\-_.]*:\/\/[^\/]+)\/?/i,i=function(e,t){try{return new window.URL(e,t).toString()}catch(t){return e}},s=function(e,t){var r=o;if(!t)return e;if(!c(e))return e;f(e)&&(r=u),d(e)&&(r=l);var n=r(t),a="/"!==n.charAt(n.length-1)&&"/"!==e.charAt(0)?"/":"";return[n,e].join(a)};function o(e){var t=e.indexOf("/"),r=e.lastIndexOf("/");return-1!==t?r===t+1?e:(-1!==e.indexOf("?")&&(e=e.substring(0,e.indexOf("?"))),e.substring(0,r+1)):""}function u(e){var t=e.match(a);return t?t[1]:""}function l(e){var r=e.match(t);return r?r[0]:""}function c(e){return!t.test(e)}function f(e){return c(e)&&"/"===e.charAt(0)}function d(e){return 0===e.indexOf("//")}return function(){try{new window.URL("x","http://y"),e=i}catch(e){}finally{e=e||s}}(),{parseBaseUrl:o,parseOrigin:u,parseScheme:l,isRelative:c,isPathAbsolute:f,isSchemeRelative:d,isHTTPURL:function(e){return r.test(e)},isHTTPS:function(e){return n.test(e)},removeHostname:function(e){return/^(?:\w+\:\/\/)?([^\/]+)(.*)$/.exec(e)[2].substring(1)},resolve:function(t,r){return e(t,r)}}}a.__dashjs_factory_name="DefaultURLUtils",t.default=n.default.getSingletonFactory(a)},"./src/streaming/utils/EBMLParser.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js");function a(e){var t;e=e||{};var r=new DataView(e.data),n=0;function a(e,t){var a=!0,i=0;if(void 0===t&&(t=!1),e.tag>16777215?(r.getUint32(n)!==e.tag&&(a=!1),i=4):e.tag>65535?(256*r.getUint16(n)+r.getUint8(n+2)!==e.tag&&(a=!1),i=3):e.tag>255?(r.getUint16(n)!==e.tag&&(a=!1),i=2):(r.getUint8(n)!==e.tag&&(a=!1),i=1),!a&&e.required&&!t)throw new Error("required tag not found");return a&&(n+=i),a}function i(e){var t=1,a=128,i=-1,s=0,o=r.getUint8(n),u=0;for(u=0;u<8;u+=1){if((o&a)===a){s=void 0===e?o&~a:o,i=u;break}a>>=1}for(u=0;u<i;u+=1,t+=1)s=s<<8|255&r.getUint8(n+t);return n+=t,s}return t={getPos:function(){return n},setPos:function(e){n=e},consumeTag:a,consumeTagAndSize:function(e,t){var r=a(e,t);return r&&i(),r},parseTag:function(e){var r;return a(e),r=i(),t[e.parse](r)},skipOverElement:function(e,t){var r,s=a(e,t);return s&&(r=i(),n+=r),s},getMatroskaCodedNum:i,getMatroskaFloat:function(e){var t;switch(e){case 4:t=r.getFloat32(n),n+=4;break;case 8:t=r.getFloat64(n),n+=8}return t},getMatroskaUint:function(e){for(var t=0,a=0;a<e;a+=1)t<<=8,t|=255&r.getUint8(n+a);return n+=e,t},moreData:function(){return n<r.byteLength}}}a.__dashjs_factory_name="EBMLParser",t.default=n.default.getClassFactory(a)},"./src/streaming/utils/ErrorHandler.js":function(e,t,r){r.r(t);var n=r("./src/core/EventBus.js"),a=r("./src/core/events/Events.js"),i=r("./src/core/FactoryMaker.js");function s(){var e=this.context,t=Object(n.default)(e).getInstance();return{error:function(e){t.trigger(a.default.ERROR,{error:e})}}}s.__dashjs_factory_name="ErrorHandler",t.default=i.default.getSingletonFactory(s)},"./src/streaming/utils/InitCache.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js");function a(){var e={};return{save:function(t){var r=t.streamId,n=t.representationId;e[r]=e[r]||{},e[r][n]=t},extract:function(t,r){return e&&e[t]&&e[t][r]?e[t][r]:null},reset:function(){e={}}}}a.__dashjs_factory_name="InitCache",t.default=n.default.getSingletonFactory(a)},"./src/streaming/utils/IsoFile.js":function(e,t,r){r.r(t);var n=r("./src/streaming/vo/IsoBox.js"),a=r("./src/core/FactoryMaker.js");function i(){var e;function t(t){var n=[];if(!t||!e||"function"!=typeof e.fetchAll)return n;for(var a,i=e.fetchAll(t),s=0,o=i.length;s<o;s++)(a=r(i[s]))&&n.push(a);return n}function r(e){if(!e)return null;var t=new n.default(e);return e.hasOwnProperty("_incomplete")&&(t.isComplete=!e._incomplete),t}return{getBox:function(t){return t&&e&&e.boxes&&0!==e.boxes.length&&"function"==typeof e.fetch?r(e.fetch(t)):null},getBoxes:t,setData:function(t){e=t},getLastBox:function(){if(!e||!e.boxes||!e.boxes.length)return null;var r=t(e.boxes[e.boxes.length-1].type);return r.length>0?r[r.length-1]:null}}}i.__dashjs_factory_name="IsoFile",t.default=a.default.getClassFactory(i)},"./src/streaming/utils/ObjectUtils.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./node_modules/fast-deep-equal/index.js"),i=r.n(a);function s(){return{areEqual:function(e,t){return i()(e,t)}}}s.__dashjs_factory_name="ObjectUtils",t.default=n.default.getSingletonFactory(s)},"./src/streaming/utils/RequestModifier.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js");function a(){return{modifyRequestURL:function(e){return e},modifyRequestHeader:function(e){return e}}}a.__dashjs_factory_name="RequestModifier",t.default=n.default.getSingletonFactory(a)},"./src/streaming/utils/SupervisorTools.js":function(e,t,r){r.r(t),r.d(t,"checkParameterType",function(){return i}),r.d(t,"checkInteger",function(){return s}),r.d(t,"checkRange",function(){return o}),r.d(t,"checkIsVideoOrAudioType",function(){return u});var n=r("./src/streaming/constants/Constants.js");function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function i(e,t){if(a(e)!==t)throw n.default.BAD_ARGUMENT_ERROR}function s(e){if(null===e||isNaN(e)||e%1!=0)throw n.default.BAD_ARGUMENT_ERROR+" : argument is not an integer"}function o(e,t,r){if(e<t||e>r)throw n.default.BAD_ARGUMENT_ERROR+" : argument out of range"}function u(e){if("string"!=typeof e||e!==n.default.AUDIO&&e!==n.default.VIDEO)throw n.default.BAD_ARGUMENT_ERROR}},"./src/streaming/utils/TTMLParser.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/core/Debug.js"),i=r("./src/core/EventBus.js"),s=r("./src/core/events/Events.js"),o=r("./node_modules/imsc/src/main/js/main.js"),u=r("./src/streaming/MediaPlayerEvents.js"),l=r("./src/streaming/constants/ConformanceViolationConstants.js");function c(){var e,t,r=this.context,n=Object(i.default)(r).getInstance(),c=0;function f(){var e="cue_TTML_"+c;return c++,e}return e={parse:function(e,r,a,i,c){var d,h,g,p="",m=[],y={},E={},_="",v="",T={onOpenTag:function(e,r,a){if(a[" imagetype"]&&!a[" imageType"]&&(n.trigger(u.default.CONFORMANCE_VIOLATION,{level:l.default.LEVELS.ERROR,event:l.default.EVENTS.NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE}),a[" imageType"]=a[" imagetype"]),"image"===r&&("http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt"===e||"http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt"===e)){if(!a[" imageType"]||"PNG"!==a[" imageType"].value)return void t.warn("smpte-tt imageType != PNG. Discarded");_=a["http://www.w3.org/XML/1998/namespace id"].value}},onCloseTag:function(){_&&(E[_]=v.trim()),v="",_=""},onText:function(e){_&&(v+=e)}};if(!e)throw p="no ttml data to parse",new Error(p);y.data=e,n.trigger(s.default.TTML_TO_PARSE,y);var S=Object(o.fromXML)(y.data,function(e){p=e},T);n.trigger(s.default.TTML_PARSED,{ttmlString:y.data,ttmlDoc:S});var b=S.getMediaTimeEvents();for(g=0;g<b.length;g++){var A=Object(o.generateISD)(S,b[g],function(e){p=e});A.contents.some(function(e){return e.contents.length})&&(d=b[g]+r<a?a:b[g]+r)<(h=b[g+1]+r>i?i:b[g+1]+r)&&m.push({start:d,end:h,type:"html",cueID:f(),isd:A,images:c,embeddedImages:E})}if(""!==p)throw t.error(p),new Error(p);return m}},t=Object(a.default)(r).getInstance().getLogger(e),e}c.__dashjs_factory_name="TTMLParser",t.default=n.default.getSingletonFactory(c)},"./src/streaming/utils/URLUtils.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/streaming/utils/DefaultURLUtils.js");function i(){var e,t=[],r=this.context;function n(r,n,a){var i=function(r){var n;for(n=0;n<t.length;n++)if(t[n].regex.test(r))return t[n].utils;return e}(a||n);return i&&"function"==typeof i[r]?i[r](n,a):e[r](n,a)}return e=Object(a.default)(r).getInstance(),{registerUrlRegex:function(e,r){t.push({regex:e,utils:r})},parseBaseUrl:function(e){return n("parseBaseUrl",e)},parseOrigin:function(e){return n("parseOrigin",e)},parseScheme:function(e){return n("parseScheme",e)},isRelative:function(e){return n("isRelative",e)},isPathAbsolute:function(e){return n("isPathAbsolute",e)},isSchemeRelative:function(e){return n("isSchemeRelative",e)},isHTTPURL:function(e){return n("isHTTPURL",e)},isHTTPS:function(e){return n("isHTTPS",e)},removeHostname:function(e){return n("removeHostname",e)},resolve:function(e,t){return n("resolve",e,t)}}}i.__dashjs_factory_name="URLUtils";var s=n.default.getSingletonFactory(i);t.default=s},"./src/streaming/utils/VTTParser.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/core/Debug.js");function i(){var e,t,r,n,i,s,o=this.context;function u(e){var t=e.split(":"),r=t.length-1;return e=60*parseInt(t[r-1],10)+parseFloat(t[r]),2===r&&(e+=3600*parseInt(t[0],10)),e}function l(e){var t=e.split(n),r=t[1].split(s);return r.shift(),t[1]=r[0],r.shift(),{cuePoints:t,styles:c(r)}}function c(e){var t={};return e.forEach(function(e){if(e.split(/:/).length>1){var r=e.split(/:/)[1];r&&-1!=r.search(/%/)&&(r=parseInt(r.replace(/%/,""),10)),(e.match(/align/)||e.match(/A/))&&(t.align=r),(e.match(/line/)||e.match(/L/))&&(t.line=r),(e.match(/position/)||e.match(/P/))&&(t.position=r),(e.match(/size/)||e.match(/S/))&&(t.size=r)}}),t}function f(e,t){for(var r,a=t,i="",s="";""!==e[a]&&a<e.length;)a++;if((r=a-t)>1)for(var o=0;o<r;o++){if((s=e[t+o]).match(n)){i="";break}i+=s,o!==r-1&&(i+="\n")}else(s=e[t]).match(n)||(i=s);return i}return e={parse:function(e){var a,s,o=[];if(!e)return o;a=(e=e.split(r)).length,s=-1;for(var c=0;c<a;c++){var d=e[c];if(d.length>0&&"WEBVTT"!==d&&d.match(n)){var h=l(d),g=h.cuePoints,p=h.styles,m=f(e,c+1),y=u(g[0].replace(i,"")),E=u(g[1].replace(i,""));!isNaN(y)&&!isNaN(E)&&y>=s&&E>y?""!==m?(s=y,o.push({start:y,end:E,data:m,styles:p})):t.error("Skipping cue due to empty/malformed cue text"):t.error("Skipping cue due to incorrect cue timing")}}return o}},t=Object(a.default)(o).getInstance().getLogger(e),r=/(?:\r\n|\r|\n)/gm,n=/-->/,i=/(^[\s]+|[\s]+$)/g,s=/\s\b/g,e}i.__dashjs_factory_name="VTTParser",t.default=n.default.getSingletonFactory(i)},"./src/streaming/utils/baseUrlResolution/BasicSelector.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js");function a(e){var t=(e=e||{}).blacklistController;return{select:function(e){var r,n=0;return e&&e.some(function(e,r){return n=r,!t.contains(e.serviceLocation)})&&(r=e[n]),r}}}a.__dashjs_factory_name="BasicSelector",t.default=n.default.getClassFactory(a)},"./src/streaming/utils/baseUrlResolution/DVBSelector.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js");function a(e){var t=(e=e||{}).blacklistController;return{select:function(e){return e&&function(e){var t,r,n=0,a=[],i=0;if((r=e.sort(function(e,t){var r=e.dvb_priority-t.dvb_priority;return isNaN(r)?0:r}).filter(function(e,t,r){return!t||r[0].dvb_priority&&e.dvb_priority&&r[0].dvb_priority===e.dvb_priority})).length)return r.length>1&&(r.forEach(function(e){n+=e.dvb_weight,a.push(n)}),t=Math.floor(Math.random()*(n-1)),a.every(function(e,r){return i=r,!(t<e)})),r[i]}((r=[],e.filter(function(e){return!t.contains(e.serviceLocation)||(e.dvb_priority&&r.push(e.dvb_priority),!1)}).filter(function(e){return!r.length||!e.dvb_priority||-1===r.indexOf(e.dvb_priority)})));var r}}}a.__dashjs_factory_name="DVBSelector",t.default=n.default.getClassFactory(a)},"./src/streaming/vo/BitrateInfo.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mediaType=null,this.bitrate=null,this.width=null,this.height=null,this.scanType=null,this.qualityIndex=NaN}},"./src/streaming/vo/DashJSError.js":function(e,t,r){r.r(t),t.default=function e(t,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.code=t||null,this.message=r||null,this.data=n||null}},"./src/streaming/vo/DataChunk.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.streamId=null,this.mediaInfo=null,this.segmentType=null,this.quality=NaN,this.index=NaN,this.bytes=null,this.start=NaN,this.end=NaN,this.duration=NaN,this.representationId=null,this.endFragment=null}},"./src/streaming/vo/FragmentRequest.js":function(e,t,r){r.r(t);var n=r("./src/streaming/vo/metrics/HTTPRequest.js");function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var i=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.action=e.ACTION_DOWNLOAD,this.startTime=NaN,this.mediaStartTime=NaN,this.mediaType=null,this.mediaInfo=null,this.type=null,this.duration=NaN,this.timescale=NaN,this.range=null,this.url=t||null,this.serviceLocation=null,this.requestStartDate=null,this.firstByteDate=null,this.requestEndDate=null,this.quality=NaN,this.index=NaN,this.availabilityStartTime=null,this.availabilityEndTime=null,this.wallStartTime=null,this.bytesLoaded=NaN,this.bytesTotal=NaN,this.delayLoadingTime=NaN,this.responseType="arraybuffer",this.representationId=null}var t,r;return t=e,(r=[{key:"isInitializationRequest",value:function(){return this.type&&this.type===n.HTTPRequest.INIT_SEGMENT_TYPE}},{key:"setInfo",value:function(e){this.type=e&&e.init?n.HTTPRequest.INIT_SEGMENT_TYPE:n.HTTPRequest.MEDIA_SEGMENT_TYPE,this.url=e&&e.url?e.url:null,this.range=e&&e.range?e.range.start+"-"+e.range.end:null,this.mediaType=e&&e.mediaType?e.mediaType:null}}])&&a(t.prototype,r),e}();i.ACTION_DOWNLOAD="download",i.ACTION_COMPLETE="complete",t.default=i},"./src/streaming/vo/HeadRequest.js":function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}r.r(t);var s=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(o,e);var t,r,s=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,a=i(t);if(r){var s=i(this).constructor;e=Reflect.construct(a,arguments,s)}else e=a.apply(this,arguments);return function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function o(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(t=s.call(this,e)).checkForExistenceOnly=!0,t}return o}(r("./src/streaming/vo/FragmentRequest.js").default);t.default=s},"./src/streaming/vo/IsoBox.js":function(e,t,r){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}r.r(t);var a=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.offset=t._offset,this.type=t.type,this.size=t.size,this.boxes=[],t.boxes)for(var r=0;r<t.boxes.length;r++)this.boxes.push(new e(t.boxes[r]));switch(this.isComplete=!0,t.type){case"sidx":if(this.timescale=t.timescale,this.earliest_presentation_time=t.earliest_presentation_time,this.first_offset=t.first_offset,this.references=t.references,t.references){this.references=[];for(var n=0;n<t.references.length;n++){var a={reference_type:t.references[n].reference_type,referenced_size:t.references[n].referenced_size,subsegment_duration:t.references[n].subsegment_duration};this.references.push(a)}}break;case"emsg":this.id=t.id,this.version=1===t.version?1:0,this.value=t.value,this.timescale=t.timescale,this.scheme_id_uri=t.scheme_id_uri,this.presentation_time_delta=1===t.version?t.presentation_time:t.presentation_time_delta,this.event_duration=t.event_duration,this.message_data=t.message_data;break;case"mdhd":this.timescale=t.timescale;break;case"mfhd":this.sequence_number=t.sequence_number;break;case"subs":this.entry_count=t.entry_count,this.entries=t.entries;break;case"tfhd":this.base_data_offset=t.base_data_offset,this.sample_description_index=t.sample_description_index,this.default_sample_duration=t.default_sample_duration,this.default_sample_size=t.default_sample_size,this.default_sample_flags=t.default_sample_flags,this.flags=t.flags;break;case"tfdt":this.version=t.version,this.baseMediaDecodeTime=t.baseMediaDecodeTime,this.flags=t.flags;break;case"trun":if(this.sample_count=t.sample_count,this.first_sample_flags=t.first_sample_flags,this.data_offset=t.data_offset,this.flags=t.flags,this.samples=t.samples,t.samples){this.samples=[];for(var i=0,s=t.samples.length;i<s;i++){var o={sample_size:t.samples[i].sample_size,sample_duration:t.samples[i].sample_duration,sample_composition_time_offset:t.samples[i].sample_composition_time_offset};this.samples.push(o)}}}}var t,r;return t=e,(r=[{key:"getChildBox",value:function(e){for(var t=0;t<this.boxes.length;t++)if(this.boxes[t].type===e)return this.boxes[t]}},{key:"getChildBoxes",value:function(e){for(var t=[],r=0;r<this.boxes.length;r++)this.boxes[r].type===e&&t.push(this.boxes[r]);return t}}])&&n(t.prototype,r),e}();t.default=a},"./src/streaming/vo/IsoBoxSearchInfo.js":function(e,t,r){r.r(t),t.default=function e(t,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.lastCompletedOffset=t,this.found=r,this.size=n}},"./src/streaming/vo/MetricsList.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.TcpList=[],this.HttpList=[],this.RepSwitchList=[],this.BufferLevel=[],this.BufferState=[],this.PlayList=[],this.DroppedFrames=[],this.SchedulingInfo=[],this.DVRInfo=[],this.ManifestUpdate=[],this.RequestsQueue=null,this.DVBErrors=[]}},"./src/streaming/vo/TextRequest.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/Constants.js");function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}var o=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(u,e);var t,r,o=(t=u,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=s(t);if(r){var i=s(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return function(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function u(e,t){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),(r=o.call(this)).url=e||null,r.type=t||null,r.mediaType=n.default.STREAM,r.responseType="",r}return u}(r("./src/streaming/vo/FragmentRequest.js").default);t.default=o},"./src/streaming/vo/TextTrackInfo.js":function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}r.r(t);var s=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(o,e);var t,r,s=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,a=i(t);if(r){var s=i(this).constructor;e=Reflect.construct(a,arguments,s)}else e=a.apply(this,arguments);return function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function o(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=s.call(this)).captionData=null,e.label=null,e.defaultTrack=!1,e.kind=null,e.isFragmented=!1,e.isEmbedded=!1,e.isTTML=null,e}return o}(r("./src/dash/vo/MediaInfo.js").default);t.default=s},"./src/streaming/vo/Thumbnail.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=null,this.width=null,this.height=null,this.x=null,this.y=null}},"./src/streaming/vo/ThumbnailTrackInfo.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.bitrate=0,this.width=0,this.height=0,this.tilesHor=0,this.tilesVert=0,this.widthPerTile=0,this.heightPerTile=0,this.startNumber=0,this.segmentDuration=0,this.timescale=0,this.templateUrl="",this.id=""}},"./src/streaming/vo/URIFragmentData.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.t=null,this.xywh=null,this.track=null,this.id=null,this.s=null,this.r=null}},"./src/streaming/vo/metrics/BufferLevel.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.t=null,this.level=null}},"./src/streaming/vo/metrics/BufferState.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/MetricsConstants.js");t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.target=null,this.state=n.default.BUFFER_EMPTY}},"./src/streaming/vo/metrics/DVRInfo.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.time=null,this.range=null,this.manifestInfo=null}},"./src/streaming/vo/metrics/DroppedFrames.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.time=null,this.droppedFrames=null}},"./src/streaming/vo/metrics/HTTPRequest.js":function(e,t,r){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}r.r(t),r.d(t,"HTTPRequest",function(){return a}),r.d(t,"HTTPRequestTrace",function(){return i});var a=function e(){n(this,e),this.tcpid=null,this.type=null,this.url=null,this.actualurl=null,this.range=null,this.trequest=null,this.tresponse=null,this.responsecode=null,this.interval=null,this.trace=[],this._stream=null,this._tfinish=null,this._mediaduration=null,this._quality=null,this._responseHeaders=null,this._serviceLocation=null},i=function e(){n(this,e),this.s=null,this.d=null,this.b=[],this.t=null};a.GET="GET",a.HEAD="HEAD",a.MPD_TYPE="MPD",a.XLINK_EXPANSION_TYPE="XLinkExpansion",a.INIT_SEGMENT_TYPE="InitializationSegment",a.INDEX_SEGMENT_TYPE="IndexSegment",a.MEDIA_SEGMENT_TYPE="MediaSegment",a.BITSTREAM_SWITCHING_SEGMENT_TYPE="BitstreamSwitchingSegment",a.MSS_FRAGMENT_INFO_SEGMENT_TYPE="FragmentInfoSegment",a.LICENSE="license",a.OTHER_TYPE="other"},"./src/streaming/vo/metrics/ManifestUpdate.js":function(e,t,r){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}r.r(t),r.d(t,"ManifestUpdate",function(){return a}),r.d(t,"ManifestUpdateStreamInfo",function(){return i}),r.d(t,"ManifestUpdateRepresentationInfo",function(){return s});var a=function e(){n(this,e),this.mediaType=null,this.type=null,this.requestTime=null,this.fetchTime=null,this.availabilityStartTime=null,this.presentationStartTime=0,this.clientTimeOffset=0,this.currentTime=null,this.buffered=null,this.latency=0,this.streamInfo=[],this.representationInfo=[]},i=function e(){n(this,e),this.id=null,this.index=null,this.start=null,this.duration=null},s=function e(){n(this,e),this.id=null,this.index=null,this.mediaType=null,this.streamIndex=null,this.presentationTimeOffset=null,this.startNumber=null,this.fragmentInfoType=null}},"./src/streaming/vo/metrics/PlayList.js":function(e,t,r){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}r.r(t),r.d(t,"PlayList",function(){return a}),r.d(t,"PlayListTrace",function(){return i});var a=function e(){n(this,e),this.start=null,this.mstart=null,this.starttype=null,this.trace=[]};a.INITIAL_PLAYOUT_START_REASON="initial_playout",a.SEEK_START_REASON="seek",a.RESUME_FROM_PAUSE_START_REASON="resume",a.METRICS_COLLECTION_START_REASON="metrics_collection_start";var i=function e(){n(this,e),this.representationid=null,this.subreplevel=null,this.start=null,this.mstart=null,this.duration=null,this.playbackspeed=null,this.stopreason=null};i.REPRESENTATION_SWITCH_STOP_REASON="representation_switch",i.REBUFFERING_REASON="rebuffering",i.USER_REQUEST_STOP_REASON="user_request",i.END_OF_PERIOD_STOP_REASON="end_of_period",i.END_OF_CONTENT_STOP_REASON="end_of_content",i.METRICS_COLLECTION_STOP_REASON="metrics_collection_end",i.FAILURE_STOP_REASON="failure"},"./src/streaming/vo/metrics/RepresentationSwitch.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.t=null,this.mt=null,this.to=null,this.lto=null}},"./src/streaming/vo/metrics/RequestsQueue.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.loadingRequests=[],this.executedRequests=[]}},"./src/streaming/vo/metrics/SchedulingInfo.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mediaType=null,this.t=null,this.type=null,this.startTime=null,this.availabilityStartTime=null,this.duration=null,this.quality=null,this.range=null,this.state=null}},0:function(e,t){},1:function(e,t){}}).default},e.exports=r()},n(i={exports:{}}),i.exports),p=(o=g)&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o;function m(e,t){var r=e.dash.mediaPlayer,n=r.getTracksFor("audio"),a=e.audioTracks();function i(e){return"dash-audio-"+e}function s(e,t){return e.find(function(e){return i(e.index)===t.id})}a.length&&t.clearTracks(["audio"]);var o=r.getCurrentTrackFor("audio");n.forEach(function(t){var r,n;if(Array.isArray(t.labels))for(var s=0;s<t.labels.length;s++)if(t.labels[s].lang&&-1!==e.language().indexOf(t.labels[s].lang.toLowerCase())){r=t.labels[s];break}r?n=r.text:Array.isArray(t.labels)&&1===t.labels.length?n=t.labels[0].text:(n=t.lang,t.roles&&t.roles.length&&(n+=" ("+t.roles.join(", ")+")")),a.addTrack(new(l().AudioTrack)({enabled:t===o,id:i(t.index),kind:t.kind||"main",label:n,language:t.lang}))});var u=function(){for(var e=0;e<a.length;e++){var t=a[e];if(t.enabled){var i=s(n,t);r.setCurrentTrack(i)}}};a.addEventListener("change",u),e.dash.mediaPlayer.on(p.MediaPlayer.events.STREAM_TEARDOWN_COMPLETE,function(){a.removeEventListener("change",u)})}function y(e,t){e.dash.mediaPlayer.on(p.MediaPlayer.events.PLAYBACK_METADATA_LOADED,m.bind(null,e,t))}function E(e,t,r){f().VTTCue&&!/\[native code\]/.test(f().VTTCue.toString())&&(f().VTTCue=!1);var n=[];if(t.featuresNativeTextTracks)l().log.error("You must pass {html: {nativeCaptions: false}} in the videojs constructor to use text tracks in videojs-contrib-dash");else{var a=e.dash.mediaPlayer;a.on(p.MediaPlayer.events.TEXT_TRACKS_ADDED,i),a.on(p.MediaPlayer.events.CAN_PLAY,function(){a.off(p.MediaPlayer.events.TEXT_TRACKS_ADDED,i)})}function i(t){t.index;var r=t.tracks;a.off(p.MediaPlayer.events.TEXT_TRACKS_ADDED,i),n.forEach(e.removeRemoteTextTrack.bind(e)),n=[],r.length&&(n=function(e,t,r){var n=[],a=r.map(function(t){var r;if(Array.isArray(t.labels))for(var n=0;n<t.labels.length;n++)if(t.labels[n].lang&&-1!==e.language().indexOf(t.labels[n].lang.toLowerCase())){r=t.labels[n];break}return{dashTrack:t,trackConfig:{label:r?r.text:Array.isArray(t.labels)&&1===t.labels.length?t.labels[0].text:t.lang||t.label,language:t.lang,srclang:t.lang,kind:t.kind}}}).map(function(t){var r=t.trackConfig,a=t.dashTrack;if(a.isTTML&&!e.getChild("TTMLTextTrackDisplay"))return null;var i=e.addRemoteTextTrack(r,!1);return n.push({textTrack:i.track,dashTrack:a}),i}).filter(function(e){return null!==e});function i(){for(var t=e.dash.mediaPlayer,a=e.textTracks(),i=-1,s=function(e){var t=a[e];if("showing"===t.mode){var s=function(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return e[r]}(n,function(e){return e.textTrack===t}),o=s?s.dashTrack:null;o&&(i=r.indexOf(o))}},o=0;o<a.length;o+=1)s(o);i!==t.getCurrentTextTrackIndex()&&t.setTextTrack(i)}return e.textTracks().on("change",i),e.dash.mediaPlayer.on(p.MediaPlayer.events.STREAM_TEARDOWN_COMPLETE,function(){e.textTracks().off("change",i)}),i(),a}(e,0,r))}}function _(e,t){return _=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},_(e,t)}function v(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var T=l().getComponent("Component"),S="#222",b={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function A(e,t,r){try{e.style[t]=r}catch(e){return}}function R(e){for(var t in e.style&&(e.style.left=null,e.style.width="100%"),e.children)R(e.children[t])}function I(e,t){var r;if(4===e.length)r=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(7!==e.length)throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");r=e.slice(1)}return"rgba("+parseInt(r.slice(0,2),16)+","+parseInt(r.slice(2,4),16)+","+parseInt(r.slice(4,6),16)+","+t+")"}var C=function(e){var t,r;function n(t,r,n){var a;a=e.call(this,t,l().mergeOptions(r,{playerOptions:{}}),n)||this;for(var i=t.getChild("TextTrackSettings").$$("select"),s=0;s<i.length;s++)a.on(i[s],"change",a.updateStyle.bind(v(a)));return t.dash.mediaPlayer.on(p.MediaPlayer.events.CAPTION_RENDERED,a.updateStyle.bind(v(a))),a}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,_(t,r);var a=n.prototype;return a.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-text-track-display-ttml"},{"aria-live":"off","aria-atomic":"true"});return t.style.position="absolute",t.style.left="0",t.style.right="0",t.style.top="0",t.style.bottom="0",t.style.margin="1.5%",t},a.updateStyle=function(e){var t=e.captionDiv;if(this.player_.textTrackSettings){var r=this.player_.textTrackSettings.getValues();if(t=t||this.player_.getChild("TTMLTextTrackDisplay").el().firstChild){R(t);for(var n=t.getElementsByTagName("span"),a=0;a<n.length;a++){var i=n[a];if(i.parentNode.style.textAlign="center",r.color&&(i.style.color=r.color),r.textOpacity&&A(i,"color",I(r.color||"#fff",r.textOpacity)),r.backgroundColor&&(i.style.backgroundColor=r.backgroundColor),r.backgroundOpacity&&A(i,"backgroundColor",I(r.backgroundColor||"#000",r.backgroundOpacity)),r.windowColor&&(r.windowOpacity?A(i.parentNode,"backgroundColor",I(r.windowColor,r.windowOpacity)):i.parent.style.backgroundColor=r.windowColor),r.edgeStyle&&("dropshadow"===r.edgeStyle?i.style.textShadow="2px 2px 3px #222, 2px 2px 4px #222, 2px 2px 5px "+S:"raised"===r.edgeStyle?i.style.textShadow="1px 1px #222, 2px 2px #222, 3px 3px "+S:"depressed"===r.edgeStyle?i.style.textShadow="1px 1px #ccc, 0 1px #ccc, -1px -1px #222, 0 -1px "+S:"uniform"===r.edgeStyle&&(i.style.textShadow="0 0 4px #222, 0 0 4px #222, 0 0 4px #222, 0 0 4px "+S)),r.fontPercent&&1!==r.fontPercent){var s=f().parseFloat(i.style.fontSize);i.style.fontSize=s*r.fontPercent+"px",i.style.height="auto",i.style.top="auto",i.style.bottom="2px"}r.fontFamily&&"default"!==r.fontFamily&&("small-caps"===r.fontFamily?i.style.fontVariant="small-caps":i.style.fontFamily=b[r.fontFamily])}}}},n}(T);l().registerComponent("TTMLTextTrackDisplay",C);var w=function(){function e(t,r,n){var a=this;if(n=n||r.options_,this.player=l()(n.playerId),this.player.dash=this.player.dash||{},this.tech_=r,this.el_=r.el(),this.elParent_=this.el_.parentNode,this.hasFiniteDuration_=!1,t.src){r.isReady_=!1,e.updateSourceData&&(l().log.warn('updateSourceData has been deprecated. Please switch to using hook("updatesource", callback).'),t=e.updateSourceData(t)),e.hooks("updatesource").forEach(function(e){t=e(t)});var i=t.src;this.keySystemOptions_=e.buildDashJSProtData(t.keySystemOptions),this.player.dash.mediaPlayer=p.MediaPlayer().create(),this.mediaPlayer_=this.player.dash.mediaPlayer,e.useVideoJSDebug&&(l().log.warn('useVideoJSDebug has been deprecated. Please switch to using hook("beforeinitialize", callback).'),e.useVideoJSDebug(this.mediaPlayer_)),e.beforeInitialize&&(l().log.warn('beforeInitialize has been deprecated. Please switch to using hook("beforeinitialize", callback).'),e.beforeInitialize(this.player,this.mediaPlayer_)),e.hooks("beforeinitialize").forEach(function(e){e(a.player,a.mediaPlayer_)}),this.mediaPlayer_.initialize(),this.retriggerError_=function(e){if("capability"===e.error&&"mediasource"===e.event)a.player.error({code:4,message:"The media cannot be played because it requires a feature that your browser does not support."});else if("manifestError"!==e.error||"createParser"!==e.event.id&&"codec"!==e.event.id&&"nostreams"!==e.event.id&&"nostreamscomposed"!==e.event.id&&"parse"!==e.event.id&&"multiplexedrep"!==e.event.id)if("mediasource"===e.error)e.event.match("MEDIA_ERR_ABORTED")?a.player.error({code:1,message:e.event}):e.event.match("MEDIA_ERR_NETWORK")?a.player.error({code:2,message:e.event}):e.event.match("MEDIA_ERR_DECODE")?a.player.error({code:3,message:e.event}):e.event.match("MEDIA_ERR_SRC_NOT_SUPPORTED")?a.player.error({code:4,message:e.event}):e.event.match("MEDIA_ERR_ENCRYPTED")?a.player.error({code:5,message:e.event}):(e.event.match("UNKNOWN"),a.player.error({code:4,message:e.event}));else if("capability"===e.error&&"encryptedmedia"===e.event)a.player.error({code:5,message:"The media cannot be played because it requires encryption features that your browser does not support."});else if("key_session"===e.error)a.player.error({code:5,message:e.event});else if("download"===e.error)a.player.error({code:2,message:"The media playback was aborted because too many consecutive download errors occurred."});else{if("mssError"!==e.error)return;a.player.error({code:3,message:e.event})}else a.player.error({code:4,message:e.event.message});setTimeout(function(){a.mediaPlayer_.reset()},10)},this.mediaPlayer_.on(p.MediaPlayer.events.ERROR,this.retriggerError_),this.getDuration_=function(e){var t=e.data.Period_asArray,r=a.hasFiniteDuration_;e.data.mediaPresentationDuration||t[t.length-1].duration?a.hasFiniteDuration_=!0:a.hasFiniteDuration_=!1,a.hasFiniteDuration_!==r&&a.player.trigger("durationchange")},this.mediaPlayer_.on(p.MediaPlayer.events.MANIFEST_LOADED,this.getDuration_),n.dash&&Object.keys(n.dash).forEach(function(e){var t;if("useTTML"!==e){var r="set"+e.charAt(0).toUpperCase()+e.slice(1),i=n.dash[e];a.mediaPlayer_.hasOwnProperty(r)&&(l().log.warn("Using dash options in videojs-contrib-dash without the set prefix has been deprecated. Change '"+e+"' to '"+r+"'"),e=r),a.mediaPlayer_.hasOwnProperty(e)?(Array.isArray(i)||(i=[i]),(t=a.mediaPlayer_)[e].apply(t,i)):l().log.warn("Warning: dash configuration option unrecognized: "+e)}}),this.mediaPlayer_.attachView(this.el_),n.dash&&n.dash.useTTML&&(this.ttmlContainer_=this.player.addChild("TTMLTextTrackDisplay"),this.mediaPlayer_.attachTTMLRenderingDiv(this.ttmlContainer_.el())),this.mediaPlayer_.setAutoPlay(!1),y.call(null,this.player,r),E.call(null,this.player,r,n),this.mediaPlayer_.setProtectionData(this.keySystemOptions_),this.mediaPlayer_.attachSource(i),this.tech_.triggerReady()}}e.buildDashJSProtData=function(e){var t={};if(!e||!Array.isArray(e))return null;for(var r=0;r<e.length;r++){var n=e[r],a=l().mergeOptions({},n.options);a.licenseUrl&&(a.serverURL=a.licenseUrl,delete a.licenseUrl),t[n.name]=a}return t};var t=e.prototype;return t.dispose=function(){this.mediaPlayer_&&(this.mediaPlayer_.off(p.MediaPlayer.events.ERROR,this.retriggerError_),this.mediaPlayer_.off(p.MediaPlayer.events.MANIFEST_LOADED,this.getDuration_),this.mediaPlayer_.reset()),this.player.dash&&delete this.player.dash,this.ttmlContainer_&&(this.ttmlContainer_.dispose(),this.player.removeChild("TTMLTextTrackDisplay"))},t.duration=function(){return this.mediaPlayer_.isDynamic()&&!this.hasFiniteDuration_?1/0:this.mediaPlayer_.duration()},e.hooks=function(t,r){return e.hooks_[t]=e.hooks_[t]||[],r&&(e.hooks_[t]=e.hooks_[t].concat(r)),e.hooks_[t]},e.hook=function(t,r){e.hooks(t,r)},e.removeHook=function(t,r){var n=e.hooks(t).indexOf(r);return-1!==n&&(e.hooks_[t]=e.hooks_[t].slice(),e.hooks_[t].splice(n,1),!0)},e}();w.hooks_={},l().DashSourceHandler=function(){return{canHandleSource:function(e){return function(e){e=JSON.parse(JSON.stringify(e)),w.updateSourceData&&(l().log.warn('updateSourceData has been deprecated. Please switch to using hook("updatesource", callback).'),e=w.updateSourceData(e)),w.hooks("updatesource").forEach(function(t){e=t(e)});var t=h().createElement("video");return!(e.keySystemOptions&&!f().navigator.requestMediaKeySystemAccess&&!t.msSetMediaKeys)}(e)?l().DashSourceHandler.canPlayType(e.type)?"probably":/\.mpd/i.test(e.src)?"maybe":"":""},handleSource:function(e,t,r){return new w(e,t,r)},canPlayType:function(e){return l().DashSourceHandler.canPlayType(e)}}},l().DashSourceHandler.canPlayType=function(e){return/^application\/dash\+xml/i.test(e)?"probably":""},f().MediaSource&&l().getTech("Html5").registerSourceHandler(l().DashSourceHandler(),0),l().Html5DashJS=w;const N=w},7509(e,t,r){var n,a=void 0!==r.g?r.g:"undefined"!=typeof window?window:{},i=r(4626);"undefined"!=typeof document?n=document:(n=a["__GLOBAL_DOCUMENT_CACHE@4"])||(n=a["__GLOBAL_DOCUMENT_CACHE@4"]=i),e.exports=n}};
|
|
2
|
+
(self.cloudinaryVideoPlayerChunkLoading=self.cloudinaryVideoPlayerChunkLoading||[]).push([[367],{7509:(e,t,r)=>{var n,a=void 0!==r.g?r.g:"undefined"!=typeof window?window:{},i=r(4626);"undefined"!=typeof document?n=document:(n=a["__GLOBAL_DOCUMENT_CACHE@4"])||(n=a["__GLOBAL_DOCUMENT_CACHE@4"]=i),e.exports=n},5204:(e,t,r)=>{var n;n="undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:{},e.exports=n},6604:(e,t,r)=>{r.r(t),r.d(t,{default:()=>N});var n,i,o,u=r(6673),l=r.n(u),c=r(5204),f=r.n(c),d=r(7509),h=r.n(d),g=(n=function(e,t){var r;window,r=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/dist/",r(r.s="./index.js")}({"./externals/base64.js":function(e,t,r){var n,i,o,u,l,c=function(e){for(var t=[],r=0;r<e.length;++r){var n=e.charCodeAt(r);n<128?t.push(n):n<2048?(t.push(192|n>>6),t.push(128|63&n)):n<65536?(t.push(224|n>>12),t.push(128|63&n>>6),t.push(128|63&n)):(t.push(240|n>>18),t.push(128|63&n>>12),t.push(128|63&n>>6),t.push(128|63&n))}return t},f=function(e){for(var t=[],r=0;r<e.length;){var n=e[r++];n<128||(n<224?(n=(31&n)<<6,n|=63&e[r++]):n<240?(n=(15&n)<<12,n|=(63&e[r++])<<6,n|=63&e[r++]):(n=(7&n)<<18,n|=(63&e[r++])<<12,n|=(63&e[r++])<<6,n|=63&e[r++])),t.push(String.fromCharCode(n))}return t.join("")},d={};n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=function(e){for(var t=0,r=[],a=0|e.length/3;0<a--;){var i=(e[t]<<16)+(e[t+1]<<8)+e[t+2];t+=3,r.push(n.charAt(63&i>>18)),r.push(n.charAt(63&i>>12)),r.push(n.charAt(63&i>>6)),r.push(n.charAt(63&i))}return 2==e.length-t?(i=(e[t]<<16)+(e[t+1]<<8),r.push(n.charAt(63&i>>18)),r.push(n.charAt(63&i>>12)),r.push(n.charAt(63&i>>6)),r.push("=")):1==e.length-t&&(i=e[t]<<16,r.push(n.charAt(63&i>>18)),r.push(n.charAt(63&i>>12)),r.push("==")),r.join("")},o=function(){for(var e=[],t=0;t<64;++t)e[n.charCodeAt(t)]=t;return e["=".charCodeAt(0)]=0,e}(),u=function(e){for(var t=0,r=[],n=0|e.length/4;0<n--;){var a=(o[e.charCodeAt(t)]<<18)+(o[e.charCodeAt(t+1)]<<12)+(o[e.charCodeAt(t+2)]<<6)+o[e.charCodeAt(t+3)];r.push(255&a>>16),r.push(255&a>>8),r.push(255&a),t+=4}return r&&("="==e.charAt(t-2)?(r.pop(),r.pop()):"="==e.charAt(t-1)&&r.pop()),r},l={encode:function(e){for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t},decode:function(e){for(var t=0;t<s.length;++t)a[t]=String.fromCharCode(a[t]);return a.join("")}},d.decodeArray=function(e){var t=u(e);return new Uint8Array(t)},d.encodeASCII=function(e){var t=l.encode(e);return i(t)},d.decodeASCII=function(e){var t=u(e);return l.decode(t)},d.encode=function(e){var t=c(e);return i(t)},d.decode=function(e){var t=u(e);return f(t)},t.decode=d.decode,t.decodeArray=d.decodeArray,t.encode=d.encode,t.encodeASCII=d.encodeASCII},"./externals/cea608-parser.js":function(e,t,r){!function(e){var t={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},r=function(e){var r=e;return t.hasOwnProperty(e)&&(r=t[e]),String.fromCharCode(r)},n=15,a=32,i={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},s={17:2,18:4,21:6,22:8,23:10,19:13,20:15},o={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},u={25:2,26:4,29:6,30:8,31:10,27:13,28:15},l=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],c={verboseFilter:{DATA:3,DEBUG:3,INFO:2,WARNING:2,TEXT:1,ERROR:0},time:null,verboseLevel:0,setTime:function(e){this.time=e},log:function(e,t){var r=this.verboseFilter[e];this.verboseLevel>=r&&console.log(this.time+" ["+e+"] "+t)}},f=function(e){for(var t=[],r=0;r<e.length;r++)t.push(e[r].toString(16));return t},d=function(e,t,r,n,a){this.foreground=e||"white",this.underline=t||!1,this.italics=r||!1,this.background=n||"black",this.flash=a||!1};d.prototype={reset:function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},setStyles:function(e){for(var t=["foreground","underline","italics","background","flash"],r=0;r<t.length;r++){var n=t[r];e.hasOwnProperty(n)&&(this[n]=e[n])}},isDefault:function(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash},equals:function(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash},copy:function(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash},toString:function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}};var h=function(e,t,r,n,a,i){this.uchar=e||" ",this.penState=new d(t,r,n,a,i)};h.prototype={reset:function(){this.uchar=" ",this.penState.reset()},setChar:function(e,t){this.uchar=e,this.penState.copy(t)},setPenState:function(e){this.penState.copy(e)},equals:function(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)},copy:function(e){this.uchar=e.uchar,this.penState.copy(e.penState)},isEmpty:function(){return" "===this.uchar&&this.penState.isDefault()}};var g=function(){this.chars=[];for(var e=0;e<a;e++)this.chars.push(new h);this.pos=0,this.currPenState=new d};g.prototype={equals:function(e){for(var t=!0,r=0;r<a;r++)if(!this.chars[r].equals(e.chars[r])){t=!1;break}return t},copy:function(e){for(var t=0;t<a;t++)this.chars[t].copy(e.chars[t])},isEmpty:function(){for(var e=!0,t=0;t<a;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e},setCursor:function(e){this.pos!==e&&(this.pos=e),this.pos<0?(c.log("ERROR","Negative cursor position "+this.pos),this.pos=0):this.pos>a&&(c.log("ERROR","Too large cursor position "+this.pos),this.pos=a)},moveCursor:function(e){var t=this.pos+e;if(e>1)for(var r=this.pos+1;r<t+1;r++)this.chars[r].setPenState(this.currPenState);this.setCursor(t)},backSpace:function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},insertChar:function(e){e>=144&&this.backSpace();var t=r(e);this.pos>=a?c.log("ERROR","Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!"):(this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1))},clearFromPos:function(e){var t;for(t=e;t<a;t++)this.chars[t].reset()},clear:function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},clearToEndOfRow:function(){this.clearFromPos(this.pos)},getTextString:function(){for(var e=[],t=!0,r=0;r<a;r++){var n=this.chars[r].uchar;" "!==n&&(t=!1),e.push(n)}return t?"":e.join("")},setPenStyles:function(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}};var p=function(){this.rows=[];for(var e=0;e<n;e++)this.rows.push(new g);this.currRow=14,this.nrRollUpRows=null,this.reset()};p.prototype={reset:function(){for(var e=0;e<n;e++)this.rows[e].clear();this.currRow=14},equals:function(e){for(var t=!0,r=0;r<n;r++)if(!this.rows[r].equals(e.rows[r])){t=!1;break}return t},copy:function(e){for(var t=0;t<n;t++)this.rows[t].copy(e.rows[t])},isEmpty:function(){for(var e=!0,t=0;t<n;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e},backSpace:function(){this.rows[this.currRow].backSpace()},clearToEndOfRow:function(){this.rows[this.currRow].clearToEndOfRow()},insertChar:function(e){this.rows[this.currRow].insertChar(e)},setPen:function(e){this.rows[this.currRow].setPenStyles(e)},moveCursor:function(e){this.rows[this.currRow].moveCursor(e)},setCursor:function(e){c.log("INFO","setCursor: "+e),this.rows[this.currRow].setCursor(e)},setPAC:function(e){c.log("INFO","pacData = "+JSON.stringify(e));var t=e.row-1;this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.currRow=t;var r=this.rows[this.currRow];if(null!==e.indent){var n=e.indent,a=Math.max(n-1,0);r.setCursor(e.indent),e.color=r.chars[a].penState.foreground}var i={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(i)},setBkgData:function(e){c.log("INFO","bkgData = "+JSON.stringify(e)),this.backSpace(),this.setPen(e),this.insertChar(32)},setRollUpRows:function(e){this.nrRollUpRows=e},rollUp:function(){if(null!==this.nrRollUpRows){c.log("TEXT",this.getDisplayText());var e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),c.log("INFO","Rolling up")}else c.log("DEBUG","roll_up but nrRollUpRows not set yet")},getDisplayText:function(e){e=e||!1;for(var t=[],r="",a=-1,i=0;i<n;i++){var s=this.rows[i].getTextString();s&&(a=i+1,e?t.push("Row "+a+': "'+s+'"'):t.push(s.trim()))}return t.length>0&&(r=e?"["+t.join(" | ")+"]":t.join("\n")),r},getTextAndFormat:function(){return this.rows}};var m=function(e,t){this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new p,this.nonDisplayedMemory=new p,this.lastOutputScreen=new p,this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null};m.prototype={modes:["MODE_ROLL-UP","MODE_POP-ON","MODE_PAINT-ON","MODE_TEXT"],reset:function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.lastCueEndTime=null},getHandler:function(){return this.outputFilter},setHandler:function(e){this.outputFilter=e},setPAC:function(e){this.writeScreen.setPAC(e)},setBkgData:function(e){this.writeScreen.setBkgData(e)},setMode:function(e){e!==this.mode&&(this.mode=e,c.log("INFO","MODE="+e),"MODE_POP-ON"==this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)},insertChars:function(e){for(var t=0;t<e.length;t++)this.writeScreen.insertChar(e[t]);var r=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";c.log("INFO",r+": "+this.writeScreen.getDisplayText(!0)),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(c.log("TEXT","DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},cc_RCL:function(){c.log("INFO","RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},cc_BS:function(){c.log("INFO","BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())},cc_AOF:function(){},cc_AON:function(){},cc_DER:function(){c.log("INFO","DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},cc_RU:function(e){c.log("INFO","RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)},cc_FON:function(){c.log("INFO","FON - Flash On"),this.writeScreen.setPen({flash:!0})},cc_RDC:function(){c.log("INFO","RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},cc_TR:function(){c.log("INFO","TR"),this.setMode("MODE_TEXT")},cc_RTD:function(){c.log("INFO","RTD"),this.setMode("MODE_TEXT")},cc_EDM:function(){c.log("INFO","EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate()},cc_CR:function(){c.log("CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate()},cc_ENM:function(){c.log("INFO","ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},cc_EOC:function(){if(c.log("INFO","EOC - End Of Caption"),"MODE_POP-ON"===this.mode){var e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,c.log("TEXT","DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate()},cc_TO:function(e){c.log("INFO","TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)},cc_MIDROW:function(e){var t={flash:!1};if(t.underline=e%2==1,t.italics=e>=46,t.italics)t.foreground="white";else{var r=Math.floor(e/2)-16;t.foreground=["white","green","blue","cyan","red","yellow","magenta"][r]}c.log("INFO","MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)},outputDataUpdate:function(){var e=c.time;null!==e&&this.outputFilter&&(this.outputFilter.updateData&&this.outputFilter.updateData(e,this.displayedMemory),null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory))},cueSplitAtTime:function(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}};var y=function(e,t,r){this.field=e||1,this.outputs=[t,r],this.channels=[new m(1,t),new m(2,r)],this.currChNr=-1,this.lastCmdA=null,this.lastCmdB=null,this.bufferedData=[],this.startTime=null,this.lastTime=null,this.dataCounters={padding:0,char:0,cmd:0,other:0}};y.prototype={getHandler:function(e){return this.channels[e].getHandler()},setHandler:function(e,t){this.channels[e].setHandler(t)},addData:function(e,t){var r,n,a,i=!1;this.lastTime=e,c.setTime(e);for(var s=0;s<t.length;s+=2)n=127&t[s],a=127&t[s+1],n>=16&&n<=31&&n===this.lastCmdA&&a===this.lastCmdB?(this.lastCmdA=null,this.lastCmdB=null,c.log("DEBUG","Repeated command ("+f([n,a])+") is dropped")):0!==n||0!==a?(c.log("DATA","["+f([t[s],t[s+1]])+"] -> ("+f([n,a])+")"),(r=this.parseCmd(n,a))||(r=this.parseMidrow(n,a)),r||(r=this.parsePAC(n,a)),r||(r=this.parseBackgroundAttributes(n,a)),r||(i=this.parseChars(n,a))&&(this.currChNr&&this.currChNr>=0?this.channels[this.currChNr-1].insertChars(i):c.log("WARNING","No channel found yet. TEXT-MODE?")),r?this.dataCounters.cmd+=2:i?this.dataCounters.char+=2:(this.dataCounters.other+=2,c.log("WARNING","Couldn't parse cleaned data "+f([n,a])+" orig: "+f([t[s],t[s+1]])))):this.dataCounters.padding+=2},parseCmd:function(e,t){var r;if(!((20===e||21===e||28===e||29===e)&&32<=t&&t<=47||(23===e||31===e)&&33<=t&&t<=35))return!1;r=20===e||21===e||23===e?1:2;var n=this.channels[r-1];return 20===e||21===e||28===e||29===e?32===t?n.cc_RCL():33===t?n.cc_BS():34===t?n.cc_AOF():35===t?n.cc_AON():36===t?n.cc_DER():37===t?n.cc_RU(2):38===t?n.cc_RU(3):39===t?n.cc_RU(4):40===t?n.cc_FON():41===t?n.cc_RDC():42===t?n.cc_TR():43===t?n.cc_RTD():44===t?n.cc_EDM():45===t?n.cc_CR():46===t?n.cc_ENM():47===t&&n.cc_EOC():n.cc_TO(t-32),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=r,!0},parseMidrow:function(e,t){var r=null;if((17===e||25===e)&&32<=t&&t<=47){if((r=17===e?1:2)!==this.currChNr)return c.log("ERROR","Mismatch channel in midrow parsing"),!1;var n=this.channels[r-1];return n.insertChars([32]),n.cc_MIDROW(t),c.log("DEBUG","MIDROW ("+f([e,t])+")"),this.lastCmdA=e,this.lastCmdB=t,!0}return!1},parsePAC:function(e,t){var r,n;if(!((17<=e&&e<=23||25<=e&&e<=31)&&64<=t&&t<=127||(16===e||24===e)&&64<=t&&t<=95))return!1;r=e<=23?1:2,n=64<=t&&t<=95?1===r?i[e]:o[e]:1===r?s[e]:u[e];var a=this.interpretPAC(n,t);return this.channels[r-1].setPAC(a),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=r,!0},interpretPAC:function(e,t){var r,n={color:null,italics:!1,indent:null,underline:!1,row:e};return r=t>95?t-96:t-64,n.underline=!(1&~r),r<=13?n.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(r/2)]:r<=15?(n.italics=!0,n.color="white"):n.indent=4*Math.floor((r-16)/2),n},parseChars:function(e,t){var n=null,a=null,i=null;if(e>=25?(n=2,i=e-8):(n=1,i=e),17<=i&&i<=19){var s;s=17===i?t+80:18===i?t+112:t+144,c.log("INFO","Special char '"+r(s)+"' in channel "+n),a=[s],this.lastCmdA=e,this.lastCmdB=t}else 32<=e&&e<=127&&(a=0===t?[e]:[e,t],this.lastCmdA=null,this.lastCmdB=null);if(a){var o=f(a);c.log("DEBUG","Char codes = "+o.join(","))}return a},parseBackgroundAttributes:function(e,t){var r,n,a;return((16===e||24===e)&&32<=t&&t<=47||(23===e||31===e)&&45<=t&&t<=47)&&(r={},16===e||24===e?(n=Math.floor((t-32)/2),r.background=l[n],t%2==1&&(r.background=r.background+"_semi")):45===t?r.background="transparent":(r.foreground="black",47===t&&(r.underline=!0)),a=e<24?1:2,this.channels[a-1].setBkgData(r),this.lastCmdA=e,this.lastCmdB=t,!0)},reset:function(){for(var e=0;e<this.channels.length;e++)this.channels[e]&&this.channels[e].reset();this.lastCmdA=null,this.lastCmdB=null},cueSplitAtTime:function(e){for(var t=0;t<this.channels.length;t++)this.channels[t]&&this.channels[t].cueSplitAtTime(e)}},e.logger=c,e.PenState=d,e.CaptionScreen=p,e.Cea608Parser=y,e.findCea608Nalus=function(e,t,r){for(var n=0,a=t,i=[],s=function(e,t,r,n){if(4!==e||t<8)return null;var a=r.getUint8(n),i=r.getUint16(n+1),s=r.getUint32(n+3),o=r.getUint8(n+7);return 181==a&&49==i&&1195456820==s&&3==o};a<t+r;){if(n=e.getUint32(a),6==(31&e.getUint8(a+4)))for(var o=a+5,u=-1;o<a+4+n-1;){u=0;for(var l=255;255===l;)u+=l=e.getUint8(o),o++;var c=0;for(l=255;255===l;)c+=l=e.getUint8(o),o++;s(u,c,e,o)&&i.push([o,c]),o+=c}a+=n+4}return i},e.extractCea608DataFromRange=function(e,t){var r=t[0],n=[[],[]];r+=8;var a=31&e.getUint8(r);r+=2;for(var i=0;i<a;i++){var s=e.getUint8(r),o=4&s,u=3&s;r++;var l=e.getUint8(r);r++;var c=e.getUint8(r);r++,o&&(127&l)+(127&c)!=0&&(0===u?(n[0].push(l),n[0].push(c)):1===u&&(n[1].push(l),n[1].push(c)))}return n}}(t)},"./externals/xml2json.js":function(e,t,r){r.r(t),t.default=function(e){void 0===(e=e||{}).escapeMode&&(e.escapeMode=!0),void 0===e.attributePrefix&&(e.attributePrefix="_"),e.arrayAccessForm=e.arrayAccessForm||"none",e.emptyNodeForm=e.emptyNodeForm||"text",void 0===e.enableToStringFunc&&(e.enableToStringFunc=!0),e.arrayAccessFormPaths=e.arrayAccessFormPaths||[],void 0===e.skipEmptyTextNodesForObj&&(e.skipEmptyTextNodesForObj=!0),void 0===e.stripWhitespaces&&(e.stripWhitespaces=!0),e.datetimeAccessFormPaths=e.datetimeAccessFormPaths||[],void 0===e.useDoubleQuotes&&(e.useDoubleQuotes=!1),e.xmlElementsFilter=e.xmlElementsFilter||[],e.jsonPropertiesFilter=e.jsonPropertiesFilter||[],void 0===e.keepCData&&(e.keepCData=!1),void 0===e.ignoreRoot&&(e.ignoreRoot=!1);function t(e){var t=e.localName;return null==t&&(t=e.baseName),null!=t&&""!=t||(t=e.nodeName),t}function r(e){return"string"==typeof e?e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):e}function n(e,t,r,n){for(var a=0;a<e.length;a++){var i=e[a];if("string"==typeof i){if(i==n)break}else if(i instanceof RegExp){if(i.test(n))break}else if("function"==typeof i&&i(t,r,n))break}return a!=e.length}function a(t,r,a){"property"===e.arrayAccessForm&&(t[r]instanceof Array?t[r+"_asArray"]=t[r]:t[r+"_asArray"]=[t[r]]),!(t[r]instanceof Array)&&e.arrayAccessFormPaths.length>0&&n(e.arrayAccessFormPaths,t,r,a)&&(t[r]=[t[r]])}function i(e){var t=e.split(/[-T:+Z]/g),r=new Date(t[0],t[1]-1,t[2]),n=t[5].split(".");if(r.setHours(t[3],t[4],n[0]),n.length>1&&r.setMilliseconds(n[1]),t[6]&&t[7]){var a=60*t[6]+Number(t[7]);a=0+("-"==(/\d\d-\d\d:\d\d$/.test(e)?"-":"+")?-1*a:a),r.setMinutes(r.getMinutes()-a-r.getTimezoneOffset())}else-1!==e.indexOf("Z",e.length-1)&&(r=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds())));return r}function s(t,r,a,i){return!(1==r&&e.xmlElementsFilter.length>0)||n(e.xmlElementsFilter,t,a,i)}function o(r,u){if(9==r.nodeType){for(var l=new Object,c=r.childNodes,f=0;f<c.length;f++)1==(h=c[f]).nodeType&&(e.ignoreRoot?l=o(h):(l={})[g=t(h)]=o(h));return l}if(1==r.nodeType){(l=new Object).__cnt=0;var d=[];for(c=r.childNodes,f=0;f<c.length;f++){var h,g=t(h=c[f]);if(8!=h.nodeType){var p=u+"."+g;if(s(l,h.nodeType,g,p))if(l.__cnt++,null==l[g]){var m=o(h,p);("#text"!=g||/[^\s]/.test(m))&&((y={})[g]=m,d.push(y)),l[g]=m,a(l,g,p)}else{var y;null!=l[g]&&(l[g]instanceof Array||(l[g]=[l[g]],a(l,g,p))),m=o(h,p),("#text"!=g||/[^\s]/.test(m))&&((y={})[g]=m,d.push(y)),l[g][l[g].length]=m}}}l.__children=d;for(var E=t(r),_=0;_<r.attributes.length;_++){var v=r.attributes[_];l.__cnt++;for(var T=v.value,S=0,b=e.matchers.length;S<b;S++){var A=e.matchers[S];A.test(v,E)&&(T=A.converter(v.value))}l[e.attributePrefix+v.name]=T}var R=function(e){return e.prefix}(r);return null!=R&&""!=R&&(l.__cnt++,l.__prefix=R),null!=l["#text"]&&(l.__text=l["#text"],l.__text instanceof Array&&(l.__text=l.__text.join("\n")),e.stripWhitespaces&&(l.__text=l.__text.trim()),delete l["#text"],"property"==e.arrayAccessForm&&delete l["#text_asArray"],l.__text=function(t,r,a){if(e.datetimeAccessFormPaths.length>0){var s=a.split(".#")[0];return n(e.datetimeAccessFormPaths,t,r,s)?i(t):t}return t}(l.__text,g,u+"."+g)),null!=l["#cdata-section"]&&(l.__cdata=l["#cdata-section"],delete l["#cdata-section"],"property"==e.arrayAccessForm&&delete l["#cdata-section_asArray"]),0==l.__cnt&&"text"==e.emptyNodeForm?l="":1==l.__cnt&&null!=l.__text?l=l.__text:1!=l.__cnt||null==l.__cdata||e.keepCData?l.__cnt>1&&null!=l.__text&&e.skipEmptyTextNodesForObj&&(e.stripWhitespaces&&""==l.__text||""==l.__text.trim())&&delete l.__text:l=l.__cdata,delete l.__cnt,!e.enableToStringFunc||null==l.__text&&null==l.__cdata||(l.toString=function(){return(null!=this.__text?this.__text:"")+(null!=this.__cdata?this.__cdata:"")}),l}if(3==r.nodeType||4==r.nodeType)return r.nodeValue}function u(t,n,a,i){var s="<"+(null!=t&&null!=t.__prefix?t.__prefix+":":"")+n;if(null!=a)for(var o=0;o<a.length;o++){var u=a[o],l=t[u];e.escapeMode&&(l=r(l)),s+=" "+u.substr(e.attributePrefix.length)+"=",e.useDoubleQuotes?s+='"'+l+'"':s+="'"+l+"'"}return s+(i?"/>":">")}function l(e,t){return"</"+(null!=e.__prefix?e.__prefix+":":"")+t+">"}function c(t,r){return"property"==e.arrayAccessForm&&(a="_asArray",-1!==(n=r.toString()).indexOf(a,n.length-8))||0==r.toString().indexOf(e.attributePrefix)||0==r.toString().indexOf("__")||t[r]instanceof Function;var n,a}function f(e){var t=0;if(e instanceof Object)for(var r in e)c(e,r)||t++;return t}function d(t,r,a){return 0==e.jsonPropertiesFilter.length||""==a||n(e.jsonPropertiesFilter,t,r,a)}function h(t){var r=[];if(t instanceof Object)for(var n in t)-1==n.toString().indexOf("__")&&0==n.toString().indexOf(e.attributePrefix)&&r.push(n);return r}function g(t){var n="";return t instanceof Object?n+=function(t){var n="";return null!=t.__cdata&&(n+="<![CDATA["+t.__cdata+"]]>"),null!=t.__text&&(e.escapeMode?n+=r(t.__text):n+=t.__text),n}(t):null!=t&&(e.escapeMode?n+=r(t):n+=t),n}function p(e,t){return""===e?t:e+"."+t}function m(e,t,r,n){var a="";if(0==e.length)a+=u(e,t,r,!0);else for(var i=0;i<e.length;i++)a+=u(e[i],t,h(e[i]),!1),a+=y(e[i],p(n,t)),a+=l(e[i],t);return a}function y(e,t){var r="";if(f(e)>0)for(var n in e)if(!c(e,n)&&(""==t||d(e,n,p(t,n)))){var a=e[n],i=h(a);null==a||null==a?r+=u(a,n,i,!0):a instanceof Object?a instanceof Array?r+=m(a,n,i,t):a instanceof Date?(r+=u(a,n,i,!1),r+=a.toISOString(),r+=l(a,n)):f(a)>0||null!=a.__text||null!=a.__cdata?(r+=u(a,n,i,!1),r+=y(a,p(t,n)),r+=l(a,n)):r+=u(a,n,i,!0):(r+=u(a,n,i,!1),r+=g(a),r+=l(a,n))}return r+g(e)}this.parseXmlString=function(e){var t;if(window.ActiveXObject||window,void 0===e)return null;if(window.DOMParser){var r=new window.DOMParser;try{(t=r.parseFromString(e,"text/xml")).getElementsByTagNameNS("*","parsererror").length>0&&(t=null)}catch(e){t=null}}else 0==e.indexOf("<?")&&(e=e.substr(e.indexOf("?>")+2)),(t=new ActiveXObject("Microsoft.XMLDOM")).async="false",t.loadXML(e);return t},this.asArray=function(e){return void 0===e||null==e?[]:e instanceof Array?e:[e]},this.toXmlDateTime=function(e){return e instanceof Date?e.toISOString():"number"==typeof e?new Date(e).toISOString():null},this.asDateTime=function(e){return"string"==typeof e?i(e):e},this.xml2json=function(e){return o(e)},this.xml_str2json=function(e){var t=this.parseXmlString(e);return null!=t?this.xml2json(t):null},this.json2xml_str=function(e){return y(e,"")},this.json2xml=function(e){var t=this.json2xml_str(e);return this.parseXmlString(t)},this.getVersion=function(){return"1.2.0"}}},"./index.js":function(e,t,r){r.r(t);var n=r("./index_mediaplayerOnly.js");r.d(t,"MediaPlayer",function(){return n.MediaPlayer});var a=r("./src/streaming/utils/Capabilities.js");r.d(t,"supportsMediaSource",function(){return a.supportsMediaSource});var i=r("./src/streaming/metrics/MetricsReporting.js");r.d(t,"MetricsReporting",function(){return i.default});var s=r("./src/streaming/protection/Protection.js");r.d(t,"Protection",function(){return s.default});var o=r("./src/streaming/MediaPlayerFactory.js");r.d(t,"MediaPlayerFactory",function(){return o.default});var u=r("./src/core/Debug.js");r.d(t,"Debug",function(){return u.default}),dashjs.Protection=s.default,dashjs.MetricsReporting=i.default,dashjs.MediaPlayerFactory=o.default,dashjs.Debug=u.default,dashjs.supportsMediaSource=a.supportsMediaSource,t.default=dashjs},"./index_mediaplayerOnly.js":function(e,t,r){r.r(t),function(e){var n=r("./src/streaming/MediaPlayer.js");r.d(t,"MediaPlayer",function(){return n.default});var a=r("./src/core/FactoryMaker.js");r.d(t,"FactoryMaker",function(){return a.default});var i=r("./src/core/Debug.js");r.d(t,"Debug",function(){return i.default});var s=r("./src/core/Version.js"),o=(r("./node_modules/es6-promise/auto.js"),"undefined"!=typeof window&&window||e),u=o.dashjs;u||(u=o.dashjs={}),u.MediaPlayer=n.default,u.FactoryMaker=a.default,u.Debug=i.default,u.Version=Object(s.getVersionString)(),t.default=u}.call(this,r("./node_modules/webpack/buildin/global.js"))},"./node_modules/base64-js/index.js":function(e,t,r){t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){for(var t,r=u(e),n=r[0],s=r[1],o=new i(function(e,t,r){return 3*(t+r)/4-r}(0,n,s)),l=0,c=s>0?n-4:n,f=0;f<c;f+=4)t=a[e.charCodeAt(f)]<<18|a[e.charCodeAt(f+1)]<<12|a[e.charCodeAt(f+2)]<<6|a[e.charCodeAt(f+3)],o[l++]=t>>16&255,o[l++]=t>>8&255,o[l++]=255&t;return 2===s&&(t=a[e.charCodeAt(f)]<<2|a[e.charCodeAt(f+1)]>>4,o[l++]=255&t),1===s&&(t=a[e.charCodeAt(f)]<<10|a[e.charCodeAt(f+1)]<<4|a[e.charCodeAt(f+2)]>>2,o[l++]=t>>8&255,o[l++]=255&t),o},t.fromByteArray=function(e){for(var t,r=e.length,a=r%3,i=[],s=16383,o=0,u=r-a;o<u;o+=s)i.push(c(e,o,o+s>u?u:o+s));return 1===a?(t=e[r-1],i.push(n[t>>2]+n[t<<4&63]+"==")):2===a&&(t=(e[r-2]<<8)+e[r-1],i.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),i.join("")};for(var n=[],a=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)n[o]=s[o],a[s.charCodeAt(o)]=o;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function c(e,t,r){for(var n,a=[],i=t;i<r;i+=3)n=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),a.push(l(n));return a.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},"./node_modules/codem-isoboxer/dist/iso_boxer.js":function(e,t,r){var n={parseBuffer:function(e){return new a(e).parse()},addBoxProcessor:function(e,t){"string"==typeof e&&"function"==typeof t&&(i.prototype._boxProcessors[e]=t)},createFile:function(){return new a},createBox:function(e,t,r){var n=i.create(e);return t&&t.append(n,r),n},createFullBox:function(e,t,r){var a=n.createBox(e,t,r);return a.version=0,a.flags=0,a},Utils:{}};n.Utils.dataViewToString=function(e,t){var r=t||"utf-8";if("undefined"!=typeof TextDecoder)return new TextDecoder(r).decode(e);var n=[],a=0;if("utf-8"===r)for(;a<e.byteLength;){var i=e.getUint8(a++);i<128||(i<224?(i=(31&i)<<6,i|=63&e.getUint8(a++)):i<240?(i=(15&i)<<12,i|=(63&e.getUint8(a++))<<6,i|=63&e.getUint8(a++)):(i=(7&i)<<18,i|=(63&e.getUint8(a++))<<12,i|=(63&e.getUint8(a++))<<6,i|=63&e.getUint8(a++))),n.push(String.fromCharCode(i))}else for(;a<e.byteLength;)n.push(String.fromCharCode(e.getUint8(a++)));return n.join("")},n.Utils.utf8ToByteArray=function(e){var t,r;if("undefined"!=typeof TextEncoder)t=(new TextEncoder).encode(e);else for(t=[],r=0;r<e.length;++r){var n=e.charCodeAt(r);n<128?t.push(n):n<2048?(t.push(192|n>>6),t.push(128|63&n)):n<65536?(t.push(224|n>>12),t.push(128|63&n>>6),t.push(128|63&n)):(t.push(240|n>>18),t.push(128|63&n>>12),t.push(128|63&n>>6),t.push(128|63&n))}return t},n.Utils.appendBox=function(e,t,r){if(t._offset=e._cursor.offset,t._root=e._root?e._root:e,t._raw=e._raw,t._parent=e,-1!==r)if(null!=r){var n,a=-1;if("number"==typeof r)a=r;else{if("string"==typeof r)n=r;else{if("object"!=typeof r||!r.type)return void e.boxes.push(t);n=r.type}for(var i=0;i<e.boxes.length;i++)if(n===e.boxes[i].type){a=i+1;break}}e.boxes.splice(a,0,t)}else e.boxes.push(t)},t.parseBuffer=n.parseBuffer,t.addBoxProcessor=n.addBoxProcessor,t.createFile=n.createFile,t.createBox=n.createBox,t.createFullBox=n.createFullBox,t.Utils=n.Utils,n.Cursor=function(e){this.offset=void 0===e?0:e};var a=function(e){this._cursor=new n.Cursor,this.boxes=[],e&&(this._raw=new DataView(e))};a.prototype.fetch=function(e){var t=this.fetchAll(e,!0);return t.length?t[0]:null},a.prototype.fetchAll=function(e,t){var r=[];return a._sweep.call(this,e,r,t),r},a.prototype.parse=function(){for(this._cursor.offset=0,this.boxes=[];this._cursor.offset<this._raw.byteLength;){var e=i.parse(this);if(void 0===e.type)break;this.boxes.push(e)}return this},a._sweep=function(e,t,r){for(var n in this.type&&this.type==e&&t.push(this),this.boxes){if(t.length&&r)return;a._sweep.call(this.boxes[n],e,t,r)}},a.prototype.write=function(){var e,t=0;for(e=0;e<this.boxes.length;e++)t+=this.boxes[e].getLength(!1);var r=new Uint8Array(t);for(this._rawo=new DataView(r.buffer),this.bytes=r,this._cursor.offset=0,e=0;e<this.boxes.length;e++)this.boxes[e].write();return r.buffer},a.prototype.append=function(e,t){n.Utils.appendBox(this,e,t)};var i=function(){this._cursor=new n.Cursor};i.parse=function(e){var t=new i;return t._offset=e._cursor.offset,t._root=e._root?e._root:e,t._raw=e._raw,t._parent=e,t._parseBox(),e._cursor.offset=t._raw.byteOffset+t._raw.byteLength,t},i.create=function(e){var t=new i;return t.type=e,t.boxes=[],t},i.prototype._boxContainers=["dinf","edts","mdia","meco","mfra","minf","moof","moov","mvex","stbl","strk","traf","trak","tref","udta","vttc","sinf","schi","encv","enca"],i.prototype._boxProcessors={},i.prototype._procField=function(e,t,r){this._parsing?this[e]=this._readField(t,r):this._writeField(t,r,this[e])},i.prototype._procFieldArray=function(e,t,r,n){var a;if(this._parsing)for(this[e]=[],a=0;a<t;a++)this[e][a]=this._readField(r,n);else for(a=0;a<this[e].length;a++)this._writeField(r,n,this[e][a])},i.prototype._procFullBox=function(){this._procField("version","uint",8),this._procField("flags","uint",24)},i.prototype._procEntries=function(e,t,r){var n;if(this._parsing)for(this[e]=[],n=0;n<t;n++)this[e].push({}),r.call(this,this[e][n]);else for(n=0;n<t;n++)r.call(this,this[e][n])},i.prototype._procSubEntries=function(e,t,r,n){var a;if(this._parsing)for(e[t]=[],a=0;a<r;a++)e[t].push({}),n.call(this,e[t][a]);else for(a=0;a<r;a++)n.call(this,e[t][a])},i.prototype._procEntryField=function(e,t,r,n){this._parsing?e[t]=this._readField(r,n):this._writeField(r,n,e[t])},i.prototype._procSubBoxes=function(e,t){var r;if(this._parsing)for(this[e]=[],r=0;r<t;r++)this[e].push(i.parse(this));else for(r=0;r<t;r++)this._rawo?this[e][r].write():this.size+=this[e][r].getLength()},i.prototype._readField=function(e,t){switch(e){case"uint":return this._readUint(t);case"int":return this._readInt(t);case"template":return this._readTemplate(t);case"string":return-1===t?this._readTerminatedString():this._readString(t);case"data":return this._readData(t);case"utf8":return this._readUTF8String();default:return-1}},i.prototype._readInt=function(e){var t=null,r=this._cursor.offset-this._raw.byteOffset;switch(e){case 8:t=this._raw.getInt8(r);break;case 16:t=this._raw.getInt16(r);break;case 32:t=this._raw.getInt32(r);break;case 64:var n=this._raw.getInt32(r),a=this._raw.getInt32(r+4);t=n*Math.pow(2,32)+a}return this._cursor.offset+=e>>3,t},i.prototype._readUint=function(e){var t,r,n=null,a=this._cursor.offset-this._raw.byteOffset;switch(e){case 8:n=this._raw.getUint8(a);break;case 16:n=this._raw.getUint16(a);break;case 24:n=((t=this._raw.getUint16(a))<<8)+(r=this._raw.getUint8(a+2));break;case 32:n=this._raw.getUint32(a);break;case 64:t=this._raw.getUint32(a),r=this._raw.getUint32(a+4),n=t*Math.pow(2,32)+r}return this._cursor.offset+=e>>3,n},i.prototype._readString=function(e){for(var t="",r=0;r<e;r++){var n=this._readUint(8);t+=String.fromCharCode(n)}return t},i.prototype._readTemplate=function(e){return this._readUint(e/2)+this._readUint(e/2)/Math.pow(2,e/2)},i.prototype._readTerminatedString=function(){for(var e="";this._cursor.offset-this._offset<this._raw.byteLength;){var t=this._readUint(8);if(0===t)break;e+=String.fromCharCode(t)}return e},i.prototype._readData=function(e){var t=e>0?e:this._raw.byteLength-(this._cursor.offset-this._offset);if(t>0){var r=new Uint8Array(this._raw.buffer,this._cursor.offset,t);return this._cursor.offset+=t,r}return null},i.prototype._readUTF8String=function(){var e=this._raw.byteLength-(this._cursor.offset-this._offset),t=null;return e>0&&(t=new DataView(this._raw.buffer,this._cursor.offset,e),this._cursor.offset+=e),t?n.Utils.dataViewToString(t):t},i.prototype._parseBox=function(){if(this._parsing=!0,this._cursor.offset=this._offset,this._offset+8>this._raw.buffer.byteLength)this._root._incomplete=!0;else{switch(this._procField("size","uint",32),this._procField("type","string",4),1===this.size&&this._procField("largesize","uint",64),"uuid"===this.type&&this._procFieldArray("usertype",16,"uint",8),this.size){case 0:this._raw=new DataView(this._raw.buffer,this._offset,this._raw.byteLength-this._cursor.offset+8);break;case 1:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.largesize);break;default:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.size)}this._incomplete||(this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type)?this._parseContainerBox():this._data=this._readData())}},i.prototype._parseFullBox=function(){this.version=this._readUint(8),this.flags=this._readUint(24)},i.prototype._parseContainerBox=function(){for(this.boxes=[];this._cursor.offset-this._raw.byteOffset<this._raw.byteLength;)this.boxes.push(i.parse(this))},i.prototype.append=function(e,t){n.Utils.appendBox(this,e,t)},i.prototype.getLength=function(){if(this._parsing=!1,this._rawo=null,this.size=0,this._procField("size","uint",32),this._procField("type","string",4),1===this.size&&this._procField("largesize","uint",64),"uuid"===this.type&&this._procFieldArray("usertype",16,"uint",8),this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type))for(var e=0;e<this.boxes.length;e++)this.size+=this.boxes[e].getLength();return this._data&&this._writeData(this._data),this.size},i.prototype.write=function(){switch(this._parsing=!1,this._cursor.offset=this._parent._cursor.offset,this.size){case 0:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.parent._rawo.byteLength-this._cursor.offset);break;case 1:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.largesize);break;default:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.size)}if(this._procField("size","uint",32),this._procField("type","string",4),1===this.size&&this._procField("largesize","uint",64),"uuid"===this.type&&this._procFieldArray("usertype",16,"uint",8),this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type))for(var e=0;e<this.boxes.length;e++)this.boxes[e].write();return this._data&&this._writeData(this._data),this._parent._cursor.offset+=this.size,this.size},i.prototype._writeInt=function(e,t){if(this._rawo){var r=this._cursor.offset-this._rawo.byteOffset;switch(e){case 8:this._rawo.setInt8(r,t);break;case 16:this._rawo.setInt16(r,t);break;case 32:this._rawo.setInt32(r,t);break;case 64:var n=Math.floor(t/Math.pow(2,32)),a=t-n*Math.pow(2,32);this._rawo.setUint32(r,n),this._rawo.setUint32(r+4,a)}this._cursor.offset+=e>>3}else this.size+=e>>3},i.prototype._writeUint=function(e,t){if(this._rawo){var r,n,a=this._cursor.offset-this._rawo.byteOffset;switch(e){case 8:this._rawo.setUint8(a,t);break;case 16:this._rawo.setUint16(a,t);break;case 24:r=(16776960&t)>>8,n=255&t,this._rawo.setUint16(a,r),this._rawo.setUint8(a+2,n);break;case 32:this._rawo.setUint32(a,t);break;case 64:n=t-(r=Math.floor(t/Math.pow(2,32)))*Math.pow(2,32),this._rawo.setUint32(a,r),this._rawo.setUint32(a+4,n)}this._cursor.offset+=e>>3}else this.size+=e>>3},i.prototype._writeString=function(e,t){for(var r=0;r<e;r++)this._writeUint(8,t.charCodeAt(r))},i.prototype._writeTerminatedString=function(e){if(0!==e.length){for(var t=0;t<e.length;t++)this._writeUint(8,e.charCodeAt(t));this._writeUint(8,0)}},i.prototype._writeTemplate=function(e,t){var r=Math.floor(t),n=(t-r)*Math.pow(2,e/2);this._writeUint(e/2,r),this._writeUint(e/2,n)},i.prototype._writeData=function(e){if(e)if(this._rawo){if(e instanceof Array){for(var t=this._cursor.offset-this._rawo.byteOffset,r=0;r<e.length;r++)this._rawo.setInt8(t+r,e[r]);this._cursor.offset+=e.length}e instanceof Uint8Array&&(this._root.bytes.set(e,this._cursor.offset),this._cursor.offset+=e.length)}else this.size+=e.length},i.prototype._writeUTF8String=function(e){var t=n.Utils.utf8ToByteArray(e);if(this._rawo)for(var r=new DataView(this._rawo.buffer,this._cursor.offset,t.length),a=0;a<t.length;a++)r.setUint8(a,t[a]);else this.size+=t.length},i.prototype._writeField=function(e,t,r){switch(e){case"uint":this._writeUint(t,r);break;case"int":this._writeInt(t,r);break;case"template":this._writeTemplate(t,r);break;case"string":-1==t?this._writeTerminatedString(r):this._writeString(t,r);break;case"data":this._writeData(r);break;case"utf8":this._writeUTF8String(r)}},i.prototype._boxProcessors.avc1=i.prototype._boxProcessors.encv=function(){this._procFieldArray("reserved1",6,"uint",8),this._procField("data_reference_index","uint",16),this._procField("pre_defined1","uint",16),this._procField("reserved2","uint",16),this._procFieldArray("pre_defined2",3,"uint",32),this._procField("width","uint",16),this._procField("height","uint",16),this._procField("horizresolution","template",32),this._procField("vertresolution","template",32),this._procField("reserved3","uint",32),this._procField("frame_count","uint",16),this._procFieldArray("compressorname",32,"uint",8),this._procField("depth","uint",16),this._procField("pre_defined3","int",16),this._procField("config","data",-1)},i.prototype._boxProcessors.dref=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},i.prototype._boxProcessors.elst=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,function(e){this._procEntryField(e,"segment_duration","uint",1===this.version?64:32),this._procEntryField(e,"media_time","int",1===this.version?64:32),this._procEntryField(e,"media_rate_integer","int",16),this._procEntryField(e,"media_rate_fraction","int",16)})},i.prototype._boxProcessors.emsg=function(){this._procFullBox(),1==this.version?(this._procField("timescale","uint",32),this._procField("presentation_time","uint",64),this._procField("event_duration","uint",32),this._procField("id","uint",32),this._procField("scheme_id_uri","string",-1),this._procField("value","string",-1)):(this._procField("scheme_id_uri","string",-1),this._procField("value","string",-1),this._procField("timescale","uint",32),this._procField("presentation_time_delta","uint",32),this._procField("event_duration","uint",32),this._procField("id","uint",32)),this._procField("message_data","data",-1)},i.prototype._boxProcessors.free=i.prototype._boxProcessors.skip=function(){this._procField("data","data",-1)},i.prototype._boxProcessors.frma=function(){this._procField("data_format","uint",32)},i.prototype._boxProcessors.ftyp=i.prototype._boxProcessors.styp=function(){this._procField("major_brand","string",4),this._procField("minor_version","uint",32);var e=-1;this._parsing&&(e=(this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset))/4),this._procFieldArray("compatible_brands",e,"string",4)},i.prototype._boxProcessors.hdlr=function(){this._procFullBox(),this._procField("pre_defined","uint",32),this._procField("handler_type","string",4),this._procFieldArray("reserved",3,"uint",32),this._procField("name","string",-1)},i.prototype._boxProcessors.mdat=function(){this._procField("data","data",-1)},i.prototype._boxProcessors.mdhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("timescale","uint",32),this._procField("duration","uint",1==this.version?64:32),this._parsing||"string"!=typeof this.language||(this.language=this.language.charCodeAt(0)-96<<10|this.language.charCodeAt(1)-96<<5|this.language.charCodeAt(2)-96),this._procField("language","uint",16),this._parsing&&(this.language=String.fromCharCode(96+(this.language>>10&31),96+(this.language>>5&31),96+(31&this.language))),this._procField("pre_defined","uint",16)},i.prototype._boxProcessors.mehd=function(){this._procFullBox(),this._procField("fragment_duration","uint",1==this.version?64:32)},i.prototype._boxProcessors.mfhd=function(){this._procFullBox(),this._procField("sequence_number","uint",32)},i.prototype._boxProcessors.mfro=function(){this._procFullBox(),this._procField("mfra_size","uint",32)},i.prototype._boxProcessors.mp4a=i.prototype._boxProcessors.enca=function(){this._procFieldArray("reserved1",6,"uint",8),this._procField("data_reference_index","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procField("channelcount","uint",16),this._procField("samplesize","uint",16),this._procField("pre_defined","uint",16),this._procField("reserved3","uint",16),this._procField("samplerate","template",32),this._procField("esds","data",-1)},i.prototype._boxProcessors.mvhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("timescale","uint",32),this._procField("duration","uint",1==this.version?64:32),this._procField("rate","template",32),this._procField("volume","template",16),this._procField("reserved1","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procFieldArray("matrix",9,"template",32),this._procFieldArray("pre_defined",6,"uint",32),this._procField("next_track_ID","uint",32)},i.prototype._boxProcessors.payl=function(){this._procField("cue_text","utf8")},i.prototype._boxProcessors.pssh=function(){this._procFullBox(),this._procFieldArray("SystemID",16,"uint",8),this._procField("DataSize","uint",32),this._procFieldArray("Data",this.DataSize,"uint",8)},i.prototype._boxProcessors.schm=function(){this._procFullBox(),this._procField("scheme_type","uint",32),this._procField("scheme_version","uint",32),1&this.flags&&this._procField("scheme_uri","string",-1)},i.prototype._boxProcessors.sdtp=function(){this._procFullBox();var e=-1;this._parsing&&(e=this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset)),this._procFieldArray("sample_dependency_table",e,"uint",8)},i.prototype._boxProcessors.sidx=function(){this._procFullBox(),this._procField("reference_ID","uint",32),this._procField("timescale","uint",32),this._procField("earliest_presentation_time","uint",1==this.version?64:32),this._procField("first_offset","uint",1==this.version?64:32),this._procField("reserved","uint",16),this._procField("reference_count","uint",16),this._procEntries("references",this.reference_count,function(e){this._parsing||(e.reference=(1&e.reference_type)<<31,e.reference|=2147483647&e.referenced_size,e.sap=(1&e.starts_with_SAP)<<31,e.sap|=(3&e.SAP_type)<<28,e.sap|=268435455&e.SAP_delta_time),this._procEntryField(e,"reference","uint",32),this._procEntryField(e,"subsegment_duration","uint",32),this._procEntryField(e,"sap","uint",32),this._parsing&&(e.reference_type=e.reference>>31&1,e.referenced_size=2147483647&e.reference,e.starts_with_SAP=e.sap>>31&1,e.SAP_type=e.sap>>28&7,e.SAP_delta_time=268435455&e.sap)})},i.prototype._boxProcessors.smhd=function(){this._procFullBox(),this._procField("balance","uint",16),this._procField("reserved","uint",16)},i.prototype._boxProcessors.ssix=function(){this._procFullBox(),this._procField("subsegment_count","uint",32),this._procEntries("subsegments",this.subsegment_count,function(e){this._procEntryField(e,"ranges_count","uint",32),this._procSubEntries(e,"ranges",e.ranges_count,function(e){this._procEntryField(e,"level","uint",8),this._procEntryField(e,"range_size","uint",24)})})},i.prototype._boxProcessors.stsd=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},i.prototype._boxProcessors.subs=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,function(e){this._procEntryField(e,"sample_delta","uint",32),this._procEntryField(e,"subsample_count","uint",16),this._procSubEntries(e,"subsamples",e.subsample_count,function(e){this._procEntryField(e,"subsample_size","uint",1===this.version?32:16),this._procEntryField(e,"subsample_priority","uint",8),this._procEntryField(e,"discardable","uint",8),this._procEntryField(e,"codec_specific_parameters","uint",32)})})},i.prototype._boxProcessors.tenc=function(){this._procFullBox(),this._procField("default_IsEncrypted","uint",24),this._procField("default_IV_size","uint",8),this._procFieldArray("default_KID",16,"uint",8)},i.prototype._boxProcessors.tfdt=function(){this._procFullBox(),this._procField("baseMediaDecodeTime","uint",1==this.version?64:32)},i.prototype._boxProcessors.tfhd=function(){this._procFullBox(),this._procField("track_ID","uint",32),1&this.flags&&this._procField("base_data_offset","uint",64),2&this.flags&&this._procField("sample_description_offset","uint",32),8&this.flags&&this._procField("default_sample_duration","uint",32),16&this.flags&&this._procField("default_sample_size","uint",32),32&this.flags&&this._procField("default_sample_flags","uint",32)},i.prototype._boxProcessors.tfra=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._parsing||(this.reserved=0,this.reserved|=(48&this.length_size_of_traf_num)<<4,this.reserved|=(12&this.length_size_of_trun_num)<<2,this.reserved|=3&this.length_size_of_sample_num),this._procField("reserved","uint",32),this._parsing&&(this.length_size_of_traf_num=(48&this.reserved)>>4,this.length_size_of_trun_num=(12&this.reserved)>>2,this.length_size_of_sample_num=3&this.reserved),this._procField("number_of_entry","uint",32),this._procEntries("entries",this.number_of_entry,function(e){this._procEntryField(e,"time","uint",1===this.version?64:32),this._procEntryField(e,"moof_offset","uint",1===this.version?64:32),this._procEntryField(e,"traf_number","uint",8*(this.length_size_of_traf_num+1)),this._procEntryField(e,"trun_number","uint",8*(this.length_size_of_trun_num+1)),this._procEntryField(e,"sample_number","uint",8*(this.length_size_of_sample_num+1))})},i.prototype._boxProcessors.tkhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("track_ID","uint",32),this._procField("reserved1","uint",32),this._procField("duration","uint",1==this.version?64:32),this._procFieldArray("reserved2",2,"uint",32),this._procField("layer","uint",16),this._procField("alternate_group","uint",16),this._procField("volume","template",16),this._procField("reserved3","uint",16),this._procFieldArray("matrix",9,"template",32),this._procField("width","template",32),this._procField("height","template",32)},i.prototype._boxProcessors.trex=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._procField("default_sample_description_index","uint",32),this._procField("default_sample_duration","uint",32),this._procField("default_sample_size","uint",32),this._procField("default_sample_flags","uint",32)},i.prototype._boxProcessors.trun=function(){this._procFullBox(),this._procField("sample_count","uint",32),1&this.flags&&this._procField("data_offset","int",32),4&this.flags&&this._procField("first_sample_flags","uint",32),this._procEntries("samples",this.sample_count,function(e){256&this.flags&&this._procEntryField(e,"sample_duration","uint",32),512&this.flags&&this._procEntryField(e,"sample_size","uint",32),1024&this.flags&&this._procEntryField(e,"sample_flags","uint",32),2048&this.flags&&this._procEntryField(e,"sample_composition_time_offset",1===this.version?"int":"uint",32)})},i.prototype._boxProcessors["url "]=i.prototype._boxProcessors["urn "]=function(){this._procFullBox(),"urn "===this.type&&this._procField("name","string",-1),this._procField("location","string",-1)},i.prototype._boxProcessors.vlab=function(){this._procField("source_label","utf8")},i.prototype._boxProcessors.vmhd=function(){this._procFullBox(),this._procField("graphicsmode","uint",16),this._procFieldArray("opcolor",3,"uint",16)},i.prototype._boxProcessors.vttC=function(){this._procField("config","utf8")},i.prototype._boxProcessors.vtte=function(){}},"./node_modules/core-util-is/lib/util.js":function(e,t,r){(function(e){function r(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===r(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===r(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===r(e)},t.isError=function(e){return"[object Error]"===r(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,r("./node_modules/node-libs-browser/node_modules/buffer/index.js").Buffer)},"./node_modules/es6-promise/auto.js":function(e,t,r){e.exports=r("./node_modules/es6-promise/dist/es6-promise.js").polyfill()},"./node_modules/es6-promise/dist/es6-promise.js":function(e,t,r){(function(t,r){var n;n=function(){function e(e){return"function"==typeof e}var n=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},a=0,i=void 0,s=void 0,o=function(e,t){g[a]=e,g[a+1]=t,2===(a+=2)&&(s?s(p):v())},u="undefined"!=typeof window?window:void 0,l=u||{},c=l.MutationObserver||l.WebKitMutationObserver,f="undefined"==typeof self&&void 0!==t&&"[object process]"==={}.toString.call(t),d="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function h(){var e=setTimeout;return function(){return e(p,1)}}var g=new Array(1e3);function p(){for(var e=0;e<a;e+=2)(0,g[e])(g[e+1]),g[e]=void 0,g[e+1]=void 0;a=0}var m,y,E,_,v=void 0;function T(e,t){var r=this,n=new this.constructor(A);void 0===n[b]&&x(n);var a=r._state;if(a){var i=arguments[a-1];o(function(){return F(a,n,i,r._result)})}else P(r,n,e,t);return n}function S(e){if(e&&"object"==typeof e&&e.constructor===this)return e;var t=new this(A);return N(t,e),t}f?v=function(){return t.nextTick(p)}:c?(y=0,E=new c(p),_=document.createTextNode(""),E.observe(_,{characterData:!0}),v=function(){_.data=y=++y%2}):d?((m=new MessageChannel).port1.onmessage=p,v=function(){return m.port2.postMessage(0)}):v=void 0===u?function(){try{var e=Function("return this")().require("vertx");return void 0!==(i=e.runOnLoop||e.runOnContext)?function(){i(p)}:h()}catch(e){return h()}}():h();var b=Math.random().toString(36).substring(2);function A(){}var R=void 0,I=1,C=2;function w(t,r,n){r.constructor===t.constructor&&n===T&&r.constructor.resolve===S?function(e,t){t._state===I?M(e,t._result):t._state===C?O(e,t._result):P(t,void 0,function(t){return N(e,t)},function(t){return O(e,t)})}(t,r):void 0===n?M(t,r):e(n)?function(e,t,r){o(function(e){var n=!1,a=function(r,a){try{r.call(a,function(r){n||(n=!0,t!==r?N(e,r):M(e,r))},function(t){n||(n=!0,O(e,t))})}catch(e){return e}}(r,t,0,0,e._label);!n&&a&&(n=!0,O(e,a))},e)}(t,r,n):M(t,r)}function N(e,t){if(e===t)O(e,new TypeError("You cannot resolve a promise with itself"));else if(a=typeof(n=t),null===n||"object"!==a&&"function"!==a)M(e,t);else{var r=void 0;try{r=t.then}catch(t){return void O(e,t)}w(e,t,r)}var n,a}function D(e){e._onerror&&e._onerror(e._result),L(e)}function M(e,t){e._state===R&&(e._result=t,e._state=I,0!==e._subscribers.length&&o(L,e))}function O(e,t){e._state===R&&(e._state=C,e._result=t,o(D,e))}function P(e,t,r,n){var a=e._subscribers,i=a.length;e._onerror=null,a[i]=t,a[i+I]=r,a[i+C]=n,0===i&&e._state&&o(L,e)}function L(e){var t=e._subscribers,r=e._state;if(0!==t.length){for(var n=void 0,a=void 0,i=e._result,s=0;s<t.length;s+=3)n=t[s],a=t[s+r],n?F(r,n,a,i):a(i);e._subscribers.length=0}}function F(t,r,n,a){var i=e(n),s=void 0,o=void 0,u=!0;if(i){try{s=n(a)}catch(e){u=!1,o=e}if(r===s)return void O(r,new TypeError("A promises callback cannot return that same promise."))}else s=a;r._state!==R||(i&&u?N(r,s):!1===u?O(r,o):t===I?M(r,s):t===C&&O(r,s))}var j=0;function x(e){e[b]=j++,e._state=void 0,e._result=void 0,e._subscribers=[]}var k=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(A),this.promise[b]||x(this.promise),n(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?M(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&M(this.promise,this._result))):O(this.promise,new Error("Array Methods must be provided an Array"))}return e.prototype._enumerate=function(e){for(var t=0;this._state===R&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var r=this._instanceConstructor,n=r.resolve;if(n===S){var a=void 0,i=void 0,s=!1;try{a=e.then}catch(e){s=!0,i=e}if(a===T&&e._state!==R)this._settledAt(e._state,t,e._result);else if("function"!=typeof a)this._remaining--,this._result[t]=e;else if(r===B){var o=new r(A);s?O(o,i):w(o,e,a),this._willSettleAt(o,t)}else this._willSettleAt(new r(function(t){return t(e)}),t)}else this._willSettleAt(n(e),t)},e.prototype._settledAt=function(e,t,r){var n=this.promise;n._state===R&&(this._remaining--,e===C?O(n,r):this._result[t]=r),0===this._remaining&&M(n,this._result)},e.prototype._willSettleAt=function(e,t){var r=this;P(e,void 0,function(e){return r._settledAt(I,t,e)},function(e){return r._settledAt(C,t,e)})},e}(),B=function(){function t(e){this[b]=j++,this._result=this._state=void 0,this._subscribers=[],A!==e&&("function"!=typeof e&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof t?function(e,t){try{t(function(t){N(e,t)},function(t){O(e,t)})}catch(t){O(e,t)}}(this,e):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return t.prototype.catch=function(e){return this.then(null,e)},t.prototype.finally=function(t){var r=this,n=r.constructor;return e(t)?r.then(function(e){return n.resolve(t()).then(function(){return e})},function(e){return n.resolve(t()).then(function(){throw e})}):r.then(t,t)},t}();return B.prototype.then=T,B.all=function(e){return new k(this,e).promise},B.race=function(e){var t=this;return n(e)?new t(function(r,n){for(var a=e.length,i=0;i<a;i++)t.resolve(e[i]).then(r,n)}):new t(function(e,t){return t(new TypeError("You must pass an array to race."))})},B.resolve=S,B.reject=function(e){var t=new this(A);return O(t,e),t},B._setScheduler=function(e){s=e},B._setAsap=function(e){o=e},B._asap=o,B.polyfill=function(){var e=void 0;if(void 0!==r)e=r;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var n=null;try{n=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===n&&!t.cast)return}e.Promise=B},B.Promise=B,B},e.exports=n()}).call(this,r("./node_modules/process/browser.js"),r("./node_modules/webpack/buildin/global.js"))},"./node_modules/fast-deep-equal/index.js":function(e,t,r){var n=Array.isArray,a=Object.keys,i=Object.prototype.hasOwnProperty;e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){var s,o,u,l=n(t),c=n(r);if(l&&c){if((o=t.length)!=r.length)return!1;for(s=o;0!==s--;)if(!e(t[s],r[s]))return!1;return!0}if(l!=c)return!1;var f=t instanceof Date,d=r instanceof Date;if(f!=d)return!1;if(f&&d)return t.getTime()==r.getTime();var h=t instanceof RegExp,g=r instanceof RegExp;if(h!=g)return!1;if(h&&g)return t.toString()==r.toString();var p=a(t);if((o=p.length)!==a(r).length)return!1;for(s=o;0!==s--;)if(!i.call(r,p[s]))return!1;for(s=o;0!==s--;)if(!e(t[u=p[s]],r[u]))return!1;return!0}return t!=t&&r!=r}},"./node_modules/ieee754/index.js":function(e,t){t.read=function(e,t,r,n,a){var i,s,o=8*a-n-1,u=(1<<o)-1,l=u>>1,c=-7,f=r?a-1:0,d=r?-1:1,h=e[t+f];for(f+=d,i=h&(1<<-c)-1,h>>=-c,c+=o;c>0;i=256*i+e[t+f],f+=d,c-=8);for(s=i&(1<<-c)-1,i>>=-c,c+=n;c>0;s=256*s+e[t+f],f+=d,c-=8);if(0===i)i=1-l;else{if(i===u)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,n),i-=l}return(h?-1:1)*s*Math.pow(2,i-n)},t.write=function(e,t,r,n,a,i){var s,o,u,l=8*i-a-1,c=(1<<l)-1,f=c>>1,d=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,g=n?1:-1,p=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=c?(o=0,s=c):s+f>=1?(o=(t*u-1)*Math.pow(2,a),s+=f):(o=t*Math.pow(2,f-1)*Math.pow(2,a),s=0));a>=8;e[r+h]=255&o,h+=g,o/=256,a-=8);for(s=s<<a|o,l+=a;l>0;e[r+h]=255&s,h+=g,s/=256,l-=8);e[r+h-g]|=128*p}},"./node_modules/imsc/src/main/js/doc.js":function(e,t,r){!function(e,t,r,n,a){function i(e,t,r,n){var a=n&&"seq"===n.timeContainer,s=0;n&&(s=a&&r?r.end:n.begin),t.begin=t.explicit_begin?t.explicit_begin+s:s;var o=t.begin,u=null;for(var l in t.sets)i(e,t.sets[l],u,t),o="seq"===t.timeContainer?t.sets[l].end:Math.max(o,t.sets[l].end),u=t.sets[l];if("contents"in t)for(var c in t.contents)i(e,t.contents[c],u,t),o="seq"===t.timeContainer?t.contents[c].end:Math.max(o,t.contents[c].end),u=t.contents[c];else o=a?t.begin:Number.POSITIVE_INFINITY;null!==t.explicit_end&&null!==t.explicit_dur?t.end=Math.min(t.begin+t.explicit_dur,s+t.explicit_end):null===t.explicit_end&&null!==t.explicit_dur?t.end=t.begin+t.explicit_dur:null!==t.explicit_end&&null===t.explicit_dur?t.end=s+t.explicit_end:t.end=o,delete t.explicit_begin,delete t.explicit_dur,delete t.explicit_end,e._registerEvent(t)}function s(e){this.node=e}function o(){this.events=[],this.head=null,this.body=null}function u(){this.styling=null,this.layout=null}function l(){this.styles={}}function c(){this.id=null,this.styleAttrs=null,this.styleRefs=null}function f(){this.regions={}}function d(e){this.kind=e}function h(e){this.id=e}function g(e){this.regionID=e}function p(e){this.styleAttrs=e}function m(e){this.sets=e}function y(e){this.contents=e}function E(e,t,r){this.explicit_begin=e,this.explicit_end=t,this.explicit_dur=r}function _(){d.call(this,"body")}function v(){d.call(this,"div")}function T(){d.call(this,"p")}function S(){d.call(this,"span")}function b(){d.call(this,"span")}function A(){d.call(this,"br")}function R(){}function I(){}function C(e){return e&&"xml:id"in e.attributes&&e.attributes["xml:id"].value||null}function w(e){return e&&"style"in e.attributes?e.attributes.style.value.split(" "):[]}function N(e,t){var r={};if(null!==e)for(var a in e.attributes){var i=e.attributes[a].uri+" "+e.attributes[a].local,s=n.byQName[i];if(void 0!==s){var o=s.parse(e.attributes[a].value);null!==o?(r[i]=o,s===n.byName.zIndex&&F(t,"zIndex attribute present but not used by IMSC1 since regions do not overlap")):j(t,"Cannot parse styling attribute "+i+" --\x3e "+e.attributes[a].value)}}return r}function D(e,t,r){for(var n in e.attributes)if(e.attributes[n].uri===t&&e.attributes[n].local===r)return e.attributes[n].value;return null}function M(e,t,r){var n,a=null;return null!==(n=/^(\d+(?:\.\d+)?)f$/.exec(r))?null!==t&&(a=parseFloat(n[1])/t):null!==(n=/^(\d+(?:\.\d+)?)t$/.exec(r))?null!==e&&(a=parseFloat(n[1])/e):null!==(n=/^(\d+(?:\.\d+)?)ms$/.exec(r))?a=parseFloat(n[1])/1e3:null!==(n=/^(\d+(?:\.\d+)?)s$/.exec(r))?a=parseFloat(n[1]):null!==(n=/^(\d+(?:\.\d+)?)h$/.exec(r))?a=3600*parseFloat(n[1]):null!==(n=/^(\d+(?:\.\d+)?)m$/.exec(r))?a=60*parseFloat(n[1]):null!==(n=/^(\d{2,}):(\d\d):(\d\d(?:\.\d+)?)$/.exec(r))?a=3600*parseInt(n[1])+60*parseInt(n[2])+parseFloat(n[3]):null!==(n=/^(\d{2,}):(\d\d):(\d\d)\:(\d{2,})$/.exec(r))&&null!==t&&(a=3600*parseInt(n[1])+60*parseInt(n[2])+parseInt(n[3])+(null===n[4]?0:parseInt(n[4])/t)),a}function O(e,t,r){for(;t.styleRefs.length>0;){var n=t.styleRefs.pop();n in e.styles?(O(e,e.styles[n],r),L(e.styles[n].styleAttrs,t.styleAttrs)):j(r,"Non-existant style id referenced")}}function P(e,t,r,n){for(var a=t.length-1;a>=0;a--){var i=t[a];i in e.styles?L(e.styles[i].styleAttrs,r):j(n,"Non-existant style id referenced")}}function L(e,t){for(var r in e)r in t||(t[r]=e[r])}function F(e,t){if(e&&e.warn&&e.warn(t))throw t}function j(e,t){if(e&&e.error&&e.error(t))throw t}function x(e,t){throw e&&e.fatal&&e.fatal(t),t}function k(e,t){for(var r,n=0,a=e.length-1;n<=a;){var i=e[r=Math.floor((n+a)/2)];if(i<t)n=r+1;else{if(!(i>t))return{found:!0,index:r};a=r-1}}return{found:!1,index:n}}e.fromXML=function(e,n,a){var d=t.parser(!0,{xmlns:!0}),h=[],g=[],p=[],m=0,y=null;d.onclosetag=function(e){if(h[0]instanceof l)for(var t in h[0].styles)O(h[0],h[0].styles[t],n);else if(h[0]instanceof T||h[0]instanceof S){if(h[0].contents.length>1){var i,o=[h[0].contents[0]];for(i=1;i<h[0].contents.length;i++)h[0].contents[i]instanceof b&&o[o.length-1]instanceof b?o[o.length-1].text+=h[0].contents[i].text:o.push(h[0].contents[i]);h[0].contents=o}h[0]instanceof S&&1===h[0].contents.length&&h[0].contents[0]instanceof b&&(h[0].text=h[0].contents[0].text,delete h[0].contents)}else h[0]instanceof s&&(h[0].node.uri===r.ns_tt&&"metadata"===h[0].node.local?m--:m>0&&a&&"onCloseTag"in a&&a.onCloseTag());p.shift(),g.shift(),h.shift()},d.ontext=function(e){if(void 0===h[0]);else if(h[0]instanceof S||h[0]instanceof T){var t=new b;t.initFromText(y,h[0],e,p[0],n),h[0].contents.push(t)}else h[0]instanceof s&&m>0&&a&&"onText"in a&&a.onText(e)},d.onopentag=function(e){var t=e.attributes["xml:space"];t?p.unshift(t.value):0===p.length?p.unshift("default"):p.unshift(p[0]);var i=e.attributes["xml:lang"];if(i?g.unshift(i.value):0===g.length?g.unshift(""):g.unshift(g[0]),e.uri===r.ns_tt)if("tt"===e.local)null!==y&&x(n,"Two <tt> elements at ("+this.line+","+this.column+")"),(y=new o).initFromNode(e,n),h.unshift(y);else if("head"===e.local)h[0]instanceof o||x(n,"Parent of <head> element is not <tt> at ("+this.line+","+this.column+")"),null!==y.head&&x("Second <head> element at ("+this.line+","+this.column+")"),y.head=new u,h.unshift(y.head);else if("styling"===e.local)h[0]instanceof u||x(n,"Parent of <styling> element is not <head> at ("+this.line+","+this.column+")"),null!==y.head.styling&&x("Second <styling> element at ("+this.line+","+this.column+")"),y.head.styling=new l,h.unshift(y.head.styling);else if("style"===e.local){var d;h[0]instanceof l?((d=new c).initFromNode(e,n),d.id?y.head.styling.styles[d.id]=d:j(n,"<style> element missing @id attribute"),h.unshift(d)):h[0]instanceof R?((d=new c).initFromNode(e,n),L(d.styleAttrs,h[0].styleAttrs),h.unshift(d)):x(n,"Parent of <style> element is not <styling> or <region> at ("+this.line+","+this.column+")")}else if("layout"===e.local)h[0]instanceof u||x(n,"Parent of <layout> element is not <head> at "+this.line+","+this.column+")"),null!==y.head.layout&&x(n,"Second <layout> element at "+this.line+","+this.column+")"),y.head.layout=new f,h.unshift(y.head.layout);else if("region"===e.local){h[0]instanceof f||x(n,"Parent of <region> element is not <layout> at "+this.line+","+this.column+")");var E=new R;E.initFromNode(y,e,n),!E.id||E.id in y.head.layout.regions?j(n,"Ignoring <region> with duplicate or missing @id at "+this.line+","+this.column+")"):y.head.layout.regions[E.id]=E,h.unshift(E)}else if("body"===e.local){h[0]instanceof o||x(n,"Parent of <body> element is not <tt> at "+this.line+","+this.column+")"),null!==y.body&&x(n,"Second <body> element at "+this.line+","+this.column+")");var b=new _;b.initFromNode(y,e,n),y.body=b,h.unshift(b)}else if("div"===e.local){h[0]instanceof v||h[0]instanceof _||x(n,"Parent of <div> element is not <body> or <div> at "+this.line+","+this.column+")");var C=new v;C.initFromNode(y,h[0],e,n),h[0].contents.push(C),h.unshift(C)}else if("p"===e.local){h[0]instanceof v||x(n,"Parent of <p> element is not <div> at "+this.line+","+this.column+")");var w=new T;w.initFromNode(y,h[0],e,n),h[0].contents.push(w),h.unshift(w)}else if("span"===e.local){h[0]instanceof S||h[0]instanceof T||x(n,"Parent of <span> element is not <span> or <p> at "+this.line+","+this.column+")");var N=new S;N.initFromNode(y,h[0],e,p[0],n),h[0].contents.push(N),h.unshift(N)}else if("br"===e.local){h[0]instanceof S||h[0]instanceof T||x(n,"Parent of <br> element is not <span> or <p> at "+this.line+","+this.column+")");var D=new A;D.initFromNode(y,h[0],e,n),h[0].contents.push(D),h.unshift(D)}else if("set"===e.local){h[0]instanceof S||h[0]instanceof T||h[0]instanceof v||h[0]instanceof _||h[0]instanceof R||h[0]instanceof A||x(n,"Parent of <set> element is not a content element or a region at "+this.line+","+this.column+")");var M=new I;M.initFromNode(y,h[0],e,n),h[0].sets.push(M),h.unshift(M)}else h.unshift(new s(e));else h.unshift(new s(e));if(h[0]instanceof s)if(e.uri===r.ns_tt&&"metadata"===e.local)m++;else if(m>0&&a&&"onOpenTag"in a){var O=[];for(var P in e.attributes)O[e.attributes[P].uri+" "+e.attributes[P].local]={uri:e.attributes[P].uri,local:e.attributes[P].local,value:e.attributes[P].value};a.onOpenTag(e.uri,e.local,O)}},d.write(e).close(),null!==y.head?delete y.head.styling:y.head=new u,null===y.head.layout&&(y.head.layout=new f);var E=!1;for(var C in y.head.layout.regions){E=!0;break}if(!E){var w=R.prototype.createDefaultRegion();y.head.layout.regions[w.id]=w}for(var N in y.head.layout.regions)i(y,y.head.layout.regions[N],null,null);return y.body&&i(y,y.body,null,null),y},o.prototype.initFromNode=function(e,t){this.cellResolution=function(e,t){var n=D(e,r.ns_ttp,"cellResolution"),a=15,i=32;if(null!==n){var s=/(\d+) (\d+)/.exec(n);null!==s?(i=parseInt(s[1]),a=parseInt(s[2])):F(t,"Malformed cellResolution value (using initial value instead)")}return{w:i,h:a}}(e,t);var n=function(e,t){var n,a=D(e,r.ns_ttp,"frameRate"),i=30;null!==a&&(null!==(n=/(\d+)/.exec(a))?i=parseInt(n[1]):F(t,"Malformed frame rate attribute (using initial value instead)"));var s=D(e,r.ns_ttp,"frameRateMultiplier"),o=1;null!==s&&(null!==(n=/(\d+) (\d+)/.exec(s))?o=parseInt(n[1])/parseInt(n[2]):F(t,"Malformed frame rate multiplier attribute (using initial value instead)"));var u=o*i,l=1,c=D(e,r.ns_ttp,"tickRate");return null===c?null!==a&&(l=u):null!==(n=/(\d+)/.exec(c))?l=parseInt(n[1]):F(t,"Malformed tick rate attribute (using initial value instead)"),{effectiveFrameRate:u,tickRate:l}}(e,t);this.effectiveFrameRate=n.effectiveFrameRate,this.tickRate=n.tickRate,this.aspectRatio=function(e,t){var n=D(e,r.ns_ittp,"aspectRatio"),a=null;if(null!==n){var i=/(\d+) (\d+)/.exec(n);if(null!==i){var s=parseInt(i[1]),o=parseInt(i[2]);0!==s&&0!==o?a=s/o:j(t,"Illegal aspectRatio values (ignoring)")}else j(t,"Malformed aspectRatio attribute (ignoring)")}return a}(e,t);var i=D(e,r.ns_ttp,"timeBase");null!==i&&"media"!==i&&x(t,"Unsupported time base");var s=function(e,t){var n=D(e,r.ns_tts,"extent");if(null===n)return null;var i=n.split(" ");if(2!==i.length)return F(t,"Malformed extent (ignoring)"),null;var s=a.parseLength(i[0]),o=a.parseLength(i[1]);return o&&s?{h:o,w:s}:(F(t,"Malformed extent values (ignoring)"),null)}(e,t);null===s?this.pxDimensions={h:480,w:640}:("px"===s.h.unit&&"px"===s.w.unit||x(t,"Extent on TT must be in px or absent"),this.pxDimensions={h:s.h.value,w:s.w.value})},o.prototype._registerEvent=function(e){if(!(e.end<=e.begin)){var t=k(this.events,e.begin);if(t.found||this.events.splice(t.index,0,e.begin),e.end!==Number.POSITIVE_INFINITY){var r=k(this.events,e.end);r.found||this.events.splice(r.index,0,e.end)}}},o.prototype.getMediaTimeRange=function(){return[this.events[0],this.events[this.events.length-1]]},o.prototype.getMediaTimeEvents=function(){return this.events},c.prototype.initFromNode=function(e,t){this.id=C(e),this.styleAttrs=N(e,t),this.styleRefs=w(e)},h.prototype.initFromNode=function(e,t,r,n){this.id=C(r)},g.prototype.initFromNode=function(e,t,r,n){this.regionID=function(e){return e&&"region"in e.attributes?e.attributes.region.value:""}(r)},p.prototype.initFromNode=function(e,t,r,n){this.styleAttrs=N(r,n),null!==e.head&&null!==e.head.styling&&P(e.head.styling,w(r),this.styleAttrs,n)},m.prototype.initFromNode=function(e,t,r,n){this.sets=[]},y.prototype.initFromNode=function(e,t,r,n){this.contents=[]},E.prototype.initFromNode=function(e,t,r,n){var a=function(e,t,r,n){var a=null;r&&"begin"in r.attributes&&null===(a=M(e.tickRate,e.effectiveFrameRate,r.attributes.begin.value))&&F(n,"Malformed begin value "+r.attributes.begin.value+" (using 0)");var i=null;r&&"dur"in r.attributes&&null===(i=M(e.tickRate,e.effectiveFrameRate,r.attributes.dur.value))&&F(n,"Malformed dur value "+r.attributes.dur.value+" (ignoring)");var s=null;return r&&"end"in r.attributes&&null===(s=M(e.tickRate,e.effectiveFrameRate,r.attributes.end.value))&&F(n,"Malformed end value (ignoring)"),{explicit_begin:a,explicit_end:s,explicit_dur:i}}(e,0,r,n);this.explicit_begin=a.explicit_begin,this.explicit_end=a.explicit_end,this.explicit_dur=a.explicit_dur,this.timeContainer=function(e,t){var r=e&&"timeContainer"in e.attributes?e.attributes.timeContainer.value:null;return r&&"par"!==r?"seq"===r?"seq":(j(t,"Illegal value of timeContainer (assuming 'par')"),"par"):"par"}(r,n)},_.prototype.initFromNode=function(e,t,r){p.prototype.initFromNode.call(this,e,null,t,r),E.prototype.initFromNode.call(this,e,null,t,r),m.prototype.initFromNode.call(this,e,null,t,r),g.prototype.initFromNode.call(this,e,null,t,r),y.prototype.initFromNode.call(this,e,null,t,r)},v.prototype.initFromNode=function(e,t,r,n){p.prototype.initFromNode.call(this,e,t,r,n),E.prototype.initFromNode.call(this,e,t,r,n),m.prototype.initFromNode.call(this,e,t,r,n),g.prototype.initFromNode.call(this,e,t,r,n),y.prototype.initFromNode.call(this,e,t,r,n)},T.prototype.initFromNode=function(e,t,r,n){p.prototype.initFromNode.call(this,e,t,r,n),E.prototype.initFromNode.call(this,e,t,r,n),m.prototype.initFromNode.call(this,e,t,r,n),g.prototype.initFromNode.call(this,e,t,r,n),y.prototype.initFromNode.call(this,e,t,r,n)},S.prototype.initFromNode=function(e,t,r,n,a){p.prototype.initFromNode.call(this,e,t,r,a),E.prototype.initFromNode.call(this,e,t,r,a),m.prototype.initFromNode.call(this,e,t,r,a),g.prototype.initFromNode.call(this,e,t,r,a),y.prototype.initFromNode.call(this,e,t,r,a),this.space=n},b.prototype.initFromText=function(e,t,r,n,a){E.prototype.initFromNode.call(this,e,t,null,a),this.text=r,this.space=n},A.prototype.initFromNode=function(e,t,r,n){g.prototype.initFromNode.call(this,e,t,r,n),E.prototype.initFromNode.call(this,e,t,r,n)},R.prototype.createDefaultRegion=function(){var e=new R;return h.call(e,""),p.call(e,{}),m.call(e,[]),E.call(e,0,Number.POSITIVE_INFINITY,null),e},R.prototype.initFromNode=function(e,t,r){h.prototype.initFromNode.call(this,e,null,t,r),p.prototype.initFromNode.call(this,e,null,t,r),E.prototype.initFromNode.call(this,e,null,t,r),m.prototype.initFromNode.call(this,e,null,t,r),null!==e.head&&null!==e.head.styling&&P(e.head.styling,w(t),this.styleAttrs,r)},I.prototype.initFromNode=function(e,t,r,n){E.prototype.initFromNode.call(this,e,t,r,n);var a=N(r,n);for(var i in this.qname=null,this.value=null,a){if(this.qname){j(n,"More than one style specified on set");break}this.qname=i,this.value=a[i]}}}(t,"undefined"==typeof sax?r("./node_modules/sax/lib/sax.js"):sax,"undefined"==typeof imscNames?r("./node_modules/imsc/src/main/js/names.js"):imscNames,"undefined"==typeof imscStyles?r("./node_modules/imsc/src/main/js/styles.js"):imscStyles,"undefined"==typeof imscUtils?r("./node_modules/imsc/src/main/js/utils.js"):imscUtils)},"./node_modules/imsc/src/main/js/html.js":function(e,t,r){!function(e,t,r){function n(e,t,o){var l;if("region"===o.kind?(l=document.createElement("div")).style.position="absolute":"body"===o.kind||"div"===o.kind?l=document.createElement("div"):"p"===o.kind?l=document.createElement("p"):"span"===o.kind?l=document.createElement("span"):"br"===o.kind&&(l=document.createElement("br")),l){for(var c in l.style.margin="0",u){var f=u[c],d=o.styleAttrs[f.qname];void 0!==d&&null!==f.map&&f.map(e,l,o,d)}var h=l;if("region"===o.kind){var g=o.styleAttrs[r.byName.writingMode.qname];"lrtb"===g||"lr"===g?(e.ipd="lr",e.bpd="tb"):"rltb"===g||"rl"===g?(e.ipd="rl",e.bpd="tb"):"tblr"===g?(e.ipd="tb",e.bpd="lr"):"tbrl"!==g&&"tb"!==g||(e.ipd="tb",e.bpd="rl")}var p=o.styleAttrs[r.byName.linePadding.qname];if(p&&p>0){var m=Math.ceil(p*e.h)+"px";"tb"===e.bpd?(h.style.paddingLeft=m,h.style.paddingRight=m):(h.style.paddingTop=m,h.style.paddingBottom=m),e.lp=p}var y=o.styleAttrs[r.byName.multiRowAlign.qname];if(y&&"auto"!==y){var E=document.createElement("span");E.style.display="inline-block",E.style.textAlign=y,l.appendChild(E),h=E,e.mra=y}if(o.styleAttrs[r.byName.fillLineGap.qname]&&(e.flg=!0),"span"===o.kind&&o.text)if(e.lp||e.mra||e.flg)for(var _="",v=0;v<o.text.length;v++){_+=o.text.charAt(v);var T=o.text.charCodeAt(v);if(T<55296||T>56319||v===o.text.length){var S=document.createElement("span");S.textContent=_,l.appendChild(S),_=""}}else l.textContent=o.text;for(var b in t.appendChild(l),o.contents)n(e,h,o.contents[b]);var A=[];if((e.lp||e.mra||e.flg)&&"p"===o.kind&&(s(e,h,A,null),e.mra&&(function(e){for(var t=0;t<e.length-1;t++){var r=e[t].elements.length;if(0!==r&&!1===e[t].br){var n=document.createElement("br"),a=e[t].elements[r-1].node;a.parentElement.insertBefore(n,a.nextSibling)}}}(A),e.mra=null),e.lp&&(function(e,t,r){for(var n in e){var a=e[n].elements.length,i=e[n].elements[e[n].start_elem],s=e[n].elements[e[n].end_elem],o=Math.ceil(t)+"px",u="-"+Math.ceil(t)+"px";0!==a&&("lr"===r.ipd?(i.node.style.borderLeftColor=i.bgcolor||"#00000000",i.node.style.borderLeftStyle="solid",i.node.style.borderLeftWidth=o,i.node.style.marginLeft=u):"rl"===r.ipd?(i.node.style.borderRightColor=i.bgcolor||"#00000000",i.node.style.borderRightStyle="solid",i.node.style.borderRightWidth=o,i.node.style.marginRight=u):"tb"===r.ipd&&(i.node.style.borderTopColor=i.bgcolor||"#00000000",i.node.style.borderTopStyle="solid",i.node.style.borderTopWidth=o,i.node.style.marginTop=u),"lr"===r.ipd?(s.node.style.borderRightColor=s.bgcolor||"#00000000",s.node.style.borderRightStyle="solid",s.node.style.borderRightWidth=o,s.node.style.marginRight=u):"rl"===r.ipd?(s.node.style.borderLeftColor=s.bgcolor||"#00000000",s.node.style.borderLeftStyle="solid",s.node.style.borderLeftWidth=o,s.node.style.marginLeft=u):"tb"===r.ipd&&(s.node.style.borderBottomColor=s.bgcolor||"#00000000",s.node.style.borderBottomStyle="solid",s.node.style.borderBottomWidth=o,s.node.style.marginBottom=u))}}(A,e.lp*e.h,e),e.lp=null),e.flg)){var R=i(h.getBoundingClientRect(),e);!function(e,t,r,n){for(var a=Math.sign(r-t),i=0;i<=e.length;i++){var s,o,u;if(s=0===i?t:i===e.length?r:(e[i].before+e[i-1].after)/2,i>0)for(var l=0;l<e[i-1].elements.length;l++)null!==e[i-1].elements[l].bgcolor&&a*((u=e[i-1].elements[l]).after-s)<0&&(o=Math.ceil(Math.abs(s-u.after))+"px",u.node.style.backgroundColor=u.bgcolor,"lr"===n.bpd?u.node.style.paddingRight=o:"rl"===n.bpd?u.node.style.paddingLeft=o:"tb"===n.bpd&&(u.node.style.paddingBottom=o));if(i<e.length)for(var c=0;c<e[i].elements.length;c++)null!==(u=e[i].elements[c]).bgcolor&&a*(u.before-s)>0&&(o=Math.ceil(Math.abs(u.before-s))+"px",u.node.style.backgroundColor=u.bgcolor,"lr"===n.bpd?u.node.style.paddingLeft=o:"rl"===n.bpd?u.node.style.paddingRight=o:"tb"===n.bpd&&(u.node.style.paddingTop=o))}}(A,R.before,R.after,e),e.flg=null}if("region"===o.kind&&(s(e,h,A),"tb"===e.bpd&&e.enableRollUp&&o.contents.length>0&&"after"===o.styleAttrs[r.byName.displayAlign.qname])){var I=new a(""===o.id?"_":o.id,A);if(e.currentISDState[I.id]=I,e.previousISDState&&I.id in e.previousISDState&&e.previousISDState[I.id].plist.length>0&&I.plist.length>1&&I.plist[I.plist.length-2].text===e.previousISDState[I.id].plist[e.previousISDState[I.id].plist.length-1].text){var C=l.firstElementChild,w=I.plist[I.plist.length-1].after-I.plist[I.plist.length-1].before;C.style.bottom="-"+w+"px",C.style.transition="transform 0.4s",C.style.position="relative",C.style.transform="translateY(-"+w+"px)"}}}else!function(e,t){if(e&&e.error&&e.error(t))throw t}(e.errorHandler,"Error processing ISD element kind: "+o.kind)}function a(e,t){this.id=e,this.plist=t}function i(e,t){var r={before:null,after:null,start:null,end:null};return"tb"===t.bpd?(r.before=e.top,r.after=e.bottom,"lr"===t.ipd?(r.start=e.left,r.end=e.right):(r.start=e.right,r.end=e.left)):"lr"===t.bpd?(r.before=e.left,r.after=e.right,r.start=e.top,r.end=e.bottom):"rl"===t.bpd&&(r.before=e.right,r.after=e.left,r.start=e.top,r.end=e.bottom),r}function s(e,t,r,n){var a,o,u,l,c=t.style.backgroundColor||n;if(0===t.childElementCount)if("span"===t.localName){var f=t.getBoundingClientRect();if(0===f.height||0===f.width)return;var d=i(f,e);if(0!==r.length&&(a=d.before,o=d.after,u=r[r.length-1].before,o<(l=r[r.length-1].after)&&a>u||l<=o&&u>=a)){var h=Math.sign(d.after-d.before),g=Math.sign(d.end-d.start);h*(d.before-r[r.length-1].before)<0&&(r[r.length-1].before=d.before),h*(d.after-r[r.length-1].after)>0&&(r[r.length-1].after=d.after),g*(d.start-r[r.length-1].start)<0&&(r[r.length-1].start=d.start,r[r.length-1].start_elem=r[r.length-1].elements.length),g*(d.end-r[r.length-1].end)>0&&(r[r.length-1].end=d.end,r[r.length-1].end_elem=r[r.length-1].elements.length)}else r.push({before:d.before,after:d.after,start:d.start,end:d.end,start_elem:0,end_elem:0,elements:[],text:"",br:!1});r[r.length-1].text+=t.textContent,r[r.length-1].elements.push({node:t,bgcolor:c,before:d.before,after:d.after})}else"br"===t.localName&&0!==r.length&&(r[r.length-1].br=!0);else for(var p=t.firstChild;p;)p.nodeType===Node.ELEMENT_NODE&&s(e,p,r,c),p=p.nextSibling}function o(e,t){this.qname=e,this.map=t}e.render=function(e,t,r,a,i,s,o,u,l){var c=a||t.clientHeight,f=i||t.clientWidth;if(null!==e.aspectRatio){var d=c*e.aspectRatio;d>f?c=Math.round(f/e.aspectRatio):f=d}var h=document.createElement("div");h.style.position="relative",h.style.width=f+"px",h.style.height=c+"px",h.style.margin="auto",h.style.top=0,h.style.bottom=0,h.style.left=0,h.style.right=0,h.style.zIndex=0;var g={h:c,w:f,regionH:null,regionW:null,imgResolver:r,displayForcedOnlyMode:s||!1,isd:e,errorHandler:o,previousISDState:u,enableRollUp:l||!1,currentISDState:{},flg:null,lp:null,mra:null,ipd:null,bpd:null};for(var p in t.appendChild(h),e.contents)n(g,h,e.contents[p]);return g.currentISDState};var u=[new o("http://www.w3.org/ns/ttml#styling backgroundColor",function(e,t,r,n){0!==n[3]&&(t.style.backgroundColor="rgba("+n[0].toString()+","+n[1].toString()+","+n[2].toString()+","+(n[3]/255).toString()+")")}),new o("http://www.w3.org/ns/ttml#styling color",function(e,t,r,n){t.style.color="rgba("+n[0].toString()+","+n[1].toString()+","+n[2].toString()+","+(n[3]/255).toString()+")"}),new o("http://www.w3.org/ns/ttml#styling direction",function(e,t,r,n){t.style.direction=n}),new o("http://www.w3.org/ns/ttml#styling display",function(e,t,r,n){}),new o("http://www.w3.org/ns/ttml#styling displayAlign",function(e,t,r,n){t.style.display="flex",t.style.flexDirection="column","before"===n?t.style.justifyContent="flex-start":"center"===n?t.style.justifyContent="center":"after"===n&&(t.style.justifyContent="flex-end")}),new o("http://www.w3.org/ns/ttml#styling extent",function(e,t,r,n){e.regionH=n.h*e.h,e.regionW=n.w*e.w;var a=0,i=0,s=r.styleAttrs["http://www.w3.org/ns/ttml#styling padding"];s&&(a=(s[0]+s[2])*e.h,i=(s[1]+s[3])*e.w),t.style.height=e.regionH-a+"px",t.style.width=e.regionW-i+"px"}),new o("http://www.w3.org/ns/ttml#styling fontFamily",function(e,t,r,n){var a=[];for(var i in n)"monospaceSerif"===n[i]?(a.push("Courier New"),a.push('"Liberation Mono"'),a.push("Courier"),a.push("monospace")):"proportionalSansSerif"===n[i]?(a.push("Arial"),a.push("Helvetica"),a.push('"Liberation Sans"'),a.push("sans-serif")):"monospace"===n[i]?a.push("monospace"):"sansSerif"===n[i]?a.push("sans-serif"):"serif"===n[i]?a.push("serif"):"monospaceSansSerif"===n[i]?(a.push("Consolas"),a.push("monospace")):"proportionalSerif"===n[i]?a.push("serif"):a.push(n[i]);t.style.fontFamily=a.join(",")}),new o("http://www.w3.org/ns/ttml#styling fontSize",function(e,t,r,n){t.style.fontSize=n*e.h+"px"}),new o("http://www.w3.org/ns/ttml#styling fontStyle",function(e,t,r,n){t.style.fontStyle=n}),new o("http://www.w3.org/ns/ttml#styling fontWeight",function(e,t,r,n){t.style.fontWeight=n}),new o("http://www.w3.org/ns/ttml#styling lineHeight",function(e,t,r,n){t.style.lineHeight="normal"===n?"normal":n*e.h+"px"}),new o("http://www.w3.org/ns/ttml#styling opacity",function(e,t,r,n){t.style.opacity=n}),new o("http://www.w3.org/ns/ttml#styling origin",function(e,t,r,n){t.style.top=n.h*e.h+"px",t.style.left=n.w*e.w+"px"}),new o("http://www.w3.org/ns/ttml#styling overflow",function(e,t,r,n){t.style.overflow=n}),new o("http://www.w3.org/ns/ttml#styling padding",function(e,t,r,n){var a=[];a[0]=n[0]*e.h+"px",a[1]=n[3]*e.w+"px",a[2]=n[2]*e.h+"px",a[3]=n[1]*e.w+"px",t.style.padding=a.join(" ")}),new o("http://www.w3.org/ns/ttml#styling showBackground",null),new o("http://www.w3.org/ns/ttml#styling textAlign",function(e,t,n,a){var i,s=n.styleAttrs[r.byName.direction.qname];i="start"===a?"rtl"===s?"right":"left":"end"===a?"rtl"===s?"left":"right":a,t.style.textAlign=i}),new o("http://www.w3.org/ns/ttml#styling textDecoration",function(e,t,r,n){t.style.textDecoration=n.join(" ").replace("lineThrough","line-through")}),new o("http://www.w3.org/ns/ttml#styling textOutline",function(e,t,r,n){t.style.textShadow="none"===n?"":"rgba("+n.color[0].toString()+","+n.color[1].toString()+","+n.color[2].toString()+","+(n.color[3]/255).toString()+") 0px 0px "+n.thickness*e.h+"px"}),new o("http://www.w3.org/ns/ttml#styling unicodeBidi",function(e,t,r,n){var a;a="bidiOverride"===n?"bidi-override":n,t.style.unicodeBidi=a}),new o("http://www.w3.org/ns/ttml#styling visibility",function(e,t,r,n){t.style.visibility=n}),new o("http://www.w3.org/ns/ttml#styling wrapOption",function(e,t,r,n){"wrap"===n?"preserve"===r.space?t.style.whiteSpace="pre-wrap":t.style.whiteSpace="normal":"preserve"===r.space?t.style.whiteSpace="pre":t.style.whiteSpace="noWrap"}),new o("http://www.w3.org/ns/ttml#styling writingMode",function(e,t,r,n){"lrtb"===n||"lr"===n||"rltb"===n||"rl"===n?t.style.writingMode="horizontal-tb":"tblr"===n?t.style.writingMode="vertical-lr":"tbrl"!==n&&"tb"!==n||(t.style.writingMode="vertical-rl")}),new o("http://www.w3.org/ns/ttml#styling zIndex",function(e,t,r,n){t.style.zIndex=n}),new o("http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt backgroundImage",function(e,t,r,n){if(null!==e.imgResolver&&null!==n){var a=document.createElement("img"),i=e.imgResolver(n,a);i&&(a.src=i),a.height=e.regionH,a.width=e.regionW,t.appendChild(a)}}),new o("http://www.w3.org/ns/ttml/profile/imsc1#styling forcedDisplay",function(e,t,r,n){e.displayForcedOnlyMode&&!1===n&&(t.style.visibility="hidden")})],l={};for(var c in u)l[u[c].qname]=u[c]}(t,"undefined"==typeof imscNames?r("./node_modules/imsc/src/main/js/names.js"):imscNames,"undefined"==typeof imscStyles?r("./node_modules/imsc/src/main/js/styles.js"):imscStyles)},"./node_modules/imsc/src/main/js/isd.js":function(e,t,r){!function(e,t,r){function n(e,t,s,l,c,f,d,h,g){if(t<d.begin||t>=d.end)return null;var p="regionID"in d&&""!==d.regionID?d.regionID:f;if(null!==c&&p!==s.id&&(!("contents"in d)||"contents"in d&&0===d.contents.length||""!==p))return null;var m=new o(d);for(var y in d.sets)t<d.sets[y].begin||t>=d.sets[y].end||(m.styleAttrs[d.sets[y].qname]=d.sets[y].value);var E,_={};for(var v in m.styleAttrs)if(_[v]=!0,v===r.byName.writingMode.qname&&!(r.byName.direction.qname in m.styleAttrs)){var T=m.styleAttrs[v];"lrtb"===T||"lr"===T?m.styleAttrs[r.byName.direction.qname]="ltr":"rltb"!==T&&"rl"!==T||(m.styleAttrs[r.byName.direction.qname]="rtl")}if(null!==c)for(var S in r.all){var b=r.all[S];if(b.qname===r.byName.textDecoration.qname){var A=c.styleAttrs[b.qname],R=m.styleAttrs[b.qname],I=[];void 0===R?I=A:-1===R.indexOf("none")?((-1===R.indexOf("noUnderline")&&-1!==A.indexOf("underline")||-1!==R.indexOf("underline"))&&I.push("underline"),(-1===R.indexOf("noLineThrough")&&-1!==A.indexOf("lineThrough")||-1!==R.indexOf("lineThrough"))&&I.push("lineThrough"),(-1===R.indexOf("noOverline")&&-1!==A.indexOf("overline")||-1!==R.indexOf("overline"))&&I.push("overline")):I.push("none"),m.styleAttrs[b.qname]=I}else b.inherit&&b.qname in c.styleAttrs&&!(b.qname in m.styleAttrs)&&(m.styleAttrs[b.qname]=c.styleAttrs[b.qname])}for(var C in r.all){var w=r.all[C];w.qname in m.styleAttrs||("region"===m.kind||!1===w.inherit&&null!==w.initial)&&(m.styleAttrs[w.qname]=w.parse(w.initial),_[w.qname]=!0)}for(var N in r.all){var D=r.all[N];if(D.qname in _&&null!==D.compute){var M=D.compute(e,c,m,m.styleAttrs[D.qname],g);null!==M?m.styleAttrs[D.qname]=M:u(h,"Style '"+D.qname+"' on element '"+m.kind+"' cannot be computed")}}if("none"===m.styleAttrs[r.byName.display.qname])return null;for(var O in null===c?E=null===l?[]:[l]:"contents"in d&&(E=d.contents),E){var P=n(e,t,s,l,m,p,E[O],h,g);null!==P&&m.contents.push(P.element)}for(var L in m.styleAttrs)-1===r.byQName[L].applies.indexOf(m.kind)&&delete m.styleAttrs[L];if("span"===m.kind&&m.text&&"default"===m.space){var F=m.text.replace(/\s+/g," ");m.text=F}if("p"===m.kind){var j=[];a(m,j);for(var x=0,k="after_br",B=0;;)if("after_br"===k)x>=j.length||"br"===j[x].kind?(k="before_br",B=x,x--):("preserve"!==j[x].space&&(j[x].text=j[x].text.replace(/^\s+/g,"")),j[x].text.length>0?(k="looking_br",x++):j.splice(x,1));else if("before_br"===k)if(x<0||"br"===j[x].kind){if(k="after_br",(x=B+1)>=j.length)break}else if("preserve"!==j[x].space&&(j[x].text=j[x].text.replace(/\s+$/g,"")),j[x].text.length>0){if(k="after_br",(x=B+1)>=j.length)break}else j.splice(x,1),x--;else x>=j.length||"br"===j[x].kind?(k="before_br",B=x,x--):x++;i(m)}return"div"===m.kind&&r.byName.backgroundImage.qname in m.styleAttrs||"br"===m.kind||"contents"in m&&m.contents.length>0||"span"===m.kind&&null!==m.text||"region"===m.kind&&"always"===m.styleAttrs[r.byName.showBackground.qname]?{region_id:p,element:m}:null}function a(e,t){if("contents"in e)for(var r in e.contents)a(e.contents[r],t);else t.push(e)}function i(e){if("br"===e.kind)return!1;if("text"in e)return 0===e.text.length;if("contents"in e){for(var t=e.contents.length;t--;)i(e.contents[t])&&e.contents.splice(t,1);return 0===e.contents.length}}function s(e){this.contents=[],this.aspectRatio=e.aspectRatio}function o(e){for(var t in this.kind=e.kind||"region",e.id&&(this.id=e.id),this.styleAttrs={},e.styleAttrs)this.styleAttrs[t]=e.styleAttrs[t];"text"in e?this.text=e.text:"br"!==e.kind&&(this.contents=[]),"space"in e&&(this.space=e.space)}function u(e,t){if(e&&e.error&&e.error(t))throw t}e.generateISD=function(e,t,r){var a=new s(e),i={};for(var o in e.head.layout.regions){var u=n(e,t,e.head.layout.regions[o],e.body,null,"",e.head.layout.regions[o],r,i);null!==u&&a.contents.push(u.element)}return a}}(t,"undefined"==typeof imscNames?r("./node_modules/imsc/src/main/js/names.js"):imscNames,"undefined"==typeof imscStyles?r("./node_modules/imsc/src/main/js/styles.js"):imscStyles)},"./node_modules/imsc/src/main/js/main.js":function(e,t,r){t.generateISD=r("./node_modules/imsc/src/main/js/isd.js").generateISD,t.fromXML=r("./node_modules/imsc/src/main/js/doc.js").fromXML,t.renderHTML=r("./node_modules/imsc/src/main/js/html.js").render},"./node_modules/imsc/src/main/js/names.js":function(e,t,r){!function(e){e.ns_tt="http://www.w3.org/ns/ttml",e.ns_tts="http://www.w3.org/ns/ttml#styling",e.ns_ttp="http://www.w3.org/ns/ttml#parameter",e.ns_xml="http://www.w3.org/XML/1998/namespace",e.ns_itts="http://www.w3.org/ns/ttml/profile/imsc1#styling",e.ns_ittp="http://www.w3.org/ns/ttml/profile/imsc1#parameter",e.ns_smpte="http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt",e.ns_ebutts="urn:ebu:tt:style"}(t)},"./node_modules/imsc/src/main/js/styles.js":function(e,t,r){!function(e,t,r){function n(e,t,r,n,a,i,s,o){this.name=t,this.ns=e,this.qname=e+" "+t,this.inherit=a,this.animatable=i,this.initial=r,this.applies=n,this.parse=s,this.compute=o}for(var a in e.all=[new n(t.ns_tts,"backgroundColor","transparent",["body","div","p","region","span"],!1,!0,r.parseColor,null),new n(t.ns_tts,"color","white",["span"],!0,!0,r.parseColor,null),new n(t.ns_tts,"direction","ltr",["p","span"],!0,!0,function(e){return e},null),new n(t.ns_tts,"display","auto",["body","div","p","region","span"],!1,!0,function(e){return e},null),new n(t.ns_tts,"displayAlign","before",["region"],!1,!0,function(e){return e},null),new n(t.ns_tts,"extent","auto",["tt","region"],!1,!0,function(e){if("auto"===e)return e;var t=e.split(" ");if(2!==t.length)return null;var n=r.parseLength(t[0]),a=r.parseLength(t[1]);return a&&n?{h:a,w:n}:null},function(e,t,r,n,a){var i,s;if("auto"===n)i=1;else if("%"===n.h.unit)i=n.h.value/100;else{if("px"!==n.h.unit)return null;i=n.h.value/e.pxDimensions.h}if("auto"===n)s=1;else if("%"===n.w.unit)s=n.w.value/100;else{if("px"!==n.w.unit)return null;s=n.w.value/e.pxDimensions.w}return{h:i,w:s}}),new n(t.ns_tts,"fontFamily","default",["span"],!0,!0,function(e){var t=e.split(","),r=[];for(var n in t)"'"!==t[n].charAt(0)&&'"'!==t[n].charAt(0)&&"default"===t[n]?r.push("monospaceSerif"):r.push(t[n]);return r},null),new n(t.ns_tts,"fontSize","1c",["span"],!0,!0,r.parseLength,function(t,r,n,a,i){var s;if("%"===a.unit)s=null!==r?r.styleAttrs[e.byName.fontSize.qname]*a.value/100:a.value/100/t.cellResolution.h;else if("em"===a.unit)s=null!==r?r.styleAttrs[e.byName.fontSize.qname]*a.value:a.value/t.cellResolution.h;else if("c"===a.unit)s=a.value/t.cellResolution.h;else{if("px"!==a.unit)return null;s=a.value/t.pxDimensions.h}return s}),new n(t.ns_tts,"fontStyle","normal",["span"],!0,!0,function(e){return e},null),new n(t.ns_tts,"fontWeight","normal",["span"],!0,!0,function(e){return e},null),new n(t.ns_tts,"lineHeight","normal",["p"],!0,!0,function(e){return"normal"===e?e:r.parseLength(e)},function(t,r,n,a,i){var s;if("normal"===a)s=a;else if("%"===a.unit)s=n.styleAttrs[e.byName.fontSize.qname]*a.value/100;else if("em"===a.unit)s=n.styleAttrs[e.byName.fontSize.qname]*a.value;else if("c"===a.unit)s=a.value/t.cellResolution.h;else{if("px"!==a.unit)return null;s=a.value/t.pxDimensions.h}return s}),new n(t.ns_tts,"opacity",1,["region"],!1,!0,parseFloat,null),new n(t.ns_tts,"origin","auto",["region"],!1,!0,function(e){if("auto"===e)return e;var t=e.split(" ");if(2!==t.length)return null;var n=r.parseLength(t[0]),a=r.parseLength(t[1]);return a&&n?{h:a,w:n}:null},function(e,t,r,n,a){var i,s;if("auto"===n)i=0;else if("%"===n.h.unit)i=n.h.value/100;else{if("px"!==n.h.unit)return null;i=n.h.value/e.pxDimensions.h}if("auto"===n)s=0;else if("%"===n.w.unit)s=n.w.value/100;else{if("px"!==n.w.unit)return null;s=n.w.value/e.pxDimensions.w}return{h:i,w:s}}),new n(t.ns_tts,"overflow","hidden",["region"],!1,!0,function(e){return e},null),new n(t.ns_tts,"padding","0px",["region"],!1,!0,function(e){var t=e.split(" ");if(t.length>4)return null;var n=[];for(var a in t){var i=r.parseLength(t[a]);if(!i)return null;n.push(i)}return n},function(t,r,n,a,i){var s;if(1===a.length)s=[a[0],a[0],a[0],a[0]];else if(2===a.length)s=[a[0],a[1],a[0],a[1]];else if(3===a.length)s=[a[0],a[1],a[2],a[1]];else{if(4!==a.length)return null;s=[a[0],a[1],a[2],a[3]]}var o=n.styleAttrs[e.byName.writingMode.qname];if("lrtb"===o||"lr"===o)s=[s[0],s[3],s[2],s[1]];else if("rltb"===o||"rl"===o)s=[s[0],s[1],s[2],s[3]];else if("tblr"===o)s=[s[3],s[0],s[1],s[2]];else{if("tbrl"!==o&&"tb"!==o)return null;s=[s[3],s[2],s[1],s[0]]}var u=[];for(var l in s)if(0===s[l].value)u[l]=0;else if("%"===s[l].unit)u[l]="0"===l||"2"===l?n.styleAttrs[e.byName.extent.qname].h*s[l].value/100:n.styleAttrs[e.byName.extent.qname].w*s[l].value/100;else if("em"===s[l].unit)u[l]=n.styleAttrs[e.byName.fontSize.qname]*s[l].value;else if("c"===s[l].unit)u[l]=s[l].value/t.cellResolution.h;else{if("px"!==s[l].unit)return null;u[l]="0"===l||"2"===l?s[l].value/t.pxDimensions.h:s[l].value/t.pxDimensions.w}return u}),new n(t.ns_tts,"showBackground","always",["region"],!1,!0,function(e){return e},null),new n(t.ns_tts,"textAlign","start",["p"],!0,!0,function(e){return e},function(e,t,r,n,a){return"left"===n?"start":"right"===n?"end":n}),new n(t.ns_tts,"textDecoration","none",["span"],!0,!0,function(e){return e.split(" ")},null),new n(t.ns_tts,"textOutline","none",["span"],!0,!0,function(e){if("none"===e)return e;var t={},n=e.split(" ");if(0===n.length||n.length>2)return null;var a=r.parseColor(n[0]);if(t.color=a,null!==a&&n.shift(),1!==n.length)return null;var i=r.parseLength(n[0]);return i?(t.thickness=i,t):null},function(t,r,n,a,i){if("none"===a)return a;var s={};if(null===a.color?s.color=n.styleAttrs[e.byName.color.qname]:s.color=a.color,"%"===a.thickness.unit)s.thickness=n.styleAttrs[e.byName.fontSize.qname]*a.thickness.value/100;else if("em"===a.thickness.unit)s.thickness=n.styleAttrs[e.byName.fontSize.qname]*a.thickness.value;else if("c"===a.thickness.unit)s.thickness=a.thickness.value/t.cellResolution.h;else{if("px"!==a.thickness.unit)return null;s.thickness=a.thickness.value/t.pxDimensions.h}return s}),new n(t.ns_tts,"unicodeBidi","normal",["span","p"],!1,!0,function(e){return e},null),new n(t.ns_tts,"visibility","visible",["body","div","p","region","span"],!0,!0,function(e){return e},null),new n(t.ns_tts,"wrapOption","wrap",["span"],!0,!0,function(e){return e},null),new n(t.ns_tts,"writingMode","lrtb",["region"],!1,!0,function(e){return e},null),new n(t.ns_tts,"zIndex","auto",["region"],!1,!0,function(e){var t;return"auto"===e?t=e:(t=parseInt(e),isNaN(t)&&(t=null)),t},null),new n(t.ns_ebutts,"linePadding","0c",["p"],!0,!1,r.parseLength,function(e,t,r,n,a){return"c"===n.unit?n.value/e.cellResolution.h:null}),new n(t.ns_ebutts,"multiRowAlign","auto",["p"],!0,!1,function(e){return e},null),new n(t.ns_smpte,"backgroundImage",null,["div"],!1,!1,function(e){return e},null),new n(t.ns_itts,"forcedDisplay","false",["body","div","p","region","span"],!0,!0,function(e){return"true"===e},null),new n(t.ns_itts,"fillLineGap","false",["p"],!0,!0,function(e){return"true"===e},null)],e.byQName={},e.all)e.byQName[e.all[a].qname]=e.all[a];for(var i in e.byName={},e.all)e.byName[e.all[i].name]=e.all[i]}(t,"undefined"==typeof imscNames?r("./node_modules/imsc/src/main/js/names.js"):imscNames,"undefined"==typeof imscUtils?r("./node_modules/imsc/src/main/js/utils.js"):imscUtils)},"./node_modules/imsc/src/main/js/utils.js":function(e,t,r){!function(e){var t=/#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})?/,r=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,n=/rgba\(\s*(\d+),\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,a={transparent:[0,0,0,0],black:[0,0,0,255],silver:[192,192,192,255],gray:[128,128,128,255],white:[255,255,255,255],maroon:[128,0,0,255],red:[255,0,0,255],purple:[128,0,128,255],fuchsia:[255,0,255,255],magenta:[255,0,255,255],green:[0,128,0,255],lime:[0,255,0,255],olive:[128,128,0,255],yellow:[255,255,0,255],navy:[0,0,128,255],blue:[0,0,255,255],teal:[0,128,128,255],aqua:[0,255,255,255],cyan:[0,255,255,255]};e.parseColor=function(e){var i,s=null,o=a[e.toLowerCase()];return void 0!==o?s=o:null!==(i=t.exec(e))?s=[parseInt(i[1],16),parseInt(i[2],16),parseInt(i[3],16),void 0!==i[4]?parseInt(i[4],16):255]:null!==(i=r.exec(e))?s=[parseInt(i[1]),parseInt(i[2]),parseInt(i[3]),255]:null!==(i=n.exec(e))&&(s=[parseInt(i[1]),parseInt(i[2]),parseInt(i[3]),parseInt(i[4])]),s};var i=/^((?:\+|\-)?\d*(?:\.\d+)?)(px|em|c|%)$/;e.parseLength=function(e){var t,r=null;return null!==(t=i.exec(e))&&(r={value:parseFloat(t[1]),unit:t[2]}),r}}(t)},"./node_modules/inherits/inherits_browser.js":function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},"./node_modules/isarray/index.js":function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},"./node_modules/node-libs-browser/node_modules/buffer/index.js":function(e,t,r){(function(e){var n=r("./node_modules/base64-js/index.js"),a=r("./node_modules/ieee754/index.js"),i=r("./node_modules/isarray/index.js");function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(e,t){if(s()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,r){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return f(this,e)}return l(this,e,t,r)}function l(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n),u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=d(e,t),e}(e,t,r,n):"string"==typeof t?function(e,t,r){if("string"==typeof r&&""!==r||(r="utf8"),!u.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|g(t,r),a=(e=o(e,n)).write(t,r);return a!==n&&(e=e.slice(0,a)),e}(e,t,r):function(e,t){if(u.isBuffer(t)){var r=0|h(t.length);return 0===(e=o(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?o(e,0):d(e,t);if("Buffer"===t.type&&i(t.data))return d(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function f(e,t){if(c(t),e=o(e,t<0?0:0|h(t)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function d(e,t){var r=t.length<0?0:0|h(t.length);e=o(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function h(e){if(e>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function g(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(e).length;default:if(n)return G(e).length;t=(""+t).toLowerCase(),n=!0}}function p(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return D(this,t,r);case"utf8":case"utf-8":return I(this,t,r);case"ascii":return w(this,t,r);case"latin1":case"binary":return N(this,t,r);case"base64":return R(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function m(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,a){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=a?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(a)return-1;r=e.length-1}else if(r<0){if(!a)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:E(e,t,r,n,a);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):E(e,[t],r,n,a);throw new TypeError("val must be string, number or Buffer")}function E(e,t,r,n,a){var i,s=1,o=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,o/=2,u/=2,r/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(a){var c=-1;for(i=r;i<o;i++)if(l(e,i)===l(t,-1===c?0:i-c)){if(-1===c&&(c=i),i-c+1===u)return c*s}else-1!==c&&(i-=i-c),c=-1}else for(r+u>o&&(r=o-u),i=r;i>=0;i--){for(var f=!0,d=0;d<u;d++)if(l(e,i+d)!==l(t,d)){f=!1;break}if(f)return i}return-1}function _(e,t,r,n){r=Number(r)||0;var a=e.length-r;n?(n=Number(n))>a&&(n=a):n=a;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var s=0;s<n;++s){var o=parseInt(t.substr(2*s,2),16);if(isNaN(o))return s;e[r+s]=o}return s}function v(e,t,r,n){return q(G(t,e.length-r),e,r,n)}function T(e,t,r,n){return q(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function S(e,t,r,n){return T(e,t,r,n)}function b(e,t,r,n){return q(H(t),e,r,n)}function A(e,t,r,n){return q(function(e,t){for(var r,n,a,i=[],s=0;s<e.length&&!((t-=2)<0);++s)n=(r=e.charCodeAt(s))>>8,a=r%256,i.push(a),i.push(n);return i}(t,e.length-r),e,r,n)}function R(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function I(e,t,r){r=Math.min(e.length,r);for(var n=[],a=t;a<r;){var i,s,o,u,l=e[a],c=null,f=l>239?4:l>223?3:l>191?2:1;if(a+f<=r)switch(f){case 1:l<128&&(c=l);break;case 2:128==(192&(i=e[a+1]))&&(u=(31&l)<<6|63&i)>127&&(c=u);break;case 3:i=e[a+1],s=e[a+2],128==(192&i)&&128==(192&s)&&(u=(15&l)<<12|(63&i)<<6|63&s)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:i=e[a+1],s=e[a+2],o=e[a+3],128==(192&i)&&128==(192&s)&&128==(192&o)&&(u=(15&l)<<18|(63&i)<<12|(63&s)<<6|63&o)>65535&&u<1114112&&(c=u)}null===c?(c=65533,f=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),a+=f}return function(e){var t=e.length;if(t<=C)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=C));return r}(n)}t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=s(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,r){return l(null,e,t,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,r){return function(e,t,r,n){return c(t),t<=0?o(e,t):void 0!==r?"string"==typeof n?o(e,t).fill(r,n):o(e,t).fill(r):o(e,t)}(null,e,t,r)},u.allocUnsafe=function(e){return f(null,e)},u.allocUnsafeSlow=function(e){return f(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,a=0,i=Math.min(r,n);a<i;++a)if(e[a]!==t[a]){r=e[a],n=t[a];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!i(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=u.allocUnsafe(t),a=0;for(r=0;r<e.length;++r){var s=e[r];if(!u.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,a),a+=s.length}return n},u.byteLength=g,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?I(this,0,e):p.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,r,n,a){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===a&&(a=this.length),t<0||r>e.length||n<0||a>this.length)throw new RangeError("out of range index");if(n>=a&&t>=r)return 0;if(n>=a)return-1;if(t>=r)return 1;if(this===e)return 0;for(var i=(a>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),o=Math.min(i,s),l=this.slice(n,a),c=e.slice(t,r),f=0;f<o;++f)if(l[f]!==c[f]){i=l[f],s=c[f];break}return i<s?-1:s<i?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return y(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return y(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var a=this.length-t;if((void 0===r||r>a)&&(r=a),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return _(this,e,t,r);case"utf8":case"utf-8":return v(this,e,t,r);case"ascii":return T(this,e,t,r);case"latin1":case"binary":return S(this,e,t,r);case"base64":return b(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var C=4096;function w(e,t,r){var n="";r=Math.min(e.length,r);for(var a=t;a<r;++a)n+=String.fromCharCode(127&e[a]);return n}function N(e,t,r){var n="";r=Math.min(e.length,r);for(var a=t;a<r;++a)n+=String.fromCharCode(e[a]);return n}function D(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var a="",i=t;i<r;++i)a+=U(e[i]);return a}function M(e,t,r){for(var n=e.slice(t,r),a="",i=0;i<n.length;i+=2)a+=String.fromCharCode(n[i]+256*n[i+1]);return a}function O(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function P(e,t,r,n,a,i){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>a||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function L(e,t,r,n){t<0&&(t=65535+t+1);for(var a=0,i=Math.min(e.length-r,2);a<i;++a)e[r+a]=(t&255<<8*(n?a:1-a))>>>8*(n?a:1-a)}function F(e,t,r,n){t<0&&(t=4294967295+t+1);for(var a=0,i=Math.min(e.length-r,4);a<i;++a)e[r+a]=t>>>8*(n?a:3-a)&255}function j(e,t,r,n,a,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function x(e,t,r,n,i){return i||j(e,0,r,4),a.write(e,t,r,n,23,4),r+4}function k(e,t,r,n,i){return i||j(e,0,r,8),a.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=u.prototype;else{var a=t-e;r=new u(a,void 0);for(var i=0;i<a;++i)r[i]=this[i+e]}return r},u.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||O(e,t,this.length);for(var n=this[e],a=1,i=0;++i<t&&(a*=256);)n+=this[e+i]*a;return n},u.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||O(e,t,this.length);for(var n=this[e+--t],a=1;t>0&&(a*=256);)n+=this[e+--t]*a;return n},u.prototype.readUInt8=function(e,t){return t||O(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||O(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||O(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||O(e,t,this.length);for(var n=this[e],a=1,i=0;++i<t&&(a*=256);)n+=this[e+i]*a;return n>=(a*=128)&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||O(e,t,this.length);for(var n=t,a=1,i=this[e+--n];n>0&&(a*=256);)i+=this[e+--n]*a;return i>=(a*=128)&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||O(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){t||O(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||O(e,4,this.length),a.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||O(e,4,this.length),a.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||O(e,8,this.length),a.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||O(e,8,this.length),a.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t|=0,r|=0,n||P(this,e,t,r,Math.pow(2,8*r)-1,0);var a=1,i=0;for(this[t]=255&e;++i<r&&(a*=256);)this[t+i]=e/a&255;return t+r},u.prototype.writeUIntBE=function(e,t,r,n){e=+e,t|=0,r|=0,n||P(this,e,t,r,Math.pow(2,8*r)-1,0);var a=r-1,i=1;for(this[t+a]=255&e;--a>=0&&(i*=256);)this[t+a]=e/i&255;return t+r},u.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):L(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):L(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):F(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):F(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var a=Math.pow(2,8*r-1);P(this,e,t,r,a-1,-a)}var i=0,s=1,o=0;for(this[t]=255&e;++i<r&&(s*=256);)e<0&&0===o&&0!==this[t+i-1]&&(o=1),this[t+i]=(e/s|0)-o&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var a=Math.pow(2,8*r-1);P(this,e,t,r,a-1,-a)}var i=r-1,s=1,o=0;for(this[t+i]=255&e;--i>=0&&(s*=256);)e<0&&0===o&&0!==this[t+i+1]&&(o=1),this[t+i]=(e/s|0)-o&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):L(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):L(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):F(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):F(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,r){return x(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return x(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return k(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return k(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var a,i=n-r;if(this===e&&r<t&&t<n)for(a=i-1;a>=0;--a)e[a+t]=this[a+r];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(a=0;a<i;++a)e[a+t]=this[a+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+i),t);return i},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var a=e.charCodeAt(0);a<256&&(e=a)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{var s=u.isBuffer(e)?e:G(new u(e,n).toString()),o=s.length;for(i=0;i<r-t;++i)this[i+t]=s[i%o]}return this};var B=/[^+\/0-9A-Za-z-_]/g;function U(e){return e<16?"0"+e.toString(16):e.toString(16)}function G(e,t){var r;t=t||1/0;for(var n=e.length,a=null,i=[],s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!a){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&i.push(239,191,189);continue}a=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),a=r;continue}r=65536+(a-55296<<10|r-56320)}else a&&(t-=3)>-1&&i.push(239,191,189);if(a=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function H(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(B,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function q(e,t,r,n){for(var a=0;a<n&&!(a+r>=t.length||a>=e.length);++a)t[a+r]=e[a];return a}}).call(this,r("./node_modules/webpack/buildin/global.js"))},"./node_modules/node-libs-browser/node_modules/events/events.js":function(e,t,r){var n,a="object"==typeof Reflect?Reflect:null,i=a&&"function"==typeof a.apply?a.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};n=a&&"function"==typeof a.ownKeys?a.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise(function(r,n){function a(r){e.removeListener(t,i),n(r)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",a),r([].slice.call(arguments))}y(e,t,i,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&y(e,"error",t,{once:!0})}(e,a)})},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var u=10;function l(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function f(e,t,r,n){var a,i,s,o;if(l(r),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),i=e._events),s=i[t]),void 0===s)s=i[t]=r,++e._eventsCount;else if("function"==typeof s?s=i[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(a=c(e))>0&&s.length>a&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,o=u,console&&console.warn&&console.warn(o)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},a=d.bind(n);return a.listener=r,n.wrapFn=a,a}function g(e,t,r){var n=e._events;if(void 0===n)return[];var a=n[t];return void 0===a?[]:"function"==typeof a?r?[a.listener||a]:[a]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(a):m(a,a.length)}function p(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function m(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function y(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function a(i){n.once&&e.removeEventListener(t,a),r(i)})}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");u=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return c(this)},o.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,a=this._events;if(void 0!==a)n=n&&void 0===a.error;else if(!n)return!1;if(n){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var u=a[e];if(void 0===u)return!1;if("function"==typeof u)i(u,this,t);else{var l=u.length,c=m(u,l);for(r=0;r<l;++r)i(c[r],this,t)}return!0},o.prototype.addListener=function(e,t){return f(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return f(this,e,t,!0)},o.prototype.once=function(e,t){return l(t),this.on(e,h(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,h(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,n,a,i,s;if(l(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(a=-1,i=r.length-1;i>=0;i--)if(r[i]===t||r[i].listener===t){s=r[i].listener,a=i;break}if(a<0)return this;0===a?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,a),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var a,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(a=i[n])&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return g(this,e,!0)},o.prototype.rawListeners=function(e){return g(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},"./node_modules/node-libs-browser/node_modules/timers-browserify/main.js":function(e,t,r){(function(e){var n=void 0!==e&&e||"undefined"!=typeof self&&self||window,a=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(a.call(setTimeout,n,arguments),clearTimeout)},t.setInterval=function(){return new i(a.call(setInterval,n,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(n,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},r("./node_modules/setimmediate/setImmediate.js"),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r("./node_modules/webpack/buildin/global.js"))},"./node_modules/path-browserify/index.js":function(e,t,r){(function(e){function r(e,t){for(var r=0,n=e.length-1;n>=0;n--){var a=e[n];"."===a?e.splice(n,1):".."===a?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function n(e,t){if(e.filter)return e.filter(t);for(var r=[],n=0;n<e.length;n++)t(e[n],n,e)&&r.push(e[n]);return r}t.resolve=function(){for(var t="",a=!1,i=arguments.length-1;i>=-1&&!a;i--){var s=i>=0?arguments[i]:e.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(t=s+"/"+t,a="/"===s.charAt(0))}return(a?"/":"")+(t=r(n(t.split("/"),function(e){return!!e}),!a).join("/"))||"."},t.normalize=function(e){var i=t.isAbsolute(e),s="/"===a(e,-1);return(e=r(n(e.split("/"),function(e){return!!e}),!i).join("/"))||i||(e="."),e&&s&&(e+="/"),(i?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(n(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},t.relative=function(e,r){function n(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=t.resolve(e).substr(1),r=t.resolve(r).substr(1);for(var a=n(e.split("/")),i=n(r.split("/")),s=Math.min(a.length,i.length),o=s,u=0;u<s;u++)if(a[u]!==i[u]){o=u;break}var l=[];for(u=o;u<a.length;u++)l.push("..");return(l=l.concat(i.slice(o))).join("/")},t.sep="/",t.delimiter=":",t.dirname=function(e){if("string"!=typeof e&&(e+=""),0===e.length)return".";for(var t=e.charCodeAt(0),r=47===t,n=-1,a=!0,i=e.length-1;i>=1;--i)if(47===(t=e.charCodeAt(i))){if(!a){n=i;break}}else a=!1;return-1===n?r?"/":".":r&&1===n?"/":e.slice(0,n)},t.basename=function(e,t){var r=function(e){"string"!=typeof e&&(e+="");var t,r=0,n=-1,a=!0;for(t=e.length-1;t>=0;--t)if(47===e.charCodeAt(t)){if(!a){r=t+1;break}}else-1===n&&(a=!1,n=t+1);return-1===n?"":e.slice(r,n)}(e);return t&&r.substr(-1*t.length)===t&&(r=r.substr(0,r.length-t.length)),r},t.extname=function(e){"string"!=typeof e&&(e+="");for(var t=-1,r=0,n=-1,a=!0,i=0,s=e.length-1;s>=0;--s){var o=e.charCodeAt(s);if(47!==o)-1===n&&(a=!1,n=s+1),46===o?-1===t?t=s:1!==i&&(i=1):-1!==t&&(i=-1);else if(!a){r=s+1;break}}return-1===t||-1===n||0===i||1===i&&t===n-1&&t===r+1?"":e.slice(t,n)};var a=function(e,t,r){return e.substr(t,r)}}).call(this,r("./node_modules/process/browser.js"))},"./node_modules/process-nextick-args/index.js":function(e,t,r){(function(t){!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,r,n,a){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var i,s,o=arguments.length;switch(o){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick(function(){e.call(null,r)});case 3:return t.nextTick(function(){e.call(null,r,n)});case 4:return t.nextTick(function(){e.call(null,r,n,a)});default:for(i=new Array(o-1),s=0;s<i.length;)i[s++]=arguments[s];return t.nextTick(function(){e.apply(null,i)})}}}:e.exports=t}).call(this,r("./node_modules/process/browser.js"))},"./node_modules/process/browser.js":function(e,t){var r,n,a=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function o(e){if(r===setTimeout)return setTimeout(e,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(e){r=i}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(e){n=s}}();var u,l=[],c=!1,f=-1;function d(){c&&u&&(c=!1,u.length?l=u.concat(l):f=-1,l.length&&h())}function h(){if(!c){var e=o(d);c=!0;for(var t=l.length;t;){for(u=l,l=[];++f<t;)u&&u[f].run();f=-1,t=l.length}u=null,c=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{return n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function g(e,t){this.fun=e,this.array=t}function p(){}a.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new g(e,t)),1!==l.length||c||o(h)},g.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=p,a.addListener=p,a.once=p,a.off=p,a.removeListener=p,a.removeAllListeners=p,a.emit=p,a.prependListener=p,a.prependOnceListener=p,a.listeners=function(e){return[]},a.binding=function(e){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(e){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},"./node_modules/readable-stream/duplex-browser.js":function(e,t,r){e.exports=r("./node_modules/readable-stream/lib/_stream_duplex.js")},"./node_modules/readable-stream/lib/_stream_duplex.js":function(e,t,r){var n=r("./node_modules/process-nextick-args/index.js"),a=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=f;var i=r("./node_modules/core-util-is/lib/util.js");i.inherits=r("./node_modules/inherits/inherits_browser.js");var s=r("./node_modules/readable-stream/lib/_stream_readable.js"),o=r("./node_modules/readable-stream/lib/_stream_writable.js");i.inherits(f,s);for(var u=a(o.prototype),l=0;l<u.length;l++){var c=u[l];f.prototype[c]||(f.prototype[c]=o.prototype[c])}function f(e){if(!(this instanceof f))return new f(e);s.call(this,e),o.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",d)}function d(){this.allowHalfOpen||this._writableState.ended||n.nextTick(h,this)}function h(e){e.end()}Object.defineProperty(f.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(f.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),f.prototype._destroy=function(e,t){this.push(null),this.end(),n.nextTick(t,e)}},"./node_modules/readable-stream/lib/_stream_passthrough.js":function(e,t,r){e.exports=i;var n=r("./node_modules/readable-stream/lib/_stream_transform.js"),a=r("./node_modules/core-util-is/lib/util.js");function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}a.inherits=r("./node_modules/inherits/inherits_browser.js"),a.inherits(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},"./node_modules/readable-stream/lib/_stream_readable.js":function(e,t,r){(function(t,n){var a=r("./node_modules/process-nextick-args/index.js");e.exports=_;var i,s=r("./node_modules/isarray/index.js");_.ReadableState=E,r("./node_modules/node-libs-browser/node_modules/events/events.js").EventEmitter;var o=function(e,t){return e.listeners(t).length},u=r("./node_modules/readable-stream/lib/internal/streams/stream-browser.js"),l=r("./node_modules/safe-buffer/index.js").Buffer,c=t.Uint8Array||function(){},f=r("./node_modules/core-util-is/lib/util.js");f.inherits=r("./node_modules/inherits/inherits_browser.js");var d=r(0),h=void 0;h=d&&d.debuglog?d.debuglog("stream"):function(){};var g,p=r("./node_modules/readable-stream/lib/internal/streams/BufferList.js"),m=r("./node_modules/readable-stream/lib/internal/streams/destroy.js");f.inherits(_,u);var y=["error","close","destroy","pause","resume"];function E(e,t){e=e||{};var n=t instanceof(i=i||r("./node_modules/readable-stream/lib/_stream_duplex.js"));this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var a=e.highWaterMark,s=e.readableHighWaterMark,o=this.objectMode?16:16384;this.highWaterMark=a||0===a?a:n&&(s||0===s)?s:o,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(g||(g=r("./node_modules/string_decoder/lib/string_decoder.js").StringDecoder),this.decoder=new g(e.encoding),this.encoding=e.encoding)}function _(e){if(i=i||r("./node_modules/readable-stream/lib/_stream_duplex.js"),!(this instanceof _))return new _(e);this._readableState=new E(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),u.call(this)}function v(e,t,r,n,a){var i,s=e._readableState;return null===t?(s.reading=!1,function(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,A(e)}}(e,s)):(a||(i=function(e,t){var r,n;return n=t,l.isBuffer(n)||n instanceof c||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}(s,t)),i?e.emit("error",i):s.objectMode||t&&t.length>0?("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===l.prototype||(t=function(e){return l.from(e)}(t)),n?s.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):T(e,s,t,!0):s.ended?e.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||0!==t.length?T(e,s,t,!1):I(e,s)):T(e,s,t,!1))):n||(s.reading=!1)),function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(s)}function T(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&A(e)),I(e,t)}Object.defineProperty(_.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),_.prototype.destroy=m.destroy,_.prototype._undestroy=m.undestroy,_.prototype._destroy=function(e,t){this.push(null),t(e)},_.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=l.from(e,t),t=""),r=!0),v(this,e,t,!1,r)},_.prototype.unshift=function(e){return v(this,e,null,!0,!1)},_.prototype.isPaused=function(){return!1===this._readableState.flowing},_.prototype.setEncoding=function(e){return g||(g=r("./node_modules/string_decoder/lib/string_decoder.js").StringDecoder),this._readableState.decoder=new g(e),this._readableState.encoding=e,this};var S=8388608;function b(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=S?e=S:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function A(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?a.nextTick(R,e):R(e))}function R(e){h("emit readable"),e.emit("readable"),D(e)}function I(e,t){t.readingMore||(t.readingMore=!0,a.nextTick(C,e,t))}function C(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(h("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function w(e){h("readable nexttick read 0"),e.read(0)}function N(e,t){t.reading||(h("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),D(e),t.flowing&&!t.reading&&e.read(0)}function D(e){var t=e._readableState;for(h("flow",t.flowing);t.flowing&&null!==e.read(););}function M(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;return e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):n=e===t.head.data.length?t.shift():r?function(e,t){var r=t.head,n=1,a=r.data;for(e-=a.length;r=r.next;){var i=r.data,s=e>i.length?i.length:e;if(s===i.length?a+=i:a+=i.slice(0,e),0===(e-=s)){s===i.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=i.slice(s));break}++n}return t.length-=n,a}(e,t):function(e,t){var r=l.allocUnsafe(e),n=t.head,a=1;for(n.data.copy(r),e-=n.data.length;n=n.next;){var i=n.data,s=e>i.length?i.length:e;if(i.copy(r,r.length-e,0,s),0===(e-=s)){s===i.length?(++a,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=i.slice(s));break}++a}return t.length-=a,r}(e,t),n}(e,t.buffer,t.decoder),r);var r}function O(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,a.nextTick(P,t,e))}function P(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function L(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}_.prototype.read=function(e){h("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?O(this):A(this),null;if(0===(e=b(e,t))&&t.ended)return 0===t.length&&O(this),null;var n,a=t.needReadable;return h("need readable",a),(0===t.length||t.length-e<t.highWaterMark)&&h("length less than watermark",a=!0),t.ended||t.reading?h("reading or ended",a=!1):a&&(h("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=b(r,t))),null===(n=e>0?M(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&O(this)),null!==n&&this.emit("data",n),n},_.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},_.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,h("pipe count=%d opts=%j",i.pipesCount,t);var u=t&&!1===t.end||e===n.stdout||e===n.stderr?E:l;function l(){h("onend"),e.end()}i.endEmitted?a.nextTick(u):r.once("end",u),e.on("unpipe",function t(n,a){h("onunpipe"),n===r&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,h("cleanup"),e.removeListener("close",m),e.removeListener("finish",y),e.removeListener("drain",c),e.removeListener("error",p),e.removeListener("unpipe",t),r.removeListener("end",l),r.removeListener("end",E),r.removeListener("data",g),f=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||c())});var c=function(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,D(e))}}(r);e.on("drain",c);var f=!1,d=!1;function g(t){h("ondata"),d=!1,!1!==e.write(t)||d||((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==L(i.pipes,e))&&!f&&(h("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,d=!0),r.pause())}function p(t){h("onerror",t),E(),e.removeListener("error",p),0===o(e,"error")&&e.emit("error",t)}function m(){e.removeListener("finish",y),E()}function y(){h("onfinish"),e.removeListener("close",m),E()}function E(){h("unpipe"),r.unpipe(e)}return r.on("data",g),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?s(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",p),e.once("close",m),e.once("finish",y),e.emit("pipe",r),i.flowing||(h("pipe resume"),r.resume()),e},_.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,a=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<a;i++)n[i].emit("unpipe",this,r);return this}var s=L(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},_.prototype.on=function(e,t){var r=u.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var n=this._readableState;n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&A(this):a.nextTick(w,this))}return r},_.prototype.addListener=_.prototype.on,_.prototype.resume=function(){var e=this._readableState;return e.flowing||(h("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,a.nextTick(N,e,t))}(this,e)),this},_.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this},_.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var a in e.on("end",function(){if(h("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(a){h("wrapped data"),r.decoder&&(a=r.decoder.write(a)),r.objectMode&&null==a||(r.objectMode||a&&a.length)&&(t.push(a)||(n=!0,e.pause()))}),e)void 0===this[a]&&"function"==typeof e[a]&&(this[a]=function(t){return function(){return e[t].apply(e,arguments)}}(a));for(var i=0;i<y.length;i++)e.on(y[i],this.emit.bind(this,y[i]));return this._read=function(t){h("wrapped _read",t),n&&(n=!1,e.resume())},this},Object.defineProperty(_.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),_._fromList=M}).call(this,r("./node_modules/webpack/buildin/global.js"),r("./node_modules/process/browser.js"))},"./node_modules/readable-stream/lib/_stream_transform.js":function(e,t,r){e.exports=s;var n=r("./node_modules/readable-stream/lib/_stream_duplex.js"),a=r("./node_modules/core-util-is/lib/util.js");function i(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var a=this._readableState;a.reading=!1,(a.needReadable||a.length<a.highWaterMark)&&this._read(a.highWaterMark)}function s(e){if(!(this instanceof s))return new s(e);n.call(this,e),this._transformState={afterTransform:i.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",o)}function o(){var e=this;"function"==typeof this._flush?this._flush(function(t,r){u(e,t,r)}):u(this,null,null)}function u(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}a.inherits=r("./node_modules/inherits/inherits_browser.js"),a.inherits(s,n),s.prototype.push=function(e,t){return this._transformState.needTransform=!1,n.prototype.push.call(this,e,t)},s.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")},s.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var a=this._readableState;(n.needTransform||a.needReadable||a.length<a.highWaterMark)&&this._read(a.highWaterMark)}},s.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},s.prototype._destroy=function(e,t){var r=this;n.prototype._destroy.call(this,e,function(e){t(e),r.emit("close")})}},"./node_modules/readable-stream/lib/_stream_writable.js":function(e,t,r){(function(t,n,a){var i=r("./node_modules/process-nextick-args/index.js");function s(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t){var r=e.entry;for(e.entry=null;r;){var n=r.callback;t.pendingcb--,n(undefined),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=E;var o,u=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?n:i.nextTick;E.WritableState=y;var l=r("./node_modules/core-util-is/lib/util.js");l.inherits=r("./node_modules/inherits/inherits_browser.js");var c,f={deprecate:r("./node_modules/util-deprecate/browser.js")},d=r("./node_modules/readable-stream/lib/internal/streams/stream-browser.js"),h=r("./node_modules/safe-buffer/index.js").Buffer,g=a.Uint8Array||function(){},p=r("./node_modules/readable-stream/lib/internal/streams/destroy.js");function m(){}function y(e,t){o=o||r("./node_modules/readable-stream/lib/_stream_duplex.js"),e=e||{};var n=t instanceof o;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var a=e.highWaterMark,l=e.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=a||0===a?a:n&&(l||0===l)?l:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var f=!1===e.decodeStrings;this.decodeStrings=!f,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,a=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,a){--t.pendingcb,r?(i.nextTick(a,n),i.nextTick(A,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(a(n),e._writableState.errorEmitted=!0,e.emit("error",n),A(e,t))}(e,r,n,t,a);else{var s=S(r);s||r.corked||r.bufferProcessing||!r.bufferedRequest||T(e,r),n?u(v,e,r,s,a):v(e,r,s,a)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}function E(e){if(o=o||r("./node_modules/readable-stream/lib/_stream_duplex.js"),!(c.call(E,this)||this instanceof o))return new E(e);this._writableState=new y(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),d.call(this)}function _(e,t,r,n,a,i,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,r?e._writev(a,t.onwrite):e._write(a,i,t.onwrite),t.sync=!1}function v(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),A(e,t)}function T(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,a=new Array(n),i=t.corkedRequestsFree;i.entry=r;for(var o=0,u=!0;r;)a[o]=r,r.isBuf||(u=!1),r=r.next,o+=1;a.allBuffers=u,_(e,t,!0,t.length,a,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new s(t),t.bufferedRequestCount=0}else{for(;r;){var l=r.chunk,c=r.encoding,f=r.callback;if(_(e,t,!1,t.objectMode?1:l.length,l,c,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function S(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function b(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),A(e,t)})}function A(e,t){var r=S(t);return r&&(function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,i.nextTick(b,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}l.inherits(E,d),y.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(y.prototype,"buffer",{get:f.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(c=Function.prototype[Symbol.hasInstance],Object.defineProperty(E,Symbol.hasInstance,{value:function(e){return!!c.call(this,e)||this===E&&e&&e._writableState instanceof y}})):c=function(e){return e instanceof this},E.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},E.prototype.write=function(e,t,r){var n,a=this._writableState,s=!1,o=!a.objectMode&&(n=e,h.isBuffer(n)||n instanceof g);return o&&!h.isBuffer(e)&&(e=function(e){return h.from(e)}(e)),"function"==typeof t&&(r=t,t=null),o?t="buffer":t||(t=a.defaultEncoding),"function"!=typeof r&&(r=m),a.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),i.nextTick(t,r)}(this,r):(o||function(e,t,r,n){var a=!0,s=!1;return null===r?s=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),s&&(e.emit("error",s),i.nextTick(n,s),a=!1),a}(this,a,e,r))&&(a.pendingcb++,s=function(e,t,r,n,a,i){if(!r){var s=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=h.from(t,r)),t}(t,n,a);n!==s&&(r=!0,a="buffer",n=s)}var o=t.objectMode?1:n.length;t.length+=o;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:a,isBuf:r,callback:i,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else _(e,t,!1,o,n,a,i);return u}(this,a,o,e,t,r)),s},E.prototype.cork=function(){this._writableState.corked++},E.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||T(this,e))},E.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(E.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),E.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},E.prototype._writev=null,E.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,A(e,t),r&&(t.finished?i.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r)},Object.defineProperty(E.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),E.prototype.destroy=p.destroy,E.prototype._undestroy=p.undestroy,E.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,r("./node_modules/process/browser.js"),r("./node_modules/node-libs-browser/node_modules/timers-browserify/main.js").setImmediate,r("./node_modules/webpack/buildin/global.js"))},"./node_modules/readable-stream/lib/internal/streams/BufferList.js":function(e,t,r){var n=r("./node_modules/safe-buffer/index.js").Buffer,a=r(1);function i(e,t,r){e.copy(t,r)}e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var t=n.allocUnsafe(e>>>0),r=this.head,a=0;r;)i(r.data,t,a),a+=r.data.length,r=r.next;return t},e}(),a&&a.inspect&&a.inspect.custom&&(e.exports.prototype[a.inspect.custom]=function(){var e=a.inspect({length:this.length});return this.constructor.name+" "+e})},"./node_modules/readable-stream/lib/internal/streams/destroy.js":function(e,t,r){var n=r("./node_modules/process-nextick-args/index.js");function a(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return i||s?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||n.nextTick(a,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(n.nextTick(a,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},"./node_modules/readable-stream/lib/internal/streams/stream-browser.js":function(e,t,r){e.exports=r("./node_modules/node-libs-browser/node_modules/events/events.js").EventEmitter},"./node_modules/readable-stream/passthrough.js":function(e,t,r){e.exports=r("./node_modules/readable-stream/readable-browser.js").PassThrough},"./node_modules/readable-stream/readable-browser.js":function(e,t,r){(t=e.exports=r("./node_modules/readable-stream/lib/_stream_readable.js")).Stream=t,t.Readable=t,t.Writable=r("./node_modules/readable-stream/lib/_stream_writable.js"),t.Duplex=r("./node_modules/readable-stream/lib/_stream_duplex.js"),t.Transform=r("./node_modules/readable-stream/lib/_stream_transform.js"),t.PassThrough=r("./node_modules/readable-stream/lib/_stream_passthrough.js")},"./node_modules/readable-stream/transform.js":function(e,t,r){e.exports=r("./node_modules/readable-stream/readable-browser.js").Transform},"./node_modules/readable-stream/writable-browser.js":function(e,t,r){e.exports=r("./node_modules/readable-stream/lib/_stream_writable.js")},"./node_modules/safe-buffer/index.js":function(e,t,r){var n=r("./node_modules/node-libs-browser/node_modules/buffer/index.js"),a=n.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return a(e,t,r)}a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?e.exports=n:(i(n,t),t.Buffer=s),i(a,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return a(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=a(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return a(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},"./node_modules/sax/lib/sax.js":function(e,t,r){(function(e){!function(t){t.parser=function(e,t){return new i(e,t)},t.SAXParser=i,t.SAXStream=o,t.createStream=function(e,t){return new o(e,t)},t.MAX_BUFFER_LENGTH=65536;var n,a=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];function i(e,r){if(!(this instanceof i))return new i(e,r);var n=this;!function(e){for(var t=0,r=a.length;t<r;t++)e[a[t]]=""}(n),n.q=n.c="",n.bufferCheckPosition=t.MAX_BUFFER_LENGTH,n.opt=r||{},n.opt.lowercase=n.opt.lowercase||n.opt.lowercasetags,n.looseCase=n.opt.lowercase?"toLowerCase":"toUpperCase",n.tags=[],n.closed=n.closedRoot=n.sawRoot=!1,n.tag=n.error=null,n.strict=!!e,n.noscript=!(!e&&!n.opt.noscript),n.state=w.BEGIN,n.strictEntities=n.opt.strictEntities,n.ENTITIES=n.strictEntities?Object.create(t.XML_ENTITIES):Object.create(t.ENTITIES),n.attribList=[],n.opt.xmlns&&(n.ns=Object.create(y)),n.trackPosition=!1!==n.opt.position,n.trackPosition&&(n.position=n.line=n.column=0),D(n,"onready")}t.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],Object.create||(Object.create=function(e){function t(){}return t.prototype=e,new t}),Object.keys||(Object.keys=function(e){var t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(r);return t}),i.prototype={end:function(){F(this)},write:function(e){var r=this;if(this.error)throw this.error;if(r.closed)return L(r,"Cannot write after close. Assign an onready handler.");if(null===e)return F(r);"object"==typeof e&&(e=e.toString());for(var n=0,i="";i=Y(e,n++),r.c=i,i;)switch(r.trackPosition&&(r.position++,"\n"===i?(r.line++,r.column=0):r.column++),r.state){case w.BEGIN:if(r.state=w.BEGIN_WHITESPACE,"\ufeff"===i)continue;q(r,i);continue;case w.BEGIN_WHITESPACE:q(r,i);continue;case w.TEXT:if(r.sawRoot&&!r.closedRoot){for(var s=n-1;i&&"<"!==i&&"&"!==i;)(i=Y(e,n++))&&r.trackPosition&&(r.position++,"\n"===i?(r.line++,r.column=0):r.column++);r.textNode+=e.substring(s,n-1)}"<"!==i||r.sawRoot&&r.closedRoot&&!r.strict?(!A(u,i)||r.sawRoot&&!r.closedRoot||j(r,"Text data outside of root node."),"&"===i?r.state=w.TEXT_ENTITY:r.textNode+=i):(r.state=w.OPEN_WAKA,r.startTagPosition=r.position);continue;case w.SCRIPT:"<"===i?r.state=w.SCRIPT_ENDING:r.script+=i;continue;case w.SCRIPT_ENDING:"/"===i?r.state=w.CLOSE_TAG:(r.script+="<"+i,r.state=w.SCRIPT);continue;case w.OPEN_WAKA:if("!"===i)r.state=w.SGML_DECL,r.sgmlDecl="";else if(b(u,i));else if(b(E,i))r.state=w.OPEN_TAG,r.tagName=i;else if("/"===i)r.state=w.CLOSE_TAG,r.tagName="";else if("?"===i)r.state=w.PROC_INST,r.procInstName=r.procInstBody="";else{if(j(r,"Unencoded <"),r.startTagPosition+1<r.position){var o=r.position-r.startTagPosition;i=new Array(o).join(" ")+i}r.textNode+="<"+i,r.state=w.TEXT}continue;case w.SGML_DECL:(r.sgmlDecl+i).toUpperCase()===h?(M(r,"onopencdata"),r.state=w.CDATA,r.sgmlDecl="",r.cdata=""):r.sgmlDecl+i==="--"?(r.state=w.COMMENT,r.comment="",r.sgmlDecl=""):(r.sgmlDecl+i).toUpperCase()===g?(r.state=w.DOCTYPE,(r.doctype||r.sawRoot)&&j(r,"Inappropriately located doctype declaration"),r.doctype="",r.sgmlDecl=""):">"===i?(M(r,"onsgmldeclaration",r.sgmlDecl),r.sgmlDecl="",r.state=w.TEXT):b(f,i)?(r.state=w.SGML_DECL_QUOTED,r.sgmlDecl+=i):r.sgmlDecl+=i;continue;case w.SGML_DECL_QUOTED:i===r.q&&(r.state=w.SGML_DECL,r.q=""),r.sgmlDecl+=i;continue;case w.DOCTYPE:">"===i?(r.state=w.TEXT,M(r,"ondoctype",r.doctype),r.doctype=!0):(r.doctype+=i,"["===i?r.state=w.DOCTYPE_DTD:b(f,i)&&(r.state=w.DOCTYPE_QUOTED,r.q=i));continue;case w.DOCTYPE_QUOTED:r.doctype+=i,i===r.q&&(r.q="",r.state=w.DOCTYPE);continue;case w.DOCTYPE_DTD:r.doctype+=i,"]"===i?r.state=w.DOCTYPE:b(f,i)&&(r.state=w.DOCTYPE_DTD_QUOTED,r.q=i);continue;case w.DOCTYPE_DTD_QUOTED:r.doctype+=i,i===r.q&&(r.state=w.DOCTYPE_DTD,r.q="");continue;case w.COMMENT:"-"===i?r.state=w.COMMENT_ENDING:r.comment+=i;continue;case w.COMMENT_ENDING:"-"===i?(r.state=w.COMMENT_ENDED,r.comment=P(r.opt,r.comment),r.comment&&M(r,"oncomment",r.comment),r.comment=""):(r.comment+="-"+i,r.state=w.COMMENT);continue;case w.COMMENT_ENDED:">"!==i?(j(r,"Malformed comment"),r.comment+="--"+i,r.state=w.COMMENT):r.state=w.TEXT;continue;case w.CDATA:"]"===i?r.state=w.CDATA_ENDING:r.cdata+=i;continue;case w.CDATA_ENDING:"]"===i?r.state=w.CDATA_ENDING_2:(r.cdata+="]"+i,r.state=w.CDATA);continue;case w.CDATA_ENDING_2:">"===i?(r.cdata&&M(r,"oncdata",r.cdata),M(r,"onclosecdata"),r.cdata="",r.state=w.TEXT):"]"===i?r.cdata+="]":(r.cdata+="]]"+i,r.state=w.CDATA);continue;case w.PROC_INST:"?"===i?r.state=w.PROC_INST_ENDING:b(u,i)?r.state=w.PROC_INST_BODY:r.procInstName+=i;continue;case w.PROC_INST_BODY:if(!r.procInstBody&&b(u,i))continue;"?"===i?r.state=w.PROC_INST_ENDING:r.procInstBody+=i;continue;case w.PROC_INST_ENDING:">"===i?(M(r,"onprocessinginstruction",{name:r.procInstName,body:r.procInstBody}),r.procInstName=r.procInstBody="",r.state=w.TEXT):(r.procInstBody+="?"+i,r.state=w.PROC_INST_BODY);continue;case w.OPEN_TAG:b(_,i)?r.tagName+=i:(x(r),">"===i?U(r):"/"===i?r.state=w.OPEN_TAG_SLASH:(A(u,i)&&j(r,"Invalid character in tag name"),r.state=w.ATTRIB));continue;case w.OPEN_TAG_SLASH:">"===i?(U(r,!0),G(r)):(j(r,"Forward-slash in opening tag not followed by >"),r.state=w.ATTRIB);continue;case w.ATTRIB:if(b(u,i))continue;">"===i?U(r):"/"===i?r.state=w.OPEN_TAG_SLASH:b(E,i)?(r.attribName=i,r.attribValue="",r.state=w.ATTRIB_NAME):j(r,"Invalid attribute name");continue;case w.ATTRIB_NAME:"="===i?r.state=w.ATTRIB_VALUE:">"===i?(j(r,"Attribute without value"),r.attribValue=r.attribName,B(r),U(r)):b(u,i)?r.state=w.ATTRIB_NAME_SAW_WHITE:b(_,i)?r.attribName+=i:j(r,"Invalid attribute name");continue;case w.ATTRIB_NAME_SAW_WHITE:if("="===i)r.state=w.ATTRIB_VALUE;else{if(b(u,i))continue;j(r,"Attribute without value"),r.tag.attributes[r.attribName]="",r.attribValue="",M(r,"onattribute",{name:r.attribName,value:""}),r.attribName="",">"===i?U(r):b(E,i)?(r.attribName=i,r.state=w.ATTRIB_NAME):(j(r,"Invalid attribute name"),r.state=w.ATTRIB)}continue;case w.ATTRIB_VALUE:if(b(u,i))continue;b(f,i)?(r.q=i,r.state=w.ATTRIB_VALUE_QUOTED):(j(r,"Unquoted attribute value"),r.state=w.ATTRIB_VALUE_UNQUOTED,r.attribValue=i);continue;case w.ATTRIB_VALUE_QUOTED:if(i!==r.q){"&"===i?r.state=w.ATTRIB_VALUE_ENTITY_Q:r.attribValue+=i;continue}B(r),r.q="",r.state=w.ATTRIB_VALUE_CLOSED;continue;case w.ATTRIB_VALUE_CLOSED:b(u,i)?r.state=w.ATTRIB:">"===i?U(r):"/"===i?r.state=w.OPEN_TAG_SLASH:b(E,i)?(j(r,"No whitespace between attributes"),r.attribName=i,r.attribValue="",r.state=w.ATTRIB_NAME):j(r,"Invalid attribute name");continue;case w.ATTRIB_VALUE_UNQUOTED:if(A(d,i)){"&"===i?r.state=w.ATTRIB_VALUE_ENTITY_U:r.attribValue+=i;continue}B(r),">"===i?U(r):r.state=w.ATTRIB;continue;case w.CLOSE_TAG:if(r.tagName)">"===i?G(r):b(_,i)?r.tagName+=i:r.script?(r.script+="</"+r.tagName,r.tagName="",r.state=w.SCRIPT):(A(u,i)&&j(r,"Invalid tagname in closing tag"),r.state=w.CLOSE_TAG_SAW_WHITE);else{if(b(u,i))continue;A(E,i)?r.script?(r.script+="</"+i,r.state=w.SCRIPT):j(r,"Invalid tagname in closing tag."):r.tagName=i}continue;case w.CLOSE_TAG_SAW_WHITE:if(b(u,i))continue;">"===i?G(r):j(r,"Invalid characters in closing tag");continue;case w.TEXT_ENTITY:case w.ATTRIB_VALUE_ENTITY_Q:case w.ATTRIB_VALUE_ENTITY_U:var l,c;switch(r.state){case w.TEXT_ENTITY:l=w.TEXT,c="textNode";break;case w.ATTRIB_VALUE_ENTITY_Q:l=w.ATTRIB_VALUE_QUOTED,c="attribValue";break;case w.ATTRIB_VALUE_ENTITY_U:l=w.ATTRIB_VALUE_UNQUOTED,c="attribValue"}";"===i?(r[c]+=H(r),r.entity="",r.state=l):b(r.entity.length?T:v,i)?r.entity+=i:(j(r,"Invalid character in entity name"),r[c]+="&"+r.entity+i,r.entity="",r.state=l);continue;default:throw new Error(r,"Unknown state: "+r.state)}return r.position>=r.bufferCheckPosition&&function(e){for(var r=Math.max(t.MAX_BUFFER_LENGTH,10),n=0,i=0,s=a.length;i<s;i++){var o=e[a[i]].length;if(o>r)switch(a[i]){case"textNode":O(e);break;case"cdata":M(e,"oncdata",e.cdata),e.cdata="";break;case"script":M(e,"onscript",e.script),e.script="";break;default:L(e,"Max buffer length exceeded: "+a[i])}n=Math.max(n,o)}var u=t.MAX_BUFFER_LENGTH-n;e.bufferCheckPosition=u+e.position}(r),r},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){var e;O(e=this),""!==e.cdata&&(M(e,"oncdata",e.cdata),e.cdata=""),""!==e.script&&(M(e,"onscript",e.script),e.script="")}};try{n=r("./node_modules/stream-browserify/index.js").Stream}catch(e){n=function(){}}var s=t.EVENTS.filter(function(e){return"error"!==e&&"end"!==e});function o(e,t){if(!(this instanceof o))return new o(e,t);n.apply(this),this._parser=new i(e,t),this.writable=!0,this.readable=!0;var r=this;this._parser.onend=function(){r.emit("end")},this._parser.onerror=function(e){r.emit("error",e),r._parser.error=null},this._decoder=null,s.forEach(function(e){Object.defineProperty(r,"on"+e,{get:function(){return r._parser["on"+e]},set:function(t){if(!t)return r.removeAllListeners(e),r._parser["on"+e]=t,t;r.on(e,t)},enumerable:!0,configurable:!1})})}o.prototype=Object.create(n.prototype,{constructor:{value:o}}),o.prototype.write=function(t){if("function"==typeof e&&"function"==typeof e.isBuffer&&e.isBuffer(t)){if(!this._decoder){var n=r("./node_modules/string_decoder/lib/string_decoder.js").StringDecoder;this._decoder=new n("utf8")}t=this._decoder.write(t)}return this._parser.write(t.toString()),this.emit("data",t),!0},o.prototype.end=function(e){return e&&e.length&&this.write(e),this._parser.end(),!0},o.prototype.on=function(e,t){var r=this;return r._parser["on"+e]||-1===s.indexOf(e)||(r._parser["on"+e]=function(){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),r.emit.apply(r,t)}),n.prototype.on.call(r,e,t)};var u="\r\n\t ",l="0124356789",c="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",f="'\"",d=u+">",h="[CDATA[",g="DOCTYPE",p="http://www.w3.org/XML/1998/namespace",m="http://www.w3.org/2000/xmlns/",y={xml:p,xmlns:m};u=S(u),l=S(l),c=S(c);var E=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,_=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/,v=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,T=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;function S(e){return e.split("").reduce(function(e,t){return e[t]=!0,e},{})}function b(e,t){return function(e){return"[object RegExp]"===Object.prototype.toString.call(e)}(e)?!!t.match(e):e[t]}function A(e,t){return!b(e,t)}f=S(f),d=S(d);var R,I,C,w=0;for(var N in t.STATE={BEGIN:w++,BEGIN_WHITESPACE:w++,TEXT:w++,TEXT_ENTITY:w++,OPEN_WAKA:w++,SGML_DECL:w++,SGML_DECL_QUOTED:w++,DOCTYPE:w++,DOCTYPE_QUOTED:w++,DOCTYPE_DTD:w++,DOCTYPE_DTD_QUOTED:w++,COMMENT_STARTING:w++,COMMENT:w++,COMMENT_ENDING:w++,COMMENT_ENDED:w++,CDATA:w++,CDATA_ENDING:w++,CDATA_ENDING_2:w++,PROC_INST:w++,PROC_INST_BODY:w++,PROC_INST_ENDING:w++,OPEN_TAG:w++,OPEN_TAG_SLASH:w++,ATTRIB:w++,ATTRIB_NAME:w++,ATTRIB_NAME_SAW_WHITE:w++,ATTRIB_VALUE:w++,ATTRIB_VALUE_QUOTED:w++,ATTRIB_VALUE_CLOSED:w++,ATTRIB_VALUE_UNQUOTED:w++,ATTRIB_VALUE_ENTITY_Q:w++,ATTRIB_VALUE_ENTITY_U:w++,CLOSE_TAG:w++,CLOSE_TAG_SAW_WHITE:w++,SCRIPT:w++,SCRIPT_ENDING:w++},t.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},t.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(t.ENTITIES).forEach(function(e){var r=t.ENTITIES[e],n="number"==typeof r?String.fromCharCode(r):r;t.ENTITIES[e]=n}),t.STATE)t.STATE[t.STATE[N]]=N;function D(e,t,r){e[t]&&e[t](r)}function M(e,t,r){e.textNode&&O(e),D(e,t,r)}function O(e){e.textNode=P(e.opt,e.textNode),e.textNode&&D(e,"ontext",e.textNode),e.textNode=""}function P(e,t){return e.trim&&(t=t.trim()),e.normalize&&(t=t.replace(/\s+/g," ")),t}function L(e,t){return O(e),e.trackPosition&&(t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c),t=new Error(t),e.error=t,D(e,"onerror",t),e}function F(e){return e.sawRoot&&!e.closedRoot&&j(e,"Unclosed root tag"),e.state!==w.BEGIN&&e.state!==w.BEGIN_WHITESPACE&&e.state!==w.TEXT&&L(e,"Unexpected end"),O(e),e.c="",e.closed=!0,D(e,"onend"),i.call(e,e.strict,e.opt),e}function j(e,t){if("object"!=typeof e||!(e instanceof i))throw new Error("bad call to strictFail");e.strict&&L(e,t)}function x(e){e.strict||(e.tagName=e.tagName[e.looseCase]());var t=e.tags[e.tags.length-1]||e,r=e.tag={name:e.tagName,attributes:{}};e.opt.xmlns&&(r.ns=t.ns),e.attribList.length=0,M(e,"onopentagstart",r)}function k(e,t){var r=e.indexOf(":")<0?["",e]:e.split(":"),n=r[0],a=r[1];return t&&"xmlns"===e&&(n="xmlns",a=""),{prefix:n,local:a}}function B(e){if(e.strict||(e.attribName=e.attribName[e.looseCase]()),-1!==e.attribList.indexOf(e.attribName)||e.tag.attributes.hasOwnProperty(e.attribName))e.attribName=e.attribValue="";else{if(e.opt.xmlns){var t=k(e.attribName,!0),r=t.prefix,n=t.local;if("xmlns"===r)if("xml"===n&&e.attribValue!==p)j(e,"xml: prefix must be bound to "+p+"\nActual: "+e.attribValue);else if("xmlns"===n&&e.attribValue!==m)j(e,"xmlns: prefix must be bound to "+m+"\nActual: "+e.attribValue);else{var a=e.tag,i=e.tags[e.tags.length-1]||e;a.ns===i.ns&&(a.ns=Object.create(i.ns)),a.ns[n]=e.attribValue}e.attribList.push([e.attribName,e.attribValue])}else e.tag.attributes[e.attribName]=e.attribValue,M(e,"onattribute",{name:e.attribName,value:e.attribValue});e.attribName=e.attribValue=""}}function U(e,t){if(e.opt.xmlns){var r=e.tag,n=k(e.tagName);r.prefix=n.prefix,r.local=n.local,r.uri=r.ns[n.prefix]||"",r.prefix&&!r.uri&&(j(e,"Unbound namespace prefix: "+JSON.stringify(e.tagName)),r.uri=n.prefix);var a=e.tags[e.tags.length-1]||e;r.ns&&a.ns!==r.ns&&Object.keys(r.ns).forEach(function(t){M(e,"onopennamespace",{prefix:t,uri:r.ns[t]})});for(var i=0,s=e.attribList.length;i<s;i++){var o=e.attribList[i],u=o[0],l=o[1],c=k(u,!0),f=c.prefix,d=c.local,h=""===f?"":r.ns[f]||"",g={name:u,value:l,prefix:f,local:d,uri:h};f&&"xmlns"!==f&&!h&&(j(e,"Unbound namespace prefix: "+JSON.stringify(f)),g.uri=f),e.tag.attributes[u]=g,M(e,"onattribute",g)}e.attribList.length=0}e.tag.isSelfClosing=!!t,e.sawRoot=!0,e.tags.push(e.tag),M(e,"onopentag",e.tag),t||(e.noscript||"script"!==e.tagName.toLowerCase()?e.state=w.TEXT:e.state=w.SCRIPT,e.tag=null,e.tagName=""),e.attribName=e.attribValue="",e.attribList.length=0}function G(e){if(!e.tagName)return j(e,"Weird empty close tag."),e.textNode+="</>",void(e.state=w.TEXT);if(e.script){if("script"!==e.tagName)return e.script+="</"+e.tagName+">",e.tagName="",void(e.state=w.SCRIPT);M(e,"onscript",e.script),e.script=""}var t=e.tags.length,r=e.tagName;e.strict||(r=r[e.looseCase]());for(var n=r;t--&&e.tags[t].name!==n;)j(e,"Unexpected close tag");if(t<0)return j(e,"Unmatched closing tag: "+e.tagName),e.textNode+="</"+e.tagName+">",void(e.state=w.TEXT);e.tagName=r;for(var a=e.tags.length;a-- >t;){var i=e.tag=e.tags.pop();e.tagName=e.tag.name,M(e,"onclosetag",e.tagName);var s={};for(var o in i.ns)s[o]=i.ns[o];var u=e.tags[e.tags.length-1]||e;e.opt.xmlns&&i.ns!==u.ns&&Object.keys(i.ns).forEach(function(t){var r=i.ns[t];M(e,"onclosenamespace",{prefix:t,uri:r})})}0===t&&(e.closedRoot=!0),e.tagName=e.attribValue=e.attribName="",e.attribList.length=0,e.state=w.TEXT}function H(e){var t,r=e.entity,n=r.toLowerCase(),a="";return e.ENTITIES[r]?e.ENTITIES[r]:e.ENTITIES[n]?e.ENTITIES[n]:("#"===(r=n).charAt(0)&&("x"===r.charAt(1)?(r=r.slice(2),a=(t=parseInt(r,16)).toString(16)):(r=r.slice(1),a=(t=parseInt(r,10)).toString(10))),r=r.replace(/^0+/,""),a.toLowerCase()!==r?(j(e,"Invalid character entity"),"&"+e.entity+";"):String.fromCodePoint(t))}function q(e,t){"<"===t?(e.state=w.OPEN_WAKA,e.startTagPosition=e.position):A(u,t)&&(j(e,"Non-whitespace before first tag."),e.textNode=t,e.state=w.TEXT)}function Y(e,t){var r="";return t<e.length&&(r=e.charAt(t)),r}w=t.STATE,String.fromCodePoint||(R=String.fromCharCode,I=Math.floor,C=function(){var e,t,r=[],n=-1,a=arguments.length;if(!a)return"";for(var i="";++n<a;){var s=Number(arguments[n]);if(!isFinite(s)||s<0||s>1114111||I(s)!==s)throw RangeError("Invalid code point: "+s);s<=65535?r.push(s):(e=55296+((s-=65536)>>10),t=s%1024+56320,r.push(e,t)),(n+1===a||r.length>16384)&&(i+=R.apply(null,r),r.length=0)}return i},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:C,configurable:!0,writable:!0}):String.fromCodePoint=C)}(t)}).call(this,r("./node_modules/node-libs-browser/node_modules/buffer/index.js").Buffer)},"./node_modules/setimmediate/setImmediate.js":function(e,t,r){(function(e,t){!function(e){if(!e.setImmediate){var r,n,a,i,s,o=1,u={},l=!1,c=e.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(e);f=f&&f.setTimeout?f:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick(function(){h(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?(i="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(i)&&h(+t.data.slice(i.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(i+t,"*")}):e.MessageChannel?((a=new MessageChannel).port1.onmessage=function(e){h(e.data)},r=function(e){a.port2.postMessage(e)}):c&&"onreadystatechange"in c.createElement("script")?(n=c.documentElement,r=function(e){var t=c.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,n.removeChild(t),t=null},n.appendChild(t)}):r=function(e){setTimeout(h,0,e)},f.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var a={callback:e,args:t};return u[o]=a,r(o),o++},f.clearImmediate=d}function d(e){delete u[e]}function h(e){if(l)setTimeout(h,0,e);else{var t=u[e];if(t){l=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(void 0,r)}}(t)}finally{d(e),l=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,r("./node_modules/webpack/buildin/global.js"),r("./node_modules/process/browser.js"))},"./node_modules/stream-browserify/index.js":function(e,t,r){e.exports=a;var n=r("./node_modules/node-libs-browser/node_modules/events/events.js").EventEmitter;function a(){n.call(this)}r("./node_modules/inherits/inherits_browser.js")(a,n),a.Readable=r("./node_modules/readable-stream/readable-browser.js"),a.Writable=r("./node_modules/readable-stream/writable-browser.js"),a.Duplex=r("./node_modules/readable-stream/duplex-browser.js"),a.Transform=r("./node_modules/readable-stream/transform.js"),a.PassThrough=r("./node_modules/readable-stream/passthrough.js"),a.Stream=a,a.prototype.pipe=function(e,t){var r=this;function a(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function i(){r.readable&&r.resume&&r.resume()}r.on("data",a),e.on("drain",i),e._isStdio||t&&!1===t.end||(r.on("end",o),r.on("close",u));var s=!1;function o(){s||(s=!0,e.end())}function u(){s||(s=!0,"function"==typeof e.destroy&&e.destroy())}function l(e){if(c(),0===n.listenerCount(this,"error"))throw e}function c(){r.removeListener("data",a),e.removeListener("drain",i),r.removeListener("end",o),r.removeListener("close",u),r.removeListener("error",l),e.removeListener("error",l),r.removeListener("end",c),r.removeListener("close",c),e.removeListener("close",c)}return r.on("error",l),e.on("error",l),r.on("end",c),r.on("close",c),e.on("close",c),e.emit("pipe",r),e}},"./node_modules/string_decoder/lib/string_decoder.js":function(e,t,r){var n=r("./node_modules/safe-buffer/index.js").Buffer,a=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===a||!a(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=l,t=4;break;case"utf8":this.fillLast=o,t=4;break;case"base64":this.text=c,this.end=f,t=3;break;default:return this.write=d,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function o(e){var t=this.lastTotal-this.lastNeed,r=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function c(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},i.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},i.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var a=s(t[n]);return a>=0?(a>0&&(e.lastNeed=a-1),a):--n<r||-2===a?0:(a=s(t[n]))>=0?(a>0&&(e.lastNeed=a-2),a):--n<r||-2===a?0:(a=s(t[n]))>=0?(a>0&&(2===a?a=0:e.lastNeed=a-3),a):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},"./node_modules/util-deprecate/browser.js":function(e,t,r){(function(t){function r(e){try{if(!t.localStorage)return!1}catch(e){return!1}var r=t.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}e.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this,r("./node_modules/webpack/buildin/global.js"))},"./node_modules/webpack/buildin/global.js":function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},"./src/core/Debug.js":function(e,t,r){r.r(t);var n=r("./src/core/EventBus.js"),a=r("./src/core/events/Events.js"),i=r("./src/core/FactoryMaker.js"),s=1,o=2,u=3,l=4,c=5;function f(e){e=e||{};var t,r,i,f,d=this.context,h=Object(n.default)(d).getInstance(),g=e.settings,p=[];function m(e){return e&&e.bind?e.bind(window.console):window.console.log.bind(window.console)}function y(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];S.apply(void 0,[s,this].concat(t))}function E(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];S.apply(void 0,[o,this].concat(t))}function _(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];S.apply(void 0,[u,this].concat(t))}function v(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];S.apply(void 0,[l,this].concat(t))}function T(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];S.apply(void 0,[c,this].concat(t))}function S(e,t){var n="",s=null;r&&(s=(new Date).getTime(),n+="["+(s-f)+"]"),i&&t&&t.getClassName&&(n+="["+t.getClassName()+"]",t.getType&&(n+="["+t.getType()+"]")),n.length>0&&(n+=" ");for(var o=arguments.length,u=new Array(o>2?o-2:0),l=2;l<o;l++)u[l-2]=arguments[l];Array.apply(null,u).forEach(function(e){n+=e+" "}),p[e]&&g.get().debug.logLevel>=e&&p[e](n),g&&g.get().debug.dispatchEvent&&h.trigger(a.default.LOG,{message:n,level:e})}return t={getLogger:function(e){return{fatal:y.bind(e),error:E.bind(e),warn:_.bind(e),info:v.bind(e),debug:T.bind(e)}},setLogTimestampVisible:function(e){r=e},setCalleeNameVisible:function(e){i=e}},r=!0,i=!0,f=(new Date).getTime(),"undefined"!=typeof window&&window.console&&(p[s]=m(window.console.error),p[o]=m(window.console.error),p[u]=m(window.console.warn),p[l]=m(window.console.info),p[c]=m(window.console.debug)),t}f.__dashjs_factory_name="Debug";var d=i.default.getSingletonFactory(f);d.LOG_LEVEL_NONE=0,d.LOG_LEVEL_FATAL=s,d.LOG_LEVEL_ERROR=o,d.LOG_LEVEL_WARNING=u,d.LOG_LEVEL_INFO=l,d.LOG_LEVEL_DEBUG=c,i.default.updateSingletonFactory(f.__dashjs_factory_name,d),t.default=d},"./src/core/EventBus.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/streaming/MediaPlayerEvents.js");function i(){var e={};function t(t,r,n){var a=-1;return e[t]?(e[t].some(function(e,t){if(e&&e.callback===r&&(!n||n===e.scope))return a=t,!0}),a):a}var r={on:function(r,n,a){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!r)throw new Error("event type cannot be null or undefined");if(!n||"function"!=typeof n)throw new Error("listener must be a function: "+n);var s=i.priority||0;if(!(t(r,n,a)>=0)){e[r]=e[r]||[];var o={callback:n,scope:a,priority:s};a&&a.getStreamId&&(o.streamId=a.getStreamId()),a&&a.getType&&(o.mediaType=a.getType()),i&&i.mode&&(o.mode=i.mode),e[r].some(function(t,n){if(t&&s>t.priority)return e[r].splice(n,0,o),!0})||e[r].push(o)}},off:function(r,n,a){if(r&&n&&e[r]){var i=t(r,n,a);i<0||(e[r][i]=null)}},trigger:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t&&e[t]){if((r=r||{}).hasOwnProperty("type"))throw new Error("'type' is a reserved word for event dispatching");r.type=t,n.streamId&&(r.streamId=n.streamId),n.mediaType&&(r.mediaType=n.mediaType),e[t].filter(function(e){return!(!e||n.streamId&&e.streamId&&e.streamId!==n.streamId||n.mediaType&&e.mediaType&&e.mediaType!==n.mediaType||n.mode&&e.mode&&e.mode!==n.mode||!e.mode&&n.mode&&n.mode===a.default.EVENT_MODE_ON_RECEIVE)}).forEach(function(e){return e&&e.callback.call(e.scope,r)})}},reset:function(){e={}}};return r}i.__dashjs_factory_name="EventBus";var s=n.default.getSingletonFactory(i);s.EVENT_PRIORITY_LOW=0,s.EVENT_PRIORITY_HIGH=5e3,n.default.updateSingletonFactory(i.__dashjs_factory_name,s),t.default=s},"./src/core/FactoryMaker.js":function(e,t,r){r.r(t);var n=function(){var e,t=[],r={},n={};function a(e,r){for(var n in t){var a=t[n];if(a.context===e&&a.name===r)return a.instance}return null}function i(e,t){return t[e]}function s(e,t,r){e in r&&(r[e]=t)}function o(t,r,n){var a,i=t.__dashjs_factory_name,s=r[i];if(s){var o=s.instance;if(!s.override)return o.apply({context:r,factory:e},n);for(var u in a=t.apply({context:r},n),o=o.apply({context:r,factory:e,parent:a},n))a.hasOwnProperty(u)&&(a[u]=o[u])}else a=t.apply({context:r},n);return a.getClassName=function(){return i},a}return e={extend:function(e,t,r,n){!n[e]&&t&&(n[e]={instance:t,override:r})},getSingletonInstance:a,setSingletonInstance:function(e,r,n){for(var a in t){var i=t[a];if(i.context===e&&i.name===r)return void(t[a].instance=n)}t.push({name:r,context:e,instance:n})},deleteSingletonInstances:function(e){t=t.filter(function(t){return t.context!==e})},getSingletonFactory:function(e){var n=i(e.__dashjs_factory_name,r);return n||(n=function(r){var n;return void 0===r&&(r={}),{getInstance:function(){return n||(n=a(r,e.__dashjs_factory_name)),n||(n=o(e,r,arguments),t.push({name:e.__dashjs_factory_name,context:r,instance:n})),n}}},r[e.__dashjs_factory_name]=n),n},getSingletonFactoryByName:function(e){return i(e,r)},updateSingletonFactory:function(e,t){s(e,t,r)},getClassFactory:function(e){var t=i(e.__dashjs_factory_name,n);return t||(t=function(t){return void 0===t&&(t={}),{create:function(){return o(e,t,arguments)}}},n[e.__dashjs_factory_name]=t),t},getClassFactoryByName:function(e){return i(e,n)},updateClassFactory:function(e,t){s(e,t,n)}},e}();t.default=n},"./src/core/Settings.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/core/Utils.js"),i=r("./src/core/Debug.js"),s=r("./src/streaming/constants/Constants.js"),o=r("./src/streaming/vo/metrics/HTTPRequest.js");function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(){var e,t,r={debug:{logLevel:i.default.LOG_LEVEL_WARNING,dispatchEvent:!1},streaming:{abandonLoadTimeout:1e4,wallclockTimeUpdateInterval:100,lowLatencyEnabled:!1,lowLatencyEnabledByManifest:!0,manifestUpdateRetryInterval:100,cacheInitSegments:!1,eventControllerRefreshDelay:150,capabilities:{filterUnsupportedEssentialProperties:!0,useMediaCapabilitiesApi:!1},timeShiftBuffer:{calcFromSegmentTimeline:!1,fallbackToSegmentTimeline:!0},metrics:{maxListDepth:100},delay:{liveDelayFragmentCount:NaN,liveDelay:NaN,useSuggestedPresentationDelay:!0,applyServiceDescription:!0},protection:{keepProtectionMediaKeys:!1,ignoreEmeEncryptedEvent:!1},buffer:{enableSeekDecorrelationFix:!1,fastSwitchEnabled:!0,flushBufferAtTrackSwitch:!1,reuseExistingSourceBuffers:!0,bufferPruningInterval:10,bufferToKeep:20,bufferTimeAtTopQuality:30,bufferTimeAtTopQualityLongForm:60,initialBufferLevel:NaN,stableBufferTime:12,longFormContentDurationThreshold:600,stallThreshold:.3,useAppendWindow:!0,setStallState:!0},gaps:{jumpGaps:!0,jumpLargeGaps:!0,smallGapLimit:1.5,threshold:.3,enableSeekFix:!1},utcSynchronization:{enabled:!0,useManifestDateHeaderTimeSource:!0,backgroundAttempts:2,timeBetweenSyncAttempts:30,maximumTimeBetweenSyncAttempts:600,minimumTimeBetweenSyncAttempts:2,timeBetweenSyncAttemptsAdjustmentFactor:2,maximumAllowedDrift:100,enableBackgroundSyncAfterSegmentDownloadError:!0,defaultTimingSource:{scheme:"urn:mpeg:dash:utc:http-xsdate:2014",value:"https://time.akamai.com/?iso&ms"}},scheduling:{defaultTimeout:500,lowLatencyTimeout:0,scheduleWhilePaused:!0},text:{defaultEnabled:!0},liveCatchup:{minDrift:.02,maxDrift:12,playbackRate:.5,latencyThreshold:60,playbackBufferMin:.5,enabled:!1,mode:s.default.LIVE_CATCHUP_MODE_DEFAULT},lastBitrateCachingInfo:{enabled:!0,ttl:36e4},lastMediaSettingsCachingInfo:{enabled:!0,ttl:36e4},cacheLoadThresholds:{video:50,audio:5},trackSwitchMode:{audio:s.default.TRACK_SWITCH_MODE_ALWAYS_REPLACE,video:s.default.TRACK_SWITCH_MODE_NEVER_REPLACE},selectionModeForInitialTrack:s.default.TRACK_SELECTION_MODE_HIGHEST_SELECTION_PRIORITY,fragmentRequestTimeout:0,retryIntervals:(e={},l(e,o.HTTPRequest.MPD_TYPE,500),l(e,o.HTTPRequest.XLINK_EXPANSION_TYPE,500),l(e,o.HTTPRequest.MEDIA_SEGMENT_TYPE,1e3),l(e,o.HTTPRequest.INIT_SEGMENT_TYPE,1e3),l(e,o.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE,1e3),l(e,o.HTTPRequest.INDEX_SEGMENT_TYPE,1e3),l(e,o.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE,1e3),l(e,o.HTTPRequest.LICENSE,1e3),l(e,o.HTTPRequest.OTHER_TYPE,1e3),l(e,"lowLatencyReductionFactor",10),e),retryAttempts:(t={},l(t,o.HTTPRequest.MPD_TYPE,3),l(t,o.HTTPRequest.XLINK_EXPANSION_TYPE,1),l(t,o.HTTPRequest.MEDIA_SEGMENT_TYPE,3),l(t,o.HTTPRequest.INIT_SEGMENT_TYPE,3),l(t,o.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE,3),l(t,o.HTTPRequest.INDEX_SEGMENT_TYPE,3),l(t,o.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE,3),l(t,o.HTTPRequest.LICENSE,3),l(t,o.HTTPRequest.OTHER_TYPE,3),l(t,"lowLatencyMultiplyFactor",5),t),abr:{movingAverageMethod:s.default.MOVING_AVERAGE_SLIDING_WINDOW,ABRStrategy:s.default.ABR_STRATEGY_DYNAMIC,additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0,abandonRequestsRule:!1},bandwidthSafetyFactor:.9,useDefaultABRRules:!0,useDeadTimeLatency:!0,limitBitrateByPortal:!1,usePixelRatioInLimitBitrateByPortal:!1,maxBitrate:{audio:-1,video:-1},minBitrate:{audio:-1,video:-1},maxRepresentationRatio:{audio:1,video:1},initialBitrate:{audio:-1,video:-1},initialRepresentationRatio:{audio:-1,video:-1},autoSwitchBitrate:{audio:!0,video:!0},fetchThroughputCalculationMode:s.default.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING},cmcd:{enabled:!1,sid:null,cid:null,rtp:null,rtpSafetyFactor:5,mode:s.default.CMCD_MODE_QUERY}},errors:{recoverAttempts:{mediaErrorDecode:5}}},n=a.default.clone(r);function c(e,t,r){for(var n in e)e.hasOwnProperty(n)&&t.hasOwnProperty(n)&&("object"===u(e[n])&&null!==e[n]?c(e[n],t[n],r.slice()+n+"."):t[n]=a.default.clone(e[n]))}return{get:function(){return n},update:function(e){"object"===u(e)&&c(e,n,"")},reset:function(){n=a.default.clone(r)}}}c.__dashjs_factory_name="Settings";var f=n.default.getSingletonFactory(c);t.default=f},"./src/core/Utils.js":function(e,t,r){r.r(t);var n=r("./node_modules/path-browserify/index.js"),a=r.n(n);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,r;return t=e,r=[{key:"mixin",value:function(t,r,n){var a,s={};if(t)for(var o in r)r.hasOwnProperty(o)&&(a=r[o],o in t&&(t[o]===a||o in s&&s[o]===a)||("object"===i(t[o])&&null!==t[o]?t[o]=e.mixin(t[o],a,n):t[o]=n(a)));return t}},{key:"clone",value:function(t){if(!t||"object"!==i(t))return t;var r;if(t instanceof Array){r=[];for(var n=0,a=t.length;n<a;++n)n in t&&r.push(e.clone(t[n]))}else r={};return e.mixin(r,t,e.clone)}},{key:"addAditionalQueryParameterToUrl",value:function(e,t){try{if(!t||0===t.length)return e;var r=new URL(e);return t.forEach(function(e){e.key&&e.value&&r.searchParams.set(e.key,e.value)}),r.href}catch(t){return e}}},{key:"parseHttpHeaders",value:function(e){var t={};if(!e)return t;for(var r=e.trim().split("\r\n"),n=0,a=r.length;n<a;n++){var i=r[n],s=i.indexOf(": ");s>0&&(t[i.substring(0,s)]=i.substring(s+2))}return t}},{key:"generateUuid",value:function(){var e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var r=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?r:3&r|8).toString(16)})}},{key:"generateHashCode",value:function(e){var t=0;if(0===e.length)return t;for(var r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return t}},{key:"getRelativeUrl",value:function(e,t){try{var r=new URL(e),n=new URL(t);if(r.protocol=n.protocol,r.origin!==n.origin)return t;var i=a.a.relative(r.pathname.substr(0,r.pathname.lastIndexOf("/")),n.pathname.substr(0,n.pathname.lastIndexOf("/"))),s=0===i.length?1:0;return i+=n.pathname.substr(n.pathname.lastIndexOf("/")+s,n.pathname.length-1),n.pathname.length<i.length?n.pathname:i}catch(e){return t}}}],null&&s(t.prototype,null),r&&s(t,r),e}();t.default=o},"./src/core/Version.js":function(e,t,r){r.r(t),r.d(t,"getVersionString",function(){return a});var n="4.2.0";function a(){return n}},"./src/core/errors/Errors.js":function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}r.r(t);var s=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(o,e);var t,r,s=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,a=i(t);if(r){var s=i(this).constructor;e=Reflect.construct(a,arguments,s)}else e=a.apply(this,arguments);return function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function o(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=s.call(this)).MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE=10,e.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE=11,e.XLINK_LOADER_LOADING_FAILURE_ERROR_CODE=12,e.SEGMENT_BASE_LOADER_ERROR_CODE=15,e.TIME_SYNC_FAILED_ERROR_CODE=16,e.FRAGMENT_LOADER_LOADING_FAILURE_ERROR_CODE=17,e.FRAGMENT_LOADER_NULL_REQUEST_ERROR_CODE=18,e.URL_RESOLUTION_FAILED_GENERIC_ERROR_CODE=19,e.APPEND_ERROR_CODE=20,e.REMOVE_ERROR_CODE=21,e.DATA_UPDATE_FAILED_ERROR_CODE=22,e.CAPABILITY_MEDIASOURCE_ERROR_CODE=23,e.CAPABILITY_MEDIAKEYS_ERROR_CODE=24,e.DOWNLOAD_ERROR_ID_MANIFEST_CODE=25,e.DOWNLOAD_ERROR_ID_SIDX_CODE=26,e.DOWNLOAD_ERROR_ID_CONTENT_CODE=27,e.DOWNLOAD_ERROR_ID_INITIALIZATION_CODE=28,e.DOWNLOAD_ERROR_ID_XLINK_CODE=29,e.MANIFEST_ERROR_ID_PARSE_CODE=31,e.MANIFEST_ERROR_ID_NOSTREAMS_CODE=32,e.TIMED_TEXT_ERROR_ID_PARSE_CODE=33,e.MANIFEST_ERROR_ID_MULTIPLEXED_CODE=34,e.MEDIASOURCE_TYPE_UNSUPPORTED_CODE=35,e.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE="parsing failed for ",e.MANIFEST_LOADER_LOADING_FAILURE_ERROR_MESSAGE="Failed loading manifest: ",e.XLINK_LOADER_LOADING_FAILURE_ERROR_MESSAGE="Failed loading Xlink element: ",e.SEGMENTS_UPDATE_FAILED_ERROR_MESSAGE="Segments update failed",e.SEGMENTS_UNAVAILABLE_ERROR_MESSAGE="no segments are available yet",e.SEGMENT_BASE_LOADER_ERROR_MESSAGE="error loading segment ranges from sidx",e.TIME_SYNC_FAILED_ERROR_MESSAGE="Failed to synchronize client and server time",e.FRAGMENT_LOADER_NULL_REQUEST_ERROR_MESSAGE="request is null",e.URL_RESOLUTION_FAILED_GENERIC_ERROR_MESSAGE="Failed to resolve a valid URL",e.APPEND_ERROR_MESSAGE="chunk is not defined",e.REMOVE_ERROR_MESSAGE="Removing data from the SourceBuffer",e.DATA_UPDATE_FAILED_ERROR_MESSAGE="Data update failed",e.CAPABILITY_MEDIASOURCE_ERROR_MESSAGE="mediasource is not supported",e.CAPABILITY_MEDIAKEYS_ERROR_MESSAGE="mediakeys is not supported",e.TIMED_TEXT_ERROR_MESSAGE_PARSE="parsing error :",e.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE="Error creating source buffer of type : ",e}return o}(r("./src/core/errors/ErrorsBase.js").default));t.default=s},"./src/core/errors/ErrorsBase.js":function(e,t,r){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}r.r(t);var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,r;return t=e,(r=[{key:"extend",value:function(e,t){if(e){var r=!!t&&t.override,n=!!t&&t.publicOnly;for(var a in e)!e.hasOwnProperty(a)||this[a]&&!r||n&&-1===e[a].indexOf("public_")||(this[a]=e[a])}}}])&&n(t.prototype,r),e}();t.default=a},"./src/core/events/CoreEvents.js":function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}r.r(t);var s=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(o,e);var t,r,s=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,a=i(t);if(r){var s=i(this).constructor;e=Reflect.construct(a,arguments,s)}else e=a.apply(this,arguments);return function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function o(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=s.call(this)).ATTEMPT_BACKGROUND_SYNC="attemptBackgroundSync",e.BUFFERING_COMPLETED="bufferingCompleted",e.BUFFER_CLEARED="bufferCleared",e.BYTES_APPENDED_END_FRAGMENT="bytesAppendedEndFragment",e.BUFFER_REPLACEMENT_STARTED="bufferReplacementStarted",e.CHECK_FOR_EXISTENCE_COMPLETED="checkForExistenceCompleted",e.CURRENT_TRACK_CHANGED="currentTrackChanged",e.DATA_UPDATE_COMPLETED="dataUpdateCompleted",e.INBAND_EVENTS="inbandEvents",e.INITIAL_STREAM_SWITCH="initialStreamSwitch",e.INIT_FRAGMENT_LOADED="initFragmentLoaded",e.INIT_FRAGMENT_NEEDED="initFragmentNeeded",e.INTERNAL_MANIFEST_LOADED="internalManifestLoaded",e.ORIGINAL_MANIFEST_LOADED="originalManifestLoaded",e.LOADING_COMPLETED="loadingCompleted",e.LOADING_PROGRESS="loadingProgress",e.LOADING_DATA_PROGRESS="loadingDataProgress",e.LOADING_ABANDONED="loadingAborted",e.MANIFEST_UPDATED="manifestUpdated",e.MEDIA_FRAGMENT_LOADED="mediaFragmentLoaded",e.MEDIA_FRAGMENT_NEEDED="mediaFragmentNeeded",e.QUOTA_EXCEEDED="quotaExceeded",e.SEGMENT_LOCATION_BLACKLIST_ADD="segmentLocationBlacklistAdd",e.SEGMENT_LOCATION_BLACKLIST_CHANGED="segmentLocationBlacklistChanged",e.SERVICE_LOCATION_BLACKLIST_ADD="serviceLocationBlacklistAdd",e.SERVICE_LOCATION_BLACKLIST_CHANGED="serviceLocationBlacklistChanged",e.SET_FRAGMENTED_TEXT_AFTER_DISABLED="setFragmentedTextAfterDisabled",e.SET_NON_FRAGMENTED_TEXT="setNonFragmentedText",e.SOURCE_BUFFER_ERROR="sourceBufferError",e.STREAMS_COMPOSED="streamsComposed",e.STREAM_BUFFERING_COMPLETED="streamBufferingCompleted",e.STREAM_REQUESTING_COMPLETED="streamRequestingCompleted",e.TEXT_TRACKS_QUEUE_INITIALIZED="textTracksQueueInitialized",e.TIME_SYNCHRONIZATION_COMPLETED="timeSynchronizationComplete",e.UPDATE_TIME_SYNC_OFFSET="updateTimeSyncOffset",e.URL_RESOLUTION_FAILED="urlResolutionFailed",e.VIDEO_CHUNK_RECEIVED="videoChunkReceived",e.WALLCLOCK_TIME_UPDATED="wallclockTimeUpdated",e.XLINK_ELEMENT_LOADED="xlinkElementLoaded",e.XLINK_READY="xlinkReady",e.SEEK_TARGET="seekTarget",e}return o}(r("./src/core/events/EventsBase.js").default);t.default=s},"./src/core/events/Events.js":function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}r.r(t);var s=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(o,e);var t,r,s=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,a=i(t);if(r){var s=i(this).constructor;e=Reflect.construct(a,arguments,s)}else e=a.apply(this,arguments);return function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),s.apply(this,arguments)}return o}(r("./src/core/events/CoreEvents.js").default),o=new s;t.default=o},"./src/core/events/EventsBase.js":function(e,t,r){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}r.r(t);var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,r;return t=e,(r=[{key:"extend",value:function(e,t){if(e){var r=!!t&&t.override,n=!!t&&t.publicOnly;for(var a in e)!e.hasOwnProperty(a)||this[a]&&!r||n&&-1===e[a].indexOf("public_")||(this[a]=e[a])}}}])&&n(t.prototype,r),e}();t.default=a},"./src/dash/DashAdapter.js":function(e,t,r){r.r(t);var n=r("./src/dash/constants/DashConstants.js"),a=r("./src/dash/vo/RepresentationInfo.js"),i=r("./src/dash/vo/MediaInfo.js"),s=r("./src/dash/vo/StreamInfo.js"),o=r("./src/dash/vo/ManifestInfo.js"),u=r("./src/dash/vo/Event.js"),l=r("./src/core/FactoryMaker.js"),c=r("./src/dash/models/DashManifestModel.js"),f=r("./src/dash/models/PatchManifestModel.js");function d(){var e,t,r,l,d,h,g,p=this.context;function m(e){return t.getRolesForAdaptation(e).filter(function(e){return e.value===n.default.MAIN})[0]}function y(e,r,n){var a=t.getAdaptationsForType(l[0].mpd.manifest,e,r);if(!a||0===a.length)return null;if(a.length>1&&n){var i=v(n,r);if(d[n.id]&&d[n.id][r])for(var s=0,o=a.length;s<o;s++)if(E(d[n.id][r],i[s]))return a[s];for(var u=0,c=a.length;u<c;u++)if(m(a[u]))return a[u]}return a[0]}function E(e,t){if(!e||!t)return!1;var r=e.id===t.id,n=e.codec===t.codec,a=e.viewpoint===t.viewpoint,i=e.lang===t.lang,s=e.roles.toString()===t.roles.toString(),o=e.accessibility.toString()===t.accessibility.toString(),u=e.audioChannelConfiguration.toString()===t.audioChannelConfiguration.toString();return r&&n&&a&&i&&s&&o&&u}function _(e,r,n,a,i,s){var o,u,l,c,f,d,g=[];if(!a||0===a.length)return[];var p=t.getAdaptationsForPeriod(r);for(c=0,d=a.length;c<d;c++)if(o=a[c],u=C(p[l=t.getIndexForAdaptation(o,e,n.index)]),s){var m=u.accessibility.length;for(f=0;f<m;f++)if(u){var y=u.accessibility[f];if(0===y.indexOf("cea-608:")){var E=y.substring(8).split(";");if("CC"===E[0].substring(0,2))for(f=0;f<E.length;f++)u||(u=C.call(this,p[l])),w(u,E[f].substring(0,3),E[f].substring(4)),g.push(u),u=null;else for(f=0;f<E.length;f++)u||(u=C.call(this,p[l])),w(u,"CC"+(f+1),E[f]),g.push(u),u=null}else 0===y.indexOf("cea-608")&&(w(u,h.CC1,"eng"),g.push(u),u=null)}}else i===h.IMAGE?(N(u),g.push(u),u=null):u&&g.push(u);return g}function v(e,r,n){var a=l,i=n,s=[];if(i)M(),a=T(i);else{if(!(l.length>0))return s;i=l[0].mpd.manifest}var o=I(e,a),u=t.getAdaptationsForType(i,e?e.index:null,r);return s=_(i,o,e,u,r),r===h.TEXT&&(u=t.getAdaptationsForType(i,e?e.index:null,h.VIDEO),s=s.concat(_(i,o,e,u,r,!0))),s}function T(e){var r=S(e);return t.getRegularPeriods(r)}function S(e){var r=A(e);return t.getMpd(r)}function b(){l=[],d={}}function A(e){return e||(l.length>0?l[0].mpd.manifest:null)}function R(e){try{var r=I(e.streamInfo,l),n=t.getAdaptationsForPeriod(r);return e&&e.streamInfo&&void 0!==e.streamInfo.id&&n?n[e.index]:null}catch(e){return null}}function I(e,t){for(var r=t.length,n=0;n<r;n++){var a=t[n];if(e&&e.id===a.id)return a}return null}function C(e){if(!e)return null;var r,n=new i.default,a=e.period.mpd.manifest.Period_asArray[e.period.index].AdaptationSet_asArray[e.index];if(n.id=e.id,n.index=e.index,n.type=e.type,n.streamInfo=D(e.period),n.representationCount=t.getRepresentationCount(a),n.labels=t.getLabelsForAdaptation(a),n.lang=t.getLanguageForAdaptation(a),r=t.getViewpointForAdaptation(a),n.viewpoint=r?r.value:void 0,n.accessibility=t.getAccessibilityForAdaptation(a).map(function(e){var t=e.value,r=t;return e.schemeIdUri&&e.schemeIdUri.search("cea-608")>=0&&void 0!==g&&(r=t?"cea-608:"+t:"cea-608",n.embeddedCaptions=!0),r}),n.audioChannelConfiguration=t.getAudioChannelConfigurationForAdaptation(a).map(function(e){return e.value}),0===n.audioChannelConfiguration.length&&Array.isArray(a.Representation_asArray)&&a.Representation_asArray.length>0&&(n.audioChannelConfiguration=t.getAudioChannelConfigurationForRepresentation(a.Representation_asArray[0]).map(function(e){return e.value})),n.roles=t.getRolesForAdaptation(a).map(function(e){return e.value}),n.codec=t.getCodec(a),n.mimeType=t.getMimeType(a),n.contentProtection=t.getContentProtectionData(a),n.bitrateList=t.getBitrateListForAdaptation(a),n.selectionPriority=t.getSelectionPriority(a),n.contentProtection){var s=n.contentProtection.map(function(e){return t.getKID(e)}).filter(function(e){return null!==e});if(s.length){var o=s[0];n.contentProtection.forEach(function(e){e.keyId=o})}}return n.isText=t.getIsText(a),n.supplementalProperties=t.getSupplementalProperties(a),n.isFragmented=t.getIsFragmented(a),n.isEmbedded=!1,n}function w(e,t,r){e.id=t,e.index=100+parseInt(t.substring(2,3)),e.type=h.TEXT,e.codec="cea-608-in-SEI",e.isEmbedded=!0,e.isFragmented=!1,e.lang=r,e.roles=["caption"]}function N(e){e.type=h.IMAGE}function D(e){var r,n,a=new s.default;return a.id=e.id,a.index=e.index,a.start=e.start,a.duration=e.duration,a.manifestInfo=(r=e.mpd,(n=new o.default).dvrWindowSize=r.timeShiftBufferDepth,n.loadedTime=r.manifest.loadedTime,n.availableFrom=r.availabilityStartTime,n.minBufferTime=r.manifest.minBufferTime,n.maxFragmentDuration=r.maxSegmentDuration,n.duration=t.getDuration(r.manifest),n.isDynamic=t.getIsDynamic(r.manifest),n.serviceDescriptions=t.getServiceDescriptions(r.manifest),n.protocol=r.manifest.protocol,n),a.isLast=1===e.mpd.manifest.Period_asArray.length||Math.abs(a.start+a.duration-a.manifestInfo.duration)<1,a}function M(){if(!h)throw new Error("setConfig function has to be called previously")}function O(e){return l.length>0?l[0].mpd.manifest.Period_asArray[e]:null}function P(e,t,r){var n,a,i,s,o;if(e)for(n=e.AdaptationSet_asArray,s=0;s<n.length;s+=1)for(i=n[s].Representation_asArray,o=0;o<i.length;o+=1)if(t===(a=i[o]).id)return r?o:a;return null}return e={getBandwidthForRepresentation:function(e,t){var r;return(r=P(O(t),e))?r.bandwidth:null},getIndexForRepresentation:function(e,t){return function(e,t){var r=P(e,t,!0);return null!==r?r:-1}(O(t),e)},getMaxIndexForBufferType:function(e,r){return function(e,r){var n,a,i,s;if(!e||!r)return-1;for(a=e.AdaptationSet_asArray,s=0;s<a.length;s+=1)if(i=(n=a[s]).Representation_asArray,t.getIsTypeOf(n,r))return i.length;return-1}(O(r),e)},convertRepresentationToRepresentationInfo:function(e){if(e){var r=new a.default,n=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index],i=t.getRepresentationFor(e.index,n);return r.id=e.id,r.quality=e.index,r.bandwidth=t.getBandwidth(i),r.fragmentDuration=e.segmentDuration||(e.segments&&e.segments.length>0?e.segments[0].duration:NaN),r.MSETimeOffset=e.MSETimeOffset,r.mediaInfo=C(e.adaptation),r}return null},getStreamsInfo:function(e,t){var r=[],n=l;if(e&&(M(),n=T(e)),n.length>0){(!t||t>n.length)&&(t=n.length);for(var a=0;a<t;a++)r.push(D(n[a]))}return r},getMediaInfoForType:function(e,r){if(0===l.length||!e)return null;var n=I(e,l);if(!n)return null;var a=t.getAdaptationsForPeriod(n),i=y(e.index,r,e);return i?C(a[t.getIndexForAdaptation(i,l[0].mpd.manifest,e.index)]):null},getAllMediaInfoForType:v,getAdaptationForType:y,getRealAdaptation:function(e,r){var n,a,i=I(e,l);return n=r?r.id:null,l.length>0&&i&&(a=n?t.getAdaptationForId(n,l[0].mpd.manifest,i.index):t.getAdaptationForIndex(r?r.index:null,l[0].mpd.manifest,i.index)),a},getRealPeriodByIndex:function(e){return t.getRealPeriodForIndex(e,l[0].mpd.manifest)},getEssentialPropertiesForRepresentation:function(e){try{return t.getEssentialPropertiesForRepresentation(e)}catch(e){return[]}},getVoRepresentations:function(e){var r=R(e);return t.getRepresentationsForAdaptation(r)},getEventsFor:function(e,r){var n=[];if(l.length>0){var o=l[0].mpd.manifest;e instanceof s.default?n=t.getEventsForPeriod(I(e,l)):e instanceof i.default?n=t.getEventStreamForAdaptationSet(o,R(e)):e instanceof a.default&&(n=t.getEventStreamForRepresentation(o,r))}return n},getEvent:function(e,t,r,n){try{if(!e||!t||isNaN(r)||!n)return null;var a=e.scheme_id_uri,i=e.value;if(!t[a+"/"+i])return null;var s,o=new u.default,l=e.timescale||1,c=n.adaptation.period.start,f=t[a+"/"+i],d=isNaN(n.presentationTimeOffset)?isNaN(f.presentationTimeOffset)?0:f.presentationTimeOffset:n.presentationTimeOffset,h=e.presentation_time_delta/l;s=0===e.version?c+r-d+h:c-d+h;var g=e.event_duration,p=e.id,m=e.message_data;return o.eventStream=f,o.eventStream.value=i,o.eventStream.timescale=l,o.duration=g,o.id=p,o.calculatedPresentationTime=s,o.messageData=m,o.presentationTimeDelta=h,o}catch(e){return null}},getMpd:S,setConfig:function(e){e&&(e.constants&&(h=e.constants),e.cea608parser&&(g=e.cea608parser),e.errHandler&&t.setConfig({errHandler:e.errHandler}),e.BASE64&&t.setConfig({BASE64:e.BASE64}))},updatePeriods:function(e){if(!e)return null;M(),l=T(e)},getIsTextTrack:function(e){return t.getIsText(e)},getUTCTimingSources:function(){var e=A();return t.getUTCTimingSources(e)},getSuggestedPresentationDelay:function(){var e=l.length>0?l[0].mpd:null;return t.getSuggestedPresentationDelay(e)},getAvailabilityStartTime:function(e){var r=S(e);return t.getAvailabilityStartTime(r)},getIsTypeOf:function(e,r){return t.getIsTypeOf(e,r)},getIsDynamic:function(e){var r=A(e);return t.getIsDynamic(r)},getDuration:function(e){var r=A(e);return t.getDuration(r)},getRegularPeriods:T,getLocation:function(e){return t.getLocation(e)},getPatchLocation:function(e){var r=t.getPatchLocation(e),n=t.getPublishTime(e);if(!r||!n)return null;if(r.hasOwnProperty("ttl")&&n){var a=1e3*parseFloat(r.ttl);if(n.getTime()+a<=(new Date).getTime())return null}return r.__text},getManifestUpdatePeriod:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t.getManifestUpdatePeriod(e,r)},getPublishTime:function(e){return t.getPublishTime(e)},getIsDVB:function(e){return t.hasProfile(e,"urn:dvb:dash:profile:dvb-dash:2014")},getIsPatch:function(e){return r.getIsPatch(e)},getBaseURLsFromElement:function(e){return t.getBaseURLsFromElement(e)},getRepresentationSortFunction:function(){return t.getRepresentationSortFunction()},getCodec:function(e,r,n){return t.getCodec(e,r,n)},getPeriodById:function(e){if(!e||0===l.length)return null;var t=l.filter(function(t){return t.id===e});return t&&t.length>0?t[0]:null},setCurrentMediaInfo:function(e,t,r){d[e]=d[e]||{},d[e][t]=d[e][t]||{},d[e][t]=r},isPatchValid:function(e,n){var a=t.getId(e),i=r.getMpdId(n),s=t.getPublishTime(e),o=r.getPublishTime(n),u=r.getOriginalPublishTime(n);return!!(a&&i&&a==i&&s&&u&&s.getTime()==u.getTime()&&o&&s.getTime()<o.getTime())},applyPatchToManifest:function(e,t){r.getPatchOperations(t).forEach(function(t){var r=t.getMpdTarget(e);if(null!==r){var n=r.name,a=r.target,i=r.leaf;if(t.xpath.findsAttribute())switch(t.action){case"add":case"replace":a[n]=t.value;break;case"remove":delete a[n]}else{var s=(a[n+"_asArray"]||[]).indexOf(i),o="prepend"===t.position||"before"===t.position;if(("remove"===t.action||"replace"===t.action)&&(delete a[n],-1!=s)){var u=a[n+"_asArray"];u.splice(s,1),u.length>1?a[n]=u:1==u.length?a[n]=u[0]:delete a[n+"_asArray"]}"add"!==t.action&&"replace"!==t.action||Object.keys(t.value).forEach(function(e){var r=t.value[e],i=a[e+"_asArray"]||[];if(0===i.length&&a[e]&&i.push(a[e]),0===i.length)i=r;else{var u=i.length;u=e==n&&-1!=s?s+(o?0:1)+("replace"==t.action?-1:0):o?0:i.length,i.splice.apply(i,[u,0].concat(r))}a[e+"_asArray"]=i,a[e]=1==i.length?i[0]:i})}}})},areMediaInfosEqual:E,reset:b},t=Object(c.default)(p).getInstance(),r=Object(f.default)(p).getInstance(),b(),e}d.__dashjs_factory_name="DashAdapter",t.default=l.default.getSingletonFactory(d)},"./src/dash/DashHandler.js":function(e,t,r){r.r(t);var n=r("./src/streaming/vo/FragmentRequest.js"),a=r("./src/streaming/vo/metrics/HTTPRequest.js"),i=r("./src/core/FactoryMaker.js"),s=r("./src/streaming/MediaPlayerEvents.js"),o=r("./src/dash/utils/SegmentsUtils.js"),u=r("./src/dash/constants/DashConstants.js");function l(e){var t,r,i,l,c,f=(e=e||{}).eventBus,d=e.debug,h=e.urlUtils,g=e.type,p=e.streamInfo,m=e.segmentsController,y=e.timelineConverter,E=e.baseURLController;function _(){return g}function v(){i=null}function T(e,t,r){var n,a,i=E.resolve(r.path);return i&&t!==i.url&&h.isRelative(t)?(n=i.url,a=i.serviceLocation,t&&(n=h.resolve(t,n))):n=t,!h.isRelative(n)&&(e.url=n,e.serviceLocation=a,!0)}function S(e,t){if(null==t)return null;var r=new n.default,i=t.representation,s=i.adaptation.period.mpd.manifest.Period_asArray[i.adaptation.period.index].AdaptationSet_asArray[i.adaptation.index].Representation_asArray[i.index].bandwidth,u=t.media;return u=Object(o.replaceTokenForTemplate)(u,"Number",t.replacementNumber),u=Object(o.replaceTokenForTemplate)(u,"Time",t.replacementTime),u=Object(o.replaceTokenForTemplate)(u,"Bandwidth",s),u=Object(o.replaceIDForTemplate)(u,i.id),u=Object(o.unescapeDollarsInTemplate)(u),r.mediaType=_(),r.type=a.HTTPRequest.MEDIA_SEGMENT_TYPE,r.range=t.mediaRange,r.startTime=t.presentationStartTime,r.mediaStartTime=t.mediaStartTime,r.duration=t.duration,r.timescale=i.timescale,r.availabilityStartTime=t.availabilityStartTime,r.availabilityEndTime=t.availabilityEndTime,r.wallStartTime=t.wallStartTime,r.quality=i.index,r.index=t.index,r.mediaInfo=e,r.adaptationIndex=i.adaptation.index,r.representationId=i.id,T(r,u,i)?r:void 0}function b(e,t,n){var a=null;if(!t||!t.segmentInfoType)return a;var s=m.getSegmentByTime(t,n);return s&&(i=s,r.debug("Index for time "+n+" is "+s.index),a=S(e,s)),a}function A(){r.debug("Dynamic stream complete"),c=!0}return t={initialize:function(e){l=e,c=!1,m.initialize(e)},getStreamId:function(){return p.id},getType:_,getStreamInfo:function(){return p},getInitRequest:function(e,t){return t?function(e,t,r){var i=new n.default,s=t.adaptation.period,u=s.start;if(i.mediaType=r,i.type=a.HTTPRequest.INIT_SEGMENT_TYPE,i.range=t.range,i.availabilityStartTime=y.calcAvailabilityStartTimeFromPresentationTime(u,t,l),i.availabilityEndTime=y.calcAvailabilityEndTimeFromPresentationTime(u+s.duration,t,l),i.quality=t.index,i.mediaInfo=e,i.representationId=t.id,T(i,t.initialization,t))return i.url=Object(o.replaceTokenForTemplate)(i.url,"Bandwidth",t.bandwidth),i}(e,t,_()):null},getSegmentRequestForTime:b,getCurrentIndex:function(){return i?i.index:-1},getNextSegmentRequest:function(e,t){var n=null;if(!t||!t.segmentInfoType)return null;var a=i?i.index+1:0,s=m.getSegmentByIndex(t,a,i?i.mediaStartTime:-1);if(s)n=S(e,s),i=s;else{if(l&&!c)return r.debug(_()+" No segment found at index: "+a+". Wait for next loop"),null;c=!0}return n},isLastSegmentRequested:function(e,t){if(!e||!i)return!1;if(c)return!0;if(!isFinite(e.adaptation.period.duration))return!1;if(i.presentationStartTime+i.duration>t)return!1;if(e.mediaFinishedInformation&&!isNaN(e.mediaFinishedInformation.numberOfSegments)&&!isNaN(i.index)&&i.index>=e.mediaFinishedInformation.numberOfSegments-1){if(!l||e.segmentInfoType===u.default.SEGMENT_TEMPLATE)return!0;if(l&&e.segmentInfoType===u.default.SEGMENT_LIST&&e.adaptation.period.nextPeriodId)return!0}return!!(l&&e.adaptation.period.nextPeriodId&&e.segmentInfoType===u.default.SEGMENT_TIMELINE&&e.mediaFinishedInformation&&!isNaN(e.mediaFinishedInformation.mediaTimeOfLastSignaledSegment)&&i&&!isNaN(i.mediaStartTime)&&!isNaN(i.duration)&&i.mediaStartTime+i.duration>=e.mediaFinishedInformation.mediaTimeOfLastSignaledSegment-.05)},reset:function(){v(),f.off(s.default.DYNAMIC_TO_STATIC,A,t)},getNextSegmentRequestIdempotent:function(e,t){var r=i?i.index+1:0,n=m.getSegmentByIndex(t,r,i?i.mediaStartTime:-1);return n?S(e,n):null},getValidSeekTimeCloseToTargetTime:function(e,t,r,n){try{if(isNaN(e)||!t||!r)return NaN;if(e<0&&(e=0),isNaN(n)&&(n=.5),b(t,r,e))return e;for(var a=r.adaptation.period.start,i=r.adaptation.period.start+r.adaptation.period.duration,s=Math.min(e+n,i),o=Math.max(e-n,a),u=NaN,l=null;s<=i||o>=a;){var c=null,f=null;if(s<=i&&(c=b(t,r,s)),o>=a&&(f=b(t,r,o)),f){u=o,l=f;break}if(c){u=s,l=c;break}s+=n,o-=n}if(l){var d=l.startTime+l.duration;return e>=l.startTime&&d-e>n?e:e<l.startTime?l.startTime:Math.min(d-n,u)}return u}catch(e){return NaN}}},r=d.getLogger(t),v(),f.on(s.default.DYNAMIC_TO_STATIC,A,t),t}l.__dashjs_factory_name="DashHandler",t.default=i.default.getClassFactory(l)},"./src/dash/DashMetrics.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/Constants.js"),a=r("./src/streaming/vo/metrics/HTTPRequest.js"),i=r("./src/core/FactoryMaker.js"),s=r("./src/streaming/constants/MetricsConstants.js"),o=r("./src/dash/utils/Round10.js"),u=r("./src/streaming/models/MetricsModel.js"),l=r("./src/core/Utils.js"),c=r("./src/streaming/vo/metrics/PlayList.js");function f(e){e=e||{};var t,r,i,f,d=this.context,h=e.metricsModel;function g(e){var t=h.getMetricsFor(e,!0);if(!t)return null;var r,n=t.HttpList,a=null;if(!n||n.length<=0)return null;for(r=n.length-1;r>=0;){if(n[r].responsecode){a=n[r];break}r--}return a}function p(e){var t=h.getMetricsFor(e,!0);return t&&t.HttpList?t.HttpList:[]}function m(e,t){if(!e)return null;var r=e[t];return r&&0!==r.length?r[r.length-1]:null}return t={getCurrentRepresentationSwitch:function(e){return m(h.getMetricsFor(e,!0),s.default.TRACK_SWITCH)},getCurrentBufferState:function(e){return m(h.getMetricsFor(e,!0),s.default.BUFFER_STATE)},getCurrentBufferLevel:function(e){var t=m(h.getMetricsFor(e,!0),s.default.BUFFER_LEVEL);return t?o.default.round10(t.level/1e3,-3):0},getCurrentHttpRequest:g,getHttpRequests:p,getCurrentDroppedFrames:function(){return m(h.getMetricsFor(n.default.VIDEO,!0),s.default.DROPPED_FRAMES)},getCurrentSchedulingInfo:function(e){return m(h.getMetricsFor(e,!0),s.default.SCHEDULING_INFO)},getCurrentDVRInfo:function(e){return m(e?h.getMetricsFor(e,!0):h.getMetricsFor(n.default.VIDEO,!0)||h.getMetricsFor(n.default.AUDIO,!0),s.default.DVR_INFO)},getCurrentManifestUpdate:function(){return m(h.getMetricsFor(n.default.STREAM),s.default.MANIFEST_UPDATE)},getLatestFragmentRequestHeaderValueByID:function(e,t){if(!t)return null;var r={},n=g(e);n&&(r=l.default.parseHttpHeaders(n._responseHeaders));var a=r[t.toLowerCase()];return void 0===a?null:a},getLatestMPDRequestHeaderValueByID:function(e){if(!e)return null;var t,r,i,s={};for(i=(t=p(n.default.STREAM)).length-1;i>=0;i--)if((r=t[i]).type===a.HTTPRequest.MPD_TYPE){s=l.default.parseHttpHeaders(r._responseHeaders);break}var o=s[e.toLowerCase()];return void 0===o?null:o},addRepresentationSwitch:function(e,t,r,n,a){h.addRepresentationSwitch(e,t,r,n,a)},addDVRInfo:function(e,t,r,n){h.addDVRInfo(e,t,r,n)},updateManifestUpdateInfo:function(e){var t=this.getCurrentManifestUpdate();h.updateManifestUpdateInfo(t,e)},addManifestUpdateStreamInfo:function(e){if(e){var t=this.getCurrentManifestUpdate();h.addManifestUpdateStreamInfo(t,e.id,e.index,e.start,e.duration)}},addManifestUpdateRepresentationInfo:function(e,t){if(e){var r=this.getCurrentManifestUpdate();h.addManifestUpdateRepresentationInfo(r,e.id,e.index,e.streamIndex,t,e.presentationTimeOffset,e.startNumber,e.fragmentInfoType)}},addManifestUpdate:function(e){h.addManifestUpdate(n.default.STREAM,e.type,e.requestStartDate,e.requestEndDate)},addHttpRequest:function(e,t,r,n,a){h.addHttpRequest(e.mediaType,null,e.type,e.url,e.quality,t,e.serviceLocation||null,e.range||null,e.requestStartDate,e.firstByteDate,e.requestEndDate,r,e.duration,n,a)},addSchedulingInfo:function(e,t){h.addSchedulingInfo(e.mediaType,new Date,e.type,e.startTime,e.availabilityStartTime,e.duration,e.quality,e.range,t)},addRequestsQueue:function(e,t,r){h.addRequestsQueue(e,t,r)},addBufferLevel:function(e,t,r){h.addBufferLevel(e,t,r)},addBufferState:function(e,t,r){h.addBufferState(e,t,r)},addDroppedFrames:function(e){h.addDroppedFrames(n.default.VIDEO,e)},addPlayList:function(){f&&(h.addPlayList(f),f=null)},addDVBErrors:function(e){h.addDVBErrors(e)},createPlaylistMetrics:function(e,t){(f=new c.PlayList).start=new Date,f.mstart=e,f.starttype=t},createPlaylistTraceMetrics:function(e,t,n){!0===r&&(r=!1,(i=new c.PlayListTrace).representationid=e,i.start=new Date,i.mstart=t,i.playbackspeed=null!==n?n.toString():null)},updatePlayListTraceMetrics:function(e){if(i)for(var t in i)i[t]=e[t]},pushPlayListTraceMetrics:function(e,t){if(!1===r&&f&&i&&i.start){var n=i.start,a=e.getTime()-n.getTime();i.duration=a,i.stopreason=t,f.trace.push(i),r=!0}},clearAllCurrentMetrics:function(){h.clearAllCurrentMetrics()}},h=h||Object(u.default)(d).getInstance({settings:e.settings}),r=!0,i=null,f=null,t}f.__dashjs_factory_name="DashMetrics",t.default=i.default.getSingletonFactory(f)},"./src/dash/SegmentBaseLoader.js":function(e,t,r){r.r(t);var n=r("./src/dash/vo/Segment.js"),a=r("./src/streaming/vo/DashJSError.js"),i=r("./src/core/FactoryMaker.js"),s=r("./src/streaming/vo/FragmentRequest.js"),o=r("./src/streaming/net/URLLoader.js");function u(){var e,t,r,i,u,l,c,f,d,h,g,p,m,y=this.context;function E(e,r,n,a){var s=null,o=e?m.resolve(e.path):null,u=a||{init:!0,url:o?o.url:void 0,range:{start:0,end:1500},searching:!1,bytesLoaded:0,bytesToLoad:1500,mediaType:r};t.debug("Start searching for initialization.");var l=T(u);f.load({request:l,success:function(t){if(u.bytesLoaded=u.range.end,!(s=i.findInitRange(t)))return u.range.end=u.bytesLoaded+u.bytesToLoad,E(e,r,n,u);e.range=s,n(e)},error:function(){n(e)}}),t.debug("Perform init search: "+u.url)}function _(e,r,a,s,o,u){if(a&&(void 0===a.start||void 0===a.end)){var l=a?a.toString().split("-"):null;a=l?{start:parseFloat(l[0]),end:parseFloat(l[1])}:null}o=o||v;var c=null,d=null,h=!!a,g=e?m.resolve(e.path):null,p={init:!1,url:g?g.url:void 0,range:h?a:{start:0,end:1500},searching:!h,bytesLoaded:u?u.bytesLoaded:0,bytesToLoad:1500,mediaType:r},y=T(p);f.load({request:y,success:function(a){var u=p.bytesToLoad,l=a.byteLength;if(p.bytesLoaded=p.range.end-p.range.start,c=i.parse(a),(d=c.getBox("sidx"))&&d.isComplete){var f,h,g=d.references;if(null!=g&&g.length>0&&(f=1===g[0].reference_type),f){var m,y,E,v;t.debug("Initiate multiple SIDX load."),p.range.end=p.range.start+d.size;var T=[],S=0,b=(d.offset||p.range.start)+d.size,A=function(t){t?(T=T.concat(t),++S>=y&&(T.sort(function(e,t){return e.startTime-t.startTime<0?-1:0}),o(T,e,s))):o(null,e,s)};for(m=0,y=g.length;m<y;m++)E=b,v=b+g[m].referenced_size-1,b+=g[m].referenced_size,_(e,r,{start:E,end:v},s,A,p)}else t.debug("Parsing segments from SIDX. representation "+r+" - id: "+e.id+" for range : "+p.range.start+" - "+p.range.end),h=function(e,t){for(var r,a,i,s,o=e.references,u=o.length,l=e.timescale,c=e.earliest_presentation_time,f=t.range.start+e.offset+e.first_offset+e.size,d=[],h=0;h<u;h++)i=o[h].subsegment_duration,s=o[h].referenced_size,(r=new n.default).duration=i,r.startTime=c,r.timescale=l,a=f+s-1,r.mediaRange=f+"-"+a,d.push(r),c+=i,f+=s;return d}(d,p),o(h,e,s)}else{if(d)p.range.start=d.offset||p.range.start,p.range.end=p.range.start+(d.size||u);else{if(l<p.bytesLoaded)return void o(null,e,s);var R=c.getLastBox();R&&R.size?(p.range.start=R.offset+R.size,p.range.end=p.range.start+u):p.range.end+=u}_(e,r,p.range,s,null,p)}},error:function(){o(null,e,s)}}),t.debug("Perform SIDX load for type ".concat(r," : ").concat(p.url," with range ").concat(p.range.start," - ").concat(p.range.end))}function v(e,t,r){r({segments:e,representation:t,error:e?void 0:new a.default(d.SEGMENT_BASE_LOADER_ERROR_CODE,d.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})}function T(e){if(e.url){var t=new s.default;return t.setInfo(e),t}}return e={setConfig:function(n){n.baseURLController&&(m=n.baseURLController),n.dashMetrics&&(l=n.dashMetrics),n.mediaPlayerModel&&(c=n.mediaPlayerModel),n.errHandler&&(r=n.errHandler),n.boxParser&&(i=n.boxParser),n.debug&&(t=n.debug.getLogger(e)),n.requestModifier&&(u=n.requestModifier),n.errors&&(d=n.errors),n.urlUtils&&(p=n.urlUtils),n.constants&&(h=n.constants),n.dashConstants&&(g=n.dashConstants)},initialize:function(){f=Object(o.default)(y).create({errHandler:r,dashMetrics:l,mediaPlayerModel:c,requestModifier:u,boxParser:i,errors:d,urlUtils:p,constants:h,dashConstants:g})},loadInitialization:function(e,t){return new Promise(function(r){E(e,t,r)})},loadSegments:function(e,t,r){return new Promise(function(n){_(e,t,r,n)})},reset:function(){f&&(f.abort(),f=null)}}}u.__dashjs_factory_name="SegmentBaseLoader",t.default=i.default.getSingletonFactory(u)},"./src/dash/WebmSegmentBaseLoader.js":function(e,t,r){r.r(t);var n=r("./src/streaming/utils/EBMLParser.js"),a=r("./src/streaming/constants/Constants.js"),i=r("./src/core/FactoryMaker.js"),s=r("./src/dash/vo/Segment.js"),o=r("./src/streaming/vo/FragmentRequest.js"),u=r("./src/streaming/net/URLLoader.js"),l=r("./src/streaming/vo/DashJSError.js");function c(){var e,t,r,i,c,f,d,h,g,p,m=this.context;function y(e){var t=new o.default;return t.setInfo(e),t}return e={setConfig:function(r){if(!(r.baseURLController&&r.dashMetrics&&r.mediaPlayerModel&&r.errHandler))throw new Error(a.default.MISSING_CONFIG_ERROR);p=r.baseURLController,f=r.dashMetrics,d=r.mediaPlayerModel,i=r.errHandler,g=r.errors,t=r.debug.getLogger(e),c=r.requestModifier},initialize:function(){h=Object(u.default)(m).create({errHandler:i,dashMetrics:f,mediaPlayerModel:d,requestModifier:c,errors:g})},loadInitialization:function(e,r){return new Promise(function(n){var a=null,i=e?p.resolve(e.path):null,s=e?e.range.split("-"):null,o={range:{start:s?parseFloat(s[0]):null,end:s?parseFloat(s[1]):null},request:a,url:i?i.url:void 0,init:!0,mediaType:r};t.info("Start loading initialization."),a=y(o),h.load({request:a,success:function(){n(e)},error:function(){n(e)}}),t.debug("Perform init load: "+o.url)})},loadSegments:function(e,a,i){return new Promise(function(o){var u=null,c=e?p.resolve(e.path):null,f=c?c.url:void 0;u=y({bytesLoaded:0,bytesToLoad:8192,range:{start:0,end:8192},request:u,url:f,init:!1,mediaType:a}),t.debug("Parsing ebml header"),h.load({request:u,success:function(a){!function(e,a,i,o){if(e&&0!==e.byteLength){var u,l,c,f,d=Object(n.default)(m).create({data:e}),g=i?i.split("-"):null,p=null,E={url:a,range:{start:g?parseFloat(g[0]):null,end:g?parseFloat(g[1]):null},request:p};for(t.debug("Parse EBML header: "+E.url),d.skipOverElement(r.EBML),d.consumeTag(r.Segment),c=d.getMatroskaCodedNum(),c+=d.getPos(),f=d.getPos();d.moreData()&&!d.consumeTagAndSize(r.Segment.Info,!0);)if(!(d.skipOverElement(r.Segment.SeekHead,!0)||d.skipOverElement(r.Segment.Tracks,!0)||d.skipOverElement(r.Segment.Cues,!0)||d.skipOverElement(r.Void,!0)))throw new Error("no valid top level element found");for(;void 0===u;){var _=d.getMatroskaCodedNum(!0),v=d.getMatroskaCodedNum();_===r.Segment.Info.Duration.tag?u=d[r.Segment.Info.Duration.parse](v):d.setPos(d.getPos()+v)}p=y(E),h.load({request:p,success:function(e){l=function(e,a,i,o){var u,l,c,f,d,h,g,p;for(c=[],d=0,h=(l=function(e){var t,a,i=[],s=Object(n.default)(m).create({data:e});for(s.consumeTagAndSize(r.Segment.Cues);s.moreData()&&s.consumeTagAndSize(r.Segment.Cues.CuePoint,!0);){for((t={}).CueTime=s.parseTag(r.Segment.Cues.CuePoint.CueTime),t.CueTracks=[];s.moreData()&&s.consumeTag(r.Segment.Cues.CuePoint.CueTrackPositions,!0);){var o=s.getMatroskaCodedNum(),u=s.getPos();if((a={}).Track=s.parseTag(r.Segment.Cues.CuePoint.CueTrackPositions.CueTrack),0===a.Track)throw new Error("Cue track cannot be 0");a.ClusterPosition=s.parseTag(r.Segment.Cues.CuePoint.CueTrackPositions.CueClusterPosition),t.CueTracks.push(a),s.setPos(u+o)}if(0===t.CueTracks.length)throw new Error("Mandatory cuetrack not found");i.push(t)}if(0===i.length)throw new Error("mandatory cuepoint not found");return i}(e)).length;d<h;d+=1)f=new s.default,u=d<l.length-1?l[d+1].CueTime-l[d].CueTime:o-l[d].CueTime,f.duration=u,f.startTime=l[d].CueTime,f.timescale=1e3,g=l[d].CueTracks[0].ClusterPosition+a,p=d<l.length-1?l[d+1].CueTracks[0].ClusterPosition+a-1:i-1,f.mediaRange=g+"-"+p,c.push(f);return t.debug("Parsed cues: "+c.length+" cues."),c}(e,f,c,u),o(l)},error:function(){t.error("Download Error: Cues "+E.url),o(null)}}),t.debug("Perform cues load: "+E.url+" bytes="+E.range.start+"-"+E.range.end)}else o(null)}(a,f,i,function(t){o({segments:t,representation:e,error:t?void 0:new l.default(g.SEGMENT_BASE_LOADER_ERROR_CODE,g.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})})},error:function(){o({representation:e,error:new l.default(g.SEGMENT_BASE_LOADER_ERROR_CODE,g.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})}})})},reset:function(){h&&(h.abort(),h=null)}},r={EBML:{tag:440786851,required:!0},Segment:{tag:408125543,required:!0,SeekHead:{tag:290298740,required:!0},Info:{tag:357149030,required:!0,TimecodeScale:{tag:2807729,required:!0,parse:"getMatroskaUint"},Duration:{tag:17545,required:!0,parse:"getMatroskaFloat"}},Tracks:{tag:374648427,required:!0},Cues:{tag:475249515,required:!0,CuePoint:{tag:187,required:!0,CueTime:{tag:179,required:!0,parse:"getMatroskaUint"},CueTrackPositions:{tag:183,required:!0,CueTrack:{tag:247,required:!0,parse:"getMatroskaUint"},CueClusterPosition:{tag:241,required:!0,parse:"getMatroskaUint"}}}}},Void:{tag:236,required:!0}},e}c.__dashjs_factory_name="WebmSegmentBaseLoader",t.default=i.default.getSingletonFactory(c)},"./src/dash/constants/DashConstants.js":function(e,t,r){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}r.r(t);var a=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}var t,r;return t=e,(r=[{key:"init",value:function(){this.BASE_URL="BaseURL",this.SEGMENT_BASE="SegmentBase",this.SEGMENT_TEMPLATE="SegmentTemplate",this.SEGMENT_LIST="SegmentList",this.SEGMENT_URL="SegmentURL",this.SEGMENT_TIMELINE="SegmentTimeline",this.SEGMENT_PROFILES="segmentProfiles",this.ADAPTATION_SET="AdaptationSet",this.REPRESENTATION="Representation",this.REPRESENTATION_INDEX="RepresentationIndex",this.SUB_REPRESENTATION="SubRepresentation",this.INITIALIZATION="Initialization",this.INITIALIZATION_MINUS="initialization",this.MPD="MPD",this.PERIOD="Period",this.ASSET_IDENTIFIER="AssetIdentifier",this.EVENT_STREAM="EventStream",this.ID="id",this.PROFILES="profiles",this.SERVICE_LOCATION="serviceLocation",this.RANGE="range",this.INDEX="index",this.MEDIA="media",this.BYTE_RANGE="byteRange",this.INDEX_RANGE="indexRange",this.MEDIA_RANGE="mediaRange",this.VALUE="value",this.CONTENT_TYPE="contentType",this.MIME_TYPE="mimeType",this.BITSTREAM_SWITCHING="BitstreamSwitching",this.BITSTREAM_SWITCHING_MINUS="bitstreamSwitching",this.CODECS="codecs",this.DEPENDENCY_ID="dependencyId",this.MEDIA_STREAM_STRUCTURE_ID="mediaStreamStructureId",this.METRICS="Metrics",this.METRICS_MINUS="metrics",this.REPORTING="Reporting",this.WIDTH="width",this.HEIGHT="height",this.SAR="sar",this.FRAMERATE="frameRate",this.AUDIO_SAMPLING_RATE="audioSamplingRate",this.MAXIMUM_SAP_PERIOD="maximumSAPPeriod",this.START_WITH_SAP="startWithSAP",this.MAX_PLAYOUT_RATE="maxPlayoutRate",this.CODING_DEPENDENCY="codingDependency",this.SCAN_TYPE="scanType",this.FRAME_PACKING="FramePacking",this.AUDIO_CHANNEL_CONFIGURATION="AudioChannelConfiguration",this.CONTENT_PROTECTION="ContentProtection",this.ESSENTIAL_PROPERTY="EssentialProperty",this.SUPPLEMENTAL_PROPERTY="SupplementalProperty",this.INBAND_EVENT_STREAM="InbandEventStream",this.ACCESSIBILITY="Accessibility",this.ROLE="Role",this.RATING="Rating",this.CONTENT_COMPONENT="ContentComponent",this.SUBSET="Subset",this.LANG="lang",this.VIEWPOINT="Viewpoint",this.ROLE_ASARRAY="Role_asArray",this.ACCESSIBILITY_ASARRAY="Accessibility_asArray",this.AUDIOCHANNELCONFIGURATION_ASARRAY="AudioChannelConfiguration_asArray",this.CONTENTPROTECTION_ASARRAY="ContentProtection_asArray",this.MAIN="main",this.DYNAMIC="dynamic",this.STATIC="static",this.MEDIA_PRESENTATION_DURATION="mediaPresentationDuration",this.MINIMUM_UPDATE_PERIOD="minimumUpdatePeriod",this.CODEC_PRIVATE_DATA="codecPrivateData",this.BANDWITH="bandwidth",this.SOURCE_URL="sourceURL",this.TIMESCALE="timescale",this.DURATION="duration",this.START_NUMBER="startNumber",this.PRESENTATION_TIME_OFFSET="presentationTimeOffset",this.AVAILABILITY_START_TIME="availabilityStartTime",this.AVAILABILITY_END_TIME="availabilityEndTime",this.TIMESHIFT_BUFFER_DEPTH="timeShiftBufferDepth",this.MAX_SEGMENT_DURATION="maxSegmentDuration",this.PRESENTATION_TIME="presentationTime",this.MIN_BUFFER_TIME="minBufferTime",this.MAX_SUBSEGMENT_DURATION="maxSubsegmentDuration",this.START="start",this.AVAILABILITY_TIME_OFFSET="availabilityTimeOffset",this.AVAILABILITY_TIME_COMPLETE="availabilityTimeComplete",this.CENC_DEFAULT_KID="cenc:default_KID",this.DVB_PRIORITY="dvb:priority",this.DVB_WEIGHT="dvb:weight",this.SUGGESTED_PRESENTATION_DELAY="suggestedPresentationDelay",this.SERVICE_DESCRIPTION="ServiceDescription",this.SERVICE_DESCRIPTION_SCOPE="Scope",this.SERVICE_DESCRIPTION_LATENCY="Latency",this.SERVICE_DESCRIPTION_PLAYBACK_RATE="PlaybackRate",this.PATCH_LOCATION="PatchLocation",this.PUBLISH_TIME="publishTime",this.ORIGINAL_PUBLISH_TIME="originalPublishTime",this.ORIGINAL_MPD_ID="mpdId"}}])&&n(t.prototype,r),e}());t.default=a},"./src/dash/controllers/RepresentationController.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/Constants.js"),a=r("./src/core/FactoryMaker.js"),i=r("./src/streaming/MediaPlayerEvents.js"),s=r("./src/dash/utils/SegmentsUtils.js");function o(e){var t,r,a,o,u,l=(e=e||{}).eventBus,c=e.events,f=e.abrController,d=e.dashMetrics,h=e.playbackController,g=e.timelineConverter,p=e.type,m=e.streamInfo,y=e.dashConstants,E=e.segmentsController,_=e.isDynamic;function v(){return p}function T(){if(!(f&&d&&h&&g))throw new Error(n.default.MISSING_CONFIG_ERROR)}function S(){return a}function b(){return u}function A(){r=null,a=!0,o=[]}function R(e){return new Promise(function(t,r){var n=e.hasInitialization(),a=e.hasSegments(),i=[];i.push(E.updateInitData(e,n)),i.push(E.updateSegmentData(e,a)),Promise.all(i).then(function(r){var n;r[0]&&!r[0].error&&(e=function(e,t){return t&&!t.error&&t.representation?t.representation:e}(e,r[0])),r[1]&&!r[1].error&&(e=function(e,t){if(t&&!t.error){var r,n,a,i,o=t.segments,u=[],l=0;for(r=0,n=o?o.length:0;r<n;r++)a=o[r],(i=Object(s.getTimeBasedSegment)(g,_,e,a.startTime,a.duration,a.timescale,a.media,a.mediaRange,l))&&(u.push(i),i=null,l++);return u.length>0&&(e.segments=u),e}}(e,r[1])),(n=e).mediaFinishedInformation=E.getMediaFinishedInformation(n),function(e){if(S()){var t,r,n=d.getCurrentManifestUpdate(),a=!1;if(n){for(var i=0;i<n.representationInfo.length;i++)if((t=n.representationInfo[i]).index===e.index&&t.mediaType===v()){a=!0;break}a||d.addManifestUpdateRepresentationInfo(e,v())}if(function(){for(var e=0,t=o.length;e<t;e++){var r=o[e].segmentInfoType;if(!o[e].hasInitialization()||(r===y.SEGMENT_BASE||r===y.BASE_URL)&&!o[e].segments)return!1}return!0}()){f.setPlaybackQuality(p,m,(r=u,o.indexOf(r)));var s=d.getCurrentDVRInfo(p);s&&d.updateManifestUpdateInfo({latency:s.range.end-h.getTime()}),d.getCurrentRepresentationSwitch(b().adaptation.type)||I(),w()}}}(e),t()}).catch(function(e){r(e)})})}function I(){T();var e=new Date,t=b(),r=1e3*h.getTime();t&&d.addRepresentationSwitch(t.adaptation.type,e,r,t.id),l.trigger(i.default.REPRESENTATION_SWITCH,{mediaType:p,streamId:m.id,currentRepresentation:t,numberOfRepresentations:o.length},{streamId:m.id,mediaType:p})}function C(e){return null==e||e>=o.length?null:o[e]}function w(e){a=!1,l.trigger(c.DATA_UPDATE_COMPLETED,{data:r,currentRepresentation:u,error:e},{streamId:m.id,mediaType:p})}function N(e){u=e}function D(e){if(e.newDuration){var t=b();t&&t.adaptation.period&&(t.adaptation.period.duration=e.newDuration)}}return t={getStreamId:function(){return m.id},getType:v,getData:function(){return r},isUpdating:S,updateData:function(e,t,i,s,u){if(T(),a=!0,o=t,N(C(u)),r=e,i!==n.default.VIDEO&&i!==n.default.AUDIO&&(i!==n.default.TEXT||!s))return w(),Promise.resolve();for(var l=[],c=0,f=o.length;c<f;c++){var d=o[c];l.push(R(d))}return Promise.all(l)},getCurrentRepresentation:b,getRepresentationForQuality:C,prepareQualityChange:function(e){N(C(e)),I()},reset:function(){l.off(i.default.MANIFEST_VALIDITY_CHANGED,D,t),A()}},A(),l.on(i.default.MANIFEST_VALIDITY_CHANGED,D,t),t}o.__dashjs_factory_name="RepresentationController",t.default=a.default.getClassFactory(o)},"./src/dash/controllers/SegmentBaseController.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/dash/SegmentBaseLoader.js"),i=r("./src/dash/WebmSegmentBaseLoader.js");function s(e){e=e||{};var t,r,n,s=this.context,o=e.eventBus,u=e.events,l=e.dashMetrics,c=e.mediaPlayerModel,f=e.errHandler,d=e.baseURLController,h=e.debug,g=e.boxParser,p=e.requestModifier,m=e.errors;function y(e){return"webm"===(e?e.split("/")[1]:"").toLowerCase()}return t={initialize:function(){r.initialize(),n.initialize()},getSegmentBaseInitSegment:function(e){return y(e.representation.mimeType)?n.loadInitialization(e.representation,e.mediaType):r.loadInitialization(e.representation,e.mediaType)},getSegmentList:function(e){return y(e.mimeType)?n.loadSegments(e.representation,e.mediaType,e.representation?e.representation.indexRange:null):r.loadSegments(e.representation,e.mediaType,e.representation?e.representation.indexRange:null)},reset:function(){r.reset(),n.reset()}},r=Object(a.default)(s).getInstance(),n=Object(i.default)(s).getInstance(),r.setConfig({baseURLController:d,dashMetrics:l,mediaPlayerModel:c,errHandler:f,eventBus:o,events:u,errors:m,debug:h,boxParser:g,requestModifier:p}),n.setConfig({baseURLController:d,dashMetrics:l,mediaPlayerModel:c,errHandler:f,eventBus:o,events:u,errors:m,debug:h,requestModifier:p}),t}s.__dashjs_factory_name="SegmentBaseController";var o=n.default.getSingletonFactory(s);t.default=o},"./src/dash/controllers/SegmentsController.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/dash/utils/TimelineSegmentsGetter.js"),i=r("./src/dash/utils/TemplateSegmentsGetter.js"),s=r("./src/dash/utils/ListSegmentsGetter.js"),o=r("./src/dash/utils/SegmentBaseGetter.js");function u(e){e=e||{};var t,r,n=this.context,u=e.dashConstants,l=e.type,c=e.segmentBaseController;function f(e){return e?e.segments?r[u.SEGMENT_BASE]:r[e.segmentInfoType]:null}return t={initialize:function(t){r[u.SEGMENT_TIMELINE]=Object(a.default)(n).create(e,t),r[u.SEGMENT_TEMPLATE]=Object(i.default)(n).create(e,t),r[u.SEGMENT_LIST]=Object(s.default)(n).create(e,t),r[u.SEGMENT_BASE]=Object(o.default)(n).create(e,t)},updateInitData:function(e,t){return t?Promise.resolve():c.getSegmentBaseInitSegment({representation:e,mediaType:l})},updateSegmentData:function(e,t){return t?Promise.resolve():c.getSegmentList({mimeType:e.mimeType,representation:e,mediaType:l})},getSegmentByIndex:function(e,t,r){var n=f(e);return n?n.getSegmentByIndex(e,t,r):null},getSegmentByTime:function(e,t){var r=f(e);return r?r.getSegmentByTime(e,t):null},getMediaFinishedInformation:function(e){var t=f(e);return t?t.getMediaFinishedInformation(e):{numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN}}},r={},t}u.__dashjs_factory_name="SegmentsController";var l=n.default.getClassFactory(u);t.default=l},"./src/dash/models/DashManifestModel.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/Constants.js"),a=r("./src/dash/constants/DashConstants.js"),i=r("./src/dash/vo/Representation.js"),s=r("./src/dash/vo/AdaptationSet.js"),o=r("./src/dash/vo/Period.js"),u=r("./src/dash/vo/Mpd.js"),l=r("./src/dash/vo/UTCTiming.js"),c=r("./src/dash/vo/Event.js"),f=r("./src/dash/vo/BaseURL.js"),d=r("./src/dash/vo/EventStream.js"),h=r("./src/streaming/utils/ObjectUtils.js"),g=r("./src/streaming/utils/URLUtils.js"),p=r("./src/core/FactoryMaker.js"),m=r("./src/core/Debug.js"),y=r("./src/streaming/vo/DashJSError.js"),E=r("./src/core/errors/Errors.js"),_=r("./src/streaming/thumbnail/ThumbnailTracks.js");function v(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return T(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?T(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,o=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return s=e.done,e},e:function(e){o=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(o)throw i}}}}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function S(){var e,t,r,p,T=this.context,S=Object(g.default)(T).getInstance(),b=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};function A(e,t){if(!e)throw new Error("adaptation is not defined");if(!t)throw new Error("type is not defined");if(e.Representation_asArray&&e.Representation_asArray.length){var r=F(e.Representation_asArray[0]);if(r&&r.length>0&&_.THUMBNAILS_SCHEME_ID_URIS.indexOf(r[0].schemeIdUri)>=0)return t===n.default.IMAGE}if(e.ContentComponent_asArray&&e.ContentComponent_asArray.length>0){if(e.ContentComponent_asArray.length>1)return t===n.default.MUXED;if(e.ContentComponent_asArray[0].contentType===t)return!0}var i=t===n.default.TEXT?new RegExp("(ttml|vtt|wvtt|stpp)"):new RegExp(t);if(e.Representation_asArray&&e.Representation_asArray.length){var s=e.Representation_asArray[0].codecs;if(i.test(s))return!0}if(e.hasOwnProperty(a.default.MIME_TYPE))return i.test(e.mimeType);if(e.Representation_asArray)for(var o,u=0;u<e.Representation_asArray.length;u++)if((o=e.Representation_asArray[u]).hasOwnProperty(a.default.MIME_TYPE))return i.test(o.mimeType);return!1}function R(e){if(!e)throw new Error("adaptation is not defined");if(e.hasOwnProperty(a.default.SEGMENT_TEMPLATE)||e.hasOwnProperty(a.default.SEGMENT_TIMELINE)||e.hasOwnProperty(a.default.SEGMENT_LIST)||e.hasOwnProperty(a.default.SEGMENT_BASE))return!0;if(e.Representation_asArray&&e.Representation_asArray.length>0){var t=e.Representation_asArray[0];if(t.hasOwnProperty(a.default.SEGMENT_TEMPLATE)||t.hasOwnProperty(a.default.SEGMENT_TIMELINE)||t.hasOwnProperty(a.default.SEGMENT_LIST)||t.hasOwnProperty(a.default.SEGMENT_BASE))return!0}return!1}function I(e){return A(e,n.default.AUDIO)}function C(e){return A(e,n.default.VIDEO)}function w(e){return A(e,n.default.TEXT)}function N(e){return A(e,n.default.MUXED)}function D(e){return A(e,n.default.IMAGE)}function M(e){return e&&Array.isArray(e.Representation_asArray)&&e.Representation_asArray.sort(function(e,t){return e.bandwidth-t.bandwidth}),e}function O(e,t){return e&&e.Period_asArray&&b(t)&&e.Period_asArray[t]?e.Period_asArray[t].AdaptationSet_asArray:[]}function P(e){return e&&e.Period_asArray?e.Period_asArray:[]}function L(e){var t=!1;return e&&e.hasOwnProperty("type")&&(t=e.type===a.default.DYNAMIC),t}function F(e){return e&&e.EssentialProperty_asArray&&e.EssentialProperty_asArray.length?e.EssentialProperty_asArray.map(function(e){return{schemeIdUri:e.schemeIdUri,value:e.value}}):null}function j(e){if(!e||!e.S_asArray)return NaN;var t=e.S_asArray[0],r=e.S_asArray[1];return t.hasOwnProperty("d")?t.d:r.t-t.t}function x(e){var t=e.presentationTimeOffset;return e.adaptation.period.start-t}function k(e,t){if(!e)throw new Error("Period cannot be null or undefined");var r=o.default.DEFAULT_ID+"_"+t;return e.hasOwnProperty(a.default.ID)&&e.id.length>0&&"__proto__"!==e.id&&(r=e.id),r}function B(e,t){var r,i=[];if(!e)return i;for(r=0;r<e.length;r++){var s=new d.default;if(s.timescale=1,s.representation=t,!e[r].hasOwnProperty(n.default.SCHEME_ID_URI))throw new Error("Invalid EventStream. SchemeIdUri has to be set");s.schemeIdUri=e[r].schemeIdUri,e[r].hasOwnProperty(a.default.TIMESCALE)&&(s.timescale=e[r].timescale),e[r].hasOwnProperty(a.default.VALUE)&&(s.value=e[r].value),i.push(s)}return i}function U(e){var t=[],r=e.BaseURL_asArray||[e.baseUri],n=!1;return r.some(function(r){if(r){var i=new f.default,s=r.__text||r;return S.isRelative(s)&&(n=!0,e.baseUri&&(s=S.resolve(s,e.baseUri))),i.url=s,r.hasOwnProperty(a.default.SERVICE_LOCATION)&&r.serviceLocation.length?i.serviceLocation=r.serviceLocation:i.serviceLocation=s,r.hasOwnProperty(a.default.DVB_PRIORITY)&&(i.dvb_priority=r[a.default.DVB_PRIORITY]),r.hasOwnProperty(a.default.DVB_WEIGHT)&&(i.dvb_weight=r[a.default.DVB_WEIGHT]),r.hasOwnProperty(a.default.AVAILABILITY_TIME_OFFSET)&&(i.availabilityTimeOffset=r[a.default.AVAILABILITY_TIME_OFFSET]),r.hasOwnProperty(a.default.AVAILABILITY_TIME_COMPLETE)&&(i.availabilityTimeComplete="false"!==r[a.default.AVAILABILITY_TIME_COMPLETE]),t.push(i),n}}),t}return e={getIsTypeOf:A,getIsText:w,getIsFragmented:R,getLanguageForAdaptation:function(e){var t="";return e&&e.hasOwnProperty(a.default.LANG)&&(t=e.lang.replace(/[^A-Za-z0-9-]/g,"")),t},getViewpointForAdaptation:function(e){return e&&e.hasOwnProperty(a.default.VIEWPOINT)?e.Viewpoint:null},getRolesForAdaptation:function(e){return e&&e.hasOwnProperty(a.default.ROLE_ASARRAY)?e.Role_asArray:[]},getAccessibilityForAdaptation:function(e){return e&&e.hasOwnProperty(a.default.ACCESSIBILITY_ASARRAY)?e.Accessibility_asArray:[]},getAudioChannelConfigurationForAdaptation:function(e){return e&&e.hasOwnProperty(a.default.AUDIOCHANNELCONFIGURATION_ASARRAY)?e.AudioChannelConfiguration_asArray:[]},getAudioChannelConfigurationForRepresentation:function(e){return e&&e.hasOwnProperty(a.default.AUDIOCHANNELCONFIGURATION_ASARRAY)?e.AudioChannelConfiguration_asArray:[]},getAdaptationForIndex:function(e,t,r){var n=O(t,r);return n.length>0&&b(e)?n[e]:null},getIndexForAdaptation:function(e,t,r){if(!e)return-1;for(var n=O(t,r),a=0;a<n.length;a++)if(Object(h.default)(T).getInstance().areEqual(n[a],e))return a;return-1},getAdaptationForId:function(e,t,r){var n,i,s=O(t,r);for(n=0,i=s.length;n<i;n++)if(s[n].hasOwnProperty(a.default.ID)&&s[n].id===e)return s[n];return null},getAdaptationsForType:function(e,t,r){var n,a,i=O(e,t),s=[];for(n=0,a=i.length;n<a;n++)A(i[n],r)&&s.push(M(i[n]));return s},getRealPeriods:P,getRealPeriodForIndex:function(e,t){var r=P(t);return r.length>0&&b(e)?r[e]:null},getCodec:function(e,t,r){var n=null;if(e&&e.Representation_asArray&&e.Representation_asArray.length>0){var a=b(t)&&t>=0&&t<e.Representation_asArray.length?e.Representation_asArray[t]:e.Representation_asArray[0];a&&(n=a.mimeType+';codecs="'+a.codecs+'"',r&&void 0!==a.width&&(n+=';width="'+a.width+'";height="'+a.height+'"'))}return n&&(n=n.replace(/\sprofiles=[^;]*/g,"")),n},getSelectionPriority:function(e){try{var t=e&&void 0!==e.selectionPriority?parseInt(e.selectionPriority):1;return isNaN(t)?1:t}catch(e){return 1}},getMimeType:function(e){return e&&e.Representation_asArray&&e.Representation_asArray.length>0?e.Representation_asArray[0].mimeType:null},getKID:function(e){return e&&e.hasOwnProperty(a.default.CENC_DEFAULT_KID)?e[a.default.CENC_DEFAULT_KID]:null},getLabelsForAdaptation:function(e){if(!e||!Array.isArray(e.Label_asArray))return[];for(var t=[],r=0;r<e.Label_asArray.length;r++)t.push({lang:e.Label_asArray[r].lang,text:e.Label_asArray[r].__text||e.Label_asArray[r]});return t},getContentProtectionData:function(e){return e&&e.hasOwnProperty(a.default.CONTENTPROTECTION_ASARRAY)&&0!==e.ContentProtection_asArray.length?e.ContentProtection_asArray:null},getIsDynamic:L,getId:function(e){return e&&e[a.default.ID]||null},hasProfile:function(e,t){var r=!1;return e&&e.profiles&&e.profiles.length>0&&(r=-1!==e.profiles.indexOf(t)),r},getDuration:function(e){return e&&e.hasOwnProperty(a.default.MEDIA_PRESENTATION_DURATION)?e.mediaPresentationDuration:e&&"dynamic"==e.type?Number.POSITIVE_INFINITY:Number.MAX_SAFE_INTEGER||Number.MAX_VALUE},getBandwidth:function(e){return e&&e.bandwidth?e.bandwidth:NaN},getManifestUpdatePeriod:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=NaN;return e&&e.hasOwnProperty(a.default.MINIMUM_UPDATE_PERIOD)&&(r=e.minimumUpdatePeriod),isNaN(r)?r:Math.max(r-t,1)},getPublishTime:function(e){return e&&e.hasOwnProperty(a.default.PUBLISH_TIME)?new Date(e[a.default.PUBLISH_TIME]):null},getRepresentationCount:function(e){return e&&Array.isArray(e.Representation_asArray)?e.Representation_asArray.length:0},getBitrateListForAdaptation:function(e){var t=M(e);return(t&&Array.isArray(t.Representation_asArray)?t.Representation_asArray:[]).map(function(e){return{bandwidth:e.bandwidth,width:e.width||0,height:e.height||0,scanType:e.scanType||null,id:e.id||null}})},getRepresentationFor:function(e,t){return t&&t.Representation_asArray&&t.Representation_asArray.length>0&&b(e)?t.Representation_asArray[e]:null},getRepresentationsForAdaptation:function(e){var t,r,n=[],s=function(e){if(e&&e.period&&b(e.period.index)){var t=e.period.mpd.manifest.Period_asArray[e.period.index];if(t&&t.AdaptationSet_asArray&&b(e.index))return M(t.AdaptationSet_asArray[e.index])}}(e);if(s&&s.Representation_asArray){if(e&&e.period&&b(e.period.index)){var o=U(e.period.mpd.manifest);o&&(r=o[0])}for(var u=0,l=s.Representation_asArray.length;u<l;++u){var c=s.Representation_asArray[u],f=new i.default;if(f.index=u,f.adaptation=e,c.hasOwnProperty(a.default.ID)&&(f.id=c.id),c.hasOwnProperty(a.default.CODECS)&&(f.codecs=c.codecs),c.hasOwnProperty(a.default.MIME_TYPE)&&(f.mimeType=c[a.default.MIME_TYPE]),c.hasOwnProperty(a.default.CODEC_PRIVATE_DATA)&&(f.codecPrivateData=c.codecPrivateData),c.hasOwnProperty(a.default.BANDWITH)&&(f.bandwidth=c.bandwidth),c.hasOwnProperty(a.default.WIDTH)&&(f.width=c.width),c.hasOwnProperty(a.default.HEIGHT)&&(f.height=c.height),c.hasOwnProperty(a.default.SCAN_TYPE)&&(f.scanType=c.scanType),c.hasOwnProperty(a.default.MAX_PLAYOUT_RATE)&&(f.maxPlayoutRate=c.maxPlayoutRate),c.hasOwnProperty(a.default.SEGMENT_BASE)?(t=c.SegmentBase,f.segmentInfoType=a.default.SEGMENT_BASE):c.hasOwnProperty(a.default.SEGMENT_LIST)?(t=c.SegmentList).hasOwnProperty(a.default.SEGMENT_TIMELINE)?f.segmentInfoType=a.default.SEGMENT_TIMELINE:f.segmentInfoType=a.default.SEGMENT_LIST:c.hasOwnProperty(a.default.SEGMENT_TEMPLATE)?((t=c.SegmentTemplate).hasOwnProperty(a.default.SEGMENT_TIMELINE)?f.segmentInfoType=a.default.SEGMENT_TIMELINE:f.segmentInfoType=a.default.SEGMENT_TEMPLATE,t.hasOwnProperty(a.default.INITIALIZATION_MINUS)&&(f.initialization=t.initialization.split("$Bandwidth$").join(c.bandwidth).split("$RepresentationID$").join(c.id))):f.segmentInfoType=a.default.BASE_URL,f.essentialProperties=F(c),t){if(t.hasOwnProperty(a.default.INITIALIZATION)){var d=t.Initialization;d.hasOwnProperty(a.default.SOURCE_URL)&&(f.initialization=d.sourceURL),d.hasOwnProperty(a.default.RANGE)&&(f.range=d.range)}else w(s)&&R(s)&&s.mimeType&&-1===s.mimeType.indexOf("application/mp4")&&(f.range=0);t.hasOwnProperty(a.default.TIMESCALE)&&(f.timescale=t.timescale),t.hasOwnProperty(a.default.DURATION)?f.segmentDuration=t.duration/f.timescale:c.hasOwnProperty(a.default.SEGMENT_TEMPLATE)&&(t=c.SegmentTemplate).hasOwnProperty(a.default.SEGMENT_TIMELINE)&&(f.segmentDuration=j(t.SegmentTimeline)/f.timescale),t.hasOwnProperty(a.default.MEDIA)&&(f.media=t.media),t.hasOwnProperty(a.default.START_NUMBER)&&(f.startNumber=t.startNumber),t.hasOwnProperty(a.default.INDEX_RANGE)&&(f.indexRange=t.indexRange),t.hasOwnProperty(a.default.PRESENTATION_TIME_OFFSET)&&(f.presentationTimeOffset=t.presentationTimeOffset/f.timescale),t.hasOwnProperty(a.default.AVAILABILITY_TIME_OFFSET)?f.availabilityTimeOffset=t.availabilityTimeOffset:r&&void 0!==r.availabilityTimeOffset&&(f.availabilityTimeOffset=r.availabilityTimeOffset),t.hasOwnProperty(a.default.AVAILABILITY_TIME_COMPLETE)?f.availabilityTimeComplete="false"!==t.availabilityTimeComplete:r&&void 0!==r.availabilityTimeComplete&&(f.availabilityTimeComplete=r.availabilityTimeComplete)}f.MSETimeOffset=x(f),f.path=[e.period.index,e.index,u],n.push(f)}}return n},getAdaptationsForPeriod:function(e){var r,i,o,u=e&&b(e.index)?e.mpd.manifest.Period_asArray[e.index]:null,l=[];if(u&&u.AdaptationSet_asArray)for(o=0;o<u.AdaptationSet_asArray.length;o++)i=u.AdaptationSet_asArray[o],r=new s.default,i.hasOwnProperty(a.default.ID)&&(r.id=i.id),r.index=o,r.period=e,N(i)?r.type=n.default.MUXED:I(i)?r.type=n.default.AUDIO:C(i)?r.type=n.default.VIDEO:w(i)?r.type=n.default.TEXT:D(i)?r.type=n.default.IMAGE:t.warn("Unknown Adaptation stream type"),l.push(r);return l},getRegularPeriods:function(e){var i,s,u=!!e&&L(e.manifest),l=[],c=null,f=null,d=null,h=null;for(s=0,i=e&&e.manifest&&e.manifest.Period_asArray?e.manifest.Period_asArray.length:0;s<i;s++)(f=e.manifest.Period_asArray[s]).hasOwnProperty(a.default.START)?(h=new o.default).start=f.start:null!==c&&c.hasOwnProperty(a.default.DURATION)&&null!==d?(h=new o.default).start=parseFloat((d.start+d.duration).toFixed(5)):0!==s||u||((h=new o.default).start=0),null!==d&&isNaN(d.duration)&&(null!==h?d.duration=parseFloat((h.start-d.start).toFixed(5)):t.warn("First period duration could not be calculated because lack of start and duration period properties. This will cause timing issues during playback")),null!==h&&(h.id=k(f,s),h.index=s,h.mpd=e,f.hasOwnProperty(a.default.DURATION)&&(h.duration=f.duration),d&&(d.nextPeriodId=h.id),l.push(h),c=f,d=h),f=null,h=null;return 0===l.length||null!==d&&isNaN(d.duration)&&(d.duration=parseFloat((function(e){!function(){if(!r||!r.hasOwnProperty("error"))throw new Error(n.default.MISSING_CONFIG_ERROR)}();var t,a=L(e.mpd.manifest);return e.mpd.manifest.mediaPresentationDuration?t=e.mpd.manifest.mediaPresentationDuration:e.duration?t=e.duration:a?t=Number.POSITIVE_INFINITY:r.error(new y.default(E.default.MANIFEST_ERROR_ID_PARSE_CODE,"Must have @mediaPresentationDuration on MPD or an explicit @duration on the last period.",e)),t}(d)-d.start).toFixed(5))),l},getMpd:function(e){var t=new u.default;return e&&(t.manifest=e,e.hasOwnProperty(a.default.AVAILABILITY_START_TIME)?t.availabilityStartTime=new Date(e.availabilityStartTime.getTime()):e.loadedTime&&(t.availabilityStartTime=new Date(e.loadedTime.getTime())),e.hasOwnProperty(a.default.AVAILABILITY_END_TIME)&&(t.availabilityEndTime=new Date(e.availabilityEndTime.getTime())),e.hasOwnProperty(a.default.MINIMUM_UPDATE_PERIOD)&&(t.minimumUpdatePeriod=e.minimumUpdatePeriod),e.hasOwnProperty(a.default.MEDIA_PRESENTATION_DURATION)&&(t.mediaPresentationDuration=e.mediaPresentationDuration),e.hasOwnProperty(a.default.SUGGESTED_PRESENTATION_DELAY)&&(t.suggestedPresentationDelay=e.suggestedPresentationDelay),e.hasOwnProperty(a.default.TIMESHIFT_BUFFER_DEPTH)&&(t.timeShiftBufferDepth=e.timeShiftBufferDepth),e.hasOwnProperty(a.default.MAX_SEGMENT_DURATION)&&(t.maxSegmentDuration=e.maxSegmentDuration),e.hasOwnProperty(a.default.PUBLISH_TIME)&&(t.publishTime=new Date(e.publishTime))),t},getEventsForPeriod:function(e){var t,r,i=e&&e.mpd&&e.mpd.manifest?e.mpd.manifest:null,s=i?i.Period_asArray:null,o=s&&e&&b(e.index)?s[e.index].EventStream_asArray:null,u=[];if(o)for(t=0;t<o.length;t++){var l=new d.default;if(l.period=e,l.timescale=1,!o[t].hasOwnProperty(n.default.SCHEME_ID_URI))throw new Error("Invalid EventStream. SchemeIdUri has to be set");for(l.schemeIdUri=o[t][n.default.SCHEME_ID_URI],o[t].hasOwnProperty(a.default.TIMESCALE)&&(l.timescale=o[t][a.default.TIMESCALE]),o[t].hasOwnProperty(a.default.VALUE)&&(l.value=o[t][a.default.VALUE]),o[t].hasOwnProperty(a.default.PRESENTATION_TIME_OFFSET)&&(l.presentationTimeOffset=o[t][a.default.PRESENTATION_TIME_OFFSET]),r=0;o[t].Event_asArray&&r<o[t].Event_asArray.length;r++){var f=o[t].Event_asArray[r],h=new c.default;if(h.presentationTime=0,h.eventStream=l,f.hasOwnProperty(a.default.PRESENTATION_TIME)){h.presentationTime=f.presentationTime;var g=l.presentationTimeOffset?l.presentationTimeOffset/l.timescale:0;h.calculatedPresentationTime=h.presentationTime/l.timescale+e.start-g}f.hasOwnProperty(a.default.DURATION)&&(h.duration=f.duration/l.timescale),f.hasOwnProperty(a.default.ID)&&(h.id=f.id),f.Signal&&f.Signal.Binary?h.messageData=p.decodeArray(f.Signal.Binary.toString()):h.messageData=f.messageData||f.__text,u.push(h)}}return u},getEssentialPropertiesForRepresentation:F,getEventStreamForAdaptationSet:function(e,t){var r,n,a;return e&&e.Period_asArray&&t&&t.period&&b(t.period.index)&&(n=e.Period_asArray[t.period.index])&&n.AdaptationSet_asArray&&b(t.index)&&(a=n.AdaptationSet_asArray[t.index])&&(r=a.InbandEventStream_asArray),B(r,null)},getEventStreamForRepresentation:function(e,t){var r,n,a,i;return e&&e.Period_asArray&&t&&t.adaptation&&t.adaptation.period&&b(t.adaptation.period.index)&&(n=e.Period_asArray[t.adaptation.period.index])&&n.AdaptationSet_asArray&&b(t.adaptation.index)&&(a=n.AdaptationSet_asArray[t.adaptation.index])&&a.Representation_asArray&&b(t.index)&&(i=a.Representation_asArray[t.index])&&(r=i.InbandEventStream_asArray),B(r,t)},getUTCTimingSources:function(e){var t=L(e),r=!!e&&e.hasOwnProperty(a.default.AVAILABILITY_START_TIME),i=e?e.UTCTiming_asArray:null,s=[];return(t||r)&&i&&i.forEach(function(e){var t=new l.default;e.hasOwnProperty(n.default.SCHEME_ID_URI)&&(t.schemeIdUri=e.schemeIdUri,e.hasOwnProperty(a.default.VALUE)&&(t.value=e.value.toString(),s.push(t)))}),s},getBaseURLsFromElement:U,getRepresentationSortFunction:function(){return function(e,t){return e.bandwidth-t.bandwidth}},getLocation:function(e){if(e&&e.hasOwnProperty(n.default.LOCATION))return e.Location=e.Location_asArray[0],e.Location},getPatchLocation:function(e){if(e&&e.hasOwnProperty(a.default.PATCH_LOCATION))return e.PatchLocation=e.PatchLocation_asArray[0],e.PatchLocation},getSuggestedPresentationDelay:function(e){return e&&e.hasOwnProperty(a.default.SUGGESTED_PRESENTATION_DELAY)?e.suggestedPresentationDelay:null},getAvailabilityStartTime:function(e){return e&&e.hasOwnProperty(a.default.AVAILABILITY_START_TIME)&&null!==e.availabilityStartTime?e.availabilityStartTime.getTime():null},getServiceDescriptions:function(e){var t=[];if(e&&e.hasOwnProperty(a.default.SERVICE_DESCRIPTION)){var r,i=v(e.ServiceDescription_asArray);try{for(i.s();!(r=i.n()).done;){var s=r.value,o=void 0,u=void 0,l=void 0,c=void 0;for(var f in s)s.hasOwnProperty(f)&&(f===a.default.ID?o=s[f]:f===a.default.SERVICE_DESCRIPTION_SCOPE?u=s[f].schemeIdUri:f===a.default.SERVICE_DESCRIPTION_LATENCY?l={target:s[f].target,max:s[f].max,min:s[f].min}:f===a.default.SERVICE_DESCRIPTION_PLAYBACK_RATE&&(c={max:s[f].max,min:s[f].min}));u===n.default.SERVICE_DESCRIPTION_LL_SCHEME&&(l||c)&&t.push({id:o,schemeIdUri:u,latency:l,playbackRate:c})}}catch(e){i.e(e)}finally{i.f()}}return t},getSupplementalProperties:function(e){var t={};if(e&&e.hasOwnProperty(a.default.SUPPLEMENTAL_PROPERTY)){var r,i=v(e.SupplementalProperty_asArray);try{for(i.s();!(r=i.n()).done;){var s=r.value;s.hasOwnProperty(n.default.SCHEME_ID_URI)&&s.hasOwnProperty(a.default.VALUE)&&(t[s[n.default.SCHEME_ID_URI]]=s[a.default.VALUE])}}catch(e){i.e(e)}finally{i.f()}}return t},setConfig:function(e){e&&(e.errHandler&&(r=e.errHandler),e.BASE64&&(p=e.BASE64))}},t=Object(m.default)(T).getInstance().getLogger(e),e}S.__dashjs_factory_name="DashManifestModel",t.default=p.default.getSingletonFactory(S)},"./src/dash/models/PatchManifestModel.js":function(e,t,r){r.r(t);var n=r("./src/dash/constants/DashConstants.js"),a=r("./src/core/FactoryMaker.js"),i=r("./src/core/Debug.js"),s=r("./src/dash/vo/SimpleXPath.js"),o=r("./src/dash/vo/PatchOperation.js");function u(){var e,t,r=this.context;return e={getIsPatch:function(e){return e&&e.hasOwnProperty(n.default.ORIGINAL_MPD_ID)||!1},getPublishTime:function(e){return e&&e.hasOwnProperty(n.default.PUBLISH_TIME)?new Date(e[n.default.PUBLISH_TIME]):null},getOriginalPublishTime:function(e){return e&&e.hasOwnProperty(n.default.ORIGINAL_PUBLISH_TIME)?new Date(e[n.default.ORIGINAL_PUBLISH_TIME]):null},getMpdId:function(e){return e&&e[n.default.ORIGINAL_MPD_ID]||null},getPatchOperations:function(e){return e?(e.__children||[]).map(function(e){var r=Object.keys(e)[0];if("add"!==r&&"remove"!==r&&"replace"!==r)return t.warn("Ignoring node of invalid action: ".concat(r)),null;var n=e[r],a=n.sel;if("add"===r&&n.type){if(!n.type.startsWith("@"))return t.warn("Ignoring add action for prefixed namespace declaration: ".concat(n.type,"=").concat(n.__text)),null;a="".concat(a,"/").concat(n.type)}var i=new s.default(a);if(!i.isValid())return t.warn("Ignoring action with invalid selector: ".concat(r," - ").concat(a)),null;var u=null;i.findsAttribute()?u=n.__text||"":"remove"!==r&&(u=n.__children.reduce(function(e,t){var r=Object.keys(t)[0];return"#text"!==r&&(e[r]=e[r]||[],e[r].push(t[r])),e},{}));var l=new o.default(r,i,u);return"add"===r&&(l.position=n.pos),l}).filter(function(e){return!!e}):[]}},t=Object(i.default)(r).getInstance().getLogger(e),e}u.__dashjs_factory_name="PatchManifestModel",t.default=a.default.getSingletonFactory(u)},"./src/dash/parser/DashParser.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/dash/parser/objectiron.js"),i=r("./externals/xml2json.js"),s=r("./src/dash/parser/matchers/StringMatcher.js"),o=r("./src/dash/parser/matchers/DurationMatcher.js"),u=r("./src/dash/parser/matchers/DateTimeMatcher.js"),l=r("./src/dash/parser/matchers/NumericMatcher.js"),c=r("./src/dash/parser/maps/RepresentationBaseValuesMap.js"),f=r("./src/dash/parser/maps/SegmentValuesMap.js");function d(e){e=e||{};var t,r,n,d,h,g=this.context,p=e.debug;return t={parse:function(e){var t,n=window.performance.now();if(!(t=d.xml_str2json(e)))throw new Error("parsing the manifest failed");var a=window.performance.now();t.Patch?((t=t.Patch).add_asArray&&t.add_asArray.forEach(function(e){return h.run(e)}),t.replace_asArray&&t.replace_asArray.forEach(function(e){return h.run(e)})):(t=t.MPD,h.run(t));var i=window.performance.now();return r.info("Parsing complete: ( xml2json: "+(a-n).toPrecision(3)+"ms, objectiron: "+(i-a).toPrecision(3)+"ms, total: "+((i-n)/1e3).toPrecision(3)+"s)"),t.protocol="DASH",t},getMatchers:function(){return n},getIron:function(){return h}},r=p.getLogger(t),n=[new o.default,new u.default,new l.default,new s.default],d=new i.default({escapeMode:!1,attributePrefix:"",arrayAccessForm:"property",emptyNodeForm:"object",stripWhitespaces:!1,enableToStringFunc:!0,ignoreRoot:!1,matchers:n}),h=Object(a.default)(g).create({adaptationset:new c.default,period:new f.default}),t}d.__dashjs_factory_name="DashParser",t.default=n.default.getClassFactory(d)},"./src/dash/parser/maps/CommonProperty.js":function(e,t,r){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}r.r(t);var a=function(){function e(t){var r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._name=t,this._merge=(r=t)&&r.length&&r.charAt(0)===r.charAt(0).toUpperCase()}var t,r;return t=e,(r=[{key:"name",get:function(){return this._name}},{key:"merge",get:function(){return this._merge}}])&&n(t.prototype,r),e}();t.default=a},"./src/dash/parser/maps/MapNode.js":function(e,t,r){r.r(t);var n=r("./src/dash/parser/maps/CommonProperty.js");function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var i=function(){function e(t,r,a){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._name=t||"",this._properties=[],this._children=a||[],Array.isArray(r)&&r.forEach(function(e){i._properties.push(new n.default(e))})}var t,r;return t=e,(r=[{key:"name",get:function(){return this._name}},{key:"children",get:function(){return this._children}},{key:"properties",get:function(){return this._properties}}])&&a(t.prototype,r),e}();t.default=i},"./src/dash/parser/maps/RepresentationBaseValuesMap.js":function(e,t,r){r.r(t);var n=r("./src/dash/parser/maps/MapNode.js"),a=r("./src/dash/constants/DashConstants.js");function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function s(e,t){return s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},s(e,t)}function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}var u=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(l,e);var t,r,u=(t=l,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=o(t);if(r){var a=o(this).constructor;e=Reflect.construct(n,arguments,a)}else e=n.apply(this,arguments);return function(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function l(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l);var e=[a.default.PROFILES,a.default.WIDTH,a.default.HEIGHT,a.default.SAR,a.default.FRAMERATE,a.default.AUDIO_SAMPLING_RATE,a.default.MIME_TYPE,a.default.SEGMENT_PROFILES,a.default.CODECS,a.default.MAXIMUM_SAP_PERIOD,a.default.START_WITH_SAP,a.default.MAX_PLAYOUT_RATE,a.default.CODING_DEPENDENCY,a.default.SCAN_TYPE,a.default.FRAME_PACKING,a.default.AUDIO_CHANNEL_CONFIGURATION,a.default.CONTENT_PROTECTION,a.default.ESSENTIAL_PROPERTY,a.default.SUPPLEMENTAL_PROPERTY,a.default.INBAND_EVENT_STREAM];return u.call(this,a.default.ADAPTATION_SET,e,[new n.default(a.default.REPRESENTATION,e,[new n.default(a.default.SUB_REPRESENTATION,e)])])}return l}(n.default);t.default=u},"./src/dash/parser/maps/SegmentValuesMap.js":function(e,t,r){r.r(t);var n=r("./src/dash/parser/maps/MapNode.js"),a=r("./src/dash/constants/DashConstants.js");function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function s(e,t){return s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},s(e,t)}function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}var u=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(l,e);var t,r,u=(t=l,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=o(t);if(r){var a=o(this).constructor;e=Reflect.construct(n,arguments,a)}else e=n.apply(this,arguments);return function(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function l(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l);var e=[a.default.SEGMENT_BASE,a.default.SEGMENT_TEMPLATE,a.default.SEGMENT_LIST];return u.call(this,a.default.PERIOD,e,[new n.default(a.default.ADAPTATION_SET,e,[new n.default(a.default.REPRESENTATION,e)])])}return l}(n.default);t.default=u},"./src/dash/parser/matchers/BaseMatcher.js":function(e,t,r){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}r.r(t);var a=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._test=t,this._converter=r}var t,r;return t=e,(r=[{key:"test",get:function(){return this._test}},{key:"converter",get:function(){return this._converter}}])&&n(t.prototype,r),e}();t.default=a},"./src/dash/parser/matchers/DateTimeMatcher.js":function(e,t,r){r.r(t);var n=r("./src/dash/parser/matchers/BaseMatcher.js");function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}var o=/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2})(?::([0-9]*)(\.[0-9]*)?)?(?:([+-])([0-9]{2})(?::?)([0-9]{2}))?/,u=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(u,e);var t,r,n=(t=u,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=s(t);if(r){var i=s(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return function(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function u(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),n.call(this,function(e){return o.test(e.value)},function(e){var t,r=o.exec(e);if(t=Date.UTC(parseInt(r[1],10),parseInt(r[2],10)-1,parseInt(r[3],10),parseInt(r[4],10),parseInt(r[5],10),r[6]&&parseInt(r[6],10)||0,r[7]&&1e3*parseFloat(r[7])||0),r[9]&&r[10]){var n=60*parseInt(r[9],10)+parseInt(r[10],10);t+=("+"===r[8]?-1:1)*n*60*1e3}return new Date(t)})}return u}(n.default);t.default=u},"./src/dash/parser/matchers/DurationMatcher.js":function(e,t,r){r.r(t);var n=r("./src/dash/parser/matchers/BaseMatcher.js"),a=r("./src/streaming/constants/Constants.js"),i=r("./src/dash/constants/DashConstants.js");function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function o(e,t){return o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},o(e,t)}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}var l=/^([-])?P(([\d.]*)Y)?(([\d.]*)M)?(([\d.]*)D)?T?(([\d.]*)H)?(([\d.]*)M)?(([\d.]*)S)?/,c=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(c,e);var t,r,n=(t=c,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=u(t);if(r){var a=u(this).constructor;e=Reflect.construct(n,arguments,a)}else e=n.apply(this,arguments);return function(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function c(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),n.call(this,function(e){for(var t=[i.default.MIN_BUFFER_TIME,i.default.MEDIA_PRESENTATION_DURATION,i.default.MINIMUM_UPDATE_PERIOD,i.default.TIMESHIFT_BUFFER_DEPTH,i.default.MAX_SEGMENT_DURATION,i.default.MAX_SUBSEGMENT_DURATION,i.default.SUGGESTED_PRESENTATION_DELAY,i.default.START,a.default.START_TIME,i.default.DURATION],r=t.length,n=0;n<r;n++)if(e.nodeName===t[n])return l.test(e.value);return!1},function(e){var t=l.exec(e),r=31536e3*parseFloat(t[3]||0)+2592e3*parseFloat(t[5]||0)+86400*parseFloat(t[7]||0)+3600*parseFloat(t[9]||0)+60*parseFloat(t[11]||0)+parseFloat(t[13]||0);return void 0!==t[1]&&(r=-r),r})}return c}(n.default);t.default=c},"./src/dash/parser/matchers/NumericMatcher.js":function(e,t,r){r.r(t);var n=r("./src/dash/parser/matchers/BaseMatcher.js");function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}var o=/^[-+]?[0-9]+[.]?[0-9]*([eE][-+]?[0-9]+)?$/,u=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(u,e);var t,r,n=(t=u,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=s(t);if(r){var i=s(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return function(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function u(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),n.call(this,function(e){return o.test(e.value)},function(e){return parseFloat(e)})}return u}(n.default);t.default=u},"./src/dash/parser/matchers/StringMatcher.js":function(e,t,r){r.r(t);var n=r("./src/dash/parser/matchers/BaseMatcher.js"),a=r("./src/dash/constants/DashConstants.js");function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){return o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},o(e,t)}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}var l=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(l,e);var t,r,n=(t=l,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=u(t);if(r){var a=u(this).constructor;e=Reflect.construct(n,arguments,a)}else e=n.apply(this,arguments);return function(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function l(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),n.call(this,function(e,t){var r,n=(s(r={},a.default.MPD,[a.default.ID,a.default.PROFILES]),s(r,a.default.PERIOD,[a.default.ID]),s(r,a.default.BASE_URL,[a.default.SERVICE_LOCATION,a.default.BYTE_RANGE]),s(r,a.default.SEGMENT_BASE,[a.default.INDEX_RANGE]),s(r,a.default.INITIALIZATION,[a.default.RANGE]),s(r,a.default.REPRESENTATION_INDEX,[a.default.RANGE]),s(r,a.default.SEGMENT_LIST,[a.default.INDEX_RANGE]),s(r,a.default.BITSTREAM_SWITCHING,[a.default.RANGE]),s(r,a.default.SEGMENT_URL,[a.default.MEDIA_RANGE,a.default.INDEX_RANGE]),s(r,a.default.SEGMENT_TEMPLATE,[a.default.INDEX_RANGE,a.default.MEDIA,a.default.INDEX,a.default.INITIALIZATION_MINUS,a.default.BITSTREAM_SWITCHING_MINUS]),s(r,a.default.ASSET_IDENTIFIER,[a.default.VALUE,a.default.ID]),s(r,a.default.EVENT_STREAM,[a.default.VALUE]),s(r,a.default.ADAPTATION_SET,[a.default.PROFILES,a.default.MIME_TYPE,a.default.SEGMENT_PROFILES,a.default.CODECS,a.default.CONTENT_TYPE]),s(r,a.default.FRAME_PACKING,[a.default.VALUE,a.default.ID]),s(r,a.default.AUDIO_CHANNEL_CONFIGURATION,[a.default.VALUE,a.default.ID]),s(r,a.default.CONTENT_PROTECTION,[a.default.VALUE,a.default.ID]),s(r,a.default.ESSENTIAL_PROPERTY,[a.default.VALUE,a.default.ID]),s(r,a.default.SUPPLEMENTAL_PROPERTY,[a.default.VALUE,a.default.ID]),s(r,a.default.INBAND_EVENT_STREAM,[a.default.VALUE,a.default.ID]),s(r,a.default.ACCESSIBILITY,[a.default.VALUE,a.default.ID]),s(r,a.default.ROLE,[a.default.VALUE,a.default.ID]),s(r,a.default.RATING,[a.default.VALUE,a.default.ID]),s(r,a.default.VIEWPOINT,[a.default.VALUE,a.default.ID]),s(r,a.default.CONTENT_COMPONENT,[a.default.CONTENT_TYPE]),s(r,a.default.REPRESENTATION,[a.default.ID,a.default.DEPENDENCY_ID,a.default.MEDIA_STREAM_STRUCTURE_ID]),s(r,a.default.SUBSET,[a.default.ID]),s(r,a.default.METRICS,[a.default.METRICS_MINUS]),s(r,a.default.REPORTING,[a.default.VALUE,a.default.ID]),r);if(n.hasOwnProperty(t)){var i=n[t];return void 0!==i&&i.indexOf(e.name)>=0}return!1},function(e){return String(e)})}return l}(n.default);t.default=l},"./src/dash/parser/objectiron.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js");function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function i(e){function t(e,t){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}function r(e,r,n){for(var i=0,s=e.length;i<s;++i){var o=e[i];if(r[o.name])if(n[o.name]){if(o.merge){var u=r[o.name],l=n[o.name];"object"===a(u)&&"object"===a(l)?t(u,l):n[o.name]=u+l}}else n[o.name]=r[o.name]}}function n(e,t){for(var a=0,i=e.children.length;a<i;++a){var s=e.children[a],o=t[s.name+"_asArray"];if(o)for(var u=0,l=o.length;u<l;++u){var c=o[u];r(e.properties,t,c),n(s,c)}}}return{run:function(t){if(null===t||"object"!==a(t))return t;if(t.Period_asArray&&"period"in e)for(var r=e.period,i=t.Period_asArray,s=0,o=i.length;s<o;++s){var u=i[s];if(n(r,u),"adaptationset"in e){var l=u.AdaptationSet_asArray;if(l)for(var c=e.adaptationset,f=0,d=l.length;f<d;++f)n(c,l[f])}}return t}}}i.__dashjs_factory_name="ObjectIron";var s=n.default.getClassFactory(i);t.default=s},"./src/dash/utils/ListSegmentsGetter.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/streaming/constants/Constants.js"),i=r("./src/dash/utils/SegmentsUtils.js");function s(e,t){var r=(e=e||{}).timelineConverter;function n(){if(!r||!r.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(a.default.MISSING_CONFIG_ERROR)}function s(e,a){if(n(),!e)return null;var s=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList,o=s.SegmentURL_asArray.length,u=e&&!isNaN(e.startNumber)?e.startNumber:1,l=Math.max(u-1,0),c=Math.max(a-l,0),f=null;if(c<o){var d=s.SegmentURL_asArray[c];(f=Object(i.getIndexBasedSegment)(r,t,e,a))&&(f.replacementTime=(u+a-1)*e.segmentDuration,f.media=d.media?d.media:"",f.mediaRange=d.mediaRange,f.indexRange=d.indexRange)}return f}return{getSegmentByIndex:s,getSegmentByTime:function(e,t){if(n(),!e)return null;var a=e.segmentDuration;if(isNaN(a))return null;var i=r.calcPeriodRelativeTimeFromMpdRelativeTime(e,t);return s(e,Math.floor(i/a))},getMediaFinishedInformation:function(e){var t={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};if(!e)return t;var r=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList,n=e&&!isNaN(e.startNumber)?e.startNumber:1,a=Math.max(n-1,0);return t.numberOfSegments=a+r.SegmentURL_asArray.length,t}}}s.__dashjs_factory_name="ListSegmentsGetter";var o=n.default.getClassFactory(s);t.default=o},"./src/dash/utils/Round10.js":function(e,t,r){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}r.r(t),r.d(t,"default",function(){return a});var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,r;return t=e,r=[{key:"round10",value:function(e,t){return function(e,t,r){return void 0===r||0===+r?Math[e](t):(r=+r,null===(t=+t)||isNaN(t)||"number"!=typeof r||r%1!=0?NaN:(t=t.toString().split("e"),+((t=(t=Math[e](+(t[0]+"e"+(t[1]?+t[1]-r:-r)))).toString().split("e"))[0]+"e"+(t[1]?+t[1]+r:r))))}("round",e,t)}}],null&&n(t.prototype,null),r&&n(t,r),e}()},"./src/dash/utils/SegmentBaseGetter.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/streaming/constants/Constants.js");function i(e){var t=(e=e||{}).timelineConverter;function r(){if(!t||!t.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(a.default.MISSING_CONFIG_ERROR)}function n(e,t){if(r(),!e)return null;var n,a=e.segments?e.segments.length:-1;if(t<a&&(n=e.segments[t])&&n.index===t)return n;for(var i=0;i<a;i++)if((n=e.segments[i])&&n.index===t)return n;return null}return{getSegmentByIndex:n,getSegmentByTime:function(e,t){r();var a=function(e,t){if(!e)return-1;var r,n,a,i,s,o=e.segments,u=o?o.length:null,l=-1;if(o&&u>0)for(s=0;s<u;s++)if(a=(n=o[s]).presentationStartTime,t+(r=(i=n.duration)/2)>=a&&t-r<a+i){l=n.index;break}return l}(e,t);return n(e,a)},getMediaFinishedInformation:function(e){var t={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};return e&&e.segments?(t.numberOfSegments=e.segments.length,t):t}}}i.__dashjs_factory_name="SegmentBaseGetter";var s=n.default.getClassFactory(i);t.default=s},"./src/dash/utils/SegmentsUtils.js":function(e,t,r){r.r(t),r.d(t,"unescapeDollarsInTemplate",function(){return i}),r.d(t,"replaceIDForTemplate",function(){return s}),r.d(t,"replaceTokenForTemplate",function(){return o}),r.d(t,"getIndexBasedSegment",function(){return c}),r.d(t,"getTimeBasedSegment",function(){return f});var n=r("./src/dash/vo/Segment.js");function a(e,t){for(;e.length<t;)e="0"+e;return e}function i(e){return e?e.split("$$").join("$"):e}function s(e,t){if(!t||!e||-1===e.indexOf("$RepresentationID$"))return e;var r=t.toString();return e.split("$RepresentationID$").join(r)}function o(e,t,r){var n,i,s,o,u,l,c=t.length;if(!e)return e;for(;;){if((n=e.indexOf("$"+t))<0)return e;if((i=e.indexOf("$",n+c))<0)return e;if((s=e.indexOf("%0",n+c))>n&&s<i)switch(o=e.charAt(i-1),u=parseInt(e.substring(s+2,i-1),10),o){case"d":case"i":case"u":l=a(r.toString(),u);break;case"x":l=a(r.toString(16),u);break;case"X":l=a(r.toString(16),u).toUpperCase();break;case"o":l=a(r.toString(8),u);break;default:return e}else l=r;e=e.substring(0,n)+l+e.substring(i+1)}}function u(e,t,r,a,i,s,o,u){var l,c=new n.default;return c.representation=e,c.duration=t,c.presentationStartTime=r,c.mediaStartTime=a,c.availabilityStartTime=i.calcAvailabilityStartTimeFromPresentationTime(s,e,o),c.availabilityEndTime=i.calcAvailabilityEndTimeFromPresentationTime(s+t,e,o),c.wallStartTime=i.calcWallTimeForSegment(c,o),c.replacementNumber=(l=u,c.representation.startNumber+l),c.index=u,c}function l(e,t,r,n){var a=t.adaptation.period;if(isFinite(a.duration)&&a.start+a.duration<=r.presentationStartTime)return!1;if(n){if("INF"===t.availabilityTimeOffset)return!0;var i=e.getClientReferenceTime();return r.availabilityStartTime.getTime()<=i&&(!isFinite(r.availabilityEndTime)||r.availabilityEndTime.getTime()>=i)}return!0}function c(e,t,r,n){var a,i,s;a=r.segmentDuration,isNaN(a)&&(a=r.adaptation.period.duration),i=parseFloat((r.adaptation.period.start+n*a).toFixed(5)),s=parseFloat((i+a).toFixed(5));var o=u(r,a,i,e.calcMediaTimeFromPresentationTime(i,r),e,s,t,n);return l(e,r,o,t)?o:null}function f(e,t,r,n,a,i,s,c,f,d){var h,g,p=n/i,m=a/i;return h=e.calcPresentationTimeFromMediaTime(p,r),l(e,r,g=u(r,m,h,p,e,h+m,t,f),t)?(g.replacementTime=d||n,s=o(s,"Number",g.replacementNumber),s=o(s,"Time",g.replacementTime),g.media=s,g.mediaRange=c,g):null}},"./src/dash/utils/TemplateSegmentsGetter.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/streaming/constants/Constants.js"),i=r("./src/dash/utils/SegmentsUtils.js");function s(e,t){var r=(e=e||{}).timelineConverter;function n(){if(!r||!r.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(a.default.MISSING_CONFIG_ERROR)}function s(e,a){if(n(),!e)return null;var s=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentTemplate;a=Math.max(a,0);var o=Object(i.getIndexBasedSegment)(r,t,e,a);if(o){o.replacementTime=Math.round((a-1)*e.segmentDuration*e.timescale,10);var u=s.media;u=Object(i.replaceTokenForTemplate)(u,"Number",o.replacementNumber),u=Object(i.replaceTokenForTemplate)(u,"Time",o.replacementTime),o.media=u}return o}return{getSegmentByIndex:s,getSegmentByTime:function(e,t){if(n(),!e)return null;var a=e.segmentDuration;if(isNaN(a))return null;var i=r.calcPeriodRelativeTimeFromMpdRelativeTime(e,t);return s(e,Math.floor(i/a))},getMediaFinishedInformation:function(e){var t={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};if(!e)return t;var r=e.segmentDuration;return isNaN(r)?t.numberOfSegments=1:t.numberOfSegments=Math.ceil(e.adaptation.period.duration/r),t}}}s.__dashjs_factory_name="TemplateSegmentsGetter";var o=n.default.getClassFactory(s);t.default=o},"./src/dash/utils/TimelineConverter.js":function(e,t,r){r.r(t);var n=r("./src/core/EventBus.js"),a=r("./src/core/events/Events.js"),i=r("./src/core/FactoryMaker.js"),s=r("./src/dash/constants/DashConstants.js"),o=r("./src/dash/models/DashManifestModel.js"),u=r("./src/core/Settings.js"),l=r("./src/streaming/constants/Constants.js"),c=r("./src/streaming/MediaPlayerEvents.js"),f=r("./src/streaming/constants/ConformanceViolationConstants.js");function d(){var e,t,r,i,d=this.context,h=Object(n.default)(d).getInstance(),g=Object(u.default)(d).getInstance();function p(e){i=e}function m(e,t,r,n){var a,i=t.adaptation.period.mpd,s=i.availabilityStartTime;if(n)a=r&&i.timeShiftBufferDepth!==Number.POSITIVE_INFINITY?new Date(s.getTime()+1e3*(e+i.timeShiftBufferDepth)):i.availabilityEndTime;else if(r){var o=t.availabilityTimeOffset;a=new Date(s.getTime()+1e3*(e-o))}else a=s;return a}function y(e,t){return(e.getTime()-t.mpd.availabilityStartTime.getTime()+1e3*i)/1e3}function E(e,t){return e+(t.adaptation.period.start-t.presentationTimeOffset)}function _(e){var r={start:NaN,end:NaN},n=e[0].getAdapter().getRegularPeriods()[0],a=y(new Date,n);if(!e||0===e.length)return{range:r,now:a};e.forEach(function(e){var n=e.getAdapter(),i=n.getMediaInfoForType(e.getStreamInfo(),l.default.VIDEO)||n.getMediaInfoForType(e.getStreamInfo(),l.default.AUDIO),o=n.getVoRepresentations(i)[0],u={start:NaN,end:NaN};if(o)if(o.segmentInfoType===s.default.SEGMENT_TIMELINE)u=function(e){var r,n,a,i,s=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index],o=t.getRepresentationFor(e.index,s),u=o.SegmentTemplate.SegmentTimeline,l=o.SegmentTemplate.timescale,c=u.S_asArray,f={start:0,end:0},d=0;for(f.start=E(c[0].t/l,e),a=0,i=c.length;a<i;a++)n=0,(r=c[a]).hasOwnProperty("r")&&(n=r.r),d+=r.d/l*(1+n);return f.end=f.start+d,f}(o);else{var c=o.adaptation.period;u.start=c.start,u.end=Math.max(a,c.start+c.duration)}!isNaN(u.start)&&(isNaN(r.start)||r.start>u.start)&&(r.start=u.start),!isNaN(u.end)&&(isNaN(r.end)||r.end<u.end)&&(r.end=u.end)}),r.end=Math.min(a,r.end);var i=T(e,r.end,!0);return r.end=isNaN(i)?r.end:i,r.start=n&&n.mpd&&n.mpd.timeShiftBufferDepth&&!isNaN(n.mpd.timeShiftBufferDepth)&&!isNaN(r.end)?Math.max(r.end-n.mpd.timeShiftBufferDepth,r.start):r.start,r.start=T(e,r.start),{range:r,now:a}}function v(e,t){r=e-t.end}function T(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{for(var n=0,a=!1,i=NaN;!a&&n<e.length;){var s=e[n].getStreamInfo();s.start<=t&&(!isFinite(s.duration)||s.start+s.duration>=t)?(i=t,a=!0):!r&&s.start>t&&(isNaN(i)||s.start<i)?i=s.start:r&&s.start+s.duration<t&&(isNaN(i)||s.start+s.duration>i)&&(i=s.start+s.duration),n+=1}return i}catch(e){return t}}function S(e){void 0===e.offset||isNaN(e.offset)||p(e.offset/1e3)}function b(){i=0,r=0}function A(){h.off(a.default.UPDATE_TIME_SYNC_OFFSET,S,this),b()}return e={initialize:function(){b(),h.on(a.default.UPDATE_TIME_SYNC_OFFSET,S,this)},getClientTimeOffset:function(){return i},setClientTimeOffset:p,getClientReferenceTime:function(){return Date.now()-1e3*r+1e3*i},calcAvailabilityStartTimeFromPresentationTime:function(e,t,r){return m(e,t,r)},calcAvailabilityEndTimeFromPresentationTime:function(e,t,r){return m(e,t,r,!0)},calcPresentationTimeFromWallTime:y,calcPresentationTimeFromMediaTime:E,calcPeriodRelativeTimeFromMpdRelativeTime:function(e,t){return t-e.adaptation.period.start},calcMediaTimeFromPresentationTime:function(e,t){return e-t.adaptation.period.start+t.presentationTimeOffset},calcWallTimeForSegment:function(e,t){var r,n,a;return t&&(r=e.representation.adaptation.period.mpd.suggestedPresentationDelay,n=e.presentationStartTime+r,a=new Date(e.availabilityStartTime.getTime()+1e3*n)),a},calcTimeShiftBufferWindow:function(e,t){if(!t)return function(e){var t={start:NaN,end:NaN},r=0,n=NaN;return e.forEach(function(e){var t=e.getStreamInfo();r+=t.duration,(isNaN(n)||t.start<n)&&(n=t.start)}),t.start=n,t.end=n+r,t}(e);if(g.get().streaming.timeShiftBuffer.calcFromSegmentTimeline){var r=_(e);return v(r.now,r.range),r.range}return function(e){var t={start:NaN,end:NaN};if(!e||0===e.length)return t;var r=e[0].getAdapter().getRegularPeriods()[0],n=y(new Date,r),a=r.mpd.timeShiftBufferDepth,i=isNaN(a)?0:n-a;if(t.start=T(e,i),t.end=!isNaN(t.start)&&n<t.start?n:T(e,n,!0),!isNaN(a)&&t.end<n-a&&(t.end=NaN),g.get().streaming.timeShiftBuffer.fallbackToSegmentTimeline){var s=_(e);if(s.range.end<t.start)return h.trigger(c.default.CONFORMANCE_VIOLATION,{level:f.default.LEVELS.WARNING,event:f.default.EVENTS.INVALID_DVR_WINDOW}),v(s.now,s.range),s.range}return t}(e)},reset:A},t=Object(o.default)(d).getInstance(),A(),e}d.__dashjs_factory_name="TimelineConverter",t.default=i.default.getSingletonFactory(d)},"./src/dash/utils/TimelineSegmentsGetter.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/streaming/constants/Constants.js"),i=r("./src/dash/utils/SegmentsUtils.js");function s(e,t){var r=(e=e||{}).timelineConverter,n=e.dashMetrics;function s(){if(!r)throw new Error(a.default.MISSING_CONFIG_ERROR)}function o(e,t){var r,n,a,i,s,o,l,c=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentTemplate||e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList,f=c.SegmentTimeline,d=c.SegmentURL_asArray,h=0,g=0,p=-1;l=e.timescale;var m=!1;for(a=0,i=(r=f.S_asArray).length;a<i&&!m;a++)for(o=0,(n=r[a]).hasOwnProperty("r")&&(o=n.r),n.hasOwnProperty("t")&&(g=(h=n.t)/l),o<0&&(o=u(e,r[a+1],n,l,g)),s=0;s<=o&&!m;s++)(m=t(h,g,c,d,n,l,++p,a))&&(e.segmentDuration=n.d/l),g=(h+=n.d)/l}function u(e,t,a,i,s){var o;if(t&&t.hasOwnProperty("t"))o=t.t/i;else try{var u=0;if(isNaN(e.adaptation.period.start)||isNaN(e.adaptation.period.duration)||!isFinite(e.adaptation.period.duration)){var l=n.getCurrentDVRInfo();u=isNaN(l.end)?0:l.end}else u=e.adaptation.period.start+e.adaptation.period.duration;o=r.calcMediaTimeFromPresentationTime(u,e),e.segmentDuration=a.d/i}catch(e){o=0}return Math.max(Math.ceil((o-s)/(a.d/i))-1,0)}return{getSegmentByIndex:function(e,n,a){if(s(),!e)return null;var u=null,l=!1;return o(e,function(n,s,o,c,f,d,h,g){if(l||a<0){var p=o.media,m=f.mediaRange;return c&&(p=c[g].media||"",m=c[g].mediaRange),u=Object(i.getTimeBasedSegment)(r,t,e,n,f.d,d,p,m,h,f.tManifest),!0}return s>=a-.5*f.d/d&&(l=!0),!1}),u},getSegmentByTime:function(e,n){if(s(),!e)return null;void 0===n&&(n=null);var a=null,u=r.calcMediaTimeFromPresentationTime(n,e);return o(e,function(n,s,o,l,c,f,d,h){if(u<s+c.d/f){var g=o.media,p=c.mediaRange;return l&&(g=l[h].media||"",p=l[h].mediaRange),a=Object(i.getTimeBasedSegment)(r,t,e,n,c.d,f,g,p,d,c.tManifest),!0}return!1}),a},getMediaFinishedInformation:function(e){if(!e)return 0;var t,r,n,a,i,s,o,l=(e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentTemplate||e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList).SegmentTimeline,c=0,f=0,d=0;for(o=e.timescale,a=(t=l.S_asArray).length,n=0;n<a;n++)for(s=0,(r=t[n]).hasOwnProperty("r")&&(s=r.r),r.hasOwnProperty("t")&&(f=(c=r.t)/o),s<0&&(s=u(e,t[n+1],r,o,f)),i=0;i<=s;i++)d++,f=(c+=r.d)/o;return{numberOfSegments:d,mediaTimeOfLastSignaledSegment:f}}}}s.__dashjs_factory_name="TimelineSegmentsGetter";var o=n.default.getClassFactory(s);t.default=o},"./src/dash/vo/AdaptationSet.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.period=null,this.index=-1,this.type=null}},"./src/dash/vo/BaseURL.js":function(e,t,r){r.r(t);var n=function e(t,r,n,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t||"",this.serviceLocation=r||t||"",this.dvb_priority=n||1,this.dvb_weight=a||1,this.availabilityTimeOffset=0,this.availabilityTimeComplete=!0};n.DEFAULT_DVB_PRIORITY=1,n.DEFAULT_DVB_WEIGHT=1,t.default=n},"./src/dash/vo/Event.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.duration=NaN,this.presentationTime=NaN,this.id=NaN,this.messageData="",this.eventStream=null,this.presentationTimeDelta=NaN}},"./src/dash/vo/EventStream.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.adaptionSet=null,this.representation=null,this.period=null,this.timescale=1,this.value="",this.schemeIdUri="",this.presentationTimeOffset=0}},"./src/dash/vo/ManifestInfo.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.dvrWindowSize=NaN,this.loadedTime=null,this.availableFrom=null,this.minBufferTime=NaN,this.duration=NaN,this.isDynamic=!1,this.maxFragmentDuration=null}},"./src/dash/vo/MediaInfo.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=null,this.type=null,this.streamInfo=null,this.representationCount=0,this.labels=null,this.lang=null,this.viewpoint=null,this.accessibility=null,this.audioChannelConfiguration=null,this.roles=null,this.codec=null,this.mimeType=null,this.contentProtection=null,this.KID=null,this.bitrateList=null,this.isFragmented=null,this.isEmbedded=null,this.selectionPriority=1}},"./src/dash/vo/Mpd.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.manifest=null,this.suggestedPresentationDelay=0,this.availabilityStartTime=null,this.availabilityEndTime=Number.POSITIVE_INFINITY,this.timeShiftBufferDepth=Number.POSITIVE_INFINITY,this.maxSegmentDuration=Number.POSITIVE_INFINITY,this.publishTime=null,this.minimumUpdatePeriod=NaN,this.mediaPresentationDuration=NaN}},"./src/dash/vo/PatchOperation.js":function(e,t,r){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}r.r(t);var a=function(){function e(t,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.action=t,this.xpath=r,this.value=n,this.position=null}var t,r;return t=e,(r=[{key:"getMpdTarget",value:function(e){var t="remove"===this.action||"replace"===this.action||"before"===this.position||"after"===this.position;return this.xpath.getMpdTarget(e,t)}}])&&n(t.prototype,r),e}();t.default=a},"./src/dash/vo/Period.js":function(e,t,r){r.r(t);var n=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=-1,this.duration=NaN,this.start=NaN,this.mpd=null,this.nextPeriodId=null};n.DEFAULT_ID="defaultId",t.default=n},"./src/dash/vo/Representation.js":function(e,t,r){r.r(t);var n=r("./src/dash/constants/DashConstants.js");function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=-1,this.adaptation=null,this.segmentInfoType=null,this.initialization=null,this.codecs=null,this.mimeType=null,this.codecPrivateData=null,this.segmentDuration=NaN,this.timescale=1,this.startNumber=1,this.indexRange=null,this.range=null,this.presentationTimeOffset=0,this.MSETimeOffset=NaN,this.mediaFinishedInformation={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN},this.bandwidth=NaN,this.width=NaN,this.height=NaN,this.scanType=null,this.maxPlayoutRate=NaN,this.availabilityTimeOffset=0,this.availabilityTimeComplete=!0}var t,r;return t=e,(r=[{key:"hasInitialization",value:function(){return null!==this.initialization||null!==this.range}},{key:"hasSegments",value:function(){return this.segmentInfoType!==n.default.BASE_URL&&this.segmentInfoType!==n.default.SEGMENT_BASE&&!this.indexRange}}])&&a(t.prototype,r),e}();t.default=i},"./src/dash/vo/RepresentationInfo.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.quality=null,this.fragmentDuration=null,this.mediaInfo=null,this.MSETimeOffset=null}},"./src/dash/vo/Segment.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.indexRange=null,this.index=null,this.mediaRange=null,this.media=null,this.duration=NaN,this.replacementTime=null,this.replacementNumber=NaN,this.mediaStartTime=NaN,this.presentationStartTime=NaN,this.availabilityStartTime=NaN,this.availabilityEndTime=NaN,this.wallStartTime=NaN,this.representation=null}},"./src/dash/vo/SimpleXPath.js":function(e,t,r){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}r.r(t);var a=function(){function e(t){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.valid="/"==t[0],this.path=t.split("/").filter(function(e){return 0!==e.length}).map(function(e){var t={name:e},n=e.indexOf("[");if(-1!=n){t.name=e.substring(0,n);var a=e.substring(n+1,e.length-1);r.valid=r.valid&&-1==a.indexOf("[");var i=a.indexOf("=");-1!=i?(t.attribute={name:a.substring(1,i),value:a.substring(i+1)},-1!=["'",'"'].indexOf(t.attribute.value[0])&&(t.attribute.value=t.attribute.value.substring(1,t.attribute.value.length-1))):t.position=parseInt(a,10)-1}return t})}var t,r;return t=e,(r=[{key:"isValid",value:function(){return this.valid}},{key:"findsElement",value:function(){return!this.findsAttribute()}},{key:"findsAttribute",value:function(){return this.path[this.path.length-1].name.startsWith("@")}},{key:"getMpdTarget",value:function(e,t){for(var r=null,n=e,a=1,i="MPD";a<this.path.length&&null!==n;){r=n;var s=this.path[a];if(i=s.name,a!==this.path.length-1||!i.startsWith("@")){var o=r[i+"_asArray"]||[];0===o.length&&r[i]&&o.push(r[i]),s.position?n=o[s.position]||null:s.attribute?function(){var e=s.attribute;n=o.filter(function(t){return t[e.name]==e.value})[0]||null}():n=o[0]||null}a++}return null===n?null:i.startsWith("@")?{name:i.substring(1),leaf:n,target:n}:{name:i,leaf:n,target:t?r:n}}}])&&n(t.prototype,r),e}();t.default=a},"./src/dash/vo/StreamInfo.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=null,this.start=NaN,this.duration=NaN,this.manifestInfo=null,this.isLast=!0}},"./src/dash/vo/UTCTiming.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.schemeIdUri="",this.value=""}},"./src/streaming/FragmentLoader.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/Constants.js"),a=r("./src/streaming/net/URLLoader.js"),i=r("./src/streaming/vo/HeadRequest.js"),s=r("./src/streaming/vo/DashJSError.js"),o=r("./src/core/FactoryMaker.js");function u(e){e=e||{};var t,r,o=this.context,u=e.eventBus,l=e.events,c=e.urlUtils,f=e.errors,d=e.streamId;return t={checkForExistence:function(e){var t=function(t){u.trigger(l.CHECK_FOR_EXISTENCE_COMPLETED,{request:e,exists:t})};if(e){var n=new i.default(e.url);r.load({request:n,success:function(){t(!0)},error:function(){t(!1)}})}else t(!1)},load:function(e){var n=function(r,n){u.trigger(l.LOADING_COMPLETED,{request:e,response:r||null,error:n||null,sender:t})};e?r.load({request:e,progress:function(r){u.trigger(l.LOADING_PROGRESS,{request:e,stream:r.stream,streamId:d}),r.data&&u.trigger(l.LOADING_DATA_PROGRESS,{request:e,response:r.data||null,error:null,sender:t})},success:function(e){n(e)},error:function(e,t,r){n(void 0,new s.default(f.FRAGMENT_LOADER_LOADING_FAILURE_ERROR_CODE,r,t))},abort:function(e){e&&u.trigger(l.LOADING_ABANDONED,{mediaType:e.mediaType,request:e,sender:t})}}):n(void 0,new s.default(f.FRAGMENT_LOADER_NULL_REQUEST_ERROR_CODE,f.FRAGMENT_LOADER_NULL_REQUEST_ERROR_MESSAGE))},abort:function(){r&&r.abort()},reset:function(){r&&(r.abort(),r=null)}},r=Object(a.default)(o).create({errHandler:e.errHandler,errors:f,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,urlUtils:c,constants:n.default,boxParser:e.boxParser,dashConstants:e.dashConstants,requestTimeout:e.settings.get().streaming.fragmentRequestTimeout}),t}u.__dashjs_factory_name="FragmentLoader",t.default=o.default.getClassFactory(u)},"./src/streaming/ManifestLoader.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/Constants.js"),a=r("./src/dash/constants/DashConstants.js"),i=r("./src/streaming/controllers/XlinkController.js"),s=r("./src/streaming/net/URLLoader.js"),o=r("./src/streaming/utils/URLUtils.js"),u=r("./src/streaming/vo/TextRequest.js"),l=r("./src/streaming/vo/DashJSError.js"),c=r("./src/streaming/vo/metrics/HTTPRequest.js"),f=r("./src/core/EventBus.js"),d=r("./src/core/events/Events.js"),h=r("./src/core/errors/Errors.js"),g=r("./src/core/FactoryMaker.js"),p=r("./src/dash/parser/DashParser.js");function m(e){e=e||{};var t,r,g,m,y,E=this.context,_=e.debug,v=Object(f.default)(E).getInstance(),T=Object(o.default)(E).getInstance(),S=e.mssHandler,b=e.errHandler;function A(e){v.trigger(d.default.INTERNAL_MANIFEST_LOADED,{manifest:e.manifest})}return t={load:function(e){var t=new u.default(e,c.HTTPRequest.MPD_TYPE);g.load({request:t,success:function(t,a,i){var s,o,u;if(m)if(i&&i!==e?(o=T.parseBaseUrl(i),s=i):(T.isRelative(e)&&(e=T.resolve(e,window.location.href)),o=T.parseBaseUrl(e)),"No Content"!=a)if(null===y&&(y=function(e){var t=null;return e.indexOf("SmoothStreamingMedia")>-1?(S&&(t=S.createMssParser(),S.registerEvents()),t):e.indexOf("MPD")>-1||e.indexOf("Patch")>-1?Object(p.default)(E).create({debug:_}):t}(t)),null!==y){m.setMatchers(y.getMatchers()),m.setIron(y.getIron());try{u=y.parse(t)}catch(t){return void v.trigger(d.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new l.default(h.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,h.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+"".concat(e))})}u?(u.url=s||e,u.originalUrl||(u.originalUrl=u.url),u.hasOwnProperty(n.default.LOCATION)&&(o=T.parseBaseUrl(u.Location_asArray[0]),r.debug("BaseURI set by Location to: "+o)),u.baseUri=o,u.loadedTime=new Date,m.resolveManifestOnLoad(u),v.trigger(d.default.ORIGINAL_MANIFEST_LOADED,{originalManifest:t})):v.trigger(d.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new l.default(h.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,h.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+"".concat(e))})}else v.trigger(d.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new l.default(h.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,h.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+"".concat(e))});else v.trigger(d.default.INTERNAL_MANIFEST_LOADED,{manifest:null})},error:function(t,r,n){v.trigger(d.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new l.default(h.default.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE,h.default.MANIFEST_LOADER_LOADING_FAILURE_ERROR_MESSAGE+"".concat(e,", ").concat(n))})}})},reset:function(){v.off(d.default.XLINK_READY,A,t),S&&S.reset(),m&&(m.reset(),m=null),g&&(g.abort(),g=null)}},r=_.getLogger(t),v.on(d.default.XLINK_READY,A,t),g=Object(s.default)(E).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,urlUtils:T,constants:n.default,dashConstants:a.default,errors:h.default}),m=Object(i.default)(E).create({errHandler:b,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,settings:e.settings}),y=null,t}m.__dashjs_factory_name="ManifestLoader";var y=g.default.getClassFactory(m);t.default=y},"./src/streaming/ManifestUpdater.js":function(e,t,r){r.r(t);var n=r("./src/core/EventBus.js"),a=r("./src/core/events/Events.js"),i=r("./src/streaming/MediaPlayerEvents.js"),s=r("./src/core/FactoryMaker.js"),o=r("./src/core/Debug.js"),u=r("./src/core/errors/Errors.js"),l=r("./src/dash/constants/DashConstants.js"),c=r("./src/streaming/utils/URLUtils.js");function f(){var e,t,r,s,f,d,h,g,p,m,y,E,_=this.context,v=Object(n.default)(_).getInstance(),T=Object(c.default)(_).getInstance();function S(){r=NaN,h=!1,f=!0,d=!1,b()}function b(){null!==s&&(clearTimeout(s),s=null)}function A(e){b(),d||(isNaN(e)&&!isNaN(r)&&(e=1e3*r),isNaN(e)||(t.debug("Refresh manifest in "+e+" milliseconds."),s=setTimeout(C,e)))}function R(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];h=!0;var t=p.getValue(),r=t.url,n=m.getPatchLocation(t),a=m.getLocation(t);n&&!e?r=n:a&&(r=a),T.isRelative(r)&&(r=T.resolve(r,t.url)),g.load(r)}function I(e){if(e){if(m.getIsPatch(e)){var n=e;e=p.getValue();var i=m.isPatchValid(e,n),s=i;if(i){var o=m.getPublishTime(e);s=m.applyPatchToManifest(e,n);var u=m.getPublishTime(e);s=o.getTime()!=u.getTime()}if(!s)return t.debug("Patch provided is invalid, performing full manifest refresh"),void R(!0);e.loadedTime=new Date}}else(e=p.getValue()).loadedTime=new Date;if(p.getValue()&&p.getValue().type===l.default.DYNAMIC&&e.type===l.default.STATIC)return v.trigger(a.default.DYNAMIC_TO_STATIC),h=!1,void(d=!0);p.setValue(e);var c=new Date,g=(c.getTime()-e.loadedTime.getTime())/1e3;1e3*(r=m.getManifestUpdatePeriod(e,g))>2147483647&&(r=2147483.647),v.trigger(a.default.MANIFEST_UPDATED,{manifest:e}),t.info("Manifest has been refreshed at "+c+"["+c.getTime()/1e3+"] "),f||A()}function C(){f||(h?A(E.get().streaming.manifestUpdateRetryInterval):R())}function w(e){e.error?e.error.code===u.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE&&y.error(e.error):I(e.manifest)}function N(){f=!1,A()}function D(){(f=!E.get().streaming.scheduling.scheduleWhilePaused)&&b()}function M(){h=!1}return e={initialize:function(){S(),v.on(a.default.STREAMS_COMPOSED,M,this),v.on(i.default.PLAYBACK_STARTED,N,this),v.on(i.default.PLAYBACK_PAUSED,D,this),v.on(a.default.INTERNAL_MANIFEST_LOADED,w,this)},setManifest:function(e){I(e)},refreshManifest:R,getIsUpdating:function(){return h},setConfig:function(e){e&&(e.manifestModel&&(p=e.manifestModel),e.adapter&&(m=e.adapter),e.manifestLoader&&(g=e.manifestLoader),e.errHandler&&(y=e.errHandler),e.settings&&(E=e.settings))},reset:function(){v.off(i.default.PLAYBACK_STARTED,N,this),v.off(i.default.PLAYBACK_PAUSED,D,this),v.off(a.default.STREAMS_COMPOSED,M,this),v.off(a.default.INTERNAL_MANIFEST_LOADED,w,this),S()}},t=Object(o.default)(_).getInstance().getLogger(e),e}f.__dashjs_factory_name="ManifestUpdater",t.default=s.default.getClassFactory(f)},"./src/streaming/MediaPlayer.js":function(e,t,r){r.r(t);var n=r("./externals/cea608-parser.js"),a=r.n(n),i=r("./src/streaming/constants/Constants.js"),s=r("./src/dash/constants/DashConstants.js"),o=r("./src/streaming/constants/MetricsConstants.js"),u=r("./src/streaming/controllers/PlaybackController.js"),l=r("./src/streaming/controllers/StreamController.js"),c=r("./src/streaming/controllers/GapController.js"),f=r("./src/streaming/controllers/MediaController.js"),d=r("./src/streaming/controllers/BaseURLController.js"),h=r("./src/streaming/ManifestLoader.js"),g=r("./src/streaming/utils/ErrorHandler.js"),p=r("./src/streaming/utils/Capabilities.js"),m=r("./src/streaming/utils/CapabilitiesFilter.js"),y=r("./src/streaming/utils/RequestModifier.js"),E=r("./src/streaming/models/URIFragmentModel.js"),_=r("./src/streaming/models/ManifestModel.js"),v=r("./src/streaming/models/MediaPlayerModel.js"),T=r("./src/streaming/controllers/AbrController.js"),S=r("./src/streaming/net/SchemeLoaderFactory.js"),b=r("./src/streaming/models/VideoModel.js"),A=r("./src/streaming/models/CmcdModel.js"),R=r("./src/streaming/utils/DOMStorage.js"),I=r("./src/core/Debug.js"),C=r("./src/core/errors/Errors.js"),w=r("./src/core/EventBus.js"),N=r("./src/core/events/Events.js"),D=r("./src/streaming/MediaPlayerEvents.js"),M=r("./src/core/FactoryMaker.js"),O=r("./src/core/Settings.js"),P=r("./src/core/Version.js"),L=r("./src/dash/controllers/SegmentBaseController.js"),F=r("./src/dash/DashAdapter.js"),j=r("./src/dash/DashMetrics.js"),x=r("./src/dash/utils/TimelineConverter.js"),k=r("./src/streaming/vo/metrics/HTTPRequest.js"),B=r("./externals/base64.js"),U=r.n(B),G=r("./node_modules/codem-isoboxer/dist/iso_boxer.js"),H=r.n(G),q=r("./src/streaming/vo/DashJSError.js"),Y=r("./src/streaming/utils/SupervisorTools.js"),K=r("./src/streaming/ManifestUpdater.js"),V=r("./src/streaming/utils/URLUtils.js"),W=r("./src/streaming/utils/BoxParser.js"),z=r("./src/streaming/text/TextController.js");function X(){var e,t,r,n,B,G,X,Q,J,$,Z,ee,te,re,ne,ae,ie,se,oe,ue,le,ce,fe,de,he,ge,pe,me,ye,Ee,_e,ve,Te,Se,be,Ae,Re="You must first call initialize() and set a source before calling this method",Ie="You must first call initialize() and set a valid source and view before calling this method",Ce="You must first call attachView() to set the video element before calling this method",we="MediaPlayer not initialized!",Ne=this.context,De=Object(w.default)(Ne).getInstance(),Me=Object(O.default)(Ne).getInstance(),Oe=Object(I.default)(Ne).getInstance({settings:Me});function Pe(){We(null),Ye(null),n=null,te&&(te.reset(),te=null),re&&(re.reset(),re=null),Me.reset(),ae&&(ae.reset(),ae=null)}function Le(){return!!r&&!!Ee.getElement()}function Fe(){return Object(P.getVersionString)()}function je(){if(!X)throw Ie;return ge.isPaused()}function xe(e){var t=fe&&fe.hasVideoTrack()?i.default.VIDEO:i.default.AUDIO,r=pe.getCurrentDVRInfo(t);if(!r)return 0;var n=ge.getLiveDelay(),a=r.range.start+e;return a>r.range.end-n&&(a=r.range.end-n),a}function ke(e){if(!X)throw Ie;var t=qe().currentTime;if(void 0!==e)t=fe.getTimeRelativeToStreamId(t,e);else if(ge.getIsDynamic()){var r=fe&&fe.hasVideoTrack()?i.default.VIDEO:i.default.AUDIO,n=pe.getCurrentDVRInfo(r);t=null===n||0===t?0:Math.max(0,t-n.range.start)}return t}function Be(){if(!X)throw Ie;var e=qe().duration;if(ge.getIsDynamic()){var t=fe&&fe.hasVideoTrack()?i.default.VIDEO:i.default.AUDIO,r=pe.getCurrentDVRInfo(t);e=r?r.range.end-r.range.start:0}return e}function Ue(e){Object(Y.checkParameterType)(e,"boolean"),Q=e}function Ge(){se.restoreDefaultUTCTimingSources()}function He(){return pe}function qe(){if(!Ee.getElement())throw Ce;return Ee.getElement()}function Ye(e){if(!B)throw we;Ee.setElement(e),e&&(Je(),function(){if(!re){var e=dashjs.MetricsReporting;if("function"==typeof e){var t=e(Ne).create();re=t.createMetricsReporting({debug:Oe,eventBus:De,mediaElement:qe(),adapter:ie,dashMetrics:pe,events:N.default,constants:i.default,metricsConstants:o.default})}}}(),function(){if(!ne){var e=dashjs.MssHandler;"function"==typeof e&&(C.default.extend(e.errors),ne=e(Ne).create({eventBus:De,mediaPlayerModel:se,dashMetrics:pe,manifestModel:me,playbackController:ge,streamController:fe,protectionController:te,baseURLController:ue,errHandler:oe,events:N.default,constants:i.default,debug:Oe,initSegmentType:k.HTTPRequest.INIT_SEGMENT_TYPE,BASE64:U.a,ISOBoxer:H.a,settings:Me}))}}(),fe&&fe.switchToVideoElement()),X&&Xe(),et()}function Ke(e){if(!G)throw Re;var t=fe.getActiveStreamInfo();return t?ee.getTracksFor(e,t.id):[]}function Ve(e,t){var r=-1;e.some(function(e,n){if(e===t)return r=n,!0}),r<0||e.splice(r,1)}function We(e){if(!B)throw we;"string"==typeof e&&_e.initialize(e),r=e,(G||X)&&Xe(),Le()&&et()}function ze(){if(!G)throw Re;var e=fe.getActiveStreamInfo();return e?fe.getStreamById(e.id):null}function Xe(){X=!1,G=!1,ie.reset(),fe.reset(),he.reset(),ge.reset(),J.reset(),ee.reset(),Te.reset(),te&&(Me.get().streaming.protection.keepProtectionMediaKeys?te.stop():(te.reset(),te=null,Je())),de.reset(),ye.reset()}function Qe(){return Object(h.default)(Ne).create({debug:Oe,errHandler:oe,dashMetrics:pe,mediaPlayerModel:se,requestModifier:Object(y.default)(Ne).getInstance(),mssHandler:ne,settings:Me})}function Je(){if(te)return te;var e=dashjs.Protection;if("function"==typeof e){var t=e(Ne).create();return N.default.extend(e.events),D.default.extend(e.events,{publicOnly:!0}),C.default.extend(e.errors),le||(le=Object(p.default)(Ne).getInstance()),(te=t.createProtectionSystem({debug:Oe,errHandler:oe,videoModel:Ee,capabilities:le,eventBus:De,events:N.default,BASE64:U.a,constants:i.default,cmcdModel:ye,settings:Me}))&&(te.setLicenseRequestFilters(Se),te.setLicenseResponseFilters(be)),te}return null}function $e(){if(!B)throw we;if(ae)return ae;var e=dashjs.OfflineController;if("function"==typeof e){N.default.extend(e.events),D.default.extend(e.events,{publicOnly:!0}),C.default.extend(e.errors);var t=Qe(),r=Object(K.default)(Ne).create();return r.setConfig({manifestModel:me,adapter:ie,manifestLoader:t,errHandler:oe}),ae=e(Ne).create({debug:Oe,manifestUpdater:r,baseURLController:ue,manifestLoader:t,manifestModel:me,mediaPlayerModel:se,abrController:J,playbackController:ge,adapter:ie,errHandler:oe,dashMetrics:pe,timelineConverter:Z,segmentBaseController:Te,schemeLoaderFactory:$,eventBus:De,events:N.default,errors:C.default,constants:i.default,settings:Me,dashConstants:s.default,urlUtils:Object(V.default)(Ne).getInstance()})}return null}function Ze(e){var t=fe&&fe.hasVideoTrack()?i.default.VIDEO:i.default.AUDIO,r=pe.getCurrentDVRInfo(t);return r?e+(r.manifestInfo.availableFrom.getTime()/1e3+r.range.start):0}function et(){var e;ae&&ae.resetRecords(),!G&&r&&(G=!0,t.info("Streaming Initialized"),e=Qe(),fe||(fe=Object(l.default)(Ne).getInstance()),de||(de=Object(z.default)(Ne).create({errHandler:oe,manifestModel:me,adapter:ie,mediaController:ee,videoModel:Ee,settings:Me})),ce.setConfig({capabilities:le,adapter:ie,settings:Me,manifestModel:me,errHandler:oe}),ce.setCustomCapabilitiesFilters(Ae),fe.setConfig({capabilities:le,capabilitiesFilter:ce,manifestLoader:e,manifestModel:me,mediaPlayerModel:se,protectionController:te,textController:de,adapter:ie,dashMetrics:pe,errHandler:oe,timelineConverter:Z,videoModel:Ee,playbackController:ge,abrController:J,mediaController:ee,settings:Me,baseURLController:ue,uriFragmentModel:_e,segmentBaseController:Te}),he.setConfig({settings:Me,playbackController:ge,streamController:fe,videoModel:Ee,timelineConverter:Z,adapter:ie}),ge.setConfig({streamController:fe,dashMetrics:pe,mediaPlayerModel:se,adapter:ie,videoModel:Ee,timelineConverter:Z,settings:Me}),J.setConfig({streamController:fe,domStorage:ve,mediaPlayerModel:se,dashMetrics:pe,adapter:ie,videoModel:Ee,settings:Me}),ye.setConfig({abrController:J,dashMetrics:pe,playbackController:ge}),J.initialize(),fe.initialize(Q,n),de.initialize(),he.initialize(),ye.initialize(),Te.initialize(),"string"==typeof r?fe.load(r):fe.loadWithManifest(r)),!X&&Le()&&(X=!0,t.info("Playback Initialized"))}return e={initialize:function(e,r,n){le||(le=Object(p.default)(Ne).getInstance()).setConfig({settings:Me}),oe||(oe=Object(g.default)(Ne).getInstance()),le.supportsMediaSource()?(B||(B=!0,Z=Object(x.default)(Ne).getInstance(),J||(J=Object(T.default)(Ne).getInstance()).setConfig({settings:Me}),$||($=Object(S.default)(Ne).getInstance()),ge||(ge=Object(u.default)(Ne).getInstance()),ee||(ee=Object(f.default)(Ne).getInstance()),fe||(fe=Object(l.default)(Ne).getInstance()),he||(he=Object(c.default)(Ne).getInstance()),ce||(ce=Object(m.default)(Ne).getInstance()),ie=Object(F.default)(Ne).getInstance(),me=Object(_.default)(Ne).getInstance(),ye=Object(A.default)(Ne).getInstance(),pe=Object(j.default)(Ne).getInstance({settings:Me}),ve=Object(R.default)(Ne).getInstance({settings:Me}),ie.setConfig({constants:i.default,cea608parser:a.a,errHandler:oe,BASE64:U.a}),ue||(ue=Object(d.default)(Ne).create()),ue.setConfig({adapter:ie}),Te||(Te=Object(L.default)(Ne).getInstance({dashMetrics:pe,mediaPlayerModel:se,errHandler:oe,baseURLController:ue,events:N.default,eventBus:De,debug:Oe,boxParser:Object(W.default)(Ne).getInstance(),requestModifier:Object(y.default)(Ne).getInstance(),errors:C.default})),ee.setConfig({domStorage:ve,settings:Me}),Ge(),Ue(void 0===n||n),$e()),e&&Ye(e),r&&We(r),t.info("[dash.js "+Fe()+"] MediaPlayer has been initialized")):oe.error(new q.default(C.default.CAPABILITY_MEDIASOURCE_ERROR_CODE,C.default.CAPABILITY_MEDIASOURCE_ERROR_MESSAGE))},setConfig:function(e){e&&(e.capabilities&&(le=e.capabilities),e.capabilitiesFilter&&(ce=e.capabilitiesFilter),e.streamController&&(fe=e.streamController),e.textController&&(de=e.textController),e.gapController&&(he=e.gapController),e.playbackController&&(ge=e.playbackController),e.mediaPlayerModel&&(se=e.mediaPlayerModel),e.abrController&&(J=e.abrController),e.schemeLoaderFactory&&($=e.schemeLoaderFactory),e.mediaController&&(ee=e.mediaController),e.settings&&(Me=e.settings))},on:function(e,t,r,n){De.on(e,t,r,n)},off:function(e,t,r){De.off(e,t,r)},extend:function(e,t,r){M.default.extend(e,t,r,Ne)},attachView:Ye,attachSource:We,isReady:Le,play:function(){if(!X)throw Ie;(!Q||je()&&X)&&ge.play()},isPaused:je,pause:function(){if(!X)throw Ie;ge.pause()},isSeeking:function(){if(!X)throw Ie;return ge.isSeeking()},isDynamic:function(){if(!X)throw Ie;return ge.getIsDynamic()},seek:function(e){if(!X)throw Ie;if(Object(Y.checkParameterType)(e,"number"),isNaN(e))throw i.default.BAD_ARGUMENT_ERROR;var t=ge.getIsDynamic()?xe(e):e;ge.seek(t)},setPlaybackRate:function(e){qe().playbackRate=e},getPlaybackRate:function(){return qe().playbackRate},setMute:function(e){Object(Y.checkParameterType)(e,"boolean"),qe().muted=e},isMuted:function(){return qe().muted},setVolume:function(e){if("number"!=typeof e||isNaN(e)||e<0||e>1)throw i.default.BAD_ARGUMENT_ERROR;qe().volume=e},getVolume:function(){return qe().volume},time:ke,duration:Be,timeAsUTC:function(){if(!X)throw Ie;return ke()<0?NaN:Ze(ke())},durationAsUTC:function(){if(!X)throw Ie;return Ze(Be())},getActiveStream:ze,getDVRWindowSize:function(){var e=fe&&fe.hasVideoTrack()?i.default.VIDEO:i.default.AUDIO,t=pe.getCurrentDVRInfo(e);return t?t.manifestInfo.dvrWindowSize:0},getDVRSeekOffset:xe,convertToTimeCode:function(e){e=Math.max(e,0);var t=Math.floor(e/3600),r=Math.floor(e%3600/60),n=Math.floor(e%3600%60);return(0===t?"":t<10?"0"+t.toString()+":":t.toString()+":")+(r<10?"0"+r.toString():r.toString())+":"+(n<10?"0"+n.toString():n.toString())},formatUTC:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=new Date(1e3*e),i=a.toLocaleDateString(t),s=a.toLocaleTimeString(t,{hour12:r});return n?s+" "+i:s},getVersion:Fe,getDebug:function(){return Oe},getBufferLength:function(e){var r=[i.default.VIDEO,i.default.AUDIO,i.default.TEXT];if(e)return-1!==r.indexOf(e)?He().getCurrentBufferLevel(e)||NaN:(t.warn("getBufferLength requested for invalid type"),NaN);var n=r.map(function(e){return Ke(e).length>0?He().getCurrentBufferLevel(e):Number.MAX_VALUE}).reduce(function(e,t){return Math.min(e,t)});return n===Number.MAX_VALUE?NaN:n},getTTMLRenderingDiv:function(){return Ee?Ee.getTTMLRenderingDiv():null},getVideoElement:qe,getSource:function(){if(!r)throw"You must first call attachSource() with a valid source before calling this method";return r},getCurrentLiveLatency:function(){if(!B)throw we;return X?ge.getCurrentLiveLatency():NaN},getTopBitrateInfoFor:function(e){if(!G)throw Re;return J.getTopBitrateInfoFor(e)},setAutoPlay:Ue,getAutoPlay:function(){return Q},getDashMetrics:He,getQualityFor:function(e){if(!G)throw Re;if(e===i.default.IMAGE){var t=ze();if(!t)return-1;var r=t.getThumbnailController();return r?r.getCurrentTrackIndex():-1}return J.getQualityFor(e)},setQualityFor:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!G)throw Re;if(e===i.default.IMAGE){var n=ze();if(!n)return;var a=n.getThumbnailController();a&&a.setTrackByIndex(t)}J.setPlaybackQuality(e,fe.getActiveStreamInfo(),t,{forceReplace:r})},updatePortalSize:function(){J.setElementSize(),J.setWindowResizeEventCalled(!0)},enableText:function(e){var t=fe.getActiveStreamInfo();return!(!t||!de)&&de.enableText(t.id,e)},enableForcedTextStreaming:function(e){return!(!fe.getActiveStreamInfo()||!de)&&de.enableForcedTextStreaming(e)},isTextEnabled:function(){var e=fe.getActiveStreamInfo();return!(!e||!de)&&de.isTextEnabled(e)},setTextTrack:function(e){if(!X)throw Ie;var t=fe.getActiveStreamInfo();t&&de&&de.setTextTrack(t.id,e)},getBitrateInfoListFor:function(e){if(!G)throw Re;var t=ze();return t?t.getBitrateListFor(e):[]},getStreamsFromManifest:function(e){if(!G)throw Re;return ie.getStreamsInfo(e)},getTracksFor:Ke,getTracksForTypeFromManifest:function(e,t,r){if(!G)throw Re;return(r=r||ie.getStreamsInfo(t,1)[0])?ie.getAllMediaInfoForType(r,e,t):[]},getCurrentTrackFor:function(e){if(!G)throw Re;var t=fe.getActiveStreamInfo();return ee.getCurrentTrackFor(e,t.id)},setInitialMediaSettingsFor:function(e,t){if(!B)throw we;ee.setInitialSettings(e,t)},getInitialMediaSettingsFor:function(e){if(!B)throw we;return ee.getInitialSettings(e)},setCurrentTrack:function(e){if(!G)throw Re;ee.setTrack(e)},addABRCustomRule:function(e,t,r){se.addABRCustomRule(e,t,r)},removeABRCustomRule:function(e){se.removeABRCustomRule(e)},removeAllABRCustomRule:function(){se.removeABRCustomRule()},getAverageThroughput:function(e){var t=J.getThroughputHistory(),r=ge.getIsDynamic();return t?t.getAverageThroughput(e,r):0},retrieveManifest:function(e,t){var r=Qe(),n=this;De.on(N.default.INTERNAL_MANIFEST_LOADED,function e(a){a.error?t(null,a.error):t(a.manifest),De.off(N.default.INTERNAL_MANIFEST_LOADED,e,n),r.reset()},n),_e.initialize(e),r.load(e)},addUTCTimingSource:function(e,t){se.addUTCTimingSource(e,t)},removeUTCTimingSource:function(e,t){se.removeUTCTimingSource(e,t)},clearDefaultUTCTimingSources:function(){se.clearDefaultUTCTimingSources()},restoreDefaultUTCTimingSources:Ge,setXHRWithCredentialsForType:function(e,t){se.setXHRWithCredentialsForType(e,t)},getXHRWithCredentialsForType:function(e){return se.getXHRWithCredentialsForType(e)},getProtectionController:function(){return Je()},attachProtectionController:function(e){te=e},setProtectionData:function(e){n=e,fe&&fe.setProtectionData(n)},registerLicenseRequestFilter:function(e){Se.push(e),te&&te.setLicenseRequestFilters(Se)},registerLicenseResponseFilter:function(e){be.push(e),te&&te.setLicenseResponseFilters(be)},unregisterLicenseRequestFilter:function(e){Ve(Se,e),te&&te.setLicenseRequestFilters(Se)},unregisterLicenseResponseFilter:function(e){Ve(be,e),te&&te.setLicenseResponseFilters(be)},registerCustomCapabilitiesFilter:function(e){Ae.push(e),ce&&ce.setCustomCapabilitiesFilters(Ae)},unregisterCustomCapabilitiesFilter:function(e){Ve(Ae,e),ce&&ce.setCustomCapabilitiesFilters(Ae)},setCustomInitialTrackSelectionFunction:function(e){ee&&ee.setCustomInitialTrackSelectionFunction(e)},resetCustomInitialTrackSelectionFunction:function(){ee&&ee.setCustomInitialTrackSelectionFunction(null)},attachTTMLRenderingDiv:function(e){if(!Ee.getElement())throw Ce;Ee.setTTMLRenderingDiv(e)},getCurrentTextTrackIndex:function(){var e=fe.getActiveStreamInfo();if(e&&de)return de.getCurrentTrackIdx(e.id)},provideThumbnail:function(e,t){if("function"==typeof t)if(e<0)t(null);else{var r=ge.getIsDynamic()?xe(e):e,n=fe.getStreamForTime(r);if(null!==n){var a=n.getThumbnailController();if(a){var i=fe.getTimeRelativeToStreamId(r,n.getId());return a.provide(i,t)}t(null)}else t(null)}},getDashAdapter:function(){return ie},getOfflineController:function(){return $e()},getSettings:function(){return Me.get()},updateSettings:function(e){Me.update(e)},resetSettings:function(){Me.reset()},reset:Pe,destroy:function(){Pe(),Se=[],be=[],Ae=[],M.default.deleteSingletonInstances(Ne)}},t=Oe.getLogger(e),B=!1,X=!1,G=!1,Q=!0,te=null,ae=null,n=null,ie=null,Te=null,N.default.extend(D.default),se=Object(v.default)(Ne).getInstance(),Ee=Object(b.default)(Ne).getInstance(),_e=Object(E.default)(Ne).getInstance(),Se=[],be=[],Ae=[],e}X.__dashjs_factory_name="MediaPlayer";var Q=M.default.getClassFactory(X);Q.events=D.default,Q.errors=C.default,M.default.updateClassFactory(X.__dashjs_factory_name,Q),t.default=Q},"./src/streaming/MediaPlayerEvents.js":function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}r.r(t);var s=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(o,e);var t,r,s=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,a=i(t);if(r){var s=i(this).constructor;e=Reflect.construct(a,arguments,s)}else e=a.apply(this,arguments);return function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function o(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=s.call(this)).AST_IN_FUTURE="astInFuture",e.BUFFER_EMPTY="bufferStalled",e.BUFFER_LOADED="bufferLoaded",e.BUFFER_LEVEL_STATE_CHANGED="bufferStateChanged",e.BUFFER_LEVEL_UPDATED="bufferLevelUpdated",e.DYNAMIC_TO_STATIC="dynamicToStatic",e.ERROR="error",e.FRAGMENT_LOADING_COMPLETED="fragmentLoadingCompleted",e.FRAGMENT_LOADING_PROGRESS="fragmentLoadingProgress",e.FRAGMENT_LOADING_STARTED="fragmentLoadingStarted",e.FRAGMENT_LOADING_ABANDONED="fragmentLoadingAbandoned",e.LOG="log",e.MANIFEST_LOADED="manifestLoaded",e.METRICS_CHANGED="metricsChanged",e.METRIC_CHANGED="metricChanged",e.METRIC_ADDED="metricAdded",e.METRIC_UPDATED="metricUpdated",e.PERIOD_SWITCH_STARTED="periodSwitchStarted",e.PERIOD_SWITCH_COMPLETED="periodSwitchCompleted",e.QUALITY_CHANGE_REQUESTED="qualityChangeRequested",e.QUALITY_CHANGE_RENDERED="qualityChangeRendered",e.TRACK_CHANGE_RENDERED="trackChangeRendered",e.STREAM_INITIALIZING="streamInitializing",e.STREAM_UPDATED="streamUpdated",e.STREAM_ACTIVATED="streamActivated",e.STREAM_DEACTIVATED="streamDeactivated",e.STREAM_INITIALIZED="streamInitialized",e.STREAM_TEARDOWN_COMPLETE="streamTeardownComplete",e.TEXT_TRACKS_ADDED="allTextTracksAdded",e.TEXT_TRACK_ADDED="textTrackAdded",e.TTML_PARSED="ttmlParsed",e.TTML_TO_PARSE="ttmlToParse",e.CAPTION_RENDERED="captionRendered",e.CAPTION_CONTAINER_RESIZE="captionContainerResize",e.CAN_PLAY="canPlay",e.CAN_PLAY_THROUGH="canPlayThrough",e.PLAYBACK_ENDED="playbackEnded",e.PLAYBACK_ERROR="playbackError",e.PLAYBACK_NOT_ALLOWED="playbackNotAllowed",e.PLAYBACK_METADATA_LOADED="playbackMetaDataLoaded",e.PLAYBACK_LOADED_DATA="playbackLoadedData",e.PLAYBACK_PAUSED="playbackPaused",e.PLAYBACK_PLAYING="playbackPlaying",e.PLAYBACK_PROGRESS="playbackProgress",e.PLAYBACK_RATE_CHANGED="playbackRateChanged",e.PLAYBACK_SEEKED="playbackSeeked",e.PLAYBACK_SEEKING="playbackSeeking",e.PLAYBACK_SEEK_ASKED="playbackSeekAsked",e.PLAYBACK_STALLED="playbackStalled",e.PLAYBACK_STARTED="playbackStarted",e.PLAYBACK_TIME_UPDATED="playbackTimeUpdated",e.PLAYBACK_WAITING="playbackWaiting",e.MANIFEST_VALIDITY_CHANGED="manifestValidityChanged",e.EVENT_MODE_ON_START="eventModeOnStart",e.EVENT_MODE_ON_RECEIVE="eventModeOnReceive",e.CONFORMANCE_VIOLATION="conformanceViolation",e.REPRESENTATION_SWITCH="representationSwitch",e}return o}(r("./src/core/events/EventsBase.js").default));t.default=s},"./src/streaming/MediaPlayerFactory.js":function(e,t,r){r.r(t);var n,a=r("./src/streaming/MediaPlayer.js"),i=function(){var e,t="application/dash+xml";function r(r,n,i){if(!r||!/^VIDEO$/i.test(r.nodeName))return null;if(r._dashjs_player)return r._dashjs_player;var s,o=r.id||r.name||"video element";if(!(n=n||[].slice.call(r.querySelectorAll("source")).filter(function(e){return e.type==t})[0])&&r.src)(n=document.createElement("source")).src=r.src;else if(!n&&!r.src)return null;return i=i||{},(s=Object(a.default)(i).create()).initialize(r,n.src,r.autoplay),e||(e=s.getDebug().getLogger()),e.debug("Converted "+o+" to dash.js player and added content: "+n.src),r._dashjs_player=s,s}function n(e){return/^VIDEO$/i.test(e.nodeName)?e:n(e.parentNode)}return{create:r,createAll:function(e,a){var i=[];e=e||"[data-dashjs-player]";for(var s=(a=a||document).querySelectorAll(e),o=0;o<s.length;o++){var u=r(s[o],null);i.push(u)}for(var l=a.querySelectorAll('source[type="'+t+'"]'),c=0;c<l.length;c++){var f=r(n(l[c]),null);i.push(f)}return i}}}();!("undefined"!=typeof window&&window&&window.dashjs&&window.dashjs.skipAutoCreate)&&"undefined"!=typeof window&&window&&window.addEventListener&&("complete"===window.document.readyState?window.dashjs?i.createAll():n=window.setInterval(function(){window.dashjs&&(window.clearInterval(n),i.createAll())},500):window.addEventListener("load",function e(){window.removeEventListener("load",e),i.createAll()})),t.default=i},"./src/streaming/SourceBufferSink.js":function(e,t,r){r.r(t);var n=r("./src/core/Debug.js"),a=r("./src/streaming/vo/DashJSError.js"),i=r("./src/core/FactoryMaker.js"),s=r("./src/core/errors/Errors.js"),o=r("./src/core/Settings.js"),u=r("./src/streaming/constants/Constants.js"),l=r("./src/streaming/vo/metrics/HTTPRequest.js"),c=r("./src/core/events/Events.js");function f(e){var t,r,i,f,d,h,g=this.context,p=Object(o.default)(g).getInstance(),m=e.textController,y=e.eventBus,E=[],_=[],v=!1,T=e.mediaSource,S=null;function b(e){return new Promise(function(t){P(function(){f.changeType&&f.changeType(e),t()})})}function A(e){return f=m.getTextSourceBuffer(e),Promise.resolve()}function R(){if("function"==typeof f.addEventListener)try{f.addEventListener("updateend",M,!1),f.addEventListener("error",O,!1),f.addEventListener("abort",O,!1)}catch(e){h=setInterval(M,50)}else h=setInterval(M,50)}function I(e){return new Promise(function(t){f&&p.get().streaming.buffer.useAppendWindow?P(function(){try{if(!f)return void t();var r=T.duration,n=0;e&&!isNaN(e.start)&&!isNaN(e.duration)&&isFinite(e.duration)&&(r=e.start+e.duration),e&&!isNaN(e.start)&&(n=e.start),f.appendWindowEnd===r&&f.appendWindowStart===n||(f.appendWindowStart=0,f.appendWindowEnd=r+.01,f.appendWindowStart=Math.max(n-.1,0),i.debug("Updated append window for ".concat(d.type,". Set start to ").concat(f.appendWindowStart," and end to ").concat(f.appendWindowEnd))),t()}catch(e){i.warn("Failed to set append window"),t()}}):t()})}function C(e){return new Promise(function(t){f?P(function(){try{f.timestampOffset===e||isNaN(e)||(f.timestampOffset=e,i.debug("Set MSE timestamp offset to ".concat(e))),t()}catch(e){t()}}):t()})}function w(){return new Promise(function(e){P(function(){var t=f.appendWindowStart,r=f.appendWindowEnd;f&&(f.abort(),f.appendWindowStart=t,f.appendWindowEnd=r),e()})})}function N(){if(!v&&_.length>0){v=!0;var e=_[0];_.splice(0,1);var t=function(){v=!1,_.length>0&&N.call(this),e&&e.data&&e.data.segmentType&&e.data.segmentType!==l.HTTPRequest.INIT_SEGMENT_TYPE&&delete e.data.bytes,e.promise.resolve({chunk:e.data})};try{S=e.request,0===e.data.bytes.byteLength?t.call(this):(f.appendBuffer?f.appendBuffer(e.data.bytes):f.append(e.data.bytes,e.data),P(t.bind(this)))}catch(t){i.fatal('SourceBuffer append failed "'+t+'"'),_.length>0?N():v=!1,delete e.data.bytes,e.promise.reject({chunk:e.data,error:new a.default(t.code,t.message)})}}}function D(){E.length>0&&(f.updating||(E.shift()(),D()))}function M(){f.updating||D()}function O(e){var t,n,a=e.target||{};t=c.default.SOURCE_BUFFER_ERROR,n={error:a,lastRequestAppended:S}||{},y.trigger(t,n,{streamId:d.streamInfo.id,mediaType:r})}function P(e){E.push(e),f.updating||D()}return t={getType:function(){return r},getAllBufferRanges:function(){try{return f.buffered}catch(e){return i.error("getAllBufferRanges exception: "+e.message),null}},getBuffer:function(){return f},append:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new Promise(function(n,i){e?(_.push({data:e,promise:{resolve:n,reject:i},request:r}),P(N.bind(t))):i({chunk:e,error:new a.default(s.default.APPEND_ERROR_CODE,s.default.APPEND_ERROR_MESSAGE)})})},remove:function(e){return new Promise(function(t,r){var n=e.start,i=e.end;n>=0&&i>n?P(function(){try{f.remove(n,i),P(function(){t({from:n,to:i,unintended:!1}),e.resolve&&e.resolve()})}catch(t){r({from:n,to:i,unintended:!1,error:new a.default(s.default.REMOVE_ERROR_CODE,s.default.REMOVE_ERROR_MESSAGE)}),e.reject&&e.reject(t)}}):t()})},abort:function(){return new Promise(function(e){try{_=[],"open"===T.readyState?P(function(){try{f&&f.abort(),e()}catch(t){e()}}):f&&f.setTextTrack&&"ended"===T.readyState?(f.abort(),e()):e()}catch(t){e()}})},reset:function(){if(f){try{E=[],function(){try{"function"==typeof f.removeEventListener&&(f.removeEventListener("updateend",M,!1),f.removeEventListener("error",O,!1),f.removeEventListener("abort",O,!1)),clearInterval(h)}catch(e){i.error(e)}}(),v=!1,_=[],f.getClassName&&"TextSourceBuffer"===f.getClassName()||(i.debug("Removing sourcebuffer from media source"),T.removeSourceBuffer(f))}catch(e){}f=null}S=null},updateTimestampOffset:C,initializeForStreamSwitch:function(e,t,n){r=(d=e).type;var a=d.codec;!function(e){f=e.getBuffer()}(n),R();var i=[];return i.push(w),i.push(I(d.streamInfo)),i.push(b(a)),t&&void 0!==t.MSETimeOffset&&i.push(C(t.MSETimeOffset)),Promise.all(i)},initializeForFirstUse:function(e,t,n){r=(d=t).type;var a=d.codec;try{if(a.match(/application\/mp4;\s*codecs="(stpp|wvtt).*"/i))return A(e);f=T.addSourceBuffer(a),R();var i=[];return i.push(I(d.streamInfo)),n&&void 0!==n.MSETimeOffset&&i.push(C(n.MSETimeOffset)),Promise.all(i)}catch(t){return d.type==u.default.TEXT&&!d.isFragmented||-1!==a.indexOf('codecs="stpp')||-1!==a.indexOf('codecs="vtt')?A(e):Promise.reject(t)}},updateAppendWindow:I,changeType:b},i=Object(n.default)(g).getInstance().getLogger(t),t}f.__dashjs_factory_name="SourceBufferSink";var d=i.default.getClassFactory(f);t.default=d},"./src/streaming/Stream.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/Constants.js"),a=r("./src/dash/constants/DashConstants.js"),i=r("./src/streaming/StreamProcessor.js"),s=r("./src/streaming/controllers/FragmentController.js"),o=r("./src/streaming/thumbnail/ThumbnailController.js"),u=r("./src/core/EventBus.js"),l=r("./src/core/events/Events.js"),c=r("./src/core/Debug.js"),f=r("./src/core/errors/Errors.js"),d=r("./src/core/FactoryMaker.js"),h=r("./src/streaming/vo/DashJSError.js"),g=r("./src/streaming/utils/BoxParser.js"),p=r("./src/streaming/utils/URLUtils.js"),m=r("./src/streaming/controllers/BlacklistController.js"),y=[n.default.VIDEO,n.default.AUDIO,n.default.TEXT,n.default.MUXED,n.default.IMAGE];function E(e){e=e||{};var t,r,d,E,_,v,T,S,b,A,R,I,C,w,N,D,M,O,P=this.context,L=Object(u.default)(P).getInstance(),F=Object(p.default)(P).getInstance(),j=e.manifestModel,x=e.mediaPlayerModel,k=e.dashMetrics,B=e.manifestUpdater,U=e.adapter,G=e.timelineConverter,H=e.capabilities,q=e.errHandler,Y=e.abrController,K=e.playbackController,V=e.eventController,W=e.mediaController,z=e.protectionController,X=e.textController,Q=e.videoModel,J=e.streamInfo,$=e.settings;function Z(t,s){return new Promise(function(u,c){oe(),A=!0,le();var g,p=Q.getElement();y.forEach(function(s){(s!==n.default.VIDEO||!p||p&&/^VIDEO$/i.test(p.nodeName))&&function(t,s){var u,c=U.getAllMediaInfoForType(J,t),f=[],h=null;if(c&&0!==c.length){t===n.default.VIDEO&&(T=!0),t===n.default.AUDIO&&(S=!0);for(var g=0,p=c.length;g<p;g++)h=c[g],t===n.default.TEXT&&h.isEmbedded&&(X.addEmbeddedTrack(J,h),f.push(h)),ee(h)&&W.addTrack(h);if(f.length>0&&(W.setInitialMediaSettingsForType(t,J),X.setInitialSettings(W.getInitialSettings(t)),X.addMediaInfosToBuffer(J,t,f)),0!==(c=c.filter(function(e){return!e.isEmbedded})).length)if(t!==n.default.IMAGE){L.trigger(l.default.STREAM_INITIALIZING,{streamInfo:J,mediaInfo:h}),W.setInitialMediaSettingsForType(t,J);var m=function(t,r){var a=t&&t.length>0?t[0]:null,s=R.getModel(a?a.type:null),o=a?a.type:null,u=a?a.mimeType:null,l=a?a.isFragmented:null,c=Object(i.default)(P).create({streamInfo:J,type:o,mimeType:u,timelineConverter:G,adapter:U,manifestModel:j,mediaPlayerModel:x,fragmentModel:s,dashMetrics:e.dashMetrics,baseURLController:e.baseURLController,segmentBaseController:e.segmentBaseController,abrController:Y,playbackController:K,mediaController:W,textController:X,errHandler:q,settings:$,boxParser:N,segmentBlacklistController:C});c.initialize(r,T,l),d.push(c);for(var f=0;f<t.length;f++)c.addMediaInfo(t[f]);return o===n.default.TEXT&&X.addMediaInfosToBuffer(J,o,t,s),c}(c,s);(u=W.getCurrentTrackFor(t,J.id))&&(Y.updateTopQualityIndex(u),m.selectMediaInfo(t===n.default.TEXT&&u.isEmbedded?c[0]:u))}else(I=Object(o.default)(P).create({streamInfo:J,adapter:U,baseURLController:e.baseURLController,timelineConverter:e.timelineConverter,debug:D,eventBus:L,events:l.default,dashConstants:a.default,dashMetrics:e.dashMetrics,segmentBaseController:e.segmentBaseController})).initialize()}else r.info("No "+t+" data.")}(s,t)}),(g=s,new Promise(function(e){var t={},r=d.map(function(e){return e.createBufferSinks(g)});Promise.all(r).then(function(r){r.forEach(function(e){e&&(t[e.getType()]=e)}),e(t)}).catch(function(){e(t)})})).then(function(e){if(A=!1,0===d.length){var t="No streams to play.";q.error(new h.default(f.default.MANIFEST_ERROR_ID_NOSTREAMS_CODE,t,j.getValue())),r.fatal(t)}else ce();X.createTracks(J),u(e)}).catch(function(e){c(e)})})}function ee(e){var t,a=e?e.type:null;return a===n.default.MUXED?(t="Multiplexed representations are intentionally not supported, as they are not compliant with the DASH-AVC/264 guidelines",r.fatal(t),q.error(new h.default(f.default.MANIFEST_ERROR_ID_MULTIPLEXED_CODE,t,j.getValue())),!1):!(a!==n.default.TEXT&&a!==n.default.IMAGE&&e.contentProtection&&!H.supportsEncryptedMedia()&&(q.error(new h.default(f.default.CAPABILITY_MEDIAKEYS_ERROR_CODE,f.default.CAPABILITY_MEDIAKEYS_ERROR_MESSAGE)),1))}function te(e){for(var t=d?d.length:0,r=0;r<t;r++){var n=d[r].getFragmentModel();n.abortRequests(),n.resetInitialSettings(),d[r].reset(!1,e)}X&&X.deactivateStream(J),d=[],_=!1,v=!1,ve(!1),ne(!1),L.trigger(l.default.STREAM_DEACTIVATED,{streamInfo:J})}function re(e){te(e),E=!1,T=!1,S=!1,b={},A=!1,M=!1,O=[]}function ne(e){M=e}function ae(){return J?J.start:NaN}function ie(){return J?J.id:null}function se(){return J}function oe(){if(!Q||!Y)throw new Error(n.default.MISSING_CONFIG_ERROR)}function ue(e){e.error&&(q.error(e.error),r.fatal(e.error.message))}function le(){if(V){var e=U.getEventsFor(J);V.addInlineEvents(e)}}function ce(){for(var e=d.length,t=b.audio||b.video?new h.default(f.default.DATA_UPDATE_FAILED_ERROR_CODE,f.default.DATA_UPDATE_FAILED_ERROR_MESSAGE):null,r=0;r<e;r++)if(d[r].isUpdating()||A)return;if(z){z.clearMediaInfoArray();for(var a=0;a<e&&d[a];a++){var i=d[a].getType(),s=d[a].getMediaInfo();if(i===n.default.AUDIO||i===n.default.VIDEO||i===n.default.TEXT&&s.isFragmented){var o=d[a].getMediaInfo();o&&z.initializeForMedia(o)}}}t?q.error(t):E||(E=!0,L.trigger(l.default.STREAM_INITIALIZED,{streamInfo:J}))}function fe(){var e=me(),t=e.length;if(0!==t){for(var a=0;a<t;a++)if(!e[a].isBufferingCompleted()&&(e[a].getType()===n.default.AUDIO||e[a].getType()===n.default.VIDEO))return void r.debug("onBufferingCompleted - One streamProcessor has finished but",e[a].getType(),"one is not buffering completed");r.debug("onBufferingCompleted - trigger STREAM_BUFFERING_COMPLETED"),v=!0,L.trigger(l.default.STREAM_BUFFERING_COMPLETED,{streamInfo:J},{streamInfo:J})}else r.warn("onBufferingCompleted - can't trigger STREAM_BUFFERING_COMPLETED because no streamProcessor is defined")}function de(e){b[e.mediaType]=e.error,ce()}function he(e){V&&V.addInbandEvents(e.events)}function ge(e){return e&&e.type?pe(e.type):null}function pe(e){return e?me().filter(function(t){return t.getType()===e})[0]:null}function me(){for(var e,t,r=[],a=0;a<d.length;a++)(e=(t=d[a]).getType())!==n.default.AUDIO&&e!==n.default.VIDEO&&e!==n.default.TEXT||r.push(t);return r}function ye(e,t){var r=se(),n=t.getStreamInfo();if(!n||!r)return!0;var a=U.getAdaptationForType(n.index,e,n),i=U.getAdaptationForType(r.index,e,r);return a&&i?!(!Ee(i)&&Ee(a)):!a&&!i}function Ee(e){return!!e&&!!(e.ContentProtection||e.Representation&&e.Representation.length>0&&e.Representation[0].ContentProtection)}function _e(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e||!e.hasOwnProperty("getStreamInfo"))return!1;var n=e.getStreamInfo(),a=r?r.getStreamInfo():se();if(!n||!a)return!1;var i=U.getAdaptationForType(n.index,t,n),s=U.getAdaptationForType(a.index,t,a);if(!i||!s)return!i&&!s;var o=i&&s&&i.mimeType===s.mimeType,u=s.Representation_asArray.map(function(e){return e.codecs}),l=i.Representation_asArray.map(function(e){return e.codecs}),c=l.some(function(e){return u.indexOf(e)>-1}),f=l.some(function(e){return u.some(function(t){return H.codecRootCompatibleWithCodec(t,e)})});return c||f&&o}function ve(e){w=e}function Te(){return w}return t={initialize:function(){L.on(l.default.BUFFERING_COMPLETED,fe,t),L.on(l.default.DATA_UPDATE_COMPLETED,de,t),L.on(l.default.INBAND_EVENTS,he,t),z&&(L.on(l.default.KEY_ERROR,ue,t),L.on(l.default.SERVER_CERTIFICATE_UPDATED,ue,t),L.on(l.default.LICENSE_REQUEST_COMPLETE,ue,t),L.on(l.default.KEY_SYSTEM_SELECTED,ue,t),L.on(l.default.KEY_SESSION_CREATED,ue,t),L.on(l.default.KEY_STATUSES_CHANGED,ue,t)),X.initializeForStream(J),L.trigger(l.default.STREAM_UPDATED,{streamInfo:J})},getStreamId:function(){return J?J.id:null},activate:function(e,t){return new Promise(function(r,n){if(!_)return Te()?(_=!0,L.trigger(l.default.STREAM_ACTIVATED,{streamInfo:J}),void r(t)):void function(e,t){return Z(e,t)}(e,t).then(function(e){_=!0,L.trigger(l.default.STREAM_ACTIVATED,{streamInfo:J}),r(e)}).catch(function(e){n(e)});r(t)})},deactivate:te,getIsActive:function(){return _},getDuration:function(){return J?J.duration:NaN},getStartTime:ae,getId:ie,getStreamInfo:se,getHasAudioTrack:function(){return S},getHasVideoTrack:function(){return T},startPreloading:function(e,t){return new Promise(function(n,a){Te()?a():(r.info("[startPreloading] Preloading next stream with id ".concat(ie())),ve(!0),Z(e,t).then(function(){for(var e=0;e<d.length&&d[e];e++)d[e].setExplicitBufferingTime(ae()),d[e].getScheduleController().startScheduleTimer();n()}).catch(function(){ve(!1),a()}))})},getThumbnailController:function(){return I},getBitrateListFor:function(e){if(oe(),e===n.default.IMAGE)return I?I.getBitrateList():[];var t=function(e){for(var t=null,r=0;r<d.length;r++)if((t=d[r]).getType()===e)return t.getMediaInfo();return null}(e);return Y.getBitrateList(t)},updateData:function(e){return new Promise(function(t){A=!0,J=e,V&&le();for(var r=[],n=0,a=d.length;n<a;n++){var i=d[n],s=i.getMediaInfo();r.push(i.updateStreamInfo(J));var o=U.getAllMediaInfoForType(J,i.getType());if(o){i.clearMediaInfoArray();for(var u=0;u<o.length;u++){var c=o[u];i.addMediaInfo(o[u]),U.areMediaInfosEqual(s,c)&&(Y.updateTopQualityIndex(c),r.push(i.selectMediaInfo(c)))}}}Promise.all(r).then(function(){for(r=[];O.length>0;){var e=O.pop(),t=e.newMediaInfo,n=ge(e.oldMediaInfo);if(!n)return;r.push(n.prepareTrackSwitch()),n.selectMediaInfo(t)}return Promise.all(r)}).then(function(){A=!1,ce(),L.trigger(l.default.STREAM_UPDATED,{streamInfo:J}),t()})})},reset:function(e){R&&(R.reset(),R=null),Y&&J&&Y.clearDataForStream(J.id),C&&(C.reset(),C=null),re(e),J=null,L.off(l.default.DATA_UPDATE_COMPLETED,de,t),L.off(l.default.BUFFERING_COMPLETED,fe,t),L.off(l.default.INBAND_EVENTS,he,t),z&&(L.off(l.default.KEY_ERROR,ue,t),L.off(l.default.SERVER_CERTIFICATE_UPDATED,ue,t),L.off(l.default.LICENSE_REQUEST_COMPLETE,ue,t),L.off(l.default.KEY_SYSTEM_SELECTED,ue,t),L.off(l.default.KEY_SESSION_CREATED,ue,t),L.off(l.default.KEY_STATUSES_CHANGED,ue,t))},getProcessors:me,setMediaSource:function(e){for(var t=0;t<d.length;)ee(d[t].getMediaInfo())?(d[t].setMediaSource(e),t++):(d[t].reset(),d.splice(t,1));if(0===d.length){var n="No streams to play.";q.error(new h.default(f.default.MANIFEST_ERROR_ID_NOSTREAMS_CODE,n+"nostreams",j.getValue())),r.fatal(n)}},isMediaCodecCompatible:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return _e(e,n.default.VIDEO,t)&&_e(e,n.default.AUDIO,t)},isProtectionCompatible:function(e){return!e||ye(n.default.VIDEO,e)&&ye(n.default.AUDIO,e)},getPreloaded:Te,getIsEndedEventSignaled:function(){return M},setIsEndedEventSignaled:ne,getAdapter:function(){return U},getHasFinishedBuffering:function(){return v},setPreloaded:ve,startScheduleControllers:function(){for(var e=d.length,t=0;t<e&&d[t];t++)d[t].getScheduleController().startScheduleTimer()},prepareTrackChange:function(e){if(_&&J){v=!1;var t=e.newMediaInfo,a=j.getValue();U.setCurrentMediaInfo(J.id,t.type,t);var i=ge(t);if(i){var s=K.getTime();r.info("Stream - Process track changed at current time "+s),a.refreshManifestOnSwitchTrack?(O.push(e),B.getIsUpdating()||(r.debug("Stream - Refreshing manifest for switch track"),B.refreshManifest())):i.selectMediaInfo(t).then(function(){t.type!==n.default.VIDEO&&t.type!==n.default.AUDIO||Y.updateTopQualityIndex(t),i.prepareTrackSwitch()})}}},prepareQualityChange:function(e){var t=pe(e.mediaType);t&&t.prepareQualityChange(e)}},function(){try{D=Object(c.default)(P).getInstance(),r=D.getLogger(t),re(),N=Object(g.default)(P).getInstance(),C=Object(m.default)(P).create({updateEventName:l.default.SEGMENT_LOCATION_BLACKLIST_CHANGED,addBlacklistEventName:l.default.SEGMENT_LOCATION_BLACKLIST_ADD}),R=Object(s.default)(P).create({streamInfo:J,mediaPlayerModel:x,dashMetrics:k,errHandler:q,settings:$,boxParser:N,dashConstants:a.default,urlUtils:F})}catch(e){throw e}}(),t}E.__dashjs_factory_name="Stream",t.default=d.default.getClassFactory(E)},"./src/streaming/StreamProcessor.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/Constants.js"),a=r("./src/dash/constants/DashConstants.js"),i=r("./src/streaming/constants/MetricsConstants.js"),s=r("./src/streaming/models/FragmentModel.js"),o=r("./src/streaming/controllers/BufferController.js"),u=r("./src/streaming/text/NotFragmentedTextBufferController.js"),l=r("./src/streaming/controllers/ScheduleController.js"),c=r("./src/dash/controllers/RepresentationController.js"),f=r("./src/core/FactoryMaker.js"),d=r("./src/streaming/utils/SupervisorTools.js"),h=r("./src/core/EventBus.js"),g=r("./src/core/events/Events.js"),p=r("./src/dash/DashHandler.js"),m=r("./src/core/errors/Errors.js"),y=r("./src/streaming/vo/DashJSError.js"),E=r("./src/core/Debug.js"),_=r("./src/streaming/utils/RequestModifier.js"),v=r("./src/streaming/utils/URLUtils.js"),T=r("./src/streaming/utils/BoxParser.js"),S=r("./src/streaming/vo/metrics/PlayList.js"),b=r("./src/dash/controllers/SegmentsController.js"),A=r("./src/streaming/vo/metrics/HTTPRequest.js");function R(e){e=e||{};var t,r,f,R,I,C,w,N,D,M,O,P,L,F=this.context,j=Object(h.default)(F).getInstance(),x=e.streamInfo,k=e.type,B=e.errHandler,U=e.mimeType,G=e.timelineConverter,H=e.adapter,q=e.manifestModel,Y=e.mediaPlayerModel,K=e.fragmentModel,V=e.abrController,W=e.playbackController,z=e.mediaController,X=e.textController,Q=e.dashMetrics,J=e.settings,$=e.boxParser,Z=e.segmentBlacklistController;function ee(){return x.id}function te(){return k}function re(){return H.getIsTextTrack(N.getData())}function ne(){I=[],R=null,L=0,D=!1,M=!1}function ae(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e.sender)if(W.getIsManifestUpdateInProgress())se();else if((!re()||X.isTextEnabled())&&C&&e.representationId&&!C.appendInitSegmentFromCache(e.representationId)){var r=N.getCurrentRepresentation();if(0===r.range)return void ie();var n=O?O.getInitRequest(R,r):null;n?K.executeRequest(n):t&&(w.setInitSegmentRequired(!0),se())}}function ie(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(W.getIsManifestUpdateInProgress()||C.getIsPruningInProgress())se();else{var a=function(){var e,t=ve();if(isNaN(L)||te()===n.default.TEXT&&!X.isTextEnabled())return null;var r=D;if(O){var a=N&&t?N.getRepresentationForQuality(t.quality):null;e=r?O.getSegmentRequestForTime(R,a,L):O.getNextSegmentRequest(R,a)}return e}();a?(D=!1,function(e){isNaN(e.startTime+e.duration)||(L=e.startTime+e.duration),e.delayLoadingTime=(new Date).getTime()+w.getTimeToLoadDelay(),w.setTimeToLoadDelay(0),function(e){var t=e.url;return e.range&&(t=t.concat("_",e.range)),Z.contains(t)}(e)?(r.warn("Fragment request url ".concat(e.url," for stream id ").concat(x.id," and media type ").concat(k," is on the ignore list and will be skipped")),se()):(r.debug("Next fragment request url for stream id ".concat(x.id," and media type ").concat(k," is ").concat(e.url)),K.executeRequest(e))}(a)):function(e){var t=N.getCurrentRepresentation();if(J.get().streaming.gaps.enableSeekFix&&!f&&D&&W.isSeeking()){var n=O.getValidSeekTimeCloseToTargetTime(L,R,t,J.get().streaming.gaps.threshold);if(!isNaN(n))return void W.seek(n,!1,!1)}if(O.isLastSegmentRequested(t,L)){var a=O.getCurrentIndex();return r.debug("Segment requesting for stream ".concat(x.id," has finished")),j.trigger(g.default.STREAM_REQUESTING_COMPLETED,{segmentIndex:a},{streamId:x.id,mediaType:k}),C.segmentRequestingCompleted(a),void w.clearScheduleTimer()}e&&se()}(t)}}function se(){w.startScheduleTimer(J.get().streaming.lowLatencyEnabled?J.get().streaming.scheduling.lowLatencyTimeout:J.get().streaming.scheduling.defaultTimeout)}function oe(e){e.error||(w.setCurrentRepresentation(H.convertRepresentationToRepresentationInfo(e.currentRepresentation)),C.getIsBufferingCompleted()||C.updateBufferTimestampOffset(e.currentRepresentation))}function ue(e){Q.addBufferState(k,e.state,w.getBufferTarget()),e.state!==i.default.BUFFER_EMPTY||W.isSeeking()||(r.info("Buffer is empty! Stalling!"),Q.pushPlayListTraceMetrics(new Date,S.PlayListTrace.REBUFFERING_REASON))}function le(e){K.syncExecutedRequestsWithBufferedRange(C.getBuffer().getAllBufferRanges(),x.duration),e.quotaExceeded&&e.from>W.getTime()&&Ie(e.from),e.hasEnoughSpaceToAppend&&e.quotaExceeded&&w.startScheduleTimer()}function ce(e){if(e&&e.lastRequestAppended&&e.lastRequestAppended.url){var t=e.lastRequestAppended.url;e.lastRequestAppended.range&&(t=t.concat("_",e.lastRequestAppended.range)),r.warn("Blacklisting segment with url ".concat(t)),Z.add(t)}}function fe(){Ae(),M=!1}function de(e){r.info("onFragmentLoadingAbandoned request: "+e.request.url+" has been aborted"),W.isSeeking()||w.getSwitchStrack()||M||(r.info("onFragmentLoadingAbandoned request: "+e.request.url+" has to be downloaded again, origin is not seeking process or switch track call"),e.request&&e.request.isInitializationRequest()?w.setInitSegmentRequired(!0):Ie(e.request.startTime+e.request.duration/2),w.startScheduleTimer(0))}function he(e){r.info("OnFragmentLoadingCompleted for stream id "+x.id+" and media type "+k+" - Url:",e.request?e.request.url:"undefined",e.request.range?", Range:"+e.request.range:""),re()&&w.startScheduleTimer(0),e.error&&e.request.serviceLocation&&function(e){r.info("Fragment loading completed with an error"),e&&e.request&&e.request.type&&(e.request.type===A.HTTPRequest.INIT_SEGMENT_TYPE?ae({representationId:e.request.representationId,sender:{}},!1):e.request.type===A.HTTPRequest.MEDIA_SEGMENT_TYPE&&(Ie(e.request.startTime+e.request.duration/2),ie({},!1)))}(e)}function ge(){Ie(W.getTime()),_e().startScheduleTimer()}function pe(e){var t=e.currentTrackInfo;if(t){var r=I.find(function(e){return e.index===t.index&&e.lang===t.lang});r&&Ee(r).then(function(){C.setIsBufferingCompleted(!1),Ie(W.getTime()),w.setInitSegmentRequired(!0),w.startScheduleTimer()})}}function me(e){Ie(e.quotaExceededTime),w.clearScheduleTimer()}function ye(){return C?C.getBuffer():null}function Ee(e){e===R||e&&R&&e.type!==R.type||(R=e);var t=H.getRealAdaptation(x,R),r=H.getVoRepresentations(R);if(N){var a,i=N.getData(),s=V.getMaxAllowedIndexFor(k,x.id),o=V.getMinAllowedIndexFor(k,x.id),u=null;return null!==i&&i.id===t.id||k===n.default.TEXT?a=V.getQualityFor(k,x.id):(u=V.getThroughputHistory().getAverageThroughput(k,f)||V.getInitialBitrateFor(k,x.id),a=V.getQualityForBitrate(R,u,x.id)),void 0!==o&&a<o&&(a=o),a>s&&(a=s),N.updateData(t,r,k,R.isFragmented,a)}return Promise.resolve()}function _e(){return w}function ve(e){var t;return void 0!==e?(Object(d.checkInteger)(e),t=N?N.getRepresentationForQuality(e):null):t=N?N.getCurrentRepresentation():null,H.convertRepresentationToRepresentationInfo(t)}function Te(){return!!C&&C.getIsBufferingCompleted()}function Se(e){var t=e.chunk,r=t.bytes,n=t.quality,a=ve(n),i=N&&a?N.getRepresentationForQuality(a.quality):null;if(a&&i){var o=H.getEventsFor(a.mediaInfo),u=H.getEventsFor(a,i);if(o&&o.length>0||u&&u.length>0){var l=function(e,t,r,n){try{for(var a={},i=[],s=r.concat(n),o=0,u=s.length;o<u;o++)a[s[o].schemeIdUri+"/"+s[o].value]=s[o];var l=Object(T.default)(F).getInstance().parse(e),c=l.getBoxes("emsg");if(!c||0===c.length)return i;for(var f=l.getBox("sidx"),d=!f||isNaN(f.earliest_presentation_time)||isNaN(f.timescale)?t&&!isNaN(t.mediaStartTime)?t.mediaStartTime:0:f.earliest_presentation_time/f.timescale,h=Math.max(d,0),g=N.getCurrentRepresentation(),p=0,m=c.length;p<m;p++){var y=H.getEvent(c[p],a,h,g);y&&i.push(y)}return i}catch(e){return[]}}(r,K.getRequests({state:s.default.FRAGMENT_MODEL_EXECUTED,quality:n,index:t.index})[0],o,u);j.trigger(g.default.INBAND_EVENTS,{events:l},{streamId:x.id})}}}function be(){var e=W.getTime();J.get().streaming.buffer.flushBufferAtTrackSwitch&&W.seek(e+.001,!1,!0),Ie(e),C.setSeekTarget(e),w.startScheduleTimer()}function Ae(){var e=W.getTime();Ie(C.getContinuousBufferTimeForTargetTime(e)),w.startScheduleTimer()}function Re(e){e&&!isNaN(e.time)&&(Ie(e.time),C.setSeekTarget(e.time))}function Ie(e){L=e,D=!0}return t={initialize:function(r,i,s){P=Object(b.default)(F).create({events:g.default,eventBus:j,streamInfo:x,timelineConverter:G,dashConstants:a.default,segmentBaseController:e.segmentBaseController,type:k}),O=Object(p.default)(F).create({streamInfo:x,type:k,timelineConverter:G,dashMetrics:Q,mediaPlayerModel:Y,baseURLController:e.baseURLController,errHandler:B,segmentsController:P,settings:J,boxParser:$,events:g.default,eventBus:j,errors:m.default,debug:Object(E.default)(F).getInstance(),requestModifier:Object(_.default)(F).getInstance(),dashConstants:a.default,constants:n.default,urlUtils:Object(v.default)(F).getInstance()}),f=x.manifestInfo.isDynamic,O.initialize(f),V.registerStreamType(k,t),N=Object(c.default)(F).create({streamInfo:x,type:k,abrController:V,dashMetrics:Q,playbackController:W,timelineConverter:G,dashConstants:a.default,events:g.default,eventBus:j,errors:m.default,isDynamic:f,segmentsController:P}),C=function(e,t){return e?e!==n.default.TEXT||t?Object(o.default)(F).create({streamInfo:x,type:e,mediaPlayerModel:Y,manifestModel:q,fragmentModel:K,errHandler:B,mediaController:z,representationController:N,adapter:H,textController:X,abrController:V,playbackController:W,settings:J}):Object(u.default)(F).create({streamInfo:x,type:e,mimeType:U,fragmentModel:K,textController:X,errHandler:B,settings:J}):(B.error(new y.default(m.default.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,m.default.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+"not properly defined")),null)}(k,s),C&&C.initialize(r),(w=Object(l.default)(F).create({streamInfo:x,type:k,mimeType:U,adapter:H,dashMetrics:Q,mediaPlayerModel:Y,fragmentModel:K,abrController:V,playbackController:W,textController:X,mediaController:z,bufferController:C,settings:J})).initialize(i),L=0,D=!1},getStreamId:ee,getType:te,isUpdating:function(){return!!N&&N.isUpdating()},getBufferController:function(){return C},getFragmentModel:function(){return K},getScheduleController:_e,getRepresentationController:function(){return N},getRepresentationInfo:ve,getBufferLevel:function(){return C?C.getBufferLevel():0},isBufferingCompleted:Te,createBufferSinks:function(e){var t=ye();return t?Promise.resolve(t):C?C.createBufferSink(R,e):Promise.resolve(null)},updateStreamInfo:function(e){return x=e,Te()?Promise.resolve():C.updateAppendWindow()},getStreamInfo:function(){return x},selectMediaInfo:Ee,clearMediaInfoArray:function(){I=[]},addMediaInfo:function(e){-1===I.indexOf(e)&&I.push(e)},prepareTrackSwitch:function(){return new Promise(function(e){r.debug("Preparing track switch for type ".concat(k));var t=k===n.default.TEXT||J.get().streaming.trackSwitchMode[k]===n.default.TRACK_SWITCH_MODE_ALWAYS_REPLACE&&W.getTimeToStreamEnd(x)>J.get().streaming.buffer.stallThreshold;if(C.getIsBufferingCompleted()&&!t)return C.prepareForNonReplacementTrackSwitch(R.codec).then(function(){j.trigger(g.default.BUFFERING_COMPLETED,{},{streamId:x.id,mediaType:k})}).catch(function(){j.trigger(g.default.BUFFERING_COMPLETED,{},{streamId:x.id,mediaType:k})}),void e();w.clearScheduleTimer(),w.setSwitchTrack(!0),t?(j.trigger(g.default.BUFFER_REPLACEMENT_STARTED,{mediaType:k,streamId:x.id},{mediaType:k,streamId:x.id}),K.abortRequests(),C.prepareForReplacementTrackSwitch(R.codec).then(function(){var e=ve();return C.updateBufferTimestampOffset(e)}).then(function(){be(),e()}).catch(function(){be(),e()})):C.prepareForNonReplacementTrackSwitch(R.codec).then(function(){Ae(),e()}).catch(function(){Ae(),e()})})},prepareQualityChange:function(e){r.debug("Preparing quality switch for type ".concat(k));var t=e.newQuality;M=!0,w.clearScheduleTimer();var n=ve(t);w.setCurrentRepresentation(n),N.prepareQualityChange(t),K.abortRequests(),C.updateBufferTimestampOffset(n).then(function(){e.reason&&e.reason.forceReplace?(j.trigger(g.default.BUFFER_REPLACEMENT_STARTED,{mediaType:k,streamId:x.id},{mediaType:k,streamId:x.id}),C.prepareForReplacementQualitySwitch().then(function(){be(),M=!1}).catch(function(){be(),M=!1})):J.get().streaming.buffer.fastSwitchEnabled?function(e){var t=W.getTime(),r=K.getRequests({state:s.default.FRAGMENT_MODEL_EXECUTED,time:t+1.5,threshold:0})[0];if(r&&!re()){var n=C.getBufferLevel(),a=V.getAbandonmentStateFor(x.id,k);r.quality<e.quality&&n>=1.5&&a!==i.default.ABANDON_LOAD?(Ie(t+1.5),w.setCheckPlaybackQuality(!1),w.startScheduleTimer()):fe()}else w.startScheduleTimer();M=!1}(n):fe(),Q.pushPlayListTraceMetrics(new Date,S.PlayListTrace.REPRESENTATION_SWITCH_STOP_REASON),Q.createPlaylistTraceMetrics(n.id,1e3*W.getTime(),W.getPlaybackRate())})},getMediaInfo:function(){return R},getMediaSource:function(){return C.getMediaSource()},setMediaSource:function(e){C.setMediaSource(e)},getBuffer:ye,setExplicitBufferingTime:Ie,finalisePlayList:function(e,t){Q.pushPlayListTraceMetrics(e,t)},probeNextRequest:function(){var e=ve(),t=N&&e?N.getRepresentationForQuality(e.quality):null;return O.getNextSegmentRequestIdempotent(R,t)},prepareInnerPeriodPlaybackSeeking:function(e){return new Promise(function(t){w.clearScheduleTimer(),K.abortRequests(),C.prepareForPlaybackSeek().then(function(){var t=C.getAllRangesWithSafetyFactor(e.seekTime);return C.clearBuffers(t)}).then(function(){var r=C.getContinuousBufferTimeForTargetTime(e.seekTime);if(!isNaN(x.duration)&&isFinite(x.duration)&&r>=x.start+x.duration)C.setIsBufferingCompleted(!0),t();else{Ie(r),C.setSeekTarget(r);var n=[];n.push(C.updateAppendWindow());var a=ve();n.push(C.updateBufferTimestampOffset(a)),Promise.all(n).then(function(){w.setInitSegmentRequired(!0),w.setCheckPlaybackQuality(!1),w.startScheduleTimer(),t()})}}).catch(function(e){r.error(e)})})},prepareOuterPeriodPlaybackSeeking:function(){return new Promise(function(e,t){try{w.clearScheduleTimer(),K.abortRequests(),C.prepareForPlaybackSeek().then(function(){return C.pruneAllSafely()}).then(function(){e()})}catch(e){t(e)}})},reset:function(e,r){O&&O.reset(),C&&(C.reset(e,r),C=null),w&&(w.reset(),w=null),N&&(N.reset(),N=null),P&&(P=null),V&&V.unRegisterStreamType(ee(),k),j.off(g.default.DATA_UPDATE_COMPLETED,oe,t),j.off(g.default.INIT_FRAGMENT_NEEDED,ae,t),j.off(g.default.MEDIA_FRAGMENT_NEEDED,ie,t),j.off(g.default.MEDIA_FRAGMENT_LOADED,Se,t),j.off(g.default.BUFFER_LEVEL_STATE_CHANGED,ue,t),j.off(g.default.BUFFER_CLEARED,le,t),j.off(g.default.SEEK_TARGET,Re,t),j.off(g.default.FRAGMENT_LOADING_ABANDONED,de,t),j.off(g.default.FRAGMENT_LOADING_COMPLETED,he,t),j.off(g.default.SET_FRAGMENTED_TEXT_AFTER_DISABLED,ge,t),j.off(g.default.SET_NON_FRAGMENTED_TEXT,pe,t),j.off(g.default.QUOTA_EXCEEDED,me,t),j.off(g.default.SOURCE_BUFFER_ERROR,ce,t),ne(),k=null,x=null}},r=Object(E.default)(F).getInstance().getLogger(t),ne(),j.on(g.default.DATA_UPDATE_COMPLETED,oe,t,{priority:h.default.EVENT_PRIORITY_HIGH}),j.on(g.default.INIT_FRAGMENT_NEEDED,ae,t),j.on(g.default.MEDIA_FRAGMENT_NEEDED,ie,t),j.on(g.default.MEDIA_FRAGMENT_LOADED,Se,t),j.on(g.default.BUFFER_LEVEL_STATE_CHANGED,ue,t),j.on(g.default.BUFFER_CLEARED,le,t),j.on(g.default.SEEK_TARGET,Re,t),j.on(g.default.FRAGMENT_LOADING_ABANDONED,de,t),j.on(g.default.FRAGMENT_LOADING_COMPLETED,he,t),j.on(g.default.QUOTA_EXCEEDED,me,t),j.on(g.default.SET_FRAGMENTED_TEXT_AFTER_DISABLED,ge,t),j.on(g.default.SET_NON_FRAGMENTED_TEXT,pe,t),j.on(g.default.SOURCE_BUFFER_ERROR,ce,t),t}R.__dashjs_factory_name="StreamProcessor",t.default=f.default.getClassFactory(R)},"./src/streaming/XlinkLoader.js":function(e,t,r){r.r(t);var n=r("./src/streaming/vo/DashJSError.js"),a=r("./src/streaming/net/URLLoader.js"),i=r("./src/streaming/vo/metrics/HTTPRequest.js"),s=r("./src/streaming/vo/TextRequest.js"),o=r("./src/core/EventBus.js"),u=r("./src/core/events/Events.js"),l=r("./src/core/FactoryMaker.js"),c=r("./src/core/errors/Errors.js");function f(e){e=e||{};var t=this.context,r=Object(o.default)(t).getInstance(),l=Object(a.default)(t).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,errors:c.default});return{load:function(e,t,a){var o=function(i,s){t.resolved=!0,t.resolvedContent=i||null,r.trigger(u.default.XLINK_ELEMENT_LOADED,{element:t,resolveObject:a,error:i||s?null:new n.default(c.default.XLINK_LOADER_LOADING_FAILURE_ERROR_CODE,c.default.XLINK_LOADER_LOADING_FAILURE_ERROR_MESSAGE+e)})};if("urn:mpeg:dash:resolve-to-zero:2013"===e)o(null,!0);else{var f=new s.default(e,i.HTTPRequest.XLINK_EXPANSION_TYPE);l.load({request:f,success:function(e){o(e)},error:function(){o(null)}})}},reset:function(){l&&(l.abort(),l=null)}}}f.__dashjs_factory_name="XlinkLoader",t.default=l.default.getClassFactory(f)},"./src/streaming/constants/ConformanceViolationConstants.js":function(e,t,r){r.r(t),t.default={LEVELS:{SUGGESTION:"Suggestion",WARNING:"Warning",ERROR:"Error"},EVENTS:{NO_UTC_TIMING_ELEMENT:{key:"NO_UTC_TIMING_ELEMENT",message:"No UTCTiming element is present in the manifest. You may experience playback failures. For a detailed validation use https://conformance.dashif.org/"},NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE:{key:"NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE",message:'SMPTE 2052-1:2013 defines the attribute name as "imageType" and does not define "imagetype"'},INVALID_DVR_WINDOW:{key:"INVALID_DVR_WINDOW",message:"No valid segment found when applying a specification compliant DVR window calculation. Using SegmentTimeline entries as a fallback."}}}},"./src/streaming/constants/Constants.js":function(e,t,r){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}r.r(t);var a=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}var t,r;return t=e,(r=[{key:"init",value:function(){this.STREAM="stream",this.VIDEO="video",this.AUDIO="audio",this.TEXT="text",this.MUXED="muxed",this.IMAGE="image",this.STPP="stpp",this.TTML="ttml",this.VTT="vtt",this.WVTT="wvtt",this.ABR_STRATEGY_DYNAMIC="abrDynamic",this.ABR_STRATEGY_BOLA="abrBola",this.ABR_STRATEGY_L2A="abrL2A",this.ABR_STRATEGY_LoLP="abrLoLP",this.ABR_STRATEGY_THROUGHPUT="abrThroughput",this.ABR_FETCH_THROUGHPUT_CALCULATION_DOWNLOADED_DATA="abrFetchThroughputCalculationDownloadedData",this.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING="abrFetchThroughputCalculationMoofParsing",this.ABR_FETCH_THROUGHPUT_CALCULATION_AAST="abrFetchThroughputCalculationAAST",this.LIVE_CATCHUP_MODE_DEFAULT="liveCatchupModeDefault",this.LIVE_CATCHUP_MODE_LOLP="liveCatchupModeLoLP",this.MOVING_AVERAGE_SLIDING_WINDOW="slidingWindow",this.MOVING_AVERAGE_EWMA="ewma",this.BAD_ARGUMENT_ERROR="Invalid Arguments",this.MISSING_CONFIG_ERROR="Missing config parameter(s)",this.TRACK_SWITCH_MODE_ALWAYS_REPLACE="alwaysReplace",this.TRACK_SWITCH_MODE_NEVER_REPLACE="neverReplace",this.TRACK_SELECTION_MODE_FIRST_TRACK="firstTrack",this.TRACK_SELECTION_MODE_HIGHEST_BITRATE="highestBitrate",this.TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY="highestEfficiency",this.TRACK_SELECTION_MODE_WIDEST_RANGE="widestRange",this.TRACK_SELECTION_MODE_HIGHEST_SELECTION_PRIORITY="highestSelectionPriority",this.CMCD_MODE_QUERY="query",this.CMCD_MODE_HEADER="header",this.LOCATION="Location",this.INITIALIZE="initialize",this.TEXT_SHOWING="showing",this.TEXT_HIDDEN="hidden",this.CC1="CC1",this.CC3="CC3",this.UTF8="utf-8",this.SCHEME_ID_URI="schemeIdUri",this.START_TIME="starttime",this.SERVICE_DESCRIPTION_LL_SCHEME="urn:dvb:dash:lowlatency:scope:2019",this.SUPPLEMENTAL_PROPERTY_LL_SCHEME="urn:dvb:dash:lowlatency:critical:2019",this.XML="XML",this.ARRAY_BUFFER="ArrayBuffer",this.DVB_REPORTING_URL="dvb:reportingUrl",this.DVB_PROBABILITY="dvb:probability",this.VIDEO_ELEMENT_READY_STATES={HAVE_NOTHING:0,HAVE_METADATA:1,HAVE_CURRENT_DATA:2,HAVE_FUTURE_DATA:3,HAVE_ENOUGH_DATA:4}}}])&&n(t.prototype,r),e}());t.default=a},"./src/streaming/constants/MetricsConstants.js":function(e,t,r){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}r.r(t);var a=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}var t,r;return t=e,(r=[{key:"init",value:function(){this.TCP_CONNECTION="TcpList",this.HTTP_REQUEST="HttpList",this.TRACK_SWITCH="RepSwitchList",this.BUFFER_LEVEL="BufferLevel",this.BUFFER_LOADED="bufferLoaded",this.ABANDON_LOAD="abandonload",this.ALLOW_LOAD="allowload",this.BUFFER_EMPTY="bufferStalled",this.BUFFER_STATE="BufferState",this.DVR_INFO="DVRInfo",this.DROPPED_FRAMES="DroppedFrames",this.SCHEDULING_INFO="SchedulingInfo",this.REQUESTS_QUEUE="RequestsQueue",this.MANIFEST_UPDATE="ManifestUpdate",this.MANIFEST_UPDATE_STREAM_INFO="ManifestUpdatePeriodInfo",this.MANIFEST_UPDATE_TRACK_INFO="ManifestUpdateRepresentationInfo",this.PLAY_LIST="PlayList",this.DVB_ERRORS="DVBErrors"}}])&&n(t.prototype,r),e}());t.default=a},"./src/streaming/constants/ProtectionConstants.js":function(e,t,r){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}r.r(t);var a=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}var t,r;return t=e,(r=[{key:"init",value:function(){this.CLEARKEY_KEYSTEM_STRING="org.w3.clearkey",this.WIDEVINE_KEYSTEM_STRING="com.widevine.alpha",this.PLAYREADY_KEYSTEM_STRING="com.microsoft.playready",this.INITIALIZATION_DATA_TYPE_CENC="cenc",this.INITIALIZATION_DATA_TYPE_KEYIDS="keyids",this.INITIALIZATION_DATA_TYPE_WEBM="webm"}}])&&n(t.prototype,r),e}());t.default=a},"./src/streaming/controllers/AbrController.js":function(e,t,r){r.r(t);var n=r("./src/streaming/rules/abr/ABRRulesCollection.js"),a=r("./src/streaming/constants/Constants.js"),i=r("./src/streaming/constants/MetricsConstants.js"),s=r("./src/streaming/vo/BitrateInfo.js"),o=r("./src/streaming/models/FragmentModel.js"),u=r("./src/core/EventBus.js"),l=r("./src/core/events/Events.js"),c=r("./src/core/FactoryMaker.js"),f=r("./src/streaming/rules/RulesContext.js"),d=r("./src/streaming/rules/SwitchRequest.js"),h=r("./src/streaming/rules/SwitchRequestHistory.js"),g=r("./src/streaming/rules/DroppedFramesHistory.js"),p=r("./src/streaming/rules/ThroughputHistory.js"),m=r("./src/core/Debug.js"),y=r("./src/streaming/vo/metrics/HTTPRequest.js"),E=r("./src/streaming/utils/SupervisorTools.js"),_=r("./src/streaming/MediaPlayerEvents.js");function v(){var e,t,r,c,v,T,S,b,A,R,I,C,w,N,D,M,O,P,L,F,j,x,k,B,U,G=this.context,H=Object(m.default)(G).getInstance(),q=Object(u.default)(G).getInstance();function Y(){v={},T={},b={},S={},P={},j={},x={},k={},void 0===R&&(R=!1),L&&L.reset(),O=void 0,L=void 0,F=void 0,clearTimeout(A),A=null}function K(t){var n=t.request.mediaType,a=t.streamId;if(n&&a&&S[a]&&U.get().streaming.abr.autoSwitchBitrate[n]){var s=S[a][n];if(s){var u=Object(f.default)(G).create({abrController:e,streamProcessor:s,currentRequest:t.request,useBufferOccupancyABR:j[n],useL2AABR:x[n],useLoLPABR:k[n],videoModel:N}),l=r.shouldAbandonFragment(u,a);if(l.quality>d.default.NO_CHANGE){var h=s.getFragmentModel();h.getRequests({state:o.default.FRAGMENT_MODEL_LOADING,index:t.request.index})[0]&&(h.abortRequests(),b[a][n].state=i.default.ABANDON_LOAD,P[a][n].reset(),P[a][n].push({oldValue:Q(n,a),newValue:l.quality,confidence:1,reason:l.reason}),J(n,c.getActiveStreamInfo(),l.quality,l.reason),clearTimeout(A),A=setTimeout(function(){b[a][n].state=i.default.ALLOW_LOAD,A=null},U.get().streaming.abandonLoadTimeout))}}}}function V(e){e.mediaType===a.default.VIDEO&&(void 0!==O&&L.push(e.streamId,O,N.getPlaybackQuality()),O=e.newQuality)}function W(e){var r,n;e.metric!==i.default.HTTP_REQUEST||!e.value||e.value.type!==y.HTTPRequest.MEDIA_SEGMENT_TYPE||e.mediaType!==a.default.AUDIO&&e.mediaType!==a.default.VIDEO||F.push(e.mediaType,e.value,U.get().streaming.abr.useDeadTimeLatency),e.metric!==i.default.BUFFER_LEVEL||e.mediaType!==a.default.AUDIO&&e.mediaType!==a.default.VIDEO||(r=e.mediaType,n=.001*e.value.level,U.get().streaming.abr.ABRStrategy===a.default.ABR_STRATEGY_DYNAMIC&&function(e,r){var n=D.getStableBufferTime(),a=n,i=.5*n,s=j[e],o=r>(s?i:a);j[e]=o,o!==s&&(o?t.info("["+e+"] switching from throughput to buffer occupancy ABR rule (buffer: "+r.toFixed(3)+")."):t.info("["+e+"] switching from buffer occupancy to throughput ABR rule (buffer: "+r.toFixed(3)+")."))}(r,n))}function z(e,t){try{var r;return v[t]=v[t]||{},v[t].hasOwnProperty(e)||(v[t][e]=0),r=function(e,t){var r=v[t][e],n=r;if(!S[t]||!S[t][e])return n;var a=X(e,t);void 0!==a&&(n=Math.max(r,a));var i=function(e,t){try{var r=U.get().streaming.abr.maxBitrate[e];return r>-1?Z(S[t][e].getMediaInfo(),r,t):void 0}catch(e){return}}(e,t);return void 0!==i&&(n=Math.min(n,i)),n}(e,t),r=function(e,t,r){var n=v[r][t],a=U.get().streaming.abr.maxRepresentationRatio[t];return isNaN(a)||a>=1||a<0?e:Math.min(e,Math.round(n*a))}(r,e,t),r=function(e,t,r){if(t!==a.default.VIDEO||!U.get().streaming.abr.limitBitrateByPortal||!S[r]||!S[r][t])return e;R||te();var n=S[r][t].getStreamInfo(),i=w.getAdaptationForType(n.index,t,n).Representation,s=e;if(I>0&&C>0){for(;s>0&&i[s]&&I<i[s].width&&I-i[s-1].width<i[s].width-I;)s-=1;for(;s<i.length-1&&i[s].width===i[s+1].width;)s+=1}return s}(r,e,t),r}catch(e){return}}function X(e,t){try{return function(e,t){try{var r=U.get().streaming.abr.minBitrate[e];if(r>-1){var n=S[t][e].getMediaInfo(),a=ee(n),i=Z(n,r,t);return a[i]&&i<a.length-1&&a[i].bitrate<1e3*r&&i++,i}return}catch(e){return}}(e,t)}catch(e){return}}function Q(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;try{return t||(t=c.getActiveStreamInfo().id),e&&S[t]&&S[t][e]&&t?(T[t]=T[t]||{},T[t].hasOwnProperty(e)||(T[t][e]=0),T[t][e]):0}catch(e){return 0}}function J(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(t&&t.id&&e){var a=t.id,i=Q(e,a);Object(E.checkInteger)(r);var s=z(e,a);r!==i&&r>=0&&r<=s&&$(e,i,r,s,n,a)}}function $(e,r,n,a,i,s){if(e&&S[s]&&S[s][e]){var o=S[s][e].getStreamInfo(),u=o&&o.manifestInfo&&o.manifestInfo.isDynamic,c=B.getCurrentBufferLevel(e);t.info("Stream ID: "+s+" ["+e+"] switch from "+r+" to "+n+"/"+a+" (buffer: "+c+") "+(i?JSON.stringify(i):".")),T[s]=T[s]||{},T[s][e]=n;var f=function(e,t,r){if(t&&S&&S[e]&&S[e][t]){var n=ee(S[e][t].getMediaInfo());return n[r]?n[r]:null}return null}(s,e,n);q.trigger(l.default.QUALITY_CHANGE_REQUESTED,{oldQuality:r,newQuality:n,reason:i,streamInfo:o,bitrateInfo:f,maxIdx:a,mediaType:e},{streamId:o.id,mediaType:e});var d=F.getAverageThroughput(e,u);isNaN(d)||M.setSavedBitrateSettings(e,d)}}function Z(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=e&&e.type?S[r][e.type].getRepresentationInfo():null;if(U.get().streaming.abr.useDeadTimeLatency&&n&&a&&a.fragmentDuration){n/=1e3;var i=a.fragmentDuration;if(n>i)return 0;t*=1-n/i}for(var s=ee(e),o=s.length-1;o>=0;o--)if(1e3*t>=s[o].bitrate)return o;return 0}function ee(e){var t=[];if(!e||!e.bitrateList)return t;for(var r,n=e.bitrateList,a=e.type,i=0,o=n.length;i<o;i++)(r=new s.default).mediaType=a,r.qualityIndex=i,r.bitrate=n[i].bandwidth,r.width=n[i].width,r.height=n[i].height,r.scanType=n[i].scanType,t.push(r);return t}function te(){if(N){var e=U.get().streaming.abr.usePixelRatioInLimitBitrateByPortal&&window.hasOwnProperty("devicePixelRatio")?window.devicePixelRatio:1;I=N.getClientWidth()*e,C=N.getClientHeight()*e}}return e={initialize:function(){L=Object(g.default)(G).create(),F=Object(p.default)(G).create({settings:U}),(r=Object(n.default)(G).create({dashMetrics:B,mediaPlayerModel:D,settings:U})).initialize(),q.on(_.default.QUALITY_CHANGE_RENDERED,V,e),q.on(_.default.METRIC_ADDED,W,e),q.on(l.default.LOADING_PROGRESS,K,e)},isPlayingAtTopQuality:function(e){var t=e?e.id:null,r=Q(a.default.AUDIO,t),n=Q(a.default.VIDEO,t);return r===z(a.default.AUDIO,t)&&n===z(a.default.VIDEO,t)},updateTopQualityIndex:function(e){var t=e.type,r=e.streamInfo.id,n=e.representationCount-1;return v[r]=v[r]||{},v[r][t]=n,n},clearDataForStream:function(e){L&&L.clearForStream(e),S[e]&&delete S[e],P[e]&&delete P[e],b[e]&&delete b[e]},getThroughputHistory:function(){return F},getBitrateList:ee,getQualityForBitrate:Z,getTopBitrateInfoFor:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t||(t=c.getActiveStreamInfo().id),e&&S&&S[t]&&S[t][e]){var r=z(e,t),n=ee(S[t][e].getMediaInfo());return n[r]?n[r]:null}return null},getMinAllowedIndexFor:X,getMaxAllowedIndexFor:z,getInitialBitrateFor:function(e,t){if(function(){if(!M||!M.hasOwnProperty("getSavedBitrateSettings"))throw new Error(a.default.MISSING_CONFIG_ERROR)}(),e===a.default.TEXT)return NaN;var r=M.getSavedBitrateSettings(e),n=U.get().streaming.abr.initialBitrate[e],i=U.get().streaming.abr.initialRepresentationRatio[e];if(-1===n)if(i>-1){var s=S[t][e].getStreamInfo(),o=w.getAdaptationForType(s.index,e,s).Representation;n=Array.isArray(o)?o[Math.max(Math.round(o.length*i)-1,0)].bandwidth/1e3:0}else n=isNaN(r)?e===a.default.VIDEO?1e3:100:r;return n},getQualityFor:Q,getAbandonmentStateFor:function(e,t){return b[e]&&b[e][t]?b[e][t].state:null},setPlaybackQuality:J,checkPlaybackQuality:function(t,n){try{if(!(t&&S&&S[n]&&S[n][t]))return!1;if(L){var a=N.getPlaybackQuality();a&&L.push(n,O,a)}if(!U.get().streaming.abr.autoSwitchBitrate[t])return!1;var s=Q(t,n),o=Object(f.default)(G).create({abrController:e,switchHistory:P[n][t],droppedFramesHistory:L,streamProcessor:S[n][t],currentValue:s,useBufferOccupancyABR:j[t],useL2AABR:x[t],useLoLPABR:k[t],videoModel:N}),u=X(t,n),l=z(t,n),c=r.getMaxQuality(o),h=c.quality;return void 0!==u&&(h>d.default.NO_CHANGE?h:s)<u&&(h=u),h>l&&(h=l),P[n][t].push({oldValue:s,newValue:h}),h>d.default.NO_CHANGE&&h!==s&&(b[n][t].state===i.default.ALLOW_LOAD||h>s)&&($(t,s,h,l,c.reason,n),!0)}catch(e){return!1}},setElementSize:te,setWindowResizeEventCalled:function(e){R=e},registerStreamType:function(e,t){var r=t.getStreamInfo().id;S[r]||(S[r]={}),P[r]||(P[r]={}),b[r]||(b[r]={}),P[r][e]=Object(h.default)(G).create(),S[r][e]=t,b[r][e]={},b[r][e].state=i.default.ALLOW_LOAD,function(e){var t=U.get().streaming.abr.ABRStrategy;t===a.default.ABR_STRATEGY_L2A?(j[e]=!1,k[e]=!1,x[e]=!0):t===a.default.ABR_STRATEGY_LoLP?(j[e]=!1,k[e]=!0,x[e]=!1):t===a.default.ABR_STRATEGY_BOLA?(j[e]=!0,k[e]=!1,x[e]=!1):t===a.default.ABR_STRATEGY_THROUGHPUT?(j[e]=!1,k[e]=!1,x[e]=!1):t===a.default.ABR_STRATEGY_DYNAMIC&&(j[e]=!(!j||!j[e])&&j[e],k[e]=!1,x[e]=!1)}(e),e===a.default.VIDEO&&te()},unRegisterStreamType:function(e,t){try{S[e]&&S[e][t]&&delete S[e][t],P[e]&&P[e][t]&&delete P[e][t],b[e]&&b[e][t]&&delete b[e][t]}catch(e){}},setConfig:function(e){e&&(e.streamController&&(c=e.streamController),e.domStorage&&(M=e.domStorage),e.mediaPlayerModel&&(D=e.mediaPlayerModel),e.dashMetrics&&(B=e.dashMetrics),e.adapter&&(w=e.adapter),e.videoModel&&(N=e.videoModel),e.settings&&(U=e.settings))},reset:function(){Y(),q.off(l.default.LOADING_PROGRESS,K,e),q.off(_.default.QUALITY_CHANGE_RENDERED,V,e),q.off(_.default.METRIC_ADDED,W,e),r&&r.reset()}},t=H.getLogger(e),Y(),e}v.__dashjs_factory_name="AbrController";var T=c.default.getSingletonFactory(v);T.QUALITY_DEFAULT=0,c.default.updateSingletonFactory(v.__dashjs_factory_name,T),t.default=T},"./src/streaming/controllers/BaseURLController.js":function(e,t,r){r.r(t);var n=r("./src/streaming/models/BaseURLTreeModel.js"),a=r("./src/streaming/utils/BaseURLSelector.js"),i=r("./src/streaming/utils/URLUtils.js"),s=r("./src/dash/vo/BaseURL.js"),o=r("./src/core/FactoryMaker.js"),u=r("./src/core/EventBus.js"),l=r("./src/core/events/Events.js");function c(){var e,t,r,o,c=this.context,f=Object(u.default)(c).getInstance(),d=Object(i.default)(c).getInstance();return e={reset:function(){r.reset(),o.reset()},initialize:function(e){var n;r.setConfig({adapter:t}),n=e,r.update(n),o.chooseSelector(t.getIsDVB(n))},resolve:function(e){var t=r.getForPath(e).reduce(function(e,t){var r=o.select(t);return r?(d.isRelative(r.url)?e.url=d.resolve(r.url,e.url):(e.url=r.url,e.serviceLocation=r.serviceLocation),e.availabilityTimeOffset=r.availabilityTimeOffset,e.availabilityTimeComplete=r.availabilityTimeComplete,e):new s.default},new s.default);if(!d.isRelative(t.url))return t},setConfig:function(e){e.baseURLTreeModel&&(r=e.baseURLTreeModel),e.baseURLSelector&&(o=e.baseURLSelector),e.adapter&&(t=e.adapter)}},r=Object(n.default)(c).create(),o=Object(a.default)(c).create(),f.on(l.default.SERVICE_LOCATION_BLACKLIST_CHANGED,function(e){r.invalidateSelectedIndexes(e.entry)},e),e}c.__dashjs_factory_name="BaseURLController",t.default=o.default.getClassFactory(c)},"./src/streaming/controllers/BlacklistController.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/core/EventBus.js");function i(e){var t;e=e||{};var r=[],n=Object(a.default)(this.context).getInstance(),i=e.updateEventName,s=e.addBlacklistEventName;function o(e){-1===r.indexOf(e)&&(r.push(e),n.trigger(i,{entry:e}))}return t={add:o,contains:function(e){return!!(r.length&&e&&e.length)&&-1!==r.indexOf(e)},reset:function(){r=[]}},s&&n.on(s,function(e){o(e.entry)},t),t}i.__dashjs_factory_name="BlackListController",t.default=n.default.getClassFactory(i)},"./src/streaming/controllers/BufferController.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/Constants.js"),a=r("./src/streaming/constants/MetricsConstants.js"),i=r("./src/streaming/models/FragmentModel.js"),s=r("./src/streaming/SourceBufferSink.js"),o=r("./src/core/EventBus.js"),u=r("./src/core/events/Events.js"),l=r("./src/core/FactoryMaker.js"),c=r("./src/core/Debug.js"),f=r("./src/streaming/utils/InitCache.js"),d=r("./src/streaming/vo/DashJSError.js"),h=r("./src/core/errors/Errors.js"),g=r("./src/streaming/vo/metrics/HTTPRequest.js"),p=r("./src/streaming/MediaPlayerEvents.js"),m=.01,y="BufferController";function E(e){e=e||{};var t,r,l,E,_,v,T,S,b,A,R,I,C,w,N,D,M,O,P=this.context,L=Object(o.default)(P).getInstance(),F=e.errHandler,j=e.fragmentModel,x=e.representationController,k=e.adapter,B=e.textController,U=e.abrController,G=e.playbackController,H=e.streamInfo,q=e.type,Y=e.settings;function K(e){v=e}function V(e){return k.convertRepresentationToRepresentationInfo(x.getRepresentationForQuality(e))}function W(e){Y.get().streaming.cacheInitSegments&&(r.info("Init fragment finished loading saving to",q+"'s init cache"),N.save(e.chunk)),r.debug("Append Init fragment",q," with representationId:",e.chunk.representationId," and quality:",e.chunk.quality,", data size:",e.chunk.bytes.byteLength),X(e.chunk)}function z(e){X(e.chunk,e.request)}function X(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;b.append(e,t).then(function(e){J(e)}).catch(function(e){J(e)}),e.mediaInfo.type===n.default.VIDEO&&_e(u.default.VIDEO_CHUNK_RECEIVED,{chunk:e})}function Q(e){if(e&&e.length>0)for(var t=0,n=e.length;t<n;t++)r.debug("Buffered range: "+e.start(t)+" - "+e.end(t)+", currentTime = ",G.getTime())}function J(e){if(e.error)return 22===e.error.code&&function(){if(w=!0,_=.8*ye(),r.warn("Quota exceeded, Critical Buffer: "+_),_>0){var e=Math.max(.2*_,1),t=_-e,n=Math.min(Y.get().streaming.buffer.bufferTimeAtTopQuality,.9*t),a=Math.min(Y.get().streaming.buffer.bufferTimeAtTopQualityLongForm,.9*t),i={streaming:{buffer:{bufferToKeep:parseFloat(e.toFixed(5)),bufferTimeAtTopQuality:parseFloat(n.toFixed(5)),bufferTimeAtTopQualityLongForm:parseFloat(a.toFixed(5))}}};Y.update(i)}}(),void(22!==e.error.code&&Ee()||(r.warn("Clearing playback buffer to overcome quota exceed situation"),_e(u.default.QUOTA_EXCEEDED,{criticalBufferLevel:_,quotaExceededTime:e.chunk.start}),le(ue())));if(b&&(ae(),w=!1,(R=e.chunk)&&R.endFragment)){R&&!isNaN(R.index)&&(T=Math.max(R.index,T),ie());var t=b.getAllBufferRanges();R.segmentType===g.HTTPRequest.MEDIA_SEGMENT_TYPE&&(Q(t),ee(),function(){if(!isNaN(O))if(q===n.default.AUDIO||q===n.default.VIDEO){var e=G.getTime(),t=ne(O,0);if(e===O&&t)O=NaN;else{var r=x.getCurrentRepresentation().segmentDuration;(t=ne(O,r))&&(Y.get().streaming.buffer.enableSeekDecorrelationFix&&Math.abs(e-O)>r?O<=t.end&&(G.seek(Math.max(O,t.start),!1,!0),O=NaN):e<t.start&&(G.seek(t.start,!1,!0),O=NaN))}}else O=NaN}()),R&&_e(u.default.BYTES_APPENDED_END_FRAGMENT,{quality:R.quality,startTime:R.start,index:R.index,bufferedRanges:t,segmentType:R.segmentType,mediaType:q})}}function $(){return new Promise(function(e,t){var r=Z();if(!r||0===r.length)return ee(),void e();le(r).then(function(){e()}).catch(function(e){t(e)})})}function Z(e){var t=[],r=b.getAllBufferRanges();if(!r||0===r.length)return t;if(!e&&0!==e||isNaN(e))t.push({start:r.start(0),end:r.end(r.length-1)+.5});else{var n=function(e,t){var r=Y.get().streaming.buffer.bufferToKeep,n=t.start(0);if(e-n>r){var a=Math.max(0,e-r),s=j.getRequests({state:i.default.FRAGMENT_MODEL_EXECUTED,time:e,threshold:m})[0];if(s&&(a=Math.min(s.startTime,a)),a>0)return{start:n,end:a}}return null}(e,r),a=function(e,t){var r=t.end(t.length-1)+.5,n=H.manifestInfo.duration>=Y.get().streaming.buffer.longFormContentDurationThreshold?Y.get().streaming.buffer.bufferTimeAtTopQualityLongForm:Y.get().streaming.buffer.bufferTimeAtTopQuality;if(r-e>n){var a=e+n,s=j.getRequests({state:i.default.FRAGMENT_MODEL_EXECUTED,time:e,threshold:m})[0];if(s&&(a=Math.max(s.startTime+s.duration,a)),a<r)return{start:a,end:r}}return null}(e,r);n&&t.push(n),a&&t.push(a)}return t}function ee(){(!M||q===n.default.TEXT&&B.isTextEnabled())&&ae()}function te(){se()}function re(){se(),O=NaN}function ne(e,t){var r,n,a=b.getAllBufferRanges(),i=0,s=0,o=null,u=null,l=0,c=isNaN(t)?.15:t;if(null!=a){for(n=0,r=a.length;n<r;n++)if(i=a.start(n),s=a.end(n),null===o)l=Math.abs(i-e),(e>=i&&e<s||l<=c)&&(o=i,u=s);else{if(!((l=i-u)<=c))break;u=s}if(null!==o)return{start:o,end:u}}return null}function ae(){if(G){var e=Y.get().streaming.gaps.jumpGaps&&!isNaN(Y.get().streaming.gaps.smallGapLimit)?Y.get().streaming.gaps.smallGapLimit:NaN;E=Math.max(function(e,t){var r;return Y.get().streaming.gaps.jumpGaps&&(t=Y.get().streaming.gaps.smallGapLimit),null===(r=ne(e,t))?0:r.end-e}(G.getTime()||0,e),0),_e(u.default.BUFFER_LEVEL_UPDATED,{mediaType:q,bufferLevel:E}),se()}}function ie(){var e=T>=S-1,t=G.getTimeToStreamEnd(H)-E<=0;!e&&!t||l||(me(!0),r.debug("checkIfBufferingCompleted trigger BUFFERING_COMPLETED for stream id ".concat(H.id," and type ").concat(q)))}function se(){q!==n.default.AUDIO&&q!==n.default.VIDEO||((!Y.get().streaming.lowLatencyEnabled&&E<Y.get().streaming.buffer.stallThreshold||0===E)&&!l?oe(a.default.BUFFER_EMPTY):(l||E>=Y.get().streaming.buffer.stallThreshold||Y.get().streaming.lowLatencyEnabled&&E>0)&&oe(a.default.BUFFER_LOADED))}function oe(e){A===e||e===a.default.BUFFER_EMPTY&&0===G.getTime()||q===n.default.TEXT&&!B.isTextEnabled()||(A=e,_e(u.default.BUFFER_LEVEL_STATE_CHANGED,{state:e}),_e(e===a.default.BUFFER_LOADED?u.default.BUFFER_LOADED:u.default.BUFFER_EMPTY),r.debug(e===a.default.BUFFER_LOADED?"Got enough buffer to start":"Waiting for more buffer before starting playback"))}function ue(){var e=[],t=b.getAllBufferRanges();if(!t||0===t.length)return e;var r=G.getTime(),n=Math.max(0,r-Y.get().streaming.buffer.bufferToKeep),a=j.getRequests({state:i.default.FRAGMENT_MODEL_EXECUTED,time:r,threshold:m})[0];if(a)n=Math.min(a.startTime,n);else if(0===r&&G.getIsDynamic())return[];if(t.start(0)<=n){for(var s={start:0,end:n},o=0;o<t.length&&t.end(o)<=n;o++)s.end=t.end(o);s.start<s.end&&e.push(s)}return e}function le(e){return new Promise(function(t,r){if(e&&b&&0!==e.length){var n=[];e.forEach(function(e){n.push(function(e){return new Promise(function(t,r){e.resolve=t,e.reject=r,D.push(e)})}(e))}),C||ce(),Promise.all(n).then(function(){t()}).catch(function(e){r(e)})}else t()})}function ce(){try{if(0===D.length||!b)return r.debug("Nothing to prune, halt pruning"),D=[],void(C=!1);var e=b.getBuffer();if(!e||!e.buffered||0===e.buffered.length)return r.debug("SourceBuffer is empty (or does not exist), halt pruning"),D=[],void(C=!1);var t=D.shift();r.debug("".concat(q,": Removing buffer from: ").concat(t.start," to ").concat(t.end)),C=!0,G.getTime()<t.end&&me(!1),b.remove(t).then(function(e){fe(e)}).catch(function(e){fe(e)})}catch(e){C=!1}}function fe(e){r.debug("onRemoved buffer from:",e.from,"to",e.to),Q(b.getAllBufferRanges()),0===D.length&&(C=!1,ae()),e.unintended&&(r.warn("Detected unintended removal from:",e.from,"to",e.to,"setting streamprocessor time to",e.from),_e(u.default.SEEK_TARGET,{time:e.from})),C?ce():(M?M=!1:ae(),_e(u.default.BUFFER_CLEARED,{from:e.from,to:e.to,unintended:e.unintended,hasEnoughSpaceToAppend:Ee(),quotaExceeded:w}))}function de(e){return new Promise(function(t){e&&void 0!==e.MSETimeOffset&&b&&b.updateTimestampOffset?b.updateTimestampOffset(e.MSETimeOffset).then(function(){t()}).catch(function(){t()}):t()})}function he(){return b&&!l?b.updateAppendWindow(H):Promise.resolve()}function ge(){++I*(Y.get().streaming.wallclockTimeUpdateInterval/1e3)>=Y.get().streaming.buffer.bufferPruningInterval&&(I=0,b&&q!==n.default.TEXT&&(l||le(ue())))}function pe(){se()}function me(e){l!==e&&((l=e)?_e(u.default.BUFFERING_COMPLETED):S=Number.POSITIVE_INFINITY)}function ye(){try{var e,t,r=b.getAllBufferRanges(),n=0;if(!r)return n;for(t=0,e=r.length;t<e;t++)n+=r.end(t)-r.start(t);return n}catch(e){return 0}}function Ee(){var e=ye();return isNaN(e)||e<_}function _e(e,t){var r=t||{};L.trigger(e,r,{streamId:H.id,mediaType:q})}function ve(e,t){_=Number.POSITIVE_INFINITY,A=void 0,S=Number.POSITIVE_INFINITY,T=0,R=null,l=!1,C=!1,w=!1,E=0,I=0,D=[],O=NaN,b&&(e||t?b=null:b.abort().then(function(){b.reset(t),b=null})),M=!1}return t={initialize:function(e){K(e),L.on(u.default.INIT_FRAGMENT_LOADED,W,t),L.on(u.default.MEDIA_FRAGMENT_LOADED,z,t),L.on(u.default.WALLCLOCK_TIME_UPDATED,ge,t),L.on(p.default.PLAYBACK_PLAYING,re,t),L.on(p.default.PLAYBACK_PROGRESS,ee,t),L.on(p.default.PLAYBACK_TIME_UPDATED,ee,t),L.on(p.default.PLAYBACK_RATE_CHANGED,pe,t),L.on(p.default.PLAYBACK_STALLED,te,t)},getStreamId:function(){return H.id},getType:function(){return q},getBufferControllerType:function(){return y},createBufferSink:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return new Promise(function(a,i){if(N&&e&&v){var o=U.getQualityFor(q,H.id);b=Object(s.default)(P).create({mediaSource:v,textController:B,eventBus:L}),function(e,t,r){var a=V(r);return t&&t[q]&&(q===n.default.VIDEO||q===n.default.AUDIO)?b.initializeForStreamSwitch(e,a,t[q]):b.initializeForFirstUse(H,e,a)}(e,t,o).then(function(){return de(V(o))}).then(function(){a(b)}).catch(function(e){r.fatal("Caught error on create SourceBuffer: "+e),F.error(new d.default(h.default.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,h.default.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+q)),i(e)})}else a(null)})},getBuffer:function(){return b},getBufferLevel:function(){return E},getRangeAt:ne,setMediaSource:K,getMediaSource:function(){return v},appendInitSegmentFromCache:function(e){var t=N.extract(H.id,e);return!!t&&(r.info("Append Init fragment",q," with representationId:",t.representationId," and quality:",t.quality,", data size:",t.bytes.byteLength),X(t),!0)},getIsBufferingCompleted:function(){return l},setIsBufferingCompleted:me,getIsPruningInProgress:function(){return C},reset:function(e,t){L.off(u.default.INIT_FRAGMENT_LOADED,W,this),L.off(u.default.MEDIA_FRAGMENT_LOADED,z,this),L.off(u.default.WALLCLOCK_TIME_UPDATED,ge,this),L.off(p.default.PLAYBACK_PLAYING,re,this),L.off(p.default.PLAYBACK_PROGRESS,ee,this),L.off(p.default.PLAYBACK_TIME_UPDATED,ee,this),L.off(p.default.PLAYBACK_RATE_CHANGED,pe,this),L.off(p.default.PLAYBACK_STALLED,te,this),ve(e,t)},prepareForPlaybackSeek:function(){return l&&me(!1),b.abort()},prepareForReplacementTrackSwitch:function(e){return new Promise(function(t,r){b.abort().then(function(){return he()}).then(function(){return b.changeType(e)}).then(function(){return $()}).then(function(){me(!1),t()}).catch(function(e){r(e)})})},prepareForNonReplacementTrackSwitch:function(e){return new Promise(function(t,r){he().then(function(){return b.changeType(e)}).then(function(){t()}).catch(function(e){r(e)})})},prepareForReplacementQualitySwitch:function(){return new Promise(function(e,t){b.abort().then(function(){return he()}).then(function(){return $()}).then(function(){me(!1),e()}).catch(function(e){t(e)})})},updateAppendWindow:he,getAllRangesWithSafetyFactor:Z,getContinuousBufferTimeForTargetTime:function(e){try{var t=e,r=b.getAllBufferRanges();if(!r||0===r.length)return e;for(var n=0;t===e&&n<r.length;){var a=r.start(n),i=r.end(n);t>=a&&t<=i&&(t=i),n+=1}return t}catch(e){}},clearBuffers:le,pruneAllSafely:$,updateBufferTimestampOffset:de,setSeekTarget:function(e){O=e},segmentRequestingCompleted:function(e){isNaN(e)||(S=e,ie())}},r=Object(c.default)(P).getInstance().getLogger(t),N=Object(f.default)(P).getInstance(),ve(),t}E.__dashjs_factory_name=y,t.default=l.default.getClassFactory(E)},"./src/streaming/controllers/EventController.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/core/Debug.js"),i=r("./src/core/EventBus.js"),s=r("./src/streaming/MediaPlayerEvents.js"),o=r("./src/streaming/net/XHRLoader.js");function u(){var e,t,r,n,u,l,c,f,d,h,g,p="urn:mpeg:dash:event:2012",m="updated",y="added",E=this.context,_=Object(i.default)(E).getInstance();function v(){if(!c||!f)throw new Error("setConfig function has to be called previously")}function T(){g=!1,r={},n={},u=null,h=!1,l=Date.now()/1e3}function S(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e.eventStream.schemeIdUri,a=e.eventStream.value,i=e.id,s="discarded";t[n]||(t[n]=[]);var o=t[n].findIndex(function(e){return(!a||e.eventStream.value&&e.eventStream.value===a)&&e.id===i});return-1===o?(t[n].push(e),s=y):r&&(t[n][o]=e,s=m),s}function b(e){try{if(1==e.eventStream.value){var t,r=e.calculatedPresentationTime;t=4294967295==e.calculatedPresentationTime?NaN:e.calculatedPresentationTime+e.duration,_.trigger(s.default.MANIFEST_VALIDITY_CHANGED,{id:e.id,validUntil:r,newDuration:t,newManifestValidAfter:NaN},{mode:s.default.EVENT_MODE_ON_START})}}catch(e){}}function A(){try{if(!h){h=!0;var e=f.getTime(),t=e-l;t=l>0?Math.max(0,t):0,R(n,t,e),R(r,t,e),l=e,h=!1}}catch(e){h=!1}}function R(e,r,n){try{C(e,function(a){if(void 0!==a){var i=isNaN(a.duration)?0:a.duration;a.calculatedPresentationTime<=n&&a.calculatedPresentationTime+r+i>=n?w(a,e,s.default.EVENT_MODE_ON_START):(function(e,t,r){try{return e-t>r}catch(e){return!1}}(n,i+r,a.calculatedPresentationTime)||function(e){try{var t=e.eventStream.period.start+e.eventStream.period.duration;return e.calculatedPresentationTime>t}catch(e){return!1}}(a))&&(t.debug("Deleting event ".concat(a.id," as it is expired or invalid")),N(e,a))}})}catch(e){}}function I(e){try{var t=f.getTime();C(e,function(r){var n=r.eventStream&&r.eventStream.period&&!isNaN(r.eventStream.period.duration)?r.eventStream.period.duration:NaN,a=r.eventStream&&r.eventStream.period&&!isNaN(r.eventStream.period.start)?r.eventStream.period.start:NaN;if(!isNaN(n)&&!isNaN(a)){var i=r.calculatedPresentationTime;Math.abs(i-t)<300&&w(r,e,s.default.EVENT_MODE_ON_START)}})}catch(e){}}function C(e,t){try{if(e)for(var r=Object.keys(e),n=0;n<r.length;n++)e[r[n]].forEach(function(e){void 0!==e&&t(e)})}catch(e){}}function w(e,r,n){try{var a=f.getTime(),i=e.id;if(n===s.default.EVENT_MODE_ON_RECEIVE)return t.debug("Received event ".concat(i)),void _.trigger(e.eventStream.schemeIdUri,{event:e},{mode:n});e.eventStream.schemeIdUri===p&&1==e.eventStream.value?0===e.duration&&0===e.presentationTimeDelta||(t.debug("Starting manifest refresh event ".concat(i," at ").concat(a)),N(r,e),function(){try{v(),c.refreshManifest()}catch(e){}}()):"urn:mpeg:dash:event:callback:2015"===e.eventStream.schemeIdUri&&1==e.eventStream.value?(t.debug("Starting callback event ".concat(i," at ").concat(a)),N(r,e),function(e){try{Object(o.default)(E).create({}).load({method:"get",url:e,request:{responseType:"arraybuffer"}})}catch(e){throw e}}(e.messageData)):(t.debug("Starting event ".concat(i," at ").concat(a)),N(r,e),_.trigger(e.eventStream.schemeIdUri,{event:e},{mode:n}))}catch(e){}}function N(e,t){var r=t.eventStream.schemeIdUri,n=t.eventStream.value,a=t.id;e[r]=e[r].filter(function(e){return n&&e.eventStream.value&&e.eventStream.value!==n||e.id!==a}),0===e[r].length&&delete e[r]}return e={addInlineEvents:function(e){try{if(v(),e)for(var n=0;n<e.length;n++){var a=e[n],i=S(a,r,!0);i===y?(t.debug("Added inline event with id ".concat(a.id)),w(a,e,s.default.EVENT_MODE_ON_RECEIVE)):i===m&&t.debug("Updated inline event with id ".concat(a.id))}}catch(e){throw e}},addInbandEvents:function(e){try{v();for(var r=0;r<e.length;r++){var a=e[r];S(a,n,!1)===y?(a.eventStream.schemeIdUri===p&&void 0===n[a.id]&&b(a),t.debug("Added inband event with id "+a.id),w(a,e,s.default.EVENT_MODE_ON_RECEIVE)):t.debug("Inband event with scheme_id_uri ".concat(a.eventStream.schemeIdUri,", value ").concat(a.eventStream.value," and id ").concat(a.id," was ignored because it has been added before."))}A()}catch(e){throw e}},getInbandEvents:function(){return n},getInlineEvents:function(){return r},start:function(){try{v(),t.debug("Start Event Controller");var e=d.get().streaming.eventControllerRefreshDelay;g||isNaN(e)||(g=!0,u=setInterval(A,e))}catch(e){throw e}},setConfig:function(e){try{if(!e)return;e.manifestUpdater&&(c=e.manifestUpdater),e.playbackController&&(f=e.playbackController),e.settings&&(d=e.settings)}catch(e){throw e}},reset:function(){(function(){try{null!==u&&g&&(clearInterval(u),u=null,g=!1,function(){try{I(n),I(r)}catch(e){}}())}catch(e){throw e}})(),T()}},t=Object(a.default)(E).getInstance().getLogger(e),T(),e}u.__dashjs_factory_name="EventController",t.default=n.default.getSingletonFactory(u)},"./src/streaming/controllers/FragmentController.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/Constants.js"),a=r("./src/streaming/vo/DataChunk.js"),i=r("./src/streaming/models/FragmentModel.js"),s=r("./src/streaming/FragmentLoader.js"),o=r("./src/streaming/utils/RequestModifier.js"),u=r("./src/core/EventBus.js"),l=r("./src/core/events/Events.js"),c=r("./src/streaming/MediaPlayerEvents.js"),f=r("./src/core/errors/Errors.js"),d=r("./src/core/FactoryMaker.js"),h=r("./src/core/Debug.js");function g(e){e=e||{};var t,r,d,g=this.context,p=Object(u.default)(g).getInstance(),m=e.errHandler,y=e.mediaPlayerModel,E=e.dashMetrics,_=Object(h.default)(g).getInstance(),v=e.streamInfo;function T(){return v.id}function S(){for(var e in d)d[e].reset();d={}}function b(e){if(e.sender){var t=e.request,i=e.response,s=t.isInitializationRequest(),o=t.mediaInfo.streamInfo;if(e.error&&(t.mediaType===n.default.AUDIO||t.mediaType===n.default.VIDEO||t.mediaType===n.default.TEXT&&t.mediaInfo.isFragmented)&&p.trigger(l.default.SERVICE_LOCATION_BLACKLIST_ADD,{entry:e.request.serviceLocation}),i&&o){var u=function(e,t,r,n){var i=new a.default;return i.streamId=r,i.mediaInfo=t.mediaInfo,i.segmentType=t.type,i.start=t.startTime,i.duration=t.duration,i.end=i.start+i.duration,i.bytes=e,i.index=t.index,i.quality=t.quality,i.representationId=t.representationId,i.endFragment=n,i}(i,t,v.id,e.type!==l.default.FRAGMENT_LOADING_PROGRESS);p.trigger(s?l.default.INIT_FRAGMENT_LOADED:l.default.MEDIA_FRAGMENT_LOADED,{chunk:u,request:t},{streamId:o.id,mediaType:t.mediaType})}else r.warn("No "+t.mediaType+" bytes to push or stream is inactive.")}}return t={getStreamId:T,getModel:function(t){var r=d[t];return r||(r=Object(i.default)(g).create({streamInfo:v,type:t,dashMetrics:E,fragmentLoader:Object(s.default)(g).create({dashMetrics:E,mediaPlayerModel:y,errHandler:m,requestModifier:Object(o.default)(g).getInstance(),settings:e.settings,boxParser:e.boxParser,eventBus:p,events:l.default,errors:f.default,dashConstants:e.dashConstants,urlUtils:e.urlUtils,streamId:T()}),debug:_,eventBus:p,events:l.default}),d[t]=r),r},reset:function(){p.off(c.default.FRAGMENT_LOADING_COMPLETED,b,this),p.off(c.default.FRAGMENT_LOADING_PROGRESS,b,this),S()}},r=_.getLogger(t),S(),p.on(c.default.FRAGMENT_LOADING_COMPLETED,b,t),p.on(c.default.FRAGMENT_LOADING_PROGRESS,b,t),t}g.__dashjs_factory_name="FragmentController",t.default=d.default.getClassFactory(g)},"./src/streaming/controllers/GapController.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/core/Debug.js"),i=r("./src/core/events/Events.js"),s=r("./src/core/EventBus.js");function o(){var e,t,r,n,o,u,l,c,f,d,h,g,p=this.context,m=Object(s.default)(p).getInstance();function y(){g.debug("Stopping the gap controller"),o&&(clearInterval(o),o=null),function(){m.off(i.default.WALLCLOCK_TIME_UPDATED,S,this),m.off(i.default.INITIAL_STREAM_SWITCH,T,this),m.off(i.default.PLAYBACK_SEEKING,E,this),m.off(i.default.BUFFER_REPLACEMENT_STARTED,_,e),m.off(i.default.TRACK_CHANGE_RENDERED,v,e)}(),o=null,u=NaN,n=0,d=null,h={}}function E(){d&&(clearTimeout(d),d=null)}function _(e){try{if(e.streamId!==c.getActiveStreamInfo().id||!e.mediaType)return;e.streamId===c.getActiveStreamInfo().id&&(h[e.mediaType]=!0)}catch(e){g.error(e)}}function v(e){e&&e.mediaType&&(h[e.mediaType]=!1)}function T(){o||function(){try{o||(g.debug("Starting the gap controller"),o=setInterval(function(){b()&&A(l.getTime())},100))}catch(e){}}()}function S(){if(b(r.get().streaming.gaps.enableSeekFix)&&++n>=10){var e=l.getTime();t===e?A(e,!0):(t=e,u=NaN),n=0}}function b(){var e,t,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],a=Object.keys(h).some(function(e){return h[e]}),i=!!n&&(e=c.getActiveStream(),t=parseFloat((e.getStartTime()+e.getDuration()).toFixed(5)),l.getTime()+r.get().streaming.gaps.threshold>=t);return!a&&r.get().streaming.gaps.jumpGaps&&c.getActiveStreamProcessors().length>0&&(!l.isSeeking()||i)&&!l.isPaused()&&!c.getIsStreamSwitchInProgress()&&!c.getHasMediaOrInitialisationError()}function A(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=r.get().streaming.gaps.smallGapLimit,i=r.get().streaming.gaps.jumpLargeGaps,s=f.getBufferRange(),o=NaN,h=!1;if(t=function(e,t){try{if(!e||e.length<=1&&t>0)return NaN;for(var n=NaN,a=0;isNaN(n)&&a<e.length;){var i=a>0?e.end(a-1):0;t<e.start(a)&&i-t<r.get().streaming.gaps.threshold&&(n=a),a+=1}return n}catch(e){return null}}(s,e),!isNaN(t)){var p=s.start(t),m=p-e;m>0&&(m<=a||i)&&(o=p)}var y=l.getTimeToStreamEnd();if(isNaN(o)&&n&&isFinite(y)&&!isNaN(y)&&y<a&&(o=parseFloat(l.getStreamEndTime().toFixed(5)),h=!0),o>0&&u!==o&&o>e&&!d){var E=o-e;if(h){var _=c.getStreamForTime(o),v=_&&!!_.getPreloaded();g.warn("Jumping to end of stream because of gap from ".concat(e," to ").concat(o,". Gap duration: ").concat(E)),l.seek(o,!0,v)}else{var T=l.getIsDynamic(),S=t>0?s.end(t-1):e,b=T?1e3*Math.max(0,E-.1):0;d=window.setTimeout(function(){l.seek(o,!0,!0),g.warn("Jumping gap occuring in period ".concat(c.getActiveStream().getStreamId()," starting at ").concat(S," and ending at ").concat(o,". Jumping by: ").concat(E-b/1e3)),d=null},b)}u=o}}return e={reset:y,setConfig:function(e){e&&(e.settings&&(r=e.settings),e.playbackController&&(l=e.playbackController),e.streamController&&(c=e.streamController),e.videoModel&&(f=e.videoModel))},initialize:function(){!function(){m.on(i.default.WALLCLOCK_TIME_UPDATED,S,this),m.on(i.default.INITIAL_STREAM_SWITCH,T,this),m.on(i.default.PLAYBACK_SEEKING,E,this),m.on(i.default.BUFFER_REPLACEMENT_STARTED,_,e),m.on(i.default.TRACK_CHANGE_RENDERED,v,e)}()}},g=Object(a.default)(p).getInstance().getLogger(e),y(),e}o.__dashjs_factory_name="GapController",t.default=n.default.getSingletonFactory(o)},"./src/streaming/controllers/MediaController.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/Constants.js"),a=r("./src/core/events/Events.js"),i=r("./src/core/EventBus.js"),s=r("./src/core/FactoryMaker.js"),o=r("./src/core/Debug.js");function u(){var e,t,r,s,u,l,c,f,d=this.context,h=Object(i.default)(d).getInstance();function g(e,t){return e&&r[t]&&r[t][e]?r[t][e].list:[]}function p(e,t){return e&&r[t]&&r[t][e]?r[t][e].current:null}function m(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e&&e.streamInfo){var i=e.type,o=e.streamInfo.id,u=p(i,o);if(r[o]&&r[o][i]&&!_(e,u)&&(r[o][i].current=e,r[o][i].current&&(i!==n.default.TEXT||i===n.default.TEXT&&e.isFragmented)&&h.trigger(a.default.CURRENT_TRACK_CHANGED,{oldMediaInfo:u,newMediaInfo:e,switchMode:s.get().streaming.trackSwitchMode[i]},{streamId:o}),!t)){var f=function(e){var t={lang:e.lang,viewpoint:e.viewpoint,roles:e.roles,accessibility:e.accessibility,audioChannelConfiguration:e.audioChannelConfiguration};return t.lang||t.viewpoint||t.role&&t.role.length>0||t.accessibility&&t.accessibility.length>0||t.audioChannelConfiguration&&t.audioChannelConfiguration.length>0?t:null}(e);if(!f||!r[o][i].storeLastSettings)return;f.roles&&(f.role=f.roles[0],delete f.roles),f.accessibility&&(f.accessibility=f.accessibility[0]),f.audioChannelConfiguration&&(f.audioChannelConfiguration=f.audioChannelConfiguration[0]),l[i]=f,c.setSavedMediaSettings(i,f)}}}function y(e,t){e&&t&&(u[e]=t)}function E(e){return e?u[e]:null}function _(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;var r=e.id===t.id,n=e.viewpoint===t.viewpoint,a=e.lang===t.lang,i=e.codec===t.codec,s=e.roles.toString()===t.roles.toString(),o=e.accessibility.toString()===t.accessibility.toString(),u=e.audioChannelConfiguration.toString()===t.audioChannelConfiguration.toString();return r&&i&&n&&a&&s&&o&&u}function v(){r={},l={},f=null,u={audio:null,video:null,text:null}}function T(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=!e.lang||t.lang.match(e.lang),i=void 0===e.index||null===e.index||t.index===e.index,s=!e.viewpoint||e.viewpoint===t.viewpoint,o=!e.role||!!t.roles.filter(function(t){return t===e.role})[0],u=!e.accessibility||!!t.accessibility.filter(function(t){return t===e.accessibility})[0],l=!e.audioChannelConfiguration||!!t.audioChannelConfiguration.filter(function(t){return t===e.audioChannelConfiguration})[0];return a&&i&&s&&(o||t.type===n.default.AUDIO&&r)&&u&&l}function S(e){var t,r=0,n=[];return e.forEach(function(e){(t=Math.max.apply(Math,e.bitrateList.map(function(e){return e.bandwidth})))>r?(r=t,n=[e]):t===r&&n.push(e)}),n}function b(e){var t,r=1/0,n=[];return e.forEach(function(e){var a=e.bitrateList.reduce(function(e,t){var r=Math.max(1,t.width*t.height);return e+t.bandwidth/r},0);(t=a/e.bitrateList.length)<r?(r=t,n=[e]):t===r&&n.push(e)}),n}function A(e){var t,r=0,n=[];return e.forEach(function(e){(t=e.representationCount)>r?(r=t,n=[e]):t===r&&n.push(e)}),n}function R(e,r){if(e===n.default.TEXT)return r[0];var a,i=s.get().streaming.selectionModeForInitialTrack;if(f&&"function"==typeof f)a=f(r);else switch(i){case n.default.TRACK_SELECTION_MODE_HIGHEST_SELECTION_PRIORITY:a=function(e){var t,r,n=(t=0,r=[],e.forEach(function(e){isNaN(e.selectionPriority)||(e.selectionPriority>t?(t=e.selectionPriority,r=[e]):e.selectionPriority===t&&r.push(e))}),r);return n.length>1&&(n=S(n)),n.length>1&&(n=A(n)),n}(r);break;case n.default.TRACK_SELECTION_MODE_HIGHEST_BITRATE:a=function(e){var t=S(e);return t.length>1&&(t=A(t)),t}(r);break;case n.default.TRACK_SELECTION_MODE_FIRST_TRACK:a=I(r);break;case n.default.TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY:a=function(e){var t=b(e);return t.length>1&&(t=S(t)),t}(r);break;case n.default.TRACK_SELECTION_MODE_WIDEST_RANGE:a=function(e){var t=A(e);return t.length>1&&(t=S(e)),t}(r);break;default:t.warn("Track selection mode ".concat(i," is not supported. Falling back to TRACK_SELECTION_MODE_FIRST_TRACK")),a=I(r)}return a.length>0?a[0]:r[0]}function I(e){return e[0]}return e={setInitialMediaSettingsForType:function(e,t){var r=l[e]||E(e),n=g(e,t.id),a=[];r||(r=c.getSavedMediaSettings(e),y(e,r)),n&&0!==n.length&&(r&&n.forEach(function(t){T(r,t,!!l[e])&&a.push(t)}),0===a.length?m(R(e,n),!0):a.length>1?m(R(e,a,l[e])):m(a[0]))},addTrack:function(e){if(e){var t=e.type;if((a=t)===n.default.AUDIO||a===n.default.VIDEO||a===n.default.TEXT||a===n.default.IMAGE){var a,i=e.streamInfo.id;r[i]||(r[i]={audio:{list:[],storeLastSettings:!0,current:null},video:{list:[],storeLastSettings:!0,current:null},text:{list:[],storeLastSettings:!0,current:null},image:{list:[],storeLastSettings:!0,current:null}});for(var s=r[i][t].list,o=0,u=s.length;o<u;++o)if(_(s[o],e))return;s.push(e)}}},getTracksFor:g,getCurrentTrackFor:p,isCurrentTrack:function(e){if(!e)return!1;var t=e.type,n=e.streamInfo.id;return r[n]&&r[n][t]&&_(r[n][t].current,e)},setTrack:m,selectInitialTrack:R,setCustomInitialTrackSelectionFunction:function(e){f=e},setInitialSettings:y,getInitialSettings:E,getTracksWithHighestBitrate:S,getTracksWithHighestEfficiency:b,getTracksWithWidestRange:A,isTracksEqual:_,matchSettings:T,saveTextSettingsDisabled:function(){c.setSavedMediaSettings(n.default.TEXT,null)},setConfig:function(e){e&&(e.domStorage&&(c=e.domStorage),e.settings&&(s=e.settings))},reset:v},t=Object(o.default)(d).getInstance().getLogger(e),v(),e}u.__dashjs_factory_name="MediaController";var l=s.default.getSingletonFactory(u);s.default.updateSingletonFactory(u.__dashjs_factory_name,l),t.default=l},"./src/streaming/controllers/MediaSourceController.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/core/Debug.js");function i(){var e,t,r,n=this.context;return e={createMediaSource:function(){var e="WebKitMediaSource"in window;return"MediaSource"in window?t=new MediaSource:e&&(t=new WebKitMediaSource),t},attachMediaSource:function(e){var r=window.URL.createObjectURL(t);return e.setSource(r),r},detachMediaSource:function(e){e.setSource(null)},setDuration:function e(n){t&&"open"===t.readyState&&(null===n&&isNaN(n)||t.duration!==n&&(function(e){for(var t=e.sourceBuffers,r=0;r<t.length;r++)if(t[r].updating)return!0;return!1}(t)?setTimeout(e.bind(null,n),50):(r.info("Set MediaSource duration:"+n),t.duration=n)))},setSeekable:function(e,r){t&&"function"==typeof t.setLiveSeekableRange&&"function"==typeof t.clearLiveSeekableRange&&"open"===t.readyState&&e>=0&&e<r&&(t.clearLiveSeekableRange(),t.setLiveSeekableRange(e,r))},signalEndOfStream:function(e){if(e&&"open"===e.readyState){for(var t=e.sourceBuffers,n=0;n<t.length;n++){if(t[n].updating)return;if(0===t[n].buffered.length)return}r.info("call to mediaSource endOfStream"),e.endOfStream()}}},r=Object(a.default)(n).getInstance().getLogger(e),e}i.__dashjs_factory_name="MediaSourceController",t.default=n.default.getSingletonFactory(i)},"./src/streaming/controllers/PlaybackController.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/Constants.js"),a=r("./src/streaming/constants/MetricsConstants.js"),i=r("./src/core/EventBus.js"),s=r("./src/core/events/Events.js"),o=r("./src/core/FactoryMaker.js"),u=r("./src/core/Debug.js"),l=r("./src/streaming/MediaPlayerEvents.js");function c(){var e,t,r,o,c,f,d,h,g,p,m,y,E,_,v,T,S,b,A,R,I,C,w=this.context,N=Object(i.default)(w).getInstance();function D(){return parseFloat((M(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)-x()).toFixed(5))}function M(e){var t=e||p;return t.start+t.duration}function O(){p&&f&&f.getElement()?f.play():E=!0}function P(){return p&&f?f.isPaused():null}function L(){p&&f&&f.pause()}function F(){return p&&f?f.isSeeking():null}function j(e,r,n){p&&f&&e!==(isNaN(T)?f.getTime():T)&&((S=!0===n)||(T=e,N.trigger(s.default.PLAYBACK_SEEK_ASKED)),t.info("Requesting seek to time: "+e+(S?" (internal)":"")),f.setCurrentTime(e,r))}function x(){return p&&f?f.getTime():null}function k(){var e=x();if(m&&!isNaN(v)){var t=v/1e3;e>t&&(e-=t)}return e}function B(){return p&&f?f.getPlaybackRate():null}function U(){return p&&f?f.getEnded():null}function G(){return m}function H(){if(!m||isNaN(v))return NaN;var e=k();if(isNaN(e)||0===e)return 0;var t=(new Date).getTime()+1e3*d.getClientTimeOffset();return Math.max(((t-v-1e3*e)/1e3).toFixed(3),0)}function q(){L(),E=!1,g=0,v=0,I=!1,T=NaN,f&&(N.off(s.default.DATA_UPDATE_COMPLETED,W,e),N.off(s.default.LOADING_PROGRESS,pe,e),N.off(s.default.MANIFEST_UPDATED,ve,e),N.off(s.default.STREAMS_COMPOSED,Te,e),N.off(l.default.BUFFER_LEVEL_STATE_CHANGED,me,e),N.off(l.default.PLAYBACK_PROGRESS,ce,e),N.off(l.default.PLAYBACK_TIME_UPDATED,ce,e),N.off(l.default.PLAYBACK_ENDED,ue,e),N.off(l.default.STREAM_INITIALIZING,Ee,e),N.off(l.default.REPRESENTATION_SWITCH,_e,e),f.setPlaybackRate(1,!0),K(),f.removeEventListener("canplay",z),f.removeEventListener("canplaythrough",X),f.removeEventListener("play",Q),f.removeEventListener("waiting",J),f.removeEventListener("playing",$),f.removeEventListener("pause",Z),f.removeEventListener("error",le),f.removeEventListener("seeking",ee),f.removeEventListener("seeked",te),f.removeEventListener("timeupdate",re),f.removeEventListener("progress",ne),f.removeEventListener("ratechange",ae),f.removeEventListener("loadedmetadata",ie),f.removeEventListener("loadeddata",se),f.removeEventListener("stalled",ye),f.removeEventListener("ended",oe)),h=null,f=null,p=null,m=null}function Y(){null===h&&(h=setInterval(function(){var e;N.trigger(s.default.WALLCLOCK_TIME_UPDATED,{isDynamic:m,time:new Date}),G()&&(r.addDVRMetric(),P()?(e=Date.now(),(!_||e>_+500)&&(_=e,re())):V())},C.get().streaming.wallclockTimeUpdateInterval))}function K(){clearInterval(h),h=null}function V(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!P()&&m&&0!==f.getReadyState()&&!F()&&!I){e||(e=r.hasVideoTrack()?n.default.VIDEO:n.default.AUDIO);var a=k(),i=function(e,t){var r=o.getCurrentDVRInfo(t),n=r?r.range:null;return n?e>n.end?Math.max(n.end-g,n.start):e>0&&e+.25<n.start&&Math.abs(e-n.start)<31536e4?C.get().streaming.lowLatencyEnabled?Math.max(n.end-g,n.start):n.start:e:NaN}(a,e);!isNaN(i)&&i!==a&&!F()&&(p&&f&&f.isStalled()||A||1===f.getReadyState())&&(t.debug("UpdateCurrentTime: Seek to actual time: ".concat(i," from currentTime: ").concat(a)),j(i))}}function W(e){var t=c.convertRepresentationToRepresentationInfo(e.currentRepresentation),r=t?t.mediaInfo.streamInfo:null;null!==r&&p.id===r.id&&(p=r)}function z(){N.trigger(s.default.CAN_PLAY)}function X(){N.trigger(s.default.CAN_PLAY_THROUGH)}function Q(){t.info("Native video element event: play"),V(),Y(),N.trigger(s.default.PLAYBACK_STARTED,{startTime:x()})}function J(){t.info("Native video element event: waiting"),N.trigger(s.default.PLAYBACK_WAITING,{playingTime:x()})}function $(){t.info("Native video element event: playing"),N.trigger(s.default.PLAYBACK_PLAYING,{playingTime:x()})}function Z(){t.info("Native video element event: pause"),N.trigger(s.default.PLAYBACK_PAUSED,{ended:U()})}function ee(){if(S)S=!1;else{var e=x();isNaN(T)||T===e||(e=T),T=NaN,t.info("Seeking to: "+e),Y(),N.trigger(s.default.PLAYBACK_SEEKING,{seekTime:e,streamId:p.id})}}function te(){t.info("Native video element event: seeked"),N.trigger(s.default.PLAYBACK_SEEKED)}function re(){p&&N.trigger(s.default.PLAYBACK_TIME_UPDATED,{timeToEnd:D(),time:x(),streamId:p.id})}function ne(){N.trigger(s.default.PLAYBACK_PROGRESS,{streamId:p.id})}function ae(){var e=B();t.info("Native video element event: ratechange: ",e),N.trigger(s.default.PLAYBACK_RATE_CHANGED,{playbackRate:e})}function ie(){t.info("Native video element event: loadedmetadata"),N.trigger(s.default.PLAYBACK_METADATA_LOADED),Y()}function se(){t.info("Native video element event: loadeddata"),N.trigger(s.default.PLAYBACK_LOADED_DATA)}function oe(){t.info("Native video element event: ended"),L(),K();var e=r?r.getActiveStreamInfo():null;e&&N.trigger(s.default.PLAYBACK_ENDED,{isLast:e.isLast})}function ue(e){if(h&&e.isLast){t.info("onPlaybackEnded -- PLAYBACK_ENDED but native video element didn't fire ended");var r=e.seekTime?e.seekTime:M();f.setCurrentTime(r),L(),K()}}function le(e){var t=e.target||e.srcElement;N.trigger(s.default.PLAYBACK_ERROR,{error:t.error})}function ce(){m&&fe()&&C.get().streaming.liveCatchup.playbackRate>0&&!P()&&!F()&&(function(){try{if(fe()&&C.get().streaming.liveCatchup.playbackRate>0&&x()>0){var e=he(),t=H(),r=y.getLiveDelay(),a=y.getLiveCatchupLatencyThreshold(),i=C.get().streaming.liveCatchup.minDrift;return e===n.default.LIVE_CATCHUP_MODE_LOLP?function(e,t,r,n,a,i){try{var s=Math.abs(e-t);return(isNaN(i)||e<=i)&&(s>r||n<a)}catch(e){return!1}}(t,r,i,de(),C.get().streaming.liveCatchup.playbackBufferMin,a):function(e,t,r,n){try{return Math.abs(e-t)>n&&(isNaN(r)||e<=r)}catch(e){return!1}}(t,r,a,i)}}catch(e){return!1}}()?function(){if(f){var e,a=f.getPlaybackRate(),i=C.get().streaming.liveCatchup.playbackRate,s=H(),u=y.getLiveDelay(),l=de();he()===n.default.LIVE_CATCHUP_MODE_LOLP?(C.get().streaming.liveCatchup.minDrift,e=function(e,r,n,a,i,s,o){var u,l=e;if(s<i){var c=5*(s-i);u=1-l+2*l/(1+Math.pow(Math.E,-c)),t.debug("[LoL+ playback control_buffer-based] bufferLevel: "+s+", newRate: "+u)}else{if(Math.abs(r-n)<=.02*n)u=1;else{var f=5*(r-n);u=1-l+2*l/(1+Math.pow(Math.E,-f))}t.debug("[LoL+ playback control_latency-based] latency: "+r+", newRate: "+u)}return A&&s>n/2&&(A=!1),Math.abs(o-u)<=R&&(u=null),{newRate:u}}(i,s,u,0,C.get().streaming.liveCatchup.playbackBufferMin,l,a)):e=function(e,t,r,n,a){var i=t-r,s=5*i,o=1-e+2*e/(1+Math.pow(Math.E,-s));return A&&(n>r/2?A=!1:i>0&&(o=1)),Math.abs(a-o)<=R&&(o=null),{newRate:o}}(i,s,u,l,a);var c=e.newRate;c&&f.setPlaybackRate(c);var d=s-u;C.get().streaming.liveCatchup.maxDrift>0&&!b&&d>C.get().streaming.liveCatchup.maxDrift?(t.info("Low Latency catchup mechanism. Latency too high, doing a seek to live point"),b=!0,h=r&&r.hasVideoTrack()?n.default.VIDEO:n.default.AUDIO,(p=(g=o.getCurrentDVRInfo(h))?g.range:null)&&!isNaN(p.end)&&j(p.end-y.getLiveDelay(),!0,!1)):b=!1}var h,g,p}():ge())}function fe(){return C.get().streaming.liveCatchup.enabled||C.get().streaming.lowLatencyEnabled}function de(){var e=null;return r.getActiveStreamProcessors().forEach(function(t){var r=t.getBufferLevel();e=null===e?r:Math.min(e,r)}),e}function he(){var e=C.get().streaming.liveCatchup.playbackBufferMin;return C.get().streaming.liveCatchup.mode!==n.default.LIVE_CATCHUP_MODE_LOLP||null===e||isNaN(e)?n.default.LIVE_CATCHUP_MODE_DEFAULT:n.default.LIVE_CATCHUP_MODE_LOLP}function ge(){f&&f.setPlaybackRate(1)}function pe(e){if(!1===e.stream&&C.get().streaming.lowLatencyEnabled&&!isNaN(e.request.duration)){var r=1.2*e.request.duration;r>y.getLiveDelay()&&(t.warn("Browser does not support fetch API with StreamReader. Increasing live delay to be 20% higher than segment duration:",r.toFixed(2)),C.update({streaming:{delay:{liveDelay:r}}}))}}function me(e){e.streamId===p.id&&(fe()?e.state!==a.default.BUFFER_EMPTY||F()||A||(A=!0,ge()):C.get().streaming.buffer.setStallState&&f.setStallState(e.mediaType,e.state===a.default.BUFFER_EMPTY))}function ye(e){N.trigger(s.default.PLAYBACK_STALLED,{e})}function Ee(e){var r;(r=e.mediaInfo)&&r.supplementalProperties&&"true"===r.supplementalProperties[n.default.SUPPLEMENTAL_PROPERTY_LL_SCHEME]&&(t.debug("Low Latency critical SupplementalProperty set: Enabling low Latency"),C.update({streaming:{lowLatencyEnabled:!0}}))}function _e(e){var t=r.getActiveStreamInfo();if(C.get().streaming.lowLatencyEnabledByManifest&&e&&t&&e.currentRepresentation&&e.streamId&&e.streamId===t.id&&e.mediaType&&(e.mediaType===n.default.VIDEO||e.mediaType===n.default.AUDIO)){var a=!e.currentRepresentation.availabilityTimeComplete;a&&C.update({streaming:{lowLatencyEnabled:a}})}}function ve(){I=!0}function Te(){I=!1}return e={initialize:function(t,r){p=t,!0!==r&&function(){f.addEventListener("canplay",z),f.addEventListener("canplaythrough",X),f.addEventListener("play",Q),f.addEventListener("waiting",J),f.addEventListener("playing",$),f.addEventListener("pause",Z),f.addEventListener("error",le),f.addEventListener("seeking",ee),f.addEventListener("seeked",te),f.addEventListener("timeupdate",re),f.addEventListener("progress",ne),f.addEventListener("ratechange",ae),f.addEventListener("loadedmetadata",ie),f.addEventListener("loadeddata",se),f.addEventListener("stalled",ye),f.addEventListener("ended",oe),m=p.manifestInfo.isDynamic,b=!1,A=!1,S=!1;var t="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",r=/safari/.test(t)&&!/chrome/.test(t);R=r?.25:.02,N.on(s.default.DATA_UPDATE_COMPLETED,W,e),N.on(s.default.LOADING_PROGRESS,pe,e),N.on(s.default.MANIFEST_UPDATED,ve,e),N.on(s.default.STREAMS_COMPOSED,Te,e),N.on(l.default.BUFFER_LEVEL_STATE_CHANGED,me,e),N.on(l.default.PLAYBACK_PROGRESS,ce,e),N.on(l.default.PLAYBACK_TIME_UPDATED,ce,e),N.on(l.default.PLAYBACK_ENDED,ue,e,{priority:i.default.EVENT_PRIORITY_HIGH}),N.on(l.default.STREAM_INITIALIZING,Ee,e),N.on(l.default.REPRESENTATION_SWITCH,_e,e),E&&(E=!1,O())}()},setConfig:function(e){e&&(e.streamController&&(r=e.streamController),e.dashMetrics&&(o=e.dashMetrics),e.mediaPlayerModel&&(y=e.mediaPlayerModel),e.adapter&&(c=e.adapter),e.videoModel&&(f=e.videoModel),e.timelineConverter&&(d=e.timelineConverter),e.settings&&(C=e.settings))},getTimeToStreamEnd:D,getBufferLevel:de,getTime:x,getNormalizedTime:k,getIsManifestUpdateInProgress:function(){return I},getPlaybackRate:B,getPlayedRanges:function(){return p&&f?f.getPlayedRanges():null},getEnded:U,getIsDynamic:G,getStreamController:function(){return r},computeAndSetLiveDelay:function(e,r){var a,i,s,o=!isNaN(e)&&isFinite(e)?e:NaN,u=c.getSuggestedPresentationDelay();if(C.get().streaming.delay.applyServiceDescription&&isNaN(C.get().streaming.delay.liveDelay)&&isNaN(C.get().streaming.delay.liveDelayFragmentCount)&&function(e){if(e&&e.serviceDescriptions){for(var r=null,a=0;a<e.serviceDescriptions.length;a++){var i=e.serviceDescriptions[a];if(i.schemeIdUri===n.default.SERVICE_DESCRIPTION_LL_SCHEME){r=i;break}}r&&(r.latency&&r.latency.target>0&&(t.debug("Apply LL properties coming from service description. Target Latency (ms):",r.latency.target),C.update({streaming:{delay:{liveDelay:r.latency.target/1e3},liveCatchup:{minDrift:(r.latency.target+500)/1e3,maxDrift:r.latency.max>r.latency.target?(r.latency.max-r.latency.target+500)/1e3:void 0}}})),r.playbackRate&&r.playbackRate.max>1&&(t.debug("Apply LL properties coming from service description. Max PlaybackRate:",r.playbackRate.max),C.update({streaming:{liveCatchup:{playbackRate:r.playbackRate.max-1}}})))}}(r),a=y.getLiveDelay()?y.getLiveDelay():null===C.get().streaming.delay.liveDelayFragmentCount||isNaN(C.get().streaming.delay.liveDelayFragmentCount)||isNaN(o)?!0===C.get().streaming.delay.useSuggestedPresentationDelay&&null!==u&&!isNaN(u)&&u>0?u:isNaN(o)?r&&!isNaN(r.minBufferTime)?4*r.minBufferTime:4*p.manifestInfo.minBufferTime:4*o:o*C.get().streaming.delay.liveDelayFragmentCount,null!==(s=c.getAvailabilityStartTime())&&(v=s),r&&r.dvrWindowSize>0){var l=Math.max(r.dvrWindowSize-10,r.dvrWindowSize/2);i=Math.min(a,l)}else i=a;return g=i,i},getLiveDelay:function(){return g},getCurrentLiveLatency:H,play:O,isPaused:P,pause:L,isSeeking:F,getStreamEndTime:M,seek:j,reset:q,updateCurrentTime:V,getAvailabilityStartTime:function(){return v}},t=Object(u.default)(w).getInstance().getLogger(e),q(),e}c.__dashjs_factory_name="PlaybackController",t.default=o.default.getSingletonFactory(c)},"./src/streaming/controllers/ScheduleController.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/Constants.js"),a=r("./src/streaming/models/FragmentModel.js"),i=r("./src/core/EventBus.js"),s=r("./src/core/events/Events.js"),o=r("./src/core/FactoryMaker.js"),u=r("./src/core/Debug.js"),l=r("./src/streaming/constants/MetricsConstants.js"),c=r("./src/streaming/MediaPlayerEvents.js");function f(e){e=e||{};var t,r,o,f,d,h,g,p,m,y,E,_,v,T=this.context,S=Object(i.default)(T).getInstance(),b=e.dashMetrics,A=e.mediaPlayerModel,R=e.fragmentModel,I=e.abrController,C=e.playbackController,w=e.textController,N=e.type,D=e.bufferController,M=e.settings;function O(e){if(!D.getIsBufferingCompleted()){P();var t=isNaN(e)?0:e;h=setTimeout(L,t)}}function P(){h&&(clearTimeout(h),h=null)}function L(){try{if(function(){try{return N===n.default.TEXT&&!w.isTextEnabled()||C.isPaused()&&(!C.getStreamController().getInitialPlayback()||!C.getStreamController().getAutoPlay())&&!M.get().streaming.scheduling.scheduleWhilePaused}catch(e){return!1}}())return void P();if(function(){try{return f&&(isNaN(y)||E||(e=r.id,t=I.getMaxAllowedIndexFor(N,e),!(!isNaN(m)&&m==t||(o.info("Top quality "+N+" index has changed from "+m+" to "+t),m=t,0)))||!N||!f||b.getCurrentBufferLevel(N)<F())}catch(e){return!1}var e,t}()){var e=!1;v&&(e=I.checkPlaybackQuality(N,r.id)),e||(_||f.quality!==y||E?(E?(o.debug("Switch track for "+N+", representation id = "+f.id),E=!1):o.debug("Quality has changed, get init request for representationid = "+f.id),S.trigger(s.default.INIT_FRAGMENT_NEEDED,{representationId:f.id,sender:t},{streamId:r.id,mediaType:N}),v=!1,_=!1):(o.debug("Media segment needed for ".concat(N," and stream id ").concat(r.id)),S.trigger(s.default.MEDIA_FRAGMENT_NEEDED,{},{streamId:r.id,mediaType:N}),v=!0))}else O(M.get().streaming.lowLatencyEnabled?M.get().streaming.scheduling.lowLatencyTimeout:M.get().streaming.scheduling.defaultTimeout)}catch(e){O(M.get().streaming.lowLatencyEnabled?M.get().streaming.scheduling.lowLatencyTimeout:M.get().streaming.scheduling.defaultTimeout)}}function F(){var e=NaN;return N&&f?e=N===n.default.TEXT?function(){try{if(w.isTextEnabled()){if(isNaN(f.fragmentDuration)){var e=b.getCurrentSchedulingInfo(l.default.SCHEDULING_INFO);return e?e.duration:0}return f.fragmentDuration}return 0}catch(e){return 0}}():N===n.default.AUDIO&&g?function(){try{var e=b.getCurrentBufferLevel(n.default.VIDEO);return isNaN(f.fragmentDuration)?e+1:Math.max(e+1,f.fragmentDuration)}catch(e){return 0}}():function(){try{var e=f.mediaInfo.streamInfo;return I.isPlayingAtTopQuality(e)?e.manifestInfo.duration>=M.get().streaming.buffer.longFormContentDurationThreshold?M.get().streaming.buffer.bufferTimeAtTopQualityLongForm:M.get().streaming.buffer.bufferTimeAtTopQuality:A.getStableBufferTime()}catch(e){return A.getStableBufferTime()}}():e}function j(){x(!0)}function x(e){if(C&&R){var t=R.getRequests({state:a.default.FRAGMENT_MODEL_EXECUTED,time:C.getTime(),threshold:0})[0];t&&C.getTime()>=t.startTime&&((!p.mediaInfo||t.mediaInfo.type===p.mediaInfo.type&&t.mediaInfo.id!==p.mediaInfo.id)&&e&&S.trigger(s.default.TRACK_CHANGE_RENDERED,{mediaType:N,oldMediaInfo:p.mediaInfo,newMediaInfo:t.mediaInfo,streamId:r.id}),t.quality===p.quality&&t.adaptationIndex===p.adaptationIndex||!e||(o.debug("Quality change rendered for streamId ".concat(r.id," and type ").concat(N)),S.trigger(s.default.QUALITY_CHANGE_RENDERED,{mediaType:N,oldQuality:p.quality,newQuality:t.quality,streamId:r.id})),p={mediaInfo:t.mediaInfo,quality:t.quality,adaptationIndex:t.adaptationIndex})}}function k(e){o.debug("Appended bytes for ".concat(e.mediaType," and stream id ").concat(r.id)),(isNaN(e.index)||isNaN(y))&&(y=e.quality,o.info("["+N+"] lastInitializedRepresentationInfo changed to "+e.quality)),O(0)}function B(){R.abortRequests(),P()}function U(){M.get().streaming.scheduling.scheduleWhilePaused||O()}function G(e){b.updatePlayListTraceMetrics({playbackspeed:e.playbackRate.toString()})}function H(){v=!0,d=0,y=NaN,p={mediaInfo:void 0,quality:NaN,adaptationIndex:NaN},m=NaN,E=!1,_=!1}return t={initialize:function(e){g=e,S.on(s.default.BYTES_APPENDED_END_FRAGMENT,k,t),S.on(s.default.URL_RESOLUTION_FAILED,B,t),S.on(c.default.PLAYBACK_STARTED,U,t),S.on(c.default.PLAYBACK_RATE_CHANGED,G,t),S.on(c.default.PLAYBACK_TIME_UPDATED,j,t)},getType:function(){return N},getStreamId:function(){return r.id},setCurrentRepresentation:function(e){f=e},setTimeToLoadDelay:function(e){d=e},getTimeToLoadDelay:function(){return d},setSwitchTrack:function(e){E=e},getSwitchStrack:function(){return E},startScheduleTimer:O,clearScheduleTimer:P,reset:function(){S.off(s.default.BYTES_APPENDED_END_FRAGMENT,k,t),S.off(s.default.URL_RESOLUTION_FAILED,B,t),S.off(c.default.PLAYBACK_STARTED,U,t),S.off(c.default.PLAYBACK_RATE_CHANGED,G,t),S.off(c.default.PLAYBACK_TIME_UPDATED,j,t),P(),x(!1),H(),r=null},getBufferTarget:F,getPlaybackController:function(){return C},setCheckPlaybackQuality:function(e){v=e},setInitSegmentRequired:function(e){_=e}},o=Object(u.default)(T).getInstance().getLogger(t),H(),r=e.streamInfo,t}f.__dashjs_factory_name="ScheduleController",t.default=o.default.getClassFactory(f)},"./src/streaming/controllers/StreamController.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/Constants.js"),a=r("./src/streaming/constants/MetricsConstants.js"),i=r("./src/streaming/Stream.js"),s=r("./src/streaming/ManifestUpdater.js"),o=r("./src/core/EventBus.js"),u=r("./src/core/events/Events.js"),l=r("./src/core/FactoryMaker.js"),c=r("./src/streaming/vo/metrics/PlayList.js"),f=r("./src/core/Debug.js"),d=r("./src/streaming/utils/InitCache.js"),h=r("./src/streaming/utils/URLUtils.js"),g=r("./src/streaming/MediaPlayerEvents.js"),p=r("./src/streaming/controllers/TimeSyncController.js"),m=r("./src/streaming/controllers/MediaSourceController.js"),y=r("./src/streaming/vo/DashJSError.js"),E=r("./src/core/errors/Errors.js"),_=r("./src/streaming/controllers/EventController.js"),v=r("./src/streaming/constants/ConformanceViolationConstants.js");function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function S(){var e,t,r,l,S,b,A,R,I,C,w,N,D,M,O,P,L,F,j,x,k,B,U,G,H,q,Y,K,V,W,z,X,Q,J,$,Z,ee,te,re,ne,ae,ie,se,oe,ue=this.context,le=Object(o.default)(ue).getInstance();function ce(){!function(){try{var e=R.getStreamsInfo();if(!U&&0===e.length)throw new Error("There are no streams");U&&I.updateManifestUpdateInfo({currentTime:Q.getTime(),buffered:X.getBufferRange(),presentationStartTime:e[0].start,clientTimeOffset:k.getClientTimeOffset()}),B.length>0&&function(e){B=B.filter(function(r){var n=e.filter(function(e){return e.id===r.getId()}).length>0||r.getId()===U.getId();return n||(t.debug("Removing stream ".concat(r.getId())),r.reset(!0)),n})}(e);for(var r=[],n=0,a=e.length;n<a;n++){var i=e[n];r.push(de(i)),I.addManifestUpdateStreamInfo(i)}Promise.all(r).then(function(){U||he(e),le.trigger(u.default.STREAMS_COMPOSED),Me()}).catch(function(e){throw e})}catch(e){x.error(new y.default(E.default.MANIFEST_ERROR_ID_NOSTREAMS_CODE,e.message+"nostreamscomposed",A.getValue())),W=!0,ze()}}()}function fe(){ie=!0}function de(e){var t=Ye(e.id);return t?t.updateData(e):(t=Object(i.default)(ue).create({manifestModel:A,mediaPlayerModel:J,dashMetrics:I,manifestUpdater:S,adapter:R,timelineConverter:k,capabilities:r,capabilitiesFilter:l,errHandler:x,baseURLController:N,segmentBaseController:D,textController:H,abrController:O,playbackController:Q,eventController:L,mediaController:P,protectionController:G,videoModel:X,streamInfo:e,settings:ae}),B.push(t),t.initialize(),Promise.resolve())}function he(e){Ae();var r=I.getCurrentDVRInfo().range;if(r.end<r.start){se&&clearTimeout(se);var a=Math.min(1e3*(-1*(r.end-r.start)+2),2147483647);return t.debug("Waiting for ".concat(a," ms before playback can start")),le.trigger(u.default.AST_IN_FUTURE,{delay:a}),void(se=setTimeout(function(){he(e)},a))}if(R.getIsDynamic()&&B.length){var i=e[0].manifestInfo,s=function(e,t){try{var r=NaN;if(t&&!isNaN(t.maxFragmentDuration)&&isFinite(t.maxFragmentDuration))return t.maxFragmentDuration;if(e&&1===e.length){var a=e[0],i=[n.default.VIDEO,n.default.AUDIO,n.default.TEXT].reduce(function(e,t){var r=R.getMediaInfoForType(a,t);return r&&!1!==r.isFragmented&&e.push(r),e},[]).reduce(function(e,t){var r=R.getVoRepresentations(t);return r&&r.length>0&&r.forEach(function(t){t&&e.push(t)}),e},[]).reduce(function(e,t){var r=R.convertRepresentationToRepresentationInfo(t);return r&&r.fragmentDuration&&!isNaN(r.fragmentDuration)&&e.push(r.fragmentDuration),e},[]);r=Math.max.apply(Math,function(e){if(Array.isArray(e))return T(e)}(s=i)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(s)||function(e,t){if(e){if("string"==typeof e)return T(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?T(e,t):void 0}}(s)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}return isFinite(r)?r:NaN}catch(e){return NaN}var s}(e,i);Q.computeAndSetLiveDelay(s,i)}var o=function(){var e;if(R.getIsDynamic()){var r=I.getCurrentDVRInfo();e=(r&&r.range?r.range.end:0)-Q.getLiveDelay();var n=r?r.range:null;if(n){var a=je(!0);isNaN(a)||(t.info("Start time from URI parameters: "+a),e=Math.max(Math.min(e,a),n.start))}}else{e=Qe()[0].getStreamInfo().start;var i=je(!1);isNaN(i)||(t.info("Start time from URI parameters: "+i),e=Math.max(e,i))}return e}(),l=be(o),c=null!==l?l:B[0];le.trigger(u.default.INITIAL_STREAM_SWITCH,{startTime:o}),ge(c,null,o),ee||(ee=setInterval(function(){!K&&Q.getTimeToStreamEnd()<=0&&!Q.isSeeking()&&le.trigger(u.default.PLAYBACK_ENDED,{isLast:qe().isLast})},200))}function ge(e,r,n){try{if(K||!e||r===e&&e.getIsActive())return;K=!0,le.trigger(u.default.PERIOD_SWITCH_STARTED,{fromStreamInfo:r?r.getStreamInfo():null,toStreamInfo:e.getStreamInfo()});var a=!1;U=e,r&&(a=Te(e,r),r.deactivate(a)),n=isNaN(n)?!a&&r?e.getStreamInfo().start:NaN:n,t.info("Switch to stream ".concat(e.getId(),". Seektime is ").concat(n,", current playback time is ").concat(Q.getTime(),". Seamless period switch is set to ").concat(a)),re=re.filter(function(e){return e.getId()!==U.getId()}),Q.initialize(qe(),!!r),X.getElement()&&pe(n,a)}catch(e){K=!1}}function pe(e,r){var n;function a(){if(z&&"open"===z.readyState){t.debug("MediaSource is open!"),window.URL.revokeObjectURL(n),z.removeEventListener("sourceopen",a),z.removeEventListener("webkitsourceopen",a),Fe();var i=I.getCurrentDVRInfo();C.setSeekable(i.range.start,i.range.end),me(e,r)}}function i(){z.addEventListener("sourceopen",a,!1),z.addEventListener("webkitsourceopen",a,!1),n=C.attachMediaSource(X),t.debug("MediaSource attached to element. Waiting on open...")}z?r?me(e,r):(C.detachMediaSource(X),i()):(z=C.createMediaSource(),i())}function me(e,t){U.activate(z,t?te:void 0,e).then(function(t){if(t){var r=Object.keys(t);r.length>0&&t[r[0]].getBuffer().changeType&&(ne=!0),te=t}isNaN(e)||(le.trigger(u.default.SEEK_TARGET,{time:e},{streamId:U.getId()}),Q.seek(e,!1,!0),U.startScheduleControllers()),K=!1,le.trigger(u.default.PERIOD_SWITCH_COMPLETED,{toStreamInfo:qe()})})}function ye(e){var t=Q.getTime(),r=e.seekTime,n=be(r);n&&n!==U?n&&n!==U&&(Ee(t,r),function(e,t){var r=e&&!isNaN(e.seekTime)?e.seekTime:NaN,n=U.getProcessors().map(function(t){return t.prepareOuterPeriodPlaybackSeeking(e)});Promise.all(n).then(function(){ge(t,U,r)}).catch(function(e){x.error(e)})}(e,n)):(Ee(t,r),function(e){U.getProcessors().forEach(function(t){return t.prepareInnerPeriodPlaybackSeeking(e)}),Ue(c.PlayListTrace.USER_REQUEST_STOP_REASON)}(e)),Ge(c.PlayList.SEEK_START_REASON)}function Ee(e,t){_e()}function _e(){re&&re.length>0&&(re.forEach(function(e){e.deactivate(!0)}),re=[])}function ve(e){e.newMediaInfo.streamInfo.id===U.getId()&&(_e(),U.prepareTrackChange(e))}function Te(e,t){try{return ae.get().streaming.buffer.reuseExistingSourceBuffers&&(t.isProtectionCompatible(e)||ie)&&(ne||t.isMediaCodecCompatible(e,t))}catch(e){return!1}}function Se(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;z&&!e.getPreloaded()&&Te(e,t)&&e.startPreloading(z,te).then(function(){re.push(e)})}function be(e){if(isNaN(e))return null;for(var t=B.length,r=0;r<t;r++){var n=B[r];if(e<parseFloat((n.getStartTime()+n.getDuration()).toFixed(5)))return n}return null}function Ae(){try{var e=R.getIsDynamic(),t=R.getStreamsInfo()[0].manifestInfo,r=Q.getTime(),a=k.calcTimeShiftBufferWindow(B,e),i=Pe();if(void 0===a.start||void 0===a.end)return;i&&0!==i.length?i.forEach(function(e){I.addDVRInfo(e.getType(),r,t,a)}):I.addDVRInfo(n.default.VIDEO,r,t,a)}catch(e){}}function Re(e){if(Z&&Y){var t=J.getInitialBufferLevel();(isNaN(t)||t<=Q.getBufferLevel()||R.getIsDynamic()&&t>Q.getLiveDelay())&&(Z=!1,Ge(c.PlayList.INITIAL_PLAYOUT_START_REASON),Q.play())}e&&e.mediaType&&I.addBufferLevel(e.mediaType,new Date,1e3*e.bufferLevel)}function Ie(e){e.streamInfo.id===U.getId()&&e.reason&&e.reason.forceReplace&&_e(),Ye(e.streamInfo.id).prepareQualityChange(e)}function Ce(){if(ke()){var e=X.getPlaybackQuality();e&&I.addDroppedFrames(e)}}function we(){t.debug("[onPlaybackStarted]"),!Z&&$&&Ge(c.PlayList.RESUME_FROM_PAUSE_START_REASON),Z&&(Z=!1),$=!1}function Ne(e){t.debug("[onPlaybackPaused]"),e.ended||($=!0,Ue(c.PlayListTrace.USER_REQUEST_STOP_REASON))}function De(e){t.debug("Stream with id ".concat(e.streamInfo.id," finished buffering"));var r=e.streamInfo.isLast;z&&r?(t.info("[onStreamBufferingCompleted] calls signalEndOfStream of mediaSourceController."),C.signalEndOfStream(z)):Me()}function Me(){if(U&&U.getHasFinishedBuffering())for(var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;try{var t=e||U||null;if(t){var r=t.getStreamInfo();return B.filter(function(e){var t=e.getStreamInfo();return t.start>r.start&&r.id!==t.id})}}catch(e){return[]}}(U),t=0;t<e.length;){var r=e[t],n=0===t?U:e[t-1];!r.getPreloaded()&&n.getHasFinishedBuffering()&&z&&Se(r,n),t+=1}}function Oe(){ee&&(clearInterval(ee),ee=null)}function Pe(){return U?U.getProcessors():[]}function Le(e){if(U&&!U.getIsEndedEventSignaled()){U.setIsEndedEventSignaled(!0);var r=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)||U||null;if(!e)return null;for(var t=e.getStreamInfo(),r=t.start,n=0,a=-1,i=NaN;n<B.length;){var s=B[n].getStreamInfo(),o=s.start-r;o>0&&(isNaN(i)||o<i)&&t.id!==s.id&&(i=o,a=n),n+=1}return a>=0?B[a]:null}();r?(t.debug("StreamController onEnded, found next stream with id ".concat(r.getStreamInfo().id,". Switching from ").concat(U.getStreamInfo().id," to ").concat(r.getStreamInfo().id)),ge(r,U,NaN)):(t.debug("StreamController no next stream found"),U.setIsEndedEventSignaled(!1)),Ue(r?c.PlayListTrace.END_OF_PERIOD_STOP_REASON:c.PlayListTrace.END_OF_CONTENT_STOP_REASON)}e&&e.isLast&&Oe()}function Fe(e){var t=e||qe().manifestInfo.duration;C.setDuration(t)}function je(e){var t=M.getURIFragmentData();if(!t||!t.t)return NaN;var r=Qe()[0].getStreamInfo().start;t.t=t.t.split(",")[0];var n=-1!==t.t.indexOf("posix:")?"now"===t.t.substring(6)?Date.now()/1e3:parseInt(t.t.substring(6)):NaN;return e&&!isNaN(n)?n-Q.getAvailabilityStartTime()/1e3:parseInt(t.t)+r}function xe(e){if(e.error)W=!0,ze();else{t.info("Manifest updated... updating data system wide.");var r=e.manifest;R.updatePeriods(r);var n=R.getUTCTimingSources();!R.getIsDynamic()||n&&0!==n.length||le.trigger(g.default.CONFORMANCE_VIOLATION,{level:v.default.LEVELS.WARNING,event:v.default.EVENTS.NO_UTC_TIMING_ELEMENT});var a=R.getIsDynamic()?n.concat(J.getUTCTimingSources()):n,i=j.isHTTPS(e.manifest.url);a.forEach(function(e){e.value.replace(/.*?:\/\//g,"")===J.getDefaultUtcTimingSource().value.replace(/.*?:\/\//g,"")&&(e.value=e.value.replace(i?new RegExp(/^(http:)?\/\//i):new RegExp(/^(https:)?\/\//i),i?"https://":"http://"),t.debug("Matching default timing source protocol to manifest protocol: ",e.value))}),l.filterUnsupportedFeatures(r).then(function(){N.initialize(r),w.attemptSync(a,R.getIsDynamic())})}}function ke(){return!!U&&U.getHasVideoTrack()}function Be(){return!!U&&U.getHasAudioTrack()}function Ue(e,t){t=t||new Date,Pe().forEach(function(r){r.finalisePlayList(t,e)}),I.addPlayList()}function Ge(e){I.createPlaylistMetrics(1e3*Q.getTime(),e)}function He(e){if(e.error){var r="";switch(e.error.code){case 1:r="MEDIA_ERR_ABORTED";break;case 2:r="MEDIA_ERR_NETWORK";break;case 3:r="MEDIA_ERR_DECODE",oe.counts.mediaErrorDecode+=1;break;case 4:r="MEDIA_ERR_SRC_NOT_SUPPORTED";break;case 5:r="MEDIA_ERR_ENCRYPTED";break;default:r="UNKNOWN"}"MEDIA_ERR_DECODE"===r&&ae.get().errors.recoverAttempts.mediaErrorDecode>=oe.counts.mediaErrorDecode?function(){t.warn("A MEDIA_ERR_DECODE occured: Resetting the MediaSource");var e=Q.getTime();U.deactivate(!1),t.warn("MediaSource has been resetted. Resuming playback from time ".concat(e)),pe(e,!1)}():(V=!0,e.error.message&&(r+=" ("+e.error.message+")"),e.error.msExtendedCode&&(r+=" (0x"+(e.error.msExtendedCode>>>0).toString(16).toUpperCase()+")"),t.fatal("Video Element Error: "+r),e.error&&t.fatal(e.error),x.error(new y.default(e.error.code,r)),ze())}}function qe(){return U?U.getStreamInfo():null}function Ye(e){for(var t=0,r=B.length;t<r;t++)if(B[t].getId()===e)return B[t];return null}function Ke(){if(!(b&&b.hasOwnProperty("load")&&k&&k.hasOwnProperty("initialize")&&k.hasOwnProperty("reset")&&k.hasOwnProperty("getClientTimeOffset")&&A&&x&&I&&Q))throw new Error(n.default.MISSING_CONFIG_ERROR)}function Ve(e){isNaN(e.newDuration)||Fe(e.newDuration)}function We(){B=[],G=null,K=!1,U=null,V=!1,W=!1,Z=!0,$=!1,Y=!0,ee=null,ie=!1,ne=!1,re=[],se=null,oe={counts:{mediaErrorDecode:0}}}function ze(){Ke(),w.reset(),Ue(V||W?c.PlayListTrace.FAILURE_STOP_REASON:c.PlayListTrace.USER_REQUEST_STOP_REASON);for(var t=0,r=B?B.length:0;t<r;t++)B[t].reset(V);le.off(g.default.PLAYBACK_TIME_UPDATED,Ce,e),le.off(g.default.PLAYBACK_SEEKING,ye,e),le.off(g.default.PLAYBACK_ERROR,He,e),le.off(g.default.PLAYBACK_STARTED,we,e),le.off(g.default.PLAYBACK_PAUSED,Ne,e),le.off(g.default.PLAYBACK_ENDED,Le,e),le.off(g.default.METRIC_ADDED,Xe,e),le.off(g.default.MANIFEST_VALIDITY_CHANGED,Ve,e),le.off(g.default.BUFFER_LEVEL_UPDATED,Re,e),le.off(g.default.QUALITY_CHANGE_REQUESTED,Ie,e),u.default.KEY_SESSION_UPDATED&&le.off(u.default.KEY_SESSION_UPDATED,fe,e),le.off(u.default.MANIFEST_UPDATED,xe,e),le.off(u.default.STREAM_BUFFERING_COMPLETED,De,e),le.off(u.default.TIME_SYNCHRONIZATION_COMPLETED,ce,e),le.off(u.default.CURRENT_TRACK_CHANGED,ve,e),N.reset(),S.reset(),L.reset(),I.clearAllCurrentMetrics(),A.setValue(null),b.reset(),k.reset(),F.reset(),z&&(C.detachMediaSource(X),z=null),X=null,G&&(G=null,q=null,A.getValue()&&le.trigger(u.default.PROTECTION_DESTROYED,{data:A.getValue().url})),Oe(),le.trigger(u.default.STREAM_TEARDOWN_COMPLETE),We()}function Xe(e){if(e.metric===a.default.DVR_INFO){var t=Be()?n.default.AUDIO:n.default.VIDEO;e.mediaType===t&&C.setSeekable(e.value.range.start,e.value.range.end)}}function Qe(){return B}return e={initialize:function(t,r){Ke(),Y=t,q=r,k.initialize(),(S=Object(s.default)(ue).create()).setConfig({manifestModel:A,adapter:R,manifestLoader:b,errHandler:x,settings:ae}),S.initialize(),(L=Object(_.default)(ue).getInstance()).setConfig({manifestUpdater:S,playbackController:Q,settings:ae}),L.start(),w.setConfig({dashMetrics:I,baseURLController:N,errHandler:x,settings:ae}),w.initialize(),G&&(le.trigger(u.default.PROTECTION_CREATED,{controller:G}),G.setMediaElement(X.getElement()),q&&G.setProtectionData(q)),le.on(g.default.PLAYBACK_TIME_UPDATED,Ce,e),le.on(g.default.PLAYBACK_SEEKING,ye,e),le.on(g.default.PLAYBACK_ERROR,He,e),le.on(g.default.PLAYBACK_STARTED,we,e),le.on(g.default.PLAYBACK_PAUSED,Ne,e),le.on(g.default.PLAYBACK_ENDED,Le,e),le.on(g.default.METRIC_ADDED,Xe,e),le.on(g.default.MANIFEST_VALIDITY_CHANGED,Ve,e),le.on(g.default.BUFFER_LEVEL_UPDATED,Re,e),le.on(g.default.QUALITY_CHANGE_REQUESTED,Ie,e),u.default.KEY_SESSION_UPDATED&&le.on(u.default.KEY_SESSION_UPDATED,fe,e),le.on(u.default.MANIFEST_UPDATED,xe,e),le.on(u.default.STREAM_BUFFERING_COMPLETED,De,e),le.on(u.default.TIME_SYNCHRONIZATION_COMPLETED,ce,e),le.on(u.default.CURRENT_TRACK_CHANGED,ve,e)},getActiveStreamInfo:qe,addDVRMetric:Ae,hasVideoTrack:ke,hasAudioTrack:Be,getStreamById:Ye,getStreamForTime:be,getTimeRelativeToStreamId:function(e,t){for(var r=null,n=0,a=0,i=null,s=0;s<B.length;s++){if(a=(r=B[s]).getStartTime(),i=r.getDuration(),Number.isFinite(a)&&(n=a),r.getId()===t)return e-n;Number.isFinite(i)&&(n+=i)}return null},load:function(e){Ke(),b.load(e)},loadWithManifest:function(e){!function(){if(!S||!S.hasOwnProperty("setManifest"))throw new Error("initialize function has to be called previously")}(),S.setManifest(e)},getActiveStreamProcessors:Pe,setConfig:function(e){e&&(e.capabilities&&(r=e.capabilities),e.capabilitiesFilter&&(l=e.capabilitiesFilter),e.manifestLoader&&(b=e.manifestLoader),e.manifestModel&&(A=e.manifestModel),e.mediaPlayerModel&&(J=e.mediaPlayerModel),e.protectionController&&(G=e.protectionController),e.adapter&&(R=e.adapter),e.dashMetrics&&(I=e.dashMetrics),e.errHandler&&(x=e.errHandler),e.timelineConverter&&(k=e.timelineConverter),e.videoModel&&(X=e.videoModel),e.playbackController&&(Q=e.playbackController),e.textController&&(H=e.textController),e.abrController&&(O=e.abrController),e.mediaController&&(P=e.mediaController),e.settings&&(ae=e.settings),e.baseURLController&&(N=e.baseURLController),e.uriFragmentModel&&(M=e.uriFragmentModel),e.segmentBaseController&&(D=e.segmentBaseController))},setProtectionData:function(e){q=e,G&&G.setProtectionData(q)},getIsStreamSwitchInProgress:function(){return K},switchToVideoElement:function(e){U&&(Q.initialize(qe()),pe(e,!1))},getHasMediaOrInitialisationError:function(){return V||W},getStreams:Qe,getActiveStream:function(){return U},getInitialPlayback:function(){return Z},getAutoPlay:function(){return Y},reset:ze},t=Object(f.default)(ue).getInstance().getLogger(e),w=Object(p.default)(ue).getInstance(),C=Object(m.default)(ue).getInstance(),F=Object(d.default)(ue).getInstance(),j=Object(h.default)(ue).getInstance(),We(),e}S.__dashjs_factory_name="StreamController",t.default=l.default.getSingletonFactory(S)},"./src/streaming/controllers/TimeSyncController.js":function(e,t,r){r.r(t);var n=r("./src/streaming/vo/DashJSError.js"),a=r("./src/streaming/vo/metrics/HTTPRequest.js"),i=r("./src/core/EventBus.js"),s=r("./src/core/events/Events.js"),o=r("./src/core/errors/Errors.js"),u=r("./src/core/FactoryMaker.js"),l=r("./src/core/Debug.js"),c=r("./src/streaming/utils/URLUtils.js");function f(){var e,t,r,u,f,d,h,g,p,m,y,E,_,v,T,S,b=this.context,A=Object(i.default)(b).getInstance(),R=Object(c.default)(b).getInstance();function I(){g=[],p=[],m=null,y=null,_=null,E=NaN,r=!1,u=!1,v=f.get().streaming.utcSynchronization.timeBetweenSyncAttempts}function C(){f.get().streaming.utcSynchronization.enabled&&!r&&!u&&_&&_.value&&_.schemeIdUri&&!isNaN(E)&&!isNaN(f.get().streaming.utcSynchronization.backgroundAttempts)&&(y&&(Date.now()-y)/1e3<30||(g=[],u=!0,w(isNaN(f.get().streaming.utcSynchronization.backgroundAttempts)?2:f.get().streaming.utcSynchronization.backgroundAttempts)))}function w(e){try{if(e<=0)return void U();var t=Date.now();d[_.schemeIdUri](_.value,function(r){var n=Date.now(),a=D(t,n,r);g.push(a),w(e-1)},function(){U()})}catch(e){U()}}function N(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)||0;if(!p||0===p.length||e>=p.length)M();else{var t=p[e];if(t)if(d.hasOwnProperty(t.schemeIdUri)){var r=(new Date).getTime();d[t.schemeIdUri](t.value,function(e){var n=(new Date).getTime(),a=D(r,n,e);_=t,M(a)},function(){N(e+1)})}else N(e+1);else M()}}function D(e,t,r){return r-(t-(t-e)/2)}function M(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:NaN,n=isNaN(r);n&&f.get().streaming.utcSynchronization.useManifestDateHeaderTimeSource?(t=null!==(e=h.getLatestMPDRequestHeaderValueByID("Date"))?new Date(e).getTime():Number.NaN,isNaN(t)?B(!0):B(!1,t-Date.now())):B(n,r)}function O(e){var t=Date.parse(e);return isNaN(t)&&(t=function(e){var t,r,n=/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2})(?::([0-9]*)(\.[0-9]*)?)?(?:([+\-])([0-9]{2})([0-9]{2}))?/.exec(e);return t=Date.UTC(parseInt(n[1],10),parseInt(n[2],10)-1,parseInt(n[3],10),parseInt(n[4],10),parseInt(n[5],10),n[6]&&(parseInt(n[6],10)||0),n[7]&&1e3*parseFloat(n[7])||0),n[9]&&n[10]&&(r=60*parseInt(n[9],10)+parseInt(n[10],10),t+=("+"===n[8]?-1:1)*r*60*1e3),new Date(t).getTime()}(e)),t}function P(e){return Date.parse(e)}function L(e){return Date.parse(e)}function F(e,t,r){r()}function j(e,t,r){var n=O(e);isNaN(n)?r():t(n)}function x(e,t,r,n,i){var s,o,u=!1,l=new XMLHttpRequest,c=i?a.HTTPRequest.HEAD:a.HTTPRequest.GET,f=t.match(/\S+/g);if(t=f.shift(),s=function(){u||(u=!0,f.length?x(e,f.join(" "),r,n,i):n())},o=function(){var t,n;200===l.status&&(t=i?l.getResponseHeader("Date"):l.response,n=e(t),isNaN(n)||(r(n),u=!0))},R.isRelative(t)){var d=S.resolve();d&&(t=R.resolve(t,d.url))}l.open(c,t),l.timeout=5e3,l.onload=o,l.onloadend=s,l.send()}function k(e,t,r){x(L,e,t,r,!0)}function B(e,a){if(isNaN(E)||isNaN(a)||e||function(e){try{var r,n=G(e),a=isNaN(v)?30:v,i=isNaN(f.get().streaming.utcSynchronization.timeBetweenSyncAttemptsAdjustmentFactor)?2:f.get().streaming.utcSynchronization.timeBetweenSyncAttemptsAdjustmentFactor,s=isNaN(f.get().streaming.utcSynchronization.maximumTimeBetweenSyncAttempts)?600:f.get().streaming.utcSynchronization.maximumTimeBetweenSyncAttempts,o=isNaN(f.get().streaming.utcSynchronization.minimumTimeBetweenSyncAttempts)?2:f.get().streaming.utcSynchronization.minimumTimeBetweenSyncAttempts;n?(r=Math.min(a*i,s),t.debug("Increasing timeBetweenSyncAttempts to ".concat(r))):(r=Math.max(a/i,o),t.debug("Decreasing timeBetweenSyncAttempts to ".concat(r))),v=r}catch(e){}}(a),!e&&!isNaN(a)){m=Date.now(),r=!1;var i=isNaN(E);E=a,i&&C(),t.debug("Completed UTC sync. Setting client - server offset to ".concat(a))}e&&(_=null,r=!1,T.error(new n.default(o.default.TIME_SYNC_FAILED_ERROR_CODE,o.default.TIME_SYNC_FAILED_ERROR_MESSAGE))),A.trigger(s.default.UPDATE_TIME_SYNC_OFFSET,{offset:a}),A.trigger(s.default.TIME_SYNCHRONIZATION_COMPLETED)}function U(){if(g&&0!==g.length){var e=g.reduce(function(e,t){return e+t},0)/g.length;G(e)?t.debug("Completed background UTC sync. Offset is within allowed threshold and is not adjusted."):(t.debug("Completed background UTC sync. Setting client - server offset to ".concat(e)),E=e,A.trigger(s.default.UPDATE_TIME_SYNC_OFFSET,{offset:E})),u=!1,y=Date.now()}}function G(e){try{if(isNaN(E))return!0;var t=f.get().streaming.utcSynchronization.maximumAllowedDrift&&!isNaN(f.get().streaming.utcSynchronization.maximumAllowedDrift)?f.get().streaming.utcSynchronization.maximumAllowedDrift:100;return e>=E-t&&e<=E+t}catch(e){return!0}}return e={initialize:function(){I(),d={"urn:mpeg:dash:utc:http-head:2014":k,"urn:mpeg:dash:utc:http-xsdate:2014":x.bind(null,O),"urn:mpeg:dash:utc:http-iso:2014":x.bind(null,P),"urn:mpeg:dash:utc:direct:2014":j,"urn:mpeg:dash:utc:http-head:2012":k,"urn:mpeg:dash:utc:http-xsdate:2012":x.bind(null,O),"urn:mpeg:dash:utc:http-iso:2012":x.bind(null,P),"urn:mpeg:dash:utc:direct:2012":j,"urn:mpeg:dash:utc:http-ntp:2014":F,"urn:mpeg:dash:utc:ntp:2014":F,"urn:mpeg:dash:utc:sntp:2014":F}},attemptSync:function(e,t){p=e,r||(function(e){try{if(!e||!f.get().streaming.utcSynchronization.enabled)return!1;var t=isNaN(v)?30:v;return!(m&&t&&!isNaN(t))||(Date.now()-m)/1e3>=t}catch(e){return!0}}(t)?(r=!0,N()):A.trigger(s.default.TIME_SYNCHRONIZATION_COMPLETED))},setConfig:function(e){e&&(e.dashMetrics&&(h=e.dashMetrics),e.baseURLController&&(S=e.baseURLController),e.errHandler&&(T=e.errHandler),e.settings&&(f=e.settings))},reset:function(){I(),A.off(s.default.ATTEMPT_BACKGROUND_SYNC,C,e)}},t=Object(l.default)(b).getInstance().getLogger(e),A.on(s.default.ATTEMPT_BACKGROUND_SYNC,C,e),e}f.__dashjs_factory_name="TimeSyncController";var d=u.default.getSingletonFactory(f);d.HTTP_TIMEOUT_MS=5e3,u.default.updateSingletonFactory(f.__dashjs_factory_name,d),t.default=d},"./src/streaming/controllers/XlinkController.js":function(e,t,r){r.r(t);var n=r("./src/streaming/XlinkLoader.js"),a=r("./src/core/EventBus.js"),i=r("./src/core/events/Events.js"),s=r("./src/core/FactoryMaker.js"),o=r("./externals/xml2json.js"),u=r("./src/streaming/utils/URLUtils.js"),l=r("./src/dash/constants/DashConstants.js"),c="onLoad";function f(e){e=e||{};var t,r,s,f,d,h,g=this.context,p=Object(a.default)(g).getInstance(),m=Object(u.default)(g).getInstance();function y(e,t,r){var n,a,i={};i.elements=e,i.type=t,i.resolveType=r,0===i.elements.length&&_(i);for(var s=0;s<i.elements.length;s++)n=i.elements[s],a=m.isHTTPURL(n.url)?n.url:n.originalContent.BaseURL+n.url,h.load(a,n,i)}function E(e){var t,r,n="";if(t=e.element,r=e.resolveObject,t.resolvedContent){var a=0;0===t.resolvedContent.indexOf("<?xml")&&(a=t.resolvedContent.indexOf("?>")+2),n=t.resolvedContent.substr(0,a)+"<response>"+t.resolvedContent.substr(a)+"</response>",t.resolvedContent=d.xml_str2json(n)}(function(e){var t;for(t=0;t<e.elements.length;t++)if(!1===e.elements[t].resolved)return!1;return!0})(r)&&_(r)}function _(e){var t,r,n=[];if(function(e){var t,r,n,a,i,o,u=[];for(a=e.elements.length-1;a>=0;a--){if(r=(t=e.elements[a]).type+"_asArray",!t.resolvedContent||S())delete t.originalContent["xlink:actuate"],delete t.originalContent["xlink:href"],u.push(t.originalContent);else if(t.resolvedContent)for(i=0;i<t.resolvedContent[r].length;i++)n=t.resolvedContent[r][i],u.push(n);for(t.parentElement[r].splice(t.index,1),o=0;o<u.length;o++)t.parentElement[r].splice(t.index+o,0,u[o]);u=[]}e.elements.length>0&&s.run(f)}(e),"onActuate"===e.resolveType&&p.trigger(i.default.XLINK_READY,{manifest:f}),e.resolveType===c)switch(e.type){case l.default.PERIOD:for(t=0;t<f[l.default.PERIOD+"_asArray"].length;t++)(r=f[l.default.PERIOD+"_asArray"][t]).hasOwnProperty(l.default.ADAPTATION_SET+"_asArray")&&(n=n.concat(v(r[l.default.ADAPTATION_SET+"_asArray"],r,l.default.ADAPTATION_SET,c))),r.hasOwnProperty(l.default.EVENT_STREAM+"_asArray")&&(n=n.concat(v(r[l.default.EVENT_STREAM+"_asArray"],r,l.default.EVENT_STREAM,c)));y(n,l.default.ADAPTATION_SET,c);break;case l.default.ADAPTATION_SET:p.trigger(i.default.XLINK_READY,{manifest:f})}}function v(e,t,r,n){var a,i,s,o=[];for(i=e.length-1;i>=0;i--)(a=e[i]).hasOwnProperty("xlink:href")&&"urn:mpeg:dash:resolve-to-zero:2013"===a["xlink:href"]&&e.splice(i,1);for(i=0;i<e.length;i++)(a=e[i]).hasOwnProperty("xlink:href")&&a.hasOwnProperty("xlink:actuate")&&a["xlink:actuate"]===n&&(s=T(a["xlink:href"],t,r,i,n,a),o.push(s));return o}function T(e,t,r,n,a,i){return{url:e,parentElement:t,type:r,index:n,resolveType:a,originalContent:i,resolvedContent:null,resolved:!1}}function S(){return!1}return t={resolveManifestOnLoad:function(e){d=new o.default({escapeMode:!1,attributePrefix:"",arrayAccessForm:"property",emptyNodeForm:"object",stripWhitespaces:!1,enableToStringFunc:!1,ignoreRoot:!0,matchers:r}),(f=e).Period_asArray?y(v(f.Period_asArray,f,l.default.PERIOD,c),l.default.PERIOD,c):p.trigger(i.default.XLINK_READY,{manifest:f})},setMatchers:function(e){e&&(r=e)},setIron:function(e){e&&(s=e)},reset:function(){p.off(i.default.XLINK_ELEMENT_LOADED,E,t),h&&(h.reset(),h=null)}},p.on(i.default.XLINK_ELEMENT_LOADED,E,t),h=Object(n.default)(g).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,settings:e.settings}),t}f.__dashjs_factory_name="XlinkController",t.default=s.default.getClassFactory(f)},"./src/streaming/metrics/MetricsReporting.js":function(e,t,r){r.r(t);var n=r("./src/streaming/metrics/utils/DVBErrorsTranslator.js"),a=r("./src/streaming/metrics/MetricsReportingEvents.js"),i=r("./src/streaming/metrics/controllers/MetricsCollectionController.js"),s=r("./src/streaming/metrics/metrics/MetricsHandlerFactory.js"),o=r("./src/streaming/metrics/reporting/ReportingFactory.js");function u(){var e=this.context;return{createMetricsReporting:function(t){return Object(n.default)(e).getInstance({eventBus:t.eventBus,dashMetrics:t.dashMetrics,metricsConstants:t.metricsConstants,events:t.events}).initialise(),Object(i.default)(e).create(t)},getReportingFactory:function(){return Object(o.default)(e).getInstance()},getMetricsHandlerFactory:function(){return Object(s.default)(e).getInstance()}}}u.__dashjs_factory_name="MetricsReporting";var l=dashjs.FactoryMaker.getClassFactory(u);l.events=a.default,dashjs.FactoryMaker.updateClassFactory(u.__dashjs_factory_name,l),t.default=l},"./src/streaming/metrics/MetricsReportingEvents.js":function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}r.r(t);var s=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(o,e);var t,r,s=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,a=i(t);if(r){var s=i(this).constructor;e=Reflect.construct(a,arguments,s)}else e=a.apply(this,arguments);return function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function o(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=s.call(this)).METRICS_INITIALISATION_COMPLETE="internal_metricsReportingInitialized",e.BECAME_REPORTING_PLAYER="internal_becameReportingPlayer",e.CMCD_DATA_GENERATED="cmcdDataGenerated",e}return o}(r("./src/core/events/EventsBase.js").default));t.default=s},"./src/streaming/metrics/controllers/MetricsCollectionController.js":function(e,t,r){r.r(t);var n=r("./src/streaming/metrics/controllers/MetricsController.js"),a=r("./src/streaming/metrics/utils/ManifestParsing.js"),i=r("./src/streaming/metrics/MetricsReportingEvents.js");function s(e){var t;e=e||{};var r={},s=this.context,o=e.eventBus,u=e.events;function l(t){if(!t.error){var u=Object.keys(r);Object(a.default)(s).getInstance({adapter:e.adapter,constants:e.constants}).getMetrics(t.manifest).forEach(function(t){var a=JSON.stringify(t);if(r.hasOwnProperty(a))u.splice(a,1);else try{var i=Object(n.default)(s).create(e);i.initialize(t),r[a]=i}catch(e){}}),u.forEach(function(e){r[e].reset(),delete r[e]}),o.trigger(i.default.METRICS_INITIALISATION_COMPLETE)}}function c(){Object.keys(r).forEach(function(e){r[e].reset()}),r={}}return t={reset:function(){o.off(u.MANIFEST_UPDATED,l,t),o.off(u.STREAM_TEARDOWN_COMPLETE,c,t)}},o.on(u.MANIFEST_UPDATED,l,t),o.on(u.STREAM_TEARDOWN_COMPLETE,c,t),t}s.__dashjs_factory_name="MetricsCollectionController",t.default=dashjs.FactoryMaker.getClassFactory(s)},"./src/streaming/metrics/controllers/MetricsController.js":function(e,t,r){r.r(t);var n=r("./src/streaming/metrics/controllers/RangeController.js"),a=r("./src/streaming/metrics/controllers/ReportingController.js"),i=r("./src/streaming/metrics/controllers/MetricsHandlersController.js");function s(e){var t,r,s;e=e||{};var o=this.context;function u(){t&&t.reset(),r&&r.reset(),s&&s.reset()}return{initialize:function(l){try{(s=Object(n.default)(o).create({mediaElement:e.mediaElement})).initialize(l.Range),(r=Object(a.default)(o).create({debug:e.debug,metricsConstants:e.metricsConstants})).initialize(l.Reporting,s),(t=Object(i.default)(o).create({debug:e.debug,eventBus:e.eventBus,metricsConstants:e.metricsConstants,events:e.events})).initialize(l.metrics,r)}catch(e){throw u(),e}},reset:u}}s.__dashjs_factory_name="MetricsController",t.default=dashjs.FactoryMaker.getClassFactory(s)},"./src/streaming/metrics/controllers/MetricsHandlersController.js":function(e,t,r){r.r(t);var n=r("./src/streaming/metrics/metrics/MetricsHandlerFactory.js");function a(e){e=e||{};var t,r=[],a=this.context,i=e.eventBus,s=e.events,o=Object(n.default)(a).getInstance({debug:e.debug,eventBus:e.eventBus,metricsConstants:e.metricsConstants});function u(e){r.forEach(function(t){t.handleNewMetric(e.metric,e.value,e.mediaType)})}return t={initialize:function(e,n){e.split(",").forEach(function(e,t,a){var i;if(-1!==e.indexOf("(")&&-1===e.indexOf(")")){var s=a[t+1];s&&-1===s.indexOf("(")&&-1!==s.indexOf(")")&&(e+=","+s,delete a[t+1])}(i=o.create(e,n))&&r.push(i)}),i.on(s.METRIC_ADDED,u,t),i.on(s.METRIC_UPDATED,u,t)},reset:function(){i.off(s.METRIC_ADDED,u,t),i.off(s.METRIC_UPDATED,u,t),r.forEach(function(e){return e.reset()}),r=[]}}}a.__dashjs_factory_name="MetricsHandlersController",t.default=dashjs.FactoryMaker.getClassFactory(a)},"./src/streaming/metrics/controllers/RangeController.js":function(e,t,r){r.r(t);var n=r("./src/streaming/utils/CustomTimeRanges.js");function a(e){e=e||{};var t,r,a=!1,i=this.context,s=e.mediaElement;return t={initialize:function(e){e&&e.length&&(e.forEach(function(e){var t=e.starttime,n=t+e.duration;r.add(t,n)}),a=!!e[0]._useWallClockTime)},reset:function(){r.clear()},isEnabled:function(){var e,t=r.length;if(!t)return!0;e=a?(new Date).getTime()/1e3:s.currentTime;for(var n=0;n<t;n+=1){var i=r.start(n),o=r.end(n);if(i<=e&&e<o)return!0}return!1}},r=Object(n.default)(i).create(),t}a.__dashjs_factory_name="RangeController",t.default=dashjs.FactoryMaker.getClassFactory(a)},"./src/streaming/metrics/controllers/ReportingController.js":function(e,t,r){r.r(t);var n=r("./src/streaming/metrics/reporting/ReportingFactory.js");function a(e){var t=[],r=Object(n.default)(this.context).getInstance(e);return{initialize:function(e,n){e.some(function(e){var a=r.create(e,n);if(a)return t.push(a),!0})},reset:function(){t.forEach(function(e){return e.reset()}),t=[]},report:function(e,r){t.forEach(function(t){return t.report(e,r)})}}}a.__dashjs_factory_name="ReportingController",t.default=dashjs.FactoryMaker.getClassFactory(a)},"./src/streaming/metrics/metrics/MetricsHandlerFactory.js":function(e,t,r){r.r(t);var n=r("./src/streaming/metrics/metrics/handlers/BufferLevelHandler.js"),a=r("./src/streaming/metrics/metrics/handlers/DVBErrorsHandler.js"),i=r("./src/streaming/metrics/metrics/handlers/HttpListHandler.js"),s=r("./src/streaming/metrics/metrics/handlers/GenericMetricHandler.js");function o(e){var t,r=(e=e||{}).debug?e.debug.getLogger(t):{},o=/([a-zA-Z]*)(\(([0-9]*)(\,\s*([a-zA-Z]*))?\))?/,u=this.context,l={BufferLevel:n.default,DVBErrors:a.default,HttpList:i.default,PlayList:s.default,RepSwitchList:s.default,TcpList:s.default};return{create:function(t,n){var a,i=t.match(o);if(i){try{(a=l[i[1]](u).create({eventBus:e.eventBus,metricsConstants:e.metricsConstants})).initialize(i[1],n,i[3],i[5])}catch(e){a=null,r.error("MetricsHandlerFactory: Could not create handler for type ".concat(i[1]," with args ").concat(i[3],", ").concat(i[5]," (").concat(e.message,")"))}return a}},register:function(e,t){l[e]=t},unregister:function(e){delete l[e]}}}o.__dashjs_factory_name="MetricsHandlerFactory",t.default=dashjs.FactoryMaker.getSingletonFactory(o)},"./src/streaming/metrics/metrics/handlers/BufferLevelHandler.js":function(e,t,r){r.r(t);var n=r("./src/streaming/metrics/utils/HandlerHelpers.js");function a(e){var t,r,a,i,s;e=e||{};var o=this.context,u=Object(n.default)(o).getInstance(),l=[],c=e.metricsConstants;function f(){var e=function(){try{return Object.keys(l).map(function(e){return l[e]}).reduce(function(e,t){return e.level<t.level?e:t})}catch(e){return}}();e&&s!==e.t&&(s=e.t,t.report(a,e))}return{initialize:function(e,n,s){n&&(r=u.validateN(s),t=n,a=u.reconstructFullMetricName(e,s),i=setInterval(f,r))},reset:function(){clearInterval(i),i=null,r=0,t=null,s=null},handleNewMetric:function(e,t,r){e===c.BUFFER_LEVEL&&(l[r]=t)}}}a.__dashjs_factory_name="BufferLevelHandler",t.default=dashjs.FactoryMaker.getClassFactory(a)},"./src/streaming/metrics/metrics/handlers/DVBErrorsHandler.js":function(e,t,r){r.r(t);var n=r("./src/streaming/metrics/MetricsReportingEvents.js");t.default=dashjs.FactoryMaker.getClassFactory(function(e){var t,r=(e=e||{}).eventBus,a=e.metricsConstants;function i(){r.off(n.default.METRICS_INITIALISATION_COMPLETE,i,this),r.trigger(n.default.BECAME_REPORTING_PLAYER)}return{initialize:function(e,a){a&&(t=a,r.on(n.default.METRICS_INITIALISATION_COMPLETE,i,this))},reset:function(){t=null},handleNewMetric:function(e,r){e===a.DVB_ERRORS&&t&&t.report(e,r)}}})},"./src/streaming/metrics/metrics/handlers/GenericMetricHandler.js":function(e,t,r){function n(){var e,t;return{initialize:function(r,n){e=r,t=n},reset:function(){t=null,e=void 0},handleNewMetric:function(r,n){r===e&&t&&t.report(e,n)}}}r.r(t),n.__dashjs_factory_name="GenericMetricHandler",t.default=dashjs.FactoryMaker.getClassFactory(n)},"./src/streaming/metrics/metrics/handlers/HttpListHandler.js":function(e,t,r){r.r(t);var n=r("./src/streaming/metrics/utils/HandlerHelpers.js");function a(e){var t,r,a,i,s;e=e||{};var o=[],u=Object(n.default)(this.context).getInstance(),l=e.metricsConstants;function c(){var e=o;e.length&&t&&t.report(i,e),o=[]}return{initialize:function(e,n,o,l){n&&(r=u.validateN(o),t=n,l&&l.length&&(a=l),i=u.reconstructFullMetricName(e,o,l),s=setInterval(c,r))},reset:function(){clearInterval(s),s=null,r=null,a=null,o=[],t=null},handleNewMetric:function(e,t){e===l.HTTP_REQUEST&&(a&&a!==t.type||o.push(t))}}}a.__dashjs_factory_name="HttpListHandler",t.default=dashjs.FactoryMaker.getClassFactory(a)},"./src/streaming/metrics/reporting/ReportingFactory.js":function(e,t,r){r.r(t);var n=r("./src/streaming/metrics/reporting/reporters/DVBReporting.js");function a(e){e=e||{};var t,r={"urn:dvb:dash:reporting:2014":n.default},a=this.context,i=e.debug?e.debug.getLogger(t):{},s=e.metricsConstants;return{create:function(e,t){var n;try{(n=r[e.schemeIdUri](a).create({metricsConstants:s})).initialize(e,t)}catch(t){n=null,i.error("ReportingFactory: could not create Reporting with schemeIdUri ".concat(e.schemeIdUri," (").concat(t.message,")"))}return n},register:function(e,t){r[e]=t},unregister:function(e){delete r[e]}}}a.__dashjs_factory_name="ReportingFactory",t.default=dashjs.FactoryMaker.getSingletonFactory(a)},"./src/streaming/metrics/reporting/reporters/DVBReporting.js":function(e,t,r){r.r(t);var n=r("./src/streaming/metrics/utils/MetricSerialiser.js"),a=r("./src/streaming/metrics/utils/RNG.js");function i(e){var t;e=e||{};var r,i,s,o,u,l,c=this.context,f=[],d=e.metricsConstants;function h(){s=!1,o=!1,u=null,l=null}return t={report:function(e,t){Array.isArray(t)||(t=[t]),o&&l.isEnabled()&&t.forEach(function(t){var n=r.serialise(t);e!==d.DVB_ERRORS&&(n="metricname=".concat(e,"&").concat(n)),function(e,t,r){var n=new XMLHttpRequest,a=function(){var e=f.indexOf(n);-1!==e&&(f.splice(e,1),!(n.status>=200&&n.status<300)&&(r&&r()))};f.push(n);try{n.open("GET",e),n.onloadend=a,n.onerror=a,n.send()}catch(e){n.onerror()}}(n="".concat(u,"?").concat(n),0,function(){o=!1})})},initialize:function(e,t){var r;if(l=t,!(u=e.dvb_reportingUrl))throw new Error("required parameter missing (dvb:reportingUrl)");s||((r=e.dvb_probability)&&(1e3===r||r/1e3>=i.random())&&(o=!0),s=!0)},reset:function(){h()}},r=Object(n.default)(c).getInstance(),i=Object(a.default)(c).getInstance(),h(),t}i.__dashjs_factory_name="DVBReporting",t.default=dashjs.FactoryMaker.getClassFactory(i)},"./src/streaming/metrics/utils/DVBErrorsTranslator.js":function(e,t,r){r.r(t);var n=r("./src/streaming/metrics/vo/DVBErrors.js"),a=r("./src/streaming/metrics/MetricsReportingEvents.js");function i(e){var t,r,i=(e=e||{}).eventBus,s=e.dashMetrics,o=e.metricsConstants,u=e.events;function l(e){var t=new n.default;if(r){for(var a in e)e.hasOwnProperty(a)&&(t[a]=e[a]);t.mpdurl||(t.mpdurl=r.originalUrl||r.url),t.terror||(t.terror=new Date),s.addDVBErrors(t)}}function c(e){e.error||(r=e.manifest)}function f(e){l({errorcode:n.default.BASE_URL_CHANGED,servicelocation:e.entry})}function d(){l({errorcode:n.default.BECAME_REPORTER})}function h(e){var t;e.metric===o.HTTP_REQUEST&&(0===(t=e.value).responsecode||null==t.responsecode||t.responsecode>=400||t.responsecode<100||t.responsecode>=600)&&l({errorcode:t.responsecode||n.default.CONNECTION_ERROR,url:t.url,terror:t.tresponse,servicelocation:t._serviceLocation})}function g(e){var t;switch(e.error?e.error.code:0){case MediaError.MEDIA_ERR_NETWORK:t=n.default.CONNECTION_ERROR;break;case MediaError.MEDIA_ERR_DECODE:t=n.default.CORRUPT_MEDIA_OTHER;break;default:return}l({errorcode:t})}return t={initialise:function(){i.on(u.MANIFEST_UPDATED,c,t),i.on(u.SERVICE_LOCATION_BLACKLIST_CHANGED,f,t),i.on(u.METRIC_ADDED,h,t),i.on(u.METRIC_UPDATED,h,t),i.on(u.PLAYBACK_ERROR,g,t),i.on(a.default.BECAME_REPORTING_PLAYER,d,t)},reset:function(){i.off(u.MANIFEST_UPDATED,c,t),i.off(u.SERVICE_LOCATION_BLACKLIST_CHANGED,f,t),i.off(u.METRIC_ADDED,h,t),i.off(u.METRIC_UPDATED,h,t),i.off(u.PLAYBACK_ERROR,g,t),i.off(a.default.BECAME_REPORTING_PLAYER,d,t)}}}i.__dashjs_factory_name="DVBErrorsTranslator",t.default=dashjs.FactoryMaker.getSingletonFactory(i)},"./src/streaming/metrics/utils/HandlerHelpers.js":function(e,t,r){function n(){return{reconstructFullMetricName:function(e,t,r){var n=e;return t&&(n+="("+t,r&&r.length&&(n+=","+r),n+=")"),n},validateN:function(e){if(!e)throw new Error("missing n");if(isNaN(e))throw new Error("n is NaN");if(e<0)throw new Error("n must be positive");return e}}}r.r(t),n.__dashjs_factory_name="HandlerHelpers",t.default=dashjs.FactoryMaker.getSingletonFactory(n)},"./src/streaming/metrics/utils/ManifestParsing.js":function(e,t,r){r.r(t);var n=r("./src/streaming/metrics/vo/Metrics.js"),a=r("./src/streaming/metrics/vo/Range.js"),i=r("./src/streaming/metrics/vo/Reporting.js");function s(e){var t=(e=e||{}).adapter,r=e.constants;return{getMetrics:function(e){var s=[];return e&&e.Metrics_asArray&&e.Metrics_asArray.forEach(function(o){var u=new n.default,l=t.getIsDynamic(e);o.hasOwnProperty("metrics")&&(u.metrics=o.metrics,o.Range_asArray&&o.Range_asArray.forEach(function(n){var i=new a.default;i.starttime=function(e,n,a){var i,s,o=0;return n?o=t.getAvailabilityStartTime(e)/1e3:(i=t.getRegularPeriods(e)).length&&(o=i[0].start),s=o,a&&a.hasOwnProperty(r.START_TIME)&&(s+=a.starttime),s}(e,l,n),n.hasOwnProperty("duration")?i.duration=n.duration:i.duration=t.getDuration(e),i._useWallClockTime=l,u.Range.push(i)}),o.Reporting_asArray&&(o.Reporting_asArray.forEach(function(e){var t=new i.default;e.hasOwnProperty(r.SCHEME_ID_URI)&&(t.schemeIdUri=e.schemeIdUri,e.hasOwnProperty("value")&&(t.value=e.value),e.hasOwnProperty(r.DVB_REPORTING_URL)&&(t.dvb_reportingUrl=e[r.DVB_REPORTING_URL]),e.hasOwnProperty(r.DVB_PROBABILITY)&&(t.dvb_probability=e[r.DVB_PROBABILITY]),u.Reporting.push(t))}),s.push(u)))}),s}}}s.__dashjs_factory_name="ManifestParsing",t.default=dashjs.FactoryMaker.getSingletonFactory(s)},"./src/streaming/metrics/utils/MetricSerialiser.js":function(e,t,r){function n(){return{serialise:function e(t){var r,n,a=[],i=[];for(r in t)if(t.hasOwnProperty(r)&&0!==r.indexOf("_")){if(null==(n=t[r])&&(n=""),Array.isArray(n)){if(!n.length)continue;i=[],n.forEach(function(t){var r="Object"!==Object.prototype.toString.call(t).slice(8,-1);i.push(r?t:e(t))}),n=i.map(encodeURIComponent).join(",")}else"string"==typeof n?n=encodeURIComponent(n):n instanceof Date?n=n.toISOString():"number"==typeof n&&(n=Math.round(n));a.push(r+"="+n)}return a.join("&")}}}r.r(t),n.__dashjs_factory_name="MetricSerialiser",t.default=dashjs.FactoryMaker.getSingletonFactory(n)},"./src/streaming/metrics/utils/RNG.js":function(e,t,r){function n(){var e,t,r,n=window.crypto||window.msCrypto,a=Uint32Array,i=Math.pow(2,8*a.BYTES_PER_ELEMENT)-1;function s(){n&&(e||(e=new a(10)),n.getRandomValues(e),t=0)}return r={random:function(r,a){var o;return r||(r=0),a||(a=1),n?(t===e.length&&s(),o=e[t]/i,t+=1):o=Math.random(),o*(a-r)+r}},s(),r}r.r(t),n.__dashjs_factory_name="RNG",t.default=dashjs.FactoryMaker.getSingletonFactory(n)},"./src/streaming/metrics/vo/DVBErrors.js":function(e,t,r){r.r(t);var n=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mpdurl=null,this.errorcode=null,this.terror=null,this.url=null,this.ipaddress=null,this.servicelocation=null};n.SSL_CONNECTION_FAILED_PREFIX="SSL",n.DNS_RESOLUTION_FAILED="C00",n.HOST_UNREACHABLE="C01",n.CONNECTION_REFUSED="C02",n.CONNECTION_ERROR="C03",n.CORRUPT_MEDIA_ISOBMFF="M00",n.CORRUPT_MEDIA_OTHER="M01",n.BASE_URL_CHANGED="F00",n.BECAME_REPORTER="S00",t.default=n},"./src/streaming/metrics/vo/Metrics.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.metrics="",this.Range=[],this.Reporting=[]}},"./src/streaming/metrics/vo/Range.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.starttime=0,this.duration=1/0,this._useWallClockTime=!1}},"./src/streaming/metrics/vo/Reporting.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.schemeIdUri="",this.value="",this.dvb_reportingUrl="",this.dvb_probability=1e3}},"./src/streaming/models/BaseURLTreeModel.js":function(e,t,r){r.r(t);var n=r("./src/streaming/utils/ObjectUtils.js"),a=r("./src/core/FactoryMaker.js"),i=NaN,s=function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.data={baseUrls:t||null,selectedIdx:r||i},this.children=[]};function o(){var e,t,r,a=this.context,o=Object(n.default)(a).getInstance();function u(e,t,n){var a=r.getBaseURLsFromElement(n);e[t]?o.areEqual(a,e[t].data.baseUrls)||(e[t].data.baseUrls=a,e[t].data.selectedIdx=i):e[t]=new s(a)}function l(e,r){var n=r||t;e(n.data),n.children&&n.children.forEach(function(t){return l(e,t)})}function c(){t=new s}return e={reset:c,update:function(e){!function(e){!function(){if(!r||!r.hasOwnProperty("getBaseURLsFromElement")||!r.hasOwnProperty("getRepresentationSortFunction"))throw new Error("setConfig function has to be called previously")}();var n=r.getBaseURLsFromElement(e);o.areEqual(n,t.data.baseUrls)||(t.data.baseUrls=n,t.data.selectedIdx=i),e&&e.Period_asArray&&e.Period_asArray.forEach(function(e,n){u(t.children,n,e),e.AdaptationSet_asArray&&e.AdaptationSet_asArray.forEach(function(e,a){u(t.children[n].children,a,e),e.Representation_asArray&&e.Representation_asArray.sort(r.getRepresentationSortFunction()).forEach(function(e,r){u(t.children[n].children[a].children,r,e)})})})}(e)},getForPath:function(e){var r=t,n=[r.data];return e&&e.forEach(function(e){(r=r.children[e])&&n.push(r.data)}),n.filter(function(e){return e.baseUrls.length})},invalidateSelectedIndexes:function(e){l(function(t){isNaN(t.selectedIdx)||e===t.baseUrls[t.selectedIdx].serviceLocation&&(t.selectedIdx=i)})},setConfig:function(e){e.adapter&&(r=e.adapter)}},c(),e}o.__dashjs_factory_name="BaseURLTreeModel",t.default=a.default.getClassFactory(o)},"./src/streaming/models/CmcdModel.js":function(e,t,r){r.r(t);var n=r("./src/core/EventBus.js"),a=r("./src/streaming/MediaPlayerEvents.js"),i=r("./src/streaming/metrics/MetricsReportingEvents.js"),s=r("./src/core/FactoryMaker.js"),o=r("./src/core/Settings.js"),u=r("./src/streaming/constants/Constants.js"),l=r("./src/streaming/vo/metrics/HTTPRequest.js"),c=r("./src/dash/models/DashManifestModel.js"),f=r("./src/core/Utils.js");function d(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return h(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?h(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,o=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return s=e.done,e},e:function(e){o=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(o)throw i}}}}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function g(){var e,t,r,s,h,g,p,m,y,E,_=this.context,v=Object(n.default)(_).getInstance(),T=Object(o.default)(_).getInstance();function S(){r={pr:1,nor:null,st:null,sf:null,sid:"".concat(f.default.generateUuid()),cid:null},y={},m={},E={},A()}function b(){A()}function A(){if(g){var e=g.getStreamController();if(e&&"function"==typeof e.getActiveStream){var t=e.getActiveStream();t&&(p=t.getProcessors())}}}function R(e,t){var r,n={},a=d(t);try{for(a.s();!(r=a.n()).done;){var i=r.value;e[i]&&(n[i]=e[i])}}catch(e){a.e(e)}finally{a.f()}return n}function I(e){try{return e.type===l.HTTPRequest.MPD_TYPE?((n=C()).ot="m",n):e.type===l.HTTPRequest.MEDIA_SEGMENT_TYPE?(t=e.mediaType,E.hasOwnProperty(t)||(E[t]=!1),m.hasOwnProperty(t)||(m[t]=!1),y.hasOwnProperty(t)||(y[t]=!1),function(e){var t,n=C(),a=function(e){try{var t=e.quality,r=e.mediaInfo.bitrateList;return parseInt(r[t].bandwidth/1e3)}catch(e){return null}}(e),i=function(e){try{return isNaN(e.duration)?null:Math.round(1e3*e.duration)}catch(e){return null}}(e),o=function(e){try{return 100*parseInt(s.getThroughputHistory().getSafeAverageThroughput(e)/100)}catch(e){return null}}(e.mediaType),l=function(e){try{var t=r.pr,n=h.getCurrentBufferLevel(e);return isNaN(t)||isNaN(n)?null:100*parseInt(n/t*10)}catch(e){return null}}(e.mediaType),c=w(e.mediaType),_=function(e){try{var t=s.getTopBitrateInfoFor(e);return Math.round(t.bitrate/1e3)}catch(e){return null}}(e.mediaType),v=r.pr,S=function(e){if(p&&0!==p.length){var t,r=d(p);try{for(r.s();!(t=r.n()).done;){var n=t.value;if(n.getType()===e)return n.probeNextRequest()}}catch(e){r.e(e)}finally{r.f()}}}(e.mediaType);e.mediaType===u.default.VIDEO&&(t="v"),e.mediaType===u.default.AUDIO&&(t="a"),e.mediaType===u.default.TEXT&&(t="application/mp4"===e.mediaInfo.mimeType?"tt":"c");var b=T.get().streaming.cmcd.rtp;return b||(b=function(e){var t=g.getPlaybackRate();t||(t=1);var r=e.quality,n=e.mediaType,a=e.mediaInfo,i=e.duration,s=w(n);0===s&&(s=500);var o=a.bitrateList[r].bandwidth*i/1e3/(s/t/1e3),u=T.get().streaming.cmcd.rtpSafetyFactor&&!isNaN(T.get().streaming.cmcd.rtpSafetyFactor)?T.get().streaming.cmcd.rtpSafetyFactor:5;return 100*(parseInt(o*u/100)+1)}(e)),n.rtp=b,S&&(e.url!==S.url?n.nor=encodeURIComponent(f.default.getRelativeUrl(e.url,S.url)):S.range&&(n.nrr=S.range)),a&&(n.br=a),t&&(n.ot=t),isNaN(i)||(n.d=i),isNaN(o)||(n.mtp=o),isNaN(l)||(n.dl=l),isNaN(c)||(n.bl=c),isNaN(_)||(n.tb=_),isNaN(v)||1===v||(n.pr=v),y[e.mediaType]&&(n.bs=!0,y[e.mediaType]=!1),!m[e.mediaType]&&E[e.mediaType]||(n.su=!0,m[e.mediaType]=!1,E[e.mediaType]=!0),n}(e)):e.type===l.HTTPRequest.INIT_SEGMENT_TYPE?function(){var e=C();return e.ot="i",e.su=!0,e}():e.type===l.HTTPRequest.OTHER_TYPE||e.type===l.HTTPRequest.XLINK_EXPANSION_TYPE?function(){var e=C();return e.ot="o",e}():e.type===l.HTTPRequest.LICENSE?function(){var e=C();return e.ot="k",e}():null}catch(e){return null}var t,n}function C(){var e={},t=T.get().streaming.cmcd.cid?T.get().streaming.cmcd.cid:r.cid;return e.v=1,e.sid=T.get().streaming.cmcd.sid?T.get().streaming.cmcd.sid:r.sid,e.sid="".concat(e.sid),t&&(e.cid="".concat(t)),isNaN(r.pr)||1===r.pr||null===r.pr||(e.pr=r.pr),r.st&&(e.st=r.st),r.sf&&(e.sf=r.sf),e}function w(e){try{var t=h.getCurrentBufferLevel(e);return isNaN(t)?null:100*parseInt(10*t)}catch(e){return null}}function N(e){try{r.pr=e.playbackRate}catch(e){}}function D(t){try{var n=e.getIsDynamic(t.data)?"l":"v",a=t.protocol&&"MSS"===t.protocol?"s":"d";r.st="".concat(n),r.sf="".concat(a)}catch(e){}}function M(e){try{e.state&&e.mediaType&&e.state===a.default.BUFFER_EMPTY&&(y[e.mediaType]||(y[e.mediaType]=!0),m[e.mediaType]||(m[e.mediaType]=!0))}catch(e){}}function O(){for(var e in y)y.hasOwnProperty(e)&&(y[e]=!0);for(var t in m)m.hasOwnProperty(t)&&(m[t]=!0)}function P(e){try{if(!e)return null;var t=Object.keys(e).sort(function(e,t){return e.localeCompare(t)}),r=t.length,n=t.reduce(function(t,n,a){if("v"===n&&1===e[n])return t;if("string"==typeof e[n]&&"ot"!==n&&"sf"!==n&&"st"!==n){var i=e[n].replace(/"/g,'"');t+="".concat(n,'="').concat(i,'"')}else t+="".concat(n,"=").concat(e[n]);return a<r-1&&(t+=","),t},"");return(n=n.replace(/=true/g,"")).replace(/,\s*$/,"")}catch(e){return null}}return t={getQueryParameter:function(e){try{if(T.get().streaming.cmcd&&T.get().streaming.cmcd.enabled){var t=I(e),r=P(t);return v.trigger(i.default.CMCD_DATA_GENERATED,{url:e.url,mediaType:e.mediaType,cmcdData:t,cmcdString:r}),{key:"CMCD",value:r}}return null}catch(e){return null}},getHeaderParameters:function(e){try{if(T.get().streaming.cmcd&&T.get().streaming.cmcd.enabled){var t=I(e),r=R(t,["br","d","ot","tb"]),n=R(t,["bl","dl","mtp","nor","nrr","su"]),a=R(t,["bs","rtp"]),s=R(t,["cid","pr","sf","sid","st","v"]),o={"CMCD-Object":P(r),"CMCD-Request":P(n),"CMCD-Status":P(a),"CMCD-Session":P(s)};return v.trigger(i.default.CMCD_DATA_GENERATED,{url:e.url,mediaType:e.mediaType,cmcdData:t,headers:o}),o}return null}catch(e){return null}},setConfig:function(e){e&&(e.abrController&&(s=e.abrController),e.dashMetrics&&(h=e.dashMetrics),e.playbackController&&(g=e.playbackController))},reset:function(){v.off(a.default.PLAYBACK_RATE_CHANGED,N,this),v.off(a.default.MANIFEST_LOADED,D,this),v.off(a.default.BUFFER_LEVEL_STATE_CHANGED,M,t),v.off(a.default.PLAYBACK_SEEKED,O,t),S()},initialize:function(){v.on(a.default.PLAYBACK_RATE_CHANGED,N,t),v.on(a.default.MANIFEST_LOADED,D,t),v.on(a.default.BUFFER_LEVEL_STATE_CHANGED,M,t),v.on(a.default.PLAYBACK_SEEKED,O,t),v.on(a.default.PERIOD_SWITCH_COMPLETED,b,t)}},e=Object(c.default)(_).getInstance(),S(),t}g.__dashjs_factory_name="CmcdModel",t.default=s.default.getSingletonFactory(g)},"./src/streaming/models/FragmentModel.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/streaming/vo/FragmentRequest.js"),i="loading",s="executed",o="failed";function u(e){var t,r,n,u,l=(e=e||{}).eventBus,c=e.events,f=e.dashMetrics,d=e.fragmentLoader,h=e.debug,g=e.streamInfo,p=e.type;function m(e){var t;return!!e&&(t=!1,n.some(function(r){if(n=e,i=r,!isNaN(n.index)&&n.startTime===i.startTime&&n.adaptationIndex===i.adaptationIndex&&n.type===i.type||function(e,t){return isNaN(e.index)&&isNaN(t.index)&&e.quality===t.quality}(e,r)||function(e,t){return e.action===a.default.ACTION_COMPLETE&&e.action===t.action}(e,r))return t=!0;var n,i}),t)}function y(e){return isNaN(e.duration)?.25:Math.min(e.duration/8,.5)}function E(e){n=n.filter(function(t){var r=y(t);return isNaN(t.startTime)||void 0!==e&&t.startTime>=e-r})}function _(e,t){t<=e+.5||(n=n.filter(function(r){var n=y(r);return isNaN(r.startTime)||r.startTime>=t-n||isNaN(r.duration)||r.startTime+r.duration<=e+n}))}function v(e,t,r){for(var n=e.length-1;n>=0;n--){var a=e[n],i=a.startTime,s=i+a.duration;if(r=isNaN(r)?y(a):r,!isNaN(i)&&!isNaN(s)&&t+r>=i&&t-r<s||isNaN(i)&&isNaN(t))return a}return null}function T(e,t){f.addSchedulingInfo(e,t),f.addRequestsQueue(e.mediaType,u,n)}function S(e){e.sender===d&&(u.splice(u.indexOf(e.request),1),e.response&&!e.error&&n.push(e.request),T(e.request,e.error?o:s),l.trigger(c.FRAGMENT_LOADING_COMPLETED,{request:e.request,response:e.response,error:e.error,sender:this},{streamId:g.id,mediaType:p}))}function b(e){e.sender===d&&l.trigger(c.FRAGMENT_LOADING_PROGRESS,{request:e.request,response:e.response,error:e.error,sender:this},{streamId:g.id,mediaType:p})}function A(e){e.sender===d&&l.trigger(c.FRAGMENT_LOADING_ABANDONED,{request:e.request},{streamId:g.id,mediaType:p})}function R(){n=[],u=[]}return t={getStreamId:function(){return g.id},getType:function(){return p},getRequests:function(e){var t=e?e.state instanceof Array?e.state:[e.state]:[],r=[];return t.forEach(function(t){var a=function(e){var t;switch(e){case i:t=u;break;case s:t=n;break;default:t=[]}return t}(t);r=r.concat(function(e,t){return t.hasOwnProperty("time")?[v(e,t.time,t.threshold)]:e.filter(function(e){for(var r in t)if("state"!==r&&t.hasOwnProperty(r)&&e[r]!=t[r])return!1;return!0})}(a,e))}),r},isFragmentLoaded:m,isFragmentLoadedOrPending:function(e){var t,r=!1,n=0;if(!(r=m(e)))for(n=0;n<u.length;n++)t=u[n],e.url===t.url&&e.startTime===t.startTime&&(r=!0);return r},removeExecutedRequestsBeforeTime:E,removeExecutedRequestsAfterTime:function(e){n=n.filter(function(t){return isNaN(t.startTime)||void 0!==e&&t.startTime<e})},syncExecutedRequestsWithBufferedRange:function(e,t){if(e&&0!==e.length){for(var r=0,n=0,a=e.length;n<a;n++)_(r,e.start(n)),r=e.end(n);t>0&&_(r,t)}else E()},abortRequests:function(){r.debug("abort requests"),d.abort(),u=[]},executeRequest:function(e){e.action===a.default.ACTION_DOWNLOAD?(T(e,i),u.push(e),function(e){l.trigger(c.FRAGMENT_LOADING_STARTED,{request:e},{streamId:g.id,mediaType:p}),d.load(e)}(e)):r.warn("Unknown request action.")},reset:function(){l.off(c.LOADING_COMPLETED,S,this),l.off(c.LOADING_DATA_PROGRESS,b,this),l.off(c.LOADING_ABANDONED,A,this),d&&d.reset(),R()},resetInitialSettings:R,addExecutedRequest:function(e){n.push(e)}},r=h.getLogger(t),R(),l.on(c.LOADING_COMPLETED,S,t),l.on(c.LOADING_DATA_PROGRESS,b,t),l.on(c.LOADING_ABANDONED,A,t),t}u.__dashjs_factory_name="FragmentModel";var l=n.default.getClassFactory(u);l.FRAGMENT_MODEL_LOADING=i,l.FRAGMENT_MODEL_EXECUTED=s,l.FRAGMENT_MODEL_CANCELED="canceled",l.FRAGMENT_MODEL_FAILED=o,n.default.updateClassFactory(u.__dashjs_factory_name,l),t.default=l},"./src/streaming/models/LowLatencyThroughputModel.js":function(e,t,r){r.r(t);var n=r("./src/core/Debug.js"),a=r("./src/core/FactoryMaker.js");function i(){var e,t,r=this.context,a={};function i(){t=Object(n.default)(r).getInstance().getLogger(e)}function s(e){for(var t={},r=0,n=0,a=0,i=0,s=e.length,o=0;o<s;++o)r+=e[o].chunkDownloadTimeRelativeMS,n+=e[o].bufferLevel,a+=e[o].chunkDownloadTimeRelativeMS*e[o].bufferLevel,i+=e[o].chunkDownloadTimeRelativeMS*e[o].chunkDownloadTimeRelativeMS;return t.m=(a-r*n/s)/(i-r*r/s),t.b=n/s-t.m*r/s,function(e){return t.m*e+t.b}}function o(e){var t,r=!0,n=e.reduce(function(e,t){return e+t.bufferLevelAtSegmentEnd},0)/e.length;return e.forEach(function(e){Math.abs(e.bufferLevelAtSegmentEnd/e.bufferLevelAtSegmentStart)<.95&&(r=!1),e.bufferLevelAtSegmentEnd/n<.8&&(r=!1),t?t>e.bitrate&&(r=!1):t=e.bitrate}),r}return e={setup:i,addMeasurement:function(e,t,r,n,i){e&&e.mediaType&&!a[e.mediaType]&&(a[e.mediaType]=[]);var o=e.mediaInfo.bitrateList.find(function(t){return t.id===e.representationId});a[e.mediaType].push({index:e.index,repId:e.representationId,mediaType:e.mediaType,requestTimeMS:n,adjustedAvailabilityStartTimeMS:e.availabilityStartTime.getTime(),segDurationMS:1e3*e.duration,chunksDurationMS:r.reduce(function(e,t){return e+t.chunkDownloadDurationMS},0),segmentBytes:r.reduce(function(e,t){return e+t.chunkBytes},0),bitrate:o&&o.bandwidth,bitrateList:e.mediaInfo.bitrateList,chunkMeasurements:r,fetchDownloadDurationMS:t,throughputCapacityDelayMS:i,getEstimatedBufferLevel:s(r.slice(1))}),a[e.mediaType].length>10&&a[e.mediaType].shift()},getThroughputCapacityDelayMS:function(e,t){var r=a[e.mediaType]&&a[e.mediaType].slice(-3);return!r||r.length<3?0:o(r)?t/4>250?250:t/4:0},getEstimatedDownloadDurationMS:function(e){var r=a[e.mediaType].slice(-1).pop(),n=a[e.mediaType].slice(-3),i=r.chunkMeasurements.slice(-1).pop().chunkDownloadTimeRelativeMS;r.bufferLevelAtSegmentStart=r.getEstimatedBufferLevel(i/2),r.bufferLevelAtSegmentEnd=r.getEstimatedBufferLevel(i);var s=o(n),u=s?.6:.8;if(r.isBufferStable&&1.05*r.segDurationMS<r.fetchDownloadDurationMS)return r.fetchDownloadDurationMS;if(!s||r.segDurationMS<r.fetchDownloadDurationMS)return.8*r.fetchDownloadDurationMS;if(r.adjustedAvailabilityStartTimeMS<=r.requestTimeMS+r.throughputCapacityDelayMS-r.segDurationMS)return.8*r.fetchDownloadDurationMS;for(var l=r.requestTimeMS+r.throughputCapacityDelayMS-r.adjustedAvailabilityStartTimeMS,c=0,f=0,d=0,h=0;h<r.chunkMeasurements.length;h++){var g=r.chunkMeasurements[h];if(l<f+g.chunkDownloadDurationMS)break;f+=g.chunkDownloadDurationMS,c+=g.chunkBytes,d++}if(l<0&&t.warn("request time was before adjusted availibitly start time"),c&&f&&d>.2*r.chunkMeasurements.length){var p=c/f,m=r.segmentBytes/p;return r.fetchDownloadDurationMS<m?r.fetchDownloadDurationMS*u:m*u}var y=r.bitrate;return r.bitrateList.some(function(e){if(e.bandwidth>r.bitrate)return y=e.bandwidth,!0}),y===r.bitrate?r.fetchDownloadDurationMS*u:u*r.segmentBytes*8*1e3/y}},i(),e}i.__dashjs_factory_name="LowLatencyThroughputModel",t.default=a.default.getSingletonFactory(i)},"./src/streaming/models/ManifestModel.js":function(e,t,r){r.r(t);var n=r("./src/core/EventBus.js"),a=r("./src/core/events/Events.js"),i=r("./src/core/FactoryMaker.js");function s(){var e,t=this.context,r=Object(n.default)(t).getInstance();return{getValue:function(){return e},setValue:function(t){e=t,t&&r.trigger(a.default.MANIFEST_LOADED,{data:t})}}}s.__dashjs_factory_name="ManifestModel",t.default=i.default.getSingletonFactory(s)},"./src/streaming/models/MediaPlayerModel.js":function(e,t,r){r.r(t);var n=r("./src/dash/vo/UTCTiming.js"),a=r("./src/core/FactoryMaker.js"),i=r("./src/streaming/constants/Constants.js"),s=r("./src/streaming/rules/abr/ABRRulesCollection.js"),o=r("./src/core/Settings.js"),u=r("./src/streaming/utils/SupervisorTools.js");function l(){var e,t,r,a,l=this.context,c=Object(o.default)(l).getInstance();function f(e){var t;for(t=0;t<a.length;t++)if(a[t].rulename===e)return t;return-1}function d(){if(c.get().streaming.lowLatencyEnabled)return h();var e=c.get().streaming.buffer.stableBufferTime;return e>0?e:c.get().streaming.buffer.fastSwitchEnabled?20:12}function h(){return c.get().streaming.lowLatencyEnabled?c.get().streaming.delay.liveDelay||3:c.get().streaming.delay.liveDelay}function g(e,r){p(e,r);var a=new n.default;a.schemeIdUri=e,a.value=r,t.push(a)}function p(e,r){Object(u.checkParameterType)(e,"string"),Object(u.checkParameterType)(r,"string"),t.forEach(function(n,a){n.schemeIdUri===e&&n.value===r&&t.splice(a,1)})}return e={getABRCustomRules:function(){return a},addABRCustomRule:function(e,t,r){if("string"!=typeof e||e!==s.default.ABANDON_FRAGMENT_RULES&&e!==s.default.QUALITY_SWITCH_RULES||"string"!=typeof t)throw i.default.BAD_ARGUMENT_ERROR;var n=f(t);-1===n?a.push({type:e,rulename:t,rule:r}):(a[n].type=e,a[n].rule=r)},removeABRCustomRule:function(e){if(e){var t=f(e);-1!==t&&a.splice(t,1)}else a=[]},getStableBufferTime:d,getInitialBufferLevel:function(){var e=c.get().streaming.buffer.initialBufferLevel;return isNaN(e)||e<0?0:Math.min(d(),e)},getRetryAttemptsForType:function(e){var t=isNaN(c.get().streaming.retryAttempts.lowLatencyMultiplyFactor)?5:c.get().streaming.retryAttempts.lowLatencyMultiplyFactor;return c.get().streaming.lowLatencyEnabled?c.get().streaming.retryAttempts[e]*t:c.get().streaming.retryAttempts[e]},getRetryIntervalsForType:function(e){var t=isNaN(c.get().streaming.retryIntervals.lowLatencyReductionFactor)?10:c.get().streaming.retryIntervals.lowLatencyReductionFactor;return c.get().streaming.lowLatencyEnabled?c.get().streaming.retryIntervals[e]/t:c.get().streaming.retryIntervals[e]},getLiveDelay:h,getLiveCatchupLatencyThreshold:function(){try{var e=c.get().streaming.liveCatchup.latencyThreshold,t=h();if(null!==e&&!isNaN(e))return Math.max(e,t);var r=c.get().streaming.liveCatchup.minDrift,n=!isNaN(t)&&t?isNaN(r)?h():c.get().streaming.liveCatchup.minDrift+h():NaN;return n&&!isNaN(n)?Math.max(4*n,5):NaN}catch(e){return NaN}},addUTCTimingSource:g,removeUTCTimingSource:p,getUTCTimingSources:function(){return t},clearDefaultUTCTimingSources:function(){t=[]},restoreDefaultUTCTimingSources:function(){var e=c.get().streaming.utcSynchronization.defaultTimingSource;g(e.scheme,e.value)},setXHRWithCredentialsForType:function e(t,n){t?r[t]=!!n:Object.keys(r).forEach(function(t){e(t,n)})},getXHRWithCredentialsForType:function(e){var t=r[e];return void 0===t?r.default:t},getDefaultUtcTimingSource:function(){return c.get().streaming.utcSynchronization.defaultTimingSource},reset:function(){}},t=[],r={default:!1},a=[],e}l.__dashjs_factory_name="MediaPlayerModel",t.default=a.default.getSingletonFactory(l)},"./src/streaming/models/MetricsModel.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/Constants.js"),a=r("./src/streaming/constants/MetricsConstants.js"),i=r("./src/streaming/vo/MetricsList.js"),s=r("./src/streaming/vo/metrics/HTTPRequest.js"),o=r("./src/streaming/vo/metrics/RepresentationSwitch.js"),u=r("./src/streaming/vo/metrics/BufferLevel.js"),l=r("./src/streaming/vo/metrics/BufferState.js"),c=r("./src/streaming/vo/metrics/DVRInfo.js"),f=r("./src/streaming/vo/metrics/DroppedFrames.js"),d=r("./src/streaming/vo/metrics/ManifestUpdate.js"),h=r("./src/streaming/vo/metrics/SchedulingInfo.js"),g=r("./src/core/EventBus.js"),p=r("./src/streaming/vo/metrics/RequestsQueue.js"),m=r("./src/core/events/Events.js"),y=r("./src/core/FactoryMaker.js");function E(e){var t,r,y=(e=e||{}).settings,E=this.context,_=Object(g.default)(E).getInstance();function v(){_.trigger(m.default.METRICS_CHANGED)}function T(e){_.trigger(m.default.METRIC_CHANGED,{mediaType:e}),v()}function S(e,t,r){_.trigger(m.default.METRIC_UPDATED,{mediaType:e,metric:t,value:r}),T(e)}function b(e,t,r){_.trigger(m.default.METRIC_ADDED,{mediaType:e,metric:t,value:r}),T(e)}function A(e,t){var n=null;return e?(r.hasOwnProperty(e)?n=r[e]:t||(n=new i.default,r[e]=n),n):n}function R(e,t,r){var n=A(e);null!==n&&(n[t].push(r),n[t].length>y.get().streaming.metrics.maxListDepth&&n[t].shift())}function I(e,t,r){R(e,t,r),b(e,t,r)}return t={clearCurrentMetricsForType:function(e){delete r[e],T(e)},clearAllCurrentMetrics:function(){r={},v()},getMetricsFor:A,addHttpRequest:function e(t,r,n,i,o,u,l,c,f,d,h,g,p,m,y){var E=new s.HTTPRequest;u&&u!==i&&(e(t,null,n,i,o,null,null,c,f,null,null,null,p,null,null),E.actualurl=u),E.tcpid=r,E.type=n,E.url=i,E.range=c,E.trequest=f,E.tresponse=d,E.responsecode=g,E._tfinish=h,E._stream=t,E._mediaduration=p,E._quality=o,E._responseHeaders=m,E._serviceLocation=l,y?y.forEach(function(e){!function(e,t,r,n,a){var i=new s.HTTPRequestTrace;i.s=t,i.d=r,i.b=n,i.t=a,e.trace.push(i),e.interval||(e.interval=0),e.interval+=r}(E,e.s,e.d,e.b,e.t)}):(delete E.interval,delete E.trace),I(t,a.default.HTTP_REQUEST,E)},addRepresentationSwitch:function(e,t,r,n,i){var s=new o.default;s.t=t,s.mt=r,s.to=n,i?s.lto=i:delete s.lto,I(e,a.default.TRACK_SWITCH,s)},addBufferLevel:function(e,t,r){var n=new u.default;n.t=t,n.level=r,I(e,a.default.BUFFER_LEVEL,n)},addBufferState:function(e,t,r){var n=new l.default;n.target=r,n.state=t,I(e,a.default.BUFFER_STATE,n)},addDVRInfo:function(e,t,r,n){var i=new c.default;i.time=t,i.range=n,i.manifestInfo=r,I(e,a.default.DVR_INFO,i)},addDroppedFrames:function(e,t){var r=new f.default,n=A(e).DroppedFrames;t&&(r.time=t.creationTime,r.droppedFrames=t.droppedVideoFrames,n.length>0&&n[n.length-1]==r||I(e,a.default.DROPPED_FRAMES,r))},addSchedulingInfo:function(e,t,r,n,i,s,o,u,l){var c=new h.default;c.mediaType=e,c.t=t,c.type=r,c.startTime=n,c.availabilityStartTime=i,c.duration=s,c.quality=o,c.range=u,c.state=l,I(e,a.default.SCHEDULING_INFO,c)},addRequestsQueue:function(e,t,r){var n=new p.default;n.loadingRequests=t,n.executedRequests=r,A(e).RequestsQueue=n,b(e,a.default.REQUESTS_QUEUE,n)},addManifestUpdate:function(e,t,r,i,s,o,u,l,c,f){var h=new d.ManifestUpdate;h.mediaType=e,h.type=t,h.requestTime=r,h.fetchTime=i,h.availabilityStartTime=s,h.presentationStartTime=o,h.clientTimeOffset=u,h.currentTime=l,h.buffered=c,h.latency=f,R(n.default.STREAM,a.default.MANIFEST_UPDATE,h),b(e,a.default.MANIFEST_UPDATE,h)},updateManifestUpdateInfo:function(e,t){if(e){for(var r in t)e[r]=t[r];S(e.mediaType,a.default.MANIFEST_UPDATE,e)}},addManifestUpdateStreamInfo:function(e,t,r,n,i){if(e){var s=new d.ManifestUpdateStreamInfo;s.id=t,s.index=r,s.start=n,s.duration=i,e.streamInfo.push(s),S(e.mediaType,a.default.MANIFEST_UPDATE_STREAM_INFO,e)}},addManifestUpdateRepresentationInfo:function(e,t,r,n,i,s,o,u){if(e&&e.representationInfo){var l=new d.ManifestUpdateRepresentationInfo;l.id=t,l.index=r,l.streamIndex=n,l.mediaType=i,l.startNumber=o,l.fragmentInfoType=u,l.presentationTimeOffset=s,e.representationInfo.push(l),S(e.mediaType,a.default.MANIFEST_UPDATE_TRACK_INFO,e)}},addPlayList:function(e){e.trace&&Array.isArray(e.trace)?e.trace.forEach(function(e){e.hasOwnProperty("subreplevel")&&!e.subreplevel&&delete e.subreplevel}):delete e.trace,I(n.default.STREAM,a.default.PLAY_LIST,e)},addDVBErrors:function(e){I(n.default.STREAM,a.default.DVB_ERRORS,e)}},r={},t}E.__dashjs_factory_name="MetricsModel",t.default=y.default.getSingletonFactory(E)},"./src/streaming/models/URIFragmentModel.js":function(e,t,r){r.r(t);var n=r("./src/streaming/vo/URIFragmentData.js"),a=r("./src/core/FactoryMaker.js");function i(){var e;return{initialize:function(t){if(e=new n.default,!t)return null;var r=t.indexOf("#");if(-1!==r)for(var a=t.substr(r+1).split("&"),i=0,s=a.length;i<s;++i){var o=a[i],u=o.indexOf("=");if(-1!==u){var l=o.substring(0,u);e.hasOwnProperty(l)&&(e[l]=o.substr(u+1))}}},getURIFragmentData:function(){return e}}}i.__dashjs_factory_name="URIFragmentModel",t.default=a.default.getSingletonFactory(i)},"./src/streaming/models/VideoModel.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/core/EventBus.js"),i=r("./src/core/events/Events.js"),s=r("./src/core/Debug.js"),o=r("./src/streaming/constants/Constants.js"),u=new Map([[o.default.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,"loadedmetadata"],[o.default.VIDEO_ELEMENT_READY_STATES.HAVE_CURRENT_DATA,"loadeddata"],[o.default.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA,"canplay"],[o.default.VIDEO_ELEMENT_READY_STATES.HAVE_ENOUGH_DATA,"canplaythrough"]]);function l(){var e,t,r,n,l=this.context,c=Object(a.default)(l).getInstance(),f=[];function d(){r&&(r.playbackRate=1,r.removeEventListener("canplay",d))}function h(){return f.length>0}function g(){if(r&&h()&&0===r.playbackRate){var e=document.createEvent("Event");e.initEvent("waiting",!0,!1),r.dispatchEvent(e)}}function p(e,t){r&&r.addEventListener(e,t)}function m(e,t){r&&r.removeEventListener(e,t)}function y(){return r?r.readyState:NaN}function E(){return r?r.buffered:null}function _(e,t,n,a,i){if(r)for(var s=0;s<r.textTracks.length;s++)if(r.textTracks[s].kind===e&&(!t||r.textTracks[s].label==t)&&r.textTracks[s].language===n&&r.textTracks[s].isTTML===a&&r.textTracks[s].isEmbedded===i)return r.textTracks[s];return null}return e={initialize:function(){c.on(i.default.PLAYBACK_PLAYING,g,this)},setCurrentTime:function(e,t){var n,a;a=function(){if(r){if(r.currentTime===e)return;try{e=t?function(e){var t=E(),r=e,n=9999999999;if(t)for(var a=0;a<t.length;a++){var i=t.start(a),s=t.end(a),o=Math.abs(i-e),u=Math.abs(s-e);if(e>=i&&e<=s)return e;o<n&&(n=o,r=i),u<n&&(n=u,r=s)}return r}(e):e,r.currentTime=e}catch(t){0===r.readyState&&t.code===t.INVALID_STATE_ERR&&setTimeout(function(){r.currentTime=e},400)}}},(n=o.default.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA)===o.default.VIDEO_ELEMENT_READY_STATES.HAVE_NOTHING||y()>=n?a():function(e,t){p(e,function r(){m(e,r),t(e)})}(u.get(n),a)},play:function(){if(r){r.autoplay=!0;var e=r.play();e&&e.catch&&"undefined"!=typeof Promise&&e.catch(function(e){"NotAllowedError"===e.name&&c.trigger(i.default.PLAYBACK_NOT_ALLOWED),t.warn("Caught pending play exception - continuing (".concat(e,")"))})}},isPaused:function(){return r?r.paused:null},pause:function(){r&&(r.pause(),r.autoplay=!1)},isStalled:h,isSeeking:function(){return r?r.seeking:null},getTime:function(){return r?r.currentTime:null},getPlaybackRate:function(){return r?r.playbackRate:null},setPlaybackRate:function(e){r&&(!(arguments.length>1&&void 0!==arguments[1]&&arguments[1])&&r.readyState<=2&&e>0?r.addEventListener("canplay",d):r.playbackRate=e)},getPlayedRanges:function(){return r?r.played:null},getEnded:function(){return r?r.ended:null},setStallState:function(e,t){!function(e,t){t?function(e){null!==e&&r&&!r.seeking&&-1===f.indexOf(e)&&f.push(e)}(e):function(e){var t=f.indexOf(e);null!==e&&-1!==t&&f.splice(t,1)}(e)}(e,t)},getElement:function(){return r},setElement:function(e){if(!(null==e||e&&/^(VIDEO|AUDIO)$/i.test(e.nodeName)))throw"element is not video or audio DOM type!";(r=e)&&(r.preload="auto")},setSource:function(e){r&&(e?r.src=e:(r.removeAttribute("src"),r.load()))},getSource:function(){return r?r.src:null},getTTMLRenderingDiv:function(){return n},setTTMLRenderingDiv:function(e){(n=e).style.position="absolute",n.style.display="flex",n.style.overflow="hidden",n.style.pointerEvents="none",n.style.top=0,n.style.left=0},getPlaybackQuality:function(){if(!r)return null;var e="webkitDroppedFrameCount"in r&&"webkitDecodedFrameCount"in r,t=null;return"getVideoPlaybackQuality"in r?t=r.getVideoPlaybackQuality():e&&(t={droppedVideoFrames:r.webkitDroppedFrameCount,totalVideoFrames:r.webkitDroppedFrameCount+r.webkitDecodedFrameCount,creationTime:new Date}),t},addEventListener:p,removeEventListener:m,getReadyState:y,getBufferRange:E,getClientWidth:function(){return r?r.clientWidth:NaN},getClientHeight:function(){return r?r.clientHeight:NaN},getTextTracks:function(){return r?r.textTracks:[]},getTextTrack:_,addTextTrack:function(e,t,n,a,i){if(!r)return null;var s=_(e,t,n,a,i);return s||((s=r.addTextTrack(e,t,n)).isEmbedded=i,s.isTTML=a),s},appendChild:function(e){r&&(r.appendChild(e),void 0!==e.isTTML&&(r.textTracks[r.textTracks.length-1].isTTML=e.isTTML,r.textTracks[r.textTracks.length-1].isEmbedded=e.isEmbedded))},removeChild:function(e){r&&r.removeChild(e)},getVideoWidth:function(){return r?r.videoWidth:NaN},getVideoHeight:function(){return r?r.videoHeight:NaN},getVideoRelativeOffsetTop:function(){var e=r.parentNode.host||r.parentNode;return e?r.getBoundingClientRect().top-e.getBoundingClientRect().top:NaN},getVideoRelativeOffsetLeft:function(){var e=r.parentNode.host||r.parentNode;return e?r.getBoundingClientRect().left-e.getBoundingClientRect().left:NaN},reset:function(){c.off(i.default.PLAYBACK_PLAYING,g,this)}},t=Object(s.default)(l).getInstance().getLogger(e),e}l.__dashjs_factory_name="VideoModel",t.default=n.default.getSingletonFactory(l)},"./src/streaming/net/FetchLoader.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/core/Settings.js"),i=r("./src/streaming/constants/Constants.js");function s(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function u(e){e=e||{};var t,r,n=this.context,o=e.requestModifier,u=e.lowLatencyThroughputModel,l=e.boxParser,c=Object(a.default)(n).getInstance();function f(e,t){e.reader.read().then(t).catch(function(t){e.onerror&&200===e.response.status&&e.onerror(t)})}function d(e,t){try{if((e=e.filter(function(r){return r.bytes>t/4/e.length})).length>1){var r=0,n=(e[e.length-1].ts-e[0].ts)/e.length;return e.forEach(function(t,a){var i=e[a+1];if(i){var s=i.ts-t.ts;r+=s<n?s:0}}),r}return null}catch(e){return null}}return t={load:function(e){var t,n=new Date,a=e.request,h=new Headers;if(a.range&&h.append("Range","bytes="+a.range),e.headers)for(var g in e.headers){var p=e.headers[g];p&&h.append(g,p)}a.requestStartDate||(a.requestStartDate=n),o&&o.modifyRequestHeader({setRequestHeader:function(e,t){h.append(e,t)}}),"function"==typeof window.AbortController&&(t=new AbortController,e.abortController=t,t.signal.onabort=e.onabort);var m={method:e.method,headers:h,credentials:e.withCredentials?"include":void 0,signal:t?t.signal:void 0},y=c.get().streaming.abr.fetchThroughputCalculationMode,E=Date.now(),_=0;new Promise(function(e){if(y===i.default.ABR_FETCH_THROUGHPUT_CALCULATION_AAST&&u&&(_=u.getThroughputCapacityDelayMS(a,1e3*r.getCurrentBufferLevel(a.mediaType))))return setTimeout(e,_);e()}).then(function(){var t=Date.now();fetch(e.url,m).then(function(n){e.response||(e.response={}),e.response.status=n.status,e.response.statusText=n.statusText,e.response.responseURL=n.url,n.ok||e.onerror();var o,c="",h=function(e){var t;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(t=s(e))){t&&(e=t);var r=0,n=function(){};return{s:n,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,o=!1;return{s:function(){t=e[Symbol.iterator]()},n:function(){var e=t.next();return i=e.done,e},e:function(e){o=!0,a=e},f:function(){try{i||null==t.return||t.return()}finally{if(o)throw a}}}}(n.headers.keys());try{for(h.s();!(o=h.n()).done;){var g=o.value;c+=g+": "+n.headers.get(g)+"\r\n"}}catch(e){h.e(e)}finally{h.f()}if(e.response.responseHeaders=c,!n.body)return n.arrayBuffer().then(function(t){e.response.response=t;var r={loaded:t.byteLength,total:t.byteLength,stream:!1};e.progress(r),e.onload(),e.onend()});var p,m,v,T,S=parseInt(n.headers.get("Content-Length"),10),b=0,A=!1,R=new Uint8Array,I=0;if(y===i.default.ABR_FETCH_THROUGHPUT_CALCULATION_AAST&&u){var C=t,w=0,N=(v=n.body.tee(),T=2,function(e){if(Array.isArray(e))return e}(v)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,a=!1,i=void 0;try{for(var s,o=e[Symbol.iterator]();!(n=(s=o.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(e){a=!0,i=e}finally{try{n||null==o.return||o.return()}finally{if(a)throw i}}return r}}(v,T)||s(v,T)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),D=N[0],M=N[1];p=D.getReader(),m=[],p.read().then(function n(i){var s=i.value,o=i.done;if(w=Date.now(),s&&s.length){var l=w-C,f=s.length;m.push({chunkDownloadTimeRelativeMS:w-t,chunkDownloadDurationMS:l,chunkBytes:f,kbps:Math.round(8*f/(l/1e3)),bufferLevel:r.getCurrentBufferLevel(a.mediaType)})}if(o){var d=w-t,h=m.reduce(function(e,t){return e+t.chunkBytes},0);return u.addMeasurement(a,d,m,E,_,c),void e.progress({loaded:h,total:h,lengthComputable:!0,time:u.getEstimatedDownloadDurationMS(a),stream:!0})}return C=Date.now(),p.read().then(n)}),e.reader=M.getReader()}else e.reader=n.body.getReader();var O=[],P=[],L=[],F=!0;f(e,function t(r){var n=r.value;if(r.done){if(R){if(y!==i.default.ABR_FETCH_THROUGHPUT_CALCULATION_AAST){var a=null;y===i.default.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING&&(a=function(e,t){try{var r,n;r=e.filter(function(t,r){return r<e.length-1}),n=t.filter(function(e,r){return r<t.length-1});var a=[];if(r.length>1){for(var i=0,s=0,o=0;o<r.length;o++)if(r[o]&&n[o]){var u=n[o].ts-r[o].ts;if(u>1)a.push(8*n[o].bytes/u);else{0===s&&(s=r[o].ts);var l=n[o].ts-s;l>1?(a.push(8*i/l),i=0,s=0):i+=n[o].bytes}}if(a.length>0)return a.reduce(function(e,t){return e+t},0)/a.length}return null}catch(e){return null}}(P,L)),e.progress({loaded:b,total:isNaN(S)?b:S,lengthComputable:!0,time:d(O,b),throughput:a,stream:!0})}e.response.response=R.buffer}return e.onload(),void e.onend()}if(n&&n.length>0){R=function(e,t){if(0===e.length)return t;var r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}(R,n),b+=n.length,O.push({ts:Date.now(),bytes:n.length}),y===i.default.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING&&F&&l.findLastTopIsoBoxCompleted(["moof"],R,I).found&&(F=!1,P.push({ts:performance.now(),bytes:n.length}));var s=l.findLastTopIsoBoxCompleted(["moov","mdat"],R,I);if(s.found){var o,u=s.lastCompletedOffset+s.size;y!==i.default.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING||F||(F=!0,L.push({ts:performance.now(),bytes:R.length})),u===R.length?(o=R,R=new Uint8Array):(o=new Uint8Array(R.subarray(0,u)),R=R.subarray(u)),e.progress({data:o.buffer,lengthComputable:!1,noTrace:!0}),I=0}else I=s.lastCompletedOffset,A||(e.progress({lengthComputable:!1,noTrace:!0}),A=!0)}f(e,t)})}).catch(function(t){e.onerror&&e.onerror(t)})})},abort:function(e){if(e.abortController)e.abortController.abort();else if(e.reader)try{e.reader.cancel(),e.onabort()}catch(e){}},calculateDownloadedTime:d,setup:function(e){r=e.dashMetrics}},t}u.__dashjs_factory_name="FetchLoader";var l=n.default.getClassFactory(u);t.default=l},"./src/streaming/net/HTTPLoader.js":function(e,t,r){r.r(t);var n=r("./src/streaming/net/XHRLoader.js"),a=r("./src/streaming/net/FetchLoader.js"),i=r("./src/streaming/vo/metrics/HTTPRequest.js"),s=r("./src/core/FactoryMaker.js"),o=r("./src/streaming/vo/DashJSError.js"),u=r("./src/streaming/models/CmcdModel.js"),l=r("./src/core/Utils.js"),c=r("./src/core/Debug.js"),f=r("./src/core/EventBus.js"),d=r("./src/core/events/Events.js"),h=r("./src/core/Settings.js"),g=r("./src/streaming/constants/Constants.js"),p=r("./src/streaming/models/LowLatencyThroughputModel.js");function m(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function y(e){e=e||{};var t,r,s,y,E,_,v,T,S,b=this.context,A=e.errHandler,R=e.dashMetrics,I=e.mediaPlayerModel,C=e.requestModifier,w=e.boxParser,N=e.errors,D=e.requestTimeout||0,M=Object(f.default)(b).getInstance(),O=Object(h.default)(b).getInstance();function P(e,t){var u,c=e.request,f=[],h=!0,p=!0,m=new Date,S=m,N=0;if(!C||!R||!A)throw new Error("config object is not correct or missing");var L,F=function(e){if(p=!1,c.requestStartDate=m,c.requestEndDate=new Date,c.firstByteDate=c.firstByteDate||m,!c.checkExistenceOnly){var t=u.response?u.response.responseURL:null,r=u.response?u.response.status:null,n=u.response&&u.response.getAllResponseHeaders?u.response.getAllResponseHeaders():u.response?u.response.responseHeaders:[];R.addHttpRequest(c,t,r,n,e?f:null),c.type===i.HTTPRequest.MPD_TYPE&&R.addManifestUpdate(c)}},j=function(){if(-1!==r.indexOf(u)&&(r.splice(r.indexOf(u),1),p))if(F(!1),t>0){try{O.get().streaming.utcSynchronization.enableBackgroundSyncAfterSegmentDownloadError&&c.type===i.HTTPRequest.MEDIA_SEGMENT_TYPE&&I.getRetryAttemptsForType(i.HTTPRequest.MEDIA_SEGMENT_TYPE)===t&&M.trigger(d.default.ATTEMPT_BACKGROUND_SYNC)}catch(e){}t--;var n={config:e};y.push(n),n.timeout=setTimeout(function(){-1!==y.indexOf(n)&&(y.splice(y.indexOf(n),1),P(e,t))},I.getRetryIntervalsForType(c.type))}else{if(c.type===i.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE)return;A.error(new o.default(E[c.type],c.url+" is not available",{request:c,response:u.response})),e.error&&e.error(c,"error",u.response.statusText),e.complete&&e.complete(c,u.response.statusText)}};O.get().streaming.lowLatencyEnabled&&window.fetch&&"arraybuffer"===c.responseType&&c.type===i.HTTPRequest.MEDIA_SEGMENT_TYPE?(L=Object(a.default)(b).create({requestModifier:C,lowLatencyThroughputModel:v,boxParser:w})).setup({dashMetrics:R}):L=Object(n.default)(b).create({requestModifier:C});var x=null,k=C.modifyRequestURL(c.url);if(O.get().streaming.cmcd&&O.get().streaming.cmcd.enabled){var B=O.get().streaming.cmcd.mode;if(B===g.default.CMCD_MODE_QUERY){var U=function(e){try{var t=[],r=_.getQueryParameter(e);return r&&t.push(r),t}catch(e){return[]}}(c);k=l.default.addAditionalQueryParameterToUrl(k,U)}else B===g.default.CMCD_MODE_HEADER&&(x=_.getHeaderParameters(c))}c.url=k;var G=c.checkExistenceOnly?i.HTTPRequest.HEAD:i.HTTPRequest.GET,H=I.getXHRWithCredentialsForType(c.type);u={url:k,method:G,withCredentials:H,request:c,onload:function(){u.response.status>=200&&u.response.status<=299&&(F(!0),e.success&&e.success(u.response.response,u.response.statusText,u.response.responseURL),e.complete&&e.complete(c,u.response.statusText))},onend:j,onerror:j,progress:function(t){var r=new Date;h&&(h=!1,(!t.lengthComputable||t.lengthComputable&&t.total!==t.loaded)&&(c.firstByteDate=r)),t.lengthComputable&&(c.bytesLoaded=t.loaded,c.bytesTotal=t.total),t.noTrace||(f.push({s:S,d:t.time?t.time:r.getTime()-S.getTime(),b:[t.loaded?t.loaded-N:0],t:t.throughput}),S=r,N=t.loaded),e.progress&&t&&e.progress(t)},onabort:function(){e.abort&&e.abort(c)},ontimeout:function(e){var t;if(e.lengthComputable){var r=e.loaded/e.total*100;t="Request timeout: loaded: "+e.loaded+", out of: "+e.total+" : "+r.toFixed(3)+"% Completed"}else t="Request timeout: non-computable download size";T.warn(t)},loader:L,timeout:D,headers:x};var q=(new Date).getTime();if(isNaN(c.delayLoadingTime)||q>=c.delayLoadingTime)r.push(u),L.load(u);else{var Y={httpRequest:u};s.push(Y),Y.delayTimeout=setTimeout(function(){if(-1!==s.indexOf(Y)){s.splice(s.indexOf(Y),1);try{m=new Date,S=m,r.push(Y.httpRequest),L.load(Y.httpRequest)}catch(e){Y.httpRequest.onerror()}}},c.delayLoadingTime-q)}}return t={load:function(e){e.request?P(e,I.getRetryAttemptsForType(e.request.type)):e.error&&e.error(e.request,"error")},abort:function(){y.forEach(function(e){clearTimeout(e.timeout),e.config.request&&e.config.abort&&e.config.abort(e.config.request)}),y=[],s.forEach(function(e){return clearTimeout(e.delayTimeout)}),s=[],r.forEach(function(e){e.request.type!==i.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE&&(e.onloadend=e.onerror=e.onprogress=void 0,e.loader.abort(e))}),r=[]}},T=Object(c.default)(b).getInstance().getLogger(t),r=[],s=[],y=[],_=Object(u.default)(b).getInstance(),v=Object(p.default)(b).getInstance(),m(S={},i.HTTPRequest.MPD_TYPE,N.DOWNLOAD_ERROR_ID_MANIFEST_CODE),m(S,i.HTTPRequest.XLINK_EXPANSION_TYPE,N.DOWNLOAD_ERROR_ID_XLINK_CODE),m(S,i.HTTPRequest.INIT_SEGMENT_TYPE,N.DOWNLOAD_ERROR_ID_INITIALIZATION_CODE),m(S,i.HTTPRequest.MEDIA_SEGMENT_TYPE,N.DOWNLOAD_ERROR_ID_CONTENT_CODE),m(S,i.HTTPRequest.INDEX_SEGMENT_TYPE,N.DOWNLOAD_ERROR_ID_CONTENT_CODE),m(S,i.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE,N.DOWNLOAD_ERROR_ID_CONTENT_CODE),m(S,i.HTTPRequest.OTHER_TYPE,N.DOWNLOAD_ERROR_ID_CONTENT_CODE),E=S,t}y.__dashjs_factory_name="HTTPLoader";var E=s.default.getClassFactory(y);t.default=E},"./src/streaming/net/SchemeLoaderFactory.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/streaming/net/HTTPLoader.js");function i(){var e;function t(){e={}}function r(){t()}return r(),{getLoader:function(t){for(var r in e)if(e.hasOwnProperty(r)&&t.startsWith(r))return e[r];return a.default},registerLoader:function(t,r){e[t]=r},unregisterLoader:function(t){e[t]&&delete e[t]},unregisterAllLoader:t,reset:r}}i.__dashjs_factory_name="SchemeLoaderFactory";var s=n.default.getSingletonFactory(i);t.default=s},"./src/streaming/net/URLLoader.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/streaming/net/SchemeLoaderFactory.js");function i(e){e=e||{};var t,r,n=this.context;return t=Object(a.default)(n).getInstance(),{load:function(a){if(!r){var i=t.getLoader(a&&a.request?a.request.url:null);r=i(n).create({errHandler:e.errHandler,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,dashMetrics:e.dashMetrics,boxParser:e.boxParser?e.boxParser:null,constants:e.constants?e.constants:null,dashConstants:e.dashConstants?e.dashConstants:null,urlUtils:e.urlUtils?e.urlUtils:null,requestTimeout:isNaN(e.requestTimeout)?0:e.requestTimeout,errors:e.errors})}r.load(a)},abort:function(){r&&r.abort()}}}i.__dashjs_factory_name="URLLoader";var s=n.default.getClassFactory(i);t.default=s},"./src/streaming/net/XHRLoader.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js");function a(e){var t=(e=e||{}).requestModifier;return{load:function(e){var r=new Date,n=e.request,a=new XMLHttpRequest;if(a.open(e.method,e.url,!0),n.responseType&&(a.responseType=n.responseType),n.range&&a.setRequestHeader("Range","bytes="+n.range),n.requestStartDate||(n.requestStartDate=r),t&&(a=t.modifyRequestHeader(a)),e.headers)for(var i in e.headers){var s=e.headers[i];s&&a.setRequestHeader(i,s)}a.withCredentials=e.withCredentials,a.onload=e.onload,a.onloadend=e.onend,a.onerror=e.onerror,a.onprogress=e.progress,a.onabort=e.onabort,a.ontimeout=e.ontimeout,a.timeout=e.timeout,a.send(),e.response=a},abort:function(e){var t=e.response;t.onloadend=t.onerror=t.onprogress=void 0,t.abort()}}}a.__dashjs_factory_name="XHRLoader";var i=n.default.getClassFactory(a);t.default=i},"./src/streaming/protection/CommonEncryption.js":function(e,t,r){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}r.r(t);var a={attributes:["Laurl","laurl"],prefixes:["clearkey","dashif"]},i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,r;return t=e,r=[{key:"findCencContentProtection",value:function(e){for(var t=null,r=0;r<e.length;++r){var n=e[r];"urn:mpeg:dash:mp4protection:2011"!==n.schemeIdUri.toLowerCase()||"cenc"!==n.value.toLowerCase()&&"cbcs"!==n.value.toLowerCase()||(t=n)}return t}},{key:"getPSSHData",value:function(e){var t=8,r=new DataView(e),n=r.getUint8(t);return t+=20,n>0&&(t+=4+16*r.getUint32(t)),t+=4,e.slice(t)}},{key:"getPSSHForKeySystem",value:function(t,r){var n=e.parsePSSHList(r);return t&&n.hasOwnProperty(t.uuid.toLowerCase())?n[t.uuid.toLowerCase()]:null}},{key:"parseInitDataFromContentProtection",value:function(e,t){return"pssh"in e?(e.pssh.__text=e.pssh.__text.replace(/\r?\n|\r/g,"").replace(/\s+/g,""),t.decodeArray(e.pssh.__text).buffer):null}},{key:"parsePSSHList",value:function(e){if(null==e)return[];for(var t=new DataView(e.buffer||e),r={},n=0;;){var a,i,s=void 0,o=n;if(n>=t.buffer.byteLength)break;if(a=n+t.getUint32(n),n+=4,1886614376===t.getUint32(n))if(n+=4,0===(i=t.getUint8(n))||1===i){n++,n+=3,s="";var u=void 0,l=void 0;for(u=0;u<4;u++)s+=1===(l=t.getUint8(n+u).toString(16)).length?"0"+l:l;for(n+=4,s+="-",u=0;u<2;u++)s+=1===(l=t.getUint8(n+u).toString(16)).length?"0"+l:l;for(n+=2,s+="-",u=0;u<2;u++)s+=1===(l=t.getUint8(n+u).toString(16)).length?"0"+l:l;for(n+=2,s+="-",u=0;u<2;u++)s+=1===(l=t.getUint8(n+u).toString(16)).length?"0"+l:l;for(n+=2,s+="-",u=0;u<6;u++)s+=1===(l=t.getUint8(n+u).toString(16)).length?"0"+l:l;n+=6,n+=4,r[s=s.toLowerCase()]=t.buffer.slice(o,a),n=a}else n=a;else n=a}return r}},{key:"getLicenseServerUrlFromMediaInfo",value:function(e,t){try{if(!e||0===e.length)return null;for(var r=0,n=null;r<e.length&&!n;){var i=e[r];if(i&&i.contentProtection&&i.contentProtection.length>0){var s=i.contentProtection.filter(function(e){return e.schemeIdUri&&e.schemeIdUri===t});if(s&&s.length>0)for(var o=0;o<s.length&&!n;){for(var u=s[o],l=0;l<a.attributes.length&&!n;){for(var c=0,f=a.attributes[l];c<a.prefixes.length&&!n;){var d=a.prefixes[c];u[f]&&u[f].__prefix&&u[f].__prefix===d&&u[f].__text&&(n=u[f].__text),c+=1}l+=1}o+=1}}r+=1}return n}catch(e){return null}}}],null&&n(t.prototype,null),r&&n(t,r),e}();t.default=i},"./src/streaming/protection/Protection.js":function(e,t,r){r.r(t);var n=r("./src/streaming/protection/controllers/ProtectionController.js"),a=r("./src/streaming/protection/controllers/ProtectionKeyController.js"),i=r("./src/streaming/protection/ProtectionEvents.js"),s=r("./src/streaming/protection/errors/ProtectionErrors.js"),o=r("./src/streaming/protection/models/ProtectionModel_21Jan2015.js"),u=r("./src/streaming/protection/models/ProtectionModel_3Feb2014.js"),l=r("./src/streaming/protection/models/ProtectionModel_01b.js"),c=[{generateKeyRequest:"generateKeyRequest",addKey:"addKey",cancelKeyRequest:"cancelKeyRequest",needkey:"needkey",keyerror:"keyerror",keyadded:"keyadded",keymessage:"keymessage"},{generateKeyRequest:"webkitGenerateKeyRequest",addKey:"webkitAddKey",cancelKeyRequest:"webkitCancelKeyRequest",needkey:"webkitneedkey",keyerror:"webkitkeyerror",keyadded:"webkitkeyadded",keymessage:"webkitkeymessage"}],f=[{setMediaKeys:"setMediaKeys",MediaKeys:"MediaKeys",release:"close",needkey:"needkey",error:"keyerror",message:"keymessage",ready:"keyadded",close:"keyclose"},{setMediaKeys:"msSetMediaKeys",MediaKeys:"MSMediaKeys",release:"close",needkey:"msneedkey",error:"mskeyerror",message:"mskeymessage",ready:"mskeyadded",close:"mskeyclose"}];function d(){var e,t=this.context;function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];if("function"==typeof e[n[Object.keys(n)[0]]])return n}return null}return e={createProtectionSystem:function(i){var s=null,d=Object(a.default)(t).getInstance();d.setConfig({debug:i.debug,BASE64:i.BASE64}),d.initialize();var h=function(n){var a=n.debug,i=a.getLogger(e),s=n.eventBus,d=n.errHandler,h=n.videoModel?n.videoModel.getElement():null;return h&&void 0===h.onencrypted||h&&void 0===h.mediaKeys?r(h,f)?(i.info("EME detected on this user agent! (ProtectionModel_3Feb2014)"),Object(u.default)(t).create({debug:a,eventBus:s,events:n.events,api:r(h,f)})):r(h,c)?(i.info("EME detected on this user agent! (ProtectionModel_01b)"),Object(l.default)(t).create({debug:a,eventBus:s,errHandler:d,events:n.events,api:r(h,c)})):(i.warn("No supported version of EME detected on this user agent! - Attempts to play encrypted content will fail!"),null):(i.info("EME detected on this user agent! (ProtectionModel_21Jan2015)"),Object(o.default)(t).create({debug:a,eventBus:s,events:n.events}))}(i);return!s&&h&&(s=Object(n.default)(t).create({protectionModel:h,protectionKeyController:d,eventBus:i.eventBus,debug:i.debug,events:i.events,BASE64:i.BASE64,constants:i.constants,cmcdModel:i.cmcdModel,settings:i.settings}),i.capabilities.setEncryptedMediaSupported(!0)),s}}}d.__dashjs_factory_name="Protection";var h=dashjs.FactoryMaker.getClassFactory(d);h.events=i.default,h.errors=s.default,dashjs.FactoryMaker.updateClassFactory(d.__dashjs_factory_name,h),t.default=h},"./src/streaming/protection/ProtectionEvents.js":function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}r.r(t);var s=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(o,e);var t,r,s=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,a=i(t);if(r){var s=i(this).constructor;e=Reflect.construct(a,arguments,s)}else e=a.apply(this,arguments);return function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function o(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=s.call(this)).INTERNAL_KEY_MESSAGE="internalKeyMessage",e.INTERNAL_KEY_STATUS_CHANGED="internalkeyStatusChanged",e.KEY_ADDED="public_keyAdded",e.KEY_ERROR="public_keyError",e.KEY_MESSAGE="public_keyMessage",e.KEY_SESSION_CLOSED="public_keySessionClosed",e.KEY_SESSION_CREATED="public_keySessionCreated",e.KEY_SESSION_REMOVED="public_keySessionRemoved",e.KEY_STATUSES_CHANGED="public_keyStatusesChanged",e.KEY_SYSTEM_ACCESS_COMPLETE="public_keySystemAccessComplete",e.KEY_SYSTEM_SELECTED="public_keySystemSelected",e.LICENSE_REQUEST_COMPLETE="public_licenseRequestComplete",e.LICENSE_REQUEST_SENDING="public_licenseRequestSending",e.NEED_KEY="needkey",e.PROTECTION_CREATED="public_protectioncreated",e.PROTECTION_DESTROYED="public_protectiondestroyed",e.SERVER_CERTIFICATE_UPDATED="serverCertificateUpdated",e.TEARDOWN_COMPLETE="protectionTeardownComplete",e.VIDEO_ELEMENT_SELECTED="videoElementSelected",e.KEY_SESSION_UPDATED="public_keySessionUpdated",e}return o}(r("./src/core/events/EventsBase.js").default));t.default=s},"./src/streaming/protection/controllers/ProtectionController.js":function(e,t,r){r.r(t);var n=r("./src/streaming/protection/CommonEncryption.js"),a=r("./src/streaming/protection/vo/MediaCapability.js"),i=r("./src/streaming/protection/vo/KeySystemConfiguration.js"),s=r("./src/streaming/protection/errors/ProtectionErrors.js"),o=r("./src/streaming/vo/DashJSError.js"),u=r("./src/streaming/protection/vo/LicenseRequest.js"),l=r("./src/streaming/protection/vo/LicenseResponse.js"),c=r("./src/streaming/vo/metrics/HTTPRequest.js"),f=r("./src/core/Utils.js"),d=r("./src/streaming/constants/Constants.js"),h=r("./src/core/FactoryMaker.js");function g(e){return g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},g(e)}function p(e){var t,r,h,p,m,y,E,_,v,T,S,b=(e=e||{}).protectionKeyController,A=e.protectionModel,R=e.eventBus,I=e.events,C=e.debug,w=e.BASE64,N=e.constants,D=[],M=e.cmcdModel,O=e.settings;function P(){if(!(R&&R.hasOwnProperty("on")&&b&&b.hasOwnProperty("getSupportedKeySystemsFromContentProtection")))throw new Error("Missing config parameter(s)")}function L(e,t){v?h.push(e):_?_&&function(e){var t=e.findIndex(function(e){return e.ks===_}),r=e[t];-1!==t&&r.initData&&F(r)}(e):function(e,t){v=!0;var n,a=[];h.push(e);for(var i=0;i<e.length;i++){var u=G(e[i]);a.push({ks:e[i].ks,configs:[u]})}A.requestKeySystemAccess(a).then(function(e){return n=e.data,r.info("DRM: KeySystem Access Granted ("+n.keySystem.systemString+")! Selecting key system..."),A.selectKeySystem(n)}).then(function(e){if(_=e,v=!1,A){R.trigger(I.KEY_SYSTEM_SELECTED,{data:n});var t,r=k(_);r&&r.serverCertificate&&r.serverCertificate.length>0&&A.setServerCertificate(w.decodeArray(r.serverCertificate).buffer);for(var a=0;a<h.length;a++)for(t=0;t<h[a].length;t++)if(_===h[a][t].ks){F(h[a][t]);break}}}).catch(function(e){_=null,v=!1,t||R.trigger(I.KEY_SYSTEM_SELECTED,{data:null,error:new o.default(s.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE,s.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE+"Error selecting key system! -- "+e.error)})})}(e,t)}function F(e){if(b.isClearKey(_)&&e.protData&&e.protData.hasOwnProperty("clearkeys")){var t={kids:Object.keys(e.protData.clearkeys)};e.initData=(new TextEncoder).encode(JSON.stringify(t))}e.sessionId?j(e):null!==e.initData&&x(e)}function j(e){P(),A.loadKeySession(e)}function x(e){var t=n.default.getPSSHForKeySystem(_,e?e.initData:null);if(t){if(function(e){if(!e)return!1;try{for(var t=A.getSessions(),r=0;r<t.length;r++)if(t[r].getKeyId()===e)return!0;return!1}catch(e){return!1}}(e.keyId))return;if(B(t))return;try{e.initData=t,A.createKeySession(e)}catch(e){R.trigger(I.KEY_SESSION_CREATED,{data:null,error:new o.default(s.default.KEY_SESSION_CREATED_ERROR_CODE,s.default.KEY_SESSION_CREATED_ERROR_MESSAGE+e.message)})}}else e&&e.initData?A.createKeySession(e):R.trigger(I.KEY_SESSION_CREATED,{data:null,error:new o.default(s.default.KEY_SESSION_CREATED_ERROR_CODE,s.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Selected key system is "+(_?_.systemString:null)+". needkey/encrypted event contains no initData corresponding to that key system!")})}function k(e){if(e){var t=e.systemString;if(m)return t in m?m[t]:null}return null}function B(e){if(!e)return!1;try{for(var t=A.getAllInitData(),n=0;n<t.length;n++)if(b.initDataEquals(e,t[n]))return r.debug("DRM: Ignoring initData because we have already seen it!"),!0;return!1}catch(e){return!1}}function U(e){P(),e?(A.setMediaElement(e),R.on(I.NEED_KEY,X,t)):null===e&&(A.setMediaElement(e),R.off(I.NEED_KEY,X,t))}function G(e){var t=e.protData,r=[],n=[],s=t&&t.audioRobustness&&t.audioRobustness.length>0?t.audioRobustness:E,o=t&&t.videoRobustness&&t.videoRobustness.length>0?t.videoRobustness:E,u=e.sessionType,l=t&&t.distinctiveIdentifier?t.distinctiveIdentifier:"optional",c=t&&t.persistentState?t.persistentState:"temporary"===u?"optional":"required";return p.forEach(function(e){e.type===N.AUDIO?r.push(new a.default(e.codec,s)):e.type===N.VIDEO&&n.push(new a.default(e.codec,o))}),new i.default(r,n,l,c,[u])}function H(e){e.error?R.trigger(I.KEY_STATUSES_CHANGED,{data:null,error:e.error}):r.debug("DRM: key status = "+e.status)}function q(e){r.debug("DRM: onKeyMessage");var t=e.data;R.trigger(I.KEY_MESSAGE,{data:t});var a=t.messageType?t.messageType:"license-request",i=t.message,d=t.sessionToken,h=k(_),m=b.getLicenseServerModelInstance(_,h,a),y={sessionToken:d,messageType:a};if(i&&0!==i.byteLength){if(!m)return r.debug("DRM: License server request not required for this message (type = "+e.data.messageType+"). Session ID = "+d.getSessionId()),void Y(y);if(b.isClearKey(_)){var E=b.processClearKeyLicenseRequest(_,h,i);if(E)return r.debug("DRM: ClearKey license request handled by application!"),Y(y),void A.updateKeySession(d,E)}!function(e,t,r){var a=e.sessionToken,i=e.messageType?e.messageType:"license-request",d={sessionToken:a,messageType:i},h=_?_.systemString:null,m=function(e,t,r,a,i){var s=null,o=a.message;if(e&&e.serverURL){var u=e.serverURL;"string"==typeof u&&""!==u?s=u:"object"===g(u)&&u.hasOwnProperty(t)&&(s=u[t])}else if(e&&e.laURL&&""!==e.laURL)s=e.laURL;else if(!(s=n.default.getLicenseServerUrlFromMediaInfo(p,_.schemeIdURI))&&!b.isClearKey(_)){var l=n.default.getPSSHData(r.initData);(s=_.getLicenseServerURLFromInitData(l))||(s=a.laURL)}return i.getServerURLFromMessage(s,o,t)}(r,i,a,e,t);if(m){var y={},E=!1;r&&V(y,r.httpRequestHeaders);var v=e.message;V(y,_.getRequestHeadersFromMessage(v)),Object.keys(y).forEach(function(e){"authorization"===e.toLowerCase()&&(E=!0)}),r&&"boolean"==typeof r.withCredentials&&(E=r.withCredentials);var R=function(e){if(A)if(e.status>=200&&e.status<=299){var r=f.default.parseHttpHeaders(e.getAllResponseHeaders?e.getAllResponseHeaders():null),n=new l.default(e.responseURL,r,e.response);z(S,n).then(function(){var r=t.getLicenseMessage(n.data,h,i);null!==r?(Y(d),A.updateKeySession(a,r)):W(e,d,h,i,t)})}else W(e,d,h,i,t)},I=function(e){Y(d,new o.default(s.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,s.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+h+' update, XHR aborted. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState))},C=function(e){Y(d,new o.default(s.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,s.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+h+' update, XHR error. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState))},w=_.getLicenseRequestFromMessage(v),N=t.getHTTPMethod(i),D=t.getResponseType(h,i),M=r&&!isNaN(r.httpTimeout)?r.httpTimeout:8e3,P=a.getSessionId()||null,L=new u.default(m,N,D,y,E,i,P,w),F=isNaN(O.get().streaming.retryAttempts[c.HTTPRequest.LICENSE])?3:O.get().streaming.retryAttempts[c.HTTPRequest.LICENSE];z(T,L).then(function(){K(L,F,M,R,I,C)})}else Y(d,new o.default(s.default.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE,s.default.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE))}(t,m,h)}else Y(y,new o.default(s.default.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE,s.default.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE))}function Y(e,t){R.trigger(I.LICENSE_REQUEST_COMPLETE,{data:e,error:t})}function K(e,t,n,a,i,s){var o=new XMLHttpRequest;if(O.get().streaming.cmcd&&O.get().streaming.cmcd.enabled&&O.get().streaming.cmcd.mode===d.default.CMCD_MODE_QUERY){var u=M.getQueryParameter({url:e.url,type:c.HTTPRequest.LICENSE});u&&(e.url=f.default.addAditionalQueryParameterToUrl(e.url,[u]))}for(var l in o.open(e.method,e.url,!0),o.responseType=e.responseType,o.withCredentials=e.withCredentials,n>0&&(o.timeout=n),e.headers)o.setRequestHeader(l,e.headers[l]);if(O.get().streaming.cmcd&&O.get().streaming.cmcd.enabled&&O.get().streaming.cmcd.mode===d.default.CMCD_MODE_HEADER){var h=M.getHeaderParameters({url:e.url,type:c.HTTPRequest.LICENSE});if(h)for(var g in h){var p=h[g];p&&o.setRequestHeader(g,p)}}var m=function(){t--;var r=isNaN(O.get().streaming.retryIntervals[c.HTTPRequest.LICENSE])?1e3:O.get().streaming.retryIntervals[c.HTTPRequest.LICENSE];setTimeout(function(){K(e,t,n,a,i,s)},r)};o.onload=function(){this.status>=200&&this.status<=299||t<=0?a(this):(r.warn("License request failed ("+this.status+"). Retrying it... Pending retries: "+t),m())},o.ontimeout=o.onerror=function(){t<=0?s(this):(r.warn("License request network request failed . Retrying it... Pending retries: "+t),m())},o.onabort=function(){i(this)},R.trigger(I.LICENSE_REQUEST_SENDING,{url:e.url,headers:e.headers,payload:e.data,sessionId:e.sessionId}),o.send(e.data)}function V(e,t){if(t)for(var r in t)e[r]=t[r]}function W(e,t,r,n,a){var i=e.response?a.getErrorResponse(e.response,r,n):"NONE";Y(t,new o.default(s.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,s.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+r+' update, XHR complete. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState+". Response is "+i))}function z(e,t){return e?e.reduce(function(e,r){return e.then(function(){return r(t)})},Promise.resolve()):Promise.resolve()}function X(e,t){if(!O.get().streaming.protection.ignoreEmeEncryptedEvent){if(r.debug("DRM: onNeedKey"),"cenc"!==e.key.initDataType)return void r.warn("DRM: Only 'cenc' initData is supported! Ignoring initData of type: "+e.key.initDataType);if(0===p.length&&(r.warn("DRM: onNeedKey called before initializeForMedia, wait until initialized"),(t=void 0===t?1:t+1)<5))return void D.push(setTimeout(function(){X(e,t)},500));var a=e.key.initData;if(ArrayBuffer.isView(a)&&(a=a.buffer),_){var i=n.default.getPSSHForKeySystem(_,a);if(i&&B(i))return}r.debug("DRM: initData:",String.fromCharCode.apply(null,new Uint8Array(a)));var s=b.getSupportedKeySystemsFromSegmentPssh(a,m,y);if(0===s.length)return void r.debug("DRM: Received needkey event with initData, but we don't support any of the key systems!");L(s,!1)}}return t={initializeForMedia:function(e){if(!e)throw new Error("mediaInfo can not be null or undefined");P(),p.push(e);var t=b.getSupportedKeySystemsFromContentProtection(e.contentProtection,m,y);(t=t.sort(function(e,r){return(m&&m[e.ks.systemString]&&m[e.ks.systemString].priority>=0?m[e.ks.systemString].priority:t.length)-(m&&m[r.ks.systemString]&&m[r.ks.systemString].priority>=0?m[r.ks.systemString].priority:t.length)}))&&t.length>0&&L(t,!0)},clearMediaInfoArray:function(){p=[]},createKeySession:x,loadKeySession:j,removeKeySession:function(e){P(),A.removeKeySession(e)},closeKeySession:function(e){P(),A.closeKeySession(e)},setServerCertificate:function(e){P(),A.setServerCertificate(e)},setMediaElement:U,setSessionType:function(e){y=e},setRobustnessLevel:function(e){E=e},setProtectionData:function(e){m=e,b.setProtectionData(e)},getSupportedKeySystemsFromContentProtection:function(e){return P(),b.getSupportedKeySystemsFromContentProtection(e,m,y)},getKeySystems:function(){return b?b.getKeySystems():[]},setKeySystems:function(e){b&&b.setKeySystems(e)},setLicenseRequestFilters:function(e){T=e},setLicenseResponseFilters:function(e){S=e},stop:function(){A&&A.stop()},reset:function(){R.off(I.INTERNAL_KEY_MESSAGE,q,t),R.off(I.INTERNAL_KEY_STATUS_CHANGED,H,t),P(),T=[],S=[],U(null),_=null,v=!1,A&&(A.reset(),A=null),D.forEach(function(e){return clearTimeout(e)}),D=[],p=[],h=[]}},r=C.getLogger(t),h=[],p=[],y="temporary",E="",T=[],S=[],R.on(I.INTERNAL_KEY_MESSAGE,q,t),R.on(I.INTERNAL_KEY_STATUS_CHANGED,H,t),t}p.__dashjs_factory_name="ProtectionController",t.default=h.default.getClassFactory(p)},"./src/streaming/protection/controllers/ProtectionKeyController.js":function(e,t,r){r.r(t);var n=r("./src/streaming/protection/CommonEncryption.js"),a=r("./src/streaming/protection/drm/KeySystemClearKey.js"),i=r("./src/streaming/protection/drm/KeySystemW3CClearKey.js"),s=r("./src/streaming/protection/drm/KeySystemWidevine.js"),o=r("./src/streaming/protection/drm/KeySystemPlayReady.js"),u=r("./src/streaming/protection/servers/DRMToday.js"),l=r("./src/streaming/protection/servers/PlayReady.js"),c=r("./src/streaming/protection/servers/Widevine.js"),f=r("./src/streaming/protection/servers/ClearKey.js"),d=r("./src/streaming/constants/ProtectionConstants.js");function h(){var e,t,r,h,g,p,m,y=this.context;function E(e,t){return t&&e in t?t[e]:null}function _(e,t){return e&&e.sessionId?e.sessionId:t&&t.sessionId?t.sessionId:null}function v(e,t){return e&&e.sessionType?e.sessionType:t}return e={initialize:function(){var e;h=[],e=Object(o.default)(y).getInstance({BASE64:g}),h.push(e),e=Object(s.default)(y).getInstance({BASE64:g}),h.push(e),e=Object(a.default)(y).getInstance({BASE64:g}),h.push(e),p=e,e=Object(i.default)(y).getInstance({BASE64:g,debug:t}),h.push(e),m=e},setProtectionData:function(e){for(var t=function(t){var r=null;return e&&(r=t in e?e[t]:null),r},r=0;r<h.length;r++){var n=h[r];n.hasOwnProperty("init")&&n.init(t(n.systemString))}},isClearKey:function(e){return e===p||e===m},initDataEquals:function(e,t){if(e.byteLength===t.byteLength){for(var r=new Uint8Array(e),n=new Uint8Array(t),a=0;a<r.length;a++)if(r[a]!==n[a])return!1;return!0}return!1},getKeySystems:function(){return h},setKeySystems:function(e){h=e},getKeySystemBySystemString:function(e){for(var t=0;t<h.length;t++)if(h[t].systemString===e)return h[t];return null},getSupportedKeySystemsFromContentProtection:function(e,t,r){var a,i,s,o,u=[];if(e){var l=n.default.findCencContentProtection(e);for(s=0;s<h.length;++s){var c=E((i=h[s]).systemString,t);for(o=0;o<e.length;++o)if((a=e[o]).schemeIdUri.toLowerCase()===i.schemeIdURI){var f=i.getInitData(a,l);u.push({ks:h[s],keyId:a.keyId,initData:f,protData:c,cdmData:i.getCDMData(c?c.cdmData:null),sessionId:_(c,a),sessionType:v(c,r)})}}}return u},getSupportedKeySystemsFromSegmentPssh:function(e,t,r){for(var a,i=[],s=n.default.parsePSSHList(e),o=0;o<h.length;++o){var u=E((a=h[o]).systemString,t);a.uuid in s&&i.push({ks:a,initData:s[a.uuid],protData:u,cdmData:a.getCDMData(u?u.cdmData:null),sessionId:_(u),sessionType:v(u,r)})}return i},getLicenseServerModelInstance:function(e,t,r){if("license-release"===r||"individualization-request"===r)return null;var n=null;return t&&t.hasOwnProperty("drmtoday")?n=Object(u.default)(y).getInstance({BASE64:g}):e.systemString===d.default.WIDEVINE_KEYSTEM_STRING?n=Object(c.default)(y).getInstance():e.systemString===d.default.PLAYREADY_KEYSTEM_STRING?n=Object(l.default)(y).getInstance():e.systemString===d.default.CLEARKEY_KEYSTEM_STRING&&(n=Object(f.default)(y).getInstance()),n},processClearKeyLicenseRequest:function(e,t,n){try{return e.getClearKeysFromProtectionData(t,n)}catch(e){return r.error("Failed to retrieve clearkeys from ProtectionData"),null}},setConfig:function(n){n&&(n.debug&&(t=n.debug,r=t.getLogger(e)),n.BASE64&&(g=n.BASE64))}}}h.__dashjs_factory_name="ProtectionKeyController",t.default=dashjs.FactoryMaker.getSingletonFactory(h)},"./src/streaming/protection/drm/KeySystemClearKey.js":function(e,t,r){r.r(t);var n=r("./src/streaming/protection/vo/KeyPair.js"),a=r("./src/streaming/protection/vo/ClearKeyKeySet.js"),i=r("./src/streaming/protection/CommonEncryption.js"),s=r("./src/streaming/constants/ProtectionConstants.js"),o="e2719d58-a985-b3c9-781a-b030af78d30e",u=s.default.CLEARKEY_KEYSTEM_STRING,l="urn:uuid:"+o;function c(e){var t=(e=e||{}).BASE64;return{uuid:o,schemeIdURI:l,systemString:u,getInitData:function(e,r){try{var n=i.default.parseInitDataFromContentProtection(e,t);if(!n&&r){var a={kids:[function(e){try{var t=e.replace(/-/g,"");return(t=btoa(t.match(/\w{2}/g).map(function(e){return String.fromCharCode(parseInt(e,16))}).join(""))).replace(/=/g,"")}catch(e){return null}}(r["cenc:default_KID"])]};n=(new TextEncoder).encode(JSON.stringify(a))}return n}catch(e){return null}},getRequestHeadersFromMessage:function(){return{"Content-Type":"application/json"}},getLicenseRequestFromMessage:function(e){return JSON.parse(String.fromCharCode.apply(null,new Uint8Array(e)))},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getClearKeysFromProtectionData:function(e,t){var r=null;if(e){for(var i=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(t))),s=[],o=0;o<i.kids.length;o++){var u=i.kids[o],l=e.clearkeys&&e.clearkeys.hasOwnProperty(u)?e.clearkeys[u]:null;if(!l)throw new Error("DRM: ClearKey keyID ("+u+") is not known!");s.push(new n.default(u,l))}r=new a.default(s)}return r}}}c.__dashjs_factory_name="KeySystemClearKey",t.default=dashjs.FactoryMaker.getSingletonFactory(c)},"./src/streaming/protection/drm/KeySystemPlayReady.js":function(e,t,r){r.r(t);var n=r("./src/streaming/protection/CommonEncryption.js"),a=r("./src/streaming/constants/ProtectionConstants.js"),i="9a04f079-9840-4286-ab92-e65be0885f95",s=a.default.PLAYREADY_KEYSTEM_STRING,o="urn:uuid:"+i;function u(e){var t="utf-16",r=(e=e||{}).BASE64;function a(){if(!r||!r.hasOwnProperty("decodeArray")||!r.hasOwnProperty("decodeArray"))throw new Error("Missing config parameter(s)")}return{uuid:i,schemeIdURI:o,systemString:s,getInitData:function(e){var t,i,s,o,u,l=new Uint8Array([112,115,115,104,0,0,0,0]),c=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]),f=0,d=null;if(a(),!e)return null;if("pssh"in e)return n.default.parseInitDataFromContentProtection(e,r);if("pro"in e)d=r.decodeArray(e.pro.__text);else{if(!("prheader"in e))return null;d=r.decodeArray(e.prheader.__text)}return t=d.length,i=4+l.length+c.length+4+t,s=new ArrayBuffer(i),o=new Uint8Array(s),(u=new DataView(s)).setUint32(f,i),f+=4,o.set(l,f),f+=l.length,o.set(c,f),f+=c.length,u.setUint32(f,t),f+=4,o.set(d,f),f+=t,o.buffer},getRequestHeadersFromMessage:function(e){var r,n,a={},i=new DOMParser,s="utf-16"===t?new Uint16Array(e):new Uint8Array(e);r=String.fromCharCode.apply(null,s);for(var o=(n=i.parseFromString(r,"application/xml")).getElementsByTagName("name"),u=n.getElementsByTagName("value"),l=0;l<o.length;l++)a[o[l].childNodes[0].nodeValue]=u[l].childNodes[0].nodeValue;return a.hasOwnProperty("Content")&&(a["Content-Type"]=a.Content,delete a.Content),a.hasOwnProperty("Content-Type")||(a["Content-Type"]="text/xml; charset=utf-8"),a},getLicenseRequestFromMessage:function(e){var n=null,i=new DOMParser,s="utf-16"===t?new Uint16Array(e):new Uint8Array(e);a();var o=String.fromCharCode.apply(null,s),u=i.parseFromString(o,"application/xml");if(!u.getElementsByTagName("PlayReadyKeyMessage")[0])return e;var l=u.getElementsByTagName("Challenge")[0].childNodes[0].nodeValue;return l&&(n=r.decode(l)),n},getLicenseServerURLFromInitData:function(e){if(e)for(var t=new DataView(e),r=t.getUint16(4,!0),n=6,a=new DOMParser,i=0;i<r;i++){var s=t.getUint16(n,!0);n+=2;var o=t.getUint16(n,!0);if(n+=2,1===s){var u=e.slice(n,n+o),l=String.fromCharCode.apply(null,new Uint16Array(u)),c=a.parseFromString(l,"application/xml");if(c.getElementsByTagName("LA_URL")[0]){var f=c.getElementsByTagName("LA_URL")[0].childNodes[0].nodeValue;if(f)return f}if(c.getElementsByTagName("LUI_URL")[0]){var d=c.getElementsByTagName("LUI_URL")[0].childNodes[0].nodeValue;if(d)return d}}else n+=o}return null},getCDMData:function(e){var t,n,i,s;if(a(),!e)return null;for(t=[],s=0;s<e.length;++s)t.push(e.charCodeAt(s)),t.push(0);for(t=String.fromCharCode.apply(null,t),t=r.encode(t),n='<PlayReadyCDMData type="LicenseAcquisition"><LicenseAcquisition version="1.0" Proactive="false"><CustomData encoding="base64encoded">%CUSTOMDATA%</CustomData></LicenseAcquisition></PlayReadyCDMData>'.replace("%CUSTOMDATA%",t),i=[],s=0;s<n.length;++s)i.push(n.charCodeAt(s)),i.push(0);return new Uint8Array(i).buffer},setPlayReadyMessageFormat:function(e){if("utf-8"!==e&&"utf-16"!==e)throw new Error('Specified message format is not one of "utf-8" or "utf-16"');t=e}}}u.__dashjs_factory_name="KeySystemPlayReady",t.default=dashjs.FactoryMaker.getSingletonFactory(u)},"./src/streaming/protection/drm/KeySystemW3CClearKey.js":function(e,t,r){r.r(t);var n=r("./src/streaming/protection/vo/KeyPair.js"),a=r("./src/streaming/protection/vo/ClearKeyKeySet.js"),i=r("./src/streaming/protection/CommonEncryption.js"),s=r("./src/streaming/constants/ProtectionConstants.js"),o="1077efec-c0b2-4d02-ace3-3c1e52e2fb4b",u=s.default.CLEARKEY_KEYSTEM_STRING,l="urn:uuid:"+o;function c(e){var t,r=e.BASE64,s=e.debug.getLogger(t);return{uuid:o,schemeIdURI:l,systemString:u,getInitData:function(e){return i.default.parseInitDataFromContentProtection(e,r)},getRequestHeadersFromMessage:function(){return null},getLicenseRequestFromMessage:function(e){return new Uint8Array(e)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getClearKeysFromProtectionData:function(e,t){var r=null;if(e){for(var i=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(t))),o=[],u=0;u<i.kids.length;u++){var l=i.kids[u],c=e.clearkeys&&e.clearkeys.hasOwnProperty(l)?e.clearkeys[l]:null;if(!c)throw new Error("DRM: ClearKey keyID ("+l+") is not known!");o.push(new n.default(l,c))}r=new a.default(o),s.warn("ClearKey schemeIdURI is using W3C Common PSSH systemID (1077efec-c0b2-4d02-ace3-3c1e52e2fb4b) in Content Protection. See DASH-IF IOP v4.1 section 7.6.2.4")}return r}}}c.__dashjs_factory_name="KeySystemW3CClearKey",t.default=dashjs.FactoryMaker.getSingletonFactory(c)},"./src/streaming/protection/drm/KeySystemWidevine.js":function(e,t,r){r.r(t);var n=r("./src/streaming/protection/CommonEncryption.js"),a=r("./src/streaming/constants/ProtectionConstants.js"),i="edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",s=a.default.WIDEVINE_KEYSTEM_STRING,o="urn:uuid:"+i;function u(e){var t=(e=e||{}).BASE64;return{uuid:i,schemeIdURI:o,systemString:s,getInitData:function(e){return n.default.parseInitDataFromContentProtection(e,t)},getRequestHeadersFromMessage:function(){return null},getLicenseRequestFromMessage:function(e){return new Uint8Array(e)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null}}}u.__dashjs_factory_name="KeySystemWidevine",t.default=dashjs.FactoryMaker.getSingletonFactory(u)},"./src/streaming/protection/errors/ProtectionErrors.js":function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}r.r(t);var s=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(o,e);var t,r,s=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,a=i(t);if(r){var s=i(this).constructor;e=Reflect.construct(a,arguments,s)}else e=a.apply(this,arguments);return function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function o(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=s.call(this)).MEDIA_KEYERR_CODE=100,e.MEDIA_KEYERR_UNKNOWN_CODE=101,e.MEDIA_KEYERR_CLIENT_CODE=102,e.MEDIA_KEYERR_SERVICE_CODE=103,e.MEDIA_KEYERR_OUTPUT_CODE=104,e.MEDIA_KEYERR_HARDWARECHANGE_CODE=105,e.MEDIA_KEYERR_DOMAIN_CODE=106,e.MEDIA_KEY_MESSAGE_ERROR_CODE=107,e.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE=108,e.SERVER_CERTIFICATE_UPDATED_ERROR_CODE=109,e.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE=110,e.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE=111,e.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE=112,e.KEY_SESSION_CREATED_ERROR_CODE=113,e.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE=114,e.MEDIA_KEYERR_UNKNOWN_MESSAGE="An unspecified error occurred. This value is used for errors that don't match any of the other codes.",e.MEDIA_KEYERR_CLIENT_MESSAGE="The Key System could not be installed or updated.",e.MEDIA_KEYERR_SERVICE_MESSAGE="The message passed into update indicated an error from the license service.",e.MEDIA_KEYERR_OUTPUT_MESSAGE="There is no available output device with the required characteristics for the content protection system.",e.MEDIA_KEYERR_HARDWARECHANGE_MESSAGE="A hardware configuration change caused a content protection error.",e.MEDIA_KEYERR_DOMAIN_MESSAGE="An error occurred in a multi-device domain licensing configuration. The most common error is a failure to join the domain.",e.MEDIA_KEY_MESSAGE_ERROR_MESSAGE="Multiple key sessions were creates with a user-agent that does not support sessionIDs!! Unpredictable behavior ahead!",e.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE="DRM: Empty key message from CDM",e.SERVER_CERTIFICATE_UPDATED_ERROR_MESSAGE="Error updating server certificate -- ",e.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE="DRM: KeyStatusChange error! -- License has expired",e.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE="DRM: No license server URL specified!",e.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE="DRM: KeySystem Access Denied! -- ",e.KEY_SESSION_CREATED_ERROR_MESSAGE="DRM: unable to create session! --",e.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE="DRM: licenser error! --",e}return o}(r("./src/core/errors/ErrorsBase.js").default));t.default=s},"./src/streaming/protection/models/ProtectionModel_01b.js":function(e,t,r){r.r(t);var n=r("./src/streaming/protection/controllers/ProtectionKeyController.js"),a=r("./src/streaming/protection/vo/NeedKey.js"),i=r("./src/streaming/vo/DashJSError.js"),s=r("./src/streaming/protection/vo/KeyMessage.js"),o=r("./src/streaming/protection/vo/KeySystemConfiguration.js"),u=r("./src/streaming/protection/vo/KeySystemAccess.js"),l=r("./src/streaming/protection/errors/ProtectionErrors.js");function c(e){e=e||{};var t,r,c,f,d,h,g,p,m,y=this.context,E=e.eventBus,_=e.events,v=e.debug,T=e.api,S=e.errHandler;function b(){c&&I();for(var e=0;e<g.length;e++)A(g[e]);E.trigger(_.TEARDOWN_COMPLETE)}function A(e){try{c[T.cancelKeyRequest](f.systemString,e.sessionId)}catch(t){E.trigger(_.KEY_SESSION_CLOSED,{data:null,error:"Error closing session ("+e.sessionId+") "+t.message})}}function R(e,t){if(t&&e){for(var r=e.length,n=0;n<r;n++)if(e[n].sessionId==t)return e[n];return null}return null}function I(){c.removeEventListener(T.keyerror,m),c.removeEventListener(T.needkey,m),c.removeEventListener(T.keymessage,m),c.removeEventListener(T.keyadded,m)}return t={getAllInitData:function(){for(var e=[],t=0;t<h.length;t++)e.push(h[t].initData);for(var r=0;r<g.length;r++)e.push(g[r].initData);return e},getSessions:function(){return g.concat(h)},requestKeySystemAccess:function(e){return new Promise(function(t,r){var n=c;n||(n=document.createElement("video"));for(var a=!1,i=0;i<e.length;i++)for(var s=e[i].ks.systemString,l=e[i].configs,f=null,h=0;h<l.length;h++){var g=l[h].videoCapabilities;if(g&&0!==g.length){f=[];for(var p=0;p<g.length;p++)""!==n.canPlayType(g[p].contentType,s)&&f.push(g[p])}if(f&&(!f||0!==f.length)){a=!0;var m=new o.default(null,f),y=d.getKeySystemBySystemString(s),v=new u.default(y,m);E.trigger(_.KEY_SYSTEM_ACCESS_COMPLETE,{data:v}),t({data:v});break}}if(!a){var T="Key system access denied! -- No valid audio/video content configurations detected!";E.trigger(_.KEY_SYSTEM_ACCESS_COMPLETE,{error:T}),r({error:T})}})},selectKeySystem:function(e){return f=e.keySystem,Promise.resolve(f)},setMediaElement:function(e){if(c!==e){if(c){I();for(var t=0;t<g.length;t++)A(g[t]);g=[]}(c=e)&&(c.addEventListener(T.keyerror,m),c.addEventListener(T.needkey,m),c.addEventListener(T.keymessage,m),c.addEventListener(T.keyadded,m),E.trigger(_.VIDEO_ELEMENT_SELECTED))}},createKeySession:function(e){if(!f)throw new Error("Can not create sessions until you have selected a key system");if(p||0===g.length){var t={sessionId:null,keyId:e.keyId,initData:e.initData,getKeyId:function(){return this.keyId},getSessionId:function(){return this.sessionId},getExpirationTime:function(){return NaN},getSessionType:function(){return"temporary"}};return h.push(t),c[T.generateKeyRequest](f.systemString,new Uint8Array(e.initData)),t}throw new Error("Multiple sessions not allowed!")},updateKeySession:function(e,t){var r=e.sessionId;if(d.isClearKey(f))for(var n=0;n<t.keyPairs.length;n++)c[T.addKey](f.systemString,t.keyPairs[n].key,t.keyPairs[n].keyID,r);else c[T.addKey](f.systemString,new Uint8Array(t),new Uint8Array(e.initData),r);E.trigger(_.KEY_SESSION_UPDATED)},closeKeySession:A,setServerCertificate:function(){},loadKeySession:function(){},removeKeySession:function(){},stop:b,reset:b},r=v.getLogger(t),c=null,f=null,h=[],g=[],d=Object(n.default)(y).getInstance(),m={handleEvent:function(e){var t=null;switch(e.type){case T.needkey:var n=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;E.trigger(_.NEED_KEY,{key:new a.default(n,"cenc")});break;case T.keyerror:if((t=R(g,e.sessionId))||(t=R(h,e.sessionId)),t){var o=l.default.MEDIA_KEYERR_CODE,u="";switch(e.errorCode.code){case 1:o=l.default.MEDIA_KEYERR_UNKNOWN_CODE,u+="MEDIA_KEYERR_UNKNOWN - "+l.default.MEDIA_KEYERR_UNKNOWN_MESSAGE;break;case 2:o=l.default.MEDIA_KEYERR_CLIENT_CODE,u+="MEDIA_KEYERR_CLIENT - "+l.default.MEDIA_KEYERR_CLIENT_MESSAGE;break;case 3:o=l.default.MEDIA_KEYERR_SERVICE_CODE,u+="MEDIA_KEYERR_SERVICE - "+l.default.MEDIA_KEYERR_SERVICE_MESSAGE;break;case 4:o=l.default.MEDIA_KEYERR_OUTPUT_CODE,u+="MEDIA_KEYERR_OUTPUT - "+l.default.MEDIA_KEYERR_OUTPUT_MESSAGE;break;case 5:o=l.default.MEDIA_KEYERR_HARDWARECHANGE_CODE,u+="MEDIA_KEYERR_HARDWARECHANGE - "+l.default.MEDIA_KEYERR_HARDWARECHANGE_MESSAGE;break;case 6:o=l.default.MEDIA_KEYERR_DOMAIN_CODE,u+="MEDIA_KEYERR_DOMAIN - "+l.default.MEDIA_KEYERR_DOMAIN_MESSAGE}u+=" System Code = "+e.systemCode,E.trigger(_.KEY_ERROR,{error:new i.default(o,u,t)})}else r.error("No session token found for key error");break;case T.keyadded:(t=R(g,e.sessionId))||(t=R(h,e.sessionId)),t?(r.debug("DRM: Key added."),E.trigger(_.KEY_ADDED,{data:t})):r.debug("No session token found for key added");break;case T.keymessage:if((p=null!==e.sessionId&&void 0!==e.sessionId)?!(t=R(g,e.sessionId))&&h.length>0&&(t=h.shift(),g.push(t),t.sessionId=e.sessionId,E.trigger(_.KEY_SESSION_CREATED,{data:t})):h.length>0&&(t=h.shift(),g.push(t),0!==h.length&&S.error(new i.default(l.default.MEDIA_KEY_MESSAGE_ERROR_CODE,l.default.MEDIA_KEY_MESSAGE_ERROR_MESSAGE))),t){var c=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;t.keyMessage=c,E.trigger(_.INTERNAL_KEY_MESSAGE,{data:new s.default(t,c,e.defaultURL)})}else r.warn("No session token found for key message")}}},t}c.__dashjs_factory_name="ProtectionModel_01b",t.default=dashjs.FactoryMaker.getClassFactory(c)},"./src/streaming/protection/models/ProtectionModel_21Jan2015.js":function(e,t,r){r.r(t);var n=r("./src/streaming/protection/controllers/ProtectionKeyController.js"),a=r("./src/streaming/protection/vo/NeedKey.js"),i=r("./src/streaming/protection/errors/ProtectionErrors.js"),s=r("./src/streaming/vo/DashJSError.js"),o=r("./src/streaming/protection/vo/KeyMessage.js"),u=r("./src/streaming/protection/vo/KeySystemAccess.js"),l=r("./src/streaming/constants/ProtectionConstants.js");function c(e){e=e||{};var t,r,c,f,d,h,g,p,m=this.context,y=e.eventBus,E=e.events,_=e.debug;function v(e,t,r,n){if(void 0===navigator.requestMediaKeySystemAccess||"function"!=typeof navigator.requestMediaKeySystemAccess){var a="Insecure origins are not allowed";return y.trigger(E.KEY_SYSTEM_ACCESS_COMPLETE,{error:a}),void n({error:a})}var i=e[t].ks,s=e[t].configs,o=i.systemString;o===l.default.PLAYREADY_KEYSTEM_STRING&&"required"===s[0].persistentState&&(o+=".recommendation"),navigator.requestMediaKeySystemAccess(o,s).then(function(e){var t="function"==typeof e.getConfiguration?e.getConfiguration():null,n=new u.default(i,t);n.mksa=e,y.trigger(E.KEY_SYSTEM_ACCESS_COMPLETE,{data:n}),r({data:n})}).catch(function(a){if(t+1<e.length)v(e,t+1,r,n);else{var i="Key system access denied! ";y.trigger(E.KEY_SYSTEM_ACCESS_COMPLETE,{error:i+a.message}),n({error:i+a.message})}})}function T(e){var t=e.session;return t.removeEventListener("keystatuseschange",e),t.removeEventListener("message",e),t.close()}function S(e){for(var t=0;t<h.length;t++)if(h[t]===e){h.splice(t,1);break}}function b(e){var t,r;return e&&e.length>0&&(e[0]&&("string"==typeof e[0]?t=e[0]:r=e[0]),e[1]&&("string"==typeof e[1]?t=e[1]:r=e[1])),{status:t,keyId:r}}function A(e,t){var n={session:e,keyId:t.keyId,initData:t.initData,sessionId:t.sessionId,sessionType:t.sessionType,handleEvent:function(e){switch(e.type){case"keystatuseschange":y.trigger(E.KEY_STATUSES_CHANGED,{data:this}),e.target.keyStatuses.forEach(function(){var e=b(arguments);"expired"===e.status?y.trigger(E.INTERNAL_KEY_STATUS_CHANGED,{error:new s.default(i.default.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE,i.default.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE)}):y.trigger(E.INTERNAL_KEY_STATUS_CHANGED,e)});break;case"message":var t=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;y.trigger(E.INTERNAL_KEY_MESSAGE,{data:new o.default(this,t,void 0,e.messageType)})}},getKeyId:function(){return this.keyId},getSessionId:function(){return e.sessionId},getSessionType:function(){return this.sessionType},getExpirationTime:function(){return e.expiration},getKeyStatuses:function(){return e.keyStatuses},getUsable:function(){var t=!1;return e.keyStatuses.forEach(function(){"usable"===b(arguments).status&&(t=!0)}),t}};return e.addEventListener("keystatuseschange",n),e.addEventListener("message",n),e.closed.then(function(){S(n),r.debug("DRM: Session closed. SessionID = "+n.getSessionId()),y.trigger(E.KEY_SESSION_CLOSED,{data:n.getSessionId()})}),h.push(n),n}return t={getAllInitData:function(){for(var e=[],t=0;t<h.length;t++)h[t].initData&&e.push(h[t].initData);return e},getSessions:function(){return h},requestKeySystemAccess:function(e){return new Promise(function(t,r){v(e,0,t,r)})},selectKeySystem:function(e){return new Promise(function(t,r){e.mksa.createMediaKeys().then(function(t){return c=e.keySystem,d=t,f?f.setMediaKeys(d):Promise.resolve()}).then(function(){t(c)}).catch(function(){r({error:"Error selecting keys system ("+e.keySystem.systemString+")! Could not create MediaKeys -- TODO"})})})},setMediaElement:function(e){f!==e&&(f&&(f.removeEventListener("encrypted",g),f.setMediaKeys&&f.setMediaKeys(null)),(f=e)&&(f.addEventListener("encrypted",g),f.setMediaKeys&&d&&f.setMediaKeys(d)))},setServerCertificate:function(e){if(!c||!d)throw new Error("Can not set server certificate until you have selected a key system");d.setServerCertificate(e).then(function(){r.info("DRM: License server certificate successfully updated."),y.trigger(E.SERVER_CERTIFICATE_UPDATED)}).catch(function(e){y.trigger(E.SERVER_CERTIFICATE_UPDATED,{error:new s.default(i.default.SERVER_CERTIFICATE_UPDATED_ERROR_CODE,i.default.SERVER_CERTIFICATE_UPDATED_ERROR_MESSAGE+e.name)})})},createKeySession:function(e){if(!c||!d)throw new Error("Can not create sessions until you have selected a key system");var t=d.createSession(e.sessionType),n=A(t,e),a=c.systemString===l.default.CLEARKEY_KEYSTEM_STRING&&(e.initData||e.protData&&e.protData.clearkeys)?l.default.INITIALIZATION_DATA_TYPE_KEYIDS:l.default.INITIALIZATION_DATA_TYPE_CENC;t.generateRequest(a,e.initData).then(function(){r.debug("DRM: Session created. SessionID = "+n.getSessionId()),y.trigger(E.KEY_SESSION_CREATED,{data:n})}).catch(function(e){S(n),y.trigger(E.KEY_SESSION_CREATED,{data:null,error:new s.default(i.default.KEY_SESSION_CREATED_ERROR_CODE,i.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Error generating key request -- "+e.name)})})},updateKeySession:function(e,t){var r=e.session;p.isClearKey(c)&&(t=t.toJWK()),r.update(t).then(function(){y.trigger(E.KEY_SESSION_UPDATED)}).catch(function(t){y.trigger(E.KEY_ERROR,{error:new s.default(i.default.MEDIA_KEYERR_CODE,"Error sending update() message! "+t.name,e)})})},loadKeySession:function(e){if(!c||!d)throw new Error("Can not load sessions until you have selected a key system");for(var t=e.sessionId,n=0;n<h.length;n++)if(t===h[n].sessionId)return void r.warn("DRM: Ignoring session ID because we have already seen it!");var a=d.createSession(e.sessionType),o=A(a,e);a.load(t).then(function(e){e?(r.debug("DRM: Session loaded. SessionID = "+o.getSessionId()),y.trigger(E.KEY_SESSION_CREATED,{data:o})):(S(o),y.trigger(E.KEY_SESSION_CREATED,{data:null,error:new s.default(i.default.KEY_SESSION_CREATED_ERROR_CODE,i.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Could not load session! Invalid Session ID ("+t+")")}))}).catch(function(e){S(o),y.trigger(E.KEY_SESSION_CREATED,{data:null,error:new s.default(i.default.KEY_SESSION_CREATED_ERROR_CODE,i.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Could not load session ("+t+")! "+e.name)})})},removeKeySession:function(e){e.session.remove().then(function(){r.debug("DRM: Session removed. SessionID = "+e.getSessionId()),y.trigger(E.KEY_SESSION_REMOVED,{data:e.getSessionId()})},function(t){y.trigger(E.KEY_SESSION_REMOVED,{data:null,error:"Error removing session ("+e.getSessionId()+"). "+t.name})})},closeKeySession:function(e){T(e).catch(function(t){S(e),y.trigger(E.KEY_SESSION_CLOSED,{data:null,error:"Error closing session ("+e.getSessionId()+") "+t.name})})},stop:function(){for(var e,t=0;t<h.length;t++)(e=h[t]).getUsable()||T(e).catch(function(){S(e)})},reset:function(){var e,t=h.length;0!==t?function(){for(var r=function(e){S(e),0===h.length&&(f?(f.removeEventListener("encrypted",g),f.setMediaKeys(null).then(function(){y.trigger(E.TEARDOWN_COMPLETE)})):y.trigger(E.TEARDOWN_COMPLETE))},n=0;n<t;n++)(function(t){e.session.closed.then(function(){r(t)}),T(e).catch(function(){r(t)})})(e=h[n])}():y.trigger(E.TEARDOWN_COMPLETE)}},r=_.getLogger(t),c=null,f=null,d=null,h=[],p=Object(n.default)(m).getInstance(),g={handleEvent:function(e){if("encrypted"===e.type&&e.initData){var t=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;y.trigger(E.NEED_KEY,{key:new a.default(t,e.initDataType)})}}},t}c.__dashjs_factory_name="ProtectionModel_21Jan2015",t.default=dashjs.FactoryMaker.getClassFactory(c)},"./src/streaming/protection/models/ProtectionModel_3Feb2014.js":function(e,t,r){r.r(t);var n=r("./src/streaming/protection/controllers/ProtectionKeyController.js"),a=r("./src/streaming/protection/vo/NeedKey.js"),i=r("./src/streaming/vo/DashJSError.js"),s=r("./src/streaming/protection/errors/ProtectionErrors.js"),o=r("./src/streaming/protection/vo/KeyMessage.js"),u=r("./src/streaming/protection/vo/KeySystemConfiguration.js"),l=r("./src/streaming/protection/vo/KeySystemAccess.js");function c(e){e=e||{};var t,r,c,f,d,h,g,p,m,y=this.context,E=e.eventBus,_=e.events,v=e.debug,T=e.api;function S(){try{for(var e=0;e<g.length;e++)b(g[e]);c&&c.removeEventListener(T.needkey,p),E.trigger(_.TEARDOWN_COMPLETE)}catch(e){E.trigger(_.TEARDOWN_COMPLETE,{error:"Error tearing down key sessions and MediaKeys! -- "+e.message})}}function b(e){var t=e.session;t.removeEventListener(T.error,e),t.removeEventListener(T.message,e),t.removeEventListener(T.ready,e),t.removeEventListener(T.close,e);for(var r=0;r<g.length;r++)if(g[r]===e){g.splice(r,1);break}t[T.release]()}function A(){var e=null,t=function(){c.removeEventListener("loadedmetadata",e),c[T.setMediaKeys](d),E.trigger(_.VIDEO_ELEMENT_SELECTED)};c.readyState>=1?t():(e=t.bind(this),c.addEventListener("loadedmetadata",e))}return t={getAllInitData:function(){for(var e=[],t=0;t<g.length;t++)e.push(g[t].initData);return e},getSessions:function(){return g},requestKeySystemAccess:function(e){return new Promise(function(t,r){for(var n=!1,a=0;a<e.length;a++)for(var i=e[a].ks.systemString,s=e[a].configs,o=null,c=null,f=0;f<s.length;f++){var d=s[f].audioCapabilities,h=s[f].videoCapabilities;if(d&&0!==d.length){o=[];for(var g=0;g<d.length;g++)window[T.MediaKeys].isTypeSupported(i,d[g].contentType)&&o.push(d[g])}if(h&&0!==h.length){c=[];for(var p=0;p<h.length;p++)window[T.MediaKeys].isTypeSupported(i,h[p].contentType)&&c.push(h[p])}if(!(!o&&!c||o&&0===o.length||c&&0===c.length)){n=!0;var y=new u.default(o,c),v=m.getKeySystemBySystemString(i),S=new l.default(v,y);E.trigger(_.KEY_SYSTEM_ACCESS_COMPLETE,{data:S}),t({data:S});break}}if(!n){var b="Key system access denied! -- No valid audio/video content configurations detected!";E.trigger(_.KEY_SYSTEM_ACCESS_COMPLETE,{error:b}),r({error:b})}})},selectKeySystem:function(e){return new Promise(function(t,r){try{d=e.mediaKeys=new window[T.MediaKeys](e.keySystem.systemString),f=e.keySystem,h=e,c&&A(),t(f)}catch(e){r({error:"Error selecting keys system ("+f.systemString+")! Could not create MediaKeys -- TODO"})}})},setMediaElement:function(e){c!==e&&(c&&c.removeEventListener(T.needkey,p),(c=e)&&(c.addEventListener(T.needkey,p),d&&A()))},createKeySession:function(e){if(!f||!d||!h)throw new Error("Can not create sessions until you have selected a key system");var t=null;if(h.ksConfiguration.videoCapabilities&&h.ksConfiguration.videoCapabilities.length>0&&(t=h.ksConfiguration.videoCapabilities[0]),null===t&&h.ksConfiguration.audioCapabilities&&h.ksConfiguration.audioCapabilities.length>0&&(t=h.ksConfiguration.audioCapabilities[0]),null===t)throw new Error("Can not create sessions for unknown content types.");var n=t.contentType,a=d.createSession(n,new Uint8Array(e.initData),e.cdmData?new Uint8Array(e.cdmData):null),u=function(e,t){return{session:e,keyId:t.keyId,initData:t.initData,getKeyId:function(){return this.keyId},getSessionId:function(){return this.session.sessionId},getExpirationTime:function(){return NaN},getSessionType:function(){return"temporary"},handleEvent:function(e){switch(e.type){case T.error:E.trigger(_.KEY_ERROR,{error:new i.default(s.default.MEDIA_KEYERR_CODE,"KeyError",this)});break;case T.message:var t=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;E.trigger(_.INTERNAL_KEY_MESSAGE,{data:new o.default(this,t,e.destinationURL)});break;case T.ready:r.debug("DRM: Key added."),E.trigger(_.KEY_ADDED);break;case T.close:r.debug("DRM: Session closed. SessionID = "+this.getSessionId()),E.trigger(_.KEY_SESSION_CLOSED,{data:this.getSessionId()})}}}}(a,e);a.addEventListener(T.error,u),a.addEventListener(T.message,u),a.addEventListener(T.ready,u),a.addEventListener(T.close,u),g.push(u),r.debug("DRM: Session created. SessionID = "+u.getSessionId()),E.trigger(_.KEY_SESSION_CREATED,{data:u})},updateKeySession:function(e,t){var r=e.session;m.isClearKey(f)?r.update(new Uint8Array(t.toJWK())):r.update(new Uint8Array(t)),E.trigger(_.KEY_SESSION_UPDATED)},closeKeySession:b,setServerCertificate:function(){},loadKeySession:function(){},removeKeySession:function(){},stop:S,reset:S},r=v.getLogger(t),c=null,f=null,d=null,h=null,g=[],m=Object(n.default)(y).getInstance(),p={handleEvent:function(e){if(e.type===T.needkey&&e.initData){var t=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;E.trigger(_.NEED_KEY,{key:new a.default(t,"cenc")})}}},t}c.__dashjs_factory_name="ProtectionModel_3Feb2014",t.default=dashjs.FactoryMaker.getClassFactory(c)},"./src/streaming/protection/servers/ClearKey.js":function(e,t,r){r.r(t);var n=r("./src/streaming/protection/vo/KeyPair.js"),a=r("./src/streaming/protection/vo/ClearKeyKeySet.js");function i(){return{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"json"},getLicenseMessage:function(e){if(!e.hasOwnProperty("keys"))return null;for(var t=[],r=0;r<e.keys.length;r++){var i=e.keys[r],s=i.kid.replace(/=/g,""),o=i.k.replace(/=/g,"");t.push(new n.default(s,o))}return new a.default(t)},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}}}i.__dashjs_factory_name="ClearKey",t.default=dashjs.FactoryMaker.getSingletonFactory(i)},"./src/streaming/protection/servers/DRMToday.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/ProtectionConstants.js");function a(e){var t=(e=e||{}).BASE64,r={};return r[n.default.WIDEVINE_KEYSTEM_STRING]={responseType:"json",getLicenseMessage:function(e){return t.decodeArray(e.license)},getErrorResponse:function(e){return e}},r[n.default.PLAYREADY_KEYSTEM_STRING]={responseType:"arraybuffer",getLicenseMessage:function(e){return e},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}},{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(e){return r[e].responseType},getLicenseMessage:function(e,n){return function(){if(!t||!t.hasOwnProperty("decodeArray"))throw new Error("Missing config parameter(s)")}(),r[n].getLicenseMessage(e)},getErrorResponse:function(e,t){return r[t].getErrorResponse(e)}}}a.__dashjs_factory_name="DRMToday",t.default=dashjs.FactoryMaker.getSingletonFactory(a)},"./src/streaming/protection/servers/PlayReady.js":function(e,t,r){function n(){var e="http://schemas.xmlsoap.org/soap/envelope/";function t(e){var t=String.fromCharCode.apply(null,new Uint8Array(e));return decodeURIComponent(escape(t))}function r(r){if(window.DOMParser){var n=t(r),a=(new window.DOMParser).parseFromString(n,"text/xml"),i=a?a.getElementsByTagNameNS(e,"Envelope")[0]:null,s=i?i.getElementsByTagNameNS(e,"Body")[0]:null;if(s&&s.getElementsByTagNameNS(e,"Fault")[0])return null}return r}function n(r){var n="",a="",i="",s=-1,o=-1;if(window.DOMParser){var u=t(r),l=(new window.DOMParser).parseFromString(u,"text/xml"),c=l?l.getElementsByTagNameNS(e,"Envelope")[0]:null,f=c?c.getElementsByTagNameNS(e,"Body")[0]:null,d=f?f.getElementsByTagNameNS(e,"Fault")[0]:null,h=d?d.getElementsByTagName("detail")[0]:null,g=h?h.getElementsByTagName("Exception")[0]:null,p=null;if(null===d)return u;n=(p=d.getElementsByTagName("faultstring")[0].firstChild)?p.nodeValue:null,null!==g&&(a=(p=g.getElementsByTagName("StatusCode")[0])?p.firstChild.nodeValue:null,s=(i=(p=g.getElementsByTagName("Message")[0])?p.firstChild.nodeValue:null)?i.lastIndexOf("[")+1:-1,o=i?i.indexOf("]"):-1,i=i?i.substring(s,o):"")}var m="code: ".concat(a,", name: ").concat(n);return i&&(m+=", message: ".concat(i)),m}return{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"arraybuffer"},getLicenseMessage:function(e){return r.call(this,e)},getErrorResponse:function(e){return n.call(this,e)}}}r.r(t),n.__dashjs_factory_name="PlayReady",t.default=dashjs.FactoryMaker.getSingletonFactory(n)},"./src/streaming/protection/servers/Widevine.js":function(e,t,r){function n(){return{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"arraybuffer"},getLicenseMessage:function(e){return e},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}}}r.r(t),n.__dashjs_factory_name="Widevine",t.default=dashjs.FactoryMaker.getSingletonFactory(n)},"./src/streaming/protection/vo/ClearKeyKeySet.js":function(e,t,r){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}r.r(t);var a=function(){function e(t,r){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r&&"persistent"!==r&&"temporary"!==r)throw new Error("Invalid ClearKey key set type! Must be one of 'persistent' or 'temporary'");this.keyPairs=t,this.type=r}var t,r;return t=e,(r=[{key:"toJWK",value:function(){var e,t=this.keyPairs.length,r={keys:[]};for(e=0;e<t;e++){var n={kty:"oct",alg:"A128KW",kid:this.keyPairs[e].keyID,k:this.keyPairs[e].key};r.keys.push(n)}this.type&&(r.type=this.type);var a=JSON.stringify(r),i=a.length,s=new ArrayBuffer(i),o=new Uint8Array(s);for(e=0;e<i;e++)o[e]=a.charCodeAt(e);return s}}])&&n(t.prototype,r),e}();t.default=a},"./src/streaming/protection/vo/KeyMessage.js":function(e,t,r){r.r(t),t.default=function e(t,r,n,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.sessionToken=t,this.message=r,this.defaultURL=n,this.messageType=a||"license-request"}},"./src/streaming/protection/vo/KeyPair.js":function(e,t,r){r.r(t),t.default=function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.keyID=t,this.key=r}},"./src/streaming/protection/vo/KeySystemAccess.js":function(e,t,r){r.r(t),t.default=function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.keySystem=t,this.ksConfiguration=r}},"./src/streaming/protection/vo/KeySystemConfiguration.js":function(e,t,r){r.r(t),t.default=function e(t,r,n,a,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.initDataTypes=["cenc"],t&&t.length&&(this.audioCapabilities=t),r&&r.length&&(this.videoCapabilities=r),this.distinctiveIdentifier=n,this.persistentState=a,this.sessionTypes=i}},"./src/streaming/protection/vo/LicenseRequest.js":function(e,t,r){r.r(t),t.default=function e(t,r,n,a,i,s,o,u){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t,this.method=r,this.responseType=n,this.headers=a,this.withCredentials=i,this.messageType=s,this.sessionId=o,this.data=u}},"./src/streaming/protection/vo/LicenseResponse.js":function(e,t,r){r.r(t),t.default=function e(t,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t,this.headers=r,this.data=n}},"./src/streaming/protection/vo/MediaCapability.js":function(e,t,r){r.r(t),t.default=function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.contentType=t,this.robustness=r}},"./src/streaming/protection/vo/NeedKey.js":function(e,t,r){r.r(t),t.default=function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.initData=t,this.initDataType=r}},"./src/streaming/rules/DroppedFramesHistory.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js");function a(){var e={},t={},r={};return{push:function(n,a,i){if(a){e[n]||(e[n]=[],t[n]=0,r[n]=0);var s=i&&i.droppedVideoFrames?i.droppedVideoFrames:0,o=i&&i.totalVideoFrames?i.totalVideoFrames:0,u=s-t;t[n]=s;var l=o-r;r[n]=o;var c=e[n];isNaN(a)||(c[a]?(c[a].droppedVideoFrames+=u,c[a].totalVideoFrames+=l):c[a]={droppedVideoFrames:u,totalVideoFrames:l})}},getFrameHistory:function(t){return e[t]},clearForStream:function(n){try{delete e[n],delete t[n],delete r[n]}catch(e){}},reset:function(){e={},t={},r={}}}}a.__dashjs_factory_name="DroppedFramesHistory";var i=n.default.getClassFactory(a);t.default=i},"./src/streaming/rules/RulesContext.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js");function a(e){var t=(e=e||{}).abrController,r=e.switchHistory,n=e.droppedFramesHistory,a=e.currentRequest,i=e.useBufferOccupancyABR,s=e.useL2AABR,o=e.useLoLPABR,u=e.streamProcessor?e.streamProcessor.getScheduleController():null,l=e.streamProcessor?e.streamProcessor.getRepresentationInfo():null,c=e.videoModel?e.videoModel:null;function f(){return l?l.mediaInfo:null}return{getMediaType:function(){var e=f();return e?e.type:null},getMediaInfo:f,getDroppedFramesHistory:function(){return n},getCurrentRequest:function(){return a},getSwitchHistory:function(){return r},getStreamInfo:function(){var e=f();return e?e.streamInfo:null},getScheduleController:function(){return u},getAbrController:function(){return t},getRepresentationInfo:function(){return l},useBufferOccupancyABR:function(){return i},useL2AABR:function(){return s},useLoLPABR:function(){return o},getVideoModel:function(){return c}}}a.__dashjs_factory_name="RulesContext",t.default=n.default.getClassFactory(a)},"./src/streaming/rules/SwitchRequest.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a={DEFAULT:.5,STRONG:1,WEAK:0};function i(e,t,r){var n,i;return n=void 0===e?-1:e,i=function(e){var t=a.DEFAULT;return e!==a.DEFAULT&&e!==a.STRONG&&e!==a.WEAK||(t=e),t}(r),{quality:n,reason:void 0===t?null:t,priority:i}}i.__dashjs_factory_name="SwitchRequest";var s=n.default.getClassFactory(i);s.NO_CHANGE=-1,s.PRIORITY=a,n.default.updateClassFactory(i.__dashjs_factory_name,s),t.default=s},"./src/streaming/rules/SwitchRequestHistory.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/streaming/rules/SwitchRequest.js");function i(){var e=[],t=[];return{push:function(r){r.newValue===a.default.NO_CHANGE&&(r.newValue=r.oldValue),e[r.oldValue]||(e[r.oldValue]={noDrops:0,drops:0,dropSize:0});var n=r.newValue-r.oldValue,i=n<0?1:0,s=i?-n:0,o=i?0:1;if(e[r.oldValue].drops+=i,e[r.oldValue].dropSize+=s,e[r.oldValue].noDrops+=o,t.push({idx:r.oldValue,noDrop:o,drop:i,dropSize:s}),t.length>8){var u=t.shift();e[u.idx].drops-=u.drop,e[u.idx].dropSize-=u.dropSize,e[u.idx].noDrops-=u.noDrop}},getSwitchRequests:function(){return e},reset:function(){e=[],t=[]}}}i.__dashjs_factory_name="SwitchRequestHistory";var s=n.default.getClassFactory(i);t.default=s},"./src/streaming/rules/ThroughputHistory.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/Constants.js"),a=r("./src/core/FactoryMaker.js");function i(e){var t,r,a,i,s,o=(e=e||{}).settings;function u(e,t,r,n){var a=Math.pow(.5,r/n.fast);e.fastEstimate=(1-a)*t+a*e.fastEstimate;var i=Math.pow(.5,r/n.slow);e.slowEstimate=(1-i)*t+i*e.slowEstimate,e.totalWeight+=r}function l(e,u,l){return o.get().streaming.abr.movingAverageMethod!==n.default.MOVING_AVERAGE_SLIDING_WINDOW?function(e,t){var r=e?s.throughputHalfLife:s.latencyHalfLife,n=e?a[t]:i[t];if(!n||n.totalWeight<=0)return NaN;var o=n.fastEstimate/(1-Math.pow(.5,n.totalWeight/r.fast)),u=n.slowEstimate/(1-Math.pow(.5,n.totalWeight/r.slow));return e?Math.min(o,u):Math.max(o,u)}(e,u):function(e,n,a){var i=function(e,n,a){var i,s;if(e?(i=t[n],s=a?3:4):(i=r[n],s=4),i){if(s>=i.length)s=i.length;else if(e)for(var o=1;o<s;++o){var u=i[i.length-o]/i[i.length-o-1];if((u>=1.3||u<=1/1.3)&&(s+=1)===i.length)break}}else s=0;return s}(e,n,a),s=(e?t:r)[n];return 0!==i&&s&&0!==s.length?(s=s.slice(-i)).reduce(function(e,t){return e+t})/s.length:NaN}(e,u,l)}function c(e,t){return l(!0,e,t)}function f(e){t[e]=t[e]||[],r[e]=r[e]||[],a[e]=a[e]||{fastEstimate:0,slowEstimate:0,totalWeight:0},i[e]=i[e]||{fastEstimate:0,slowEstimate:0,totalWeight:0}}function d(){t={},r={},a={},i={}}var h={push:function(e,l,c){if(l.trace&&l.trace.length){var d=l.tresponse.getTime()-l.trequest.getTime()||1,h=l._tfinish.getTime()-l.tresponse.getTime()||1,g=l.trace.reduce(function(e,t){return e+t.b[0]},0),p=0,m=0;if(o.get().streaming.lowLatencyEnabled){if(o.get().streaming.abr.fetchThroughputCalculationMode===n.default.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING){var y=l.trace.reduce(function(e,t){return e+t.t},0);m=Math.round(y/l.trace.length)}0===m&&(p=l.trace.reduce(function(e,t){return e+t.d},0))}else p=c?h:d+h;if(0!==p&&(m=Math.round(8*g/p)),f(e),function(e,t,r){return e===n.default.VIDEO?r<o.get().streaming.cacheLoadThresholds[n.default.VIDEO]:e===n.default.AUDIO?r<o.get().streaming.cacheLoadThresholds[n.default.AUDIO]:void 0}(e,0,h)){if(t[e].length>0&&!t[e].hasCachedEntries)return;t[e].hasCachedEntries=!0}else t[e]&&t[e].hasCachedEntries&&function(e){delete t[e],delete r[e],delete a[e],delete i[e],f(e)}(e);t[e].push(m),t[e].length>20&&t[e].shift(),r[e].push(d),r[e].length>20&&r[e].shift(),u(a[e],m,.001*h,s.throughputHalfLife),u(i[e],d,1,s.latencyHalfLife)}},getAverageThroughput:c,getSafeAverageThroughput:function(e,t){var r=c(e,t);return isNaN(r)||(r*=o.get().streaming.abr.bandwidthSafetyFactor),r},getAverageLatency:function(e){return l(!1,e)},reset:d};return s={throughputHalfLife:{fast:3,slow:8},latencyHalfLife:{fast:1,slow:2}},d(),h}i.__dashjs_factory_name="ThroughputHistory",t.default=a.default.getClassFactory(i)},"./src/streaming/rules/abr/ABRRulesCollection.js":function(e,t,r){r.r(t);var n=r("./src/streaming/rules/abr/ThroughputRule.js"),a=r("./src/streaming/rules/abr/InsufficientBufferRule.js"),i=r("./src/streaming/rules/abr/AbandonRequestsRule.js"),s=r("./src/streaming/rules/abr/DroppedFramesRule.js"),o=r("./src/streaming/rules/abr/SwitchHistoryRule.js"),u=r("./src/streaming/rules/abr/BolaRule.js"),l=r("./src/streaming/rules/abr/L2ARule.js"),c=r("./src/streaming/rules/abr/lolp/LoLpRule.js"),f=r("./src/core/FactoryMaker.js"),d=r("./src/streaming/rules/SwitchRequest.js"),h=r("./src/streaming/constants/Constants.js"),g="qualitySwitchRules",p="abandonFragmentRules";function m(e){e=e||{};var t,r,f=this.context,m=e.mediaPlayerModel,y=e.dashMetrics,E=e.settings;function _(e){return e.filter(function(e){return e.quality>d.default.NO_CHANGE})}function v(e){var t,r,n,a,i,s={},o=null;if(0!==e.length){for(s[d.default.PRIORITY.STRONG]={quality:d.default.NO_CHANGE,reason:null},s[d.default.PRIORITY.WEAK]={quality:d.default.NO_CHANGE,reason:null},s[d.default.PRIORITY.DEFAULT]={quality:d.default.NO_CHANGE,reason:null},t=0,r=e.length;t<r;t+=1)(n=e[t]).quality!==d.default.NO_CHANGE&&(s[n.priority].quality===d.default.NO_CHANGE||s[n.priority].quality>n.quality)&&(s[n.priority].quality=n.quality,s[n.priority].reason=n.reason||null);return s[d.default.PRIORITY.WEAK].quality!==d.default.NO_CHANGE&&(o=s[d.default.PRIORITY.WEAK]),s[d.default.PRIORITY.DEFAULT].quality!==d.default.NO_CHANGE&&(o=s[d.default.PRIORITY.DEFAULT]),s[d.default.PRIORITY.STRONG].quality!==d.default.NO_CHANGE&&(o=s[d.default.PRIORITY.STRONG]),o&&(a=o.quality,i=o.reason),Object(d.default)(f).create(a,i)}}return{initialize:function(){t=[],r=[],E.get().streaming.abr.useDefaultABRRules&&(E.get().streaming.abr.ABRStrategy===h.default.ABR_STRATEGY_L2A?t.push(Object(l.default)(f).create({dashMetrics:y,mediaPlayerModel:m,settings:E})):E.get().streaming.abr.ABRStrategy===h.default.ABR_STRATEGY_LoLP?t.push(Object(c.default)(f).create({dashMetrics:y})):(t.push(Object(u.default)(f).create({dashMetrics:y,mediaPlayerModel:m,settings:E})),t.push(Object(n.default)(f).create({dashMetrics:y})),E.get().streaming.abr.additionalAbrRules.insufficientBufferRule&&t.push(Object(a.default)(f).create({dashMetrics:y,settings:E})),E.get().streaming.abr.additionalAbrRules.switchHistoryRule&&t.push(Object(o.default)(f).create()),E.get().streaming.abr.additionalAbrRules.droppedFramesRule&&t.push(Object(s.default)(f).create()),E.get().streaming.abr.additionalAbrRules.abandonRequestsRule&&r.push(Object(i.default)(f).create({dashMetrics:y,mediaPlayerModel:m,settings:E})))),m.getABRCustomRules().forEach(function(e){e.type===g&&t.push(e.rule(f).create()),e.type===p&&r.push(e.rule(f).create())})},reset:function(){[t,r].forEach(function(e){e&&e.length&&e.forEach(function(e){return e.reset&&e.reset()})}),t=[],r=[]},getMaxQuality:function(e){return v(_(t.map(function(t){return t.getMaxIndex(e)})))||Object(d.default)(f).create()},getMinSwitchRequest:v,shouldAbandonFragment:function(e,t){return v(_(r.map(function(r){return r.shouldAbandon(e,t)})))||Object(d.default)(f).create()},getQualitySwitchRules:function(){return t}}}m.__dashjs_factory_name="ABRRulesCollection";var y=f.default.getClassFactory(m);y.QUALITY_SWITCH_RULES=g,y.ABANDON_FRAGMENT_RULES=p,f.default.updateSingletonFactory(m.__dashjs_factory_name,y),t.default=y},"./src/streaming/rules/abr/AbandonRequestsRule.js":function(e,t,r){r.r(t);var n=r("./src/streaming/rules/SwitchRequest.js"),a=r("./src/core/FactoryMaker.js"),i=r("./src/core/Debug.js");function s(e){e=e||{};var t,r,a,o,u,l=this.context,c=e.mediaPlayerModel,f=e.dashMetrics,d=e.settings;function h(){a={},o={},u=[]}return t={shouldAbandon:function(e){var t=Object(n.default)(l).create(n.default.NO_CHANGE,{name:s.__dashjs_factory_name});if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getCurrentRequest")&&e.hasOwnProperty("getRepresentationInfo")&&e.hasOwnProperty("getAbrController")))return t;var i,h,g=e.getMediaInfo(),p=e.getMediaType(),m=e.getStreamInfo(),y=m?m.id:null,E=e.getCurrentRequest();if(!isNaN(E.index)){i=p,h=E.index,a[i]=a[i]||{},a[i][h]=a[i][h]||{};var _=c.getStableBufferTime();if(f.getCurrentBufferLevel(p)>_)return t;var v=a[p][E.index];if(null===v||null===E.firstByteDate||o.hasOwnProperty(v.id))return t;if(void 0===v.firstByteTime&&(u[p]=[],v.firstByteTime=E.firstByteDate.getTime(),v.segmentDuration=E.duration,v.bytesTotal=E.bytesTotal,v.id=E.index),v.bytesLoaded=E.bytesLoaded,v.elapsedTime=(new Date).getTime()-v.firstByteTime,v.bytesLoaded>0&&v.elapsedTime>0&&function(e,t){u[e]=u[e]||[],u[e].push(t)}(p,Math.round(8*v.bytesLoaded/v.elapsedTime)),u[p].length>=5&&v.elapsedTime>500&&v.bytesLoaded<v.bytesTotal){var T=u[p].reduce(function(e,t){return e+t},0);if(v.measuredBandwidthInKbps=Math.round(T/u[p].length),v.estimatedTimeOfDownload=+(8*v.bytesTotal/v.measuredBandwidthInKbps/1e3).toFixed(2),v.estimatedTimeOfDownload<1.8*v.segmentDuration||0===e.getRepresentationInfo().quality)return t;if(!o.hasOwnProperty(v.id)){var S=e.getAbrController(),b=v.bytesTotal-v.bytesLoaded,A=S.getBitrateList(g),R=S.getQualityForBitrate(g,v.measuredBandwidthInKbps*d.get().streaming.abr.bandwidthSafetyFactor,y),I=S.getMinAllowedIndexFor(p,y),C=void 0!==I?Math.max(I,R):R;b>v.bytesTotal*A[C].bitrate/A[S.getQualityFor(p,y)].bitrate&&(t.quality=C,t.reason.throughput=v.measuredBandwidthInKbps,t.reason.fragmentID=v.id,o[v.id]=v,r.debug("["+p+"] frag id",v.id," is asking to abandon and switch to quality to ",C," measured bandwidth was",v.measuredBandwidthInKbps),delete a[p][v.id])}}else v.bytesLoaded===v.bytesTotal&&delete a[p][v.id]}return t},reset:h},r=Object(i.default)(l).getInstance().getLogger(t),h(),t}s.__dashjs_factory_name="AbandonRequestsRule",t.default=a.default.getClassFactory(s)},"./src/streaming/rules/abr/BolaRule.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/MetricsConstants.js"),a=r("./src/streaming/rules/SwitchRequest.js"),i=r("./src/core/FactoryMaker.js"),s=r("./src/streaming/vo/metrics/HTTPRequest.js"),o=r("./src/core/EventBus.js"),u=r("./src/core/events/Events.js"),l=r("./src/core/Debug.js"),c=r("./src/streaming/MediaPlayerEvents.js"),f=10;function d(e){e=e||{};var t,r,i,d=this.context,h=e.dashMetrics,g=e.mediaPlayerModel,p=Object(o.default)(d).getInstance();function m(e,t,r){var n=r.reduce(function(e,t,n){return t>r[e]?n:e},0);if(0===n)return null;var a=Math.max(e,f+2*t.length),i=(r[n]-1)/(a/f-1);return{gp:i,Vp:f/i}}function y(e){e.placeholderBuffer=0,e.mostAdvancedSegmentStart=NaN,e.lastSegmentWasReplacement=!1,e.lastSegmentStart=NaN,e.lastSegmentDurationS=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN}function E(e,t){var r=g.getStableBufferTime();if(e.stableBufferTime!==r){var n=m(r,e.bitrates,e.utilities);if(n.Vp!==e.Vp||n.gp!==e.gp){var a=h.getCurrentBufferLevel(t),i=a+e.placeholderBuffer;i-=f,i*=n.Vp/e.Vp,i+=f,e.stableBufferTime=r,e.Vp=n.Vp,e.gp=n.gp,e.placeholderBuffer=Math.max(0,i-a)}}}function _(e,t){return e.Vp*(e.utilities[t]+e.gp)}function v(e,t){for(var r=e.bitrates[t],n=e.utilities[t],a=0,i=t-1;i>=0;--i)if(e.utilities[i]<e.utilities[t]){var s=e.bitrates[i],o=e.utilities[i],u=e.Vp*(e.gp+(r*o-s*n)/(r-s));a=Math.max(a,u)}return a}function T(){for(var e in i)i.hasOwnProperty(e)&&2===i[e].state&&(i[e].placeholderBuffer=0)}function S(){for(var e in i)if(i.hasOwnProperty(e)){var t=i[e];0!==t.state&&(t.state=1,y(t))}}function b(e){if(e&&e.chunk&&e.chunk.mediaInfo){var t=i[e.chunk.mediaInfo.type];if(t&&0!==t.state){var r=e.chunk.start;isNaN(t.mostAdvancedSegmentStart)||r>t.mostAdvancedSegmentStart?(t.mostAdvancedSegmentStart=r,t.lastSegmentWasReplacement=!1):t.lastSegmentWasReplacement=!0,t.lastSegmentStart=r,t.lastSegmentDurationS=e.chunk.duration,t.lastQuality=e.chunk.quality,R(t,e.chunk.mediaInfo.type)}}}function A(e){if(e&&e.metric===n.default.HTTP_REQUEST&&e.value&&e.value.type===s.HTTPRequest.MEDIA_SEGMENT_TYPE&&e.value.trace&&e.value.trace.length){var t=i[e.mediaType];t&&0!==t.state&&(t.lastSegmentRequestTimeMs=e.value.trequest.getTime(),t.lastSegmentFinishTimeMs=e.value._tfinish.getTime(),R(t,e.mediaType))}}function R(e,t){if(!isNaN(e.lastSegmentStart)&&!isNaN(e.lastSegmentRequestTimeMs)&&!isNaN(e.placeholderBuffer)){if(e.placeholderBuffer*=.99,!isNaN(e.lastSegmentFinishTimeMs)){var r=h.getCurrentBufferLevel(t)+.001*(e.lastSegmentFinishTimeMs-e.lastSegmentRequestTimeMs),n=_(e,e.lastQuality),a=Math.max(0,n-r);e.placeholderBuffer=Math.min(a,e.placeholderBuffer)}e.lastSegmentWasReplacement&&!isNaN(e.lastSegmentDurationS)&&(e.placeholderBuffer+=e.lastSegmentDurationS),e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN}}function I(e){if(e){var t=i[e.mediaType];t&&0!==t.state&&(t.abrQuality=e.newQuality)}}function C(e){if(e){var t=i[e.mediaType];if(t&&0!==t.state){var r,n=h.getCurrentBufferLevel(e.mediaType);r=t.abrQuality>0?v(t,t.abrQuality):f;var a=Math.max(0,r-n);t.placeholderBuffer=Math.min(t.placeholderBuffer,a)}}}function w(){i={}}return t={getMaxIndex:function(e){var t=Object(a.default)(d).create();if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getScheduleController")&&e.hasOwnProperty("getStreamInfo")&&e.hasOwnProperty("getAbrController")&&e.hasOwnProperty("useBufferOccupancyABR")))return t;var n=e.getMediaInfo(),s=e.getMediaType(),o=e.getScheduleController(),u=e.getStreamInfo(),l=e.getAbrController(),c=l.getThroughputHistory(),f=u?u.id:null,p=u&&u.manifestInfo&&u.manifestInfo.isDynamic,T=e.useBufferOccupancyABR();if(t.reason=t.reason||{},!T)return t;o.setTimeToLoadDelay(0);var S=function(e){var t=e.getMediaType(),r=i[t];return r?0!==r.state&&E(r,t):(r=function(e){var t={},r=e.getMediaInfo().bitrateList.map(function(e){return e.bandwidth}),n=function(e){return e.map(function(e){return Math.log(e)})}(r);n=n.map(function(e){return e-n[0]+1});var a=g.getStableBufferTime(),i=m(a,r,n);return i?(t.state=1,t.bitrates=r,t.utilities=n,t.stableBufferTime=a,t.Vp=i.Vp,t.gp=i.gp,t.lastQuality=0,y(t)):t.state=0,t}(e),i[t]=r),r}(e);if(0===S.state)return t;var b,A=h.getCurrentBufferLevel(s),R=c.getAverageThroughput(s,p),I=c.getSafeAverageThroughput(s,p),C=c.getAverageLatency(s);if(t.reason.state=S.state,t.reason.throughput=R,t.reason.latency=C,isNaN(R))return t;switch(S.state){case 1:b=l.getQualityForBitrate(n,I,f,C),t.quality=b,t.reason.throughput=I,S.placeholderBuffer=Math.max(0,v(S,b)-A),S.lastQuality=b,!isNaN(S.lastSegmentDurationS)&&A>=S.lastSegmentDurationS&&(S.state=2);break;case 2:!function(e,t){var r=Date.now();if(isNaN(e.lastSegmentFinishTimeMs)){if(!isNaN(e.lastCallTimeMs)){var n=.001*(r-e.lastCallTimeMs);e.placeholderBuffer+=Math.max(0,n)}}else{var a=.001*(r-e.lastSegmentFinishTimeMs);e.placeholderBuffer+=Math.max(0,a)}e.lastCallTimeMs=r,e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN,E(e,t)}(S,s),b=function(e,t){for(var r=e.bitrates.length,n=NaN,a=NaN,i=0;i<r;++i){var s=(e.Vp*(e.utilities[i]+e.gp)-t)/e.bitrates[i];(isNaN(a)||s>=a)&&(a=s,n=i)}return n}(S,A+S.placeholderBuffer);var w=l.getQualityForBitrate(n,I,f,C);b>S.lastQuality&&b>w&&(b=Math.max(w,S.lastQuality));var N=Math.max(0,A+S.placeholderBuffer-_(S,b));N<=S.placeholderBuffer?(S.placeholderBuffer-=N,N=0):(N-=S.placeholderBuffer,S.placeholderBuffer=0,b<l.getMaxAllowedIndexFor(s,f)?o.setTimeToLoadDelay(1e3*N):N=0),t.quality=b,t.reason.throughput=R,t.reason.latency=C,t.reason.bufferLevel=A,t.reason.placeholderBuffer=S.placeholderBuffer,t.reason.delay=N,S.lastQuality=b;break;default:r.debug("BOLA ABR rule invoked in bad state."),t.quality=l.getQualityForBitrate(n,I,f,C),t.reason.state=S.state,t.reason.throughput=I,t.reason.latency=C,S.state=1,y(S)}return t},reset:function(){w(),p.off(c.default.BUFFER_EMPTY,T,t),p.off(c.default.PLAYBACK_SEEKING,S,t),p.off(c.default.METRIC_ADDED,A,t),p.off(c.default.QUALITY_CHANGE_REQUESTED,I,t),p.off(c.default.FRAGMENT_LOADING_ABANDONED,C,t),p.off(u.default.MEDIA_FRAGMENT_LOADED,b,t)}},r=Object(l.default)(d).getInstance().getLogger(t),w(),p.on(c.default.BUFFER_EMPTY,T,t),p.on(c.default.PLAYBACK_SEEKING,S,t),p.on(c.default.METRIC_ADDED,A,t),p.on(c.default.QUALITY_CHANGE_REQUESTED,I,t),p.on(c.default.FRAGMENT_LOADING_ABANDONED,C,t),p.on(u.default.MEDIA_FRAGMENT_LOADED,b,t),t}d.__dashjs_factory_name="BolaRule",t.default=i.default.getClassFactory(d)},"./src/streaming/rules/abr/DroppedFramesRule.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/streaming/rules/SwitchRequest.js"),i=r("./src/core/Debug.js");function s(){var e,t,r=this.context;return e={getMaxIndex:function(e){var n=Object(a.default)(r).create();if(!e||!e.hasOwnProperty("getDroppedFramesHistory"))return n;var i=e.getDroppedFramesHistory(),s=e.getStreamInfo().id;if(i){var o=i.getFrameHistory(s);if(!o||0===o.length)return n;for(var u=0,l=0,c=a.default.NO_CHANGE,f=1;f<o.length;f++)if(o[f]&&(u=o[f].droppedVideoFrames,(l=o[f].totalVideoFrames)>375&&u/l>.15)){c=f-1,t.debug("index: "+c+" Dropped Frames: "+u+" Total Frames: "+l);break}return Object(a.default)(r).create(c,{droppedFrames:u})}return n}},t=Object(i.default)(r).getInstance().getLogger(e),e}s.__dashjs_factory_name="DroppedFramesRule",t.default=n.default.getClassFactory(s)},"./src/streaming/rules/abr/InsufficientBufferRule.js":function(e,t,r){r.r(t);var n=r("./src/core/EventBus.js"),a=r("./src/core/events/Events.js"),i=r("./src/core/FactoryMaker.js"),s=r("./src/core/Debug.js"),o=r("./src/streaming/rules/SwitchRequest.js"),u=r("./src/streaming/constants/Constants.js"),l=r("./src/streaming/constants/MetricsConstants.js"),c=r("./src/streaming/MediaPlayerEvents.js");function f(e){e=e||{};var t,r,i,f=this.context,d=Object(n.default)(f).getInstance(),h=e.dashMetrics,g=e.settings;function p(){(i={})[u.default.VIDEO]={ignoreCount:2},i[u.default.AUDIO]={ignoreCount:2}}function m(){p()}function y(e){isNaN(e.startTime)||e.mediaType!==u.default.AUDIO&&e.mediaType!==u.default.VIDEO||i[e.mediaType].ignoreCount>0&&i[e.mediaType].ignoreCount--}return t={getMaxIndex:function(e){var t=Object(o.default)(f).create();if(!e||!e.hasOwnProperty("getMediaType"))return t;!function(){if(!h||!h.hasOwnProperty("getCurrentBufferLevel")||!h.hasOwnProperty("getCurrentBufferState"))throw new Error(u.default.MISSING_CONFIG_ERROR)}();var n=e.getMediaType(),a=h.getCurrentBufferState(n),s=e.getRepresentationInfo().fragmentDuration,c=e.getStreamInfo(),d=c?c.id:null,p=c&&c.manifestInfo&&c.manifestInfo.isDynamic;if(function(e){return!g.get().streaming.lowLatencyEnabled&&i[e].ignoreCount>0}(n)||!s)return t;if(a&&a.state===l.default.BUFFER_EMPTY)r.debug("["+n+"] Switch to index 0; buffer is empty."),t.quality=0,t.reason="InsufficientBufferRule: Buffer is empty";else{var m=e.getMediaInfo(),y=e.getAbrController(),E=y.getThroughputHistory(),_=h.getCurrentBufferLevel(n),v=E.getAverageThroughput(n,p),T=E.getAverageLatency(n),S=v*(_/s)*.5;t.quality=y.getQualityForBitrate(m,S,d,T),t.reason="InsufficientBufferRule: being conservative to avoid immediate rebuffering"}return t},reset:function(){p(),d.off(c.default.PLAYBACK_SEEKING,m,t),d.off(a.default.BYTES_APPENDED_END_FRAGMENT,y,t)}},r=Object(s.default)(f).getInstance().getLogger(t),p(),d.on(c.default.PLAYBACK_SEEKING,m,t),d.on(a.default.BYTES_APPENDED_END_FRAGMENT,y,t),t}f.__dashjs_factory_name="InsufficientBufferRule",t.default=i.default.getClassFactory(f)},"./src/streaming/rules/abr/L2ARule.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/MetricsConstants.js"),a=r("./src/streaming/rules/SwitchRequest.js"),i=r("./src/core/FactoryMaker.js"),s=r("./src/streaming/vo/metrics/HTTPRequest.js"),o=r("./src/core/EventBus.js"),u=r("./src/core/events/Events.js"),l=r("./src/core/Debug.js"),c=r("./src/streaming/constants/Constants.js");function f(e){e=e||{};var t,r,i,f,d=this.context,h=e.dashMetrics,g=Object(o.default)(d).getInstance();function p(e){e.placeholderBuffer=0,e.mostAdvancedSegmentStart=NaN,e.lastSegmentWasReplacement=!1,e.lastSegmentStart=NaN,e.lastSegmentDurationS=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN}function m(){for(var e in r)if(r.hasOwnProperty(e)){var t=r[e];0!==t.state&&(t.state=1,p(t))}}function y(e){if(e&&e.chunk&&e.chunk.mediaInfo){var t=r[e.chunk.mediaInfo.type],n=i[e.chunk.mediaInfo.type];if(t&&0!==t.state){var a=e.chunk.start;isNaN(t.mostAdvancedSegmentStart)||a>t.mostAdvancedSegmentStart?(t.mostAdvancedSegmentStart=a,t.lastSegmentWasReplacement=!1):t.lastSegmentWasReplacement=!0,t.lastSegmentStart=a,t.lastSegmentDurationS=e.chunk.duration,t.lastQuality=e.chunk.quality,_(t,n)}}}function E(e){if(e&&e.metric===n.default.HTTP_REQUEST&&e.value&&e.value.type===s.HTTPRequest.MEDIA_SEGMENT_TYPE&&e.value.trace&&e.value.trace.length){var t=r[e.mediaType],a=i[e.mediaType];t&&0!==t.state&&(t.lastSegmentRequestTimeMs=e.value.trequest.getTime(),t.lastSegmentFinishTimeMs=e.value._tfinish.getTime(),_(t,a))}}function _(e,t){isNaN(e.lastSegmentStart)||isNaN(e.lastSegmentRequestTimeMs)||(t.segment_request_start_s=.001*e.lastSegmentRequestTimeMs,t.segment_download_finish_s=.001*e.lastSegmentFinishTimeMs,e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN)}function v(e){if(e&&e.mediaType){var t=r[e.mediaType];t&&0!==t.state&&(t.abrQuality=e.newQuality)}}function T(e,t){if(e.length!==t.length)return-1;for(var r=0,n=0;n<e.length;n++)r+=e[n]*t[n];return r}function S(){r={},i={}}return t={getMaxIndex:function(e){var t,n=Object(a.default)(d).create(),s=Math.pow(4,.99),o=Math.max(Math.pow(4,1),s*Math.sqrt(4)),u=e.getMediaInfo(),l=e.getMediaType(),g=u.bitrateList.map(function(e){return e.bandwidth}),m=g.length,y=e.getScheduleController(),E=e.getStreamInfo(),_=e.getAbrController(),v=_.getThroughputHistory(),S=E&&E.manifestInfo&&E.manifestInfo.isDynamic,b=e.useL2AABR(),A=h.getCurrentBufferLevel(l,!0),R=v.getSafeAverageThroughput(l,S),I=v.getAverageThroughput(l,S),C=v.getAverageLatency(l),w=e.getVideoModel().getPlaybackRate();if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getScheduleController")&&e.hasOwnProperty("getStreamInfo")&&e.hasOwnProperty("getAbrController")&&e.hasOwnProperty("useL2AABR")))return n;if(n.reason=n.reason||{},!b||l===c.default.AUDIO)return n;y.setTimeToLoadDelay(0);var N=function(e){var t=e.getMediaType(),n=r[t];return n||(n=function(e){var t={},r=e.getMediaInfo(),n=r.bitrateList.map(function(e){return e.bandwidth/1e3});return t.state=1,t.bitrates=n,t.lastQuality=0,function(e){e&&e.type&&(i[e.type]={},i[e.type].w=[],i[e.type].prev_w=[],i[e.type].Q=0,i[e.type].segment_request_start_s=0,i[e.type].segment_download_finish_s=0,i[e.type].B_target=1.5)}(r),p(t),t}(e),r[t]=n),n}(e);if(0===N.state)return n;var D=i[l];if(!D)return n;if(n.reason.state=N.state,n.reason.throughput=I,n.reason.latency=C,isNaN(I))return n;switch(N.state){case 1:if(t=_.getQualityForBitrate(u,R,E.id,C),n.quality=t,n.reason.throughput=R,N.lastQuality=t,!isNaN(N.lastSegmentDurationS)&&A>=D.B_target){N.state=2,D.Q=s;for(var M=0;M<m;++M)M===N.lastQuality?D.prev_w[M]=1:D.prev_w[M]=0}break;case 2:var O=[],P=h.getCurrentHttpRequest(l).trace.reduce(function(e,t){return e+t.d},0),L=h.getCurrentHttpRequest(l).trace.reduce(function(e,t){return e+t.b[0]},0),F=Math.round(8*L/P);F<1&&(F=1);for(var j=N.lastSegmentDurationS,x=1,k=0;k<m;++k)g[k]=g[k]/1e3,w*g[k]>F&&(x=-1),D.w[k]=D.prev_w[k]+x*(j/(2*o))*((D.Q+s)*(w*g[k]/F));D.w=function(e){for(var t=e.length,r=!1,n=[],a=0;a<t;++a)n[a]=e[a];for(var i=e.sort(function(e,t){return t-e}),s=0,o=0,u=[],l=0;l<t-1;++l)if((o=((s+=i[l])-1)/(l+1))>=i[l+1]){r=!0;break}r||(o=(s+i[t-1]-1)/t);for(var c=0;c<t;++c)u[c]=Math.max(n[c]-o,0);return u}(D.w);for(var B=0;B<m;++B)O[B]=D.w[B]-D.prev_w[B],D.prev_w[B]=D.w[B];D.Q=Math.max(0,D.Q-j+j*w*((T(g,D.prev_w)+T(g,O))/F));for(var U=[],G=0;G<m;++G)U[G]=Math.abs(g[G]-T(D.w,g));(t=U.indexOf(Math.min.apply(Math,U)))>N.lastQuality&&g[N.lastQuality+1]<=F&&(t=N.lastQuality+1),g[t]>=F&&(D.Q=2*Math.max(s,D.Q)),n.quality=t,n.reason.throughput=I,n.reason.latency=C,n.reason.bufferLevel=A,N.lastQuality=n.quality;break;default:f.debug("L2A ABR rule invoked in bad state."),n.quality=_.getQualityForBitrate(u,R,E.id,C),n.reason.state=N.state,n.reason.throughput=R,n.reason.latency=C,N.state=1,p(N)}return n},reset:function(){S(),g.off(u.default.PLAYBACK_SEEKING,m,t),g.off(u.default.MEDIA_FRAGMENT_LOADED,y,t),g.off(u.default.METRIC_ADDED,E,t),g.off(u.default.QUALITY_CHANGE_REQUESTED,v,t)}},f=Object(l.default)(d).getInstance().getLogger(t),S(),g.on(u.default.PLAYBACK_SEEKING,m,t),g.on(u.default.MEDIA_FRAGMENT_LOADED,y,t),g.on(u.default.METRIC_ADDED,E,t),g.on(u.default.QUALITY_CHANGE_REQUESTED,v,t),t}f.__dashjs_factory_name="L2ARule",t.default=i.default.getClassFactory(f)},"./src/streaming/rules/abr/SwitchHistoryRule.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/core/Debug.js"),i=r("./src/streaming/rules/SwitchRequest.js");function s(){var e,t,r=this.context;return e={getMaxIndex:function(e){for(var n=e?e.getSwitchHistory():null,a=n?n.getSwitchRequests():[],s=0,o=0,u=0,l=Object(i.default)(r).create(),c=0;c<a.length;c++)if(void 0!==a[c]&&(s+=a[c].drops,o+=a[c].noDrops,u+=a[c].dropSize,s+o>=6&&s/o>.075)){l.quality=c>0&&a[c].drops>0?c-1:c,l.reason={index:l.quality,drops:s,noDrops:o,dropSize:u},t.debug("Switch history rule index: "+l.quality+" samples: "+(s+o)+" drops: "+s);break}return l}},t=Object(a.default)(r).getInstance().getLogger(e),e}s.__dashjs_factory_name="SwitchHistoryRule",t.default=n.default.getClassFactory(s)},"./src/streaming/rules/abr/ThroughputRule.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/streaming/rules/SwitchRequest.js"),i=r("./src/streaming/constants/Constants.js"),s=r("./src/streaming/constants/MetricsConstants.js");function o(e){e=e||{};var t=this.context,r=e.dashMetrics;return{getMaxIndex:function(e){var n=Object(a.default)(t).create();if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("useBufferOccupancyABR")&&e.hasOwnProperty("getAbrController")&&e.hasOwnProperty("getScheduleController")))return n;!function(){if(!r||!r.hasOwnProperty("getCurrentBufferState"))throw new Error(i.default.MISSING_CONFIG_ERROR)}();var o=e.getMediaInfo(),u=e.getMediaType(),l=r.getCurrentBufferState(u),c=e.getScheduleController(),f=e.getAbrController(),d=e.getStreamInfo(),h=d?d.id:null,g=d&&d.manifestInfo?d.manifestInfo.isDynamic:null,p=f.getThroughputHistory(),m=p.getSafeAverageThroughput(u,g),y=p.getAverageLatency(u),E=e.useBufferOccupancyABR();return isNaN(m)||!l||E||f.getAbandonmentStateFor(h,u)!==s.default.ABANDON_LOAD&&(l.state===s.default.BUFFER_LOADED||g)&&(n.quality=f.getQualityForBitrate(o,m,h,y),c.setTimeToLoadDelay(0),n.reason={throughput:m,latency:y}),n},reset:function(){}}}o.__dashjs_factory_name="ThroughputRule",t.default=n.default.getClassFactory(o)},"./src/streaming/rules/abr/lolp/LearningAbrController.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/core/Debug.js");function i(){var e,t,r,n,i,s,o,u,l,c=this.context;function f(){r=null,n=1,i=100,s=0,o=null,u=null,l="dynamic_weight_selection"}function d(){var e=0;if(r)for(var t=0;t<r.length;t++){var n=r[t];n.state.throughput>e&&(e=n.state.throughput)}return e}function h(e,t,r){var n=e.map(function(e,n){return r[n]*Math.pow(e-t[n],2)}).reduce(function(e,t){return e+t});return(n<0?-1:1)*Math.sqrt(Math.abs(n))}function g(e,t){return h([e.state.throughput,e.state.latency,e.state.rebuffer,e.state.switch],[t.state.throughput,t.state.latency,t.state.rebuffer,t.state.switch],[1,1,1,1])}function p(e,t,r){for(var n=0;n<t.length;n++){var a=t[n],i=g(a,e);m(a,r,Math.exp(-1*Math.pow(i,2)/(2*Math.pow(.1,2))))}}function m(e,t,r){var n=e.state,a=[.01,.01,.01,.01];n.throughput=n.throughput+(t[0]-n.throughput)*a[0]*r,n.latency=n.latency+(t[1]-n.latency)*a[1]*r,n.rebuffer=n.rebuffer+(t[2]-n.rebuffer)*a[2]*r,n.switch=n.switch+(t[3]-n.switch)*a[3]*r}return e={getNextQuality:function(e,a,c,f,g,m,y){var E=c,_=f,v=a,T=function(e){if(!r){r=[];var t=e.bitrateList,a=[];s=t[0].bandwidth,t.forEach(function(e){a.push(e.bandwidth),e.bandwidth<s&&(s=e.bandwidth)}),l=a.map(function(e){return Math.pow(e,2)}).reduce(function(e,t){return e+t}),n=Math.sqrt(l);for(var i=0;i<t.length;i++){var o={qualityIndex:i,bitrate:t[i].bandwidth,state:{throughput:t[i].bandwidth/n,latency:0,rebuffer:0,switch:0}};r.push(o)}u=function(e){var t=[],r=function(e){for(var t=[],r=0;r<e;r++){var n=[Math.random()*d(),Math.random(),Math.random(),Math.random()];t.push(n)}return t}(Math.pow(e.length,2));t.push(r[0]);for(var n=[1,1,1,1],a=1;a<e.length;a++){for(var i=null,s=null,o=0;o<r.length;o++){for(var u=r[o],l=null,c=0;c<t.length;c++){var f=h(u,t[c],n);(null===l||f<l)&&(l=f)}(null===s||l>s)&&(i=u,s=l)}t.push(i)}for(var g=null,p=null,m=0;m<t.length;m++){for(var y=0,E=0;E<t.length;E++)m!==E&&(y+=h(t[m],t[E],n));(null===g||y>g)&&(g=y,p=m)}var _=[];for(_.push(t[p]),t.splice(p,1);t.length>0;){for(var v=null,T=null,S=0;S<t.length;S++){var b=h(_[0],t[S],n);(null===v||b<v)&&(v=b,T=S)}_.push(t[T]),t.splice(T,1)}return _}(r)}var l;return r}(e),S=a/n;S>1&&(S=d()),c/=i,t.debug("getNextQuality called throughput:".concat(S," latency:").concat(c," bufferSize:").concat(f," currentQualityIndex:").concat(m," playbackRate:").concat(g));var b=T[m],A=b.bitrate*y.getSegmentDuration()/v,R=Math.max(0,A-_);if(_-A<y.getMinBuffer())return t.debug("Buffer is low for bitrate= ".concat(b.bitrate," downloadTime=").concat(A," currentBuffer=").concat(_," rebuffer=").concat(R)),function(e,t){var n=0,a=e;if(r)for(var i=0;i<r.length;i++){var s=r[i];s.bitrate<e.bitrate&&s.bitrate>n&&t>s.bitrate&&(n=s.bitrate,a=s)}return a}(b,v).qualityIndex;switch(l){case"manual_weight_selection":o=[.4,.4,.4,.4];break;case"random_weight_selection":!function(e){o=function(e){for(var t=[],r=Math.sqrt(2/e),n=0;n<4;n++)t.push(Math.random()*r);return o=t}(e.length)}(T);break;default:!function(e,t,r,n,a,i,s){o||(o=u[u.length-1]);var l=e.findWeightVector(t,r,n,a,i,s);null!==l&&-1!==l&&(o=l)}(y,T,E,_,R,v,g)}for(var I=null,C=null,w=null,N=0;N<T.length;N++){var D=T[N],M=D.state,O=[M.throughput,M.latency,M.rebuffer,M.switch],P=o.slice(),L=y.getNextBufferWithBitrate(D.bitrate,_,v),F=L<y.getMinBuffer();F&&t.debug("Buffer is low for bitrate=".concat(D.bitrate," downloadTime=").concat(A," currentBuffer=").concat(_," nextBuffer=").concat(L)),(D.bitrate>a-1e4||F)&&D.bitrate!==s&&(P[0]=100);var j=h(O,[S,0,0,0],P);(null===I||j<I)&&(I=j,C=D.qualityIndex,w=D)}var x=Math.abs(b.bitrate-w.bitrate)/n;return p(b,T,[S,c,R,x]),p(w,T,[S,0,0,x]),C},reset:function(){f()}},t=Object(a.default)(c).getInstance().getLogger(e),f(),e}i.__dashjs_factory_name="LearningAbrController",t.default=n.default.getClassFactory(i)},"./src/streaming/rules/abr/lolp/LoLpQoEEvaluator.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/streaming/rules/abr/lolp/QoeInfo.js");function i(){var e,t,r,n,i;function s(){t=null,r=null,n=null,i=null}function o(e,t,r,n){var i=new a.default;return i.type=e,i.weights.bitrateReward=t||1,i.weights.bitrateSwitchPenalty=1,i.weights.rebufferPenalty=r||1e3,i.weights.latencyPenalty=[],i.weights.latencyPenalty.push({threshold:1.1,penalty:.05*n}),i.weights.latencyPenalty.push({threshold:1e8,penalty:.1*r}),i.weights.playbackSpeedPenalty=n||200,i}function u(e,t,r,n,a){a.bitrateWSum+=a.weights.bitrateReward*e,a.lastBitrate&&(a.bitrateSwitchWSum+=a.weights.bitrateSwitchPenalty*Math.abs(e-a.lastBitrate)),a.lastBitrate=e,a.rebufferWSum+=a.weights.rebufferPenalty*t;for(var i=0;i<a.weights.latencyPenalty.length;i++){var s=a.weights.latencyPenalty[i];if(r<=s.threshold){a.latencyWSum+=s.penalty*r;break}}a.playbackSpeedWSum+=a.weights.playbackSpeedPenalty*Math.abs(1-n),a.totalQoe=a.bitrateWSum-a.bitrateSwitchWSum-a.rebufferWSum-a.latencyWSum-a.playbackSpeedWSum}return e={setupPerSegmentQoe:function(e,a,s){t=o("segment",e,a,s),r=e,n=a,i=s},logSegmentMetrics:function(e,r,n,a){t&&u(e,r,n,a,t)},getPerSegmentQoe:function(){return t},calculateSingleUseQoe:function(e,t,a,s){var l=null;return r&&n&&i&&(l=o("segment",r,n,i)),l?(u(e,t,a,s,l),l.totalQoe):0},reset:function(){s()}},s(),e}i.__dashjs_factory_name="LoLpQoeEvaluator",t.default=n.default.getClassFactory(i)},"./src/streaming/rules/abr/lolp/LoLpRule.js":function(e,t,r){r.r(t);var n=r("./src/core/Debug.js"),a=r("./src/core/FactoryMaker.js"),i=r("./src/streaming/rules/abr/lolp/LearningAbrController.js"),s=r("./src/streaming/rules/abr/lolp/LoLpQoEEvaluator.js"),o=r("./src/streaming/rules/SwitchRequest.js"),u=r("./src/streaming/constants/MetricsConstants.js"),l=r("./src/streaming/rules/abr/lolp/LoLpWeightSelector.js"),c=r("./src/streaming/constants/Constants.js");function f(e){var t,r,a,f,d=(e=e||{}).dashMetrics,h=this.context;return r={getMaxIndex:function(e){try{var r=Object(o.default)(h).create(),n=e.getMediaInfo().type,i=e.getAbrController(),s=e.getStreamInfo(),g=i.getQualityFor(n,s.id),p=e.getMediaInfo(),m=d.getCurrentBufferState(n),y=e.getScheduleController(),E=d.getCurrentBufferLevel(n,!0),_=s&&s.manifestInfo?s.manifestInfo.isDynamic:null,v=y.getPlaybackController(),T=v.getCurrentLiveLatency();if(!e.useLoLPABR()||n===c.default.AUDIO)return r;T||(T=0);var S=v.getPlaybackRate(),b=i.getThroughputHistory().getSafeAverageThroughput(n,_);if(t.debug("Throughput ".concat(Math.round(b)," kbps")),isNaN(b)||!m)return r;if(i.getAbandonmentStateFor(s.id,n)===u.default.ABANDON_LOAD)return r;for(var A=p.bitrateList,R=e.getRepresentationInfo().fragmentDuration,I=A[0].bandwidth/1e3,C=A[A.length-1].bandwidth/1e3,w=0;w<A.length;w++){var N=A[w].bandwidth/1e3;N>C?C=N:N<I&&(I=N)}var D=A[g].bandwidth/1e3,M=d.getCurrentHttpRequest(n,!0),O=(M.tresponse.getTime()-M.trequest.getTime())/1e3,P=O>R?O-R:0;f.setupPerSegmentQoe(R,C,I),f.logSegmentMetrics(D,P,T,S);var L=Object(l.default)(h).create({targetLatency:1.5,bufferMin:.3,segmentDuration:R,qoeEvaluator:f});return r.quality=a.getNextQuality(p,1e3*b,T,E,S,g,L),r.reason={throughput:b,latency:T},r.priority=o.default.PRIORITY.STRONG,y.setTimeToLoadDelay(0),r.quality!==g&&console.log("[TgcLearningRule]["+n+"] requesting switch to index: ",r.quality,"Average throughput",Math.round(b),"kbps"),r}catch(e){throw e}},reset:function(){a.reset(),f.reset()}},t=Object(n.default)(h).getInstance().getLogger(r),a=Object(i.default)(h).create(),f=Object(s.default)(h).create(),r}f.__dashjs_factory_name="LoLPRule",t.default=a.default.getClassFactory(f)},"./src/streaming/rules/abr/lolp/LoLpWeightSelector.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js");function a(e){var t,r,n,a,i=e.targetLatency,s=e.bufferMin,o=e.segmentDuration,u=e.qoeEvaluator;function l(){return o}function c(e,t){var r=l();return t>r?e-r:e+r-t}return t={getMinBuffer:function(){return s},getSegmentDuration:l,getNextBufferWithBitrate:function(e,t,r){return c(t,e*o/r)},getNextBuffer:c,findWeightVector:function(e,t,a,l,f,d){var h=null,g=null,p=null,m=Math.abs(t-n);return e.forEach(function(e){r.forEach(function(r){r[0];var n=r[1],l=r[2],y=(r[3],e.bitrate*o/f),E=c(a,y),_=(0===l?10:1/l)*Math.max(1e-5,y-E),v=(0===n?10:1/n)*e.state.latency,T=u.calculateSingleUseQoe(e.bitrate,_,v,d);(null===h||T>h)&&function(e,t,r){return!(e>i+r)&&t>=s}(t,E,m)&&(h=T,g=r,p=e.bitrate)})}),null===g&&null===p&&(g=-1),n=t,g}},r=function e(t,r,n){if(n===r)return t;for(var i=t.length,s=0;s<i;s++)for(var o=t.shift(),u=0;u<a.length;u++)t.push(o.concat(a[u]));return e(t,r,n+1)}((a=[.2,.4,.6,.8,1]).map(function(e){return[e]}),4,1),n=0,t}a.__dashjs_factory_name="LoLpWeightSelector",t.default=n.default.getClassFactory(a)},"./src/streaming/rules/abr/lolp/QoeInfo.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.type=null,this.lastBitrate=null,this.weights={},this.weights.bitrateReward=null,this.weights.bitrateSwitchPenalty=null,this.weights.rebufferPenalty=null,this.weights.latencyPenalty=null,this.weights.playbackSpeedPenalty=null,this.bitrateWSum=0,this.bitrateSwitchWSum=0,this.rebufferWSum=0,this.latencyWSum=0,this.playbackSpeedWSum=0,this.totalQoe=0}},"./src/streaming/text/EmbeddedTextHtmlRender.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js");function a(){var e=0;function t(e){for(var t="",r=0;r<e.length;++r)t+=e[r].uchar;return t.length-t.replace(/^\s+/,"").length}function r(e){return"left: "+3.125*e.x+"%; top: "+6.66*e.y1+"%; width: "+(100-3.125*e.x)+"%; height: "+6.66*Math.max(e.y2-1-e.y1,1)+"%; align-items: flex-start; overflow: visible; -webkit-writing-mode: horizontal-tb;"}function n(e){return"red"===e?"rgb(255, 0, 0)":"green"===e?"rgb(0, 255, 0)":"blue"===e?"rgb(0, 0, 255)":"cyan"===e?"rgb(0, 255, 255)":"magenta"===e?"rgb(255, 0, 255)":"yellow"===e?"rgb(255, 255, 0)":"white"===e?"rgb(255, 255, 255)":"black"===e?"rgb(0, 0, 0)":e}function a(e,t){var r=e.videoHeight/15;return t?"font-size: "+r+"px; font-family: Menlo, Consolas, 'Cutive Mono', monospace; color: "+(t.foreground?n(t.foreground):"rgb(255, 255, 255)")+"; font-style: "+(t.italics?"italic":"normal")+"; text-decoration: "+(t.underline?"underline":"none")+"; white-space: pre; background-color: "+(t.background?n(t.background):"transparent")+";":"font-size: "+r+"px; font-family: Menlo, Consolas, 'Cutive Mono', monospace; justify-content: flex-start; text-align: left; color: rgb(255, 255, 255); font-style: normal; white-space: pre; line-height: normal; font-weight: normal; text-decoration: none; width: 100%; display: flex;"}function i(e){return e.replace(/^\s+/g,"")}function s(e){return e.replace(/\s+$/g,"")}return{createHTMLCaptionsFromScreen:function(n,o,u,l){var c,f,d=null,h=!1,g=-1,p={start:o,end:u,spans:[]},m="style_cea608_white_black",y={},E={},_=[];for(c=0;c<15;++c){var v=l.rows[c],T="",S=null;if(!1===v.isEmpty()){var b=t(v.chars);null===d&&(d={x:b,y1:c,y2:c+1,p:[]}),b!==g&&h&&(d.p.push(p),p={start:o,end:u,spans:[]},d.y2=c,d.name="region_"+d.x+"_"+d.y1+"_"+d.y2,!1===y.hasOwnProperty(d.name)?(_.push(d),y[d.name]=d):y[d.name].p.contat(d.p),d={x:b,y1:c,y2:c+1,p:[]});for(var A=0;A<v.chars.length;++A){var R=v.chars[A],I=R.penState;if(null===S||!I.equals(S)){T.trim().length>0&&(p.spans.push({name:m,line:T,row:c}),T="");var C="style_cea608_"+I.foreground+"_"+I.background;I.underline&&(C+="_underline"),I.italics&&(C+="_italics"),E.hasOwnProperty(C)||(E[C]=JSON.parse(JSON.stringify(I))),S=I,m=C}T+=R.uchar}T.trim().length>0&&p.spans.push({name:m,line:T,row:c}),h=!0,g=b}else h=!1,g=-1,d&&(d.p.push(p),p={start:o,end:u,spans:[]},d.y2=c,d.name="region_"+d.x+"_"+d.y1+"_"+d.y2,!1===y.hasOwnProperty(d.name)?(_.push(d),y[d.name]=d):y[d.name].p.contat(d.p),d=null)}d&&(d.p.push(p),d.y2=c+1,d.name="region_"+d.x+"_"+d.y1+"_"+d.y2,!1===y.hasOwnProperty(d.name)?(_.push(d),y[d.name]=d):y[d.name].p.contat(d.p),d=null);var w=[];for(c=0;c<_.length;++c){var N=_[c],D="sub_cea608_"+e++,M=document.createElement("div");M.id=D;var O=r(N);M.style.cssText="position: absolute; margin: 0; display: flex; box-sizing: border-box; pointer-events: none;"+O;var P=document.createElement("div");P.className="paragraph bodyStyle",P.style.cssText=a(n);var L=document.createElement("div");L.className="cueUniWrapper",L.style.cssText="unicode-bidi: normal; direction: ltr;";for(var F=0;F<N.p.length;++F){var j=N.p[F],x=0;for(f=0;f<j.spans.length;++f){var k=j.spans[f];if(k.line.length>0){if(0!==f&&x!=k.row){var B=document.createElement("br");B.className="lineBreak",L.appendChild(B)}var U=!1;x===k.row&&(U=!0),x=k.row;var G=E[k.name],H=document.createElement("span");H.className="spanPadding "+k.name+" customSpanColor",H.style.cssText=a(n,G),0!==f&&U?f===j.spans.length-1?H.textContent=s(k.line):H.textContent=k.line:j.spans.length>1&&f<j.spans.length-1&&k.row===j.spans[f+1].row?H.textContent=i(k.line):H.textContent=k.line.trim(),L.appendChild(H)}}}P.appendChild(L),M.appendChild(P);var q={bodyStyle:["%",90]};for(var Y in E)E.hasOwnProperty(Y)&&(q[Y]=["%",90]);w.push({type:"html",start:o,end:u,cueHTMLElement:M,cueID:D,cellResolution:[32,15],isFromCEA608:!0,fontSize:q,lineHeight:{},linePadding:{}})}return w}}}a.__dashjs_factory_name="EmbeddedTextHtmlRender",t.default=n.default.getSingletonFactory(a)},"./src/streaming/text/NotFragmentedTextBufferController.js":function(e,t,r){r.r(t);var n=r("./src/core/EventBus.js"),a=r("./src/core/events/Events.js"),i=r("./src/core/FactoryMaker.js"),s=r("./src/streaming/utils/InitCache.js"),o=r("./src/streaming/SourceBufferSink.js"),u=r("./src/streaming/vo/DashJSError.js"),l=r("./src/core/errors/Errors.js"),c="NotFragmentedTextBufferController";function f(e){e=e||{};var t,r,i,f,d,h,g=this.context,p=Object(n.default)(g).getInstance(),m=e.textController,y=e.errHandler,E=e.streamInfo,_=e.type;function v(e){f=e}function T(e){var t,n;r!==e&&(r=e)&&(t=a.default.BUFFERING_COMPLETED,n={},p.trigger(t,n,{streamId:E.id,mediaType:_}))}function S(e){e.chunk.bytes&&!r&&(h.save(e.chunk),d.append(e.chunk),T(!0))}return t={initialize:function(e){v(e)},getStreamId:function(){return E.id},getType:function(){return _},getBufferControllerType:function(){return c},createBufferSink:function(e){return new Promise(function(t,r){try{(d=Object(o.default)(g).create({mediaSource:f,textController:m,eventBus:p})).initializeForFirstUse(E,e),i||(d.getBuffer()&&"function"==typeof d.getBuffer().initialize&&d.getBuffer().initialize(),i=!0),t(d)}catch(e){y.error(new u.default(l.default.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,l.default.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+_)),r(e)}})},getBuffer:function(){return d},getBufferLevel:function(){return 0},getRangeAt:function(){return null},getAllRangesWithSafetyFactor:function(){return[]},getContinuousBufferTimeForTargetTime:function(){return Number.POSITIVE_INFINITY},setMediaSource:v,getMediaSource:function(){return f},appendInitSegmentFromCache:function(e){return null!==h.extract(E.id,e)},getIsBufferingCompleted:function(){return r},setIsBufferingCompleted:T,getIsPruningInProgress:function(){return!1},reset:function(e){p.off(a.default.INIT_FRAGMENT_LOADED,S,t),!e&&d&&(d.abort(),d.reset(),d=null)},clearBuffers:function(){return Promise.resolve()},prepareForPlaybackSeek:function(){return Promise.resolve()},prepareForReplacementTrackSwitch:function(){return r=!1,Promise.resolve()},setSeekTarget:function(){},updateAppendWindow:function(){return Promise.resolve()},pruneAllSafely:function(){return Promise.resolve()},updateBufferTimestampOffset:function(){return Promise.resolve()},segmentRequestingCompleted:function(){}},i=!1,f=null,r=!1,h=Object(s.default)(g).getInstance(),p.on(a.default.INIT_FRAGMENT_LOADED,S,t),t}f.__dashjs_factory_name=c,t.default=i.default.getClassFactory(f)},"./src/streaming/text/TextController.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/Constants.js"),a=r("./src/core/FactoryMaker.js"),i=r("./src/streaming/text/TextSourceBuffer.js"),s=r("./src/streaming/text/TextTracks.js"),o=r("./src/streaming/utils/VTTParser.js"),u=r("./src/streaming/utils/TTMLParser.js"),l=r("./src/core/EventBus.js"),c=r("./src/core/events/Events.js"),f=r("./src/streaming/MediaPlayerEvents.js"),d=r("./src/streaming/utils/SupervisorTools.js");function h(e){var t,r,a,h,g,p,m,y,E,_,v,T,S,b=this.context,A=e.adapter,R=e.errHandler,I=e.manifestModel,C=e.mediaController,w=e.videoModel,N=e.settings;function D(e){var t=e.tracks,n=e.index,a=e.streamId;!1===N.get().streaming.text.defaultEnabled&&!O()||S?P(a,-1):(y&&t.some(function(e,t){if(C.matchSettings(y,e))return P(a,t),n=t,!0}),_=!1),r[a].lastEnabledIndex=n,m.trigger(f.default.TEXT_TRACKS_ADDED,{enabled:O(),index:n,tracks:t,streamId:a}),T=!0}function M(e){if(!E&&e&&e.newMediaInfo){var t=e.newMediaInfo;t.type===n.default.TEXT&&(y={lang:t.lang,role:t.roles[0],index:t.index,codec:t.codec,accessibility:t.accessibility[0]})}}function O(){var e=!0;return _&&!v&&(e=!1),e}function P(e,t){(_=-1===t)&&C&&C.saveTextSettingsDisabled();var r=L(e);if(r!==t&&h[e]){h[e].setModeForTrackIdx(r,n.default.TEXT_HIDDEN),h[e].setCurrentTrackIdx(t),h[e].setModeForTrackIdx(t,n.default.TEXT_SHOWING);var i=h[e].getCurrentTrackInfo();i&&i.isFragmented&&!i.isEmbedded?function(e,t,r){if(a[e])for(var i=a[e].getConfig().fragmentedTracks,s=0;s<i.length;s++){var o=i[s];if(t.lang===o.lang&&(o.id?t.id===o.id:t.index===o.index)){var u=C.getCurrentTrackFor(n.default.TEXT,e);(o.id?u.id!==o.id:u.index!==o.index)?(h[e].deleteCuesFromTrackIdx(r),a[e].setCurrentFragmentedTrackIdx(s)):-1===r&&m.trigger(c.default.SET_FRAGMENTED_TEXT_AFTER_DISABLED,{},{streamId:e,mediaType:n.default.TEXT})}}}(e,i,r):i&&!i.isFragmented&&function(e,t){m.trigger(c.default.SET_NON_FRAGMENTED_TEXT,{currentTrackInfo:t},{streamId:e,mediaType:n.default.TEXT})}(e,i),C.setTrack(i)}}function L(e){return h[e].getCurrentTrackIdx()}function F(){a={},h={},r={},_=!0,T=!1,S=!1}return t={deactivateStream:function(e){if(e){var t=e.id;a[t]&&a[t].resetMediaInfos(),h[t]&&h[t].deleteAllTextTracks()}},initialize:function(){m.on(c.default.CURRENT_TRACK_CHANGED,M,t),m.on(c.default.TEXT_TRACKS_QUEUE_INITIALIZED,D,t)},initializeForStream:function(e){var t=e.id,n=Object(s.default)(b).create({videoModel:w,streamInfo:e});n.initialize(),h[t]=n;var o=Object(i.default)(b).create({errHandler:R,adapter:A,manifestModel:I,mediaController:C,videoModel:w,textTracks:n,vttParser:g,ttmlParser:p,streamInfo:e});o.initialize(),a[t]=o,r[t]={},r[t].lastEnabledIndex=-1},createTracks:function(e){var t=e.id;h[t]&&h[t].createTracks()},getTextSourceBuffer:function(e){var t=e.id;if(a&&a[t])return a[t]},getAllTracksAreDisabled:function(){return _},addEmbeddedTrack:function(e,t){var r=e.id;a[r]&&a[r].addEmbeddedTrack(t)},setInitialSettings:function(e){y=e,E=!0},enableText:function(e,t){Object(d.checkParameterType)(t,"boolean"),O()!==t&&(t&&P(e,r[e].lastEnabledIndex),t||(r[e].lastEnabledIndex=L(e),T?P(e,-1):S=!0))},isTextEnabled:O,setTextTrack:P,getCurrentTrackIdx:L,enableForcedTextStreaming:function(e){Object(d.checkParameterType)(e,"boolean"),v=e},addMediaInfosToBuffer:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=e.id;a[i]&&a[i].addMediaInfos(t,r,n)},reset:function(){F(),m.off(c.default.CURRENT_TRACK_CHANGED,M,t),m.off(c.default.TEXT_TRACKS_QUEUE_INITIALIZED,D,t),Object.keys(a).forEach(function(e){a[e].resetEmbedded(),a[e].reset()})}},y=null,v=!1,T=!1,E=!1,S=!1,g=Object(o.default)(b).getInstance(),p=Object(u.default)(b).getInstance(),m=Object(l.default)(b).getInstance(),F(),t}h.__dashjs_factory_name="TextController",t.default=a.default.getClassFactory(h)},"./src/streaming/text/TextSourceBuffer.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/Constants.js"),a=r("./src/streaming/vo/metrics/HTTPRequest.js"),i=r("./src/streaming/vo/TextTrackInfo.js"),s=r("./src/streaming/utils/BoxParser.js"),o=r("./src/streaming/utils/CustomTimeRanges.js"),u=r("./src/core/FactoryMaker.js"),l=r("./src/core/Debug.js"),c=r("./src/streaming/text/EmbeddedTextHtmlRender.js"),f=r("./node_modules/codem-isoboxer/dist/iso_boxer.js"),d=r.n(f),h=r("./externals/cea608-parser.js"),g=r.n(h),p=r("./src/core/EventBus.js"),m=r("./src/core/events/Events.js"),y=r("./src/streaming/vo/DashJSError.js"),E=r("./src/core/errors/Errors.js");function _(e){var t,r,u,f,h,_,v,T,S,b,A,R,I,C,w,N,D=e.errHandler,M=e.manifestModel,O=e.mediaController,P=e.videoModel,L=e.textTracks,F=e.vttParser,j=e.ttmlParser,x=e.streamInfo,k=this.context,B=Object(p.default)(k).getInstance(),U=!1;function G(){_=null,T=NaN,S=[],b=null,v=!1,h=[],f=null}function H(e){var t=new i.default;for(var r in e)t[r]=e[r];t.labels=e.labels,t.defaultTrack=function(e){var t=!1;return R.length>1&&e.isEmbedded?t=e.id&&e.id===n.default.CC1:1===R.length?e.id&&"string"==typeof e.id&&"CC"===e.id.substring(0,2)&&(t=!0):0===R.length&&(t=e.index===h[0].index),t}(e),t.isFragmented=e.isFragmented,t.isEmbedded=!!e.isEmbedded,t.isTTML=function(e){return e.codec&&e.codec.search(n.default.STPP)>=0||e.mimeType&&e.mimeType.search(n.default.TTML)>=0}(e),t.kind=function(e,t){var r=e.roles&&e.roles.length>0?t[e.roles[0]]:t.caption;return r===t.caption||r===t.subtitle?r:t.caption}(e,{subtitle:"subtitles",caption:"captions"}),L.addTextTrack(t)}function q(e){var t=e.chunk;t.mediaInfo.embeddedCaptions&&K(t.bytes,t)}function Y(e){A=e}function K(e,i){var s=i.mediaInfo,o=s.type,l=s.mimeType,c=s.codec||l;c?-1!==s.codec.indexOf("application/mp4")?function(e,a,i){var s;if("InitializationSegment"===a.segmentType)v=!0,T=u.getMediaTimescaleFromMoov(e);else{if(!v)return;(s=u.getSamplesInfo(e).sampleList).length>0&&(b=s[0].cts-a.start*T),i.search(n.default.STPP)>=0?function(e,a,i){var s,o;for(f=null!==f?f:z(i),s=0;s<a.length;s++){var u=a[s],l=u.cts,c=W(),h=c+l/T,g=h+u.duration/T;t.buffered.add(h,g);var p=new DataView(e,u.offset,u.subSizes[0]),m=d.a.Utils.dataViewToString(p,n.default.UTF8),y=[],E=u.offset+u.subSizes[0];for(o=1;o<u.subSizes.length;o++){var v=new Uint8Array(e,E,u.subSizes[o]),S=String.fromCharCode.apply(null,v);y.push(S),E+=u.subSizes[o]}try{var b=M.getValue().ttmlTimeIsRelative?l/T:0,R=f.parse(m,b,l/T,(l+u.duration)/T,y);L.addCaptions(A,c,R)}catch(e){_.removeExecutedRequestsBeforeTime(),this.remove(),r.error("TTML parser error: "+e.message)}}}(e,s,i):function(e,n){var a,i,s,o=[];for(a=0;a<n.length;a++){var u=n[a];u.cts-=b;var l=W()+u.cts/T,c=l+u.duration/T;t.buffered.add(l,c);var f=e.slice(u.offset,u.offset+u.size),h=d.a.parseBuffer(f);for(i=0;i<h.boxes.length;i++){var g=h.boxes[i];if(r.debug("VTT box1: "+g.type),"vtte"!==g.type&&"vttc"===g.type)for(r.debug("VTT vttc boxes.length = "+g.boxes.length),s=0;s<g.boxes.length;s++){var p=g.boxes[s];if(r.debug("VTT box2: "+p.type),"payl"===p.type){var m=p.cue_text;r.debug("VTT cue_text = "+m);var y=u.cts/T,E=(u.cts+u.duration)/T;o.push({start:y,end:E,data:m,styles:{}}),r.debug("VTT "+y+"-"+E+" : "+m)}}}}o.length>0&&L.addCaptions(A,0,o)}(e,s)}}(e,i,c):o===n.default.VIDEO?function(e,t){var n,i;if(t.segmentType===a.HTTPRequest.INIT_SEGMENT_TYPE)0===I&&(I=u.getMediaTimescaleFromMoov(e));else if(t.segmentType===a.HTTPRequest.MEDIA_SEGMENT_TYPE){if(0===I)return void r.warn("CEA-608: No timescale for embeddedTextTrack yet");var s=(i=u.getSamplesInfo(e)).lastSequenceNumber;if(w[0]||w[1]||function(){for(var e,t=0;t<R.length;t++){if(-1===(e=L.getTrackIdxForId(R[t].id)))return void r.warn("CEA-608: data before track is ready.");var n=V(e);w[t]=new g.a.Cea608Parser(t+1,{newCue:n},null)}}(),I){if(null!==C&&s!==C+i.numSequences)for(n=0;n<w.length;n++)w[n]&&w[n].reset();for(var o=function(e,t){if(0===t.length)return null;for(var r={splits:[],fields:[[],[]]},n=new DataView(e),a=0;a<t.length;a++)for(var i=t[a],s=g.a.findCea608Nalus(n,i.offset,i.size),o=null,u=0,l=0;l<s.length;l++)for(var c=g.a.extractCea608DataFromRange(n,s[l]),f=0;f<2;f++)if(c[f].length>0){i.cts!==o?u=0:u+=1;var d=W();r.fields[f].push([i.cts+d*I,c[f],u]),o=i.cts}return r.fields.forEach(function(e){e.sort(function(e,t){return e[0]===t[0]?e[2]-t[2]:e[0]-t[0]})}),r}(e,i.sampleList),l=0;l<w.length;l++){var c=o.fields[l],f=w[l];if(f)for(n=0;n<c.length;n++)f.addData(c[n][0]/I,c[n][1])}C=s}}}(e,i):function(e,r,a){var i,s,o=new DataView(e,0,e.byteLength);s=d.a.Utils.dataViewToString(o,n.default.UTF8);try{i=z(a).parse(s,0),L.addCaptions(L.getCurrentTrackIdx(),0,i),t.buffered&&t.buffered.add(r.start,r.end)}catch(e){D.error(new y.default(E.default.TIMED_TEXT_ERROR_ID_PARSE_CODE,E.default.TIMED_TEXT_ERROR_MESSAGE_PARSE+e.message,s))}}(e,i,c):r.error("No text type defined")}function V(e){return function(t,r,n){var a;(a=P.getTTMLRenderingDiv()?N.createHTMLCaptionsFromScreen(P.getElement(),t,r,n):[{start:t,end:r,data:n.getDisplayText(),styles:{}}])&&L.addCaptions(e,0,a)}}function W(){return isNaN(t.timestampOffset)?0:t.timestampOffset}function z(e){var t;return e.search(n.default.VTT)>=0?t=F:(e.search(n.default.TTML)>=0||e.search(n.default.STPP)>=0)&&(t=j),t}function X(e){R.forEach(function(t){var r=L.getTrackIdxForId(t.id);r>=0&&L.deleteCuesFromTrackIdx(r,e.from,e.to)})}return t={initialize:function(){U||(R=[],A=null,I=0,w=[],C=null,U=!0,N=Object(c.default)(k).getInstance(),B.on(m.default.VIDEO_CHUNK_RECEIVED,q,t),B.on(m.default.BUFFER_CLEARED,X,t))},addMediaInfos:function(e,r,a){if(h=h.concat(r),e===n.default.TEXT&&r[0].isFragmented&&!r[0].isEmbedded){_=a,t.buffered=Object(o.default)(k).create(),S=O.getTracksFor(n.default.TEXT,x.id).filter(function(e){return e.isFragmented});for(var i=O.getCurrentTrackFor(n.default.TEXT,x.id),s=0;s<S.length;s++)if(S[s]===i){Y(s);break}}for(var u=0;u<r.length;u++)H(r[u])},resetMediaInfos:function(){h=[]},getStreamId:function(){return x.id},append:K,abort:function(){},addEmbeddedTrack:function(e){if(U&&e)if(e.id===n.default.CC1||e.id===n.default.CC3){for(var t=0;t<R.length;t++)if(R[t].id===e.id)return;R.push(e)}else r.warn("Embedded track "+e.id+" not supported!")},resetEmbedded:function(){B.off(m.default.VIDEO_CHUNK_RECEIVED,q,t),B.off(m.default.BUFFER_CLEARED,X,t),L&&L.deleteAllTextTracks(),U=!1,R=[],w=[null,null],C=null},getConfig:function(){return{fragmentModel:_,fragmentedTracks:S,videoModel:P}},setCurrentFragmentedTrackIdx:Y,remove:function(e,r){void 0===e&&e===r&&(e=t.buffered.start(0),r=t.buffered.end(t.buffered.length-1)),t.buffered.remove(e,r),L.deleteCuesFromTrackIdx(A,e,r)},reset:function(){G(),h=[],u=null}},r=Object(l.default)(k).getInstance().getLogger(t),u=Object(s.default)(k).getInstance(),G(),t}_.__dashjs_factory_name="TextSourceBuffer",t.default=u.default.getClassFactory(_)},"./src/streaming/text/TextTracks.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/Constants.js"),a=r("./src/core/EventBus.js"),i=r("./src/core/events/Events.js"),s=r("./src/streaming/MediaPlayerEvents.js"),o=r("./src/core/FactoryMaker.js"),u=r("./src/core/Debug.js"),l=r("./node_modules/imsc/src/main/js/main.js");function c(e){var t,r,o,c,f,d,h,g,p,m,y,E,_,v,T,S,b,A=this.context,R=Object(a.default)(A).getInstance(),I=e.videoModel,C=e.streamInfo;function w(e){var t=e.kind,r=void 0!==e.id?e.id:e.lang,n=e.lang,a=e.isTTML,i=e.isEmbedded;return I.addTextTrack(t,r,n,a,i)}function N(e,t,r,n,a,i){var s=0,o=0;e/t>r/n?s=(o=t)/n*r:o=(s=e)/r*n;var u,l,c=0,f=0;return s/o>a?(f=o,c=o*a):(c=s,f=s/a),u=(e-c)/2,l=(t-f)/2,i?{x:u+.1*c,y:l+.1*f,w:.8*c,h:.8*f}:{x:u,y:l,w:c,h:f}}function D(e,t){var r=I.getClientWidth(),n=I.getClientHeight(),a=I.getVideoWidth(),i=I.getVideoHeight(),o=I.getVideoRelativeOffsetTop(),u=I.getVideoRelativeOffsetLeft();if(0!==a&&0!==i){var l=a/i,c=!1;e.isFromCEA608&&(l=3.5/3,c=!0);var f=N.call(this,r,n,a,i,l,c),d=f.w,E=f.h,T=f.x,b=f.y;if(d!=p||E!=m||T!=h||b!=g||t){if(h=T+u,g=b+o,p=d,m=E,y){var A=y.style;A&&(A.left=h+"px",A.top=g+"px",A.width=p+"px",A.height=m+"px",A.zIndex=_&&document[_]||v?S:null,R.trigger(s.default.CAPTION_CONTAINER_RESIZE))}var C=e.activeCues;if(C)for(var w=C.length,D=0;D<w;++D){var M=C[D];M.scaleCue(M)}}}}function M(e){var t,r,n,a,i,s=p,o=m;if(e.cellResolution){var u=[s/e.cellResolution[0],o/e.cellResolution[1]];if(e.linePadding)for(t in e.linePadding)if(e.linePadding.hasOwnProperty(t)){r=(e.linePadding[t]*u[0]).toString();for(var l=document.getElementsByClassName("spanPadding"),c=0;c<l.length;c++)l[c].style.cssText=l[c].style.cssText.replace(/(padding-left\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+r),l[c].style.cssText=l[c].style.cssText.replace(/(padding-right\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+r)}if(e.fontSize){for(t in e.fontSize)if(e.fontSize.hasOwnProperty(t)){"%"===e.fontSize[t][0]?n=e.fontSize[t][1]/100:"c"===e.fontSize[t][0]&&(n=e.fontSize[t][1]),r=(n*u[1]).toString(),i="defaultFontSize"!==t?document.getElementsByClassName(t):document.getElementsByClassName("paragraph");for(var f=0;f<i.length;f++)i[f].style.cssText=i[f].style.cssText.replace(/(font-size\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+r)}if(e.lineHeight)for(t in e.lineHeight)if(e.lineHeight.hasOwnProperty(t)){"%"===e.lineHeight[t][0]?a=e.lineHeight[t][1]/100:"c"===e.fontSize[t][0]&&(a=e.lineHeight[t][1]),r=(a*u[1]).toString(),i=document.getElementsByClassName(t);for(var d=0;d<i.length;d++)i[d].style.cssText=i[d].style.cssText.replace(/(line-height\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+r)}}}if(e.isd){var h=document.getElementById(e.cueID);h&&y.removeChild(h),O(e)}}function O(e){if(y){var t=document.createElement("div");y.appendChild(t),T=Object(l.renderHTML)(e.isd,t,function(t){var r=/^(urn:)(mpeg:[a-z0-9][a-z0-9-]{0,31}:)(subs:)([0-9]+)$/,n=/^#(.*)$/;if(r.test(t)){var a=r.exec(t),i=parseInt(a[4],10)-1;return"data:image/png;base64,"+btoa(e.images[i])}if(n.test(t)){var s=n.exec(t)[1];return"data:image/png;base64,"+e.embeddedImages[s]}return null},y.clientHeight,y.clientWidth,!1,function(e){r.info("renderCaption :",e)},T,!0),t.id=e.cueID,R.trigger(s.default.CAPTION_RENDERED,{captionDiv:t,currentTrackIdx:d})}}function P(e,t,a){var i=L(e),u=this;if(i&&Array.isArray(a)&&0!==a.length)for(var l=0;l<a.length;l++){var c=void 0,f=a[l];i.cellResolution=f.cellResolution,i.isFromCEA608=f.isFromCEA608,"html"!==f.type||!y||isNaN(f.start)||isNaN(f.end)?!f.data||isNaN(f.start)||isNaN(f.end)||(c=new o(f.start-t,f.end-t,f.data),f.styles&&(void 0!==f.styles.align&&"align"in c&&(c.align=f.styles.align),void 0!==f.styles.line&&"line"in c&&(c.line=f.styles.line),void 0!==f.styles.position&&"position"in c&&(c.position=f.styles.position),void 0!==f.styles.size&&"size"in c&&(c.size=f.styles.size)),c.onenter=function(){i.mode===n.default.TEXT_SHOWING&&R.trigger(s.default.CAPTION_RENDERED,{currentTrackIdx:d})}):((c=new o(f.start+t,f.end+t,"")).cueHTMLElement=f.cueHTMLElement,c.isd=f.isd,c.images=f.images,c.embeddedImages=f.embeddedImages,c.cueID=f.cueID,c.scaleCue=M.bind(u),c.cellResolution=f.cellResolution,c.lineHeight=f.lineHeight,c.linePadding=f.linePadding,c.fontSize=f.fontSize,y.style.left=h+"px",y.style.top=g+"px",y.style.width=p+"px",y.style.height=m+"px",c.onenter=function(){i.mode===n.default.TEXT_SHOWING&&(this.isd?(O(this),r.debug("Cue enter id:"+this.cueID)):(y.appendChild(this.cueHTMLElement),M.call(u,this),R.trigger(s.default.CAPTION_RENDERED,{captionDiv:this.cueHTMLElement,currentTrackIdx:d})))},c.onexit=function(){if(y)for(var e=y.childNodes,t=0;t<e.length;++t)e[t].id===this.cueID&&(r.debug("Cue exit id:"+e[t].id),y.removeChild(e[t]),--t)});try{c?x(i,c)||i.addCue(c):r.error("impossible to display subtitles.")}catch(e){throw B(i),i.addCue(c),e}}}function L(e){return e>=0&&c[e]?I.getTextTrack(c[e].kind,c[e].id,c[e].lang,c[e].isTTML,c[e].isEmbedded):null}function F(e){var t=this;if(e!==d){var r=L(d=e);j.call(this,r),E&&(clearInterval(E),E=null),r&&"html"===r.renderingType&&(D.call(this,r,!0),window.ResizeObserver?(b=new window.ResizeObserver(function(){D.call(t,r,!0)})).observe(I.getElement()):E=setInterval(D.bind(this,r),500))}}function j(e){H.call(this),e&&"html"===e.renderingType?U.call(this):G.call(this)}function x(e,t){if(!e.cues)return!1;for(var r=0;r<e.cues.length;r++)if(e.cues[r].startTime===t.startTime&&e.cues[r].endTime===t.endTime)return!0;return!1}function k(e,t,r){return(isNaN(t)||e.startTime>=t)&&(isNaN(r)||e.endTime<=r)}function B(e,t,r){if(e.cues)for(var n=e.cues,a=n.length-1;a>=0;a--)k(n[a],t,r)&&(n[a].onexit&&n[a].onexit(),e.removeCue(n[a]))}function U(){var e=document.getElementById("native-cue-style");if(!e){(e=document.createElement("style")).id="native-cue-style",document.head.appendChild(e);var t=e.sheet,n=I.getElement();try{n&&(n.id?t.insertRule("#"+n.id+"::cue {background: transparent}",0):0!==n.classList.length?t.insertRule("."+n.className+"::cue {background: transparent}",0):t.insertRule("video::cue {background: transparent}",0))}catch(e){r.info(""+e.message)}}}function G(){var e=document.getElementById("native-cue-style");e&&document.head.removeChild(e)}function H(){if(y)for(;y.firstChild;)y.removeChild(y.firstChild)}return t={initialize:function(){"undefined"!=typeof window&&"undefined"!=typeof navigator&&(o=window.VTTCue||window.TextTrackCue,c=[],f=[],d=-1,h=0,g=0,p=0,m=0,y=null,E=null,v=!1,S=2147483647,T=null,void 0!==document.fullscreenElement?_="fullscreenElement":void 0!==document.webkitIsFullScreen?_="webkitIsFullScreen":document.msFullscreenElement?_="msFullscreenElement":document.mozFullScreen&&(_="mozFullScreen"))},getStreamId:function(){return C.id},addTextTrack:function(e){c.push(e)},addCaptions:P,createTracks:function(){c.sort(function(e,t){return e.index-t.index}),y=I.getTTMLRenderingDiv();for(var e=-1,t=0;t<c.length;t++){var r=w(c[t]);f.push(r),c[t].defaultTrack&&(r.default=!0,e=t);var a=L(t);a&&(a.mode=n.default.TEXT_SHOWING,y&&(c[t].isTTML||c[t].isEmbedded)?a.renderingType="html":a.renderingType="default"),P(t,0,c[t].captionData),R.trigger(s.default.TEXT_TRACK_ADDED)}if(F.call(this,e),e>=0){R.on(s.default.PLAYBACK_METADATA_LOADED,function t(){var r=L(e);r&&"html"===r.renderingType&&D.call(this,r,!0),R.off(s.default.PLAYBACK_METADATA_LOADED,t,this)},this);for(var o=0;o<c.length;o++){var u=L(o);u&&(u.mode=o===e?n.default.TEXT_SHOWING:n.default.TEXT_HIDDEN)}}R.trigger(i.default.TEXT_TRACKS_QUEUE_INITIALIZED,{index:d,tracks:c,streamId:C.id})},getCurrentTrackIdx:function(){return d},setCurrentTrackIdx:F,getTrackIdxForId:function(e){for(var t=-1,r=0;r<c.length;r++)if(c[r].id===e){t=r;break}return t},getCurrentTrackInfo:function(){return c[d]},setModeForTrackIdx:function(e,t){var r=L(e);r&&r.mode!==t&&(r.mode=t)},deleteCuesFromTrackIdx:function(e,t,r){var n=L(e);n&&B(n,t,r)},deleteAllTextTracks:function(){for(var e=f?f.length:0,t=0;t<e;t++){var r=L(t);r&&B.call(this,r,C.start,C.start+C.duration)}f=[],c=[],E&&(clearInterval(E),E=null),b&&I&&(b.unobserve(I.getElement()),b=null),d=-1,H.call(this)},deleteTextTrack:function(e){I.removeChild(f[e]),f.splice(e,1)}},r=Object(u.default)(A).getInstance().getLogger(t),t}c.__dashjs_factory_name="TextTracks",t.default=o.default.getClassFactory(c)},"./src/streaming/thumbnail/ThumbnailController.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/streaming/constants/Constants.js"),i=r("./src/streaming/vo/Thumbnail.js"),s=r("./src/streaming/thumbnail/ThumbnailTracks.js"),o=r("./src/streaming/vo/BitrateInfo.js"),u=r("./src/dash/utils/SegmentsUtils.js");function l(e){var t,r,n=this.context,l=e.streamInfo;function c(e){r.setTrackByIndex(e)}function f(){r&&r.reset()}return t={getStreamId:function(){return l.id},initialize:function(){r.addTracks();var e=r.getTracks();e&&e.length>0&&c(0)},provide:function(e,t){if("function"==typeof t){var n,a,s=r.getCurrentTrack();if(!s||s.segmentDuration<=0||null==e)t(null);else{(a=r.getThumbnailRequestForTime(e))&&(s.segmentDuration=a.duration),n=e%s.segmentDuration;var o=Math.floor(n*s.tilesHor*s.tilesVert/s.segmentDuration),l=new i.default;if(l.width=Math.floor(s.widthPerTile),l.height=Math.floor(s.heightPerTile),l.x=Math.floor(o%s.tilesHor)*s.widthPerTile,l.y=Math.floor(o/s.tilesHor)*s.heightPerTile,"readThumbnail"in s)return s.readThumbnail(e,function(e){l.url=e,t(l)});if(a)l.url=a.url,s.segmentDuration=NaN;else{var c=Math.floor(e/s.segmentDuration);l.url=function(e,t){var r=t+e.startNumber,n=Object(u.replaceTokenForTemplate)(e.templateUrl,"Number",r);return n=Object(u.replaceTokenForTemplate)(n,"Time",(r-1)*e.segmentDuration*e.timescale),n=Object(u.replaceTokenForTemplate)(n,"Bandwidth",e.bandwidth),Object(u.unescapeDollarsInTemplate)(n)}(s,c)}t(l)}}},setTrackByIndex:c,getCurrentTrackIndex:function(){return r.getCurrentTrackIndex()},getBitrateList:function(){var e=r.getTracks(),t=0;return e.map(function(e){var r=new o.default;return r.mediaType=a.default.IMAGE,r.qualityIndex=t++,r.bitrate=e.bitrate,r.width=e.width,r.height=e.height,r})},reset:f},f(),r=Object(s.default)(n).create({streamInfo:l,adapter:e.adapter,baseURLController:e.baseURLController,timelineConverter:e.timelineConverter,debug:e.debug,eventBus:e.eventBus,events:e.events,dashConstants:e.dashConstants,dashMetrics:e.dashMetrics,segmentBaseController:e.segmentBaseController}),t}l.__dashjs_factory_name="ThumbnailController",t.default=n.default.getClassFactory(l)},"./src/streaming/thumbnail/ThumbnailTracks.js":function(e,t,r){r.r(t),r.d(t,"THUMBNAILS_SCHEME_ID_URIS",function(){return h});var n=r("./src/streaming/constants/Constants.js"),a=r("./src/dash/constants/DashConstants.js"),i=r("./src/core/FactoryMaker.js"),s=r("./src/streaming/vo/ThumbnailTrackInfo.js"),o=r("./src/streaming/utils/URLUtils.js"),u=r("./src/dash/utils/SegmentsUtils.js"),l=r("./src/streaming/utils/BoxParser.js"),c=r("./src/streaming/net/XHRLoader.js"),f=r("./src/dash/DashHandler.js"),d=r("./src/dash/controllers/SegmentsController.js"),h=["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"];function g(e){var t,r,i,g,p,m,y,E,_=this.context,v=e.adapter,T=e.baseURLController,S=e.streamInfo,b=e.timelineConverter,A=e.debug,R=e.eventBus,I=e.events,C=e.dashConstants,w=Object(o.default)(_).getInstance();function N(e,t){var n=new s.default;n.id=e.id,n.bitrate=e.bandwidth,n.width=e.width,n.height=e.height,n.tilesHor=1,n.tilesVert=1,e.essentialProperties&&e.essentialProperties.forEach(function(e){if(h.indexOf(e.schemeIdUri)>=0&&e.value){var t=e.value.split("x");2!==t.length||isNaN(t[0])||isNaN(t[1])||(n.tilesHor=parseInt(t[0],10),n.tilesVert=parseInt(t[1],10))}}),t?m.updateSegmentData(e).then(function(t){!function(e,t,r){var n=[],a=function(e,t){var r,n,a,i,s=[],o=0;for(r=0,n=e.segments.length;r<n;r++)a=e.segments[r],(i=Object(u.getTimeBasedSegment)(b,v.getIsDynamic(),t,a.startTime,a.duration,a.timescale,a.media,a.mediaRange,o))&&(s.push(i),i=null,o++);return s}(r,t);t.segments=a,e.segmentDuration=t.segments[0].duration,e.readThumbnail=function(e,r){var a=null;n.some(function(t){if(t.start<=e&&t.end>e)return a=t.url,!0}),a?r(a):t.segments.some(function(a){if(a.mediaStartTime<=e&&a.mediaStartTime+a.duration>e){var i=T.resolve(t.path);return y.load({method:"get",url:i.url,request:{range:a.mediaRange,responseType:"arraybuffer"},onload:function(e){var t=E.getSamplesInfo(e.target.response),i=new Blob([e.target.response.slice(t.sampleList[0].offset,t.sampleList[0].offset+t.sampleList[0].size)],{type:"image/jpeg"}),s=window.URL.createObjectURL(i);n.push({start:a.mediaStartTime,end:a.mediaStartTime+a.duration,url:s}),r&&r(s)}}),!0}})}}(n,e,t)}):(n.startNumber=e.startNumber,n.segmentDuration=e.segmentDuration,n.timescale=e.timescale,n.templateUrl=function(e){var t=w.isRelative(e.media)?w.resolve(e.media,T.resolve(e.path).url):e.media;return t?Object(u.replaceIDForTemplate)(t,e.id):""}(e)),n.tilesHor>0&&n.tilesVert>0&&(n.widthPerTile=n.width/n.tilesHor,n.heightPerTile=n.height/n.tilesVert,r.push(n))}function D(){r=[],g=-1,p=null}return t={getTracks:function(){return r},addTracks:function(){if(S&&v&&(p=v.getMediaInfoForType(S,n.default.IMAGE))){var e=v.getVoRepresentations(p);e&&e.length>0&&e.forEach(function(e){(e.segmentInfoType===a.default.SEGMENT_TEMPLATE&&e.segmentDuration>0&&e.media||e.segmentInfoType===a.default.SEGMENT_TIMELINE)&&N(e),e.segmentInfoType===a.default.SEGMENT_BASE&&N(e,!0)}),r.length>0&&r.sort(function(e,t){return e.bitrate-t.bitrate})}},reset:D,setTrackByIndex:function(e){r&&0!==r.length&&(e>=r.length&&(e=r.length-1),g=e)},getCurrentTrack:function(){return g<0?null:r[g]},getCurrentTrackIndex:function(){return g},getThumbnailRequestForTime:function(e){for(var t,n=v.getVoRepresentations(p),a=0;a<n.length;a++)if(r[g].id===n[a].id){t=n[a];break}return i.getSegmentRequestForTime(p,t,e)}},D(),y=Object(c.default)(_).create({}),E=Object(l.default)(_).getInstance(),m=Object(d.default)(_).create({events:I,eventBus:R,streamInfo:S,timelineConverter:b,dashConstants:C,dashMetrics:e.dashMetrics,segmentBaseController:e.segmentBaseController,type:n.default.IMAGE}),(i=Object(f.default)(_).create({streamInfo:S,type:n.default.IMAGE,timelineConverter:b,segmentsController:m,baseURLController:T,debug:A,eventBus:R,events:I,dashConstants:C,urlUtils:w})).initialize(!!v&&v.getIsDynamic()),t}g.__dashjs_factory_name="ThumbnailTracks",t.default=i.default.getClassFactory(g)},"./src/streaming/utils/BaseURLSelector.js":function(e,t,r){r.r(t);var n=r("./src/core/errors/Errors.js"),a=r("./src/core/EventBus.js"),i=r("./src/core/events/Events.js"),s=r("./src/streaming/controllers/BlacklistController.js"),o=r("./src/streaming/utils/baseUrlResolution/DVBSelector.js"),u=r("./src/streaming/utils/baseUrlResolution/BasicSelector.js"),l=r("./src/core/FactoryMaker.js"),c=r("./src/streaming/vo/DashJSError.js"),f=r("./src/streaming/utils/SupervisorTools.js");function d(){var e,t,r,l,d,h=this.context,g=Object(a.default)(h).getInstance();function p(){t.reset()}return e={chooseSelector:function(e){Object(f.checkParameterType)(e,"boolean"),d=e?l:r},select:function(e){if(e){var t=e.baseUrls,a=e.selectedIdx;if(!isNaN(a))return t[a];var s=d.select(t);return s?(e.selectedIdx=t.indexOf(s),s):(g.trigger(i.default.URL_RESOLUTION_FAILED,{error:new c.default(n.default.URL_RESOLUTION_FAILED_GENERIC_ERROR_CODE,n.default.URL_RESOLUTION_FAILED_GENERIC_ERROR_MESSAGE)}),void(d===r&&p()))}},reset:p,setConfig:function(e){e.selector&&(d=e.selector)}},t=Object(s.default)(h).create({updateEventName:i.default.SERVICE_LOCATION_BLACKLIST_CHANGED,addBlacklistEventName:i.default.SERVICE_LOCATION_BLACKLIST_ADD}),r=Object(u.default)(h).create({blacklistController:t}),l=Object(o.default)(h).create({blacklistController:t}),d=r,e}d.__dashjs_factory_name="BaseURLSelector",t.default=l.default.getClassFactory(d)},"./src/streaming/utils/BoxParser.js":function(e,t,r){r.r(t);var n=r("./src/core/Debug.js"),a=r("./src/streaming/utils/IsoFile.js"),i=r("./src/core/FactoryMaker.js"),s=r("./node_modules/codem-isoboxer/dist/iso_boxer.js"),o=r.n(s),u=r("./src/streaming/vo/IsoBoxSearchInfo.js");function l(){var e,t,r=this.context;function i(e){if(!e)return null;void 0===e.fileStart&&(e.fileStart=0);var t=o.a.parseBuffer(e),n=Object(a.default)(r).create();return n.setData(t),n}function s(e,t){return e[t+3]>>>0|e[t+2]<<8>>>0|e[t+1]<<16>>>0|e[t]<<24>>>0}function l(e,t){return String.fromCharCode(e[t++])+String.fromCharCode(e[t++])+String.fromCharCode(e[t++])+String.fromCharCode(e[t])}return t={parse:i,findLastTopIsoBoxCompleted:function(e,t,r){if(void 0===r&&(r=0),!t||r+8>=t.byteLength)return new u.default(0,!1);for(var n,a=t instanceof ArrayBuffer?new Uint8Array(t):t,i=0;r<a.byteLength;){var o=s(a,r),c=l(a,r+4);if(0===o)break;r+o<=a.byteLength&&(e.indexOf(c)>=0?n=new u.default(r,!0,o):i=r+o),r+=o}return n||new u.default(i,!1)},getMediaTimescaleFromMoov:function(e){var t=i(e),r=t?t.getBox("mdhd"):void 0;return r?r.timescale:NaN},getSamplesInfo:function(e){if(!e||0===e.byteLength)return{sampleList:[],lastSequenceNumber:NaN,totalDuration:NaN,numSequences:NaN};var t,r,n,a,s,o,u,l,c,f,d,h,g,p,m,y,E=i(e),_=E.getBoxes("moof"),v=E.getBoxes("mfhd");m=E.getBoxes("moof").length,p=v[v.length-1].sequence_number,r=0,s=[];var T=-1,S=-1;for(f=0;f<_.length;f++){var b=_[f],A=b.getChildBoxes("traf");for(l=0;l<A.length;l++){var R=A[l],I=R.getChildBox("tfhd"),C=R.getChildBox("tfdt");a=C.baseMediaDecodeTime;var w=R.getChildBoxes("trun"),N=R.getChildBoxes("subs");for(c=0;c<w.length;c++){var D=w[c];for(r=D.sample_count,g=(I.base_data_offset||0)+(D.data_offset||0),u=0;u<r;u++){t=void 0!==(o=D.samples[u]).sample_duration?o.sample_duration:I.default_sample_duration,n=void 0!==o.sample_size?o.sample_size:I.default_sample_size;var M={dts:a,cts:a+(void 0!==o.sample_composition_time_offset?o.sample_composition_time_offset:0),duration:t,offset:b.offset+g,size:n,subSizes:[n]};if(N)for(d=0;d<N.length;d++){var O=N[d];if(T<O.entry_count-1&&u>S&&(T++,S+=O.entries[T].sample_delta),u==S){M.subSizes=[];var P=O.entries[T];for(h=0;h<P.subsample_count;h++)M.subSizes.push(P.subsamples[h].subsample_size)}}s.push(M),g+=n,a+=t}}y=a-C.baseMediaDecodeTime}}return{sampleList:s,lastSequenceNumber:p,totalDuration:y,numSequences:m}},findInitRange:function(t){var r=null,n=i(t);if(!n)return r;var a=n.getBox("ftyp"),s=n.getBox("moov");return e.debug("Searching for initialization."),s&&s.isComplete&&(r=(a?a.offset:s.offset)+"-"+(s.offset+s.size-1),e.debug("Found the initialization. Range: "+r)),r},parsePayload:function(e,t,r){if(void 0===r&&(r=0),!t||r+8>=t.byteLength)return new u.default(0,!1);for(var n,a=t instanceof ArrayBuffer?new Uint8Array(t):t,i=0;r<a.byteLength;){var o=s(a,r),c=l(a,r+4);if(0===o)break;r+o<=a.byteLength&&(e.indexOf(c)>=0?n=new u.default(r,!0,o,c):i=r+o),r+=o}return n||new u.default(i,!1)}},e=Object(n.default)(r).getInstance().getLogger(t),t}l.__dashjs_factory_name="BoxParser",t.default=i.default.getSingletonFactory(l)},"./src/streaming/utils/Capabilities.js":function(e,t,r){r.r(t),r.d(t,"supportsMediaSource",function(){return o});var n=r("./src/core/FactoryMaker.js"),a=r("./src/streaming/thumbnail/ThumbnailTracks.js"),i=r("./src/streaming/constants/Constants.js"),s=[{codec:"avc1",compatibleCodecs:["avc3"]},{codec:"avc3",compatibleCodecs:["avc1"]}];function o(){var e="WebKitMediaSource"in window,t="MediaSource"in window;return e||t}function u(){var e,t,r;return e={setConfig:function(e){e&&e.settings&&(t=e.settings)},supportsMediaSource:o,supportsEncryptedMedia:function(){return r},supportsCodec:function(e,r){return r!==i.default.AUDIO&&r!==i.default.VIDEO?Promise.resolve(!0):function(e,r){return t.get().streaming.capabilities.useMediaCapabilitiesApi&&navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo&&(e.codec&&r===i.default.AUDIO||r===i.default.VIDEO&&e.codec&&e.width&&e.height&&e.bitrate&&e.framerate)}(e,r)?function(e,t){return new Promise(function(r){if(e&&e.codec){var n={type:"media-source"};n[t]={},n[t].contentType=e.codec,n[t].width=e.width,n[t].height=e.height,n[t].bitrate=parseInt(e.bitrate),n[t].framerate=parseFloat(e.framerate),navigator.mediaCapabilities.decodingInfo(n).then(function(e){r(e.supported)}).catch(function(){r(!1)})}else r(!1)})}(e,r):function(e){return new Promise(function(t){if(e&&e.codec){var r=e.codec;e.width&&e.height&&(r+=';width="'+e.width+'";height="'+e.height+'"'),"MediaSource"in window&&MediaSource.isTypeSupported(r)||"WebKitMediaSource"in window&&WebKitMediaSource.isTypeSupported(r)?t(!0):t(!1)}else t(!1)})}(e)},setEncryptedMediaSupported:function(e){r=e},supportsEssentialProperty:function(e){try{return-1!==a.THUMBNAILS_SCHEME_ID_URIS.indexOf(e.schemeIdUri)}catch(e){return!0}},codecRootCompatibleWithCodec:function(e,t){for(var r,n=e.split(".")[0],a=0===t.indexOf(n),i=0;i<s.length;i++)if(s[i].codec===n){r=s[i];break}return r?a||r.compatibleCodecs.some(function(e){return 0===t.indexOf(e)}):a}},r=!1,e}u.__dashjs_factory_name="Capabilities",t.default=n.default.getSingletonFactory(u)},"./src/streaming/utils/CapabilitiesFilter.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/core/Debug.js"),i=r("./src/streaming/constants/Constants.js");function s(){var e,t,r,n,s,o,u=this.context;function l(e,n){if(!n||!n.Period_asArray||0===n.Period_asArray.length)return Promise.resolve();var a=[];return n.Period_asArray.forEach(function(n){a.push(function(e,n){return new Promise(function(a){if(e&&e.AdaptationSet_asArray&&0!==e.AdaptationSet_asArray.length){var o=[];e.AdaptationSet_asArray.forEach(function(e){t.getIsTypeOf(e,n)&&o.push(function(e,n){return new Promise(function(a){if(e.Representation_asArray&&0!==e.Representation_asArray.length){var o=[],u=[];e.Representation_asArray.forEach(function(a,s){var l=t.getCodec(e,s,!1),c=function(e,t,r){switch(e){case i.default.VIDEO:return function(e,t){return{codec:t,width:e.width||null,height:e.height||null,framerate:e.frameRate||null,bitrate:e.bandwidth||null}}(t,r);case i.default.AUDIO:return function(e,t){var r=e.audioSamplingRate||null;return{codec:t,bitrate:e.bandwidth||null,samplerate:r}}(t,r);default:return null}}(n,a,l);u.push(c),o.push(r.supportsCodec(c,n))}),Promise.all(o).then(function(t){e.Representation_asArray=e.Representation_asArray.filter(function(e,r){return t[r]||s.debug("[Stream] Codec ".concat(u[r].codec," not supported ")),t[r]}),a()}).catch(function(){a()})}else a()})}(e,n))}),Promise.all(o).then(function(){e.AdaptationSet_asArray=e.AdaptationSet_asArray.filter(function(e){var t=e.Representation_asArray&&e.Representation_asArray.length>0;return t||s.warn("AdaptationSet has been removed because of no supported Representation"),t}),a()}).catch(function(){a()})}else a()})}(n,e))}),Promise.all(a)}return e={setConfig:function(e){e&&(e.adapter&&(t=e.adapter),e.capabilities&&(r=e.capabilities),e.settings&&(n=e.settings))},filterUnsupportedFeatures:function(e){return new Promise(function(a){var u=[];u.push(l(i.default.VIDEO,e)),u.push(l(i.default.AUDIO,e)),Promise.all(u).then(function(){n.get().streaming.capabilities.filterUnsupportedEssentialProperties&&function(e){e&&e.Period_asArray&&0!==e.Period_asArray.length&&e.Period_asArray.forEach(function(e){e.AdaptationSet_asArray=e.AdaptationSet_asArray.filter(function(e){return!e.Representation_asArray||0===e.Representation_asArray.length||(e.Representation_asArray=e.Representation_asArray.filter(function(e){var n=t.getEssentialPropertiesForRepresentation(e);if(n&&n.length>0)for(var a=0;a<n.length;){if(!r.supportsEssentialProperty(n[a]))return s.debug("[Stream] EssentialProperty not supported: "+n[a].schemeIdUri),!1;a+=1}return!0}),e.Representation_asArray&&e.Representation_asArray.length>0)})})}(e),function(e){o&&0!==o.length&&e&&e.Period_asArray&&0!==e.Period_asArray.length&&e.Period_asArray.forEach(function(e){e.AdaptationSet_asArray=e.AdaptationSet_asArray.filter(function(e){return!e.Representation_asArray||0===e.Representation_asArray.length||(e.Representation_asArray=e.Representation_asArray.filter(function(e){return!o.some(function(t){return!t(e)})}),e.Representation_asArray&&e.Representation_asArray.length>0)})})}(e),a()}).catch(function(){a()})})},setCustomCapabilitiesFilters:function(e){o=e}},s=Object(a.default)(u).getInstance().getLogger(e),e}s.__dashjs_factory_name="CapabilitiesFilter",t.default=n.default.getSingletonFactory(s)},"./src/streaming/utils/CustomTimeRanges.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/streaming/utils/SupervisorTools.js");function i(){return{customTimeRangeArray:[],length:0,add:function(e,t){var r=0;for(r=0;r<this.customTimeRangeArray.length&&e>this.customTimeRangeArray[r].start;r++);for(this.customTimeRangeArray.splice(r,0,{start:e,end:t}),r=0;r<this.customTimeRangeArray.length-1;r++)this.mergeRanges(r,r+1)&&r--;this.length=this.customTimeRangeArray.length},clear:function(){this.customTimeRangeArray=[],this.length=0},remove:function(e,t){for(var r=0;r<this.customTimeRangeArray.length;r++)if(e<=this.customTimeRangeArray[r].start&&t>=this.customTimeRangeArray[r].end)this.customTimeRangeArray.splice(r,1),r--;else{if(e>this.customTimeRangeArray[r].start&&t<this.customTimeRangeArray[r].end){this.customTimeRangeArray.splice(r+1,0,{start:t,end:this.customTimeRangeArray[r].end}),this.customTimeRangeArray[r].end=e;break}e>this.customTimeRangeArray[r].start&&e<this.customTimeRangeArray[r].end?this.customTimeRangeArray[r].end=e:t>this.customTimeRangeArray[r].start&&t<this.customTimeRangeArray[r].end&&(this.customTimeRangeArray[r].start=t)}this.length=this.customTimeRangeArray.length},mergeRanges:function(e,t){var r=this.customTimeRangeArray[e],n=this.customTimeRangeArray[t];return r.start<=n.start&&n.start<=r.end&&r.end<=n.end?(r.end=n.end,this.customTimeRangeArray.splice(t,1),!0):n.start<=r.start&&r.start<=n.end&&n.end<=r.end?(r.start=n.start,this.customTimeRangeArray.splice(t,1),!0):n.start<=r.start&&r.start<=n.end&&r.end<=n.end?(this.customTimeRangeArray.splice(e,1),!0):r.start<=n.start&&n.start<=r.end&&n.end<=r.end&&(this.customTimeRangeArray.splice(t,1),!0)},start:function(e){return Object(a.checkInteger)(e),e>=this.customTimeRangeArray.length||e<0?NaN:this.customTimeRangeArray[e].start},end:function(e){return Object(a.checkInteger)(e),e>=this.customTimeRangeArray.length||e<0?NaN:this.customTimeRangeArray[e].end}}}i.__dashjs_factory_name="CustomTimeRanges",t.default=n.default.getClassFactory(i)},"./src/streaming/utils/DOMStorage.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/core/Debug.js"),i=r("./src/streaming/constants/Constants.js"),s=[{oldKey:"dashjs_vbitrate",newKey:"dashjs_video_bitrate"},{oldKey:"dashjs_abitrate",newKey:"dashjs_audio_bitrate"},{oldKey:"dashjs_vsettings",newKey:"dashjs_video_settings"},{oldKey:"dashjs_asettings",newKey:"dashjs_audio_settings"}],o="dashjs_?_bitrate",u="dashjs_?_settings",l="localStorage",c="lastBitrate",f="lastMediaSettings";function d(e){e=e||{};var t,r,n,d=this.context,h=e.settings;function g(e){if(void 0!==n)return n;var t;n=!1;try{"undefined"!=typeof window&&(t=window[e])}catch(e){return r.warn("DOMStorage access denied: "+e.message),n}if(!t||e!==l&&"sessionStorage"!==e)return n;try{t.setItem("1","1"),t.removeItem("1"),n=!0}catch(e){r.warn("DOMStorage is supported, but cannot be used: "+e.message)}return n}function p(){var e=6e5;return Math.round((new Date).getTime()/e)*e}function m(e,t){return g(e)&&h.get().streaming[t+"CachingInfo"].enabled}function y(){if(!h)throw new Error(i.default.MISSING_CONFIG_ERROR)}return t={getSavedBitrateSettings:function(e){var t=NaN;if(y(),m(l,c)){var n=o.replace(/\?/,e);try{var a=JSON.parse(localStorage.getItem(n))||{},i=(new Date).getTime()-parseInt(a.timestamp,10)>=h.get().streaming.lastBitrateCachingInfo.ttl||!1,s=parseFloat(a.bitrate);isNaN(s)||i?i&&localStorage.removeItem(n):(t=s,r.debug("Last saved bitrate for "+e+" was "+s))}catch(e){return null}}return t},setSavedBitrateSettings:function(e,t){if(m(l,c)&&t){var n=o.replace(/\?/,e);try{localStorage.setItem(n,JSON.stringify({bitrate:t.toFixed(3),timestamp:p()}))}catch(e){r.error(e.message)}}},getSavedMediaSettings:function(e){var t=null;if(y(),m(l,f)){var r=u.replace(/\?/,e);try{var n=JSON.parse(localStorage.getItem(r))||{},a=(new Date).getTime()-parseInt(n.timestamp,10)>=h.get().streaming.lastMediaSettingsCachingInfo.ttl||!1;t=n.settings,a&&(localStorage.removeItem(r),t=null)}catch(e){return null}}return t},setSavedMediaSettings:function(e,t){if(m(l,f)){var n=u.replace(/\?/,e);try{localStorage.setItem(n,JSON.stringify({settings:t,timestamp:p()}))}catch(e){r.error(e.message)}}}},r=Object(a.default)(d).getInstance().getLogger(t),g(l)&&s.forEach(function(e){var t=localStorage.getItem(e.oldKey);if(t){localStorage.removeItem(e.oldKey);try{localStorage.setItem(e.newKey,t)}catch(e){r.error(e.message)}}}),t}d.__dashjs_factory_name="DOMStorage";var h=n.default.getSingletonFactory(d);t.default=h},"./src/streaming/utils/DefaultURLUtils.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js");function a(){var e,t=/^[a-z][a-z0-9+\-_.]*:/i,r=/^https?:\/\//i,n=/^https:\/\//i,a=/^([a-z][a-z0-9+\-_.]*:\/\/[^\/]+)\/?/i,i=function(e,t){try{return new window.URL(e,t).toString()}catch(t){return e}},s=function(e,t){var r=o;if(!t)return e;if(!c(e))return e;f(e)&&(r=u),d(e)&&(r=l);var n=r(t),a="/"!==n.charAt(n.length-1)&&"/"!==e.charAt(0)?"/":"";return[n,e].join(a)};function o(e){var t=e.indexOf("/"),r=e.lastIndexOf("/");return-1!==t?r===t+1?e:(-1!==e.indexOf("?")&&(e=e.substring(0,e.indexOf("?"))),e.substring(0,r+1)):""}function u(e){var t=e.match(a);return t?t[1]:""}function l(e){var r=e.match(t);return r?r[0]:""}function c(e){return!t.test(e)}function f(e){return c(e)&&"/"===e.charAt(0)}function d(e){return 0===e.indexOf("//")}return function(){try{new window.URL("x","http://y"),e=i}catch(e){}finally{e=e||s}}(),{parseBaseUrl:o,parseOrigin:u,parseScheme:l,isRelative:c,isPathAbsolute:f,isSchemeRelative:d,isHTTPURL:function(e){return r.test(e)},isHTTPS:function(e){return n.test(e)},removeHostname:function(e){return/^(?:\w+\:\/\/)?([^\/]+)(.*)$/.exec(e)[2].substring(1)},resolve:function(t,r){return e(t,r)}}}a.__dashjs_factory_name="DefaultURLUtils",t.default=n.default.getSingletonFactory(a)},"./src/streaming/utils/EBMLParser.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js");function a(e){var t;e=e||{};var r=new DataView(e.data),n=0;function a(e,t){var a=!0,i=0;if(void 0===t&&(t=!1),e.tag>16777215?(r.getUint32(n)!==e.tag&&(a=!1),i=4):e.tag>65535?(256*r.getUint16(n)+r.getUint8(n+2)!==e.tag&&(a=!1),i=3):e.tag>255?(r.getUint16(n)!==e.tag&&(a=!1),i=2):(r.getUint8(n)!==e.tag&&(a=!1),i=1),!a&&e.required&&!t)throw new Error("required tag not found");return a&&(n+=i),a}function i(e){var t=1,a=128,i=-1,s=0,o=r.getUint8(n),u=0;for(u=0;u<8;u+=1){if((o&a)===a){s=void 0===e?o&~a:o,i=u;break}a>>=1}for(u=0;u<i;u+=1,t+=1)s=s<<8|255&r.getUint8(n+t);return n+=t,s}return t={getPos:function(){return n},setPos:function(e){n=e},consumeTag:a,consumeTagAndSize:function(e,t){var r=a(e,t);return r&&i(),r},parseTag:function(e){var r;return a(e),r=i(),t[e.parse](r)},skipOverElement:function(e,t){var r,s=a(e,t);return s&&(r=i(),n+=r),s},getMatroskaCodedNum:i,getMatroskaFloat:function(e){var t;switch(e){case 4:t=r.getFloat32(n),n+=4;break;case 8:t=r.getFloat64(n),n+=8}return t},getMatroskaUint:function(e){for(var t=0,a=0;a<e;a+=1)t<<=8,t|=255&r.getUint8(n+a);return n+=e,t},moreData:function(){return n<r.byteLength}}}a.__dashjs_factory_name="EBMLParser",t.default=n.default.getClassFactory(a)},"./src/streaming/utils/ErrorHandler.js":function(e,t,r){r.r(t);var n=r("./src/core/EventBus.js"),a=r("./src/core/events/Events.js"),i=r("./src/core/FactoryMaker.js");function s(){var e=this.context,t=Object(n.default)(e).getInstance();return{error:function(e){t.trigger(a.default.ERROR,{error:e})}}}s.__dashjs_factory_name="ErrorHandler",t.default=i.default.getSingletonFactory(s)},"./src/streaming/utils/InitCache.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js");function a(){var e={};return{save:function(t){var r=t.streamId,n=t.representationId;e[r]=e[r]||{},e[r][n]=t},extract:function(t,r){return e&&e[t]&&e[t][r]?e[t][r]:null},reset:function(){e={}}}}a.__dashjs_factory_name="InitCache",t.default=n.default.getSingletonFactory(a)},"./src/streaming/utils/IsoFile.js":function(e,t,r){r.r(t);var n=r("./src/streaming/vo/IsoBox.js"),a=r("./src/core/FactoryMaker.js");function i(){var e;function t(t){var n=[];if(!t||!e||"function"!=typeof e.fetchAll)return n;for(var a,i=e.fetchAll(t),s=0,o=i.length;s<o;s++)(a=r(i[s]))&&n.push(a);return n}function r(e){if(!e)return null;var t=new n.default(e);return e.hasOwnProperty("_incomplete")&&(t.isComplete=!e._incomplete),t}return{getBox:function(t){return t&&e&&e.boxes&&0!==e.boxes.length&&"function"==typeof e.fetch?r(e.fetch(t)):null},getBoxes:t,setData:function(t){e=t},getLastBox:function(){if(!e||!e.boxes||!e.boxes.length)return null;var r=t(e.boxes[e.boxes.length-1].type);return r.length>0?r[r.length-1]:null}}}i.__dashjs_factory_name="IsoFile",t.default=a.default.getClassFactory(i)},"./src/streaming/utils/ObjectUtils.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./node_modules/fast-deep-equal/index.js"),i=r.n(a);function s(){return{areEqual:function(e,t){return i()(e,t)}}}s.__dashjs_factory_name="ObjectUtils",t.default=n.default.getSingletonFactory(s)},"./src/streaming/utils/RequestModifier.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js");function a(){return{modifyRequestURL:function(e){return e},modifyRequestHeader:function(e){return e}}}a.__dashjs_factory_name="RequestModifier",t.default=n.default.getSingletonFactory(a)},"./src/streaming/utils/SupervisorTools.js":function(e,t,r){r.r(t),r.d(t,"checkParameterType",function(){return i}),r.d(t,"checkInteger",function(){return s}),r.d(t,"checkRange",function(){return o}),r.d(t,"checkIsVideoOrAudioType",function(){return u});var n=r("./src/streaming/constants/Constants.js");function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function i(e,t){if(a(e)!==t)throw n.default.BAD_ARGUMENT_ERROR}function s(e){if(null===e||isNaN(e)||e%1!=0)throw n.default.BAD_ARGUMENT_ERROR+" : argument is not an integer"}function o(e,t,r){if(e<t||e>r)throw n.default.BAD_ARGUMENT_ERROR+" : argument out of range"}function u(e){if("string"!=typeof e||e!==n.default.AUDIO&&e!==n.default.VIDEO)throw n.default.BAD_ARGUMENT_ERROR}},"./src/streaming/utils/TTMLParser.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/core/Debug.js"),i=r("./src/core/EventBus.js"),s=r("./src/core/events/Events.js"),o=r("./node_modules/imsc/src/main/js/main.js"),u=r("./src/streaming/MediaPlayerEvents.js"),l=r("./src/streaming/constants/ConformanceViolationConstants.js");function c(){var e,t,r=this.context,n=Object(i.default)(r).getInstance(),c=0;function f(){var e="cue_TTML_"+c;return c++,e}return e={parse:function(e,r,a,i,c){var d,h,g,p="",m=[],y={},E={},_="",v="",T={onOpenTag:function(e,r,a){if(a[" imagetype"]&&!a[" imageType"]&&(n.trigger(u.default.CONFORMANCE_VIOLATION,{level:l.default.LEVELS.ERROR,event:l.default.EVENTS.NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE}),a[" imageType"]=a[" imagetype"]),"image"===r&&("http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt"===e||"http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt"===e)){if(!a[" imageType"]||"PNG"!==a[" imageType"].value)return void t.warn("smpte-tt imageType != PNG. Discarded");_=a["http://www.w3.org/XML/1998/namespace id"].value}},onCloseTag:function(){_&&(E[_]=v.trim()),v="",_=""},onText:function(e){_&&(v+=e)}};if(!e)throw p="no ttml data to parse",new Error(p);y.data=e,n.trigger(s.default.TTML_TO_PARSE,y);var S=Object(o.fromXML)(y.data,function(e){p=e},T);n.trigger(s.default.TTML_PARSED,{ttmlString:y.data,ttmlDoc:S});var b=S.getMediaTimeEvents();for(g=0;g<b.length;g++){var A=Object(o.generateISD)(S,b[g],function(e){p=e});A.contents.some(function(e){return e.contents.length})&&(d=b[g]+r<a?a:b[g]+r)<(h=b[g+1]+r>i?i:b[g+1]+r)&&m.push({start:d,end:h,type:"html",cueID:f(),isd:A,images:c,embeddedImages:E})}if(""!==p)throw t.error(p),new Error(p);return m}},t=Object(a.default)(r).getInstance().getLogger(e),e}c.__dashjs_factory_name="TTMLParser",t.default=n.default.getSingletonFactory(c)},"./src/streaming/utils/URLUtils.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/streaming/utils/DefaultURLUtils.js");function i(){var e,t=[],r=this.context;function n(r,n,a){var i=function(r){var n;for(n=0;n<t.length;n++)if(t[n].regex.test(r))return t[n].utils;return e}(a||n);return i&&"function"==typeof i[r]?i[r](n,a):e[r](n,a)}return e=Object(a.default)(r).getInstance(),{registerUrlRegex:function(e,r){t.push({regex:e,utils:r})},parseBaseUrl:function(e){return n("parseBaseUrl",e)},parseOrigin:function(e){return n("parseOrigin",e)},parseScheme:function(e){return n("parseScheme",e)},isRelative:function(e){return n("isRelative",e)},isPathAbsolute:function(e){return n("isPathAbsolute",e)},isSchemeRelative:function(e){return n("isSchemeRelative",e)},isHTTPURL:function(e){return n("isHTTPURL",e)},isHTTPS:function(e){return n("isHTTPS",e)},removeHostname:function(e){return n("removeHostname",e)},resolve:function(e,t){return n("resolve",e,t)}}}i.__dashjs_factory_name="URLUtils";var s=n.default.getSingletonFactory(i);t.default=s},"./src/streaming/utils/VTTParser.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js"),a=r("./src/core/Debug.js");function i(){var e,t,r,n,i,s,o=this.context;function u(e){var t=e.split(":"),r=t.length-1;return e=60*parseInt(t[r-1],10)+parseFloat(t[r]),2===r&&(e+=3600*parseInt(t[0],10)),e}function l(e){var t=e.split(n),r=t[1].split(s);return r.shift(),t[1]=r[0],r.shift(),{cuePoints:t,styles:c(r)}}function c(e){var t={};return e.forEach(function(e){if(e.split(/:/).length>1){var r=e.split(/:/)[1];r&&-1!=r.search(/%/)&&(r=parseInt(r.replace(/%/,""),10)),(e.match(/align/)||e.match(/A/))&&(t.align=r),(e.match(/line/)||e.match(/L/))&&(t.line=r),(e.match(/position/)||e.match(/P/))&&(t.position=r),(e.match(/size/)||e.match(/S/))&&(t.size=r)}}),t}function f(e,t){for(var r,a=t,i="",s="";""!==e[a]&&a<e.length;)a++;if((r=a-t)>1)for(var o=0;o<r;o++){if((s=e[t+o]).match(n)){i="";break}i+=s,o!==r-1&&(i+="\n")}else(s=e[t]).match(n)||(i=s);return i}return e={parse:function(e){var a,s,o=[];if(!e)return o;a=(e=e.split(r)).length,s=-1;for(var c=0;c<a;c++){var d=e[c];if(d.length>0&&"WEBVTT"!==d&&d.match(n)){var h=l(d),g=h.cuePoints,p=h.styles,m=f(e,c+1),y=u(g[0].replace(i,"")),E=u(g[1].replace(i,""));!isNaN(y)&&!isNaN(E)&&y>=s&&E>y?""!==m?(s=y,o.push({start:y,end:E,data:m,styles:p})):t.error("Skipping cue due to empty/malformed cue text"):t.error("Skipping cue due to incorrect cue timing")}}return o}},t=Object(a.default)(o).getInstance().getLogger(e),r=/(?:\r\n|\r|\n)/gm,n=/-->/,i=/(^[\s]+|[\s]+$)/g,s=/\s\b/g,e}i.__dashjs_factory_name="VTTParser",t.default=n.default.getSingletonFactory(i)},"./src/streaming/utils/baseUrlResolution/BasicSelector.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js");function a(e){var t=(e=e||{}).blacklistController;return{select:function(e){var r,n=0;return e&&e.some(function(e,r){return n=r,!t.contains(e.serviceLocation)})&&(r=e[n]),r}}}a.__dashjs_factory_name="BasicSelector",t.default=n.default.getClassFactory(a)},"./src/streaming/utils/baseUrlResolution/DVBSelector.js":function(e,t,r){r.r(t);var n=r("./src/core/FactoryMaker.js");function a(e){var t=(e=e||{}).blacklistController;return{select:function(e){return e&&function(e){var t,r,n=0,a=[],i=0;if((r=e.sort(function(e,t){var r=e.dvb_priority-t.dvb_priority;return isNaN(r)?0:r}).filter(function(e,t,r){return!t||r[0].dvb_priority&&e.dvb_priority&&r[0].dvb_priority===e.dvb_priority})).length)return r.length>1&&(r.forEach(function(e){n+=e.dvb_weight,a.push(n)}),t=Math.floor(Math.random()*(n-1)),a.every(function(e,r){return i=r,!(t<e)})),r[i]}((r=[],e.filter(function(e){return!t.contains(e.serviceLocation)||(e.dvb_priority&&r.push(e.dvb_priority),!1)}).filter(function(e){return!r.length||!e.dvb_priority||-1===r.indexOf(e.dvb_priority)})));var r}}}a.__dashjs_factory_name="DVBSelector",t.default=n.default.getClassFactory(a)},"./src/streaming/vo/BitrateInfo.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mediaType=null,this.bitrate=null,this.width=null,this.height=null,this.scanType=null,this.qualityIndex=NaN}},"./src/streaming/vo/DashJSError.js":function(e,t,r){r.r(t),t.default=function e(t,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.code=t||null,this.message=r||null,this.data=n||null}},"./src/streaming/vo/DataChunk.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.streamId=null,this.mediaInfo=null,this.segmentType=null,this.quality=NaN,this.index=NaN,this.bytes=null,this.start=NaN,this.end=NaN,this.duration=NaN,this.representationId=null,this.endFragment=null}},"./src/streaming/vo/FragmentRequest.js":function(e,t,r){r.r(t);var n=r("./src/streaming/vo/metrics/HTTPRequest.js");function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var i=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.action=e.ACTION_DOWNLOAD,this.startTime=NaN,this.mediaStartTime=NaN,this.mediaType=null,this.mediaInfo=null,this.type=null,this.duration=NaN,this.timescale=NaN,this.range=null,this.url=t||null,this.serviceLocation=null,this.requestStartDate=null,this.firstByteDate=null,this.requestEndDate=null,this.quality=NaN,this.index=NaN,this.availabilityStartTime=null,this.availabilityEndTime=null,this.wallStartTime=null,this.bytesLoaded=NaN,this.bytesTotal=NaN,this.delayLoadingTime=NaN,this.responseType="arraybuffer",this.representationId=null}var t,r;return t=e,(r=[{key:"isInitializationRequest",value:function(){return this.type&&this.type===n.HTTPRequest.INIT_SEGMENT_TYPE}},{key:"setInfo",value:function(e){this.type=e&&e.init?n.HTTPRequest.INIT_SEGMENT_TYPE:n.HTTPRequest.MEDIA_SEGMENT_TYPE,this.url=e&&e.url?e.url:null,this.range=e&&e.range?e.range.start+"-"+e.range.end:null,this.mediaType=e&&e.mediaType?e.mediaType:null}}])&&a(t.prototype,r),e}();i.ACTION_DOWNLOAD="download",i.ACTION_COMPLETE="complete",t.default=i},"./src/streaming/vo/HeadRequest.js":function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}r.r(t);var s=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(o,e);var t,r,s=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,a=i(t);if(r){var s=i(this).constructor;e=Reflect.construct(a,arguments,s)}else e=a.apply(this,arguments);return function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function o(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(t=s.call(this,e)).checkForExistenceOnly=!0,t}return o}(r("./src/streaming/vo/FragmentRequest.js").default);t.default=s},"./src/streaming/vo/IsoBox.js":function(e,t,r){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}r.r(t);var a=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.offset=t._offset,this.type=t.type,this.size=t.size,this.boxes=[],t.boxes)for(var r=0;r<t.boxes.length;r++)this.boxes.push(new e(t.boxes[r]));switch(this.isComplete=!0,t.type){case"sidx":if(this.timescale=t.timescale,this.earliest_presentation_time=t.earliest_presentation_time,this.first_offset=t.first_offset,this.references=t.references,t.references){this.references=[];for(var n=0;n<t.references.length;n++){var a={reference_type:t.references[n].reference_type,referenced_size:t.references[n].referenced_size,subsegment_duration:t.references[n].subsegment_duration};this.references.push(a)}}break;case"emsg":this.id=t.id,this.version=1===t.version?1:0,this.value=t.value,this.timescale=t.timescale,this.scheme_id_uri=t.scheme_id_uri,this.presentation_time_delta=1===t.version?t.presentation_time:t.presentation_time_delta,this.event_duration=t.event_duration,this.message_data=t.message_data;break;case"mdhd":this.timescale=t.timescale;break;case"mfhd":this.sequence_number=t.sequence_number;break;case"subs":this.entry_count=t.entry_count,this.entries=t.entries;break;case"tfhd":this.base_data_offset=t.base_data_offset,this.sample_description_index=t.sample_description_index,this.default_sample_duration=t.default_sample_duration,this.default_sample_size=t.default_sample_size,this.default_sample_flags=t.default_sample_flags,this.flags=t.flags;break;case"tfdt":this.version=t.version,this.baseMediaDecodeTime=t.baseMediaDecodeTime,this.flags=t.flags;break;case"trun":if(this.sample_count=t.sample_count,this.first_sample_flags=t.first_sample_flags,this.data_offset=t.data_offset,this.flags=t.flags,this.samples=t.samples,t.samples){this.samples=[];for(var i=0,s=t.samples.length;i<s;i++){var o={sample_size:t.samples[i].sample_size,sample_duration:t.samples[i].sample_duration,sample_composition_time_offset:t.samples[i].sample_composition_time_offset};this.samples.push(o)}}}}var t,r;return t=e,(r=[{key:"getChildBox",value:function(e){for(var t=0;t<this.boxes.length;t++)if(this.boxes[t].type===e)return this.boxes[t]}},{key:"getChildBoxes",value:function(e){for(var t=[],r=0;r<this.boxes.length;r++)this.boxes[r].type===e&&t.push(this.boxes[r]);return t}}])&&n(t.prototype,r),e}();t.default=a},"./src/streaming/vo/IsoBoxSearchInfo.js":function(e,t,r){r.r(t),t.default=function e(t,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.lastCompletedOffset=t,this.found=r,this.size=n}},"./src/streaming/vo/MetricsList.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.TcpList=[],this.HttpList=[],this.RepSwitchList=[],this.BufferLevel=[],this.BufferState=[],this.PlayList=[],this.DroppedFrames=[],this.SchedulingInfo=[],this.DVRInfo=[],this.ManifestUpdate=[],this.RequestsQueue=null,this.DVBErrors=[]}},"./src/streaming/vo/TextRequest.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/Constants.js");function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}var o=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(u,e);var t,r,o=(t=u,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=s(t);if(r){var i=s(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return function(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function u(e,t){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),(r=o.call(this)).url=e||null,r.type=t||null,r.mediaType=n.default.STREAM,r.responseType="",r}return u}(r("./src/streaming/vo/FragmentRequest.js").default);t.default=o},"./src/streaming/vo/TextTrackInfo.js":function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}r.r(t);var s=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(o,e);var t,r,s=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,a=i(t);if(r){var s=i(this).constructor;e=Reflect.construct(a,arguments,s)}else e=a.apply(this,arguments);return function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function o(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=s.call(this)).captionData=null,e.label=null,e.defaultTrack=!1,e.kind=null,e.isFragmented=!1,e.isEmbedded=!1,e.isTTML=null,e}return o}(r("./src/dash/vo/MediaInfo.js").default);t.default=s},"./src/streaming/vo/Thumbnail.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=null,this.width=null,this.height=null,this.x=null,this.y=null}},"./src/streaming/vo/ThumbnailTrackInfo.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.bitrate=0,this.width=0,this.height=0,this.tilesHor=0,this.tilesVert=0,this.widthPerTile=0,this.heightPerTile=0,this.startNumber=0,this.segmentDuration=0,this.timescale=0,this.templateUrl="",this.id=""}},"./src/streaming/vo/URIFragmentData.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.t=null,this.xywh=null,this.track=null,this.id=null,this.s=null,this.r=null}},"./src/streaming/vo/metrics/BufferLevel.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.t=null,this.level=null}},"./src/streaming/vo/metrics/BufferState.js":function(e,t,r){r.r(t);var n=r("./src/streaming/constants/MetricsConstants.js");t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.target=null,this.state=n.default.BUFFER_EMPTY}},"./src/streaming/vo/metrics/DVRInfo.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.time=null,this.range=null,this.manifestInfo=null}},"./src/streaming/vo/metrics/DroppedFrames.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.time=null,this.droppedFrames=null}},"./src/streaming/vo/metrics/HTTPRequest.js":function(e,t,r){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}r.r(t),r.d(t,"HTTPRequest",function(){return a}),r.d(t,"HTTPRequestTrace",function(){return i});var a=function e(){n(this,e),this.tcpid=null,this.type=null,this.url=null,this.actualurl=null,this.range=null,this.trequest=null,this.tresponse=null,this.responsecode=null,this.interval=null,this.trace=[],this._stream=null,this._tfinish=null,this._mediaduration=null,this._quality=null,this._responseHeaders=null,this._serviceLocation=null},i=function e(){n(this,e),this.s=null,this.d=null,this.b=[],this.t=null};a.GET="GET",a.HEAD="HEAD",a.MPD_TYPE="MPD",a.XLINK_EXPANSION_TYPE="XLinkExpansion",a.INIT_SEGMENT_TYPE="InitializationSegment",a.INDEX_SEGMENT_TYPE="IndexSegment",a.MEDIA_SEGMENT_TYPE="MediaSegment",a.BITSTREAM_SWITCHING_SEGMENT_TYPE="BitstreamSwitchingSegment",a.MSS_FRAGMENT_INFO_SEGMENT_TYPE="FragmentInfoSegment",a.LICENSE="license",a.OTHER_TYPE="other"},"./src/streaming/vo/metrics/ManifestUpdate.js":function(e,t,r){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}r.r(t),r.d(t,"ManifestUpdate",function(){return a}),r.d(t,"ManifestUpdateStreamInfo",function(){return i}),r.d(t,"ManifestUpdateRepresentationInfo",function(){return s});var a=function e(){n(this,e),this.mediaType=null,this.type=null,this.requestTime=null,this.fetchTime=null,this.availabilityStartTime=null,this.presentationStartTime=0,this.clientTimeOffset=0,this.currentTime=null,this.buffered=null,this.latency=0,this.streamInfo=[],this.representationInfo=[]},i=function e(){n(this,e),this.id=null,this.index=null,this.start=null,this.duration=null},s=function e(){n(this,e),this.id=null,this.index=null,this.mediaType=null,this.streamIndex=null,this.presentationTimeOffset=null,this.startNumber=null,this.fragmentInfoType=null}},"./src/streaming/vo/metrics/PlayList.js":function(e,t,r){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}r.r(t),r.d(t,"PlayList",function(){return a}),r.d(t,"PlayListTrace",function(){return i});var a=function e(){n(this,e),this.start=null,this.mstart=null,this.starttype=null,this.trace=[]};a.INITIAL_PLAYOUT_START_REASON="initial_playout",a.SEEK_START_REASON="seek",a.RESUME_FROM_PAUSE_START_REASON="resume",a.METRICS_COLLECTION_START_REASON="metrics_collection_start";var i=function e(){n(this,e),this.representationid=null,this.subreplevel=null,this.start=null,this.mstart=null,this.duration=null,this.playbackspeed=null,this.stopreason=null};i.REPRESENTATION_SWITCH_STOP_REASON="representation_switch",i.REBUFFERING_REASON="rebuffering",i.USER_REQUEST_STOP_REASON="user_request",i.END_OF_PERIOD_STOP_REASON="end_of_period",i.END_OF_CONTENT_STOP_REASON="end_of_content",i.METRICS_COLLECTION_STOP_REASON="metrics_collection_end",i.FAILURE_STOP_REASON="failure"},"./src/streaming/vo/metrics/RepresentationSwitch.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.t=null,this.mt=null,this.to=null,this.lto=null}},"./src/streaming/vo/metrics/RequestsQueue.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.loadingRequests=[],this.executedRequests=[]}},"./src/streaming/vo/metrics/SchedulingInfo.js":function(e,t,r){r.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mediaType=null,this.t=null,this.type=null,this.startTime=null,this.availabilityStartTime=null,this.duration=null,this.quality=null,this.range=null,this.state=null}},0:function(e,t){},1:function(e,t){}}).default},e.exports=r()},n(i={exports:{}}),i.exports),p=(o=g)&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o;function m(e,t){var r=e.dash.mediaPlayer,n=r.getTracksFor("audio"),a=e.audioTracks();function i(e){return"dash-audio-"+e}function s(e,t){return e.find(function(e){return i(e.index)===t.id})}a.length&&t.clearTracks(["audio"]);var o=r.getCurrentTrackFor("audio");n.forEach(function(t){var r,n;if(Array.isArray(t.labels))for(var s=0;s<t.labels.length;s++)if(t.labels[s].lang&&-1!==e.language().indexOf(t.labels[s].lang.toLowerCase())){r=t.labels[s];break}r?n=r.text:Array.isArray(t.labels)&&1===t.labels.length?n=t.labels[0].text:(n=t.lang,t.roles&&t.roles.length&&(n+=" ("+t.roles.join(", ")+")")),a.addTrack(new(l().AudioTrack)({enabled:t===o,id:i(t.index),kind:t.kind||"main",label:n,language:t.lang}))});var u=function(){for(var e=0;e<a.length;e++){var t=a[e];if(t.enabled){var i=s(n,t);r.setCurrentTrack(i)}}};a.addEventListener("change",u),e.dash.mediaPlayer.on(p.MediaPlayer.events.STREAM_TEARDOWN_COMPLETE,function(){a.removeEventListener("change",u)})}function y(e,t){e.dash.mediaPlayer.on(p.MediaPlayer.events.PLAYBACK_METADATA_LOADED,m.bind(null,e,t))}function E(e,t,r){f().VTTCue&&!/\[native code\]/.test(f().VTTCue.toString())&&(f().VTTCue=!1);var n=[];if(t.featuresNativeTextTracks)l().log.error("You must pass {html: {nativeCaptions: false}} in the videojs constructor to use text tracks in videojs-contrib-dash");else{var a=e.dash.mediaPlayer;a.on(p.MediaPlayer.events.TEXT_TRACKS_ADDED,i),a.on(p.MediaPlayer.events.CAN_PLAY,function(){a.off(p.MediaPlayer.events.TEXT_TRACKS_ADDED,i)})}function i(t){t.index;var r=t.tracks;a.off(p.MediaPlayer.events.TEXT_TRACKS_ADDED,i),n.forEach(e.removeRemoteTextTrack.bind(e)),n=[],r.length&&(n=function(e,t,r){var n=[],a=r.map(function(t){var r;if(Array.isArray(t.labels))for(var n=0;n<t.labels.length;n++)if(t.labels[n].lang&&-1!==e.language().indexOf(t.labels[n].lang.toLowerCase())){r=t.labels[n];break}return{dashTrack:t,trackConfig:{label:r?r.text:Array.isArray(t.labels)&&1===t.labels.length?t.labels[0].text:t.lang||t.label,language:t.lang,srclang:t.lang,kind:t.kind}}}).map(function(t){var r=t.trackConfig,a=t.dashTrack;if(a.isTTML&&!e.getChild("TTMLTextTrackDisplay"))return null;var i=e.addRemoteTextTrack(r,!1);return n.push({textTrack:i.track,dashTrack:a}),i}).filter(function(e){return null!==e});function i(){for(var t=e.dash.mediaPlayer,a=e.textTracks(),i=-1,s=function(e){var t=a[e];if("showing"===t.mode){var s=function(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return e[r]}(n,function(e){return e.textTrack===t}),o=s?s.dashTrack:null;o&&(i=r.indexOf(o))}},o=0;o<a.length;o+=1)s(o);i!==t.getCurrentTextTrackIndex()&&t.setTextTrack(i)}return e.textTracks().on("change",i),e.dash.mediaPlayer.on(p.MediaPlayer.events.STREAM_TEARDOWN_COMPLETE,function(){e.textTracks().off("change",i)}),i(),a}(e,0,r))}}function _(e,t){return _=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},_(e,t)}function v(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var T=l().getComponent("Component"),S="#222",b={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function A(e,t,r){try{e.style[t]=r}catch(e){return}}function R(e){for(var t in e.style&&(e.style.left=null,e.style.width="100%"),e.children)R(e.children[t])}function I(e,t){var r;if(4===e.length)r=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(7!==e.length)throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");r=e.slice(1)}return"rgba("+parseInt(r.slice(0,2),16)+","+parseInt(r.slice(2,4),16)+","+parseInt(r.slice(4,6),16)+","+t+")"}var C=function(e){var t,r;function n(t,r,n){var a;a=e.call(this,t,l().mergeOptions(r,{playerOptions:{}}),n)||this;for(var i=t.getChild("TextTrackSettings").$$("select"),s=0;s<i.length;s++)a.on(i[s],"change",a.updateStyle.bind(v(a)));return t.dash.mediaPlayer.on(p.MediaPlayer.events.CAPTION_RENDERED,a.updateStyle.bind(v(a))),a}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,_(t,r);var a=n.prototype;return a.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-text-track-display-ttml"},{"aria-live":"off","aria-atomic":"true"});return t.style.position="absolute",t.style.left="0",t.style.right="0",t.style.top="0",t.style.bottom="0",t.style.margin="1.5%",t},a.updateStyle=function(e){var t=e.captionDiv;if(this.player_.textTrackSettings){var r=this.player_.textTrackSettings.getValues();if(t=t||this.player_.getChild("TTMLTextTrackDisplay").el().firstChild){R(t);for(var n=t.getElementsByTagName("span"),a=0;a<n.length;a++){var i=n[a];if(i.parentNode.style.textAlign="center",r.color&&(i.style.color=r.color),r.textOpacity&&A(i,"color",I(r.color||"#fff",r.textOpacity)),r.backgroundColor&&(i.style.backgroundColor=r.backgroundColor),r.backgroundOpacity&&A(i,"backgroundColor",I(r.backgroundColor||"#000",r.backgroundOpacity)),r.windowColor&&(r.windowOpacity?A(i.parentNode,"backgroundColor",I(r.windowColor,r.windowOpacity)):i.parent.style.backgroundColor=r.windowColor),r.edgeStyle&&("dropshadow"===r.edgeStyle?i.style.textShadow="2px 2px 3px #222, 2px 2px 4px #222, 2px 2px 5px "+S:"raised"===r.edgeStyle?i.style.textShadow="1px 1px #222, 2px 2px #222, 3px 3px "+S:"depressed"===r.edgeStyle?i.style.textShadow="1px 1px #ccc, 0 1px #ccc, -1px -1px #222, 0 -1px "+S:"uniform"===r.edgeStyle&&(i.style.textShadow="0 0 4px #222, 0 0 4px #222, 0 0 4px #222, 0 0 4px "+S)),r.fontPercent&&1!==r.fontPercent){var s=f().parseFloat(i.style.fontSize);i.style.fontSize=s*r.fontPercent+"px",i.style.height="auto",i.style.top="auto",i.style.bottom="2px"}r.fontFamily&&"default"!==r.fontFamily&&("small-caps"===r.fontFamily?i.style.fontVariant="small-caps":i.style.fontFamily=b[r.fontFamily])}}}},n}(T);l().registerComponent("TTMLTextTrackDisplay",C);var w=function(){function e(t,r,n){var a=this;if(n=n||r.options_,this.player=l()(n.playerId),this.player.dash=this.player.dash||{},this.tech_=r,this.el_=r.el(),this.elParent_=this.el_.parentNode,this.hasFiniteDuration_=!1,t.src){r.isReady_=!1,e.updateSourceData&&(l().log.warn('updateSourceData has been deprecated. Please switch to using hook("updatesource", callback).'),t=e.updateSourceData(t)),e.hooks("updatesource").forEach(function(e){t=e(t)});var i=t.src;this.keySystemOptions_=e.buildDashJSProtData(t.keySystemOptions),this.player.dash.mediaPlayer=p.MediaPlayer().create(),this.mediaPlayer_=this.player.dash.mediaPlayer,e.useVideoJSDebug&&(l().log.warn('useVideoJSDebug has been deprecated. Please switch to using hook("beforeinitialize", callback).'),e.useVideoJSDebug(this.mediaPlayer_)),e.beforeInitialize&&(l().log.warn('beforeInitialize has been deprecated. Please switch to using hook("beforeinitialize", callback).'),e.beforeInitialize(this.player,this.mediaPlayer_)),e.hooks("beforeinitialize").forEach(function(e){e(a.player,a.mediaPlayer_)}),this.mediaPlayer_.initialize(),this.retriggerError_=function(e){if("capability"===e.error&&"mediasource"===e.event)a.player.error({code:4,message:"The media cannot be played because it requires a feature that your browser does not support."});else if("manifestError"!==e.error||"createParser"!==e.event.id&&"codec"!==e.event.id&&"nostreams"!==e.event.id&&"nostreamscomposed"!==e.event.id&&"parse"!==e.event.id&&"multiplexedrep"!==e.event.id)if("mediasource"===e.error)e.event.match("MEDIA_ERR_ABORTED")?a.player.error({code:1,message:e.event}):e.event.match("MEDIA_ERR_NETWORK")?a.player.error({code:2,message:e.event}):e.event.match("MEDIA_ERR_DECODE")?a.player.error({code:3,message:e.event}):e.event.match("MEDIA_ERR_SRC_NOT_SUPPORTED")?a.player.error({code:4,message:e.event}):e.event.match("MEDIA_ERR_ENCRYPTED")?a.player.error({code:5,message:e.event}):(e.event.match("UNKNOWN"),a.player.error({code:4,message:e.event}));else if("capability"===e.error&&"encryptedmedia"===e.event)a.player.error({code:5,message:"The media cannot be played because it requires encryption features that your browser does not support."});else if("key_session"===e.error)a.player.error({code:5,message:e.event});else if("download"===e.error)a.player.error({code:2,message:"The media playback was aborted because too many consecutive download errors occurred."});else{if("mssError"!==e.error)return;a.player.error({code:3,message:e.event})}else a.player.error({code:4,message:e.event.message});setTimeout(function(){a.mediaPlayer_.reset()},10)},this.mediaPlayer_.on(p.MediaPlayer.events.ERROR,this.retriggerError_),this.getDuration_=function(e){var t=e.data.Period_asArray,r=a.hasFiniteDuration_;e.data.mediaPresentationDuration||t[t.length-1].duration?a.hasFiniteDuration_=!0:a.hasFiniteDuration_=!1,a.hasFiniteDuration_!==r&&a.player.trigger("durationchange")},this.mediaPlayer_.on(p.MediaPlayer.events.MANIFEST_LOADED,this.getDuration_),n.dash&&Object.keys(n.dash).forEach(function(e){var t;if("useTTML"!==e){var r="set"+e.charAt(0).toUpperCase()+e.slice(1),i=n.dash[e];a.mediaPlayer_.hasOwnProperty(r)&&(l().log.warn("Using dash options in videojs-contrib-dash without the set prefix has been deprecated. Change '"+e+"' to '"+r+"'"),e=r),a.mediaPlayer_.hasOwnProperty(e)?(Array.isArray(i)||(i=[i]),(t=a.mediaPlayer_)[e].apply(t,i)):l().log.warn("Warning: dash configuration option unrecognized: "+e)}}),this.mediaPlayer_.attachView(this.el_),n.dash&&n.dash.useTTML&&(this.ttmlContainer_=this.player.addChild("TTMLTextTrackDisplay"),this.mediaPlayer_.attachTTMLRenderingDiv(this.ttmlContainer_.el())),this.mediaPlayer_.setAutoPlay(!1),y.call(null,this.player,r),E.call(null,this.player,r,n),this.mediaPlayer_.setProtectionData(this.keySystemOptions_),this.mediaPlayer_.attachSource(i),this.tech_.triggerReady()}}e.buildDashJSProtData=function(e){var t={};if(!e||!Array.isArray(e))return null;for(var r=0;r<e.length;r++){var n=e[r],a=l().mergeOptions({},n.options);a.licenseUrl&&(a.serverURL=a.licenseUrl,delete a.licenseUrl),t[n.name]=a}return t};var t=e.prototype;return t.dispose=function(){this.mediaPlayer_&&(this.mediaPlayer_.off(p.MediaPlayer.events.ERROR,this.retriggerError_),this.mediaPlayer_.off(p.MediaPlayer.events.MANIFEST_LOADED,this.getDuration_),this.mediaPlayer_.reset()),this.player.dash&&delete this.player.dash,this.ttmlContainer_&&(this.ttmlContainer_.dispose(),this.player.removeChild("TTMLTextTrackDisplay"))},t.duration=function(){return this.mediaPlayer_.isDynamic()&&!this.hasFiniteDuration_?1/0:this.mediaPlayer_.duration()},e.hooks=function(t,r){return e.hooks_[t]=e.hooks_[t]||[],r&&(e.hooks_[t]=e.hooks_[t].concat(r)),e.hooks_[t]},e.hook=function(t,r){e.hooks(t,r)},e.removeHook=function(t,r){var n=e.hooks(t).indexOf(r);return-1!==n&&(e.hooks_[t]=e.hooks_[t].slice(),e.hooks_[t].splice(n,1),!0)},e}();w.hooks_={},l().DashSourceHandler=function(){return{canHandleSource:function(e){return function(e){e=JSON.parse(JSON.stringify(e)),w.updateSourceData&&(l().log.warn('updateSourceData has been deprecated. Please switch to using hook("updatesource", callback).'),e=w.updateSourceData(e)),w.hooks("updatesource").forEach(function(t){e=t(e)});var t=h().createElement("video");return!(e.keySystemOptions&&!f().navigator.requestMediaKeySystemAccess&&!t.msSetMediaKeys)}(e)?l().DashSourceHandler.canPlayType(e.type)?"probably":/\.mpd/i.test(e.src)?"maybe":"":""},handleSource:function(e,t,r){return new w(e,t,r)},canPlayType:function(e){return l().DashSourceHandler.canPlayType(e)}}},l().DashSourceHandler.canPlayType=function(e){return/^application\/dash\+xml/i.test(e)?"probably":""},f().MediaSource&&l().getTech("Html5").registerSourceHandler(l().DashSourceHandler(),0),l().Html5DashJS=w;const N=w},4626:()=>{}}]);
|