Files
sdk4.0/static/3rdparty/liveplayer/liveplayer-element.min.js
2025-07-03 13:54:01 +08:00

1 line
1.6 MiB
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("global/window"),require("global/document")):"function"==typeof define&&define.amd?define(["global/window","global/document"],t):(e=e||self).videojs=t(e.window,e.document)}(this,(function(e,t){function n(e,t){Ye(e).forEach((function(n){return t(e[n],n)}))}function r(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return Object.assign?Object.assign.apply(Object,[e].concat(r)):(r.forEach((function(t){t&&n(t,(function(t,n){e[n]=t}))})),e)}function i(e){return!!e&&"object"==typeof e}function a(e){return i(e)&&"[object Object]"===$e.call(e)&&e.constructor===Object}function s(t,n){if(!t||!n)return"";if("function"==typeof e.getComputedStyle){var r=e.getComputedStyle(t);return r?r.getPropertyValue(n)||r[n]:""}return""}function o(e){return"string"==typeof e&&/\S/.test(e)}function u(e){if(/\s/.test(e))throw new Error("class has illegal whitespace characters")}function l(){return t===e.document}function c(e){return i(e)&&1===e.nodeType}function d(){try{return e.parent!==e.self}catch(e){return!0}}function h(e){return function(n,r){if(!o(n))return t[e](null);o(r)&&(r=t.querySelector(r));var i=c(r)?r:t;return i[e]&&i[e](n)}}function f(e,n,r,i){void 0===e&&(e="div"),void 0===n&&(n={}),void 0===r&&(r={});var a=t.createElement(e);return Object.getOwnPropertyNames(n).forEach((function(e){var t=n[e];-1!==e.indexOf("aria-")||"role"===e||"type"===e?(Ke.warn("Setting attributes in the second argument of createEl()\nhas been deprecated. Use the third argument instead.\ncreateEl(type, properties, attributes). Attempting to set "+e+" to "+t+"."),a.setAttribute(e,t)):"textContent"===e?p(a,t):a[e]=t})),Object.getOwnPropertyNames(r).forEach((function(e){a.setAttribute(e,r[e])})),i&&D(a,i),a}function p(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e}function v(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function m(e,t){return u(t),e.classList?e.classList.contains(t):function(e){return new RegExp("(^|\\s)"+e+"($|\\s)")}(t).test(e.className)}function g(e,t){return e?(e.classList?e.classList.add(t):m(e,t)||(e.className=(e.className+" "+t).trim()),e):e}function y(e,t){return e?(e.classList?e.classList.remove(t):(u(t),e.className=e.className.split(/\s+/).filter((function(e){return e!==t})).join(" ")),e):e}function _(e,t,n){var r=m(e,t);return"function"==typeof n&&(n=n(e,t)),"boolean"!=typeof n&&(n=!r),n===r||(n?g(e,t):y(e,t)),e}function b(e,t){Object.getOwnPropertyNames(t).forEach((function(n){var r=t[n];null==r||!1===r?e.removeAttribute(n):e.setAttribute(n,!0===r?"":r)}))}function T(e){var t={};if(e&&e.attributes&&e.attributes.length>0)for(var n=e.attributes,r=n.length-1;r>=0;r--){var i=n[r].name,a=n[r].value;"boolean"!=typeof e[i]&&-1===",autoplay,stretch,fluent,controls,playsinline,loop,muted,default,defaultMuted,".indexOf(","+i+",")||(a=null!==a),t[i]=a}return t}function S(e,t){return e.getAttribute(t)}function E(e,t,n){e.setAttribute(t,n)}function k(e,t){e.removeAttribute(t)}function w(){t.body.focus(),t.onselectstart=function(){return!1}}function C(){t.onselectstart=function(){return!0}}function A(e){if(e&&e.getBoundingClientRect&&e.parentNode){var t=e.getBoundingClientRect(),n={};return["bottom","height","left","right","top","width"].forEach((function(e){void 0!==t[e]&&(n[e]=t[e])})),n.height||(n.height=parseFloat(s(e,"height"))),n.width||(n.width=parseFloat(s(e,"width"))),n}}function L(n){var r;if(n.getBoundingClientRect&&n.parentNode&&(r=n.getBoundingClientRect()),!r)return{left:0,top:0};var i=t.documentElement,a=t.body,s=i.clientLeft||a.clientLeft||0,o=e.pageXOffset||a.scrollLeft,u=r.left+o-s,l=i.clientTop||a.clientTop||0,c=e.pageYOffset||a.scrollTop,d=r.top+c-l;return{left:Math.round(u),top:Math.round(d)}}function R(e,t){var n={},r=L(e),i=e.offsetWidth,a=e.offsetHeight,s=r.top,o=r.left,u=t.pageY,l=t.pageX;return t.changedTouches&&(l=t.changedTouches[0].pageX,u=t.changedTouches[0].pageY),n.y=Math.max(0,Math.min(1,(s-u+a)/a)),n.x=Math.max(0,Math.min(1,(l-o)/i)),n}function x(e){return i(e)&&3===e.nodeType}function I(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function O(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map((function(e){return"function"==typeof e&&(e=e()),c(e)||x(e)?e:"string"==typeof e&&/\S/.test(e)?t.createTextNode(e):void 0})).filter((function(e){return e}))}function D(e,t){return O(t).forEach((function(t){return e.appendChild(t)})),e}function P(e,t){return D(I(e),t)}function M(e){return void 0===e.button&&void 0===e.buttons||0===e.button&&void 0===e.buttons||"mouseup"===e.type&&0===e.button&&0===e.buttons||0===e.button&&1===e.buttons}function j(){return et++}function U(e,t){if(Ze.has(e)){var n=Ze.get(e);0===n.handlers[t].length&&(delete n.handlers[t],e.removeEventListener?e.removeEventListener(t,n.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,n.dispatcher)),Object.getOwnPropertyNames(n.handlers).length<=0&&(delete n.handlers,delete n.dispatcher,delete n.disabled),0===Object.getOwnPropertyNames(n).length&&Ze.delete(e)}}function B(e,t,n,r){n.forEach((function(n){e(t,n,r)}))}function F(n){function r(){return!0}function i(){return!1}if(!n||!n.isPropagationStopped){var a=n||e.event;n={};var s=["layerX","layerY","keyLocation","path","webkitMovementX","webkitMovementY","mozPressure","mozInputSource"];for(var o in a)s.includes(o)||"returnValue"===o&&a.preventDefault||(n[o]=a[o]);if(n.target||(n.target=n.srcElement||t),n.relatedTarget||(n.relatedTarget=n.fromElement===n.target?n.toElement:n.fromElement),n.preventDefault=function(){a.preventDefault&&a.preventDefault(),n.returnValue=!1,a.returnValue=!1,n.defaultPrevented=!0},n.defaultPrevented=!1,n.stopPropagation=function(){a.stopPropagation&&a.stopPropagation(),n.cancelBubble=!0,a.cancelBubble=!0,n.isPropagationStopped=r},n.isPropagationStopped=i,n.stopImmediatePropagation=function(){a.stopImmediatePropagation&&a.stopImmediatePropagation(),n.isImmediatePropagationStopped=r,n.stopPropagation()},n.isImmediatePropagationStopped=i,null!==n.clientX&&void 0!==n.clientX){var u=t.documentElement,l=t.body;n.pageX=n.clientX+(u&&u.scrollLeft||l&&l.scrollLeft||0)-(u&&u.clientLeft||l&&l.clientLeft||0),n.pageY=n.clientY+(u&&u.scrollTop||l&&l.scrollTop||0)-(u&&u.clientTop||l&&l.clientTop||0)}n.which=n.charCode||n.keyCode,null!==n.button&&void 0!==n.button&&(n.button=1&n.button?0:4&n.button?1:2&n.button?2:0)}return n}function N(e,t,n){if(Array.isArray(t))return B(N,e,t,n);Ze.has(e)||Ze.set(e,{});var r=Ze.get(e);if(r.handlers||(r.handlers={}),r.handlers[t]||(r.handlers[t]=[]),n.guid||(n.guid=j()),r.handlers[t].push(n),r.dispatcher||(r.disabled=!1,r.dispatcher=function(t,n){if(!r.disabled){t=F(t);var i=r.handlers[t.type];if(i)for(var a=i.slice(0),s=0,o=a.length;s<o&&!t.isImmediatePropagationStopped();s++)try{a[s].call(e,t,n)}catch(e){Ke.error(e)}}}),1===r.handlers[t].length)if(e.addEventListener){var i=!1;tt&&rt.indexOf(t)>-1&&(i={passive:!0}),e.addEventListener(t,r.dispatcher,i)}else e.attachEvent&&e.attachEvent("on"+t,r.dispatcher)}function G(e,t,n){if(Ze.has(e)){var r=Ze.get(e);if(r.handlers){if(Array.isArray(t))return B(G,e,t,n);var i=function(e,t){r.handlers[t]=[],U(e,t)};if(void 0!==t){var a=r.handlers[t];if(a){if(!n)return void i(e,t);if(n.guid)for(var s=0;s<a.length;s++)a[s].guid===n.guid&&a.splice(s--,1);U(e,t)}}else for(var o in r.handlers)Object.prototype.hasOwnProperty.call(r.handlers||{},o)&&i(e,o)}}}function V(e,t,n){var r=Ze.has(e)?Ze.get(e):{},i=e.parentNode||e.ownerDocument;if("string"==typeof t?t={type:t,target:e}:t.target||(t.target=e),t=F(t),r.dispatcher&&r.dispatcher.call(e,t,n),i&&!t.isPropagationStopped()&&!0===t.bubbles)V.call(null,i,t,n);else if(!i&&!t.defaultPrevented&&t.target&&t.target[t.type]){Ze.has(t.target)||Ze.set(t.target,{});var a=Ze.get(t.target);t.target[t.type]&&(a.disabled=!0,"function"==typeof t.target[t.type]&&t.target[t.type](),a.disabled=!1)}return!t.defaultPrevented}function H(e,t,n){if(Array.isArray(t))return B(H,e,t,n);var r=function r(){G(e,t,r),n.apply(this,arguments)};r.guid=n.guid=n.guid||j(),N(e,t,r)}function z(e,t,n){var r=function r(){G(e,t,r),n.apply(this,arguments)};r.guid=n.guid=n.guid||j(),N(e,t,r)}function W(t,n){n&&(nt=n),e.setTimeout(st,t)}function K(t,n){void 0===n&&(n={});var i=n.eventBusKey;if(i){if(!t[i].nodeName)throw new Error('The eventBusKey "'+i+'" does not refer to an element.');t.eventBusEl_=t[i]}else t.eventBusEl_=f("span",{className:"vjs-event-bus"});return r(t,Tt),t.eventedCallbacks&&t.eventedCallbacks.forEach((function(e){e()})),t.on("dispose",(function(){t.off(),e.setTimeout((function(){t.eventBusEl_=null}),0)})),t}function q(e,t){return r(e,St),e.state=r({},e.state,t),"function"==typeof e.handleStateChanged&&pt(e)&&e.on("statechanged",e.handleStateChanged),e}function $(){for(var e={},t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return r.forEach((function(t){t&&n(t,(function(t,n){a(t)?(a(e[n])||(e[n]={}),e[n]=$(e[n],t)):e[n]=t}))})),e}function Y(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function X(e,t){return(X=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function J(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function Q(e,t,n){return(Q=J()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&X(i,n.prototype),i}).apply(null,arguments)}function Z(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ee(e,t,n,r){return function(e,t,n){if("number"!=typeof t||t<0||t>n)throw new Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+n+").")}(e,r,n.length-1),n[r][t]}function te(e){return void 0===e||0===e.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:ee.bind(null,"start",0,e),end:ee.bind(null,"end",1,e)}}function ne(e,t){return Array.isArray(e)?te(e):void 0===e||void 0===t?te():te([[e,t]])}function re(e,t){var n,r,i=0;if(!t)return 0;e&&e.length||(e=ne(0,0));for(var a=0;a<e.length;a++)n=e.start(a),(r=e.end(a))>t&&(r=t),i+=r-n;return i/t}function ie(e){if(e instanceof ie)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:i(e)&&("number"==typeof e.code&&(this.code=e.code),r(this,e)),this.message||(this.message=ie.defaultMessages[this.code]||"")}function ae(e){return null!=e&&"function"==typeof e.then}function se(e){ae(e)&&e.then(null,(function(e){}))}function oe(e,t){return e(t={exports:{}},t.exports),t.exports}function ue(e,t,n){var r=e;return Ln(t)?(n=t,"string"==typeof e&&(r={uri:e})):r=qr(t,{uri:e}),r.callback=n,r}function le(e,t,n){return ce(t=ue(e,t,n))}function ce(e){function t(){var e=void 0;if(e=s.response?s.response:s.responseText||function(e){if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;return""!==e.responseType||t?null:e.responseXML}(s),v)try{e=JSON.parse(e)}catch(e){}return e}function n(e){return clearTimeout(l),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,a(e,m)}function r(){if(!u){var n;clearTimeout(l),n=e.useXDR&&void 0===s.status?200:1223===s.status?204:s.status;var r=m,i=null;return 0!==n?(r={body:t(),statusCode:n,method:d,headers:{},url:c,rawRequest:s},s.getAllResponseHeaders&&(r.headers=Kr(s.getAllResponseHeaders()))):i=new Error("Internal XMLHttpRequest Error"),a(i,r,r.body)}}if(void 0===e.callback)throw new Error("callback argument missing");var i=!1,a=function(t,n,r){i||(i=!0,e.callback(t,n,r))},s=e.xhr||null;s||(s=e.cors||e.useXDR?new le.XDomainRequest:new le.XMLHttpRequest);var o,u,l,c=s.url=e.uri||e.url,d=s.method=e.method||"GET",h=e.body||e.data,f=s.headers=e.headers||{},p=!!e.sync,v=!1,m={body:void 0,headers:{},statusCode:0,method:d,url:c,rawRequest:s};if("json"in e&&!1!==e.json&&(v=!0,f.accept||f.Accept||(f.Accept="application/json"),"GET"!==d&&"HEAD"!==d&&(f["content-type"]||f["Content-Type"]||(f["Content-Type"]="application/json"),h=JSON.stringify(!0===e.json?h:e.json))),s.onreadystatechange=function(){4===s.readyState&&setTimeout(r,0)},s.onload=r,s.onerror=n,s.onprogress=function(){},s.onabort=function(){u=!0},s.ontimeout=n,s.open(d,c,!p,e.username,e.password),p||(s.withCredentials=!!e.withCredentials),!p&&e.timeout>0&&(l=setTimeout((function(){if(!u){u=!0,s.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",n(e)}}),e.timeout)),s.setRequestHeader)for(o in f)f.hasOwnProperty(o)&&s.setRequestHeader(o,f[o]);else if(e.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(s.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(s),s.send(h||null),s}function de(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function he(e){function t(e,t,n,r){return 3600*(0|e)+60*(0|t)+(0|n)+(0|r)/1e3}var n=e.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return n?n[3]?t(n[1],n[2],n[3].replace(":",""),n[4]):n[1]>59?t(n[1],n[2],0,n[4]):t(0,n[1],n[2],n[4]):null}function fe(){this.values=ai(null)}function pe(e,t,n,r){var i=r?e.split(r):[e];for(var a in i)if("string"==typeof i[a]){var s=i[a].split(n);if(2===s.length)t(s[0],s[1])}}function ve(e,t,n){function r(){var t=he(e);if(null===t)throw new de(de.Errors.BadTimeStamp,"Malformed timestamp: "+a);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function i(){e=e.replace(/^\s+/,"")}var a=e;if(i(),t.startTime=r(),i(),"--\x3e"!==e.substr(0,3))throw new de(de.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+a);e=e.substr(3),i(),t.endTime=r(),i(),function(e,t){var r=new fe;pe(e,(function(e,t){switch(e){case"region":for(var i=n.length-1;i>=0;i--)if(n[i].id===t){r.set(e,n[i].region);break}break;case"vertical":r.alt(e,t,["rl","lr"]);break;case"line":var a=t.split(","),s=a[0];r.integer(e,s),r.percent(e,s)&&r.set("snapToLines",!1),r.alt(e,s,["auto"]),2===a.length&&r.alt("lineAlign",a[1],["start","middle","end"]);break;case"position":a=t.split(","),r.percent(e,a[0]),2===a.length&&r.alt("positionAlign",a[1],["start","middle","end"]);break;case"size":r.percent(e,t);break;case"align":r.alt(e,t,["start","middle","end","left","right"])}}),/:/,/\s/),t.region=r.get("region",null),t.vertical=r.get("vertical",""),t.line=r.get("line","auto"),t.lineAlign=r.get("lineAlign","start"),t.snapToLines=r.get("snapToLines",!0),t.size=r.get("size",100),t.align=r.get("align","middle"),t.position=r.get("position",{start:0,left:0,middle:50,end:100,right:100},t.align),t.positionAlign=r.get("positionAlign",{start:"start",left:"start",middle:"middle",end:"end",right:"end"},t.align)}(e,t)}function me(e,t){function n(e){return si[e]}for(var r,i=e.document.createElement("div"),a=i,s=[];null!==(r=function(){if(!t)return null;var e=t.match(/^([^<]*)(<[^>]*>?)?/);return function(e){return t=t.substr(e.length),e}(e[1]?e[1]:e[2])}());)if("<"!==r[0])a.appendChild(e.document.createTextNode(function(e){for(;l=e.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)e=e.replace(l[0],n);return e}(r)));else{if("/"===r[1]){s.length&&s[s.length-1]===r.substr(2).replace(">","")&&(s.pop(),a=a.parentNode);continue}var o,u=he(r.substr(1,r.length-2));if(u){o=e.document.createProcessingInstruction("timestamp",u),a.appendChild(o);continue}var l=r.match(/^<([^.\s\/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!l)continue;if(!(o=function(t,n){var r=oi[t];if(!r)return null;var i=e.document.createElement(r);i.localName=r;var a=ui[t];return a&&n&&(i[a]=n.trim()),i}(l[1],l[3])))continue;if(!function(e,t){return!li[t.localName]||li[t.localName]===e.localName}(a,o))continue;l[2]&&(o.className=l[2].substr(1).replace("."," ")),s.push(l[1]),a.appendChild(o),a=o}return i}function ge(e){for(var t=0;t<ci.length;t++){var n=ci[t];if(e>=n[0]&&e<=n[1])return!0}return!1}function ye(e){function t(e,t){for(var n=t.childNodes.length-1;n>=0;n--)e.push(t.childNodes[n])}function n(e){if(!e||!e.length)return null;var r=e.pop(),i=r.textContent||r.innerText;if(i){var a=i.match(/^.*(\n|\r)/);return a?(e.length=0,a[0]):i}return"ruby"===r.tagName?n(e):r.childNodes?(t(e,r),n(e)):void 0}var r=[],i="";if(!e||!e.childNodes)return"ltr";for(t(r,e);i=n(r);)for(var a=0;a<i.length;a++)if(ge(i.charCodeAt(a)))return"rtl";return"ltr"}function _e(){}function be(e,t,n){_e.call(this),this.cue=t,this.cueDiv=me(e,t.text);var r={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(r,this.cueDiv),this.div=e.document.createElement("div"),r={direction:ye(this.cueDiv),writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:"middle"===t.align?"center":t.align,font:n.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(r),this.div.appendChild(this.cueDiv);var i=0;switch(t.positionAlign){case"start":i=t.position;break;case"middle":i=t.position-t.size/2;break;case"end":i=t.position-t.size}""===t.vertical?this.applyStyles({left:this.formatStyle(i,"%"),width:this.formatStyle(t.size,"%")}):this.applyStyles({top:this.formatStyle(i,"%"),height:this.formatStyle(t.size,"%")}),this.move=function(e){this.applyStyles({top:this.formatStyle(e.top,"px"),bottom:this.formatStyle(e.bottom,"px"),left:this.formatStyle(e.left,"px"),right:this.formatStyle(e.right,"px"),height:this.formatStyle(e.height,"px"),width:this.formatStyle(e.width,"px")})}}function Te(e){var t,n,r,i;if(e.div){n=e.div.offsetHeight,r=e.div.offsetWidth,i=e.div.offsetTop;var a=(a=e.div.childNodes)&&(a=a[0])&&a.getClientRects&&a.getClientRects();e=e.div.getBoundingClientRect(),t=a?Math.max(a[0]&&a[0].height||0,e.height/a.length):0}this.left=e.left,this.right=e.right,this.top=e.top||i,this.height=e.height||n,this.bottom=e.bottom||i+(e.height||n),this.width=e.width||r,this.lineHeight=void 0!==t?t:e.lineHeight}function Se(e,t,n,r){var i=new Te(t),a=t.cue,s=function(e){if("number"==typeof e.line&&(e.snapToLines||e.line>=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,n=t.textTrackList,r=0,i=0;i<n.length&&n[i]!==t;i++)"showing"===n[i].mode&&r++;return-1*++r}(a),o=[];if(a.snapToLines){var u;switch(a.vertical){case"":o=["+y","-y"],u="height";break;case"rl":o=["+x","-x"],u="width";break;case"lr":o=["-x","+x"],u="width"}var l=i.lineHeight,c=l*Math.round(s),d=n[u]+l,h=o[0];Math.abs(c)>d&&(c=c<0?-1:1,c*=Math.ceil(d/l)*l),s<0&&(c+=""===a.vertical?n.height:n.width,o=o.reverse()),i.move(h,c)}else{var f=i.lineHeight/n.height*100;switch(a.lineAlign){case"middle":s-=f/2;break;case"end":s-=f}switch(a.vertical){case"":t.applyStyles({top:t.formatStyle(s,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(s,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(s,"%")})}o=["+y","-x","+x","-y"],i=new Te(t)}var p=function(e,t){for(var i,a=new Te(e),s=1,o=0;o<t.length;o++){for(;e.overlapsOppositeAxis(n,t[o])||e.within(n)&&e.overlapsAny(r);)e.move(t[o]);if(e.within(n))return e;var u=e.intersectPercentage(n);s>u&&(i=new Te(e),s=u),e=new Te(a)}return i||a}(i,o);t.move(p.toCSSCompatValues(n))}function Ee(){}function ke(e){return"string"==typeof e&&!!pi[e.toLowerCase()]&&e.toLowerCase()}function we(e,t,n){this.hasBeenReset=!1;var r="",i=!1,a=e,s=t,o=n,u=null,l="",c=!0,d="auto",h="start",f=50,p="middle",v=50,m="middle";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return r},set:function(e){r=""+e}},pauseOnExit:{enumerable:!0,get:function(){return i},set:function(e){i=!!e}},startTime:{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e)throw new TypeError("Start time must be set to a number.");a=e,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e)throw new TypeError("End time must be set to a number.");s=e,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return o},set:function(e){o=""+e,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return u},set:function(e){u=e,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return l},set:function(e){var t=function(e){return"string"==typeof e&&!!fi[e.toLowerCase()]&&e.toLowerCase()}(e);if(!1===t)throw new SyntaxError("An invalid or illegal string was specified.");l=t,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return c},set:function(e){c=!!e,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return d},set:function(e){if("number"!=typeof e&&e!==hi)throw new SyntaxError("An invalid number or illegal string was specified.");d=e,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return h},set:function(e){var t=ke(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");h=t,this.hasBeenReset=!0}},position:{enumerable:!0,get:function(){return f},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");f=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return p},set:function(e){var t=ke(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");p=t,this.hasBeenReset=!0}},size:{enumerable:!0,get:function(){return v},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");v=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return m},set:function(e){var t=ke(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");m=t,this.hasBeenReset=!0}}}),this.displayState=void 0}function Ce(e){return"number"==typeof e&&e>=0&&e<=100}function Ae(e,t,n){e.setTimeout((function(){return function e(t,n,i,a,s,o){void 0===t&&(t={}),void 0===n&&(n=[]),void 0===s&&(s=[]),void 0===o&&(o=!1);var u=n,l=u[0],c=u.slice(1);if("string"==typeof l)e(t,bi[l],i,a,s,o);else if(l){var d=function(e,t){var n=Ti[e.id()],r=null;if(null==n)return r=t(e),Ti[e.id()]=[[t,r]],r;for(var i=0;i<n.length;i++){var a=n[i],s=a[0],o=a[1];s===t&&(r=o)}return null===r&&(r=t(e),n.push([t,r])),r}(a,l);if(!d.setSource)return s.push(d),e(t,c,i,a,s,o);d.setSource(r({},t),(function(n,r){if(n)return e(t,c,i,a,s,o);s.push(d),e(r,t.type===r.type?c:bi[r.type],i,a,s,o)}))}else c.length?e(t,c,i,a,s,o):o?i(t,s):e(t,bi["*"],i,a,s,!0)}(t,bi[t.type],n,e)}),1)}function Le(e,t,n,r){void 0===r&&(r=null);var i="call"+kt(n),a=e.reduce(Re(i),r),s=a===Si,o=s?null:t[n](a);return function(e,t,n,r){for(var i=e.length-1;i>=0;i--){var a=e[i];a[t]&&a[t](r,n)}}(e,n,o,s),o}function Re(e){return function(t,n){return t===Si?Si:n[e]?n[e](t):t}}function xe(e){if(!e.type){var t=Ai(e.src);t&&(e.type=t)}return e}function Ie(e,t){var n;if(4===e.length)n=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.");n=e.slice(1)}return"rgba("+parseInt(n.slice(0,2),16)+","+parseInt(n.slice(2,4),16)+","+parseInt(n.slice(4,6),16)+","+t+")"}function Oe(e,t,n){try{e.style[t]=n}catch(e){return}}function De(e,t){return void 0===t&&(t=e),Fi(e,t)}function Pe(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}function Me(e,t,n){var r=Me.getPlayer(e);if(r)return t&&Ke.warn('Player "'+e+'" is already initialised. Options will not be applied.'),n&&r.ready(n),r;var a="string"==typeof e?Xe("#"+gs(e)):e;if(!c(a))throw new TypeError("The element or ID supplied is not valid. (videojs)");a.ownerDocument.defaultView&&a.ownerDocument.body.contains(a)||Ke.warn("The element supplied is not included in the DOM"),t=t||{},Me.hooks("beforesetup").forEach((function(e){var n=e(a,$(t));i(n)&&!Array.isArray(n)?t=$(t,n):Ke.error("please return an object in beforesetup hooks")}));var s=wt.getComponent("Player");return r=new s(a,t,n),Me.hooks("setup").forEach((function(e){return e(r)})),r}function je(){return(je=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Ue(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function Be(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Fe(t){for(var n=e.atob(t),r=new Uint8Array(n.length),i=0;i<n.length;i++)r[i]=n.charCodeAt(i);return r}function Ne(e,t){return function(n){var r=this;if(!t)return new Td(e);if(Td&&!n){var i=Ge(t.toString().replace(/^function.+?{/,"").slice(0,-1));return this[gd]=new Td(i),function(e,t){if(e&&t){var n=e.terminate;e.objURL=t,e.terminate=function(){e.objURL&&bd.revokeObjectURL(e.objURL),n.call(e)}}}(this[gd],i),this[gd]}var a={postMessage:function(e){r.onmessage&&setTimeout((function(){r.onmessage({data:e,target:a})}))}};t.call(a),this.postMessage=function(e){setTimeout((function(){a.onmessage({data:e,target:r})}))},this.isThisThread=!0}}function Ge(e){try{return bd.createObjectURL(new Blob([e],{type:yd}))}catch(n){var t=new _d;return t.append(e),bd.createObjectURL(t.getBlob(type))}}function Ve(){}e=e&&e.hasOwnProperty("default")?e.default:e,t=t&&t.hasOwnProperty("default")?t.default:t;var He="9.21.9",ze=[],We=function(t,n){return function(r,i,a){var s=n.levels[i],o=new RegExp("^("+s+")$");if("log"!==r&&a.unshift(r.toUpperCase()+":"),a.unshift(t+":"),ze&&ze.push([].concat(a)),e.console){var u=e.console[r];u||"debug"!==r||(u=e.console.info||e.console.log),u&&s&&o.test(r)&&u[Array.isArray(a)?"apply":"call"](e.console,a)}}},Ke=function e(t){var n,r="info",i=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];n("log",r,t)};return n=We(t,i),i.createLogger=function(n){return e(t+": "+n)},i.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:r},i.level=function(e){if("string"==typeof e){if(!i.levels.hasOwnProperty(e))throw new Error('"'+e+'" in not a valid log level');r=e}return r},(i.history=function(){return ze?[].concat(ze):[]}).filter=function(e){return(ze||[]).filter((function(t){return new RegExp(".*"+e+".*").test(t[0])}))},i.history.clear=function(){ze&&(ze.length=0)},i.history.disable=function(){null!==ze&&(ze.length=0,ze=null)},i.history.enable=function(){null===ze&&(ze=[])},i.error=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return n("error",r,t)},i.warn=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return n("warn",r,t)},i.debug=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return n("debug",r,t)},i}("VIDEOJS"),qe=Ke.createLogger,$e=Object.prototype.toString,Ye=function(e){return i(e)?Object.keys(e):[]},Xe=h("querySelector"),Je=h("querySelectorAll"),Qe=Object.freeze({isReal:l,isEl:c,isInFrame:d,createEl:f,textContent:p,prependTo:v,hasClass:m,addClass:g,removeClass:y,toggleClass:_,setAttributes:b,getAttributes:T,getAttribute:S,setAttribute:E,removeAttribute:k,blockTextSelection:w,unblockTextSelection:C,getBoundingClientRect:A,findPosition:L,getPointerPosition:R,isTextNode:x,emptyEl:I,normalizeContent:O,appendContent:D,insertContent:P,isSingleLeftClick:M,$:Xe,$$:Je}),Ze=new WeakMap,et=1,tt=!1;!function(){try{var t=Object.defineProperty({},"passive",{get:function(){tt=!0}});e.addEventListener("test",null,t),e.removeEventListener("test",null,t)}catch(e){}}();var nt,rt=["touchstart","touchmove"],it=Object.freeze({fixEvent:F,on:N,off:G,trigger:V,one:H,any:z}),at=!1,st=function(){if(l()&&!1!==nt.options.autoSetup){var e=Array.prototype.slice.call(t.getElementsByTagName("video")),n=Array.prototype.slice.call(t.getElementsByTagName("audio")),r=Array.prototype.slice.call(t.getElementsByTagName("video-js")),i=e.concat(n,r);if(i&&i.length>0)for(var a=0,s=i.length;a<s;a++){var o=i[a];if(!o||!o.getAttribute){W(1);break}if(void 0===o.player)null!==o.getAttribute("data-setup")&&nt(o)}else at||W(1)}};l()&&"complete"===t.readyState?at=!0:H(e,"load",(function(){at=!0}));var ot,ut=function(e){var n=t.createElement("style");return n.className=e,n},lt=function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t},ct=30,dt=function(e,t,n){t.guid||(t.guid=j());var r=t.bind(e);return r.guid=n?n+"_"+t.guid:t.guid,r},ht=function(t,n){var r=e.performance.now();return function(){var i=e.performance.now();i-r>=n&&(t.apply(void 0,arguments),r=i)}},ft=function(){};ft.prototype.allowedEvents_={},ft.prototype.on=function(e,t){var n=this.addEventListener;this.addEventListener=function(){},N(this,e,t),this.addEventListener=n},ft.prototype.addEventListener=ft.prototype.on,ft.prototype.off=function(e,t){G(this,e,t)},ft.prototype.removeEventListener=ft.prototype.off,ft.prototype.one=function(e,t){var n=this.addEventListener;this.addEventListener=function(){},H(this,e,t),this.addEventListener=n},ft.prototype.any=function(e,t){var n=this.addEventListener;this.addEventListener=function(){},z(this,e,t),this.addEventListener=n},ft.prototype.trigger=function(e){var t=e.type||e;"string"==typeof e&&(e={type:t}),e=F(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),V(this,e)},ft.prototype.dispatchEvent=ft.prototype.trigger,ft.prototype.queueTrigger=function(t){var n=this;ot||(ot=new Map);var r=t.type||t,i=ot.get(this);i||(i=new Map,ot.set(this,i));var a=i.get(r);i.delete(r),e.clearTimeout(a);var s=e.setTimeout((function(){0===i.size&&(i=null,ot.delete(n)),n.trigger(t)}),0);i.set(r,s)};var pt=function(e){return e instanceof ft||!!e.eventBusEl_&&["on","one","off","trigger"].every((function(t){return"function"==typeof e[t]}))},vt=function(e){return"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length},mt=function(e){if(!e.nodeName&&!pt(e))throw new Error("Invalid target; must be a DOM node or evented object.")},gt=function(e){if(!vt(e))throw new Error("Invalid event type; must be a non-empty string or array.")},yt=function(e){if("function"!=typeof e)throw new Error("Invalid listener; must be a function.")},_t=function(e,t){var n,r,i,a=t.length<3||t[0]===e||t[0]===e.eventBusEl_;return a?(n=e.eventBusEl_,t.length>=3&&t.shift(),r=t[0],i=t[1]):(n=t[0],r=t[1],i=t[2]),mt(n),gt(r),yt(i),{isTargetingSelf:a,target:n,type:r,listener:i=dt(e,i)}},bt=function(e,t,n,r){mt(e),e.nodeName?it[t](e,n,r):e[t](n,r)},Tt={on:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=_t(this,n),a=i.isTargetingSelf,s=i.target,o=i.type,u=i.listener;if(bt(s,"on",o,u),!a){var l=function(){return e.off(s,o,u)};l.guid=u.guid;var c=function(){return e.off("dispose",l)};c.guid=u.guid,bt(this,"on","dispose",l),bt(s,"on","dispose",c)}},one:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=_t(this,n),a=i.isTargetingSelf,s=i.target,o=i.type,u=i.listener;if(a)bt(s,"one",o,u);else{var l=function t(){e.off(s,o,t);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];u.apply(null,r)};l.guid=u.guid,bt(s,"one",o,l)}},any:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=_t(this,n),a=i.isTargetingSelf,s=i.target,o=i.type,u=i.listener;if(a)bt(s,"any",o,u);else{var l=function t(){e.off(s,o,t);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];u.apply(null,r)};l.guid=u.guid,bt(s,"any",o,l)}},off:function(e,t,n){if(!e||vt(e))G(this.eventBusEl_,e,t);else{var r=e,i=t;mt(r),gt(i),yt(n),n=dt(this,n),this.off("dispose",n),r.nodeName?(G(r,i,n),G(r,"dispose",n)):pt(r)&&(r.off(i,n),r.off("dispose",n))}},trigger:function(e,t){return V(this.eventBusEl_,e,t)}},St={state:{},setState:function(e){var t,r=this;return"function"==typeof e&&(e=e()),n(e,(function(e,n){r.state[n]!==e&&((t=t||{})[n]={from:r.state[n],to:e}),r.state[n]=e})),t&&pt(this)&&this.trigger({changes:t,type:"statechanged"}),t}},Et=function(e){return"string"!=typeof e?e:e.replace(/./,(function(e){return e.toLowerCase()}))},kt=function(e){return"string"!=typeof e?e:e.replace(/./,(function(e){return e.toUpperCase()}))},wt=function(){function t(e,t,n){if(!e&&this.play?this.player_=e=this:this.player_=e,this.parentComponent_=null,this.options_=$({},this.options_),t=this.options_=$(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){var r=e&&e.id&&e.id()||"no_player";this.id_=r+"_component_"+j()}this.name_=t.name||null,t.el?this.el_=t.el:!1!==t.createEl&&(this.el_=this.createEl()),!1!==t.evented&&K(this,{eventBusKey:this.el_?"el_":null}),q(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.clearingTimersOnDispose_=!1,!1!==t.initChildren&&this.initChildren(),this.ready(n),!1!==t.reportTouchActivity&&this.enableTouchActivity()}var n=t.prototype;return n.dispose=function(){if(this.trigger({type:"dispose",bubbles:!1}),this.children_)for(var e=this.children_.length-1;e>=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),Ze.has(this.el_)&&Ze.delete(this.el_),this.el_=null),this.player_=null},n.player=function(){return this.player_},n.options=function(e){return e?(this.options_=$(this.options_,e),this.options_):this.options_},n.el=function(){return this.el_},n.createEl=function(e,t,n){return f(e,t,n)},n.localize=function(e,t,n){void 0===n&&(n=e);var r=this.player_.language&&this.player_.language(),i=this.player_.languages&&this.player_.languages(),a=i&&i[r],s=r&&r.split("-")[0],o=i&&i[s],u=n;return a&&a[e]?u=a[e]:o&&o[e]&&(u=o[e]),t&&(u=u.replace(/\{(\d+)\}/g,(function(e,n){var r=t[n-1],i=r;return void 0===r&&(i=e),i}))),u},n.contentEl=function(){return this.contentEl_||this.el_},n.id=function(){return this.id_},n.name=function(){return this.name_},n.children=function(){return this.children_},n.getChildById=function(e){return this.childIndex_[e]},n.getChild=function(e){if(e)return this.childNameIndex_[e]},n.addChild=function(e,n,r){var i,a;if(void 0===n&&(n={}),void 0===r&&(r=this.children_.length),"string"==typeof e){a=kt(e);var s=n.componentClass||a;n.name=a;var o=t.getComponent(s);if(!o)throw new Error("Component "+s+" does not exist");if("function"!=typeof o)return null;i=new o(this.player_||this,n)}else i=e;if(i.parentComponent_&&i.parentComponent_.removeChild(i),this.children_.splice(r,0,i),i.parentComponent_=this,"function"==typeof i.id&&(this.childIndex_[i.id()]=i),(a=a||i.name&&kt(i.name()))&&(this.childNameIndex_[a]=i,this.childNameIndex_[Et(a)]=i),"function"==typeof i.el&&i.el()){var u=this.contentEl().children[r]||null;this.contentEl().insertBefore(i.el(),u)}return i},n.removeChild=function(e){if("string"==typeof e&&(e=this.getChild(e)),e&&this.children_){for(var t=!1,n=this.children_.length-1;n>=0;n--)if(this.children_[n]===e){t=!0,this.children_.splice(n,1);break}if(t){e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[kt(e.name())]=null,this.childNameIndex_[Et(e.name())]=null;var r=e.el();r&&r.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}}},n.initChildren=function(){var e=this,n=this.options_.children;if(n){var r,i=this.options_,a=t.getComponent("Tech");(r=Array.isArray(n)?n:Object.keys(n)).concat(Object.keys(this.options_).filter((function(e){return!r.some((function(t){return"string"==typeof t?e===t:e===t.name}))}))).map((function(t){var r,i;return"string"==typeof t?i=n[r=t]||e.options_[r]||{}:(r=t.name,i=t),{name:r,opts:i}})).filter((function(e){var n=t.getComponent(e.opts.componentClass||kt(e.name));return n&&!a.isTech(n)})).forEach((function(t){var n=t.name,r=t.opts;if(void 0!==i[n]&&(r=i[n]),!1!==r){!0===r&&(r={}),r.playerOptions=e.options_.playerOptions;var a=e.addChild(n,r);a&&(e[n]=a)}}))}},n.buildCSSClass=function(){return""},n.ready=function(e,t){if(void 0===t&&(t=!1),e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))},n.triggerReady=function(){this.isReady_=!0,this.setTimeout((function(){var e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach((function(e){e.call(this)}),this),this.trigger("ready")}),1)},n.$=function(e,t){return Xe(e,t||this.contentEl())},n.$$=function(e,t){return Je(e,t||this.contentEl())},n.hasClass=function(e){return m(this.el_,e)},n.addClass=function(e){g(this.el_,e)},n.removeClass=function(e){y(this.el_,e)},n.toggleClass=function(e,t){_(this.el_,e,t)},n.show=function(){this.removeClass("vjs-hidden")},n.hide=function(){this.addClass("vjs-hidden")},n.lockShowing=function(){this.addClass("vjs-lock-showing")},n.unlockShowing=function(){this.removeClass("vjs-lock-showing")},n.getAttribute=function(e){return S(this.el_,e)},n.setAttribute=function(e,t){E(this.el_,e,t)},n.removeAttribute=function(e){k(this.el_,e)},n.width=function(e,t){return this.dimension("width",e,t)},n.height=function(e,t){return this.dimension("height",e,t)},n.dimensions=function(e,t){this.width(e,!0),this.height(t)},n.dimension=function(e,t,n){if(void 0!==t)return null!==t&&t==t||(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",void(n||this.trigger("componentresize"));if(!this.el_)return 0;var r=this.el_.style[e],i=r.indexOf("px");return-1!==i?parseInt(r.slice(0,i),10):parseInt(this.el_["offset"+kt(e)],10)},n.currentDimension=function(e){var t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if(t=s(this.el_,e),0===(t=parseFloat(t))||isNaN(t)){var n="offset"+kt(e);t=this.el_[n]}return t},n.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},n.currentWidth=function(){return this.currentDimension("width")},n.currentHeight=function(){return this.currentDimension("height")},n.focus=function(){this.el_.focus()},n.blur=function(){this.el_.blur()},n.handleKeyDown=function(e){this.player_&&(e.stopPropagation(),this.player_.handleKeyDown(e))},n.handleKeyPress=function(e){this.handleKeyDown(e)},n.emitTapEvents=function(){var t,n=0,r=null;this.on("touchstart",(function(i){1===i.touches.length&&(r={pageX:i.touches[0].pageX,pageY:i.touches[0].pageY},n=e.performance.now(),t=!0)})),this.on("touchmove",(function(e){if(e.touches.length>1)t=!1;else if(r){var n=e.touches[0].pageX-r.pageX,i=e.touches[0].pageY-r.pageY;Math.sqrt(n*n+i*i)>10&&(t=!1)}}));var i=function(){t=!1};this.on("touchleave",i),this.on("touchcancel",i),this.on("touchend",(function(i){r=null,!0===t&&e.performance.now()-n<200&&(i.preventDefault(),this.trigger("tap"))}))},n.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var e,t=dt(this.player(),this.player().reportUserActivity);this.on("touchstart",(function(){t(),this.clearInterval(e),e=this.setInterval(t,250)}));var n=function(n){t(),this.clearInterval(e)};this.on("touchmove",t),this.on("touchend",n),this.on("touchcancel",n)}},n.setTimeout=function(t,n){var r,i=this;return t=dt(this,t),this.clearTimersOnDispose_(),r=e.setTimeout((function(){i.setTimeoutIds_.has(r)&&i.setTimeoutIds_.delete(r),t()}),n),this.setTimeoutIds_.add(r),r},n.clearTimeout=function(t){return this.setTimeoutIds_.has(t)&&(this.setTimeoutIds_.delete(t),e.clearTimeout(t)),t},n.setInterval=function(t,n){t=dt(this,t),this.clearTimersOnDispose_();var r=e.setInterval(t,n);return this.setIntervalIds_.add(r),r},n.clearInterval=function(t){return this.setIntervalIds_.has(t)&&(this.setIntervalIds_.delete(t),e.clearInterval(t)),t},n.requestAnimationFrame=function(t){var n,r=this;return this.supportsRaf_?(this.clearTimersOnDispose_(),t=dt(this,t),n=e.requestAnimationFrame((function(){r.rafIds_.has(n)&&r.rafIds_.delete(n),t()})),this.rafIds_.add(n),n):this.setTimeout(t,1e3/60)},n.cancelAnimationFrame=function(t){return this.supportsRaf_?(this.rafIds_.has(t)&&(this.rafIds_.delete(t),e.cancelAnimationFrame(t)),t):this.clearTimeout(t)},n.clearTimersOnDispose_=function(){var e=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",(function(){[["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach((function(t){var n=t[0],r=t[1];e[n].forEach(e[r],e)})),e.clearingTimersOnDispose_=!1})))},t.registerComponent=function(e,n){if("string"!=typeof e||!e)throw new Error('Illegal component name, "'+e+'"; must be a non-empty string.');var r=t.getComponent("Tech"),i=r&&r.isTech(n),a=t===n||t.prototype.isPrototypeOf(n.prototype);if(i||!a)throw new Error('Illegal component, "'+e+'"; '+(i?"techs must be registered using Tech.registerTech()":"must be a Component subclass")+".");e=kt(e),t.components_||(t.components_={});var s=t.getComponent("Player");if("Player"===e&&s&&s.players){var o=s.players,u=Object.keys(o);if(o&&u.length>0&&u.map((function(e){return o[e]})).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return t.components_[e]=n,t.components_[Et(e)]=n,n},t.getComponent=function(e){if(e&&t.components_)return t.components_[e]},t}();wt.prototype.supportsRaf_="function"==typeof e.requestAnimationFrame&&"function"==typeof e.cancelAnimationFrame,wt.registerComponent("Component",wt);for(var Ct,At=e.navigator&&e.navigator.userAgent||"",Lt=/AppleWebKit\/([\d.]+)/i.exec(At),Rt=Lt?parseFloat(Lt.pop()):null,xt=/iPad/i.test(At),It=/iPhone/i.test(At)&&!xt,Ot=/iPod/i.test(At),Dt=It||xt||Ot,Pt=function(){var e=At.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),Mt=/Android/i.test(At),jt=function(){var e=At.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;var t=e[1]&&parseFloat(e[1]),n=e[2]&&parseFloat(e[2]);return t&&n?parseFloat(e[1]+"."+e[2]):t||null}(),Ut=Mt&&jt<5&&Rt<537,Bt=/Firefox/i.test(At),Ft=/Edge/i.test(At),Nt=!Ft&&(/Chrome/i.test(At)||/CriOS/i.test(At)),Gt=function(){var e=At.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),Vt=function(){var e=/MSIE\s(\d+)\.\d/.exec(At),t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(At)&&/rv:11.0/.test(At)&&(t=11),t}(),Ht=/Safari/i.test(At)&&!Nt&&!Mt&&!Ft,zt=(Ht||Dt)&&!Nt,Wt=/Windows/i.test(At),Kt=(l()&&("ontouchstart"in e||e.navigator.maxTouchPoints||e.DocumentTouch&&e.document instanceof e.DocumentTouch)),qt=Object.freeze({IS_IPAD:xt,IS_IPHONE:It,IS_IPOD:Ot,IS_IOS:Dt,IOS_VERSION:Pt,IS_ANDROID:Mt,ANDROID_VERSION:jt,IS_NATIVE_ANDROID:Ut,IS_FIREFOX:Bt,IS_EDGE:Ft,IS_CHROME:Nt,CHROME_VERSION:Gt,IE_VERSION:Vt,IS_SAFARI:Ht,IS_ANY_SAFARI:zt,IS_WINDOWS:Wt,TOUCH_ENABLED:Kt}),$t={prefixed:!0},Yt=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"]],Xt=Yt[0],Jt=0;Jt<Yt.length;Jt++)if(Yt[Jt][1]in t){Ct=Yt[Jt];break}if(Ct){for(var Qt=0;Qt<Ct.length;Qt++)$t[Xt[Qt]]=Ct[Qt];$t.prefixed=Ct[0]!==Xt[0]}ie.prototype.code=0,ie.prototype.message="",ie.prototype.status=null,ie.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],ie.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};for(var Zt=0;Zt<ie.errorTypes.length;Zt++)ie[ie.errorTypes[Zt]]=Zt,ie.prototype[ie.errorTypes[Zt]]=Zt;var en=function(e,t){var n,r=null;try{n=JSON.parse(e,t)}catch(e){r=e}return[r,n]},tn=function(e){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((function(t,n,r){return e[n]&&(t[n]=e[n]),t}),{cues:e.cues&&Array.prototype.map.call(e.cues,(function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}}))})},nn=function(e){var t=e.$$("track"),n=Array.prototype.map.call(t,(function(e){return e.track}));return Array.prototype.map.call(t,(function(e){var t=tn(e.track);return e.src&&(t.src=e.src),t})).concat(Array.prototype.filter.call(e.textTracks(),(function(e){return-1===n.indexOf(e)})).map(tn))},rn=function(e,t){return e.forEach((function(e){var n=t.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach((function(e){return n.addCue(e)}))})),t.textTracks()},an=oe((function(e,t){function n(e){if(e&&"object"==typeof e){var t=e.which||e.keyCode||e.charCode;t&&(e=t)}if("number"==typeof e)return s[e];var n,a=String(e);return(n=r[a.toLowerCase()])?n:(n=i[a.toLowerCase()])||(1===a.length?a.charCodeAt(0):void 0)}n.isEventKey=function(e,t){if(e&&"object"==typeof e){var n=e.which||e.keyCode||e.charCode;if(null==n)return!1;if("string"==typeof t){var a;if(a=r[t.toLowerCase()])return a===n;if(a=i[t.toLowerCase()])return a===n}else if("number"==typeof t)return t===n;return!1}};var r=(t=e.exports=n).code=t.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},i=t.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};for(a=97;a<123;a++)r[String.fromCharCode(a)]=a-32;for(var a=48;a<58;a++)r[a-48]=a;for(a=1;a<13;a++)r["f"+a]=a+111;for(a=0;a<10;a++)r["numpad "+a]=a+96;var s=t.names=t.title={};for(a in r)s[r[a]]=a;for(var o in i)r[o]=i[o]})),sn=(an.code,an.codes,an.aliases,an.names,an.title,"vjs-modal-dialog"),on=function(n){function r(e,t){var r;return(r=n.call(this,e,t)||this).opened_=r.hasBeenOpened_=r.hasBeenFilled_=!1,r.closeable(!r.options_.uncloseable),r.content(r.options_.content),r.contentEl_=f("div",{className:sn+"-content"},{role:"document"}),r.descEl_=f("p",{className:sn+"-description vjs-control-text",id:r.el().getAttribute("aria-describedby")}),p(r.descEl_,r.description()),r.el_.appendChild(r.descEl_),r.el_.appendChild(r.contentEl_),r}Y(r,n);var i=r.prototype;return i.createEl=function(){return n.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":this.id()+"_description","aria-hidden":"true","aria-label":this.label(),role:"dialog"})},i.dispose=function(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,n.prototype.dispose.call(this)},i.buildCSSClass=function(){return sn+" vjs-hidden "+n.prototype.buildCSSClass.call(this)},i.label=function(){return this.localize(this.options_.label||"Modal Window")},i.description=function(){var e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e},i.open=function(){if(!this.opened_){var e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}},i.opened=function(e){return"boolean"==typeof e&&this[e?"open":"close"](),this.opened_},i.close=function(){if(this.opened_){var e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}},i.closeable=function(e){if("boolean"==typeof e){var t=this.closeable_=!!e,n=this.getChild("closeButton");if(t&&!n){var r=this.contentEl_;this.contentEl_=this.el_,n=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=r,this.on(n,"close",this.close)}!t&&n&&(this.off(n,"close",this.close),this.removeChild(n),n.dispose())}return this.closeable_},i.fill=function(){this.fillWith(this.content())},i.fillWith=function(e){var t=this.contentEl(),n=t.parentNode,r=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,n.removeChild(t),this.empty(),P(t,e),this.trigger("modalfill"),r?n.insertBefore(t,r):n.appendChild(t);var i=this.getChild("closeButton");i&&n.appendChild(i.el_)},i.empty=function(){this.trigger("beforemodalempty"),I(this.contentEl()),this.trigger("modalempty")},i.content=function(e){return void 0!==e&&(this.content_=e),this.content_},i.conditionalFocus_=function(){var e=t.activeElement,n=this.player_.el_;this.previouslyActiveEl_=null,(n.contains(e)||n===e)&&(this.previouslyActiveEl_=e,this.focus())},i.conditionalBlur_=function(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)},i.handleKeyDown=function(e){if(e.stopPropagation(),an.isEventKey(e,"Escape")&&this.closeable())return e.preventDefault(),void this.close();if(an.isEventKey(e,"Tab")){for(var n,r=this.focusableEls_(),i=this.el_.querySelector(":focus"),a=0;a<r.length;a++)if(i===r[a]){n=a;break}t.activeElement===this.el_&&(n=0),e.shiftKey&&0===n?(r[r.length-1].focus(),e.preventDefault()):e.shiftKey||n!==r.length-1||(r[0].focus(),e.preventDefault())}},i.focusableEls_=function(){var t=this.el_.querySelectorAll("*");return Array.prototype.filter.call(t,(function(t){return(t instanceof e.HTMLAnchorElement||t instanceof e.HTMLAreaElement)&&t.hasAttribute("href")||(t instanceof e.HTMLInputElement||t instanceof e.HTMLSelectElement||t instanceof e.HTMLTextAreaElement||t instanceof e.HTMLButtonElement)&&!t.hasAttribute("disabled")||t instanceof e.HTMLIFrameElement||t instanceof e.HTMLObjectElement||t instanceof e.HTMLEmbedElement||t.hasAttribute("tabindex")&&-1!==t.getAttribute("tabindex")||t.hasAttribute("contenteditable")}))},r}(wt);on.prototype.options_={pauseOnOpen:!0,temporary:!0},wt.registerComponent("ModalDialog",on);var un=function(e){function t(t){var n;void 0===t&&(t=[]),(n=e.call(this)||this).tracks_=[],Object.defineProperty(Z(n),"length",{get:function(){return this.tracks_.length}});for(var r=0;r<t.length;r++)n.addTrack(t[r]);return n}Y(t,e);var n=t.prototype;return n.addTrack=function(e){var t=this.tracks_.length;""+t in this||Object.defineProperty(this,t,{get:function(){return this.tracks_[t]}}),-1===this.tracks_.indexOf(e)&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this}))},n.removeTrack=function(e){for(var t,n=0,r=this.length;n<r;n++)if(this[n]===e){(t=this[n]).off&&t.off(),this.tracks_.splice(n,1);break}t&&this.trigger({track:t,type:"removetrack",target:this})},n.getTrackById=function(e){for(var t=null,n=0,r=this.length;n<r;n++){var i=this[n];if(i.id===e){t=i;break}}return t},t}(ft);for(var ln in un.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack"},un.prototype.allowedEvents_)un.prototype["on"+ln]=null;var cn,dn=function(e,t){for(var n=0;n<e.length;n++)Object.keys(e[n]).length&&t.id!==e[n].id&&(e[n].enabled=!1)},hn=function(e){function t(t){var n;void 0===t&&(t=[]);for(var r=t.length-1;r>=0;r--)if(t[r].enabled){dn(t,t[r]);break}return(n=e.call(this,t)||this).changing_=!1,n}Y(t,e);var n=t.prototype;return n.addTrack=function(t){var n=this;t.enabled&&dn(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&(t.enabledChange_=function(){n.changing_||(n.changing_=!0,dn(n,t),n.changing_=!1,n.trigger("change"))},t.addEventListener("enabledchange",t.enabledChange_))},n.removeTrack=function(t){e.prototype.removeTrack.call(this,t),t.removeEventListener&&t.enabledChange_&&(t.removeEventListener("enabledchange",t.enabledChange_),t.enabledChange_=null)},t}(un),fn=function(e,t){for(var n=0;n<e.length;n++)Object.keys(e[n]).length&&t.id!==e[n].id&&(e[n].selected=!1)},pn=function(e){function t(t){var n;void 0===t&&(t=[]);for(var r=t.length-1;r>=0;r--)if(t[r].selected){fn(t,t[r]);break}return(n=e.call(this,t)||this).changing_=!1,Object.defineProperty(Z(n),"selectedIndex",{get:function(){for(var e=0;e<this.length;e++)if(this[e].selected)return e;return-1},set:function(){}}),n}Y(t,e);var n=t.prototype;return n.addTrack=function(t){var n=this;t.selected&&fn(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&(t.selectedChange_=function(){n.changing_||(n.changing_=!0,fn(n,t),n.changing_=!1,n.trigger("change"))},t.addEventListener("selectedchange",t.selectedChange_))},n.removeTrack=function(t){e.prototype.removeTrack.call(this,t),t.removeEventListener&&t.selectedChange_&&(t.removeEventListener("selectedchange",t.selectedChange_),t.selectedChange_=null)},t}(un),vn=function(e){function t(){return e.apply(this,arguments)||this}Y(t,e);var n=t.prototype;return n.addTrack=function(t){var n=this;e.prototype.addTrack.call(this,t),this.queueChange_||(this.queueChange_=function(){return n.queueTrigger("change")}),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=function(){return n.trigger("selectedlanguagechange")}),t.addEventListener("modechange",this.queueChange_),-1===["metadata","chapters"].indexOf(t.kind)&&t.addEventListener("modechange",this.triggerSelectedlanguagechange_)},n.removeTrack=function(t){e.prototype.removeTrack.call(this,t),t.removeEventListener&&(this.queueChange_&&t.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&t.removeEventListener("modechange",this.triggerSelectedlanguagechange_))},t}(un),mn=function(){function e(e){void 0===e&&(e=[]),this.trackElements_=[],Object.defineProperty(this,"length",{get:function(){return this.trackElements_.length}});for(var t=0,n=e.length;t<n;t++)this.addTrackElement_(e[t])}var t=e.prototype;return t.addTrackElement_=function(e){var t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get:function(){return this.trackElements_[t]}}),-1===this.trackElements_.indexOf(e)&&this.trackElements_.push(e)},t.getTrackElementByTrack_=function(e){for(var t,n=0,r=this.trackElements_.length;n<r;n++)if(e===this.trackElements_[n].track){t=this.trackElements_[n];break}return t},t.removeTrackElement_=function(e){for(var t=0,n=this.trackElements_.length;t<n;t++)if(e===this.trackElements_[t]){this.trackElements_[t].track&&"function"==typeof this.trackElements_[t].track.off&&this.trackElements_[t].track.off(),"function"==typeof this.trackElements_[t].off&&this.trackElements_[t].off(),this.trackElements_.splice(t,1);break}},e}(),gn=function(){function e(t){e.prototype.setCues_.call(this,t),Object.defineProperty(this,"length",{get:function(){return this.length_}})}var t=e.prototype;return t.setCues_=function(e){var t=this.length||0,n=0,r=e.length;this.cues_=e,this.length_=e.length;var i=function(e){""+e in this||Object.defineProperty(this,""+e,{get:function(){return this.cues_[e]}})};if(t<r)for(n=t;n<r;n++)i.call(this,n)},t.getCueById=function(e){for(var t=null,n=0,r=this.length;n<r;n++){var i=this[n];if(i.id===e){t=i;break}}return t},e}(),yn={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},_n={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},bn={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},Tn={disabled:"disabled",hidden:"hidden",showing:"showing"},Sn=function(e){function t(t){var n;void 0===t&&(t={}),n=e.call(this)||this;var r={id:t.id||"vjs_track_"+j(),kind:t.kind||"",label:t.label||"",language:t.language||""};for(var i in r)!function(e){Object.defineProperty(Z(n),e,{get:function(){return r[e]},set:function(){}})}(i);return n}return Y(t,e),t}(ft),En=function(n){var r=["protocol","hostname","port","pathname","search","hash","host"],i=t.createElement("a");i.href=n;for(var a={},s=0;s<r.length;s++)a[r[s]]=i[r[s]];return"http:"===a.protocol&&(a.host=a.host.replace(/:80$/,"")),"https:"===a.protocol&&(a.host=a.host.replace(/:443$/,"")),a.protocol||(a.protocol=e.location.protocol),a.host||(a.host=e.location.host),a},kn=function(e){if(!e.match(/^https?:\/\//)){var n=t.createElement("a");n.href=e,e=n.href}return e},wn=function(e){if("string"==typeof e){var t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(e);if(t)return t.pop().toLowerCase()}return""},Cn=function(t){var n=e.location,r=En(t);return(":"===r.protocol?n.protocol:r.protocol)+r.host!==n.protocol+n.host},An=Object.freeze({parseUrl:En,getAbsoluteURL:kn,getFileExtension:wn,isCrossOrigin:Cn}),Ln=function(e){var t=Rn.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)},Rn=Object.prototype.toString,xn=Array.prototype.slice,In=Object.prototype.toString,On=Function.prototype.bind||function(e){var t=this;if("function"!=typeof t||"[object Function]"!==In.call(t))throw new TypeError("Function.prototype.bind called on incompatible "+t);for(var n,r=xn.call(arguments,1),i=function(){if(this instanceof n){var i=t.apply(this,r.concat(xn.call(arguments)));return Object(i)===i?i:this}return t.apply(e,r.concat(xn.call(arguments)))},a=Math.max(0,t.length-r.length),s=[],o=0;o<a;o++)s.push("$"+o);if(n=Function("binder","return function ("+s.join(",")+"){ return binder.apply(this,arguments); }")(i),t.prototype){var u=function(){};u.prototype=t.prototype,n.prototype=new u,u.prototype=null}return n},Dn=Object.prototype.toString,Pn=function(e){var t=Dn.call(e),n="[object Arguments]"===t;return n||(n="[object Array]"!==t&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===Dn.call(e.callee)),n};if(!Object.keys){var Mn=Object.prototype.hasOwnProperty,jn=Object.prototype.toString,Un=Pn,Bn=Object.prototype.propertyIsEnumerable,Fn=!Bn.call({toString:null},"toString"),Nn=Bn.call((function(){}),"prototype"),Gn=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Vn=function(e){var t=e.constructor;return t&&t.prototype===e},Hn={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},zn=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!Hn["$"+e]&&Mn.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{Vn(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();cn=function(e){var t=null!==e&&"object"==typeof e,n="[object Function]"===jn.call(e),r=Un(e),i=t&&"[object String]"===jn.call(e),a=[];if(!t&&!n&&!r)throw new TypeError("Object.keys called on a non-object");var s=Nn&&n;if(i&&e.length>0&&!Mn.call(e,0))for(var o=0;o<e.length;++o)a.push(String(o));if(r&&e.length>0)for(var u=0;u<e.length;++u)a.push(String(u));else for(var l in e)s&&"prototype"===l||!Mn.call(e,l)||a.push(String(l));if(Fn)for(var c=function(e){if("undefined"==typeof window||!zn)return Vn(e);try{return Vn(e)}catch(e){return!1}}(e),d=0;d<Gn.length;++d)c&&"constructor"===Gn[d]||!Mn.call(e,Gn[d])||a.push(Gn[d]);return a}}var Wn=cn,Kn=Array.prototype.slice,qn=Object.keys,$n=qn?function(e){return qn(e)}:Wn,Yn=Object.keys;$n.shim=function(){return Object.keys?function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2)||(Object.keys=function(e){return Yn(Pn(e)?Kn.call(e):e)}):Object.keys=$n,Object.keys||$n};var Xn=$n,Jn="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),Qn=Object.prototype.toString,Zn=Array.prototype.concat,er=Object.defineProperty,tr=er&&function(){var e={};try{for(var t in er(e,"x",{enumerable:!1,value:e}),e)return!1;return e.x===e}catch(e){return!1}}(),nr=function(e,t,n,r){(!(t in e)||function(e){return"function"==typeof e&&"[object Function]"===Qn.call(e)}(r)&&r())&&(tr?er(e,t,{configurable:!0,enumerable:!1,value:n,writable:!0}):e[t]=n)},rr=function(e,t){var n=arguments.length>2?arguments[2]:{},r=Xn(t);Jn&&(r=Zn.call(r,Object.getOwnPropertySymbols(t)));for(var i=0;i<r.length;i+=1)nr(e,r[i],t[r[i]],n[r[i]])};rr.supportsDescriptors=!!tr;var ir=rr,ar=Object.getOwnPropertyDescriptor?function(){return Object.getOwnPropertyDescriptor(arguments,"callee").get}():function(){throw new TypeError},sr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,or=Object.getPrototypeOf||function(e){return e.__proto__},ur="undefined"==typeof Uint8Array?void 0:or(Uint8Array),lr={"$ %Array%":Array,"$ %ArrayBuffer%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer,"$ %ArrayBufferPrototype%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer.prototype,"$ %ArrayIteratorPrototype%":sr?or([][Symbol.iterator]()):void 0,"$ %ArrayPrototype%":Array.prototype,"$ %ArrayProto_entries%":Array.prototype.entries,"$ %ArrayProto_forEach%":Array.prototype.forEach,"$ %ArrayProto_keys%":Array.prototype.keys,"$ %ArrayProto_values%":Array.prototype.values,"$ %AsyncFromSyncIteratorPrototype%":void 0,"$ %AsyncFunction%":void 0,"$ %AsyncFunctionPrototype%":void 0,"$ %AsyncGenerator%":void 0,"$ %AsyncGeneratorFunction%":void 0,"$ %AsyncGeneratorPrototype%":void 0,"$ %AsyncIteratorPrototype%":void 0,"$ %Atomics%":"undefined"==typeof Atomics?void 0:Atomics,"$ %Boolean%":Boolean,"$ %BooleanPrototype%":Boolean.prototype,"$ %DataView%":"undefined"==typeof DataView?void 0:DataView,"$ %DataViewPrototype%":"undefined"==typeof DataView?void 0:DataView.prototype,"$ %Date%":Date,"$ %DatePrototype%":Date.prototype,"$ %decodeURI%":decodeURI,"$ %decodeURIComponent%":decodeURIComponent,"$ %encodeURI%":encodeURI,"$ %encodeURIComponent%":encodeURIComponent,"$ %Error%":Error,"$ %ErrorPrototype%":Error.prototype,"$ %eval%":eval,"$ %EvalError%":EvalError,"$ %EvalErrorPrototype%":EvalError.prototype,"$ %Float32Array%":"undefined"==typeof Float32Array?void 0:Float32Array,"$ %Float32ArrayPrototype%":"undefined"==typeof Float32Array?void 0:Float32Array.prototype,"$ %Float64Array%":"undefined"==typeof Float64Array?void 0:Float64Array,"$ %Float64ArrayPrototype%":"undefined"==typeof Float64Array?void 0:Float64Array.prototype,"$ %Function%":Function,"$ %FunctionPrototype%":Function.prototype,"$ %Generator%":void 0,"$ %GeneratorFunction%":void 0,"$ %GeneratorPrototype%":void 0,"$ %Int8Array%":"undefined"==typeof Int8Array?void 0:Int8Array,"$ %Int8ArrayPrototype%":"undefined"==typeof Int8Array?void 0:Int8Array.prototype,"$ %Int16Array%":"undefined"==typeof Int16Array?void 0:Int16Array,"$ %Int16ArrayPrototype%":"undefined"==typeof Int16Array?void 0:Int8Array.prototype,"$ %Int32Array%":"undefined"==typeof Int32Array?void 0:Int32Array,"$ %Int32ArrayPrototype%":"undefined"==typeof Int32Array?void 0:Int32Array.prototype,"$ %isFinite%":isFinite,"$ %isNaN%":isNaN,"$ %IteratorPrototype%":sr?or(or([][Symbol.iterator]())):void 0,"$ %JSON%":JSON,"$ %JSONParse%":JSON.parse,"$ %Map%":"undefined"==typeof Map?void 0:Map,"$ %MapIteratorPrototype%":"undefined"!=typeof Map&&sr?or((new Map)[Symbol.iterator]()):void 0,"$ %MapPrototype%":"undefined"==typeof Map?void 0:Map.prototype,"$ %Math%":Math,"$ %Number%":Number,"$ %NumberPrototype%":Number.prototype,"$ %Object%":Object,"$ %ObjectPrototype%":Object.prototype,"$ %ObjProto_toString%":Object.prototype.toString,"$ %ObjProto_valueOf%":Object.prototype.valueOf,"$ %parseFloat%":parseFloat,"$ %parseInt%":parseInt,"$ %Promise%":"undefined"==typeof Promise?void 0:Promise,"$ %PromisePrototype%":"undefined"==typeof Promise?void 0:Promise.prototype,"$ %PromiseProto_then%":"undefined"==typeof Promise?void 0:Promise.prototype.then,"$ %Promise_all%":"undefined"==typeof Promise?void 0:Promise.all,"$ %Promise_reject%":"undefined"==typeof Promise?void 0:Promise.reject,"$ %Promise_resolve%":"undefined"==typeof Promise?void 0:Promise.resolve,"$ %Proxy%":"undefined"==typeof Proxy?void 0:Proxy,"$ %RangeError%":RangeError,"$ %RangeErrorPrototype%":RangeError.prototype,"$ %ReferenceError%":ReferenceError,"$ %ReferenceErrorPrototype%":ReferenceError.prototype,"$ %Reflect%":"undefined"==typeof Reflect?void 0:Reflect,"$ %RegExp%":RegExp,"$ %RegExpPrototype%":RegExp.prototype,"$ %Set%":"undefined"==typeof Set?void 0:Set,"$ %SetIteratorPrototype%":"undefined"!=typeof Set&&sr?or((new Set)[Symbol.iterator]()):void 0,"$ %SetPrototype%":"undefined"==typeof Set?void 0:Set.prototype,"$ %SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer,"$ %SharedArrayBufferPrototype%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer.prototype,"$ %String%":String,"$ %StringIteratorPrototype%":sr?or(""[Symbol.iterator]()):void 0,"$ %StringPrototype%":String.prototype,"$ %Symbol%":sr?Symbol:void 0,"$ %SymbolPrototype%":sr?Symbol.prototype:void 0,"$ %SyntaxError%":SyntaxError,"$ %SyntaxErrorPrototype%":SyntaxError.prototype,"$ %ThrowTypeError%":ar,"$ %TypedArray%":ur,"$ %TypedArrayPrototype%":ur?ur.prototype:void 0,"$ %TypeError%":TypeError,"$ %TypeErrorPrototype%":TypeError.prototype,"$ %Uint8Array%":"undefined"==typeof Uint8Array?void 0:Uint8Array,"$ %Uint8ArrayPrototype%":"undefined"==typeof Uint8Array?void 0:Uint8Array.prototype,"$ %Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray,"$ %Uint8ClampedArrayPrototype%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray.prototype,"$ %Uint16Array%":"undefined"==typeof Uint16Array?void 0:Uint16Array,"$ %Uint16ArrayPrototype%":"undefined"==typeof Uint16Array?void 0:Uint16Array.prototype,"$ %Uint32Array%":"undefined"==typeof Uint32Array?void 0:Uint32Array,"$ %Uint32ArrayPrototype%":"undefined"==typeof Uint32Array?void 0:Uint32Array.prototype,"$ %URIError%":URIError,"$ %URIErrorPrototype%":URIError.prototype,"$ %WeakMap%":"undefined"==typeof WeakMap?void 0:WeakMap,"$ %WeakMapPrototype%":"undefined"==typeof WeakMap?void 0:WeakMap.prototype,"$ %WeakSet%":"undefined"==typeof WeakSet?void 0:WeakSet,"$ %WeakSetPrototype%":"undefined"==typeof WeakSet?void 0:WeakSet.prototype},cr=function(e,t){if(arguments.length>1&&"boolean"!=typeof t)throw new TypeError('"allowMissing" argument must be a boolean');var n="$ "+e;if(!(n in lr))throw new SyntaxError("intrinsic "+e+" does not exist!");if(void 0===lr[n]&&!t)throw new TypeError("intrinsic "+e+" exists, but is not available. Please file an issue!");return lr[n]},dr=On.call(Function.call,Object.prototype.hasOwnProperty),hr=cr("%TypeError%"),fr=cr("%SyntaxError%"),pr={"Property Descriptor":function(e,t){if("Object"!==e.Type(t))return!1;var n={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var r in t)if(dr(t,r)&&!n[r])return!1;var i=dr(t,"[[Value]]"),a=dr(t,"[[Get]]")||dr(t,"[[Set]]");if(i&&a)throw new hr("Property Descriptors may not be both accessor and data descriptors");return!0}},vr=function(e,t,n,r){var i=pr[t];if("function"!=typeof i)throw new fr("unknown record type: "+t);if(!i(e,r))throw new hr(n+" must be a "+t);console.log(i(e,r),r)},mr=Number.isNaN||function(e){return e!=e},gr=Number.isNaN||function(e){return e!=e},yr=Number.isFinite||function(e){return"number"==typeof e&&!gr(e)&&e!==1/0&&e!==-1/0},_r=function(e){return e>=0?1:-1},br=Function.prototype.toString,Tr=/^\s*class\b/,Sr=function(e){try{var t=br.call(e);return Tr.test(t)}catch(e){return!1}},Er=Object.prototype.toString,kr="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,wr=function(e){if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if("function"==typeof e&&!e.prototype)return!0;if(kr)return function(e){try{return!Sr(e)&&(br.call(e),!0)}catch(e){return!1}}(e);if(Sr(e))return!1;var t=Er.call(e);return"[object Function]"===t||"[object GeneratorFunction]"===t},Cr=function(e){return null===e||"function"!=typeof e&&"object"!=typeof e},Ar=Object.prototype.toString,Lr=function(e){var t;if((t=arguments.length>1?arguments[1]:"[object Date]"===Ar.call(e)?String:Number)===String||t===Number){var n,r,i=t===String?["toString","valueOf"]:["valueOf","toString"];for(r=0;r<i.length;++r)if(wr(e[i[r]])&&(n=e[i[r]](),Cr(n)))return n;throw new TypeError("No default value")}throw new TypeError("invalid [[DefaultValue]] hint supplied")},Rr=cr("%Object%"),xr=cr("%TypeError%"),Ir=cr("%String%"),Or={ToPrimitive:function(e){return Cr(e)?e:arguments.length>1?Lr(e,arguments[1]):Lr(e)},ToBoolean:function(e){return!!e},ToNumber:function(e){return+e},ToInteger:function(e){var t=this.ToNumber(e);return mr(t)?0:0!==t&&yr(t)?_r(t)*Math.floor(Math.abs(t)):t},ToInt32:function(e){return this.ToNumber(e)>>0},ToUint32:function(e){return this.ToNumber(e)>>>0},ToUint16:function(e){var t=this.ToNumber(e);return mr(t)||0===t||!yr(t)?0:function(e,t){var n=e%t;return Math.floor(n>=0?n:n+t)}(_r(t)*Math.floor(Math.abs(t)),65536)},ToString:function(e){return Ir(e)},ToObject:function(e){return this.CheckObjectCoercible(e),Rr(e)},CheckObjectCoercible:function(e,t){if(null==e)throw new xr(t||"Cannot call method on "+e);return e},IsCallable:wr,SameValue:function(e,t){return e===t?0!==e||1/e==1/t:mr(e)&&mr(t)},Type:function(e){return null===e?"Null":void 0===e?"Undefined":"function"==typeof e||"object"==typeof e?"Object":"number"==typeof e?"Number":"boolean"==typeof e?"Boolean":"string"==typeof e?"String":void 0},IsPropertyDescriptor:function(e){if("Object"!==this.Type(e))return!1;var t={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var n in e)if(dr(e,n)&&!t[n])return!1;var r=dr(e,"[[Value]]"),i=dr(e,"[[Get]]")||dr(e,"[[Set]]");if(r&&i)throw new xr("Property Descriptors may not be both accessor and data descriptors");return!0},IsAccessorDescriptor:function(e){return void 0!==e&&(vr(this,"Property Descriptor","Desc",e),!(!dr(e,"[[Get]]")&&!dr(e,"[[Set]]")))},IsDataDescriptor:function(e){return void 0!==e&&(vr(this,"Property Descriptor","Desc",e),!(!dr(e,"[[Value]]")&&!dr(e,"[[Writable]]")))},IsGenericDescriptor:function(e){return void 0!==e&&(vr(this,"Property Descriptor","Desc",e),!this.IsAccessorDescriptor(e)&&!this.IsDataDescriptor(e))},FromPropertyDescriptor:function(e){if(void 0===e)return e;if(vr(this,"Property Descriptor","Desc",e),this.IsDataDescriptor(e))return{value:e["[[Value]]"],writable:!!e["[[Writable]]"],enumerable:!!e["[[Enumerable]]"],configurable:!!e["[[Configurable]]"]};if(this.IsAccessorDescriptor(e))return{get:e["[[Get]]"],set:e["[[Set]]"],enumerable:!!e["[[Enumerable]]"],configurable:!!e["[[Configurable]]"]};throw new xr("FromPropertyDescriptor must be called with a fully populated Property Descriptor")},ToPropertyDescriptor:function(e){if("Object"!==this.Type(e))throw new xr("ToPropertyDescriptor requires an object");var t={};if(dr(e,"enumerable")&&(t["[[Enumerable]]"]=this.ToBoolean(e.enumerable)),dr(e,"configurable")&&(t["[[Configurable]]"]=this.ToBoolean(e.configurable)),dr(e,"value")&&(t["[[Value]]"]=e.value),dr(e,"writable")&&(t["[[Writable]]"]=this.ToBoolean(e.writable)),dr(e,"get")){var n=e.get;if(void 0!==n&&!this.IsCallable(n))throw new TypeError("getter must be a function");t["[[Get]]"]=n}if(dr(e,"set")){var r=e.set;if(void 0!==r&&!this.IsCallable(r))throw new xr("setter must be a function");t["[[Set]]"]=r}if((dr(t,"[[Get]]")||dr(t,"[[Set]]"))&&(dr(t,"[[Value]]")||dr(t,"[[Writable]]")))throw new xr("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return t}},Dr=On.call(Function.call,String.prototype.replace),Pr=/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,Mr=/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/,jr=function(){var e=Or.ToString(Or.CheckObjectCoercible(this));return Dr(Dr(e,Pr,""),Mr,"")},Ur=function(){return String.prototype.trim&&""==="".trim()?String.prototype.trim:jr},Br=On.call(Function.call,Ur());ir(Br,{getPolyfill:Ur,implementation:jr,shim:function(){var e=Ur();return ir(String.prototype,{trim:e},{trim:function(){return String.prototype.trim!==e}}),e}});var Fr=Br,Nr=Object.prototype.toString,Gr=Object.prototype.hasOwnProperty,Vr=function(e,t,n){for(var r=0,i=e.length;r<i;r++)Gr.call(e,r)&&(null==n?t(e[r],r,e):t.call(n,e[r],r,e))},Hr=function(e,t,n){for(var r=0,i=e.length;r<i;r++)null==n?t(e.charAt(r),r,e):t.call(n,e.charAt(r),r,e)},zr=function(e,t,n){for(var r in e)Gr.call(e,r)&&(null==n?t(e[r],r,e):t.call(n,e[r],r,e))},Wr=function(e,t,n){if(!wr(t))throw new TypeError("iterator must be a function");var r;arguments.length>=3&&(r=n),"[object Array]"===Nr.call(e)?Vr(e,t,r):"string"==typeof e?Hr(e,t,r):zr(e,t,r)},Kr=function(e){if(!e)return{};var t={};return Wr(Fr(e).split("\n"),(function(e){var n=e.indexOf(":"),r=Fr(e.slice(0,n)).toLowerCase(),i=Fr(e.slice(n+1));void 0===t[r]?t[r]=i:function(e){return"[object Array]"===Object.prototype.toString.call(e)}(t[r])?t[r].push(i):t[r]=[t[r],i]})),t},qr=function(){for(var e={},t=0;t<arguments.length;t++){var n=arguments[t];for(var r in n)$r.call(n,r)&&(e[r]=n[r])}return e},$r=Object.prototype.hasOwnProperty,Yr=le;le.XMLHttpRequest=e.XMLHttpRequest||function(){},le.XDomainRequest="withCredentials"in new le.XMLHttpRequest?le.XMLHttpRequest:e.XDomainRequest,function(e,t){for(var n=0;n<e.length;n++)t(e[n])}(["get","put","post","patch","head","delete"],(function(e){le["delete"===e?"del":e]=function(t,n,r){return(n=ue(t,n,r)).method=e.toUpperCase(),ce(n)}}));var Xr=function(t,n){var r=new e.WebVTT.Parser(e,e.vttjs,e.WebVTT.StringDecoder()),i=[];r.oncue=function(e){n.addCue(e)},r.onparsingerror=function(e){i.push(e)},r.onflush=function(){n.trigger({type:"loadeddata",target:n})},r.parse(t),i.length>0&&(e.console&&e.console.groupCollapsed&&e.console.groupCollapsed("Text Track parsing errors for "+n.src),i.forEach((function(e){return Ke.error(e)})),e.console&&e.console.groupEnd&&e.console.groupEnd()),r.flush()},Jr=function(t,n){var r={uri:t},i=Cn(t);i&&(r.cors=i),Yr(r,dt(this,(function(t,r,i){if(t)return Ke.error(t,r);n.loaded_=!0,"function"!=typeof e.WebVTT?n.tech_&&n.tech_.any(["vttjsloaded","vttjserror"],(function(e){return"vttjserror"===e.type?void Ke.error("vttjs failed to load, stopping trying to process "+n.src):Xr(i,n)})):Xr(i,n)})))},Qr=function(t){function n(e){var n;if(void 0===e&&(e={}),!e.tech)throw new Error("A tech was not provided.");var r=$(e,{kind:bn[e.kind]||"subtitles",language:e.language||e.srclang||""}),i=Tn[r.mode]||"disabled",a=r.default;"metadata"!==r.kind&&"chapters"!==r.kind||(i="hidden"),(n=t.call(this,r)||this).tech_=r.tech,n.cues_=[],n.activeCues_=[];var s=new gn(n.cues_),o=new gn(n.activeCues_),u=!1,l=dt(Z(n),(function(){this.activeCues=this.activeCues,u&&(this.trigger("cuechange"),u=!1)}));return"disabled"!==i&&n.tech_.ready((function(){n.tech_.on("timeupdate",l)}),!0),Object.defineProperties(Z(n),{default:{get:function(){return a},set:function(){}},mode:{get:function(){return i},set:function(e){var t=this;Tn[e]&&("disabled"!==(i=e)?this.tech_.ready((function(){t.tech_.on("timeupdate",l)}),!0):this.tech_.off("timeupdate",l),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?s:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return o;for(var e=this.tech_.currentTime(),t=[],n=0,r=this.cues.length;n<r;n++){var i=this.cues[n];(i.startTime<=e&&i.endTime>=e||i.startTime===i.endTime&&i.startTime<=e&&i.startTime+.5>=e)&&t.push(i)}if(u=!1,t.length!==this.activeCues_.length)u=!0;else for(var a=0;a<t.length;a++)-1===this.activeCues_.indexOf(t[a])&&(u=!0);return this.activeCues_=t,o.setCues_(this.activeCues_),o},set:function(){}}}),r.src?(n.src=r.src,Jr(r.src,Z(n))):n.loaded_=!0,n}Y(n,t);var r=n.prototype;return r.addCue=function(t){var n=t;if(e.vttjs&&!(t instanceof e.vttjs.VTTCue)){for(var r in n=new e.vttjs.VTTCue(t.startTime,t.endTime,t.text),t)r in n||(n[r]=t[r]);n.id=t.id,n.originalCue_=t}for(var i=this.tech_.textTracks(),a=0;a<i.length;a++)i[a]!==this&&i[a].removeCue(n);this.cues_.push(n),this.cues.setCues_(this.cues_)},r.removeCue=function(e){for(var t=this.cues_.length;t--;){var n=this.cues_[t];if(n===e||n.originalCue_&&n.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}},n}(Sn);Qr.prototype.allowedEvents_={cuechange:"cuechange"};var Zr=function(e){function t(t){var n;void 0===t&&(t={});var r=$(t,{kind:_n[t.kind]||""});n=e.call(this,r)||this;var i=!1;return Object.defineProperty(Z(n),"enabled",{get:function(){return i},set:function(e){"boolean"==typeof e&&e!==i&&(i=e,this.trigger("enabledchange"))}}),r.enabled&&(n.enabled=r.enabled),n.loaded_=!0,n}return Y(t,e),t}(Sn),ei=function(e){function t(t){var n;void 0===t&&(t={});var r=$(t,{kind:yn[t.kind]||""});n=e.call(this,r)||this;var i=!1;return Object.defineProperty(Z(n),"selected",{get:function(){return i},set:function(e){"boolean"==typeof e&&e!==i&&(i=e,this.trigger("selectedchange"))}}),r.selected&&(n.selected=r.selected),n}return Y(t,e),t}(Sn),ti=function(e){function t(t){var n;void 0===t&&(t={}),n=e.call(this)||this;var r,i=new Qr(t);return n.kind=i.kind,n.src=i.src,n.srclang=i.language,n.label=i.label,n.default=i.default,Object.defineProperties(Z(n),{readyState:{get:function(){return r}},track:{get:function(){return i}}}),r=0,i.addEventListener("loadeddata",(function(){r=2,n.trigger({type:"load",target:Z(n)})})),n}return Y(t,e),t}(ft);ti.prototype.allowedEvents_={load:"load"},ti.NONE=0,ti.LOADING=1,ti.LOADED=2,ti.ERROR=3;var ni={audio:{ListClass:hn,TrackClass:Zr,capitalName:"Audio"},video:{ListClass:pn,TrackClass:ei,capitalName:"Video"},text:{ListClass:vn,TrackClass:Qr,capitalName:"Text"}};Object.keys(ni).forEach((function(e){ni[e].getterName=e+"Tracks",ni[e].privateName=e+"Tracks_"}));var ri={remoteText:{ListClass:vn,TrackClass:Qr,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:mn,TrackClass:ti,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},ii=$(ni,ri);ri.names=Object.keys(ri),ni.names=Object.keys(ni),ii.names=[].concat(ri.names).concat(ni.names);var ai=Object.create||function(){function e(){}return function(t){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return e.prototype=t,new e}}();de.prototype=ai(Error.prototype),de.prototype.constructor=de,de.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},fe.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,n){return n?this.has(e)?this.values[e]:t[n]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,n){for(var r=0;r<n.length;++r)if(t===n[r]){this.set(e,t);break}},integer:function(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))},percent:function(e,t){return!!(t.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(t=parseFloat(t))>=0&&t<=100)&&(this.set(e,t),!0)}};var si={"&amp;":"&","&lt;":"<","&gt;":">","&lrm;":"","&rlm;":"","&nbsp;":" "},oi={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},ui={v:"title",lang:"lang"},li={rt:"ruby"},ci=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];_e.prototype.applyStyles=function(e,t){for(var n in t=t||this.div,e)e.hasOwnProperty(n)&&(t.style[n]=e[n])},_e.prototype.formatStyle=function(e,t){return 0===e?0:e+t},be.prototype=ai(_e.prototype),be.prototype.constructor=be,Te.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t}},Te.prototype.overlaps=function(e){return this.left<e.right&&this.right>e.left&&this.top<e.bottom&&this.bottom>e.top},Te.prototype.overlapsAny=function(e){for(var t=0;t<e.length;t++)if(this.overlaps(e[t]))return!0;return!1},Te.prototype.within=function(e){return this.top>=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},Te.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.left<e.left;case"-x":return this.right>e.right;case"+y":return this.top<e.top;case"-y":return this.bottom>e.bottom}},Te.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)},Te.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},Te.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,n=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,r=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||r,height:e.height||t,bottom:e.bottom||r+(e.height||t),width:e.width||n}},Ee.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},Ee.convertCueToDOMTree=function(e,t){return e&&t?me(e,t):null},Ee.processCues=function(e,t,n){if(!e||!t||!n)return null;for(;n.firstChild;)n.removeChild(n.firstChild);var r=e.document.createElement("div");if(r.style.position="absolute",r.style.left="0",r.style.right="0",r.style.top="0",r.style.bottom="0",r.style.margin="1.5%",n.appendChild(r),function(e){for(var t=0;t<e.length;t++)if(e[t].hasBeenReset||!e[t].displayState)return!0;return!1}(t)){var i=[],a=Te.getSimpleBoxPosition(r),s={font:Math.round(.05*a.height*100)/100+"px sans-serif"};!function(){for(var n,o,u=0;u<t.length;u++)o=t[u],n=new be(e,o,s),r.appendChild(n.div),Se(0,n,a,i),o.displayState=n.div,i.push(Te.getSimpleBoxPosition(n))}()}else for(var o=0;o<t.length;o++)r.appendChild(t[o].displayState)},Ee.Parser=function(e,t,n){n||(n=t,t={}),t||(t={}),this.window=e,this.vttjs=t,this.state="INITIAL",this.buffer="",this.decoder=n||new TextDecoder("utf8"),this.regionList=[]},Ee.Parser.prototype={reportOrThrowError:function(e){if(!(e instanceof de))throw e;this.onparsingerror&&this.onparsingerror(e)},parse:function(e){function t(){for(var e=i.buffer,t=0;t<e.length&&"\r"!==e[t]&&"\n"!==e[t];)++t;var n=e.substr(0,t);return"\r"===e[t]&&++t,"\n"===e[t]&&++t,i.buffer=e.substr(t),n}function n(e){var t=new fe;if(pe(e,(function(e,n){switch(e){case"id":t.set(e,n);break;case"width":t.percent(e,n);break;case"lines":t.integer(e,n);break;case"regionanchor":case"viewportanchor":var r=n.split(",");if(2!==r.length)break;var i=new fe;if(i.percent("x",r[0]),i.percent("y",r[1]),!i.has("x")||!i.has("y"))break;t.set(e+"X",i.get("x")),t.set(e+"Y",i.get("y"));break;case"scroll":t.alt(e,n,["up"])}}),/=/,/\s/),t.has("id")){var n=new(i.vttjs.VTTRegion||i.window.VTTRegion);n.width=t.get("width",100),n.lines=t.get("lines",3),n.regionAnchorX=t.get("regionanchorX",0),n.regionAnchorY=t.get("regionanchorY",100),n.viewportAnchorX=t.get("viewportanchorX",0),n.viewportAnchorY=t.get("viewportanchorY",100),n.scroll=t.get("scroll",""),i.onregion&&i.onregion(n),i.regionList.push({id:t.get("id"),region:n})}}function r(e){var t=new fe;pe(e,(function(e,n){switch(e){case"MPEGT":t.integer(e+"S",n);break;case"LOCA":t.set(e+"L",he(n))}}),/[^\d]:/,/,/),i.ontimestampmap&&i.ontimestampmap({MPEGTS:t.get("MPEGTS"),LOCAL:t.get("LOCAL")})}var i=this;e&&(i.buffer+=i.decoder.decode(e,{stream:!0}));try{var a;if("INITIAL"===i.state){if(!/\r\n|\n/.test(i.buffer))return this;var s=(a=t()).match(/^WEBVTT([ \t].*)?$/);if(!s||!s[0])throw new de(de.Errors.BadSignature);i.state="HEADER"}for(var o=!1;i.buffer;){if(!/\r\n|\n/.test(i.buffer))return this;switch(o?o=!1:a=t(),i.state){case"HEADER":/:/.test(a)?function(e){e.match(/X-TIMESTAMP-MAP/)?pe(e,(function(e,t){switch(e){case"X-TIMESTAMP-MAP":r(t)}}),/=/):pe(e,(function(e,t){switch(e){case"Region":n(t)}}),/:/)}(a):a||(i.state="ID");continue;case"NOTE":a||(i.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(a)){i.state="NOTE";break}if(!a)continue;if(i.cue=new(i.vttjs.VTTCue||i.window.VTTCue)(0,0,""),i.state="CUE",-1===a.indexOf("--\x3e")){i.cue.id=a;continue}case"CUE":try{ve(a,i.cue,i.regionList)}catch(e){i.reportOrThrowError(e),i.cue=null,i.state="BADCUE";continue}i.state="CUETEXT";continue;case"CUETEXT":var u=-1!==a.indexOf("--\x3e");if(!a||u&&(o=!0)){i.oncue&&i.oncue(i.cue),i.cue=null,i.state="ID";continue}i.cue.text&&(i.cue.text+="\n"),i.cue.text+=a;continue;case"BADCUE":a||(i.state="ID");continue}}}catch(e){i.reportOrThrowError(e),"CUETEXT"===i.state&&i.cue&&i.oncue&&i.oncue(i.cue),i.cue=null,i.state="INITIAL"===i.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var e=this;try{if(e.buffer+=e.decoder.decode(),(e.cue||"HEADER"===e.state)&&(e.buffer+="\n\n",e.parse()),"INITIAL"===e.state)throw new de(de.Errors.BadSignature)}catch(t){e.reportOrThrowError(t)}return e.onflush&&e.onflush(),this}};var di=Ee,hi="auto",fi={"":1,lr:1,rl:1},pi={start:1,middle:1,end:1,left:1,right:1};we.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var vi=we,mi={"":!0,up:!0},gi=function(){var e=100,t=3,n=0,r=100,i=0,a=100,s="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!Ce(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return t},set:function(e){if("number"!=typeof e)throw new TypeError("Lines must be set to a number.");t=e}},regionAnchorY:{enumerable:!0,get:function(){return r},set:function(e){if(!Ce(e))throw new Error("RegionAnchorX must be between 0 and 100.");r=e}},regionAnchorX:{enumerable:!0,get:function(){return n},set:function(e){if(!Ce(e))throw new Error("RegionAnchorY must be between 0 and 100.");n=e}},viewportAnchorY:{enumerable:!0,get:function(){return a},set:function(e){if(!Ce(e))throw new Error("ViewportAnchorY must be between 0 and 100.");a=e}},viewportAnchorX:{enumerable:!0,get:function(){return i},set:function(e){if(!Ce(e))throw new Error("ViewportAnchorX must be between 0 and 100.");i=e}},scroll:{enumerable:!0,get:function(){return s},set:function(e){var t=function(e){return"string"==typeof e&&!!mi[e.toLowerCase()]&&e.toLowerCase()}(e);if(!1===t)throw new SyntaxError("An invalid or illegal string was specified.");s=t}}})},yi=oe((function(t){var n=t.exports={WebVTT:di,VTTCue:vi,VTTRegion:gi};e.vttjs=n,e.WebVTT=n.WebVTT;var r=n.VTTCue,i=n.VTTRegion,a=e.VTTCue,s=e.VTTRegion;n.shim=function(){e.VTTCue=r,e.VTTRegion=i},n.restore=function(){e.VTTCue=a,e.VTTRegion=s},e.VTTCue||n.shim()})),_i=(yi.WebVTT,yi.VTTCue,yi.VTTRegion,function(n){function r(e,t){var r;return void 0===e&&(e={}),void 0===t&&(t=function(){}),e.reportTouchActivity=!1,(r=n.call(this,null,e,t)||this).hasStarted_=!1,r.on("playing",(function(){this.hasStarted_=!0})),r.on("loadstart",(function(){this.hasStarted_=!1})),ii.names.forEach((function(t){var n=ii[t];e&&e[n.getterName]&&(r[n.privateName]=e[n.getterName])})),r.featuresProgressEvents||r.manualProgressOn(),r.featuresTimeupdateEvents||r.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach((function(t){!1===e["native"+t+"Tracks"]&&(r["featuresNative"+t+"Tracks"]=!1)})),!1===e.nativeCaptions||!1===e.nativeTextTracks?r.featuresNativeTextTracks=!1:!0!==e.nativeCaptions&&!0!==e.nativeTextTracks||(r.featuresNativeTextTracks=!0),r.featuresNativeTextTracks||r.emulateTextTracks(),r.autoRemoteTextTracks_=new ii.text.ListClass,r.initTrackListeners(),e.nativeControlsForTouch||r.emitTapEvents(),r.constructor&&(r.name_=r.constructor.name||"Unknown Tech"),r}Y(r,n);var i=r.prototype;return i.triggerSourceset=function(e){var t=this;this.isReady_||this.one("ready",(function(){return t.setTimeout((function(){return t.triggerSourceset(e)}),1)})),this.trigger({src:e,type:"sourceset"})},i.manualProgressOn=function(){this.on("durationchange",this.onDurationChange),this.manualProgress=!0,this.one("ready",this.trackProgress)},i.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange)},i.trackProgress=function(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(dt(this,(function(){var e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger("progress"),this.bufferedPercent_=e,1===e&&this.stopTrackingProgress()})),500)},i.onDurationChange=function(e){this.duration_=this.duration()},i.buffered=function(){return ne(0,0)},i.bufferedPercent=function(){return re(this.buffered(),this.duration_)},i.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},i.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime),this.on("pause",this.stopTrackingCurrentTime)},i.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime),this.off("pause",this.stopTrackingCurrentTime)},i.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval((function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}),250)},i.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},i.dispose=function(){this.clearTracks(ni.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),n.prototype.dispose.call(this)},i.clearTracks=function(e){var t=this;(e=[].concat(e)).forEach((function(e){for(var n=t[e+"Tracks"]()||[],r=n.length;r--;){var i=n[r];"text"===e&&t.removeRemoteTextTrack(i),n.removeTrack(i)}}))},i.cleanupAutoTextTracks=function(){for(var e=this.autoRemoteTextTracks_||[],t=e.length;t--;){var n=e[t];this.removeRemoteTextTrack(n)}},i.reset=function(){},i.error=function(e){return void 0!==e&&(this.error_=new ie(e),this.trigger("error")),this.error_},i.played=function(){return this.hasStarted_?ne(0,0):ne()},i.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},i.initTrackListeners=function(){var e=this;ni.names.forEach((function(t){var n=ni[t],r=function(){e.trigger(t+"trackchange")},i=e[n.getterName]();i.addEventListener("removetrack",r),i.addEventListener("addtrack",r),e.on("dispose",(function(){i.removeEventListener("removetrack",r),i.removeEventListener("addtrack",r)}))}))},i.addWebVttScript_=function(){var n=this;if(!e.WebVTT)if(t.body.contains(this.el())){if(!this.options_["vtt.js"]&&a(yi)&&Object.keys(yi).length>0)return void this.trigger("vttjsloaded");var r=t.createElement("script");r.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",r.onload=function(){n.trigger("vttjsloaded")},r.onerror=function(){n.trigger("vttjserror")},this.on("dispose",(function(){r.onload=null,r.onerror=null})),e.WebVTT=!0,this.el().parentNode.appendChild(r)}else this.ready(this.addWebVttScript_)},i.emulateTextTracks=function(){var e=this,t=this.textTracks(),n=this.remoteTextTracks(),r=function(e){return t.addTrack(e.track)},i=function(e){return t.removeTrack(e.track)};n.on("addtrack",r),n.on("removetrack",i),this.addWebVttScript_();var a=function(){return e.trigger("texttrackchange")},s=function(){a();for(var e=0;e<t.length;e++){var n=t[e];n.removeEventListener("cuechange",a),"showing"===n.mode&&n.addEventListener("cuechange",a)}};s(),t.addEventListener("change",s),t.addEventListener("addtrack",s),t.addEventListener("removetrack",s),this.on("dispose",(function(){n.off("addtrack",r),n.off("removetrack",i),t.removeEventListener("change",s),t.removeEventListener("addtrack",s),t.removeEventListener("removetrack",s);for(var e=0;e<t.length;e++)t[e].removeEventListener("cuechange",a)}))},i.addTextTrack=function(e,t,n){if(!e)throw new Error("TextTrack kind is required but was not provided");return function(e,t,n,r,i){void 0===i&&(i={});var a=e.textTracks();i.kind=t,n&&(i.label=n),r&&(i.language=r),i.tech=e;var s=new ii.text.TrackClass(i);return a.addTrack(s),s}(this,e,t,n)},i.createRemoteTextTrack=function(e){var t=$(e,{tech:this});return new ri.remoteTextEl.TrackClass(t)},i.addRemoteTextTrack=function(e,t){var n=this;void 0===e&&(e={});var r=this.createRemoteTextTrack(e);return!0!==t&&!1!==t&&(Ke.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),t=!0),this.remoteTextTrackEls().addTrackElement_(r),this.remoteTextTracks().addTrack(r.track),!0!==t&&this.ready((function(){return n.autoRemoteTextTracks_.addTrack(r.track)})),r},i.removeRemoteTextTrack=function(e){var t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)},i.getVideoPlaybackQuality=function(){return{}},i.requestPictureInPicture=function(){var t=this.options_.Promise||e.Promise;if(t)return t.reject()},i.setPoster=function(){},i.playsinline=function(){},i.setPlaysinline=function(){},i.overrideNativeAudioTracks=function(){},i.overrideNativeVideoTracks=function(){},i.canPlayType=function(){return""},r.canPlayType=function(){return""},r.canPlaySource=function(e,t){return r.canPlayType(e.type)},r.isTech=function(e){return e.prototype instanceof r||e instanceof r||e===r},r.registerTech=function(e,t){if(r.techs_||(r.techs_={}),!r.isTech(t))throw new Error("Tech "+e+" must be a Tech");if(!r.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!r.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=kt(e),r.techs_[e]=t,r.techs_[Et(e)]=t,"Tech"!==e&&r.defaultTechOrder_.push(e),t},r.getTech=function(t){if(t)return r.techs_&&r.techs_[t]?r.techs_[t]:(t=kt(t),e&&e.videojs&&e.videojs[t]?(Ke.warn("The "+t+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),e.videojs[t]):void 0)},r}(wt));ii.names.forEach((function(e){var t=ii[e];_i.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}})),_i.prototype.featuresVolumeControl=!0,_i.prototype.featuresMuteControl=!0,_i.prototype.featuresFullscreenResize=!1,_i.prototype.featuresPlaybackRate=!1,_i.prototype.featuresProgressEvents=!1,_i.prototype.featuresSourceset=!1,_i.prototype.featuresTimeupdateEvents=!1,_i.prototype.featuresNativeTextTracks=!1,_i.withSourceHandlers=function(e){e.registerSourceHandler=function(t,n){var r=e.sourceHandlers;r||(r=e.sourceHandlers=[]),void 0===n&&(n=r.length),r.splice(n,0,t)},e.canPlayType=function(t){for(var n,r=e.sourceHandlers||[],i=0;i<r.length;i++)if(n=r[i].canPlayType(t))return n;return""},e.selectSourceHandler=function(t,n){for(var r=e.sourceHandlers||[],i=0;i<r.length;i++)if(r[i].canHandleSource(t,n))return r[i];return null},e.canPlaySource=function(t,n){var r=e.selectSourceHandler(t,n);return r?r.canHandleSource(t,n):""},["seekable","seeking","duration"].forEach((function(e){var t=this[e];"function"==typeof t&&(this[e]=function(){return this.sourceHandler_&&this.sourceHandler_[e]?this.sourceHandler_[e].apply(this.sourceHandler_,arguments):t.apply(this,arguments)})}),e.prototype),e.prototype.setSource=function(t){var n=e.selectSourceHandler(t,this.options_);n||(e.nativeSourceHandler?n=e.nativeSourceHandler:Ke.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler),n!==e.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=n.handleSource(t,this,this.options_),this.one("dispose",this.disposeSourceHandler)},e.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}},wt.registerComponent("Tech",_i),_i.registerTech("Tech",_i),_i.defaultTechOrder_=[];var bi={},Ti={},Si={},Ei={buffered:1,currentTime:1,duration:1,seekable:1,played:1,paused:1,volume:1},ki={setCurrentTime:1,setVolume:1},wi={play:1,pause:1},Ci={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",oga:"audio/ogg",m3u8:"application/x-mpegURL",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},Ai=function(e){void 0===e&&(e="");var t=wn(e);return Ci[t.toLowerCase()]||""},Li=function(e){function t(t,n,r){var i,a=$({createEl:!1},n);if(i=e.call(this,t,a,r)||this,n.playerOptions.sources&&0!==n.playerOptions.sources.length)t.src(n.playerOptions.sources);else for(var s=0,o=n.playerOptions.techOrder;s<o.length;s++){var u=kt(o[s]),l=_i.getTech(u);if(u||(l=wt.getComponent(u)),l&&l.isSupported()){t.loadTech_(u);break}}return i}return Y(t,e),t}(wt);wt.registerComponent("MediaLoader",Li);var Ri=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).emitTapEvents(),r.enable(),r}Y(t,e);var n=t.prototype;return n.createEl=function(t,n,i){void 0===t&&(t="div"),void 0===n&&(n={}),void 0===i&&(i={}),n=r({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass(),tabIndex:0},n),"button"===t&&Ke.error("Creating a ClickableComponent with an HTML element of "+t+" is not supported; use a Button instead."),i=r({role:"button"},i),this.tabIndex_=n.tabIndex;var a=e.prototype.createEl.call(this,t,n,i);return this.createControlTextEl(a),a},n.dispose=function(){this.controlTextEl_=null,e.prototype.dispose.call(this)},n.createControlTextEl=function(e){return this.controlTextEl_=f("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_},n.controlText=function(e,t){if(void 0===t&&(t=this.el()),void 0===e)return this.controlText_||"Need Text";var n=this.localize(e);this.controlText_=e,p(this.controlTextEl_,n),this.nonIconControl||t.setAttribute("title",n)},n.buildCSSClass=function(){return"vjs-control vjs-button "+e.prototype.buildCSSClass.call(this)},n.enable=function(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),void 0!==this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick),this.on("keydown",this.handleKeyDown))},n.disable=function(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),void 0!==this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver),this.off("mouseout",this.handleMouseOut),this.off(["tap","click"],this.handleClick),this.off("keydown",this.handleKeyDown)},n.handleClick=function(e){},n.handleKeyDown=function(t){an.isEventKey(t,"Space")||an.isEventKey(t,"Enter")?(t.preventDefault(),t.stopPropagation(),this.trigger("click")):e.prototype.handleKeyDown.call(this,t)},t}(wt);wt.registerComponent("ClickableComponent",Ri);var xi=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).update(),t.on("posterchange",dt(Z(r),r.update)),r}Y(t,e);var n=t.prototype;return n.dispose=function(){this.player().off("posterchange",this.update),e.prototype.dispose.call(this)},n.createEl=function(){return f("div",{className:"vjs-poster",tabIndex:-1})},n.update=function(e){var t=this.player().poster();this.setSrc(t),t?this.show():this.hide()},n.setSrc=function(e){var t="";e&&(t='url("'+e+'")'),this.el_.style.backgroundImage=t},n.handleClick=function(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?se(this.player_.play()):this.player_.pause())},t}(Ri);wt.registerComponent("PosterImage",xi);var Ii={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'},Oi=function(t){function n(n,r,i){var a;a=t.call(this,n,r,i)||this;var s=dt(Z(a),a.updateDisplay);return n.on("loadstart",dt(Z(a),a.toggleDisplay)),n.on("texttrackchange",s),n.on("loadedmetadata",dt(Z(a),a.preselectTrack)),n.ready(dt(Z(a),(function(){if(n.tech_&&n.tech_.featuresNativeTextTracks)this.hide();else{n.on("fullscreenchange",s),n.on("playerresize",s),e.addEventListener("orientationchange",s),n.on("dispose",(function(){return e.removeEventListener("orientationchange",s)}));for(var t=this.options_.playerOptions.tracks||[],r=0;r<t.length;r++)this.player_.addRemoteTextTrack(t[r],!0);this.preselectTrack()}}))),a}Y(n,t);var r=n.prototype;return r.preselectTrack=function(){for(var e,t,n,r={captions:1,subtitles:1},i=this.player_.textTracks(),a=this.player_.cache_.selectedLanguage,s=0;s<i.length;s++){var o=i[s];a&&a.enabled&&a.language&&a.language===o.language&&o.kind in r?o.kind===a.kind?n=o:n||(n=o):a&&!a.enabled?(n=null,e=null,t=null):o.default&&("descriptions"!==o.kind||e?o.kind in r&&!t&&(t=o):e=o)}n?n.mode="showing":t?t.mode="showing":e&&(e.mode="showing")},r.toggleDisplay=function(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()},r.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-text-track-display"},{"aria-live":"off","aria-atomic":"true"})},r.clearDisplay=function(){"function"==typeof e.WebVTT&&e.WebVTT.processCues(e,[],this.el_)},r.updateDisplay=function(){var e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){for(var n=[],r=0;r<e.length;++r){var i=e[r];"showing"===i.mode&&n.push(i)}this.updateForTrack(n)}else{for(var a=null,s=null,o=e.length;o--;){var u=e[o];"showing"===u.mode&&("descriptions"===u.kind?a=u:s=u)}s?("off"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","off"),this.updateForTrack(s)):a&&("assertive"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","assertive"),this.updateForTrack(a))}},r.updateDisplayState=function(t){for(var n=this.player_.textTrackSettings.getValues(),r=t.activeCues,i=r.length;i--;){var a=r[i];if(a){var s=a.displayState;if(n.color&&(s.firstChild.style.color=n.color),n.textOpacity&&Oe(s.firstChild,"color",Ie(n.color||"#fff",n.textOpacity)),n.backgroundColor&&(s.firstChild.style.backgroundColor=n.backgroundColor),n.backgroundOpacity&&Oe(s.firstChild,"backgroundColor",Ie(n.backgroundColor||"#000",n.backgroundOpacity)),n.windowColor&&(n.windowOpacity?Oe(s,"backgroundColor",Ie(n.windowColor,n.windowOpacity)):s.style.backgroundColor=n.windowColor),n.edgeStyle&&("dropshadow"===n.edgeStyle?s.firstChild.style.textShadow="2px 2px 3px #222, 2px 2px 4px #222, 2px 2px 5px #222":"raised"===n.edgeStyle?s.firstChild.style.textShadow="1px 1px #222, 2px 2px #222, 3px 3px #222":"depressed"===n.edgeStyle?s.firstChild.style.textShadow="1px 1px #ccc, 0 1px #ccc, -1px -1px #222, 0 -1px #222":"uniform"===n.edgeStyle&&(s.firstChild.style.textShadow="0 0 4px #222, 0 0 4px #222, 0 0 4px #222, 0 0 4px #222")),n.fontPercent&&1!==n.fontPercent){var o=e.parseFloat(s.style.fontSize);s.style.fontSize=o*n.fontPercent+"px",s.style.height="auto",s.style.top="auto",s.style.bottom="2px"}n.fontFamily&&"default"!==n.fontFamily&&("small-caps"===n.fontFamily?s.firstChild.style.fontVariant="small-caps":s.firstChild.style.fontFamily=Ii[n.fontFamily])}}},r.updateForTrack=function(t){if(Array.isArray(t)||(t=[t]),"function"==typeof e.WebVTT&&!t.every((function(e){return!e.activeCues}))){for(var n=[],r=0;r<t.length;++r)for(var i=t[r],a=0;a<i.activeCues.length;++a)n.push(i.activeCues[a]);e.WebVTT.processCues(e,n,this.el_);for(var s=0;s<t.length;++s){for(var o=t[s],u=0;u<o.activeCues.length;++u){var l=o.activeCues[u].displayState;g(l,"vjs-text-track-cue"),g(l,"vjs-text-track-cue-"+(o.language?o.language:s))}this.player_.textTrackSettings&&this.updateDisplayState(o)}}},n}(wt);wt.registerComponent("TextTrackDisplay",Oi);var Di=function(e){function t(){return e.apply(this,arguments)||this}return Y(t,e),t.prototype.createEl=function(){var t=this.player_.isAudio(),n=this.localize(t?"Audio Player":"Video Player"),r=f("span",{className:"vjs-control-text",innerHTML:this.localize("{1} is loading.",[n])}),i=e.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner",dir:"ltr"});return i.appendChild(r),i},t}(wt);wt.registerComponent("LoadingSpinner",Di);var Pi=function(e){function t(){return e.apply(this,arguments)||this}Y(t,e);var n=t.prototype;return n.createEl=function(e,t,n){void 0===t&&(t={}),void 0===n&&(n={}),t=r({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass()},t),n=r({type:"button"},n);var i=wt.prototype.createEl.call(this,"button",t,n);return this.createControlTextEl(i),i},n.addChild=function(e,t){void 0===t&&(t={});var n=this.constructor.name;return Ke.warn("Adding an actionable (user controllable) child to a Button ("+n+") is not supported; use a ClickableComponent instead."),wt.prototype.addChild.call(this,e,t)},n.enable=function(){e.prototype.enable.call(this),this.el_.removeAttribute("disabled")},n.disable=function(){e.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},n.handleKeyDown=function(t){an.isEventKey(t,"Space")||an.isEventKey(t,"Enter")?t.stopPropagation():e.prototype.handleKeyDown.call(this,t)},t}(Ri);wt.registerComponent("Button",Pi);var Mi=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).mouseused_=!1,r.on("mousedown",r.handleMouseDown),r}Y(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-big-play-button"},n.handleClick=function(e){var t=this.player_.play();if(this.mouseused_&&e.clientX&&e.clientY)return se(t),void(this.player_.tech(!0)&&this.player_.tech(!0).focus());var n=this.player_.getChild("controlBar"),r=n&&n.getChild("playToggle");if(r){var i=function(){return r.focus()};ae(t)?t.then(i,(function(){})):this.setTimeout(i,1)}else this.player_.tech(!0).focus()},n.handleKeyDown=function(t){this.mouseused_=!1,e.prototype.handleKeyDown.call(this,t)},n.handleMouseDown=function(e){this.mouseused_=!0},t}(Pi);Mi.prototype.controlText_="Play Video",wt.registerComponent("BigPlayButton",Mi);var ji=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).controlText(n&&n.controlText||r.localize("Close")),r}Y(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-close-button "+e.prototype.buildCSSClass.call(this)},n.handleClick=function(e){this.trigger({type:"close",bubbles:!1})},n.handleKeyDown=function(t){an.isEventKey(t,"Esc")?(t.preventDefault(),t.stopPropagation(),this.trigger("click")):e.prototype.handleKeyDown.call(this,t)},t}(Pi);wt.registerComponent("CloseButton",ji);var Ui=function(e){function t(t,n){var r;return void 0===n&&(n={}),r=e.call(this,t,n)||this,n.replay=void 0===n.replay||n.replay,r.on(t,"play",r.handlePlay),r.on(t,"pause",r.handlePause),n.replay&&r.on(t,"ended",r.handleEnded),r}Y(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-play-control "+e.prototype.buildCSSClass.call(this)},n.handleClick=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},n.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)},n.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},n.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},n.handleEnded=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",this.handleSeeked)},t}(Pi);Ui.prototype.controlText_="Play",wt.registerComponent("PlayToggle",Ui);var Bi=function(e,t){e=e<0?0:e;var n=Math.floor(e%60),r=Math.floor(e/60%60),i=Math.floor(e/3600),a=Math.floor(t/60%60),s=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(i=r=n="-"),(i=i>0||s>0?i+":":"")+(r=((i||a>=10)&&r<10?"0"+r:r)+":")+(n=n<10?"0"+n:n)},Fi=Bi,Ni=function(e){function n(t,n){var r;return(r=e.call(this,t,n)||this).throttledUpdateContent=ht(dt(Z(r),r.updateContent),ct),r.on(t,"timeupdate",r.throttledUpdateContent),r}Y(n,e);var r=n.prototype;return r.createEl=function(){var t=this.buildCSSClass(),n=e.prototype.createEl.call(this,"div",{className:t+" vjs-time-control vjs-control",innerHTML:'<span class="vjs-control-text" role="presentation">'+this.localize(this.labelText_)+" </span>"});return this.contentEl_=f("span",{className:t+"-display"},{"aria-live":"off",role:"presentation"}),this.updateTextNode_(),n.appendChild(this.contentEl_),n},r.dispose=function(){this.contentEl_=null,this.textNode_=null,e.prototype.dispose.call(this)},r.updateTextNode_=function(){if(this.contentEl_){for(;this.contentEl_.firstChild;)this.contentEl_.removeChild(this.contentEl_.firstChild);this.textNode_=t.createTextNode(this.formattedTime_||this.formatTime_(0)),this.contentEl_.appendChild(this.textNode_)}},r.formatTime_=function(e){return De(e)},r.updateFormattedTime_=function(e){var t=this.formatTime_(e);t!==this.formattedTime_&&(this.formattedTime_=t,this.requestAnimationFrame(this.updateTextNode_))},r.updateContent=function(e){},n}(wt);Ni.prototype.labelText_="Time",Ni.prototype.controlText_="Time",wt.registerComponent("TimeDisplay",Ni);var Gi=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).on(t,"ended",r.handleEnded),r}Y(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-current-time"},n.updateContent=function(e){var t=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();this.updateFormattedTime_(t)},n.handleEnded=function(e){this.player_.duration()&&this.updateFormattedTime_(this.player_.duration())},t}(Ni);Gi.prototype.labelText_="Current Time",Gi.prototype.controlText_="Current Time",wt.registerComponent("CurrentTimeDisplay",Gi);var Vi=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).on(t,"durationchange",r.updateContent),r.on(t,"loadstart",r.updateContent),r.on(t,"loadedmetadata",r.throttledUpdateContent),r}Y(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-duration"},n.updateContent=function(e){var t=this.player_.duration();this.duration_!==t&&(this.duration_=t,this.updateFormattedTime_(t))},t}(Ni);Vi.prototype.labelText_="Duration",Vi.prototype.controlText_="Duration",wt.registerComponent("DurationDisplay",Vi);var Hi=function(e){function t(){return e.apply(this,arguments)||this}return Y(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider",innerHTML:"<div><span>/</span></div>"},{"aria-hidden":!0})},t}(wt);wt.registerComponent("TimeDivider",Hi);var zi=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).on(t,"durationchange",r.throttledUpdateContent),r.on(t,"ended",r.handleEnded),r}Y(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-remaining-time"},n.createEl=function(){var t=e.prototype.createEl.call(this);return t.insertBefore(f("span",{},{"aria-hidden":!0},"-"),this.contentEl_),t},n.updateContent=function(e){"number"==typeof this.player_.duration()&&(this.player_.remainingTimeDisplay?this.updateFormattedTime_(this.player_.remainingTimeDisplay()):this.updateFormattedTime_(this.player_.remainingTime()))},n.handleEnded=function(e){this.player_.duration()&&this.updateFormattedTime_(0)},t}(Ni);zi.prototype.labelText_="Remaining Time",zi.prototype.controlText_="Remaining Time",wt.registerComponent("RemainingTimeDisplay",zi);var Wi=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).updateShowing(),r.on(r.player(),"durationchange",r.updateShowing),r}Y(t,e);var n=t.prototype;return n.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=f("div",{className:"vjs-live-display",innerHTML:'<span class="vjs-control-text">'+this.localize("Stream Type")+" </span>"+this.localize("LIVE")},{"aria-live":"off"}),t.appendChild(this.contentEl_),t},n.dispose=function(){this.contentEl_=null,e.prototype.dispose.call(this)},n.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide()},t}(wt);wt.registerComponent("LiveDisplay",Wi);var Ki=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).updateLiveEdgeStatus(),r.player_.liveTracker&&r.on(r.player_.liveTracker,"liveedgechange",r.updateLiveEdgeStatus),r}Y(t,e);var n=t.prototype;return n.createEl=function(){var t=e.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=f("span",{className:"vjs-seek-to-live-text",innerHTML:this.localize("LIVE")},{"aria-hidden":"true"}),t.appendChild(this.textEl_),t},n.updateLiveEdgeStatus=function(e){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))},n.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},n.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatus),this.textEl_=null,e.prototype.dispose.call(this)},t}(Pi);Ki.prototype.controlText_="Seek to live, currently playing live",wt.registerComponent("SeekToLive",Ki);var qi=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).bar=r.getChild(r.options_.barName),r.vertical(!!r.options_.vertical),r.enable(),r}Y(t,e);var n=t.prototype;return n.enabled=function(){return this.enabled_},n.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown),this.on("touchstart",this.handleMouseDown),this.on("keydown",this.handleKeyDown),this.on("click",this.handleClick),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)},n.disable=function(){if(this.enabled()){var e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown),this.off("touchstart",this.handleMouseDown),this.off("keydown",this.handleKeyDown),this.off("click",this.handleClick),this.off(this.player_,"controlsvisible",this.update),this.off(e,"mousemove",this.handleMouseMove),this.off(e,"mouseup",this.handleMouseUp),this.off(e,"touchmove",this.handleMouseMove),this.off(e,"touchend",this.handleMouseUp),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}},n.createEl=function(t,n,i){return void 0===n&&(n={}),void 0===i&&(i={}),n.className=n.className+" vjs-slider",n=r({tabIndex:0},n),i=r({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},i),e.prototype.createEl.call(this,t,n,i)},n.handleMouseDown=function(e){var t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||Nt||e.preventDefault(),w(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove),this.on(t,"mouseup",this.handleMouseUp),this.on(t,"touchmove",this.handleMouseMove),this.on(t,"touchend",this.handleMouseUp),this.handleMouseMove(e)},n.handleMouseMove=function(e){},n.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;C(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(e,"mousemove",this.handleMouseMove),this.off(e,"mouseup",this.handleMouseUp),this.off(e,"touchmove",this.handleMouseMove),this.off(e,"touchend",this.handleMouseUp),this.update()},n.update=function(){if(this.el_){var e=this.getPercent(),t=this.bar;if(t){("number"!=typeof e||e!=e||e<0||e===1/0)&&(e=0);var n=(100*e).toFixed(2)+"%",r=t.el().style,i=this.vertical()?"height":"width";return r[i]!==n&&(r[i]=n),e}}},n.calculateDistance=function(e){var t=R(this.el_,e);return this.vertical()?t.y:t.x},n.handleKeyDown=function(t){an.isEventKey(t,"Left")||an.isEventKey(t,"Down")?(t.preventDefault(),t.stopPropagation(),this.stepBack()):an.isEventKey(t,"Right")||an.isEventKey(t,"Up")?(t.preventDefault(),t.stopPropagation(),this.stepForward()):e.prototype.handleKeyDown.call(this,t)},n.handleClick=function(e){e.stopPropagation(),e.preventDefault()},n.vertical=function(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},t}(wt);wt.registerComponent("Slider",qi);var $i=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).partEls_=[],r.on(t,"progress",r.update),r}Y(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-load-progress",innerHTML:'<span class="vjs-control-text"><span>'+this.localize("Loaded")+'</span>: <span class="vjs-control-text-loaded-percentage">0%</span></span>'})},n.dispose=function(){this.partEls_=null,e.prototype.dispose.call(this)},n.update=function(e){var t=this.player_.liveTracker,n=this.player_.buffered(),r=t&&t.isLive()?t.seekableEnd():this.player_.duration(),i=this.player_.bufferedEnd(),a=this.partEls_,s=this.$(".vjs-control-text-loaded-percentage"),o=function(e,t,n){var r=e/t||0;return r=100*(r>=1?1:r),n&&(r=r.toFixed(2)),r+"%"};this.el_.style.width=o(i,r),p(s,o(i,r,!0));for(var u=0;u<n.length;u++){var l=n.start(u),c=n.end(u),d=a[u];d||(d=this.el_.appendChild(f()),a[u]=d),d.style.left=o(l,i),d.style.width=o(c-l,i)}for(var h=a.length;h>n.length;h--)this.el_.removeChild(a[h-1]);a.length=n.length},t}(wt);wt.registerComponent("LoadProgressBar",$i);var Yi=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).update=ht(dt(Z(r),r.update),ct),r}Y(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},n.update=function(e,t,n){var r=A(this.el_),i=A(this.player_.el()),a=e.width*t;if(i&&r){var s=e.left-i.left+a,o=e.width-a+(i.right-e.right),u=r.width/2;s<u?u+=u-s:o<u&&(u=o),u<0?u=0:u>r.width&&(u=r.width),this.el_.style.right="-"+u+"px",this.write(n)}},n.write=function(e){p(this.el_,e)},n.updateTime=function(e,t,n,r){var i=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame((function(){var a,s=i.player_.duration();if(i.player_.liveTracker&&i.player_.liveTracker.isLive()){var o=i.player_.liveTracker.liveWindow(),u=o-t*o;a=(u<1?"":"-")+De(u,o)}else a=De(n,s);i.update(e,t,a),r&&r()}))},t}(wt);wt.registerComponent("TimeTooltip",Yi);var Xi=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).update=ht(dt(Z(r),r.update),ct),r}Y(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},n.update=function(e,t){var n=this.getChild("timeTooltip");if(n){var r=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();n.updateTime(e,t,r)}},t}(wt);Xi.prototype.options_={children:[]},Dt||Mt||Xi.prototype.options_.children.push("timeTooltip"),wt.registerComponent("PlayProgressBar",Xi);var Ji=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).update=ht(dt(Z(r),r.update),ct),r}Y(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},n.update=function(e,t){var n=this,r=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,r,(function(){n.el_.style.left=e.width*t+"px"}))},t}(wt);Ji.prototype.options_={children:["timeTooltip"]},wt.registerComponent("MouseTimeDisplay",Ji);var Qi=function(e){function n(t,n){var r;return(r=e.call(this,t,n)||this).setEventHandlers_(),r}Y(n,e);var r=n.prototype;return r.setEventHandlers_=function(){this.update=ht(dt(this,this.update),30),this.on(this.player_,"timeupdate",this.update),this.on(this.player_,"ended",this.handleEnded),this.on(this.player_,"durationchange",this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.on(this.player_,["playing"],this.enableInterval_),this.on(this.player_,["ended","pause","waiting"],this.disableInterval_),"hidden"in t&&"visibilityState"in t&&this.on(t,"visibilitychange",this.toggleVisibility_)},r.toggleVisibility_=function(e){t.hidden?this.disableInterval_(e):(this.enableInterval_(),this.requestAnimationFrame(this.update))},r.enableInterval_=function(){var e=this;this.clearInterval(this.updateInterval),this.updateInterval=this.setInterval((function(){e.requestAnimationFrame(e.update)}),30)},r.disableInterval_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&"ended"!==e.type||this.clearInterval(this.updateInterval)},r.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},r.update_=function(e,t){var n=this.player_.liveTracker,r=this.player_.duration();n&&n.isLive()&&(r=this.player_.liveTracker.liveCurrentTime()),this.el_.setAttribute("aria-valuenow",(100*t).toFixed(2)),this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[De(e,r),De(r,r)],"{1} of {2}")),this.bar&&this.bar.update(A(this.el_),t)},r.update=function(t){if(null!==this.el().offsetParent){var n=e.prototype.update.call(this);return this.update_(this.getCurrentTime_(),n),n}},r.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},r.handleEnded=function(e){this.update_(this.player_.duration(),1)},r.getPercent=function(){var e,t=this.getCurrentTime_(),n=this.player_.liveTracker;return n&&n.isLive()?(e=(t-n.seekableStart())/n.liveWindow(),n.atLiveEdge()&&(e=1)):e=t/this.player_.duration(),e>=1?1:e||0},r.handleMouseDown=function(t){M(t)&&(t.stopPropagation(),this.player_.scrubbing(!0),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),e.prototype.handleMouseDown.call(this,t))},r.handleMouseMove=function(e){if(M(e)){var t,n=this.calculateDistance(e),r=this.player_.liveTracker;if(r&&r.isLive()){var i=r.seekableStart(),a=r.liveCurrentTime();if((t=i+n*r.liveWindow())>=a&&(t=a),t<=i&&(t=i+.1),t===1/0)return}else(t=n*this.player_.duration())===this.player_.duration()&&(t-=.1);this.player_.currentTime(t)}},r.enable=function(){e.prototype.enable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.show()},r.disable=function(){e.prototype.disable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.hide()},r.handleMouseUp=function(t){e.prototype.handleMouseUp.call(this,t),t&&t.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying&&se(this.player_.play())},r.stepForward=function(){this.player_.currentTime(this.player_.currentTime()+5)},r.stepBack=function(){this.player_.currentTime(this.player_.currentTime()-5)},r.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},r.handleKeyDown=function(t){if(an.isEventKey(t,"Space")||an.isEventKey(t,"Enter"))t.preventDefault(),t.stopPropagation(),this.handleAction(t);else if(an.isEventKey(t,"Home"))t.preventDefault(),t.stopPropagation(),this.player_.currentTime(0);else if(an.isEventKey(t,"End"))t.preventDefault(),t.stopPropagation(),this.player_.currentTime(this.player_.duration());else if(/^[0-9]$/.test(an(t))){t.preventDefault(),t.stopPropagation();var n=10*(an.codes[an(t)]-an.codes[0])/100;this.player_.currentTime(this.player_.duration()*n)}else an.isEventKey(t,"PgDn")?(t.preventDefault(),t.stopPropagation(),this.player_.currentTime(this.player_.currentTime()-60)):an.isEventKey(t,"PgUp")?(t.preventDefault(),t.stopPropagation(),this.player_.currentTime(this.player_.currentTime()+60)):e.prototype.handleKeyDown.call(this,t)},n}(qi);Qi.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},Dt||Mt||Qi.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),wt.registerComponent("SeekBar",Qi);var Zi=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).handleMouseMove=ht(dt(Z(r),r.handleMouseMove),ct),r.throttledHandleMouseSeek=ht(dt(Z(r),r.handleMouseSeek),ct),r.enable(),r}Y(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},n.handleMouseMove=function(e){var t=this.getChild("seekBar");if(t){var n=t.getChild("mouseTimeDisplay"),r=t.el(),i=A(r),a=R(r,e).x;a>1?a=1:a<0&&(a=0),n&&n.update(i,a)}},n.handleMouseSeek=function(e){var t=this.getChild("seekBar");t&&t.handleMouseMove(e)},n.enabled=function(){return this.enabled_},n.disable=function(){this.children().forEach((function(e){return e.disable&&e.disable()})),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDown),this.off(this.el_,"mousemove",this.handleMouseMove),this.handleMouseUp(),this.addClass("disabled"),this.enabled_=!1)},n.enable=function(){this.children().forEach((function(e){return e.enable&&e.enable()})),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDown),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},n.handleMouseDown=function(e){var t=this.el_.ownerDocument,n=this.getChild("seekBar");n&&n.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUp),this.on(t,"touchend",this.handleMouseUp)},n.handleMouseUp=function(e){var t=this.el_.ownerDocument,n=this.getChild("seekBar");n&&n.handleMouseUp(e),this.off(t,"mousemove",this.throttledHandleMouseSeek),this.off(t,"touchmove",this.throttledHandleMouseSeek),this.off(t,"mouseup",this.handleMouseUp),this.off(t,"touchend",this.handleMouseUp)},t}(wt);Zi.prototype.options_={children:["seekBar"]},wt.registerComponent("ProgressControl",Zi);var ea=function(e){function n(n,r){var i;return(i=e.call(this,n,r)||this).on(n,["enterpictureinpicture","leavepictureinpicture"],i.handlePictureInPictureChange),t.pictureInPictureEnabled||i.disable(),i}Y(n,e);var r=n.prototype;return r.buildCSSClass=function(){return"vjs-picture-in-picture-control "+e.prototype.buildCSSClass.call(this)},r.handlePictureInPictureChange=function(e){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture")},r.handleClick=function(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()},n}(Pi);ea.prototype.controlText_="Picture-in-Picture",wt.registerComponent("PictureInPictureToggle",ea);var ta=function(e){function n(n,r){var i;return(i=e.call(this,n,r)||this).on(n,"fullscreenchange",i.handleFullscreenChange),!1===t[n.fsApi_.fullscreenEnabled]&&i.disable(),i}Y(n,e);var r=n.prototype;return r.buildCSSClass=function(){return"vjs-fullscreen-control "+e.prototype.buildCSSClass.call(this)},r.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},r.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},n}(Pi);ta.prototype.controlText_="Fullscreen",wt.registerComponent("FullscreenToggle",ta);var na=function(e){function t(){return e.apply(this,arguments)||this}return Y(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-level",innerHTML:'<span class="vjs-control-text"></span>'})},t}(wt);wt.registerComponent("VolumeLevel",na);var ra=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).on("slideractive",r.updateLastVolume_),r.on(t,"volumechange",r.updateARIAAttributes),t.ready((function(){return r.updateARIAAttributes()})),r}Y(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},n.handleMouseDown=function(t){M(t)&&e.prototype.handleMouseDown.call(this,t)},n.handleMouseMove=function(e){M(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))},n.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},n.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},n.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},n.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},n.updateARIAAttributes=function(e){var t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")},n.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},n.updateLastVolume_=function(){var e=this,t=this.player_.volume();this.one("sliderinactive",(function(){0===e.player_.volume()&&e.player_.lastVolume_(t)}))},t}(qi);ra.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},ra.prototype.playerEvent="volumechange",wt.registerComponent("VolumeBar",ra);var ia=function(e){function t(t,n){var r;return void 0===n&&(n={}),n.vertical=n.vertical||!1,(void 0===n.volumeBar||a(n.volumeBar))&&(n.volumeBar=n.volumeBar||{},n.volumeBar.vertical=n.vertical),function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))}(Z(r=e.call(this,t,n)||this),t),r.throttledHandleMouseMove=ht(dt(Z(r),r.handleMouseMove),ct),r.on("mousedown",r.handleMouseDown),r.on("touchstart",r.handleMouseDown),r.on(r.volumeBar,["focus","slideractive"],(function(){r.volumeBar.addClass("vjs-slider-active"),r.addClass("vjs-slider-active"),r.trigger("slideractive")})),r.on(r.volumeBar,["blur","sliderinactive"],(function(){r.volumeBar.removeClass("vjs-slider-active"),r.removeClass("vjs-slider-active"),r.trigger("sliderinactive")})),r}Y(t,e);var n=t.prototype;return n.createEl=function(){var t="vjs-volume-horizontal";return this.options_.vertical&&(t="vjs-volume-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+t})},n.handleMouseDown=function(e){var t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUp),this.on(t,"touchend",this.handleMouseUp)},n.handleMouseUp=function(e){var t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUp),this.off(t,"touchend",this.handleMouseUp)},n.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)},t}(wt);ia.prototype.options_={children:["volumeBar"]},wt.registerComponent("VolumeControl",ia);var aa=function(e){function t(t,n){var r;return function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))}(Z(r=e.call(this,t,n)||this),t),r.on(t,["loadstart","volumechange"],r.update),r}Y(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-mute-control "+e.prototype.buildCSSClass.call(this)},n.handleClick=function(e){var t=this.player_.volume(),n=this.player_.lastVolume_();if(0===t){var r=n<.1?.1:n;this.player_.volume(r),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},n.update=function(e){this.updateIcon_(),this.updateControlText_()},n.updateIcon_=function(){var e=this.player_.volume(),t=3;Dt&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?t=0:e<.33?t=1:e<.67&&(t=2);for(var n=0;n<4;n++)y(this.el_,"vjs-vol-"+n);g(this.el_,"vjs-vol-"+t)},n.updateControlText_=function(){var e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)},t}(Pi);aa.prototype.controlText_="Mute",wt.registerComponent("MuteToggle",aa);var sa=function(e){function n(t,n){var r;return void 0===n&&(n={}),void 0!==n.inline?n.inline=n.inline:n.inline=!0,(void 0===n.volumeControl||a(n.volumeControl))&&(n.volumeControl=n.volumeControl||{},n.volumeControl.vertical=!n.inline),(r=e.call(this,t,n)||this).on(t,["loadstart"],r.volumePanelState_),r.on(r.muteToggle,"keyup",r.handleKeyPress),r.on(r.volumeControl,"keyup",r.handleVolumeControlKeyUp),r.on("keydown",r.handleKeyPress),r.on("mouseover",r.handleMouseOver),r.on("mouseout",r.handleMouseOut),r.on(r.volumeControl,["slideractive"],r.sliderActive_),r.on(r.volumeControl,["sliderinactive"],r.sliderInactive_),r}Y(n,e);var r=n.prototype;return r.sliderActive_=function(){this.addClass("vjs-slider-active")},r.sliderInactive_=function(){this.removeClass("vjs-slider-active")},r.volumePanelState_=function(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")},r.createEl=function(){var t="vjs-volume-panel-horizontal";return this.options_.inline||(t="vjs-volume-panel-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+t})},r.dispose=function(){this.handleMouseOut(),e.prototype.dispose.call(this)},r.handleVolumeControlKeyUp=function(e){an.isEventKey(e,"Esc")&&this.muteToggle.focus()},r.handleMouseOver=function(e){this.addClass("vjs-hover"),N(t,"keyup",dt(this,this.handleKeyPress))},r.handleMouseOut=function(e){this.removeClass("vjs-hover"),G(t,"keyup",dt(this,this.handleKeyPress))},r.handleKeyPress=function(e){an.isEventKey(e,"Esc")&&this.handleMouseOut()},n}(wt);sa.prototype.options_={children:["muteToggle","volumeControl"]},wt.registerComponent("VolumePanel",sa);var oa=function(e){function n(t,n){var r;return r=e.call(this,t,n)||this,n&&(r.menuButton_=n.menuButton),r.focusedChild_=-1,r.on("keydown",r.handleKeyDown),r.boundHandleBlur_=dt(Z(r),r.handleBlur),r.boundHandleTapClick_=dt(Z(r),r.handleTapClick),r}Y(n,e);var r=n.prototype;return r.addEventListenerForItem=function(e){e instanceof wt&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))},r.removeEventListenerForItem=function(e){e instanceof wt&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))},r.removeChild=function(t){"string"==typeof t&&(t=this.getChild(t)),this.removeEventListenerForItem(t),e.prototype.removeChild.call(this,t)},r.addItem=function(e){var t=this.addChild(e);t&&this.addEventListenerForItem(t)},r.createEl=function(){var t=this.options_.contentElType||"ul";this.contentEl_=f(t,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var n=e.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return n.appendChild(this.contentEl_),N(n,"click",(function(e){e.preventDefault(),e.stopImmediatePropagation()})),n},r.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,e.prototype.dispose.call(this)},r.handleBlur=function(e){var n=e.relatedTarget||t.activeElement;if(!this.children().some((function(e){return e.el()===n}))){var r=this.menuButton_;r&&r.buttonPressed_&&n!==r.el().firstChild&&r.unpressButton()}},r.handleTapClick=function(e){if(this.menuButton_){this.menuButton_.unpressButton();var t=this.children();if(!Array.isArray(t))return;var n=t.filter((function(t){return t.el()===e.target}))[0];if(!n)return;"CaptionSettingsMenuItem"!==n.name()&&this.menuButton_.focus()}},r.handleKeyDown=function(e){an.isEventKey(e,"Left")||an.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(an.isEventKey(e,"Right")||an.isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack())},r.stepForward=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)},r.stepBack=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)},r.focus=function(e){void 0===e&&(e=0);var t=this.children().slice();t.length&&t[0].className&&/vjs-menu-title/.test(t[0].className)&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())},n}(wt);wt.registerComponent("Menu",oa);var ua=function(e){function n(n,r){var i;void 0===r&&(r={}),(i=e.call(this,n,r)||this).menuButton_=new Pi(n,r),i.menuButton_.controlText(i.controlText_),i.menuButton_.el_.setAttribute("aria-haspopup","true");var a=Pi.prototype.buildCSSClass();return i.menuButton_.el_.className=i.buildCSSClass()+" "+a,i.menuButton_.removeClass("vjs-control"),i.addChild(i.menuButton_),i.update(),i.enabled_=!0,i.on(i.menuButton_,"tap",i.handleClick),i.on(i.menuButton_,"click",i.handleClick),i.on(i.menuButton_,"keydown",i.handleKeyDown),i.on(i.menuButton_,"mouseenter",(function(){i.addClass("vjs-hover"),i.menu.show(),N(t,"keyup",dt(Z(i),i.handleMenuKeyUp))})),i.on("mouseleave",i.handleMouseLeave),i.on("keydown",i.handleSubmenuKeyDown),i}Y(n,e);var r=n.prototype;return r.update=function(){var e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?this.hide():this.show()},r.createMenu=function(){var e=new oa(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var t=f("li",{className:"vjs-menu-title",innerHTML:kt(this.options_.title),tabIndex:-1});this.hideThreshold_+=1;var n=new wt(this.player_,{el:t});e.addItem(n)}if(this.items=this.createItems(),this.items)for(var r=0;r<this.items.length;r++)e.addItem(this.items[r]);return e},r.createItems=function(){},r.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildWrapperCSSClass()},{})},r.buildWrapperCSSClass=function(){var t="vjs-menu-button";return!0===this.options_.inline?t+="-inline":t+="-popup","vjs-menu-button "+t+" "+Pi.prototype.buildCSSClass()+" "+e.prototype.buildCSSClass.call(this)},r.buildCSSClass=function(){var t="vjs-menu-button";return!0===this.options_.inline?t+="-inline":t+="-popup","vjs-menu-button "+t+" "+e.prototype.buildCSSClass.call(this)},r.controlText=function(e,t){return void 0===t&&(t=this.menuButton_.el()),this.menuButton_.controlText(e,t)},r.dispose=function(){this.handleMouseLeave(),e.prototype.dispose.call(this)},r.handleClick=function(e){this.buttonPressed_?this.unpressButton():this.pressButton()},r.handleMouseLeave=function(e){this.removeClass("vjs-hover"),G(t,"keyup",dt(this,this.handleMenuKeyUp))},r.focus=function(){this.menuButton_.focus()},r.blur=function(){this.menuButton_.blur()},r.handleKeyDown=function(e){an.isEventKey(e,"Esc")||an.isEventKey(e,"Tab")?(this.buttonPressed_&&this.unpressButton(),an.isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus())):(an.isEventKey(e,"Up")||an.isEventKey(e,"Down"))&&(this.buttonPressed_||(e.preventDefault(),this.pressButton()))},r.handleMenuKeyUp=function(e){(an.isEventKey(e,"Esc")||an.isEventKey(e,"Tab"))&&this.removeClass("vjs-hover")},r.handleSubmenuKeyPress=function(e){this.handleSubmenuKeyDown(e)},r.handleSubmenuKeyDown=function(e){(an.isEventKey(e,"Esc")||an.isEventKey(e,"Tab"))&&(this.buttonPressed_&&this.unpressButton(),an.isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus()))},r.pressButton=function(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),Dt&&d())return;this.menu.focus()}},r.unpressButton=function(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))},r.disable=function(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()},r.enable=function(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()},n}(wt);wt.registerComponent("MenuButton",ua);var la=function(e){function t(t,n){var r,i=n.tracks;if((r=e.call(this,t,n)||this).items.length<=1&&r.hide(),!i)return Z(r);var a=dt(Z(r),r.update);return i.addEventListener("removetrack",a),i.addEventListener("addtrack",a),r.player_.on("ready",a),r.player_.on("dispose",(function(){i.removeEventListener("removetrack",a),i.removeEventListener("addtrack",a)})),r}return Y(t,e),t}(ua);wt.registerComponent("TrackButton",la);var ca=["Tab","Esc","Up","Down","Right","Left"],da=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).selectable=n.selectable,r.isSelected_=n.selected||!1,r.multiSelectable=n.multiSelectable,r.selected(r.isSelected_),r.selectable?r.multiSelectable?r.el_.setAttribute("role","menuitemcheckbox"):r.el_.setAttribute("role","menuitemradio"):r.el_.setAttribute("role","menuitem"),r}Y(t,e);var n=t.prototype;return n.createEl=function(t,n,i){return this.nonIconControl=!0,e.prototype.createEl.call(this,"li",r({className:"vjs-menu-item",innerHTML:'<span class="vjs-menu-item-text">'+this.localize(this.options_.label)+"</span>",tabIndex:-1},n),i)},n.handleKeyDown=function(t){ca.some((function(e){return an.isEventKey(t,e)}))||e.prototype.handleKeyDown.call(this,t)},n.handleClick=function(e){this.selected(!0)},n.selected=function(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))},t}(Ri);wt.registerComponent("MenuItem",da);var ha=function(n){function r(r,i){var a,s=i.track,o=r.textTracks();i.label=s.label||s.language||"Unknown",i.selected="showing"===s.mode,(a=n.call(this,r,i)||this).track=s,a.kinds=(i.kinds||[i.kind||a.track.kind]).filter(Boolean);var u,l=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];a.handleTracksChange.apply(Z(a),t)},c=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];a.handleSelectedLanguageChange.apply(Z(a),t)};(r.on(["loadstart","texttrackchange"],l),o.addEventListener("change",l),o.addEventListener("selectedlanguagechange",c),a.on("dispose",(function(){r.off(["loadstart","texttrackchange"],l),o.removeEventListener("change",l),o.removeEventListener("selectedlanguagechange",c)})),void 0===o.onchange)&&a.on(["tap","click"],(function(){if("object"!=typeof e.Event)try{u=new e.Event("change")}catch(e){}u||(u=t.createEvent("Event")).initEvent("change",!0,!0),o.dispatchEvent(u)}));return a.handleTracksChange(),a}Y(r,n);var i=r.prototype;return i.handleClick=function(e){var t=this.track,r=this.player_.textTracks();if(n.prototype.handleClick.call(this,e),r)for(var i=0;i<r.length;i++){var a=r[i];-1!==this.kinds.indexOf(a.kind)&&(a===t?"showing"!==a.mode&&(a.mode="showing"):"disabled"!==a.mode&&(a.mode="disabled"))}},i.handleTracksChange=function(e){var t="showing"===this.track.mode;t!==this.isSelected_&&this.selected(t)},i.handleSelectedLanguageChange=function(e){if("showing"===this.track.mode){var t=this.player_.cache_.selectedLanguage;if(t&&t.enabled&&t.language===this.track.language&&t.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}},i.dispose=function(){this.track=null,n.prototype.dispose.call(this)},r}(da);wt.registerComponent("TextTrackMenuItem",ha);var fa=function(e){function t(t,n){return n.track={player:t,kind:n.kind,kinds:n.kinds,default:!1,mode:"disabled"},n.kinds||(n.kinds=[n.kind]),n.label?n.track.label=n.label:n.track.label=n.kinds.join(" and ")+" off",n.selectable=!0,n.multiSelectable=!1,e.call(this,t,n)||this}Y(t,e);var n=t.prototype;return n.handleTracksChange=function(e){for(var t=this.player().textTracks(),n=!0,r=0,i=t.length;r<i;r++){var a=t[r];if(this.options_.kinds.indexOf(a.kind)>-1&&"showing"===a.mode){n=!1;break}}n!==this.isSelected_&&this.selected(n)},n.handleSelectedLanguageChange=function(e){for(var t=this.player().textTracks(),n=!0,r=0,i=t.length;r<i;r++){var a=t[r];if(["captions","descriptions","subtitles"].indexOf(a.kind)>-1&&"showing"===a.mode){n=!1;break}}n&&(this.player_.cache_.selectedLanguage={enabled:!1})},t}(ha);wt.registerComponent("OffTextTrackMenuItem",fa);var pa=function(e){function t(t,n){return void 0===n&&(n={}),n.tracks=t.textTracks(),e.call(this,t,n)||this}return Y(t,e),t.prototype.createItems=function(e,t){var n;void 0===e&&(e=[]),void 0===t&&(t=ha),this.label_&&(n=this.label_+" off"),e.push(new fa(this.player_,{kinds:this.kinds_,kind:this.kind_,label:n})),this.hideThreshold_+=1;var r=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var i=0;i<r.length;i++){var a=r[i];if(this.kinds_.indexOf(a.kind)>-1){var s=new t(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});s.addClass("vjs-"+a.kind+"-menu-item"),e.push(s)}}return e},t}(la);wt.registerComponent("TextTrackButton",pa);var va=function(e){function t(t,n){var r,i=n.track,a=n.cue,s=t.currentTime();return n.selectable=!0,n.multiSelectable=!1,n.label=a.text,n.selected=a.startTime<=s&&s<a.endTime,(r=e.call(this,t,n)||this).track=i,r.cue=a,i.addEventListener("cuechange",dt(Z(r),r.update)),r}Y(t,e);var n=t.prototype;return n.handleClick=function(t){e.prototype.handleClick.call(this),this.player_.currentTime(this.cue.startTime),this.update(this.cue.startTime)},n.update=function(e){var t=this.cue,n=this.player_.currentTime();this.selected(t.startTime<=n&&n<t.endTime)},t}(da);wt.registerComponent("ChaptersTrackMenuItem",va);var ma=function(e){function t(t,n,r){return e.call(this,t,n,r)||this}Y(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-chapters-button "+e.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-chapters-button "+e.prototype.buildWrapperCSSClass.call(this)},n.update=function(t){this.track_&&(!t||"addtrack"!==t.type&&"removetrack"!==t.type)||this.setTrack(this.findChaptersTrack()),e.prototype.update.call(this)},n.setTrack=function(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){var t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.removeEventListener("load",this.updateHandler_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";var n=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);n&&n.addEventListener("load",this.updateHandler_)}}},n.findChaptersTrack=function(){for(var e=this.player_.textTracks()||[],t=e.length-1;t>=0;t--){var n=e[t];if(n.kind===this.kind_)return n}},n.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(kt(this.kind_))},n.createMenu=function(){return this.options_.title=this.getMenuCaption(),e.prototype.createMenu.call(this)},n.createItems=function(){var e=[];if(!this.track_)return e;var t=this.track_.cues;if(!t)return e;for(var n=0,r=t.length;n<r;n++){var i=t[n],a=new va(this.player_,{track:this.track_,cue:i});e.push(a)}return e},t}(pa);ma.prototype.kind_="chapters",ma.prototype.controlText_="Chapters",wt.registerComponent("ChaptersButton",ma);var ga=function(e){function t(t,n,r){var i;i=e.call(this,t,n,r)||this;var a=t.textTracks(),s=dt(Z(i),i.handleTracksChange);return a.addEventListener("change",s),i.on("dispose",(function(){a.removeEventListener("change",s)})),i}Y(t,e);var n=t.prototype;return n.handleTracksChange=function(e){for(var t=this.player().textTracks(),n=!1,r=0,i=t.length;r<i;r++){var a=t[r];if(a.kind!==this.kind_&&"showing"===a.mode){n=!0;break}}n?this.disable():this.enable()},n.buildCSSClass=function(){return"vjs-descriptions-button "+e.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-descriptions-button "+e.prototype.buildWrapperCSSClass.call(this)},t}(pa);ga.prototype.kind_="descriptions",ga.prototype.controlText_="Descriptions",wt.registerComponent("DescriptionsButton",ga);var ya=function(e){function t(t,n,r){return e.call(this,t,n,r)||this}Y(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-subtitles-button "+e.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-subtitles-button "+e.prototype.buildWrapperCSSClass.call(this)},t}(pa);ya.prototype.kind_="subtitles",ya.prototype.controlText_="Subtitles",wt.registerComponent("SubtitlesButton",ya);var _a=function(e){function t(t,n){var r;return n.track={player:t,kind:n.kind,label:n.kind+" settings",selectable:!1,default:!1,mode:"disabled"},n.selectable=!1,n.name="CaptionSettingsMenuItem",(r=e.call(this,t,n)||this).addClass("vjs-texttrack-settings"),r.controlText(", opens "+n.kind+" settings dialog"),r}return Y(t,e),t.prototype.handleClick=function(e){this.player().getChild("textTrackSettings").open()},t}(ha);wt.registerComponent("CaptionSettingsMenuItem",_a);var ba=function(e){function t(t,n,r){return e.call(this,t,n,r)||this}Y(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-captions-button "+e.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-captions-button "+e.prototype.buildWrapperCSSClass.call(this)},n.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new _a(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),e.prototype.createItems.call(this,t)},t}(pa);ba.prototype.kind_="captions",ba.prototype.controlText_="Captions",wt.registerComponent("CaptionsButton",ba);var Ta=function(e){function t(){return e.apply(this,arguments)||this}return Y(t,e),t.prototype.createEl=function(t,n,i){var a='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);return"captions"===this.options_.track.kind&&(a+='\n <span aria-hidden="true" class="vjs-icon-placeholder"></span>\n <span class="vjs-control-text"> '+this.localize("Captions")+"</span>\n "),a+="</span>",e.prototype.createEl.call(this,t,r({innerHTML:a},n),i)},t}(ha);wt.registerComponent("SubsCapsMenuItem",Ta);var Sa=function(e){function t(t,n){var r;return void 0===n&&(n={}),(r=e.call(this,t,n)||this).label_="subtitles",["en","en-us","en-ca","fr-ca"].indexOf(r.player_.language_)>-1&&(r.label_="captions"),r.menuButton_.controlText(kt(r.label_)),r}Y(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildWrapperCSSClass.call(this)},n.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new _a(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e.prototype.createItems.call(this,t,Ta)},t}(pa);Sa.prototype.kinds_=["captions","subtitles"],Sa.prototype.controlText_="Subtitles",wt.registerComponent("SubsCapsButton",Sa);var Ea=function(e){function t(t,n){var r,i=n.track,a=t.audioTracks();n.label=i.label||i.language||"Unknown",n.selected=i.enabled,(r=e.call(this,t,n)||this).track=i,r.addClass("vjs-"+i.kind+"-menu-item");var s=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];r.handleTracksChange.apply(Z(r),t)};return a.addEventListener("change",s),r.on("dispose",(function(){a.removeEventListener("change",s)})),r}Y(t,e);var n=t.prototype;return n.createEl=function(t,n,i){var a='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);return"main-desc"===this.options_.track.kind&&(a+='\n <span aria-hidden="true" class="vjs-icon-placeholder"></span>\n <span class="vjs-control-text"> '+this.localize("Descriptions")+"</span>\n "),a+="</span>",e.prototype.createEl.call(this,t,r({innerHTML:a},n),i)},n.handleClick=function(t){var n=this.player_.audioTracks();e.prototype.handleClick.call(this,t);for(var r=0;r<n.length;r++){var i=n[r];i.enabled=i===this.track}},n.handleTracksChange=function(e){this.selected(this.track.enabled)},t}(da);wt.registerComponent("AudioTrackMenuItem",Ea);var ka=function(e){function t(t,n){return void 0===n&&(n={}),n.tracks=t.audioTracks(),e.call(this,t,n)||this}Y(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-audio-button "+e.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-audio-button "+e.prototype.buildWrapperCSSClass.call(this)},n.createItems=function(e){void 0===e&&(e=[]),this.hideThreshold_=1;for(var t=this.player_.audioTracks(),n=0;n<t.length;n++){var r=t[n];e.push(new Ea(this.player_,{track:r,selectable:!0,multiSelectable:!1}))}return e},t}(la);ka.prototype.controlText_="Audio Track",wt.registerComponent("AudioTrackButton",ka);var wa=function(e){function t(t,n){var r,i=n.rate,a=parseFloat(i,10);return n.label=i,n.selected=1===a,n.selectable=!0,n.multiSelectable=!1,(r=e.call(this,t,n)||this).label=i,r.rate=a,r.on(t,"ratechange",r.update),r}Y(t,e);var n=t.prototype;return n.handleClick=function(t){e.prototype.handleClick.call(this),this.player().playbackRate(this.rate)},n.update=function(e){this.selected(this.player().playbackRate()===this.rate)},t}(da);wa.prototype.contentElType="button",wt.registerComponent("PlaybackRateMenuItem",wa);var Ca=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).updateVisibility(),r.updateLabel(),r.on(t,"loadstart",r.updateVisibility),r.on(t,"ratechange",r.updateLabel),r}Y(t,e);var n=t.prototype;return n.createEl=function(){var t=e.prototype.createEl.call(this);return this.labelEl_=f("div",{className:"vjs-playback-rate-value",innerHTML:"1x"}),t.appendChild(this.labelEl_),t},n.dispose=function(){this.labelEl_=null,e.prototype.dispose.call(this)},n.buildCSSClass=function(){return"vjs-playback-rate "+e.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-playback-rate "+e.prototype.buildWrapperCSSClass.call(this)},n.createMenu=function(){var e=new oa(this.player()),t=this.playbackRates();if(t)for(var n=t.length-1;n>=0;n--)e.addChild(new wa(this.player(),{rate:t[n]+"x"}));return e},n.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},n.handleClick=function(e){for(var t=this.player().playbackRate(),n=this.playbackRates(),r=n[0],i=0;i<n.length;i++)if(n[i]>t){r=n[i];break}this.player().playbackRate(r)},n.playbackRates=function(){return this.options_.playbackRates||this.options_.playerOptions&&this.options_.playerOptions.playbackRates},n.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},n.updateVisibility=function(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},n.updateLabel=function(e){this.playbackRateSupported()&&(this.labelEl_.innerHTML=this.player().playbackRate()+"x")},t}(ua);Ca.prototype.controlText_="Playback Rate",wt.registerComponent("PlaybackRateMenuButton",Ca);var Aa=function(e){function t(){return e.apply(this,arguments)||this}Y(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-spacer "+e.prototype.buildCSSClass.call(this)},n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass()})},t}(wt);wt.registerComponent("Spacer",Aa);var La=function(e){function t(){return e.apply(this,arguments)||this}Y(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-custom-control-spacer "+e.prototype.buildCSSClass.call(this)},n.createEl=function(){var t=e.prototype.createEl.call(this,{className:this.buildCSSClass()});return t.innerHTML=" ",t},t}(Aa);wt.registerComponent("CustomControlSpacer",La);var Ra=function(e){function t(){return e.apply(this,arguments)||this}return Y(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},t}(wt);Ra.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},"exitPictureInPicture"in t&&Ra.prototype.options_.children.splice(Ra.prototype.options_.children.length-1,0,"pictureInPictureToggle"),wt.registerComponent("ControlBar",Ra);var xa=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).on(t,"error",r.open),r}Y(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-error-display "+e.prototype.buildCSSClass.call(this)},n.content=function(){var e=this.player().error();return e?this.localize(e.message):""},t}(on);xa.prototype.options_=$(on.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),wt.registerComponent("ErrorDisplay",xa);var Ia=["#000","Black"],Oa=["#00F","Blue"],Da=["#0FF","Cyan"],Pa=["#0F0","Green"],Ma=["#F0F","Magenta"],ja=["#F00","Red"],Ua=["#FFF","White"],Ba=["#FF0","Yellow"],Fa=["1","Opaque"],Na=["0.5","Semi-Transparent"],Ga=["0","Transparent"],Va={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Ia,Ua,ja,Pa,Oa,Ba,Ma,Da]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[Fa,Na,Ga]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Ua,Ia,ja,Pa,Oa,Ba,Ma,Da]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:function(e){return"1.00"===e?null:Number(e)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[Fa,Na]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Transparency",options:[Ga,Na,Fa]}};Va.windowColor.options=Va.backgroundColor.options;var Ha=function(t){function r(e,r){var i;return r.temporary=!1,(i=t.call(this,e,r)||this).updateDisplay=dt(Z(i),i.updateDisplay),i.fill(),i.hasBeenOpened_=i.hasBeenFilled_=!0,i.endDialog=f("p",{className:"vjs-control-text",textContent:i.localize("End of dialog window.")}),i.el().appendChild(i.endDialog),i.setDefaults(),void 0===r.persistTextTrackSettings&&(i.options_.persistTextTrackSettings=i.options_.playerOptions.persistTextTrackSettings),i.on(i.$(".vjs-done-button"),"click",(function(){i.saveSettings(),i.close()})),i.on(i.$(".vjs-default-button"),"click",(function(){i.setDefaults(),i.updateDisplay()})),n(Va,(function(e){i.on(i.$(e.selector),"change",i.updateDisplay)})),i.options_.persistTextTrackSettings&&i.restoreSettings(),i}Y(r,t);var i=r.prototype;return i.dispose=function(){this.endDialog=null,t.prototype.dispose.call(this)},i.createElSelect_=function(e,t,n){var r=this;void 0===t&&(t=""),void 0===n&&(n="label");var i=Va[e],a=i.id.replace("%s",this.id_),s=[t,a].join(" ").trim();return["<"+n+' id="'+a+'" class="'+("label"===n?"vjs-label":"")+'">',this.localize(i.label),"</"+n+">",'<select aria-labelledby="'+s+'">'].concat(i.options.map((function(e){var t=a+"-"+e[1].replace(/\W+/g,"");return['<option id="'+t+'" value="'+e[0]+'" ','aria-labelledby="'+s+" "+t+'">',r.localize(e[1]),"</option>"].join("")}))).concat("</select>").join("")},i.createElFgColor_=function(){var e="captions-text-legend-"+this.id_;return['<fieldset class="vjs-fg-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Text"),"</legend>",this.createElSelect_("color",e),'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",e),"</span>","</fieldset>"].join("")},i.createElBgColor_=function(){var e="captions-background-"+this.id_;return['<fieldset class="vjs-bg-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Background"),"</legend>",this.createElSelect_("backgroundColor",e),'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",e),"</span>","</fieldset>"].join("")},i.createElWinColor_=function(){var e="captions-window-"+this.id_;return['<fieldset class="vjs-window-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Window"),"</legend>",this.createElSelect_("windowColor",e),'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",e),"</span>","</fieldset>"].join("")},i.createElColors_=function(){return f("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},i.createElFont_=function(){return f("div",{className:"vjs-track-settings-font",innerHTML:['<fieldset class="vjs-font-percent vjs-track-setting">',this.createElSelect_("fontPercent","","legend"),"</fieldset>",'<fieldset class="vjs-edge-style vjs-track-setting">',this.createElSelect_("edgeStyle","","legend"),"</fieldset>",'<fieldset class="vjs-font-family vjs-track-setting">',this.createElSelect_("fontFamily","","legend"),"</fieldset>"].join("")})},i.createElControls_=function(){var e=this.localize("restore all settings to the default values");return f("div",{className:"vjs-track-settings-controls",innerHTML:['<button type="button" class="vjs-default-button" title="'+e+'">',this.localize("Reset"),'<span class="vjs-control-text"> '+e+"</span>","</button>",'<button type="button" class="vjs-done-button">'+this.localize("Done")+"</button>"].join("")})},i.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},i.label=function(){return this.localize("Caption Settings Dialog")},i.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},i.buildCSSClass=function(){return t.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},i.getValues=function(){var e=this;return function(e,t,n){return void 0===n&&(n=0),Ye(e).reduce((function(n,r){return t(n,e[r],r)}),n)}(Va,(function(t,n,r){var i=function(e,t){return Pe(e.options[e.options.selectedIndex].value,t)}(e.$(n.selector),n.parser);return void 0!==i&&(t[r]=i),t}),{})},i.setValues=function(e){var t=this;n(Va,(function(n,r){!function(e,t,n){if(t)for(var r=0;r<e.options.length;r++)if(Pe(e.options[r].value,n)===t){e.selectedIndex=r;break}}(t.$(n.selector),e[r],n.parser)}))},i.setDefaults=function(){var e=this;n(Va,(function(t){var n=t.hasOwnProperty("default")?t.default:0;e.$(t.selector).selectedIndex=n}))},i.restoreSettings=function(){var t;try{t=JSON.parse(e.localStorage.getItem("vjs-text-track-settings"))}catch(e){Ke.warn(e)}t&&this.setValues(t)},i.saveSettings=function(){if(this.options_.persistTextTrackSettings){var t=this.getValues();try{Object.keys(t).length?e.localStorage.setItem("vjs-text-track-settings",JSON.stringify(t)):e.localStorage.removeItem("vjs-text-track-settings")}catch(e){Ke.warn(e)}}},i.updateDisplay=function(){var e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()},i.conditionalBlur_=function(){this.previouslyActiveEl_=null;var e=this.player_.controlBar,t=e&&e.subsCapsButton,n=e&&e.captionsButton;t?t.focus():n&&n.focus()},r}(on);wt.registerComponent("TextTrackSettings",Ha);var za=function(t){function n(n,r){var i,a=r.ResizeObserver||e.ResizeObserver;null===r.ResizeObserver&&(a=!1);var s=$({createEl:!a,reportTouchActivity:!1},r);return(i=t.call(this,n,s)||this).ResizeObserver=r.ResizeObserver||e.ResizeObserver,i.loadListener_=null,i.resizeObserver_=null,i.debouncedHandler_=function(t,n,r,i){void 0===i&&(i=e);var a,s=function(){var e=this,s=arguments,o=function(){a=null,o=null,r||t.apply(e,s)};!a&&r&&t.apply(e,s),i.clearTimeout(a),a=i.setTimeout(o,n)};return s.cancel=function(){i.clearTimeout(a),a=null},s}((function(){i.resizeHandler()}),100,!1,Z(i)),a?(i.resizeObserver_=new i.ResizeObserver(i.debouncedHandler_),i.resizeObserver_.observe(n.el())):(i.loadListener_=function(){if(i.el_&&i.el_.contentWindow){var e=i.debouncedHandler_,t=i.unloadListener_=function(){G(this,"resize",e),G(this,"unload",t),t=null};N(i.el_.contentWindow,"unload",t),N(i.el_.contentWindow,"resize",e)}},i.one("load",i.loadListener_)),i}Y(n,t);var r=n.prototype;return r.createEl=function(){return t.prototype.createEl.call(this,"iframe",{className:"vjs-resize-manager",tabIndex:-1},{"aria-hidden":"true"})},r.resizeHandler=function(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")},r.dispose=function(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,t.prototype.dispose.call(this)},n}(wt);wt.registerComponent("ResizeManager",za);var Wa=function(e){function n(n,r){var i,a=$({createEl:!1},r);return(i=e.call(this,n,a)||this).reset_(),i.on(i.player_,"durationchange",i.handleDurationchange),Vt&&"hidden"in t&&"visibilityState"in t&&i.on(t,"visibilitychange",i.handleVisibilityChange),i}Y(n,e);var r=n.prototype;return r.handleVisibilityChange=function(){this.player_.duration()===1/0&&(t.hidden?this.stopTracking():this.startTracking())},r.isBehind_=function(){if(!this.timeupdateSeen_)return!1;var e=this.liveCurrentTime(),t=this.player_.currentTime(),n=this.seekableIncrement_;return e!==1/0&&e-(2*n+.07)>=t},r.trackLive_=function(){this.pastSeekEnd_=this.pastSeekEnd_;var e=this.player_.seekable();if(e&&e.length){var t=this.seekableEnd();t!==this.lastSeekEnd_&&(this.lastSeekEnd_&&(this.seekableIncrement_=Math.abs(t-this.lastSeekEnd_)),this.pastSeekEnd_=0,this.lastSeekEnd_=t,this.trigger("seekableendchange")),this.pastSeekEnd_=this.pastSeekEnd()+.03,this.isBehind_()!==this.behindLiveEdge()&&(this.behindLiveEdge_=this.isBehind_(),this.trigger("liveedgechange"))}},r.handleDurationchange=function(){this.player_.duration()===1/0?this.startTracking():this.stopTracking()},r.startTracking=function(){var e=this;this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLive_,30),this.trackLive_(),this.on(this.player_,"play",this.trackLive_),this.on(this.player_,"pause",this.trackLive_),this.timeupdateSeen_||(this.one(this.player_,"play",this.handlePlay),this.handleTimeupdate=function(){e.timeupdateSeen_=!0,e.handleTimeupdate=null},this.one(this.player_,"timeupdate",this.handleTimeupdate)))},r.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge)},r.reset_=function(){this.pastSeekEnd_=0,this.lastSeekEnd_=null,this.behindLiveEdge_=null,this.timeupdateSeen_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.seekableIncrement_=12,this.off(this.player_,"play",this.trackLive_),this.off(this.player_,"pause",this.trackLive_),this.off(this.player_,"play",this.handlePlay),this.off(this.player_,"timeupdate",this.seekToLiveEdge),this.handleTimeupdate&&(this.off(this.player_,"timeupdate",this.handleTimeupdate),this.handleTimeupdate=null)},r.stopTracking=function(){this.isTracking()&&this.reset_()},r.seekableEnd=function(){for(var e=this.player_.seekable(),t=[],n=e?e.length:0;n--;)t.push(e.end(n));return t.length?t.sort()[t.length-1]:1/0},r.seekableStart=function(){for(var e=this.player_.seekable(),t=[],n=e?e.length:0;n--;)t.push(e.start(n));return t.length?t.sort()[0]:0},r.liveWindow=function(){var e=this.liveCurrentTime();return e===1/0?1/0:e-this.seekableStart()},r.isLive=function(){return this.isTracking()},r.atLiveEdge=function(){return!this.behindLiveEdge()},r.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()},r.pastSeekEnd=function(){return this.pastSeekEnd_},r.behindLiveEdge=function(){return this.behindLiveEdge_},r.isTracking=function(){return"number"==typeof this.trackingInterval_},r.seekToLiveEdge=function(){this.atLiveEdge()||(this.player_.currentTime(this.liveCurrentTime()),this.player_.paused()&&this.player_.play())},r.dispose=function(){this.stopTracking(),e.prototype.dispose.call(this)},n}(wt);wt.registerComponent("LiveTracker",Wa);var Ka=function(e){var t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;var n=e.$$("source"),r=[],i="";if(!n.length)return!1;for(var a=0;a<n.length;a++){var s=n[a].src;s&&-1===r.indexOf(s)&&r.push(s)}return!!r.length&&(1===r.length&&(i=r[0]),e.triggerSourceset(i),!0)},qa=Object.defineProperty({},"innerHTML",{get:function(){return this.cloneNode(!0).innerHTML},set:function(n){var r=t.createElement(this.nodeName.toLowerCase());r.innerHTML=n;for(var i=t.createDocumentFragment();r.childNodes.length;)i.appendChild(r.childNodes[0]);return this.innerText="",e.Element.prototype.appendChild.call(this,i),this.innerHTML}}),$a=function(e,t){for(var n={},r=0;r<e.length&&!((n=Object.getOwnPropertyDescriptor(e[r],t))&&n.set&&n.get);r++);return n.enumerable=!0,n.configurable=!0,n},Ya=function(t){return $a([t.el(),e.HTMLMediaElement.prototype,e.Element.prototype,qa],"innerHTML")},Xa=function(e){var t=e.el();if(!t.resetSourceWatch_){var n={},r=Ya(e),i=function(n){return function(){for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];var s=n.apply(t,i);return Ka(e),s}};["append","appendChild","insertAdjacentHTML"].forEach((function(e){t[e]&&(n[e]=t[e],t[e]=i(n[e]))})),Object.defineProperty(t,"innerHTML",$(r,{set:i(r.set)})),t.resetSourceWatch_=function(){t.resetSourceWatch_=null,Object.keys(n).forEach((function(e){t[e]=n[e]})),Object.defineProperty(t,"innerHTML",r)},e.one("sourceset",t.resetSourceWatch_)}},Ja=Object.defineProperty({},"src",{get:function(){return this.hasAttribute("src")?kn(e.Element.prototype.getAttribute.call(this,"src")):""},set:function(t){return e.Element.prototype.setAttribute.call(this,"src",t),t}}),Qa=function(t){return $a([t.el(),e.HTMLMediaElement.prototype,Ja],"src")},Za=function(n){function i(e,t){var r;r=n.call(this,e,t)||this;var i=e.source,a=!1;if(i&&(r.el_.currentSrc!==i.src||e.tag&&3===e.tag.initNetworkState_)?r.setSource(i):r.handleLateInit_(r.el_),e.enableSourceset&&r.setupSourcesetHandling_(),r.el_.hasChildNodes()){for(var s=r.el_.childNodes,o=s.length,u=[];o--;){var l=s[o];"track"===l.nodeName.toLowerCase()&&(r.featuresNativeTextTracks?(r.remoteTextTrackEls().addTrackElement_(l),r.remoteTextTracks().addTrack(l.track),r.textTracks().addTrack(l.track),a||r.el_.hasAttribute("crossorigin")||!Cn(l.src)||(a=!0)):u.push(l))}for(var c=0;c<u.length;c++)r.el_.removeChild(u[c])}return r.proxyNativeTracks_(),r.featuresNativeTextTracks&&a&&Ke.warn("Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\nThis may prevent text tracks from loading."),r.restoreMetadataTracksInIOSNativePlayer_(),(Kt||It||Ut)&&!0===e.nativeControlsForTouch&&r.setControls(!0),r.proxyWebkitFullscreen_(),r.triggerReady(),r}Y(i,n);var a=i.prototype;return a.dispose=function(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),i.disposeMediaElement(this.el_),this.options_=null,n.prototype.dispose.call(this)},a.setupSourcesetHandling_=function(){!function(e){if(e.featuresSourceset){var t=e.el();if(!t.resetSourceset_){var n=Qa(e),r=t.setAttribute,i=t.load;Object.defineProperty(t,"src",$(n,{set:function(r){var i=n.set.call(t,r);return e.triggerSourceset(t.src),i}})),t.setAttribute=function(n,i){var a=r.call(t,n,i);return/src/i.test(n)&&e.triggerSourceset(t.src),a},t.load=function(){var n=i.call(t);return Ka(e)||(e.triggerSourceset(""),Xa(e)),n},t.currentSrc?e.triggerSourceset(t.currentSrc):Ka(e)||Xa(e),t.resetSourceset_=function(){t.resetSourceset_=null,t.load=i,t.setAttribute=r,Object.defineProperty(t,"src",n),t.resetSourceWatch_&&t.resetSourceWatch_()}}}}(this)},a.restoreMetadataTracksInIOSNativePlayer_=function(){var e,t=this.textTracks(),n=function(){e=[];for(var n=0;n<t.length;n++){var r=t[n];"metadata"===r.kind&&e.push({track:r,storedMode:r.mode})}};n(),t.addEventListener("change",n),this.on("dispose",(function(){return t.removeEventListener("change",n)}));var r=function n(){for(var r=0;r<e.length;r++){var i=e[r];"disabled"===i.track.mode&&i.track.mode!==i.storedMode&&(i.track.mode=i.storedMode)}t.removeEventListener("change",n)};this.on("webkitbeginfullscreen",(function(){t.removeEventListener("change",n),t.removeEventListener("change",r),t.addEventListener("change",r)})),this.on("webkitendfullscreen",(function(){t.removeEventListener("change",n),t.addEventListener("change",n),t.removeEventListener("change",r)}))},a.overrideNative_=function(e,t){var n=this;if(t===this["featuresNative"+e+"Tracks"]){var r=e.toLowerCase();this[r+"TracksListeners_"]&&Object.keys(this[r+"TracksListeners_"]).forEach((function(e){n.el()[r+"Tracks"].removeEventListener(e,n[r+"TracksListeners_"][e])})),this["featuresNative"+e+"Tracks"]=!t,this[r+"TracksListeners_"]=null,this.proxyNativeTracksForType_(r)}},a.overrideNativeAudioTracks=function(e){this.overrideNative_("Audio",e)},a.overrideNativeVideoTracks=function(e){this.overrideNative_("Video",e)},a.proxyNativeTracksForType_=function(e){var t=this,n=ni[e],r=this.el()[n.getterName],i=this[n.getterName]();if(this["featuresNative"+n.capitalName+"Tracks"]&&r&&r.addEventListener){var a={change:function(e){i.trigger({type:"change",target:i,currentTarget:i,srcElement:i})},addtrack:function(e){i.addTrack(e.track)},removetrack:function(e){i.removeTrack(e.track)}},s=function(){for(var e=[],t=0;t<i.length;t++){for(var n=!1,a=0;a<r.length;a++)if(r[a]===i[t]){n=!0;break}n||e.push(i[t])}for(;e.length;)i.removeTrack(e.shift())};this[n.getterName+"Listeners_"]=a,Object.keys(a).forEach((function(e){var n=a[e];r.addEventListener(e,n),t.on("dispose",(function(t){return r.removeEventListener(e,n)}))})),this.on("loadstart",s),this.on("dispose",(function(e){return t.off("loadstart",s)}))}},a.proxyNativeTracks_=function(){var e=this;ni.names.forEach((function(t){e.proxyNativeTracksForType_(t)}))},a.createEl=function(){var e=this.options_.tag;if(!e||!this.options_.playerElIngest&&!this.movingMediaElementInDOM){if(e){var n=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(n,e),i.disposeMediaElement(e),e=n}else{e=t.createElement("video");var a=$({},this.options_.tag&&T(this.options_.tag));Kt&&!0===this.options_.nativeControlsForTouch||delete a.controls,b(e,r(a,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}void 0!==this.options_.preload&&E(e,"preload",this.options_.preload);for(var s=["loop","muted","playsinline","autoplay","stretch","fluent"],o=0;o<s.length;o++){var u=s[o],l=this.options_[u];void 0!==l&&(l?E(e,u,u):k(e,u),e[u]=l)}return e},a.handleLateInit_=function(e){if(0!==e.networkState&&3!==e.networkState){if(0===e.readyState){var t=!1,n=function(){t=!0};this.on("loadstart",n);var r=function(){t||this.trigger("loadstart")};return this.on("loadedmetadata",r),void this.ready((function(){this.off("loadstart",n),this.off("loadedmetadata",r),t||this.trigger("loadstart")}))}var i=["loadstart"];i.push("loadedmetadata"),e.readyState>=2&&i.push("loadeddata"),e.readyState>=3&&i.push("canplay"),e.readyState>=4&&i.push("canplaythrough"),this.ready((function(){i.forEach((function(e){this.trigger(e)}),this)}))}},a.setCurrentTime=function(e){try{this.el_.currentTime=e}catch(e){Ke(e,"Video is not ready. (Video.js)")}},a.duration=function(){var e=this;if(this.el_.duration===1/0&&Mt&&Nt&&0===this.el_.currentTime){return this.on("timeupdate",(function t(){e.el_.currentTime>0&&(e.el_.duration===1/0&&e.trigger("durationchange"),e.off("timeupdate",t))})),NaN}return this.el_.duration||NaN},a.width=function(){return this.el_.offsetWidth},a.height=function(){return this.el_.offsetHeight},a.proxyWebkitFullscreen_=function(){var e=this;if("webkitDisplayingFullscreen"in this.el_){var t=function(){this.trigger("fullscreenchange",{isFullscreen:!1})},n=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",t),this.trigger("fullscreenchange",{isFullscreen:!0}))};this.on("webkitbeginfullscreen",n),this.on("dispose",(function(){e.off("webkitbeginfullscreen",n),e.off("webkitendfullscreen",t)}))}},a.supportsFullScreen=function(){if("function"==typeof this.el_.webkitEnterFullScreen){var t=e.navigator&&e.navigator.userAgent||"";if(/Android/.test(t)||!/Chrome|Mac OS X 10.5/.test(t))return!0}return!1},a.enterFullScreen=function(){var e=this.el_;e.paused&&e.networkState<=e.HAVE_METADATA?(this.el_.play(),this.setTimeout((function(){e.pause(),e.webkitEnterFullScreen()}),0)):e.webkitEnterFullScreen()},a.exitFullScreen=function(){this.el_.webkitExitFullScreen()},a.requestPictureInPicture=function(){return this.el_.requestPictureInPicture()},a.src=function(e){if(void 0===e)return this.el_.src;this.setSrc(e)},a.reset=function(){i.resetMediaElement(this.el_)},a.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},a.setControls=function(e){this.el_.controls=!!e},a.addTextTrack=function(e,t,r){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,r):n.prototype.addTextTrack.call(this,e,t,r)},a.createRemoteTextTrack=function(e){if(!this.featuresNativeTextTracks)return n.prototype.createRemoteTextTrack.call(this,e);var r=t.createElement("track");return e.kind&&(r.kind=e.kind),e.label&&(r.label=e.label),(e.language||e.srclang)&&(r.srclang=e.language||e.srclang),e.default&&(r.default=e.default),e.id&&(r.id=e.id),e.src&&(r.src=e.src),r},a.addRemoteTextTrack=function(e,t){var r=n.prototype.addRemoteTextTrack.call(this,e,t);return this.featuresNativeTextTracks&&this.el().appendChild(r),r},a.removeRemoteTextTrack=function(e){if(n.prototype.removeRemoteTextTrack.call(this,e),this.featuresNativeTextTracks)for(var t=this.$$("track"),r=t.length;r--;)e!==t[r]&&e!==t[r].track||this.el().removeChild(t[r])},a.getVideoPlaybackQuality=function(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();var t={};return void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(t.droppedVideoFrames=this.el().webkitDroppedFrameCount,t.totalVideoFrames=this.el().webkitDecodedFrameCount),e.performance&&"function"==typeof e.performance.now?t.creationTime=e.performance.now():e.performance&&e.performance.timing&&"number"==typeof e.performance.timing.navigationStart&&(t.creationTime=e.Date.now()-e.performance.timing.navigationStart),t},i}(_i);if(l()){Za.TEST_VID=t.createElement("video");var es=t.createElement("track");es.kind="captions",es.srclang="en",es.label="English",Za.TEST_VID.appendChild(es)}Za.isSupported=function(){try{Za.TEST_VID.volume=.5}catch(e){return!1}return!(!Za.TEST_VID||!Za.TEST_VID.canPlayType)},Za.canPlayType=function(e){return Za.TEST_VID.canPlayType(e)},Za.canPlaySource=function(e,t){return Za.canPlayType(e.type)},Za.canControlVolume=function(){try{var e=Za.TEST_VID.volume;return Za.TEST_VID.volume=e/2+.1,e!==Za.TEST_VID.volume}catch(e){return!1}},Za.canMuteVolume=function(){try{var e=Za.TEST_VID.muted;return Za.TEST_VID.muted=!e,Za.TEST_VID.muted?E(Za.TEST_VID,"muted","muted"):k(Za.TEST_VID,"muted"),e!==Za.TEST_VID.muted}catch(e){return!1}},Za.canControlPlaybackRate=function(){if(Mt&&Nt&&Gt<58)return!1;try{var e=Za.TEST_VID.playbackRate;return Za.TEST_VID.playbackRate=e/2+.1,e!==Za.TEST_VID.playbackRate}catch(e){return!1}},Za.canOverrideAttributes=function(){try{var e=function(){};Object.defineProperty(t.createElement("video"),"src",{get:e,set:e}),Object.defineProperty(t.createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(t.createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(t.createElement("audio"),"innerHTML",{get:e,set:e})}catch(e){return!1}return!0},Za.supportsNativeTextTracks=function(){return zt||Dt&&Nt},Za.supportsNativeVideoTracks=function(){return!(!Za.TEST_VID||!Za.TEST_VID.videoTracks)},Za.supportsNativeAudioTracks=function(){return!(!Za.TEST_VID||!Za.TEST_VID.audioTracks)},Za.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],Za.prototype.featuresVolumeControl=Za.canControlVolume(),Za.prototype.featuresMuteControl=Za.canMuteVolume(),Za.prototype.featuresPlaybackRate=Za.canControlPlaybackRate(),Za.prototype.featuresSourceset=Za.canOverrideAttributes(),Za.prototype.movingMediaElementInDOM=!Dt,Za.prototype.featuresFullscreenResize=!0,Za.prototype.featuresProgressEvents=!0,Za.prototype.featuresTimeupdateEvents=!0,Za.prototype.featuresNativeTextTracks=Za.supportsNativeTextTracks(),Za.prototype.featuresNativeVideoTracks=Za.supportsNativeVideoTracks(),Za.prototype.featuresNativeAudioTracks=Za.supportsNativeAudioTracks();var ts=Za.TEST_VID&&Za.TEST_VID.constructor.prototype.canPlayType,ns=/^application\/(?:x-|vnd\.apple\.)mpegurl/i;Za.patchCanPlayType=function(){jt>=4&&!Bt&&!Nt&&(Za.TEST_VID.constructor.prototype.canPlayType=function(e){return e&&ns.test(e)?"maybe":ts.call(this,e)})},Za.unpatchCanPlayType=function(){var e=Za.TEST_VID.constructor.prototype.canPlayType;return Za.TEST_VID.constructor.prototype.canPlayType=ts,e},Za.patchCanPlayType(),Za.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},Za.resetMediaElement=function(e){if(e){for(var t=e.querySelectorAll("source"),n=t.length;n--;)e.removeChild(t[n]);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},["muted","defaultMuted","autoplay","stretch","fluent","controls","loop","playsinline"].forEach((function(e){Za.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}})),["muted","defaultMuted","autoplay","loop","playsinline"].forEach((function(e){Za.prototype["set"+kt(e)]=function(t){this.el_[e]=t,t?this.el_.setAttribute(e,e):this.el_.removeAttribute(e)}})),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","played","networkState","readyState","videoWidth","videoHeight"].forEach((function(e){Za.prototype[e]=function(){return this.el_[e]}})),["volume","src","poster","preload","playbackRate","defaultPlaybackRate"].forEach((function(e){Za.prototype["set"+kt(e)]=function(t){this.el_[e]=t}})),["pause","load","play"].forEach((function(e){Za.prototype[e]=function(){return this.el_[e]()}})),_i.withSourceHandlers(Za),Za.nativeSourceHandler={},Za.nativeSourceHandler.canPlayType=function(e){try{return Za.TEST_VID.canPlayType(e)}catch(e){return""}},Za.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return Za.nativeSourceHandler.canPlayType(e.type);if(e.src){var n=wn(e.src);return Za.nativeSourceHandler.canPlayType("video/"+n)}return""},Za.nativeSourceHandler.handleSource=function(e,t,n){t.setSrc(e.src)},Za.nativeSourceHandler.dispose=function(){},Za.registerSourceHandler(Za.nativeSourceHandler),_i.registerTech("Html5",Za);var rs=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],is={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},as=["tiny","xsmall","small","medium","large","xlarge","huge"],ss={};as.forEach((function(e){var t="x"===e.charAt(0)?"x-"+e.substring(1):e;ss[e]="vjs-layout-"+t}));var os={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},us=function(n){function a(e,t,i){var s;if(e.id=e.id||t.id||"vjs_video_"+j(),(t=r(a.getTagSettings(e),t)).initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language)if("function"==typeof e.closest){var o=e.closest("[lang]");o&&o.getAttribute&&(t.language=o.getAttribute("lang"))}else for(var u=e;u&&1===u.nodeType;){if(T(u).hasOwnProperty("lang")){t.language=u.getAttribute("lang");break}u=u.parentNode}if((s=n.call(this,null,t,i)||this).boundDocumentFullscreenChange_=dt(Z(s),s.documentFullscreenChange_),s.boundFullWindowOnEscKey_=dt(Z(s),s.fullWindowOnEscKey),s.log=qe(s.id_),s.fsApi_=$t,s.isPosterFromTech_=!1,s.queuedCallbacks_=[],s.isReady_=!1,s.hasStarted_=!1,s.userActive_=!1,!s.options_||!s.options_.techOrder||!s.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(s.tag=e,s.tagAttributes=e&&T(e),s.language(s.options_.language),t.languages){var l={};Object.getOwnPropertyNames(t.languages).forEach((function(e){l[e.toLowerCase()]=t.languages[e]})),s.languages_=l}else s.languages_=a.prototype.options_.languages;s.resetCache_(),s.poster_=t.poster||"",s.controls_=!!t.controls,e.controls=!1,e.removeAttribute("controls"),s.changingSrc_=!1,s.playCallbacks_=[],s.playTerminatedQueue_=[],e.hasAttribute("autoplay")?s.autoplay(!0):s.autoplay(s.options_.autoplay),t.plugins&&Object.keys(t.plugins).forEach((function(e){if("function"!=typeof s[e])throw new Error('plugin "'+e+'" does not exist')})),s.scrubbing_=!1,s.el_=s.createEl(),K(Z(s),{eventBusKey:"el_"}),s.fluid_&&s.on("playerreset",s.updateStyleEl_);var c=$(s.options_);t.plugins&&Object.keys(t.plugins).forEach((function(e){s[e](t.plugins[e])})),s.options_.playerOptions=c,s.middleware_=[],s.initChildren(),s.isAudio("audio"===e.nodeName.toLowerCase()),s.controls()?s.addClass("vjs-controls-enabled"):s.addClass("vjs-controls-disabled"),s.el_.setAttribute("role","region"),s.isAudio()?s.el_.setAttribute("aria-label",s.localize("Audio Player")):s.el_.setAttribute("aria-label",s.localize("Video Player")),s.isAudio()&&s.addClass("vjs-audio"),s.flexNotSupported_()&&s.addClass("vjs-no-flex"),Kt&&s.addClass("vjs-touch-enabled"),Dt||s.addClass("vjs-workinghover"),a.players[s.id_]=Z(s);var d=He.split(".")[0];return s.addClass("vjs-v"+d),s.userActive(!0),s.reportUserActivity(),s.one("play",s.listenForUserActivity_),s.on("stageclick",s.handleStageClick_),s.on("keydown",s.handleKeyDown),s.breakpoints(s.options_.breakpoints),s.responsive(s.options_.responsive),s}Y(a,n);var s=a.prototype;return s.dispose=function(){var e=this;this.trigger("dispose"),this.off("dispose"),G(t,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),G(t,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),a.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),function(e){Ti[e.id()]=null}(this),ii.names.forEach((function(t){var n=ii[t],r=e[n.getterName]();r&&r.off&&r.off()})),n.prototype.dispose.call(this)},s.createEl=function(){var r,i=this.tag,a=this.playerElIngest_=i.parentNode&&i.parentNode.hasAttribute&&i.parentNode.hasAttribute("data-vjs-player"),s="video-js"===this.tag.tagName.toLowerCase();a?r=this.el_=i.parentNode:s||(r=this.el_=n.prototype.createEl.call(this,"div"));var o=T(i);if(s){for(r=this.el_=i,i=this.tag=t.createElement("video");r.children.length;)i.appendChild(r.firstChild);m(r,"video-js")||g(r,"video-js"),r.appendChild(i),a=this.playerElIngest_=r,Object.keys(r).forEach((function(e){i[e]=r[e]}))}if(i.setAttribute("tabindex","-1"),o.tabindex="-1",(Vt||Nt&&Wt)&&(i.setAttribute("role","application"),o.role="application"),i.removeAttribute("width"),i.removeAttribute("height"),"width"in o&&delete o.width,"height"in o&&delete o.height,Object.getOwnPropertyNames(o).forEach((function(e){s&&"class"===e||r.setAttribute(e,o[e]),s&&i.setAttribute(e,o[e])})),i.playerId=i.id,i.id+="_html5_api",i.className="vjs-tech",i.player=r.player=this,this.addClass("vjs-paused"),!0!==e.VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=ut("vjs-styles-dimensions");var u=Xe(".vjs-styles-defaults"),l=Xe("head");l.insertBefore(this.styleEl_,u?u.nextSibling:l.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio);for(var c=i.getElementsByTagName("a"),d=0;d<c.length;d++){var h=c.item(d);g(h,"vjs-hidden"),h.setAttribute("hidden","hidden")}return i.initNetworkState_=i.networkState,i.parentNode&&!a&&i.parentNode.insertBefore(r,i),v(i,r),this.children_.unshift(i),this.el_.setAttribute("lang",this.language_),this.el_=r,r},s.width=function(e){return this.dimension("width",e)},s.height=function(e){return this.dimension("height",e)},s.dimension=function(e,t){var n=e+"_";if(void 0===t)return this[n]||0;if(""===t)return this[n]=void 0,void this.updateStyleEl_();var r=parseFloat(t);isNaN(r)?Ke.error('Improper value "'+t+'" supplied for for '+e):(this[n]=r,this.updateStyleEl_())},s.fluid=function(e){if(void 0===e)return!!this.fluid_;this.fluid_=!!e,pt(this)&&this.off("playerreset",this.updateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),function(e,t){pt(e)?t():(e.eventedCallbacks||(e.eventedCallbacks=[]),e.eventedCallbacks.push(t))}((function(){this.on("playerreset",this.updateStyleEl_)}))):this.removeClass("vjs-fluid"),this.updateStyleEl_()},s.fill=function(e){if(void 0===e)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")},s.aspectRatio=function(e){if(void 0===e)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()},s.updateStyleEl_=function(){if(!0!==e.VIDEOJS_NO_DYNAMIC_STYLE){var t,n,r,i=(void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"),a=i[1]/i[0];t=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/a:this.videoWidth()||300,n=void 0!==this.height_?this.height_:t*a,r=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(r),lt(this.styleEl_,"\n ."+r+" {\n width: "+t+"px;\n height: "+n+"px;\n }\n\n ."+r+".vjs-fluid {\n padding-top: "+100*a+"%;\n }\n ")}else{var s="number"==typeof this.width_?this.width_:this.options_.width,o="number"==typeof this.height_?this.height_:this.options_.height,u=this.tech_&&this.tech_.el();u&&(s>=0&&(u.width=s),o>=0&&(u.height=o))}},s.loadTech_=function(e,t){var n=this;this.tech_&&this.unloadTech_();var i=kt(e),a=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==i&&this.tag&&(_i.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=i,this.isReady_=!1;var s={source:t,autoplay:"string"!=typeof this.autoplay()&&this.autoplay(),nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+a+"_api",playsinline:this.options_.playsinline,stretch:this.options_.stretch,fluent:this.options_.fluent,preload:this.options_.preload,loop:this.options_.loop,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset,Promise:this.options_.Promise};ii.names.forEach((function(e){var t=ii[e];s[t.getterName]=n[t.privateName]})),r(s,this.options_[i]),r(s,this.options_[a]),r(s,this.options_[e.toLowerCase()]),this.tag&&(s.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(s.startTime=this.cache_.currentTime);var o=_i.getTech(e);if(!o)throw new Error("No Tech named '"+i+"' exists! '"+i+"' should be registered using videojs.registerTech()'");this.tech_=new o(s),this.tech_.ready(dt(this,this.handleTechReady_),!0),rn(this.textTracksJson_||[],this.tech_),rs.forEach((function(e){n.on(n.tech_,e,n["handleTech"+kt(e)+"_"])})),Object.keys(is).forEach((function(e){n.on(n.tech_,e,(function(t){0===n.tech_.playbackRate()&&n.tech_.seeking()?n.queuedCallbacks_.push({callback:n["handleTech"+is[e]+"_"].bind(n),event:t}):n["handleTech"+is[e]+"_"](t)}))})),this.on(this.tech_,"loadstart",this.handleTechLoadStart_),this.on(this.tech_,"sourceset",this.handleTechSourceset_),this.on(this.tech_,"waiting",this.handleTechWaiting_),this.on(this.tech_,"ended",this.handleTechEnded_),this.on(this.tech_,"seeking",this.handleTechSeeking_),this.on(this.tech_,"play",this.handleTechPlay_),this.on(this.tech_,"firstplay",this.handleTechFirstPlay_),this.on(this.tech_,"pause",this.handleTechPause_),this.on(this.tech_,"durationchange",this.handleTechDurationChange_),this.on(this.tech_,"fullscreenchange",this.handleTechFullscreenChange_),this.on(this.tech_,"fullscreentoggle",this.handleTechFullscreenToggle_),this.on(this.tech_,"enterpictureinpicture",this.handleTechEnterPictureInPicture_),this.on(this.tech_,"leavepictureinpicture",this.handleTechLeavePictureInPicture_),this.on(this.tech_,"error",this.handleTechError_),this.on(this.tech_,"loadedmetadata",this.updateStyleEl_),this.on(this.tech_,"posterchange",this.handleTechPosterChange_),this.on(this.tech_,"textdata",this.handleTechTextData_),this.on(this.tech_,"ratechange",this.handleTechRateChange_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===i&&this.tag||v(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},s.unloadTech_=function(){var e=this;ii.names.forEach((function(t){var n=ii[t];e[n.privateName]=e[n.getterName]()})),this.textTracksJson_=nn(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},s.tech=function(e){return void 0===e&&Ke.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),this.tech_},s.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"mouseup",this.handleTechClick_),this.on(this.tech_,"dblclick",this.handleTechDoubleClick_),this.on(this.tech_,"touchstart",this.handleTechTouchStart_),this.on(this.tech_,"touchmove",this.handleTechTouchMove_),this.on(this.tech_,"touchend",this.handleTechTouchEnd_),this.on(this.tech_,"tap",this.handleTechTap_)},s.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.handleTechTap_),this.off(this.tech_,"touchstart",this.handleTechTouchStart_),this.off(this.tech_,"touchmove",this.handleTechTouchMove_),this.off(this.tech_,"touchend",this.handleTechTouchEnd_),this.off(this.tech_,"mouseup",this.handleTechClick_),this.off(this.tech_,"dblclick",this.handleTechDoubleClick_)},s.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},s.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.seekingTimer&&(clearTimeout(this.seekingTimer),this.seekingTimer=0),this.removeClass("vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(this.autoplay())},s.manualAutoplay_=function(e){var t=this;if(this.tech_&&"string"==typeof e){var n,r=function(){var e=t.muted();t.muted(!0);var n=function(){t.muted(e)};t.playTerminatedQueue_.push(n);var r=t.play();if(ae(r))return r.catch(n)};if("any"===e&&!0!==this.muted()?ae(n=this.play())&&(n=n.catch(r)):n="muted"===e&&!0!==this.muted()?r():this.play(),ae(n))return n.then((function(){t.trigger({type:"autoplay-success",autoplay:e})})).catch((function(n){t.trigger({type:"autoplay-failure",autoplay:e})}))}},s.updateSourceCaches_=function(e){void 0===e&&(e="");var t=e,n="";"string"!=typeof t&&(t=e.src,n=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!n&&(n=function(e,t){if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;var n=e.cache_.sources.filter((function(e){return e.src===t}));if(n.length)return n[0].type;for(var r=e.$$("source"),i=0;i<r.length;i++){var a=r[i];if(a.type&&a.src&&a.src===t)return a.type}return Ai(t)}(this,t)),this.cache_.source=$({},e,{src:t,type:n});for(var r=this.cache_.sources.filter((function(e){return e.src&&e.src===t})),i=[],a=this.$$("source"),s=[],o=0;o<a.length;o++){var u=T(a[o]);i.push(u),u.src&&u.src===t&&s.push(u.src)}s.length&&!r.length?this.cache_.sources=i:r.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t},s.handleTechSourceset_=function(e){var t=this;if(!this.changingSrc_){var n=function(e){return t.updateSourceCaches_(e)},r=this.currentSource().src,i=e.src;r&&!/^blob:/.test(r)&&/^blob:/.test(i)&&(!this.lastSource_||this.lastSource_.tech!==i&&this.lastSource_.player!==r)&&(n=function(){}),n(i),e.src||this.tech_.any(["sourceset","loadstart"],(function(e){if("sourceset"!==e.type){var n=t.techGet("currentSrc");t.lastSource_.tech=n,t.updateSourceCaches_(n)}}))}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})},s.hasStarted=function(e){if(void 0===e)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?(this.addClass("vjs-has-started"),this.trigger("firstplay")):this.removeClass("vjs-has-started"))},s.handleTechPlay_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")},s.handleTechRateChange_=function(){this.tech_.playbackRate()>0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach((function(e){return e.callback(e.event)})),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},s.waitingTimer=0,s.seekingTimer=0,s.handleTechWaiting_=function(){var e=this;this.waitingTimer&&clearTimeout(this.waitingTimer),this.waitingTimer=setTimeout((function(){e.addClass("vjs-waiting")}),1e3),this.trigger("waiting");var t=this.currentTime();this.on("timeupdate",(function n(){e.waitingTimer&&(clearTimeout(e.waitingTimer),e.waitingTimer=0),t!==e.currentTime()&&(e.removeClass("vjs-waiting"),e.off("timeupdate",n))}))},s.handleTechCanPlay_=function(){this.waitingTimer&&(clearTimeout(this.waitingTimer),this.waitingTimer=0),this.removeClass("vjs-waiting"),this.trigger("canplay")},s.handleTechCanPlayThrough_=function(){this.waitingTimer&&(clearTimeout(this.waitingTimer),this.waitingTimer=0),this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},s.handleTechPlaying_=function(){this.waitingTimer&&(clearTimeout(this.waitingTimer),this.waitingTimer=0),this.removeClass("vjs-waiting"),this.trigger("playing")},s.handleTechSeeking_=function(){var e=this;this.seekingTimer&&clearTimeout(this.seekingTimer),this.seekingTimer=setTimeout((function(){e.addClass("vjs-seeking")}),1e3),this.trigger("seeking")},s.handleTechSeeked_=function(){this.seekingTimer&&(clearTimeout(this.seekingTimer),this.seekingTimer=0),this.removeClass("vjs-seeking"),this.removeClass("vjs-ended"),this.trigger("seeked")},s.handleTechFirstPlay_=function(){this.options_.starttime&&(Ke.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},s.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},s.handleTechEnded_=function(){this.addClass("vjs-ended"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},s.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},s.handleTechClick_=function(e){M(e)&&this.controls_&&this.paused()},s.handleTechDoubleClick_=function(e){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),(function(t){return t.contains(e.target)}))||void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.doubleClick&&!1===this.options_.userActions.doubleClick||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))},s.handleTechTap_=function(){this.userActive(!this.userActive())},s.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},s.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},s.handleTechTouchEnd_=function(e){e.preventDefault()},s.handleStageClick_=function(){this.reportUserActivity()},s.toggleFullscreenClass_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},s.documentFullscreenChange_=function(e){var n=this.el(),r=t[this.fsApi_.fullscreenElement]===n;!r&&n.matches?r=n.matches(":"+this.fsApi_.fullscreen):!r&&n.msMatchesSelector&&(r=n.msMatchesSelector(":"+this.fsApi_.fullscreen)),this.isFullscreen(r),!1===this.isFullscreen()&&G(t,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.fsApi_.prefixed&&this.trigger("fullscreenchange")},s.handleTechFullscreenChange_=function(e,t){t&&this.isFullscreen(t.isFullscreen),this.trigger("fullscreenchange")},s.handleTechFullscreenToggle_=function(e,t){this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()},s.togglePictureInPictureClass_=function(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")},s.handleTechEnterPictureInPicture_=function(e){this.isInPictureInPicture(!0)},s.handleTechLeavePictureInPicture_=function(e){this.isInPictureInPicture(!1)},s.handleTechError_=function(){var e=this.tech_.error();this.error(e)},s.handleTechTextData_=function(){var e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)},s.getCache=function(){return this.cache_},s.resetCache_=function(){this.cache_={currentTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],volume:1}},s.techCall_=function(e,t){this.ready((function(){if(e in ki)return function(e,t,n,r){return t[n](e.reduce(Re(n),r))}(this.middleware_,this.tech_,e,t);if(e in wi)return Le(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(e){throw Ke(e),e}}),!0)},s.techGet_=function(e){if(this.tech_&&this.tech_.isReady_){if(e in Ei)return function(e,t,n){return e.reduceRight(Re(n),t[n]())}(this.middleware_,this.tech_,e);if(e in wi)return Le(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){if(void 0===this.tech_[e])throw Ke("Video.js: "+e+" method not defined for "+this.techName_+" playback technology.",t),t;if("TypeError"===t.name)throw Ke("Video.js: "+e+" unavailable on "+this.techName_+" playback technology element.",t),this.tech_.isReady_=!1,t;throw Ke(t),t}}},s.play=function(){var t=this,n=this.options_.Promise||e.Promise;return n?new n((function(e){t.play_(e)})):this.play_()},s.play_=function(e){var t=this;void 0===e&&(e=se),this.playCallbacks_.push(e);var n=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc()));if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!n)return this.waitToPlay_=function(e){t.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(n||!zt&&!Dt||this.load());var r=this.techGet_("play");null===r?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(r)},s.runPlayTerminatedQueue_=function(){var e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach((function(e){e()}))},s.runPlayCallbacks_=function(e){var t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach((function(t){t(e)}))},s.pause=function(){this.techCall_("pause")},s.paused=function(){return!1!==this.techGet_("paused")},s.played=function(){return this.techGet_("played")||ne(0,0)},s.scrubbing=function(e){if(void 0===e)return this.scrubbing_;this.scrubbing_=!!e,e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},s.currentTime=function(e){return void 0!==e?(e<0&&(e=0),void this.techCall_("setCurrentTime",e)):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)},s.duration=function(e){if(void 0===e)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(e=parseFloat(e))<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?(this.addClass("vjs-live"),this.options_.liveui&&this.player_.liveTracker&&this.addClass("vjs-liveui")):(this.removeClass("vjs-live"),this.removeClass("vjs-liveui")),isNaN(e)||this.trigger("durationchange"))},s.remainingTime=function(){return this.duration()-this.currentTime()},s.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},s.buffered=function(){var e=this.techGet_("buffered");return e&&e.length||(e=ne(0,0)),e},s.bufferedPercent=function(){return re(this.buffered(),this.duration())},s.bufferedEnd=function(){var e=this.buffered(),t=this.duration(),n=e.end(e.length-1);return n>t&&(n=t),n},s.volume=function(e){var t;return void 0!==e?(t=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=t,this.techCall_("setVolume",t),void(t>0&&this.lastVolume_(t))):(t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t)},s.muted=function(e){return void 0!==e?void this.techCall_("setMuted",e):this.techGet_("muted")||!1},s.defaultMuted=function(e){return void 0!==e?this.techCall_("setDefaultMuted",e):this.techGet_("defaultMuted")||!1},s.lastVolume_=function(e){return void 0!==e&&0!==e?void(this.cache_.lastVolume=e):this.cache_.lastVolume},s.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},s.isFullscreen=function(e){return void 0!==e?(this.isFullscreen_=!!e,void this.toggleFullscreenClass_()):!!this.isFullscreen_},s.requestFullscreen=function(e){var n;this.isFullscreen(!0),this.fsApi_.requestFullscreen?(N(t,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.fsApi_.prefixed||(n=this.options_.fullscreen&&this.options_.fullscreen.options||{},void 0!==e&&(n=e)),se(this.el_[this.fsApi_.requestFullscreen](n))):this.tech_.supportsFullScreen()?this.techCall_("enterFullScreen"):(this.enterFullWindow(),this.trigger("fullscreenchange"))},s.exitFullscreen=function(){this.isFullscreen(!1),this.fsApi_.requestFullscreen?(t.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement||t.msFullscreenElement)&&se(t[this.fsApi_.exitFullscreen]()):this.tech_.supportsFullScreen()?this.techCall_("exitFullScreen"):(this.exitFullWindow(),this.trigger("fullscreenchange"))},s.enterFullWindow=function(){this.isFullWindow=!0,this.docOrigOverflow=t.documentElement.style.overflow,N(t,"keydown",this.boundFullWindowOnEscKey_),t.documentElement.style.overflow="hidden",g(t.body,"vjs-full-window"),this.trigger("enterFullWindow")},s.fullWindowOnEscKey=function(e){an.isEventKey(e,"Esc")&&(!0===this.isFullscreen()?this.exitFullscreen():this.exitFullWindow())},s.exitFullWindow=function(){this.isFullWindow=!1,G(t,"keydown",this.boundFullWindowOnEscKey_),t.documentElement.style.overflow=this.docOrigOverflow,y(t.body,"vjs-full-window"),this.trigger("exitFullWindow")},s.isInPictureInPicture=function(e){return void 0!==e?(this.isInPictureInPicture_=!!e,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_},s.requestPictureInPicture=function(){if("pictureInPictureEnabled"in t)return this.techGet_("requestPictureInPicture")},s.exitPictureInPicture=function(){if("pictureInPictureEnabled"in t)return t.exitPictureInPicture()},s.handleKeyDown=function(e){var t=this.options_.userActions;t&&t.hotkeys&&(function(e){var t=e.tagName.toLowerCase();if(e.isContentEditable)return!0;return"input"===t?-1===["button","checkbox","hidden","radio","reset","submit"].indexOf(e.type):-1!==["textarea"].indexOf(t)}(this.el_.ownerDocument.activeElement)||("function"==typeof t.hotkeys?t.hotkeys.call(this,e):this.handleHotkeys(e)))},s.handleHotkeys=function(e){var n=this.options_.userActions?this.options_.userActions.hotkeys:{},r=n.fullscreenKey,i=void 0===r?function(e){return an.isEventKey(e,"f")}:r,a=n.muteKey,s=void 0===a?function(e){return an.isEventKey(e,"m")}:a,o=n.playPauseKey,u=void 0===o?function(e){return an.isEventKey(e,"k")||an.isEventKey(e,"Space")}:o;if(i.call(this,e)){e.preventDefault(),e.stopPropagation();var l=wt.getComponent("FullscreenToggle");!1!==t[this.fsApi_.fullscreenEnabled]&&l.prototype.handleClick.call(this,e)}else if(s.call(this,e)){e.preventDefault(),e.stopPropagation(),wt.getComponent("MuteToggle").prototype.handleClick.call(this,e)}else if(u.call(this,e)){e.preventDefault(),e.stopPropagation(),wt.getComponent("PlayToggle").prototype.handleClick.call(this,e)}},s.canPlayType=function(e){for(var t,n=0,r=this.options_.techOrder;n<r.length;n++){var i=r[n],a=_i.getTech(i);if(a||(a=wt.getComponent(i)),a){if(a.isSupported()&&(t=a.canPlayType(e)))return t}else Ke.error('The "'+i+'" tech is undefined. Skipped browser support check for that tech.')}return""},s.selectSource=function(e){var t=this,n=this.options_.techOrder.map((function(e){return[e,_i.getTech(e)]})).filter((function(e){var t=e[0],n=e[1];return n?n.isSupported():(Ke.error('The "'+t+'" tech is undefined. Skipped browser support check for that tech.'),!1)})),r=function(e,t,n){var r;return e.some((function(e){return t.some((function(t){if(r=n(e,t))return!0}))})),r},i=function(e,n){var r=e[0];if(e[1].canPlaySource(n,t.options_[r.toLowerCase()]))return{source:n,tech:r}};return(this.options_.sourceOrder?r(e,n,function(e){return function(t,n){return e(n,t)}}(i)):r(n,e,i))||!1},s.src=function(e){var t=this;if(void 0===e)return this.cache_.src||"";var n=function e(t){if(Array.isArray(t)){var n=[];t.forEach((function(t){t=e(t),Array.isArray(t)?n=n.concat(t):i(t)&&n.push(t)})),t=n}else t="string"==typeof t&&t.trim()?[xe({src:t})]:i(t)&&"string"==typeof t.src&&t.src&&t.src.trim()?[xe(t)]:[];return t}(e);n.length?(this.changingSrc_=!0,this.cache_.sources=n,this.updateSourceCaches_(n[0]),Ae(this,n[0],(function(e,r){if(t.middleware_=r,t.cache_.sources=n,t.updateSourceCaches_(e),t.src_(e))return n.length>1?t.src(n.slice(1)):(t.changingSrc_=!1,t.setTimeout((function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})}),0),void t.triggerReady());!function(e,t){e.forEach((function(e){return e.setTech&&e.setTech(t)}))}(r,t.tech_)}))):this.setTimeout((function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})}),0)},s.src_=function(e){var t=this,n=this.selectSource([e]);return!n||(function(e,t){return kt(e)===kt(t)}(n.tech,this.techName_)?(this.ready((function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1}),!0),!1):(this.changingSrc_=!0,this.loadTech_(n.tech,n.source),this.tech_.ready((function(){t.changingSrc_=!1})),!1))},s.load=function(){this.techCall_("load")},s.reset=function(){var t=this,n=this.options_.Promise||e.Promise;this.paused()||!n?this.doReset_():se(this.play().then((function(){return t.doReset_()})))},s.doReset_=function(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),pt(this)&&this.trigger("playerreset")},s.resetControlBarUI_=function(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()},s.resetProgressBar_=function(){this.currentTime(0);var e=this.controlBar,t=e.durationDisplay,n=e.remainingTimeDisplay;t&&t.updateContent(),n&&n.updateContent()},s.resetPlaybackRate_=function(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()},s.resetVolumeBar_=function(){this.volume(1),this.trigger("volumechange")},s.currentSources=function(){var e=this.currentSource(),t=[];return 0!==Object.keys(e).length&&t.push(e),this.cache_.sources||t},s.currentSource=function(){return this.cache_.source||{}},s.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},s.currentType=function(){return this.currentSource()&&this.currentSource().type||""},s.preload=function(e){return void 0!==e?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")},s.autoplay=function(e){if(void 0===e)return this.options_.autoplay||!1;var t;"string"==typeof e&&/(any|play|muted)/.test(e)?(this.options_.autoplay=e,this.manualAutoplay_(e),t=!1):this.options_.autoplay=!!e,t=void 0===t?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)},s.playsinline=function(e){return void 0!==e?(this.techCall_("setPlaysinline",e),this.options_.playsinline=e,this):this.techGet_("playsinline")},s.loop=function(e){return void 0!==e?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")},s.stretch=function(e){return void 0!==e?(this.techCall_("setStretch",e),void(this.options_.stretch=e)):this.techGet_("stretch")},s.fluent=function(e){return null!=e?(this.techCall_("setFluent",e),this.options_.fluent=e,this):this.techGet_("fluent")},s.poster=function(e){if(void 0===e)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))},s.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}},s.controls=function(e){if(void 0===e)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))},s.usingNativeControls=function(e){if(void 0===e)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))},s.error=function(e){if(void 0===e)return this.error_||null;if(this.options_.suppressNotSupportedError&&e&&e.message&&e.message===this.localize(this.options_.notSupportedMessage)){var t=function(){this.error(e)};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),void this.one("loadstart",(function(){this.off(["click","touchstart"],t)}))}if(null===e)return this.error_=e,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new ie(e),this.addClass("vjs-error"),Ke.error("(CODE:"+this.error_.code+" "+ie.errorTypes[this.error_.code]+")",this.error_.message,this.error_),this.trigger("error")},s.reportUserActivity=function(e){this.userActivity_=!0},s.userActive=function(e){if(void 0===e)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",(function(e){e.stopPropagation(),e.preventDefault()})),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},s.listenForUserActivity_=function(){var e,t,n,r=dt(this,this.reportUserActivity);this.on("mousedown",(function(){r(),this.clearInterval(e),e=this.setInterval(r,250)})),this.on("mousemove",(function(e){e.screenX===t&&e.screenY===n||(t=e.screenX,n=e.screenY,r())})),this.on("mouseup",(function(t){r(),this.clearInterval(e)}));var i,a=this.getChild("controlBar");!a||Dt||Mt||(a.on("mouseenter",(function(e){this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout,this.player().options_.inactivityTimeout=0})),a.on("mouseleave",(function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout}))),this.on("keydown",r),this.on("keyup",r),this.setInterval((function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(i);var e=this.options_.inactivityTimeout;e<=0||(i=this.setTimeout((function(){this.userActivity_||this.userActive(!1)}),e))}}),250)},s.playbackRate=function(e){return void 0!==e?void this.techCall_("setPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1},s.defaultPlaybackRate=function(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},s.isAudio=function(e){return void 0!==e?void(this.isAudio_=!!e):!!this.isAudio_},s.addTextTrack=function(e,t,n){if(this.tech_)return this.tech_.addTextTrack(e,t,n)},s.addRemoteTextTrack=function(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)},s.removeRemoteTextTrack=function(e){void 0===e&&(e={});var t=e.track;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)},s.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},s.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},s.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},s.language=function(e){if(void 0===e)return this.language_;this.language_=String(e).toLowerCase()},s.languages=function(){return $(a.prototype.options_.languages,this.languages_)},s.toJSON=function(){var e=$(this.options_),t=e.tracks;e.tracks=[];for(var n=0;n<t.length;n++){var r=t[n];(r=$(r)).player=void 0,e.tracks[n]=r}return e},s.createModal=function(e,t){var n=this;(t=t||{}).content=e||"";var r=new on(this,t);return this.addChild(r),r.on("dispose",(function(){n.removeChild(r)})),r.open(),r},s.updateCurrentBreakpoint_=function(){if(this.responsive())for(var e=this.currentBreakpoint(),t=this.currentWidth(),n=0;n<as.length;n++){var r=as[n];if(t<=this.breakpoints_[r]){if(e===r)return;e&&this.removeClass(ss[e]),this.addClass(ss[r]),this.breakpoint_=r;break}}},s.removeCurrentBreakpoint_=function(){var e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)},s.breakpoints=function(e){return void 0===e||(this.breakpoint_="",this.breakpoints_=r({},os,e),this.updateCurrentBreakpoint_()),r(this.breakpoints_)},s.responsive=function(e){return void 0===e?this.responsive_:(e=Boolean(e))!==this.responsive_?(this.responsive_=e,e?(this.on("playerresize",this.updateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.updateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e):void 0},s.currentBreakpoint=function(){return this.breakpoint_},s.currentBreakpointClass=function(){return ss[this.breakpoint_]||""},s.loadMedia=function(e,t){var n=this;if(e&&"object"==typeof e){this.reset(),this.cache_.media=$(e);var r=this.cache_.media,i=r.artwork,a=r.poster,s=r.src,o=r.textTracks;!i&&a&&(this.cache_.media.artwork=[{src:a,type:Ai(a)}]),s&&this.src(s),a&&this.poster(a),Array.isArray(o)&&o.forEach((function(e){return n.addRemoteTextTrack(e,!1)})),this.ready(t)}},s.getMedia=function(){if(!this.cache_.media){var e=this.poster(),t={src:this.currentSources(),textTracks:Array.prototype.map.call(this.remoteTextTracks(),(function(e){return{kind:e.kind,label:e.label,language:e.language,src:e.src}}))};return e&&(t.poster=e,t.artwork=[{src:t.poster,type:Ai(t.poster)}]),t}return $(this.cache_.media)},a.getTagSettings=function(e){var t={sources:[],tracks:[]},n=T(e),i=n["data-setup"];if(m(e,"vjs-fill")&&(n.fill=!0),m(e,"vjs-fluid")&&(n.fluid=!0),null!==i){var a=en(i||"{}"),s=a[0],o=a[1];s&&Ke.error(s),r(n,o)}if(r(t,n),e.hasChildNodes())for(var u=e.childNodes,l=0,c=u.length;l<c;l++){var d=u[l],h=d.nodeName.toLowerCase();"source"===h?t.sources.push(T(d)):"track"===h&&t.tracks.push(T(d))}return t},s.flexNotSupported_=function(){var e=t.createElement("i");return!("flexBasis"in e.style||"webkitFlexBasis"in e.style||"mozFlexBasis"in e.style||"msFlexBasis"in e.style||"msFlexOrder"in e.style)},a}(wt);ii.names.forEach((function(e){var t=ii[e];us.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}})),us.players={};var ls=e.navigator;us.prototype.options_={techOrder:_i.defaultTechOrder_,html5:{},flash:{},inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:ls&&(ls.languages&&ls.languages[0]||ls.userLanguage||ls.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1},["ended","seeking","seekable","networkState","readyState"].forEach((function(e){us.prototype[e]=function(){return this.techGet_(e)}})),rs.forEach((function(e){us.prototype["handleTech"+kt(e)+"_"]=function(){return this.trigger(e)}})),wt.registerComponent("Player",us);var cs={},ds=function(e){return cs.hasOwnProperty(e)},hs=function(e){return ds(e)?cs[e]:void 0},fs=function(e,t){e.activePlugins_=e.activePlugins_||{},e.activePlugins_[t]=!0},ps=function(e,t,n){var r=(n?"before":"")+"pluginsetup";e.trigger(r,t),e.trigger(r+":"+t.name,t)},vs=function(e,t){return t.prototype.name=e,function(){ps(this,{name:e,plugin:t,instance:null},!0);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];var a=Q(t,[this].concat(r));return this[e]=function(){return a},ps(this,a.getEventHash()),a}},ms=function(){function e(t){if(this.constructor===e)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=t,K(this),delete this.trigger,q(this,this.constructor.defaultState),fs(t,this.name),this.dispose=dt(this,this.dispose),t.on("dispose",this.dispose)}var t=e.prototype;return t.version=function(){return this.constructor.VERSION},t.getEventHash=function(e){return void 0===e&&(e={}),e.name=this.name,e.plugin=this.constructor,e.instance=this,e},t.trigger=function(e,t){return void 0===t&&(t={}),V(this.eventBusEl_,e,this.getEventHash(t))},t.handleStateChanged=function(e){},t.dispose=function(){var e=this.name,t=this.player;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t.activePlugins_[e]=!1,this.player=this.state=null,t[e]=vs(e,cs[e])},e.isBasic=function(t){var n="string"==typeof t?hs(t):t;return"function"==typeof n&&!e.prototype.isPrototypeOf(n.prototype)},e.registerPlugin=function(t,n){if("string"!=typeof t)throw new Error('Illegal plugin name, "'+t+'", must be a string, was '+typeof t+".");if(ds(t))Ke.warn('A plugin named "'+t+'" already exists. You may want to avoid re-registering plugins!');else if(us.prototype.hasOwnProperty(t))throw new Error('Illegal plugin name, "'+t+'", cannot share a name with an existing player method!');if("function"!=typeof n)throw new Error('Illegal plugin for "'+t+'", must be a function, was '+typeof n+".");return cs[t]=n,"plugin"!==t&&(e.isBasic(n)?us.prototype[t]=function(e,t){var n=function(){ps(this,{name:e,plugin:t,instance:null},!0);var n=t.apply(this,arguments);return fs(this,e),ps(this,{name:e,plugin:t,instance:n}),n};return Object.keys(t).forEach((function(e){n[e]=t[e]})),n}(t,n):us.prototype[t]=vs(t,n)),n},e.deregisterPlugin=function(e){if("plugin"===e)throw new Error("Cannot de-register base plugin.");ds(e)&&(delete cs[e],delete us.prototype[e])},e.getPlugins=function(e){var t;return void 0===e&&(e=Object.keys(cs)),e.forEach((function(e){var n=hs(e);n&&((t=t||{})[e]=n)})),t},e.getPluginVersion=function(e){var t=hs(e);return t&&t.VERSION||""},e}();ms.getPlugin=hs,ms.BASE_PLUGIN_NAME="plugin",ms.registerPlugin("plugin",ms),us.prototype.usingPlugin=function(e){return!!this.activePlugins_&&!0===this.activePlugins_[e]},us.prototype.hasPlugin=function(e){return!!ds(e)};var gs=function(e){return 0===e.indexOf("#")?e.slice(1):e};if(Me.hooks_={},Me.hooks=function(e,t){return Me.hooks_[e]=Me.hooks_[e]||[],t&&(Me.hooks_[e]=Me.hooks_[e].concat(t)),Me.hooks_[e]},Me.hook=function(e,t){Me.hooks(e,t)},Me.hookOnce=function(e,t){Me.hooks(e,[].concat(t).map((function(t){return function n(){return Me.removeHook(e,n),t.apply(void 0,arguments)}})))},Me.removeHook=function(e,t){var n=Me.hooks(e).indexOf(t);return!(n<=-1||(Me.hooks_[e]=Me.hooks_[e].slice(),Me.hooks_[e].splice(n,1),0))},!0!==e.VIDEOJS_NO_DYNAMIC_STYLE&&l()){var ys=Xe(".vjs-styles-defaults");if(!ys){ys=ut("vjs-styles-defaults");var _s=Xe("head");_s&&_s.insertBefore(ys,_s.firstChild),lt(ys,"\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid {\n padding-top: 56.25%\n }\n ")}}W(1,Me),Me.VERSION=He,Me.options=us.prototype.options_,Me.getPlayers=function(){return us.players},Me.getPlayer=function(e){var t,n=us.players;if("string"==typeof e){var r=gs(e),i=n[r];if(i)return i;t=Xe("#"+r)}else t=e;if(c(t)){var a=t,s=a.player,o=a.playerId;if(s||n[o])return s||n[o]}},Me.getAllPlayers=function(){return Object.keys(us.players).map((function(e){return us.players[e]})).filter(Boolean)},Me.players=us.players,Me.getComponent=wt.getComponent,Me.registerComponent=function(e,t){_i.isTech(t)&&Ke.warn("The "+e+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),wt.registerComponent.call(wt,e,t)},Me.getTech=_i.getTech,Me.registerTech=_i.registerTech,Me.use=function(e,t){bi[e]=bi[e]||[],bi[e].push(t)},Object.defineProperty(Me,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(Me.middleware,"TERMINATOR",{value:Si,writeable:!1,enumerable:!0}),Me.browser=qt,Me.TOUCH_ENABLED=Kt,Me.extend=function(e,t){void 0===t&&(t={});var n=function(){e.apply(this,arguments)},r={};for(var i in"object"==typeof t?(t.constructor!==Object.prototype.constructor&&(n=t.constructor),r=t):"function"==typeof t&&(n=t),function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.super_=t)}(n,e),r)r.hasOwnProperty(i)&&(n.prototype[i]=r[i]);return n},Me.mergeOptions=$,Me.bind=dt,Me.registerPlugin=ms.registerPlugin,Me.deregisterPlugin=ms.deregisterPlugin,Me.plugin=function(e,t){return Ke.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),ms.registerPlugin(e,t)},Me.getPlugins=ms.getPlugins,Me.getPlugin=ms.getPlugin,Me.getPluginVersion=ms.getPluginVersion,Me.addLanguage=function(e,t){var n;return e=(""+e).toLowerCase(),Me.options.languages=$(Me.options.languages,((n={})[e]=t,n)),Me.options.languages[e]},Me.log=Ke,Me.createLogger=qe,Me.createTimeRange=Me.createTimeRanges=ne,Me.formatTime=De,Me.setFormatTime=function(e){Fi=e},Me.resetFormatTime=function(){Fi=Bi},Me.parseUrl=En,Me.isCrossOrigin=Cn,Me.EventTarget=ft,Me.on=N,Me.one=H,Me.off=G,Me.trigger=V,Me.xhr=Yr,Me.TextTrack=Qr,Me.AudioTrack=Zr,Me.VideoTrack=ei,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach((function(e){Me[e]=function(){return Ke.warn("videojs."+e+"() is deprecated; use videojs.dom."+e+"() instead"),Qe[e].apply(null,arguments)}})),Me.computedStyle=s,Me.dom=Qe,Me.url=An;var bs,Ts,Ss,Es,ks,ws=oe((function(e,t){!function(t){var n=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/\?#]*\/)*.*?)??(;.*?)?(\?.*?)?(#.*?)?$/,r=/^([^\/?#]*)(.*)$/,i=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g,s={buildAbsoluteURL:function(e,t,n){if(n=n||{},e=e.trim(),!(t=t.trim())){if(!n.alwaysNormalize)return e;var i=s.parseURL(e);if(!i)throw new Error("Error trying to parse base URL.");return i.path=s.normalizePath(i.path),s.buildURLFromParts(i)}var a=s.parseURL(t);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return n.alwaysNormalize?(a.path=s.normalizePath(a.path),s.buildURLFromParts(a)):t;var o=s.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&"/"!==o.path[0]){var u=r.exec(o.path);o.netLoc=u[1],o.path=u[2]}o.netLoc&&!o.path&&(o.path="/");var l={scheme:o.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(l.netLoc=o.netLoc,"/"!==a.path[0]))if(a.path){var c=o.path,d=c.substring(0,c.lastIndexOf("/")+1)+a.path;l.path=s.normalizePath(d)}else l.path=o.path,a.params||(l.params=o.params,a.query||(l.query=o.query));return null===l.path&&(l.path=n.alwaysNormalize?s.normalizePath(a.path):a.path),s.buildURLFromParts(l)},parseURL:function(e){var t=n.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(i,"");e.length!==(e=e.replace(a,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}};e.exports=s}()})),Cs=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var n=this.listeners[e].indexOf(t);return this.listeners[e].splice(n,1),n>-1},t.trigger=function(e){var t,n,r,i=this.listeners[e];if(i)if(2===arguments.length)for(n=i.length,t=0;t<n;++t)i[t].call(this,arguments[1]);else for(r=Array.prototype.slice.call(arguments,1),n=i.length,t=0;t<n;++t)i[t].apply(this,r)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",(function(t){e.push(t)}))},e}(),As=function(e){function t(){var t;return(t=e.call(this)||this).buffer="",t}return Ue(t,e),t.prototype.push=function(e){var t;for(this.buffer+=e,t=this.buffer.indexOf("\n");t>-1;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)},t}(Cs),Ls=function(e){for(var t,n=e.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')),r={},i=n.length;i--;)""!==n[i]&&((t=/([^=]*)=(.*)/.exec(n[i]).slice(1))[0]=t[0].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^['"](.*)['"]$/g,"$1"),r[t[0]]=t[1]);return r},Rs=function(e){function t(){var t;return(t=e.call(this)||this).customParsers=[],t.tagMappers=[],t}Ue(t,e);var n=t.prototype;return n.push=function(e){var t,n,r=this;if(0!==(e=e.trim()).length){if("#"!==e[0])return void this.trigger("data",{type:"uri",uri:e});this.tagMappers.reduce((function(t,n){var r=n(e);return r===e?t:t.concat([r])}),[e]).forEach((function(e){for(var i=0;i<r.customParsers.length;i++)if(r.customParsers[i].call(r,e))return;if(0===e.indexOf("#EXT"))if(e=e.replace("\r",""),t=/^#EXTM3U/.exec(e))r.trigger("data",{type:"tag",tagType:"m3u"});else{if(t=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(e))return n={type:"tag",tagType:"inf"},t[1]&&(n.duration=parseFloat(t[1])),t[2]&&(n.title=t[2]),void r.trigger("data",n);if(t=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(e))return n={type:"tag",tagType:"targetduration"},t[1]&&(n.duration=parseInt(t[1],10)),void r.trigger("data",n);if(t=/^#ZEN-TOTAL-DURATION:?([0-9.]*)?/.exec(e))return n={type:"tag",tagType:"totalduration"},t[1]&&(n.duration=parseInt(t[1],10)),void r.trigger("data",n);if(t=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(e))return n={type:"tag",tagType:"version"},t[1]&&(n.version=parseInt(t[1],10)),void r.trigger("data",n);if(t=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(e))return n={type:"tag",tagType:"media-sequence"},t[1]&&(n.number=parseInt(t[1],10)),void r.trigger("data",n);if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(e))return n={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(n.number=parseInt(t[1],10)),void r.trigger("data",n);if(t=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(e))return n={type:"tag",tagType:"playlist-type"},t[1]&&(n.playlistType=t[1]),void r.trigger("data",n);if(t=/^#EXT-X-BYTERANGE:?([0-9.]*)?@?([0-9.]*)?/.exec(e))return n={type:"tag",tagType:"byterange"},t[1]&&(n.length=parseInt(t[1],10)),t[2]&&(n.offset=parseInt(t[2],10)),void r.trigger("data",n);if(t=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(e))return n={type:"tag",tagType:"allow-cache"},t[1]&&(n.allowed=!/NO/.test(t[1])),void r.trigger("data",n);if(t=/^#EXT-X-MAP:?(.*)$/.exec(e)){if(n={type:"tag",tagType:"map"},t[1]){var a=Ls(t[1]);if(a.URI&&(n.uri=a.URI),a.BYTERANGE){var s=a.BYTERANGE.split("@"),o=s[0],u=s[1];n.byterange={},o&&(n.byterange.length=parseInt(o,10)),u&&(n.byterange.offset=parseInt(u,10))}}r.trigger("data",n)}else{if(!(t=/^#EXT-X-STREAM-INF:?(.*)$/.exec(e)))return(t=/^#EXT-X-MEDIA:?(.*)$/.exec(e))?(n={type:"tag",tagType:"media"},t[1]&&(n.attributes=Ls(t[1])),void r.trigger("data",n)):(t=/^#EXT-X-ENDLIST/.exec(e))?void r.trigger("data",{type:"tag",tagType:"endlist"}):(t=/^#EXT-X-DISCONTINUITY/.exec(e))?void r.trigger("data",{type:"tag",tagType:"discontinuity"}):(t=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(e))?(n={type:"tag",tagType:"program-date-time"},t[1]&&(n.dateTimeString=t[1],n.dateTimeObject=new Date(t[1])),void r.trigger("data",n)):(t=/^#EXT-X-KEY:?(.*)$/.exec(e))?(n={type:"tag",tagType:"key"},t[1]&&(n.attributes=Ls(t[1]),n.attributes.IV&&("0x"===n.attributes.IV.substring(0,2).toLowerCase()&&(n.attributes.IV=n.attributes.IV.substring(2)),n.attributes.IV=n.attributes.IV.match(/.{8}/g),n.attributes.IV[0]=parseInt(n.attributes.IV[0],16),n.attributes.IV[1]=parseInt(n.attributes.IV[1],16),n.attributes.IV[2]=parseInt(n.attributes.IV[2],16),n.attributes.IV[3]=parseInt(n.attributes.IV[3],16),n.attributes.IV=new Uint32Array(n.attributes.IV))),void r.trigger("data",n)):(t=/^#EXT-X-START:?(.*)$/.exec(e))?(n={type:"tag",tagType:"start"},t[1]&&(n.attributes=Ls(t[1]),n.attributes["TIME-OFFSET"]=parseFloat(n.attributes["TIME-OFFSET"]),n.attributes.PRECISE=/YES/.test(n.attributes.PRECISE)),void r.trigger("data",n)):(t=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(e))?(n={type:"tag",tagType:"cue-out-cont"},t[1]?n.data=t[1]:n.data="",void r.trigger("data",n)):(t=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(e))?(n={type:"tag",tagType:"cue-out"},t[1]?n.data=t[1]:n.data="",void r.trigger("data",n)):(t=/^#EXT-X-CUE-IN:?(.*)?$/.exec(e))?(n={type:"tag",tagType:"cue-in"},t[1]?n.data=t[1]:n.data="",void r.trigger("data",n)):void r.trigger("data",{type:"tag",data:e.slice(4)});if(n={type:"tag",tagType:"stream-inf"},t[1]){if(n.attributes=Ls(t[1]),n.attributes.RESOLUTION){var l=n.attributes.RESOLUTION.split("x"),c={};l[0]&&(c.width=parseInt(l[0],10)),l[1]&&(c.height=parseInt(l[1],10)),n.attributes.RESOLUTION=c}n.attributes.BANDWIDTH&&(n.attributes.BANDWIDTH=parseInt(n.attributes.BANDWIDTH,10)),n.attributes["PROGRAM-ID"]&&(n.attributes["PROGRAM-ID"]=parseInt(n.attributes["PROGRAM-ID"],10))}r.trigger("data",n)}}else r.trigger("data",{type:"comment",text:e.slice(1)})}))}},n.addParser=function(e){var t=this,n=e.expression,r=e.customType,i=e.dataParser,a=e.segment;"function"!=typeof i&&(i=function(e){return e}),this.customParsers.push((function(e){if(n.exec(e))return t.trigger("data",{type:"custom",data:i(e),customType:r,segment:a}),!0}))},n.addTagMapper=function(e){var t=e.expression,n=e.map;this.tagMappers.push((function(e){return t.test(e)?n(e):e}))},t}(Cs),xs=function(e){function t(){var t;(t=e.call(this)||this).lineStream=new As,t.parseStream=new Rs,t.lineStream.pipe(t.parseStream);var n,r,i=Be(Be(t)),a=[],s={},o=function(){},u={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},l=0;return t.manifest={allowCache:!0,discontinuityStarts:[],segments:[]},t.parseStream.on("data",(function(e){var t,c;({tag:function(){({"allow-cache":function(){this.manifest.allowCache=e.allowed,"allowed"in e||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange:function(){var t={};"length"in e&&(s.byterange=t,t.length=e.length,"offset"in e||(this.trigger("info",{message:"defaulting offset to zero"}),e.offset=0)),"offset"in e&&(s.byterange=t,t.offset=e.offset)},endlist:function(){this.manifest.endList=!0},inf:function(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),e.duration>0&&(s.duration=e.duration),0===e.duration&&(s.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=a},key:function(){return e.attributes?"NONE"===e.attributes.METHOD?void(r=null):e.attributes.URI?(e.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),r={method:e.attributes.METHOD||"AES-128",uri:e.attributes.URI},void(void 0!==e.attributes.IV&&(r.iv=e.attributes.IV))):void this.trigger("warn",{message:"ignoring key declaration without URI"}):void this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence":function(){isFinite(e.number)?this.manifest.mediaSequence=e.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+e.number})},"discontinuity-sequence":function(){isFinite(e.number)?(this.manifest.discontinuitySequence=e.number,l=e.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+e.number})},"playlist-type":function(){/VOD|EVENT/.test(e.playlistType)?this.manifest.playlistType=e.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+e.playlist})},map:function(){n={},e.uri&&(n.uri=e.uri),e.byterange&&(n.byterange=e.byterange)},"stream-inf":function(){this.manifest.playlists=a,this.manifest.mediaGroups=this.manifest.mediaGroups||u,e.attributes?(s.attributes||(s.attributes={}),je(s.attributes,e.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||u,e.attributes&&e.attributes.TYPE&&e.attributes["GROUP-ID"]&&e.attributes.NAME){var n=this.manifest.mediaGroups[e.attributes.TYPE];n[e.attributes["GROUP-ID"]]=n[e.attributes["GROUP-ID"]]||{},t=n[e.attributes["GROUP-ID"]],(c={default:/yes/i.test(e.attributes.DEFAULT)}).default?c.autoselect=!0:c.autoselect=/yes/i.test(e.attributes.AUTOSELECT),e.attributes.LANGUAGE&&(c.language=e.attributes.LANGUAGE),e.attributes.URI&&(c.uri=e.attributes.URI),e.attributes["INSTREAM-ID"]&&(c.instreamId=e.attributes["INSTREAM-ID"]),e.attributes.CHARACTERISTICS&&(c.characteristics=e.attributes.CHARACTERISTICS),e.attributes.FORCED&&(c.forced=/yes/i.test(e.attributes.FORCED)),t[e.attributes.NAME]=c}else this.trigger("warn",{message:"ignoring incomplete or missing media group"})},discontinuity:function(){l+=1,s.discontinuity=!0,this.manifest.discontinuityStarts.push(a.length)},"program-date-time":function(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=e.dateTimeString,this.manifest.dateTimeObject=e.dateTimeObject),s.dateTimeString=e.dateTimeString,s.dateTimeObject=e.dateTimeObject},targetduration:function(){!isFinite(e.duration)||e.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+e.duration}):this.manifest.targetDuration=e.duration},totalduration:function(){!isFinite(e.duration)||e.duration<0?this.trigger("warn",{message:"ignoring invalid total duration: "+e.duration}):this.manifest.totalDuration=e.duration},start:function(){e.attributes&&!isNaN(e.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:e.attributes["TIME-OFFSET"],precise:e.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out":function(){s.cueOut=e.data},"cue-out-cont":function(){s.cueOutCont=e.data},"cue-in":function(){s.cueIn=e.data}}[e.tagType]||o).call(i)},uri:function(){s.uri=e.uri,a.push(s),!this.manifest.targetDuration||"duration"in s||(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),s.duration=this.manifest.targetDuration),r&&(s.key=r),s.timeline=l,n&&(s.map=n),s={}},comment:function(){},custom:function(){e.segment?(s.custom=s.custom||{},s.custom[e.customType]=e.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[e.customType]=e.data)}})[e.type].call(i)})),t}Ue(t,e);var n=t.prototype;return n.push=function(e){this.lineStream.push(e)},n.end=function(){this.lineStream.push("\n")},n.addParser=function(e){this.parseStream.addParser(e)},n.addTagMapper=function(e){this.parseStream.addTagMapper(e)},t}(Cs),Is=function(e){return!!e&&"object"==typeof e},Os=function e(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return n.reduce((function(t,n){return Object.keys(n).forEach((function(r){Array.isArray(t[r])&&Array.isArray(n[r])?t[r]=t[r].concat(n[r]):Is(t[r])&&Is(n[r])?t[r]=e(t[r],n[r]):t[r]=n[r]})),t}),{})},Ds=function(e){return e.reduce((function(e,t){return e.concat(t)}),[])},Ps=function(e){if(!e.length)return[];for(var t=[],n=0;n<e.length;n++)t.push(e[n]);return t},Ms="INVALID_NUMBER_OF_PERIOD",js="DASH_EMPTY_MANIFEST",Us="DASH_INVALID_XML",Bs="NO_BASE_URL",Fs="SEGMENT_TIME_UNSPECIFIED",Ns="UNSUPPORTED_UTC_TIMING_SCHEME",Gs=function(e,t){return function(e,t){!function(t){var n=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/\?#]*\/)*.*?)??(;.*?)?(\?.*?)?(#.*?)?$/,r=/^([^\/?#]*)(.*)$/,i=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g,s={buildAbsoluteURL:function(e,t,n){if(n=n||{},e=e.trim(),!(t=t.trim())){if(!n.alwaysNormalize)return e;var i=s.parseURL(e);if(!i)throw new Error("Error trying to parse base URL.");return i.path=s.normalizePath(i.path),s.buildURLFromParts(i)}var a=s.parseURL(t);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return n.alwaysNormalize?(a.path=s.normalizePath(a.path),s.buildURLFromParts(a)):t;var o=s.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&"/"!==o.path[0]){var u=r.exec(o.path);o.netLoc=u[1],o.path=u[2]}o.netLoc&&!o.path&&(o.path="/");var l={scheme:o.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(l.netLoc=o.netLoc,"/"!==a.path[0]))if(a.path){var c=o.path,d=c.substring(0,c.lastIndexOf("/")+1)+a.path;l.path=s.normalizePath(d)}else l.path=o.path,a.params||(l.params=o.params,a.query||(l.query=o.query));return null===l.path&&(l.path=n.alwaysNormalize?s.normalizePath(a.path):a.path),s.buildURLFromParts(l)},parseURL:function(e){var t=n.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(i,"");e.length!==(e=e.replace(a,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}};e.exports=s}()}(t={exports:{}}),t.exports}(),Vs=function(t,n){return/^[a-z]+:/i.test(n)?n:(/\/\//i.test(t)||(t=Gs.buildAbsoluteURL(e.location.href,t)),Gs.buildAbsoluteURL(t,n))},Hs=function(e){var t=e.baseUrl,n=void 0===t?"":t,r=e.source,i=void 0===r?"":r,a=e.range,s=void 0===a?"":a,o=e.indexRange,u=void 0===o?"":o,l={uri:i,resolvedUri:Vs(n||"",i)};if(s||u){var c=(s||u).split("-"),d=parseInt(c[0],10),h=parseInt(c[1],10);l.byterange={length:h-d+1,offset:d}}return l},zs=function(e){var t=e.offset+e.length-1;return e.offset+"-"+t},Ws={static:function(e){var t=e.duration,n=e.timescale,r=void 0===n?1:n,i=e.sourceDuration;return{start:0,end:Math.ceil(i/(t/r))}},dynamic:function(e){var t=e.NOW,n=e.clientOffset,r=e.availabilityStartTime,i=e.timescale,a=void 0===i?1:i,s=e.duration,o=e.start,u=void 0===o?0:o,l=e.minimumUpdatePeriod,c=void 0===l?0:l,d=e.timeShiftBufferDepth,h=void 0===d?1/0:d,f=(t+n)/1e3,p=r+u,v=f+c-p,m=Math.ceil(v*a/s),g=Math.floor((f-p-h)*a/s),y=Math.floor((f-p)*a/s);return{start:Math.max(0,g),end:Math.min(m,y)}}},Ks=function(e){var t=e.type,n=void 0===t?"static":t,r=e.duration,i=e.timescale,a=void 0===i?1:i,s=e.sourceDuration,o=Ws[n](e),u=function(e,t){for(var n=[],r=e;r<t;r++)n.push(r);return n}(o.start,o.end).map(function(e){return function(t,n){var r=e.duration,i=e.timescale,a=void 0===i?1:i,s=e.periodIndex,o=e.startNumber;return{number:(void 0===o?1:o)+t,duration:r/a,timeline:s,time:n*r}}}(e));if("static"===n){var l=u.length-1;u[l].duration=s-r/a*l}return u},qs=function(e){var t=e.baseUrl,n=e.initialization,r=void 0===n?{}:n,i=e.sourceDuration,a=e.timescale,s=void 0===a?1:a,o=e.indexRange,u=void 0===o?"":o,l=e.duration;if(!t)throw new Error(Bs);var c=Hs({baseUrl:t,source:r.sourceURL,range:r.range}),d=Hs({baseUrl:t,source:t,indexRange:u});if(d.map=c,l){var h=Ks(e);h.length&&(d.duration=h[0].duration,d.timeline=h[0].timeline)}else i&&(d.duration=i/s,d.timeline=0);return d.number=0,[d]},$s=function(e,t,n){for(var r=e.sidx.map?e.sidx.map:null,i=e.sidx.duration,a=e.timeline||0,s=e.sidx.byterange,o=s.offset+s.length,u=t.timescale,l=t.references.filter((function(e){return 1!==e.referenceType})),c=[],d=o+t.firstOffset,h=0;h<l.length;h++){var f=t.references[h],p=f.referencedSize,v=f.subsegmentDuration,m=qs({baseUrl:n,timescale:u,timeline:a,periodIndex:a,duration:v,sourceDuration:i,indexRange:d+"-"+(d+p-1)})[0];r&&(m.map=r),c.push(m),d+=p}return e.segments=c,e},Ys=function(e){return function(e){return Object.keys(e).map((function(t){return e[t]}))}(e.reduce((function(e,t){var n,r=t.attributes.id+(t.attributes.lang||"");e[r]?(t.segments[0]&&(t.segments[0].discontinuity=!0),(n=e[r].segments).push.apply(n,t.segments),t.attributes.contentProtection&&(e[r].attributes.contentProtection=t.attributes.contentProtection)):e[r]=t;return e}),{})).map((function(e){return e.discontinuityStarts=function(e,t){return e.reduce((function(e,n,r){return n[t]&&e.push(r),e}),[])}(e.segments,"discontinuity"),e}))},Xs=function(e,t){if(void 0===t&&(t={}),!Object.keys(t).length)return e;for(var n in e){var r=e[n];if(r.sidx){var i=r.sidx.uri+"-"+zs(r.sidx.byterange),a=t[i]&&t[i].sidx;r.sidx&&a&&$s(r,a,r.sidx.resolvedUri)}}return e},Js=function(e){var t,n=e.attributes,r=e.segments,i=e.sidx,a={attributes:(t={NAME:n.id,BANDWIDTH:n.bandwidth,CODECS:n.codecs},t["PROGRAM-ID"]=1,t),uri:"",endList:"static"===(n.type||"static"),timeline:n.periodIndex,resolvedUri:"",targetDuration:n.duration,segments:r,mediaSequence:r.length?r[0].number:1};return n.contentProtection&&(a.contentProtection=n.contentProtection),i&&(a.sidx=i),a},Qs=function(e){var t,n=e.attributes,r=e.segments;return void 0===r&&(r=[{uri:n.baseUrl,timeline:n.periodIndex,resolvedUri:n.baseUrl||"",duration:n.sourceDuration,number:0}],n.duration=n.sourceDuration),{attributes:(t={NAME:n.id,BANDWIDTH:n.bandwidth},t["PROGRAM-ID"]=1,t),uri:"",endList:"static"===(n.type||"static"),timeline:n.periodIndex,resolvedUri:n.baseUrl||"",targetDuration:n.duration,segments:r,mediaSequence:r.length?r[0].number:1}},Zs=function(e){var t,n=e.attributes,r=e.segments,i=e.sidx,a={attributes:(t={NAME:n.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:n.width,height:n.height},CODECS:n.codecs,BANDWIDTH:n.bandwidth},t["PROGRAM-ID"]=1,t),uri:"",endList:"static"===(n.type||"static"),timeline:n.periodIndex,resolvedUri:"",targetDuration:n.duration,segments:r,mediaSequence:r.length?r[0].number:1};return n.contentProtection&&(a.contentProtection=n.contentProtection),i&&(a.sidx=i),a},eo=function(e,t){var n;if(void 0===t&&(t={}),!e.length)return{};var r=e[0].attributes,i=r.sourceDuration,a=r.minimumUpdatePeriod,s=void 0===a?0:a,o=Ys(e.filter((function(e){var t=e.attributes;return"video/mp4"===t.mimeType||"video"===t.contentType}))).map(Zs),u=Ys(e.filter((function(e){var t=e.attributes;return"audio/mp4"===t.mimeType||"audio"===t.contentType}))),l=e.filter((function(e){var t=e.attributes;return"text/vtt"===t.mimeType||"text"===t.contentType})),c={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(n={AUDIO:{},VIDEO:{}},n["CLOSED-CAPTIONS"]={},n.SUBTITLES={},n),uri:"",duration:i,playlists:Xs(o,t),minimumUpdatePeriod:1e3*s};return u.length&&(c.mediaGroups.AUDIO.audio=function(e,t){void 0===t&&(t={});var n,r=e.reduce((function(e,r){var i=r.attributes.role&&r.attributes.role.value||"",a=r.attributes.lang||"",s="main";if(a){var o=i?" ("+i+")":"";s=""+r.attributes.lang+o}return e[s]&&e[s].playlists[0].attributes.BANDWIDTH>r.attributes.bandwidth||(e[s]={language:a,autoselect:!0,default:"main"===i,playlists:Xs([Js(r)],t),uri:""},void 0===n&&"main"===i&&((n=r).default=!0)),e}),{});return n||(r[Object.keys(r)[0]].default=!0),r}(u,t)),l.length&&(c.mediaGroups.SUBTITLES.subs=function(e,t){return void 0===t&&(t={}),e.reduce((function(e,n){var r=n.attributes.lang||"text";return e[r]||(e[r]={language:r,default:!1,autoselect:!1,playlists:Xs([Qs(n)],t),uri:""}),e}),{})}(l,t)),c},to=function(e,t,n){var r=e.NOW,i=e.clientOffset,a=e.availabilityStartTime,s=e.timescale,o=void 0===s?1:s,u=e.start,l=void 0===u?0:u,c=e.minimumUpdatePeriod,d=(r+i)/1e3+(void 0===c?0:c)-(a+l);return Math.ceil((d*o-t)/n)},no=function(e,t){for(var n=e.type,r=void 0===n?"static":n,i=e.minimumUpdatePeriod,a=void 0===i?0:i,s=e.media,o=void 0===s?"":s,u=e.sourceDuration,l=e.timescale,c=void 0===l?1:l,d=e.startNumber,h=void 0===d?1:d,f=e.periodIndex,p=[],v=-1,m=0;m<t.length;m++){var g=t[m],y=g.d,_=g.r||0,b=g.t||0;v<0&&(v=b),b&&b>v&&(v=b);var T=void 0;if(_<0){var S=m+1;T=S===t.length?"dynamic"===r&&a>0&&o.indexOf("$Number$")>0?to(e,v,y):(u*c-v)/y:(t[S].t-v)/y}else T=_+1;for(var E=h+p.length+T,k=h+p.length;k<E;)p.push({number:k,duration:y/c,time:v,timeline:f}),v+=y,k++}return p},ro=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,io=function(e,t){return e.replace(ro,function(e){return function(t,n,r,i){if("$$"===t)return"$";if(void 0===e[n])return t;var a=""+e[n];return"RepresentationID"===n?a:(i=r?parseInt(i,10):1,a.length>=i?a:""+new Array(i-a.length+1).join("0")+a)}}(t))},ao=function(e,t){var n={RepresentationID:e.id,Bandwidth:e.bandwidth||0},r=e.initialization,i=void 0===r?{sourceURL:"",range:""}:r,a=Hs({baseUrl:e.baseUrl,source:io(i.sourceURL,n),range:i.range});return function(e,t){return e.duration||t?e.duration?Ks(e):no(e,t):[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodIndex}]}(e,t).map((function(t){n.Number=t.number,n.Time=t.time;var r=io(e.media||"",n);return{uri:r,timeline:t.timeline,duration:t.duration,resolvedUri:Vs(e.baseUrl||"",r),map:a,number:t.number}}))},so=function(e,t){var n=e.duration,r=e.segmentUrls,i=void 0===r?[]:r;if(!n&&!t||n&&t)throw new Error(Fs);var a,s=i.map((function(t){return function(e,t){var n=e.baseUrl,r=e.initialization,i=void 0===r?{}:r,a=Hs({baseUrl:n,source:i.sourceURL,range:i.range}),s=Hs({baseUrl:n,source:t.media,range:t.mediaRange});return s.map=a,s}(e,t)}));return n&&(a=Ks(e)),t&&(a=no(e,t)),a.map((function(e,t){if(s[t]){var n=s[t];return n.timeline=e.timeline,n.duration=e.duration,n.number=e.number,n}})).filter((function(e){return e}))},oo=function(e){var t,n,r=e.attributes,i=e.segmentInfo;i.template?(n=ao,t=Os(r,i.template)):i.base?(n=qs,t=Os(r,i.base)):i.list&&(n=so,t=Os(r,i.list));var a={attributes:r};if(!n)return a;var s=n(t,i.timeline);if(t.duration){var o=t,u=o.duration,l=o.timescale,c=void 0===l?1:l;t.duration=u/c}else s.length?t.duration=s.reduce((function(e,t){return Math.max(e,Math.ceil(t.duration))}),0):t.duration=0;return a.attributes=t,a.segments=s,i.base&&t.indexRange&&(a.sidx=s[0],a.segments=[]),a},uo=function(e,t){return Ps(e.childNodes).filter((function(e){return e.tagName===t}))},lo=function(e){return e.textContent.trim()},co=function(e){var t=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e);if(!t)return 0;var n=t.slice(1),r=n[0],i=n[1],a=n[2],s=n[3],o=n[4],u=n[5];return 31536e3*parseFloat(r||0)+2592e3*parseFloat(i||0)+86400*parseFloat(a||0)+3600*parseFloat(s||0)+60*parseFloat(o||0)+parseFloat(u||0)},ho={mediaPresentationDuration:function(e){return co(e)},availabilityStartTime:function(e){return function(e){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(e)&&(e+="Z"),Date.parse(e)}(e)/1e3},minimumUpdatePeriod:function(e){return co(e)},timeShiftBufferDepth:function(e){return co(e)},start:function(e){return co(e)},width:function(e){return parseInt(e,10)},height:function(e){return parseInt(e,10)},bandwidth:function(e){return parseInt(e,10)},startNumber:function(e){return parseInt(e,10)},timescale:function(e){return parseInt(e,10)},duration:function(e){var t=parseInt(e,10);return isNaN(t)?co(e):t},d:function(e){return parseInt(e,10)},t:function(e){return parseInt(e,10)},r:function(e){return parseInt(e,10)},DEFAULT:function(e){return e}},fo=function(e){return e&&e.attributes?Ps(e.attributes).reduce((function(e,t){var n=ho[t.name]||ho.DEFAULT;return e[t.name]=n(t.value),e}),{}):{}},po={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"},vo=function(e,t){return t.length?Ds(e.map((function(e){return t.map((function(t){return Vs(e,lo(t))}))}))):e},mo=function(e){var t=uo(e,"SegmentTemplate")[0],n=uo(e,"SegmentList")[0],r=n&&uo(n,"SegmentURL").map((function(e){return Os({tag:"SegmentURL"},fo(e))})),i=uo(e,"SegmentBase")[0],a=n||t,s=a&&uo(a,"SegmentTimeline")[0],o=n||i||t,u=o&&uo(o,"Initialization")[0],l=t&&fo(t);l&&u?l.initialization=u&&fo(u):l&&l.initialization&&(l.initialization={sourceURL:l.initialization});var c={template:l,timeline:s&&uo(s,"S").map((function(e){return fo(e)})),list:n&&Os(fo(n),{segmentUrls:r,initialization:fo(u)}),base:i&&Os(fo(i),{initialization:fo(u)})};return Object.keys(c).forEach((function(e){c[e]||delete c[e]})),c},go=function(e,t,n){return function(r){var i=fo(r),a=vo(t,uo(r,"BaseURL")),s=uo(r,"Role")[0],o={role:fo(s)},u=Os(e,i,o),l=function(e){return e.reduce((function(e,t){var n=fo(t),r=po[n.schemeIdUri];if(r){e[r]={attributes:n};var i=uo(t,"cenc:pssh")[0];if(i){var a=lo(i),s=a&&Fe(a);e[r].pssh=s}}return e}),{})}(uo(r,"ContentProtection"));Object.keys(l).length&&(u=Os(u,{contentProtection:l}));var c=mo(r),d=uo(r,"Representation"),h=Os(n,c);return Ds(d.map(function(e,t,n){return function(r){var i=uo(r,"BaseURL"),a=vo(t,i),s=Os(e,fo(r)),o=mo(r);return a.map((function(e){return{segmentInfo:Os(n,o),attributes:Os(s,{baseUrl:e})}}))}}(u,a,h)))}},yo=function(t,n){return function(r,i){var a=vo(n,uo(r,"BaseURL")),s=fo(r),o=parseInt(s.id,10),u=e.isNaN(o)?i:o,l=Os(t,{periodIndex:u}),c=uo(r,"AdaptationSet"),d=mo(r);return Ds(c.map(go(l,a,d)))}},_o=function(t){if(""===t)throw new Error(js);var n=(new e.DOMParser).parseFromString(t,"application/xml"),r=n&&"MPD"===n.documentElement.tagName?n.documentElement:null;if(!r||r&&r.getElementsByTagName("parsererror").length>0)throw new Error(Us);return r},bo=function(e,t){return void 0===t&&(t={}),eo(function(e){return e.map(oo)}(function(e,t){void 0===t&&(t={});var n=t,r=n.manifestUri,i=void 0===r?"":r,a=n.NOW,s=void 0===a?Date.now():a,o=n.clientOffset,u=void 0===o?0:o,l=uo(e,"Period");if(!l.length)throw new Error(Ms);var c=fo(e),d=vo([i],uo(e,"BaseURL"));return c.sourceDuration=c.mediaPresentationDuration||0,c.NOW=s,c.clientOffset=u,Ds(l.map(yo(c,d)))}(_o(e),t)),t.sidxMapping)},To=function(e){return function(e){var t=uo(e,"UTCTiming")[0];if(!t)return null;var n=fo(t);switch(n.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":n.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":n.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":n.method="DIRECT",n.value=Date.parse(n.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(Ns)}return n}(_o(e))},So=function(e){return e>>>0};Ss=function(e){return bs(e,["moov","trak"]).reduce((function(e,t){var n,r,i,a,s;return(n=bs(t,["tkhd"])[0])?(r=n[0],a=So(n[i=0===r?12:20]<<24|n[i+1]<<16|n[i+2]<<8|n[i+3]),(s=bs(t,["mdia","mdhd"])[0])?(i=0===(r=s[0])?12:20,e[a]=So(s[i]<<24|s[i+1]<<16|s[i+2]<<8|s[i+3]),e):null):null}),{})},Es=function(e,t){var n,r,i;return n=bs(t,["moof","traf"]),r=[].concat.apply([],n.map((function(t){return bs(t,["tfhd"]).map((function(n){var r,i;return r=So(n[4]<<24|n[5]<<16|n[6]<<8|n[7]),i=e[r]||9e4,(bs(t,["tfdt"]).map((function(e){var t,n;return t=e[0],n=So(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),1===t&&(n*=Math.pow(2,32),n+=So(e[8]<<24|e[9]<<16|e[10]<<8|e[11])),n}))[0]||1/0)/i}))}))),i=Math.min.apply(null,r),isFinite(i)?i:0},ks=function(e){var t=bs(e,["moov","trak"]),n=[];return t.forEach((function(e){var t=bs(e,["mdia","hdlr"]),r=bs(e,["tkhd"]);t.forEach((function(e,t){var i,a,s=Ts(e.subarray(8,12)),o=r[t];"vide"===s&&(a=0===(i=new DataView(o.buffer,o.byteOffset,o.byteLength)).getUint8(0)?i.getUint32(12):i.getUint32(20),n.push(a))}))})),n};var Eo,ko,wo,Co,Ao,Lo,Ro,xo,Io,Oo,Do,Po,Mo,jo,Uo,Bo,Fo,No,Go,Vo,Ho,zo,Wo,Ko,qo,$o,Yo,Xo,Jo,Qo,Zo,eu,tu,nu,ru,iu,au,su,ou={findBox:bs=function(e,t){var n,r,i,a,s,o=[];if(!t.length)return null;for(n=0;n<e.byteLength;)r=So(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3]),i=Ts(e.subarray(n+4,n+8)),a=r>1?n+r:e.byteLength,i===t[0]&&(1===t.length?o.push(e.subarray(n+8,a)):(s=bs(e.subarray(n+8,a),t.slice(1))).length&&(o=o.concat(s))),n=a;return o},parseType:Ts=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),(t+=String.fromCharCode(e[2]))+String.fromCharCode(e[3])},timescale:Ss,startTime:Es,videoTrackIds:ks},uu=ou.parseType,lu=function(e){return new Date(1e3*e-20828448e5)},cu=function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}},du=function(e){var t,n,r=new DataView(e.buffer,e.byteOffset,e.byteLength),i=[];for(t=0;t+4<e.length;t+=n)if(n=r.getUint32(t),t+=4,n<=0)i.push("<span style='color:red;'>MALFORMED DATA</span>");else switch(31&e[t]){case 1:i.push("slice_layer_without_partitioning_rbsp");break;case 5:i.push("slice_layer_without_partitioning_rbsp_idr");break;case 6:i.push("sei_rbsp");break;case 7:i.push("seq_parameter_set_rbsp");break;case 8:i.push("pic_parameter_set_rbsp");break;case 9:i.push("access_unit_delimiter_rbsp");break;default:i.push("UNKNOWN NAL - "+e[t]&31)}return i},hu={avc1:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{dataReferenceIndex:t.getUint16(6),width:t.getUint16(24),height:t.getUint16(26),horizresolution:t.getUint16(28)+t.getUint16(30)/16,vertresolution:t.getUint16(32)+t.getUint16(34)/16,frameCount:t.getUint16(40),depth:t.getUint16(74),config:Eo(e.subarray(78,e.byteLength))}},avcC:function(e){var t,n,r,i,a=new DataView(e.buffer,e.byteOffset,e.byteLength),s={configurationVersion:e[0],avcProfileIndication:e[1],profileCompatibility:e[2],avcLevelIndication:e[3],lengthSizeMinusOne:3&e[4],sps:[],pps:[]},o=31&e[5];for(r=6,i=0;i<o;i++)n=a.getUint16(r),r+=2,s.sps.push(new Uint8Array(e.subarray(r,r+n))),r+=n;for(t=e[r],r++,i=0;i<t;i++)n=a.getUint16(r),r+=2,s.pps.push(new Uint8Array(e.subarray(r,r+n))),r+=n;return s},btrt:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{bufferSizeDB:t.getUint32(0),maxBitrate:t.getUint32(4),avgBitrate:t.getUint32(8)}},esds:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),esId:e[6]<<8|e[7],streamPriority:31&e[8],decoderConfig:{objectProfileIndication:e[11],streamType:e[12]>>>2&63,bufferSize:e[13]<<16|e[14]<<8|e[15],maxBitrate:e[16]<<24|e[17]<<16|e[18]<<8|e[19],avgBitrate:e[20]<<24|e[21]<<16|e[22]<<8|e[23],decoderConfigDescriptor:{tag:e[24],length:e[25],audioObjectType:e[26]>>>3&31,samplingFrequencyIndex:(7&e[26])<<1|e[27]>>>7&1,channelConfiguration:e[27]>>>3&15}}}},ftyp:function(e){for(var t=new DataView(e.buffer,e.byteOffset,e.byteLength),n={majorBrand:uu(e.subarray(0,4)),minorVersion:t.getUint32(4),compatibleBrands:[]},r=8;r<e.byteLength;)n.compatibleBrands.push(uu(e.subarray(r,r+4))),r+=4;return n},dinf:function(e){return{boxes:Eo(e)}},dref:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),dataReferences:Eo(e.subarray(8))}},hdlr:function(e){var t={version:new DataView(e.buffer,e.byteOffset,e.byteLength).getUint8(0),flags:new Uint8Array(e.subarray(1,4)),handlerType:uu(e.subarray(8,12)),name:""},n=8;for(n=24;n<e.byteLength;n++){if(0===e[n]){n++;break}t.name+=String.fromCharCode(e[n])}return t.name=decodeURIComponent(escape(t.name)),t},mdat:function(e){return{byteLength:e.byteLength,nals:du(e)}},mdhd:function(e){var t,n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=4,i={version:n.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),language:""};return 1===i.version?(r+=4,i.creationTime=lu(n.getUint32(r)),r+=8,i.modificationTime=lu(n.getUint32(r)),r+=4,i.timescale=n.getUint32(r),r+=8,i.duration=n.getUint32(r)):(i.creationTime=lu(n.getUint32(r)),r+=4,i.modificationTime=lu(n.getUint32(r)),r+=4,i.timescale=n.getUint32(r),r+=4,i.duration=n.getUint32(r)),r+=4,t=n.getUint16(r),i.language+=String.fromCharCode(96+(t>>10)),i.language+=String.fromCharCode(96+((992&t)>>5)),i.language+=String.fromCharCode(96+(31&t)),i},mdia:function(e){return{boxes:Eo(e)}},mfhd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),sequenceNumber:e[4]<<24|e[5]<<16|e[6]<<8|e[7]}},minf:function(e){return{boxes:Eo(e)}},mp4a:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),n={dataReferenceIndex:t.getUint16(6),channelcount:t.getUint16(16),samplesize:t.getUint16(18),samplerate:t.getUint16(24)+t.getUint16(26)/65536};return e.byteLength>28&&(n.streamDescriptor=Eo(e.subarray(28))[0]),n},moof:function(e){return{boxes:Eo(e)}},moov:function(e){return{boxes:Eo(e)}},mvex:function(e){return{boxes:Eo(e)}},mvhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),n=4,r={version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4))};return 1===r.version?(n+=4,r.creationTime=lu(t.getUint32(n)),n+=8,r.modificationTime=lu(t.getUint32(n)),n+=4,r.timescale=t.getUint32(n),n+=8,r.duration=t.getUint32(n)):(r.creationTime=lu(t.getUint32(n)),n+=4,r.modificationTime=lu(t.getUint32(n)),n+=4,r.timescale=t.getUint32(n),n+=4,r.duration=t.getUint32(n)),n+=4,r.rate=t.getUint16(n)+t.getUint16(n+2)/16,n+=4,r.volume=t.getUint8(n)+t.getUint8(n+1)/8,n+=2,n+=2,n+=8,r.matrix=new Uint32Array(e.subarray(n,n+36)),n+=36,n+=24,r.nextTrackId=t.getUint32(n),r},pdin:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),rate:t.getUint32(4),initialDelay:t.getUint32(8)}},sdtp:function(e){var t,n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]};for(t=4;t<e.byteLength;t++)n.samples.push({dependsOn:(48&e[t])>>4,isDependedOn:(12&e[t])>>2,hasRedundancy:3&e[t]});return n},sidx:function(e){var t,n=new DataView(e.buffer,e.byteOffset,e.byteLength),r={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:n.getUint32(4),timescale:n.getUint32(8),earliestPresentationTime:n.getUint32(12),firstOffset:n.getUint32(16)},i=n.getUint16(22);for(t=24;i;t+=12,i--)r.references.push({referenceType:(128&e[t])>>>7,referencedSize:2147483647&n.getUint32(t),subsegmentDuration:n.getUint32(t+4),startsWithSap:!!(128&e[t+8]),sapType:(112&e[t+8])>>>4,sapDeltaTime:268435455&n.getUint32(t+8)});return r},smhd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),balance:e[4]+e[5]/256}},stbl:function(e){return{boxes:Eo(e)}},stco:function(e){var t,n=new DataView(e.buffer,e.byteOffset,e.byteLength),r={version:e[0],flags:new Uint8Array(e.subarray(1,4)),chunkOffsets:[]},i=n.getUint32(4);for(t=8;i;t+=4,i--)r.chunkOffsets.push(n.getUint32(t));return r},stsc:function(e){var t,n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=n.getUint32(4),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleToChunks:[]};for(t=8;r;t+=12,r--)i.sampleToChunks.push({firstChunk:n.getUint32(t),samplesPerChunk:n.getUint32(t+4),sampleDescriptionIndex:n.getUint32(t+8)});return i},stsd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleDescriptions:Eo(e.subarray(8))}},stsz:function(e){var t,n=new DataView(e.buffer,e.byteOffset,e.byteLength),r={version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleSize:n.getUint32(4),entries:[]};for(t=12;t<e.byteLength;t+=4)r.entries.push(n.getUint32(t));return r},stts:function(e){var t,n=new DataView(e.buffer,e.byteOffset,e.byteLength),r={version:e[0],flags:new Uint8Array(e.subarray(1,4)),timeToSamples:[]},i=n.getUint32(4);for(t=8;i;t+=8,i--)r.timeToSamples.push({sampleCount:n.getUint32(t),sampleDelta:n.getUint32(t+4)});return r},styp:function(e){return hu.ftyp(e)},tfdt:function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4)),baseMediaDecodeTime:e[4]<<24|e[5]<<16|e[6]<<8|e[7]};return 1===t.version&&(t.baseMediaDecodeTime*=Math.pow(2,32),t.baseMediaDecodeTime+=e[8]<<24|e[9]<<16|e[10]<<8|e[11]),t},tfhd:function(e){var t,n=new DataView(e.buffer,e.byteOffset,e.byteLength),r={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:n.getUint32(4)},i=1&r.flags[2],a=2&r.flags[2],s=8&r.flags[2],o=16&r.flags[2],u=32&r.flags[2],l=65536&r.flags[0],c=131072&r.flags[0];return t=8,i&&(t+=4,r.baseDataOffset=n.getUint32(12),t+=4),a&&(r.sampleDescriptionIndex=n.getUint32(t),t+=4),s&&(r.defaultSampleDuration=n.getUint32(t),t+=4),o&&(r.defaultSampleSize=n.getUint32(t),t+=4),u&&(r.defaultSampleFlags=n.getUint32(t)),l&&(r.durationIsEmpty=!0),!i&&c&&(r.baseDataOffsetIsMoof=!0),r},tkhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),n=4,r={version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4))};return 1===r.version?(n+=4,r.creationTime=lu(t.getUint32(n)),n+=8,r.modificationTime=lu(t.getUint32(n)),n+=4,r.trackId=t.getUint32(n),n+=4,n+=8,r.duration=t.getUint32(n)):(r.creationTime=lu(t.getUint32(n)),n+=4,r.modificationTime=lu(t.getUint32(n)),n+=4,r.trackId=t.getUint32(n),n+=4,n+=4,r.duration=t.getUint32(n)),n+=4,n+=8,r.layer=t.getUint16(n),n+=2,r.alternateGroup=t.getUint16(n),n+=2,r.volume=t.getUint8(n)+t.getUint8(n+1)/8,n+=2,n+=2,r.matrix=new Uint32Array(e.subarray(n,n+36)),n+=36,r.width=t.getUint16(n)+t.getUint16(n+2)/16,n+=4,r.height=t.getUint16(n)+t.getUint16(n+2)/16,r},traf:function(e){return{boxes:Eo(e)}},trak:function(e){return{boxes:Eo(e)}},trex:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:t.getUint32(4),defaultSampleDescriptionIndex:t.getUint32(8),defaultSampleDuration:t.getUint32(12),defaultSampleSize:t.getUint32(16),sampleDependsOn:3&e[20],sampleIsDependedOn:(192&e[21])>>6,sampleHasRedundancy:(48&e[21])>>4,samplePaddingValue:(14&e[21])>>1,sampleIsDifferenceSample:!!(1&e[21]),sampleDegradationPriority:t.getUint16(22)}},trun:function(e){var t,n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},r=new DataView(e.buffer,e.byteOffset,e.byteLength),i=1&n.flags[2],a=4&n.flags[2],s=1&n.flags[1],o=2&n.flags[1],u=4&n.flags[1],l=8&n.flags[1],c=r.getUint32(4),d=8;for(i&&(n.dataOffset=r.getInt32(d),d+=4),a&&c&&(t={flags:cu(e.subarray(d,d+4))},d+=4,s&&(t.duration=r.getUint32(d),d+=4),o&&(t.size=r.getUint32(d),d+=4),l&&(t.compositionTimeOffset=r.getUint32(d),d+=4),n.samples.push(t),c--);c--;)t={},s&&(t.duration=r.getUint32(d),d+=4),o&&(t.size=r.getUint32(d),d+=4),u&&(t.flags=cu(e.subarray(d,d+4)),d+=4),l&&(t.compositionTimeOffset=r.getUint32(d),d+=4),n.samples.push(t);return n},"url ":function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4))}},vmhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),graphicsmode:t.getUint16(4),opcolor:new Uint16Array([t.getUint16(6),t.getUint16(8),t.getUint16(10)])}}},fu={inspect:Eo=function(e){for(var t,n,r,i,a,s=0,o=[],u=new ArrayBuffer(e.length),l=new Uint8Array(u),c=0;c<e.length;++c)l[c]=e[c];for(t=new DataView(u);s<e.byteLength;)n=t.getUint32(s),r=uu(e.subarray(s+4,s+8)),i=n>1?s+n:e.byteLength,(a=(hu[r]||function(e){return{data:e}})(e.subarray(s+8,i))).size=n,a.type=r,o.push(a),s=i;return o},textify:ko=function(e,t){var n;return t=t||0,n=new Array(2*t+1).join(" "),e.map((function(e,r){return n+e.type+"\n"+Object.keys(e).filter((function(e){return"type"!==e&&"boxes"!==e})).map((function(t){var r=n+" "+t+": ",i=e[t];if(i instanceof Uint8Array||i instanceof Uint32Array){var a=Array.prototype.slice.call(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)).map((function(e){return" "+("00"+e.toString(16)).slice(-2)})).join("").match(/.{1,24}/g);return a?1===a.length?r+"<"+a.join("").slice(1)+">":r+"<\n"+a.map((function(e){return n+" "+e})).join("\n")+"\n"+n+" >":r+"<>"}return r+JSON.stringify(i,null,2).split("\n").map((function(e,t){return 0===t?e:n+" "+e})).join("\n")})).join("\n")+(e.boxes?"\n"+ko(e.boxes,t+1):"")})).join("\n")},parseTfdt:hu.tfdt,parseHdlr:hu.hdlr,parseTfhd:hu.tfhd,parseTrun:hu.trun,parseSidx:hu.sidx},pu=Math.pow(2,32)-1;!function(){var e;if(qo={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},"undefined"!=typeof Uint8Array){for(e in qo)qo.hasOwnProperty(e)&&(qo[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);$o=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),Xo=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),Yo=new Uint8Array([0,0,0,1]),Jo=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),Qo=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),Zo={video:Jo,audio:Qo},nu=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),tu=new Uint8Array([0,0,0,0,0,0,0,0]),ru=new Uint8Array([0,0,0,0,0,0,0,0]),iu=ru,au=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),su=ru,eu=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}}(),wo=function(e){var t,n,r=[],i=0;for(t=1;t<arguments.length;t++)r.push(arguments[t]);for(t=r.length;t--;)i+=r[t].byteLength;for(n=new Uint8Array(i+8),new DataView(n.buffer,n.byteOffset,n.byteLength).setUint32(0,n.byteLength),n.set(e,4),t=0,i=8;t<r.length;t++)n.set(r[t],i),i+=r[t].byteLength;return n},Co=function(){return wo(qo.dinf,wo(qo.dref,nu))},Ao=function(e){return wo(qo.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,e.audioobjecttype<<3|e.samplingfrequencyindex>>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]))},Lo=function(){return wo(qo.ftyp,$o,Yo,$o,Xo)},No=function(e){return wo(qo.hdlr,Zo[e])},Ro=function(e){return wo(qo.mdat,e)},Fo=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,e.duration>>>24&255,e.duration>>>16&255,e.duration>>>8&255,255&e.duration,85,196,0,0]);return e.samplerate&&(t[12]=e.samplerate>>>24&255,t[13]=e.samplerate>>>16&255,t[14]=e.samplerate>>>8&255,t[15]=255&e.samplerate),wo(qo.mdhd,t)},Bo=function(e){return wo(qo.mdia,Fo(e),No(e.type),Io(e))},xo=function(e){return wo(qo.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},Io=function(e){return wo(qo.minf,"video"===e.type?wo(qo.vmhd,eu):wo(qo.smhd,tu),Co(),Vo(e))},Oo=function(e,t){for(var n=[],r=t.length;r--;)n[r]=zo(t[r]);return wo.apply(null,[qo.moof,xo(e)].concat(n))},Do=function(e){for(var t=e.length,n=[];t--;)n[t]=jo(e[t]);return wo.apply(null,[qo.moov,Mo(4294967295)].concat(n).concat(Po(e)))},Po=function(e){for(var t=e.length,n=[];t--;)n[t]=Wo(e[t]);return wo.apply(null,[qo.mvex].concat(n))},Mo=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return wo(qo.mvhd,t)},Go=function(e){var t,n,r=e.samples||[],i=new Uint8Array(4+r.length);for(n=0;n<r.length;n++)t=r[n].flags,i[n+4]=t.dependsOn<<4|t.isDependedOn<<2|t.hasRedundancy;return wo(qo.sdtp,i)},Vo=function(e){return wo(qo.stbl,Ho(e),wo(qo.stts,su),wo(qo.stsc,iu),wo(qo.stsz,au),wo(qo.stco,ru))},function(){var e,t;Ho=function(n){return wo(qo.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===n.type?e(n):t(n))},e=function(e){var t,n=e.sps||[],r=e.pps||[],i=[],a=[];for(t=0;t<n.length;t++)i.push((65280&n[t].byteLength)>>>8),i.push(255&n[t].byteLength),i=i.concat(Array.prototype.slice.call(n[t]));for(t=0;t<r.length;t++)a.push((65280&r[t].byteLength)>>>8),a.push(255&r[t].byteLength),a=a.concat(Array.prototype.slice.call(r[t]));return wo(qo.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),wo(qo.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([n.length]).concat(i).concat([r.length]).concat(a))),wo(qo.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])))},t=function(e){return wo(qo.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),Ao(e))}}(),Uo=function(e){var t=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,0,(4278190080&e.duration)>>24,(16711680&e.duration)>>16,(65280&e.duration)>>8,255&e.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&e.width)>>8,255&e.width,0,0,(65280&e.height)>>8,255&e.height,0,0]);return wo(qo.tkhd,t)},zo=function(e){var t,n,r,i,a,s;return t=wo(qo.tfhd,new Uint8Array([0,0,0,58,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),a=Math.floor(e.baseMediaDecodeTime/(pu+1)),s=Math.floor(e.baseMediaDecodeTime%(pu+1)),n=wo(qo.tfdt,new Uint8Array([1,0,0,0,a>>>24&255,a>>>16&255,a>>>8&255,255&a,s>>>24&255,s>>>16&255,s>>>8&255,255&s])),92,"audio"===e.type?(r=Ko(e,92),wo(qo.traf,t,n,r)):(i=Go(e),r=Ko(e,i.length+92),wo(qo.traf,t,n,r,i))},jo=function(e){return e.duration=e.duration||4294967295,wo(qo.trak,Uo(e),Bo(e))},Wo=function(e){var t=new Uint8Array([0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==e.type&&(t[t.length-1]=0),wo(qo.trex,t)},function(){var e,t,n;n=function(e,t){var n=0,r=0,i=0,a=0;return e.length&&(void 0!==e[0].duration&&(n=1),void 0!==e[0].size&&(r=2),void 0!==e[0].flags&&(i=4),void 0!==e[0].compositionTimeOffset&&(a=8)),[0,0,n|r|i|a,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},t=function(e,t){var r,i,a,s;for(t+=20+16*(i=e.samples||[]).length,r=n(i,t),s=0;s<i.length;s++)a=i[s],r=r.concat([(4278190080&a.duration)>>>24,(16711680&a.duration)>>>16,(65280&a.duration)>>>8,255&a.duration,(4278190080&a.size)>>>24,(16711680&a.size)>>>16,(65280&a.size)>>>8,255&a.size,a.flags.isLeading<<2|a.flags.dependsOn,a.flags.isDependedOn<<6|a.flags.hasRedundancy<<4|a.flags.paddingValue<<1|a.flags.isNonSyncSample,61440&a.flags.degradationPriority,15&a.flags.degradationPriority,(4278190080&a.compositionTimeOffset)>>>24,(16711680&a.compositionTimeOffset)>>>16,(65280&a.compositionTimeOffset)>>>8,255&a.compositionTimeOffset]);return wo(qo.trun,new Uint8Array(r))},e=function(e,t){var r,i,a,s;for(t+=20+8*(i=e.samples||[]).length,r=n(i,t),s=0;s<i.length;s++)a=i[s],r=r.concat([(4278190080&a.duration)>>>24,(16711680&a.duration)>>>16,(65280&a.duration)>>>8,255&a.duration,(4278190080&a.size)>>>24,(16711680&a.size)>>>16,(65280&a.size)>>>8,255&a.size]);return wo(qo.trun,new Uint8Array(r))},Ko=function(n,r){return"audio"===n.type?e(n,r):t(n,r)}}();var vu={ftyp:Lo,mdat:Ro,moof:Oo,moov:Do,initSegment:function(e){var t,n=Lo(),r=Do(e);return(t=new Uint8Array(n.byteLength+r.byteLength)).set(n),t.set(r,n.byteLength),t}},mu=function(){this.init=function(){var e={};this.on=function(t,n){e[t]||(e[t]=[]),e[t]=e[t].concat(n)},this.off=function(t,n){var r;return!!e[t]&&(r=e[t].indexOf(n),e[t]=e[t].slice(),e[t].splice(r,1),r>-1)},this.trigger=function(t){var n,r,i,a;if(n=e[t])if(2===arguments.length)for(i=n.length,r=0;r<i;++r)n[r].call(this,arguments[1]);else{for(a=[],r=arguments.length,r=1;r<arguments.length;++r)a.push(arguments[r]);for(i=n.length,r=0;r<i;++r)n[r].apply(this,a)}},this.dispose=function(){e={}}}};mu.prototype.pipe=function(e){return this.on("data",(function(t){e.push(t)})),this.on("done",(function(t){e.flush(t)})),e},mu.prototype.push=function(e){this.trigger("data",e)},mu.prototype.flush=function(e){this.trigger("done",e)};var gu,yu,_u,bu,Tu,Su,Eu=mu,ku=function(e,t){var n={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return n.dataOffset=t,n.compositionTimeOffset=e.pts-e.dts,n.duration=e.duration,n.size=4*e.length,n.size+=e.byteLength,e.keyFrame&&(n.flags.dependsOn=2,n.flags.isNonSyncSample=0),n},wu=function(e){var t,n,r=[],i=[];for(r.byteLength=0,t=0;t<e.length;t++)"access_unit_delimiter_rbsp"===(n=e[t]).nalUnitType?(r.length&&(r.duration=n.dts-r.dts,i.push(r)),(r=[n]).byteLength=n.data.byteLength,r.pts=n.pts,r.dts=n.dts):("slice_layer_without_partitioning_rbsp_idr"===n.nalUnitType&&(r.keyFrame=!0),r.duration=n.dts-r.dts,r.byteLength+=n.data.byteLength,r.push(n));return i.length&&(!r.duration||r.duration<=0)&&(r.duration=i[i.length-1].duration),i.push(r),i},Cu=function(e){var t,n,r=[],i=[];for(r.byteLength=0,r.nalCount=0,r.duration=0,r.pts=e[0].pts,r.dts=e[0].dts,i.byteLength=0,i.nalCount=0,i.duration=0,i.pts=e[0].pts,i.dts=e[0].dts,t=0;t<e.length;t++)(n=e[t]).keyFrame?(r.length&&(i.push(r),i.byteLength+=r.byteLength,i.nalCount+=r.nalCount,i.duration+=r.duration),(r=[n]).nalCount=n.length,r.byteLength=n.byteLength,r.pts=n.pts,r.dts=n.dts,r.duration=n.duration):(r.duration+=n.duration,r.nalCount+=n.length,r.byteLength+=n.byteLength,r.push(n));return i.length&&r.duration<=0&&(r.duration=i[i.length-1].duration),i.byteLength+=r.byteLength,i.nalCount+=r.nalCount,i.duration+=r.duration,i.push(r),i},Au=function(e){var t;return!e[0][0].keyFrame&&e.length>1&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e},Lu=function(e,t){var n,r,i,a,s,o=t||0,u=[];for(n=0;n<e.length;n++)for(a=e[n],r=0;r<a.length;r++)s=a[r],o+=(i=ku(s,o)).size,u.push(i);return u},Ru=function(e){var t,n,r,i,a,s,o=0,u=e.byteLength,l=e.nalCount,c=new Uint8Array(u+4*l),d=new DataView(c.buffer);for(t=0;t<e.length;t++)for(i=e[t],n=0;n<i.length;n++)for(a=i[n],r=0;r<a.length;r++)s=a[r],d.setUint32(o,s.data.byteLength),o+=4,c.set(s.data,o),o+=s.data.byteLength;return c},xu=[33,16,5,32,164,27],Iu=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],Ou=function(e){for(var t=[];e--;)t.push(0);return t},Du=function(e){return Object.keys(e).reduce((function(t,n){return t[n]=new Uint8Array(e[n].reduce((function(e,t){return e.concat(t)}),[])),t}),{})}({96e3:[xu,[227,64],Ou(154),[56]],88200:[xu,[231],Ou(170),[56]],64e3:[xu,[248,192],Ou(240),[56]],48e3:[xu,[255,192],Ou(268),[55,148,128],Ou(54),[112]],44100:[xu,[255,192],Ou(268),[55,163,128],Ou(84),[112]],32e3:[xu,[255,192],Ou(268),[55,234],Ou(226),[112]],24e3:[xu,[255,192],Ou(268),[55,255,128],Ou(268),[111,112],Ou(126),[224]],16e3:[xu,[255,192],Ou(268),[55,255,128],Ou(268),[111,255],Ou(269),[223,108],Ou(195),[1,192]],12e3:[Iu,Ou(268),[3,127,248],Ou(268),[6,255,240],Ou(268),[13,255,224],Ou(268),[27,253,128],Ou(259),[56]],11025:[Iu,Ou(268),[3,127,248],Ou(268),[6,255,240],Ou(268),[13,255,224],Ou(268),[27,255,192],Ou(268),[55,175,128],Ou(108),[112]],8e3:[Iu,Ou(268),[3,121,16],Ou(47),[7]]});Tu=function(e,t){return gu(bu(e,t))},Su=function(e,t){return yu(_u(e),t)};gu=function(e){return 9e4*e},yu=function(e,t){return e*t},_u=function(e){return e/9e4},bu=function(e,t){return e/t};var Pu=Tu,Mu=Su,ju=function(e,t,n,r){var i,a,s,o=0,u=0,l=0,c=0;if(t.length&&(i=Pu(e.baseMediaDecodeTime,e.samplerate),o=Math.ceil(9e4/(e.samplerate/1024)),n&&r&&(u=i-Math.max(n,r),c=(l=Math.floor(u/o))*o),!(l<1||c>45e3))){for((a=Du[e.samplerate])||(a=t[0].data),s=0;s<l;s++)t.splice(s,0,{data:a});e.baseMediaDecodeTime-=Math.floor(Mu(c,e.samplerate))}},Uu=function(e,t,n){return t.minSegmentDts>=n?e:(t.minSegmentDts=1/0,e.filter((function(e){return e.dts>=n&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0)})))},Bu=function(e){var t,n,r=[];for(t=0;t<e.length;t++)n=e[t],r.push({size:n.data.byteLength,duration:1024});return r},Fu=function(e){var t,n,r=0,i=new Uint8Array(function(e){var t,n=0;for(t=0;t<e.length;t++)n+=e[t].data.byteLength;return n}(e));for(t=0;t<e.length;t++)n=e[t],i.set(n.data,r),r+=n.data.byteLength;return i},Nu=function(e){delete e.minSegmentDts,delete e.maxSegmentDts,delete e.minSegmentPts,delete e.maxSegmentPts},Gu=function(e,t){var n,r=e.minSegmentDts;return t||(r-=e.timelineStartInfo.dts),n=e.timelineStartInfo.baseMediaDecodeTime,n+=r,n=Math.max(0,n),"audio"===e.type&&(n*=e.samplerate/9e4,n=Math.floor(n)),n},Vu=function(e,t){"number"==typeof t.pts&&(void 0===e.timelineStartInfo.pts&&(e.timelineStartInfo.pts=t.pts),void 0===e.minSegmentPts?e.minSegmentPts=t.pts:e.minSegmentPts=Math.min(e.minSegmentPts,t.pts),void 0===e.maxSegmentPts?e.maxSegmentPts=t.pts:e.maxSegmentPts=Math.max(e.maxSegmentPts,t.pts)),"number"==typeof t.dts&&(void 0===e.timelineStartInfo.dts&&(e.timelineStartInfo.dts=t.dts),void 0===e.minSegmentDts?e.minSegmentDts=t.dts:e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),void 0===e.maxSegmentDts?e.maxSegmentDts=t.dts:e.maxSegmentDts=Math.max(e.maxSegmentDts,t.dts))},Hu=function(e){for(var t=0,n={payloadType:-1,payloadSize:0},r=0,i=0;t<e.byteLength&&128!==e[t];){for(;255===e[t];)r+=255,t++;for(r+=e[t++];255===e[t];)i+=255,t++;if(i+=e[t++],!n.payload&&4===r){n.payloadType=r,n.payloadSize=i,n.payload=e.subarray(t,t+i);break}t+=i,r=0,i=0}return n},zu=function(e){return 181!==e.payload[0]||49!=(e.payload[1]<<8|e.payload[2])||"GA94"!==String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])||3!==e.payload[7]?null:e.payload.subarray(8,e.payload.length-1)},Wu=function(e,t){var n,r,i,a,s=[];if(!(64&t[0]))return s;for(r=31&t[0],n=0;n<r;n++)a={type:3&t[(i=3*n)+2],pts:e},4&t[i+2]&&(a.ccData=t[i+3]<<8|t[i+4],s.push(a));return s},Ku=function(e){for(var t,n,r=e.byteLength,i=[],a=1;a<r-2;)0===e[a]&&0===e[a+1]&&3===e[a+2]?(i.push(a+2),a+=2):a++;if(0===i.length)return e;t=r-i.length,n=new Uint8Array(t);var s=0;for(a=0;a<t;s++,a++)s===i[0]&&(s++,i.shift()),n[a]=e[s];return n},qu=4,$u=function e(){e.prototype.init.call(this),this.captionPackets_=[],this.ccStreams_=[new Zu(0,0),new Zu(0,1),new Zu(1,0),new Zu(1,1)],this.reset(),this.ccStreams_.forEach((function(e){e.on("data",this.trigger.bind(this,"data")),e.on("done",this.trigger.bind(this,"done"))}),this)};($u.prototype=new Eu).push=function(e){var t,n,r;if("sei_rbsp"===e.nalUnitType&&((t=Hu(e.escapedRBSP)).payloadType===qu&&(n=zu(t)))){if(e.dts<this.latestDts_)return void(this.ignoreNextEqualDts_=!0);if(e.dts===this.latestDts_&&this.ignoreNextEqualDts_)return void(--this.numSameDts_||(this.ignoreNextEqualDts_=!1));r=Wu(e.pts,n),this.captionPackets_=this.captionPackets_.concat(r),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts}},$u.prototype.flush=function(){this.captionPackets_.length?(this.captionPackets_.forEach((function(e,t){e.presortIndex=t})),this.captionPackets_.sort((function(e,t){return e.pts===t.pts?e.presortIndex-t.presortIndex:e.pts-t.pts})),this.captionPackets_.forEach((function(e){e.type<2&&this.dispatchCea608Packet(e)}),this),this.captionPackets_.length=0,this.ccStreams_.forEach((function(e){e.flush()}),this)):this.ccStreams_.forEach((function(e){e.flush()}),this)},$u.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach((function(e){e.reset()}))},$u.prototype.dispatchCea608Packet=function(e){this.setsTextOrXDSActive(e)?this.activeCea608Channel_[e.type]=null:this.setsChannel1Active(e)?this.activeCea608Channel_[e.type]=0:this.setsChannel2Active(e)&&(this.activeCea608Channel_[e.type]=1),null!==this.activeCea608Channel_[e.type]&&this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)},$u.prototype.setsChannel1Active=function(e){return 4096==(30720&e.ccData)},$u.prototype.setsChannel2Active=function(e){return 6144==(30720&e.ccData)},$u.prototype.setsTextOrXDSActive=function(e){return 256==(28928&e.ccData)||4138==(30974&e.ccData)||6186==(30974&e.ccData)};var Yu={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},Xu=function(e){return null===e?"":(e=Yu[e]||e,String.fromCharCode(e))},Ju=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Qu=function(){for(var e=[],t=15;t--;)e.push("");return e},Zu=function e(t,n){e.prototype.init.call(this),this.field_=t||0,this.dataChannel_=n||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,n,r,i,a;if((t=32639&e.ccData)!==this.lastControlCode_){if(4096==(61440&t)?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),r=t>>>8,i=255&t,t!==this.PADDING_)if(t===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(t===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),n=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=n,this.startPts_=e.pts;else if(t===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(e.pts);else if(t===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(e.pts);else if(t===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(e.pts);else if(t===this.CARRIAGE_RETURN_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts;else if(t===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(t===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=Qu();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Qu();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=Qu()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(r,i))a=Xu((r=(3&r)<<8)|i),this[this.mode_](e.pts,a),this.column_++;else if(this.isExtCharacter(r,i))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),a=Xu((r=(3&r)<<8)|i),this[this.mode_](e.pts,a),this.column_++;else if(this.isMidRowCode(r,i))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14==(14&i)&&this.addFormatting(e.pts,["i"]),1==(1&i)&&this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(r,i))this.column_+=3&i;else if(this.isPAC(r,i)){var s=Ju.indexOf(7968&t);"rollUp"===this.mode_&&(s-this.rollUpRows_+1<0&&(s=this.rollUpRows_-1),this.setRollUp(e.pts,s)),s!==this.row_&&(this.clearFormatting(e.pts),this.row_=s),1&i&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),16==(16&t)&&(this.column_=4*((14&t)>>1)),this.isColorPAC(i)&&14==(14&i)&&this.addFormatting(e.pts,["i"])}else this.isNormalChar(r)&&(0===i&&(i=null),a=Xu(r),a+=Xu(i),this[this.mode_](e.pts,a),this.column_+=a.length)}else this.lastControlCode_=null}};Zu.prototype=new Eu,Zu.prototype.flushDisplayed=function(e){var t=this.displayed_.map((function(e){try{return e.trim()}catch(e){return console.error("Skipping malformed caption."),""}})).join("\n").replace(/^\n+|\n+$/g,"");t.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})},Zu.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Qu(),this.nonDisplayed_=Qu(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},Zu.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},Zu.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},Zu.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},Zu.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},Zu.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},Zu.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&t>=64&&t<=127},Zu.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},Zu.prototype.isNormalChar=function(e){return e>=32&&e<=127},Zu.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=Qu(),this.displayed_=Qu()),void 0!==t&&t!==this.row_)for(var n=0;n<this.rollUpRows_;n++)this.displayed_[t-n]=this.displayed_[this.row_-n],this.displayed_[this.row_-n]="";void 0===t&&(t=this.row_),this.topRow_=t-this.rollUpRows_+1},Zu.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t);var n=t.reduce((function(e,t){return e+"<"+t+">"}),"");this[this.mode_](e,n)},Zu.prototype.clearFormatting=function(e){if(this.formatting_.length){var t=this.formatting_.reverse().reduce((function(e,t){return e+"</"+t+">"}),"");this.formatting_=[],this[this.mode_](e,t)}},Zu.prototype.popOn=function(e,t){var n=this.nonDisplayed_[this.row_];n+=t,this.nonDisplayed_[this.row_]=n},Zu.prototype.rollUp=function(e,t){var n=this.displayed_[this.row_];n+=t,this.displayed_[this.row_]=n},Zu.prototype.shiftRowsUp_=function(){var e;for(e=0;e<this.topRow_;e++)this.displayed_[e]="";for(e=this.row_+1;e<15;e++)this.displayed_[e]="";for(e=this.topRow_;e<this.row_;e++)this.displayed_[e]=this.displayed_[e+1];this.displayed_[this.row_]=""},Zu.prototype.paintOn=function(e,t){var n=this.displayed_[this.row_];n+=t,this.displayed_[this.row_]=n};var el={CaptionStream:$u,Cea608Stream:Zu},tl={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},nl=function(e,t){var n=1;for(e>t&&(n=-1);Math.abs(t-e)>4294967296;)e+=8589934592*n;return e},rl=function e(t){var n,r;e.prototype.init.call(this),this.type_=t,this.push=function(e){e.type===this.type_&&(void 0===r&&(r=e.dts),e.dts=nl(e.dts,r),e.pts=nl(e.pts,r),n=e.dts,this.trigger("data",e))},this.flush=function(){r=n,this.trigger("done")},this.discontinuity=function(){r=void 0,n=void 0}};rl.prototype=new Eu;var il,al=rl,sl=nl,ol=function(e,t,n){var r,i="";for(r=t;r<n;r++)i+="%"+("00"+e[r].toString(16)).slice(-2);return i},ul=function(e,t,n){return decodeURIComponent(ol(e,t,n))},ll=function(e,t,n){return unescape(ol(e,t,n))},cl=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},dl={TXXX:function(e){var t;if(3===e.data[0]){for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=ul(e.data,1,t),e.value=ul(e.data,t+1,e.data.length).replace(/\0*$/,"");break}e.data=e.value}},WXXX:function(e){var t;if(3===e.data[0])for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=ul(e.data,1,t),e.url=ul(e.data,t+1,e.data.length);break}},PRIV:function(e){var t;for(t=0;t<e.data.length;t++)if(0===e.data[t]){e.owner=ll(e.data,0,t);break}e.privateData=e.data.subarray(t+1),e.data=e.privateData}};(il=function(e){var t,n={debug:!(!e||!e.debug),descriptor:e&&e.descriptor},r=0,i=[],a=0;if(il.prototype.init.call(this),this.dispatchType=tl.METADATA_STREAM_TYPE.toString(16),n.descriptor)for(t=0;t<n.descriptor.length;t++)this.dispatchType+=("00"+n.descriptor[t].toString(16)).slice(-2);this.push=function(e){var t,s,o,u,l;if("timed-metadata"===e.type){if(e.dataAlignmentIndicator&&(a=0,i.length=0),0===i.length&&(e.data.length<10||e.data[0]!=="I".charCodeAt(0)||e.data[1]!=="D".charCodeAt(0)||e.data[2]!=="3".charCodeAt(0)))return void(n.debug&&console.log("Skipping unrecognized metadata packet"));if(i.push(e),a+=e.data.byteLength,1===i.length&&(r=cl(e.data.subarray(6,10)),r+=10),!(a<r)){for(t={data:new Uint8Array(r),frames:[],pts:i[0].pts,dts:i[0].dts},l=0;l<r;)t.data.set(i[0].data.subarray(0,r-l),l),l+=i[0].data.byteLength,a-=i[0].data.byteLength,i.shift();s=10,64&t.data[5]&&(s+=4,s+=cl(t.data.subarray(10,14)),r-=cl(t.data.subarray(16,20)));do{if((o=cl(t.data.subarray(s+4,s+8)))<1)return console.log("Malformed ID3 frame encountered. Skipping metadata parsing.");if((u={id:String.fromCharCode(t.data[s],t.data[s+1],t.data[s+2],t.data[s+3]),data:t.data.subarray(s+10,s+o+10)}).key=u.id,dl[u.id]&&(dl[u.id](u),"com.apple.streaming.transportStreamTimestamp"===u.owner)){var c=u.data,d=(1&c[3])<<30|c[4]<<22|c[5]<<14|c[6]<<6|c[7]>>>2;d*=4,d+=3&c[7],u.timeStamp=d,void 0===t.pts&&void 0===t.dts&&(t.pts=u.timeStamp,t.dts=u.timeStamp),this.trigger("timestamp",u)}t.frames.push(u),s+=10,s+=o}while(s<r);this.trigger("data",t)}}}}).prototype=new Eu;var hl,fl,pl,vl=il,ml=al;(hl=function(){var e=new Uint8Array(188),t=0;hl.prototype.init.call(this),this.push=function(n){var r,i=0,a=188;for(t?((r=new Uint8Array(n.byteLength+t)).set(e.subarray(0,t)),r.set(n,t),t=0):r=n;a<r.byteLength;)71!==r[i]||71!==r[a]?(i++,a++):(this.trigger("data",r.subarray(i,a)),i+=188,a+=188);i<r.byteLength&&(e.set(r.subarray(i),0),t=r.byteLength-i)},this.flush=function(){188===t&&71===e[0]&&(this.trigger("data",e),t=0),this.trigger("done")}}).prototype=new Eu,(fl=function(){var e,t,n,r;fl.prototype.init.call(this),r=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,e=function(e,r){var i=0;r.payloadUnitStartIndicator&&(i+=e[i]+1),"pat"===r.type?t(e.subarray(i),r):n(e.subarray(i),r)},t=function(e,t){t.section_number=e[7],t.last_section_number=e[8],r.pmtPid=(31&e[10])<<8|e[11],t.pmtPid=r.pmtPid},n=function(e,t){var n,i;if(1&e[5]){for(r.programMapTable={video:null,audio:null,"timed-metadata":{}},n=3+((15&e[1])<<8|e[2])-4,i=12+((15&e[10])<<8|e[11]);i<n;){var a=e[i],s=(31&e[i+1])<<8|e[i+2];a===tl.H264_STREAM_TYPE&&null===r.programMapTable.video?r.programMapTable.video=s:a===tl.ADTS_STREAM_TYPE&&null===r.programMapTable.audio?r.programMapTable.audio=s:a===tl.METADATA_STREAM_TYPE&&(r.programMapTable["timed-metadata"][s]=a),i+=5+((15&e[i+3])<<8|e[i+4])}t.programMapTable=r.programMapTable}},this.push=function(t){var n={},r=4;if(n.payloadUnitStartIndicator=!!(64&t[1]),n.pid=31&t[1],n.pid<<=8,n.pid|=t[2],(48&t[3])>>>4>1&&(r+=t[r]+1),0===n.pid)n.type="pat",e(t.subarray(r),n),this.trigger("data",n);else if(n.pid===this.pmtPid)for(n.type="pmt",e(t.subarray(r),n),this.trigger("data",n);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,r,n]):this.processPes_(t,r,n)},this.processPes_=function(e,t,n){n.pid===this.programMapTable.video?n.streamType=tl.H264_STREAM_TYPE:n.pid===this.programMapTable.audio?n.streamType=tl.ADTS_STREAM_TYPE:n.streamType=this.programMapTable["timed-metadata"][n.pid],n.type="pes",n.data=e.subarray(t),this.trigger("data",n)}}).prototype=new Eu,fl.STREAM_TYPES={h264:27,adts:15},(pl=function(){var e=this,t={data:[],size:0},n={data:[],size:0},r={data:[],size:0},i=function(t,n,r){var i,a=new Uint8Array(t.size),s={type:n},o=0,u=0,l=!1;if(t.data.length&&!(t.size<9)){for(s.trackId=t.data[0].pid,o=0;o<t.data.length;o++)i=t.data[o],a.set(i.data,u),u+=i.data.byteLength;(function(e,t){var n;t.packetLength=6+(e[4]<<8|e[5]),t.dataAlignmentIndicator=0!=(4&e[6]),192&(n=e[7])&&(t.pts=(14&e[9])<<27|(255&e[10])<<20|(254&e[11])<<12|(255&e[12])<<5|(254&e[13])>>>3,t.pts*=4,t.pts+=(6&e[13])>>>1,t.dts=t.pts,64&n&&(t.dts=(14&e[14])<<27|(255&e[15])<<20|(254&e[16])<<12|(255&e[17])<<5|(254&e[18])>>>3,t.dts*=4,t.dts+=(6&e[18])>>>1)),t.data=e.subarray(9+e[8])})(a,s),l="video"===n||s.packetLength<=t.size,(r||l)&&(t.size=0,t.data.length=0),l&&e.trigger("data",s)}};pl.prototype.init.call(this),this.push=function(a){({pat:function(){},pes:function(){var e,s;switch(a.streamType){case tl.H264_STREAM_TYPE:case tl.H264_STREAM_TYPE:e=t,s="video";break;case tl.ADTS_STREAM_TYPE:e=n,s="audio";break;case tl.METADATA_STREAM_TYPE:e=r,s="timed-metadata";break;default:return}a.payloadUnitStartIndicator&&i(e,s,!0),e.data.push(a),e.size+=a.data.byteLength},pmt:function(){var t={type:"metadata",tracks:[]},n=a.programMapTable;null!==n.video&&t.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+n.video,codec:"avc",type:"video"}),null!==n.audio&&t.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+n.audio,codec:"adts",type:"audio"}),e.trigger("data",t)}})[a.type]()},this.flush=function(){i(t,"video"),i(n,"audio"),i(r,"timed-metadata"),this.trigger("done")}}).prototype=new Eu;var gl={PAT_PID:0,MP2T_PACKET_LENGTH:188,TransportPacketStream:hl,TransportParseStream:fl,ElementaryStream:pl,TimestampRolloverStream:ml,CaptionStream:el.CaptionStream,Cea608Stream:el.Cea608Stream,MetadataStream:vl};for(var yl in tl)tl.hasOwnProperty(yl)&&(gl[yl]=tl[yl]);var _l,bl=gl,Tl=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];(_l=function(){var e;_l.prototype.init.call(this),this.push=function(t){var n,r,i,a,s,o,u=0,l=0;if("audio"===t.type)for(e?(a=e,(e=new Uint8Array(a.byteLength+t.data.byteLength)).set(a),e.set(t.data,a.byteLength)):e=t.data;u+5<e.length;)if(255===e[u]&&240==(246&e[u+1])){if(r=2*(1&~e[u+1]),n=(3&e[u+3])<<11|e[u+4]<<3|(224&e[u+5])>>5,o=9e4*(s=1024*(1+(3&e[u+6])))/Tl[(60&e[u+2])>>>2],i=u+n,e.byteLength<i)return;if(this.trigger("data",{pts:t.pts+l*o,dts:t.dts+l*o,sampleCount:s,audioobjecttype:1+(e[u+2]>>>6&3),channelcount:(1&e[u+2])<<2|(192&e[u+3])>>>6,samplerate:Tl[(60&e[u+2])>>>2],samplingfrequencyindex:(60&e[u+2])>>>2,samplesize:16,data:e.subarray(u+7+r,i)}),e.byteLength===i)return void(e=void 0);l++,e=e.subarray(i)}else u++},this.flush=function(){this.trigger("done")}}).prototype=new Eu;var Sl,El,kl,wl=_l,Cl=function(e){var t=e.byteLength,n=0,r=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+r},this.loadWord=function(){var i=e.byteLength-t,a=new Uint8Array(4),s=Math.min(4,t);if(0===s)throw new Error("no bytes available");a.set(e.subarray(i,i+s)),n=new DataView(a.buffer).getUint32(0),r=8*s,t-=s},this.skipBits=function(e){var i;r>e?(n<<=e,r-=e):(e-=r,e-=8*(i=Math.floor(e/8)),t-=i,this.loadWord(),n<<=e,r-=e)},this.readBits=function(e){var i=Math.min(r,e),a=n>>>32-i;return(r-=i)>0?n<<=i:t>0&&this.loadWord(),(i=e-i)>0?a<<i|this.readBits(i):a},this.skipLeadingZeros=function(){var e;for(e=0;e<r;++e)if(0!=(n&2147483648>>>e))return n<<=e,r-=e,e;return this.loadWord(),e+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};(El=function(){var e,t,n=0;El.prototype.init.call(this),this.push=function(r){var i;for(t?((i=new Uint8Array(t.byteLength+r.data.byteLength)).set(t),i.set(r.data,t.byteLength),t=i):t=r.data;n<t.byteLength-3;n++)if(1===t[n+2]){e=n+5;break}for(;e<t.byteLength;)switch(t[e]){case 0:if(0!==t[e-1]){e+=2;break}if(0!==t[e-2]){e++;break}n+3!==e-2&&this.trigger("data",t.subarray(n+3,e-2));do{e++}while(1!==t[e]&&e<t.length);n=e-2,e+=3;break;case 1:if(0!==t[e-1]||0!==t[e-2]){e+=3;break}this.trigger("data",t.subarray(n+3,e-2)),n=e-2,e+=3;break;default:e+=3}t=t.subarray(n),e-=n,n=0},this.flush=function(){t&&t.byteLength>3&&this.trigger("data",t.subarray(n+3)),t=null,n=0,this.trigger("done")}}).prototype=new Eu,kl={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},(Sl=function(){var e,t,n,r,i,a,s,o=new El;Sl.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,n=e.pts,r=e.dts,o.push(e))},o.on("data",(function(s){var o={trackId:t,pts:n,dts:r,data:s};switch(31&s[0]){case 5:o.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:o.nalUnitType="sei_rbsp",o.escapedRBSP=i(s.subarray(1));break;case 7:o.nalUnitType="seq_parameter_set_rbsp",o.escapedRBSP=i(s.subarray(1)),o.config=a(o.escapedRBSP);break;case 8:o.nalUnitType="pic_parameter_set_rbsp";break;case 9:o.nalUnitType="access_unit_delimiter_rbsp"}e.trigger("data",o)})),o.on("done",(function(){e.trigger("done")})),this.flush=function(){o.flush()},s=function(e,t){var n,r=8,i=8;for(n=0;n<e;n++)0!==i&&(i=(r+t.readExpGolomb()+256)%256),r=0===i?r:i},i=function(e){for(var t,n,r=e.byteLength,i=[],a=1;a<r-2;)0===e[a]&&0===e[a+1]&&3===e[a+2]?(i.push(a+2),a+=2):a++;if(0===i.length)return e;t=r-i.length,n=new Uint8Array(t);var s=0;for(a=0;a<t;s++,a++)s===i[0]&&(s++,i.shift()),n[a]=e[s];return n},a=function(e){var t,n,r,i,a,o,u,l,c,d,h,f,p,v=0,m=0,g=0,y=0,_=1;if(n=(t=new Cl(e)).readUnsignedByte(),i=t.readUnsignedByte(),r=t.readUnsignedByte(),t.skipUnsignedExpGolomb(),kl[n]&&(3===(a=t.readUnsignedExpGolomb())&&t.skipBits(1),t.skipUnsignedExpGolomb(),t.skipUnsignedExpGolomb(),t.skipBits(1),t.readBoolean()))for(h=3!==a?8:12,p=0;p<h;p++)t.readBoolean()&&s(p<6?16:64,t);if(t.skipUnsignedExpGolomb(),0===(o=t.readUnsignedExpGolomb()))t.readUnsignedExpGolomb();else if(1===o)for(t.skipBits(1),t.skipExpGolomb(),t.skipExpGolomb(),u=t.readUnsignedExpGolomb(),p=0;p<u;p++)t.skipExpGolomb();if(t.skipUnsignedExpGolomb(),t.skipBits(1),l=t.readUnsignedExpGolomb(),c=t.readUnsignedExpGolomb(),0===(d=t.readBits(1))&&t.skipBits(1),t.skipBits(1),t.readBoolean()&&(v=t.readUnsignedExpGolomb(),m=t.readUnsignedExpGolomb(),g=t.readUnsignedExpGolomb(),y=t.readUnsignedExpGolomb()),t.readBoolean()&&t.readBoolean()){switch(t.readUnsignedByte()){case 1:f=[1,1];break;case 2:f=[12,11];break;case 3:f=[10,11];break;case 4:f=[16,11];break;case 5:f=[40,33];break;case 6:f=[24,11];break;case 7:f=[20,11];break;case 8:f=[32,11];break;case 9:f=[80,33];break;case 10:f=[18,11];break;case 11:f=[15,11];break;case 12:f=[64,33];break;case 13:f=[160,99];break;case 14:f=[4,3];break;case 15:f=[3,2];break;case 16:f=[2,1];break;case 255:f=[t.readUnsignedByte()<<8|t.readUnsignedByte(),t.readUnsignedByte()<<8|t.readUnsignedByte()]}f&&(_=f[0]/f[1])}return{profileIdc:n,levelIdc:r,profileCompatibility:i,width:Math.ceil((16*(l+1)-2*v-2*m)*_),height:(2-d)*(c+1)*16-2*g-2*y}}}).prototype=new Eu;var Al,Ll={H264Stream:Sl,NalByteStream:El},Rl=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],xl=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},Il=function(e,t,n){return unescape(function(e,t,n){var r,i="";for(r=t;r<n;r++)i+="%"+("00"+e[r].toString(16)).slice(-2);return i}(e,t,n))},Ol={isLikelyAacData:function(e){return e[0]==="I".charCodeAt(0)&&e[1]==="D".charCodeAt(0)&&e[2]==="3".charCodeAt(0)},parseId3TagSize:function(e,t){var n=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(16&e[t+5])>>4?n+20:n+10},parseAdtsSize:function(e,t){var n=(224&e[t+5])>>5,r=e[t+4]<<3;return 6144&e[t+3]|r|n},parseType:function(e,t){return e[t]==="I".charCodeAt(0)&&e[t+1]==="D".charCodeAt(0)&&e[t+2]==="3".charCodeAt(0)?"timed-metadata":!0&e[t]&&240==(240&e[t+1])?"audio":null},parseSampleRate:function(e){for(var t=0;t+5<e.length;){if(255===e[t]&&240==(246&e[t+1]))return Rl[(60&e[t+2])>>>2];t++}return null},parseAacTimestamp:function(e){var t,n,r;t=10,64&e[5]&&(t+=4,t+=xl(e.subarray(10,14)));do{if((n=xl(e.subarray(t+4,t+8)))<1)return null;if("PRIV"===String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3])){r=e.subarray(t+10,t+n+10);for(var i=0;i<r.byteLength;i++)if(0===r[i]){if("com.apple.streaming.transportStreamTimestamp"===Il(r,0,i)){var a=r.subarray(i+1),s=(1&a[3])<<30|a[4]<<22|a[5]<<14|a[6]<<6|a[7]>>>2;return(s*=4)+(3&a[7])}break}}t+=10,t+=n}while(t<e.byteLength);return null}};(Al=function(){var e=new Uint8Array,t=0;Al.prototype.init.call(this),this.setTimestamp=function(e){t=e},this.push=function(n){var r,i,a,s,o=0,u=0;for(e.length?(s=e.length,(e=new Uint8Array(n.byteLength+s)).set(e.subarray(0,s)),e.set(n,s)):e=n;e.length-u>=3;)if(e[u]!=="I".charCodeAt(0)||e[u+1]!=="D".charCodeAt(0)||e[u+2]!=="3".charCodeAt(0))if(255!=(255&e[u])||240!=(240&e[u+1]))u++;else{if(e.length-u<7)break;if(u+(o=Ol.parseAdtsSize(e,u))>e.length)break;a={type:"audio",data:e.subarray(u,u+o),pts:t,dts:t},this.trigger("data",a),u+=o}else{if(e.length-u<10)break;if(u+(o=Ol.parseId3TagSize(e,u))>e.length)break;i={type:"timed-metadata",data:e.subarray(u,u+o)},this.trigger("data",i),u+=o}r=e.length-u,e=r>0?e.subarray(u):new Uint8Array}}).prototype=new Eu;var Dl,Pl,Ml,jl,Ul=Al,Bl=Ll.H264Stream,Fl=Ol.isLikelyAacData,Nl=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Gl=["width","height","profileIdc","levelIdc","profileCompatibility"],Vl=function(e,t){var n;if(e.length!==t.length)return!1;for(n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0},Hl=function(e,t,n,r,i,a){return{start:{dts:e,pts:e+(n-t)},end:{dts:e+(r-t),pts:e+(i-n)},prependedContentDuration:a,baseMediaDecodeTime:e}};(Pl=function(e,t){var n=[],r=0,i=0,a=0,s=1/0;t=t||{},Pl.prototype.init.call(this),this.push=function(t){Vu(e,t),e&&Nl.forEach((function(n){e[n]=t[n]})),n.push(t)},this.setEarliestDts=function(t){i=t-e.timelineStartInfo.baseMediaDecodeTime},this.setVideoBaseMediaDecodeTime=function(e){s=e},this.setAudioAppendStart=function(e){a=e},this.flush=function(){var o,u,l,c;0!==n.length?(o=Uu(n,e,i),e.baseMediaDecodeTime=Gu(e,t.keepOriginalTimestamps),ju(e,o,a,s),e.samples=Bu(o),l=vu.mdat(Fu(o)),n=[],u=vu.moof(r,[e]),c=new Uint8Array(u.byteLength+l.byteLength),r++,c.set(u),c.set(l,u.byteLength),Nu(e),this.trigger("data",{track:e,boxes:c}),this.trigger("done","AudioSegmentStream")):this.trigger("done","AudioSegmentStream")}}).prototype=new Eu,(Dl=function(e,t){var n,r,i=0,a=[],s=[];t=t||{},Dl.prototype.init.call(this),delete e.minPTS,this.gopCache_=[],this.push=function(t){Vu(e,t),"seq_parameter_set_rbsp"!==t.nalUnitType||n||(n=t.config,e.sps=[t.data],Gl.forEach((function(t){e[t]=n[t]}),this)),"pic_parameter_set_rbsp"!==t.nalUnitType||r||(r=t.data,e.pps=[t.data]),a.push(t)},this.flush=function(){for(var n,r,o,u,l,c,d,h,f=0;a.length&&"access_unit_delimiter_rbsp"!==a[0].nalUnitType;)a.shift();if(0===a.length)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(n=wu(a),(o=Cu(n))[0][0].keyFrame||((r=this.getGopForFusion_(a[0],e))?(f=r.duration,o.unshift(r),o.byteLength+=r.byteLength,o.nalCount+=r.nalCount,o.pts=r.pts,o.dts=r.dts,o.duration+=r.duration):o=Au(o)),s.length){var p;if(!(p=t.alignGopsAtEnd?this.alignGopsAtEnd_(o):this.alignGopsAtStart_(o)))return this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),a=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");Nu(e),o=p}Vu(e,o),e.samples=Lu(o),l=vu.mdat(Ru(o)),e.baseMediaDecodeTime=Gu(e,t.keepOriginalTimestamps),this.trigger("processedGopsInfo",o.map((function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}}))),d=o[0],h=o[o.length-1],this.trigger("segmentTimingInfo",Hl(e.baseMediaDecodeTime,d.dts,d.pts,h.dts+h.duration,h.pts+h.duration,f)),this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),a=[],this.trigger("baseMediaDecodeTime",e.baseMediaDecodeTime),this.trigger("timelineStartInfo",e.timelineStartInfo),u=vu.moof(i,[e]),c=new Uint8Array(u.byteLength+l.byteLength),i++,c.set(u),c.set(l,u.byteLength),this.trigger("data",{track:e,boxes:c}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.resetStream_=function(){Nu(e),n=void 0,r=void 0},this.getGopForFusion_=function(t){var n,r,i,a,s,o=1/0;for(s=0;s<this.gopCache_.length;s++)i=(a=this.gopCache_[s]).gop,e.pps&&Vl(e.pps[0],a.pps[0])&&e.sps&&Vl(e.sps[0],a.sps[0])&&(i.dts<e.timelineStartInfo.dts||(n=t.dts-i.dts-i.duration)>=-1e4&&n<=45e3&&(!r||o>n)&&(r=a,o=n));return r?r.gop:null},this.alignGopsAtStart_=function(e){var t,n,r,i,a,o,u,l;for(a=e.byteLength,o=e.nalCount,u=e.duration,t=n=0;t<s.length&&n<e.length&&(r=s[t],i=e[n],r.pts!==i.pts);)i.pts>r.pts?t++:(n++,a-=i.byteLength,o-=i.nalCount,u-=i.duration);return 0===n?e:n===e.length?null:((l=e.slice(n)).byteLength=a,l.duration=u,l.nalCount=o,l.pts=l[0].pts,l.dts=l[0].dts,l)},this.alignGopsAtEnd_=function(e){var t,n,r,i,a,o,u;for(t=s.length-1,n=e.length-1,a=null,o=!1;t>=0&&n>=0;){if(r=s[t],i=e[n],r.pts===i.pts){o=!0;break}r.pts>i.pts?t--:(t===s.length-1&&(a=n),n--)}if(!o&&null===a)return null;if(0===(u=o?n:a))return e;var l=e.slice(u),c=l.reduce((function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e}),{byteLength:0,duration:0,nalCount:0});return l.byteLength=c.byteLength,l.duration=c.duration,l.nalCount=c.nalCount,l.pts=l[0].pts,l.dts=l[0].dts,l},this.alignGopsWith=function(e){s=e}}).prototype=new Eu,(jl=function(e,t){this.numberOfTracks=0,this.metadataStream=t,void 0!==(e=e||{}).remux?this.remuxTracks=!!e.remux:this.remuxTracks=!0,"boolean"==typeof e.keepOriginalTimestamps&&(this.keepOriginalTimestamps=e.keepOriginalTimestamps),this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,jl.prototype.init.call(this),this.push=function(e){return e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):(this.pendingTracks.push(e.track),this.pendingBoxes.push(e.boxes),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track),void("audio"===e.track.type&&(this.audioTrack=e.track)))}}).prototype=new Eu,jl.prototype.flush=function(e){var t,n,r,i,a=0,s={captions:[],captionStreams:{},metadata:[],info:{}},o=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==e&&"AudioSegmentStream"!==e)return;if(this.remuxTracks)return;if(0===this.pendingTracks.length)return void(++this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}for(this.videoTrack?(o=this.videoTrack.timelineStartInfo.pts,Gl.forEach((function(e){s.info[e]=this.videoTrack[e]}),this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,Nl.forEach((function(e){s.info[e]=this.audioTrack[e]}),this)),1===this.pendingTracks.length?s.type=this.pendingTracks[0].type:s.type="combined",this.emittedTracks+=this.pendingTracks.length,r=vu.initSegment(this.pendingTracks),s.initSegment=new Uint8Array(r.byteLength),s.initSegment.set(r),s.data=new Uint8Array(this.pendingBytes),i=0;i<this.pendingBoxes.length;i++)s.data.set(this.pendingBoxes[i],a),a+=this.pendingBoxes[i].byteLength;for(i=0;i<this.pendingCaptions.length;i++)(t=this.pendingCaptions[i]).startTime=t.startPts,this.keepOriginalTimestamps||(t.startTime-=o),t.startTime/=9e4,t.endTime=t.endPts,this.keepOriginalTimestamps||(t.endTime-=o),t.endTime/=9e4,s.captionStreams[t.stream]=!0,s.captions.push(t);for(i=0;i<this.pendingMetadata.length;i++)(n=this.pendingMetadata[i]).cueTime=n.pts,this.keepOriginalTimestamps||(n.cueTime-=o),n.cueTime/=9e4,s.metadata.push(n);s.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",s),this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},(Ml=function(e){var t,n,r=this,i=!0;Ml.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var t={};this.transmuxPipeline_=t,t.type="aac",t.metadataStream=new bl.MetadataStream,t.aacStream=new Ul,t.audioTimestampRolloverStream=new bl.TimestampRolloverStream("audio"),t.timedMetadataTimestampRolloverStream=new bl.TimestampRolloverStream("timed-metadata"),t.adtsStream=new wl,t.coalesceStream=new jl(e,t.metadataStream),t.headOfPipeline=t.aacStream,t.aacStream.pipe(t.audioTimestampRolloverStream).pipe(t.adtsStream),t.aacStream.pipe(t.timedMetadataTimestampRolloverStream).pipe(t.metadataStream).pipe(t.coalesceStream),t.metadataStream.on("timestamp",(function(e){t.aacStream.setTimestamp(e.timeStamp)})),t.aacStream.on("data",(function(i){"timed-metadata"!==i.type||t.audioSegmentStream||(n=n||{timelineStartInfo:{baseMediaDecodeTime:r.baseMediaDecodeTime},codec:"adts",type:"audio"},t.coalesceStream.numberOfTracks++,t.audioSegmentStream=new Pl(n,e),t.adtsStream.pipe(t.audioSegmentStream).pipe(t.coalesceStream))})),t.coalesceStream.on("data",this.trigger.bind(this,"data")),t.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setupTsPipeline=function(){var i={};this.transmuxPipeline_=i,i.type="ts",i.metadataStream=new bl.MetadataStream,i.packetStream=new bl.TransportPacketStream,i.parseStream=new bl.TransportParseStream,i.elementaryStream=new bl.ElementaryStream,i.videoTimestampRolloverStream=new bl.TimestampRolloverStream("video"),i.audioTimestampRolloverStream=new bl.TimestampRolloverStream("audio"),i.timedMetadataTimestampRolloverStream=new bl.TimestampRolloverStream("timed-metadata"),i.adtsStream=new wl,i.h264Stream=new Bl,i.captionStream=new bl.CaptionStream,i.coalesceStream=new jl(e,i.metadataStream),i.headOfPipeline=i.packetStream,i.packetStream.pipe(i.parseStream).pipe(i.elementaryStream),i.elementaryStream.pipe(i.videoTimestampRolloverStream).pipe(i.h264Stream),i.elementaryStream.pipe(i.audioTimestampRolloverStream).pipe(i.adtsStream),i.elementaryStream.pipe(i.timedMetadataTimestampRolloverStream).pipe(i.metadataStream).pipe(i.coalesceStream),i.h264Stream.pipe(i.captionStream).pipe(i.coalesceStream),i.elementaryStream.on("data",(function(a){var s;if("metadata"===a.type){for(s=a.tracks.length;s--;)t||"video"!==a.tracks[s].type?n||"audio"!==a.tracks[s].type||((n=a.tracks[s]).timelineStartInfo.baseMediaDecodeTime=r.baseMediaDecodeTime):(t=a.tracks[s]).timelineStartInfo.baseMediaDecodeTime=r.baseMediaDecodeTime;t&&!i.videoSegmentStream&&(i.coalesceStream.numberOfTracks++,i.videoSegmentStream=new Dl(t,e),i.videoSegmentStream.on("timelineStartInfo",(function(e){n&&(n.timelineStartInfo=e,i.audioSegmentStream.setEarliestDts(e.dts))})),i.videoSegmentStream.on("processedGopsInfo",r.trigger.bind(r,"gopInfo")),i.videoSegmentStream.on("segmentTimingInfo",r.trigger.bind(r,"videoSegmentTimingInfo")),i.videoSegmentStream.on("baseMediaDecodeTime",(function(e){n&&i.audioSegmentStream.setVideoBaseMediaDecodeTime(e)})),i.h264Stream.pipe(i.videoSegmentStream).pipe(i.coalesceStream)),n&&!i.audioSegmentStream&&(i.coalesceStream.numberOfTracks++,i.audioSegmentStream=new Pl(n,e),i.adtsStream.pipe(i.audioSegmentStream).pipe(i.coalesceStream))}})),i.coalesceStream.on("data",this.trigger.bind(this,"data")),i.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setBaseMediaDecodeTime=function(r){var i=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=r),n&&(n.timelineStartInfo.dts=void 0,n.timelineStartInfo.pts=void 0,Nu(n),e.keepOriginalTimestamps||(n.timelineStartInfo.baseMediaDecodeTime=r),i.audioTimestampRolloverStream&&i.audioTimestampRolloverStream.discontinuity()),t&&(i.videoSegmentStream&&(i.videoSegmentStream.gopCache_=[],i.videoTimestampRolloverStream.discontinuity()),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,Nu(t),i.captionStream.reset(),e.keepOriginalTimestamps||(t.timelineStartInfo.baseMediaDecodeTime=r)),i.timedMetadataTimestampRolloverStream&&i.timedMetadataTimestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){n&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.alignGopsWith=function(e){t&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)},this.push=function(e){if(i){var t=Fl(e);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),i=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){i=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}}).prototype=new Eu;var zl={Transmuxer:Ml,VideoSegmentStream:Dl,AudioSegmentStream:Pl,AUDIO_PROPERTIES:Nl,VIDEO_PROPERTIES:Gl,generateVideoSegmentTimingInfo:Hl},Wl=Ku,Kl=el.CaptionStream,ql=function(e,t){for(var n=e,r=0;r<t.length;r++){var i=t[r];if(n<i.size)return i;n-=i.size}return null},$l=function(e,t){var n=ou.findBox(e,["moof","traf"]),r=ou.findBox(e,["mdat"]),i={},a=[];return r.forEach((function(e,t){var r=n[t];a.push({mdat:e,traf:r})})),a.forEach((function(e){var n,r,a=e.mdat,s=e.traf,o=ou.findBox(s,["tfhd"]),u=fu.parseTfhd(o[0]),l=u.trackId,c=ou.findBox(s,["tfdt"]),d=c.length>0?fu.parseTfdt(c[0]).baseMediaDecodeTime:0,h=ou.findBox(s,["trun"]);t===l&&h.length>0&&(n=function(e,t,n){var r=t,i=n.defaultSampleDuration||0,a=n.defaultSampleSize||0,s=n.trackId,o=[];return e.forEach((function(e){var t=fu.parseTrun(e).samples;t.forEach((function(e){void 0===e.duration&&(e.duration=i),void 0===e.size&&(e.size=a),e.trackId=s,e.dts=r,void 0===e.compositionTimeOffset&&(e.compositionTimeOffset=0),e.pts=r+e.compositionTimeOffset,r+=e.duration})),o=o.concat(t)})),o}(h,d,u),r=function(e,t,n){var r,i,a,s,o=new DataView(e.buffer,e.byteOffset,e.byteLength),u=[];for(i=0;i+4<e.length;i+=a)if(a=o.getUint32(i),i+=4,!(a<=0))switch(31&e[i]){case 6:var l=e.subarray(i+1,i+1+a),c=ql(i,t);r={nalUnitType:"sei_rbsp",size:a,data:l,escapedRBSP:Wl(l),trackId:n},c?(r.pts=c.pts,r.dts=c.dts,s=c):(r.pts=s.pts,r.dts=s.dts),u.push(r)}return u}(a,n,l),i[l]||(i[l]=[]),i[l]=i[l].concat(r))})),i},Yl={generator:vu,probe:ou,Transmuxer:zl.Transmuxer,AudioSegmentStream:zl.AudioSegmentStream,VideoSegmentStream:zl.VideoSegmentStream,CaptionParser:function(){var e,t,n,r,i,a=!1;this.isInitialized=function(){return a},this.init=function(){e=new Kl,a=!0,e.on("data",(function(e){e.startTime=e.startPts/r,e.endTime=e.endPts/r,i.captions.push(e),i.captionStreams[e.stream]=!0}))},this.isNewInit=function(e,t){return!(e&&0===e.length||t&&"object"==typeof t&&0===Object.keys(t).length||n===e[0]&&r===t[n])},this.parse=function(e,a,s){var o;if(!this.isInitialized())return null;if(!a||!s)return null;if(this.isNewInit(a,s))n=a[0],r=s[n];else if(!n||!r)return t.push(e),null;for(;t.length>0;){var u=t.shift();this.parse(u,a,s)}return null!==(o=function(e,t,n){return t?{seiNals:$l(e,t)[t],timescale:n}:null}(e,n,r))&&o.seiNals?(this.pushNals(o.seiNals),this.flushStream(),i):null},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach((function(t){e.push(t)}))},this.flushStream=function(){if(!this.isInitialized())return null;e.flush()},this.clearParsedCaptions=function(){i.captions=[],i.captionStreams={}},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],n=null,r=null,i?this.clearParsedCaptions():i={captions:[],captionStreams:{}},this.resetCaptionStream()},this.reset()}}.CaptionParser,Xl=function(e){var t=31&e[1];return(t<<=8)|e[2]},Jl=function(e){return!!(64&e[1])},Ql=function(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t},Zl=function(e){switch(e){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},ec={parseType:function(e,t){var n=Xl(e);return 0===n?"pat":n===t?"pmt":t?"pes":null},parsePat:function(e){var t=Jl(e),n=4+Ql(e);return t&&(n+=e[n]+1),(31&e[n+10])<<8|e[n+11]},parsePmt:function(e){var t={},n=Jl(e),r=4+Ql(e);if(n&&(r+=e[r]+1),1&e[r+5]){var i;i=3+((15&e[r+1])<<8|e[r+2])-4;for(var a=12+((15&e[r+10])<<8|e[r+11]);a<i;){var s=r+a;t[(31&e[s+1])<<8|e[s+2]]=e[s],a+=5+((15&e[s+3])<<8|e[s+4])}return t}},parsePayloadUnitStartIndicator:Jl,parsePesType:function(e,t){switch(t[Xl(e)]){case tl.H264_STREAM_TYPE:return"video";case tl.ADTS_STREAM_TYPE:return"audio";case tl.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},parsePesTime:function(e){if(!Jl(e))return null;var t=4+Ql(e);if(t>=e.byteLength)return null;var n,r=null;return 192&(n=e[t+7])&&((r={}).pts=(14&e[t+9])<<27|(255&e[t+10])<<20|(254&e[t+11])<<12|(255&e[t+12])<<5|(254&e[t+13])>>>3,r.pts*=4,r.pts+=(6&e[t+13])>>>1,r.dts=r.pts,64&n&&(r.dts=(14&e[t+14])<<27|(255&e[t+15])<<20|(254&e[t+16])<<12|(255&e[t+17])<<5|(254&e[t+18])>>>3,r.dts*=4,r.dts+=(6&e[t+18])>>>1)),r},videoPacketContainsKeyFrame:function(e){for(var t=4+Ql(e),n=e.subarray(t),r=0,i=0,a=!1;i<n.byteLength-3;i++)if(1===n[i+2]){r=i+5;break}for(;r<n.byteLength;)switch(n[r]){case 0:if(0!==n[r-1]){r+=2;break}if(0!==n[r-2]){r++;break}i+3!==r-2&&"slice_layer_without_partitioning_rbsp_idr"===Zl(31&n[i+3])&&(a=!0);do{r++}while(1!==n[r]&&r<n.length);i=r-2,r+=3;break;case 1:if(0!==n[r-1]||0!==n[r-2]){r+=3;break}"slice_layer_without_partitioning_rbsp_idr"===Zl(31&n[i+3])&&(a=!0),i=r-2,r+=3;break;default:r+=3}return n=n.subarray(i),r-=i,i=0,n&&n.byteLength>3&&"slice_layer_without_partitioning_rbsp_idr"===Zl(31&n[i+3])&&(a=!0),a}},tc=sl,nc={};nc.ts=ec,nc.aac=Ol;var rc=function(e,t,n){for(var r,i,a,s,o=0,u=188,l=!1;u<=e.byteLength;)if(71!==e[o]||71!==e[u]&&u!==e.byteLength)o++,u++;else{switch(r=e.subarray(o,u),nc.ts.parseType(r,t.pid)){case"pes":i=nc.ts.parsePesType(r,t.table),a=nc.ts.parsePayloadUnitStartIndicator(r),"audio"===i&&a&&(s=nc.ts.parsePesTime(r))&&(s.type="audio",n.audio.push(s),l=!0)}if(l)break;o+=188,u+=188}for(o=(u=e.byteLength)-188,l=!1;o>=0;)if(71!==e[o]||71!==e[u]&&u!==e.byteLength)o--,u--;else{switch(r=e.subarray(o,u),nc.ts.parseType(r,t.pid)){case"pes":i=nc.ts.parsePesType(r,t.table),a=nc.ts.parsePayloadUnitStartIndicator(r),"audio"===i&&a&&(s=nc.ts.parsePesTime(r))&&(s.type="audio",n.audio.push(s),l=!0)}if(l)break;o-=188,u-=188}},ic=function(e,t,n){for(var r,i,a,s,o,u,l,c=0,d=188,h=!1,f={data:[],size:0};d<e.byteLength;)if(71!==e[c]||71!==e[d])c++,d++;else{switch(r=e.subarray(c,d),nc.ts.parseType(r,t.pid)){case"pes":if(i=nc.ts.parsePesType(r,t.table),a=nc.ts.parsePayloadUnitStartIndicator(r),"video"===i&&(a&&!h&&(s=nc.ts.parsePesTime(r))&&(s.type="video",n.video.push(s),h=!0),!n.firstKeyFrame)){if(a&&0!==f.size){for(o=new Uint8Array(f.size),u=0;f.data.length;)l=f.data.shift(),o.set(l,u),u+=l.byteLength;if(nc.ts.videoPacketContainsKeyFrame(o)){var p=nc.ts.parsePesTime(o);p?(n.firstKeyFrame=p,n.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.")}f.size=0}f.data.push(r),f.size+=r.byteLength}}if(h&&n.firstKeyFrame)break;c+=188,d+=188}for(c=(d=e.byteLength)-188,h=!1;c>=0;)if(71!==e[c]||71!==e[d])c--,d--;else{switch(r=e.subarray(c,d),nc.ts.parseType(r,t.pid)){case"pes":i=nc.ts.parsePesType(r,t.table),a=nc.ts.parsePayloadUnitStartIndicator(r),"video"===i&&a&&(s=nc.ts.parsePesTime(r))&&(s.type="video",n.video.push(s),h=!0)}if(h)break;c-=188,d-=188}},ac=function(e){var t={pid:null,table:null},n={};for(var r in function(e,t){for(var n,r=0,i=188;i<e.byteLength;)if(71!==e[r]||71!==e[i])r++,i++;else{switch(n=e.subarray(r,i),nc.ts.parseType(n,t.pid)){case"pat":t.pid||(t.pid=nc.ts.parsePat(n));break;case"pmt":t.table||(t.table=nc.ts.parsePmt(n))}if(t.pid&&t.table)return;r+=188,i+=188}}(e,t),t.table)if(t.table.hasOwnProperty(r)){switch(t.table[r]){case tl.H264_STREAM_TYPE:n.video=[],ic(e,t,n),0===n.video.length&&delete n.video;break;case tl.ADTS_STREAM_TYPE:n.audio=[],rc(e,t,n),0===n.audio.length&&delete n.audio}}return n},sc=function(e,t){var n;return(n=nc.aac.isLikelyAacData(e)?function(e){for(var t,n=!1,r=0,i=null,a=null,s=0,o=0;e.length-o>=3;){switch(nc.aac.parseType(e,o)){case"timed-metadata":if(e.length-o<10){n=!0;break}if((s=nc.aac.parseId3TagSize(e,o))>e.length){n=!0;break}null===a&&(t=e.subarray(o,o+s),a=nc.aac.parseAacTimestamp(t)),o+=s;break;case"audio":if(e.length-o<7){n=!0;break}if((s=nc.aac.parseAdtsSize(e,o))>e.length){n=!0;break}null===i&&(t=e.subarray(o,o+s),i=nc.aac.parseSampleRate(t)),r++,o+=s;break;default:o++}if(n)return null}if(null===i||null===a)return null;var u=9e4/i;return{audio:[{type:"audio",dts:a,pts:a},{type:"audio",dts:a+1024*r*u,pts:a+1024*r*u}]}}(e):ac(e))&&(n.audio||n.video)?(function(e,t){if(e.audio&&e.audio.length){var n=t;void 0===n&&(n=e.audio[0].dts),e.audio.forEach((function(e){e.dts=tc(e.dts,n),e.pts=tc(e.pts,n),e.dtsTime=e.dts/9e4,e.ptsTime=e.pts/9e4}))}if(e.video&&e.video.length){var r=t;if(void 0===r&&(r=e.video[0].dts),e.video.forEach((function(e){e.dts=tc(e.dts,r),e.pts=tc(e.pts,r),e.dtsTime=e.dts/9e4,e.ptsTime=e.pts/9e4})),e.firstKeyFrame){var i=e.firstKeyFrame;i.dts=tc(i.dts,r),i.pts=tc(i.pts,r),i.dtsTime=i.dts/9e4,i.ptsTime=i.dts/9e4}}}(n,t),n):null},oc=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},uc=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),lc=null,cc=function(){function e(t){oc(this,e),lc||(lc=function(){var e=[[[],[],[],[],[]],[[],[],[],[],[]]],t=e[0],n=e[1],r=t[4],i=n[4],a=void 0,s=void 0,o=void 0,u=[],l=[],c=void 0,d=void 0,h=void 0,f=void 0,p=void 0;for(a=0;a<256;a++)l[(u[a]=a<<1^283*(a>>7))^a]=a;for(s=o=0;!r[s];s^=c||1,o=l[o]||1)for(h=(h=o^o<<1^o<<2^o<<3^o<<4)>>8^255&h^99,r[s]=h,i[h]=s,p=16843009*u[d=u[c=u[s]]]^65537*d^257*c^16843008*s,f=257*u[h]^16843008*h,a=0;a<4;a++)t[a][s]=f=f<<24^f>>>8,n[a][h]=p=p<<24^p>>>8;for(a=0;a<5;a++)t[a]=t[a].slice(0),n[a]=n[a].slice(0);return e}()),this._tables=[[lc[0][0].slice(),lc[0][1].slice(),lc[0][2].slice(),lc[0][3].slice(),lc[0][4].slice()],[lc[1][0].slice(),lc[1][1].slice(),lc[1][2].slice(),lc[1][3].slice(),lc[1][4].slice()]];var n=void 0,r=void 0,i=void 0,a=void 0,s=void 0,o=this._tables[0][4],u=this._tables[1],l=t.length,c=1;if(4!==l&&6!==l&&8!==l)throw new Error("Invalid aes key size");for(a=t.slice(0),s=[],this._key=[a,s],n=l;n<4*l+28;n++)i=a[n-1],(n%l==0||8===l&&n%l==4)&&(i=o[i>>>24]<<24^o[i>>16&255]<<16^o[i>>8&255]<<8^o[255&i],n%l==0&&(i=i<<8^i>>>24^c<<24,c=c<<1^283*(c>>7))),a[n]=a[n-l]^i;for(r=0;n;r++,n--)i=a[3&r?n:n-4],s[r]=n<=4||r<4?i:u[0][o[i>>>24]]^u[1][o[i>>16&255]]^u[2][o[i>>8&255]]^u[3][o[255&i]]}return e.prototype.decrypt=function(e,t,n,r,i,a){var s=this._key[1],o=e^s[0],u=r^s[1],l=n^s[2],c=t^s[3],d=void 0,h=void 0,f=void 0,p=s.length/4-2,v=void 0,m=4,g=this._tables[1],y=g[0],_=g[1],b=g[2],T=g[3],S=g[4];for(v=0;v<p;v++)d=y[o>>>24]^_[u>>16&255]^b[l>>8&255]^T[255&c]^s[m],h=y[u>>>24]^_[l>>16&255]^b[c>>8&255]^T[255&o]^s[m+1],f=y[l>>>24]^_[c>>16&255]^b[o>>8&255]^T[255&u]^s[m+2],c=y[c>>>24]^_[o>>16&255]^b[u>>8&255]^T[255&l]^s[m+3],m+=4,o=d,u=h,l=f;for(v=0;v<4;v++)i[(3&-v)+a]=S[o>>>24]<<24^S[u>>16&255]<<16^S[l>>8&255]<<8^S[255&c]^s[m++],d=o,o=u,u=l,l=c,c=d},e}(),dc=function(){function e(){oc(this,e),this.listeners={}}return e.prototype.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},e.prototype.off=function(e,t){if(!this.listeners[e])return!1;var n=this.listeners[e].indexOf(t);return this.listeners[e].splice(n,1),n>-1},e.prototype.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var n=t.length,r=0;r<n;++r)t[r].call(this,arguments[1]);else for(var i=Array.prototype.slice.call(arguments,1),a=t.length,s=0;s<a;++s)t[s].apply(this,i)},e.prototype.dispose=function(){this.listeners={}},e.prototype.pipe=function(e){this.on("data",(function(t){e.push(t)}))},e}(),hc=function(e){function t(){oc(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,dc));return n.jobs=[],n.delay=1,n.timeout_=null,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},t.prototype.push=function(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},t}(dc),fc=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},pc=function(e,t,n){var r=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),i=new cc(Array.prototype.slice.call(t)),a=new Uint8Array(e.byteLength),s=new Int32Array(a.buffer),o=void 0,u=void 0,l=void 0,c=void 0,d=void 0,h=void 0,f=void 0,p=void 0,v=void 0;for(o=n[0],u=n[1],l=n[2],c=n[3],v=0;v<r.length;v+=4)d=fc(r[v]),h=fc(r[v+1]),f=fc(r[v+2]),p=fc(r[v+3]),i.decrypt(d,h,f,p,s,v),s[v]=fc(s[v]^o),s[v+1]=fc(s[v+1]^u),s[v+2]=fc(s[v+2]^l),s[v+3]=fc(s[v+3]^c),o=d,u=h,l=f,c=p;return a},vc=function(){function e(t,n,r,i){oc(this,e);var a=e.STEP,s=new Int32Array(t.buffer),o=new Uint8Array(t.byteLength),u=0;for(this.asyncStream_=new hc,this.asyncStream_.push(this.decryptChunk_(s.subarray(u,u+a),n,r,o)),u=a;u<s.length;u+=a)r=new Uint32Array([fc(s[u-4]),fc(s[u-3]),fc(s[u-2]),fc(s[u-1])]),this.asyncStream_.push(this.decryptChunk_(s.subarray(u,u+a),n,r,o));this.asyncStream_.push((function(){i(null,function(e){return e.subarray(0,e.byteLength-e[e.byteLength-1])}(o))}))}return e.prototype.decryptChunk_=function(e,t,n,r){return function(){var i=pc(e,t,n);r.set(i,e.byteOffset)}},uc(e,null,[{key:"STEP",get:function(){return 32e3}}]),e}(),mc=function(t,n){return/^[a-z]+:/i.test(n)?n:(/\/\//i.test(t)||(t=ws.buildAbsoluteURL(e.location.href,t)),ws.buildAbsoluteURL(t,n))},gc=function(e,t,n){return e&&n.responseURL&&t!==n.responseURL?n.responseURL:t},yc=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},_c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),bc=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},Tc=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},Sc=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var s,o=e[Symbol.iterator]();!(r=(s=o.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{!r&&o.return&&o.return()}finally{if(i)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},Ec=Me.mergeOptions,kc=Me.EventTarget,wc=Me.log,Cc=function(e,t){["AUDIO","SUBTITLES"].forEach((function(n){for(var r in e.mediaGroups[n])for(var i in e.mediaGroups[n][r]){var a=e.mediaGroups[n][r][i];t(a,n,r,i)}}))},Ac=function(e,t){var n=Ec(e,{}),r=n.playlists[t.uri];if(!r)return null;if(r.segments&&t.segments&&r.segments.length===t.segments.length&&r.endList===t.endList&&r.mediaSequence===t.mediaSequence)return null;var i=Ec(r,t);r.segments&&(i.segments=function(e,t,n){var r=t.slice();n=n||0;for(var i=Math.min(e.length,t.length+n),a=n;a<i;a++)r[a-n]=Ec(e[a],r[a-n]);return r}(r.segments,t.segments,t.mediaSequence-r.mediaSequence)),i.segments.forEach((function(e){!function(e,t){e.resolvedUri||(e.resolvedUri=mc(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=mc(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=mc(t,e.map.uri))}(e,i.resolvedUri)}));for(var a=0;a<n.playlists.length;a++)n.playlists[a].uri===t.uri&&(n.playlists[a]=i);return n.playlists[t.uri]=i,n},Lc=function(e){for(var t=e.playlists.length;t--;){var n=e.playlists[t];e.playlists[n.uri]=n,n.resolvedUri=mc(e.uri,n.uri),n.id=t,n.attributes||(n.attributes={},wc.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute."))}},Rc=function(e){Cc(e,(function(t){t.uri&&(t.resolvedUri=mc(e.uri,t.uri))}))},xc=function(e,t){var n=e.segments[e.segments.length-1];return t&&n&&n.duration?1e3*n.duration:500*(e.targetDuration||10)},Ic=function(t){function n(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};yc(this,n);var i=Tc(this,(n.__proto__||Object.getPrototypeOf(n)).call(this)),a=r.withCredentials,s=void 0!==a&&a,o=r.handleManifestRedirects,u=void 0!==o&&o;i.srcUrl=e,i.hls_=t,i.withCredentials=s,i.handleManifestRedirects=u;var l=t.options_;if(i.customTagParsers=l&&l.customTagParsers||[],i.customTagMappers=l&&l.customTagMappers||[],!i.srcUrl)throw new Error("A non-empty playlist URL is required");return i.state="HAVE_NOTHING",i.on("mediaupdatetimeout",(function(){"HAVE_METADATA"===i.state&&(i.state="HAVE_CURRENT_METADATA",i.request=i.hls_.xhr({uri:mc(i.master.uri,i.media().uri),withCredentials:i.withCredentials},(function(e,t){if(i.request)return e?i.playlistRequestError(i.request,i.media().uri,"HAVE_METADATA"):void i.haveMetadata(i.request,i.media().uri)})))})),i}return bc(n,t),_c(n,[{key:"playlistRequestError",value:function(e,t,n){this.request=null,n&&(this.state=n),this.error={playlist:this.master.playlists[t],status:e.status,message:"HLS playlist request error at URL: "+t+".",responseText:e.responseText,code:e.status>=500?4:2},this.trigger("error")}},{key:"haveMetadata",value:function(t,n){var r=this;this.request=null,this.state="HAVE_METADATA";var i=new xs;this.customTagParsers.forEach((function(e){return i.addParser(e)})),this.customTagMappers.forEach((function(e){return i.addTagMapper(e)})),i.push(t.responseText),i.end(),i.manifest.uri=n,i.manifest.attributes=i.manifest.attributes||{};var a=Ac(this.master,i.manifest);this.targetDuration=i.manifest.targetDuration,a?(this.master=a,this.media_=this.master.playlists[i.manifest.uri]):this.trigger("playlistunchanged"),this.media().endList||(e.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=e.setTimeout((function(){r.trigger("mediaupdatetimeout")}),xc(this.media(),!!a))),this.trigger("loadedplaylist")}},{key:"dispose",value:function(){this.stopRequest(),e.clearTimeout(this.mediaUpdateTimeout),e.clearTimeout(this.finalRenditionTimeout)}},{key:"stopRequest",value:function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}},{key:"media",value:function(t,n){var r=this;if(!t)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);if("string"==typeof t){if(!this.master.playlists[t])throw new Error("Unknown playlist URI: "+t);t=this.master.playlists[t]}if(e.clearTimeout(this.finalRenditionTimeout),n){var i=t.targetDuration/2*1e3||5e3;this.finalRenditionTimeout=e.setTimeout(this.media.bind(this,t,!1),i)}else{var a=this.state,s=!this.media_||t.uri!==this.media_.uri;if(this.master.playlists[t.uri].endList)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=t,void(s&&(this.trigger("mediachanging"),this.trigger("mediachange")));if(s){if(this.state="SWITCHING_MEDIA",this.request){if(t.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.request=this.hls_.xhr({uri:t.resolvedUri,withCredentials:this.withCredentials},(function(e,n){if(r.request){if(t.resolvedUri=gc(r.handleManifestRedirects,t.resolvedUri,n),e)return r.playlistRequestError(r.request,t.uri,a);r.haveMetadata(n,t.uri),"HAVE_MASTER"===a?r.trigger("loadedmetadata"):r.trigger("mediachange")}}))}}}},{key:"pause",value:function(){this.stopRequest(),e.clearTimeout(this.mediaUpdateTimeout),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MASTER":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")}},{key:"load",value:function(t){var n=this;e.clearTimeout(this.mediaUpdateTimeout);var r=this.media();if(t){var i=r?r.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=e.setTimeout((function(){return n.load()}),i)}else this.started?r&&!r.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()}},{key:"start",value:function(){var t=this;this.started=!0,this.request=this.hls_.xhr({uri:this.srcUrl,withCredentials:this.withCredentials},(function(n,r){if(t.request){if(t.request=null,n)return t.error={status:r.status,message:"HLS playlist request error at URL: "+t.srcUrl+".",responseText:r.responseText,code:2},"HAVE_NOTHING"===t.state&&(t.started=!1),t.trigger("error");var i=new xs;return t.customTagParsers.forEach((function(e){return i.addParser(e)})),t.customTagMappers.forEach((function(e){return i.addTagMapper(e)})),i.push(r.responseText),i.end(),t.state="HAVE_MASTER",t.srcUrl=gc(t.handleManifestRedirects,t.srcUrl,r),i.manifest.uri=t.srcUrl,i.manifest.playlists?(t.master=i.manifest,Lc(t.master),Rc(t.master),t.trigger("loadedplaylist"),void(t.request||t.media(i.manifest.playlists[0]))):(t.master={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:e.location.href,playlists:[{uri:t.srcUrl,id:0,resolvedUri:t.srcUrl,attributes:{}}]},t.master.playlists[t.srcUrl]=t.master.playlists[0],t.haveMetadata(r,t.srcUrl),t.trigger("loadedmetadata"))}}))}}]),n}(kc),Oc=Me.createTimeRange,Dc=function(e,t,n){var r=void 0,i=void 0;return void 0===t&&(t=e.mediaSequence+e.segments.length),t<e.mediaSequence?0:(r=function(e,t){var n=0,r=t-e.mediaSequence,i=e.segments[r];if(i){if(void 0!==i.start)return{result:i.start,precise:!0};if(void 0!==i.end)return{result:i.end-i.duration,precise:!0}}for(;r--;){if(void 0!==(i=e.segments[r]).end)return{result:n+i.end,precise:!0};if(n+=i.duration,void 0!==i.start)return{result:n+i.start,precise:!0}}return{result:n,precise:!1}}(e,t)).precise?r.result:(i=function(e,t){for(var n=0,r=void 0,i=t-e.mediaSequence;i<e.segments.length;i++){if(void 0!==(r=e.segments[i]).start)return{result:r.start-n,precise:!0};if(n+=r.duration,void 0!==r.end)return{result:r.end-n,precise:!0}}return{result:-1,precise:!1}}(e,t)).precise?i.result:r.result+n},Pc=function(t,n,r){if(!t)return 0;if("number"!=typeof r&&(r=0),void 0===n){if(t.totalDuration)return t.totalDuration;if(!t.endList)return e.Infinity}return Dc(t,n,r)},Mc=function(e,t,n){var r=0;if(t>n){var i=[n,t];t=i[0],n=i[1]}if(t<0){for(var a=t;a<Math.min(0,n);a++)r+=e.targetDuration;t=0}for(var s=t;s<n;s++)r+=e.segments[s].duration;return r},jc=function(e){if(!e.segments.length)return 0;for(var t=e.segments.length-1,n=e.segments[t].duration||e.targetDuration,r=n+2*e.targetDuration;t--&&!((n+=e.segments[t].duration)>=r););return Math.max(0,t)},Uc=function(e,t,n){if(!e||!e.segments)return null;if(e.endList)return Pc(e);if(null===t)return null;t=t||0;var r=n?jc(e):e.segments.length;return Dc(e,e.mediaSequence+r,t)},Bc=function(e){return e-Math.floor(e)==0},Fc=function(e,t){if(Bc(t))return t+.1*e;for(var n=t.toString().split(".")[1].length,r=1;r<=n;r++){var i=Math.pow(10,r),a=t*i;if(Bc(a)||r===n)return(a+e)/i}},Nc=Fc.bind(null,1),Gc=Fc.bind(null,-1),Vc=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},Hc=function(e){return e.excludeUntil&&e.excludeUntil===1/0},zc=function(e){var t=Vc(e);return!e.disabled&&!t},Wc=function(e,t){return t.attributes&&t.attributes[e]},Kc=function(e,t){if(1===e.playlists.length)return!0;var n=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter((function(e){return!!zc(e)&&(e.attributes.BANDWIDTH||0)<n})).length},qc={duration:Pc,seekable:function(e,t){var n=t||0,r=Uc(e,t,!0);return null===r?Oc():Oc(n,r)},safeLiveIndex:jc,getMediaInfoForTime:function(e,t,n,r){var i=void 0,a=void 0,s=e.segments.length,o=t-r;if(o<0){if(n>0)for(i=n-1;i>=0;i--)if(a=e.segments[i],(o+=Gc(a.duration))>0)return{mediaIndex:i,startTime:r-Mc(e,n,i)};return{mediaIndex:0,startTime:t}}if(n<0){for(i=n;i<0;i++)if((o-=e.targetDuration)<0)return{mediaIndex:0,startTime:t};n=0}for(i=n;i<s;i++)if(a=e.segments[i],(o-=Nc(a.duration))<0)return{mediaIndex:i,startTime:r+Mc(e,n,i)};return{mediaIndex:s-1,startTime:t}},isEnabled:zc,isDisabled:function(e){return e.disabled},isBlacklisted:Vc,isIncompatible:Hc,playlistEnd:Uc,isAes:function(e){for(var t=0;t<e.segments.length;t++)if(e.segments[t].key)return!0;return!1},isFmp4:function(e){for(var t=0;t<e.segments.length;t++)if(e.segments[t].map)return!0;return!1},hasAttribute:Wc,estimateSegmentRequestTime:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return Wc("BANDWIDTH",n)?(e*n.attributes.BANDWIDTH-8*r)/t:NaN},isLowestEnabledRendition:Kc},$c=Me.xhr,Yc=Me.mergeOptions,Xc=function(){return function e(t,n){t=Yc({timeout:45e3},t);var r=e.beforeRequest||Me.Hls.xhr.beforeRequest;if(r&&"function"==typeof r){var i=r(t);i&&(t=i)}var a=$c(t,(function(e,t){var r=a.response;!e&&r&&(a.responseTime=Date.now(),a.roundTripTime=a.responseTime-a.requestTime,a.bytesReceived=r.byteLength||r.length,a.bandwidth||(a.bandwidth=Math.floor(a.bytesReceived/a.roundTripTime*8*1e3))),t.headers&&(a.responseHeaders=t.headers),e&&"ETIMEDOUT"===e.code&&(a.timedout=!0),e||a.aborted||200===t.statusCode||206===t.statusCode||0===t.statusCode||(e=new Error("XHR Failed with a response of: "+(a&&(r||a.responseText)))),n(e,a)})),s=a.abort;return a.abort=function(){return a.aborted=!0,s.apply(a,arguments)},a.uri=t.uri,a.requestTime=Date.now(),a}},Jc=function(e){var t={};return e.byterange&&(t.Range=function(e){var t;return t=e.offset+e.length-1,"bytes="+e.offset+"-"+t}(e.byterange)),t},Qc=function(e,t){return e.start(t)+"-"+e.end(t)},Zc=function(e,t){var n=e.toString(16);return"00".substring(0,2-n.length)+n+(t%2?" ":"")},ed=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},td=function(e){var t={};return Object.keys(e).forEach((function(n){var r=e[n];ArrayBuffer.isView(r)?t[n]={bytes:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength}:t[n]=r})),t},nd=function(e){var t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},rd=function(e){return e.resolvedUri},id=function(e){for(var t=Array.prototype.slice.call(e),n="",r=0;r<t.length/16;r++)n+=t.slice(16*r,16*r+16).map(Zc).join("")+" "+t.slice(16*r,16*r+16).map(ed).join("")+"\n";return n},ad=Object.freeze({createTransferableMessage:td,initSegmentId:nd,segmentKeyId:rd,hexDump:id,tagDump:function(e){var t=e.bytes;return id(t)},textRanges:function(e){var t="",n=void 0;for(n=0;n<e.length;n++)t+=Qc(e,n)+" ";return t}}),sd=function(e){var t=e.playlist,n=e.time,r=void 0===n?void 0:n,i=e.callback;if(!i)throw new Error("getProgramTime: callback must be provided");if(!t||void 0===r)return i({message:"getProgramTime: playlist and time must be provided"});var a=function(e,t){if(!t||!t.segments||0===t.segments.length)return null;for(var n=0,r=void 0,i=0;i<t.segments.length&&!(e<=(n=(r=t.segments[i]).videoTimingInfo?r.videoTimingInfo.transmuxedPresentationEnd:n+r.duration));i++);var a=t.segments[t.segments.length-1];if(a.videoTimingInfo&&a.videoTimingInfo.transmuxedPresentationEnd<e)return null;if(e>n){if(e>n+.25*a.duration)return null;r=a}return{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:n-r.duration,type:r.videoTimingInfo?"accurate":"estimate"}}(r,t);if(!a)return i({message:"valid programTime was not found"});if("estimate"===a.type)return i({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:a.estimatedStart});var s={mediaSeconds:r},o=function(e,t){if(!t.dateTimeObject)return null;var n=t.videoTimingInfo.transmuxerPrependedSeconds,r=e-(t.videoTimingInfo.transmuxedPresentationStart+n);return new Date(t.dateTimeObject.getTime()+1e3*r)}(r,a.segment);return o&&(s.programDateTime=o.toISOString()),i(null,s)},od=function e(t){var n=t.programTime,r=t.playlist,i=t.retryCount,a=void 0===i?2:i,s=t.seekTo,o=t.pauseAfterSeek,u=void 0===o||o,l=t.tech,c=t.callback;if(!c)throw new Error("seekToProgramTime: callback must be provided");if(void 0===n||!r||!s)return c({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!r.endList&&!l.hasStarted_)return c({message:"player must be playing a live stream to start buffering"});if(!function(e){if(!e.segments||0===e.segments.length)return!1;for(var t=0;t<e.segments.length;t++)if(!e.segments[t].dateTimeObject)return!1;return!0}(r))return c({message:"programDateTime tags must be provided in the manifest "+r.resolvedUri});var d=function(e,t){var n=void 0;try{n=new Date(e)}catch(e){return null}if(!t||!t.segments||0===t.segments.length)return null;var r=t.segments[0];if(n<r.dateTimeObject)return null;for(var i=0;i<t.segments.length-1&&(r=t.segments[i],!(n<t.segments[i+1].dateTimeObject));i++);var a=t.segments[t.segments.length-1],s=a.dateTimeObject,o=a.videoTimingInfo?function(e){return e.transmuxedPresentationEnd-e.transmuxedPresentationStart-e.transmuxerPrependedSeconds}(a.videoTimingInfo):a.duration+.25*a.duration;return n>new Date(s.getTime()+1e3*o)?null:(n>s&&(r=a),{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:qc.duration(t,t.mediaSequence+t.segments.indexOf(r)),type:r.videoTimingInfo?"accurate":"estimate"})}(n,r);if(!d)return c({message:n+" was not found in the stream"});var h=d.segment,f=function(e,t){var n=void 0,r=void 0;try{n=new Date(e),r=new Date(t)}catch(e){}var i=n.getTime();return(r.getTime()-i)/1e3}(h.dateTimeObject,n);if("estimate"===d.type)return 0===a?c({message:n+" is not buffered yet. Try again"}):(s(d.estimatedStart+f),void l.one("seeked",(function(){e({programTime:n,playlist:r,retryCount:a-1,seekTo:s,pauseAfterSeek:u,tech:l,callback:c})})));var p=h.start+f;l.one("seeked",(function(){return c(null,l.currentTime())})),u&&l.pause(),s(p)},ud=function(e,t){var n=[],r=void 0;if(e&&e.length)for(r=0;r<e.length;r++)t(e.start(r),e.end(r))&&n.push([e.start(r),e.end(r)]);return Me.createTimeRanges(n)},ld=function(e,t){return ud(e,(function(e,n){return e-1/30<=t&&n+1/30>=t}))},cd=function(e,t){return ud(e,(function(e){return e-1/30>=t}))},dd=function(e){var t=[];if(!e||!e.length)return"";for(var n=0;n<e.length;n++)t.push(e.start(n)+" => "+e.end(n));return t.join(", ")},hd=function(e){for(var t=[],n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t},fd=function(e,t,n){var r=void 0,i=void 0;if(n&&n.cues)for(r=n.cues.length;r--;)(i=n.cues[r]).startTime<=t&&i.endTime>=e&&n.removeCue(i)},pd=function(e){return isNaN(e)||Math.abs(e)===1/0?Number.MAX_VALUE:e},vd=function(t,n,r){var i=e.WebKitDataCue||e.VTTCue;if(n&&n.forEach((function(e){var t=e.stream;this.inbandTextTracks_[t].addCue(new i(e.startTime+this.timestampOffset,e.endTime+this.timestampOffset,e.text))}),t),r){var a=pd(t.mediaSource_.duration);if(r.forEach((function(t){var n=t.cueTime+this.timestampOffset;!("number"!=typeof n||e.isNaN(n)||n<0)&&n<1/0&&t.frames.forEach((function(e){var t=new i(n,n,e.value||e.url||e.data||"");t.frame=e,t.value=e,function(e){Object.defineProperties(e.frame,{id:{get:function(){return Me.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key}},value:{get:function(){return Me.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data}},privateData:{get:function(){return Me.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data}}})}(t),this.metadataTrack_.addCue(t)}),this)}),t),t.metadataTrack_&&t.metadataTrack_.cues&&t.metadataTrack_.cues.length){for(var s=t.metadataTrack_.cues,o=[],u=0;u<s.length;u++)s[u]&&o.push(s[u]);var l=o.reduce((function(e,t){var n=e[t.startTime]||[];return n.push(t),e[t.startTime]=n,e}),{}),c=Object.keys(l).sort((function(e,t){return Number(e)-Number(t)}));c.forEach((function(e,t){var n=l[e],r=Number(c[t+1])||a;n.forEach((function(e){e.endTime=r}))}))}}},md="undefined"!=typeof window?window:{},gd="undefined"==typeof Symbol?"__target":Symbol(),yd="application/javascript",_d=md.BlobBuilder||md.WebKitBlobBuilder||md.MozBlobBuilder||md.MSBlobBuilder,bd=md.URL||md.webkitURL||bd&&bd.msURL,Td=md.Worker;if(Td){var Sd,Ed=Ge("self.onmessage = function () {}"),kd=new Uint8Array(1);try{(Sd=new Td(Ed)).postMessage(kd,[kd.buffer])}catch(e){Td=null}finally{bd.revokeObjectURL(Ed),Sd&&Sd.terminate()}}var wd=new Ne("./transmuxer-worker.worker.js",(function(e,t){var n=this;!function(){var e,t,r,i,a,s,o,u,l,c,d,h,f,p,v,m,g,y,_,b,T,S,E,k,w,C,A,L,R,x,I,O,D,P,M,j,U=Math.pow(2,32)-1;!function(){var e;if(E={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},"undefined"!=typeof Uint8Array){for(e in E)E.hasOwnProperty(e)&&(E[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);k=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),C=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),w=new Uint8Array([0,0,0,1]),A=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),L=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),R={video:A,audio:L},O=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),I=new Uint8Array([0,0,0,0,0,0,0,0]),D=new Uint8Array([0,0,0,0,0,0,0,0]),P=D,M=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),j=D,x=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}}(),e=function(e){var t,n,r=[],i=0;for(t=1;t<arguments.length;t++)r.push(arguments[t]);for(t=r.length;t--;)i+=r[t].byteLength;for(n=new Uint8Array(i+8),new DataView(n.buffer,n.byteOffset,n.byteLength).setUint32(0,n.byteLength),n.set(e,4),t=0,i=8;t<r.length;t++)n.set(r[t],i),i+=r[t].byteLength;return n},t=function(){return e(E.dinf,e(E.dref,O))},r=function(t){return e(E.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,t.audioobjecttype<<3|t.samplingfrequencyindex>>>1,t.samplingfrequencyindex<<7|t.channelcount<<3,6,1,2]))},i=function(){return e(E.ftyp,k,w,k,C)},m=function(t){return e(E.hdlr,R[t])},a=function(t){return e(E.mdat,t)},v=function(t){var n=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,t.duration>>>24&255,t.duration>>>16&255,t.duration>>>8&255,255&t.duration,85,196,0,0]);return t.samplerate&&(n[12]=t.samplerate>>>24&255,n[13]=t.samplerate>>>16&255,n[14]=t.samplerate>>>8&255,n[15]=255&t.samplerate),e(E.mdhd,n)},p=function(t){return e(E.mdia,v(t),m(t.type),o(t))},s=function(t){return e(E.mfhd,new Uint8Array([0,0,0,0,(4278190080&t)>>24,(16711680&t)>>16,(65280&t)>>8,255&t]))},o=function(n){return e(E.minf,"video"===n.type?e(E.vmhd,x):e(E.smhd,I),t(),y(n))},u=function(t,n){for(var r=[],i=n.length;i--;)r[i]=b(n[i]);return e.apply(null,[E.moof,s(t)].concat(r))},l=function(t){for(var n=t.length,r=[];n--;)r[n]=h(t[n]);return e.apply(null,[E.moov,d(4294967295)].concat(r).concat(c(t)))},c=function(t){for(var n=t.length,r=[];n--;)r[n]=T(t[n]);return e.apply(null,[E.mvex].concat(r))},d=function(t){var n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&t)>>24,(16711680&t)>>16,(65280&t)>>8,255&t,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return e(E.mvhd,n)},g=function(t){var n,r,i=t.samples||[],a=new Uint8Array(4+i.length);for(r=0;r<i.length;r++)n=i[r].flags,a[r+4]=n.dependsOn<<4|n.isDependedOn<<2|n.hasRedundancy;return e(E.sdtp,a)},y=function(t){return e(E.stbl,_(t),e(E.stts,j),e(E.stsc,P),e(E.stsz,M),e(E.stco,D))},function(){var t,n;_=function(r){return e(E.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===r.type?t(r):n(r))},t=function(t){var n,r=t.sps||[],i=t.pps||[],a=[],s=[];for(n=0;n<r.length;n++)a.push((65280&r[n].byteLength)>>>8),a.push(255&r[n].byteLength),a=a.concat(Array.prototype.slice.call(r[n]));for(n=0;n<i.length;n++)s.push((65280&i[n].byteLength)>>>8),s.push(255&i[n].byteLength),s=s.concat(Array.prototype.slice.call(i[n]));return e(E.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&t.width)>>8,255&t.width,(65280&t.height)>>8,255&t.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),e(E.avcC,new Uint8Array([1,t.profileIdc,t.profileCompatibility,t.levelIdc,255].concat([r.length]).concat(a).concat([i.length]).concat(s))),e(E.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])))},n=function(t){return e(E.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&t.channelcount)>>8,255&t.channelcount,(65280&t.samplesize)>>8,255&t.samplesize,0,0,0,0,(65280&t.samplerate)>>8,255&t.samplerate,0,0]),r(t))}}(),f=function(t){var n=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&t.id)>>24,(16711680&t.id)>>16,(65280&t.id)>>8,255&t.id,0,0,0,0,(4278190080&t.duration)>>24,(16711680&t.duration)>>16,(65280&t.duration)>>8,255&t.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&t.width)>>8,255&t.width,0,0,(65280&t.height)>>8,255&t.height,0,0]);return e(E.tkhd,n)},b=function(t){var n,r,i,a,s,o;return n=e(E.tfhd,new Uint8Array([0,0,0,58,(4278190080&t.id)>>24,(16711680&t.id)>>16,(65280&t.id)>>8,255&t.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),s=Math.floor(t.baseMediaDecodeTime/(U+1)),o=Math.floor(t.baseMediaDecodeTime%(U+1)),r=e(E.tfdt,new Uint8Array([1,0,0,0,s>>>24&255,s>>>16&255,s>>>8&255,255&s,o>>>24&255,o>>>16&255,o>>>8&255,255&o])),92,"audio"===t.type?(i=S(t,92),e(E.traf,n,r,i)):(a=g(t),i=S(t,a.length+92),e(E.traf,n,r,i,a))},h=function(t){return t.duration=t.duration||4294967295,e(E.trak,f(t),p(t))},T=function(t){var n=new Uint8Array([0,0,0,0,(4278190080&t.id)>>24,(16711680&t.id)>>16,(65280&t.id)>>8,255&t.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==t.type&&(n[n.length-1]=0),e(E.trex,n)},function(){var t,n,r;r=function(e,t){var n=0,r=0,i=0,a=0;return e.length&&(void 0!==e[0].duration&&(n=1),void 0!==e[0].size&&(r=2),void 0!==e[0].flags&&(i=4),void 0!==e[0].compositionTimeOffset&&(a=8)),[0,0,n|r|i|a,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},n=function(t,n){var i,a,s,o;for(n+=20+16*(a=t.samples||[]).length,i=r(a,n),o=0;o<a.length;o++)s=a[o],i=i.concat([(4278190080&s.duration)>>>24,(16711680&s.duration)>>>16,(65280&s.duration)>>>8,255&s.duration,(4278190080&s.size)>>>24,(16711680&s.size)>>>16,(65280&s.size)>>>8,255&s.size,s.flags.isLeading<<2|s.flags.dependsOn,s.flags.isDependedOn<<6|s.flags.hasRedundancy<<4|s.flags.paddingValue<<1|s.flags.isNonSyncSample,61440&s.flags.degradationPriority,15&s.flags.degradationPriority,(4278190080&s.compositionTimeOffset)>>>24,(16711680&s.compositionTimeOffset)>>>16,(65280&s.compositionTimeOffset)>>>8,255&s.compositionTimeOffset]);return e(E.trun,new Uint8Array(i))},t=function(t,n){var i,a,s,o;for(n+=20+8*(a=t.samples||[]).length,i=r(a,n),o=0;o<a.length;o++)s=a[o],i=i.concat([(4278190080&s.duration)>>>24,(16711680&s.duration)>>>16,(65280&s.duration)>>>8,255&s.duration,(4278190080&s.size)>>>24,(16711680&s.size)>>>16,(65280&s.size)>>>8,255&s.size]);return e(E.trun,new Uint8Array(i))},S=function(e,r){return"audio"===e.type?t(e,r):n(e,r)}}();var B,F,N,G,V,H={ftyp:i,mdat:a,moof:u,moov:l,initSegment:function(e){var t,n=i(),r=l(e);return(t=new Uint8Array(n.byteLength+r.byteLength)).set(n),t.set(r,n.byteLength),t}},z=function(e){return e>>>0};N=function(e){return B(e,["moov","trak"]).reduce((function(e,t){var n,r,i,a,s;return(n=B(t,["tkhd"])[0])?(r=n[0],a=z(n[i=0===r?12:20]<<24|n[i+1]<<16|n[i+2]<<8|n[i+3]),(s=B(t,["mdia","mdhd"])[0])?(i=0===(r=s[0])?12:20,e[a]=z(s[i]<<24|s[i+1]<<16|s[i+2]<<8|s[i+3]),e):null):null}),{})},G=function(e,t){var n,r,i;return n=B(t,["moof","traf"]),r=[].concat.apply([],n.map((function(t){return B(t,["tfhd"]).map((function(n){var r,i;return r=z(n[4]<<24|n[5]<<16|n[6]<<8|n[7]),i=e[r]||9e4,(B(t,["tfdt"]).map((function(e){var t,n;return t=e[0],n=z(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),1===t&&(n*=Math.pow(2,32),n+=z(e[8]<<24|e[9]<<16|e[10]<<8|e[11])),n}))[0]||1/0)/i}))}))),i=Math.min.apply(null,r),isFinite(i)?i:0},V=function(e){var t=B(e,["moov","trak"]),n=[];return t.forEach((function(e){var t=B(e,["mdia","hdlr"]),r=B(e,["tkhd"]);t.forEach((function(e,t){var i,a,s=F(e.subarray(8,12)),o=r[t];"vide"===s&&(a=0===(i=new DataView(o.buffer,o.byteOffset,o.byteLength)).getUint8(0)?i.getUint32(12):i.getUint32(20),n.push(a))}))})),n};var W={findBox:B=function(e,t){var n,r,i,a,s,o=[];if(!t.length)return null;for(n=0;n<e.byteLength;)r=z(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3]),i=F(e.subarray(n+4,n+8)),a=r>1?n+r:e.byteLength,i===t[0]&&(1===t.length?o.push(e.subarray(n+8,a)):(s=B(e.subarray(n+8,a),t.slice(1))).length&&(o=o.concat(s))),n=a;return o},parseType:F=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),(t+=String.fromCharCode(e[2]))+String.fromCharCode(e[3])},timescale:N,startTime:G,videoTrackIds:V},K=function(){this.init=function(){var e={};this.on=function(t,n){e[t]||(e[t]=[]),e[t]=e[t].concat(n)},this.off=function(t,n){var r;return!!e[t]&&(r=e[t].indexOf(n),e[t]=e[t].slice(),e[t].splice(r,1),r>-1)},this.trigger=function(t){var n,r,i,a;if(n=e[t])if(2===arguments.length)for(i=n.length,r=0;r<i;++r)n[r].call(this,arguments[1]);else{for(a=[],r=arguments.length,r=1;r<arguments.length;++r)a.push(arguments[r]);for(i=n.length,r=0;r<i;++r)n[r].apply(this,a)}},this.dispose=function(){e={}}}};K.prototype.pipe=function(e){return this.on("data",(function(t){e.push(t)})),this.on("done",(function(t){e.flush(t)})),e},K.prototype.push=function(e){this.trigger("data",e)},K.prototype.flush=function(e){this.trigger("done",e)};var q,$,Y,X,J,Q,Z=K,ee=function(e,t){var n={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return n.dataOffset=t,n.compositionTimeOffset=e.pts-e.dts,n.duration=e.duration,n.size=4*e.length,n.size+=e.byteLength,e.keyFrame&&(n.flags.dependsOn=2,n.flags.isNonSyncSample=0),n},te=function(e){var t,n,r=[],i=[];for(r.byteLength=0,t=0;t<e.length;t++)"access_unit_delimiter_rbsp"===(n=e[t]).nalUnitType?(r.length&&(r.duration=n.dts-r.dts,i.push(r)),(r=[n]).byteLength=n.data.byteLength,r.pts=n.pts,r.dts=n.dts):("slice_layer_without_partitioning_rbsp_idr"===n.nalUnitType&&(r.keyFrame=!0),r.duration=n.dts-r.dts,r.byteLength+=n.data.byteLength,r.push(n));return i.length&&(!r.duration||r.duration<=0)&&(r.duration=i[i.length-1].duration),i.push(r),i},ne=function(e){var t,n,r=[],i=[];for(r.byteLength=0,r.nalCount=0,r.duration=0,r.pts=e[0].pts,r.dts=e[0].dts,i.byteLength=0,i.nalCount=0,i.duration=0,i.pts=e[0].pts,i.dts=e[0].dts,t=0;t<e.length;t++)(n=e[t]).keyFrame?(r.length&&(i.push(r),i.byteLength+=r.byteLength,i.nalCount+=r.nalCount,i.duration+=r.duration),(r=[n]).nalCount=n.length,r.byteLength=n.byteLength,r.pts=n.pts,r.dts=n.dts,r.duration=n.duration):(r.duration+=n.duration,r.nalCount+=n.length,r.byteLength+=n.byteLength,r.push(n));return i.length&&r.duration<=0&&(r.duration=i[i.length-1].duration),i.byteLength+=r.byteLength,i.nalCount+=r.nalCount,i.duration+=r.duration,i.push(r),i},re=function(e){var t;return!e[0][0].keyFrame&&e.length>1&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e},ie=function(e,t){var n,r,i,a,s,o=t||0,u=[];for(n=0;n<e.length;n++)for(a=e[n],r=0;r<a.length;r++)s=a[r],o+=(i=ee(s,o)).size,u.push(i);return u},ae=function(e){var t,n,r,i,a,s,o=0,u=e.byteLength,l=e.nalCount,c=new Uint8Array(u+4*l),d=new DataView(c.buffer);for(t=0;t<e.length;t++)for(i=e[t],n=0;n<i.length;n++)for(a=i[n],r=0;r<a.length;r++)s=a[r],d.setUint32(o,s.data.byteLength),o+=4,c.set(s.data,o),o+=s.data.byteLength;return c},se=[33,16,5,32,164,27],oe=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],ue=function(e){for(var t=[];e--;)t.push(0);return t},le=function(e){return Object.keys(e).reduce((function(t,n){return t[n]=new Uint8Array(e[n].reduce((function(e,t){return e.concat(t)}),[])),t}),{})}({96e3:[se,[227,64],ue(154),[56]],88200:[se,[231],ue(170),[56]],64e3:[se,[248,192],ue(240),[56]],48e3:[se,[255,192],ue(268),[55,148,128],ue(54),[112]],44100:[se,[255,192],ue(268),[55,163,128],ue(84),[112]],32e3:[se,[255,192],ue(268),[55,234],ue(226),[112]],24e3:[se,[255,192],ue(268),[55,255,128],ue(268),[111,112],ue(126),[224]],16e3:[se,[255,192],ue(268),[55,255,128],ue(268),[111,255],ue(269),[223,108],ue(195),[1,192]],12e3:[oe,ue(268),[3,127,248],ue(268),[6,255,240],ue(268),[13,255,224],ue(268),[27,253,128],ue(259),[56]],11025:[oe,ue(268),[3,127,248],ue(268),[6,255,240],ue(268),[13,255,224],ue(268),[27,255,192],ue(268),[55,175,128],ue(108),[112]],8e3:[oe,ue(268),[3,121,16],ue(47),[7]]});J=function(e,t){return q(X(e,t))},Q=function(e,t){return $(Y(e),t)};q=function(e){return 9e4*e},$=function(e,t){return e*t},Y=function(e){return e/9e4},X=function(e,t){return e/t};var ce=J,de=Q,he=function(e,t,n,r){var i,a,s,o=0,u=0,l=0,c=0;if(t.length&&(i=ce(e.baseMediaDecodeTime,e.samplerate),o=Math.ceil(9e4/(e.samplerate/1024)),n&&r&&(u=i-Math.max(n,r),c=(l=Math.floor(u/o))*o),!(l<1||c>45e3))){for((a=le[e.samplerate])||(a=t[0].data),s=0;s<l;s++)t.splice(s,0,{data:a});e.baseMediaDecodeTime-=Math.floor(de(c,e.samplerate))}},fe=function(e,t,n){return t.minSegmentDts>=n?e:(t.minSegmentDts=1/0,e.filter((function(e){return e.dts>=n&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0)})))},pe=function(e){var t,n,r=[];for(t=0;t<e.length;t++)n=e[t],r.push({size:n.data.byteLength,duration:1024});return r},ve=function(e){var t,n,r=0,i=new Uint8Array(function(e){var t,n=0;for(t=0;t<e.length;t++)n+=e[t].data.byteLength;return n}(e));for(t=0;t<e.length;t++)n=e[t],i.set(n.data,r),r+=n.data.byteLength;return i},me=function(e){delete e.minSegmentDts,delete e.maxSegmentDts,delete e.minSegmentPts,delete e.maxSegmentPts},ge=function(e,t){var n,r=e.minSegmentDts;return t||(r-=e.timelineStartInfo.dts),n=e.timelineStartInfo.baseMediaDecodeTime,n+=r,n=Math.max(0,n),"audio"===e.type&&(n*=e.samplerate/9e4,n=Math.floor(n)),n},ye=function(e,t){"number"==typeof t.pts&&(void 0===e.timelineStartInfo.pts&&(e.timelineStartInfo.pts=t.pts),void 0===e.minSegmentPts?e.minSegmentPts=t.pts:e.minSegmentPts=Math.min(e.minSegmentPts,t.pts),void 0===e.maxSegmentPts?e.maxSegmentPts=t.pts:e.maxSegmentPts=Math.max(e.maxSegmentPts,t.pts)),"number"==typeof t.dts&&(void 0===e.timelineStartInfo.dts&&(e.timelineStartInfo.dts=t.dts),void 0===e.minSegmentDts?e.minSegmentDts=t.dts:e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),void 0===e.maxSegmentDts?e.maxSegmentDts=t.dts:e.maxSegmentDts=Math.max(e.maxSegmentDts,t.dts))},_e=function(e){for(var t=0,n={payloadType:-1,payloadSize:0},r=0,i=0;t<e.byteLength&&128!==e[t];){for(;255===e[t];)r+=255,t++;for(r+=e[t++];255===e[t];)i+=255,t++;if(i+=e[t++],!n.payload&&4===r){n.payloadType=r,n.payloadSize=i,n.payload=e.subarray(t,t+i);break}t+=i,r=0,i=0}return n},be=function(e){return 181!==e.payload[0]||49!=(e.payload[1]<<8|e.payload[2])||"GA94"!==String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])||3!==e.payload[7]?null:e.payload.subarray(8,e.payload.length-1)},Te=function(e,t){var n,r,i,a,s=[];if(!(64&t[0]))return s;for(r=31&t[0],n=0;n<r;n++)a={type:3&t[(i=3*n)+2],pts:e},4&t[i+2]&&(a.ccData=t[i+3]<<8|t[i+4],s.push(a));return s},Se=function(e){for(var t,n,r=e.byteLength,i=[],a=1;a<r-2;)0===e[a]&&0===e[a+1]&&3===e[a+2]?(i.push(a+2),a+=2):a++;if(0===i.length)return e;t=r-i.length,n=new Uint8Array(t);var s=0;for(a=0;a<t;s++,a++)s===i[0]&&(s++,i.shift()),n[a]=e[s];return n},Ee=4,ke=function e(){e.prototype.init.call(this),this.captionPackets_=[],this.ccStreams_=[new Re(0,0),new Re(0,1),new Re(1,0),new Re(1,1)],this.reset(),this.ccStreams_.forEach((function(e){e.on("data",this.trigger.bind(this,"data")),e.on("done",this.trigger.bind(this,"done"))}),this)};(ke.prototype=new Z).push=function(e){var t,n,r;if("sei_rbsp"===e.nalUnitType&&((t=_e(e.escapedRBSP)).payloadType===Ee&&(n=be(t)))){if(e.dts<this.latestDts_)return void(this.ignoreNextEqualDts_=!0);if(e.dts===this.latestDts_&&this.ignoreNextEqualDts_)return void(--this.numSameDts_||(this.ignoreNextEqualDts_=!1));r=Te(e.pts,n),this.captionPackets_=this.captionPackets_.concat(r),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts}},ke.prototype.flush=function(){this.captionPackets_.length?(this.captionPackets_.forEach((function(e,t){e.presortIndex=t})),this.captionPackets_.sort((function(e,t){return e.pts===t.pts?e.presortIndex-t.presortIndex:e.pts-t.pts})),this.captionPackets_.forEach((function(e){e.type<2&&this.dispatchCea608Packet(e)}),this),this.captionPackets_.length=0,this.ccStreams_.forEach((function(e){e.flush()}),this)):this.ccStreams_.forEach((function(e){e.flush()}),this)},ke.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach((function(e){e.reset()}))},ke.prototype.dispatchCea608Packet=function(e){this.setsTextOrXDSActive(e)?this.activeCea608Channel_[e.type]=null:this.setsChannel1Active(e)?this.activeCea608Channel_[e.type]=0:this.setsChannel2Active(e)&&(this.activeCea608Channel_[e.type]=1),null!==this.activeCea608Channel_[e.type]&&this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)},ke.prototype.setsChannel1Active=function(e){return 4096==(30720&e.ccData)},ke.prototype.setsChannel2Active=function(e){return 6144==(30720&e.ccData)},ke.prototype.setsTextOrXDSActive=function(e){return 256==(28928&e.ccData)||4138==(30974&e.ccData)||6186==(30974&e.ccData)};var we={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},Ce=function(e){return null===e?"":(e=we[e]||e,String.fromCharCode(e))},Ae=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Le=function(){for(var e=[],t=15;t--;)e.push("");return e},Re=function e(t,n){e.prototype.init.call(this),this.field_=t||0,this.dataChannel_=n||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,n,r,i,a;if((t=32639&e.ccData)!==this.lastControlCode_){if(4096==(61440&t)?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),r=t>>>8,i=255&t,t!==this.PADDING_)if(t===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(t===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),n=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=n,this.startPts_=e.pts;else if(t===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(e.pts);else if(t===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(e.pts);else if(t===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(e.pts);else if(t===this.CARRIAGE_RETURN_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts;else if(t===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(t===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=Le();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Le();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=Le()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(r,i))a=Ce((r=(3&r)<<8)|i),this[this.mode_](e.pts,a),this.column_++;else if(this.isExtCharacter(r,i))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),a=Ce((r=(3&r)<<8)|i),this[this.mode_](e.pts,a),this.column_++;else if(this.isMidRowCode(r,i))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14==(14&i)&&this.addFormatting(e.pts,["i"]),1==(1&i)&&this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(r,i))this.column_+=3&i;else if(this.isPAC(r,i)){var s=Ae.indexOf(7968&t);"rollUp"===this.mode_&&(s-this.rollUpRows_+1<0&&(s=this.rollUpRows_-1),this.setRollUp(e.pts,s)),s!==this.row_&&(this.clearFormatting(e.pts),this.row_=s),1&i&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),16==(16&t)&&(this.column_=4*((14&t)>>1)),this.isColorPAC(i)&&14==(14&i)&&this.addFormatting(e.pts,["i"])}else this.isNormalChar(r)&&(0===i&&(i=null),a=Ce(r),a+=Ce(i),this[this.mode_](e.pts,a),this.column_+=a.length)}else this.lastControlCode_=null}};Re.prototype=new Z,Re.prototype.flushDisplayed=function(e){var t=this.displayed_.map((function(e){try{return e.trim()}catch(e){return console.error("Skipping malformed caption."),""}})).join("\n").replace(/^\n+|\n+$/g,"");t.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})},Re.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Le(),this.nonDisplayed_=Le(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},Re.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},Re.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},Re.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},Re.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},Re.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},Re.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&t>=64&&t<=127},Re.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},Re.prototype.isNormalChar=function(e){return e>=32&&e<=127},Re.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=Le(),this.displayed_=Le()),void 0!==t&&t!==this.row_)for(var n=0;n<this.rollUpRows_;n++)this.displayed_[t-n]=this.displayed_[this.row_-n],this.displayed_[this.row_-n]="";void 0===t&&(t=this.row_),this.topRow_=t-this.rollUpRows_+1},Re.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t);var n=t.reduce((function(e,t){return e+"<"+t+">"}),"");this[this.mode_](e,n)},Re.prototype.clearFormatting=function(e){if(this.formatting_.length){var t=this.formatting_.reverse().reduce((function(e,t){return e+"</"+t+">"}),"");this.formatting_=[],this[this.mode_](e,t)}},Re.prototype.popOn=function(e,t){var n=this.nonDisplayed_[this.row_];n+=t,this.nonDisplayed_[this.row_]=n},Re.prototype.rollUp=function(e,t){var n=this.displayed_[this.row_];n+=t,this.displayed_[this.row_]=n},Re.prototype.shiftRowsUp_=function(){var e;for(e=0;e<this.topRow_;e++)this.displayed_[e]="";for(e=this.row_+1;e<15;e++)this.displayed_[e]="";for(e=this.topRow_;e<this.row_;e++)this.displayed_[e]=this.displayed_[e+1];this.displayed_[this.row_]=""},Re.prototype.paintOn=function(e,t){var n=this.displayed_[this.row_];n+=t,this.displayed_[this.row_]=n};var xe={CaptionStream:ke,Cea608Stream:Re},Ie={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},Oe=function(e,t){var n=1;for(e>t&&(n=-1);Math.abs(t-e)>4294967296;)e+=8589934592*n;return e},De=function e(t){var n,r;e.prototype.init.call(this),this.type_=t,this.push=function(e){e.type===this.type_&&(void 0===r&&(r=e.dts),e.dts=Oe(e.dts,r),e.pts=Oe(e.pts,r),n=e.dts,this.trigger("data",e))},this.flush=function(){r=n,this.trigger("done")},this.discontinuity=function(){r=void 0,n=void 0}};De.prototype=new Z;var Pe,Me=De,je=function(e,t,n){var r,i="";for(r=t;r<n;r++)i+="%"+("00"+e[r].toString(16)).slice(-2);return i},Ue=function(e,t,n){return decodeURIComponent(je(e,t,n))},Be=function(e,t,n){return unescape(je(e,t,n))},Fe=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},Ne={TXXX:function(e){var t;if(3===e.data[0]){for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=Ue(e.data,1,t),e.value=Ue(e.data,t+1,e.data.length).replace(/\0*$/,"");break}e.data=e.value}},WXXX:function(e){var t;if(3===e.data[0])for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=Ue(e.data,1,t),e.url=Ue(e.data,t+1,e.data.length);break}},PRIV:function(e){var t;for(t=0;t<e.data.length;t++)if(0===e.data[t]){e.owner=Be(e.data,0,t);break}e.privateData=e.data.subarray(t+1),e.data=e.privateData}};(Pe=function(e){var t,n={debug:!(!e||!e.debug),descriptor:e&&e.descriptor},r=0,i=[],a=0;if(Pe.prototype.init.call(this),this.dispatchType=Ie.METADATA_STREAM_TYPE.toString(16),n.descriptor)for(t=0;t<n.descriptor.length;t++)this.dispatchType+=("00"+n.descriptor[t].toString(16)).slice(-2);this.push=function(e){var t,s,o,u,l;if("timed-metadata"===e.type){if(e.dataAlignmentIndicator&&(a=0,i.length=0),0===i.length&&(e.data.length<10||e.data[0]!=="I".charCodeAt(0)||e.data[1]!=="D".charCodeAt(0)||e.data[2]!=="3".charCodeAt(0)))return void(n.debug&&console.log("Skipping unrecognized metadata packet"));if(i.push(e),a+=e.data.byteLength,1===i.length&&(r=Fe(e.data.subarray(6,10)),r+=10),!(a<r)){for(t={data:new Uint8Array(r),frames:[],pts:i[0].pts,dts:i[0].dts},l=0;l<r;)t.data.set(i[0].data.subarray(0,r-l),l),l+=i[0].data.byteLength,a-=i[0].data.byteLength,i.shift();s=10,64&t.data[5]&&(s+=4,s+=Fe(t.data.subarray(10,14)),r-=Fe(t.data.subarray(16,20)));do{if((o=Fe(t.data.subarray(s+4,s+8)))<1)return console.log("Malformed ID3 frame encountered. Skipping metadata parsing.");if((u={id:String.fromCharCode(t.data[s],t.data[s+1],t.data[s+2],t.data[s+3]),data:t.data.subarray(s+10,s+o+10)}).key=u.id,Ne[u.id]&&(Ne[u.id](u),"com.apple.streaming.transportStreamTimestamp"===u.owner)){var c=u.data,d=(1&c[3])<<30|c[4]<<22|c[5]<<14|c[6]<<6|c[7]>>>2;d*=4,d+=3&c[7],u.timeStamp=d,void 0===t.pts&&void 0===t.dts&&(t.pts=u.timeStamp,t.dts=u.timeStamp),this.trigger("timestamp",u)}t.frames.push(u),s+=10,s+=o}while(s<r);this.trigger("data",t)}}}}).prototype=new Z;var Ge,Ve,He,ze=Pe,We=Me;(Ge=function(){var e=new Uint8Array(188),t=0;Ge.prototype.init.call(this),this.push=function(n){var r,i=0,a=188;for(t?((r=new Uint8Array(n.byteLength+t)).set(e.subarray(0,t)),r.set(n,t),t=0):r=n;a<r.byteLength;)71!==r[i]||71!==r[a]?(i++,a++):(this.trigger("data",r.subarray(i,a)),i+=188,a+=188);i<r.byteLength&&(e.set(r.subarray(i),0),t=r.byteLength-i)},this.flush=function(){188===t&&71===e[0]&&(this.trigger("data",e),t=0),this.trigger("done")}}).prototype=new Z,(Ve=function(){var e,t,n,r;Ve.prototype.init.call(this),r=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,e=function(e,r){var i=0;r.payloadUnitStartIndicator&&(i+=e[i]+1),"pat"===r.type?t(e.subarray(i),r):n(e.subarray(i),r)},t=function(e,t){t.section_number=e[7],t.last_section_number=e[8],r.pmtPid=(31&e[10])<<8|e[11],t.pmtPid=r.pmtPid},n=function(e,t){var n,i;if(1&e[5]){for(r.programMapTable={video:null,audio:null,"timed-metadata":{}},n=3+((15&e[1])<<8|e[2])-4,i=12+((15&e[10])<<8|e[11]);i<n;){var a=e[i],s=(31&e[i+1])<<8|e[i+2];a===Ie.H264_STREAM_TYPE&&null===r.programMapTable.video?r.programMapTable.video=s:a===Ie.ADTS_STREAM_TYPE&&null===r.programMapTable.audio?r.programMapTable.audio=s:a===Ie.METADATA_STREAM_TYPE&&(r.programMapTable["timed-metadata"][s]=a),i+=5+((15&e[i+3])<<8|e[i+4])}t.programMapTable=r.programMapTable}},this.push=function(t){var n={},r=4;if(n.payloadUnitStartIndicator=!!(64&t[1]),n.pid=31&t[1],n.pid<<=8,n.pid|=t[2],(48&t[3])>>>4>1&&(r+=t[r]+1),0===n.pid)n.type="pat",e(t.subarray(r),n),this.trigger("data",n);else if(n.pid===this.pmtPid)for(n.type="pmt",e(t.subarray(r),n),this.trigger("data",n);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,r,n]):this.processPes_(t,r,n)},this.processPes_=function(e,t,n){n.pid===this.programMapTable.video?n.streamType=Ie.H264_STREAM_TYPE:n.pid===this.programMapTable.audio?n.streamType=Ie.ADTS_STREAM_TYPE:n.streamType=this.programMapTable["timed-metadata"][n.pid],n.type="pes",n.data=e.subarray(t),this.trigger("data",n)}}).prototype=new Z,Ve.STREAM_TYPES={h264:27,adts:15},(He=function(){var e=this,t={data:[],size:0},n={data:[],size:0},r={data:[],size:0},i=function(t,n,r){var i,a=new Uint8Array(t.size),s={type:n},o=0,u=0,l=!1;if(t.data.length&&!(t.size<9)){for(s.trackId=t.data[0].pid,o=0;o<t.data.length;o++)i=t.data[o],a.set(i.data,u),u+=i.data.byteLength;(function(e,t){var n;t.packetLength=6+(e[4]<<8|e[5]),t.dataAlignmentIndicator=0!=(4&e[6]),192&(n=e[7])&&(t.pts=(14&e[9])<<27|(255&e[10])<<20|(254&e[11])<<12|(255&e[12])<<5|(254&e[13])>>>3,t.pts*=4,t.pts+=(6&e[13])>>>1,t.dts=t.pts,64&n&&(t.dts=(14&e[14])<<27|(255&e[15])<<20|(254&e[16])<<12|(255&e[17])<<5|(254&e[18])>>>3,t.dts*=4,t.dts+=(6&e[18])>>>1)),t.data=e.subarray(9+e[8])})(a,s),l="video"===n||s.packetLength<=t.size,(r||l)&&(t.size=0,t.data.length=0),l&&e.trigger("data",s)}};He.prototype.init.call(this),this.push=function(a){({pat:function(){},pes:function(){var e,s;switch(a.streamType){case Ie.H264_STREAM_TYPE:case Ie.H264_STREAM_TYPE:e=t,s="video";break;case Ie.ADTS_STREAM_TYPE:e=n,s="audio";break;case Ie.METADATA_STREAM_TYPE:e=r,s="timed-metadata";break;default:return}a.payloadUnitStartIndicator&&i(e,s,!0),e.data.push(a),e.size+=a.data.byteLength},pmt:function(){var t={type:"metadata",tracks:[]},n=a.programMapTable;null!==n.video&&t.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+n.video,codec:"avc",type:"video"}),null!==n.audio&&t.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+n.audio,codec:"adts",type:"audio"}),e.trigger("data",t)}})[a.type]()},this.flush=function(){i(t,"video"),i(n,"audio"),i(r,"timed-metadata"),this.trigger("done")}}).prototype=new Z;var Ke={PAT_PID:0,MP2T_PACKET_LENGTH:188,TransportPacketStream:Ge,TransportParseStream:Ve,ElementaryStream:He,TimestampRolloverStream:We,CaptionStream:xe.CaptionStream,Cea608Stream:xe.Cea608Stream,MetadataStream:ze};for(var qe in Ie)Ie.hasOwnProperty(qe)&&(Ke[qe]=Ie[qe]);var $e,Ye=Ke,Xe=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];($e=function(){var e;$e.prototype.init.call(this),this.push=function(t){var n,r,i,a,s,o,u=0,l=0;if("audio"===t.type)for(e?(a=e,(e=new Uint8Array(a.byteLength+t.data.byteLength)).set(a),e.set(t.data,a.byteLength)):e=t.data;u+5<e.length;)if(255===e[u]&&240==(246&e[u+1])){if(r=2*(1&~e[u+1]),n=(3&e[u+3])<<11|e[u+4]<<3|(224&e[u+5])>>5,o=9e4*(s=1024*(1+(3&e[u+6])))/Xe[(60&e[u+2])>>>2],i=u+n,e.byteLength<i)return;if(this.trigger("data",{pts:t.pts+l*o,dts:t.dts+l*o,sampleCount:s,audioobjecttype:1+(e[u+2]>>>6&3),channelcount:(1&e[u+2])<<2|(192&e[u+3])>>>6,samplerate:Xe[(60&e[u+2])>>>2],samplingfrequencyindex:(60&e[u+2])>>>2,samplesize:16,data:e.subarray(u+7+r,i)}),e.byteLength===i)return void(e=void 0);l++,e=e.subarray(i)}else u++},this.flush=function(){this.trigger("done")}}).prototype=new Z;var Je,Qe,Ze,et=$e,tt=function(e){var t=e.byteLength,n=0,r=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+r},this.loadWord=function(){var i=e.byteLength-t,a=new Uint8Array(4),s=Math.min(4,t);if(0===s)throw new Error("no bytes available");a.set(e.subarray(i,i+s)),n=new DataView(a.buffer).getUint32(0),r=8*s,t-=s},this.skipBits=function(e){var i;r>e?(n<<=e,r-=e):(e-=r,e-=8*(i=Math.floor(e/8)),t-=i,this.loadWord(),n<<=e,r-=e)},this.readBits=function(e){var i=Math.min(r,e),a=n>>>32-i;return(r-=i)>0?n<<=i:t>0&&this.loadWord(),(i=e-i)>0?a<<i|this.readBits(i):a},this.skipLeadingZeros=function(){var e;for(e=0;e<r;++e)if(0!=(n&2147483648>>>e))return n<<=e,r-=e,e;return this.loadWord(),e+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};(Qe=function(){var e,t,n=0;Qe.prototype.init.call(this),this.push=function(r){var i;for(t?((i=new Uint8Array(t.byteLength+r.data.byteLength)).set(t),i.set(r.data,t.byteLength),t=i):t=r.data;n<t.byteLength-3;n++)if(1===t[n+2]){e=n+5;break}for(;e<t.byteLength;)switch(t[e]){case 0:if(0!==t[e-1]){e+=2;break}if(0!==t[e-2]){e++;break}n+3!==e-2&&this.trigger("data",t.subarray(n+3,e-2));do{e++}while(1!==t[e]&&e<t.length);n=e-2,e+=3;break;case 1:if(0!==t[e-1]||0!==t[e-2]){e+=3;break}this.trigger("data",t.subarray(n+3,e-2)),n=e-2,e+=3;break;default:e+=3}t=t.subarray(n),e-=n,n=0},this.flush=function(){t&&t.byteLength>3&&this.trigger("data",t.subarray(n+3)),t=null,n=0,this.trigger("done")}}).prototype=new Z,Ze={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},(Je=function(){var e,t,n,r,i,a,s,o=new Qe;Je.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,n=e.pts,r=e.dts,o.push(e))},o.on("data",(function(s){var o={trackId:t,pts:n,dts:r,data:s};switch(31&s[0]){case 5:o.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:o.nalUnitType="sei_rbsp",o.escapedRBSP=i(s.subarray(1));break;case 7:o.nalUnitType="seq_parameter_set_rbsp",o.escapedRBSP=i(s.subarray(1)),o.config=a(o.escapedRBSP);break;case 8:o.nalUnitType="pic_parameter_set_rbsp";break;case 9:o.nalUnitType="access_unit_delimiter_rbsp"}e.trigger("data",o)})),o.on("done",(function(){e.trigger("done")})),this.flush=function(){o.flush()},s=function(e,t){var n,r=8,i=8;for(n=0;n<e;n++)0!==i&&(i=(r+t.readExpGolomb()+256)%256),r=0===i?r:i},i=function(e){for(var t,n,r=e.byteLength,i=[],a=1;a<r-2;)0===e[a]&&0===e[a+1]&&3===e[a+2]?(i.push(a+2),a+=2):a++;if(0===i.length)return e;t=r-i.length,n=new Uint8Array(t);var s=0;for(a=0;a<t;s++,a++)s===i[0]&&(s++,i.shift()),n[a]=e[s];return n},a=function(e){var t,n,r,i,a,o,u,l,c,d,h,f,p,v=0,m=0,g=0,y=0,_=1;if(n=(t=new tt(e)).readUnsignedByte(),i=t.readUnsignedByte(),r=t.readUnsignedByte(),t.skipUnsignedExpGolomb(),Ze[n]&&(3===(a=t.readUnsignedExpGolomb())&&t.skipBits(1),t.skipUnsignedExpGolomb(),t.skipUnsignedExpGolomb(),t.skipBits(1),t.readBoolean()))for(h=3!==a?8:12,p=0;p<h;p++)t.readBoolean()&&s(p<6?16:64,t);if(t.skipUnsignedExpGolomb(),0===(o=t.readUnsignedExpGolomb()))t.readUnsignedExpGolomb();else if(1===o)for(t.skipBits(1),t.skipExpGolomb(),t.skipExpGolomb(),u=t.readUnsignedExpGolomb(),p=0;p<u;p++)t.skipExpGolomb();if(t.skipUnsignedExpGolomb(),t.skipBits(1),l=t.readUnsignedExpGolomb(),c=t.readUnsignedExpGolomb(),0===(d=t.readBits(1))&&t.skipBits(1),t.skipBits(1),t.readBoolean()&&(v=t.readUnsignedExpGolomb(),m=t.readUnsignedExpGolomb(),g=t.readUnsignedExpGolomb(),y=t.readUnsignedExpGolomb()),t.readBoolean()&&t.readBoolean()){switch(t.readUnsignedByte()){case 1:f=[1,1];break;case 2:f=[12,11];break;case 3:f=[10,11];break;case 4:f=[16,11];break;case 5:f=[40,33];break;case 6:f=[24,11];break;case 7:f=[20,11];break;case 8:f=[32,11];break;case 9:f=[80,33];break;case 10:f=[18,11];break;case 11:f=[15,11];break;case 12:f=[64,33];break;case 13:f=[160,99];break;case 14:f=[4,3];break;case 15:f=[3,2];break;case 16:f=[2,1];break;case 255:f=[t.readUnsignedByte()<<8|t.readUnsignedByte(),t.readUnsignedByte()<<8|t.readUnsignedByte()]}f&&(_=f[0]/f[1])}return{profileIdc:n,levelIdc:r,profileCompatibility:i,width:Math.ceil((16*(l+1)-2*v-2*m)*_),height:(2-d)*(c+1)*16-2*g-2*y}}}).prototype=new Z;var nt,rt={H264Stream:Je,NalByteStream:Qe},it=function(e){return e[0]==="I".charCodeAt(0)&&e[1]==="D".charCodeAt(0)&&e[2]==="3".charCodeAt(0)},at=function(e,t){var n=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(16&e[t+5])>>4?n+20:n+10},st=function(e,t){var n=(224&e[t+5])>>5,r=e[t+4]<<3;return 6144&e[t+3]|r|n};(nt=function(){var e=new Uint8Array,t=0;nt.prototype.init.call(this),this.setTimestamp=function(e){t=e},this.push=function(n){var r,i,a,s,o=0,u=0;for(e.length?(s=e.length,(e=new Uint8Array(n.byteLength+s)).set(e.subarray(0,s)),e.set(n,s)):e=n;e.length-u>=3;)if(e[u]!=="I".charCodeAt(0)||e[u+1]!=="D".charCodeAt(0)||e[u+2]!=="3".charCodeAt(0))if(255!=(255&e[u])||240!=(240&e[u+1]))u++;else{if(e.length-u<7)break;if(u+(o=st(e,u))>e.length)break;a={type:"audio",data:e.subarray(u,u+o),pts:t,dts:t},this.trigger("data",a),u+=o}else{if(e.length-u<10)break;if(u+(o=at(e,u))>e.length)break;i={type:"timed-metadata",data:e.subarray(u,u+o)},this.trigger("data",i),u+=o}r=e.length-u,e=r>0?e.subarray(u):new Uint8Array}}).prototype=new Z;var ot,ut,lt,ct,dt=nt,ht=rt.H264Stream,ft=it,pt=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],vt=["width","height","profileIdc","levelIdc","profileCompatibility"],mt=function(e,t){var n;if(e.length!==t.length)return!1;for(n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0},gt=function(e,t,n,r,i,a){return{start:{dts:e,pts:e+(n-t)},end:{dts:e+(r-t),pts:e+(i-n)},prependedContentDuration:a,baseMediaDecodeTime:e}};(ut=function(e,t){var n=[],r=0,i=0,a=0,s=1/0;t=t||{},ut.prototype.init.call(this),this.push=function(t){ye(e,t),e&&pt.forEach((function(n){e[n]=t[n]})),n.push(t)},this.setEarliestDts=function(t){i=t-e.timelineStartInfo.baseMediaDecodeTime},this.setVideoBaseMediaDecodeTime=function(e){s=e},this.setAudioAppendStart=function(e){a=e},this.flush=function(){var o,u,l,c;0!==n.length?(o=fe(n,e,i),e.baseMediaDecodeTime=ge(e,t.keepOriginalTimestamps),he(e,o,a,s),e.samples=pe(o),l=H.mdat(ve(o)),n=[],u=H.moof(r,[e]),c=new Uint8Array(u.byteLength+l.byteLength),r++,c.set(u),c.set(l,u.byteLength),me(e),this.trigger("data",{track:e,boxes:c}),this.trigger("done","AudioSegmentStream")):this.trigger("done","AudioSegmentStream")}}).prototype=new Z,(ot=function(e,t){var n,r,i=0,a=[],s=[];t=t||{},ot.prototype.init.call(this),delete e.minPTS,this.gopCache_=[],this.push=function(t){ye(e,t),"seq_parameter_set_rbsp"!==t.nalUnitType||n||(n=t.config,e.sps=[t.data],vt.forEach((function(t){e[t]=n[t]}),this)),"pic_parameter_set_rbsp"!==t.nalUnitType||r||(r=t.data,e.pps=[t.data]),a.push(t)},this.flush=function(){for(var n,r,o,u,l,c,d,h,f=0;a.length&&"access_unit_delimiter_rbsp"!==a[0].nalUnitType;)a.shift();if(0===a.length)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(n=te(a),(o=ne(n))[0][0].keyFrame||((r=this.getGopForFusion_(a[0],e))?(f=r.duration,o.unshift(r),o.byteLength+=r.byteLength,o.nalCount+=r.nalCount,o.pts=r.pts,o.dts=r.dts,o.duration+=r.duration):o=re(o)),s.length){var p;if(!(p=t.alignGopsAtEnd?this.alignGopsAtEnd_(o):this.alignGopsAtStart_(o)))return this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),a=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");me(e),o=p}ye(e,o),e.samples=ie(o),l=H.mdat(ae(o)),e.baseMediaDecodeTime=ge(e,t.keepOriginalTimestamps),this.trigger("processedGopsInfo",o.map((function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}}))),d=o[0],h=o[o.length-1],this.trigger("segmentTimingInfo",gt(e.baseMediaDecodeTime,d.dts,d.pts,h.dts+h.duration,h.pts+h.duration,f)),this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),a=[],this.trigger("baseMediaDecodeTime",e.baseMediaDecodeTime),this.trigger("timelineStartInfo",e.timelineStartInfo),u=H.moof(i,[e]),c=new Uint8Array(u.byteLength+l.byteLength),i++,c.set(u),c.set(l,u.byteLength),this.trigger("data",{track:e,boxes:c}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.resetStream_=function(){me(e),n=void 0,r=void 0},this.getGopForFusion_=function(t){var n,r,i,a,s,o=1/0;for(s=0;s<this.gopCache_.length;s++)i=(a=this.gopCache_[s]).gop,e.pps&&mt(e.pps[0],a.pps[0])&&e.sps&&mt(e.sps[0],a.sps[0])&&(i.dts<e.timelineStartInfo.dts||(n=t.dts-i.dts-i.duration)>=-1e4&&n<=45e3&&(!r||o>n)&&(r=a,o=n));return r?r.gop:null},this.alignGopsAtStart_=function(e){var t,n,r,i,a,o,u,l;for(a=e.byteLength,o=e.nalCount,u=e.duration,t=n=0;t<s.length&&n<e.length&&(r=s[t],i=e[n],r.pts!==i.pts);)i.pts>r.pts?t++:(n++,a-=i.byteLength,o-=i.nalCount,u-=i.duration);return 0===n?e:n===e.length?null:((l=e.slice(n)).byteLength=a,l.duration=u,l.nalCount=o,l.pts=l[0].pts,l.dts=l[0].dts,l)},this.alignGopsAtEnd_=function(e){var t,n,r,i,a,o,u;for(t=s.length-1,n=e.length-1,a=null,o=!1;t>=0&&n>=0;){if(r=s[t],i=e[n],r.pts===i.pts){o=!0;break}r.pts>i.pts?t--:(t===s.length-1&&(a=n),n--)}if(!o&&null===a)return null;if(0===(u=o?n:a))return e;var l=e.slice(u),c=l.reduce((function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e}),{byteLength:0,duration:0,nalCount:0});return l.byteLength=c.byteLength,l.duration=c.duration,l.nalCount=c.nalCount,l.pts=l[0].pts,l.dts=l[0].dts,l},this.alignGopsWith=function(e){s=e}}).prototype=new Z,(ct=function(e,t){this.numberOfTracks=0,this.metadataStream=t,void 0!==(e=e||{}).remux?this.remuxTracks=!!e.remux:this.remuxTracks=!0,"boolean"==typeof e.keepOriginalTimestamps&&(this.keepOriginalTimestamps=e.keepOriginalTimestamps),this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,ct.prototype.init.call(this),this.push=function(e){return e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):(this.pendingTracks.push(e.track),this.pendingBoxes.push(e.boxes),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track),void("audio"===e.track.type&&(this.audioTrack=e.track)))}}).prototype=new Z,ct.prototype.flush=function(e){var t,n,r,i,a=0,s={captions:[],captionStreams:{},metadata:[],info:{}},o=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==e&&"AudioSegmentStream"!==e)return;if(this.remuxTracks)return;if(0===this.pendingTracks.length)return void(++this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}for(this.videoTrack?(o=this.videoTrack.timelineStartInfo.pts,vt.forEach((function(e){s.info[e]=this.videoTrack[e]}),this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,pt.forEach((function(e){s.info[e]=this.audioTrack[e]}),this)),1===this.pendingTracks.length?s.type=this.pendingTracks[0].type:s.type="combined",this.emittedTracks+=this.pendingTracks.length,r=H.initSegment(this.pendingTracks),s.initSegment=new Uint8Array(r.byteLength),s.initSegment.set(r),s.data=new Uint8Array(this.pendingBytes),i=0;i<this.pendingBoxes.length;i++)s.data.set(this.pendingBoxes[i],a),a+=this.pendingBoxes[i].byteLength;for(i=0;i<this.pendingCaptions.length;i++)(t=this.pendingCaptions[i]).startTime=t.startPts,this.keepOriginalTimestamps||(t.startTime-=o),t.startTime/=9e4,t.endTime=t.endPts,this.keepOriginalTimestamps||(t.endTime-=o),t.endTime/=9e4,s.captionStreams[t.stream]=!0,s.captions.push(t);for(i=0;i<this.pendingMetadata.length;i++)(n=this.pendingMetadata[i]).cueTime=n.pts,this.keepOriginalTimestamps||(n.cueTime-=o),n.cueTime/=9e4,s.metadata.push(n);s.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",s),this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},(lt=function(e){var t,n,r=this,i=!0;lt.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var t={};this.transmuxPipeline_=t,t.type="aac",t.metadataStream=new Ye.MetadataStream,t.aacStream=new dt,t.audioTimestampRolloverStream=new Ye.TimestampRolloverStream("audio"),t.timedMetadataTimestampRolloverStream=new Ye.TimestampRolloverStream("timed-metadata"),t.adtsStream=new et,t.coalesceStream=new ct(e,t.metadataStream),t.headOfPipeline=t.aacStream,t.aacStream.pipe(t.audioTimestampRolloverStream).pipe(t.adtsStream),t.aacStream.pipe(t.timedMetadataTimestampRolloverStream).pipe(t.metadataStream).pipe(t.coalesceStream),t.metadataStream.on("timestamp",(function(e){t.aacStream.setTimestamp(e.timeStamp)})),t.aacStream.on("data",(function(i){"timed-metadata"!==i.type||t.audioSegmentStream||(n=n||{timelineStartInfo:{baseMediaDecodeTime:r.baseMediaDecodeTime},codec:"adts",type:"audio"},t.coalesceStream.numberOfTracks++,t.audioSegmentStream=new ut(n,e),t.adtsStream.pipe(t.audioSegmentStream).pipe(t.coalesceStream))})),t.coalesceStream.on("data",this.trigger.bind(this,"data")),t.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setupTsPipeline=function(){var i={};this.transmuxPipeline_=i,i.type="ts",i.metadataStream=new Ye.MetadataStream,i.packetStream=new Ye.TransportPacketStream,i.parseStream=new Ye.TransportParseStream,i.elementaryStream=new Ye.ElementaryStream,i.videoTimestampRolloverStream=new Ye.TimestampRolloverStream("video"),i.audioTimestampRolloverStream=new Ye.TimestampRolloverStream("audio"),i.timedMetadataTimestampRolloverStream=new Ye.TimestampRolloverStream("timed-metadata"),i.adtsStream=new et,i.h264Stream=new ht,i.captionStream=new Ye.CaptionStream,i.coalesceStream=new ct(e,i.metadataStream),i.headOfPipeline=i.packetStream,i.packetStream.pipe(i.parseStream).pipe(i.elementaryStream),i.elementaryStream.pipe(i.videoTimestampRolloverStream).pipe(i.h264Stream),i.elementaryStream.pipe(i.audioTimestampRolloverStream).pipe(i.adtsStream),i.elementaryStream.pipe(i.timedMetadataTimestampRolloverStream).pipe(i.metadataStream).pipe(i.coalesceStream),i.h264Stream.pipe(i.captionStream).pipe(i.coalesceStream),i.elementaryStream.on("data",(function(a){var s;if("metadata"===a.type){for(s=a.tracks.length;s--;)t||"video"!==a.tracks[s].type?n||"audio"!==a.tracks[s].type||((n=a.tracks[s]).timelineStartInfo.baseMediaDecodeTime=r.baseMediaDecodeTime):(t=a.tracks[s]).timelineStartInfo.baseMediaDecodeTime=r.baseMediaDecodeTime;t&&!i.videoSegmentStream&&(i.coalesceStream.numberOfTracks++,i.videoSegmentStream=new ot(t,e),i.videoSegmentStream.on("timelineStartInfo",(function(e){n&&(n.timelineStartInfo=e,i.audioSegmentStream.setEarliestDts(e.dts))})),i.videoSegmentStream.on("processedGopsInfo",r.trigger.bind(r,"gopInfo")),i.videoSegmentStream.on("segmentTimingInfo",r.trigger.bind(r,"videoSegmentTimingInfo")),i.videoSegmentStream.on("baseMediaDecodeTime",(function(e){n&&i.audioSegmentStream.setVideoBaseMediaDecodeTime(e)})),i.h264Stream.pipe(i.videoSegmentStream).pipe(i.coalesceStream)),n&&!i.audioSegmentStream&&(i.coalesceStream.numberOfTracks++,i.audioSegmentStream=new ut(n,e),i.adtsStream.pipe(i.audioSegmentStream).pipe(i.coalesceStream))}})),i.coalesceStream.on("data",this.trigger.bind(this,"data")),i.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setBaseMediaDecodeTime=function(r){var i=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=r),n&&(n.timelineStartInfo.dts=void 0,n.timelineStartInfo.pts=void 0,me(n),e.keepOriginalTimestamps||(n.timelineStartInfo.baseMediaDecodeTime=r),i.audioTimestampRolloverStream&&i.audioTimestampRolloverStream.discontinuity()),t&&(i.videoSegmentStream&&(i.videoSegmentStream.gopCache_=[],i.videoTimestampRolloverStream.discontinuity()),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,me(t),i.captionStream.reset(),e.keepOriginalTimestamps||(t.timelineStartInfo.baseMediaDecodeTime=r)),i.timedMetadataTimestampRolloverStream&&i.timedMetadataTimestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){n&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.alignGopsWith=function(e){t&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)},this.push=function(e){if(i){var t=ft(e);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),i=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){i=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}}).prototype=new Z;var yt,_t,bt={Transmuxer:lt,VideoSegmentStream:ot,AudioSegmentStream:ut,AUDIO_PROPERTIES:pt,VIDEO_PROPERTIES:vt,generateVideoSegmentTimingInfo:gt},Tt=W.parseType,St=function(e){return new Date(1e3*e-20828448e5)},Et=function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}},kt=function(e){var t,n,r=new DataView(e.buffer,e.byteOffset,e.byteLength),i=[];for(t=0;t+4<e.length;t+=n)if(n=r.getUint32(t),t+=4,n<=0)i.push("<span style='color:red;'>MALFORMED DATA</span>");else switch(31&e[t]){case 1:i.push("slice_layer_without_partitioning_rbsp");break;case 5:i.push("slice_layer_without_partitioning_rbsp_idr");break;case 6:i.push("sei_rbsp");break;case 7:i.push("seq_parameter_set_rbsp");break;case 8:i.push("pic_parameter_set_rbsp");break;case 9:i.push("access_unit_delimiter_rbsp");break;default:i.push("UNKNOWN NAL - "+e[t]&31)}return i},wt={avc1:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{dataReferenceIndex:t.getUint16(6),width:t.getUint16(24),height:t.getUint16(26),horizresolution:t.getUint16(28)+t.getUint16(30)/16,vertresolution:t.getUint16(32)+t.getUint16(34)/16,frameCount:t.getUint16(40),depth:t.getUint16(74),config:yt(e.subarray(78,e.byteLength))}},avcC:function(e){var t,n,r,i,a=new DataView(e.buffer,e.byteOffset,e.byteLength),s={configurationVersion:e[0],avcProfileIndication:e[1],profileCompatibility:e[2],avcLevelIndication:e[3],lengthSizeMinusOne:3&e[4],sps:[],pps:[]},o=31&e[5];for(r=6,i=0;i<o;i++)n=a.getUint16(r),r+=2,s.sps.push(new Uint8Array(e.subarray(r,r+n))),r+=n;for(t=e[r],r++,i=0;i<t;i++)n=a.getUint16(r),r+=2,s.pps.push(new Uint8Array(e.subarray(r,r+n))),r+=n;return s},btrt:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{bufferSizeDB:t.getUint32(0),maxBitrate:t.getUint32(4),avgBitrate:t.getUint32(8)}},esds:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),esId:e[6]<<8|e[7],streamPriority:31&e[8],decoderConfig:{objectProfileIndication:e[11],streamType:e[12]>>>2&63,bufferSize:e[13]<<16|e[14]<<8|e[15],maxBitrate:e[16]<<24|e[17]<<16|e[18]<<8|e[19],avgBitrate:e[20]<<24|e[21]<<16|e[22]<<8|e[23],decoderConfigDescriptor:{tag:e[24],length:e[25],audioObjectType:e[26]>>>3&31,samplingFrequencyIndex:(7&e[26])<<1|e[27]>>>7&1,channelConfiguration:e[27]>>>3&15}}}},ftyp:function(e){for(var t=new DataView(e.buffer,e.byteOffset,e.byteLength),n={majorBrand:Tt(e.subarray(0,4)),minorVersion:t.getUint32(4),compatibleBrands:[]},r=8;r<e.byteLength;)n.compatibleBrands.push(Tt(e.subarray(r,r+4))),r+=4;return n},dinf:function(e){return{boxes:yt(e)}},dref:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),dataReferences:yt(e.subarray(8))}},hdlr:function(e){var t={version:new DataView(e.buffer,e.byteOffset,e.byteLength).getUint8(0),flags:new Uint8Array(e.subarray(1,4)),handlerType:Tt(e.subarray(8,12)),name:""},n=8;for(n=24;n<e.byteLength;n++){if(0===e[n]){n++;break}t.name+=String.fromCharCode(e[n])}return t.name=decodeURIComponent(escape(t.name)),t},mdat:function(e){return{byteLength:e.byteLength,nals:kt(e)}},mdhd:function(e){var t,n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=4,i={version:n.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),language:""};return 1===i.version?(r+=4,i.creationTime=St(n.getUint32(r)),r+=8,i.modificationTime=St(n.getUint32(r)),r+=4,i.timescale=n.getUint32(r),r+=8,i.duration=n.getUint32(r)):(i.creationTime=St(n.getUint32(r)),r+=4,i.modificationTime=St(n.getUint32(r)),r+=4,i.timescale=n.getUint32(r),r+=4,i.duration=n.getUint32(r)),r+=4,t=n.getUint16(r),i.language+=String.fromCharCode(96+(t>>10)),i.language+=String.fromCharCode(96+((992&t)>>5)),i.language+=String.fromCharCode(96+(31&t)),i},mdia:function(e){return{boxes:yt(e)}},mfhd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),sequenceNumber:e[4]<<24|e[5]<<16|e[6]<<8|e[7]}},minf:function(e){return{boxes:yt(e)}},mp4a:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),n={dataReferenceIndex:t.getUint16(6),channelcount:t.getUint16(16),samplesize:t.getUint16(18),samplerate:t.getUint16(24)+t.getUint16(26)/65536};return e.byteLength>28&&(n.streamDescriptor=yt(e.subarray(28))[0]),n},moof:function(e){return{boxes:yt(e)}},moov:function(e){return{boxes:yt(e)}},mvex:function(e){return{boxes:yt(e)}},mvhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),n=4,r={version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4))};return 1===r.version?(n+=4,r.creationTime=St(t.getUint32(n)),n+=8,r.modificationTime=St(t.getUint32(n)),n+=4,r.timescale=t.getUint32(n),n+=8,r.duration=t.getUint32(n)):(r.creationTime=St(t.getUint32(n)),n+=4,r.modificationTime=St(t.getUint32(n)),n+=4,r.timescale=t.getUint32(n),n+=4,r.duration=t.getUint32(n)),n+=4,r.rate=t.getUint16(n)+t.getUint16(n+2)/16,n+=4,r.volume=t.getUint8(n)+t.getUint8(n+1)/8,n+=2,n+=2,n+=8,r.matrix=new Uint32Array(e.subarray(n,n+36)),n+=36,n+=24,r.nextTrackId=t.getUint32(n),r},pdin:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),rate:t.getUint32(4),initialDelay:t.getUint32(8)}},sdtp:function(e){var t,n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]};for(t=4;t<e.byteLength;t++)n.samples.push({dependsOn:(48&e[t])>>4,isDependedOn:(12&e[t])>>2,hasRedundancy:3&e[t]});return n},sidx:function(e){var t,n=new DataView(e.buffer,e.byteOffset,e.byteLength),r={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:n.getUint32(4),timescale:n.getUint32(8),earliestPresentationTime:n.getUint32(12),firstOffset:n.getUint32(16)},i=n.getUint16(22);for(t=24;i;t+=12,i--)r.references.push({referenceType:(128&e[t])>>>7,referencedSize:2147483647&n.getUint32(t),subsegmentDuration:n.getUint32(t+4),startsWithSap:!!(128&e[t+8]),sapType:(112&e[t+8])>>>4,sapDeltaTime:268435455&n.getUint32(t+8)});return r},smhd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),balance:e[4]+e[5]/256}},stbl:function(e){return{boxes:yt(e)}},stco:function(e){var t,n=new DataView(e.buffer,e.byteOffset,e.byteLength),r={version:e[0],flags:new Uint8Array(e.subarray(1,4)),chunkOffsets:[]},i=n.getUint32(4);for(t=8;i;t+=4,i--)r.chunkOffsets.push(n.getUint32(t));return r},stsc:function(e){var t,n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=n.getUint32(4),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleToChunks:[]};for(t=8;r;t+=12,r--)i.sampleToChunks.push({firstChunk:n.getUint32(t),samplesPerChunk:n.getUint32(t+4),sampleDescriptionIndex:n.getUint32(t+8)});return i},stsd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleDescriptions:yt(e.subarray(8))}},stsz:function(e){var t,n=new DataView(e.buffer,e.byteOffset,e.byteLength),r={version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleSize:n.getUint32(4),entries:[]};for(t=12;t<e.byteLength;t+=4)r.entries.push(n.getUint32(t));return r},stts:function(e){var t,n=new DataView(e.buffer,e.byteOffset,e.byteLength),r={version:e[0],flags:new Uint8Array(e.subarray(1,4)),timeToSamples:[]},i=n.getUint32(4);for(t=8;i;t+=8,i--)r.timeToSamples.push({sampleCount:n.getUint32(t),sampleDelta:n.getUint32(t+4)});return r},styp:function(e){return wt.ftyp(e)},tfdt:function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4)),baseMediaDecodeTime:e[4]<<24|e[5]<<16|e[6]<<8|e[7]};return 1===t.version&&(t.baseMediaDecodeTime*=Math.pow(2,32),t.baseMediaDecodeTime+=e[8]<<24|e[9]<<16|e[10]<<8|e[11]),t},tfhd:function(e){var t,n=new DataView(e.buffer,e.byteOffset,e.byteLength),r={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:n.getUint32(4)},i=1&r.flags[2],a=2&r.flags[2],s=8&r.flags[2],o=16&r.flags[2],u=32&r.flags[2],l=65536&r.flags[0],c=131072&r.flags[0];return t=8,i&&(t+=4,r.baseDataOffset=n.getUint32(12),t+=4),a&&(r.sampleDescriptionIndex=n.getUint32(t),t+=4),s&&(r.defaultSampleDuration=n.getUint32(t),t+=4),o&&(r.defaultSampleSize=n.getUint32(t),t+=4),u&&(r.defaultSampleFlags=n.getUint32(t)),l&&(r.durationIsEmpty=!0),!i&&c&&(r.baseDataOffsetIsMoof=!0),r},tkhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),n=4,r={version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4))};return 1===r.version?(n+=4,r.creationTime=St(t.getUint32(n)),n+=8,r.modificationTime=St(t.getUint32(n)),n+=4,r.trackId=t.getUint32(n),n+=4,n+=8,r.duration=t.getUint32(n)):(r.creationTime=St(t.getUint32(n)),n+=4,r.modificationTime=St(t.getUint32(n)),n+=4,r.trackId=t.getUint32(n),n+=4,n+=4,r.duration=t.getUint32(n)),n+=4,n+=8,r.layer=t.getUint16(n),n+=2,r.alternateGroup=t.getUint16(n),n+=2,r.volume=t.getUint8(n)+t.getUint8(n+1)/8,n+=2,n+=2,r.matrix=new Uint32Array(e.subarray(n,n+36)),n+=36,r.width=t.getUint16(n)+t.getUint16(n+2)/16,n+=4,r.height=t.getUint16(n)+t.getUint16(n+2)/16,r},traf:function(e){return{boxes:yt(e)}},trak:function(e){return{boxes:yt(e)}},trex:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:t.getUint32(4),defaultSampleDescriptionIndex:t.getUint32(8),defaultSampleDuration:t.getUint32(12),defaultSampleSize:t.getUint32(16),sampleDependsOn:3&e[20],sampleIsDependedOn:(192&e[21])>>6,sampleHasRedundancy:(48&e[21])>>4,samplePaddingValue:(14&e[21])>>1,sampleIsDifferenceSample:!!(1&e[21]),sampleDegradationPriority:t.getUint16(22)}},trun:function(e){var t,n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},r=new DataView(e.buffer,e.byteOffset,e.byteLength),i=1&n.flags[2],a=4&n.flags[2],s=1&n.flags[1],o=2&n.flags[1],u=4&n.flags[1],l=8&n.flags[1],c=r.getUint32(4),d=8;for(i&&(n.dataOffset=r.getInt32(d),d+=4),a&&c&&(t={flags:Et(e.subarray(d,d+4))},d+=4,s&&(t.duration=r.getUint32(d),d+=4),o&&(t.size=r.getUint32(d),d+=4),l&&(t.compositionTimeOffset=r.getUint32(d),d+=4),n.samples.push(t),c--);c--;)t={},s&&(t.duration=r.getUint32(d),d+=4),o&&(t.size=r.getUint32(d),d+=4),u&&(t.flags=Et(e.subarray(d,d+4)),d+=4),l&&(t.compositionTimeOffset=r.getUint32(d),d+=4),n.samples.push(t);return n},"url ":function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4))}},vmhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),graphicsmode:t.getUint16(4),opcolor:new Uint16Array([t.getUint16(6),t.getUint16(8),t.getUint16(10)])}}},Ct={inspect:yt=function(e){for(var t,n,r,i,a,s=0,o=[],u=new ArrayBuffer(e.length),l=new Uint8Array(u),c=0;c<e.length;++c)l[c]=e[c];for(t=new DataView(u);s<e.byteLength;)n=t.getUint32(s),r=Tt(e.subarray(s+4,s+8)),i=n>1?s+n:e.byteLength,(a=(wt[r]||function(e){return{data:e}})(e.subarray(s+8,i))).size=n,a.type=r,o.push(a),s=i;return o},textify:_t=function(e,t){var n;return t=t||0,n=new Array(2*t+1).join(" "),e.map((function(e,r){return n+e.type+"\n"+Object.keys(e).filter((function(e){return"type"!==e&&"boxes"!==e})).map((function(t){var r=n+" "+t+": ",i=e[t];if(i instanceof Uint8Array||i instanceof Uint32Array){var a=Array.prototype.slice.call(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)).map((function(e){return" "+("00"+e.toString(16)).slice(-2)})).join("").match(/.{1,24}/g);return a?1===a.length?r+"<"+a.join("").slice(1)+">":r+"<\n"+a.map((function(e){return n+" "+e})).join("\n")+"\n"+n+" >":r+"<>"}return r+JSON.stringify(i,null,2).split("\n").map((function(e,t){return 0===t?e:n+" "+e})).join("\n")})).join("\n")+(e.boxes?"\n"+_t(e.boxes,t+1):"")})).join("\n")},parseTfdt:wt.tfdt,parseHdlr:wt.hdlr,parseTfhd:wt.tfhd,parseTrun:wt.trun,parseSidx:wt.sidx},At=Se,Lt=xe.CaptionStream,Rt=function(e,t){for(var n=e,r=0;r<t.length;r++){var i=t[r];if(n<i.size)return i;n-=i.size}return null},xt=function(e,t){var n=W.findBox(e,["moof","traf"]),r=W.findBox(e,["mdat"]),i={},a=[];return r.forEach((function(e,t){var r=n[t];a.push({mdat:e,traf:r})})),a.forEach((function(e){var n,r,a=e.mdat,s=e.traf,o=W.findBox(s,["tfhd"]),u=Ct.parseTfhd(o[0]),l=u.trackId,c=W.findBox(s,["tfdt"]),d=c.length>0?Ct.parseTfdt(c[0]).baseMediaDecodeTime:0,h=W.findBox(s,["trun"]);t===l&&h.length>0&&(n=function(e,t,n){var r=t,i=n.defaultSampleDuration||0,a=n.defaultSampleSize||0,s=n.trackId,o=[];return e.forEach((function(e){var t=Ct.parseTrun(e).samples;t.forEach((function(e){void 0===e.duration&&(e.duration=i),void 0===e.size&&(e.size=a),e.trackId=s,e.dts=r,void 0===e.compositionTimeOffset&&(e.compositionTimeOffset=0),e.pts=r+e.compositionTimeOffset,r+=e.duration})),o=o.concat(t)})),o}(h,d,u),r=function(e,t,n){var r,i,a,s,o=new DataView(e.buffer,e.byteOffset,e.byteLength),u=[];for(i=0;i+4<e.length;i+=a)if(a=o.getUint32(i),i+=4,!(a<=0))switch(31&e[i]){case 6:var l=e.subarray(i+1,i+1+a),c=Rt(i,t);r={nalUnitType:"sei_rbsp",size:a,data:l,escapedRBSP:At(l),trackId:n},c?(r.pts=c.pts,r.dts=c.dts,s=c):(r.pts=s.pts,r.dts=s.dts),u.push(r)}return u}(a,n,l),i[l]||(i[l]=[]),i[l]=i[l].concat(r))})),i},It={generator:H,probe:W,Transmuxer:bt.Transmuxer,AudioSegmentStream:bt.AudioSegmentStream,VideoSegmentStream:bt.VideoSegmentStream,CaptionParser:function(){var e,t,n,r,i,a=!1;this.isInitialized=function(){return a},this.init=function(){e=new Lt,a=!0,e.on("data",(function(e){e.startTime=e.startPts/r,e.endTime=e.endPts/r,i.captions.push(e),i.captionStreams[e.stream]=!0}))},this.isNewInit=function(e,t){return!(e&&0===e.length||t&&"object"==typeof t&&0===Object.keys(t).length||n===e[0]&&r===t[n])},this.parse=function(e,a,s){var o;if(!this.isInitialized())return null;if(!a||!s)return null;if(this.isNewInit(a,s))n=a[0],r=s[n];else if(!n||!r)return t.push(e),null;for(;t.length>0;){var u=t.shift();this.parse(u,a,s)}return null!==(o=function(e,t,n){return t?{seiNals:xt(e,t)[t],timescale:n}:null}(e,n,r))&&o.seiNals?(this.pushNals(o.seiNals),this.flushStream(),i):null},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach((function(t){e.push(t)}))},this.flushStream=function(){if(!this.isInitialized())return null;e.flush()},this.clearParsedCaptions=function(){i.captions=[],i.captionStreams={}},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],n=null,r=null,i?this.clearParsedCaptions():i={captions:[],captionStreams:{}},this.resetCaptionStream()},this.reset()}},Ot=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),Dt=function(){function e(t,n){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.options=n||{},this.self=t,this.init()}return Ot(e,[{key:"init",value:function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new It.Transmuxer(this.options),function(e,t){t.on("data",(function(t){var n=t.initSegment;t.initSegment={data:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength};var r=t.data;t.data=r.buffer,e.postMessage({action:"data",segment:t,byteOffset:r.byteOffset,byteLength:r.byteLength},[t.data])})),t.captionStream&&t.captionStream.on("data",(function(t){e.postMessage({action:"caption",data:t})})),t.on("done",(function(t){e.postMessage({action:"done"})})),t.on("gopInfo",(function(t){e.postMessage({action:"gopInfo",gopInfo:t})})),t.on("videoSegmentTimingInfo",(function(t){e.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:t})}))}(this.self,this.transmuxer)}},{key:"push",value:function(e){var t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)}},{key:"reset",value:function(){this.init()}},{key:"setTimestampOffset",value:function(e){var t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(9e4*t))}},{key:"setAudioAppendStart",value:function(e){this.transmuxer.setAudioAppendStart(Math.ceil(9e4*e.appendStart))}},{key:"flush",value:function(e){this.transmuxer.flush()}},{key:"resetCaptions",value:function(){this.transmuxer.resetCaptions()}},{key:"alignGopsWith",value:function(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())}}]),e}();new function(e){e.onmessage=function(t){"init"===t.data.action&&t.data.options?this.messageHandlers=new Dt(e,t.data.options):(this.messageHandlers||(this.messageHandlers=new Dt(e)),t.data&&t.data.action&&"init"!==t.data.action&&this.messageHandlers[t.data.action]&&this.messageHandlers[t.data.action](t.data))}}(n)}()})),Cd={videoCodec:"avc1",videoObjectTypeIndicator:".4d400d",audioProfile:"2"},Ad=function(e){return e.map((function(e){return e.replace(/avc1\.(\d+)\.(\d+)/i,(function(e,t,n){return"avc1."+("00"+Number(t).toString(16)).slice(-2)+"00"+("00"+Number(n).toString(16)).slice(-2)}))}))},Ld=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t={codecCount:0},n=void 0;return t.codecCount=e.split(",").length,t.codecCount=t.codecCount||2,(n=/(^|\s|,)+(avc[13])([^ ,]*)/i.exec(e))&&(t.videoCodec=n[2],t.videoObjectTypeIndicator=n[3]),t.audioProfile=/(^|\s|,)+mp4a.[0-9A-Fa-f]+\.([0-9A-Fa-f]+)/i.exec(e),t.audioProfile=t.audioProfile&&t.audioProfile[2],t},Rd=function(e,t,n){return e+"/"+t+'; codecs="'+n.filter((function(e){return!!e})).join(", ")+'"'},xd=function(e,t){var n=function(e){return e.segments&&e.segments.length&&e.segments[0].map?"mp4":"mp2t"}(t),r=function(e){var t=e.attributes||{};return t.CODECS?Ld(t.CODECS):Cd}(t),i=t.attributes||{},a=!0,s=!1;if(!t)return[];if(e.mediaGroups.AUDIO&&i.AUDIO){var o=e.mediaGroups.AUDIO[i.AUDIO];if(o)for(var u in s=!0,a=!1,o)if(!o[u].uri&&!o[u].playlists){a=!0;break}}s&&!r.audioProfile&&(a||(r.audioProfile=function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var n=e.mediaGroups.AUDIO[t];if(!n)return null;for(var r in n){var i=n[r];if(i.default&&i.playlists)return Ld(i.playlists[0].attributes.CODECS).audioProfile}return null}(e,i.AUDIO)),r.audioProfile||(Me.log.warn("Multiple audio tracks present but no audio codec string is specified. Attempting to use the default audio codec (mp4a.40.2)"),r.audioProfile=Cd.audioProfile));var l={};r.videoCodec&&(l.video=""+r.videoCodec+r.videoObjectTypeIndicator),r.audioProfile&&(l.audio="mp4a.40."+r.audioProfile);var c=Rd("audio",n,[l.audio]),d=Rd("video",n,[l.video]),h=Rd("video",n,[l.video,l.audio]);return s?!a&&l.video?[d,c]:a||l.video?[h,c]:[c,c]:l.video?[h]:[c]},Id=function(e){return/mp4a\.\d+.\d+/i.test(e)},Od=function(e){return/avc1\.[\da-f]+/i.test(e)},Dd=function(e,t,n){if(null==t||!e.length)return[];var r=Math.ceil(9e4*(t-n+3)),i=void 0;for(i=0;i<e.length&&!(e[i].pts>r);i++);return e.slice(i)},Pd=function(e){function t(e,n){yc(this,t);var r=Tc(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,Me.EventTarget));r.timestampOffset_=0,r.pendingBuffers_=[],r.bufferUpdating_=!1,r.mediaSource_=e,r.codecs_=n,r.audioCodec_=null,r.videoCodec_=null,r.audioDisabled_=!1,r.appendAudioInitSegment_=!0,r.gopBuffer_=[],r.timeMapping_=0,r.safeAppend_=Me.browser.IE_VERSION>=11;var i={remux:!1,alignGopsAtEnd:r.safeAppend_};return r.codecs_.forEach((function(e){Id(e)?r.audioCodec_=e:Od(e)&&(r.videoCodec_=e)})),r.transmuxer_=new wd,r.transmuxer_.postMessage({action:"init",options:i}),r.transmuxer_.onmessage=function(e){return"data"===e.data.action?r.data_(e):"done"===e.data.action?r.done_(e):"gopInfo"===e.data.action?r.appendGopInfo_(e):"videoSegmentTimingInfo"===e.data.action?r.videoSegmentTimingInfo_(e.data.videoSegmentTimingInfo):void 0},Object.defineProperty(r,"timestampOffset",{get:function(){return this.timestampOffset_},set:function(e){"number"==typeof e&&e>=0&&(this.timestampOffset_=e,this.appendAudioInitSegment_=!0,this.gopBuffer_.length=0,this.timeMapping_=0,this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e}))}}),Object.defineProperty(r,"appendWindowStart",{get:function(){return(this.videoBuffer_||this.audioBuffer_).appendWindowStart},set:function(e){this.videoBuffer_&&(this.videoBuffer_.appendWindowStart=e),this.audioBuffer_&&(this.audioBuffer_.appendWindowStart=e)}}),Object.defineProperty(r,"updating",{get:function(){return!!(this.bufferUpdating_||!this.audioDisabled_&&this.audioBuffer_&&this.audioBuffer_.updating||this.videoBuffer_&&this.videoBuffer_.updating)}}),Object.defineProperty(r,"buffered",{get:function(){return function(e,t,n){var r=null,i=null,a=0,s=[],o=[];if(!e&&!t)return Me.createTimeRange();if(!e)return t.buffered;if(!t)return e.buffered;if(n)return e.buffered;if(0===e.buffered.length&&0===t.buffered.length)return Me.createTimeRange();for(var u=e.buffered,l=t.buffered,c=u.length;c--;)s.push({time:u.start(c),type:"start"}),s.push({time:u.end(c),type:"end"});for(c=l.length;c--;)s.push({time:l.start(c),type:"start"}),s.push({time:l.end(c),type:"end"});for(s.sort((function(e,t){return e.time-t.time})),c=0;c<s.length;c++)"start"===s[c].type?2==++a&&(r=s[c].time):"end"===s[c].type&&1==--a&&(i=s[c].time),null!==r&&null!==i&&(o.push([r,i]),r=null,i=null);return Me.createTimeRanges(o)}(this.videoBuffer_,this.audioBuffer_,this.audioDisabled_)}}),r}return bc(t,e),_c(t,[{key:"data_",value:function(e){var t=e.data.segment;t.data=new Uint8Array(t.data,e.data.byteOffset,e.data.byteLength),t.initSegment=new Uint8Array(t.initSegment.data,t.initSegment.byteOffset,t.initSegment.byteLength),function(e,t,n){var r=t.player_;if(n.captions&&n.captions.length)for(var i in e.inbandTextTracks_||(e.inbandTextTracks_={}),n.captionStreams)if(!e.inbandTextTracks_[i]){r.tech_.trigger({type:"usage",name:"hls-608"});var a=r.textTracks().getTrackById(i);e.inbandTextTracks_[i]=a||r.addRemoteTextTrack({kind:"captions",id:i,label:i},!1).track}n.metadata&&n.metadata.length&&!e.metadataTrack_&&(e.metadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,e.metadataTrack_.inBandMetadataTrackDispatchType=n.metadata.dispatchType)}(this,this.mediaSource_,t),this.pendingBuffers_.push(t)}},{key:"done_",value:function(e){"closed"!==this.mediaSource_.readyState?this.processPendingSegments_():this.pendingBuffers_.length=0}},{key:"videoSegmentTimingInfo_",value:function(e){var t={start:{decode:e.start.dts/9e4,presentation:e.start.pts/9e4},end:{decode:e.end.dts/9e4,presentation:e.end.pts/9e4},baseMediaDecodeTime:e.baseMediaDecodeTime/9e4};e.prependedContentDuration&&(t.prependedContentDuration=e.prependedContentDuration/9e4),this.trigger({type:"videoSegmentTimingInfo",videoSegmentTimingInfo:t})}},{key:"createRealSourceBuffers_",value:function(){var e=this,t=["audio","video"];t.forEach((function(n){if(e[n+"Codec_"]&&!e[n+"Buffer_"]){var r=null;if(e.mediaSource_[n+"Buffer_"])(r=e.mediaSource_[n+"Buffer_"]).updating=!1;else{var i=n+'/mp4;codecs="'+e[n+"Codec_"]+'"';r=function(e,t){var n=e.addSourceBuffer(t),r=Object.create(null);for(var i in r.updating=!1,r.realBuffer_=n,n)!function(e){"function"==typeof n[e]?r[e]=function(){return n[e].apply(n,arguments)}:void 0===r[e]&&Object.defineProperty(r,e,{get:function(){return n[e]},set:function(t){return n[e]=t}})}(i);return r}(e.mediaSource_.nativeMediaSource_,i),e.mediaSource_[n+"Buffer_"]=r}e[n+"Buffer_"]=r,["update","updatestart","updateend"].forEach((function(i){r.addEventListener(i,(function(){if("audio"!==n||!e.audioDisabled_)return"updateend"===i&&(e[n+"Buffer_"].updating=!1),t.every((function(t){return!("audio"!==t||!e.audioDisabled_)||n===t||!e[t+"Buffer_"]||!e[t+"Buffer_"].updating}))?e.trigger(i):void 0}))}))}}))}},{key:"appendBuffer",value:function(e){if(this.bufferUpdating_=!0,this.audioBuffer_&&this.audioBuffer_.buffered.length){var t=this.audioBuffer_.buffered;this.transmuxer_.postMessage({action:"setAudioAppendStart",appendStart:t.end(t.length-1)})}this.videoBuffer_&&this.transmuxer_.postMessage({action:"alignGopsWith",gopsToAlignWith:Dd(this.gopBuffer_,this.mediaSource_.player_?this.mediaSource_.player_.currentTime():null,this.timeMapping_)}),this.transmuxer_.postMessage({action:"push",data:e.buffer,byteOffset:e.byteOffset,byteLength:e.byteLength},[e.buffer]),this.transmuxer_.postMessage({action:"flush"})}},{key:"appendGopInfo_",value:function(e){this.gopBuffer_=function(e,t,n){if(!t.length)return e;if(n)return t.slice();for(var r=t[0].pts,i=0;i<e.length&&!(e[i].pts>=r);i++);return e.slice(0,i).concat(t)}(this.gopBuffer_,e.data.gopInfo,this.safeAppend_)}},{key:"remove",value:function(e,t){if(this.videoBuffer_&&(this.videoBuffer_.updating=!0,this.videoBuffer_.remove(e,t),this.gopBuffer_=function(e,t,n,r){for(var i=Math.ceil(9e4*(t-r)),a=Math.ceil(9e4*(n-r)),s=e.slice(),o=e.length;o--&&!(e[o].pts<=a););if(-1===o)return s;for(var u=o+1;u--&&!(e[u].pts<=i););return u=Math.max(u,0),s.splice(u,o-u+1),s}(this.gopBuffer_,e,t,this.timeMapping_)),!this.audioDisabled_&&this.audioBuffer_&&(this.audioBuffer_.updating=!0,this.audioBuffer_.remove(e,t)),fd(e,t,this.metadataTrack_),this.inbandTextTracks_)for(var n in this.inbandTextTracks_)fd(e,t,this.inbandTextTracks_[n])}},{key:"processPendingSegments_",value:function(){var e={video:{segments:[],bytes:0},audio:{segments:[],bytes:0},captions:[],metadata:[]},t="";e=this.pendingBuffers_.reduce((function(e,n){var r=n.type,i=n.data,a=n.initSegment;return e[r]?(e[r].segments.push(i),e[r].bytes+=i.byteLength,e[r].initSegment=a,n.captions&&(e.captions=e.captions.concat(n.captions)),n.info&&(e[r].info=n.info),n.metadata&&(e.metadata=e.metadata.concat(n.metadata)),e):(t=r,e)}),e),t&&this.mediaSource_&&this.mediaSource_.player_&&this.mediaSource_.player_.trigger({type:"unknow-segment-type",name:t}),this.videoBuffer_||this.audioBuffer_||(0===e.video.bytes&&(this.videoCodec_=null),0===e.audio.bytes&&(this.audioCodec_=null),this.createRealSourceBuffers_()),e.audio.info&&this.mediaSource_.trigger({type:"audioinfo",info:e.audio.info}),e.video.info&&this.mediaSource_.trigger({type:"videoinfo",info:e.video.info}),this.appendAudioInitSegment_&&(!this.audioDisabled_&&this.audioBuffer_&&(e.audio.segments.unshift(e.audio.initSegment),e.audio.bytes+=e.audio.initSegment.byteLength),this.appendAudioInitSegment_=!1);var n=!1;this.videoBuffer_&&e.video.bytes?(e.video.segments.unshift(e.video.initSegment),e.video.bytes+=e.video.initSegment.byteLength,this.concatAndAppendSegments_(e.video,this.videoBuffer_)):!this.videoBuffer_||!this.audioDisabled_&&this.audioBuffer_||(n=!0),vd(this,e.captions,e.metadata),!this.audioDisabled_&&this.audioBuffer_&&this.concatAndAppendSegments_(e.audio,this.audioBuffer_),this.pendingBuffers_.length=0,n&&this.trigger("updateend"),this.bufferUpdating_=!1}},{key:"concatAndAppendSegments_",value:function(e,t){var n=0,r=void 0;if(e.bytes){r=new Uint8Array(e.bytes),e.segments.forEach((function(e){r.set(e,n),n+=e.byteLength}));try{t.updating=!0,t.appendBuffer(r)}catch(e){this.mediaSource_.player_&&this.mediaSource_.player_.error({code:-3,type:"APPEND_BUFFER_ERR",message:e.message,originalError:e})}}}},{key:"abort",value:function(){this.videoBuffer_&&this.videoBuffer_.abort(),!this.audioDisabled_&&this.audioBuffer_&&this.audioBuffer_.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"reset"}),this.pendingBuffers_.length=0,this.bufferUpdating_=!1}}]),t}(Me.EventTarget),Md=function(n){function r(){yc(this,r);var n=Tc(this,(r.__proto__||Object.getPrototypeOf(r)).call(this)),i=void 0;for(i in n.nativeMediaSource_=new e.MediaSource,n.nativeMediaSource_)"handle"===i||i in r.prototype||"function"!=typeof n.nativeMediaSource_[i]||(n[i]=n.nativeMediaSource_[i].bind(n.nativeMediaSource_));return n.duration_=NaN,Object.defineProperty(n,"duration",{get:function(){return this.duration_===1/0?this.duration_:this.nativeMediaSource_.duration},set:function(e){this.duration_=e,e===1/0||(this.nativeMediaSource_.duration=e)}}),Object.defineProperty(n,"seekable",{get:function(){return this.duration_===1/0?Me.createTimeRanges([[0,this.nativeMediaSource_.duration]]):this.nativeMediaSource_.seekable}}),Object.defineProperty(n,"readyState",{get:function(){return this.nativeMediaSource_.readyState}}),Object.defineProperty(n,"activeSourceBuffers",{get:function(){return this.activeSourceBuffers_}}),n.sourceBuffers=[],n.activeSourceBuffers_=[],n.updateActiveSourceBuffers_=function(){if(n.activeSourceBuffers_.length=0,1===n.sourceBuffers.length){var e=n.sourceBuffers[0];return e.appendAudioInitSegment_=!0,e.audioDisabled_=!e.audioCodec_,void n.activeSourceBuffers_.push(e)}for(var t=!1,r=!0,i=0;i<n.player_.audioTracks().length;i++){var a=n.player_.audioTracks()[i];if(a.enabled&&"main"!==a.kind){t=!0,r=!1;break}}n.sourceBuffers.forEach((function(e,i){if(e.appendAudioInitSegment_=!0,e.videoCodec_&&e.audioCodec_)e.audioDisabled_=t;else if(e.videoCodec_&&!e.audioCodec_)e.audioDisabled_=!0,r=!1;else if(!e.videoCodec_&&e.audioCodec_&&(e.audioDisabled_=i?r:!r,e.audioDisabled_))return;n.activeSourceBuffers_.push(e)}))},n.onPlayerMediachange_=function(){n.sourceBuffers.forEach((function(e){e.appendAudioInitSegment_=!0}))},n.onHlsReset_=function(){n.sourceBuffers.forEach((function(e){e.transmuxer_&&e.transmuxer_.postMessage({action:"resetCaptions"})}))},n.onHlsSegmentTimeMapping_=function(e){n.sourceBuffers.forEach((function(t){return t.timeMapping_=e.mapping}))},["sourceopen","sourceclose","sourceended"].forEach((function(e){this.nativeMediaSource_.addEventListener(e,this.trigger.bind(this))}),n),n.on("sourceopen",(function(e){var r=t.querySelector('[src="'+n.url_+'"]');r&&(n.player_=Me(r.parentNode),n.player_&&(n.player_.tech_.on("hls-reset",n.onHlsReset_),n.player_.tech_.on("hls-segment-time-mapping",n.onHlsSegmentTimeMapping_),n.player_.audioTracks&&n.player_.audioTracks()&&(n.player_.audioTracks().on("change",n.updateActiveSourceBuffers_),n.player_.audioTracks().on("addtrack",n.updateActiveSourceBuffers_),n.player_.audioTracks().on("removetrack",n.updateActiveSourceBuffers_)),n.player_.on("mediachange",n.onPlayerMediachange_)))})),n.on("sourceended",(function(e){for(var t=pd(n.duration),r=0;r<n.sourceBuffers.length;r++){var i=n.sourceBuffers[r],a=i.metadataTrack_&&i.metadataTrack_.cues;a&&a.length&&(a[a.length-1].endTime=t)}})),n.on("sourceclose",(function(e){this.sourceBuffers.forEach((function(e){e.transmuxer_&&e.transmuxer_.terminate()})),this.sourceBuffers.length=0,this.player_&&(this.player_.audioTracks&&this.player_.audioTracks()&&(this.player_.audioTracks().off("change",this.updateActiveSourceBuffers_),this.player_.audioTracks().off("addtrack",this.updateActiveSourceBuffers_),this.player_.audioTracks().off("removetrack",this.updateActiveSourceBuffers_)),this.player_.el_&&this.player_.off("mediachange",this.onPlayerMediachange_),this.player_.tech_&&this.player_.tech_.el_&&(this.player_.tech_.off("hls-reset",this.onHlsReset_),this.player_.tech_.off("hls-segment-time-mapping",this.onHlsSegmentTimeMapping_)))})),n}return bc(r,n),_c(r,[{key:"addSeekableRange_",value:function(e,t){var n=void 0;if(this.duration!==1/0)throw(n=new Error("MediaSource.addSeekableRange() can only be invoked when the duration is Infinity")).name="InvalidStateError",n.code=11,n;(t>this.nativeMediaSource_.duration||isNaN(this.nativeMediaSource_.duration))&&(this.nativeMediaSource_.duration=t)}},{key:"addSourceBuffer",value:function(e){var t=void 0,n=function(e){var t={type:"",parameters:{}},n=e.trim().split(";");return t.type=n.shift().trim(),n.forEach((function(e){var n=e.trim().split("=");if(n.length>1){var r=n[0].replace(/"/g,"").trim(),i=n[1].replace(/"/g,"").trim();t.parameters[r]=i}})),t}(e);if(/^(video|audio)\/mp2t$/i.test(n.type)){var r=[];n.parameters&&n.parameters.codecs&&(r=n.parameters.codecs.split(","),r=(r=Ad(r)).filter((function(e){return Id(e)||Od(e)}))),0===r.length&&(r=["avc1.4d400d","mp4a.40.2"]),t=new Pd(this,r),0!==this.sourceBuffers.length&&(this.sourceBuffers[0].createRealSourceBuffers_(),t.createRealSourceBuffers_(),this.sourceBuffers[0].audioDisabled_=!0)}else t=this.nativeMediaSource_.addSourceBuffer(e);return this.sourceBuffers.push(t),t}}]),r}(Me.EventTarget),jd=0;Me.mediaSources={};var Ud=function(e,t){var n=Me.mediaSources[e];if(!n)throw new Error("Media Source not found (Video.js)");n.trigger({type:"sourceopen",swfId:t})},Bd=function(){return!!e.MediaSource&&!!e.MediaSource.isTypeSupported&&e.MediaSource.isTypeSupported('video/mp4;codecs="avc1.4d400d,mp4a.40.2"')},Fd=function(){if(this.MediaSource={open:Ud,supportsNativeMediaSources:Bd},Bd())return new Md;throw new Error("Cannot use create a virtual MediaSource for this video")};Fd.open=Ud,Fd.supportsNativeMediaSources=Bd;var Nd={createObjectURL:function(t){var n=void 0;return t instanceof Md?(n=e.URL.createObjectURL(t.nativeMediaSource_),t.url_=n,n):t instanceof Md?(n="blob:vjs-media-source/"+jd,jd++,Me.mediaSources[n]=t,n):(n=e.URL.createObjectURL(t),t.url_=n,n)}};Me.MediaSource=Fd,Me.URL=Nd;var Gd=Me.EventTarget,Vd=Me.mergeOptions,Hd=function(e,t){for(var n=void 0,r=Vd(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod}),i=0;i<t.playlists.length;i++){var a=Ac(r,t.playlists[i]);a?r=a:n=!0}return Cc(t,(function(e,t,i,a){if(e.playlists&&e.playlists.length){var s=e.playlists[0].uri,o=Ac(r,e.playlists[0]);o&&((r=o).mediaGroups[t][i][a].playlists[0]=r.playlists[s],n=!1)}})),n?null:r},zd=function(e){var t=e.byterange.offset+e.byterange.length-1;return e.uri+"-"+e.byterange.offset+"-"+t},Wd=function(e,t){return(Boolean(!e.map&&!t.map)||Boolean(e.map&&t.map&&e.map.byterange.offset===t.map.byterange.offset&&e.map.byterange.length===t.map.byterange.length))&&e.uri===t.uri&&e.byterange.offset===t.byterange.offset&&e.byterange.length===t.byterange.length},Kd=function(e,t){var n={};for(var r in e){var i=e[r].sidx;if(i){var a=zd(i);if(!t[a])break;var s=t[a].sidxInfo;Wd(s,i)&&(n[a]=t[a])}}return n},qd=function(e,t,n,r,i){var a={uri:gc(r.handleManifestRedirects,e.resolvedUri),byterange:e.byterange,playlist:t};return n(Me.mergeOptions(a,{responseType:"arraybuffer",headers:Jc(a)}),i)},$d=function(t){function n(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments[3];yc(this,n);var a=Tc(this,(n.__proto__||Object.getPrototypeOf(n)).call(this)),s=r.withCredentials,o=void 0!==s&&s,u=r.handleManifestRedirects,l=void 0!==u&&u;if(a.hls_=t,a.withCredentials=o,a.handleManifestRedirects=l,!e)throw new Error("A non-empty playlist URL or playlist is required");return a.on("minimumUpdatePeriod",(function(){a.refreshXml_()})),a.on("mediaupdatetimeout",(function(){a.refreshMedia_(a.media().uri)})),a.state="HAVE_NOTHING",a.loadedPlaylists_={},"string"==typeof e?(a.srcUrl=e,a.sidxMapping_={},Tc(a)):(a.setupChildLoader(i,e),a)}return bc(n,t),_c(n,[{key:"setupChildLoader",value:function(e,t){this.masterPlaylistLoader_=e,this.childPlaylist_=t}},{key:"dispose",value:function(){this.stopRequest(),this.loadedPlaylists_={},e.clearTimeout(this.minimumUpdatePeriodTimeout_),e.clearTimeout(this.mediaRequest_),e.clearTimeout(this.mediaUpdateTimeout)}},{key:"hasPendingRequest",value:function(){return this.request||this.mediaRequest_}},{key:"stopRequest",value:function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}},{key:"sidxRequestFinished_",value:function(e,t,n,r){var i=this;return function(a,s){if(i.request){if(i.request=null,a)return i.error={status:s.status,message:"DASH playlist request error at URL: "+e.uri,response:s.response,code:2},n&&(i.state=n),i.trigger("error"),r(t,null);var o=new Uint8Array(s.response),u=fu.parseSidx(o.subarray(8));return r(t,u)}}}},{key:"media",value:function(t){var n=this;if(!t)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);var r=this.state;if("string"==typeof t){if(!this.master.playlists[t])throw new Error("Unknown playlist URI: "+t);t=this.master.playlists[t]}var i=!this.media_||t.uri!==this.media_.uri;if(i&&this.loadedPlaylists_[t.uri]&&this.loadedPlaylists_[t.uri].endList)return this.state="HAVE_METADATA",this.media_=t,void(i&&(this.trigger("mediachanging"),this.trigger("mediachange")));if(i){if(this.media_&&this.trigger("mediachanging"),!t.sidx)return void(this.mediaRequest_=e.setTimeout(this.haveMetadata.bind(this,{startingState:r,playlist:t}),0));var a=void 0,s=void 0;this.masterPlaylistLoader_?(a=this.masterPlaylistLoader_.master,s=this.masterPlaylistLoader_.sidxMapping_):(a=this.master,s=this.sidxMapping_);var o=zd(t.sidx);s[o]={sidxInfo:t.sidx},this.request=qd(t.sidx,t,this.hls_.xhr,{handleManifestRedirects:this.handleManifestRedirects},this.sidxRequestFinished_(t,a,r,(function(e,i){if(!e||!i)throw new Error("failed to request sidx");s[o].sidx=i,n.haveMetadata({startingState:r,playlist:e.playlists[t.uri]})})))}}},{key:"haveMetadata",value:function(e){var t=e.startingState,n=e.playlist;this.state="HAVE_METADATA",this.loadedPlaylists_[n.uri]=n,this.mediaRequest_=null,this.refreshMedia_(n.uri),"HAVE_MASTER"===t?this.trigger("loadedmetadata"):this.trigger("mediachange")}},{key:"pause",value:function(){this.stopRequest(),e.clearTimeout(this.mediaUpdateTimeout),e.clearTimeout(this.minimumUpdatePeriodTimeout_),"HAVE_NOTHING"===this.state&&(this.started=!1)}},{key:"load",value:function(t){var n=this;e.clearTimeout(this.mediaUpdateTimeout),e.clearTimeout(this.minimumUpdatePeriodTimeout_);var r=this.media();if(t){var i=r?r.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=e.setTimeout((function(){return n.load()}),i)}else this.started?this.trigger("loadedplaylist"):this.start()}},{key:"parseMasterXml",value:function(){var e=bo(this.masterXml_,{manifestUri:this.srcUrl,clientOffset:this.clientOffset_,sidxMapping:this.sidxMapping_});e.uri=this.srcUrl;for(var t=0;t<e.playlists.length;t++){var n="placeholder-uri-"+t;e.playlists[t].uri=n,e.playlists[n]=e.playlists[t]}return Cc(e,(function(t,n,r,i){if(t.playlists&&t.playlists.length){var a="placeholder-uri-"+n+"-"+r+"-"+i;t.playlists[0].uri=a,e.playlists[a]=t.playlists[0]}})),Lc(e),Rc(e),e}},{key:"start",value:function(){var t=this;this.started=!0,this.masterPlaylistLoader_?this.mediaRequest_=e.setTimeout(this.haveMaster_.bind(this),0):this.request=this.hls_.xhr({uri:this.srcUrl,withCredentials:this.withCredentials},(function(e,n){if(t.request){if(t.request=null,e)return t.error={status:n.status,message:"DASH playlist request error at URL: "+t.srcUrl,responseText:n.responseText,code:2},"HAVE_NOTHING"===t.state&&(t.started=!1),t.trigger("error");t.masterXml_=n.responseText,n.responseHeaders&&n.responseHeaders.date?t.masterLoaded_=Date.parse(n.responseHeaders.date):t.masterLoaded_=Date.now(),t.srcUrl=gc(t.handleManifestRedirects,t.srcUrl,n),t.syncClientServerClock_(t.onClientServerClockSync_.bind(t))}}))}},{key:"syncClientServerClock_",value:function(e){var t=this,n=To(this.masterXml_);return null===n?(this.clientOffset_=this.masterLoaded_-Date.now(),e()):"DIRECT"===n.method?(this.clientOffset_=n.value-Date.now(),e()):void(this.request=this.hls_.xhr({uri:mc(this.srcUrl,n.value),method:n.method,withCredentials:this.withCredentials},(function(r,i){if(t.request){if(r)return t.clientOffset_=t.masterLoaded_-Date.now(),e();var a;a="HEAD"===n.method?i.responseHeaders&&i.responseHeaders.date?Date.parse(i.responseHeaders.date):t.masterLoaded_:Date.parse(i.responseText),t.clientOffset_=a-Date.now(),e()}})))}},{key:"haveMaster_",value:function(){this.state="HAVE_MASTER",this.mediaRequest_=null,this.masterPlaylistLoader_?this.media_||this.media(this.childPlaylist_):(this.master=this.parseMasterXml(),this.trigger("loadedplaylist"))}},{key:"onClientServerClockSync_",value:function(){var t=this;this.haveMaster_(),this.hasPendingRequest()||this.media_||this.media(this.master.playlists[0]),this.master&&this.master.minimumUpdatePeriod&&(this.minimumUpdatePeriodTimeout_=e.setTimeout((function(){t.trigger("minimumUpdatePeriod")}),this.master.minimumUpdatePeriod))}},{key:"refreshXml_",value:function(){var t=this;this.request=this.hls_.xhr({uri:this.srcUrl,withCredentials:this.withCredentials},(function(n,r){if(t.request){if(t.request=null,n)return t.error={status:r.status,message:"DASH playlist request error at URL: "+t.srcUrl,responseText:r.responseText,code:2},"HAVE_NOTHING"===t.state&&(t.started=!1),t.trigger("error");t.masterXml_=r.responseText,t.sidxMapping_=function(e,t,n,r){var i=bo(e,{manifestUri:t,clientOffset:n}),a=Kd(i.playlists,r);return Cc(i,(function(e,t,n,i){if(e.playlists&&e.playlists.length){var s=e.playlists;a=Vd(a,Kd(s,r))}})),a}(t.masterXml_,t.srcUrl,t.clientOffset_,t.sidxMapping_);var i=t.parseMasterXml(),a=Hd(t.master,i);if(a){var s=zd(t.media().sidx);if(t.sidxMapping_[s])t.master=a;else{var o=t.media();t.request=qd(o.sidx,o,t.hls_.xhr,{handleManifestRedirects:t.handleManifestRedirects},t.sidxRequestFinished_(o,i,t.state,(function(n,r){if(!n||!r)throw new Error("failed to request sidx on minimumUpdatePeriod");t.sidxMapping_[s].sidx=r,t.minimumUpdatePeriodTimeout_=e.setTimeout((function(){t.trigger("minimumUpdatePeriod")}),t.master.minimumUpdatePeriod),t.refreshMedia_(t.media().uri)})))}}t.minimumUpdatePeriodTimeout_=e.setTimeout((function(){t.trigger("minimumUpdatePeriod")}),t.master.minimumUpdatePeriod)}}))}},{key:"refreshMedia_",value:function(t){var n=this;if(!t)throw new Error("refreshMedia_ must take a media uri");var r=void 0,i=void 0;this.masterPlaylistLoader_?(r=this.masterPlaylistLoader_.master,i=this.masterPlaylistLoader_.parseMasterXml()):(r=this.master,i=this.parseMasterXml());var a=Hd(r,i);a?(this.masterPlaylistLoader_?this.masterPlaylistLoader_.master=a:this.master=a,this.media_=a.playlists[t]):(this.media_=i.playlists[t],this.trigger("playlistunchanged")),this.media().endList||(this.mediaUpdateTimeout=e.setTimeout((function(){n.trigger("mediaupdatetimeout")}),xc(this.media(),!!a))),this.trigger("loadedplaylist")}}]),n}(Gd),Yd=function(e){return Me.log.debug?Me.log.debug.bind(Me,"VHS:",e+" >"):function(){}},Xd=function(){function e(t,n,r,i){yc(this,e),this.callbacks_=[],this.pendingCallback_=null,this.timestampOffset_=0,this.mediaSource=t,this.processedAppend_=!1,this.type_=r,this.mimeType_=n,this.logger_=Yd("SourceUpdater["+r+"]["+n+"]"),"closed"===t.readyState?t.addEventListener("sourceopen",this.createSourceBuffer_.bind(this,n,i)):this.createSourceBuffer_(n,i)}return _c(e,[{key:"createSourceBuffer_",value:function(e,t){var n=this;this.sourceBuffer_=this.mediaSource.addSourceBuffer(e),this.logger_("created SourceBuffer"),t&&(t.trigger("sourcebufferadded"),this.mediaSource.sourceBuffers.length<2)?t.on("sourcebufferadded",(function(){n.start_()})):this.start_()}},{key:"start_",value:function(){var e=this;this.started_=!0,this.onUpdateendCallback_=function(){var t=e.pendingCallback_;e.pendingCallback_=null,e.sourceBuffer_.removing=!1,e.logger_("buffered ["+dd(e.buffered())+"]"),t&&t(),e.runCallback_()},this.sourceBuffer_.addEventListener("updateend",this.onUpdateendCallback_),this.runCallback_()}},{key:"abort",value:function(e){var t=this;this.processedAppend_&&this.queueCallback_((function(){t.sourceBuffer_.abort()}),e)}},{key:"appendBuffer",value:function(e,t){var n=this;this.processedAppend_=!0,this.queueCallback_((function(){e.videoSegmentTimingInfoCallback&&n.sourceBuffer_.addEventListener("videoSegmentTimingInfo",e.videoSegmentTimingInfoCallback),n.sourceBuffer_.appendBuffer(e.bytes)}),(function(){e.videoSegmentTimingInfoCallback&&n.sourceBuffer_.removeEventListener("videoSegmentTimingInfo",e.videoSegmentTimingInfoCallback),t()}))}},{key:"buffered",value:function(){return this.sourceBuffer_?this.sourceBuffer_.buffered:Me.createTimeRanges()}},{key:"remove",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ve;this.processedAppend_&&this.queueCallback_((function(){n.logger_("remove ["+e+" => "+t+"]"),n.sourceBuffer_.removing=!0,n.sourceBuffer_.remove(e,t)}),r)}},{key:"updating",value:function(){return!this.sourceBuffer_||this.sourceBuffer_.updating||!!this.pendingCallback_&&this.pendingCallback_!==Ve}},{key:"timestampOffset",value:function(e){var t=this;return void 0!==e&&(this.queueCallback_((function(){t.sourceBuffer_.timestampOffset=e,t.runCallback_()})),this.timestampOffset_=e),this.timestampOffset_}},{key:"queueCallback_",value:function(e,t){this.callbacks_.push([e.bind(this),t]),this.runCallback_()}},{key:"runCallback_",value:function(){var e=void 0;!this.updating()&&this.callbacks_.length&&this.started_&&(e=this.callbacks_.shift(),this.pendingCallback_=e[1],e[0]())}},{key:"dispose",value:function(){var e=this,t=function t(){e.sourceBuffer_&&"open"===e.mediaSource.readyState&&e.sourceBuffer_.abort(),e.sourceBuffer_.removeEventListener("updateend",t)};this.sourceBuffer_.removeEventListener("updateend",this.onUpdateendCallback_),this.sourceBuffer_.removing?this.sourceBuffer_.addEventListener("updateend",t):t()}}]),e}(),Jd={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,BUFFER_LOW_WATER_LINE_RATE:1},Qd=2,Zd=-101,eh=-102,th=function(e){e.forEach((function(e){e.abort()}))},nh=function(e,t){return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:Zd,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:eh,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:Qd,xhr:t}:null},rh=function(e,t,n){var r=0,i=!1;return function(a,s){if(!i)return a?(i=!0,th(e),n(a,s)):(r+=1)===e.length?(s.endOfAllRequests=Date.now(),s.encryptedBytes?function(e,t,n){var r;e.addEventListener("message",(function r(i){if(i.data.source===t.requestId){e.removeEventListener("message",r);var a=i.data.decrypted;return t.bytes=new Uint8Array(a.bytes,a.byteOffset,a.byteLength),n(null,t)}})),r=t.key.bytes.slice?t.key.bytes.slice():new Uint32Array(Array.prototype.slice.call(t.key.bytes)),e.postMessage(td({source:t.requestId,encrypted:t.encryptedBytes,key:r,iv:t.key.iv}),[t.encryptedBytes.buffer,r.buffer])}(t,s,n):n(null,s)):void 0}},ih=function(e,t){return function(n){return e.stats=Me.mergeOptions(e.stats,function(e){var t=e.target,n={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-t.requestTime||0};return n.bytesReceived=e.loaded,n.bandwidth=Math.floor(n.bytesReceived/n.roundTripTime*8*1e3),n}(n)),!e.stats.firstBytesReceivedAt&&e.stats.bytesReceived&&(e.stats.firstBytesReceivedAt=Date.now()),t(n,e)}},ah=function(e,t,n,r,i,a,s){var o=[],u=rh(o,n,s);if(i.key&&!i.key.bytes){var l=Me.mergeOptions(t,{uri:i.key.resolvedUri,responseType:"arraybuffer"}),c=function(e,t){return function(n,r){var i=r.response,a=nh(n,r);if(a)return t(a,e);if(16!==i.byteLength)return t({status:r.status,message:"Invalid HLS key at URL: "+r.uri,code:Qd,xhr:r},e);var s=new DataView(i);return e.key.bytes=new Uint32Array([s.getUint32(0),s.getUint32(4),s.getUint32(8),s.getUint32(12)]),t(null,e)}}(i,u),d=e(l,c);o.push(d)}if(i.map&&!i.map.bytes){var h=Me.mergeOptions(t,{uri:i.map.resolvedUri,responseType:"arraybuffer",headers:Jc(i.map)}),f=function(e,t,n){return function(r,i){var a=i.response,s=nh(r,i);return s?n(s,e):0===a.byteLength?n({status:i.status,message:"Empty HLS segment content at URL: "+i.uri,code:Qd,xhr:i},e):(e.map.bytes=new Uint8Array(i.response),t&&!t.isInitialized()&&t.init(),e.map.timescales=ou.timescale(e.map.bytes),e.map.videoTrackIds=ou.videoTrackIds(e.map.bytes),n(null,e))}}(i,r,u),p=e(h,f);o.push(p)}var v=Me.mergeOptions(t,{uri:i.resolvedUri,responseType:"arraybuffer",headers:Jc(i)}),m=function(e,t,n){return function(r,i){var a=i.response,s=nh(r,i),o=void 0;return s?n(s,e):0===a.byteLength?n({status:i.status,message:"Empty HLS segment content at URL: "+i.uri,code:Qd,xhr:i},e):(e.stats=function(e){return{bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}}(i),e.key?e.encryptedBytes=new Uint8Array(i.response):e.bytes=new Uint8Array(i.response),t&&e.map&&e.map.bytes&&(t.isInitialized()||t.init(),(o=t.parse(e.bytes,e.map.videoTrackIds,e.map.timescales))&&o.captions&&(e.captionStreams=o.captionStreams,e.fmp4Captions=o.captions)),n(null,e))}}(i,r,u),g=e(v,m);return g.addEventListener("progress",ih(i,a)),o.push(g),function(){return th(o)}},sh=function(t,n){var r=void 0;return t?(r=e.getComputedStyle(t))?r[n]:"":""},oh=function(e,t){var n=e.slice();e.sort((function(e,r){var i=t(e,r);return 0===i?n.indexOf(e)-n.indexOf(r):i}))},uh=function(t,n){var r=void 0,i=void 0;return t.attributes.BANDWIDTH&&(r=t.attributes.BANDWIDTH),r=r||e.Number.MAX_VALUE,n.attributes.BANDWIDTH&&(i=n.attributes.BANDWIDTH),r-(i=i||e.Number.MAX_VALUE)},lh=function(e,t,n){if(!e||!t)return!1;var r=n===e.segments.length;return e.endList&&"open"===t.readyState&&r},ch=function(e){return"number"==typeof e&&isFinite(e)},dh=function(t){function n(e){yc(this,n);var t=Tc(this,(n.__proto__||Object.getPrototypeOf(n)).call(this));if(!e)throw new TypeError("Initialization settings are required");if("function"!=typeof e.currentTime)throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");return t.bandwidth=e.bandwidth,t.throughput={rate:0,count:0},t.roundTrip=NaN,t.resetStats_(),t.mediaIndex=null,t.hasPlayed_=e.hasPlayed,t.currentTime_=e.currentTime,t.seekable_=e.seekable,t.seeking_=e.seeking,t.duration_=e.duration,t.mediaSource_=e.mediaSource,t.hls_=e.hls,t.loaderType_=e.loaderType,t.startingMedia_=void 0,t.segmentMetadataTrack_=e.segmentMetadataTrack,t.goalBufferLength_=e.goalBufferLength,t.sourceType_=e.sourceType,t.inbandTextTracks_=e.inbandTextTracks,t.state_="INIT",t.checkBufferTimeout_=null,t.error_=void 0,t.currentTimeline_=-1,t.pendingSegment_=null,t.mimeType_=null,t.sourceUpdater_=null,t.xhrOptions_=null,t.activeInitSegmentId_=null,t.initSegments_={},t.cacheEncryptionKeys_=e.cacheEncryptionKeys,t.keyCache_={},"main"===t.loaderType_?t.captionParser_=new Yl:t.captionParser_=null,t.decrypter_=e.decrypter,t.syncController_=e.syncController,t.syncPoint_={segmentIndex:0,time:0},t.syncController_.on("syncinfoupdate",(function(){return t.trigger("syncinfoupdate")})),t.mediaSource_.addEventListener("sourceopen",(function(){return t.ended_=!1})),t.fetchAtBuffer_=!1,t.logger_=Yd("SegmentLoader["+t.loaderType_+"]"),Object.defineProperty(t,"state",{get:function(){return this.state_},set:function(e){e!==this.state_&&(this.logger_(this.state_+" -> "+e),this.state_=e)}}),t}return bc(n,t),_c(n,[{key:"resetStats_",value:function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0}},{key:"dispose",value:function(){this.state="DISPOSED",this.pause(),this.abort_(),this.sourceUpdater_&&this.sourceUpdater_.dispose(),this.resetStats_(),this.captionParser_&&this.captionParser_.reset()}},{key:"abort",value:function(){"WAITING"===this.state?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null)}},{key:"abort_",value:function(){this.pendingSegment_&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null}},{key:"error",value:function(e){return void 0!==e&&(this.error_=e),this.pendingSegment_=null,this.error_}},{key:"endOfStream",value:function(){this.ended_=!0,this.pause(),this.trigger("ended")}},{key:"buffered_",value:function(){return this.sourceUpdater_?this.sourceUpdater_.buffered():Me.createTimeRanges()}},{key:"initSegment",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return null;var n=nd(e),r=this.initSegments_[n];return t&&!r&&e.bytes&&(this.initSegments_[n]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,timescales:e.timescales,videoTrackIds:e.videoTrackIds}),r||e}},{key:"segmentKey",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return null;var n=rd(e),r=this.keyCache_[n];this.cacheEncryptionKeys_&&t&&!r&&e.bytes&&(this.keyCache_[n]=r={resolvedUri:e.resolvedUri,bytes:e.bytes});var i={resolvedUri:(r||e).resolvedUri};return r&&(i.bytes=r.bytes),i}},{key:"couldBeginLoading_",value:function(){return this.playlist_&&(this.sourceUpdater_||this.mimeType_&&"INIT"===this.state)&&!this.paused()}},{key:"load",value:function(){if(this.monitorBuffer_(),this.playlist_){if(this.syncController_.setDateTimeMapping(this.playlist_),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state||(this.state="READY")}}},{key:"init_",value:function(){return this.state="READY",this.sourceUpdater_=new Xd(this.mediaSource_,this.mimeType_,this.loaderType_,this.sourceBufferEmitter_),this.resetEverything(),this.monitorBuffer_()}},{key:"playlist",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e){var n=this.playlist_,r=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,this.hasPlayed_()||(e.syncInfo={mediaSequence:e.mediaSequence,time:0});var i=null;if(n&&(n.id?i=n.id:n.uri&&(i=n.uri)),this.logger_("playlist update ["+i+" => "+(e.id||e.uri)+"]"),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!n||n.uri!==e.uri)return void(null!==this.mediaIndex&&this.resyncLoader());var a=e.mediaSequence-n.mediaSequence;this.logger_("live window shift ["+a+"]"),null!==this.mediaIndex&&(this.mediaIndex-=a),r&&(r.mediaIndex-=a,r.mediaIndex>=0&&(r.segment=e.segments[r.mediaIndex])),this.syncController_.saveExpiredSegmentInfo(n,e)}}},{key:"pause",value:function(){this.checkBufferTimeout_&&(e.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}},{key:"paused",value:function(){return null===this.checkBufferTimeout_}},{key:"mimeType",value:function(e,t){this.mimeType_||(this.mimeType_=e,this.sourceBufferEmitter_=t,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_())}},{key:"resetEverything",value:function(e){this.ended_=!1,this.resetLoader(),this.remove(0,this.duration_(),e),this.captionParser_&&this.captionParser_.clearAllCaptions(),this.trigger("reseteverything")}},{key:"resetLoader",value:function(){this.fetchAtBuffer_=!1,this.resyncLoader()}},{key:"resyncLoader",value:function(){this.mediaIndex=null,this.syncPoint_=null,this.abort()}},{key:"remove",value:function(e,t,n){if(this.sourceUpdater_&&this.sourceUpdater_.remove(e,t,n),fd(e,t,this.segmentMetadataTrack_),this.inbandTextTracks_)for(var r in this.inbandTextTracks_)fd(e,t,this.inbandTextTracks_[r])}},{key:"monitorBuffer_",value:function(){this.checkBufferTimeout_&&e.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=e.setTimeout(this.monitorBufferTick_.bind(this),1)}},{key:"monitorBufferTick_",value:function(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&e.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=e.setTimeout(this.monitorBufferTick_.bind(this),500)}},{key:"fillBuffer_",value:function(){if(!this.sourceUpdater_.updating()){this.syncPoint_||(this.syncPoint_=this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_()));var e=this.checkBuffer_(this.buffered_(),this.playlist_,this.mediaIndex,this.hasPlayed_(),this.currentTime_(),this.syncPoint_);if(e)return this.isEndOfStream_(e.mediaIndex)?void this.endOfStream():void((e.mediaIndex!==this.playlist_.segments.length-1||"ended"!==this.mediaSource_.readyState||this.seeking_())&&(e.timeline!==this.currentTimeline_&&(this.syncController_.reset(),e.timestampOffset=e.startOfSegment,this.captionParser_&&this.captionParser_.clearAllCaptions()),this.loadSegment_(e)))}}},{key:"isEndOfStream_",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.playlist_;return lh(t,this.mediaSource_,e)&&!this.sourceUpdater_.updating()}},{key:"checkBuffer_",value:function(e,t,n,r,i,a){var s=0,o=void 0;e.length&&(s=e.end(e.length-1));var u=Math.max(0,s-i);if(!t.segments.length)return null;if(u>=this.goalBufferLength_())return null;if(!r&&u>=1)return null;if(null===a)return n=this.getSyncSegmentCandidate_(t),this.generateSegmentInfo_(t,n,null,!0);if(null!==n){var l=t.segments[n];return o=l&&l.end?l.end:s,this.generateSegmentInfo_(t,n+1,o,!1)}if(this.fetchAtBuffer_){var c=qc.getMediaInfoForTime(t,s,a.segmentIndex,a.time);n=c.mediaIndex,o=c.startTime}else{var d=qc.getMediaInfoForTime(t,i,a.segmentIndex,a.time);n=d.mediaIndex,o=d.startTime}return this.generateSegmentInfo_(t,n,o,!1)}},{key:"getSyncSegmentCandidate_",value:function(e){var t=this;if(-1===this.currentTimeline_)return 0;var n=e.segments.map((function(e,t){return{timeline:e.timeline,segmentIndex:t}})).filter((function(e){return e.timeline===t.currentTimeline_}));return n.length?n[Math.min(n.length-1,1)].segmentIndex:Math.max(e.segments.length-1,0)}},{key:"generateSegmentInfo_",value:function(e,t,n,r){if(t<0||t>=e.segments.length)return null;var i=e.segments[t];return{requestId:"segment-loader-"+Math.random(),uri:i.resolvedUri,mediaIndex:t,isSyncRequest:r,startOfSegment:n,playlist:e,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:i.timeline,duration:i.duration,segment:i}}},{key:"abortRequestEarly_",value:function(e){if(this.hls_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH)return!1;if(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return!1;var t=this.currentTime_(),n=e.bandwidth,r=this.pendingSegment_.duration,i=qc.estimateSegmentRequestTime(r,n,this.playlist_,e.bytesReceived),a=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return((e.length?e.end(e.length-1):0)-t)/n}(this.buffered_(),t,this.hls_.tech_.playbackRate())-1;if(i<=a)return!1;var s=function(e){var t=e.master,n=e.currentTime,r=e.bandwidth,i=e.duration,a=e.segmentDuration,s=e.timeUntilRebuffer,o=e.currentTimeline,u=e.syncController,l=t.playlists.filter((function(e){return!qc.isIncompatible(e)})),c=l.filter(qc.isEnabled);c.length||(c=l.filter((function(e){return!qc.isDisabled(e)})));var d=c.filter(qc.hasAttribute.bind(null,"BANDWIDTH")).map((function(e){var t=u.getSyncPoint(e,i,o,n)?1:2;return{playlist:e,rebufferingImpact:qc.estimateSegmentRequestTime(a,r,e)*t-s}})),h=d.filter((function(e){return e.rebufferingImpact<=0}));return oh(h,(function(e,t){return uh(t.playlist,e.playlist)})),h.length?h[0]:(oh(d,(function(e,t){return e.rebufferingImpact-t.rebufferingImpact})),d[0]||null)}({master:this.hls_.playlists.master,currentTime:t,bandwidth:n,duration:this.duration_(),segmentDuration:r,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(s){var o=i-a-s.rebufferingImpact,u=.5;return a<=1/30&&(u=1),!(!s.playlist||s.playlist.uri===this.playlist_.uri||o<u)&&(this.bandwidth=s.playlist.attributes.BANDWIDTH*Jd.BANDWIDTH_VARIANCE+1,this.abort(),this.trigger("earlyabort"),!0)}}},{key:"handleProgress_",value:function(e,t){this.pendingSegment_&&t.requestId===this.pendingSegment_.requestId&&!this.abortRequestEarly_(t.stats)&&this.trigger("progress")}},{key:"loadSegment_",value:function(e){this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),e.abortRequests=ah(this.hls_.xhr,this.xhrOptions_,this.decrypter_,this.captionParser_,this.createSimplifiedSegmentObj_(e),this.handleProgress_.bind(this),this.segmentRequestFinished_.bind(this))}},{key:"trimBackBuffer_",value:function(e){var t=function(e,t,n){var r;return r=e.length&&e.start(0)>0&&e.start(0)<t?e.start(0):t-30,Math.min(r,t-n)}(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}},{key:"createSimplifiedSegmentObj_",value:function(e){var t=e.segment,n={resolvedUri:t.resolvedUri,byterange:t.byterange,requestId:e.requestId};if(t.key){var r=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);n.key=this.segmentKey(t.key),n.key.iv=r}return t.map&&(n.map=this.initSegment(t.map)),n}},{key:"segmentRequestFinished_",value:function(e,t){if(this.mediaRequests+=1,t.stats&&(this.mediaBytesTransferred+=t.stats.bytesReceived,this.mediaTransferDuration+=t.stats.roundTripTime),this.pendingSegment_){if(t.requestId===this.pendingSegment_.requestId){if(e)return this.pendingSegment_=null,this.state="READY",e.code===eh?void(this.mediaRequestsAborted+=1):(this.pause(),e.code===Zd?(this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,void this.trigger("bandwidthupdate")):(this.mediaRequestsErrored+=1,this.error(e),void this.trigger("error")));this.bandwidth=t.stats.bandwidth,this.roundTrip=t.stats.roundTripTime,t.map&&(t.map=this.initSegment(t.map,!0)),t.key&&this.segmentKey(t.key,!0),this.processSegmentResponse_(t)}}else this.mediaRequestsAborted+=1}},{key:"processSegmentResponse_",value:function(e){var t=this.pendingSegment_;t.bytes=e.bytes,e.map&&(t.segment.map.bytes=e.map.bytes),t.endOfAllRequests=e.endOfAllRequests,e.fmp4Captions&&(function(e,t,n){for(var r in n)if(!e[r]){t.trigger({type:"usage",name:"hls-608"});var i=t.textTracks().getTrackById(r);e[r]=i||t.addRemoteTextTrack({kind:"captions",id:r,label:r},!1).track}}(this.inbandTextTracks_,this.hls_.tech_,e.captionStreams),function(e){var t=e.inbandTextTracks,n=e.captionArray,r=e.timestampOffset;if(n){var i=window.WebKitDataCue||window.VTTCue;n.forEach((function(e){var n=e.stream,a=e.startTime,s=e.endTime;t[n]&&(a+=r,s+=r,t[n].addCue(new i(a,s,e.text)))}))}}({inbandTextTracks:this.inbandTextTracks_,captionArray:e.fmp4Captions,timestampOffset:0}),this.captionParser_&&this.captionParser_.clearParsedCaptions()),this.handleSegment_()}},{key:"handleSegment_",value:function(){var e=this;if(this.pendingSegment_){var t=this.pendingSegment_,n=t.segment,r=this.syncController_.probeSegmentInfo(t);void 0===this.startingMedia_&&r&&(r.containsAudio||r.containsVideo)&&(this.startingMedia_={containsAudio:r.containsAudio,containsVideo:r.containsVideo});var i=function(e,t,n){return"main"===e&&t&&n?n.containsAudio||n.containsVideo?t.containsVideo&&!n.containsVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!t.containsVideo&&n.containsVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null:"Neither audio nor video found in segment.":null}(this.loaderType_,this.startingMedia_,r);if(i)return this.error({message:i,blacklistDuration:1/0}),void this.trigger("error");if(t.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");null!==t.timestampOffset&&t.timestampOffset!==this.sourceUpdater_.timestampOffset()&&(this.sourceUpdater_.timestampOffset(t.timestampOffset),this.trigger("timestampoffset"));var a=this.syncController_.mappingForTimeline(t.timeline);if(null!==a&&this.trigger({type:"segmenttimemapping",mapping:a}),this.state="APPENDING",n.map){var s=nd(n.map);if(!this.activeInitSegmentId_||this.activeInitSegmentId_!==s){var o=this.initSegment(n.map);this.sourceUpdater_.appendBuffer({bytes:o.bytes},(function(){e.activeInitSegmentId_=s}))}}t.byteLength=t.bytes.byteLength,"number"==typeof n.start&&"number"==typeof n.end?this.mediaSecondsLoaded+=n.end-n.start:this.mediaSecondsLoaded+=n.duration,this.logger_(function(e){var t=e.segment,n=t.start,r=t.end,i=e.playlist,a=i.mediaSequence,s=i.id,o=i.segments,u=void 0===o?[]:o,l=e.mediaIndex,c=e.timeline;return["appending ["+l+"] of ["+a+", "+(a+u.length)+"] from playlist ["+s+"]","["+n+" => "+r+"] in timeline ["+c+"]"].join(" ")}(t)),this.sourceUpdater_.appendBuffer({bytes:t.bytes,videoSegmentTimingInfoCallback:this.handleVideoSegmentTimingInfo_.bind(this,t.requestId)},this.handleUpdateEnd_.bind(this))}else this.state="READY"}},{key:"handleVideoSegmentTimingInfo_",value:function(e,t){if(this.pendingSegment_&&e===this.pendingSegment_.requestId){var n=this.pendingSegment_.segment;n.videoTimingInfo||(n.videoTimingInfo={}),n.videoTimingInfo.transmuxerPrependedSeconds=t.videoSegmentTimingInfo.prependedContentDuration||0,n.videoTimingInfo.transmuxedPresentationStart=t.videoSegmentTimingInfo.start.presentation,n.videoTimingInfo.transmuxedPresentationEnd=t.videoSegmentTimingInfo.end.presentation,n.videoTimingInfo.baseMediaDecodeTime=t.videoSegmentTimingInfo.baseMediaDecodeTime}}},{key:"handleUpdateEnd_",value:function(){if(!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());var e=this.pendingSegment_,t=e.segment,n=null!==this.mediaIndex;this.pendingSegment_=null,this.recordThroughput_(e),this.addSegmentMetadataCue_(e),this.state="READY",this.mediaIndex=e.mediaIndex,this.fetchAtBuffer_=!0,this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate"),t.end&&this.currentTime_()-t.end>3*e.playlist.targetDuration?this.resetEverything():(n&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.isEndOfStream_(e.mediaIndex+1,e.playlist)&&this.endOfStream(),this.paused()||this.monitorBuffer_())}},{key:"recordThroughput_",value:function(e){var t=this.throughput.rate,n=Date.now()-e.endOfAllRequests+1,r=Math.floor(e.byteLength/n*8*1e3);this.throughput.rate+=(r-t)/++this.throughput.count}},{key:"addSegmentMetadataCue_",value:function(t){if(this.segmentMetadataTrack_){var n=t.segment,r=n.start,i=n.end;if(ch(r)&&ch(i)){fd(r,i,this.segmentMetadataTrack_);var a=e.WebKitDataCue||e.VTTCue,s={custom:n.custom,dateTimeObject:n.dateTimeObject,dateTimeString:n.dateTimeString,bandwidth:t.playlist.attributes.BANDWIDTH,resolution:t.playlist.attributes.RESOLUTION,codecs:t.playlist.attributes.CODECS,byteLength:t.byteLength,uri:t.uri,timeline:t.timeline,playlist:t.playlist.uri,start:r,end:i},o=new a(r,i,JSON.stringify(s));o.value=s,this.segmentMetadataTrack_.addCue(o)}}}}]),n}(Me.EventTarget),hh=function(e){return decodeURIComponent(escape(String.fromCharCode.apply(null,e)))},fh=new Uint8Array("\n\n".split("").map((function(e){return e.charCodeAt(0)}))),ph=function(t){function n(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};yc(this,n);var r=Tc(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e,t));return r.mediaSource_=null,r.subtitlesTrack_=null,r}return bc(n,t),_c(n,[{key:"buffered_",value:function(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues.length)return Me.createTimeRanges();var e=this.subtitlesTrack_.cues,t=e[0].startTime,n=e[e.length-1].startTime;return Me.createTimeRanges([[t,n]])}},{key:"initSegment",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return null;var n=nd(e),r=this.initSegments_[n];if(t&&!r&&e.bytes){var i=fh.byteLength+e.bytes.byteLength,a=new Uint8Array(i);a.set(e.bytes),a.set(fh,e.bytes.byteLength),this.initSegments_[n]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:a}}return r||e}},{key:"couldBeginLoading_",value:function(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}},{key:"init_",value:function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}},{key:"track",value:function(e){return void 0===e||(this.subtitlesTrack_=e,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_}},{key:"remove",value:function(e,t){fd(e,t,this.subtitlesTrack_)}},{key:"fillBuffer_",value:function(){var e=this;this.syncPoint_||(this.syncPoint_=this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_()));var t=this.checkBuffer_(this.buffered_(),this.playlist_,this.mediaIndex,this.hasPlayed_(),this.currentTime_(),this.syncPoint_);if(t=this.skipEmptySegments_(t)){if(null===this.syncController_.timestampOffsetForTimeline(t.timeline)){return this.syncController_.one("timestampoffset",(function(){e.state="READY",e.paused()||e.monitorBuffer_()})),void(this.state="WAITING_ON_TIMELINE")}this.loadSegment_(t)}}},{key:"skipEmptySegments_",value:function(e){for(;e&&e.segment.empty;)e=this.generateSegmentInfo_(e.playlist,e.mediaIndex+1,e.startOfSegment+e.duration,e.isSyncRequest);return e}},{key:"handleSegment_",value:function(){var t=this;if(this.pendingSegment_&&this.subtitlesTrack_){this.state="APPENDING";var n=this.pendingSegment_,r=n.segment;if("function"!=typeof e.WebVTT&&this.subtitlesTrack_&&this.subtitlesTrack_.tech_){var i=void 0,a=function(){t.subtitlesTrack_.tech_.off("vttjsloaded",i),t.error({message:"Error loading vtt.js"}),t.state="READY",t.pause(),t.trigger("error")};return i=function(){t.subtitlesTrack_.tech_.off("vttjserror",a),t.handleSegment_()},this.state="WAITING_ON_VTTJS",this.subtitlesTrack_.tech_.one("vttjsloaded",i),void this.subtitlesTrack_.tech_.one("vttjserror",a)}r.requested=!0;try{this.parseVTTCues_(n)}catch(e){return this.error({message:e.message}),this.state="READY",this.pause(),this.trigger("error")}if(this.updateTimeMapping_(n,this.syncController_.timelines[n.timeline],this.playlist_),n.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");n.byteLength=n.bytes.byteLength,this.mediaSecondsLoaded+=r.duration,n.cues.length&&this.remove(n.cues[0].endTime,n.cues[n.cues.length-1].endTime),n.cues.forEach((function(e){t.subtitlesTrack_.addCue(e)})),this.handleUpdateEnd_()}else this.state="READY"}},{key:"parseVTTCues_",value:function(t){var n=void 0,r=!1;"function"==typeof e.TextDecoder?n=new e.TextDecoder("utf8"):(n=e.WebVTT.StringDecoder(),r=!0);var i=new e.WebVTT.Parser(e,e.vttjs,n);if(t.cues=[],t.timestampmap={MPEGTS:0,LOCAL:0},i.oncue=t.cues.push.bind(t.cues),i.ontimestampmap=function(e){return t.timestampmap=e},i.onparsingerror=function(e){Me.log.warn("Error encountered when parsing cues: "+e.message)},t.segment.map){var a=t.segment.map.bytes;r&&(a=hh(a)),i.parse(a)}var s=t.bytes;r&&(s=hh(s)),i.parse(s),i.flush()}},{key:"updateTimeMapping_",value:function(e,t,n){var r=e.segment;if(t){if(!e.cues.length)return void(r.empty=!0);var i=e.timestampmap,a=i.MPEGTS/9e4-i.LOCAL+t.mapping;if(e.cues.forEach((function(e){e.startTime+=a,e.endTime+=a})),!n.syncInfo){var s=e.cues[0].startTime,o=e.cues[e.cues.length-1].startTime;n.syncInfo={mediaSequence:n.mediaSequence+e.mediaIndex,time:Math.min(s,o-r.duration)}}}}}]),n}(dh),vh=function(e,t){for(var n=e.cues,r=0;r<n.length;r++){var i=n[r];if(t>=i.adStartTime&&t<=i.adEndTime)return i}return null},mh=function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(t.segments)for(var i=r,a=void 0,s=0;s<t.segments.length;s++){var o=t.segments[s];if(a||(a=vh(n,i+o.duration/2)),a){if("cueIn"in o){a.endTime=i,a.adEndTime=i,i+=o.duration,a=null;continue}if(i<a.endTime){i+=o.duration;continue}a.endTime+=o.duration}else if("cueOut"in o&&((a=new e.VTTCue(i,i+o.duration,o.cueOut)).adStartTime=i,a.adEndTime=i+parseFloat(o.cueOut),n.addCue(a)),"cueOutCont"in o){var u=void 0,l=void 0,c=o.cueOutCont.split("/").map(parseFloat),d=Sc(c,2);u=d[0],l=d[1],(a=new e.VTTCue(i,i+o.duration,"")).adStartTime=i-u,a.adEndTime=a.adStartTime+l,n.addCue(a)}i+=o.duration}},gh=sc,yh=[{name:"VOD",run:function(e,t,n,r,i){return n!==1/0?{time:0,segmentIndex:0}:null}},{name:"ProgramDateTime",run:function(e,t,n,r,i){if(!e.datetimeToDisplayTime)return null;var a=t.segments||[],s=null,o=null;i=i||0;for(var u=0;u<a.length;u++){var l=a[u];if(l.dateTimeObject){var c=l.dateTimeObject.getTime()/1e3+e.datetimeToDisplayTime,d=Math.abs(i-c);if(null!==o&&(0===d||o<d))break;o=d,s={time:c,segmentIndex:u}}}return s}},{name:"Segment",run:function(e,t,n,r,i){var a=t.segments||[],s=null,o=null;i=i||0;for(var u=0;u<a.length;u++){var l=a[u];if(l.timeline===r&&void 0!==l.start){var c=Math.abs(i-l.start);if(null!==o&&o<c)break;(!s||null===o||o>=c)&&(o=c,s={time:l.start,segmentIndex:u})}}return s}},{name:"Discontinuity",run:function(e,t,n,r,i){var a=null;if(i=i||0,t.discontinuityStarts&&t.discontinuityStarts.length)for(var s=null,o=0;o<t.discontinuityStarts.length;o++){var u=t.discontinuityStarts[o],l=t.discontinuitySequence+o+1,c=e.discontinuities[l];if(c){var d=Math.abs(i-c.time);if(null!==s&&s<d)break;(!a||null===s||s>=d)&&(s=d,a={time:c.time,segmentIndex:u})}}return a}},{name:"Playlist",run:function(e,t,n,r,i){return t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence}:null}}],_h=function(e){function t(){yc(this,t);var e=Tc(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.inspectCache_=void 0,e.timelines=[],e.discontinuities=[],e.datetimeToDisplayTime=null,e.logger_=Yd("SyncController"),e}return bc(t,e),_c(t,[{key:"getSyncPoint",value:function(e,t,n,r){var i=this.runStrategies_(e,t,n,r);return i.length?this.selectSyncPoint_(i,{key:"time",value:r}):null}},{key:"getExpiredTime",value:function(e,t){if(!e||!e.segments)return null;var n=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!n.length)return null;var r=this.selectSyncPoint_(n,{key:"segmentIndex",value:0});return r.segmentIndex>0&&(r.time*=-1),Math.abs(r.time+Mc(e,r.segmentIndex,0))}},{key:"runStrategies_",value:function(e,t,n,r){for(var i=[],a=0;a<yh.length;a++){var s=yh[a],o=s.run(this,e,t,n,r);o&&(o.strategy=s.name,i.push({strategy:s.name,syncPoint:o}))}return i}},{key:"selectSyncPoint_",value:function(e,t){for(var n=e[0].syncPoint,r=Math.abs(e[0].syncPoint[t.key]-t.value),i=e[0].strategy,a=1;a<e.length;a++){var s=Math.abs(e[a].syncPoint[t.key]-t.value);s<r&&(r=s,n=e[a].syncPoint,i=e[a].strategy)}return this.logger_("syncPoint for ["+t.key+": "+t.value+"] chosen with strategy ["+i+"]: [time:"+n.time+", segmentIndex:"+n.segmentIndex+"]"),n}},{key:"saveExpiredSegmentInfo",value:function(e,t){for(var n=t.mediaSequence-e.mediaSequence-1;n>=0;n--){var r=e.segments[n];if(r&&void 0!==r.start){t.syncInfo={mediaSequence:e.mediaSequence+n,time:r.start},this.logger_("playlist refresh sync: [time:"+t.syncInfo.time+", mediaSequence: "+t.syncInfo.mediaSequence+"]"),this.trigger("syncinfoupdate");break}}}},{key:"setDateTimeMapping",value:function(e){if(!this.datetimeToDisplayTime&&e.segments&&e.segments.length&&e.segments[0].dateTimeObject){var t=e.segments[0].dateTimeObject.getTime()/1e3;this.datetimeToDisplayTime=-t}}},{key:"reset",value:function(){this.inspectCache_=void 0}},{key:"probeSegmentInfo",value:function(e){var t,n=e.segment,r=e.playlist;return(t=n.map?this.probeMp4Segment_(e):this.probeTsSegment_(e))&&this.calculateSegmentTimeMapping_(e,t)&&(this.saveDiscontinuitySyncInfo_(e),r.syncInfo||(r.syncInfo={mediaSequence:r.mediaSequence+e.mediaIndex,time:n.start})),t}},{key:"probeMp4Segment_",value:function(e){var t=e.segment,n=ou.timescale(t.map.bytes),r=ou.startTime(n,e.bytes);return null!==e.timestampOffset&&(e.timestampOffset-=r),{start:r,end:r+t.duration}}},{key:"probeTsSegment_",value:function(e){var t=gh(e.bytes,this.inspectCache_),n=void 0,r=void 0;return t?(t.video&&2===t.video.length?(this.inspectCache_=t.video[1].dts,n=t.video[0].dtsTime,r=t.video[1].dtsTime):t.audio&&2===t.audio.length&&(this.inspectCache_=t.audio[1].dts,n=t.audio[0].dtsTime,r=t.audio[1].dtsTime),{start:n,end:r,containsVideo:t.video&&2===t.video.length,containsAudio:t.audio&&2===t.audio.length}):null}},{key:"timestampOffsetForTimeline",value:function(e){return void 0===this.timelines[e]?null:this.timelines[e].time}},{key:"mappingForTimeline",value:function(e){return void 0===this.timelines[e]?null:this.timelines[e].mapping}},{key:"calculateSegmentTimeMapping_",value:function(e,t){var n=e.segment,r=this.timelines[e.timeline];if(null!==e.timestampOffset)r={time:e.startOfSegment,mapping:e.startOfSegment-t.start},this.timelines[e.timeline]=r,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+e.timeline+": [time: "+r.time+"] [mapping: "+r.mapping+"]"),n.start=e.startOfSegment,n.end=t.end+r.mapping;else{if(!r)return!1;n.start=t.start+r.mapping,n.end=t.end+r.mapping}return!0}},{key:"saveDiscontinuitySyncInfo_",value:function(e){var t=e.playlist,n=e.segment;if(n.discontinuity)this.discontinuities[n.timeline]={time:n.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(var r=0;r<t.discontinuityStarts.length;r++){var i=t.discontinuityStarts[r],a=t.discontinuitySequence+r+1,s=i-e.mediaIndex,o=Math.abs(s);if(!this.discontinuities[a]||this.discontinuities[a].accuracy>o){var u;u=s<0?n.start-Mc(t,e.mediaIndex,i):n.end+Mc(t,e.mediaIndex+1,i),this.discontinuities[a]={time:u,accuracy:o}}}}}]),t}(Me.EventTarget),bh=new Ne("./decrypter-worker.worker.js",(function(e,t){var n=this;!function(){var e=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},t=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),r=null,i=function(){function t(n){e(this,t),r||(r=function(){var e=[[[],[],[],[],[]],[[],[],[],[],[]]],t=e[0],n=e[1],r=t[4],i=n[4],a=void 0,s=void 0,o=void 0,u=[],l=[],c=void 0,d=void 0,h=void 0,f=void 0,p=void 0;for(a=0;a<256;a++)l[(u[a]=a<<1^283*(a>>7))^a]=a;for(s=o=0;!r[s];s^=c||1,o=l[o]||1)for(h=(h=o^o<<1^o<<2^o<<3^o<<4)>>8^255&h^99,r[s]=h,i[h]=s,p=16843009*u[d=u[c=u[s]]]^65537*d^257*c^16843008*s,f=257*u[h]^16843008*h,a=0;a<4;a++)t[a][s]=f=f<<24^f>>>8,n[a][h]=p=p<<24^p>>>8;for(a=0;a<5;a++)t[a]=t[a].slice(0),n[a]=n[a].slice(0);return e}()),this._tables=[[r[0][0].slice(),r[0][1].slice(),r[0][2].slice(),r[0][3].slice(),r[0][4].slice()],[r[1][0].slice(),r[1][1].slice(),r[1][2].slice(),r[1][3].slice(),r[1][4].slice()]];var i=void 0,a=void 0,s=void 0,o=void 0,u=void 0,l=this._tables[0][4],c=this._tables[1],d=n.length,h=1;if(4!==d&&6!==d&&8!==d)throw new Error("Invalid aes key size");for(o=n.slice(0),u=[],this._key=[o,u],i=d;i<4*d+28;i++)s=o[i-1],(i%d==0||8===d&&i%d==4)&&(s=l[s>>>24]<<24^l[s>>16&255]<<16^l[s>>8&255]<<8^l[255&s],i%d==0&&(s=s<<8^s>>>24^h<<24,h=h<<1^283*(h>>7))),o[i]=o[i-d]^s;for(a=0;i;a++,i--)s=o[3&a?i:i-4],u[a]=i<=4||a<4?s:c[0][l[s>>>24]]^c[1][l[s>>16&255]]^c[2][l[s>>8&255]]^c[3][l[255&s]]}return t.prototype.decrypt=function(e,t,n,r,i,a){var s=this._key[1],o=e^s[0],u=r^s[1],l=n^s[2],c=t^s[3],d=void 0,h=void 0,f=void 0,p=s.length/4-2,v=void 0,m=4,g=this._tables[1],y=g[0],_=g[1],b=g[2],T=g[3],S=g[4];for(v=0;v<p;v++)d=y[o>>>24]^_[u>>16&255]^b[l>>8&255]^T[255&c]^s[m],h=y[u>>>24]^_[l>>16&255]^b[c>>8&255]^T[255&o]^s[m+1],f=y[l>>>24]^_[c>>16&255]^b[o>>8&255]^T[255&u]^s[m+2],c=y[c>>>24]^_[o>>16&255]^b[u>>8&255]^T[255&l]^s[m+3],m+=4,o=d,u=h,l=f;for(v=0;v<4;v++)i[(3&-v)+a]=S[o>>>24]<<24^S[u>>16&255]<<16^S[l>>8&255]<<8^S[255&c]^s[m++],d=o,o=u,u=l,l=c,c=d},t}(),a=function(){function t(){e(this,t),this.listeners={}}return t.prototype.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.prototype.off=function(e,t){if(!this.listeners[e])return!1;var n=this.listeners[e].indexOf(t);return this.listeners[e].splice(n,1),n>-1},t.prototype.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var n=t.length,r=0;r<n;++r)t[r].call(this,arguments[1]);else for(var i=Array.prototype.slice.call(arguments,1),a=t.length,s=0;s<a;++s)t[s].apply(this,i)},t.prototype.dispose=function(){this.listeners={}},t.prototype.pipe=function(e){this.on("data",(function(t){e.push(t)}))},t}(),s=function(t){function n(){e(this,n);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,t.call(this,a));return r.jobs=[],r.delay=1,r.timeout_=null,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,t),n.prototype.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},n.prototype.push=function(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},n}(a),o=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},u=function(){function n(t,r,i,a){e(this,n);var u=n.STEP,l=new Int32Array(t.buffer),c=new Uint8Array(t.byteLength),d=0;for(this.asyncStream_=new s,this.asyncStream_.push(this.decryptChunk_(l.subarray(d,d+u),r,i,c)),d=u;d<l.length;d+=u)i=new Uint32Array([o(l[d-4]),o(l[d-3]),o(l[d-2]),o(l[d-1])]),this.asyncStream_.push(this.decryptChunk_(l.subarray(d,d+u),r,i,c));this.asyncStream_.push((function(){a(null,function(e){return e.subarray(0,e.byteLength-e[e.byteLength-1])}(c))}))}return n.prototype.decryptChunk_=function(e,t,n,r){return function(){var a=function(e,t,n){var r=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),a=new i(Array.prototype.slice.call(t)),s=new Uint8Array(e.byteLength),u=new Int32Array(s.buffer),l=void 0,c=void 0,d=void 0,h=void 0,f=void 0,p=void 0,v=void 0,m=void 0,g=void 0;for(l=n[0],c=n[1],d=n[2],h=n[3],g=0;g<r.length;g+=4)f=o(r[g]),p=o(r[g+1]),v=o(r[g+2]),m=o(r[g+3]),a.decrypt(f,p,v,m,u,g),u[g]=o(u[g]^l),u[g+1]=o(u[g+1]^c),u[g+2]=o(u[g+2]^d),u[g+3]=o(u[g+3]^h),l=f,c=p,d=v,h=m;return s}(e,t,n);r.set(a,e.byteOffset)}},t(n,null,[{key:"STEP",get:function(){return 32e3}}]),n}();new function(e){e.onmessage=function(t){var n=t.data,r=new Uint8Array(n.encrypted.bytes,n.encrypted.byteOffset,n.encrypted.byteLength),i=new Uint32Array(n.key.bytes,n.key.byteOffset,n.key.byteLength/4),a=new Uint32Array(n.iv.bytes,n.iv.byteOffset,n.iv.byteLength/4);new u(r,i,a,(function(t,r){e.postMessage(function(e){var t={};return Object.keys(e).forEach((function(n){var r=e[n];ArrayBuffer.isView(r)?t[n]={bytes:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength}:t[n]=r})),t}({source:n.source,decrypted:r}),[r.buffer])}))}}(n)}()})),Th=function(e){var t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},Sh=function(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},Eh=function(e,t){t.activePlaylistLoader=e,e.load()},kh={AUDIO:function(e,t){return function(){var n=t.segmentLoaders[e],r=t.mediaTypes[e],i=t.blacklistCurrentPlaylist;Sh(n,r);var a=r.activeTrack(),s=r.activeGroup(),o=(s.filter((function(e){return e.default}))[0]||s[0]).id,u=r.tracks[o];if(a!==u){for(var l in Me.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),r.tracks)r.tracks[l].enabled=r.tracks[l]===u;r.onTrackChanged()}else i({message:"Problem encountered loading the default audio track."})}},SUBTITLES:function(e,t){return function(){var n=t.segmentLoaders[e],r=t.mediaTypes[e];Me.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),Sh(n,r);var i=r.activeTrack();i&&(i.mode="disabled"),r.onTrackChanged()}}},wh={AUDIO:function(e,t,n){if(t){var r=n.tech,i=n.requestOptions,a=n.segmentLoaders[e];t.on("loadedmetadata",(function(){var e=t.media();a.playlist(e,i),(!r.paused()||e.endList&&"none"!==r.preload())&&a.load()})),t.on("loadedplaylist",(function(){a.playlist(t.media(),i),r.paused()||a.load()})),t.on("error",kh[e](e,n))}},SUBTITLES:function(e,t,n){var r=n.tech,i=n.requestOptions,a=n.segmentLoaders[e],s=n.mediaTypes[e];t.on("loadedmetadata",(function(){var e=t.media();a.playlist(e,i),a.track(s.activeTrack()),(!r.paused()||e.endList&&"none"!==r.preload())&&a.load()})),t.on("loadedplaylist",(function(){a.playlist(t.media(),i),r.paused()||a.load()})),t.on("error",kh[e](e,n))}},Ch={AUDIO:function(e,t){var n=t.hls,r=t.sourceType,i=t.segmentLoaders[e],a=t.requestOptions,s=t.master.mediaGroups,o=t.mediaTypes[e],u=o.groups,l=o.tracks,c=t.masterPlaylistLoader;for(var d in s[e]&&0!==Object.keys(s[e]).length||(s[e]={main:{default:{default:!0}}}),s[e])for(var h in u[d]||(u[d]=[]),s[e][d]){var f,p=s[e][d][h];if(f=p.resolvedUri?new Ic(p.resolvedUri,n,a):p.playlists&&"dash"===r?new $d(p.playlists[0],n,a,c):null,p=Me.mergeOptions({id:h,playlistLoader:f},p),wh[e](e,p.playlistLoader,t),u[d].push(p),void 0===l[h]){var v=new Me.AudioTrack({id:h,kind:Th(p),enabled:!1,language:p.language,default:p.default,label:h});l[h]=v}}i.on("error",kh[e](e,t))},SUBTITLES:function(e,t){var n=t.tech,r=t.hls,i=t.sourceType,a=t.segmentLoaders[e],s=t.requestOptions,o=t.master.mediaGroups,u=t.mediaTypes[e],l=u.groups,c=u.tracks,d=t.masterPlaylistLoader;for(var h in o[e])for(var f in l[h]||(l[h]=[]),o[e][h])if(!o[e][h][f].forced){var p=o[e][h][f],v=void 0;if("hls"===i?v=new Ic(p.resolvedUri,r,s):"dash"===i&&(v=new $d(p.playlists[0],r,s,d)),p=Me.mergeOptions({id:f,playlistLoader:v},p),wh[e](e,p.playlistLoader,t),l[h].push(p),void 0===c[f]){var m=n.addRemoteTextTrack({id:f,kind:"subtitles",default:p.default&&p.autoselect,language:p.language,label:f},!1).track;c[f]=m}}a.on("error",kh[e](e,t))},"CLOSED-CAPTIONS":function(e,t){var n=t.tech,r=t.master.mediaGroups,i=t.mediaTypes[e],a=i.groups,s=i.tracks;for(var o in r[e])for(var u in a[o]||(a[o]=[]),r[e][o]){var l=r[e][o][u];if(l.instreamId.match(/CC\d/)&&(a[o].push(Me.mergeOptions({id:u},l)),void 0===s[u])){var c=n.addRemoteTextTrack({id:l.instreamId,kind:"captions",default:l.default&&l.autoselect,language:l.language,label:u},!1).track;s[u]=c}}}},Ah={AUDIO:function(e,t){return function(){var n=t.mediaTypes[e].tracks;for(var r in n)if(n[r].enabled)return n[r];return null}},SUBTITLES:function(e,t){return function(){var n=t.mediaTypes[e].tracks;for(var r in n)if("showing"===n[r].mode)return n[r];return null}}},Lh=function(e){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((function(t){Ch[t](t,e)}));var t=e.mediaTypes,n=e.masterPlaylistLoader,r=e.tech,i=e.hls;["AUDIO","SUBTITLES"].forEach((function(n){t[n].activeGroup=function(e,t){return function(n){var r=t.masterPlaylistLoader,i=t.mediaTypes[e].groups,a=r.media();if(!a)return null;var s=null;return a.attributes[e]&&(s=i[a.attributes[e]]),s=s||i.main,void 0===n?s:null===n?null:s.filter((function(e){return e.id===n.id}))[0]||null}}(n,e),t[n].activeTrack=Ah[n](n,e),t[n].onGroupChanged=function(e,t){return function(){var n=t.segmentLoaders,r=n[e],i=n.main,a=t.mediaTypes[e],s=a.activeTrack(),o=a.activeGroup(s),u=a.activePlaylistLoader;if(Sh(r,a),o){if(!o.playlistLoader)return void(u&&i.resetEverything());r.resyncLoader(),Eh(o.playlistLoader,a)}}}(n,e),t[n].onTrackChanged=function(e,t){return function(){var n=t.segmentLoaders,r=n[e],i=n.main,a=t.mediaTypes[e],s=a.activeTrack(),o=a.activeGroup(s),u=a.activePlaylistLoader;if(Sh(r,a),o){if(!o.playlistLoader)return void i.resetEverything();if(u===o.playlistLoader)return void Eh(o.playlistLoader,a);r.track&&r.track(s),r.resetEverything(),Eh(o.playlistLoader,a)}}}(n,e)}));var a=t.AUDIO.activeGroup(),s=(a.filter((function(e){return e.default}))[0]||a[0]).id;t.AUDIO.tracks[s].enabled=!0,t.AUDIO.onTrackChanged(),n.on("mediachange",(function(){["AUDIO","SUBTITLES"].forEach((function(e){return t[e].onGroupChanged()}))}));var o=function(){t.AUDIO.onTrackChanged(),r.trigger({type:"usage",name:"hls-audio-change"})};for(var u in r.audioTracks().addEventListener("change",o),r.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),i.on("dispose",(function(){r.audioTracks().removeEventListener("change",o),r.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)})),r.clearTracks("audio"),t.AUDIO.tracks)r.audioTracks().addTrack(t.AUDIO.tracks[u])},Rh=void 0,xh=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred"],Ih=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]},Oh=function(t){function n(e){yc(this,n);var t=Tc(this,(n.__proto__||Object.getPrototypeOf(n)).call(this)),r=e.url,i=e.handleManifestRedirects,a=e.withCredentials,s=e.tech,o=e.bandwidth,u=e.externHls,l=e.useCueTags,c=e.blacklistDuration,d=e.enableLowInitialPlaylist,h=e.sourceType,f=e.seekTo,p=e.cacheEncryptionKeys;if(!r)throw new Error("A non-empty playlist URL is required");Rh=u,t.withCredentials=a,t.tech_=s,t.hls_=s.hls,t.seekTo_=f,t.sourceType_=h,t.useCueTags_=l,t.blacklistDuration=c,t.enableLowInitialPlaylist=d,t.useCueTags_&&(t.cueTagsTrack_=t.tech_.addTextTrack("metadata","ad-cues"),t.cueTagsTrack_.inBandMetadataTrackDispatchType=""),t.requestOptions_={withCredentials:a,handleManifestRedirects:i,timeout:null},t.mediaTypes_=function(){var e={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((function(t){e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Ve,activeTrack:Ve,onGroupChanged:Ve,onTrackChanged:Ve}})),e}(),t.mediaSource=new Me.MediaSource,t.mediaSource.addEventListener("sourceopen",t.handleSourceOpen_.bind(t)),t.seekable_=Me.createTimeRanges(),t.hasPlayed_=function(){return!1},t.syncController_=new _h(e),t.segmentMetadataTrack_=s.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,t.decrypter_=new bh,t.inbandTextTracks_={};var v={hls:t.hls_,mediaSource:t.mediaSource,currentTime:t.tech_.currentTime.bind(t.tech_),seekable:function(){return t.seekable()},seeking:function(){return t.tech_.seeking()},duration:function(){return t.mediaSource.duration},hasPlayed:function(){return t.hasPlayed_()},goalBufferLength:function(){return t.goalBufferLength()},bandwidth:o,syncController:t.syncController_,decrypter:t.decrypter_,sourceType:t.sourceType_,inbandTextTracks:t.inbandTextTracks_,cacheEncryptionKeys:p};return t.masterPlaylistLoader_="dash"===t.sourceType_?new $d(r,t.hls_,t.requestOptions_):new Ic(r,t.hls_,t.requestOptions_),t.setupMasterPlaylistLoaderListeners_(),t.mainSegmentLoader_=new dh(Me.mergeOptions(v,{segmentMetadataTrack:t.segmentMetadataTrack_,loaderType:"main"}),e),t.audioSegmentLoader_=new dh(Me.mergeOptions(v,{loaderType:"audio"}),e),t.subtitleSegmentLoader_=new ph(Me.mergeOptions(v,{loaderType:"vtt"}),e),t.setupSegmentLoaderListeners_(),xh.forEach((function(e){t[e+"_"]=Ih.bind(t,e)})),t.logger_=Yd("MPC"),t.masterPlaylistLoader_.load(),t}return bc(n,t),_c(n,[{key:"setupMasterPlaylistLoaderListeners_",value:function(){var e=this;this.masterPlaylistLoader_.on("loadedmetadata",(function(){var t=e.masterPlaylistLoader_.media(),n=1.5*t.targetDuration*1e3;Kc(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=n,t.endList&&"none"!==e.tech_.preload()&&(e.mainSegmentLoader_.playlist(t,e.requestOptions_),e.mainSegmentLoader_.load()),Lh({sourceType:e.sourceType_,segmentLoaders:{AUDIO:e.audioSegmentLoader_,SUBTITLES:e.subtitleSegmentLoader_,main:e.mainSegmentLoader_},tech:e.tech_,requestOptions:e.requestOptions_,masterPlaylistLoader:e.masterPlaylistLoader_,hls:e.hls_,master:e.master(),mediaTypes:e.mediaTypes_,blacklistCurrentPlaylist:e.blacklistCurrentPlaylist.bind(e)}),e.triggerPresenceUsage_(e.master(),t);try{e.setupSourceBuffers_()}catch(t){return Me.log.warn("Failed to create SourceBuffers",t),e.mediaSource.endOfStream("decode")}e.setupFirstPlay(),!e.mediaTypes_.AUDIO.activePlaylistLoader||e.mediaTypes_.AUDIO.activePlaylistLoader.media()?e.trigger("selectedinitialmedia"):e.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",(function(){e.trigger("selectedinitialmedia")}))})),this.masterPlaylistLoader_.on("loadedplaylist",(function(){var t=e.masterPlaylistLoader_.media();if(!t){e.excludeUnsupportedVariants_();var n=void 0;return e.enableLowInitialPlaylist&&(n=e.selectInitialPlaylist()),n||(n=e.selectPlaylist()),e.initialMedia_=n,void e.masterPlaylistLoader_.media(e.initialMedia_)}if(e.useCueTags_&&e.updateAdCues_(t),e.mainSegmentLoader_.playlist(t,e.requestOptions_),e.updateDuration(),e.tech_.paused()||(e.mainSegmentLoader_.load(),e.audioSegmentLoader_&&e.audioSegmentLoader_.load()),!t.endList){var r=function(){var t=e.seekable();0!==t.length&&e.mediaSource.addSeekableRange_(t.start(0),t.end(0))};if(e.duration()!==1/0){e.tech_.one("durationchange",(function t(){e.duration()===1/0?r():e.tech_.one("durationchange",t)}))}else r()}})),this.masterPlaylistLoader_.on("error",(function(){e.blacklistCurrentPlaylist(e.masterPlaylistLoader_.error)})),this.masterPlaylistLoader_.on("mediachanging",(function(){e.mainSegmentLoader_.abort(),e.mainSegmentLoader_.pause()})),this.masterPlaylistLoader_.on("mediachange",(function(){var t=e.masterPlaylistLoader_.media(),n=1.5*t.targetDuration*1e3;Kc(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=n,e.mainSegmentLoader_.playlist(t,e.requestOptions_),e.mainSegmentLoader_.load(),e.tech_.trigger({type:"mediachange",bubbles:!0})})),this.masterPlaylistLoader_.on("playlistunchanged",(function(){var t=e.masterPlaylistLoader_.media();e.stuckAtPlaylistEnd_(t)&&(e.blacklistCurrentPlaylist({message:"Playlist no longer updating."}),e.tech_.trigger("playliststuck"))})),this.masterPlaylistLoader_.on("renditiondisabled",(function(){e.tech_.trigger({type:"usage",name:"hls-rendition-disabled"})})),this.masterPlaylistLoader_.on("renditionenabled",(function(){e.tech_.trigger({type:"usage",name:"hls-rendition-enabled"})}))}},{key:"triggerPresenceUsage_",value:function(e,t){var n=e.mediaGroups||{},r=!0,i=Object.keys(n.AUDIO);for(var a in n.AUDIO)for(var s in n.AUDIO[a]){n.AUDIO[a][s].uri||(r=!1)}r&&this.tech_.trigger({type:"usage",name:"hls-demuxed"}),Object.keys(n.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"hls-webvtt"}),Rh.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"hls-aes"}),Rh.Playlist.isFmp4(t)&&this.tech_.trigger({type:"usage",name:"hls-fmp4"}),i.length&&Object.keys(n.AUDIO[i[0]]).length>1&&this.tech_.trigger({type:"usage",name:"hls-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"})}},{key:"setupSegmentLoaderListeners_",value:function(){var e=this;this.mainSegmentLoader_.on("bandwidthupdate",(function(){var t=e.selectPlaylist(),n=e.masterPlaylistLoader_.media(),r=e.tech_.buffered(),i=r.length?r.end(r.length-1)-e.tech_.currentTime():0,a=e.bufferLowWaterLine();(!n.endList||e.duration()<Jd.MAX_BUFFER_LOW_WATER_LINE||t.attributes.BANDWIDTH<n.attributes.BANDWIDTH||i>=a)&&e.masterPlaylistLoader_.media(t),e.tech_.trigger("bandwidthupdate")})),this.mainSegmentLoader_.on("progress",(function(){e.trigger("progress")})),this.mainSegmentLoader_.on("error",(function(){e.blacklistCurrentPlaylist(e.mainSegmentLoader_.error())})),this.mainSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.mainSegmentLoader_.on("timestampoffset",(function(){e.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})})),this.audioSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.mainSegmentLoader_.on("ended",(function(){e.onEndOfStream()})),this.mainSegmentLoader_.on("earlyabort",(function(){e.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},120)})),this.mainSegmentLoader_.on("reseteverything",(function(){e.tech_.trigger("hls-reset")})),this.mainSegmentLoader_.on("segmenttimemapping",(function(t){e.tech_.trigger({type:"hls-segment-time-mapping",mapping:t.mapping})})),this.audioSegmentLoader_.on("ended",(function(){e.onEndOfStream()}))}},{key:"mediaSecondsLoaded_",value:function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}},{key:"load",value:function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}},{key:"smoothQualityChange_",value:function(){var e=this.selectPlaylist();e!==this.masterPlaylistLoader_.media()&&(this.masterPlaylistLoader_.media(e),this.mainSegmentLoader_.resetLoader())}},{key:"fastQualityChange_",value:function(){var e=this,t=this.selectPlaylist();t!==this.masterPlaylistLoader_.media()&&(this.masterPlaylistLoader_.media(t),this.mainSegmentLoader_.resetEverything((function(){Me.browser.IE_VERSION||Me.browser.IS_EDGE?e.tech_.setCurrentTime(e.tech_.currentTime()+.04):e.tech_.setCurrentTime(e.tech_.currentTime())})))}},{key:"play",value:function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.seekTo_(0),this.hasPlayed_()&&this.load();var e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0)?this.seekTo_(e.end(e.length-1)):void 0}}},{key:"setupFirstPlay",value:function(){var e=this,t=this.masterPlaylistLoader_.media();if(!t||this.tech_.paused()||this.hasPlayed_())return!1;if(!t.endList){var n=this.seekable();if(!n.length)return!1;if(Me.browser.IE_VERSION&&0===this.tech_.readyState())return this.tech_.one("loadedmetadata",(function(){e.trigger("firstplay"),e.seekTo_(n.end(0)),e.hasPlayed_=function(){return!0}})),!1;this.trigger("firstplay"),this.seekTo_(n.end(0))}return this.hasPlayed_=function(){return!0},this.load(),!0}},{key:"handleSourceOpen_",value:function(){try{this.setupSourceBuffers_()}catch(e){return Me.log.warn("Failed to create Source Buffers",e),this.mediaSource.endOfStream("decode")}if(this.tech_.autoplay()){var e=this.tech_.play();void 0!==e&&"function"==typeof e.then&&e.then(null,(function(e){}))}this.trigger("sourceopen")}},{key:"onEndOfStream",value:function(){var e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader&&(e=!this.mainSegmentLoader_.startingMedia_||this.mainSegmentLoader_.startingMedia_.containsVideo?e&&this.audioSegmentLoader_.ended_:this.audioSegmentLoader_.ended_),e){this.logger_("calling mediaSource.endOfStream()");try{this.mediaSource.endOfStream()}catch(e){Me.log.warn("Failed to call media source endOfStream",e)}}}},{key:"stuckAtPlaylistEnd_",value:function(e){if(!this.seekable().length)return!1;var t=this.syncController_.getExpiredTime(e,this.mediaSource.duration);if(null===t)return!1;var n=Rh.Playlist.playlistEnd(e,t),r=this.tech_.currentTime(),i=this.tech_.buffered();if(!i.length)return n-r<=.1;var a=i.end(i.length-1);return a-r<=.1&&n-a<=.1}},{key:"blacklistCurrentPlaylist",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1],n=void 0,r=void 0;if(n=e.playlist||this.masterPlaylistLoader_.media(),t=t||e.blacklistDuration||this.blacklistDuration,!n){this.error=e;try{return this.mediaSource.endOfStream("network")}catch(e){return this.trigger("error")}}var i=1===this.masterPlaylistLoader_.master.playlists.filter(zc).length,a=this.masterPlaylistLoader_.master.playlists;return 1===a.length?(Me.log.warn("Problem encountered with the current HLS playlist. Trying again since it is the only playlist."),this.tech_.trigger("retryplaylist"),this.masterPlaylistLoader_.load(i)):(i&&(Me.log.warn("Removing all playlists from the blacklist because the last rendition is about to be blacklisted."),a.forEach((function(e){e.excludeUntil!==1/0&&delete e.excludeUntil})),this.tech_.trigger("retryplaylist")),n.excludeUntil=Date.now()+1e3*t,this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"}),r=this.selectPlaylist(),Me.log.warn("Problem encountered with the current HLS playlist."+(e.message?" "+e.message:"")+" Switching to another playlist."),this.masterPlaylistLoader_.media(r,i))}},{key:"pauseLoading",value:function(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()}},{key:"setCurrentTime",value:function(e){var t=ld(this.tech_.buffered(),e);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0}},{key:"duration",value:function(){return this.masterPlaylistLoader_?this.mediaSource?this.mediaSource.duration:Rh.Playlist.duration(this.masterPlaylistLoader_.media()):0}},{key:"seekable",value:function(){return this.seekable_}},{key:"onSyncInfoUpdate_",value:function(){var e=void 0,t=void 0;if(this.masterPlaylistLoader_){var n=this.masterPlaylistLoader_.media();if(n){var r=this.syncController_.getExpiredTime(n,this.mediaSource.duration);if(null!==r&&0!==(e=Rh.Playlist.seekable(n,r)).length){if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(n=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),null===(r=this.syncController_.getExpiredTime(n,this.mediaSource.duration)))return;if(0===(t=Rh.Playlist.seekable(n,r)).length)return}var i=void 0,a=void 0;this.seekable_&&this.seekable_.length&&(i=this.seekable_.end(0),a=this.seekable_.start(0)),t?t.start(0)>e.end(0)||e.start(0)>t.end(0)?this.seekable_=e:this.seekable_=Me.createTimeRanges([[t.start(0)>e.start(0)?t.start(0):e.start(0),t.end(0)<e.end(0)?t.end(0):e.end(0)]]):this.seekable_=e,this.seekable_&&this.seekable_.length&&this.seekable_.end(0)===i&&this.seekable_.start(0)===a||(this.logger_("seekable updated ["+dd(this.seekable_)+"]"),this.tech_.trigger("seekablechanged"))}}}}},{key:"updateDuration",value:function(){var e=this,t=this.mediaSource.duration,n=Rh.Playlist.duration(this.masterPlaylistLoader_.media()),r=this.tech_.buffered(),i=function t(){e.logger_("Setting duration from "+e.mediaSource.duration+" => "+n);try{e.mediaSource.duration=n}catch(e){Me.log.warn("Failed to set media source duration",e)}e.tech_.trigger("durationchange"),e.mediaSource.removeEventListener("sourceopen",t)};r.length>0&&(n=Math.max(n,r.end(r.length-1))),t!==n&&("open"!==this.mediaSource.readyState?this.mediaSource.addEventListener("sourceopen",i):i())}},{key:"dispose",value:function(){var e=this;this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),["AUDIO","SUBTITLES"].forEach((function(t){var n=e.mediaTypes_[t].groups;for(var r in n)n[r].forEach((function(e){e.playlistLoader&&e.playlistLoader.dispose()}))})),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose()}},{key:"master",value:function(){return this.masterPlaylistLoader_.master}},{key:"media",value:function(){return this.masterPlaylistLoader_.media()||this.initialMedia_}},{key:"setupSourceBuffers_",value:function(){var e=this.masterPlaylistLoader_.media(),t=void 0;if(e&&"open"===this.mediaSource.readyState){if((t=xd(this.masterPlaylistLoader_.master,e)).length<1)return this.error="No compatible SourceBuffer configuration for the variant stream:"+e.resolvedUri,this.mediaSource.endOfStream("decode");this.configureLoaderMimeTypes_(t),this.excludeIncompatibleVariants_(e)}}},{key:"configureLoaderMimeTypes_",value:function(e){var t=e.length>1&&-1===e[0].indexOf(",")&&e[0]!==e[1]?new Me.EventTarget:null;this.mainSegmentLoader_.mimeType(e[0],t),e[1]&&this.audioSegmentLoader_.mimeType(e[1],t)}},{key:"excludeUnsupportedVariants_",value:function(){this.master().playlists.forEach((function(t){t.attributes.CODECS&&e.MediaSource&&e.MediaSource.isTypeSupported&&!e.MediaSource.isTypeSupported('video/mp4; codecs="'+function(e){return e.replace(/avc1\.(\d+)\.(\d+)/i,(function(e){return Ad([e])[0]}))}(t.attributes.CODECS)+'"')&&(t.excludeUntil=1/0)}))}},{key:"excludeIncompatibleVariants_",value:function(e){var t=2,n=null,r=void 0;e.attributes.CODECS&&(r=Ld(e.attributes.CODECS),n=r.videoCodec,t=r.codecCount),this.master().playlists.forEach((function(e){var r={codecCount:2,videoCodec:null};e.attributes.CODECS&&(r=Ld(e.attributes.CODECS)),r.codecCount!==t&&(e.excludeUntil=1/0),r.videoCodec!==n&&(e.excludeUntil=1/0)}))}},{key:"updateAdCues_",value:function(e){var t=0,n=this.seekable();n.length&&(t=n.start(0)),mh(e,this.cueTagsTrack_,t)}},{key:"goalBufferLength",value:function(){var e=this.tech_.currentTime(),t=Jd.GOAL_BUFFER_LENGTH,n=Jd.GOAL_BUFFER_LENGTH_RATE,r=Math.max(t,Jd.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*n,r)}},{key:"bufferLowWaterLine",value:function(){var e=this.tech_.currentTime(),t=Jd.BUFFER_LOW_WATER_LINE,n=Jd.BUFFER_LOW_WATER_LINE_RATE,r=Math.max(t,Jd.MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*n,r)}}]),n}(Me.EventTarget),Dh=function e(t,n,r){yc(this,e);var i=t.masterPlaylistController_,a=i[(t.options_.smoothQualityChange?"smooth":"fast")+"QualityChange_"].bind(i);if(n.attributes.RESOLUTION){var s=n.attributes.RESOLUTION;this.width=s.width,this.height=s.height}this.bandwidth=n.attributes.BANDWIDTH,this.id=r,this.enabled=function(e,t,n){return function(r){var i=e.master.playlists[t],a=Hc(i),s=zc(i);return void 0===r?s:(r?delete i.disabled:i.disabled=!0,r===s||a||(n(),r?e.trigger("renditionenabled"):e.trigger("renditiondisabled")),r)}}(t.playlists,n.uri,a)},Ph=["seeking","seeked","pause","playing","error"],Mh=function(){function t(n){var r=this;yc(this,t),this.tech_=n.tech,this.seekable=n.seekable,this.seekTo=n.seekTo,this.allowSeeksWithinUnsafeLiveWindow=n.allowSeeksWithinUnsafeLiveWindow,this.media=n.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,this.checkCurrentTimeTimeout_=null,this.logger_=Yd("PlaybackWatcher"),this.logger_("initialize");var i=function(){return r.monitorCurrentTime_()},a=function(){return r.techWaiting_()},s=function(){return r.cancelTimer_()},o=function(){return r.fixesBadSeeks_()};this.tech_.on("seekablechanged",o),this.tech_.on("waiting",a),this.tech_.on(Ph,s),this.tech_.on("canplay",i),this.dispose=function(){r.logger_("dispose"),r.tech_.off("seekablechanged",o),r.tech_.off("waiting",a),r.tech_.off(Ph,s),r.tech_.off("canplay",i),r.checkCurrentTimeTimeout_&&e.clearTimeout(r.checkCurrentTimeTimeout_),r.cancelTimer_()}}return _c(t,[{key:"monitorCurrentTime_",value:function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&e.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=e.setTimeout(this.monitorCurrentTime_.bind(this),250)}},{key:"checkCurrentTime_",value:function(){if(this.tech_.seeking()&&this.fixesBadSeeks_())return this.consecutiveUpdates=0,void(this.lastRecordedTime=this.tech_.currentTime());if(!this.tech_.paused()&&!this.tech_.seeking()){var e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+.1>=t.end(t.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}}},{key:"cancelTimer_",value:function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null}},{key:"fixesBadSeeks_",value:function(){if(!this.tech_.seeking())return!1;var e=this.seekable(),t=this.tech_.currentTime(),n=void 0;return this.afterSeekableWindow_(e,t,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(n=e.end(e.length-1)),this.beforeSeekableWindow_(e,t)&&(n=e.start(0)+.1),void 0!==n&&(this.logger_("Trying to seek outside of seekable at time "+t+" with seekable range "+dd(e)+". Seeking to "+n+"."),this.seekTo(n),!0)}},{key:"waiting_",value:function(){if(!this.techWaiting_()){var e=this.tech_.currentTime(),t=this.tech_.buffered(),n=ld(t,e);return n.length&&e+3<=n.end(0)?(this.cancelTimer_(),this.seekTo(e),this.logger_("Stopped at "+e+" while inside a buffered region ["+n.start(0)+" -> "+n.end(0)+"]. Attempting to resume playback by seeking to the current time."),void this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})):void 0}}},{key:"techWaiting_",value:function(){var e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking()&&this.fixesBadSeeks_())return!0;if(this.tech_.seeking()||null!==this.timer_)return!0;if(this.beforeSeekableWindow_(e,t)){var n=e.end(e.length-1);return this.logger_("Fell out of live window at time "+t+". Seeking to live point (seekable end) "+n),this.cancelTimer_(),this.seekTo(n),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var r=this.tech_.buffered(),i=cd(r,t);if(this.videoUnderflow_(i,r,t))return this.cancelTimer_(),this.seekTo(t),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;if(i.length>0){var a=i.start(0)-t;return this.logger_("Stopped at "+t+", setting timer for "+a+", seeking to "+i.start(0)),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*a,t),!0}return!1}},{key:"afterSeekableWindow_",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!e.length)return!1;var i=e.end(e.length-1)+.1;return!n.endList&&r&&(i=e.end(e.length-1)+3*n.targetDuration),t>i}},{key:"beforeSeekableWindow_",value:function(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-.1)}},{key:"videoUnderflow_",value:function(e,t,n){if(0===e.length){var r=this.gapFromVideoUnderflow_(t,n);if(r)return this.logger_("Encountered a gap in video from "+r.start+" to "+r.end+". Seeking to current time "+n),!0}return!1}},{key:"skipTheGap_",value:function(e){var t=this.tech_.buffered(),n=this.tech_.currentTime(),r=cd(t,n);this.cancelTimer_(),0!==r.length&&n===e&&(this.logger_("skipTheGap_:","currentTime:",n,"scheduled currentTime:",e,"nextRange start:",r.start(0)),this.seekTo(r.start(0)+1/30),this.tech_.trigger({type:"usage",name:"hls-gap-skip"}))}},{key:"gapFromVideoUnderflow_",value:function(e,t){for(var n=function(e){if(e.length<2)return Me.createTimeRanges();for(var t=[],n=1;n<e.length;n++){var r=e.end(n-1),i=e.start(n);t.push([r,i])}return Me.createTimeRanges(t)}(e),r=0;r<n.length;r++){var i=n.start(r),a=n.end(r);if(t-i<4&&t-i>2)return{start:i,end:a}}return null}}]),t}(),jh={errorInterval:30,getSource:function(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_)}},Uh=function(e){!function e(t,n){var r=0,i=0,a=Me.mergeOptions(jh,n);t.ready((function(){t.trigger({type:"usage",name:"hls-error-reload-initialized"})}));var s=function(){i&&t.currentTime(i)},o=function(e){null!=e&&(i=t.duration()!==1/0&&t.currentTime()||0,t.one("loadedmetadata",s),t.src(e),t.trigger({type:"usage",name:"hls-error-reload"}),t.play())},u=function(){return Date.now()-r<1e3*a.errorInterval?void t.trigger({type:"usage",name:"hls-error-reload-canceled"}):a.getSource&&"function"==typeof a.getSource?(r=Date.now(),a.getSource.call(t,o)):void Me.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")},l=function e(){t.off("loadedmetadata",s),t.off("error",u),t.off("dispose",e)};t.on("error",u),t.on("dispose",l),t.reloadSourceOnError=function(n){l(),e(t,n)}}(this,e)};Me.use("*",(function(e){return{setSource:function(e,t){t(null,e)},setCurrentTime:function(t){return e.vhs&&e.currentSource().src===e.vhs.source_.src&&e.vhs.setCurrentTime(t),t},play:function(){e.vhs&&e.currentSource().src===e.vhs.source_.src&&e.vhs.setCurrentTime(e.tech_.currentTime())}}}));var Bh={PlaylistLoader:Ic,Playlist:qc,Decrypter:vc,AsyncStream:hc,decrypt:pc,utils:ad,STANDARD_PLAYLIST_SELECTOR:function(){return function(t,n,r,i,a){var s=t.playlists.map((function(t){var n,r;return n=t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width,r=t.attributes.RESOLUTION&&t.attributes.RESOLUTION.height,{bandwidth:t.attributes.BANDWIDTH||e.Number.MAX_VALUE,width:n,height:r,playlist:t}}));oh(s,(function(e,t){return e.bandwidth-t.bandwidth}));var o=(s=s.filter((function(e){return!qc.isIncompatible(e.playlist)}))).filter((function(e){return qc.isEnabled(e.playlist)}));o.length||(o=s.filter((function(e){return!qc.isDisabled(e.playlist)})));var u=o.filter((function(e){return e.bandwidth*Jd.BANDWIDTH_VARIANCE<n})),l=u[u.length-1],c=u.filter((function(e){return e.bandwidth===l.bandwidth}))[0];if(!1===a){var d=c||o[0]||s[0];return d?d.playlist:null}var h=u.filter((function(e){return e.width&&e.height}));oh(h,(function(e,t){return e.width-t.width}));var f=h.filter((function(e){return e.width===r&&e.height===i}));l=f[f.length-1];var p=f.filter((function(e){return e.bandwidth===l.bandwidth}))[0],v=void 0,m=void 0,g=void 0;p||(m=(v=h.filter((function(e){return e.width>r||e.height>i}))).filter((function(e){return e.width===v[0].width&&e.height===v[0].height})),l=m[m.length-1],g=m.filter((function(e){return e.bandwidth===l.bandwidth}))[0]);var y=g||p||c||o[0]||s[0];return y?y.playlist:null}(this.playlists.master,this.systemBandwidth,parseInt(sh(this.tech_.el(),"width"),10),parseInt(sh(this.tech_.el(),"height"),10),this.limitRenditionByPlayerDimensions)},INITIAL_PLAYLIST_SELECTOR:function(){var e=this.playlists.master.playlists.filter(qc.isEnabled);return oh(e,(function(e,t){return uh(e,t)})),e.filter((function(e){return Ld(e.attributes.CODECS).videoCodec}))[0]||null},comparePlaylistBandwidth:uh,comparePlaylistResolution:function(t,n){var r=void 0,i=void 0;return t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(r=t.attributes.RESOLUTION.width),r=r||e.Number.MAX_VALUE,n.attributes.RESOLUTION&&n.attributes.RESOLUTION.width&&(i=n.attributes.RESOLUTION.width),r===(i=i||e.Number.MAX_VALUE)&&t.attributes.BANDWIDTH&&n.attributes.BANDWIDTH?t.attributes.BANDWIDTH-n.attributes.BANDWIDTH:r-i},xhr:Xc()};["GOAL_BUFFER_LENGTH","MAX_GOAL_BUFFER_LENGTH","GOAL_BUFFER_LENGTH_RATE","BUFFER_LOW_WATER_LINE","MAX_BUFFER_LOW_WATER_LINE","BUFFER_LOW_WATER_LINE_RATE","BANDWIDTH_VARIANCE"].forEach((function(e){Object.defineProperty(Bh,e,{get:function(){return Me.log.warn("using Hls."+e+" is UNSAFE be sure you know what you are doing"),Jd[e]},set:function(t){Me.log.warn("using Hls."+e+" is UNSAFE be sure you know what you are doing"),"number"!=typeof t||t<0?Me.log.warn("value of Hls."+e+" must be greater than or equal to 0"):Jd[e]=t}})}));var Fh=function(e){return/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i.test(e)?"hls":/^application\/dash\+xml/i.test(e)?"dash":null},Nh=function(e,t){for(var n=t.media(),r=-1,i=0;i<e.length;i++)if(e[i].id===n.uri){r=i;break}e.selectedIndex_=r,e.trigger({selectedIndex:r,type:"change"})};Bh.canPlaySource=function(){return Me.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var Gh=function(e){if("dash"===e.options_.sourceType){var t=Me.players[e.tech_.options_.playerId];if(t.eme){var n=function(e,t,n){if(!e)return e;var r={};for(var i in e)r[i]={audioContentType:'audio/mp4; codecs="'+n.attributes.CODECS+'"',videoContentType:'video/mp4; codecs="'+t.attributes.CODECS+'"'},t.contentProtection&&t.contentProtection[i]&&t.contentProtection[i].pssh&&(r[i].pssh=t.contentProtection[i].pssh),"string"==typeof e[i]&&(r[i].url=e[i]);return Me.mergeOptions(e,r)}(e.source_.keySystems,e.playlists.media(),e.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader.media());n&&(t.currentSource().keySystems=n,t.eme.initializeMediaKeys&&t.eme.initializeMediaKeys())}}},Vh=function(){if(!window.localStorage)return null;var e=window.localStorage.getItem("videojs-vhs");if(!e)return null;try{return JSON.parse(e)}catch(e){return null}};Bh.supportsNativeHls=function(){var e=t.createElement("video");return!!Me.getTech("Html5").isSupported()&&["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some((function(t){return/maybe|probably/i.test(e.canPlayType(t))}))}(),Bh.supportsNativeDash=!!Me.getTech("Html5").isSupported()&&/maybe|probably/i.test(t.createElement("video").canPlayType("application/dash+xml")),Bh.supportsTypeNatively=function(e){return"hls"===e?Bh.supportsNativeHls:"dash"===e&&Bh.supportsNativeDash},Bh.isSupported=function(){return Me.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var Hh=function(e){function n(e,r,i){yc(this,n);var a=Tc(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,r,i.hls));if(r.options_&&r.options_.playerId){var s=Me(r.options_.playerId);s.hasOwnProperty("hls")||Object.defineProperty(s,"hls",{get:function(){return Me.log.warn("player.hls is deprecated. Use player.tech().hls instead."),r.trigger({type:"usage",name:"hls-player-access"}),a},configurable:!0}),s.vhs=a,s.dash=a,a.player_=s}if(a.tech_=r,a.source_=e,a.stats={},a.setOptions_(),a.options_.overrideNative&&r.overrideNativeAudioTracks&&r.overrideNativeVideoTracks)r.overrideNativeAudioTracks(!0),r.overrideNativeVideoTracks(!0);else if(a.options_.overrideNative&&(r.featuresNativeVideoTracks||r.featuresNativeAudioTracks))throw new Error("Overriding native HLS requires emulated tracks. See https://git.io/vMpjB");return a.on(t,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],(function(e){var n=t.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement||t.msFullscreenElement;n&&n.contains(a.tech_.el())&&a.masterPlaylistController_.smoothQualityChange_()})),a.on(a.tech_,"seeking",(function(){0===this.tech_.currentTime()&&this.tech_.player_.loop()&&this.setCurrentTime(0)})),a.on(a.tech_,"error",(function(){this.masterPlaylistController_&&this.masterPlaylistController_.pauseLoading()})),a.on(a.tech_,"play",a.play),a}return bc(n,e),_c(n,[{key:"setOptions_",value:function(){var e=this;if(this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.handleManifestRedirects=this.options_.handleManifestRedirects||!1,this.options_.limitRenditionByPlayerDimensions=!1!==this.options_.limitRenditionByPlayerDimensions,this.options_.smoothQualityChange=this.options_.smoothQualityChange||!1,this.options_.useBandwidthFromLocalStorage=void 0!==this.source_.useBandwidthFromLocalStorage?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,"number"!=typeof this.options_.blacklistDuration&&(this.options_.blacklistDuration=300),"number"!=typeof this.options_.bandwidth&&this.options_.useBandwidthFromLocalStorage){var t=Vh();t&&t.bandwidth&&(this.options_.bandwidth=t.bandwidth,this.tech_.trigger({type:"usage",name:"hls-bandwidth-from-local-storage"})),t&&t.throughput&&(this.options_.throughput=t.throughput,this.tech_.trigger({type:"usage",name:"hls-throughput-from-local-storage"}))}"number"!=typeof this.options_.bandwidth&&(this.options_.bandwidth=Jd.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Jd.INITIAL_BANDWIDTH,["withCredentials","limitRenditionByPlayerDimensions","bandwidth","smoothQualityChange","customTagParsers","customTagMappers","handleManifestRedirects","cacheEncryptionKeys"].forEach((function(t){void 0!==e.source_[t]&&(e.options_[t]=e.source_[t])})),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions}},{key:"src",value:function(e,t){var n=this;e&&(this.setOptions_(),this.options_.url=this.source_.src,this.options_.tech=this.tech_,this.options_.externHls=Bh,this.options_.sourceType=Fh(t),this.options_.seekTo=function(e){n.tech_.setCurrentTime(e),n.setCurrentTime(e)},this.masterPlaylistController_=new Oh(this.options_),this.playbackWatcher_=new Mh(Me.mergeOptions(this.options_,{seekable:function(){return n.seekable()},media:function(){return n.masterPlaylistController_.media()}})),this.masterPlaylistController_.on("error",(function(){Me.players[n.tech_.options_.playerId].error(n.masterPlaylistController_.error)})),this.masterPlaylistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):Bh.STANDARD_PLAYLIST_SELECTOR.bind(this),this.masterPlaylistController_.selectInitialPlaylist=Bh.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.masterPlaylistController_.masterPlaylistLoader_,this.mediaSource=this.masterPlaylistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get:function(){return this.masterPlaylistController_.selectPlaylist},set:function(e){this.masterPlaylistController_.selectPlaylist=e.bind(this)}},throughput:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.throughput.rate=e,this.masterPlaylistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.bandwidth},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=e,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var e,t=1/(this.bandwidth||1);return e=this.throughput>0?1/this.throughput:0,Math.floor(1/(t+e))},set:function(){Me.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:function(){return n.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return n.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return n.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return n.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return n.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return n.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return n.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return n.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},buffered:{get:function(){return hd(n.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return n.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return n.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return n.tech_.name_},enumerable:!0},duration:{get:function(){return n.tech_.duration()},enumerable:!0},master:{get:function(){return n.playlists.master},enumerable:!0},playerDimensions:{get:function(){return n.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return hd(n.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return n.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",(function(){n.options_.useBandwidthFromLocalStorage&&function(e){if(!window.localStorage)return!1;var t=Vh();t=t?Me.mergeOptions(t,e):e;try{window.localStorage.setItem("videojs-vhs",JSON.stringify(t))}catch(e){return!1}}({bandwidth:n.bandwidth,throughput:Math.round(n.throughput)})})),this.masterPlaylistController_.on("selectedinitialmedia",(function(){(function(e){var t=e.playlists;e.representations=function(){return t.master.playlists.filter((function(e){return!Hc(e)})).map((function(t,n){return new Dh(e,t,t.uri)}))}})(n),Gh(n)})),this.on(this.masterPlaylistController_,"progress",(function(){this.tech_.trigger("progress")})),this.tech_.ready((function(){return n.setupQualityLevels_()})),this.tech_.el()&&this.tech_.src(Me.URL.createObjectURL(this.masterPlaylistController_.mediaSource)))}},{key:"setupQualityLevels_",value:function(){var e=this,t=Me.players[this.tech_.options_.playerId];t&&t.qualityLevels&&(this.qualityLevels_=t.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",(function(){!function(e,t){t.representations().forEach((function(t){e.addQualityLevel(t)})),Nh(e,t.playlists)}(e.qualityLevels_,e)})),this.playlists.on("mediachange",(function(){Nh(e.qualityLevels_,e.playlists)})))}},{key:"play",value:function(){this.masterPlaylistController_.play()}},{key:"setCurrentTime",value:function(e){this.masterPlaylistController_.setCurrentTime(e)}},{key:"duration",value:function(){return this.masterPlaylistController_.duration()}},{key:"seekable",value:function(){return this.masterPlaylistController_.seekable()}},{key:"dispose",value:function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.hls&&delete this.tech_.hls,function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,n,r)}if("value"in i)return i.value;var s=i.get;return void 0!==s?s.call(r):void 0}(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"dispose",this).call(this)}},{key:"convertToProgramTime",value:function(e,t){return sd({playlist:this.masterPlaylistController_.media(),time:e,callback:t})}},{key:"seekToProgramTime",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2;return od({programTime:e,playlist:this.masterPlaylistController_.media(),retryCount:r,pauseAfterSeek:n,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}}]),n}(Me.getComponent("Component")),zh={name:"videojs-http-streaming",VERSION:"1.10.3",canHandleSource:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Me.mergeOptions(Me.options,t);return zh.canPlayType(e.type,n)},handleSource:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Me.mergeOptions(Me.options,n);return t.hls=new Hh(e,t,r),t.hls.xhr=Xc(),t.hls.src(e.src,e.type),t.hls},canPlayType:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Me.mergeOptions(Me.options,t),r=n.hls.overrideNative,i=Fh(e);return!i||Bh.supportsTypeNatively(i)&&!r?"":"maybe"}};return void 0!==Me.MediaSource&&void 0!==Me.URL||(Me.MediaSource=Fd,Me.URL=Nd),Fd.supportsNativeMediaSources()&&Me.getTech("Html5").registerSourceHandler(zh,0),Me.HlsHandler=Hh,Me.HlsSourceHandler=zh,Me.Hls=Bh,Me.use||Me.registerComponent("Hls",Bh),Me.options.hls=Me.options.hls||{},Me.registerPlugin?Me.registerPlugin("reloadSourceOnError",Uh):Me.plugin("reloadSourceOnError",Uh),Me})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("video.js")):"function"==typeof define&&define.amd?define(["video.js"],t):e.videojsSnapshot=t(e.videojs)}(this,(function(e){"use strict";e="default"in e?e.default:e;var t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};return function(e,t){return e(t={exports:{}}),t.exports}((function(n){!function(t,r){n.exports?n.exports=r(e):t.returnExports=r(t.videojs)}(t,(function(e){var t,n,r={},i=e.registerPlugin||e.plugin,a=e.getComponent("Component"),s=e.getComponent("Button");e.SnapshoterBaseComponent=e.extend(a,{constructor:function(e,t){a.call(this,e,t)},dispose:function(){}}),e.SnapshoterComponent=e.extend(e.SnapshoterBaseComponent,{constructor:function(t,n){a.call(this,t,n),this.loadOptions(),this.resetState(),this.player().one("ready",this.setupUI.bind(this));var r=e.ImageCaptureEngine;try{this.engine=new r(this.player())}catch(t){throw new Error("Could not load "+e.ImageCaptureEngine+" plugin")}},loadOptions:function(){},setupUI:function(){for(var e=this.player().controlBar.children().length,t=e-1;t>=0;t--)if("FullscreenToggle"==this.player().controlBar.children()[t].name_){e=t;break}this.player().controlBar.addChild(this.player().cameraButton,{},e),this.player().options_.controls&&(this.player().controlBar.show(),this.player().controlBar.el().style.display="flex")},isSnapshoting:function(){return this._snapshoting},isProcessing:function(){return this._processing},isDestroyed:function(){return this.player()&&null===this.player().children()},start:function(){this.isProcessing()||(this._snapshoting=!0,this._processing=!0,this.player().controlBar.playToggle.hide(),this.createSnapshot())},stop:function(){this.isProcessing()&&(this._snapshoting=!1,this._processing=!1),this.player().controlBar.playToggle.show()},destroy:function(){this.stop(),this.player().dispose(),this.resetState()},reset:function(){this.stop(),this.loadOptions(),this.resetState(),this.player().reset(),this.player().snapshotCanvas.hide(),this.player().cameraButton.hide()},resetState:function(){this._snapshoting=!1,this._processing=!1},createSnapshot:function(){var e=this;this.captureFrame().then((function(t){e.player().trigger("snap",t),e.stop()})).catch((function(t){console.log(t),e.player().trigger("snap",""),e.stop()}))},retrySnapshot:function(){this._processing=!1,this.player().snapshotCanvas.hide()},captureFrame:function(){var e=this,t=this.player().snapshotCanvas.el().firstChild;return t.width=this.player().videoWidth(),t.height=this.player().videoHeight(),new Promise((function(n,r){try{return n(e.engine.imageCaptureByIdAndCanvasDom(e.player().id(),t))}catch(e){return r(e)}}))}}),n=e.extend(a),(t=e.extend(s,{constructor:function(e,t){s.call(this,e,t),this.on("click",this.onClick),this.on("tap",this.onClick)}})).prototype.onClick=function(e){e.stopImmediatePropagation();var t=this.player().snapshoter;t.isProcessing()?(t.retrySnapshot(),this.onStop()):t.start()},t.prototype.onStart=function(){this.removeClass("vjs-icon-photo-camera"),this.addClass("vjs-icon-photo-retry"),this.el().firstChild.firstChild.innerHTML=this.localize("Retry")},t.prototype.onStop=function(){this.removeClass("vjs-icon-photo-retry"),this.addClass("vjs-icon-photo-camera"),this.el().firstChild.firstChild.innerHTML=this.localize("Image")};var o=function(e,t,n){var r={className:"vjs-"+e+"-control vjs-control vjs-button",innerHTML:'<span aria-hidden="true" class="vjs-icon-'+n+'"></span><span class="vjs-control-text" aria-live="polite">'+t+"</span>"},i={title:t,type:"button","aria-disabled":"false"};return a.prototype.createEl("button",r,i)},u=function(e){var t={className:"vjs-"+e+"-canvas",innerHTML:"<canvas></canvas>"};return a.prototype.createEl("div",t)},l=function(i){var a=this,s=e.mergeOptions(r,i),l=this;l.ready((function(){!function(e,t){e.addClass("vjs-snapshot")}(a,e.mergeOptions(r,i))})),l.on("play",(function(){try{l.tech_.el_.setAttribute("crossorigin","anonymous")}catch(e){}})),l.snapshoter=new e.SnapshoterComponent(this,{options:s}),l.addChild(l.snapshoter),l.snapshotCanvas=new n(l,{el:u("snapshot")}),l.snapshotCanvas.hide(),l.snapshoter.addChild(l.snapshotCanvas),l.cameraButton=new t(l,{el:o("snapshot",l.localize("Snapshot"),"spinner"),name:"SnapButton"}),l.cameraButton.show()};return i("snapshot",l),l})),function(t,r){n.exports?n.exports=r(e):t.returnExports=r(t.videojs)}(t,(function(e){var t=e.getComponent("Component");e.ImageCaptureEngine=e.extend(t,{constructor:function(e,n){t.call(this,e,n)},formatTag:function(e){if(e&&0!==(e=e.trim()).length)return e},getDomByIdAndTag:function(e,t){t=this.formatTag(t);var n=document.getElementById(e);if(t&&0!==t.trim().length)return n.tagName.toUpperCase()===t.toUpperCase()?n:n.getElementsByTagName(t)[0]},getScreenContainerDomByIdAndTag:function(e,t){return(t=this.formatTag(t))?this.getDomByIdAndTag(e,t):this.getDomByIdAndTag(e,"object")||this.getDomByIdAndTag(e,"video")},drawCanvas:function(e,t){e.width=t.videoWidth,e.height=t.videoHeight,e.getContext("2d").drawImage(t,0,0,e.width,e.height)},imageCaptureByDom:function(e,t){var n;return e&&e.tagName.toUpperCase()==="object".toUpperCase()?n=e.vjs_snap():(this.drawCanvas(t,e),n=t.toDataURL("image/png")),n},imageCaptureById:function(e,t){return this.imageCaptureByDom(this.getScreenContainerDomByIdAndTag(e),this.getDomByIdAndTag(t,"canvas"))},imageCaptureByIdAndCanvasDom:function(e,t){return this.imageCaptureByDom(this.getScreenContainerDomByIdAndTag(e),t)}})}))}))})),function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).flvjs=e()}}((function(){return function e(t,n,r){function i(s,o){if(!n[s]){if(!t[s]){var u="function"==typeof require&&require;if(!o&&u)return u(s,!0);if(a)return a(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[s]={exports:{}};t[s][0].call(c.exports,(function(e){return i(t[s][1][e]||e)}),c,c.exports,e,t,n,r)}return n[s].exports}for(var a="function"==typeof require&&require,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(e,t,n){(function(r,i){(function(){!function(e,r){"object"==typeof n&&void 0!==t?t.exports=r():e.ES6Promise=r()}(this,(function(){"use strict";function t(e){return"function"==typeof e}function n(){var e=setTimeout;return function(){return e(a,1)}}function a(){for(var e=0;e<_;e+=2)(0,L[e])(L[e+1]),L[e]=void 0,L[e+1]=void 0;_=0}function s(e,t){var n=this,r=new this.constructor(u);void 0===r[x]&&g(r);var i=n._state;if(i){var a=arguments[i-1];S((function(){return m(i,r,a,n._result)}))}else p(n,r,e,t);return r}function o(e){if(e&&"object"==typeof e&&e.constructor===this)return e;var t=new this(u);return c(t,e),t}function u(){}function l(e,n,r){n.constructor===e.constructor&&r===s&&n.constructor.resolve===o?function(e,t){t._state===O?h(e,t._result):t._state===D?f(e,t._result):p(t,void 0,(function(t){return c(e,t)}),(function(t){return f(e,t)}))}(e,n):void 0===r?h(e,n):t(r)?function(e,t,n){S((function(e){var r=!1,i=function(e,t,n,r){try{e.call(t,n,r)}catch(e){return e}}(n,t,(function(n){r||(r=!0,t!==n?c(e,n):h(e,n))}),(function(t){r||(r=!0,f(e,t))}),e._label);!r&&i&&(r=!0,f(e,i))}),e)}(e,n,r):h(e,n)}function c(e,t){if(e===t)f(e,new TypeError("You cannot resolve a promise with itself"));else if(function(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}(t)){var n=void 0;try{n=t.then}catch(t){return void f(e,t)}l(e,t,n)}else h(e,t)}function d(e){e._onerror&&e._onerror(e._result),v(e)}function h(e,t){e._state===I&&(e._result=t,e._state=O,0!==e._subscribers.length&&S(v,e))}function f(e,t){e._state===I&&(e._state=D,e._result=t,S(d,e))}function p(e,t,n,r){var i=e._subscribers,a=i.length;e._onerror=null,i[a]=t,i[a+O]=n,i[a+D]=r,0===a&&e._state&&S(v,e)}function v(e){var t=e._subscribers,n=e._state;if(0!==t.length){for(var r=void 0,i=void 0,a=e._result,s=0;s<t.length;s+=3)r=t[s],i=t[s+n],r?m(n,r,i,a):i(a);e._subscribers.length=0}}function m(e,n,r,i){var a=t(r),s=void 0,o=void 0,u=!0;if(a){try{s=r(i)}catch(e){u=!1,o=e}if(n===s)return void f(n,new TypeError("A promises callback cannot return that same promise."))}else s=i;n._state!==I||(a&&u?c(n,s):!1===u?f(n,o):e===O?h(n,s):e===D&&f(n,s))}function g(e){e[x]=P++,e._state=void 0,e._result=void 0,e._subscribers=[]}var y=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},_=0,b=void 0,T=void 0,S=function(e,t){L[_]=e,L[_+1]=t,2===(_+=2)&&(T?T(a):R())},E="undefined"!=typeof window?window:void 0,k=E||{},w=k.MutationObserver||k.WebKitMutationObserver,C="undefined"==typeof self&&void 0!==r&&"[object process]"==={}.toString.call(r),A="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,L=new Array(1e3),R=void 0;R=C?function(){return r.nextTick(a)}:w?function(){var e=0,t=new w(a),n=document.createTextNode("");return t.observe(n,{characterData:!0}),function(){n.data=e=++e%2}}():A?function(){var e=new MessageChannel;return e.port1.onmessage=a,function(){return e.port2.postMessage(0)}}():void 0===E&&"function"==typeof e?function(){try{var e=Function("return this")().require("vertx");return void 0!==(b=e.runOnLoop||e.runOnContext)?function(){b(a)}:n()}catch(e){return n()}}():n();var x=Math.random().toString(36).substring(2),I=void 0,O=1,D=2,P=0,M=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(u),this.promise[x]||g(this.promise),y(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?h(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&h(this.promise,this._result))):f(this.promise,new Error("Array Methods must be provided an Array"))}return e.prototype._enumerate=function(e){for(var t=0;this._state===I&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var n=this._instanceConstructor,r=n.resolve;if(r===o){var i=void 0,a=void 0,c=!1;try{i=e.then}catch(e){c=!0,a=e}if(i===s&&e._state!==I)this._settledAt(e._state,t,e._result);else if("function"!=typeof i)this._remaining--,this._result[t]=e;else if(n===j){var d=new n(u);c?f(d,a):l(d,e,i),this._willSettleAt(d,t)}else this._willSettleAt(new n((function(t){return t(e)})),t)}else this._willSettleAt(r(e),t)},e.prototype._settledAt=function(e,t,n){var r=this.promise;r._state===I&&(this._remaining--,e===D?f(r,n):this._result[t]=n),0===this._remaining&&h(r,this._result)},e.prototype._willSettleAt=function(e,t){var n=this;p(e,void 0,(function(e){return n._settledAt(O,t,e)}),(function(e){return n._settledAt(D,t,e)}))},e}(),j=function(){function e(t){this[x]=P++,this._result=this._state=void 0,this._subscribers=[],u!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof e?function(e,t){try{t((function(t){c(e,t)}),(function(t){f(e,t)}))}catch(t){f(e,t)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return e.prototype.catch=function(e){return this.then(null,e)},e.prototype.finally=function(e){var n=this,r=n.constructor;return t(e)?n.then((function(t){return r.resolve(e()).then((function(){return t}))}),(function(t){return r.resolve(e()).then((function(){throw t}))})):n.then(e,e)},e}();return j.prototype.then=s,j.all=function(e){return new M(this,e).promise},j.race=function(e){var t=this;return new t(y(e)?function(n,r){for(var i=e.length,a=0;a<i;a++)t.resolve(e[a]).then(n,r)}:function(e,t){return t(new TypeError("You must pass an array to race."))})},j.resolve=o,j.reject=function(e){var t=new this(u);return f(t,e),t},j._setScheduler=function(e){T=e},j._setAsap=function(e){S=e},j._asap=S,j.polyfill=function(){var e=void 0;if(void 0!==i)e=i;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=j},j.Promise=j,j}))}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:3}],2:[function(e,t,n){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(e){return"function"==typeof e}function a(e){return"object"==typeof e&&null!==e}function s(e){return void 0===e}t.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if(!function(e){return"number"==typeof e}(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,n,r,o,u,l;if(this._events||(this._events={}),"error"===e&&(!this._events.error||a(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}if(s(n=this._events[e]))return!1;if(i(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:o=Array.prototype.slice.call(arguments,1),n.apply(this,o)}else if(a(n))for(o=Array.prototype.slice.call(arguments,1),r=(l=n.slice()).length,u=0;u<r;u++)l[u].apply(this,o);return!0},r.prototype.addListener=function(e,t){var n;if(!i(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,i(t.listener)?t.listener:t),this._events[e]?a(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,a(this._events[e])&&!this._events[e].warned&&(n=s(this._maxListeners)?r.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){function n(){this.removeListener(e,n),r||(r=!0,t.apply(this,arguments))}if(!i(t))throw TypeError("listener must be a function");var r=!1;return n.listener=t,this.on(e,n),this},r.prototype.removeListener=function(e,t){var n,r,s,o;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(s=(n=this._events[e]).length,r=-1,n===t||i(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(a(n)){for(o=s;o-- >0;)if(n[o]===t||n[o].listener&&n[o].listener===t){r=o;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(i(n=this._events[e]))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){return this._events&&this._events[e]?i(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(i(t))return 1;if(t)return t.length}return 0},r.listenerCount=function(e,t){return e.listenerCount(t)}},{}],3:[function(e,t,n){function r(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(c===setTimeout)return setTimeout(e,0);if((c===r||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function s(){v&&f&&(v=!1,f.length?p=f.concat(p):m=-1,p.length&&o())}function o(){if(!v){var e=a(s);v=!0;for(var t=p.length;t;){for(f=p,p=[];++m<t;)f&&f[m].run();m=-1,t=p.length}f=null,v=!1,function(e){if(d===clearTimeout)return clearTimeout(e);if((d===i||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(e);try{d(e)}catch(t){try{return d.call(null,e)}catch(t){return d.call(this,e)}}}(e)}}function u(e,t){this.fun=e,this.array=t}function l(){}var c,d,h=t.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:r}catch(e){c=r}try{d="function"==typeof clearTimeout?clearTimeout:i}catch(e){d=i}}();var f,p=[],v=!1,m=-1;h.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];p.push(new u(e,t)),1!==p.length||v||a(o)},u.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=l,h.addListener=l,h.once=l,h.off=l,h.removeListener=l,h.removeAllListeners=l,h.emit=l,h.prependListener=l,h.prependOnceListener=l,h.listeners=function(e){return[]},h.binding=function(e){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(e){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},{}],4:[function(e,t,n){var r=arguments[3],i=arguments[4],a=arguments[5],s=JSON.stringify;t.exports=function(e,t){for(var n,o=Object.keys(a),u=0,l=o.length;u<l;u++){var c=o[u],d=a[c].exports;if(d===e||d&&d.default===e){n=c;break}}if(!n){n=Math.floor(Math.pow(16,8)*Math.random()).toString(16);var h={};for(u=0,l=o.length;u<l;u++){h[c=o[u]]=c}i[n]=["function(require,module,exports){"+e+"(self); }",h]}var f=Math.floor(Math.pow(16,8)*Math.random()).toString(16),p={};p[n]=n,i[f]=["function(require,module,exports){var f = require("+s(n)+");(f.default ? f.default : f)(self);}",p];var v={};!function e(t){for(var n in v[t]=!0,i[t][1]){var r=i[t][1][n];v[r]||e(r)}}(f);var m="("+r+")({"+Object.keys(v).map((function(e){return s(e)+":["+i[e][0]+","+s(i[e][1])+"]"})).join(",")+"},{},["+s(f)+"])",g=window.URL||window.webkitURL||window.mozURL||window.msURL,y=new Blob([m],{type:"text/javascript"});if(t&&t.bare)return y;var _=g.createObjectURL(y),b=new Worker(_);return b.objectURL=_,b}},{}],5:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.createDefaultConfig=function(){return Object.assign({},r)};var r=n.defaultConfig={enableWorker:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,lazyLoad:!0,lazyLoadMaxDuration:180,lazyLoadRecoverDuration:30,deferLoadAfterSourceOpen:!0,autoCleanupMaxBackwardDuration:180,autoCleanupMinBackwardDuration:120,statisticsInfoReportInterval:600,fixAudioTimestampGap:!0,accurateSeek:!1,seekType:"range",seekParamStart:"bstart",seekParamEnd:"bend",rangeLoadZeroStart:!1,customSeekHandler:void 0,reuseRedirectedURL:!1,headers:void 0,customLoader:void 0}},{}],6:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(e){return e&&e.__esModule?e:{default:e}}(e("../io/io-controller.js")),a=e("../config.js"),s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,null,[{key:"supportMSEH264Playback",value:function(){var e=self.MediaSource&&self.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),t=self.ManagedMediaSource&&self.ManagedMediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"');return e||t}},{key:"supportMSEH265Playback",value:function(){var e=self.MediaSource&&self.MediaSource.isTypeSupported('video/mp4; codecs="hvc1.1.6.L93.B0"'),t=self.ManagedMediaSource&&self.ManagedMediaSource.isTypeSupported('video/mp4; codecs="hvc1.1.6.L93.B0"');return e||t}},{key:"supportNetworkStreamIO",value:function(){var e=new i.default({},(0,a.createDefaultConfig)()),t=e.loaderType;return e.destroy(),"fetch-stream-loader"==t||"xhr-moz-chunked-loader"==t}},{key:"getNetworkLoaderTypeName",value:function(){var e=new i.default({},(0,a.createDefaultConfig)()),t=e.loaderType;return e.destroy(),t}},{key:"supportNativeMediaPlayback",value:function(t){null==e.videoElement&&(e.videoElement=window.document.createElement("video"));var n=e.videoElement.canPlayType(t);return"probably"===n||"maybe"==n}},{key:"getFeatureList",value:function(){var t={mseFlvPlayback:!1,mseLiveFlvPlayback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeMP4H265Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return t.mseFlvPlayback=e.supportMSEH264Playback(),t.networkStreamIO=e.supportNetworkStreamIO(),t.networkLoaderName=e.getNetworkLoaderTypeName(),t.mseLiveFlvPlayback=t.mseFlvPlayback&&t.networkStreamIO,t.nativeMP4H264Playback=e.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),t.nativeMP4H265Playback=e.supportNativeMediaPlayback('video/mp4; codecs="hvc1.1.6.L93.B0"'),t.nativeWebmVP8Playback=e.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),t.nativeWebmVP9Playback=e.supportNativeMediaPlayback('video/webm; codecs="vp9"'),t}}]),e}();n.default=s},{"../config.js":5,"../io/io-controller.js":25}],7:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}return r(e,[{key:"isComplete",value:function(){var e=!1===this.hasAudio||!0===this.hasAudio&&null!=this.audioCodec&&null!=this.audioSampleRate&&null!=this.audioChannelCount,t=!1===this.hasVideo||!0===this.hasVideo&&null!=this.videoCodec&&null!=this.width&&null!=this.height&&null!=this.fps&&null!=this.profile&&null!=this.level&&null!=this.refFrames&&null!=this.chromaFormat&&null!=this.sarNum&&null!=this.sarDen;return null!=this.mimeType&&e&&t}},{key:"isSeekable",value:function(){return!0===this.hasKeyframesIndex}},{key:"getNearestKeyframe",value:function(e){if(null==this.keyframesIndex)return null;var t=this.keyframesIndex,n=this._search(t.times,e);return{index:n,milliseconds:t.times[n],fileposition:t.filepositions[n]}}},{key:"_search",value:function(e,t){var n=0,r=e.length-1,i=0,a=0,s=r;for(t<e[0]&&(n=0,a=s+1);a<=s;){if((i=a+Math.floor((s-a)/2))===r||t>=e[i]&&t<e[i+1]){n=i;break}e[i]<t?a=i+1:s=i-1}return n}}]),e}();n.default=i},{}],8:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();n.SampleInfo=function e(t,n,i,a,s){r(this,e),this.dts=t,this.pts=n,this.duration=i,this.originalDts=a,this.isSyncPoint=s,this.fileposition=null},n.MediaSegmentInfo=function(){function e(){r(this,e),this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}return i(e,[{key:"appendSyncPoint",value:function(e){e.isSyncPoint=!0,this.syncPoints.push(e)}}]),e}(),n.IDRSampleList=function(){function e(){r(this,e),this._list=[]}return i(e,[{key:"clear",value:function(){this._list=[]}},{key:"appendArray",value:function(e){var t=this._list;0!==e.length&&(t.length>0&&e[0].originalDts<t[t.length-1].originalDts&&this.clear(),Array.prototype.push.apply(t,e))}},{key:"getLastSyncPointBeforeDts",value:function(e){if(0==this._list.length)return null;var t=this._list,n=0,r=t.length-1,i=0,a=0,s=r;for(e<t[0].dts&&(n=0,a=s+1);a<=s;){if((i=a+Math.floor((s-a)/2))===r||e>=t[i].dts&&e<t[i+1].dts){n=i;break}t[i].dts<e?a=i+1:s=i-1}return this._list[n]}}]),e}(),n.MediaSegmentInfoList=function(){function e(t){r(this,e),this._type=t,this._list=[],this._lastAppendLocation=-1}return i(e,[{key:"isEmpty",value:function(){return 0===this._list.length}},{key:"clear",value:function(){this._list=[],this._lastAppendLocation=-1}},{key:"_searchNearestSegmentBefore",value:function(e){var t=this._list;if(0===t.length)return-2;var n=t.length-1,r=0,i=0,a=n,s=0;if(e<t[0].originalBeginDts)return-1;for(;i<=a;){if((r=i+Math.floor((a-i)/2))===n||e>t[r].lastSample.originalDts&&e<t[r+1].originalBeginDts){s=r;break}t[r].originalBeginDts<e?i=r+1:a=r-1}return s}},{key:"_searchNearestSegmentAfter",value:function(e){return this._searchNearestSegmentBefore(e)+1}},{key:"append",value:function(e){var t=this._list,n=e,r=this._lastAppendLocation,i=0;-1!==r&&r<t.length&&n.originalBeginDts>=t[r].lastSample.originalDts&&(r===t.length-1||r<t.length-1&&n.originalBeginDts<t[r+1].originalBeginDts)?i=r+1:t.length>0&&(i=this._searchNearestSegmentBefore(n.originalBeginDts)+1),this._lastAppendLocation=i,this._list.splice(i,0,n)}},{key:"getLastSegmentBefore",value:function(e){var t=this._searchNearestSegmentBefore(e);return t>=0?this._list[t]:null}},{key:"getLastSampleBefore",value:function(e){var t=this.getLastSegmentBefore(e);return null!=t?t.lastSample:null}},{key:"getLastSyncPointBefore",value:function(e){for(var t=this._searchNearestSegmentBefore(e),n=this._list[t].syncPoints;0===n.length&&t>0;)t--,n=this._list[t].syncPoints;return n.length>0?n[n.length-1]:null}},{key:"type",get:function(){return this._type}},{key:"length",get:function(){return this._list.length}}]),e}()},{}],9:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=r(e("events")),s=r(e("../utils/logger.js")),o=r(e("../utils/browser.js")),u=r(e("./mse-events.js")),l=e("./media-segment-info.js"),c=e("../utils/exception.js"),d=function(){function e(t){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.TAG="MSEController",this._config=t,this._emitter=new a.default,this._config.isLive&&null==this._config.autoCleanupSourceBuffer&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onStartStreaming:this._onStartStreaming.bind(this),onEndStreaming:this._onEndStreaming.bind(this),onQualityChange:this._onQualityChange.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._useManagedMediaSource="ManagedMediaSource"in self&&!("MediaSource"in self),this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElement=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]},this._idrList=new l.IDRSampleList}return i(e,[{key:"destroy",value:function(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter&&this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(e,t){this._emitter.addListener(e,t)}},{key:"off",value:function(e,t){this._emitter.removeListener(e,t)}},{key:"attachMediaElement",value:function(e){if(this._mediaSource)throw new c.IllegalStateException("MediaSource has been attached to an HTMLMediaElement!");this._useManagedMediaSource&&s.default.v(this.TAG,"Using ManagedMediaSource");var t=this._mediaSource=this._useManagedMediaSource?new self.ManagedMediaSource:new self.MediaSource;t.addEventListener("sourceopen",this.e.onSourceOpen),t.addEventListener("sourceended",this.e.onSourceEnded),t.addEventListener("sourceclose",this.e.onSourceClose),this._useManagedMediaSource&&(t.addEventListener("startstreaming",this.e.onStartStreaming),t.addEventListener("endstreaming",this.e.onEndStreaming),t.addEventListener("qualitychange",this.e.onQualityChange)),this._mediaElement=e,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),e.src=this._mediaSourceObjectURL}},{key:"detachMediaElement",value:function(){if(this._mediaSource){var e=this._mediaSource;for(var t in this._sourceBuffers){var n=this._pendingSegments[t];n.splice(0,n.length),this._pendingSegments[t]=null,this._pendingRemoveRanges[t]=null,this._lastInitSegments[t]=null;var r=this._sourceBuffers[t];if(r){if("closed"!==e.readyState){try{e.removeSourceBuffer(r)}catch(e){s.default.e(this.TAG,e.message)}r.removeEventListener("error",this.e.onSourceBufferError),r.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[t]=null,this._sourceBuffers[t]=null}}if("open"===e.readyState)try{e.endOfStream()}catch(e){s.default.e(this.TAG,e.message)}e.removeEventListener("sourceopen",this.e.onSourceOpen),e.removeEventListener("sourceended",this.e.onSourceEnded),e.removeEventListener("sourceclose",this.e.onSourceClose),this._useManagedMediaSource&&(e.removeEventListener("startstraming",this.e.onStartStreaming),e.removeEventListener("endstreaming",this.e.onEndStreaming),e.removeEventListener("qualitychange",this.e.onQualityChange)),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._idrList.clear(),this._mediaSource=null}this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement=null),this._mediaSourceObjectURL&&(window.URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)}},{key:"isManagedMediaSource",value:function(){return this._useManagedMediaSource}},{key:"getObject",value:function(){if(!this._mediaSource)throw new c.IllegalStateException("MediaSource has not been initialized yet!");return this._mediaSource}},{key:"getHandle",value:function(){if(!this._mediaSource)throw new c.IllegalStateException("MediaSource has not been initialized yet!");return this._mediaSource.handle}},{key:"getObjectURL",value:function(){if(!this._mediaSource)throw new c.IllegalStateException("MediaSource has not been initialized yet!");return null==this._mediaSourceObjectURL&&(this._mediaSourceObjectURL=URL.createObjectURL(this._mediaSource)),this._mediaSourceObjectURL}},{key:"revokeObjectURL",value:function(){this._mediaSourceObjectURL&&(URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)}},{key:"appendInitSegment",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(!this._mediaSource||"open"!==this._mediaSource.readyState||!1===this._mediaSource.streaming)return this._pendingSourceBufferInit.push(e),void this._pendingSegments[e.type].push(e);var n=e,r=""+n.container;n.codec&&n.codec.length>0&&("opus"===n.codec&&o.default.safari&&(n.codec="Opus"),r+=";codecs="+n.codec);var i=!1;if(s.default.v(this.TAG,"Received Initialization Segment, mimeType: "+r),this._lastInitSegments[n.type]=n,r!==this._mimeTypes[n.type]){if(this._mimeTypes[n.type])s.default.v(this.TAG,"Notice: "+n.type+" mimeType changed, origin: "+this._mimeTypes[n.type]+", target: "+r);else{i=!0;try{var a=this._sourceBuffers[n.type]=this._mediaSource.addSourceBuffer(r);a.addEventListener("error",this.e.onSourceBufferError),a.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(e){return s.default.e(this.TAG,e.message),void this._emitter.emit(u.default.ERROR,{code:e.code,msg:e.message})}}this._mimeTypes[n.type]=r}t||this._pendingSegments[n.type].push(n),i||this._sourceBuffers[n.type]&&!this._sourceBuffers[n.type].updating&&this._doAppendSegments(),o.default.safari&&"audio/mpeg"===n.container&&n.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=n.mediaDuration/1e3,this._updateMediaSourceDuration())}},{key:"appendMediaSegment",value:function(e){var t=e;this._pendingSegments[t.type].push(t),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var n=this._sourceBuffers[t.type];!n||n.updating||this._hasPendingRemoveRanges()||this._doAppendSegments()}},{key:"seek",value:function(e){for(var t in this._sourceBuffers)if(this._sourceBuffers[t]){var n=this._sourceBuffers[t];if("open"===this._mediaSource.readyState)try{n.abort()}catch(e){s.default.e(this.TAG,e.message)}this._idrList.clear();var r=this._pendingSegments[t];if(r.splice(0,r.length),"closed"!==this._mediaSource.readyState){for(var i=0;i<n.buffered.length;i++){var a=n.buffered.start(i),u=n.buffered.end(i);this._pendingRemoveRanges[t].push({start:a,end:u})}if(n.updating||this._doRemoveRanges(),o.default.safari){var l=this._lastInitSegments[t];l&&(this._pendingSegments[t].push(l),n.updating||this._doAppendSegments())}}}}},{key:"endOfStream",value:function(){var e=this._mediaSource,t=this._sourceBuffers;e&&"open"===e.readyState?t.video&&t.video.updating||t.audio&&t.audio.updating?this._hasPendingEos=!0:(this._hasPendingEos=!1,e.endOfStream()):e&&"closed"===e.readyState&&this._hasPendingSegments()&&(this._hasPendingEos=!0)}},{key:"getNearestKeyframe",value:function(e){return this._idrList.getLastSyncPointBeforeDts(e)}},{key:"_needCleanupSourceBuffer",value:function(){if(!this._config.autoCleanupSourceBuffer)return!1;var e=this._mediaElement.currentTime;for(var t in this._sourceBuffers){var n=this._sourceBuffers[t];if(n){var r=n.buffered;if(r.length>=1&&e-r.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1}},{key:"_doCleanupSourceBuffer",value:function(){var e=this._mediaElement.currentTime;for(var t in this._sourceBuffers){var n=this._sourceBuffers[t];if(n){for(var r=n.buffered,i=!1,a=0;a<r.length;a++){var s=r.start(a),o=r.end(a);if(s<=e&&e<o+3){if(e-s>=this._config.autoCleanupMaxBackwardDuration){i=!0;var u=e-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[t].push({start:s,end:u})}}else o<e&&(i=!0,this._pendingRemoveRanges[t].push({start:s,end:o}))}i&&!n.updating&&this._doRemoveRanges()}}}},{key:"_updateMediaSourceDuration",value:function(){var e=this._sourceBuffers;if(0!==this._mediaElement.readyState&&"open"===this._mediaSource.readyState&&!(e.video&&e.video.updating||e.audio&&e.audio.updating)){var t=this._mediaSource.duration,n=this._pendingMediaDuration;n>0&&(isNaN(t)||n>t)&&(s.default.v(this.TAG,"Update MediaSource duration from "+t+" to "+n),this._mediaSource.duration=n),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}}},{key:"_doRemoveRanges",value:function(){for(var e in this._pendingRemoveRanges)if(this._sourceBuffers[e]&&!this._sourceBuffers[e].updating)for(var t=this._sourceBuffers[e],n=this._pendingRemoveRanges[e];n.length&&!t.updating;){var r=n.shift();t.remove(r.start,r.end)}}},{key:"_doAppendSegments",value:function(){var e=this._pendingSegments;for(var t in e)if(!(!this._sourceBuffers[t]||this._sourceBuffers[t].updating||this._mediaSource&&!1===this._mediaSource.streaming)&&e[t].length>0){var n=e[t].shift();if("number"==typeof n.timestampOffset&&isFinite(n.timestampOffset)){var r=this._sourceBuffers[t].timestampOffset,i=n.timestampOffset/1e3;Math.abs(r-i)>.1&&(s.default.v(this.TAG,"Update MPEG audio timestampOffset from "+r+" to "+i),this._sourceBuffers[t].timestampOffset=i),delete n.timestampOffset}if(!n.data||0===n.data.byteLength)continue;try{this._sourceBuffers[t].appendBuffer(n.data),this._isBufferFull=!1,"video"===t&&n.hasOwnProperty("info")&&this._idrList.appendArray(n.info.syncPoints)}catch(e){this._pendingSegments[t].unshift(n),22===e.code?(this._isBufferFull||this._emitter.emit(u.default.BUFFER_FULL),this._isBufferFull=!0):(s.default.e(this.TAG,t,e.message),this._emitter.emit(u.default.ERROR,{code:e.code,msg:e.message}))}}}},{key:"_onSourceOpen",value:function(){if(s.default.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var e=this._pendingSourceBufferInit;e.length;){var t=e.shift();this.appendInitSegment(t,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(u.default.SOURCE_OPEN)}},{key:"_onStartStreaming",value:function(){s.default.v(this.TAG,"ManagedMediaSource onStartStreaming"),this._emitter.emit(u.default.START_STREAMING)}},{key:"_onEndStreaming",value:function(){s.default.v(this.TAG,"ManagedMediaSource onEndStreaming"),this._emitter.emit(u.default.END_STREAMING)}},{key:"_onQualityChange",value:function(){s.default.v(this.TAG,"ManagedMediaSource onQualityChange")}},{key:"_onSourceEnded",value:function(){s.default.v(this.TAG,"MediaSource onSourceEnded")}},{key:"_onSourceClose",value:function(){s.default.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&null!=this.e&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose),this._useManagedMediaSource&&(this._mediaSource.removeEventListener("startstraming",this.e.onStartStreaming),this._mediaSource.removeEventListener("endstreaming",this.e.onEndStreaming),this._mediaSource.removeEventListener("qualitychange",this.e.onQualityChange)))}},{key:"_hasPendingSegments",value:function(){var e=this._pendingSegments;return(e.video&&e.video.length)>0||e.audio&&e.audio.length>0}},{key:"_hasPendingRemoveRanges",value:function(){var e=this._pendingRemoveRanges;return(e.video&&e.video.length)>0||e.audio&&e.audio.length>0}},{key:"_onSourceBufferUpdateEnd",value:function(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(u.default.UPDATE_END)}},{key:"_onSourceBufferError",value:function(e){s.default.e(this.TAG,"SourceBuffer Error: "+e)}}]),e}();n.default=d},{"../utils/browser.js":41,"../utils/exception.js":42,"../utils/logger.js":43,"./media-segment-info.js":8,"./mse-events.js":10,events:2}],10:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});n.default={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full",START_STREAMING:"start_streaming",END_STREAMING:"end_streaming"}},{}],11:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=r(e("events")),s=r(e("../utils/logger.js")),o=r(e("../utils/logging-control.js")),u=r(e("./transmuxing-controller.js")),l=r(e("./transmuxing-events.js")),c=r(e("./transmuxing-worker.js")),d=r(e("./media-info.js")),h=function(){function t(n,r){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.TAG="Transmuxer",this._emitter=new a.default,r.enableWorker&&"undefined"!=typeof Worker)try{var i=e("webworkify");this._worker=i(c.default),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[n,r]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},o.default.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:o.default.getConfig()})}catch(e){s.default.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new u.default(n,r)}else this._controller=new u.default(n,r);if(this._controller){var d=this._controller;d.on(l.default.IO_ERROR,this._onIOError.bind(this)),d.on(l.default.DEMUX_ERROR,this._onDemuxError.bind(this)),d.on(l.default.INIT_SEGMENT,this._onInitSegment.bind(this)),d.on(l.default.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),d.on(l.default.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),d.on(l.default.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),d.on(l.default.MEDIA_INFO,this._onMediaInfo.bind(this)),d.on(l.default.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),d.on(l.default.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),d.on(l.default.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),d.on(l.default.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return i(t,[{key:"destroy",value:function(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),o.default.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter&&this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(e,t){this._emitter.addListener(e,t)}},{key:"off",value:function(e,t){this._emitter.removeListener(e,t)}},{key:"hasWorker",value:function(){return null!=this._worker}},{key:"open",value:function(){this._worker?this._worker.postMessage({cmd:"start"}):this._controller.start()}},{key:"close",value:function(){this._worker?this._worker.postMessage({cmd:"stop"}):this._controller.stop()}},{key:"seek",value:function(e){this._worker?this._worker.postMessage({cmd:"seek",param:e}):this._controller.seek(e)}},{key:"pause",value:function(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()}},{key:"resume",value:function(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()}},{key:"_onInitSegment",value:function(e,t){var n=this;Promise.resolve().then((function(){n._emitter.emit(l.default.INIT_SEGMENT,e,t)}))}},{key:"_onMediaSegment",value:function(e,t){var n=this;Promise.resolve().then((function(){n._emitter.emit(l.default.MEDIA_SEGMENT,e,t)}))}},{key:"_onLoadingComplete",value:function(){var e=this;Promise.resolve().then((function(){e._emitter.emit(l.default.LOADING_COMPLETE)}))}},{key:"_onRecoveredEarlyEof",value:function(){var e=this;Promise.resolve().then((function(){e._emitter.emit(l.default.RECOVERED_EARLY_EOF)}))}},{key:"_onMediaInfo",value:function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(l.default.MEDIA_INFO,e)}))}},{key:"_onMetaDataArrived",value:function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(l.default.METADATA_ARRIVED,e)}))}},{key:"_onScriptDataArrived",value:function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(l.default.SCRIPTDATA_ARRIVED,e)}))}},{key:"_onStatisticsInfo",value:function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(l.default.STATISTICS_INFO,e)}))}},{key:"_onIOError",value:function(e,t){var n=this;Promise.resolve().then((function(){n._emitter.emit(l.default.IO_ERROR,e,t)}))}},{key:"_onDemuxError",value:function(e,t){var n=this;Promise.resolve().then((function(){n._emitter.emit(l.default.DEMUX_ERROR,e,t)}))}},{key:"_onRecommendSeekpoint",value:function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(l.default.RECOMMEND_SEEKPOINT,e)}))}},{key:"_onLoggingConfigChanged",value:function(e){this._worker&&this._worker.postMessage({cmd:"logging_config",param:e})}},{key:"_onWorkerMessage",value:function(e){var t=e.data,n=t.data;if("destroyed"===t.msg||this._workerDestroying)return this._workerDestroying=!1,this._worker.terminate(),void(this._worker=null);switch(t.msg){case l.default.INIT_SEGMENT:case l.default.MEDIA_SEGMENT:this._emitter.emit(t.msg,n.type,n.data);break;case l.default.LOADING_COMPLETE:case l.default.RECOVERED_EARLY_EOF:this._emitter.emit(t.msg);break;case l.default.MEDIA_INFO:Object.setPrototypeOf(n,d.default.prototype),this._emitter.emit(t.msg,n);break;case l.default.METADATA_ARRIVED:case l.default.SCRIPTDATA_ARRIVED:case l.default.STATISTICS_INFO:this._emitter.emit(t.msg,n);break;case l.default.IO_ERROR:case l.default.DEMUX_ERROR:this._emitter.emit(t.msg,n.type,n.info);break;case l.default.RECOMMEND_SEEKPOINT:this._emitter.emit(t.msg,n);break;case"logcat_callback":s.default.emitter.emit("log",n.type,n.logcat)}}}]),t}();n.default=h},{"../utils/logger.js":43,"../utils/logging-control.js":44,"./media-info.js":7,"./transmuxing-controller.js":12,"./transmuxing-events.js":13,"./transmuxing-worker.js":14,events:2,webworkify:4}],12:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=r(e("events")),s=r(e("../utils/logger.js")),o=r(e("../utils/browser.js")),u=r(e("./media-info.js")),l=r(e("../demux/flv-demuxer.js")),c=r(e("../remux/mp4-remuxer.js")),d=r(e("../demux/demux-errors.js")),h=r(e("../io/io-controller.js")),f=r(e("./transmuxing-events.js")),p=(e("../io/loader.js"),function(){function e(t,n){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.TAG="TransmuxingController",this._emitter=new a.default,this._config=n,t.segments||(t.segments=[{duration:t.duration,filesize:t.filesize,url:t.url}]),"boolean"!=typeof t.cors&&(t.cors=!0),"boolean"!=typeof t.withCredentials&&(t.withCredentials=!1),this._mediaDataSource=t,this._currentSegmentIndex=0;var r=0;this._mediaDataSource.segments.forEach((function(e){e.timestampBase=r,r+=e.duration,e.cors=t.cors,e.withCredentials=t.withCredentials,n.referrerPolicy&&(e.referrerPolicy=n.referrerPolicy)})),isNaN(r)||this._mediaDataSource.duration===r||(this._mediaDataSource.duration=r),this._mediaInfo=null,this._demuxer=null,this._remuxer=null,this._ioctl=null,this._pendingSeekTime=null,this._pendingResolveSeekPoint=null,this._statisticsReporter=null}return i(e,[{key:"destroy",value:function(){this._mediaInfo=null,this._mediaDataSource=null,this._statisticsReporter&&this._disableStatisticsReporter(),this._ioctl&&(this._ioctl.destroy(),this._ioctl=null),this._demuxer&&(this._demuxer.destroy(),this._demuxer=null),this._remuxer&&(this._remuxer.destroy(),this._remuxer=null),this._emitter&&this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(e,t){this._emitter.addListener(e,t)}},{key:"off",value:function(e,t){this._emitter.removeListener(e,t)}},{key:"start",value:function(){this._loadSegment(0),this._enableStatisticsReporter()}},{key:"_loadSegment",value:function(e,t){this._currentSegmentIndex=e;var n=this._mediaDataSource.segments[e],r=this._ioctl=new h.default(n,this._config,e);r.onError=this._onIOException.bind(this),r.onSeeked=this._onIOSeeked.bind(this),r.onComplete=this._onIOComplete.bind(this),r.onRedirect=this._onIORedirect.bind(this),r.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),t?this._demuxer.bindDataSource(this._ioctl):r.onDataArrival=this._onInitChunkArrival.bind(this),r.open(t)}},{key:"stop",value:function(){this._internalAbort(),this._disableStatisticsReporter()}},{key:"_internalAbort",value:function(){this._ioctl&&(this._ioctl.destroy(),this._ioctl=null)}},{key:"pause",value:function(){this._ioctl&&this._ioctl.isWorking()&&(this._ioctl.pause(),this._disableStatisticsReporter())}},{key:"resume",value:function(){this._ioctl&&this._ioctl.isPaused()&&(this._ioctl.resume(),this._enableStatisticsReporter())}},{key:"seek",value:function(e){if(null!=this._mediaInfo&&this._mediaInfo.isSeekable()){var t=this._searchSegmentIndexContains(e);if(t===this._currentSegmentIndex){var n=this._mediaInfo.segments[t];if(null==n)this._pendingSeekTime=e;else{var r=n.getNearestKeyframe(e);this._remuxer.seek(r.milliseconds),this._ioctl.seek(r.fileposition),this._pendingResolveSeekPoint=r.milliseconds}}else{var i=this._mediaInfo.segments[t];if(null==i)this._pendingSeekTime=e,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment(t);else{var a=i.getNearestKeyframe(e);this._internalAbort(),this._remuxer.seek(e),this._remuxer.insertDiscontinuity(),this._demuxer.resetMediaInfo(),this._demuxer.timestampBase=this._mediaDataSource.segments[t].timestampBase,this._loadSegment(t,a.fileposition),this._pendingResolveSeekPoint=a.milliseconds,this._reportSegmentMediaInfo(t)}}this._enableStatisticsReporter()}}},{key:"_searchSegmentIndexContains",value:function(e){for(var t=this._mediaDataSource.segments,n=t.length-1,r=0;r<t.length;r++)if(e<t[r].timestampBase){n=r-1;break}return n}},{key:"_onInitChunkArrival",value:function(e,t){var n=this,r=null,i=0;if(t>0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,i=this._demuxer.parseChunks(e,t);else if((r=l.default.probe(e)).match){this._demuxer=new l.default(r,this._config),this._remuxer||(this._remuxer=new c.default(this._config));var a=this._mediaDataSource;null==a.duration||isNaN(a.duration)||(this._demuxer.overridedDuration=a.duration),"boolean"==typeof a.hasAudio&&(this._demuxer.overridedHasAudio=a.hasAudio),"boolean"==typeof a.hasVideo&&(this._demuxer.overridedHasVideo=a.hasVideo),this._demuxer.timestampBase=a.segments[this._currentSegmentIndex].timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._demuxer.onMetaDataArrived=this._onMetaDataArrived.bind(this),this._demuxer.onScriptDataArrived=this._onScriptDataArrived.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this),i=this._demuxer.parseChunks(e,t)}else r=null,s.default.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then((function(){n._internalAbort()})),this._emitter.emit(f.default.DEMUX_ERROR,d.default.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),i=0;return i}},{key:"_onMediaInfo",value:function(e){var t=this;null==this._mediaInfo&&(this._mediaInfo=Object.assign({},e),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,u.default.prototype));var n=Object.assign({},e);Object.setPrototypeOf(n,u.default.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=n,this._reportSegmentMediaInfo(this._currentSegmentIndex),null!=this._pendingSeekTime&&Promise.resolve().then((function(){var e=t._pendingSeekTime;t._pendingSeekTime=null,t.seek(e)}))}},{key:"_onMetaDataArrived",value:function(e){this._emitter.emit(f.default.METADATA_ARRIVED,e)}},{key:"_onScriptDataArrived",value:function(e){this._emitter.emit(f.default.SCRIPTDATA_ARRIVED,e)}},{key:"_onIOSeeked",value:function(){this._remuxer.insertDiscontinuity()}},{key:"_onIOComplete",value:function(e){var t=e+1;t<this._mediaDataSource.segments.length?(this._internalAbort(),this._remuxer&&this._remuxer.flushStashedSamples(),this._loadSegment(t)):(this._remuxer&&this._remuxer.flushStashedSamples(),this._emitter.emit(f.default.LOADING_COMPLETE),this._disableStatisticsReporter())}},{key:"_onIORedirect",value:function(e){var t=this._ioctl.extraData;this._mediaDataSource.segments[t].redirectedURL=e}},{key:"_onIORecoveredEarlyEof",value:function(){this._emitter.emit(f.default.RECOVERED_EARLY_EOF)}},{key:"_onIOException",value:function(e,t){s.default.e(this.TAG,"IOException: type = "+e+", code = "+t.code+", msg = "+t.msg),this._emitter.emit(f.default.IO_ERROR,e,t),this._disableStatisticsReporter()}},{key:"_onDemuxException",value:function(e,t){s.default.e(this.TAG,"DemuxException: type = "+e+", info = "+t),this._emitter.emit(f.default.DEMUX_ERROR,e,t)}},{key:"_onRemuxerInitSegmentArrival",value:function(e,t){this._emitter.emit(f.default.INIT_SEGMENT,e,t)}},{key:"_onRemuxerMediaSegmentArrival",value:function(e,t){if(null==this._pendingSeekTime&&(this._emitter.emit(f.default.MEDIA_SEGMENT,e,t),null!=this._pendingResolveSeekPoint&&"video"===e)){var n=t.info.syncPoints,r=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,o.default.safari&&n.length>0&&n[0].originalDts===r&&(r=n[0].pts),this._emitter.emit(f.default.RECOMMEND_SEEKPOINT,r)}}},{key:"_enableStatisticsReporter",value:function(){null==this._statisticsReporter&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))}},{key:"_disableStatisticsReporter",value:function(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"_reportSegmentMediaInfo",value:function(e){var t=this._mediaInfo.segments[e],n=Object.assign({},t);n.duration=this._mediaInfo.duration,n.segmentCount=this._mediaInfo.segmentCount,delete n.segments,delete n.keyframesIndex,this._emitter.emit(f.default.MEDIA_INFO,n)}},{key:"_reportStatisticsInfo",value:function(){var e={};e.url=this._ioctl.currentURL,e.hasRedirect=this._ioctl.hasRedirect,e.hasRedirect&&(e.redirectedURL=this._ioctl.currentRedirectedURL),e.speed=this._ioctl.currentSpeed,e.loaderType=this._ioctl.loaderType,e.currentSegmentIndex=this._currentSegmentIndex,e.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(f.default.STATISTICS_INFO,e)}}]),e}());n.default=p},{"../demux/demux-errors.js":17,"../demux/flv-demuxer.js":19,"../io/io-controller.js":25,"../io/loader.js":26,"../remux/mp4-remuxer.js":40,"../utils/browser.js":41,"../utils/logger.js":43,"./media-info.js":7,"./transmuxing-events.js":13,events:2}],13:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});n.default={IO_ERROR:"io_error",DEMUX_ERROR:"demux_error",INIT_SEGMENT:"init_segment",MEDIA_SEGMENT:"media_segment",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info",RECOMMEND_SEEKPOINT:"recommend_seekpoint"}},{}],14:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0});var i=(r(e("../utils/logger.js")),e("../utils/logging-control.js")),a=r(i),s=r(e("../utils/polyfill.js")),o=r(e("./transmuxing-controller.js")),u=r(e("./transmuxing-events.js"));n.default=function(e){function t(t,n){var r={msg:u.default.INIT_SEGMENT,data:{type:t,data:n}};e.postMessage(r,[n.data])}function n(t,n){var r={msg:u.default.MEDIA_SEGMENT,data:{type:t,data:n}};e.postMessage(r,[n.data])}function r(){var t={msg:u.default.LOADING_COMPLETE};e.postMessage(t)}function i(){var t={msg:u.default.RECOVERED_EARLY_EOF};e.postMessage(t)}function l(t){var n={msg:u.default.MEDIA_INFO,data:t};e.postMessage(n)}function c(t){var n={msg:u.default.METADATA_ARRIVED,data:t};e.postMessage(n)}function d(t){var n={msg:u.default.SCRIPTDATA_ARRIVED,data:t};e.postMessage(n)}function h(t){var n={msg:u.default.STATISTICS_INFO,data:t};e.postMessage(n)}function f(t,n){e.postMessage({msg:u.default.IO_ERROR,data:{type:t,info:n}})}function p(t,n){e.postMessage({msg:u.default.DEMUX_ERROR,data:{type:t,info:n}})}function v(t){e.postMessage({msg:u.default.RECOMMEND_SEEKPOINT,data:t})}var m=null,g=function(t,n){e.postMessage({msg:"logcat_callback",data:{type:t,logcat:n}})}.bind(this);s.default.install(),e.addEventListener("message",(function(s){switch(s.data.cmd){case"init":(m=new o.default(s.data.param[0],s.data.param[1])).on(u.default.IO_ERROR,f.bind(this)),m.on(u.default.DEMUX_ERROR,p.bind(this)),m.on(u.default.INIT_SEGMENT,t.bind(this)),m.on(u.default.MEDIA_SEGMENT,n.bind(this)),m.on(u.default.LOADING_COMPLETE,r.bind(this)),m.on(u.default.RECOVERED_EARLY_EOF,i.bind(this)),m.on(u.default.MEDIA_INFO,l.bind(this)),m.on(u.default.METADATA_ARRIVED,c.bind(this)),m.on(u.default.SCRIPTDATA_ARRIVED,d.bind(this)),m.on(u.default.STATISTICS_INFO,h.bind(this)),m.on(u.default.RECOMMEND_SEEKPOINT,v.bind(this));break;case"destroy":m&&(m.destroy(),m=null),e.postMessage({msg:"destroyed"});break;case"start":m.start();break;case"stop":m.stop();break;case"seek":m.seek(s.data.param);break;case"pause":m.pause();break;case"resume":m.resume();break;case"logging_config":var y=s.data.param;a.default.applyConfig(y),!0===y.enableCallback?a.default.addLogListener(g):a.default.removeLogListener(g)}}))}},{"../utils/logger.js":43,"../utils/logging-control.js":44,"../utils/polyfill.js":45,"./transmuxing-controller.js":12,"./transmuxing-events.js":13}],15:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=r(e("../utils/logger.js")),s=r(e("../utils/utf8-conv.js")),o=e("../utils/exception.js"),u=function(){var e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),256===new Int16Array(e)[0]}(),l=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return i(e,null,[{key:"parseScriptData",value:function(t,n,r){var i={};try{var s=e.parseValue(t,n,r),o=e.parseValue(t,n+s.size,r-s.size);i[s.data]=o.data}catch(e){a.default.e("AMF",e.toString())}return i}},{key:"parseObject",value:function(t,n,r){if(r<3)throw new o.IllegalStateException("Data not enough when parse ScriptDataObject");var i=e.parseString(t,n,r),a=e.parseValue(t,n+i.size,r-i.size),s=a.objectEnd;return{data:{name:i.data,value:a.data},size:i.size+a.size,objectEnd:s}}},{key:"parseVariable",value:function(t,n,r){return e.parseObject(t,n,r)}},{key:"parseString",value:function(e,t,n){if(n<2)throw new o.IllegalStateException("Data not enough when parse String");var r=new DataView(e,t,n).getUint16(0,!u);return{data:r>0?(0,s.default)(new Uint8Array(e,t+2,r)):"",size:2+r}}},{key:"parseLongString",value:function(e,t,n){if(n<4)throw new o.IllegalStateException("Data not enough when parse LongString");var r=new DataView(e,t,n).getUint32(0,!u);return{data:r>0?(0,s.default)(new Uint8Array(e,t+4,r)):"",size:4+r}}},{key:"parseDate",value:function(e,t,n){if(n<10)throw new o.IllegalStateException("Data size invalid when parse Date");var r=new DataView(e,t,n),i=r.getFloat64(0,!u);return i+=60*r.getInt16(8,!u)*1e3,{data:new Date(i),size:10}}},{key:"parseValue",value:function(t,n,r){if(r<1)throw new o.IllegalStateException("Data not enough when parse Value");var i=new DataView(t,n,r),s=1,l=i.getUint8(0),c=void 0,d=!1;try{switch(l){case 0:c=i.getFloat64(1,!u),s+=8;break;case 1:c=!!i.getUint8(1),s+=1;break;case 2:var h=e.parseString(t,n+1,r-1);c=h.data,s+=h.size;break;case 3:c={};var f=0;for(9==(16777215&i.getUint32(r-4,!u))&&(f=3);s<r-4;){var p=e.parseObject(t,n+s,r-s-f);if(p.objectEnd)break;c[p.data.name]=p.data.value,s+=p.size}s<=r-3&&9==(16777215&i.getUint32(s-1,!u))&&(s+=3);break;case 8:c={},s+=4;var v=0;for(9==(16777215&i.getUint32(r-4,!u))&&(v=3);s<r-8;){var m=e.parseVariable(t,n+s,r-s-v);if(m.objectEnd)break;c[m.data.name]=m.data.value,s+=m.size}s<=r-3&&9==(16777215&i.getUint32(s-1,!u))&&(s+=3);break;case 9:c=void 0,s=1,d=!0;break;case 10:c=[];var g=i.getUint32(1,!u);s+=4;for(var y=0;y<g;y++){var _=e.parseValue(t,n+s,r-s);c.push(_.data),s+=_.size}break;case 11:var b=e.parseDate(t,n+1,r-1);c=b.data,s+=b.size;break;case 12:var T=e.parseString(t,n+1,r-1);c=T.data,s+=T.size;break;default:s=r,a.default.w("AMF","Unsupported AMF value type "+l)}}catch(e){a.default.e("AMF",e.toString())}return{data:c,size:s,objectEnd:d}}}]),e}();n.default=l},{"../utils/exception.js":42,"../utils/logger.js":43,"../utils/utf8-conv.js":47}],16:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(e){return e&&e.__esModule?e:{default:e}}(e("./exp-golomb.js")),a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,null,[{key:"parseOBUs",value:function(t){for(var n=null,r=0;r<t.byteLength;){var i=(t[r],(120&t[r])>>3),a=0!=(4&t[r]),s=0!=(2&t[r]);t[r],r+=1,a&&(r+=1);var o=Number.POSITIVE_INFINITY;if(s){o=0;for(var u=0;o|=(127&t[r])<<7*u,0!=(128&t[r+=1]);u++);}1===i&&(n=e.parseSeuqneceHeader(t.subarray(r,r+o))),r+=o}return n}},{key:"parseSeuqneceHeader",value:function(t){var n=new i.default(t),r=n.readBits(3),a=(n.readBool(),n.readBool()),s=!0,o=0,u=0,l=[];if(a)l.push({operating_point_idc:0,level:n.readBits(5),tier:0});else{if(n.readBool()){var c=n.readBits(32),d=n.readBits(32),h=n.readBool();if(h){for(var f=0,p=!0;p;){if(0!==n.readBits(1)){p=!1;break}f+=1}f>=32||n.readBits(f)}u=c,o=d,s=h,n.readBool()&&(n.readBits(5),n.readBits(32),n.readBits(5),n.readBits(5))}for(var v=n.readBool(),m=n.readBits(5),g=0;g<=m;g++){var y=n.readBits(12),_=n.readBits(5),b=_>7?n.readBits(1):0;l.push({operating_point_idc:y,level:_,tier:b}),v&&n.readBool()&&n.readBits(4)}}var T=l[0],S=T.level,E=T.tier,k=n.readBits(4),w=n.readBits(4),C=n.readBits(k+1)+1,A=n.readBits(w+1)+1,L=!1;a||(L=n.readBool()),L&&(n.readBits(4),n.readBits(4));var R=(n.readBool(),n.readBool(),n.readBool(),!1);a||(n.readBool(),n.readBool(),n.readBool(),n.readBool(),(R=n.readBool())&&(n.readBool(),n.readBool()),(n.readBool()||n.readBits(1))&&(n.readBool()||n.readBits(1)),R&&n.readBits(3));var x=(n.readBool(),n.readBool(),n.readBool(),n.readBool()),I=8;I=2===r&&x?n.readBool()?12:10:x?10:8;var O=!1;1!==r&&(O=n.readBool()),n.readBool()&&(n.readBits(8),n.readBits(8),n.readBits(8));var D=1,P=1;if(O)n.readBits(1),D=1,P=1;else{if(n.readBits(1),0==r)D=1,P=1;else if(1==r)D=0,P=0;else if(12==I){n.readBits(1)&&n.readBits(1)}else D=1,P=0;D&&P&&n.readBits(2),n.readBits(1)}return n.readBool(),n.destroy(),n=null,{codec_mimetype:"av01."+r+"."+e.getLevelString(S,E)+"."+I.toString(10).padStart(2,"0"),level:S,tier:E,level_string:e.getLevelString(S,E),profile_idc:r,profile_string:""+r,bit_depth:I,ref_frames:1,chroma_format:e.getChromaFormat(O,D,P),chroma_format_string:e.getChromaFormatString(O,D,P),frame_rate:{fixed:s,fps:o/u,fps_den:u,fps_num:o},sar_ratio:{width:1,height:1},codec_size:{width:C,height:A},present_size:{width:1*C,height:A}}}},{key:"getLevelString",value:function(e,t){return e.toString(10).padStart(2,"0")+(0===t?"M":"H")}},{key:"getChromaFormat",value:function(e,t,n){return e?0:0===t&&0===n?3:1===t&&0===n?2:1===t&&1===n?1:Number.NaN}},{key:"getChromaFormatString",value:function(e,t,n){return e?"4:0:0":0===t&&0===n?"4:4:4":1===t&&0===n?"4:2:2":1===t&&1===n?"4:2:0":"Unknown"}}]),e}();n.default=a},{"./exp-golomb.js":18}],17:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});n.default={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"}},{}],18:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=e("../utils/exception.js"),a=function(){function e(t){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.TAG="ExpGolomb",this._buffer=t,this._buffer_index=0,this._total_bytes=t.byteLength,this._total_bits=8*t.byteLength,this._current_word=0,this._current_word_bits_left=0}return r(e,[{key:"destroy",value:function(){this._buffer=null}},{key:"_fillCurrentWord",value:function(){var e=this._total_bytes-this._buffer_index;if(e<=0)throw new i.IllegalStateException("ExpGolomb: _fillCurrentWord() but no bytes available");var t=Math.min(4,e),n=new Uint8Array(4);n.set(this._buffer.subarray(this._buffer_index,this._buffer_index+t)),this._current_word=new DataView(n.buffer).getUint32(0,!1),this._buffer_index+=t,this._current_word_bits_left=8*t}},{key:"readBits",value:function(e){if(e>32)throw new i.InvalidArgumentException("ExpGolomb: readBits() bits exceeded max 32bits!");if(e<=this._current_word_bits_left){var t=this._current_word>>>32-e;return this._current_word<<=e,this._current_word_bits_left-=e,t}var n=this._current_word_bits_left?this._current_word:0;n>>>=32-this._current_word_bits_left;var r=e-this._current_word_bits_left;this._fillCurrentWord();var a=Math.min(r,this._current_word_bits_left),s=this._current_word>>>32-a;return this._current_word<<=a,this._current_word_bits_left-=a,n<<a|s}},{key:"readBool",value:function(){return 1===this.readBits(1)}},{key:"readByte",value:function(){return this.readBits(8)}},{key:"_skipLeadingZero",value:function(){var e=void 0;for(e=0;e<this._current_word_bits_left;e++)if(0!=(this._current_word&2147483648>>>e))return this._current_word<<=e,this._current_word_bits_left-=e,e;return this._fillCurrentWord(),e+this._skipLeadingZero()}},{key:"readUEG",value:function(){var e=this._skipLeadingZero();return this.readBits(e+1)-1}},{key:"readSEG",value:function(){var e=this.readUEG();return 1&e?e+1>>>1:-1*(e>>>1)}},{key:"getBitsLeft",value:function(){return 8*(this._total_bytes-this._buffer_index)+this._current_word_bits_left}}]),e}();n.default=a},{"../utils/exception.js":42}],19:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}Object.defineProperty(n,"__esModule",{value:!0});var 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},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=r(e("../utils/logger.js")),u=r(e("./amf-parser.js")),l=r(e("./sps-parser.js")),c=r(e("./hevc-sps-parser.js")),d=r(e("./av1-parser.js")),h=r(e("./demux-errors.js")),f=r(e("../core/media-info.js")),p=e("../utils/exception.js"),v=r(e("../utils/typedarray-equality.js")),m=function(){function e(t,n){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.TAG="FLVDemuxer",this._config=n,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=t.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=t.hasAudioTrack,this._hasVideo=t.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new f.default,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=function(){var e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),256===new Int16Array(e)[0]}()}return s(e,[{key:"destroy",value:function(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null}},{key:"bindDataSource",value:function(e){return e.onDataArrival=this.parseChunks.bind(this),this}},{key:"resetMediaInfo",value:function(){this._mediaInfo=new f.default}},{key:"_isInitialMetadataDispatched",value:function(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!(this._hasAudio||!this._hasVideo)&&this._videoInitialMetadataDispatched}},{key:"parseChunks",value:function(t,n){if(!(this._onError&&this._onMediaInfo&&this._onTrackMetadata&&this._onDataAvailable))throw new p.IllegalStateException("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var r=0,i=this._littleEndian;if(0===n){if(!(t.byteLength>13))return 0;r=e.probe(t).dataOffset}for(this._firstParse&&(this._firstParse=!1,n+r!==this._dataOffset&&o.default.w(this.TAG,"First time parsing but chunk byteStart invalid!"),0!==new DataView(t,r).getUint32(0,!i)&&o.default.w(this.TAG,"PrevTagSize0 !== 0 !!!"),r+=4);r<t.byteLength;){this._dispatch=!0;var a=new DataView(t,r);if(r+11+4>t.byteLength)break;var s=a.getUint8(0),u=16777215&a.getUint32(0,!i);if(r+11+u+4>t.byteLength)break;if(8===s||9===s||18===s){var l=a.getUint8(4),c=a.getUint8(5),d=a.getUint8(6)|c<<8|l<<16|a.getUint8(7)<<24;0!=(16777215&a.getUint32(7,!i))&&o.default.w(this.TAG,"Meet tag which has StreamID != 0!");var h=r+11;switch(s){case 8:this._parseAudioData(t,h,u,d);break;case 9:this._parseVideoData(t,h,u,d,n+r);break;case 18:this._parseScriptData(t,h,u)}var f=a.getUint32(11+u,!i);f!==11+u&&o.default.w(this.TAG,"Invalid PrevTagSize "+f),r+=11+u+4}else o.default.w(this.TAG,"Unsupported tag type "+s+", skipped"),r+=11+u+4}return this._isInitialMetadataDispatched()&&this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack),r}},{key:"_parseScriptData",value:function(e,t,n){var r=u.default.parseScriptData(e,t,n);if(r.hasOwnProperty("onMetaData")){if(null==r.onMetaData||"object"!==a(r.onMetaData))return void o.default.w(this.TAG,"Invalid onMetaData structure!");this._metadata&&o.default.w(this.TAG,"Found another onMetaData tag!"),this._metadata=r;var i=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},i)),"boolean"==typeof i.hasAudio&&!1===this._hasAudioFlagOverrided&&(this._hasAudio=i.hasAudio,this._mediaInfo.hasAudio=this._hasAudio),"boolean"==typeof i.hasVideo&&!1===this._hasVideoFlagOverrided&&(this._hasVideo=i.hasVideo,this._mediaInfo.hasVideo=this._hasVideo),"number"==typeof i.audiodatarate&&(this._mediaInfo.audioDataRate=i.audiodatarate),"number"==typeof i.videodatarate&&(this._mediaInfo.videoDataRate=i.videodatarate),"number"==typeof i.width&&(this._mediaInfo.width=i.width),"number"==typeof i.height&&(this._mediaInfo.height=i.height),"number"==typeof i.duration){if(!this._durationOverrided){var s=Math.floor(i.duration*this._timescale);this._duration=s,this._mediaInfo.duration=s}}else this._mediaInfo.duration=0;if("number"==typeof i.framerate){var l=Math.floor(1e3*i.framerate);if(l>0){var c=l/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=c,this._referenceFrameRate.fps_num=l,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=c}}if("object"===a(i.keyframes)){this._mediaInfo.hasKeyframesIndex=!0;var d=i.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(d),i.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=i,o.default.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(r).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},r))}},{key:"_parseKeyframesIndex",value:function(e){for(var t=[],n=[],r=1;r<e.times.length;r++){var i=this._timestampBase+Math.floor(1e3*e.times[r]);t.push(i),n.push(e.filepositions[r])}return{times:t,filepositions:n}}},{key:"_parseAudioData",value:function(e,t,n,r){if(n<=1)o.default.w(this.TAG,"Flv: Invalid audio packet, missing SoundData payload!");else if(!0!==this._hasAudioFlagOverrided||!1!==this._hasAudio){var a=(this._littleEndian,new DataView(e,t,n)).getUint8(0),s=a>>>4;if(9!==s){if(2!==s&&10!==s)return void this._onError(h.default.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+s);var u,l=(12&a)>>>2;if(!(l>=0&&l<=4))return void this._onError(h.default.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+l);u=this._flvSoundRateTable[l];var c=1&a,d=this._audioMetadata,f=this._audioTrack;if(d||(!1===this._hasAudio&&!1===this._hasAudioFlagOverrided&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),(d=this._audioMetadata={}).type="audio",d.id=f.id,d.timescale=this._timescale,d.duration=this._duration,d.audioSampleRate=u,d.channelCount=0===c?1:2),10===s){var p=this._parseAACAudioData(e,t+1,n-1);if(null==p)return;if(0===p.packetType){if(d.config){if((0,v.default)(p.data.config,d.config))return void o.default.w(this.TAG,"Found another AudioSpecificConfig!");o.default.w(this.TAG,"AudioSpecificConfig has been changed, re-generate initialization segment")}var m=p.data;d.audioSampleRate=m.samplingRate,d.channelCount=m.channelCount,d.codec=m.codec,d.originalCodec=m.originalCodec,d.config=m.config,d.refSampleDuration=1024/d.audioSampleRate*d.timescale,o.default.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",d);var g=this._mediaInfo;g.audioCodec=d.originalCodec,g.audioSampleRate=d.audioSampleRate,g.audioChannelCount=d.channelCount,g.hasVideo?null!=g.videoCodec&&(g.mimeType='video/x-flv; codecs="'+g.videoCodec+","+g.audioCodec+'"'):g.mimeType='video/x-flv; codecs="'+g.audioCodec+'"',g.isComplete()&&this._onMediaInfo(g)}else if(1===p.packetType){var y=this._timestampBase+r,_={unit:p.data,length:p.data.byteLength,dts:y,pts:y};f.samples.push(_),f.length+=p.data.length}else o.default.e(this.TAG,"Flv: Unsupported AAC data type "+p.packetType)}else if(2===s){if(!d.codec){var b=this._parseMP3AudioData(e,t+1,n-1,!0);if(null==b)return;d.audioSampleRate=b.samplingRate,d.channelCount=b.channelCount,d.codec=b.codec,d.originalCodec=b.originalCodec,d.refSampleDuration=1152/d.audioSampleRate*d.timescale,o.default.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",d);var T=this._mediaInfo;T.audioCodec=d.codec,T.audioSampleRate=d.audioSampleRate,T.audioChannelCount=d.channelCount,T.audioDataRate=b.bitRate,T.hasVideo?null!=T.videoCodec&&(T.mimeType='video/x-flv; codecs="'+T.videoCodec+","+T.audioCodec+'"'):T.mimeType='video/x-flv; codecs="'+T.audioCodec+'"',T.isComplete()&&this._onMediaInfo(T)}var S=this._parseMP3AudioData(e,t+1,n-1,!1);if(null==S)return;var E=this._timestampBase+r,k={unit:S,length:S.byteLength,dts:E,pts:E};f.samples.push(k),f.length+=S.length}}else{if(n<=5)return void o.default.w(this.TAG,"Flv: Invalid audio packet, missing AudioFourCC in Ehnanced FLV payload!");var w=15&a,C=String.fromCharCode.apply(String,i(new Uint8Array(e,t,n).slice(1,5)));switch(C){case"Opus":this._parseOpusAudioPacket(e,t+5,n-5,r,w);break;default:this._onError(h.default.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec: "+C)}}}}},{key:"_parseAACAudioData",value:function(e,t,n){if(!(n<=1)){var r={},i=new Uint8Array(e,t,n);return r.packetType=i[0],0===i[0]?r.data=this._parseAACAudioSpecificConfig(e,t+1,n-1):r.data=i.subarray(1),r}o.default.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!")}},{key:"_parseAACAudioSpecificConfig",value:function(e,t,n){var r,i,a=new Uint8Array(e,t,n),s=null,o=0,u=null;if(o=r=a[0]>>>3,(i=(7&a[0])<<1|a[1]>>>7)<0||i>=this._mpegSamplingRates.length)this._onError(h.default.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");else{var l=this._mpegSamplingRates[i],c=(120&a[1])>>>3;if(!(c<0||c>=8)){5===o&&(u=(7&a[1])<<1|a[2]>>>7,a[2]);var d=self.navigator.userAgent.toLowerCase();return-1!==d.indexOf("firefox")?i>=6?(o=5,s=new Array(4),u=i-3):(o=2,s=new Array(2),u=i):-1!==d.indexOf("android")?(o=2,s=new Array(2),u=i):(o=5,u=i,s=new Array(4),i>=6?u=i-3:1===c&&(o=2,s=new Array(2),u=i)),s[0]=o<<3,s[0]|=(15&i)>>>1,s[1]=(15&i)<<7,s[1]|=(15&c)<<3,5===o&&(s[1]|=(15&u)>>>1,s[2]=(1&u)<<7,s[2]|=8,s[3]=0),{config:s,samplingRate:l,channelCount:c,codec:"mp4a.40."+o,originalCodec:"mp4a.40."+r}}this._onError(h.default.FORMAT_ERROR,"Flv: AAC invalid channel configuration")}}},{key:"_parseMP3AudioData",value:function(e,t,n,r){if(!(n<4)){var i=(this._littleEndian,new Uint8Array(e,t,n)),a=null;if(r){if(255!==i[0])return;var s=i[1]>>>3&3,u=(6&i[1])>>1,l=(240&i[2])>>>4,c=(12&i[2])>>>2,d=3!==(i[3]>>>6&3)?2:1,h=0,f=0;switch(s){case 0:h=this._mpegAudioV25SampleRateTable[c];break;case 2:h=this._mpegAudioV20SampleRateTable[c];break;case 3:h=this._mpegAudioV10SampleRateTable[c]}switch(u){case 1:l<this._mpegAudioL3BitRateTable.length&&(f=this._mpegAudioL3BitRateTable[l]);break;case 2:l<this._mpegAudioL2BitRateTable.length&&(f=this._mpegAudioL2BitRateTable[l]);break;case 3:l<this._mpegAudioL1BitRateTable.length&&(f=this._mpegAudioL1BitRateTable[l])}a={bitRate:f,samplingRate:h,channelCount:d,codec:"mp3",originalCodec:"mp3"}}else a=i;return a}o.default.w(this.TAG,"Flv: Invalid MP3 packet, header missing!")}},{key:"_parseOpusAudioPacket",value:function(e,t,n,r,i){if(0===i)this._parseOpusSequenceHeader(e,t,n);else if(1===i)this._parseOpusAudioData(e,t,n,r);else if(2!==i)return void this._onError(h.default.FORMAT_ERROR,"Flv: Invalid video packet type "+i)}},{key:"_parseOpusSequenceHeader",value:function(e,t,n){if(n<=16)o.default.w(this.TAG,"Flv: Invalid OpusSequenceHeader, lack of data!");else{var r=this._audioMetadata,i=this._audioTrack;r||(!1===this._hasAudio&&!1===this._hasAudioFlagOverrided&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),(r=this._audioMetadata={}).type="audio",r.id=i.id,r.timescale=this._timescale,r.duration=this._duration);var a=new DataView(e,t,n);a.setUint8(8,0);var s=a.getUint8(9);a.setUint16(10,a.getUint16(10,!0),!1);var u=a.getUint32(12,!0);a.setUint32(12,a.getUint32(12,!0),!1);var l={config:new Uint8Array(e,t+8,n-8),channelCount:s,samplingFrequence:u,codec:"opus",originalCodec:"opus"};if(r.config){if((0,v.default)(l.config,r.config))return void o.default.w(this.TAG,"Found another OpusSequenceHeader!");o.default.w(this.TAG,"OpusSequenceHeader has been changed, re-generate initialization segment")}r.audioSampleRate=l.samplingFrequence,r.channelCount=l.channelCount,r.codec=l.codec,r.originalCodec=l.originalCodec,r.config=l.config,r.refSampleDuration=20,o.default.v(this.TAG,"Parsed OpusSequenceHeader"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",r);var c=this._mediaInfo;c.audioCodec=r.originalCodec,c.audioSampleRate=r.audioSampleRate,c.audioChannelCount=r.channelCount,c.hasVideo?null!=c.videoCodec&&(c.mimeType='video/x-flv; codecs="'+c.videoCodec+","+c.audioCodec+'"'):c.mimeType='video/x-flv; codecs="'+c.audioCodec+'"',c.isComplete()&&this._onMediaInfo(c)}}},{key:"_parseOpusAudioData",value:function(e,t,n,r){var i=this._audioTrack,a=new Uint8Array(e,t,n),s=this._timestampBase+r,o={unit:a,length:a.byteLength,dts:s,pts:s};i.samples.push(o),i.length+=a.length}},{key:"_parseVideoData",value:function(e,t,n,r,a){if(n<=1)o.default.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");else if(!0!==this._hasVideoFlagOverrided||!1!==this._hasVideo){var s=new Uint8Array(e,t,n)[0],u=(112&s)>>>4;if(0!=(128&s)){var l=15&s,c=String.fromCharCode.apply(String,i(new Uint8Array(e,t,n).slice(1,5)));if("hvc1"===c)this._parseEnhancedHEVCVideoPacket(e,t+5,n-5,r,a,u,l);else{if("av01"!==c)return void this._onError(h.default.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: "+c);this._parseEnhancedAV1VideoPacket(e,t+5,n-5,r,a,u,l)}}else{var d=15&s;if(7===d)this._parseAVCVideoPacket(e,t+1,n-1,r,a,u);else{if(12!==d)return void this._onError(h.default.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: "+d);this._parseHEVCVideoPacket(e,t+1,n-1,r,a,u)}}}}},{key:"_parseAVCVideoPacket",value:function(e,t,n,r,i,a){if(n<4)o.default.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");else{var s=this._littleEndian,u=new DataView(e,t,n),l=u.getUint8(0),c=(16777215&u.getUint32(0,!s))<<8>>8;if(0===l)this._parseAVCDecoderConfigurationRecord(e,t+4,n-4);else if(1===l)this._parseAVCVideoData(e,t+4,n-4,r,i,a,c);else if(2!==l)return void this._onError(h.default.FORMAT_ERROR,"Flv: Invalid video packet type "+l)}}},{key:"_parseAVCDecoderConfigurationRecord",value:function(e,t,n){if(n<7)o.default.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");else{var r=this._videoMetadata,i=this._videoTrack,a=this._littleEndian,s=new DataView(e,t,n);if(r){if(void 0!==r.avcc){var u=new Uint8Array(e,t,n);if((0,v.default)(u,r.avcc))return void o.default.w(this.TAG,"Found another AVCDecoderConfigurationRecord!");o.default.w(this.TAG,"AVCDecoderConfigurationRecord has been changed, re-generate initialization segment")}}else!1===this._hasVideo&&!1===this._hasVideoFlagOverrided&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),(r=this._videoMetadata={}).type="video",r.id=i.id,r.timescale=this._timescale,r.duration=this._duration;var c=s.getUint8(0),d=s.getUint8(1);if(s.getUint8(2),s.getUint8(3),1===c&&0!==d)if(this._naluLengthSize=1+(3&s.getUint8(4)),3===this._naluLengthSize||4===this._naluLengthSize){var f=31&s.getUint8(5);if(0!==f){f>1&&o.default.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = "+f);for(var p=6,m=0;m<f;m++){var g=s.getUint16(p,!a);if(p+=2,0!==g){var y=new Uint8Array(e,t+p,g);p+=g;var _=l.default.parseSPS(y);if(0===m){r.codecWidth=_.codec_size.width,r.codecHeight=_.codec_size.height,r.presentWidth=_.present_size.width,r.presentHeight=_.present_size.height,r.profile=_.profile_string,r.level=_.level_string,r.bitDepth=_.bit_depth,r.chromaFormat=_.chroma_format,r.sarRatio=_.sar_ratio,r.frameRate=_.frame_rate,!1!==_.frame_rate.fixed&&0!==_.frame_rate.fps_num&&0!==_.frame_rate.fps_den||(r.frameRate=this._referenceFrameRate);var b=r.frameRate.fps_den,T=r.frameRate.fps_num;r.refSampleDuration=r.timescale*(b/T);for(var S=y.subarray(1,4),E="avc1.",k=0;k<3;k++){var w=S[k].toString(16);w.length<2&&(w="0"+w),E+=w}r.codec=E;var C=this._mediaInfo;C.width=r.codecWidth,C.height=r.codecHeight,C.fps=r.frameRate.fps,C.profile=r.profile,C.level=r.level,C.refFrames=_.ref_frames,C.chromaFormat=_.chroma_format_string,C.sarNum=r.sarRatio.width,C.sarDen=r.sarRatio.height,C.videoCodec=E,C.hasAudio?null!=C.audioCodec&&(C.mimeType='video/x-flv; codecs="'+C.videoCodec+","+C.audioCodec+'"'):C.mimeType='video/x-flv; codecs="'+C.videoCodec+'"',C.isComplete()&&this._onMediaInfo(C)}}}var A=s.getUint8(p);if(0!==A){A>1&&o.default.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = "+A),p++;for(var L=0;L<A;L++){var R=s.getUint16(p,!a);p+=2,0!==R&&(p+=R)}r.avcc=new Uint8Array(n),r.avcc.set(new Uint8Array(e,t,n),0),o.default.v(this.TAG,"Parsed AVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("video",r)}else this._onError(h.default.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No PPS")}else this._onError(h.default.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS")}else this._onError(h.default.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: "+(this._naluLengthSize-1));else this._onError(h.default.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord")}}},{key:"_parseAVCVideoData",value:function(e,t,n,r,i,a,s){for(var u=this._littleEndian,l=new DataView(e,t,n),c=[],d=0,h=0,f=this._naluLengthSize,p=this._timestampBase+r,v=1===a;h<n;){if(h+4>=n){o.default.w(this.TAG,"Malformed Nalu near timestamp "+p+", offset = "+h+", dataSize = "+n);break}var m=l.getUint32(h,!u);if(3===f&&(m>>>=8),m>n-f)return void o.default.w(this.TAG,"Malformed Nalus near timestamp "+p+", NaluSize > DataSize!");var g=31&l.getUint8(h+f);5===g&&(v=!0);var y=new Uint8Array(e,t+h,f+m),_={type:g,data:y};c.push(_),d+=y.byteLength,h+=f+m}if(c.length){var b=this._videoTrack,T={units:c,length:d,isKeyframe:v,dts:p,cts:s,pts:p+s};v&&(T.fileposition=i),b.samples.push(T),b.length+=d}}},{key:"_parseHEVCVideoPacket",value:function(e,t,n,r,i,a){if(n<4)o.default.w(this.TAG,"Flv: Invalid HEVC packet, missing HEVCPacketType or/and CompositionTime");else{var s=this._littleEndian,u=new DataView(e,t,n),l=u.getUint8(0),c=(16777215&u.getUint32(0,!s))<<8>>8;if(0===l)this._parseHEVCDecoderConfigurationRecord(e,t+4,n-4);else if(1===l)this._parseHEVCVideoData(e,t+4,n-4,r,i,a,c);else if(2!==l)return void this._onError(h.default.FORMAT_ERROR,"Flv: Invalid video packet type "+l)}}},{key:"_parseEnhancedHEVCVideoPacket",value:function(e,t,n,r,i,a,s){var o=this._littleEndian,u=new DataView(e,t,n);if(0===s)this._parseHEVCDecoderConfigurationRecord(e,t,n);else if(1===s){var l=(4294967040&u.getUint32(0,!o))>>8;this._parseHEVCVideoData(e,t+3,n-3,r,i,a,l)}else if(3===s)this._parseHEVCVideoData(e,t,n,r,i,a,0);else if(2!==s)return void this._onError(h.default.FORMAT_ERROR,"Flv: Invalid video packet type "+s)}},{key:"_parseHEVCDecoderConfigurationRecord",value:function(e,t,n){if(n<23)o.default.w(this.TAG,"Flv: Invalid HEVCDecoderConfigurationRecord, lack of data!");else{var r=this._videoMetadata,i=this._videoTrack,a=this._littleEndian,s=new DataView(e,t,n);if(r){if(void 0!==r.hvcc){var u=new Uint8Array(e,t,n);if((0,v.default)(u,r.hvcc))return void o.default.w(this.TAG,"Found another HEVCDecoderConfigurationRecord!");o.default.w(this.TAG,"HEVCDecoderConfigurationRecord has been changed, re-generate initialization segment")}}else!1===this._hasVideo&&!1===this._hasVideoFlagOverrided&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),(r=this._videoMetadata={}).type="video",r.id=i.id,r.timescale=this._timescale,r.duration=this._duration;var l=s.getUint8(0),d=31&s.getUint8(1);if(0!==l&&1!==l||0===d)this._onError(h.default.FORMAT_ERROR,"Flv: Invalid HEVCDecoderConfigurationRecord");else if(this._naluLengthSize=1+(3&s.getUint8(21)),3===this._naluLengthSize||4===this._naluLengthSize){for(var f=s.getUint8(22),p=void 0,m=void 0,g=void 0,y=[],_=0,b=23;_<f;_++){var T=63&s.getUint8(b++),S=s.getUint16(b,!a);if(b+=2,0!==S){switch(T){case 32:p+=S;break;case 33:m+=S;break;case 34:g+=S}for(var E=0;E<S;E++){var k=s.getUint16(b,!a);if(b+=2,0!==k){if(33===T){var w=new Uint8Array(e,t+b,k);y.push(w)}b+=k}}}}if(0!==p)if(p>1&&o.default.w(this.TAG,"Flv: Strange HEVCDecoderConfigurationRecord: VPS Count = "+p),0!==m)if(m>1&&o.default.w(this.TAG,"Flv: Strange HEVCDecoderConfigurationRecord: SPS Count = "+m),0!==g){g>1&&o.default.w(this.TAG,"Flv: Strange HEVCDecoderConfigurationRecord: PPS Count = "+m);var C=y[0],A=c.default.parseSPS(C);r.codecWidth=A.codec_size.width,r.codecHeight=A.codec_size.height,r.presentWidth=A.present_size.width,r.presentHeight=A.present_size.height,r.profile=A.profile_string,r.level=A.level_string,r.profile_idc=A.profile_idc,r.level_idc=A.level_idc,r.bitDepth=A.bit_depth,r.chromaFormat=A.chroma_format,r.sarRatio=A.sar_ratio,r.frameRate=A.frame_rate,!1!==A.frame_rate.fixed&&0!==A.frame_rate.fps_num&&0!==A.frame_rate.fps_den||(r.frameRate=this._referenceFrameRate);var L=r.frameRate.fps_den,R=r.frameRate.fps_num;r.refSampleDuration=r.timescale*(L/R),r.codec=A.codec_mimetype;var x=this._mediaInfo;x.width=r.codecWidth,x.height=r.codecHeight,x.fps=r.frameRate.fps,x.profile=r.profile,x.level=r.level,x.refFrames=A.ref_frames,x.chromaFormat=A.chroma_format_string,x.sarNum=r.sarRatio.width,x.sarDen=r.sarRatio.height,x.videoCodec=A.codec_mimetype,x.hasAudio?null!=x.audioCodec&&(x.mimeType='video/x-flv; codecs="'+x.videoCodec+","+x.audioCodec+'"'):x.mimeType='video/x-flv; codecs="'+x.videoCodec+'"',x.isComplete()&&this._onMediaInfo(x),r.hvcc=new Uint8Array(n),r.hvcc.set(new Uint8Array(e,t,n),0),o.default.v(this.TAG,"Parsed HEVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("video",r)}else this._onError(h.default.FORMAT_ERROR,"Flv: Invalid HEVCDecoderConfigurationRecord: No PPS");else this._onError(h.default.FORMAT_ERROR,"Flv: Invalid HEVCDecoderConfigurationRecord: No SPS");else this._onError(h.default.FORMAT_ERROR,"Flv: Invalid HEVCDecoderConfigurationRecord: No VPS")}else this._onError(h.default.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: "+(this._naluLengthSize-1))}}},{key:"_parseHEVCVideoData",value:function(e,t,n,r,i,a,s){for(var u=this._littleEndian,l=new DataView(e,t,n),c=[],d=0,h=0,f=this._naluLengthSize,p=this._timestampBase+r,v=1===a;h<n;){if(h+4>=n){o.default.w(this.TAG,"Malformed Nalu near timestamp "+p+", offset = "+h+", dataSize = "+n);break}var m=l.getUint32(h,!u);if(3===f&&(m>>>=8),m>n-f)return void o.default.w(this.TAG,"Malformed Nalus near timestamp "+p+", NaluSize > DataSize!");var g=l.getUint8(h+f)>>1&63;g>=16&&g<=23&&(v=!0);var y=new Uint8Array(e,t+h,f+m),_={type:g,data:y};c.push(_),d+=y.byteLength,h+=f+m}if(c.length){var b=this._videoTrack,T={units:c,length:d,isKeyframe:v,dts:p,cts:s,pts:p+s};v&&(T.fileposition=i),b.samples.push(T),b.length+=d}}},{key:"_parseAV1CodecConfigurationRecord",value:function(e,t,n){if(n<4)o.default.w(this.TAG,"Flv: Invalid AV1CodecConfigurationRecord, lack of data!");else{var r=this._videoMetadata,i=this._videoTrack,a=(this._littleEndian,new DataView(e,t,n));if(r){if(void 0!==r.av1c){var s=new Uint8Array(e,t,n);if((0,v.default)(s,r.av1c))return void o.default.w(this.TAG,"Found another AV1CodecConfigurationRecord!");o.default.w(this.TAG,"AV1CodecConfigurationRecord has been changed, re-generate initialization segment")}}else!1===this._hasVideo&&!1===this._hasVideoFlagOverrided&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),(r=this._videoMetadata={}).type="video",r.id=i.id,r.timescale=this._timescale,r.duration=this._duration;var u=127&a.getUint8(0);if(a.getUint8(1),a.getUint8(1),a.getUint8(2),1===u){var l=d.default.parseOBUs(new Uint8Array(e,t+4,n-4));if(null!=l){r.codecWidth=l.codec_size.width,r.codecHeight=l.codec_size.height,r.presentWidth=l.present_size.width,r.presentHeight=l.present_size.height,r.profile=l.profile_string,r.level=l.level_string,r.bitDepth=l.bit_depth,r.chromaFormat=l.chroma_format,r.sarRatio=l.sar_ratio,r.frameRate=l.frame_rate,!1!==l.frame_rate.fixed&&0!==l.frame_rate.fps_num&&0!==l.frame_rate.fps_den||(r.frameRate=this._referenceFrameRate);var c=r.frameRate.fps_den,f=r.frameRate.fps_num;r.refSampleDuration=r.timescale*(c/f),r.codec=l.codec_mimetype;var p=this._mediaInfo;p.width=r.codecWidth,p.height=r.codecHeight,p.fps=r.frameRate.fps,p.profile=r.profile,p.level=r.level,p.refFrames=l.ref_frames,p.chromaFormat=l.chroma_format_string,p.sarNum=r.sarRatio.width,p.sarDen=r.sarRatio.height,p.videoCodec=l.codec_mimetype,p.hasAudio?null!=p.audioCodec&&(p.mimeType='video/x-flv; codecs="'+p.videoCodec+","+p.audioCodec+'"'):p.mimeType='video/x-flv; codecs="'+p.videoCodec+'"',p.isComplete()&&this._onMediaInfo(p),r.av1c=new Uint8Array(n),r.av1c.set(new Uint8Array(e,t,n),0),o.default.v(this.TAG,"Parsed AV1CodecConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("video",r)}else this._onError(h.default.FORMAT_ERROR,"Flv: Invalid AV1CodecConfigurationRecord")}else this._onError(h.default.FORMAT_ERROR,"Flv: Invalid AV1CodecConfigurationRecord")}}},{key:"_parseAV1VideoData",value:function(e,t,n,r,i,a,s){var o,u=(this._littleEndian,[]),l=this._timestampBase+r,c=1===a;if(o=n,u.push({unitType:0,data:new Uint8Array(e,t+0,n)}),u.length){var d=this._videoTrack,h={units:u,length:o,isKeyframe:c,dts:l,cts:s,pts:l+s};c&&(h.fileposition=i),d.samples.push(h),d.length+=o}}},{key:"_parseEnhancedAV1VideoPacket",value:function(e,t,n,r,i,a,s){if(this._littleEndian,new DataView(e,t,n),0===s)this._parseAV1CodecConfigurationRecord(e,t,n);else if(1===s)this._parseAV1VideoData(e,t,n,r,i,a,0);else{if(5===s)return void this._onError(h.default.FORMAT_ERROR,"Flv: Not Supported MP2T AV1 video packet type "+s);if(2!==s)return void this._onError(h.default.FORMAT_ERROR,"Flv: Invalid video packet type "+s)}}},{key:"onTrackMetadata",get:function(){return this._onTrackMetadata},set:function(e){this._onTrackMetadata=e}},{key:"onMediaInfo",get:function(){return this._onMediaInfo},set:function(e){this._onMediaInfo=e}},{key:"onMetaDataArrived",get:function(){return this._onMetaDataArrived},set:function(e){this._onMetaDataArrived=e}},{key:"onScriptDataArrived",get:function(){return this._onScriptDataArrived},set:function(e){this._onScriptDataArrived=e}},{key:"onError",get:function(){return this._onError},set:function(e){this._onError=e}},{key:"onDataAvailable",get:function(){return this._onDataAvailable},set:function(e){this._onDataAvailable=e}},{key:"timestampBase",get:function(){return this._timestampBase},set:function(e){this._timestampBase=e}},{key:"overridedDuration",get:function(){return this._duration},set:function(e){this._durationOverrided=!0,this._duration=e,this._mediaInfo.duration=e}},{key:"overridedHasAudio",set:function(e){this._hasAudioFlagOverrided=!0,this._hasAudio=e,this._mediaInfo.hasAudio=e}},{key:"overridedHasVideo",set:function(e){this._hasVideoFlagOverrided=!0,this._hasVideo=e,this._mediaInfo.hasVideo=e}}],[{key:"probe",value:function(e){var t=new Uint8Array(e);if(t.byteLength<9)return{needMoreData:!0};var n={match:!1};if(70!==t[0]||76!==t[1]||86!==t[2]||1!==t[3])return n;var r=(4&t[4])>>>2!=0,i=0!=(1&t[4]),a=function(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}(t,5);return a<9?n:{match:!0,consumed:a,dataOffset:a,hasAudioTrack:r,hasVideoTrack:i}}}]),e}();n.default=m},{"../core/media-info.js":7,"../utils/exception.js":42,"../utils/logger.js":43,"../utils/typedarray-equality.js":46,"./amf-parser.js":15,"./av1-parser.js":16,"./demux-errors.js":17,"./hevc-sps-parser.js":20,"./sps-parser.js":21}],20:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=r(e("./exp-golomb.js")),s=r(e("./sps-parser.js")),o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return i(e,null,[{key:"parseSPS",value:function(t){var n=s.default._ebsp2rbsp(t),r=new a.default(n),i={};r.readBits(16),r.readBits(4);var o=r.readBits(3);r.readBits(1),e._hvcc_parse_ptl(r,i,o),r.readUEG();var u=0,l=r.readUEG();3==l&&(u=r.readBits(1)),i.sar_width=i.sar_height=1,i.conf_win_left_offset=i.conf_win_right_offset=i.conf_win_top_offset=i.conf_win_bottom_offset=0,i.def_disp_win_left_offset=i.def_disp_win_right_offset=i.def_disp_win_top_offset=i.def_disp_win_bottom_offset=0;var c=r.readUEG(),d=r.readUEG();r.readBits(1)&&(i.conf_win_left_offset=r.readUEG(),i.conf_win_right_offset=r.readUEG(),i.conf_win_top_offset=r.readUEG(),i.conf_win_bottom_offset=r.readUEG(),1===i.default_display_window_flag&&(i.conf_win_left_offset,i.def_disp_win_left_offset,i.conf_win_right_offset,i.def_disp_win_right_offset,i.conf_win_top_offset,i.def_disp_win_top_offset,i.conf_win_bottom_offset,i.def_disp_win_bottom_offset));var h=r.readUEG()+8;r.readUEG();for(var f=r.readUEG(),p=r.readBits(1)?0:o;p<=o;p++)e._skip_sub_layer_ordering_info(r);r.readUEG(),r.readUEG(),r.readUEG(),r.readUEG(),r.readUEG(),r.readUEG(),r.readBits(1)&&r.readBits(1)&&e._skip_scaling_list_data(r),r.readBits(1),r.readBits(1),r.readBits(1)&&(r.readBits(4),r.readBits(4),r.readUEG(),r.readUEG(),r.readBits(1));var v=[],m=r.readUEG();for(p=0;p<m;p++)if(e._parse_rps(r,p,m,v)<0)return null;if(r.readBits(1)){var g=r.readUEG();if(g>31)return null;for(p=0;p<g;p++){var y=Math.min(f+4,16);if(y>32){for(var _=y/32,b=y%32,T=0;T<_;T++)r.readBits(32);r.readBits(b)}else r.readBits(y);r.readBits(1)}}r.readBits(1),r.readBits(1),r.readBits(1)&&e._hvcc_parse_vui(r,i,o);var S="hvc1."+i.profile_idc+".1.L"+i.level_idc+".B0",E=e.getProfileString(i.profile_idc),k=e.getLevelString(i.level_idc),w=1;1===i.sar_width&&1===i.sar_height||(w=i.sar_width/i.sar_height);var C=c,A=d,L=1===l&&0===u?2:1;C-=(1!==l&&2!=l||0!==u?1:2)*(i.conf_win_left_offset+i.conf_win_right_offset),A-=L*(i.conf_win_top_offset+i.conf_win_bottom_offset);var R=Math.ceil(C*w);return r.destroy(),r=null,{codec_mimetype:S,profile_string:E,level_string:k,profile_idc:i.profile_idc,level_idc:i.level_idc,bit_depth:h,ref_frames:1,chroma_format:l,chroma_format_string:e.getChromaFormatString(l),frame_rate:{fixed:i.fps_fixed,fps:i.fps,fps_den:i.fps_den,fps_num:i.fps_num},sar_ratio:{width:i.sar_width,height:i.sar_height},codec_size:{width:C,height:A},present_size:{width:R,height:A}}}},{key:"_hvcc_parse_ptl",value:function(e,t,n){e.readBits(2);var r=e.readBits(1),i=e.readBits(5);e.readBits(32),e.readBits(32),e.readBits(16);var a=e.readByte();void 0===t.tier_flag||void 0===t.level_idc||t.tier_flag<r?t.level_idc=a:t.level_idc=Math.max(t.level_idc,a),t.profile_idc=Math.max(void 0===t.profile_idc?0:t.profile_idc,i);for(var s=[],o=[],u=0;u<n;u++)s.push(e.readBits(1)),o.push(e.readBits(1));if(n>0)for(var l=n;l<8;l++)e.readBits(2);for(var c=0;c<n;c++)s[c]&&(e.readBits(32),e.readBits(32),e.readBits(24)),o[c]&&e.readByte()}},{key:"_parse_rps",value:function(e,t,n,r){if(t&&e.readBits(1)){if(t>=n)return-1;e.readBits(1),e.readUEG(),r[t]=0;for(var i=0;i<=r[t-1];i++){var a=0,s=e.readBits(1);s||(a=e.readBits(1)),(s||a)&&r[t]++}}else{var o=e.readUEG(),u=e.readUEG();if(2*(u+o)>e.getBitsLeft())return-1;r[t]=o+u;for(var l=0;l<o;l++)e.readUEG(),e.readBits(1);for(var c=0;c<u;c++)e.readUEG(),e.readBits(1)}return 0}},{key:"_hvcc_parse_vui",value:function(t,n,r){var i=void 0;t.readBits(1)&&255==t.readByte()&&(n.sar_width=t.readBits(16),n.sar_height=t.readBits(16)),t.readBits(1)&&t.readBits(1),t.readBits(1)&&(t.readBits(4),t.readBits(1)&&t.readBits(24)),t.readBits(1)&&(t.readUEG(),t.readUEG()),t.readBits(3),n.default_display_window_flag=t.readBits(1),n.default_display_window_flag&&(n.def_disp_win_left_offset=t.readUEG(),n.def_disp_win_right_offset=t.readUEG(),n.def_disp_win_top_offset=t.readUEG(),n.def_disp_win_bottom_offset=t.readUEG()),t.readBits(1)&&(e._skip_timing_info(t,n),t.readBits(1)&&e._skip_hrd_parameters(t,n,1,r)),t.readBits(1)&&(t.readBits(3),i=t.readUEG(),n.min_spatial_segmentation_idc=Math.min(n.min_spatial_segmentation_idc,i),t.readUEG(),t.readUEG(),t.readUEG(),t.readUEG())}},{key:"_skip_sub_layer_ordering_info",value:function(e,t){e.readUEG(),e.readUEG(),e.readUEG()}},{key:"_skip_scaling_list_data",value:function(e){for(var t=0;t<4;t++)for(var n=0;n<(3==t?2:6);n++)if(e.readBits(1)){var r=Math.min(64,1<<4+(t<<1));t>1&&e.readSEG();for(var i=0;i<r;i++)e.readSEG()}else e.readUEG()}},{key:"_skip_sub_layer_hrd_parameters",value:function(e,t,n){for(var r=0;r<=t;r++)e.readUEG(),e.readUEG(),n&&(e.readUEG(),e.readUEG()),e.readBits(1)}},{key:"_skip_timing_info",value:function(e,t){t.fps_den=e.readBits(32),t.fps_num=e.readBits(32),t.fps_den>0&&(t.fps=t.fps_num/t.fps_den);var n=0;e.readBits(1)&&(n=e.readUEG())>=0&&(t.fps/=n+1)}},{key:"_skip_hrd_parameters",value:function(t,n,r,i){var a=0,s=0;if(r&&(a=t.readBits(1),s=t.readBits(1),a||s)){var o=t.readBits(1);o&&t.readBits(19),t.readByte(),o&&t.readBits(4),t.readBits(15)}for(var u=0;u<=i;u++){var l=0,c=0,d=0,h=t.readBits(1);n.fps_fixed=h,h||(d=t.readBits(1)),d?t.readUEG():c=t.readBits(1),c||(l=t.readUEG(t)),a&&e._skip_sub_layer_hrd_parameters(t,l,0),s&&e._skip_sub_layer_hrd_parameters(t,l,0)}}},{key:"getProfileString",value:function(e){switch(e){case 1:return"Main";case 2:return"Main10";case 3:return"MainSP";case 4:return"Rext";case 9:return"SCC";default:return"Unknown"}}},{key:"getLevelString",value:function(e){return(e/30).toFixed(1)}},{key:"getChromaFormatString",value:function(e){switch(e){case 0:return"4:0:0";case 1:return"4:2:0";case 2:return"4:2:2";case 3:return"4:4:4";default:return"Unknown"}}}]),e}();n.default=o},{"./exp-golomb.js":18,"./sps-parser.js":21}],21:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(e){return e&&e.__esModule?e:{default:e}}(e("./exp-golomb.js")),a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,null,[{key:"_ebsp2rbsp",value:function(e){for(var t=e,n=t.byteLength,r=new Uint8Array(n),i=0,a=0;a<n;a++)a>=2&&3===t[a]&&0===t[a-1]&&0===t[a-2]||(r[i]=t[a],i++);return new Uint8Array(r.buffer,0,i)}},{key:"parseSPS",value:function(t){for(var n=t.subarray(1,4),r="avc1.",a=0;a<3;a++){var s=n[a].toString(16);s.length<2&&(s="0"+s),r+=s}var o=e._ebsp2rbsp(t),u=new i.default(o);u.readByte();var l=u.readByte();u.readByte();var c=u.readByte();u.readUEG();var d=e.getProfileString(l),h=e.getLevelString(c),f=1,p=420,v=8,m=8;if((100===l||110===l||122===l||244===l||44===l||83===l||86===l||118===l||128===l||138===l||144===l)&&(3===(f=u.readUEG())&&u.readBits(1),f<=3&&(p=[0,420,422,444][f]),v=u.readUEG()+8,m=u.readUEG()+8,u.readBits(1),u.readBool()))for(var g=3!==f?8:12,y=0;y<g;y++)u.readBool()&&(y<6?e._skipScalingList(u,16):e._skipScalingList(u,64));u.readUEG();var _=u.readUEG();if(0===_)u.readUEG();else if(1===_){u.readBits(1),u.readSEG(),u.readSEG();for(var b=u.readUEG(),T=0;T<b;T++)u.readSEG()}var S=u.readUEG();u.readBits(1);var E=u.readUEG(),k=u.readUEG(),w=u.readBits(1);0===w&&u.readBits(1),u.readBits(1);var C=0,A=0,L=0,R=0;u.readBool()&&(C=u.readUEG(),A=u.readUEG(),L=u.readUEG(),R=u.readUEG());var x=1,I=1,O=0,D=!0,P=0,M=0;if(u.readBool()){if(u.readBool()){var j=u.readByte();j>0&&j<16?(x=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][j-1],I=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][j-1]):255===j&&(x=u.readByte()<<8|u.readByte(),I=u.readByte()<<8|u.readByte())}if(u.readBool()&&u.readBool(),u.readBool()&&(u.readBits(4),u.readBool()&&u.readBits(24)),u.readBool()&&(u.readUEG(),u.readUEG()),u.readBool()){var U=u.readBits(32),B=u.readBits(32);D=u.readBool(),O=(P=B)/(M=2*U)}}var F=1;1===x&&1===I||(F=x/I);var N=0,G=0;0===f?(N=1,G=2-w):(N=3===f?1:2,G=(1===f?2:1)*(2-w));var V=16*(E+1),H=16*(k+1)*(2-w);V-=(C+A)*N,H-=(L+R)*G;var z=Math.ceil(V*F);return u.destroy(),u=null,{codec_mimetype:r,profile_idc:l,level_idc:c,profile_string:d,level_string:h,chroma_format_idc:f,bit_depth:v,bit_depth_luma:v,bit_depth_chroma:m,ref_frames:S,chroma_format:p,chroma_format_string:e.getChromaFormatString(p),frame_rate:{fixed:D,fps:O,fps_den:M,fps_num:P},sar_ratio:{width:x,height:I},codec_size:{width:V,height:H},present_size:{width:z,height:H}}}},{key:"_skipScalingList",value:function(e,t){for(var n=8,r=8,i=0;i<t;i++)0!==r&&(r=(n+e.readSEG()+256)%256),n=0===r?n:r}},{key:"getProfileString",value:function(e){switch(e){case 66:return"Baseline";case 77:return"Main";case 88:return"Extended";case 100:return"High";case 110:return"High10";case 122:return"High422";case 244:return"High444";default:return"Unknown"}}},{key:"getLevelString",value:function(e){return(e/10).toFixed(1)}},{key:"getChromaFormatString",value:function(e){switch(e){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}}}]),e}();n.default=a},{"./exp-golomb.js":18}],22:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0});var 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},a=r(e("./utils/polyfill.js")),s=r(e("./core/features.js")),o=e("./io/loader.js"),u=r(e("./player/flv-player.js")),l=r(e("./player/native-player.js")),c=r(e("./player/player-events.js")),d=e("./player/player-errors.js"),h=r(e("./utils/logging-control.js")),f=e("./utils/exception.js");a.default.install();var p={createPlayer:function(e,t){var n=e;if(null==n||"object"!==(void 0===n?"undefined":i(n)))throw new f.InvalidArgumentException("MediaDataSource must be an javascript object!");if(!n.hasOwnProperty("type"))throw new f.InvalidArgumentException("MediaDataSource must has type field to indicate video file type!");switch(n.type){case"flv":return new u.default(n,t);default:return new l.default(n,t)}},isSupported:function(){return s.default.supportMSEH264Playback()},getFeatureList:function(){return s.default.getFeatureList()}};p.BaseLoader=o.BaseLoader,p.LoaderStatus=o.LoaderStatus,p.LoaderErrors=o.LoaderErrors,p.Events=c.default,p.ErrorTypes=d.ErrorTypes,p.ErrorDetails=d.ErrorDetails,p.FlvPlayer=u.default,p.NativePlayer=l.default,p.LoggingControl=h.default,Object.defineProperty(p,"version",{enumerable:!0,get:function(){return"1.4.3"}}),n.default=p},{"./core/features.js":6,"./io/loader.js":26,"./player/flv-player.js":34,"./player/native-player.js":35,"./player/player-errors.js":36,"./player/player-events.js":37,"./utils/exception.js":42,"./utils/logging-control.js":44,"./utils/polyfill.js":45}],23:[function(e,t,n){"use strict";t.exports=e("./flv.js").default},{"./flv.js":22}],24:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0});var 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},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=(r(e("../utils/logger.js")),e("../utils/browser.js")),o=r(s),u=e("./loader.js"),l=e("../utils/exception.js"),c=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"fetch-stream-loader"));return r.TAG="FetchStreamLoader",r._seekHandler=e,r._config=n,r._needStash=!0,r._requestAbort=!1,r._abortController=null,r._contentLength=null,r._receivedLength=0,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),a(t,null,[{key:"isSupported",value:function(){try{var e=o.default.msedge&&o.default.version.minor>=15048,t=!o.default.msedge||e;return self.fetch&&self.ReadableStream&&t}catch(e){return!1}}}]),a(t,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,n,r)}if("value"in i)return i.value;var s=i.get;return void 0!==s?s.call(r):void 0}(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"destroy",this).call(this)}},{key:"open",value:function(e,t){var n=this;this._dataSource=e,this._range=t;var r=e.url;this._config.reuseRedirectedURL&&null!=e.redirectedURL&&(r=e.redirectedURL);var a=this._seekHandler.getConfig(r,t),s=new self.Headers;if("object"===i(a.headers)){var o=a.headers;for(var c in o)o.hasOwnProperty(c)&&s.append(c,o[c])}var d={method:"GET",headers:s,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if("object"===i(this._config.headers))for(var h in this._config.headers)s.append(h,this._config.headers[h]);!1===e.cors&&(d.mode="same-origin"),e.withCredentials&&(d.credentials="include"),e.referrerPolicy&&(d.referrerPolicy=e.referrerPolicy),self.AbortController&&(this._abortController=new self.AbortController,d.signal=this._abortController.signal),this._status=u.LoaderStatus.kConnecting,self.fetch(a.url,d).then((function(e){if(n._requestAbort)return n._status=u.LoaderStatus.kIdle,void e.body.cancel();if(e.ok&&e.status>=200&&e.status<=299){if(e.url!==a.url&&n._onURLRedirect){var t=n._seekHandler.removeURLParameters(e.url);n._onURLRedirect(t)}var r=e.headers.get("Content-Length");return null!=r&&(n._contentLength=parseInt(r),0!==n._contentLength&&n._onContentLengthKnown&&n._onContentLengthKnown(n._contentLength)),n._pump.call(n,e.body.getReader())}if(n._status=u.LoaderStatus.kError,!n._onError)throw new l.RuntimeException("FetchStreamLoader: Http code invalid, "+e.status+" "+e.statusText);n._onError(u.LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:e.status,msg:e.statusText})})).catch((function(e){if(!n._abortController||!n._abortController.signal.aborted){if(n._status=u.LoaderStatus.kError,!n._onError)throw e;n._onError(u.LoaderErrors.EXCEPTION,{code:-1,msg:e.message})}}))}},{key:"abort",value:function(){if(this._requestAbort=!0,(this._status!==u.LoaderStatus.kBuffering||!o.default.chrome)&&this._abortController)try{this._abortController.abort()}catch(e){}}},{key:"_pump",value:function(e){var t=this;return e.read().then((function(n){if(n.done)if(null!==t._contentLength&&t._receivedLength<t._contentLength){t._status=u.LoaderStatus.kError;var r=u.LoaderErrors.EARLY_EOF,i={code:-1,msg:"Fetch stream meet Early-EOF"};if(!t._onError)throw new l.RuntimeException(i.msg);t._onError(r,i)}else t._status=u.LoaderStatus.kComplete,t._onComplete&&t._onComplete(t._range.from,t._range.from+t._receivedLength-1);else{if(t._abortController&&t._abortController.signal.aborted)return void(t._status=u.LoaderStatus.kComplete);if(!0===t._requestAbort)return t._status=u.LoaderStatus.kComplete,e.cancel();t._status=u.LoaderStatus.kBuffering;var a=n.value.buffer,s=t._range.from+t._receivedLength;t._receivedLength+=a.byteLength,t._onDataArrival&&t._onDataArrival(a,s,t._receivedLength),t._pump(e)}})).catch((function(e){if(t._abortController&&t._abortController.signal.aborted)t._status=u.LoaderStatus.kComplete;else if(11!==e.code||!o.default.msedge){t._status=u.LoaderStatus.kError;var n=0,r=null;if(19!==e.code&&"network error"!==e.message||!(null===t._contentLength||null!==t._contentLength&&t._receivedLength<t._contentLength)?(n=u.LoaderErrors.EXCEPTION,r={code:e.code,msg:e.message}):(n=u.LoaderErrors.EARLY_EOF,r={code:e.code,msg:"Fetch stream meet Early-EOF"}),!t._onError)throw new l.RuntimeException(r.msg);t._onError(n,r)}}))}}]),t}(u.BaseLoader);n.default=c},{"../utils/browser.js":41,"../utils/exception.js":42,"../utils/logger.js":43,"./loader.js":26}],25:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=r(e("../utils/logger.js")),s=r(e("./speed-sampler.js")),o=e("./loader.js"),u=r(e("./fetch-stream-loader.js")),l=r(e("./xhr-moz-chunked-loader.js")),c=(r(e("./xhr-msstream-loader.js")),e("./xhr-range-loader.js")),d=r(c),h=r(e("./websocket-loader.js")),f=r(e("./range-seek-handler.js")),p=r(e("./param-seek-handler.js")),v=e("../utils/exception.js"),m=function(){function e(t,n,r){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.TAG="IOController",this._config=n,this._extraData=r,this._stashInitialSize=65536,null!=n.stashInitialSize&&n.stashInitialSize>0&&(this._stashInitialSize=n.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=Math.max(this._stashSize,3145728),this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,!1===n.enableStashBuffer&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=t,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(t.url),this._refTotalLength=t.filesize?t.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new s.default,this._speedNormalizeList=[32,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}return i(e,[{key:"destroy",value:function(){this._loader.isWorking()&&this._loader.abort(),this._loader.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null}},{key:"isWorking",value:function(){return this._loader&&this._loader.isWorking()&&!this._paused}},{key:"isPaused",value:function(){return this._paused}},{key:"_selectSeekHandler",value:function(){var e=this._config;if("range"===e.seekType)this._seekHandler=new f.default(this._config.rangeLoadZeroStart);else if("param"===e.seekType){var t=e.seekParamStart||"bstart",n=e.seekParamEnd||"bend";this._seekHandler=new p.default(t,n)}else{if("custom"!==e.seekType)throw new v.InvalidArgumentException("Invalid seekType in config: "+e.seekType);if("function"!=typeof e.customSeekHandler)throw new v.InvalidArgumentException("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new e.customSeekHandler}}},{key:"_selectLoader",value:function(){if(null!=this._config.customLoader)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=h.default;else if(u.default.isSupported())this._loaderClass=u.default;else if(l.default.isSupported())this._loaderClass=l.default;else{if(!d.default.isSupported())throw new v.RuntimeException("Your browser doesn't support xhr with arraybuffer responseType!");this._loaderClass=d.default}}},{key:"_createLoader",value:function(){this._loader=new this._loaderClass(this._seekHandler,this._config),!1===this._loader.needStashBuffer&&(this._enableStash=!1),this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)}},{key:"open",value:function(e){this._currentRange={from:0,to:-1},e&&(this._currentRange.from=e),this._speedSampler.reset(),e||(this._fullRequestFlag=!0),this._loader.open(this._dataSource,Object.assign({},this._currentRange))}},{key:"abort",value:function(){this._loader.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)}},{key:"pause",value:function(){this.isWorking()&&(this._loader.abort(),0!==this._stashUsed?(this._resumeFrom=this._stashByteStart,this._currentRange.to=this._stashByteStart-1):this._resumeFrom=this._currentRange.to+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)}},{key:"resume",value:function(){if(this._paused){this._paused=!1;var e=this._resumeFrom;this._resumeFrom=0,this._internalSeek(e,!0)}}},{key:"seek",value:function(e){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(e,!0)}},{key:"_internalSeek",value:function(e,t){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(t),this._loader.destroy(),this._loader=null;var n={from:e,to:-1};this._currentRange={from:n.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,n),this._onSeeked&&this._onSeeked()}},{key:"updateUrl",value:function(e){if(!e||"string"!=typeof e||0===e.length)throw new v.InvalidArgumentException("Url must be a non-empty string!");this._dataSource.url=e}},{key:"_expandBuffer",value:function(e){for(var t=this._stashSize;t+1048576<e;)t*=2;if((t+=1048576)!==this._bufferSize){var n=new ArrayBuffer(t);if(this._stashUsed>0){var r=new Uint8Array(this._stashBuffer,0,this._stashUsed);new Uint8Array(n,0,t).set(r,0)}this._stashBuffer=n,this._bufferSize=t}}},{key:"_normalizeSpeed",value:function(e){var t=this._speedNormalizeList,n=t.length-1,r=0,i=0,a=n;if(e<t[0])return t[0];for(;i<=a;){if((r=i+Math.floor((a-i)/2))===n||e>=t[r]&&e<t[r+1])return t[r];t[r]<e?i=r+1:a=r-1}}},{key:"_adjustStashSize",value:function(e){var t=0;(t=this._config.isLive?e/8:e<512?e:e>=512&&e<=1024?Math.floor(1.5*e):2*e)>8192&&(t=8192);var n=1024*t+1048576;this._bufferSize<n&&this._expandBuffer(n),this._stashSize=1024*t}},{key:"_dispatchChunks",value:function(e,t){return this._currentRange.to=t+e.byteLength-1,this._onDataArrival(e,t)}},{key:"_onURLRedirect",value:function(e){this._redirectedURL=e,this._onRedirect&&this._onRedirect(e)}},{key:"_onContentLengthKnown",value:function(e){e&&this._fullRequestFlag&&(this._totalLength=e,this._fullRequestFlag=!1)}},{key:"_onLoaderChunkArrival",value:function(e,t,n){if(!this._onDataArrival)throw new v.IllegalStateException("IOController: No existing consumer (onDataArrival) callback!");if(!this._paused){this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,this._onRecoveredEarlyEof&&this._onRecoveredEarlyEof()),this._speedSampler.addBytes(e.byteLength);var r=this._speedSampler.lastSecondKBps;if(0!==r){var i=this._normalizeSpeed(r);this._speedNormalized!==i&&(this._speedNormalized=i,this._adjustStashSize(i))}if(this._enableStash)if(0===this._stashUsed&&0===this._stashByteStart&&(this._stashByteStart=t),this._stashUsed+e.byteLength<=this._stashSize){new Uint8Array(this._stashBuffer,0,this._stashSize).set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength}else{var a=new Uint8Array(this._stashBuffer,0,this._bufferSize);if(this._stashUsed>0){var s=this._stashBuffer.slice(0,this._stashUsed),o=this._dispatchChunks(s,this._stashByteStart);if(o<s.byteLength){if(o>0){var u=new Uint8Array(s,o);a.set(u,0),this._stashUsed=u.byteLength,this._stashByteStart+=o}}else this._stashUsed=0,this._stashByteStart+=o;this._stashUsed+e.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+e.byteLength),a=new Uint8Array(this._stashBuffer,0,this._bufferSize)),a.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength}else{var l=this._dispatchChunks(e,t);if(l<e.byteLength){var c=e.byteLength-l;c>this._bufferSize&&(this._expandBuffer(c),a=new Uint8Array(this._stashBuffer,0,this._bufferSize)),a.set(new Uint8Array(e,l),0),this._stashUsed+=c,this._stashByteStart=t+l}}}else if(0===this._stashUsed){var d=this._dispatchChunks(e,t);if(d<e.byteLength){var h=e.byteLength-d;h>this._bufferSize&&this._expandBuffer(h),new Uint8Array(this._stashBuffer,0,this._bufferSize).set(new Uint8Array(e,d),0),this._stashUsed+=h,this._stashByteStart=t+d}}else{this._stashUsed+e.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+e.byteLength);var f=new Uint8Array(this._stashBuffer,0,this._bufferSize);f.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength;var p=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(p<this._stashUsed&&p>0){var m=new Uint8Array(this._stashBuffer,p);f.set(m,0)}this._stashUsed-=p,this._stashByteStart+=p}}}},{key:"_flushStashBuffer",value:function(e){if(this._stashUsed>0){var t=this._stashBuffer.slice(0,this._stashUsed),n=this._dispatchChunks(t,this._stashByteStart),r=t.byteLength-n;if(n<t.byteLength){if(!e){if(n>0){var i=new Uint8Array(this._stashBuffer,0,this._bufferSize),s=new Uint8Array(t,n);i.set(s,0),this._stashUsed=s.byteLength,this._stashByteStart+=n}return 0}a.default.w(this.TAG,r+" bytes unconsumed data remain when flush buffer, dropped")}return this._stashUsed=0,this._stashByteStart=0,r}return 0}},{key:"_onLoaderComplete",value:function(e,t){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)}},{key:"_onLoaderError",value:function(e,t){switch(a.default.e(this.TAG,"Loader error, code = "+t.code+", msg = "+t.msg),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,e=o.LoaderErrors.UNRECOVERABLE_EARLY_EOF),e){case o.LoaderErrors.EARLY_EOF:if(!this._config.isLive&&this._totalLength){var n=this._currentRange.to+1;return void(n<this._totalLength&&(a.default.w(this.TAG,"Connection lost, trying reconnect..."),this._isEarlyEofReconnecting=!0,this._internalSeek(n,!1)))}e=o.LoaderErrors.UNRECOVERABLE_EARLY_EOF;break;case o.LoaderErrors.UNRECOVERABLE_EARLY_EOF:case o.LoaderErrors.CONNECTING_TIMEOUT:case o.LoaderErrors.HTTP_STATUS_CODE_INVALID:case o.LoaderErrors.EXCEPTION:}if(!this._onError)throw new v.RuntimeException("IOException: "+t.msg);this._onError(e,t)}},{key:"status",get:function(){return this._loader.status}},{key:"extraData",get:function(){return this._extraData},set:function(e){this._extraData=e}},{key:"onDataArrival",get:function(){return this._onDataArrival},set:function(e){this._onDataArrival=e}},{key:"onSeeked",get:function(){return this._onSeeked},set:function(e){this._onSeeked=e}},{key:"onError",get:function(){return this._onError},set:function(e){this._onError=e}},{key:"onComplete",get:function(){return this._onComplete},set:function(e){this._onComplete=e}},{key:"onRedirect",get:function(){return this._onRedirect},set:function(e){this._onRedirect=e}},{key:"onRecoveredEarlyEof",get:function(){return this._onRecoveredEarlyEof},set:function(e){this._onRecoveredEarlyEof=e}},{key:"currentURL",get:function(){return this._dataSource.url}},{key:"hasRedirect",get:function(){return null!=this._redirectedURL||null!=this._dataSource.redirectedURL}},{key:"currentRedirectedURL",get:function(){return this._redirectedURL||this._dataSource.redirectedURL}},{key:"currentSpeed",get:function(){return this._loaderClass===d.default?this._loader.currentSpeed:this._speedSampler.lastSecondKBps}},{key:"loaderType",get:function(){return this._loader.type}}]),e}();n.default=m},{"../utils/exception.js":42,"../utils/logger.js":43,"./fetch-stream-loader.js":24,"./loader.js":26,"./param-seek-handler.js":27,"./range-seek-handler.js":28,"./speed-sampler.js":29,"./websocket-loader.js":30,"./xhr-moz-chunked-loader.js":31,"./xhr-msstream-loader.js":32,"./xhr-range-loader.js":33}],26:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.BaseLoader=n.LoaderErrors=n.LoaderStatus=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=e("../utils/exception.js"),a=n.LoaderStatus={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4};n.LoaderErrors={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},n.BaseLoader=function(){function e(t){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this._type=t||"undefined",this._status=a.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return r(e,[{key:"destroy",value:function(){this._status=a.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}},{key:"isWorking",value:function(){return this._status===a.kConnecting||this._status===a.kBuffering}},{key:"open",value:function(e,t){throw new i.NotImplementedException("Unimplemented abstract function!")}},{key:"abort",value:function(){throw new i.NotImplementedException("Unimplemented abstract function!")}},{key:"type",get:function(){return this._type}},{key:"status",get:function(){return this._status}},{key:"needStashBuffer",get:function(){return this._needStash}},{key:"onContentLengthKnown",get:function(){return this._onContentLengthKnown},set:function(e){this._onContentLengthKnown=e}},{key:"onURLRedirect",get:function(){return this._onURLRedirect},set:function(e){this._onURLRedirect=e}},{key:"onDataArrival",get:function(){return this._onDataArrival},set:function(e){this._onDataArrival=e}},{key:"onError",get:function(){return this._onError},set:function(e){this._onError=e}},{key:"onComplete",get:function(){return this._onComplete},set:function(e){this._onComplete=e}}]),e}()},{"../utils/exception.js":42}],27:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(t,n){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this._startName=t,this._endName=n}return r(e,[{key:"getConfig",value:function(e,t){var n=e;if(0!==t.from||-1!==t.to){var r=!0;-1===n.indexOf("?")&&(n+="?",r=!1),r&&(n+="&"),n+=this._startName+"="+t.from.toString(),-1!==t.to&&(n+="&"+this._endName+"="+t.to.toString())}return{url:n,headers:{}}}},{key:"removeURLParameters",value:function(e){var t=e.split("?")[0],n=void 0,r=e.indexOf("?");-1!==r&&(n=e.substring(r+1));var i="";if(null!=n&&n.length>0)for(var a=n.split("&"),s=0;s<a.length;s++){var o=a[s].split("="),u=s>0;o[0]!==this._startName&&o[0]!==this._endName&&(u&&(i+="&"),i+=a[s])}return 0===i.length?t:t+"?"+i}}]),e}();n.default=i},{}],28:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),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._zeroStart=t||!1}return r(e,[{key:"getConfig",value:function(e,t){var n={};if(0!==t.from||-1!==t.to){var r;r=-1!==t.to?"bytes="+t.from.toString()+"-"+t.to.toString():"bytes="+t.from.toString()+"-",n.Range=r}else this._zeroStart&&(n.Range="bytes=0-");return{url:e,headers:n}}},{key:"removeURLParameters",value:function(e){return e}}]),e}();n.default=i},{}],29:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now}return r(e,[{key:"reset",value:function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0}},{key:"addBytes",value:function(e){0===this._firstCheckpoint?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=e,this._totalBytes+=e):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=e,this._totalBytes+=e):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=e,this._totalBytes+=e,this._lastCheckpoint=this._now())}},{key:"currentKBps",get:function(){this.addBytes(0);var e=(this._now()-this._lastCheckpoint)/1e3;return 0==e&&(e=1),this._intervalBytes/e/1024}},{key:"lastSecondKBps",get:function(){return this.addBytes(0),0!==this._lastSecondBytes?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0}},{key:"averageKBps",get:function(){var e=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/e/1024}}]),e}();n.default=i},{}],30:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=(function(e){e&&e.__esModule}(e("../utils/logger.js")),e("./loader.js")),a=e("../utils/exception.js"),s=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"websocket-loader"));return e.TAG="WebSocketLoader",e._needStash=!0,e._ws=null,e._requestAbort=!1,e._receivedLength=0,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,null,[{key:"isSupported",value:function(){try{return void 0!==self.WebSocket}catch(e){return!1}}}]),r(t,[{key:"destroy",value:function(){this._ws&&this.abort(),function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,n,r)}if("value"in i)return i.value;var s=i.get;return void 0!==s?s.call(r):void 0}(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"destroy",this).call(this)}},{key:"open",value:function(e){try{var t=this._ws=new self.WebSocket(e.url);t.binaryType="arraybuffer",t.onopen=this._onWebSocketOpen.bind(this),t.onclose=this._onWebSocketClose.bind(this),t.onmessage=this._onWebSocketMessage.bind(this),t.onerror=this._onWebSocketError.bind(this),this._status=i.LoaderStatus.kConnecting}catch(e){this._status=i.LoaderStatus.kError;var n={code:e.code,msg:e.message};if(!this._onError)throw new a.RuntimeException(n.msg);this._onError(i.LoaderErrors.EXCEPTION,n)}}},{key:"abort",value:function(){var e=this._ws;!e||0!==e.readyState&&1!==e.readyState||(this._requestAbort=!0,e.close()),this._ws=null,this._status=i.LoaderStatus.kComplete}},{key:"_onWebSocketOpen",value:function(e){this._status=i.LoaderStatus.kBuffering}},{key:"_onWebSocketClose",value:function(e){!0!==this._requestAbort?(this._status=i.LoaderStatus.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1)):this._requestAbort=!1}},{key:"_onWebSocketMessage",value:function(e){var t=this;if(e.data instanceof ArrayBuffer)this._dispatchArrayBuffer(e.data);else if(e.data instanceof Blob){var n=new FileReader;n.onload=function(){t._dispatchArrayBuffer(n.result)},n.readAsArrayBuffer(e.data)}else{this._status=i.LoaderStatus.kError;var r={code:-1,msg:"Unsupported WebSocket message type: "+e.data.constructor.name};if(!this._onError)throw new a.RuntimeException(r.msg);this._onError(i.LoaderErrors.EXCEPTION,r)}}},{key:"_dispatchArrayBuffer",value:function(e){var t=e,n=this._receivedLength;this._receivedLength+=t.byteLength,this._onDataArrival&&this._onDataArrival(t,n,this._receivedLength)}},{key:"_onWebSocketError",value:function(e){this._status=i.LoaderStatus.kError;var t={code:e.code,msg:e.message};if(!this._onError)throw new a.RuntimeException(t.msg);this._onError(i.LoaderErrors.EXCEPTION,t)}}]),t}(i.BaseLoader);n.default=s},{"../utils/exception.js":42,"../utils/logger.js":43,"./loader.js":26}],31:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r="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=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(e){return e&&e.__esModule?e:{default:e}}(e("../utils/logger.js")),s=e("./loader.js"),o=e("../utils/exception.js"),u=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"xhr-moz-chunked-loader"));return r.TAG="MozChunkedLoader",r._seekHandler=e,r._config=n,r._needStash=!0,r._xhr=null,r._requestAbort=!1,r._contentLength=null,r._receivedLength=0,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,null,[{key:"isSupported",value:function(){try{var e=new XMLHttpRequest;return e.open("GET","https://example.com",!0),e.responseType="moz-chunked-arraybuffer","moz-chunked-arraybuffer"===e.responseType}catch(e){return a.default.w("MozChunkedLoader",e.message),!1}}}]),i(t,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onloadend=null,this._xhr.onerror=null,this._xhr=null),function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,n,r)}if("value"in i)return i.value;var s=i.get;return void 0!==s?s.call(r):void 0}(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"destroy",this).call(this)}},{key:"open",value:function(e,t){this._dataSource=e,this._range=t;var n=e.url;this._config.reuseRedirectedURL&&null!=e.redirectedURL&&(n=e.redirectedURL);var i=this._seekHandler.getConfig(n,t);this._requestURL=i.url;var a=this._xhr=new XMLHttpRequest;if(a.open("GET",i.url,!0),a.responseType="moz-chunked-arraybuffer",a.onreadystatechange=this._onReadyStateChange.bind(this),a.onprogress=this._onProgress.bind(this),a.onloadend=this._onLoadEnd.bind(this),a.onerror=this._onXhrError.bind(this),e.withCredentials&&(a.withCredentials=!0),"object"===r(i.headers)){var o=i.headers;for(var u in o)o.hasOwnProperty(u)&&a.setRequestHeader(u,o[u])}if("object"===r(this._config.headers)){var l=this._config.headers;for(var c in l)l.hasOwnProperty(c)&&a.setRequestHeader(c,l[c])}this._status=s.LoaderStatus.kConnecting,a.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=s.LoaderStatus.kComplete}},{key:"_onReadyStateChange",value:function(e){var t=e.target;if(2===t.readyState){if(null!=t.responseURL&&t.responseURL!==this._requestURL&&this._onURLRedirect){var n=this._seekHandler.removeURLParameters(t.responseURL);this._onURLRedirect(n)}if(0!==t.status&&(t.status<200||t.status>299)){if(this._status=s.LoaderStatus.kError,!this._onError)throw new o.RuntimeException("MozChunkedLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(s.LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}else this._status=s.LoaderStatus.kBuffering}}},{key:"_onProgress",value:function(e){if(this._status!==s.LoaderStatus.kError){null===this._contentLength&&null!==e.total&&0!==e.total&&(this._contentLength=e.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));var t=e.target.response,n=this._range.from+this._receivedLength;this._receivedLength+=t.byteLength,this._onDataArrival&&this._onDataArrival(t,n,this._receivedLength)}}},{key:"_onLoadEnd",value:function(e){!0!==this._requestAbort?this._status!==s.LoaderStatus.kError&&(this._status=s.LoaderStatus.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)):this._requestAbort=!1}},{key:"_onXhrError",value:function(e){this._status=s.LoaderStatus.kError;var t=0,n=null;if(this._contentLength&&e.loaded<this._contentLength?(t=s.LoaderErrors.EARLY_EOF,n={code:-1,msg:"Moz-Chunked stream meet Early-Eof"}):(t=s.LoaderErrors.EXCEPTION,n={code:-1,msg:e.constructor.name+" "+e.type}),!this._onError)throw new o.RuntimeException(n.msg);this._onError(t,n)}}]),t}(s.BaseLoader);n.default=u},{"../utils/exception.js":42,"../utils/logger.js":43,"./loader.js":26}],32:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r="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=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(e){return e&&e.__esModule?e:{default:e}}(e("../utils/logger.js")),s=e("./loader.js"),o=e("../utils/exception.js"),u=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"xhr-msstream-loader"));return r.TAG="MSStreamLoader",r._seekHandler=e,r._config=n,r._needStash=!0,r._xhr=null,r._reader=null,r._totalRange=null,r._currentRange=null,r._currentRequestURL=null,r._currentRedirectedURL=null,r._contentLength=null,r._receivedLength=0,r._bufferLimit=16777216,r._lastTimeBufferSize=0,r._isReconnecting=!1,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,null,[{key:"isSupported",value:function(){try{if(void 0===self.MSStream||void 0===self.MSStreamReader)return!1;var e=new XMLHttpRequest;return e.open("GET","https://example.com",!0),e.responseType="ms-stream","ms-stream"===e.responseType}catch(e){return a.default.w("MSStreamLoader",e.message),!1}}}]),i(t,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),this._reader&&(this._reader.onprogress=null,this._reader.onload=null,this._reader.onerror=null,this._reader=null),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr=null),function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,n,r)}if("value"in i)return i.value;var s=i.get;return void 0!==s?s.call(r):void 0}(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"destroy",this).call(this)}},{key:"open",value:function(e,t){this._internalOpen(e,t,!1)}},{key:"_internalOpen",value:function(e,t,n){this._dataSource=e,n?this._currentRange=t:this._totalRange=t;var i=e.url;this._config.reuseRedirectedURL&&(null!=this._currentRedirectedURL?i=this._currentRedirectedURL:null!=e.redirectedURL&&(i=e.redirectedURL));var a=this._seekHandler.getConfig(i,t);this._currentRequestURL=a.url;var o=this._reader=new self.MSStreamReader;o.onprogress=this._msrOnProgress.bind(this),o.onload=this._msrOnLoad.bind(this),o.onerror=this._msrOnError.bind(this);var u=this._xhr=new XMLHttpRequest;if(u.open("GET",a.url,!0),u.responseType="ms-stream",u.onreadystatechange=this._xhrOnReadyStateChange.bind(this),u.onerror=this._xhrOnError.bind(this),e.withCredentials&&(u.withCredentials=!0),"object"===r(a.headers)){var l=a.headers;for(var c in l)l.hasOwnProperty(c)&&u.setRequestHeader(c,l[c])}if("object"===r(this._config.headers)){var d=this._config.headers;for(var h in d)d.hasOwnProperty(h)&&u.setRequestHeader(h,d[h])}this._isReconnecting?this._isReconnecting=!1:this._status=s.LoaderStatus.kConnecting,u.send()}},{key:"abort",value:function(){this._internalAbort(),this._status=s.LoaderStatus.kComplete}},{key:"_internalAbort",value:function(){this._reader&&(1===this._reader.readyState&&this._reader.abort(),this._reader.onprogress=null,this._reader.onload=null,this._reader.onerror=null,this._reader=null),this._xhr&&(this._xhr.abort(),this._xhr.onreadystatechange=null,this._xhr=null)}},{key:"_xhrOnReadyStateChange",value:function(e){var t=e.target;if(2===t.readyState)if(t.status>=200&&t.status<=299){if(this._status=s.LoaderStatus.kBuffering,null!=t.responseURL){var n=this._seekHandler.removeURLParameters(t.responseURL);t.responseURL!==this._currentRequestURL&&n!==this._currentRedirectedURL&&(this._currentRedirectedURL=n,this._onURLRedirect&&this._onURLRedirect(n))}var r=t.getResponseHeader("Content-Length");if(null!=r&&null==this._contentLength){var i=parseInt(r);i>0&&(this._contentLength=i,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength))}}else{if(this._status=s.LoaderStatus.kError,!this._onError)throw new o.RuntimeException("MSStreamLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(s.LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}else if(3===t.readyState&&t.status>=200&&t.status<=299){this._status=s.LoaderStatus.kBuffering;var a=t.response;this._reader.readAsArrayBuffer(a)}}},{key:"_xhrOnError",value:function(e){this._status=s.LoaderStatus.kError;var t=s.LoaderErrors.EXCEPTION,n={code:-1,msg:e.constructor.name+" "+e.type};if(!this._onError)throw new o.RuntimeException(n.msg);this._onError(t,n)}},{key:"_msrOnProgress",value:function(e){var t=e.target.result;if(null!=t){var n=t.slice(this._lastTimeBufferSize);this._lastTimeBufferSize=t.byteLength;var r=this._totalRange.from+this._receivedLength;this._receivedLength+=n.byteLength,this._onDataArrival&&this._onDataArrival(n,r,this._receivedLength),t.byteLength>=this._bufferLimit&&(a.default.v(this.TAG,"MSStream buffer exceeded max size near "+(r+n.byteLength)+", reconnecting..."),this._doReconnectIfNeeded())}else this._doReconnectIfNeeded()}},{key:"_doReconnectIfNeeded",value:function(){if(null==this._contentLength||this._receivedLength<this._contentLength){this._isReconnecting=!0,this._lastTimeBufferSize=0,this._internalAbort();var e={from:this._totalRange.from+this._receivedLength,to:-1};this._internalOpen(this._dataSource,e,!0)}}},{key:"_msrOnLoad",value:function(e){this._status=s.LoaderStatus.kComplete,this._onComplete&&this._onComplete(this._totalRange.from,this._totalRange.from+this._receivedLength-1)}},{key:"_msrOnError",value:function(e){this._status=s.LoaderStatus.kError;var t=0,n=null;if(this._contentLength&&this._receivedLength<this._contentLength?(t=s.LoaderErrors.EARLY_EOF,n={code:-1,msg:"MSStream meet Early-Eof"}):(t=s.LoaderErrors.EARLY_EOF,n={code:-1,msg:e.constructor.name+" "+e.type}),!this._onError)throw new o.RuntimeException(n.msg);this._onError(t,n)}}]),t}(s.BaseLoader);n.default=u},{"../utils/exception.js":42,"../utils/logger.js":43,"./loader.js":26}],33:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0});var 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},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=r(e("../utils/logger.js")),o=r(e("./speed-sampler.js")),u=e("./loader.js"),l=e("../utils/exception.js"),c=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"xhr-range-loader"));return r.TAG="RangeLoader",r._seekHandler=e,r._config=n,r._needStash=!1,r._chunkSizeKBList=[128,256,384,512,768,1024,1536,2048,3072,4096,5120,6144,7168,8192],r._currentChunkSizeKB=384,r._currentSpeedNormalized=0,r._zeroSpeedChunkCount=0,r._xhr=null,r._speedSampler=new o.default,r._requestAbort=!1,r._waitForTotalLength=!1,r._totalLengthReceived=!1,r._currentRequestURL=null,r._currentRedirectedURL=null,r._currentRequestRange=null,r._totalLength=null,r._contentLength=null,r._receivedLength=0,r._lastTimeLoaded=0,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),a(t,null,[{key:"isSupported",value:function(){try{var e=new XMLHttpRequest;return e.open("GET","https://example.com",!0),e.responseType="arraybuffer","arraybuffer"===e.responseType}catch(e){return s.default.w("RangeLoader",e.message),!1}}}]),a(t,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr=null),function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,n,r)}if("value"in i)return i.value;var s=i.get;return void 0!==s?s.call(r):void 0}(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"destroy",this).call(this)}},{key:"open",value:function(e,t){this._dataSource=e,this._range=t,this._status=u.LoaderStatus.kConnecting;var n=!1;null!=this._dataSource.filesize&&0!==this._dataSource.filesize&&(n=!0,this._totalLength=this._dataSource.filesize),this._totalLengthReceived||n?this._openSubRange():(this._waitForTotalLength=!0,this._internalOpen(this._dataSource,{from:0,to:-1}))}},{key:"_openSubRange",value:function(){var e=1024*this._currentChunkSizeKB,t=this._range.from+this._receivedLength,n=t+e;null!=this._contentLength&&n-this._range.from>=this._contentLength&&(n=this._range.from+this._contentLength-1),this._currentRequestRange={from:t,to:n},this._internalOpen(this._dataSource,this._currentRequestRange)}},{key:"_internalOpen",value:function(e,t){this._lastTimeLoaded=0;var n=e.url;this._config.reuseRedirectedURL&&(null!=this._currentRedirectedURL?n=this._currentRedirectedURL:null!=e.redirectedURL&&(n=e.redirectedURL));var r=this._seekHandler.getConfig(n,t);this._currentRequestURL=r.url;var a=this._xhr=new XMLHttpRequest;if(a.open("GET",r.url,!0),a.responseType="arraybuffer",a.onreadystatechange=this._onReadyStateChange.bind(this),a.onprogress=this._onProgress.bind(this),a.onload=this._onLoad.bind(this),a.onerror=this._onXhrError.bind(this),e.withCredentials&&(a.withCredentials=!0),"object"===i(r.headers)){var s=r.headers;for(var o in s)s.hasOwnProperty(o)&&a.setRequestHeader(o,s[o])}if("object"===i(this._config.headers)){var u=this._config.headers;for(var l in u)u.hasOwnProperty(l)&&a.setRequestHeader(l,u[l])}a.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._internalAbort(),this._status=u.LoaderStatus.kComplete}},{key:"_internalAbort",value:function(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)}},{key:"_onReadyStateChange",value:function(e){var t=e.target;if(2===t.readyState){if(null!=t.responseURL){var n=this._seekHandler.removeURLParameters(t.responseURL);t.responseURL!==this._currentRequestURL&&n!==this._currentRedirectedURL&&(this._currentRedirectedURL=n,this._onURLRedirect&&this._onURLRedirect(n))}if(t.status>=200&&t.status<=299){if(this._waitForTotalLength)return;this._status=u.LoaderStatus.kBuffering}else{if(this._status=u.LoaderStatus.kError,!this._onError)throw new l.RuntimeException("RangeLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(u.LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}}}},{key:"_onProgress",value:function(e){if(this._status!==u.LoaderStatus.kError){if(null===this._contentLength){var t=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,t=!0;var n=e.total;this._internalAbort(),null!=n&0!==n&&(this._totalLength=n)}if(-1===this._range.to?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,t)return void this._openSubRange();this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var r=e.loaded-this._lastTimeLoaded;this._lastTimeLoaded=e.loaded,this._speedSampler.addBytes(r)}}},{key:"_normalizeSpeed",value:function(e){var t=this._chunkSizeKBList,n=t.length-1,r=0,i=0,a=n;if(e<t[0])return t[0];for(;i<=a;){if((r=i+Math.floor((a-i)/2))===n||e>=t[r]&&e<t[r+1])return t[r];t[r]<e?i=r+1:a=r-1}}},{key:"_onLoad",value:function(e){if(this._status!==u.LoaderStatus.kError){if(this._waitForTotalLength)return void(this._waitForTotalLength=!1);this._lastTimeLoaded=0;var t=this._speedSampler.lastSecondKBps;if(0===t&&++this._zeroSpeedChunkCount>=3&&(t=this._speedSampler.currentKBps),0!==t){var n=this._normalizeSpeed(t);this._currentSpeedNormalized!==n&&(this._currentSpeedNormalized=n,this._currentChunkSizeKB=n)}var r=e.target.response,i=this._range.from+this._receivedLength;this._receivedLength+=r.byteLength;var a=!1;null!=this._contentLength&&this._receivedLength<this._contentLength?this._openSubRange():a=!0,this._onDataArrival&&this._onDataArrival(r,i,this._receivedLength),a&&(this._status=u.LoaderStatus.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))}}},{key:"_onXhrError",value:function(e){this._status=u.LoaderStatus.kError;var t=0,n=null;if(this._contentLength&&this._receivedLength>0&&this._receivedLength<this._contentLength?(t=u.LoaderErrors.EARLY_EOF,n={code:-1,msg:"RangeLoader meet Early-Eof"}):(t=u.LoaderErrors.EXCEPTION,n={code:-1,msg:e.constructor.name+" "+e.type}),!this._onError)throw new l.RuntimeException(n.msg);this._onError(t,n)}},{key:"currentSpeed",get:function(){return this._speedSampler.lastSecondKBps}}]),t}(u.BaseLoader);n.default=c},{"../utils/exception.js":42,"../utils/logger.js":43,"./loader.js":26,"./speed-sampler.js":29}],34:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0});var 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},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=r(e("events")),o=r(e("../utils/logger.js")),u=r(e("../utils/browser.js")),l=r(e("./player-events.js")),c=r(e("../core/transmuxer.js")),d=r(e("../core/transmuxing-events.js")),h=r(e("../core/mse-controller.js")),f=r(e("../core/mse-events.js")),p=e("./player-errors.js"),v=e("../config.js"),m=e("../utils/exception.js"),g=function(){function e(t,n){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new s.default,this._config=(0,v.createDefaultConfig)(),"object"===(void 0===n?"undefined":i(n))&&Object.assign(this._config,n),"flv"!==t.type.toLowerCase())throw new m.InvalidArgumentException("FlvPlayer requires an flv MediaDataSource input!");!0===t.isLive&&(this._config.isLive=!0),this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this),onvSeeking:this._onvSeeking.bind(this),onvCanPlay:this._onvCanPlay.bind(this),onvStalled:this._onvStalled.bind(this),onvProgress:this._onvProgress.bind(this)},self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now,this._pendingSeekTime=null,this._requestSetTime=!1,this._seekpointRecord=null,this._progressChecker=null,this._mediaDataSource=t,this._mediaElement=null,this._msectl=null,this._transmuxer=null,this._mseSourceOpened=!1,this._hasPendingLoad=!1,this._receivedCanPlay=!1,this._mediaInfo=null,this._statisticsInfo=null;var r=u.default.chrome&&(u.default.version.major<50||50===u.default.version.major&&u.default.version.build<2661);this._alwaysSeekKeyframe=!!(r||u.default.msedge||u.default.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1),this._lastSeekFromTime=0,this._hasseek=!1}return a(e,[{key:"destroy",value:function(){this._emitter&&this._emitter.emit(l.default.DESTROYING),null!=this._progressChecker&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._transmuxer&&this.unload(),this._mediaElement&&this.detachMediaElement(),this.e=null,this._mediaDataSource=null,this._emitter&&this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(e,t){var n=this;e===l.default.MEDIA_INFO?null!=this._mediaInfo&&Promise.resolve().then((function(){n._emitter.emit(l.default.MEDIA_INFO,n.mediaInfo)})):e===l.default.STATISTICS_INFO&&null!=this._statisticsInfo&&Promise.resolve().then((function(){n._emitter.emit(l.default.STATISTICS_INFO,n.statisticsInfo)})),this._emitter.addListener(e,t)}},{key:"off",value:function(e,t){this._emitter.removeListener(e,t)}},{key:"attachMediaElement",value:function(e){var t=this;if(this._mediaElement=e,e.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),e.addEventListener("seeking",this.e.onvSeeking),e.addEventListener("canplay",this.e.onvCanPlay),e.addEventListener("stalled",this.e.onvStalled),e.addEventListener("progress",this.e.onvProgress),this._msectl=new h.default(this._config),this._msectl.on(f.default.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(f.default.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(f.default.SOURCE_OPEN,(function(){t._mseSourceOpened=!0,t._hasPendingLoad&&(t._hasPendingLoad=!1,t.load())})),this._msectl.on(f.default.ERROR,(function(e){t._emitter.emit(l.default.ERROR,p.ErrorTypes.MEDIA_ERROR,p.ErrorDetails.MEDIA_MSE_ERROR,e)})),this._msectl.attachMediaElement(e),null!=this._pendingSeekTime)try{e.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(e){}}},{key:"detachMediaElement",value:function(){this._mediaElement&&(this._msectl.detachMediaElement(),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement.removeEventListener("seeking",this.e.onvSeeking),this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay),this._mediaElement.removeEventListener("stalled",this.e.onvStalled),this._mediaElement.removeEventListener("progress",this.e.onvProgress),this._mediaElement=null),this._msectl&&(this._msectl.destroy(),this._msectl=null)}},{key:"load",value:function(){var e=this;if(!this._mediaElement)throw new m.IllegalStateException("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new m.IllegalStateException("FlvPlayer.load() has been called, please call unload() first!");if(!this._hasPendingLoad){if(this._config.deferLoadAfterSourceOpen&&!1===this._mseSourceOpened)return void(this._hasPendingLoad=!0);this._mediaElement.readyState>0&&this.directSeek(0),this._transmuxer=new c.default(this._mediaDataSource,this._config),this._transmuxer.on(d.default.INIT_SEGMENT,(function(t,n){e._msectl.appendInitSegment(n)})),this._transmuxer.on(d.default.MEDIA_SEGMENT,(function(t,n){if(e._msectl.appendMediaSegment(n),e._config.isLive&&"video"==t){var r=e._mediaElement.currentTime,i=e._mediaElement.paused,a=n.info.beginPts-1e3*r;if(a>=3e3&&!e._hasseek&&!i&&r){if(e._lastSeekFromTime==r)return void(a>=5e3&&e._emitter.emit(l.default.ERROR,p.ErrorTypes.OTHER_ERROR,"got wrong timestamp "+n.info.beginPts));var s=n.info.beginPts/1e3-1;o.default.w(e.TAG,"Live seems stuck at "+r+", try seek to "+s),e._hasseek=!0,e._requestSetTime=!0,e.currentTime=s,e._lastSeekFromTime=r}else a>=2e3&&e._hasseek&&(e._hasseek=!1)}if(e._config.lazyLoad&&!e._config.isLive){var u=e._mediaElement.currentTime;n.info.endDts>=1e3*(u+e._config.lazyLoadMaxDuration)&&null==e._progressChecker&&(o.default.v(e.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),e._suspendTransmuxer())}})),this._transmuxer.on(d.default.LOADING_COMPLETE,(function(){e._msectl.endOfStream(),e._emitter.emit(l.default.LOADING_COMPLETE)})),this._transmuxer.on(d.default.RECOVERED_EARLY_EOF,(function(){e._emitter.emit(l.default.RECOVERED_EARLY_EOF)})),this._transmuxer.on(d.default.IO_ERROR,(function(t,n){e._emitter.emit(l.default.ERROR,p.ErrorTypes.NETWORK_ERROR,t,n)})),this._transmuxer.on(d.default.DEMUX_ERROR,(function(t,n){e._emitter.emit(l.default.ERROR,p.ErrorTypes.MEDIA_ERROR,t,{code:-1,msg:n})})),this._transmuxer.on(d.default.MEDIA_INFO,(function(t){e._mediaInfo=t,e._emitter.emit(l.default.MEDIA_INFO,Object.assign({},t))})),this._transmuxer.on(d.default.METADATA_ARRIVED,(function(t){e._emitter.emit(l.default.METADATA_ARRIVED,t)})),this._transmuxer.on(d.default.SCRIPTDATA_ARRIVED,(function(t){e._emitter.emit(l.default.SCRIPTDATA_ARRIVED,t)})),this._transmuxer.on(d.default.STATISTICS_INFO,(function(t){e._statisticsInfo=e._fillStatisticsInfo(t),e._emitter.emit(l.default.STATISTICS_INFO,Object.assign({},e._statisticsInfo))})),this._transmuxer.on(d.default.RECOMMEND_SEEKPOINT,(function(t){e._mediaElement&&!e._config.accurateSeek&&e.directSeek(t/1e3)})),this._transmuxer.open()}}},{key:"unload",value:function(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)}},{key:"play",value:function(){return this._mediaElement.play()}},{key:"pause",value:function(){this._mediaElement.pause()}},{key:"_fillStatisticsInfo",value:function(e){if(e.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return e;var t=!0,n=0,r=0;if(this._mediaElement.getVideoPlaybackQuality){var i=this._mediaElement.getVideoPlaybackQuality();n=i.totalVideoFrames,r=i.droppedVideoFrames}else null!=this._mediaElement.webkitDecodedFrameCount?(n=this._mediaElement.webkitDecodedFrameCount,r=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=n,e.droppedFrames=r),e}},{key:"_onmseUpdateEnd",value:function(){if(this._config.lazyLoad&&!this._config.isLive){for(var e=this._mediaElement.buffered,t=this._mediaElement.currentTime,n=0,r=0;r<e.length;r++){var i=e.start(r),a=e.end(r);if(i<=t&&t<a){n=a;break}}n>=t+this._config.lazyLoadMaxDuration&&null==this._progressChecker&&(o.default.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}}},{key:"_onmseBufferFull",value:function(){o.default.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),null==this._progressChecker&&this._suspendTransmuxer()}},{key:"_suspendTransmuxer",value:function(){this._transmuxer&&(this._transmuxer.pause(),null==this._progressChecker&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))}},{key:"_checkProgressAndResume",value:function(){for(var e=this._mediaElement.currentTime,t=this._mediaElement.buffered,n=!1,r=0;r<t.length;r++){var i=t.start(r),a=t.end(r);if(e>=i&&e<a){e>=a-this._config.lazyLoadRecoverDuration&&(n=!0);break}}n&&(window.clearInterval(this._progressChecker),this._progressChecker=null,n&&(o.default.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))}},{key:"_isTimepointBuffered",value:function(e){for(var t=this._mediaElement.buffered,n=0;n<t.length;n++){var r=t.start(n),i=t.end(n);if(e>=r&&e<i)return!0}return!1}},{key:"_internalSeek",value:function(e){var t=this._isTimepointBuffered(e),n=!1,r=0;if(e<1&&this._mediaElement.buffered.length>0){var i=this._mediaElement.buffered.start(0);(i<1&&e<i||u.default.safari)&&(n=!0,r=u.default.safari?.1:i)}if(n)this.directSeek(r);else if(t){if(this._alwaysSeekKeyframe){var a=this._msectl.getNearestKeyframe(Math.floor(1e3*e));null!=a&&(e=a.dts/1e3),this.directSeek(e)}else this.directSeek(e);null!=this._progressChecker&&this._checkProgressAndResume()}else null!=this._progressChecker&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._msectl.seek(e),this._transmuxer.seek(Math.floor(1e3*e)),this._config.accurateSeek&&this.directSeek(e)}},{key:"directSeek",value:function(e){this._requestSetTime=!0,this._mediaElement.currentTime=e}},{key:"_checkAndApplyUnbufferedSeekpoint",value:function(){if(this._seekpointRecord)if(this._seekpointRecord.recordTime<=this._now()-100){var e=this._mediaElement.currentTime;this._seekpointRecord=null,this._isTimepointBuffered(e)||(null!=this._progressChecker&&(window.clearTimeout(this._progressChecker),this._progressChecker=null),this._msectl.seek(e),this._transmuxer.seek(Math.floor(1e3*e)),this._config.accurateSeek&&this.directSeek(e))}else window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}},{key:"_checkAndResumeStuckPlayback",value:function(e){var t=this._mediaElement;if(e||!this._receivedCanPlay||t.readyState<2){var n=t.buffered;if(n.length>0&&t.currentTime<n.start(0)){if(this._config.isLive&&n.start(0)-t.currentTime>3600)return o.default.w(this.TAG,"Playback seems stuck at "+t.currentTime+", try seek to "+n.start(0)+", cancel"),void this._emitter.emit(l.default.ERROR,p.ErrorTypes.MEDIA_ERROR,"got wrong timestamp "+n.start(0));n.start(0)-t.currentTime>1||t.currentTime>0?(o.default.w(this.TAG,"Playback seems stuck at "+t.currentTime+", seek to "+n.start(0)),this.directSeek(n.start(0))):o.default.w(this.TAG,"Playback seems stuck at "+t.currentTime+", skip seek to "+n.start(0))}}}},{key:"_onvLoadedMetadata",value:function(e){null!=this._pendingSeekTime&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null)}},{key:"_onvSeeking",value:function(e){if(this._requestSetTime)this._requestSetTime=!1;else{var t=this._mediaElement.currentTime,n=this._mediaElement.buffered;if(t<1&&n.length>0){var r=n.start(0);if(r<1&&t<r||u.default.safari){var i=u.default.safari?.1:r;return void this.directSeek(i)}}if(this._isTimepointBuffered(t)){if(this._alwaysSeekKeyframe){var a=this._msectl.getNearestKeyframe(Math.floor(1e3*t));null!=a&&(t=a.dts/1e3,this.directSeek(t))}null!=this._progressChecker&&this._checkProgressAndResume()}else this._seekpointRecord={seekPoint:t,recordTime:this._now()},window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}}},{key:"_onvCanPlay",value:function(e){this._receivedCanPlay=!0,this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay)}},{key:"_onvStalled",value:function(e){this._checkAndResumeStuckPlayback(!0)}},{key:"_onvProgress",value:function(e){var t=this;this._checkAndResumeStuckPlayback(),Promise.resolve().then((function(){t._emitter.emit(l.default.PROGRESS,e)}))}},{key:"type",get:function(){return this._type}},{key:"buffered",get:function(){return this._mediaElement.buffered}},{key:"duration",get:function(){return this._mediaElement.duration}},{key:"volume",get:function(){return this._mediaElement.volume},set:function(e){this._mediaElement.volume=e}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(e){this._mediaElement.muted=e}},{key:"speed",get:function(){return this._mediaElement.playbackRate},set:function(e){this._mediaElement.playbackRate=e}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(e){this._mediaElement?this._internalSeek(e):this._pendingSeekTime=e}},{key:"mediaInfo",get:function(){return Object.assign({},this._mediaInfo)}},{key:"statisticsInfo",get:function(){return null==this._statisticsInfo&&(this._statisticsInfo={}),this._statisticsInfo=this._fillStatisticsInfo(this._statisticsInfo),Object.assign({},this._statisticsInfo)}}]),e}();n.default=g},{"../config.js":5,"../core/mse-controller.js":9,"../core/mse-events.js":10,"../core/transmuxer.js":11,"../core/transmuxing-events.js":13,"../utils/browser.js":41,"../utils/exception.js":42,"../utils/logger.js":43,"./player-errors.js":36,"./player-events.js":37,events:2}],35:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0});var 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},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=r(e("events")),o=r(e("./player-events.js")),u=e("../config.js"),l=e("../utils/exception.js"),c=function(){function e(t,n){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new s.default,this._config=(0,u.createDefaultConfig)(),"object"===(void 0===n?"undefined":i(n))&&Object.assign(this._config,n),"flv"===t.type.toLowerCase())throw new l.InvalidArgumentException("NativePlayer does't support flv MediaDataSource input!");if(t.hasOwnProperty("segments"))throw new l.InvalidArgumentException("NativePlayer("+t.type+") doesn't support multipart playback!");this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this)},this._pendingSeekTime=null,this._statisticsReporter=null,this._mediaDataSource=t,this._mediaElement=null}return a(e,[{key:"destroy",value:function(){this._emitter&&this._emitter.emit(o.default.DESTROYING),this._mediaElement&&(this.unload(),this.detachMediaElement()),this.e=null,this._mediaDataSource=null,this._emitter&&this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(e,t){var n=this;e===o.default.MEDIA_INFO?null!=this._mediaElement&&0!==this._mediaElement.readyState&&Promise.resolve().then((function(){n._emitter.emit(o.default.MEDIA_INFO,n.mediaInfo)})):e===o.default.STATISTICS_INFO&&null!=this._mediaElement&&0!==this._mediaElement.readyState&&Promise.resolve().then((function(){n._emitter.emit(o.default.STATISTICS_INFO,n.statisticsInfo)})),this._emitter.addListener(e,t)}},{key:"off",value:function(e,t){this._emitter.removeListener(e,t)}},{key:"attachMediaElement",value:function(e){if(this._mediaElement=e,e.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),null!=this._pendingSeekTime)try{e.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(e){}}},{key:"detachMediaElement",value:function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement=null),null!=this._statisticsReporter&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"load",value:function(){if(!this._mediaElement)throw new l.IllegalStateException("HTMLMediaElement must be attached before load()!");this._mediaElement.src=this._mediaDataSource.url,this._mediaElement.readyState>0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)}},{key:"unload",value:function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),null!=this._statisticsReporter&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"play",value:function(){return this._mediaElement.play()}},{key:"pause",value:function(){this._mediaElement.pause()}},{key:"_onvLoadedMetadata",value:function(e){null!=this._pendingSeekTime&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(o.default.MEDIA_INFO,this.mediaInfo)}},{key:"_reportStatisticsInfo",value:function(){this._emitter.emit(o.default.STATISTICS_INFO,this.statisticsInfo)}},{key:"type",get:function(){return this._type}},{key:"buffered",get:function(){return this._mediaElement.buffered}},{key:"duration",get:function(){return this._mediaElement.duration}},{key:"volume",get:function(){return this._mediaElement.volume},set:function(e){this._mediaElement.volume=e}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(e){this._mediaElement.muted=e}},{key:"speed",get:function(){return this._mediaElement.playbackRate},set:function(e){this._mediaElement.playbackRate=e}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(e){this._mediaElement?this._mediaElement.currentTime=e:this._pendingSeekTime=e}},{key:"mediaInfo",get:function(){var e={mimeType:(this._mediaElement instanceof HTMLAudioElement?"audio/":"video/")+this._mediaDataSource.type};return this._mediaElement&&(e.duration=Math.floor(1e3*this._mediaElement.duration),this._mediaElement instanceof HTMLVideoElement&&(e.width=this._mediaElement.videoWidth,e.height=this._mediaElement.videoHeight)),e}},{key:"statisticsInfo",get:function(){var e={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return e;var t=!0,n=0,r=0;if(this._mediaElement.getVideoPlaybackQuality){var i=this._mediaElement.getVideoPlaybackQuality();n=i.totalVideoFrames,r=i.droppedVideoFrames}else null!=this._mediaElement.webkitDecodedFrameCount?(n=this._mediaElement.webkitDecodedFrameCount,r=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=n,e.droppedFrames=r),e}}]),e}();n.default=c},{"../config.js":5,"../utils/exception.js":42,"./player-events.js":37,events:2}],36:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ErrorDetails=n.ErrorTypes=void 0;var r=e("../io/loader.js"),i=function(e){return e&&e.__esModule?e:{default:e}}(e("../demux/demux-errors.js"));n.ErrorTypes={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},n.ErrorDetails={NETWORK_EXCEPTION:r.LoaderErrors.EXCEPTION,NETWORK_STATUS_CODE_INVALID:r.LoaderErrors.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:r.LoaderErrors.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:r.LoaderErrors.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:i.default.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:i.default.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:i.default.CODEC_UNSUPPORTED}},{"../demux/demux-errors.js":17,"../io/loader.js":26}],37:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});n.default={ERROR:"error",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info",DESTROYING:"destroying",PROGRESS:"progress"}},{}],38:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,null,[{key:"getSilentFrame",value:function(e,t){if("mp4a.40.2"===e){if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===t)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null}}]),e}();n.default=i},{}],39:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,null,[{key:"init",value:function(){for(var t in e.types={hvc1:[],hvcC:[],av01:[],av1C:[],avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[],pasp:[],".mp3":[],Opus:[],dOps:[]},e.types)e.types.hasOwnProperty(t)&&(e.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);var n=e.constants={};n.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),n.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),n.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),n.STSC=n.STCO=n.STTS,n.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),n.HDLR_VIDEO=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),n.HDLR_AUDIO=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),n.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),n.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),n.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}},{key:"box",value:function(e){for(var t=8,n=null,r=Array.prototype.slice.call(arguments,1),i=r.length,a=0;a<i;a++)t+=r[a].byteLength;(n=new Uint8Array(t))[0]=t>>>24&255,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n.set(e,4);for(var s=8,o=0;o<i;o++)n.set(r[o],s),s+=r[o].byteLength;return n}},{key:"generateInitSegment",value:function(t){var n=e.box(e.types.ftyp,e.constants.FTYP),r=e.moov(t),i=new Uint8Array(n.byteLength+r.byteLength);return i.set(n,0),i.set(r,n.byteLength),i}},{key:"moov",value:function(t){var n=e.mvhd(t.timescale,t.duration),r=e.trak(t),i=e.mvex(t);return e.box(e.types.moov,n,r,i)}},{key:"mvhd",value:function(t,n){return e.box(e.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t,n>>>24&255,n>>>16&255,n>>>8&255,255&n,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]))}},{key:"trak",value:function(t){return e.box(e.types.trak,e.tkhd(t),e.mdia(t))}},{key:"tkhd",value:function(t){var n=t.id,r=t.duration,i=t.presentWidth,a=t.presentHeight;return e.box(e.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n,0,0,0,0,r>>>24&255,r>>>16&255,r>>>8&255,255&r,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,i>>>8&255,255&i,0,0,a>>>8&255,255&a,0,0]))}},{key:"mdia",value:function(t){return e.box(e.types.mdia,e.mdhd(t),e.hdlr(t),e.minf(t))}},{key:"mdhd",value:function(t){var n=t.timescale,r=t.duration;return e.box(e.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n,r>>>24&255,r>>>16&255,r>>>8&255,255&r,85,196,0,0]))}},{key:"hdlr",value:function(t){var n;return n="audio"===t.type?e.constants.HDLR_AUDIO:e.constants.HDLR_VIDEO,e.box(e.types.hdlr,n)}},{key:"minf",value:function(t){var n;return n="audio"===t.type?e.box(e.types.smhd,e.constants.SMHD):e.box(e.types.vmhd,e.constants.VMHD),e.box(e.types.minf,n,e.dinf(),e.stbl(t))}},{key:"dinf",value:function(){return e.box(e.types.dinf,e.box(e.types.dref,e.constants.DREF))}},{key:"stbl",value:function(t){return e.box(e.types.stbl,e.stsd(t),e.box(e.types.stts,e.constants.STTS),e.box(e.types.stsc,e.constants.STSC),e.box(e.types.stsz,e.constants.STSZ),e.box(e.types.stco,e.constants.STCO))}},{key:"stsd",value:function(t){return"audio"===t.type?"mp3"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp3(t)):"opus"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.Opus(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp4a(t)):t.codec.startsWith("hvc1")?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.hvc1(t)):t.codec.startsWith("av01")?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.av01(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.avc1(t))}},{key:"mp3",value:function(t){var n=t.channelCount,r=t.audioSampleRate,i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,n,0,16,0,0,0,0,r>>>8&255,255&r,0,0]);return e.box(e.types[".mp3"],i)}},{key:"mp4a",value:function(t){var n=t.channelCount,r=t.audioSampleRate,i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,n,0,16,0,0,0,0,r>>>8&255,255&r,0,0]);return e.box(e.types.mp4a,i,e.esds(t))}},{key:"Opus",value:function(t){var n=t.channelCount,r=t.audioSampleRate,i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,n,0,16,0,0,0,0,r>>>8&255,255&r,0,0]);return e.box(e.types.Opus,i,e.dOps(t))}},{key:"dOps",value:function(t){var n=t.channelCount,r=t.channelConfigCode,i=t.audioSampleRate;if(t.config)return e.box(e.types.dOps,t.config);var a=[];switch(r){case 1:case 2:a=[0];break;case 0:a=[255,1,1,0,1];break;case 128:a=[255,2,0,0,1];break;case 3:a=[1,2,1,0,2,1];break;case 4:a=[1,2,2,0,1,2,3];break;case 5:a=[1,3,2,0,4,1,2,3];break;case 6:a=[1,4,2,0,4,1,2,3,5];break;case 7:a=[1,4,2,0,4,1,2,3,5,6];break;case 8:a=[1,5,3,0,6,1,2,3,4,5,7];break;case 130:a=[1,1,2,0,1];break;case 131:a=[1,1,3,0,1,2];break;case 132:a=[1,1,4,0,1,2,3];break;case 133:a=[1,1,5,0,1,2,3,4];break;case 134:a=[1,1,6,0,1,2,3,4,5];break;case 135:a=[1,1,7,0,1,2,3,4,5,6];break;case 136:a=[1,1,8,0,1,2,3,4,5,6,7]}var s=new Uint8Array([0,n,0,0,i>>>24&255,i>>>17&255,i>>>8&255,i>>>0&255,0,0].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(a)));return e.box(e.types.dOps,s)}},{key:"esds",value:function(t){var n=t.config||[],r=n.length,i=new Uint8Array([0,0,0,0,3,23+r,0,1,0,4,15+r,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([r]).concat(n).concat([6,1,2]));return e.box(e.types.esds,i)}},{key:"avc1",value:function(t){var n=t.avcc,r=t.codecWidth,i=t.codecHeight,a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,r>>>8&255,255&r,i>>>8&255,255&i,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return e.box(e.types.avc1,a,e.box(e.types.avcC,n))}},{key:"hvc1",value:function(t){var n=t.hvcc,r=t.codecWidth,i=t.codecHeight,a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,r>>>8&255,255&r,i>>>8&255,255&i,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return e.box(e.types.hvc1,a,e.box(e.types.hvcC,n))}},{key:"av01",value:function(t){var n=t.av1c,r=t.codecWidth||192,i=t.codecHeight||108,a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,r>>>8&255,255&r,i>>>8&255,255&i,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return e.box(e.types.av01,a,e.box(e.types.av1C,n))}},{key:"mvex",value:function(t){return e.box(e.types.mvex,e.trex(t))}},{key:"trex",value:function(t){var n=t.id,r=new Uint8Array([0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return e.box(e.types.trex,r)}},{key:"moof",value:function(t,n){return e.box(e.types.moof,e.mfhd(t.sequenceNumber),e.traf(t,n))}},{key:"mfhd",value:function(t){var n=new Uint8Array([0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t]);return e.box(e.types.mfhd,n)}},{key:"traf",value:function(t,n){var r=t.id,i=e.box(e.types.tfhd,new Uint8Array([0,0,0,0,r>>>24&255,r>>>16&255,r>>>8&255,255&r])),a=e.box(e.types.tfdt,new Uint8Array([0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n])),s=e.sdtp(t),o=e.trun(t,s.byteLength+16+16+8+16+8+8);return e.box(e.types.traf,i,a,o,s)}},{key:"sdtp",value:function(t){for(var n=t.samples||[],r=n.length,i=new Uint8Array(4+r),a=0;a<r;a++){var s=n[a].flags;i[a+4]=s.isLeading<<6|s.dependsOn<<4|s.isDependedOn<<2|s.hasRedundancy}return e.box(e.types.sdtp,i)}},{key:"trun",value:function(t,n){var r=t.samples||[],i=r.length,a=12+16*i,s=new Uint8Array(a);n+=8+a,s.set([0,0,15,1,i>>>24&255,i>>>16&255,i>>>8&255,255&i,n>>>24&255,n>>>16&255,n>>>8&255,255&n],0);for(var o=0;o<i;o++){var u=r[o].duration,l=r[o].size,c=r[o].flags,d=r[o].cts;s.set([u>>>24&255,u>>>16&255,u>>>8&255,255&u,l>>>24&255,l>>>16&255,l>>>8&255,255&l,c.isLeading<<2|c.dependsOn,c.isDependedOn<<6|c.hasRedundancy<<4|c.isNonSync,0,0,d>>>24&255,d>>>16&255,d>>>8&255,255&d],12+16*o)}return e.box(e.types.trun,s)}},{key:"mdat",value:function(t){return e.box(e.types.mdat,t)}}]),e}();i.init(),n.default=i},{}],40:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=r(e("../utils/logger.js")),s=r(e("./mp4-generator.js")),o=r(e("./aac-silent.js")),u=r(e("../utils/browser.js")),l=e("../core/media-segment-info.js"),c=e("../utils/exception.js"),d=function(){function e(t){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.TAG="MP4Remuxer",this._config=t,this._isLive=!0===t.isLive,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=1/0,this._videoDtsBase=1/0,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new l.MediaSegmentInfoList("audio"),this._videoSegmentInfoList=new l.MediaSegmentInfoList("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!(!u.default.chrome||!(u.default.version.major<50||50===u.default.version.major&&u.default.version.build<2661)),this._fillSilentAfterSeek=u.default.msedge||u.default.msie,this._mp3UseMpegAudio=!u.default.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return i(e,[{key:"destroy",value:function(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null}},{key:"bindDataSource",value:function(e){return e.onDataAvailable=this.remux.bind(this),e.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this}},{key:"insertDiscontinuity",value:function(){this._audioNextDts=this._videoNextDts=void 0}},{key:"seek",value:function(e){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()}},{key:"remux",value:function(e,t){if(!this._onMediaSegment)throw new c.IllegalStateException("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(e,t),t&&this._remuxVideo(t),e&&this._remuxAudio(e)}},{key:"_onTrackMetadataReceived",value:function(e,t){var n=null,r="mp4",i=t.codec;if("audio"===e)this._audioMeta=t,"mp3"===t.codec&&this._mp3UseMpegAudio?(r="mpeg",i="",n=new Uint8Array):n=s.default.generateInitSegment(t);else{if("video"!==e)return;this._videoMeta=t,n=s.default.generateInitSegment(t)}if(!this._onInitSegment)throw new c.IllegalStateException("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(e,{type:e,data:n.buffer,codec:i,container:e+"/"+r,mediaDuration:t.duration})}},{key:"_calculateDtsBase",value:function(e,t){this._dtsBaseInited||(e&&e.samples&&e.samples.length&&(this._audioDtsBase=e.samples[0].dts),t&&t.samples&&t.samples.length&&(this._videoDtsBase=t.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)}},{key:"getTimestampBase",value:function(){if(this._dtsBaseInited)return this._dtsBase}},{key:"flushStashedSamples",value:function(){var e=this._videoStashedLastSample,t=this._audioStashedLastSample,n={type:"video",id:1,sequenceNumber:0,samples:[],length:0};null!=e&&(n.samples.push(e),n.length=e.length);var r={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};null!=t&&(r.samples.push(t),r.length=t.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(n,!0),this._remuxAudio(r,!0)}},{key:"_remuxAudio",value:function(e,t){if(null!=this._audioMeta){var n=e,r=n.samples,i=void 0,c=-1,d=-1,h=this._audioMeta.refSampleDuration,f="mp3"===this._audioMeta.codec&&this._mp3UseMpegAudio,p=this._dtsBaseInited&&void 0===this._audioNextDts,v=!1;if(r&&0!==r.length&&(1!==r.length||t)){var m=0,g=null,y=0;f?(m=0,y=n.length):(m=8,y=8+n.length);var _=null;if(r.length>1&&(y-=(_=r.pop()).length),null!=this._audioStashedLastSample){var b=this._audioStashedLastSample;this._audioStashedLastSample=null,r.unshift(b),y+=b.length}null!=_&&(this._audioStashedLastSample=_);var T=r[0].dts-this._dtsBase;if(this._audioNextDts)i=T-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())i=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&"mp3"!==this._audioMeta.originalCodec&&(v=!0);else{var S=this._audioSegmentInfoList.getLastSampleBefore(T);if(null!=S){var E=T-(S.originalDts+S.duration);E<=3&&(E=0),i=T-(S.dts+S.duration+E)}else i=0}if(v){var k=T-i,w=this._videoSegmentInfoList.getLastSegmentBefore(T);if(null!=w&&w.beginDts<k){var C=o.default.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);if(C){var A=w.beginDts,L=k-w.beginDts;a.default.v(this.TAG,"InsertPrefixSilentAudio: dts: "+A+", duration: "+L),r.unshift({unit:C,dts:A,pts:A}),y+=C.byteLength}}else v=!1}for(var R=[],x=0;x<r.length;x++){var I=r[x],O=I.unit,D=I.dts-this._dtsBase,P=D,M=!1,j=null,U=0;if(!(D<-.001)){if("mp3"!==this._audioMeta.codec&&h){var B=D;if(this._audioNextDts&&(B=this._audioNextDts),(i=D-B)<=-3*h){a.default.w(this.TAG,"Dropping 1 audio frame (originalDts: "+D+" ms ,curRefDts: "+B+" ms) due to dtsCorrection: "+i+" ms overlap.");continue}if(i>=3*h&&this._fillAudioTimestampGap&&!u.default.safari){M=!0;var F=Math.floor(i/h);a.default.w(this.TAG,"Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.\noriginalDts: "+D+" ms, curRefDts: "+B+" ms, dtsCorrection: "+Math.round(i)+" ms, generate: "+F+" frames"),P=Math.floor(B),U=Math.floor(B+h)-P;var N=o.default.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);null==N&&(a.default.w(this.TAG,"Unable to generate silent frame for "+this._audioMeta.originalCodec+" with "+this._audioMeta.channelCount+" channels, repeat last frame"),N=O),j=[];for(var G=0;G<F;G++){B+=h;var V=Math.floor(B),H=Math.floor(B+h)-V,z={dts:V,pts:V,cts:0,unit:N,size:N.byteLength,duration:H,originalDts:D,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};j.push(z),y+=z.size}this._audioNextDts=B+h}else P=Math.floor(B),U=Math.floor(B+h)-P,this._audioNextDts=B+h}else{if(P=D-i,x!==r.length-1)U=r[x+1].dts-this._dtsBase-i-P;else if(null!=_){U=_.dts-this._dtsBase-i-P}else U=R.length>=1?R[R.length-1].duration:Math.floor(h);this._audioNextDts=P+U}-1===c&&(c=P),R.push({dts:P,pts:P,cts:0,unit:I.unit,size:I.unit.byteLength,duration:U,originalDts:D,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),M&&R.push.apply(R,j)}}if(0===R.length)return n.samples=[],void(n.length=0);f?g=new Uint8Array(y):((g=new Uint8Array(y))[0]=y>>>24&255,g[1]=y>>>16&255,g[2]=y>>>8&255,g[3]=255&y,g.set(s.default.types.mdat,4));for(var W=0;W<R.length;W++){var K=R[W].unit;g.set(K,m),m+=K.byteLength}var q=R[R.length-1];d=q.dts+q.duration;var $=new l.MediaSegmentInfo;$.beginDts=c,$.endDts=d,$.beginPts=c,$.endPts=d,$.originalBeginDts=R[0].originalDts,$.originalEndDts=q.originalDts+q.duration,$.firstSample=new l.SampleInfo(R[0].dts,R[0].pts,R[0].duration,R[0].originalDts,!1),$.lastSample=new l.SampleInfo(q.dts,q.pts,q.duration,q.originalDts,!1),this._isLive||this._audioSegmentInfoList.append($),n.samples=R,n.sequenceNumber++;var Y;Y=f?new Uint8Array:s.default.moof(n,c),n.samples=[],n.length=0;var X={type:"audio",data:this._mergeBoxes(Y,g).buffer,sampleCount:R.length,info:$};f&&p&&(X.timestampOffset=c),this._onMediaSegment("audio",X)}}}},{key:"_remuxVideo",value:function(e,t){if(null!=this._videoMeta){var n=e,r=n.samples,i=void 0,o=-1,u=-1,c=-1,d=-1;if(r&&0!==r.length&&(1!==r.length||t)){var h=8,f=null,p=8+e.length,v=null;if(r.length>1&&(p-=(v=r.pop()).length),null!=this._videoStashedLastSample){var m=this._videoStashedLastSample;this._videoStashedLastSample=null,r.unshift(m),p+=m.length}null!=v&&(this._videoStashedLastSample=v);var g=r[0].dts-this._dtsBase;if(this._videoNextDts)i=g-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())i=0;else{var y=this._videoSegmentInfoList.getLastSampleBefore(g);if(null!=y){var _=g-(y.originalDts+y.duration);_<=3&&(_=0),i=g-(y.dts+y.duration+_)}else i=0}for(var b=new l.MediaSegmentInfo,T=[],S=0;S<r.length;S++){var E=r[S],k=E.dts-this._dtsBase,w=E.isKeyframe,C=k-i,A=E.cts,L=C+A;-1===o&&(o=C,c=L);var R=0;if(S!==r.length-1)R=r[S+1].dts-this._dtsBase-i-C;else if(null!=v){R=v.dts-this._dtsBase-i-C}else R=T.length>=1?T[T.length-1].duration:Math.floor(this._videoMeta.refSampleDuration);if(R<=0&&(a.default.w(this.TAG,"remux video got invalid sample duration "+R+", force to 1"),R=1),w){var x=new l.SampleInfo(C,L,R,E.dts,!0);x.fileposition=E.fileposition,b.appendSyncPoint(x)}T.push({dts:C,pts:L,cts:A,units:E.units,size:E.length,isKeyframe:w,duration:R,originalDts:k,flags:{isLeading:0,dependsOn:w?2:1,isDependedOn:w?1:0,hasRedundancy:0,isNonSync:w?0:1}})}(f=new Uint8Array(p))[0]=p>>>24&255,f[1]=p>>>16&255,f[2]=p>>>8&255,f[3]=255&p,f.set(s.default.types.mdat,4);for(var I=0;I<T.length;I++)for(var O=T[I].units;O.length;){var D=O.shift().data;f.set(D,h),h+=D.byteLength}var P=T[T.length-1];if(u=P.dts+P.duration,d=P.pts+P.duration,this._videoNextDts=u,b.beginDts=o,b.endDts=u,b.beginPts=c,b.endPts=d,b.originalBeginDts=T[0].originalDts,b.originalEndDts=P.originalDts+P.duration,b.firstSample=new l.SampleInfo(T[0].dts,T[0].pts,T[0].duration,T[0].originalDts,T[0].isKeyframe),b.lastSample=new l.SampleInfo(P.dts,P.pts,P.duration,P.originalDts,P.isKeyframe),this._isLive||this._videoSegmentInfoList.append(b),n.samples=T,n.sequenceNumber++,this._forceFirstIDR){var M=T[0].flags;M.dependsOn=2,M.isNonSync=0}var j=s.default.moof(n,o);n.samples=[],n.length=0,this._onMediaSegment("video",{type:"video",data:this._mergeBoxes(j,f).buffer,sampleCount:T.length,info:b})}}}},{key:"_mergeBoxes",value:function(e,t){var n=new Uint8Array(e.byteLength+t.byteLength);return n.set(e,0),n.set(t,e.byteLength),n}},{key:"onInitSegment",get:function(){return this._onInitSegment},set:function(e){this._onInitSegment=e}},{key:"onMediaSegment",get:function(){return this._onMediaSegment},set:function(e){this._onMediaSegment=e}}]),e}();n.default=d},{"../core/media-segment-info.js":8,"../utils/browser.js":41,"../utils/exception.js":42,"../utils/logger.js":43,"./aac-silent.js":38,"./mp4-generator.js":39}],41:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r={};!function(){var e=self.navigator.userAgent.toLowerCase(),t=/(edge)\/([\w.]+)/.exec(e)||/(opr)[\/]([\w.]+)/.exec(e)||/(chrome)[ \/]([\w.]+)/.exec(e)||/(iemobile)[\/]([\w.]+)/.exec(e)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(e)||[],n=/(ipad)/.exec(e)||/(ipod)/.exec(e)||/(windows phone)/.exec(e)||/(iphone)/.exec(e)||/(kindle)/.exec(e)||/(android)/.exec(e)||/(windows)/.exec(e)||/(mac)/.exec(e)||/(linux)/.exec(e)||/(cros)/.exec(e)||[],i={browser:t[5]||t[3]||t[1]||"",version:t[2]||t[4]||"0",majorVersion:t[4]||t[2]||"0",platform:n[0]||""},a={};if(i.browser){a[i.browser]=!0;var s=i.majorVersion.split(".");a.version={major:parseInt(i.majorVersion,10),string:i.version},s.length>1&&(a.version.minor=parseInt(s[1],10)),s.length>2&&(a.version.build=parseInt(s[2],10))}for(var o in i.platform&&(a[i.platform]=!0),(a.chrome||a.opr||a.safari)&&(a.webkit=!0),(a.rv||a.iemobile)&&(a.rv&&delete a.rv,i.browser="msie",a.msie=!0),a.edge&&(delete a.edge,i.browser="msedge",a.msedge=!0),a.opr&&(i.browser="opera",a.opera=!0),a.safari&&a.android&&(i.browser="android",a.android=!0),a.name=i.browser,a.platform=i.platform,r)r.hasOwnProperty(o)&&delete r[o];Object.assign(r,a)}(),n.default=r},{}],42:[function(e,t,n){"use strict";function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n.RuntimeException=function(){function e(t){a(this,e),this._message=t}return s(e,[{key:"toString",value:function(){return this.name+": "+this.message}},{key:"name",get:function(){return"RuntimeException"}},{key:"message",get:function(){return this._message}}]),e}();n.IllegalStateException=function(e){function t(e){return a(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return i(t,e),s(t,[{key:"name",get:function(){return"IllegalStateException"}}]),t}(o),n.InvalidArgumentException=function(e){function t(e){return a(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return i(t,e),s(t,[{key:"name",get:function(){return"InvalidArgumentException"}}]),t}(o),n.NotImplementedException=function(e){function t(e){return a(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return i(t,e),s(t,[{key:"name",get:function(){return"NotImplementedException"}}]),t}(o)},{}],43:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(e){return e&&e.__esModule?e:{default:e}}(e("events")),a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,null,[{key:"e",value:function(t,n){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var r="["+t+"] > "+n;e.ENABLE_CALLBACK&&e.emitter.emit("log","error",r),e.ENABLE_ERROR&&(console.error?console.error(r):console.warn?console.warn(r):console.log(r))}},{key:"i",value:function(t,n){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var r="["+t+"] > "+n;e.ENABLE_CALLBACK&&e.emitter.emit("log","info",r),e.ENABLE_INFO&&(console.info?console.info(r):console.log(r))}},{key:"w",value:function(t,n){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var r="["+t+"] > "+n;e.ENABLE_CALLBACK&&e.emitter.emit("log","warn",r),e.ENABLE_WARN&&(console.warn?console.warn(r):console.log(r))}},{key:"d",value:function(t,n){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var r="["+t+"] > "+n;e.ENABLE_CALLBACK&&e.emitter.emit("log","debug",r),e.ENABLE_DEBUG&&(console.debug?console.debug(r):console.log(r))}},{key:"v",value:function(t,n){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var r="["+t+"] > "+n;e.ENABLE_CALLBACK&&e.emitter.emit("log","verbose",r),e.ENABLE_VERBOSE&&console.log(r)}}]),e}();a.GLOBAL_TAG="flv.js",a.FORCE_GLOBAL_TAG=!1,a.ENABLE_ERROR=!0,a.ENABLE_INFO=!0,a.ENABLE_WARN=!0,a.ENABLE_DEBUG=!0,a.ENABLE_VERBOSE=!0,a.ENABLE_CALLBACK=!1,a.emitter=new i.default,n.default=a},{events:2}],44:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=r(e("events")),s=r(e("./logger.js")),o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return i(e,null,[{key:"getConfig",value:function(){return{globalTag:s.default.GLOBAL_TAG,forceGlobalTag:s.default.FORCE_GLOBAL_TAG,enableVerbose:s.default.ENABLE_VERBOSE,enableDebug:s.default.ENABLE_DEBUG,enableInfo:s.default.ENABLE_INFO,enableWarn:s.default.ENABLE_WARN,enableError:s.default.ENABLE_ERROR,enableCallback:s.default.ENABLE_CALLBACK}}},{key:"applyConfig",value:function(e){s.default.GLOBAL_TAG=e.globalTag,s.default.FORCE_GLOBAL_TAG=e.forceGlobalTag,s.default.ENABLE_VERBOSE=e.enableVerbose,s.default.ENABLE_DEBUG=e.enableDebug,s.default.ENABLE_INFO=e.enableInfo,s.default.ENABLE_WARN=e.enableWarn,s.default.ENABLE_ERROR=e.enableError,s.default.ENABLE_CALLBACK=e.enableCallback}},{key:"_notifyChange",value:function(){var t=e.emitter;if(t.listenerCount("change")>0){var n=e.getConfig();t.emit("change",n)}}},{key:"registerListener",value:function(t){e.emitter.addListener("change",t)}},{key:"removeListener",value:function(t){e.emitter.removeListener("change",t)}},{key:"addLogListener",value:function(t){s.default.emitter.addListener("log",t),s.default.emitter.listenerCount("log")>0&&(s.default.ENABLE_CALLBACK=!0,e._notifyChange())}},{key:"removeLogListener",value:function(t){s.default.emitter.removeListener("log",t),0===s.default.emitter.listenerCount("log")&&(s.default.ENABLE_CALLBACK=!1,e._notifyChange())}},{key:"forceGlobalTag",get:function(){return s.default.FORCE_GLOBAL_TAG},set:function(t){s.default.FORCE_GLOBAL_TAG=t,e._notifyChange()}},{key:"globalTag",get:function(){return s.default.GLOBAL_TAG},set:function(t){s.default.GLOBAL_TAG=t,e._notifyChange()}},{key:"enableAll",get:function(){return s.default.ENABLE_VERBOSE&&s.default.ENABLE_DEBUG&&s.default.ENABLE_INFO&&s.default.ENABLE_WARN&&s.default.ENABLE_ERROR},set:function(t){s.default.ENABLE_VERBOSE=t,s.default.ENABLE_DEBUG=t,s.default.ENABLE_INFO=t,s.default.ENABLE_WARN=t,s.default.ENABLE_ERROR=t,e._notifyChange()}},{key:"enableDebug",get:function(){return s.default.ENABLE_DEBUG},set:function(t){s.default.ENABLE_DEBUG=t,e._notifyChange()}},{key:"enableVerbose",get:function(){return s.default.ENABLE_VERBOSE},set:function(t){s.default.ENABLE_VERBOSE=t,e._notifyChange()}},{key:"enableInfo",get:function(){return s.default.ENABLE_INFO},set:function(t){s.default.ENABLE_INFO=t,e._notifyChange()}},{key:"enableWarn",get:function(){return s.default.ENABLE_WARN},set:function(t){s.default.ENABLE_WARN=t,e._notifyChange()}},{key:"enableError",get:function(){return s.default.ENABLE_ERROR},set:function(t){s.default.ENABLE_ERROR=t,e._notifyChange()}}]),e}();o.emitter=new a.default,n.default=o},{"./logger.js":43,events:2}],45:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t)}return r(t,null,[{key:"install",value:function(){Object.setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Object.assign=Object.assign||function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(null!=r)for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])}return t},String.prototype.startsWith||Object.defineProperty(String.prototype,"startsWith",{value:function(e,t){var n=t>0?0|t:0;return this.substring(n,n+e.length)===e}}),"function"!=typeof self.Promise&&e("es6-promise").polyfill()}}]),t}();i.install(),n.default=i},{"es6-promise":1}],46:[function(e,t,n){"use strict";function r(e){return e.byteOffset%2==0&&e.byteLength%2==0}function i(e){return e.byteOffset%4==0&&e.byteLength%4==0}function a(e,t){for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e,t){return e.byteLength===t.byteLength&&(i(e)&&i(t)?function(e,t){return a(new Uint32Array(e.buffer,e.byteOffset,e.byteLength/4),new Uint32Array(t.buffer,t.byteOffset,t.byteLength/4))}(e,t):r(e)&&r(t)?function(e,t){return a(new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2),new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2))}(e,t):function(e,t){return a(e,t)}(e,t))}},{}],47:[function(e,t,n){"use strict";function r(e,t,n){var r=e;if(t+n<r.length){for(;n--;)if(128!=(192&r[++t]))return!1;return!0}return!1}Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e){for(var t=[],n=e,i=0,a=e.length;i<a;)if(n[i]<128)t.push(String.fromCharCode(n[i])),++i;else{if(n[i]<192);else if(n[i]<224){if(r(n,i,1)){var s=(31&n[i])<<6|63&n[i+1];if(s>=128){t.push(String.fromCharCode(65535&s)),i+=2;continue}}}else if(n[i]<240){if(r(n,i,2)){var o=(15&n[i])<<12|(63&n[i+1])<<6|63&n[i+2];if(o>=2048&&55296!=(63488&o)){t.push(String.fromCharCode(65535&o)),i+=3;continue}}}else if(n[i]<248&&r(n,i,3)){var u=(7&n[i])<<18|(63&n[i+1])<<12|(63&n[i+2])<<6|63&n[i+3];if(u>65536&&u<1114112){u-=65536,t.push(String.fromCharCode(u>>>10|55296)),t.push(String.fromCharCode(1023&u|56320)),i+=4;continue}}t.push(String.fromCharCode(65533)),++i}return t.join("")}},{}]},{},[23])(23)})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("video.js")):"function"==typeof define&&define.amd?define(["video.js"],t):e.videojsFlash=t(e.videojs)}(this,(function(e){"use strict";function t(e){f[e]=function(){return this.el_.vjs_getProperty(e)}}e=e&&e.hasOwnProperty("default")?e.default:e;for(var n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},r="undefined"!=typeof window?window:void 0!==n?n:"undefined"!=typeof self?self:{},i=e.getComponent("Tech"),a=e.dom,s=e.url,o=e.createTimeRange,u=e.mergeOptions,l=r&&r.navigator||{},c=function(e){function t(n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,i));return n.source&&a.ready((function(){this.setSource(n.source)}),!0),n.startTime&&a.ready((function(){this.load(),this.play(),this.currentTime(n.startTime)}),!0),r.videojs=r.videojs||{},r.videojs.Flash=r.videojs.Flash||{},r.videojs.Flash.onReady=t.onReady,r.videojs.Flash.onEvent=t.onEvent,r.videojs.Flash.onError=t.onError,a.on("seeked",(function(){this.lastSeekTarget_=void 0})),a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.createEl=function(){var e=this.options_;e.swf||(e.swf="https://vjs.zencdn.net/swf/5.4.2/video-js.swf");var n=e.techId,r=u({readyFunction:"videojs.Flash.onReady",eventProxyFunction:"videojs.Flash.onEvent",errorEventProxyFunction:"videojs.Flash.onError",autoplay:e.autoplay,stretch:e.stretch||!1,fluent:e.fluent||!1,preload:e.preload,loop:e.loop,muted:e.muted},e.flashVars),i=u({wmode:"opaque",bgcolor:"#000000"},e.params),a=u({id:n,name:n,class:"vjs-tech"},e.attributes);return this.el_=t.embed(e.swf,r,i,a),this.el_.tech=this,this.el_},t.prototype.play=function(){this.ended()&&this.setCurrentTime(0),this.el_.vjs_play()},t.prototype.pause=function(){this.el_.vjs_pause()},t.prototype.src=function(e){return void 0===e?this.currentSrc():this.setSrc(e)},t.prototype.setSrc=function(e){var t=this;e=s.getAbsoluteURL(e),this.el_.vjs_src(e),this.autoplay()&&this.setTimeout((function(){return t.play()}),0)},t.prototype.seeking=function(){return void 0!==this.lastSeekTarget_},t.prototype.setCurrentTime=function(t){var n=this.seekable();n.length&&(t=(t=t>n.start(0)?t:n.start(0))<n.end(n.length-1)?t:n.end(n.length-1),this.lastSeekTarget_=t,this.trigger("seeking"),this.el_.vjs_setProperty("currentTime",t),e.prototype.setCurrentTime.call(this))},t.prototype.currentTime=function(){return this.seeking()?this.lastSeekTarget_||0:this.el_.vjs_getProperty("currentTime")},t.prototype.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.vjs_getProperty("currentSrc")},t.prototype.duration=function(){if(0===this.readyState())return NaN;var e=this.el_.vjs_getProperty("duration");return e>=0?e:1/0},t.prototype.load=function(){this.el_.vjs_load()},t.prototype.poster=function(){this.el_.vjs_getProperty("poster")},t.prototype.setPoster=function(){},t.prototype.seekable=function(){var e=this.duration();return 0===e?o():o(0,e)},t.prototype.buffered=function(){var e=this.el_.vjs_getProperty("buffered");return 0===e.length?o():o(e[0][0],e[0][1])},t.prototype.supportsFullScreen=function(){return!1},t.prototype.enterFullScreen=function(){return!1},t.prototype.getVideoPlaybackQuality=function(){var e=this.el_.vjs_getProperty("getVideoPlaybackQuality");return r.performance&&"function"==typeof r.performance.now?e.creationTime=r.performance.now():r.performance&&r.performance.timing&&"number"==typeof r.performance.timing.navigationStart&&(e.creationTime=r.Date.now()-r.performance.timing.navigationStart),e},t}(i),d=["rtmpConnection","rtmpStream","preload","defaultPlaybackRate","playbackRate","autoplay","stretch","fluent","loop","controls","volume","muted","defaultMuted"],h=["networkState","readyState","initialTime","startOffsetTime","paused","ended","videoWidth","videoHeight"],f=c.prototype,p=0;p<d.length;p++)t(d[p]),function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);f["set"+t]=function(t){return this.el_.vjs_setProperty(e,t)}}(d[p]);for(var v=0;v<h.length;v++)t(h[v]);return c.isSupported=function(){return!!(e.browser.IS_CHROME&&!e.browser.IS_ANDROID||e.browser.IS_SAFARI&&!e.browser.IS_IOS)||c.version()[0]>=10},i.withSourceHandlers(c),c.nativeSourceHandler={},c.nativeSourceHandler.canPlayType=function(e){return e in c.formats?"maybe":""},c.nativeSourceHandler.canHandleSource=function(e,t){var n;return n=e.type?e.type.replace(/;.*/,"").toLowerCase():function(e){var t=s.getFileExtension(e);return t?"video/"+t:""}(e.src),c.nativeSourceHandler.canPlayType(n)},c.nativeSourceHandler.handleSource=function(e,t,n){t.setSrc(e.src)},c.nativeSourceHandler.dispose=function(){},c.registerSourceHandler(c.nativeSourceHandler),c.formats={"video/flv":"FLV","video/x-flv":"FLV","video/mp4":"MP4","video/m4v":"MP4"},c.onReady=function(e){var t=a.$("#"+e),n=t&&t.tech;n&&n.el()&&c.checkReady(n)},c.checkReady=function(e){e.el()&&(e.el().vjs_getProperty?e.triggerReady():this.setTimeout((function(){c.checkReady(e)}),50))},c.onEvent=function(e,t){var n=a.$("#"+e).tech,r=Array.prototype.slice.call(arguments,2);n.setTimeout((function(){n.trigger(t,r)}),1)},c.onError=function(e,t){var n=a.$("#"+e).tech;if("srcnotfound"===t)return n.error(4);"string"==typeof t?n.error("FLASH: "+t):(t.origin="flash",n.error(t))},c.version=function(){var e="0,0,0";try{e=new r.ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version").replace(/\D+/g,",").match(/^,?(.+),?$/)[1]}catch(t){try{l.mimeTypes["application/x-shockwave-flash"].enabledPlugin&&(e=(l.plugins["Shockwave Flash 2.0"]||l.plugins["Shockwave Flash"]).description.replace(/\D+/g,",").match(/^,?(.+),?$/)[1])}catch(e){}}return e.split(",")},c.embed=function(e,t,n,r){var i=c.getEmbedCode(e,t,n,r);return a.createEl("div",{innerHTML:i}).childNodes[0]},c.getEmbedCode=function(e,t,n,r){var i="",a="",s="";return t&&Object.getOwnPropertyNames(t).forEach((function(e){i+=e+"="+t[e]+"&amp;"})),n=u({movie:e,flashvars:i,allowScriptAccess:"always",allowNetworking:"all"},n),Object.getOwnPropertyNames(n).forEach((function(e){a+='<param name="'+e+'" value="'+n[e]+'" />'})),r=u({data:e,width:"100%",height:"100%"},r),Object.getOwnPropertyNames(r).forEach((function(e){s+=e+'="'+r[e]+'" '})),'<object type="application/x-shockwave-flash" '+s+">"+a+"</object>"},function(e){e.streamingFormats={"rtmp/mp4":"MP4","rtmp/flv":"FLV"},e.streamFromParts=function(e,t){return e+"&"+t},e.streamToParts=function(e){var t={connection:"",stream:""};if(!e)return t;var n=e.search(/&(?![\w-]+=)/),r=void 0;return-1!==n?r=n+1:0===(n=r=e.lastIndexOf("/")+1)&&(n=r=e.length),t.connection=e.substring(0,n),t.stream=e.substring(r,e.length),t},e.isStreamingType=function(t){return t in e.streamingFormats},e.RTMP_RE=/^rtmp[set]?:\/\//i,e.isStreamingSrc=function(t){return e.RTMP_RE.test(t)},e.rtmpSourceHandler={},e.rtmpSourceHandler.canPlayType=function(t){return e.isStreamingType(t)?"maybe":""},e.rtmpSourceHandler.canHandleSource=function(t,n){return e.rtmpSourceHandler.canPlayType(t.type)||(e.isStreamingSrc(t.src)?"maybe":"")},e.rtmpSourceHandler.handleSource=function(t,n,r){var i=e.streamToParts(t.src);n.setRtmpConnection(i.connection),n.setRtmpStream(i.stream)},e.registerSourceHandler(e.rtmpSourceHandler)}(c),i.getTech("Flash")?(e.log.warn("Not using videojs-flash as it appears to already be registered"),e.log.warn("videojs-flash should only be used with video.js@6 and above")):e.registerTech("Flash",c),c.VERSION="2.1.2",c})),function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).videojsFlvjs=e()}}((function(){return function e(t,n,r){function i(s,o){if(!n[s]){if(!t[s]){var u="function"==typeof require&&require;if(!o&&u)return u(s,!0);if(a)return a(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[s]={exports:{}};t[s][0].call(c.exports,(function(e){return i(t[s][1][e]||e)}),c,c.exports,e,t,n,r)}return n[s].exports}for(var a="function"==typeof require&&require,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(e,t,n){(function(e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),r=function(e){return e&&e.__esModule?e:{default:e}}("undefined"!=typeof window?window.videojs:void 0!==e?e.videojs:null),i=r.default.getTech("Html5"),a=r.default.mergeOptions||r.default.util.mergeOptions,s={mediaDataSource:{},config:{}},o=function(e){function n(e,t){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),e=a(s,e),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e,t))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,e),t(n,[{key:"setSrc",value:function(e){this.flvPlayer&&(this.flvPlayer.unload(),this.flvPlayer.detachMediaElement(),this.flvPlayer.destroy());var t=this.options_.mediaDataSource,n=this.options_.config;t.type=void 0===t.type?"flv":t.type,t.url=e,this.flvPlayer=window.flvjs.createPlayer(t,n),this.flvPlayer.attachMediaElement(this.el_),this.flvPlayer.load()}},{key:"dispose",value:function(){this.flvPlayer&&(this.flvPlayer.detachMediaElement(),this.flvPlayer.unload(),this.flvPlayer.destroy(),this.flvPlayer=null),function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,n,r)}if("value"in i)return i.value;var s=i.get;return void 0!==s?s.call(r):void 0}(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"dispose",this).call(this)}}]),n}(i);o.isSupported=function(){return window.flvjs&&window.flvjs.isSupported()},o.formats={"video/flv":"FLV","video/x-flv":"FLV"},o.canPlayType=function(e){return o.isSupported()&&e in o.formats?"maybe":""},o.canPlaySource=function(e,t){return o.canPlayType(e.type)},o.VERSION="0.2.0",r.default.registerTech("Flvjs",o),n.default=o}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)})),function(e){function t(r){var i;return(n[r]||(i=n[r]={i:r,l:!1,exports:{}},e[r].call(i.exports,i,i.exports,t),i.l=!0,i)).exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var i in e)t.d(r,i,function(t){return e[t]}.bind(null,i));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){"use strict";n=n(1),window.videojs&&(n.registerConfigPlugin(window.videojs),n.registerSourceHandler(window.videojs)),n={register:n.registerSourceHandler};var r="hlsSourceHandler";window[r]||(window[r]=n)},function(e,t,n){"use strict";function r(e){var t=this;e&&(t.srOptions_||(t.srOptions_={}),t.srOptions_.hlsjsConfig||(t.srOptions_.hlsjsConfig=e.hlsjsConfig),t.srOptions_.captionConfig||(t.srOptions_.captionConfig=e.captionConfig))}var 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},a=n(2);e.exports={registerSourceHandler:function(e){function t(t,n){function s(e){1===T[a.ErrorTypes.MEDIA_ERROR]?_.recoverMediaError():2===T[a.ErrorTypes.MEDIA_ERROR]?(_.swapAudioCodec(),_.recoverMediaError()):2<T[a.ErrorTypes.MEDIA_ERROR]&&(n.error=function(){return e},n.trigger("error"))}function o(e){_.nextLevel=e}function u(e,t){if(R){if("boolean"==typeof t){R[e]._enabled=t;for(var n=!0,r=0;r<R.length;r++)if(!R[r]._enabled){n=!1;break}if(n)_.currentLevel=-1;else{for(var i=R.length-1;0<=i&&!R[i]._enabled;i--);_.currentLevel=i}}return R[e]._enabled}return!1}function l(e,t){R&&(R.selectedIndex_=t.level,R.trigger({selectedIndex:t.level,type:"change"}))}function c(){var e,t;E&&(e=[],1<E.levels.length&&(t={id:-1,label:"auto",selected:-1===_.manualLevel},e.push(t)),E.levels.forEach((function(t,n){var r={};r.id=n,r.selected=n===_.manualLevel,r.label=(n=t).height?n.height+"p":n.width?Math.round(9*n.width/16)+"p":n.bitrate?n.bitrate/1e3+"kbps":0,e.push(r)})),t={qualityData:{video:e},qualitySwitchCallback:o},n.trigger("loadedqualitydata",t),b.removeEventListener("playing",c))}function d(){for(var e=n.audioTracks(),t=0;t<e.length;t++)if(e[t].enabled){_.audioTrack=t;break}}function h(){var t=_.audioTracks,r=n.audioTracks();if(1<t.length&&0===r.length){for(var i=0;i<t.length;i++)r.addTrack(new e.AudioTrack({id:i,kind:"alternative",label:t[i].name||t[i].lang,language:t[i].lang,enabled:i===_.audioTrack}));r.addEventListener("change",d)}}function f(e){return e.label||e.language}function p(e,t){return f(e)===f(t)&&e.kind===t.kind}function v(){for(var e=L.textTracks(),t=null,n=0;n<e.length;n++)if("showing"===e[n].mode){t=e[n];break}for(var r=b.textTracks,i=0;i<r.length;i++)"subtitles"!==r[i].kind&&"captions"!==r[i].kind||(r[i].mode=t&&p(r[i],t)?"showing":"disabled")}function m(){_.startLoad(-1),b.removeEventListener("play",m)}function g(){for(var e=function(e){for(var t=[],n=0;n<e.length;n++)"subtitles"!==e[n].kind&&"captions"!==e[n].kind||t.push(e[n]);return t}(b.textTracks),t=L.textTracks(),n=0;n<e.length;n++){for(var r,i=!1,a=0;a<t.length;a++)if(p(e[n],t[a])){i=!0;break}i||(r=e[n],L.addRemoteTextTrack({kind:r.kind,label:f(r),language:r.language,srclang:r.language},!1))}v(),x||(t.addEventListener("change",v),x=!0)}function y(e,t){E=t,function(){if(E&&(R=L.qualityLevels&&L.qualityLevels())){n.hls={};for(var e=0;e<E.levels.length;e++){var t,r=E.levels[e];(t={id:t="hlsjs-"+e,label:t,width:r.width,height:r.height,bandwidth:r.bitrate,bitrate:r.bitrate,_enabled:!1}).enabled=u.bind(this,e),R.addQualityLevel(t)}}}()}n.name_="livehls";var _,b=n.el(),T={},S=null,E=null,k=null,w=null,C=null,A=null,L=e(n.options_.playerId),R=L.qualityLevels&&L.qualityLevels(),x=(R&&L.hlsQualitySelector&&(n.hls={}),!1);this.duration=function(){return S||b.duration||0},this.seekable=function(){var t,n;return _.media?k?(t=Math.round(_.media.duration-w),n=Math.round(_.media.duration-C),e.createTimeRanges(t,n)):e.createTimeRanges(0,_.media.duration):e.createTimeRanges()},this.dispose=function(){b.removeEventListener("play",m),b.textTracks.removeEventListener("addtrack",g),b.removeEventListener("playing",c),L.textTracks().removeEventListener("change",v),x=!1,L.audioTracks().removeEventListener("change",d),_.destroy()},b.addEventListener("error",(function(e){var t=e.currentTarget.error;switch(t.code){case t.MEDIA_ERR_ABORTED:break;case t.MEDIA_ERR_DECODE:s(t);break;case t.MEDIA_ERR_NETWORK:case t.MEDIA_ERR_SRC_NOT_SUPPORTED:break;default:t.message}})),function(){var e,o=L.srOptions_&&L.srOptions_.hlsjsConfig||n.options_.hlsjsConfig,u=((o=(A=o?function(e){for(var t={},n=Object.keys(e),r=0;r<n.length;r++)t[n[r]]=e[n[r]];return t}(o):{},-1!==["","auto"].indexOf(b.preload)||b.autoplay||void 0!==A.autoStartLoad||(A.autoStartLoad=!1),L.srOptions_&&L.srOptions_.captionConfig||n.options_.captionConfig))&&(A.cueHandler=(e=o,{newCue:function(t,n,r,a){for(var s,o,u,l=window.VTTCue||window.TextTrackCue,c=0;c<a.rows.length;c++)if(u="",!(s=a.rows[c]).isEmpty()){for(var d=0;d<s.chars.length;d++)u+=s.chars[d].uchar;if(o=new l(n,r,u.trim()),null!=e&&"object"===(void 0===e?"undefined":i(e)))for(var h=Object.keys(e),f=0;f<h.length;f++)o[h[f]]=e[h[f]];t.addCue(o),r===n&&t.addCue(new l(r+5,""))}}})),!1===A.autoStartLoad&&b.addEventListener("play",m),b.addEventListener("playing",c),_=new a(A),"beforeinitialize");if(void 0!==r[u])for(var d=0;d<r[u].length;d++)r[u][d](L,_);_.on(a.Events.ERROR,(function(e,t){var r={message:"livehls error: "+t.type+" - fatal: "+t.fatal+" - "+t.details};if(T[t.type]?T[t.type]+=1:T[t.type]=1,t.fatal)switch(t.type){case a.ErrorTypes.NETWORK_ERROR:r.code=2,n.error=function(){return r},n.trigger("error");break;case a.ErrorTypes.MEDIA_ERROR:r.code=3,s(r);break;default:_.destroy(),n.error=function(){return r},n.trigger("error")}})),_.on(a.Events.AUDIO_TRACKS_UPDATED,h),_.on(a.Events.MANIFEST_PARSED,y),_.on(a.Events.LEVEL_LOADED,(function(e,t){A.liveSyncDuration?C=A.liveSyncDuration:A.liveSyncDurationCount&&(C=A.liveSyncDurationCount*t.details.targetduration),k=t.details.live,w=t.details.totalduration,S=k?1/0:t.details.totalduration})),_.once(a.Events.FRAG_LOADED,(function(){n.trigger("loadedmetadata")})),_.on(a.Events.LEVEL_SWITCHED,l),_.attachMedia(b),b.textTracks.addEventListener("addtrack",g),_.loadSource(t.src)}()}var n,r={};if(t.addHook=function(e,t){r[e]=r[e]||[],r[e].push(t)},t.removeHook=function(e,t){return void 0!==r[e]&&-1!==(t=r[e].indexOf(t))&&(r[e].splice(t,1),!0)},a.isSupported()){if("function"==typeof e.getTech)n=e.getTech("Html5");else{if("function"!=typeof e.getComponent)return;n=e.getComponent("Html5")}n&&(n.registerSourceHandler({canHandleSource:function(e){return/^application\/x-mpegURL|application\/vnd\.apple\.mpegurl$/i.test(e.type)?"probably":/\.m3u8/i.test(e.src)?"maybe":""},handleSource:function(e,n){return n.hlsProvider&&n.hlsProvider.dispose(),n.hlsProvider=new t(e,n),n.hlsProvider}},0),e.Html5Hlsjs=t)}},registerConfigPlugin:function(e){(e.registerPlugin||e.plugin)("livehls",r)}}},function(e,t,n){"use strict";var r,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};!function a(s){var o;o=function(){function e(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(e=function(){return!!t})()}function t(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)),r}function n(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?t(Object(i),!0).forEach((function(t){var n,a;n=e,a=i[t=t],(t=r(t))in n?Object.defineProperty(n,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[t]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function r(e){return"symbol"==(void 0===(e=function(e,t){if("object"!=(void 0===e?"undefined":i(e))||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return String(e);if("object"!=(void 0===(n=n.call(e,"string"))?"undefined":i(n)))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(e))?"undefined":i(e))?e:e+""}function o(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}function u(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(){return(l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n,r=arguments[t];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function c(e,t){e.prototype=Object.create(t.prototype),h(e.prototype.constructor=e,t)}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function h(e,t){return(h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function f(t){var n="function"==typeof Map?new Map:void 0;return(f=function(t){function r(){return function(t,n,r){var i;return e()?Reflect.construct.apply(null,arguments):((i=[null]).push.apply(i,n),n=new(t.bind.apply(t,i)),r&&h(n,r.prototype),n)}(t,arguments,d(this).constructor)}if(null===t||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(t))return n.get(t);n.set(t,r)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),h(r,t)})(t)}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function v(e,t){this.trace=void 0,this.debug=void 0,this.log=void 0,this.warn=void 0,this.info=void 0,this.error=void 0,e="["+e+"]:",this.trace=m,this.debug=t.debug.bind(null,e),this.log=t.log.bind(null,e),this.warn=t.warn.bind(null,e),this.info=t.info.bind(null,e),this.error=t.error.bind(null,e)}function m(){}function g(){return l({},Xn)}function y(e,t,n){return t[e]?t[e].bind(t):(t=e,e=n,(n=self.console[t])?n.bind(self.console,(e?"["+e+"] ":"")+"["+t+"] >"):m)}function _(e,t,n){var r=g();if("object"===("undefined"==typeof console?"undefined":i(console))&&!0===e||"object"===(void 0===e?"undefined":i(e))){var a=["debug","log","info","warn","error"];a.forEach((function(t){r[t]=y(t,e,n)}));try{r.log('Debug logs enabled for "'+t+'" in hls.js version '+void 0)}catch(t){return g()}a.forEach((function(t){Jn[t]=y(t,e)}))}else l(Jn,r);return r}function b(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}function T(e){return Uint8Array.from(atob(e),(function(e){return e.charCodeAt(0)}))}function S(e){return Uint8Array.from(unescape(encodeURIComponent(e)),(function(e){return e.charCodeAt(0)}))}function E(e){return"AES-128"===e||"AES-256"===e||"AES-256-CTR"===e}function k(e){switch(e){case"AES-128":case"AES-256":return sr;case"AES-256-CTR":return or;default:throw new Error("invalid full segment method "+e)}}function w(e){switch(e){case cr.FAIRPLAY:return lr.FAIRPLAY;case cr.PLAYREADY:return lr.PLAYREADY;case cr.WIDEVINE:return lr.WIDEVINE;case cr.CLEARKEY:return lr.CLEARKEY}}function C(e){switch(e){case lr.FAIRPLAY:return cr.FAIRPLAY;case lr.PLAYREADY:return cr.PLAYREADY;case lr.WIDEVINE:return cr.WIDEVINE;case lr.CLEARKEY:return cr.CLEARKEY}}function A(e){var t=e.drmSystems,n=(e=e.widevineLicenseUrl,t?[lr.FAIRPLAY,lr.WIDEVINE,lr.PLAYREADY,lr.CLEARKEY].filter((function(e){return!!t[e]})):[]);return!n[lr.WIDEVINE]&&e&&n.push(lr.WIDEVINE),n}function L(e,t,n){return Uint8Array.prototype.slice?e.slice(t,n):new Uint8Array(Array.prototype.slice.call(e,t,n))}function R(e,t){return t+10<=e.length&&73===e[t]&&68===e[t+1]&&51===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128}function x(e,t){return t+10<=e.length&&51===e[t]&&68===e[t+1]&&73===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128}function I(e,t){for(var n=t,r=0;R(e,t);)r=(r+=10)+fr(e,t+6),x(e,t+10)&&(r+=10),t+=r;if(0<r)return e.subarray(n,n+r)}function O(e){for(var t=P(e),n=0;n<t.length;n++){var r=t[n];if(D(r))return j(r)}}function D(e){return e&&"PRIV"===e.key&&"com.apple.streaming.transportStreamTimestamp"===e.info}function P(e){for(var t,n=0,r=[];R(e,n);){for(var i=fr(e,n+6),a=(n+=10)+i;n+8<a;){o=e.subarray(n),s=void 0;var s={type:s=String.fromCharCode(o[0],o[1],o[2],o[3]),size:t=fr(o,4),data:o.subarray(10,10+t)},o=M(s);o&&r.push(o),n+=s.size+10}x(e,n)&&(n+=10)}return r}function M(e){return("PRIV"===e.type?pr:"W"===e.type[0]?mr:vr)(e)}function j(e){var t;if(8===e.data.byteLength)return t=1&(e=new Uint8Array(e.data))[3],e=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7],e/=45,t&&(e+=47721858.84),Math.round(e)}function U(e){return String.fromCharCode.apply(null,e)}function B(e,t){return(e=e[t]<<8|e[t+1])<0?65536+e:e}function F(e,t){return(e=G(e,t))<0?4294967296+e:e}function N(e,t){var n=F(e,t);return(n*=Math.pow(2,32))+F(e,t+4)}function G(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}function V(e,t,n){e[t]=n>>24,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=255&n}function H(e,t){var n=[];if(t.length)for(var r=e.byteLength,i=0;i<r;){var a,s=1<(s=F(e,i))?i+s:r;U(e.subarray(i+4,i+8))===t[0]&&(1===t.length?n.push(e.subarray(i+8,s)):(a=H(e.subarray(i+8,s),t.slice(1))).length&&br.apply(n,a)),i=s}return n}function z(e){for(var t=[],r=H(e,["moov","trak"]),i=0;i<r.length;i++){var a,s,o=r[i],u=H(o,["tkhd"])[0];u&&(u=F(u,0===u[0]?12:20),a=H(o,["mdia","mdhd"])[0])&&(a=F(a,0===a[0]?12:20),s=H(o,["mdia","hdlr"])[0])&&(s=U(s.subarray(8,12)),s={soun:er,vide:tr}[s])&&(o=function(e){var t,n=e.subarray(8),r=n.subarray(86),i=U(n.subarray(4,8)),a=i;switch((e="enca"===i||"encv"===i)&&(t=H(n,[i])[0],H(t.subarray("enca"===i?28:78),["sinf"]).forEach((function(e){var t=H(e,["schm"])[0];!t||"cbcs"!==(t=U(t.subarray(4,8)))&&"cenc"!==t||(t=H(e,["frma"])[0])&&(a=U(t))}))),a){case"avc1":case"avc2":case"avc3":case"avc4":var s=H(r,["avcC"])[0];a+="."+K(s[1])+K(s[2])+K(s[3]);break;case"mp4a":if(s=H(n,[i])[0],(s=H(s.subarray(28),["esds"])[0])&&7<s.length){var o=4;if(3!==s[o++])break;if(o=W(s,o),o+=2,128&(v=s[o++])&&(o+=2),64&v&&(o+=s[o++]),4!==s[o++])break;if(o=W(s,o),64!==(v=s[o++]))break;if(a+="."+K(v),o+=12,5!==s[o++])break;o=W(s,o),31===(u=(248&(v=s[o++]))>>3)&&(u+=1+((7&v)<<3)+((224&s[o])>>5)),a+="."+u}break;case"hvc1":case"hev1":o=["","A","B","C"][(s=(v=H(r,["hvcC"])[0])[1])>>6];for(var u=31&s,l=F(v,2),c=(s=(32&s)>>5?"H":"L",v[12]),d=v.subarray(6,12),h=(a=(a=(a+="."+o+u)+"."+l.toString(16).toUpperCase())+"."+s+c,""),f=d.length;f--;){var p=d[f];(p||h)&&(h="."+(p=p.toString(16).toUpperCase())+h)}a+=h;break;case"dvh1":case"dvhe":o=(v=H(r,["dvcC"])[0])[2]>>1&127,u=v[2]<<5&32|v[3]>>3&31,a+="."+q(o)+"."+q(u);break;case"vp09":s=(l=H(r,["vpcC"])[0])[4],c=l[5],v=l[6]>>4&15,a+="."+q(s)+"."+q(c)+"."+q(v);break;case"av01":u=(o=H(r,["av1C"])[0])[1]>>>5,l=31&o[1],s=o[2]>>>7?"H":"M",c=(64&o[2])>>6;var v=(32&o[2])>>5,m=(v=2==u&&c?v?12:10:c?10:8,c=(16&o[2])>>4,(8&o[2])>>3),g=(4&o[2])>>2;o=3&o[2];a+="."+u+"."+q(l)+s+"."+q(v)+"."+c+"."+m+g+o+".01.01.01.0"}return{codec:a,encrypted:e}}(H(o,["mdia","minf","stbl","stsd"])[0]),t[u]={timescale:a,type:s},t[s]=n({timescale:a,id:u},o))}return H(e,["moov","mvex","trex"]).forEach((function(e){var n=F(e,4);(n=t[n])&&(n.default={duration:F(e,12),flags:F(e,20)})})),t}function W(e,t){for(var n=t+5;128&e[t++]&&t<n;);return t}function K(e){return("0"+e.toString(16).toUpperCase()).slice(-2)}function q(e){return(e<10?"0":"")+e}function $(e){var t=H(e,["schm"])[0];return!t||"cbcs"!==(t=U(t.subarray(4,8)))&&"cenc"!==t?(Qn.error("[eme] missing 'schm' box"),null):H(e,["schi","tenc"])[0]}function Y(e,t){var n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}function X(e,t){var n=[],r=t.samples,i=t.timescale,a=t.id,s=!1;return H(r,["moof"]).map((function(o){var u=o.byteOffset-8;H(o,["traf"]).map((function(o){var l=H(o,["tfdt"]).map((function(e){var t=e[0],n=F(e,4);return(n=1===t?(n*=Math.pow(2,32))+F(e,8):n)/i}))[0];return void 0!==l&&(e=l),H(o,["tfhd"]).map((function(l){var c=F(l,4),d=16777215&F(l,0),h=0,f=0,p=8;c===a&&(0!=(1&d)&&(p+=8),0!=(2&d)&&(p+=4),0!=(8&d)&&(h=F(l,p),p+=4),0!=(16&d)&&(f=F(l,p),p+=4),0!=(32&d)&&(p+=4),"video"===t.type&&(c=t.codec,s=!!c&&("hvc1"===(c=(l=c.indexOf("."))<0?c:c.substring(0,l))||"hev1"===c||"dvh1"===c||"dvhe"===c)),H(o,["trun"]).map((function(a){for(var o,l,c=a[0],d=16777215&F(a,0),p=0,v=0!=(256&d),m=0,g=0!=(512&d),y=0,_=0!=(1024&d),b=0!=(2048&d),T=0,S=F(a,4),E=8,k=(0!=(1&d)&&(p=F(a,E),E+=4),0!=(4&d)&&(E+=4),p+u),w=0;w<S;w++){if(v?(m=F(a,E),E+=4):m=h,g?(y=F(a,E),E+=4):y=f,_&&(E+=4),b&&(T=(0===c?F:G)(a,E),E+=4),t.type===tr)for(var C=0;C<y;){var A=F(r,k);o=s,l=r[k+=4],(o?39==(o=l>>1&63)||40==o:6==(31&l))&&J(r.subarray(k,k+A),s?2:1,e+T/i,n),k+=A,C+=A+4}e+=m/i}})))}))}))})),n}function J(e,t,n,r){for(var i=Q(e),a=0,s=(a+=t,0),o=0,u=0;a<i.length;){for(s=0;!(a>=i.length)&&(s+=u=i[a++],255===u););for(o=0;!(a>=i.length)&&(o+=u=i[a++],255===u););var l=i.length-a,c=a;if(o<l)a+=o;else if(l<o){Qn.error("Malformed SEI payload. "+o+" is too small, only "+l+" bytes left to parse.");break}if(4===s){if(181===i[c++]&&(l=B(i,c),c+=2,49===l&&(l=F(i,c),c+=4,1195456820===l&&3===(l=i[c++])))){var d=i[c++],h=64&d,f=h?2+3*(31&d):0,p=new Uint8Array(f);if(h){p[0]=d;for(var v=1;v<f;v++)p[v]=i[c++]}r.push({type:l,payloadType:s,pts:n,bytes:p})}}else if(5===s&&16<o){for(var m=[],g=0;g<16;g++){var y=i[c++].toString(16);m.push(1==y.length?"0"+y:y),3!==g&&5!==g&&7!==g&&9!==g||m.push("-")}for(var _=o-16,b=new Uint8Array(_),T=0;T<_;T++)b[T]=i[c++];r.push({payloadType:s,pts:n,uuid:m.join(""),userData:gr(b),userDataBytes:b})}}}function Q(e){for(var t=e.byteLength,n=[],r=1;r<t-2;)0===e[r]&&0===e[r+1]&&3===e[r+2]?(n.push(r+2),r+=2):r++;if(0===n.length)return e;var i=t-n.length,a=new Uint8Array(i),s=0;for(r=0;r<i;s++,r++)s===n[0]&&(s++,n.shift()),a[r]=e[s];return a}function Z(e){return kr.test(e)}function ee(e,t,n){if(null!==e.variableList||e.hasVariableRefs)for(var r=n.length;r--;){var i=n[r],a=t[i];a&&(t[i]=te(e,a))}}function te(e,t){var n;return null!==e.variableList||e.hasVariableRefs?(n=e.variableList,t.replace(kr,(function(t){var r=t.substring(2,t.length-1),i=null==n?void 0:n[r];return void 0===i?(e.playlistParsingError||(e.playlistParsingError=new Error('Missing preceding EXT-X-DEFINE tag for Variable Reference: "'+r+'"')),t):i}))):t}function ne(e,t,n){var r,i,a=e.variableList;if(a||(e.variableList=a={}),"QUERYPARAM"in t){r=t.QUERYPARAM;try{var s=new self.URL(n).searchParams;if(!s.has(r))throw new Error('"'+r+'" does not match any query parameter in URI: "'+n+'"');i=s.get(r)}catch(t){e.playlistParsingError||(e.playlistParsingError=new Error("EXT-X-DEFINE QUERYPARAM: "+t.message))}}else r=t.NAME,i=t.VALUE;r in a?e.playlistParsingError||(e.playlistParsingError=new Error('EXT-X-DEFINE duplicate Variable Name declarations: "'+r+'"')):a[r]=i||""}function re(e){if(void 0===e&&(e=!0),"undefined"!=typeof self)return(e||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function ie(e,t,n){return void 0===n&&(n=!0),!e.split(",").some((function(e){return!ae(e,t,n)}))}function ae(e,t,n){return null!=(n=null==(n=re(n=void 0===n||n))?void 0:n.isTypeSupported(se(e,t)))&&n}function se(e,t){return t+'/mp4;codecs="'+e+'"'}function oe(e){return e?(e=e.substring(0,4),wr.video[e]):2}function ue(e){return e.split(",").reduce((function(e,t){var n=wr.video[t];return n?(2*n+e)/(e?3:2):(wr.audio[t]+e)/(e?2:1)}),0)}function le(e,t){return void 0===t&&(t=!0),e.replace(Ar,(function(e){var n=e.toLowerCase(),r=t;if(void 0===r&&(r=!0),Cr[n])return Cr[n];for(var i,a={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"],"mp4a.40.34":["mp3"]}[n],s=0;s<a.length;s++){if(ae(a[s],"audio",r))return Cr[n]=a[s],a[s];if("mp3"===a[s]&&null!=(i=re(r))&&i.isTypeSupported("audio/mpeg"))return""}return n}))}function ce(e,t){return e&&"mp4a"!==e?e:t}function de(e,t,n){ee(n,e=new Yn(e),["KEYFORMAT","KEYFORMATVERSIONS","URI","IV","URI"]),n=null!=(n=e.METHOD)?n:"";var r=e.URI,i=e.hexadecimalInteger("IV"),a=e.KEYFORMATVERSIONS,s=null!=(s=e.KEYFORMAT)?s:"identity";r&&e.IV&&!i&&Qn.error("Invalid IV: "+e.IV),e=r?Dr.resolve(r,t):"",r=(a||"1").split("/").map(Number).filter(Number.isFinite);return new Er(n,e,s,r,i)}function he(e){return e=new Yn(e).decimalFloatingPoint("TIME-OFFSET"),Gn(e)?e:null}function fe(e,t,n){(t=t[n])&&(e[n]=t)}function pe(e,t){e.rawProgramDateTime?e.programDateTime=Date.parse(e.rawProgramDateTime):null!=t&&t.programDateTime&&(e.programDateTime=t.endProgramDateTime),Gn(e.programDateTime)||(e.programDateTime=null,e.rawProgramDateTime=null)}function ve(e,t,n,r){e.relurl=t.URI,t.BYTERANGE&&e.setByteRange(t.BYTERANGE),e.level=n,e.sn="initSegment",r&&(e.levelkeys=r),e.initSegment=null}function me(e,t,n){e.levelkeys=t,(n=n.encryptedFragments).length&&n[n.length-1].levelkeys===t||!Object.keys(t).some((function(e){return t[e].isCommonEncryption}))||n.push(e)}function ge(e){switch(e.type){case jr:return Fr;case Ur:return Nr;default:return Br}}function ye(e,t){return void 0!==(e=e.url)&&0!==e.indexOf("data:")?e:t.url}function _e(e,t){var n;try{n=new Event("addtrack")}catch(e){(n=document.createEvent("Event")).initEvent("addtrack",!1,!1)}n.track=e,t.dispatchEvent(n)}function be(e,t){var n=e.mode;if("disabled"===n&&(e.mode="hidden"),e.cues&&!e.cues.getCueById(t.id))try{if(e.addCue(t),!e.cues.getCueById(t.id))throw new Error("addCue is failed for: "+t)}catch(n){Qn.debug("[texttrack-utils]: "+n);try{var r=new self.TextTrackCue(t.startTime,t.endTime,t.text);r.id=t.id,e.addCue(r)}catch(n){Qn.debug("[texttrack-utils]: Legacy TextTrackCue fallback failed: "+n)}}"disabled"===n&&(e.mode=n)}function Te(e){var t=e.mode;if("disabled"===t&&(e.mode="hidden"),e.cues)for(var n=e.cues.length;n--;)e.removeCue(e.cues[n]);"disabled"===t&&(e.mode=t)}function Se(e,t,n,r){var i=e.mode;if("disabled"===i&&(e.mode="hidden"),e.cues&&0<e.cues.length)for(var a=function(e,t,n){var r=[],i=function(e,t){if(t<e[0].startTime)return 0;var n=e.length-1;if(t>e[n].endTime)return-1;for(var r=0,i=n;r<=i;){var a=Math.floor((i+r)/2);if(t<e[a].startTime)i=a-1;else{if(!(t>e[a].startTime&&r<n))return a;r=a+1}}return e[r].startTime-t<t-e[i].startTime?r:i}(e,t);if(-1<i)for(var a=i,s=e.length;a<s;a++){var o=e[a];if(o.startTime>=t&&o.endTime<=n)r.push(o);else if(o.startTime>n)return r}return r}(e.cues,t,n),s=0;s<a.length;s++)r&&!r(a[s])||e.removeCue(a[s]);"disabled"===i&&(e.mode=i)}function Ee(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];"subtitles"!==r.kind&&"captions"!==r.kind||!r.label||t.push(e[n])}return t}function ke(){if("undefined"!=typeof self)return self.VTTCue||self.TextTrackCue}function we(e,t,r,i,a){var s=new e(t,r,"");try{s.value=i,a&&(s.type=a)}catch(o){s=new e(t,r,JSON.stringify(a?n({type:a},i):i))}return s}function Ce(e,t){return e.getTime()/1e3-t}function Ae(e,t){return!(!t||!e)&&-1!==e.indexOf(t)}function Le(e,t){var n,r=t.startPTS;Gn(r)?(n=0,(r=t.sn>e.sn?(n=r-e.start,e):(n=e.start-r,t)).duration!==n&&(r.duration=n)):t.sn>e.sn?e.cc===t.cc&&e.minEndPTS?t.start=e.start+(e.minEndPTS-e.start):t.start=e.start+e.duration:t.start=Math.max(e.start-t.duration,0)}function Re(e,t,n,r,i,a){r-n<=0&&(Qn.warn("Fragment should have a positive duration",t),r=n+t.duration,a=i+t.duration);var s,o=n,u=r,l=t.startPTS,c=t.endPTS,d=(Gn(l)&&(d=Math.abs(l-n),Gn(t.deltaPTS)?t.deltaPTS=Math.max(d,t.deltaPTS):t.deltaPTS=d,o=Math.max(n,l),n=Math.min(n,l),i=Math.min(i,t.startDTS),u=Math.min(r,c),r=Math.max(r,c),a=Math.max(a,t.endDTS)),n-t.start);0!==t.start&&(t.start=n),t.duration=r-t.start,t.startPTS=n,t.maxStartPTS=o,t.startDTS=i,t.endPTS=r,t.minEndPTS=u,t.endDTS=a,l=t.sn;if(!e||l<e.startSN||l>e.endSN)return 0;c=l-e.startSN;var h=e.fragments;for(h[c]=t,s=c;0<s;s--)Le(h[s],h[s-1]);for(s=c;s<h.length-1;s++)Le(h[s],h[s+1]);return e.fragmentHint&&Le(h[h.length-1],e.fragmentHint),e.PTSKnown=e.alignedSliding=!0,d}function xe(e,t){for(var n=null,r=e.fragments,i=r.length-1;0<=i;i--){var a=r[i].initSegment;if(a){n=a;break}}e.fragmentHint&&delete e.fragmentHint.endPTS;for(var s,o=0,u=e,c=t,d=c.skippedSegments,h=Math.max(u.startSN,c.startSN)-c.startSN,f=(u.fragmentHint?1:0)+(d?c.endSN:Math.min(u.endSN,c.endSN))-c.startSN,p=c.startSN-u.startSN,v=c.fragmentHint?c.fragments.concat(c.fragmentHint):c.fragments,m=u.fragmentHint?u.fragments.concat(u.fragmentHint):u.fragments,g=h;g<=f;g++){var y=m[p+g],_=v[g];d&&!_&&g<d&&(_=c.fragments[g]=y),y&&_&&function(e,r){e.relurl&&(o=e.cc-r.cc),Gn(e.startPTS)&&Gn(e.endPTS)&&(r.start=r.startPTS=e.startPTS,r.startDTS=e.startDTS,r.maxStartPTS=e.maxStartPTS,r.endPTS=e.endPTS,r.endDTS=e.endDTS,r.minEndPTS=e.minEndPTS,r.duration=e.endPTS-e.startPTS,r.duration&&(s=r),t.PTSKnown=t.alignedSliding=!0),r.elementaryStreams=e.elementaryStreams,r.loader=e.loader,r.stats=e.stats,e.initSegment&&(r.initSegment=e.initSegment,n=e.initSegment)}(y,_)}if(n&&(t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments).forEach((function(e){!e||e.initSegment&&e.initSegment.relurl!==(null==n?void 0:n.relurl)||(e.initSegment=n)})),t.skippedSegments)if(t.deltaUpdateFailed=t.fragments.some((function(e){return!e})),t.deltaUpdateFailed){Qn.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var b=t.skippedSegments;b--;)t.fragments.shift();t.startSN=t.fragments[0].sn,t.startCC=t.fragments[0].cc}else t.canSkipDateRanges&&(t.dateRanges=function(e,t,n){var r=l({},e);return n&&n.forEach((function(e){delete r[e]})),Object.keys(t).forEach((function(e){var n=new Zn(t[e].attr,r[e]);n.isValid?r[e]=n:Qn.warn('Ignoring invalid Playlist Delta Update DATERANGE tag: "'+JSON.stringify(t[e].attr)+'"')})),r}(e.dateRanges,t.dateRanges,t.recentlyRemovedDateranges));var T=t.fragments;if(o){Qn.warn("discontinuity sliding from playlist, take drift into account");for(var S=0;S<T.length;S++)T[S].cc+=o}t.skippedSegments&&(t.startCC=t.fragments[0].cc);var E=e.partList,k=t.partList;if(E&&k)for(var w=0,C=0,A=E.length;C<=A;C++){var L=E[C],R=k[C+w];L&&R&&L.index===R.index&&L.fragment.sn===R.fragment.sn?function(e,t){t.elementaryStreams=e.elementaryStreams,t.stats=e.stats}(L,R):w--}s?Re(t,s,s.startPTS,s.endPTS,s.startDTS,s.endDTS):Ie(e,t),T.length&&(t.totalduration=t.edge-T[0].start),t.driftStartTime=e.driftStartTime,t.driftStart=e.driftStart,u=t.advancedDateTime,t.advanced&&u?(h=t.edge,t.driftStart||(t.driftStartTime=u,t.driftStart=h),t.driftEndTime=u,t.driftEnd=h):(t.driftEndTime=e.driftEndTime,t.driftEnd=e.driftEnd,t.advancedDateTime=e.advancedDateTime)}function Ie(e,t){var n=t.startSN+t.skippedSegments-e.startSN;e=e.fragments;n<0||n>=e.length||Oe(t,e[n].start)}function Oe(e,t){if(t){for(var n=e.fragments,r=e.skippedSegments;r<n.length;r++)n[r].start+=t;e.fragmentHint&&(e.fragmentHint.start+=t)}}function De(e,t,n){return null!=e&&e.details?Pe(null==(e=e.details)?void 0:e.partList,t,n):null}function Pe(e,t,n){if(e)for(var r=e.length;r--;){var i=e[r];if(i.index===n&&i.fragment.sn===t)return i}return null}function Me(e){e.forEach((function(e,t){null!=(e=e.details)&&e.fragments&&e.fragments.forEach((function(e){e.level=t}))}))}function je(e){switch(e.details){case Kn.FRAG_LOAD_TIMEOUT:case Kn.KEY_LOAD_TIMEOUT:case Kn.LEVEL_LOAD_TIMEOUT:case Kn.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function Ue(e,t){return t=je(t),e.default[(t?"timeout":"error")+"Retry"]}function Be(e,t){return t="linear"===e.backoff?1:Math.pow(2,t),Math.min(t*e.retryDelayMs,e.maxRetryDelayMs)}function Fe(e){return n(n({},e),{errorRetry:null,timeoutRetry:null})}function Ne(e,t,n,r){var i;return!!e&&(i=null==r?void 0:r.code,i=t<e.maxNumRetry&&(0===(i=i)&&!1===navigator.onLine||!!i&&(i<400||499<i)||!!n),e.shouldRetry?e.shouldRetry(e,t,n,r,i):i)}function Ge(e,t,n,r){void 0===n&&(n=0),void 0===r&&(r=0);var i,a=null;return e?(a=t[e.sn-t[0].sn+1]||null,0<(i=e.endDTS-n)&&i<15e-7&&(n+=15e-7)):0===n&&0===t[0].start&&(a=t[0]),a&&(!e||e.level===a.level)&&0===Ve(n,r,a)||!(i=Jr.search(t,Ve.bind(null,n,r)))||i===e&&a?a:i}function Ve(e,t,n){return void 0===t&&(t=0),n.start<=(e=void 0===e?0:e)&&n.start+n.duration>e?0:(t=Math.min(t,n.duration+(n.deltaPTS||0)),n.start+n.duration-t<=e?1:n.start-t>e&&n.start?-1:0)}function He(e,t,r){var i,a,s,o=e.videoCodec,u=e.audioCodec;return o&&u&&r?(i={width:e.width,height:e.height,bitrate:Math.ceil(Math.max(.9*e.bitrate,e.averageBitrate)),framerate:e.frameRate||30},"SDR"!==(a=e.videoRange)&&(i.transferFunction=a.toLowerCase()),s=o.split(",").map((function(e){return{type:"media-source",video:n(n({},i),{},{contentType:se(e,"video")})}})),u&&e.audioGroups&&e.audioGroups.forEach((function(e){var n;e&&null!=(n=t.groups[e])&&n.tracks.forEach((function(t){var n;t.groupId===e&&(t=t.channels||"",n=parseFloat(t),Gn(n))&&2<n&&s.push.apply(s,u.split(",").map((function(e){return{type:"media-source",audio:{contentType:se(e,"audio"),channels:""+n}}})))}))})),Promise.all(s.map((function(e){var t=function(e){var t=e.audio,n=(e=e.video)||t;if(n){if(n=n.contentType.split('"')[1],e)return"r"+e.height+"x"+e.width+"f"+Math.ceil(e.framerate)+(e.transferFunction||"sd")+"_"+n+"_"+Math.ceil(e.bitrate/1e5);if(t)return"c"+t.channels+(t.spatialRendering?"s":"n")+"_"+n}return""}(e);return ri[t]||(ri[t]=r.decodingInfo(e))}))).then((function(e){return{supported:!e.some((function(e){return!e.supported})),configurations:s,decodingInfoResults:e}})).catch((function(e){return{supported:!1,configurations:s,decodingInfoResults:[],error:e}}))):Promise.resolve(ni)}function ze(e,t,n,r,i){for(var a=Object.keys(e),s=null==r?void 0:r.channels,o=null==r?void 0:r.audioCodec,u=s&&2===parseInt(s),l=!0,c=!1,d=1/0,h=1/0,f=1/0,p=0,v=[],m=(i=(r=function(e,t){var n=!1,r=[];return e&&(n="SDR"!==e,r=[e]),t&&(r=t.allowedVideoRanges||$r.slice(0),r=(n=void 0!==t.preferHDR?t.preferHDR:function(){if("function"==typeof matchMedia){var e=matchMedia("(dynamic-range: high)"),t=matchMedia("bad query");if(e.media!==t.media)return!0===e.matches}return!1}())?r.filter((function(e){return"SDR"!==e})):["SDR"]),{preferHDR:n,allowedVideoRanges:r}}(t,i)).preferHDR,r.allowedVideoRanges),g=a.length;g--;)!function(){var t=e[a[g]],n=(l=0<t.channels[2],d=Math.min(d,t.minHeight),h=Math.min(h,t.minFramerate),f=Math.min(f,t.minBitrate),m.filter((function(e){return 0<t.videoRanges[e]})));0<n.length&&(c=!0,v=n)}();d=Gn(d)?d:0,h=Gn(h)?h:0;var y=Math.max(1080,d),_=Math.max(30,h);f=Gn(f)?f:n;return n=Math.max(f,n),c||(t=void 0,v=[]),{codecSet:a.reduce((function(t,r){var i=e[r];if(r===t)return t;if(i.minBitrate>n)return We(r,"min bitrate of "+i.minBitrate+" > current estimate of "+n),t;if(!i.hasDefaultAudio)return We(r,"no renditions with default or auto-select sound found"),t;if(o&&r.indexOf(o.substring(0,4))%5!=0)return We(r,'audio codec preference "'+o+'" not found'),t;if(s&&!u){if(!i.channels[s])return We(r,"no renditions with "+s+" channel sound found (channels options: "+Object.keys(i.channels)+")"),t}else if((!o||u)&&l&&0===i.channels[2])return We(r,"no renditions with stereo sound found"),t;return i.minHeight>y?(We(r,"min resolution of "+i.minHeight+" > maximum of "+y),t):i.minFramerate>_?(We(r,"min framerate of "+i.minFramerate+" > maximum of "+_),t):v.some((function(e){return 0<i.videoRanges[e]}))?i.maxScore<p?(We(r,"max score of "+i.maxScore+" < selected max of "+p),t):t&&(ue(r)>=ue(t)||i.fragmentError>e[t].fragmentError)?t:(p=i.maxScore,r):(We(r,"no variants with VIDEO-RANGE of "+JSON.stringify(v)+" found"),t)}),void 0),videoRanges:v,preferHDR:i,minFramerate:h,minBitrate:f}}function We(e,t){Qn.log('[abr] start candidates with "'+e+'" ignored because '+t)}function Ke(e,t,n){if("attrs"in e){var r=t.indexOf(e);if(-1!==r)return r}for(var i=0;i<t.length;i++)if(qe(e,t[i],n))return i;return-1}function qe(e,t,n){var r,i=e.groupId,a=e.name,s=e.lang,o=e.assocLang,u=e.characteristics,l=e.default,c=e.forced;return(void 0===i||t.groupId===i)&&(void 0===a||t.name===a)&&(void 0===s||t.lang===s)&&(void 0===s||t.assocLang===o)&&(void 0===l||t.default===l)&&(void 0===c||t.forced===c)&&(void 0===u||(i=u,void 0===(a=t.characteristics)&&(a=""),i=i.split(","),r=a.split(","),i.length===r.length&&!i.some((function(e){return-1===r.indexOf(e)}))))&&(void 0===n||n(e,t))}function $e(e,t){var n=e.audioCodec;e=e.channels;return!(void 0!==n&&(t.audioCodec||"").substring(0,4)!==n.substring(0,4)||void 0!==e&&e!==(t.channels||"2"))}function Ye(e,t,n){for(var r=t;r;r--)if(n(e[r]))return r;for(var i=t+1;i<e.length;i++)if(n(e[i]))return i;return-1}function Xe(e){var t;return e.buffered&&(e.body.gap||(null==(t=e.range.video)?void 0:t.partial)||(null==(t=e.range.audio)?void 0:t.partial)||(null==(t=e.range.audiovideo)?void 0:t.partial))}function Je(e){return e.type+"_"+e.level+"_"+e.sn}function Qe(e,t,n,r,i,a){void 0===r&&(r=0),void 0===i&&(i=-1),void 0===a&&(a=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing={start:0,executeStart:0,executeEnd:0,end:0},this.buffering={audio:{start:0,executeStart:0,executeEnd:0,end:0},video:{start:0,executeStart:0,executeEnd:0,end:0},audiovideo:{start:0,executeStart:0,executeEnd:0,end:0}},this.level=e,this.sn=t,this.id=n,this.size=r,this.part=i,this.partial=a}function Ze(e,t){for(var n,r=0,i=e.length;r<i;r++)if((null==(n=e[r])?void 0:n.cc)===t)return e[r];return null}function et(e,t){e&&(t=e.start+t,e.start=e.startPTS=t,e.endPTS=t+e.duration)}function tt(e,t){for(var n=t.fragments,r=0,i=n.length;r<i;r++)et(n[r],e);t.fragmentHint&&et(t.fragmentHint,e),t.alignedSliding=!0}function nt(e,t){var n,r,i,a,s;e.hasProgramDateTime&&t.hasProgramDateTime&&(n=e.fragments,r=t.fragments,n.length)&&r.length&&(s=Math.min(t.endCC,e.endCC),t.startCC<s&&e.startCC<s&&(i=Ze(r,s),a=Ze(n,s)),i&&a||(a=Ze(n,(i=r[Math.floor(r.length/2)]).cc)||n[Math.floor(n.length/2)]),t=i.programDateTime,s=a.programDateTime,t)&&s&&tt((s-t)/1e3-(a.start-i.start),e)}function rt(e,t){var n,r,i=(t=void 0===t?null:t)||e,a=(t={frag:e,part:t,responseType:"arraybuffer",url:i.url,headers:{},rangeStart:0,rangeEnd:0},i.byteRangeStartOffset);i=i.byteRangeEndOffset;return Gn(a)&&Gn(i)&&(n=a,r=i,"initSegment"!==e.sn||"AES-128"!==(e=null==(e=e.decryptdata)?void 0:e.method)&&"AES-256"!==e||((e=i-a)%16&&(r=i+(16-e%16)),0!==a&&(t.resetIV=!0,n=a-16)),t.rangeStart=n,t.rangeEnd=r),t}function it(e,t){var n=new Error("GAP "+(e.gap?"tag":"attribute")+" found");n={type:Wn.MEDIA_ERROR,details:Kn.FRAG_GAP,fatal:!1,frag:e,error:n,networkDetails:null};return t&&(n.part=t),(t||e).stats.aborted=!0,new vi(n)}function at(e,t){return{type:e=void 0===e?"":e,id:-1,pid:-1,inputTimeScale:t=void 0===t?9e4:t,sequenceNumber:-1,samples:[],dropped:0}}function st(e,t){return 255===e[t]&&240==(246&e[t+1])}function ot(e,t){return 1&e[t+1]?7:9}function ut(e,t){return(3&e[t+3])<<11|e[t+4]<<3|(224&e[t+5])>>>5}function lt(e,t){return t+1<e.length&&st(e,t)}function ct(e,t,n,r,i){e.samplerate||(t=function(e,t,n,r){var i,a,s,o=navigator.userAgent.toLowerCase(),u=r,l=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],c=i=1+((192&t[n+2])>>>6),d=(60&t[n+2])>>>2;if(!(l.length-1<d))return a=(1&t[n+2])<<2,a|=(192&t[n+3])>>>6,Qn.log("manifest codec:"+r+", ADTS type:"+c+", samplingIndex:"+d),t=/firefox|palemoon/i.test(o)?6<=d?(c=5,s=new Array(4),d-3):(c=2,s=new Array(2),d):-1!==o.indexOf("android")?(c=2,s=new Array(2),d):(c=5,s=new Array(4),r&&(-1!==r.indexOf("mp4a.40.29")||-1!==r.indexOf("mp4a.40.5"))||!r&&6<=d?d-3:((r&&-1!==r.indexOf("mp4a.40.2")&&(6<=d&&1==a||/vivaldi/i.test(o))||!r&&1==a)&&(c=2,s=new Array(2)),d)),s[0]=c<<3,s[0]|=(14&d)>>1,s[1]|=(1&d)<<7,s[1]|=a<<3,5===c&&(s[1]|=(14&t)>>1,s[2]=(1&t)<<7,s[2]|=8,s[3]=0),{config:s,samplerate:l[d],channelCount:a,codec:"mp4a.40."+c,parsedCodec:"mp4a.40."+i,manifestCodec:u};n=new Error("invalid ADTS sampling index:"+d),e.emit(zn.ERROR,zn.ERROR,{type:Wn.MEDIA_ERROR,details:Kn.FRAG_PARSING_ERROR,fatal:!0,error:n,reason:n.message})}(t,n,r,i))&&(e.config=t.config,e.samplerate=t.samplerate,e.channelCount=t.channelCount,e.codec=t.codec,e.manifestCodec=t.manifestCodec,e.parsedCodec=t.parsedCodec,Qn.log("parsed codec:"+e.parsedCodec+", codec:"+e.codec+", rate:"+t.samplerate+", channels:"+t.channelCount))}function dt(e){return 9216e4/e}function ht(e,t,n,r,i){var a,s,o;r+=i*dt(e.samplerate);return(i=function(e,t){var n=ot(e,t);if(t+n<=e.length&&0<(e=ut(e,t)-n))return{headerLength:n,frameLength:e}}(t,n))?(a=i.frameLength,a=(i=i.headerLength)+a,(s=Math.max(0,n+a-t.length))?(o=new Uint8Array(a-i)).set(t.subarray(n+i,t.length),0):o=t.subarray(n+i,n+a),i={unit:o,pts:r},s||e.samples.push(i),{sample:i,length:a,missing:s}):(e=t.length-n,(o=new Uint8Array(e)).set(t.subarray(n,t.length),0),{sample:{unit:o,pts:r},length:e,missing:-1})}function ft(e,t,n,r,i){var a;return!(n+24>t.length)&&(a=pt(t,n))&&n+a.frameLength<=t.length?(r+=i*(9e4*a.samplesPerFrame/a.sampleRate),i={unit:t.subarray(n,n+a.frameLength),pts:r,dts:r},e.config=[],e.channelCount=a.channelCount,e.samplerate=a.sampleRate,e.samples.push(i),{sample:i,length:a.frameLength,missing:0}):void 0}function pt(e,t){var n,r,i,a,s,o=e[t+1]>>3&3,u=e[t+1]>>1&3,l=e[t+2]>>4&15,c=e[t+2]>>2&3;if(1!=o&&0!=l&&15!=l&&3!=c)return s=e[t+2]>>1&1,n=e[t+3]>>6,l=1e3*ji[14*(3==o?3-u:3==u?3:4)+l-1],c=Ui[3*(3==o?0:2==o?1:2)+c],r=3==n?1:2,a=8*(o=Bi[o][u])*(i=Fi[u]),o=Math.floor(o*l/c+s)*i,null===Mi&&(s=(navigator.userAgent||"").match(/Chrome\/(\d+)/i),Mi=s?parseInt(s[1]):0),!!Mi&&Mi<=87&&2==u&&224e3<=l&&0==n&&(e[t+3]=128|e[t+3]),{sampleRate:c,channelCount:r,frameLength:o,samplesPerFrame:a}}function vt(e,t){return 255===e[t]&&224==(224&e[t+1])&&0!=(6&e[t+1])}function mt(e,t){return t+1<e.length&&vt(e,t)}function gt(e,t){var n;if(t+1<e.length&&vt(e,t))return n=4,(t+=n=null!=(t=pt(e,t))&&t.frameLength?t.frameLength:n)===e.length||mt(e,t)}function yt(e,t){for(var n=0,r=5,i=(t+=r,new Uint32Array(1)),a=new Uint32Array(1),s=new Uint8Array(1);0<r;){s[0]=e[t];var o=Math.min(r,8),u=8-o;a[0]=4278190080>>>24+u<<u,i[0]=(s[0]&a[0])>>u,n=n?n<<o|i[0]:i[0],t+=1,r-=o}return n}function _t(e,t,n,r,i){var a,s,o,u,l,c,d,h,f;return n+8>t.length||11!==t[n]||119!==t[n+1]||3<=(d=t[n+4]>>6)||(a=[48e3,44100,32e3][d],n+(o=2*[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][3*(s=63&t[n+4])+d])>t.length)?-1:(l=0,(2==(u=t[n+6]>>5)||(1&u&&1!=u&&(l+=2),4&u))&&(l+=2),l=(t[n+6]<<8|t[n+7])>>12-l&1,c=[2,1,2,3,3,4,4,5][u]+l,h=t[n+5]>>3,f=7&t[n+5],d=new Uint8Array([d<<6|h<<1|f>>2,(3&f)<<6|u<<3|l<<2|s>>4,s<<4&224]),h=r+i*(1536/a*9e4),f=t.subarray(n,n+o),e.config=d,e.channelCount=c,e.samplerate=a,e.samples.push({unit:f,pts:h}),o)}function bt(e,t){return((31&e[t+1])<<8)+e[t+2]}function Tt(e){Qn.log(e+" with AES-128-CBC encryption found in unencrypted stream")}function St(e){var t,n,r,i=0,a=e.data;if(!e||0===e.size)return null;for(;a[0].length<19&&1<a.length;)a[0]=Y(a[0],a[1]),a.splice(1,1);if(1!==((d=a[0])[0]<<16)+(d[1]<<8)+d[2])return null;if((t=(d[4]<<8)+d[5])&&t>e.size-6)return null;var s=d[7],o=(192&s&&(n=536870912*(14&d[9])+4194304*(255&d[10])+16384*(254&d[11])+128*(255&d[12])+(254&d[13])/2,64&s?54e5<n-(r=536870912*(14&d[14])+4194304*(255&d[15])+16384*(254&d[16])+128*(255&d[17])+(254&d[18])/2)&&(Qn.warn(Math.round((n-r)/9e4)+"s delta between PTS and DTS, align them"),n=r):r=n),(s=d[8])+9);if(e.size<=o)return null;e.size-=o;for(var u=new Uint8Array(e.size),l=0,c=a.length;l<c;l++){var d,h=(d=a[l]).byteLength;if(o){if(h<o){o-=h;continue}d=d.subarray(o),h-=o,o=0}u.set(d,i),i+=h}return t&&(t-=s+3),{data:u,pts:n,dts:r,len:t}}function Et(e,t,n,r){return e=e*t*(n=void 0===n?1:n),(r=void 0!==r&&r)?Math.round(e):e}function kt(e,t){return Et(e,1e3,1/Zi,t=void 0!==t&&t)}function wt(e,t){var n;if(null!==t)for(n=t<e?-8589934592:8589934592;4294967296<Math.abs(e-t);)e+=n;return e}function Ct(e,t,n,r){var i=e.samples.length;if(i){for(var a=e.inputTimeScale,s=0;s<i;s++){var o=e.samples[s];o.pts=wt(o.pts-n.baseTime*a/n.timescale,t*a)/a,o.dts=wt(o.dts-r.baseTime*a/r.timescale,t*a)/a}var u=e.samples;return e.samples=[],{samples:u}}}function At(e,t,n){var r=e.samples.length;if(r){for(var i=e.inputTimeScale,a=0;a<r;a++){var s=e.samples[a];s.pts=wt(s.pts-n.baseTime*i/n.timescale,t*i)/i}e.samples.sort((function(e,t){return e.pts-t.pts}));var o=e.samples;return e.samples=[],{samples:o}}}function Lt(e,t){return(e=null==e?void 0:e.codec)&&4<e.length?e:t===er?"ec-3"===e||"ac-3"===e||"alac"===e?e:"fLaC"===e||"Opus"===e?le(e,!1):(Qn.info('Parsed audio codec "'+e+'" or audio object type not handled. Using "mp4a.40.5"'),"mp4a.40.5"):(Qn.warn('Unhandled video codec "'+e+'"'),"hvc1"===e||"hev1"===e?"hvc1.1.6.L120.90":"av01"===e?"av01.0.04M.08":"avc1.42e01e")}function Rt(e){return"then"in e&&e.then instanceof Function}function xt(e,t,n,r,i){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=e,this.videoCodec=t,this.initSegmentData=n,this.duration=r,this.defaultInitPts=i||null}function It(e,t,n,r,i,a){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=e,this.contiguous=t,this.accurateTimeOffset=n,this.trackSwitch=r,this.timeOffset=i,this.initSegmentChange=a}function Ot(){}function Dt(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function Pt(e,t,n,r,i){if("function"!=typeof n)throw new TypeError("The listener must be a function");return n=new Dt(n,r||e,i),r=sa?sa+t:t,e._events[r]?e._events[r].fn?e._events[r]=[e._events[r],n]:e._events[r].push(n):(e._events[r]=n,e._eventsCount++),e}function Mt(e,t){0==--e._eventsCount?e._events=new Ot:delete e._events[t]}function jt(){this._events=new Ot,this._eventsCount=0}function Ut(e,t){ca.postMessage({event:e,data:t})}function Bt(e,t){var n,r,i;return!!((n=t.remuxResult).audio||n.video||n.text||n.id3||n.initSegment)&&(n=[],r=(i=t.remuxResult).audio,i=i.video,r&&Ft(n,r),i&&Ft(n,i),e.postMessage({event:"transmuxComplete",data:t},n),!0)}function Ft(e,t){t.data1&&e.push(t.data1.buffer),t.data2&&e.push(t.data2.buffer)}function Nt(e,t,n){t.reduce((function(t,n){return Bt(e,n)||t}),!1)||e.postMessage({event:"transmuxComplete",data:t[0]}),e.postMessage({event:"flush",data:n})}function Gt(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Vt(e[n].attrs,t[n].attrs))return!1;return!0}function Vt(e,t,n){var r=e["STABLE-RENDITION-ID"];return r&&!n?r===t["STABLE-RENDITION-ID"]:!(n||["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED","ASSOC-LANGUAGE"]).some((function(n){return e[n]!==t[n]}))}function Ht(e,t){return t.label.toLowerCase()===e.name.toLowerCase()&&(!t.language||t.language.toLowerCase()===(e.lang||"").toLowerCase())}function zt(e){var t=e.querySelectorAll("source");[].slice.call(t).forEach((function(t){e.removeChild(t)}))}function Wt(e){var t=e;return _a.hasOwnProperty(e)&&(t=_a[e]),String.fromCharCode(t)}function Kt(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n].toString(16));return t}function qt(e,t,n){n.a=e,n.b=t}function $t(e,t,n){return n.a===e&&n.b===t}function Yt(e,t){return"string"==typeof t&&!!Array.isArray(e)&&(t=t.toLowerCase(),!!~e.indexOf(t))&&t}function Xt(e){return Yt(pa,e)}function Jt(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var i=1;i<arguments.length;i++){var a,s=arguments[i];for(a in s)e[a]=s[a]}return e}function Qt(e,t,n){var r=this,i={enumerable:!0},a=(r.hasBeenReset=!1,""),s=!1,o=e,u=t,l=n,c=null,d="",h=!0,f="auto",p="start",v=50,m="middle",g=50,y="middle";Object.defineProperty(r,"id",Jt({},i,{get:function(){return a},set:function(e){a=""+e}})),Object.defineProperty(r,"pauseOnExit",Jt({},i,{get:function(){return s},set:function(e){s=!!e}})),Object.defineProperty(r,"startTime",Jt({},i,{get:function(){return o},set:function(e){if("number"!=typeof e)throw new TypeError("Start time must be set to a number.");o=e,this.hasBeenReset=!0}})),Object.defineProperty(r,"endTime",Jt({},i,{get:function(){return u},set:function(e){if("number"!=typeof e)throw new TypeError("End time must be set to a number.");u=e,this.hasBeenReset=!0}})),Object.defineProperty(r,"text",Jt({},i,{get:function(){return l},set:function(e){l=""+e,this.hasBeenReset=!0}})),Object.defineProperty(r,"region",Jt({},i,{get:function(){return c},set:function(e){c=e,this.hasBeenReset=!0}})),Object.defineProperty(r,"vertical",Jt({},i,{get:function(){return d},set:function(e){if(!1===(e=Yt(fa,e)))throw new SyntaxError("An invalid or illegal string was specified.");d=e,this.hasBeenReset=!0}})),Object.defineProperty(r,"snapToLines",Jt({},i,{get:function(){return h},set:function(e){h=!!e,this.hasBeenReset=!0}})),Object.defineProperty(r,"line",Jt({},i,{get:function(){return f},set:function(e){if("number"!=typeof e&&"auto"!==e)throw new SyntaxError("An invalid number or illegal string was specified.");f=e,this.hasBeenReset=!0}})),Object.defineProperty(r,"lineAlign",Jt({},i,{get:function(){return p},set:function(e){if(!(e=Xt(e)))throw new SyntaxError("An invalid or illegal string was specified.");p=e,this.hasBeenReset=!0}})),Object.defineProperty(r,"position",Jt({},i,{get:function(){return v},set:function(e){if(e<0||100<e)throw new Error("Position must be between 0 and 100.");v=e,this.hasBeenReset=!0}})),Object.defineProperty(r,"positionAlign",Jt({},i,{get:function(){return m},set:function(e){if(!(e=Xt(e)))throw new SyntaxError("An invalid or illegal string was specified.");m=e,this.hasBeenReset=!0}})),Object.defineProperty(r,"size",Jt({},i,{get:function(){return g},set:function(e){if(e<0||100<e)throw new Error("Size must be between 0 and 100.");g=e,this.hasBeenReset=!0}})),Object.defineProperty(r,"align",Jt({},i,{get:function(){return y},set:function(e){if(!(e=Xt(e)))throw new SyntaxError("An invalid or illegal string was specified.");y=e,this.hasBeenReset=!0}})),r.displayState=void 0}function Zt(e){function t(e,t,n,r){return 3600*(0|e)+60*(0|t)+(0|n)+parseFloat(r||0)}return(e=e.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/))?59<parseFloat(e[2])?t(e[2],e[3],0,e[4]):t(e[1],e[2],e[3],e[4]):null}function en(e,t,n,r){var i,a,s=r?e.split(r):[e];for(i in s)"string"==typeof s[i]&&2===(a=s[i].split(n)).length&&t(a[0],a[1])}function tn(e){return e.replace(/<br(?: \/)?>/gi,"\n")}function nn(e,t,n){return e.slice(n=void 0===n?0:n,n+t.length)===t}function rn(e,t,n){return Ga(e.toString())+Ga(t.toString())+Ga(n)}function an(e,t,n,r){if(0===(e=H(new Uint8Array(e),["mdat"])).length)r(new Error("Could not parse IMSC1 mdat"));else{e=e.map((function(e){return gr(e)}));var i,a=(1,Et(t.baseTime,1,1/(t=void 0===(t=t.timescale)?1:t),i=void 0!==i&&i));try{e.forEach((function(e){return n(function(e,t){var n,r,i,a,s,o=(new DOMParser).parseFromString(e,"text/xml").getElementsByTagName("tt")[0];if(o)return n={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},r=Object.keys(n).reduce((function(e,t){return e[t]=o.getAttribute("ttp:"+t)||n[t],e}),{}),i="preserve"!==o.getAttribute("xml:space"),a=on(sn(o,"styling","style")),s=on(sn(o,"layout","region")),e=sn(o,"body","[begin]"),[].map.call(e,(function(e){var n=function e(t,n){return[].slice.call(t.childNodes).reduce((function(t,r,i){return"br"===r.nodeName&&i?t+"\n":null!=(i=r.childNodes)&&i.length?e(r,n):n?t+r.textContent.trim().replace(/\s+/g," "):t+r.textContent}),"")}(e,i);if(!n||!e.hasAttribute("begin"))return null;var o=cn(e.getAttribute("begin"),r),u=cn(e.getAttribute("dur"),r),c=cn(e.getAttribute("end"),r);if(null===o)throw ln(e);if(null===c){if(null===u)throw ln(e);c=o+u}return(u=new Pa(o-t,c-t,n)).id=rn(u.startTime,u.endTime,u.text),(c=(o=function(e,t,n){var r="http://www.w3.org/ns/ttml#styling",i=null,a=null!=e&&e.hasAttribute("style")?e.getAttribute("style"):null;return a&&n.hasOwnProperty(a)&&(i=n[a]),["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"].reduce((function(n,a){var s=un(t,r,a)||un(e,r,a)||un(i,r,a);return s&&(n[a]=s),n}),{})}(s[e.getAttribute("region")],a[e.getAttribute("style")],a)).textAlign)&&((n=Wa[c])&&(u.lineAlign=n),u.align=c),l(u,o),u})).filter((function(e){return null!==e}));throw new Error("Invalid ttml")}(e,a))}))}catch(e){r(e)}}}function sn(e,t,n){return(e=e.getElementsByTagName(t)[0])?[].slice.call(e.querySelectorAll(n)):[]}function on(e){return e.reduce((function(e,t){var n=t.getAttribute("xml:id");return n&&(e[n]=t),e}),{})}function un(e,t,n){return e&&e.hasAttributeNS(t,n)?e.getAttributeNS(t,n):null}function ln(e){return new Error("Could not parse ttml timestamp "+e)}function cn(e,t){var n,r,i,a;return e?(null===(n=Zt(e))&&(Ha.test(e)?(r=e,i=t,a=(0|(r=Ha.exec(r))[4])+(0|r[5])/i.subFrameRate,n=3600*(0|r[1])+60*(0|r[2])+(0|r[3])+a/i.frameRate):za.test(e)&&(n=function(e,t){e=za.exec(e);var n=Number(e[1]);switch(e[2]){case"h":return 3600*n;case"m":return 60*n;case"ms":return 1e3*n;case"f":return n/t.frameRate;case"t":return n/t.tickRate}return n}(e,t))),n):null}function dn(e){return e.characteristics&&/transcribes-spoken-dialog/gi.test(e.characteristics)&&/describes-music-and-sound/gi.test(e.characteristics)?"captions":"subtitles"}function hn(e,t){return e&&e.kind===dn(t)&&Ht(t,e)}function fn(e,t){Array.isArray(e)&&(e=e.map((function(e){return e instanceof fn?e:new fn(e)}))),this.value=e,this.params=t}function pn(e,t,n){return function(e,t,n,r){return new Error("failed to "+e+' "'+(e=t,(Array.isArray(e)?JSON.stringify(e):e instanceof Map?"Map{}":e instanceof Set?"Set{}":"object"===(void 0===e?"undefined":i(e))?JSON.stringify(e):String(e))+'" as ')+n,{cause:r})}("serialize",e,t,n)}function vn(e){this.description=e}function mn(e){if((t=e)<-999999999999999||999999999999999<t)throw pn(e,"Integer");var t;return e.toString()}function gn(e){var t=function e(t,n){var r;return t<0?-e(-t,n):(n=Math.pow(10,n),Math.abs(t*n%1-.5)<Number.EPSILON?((r=Math.floor(t*n))%2==0?r:r+1)/n:Math.round(t*n)/n)}(e,3);if(12<Math.floor(Math.abs(t)).toString().length)throw pn(e,"Decimal");return(e=t.toString()).includes(".")?e:e+".0"}function yn(e){if(e=(e=e).description||e.toString().slice(7,-1),!1===/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:\/]*)$/.test(e))throw pn(e,"Token");return e}function _n(e){switch(void 0===e?"undefined":i(e)){case"number":if(Gn(e))return(Number.isInteger(e)?mn:gn)(e);throw pn(e,Qa);case"string":var t=e;if(Za.test(t))throw pn(t,"String");return'"'+t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"';case"symbol":return yn(e);case"boolean":if("boolean"!=typeof(t=e))throw pn(t,"Boolean");return t?"?1":"?0";case"object":if(e instanceof Date)return"@"+mn(e.getTime()/1e3);if(e instanceof Uint8Array)return function(e){if(!1===ArrayBuffer.isView(e))throw pn(e,"Byte Sequence");return":"+btoa(String.fromCharCode.apply(String,e))+":"}(e);if(e instanceof vn)return yn(e);default:throw pn(e,Qa)}}function bn(e){if(!1===/^[a-z*][a-z0-9\-_.*]*$/.test(e))throw pn(e,"Key");return e}function Tn(e){return null==e?"":Object.entries(e).map((function(e){var t=e[0];return!0===(e=e[1])?";"+bn(t):";"+bn(t)+"="+_n(e)})).join("")}function Sn(e){return e instanceof fn?""+_n(e.value)+Tn(e.params):_n(e)}function En(e){return Math.round(e)}function kn(e){return 100*En(e/100)}function wn(e,t){return void 0===t&&(t={}),e?function(e,t){if(void 0===t&&(t={whitespace:!0}),"object"!==(void 0===e?"undefined":i(e)))throw pn(e,"Dict");return e=e instanceof Map?e.entries():Object.entries(e),t=null!=t&&t.whitespace?" ":"",Array.from(e).map((function(e){var t,n=e[0];return(e=e[1])instanceof fn==0&&(e=new fn(e)),n=bn(n),!0===e.value?n+=Tn(e.params):(n+="=",Array.isArray(e.value)?n+="("+(t=e).value.map(Sn).join(" ")+")"+Tn(t.params):n+=Sn(e)),n})).join(","+t)}(function(e,t){var n,r,a,s={};return null!=e&&"object"===(void 0===e?"undefined":i(e))&&(n=Object.keys(e).sort(),r=l({},es,null==t?void 0:t.formatters),a=null==t?void 0:t.filter,n.forEach((function(n){var i,o;null!=a&&a(n)||(i=e[n],(o=r[n])&&(i=o(i,t)),"v"===n&&1===i)||"pr"==n&&1===i||("number"==typeof(o=i)?Gn(o):null!=o&&""!==o&&!1!==o)&&("ot"!==(o=n)&&"sf"!==o&&"st"!==o||"string"!=typeof i||(i=new vn(i)),s[n]=i)}))),s}(e,t),l({whitespace:!1},t)):""}function Cn(e,t,n,r){e&&Object.keys(t).forEach((function(i){var a=e.filter((function(e){return e.groupId===i})).map((function(e){var a=l({},e);return a.details=void 0,a.attrs=new Yn(a.attrs),a.url=a.attrs.URI=An(e.url,e.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",n),a.groupId=a.attrs["GROUP-ID"]=t[i],a.attrs["PATHWAY-ID"]=r,a}));e.push.apply(e,a)}))}function An(e,t,n,r){var i,a=r.HOST,s=r.PARAMS,o=(r=r[n],t&&(i=null==r?void 0:r[t])&&(e=i),new self.URL(e));return a&&!i&&(o.host=a),s&&Object.keys(s).sort().forEach((function(e){e&&o.searchParams.set(e,s[e])})),o.href}function Ln(e,t){return new self.Request(e.url,t)}function Rn(e){return e&&"object"===(void 0===e?"undefined":i(e))?Array.isArray(e)?e.map(Rn):Object.keys(e).reduce((function(t,n){return t[n]=Rn(e[n]),t}),{}):e}function xn(e){var t={};e.forEach((function(e){var n=e.groupId||"";e.id=t[n]=t[n]||0,t[n]++}))}function In(){return self.SourceBuffer||self.WebKitSourceBuffer}function On(){var e;return!!re()&&(!(e=In())||e.prototype&&"function"==typeof e.prototype.appendBuffer&&"function"==typeof e.prototype.remove)}Dn=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,Pn=/^(?=([^\/?#]*))\1([^]*)$/,Mn=/(?:\/|^)\.(?=\/)/g,jn=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g;var Dn,Pn,Mn,jn,Un,Bn,Fn,Nn=Un={buildAbsoluteURL:function(e,t,n){if(n=n||{},e=e.trim(),!(t=t.trim())){if(!n.alwaysNormalize)return e;var r=Un.parseURL(e);if(r)return r.path=Un.normalizePath(r.path),Un.buildURLFromParts(r);throw new Error("Error trying to parse base URL.")}if(!(r=Un.parseURL(t)))throw new Error("Error trying to parse relative URL.");if(r.scheme)return n.alwaysNormalize?(r.path=Un.normalizePath(r.path),Un.buildURLFromParts(r)):t;if(!(t=Un.parseURL(e)))throw new Error("Error trying to parse base URL.");!t.netLoc&&t.path&&"/"!==t.path[0]&&(e=Pn.exec(t.path),t.netLoc=e[1],t.path=e[2]),t.netLoc&&!t.path&&(t.path="/");var i;e={scheme:t.scheme,netLoc:r.netLoc,path:null,params:r.params,query:r.query,fragment:r.fragment};return r.netLoc||(e.netLoc=t.netLoc,"/"!==r.path[0]&&(r.path?(i=(i=t.path).substring(0,i.lastIndexOf("/")+1)+r.path,e.path=Un.normalizePath(i)):(e.path=t.path,r.params||(e.params=t.params,r.query)||(e.query=t.query)))),null===e.path&&(e.path=n.alwaysNormalize?Un.normalizePath(r.path):r.path),Un.buildURLFromParts(e)},parseURL:function(e){return(e=Dn.exec(e))?{scheme:e[1]||"",netLoc:e[2]||"",path:e[3]||"",params:e[4]||"",query:e[5]||"",fragment:e[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(Mn,"");e.length!==(e=e.replace(jn,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}},Gn=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)},Vn=Number.isSafeInteger||function(e){return"number"==typeof e&&Math.abs(e)<=Hn},Hn=Number.MAX_SAFE_INTEGER||9007199254740991,zn=function(e){return e.MEDIA_ATTACHING="hlsMediaAttaching",e.MEDIA_ATTACHED="hlsMediaAttached",e.MEDIA_DETACHING="hlsMediaDetaching",e.MEDIA_DETACHED="hlsMediaDetached",e.MEDIA_ENDED="hlsMediaEnded",e.BUFFER_RESET="hlsBufferReset",e.BUFFER_CODECS="hlsBufferCodecs",e.BUFFER_CREATED="hlsBufferCreated",e.BUFFER_APPENDING="hlsBufferAppending",e.BUFFER_APPENDED="hlsBufferAppended",e.BUFFER_EOS="hlsBufferEos",e.BUFFER_FLUSHING="hlsBufferFlushing",e.BUFFER_FLUSHED="hlsBufferFlushed",e.MANIFEST_LOADING="hlsManifestLoading",e.MANIFEST_LOADED="hlsManifestLoaded",e.MANIFEST_PARSED="hlsManifestParsed",e.LEVEL_SWITCHING="hlsLevelSwitching",e.LEVEL_SWITCHED="hlsLevelSwitched",e.LEVEL_LOADING="hlsLevelLoading",e.LEVEL_LOADED="hlsLevelLoaded",e.LEVEL_UPDATED="hlsLevelUpdated",e.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",e.LEVELS_UPDATED="hlsLevelsUpdated",e.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",e.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",e.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",e.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",e.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",e.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",e.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",e.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",e.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",e.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",e.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",e.CUES_PARSED="hlsCuesParsed",e.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",e.INIT_PTS_FOUND="hlsInitPtsFound",e.FRAG_LOADING="hlsFragLoading",e.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",e.FRAG_LOADED="hlsFragLoaded",e.FRAG_DECRYPTED="hlsFragDecrypted",e.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",e.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",e.FRAG_PARSING_METADATA="hlsFragParsingMetadata",e.FRAG_PARSED="hlsFragParsed",e.FRAG_BUFFERED="hlsFragBuffered",e.FRAG_CHANGED="hlsFragChanged",e.FPS_DROP="hlsFpsDrop",e.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",e.MAX_AUTO_LEVEL_UPDATED="hlsMaxAutoLevelUpdated",e.ERROR="hlsError",e.DESTROYING="hlsDestroying",e.KEY_LOADING="hlsKeyLoading",e.KEY_LOADED="hlsKeyLoaded",e.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",e.BACK_BUFFER_REACHED="hlsBackBufferReached",e.STEERING_MANIFEST_LOADED="hlsSteeringManifestLoaded",e}({}),Wn=function(e){return e.NETWORK_ERROR="networkError",e.MEDIA_ERROR="mediaError",e.KEY_SYSTEM_ERROR="keySystemError",e.MUX_ERROR="muxError",e.OTHER_ERROR="otherError",e}({}),Kn=function(e){return e.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",e.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",e.KEY_SYSTEM_NO_SESSION="keySystemNoSession",e.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",e.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",e.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",e.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",e.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",e.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",e.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",e.MANIFEST_LOAD_ERROR="manifestLoadError",e.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",e.MANIFEST_PARSING_ERROR="manifestParsingError",e.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",e.LEVEL_EMPTY_ERROR="levelEmptyError",e.LEVEL_LOAD_ERROR="levelLoadError",e.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",e.LEVEL_PARSING_ERROR="levelParsingError",e.LEVEL_SWITCH_ERROR="levelSwitchError",e.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",e.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",e.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",e.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",e.FRAG_LOAD_ERROR="fragLoadError",e.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",e.FRAG_DECRYPT_ERROR="fragDecryptError",e.FRAG_PARSING_ERROR="fragParsingError",e.FRAG_GAP="fragGap",e.REMUX_ALLOC_ERROR="remuxAllocError",e.KEY_LOAD_ERROR="keyLoadError",e.KEY_LOAD_TIMEOUT="keyLoadTimeOut",e.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",e.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",e.BUFFER_APPEND_ERROR="bufferAppendError",e.BUFFER_APPENDING_ERROR="bufferAppendingError",e.BUFFER_STALLED_ERROR="bufferStalledError",e.BUFFER_FULL_ERROR="bufferFullError",e.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",e.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",e.INTERNAL_EXCEPTION="internalException",e.INTERNAL_ABORTED="aborted",e.UNKNOWN="unknown",e}({}),qn=/^(\d+)x(\d+)$/,$n=/(.+?)=(".*?"|.*?)(?:,|$)/g,Yn=function(){function e(t){l(this,t="string"==typeof t?e.parseAttrList(t):t)}var t=e.prototype;return t.decimalInteger=function(e){return(e=parseInt(this[e],10))>Number.MAX_SAFE_INTEGER?1/0:e},t.hexadecimalInteger=function(e){if(this[e]){for(var t=(1&(t=(this[e]||"0x").slice(2)).length?"0":"")+t,n=new Uint8Array(t.length/2),r=0;r<t.length/2;r++)n[r]=parseInt(t.slice(2*r,2*r+2),16);return n}return null},t.hexadecimalIntegerAsNumber=function(e){return(e=parseInt(this[e],16))>Number.MAX_SAFE_INTEGER?1/0:e},t.decimalFloatingPoint=function(e){return parseFloat(this[e])},t.optionalFloat=function(e,t){return(e=this[e])?parseFloat(e):t},t.enumeratedString=function(e){return this[e]},t.bool=function(e){return"YES"===this[e]},t.decimalResolution=function(e){if(null!==(e=qn.exec(this[e])))return{width:parseInt(e[1],10),height:parseInt(e[2],10)}},e.parseAttrList=function(e){var t,n={};for($n.lastIndex=0;null!==(t=$n.exec(e));){var r=t[2];0===r.indexOf('"')&&r.lastIndexOf('"')===r.length-1&&(r=r.slice(1,-1)),n[t[1].trim()]=r}return n},u(e,[{key:"clientAttrs",get:function(){return Object.keys(this).filter((function(e){return"X-"===e.substring(0,2)}))}}])}(),Xn={trace:m,debug:m,log:m,warn:m,info:m,error:m},Jn=g(),Qn=Jn,Zn=u((function(e,t){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,t){var n,r=t.attr;for(n in r)if(Object.prototype.hasOwnProperty.call(e,n)&&e[n]!==r[n]){Qn.warn('DATERANGE tag attribute: "'+n+'" does not match for tags with ID: "'+e.ID+'"'),this._badValueForSameId=n;break}e=l(new Yn({}),r,e)}this.attr=e,this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr&&(t=new Date(this.attr["END-DATE"]),Gn(t.getTime()))&&(this._endDate=t)}),[{key:"id",get:function(){return this.attr.ID}},{key:"class",get:function(){return this.attr.CLASS}},{key:"startDate",get:function(){return this._startDate}},{key:"endDate",get:function(){var e;return this._endDate||(null!==(e=this.duration)?new Date(this._startDate.getTime()+1e3*e):null)}},{key:"duration",get:function(){if("DURATION"in this.attr){var e=this.attr.decimalFloatingPoint("DURATION");if(Gn(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}},{key:"plannedDuration",get:function(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}},{key:"endOnNext",get:function(){return this.attr.bool("END-ON-NEXT")}},{key:"isValid",get:function(){return!!this.id&&!this._badValueForSameId&&Gn(this.startDate.getTime())&&(null===this.duration||0<=this.duration)&&(!this.endOnNext||!!this.class)}}]),er="audio",tr="video",nr="audiovideo",rr=function(e){function t(t,n){return(n=e.call(this,n)||this)._decryptdata=null,n.rawProgramDateTime=null,n.programDateTime=null,n.tagList=[],n.duration=0,n.sn=0,n.levelkeys=void 0,n.type=void 0,n.loader=null,n.keyLoader=null,n.level=-1,n.cc=0,n.startPTS=void 0,n.endPTS=void 0,n.startDTS=void 0,n.endDTS=void 0,n.start=0,n.deltaPTS=void 0,n.maxStartPTS=void 0,n.minEndPTS=void 0,n.stats=new b,n.data=void 0,n.bitrateTest=!1,n.title=null,n.initSegment=null,n.endList=void 0,n.gap=void 0,n.urlId=0,n.type=t,n}c(t,e);var n=t.prototype;return n.setKeyFormat=function(e){this.levelkeys&&(e=this.levelkeys[e])&&!this._decryptdata&&(this._decryptdata=e.getDecryptData(this.sn))},n.abortRequests=function(){var e;null!=(e=this.loader)&&e.abort(),null!=(e=this.keyLoader)&&e.abort()},n.setElementaryStreamInfo=function(e,t,n,r,i,a){void 0===a&&(a=!1);var s=this.elementaryStreams,o=s[e];o?(o.startPTS=Math.min(o.startPTS,t),o.endPTS=Math.max(o.endPTS,n),o.startDTS=Math.min(o.startDTS,r),o.endDTS=Math.max(o.endDTS,i)):s[e]={startPTS:t,endPTS:n,startDTS:r,endDTS:i,partial:a}},n.clearElementaryStreamInfo=function(){var e=this.elementaryStreams;e[er]=null,e[tr]=null,e[nr]=null},u(t,[{key:"decryptdata",get:function(){if(!this.levelkeys&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){var e=this.levelkeys.identity;if(e)this._decryptdata=e.getDecryptData(this.sn);else if(1===(e=Object.keys(this.levelkeys)).length)return this._decryptdata=this.levelkeys[e[0]].getDecryptData(this.sn)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){var e;return null!==this.programDateTime&&Gn(this.programDateTime)?(e=Gn(this.duration)?this.duration:0,this.programDateTime+1e3*e):null}},{key:"encrypted",get:function(){if(null!=(e=this._decryptdata)&&e.encrypted)return!0;if(this.levelkeys){var e=Object.keys(this.levelkeys),t=e.length;if(1<t||1===t&&this.levelkeys[e[0]].encrypted)return!0}return!1}}])}(ur=function(){function e(e){var t;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=((t={})[er]=null,t[tr]=null,t[nr]=null,t),this.baseurl=e}return e.prototype.setByteRange=function(e,t){t=1===(e=e.split("@",2)).length?(null==t?void 0:t.byteRangeEndOffset)||0:parseInt(e[1]),this._byteRange=[t,parseInt(e[0])+t]},u(e,[{key:"byteRange",get:function(){return this._byteRange||[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Nn.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(e){this._url=e}}])}()),ir=function(e){function t(t,n,r,i,a){return(r=e.call(this,r)||this).fragOffset=0,r.duration=0,r.gap=!1,r.independent=!1,r.relurl=void 0,r.fragment=void 0,r.index=void 0,r.stats=new b,r.duration=t.decimalFloatingPoint("DURATION"),r.gap=t.bool("GAP"),r.independent=t.bool("INDEPENDENT"),r.relurl=t.enumeratedString("URI"),r.fragment=n,r.index=i,(n=t.enumeratedString("BYTERANGE"))&&r.setByteRange(n,a),a&&(r.fragOffset=a.fragOffset+a.duration),r}return c(t,e),u(t,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var e=this.elementaryStreams;return!!(e.audio||e.video||e.audiovideo)}}])}(ur),ar=function(){function e(e){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=e}return e.prototype.reloaded=function(e){var t,n;e?(t=this.lastPartSn-e.lastPartSn,n=this.lastPartIndex-e.lastPartIndex,this.updated=this.endSN!==e.endSN||!!n||!!t||!this.live,this.advanced=this.endSN>e.endSN||0<t||0==t&&0<n,this.updated||this.advanced?this.misses=Math.floor(.6*e.misses):this.misses=e.misses+1,this.availabilityDelay=e.availabilityDelay):(this.advanced=!0,this.updated=!0)},u(e,[{key:"hasProgramDateTime",get:function(){return!!this.fragments.length&&Gn(this.fragments[this.fragments.length-1].programDateTime)}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||10}},{key:"drift",get:function(){var e=this.driftEndTime-this.driftStartTime;return 0<e?1e3*(this.driftEnd-this.driftStart)/e:1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var e;return null!=(e=this.fragments)&&e.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}])}(),sr=0,or=1,ur="undefined"!=typeof self?self:void 0,lr={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},cr={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"},dr="edef8ba979d64acea3c827dcd51d21ed",hr=null!=ur&&null!=(Qr=ur.navigator)&&Qr.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null,fr=function(e,t){var n=(127&e[t])<<21;return(n|=(127&e[t+1])<<14)|(127&e[t+2])<<7|127&e[t+3]},pr=function(e){var t,n;if(!(e.size<2))return t=gr(e.data,!0),n=new Uint8Array(e.data.subarray(t.length+1)),{key:e.type,info:t,data:n.buffer}},vr=function(e){var t,n;if(!(e.size<2))return"TXXX"===e.type?(t=1,t+=(n=gr(e.data.subarray(1),!0)).length+1,t=gr(e.data.subarray(t)),{key:e.type,info:n,data:t}):(n=gr(e.data.subarray(1)),{key:e.type,data:n})},mr=function(e){var t,n;return"WXXX"===e.type?e.size<2?void 0:(t=1,t+=(n=gr(e.data.subarray(1),!0)).length+1,t=gr(e.data.subarray(t)),{key:e.type,info:n,data:t}):(n=gr(e.data),{key:e.type,data:n})},gr=function(e,t){void 0===t&&(t=!1);var n,r=function(){if(!navigator.userAgent.includes("PlayStation 4"))return Bn=Bn||void 0===self.TextDecoder?Bn:new self.TextDecoder("utf-8")}();if(r)return r=r.decode(e),t?-1!==(n=r.indexOf("\0"))?r.substring(0,n):r:r.replace(/\0/g,"");for(var i,a,s,o=e.length,u="",l=0;l<o;){if(0===(i=e[l++])&&t)return u;if(0!==i&&3!==i)switch(i>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:u+=String.fromCharCode(i);break;case 12:case 13:a=e[l++],u+=String.fromCharCode((31&i)<<6|63&a);break;case 14:a=e[l++],s=e[l++],u+=String.fromCharCode((15&i)<<12|(63&a)<<6|(63&s)<<0)}}return u},yr=function(e){for(var t="",n=0;n<e.length;n++){var r=e[n].toString(16);t+=r=r.length<2?"0"+r:r}return t},_r=Math.pow(2,32)-1,br=[].push,Tr={video:1,audio:2,id3:3,text:4},Sr={},Er=function(){function e(e,t,n,r,i){void 0===r&&(r=[1]),void 0===i&&(i=null),this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=e,this.uri=t,this.keyFormat=n,this.keyFormatVersions=r,this.iv=i,this.encrypted=!!e&&"NONE"!==e,this.isCommonEncryption=this.encrypted&&!E(e)}e.clearKeyUriToKeyIdMap=function(){Sr={}};var t=e.prototype;return t.isSupported=function(){if(this.method){if(E(this.method)||"NONE"===this.method)return!0;if("identity"===this.keyFormat)return"SAMPLE-AES"===this.method;switch(this.keyFormat){case cr.FAIRPLAY:case cr.WIDEVINE:case cr.PLAYREADY:case cr.CLEARKEY:return-1!==["ISO-23001-7","SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)}}return!1},t.getDecryptData=function(t){if(!this.encrypted||!this.uri)return null;if(E(this.method)&&this.uri&&!this.iv)return"number"!=typeof t&&(Qn.warn('missing IV for initialization segment with method="'+this.method+'" - compliance issue'),t=0),t=function(e){for(var t=new Uint8Array(16),n=12;n<16;n++)t[n]=e>>8*(15-n)&255;return t}(t),new e(this.method,this.uri,"identity",this.keyFormatVersions,t);var n,r=function(e){var t,n,r=null;return"data"===(e=e.split(":"))[0]&&2===e.length&&2===(t=(e=e[1].split(";"))[e.length-1].split(",")).length&&(n="base64"===t[0],t=t[1],r=n?(e.splice(-1,1),T(t)):(n=S(n=t).subarray(0,16),(e=new Uint8Array(16)).set(n,16-n.length),e)),r}(this.uri);if(r)switch(this.keyFormat){case cr.WIDEVINE:22<=(this.pssh=r).length&&(this.keyId=r.subarray(r.length-22,r.length-6));break;case cr.PLAYREADY:var i=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);i=(this.pssh=function(e,t,n){if(16!==e.byteLength)throw new RangeError("Invalid system id");var r;if(t)for(var i=1,a=new Uint8Array(16*t.length),s=0;s<t.length;s++){var o=t[s];if(16!==o.byteLength)throw new RangeError("Invalid key");a.set(o,16*s)}else i=0,a=new Uint8Array;0<i?(r=new Uint8Array(4),0<t.length&&new DataView(r.buffer).setUint32(0,t.length,!1)):r=new Uint8Array;var u=new Uint8Array(4);return n&&0<n.byteLength&&new DataView(u.buffer).setUint32(0,n.byteLength,!1),function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var i=n.length,a=8,s=i;s--;)a+=n[s].byteLength;var o=new Uint8Array(a);for(o[0]=a>>24&255,o[1]=a>>16&255,o[2]=a>>8&255,o[3]=255&a,o.set(e,4),s=0,a=8;s<i;s++)o.set(n[s],a),a+=n[s].byteLength;return o}([112,115,115,104],new Uint8Array([i,0,0,0]),e,r,a,u,n||new Uint8Array)}(i,null,r),new Uint16Array(r.buffer,r.byteOffset,r.byteLength/2)),i=(i=String.fromCharCode.apply(null,Array.from(i))).substring(i.indexOf("<"),i.length);(i=(new DOMParser).parseFromString(i,"text/xml").getElementsByTagName("KID")[0])&&(i=i.childNodes[0]?i.childNodes[0].nodeValue:i.getAttribute("VALUE"))&&(function(e){function t(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}t(e,0,3),t(e,1,2),t(e,4,5),t(e,6,7)}(i=T(i).subarray(0,16)),this.keyId=i);break;default:var a;16!==(i=r.subarray(0,16)).length&&((a=new Uint8Array(16)).set(i,16-i.length),i=a),this.keyId=i}return this.keyId&&16===this.keyId.byteLength||((t=Sr[this.uri])||(n=Object.keys(Sr).length%Number.MAX_SAFE_INTEGER,t=new Uint8Array(16),new DataView(t.buffer,12,4).setUint32(0,n),Sr[this.uri]=t),this.keyId=t),this},e}(),kr=/\{\$([a-zA-Z0-9-_]+)\}/g,wr={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}},Cr={},Ar=/flac|opus|mp4a\.40\.34/i,Lr=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,Rr=/#EXT-X-MEDIA:(.*)/g,xr=/^#EXT(?:INF|-X-TARGETDURATION):/m,Ir=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),Or=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP|INDEPENDENT-SEGMENTS)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),Dr=function(){function e(){}return e.findGroup=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.id===t)return r}},e.resolve=function(e,t){return Nn.buildAbsoluteURL(t,e,{alwaysNormalize:!0})},e.isMediaPlaylist=function(e){return xr.test(e)},e.parseMasterPlaylist=function(t,n){var r,i={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:Z(t)},a=[];for(Lr.lastIndex=0;null!=(r=Lr.exec(t));)if(r[1]){var s=(ee(i,u=new Yn(r[1]),["CODECS","SUPPLEMENTAL-CODECS","ALLOWED-CPC","PATHWAY-ID","STABLE-VARIANT-ID","AUDIO","VIDEO","SUBTITLES","CLOSED-CAPTIONS","NAME"]),te(i,r[2])),o=(s={attrs:u,bitrate:u.decimalInteger("BANDWIDTH")||u.decimalInteger("AVERAGE-BANDWIDTH"),name:u.NAME,url:e.resolve(s,n)},u.decimalResolution("RESOLUTION"));o&&(s.width=o.width,s.height=o.height),function(e,t){var n=(e||"").split(/[ ,]+/).filter((function(e){return e}));["video","audio","text"].forEach((function(e){var r=n.filter((function(t){return t=t,!!(n=wr[n=e])&&!!n[t.slice(0,4)];var n}));r.length&&(t[e+"Codec"]=r.join(","),n=n.filter((function(e){return-1===r.indexOf(e)})))})),t.unknownCodecs=n}(u.CODECS,s),null!=(o=s.unknownCodecs)&&o.length||a.push(s),i.levels.push(s)}else if(r[3]){var u=r[3],l=r[4];switch(u){case"SESSION-DATA":var c=new Yn(l),d=(ee(i,c,["DATA-ID","LANGUAGE","VALUE","URI"]),c["DATA-ID"]);d&&(null===i.sessionData&&(i.sessionData={}),i.sessionData[d]=c);break;case"SESSION-KEY":(d=de(l,n,i)).encrypted&&d.isSupported()?(null===i.sessionKeys&&(i.sessionKeys=[]),i.sessionKeys.push(d)):Qn.warn('[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "'+l+'"');break;case"DEFINE":ee(i,c=new Yn(l),["NAME","VALUE","QUERYPARAM"]),ne(i,c,n);break;case"CONTENT-STEERING":var h=new Yn(l);ee(i,h,["SERVER-URI","PATHWAY-ID"]),i.contentSteering={uri:e.resolve(h["SERVER-URI"],n),pathwayId:h["PATHWAY-ID"]||"."};break;case"START":i.startTimeOffset=he(l)}}var f=0<a.length&&a.length<i.levels.length;return i.levels=f?a:i.levels,0===i.levels.length&&(i.playlistParsingError=new Error("no levels found in manifest")),i},e.parseMasterPlaylistMedia=function(t,n,r){var i={},a=r.levels,s={AUDIO:a.map((function(e){return{id:e.attrs.AUDIO,audioCodec:e.audioCodec}})),SUBTITLES:a.map((function(e){return{id:e.attrs.SUBTITLES,textCodec:e.textCodec}})),"CLOSED-CAPTIONS":[]},o=0;for(Rr.lastIndex=0;null!==(v=Rr.exec(t));){var u,l,c,d,h,f,p,v=new Yn(v[1]),m=v.TYPE;m&&(u=s[m],l=i[m]||[],i[m]=l,ee(r,v,["URI","GROUP-ID","LANGUAGE","ASSOC-LANGUAGE","STABLE-RENDITION-ID","NAME","INSTREAM-ID","CHARACTERISTICS","CHANNELS"]),p=v.LANGUAGE,c=v["ASSOC-LANGUAGE"],d=v.CHANNELS,h=v.CHARACTERISTICS,f=v["INSTREAM-ID"],m={attrs:v,bitrate:0,id:o++,groupId:v["GROUP-ID"]||"",name:v.NAME||p||"",type:m,default:v.bool("DEFAULT"),autoselect:v.bool("AUTOSELECT"),forced:v.bool("FORCED"),lang:p,url:v.URI?e.resolve(v.URI,n):""},c&&(m.assocLang=c),d&&(m.channels=d),h&&(m.characteristics=h),f&&(m.instreamId=f),null!=u&&u.length&&(fe(m,p=e.findGroup(u,m.groupId)||u[0],"audioCodec"),fe(m,p,"textCodec")),l.push(m))}return i},e.parseLevelPlaylist=function(e,t,n,r,i,a){var s,o,u,c=new ar(t),d=c.fragments,h=null,f=0,p=0,v=0,m=0,g=null,y=new rr(r,t),_=-1,b=!1,T=null;for(Ir.lastIndex=0,c.m3u8=e,c.hasVariableRefs=Z(e);null!==(s=Ir.exec(e));){b&&(b=!1,(y=new rr(r,t)).start=v,y.sn=f,y.cc=m,y.level=n,h)&&(y.initSegment=h,y.rawProgramDateTime=h.rawProgramDateTime,h.rawProgramDateTime=null,T)&&(y.setByteRange(T),T=null);var S=s[1];if(S){y.duration=parseFloat(S);var E=(" "+s[2]).slice(1);y.title=E||null,y.tagList.push(E?["INF",S,E]:["INF",S])}else if(s[3])Gn(y.duration)&&(y.start=v,u&&me(y,u,c),y.sn=f,y.level=n,y.cc=m,d.push(y),E=(" "+s[3]).slice(1),y.relurl=te(c,E),pe(y,g),v+=(g=y).duration,f++,b=!(p=0));else if(s[4])S=(" "+s[4]).slice(1),g?y.setByteRange(S,g):y.setByteRange(S);else if(s[5])y.rawProgramDateTime=(" "+s[5]).slice(1),y.tagList.push(["PROGRAM-DATE-TIME",y.rawProgramDateTime]),-1===_&&(_=d.length);else if(s=s[0].match(Or)){for(o=1;o<s.length&&void 0===s[o];o++);var k=(" "+s[o]).slice(1),w=(" "+s[o+1]).slice(1),C=s[o+2]?(" "+s[o+2]).slice(1):"";switch(k){case"PLAYLIST-TYPE":c.type=w.toUpperCase();break;case"MEDIA-SEQUENCE":f=c.startSN=parseInt(w);break;case"SKIP":var A=new Yn(w),L=(ee(c,A,["RECENTLY-REMOVED-DATERANGES"]),A.decimalInteger("SKIPPED-SEGMENTS"));if(Gn(L)){for(var R=c.skippedSegments=L;R--;)d.unshift(null);f+=L}(L=A.enumeratedString("RECENTLY-REMOVED-DATERANGES"))&&(c.recentlyRemovedDateranges=L.split("\t"));break;case"TARGETDURATION":c.targetduration=Math.max(parseInt(w),1);break;case"VERSION":c.version=parseInt(w);break;case"INDEPENDENT-SEGMENTS":case"EXTM3U":break;case"ENDLIST":c.live=!1;break;case"#":(w||C)&&y.tagList.push(C?[w,C]:[w]);break;case"DISCONTINUITY":m++,y.tagList.push(["DIS"]);break;case"GAP":y.gap=!0,y.tagList.push([k]);break;case"BITRATE":y.tagList.push([k,w]);break;case"DATERANGE":ee(c,A=new Yn(w),["ID","CLASS","START-DATE","END-DATE","SCTE35-CMD","SCTE35-OUT","SCTE35-IN"]),ee(c,A,A.clientAttrs),(L=new Zn(A,c.dateRanges[A.ID])).isValid||c.skippedSegments?c.dateRanges[L.id]=L:Qn.warn('Ignoring invalid DATERANGE tag: "'+w+'"'),y.tagList.push(["EXT-X-DATERANGE",w]);break;case"DEFINE":var x=new Yn(w);ee(c,x,["NAME","VALUE","IMPORT","QUERYPARAM"]),"IMPORT"in x?(O=c,P=a,I=void 0,D=(D=x).IMPORT,P&&D in P?((I=O.variableList)||(O.variableList=I={}),I[D]=P[D]):O.playlistParsingError||(O.playlistParsingError=new Error('EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "'+D+'"'))):ne(c,x,t);break;case"DISCONTINUITY-SEQUENCE":m=parseInt(w);break;case"KEY":var I=de(w,t,c);if(I.isSupported()){if("NONE"===I.method){u=void 0;break}(u=(u=u||{})[I.keyFormat]?l({},u):u)[I.keyFormat]=I}else Qn.warn('[Keys] Ignoring invalid EXT-X-KEY tag: "'+w+'"');break;case"START":c.startTimeOffset=he(w);break;case"MAP":var O,D,P=new Yn(w);ee(c,P,["BYTERANGE","URI"]),y.duration?(ve(O=new rr(r,t),P,n,u),(y.initSegment=h=O).rawProgramDateTime&&!y.rawProgramDateTime&&(y.rawProgramDateTime=h.rawProgramDateTime)):(T=(D=y.byteRangeEndOffset)?D-(x=y.byteRangeStartOffset)+"@"+x:null,ve(y,P,n,u),h=y,b=!0);break;case"SERVER-CONTROL":var M=new Yn(w);c.canBlockReload=M.bool("CAN-BLOCK-RELOAD"),c.canSkipUntil=M.optionalFloat("CAN-SKIP-UNTIL",0),c.canSkipDateRanges=0<c.canSkipUntil&&M.bool("CAN-SKIP-DATERANGES"),c.partHoldBack=M.optionalFloat("PART-HOLD-BACK",0),c.holdBack=M.optionalFloat("HOLD-BACK",0);break;case"PART-INF":M=new Yn(w),c.partTarget=M.decimalFloatingPoint("PART-TARGET");break;case"PART":var j=(j=c.partList)||(c.partList=[]),U=0<p?j[j.length-1]:void 0,B=p++,F=(ee(c,F=new Yn(w),["BYTERANGE","URI"]),new ir(F,y,t,B,U));j.push(F),y.duration+=F.duration;break;case"PRELOAD-HINT":ee(c,B=new Yn(w),["URI"]),c.preloadHint=B;break;case"RENDITION-REPORT":ee(c,U=new Yn(w),["URI"]),c.renditionReports=c.renditionReports||[],c.renditionReports.push(U);break;default:Qn.warn("line parsed but not handled: "+s)}}else Qn.warn("No matches on slow regex match for level playlist!")}g&&!g.relurl?(d.pop(),v-=g.duration,c.partList&&(c.fragmentHint=g)):c.partList&&(pe(y,g),y.cc=m,c.fragmentHint=y,u)&&me(y,u,c);var N=d.length,G=d[0],V=d[N-1];return 0<(v+=c.skippedSegments*c.targetduration)&&N&&V?(c.averagetargetduration=v/N,N=V.sn,c.endSN="initSegment"!==N?N:0,c.live||(V.endList=!0),G&&(c.startCC=G.cc)):(c.endSN=0,c.startCC=0),c.fragmentHint&&(v+=c.fragmentHint.duration),c.totalduration=v,c.endCC=m,0<_&&function(e,t){for(var n=e[t],r=t;r--;){var i=e[r];if(!i)return;i.programDateTime=n.programDateTime-1e3*i.duration,n=i}}(d,_),c},e}(),Pr="manifest",Mr="level",jr="audioTrack",Ur="subtitleTrack",Br="main",Fr="audio",Nr="subtitle",Gr=function(){function e(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.hls=e,this.registerListeners()}var t=e.prototype;return t.startLoad=function(e){},t.stopLoad=function(){this.destroyInternalLoaders()},t.registerListeners=function(){var e=this.hls;e.on(zn.MANIFEST_LOADING,this.onManifestLoading,this),e.on(zn.LEVEL_LOADING,this.onLevelLoading,this),e.on(zn.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(zn.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},t.unregisterListeners=function(){var e=this.hls;e.off(zn.MANIFEST_LOADING,this.onManifestLoading,this),e.off(zn.LEVEL_LOADING,this.onLevelLoading,this),e.off(zn.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(zn.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},t.createInternalLoader=function(e){var t=this.hls.config,n=t.pLoader,r=t.loader;n=new(n||r)(t);return this.loaders[e.type]=n},t.getInternalLoader=function(e){return this.loaders[e.type]},t.resetInternalLoader=function(e){this.loaders[e]&&delete this.loaders[e]},t.destroyInternalLoaders=function(){for(var e in this.loaders){var t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}},t.destroy=function(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()},t.onManifestLoading=function(e,t){t=t.url,this.variableList=null,this.load({id:null,level:0,responseType:"text",type:Pr,url:t,deliveryDirectives:null})},t.onLevelLoading=function(e,t){var n=t.id,r=t.level,i=t.pathwayId,a=t.url;t=t.deliveryDirectives;this.load({id:n,level:r,pathwayId:i,responseType:"text",type:Mr,url:a,deliveryDirectives:t})},t.onAudioTrackLoading=function(e,t){var n=t.id,r=t.groupId,i=t.url;t=t.deliveryDirectives;this.load({id:n,groupId:r,level:null,responseType:"text",type:jr,url:i,deliveryDirectives:t})},t.onSubtitleTrackLoading=function(e,t){var n=t.id,r=t.groupId,i=t.url;t=t.deliveryDirectives;this.load({id:n,groupId:r,level:null,responseType:"text",type:Ur,url:i,deliveryDirectives:t})},t.load=function(e){var t=this,n=this.hls.config,r=this.getInternalLoader(e);if(r){var i=r.context;if(i&&i.url===e.url&&i.level===e.level)return void this.hls.logger.trace("[playlist-loader]: playlist request ongoing");this.hls.logger.log("[playlist-loader]: aborting previous loader for type: "+e.type),r.abort()}i=e.type===Pr?n.manifestLoadPolicy.default:l({},n.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),r=this.createInternalLoader(e),Gn(null==(n=e.deliveryDirectives)?void 0:n.part)&&(e.type===Mr&&null!==e.level?a=this.hls.levels[e.level].details:e.type===jr&&null!==e.id?a=this.hls.audioTracks[e.id].details:e.type===Ur&&null!==e.id&&(a=this.hls.subtitleTracks[e.id].details),a)&&(n=a.partTarget,a=a.targetduration,n)&&a&&(n=1e3*Math.max(3*n,.8*a),i=l({},i,{maxTimeToFirstByteMs:Math.min(n,i.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(n,i.maxTimeToFirstByteMs)}));var a=i.errorRetry||i.timeoutRetry||{};n={loadPolicy:i,timeout:i.maxLoadTimeMs,maxRetry:a.maxNumRetry||0,retryDelay:a.retryDelayMs||0,maxRetryDelay:a.maxRetryDelayMs||0};r.load(e,n,{onSuccess:function(e,n,r,i){var a=t.getInternalLoader(r),s=(t.resetInternalLoader(r.type),e.data);0!==s.indexOf("#EXTM3U")?t.handleManifestParsingError(e,r,new Error("no EXTM3U delimiter"),i||null,n):(n.parsing.start=performance.now(),Dr.isMediaPlaylist(s)?t.handleTrackOrLevelPlaylist(e,n,r,i||null,a):t.handleMasterPlaylist(e,n,r,i))},onError:function(e,n,r,i){t.handleNetworkError(n,r,!1,e,i)},onTimeout:function(e,n,r){t.handleNetworkError(n,r,!0,void 0,e)}})},t.handleMasterPlaylist=function(e,t,n,r){var i,a,s,o,u,l=this.hls,c=e.data,d=ye(e,n),h=Dr.parseMasterPlaylist(c,d);h.playlistParsingError?this.handleManifestParsingError(e,n,h.playlistParsingError,r,t):(e=h.contentSteering,n=h.levels,i=h.sessionData,a=h.sessionKeys,s=h.startTimeOffset,o=h.variableList,this.variableList=o,h=(c=Dr.parseMasterPlaylistMedia(c,d,h)).AUDIO,u=c.SUBTITLES,c=c["CLOSED-CAPTIONS"],(h=void 0===h?[]:h).length&&!h.some((function(e){return!e.url}))&&n[0].audioCodec&&!n[0].attrs.AUDIO&&(this.hls.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),h.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new Yn({}),bitrate:0,url:""})),l.trigger(zn.MANIFEST_LOADED,{levels:n,audioTracks:h,subtitles:u,captions:c,contentSteering:e,url:d,stats:t,networkDetails:r,sessionData:i,sessionKeys:a,startTimeOffset:s,variableList:o}))},t.handleTrackOrLevelPlaylist=function(e,t,n,r,i){var a=this.hls,s=n.id,o=n.level,u=n.type,l=ye(e,n);o=Gn(o)?o:Gn(s)?s:0,s=ge(n),o=Dr.parseLevelPlaylist(e.data,l,o,s,0,this.variableList);u===Pr&&(s={attrs:new Yn({}),bitrate:0,details:o,name:"",url:l},a.trigger(zn.MANIFEST_LOADED,{levels:[s],audioTracks:[],url:l,stats:t,networkDetails:r,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})),t.parsing.end=performance.now(),n.levelDetails=o,this.handlePlaylistLoaded(o,e,t,n,r,i)},t.handleManifestParsingError=function(e,t,n,r,i){this.hls.trigger(zn.ERROR,{type:Wn.NETWORK_ERROR,details:Kn.MANIFEST_PARSING_ERROR,fatal:t.type===Pr,url:e.url,err:n,error:n,reason:n.message,response:e,context:t,networkDetails:r,stats:i})},t.handleNetworkError=function(e,t,r,i,a){var s="A network "+((r=void 0!==r&&r)?"timeout":"error"+(i?" (status "+i.code+")":""))+" occurred while loading "+e.type,o=(e.type===Mr?s+=": "+e.level+" id: "+e.id:e.type!==jr&&e.type!==Ur||(s+=" id: "+e.id+' group-id: "'+e.groupId+'"'),new Error(s)),u=(this.hls.logger.warn("[playlist-loader]: "+s),Kn.UNKNOWN),l=!1;s=this.getInternalLoader(e);switch(e.type){case Pr:u=r?Kn.MANIFEST_LOAD_TIMEOUT:Kn.MANIFEST_LOAD_ERROR,l=!0;break;case Mr:u=r?Kn.LEVEL_LOAD_TIMEOUT:Kn.LEVEL_LOAD_ERROR,l=!1;break;case jr:u=r?Kn.AUDIO_TRACK_LOAD_TIMEOUT:Kn.AUDIO_TRACK_LOAD_ERROR,l=!1;break;case Ur:u=r?Kn.SUBTITLE_TRACK_LOAD_TIMEOUT:Kn.SUBTITLE_LOAD_ERROR,l=!1}s&&this.resetInternalLoader(e.type),s={type:Wn.NETWORK_ERROR,details:u,fatal:l,url:e.url,loader:s,context:e,error:o,networkDetails:t,stats:a},i&&(o=(null==t?void 0:t.url)||e.url,s.response=n({url:o,data:void 0},i)),this.hls.trigger(zn.ERROR,s)},t.handlePlaylistLoaded=function(e,t,n,r,i,a){var s=this.hls,o=r.type,u=r.level,l=r.id,c=r.groupId,d=r.deliveryDirectives,h=ye(t,r),f=ge(r),p="number"==typeof r.level&&f===Br?u:void 0;if(e.fragments.length)if(e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration")),u=e.playlistParsingError)s.trigger(zn.ERROR,{type:Wn.NETWORK_ERROR,details:Kn.LEVEL_PARSING_ERROR,fatal:!1,url:h,error:u,reason:u.message,response:t,context:r,level:p,parent:f,networkDetails:i,stats:n});else switch(e.live&&a&&(a.getCacheAge&&(e.ageHeader=a.getCacheAge()||0),a.getCacheAge&&!isNaN(e.ageHeader)||(e.ageHeader=0)),o){case Pr:case Mr:s.trigger(zn.LEVEL_LOADED,{details:e,level:p||0,id:l||0,stats:n,networkDetails:i,deliveryDirectives:d});break;case jr:s.trigger(zn.AUDIO_TRACK_LOADED,{details:e,id:l||0,groupId:c||"",stats:n,networkDetails:i,deliveryDirectives:d});break;case Ur:s.trigger(zn.SUBTITLE_TRACK_LOADED,{details:e,id:l||0,groupId:c||"",stats:n,networkDetails:i,deliveryDirectives:d})}else u=new Error("No Segments found in Playlist"),s.trigger(zn.ERROR,{type:Wn.NETWORK_ERROR,details:Kn.LEVEL_EMPTY_ERROR,fatal:!1,url:h,error:u,reason:u.message,response:t,context:r,level:p,parent:f,networkDetails:i,stats:n})},e}(),Vr="org.id3",Hr="https://aomedia.org/emsg/ID3",zr=function(){var e=ke();try{e&&new e(0,Number.POSITIVE_INFINITY,"")}catch(e){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY}(),Wr=function(){function e(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=e,this._registerListeners()}var t=e.prototype;return t.destroy=function(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=null},t._registerListeners=function(){var e=this.hls;e.on(zn.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(zn.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(zn.MANIFEST_LOADING,this.onManifestLoading,this),e.on(zn.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(zn.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(zn.LEVEL_UPDATED,this.onLevelUpdated,this)},t._unregisterListeners=function(){var e=this.hls;e.off(zn.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(zn.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(zn.MANIFEST_LOADING,this.onManifestLoading,this),e.off(zn.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(zn.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(zn.LEVEL_UPDATED,this.onLevelUpdated,this)},t.onMediaAttached=function(e,t){this.media=t.media},t.onMediaDetaching=function(){this.id3Track&&(Te(this.id3Track),this.id3Track=null),this.media=null,this.dateRangeCuesAppended={}},t.onManifestLoading=function(){this.dateRangeCuesAppended={}},t.createTrack=function(e){return(e=this.getID3Track(e.textTracks)).mode="hidden",e},t.getID3Track=function(e){if(this.media){for(var t=0;t<e.length;t++){var n=e[t];if("metadata"===n.kind&&"id3"===n.label)return _e(n,this.media),n}return this.media.addTextTrack("metadata","id3")}},t.onFragParsingMetadata=function(e,t){if(this.media){var n=this.hls.config,r=n.enableEmsgMetadataCues,i=n.enableID3MetadataCues;if(r||i){var a=t.samples,s=(this.id3Track||(this.id3Track=this.createTrack(this.media)),ke());if(s)for(var o=0;o<a.length;o++){var u=a[o].type;if((u!==Hr||r)&&i){var l=P(a[o].data);if(l){var c=a[o].pts,d=c+a[o].duration;(d=zr<d?zr:d)-c<=0&&(d=c+.25);for(var h=0;h<l.length;h++){var f=l[h];!D(f)&&(this.updateId3CueEnds(c,u),f=we(s,c,d,f,u))&&this.id3Track.addCue(f)}}}}}}},t.updateId3CueEnds=function(e,t){var n,r=null==(n=this.id3Track)?void 0:n.cues;if(r)for(var i=r.length;i--;){var a=r[i];a.type===t&&a.startTime<e&&a.endTime===zr&&(a.endTime=e)}},t.onBufferFlushing=function(e,t){var n,r,i=t.startOffset,a=t.endOffset,s=(t=t.type,this.id3Track),o=this.hls;o&&(o=o.config,n=o.enableEmsgMetadataCues,r=o.enableID3MetadataCues,s)&&(n||r)&&Se(s,i,a,"audio"===t?function(e){return e.type===Vr&&r}:"video"===t?function(e){return e.type===Hr&&n}:function(e){return e.type===Vr&&r||e.type===Hr&&n})},t.onLevelUpdated=function(e,t){var n=this;t=t.details;if(this.media&&t.hasProgramDateTime&&this.hls.config.enableDateRangeMetadataCues){var r=this.dateRangeCuesAppended,i=this.id3Track,a=t.dateRanges,s=Object.keys(a);if(i)for(var o=Object.keys(r).filter((function(e){return!s.includes(e)})),u=o.length;u--;)!function(){var e=o[u];Object.keys(r[e].cues).forEach((function(t){i.removeCue(r[e].cues[t])})),delete r[e]}();if(t=t.fragments[t.fragments.length-1],0!==s.length&&Gn(null==t?void 0:t.programDateTime)){this.id3Track||(this.id3Track=this.createTrack(this.media));for(var l=t.programDateTime/1e3-t.start,c=ke(),d=0;d<s.length;d++)!function(){for(var e=s[d],t=a[e],i=Ce(t.startDate,l),o=r[e],u=(null==o?void 0:o.cues)||{},h=(null==o?void 0:o.durationKnown)||!1,f=zr,p=t.endDate,v=(p?(f=Ce(p,l),h=!0):t.endOnNext&&!h&&(p=s.reduce((function(e,n){return n!==t.id&&((n=a[n]).class===t.class&&n.startDate>t.startDate&&(!e||t.startDate<e.startDate))?n:e}),null))&&(f=Ce(p.startDate,l),h=!0),Object.keys(t.attr)),m=0;m<v.length;m++){var g,y,_=v[m];"ID"!==(g=_)&&"CLASS"!==g&&"START-DATE"!==g&&"DURATION"!==g&&"END-DATE"!==g&&"END-ON-NEXT"!==g&&((g=u[_])?h&&!o.durationKnown&&(g.endTime=f):c&&(g=t.attr[_],"SCTE35-OUT"!==(y=_)&&"SCTE35-IN"!==y||(y=g,g=Uint8Array.from(y.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer),y=we(c,i,f,{key:_,data:g},"com.apple.quicktime.HLS"))&&(y.id=e,n.id3Track.addCue(y),u[_]=y))}r[e]={cues:u,dateRange:t,durationKnown:h}}()}}},e}(),Kr=function(){function e(e){var t=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.onTimeupdate=function(){var e,n,r,i=t.media,a=t.levelDetails;i&&a&&(t.currentTime=i.currentTime,null!==(n=t.computeLatency()))&&(t._latency=n,r=(e=t.config).lowLatencyMode,e=e.maxLiveSyncPlaybackRate,r)&&1!==e&&a.live&&null!==(r=t.targetLatency)&&((n-=r)<Math.min(t.maxLatency,r+a.targetduration)&&.05<n&&1<t.forwardBufferLength?(r=Math.min(2,Math.max(1,e)),a=Math.round(2/(1+Math.exp(-.75*n-t.edgeStalled))*20)/20,i.playbackRate=Math.min(r,Math.max(1,a))):1!==i.playbackRate&&0!==i.playbackRate&&(i.playbackRate=1))},this.hls=e,this.config=e.config,this.registerListeners()}var t=e.prototype;return t.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=null},t.registerListeners=function(){this.hls.on(zn.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(zn.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(zn.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(zn.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(zn.ERROR,this.onError,this)},t.unregisterListeners=function(){this.hls.off(zn.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(zn.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.off(zn.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(zn.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.off(zn.ERROR,this.onError,this)},t.onMediaAttached=function(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.onTimeupdate)},t.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.onTimeupdate),this.media=null)},t.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},t.onLevelUpdated=function(e,t){t=t.details,(this.levelDetails=t).advanced&&this.onTimeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.onTimeupdate)},t.onError=function(e,t){t.details===Kn.BUFFER_STALLED_ERROR&&(this.stallCount++,null!=(t=this.levelDetails))&&t.live&&this.hls.logger.warn("[latency-controller]: Stall detected, adjusting target latency")},t.estimateLiveEdge=function(){var e=this.levelDetails;return null===e?null:e.edge+e.age},t.computeLatency=function(){var e=this.estimateLiveEdge();return null===e?null:e-this.currentTime},u(e,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var e=this.config,t=this.levelDetails;return void 0!==e.liveMaxLatencyDuration?e.liveMaxLatencyDuration:t?e.liveMaxLatencyDurationCount*t.targetduration:0}},{key:"targetLatency",get:function(){var e,t,n,r,i,a=this.levelDetails;return null===a?null:(e=a.holdBack,r=a.partHoldBack,a=a.targetduration,t=(i=this.config).liveSyncDuration,n=i.liveSyncDurationCount,i=i.lowLatencyMode&&r||e,(i=(r=this.hls.userConfig).liveSyncDuration||r.liveSyncDurationCount||0===i?void 0!==t?t:n*a:i)+Math.min(+this.stallCount,a))}},{key:"liveSyncPosition",get:function(){var e,t=this.estimateLiveEdge(),n=this.targetLatency,r=this.levelDetails;return null===t||null===n||null===r?null:(e=r.edge,t=t-n-this.edgeStalled,n=e-r.totalduration,e-=this.config.lowLatencyMode&&r.partTarget||r.targetduration,Math.min(Math.max(n,t),e))}},{key:"drift",get:function(){var e=this.levelDetails;return null===e?1:e.drift}},{key:"edgeStalled",get:function(){var e,t=this.levelDetails;return null===t?0:(e=3*(this.config.lowLatencyMode&&t.partTarget||t.targetduration),Math.max(t.age-e,0))}},{key:"forwardBufferLength",get:function(){var e,t=this.media,n=this.levelDetails;return t&&n?((e=t.buffered.length)?t.buffered.end(e-1):n.edge)-this.currentTime:0}}])}(),qr=["NONE","TYPE-0","TYPE-1",null],$r=["SDR","PQ","HLG"],Yr=function(){function e(e,t,n){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=n}return e.prototype.addDirectives=function(e){return e=new self.URL(e),void 0!==this.msn&&e.searchParams.set("_HLS_msn",this.msn.toString()),void 0!==this.part&&e.searchParams.set("_HLS_part",this.part.toString()),this.skip&&e.searchParams.set("_HLS_skip",this.skip),e.href},e}(),Xr=function(){function e(e){this._attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.url=void 0,this.frameRate=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.supportedPromise=void 0,this.supportedResult=void 0,this._avgBitrate=0,this._audioGroups=void 0,this._subtitleGroups=void 0,this._urlId=0,this.url=[e.url],this._attrs=[e.attrs],this.bitrate=e.bitrate,e.details&&(this.details=e.details),this.id=e.id||0,this.name=e.name,this.width=e.width||0,this.height=e.height||0,this.frameRate=e.attrs.optionalFloat("FRAME-RATE",0),this._avgBitrate=e.attrs.decimalInteger("AVERAGE-BANDWIDTH"),this.audioCodec=e.audioCodec,this.videoCodec=e.videoCodec,this.codecSet=[e.videoCodec,e.audioCodec].filter((function(e){return!!e})).map((function(e){return e.substring(0,4)})).join(","),this.addGroupId("audio",e.attrs.AUDIO),this.addGroupId("text",e.attrs.SUBTITLES)}var t=e.prototype;return t.hasAudioGroup=function(e){return Ae(this._audioGroups,e)},t.hasSubtitleGroup=function(e){return Ae(this._subtitleGroups,e)},t.addGroupId=function(e,t){var n;t&&("audio"===e?-1===(n=(n=this._audioGroups)||(this._audioGroups=[])).indexOf(t)&&n.push(t):"text"===e&&-1===(n=(n=this._subtitleGroups)||(this._subtitleGroups=[])).indexOf(t)&&n.push(t))},t.addFallback=function(){},u(e,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"averageBitrate",get:function(){return this._avgBitrate||this.realBitrate||this.bitrate}},{key:"attrs",get:function(){return this._attrs[0]}},{key:"codecs",get:function(){return this.attrs.CODECS||""}},{key:"pathwayId",get:function(){return this.attrs["PATHWAY-ID"]||"."}},{key:"videoRange",get:function(){return this.attrs["VIDEO-RANGE"]||"SDR"}},{key:"score",get:function(){return this.attrs.optionalFloat("SCORE",0)}},{key:"uri",get:function(){return this.url[0]||""}},{key:"audioGroups",get:function(){return this._audioGroups}},{key:"subtitleGroups",get:function(){return this._subtitleGroups}},{key:"urlId",get:function(){return 0},set:function(e){}},{key:"audioGroupIds",get:function(){return this.audioGroups?[this.audioGroupId]:void 0}},{key:"textGroupIds",get:function(){return this.subtitleGroups?[this.textGroupId]:void 0}},{key:"audioGroupId",get:function(){var e;return null==(e=this.audioGroups)?void 0:e[0]}},{key:"textGroupId",get:function(){var e;return null==(e=this.subtitleGroups)?void 0:e[0]}}])}(),Jr={search:function(e,t){for(var n=0,r=e.length-1;n<=r;){var i,a,s=t(a=e[i=(n+r)/2|0]);if(0<s)n=1+i;else{if(!(s<0))return a;r=i-1}}return null}},Qr=function(e){function t(t){var n=e.call(this,"error-controller",t.logger)||this;return n.hls=void 0,n.playlistError=0,n.penalizedRenditions={},n.hls=t,n.registerListeners(),n}c(t,e);var n=t.prototype;return n.registerListeners=function(){var e=this.hls;e.on(zn.ERROR,this.onError,this),e.on(zn.MANIFEST_LOADING,this.onManifestLoading,this),e.on(zn.LEVEL_UPDATED,this.onLevelUpdated,this)},n.unregisterListeners=function(){var e=this.hls;e&&(e.off(zn.ERROR,this.onError,this),e.off(zn.ERROR,this.onErrorOut,this),e.off(zn.MANIFEST_LOADING,this.onManifestLoading,this),e.off(zn.LEVEL_UPDATED,this.onLevelUpdated,this))},n.destroy=function(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}},n.startLoad=function(e){},n.stopLoad=function(){this.playlistError=0},n.getVariantLevelIndex=function(e){return(null==e?void 0:e.type)===Br?e.level:this.hls.loadLevel},n.onManifestLoading=function(){this.playlistError=0,this.penalizedRenditions={}},n.onLevelUpdated=function(){this.playlistError=0},n.onError=function(e,t){if(!t.fatal){var n=this.hls,r=t.context;switch(t.details){case Kn.FRAG_LOAD_ERROR:case Kn.FRAG_LOAD_TIMEOUT:case Kn.KEY_LOAD_ERROR:case Kn.KEY_LOAD_TIMEOUT:return void(t.errorAction=this.getFragRetryOrSwitchAction(t));case Kn.FRAG_PARSING_ERROR:if(null!=(i=t.frag)&&i.gap)return void(t.errorAction={action:0,flags:0});case Kn.FRAG_GAP:case Kn.FRAG_DECRYPT_ERROR:return t.errorAction=this.getFragRetryOrSwitchAction(t),void(t.errorAction.action=2);case Kn.LEVEL_EMPTY_ERROR:case Kn.LEVEL_PARSING_ERROR:var i=t.parent===Br?t.level:n.loadLevel;return void(t.details===Kn.LEVEL_EMPTY_ERROR&&null!=(a=t.context)&&null!=(a=a.levelDetails)&&a.live?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,i):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,i)));case Kn.LEVEL_LOAD_ERROR:case Kn.LEVEL_LOAD_TIMEOUT:return void("number"==typeof(null==r?void 0:r.level)&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,r.level)));case Kn.AUDIO_TRACK_LOAD_ERROR:case Kn.AUDIO_TRACK_LOAD_TIMEOUT:case Kn.SUBTITLE_LOAD_ERROR:case Kn.SUBTITLE_TRACK_LOAD_TIMEOUT:if(r)if((a=n.levels[n.loadLevel])&&(r.type===jr&&a.hasAudioGroup(r.groupId)||r.type===Ur&&a.hasSubtitleGroup(r.groupId)))return t.errorAction=this.getPlaylistRetryOrSwitchAction(t,n.loadLevel),t.errorAction.action=2,void(t.errorAction.flags=1);return;case Kn.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:var a;return void((a=null==(i=n.levels[n.loadLevel])?void 0:i.attrs["HDCP-LEVEL"])?t.errorAction={action:2,flags:2,hdcpLevel:a}:this.keySystemError(t));case Kn.BUFFER_ADD_CODEC_ERROR:case Kn.REMUX_ALLOC_ERROR:case Kn.BUFFER_APPEND_ERROR:return void(t.errorAction=this.getLevelSwitchAction(t,null!=(i=t.level)?i:n.loadLevel));case Kn.INTERNAL_EXCEPTION:case Kn.BUFFER_APPENDING_ERROR:case Kn.BUFFER_FULL_ERROR:case Kn.LEVEL_SWITCH_ERROR:case Kn.BUFFER_STALLED_ERROR:case Kn.BUFFER_SEEK_OVER_HOLE:case Kn.BUFFER_NUDGE_ON_STALL:return void(t.errorAction={action:0,flags:0})}t.type===Wn.KEY_SYSTEM_ERROR&&this.keySystemError(t)}},n.keySystemError=function(e){var t=this.getVariantLevelIndex(e.frag);e.levelRetry=!1,e.errorAction=this.getLevelSwitchAction(e,t)},n.getPlaylistRetryOrSwitchAction=function(e,t){var n=Ue(this.hls.config.playlistLoadPolicy,e),r=this.playlistError++;return Ne(n,r,je(e),e.response)?{action:5,flags:0,retryConfig:n,retryCount:r}:(e=this.getLevelSwitchAction(e,t),n&&(e.retryConfig=n,e.retryCount=r),e)},n.getFragRetryOrSwitchAction=function(e){var t=this.hls,n=this.getVariantLevelIndex(e.frag),r=t.levels[n],i=(a=t.config).fragLoadPolicy,a=a.keyLoadPolicy;a=Ue(e.details.startsWith("key")?a:i,e),i=t.levels.reduce((function(e,t){return e+t.fragmentError}),0);return r&&(e.details!==Kn.FRAG_GAP&&r.fragmentError++,Ne(a,i,je(e),e.response))?{action:5,flags:0,retryConfig:a,retryCount:i}:(t=this.getLevelSwitchAction(e,n),a&&(t.retryConfig=a,t.retryCount=i),t)},n.getLevelSwitchAction=function(e,t){var n=this.hls,r=(null==t&&(t=n.loadLevel),this.hls.levels[t]);if(r){for(var i,a=e.details,s=(r.loadError++,a===Kn.BUFFER_APPEND_ERROR&&r.fragmentError++,-1),o=n.levels,u=n.loadLevel,l=n.minAutoLevel,c=n.maxAutoLevel,d=(n.autoLevelEnabled||(n.loadLevel=-1),null==(t=e.frag)?void 0:t.type),h=(d===Fr&&a===Kn.FRAG_PARSING_ERROR||"audio"===e.sourceBufferName&&(a===Kn.BUFFER_ADD_CODEC_ERROR||a===Kn.BUFFER_APPEND_ERROR))&&o.some((function(e){return e=e.audioCodec,r.audioCodec!==e})),f="video"===e.sourceBufferName&&(a===Kn.BUFFER_ADD_CODEC_ERROR||a===Kn.BUFFER_APPEND_ERROR)&&o.some((function(e){var t=e.codecSet;e=e.audioCodec;return r.codecSet!==t&&r.audioCodec===e})),p=(t=null!=(t=e.context)?t:{}).type,v=t.groupId,m=o.length;m--&&(0===(i=function(){var t=(m+u)%o.length;if(t!==u&&l<=t&&t<=c&&0===o[t].loadError){var n=o[t];if(a===Kn.FRAG_GAP&&e.frag){var i;if(i=o[t].details)if(null!=(i=Ge(e.frag,i.fragments,e.frag.start))&&i.gap)return 0}else{if(p===jr&&n.hasAudioGroup(v)||p===Ur&&n.hasSubtitleGroup(v))return 0;if(d===Fr&&null!=(i=r.audioGroups)&&i.some((function(e){return n.hasAudioGroup(e)}))||d===Nr&&null!=(i=r.subtitleGroups)&&i.some((function(e){return n.hasSubtitleGroup(e)}))||h&&r.audioCodec===n.audioCodec||!h&&r.audioCodec!==n.audioCodec||f&&r.codecSet===n.codecSet)return 0}return s=t,1}}())||1!==i););if(-1<s&&n.loadLevel!==s)return e.levelRetry=!0,this.playlistError=0,{action:2,flags:0,nextAutoLevel:s}}return{action:2,flags:1}},n.onErrorOut=function(e,t){var n;switch(null==(n=t.errorAction)?void 0:n.action){case 0:break;case 2:this.sendAlternateToPenaltyBox(t),t.errorAction.resolved||t.details===Kn.FRAG_GAP?/MediaSource readyState: ended/.test(t.error.message)&&(this.warn('MediaSource ended after "'+t.sourceBufferName+'" sourceBuffer append error. Attempting to recover from media error.'),this.hls.recoverMediaError()):t.fatal=!0}t.fatal&&this.hls.stopLoad()},n.sendAlternateToPenaltyBox=function(e){var t=this.hls,n=e.errorAction;if(n){var r=n.flags,i=n.hdcpLevel,a=n.nextAutoLevel;switch(r){case 0:this.switchLevel(e,a);break;case 2:i&&(t.maxHdcpLevel=qr[qr.indexOf(i)-1],n.resolved=!0),this.warn('Restricting playback to HDCP-LEVEL of "'+t.maxHdcpLevel+'" or lower')}n.resolved||this.switchLevel(e,a)}},n.switchLevel=function(e,t){void 0!==t&&e.errorAction&&(this.warn("switching to level "+t+" after "+e.details),this.hls.nextAutoLevel=t,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel)},t}(v),Zr=function(e){function t(t,n){return(n=e.call(this,n,t.logger)||this).hls=void 0,n.timer=-1,n.requestScheduled=-1,n.canLoad=!1,n.hls=t,n}c(t,e);var n=t.prototype;return n.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},n.clearTimer=function(){-1!==this.timer&&(self.clearTimeout(this.timer),this.timer=-1)},n.startLoad=function(){this.canLoad=!0,this.requestScheduled=-1,this.loadPlaylist()},n.stopLoad=function(){this.canLoad=!1,this.clearTimer()},n.switchParams=function(e,t){var n=null==t?void 0:t.renditionReports;if(n){for(var r,i,a,s=-1,o=0;o<n.length;o++){var u=n[o],l=void 0;try{l=new self.URL(u.URI,t.url).href}catch(e){this.warn("Could not construct new URL for Rendition Report: "+e),l=u.URI||""}if(l===e){s=o;break}l===e.substring(0,l.length)&&(s=o)}if(-1!==s)return i=n[s],r=parseInt(i["LAST-MSN"])||(null==t?void 0:t.lastPartSn),i=parseInt(i["LAST-PART"])||(null==t?void 0:t.lastPartIndex),this.hls.config.lowLatencyMode&&(a=Math.min(t.age-t.partTarget,t.targetduration),0<=i)&&a>t.partTarget&&(i+=1),new Yr(r,0<=i?i:void 0,"")}},n.loadPlaylist=function(e){-1===this.requestScheduled&&(this.requestScheduled=self.performance.now())},n.shouldLoadPlaylist=function(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)},n.shouldReloadPlaylist=function(e){return-1===this.timer&&-1===this.requestScheduled&&this.shouldLoadPlaylist(e)},n.playlistLoaded=function(e,t,n){var r=this,i=t.details,a=t.stats,s=self.performance.now(),o=a.loading.first?Math.max(0,s-a.loading.first):0;if(i.advancedDateTime=Date.now()-o,i.live||null!=n&&n.live){if(i.reloaded(n),n&&this.log("live playlist "+e+" "+(i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:i.updated?"UPDATED":"MISSED")),n&&0<i.fragments.length&&xe(n,i),this.canLoad&&i.live){o=void 0;var u,l=void 0;if(i.canBlockReload&&i.endSN&&i.advanced){var c,d,h=this.hls.config.lowLatencyMode,f=(c=i.lastPartSn)===(d=i.endSN),p=(c=(-1!==(p=i.lastPartIndex)?(o=f?d+1:c,l=f?h?0:p:p+1):o=d+1,i.age))+i.ageHeader;if(0<(d=Math.min(p-i.partTarget,1.5*i.targetduration))&&(p>3*i.targetduration?(this.log("Playlist last advanced "+c.toFixed(2)+"s ago. Omitting segment and part directives."),l=o=void 0):null!=n&&n.tuneInGoal&&p-i.partTarget>n.tuneInGoal?(this.warn("CDN Tune-in goal increased from: "+n.tuneInGoal+" to: "+d+" with playlist age: "+i.age),d=0):(o+=p=Math.floor(d/i.targetduration),void 0!==l&&(l+=Math.round(d%i.targetduration/i.partTarget)),this.log("CDN Tune-in age: "+i.ageHeader+"s last advanced "+c.toFixed(2)+"s goal: "+d+" skip sn "+p+" to part "+l)),i.tuneInGoal=d),u=this.getDeliveryDirectives(i,t.deliveryDirectives,o,l),h||!f)return void this.loadPlaylist(u)}else(i.canBlockReload||i.canSkipUntil)&&(u=this.getDeliveryDirectives(i,t.deliveryDirectives,o,l));c=(n=this.hls.mainForwardBufferInfo)?n.end-n.len:0,void 0===(d=p=1e3*(i.edge-c))&&(d=1/0),f=1e3*(h=i).targetduration,h.updated?(h=h.fragments).length&&d<4*f&&(d=1e3*h[h.length-1].duration)<f&&(f=d):f/=2,t=Math.round(f),i.updated&&s>this.requestScheduled+t&&(this.requestScheduled=a.loading.start),void 0!==o&&i.canBlockReload?this.requestScheduled=a.loading.first+t-(1e3*i.partTarget||1e3):-1===this.requestScheduled||this.requestScheduled+t<s?this.requestScheduled=s:this.requestScheduled-s<=0&&(this.requestScheduled+=t),l=this.requestScheduled-s,l=Math.max(0,l),this.log("reload live playlist "+e+" in "+Math.round(l)+" ms"),this.timer=self.setTimeout((function(){return r.loadPlaylist(u)}),l)}}else this.clearTimer()},n.getDeliveryDirectives=function(e,t,n,r){o=n,a=e.canSkipUntil,s=e.canSkipDateRanges,i=e.endSN;var i,a,s,o=a&&(void 0!==o?o-i:0)<a?s?"v2":"YES":"";return null!=t&&t.skip&&e.deltaUpdateFailed&&(n=t.msn,r=t.part,o=""),new Yr(n,r,o)},n.checkRetry=function(e){var t=this,n=e.details,r=je(e),i=e.errorAction,a=(o=i||{}).action,s=void 0===(s=o.retryCount)?0:s,o=o.retryConfig;if(a=!!i&&!!o&&(5===a||!i.resolved&&2===a)){if(this.requestScheduled=-1,s>=o.maxNumRetry)return!1;r&&null!=(r=e.context)&&r.deliveryDirectives?(this.warn("Retrying playlist loading "+(s+1)+"/"+o.maxNumRetry+' after "'+n+'" without delivery-directives'),this.loadPlaylist()):(r=Be(o,s),this.timer=self.setTimeout((function(){return t.loadPlaylist()}),r),this.warn("Retrying playlist loading "+(s+1)+"/"+o.maxNumRetry+' after "'+n+'" in '+r+"ms")),e.levelRetry=!0,i.resolved=!0}return a},t}(v),ei=function(){function e(e,t,n){void 0===t&&(t=0),void 0===n&&(n=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=n}var t=e.prototype;return t.sample=function(e,t){var n=Math.pow(this.alpha_,e);this.estimate_=t*(1-n)+n*this.estimate_,this.totalWeight_+=e},t.getTotalWeight=function(){return this.totalWeight_},t.getEstimate=function(){if(this.alpha_){var e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_},e}(),ti=function(){function e(e,t,n,r){void 0===r&&(r=100),this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=n,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new ei(e),this.fast_=new ei(t),this.defaultTTFB_=r,this.ttfb_=new ei(e)}var t=e.prototype;return t.update=function(e,t){var n=this.slow_,r=this.fast_,i=this.ttfb_;n.halfLife!==e&&(this.slow_=new ei(e,n.getEstimate(),n.getTotalWeight())),r.halfLife!==t&&(this.fast_=new ei(t,r.getEstimate(),r.getTotalWeight())),i.halfLife!==e&&(this.ttfb_=new ei(e,i.getEstimate(),i.getTotalWeight()))},t.sample=function(e,t){t=8*t/(e=(e=Math.max(e,this.minDelayMs_))/1e3),this.fast_.sample(e,t),this.slow_.sample(e,t)},t.sampleTTFB=function(e){var t=e/1e3;t=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(t,Math.max(e,5))},t.canEstimate=function(){return this.fast_.getTotalWeight()>=this.minWeight_},t.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},t.getEstimateTTFB=function(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_},t.destroy=function(){},e}(),ni={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]},ri={},ii=function(e){function t(t){var n=e.call(this,"abr",t.logger)||this;return n.hls=void 0,n.lastLevelLoadSec=0,n.lastLoadedFragLevel=-1,n.firstSelection=-1,n._nextAutoLevel=-1,n.nextAutoLevelKey="",n.audioTracksByGroup=null,n.codecTiers=null,n.timer=-1,n.fragCurrent=null,n.partCurrent=null,n.bitrateTestDelay=0,n.bwEstimator=void 0,n._abandonRulesCheck=function(){var e,t=(e=n).fragCurrent,r=e.partCurrent,i=(e=e.hls).autoLevelEnabled,a=e.media;if(t&&a){var s=performance.now(),o=(r||t).stats,u=(r||t).duration,l=(s=s-o.loading.start,e.minAutoLevel);if(o.aborted||o.loaded&&o.loaded===o.total||t.level<=l)n.clearTimer(),n._nextAutoLevel=-1;else if(i&&!a.paused&&a.playbackRate&&a.readyState&&null!==(i=e.mainForwardBufferInfo)){var c=n.bwEstimator.getEstimateTTFB();a=Math.abs(a.playbackRate);if(!(s<=Math.max(c,u/(2*a)*1e3))){var d,h=i.len/a,f=(i=o.loading.first?o.loading.first-o.loading.start:-1,a=o.loaded&&-1<i,n.getBwEstimate()),p=e.levels,v=p[t.level];v=o.total||Math.max(o.loaded,Math.round(u*v.averageBitrate/8));if(!((v=(d=((d=a?s-i:s)<1&&a&&(d=Math.min(s,8*o.loaded/f)),a?1e3*o.loaded/d:0))?(v-o.loaded)/d:8*v/f+c/1e3)<=h)){for(var m=d?8*d:f,g=Number.POSITIVE_INFINITY,y=t.level-1;l<y;y--){var _=p[y].maxBitrate;if((g=n.getTimeToLoadFrag(c/1e3,m,u*_,!p[y].details))<h)break}v<=g||10*u<g||(e.nextLoadLevel=e.nextAutoLevel=y,a?n.bwEstimator.sample(s-Math.min(c,i),o.loaded):n.bwEstimator.sampleTTFB(s),d=p[y].maxBitrate,n.getBwEstimate()*n.hls.config.abrBandWidthUpFactor>d&&n.resetEstimator(d),n.clearTimer(),n.warn("Fragment "+t.sn+(r?" part "+r.index:"")+" of level "+t.level+" is loading too slowly;\n Time to underbuffer: "+h.toFixed(3)+" s\n Estimated load time for current fragment: "+v.toFixed(3)+" s\n Estimated load time for down switch fragment: "+g.toFixed(3)+" s\n TTFB estimate: "+(0|i)+" ms\n Current BW estimate: "+(Gn(f)?0|f:"Unknown")+" bps\n New BW estimate: "+(0|n.getBwEstimate())+" bps\n Switching to level "+y+" @ "+(0|d)+" bps"),e.trigger(zn.FRAG_LOAD_EMERGENCY_ABORTED,{frag:t,part:r,stats:o}))}}}}},n.hls=t,n.bwEstimator=n.initEstimator(),n.registerListeners(),n}c(t,e);var n=t.prototype;return n.resetEstimator=function(e){e&&(this.log("setting initial bwe to "+e),this.hls.config.abrEwmaDefaultEstimate=e),this.firstSelection=-1,this.bwEstimator=this.initEstimator()},n.initEstimator=function(){var e=this.hls.config;return new ti(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)},n.registerListeners=function(){var e=this.hls;e.on(zn.MANIFEST_LOADING,this.onManifestLoading,this),e.on(zn.FRAG_LOADING,this.onFragLoading,this),e.on(zn.FRAG_LOADED,this.onFragLoaded,this),e.on(zn.FRAG_BUFFERED,this.onFragBuffered,this),e.on(zn.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(zn.LEVEL_LOADED,this.onLevelLoaded,this),e.on(zn.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(zn.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(zn.ERROR,this.onError,this)},n.unregisterListeners=function(){var e=this.hls;e&&(e.off(zn.MANIFEST_LOADING,this.onManifestLoading,this),e.off(zn.FRAG_LOADING,this.onFragLoading,this),e.off(zn.FRAG_LOADED,this.onFragLoaded,this),e.off(zn.FRAG_BUFFERED,this.onFragBuffered,this),e.off(zn.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(zn.LEVEL_LOADED,this.onLevelLoaded,this),e.off(zn.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(zn.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(zn.ERROR,this.onError,this))},n.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=null,this.fragCurrent=this.partCurrent=null},n.onManifestLoading=function(e,t){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()},n.onLevelsUpdated=function(){-1<this.lastLoadedFragLevel&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null},n.onMaxAutoLevelUpdated=function(){this.firstSelection=-1,this.nextAutoLevelKey=""},n.onFragLoading=function(e,t){var n=t.frag;this.ignoreFragment(n)||(n.bitrateTest||(this.fragCurrent=n,this.partCurrent=null!=(n=t.part)?n:null),this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100))},n.onLevelSwitching=function(e,t){this.clearTimer()},n.onError=function(e,t){if(!t.fatal)switch(t.details){case Kn.BUFFER_ADD_CODEC_ERROR:case Kn.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case Kn.FRAG_LOAD_TIMEOUT:var n,r=t.frag,i=this.fragCurrent,a=this.partCurrent;r&&i&&r.sn===i.sn&&r.level===i.level&&(a=performance.now()-(i=(a||r).stats).loading.start,r=i.loading.first?i.loading.first-i.loading.start:-1,i.loaded&&-1<r?(n=this.bwEstimator.getEstimateTTFB(),this.bwEstimator.sample(a-Math.min(n,r),i.loaded)):this.bwEstimator.sampleTTFB(a))}},n.getTimeToLoadFrag=function(e,t,n,r){return e+n/t+(r?this.lastLevelLoadSec:0)},n.onLevelLoaded=function(e,t){var n=this.hls.config,r=(r=t.stats.loading).end-r.start;Gn(r)&&(this.lastLevelLoadSec=r/1e3),t.details.live?this.bwEstimator.update(n.abrEwmaSlowLive,n.abrEwmaFastLive):this.bwEstimator.update(n.abrEwmaSlowVoD,n.abrEwmaFastVoD)},n.onFragLoaded=function(e,t){var n,r,i,a=t.frag,s=((t=t.part)||a).stats;a.type===Br&&this.bwEstimator.sampleTTFB(s.loading.first-s.loading.start),this.ignoreFragment(a)||(this.clearTimer(),a.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate&&(r=(t||a).duration,n=((i=this.hls.levels[a.level]).loaded?i.loaded.bytes:0)+s.loaded,r=(i.loaded?i.loaded.duration:0)+r,i.loaded={bytes:n,duration:r},i.realBitrate=Math.round(8*n/r)),a.bitrateTest?(i={stats:s,frag:a,part:t,id:a.type},this.onFragBuffered(zn.FRAG_BUFFERED,i),a.bitrateTest=!1):this.lastLoadedFragLevel=a.level)},n.onFragBuffered=function(e,t){var n,r=t.frag;(t=(null!=(t=t.part)&&t.stats.loaded?t:r).stats).aborted||this.ignoreFragment(r)||(n=t.parsing.end-t.loading.start-Math.min(t.loading.first-t.loading.start,this.bwEstimator.getEstimateTTFB()),this.bwEstimator.sample(n,t.loaded),t.bwEstimate=this.getBwEstimate(),r.bitrateTest?this.bitrateTestDelay=n/1e3:this.bitrateTestDelay=0)},n.ignoreFragment=function(e){return e.type!==Br||"initSegment"===e.sn},n.clearTimer=function(){-1<this.timer&&(self.clearInterval(this.timer),this.timer=-1)},n.getAutoLevelKey=function(){return this.getBwEstimate()+"_"+this.getStarvationDelay().toFixed(2)},n.getNextABRAutoLevel=function(){var e=this.fragCurrent,t=this.partCurrent,n=this.hls;if(n.levels.length<=1)return n.loadLevel;var r=n.maxAutoLevel,i=n.config,a=n.minAutoLevel,s=(t=t?t.duration:e?e.duration:0,e=this.getBwEstimate(),this.getStarvationDelay()),o=i.abrBandWidthFactor,u=i.abrBandWidthUpFactor;if(s&&0<=(c=this.findBestLevel(e,a,r,s,0,o,u)))return c;var l,c=t?Math.min(t,i.maxStarvationDelay):i.maxStarvationDelay;s||(l=this.bitrateTestDelay)&&(c=(t?Math.min(t,i.maxLoadingDelay):i.maxLoadingDelay)-l,this.info("bitrate test took "+Math.round(1e3*l)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*c)+" ms"),o=u=1),t=this.findBestLevel(e,a,r,s,c,o,u);return this.info((s?"rebuffering expected":"buffer is empty")+", optimal quality level "+t),-1<t?t:(i=n.levels[a],l=n.levels[n.loadLevel],(null==i?void 0:i.bitrate)<(null==l?void 0:l.bitrate)?a:n.loadLevel)},n.getStarvationDelay=function(){var e=this.hls,t=e.media;return t?(t=t&&0!==t.playbackRate?Math.abs(t.playbackRate):1,((e=e.mainForwardBufferInfo)?e.len:0)/t):1/0},n.getBwEstimate=function(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate},n.findBestLevel=function(e,t,n,r,i,a,s){var o=this,u=r+i,l=this.lastLoadedFragLevel,c=-1===l?this.hls.firstLevel:l,d=this.fragCurrent,h=this.partCurrent,f=(k=this.hls).levels,p=k.allAudioTracks,v=k.loadLevel,m=k.config;if(1===f.length)return 0;var g,y=f[c],_=!(null==y||null==(k=y.details)||!k.live),b=-1===v||-1===l,T="SDR",S=(null==y?void 0:y.frameRate)||0,E=m.audioPreference,k=m.videoPreference,w=this.audioTracksByGroup||(this.audioTracksByGroup=p.reduce((function(e,t){var n=e.groups[t.groupId],r=((n=n||(e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1})).tracks.push(t),t.channels||"2");return n.channels[r]=(n.channels[r]||0)+1,n.hasDefault=n.hasDefault||t.default,n.hasAutoSelect=n.hasAutoSelect||t.autoselect,n.hasDefault&&(e.hasDefaultAudio=!0),n.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e}),{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}}));if(b){if(-1!==this.firstSelection)return this.firstSelection;k=(p=ze(this.codecTiers||(this.codecTiers=(g=w,f.slice(t,n+1).reduce((function(e,t){var n,r,i;return t.codecSet&&(n=t.audioGroups,(r=e[t.codecSet])||(e[t.codecSet]=r={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!n,fragmentError:0}),r.minBitrate=Math.min(r.minBitrate,t.bitrate),i=Math.min(t.height,t.width),r.minHeight=Math.min(r.minHeight,i),r.minFramerate=Math.min(r.minFramerate,t.frameRate),r.maxScore=Math.max(r.maxScore,t.score),r.fragmentError+=t.fragmentError,r.videoRanges[t.videoRange]=(r.videoRanges[t.videoRange]||0)+1,n)&&n.forEach((function(e){var t;e&&(t=g.groups[e],r.hasDefaultAudio=r.hasDefaultAudio||g.hasDefaultAudio?t.hasDefault:t.hasAutoSelect||!g.hasDefaultAudio&&!g.hasAutoSelectAudio,Object.keys(t.channels).forEach((function(e){r.channels[e]=(r.channels[e]||0)+t.channels[e]})))})),e}),{}))),T,e,E,k)).codecSet;var C=p.videoRanges,A=p.minFramerate,L=p.minBitrate,R=p.preferHDR,x=k;T=R?C[C.length-1]:C[0],S=A;e=Math.max(e,L),this.log("picked start tier "+JSON.stringify(p))}else x=null==y?void 0:y.codecSet,T=null==y?void 0:y.videoRange;for(var I,O=h?h.duration:d?d.duration:0,D=this.bwEstimator.getEstimateTTFB()/1e3,P=[],M=n;t<=M;M--)if(0!==(I=function(){var t,d,p,g,k=f[M],C=c<M;return k?(!m.useMediaCapabilities||k.supportedResult||k.supportedPromise||("function"==typeof(null==(p=navigator.mediaCapabilities)?void 0:p.decodingInfo)&&function(e,t,n,r,i,a){var s=e.audioCodec?e.audioGroups:null,o=null==a?void 0:a.audioCodec,u=(a=null==a?void 0:a.channels)?parseInt(a):o?1/0:2;a=null;if(null!=s&&s.length)try{a=1===s.length&&s[0]?t.groups[s[0]].channels:s.reduce((function(e,n){if(n){var r=t.groups[n];if(!r)throw new Error("Audio track group "+n+" not found");Object.keys(r.channels).forEach((function(t){e[t]=(e[t]||0)+r.channels[t]}))}return e}),{2:0})}catch(e){return 1}return void 0!==e.videoCodec&&(1920<e.width&&1088<e.height||1920<e.height&&1088<e.width||e.frameRate>Math.max(r,30)||"SDR"!==e.videoRange&&e.videoRange!==n||e.bitrate>Math.max(i,8e6))||a&&Gn(u)&&Object.keys(a).some((function(e){return parseInt(e)>u}))}(k,w,T,S,e,E)?(k.supportedPromise=He(k,w,p),k.supportedPromise.then((function(e){var t,n;o.hls&&(k.supportedResult=e,n=(t=o.hls.levels).indexOf(k),e.error?o.warn('MediaCapabilities decodingInfo error: "'+e.error+'" for level '+n+" "+JSON.stringify(e)):e.supported||(o.warn("Unsupported MediaCapabilities decodingInfo result for level "+n+" "+JSON.stringify(e)),-1<n&&1<t.length&&(o.log("Removing unsupported level "+n),o.hls.removeLevel(n))))}))):k.supportedResult=ni),x&&k.codecSet!==x||T&&k.videoRange!==T||C&&S>k.frameRate||!C&&0<S&&S<k.frameRate||k.supportedResult&&(null==(p=k.supportedResult.decodingInfoResults)||!p[0].smooth)?(P.push(M),0):(p=k.details,t=(h?null==p?void 0:p.partTarget:null==p?void 0:p.averagetargetduration)||O,C=C?s*e:a*e,d=O&&2*O<=r&&0===i?f[M].averageBitrate:f[M].maxBitrate,p=o.getTimeToLoadFrag(D,C,d*t,void 0===p),d<=C&&(M===l||0===k.loadError&&0===k.fragmentError)&&(p<=D||!Gn(p)||_&&!o.bitrateTestDelay||p<u)?(g=o.forcedAutoLevel,M===v||-1!==g&&g===v||(P.length&&o.trace("Skipped level(s) "+P.join(",")+" of "+n+' max with CODECS and VIDEO-RANGE:"'+f[P[0]].codecs+'" '+f[P[0]].videoRange+'; not compatible with "'+y.codecs+'" '+T),o.info("switch candidate:"+c+"->"+M+" adjustedbw("+Math.round(C)+")-bitrate="+Math.round(C-d)+" ttfb:"+D.toFixed(1)+" avgDuration:"+t.toFixed(1)+" maxFetchDuration:"+u.toFixed(1)+" fetchDuration:"+p.toFixed(1)+" firstSelection:"+b+" codecSet:"+x+" videoRange:"+T+" hls.loadLevel:"+v)),b&&(o.firstSelection=M),{v:M}):void 0)):0}())&&I)return I.v;return-1},u(t,[{key:"firstAutoLevel",get:function(){var e=(t=this.hls).maxAutoLevel,t=t.minAutoLevel,n=this.getBwEstimate(),r=this.hls.config.maxStarvationDelay;return-1<(n=this.findBestLevel(n,t,e,0,r,1,1))||(r=this.hls.firstLevel,n=Math.min(Math.max(r,t),e),this.warn("Could not find best starting auto level. Defaulting to first in playlist "+r+" clamped to "+n)),n}},{key:"forcedAutoLevel",get:function(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}},{key:"nextAutoLevel",get:function(){var e=this.forcedAutoLevel,t=this.bwEstimator.canEstimate(),n=-1<this.lastLoadedFragLevel;return-1===e||t&&n&&this.nextAutoLevelKey!==this.getAutoLevelKey()?(t=t&&n?this.getNextABRAutoLevel():this.firstAutoLevel,-1!==e&&((n=this.hls.levels).length>Math.max(e,t)&&n[e].loadError<=n[t].loadError)?e:(this._nextAutoLevel=t,this.nextAutoLevelKey=this.getAutoLevelKey(),t)):e},set:function(e){var t=(n=this.hls).maxAutoLevel,n=n.minAutoLevel;e=Math.min(Math.max(e,n),t);this._nextAutoLevel!==e&&(this.nextAutoLevelKey="",this._nextAutoLevel=e)}}])}(v),ai=function(e){function t(t,n){return(t=e.call(this,t,n)||this)._boundTick=void 0,t._tickTimer=null,t._tickInterval=null,t._tickCallCount=0,t._boundTick=t.tick.bind(t),t}c(t,e);var n=t.prototype;return n.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},n.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},n.onHandlerDestroyed=function(){},n.hasInterval=function(){return!!this._tickInterval},n.hasNextTick=function(){return!!this._tickTimer},n.setInterval=function(e){return!this._tickInterval&&(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,e),!0)},n.clearInterval=function(){return!(!this._tickInterval||(self.clearInterval(this._tickInterval),this._tickInterval=null))},n.clearNextTick=function(){return!(!this._tickTimer||(self.clearTimeout(this._tickTimer),this._tickTimer=null))},n.tick=function(){1==++this._tickCallCount&&(this.doTick(),1<this._tickCallCount&&this.tickImmediate(),this._tickCallCount=0)},n.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},n.doTick=function(){},t}(v),si="NOT_LOADED",oi="APPENDING",ui="PARTIAL",li="OK",ci=function(){function e(e){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=e,this._registerListeners()}var t=e.prototype;return t._registerListeners=function(){var e=this.hls;e.on(zn.BUFFER_APPENDED,this.onBufferAppended,this),e.on(zn.FRAG_BUFFERED,this.onFragBuffered,this),e.on(zn.FRAG_LOADED,this.onFragLoaded,this)},t._unregisterListeners=function(){var e=this.hls;e.off(zn.BUFFER_APPENDED,this.onBufferAppended,this),e.off(zn.FRAG_BUFFERED,this.onFragBuffered,this),e.off(zn.FRAG_LOADED,this.onFragLoaded,this)},t.destroy=function(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null},t.getAppendedFrag=function(e,t){var n=this.activePartLists[t];if(n)for(var r=n.length;r--;){var i=n[r];if(!i)break;var a=i.end;if(i.start<=e&&null!==a&&e<=a)return i}return this.getBufferedFrag(e,t)},t.getBufferedFrag=function(e,t){return this.getFragAtPos(e,t,!0)},t.getFragAtPos=function(e,t,n){for(var r=this.fragments,i=Object.keys(r),a=i.length;a--;){var s=r[i[a]];if((null==s?void 0:s.body.type)===t&&(!n||s.buffered)&&((s=s.body).start<=e&&e<=s.end))return s}return null},t.detectEvictedFragments=function(e,t,n,r){var i=this,a=(this.timeRanges&&(this.timeRanges[e]=t),(null==r?void 0:r.fragment.sn)||-1);Object.keys(this.fragments).forEach((function(r){var s=i.fragments[r];!s||a>=s.body.sn||(s.buffered||s.loaded?(r=s.range[e])&&r.time.some((function(e){return(e=!i.isTimeBuffered(e.startPTS,e.endPTS,t))&&i.removeFragment(s.body),e})):s.body.type===n&&i.removeFragment(s.body))}))},t.detectPartialFragments=function(e){var t,n,r=this,i=this.timeRanges,a=e.frag,s=e.part;i&&"initSegment"!==a.sn&&(e=Je(a),!(t=this.fragments[e])||t.buffered&&a.gap||(n=!a.relurl,Object.keys(i).forEach((function(e){var o,u=a.elementaryStreams[e];u&&(o=i[e],u=n||!0===u.partial,t.range[e]=r.getBufferedTimes(a,s,u,o))})),t.loaded=null,Object.keys(t.range).length?(t.buffered=!0,(t.body.endList=a.endList||t.body.endList)&&(this.endListFragments[t.body.type]=t),Xe(t)||this.removeParts(a.sn-1,a.type)):this.removeFragment(t.body)))},t.removeParts=function(e,t){var n=this.activePartLists[t];n&&(this.activePartLists[t]=n.filter((function(t){return t.fragment.sn>=e})))},t.fragBuffered=function(e,t){var n=Je(e),r=this.fragments[n];!r&&t&&(r=this.fragments[n]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap)&&(this.hasGaps=!0),r&&(r.loaded=null,r.buffered=!0)},t.getBufferedTimes=function(e,t,n,r){for(var i={time:[],partial:n},a=e.start,s=e.end,o=e.minEndPTS||s,u=e.maxStartPTS||a,l=0;l<r.length;l++){var c=r.start(l)-this.bufferPadding,d=r.end(l)+this.bufferPadding;if(c<=u&&o<=d){i.time.push({startPTS:Math.max(a,r.start(l)),endPTS:Math.min(s,r.end(l))});break}if(a<d&&c<s){d=Math.max(a,r.start(l));var h=Math.min(s,r.end(l));d<h&&(i.partial=!0,i.time.push({startPTS:d,endPTS:h}))}else if(s<=c)break}return i},t.getPartialFragment=function(e){var t,n,r=null,i=0,a=this.bufferPadding,s=this.fragments;return Object.keys(s).forEach((function(o){(o=s[o])&&Xe(o)&&(t=o.body.start-a,n=o.body.end+a,t<=e)&&e<=n&&(t=Math.min(e-t,n-e),i<=t)&&(r=o.body,i=t)})),r},t.isEndListAppended=function(e){return void 0!==(e=this.endListFragments[e])&&(e.buffered||Xe(e))},t.getState=function(e){return e=Je(e),(e=this.fragments[e])?e.buffered?Xe(e)?ui:li:oi:si},t.isTimeBuffered=function(e,t,n){for(var r,i,a=0;a<n.length;a++){if(r=n.start(a)-this.bufferPadding,i=n.end(a)+this.bufferPadding,r<=e&&t<=i)return!0;if(t<=r)return!1}return!1},t.onFragLoaded=function(e,t){var n,r=t.frag,i=t.part;"initSegment"===r.sn||r.bitrateTest||(n=Je(r),this.fragments[n]={body:r,appendedPTS:null,loaded:i?null:t,buffered:!1,range:Object.create(null)})},t.onBufferAppended=function(e,t){var n,r=t.frag,i=t.part,a=t.timeRanges;t=t.type;"initSegment"!==r.sn&&(r=r.type,i&&((n=this.activePartLists[r])||(this.activePartLists[r]=n=[]),n.push(i)),n=(this.timeRanges=a)[t],this.detectEvictedFragments(t,n,r,i))},t.onFragBuffered=function(e,t){this.detectPartialFragments(t)},t.hasFragment=function(e){return e=Je(e),!!this.fragments[e]},t.hasParts=function(e){return!(null==(e=this.activePartLists[e])||!e.length)},t.removeFragmentsInRange=function(e,t,n,r,i){var a=this;r&&!this.hasGaps||Object.keys(this.fragments).forEach((function(s){var o;!(s=a.fragments[s])||(o=s.body).type!==n||r&&!o.gap||o.start<t&&o.end>e&&(s.buffered||i)&&a.removeFragment(o)}))},t.removeFragment=function(e){var t,n=Je(e),r=(e.stats.loaded=0,e.clearElementaryStreamInfo(),this.activePartLists[e.type]);r&&(t=e.sn,this.activePartLists[e.type]=r.filter((function(e){return e.fragment.sn!==t}))),delete this.fragments[n],e.endList&&delete this.endListFragments[e.type]},t.removeAllFragments=function(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1},e}(),di={length:0,start:function(){return 0},end:function(){return 0}},hi=function(){function e(){}return e.isBuffered=function(t,n){if(t)for(var r=e.getBuffered(t),i=r.length;i--;)if(n>=r.start(i)&&n<=r.end(i))return!0;return!1},e.bufferInfo=function(t,n,r){if(t){var i=e.getBuffered(t);if(i.length){for(var a=[],s=0;s<i.length;s++)a.push({start:i.start(s),end:i.end(s)});return e.bufferedInfo(a,n,r)}}return{len:0,start:n,end:n,nextStart:void 0}},e.bufferedInfo=function(e,t,n){t=Math.max(0,t),e.sort((function(e,t){return e.start-t.start||t.end-e.end}));var r=[];if(n)for(var i=0;i<e.length;i++){var a,s=r.length;s&&(a=r[s-1].end,e[i].start-a<n)?e[i].end>a&&(r[s-1].end=e[i].end):r.push(e[i])}else r=e;for(var o,u=0,l=t,c=t,d=0;d<r.length;d++){var h=r[d].start,f=r[d].end;if(h<=t+n&&t<f)l=h,u=(c=f)-t;else if(t+n<h){o=h;break}}return{len:u,start:l||0,end:c||0,nextStart:o}},e.getBuffered=function(e){try{return e.buffered||di}catch(e){return Qn.log("failed to get media.buffered",e),di}},e}(),fi=Math.pow(2,17),pi=function(){function e(e){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=e}var t=e.prototype;return t.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},t.abort=function(){this.loader&&this.loader.abort()},t.load=function(e,t){var r=this,i=e.url;if(!i)return Promise.reject(new vi({type:Wn.NETWORK_ERROR,details:Kn.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:new Error("Fragment does not have a "+(i?"part list":"url")),networkDetails:null}));this.abort();var a=this.config,s=a.fLoader,o=a.loader;return new Promise((function(u,l){if(r.loader&&r.loader.destroy(),e.gap){if(e.tagList.some((function(e){return"GAP"===e[0]})))return void l(it(e));e.gap=!1}var c=r.loader=e.loader=new(s||o)(a),d=rt(e),h=Fe(a.fragLoadPolicy.default),f={loadPolicy:h,timeout:h.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:"initSegment"===e.sn?1/0:fi};e.stats=c.stats,c.load(d,f,{onSuccess:function(t,n,i,a){r.resetLoader(e,c),t=t.data,i.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(t.slice(0,16)),t=t.slice(16)),u({frag:e,part:null,payload:t,networkDetails:a})},onError:function(t,a,s,o){r.resetLoader(e,c),l(new vi({type:Wn.NETWORK_ERROR,details:Kn.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:n({url:i,data:void 0},t),error:new Error("HTTP Error "+t.code+" "+t.text),networkDetails:s,stats:o}))},onAbort:function(t,n,i){r.resetLoader(e,c),l(new vi({type:Wn.NETWORK_ERROR,details:Kn.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:i,stats:t}))},onTimeout:function(t,n,i){r.resetLoader(e,c),l(new vi({type:Wn.NETWORK_ERROR,details:Kn.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error("Timeout after "+f.timeout+"ms"),networkDetails:i,stats:t}))},onProgress:function(n,r,i,a){t&&t({frag:e,part:null,payload:i,networkDetails:a})}})}))},t.loadPart=function(e,t,r){var i=this,a=(this.abort(),this.config),s=a.fLoader,o=a.loader;return new Promise((function(u,l){var c,d,h,f;i.loader&&i.loader.destroy(),e.gap||t.gap?l(it(e,t)):(c=i.loader=e.loader=new(s||o)(a),d=rt(e,t),h=Fe(a.fragLoadPolicy.default),f={loadPolicy:h,timeout:h.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:fi},t.stats=c.stats,c.load(d,f,{onSuccess:function(n,a,s,o){i.resetLoader(e,c),i.updateStatsFromPart(e,t),n={frag:e,part:t,payload:n.data,networkDetails:o},r(n),u(n)},onError:function(r,a,s,o){i.resetLoader(e,c),l(new vi({type:Wn.NETWORK_ERROR,details:Kn.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:n({url:d.url,data:void 0},r),error:new Error("HTTP Error "+r.code+" "+r.text),networkDetails:s,stats:o}))},onAbort:function(n,r,a){e.stats.aborted=t.stats.aborted,i.resetLoader(e,c),l(new vi({type:Wn.NETWORK_ERROR,details:Kn.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:a,stats:n}))},onTimeout:function(n,r,a){i.resetLoader(e,c),l(new vi({type:Wn.NETWORK_ERROR,details:Kn.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error("Timeout after "+f.timeout+"ms"),networkDetails:a,stats:n}))}}))}))},t.updateStatsFromPart=function(e,t){var n=e.stats,r=t.stats,i=r.total;n.loaded+=r.loaded,i?(i=((e=Math.round(e.duration/t.duration))-(t=Math.min(Math.round(n.loaded/i),e)))*Math.round(n.loaded/t),n.total=n.loaded+i):n.total=Math.max(n.loaded,n.total),e=n.loading,t=r.loading;e.start?e.first+=t.first-t.start:(e.start=t.start,e.first=t.first),e.end=t.end},t.resetLoader=function(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()},e}(),vi=function(e){function t(t){var n=e.call(this,t.error.message)||this;return n.data=void 0,n.data=t,n}return c(t,e),t}(f(Error)),mi=function(){function e(e,t,n){this.subtle=void 0,this.aesIV=void 0,this.aesMode=void 0,this.subtle=e,this.aesIV=t,this.aesMode=n}return e.prototype.decrypt=function(e,t){switch(this.aesMode){case sr:return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e);case or:return this.subtle.decrypt({name:"AES-CTR",counter:this.aesIV,length:64},t,e);default:throw new Error("[AESCrypto] invalid aes mode "+this.aesMode)}},e}(),gi=function(){function e(e,t,n){this.subtle=void 0,this.key=void 0,this.aesMode=void 0,this.subtle=e,this.key=t,this.aesMode=n}return e.prototype.expandKey=function(){var e=function(e){switch(e){case sr:return"AES-CBC";case or:return"AES-CTR";default:throw new Error("[FastAESKey] invalid aes mode "+e)}}(this.aesMode);return this.subtle.importKey("raw",this.key,{name:e},!1,["encrypt","decrypt"])},e}(),yi=function(){function e(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var t=e.prototype;return t.uint8ArrayToUint32Array_=function(e){for(var t=new DataView(e),n=new Uint32Array(4),r=0;r<4;r++)n[r]=t.getUint32(4*r);return n},t.initTable=function(){var e,t=this.sBox,n=this.invSBox,r=(e=this.subMix)[0],i=e[1],a=e[2],s=e[3],o=(e=this.invSubMix)[0],u=e[1],l=e[2],c=e[3],d=new Uint32Array(256),h=0,f=0,p=0;for(p=0;p<256;p++)d[p]=p<128?p<<1:p<<1^283;for(p=0;p<256;p++){var v=f^f<<1^f<<2^f<<3^f<<4,m=(t[h]=v=v>>>8^255&v^99,d[n[v]=h]),g=d[m],y=d[g],_=257*d[v]^16843008*v;r[h]=_<<24|_>>>8,i[h]=_<<16|_>>>16,a[h]=_<<8|_>>>24,s[h]=_,o[v]=(_=16843009*y^65537*g^257*m^16843008*h)<<24|_>>>8,u[v]=_<<16|_>>>16,l[v]=_<<8|_>>>24,c[v]=_,h?(h=m^d[d[d[y^m]]],f^=d[d[f]]):h=f=1}},t.expandKey=function(e){for(var t=this.uint8ArrayToUint32Array_(e),n=!0,r=0;r<t.length&&n;)n=t[r]===this.key[r],r++;if(!n){this.key=t;var i=this.keySize=t.length;if(4!==i&&6!==i&&8!==i)throw new Error("Invalid aes key size="+i);for(var a,s,o,u=this.ksRows=4*(i+6+1),l=this.keySchedule=new Uint32Array(u),c=this.invKeySchedule=new Uint32Array(u),d=this.sBox,h=this.rcon,f=(e=this.invSubMix)[0],p=e[1],v=e[2],m=e[3],g=0;g<u;g++)g<i?s=l[g]=t[g]:(o=s,g%i==0?(o=d[(o=o<<8|o>>>24)>>>24]<<24|d[o>>>16&255]<<16|d[o>>>8&255]<<8|d[255&o],o^=h[g/i|0]<<24):6<i&&g%i==4&&(o=d[o>>>24]<<24|d[o>>>16&255]<<16|d[o>>>8&255]<<8|d[255&o]),l[g]=s=(l[g-i]^o)>>>0);for(a=0;a<u;a++)g=u-a,o=3&a?l[g]:l[g-4],c[a]=a<4||g<=4?o:f[d[o>>>24]]^p[d[o>>>16&255]]^v[d[o>>>8&255]]^m[d[255&o]],c[a]=c[a]>>>0}},t.networkToHostOrderSwap=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},t.decrypt=function(e,t,n){for(var r,i,a,s,o,u,l,c,d,h,f,p,v,m,g,y=this.keySize+6,_=this.invKeySchedule,b=this.invSBox,T=(g=this.invSubMix)[0],S=g[1],E=g[2],k=g[3],w=(g=this.uint8ArrayToUint32Array_(n))[0],C=g[1],A=g[2],L=g[3],R=new Int32Array(e),x=new Int32Array(R.length),I=this.networkToHostOrderSwap;t<R.length;){for(d=I(R[t]),h=I(R[t+1]),f=I(R[t+2]),p=I(R[t+3]),o=d^_[0],u=p^_[1],l=f^_[2],c=h^_[3],v=4,m=1;m<y;m++)r=T[o>>>24]^S[u>>16&255]^E[l>>8&255]^k[255&c]^_[v],i=T[u>>>24]^S[l>>16&255]^E[c>>8&255]^k[255&o]^_[v+1],a=T[l>>>24]^S[c>>16&255]^E[o>>8&255]^k[255&u]^_[v+2],s=T[c>>>24]^S[o>>16&255]^E[u>>8&255]^k[255&l]^_[v+3],o=r,u=i,l=a,c=s,v+=4;r=b[o>>>24]<<24^b[u>>16&255]<<16^b[l>>8&255]<<8^b[255&c]^_[v],i=b[u>>>24]<<24^b[l>>16&255]<<16^b[c>>8&255]<<8^b[255&o]^_[v+1],a=b[l>>>24]<<24^b[c>>16&255]<<16^b[o>>8&255]<<8^b[255&u]^_[v+2],s=b[c>>>24]<<24^b[o>>16&255]<<16^b[u>>8&255]<<8^b[255&l]^_[v+3],x[t]=I(r^w),x[t+1]=I(s^C),x[t+2]=I(a^A),x[t+3]=I(i^L),w=d,C=h,A=f,L=p,t+=4}return x.buffer},e}(),_i=function(){function e(e,t){if(t=void 0===(t=(void 0===t?{}:t).removePKCS7Padding)||t,this.logEnabled=!0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.useSoftware=void 0,this.enableSoftwareAES=void 0,this.enableSoftwareAES=e.enableSoftwareAES,this.removePKCS7Padding=t)try{var n=self.crypto;n&&(this.subtle=n.subtle||n.webkitSubtle)}catch(e){}this.useSoftware=null===this.subtle}var t=e.prototype;return t.destroy=function(){this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null},t.isSync=function(){return this.useSoftware},t.flush=function(){var e,t,n=this.currentResult,r=this.remainderData;return!n||r?(this.reset(),null):(r=new Uint8Array(n),this.reset(),this.removePKCS7Padding?(t=(e=(n=r).byteLength)&&new DataView(n.buffer).getUint8(e-1))?L(n,0,e-t):n:r)},t.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},t.decrypt=function(e,t,n,r){var i=this;return this.useSoftware?new Promise((function(a,s){i.softwareDecrypt(new Uint8Array(e),t,n,r);var o=i.flush();o?a(o.buffer):s(new Error("[softwareDecrypt] Failed to decrypt data"))})):this.webCryptoDecrypt(new Uint8Array(e),t,n,r)},t.softwareDecrypt=function(e,t,n,r){var i=this.currentIV,a=this.currentResult,s=this.remainderData;return r!==sr||16!==t.byteLength?(Qn.warn("SoftwareDecrypt: can only handle AES-128-CBC"),null):(this.logOnce("JS AES decrypt"),s&&(e=Y(s,e),this.remainderData=null),(r=this.getValidChunk(e)).length?(i&&(n=i),(s=(s=this.softwareDecrypter)||(this.softwareDecrypter=new yi)).expandKey(t),e=a,this.currentResult=s.decrypt(r.buffer,0,n),this.currentIV=L(r,-16).buffer,e||null):null)},t.webCryptoDecrypt=function(e,t,n,r){var i=this,a=this.subtle;return this.key===t&&this.fastAesKey||(this.key=t,this.fastAesKey=new gi(a,t,r)),this.fastAesKey.expandKey().then((function(t){return a?(i.logOnce("WebCrypto AES decrypt"),new mi(a,new Uint8Array(n),r).decrypt(e.buffer,t)):Promise.reject(new Error("web crypto not initialized"))})).catch((function(a){return Qn.warn("[decrypter]: WebCrypto Error, disable WebCrypto API, "+a.name+": "+a.message),i.onWebCryptoError(e,t,n,r)}))},t.onWebCryptoError=function(e,t,n,r){var i=this.enableSoftwareAES;if(i&&(this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,n,r),e=this.flush()))return e.buffer;throw new Error("WebCrypto"+(i?" and softwareDecrypt":"")+": failed to decrypt data")},t.getValidChunk=function(e){var t=e,n=e.length-e.length%16;return n!==e.length&&(t=L(e,0,n),this.remainderData=L(e,n)),t},t.logOnce=function(e){this.logEnabled&&(Qn.log("[decrypter]: "+e),this.logEnabled=!1)},e}(),bi="STOPPED",Ti="IDLE",Si="KEY_LOADING",Ei="FRAG_LOADING",ki="FRAG_LOADING_WAITING_RETRY",wi="WAITING_TRACK",Ci="PARSING",Ai="PARSED",Li="ENDED",Ri="ERROR",xi="WAITING_INIT_PTS",Ii="WAITING_LEVEL",Oi=(ai=function(e){function t(t,n,r,i,a){var s=e.call(this,i,t.logger)||this;return s.hls=void 0,s.fragPrevious=null,s.fragCurrent=null,s.fragmentTracker=void 0,s.transmuxer=null,s._state=bi,s.playlistType=void 0,s.media=null,s.mediaBuffer=null,s.config=void 0,s.bitrateTest=!1,s.lastCurrentTime=0,s.nextLoadPosition=0,s.startPosition=0,s.startTimeOffset=null,s.loadedmetadata=!1,s.retryDate=0,s.levels=null,s.fragmentLoader=void 0,s.keyLoader=void 0,s.levelLastLoaded=null,s.startFragRequested=!1,s.decrypter=void 0,s.initPTS=[],s.buffering=!0,s.loadingParts=!1,s.onMediaSeeking=function(){var e=(i=s).config,t=i.fragCurrent,n=i.media,r=i.mediaBuffer,i=i.state,a=n?n.currentTime:0;r=hi.bufferInfo(r||n,a,e.maxBufferHole);s.log("media seeking to "+(Gn(a)?a.toFixed(3):a)+", state: "+i),s.state===Li?s.resetLoadingState():t&&(i=e.maxFragLookUpTolerance,e=t.start-i,i=t.start+t.duration+i,!r.len||i<r.start||e>r.end)&&(i=i<a,a<e||i)&&(i&&t.loader&&(s.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),t.abortRequests(),s.resetLoadingState()),s.fragPrevious=null),n&&(s.fragmentTracker.removeFragmentsInRange(a,1/0,s.playlistType,!0),s.lastCurrentTime=a,!s.loadingParts)&&(e=Math.max(r.end,a),i=s.shouldLoadParts(s.getLevelDetails(),e))&&(s.log("LL-Part loading ON after seeking to "+a.toFixed(2)+" with buffer @"+e.toFixed(2)),s.loadingParts=i),s.loadedmetadata||r.len||(s.nextLoadPosition=s.startPosition=a),s.tickImmediate()},s.onMediaEnded=function(){s.startPosition=s.lastCurrentTime=0,s.playlistType===Br&&s.hls.trigger(zn.MEDIA_ENDED,{stalled:!1})},s.playlistType=a,s.hls=t,s.fragmentLoader=new pi(t.config),s.keyLoader=r,s.fragmentTracker=n,s.config=t.config,s.decrypter=new _i(t.config),s}c(t,e);var n=t.prototype;return n.registerListeners=function(){var e=this.hls;e.on(zn.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(zn.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(zn.MANIFEST_LOADING,this.onManifestLoading,this),e.on(zn.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(zn.ERROR,this.onError,this)},n.unregisterListeners=function(){var e=this.hls;e.off(zn.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(zn.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(zn.MANIFEST_LOADING,this.onManifestLoading,this),e.off(zn.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(zn.ERROR,this.onError,this)},n.doTick=function(){this.onTickEnd()},n.onTickEnd=function(){},n.startLoad=function(e){},n.stopLoad=function(){this.fragmentLoader.abort(),this.keyLoader.abort(this.playlistType);var e=this.fragCurrent;null!=e&&e.loader&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=bi},n.pauseBuffering=function(){this.buffering=!1},n.resumeBuffering=function(){this.buffering=!0},n._streamEnded=function(e,t){return!(t.live||e.nextStart||!e.end||!this.media)&&(null!=(e=t.partList)&&e.length?(e=e[e.length-1],hi.isBuffered(this.media,e.start+e.duration/2)):(e=t.fragments[t.fragments.length-1].type,this.fragmentTracker.isEndListAppended(e)))},n.getLevelDetails=function(){var e;return this.levels&&null!==this.levelLastLoaded&&null!=(e=this.levelLastLoaded)?e.details:void 0},n.onMediaAttached=function(e,t){(t=this.media=this.mediaBuffer=t.media).addEventListener("seeking",this.onMediaSeeking),t.addEventListener("ended",this.onMediaEnded),t=this.config,this.levels&&t.autoStartLoad&&this.state===bi&&this.startLoad(t.startPosition)},n.onMediaDetaching=function(){var e=this.media;null!=e&&e.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),e&&(e.removeEventListener("seeking",this.onMediaSeeking),e.removeEventListener("ended",this.onMediaEnded)),this.keyLoader&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},n.onManifestLoading=function(){},n.onError=function(e,t){},n.onManifestLoaded=function(e,t){this.startTimeOffset=t.startTimeOffset,this.initPTS=[]},n.onHandlerDestroying=function(){this.stopLoad(),e.prototype.onHandlerDestroying.call(this),this.hls=this.onMediaSeeking=this.onMediaEnded=null},n.onHandlerDestroyed=function(){this.state=bi,this.fragmentLoader&&this.fragmentLoader.destroy(),this.keyLoader&&this.keyLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.keyLoader=this.fragmentLoader=this.fragmentTracker=null,e.prototype.onHandlerDestroyed.call(this)},n.loadFragment=function(e,t,n){this._loadFragForPlayback(e,t,n)},n._loadFragForPlayback=function(e,t,n){var r=this;this._doFragLoad(e,t,n,(function(t){r.fragContextChanged(e)?(r.warn("Fragment "+e.sn+(t.part?" p: "+t.part.index:"")+" of level "+e.level+" was dropped during download."),r.fragmentTracker.removeFragment(e)):(e.stats.chunkCount++,r._handleFragmentLoadProgress(t))})).then((function(t){var n;t&&(n=r.state,r.fragContextChanged(e)?n!==Ei&&(r.fragCurrent||n!==Ci)||(r.fragmentTracker.removeFragment(e),r.state=Ti):("payload"in t&&(r.log("Loaded fragment "+e.sn+" of level "+e.level),r.hls.trigger(zn.FRAG_LOADED,t)),r._handleFragmentLoadComplete(t)))})).catch((function(t){r.state!==bi&&r.state!==Ri&&(r.warn(t),r.resetFragmentLoading(e))}))},n.clearTrackerIfNeeded=function(e){var t,n=this.fragmentTracker;n.getState(e)===oi?(t=e.type,t=this.getFwdBufferInfo(this.mediaBuffer,t),t=Math.max(e.duration,t?t.len:this.config.maxBufferLength),this.reduceMaxBufferLength(t)&&n.removeFragment(e)):0===(null==(t=this.mediaBuffer)?void 0:t.buffered.length)?n.removeAllFragments():n.hasParts(e.type)&&(n.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),n.getState(e)===ui)&&n.removeFragment(e)},n.checkLiveUpdate=function(e){var t;e.updated&&!e.live&&(t=e.fragments[e.fragments.length-1],this.fragmentTracker.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type})),e.fragments[0]||(e.deltaUpdateFailed=!0)},n.flushMainBuffer=function(e,t,n){void 0===n&&(n=null),e-t&&this.hls.trigger(zn.BUFFER_FLUSHING,{startOffset:e,endOffset:t,type:n})},n._loadInitSegment=function(e,t){var n=this;this._doFragLoad(e,t).then((function(t){if(t&&!n.fragContextChanged(e)&&n.levels)return t;throw new Error("init load aborted")})).then((function(t){var r,i=n.hls,a=t.payload,s=e.decryptdata;return a&&0<a.byteLength&&null!=s&&s.key&&s.iv&&E(s.method)?(r=self.performance.now(),n.decrypter.decrypt(new Uint8Array(a),s.key.buffer,s.iv.buffer,k(s.method)).catch((function(t){throw i.trigger(zn.ERROR,{type:Wn.MEDIA_ERROR,details:Kn.FRAG_DECRYPT_ERROR,fatal:!1,error:t,reason:t.message,frag:e}),t})).then((function(a){var s=self.performance.now();return i.trigger(zn.FRAG_DECRYPTED,{frag:e,payload:a,stats:{tstart:r,tdecrypt:s}}),t.payload=a,n.completeInitSegmentLoad(t)}))):n.completeInitSegmentLoad(t)})).catch((function(t){n.state!==bi&&n.state!==Ri&&(n.warn(t),n.resetFragmentLoading(e))}))},n.completeInitSegmentLoad=function(e){if(!this.levels)throw new Error("init load aborted, missing levels");var t=e.frag.stats;this.state!==bi&&(this.state=Ti),e.frag.data=new Uint8Array(e.payload),t.parsing.start=t.buffering.start=self.performance.now(),t.parsing.end=t.buffering.end=self.performance.now(),this.tick()},n.fragContextChanged=function(e){var t=this.fragCurrent;return!e||!t||e.sn!==t.sn||e.level!==t.level},n.fragBufferedComplete=function(e,t){var n=this.mediaBuffer||this.media;if(this.log("Buffered "+e.type+" sn: "+e.sn+(t?" part: "+t.index:"")+" of "+(this.playlistType===Br?"level":"track")+" "+e.level+" (frag:["+(null!=(t=e.startPTS)?t:NaN).toFixed(3)+"-"+(null!=(t=e.endPTS)?t:NaN).toFixed(3)+"] > buffer:"+(n?function(e){for(var t="",n=e.length,r=0;r<n;r++)t+="["+e.start(r).toFixed(3)+"-"+e.end(r).toFixed(3)+"]";return t}(hi.getBuffered(n)):"(detached)")+")"),"initSegment"!==e.sn){if(e.type!==Nr){var r=e.elementaryStreams;if(!Object.keys(r).some((function(e){return!!r[e]})))return void(this.state=Ti)}null!=(t=null==(t=this.levels)?void 0:t[e.level])&&t.fragmentError&&(this.log("Resetting level fragment error count of "+t.fragmentError+" on frag buffered"),t.fragmentError=0)}this.state=Ti,n&&(!this.loadedmetadata&&e.type==Br&&n.buffered.length&&(null==(t=this.fragCurrent)?void 0:t.sn)===(null==(e=this.fragPrevious)?void 0:e.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())},n.seekToStartPos=function(){},n._handleFragmentLoadComplete=function(e){var t,n,r=this.transmuxer;r&&(n=e.frag,t=e.part,e=!(e=e.partsLoaded)||0===e.length||e.some((function(e){return!e})),n=new Qe(n.level,n.sn,n.stats.chunkCount+1,0,t?t.index:-1,!e),r.flush(n))},n._handleFragmentLoadProgress=function(e){},n._doFragLoad=function(e,t,n,r){var i=this,a=(void 0===n&&(n=null),null==t?void 0:t.details);if(!this.levels||!a)throw new Error("frag load aborted, missing level"+(a?"":" detail")+"s");var s=null,o=(!e.encrypted||null!=(o=e.decryptdata)&&o.key?!e.encrypted&&a.encryptedFragments.length&&this.keyLoader.loadClear(e,a.encryptedFragments):(this.log("Loading key for "+e.sn+" of ["+a.startSN+"-"+a.endSN+"], "+(this.playlistType===Br?"level":"track")+" "+e.level),this.state=Si,this.fragCurrent=e,s=this.keyLoader.load(e).then((function(e){if(!i.fragContextChanged(e.frag))return i.hls.trigger(zn.KEY_LOADED,e),i.state===Si&&(i.state=Ti),e})),this.hls.trigger(zn.KEY_LOADING,{frag:e}),null===this.fragCurrent&&(s=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))),this.fragPrevious);if("initSegment"===e.sn||o&&e.sn===o.sn||(c=this.shouldLoadParts(t.details,e.end))!==this.loadingParts&&(this.log("LL-Part loading "+(c?"ON":"OFF")+" loading sn "+(null==o?void 0:o.sn)+"->"+e.sn),this.loadingParts=c),n=Math.max(e.start,n||0),this.loadingParts&&"initSegment"!==e.sn&&(o=a.partList)&&r){var u;if(n>e.end&&a.fragmentHint&&(e=a.fragmentHint),-1<(c=this.getNextPart(o,e,n)))return u=o[c],this.log("Loading part sn: "+e.sn+" p: "+u.index+" cc: "+e.cc+" of playlist ["+a.startSN+"-"+a.endSN+"] parts [0-"+c+"-"+(o.length-1)+"] "+(this.playlistType===Br?"level":"track")+": "+e.level+", target: "+parseFloat(n.toFixed(3))),this.nextLoadPosition=u.start+u.duration,this.state=Ei,c=s?s.then((function(n){return!n||i.fragContextChanged(n.frag)?null:i.doFragPartsLoad(e,u,t,r)})).catch((function(e){return i.handleFragLoadError(e)})):this.doFragPartsLoad(e,u,t,r).catch((function(e){return i.handleFragLoadError(e)})),this.hls.trigger(zn.FRAG_LOADING,{frag:e,part:u,targetBufferTime:n}),null===this.fragCurrent?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):c;if(!e.url||this.loadedEndOfParts(o,n))return Promise.resolve(null)}if("initSegment"!==e.sn&&this.loadingParts)this.log("LL-Part loading OFF after next part miss @"+n.toFixed(2)),this.loadingParts=!1;else if(!e.url)return Promise.resolve(null);this.log("Loading fragment "+e.sn+" cc: "+e.cc+" "+(a?"of ["+a.startSN+"-"+a.endSN+"] ":"")+(this.playlistType===Br?"level":"track")+": "+e.level+", target: "+parseFloat(n.toFixed(3))),Gn(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=Ei;var l=this.config.progressive,c=l&&s?s.then((function(t){return!t||i.fragContextChanged(null==t?void 0:t.frag)?null:i.fragmentLoader.load(e,r)})).catch((function(e){return i.handleFragLoadError(e)})):Promise.all([this.fragmentLoader.load(e,l?r:void 0),s]).then((function(e){return e=e[0],!l&&e&&r&&r(e),e})).catch((function(e){return i.handleFragLoadError(e)}));return this.hls.trigger(zn.FRAG_LOADING,{frag:e,targetBufferTime:n}),null===this.fragCurrent?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):c},n.doFragPartsLoad=function(e,t,n,r){var i=this;return new Promise((function(a,s){var o,u=[],l=null==(o=n.details)?void 0:o.partList;!function t(o){i.fragmentLoader.loadPart(e,o,r).then((function(r){var s=(u[o.index]=r).part;if(!(r=(i.hls.trigger(zn.FRAG_LOADED,r),De(n,e.sn,o.index+1)||Pe(l,e.sn,o.index+1))))return a({frag:e,part:s,partsLoaded:u});t(r)})).catch(s)}(t)}))},n.handleFragLoadError=function(e){var t;return"data"in e?(t=e.data,e.data&&t.details===Kn.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(zn.ERROR,t)):this.hls.trigger(zn.ERROR,{type:Wn.OTHER_ERROR,details:Kn.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0}),null},n._handleTransmuxerFlush=function(e){var t,n,r,i=this.getCurrentContext(e);i&&this.state===Ci?(t=i.frag,n=i.part,i=i.level,r=self.performance.now(),t.stats.parsing.end=r,n&&(n.stats.parsing.end=r),"initSegment"!==t.sn&&(r=(r=this.getLevelDetails())&&t.sn>r.endSN||this.shouldLoadParts(r,t.end))!==this.loadingParts&&(this.log("LL-Part loading "+(r?"ON":"OFF")+" after parsing segment ending @"+t.end.toFixed(2)),this.loadingParts=r),this.updateLevelTiming(t,n,i,e.partial)):this.fragCurrent||this.state===bi||this.state===Ri||(this.state=Ti)},n.shouldLoadParts=function(e,t){if(this.config.lowLatencyMode){if(!e)return this.loadingParts;if(null!=e&&e.partList){var n=e.partList[0];if(n.end+((null==(e=e.fragmentHint)?void 0:e.duration)||0)<=t&&this.lastCurrentTime>n.start-n.fragment.duration)return!0}}return!1},n.getCurrentContext=function(e){var t,n,r,i,a=this.levels,s=this.fragCurrent,o=e.level,u=e.sn;e=e.part;return null!=a&&a[o]?(a=a[o],(i=(e=-1<e?De(a,u,e):null)?e.fragment:(n=u,r=s,null!=(t=a)&&t.details?(i=(t=t.details).fragments[n-t.startSN])||((i=t.fragmentHint)&&i.sn===n?i:n<t.startSN&&r&&r.sn===n?r:null):null))?(s&&s!==i&&(i.stats=s.stats),{frag:i,part:e,level:a}):null):(this.warn("Levels object was unset while buffering fragment "+u+" of level "+o+". The current chunk will not be buffered."),null)},n.bufferFragmentData=function(e,t,n,r,i){var a,s,o;e&&this.state===Ci&&(o=e.data1,a=e.data2,null!=(s=(s=o)&&a?Y(o,a):s))&&s.length&&(o={type:e.type,frag:t,part:n,chunkMeta:r,parent:t.type,data:s},this.hls.trigger(zn.BUFFER_APPENDING,o),e.dropped)&&e.independent&&!n&&!i&&this.flushBufferGap(t)},n.flushBufferGap=function(e){var t,n,r=this.media;r&&(hi.isBuffered(r,r.currentTime)?(t=r.currentTime,r=hi.bufferInfo(r,t,0),n=e.duration,n=Math.min(2*this.config.maxFragLookUpTolerance,.25*n),r=Math.max(Math.min(e.start-n,r.end-n),t+n),e.start-r>n&&this.flushMainBuffer(r,e.start)):this.flushMainBuffer(0,e.start))},n.getFwdBufferInfo=function(e,t){var n=this.getLoadPosition();return Gn(n)?this.getFwdBufferInfoAtPos(e,n,t):null},n.getFwdBufferInfoAtPos=function(e,t,n){var r=this.config.maxBufferHole,i=hi.bufferInfo(e,t,r);return 0===i.len&&void 0!==i.nextStart&&(n=this.fragmentTracker.getBufferedFrag(t,n))&&(i.nextStart<=n.end||n.gap)?hi.bufferInfo(e,t,Math.max(i.nextStart,r)):i},n.getMaxBufferLength=function(e){var t=this.config;e=e?Math.max(8*t.maxBufferSize/e,t.maxBufferLength):t.maxBufferLength;return Math.min(e,t.maxMaxBufferLength)},n.reduceMaxBufferLength=function(e){var t=this.config;e=e||t.maxBufferLength;return t.maxMaxBufferLength>=e&&(t.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+t.maxMaxBufferLength+"s"),!0)},n.getAppendedFrag=function(e,t){return(e=this.fragmentTracker.getAppendedFrag(e,Br))&&"fragment"in e?e.fragment:e},n.getNextFragment=function(e,t){var n=t.fragments,r=n.length;if(!r)return null;var i=this.config,a=n[0].start,s=i.lowLatencyMode&&!!t.partList,o=null;if(t.live){if(r<(i=i.initialLiveManifestSize))return this.warn("Not enough fragments to start playback (have: "+r+", need: "+i+")"),null;(!t.PTSKnown&&!this.startFragRequested&&-1===this.startPosition||e<a)&&(s&&!this.loadingParts&&(this.log("LL-Part loading ON for initial live fragment"),this.loadingParts=!0),o=this.getInitialLiveFragment(t,n),this.startPosition=this.nextLoadPosition=o?this.hls.liveSyncPosition||o.start:e)}else e<=a&&(o=n[0]);return o||(r=this.loadingParts?t.partEnd:t.fragmentEnd,o=this.getFragmentAtPosition(e,r,t)),this.mapToInitFragWhenRequired(o)},n.isLoopLoading=function(e,t){var n=this.fragmentTracker.getState(e);return(n===li||n===ui&&!!e.gap)&&this.nextLoadPosition>t},n.getNextFragmentLoopLoading=function(e,t,n,r,i){var a=e.gap;return null===(t=this.getNextFragment(this.nextLoadPosition,t))?t:(e=t,a&&e&&!e.gap&&n.nextStart&&null!==(t=this.getFwdBufferInfoAtPos(this.mediaBuffer||this.media,n.nextStart,r))&&n.len+t.len>=i?(this.log('buffer full after gaps in "'+r+'" playlist starting at sn: '+e.sn),null):e)},n.mapToInitFragWhenRequired=function(e){return null==e||!e.initSegment||null!=e&&e.initSegment.data||this.bitrateTest?e:e.initSegment},n.getNextPart=function(e,t,n){for(var r=-1,i=!1,a=!0,s=0,o=e.length;s<o;s++){var u=e[s];a=a&&!u.independent;if(-1<r&&n<u.start)break;var l=u.loaded;l?r=-1:(i||u.independent||a)&&u.fragment===t&&(r=s),i=l}return r},n.loadedEndOfParts=function(e,t){return(e=e[e.length-1])&&t>e.start&&e.loaded},n.getInitialLiveFragment=function(e,t){var n,r,i=this.fragPrevious,a=null;return i?(e.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+i.programDateTime),a=function(e,t,n){if(null!==t&&Array.isArray(e)&&e.length&&Gn(t)){var r=e[0].programDateTime;if(!(t<(r||0)||((r=e[e.length-1].endProgramDateTime)||0)<=t)){n=n||0;for(var i=0;i<e.length;++i){var a=e[i];if(function(e,t,n){return t=1e3*Math.min(t,n.duration+(n.deltaPTS||0)),(n.endProgramDateTime||0)-t>e}(t,n,a))return a}}}return null}(t,i.endProgramDateTime,this.config.maxFragLookUpTolerance)),a||((n=i.sn+1)>=e.startSN&&n<=e.endSN&&(n=t[n-e.startSN],i.cc===n.cc)&&this.log("Live playlist, switching playlist, load frag with next SN: "+(a=n).sn),!a&&(n=t,r=i.cc,a=Jr.search(n,(function(e){return e.cc<r?1:e.cc>r?-1:0})))&&this.log("Live playlist, switching playlist, load frag with same CC: "+a.sn))):null!==(t=this.hls.liveSyncPosition)&&(a=this.getFragmentAtPosition(t,this.bitrateTest?e.fragmentEnd:e.edge,e)),a},n.getFragmentAtPosition=function(e,t,n){var r=this.config,i=this.fragPrevious,a=n.fragments,s=n.endSN,o=n.fragmentHint,u=(r=r.maxFragLookUpTolerance,n.partList),l=!!(this.loadingParts&&null!=u&&u.length&&o);return l&&o&&!this.bitrateTest&&(a=a.concat(o),s=o.sn),(o=e<t?Ge(i,a,e,t-r<e?0:r):a[a.length-1])&&(t=o.sn-n.startSN,i=(e=this.fragmentTracker.getState(o))===li||e===ui&&o.gap?o:i)&&o.sn===i.sn&&(!l||u[0].fragment.sn>o.sn)&&i&&o.level===i.level&&(r=a[1+t],o=o.sn<s&&this.fragmentTracker.getState(r)!==li?r:null),o},n.synchronizeToLiveEdge=function(e){var t,n,r,i,a=this.config,s=this.media;s&&(t=this.hls.liveSyncPosition,n=s.currentTime,i=e.fragments[0].start,r=e.edge,i=n>=i-a.maxFragLookUpTolerance&&n<=r,null!==t)&&s.duration>t&&(n<t||!i)&&(a=void 0!==a.liveMaxLatencyDuration?a.liveMaxLatencyDuration:a.liveMaxLatencyDurationCount*e.targetduration,!i&&s.readyState<4||n<r-a)&&(this.loadedmetadata||(this.nextLoadPosition=t),s.readyState)&&(this.warn("Playback: "+n.toFixed(3)+" is located too far from the end of live sliding playlist: "+r+", reset currentTime to : "+t.toFixed(3)),s.currentTime=t)},n.alignPlaylists=function(e,t,n){var r,i,a,s=e.fragments.length;return s?(r=e.fragments[0].start,i=!t,a=e.alignedSliding&&Gn(r),i||!a&&!r?(function(e,t,n){var r,i;t&&(function(e,t,n){return!(!t||!(n.endCC>n.startCC||e&&e.cc<n.startCC))}(e=e,i=t,r=n)&&(e=function(e,t){if(e=e.fragments,(t=t.fragments).length&&e.length){if((e=Ze(e,t[0].cc))&&e.startPTS)return e;Qn.log("No frag in previous level to align on")}else Qn.log("No fragments to align")}(i,r))&&Gn(e.start)&&(Qn.log("Adjusting PTS using last level due to CC increase within current level "+r.url),tt(e.start,r)),!n.alignedSliding&&t&&nt(n,t),n.alignedSliding||!t||n.skippedSegments||Ie(t,n))}(i=this.fragPrevious,n,e),a=e.fragments[0].start,this.log("Live playlist sliding: "+a.toFixed(2)+" start-sn: "+(t?t.startSN:"na")+"->"+e.startSN+" prev-sn: "+(i?i.sn:"na")+" fragments: "+s),a):r):(this.warn("No fragments in live playlist"),0)},n.waitForCdnTuneIn=function(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,3*e.partTarget)},n.setStartPosition=function(e,t){var n,r,i=this.startPosition;-1!==(i=i<t?-1:i)&&-1!==this.lastCurrentTime||(null!==(r=((n=null!==this.startTimeOffset)?this:e).startTimeOffset)&&Gn(r)?(i=t+r,r<0&&(i+=e.totalduration),i=Math.min(Math.max(t,i),t+e.totalduration),this.log("Start time offset "+r+" found in "+(n?"multivariant":"media")+" playlist, adjust startPosition to "+i),this.startPosition=i):e.live?i=this.hls.liveSyncPosition||t:this.startPosition=i=0,this.lastCurrentTime=i),this.nextLoadPosition=i},n.getLoadPosition=function(){var e=this.media,t=0;return this.loadedmetadata&&e?t=e.currentTime:this.nextLoadPosition&&(t=this.nextLoadPosition),t},n.handleFragLoadAborted=function(e,t){this.transmuxer&&"initSegment"!==e.sn&&e.stats.aborted&&(this.warn("Fragment "+e.sn+(t?" part "+t.index:"")+" of level "+e.level+" was aborted"),this.resetFragmentLoading(e))},n.resetFragmentLoading=function(e){this.fragCurrent&&(this.fragContextChanged(e)||this.state===ki)||(this.state=Ti)},n.onFragmentOrKeyLoadError=function(e,t){t.chunkMeta&&!t.frag&&(n=this.getCurrentContext(t.chunkMeta))&&(t.frag=n.frag);var n=t.frag;if(n&&n.type===e&&this.levels)if(this.fragContextChanged(n))this.warn("Frag load error must match current frag to retry "+n.url+" > "+(null==(r=this.fragCurrent)?void 0:r.url));else{var r=t.details===Kn.FRAG_GAP,i=(r&&this.fragmentTracker.fragBuffered(n,!0),t.errorAction),a=(o=i||{}).action,s=void 0===(s=o.retryCount)?0:s,o=o.retryConfig;if(i&&5===a&&o){this.resetStartWhenNotLoaded(this.levelLastLoaded);var u=Be(o,s);this.warn("Fragment "+n.sn+" of "+e+" "+n.level+" errored with "+t.details+", retrying loading "+(s+1)+"/"+o.maxNumRetry+" in "+u+"ms"),i.resolved=!0,this.retryDate=self.performance.now()+u,this.state=ki}else if(o&&i){if(this.resetFragmentErrors(e),!(s<o.maxNumRetry))return void this.warn(t.details+" reached or exceeded max retry ("+s+")");r||3===a||(i.resolved=!0)}else 2===(null==i?void 0:i.action)?this.state=Ii:this.state=Ri;this.tickImmediate()}},n.reduceLengthAndFlushBuffer=function(e){var t,n,r;return(this.state===Ci||this.state===Ai)&&(t=e.parent,(n=(r=this.getFwdBufferInfo(this.mediaBuffer,t))&&.5<r.len)&&this.reduceMaxBufferLength(r.len),(r=!n)&&this.warn("Buffer full error while media.currentTime is not buffered, flush "+t+" buffer"),e.frag&&(this.fragmentTracker.removeFragment(e.frag),this.nextLoadPosition=e.frag.start),this.resetLoadingState(),r)},n.resetFragmentErrors=function(e){e===Fr&&(this.fragCurrent=null),this.loadedmetadata||(this.startFragRequested=!1),this.state!==bi&&(this.state=Ti)},n.afterBufferFlushed=function(e,t,n){e&&(e=hi.getBuffered(e),this.fragmentTracker.detectEvictedFragments(t,e,n),this.state===Li)&&this.resetLoadingState()},n.resetLoadingState=function(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state!==bi&&(this.state=Ti)},n.resetStartWhenNotLoaded=function(e){this.loadedmetadata||(this.startFragRequested=!1,null!=(e=e?e.details:null)&&e.live?(this.startPosition=-1,this.setStartPosition(e,0),this.resetLoadingState()):this.nextLoadPosition=this.startPosition)},n.resetWhenMissingContext=function(e){this.warn("The loading context changed while buffering fragment "+e.sn+" of level "+e.level+". This chunk will not be buffered."),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState()},n.removeUnbufferedFrags=function(e){this.fragmentTracker.removeFragmentsInRange(e=void 0===e?0:e,1/0,this.playlistType,!1,!0)},n.updateLevelTiming=function(e,t,n,r){var i=this,a=n.details;if(a){if(!Object.keys(e.elementaryStreams).reduce((function(t,s){var o,u=e.elementaryStreams[s];return u?(o=u.endPTS-u.startPTS)<=0?(i.warn("Could not parse fragment "+e.sn+" "+s+" duration reliably ("+o+")"),t||!1):(o=r?0:Re(a,e,u.startPTS,u.endPTS,u.startDTS,u.endDTS),i.hls.trigger(zn.LEVEL_PTS_UPDATED,{details:a,level:n,drift:o,type:s,frag:e,start:u.startPTS,end:u.endPTS}),!0):t}),!1)&&null===(null==(s=this.transmuxer)?void 0:s.error)){var s=new Error("Found no media in fragment "+e.sn+" of level "+e.level+" resetting transmuxer to fallback to playlist timing");if(0===n.fragmentError&&(n.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)),this.warn(s.message),this.hls.trigger(zn.ERROR,{type:Wn.MEDIA_ERROR,details:Kn.FRAG_PARSING_ERROR,fatal:!1,error:s,frag:e,reason:"Found no media in msn "+e.sn+' of level "'+n.url+'"'}),!this.hls)return;this.resetTransmuxer()}this.state=Ai,this.hls.trigger(zn.FRAG_PARSED,{frag:e,part:t})}else this.warn("level.details undefined")},n.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},n.recoverWorkerError=function(e){"demuxerWorker"===e.event&&(this.fragmentTracker.removeAllFragments(),this.resetTransmuxer(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState())},u(t,[{key:"state",get:function(){return this._state},set:function(e){var t=this._state;t!==e&&(this._state=e,this.log(t+"->"+e))}}])}(ai),function(){function e(){this.chunks=[],this.dataLength=0}var t=e.prototype;return t.push=function(e){this.chunks.push(e),this.dataLength+=e.length},t.flush=function(){var e=this.chunks,t=this.dataLength;return e.length?(e=1===e.length?e[0]:function(e,t){for(var n=new Uint8Array(t),r=0,i=0;i<e.length;i++){var a=e[i];n.set(a,r),r+=a.length}return n}(e,t),this.reset(),e):new Uint8Array(0)},t.reset=function(){this.chunks.length=0,this.dataLength=0},e}()),Di=function(){function e(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}var t=e.prototype;return t.resetInitSegment=function(e,t,n,r){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},t.resetTimeStamp=function(e){this.initPTS=e,this.resetContiguity()},t.resetContiguity=function(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0},t.canParse=function(e,t){return!1},t.appendFrame=function(e,t,n){},t.demux=function(e,t){this.cachedData&&(e=Y(this.cachedData,e),this.cachedData=null);var n,r,i,a=I(e,0),s=a?a.length:0,o=this._audioTrack,u=this._id3Track,l=a?O(a):void 0,c=e.length;for((null===this.basePTS||0===this.frameIndex&&Gn(l))&&(this.basePTS=Pi(l,t,this.initPTS),this.lastPTS=this.basePTS),null===this.lastPTS&&(this.lastPTS=this.basePTS),a&&0<a.length&&u.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:a,type:Vr,duration:Number.POSITIVE_INFINITY});s<c;)this.canParse(e,s)?(r=this.appendFrame(o,e,s))?(this.frameIndex++,this.lastPTS=r.sample.pts,n=s+=r.length):s=c:R(r=e,i=s)&&fr(r,i+6)+10<=r.length-i?(a=I(e,s),u.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:a,type:Vr,duration:Number.POSITIVE_INFINITY}),n=s+=a.length):s++,s===c&&n!==c&&(i=L(e,n),this.cachedData?this.cachedData=Y(this.cachedData,i):this.cachedData=i);return{audioTrack:o,videoTrack:at(),id3Track:u,textTrack:at()}},t.demuxSampleAes=function(e,t,n){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},t.flush=function(e){var t=this.cachedData;return t&&(this.cachedData=null,this.demux(t,0)),{audioTrack:this._audioTrack,videoTrack:at(),id3Track:this._id3Track,textTrack:at()}},t.destroy=function(){},e}(),Pi=function(e,t,n){return Gn(e)?90*e:9e4*t+(n?9e4*n.baseTime/n.timescale:0)},Mi=null,ji=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],Ui=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],Bi=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],Fi=[0,1,1,4],Ni=function(e){function t(t,n){var r=e.call(this)||this;return r.observer=void 0,r.config=void 0,r.observer=t,r.config=n,r}c(t,e);var n=t.prototype;return n.resetInitSegment=function(t,n,r,i){e.prototype.resetInitSegment.call(this,t,n,r,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:n,duration:i,inputTimeScale:9e4,dropped:0}},t.probe=function(e){if(e){var t=I(e,0),n=(null==t?void 0:t.length)||0;if(!gt(e,n))for(var r,i,a,s,o=e.length;n<o;n++)if(s=a=void 0,!lt(r=e,i=n)||i+(s=ot(r,i))>=r.length?void 0:!((a=ut(r,i))<=s)&&((s=i+a)===r.length||lt(r,s)))return Qn.log("ADTS sync word found !"),!0}return!1},n.canParse=function(e,t){return(t=t)+5<(e=e).length&&st(e,t)&&ut(e,t)<=e.length-t},n.appendFrame=function(e,t,n){if(ct(e,this.observer,t,n,e.manifestCodec),(e=ht(e,t,n,this.basePTS,this.frameIndex))&&0===e.missing)return e},t}(Di),Gi=/\/emsg[-\/]ID3/i,Vi=function(){function e(e,t){this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=t}var t=e.prototype;return t.resetTimeStamp=function(){},t.resetInitSegment=function(e,t,n,r){var i,a,s,o=this.videoTrack=at("video",1),u=this.audioTrack=at("audio",1),l=this.txtTrack=at("text",1);this.id3Track=at("id3",1),this.timeOffset=0,null!=e&&e.byteLength&&((e=z(e)).video&&(i=(s=e.video).id,a=s.timescale,s=s.codec,o.id=i,o.timescale=l.timescale=a,o.codec=s),e.audio&&(a=(i=e.audio).id,s=i.timescale,e=i.codec,u.id=a,u.timescale=s,u.codec=e),l.id=Tr.text,o.sampleDuration=0,o.duration=u.duration=r)},t.resetContiguity=function(){this.remainderData=null},e.probe=function(e){for(var t=e,n=t.byteLength,r=0;r<n;){var i=F(t,r);if(8<i&&109===t[r+4]&&111===t[r+5]&&111===t[r+6]&&102===t[r+7])return!0;r=1<i?r+i:n}return!1},t.demux=function(e,t){this.timeOffset=t;var n,r=e,i=this.videoTrack,a=this.txtTrack,s=(this.config.progressive?(this.remainderData&&(r=Y(this.remainderData,e)),e={valid:null,remainder:null},(s=H(n=r,["moof"])).length<2?e.remainder=n:(s=s[s.length-1],e.valid=L(n,0,s.byteOffset-8),e.remainder=L(n,s.byteOffset-8)),n=e,this.remainderData=n.remainder,i.samples=n.valid||new Uint8Array):i.samples=r,this.extractID3Track(i,t));return a.samples=X(t,i),{videoTrack:i,audioTrack:this.audioTrack,id3Track:s,textTrack:this.txtTrack}},t.flush=function(){var e=this.timeOffset,t=this.videoTrack,n=this.txtTrack,r=(t.samples=this.remainderData||new Uint8Array,this.remainderData=null,this.extractID3Track(t,this.timeOffset));return n.samples=X(e,t),{videoTrack:t,audioTrack:at(),id3Track:r,textTrack:at()}},t.extractID3Track=function(e,t){var n=this.id3Track;return e.samples.length&&(e=H(e.samples,["emsg"]))&&e.forEach((function(e){var r,i;e=function(e){var t="",n="",r=0,i=0,a=0,s=0,o=0,u=0;if(0===(l=e[0])){for(;"\0"!==U(e.subarray(u,u+1));)t+=U(e.subarray(u,u+1)),u+=1;for(t+=U(e.subarray(u,u+1)),u+=1;"\0"!==U(e.subarray(u,u+1));)n+=U(e.subarray(u,u+1)),u+=1;n+=U(e.subarray(u,u+1)),u+=1,r=F(e,12),i=F(e,16),s=F(e,20),o=F(e,24),u=28}else if(1===l){r=F(e,u+=4);var l=F(e,u+=4),c=F(e,u+=4);for(u+=4,a=Math.pow(2,32)*l+c,Vn(a)||(a=Number.MAX_SAFE_INTEGER,Qn.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),s=F(e,u),o=F(e,u+=4),u+=4;"\0"!==U(e.subarray(u,u+1));)t+=U(e.subarray(u,u+1)),u+=1;for(t+=U(e.subarray(u,u+1)),u+=1;"\0"!==U(e.subarray(u,u+1));)n+=U(e.subarray(u,u+1)),u+=1;n+=U(e.subarray(u,u+1)),u+=1}return{schemeIdUri:t,value:n,timeScale:r,presentationTime:a,presentationTimeDelta:i,eventDuration:s,id:o,payload:e.subarray(u,e.byteLength)}}(e);Gi.test(e.schemeIdUri)&&(r=Gn(e.presentationTime)?e.presentationTime/e.timeScale:t+e.presentationTimeDelta/e.timeScale,(i=4294967295===e.eventDuration?Number.POSITIVE_INFINITY:e.eventDuration/e.timeScale)<=.001&&(i=Number.POSITIVE_INFINITY),e=e.payload,n.samples.push({data:e,len:e.byteLength,dts:r,pts:r,type:Hr,duration:i}))})),n},t.demuxSampleAes=function(e,t,n){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},t.destroy=function(){},e}(),Hi=function(e){function t(t){var n=e.call(this)||this;return n.observer=void 0,n.observer=t,n}c(t,e);var n=t.prototype;return n.resetInitSegment=function(t,n,r,i){e.prototype.resetInitSegment.call(this,t,n,r,i),this._audioTrack={container:"audio/ac-3",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"ac3",samples:[],manifestCodec:n,duration:i,inputTimeScale:9e4,dropped:0}},n.canParse=function(e,t){return t+64<e.length},n.appendFrame=function(e,t,n){if(-1!==(t=_t(e,t,n,this.basePTS,this.frameIndex)))return{sample:e.samples[e.samples.length-1],length:t,missing:0}},t.probe=function(e){var t,n;return!!e&&!!(t=I(e,0))&&11===e[n=t.length]&&119===e[n+1]&&void 0!==O(t)&&yt(e,n)<16},t}(Di),zi=function(){function e(){this.VideoSample=null}var t=e.prototype;return t.createVideoSample=function(e,t,n,r){return{key:e,frame:!1,pts:t,dts:n,units:[],debug:r,length:0}},t.getLastNalUnit=function(e){var t,n=this.VideoSample;return null!=(n=n&&0!==n.units.length?n:e[e.length-1])&&n.units?(e=n.units)[e.length-1]:t},t.pushAccessUnit=function(e,t){if(e.units.length&&e.frame){if(void 0===e.pts){var n=t.samples,r=n.length;if(!r)return void t.dropped++;n=n[r-1],e.pts=n.pts,e.dts=n.dts}t.samples.push(e)}e.debug.length&&Qn.log(e.pts+"/"+e.dts+":"+e.debug)},t.parseNALu=function(e,t){var n,r=t.byteLength,i=d=e.naluState||0,a=[],s=0,o=-1,u=0;for(-1===d&&(u=this.getNALuType(t,o=0),d=0,s=1);s<r;){var l,c,d,h=t[s++];d=d?1===d?h?0:2:h?1===h?(c=s-d-1,0<=o?(l={data:t.subarray(o,c),type:u},a.push(l)):(l=this.getLastNalUnit(e.samples))&&(i&&s<=4-i&&l.state&&(l.data=l.data.subarray(0,l.data.byteLength-i)),0<c)&&(l.data=Y(l.data,t.subarray(0,c)),l.state=0),s<r?(o=s,u=this.getNALuType(t,s),0):-1):0:3:h?0:1}return 0<=o&&0<=d&&(n={data:t.subarray(o,r),type:u,state:d},a.push(n)),0===a.length&&(n=this.getLastNalUnit(e.samples))&&(n.data=Y(n.data,t)),e.naluState=d,a},e}(),Wi=function(){function e(e){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}var t=e.prototype;return t.loadWord=function(){var e=this.data,t=this.bytesAvailable,n=e.byteLength-t,r=new Uint8Array(4);if(0===(t=Math.min(4,t)))throw new Error("no bytes available");r.set(e.subarray(n,n+t)),this.word=new DataView(r.buffer).getUint32(0),this.bitsAvailable=8*t,this.bytesAvailable-=t},t.skipBits=function(e){var t;e=Math.min(e,8*this.bytesAvailable+this.bitsAvailable),this.bitsAvailable>e||(e=(e-=this.bitsAvailable)-((t=e>>3)<<3),this.bytesAvailable-=t,this.loadWord()),this.word<<=e,this.bitsAvailable-=e},t.readBits=function(e){var t=Math.min(this.bitsAvailable,e),n=this.word>>>32-t;if(32<e&&Qn.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,0<this.bitsAvailable)this.word<<=t;else{if(!(0<this.bytesAvailable))throw new Error("no bits available");this.loadWord()}return 0<(t=e-t)&&this.bitsAvailable?n<<t|this.readBits(t):n},t.skipLZ=function(){for(var e=0;e<this.bitsAvailable;++e)if(0!=(this.word&2147483648>>>e))return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()},t.skipUEG=function(){this.skipBits(1+this.skipLZ())},t.skipEG=function(){this.skipBits(1+this.skipLZ())},t.readUEG=function(){var e=this.skipLZ();return this.readBits(e+1)-1},t.readEG=function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)},t.readBoolean=function(){return 1===this.readBits(1)},t.readUByte=function(){return this.readBits(8)},t.readUShort=function(){return this.readBits(16)},t.readUInt=function(){return this.readBits(32)},e}(),Ki=function(e){function t(){return e.apply(this,arguments)||this}c(t,e);var n=t.prototype;return n.parsePES=function(e,t,n,r,i){var a,s=this,o=this.parseNALu(e,n.data),u=this.VideoSample,l=!1;n.data=null,u&&o.length&&!e.audFound&&(this.pushAccessUnit(u,e),u=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts,"")),o.forEach((function(r){switch(r.type){case 1:var o=!1,c=(a=!0,r.data);l&&4<c.length&&(2!==(c=s.readSliceType(c))&&4!==c&&7!==c&&9!==c||(o=!0)),o&&null!=u&&u.frame&&!u.key&&(s.pushAccessUnit(u,e),u=s.VideoSample=null),(u=u||(s.VideoSample=s.createVideoSample(!0,n.pts,n.dts,""))).frame=!0,u.key=o;break;case 5:a=!0,null!=u&&u.frame&&!u.key&&(s.pushAccessUnit(u,e),u=s.VideoSample=null),(u=u||(s.VideoSample=s.createVideoSample(!0,n.pts,n.dts,""))).key=!0,u.frame=!0;break;case 6:a=!0,J(r.data,1,n.pts,t.samples);break;case 7:l=a=!0;var d;c=r.data,o=s.readSPS(c);if(!e.sps||e.width!==o.width||e.height!==o.height||(null==(d=e.pixelRatio)?void 0:d[0])!==o.pixelRatio[0]||(null==(d=e.pixelRatio)?void 0:d[1])!==o.pixelRatio[1]){e.width=o.width,e.height=o.height,e.pixelRatio=o.pixelRatio,e.sps=[c],e.duration=i;for(var h=c.subarray(1,4),f="avc1.",p=0;p<3;p++){var v=h[p].toString(16);f+=v=v.length<2?"0"+v:v}e.codec=f}break;case 8:a=!0,e.pps=[r.data];break;case 9:a=!0,e.audFound=!0,u&&s.pushAccessUnit(u,e),u=s.VideoSample=s.createVideoSample(!1,n.pts,n.dts,"");break;case 12:a=!0;break;default:a=!1,u&&(u.debug+="unknown NAL "+r.type+" ")}u&&a&&u.units.push(r)})),r&&u&&(this.pushAccessUnit(u,e),this.VideoSample=null)},n.getNALuType=function(e,t){return 31&e[t]},n.readSliceType=function(e){return(e=new Wi(e)).readUByte(),e.readUEG(),e.readUEG()},n.skipScalingList=function(e,t){for(var n=8,r=8,i=0;i<e;i++)n=0===(r=0!==r?(n+t.readEG()+256)%256:r)?n:r},n.readSPS=function(e){var t,n,r,i=new Wi(e),a=(e=0,0),s=0,o=0,u=i.readUByte.bind(i),l=i.readBits.bind(i),c=i.readUEG.bind(i),d=i.readBoolean.bind(i),h=i.skipBits.bind(i),f=i.skipEG.bind(i),p=i.skipUEG.bind(i),v=this.skipScalingList.bind(this),m=(u(),u());if(l(5),h(3),u(),p(),(100===m||110===m||122===m||244===m||44===m||83===m||86===m||118===m||128===m)&&(3===(m=c())&&h(1),p(),p(),h(1),d()))for(n=3!==m?8:12,r=0;r<n;r++)d()&&v(r<6?16:64,i);if(p(),0===(m=c()))c();else if(1===m)for(h(1),f(),f(),t=c(),r=0;r<t;r++)f();p(),h(1);m=c(),p=c();var g=(0===(l=l(1))&&h(1),h(1),d()&&(e=c(),a=c(),s=c(),o=c()),[1,1]);if(d()&&d())switch(u()){case 1:g=[1,1];break;case 2:g=[12,11];break;case 3:g=[10,11];break;case 4:g=[16,11];break;case 5:g=[40,33];break;case 6:g=[24,11];break;case 7:g=[20,11];break;case 8:g=[32,11];break;case 9:g=[80,33];break;case 10:g=[18,11];break;case 11:g=[15,11];break;case 12:g=[64,33];break;case 13:g=[160,99];break;case 14:g=[4,3];break;case 15:g=[3,2];break;case 16:g=[2,1];break;case 255:g=[u()<<8|u(),u()<<8|u()]}return{width:Math.ceil(16*(m+1)-2*e-2*a),height:(2-l)*(p+1)*16-(l?2:4)*(s+o),pixelRatio:g}},t}(zi),qi=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).initVPS=null,t}c(t,e);var r=t.prototype;return r.parsePES=function(e,t,r,a,s){var o,u=this,l=this.parseNALu(e,r.data),c=this.VideoSample,d=!1;r.data=null,c&&l.length&&!e.audFound&&(this.pushAccessUnit(c,e),c=this.VideoSample=this.createVideoSample(!1,r.pts,r.dts,"")),l.forEach((function(a){var l;switch(a.type){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:(c=c||(u.VideoSample=u.createVideoSample(!1,r.pts,r.dts,""))).frame=!0,o=!0;break;case 16:case 17:case 18:case 21:o=!0,d&&null!=c&&c.frame&&!c.key&&(u.pushAccessUnit(c,e),c=u.VideoSample=null),(c=c||(u.VideoSample=u.createVideoSample(!0,r.pts,r.dts,""))).key=!0,c.frame=!0;break;case 19:case 20:o=!0,null!=c&&c.frame&&!c.key&&(u.pushAccessUnit(c,e),c=u.VideoSample=null),(c=c||(u.VideoSample=u.createVideoSample(!0,r.pts,r.dts,""))).key=!0,c.frame=!0;break;case 39:o=!0,J(a.data,2,r.pts,t.samples);break;case 32:o=!0,e.vps||(l=u.readVPS(a.data),e.params=n({},l),u.initVPS=a.data),e.vps=[a.data];break;case 33:if(d=o=!0,"object"===i(e.params)){if(void 0===e.vps||e.vps[0]===u.initVPS||void 0===e.sps||u.matchSPS(e.sps[0],a.data)||(u.initVPS=e.vps[0],e.sps=e.pps=void 0),!e.sps){var h,f=u.readSPS(a.data);for(h in e.width=f.width,e.height=f.height,e.pixelRatio=f.pixelRatio,e.duration=s,e.codec=f.codecString,e.sps=[],f.params)e.params[h]=f.params[h]}void 0!==e.vps&&e.vps[0]===u.initVPS&&e.sps.push(a.data)}(c=c||(u.VideoSample=u.createVideoSample(!0,r.pts,r.dts,""))).key=!0;break;case 34:if(o=!0,"object"===i(e.params)){if(!e.pps){e.pps=[];var p,v=u.readPPS(a.data);for(p in v)e.params[p]=v[p]}null===u.initVPS&&0!==e.pps.length||e.pps.push(a.data)}break;case 35:o=!0,e.audFound=!0,c&&u.pushAccessUnit(c,e),c=u.VideoSample=u.createVideoSample(!1,r.pts,r.dts,"");break;default:o=!1,c&&(c.debug+="unknown or irrelevant NAL "+a.type+" ")}c&&o&&c.units.push(a)})),a&&c&&(this.pushAccessUnit(c,e),this.VideoSample=null)},r.getNALuType=function(e,t){return(126&e[t])>>>1},r.ebsp2rbsp=function(e){for(var t=new Uint8Array(e.byteLength),n=0,r=0;r<e.byteLength;r++)2<=r&&3===e[r]&&0===e[r-1]&&0===e[r-2]||(t[n]=e[r],n++);return new Uint8Array(t.buffer,0,n)},r.readVPS=function(e){return(e=new Wi(e)).readUByte(),e.readUByte(),e.readBits(4),e.skipBits(2),e.readBits(6),{numTemporalLayers:e.readBits(3)+1,temporalIdNested:e.readBoolean()}},r.readSPS=function(e){for(var t=new Wi(this.ebsp2rbsp(e)),n=(t.readUByte(),t.readUByte(),t.readBits(4),t.readBits(3)),r=(e=(t.readBoolean(),t.readBits(2)),t.readBoolean()),i=t.readBits(5),a=t.readUByte(),s=t.readUByte(),o=t.readUByte(),u=t.readUByte(),l=t.readUByte(),c=t.readUByte(),d=t.readUByte(),h=t.readUByte(),f=t.readUByte(),p=t.readUByte(),v=t.readUByte(),m=[],g=[],y=0;y<n;y++)m.push(t.readBoolean()),g.push(t.readBoolean());if(0<n)for(var _=n;_<8;_++)t.readBits(2);for(var b=0;b<n;b++)m[b]&&(t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte()),g[b]&&t.readUByte();t.readUEG();for(var T=t.readUEG(),S=(3==T&&t.skipBits(1),t.readUEG()),E=t.readUEG(),k=t.readBoolean(),w=0,C=0,A=0,L=0,R=(k&&(w+=t.readUEG(),C+=t.readUEG(),A+=t.readUEG(),L+=t.readUEG()),t.readUEG()),x=t.readUEG(),I=t.readUEG(),O=t.readBoolean()?0:n;O<=n;O++)t.skipUEG(),t.skipUEG(),t.skipUEG();if(t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),(Q=t.readBoolean())&&t.readBoolean())for(var D=0;D<4;D++)for(var P=0;P<(3===D?2:6);P++)if(t.readBoolean()){var M=Math.min(64,1<<4+(D<<1));1<D&&t.readEG();for(var j=0;j<M;j++)t.readEG()}else t.readUEG();t.readBoolean(),t.readBoolean(),t.readBoolean()&&(t.readUByte(),t.skipUEG(),t.skipUEG(),t.readBoolean());for(var U=t.readUEG(),B=0,F=0;F<U;F++){var N=!1;if(N=0!==F?t.readBoolean():N){F===U&&t.readUEG(),t.readBoolean(),t.readUEG();for(var G=0,V=0;V<=B;V++){var H=t.readBoolean(),z=!1;H||(z=t.readBoolean()),(H||z)&&G++}B=G}else{for(var W=t.readUEG(),K=t.readUEG(),q=(B=W+K,0);q<W;q++)t.readUEG(),t.readBoolean();for(var $=0;$<K;$++)t.readUEG(),t.readBoolean()}}if(t.readBoolean())for(var Y=t.readUEG(),X=0;X<Y;X++){for(var J=0;J<I+4;J++)t.readBits(1);t.readBits(1)}var Q=0,Z=1,ee=1,te=!0,ne=1,re=0,ie=(t.readBoolean(),t.readBoolean(),!1);if(t.readBoolean()){if(t.readBoolean()&&(0<(fe=t.readUByte())&&fe<16?(Z=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][fe-1],ee=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][fe-1]):255===fe&&(Z=t.readBits(16),ee=t.readBits(16))),t.readBoolean()&&t.readBoolean(),t.readBoolean()&&(t.readBits(3),t.readBoolean(),t.readBoolean())&&(t.readUByte(),t.readUByte(),t.readUByte()),t.readBoolean()&&(t.readUEG(),t.readUEG()),t.readBoolean(),t.readBoolean(),t.readBoolean(),(ie=t.readBoolean())&&(w+=t.readUEG(),C+=t.readUEG(),A+=t.readUEG(),L+=t.readUEG()),t.readBoolean()&&(ne=t.readBits(32),re=t.readBits(32),t.readBoolean()&&t.readUEG(),t.readBoolean())){var ae=t.readBoolean(),se=t.readBoolean(),oe=!1;(ae||se)&&((oe=t.readBoolean())&&(t.readUByte(),t.readBits(5),t.readBoolean(),t.readBits(5)),t.readBits(4),t.readBits(4),oe&&t.readBits(4),t.readBits(5),t.readBits(5),t.readBits(5));for(var ue=0;ue<=n;ue++){var le=!1,ce=((te=t.readBoolean())||t.readBoolean()?t.readEG():le=t.readBoolean(),le?1:t.readUEG()+1);if(ae)for(var de=0;de<ce;de++)t.readUEG(),t.readUEG(),oe&&(t.readUEG(),t.readUEG()),t.skipBits(1);if(se)for(var he=0;he<ce;he++)t.readUEG(),t.readUEG(),oe&&(t.readUEG(),t.readUEG()),t.skipBits(1)}}t.readBoolean()&&(t.readBoolean(),t.readBoolean(),t.readBoolean(),Q=t.readUEG())}for(var fe=S,pe=E,ve=(S=((k||ie)&&((ie=k=1)===T?k=ie=2:2==T&&(k=2),fe=S-k*C-k*w,pe=E-ie*L-ie*A),e?["A","B","C"][e]:""),a<<24|s<<16|o<<8|u),me=0,ge=0;ge<32;ge++)me=(me|(ve>>ge&1)<<31-ge)>>>0;return C=me.toString(16),{codecString:"hvc1."+S+i+"."+(C=1===i&&"2"===C?"6":C)+"."+(r?"H":"L")+v+".B0",params:{general_tier_flag:r,general_profile_idc:i,general_profile_space:e,general_profile_compatibility_flags:[a,s,o,u],general_constraint_indicator_flags:[l,c,d,h,f,p],general_level_idc:v,bit_depth:R+8,bit_depth_luma_minus8:R,bit_depth_chroma_minus8:x,min_spatial_segmentation_idc:Q,chroma_format_idc:T,frame_rate:{fixed:te,fps:re/ne}},width:fe,height:pe,pixelRatio:[Z,ee]}},r.readPPS=function(e){(e=new Wi(this.ebsp2rbsp(e))).readUByte(),e.readUByte(),e.skipUEG(),e.skipUEG(),e.skipBits(2),e.skipBits(3),e.skipBits(2),e.skipUEG(),e.skipUEG(),e.skipEG(),e.skipBits(2),e.readBoolean()&&e.skipUEG(),e.skipEG(),e.skipEG(),e.skipBits(4);var t=e.readBoolean(),n=1;return(e=e.readBoolean())&&t?n=0:e?n=3:t&&(n=2),{parallelismType:n}},r.matchSPS=function(e,t){return String.fromCharCode.apply(null,e).substr(3)===String.fromCharCode.apply(null,t).substr(3)},t}(zi),$i=function(){function e(e,t,n){this.keyData=void 0,this.decrypter=void 0,this.keyData=n,this.decrypter=new _i(t,{removePKCS7Padding:!1})}var t=e.prototype;return t.decryptBuffer=function(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer,sr)},t.decryptAacSample=function(e,t,n){var r,i=this,a=e[t].unit;a.length<=16||(r=(r=a.subarray(16,a.length-a.length%16)).buffer.slice(r.byteOffset,r.byteOffset+r.length),this.decryptBuffer(r).then((function(r){r=new Uint8Array(r),a.set(r,16),i.decrypter.isSync()||i.decryptAacSamples(e,t+1,n)})))},t.decryptAacSamples=function(e,t,n){for(;;t++){if(t>=e.length)return void n();if(!(e[t].unit.length<32||(this.decryptAacSample(e,t,n),this.decrypter.isSync())))return}},t.getAvcEncryptedData=function(e){for(var t=16*Math.floor((e.length-48)/160)+16,n=new Int8Array(t),r=0,i=32;i<e.length-16;i+=160,r+=16)n.set(e.subarray(i,i+16),r);return n},t.getAvcDecryptedUnit=function(e,t){for(var n=new Uint8Array(t),r=0,i=32;i<e.length-16;i+=160,r+=16)e.set(n.subarray(r,r+16),i);return e},t.decryptAvcSample=function(e,t,n,r,i){var a=this,s=Q(i.data),o=this.getAvcEncryptedData(s);this.decryptBuffer(o.buffer).then((function(o){i.data=a.getAvcDecryptedUnit(s,o),a.decrypter.isSync()||a.decryptAvcSamples(e,t,n+1,r)}))},t.decryptAvcSamples=function(e,t,n,r){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,n=0){if(t>=e.length)return void r();for(var i=e[t].units;!(n>=i.length);n++){var a=i[n];if(!(a.data.length<=48||1!==a.type&&5!==a.type||(this.decryptAvcSample(e,t,n,r,a),this.decrypter.isSync())))return}}},e}(),Yi=188,Xi=(zi=function(){function e(e,t,n){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this._pmtId=-1,this._videoTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.remainderData=null,this.videoParser=void 0,this.observer=e,this.config=t,this.typeSupported=n,this.videoParser=null}e.probe=function(t){return 0<(t=e.syncOffset(t))&&Qn.warn("MPEG2-TS detected but first sync word found @ offset "+t),-1!==t},e.syncOffset=function(e){for(var t=e.length,n=Math.min(940,t-Yi)+1,r=0;r<n;){for(var i=!1,a=-1,s=0,o=r;o<t;o+=Yi){if(71!==e[o]||t-o!=Yi&&71!==e[o+Yi]){if(s)return-1;break}if(s++,-1===a&&0!==(a=o)&&(n=Math.min(a+18612,e.length-Yi)+1),(i=i||0===bt(e,o))&&1<s&&(0===a&&2<s||n<o+Yi))return a}r++}return-1},e.createTrack=function(e,t){return{container:"video"===e||"audio"===e?"video/mp2t":void 0,type:e,id:Tr[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:"audio"===e?t:void 0}};var t=e.prototype;return t.resetInitSegment=function(t,n,r,i){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=e.createTrack("video"),this._audioTrack=e.createTrack("audio",i),this._id3Track=e.createTrack("id3"),this._txtTrack=e.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.remainderData=null,this.audioCodec=n,this.videoCodec=r,this._duration=i},t.resetTimeStamp=function(){},t.resetContiguity=function(){var e=this._audioTrack,t=this._videoTrack,n=this._id3Track;e&&(e.pesData=null),t&&(t.pesData=null),n&&(n.pesData=null),this.aacOverFlow=null,this.remainderData=null},t.demux=function(t,n,r,i){void 0===i&&(i=!1),(r=void 0!==r&&r)||(this.sampleAes=null);var a,s=this._videoTrack,o=this._audioTrack,u=this._id3Track,l=this._txtTrack,c=s.pid,d=s.pesData,h=o.pid,f=u.pid,p=o.pesData,v=u.pesData,m=null,g=this.pmtParsed,y=this._pmtId,_=t.length;if(this.remainderData&&(_=(t=Y(this.remainderData,t)).length,this.remainderData=null),_<Yi&&!i)return this.remainderData=t,{audioTrack:o,videoTrack:s,id3Track:u,textTrack:l};for(var b,T=Math.max(0,e.syncOffset(t)),S=((_-=(_-T)%Yi)<t.byteLength&&!i&&(this.remainderData=new Uint8Array(t.buffer,_,t.buffer.byteLength-_)),0),E=T;E<_;E+=Yi)if(71===t[E]){var k=!!(64&t[E+1]),w=bt(t,E),C=void 0;if(1<(48&t[E+3])>>4){if((C=E+5+t[E+4])===E+Yi)continue}else C=E+4;switch(w){case c:if(k){if(d&&(a=St(d))){if(null===this.videoParser)switch(s.segmentCodec){case"avc":this.videoParser=new Ki;break;case"hevc":this.videoParser=new qi}null!==this.videoParser&&this.videoParser.parsePES(s,l,a,!1,this._duration)}d={data:[],size:0}}d&&(d.data.push(t.subarray(C,E+Yi)),d.size+=E+Yi-C);break;case h:if(k){if(p&&(a=St(p)))switch(o.segmentCodec){case"aac":this.parseAACPES(o,a);break;case"mp3":this.parseMPEGPES(o,a);break;case"ac3":this.parseAC3PES(o,a)}p={data:[],size:0}}p&&(p.data.push(t.subarray(C,E+Yi)),p.size+=E+Yi-C);break;case f:k&&(v&&(a=St(v))&&this.parseID3PES(u,a),v={data:[],size:0}),v&&(v.data.push(t.subarray(C,E+Yi)),v.size+=E+Yi-C);break;case 0:k&&(C+=t[C]+1),y=this._pmtId=(31&(A=t)[(b=C)+10])<<8|A[b+11];break;case y:k&&(C+=t[C]+1);var A=function(e,t,n,r){var i={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},a=t+3+((15&e[t+1])<<8|e[t+2])-4;for(t+=12+((15&e[t+10])<<8|e[t+11]);t<a;){var s=bt(e,t),o=(15&e[t+3])<<8|e[t+4];switch(e[t]){case 207:if(!r){Tt("ADTS AAC");break}case 15:-1===i.audioPid&&(i.audioPid=s);break;case 21:-1===i.id3Pid&&(i.id3Pid=s);break;case 219:if(!r){Tt("H.264");break}case 27:-1===i.videoPid&&(i.videoPid=s,i.segmentVideoCodec="avc");break;case 3:case 4:n.mpeg||n.mp3?-1===i.audioPid&&(i.audioPid=s,i.segmentAudioCodec="mp3"):Qn.log("MPEG audio found, not supported in this browser");break;case 193:if(!r){Tt("AC-3");break}case 129:n.ac3?-1===i.audioPid&&(i.audioPid=s,i.segmentAudioCodec="ac3"):Qn.log("AC-3 audio found, not supported in this browser");break;case 6:if(-1===i.audioPid&&0<o)for(var u=t+5,l=o;2<l;){106===e[u]&&(!0!==n.ac3?Qn.log("AC-3 audio found, not supported in this browser for now"):(i.audioPid=s,i.segmentAudioCodec="ac3"));var c=e[u+1]+2;u+=c,l-=c}break;case 194:case 135:Qn.warn("Unsupported EC-3 in M2TS found");break;case 36:-1===i.videoPid&&(i.videoPid=s,i.segmentVideoCodec="hevc",Qn.log("HEVC in M2TS found"))}t+=5+o}return i}(t,C,this.typeSupported,r);0<(c=A.videoPid)&&(s.pid=c,s.segmentCodec=A.segmentVideoCodec),0<(h=A.audioPid)&&(o.pid=h,o.segmentCodec=A.segmentAudioCodec),0<(f=A.id3Pid)&&(u.pid=f),null===m||g||(Qn.warn("MPEG-TS PMT found at "+E+" after unknown PID '"+m+"'. Backtracking to sync byte @"+T+" to parse all TS packets."),m=null,E=T-188),g=this.pmtParsed=!0;break;case 17:case 8191:break;default:m=w}}else S++;0<S&&(L=new Error("Found "+S+" TS packet/s that do not start with 0x47"),this.observer.emit(zn.ERROR,zn.ERROR,{type:Wn.MEDIA_ERROR,details:Kn.FRAG_PARSING_ERROR,fatal:!1,error:L,reason:L.message})),s.pesData=d,o.pesData=p,u.pesData=v;var L={audioTrack:o,videoTrack:s,id3Track:u,textTrack:l};return i&&this.extractRemainingSamples(L),L},t.flush=function(){var e=this.remainderData;return this.remainderData=null,e=e?this.demux(e,-1,!1,!0):{videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(e),this.sampleAes?this.decrypt(e,this.sampleAes):e},t.extractRemainingSamples=function(e){var t,n=e.audioTrack,r=e.videoTrack,i=e.id3Track,a=(e=e.textTrack,r.pesData),s=n.pesData,o=i.pesData;if(a&&(t=St(a))){if(null===this.videoParser)switch(r.segmentCodec){case"avc":this.videoParser=new Ki;break;case"hevc":this.videoParser=new qi}null!==this.videoParser&&(this.videoParser.parsePES(r,e,t,!0,this._duration),r.pesData=null)}else r.pesData=a;if(s&&(t=St(s))){switch(n.segmentCodec){case"aac":this.parseAACPES(n,t);break;case"mp3":this.parseMPEGPES(n,t);break;case"ac3":this.parseAC3PES(n,t)}n.pesData=null}else null!=s&&s.size&&Qn.log("last AAC PES packet truncated,might overlap between fragments"),n.pesData=s;o&&(t=St(o))?(this.parseID3PES(i,t),i.pesData=null):i.pesData=o},t.demuxSampleAes=function(e,t,n){return e=this.demux(e,n,!0,!this.config.progressive),n=this.sampleAes=new $i(this.observer,this.config,t),this.decrypt(e,n)},t.decrypt=function(e,t){return new Promise((function(n){var r=e.audioTrack,i=e.videoTrack;r.samples&&"aac"===r.segmentCodec?t.decryptAacSamples(r.samples,0,(function(){i.samples?t.decryptAvcSamples(i.samples,0,0,(function(){n(e)})):n(e)})):i.samples&&t.decryptAvcSamples(i.samples,0,0,(function(){n(e)}))}))},t.destroy=function(){this._duration=0},t.parseAACPES=function(e,t){var n,r,i=0,a=this.aacOverFlow,s=t.data;for(a&&(this.aacOverFlow=null,o=a.missing,u=a.sample.unit.byteLength,-1===o?s=Y(a.sample.unit,s):(u-=o,a.sample.unit.set(s.subarray(0,o),u),e.samples.push(a.sample),i=a.missing)),n=i,r=s.length;n<r-1&&!lt(s,n);n++);if(n!==i){var o=n<r-1,u=o?"AAC PES did not start with ADTS header,offset:"+n:"No ADTS header found in AAC PES";i=new Error(u);if(Qn.warn("parsing error: "+u),this.observer.emit(zn.ERROR,zn.ERROR,{type:Wn.MEDIA_ERROR,details:Kn.FRAG_PARSING_ERROR,fatal:!1,levelRetry:o,error:i,reason:u}),!o)return}if(ct(e,this.observer,s,n,this.audioCodec),void 0!==t.pts)l=t.pts;else{if(!a)return void Qn.warn("[tsdemuxer]: AAC PES unknown PTS");i=dt(e.samplerate);var l=a.sample.pts+i}for(var c,d=0;n<r;){if(n+=(c=ht(e,s,n,l,d)).length,c.missing){this.aacOverFlow=c;break}for(d++;n<r-1&&!lt(s,n);n++);}},t.parseMPEGPES=function(e,t){var n=t.data,r=n.length,i=0,a=0,s=t.pts;if(void 0===s)Qn.warn("[tsdemuxer]: MPEG PES unknown PTS");else for(;a<r;)if(mt(n,a)){var o=ft(e,n,a,s,i);if(!o)break;a+=o.length,i++}else a++},t.parseAC3PES=function(e,t){var n=t.data,r=t.pts;if(void 0===r)Qn.warn("[tsdemuxer]: AC3 PES unknown PTS");else for(var i,a=n.length,s=0,o=0;o<a&&0<(i=_t(e,n,o,r,s++));)o+=i},t.parseID3PES=function(e,t){void 0===t.pts?Qn.warn("[tsdemuxer]: ID3 PES unknown PTS"):(t=l({},t,{type:this._videoTrack?Hr:Vr,duration:Number.POSITIVE_INFINITY}),e.samples.push(t))},e}(),Di=function(e){function t(){return e.apply(this,arguments)||this}c(t,e);var n=t.prototype;return n.resetInitSegment=function(t,n,r,i){e.prototype.resetInitSegment.call(this,t,n,r,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:n,duration:i,inputTimeScale:9e4,dropped:0}},t.probe=function(e){if(e){var t=I(e,0),n=(null==t?void 0:t.length)||0;if(!(t&&11===e[n]&&119===e[n+1]&&void 0!==O(t)&&yt(e,n)<=16))for(var r=e.length;n<r;n++)if(gt(e,n))return Qn.log("MPEG Audio sync word found !"),!0}return!1},n.canParse=function(e,t){return vt(e=e,t=t)&&4<=e.length-t},n.appendFrame=function(e,t,n){if(null!==this.basePTS)return ft(e,t,n,this.basePTS,this.frameIndex)},t}(Di),function(){function e(){}return e.getSilentFrame=function(e,t){if("mp4a.40.2"===e){if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===t)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}},e}()),Ji=Math.pow(2,32)-1,Qi=function(){function e(){}return e.init=function(){for(var t in e.types={avc1:[],avcC:[],hvc1:[],hvcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],dac3:[],"ac-3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]})e.types.hasOwnProperty(t)&&(e.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);var n=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),r=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),i=(n=(e.HDLR_TYPES={video:n,audio:r},new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1])),r=new Uint8Array([0,0,0,0,0,0,0,0]),r=(e.STTS=e.STSC=e.STCO=r,e.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),e.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),e.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),e.STSD=new Uint8Array([0,0,0,0,0,0,0,1]),new Uint8Array([105,115,111,109])),new Uint8Array([97,118,99,49])),a=new Uint8Array([0,0,0,1]);e.FTYP=e.box(e.types.ftyp,r,a,r,i),e.DINF=e.box(e.types.dinf,e.box(e.types.dref,n))},e.box=function(e){for(var t=8,n=arguments.length,r=new Array(1<n?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];for(var a=r.length,s=a;a--;)t+=r[a].byteLength;var o=new Uint8Array(t);for(o[0]=t>>24&255,o[1]=t>>16&255,o[2]=t>>8&255,o[3]=255&t,o.set(e,4),a=0,t=8;a<s;a++)o.set(r[a],t),t+=r[a].byteLength;return o},e.hdlr=function(t){return e.box(e.types.hdlr,e.HDLR_TYPES[t])},e.mdat=function(t){return e.box(e.types.mdat,t)},e.mdhd=function(t,n){n*=t;var r=Math.floor(n/(1+Ji));n=Math.floor(n%(1+Ji));return e.box(e.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,r>>24,r>>16&255,r>>8&255,255&r,n>>24,n>>16&255,n>>8&255,255&n,85,196,0,0]))},e.mdia=function(t){return e.box(e.types.mdia,e.mdhd(t.timescale,t.duration),e.hdlr(t.type),e.minf(t))},e.mfhd=function(t){return e.box(e.types.mfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))},e.minf=function(t){return"audio"===t.type?e.box(e.types.minf,e.box(e.types.smhd,e.SMHD),e.DINF,e.stbl(t)):e.box(e.types.minf,e.box(e.types.vmhd,e.VMHD),e.DINF,e.stbl(t))},e.moof=function(t,n,r){return e.box(e.types.moof,e.mfhd(t),e.traf(r,n))},e.moov=function(t){for(var n=t.length,r=[];n--;)r[n]=e.trak(t[n]);return e.box.apply(null,[e.types.moov,e.mvhd(t[0].timescale,t[0].duration)].concat(r).concat(e.mvex(t)))},e.mvex=function(t){for(var n=t.length,r=[];n--;)r[n]=e.trex(t[n]);return e.box.apply(null,[e.types.mvex].concat(r))},e.mvhd=function(t,n){n*=t;var r=Math.floor(n/(1+Ji));n=Math.floor(n%(1+Ji)),t=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,r>>24,r>>16&255,r>>8&255,255&r,n>>24,n>>16&255,n>>8&255,255&n,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return e.box(e.types.mvhd,t)},e.sdtp=function(t){for(var n,r=t.samples||[],i=new Uint8Array(4+r.length),a=0;a<r.length;a++)n=r[a].flags,i[a+4]=n.dependsOn<<4|n.isDependedOn<<2|n.hasRedundancy;return e.box(e.types.sdtp,i)},e.stbl=function(t){return e.box(e.types.stbl,e.stsd(t),e.box(e.types.stts,e.STTS),e.box(e.types.stsc,e.STSC),e.box(e.types.stsz,e.STSZ),e.box(e.types.stco,e.STCO))},e.avc1=function(t){for(var n,r,i=[],a=[],s=0;s<t.sps.length;s++)r=(n=t.sps[s]).byteLength,i.push(r>>>8&255),i.push(255&r),i=i.concat(Array.prototype.slice.call(n));for(s=0;s<t.pps.length;s++)r=(n=t.pps[s]).byteLength,a.push(r>>>8&255),a.push(255&r),a=a.concat(Array.prototype.slice.call(n));var o=e.box(e.types.avcC,new Uint8Array([1,i[3],i[4],i[5],255,224|t.sps.length].concat(i).concat([t.pps.length]).concat(a))),u=t.width,l=t.height,c=t.pixelRatio[0],d=t.pixelRatio[1];return e.box(e.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,u>>8&255,255&u,l>>8&255,255&l,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o,e.box(e.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),e.box(e.types.pasp,new Uint8Array([c>>24,c>>16&255,c>>8&255,255&c,d>>24,d>>16&255,d>>8&255,255&d])))},e.esds=function(e){var t=e.config.length;return new Uint8Array([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(e.config).concat([6,1,2]))},e.audioStsd=function(e){var t=e.samplerate;return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,t>>8&255,255&t,0,0])},e.mp4a=function(t){return e.box(e.types.mp4a,e.audioStsd(t),e.box(e.types.esds,e.esds(t)))},e.mp3=function(t){return e.box(e.types[".mp3"],e.audioStsd(t))},e.ac3=function(t){return e.box(e.types["ac-3"],e.audioStsd(t),e.box(e.types.dac3,t.config))},e.stsd=function(t){return"audio"===t.type?"mp3"===t.segmentCodec&&"mp3"===t.codec?e.box(e.types.stsd,e.STSD,e.mp3(t)):"ac3"===t.segmentCodec?e.box(e.types.stsd,e.STSD,e.ac3(t)):e.box(e.types.stsd,e.STSD,e.mp4a(t)):"avc"===t.segmentCodec?e.box(e.types.stsd,e.STSD,e.avc1(t)):e.box(e.types.stsd,e.STSD,e.hvc1(t))},e.tkhd=function(t){var n=t.id,r=t.duration*t.timescale,i=t.width,a=(t=t.height,Math.floor(r/(1+Ji)));r=Math.floor(r%(1+Ji));return e.box(e.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,n>>24&255,n>>16&255,n>>8&255,255&n,0,0,0,0,a>>24,a>>16&255,a>>8&255,255&a,r>>24,r>>16&255,r>>8&255,255&r,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,i>>8&255,255&i,0,0,t>>8&255,255&t,0,0]))},e.traf=function(t,n){var r=e.sdtp(t),i=t.id,a=Math.floor(n/(1+Ji));n=Math.floor(n%(1+Ji));return e.box(e.types.traf,e.box(e.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,255&i])),e.box(e.types.tfdt,new Uint8Array([1,0,0,0,a>>24,a>>16&255,a>>8&255,255&a,n>>24,n>>16&255,n>>8&255,255&n])),e.trun(t,r.length+16+20+8+16+8+8),r)},e.trak=function(t){return t.duration=t.duration||4294967295,e.box(e.types.trak,e.tkhd(t),e.mdia(t))},e.trex=function(t){return t=t.id,e.box(e.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},e.trun=function(t,n){var r,i,a,s,o,u=t.samples||[],l=u.length,c=12+16*l,d=new Uint8Array(c);for(d.set(["video"===t.type?1:0,0,15,1,l>>>24&255,l>>>16&255,l>>>8&255,255&l,(n+=8+c)>>>24&255,n>>>16&255,n>>>8&255,255&n],0),r=0;r<l;r++)i=(o=u[r]).duration,a=o.size,s=o.flags,o=o.cts,d.set([i>>>24&255,i>>>16&255,i>>>8&255,255&i,a>>>24&255,a>>>16&255,a>>>8&255,255&a,s.isLeading<<2|s.dependsOn,s.isDependedOn<<6|s.hasRedundancy<<4|s.paddingValue<<1|s.isNonSync,61440&s.degradPrio,15&s.degradPrio,o>>>24&255,o>>>16&255,o>>>8&255,255&o],12+16*r);return e.box(e.types.trun,d)},e.initSegment=function(t){return e.types||e.init(),t=e.moov(t),Y(e.FTYP,t)},e.hvc1=function(t){for(var n=t.params,r=[t.vps,t.sps,t.pps],i=(n=new Uint8Array([1,n.general_profile_space<<6|(n.general_tier_flag?32:0)|n.general_profile_idc,n.general_profile_compatibility_flags[0],n.general_profile_compatibility_flags[1],n.general_profile_compatibility_flags[2],n.general_profile_compatibility_flags[3],n.general_constraint_indicator_flags[0],n.general_constraint_indicator_flags[1],n.general_constraint_indicator_flags[2],n.general_constraint_indicator_flags[3],n.general_constraint_indicator_flags[4],n.general_constraint_indicator_flags[5],n.general_level_idc,240|n.min_spatial_segmentation_idc>>8,255&n.min_spatial_segmentation_idc,252|n.parallelismType,252|n.chroma_format_idc,248|n.bit_depth_luma_minus8,248|n.bit_depth_chroma_minus8,0,parseInt(n.frame_rate.fps),3|n.temporal_id_nested<<2|n.num_temporal_layers<<3|(n.frame_rate.fixed?64:0),r.length])).length,a=0;a<r.length;a+=1){i+=3;for(var s=0;s<r[a].length;s+=1)i+=2+r[a][s].length}for(var o=new Uint8Array(i),u=(o.set(n,0),i=n.length,r.length-1),l=0;l<r.length;l+=1){o.set(new Uint8Array([32+l|(l===u?128:0),0,r[l].length]),i),i+=3;for(var c=0;c<r[l].length;c+=1)o.set(new Uint8Array([r[l][c].length>>8,255&r[l][c].length]),i),i+=2,o.set(r[l][c],i),i+=r[l][c].length}n=e.box(e.types.hvcC,o);var d=t.width,h=t.height,f=t.pixelRatio[0];t=t.pixelRatio[1];return e.box(e.types.hvc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,d>>8&255,255&d,h>>8&255,255&h,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),n,e.box(e.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),e.box(e.types.pasp,new Uint8Array([f>>24,f>>16&255,f>>8&255,255&f,t>>24,t>>16&255,t>>8&255,255&t])))},e}(),Zi=(Qi.types=void 0,Qi.HDLR_TYPES=void 0,Qi.STTS=void 0,Qi.STSC=void 0,Qi.STCO=void 0,Qi.STSZ=void 0,Qi.VMHD=void 0,Qi.SMHD=void 0,Qi.STSD=void 0,Qi.FTYP=void 0,Qi.DINF=void 0,9e4),ea=null,ta=null,na=function(){function e(e,t,n,r){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=e,this.config=t,this.typeSupported=n,this.ISGenerated=!1,null===ea&&(e=(navigator.userAgent||"").match(/Chrome\/(\d+)/i),ea=e?parseInt(e[1]):0),null===ta&&(t=navigator.userAgent.match(/Safari\/(\d+)/i),ta=t?parseInt(t[1]):0)}var t=e.prototype;return t.destroy=function(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null},t.resetTimeStamp=function(e){Qn.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e},t.resetNextTimestamp=function(){Qn.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},t.resetInitSegment=function(){Qn.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0},t.getVideoStartPts=function(e){var t=!1;e=e.reduce((function(e,n){var r=n.pts-e;return r<-4294967296?(t=!0,wt(e,n.pts)):0<r?e:n.pts}),e[0].pts);return t&&Qn.debug("PTS rollover detected"),e},t.remux=function(e,t,n,r,i,a,s,o){var u,l,c,d,h,f,p,v=i,m=i,g=-1<e.pid,y=-1<t.pid,_=t.samples.length,b=0<e.samples.length,T=s&&0<_||1<_;return((!g||b)&&(!y||T)||this.ISGenerated||s)&&(this.ISGenerated?!(g=this.videoTrackConfig)||t.width===g.width&&t.height===g.height&&(null==(s=t.pixelRatio)?void 0:s[0])===(null==(s=g.pixelRatio)?void 0:s[0])&&(null==(s=t.pixelRatio)?void 0:s[1])===(null==(s=g.pixelRatio)?void 0:s[1])||this.resetInitSegment():c=this.generateIS(e,t,i,a),g=this.isVideoContiguous,s=-1,T&&(s=function(e){for(var t=0;t<e.length;t++)if(e[t].key)return t;return-1}(t.samples),!g)&&this.config.forceKeyFrameOnDiscontinuity&&(p=!0,0<s?(Qn.warn("[mp4-remuxer]: Dropped "+s+" out of "+_+" video samples due to a missing keyframe"),f=this.getVideoStartPts(t.samples),t.samples=t.samples.slice(s),t.dropped+=s,f=m+=(t.samples[0].pts-f)/t.inputTimeScale):-1===s&&(Qn.warn("[mp4-remuxer]: No keyframe found out of "+_+" video samples"),p=!1)),this.ISGenerated)&&(b&&T&&(_=this.getVideoStartPts(t.samples),_=(wt(e.samples[0].pts,_)-_)/t.inputTimeScale,v+=Math.max(0,_),m+=Math.max(0,-_)),b?(e.samplerate||(Qn.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),c=this.generateIS(e,t,i,a)),l=this.remuxAudio(e,v,this.isAudioContiguous,a,y||T||o===Fr?m:void 0),T&&(_=l?l.endPTS-l.startPTS:0,t.inputTimeScale||(Qn.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),c=this.generateIS(e,t,i,a)),u=this.remuxVideo(t,m,g,_))):T&&(u=this.remuxVideo(t,m,g,0)),u)&&(u.firstKeyFrame=s,u.independent=-1!==s,u.firstKeyFramePTS=f),{audio:l,video:u,initSegment:c,independent:p,text:d=this.ISGenerated&&this._initPTS&&this._initDTS&&(n.samples.length&&(h=Ct(n,i,this._initPTS,this._initDTS)),r.samples.length)?At(r,i,this._initPTS):d,id3:h}},t.generateIS=function(e,t,n,r){var i,a,s,o=e.samples,u=t.samples,l=this.typeSupported,c={},d=this._initPTS,h="audio/mp4";if((r=!d||r)&&(a=i=1/0),e.config&&o.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":l.mpeg?(h="audio/mpeg",e.codec=""):l.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3"}c.audio={id:"audio",container:h,codec:e.codec,initSegment:"mp3"===e.segmentCodec&&l.mpeg?new Uint8Array(0):Qi.initSegment([e]),metadata:{channelCount:e.channelCount}},r&&(s=e.inputTimeScale,d&&s===d.timescale?r=!1:a=i=o[0].pts-Math.round(s*n))}if(t.sps&&t.pps&&u.length&&(t.timescale=t.inputTimeScale,c.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:Qi.initSegment([t]),metadata:{width:t.width,height:t.height}},r&&(s=t.inputTimeScale,d&&s===d.timescale?r=!1:(o=this.getVideoStartPts(u),d=Math.round(s*n),i=Math.min(i,wt(u[0].dts,o)-d),a=Math.min(a,o-d))),this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}),Object.keys(c).length)return this.ISGenerated=!0,r?(this._initPTS={baseTime:a,timescale:s},this._initDTS={baseTime:i,timescale:s}):a=s=void 0,{tracks:c,initPTS:a,timescale:s}},t.remuxVideo=function(e,t,n,r){for(var i=e.inputTimeScale,a=e.samples,s=[],o=a.length,u=this._initPTS,c=this.nextAvcDts,d=8,h=this.videoSampleDuration,f=Number.POSITIVE_INFINITY,p=Number.NEGATIVE_INFINITY,v=!1,m=(n&&null!==c||(S=t*i,T=a[0].pts-wt(a[0].dts,a[0].pts),ea&&null!==c&&Math.abs(S-T-c)<15e3?n=!0:c=S-T),u.baseTime*i/u.timescale),g=0;g<o;g++){var y=a[g];y.pts=wt(y.pts-m,c),y.dts=wt(y.dts-m,c),y.dts<a[0<g?g-1:g].dts&&(v=!0)}v&&a.sort((function(e,t){var n=e.dts-t.dts;e=e.pts-t.pts;return n||e})),S=a[0].dts;var _=(T=a[a.length-1].dts-S)?Math.round(T/(o-1)):h||e.inputTimeScale/30;if(n){var b=S-c,T=b<-1;if(((u=_<b)||T)&&(u?Qn.warn((e.segmentCodec||"").toUpperCase()+": "+kt(b,!0)+" ms ("+b+"dts) hole between fragments detected at "+t.toFixed(3)):Qn.warn((e.segmentCodec||"").toUpperCase()+": "+kt(-b,!0)+" ms ("+b+"dts) overlapping between fragments detected at "+t.toFixed(3)),!T||c>=a[0].pts||ea)){var S=c,E=a[0].pts-b;if(u)a[0].dts=S,a[0].pts=E;else for(var k=!0,w=0;w<a.length&&!(a[w].dts>E&&k);w++){var C,A=a[w].pts;a[w].dts-=b,a[w].pts-=b,w<a.length-1&&(k=(C=a[w+1].pts)<=a[w].pts==C<=A)}Qn.log("Video: Initial PTS/DTS adjusted: "+kt(E,!0)+"/"+kt(S,!0)+", delta: "+kt(b,!0)+" ms")}}for(var L=0,R=0,x=S=Math.max(0,S),I=0;I<o;I++){for(var O=a[I],D=O.units,P=D.length,M=0,j=0;j<P;j++)M+=D[j].data.length;R+=M,L+=P,O.length=M,O.dts<x?(O.dts=x,x+=_/4|0||1):x=O.dts,f=Math.min(O.pts,f),p=Math.max(O.pts,p)}n=a[o-1].dts;var U;t=R+4*L+8;try{U=new Uint8Array(t)}catch(e){return void this.observer.emit(zn.ERROR,zn.ERROR,{type:Wn.MUX_ERROR,details:Kn.REMUX_ALLOC_ERROR,fatal:!1,error:e,bytes:t,reason:"fail allocating video mdat "+t})}for(var B=new DataView(U.buffer),F=(B.setUint32(0,t),U.set(Qi.types.mdat,4),!1),N=Number.POSITIVE_INFINITY,G=Number.POSITIVE_INFINITY,V=Number.NEGATIVE_INFINITY,H=Number.NEGATIVE_INFINITY,z=0;z<o;z++){for(var W=a[z],K=W.units,q=0,$=0,Y=K.length;$<Y;$++){var X=(J=K[$]).data,J=J.data.byteLength;B.setUint32(d,J),d+=4,U.set(X,d),d+=J,q+=4+J}var Q,Z=void 0,ee=(z<o-1?(h=a[z+1].dts-W.dts,Z=a[z+1].pts-W.pts):(ee=this.config,Q=0<z?W.dts-a[z-1].dts:_,Z=0<z?W.pts-a[z-1].pts:_,ee.stretchShortVideoTrack&&null!==this.nextAudioPts&&Math.floor(ee.maxBufferHole*i)<(ee=(r?f+r*i:this.nextAudioPts)-W.pts)?((h=ee-Q)<0?h=Q:F=!0,Qn.log("[mp4-remuxer]: It is approximately "+ee/90+" ms to the next segment; using duration "+h/90+" ms for the last video frame.")):h=Q),Math.round(W.pts-W.dts));N=Math.min(N,h),V=Math.max(V,h),G=Math.min(G,Z),H=Math.max(H,Z);s.push(new ra(W.key,h,q,ee))}if(s.length)if(ea)ea<70&&((T=s[0].flags).dependsOn=2,T.isNonSync=0);else if(ta&&H-G<V-N&&_/V<.025&&0===s[0].cts){Qn.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");for(var te=S,ne=0,re=s.length;ne<re;ne++){var ie,ae=te+s[ne].duration,se=te+s[ne].cts;ne<re-1?(ie=ae+s[ne+1].cts,s[ne].duration=ie-se):s[ne].duration=ne?s[ne-1].duration:_,s[ne].cts=0,te=ae}}return this.nextAvcDts=c=n+(h=F||!h?_:h),this.videoSampleDuration=h,this.isVideoContiguous=!0,u={data1:Qi.moof(e.sequenceNumber++,S,l({},e,{samples:s})),data2:U,startPTS:f/i,endPTS:(p+h)/i,startDTS:S/i,endDTS:c/i,type:"video",hasAudio:!1,hasVideo:!0,nb:s.length,dropped:e.dropped},e.samples=[],e.dropped=0,u},t.getSamplesPerFrame=function(e){switch(e.segmentCodec){case"mp3":return 1152;case"ac3":return 1536;default:return 1024}},t.remuxAudio=function(e,t,n,r,i){var a=e.inputTimeScale,s=a/(e.samplerate||a),o=this.getSamplesPerFrame(e),u=o*s,c=this._initPTS,d="mp3"===e.segmentCodec&&this.typeSupported.mpeg,h=[],f=void 0!==i,p=e.samples,v=d?0:8,m=this.nextAudioPts||-1,g=t*a,y=c.baseTime*a/c.timescale;if(this.isAudioContiguous=n=n||p.length&&0<m&&(r&&Math.abs(g-m)<9e3||Math.abs(wt(p[0].pts-y,g)-m)<20*u),p.forEach((function(e){e.pts=wt(e.pts-y,g)})),!n||m<0){if(!(p=p.filter((function(e){return 0<=e.pts}))).length)return;m=0===i?0:r&&!f?Math.max(0,g):p[0].pts}if("aac"===e.segmentCodec)for(var _=this.config.maxAudioFramesDrift,b=0,T=m;b<p.length;b++){var S=p[b],E=S.pts,k=E-T,w=Math.abs(1e3*k/a);if(k<=-_*u&&f)0===b&&(Qn.warn("Audio frame @ "+(E/a).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*k/a)+" ms."),this.nextAudioPts=m=T=E);else if(_*u<=k&&w<1e4&&f){var C=Math.round(k/u);(T=E-C*u)<0&&(C--,T+=u),0===b&&(this.nextAudioPts=m=T),Qn.warn("[mp4-remuxer]: Injecting "+C+" audio frame @ "+(T/a).toFixed(3)+"s due to "+Math.round(1e3*k/a)+" ms gap.");for(var A=0;A<C;A++){var L=Math.max(T,0),R=Xi.getSilentFrame(e.parsedCodec||e.manifestCodec||e.codec,e.channelCount);R||(Qn.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),R=S.unit.subarray()),p.splice(b,0,{unit:R,pts:L}),T+=u,b++}}S.pts=T,T+=u}for(var x,I=null,O=null,D=0,P=p.length;P--;)D+=p[P].unit.byteLength;for(var M=0,j=p.length;M<j;M++){var U=(B=p[M]).unit,B=B.pts;if(null!==O)h[M-1].duration=Math.round((B-O)/s);else{if(I=B=n&&"aac"===e.segmentCodec?m:B,!(0<D))return;D+=v;try{x=new Uint8Array(D)}catch(e){return void this.observer.emit(zn.ERROR,zn.ERROR,{type:Wn.MUX_ERROR,details:Kn.REMUX_ALLOC_ERROR,fatal:!1,error:e,bytes:D,reason:"fail allocating audio mdat "+D})}d||(new DataView(x.buffer).setUint32(0,D),x.set(Qi.types.mdat,4))}x.set(U,v),v+=U=U.byteLength,h.push(new ra(!0,o,U,0)),O=B}if(t=h.length)return c=h[h.length-1],this.nextAudioPts=m=O+s*c.duration,c={data1:d?new Uint8Array(0):Qi.moof(e.sequenceNumber++,I/s,l({},e,{samples:h})),data2:x,startPTS:i=I/a,endPTS:r=m/a,startDTS:i,endDTS:r,type:"audio",hasAudio:!0,hasVideo:!(e.samples=[]),nb:t},this.isAudioContiguous=!0,c},t.remuxEmptyAudio=function(e,t,n,r){var i=e.inputTimeScale,a=e.samplerate||i,s=this.nextAudioPts,o=9e4*(o=this._initDTS).baseTime/o.timescale,u=(null!==s?s:r.startDTS*i)+o,l=(s=r.endDTS*i+o,i/a*1024),c=Math.ceil((s-u)/l),d=Xi.getSilentFrame(e.parsedCodec||e.manifestCodec||e.codec,e.channelCount);if(Qn.warn("[mp4-remuxer]: remux empty Audio"),d){for(var h=[],f=0;f<c;f++){var p=u+f*l;h.push({unit:d,pts:p,dts:p})}return e.samples=h,this.remuxAudio(e,t,n,!1)}Qn.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec")},e}(),ra=function(e,t,n,r){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=t,this.size=n,this.cts=r,this.flags={isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:e?2:1,isNonSync:e?0:1}},ia=function(){function e(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null}var t=e.prototype;return t.destroy=function(){},t.resetTimeStamp=function(e){this.initPTS=e,this.lastEndTime=null},t.resetNextTimestamp=function(){this.lastEndTime=null},t.resetInitSegment=function(e,t,n,r){var i;this.audioCodec=t,this.videoCodec=n,this.generateInitSegment((t=r,(n=e)&&t&&(i=t.keyId)&&t.isCommonEncryption&&H(n,["moov","trak"]).forEach((function(e){e=H(e,["mdia","minf","stbl","stsd"])[0].subarray(8);var t=H(e,["enca"]),n=0<t.length;(t=n?t:H(e,["encv"])).forEach((function(e){H(n?e.subarray(28):e.subarray(78),["sinf"]).forEach((function(e){var t;(e=$(e))&&!(t=e.subarray(8,24)).some((function(e){return 0!==e}))&&(Qn.log("[eme] Patching keyId in 'enc"+(n?"a":"v")+">sinf>>tenc' box: "+yr(t)+" -> "+yr(i)),e.set(i,8))}))}))})),n)),this.emitInitSegment=!0},t.generateInitSegment=function(e){var t,n,r=this.audioCodec,i=this.videoCodec;null!=e&&e.byteLength?((t=this.initData=z(e)).audio&&(r=Lt(t.audio,er)),t.video&&(i=Lt(t.video,tr)),n={},t.audio&&t.video?n.audiovideo={container:"video/mp4",codec:r+","+i,initSegment:e,id:"main"}:t.audio?n.audio={container:"audio/mp4",codec:r,initSegment:e,id:"audio"}:t.video?n.video={container:"video/mp4",codec:i,initSegment:e,id:"main"}:Qn.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=n):(this.initTracks=void 0,this.initData=void 0)},t.remux=function(e,t,n,r,i,a){var s,o,u,l,c,d,h,f=this.initPTS,p=this.lastEndTime,v={audio:void 0,video:void 0,text:r,id3:n,initSegment:void 0};return null!=(t=(Gn(p)||(p=this.lastEndTime=i||0),t.samples))&&t.length&&(s={initPTS:void 0,timescale:1},null!=(h=this.initData)&&h.length||(this.generateInitSegment(t),h=this.initData),null!=h&&h.length?(this.emitInitSegment&&(s.tracks=this.initTracks,this.emitInitSegment=!1),c=function(e,t){for(var n=0,r=0,i=0,a=H(e,["moof","traf"]),s=0;s<a.length;s++){var o=a[s],u=H(o,["tfhd"])[0],l=t[F(u,4)];if(l)for(var c=l.default,d=F(u,0)|(null==c?void 0:c.flags),h=null==c?void 0:c.duration,f=(8&d&&(h=F(u,2&d?12:8)),l.timescale||9e4),p=H(o,["trun"]),v=0;v<p.length;v++)!(n=function(e){var t=F(e,0),n=8;1&t&&(n+=4),4&t&&(n+=4);for(var r=0,i=F(e,4),a=0;a<i;a++)256&t&&(r+=F(e,n),n+=4),512&t&&(n+=4),1024&t&&(n+=4),2048&t&&(n+=4);return r}(p[v]))&&h&&(n=h*F(p[v],4)),l.type===tr?r+=n/f:l.type===er&&(i+=n/f)}if(0===r&&0===i){for(var m=1/0,g=0,y=0,_=H(e,["sidx"]),b=0;b<_.length;b++){var T,S=function(e){var t=[],n=e[0],r=8,i=F(e,r),a=(r+=4,0),s=0,o=(0===n?(a=F(e,r),s=F(e,r+4),r+=8):(a=N(e,r),s=N(e,r+8),r+=16),e.length+s),u=B(e,r+=2);r+=2;for(var l=0;l<u;l++){var c=r,d=F(e,c),h=(c+=4,2147483647&d);if(1==(2147483648&d)>>>31)return Qn.warn("SIDX has hierarchical references (not supported)"),null;d=F(e,c),c+=4,t.push({referenceSize:h,subsegmentDuration:d,info:{duration:d/i,start:o,end:o+h-1}}),o+=h,r=c+=4}return{earliestPresentationTime:a,timescale:i,version:n,referencesCount:u,references:t}}(_[b]);null!=S&&S.references&&(m=Math.min(m,S.earliestPresentationTime/S.timescale),T=S.references.reduce((function(e,t){return e+t.info.duration||0}),0),y=(g=Math.max(g,T+S.earliestPresentationTime/S.timescale))-m)}if(y&&Gn(y))return y}return r||i}(t,h),o=h,(function(e,t,n,r){return null===e?1:(r=Math.max(r,1),t-=e.baseTime/e.timescale,Math.abs(t-n)>r)}(f,d=null===(d=H(t,["moof","traf"]).reduce((function(e,t){var n=H(t,["tfdt"])[0],r=n[0];return null!==(t=H(t,["tfhd"]).reduce((function(e,t){if(t=F(t,4),t=o[t]){var i=F(n,4);if(1===r){if(i===_r)return Qn.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),e;i=i*(1+_r)+F(n,8)}if(i/=t.timescale||9e4,Gn(i)&&(null===e||i<e))return i}return e}),null))&&Gn(t)&&(null===e||t<e)?t:e}),null))?i:d,i,c)||s.timescale!==f.timescale&&a)&&(s.initPTS=d-i,f&&1===f.timescale&&Qn.warn("Adjusting initPTS by "+(s.initPTS-f.baseTime)),this.initPTS=f={baseTime:s.initPTS,timescale:1}),e=(a=e?d-f.baseTime/f.timescale:p)+c,u=h,l=f.baseTime/f.timescale,H(t,["moof","traf"]).forEach((function(e){H(e,["tfhd"]).forEach((function(t){var n;t=F(t,4);(t=u[t])&&(n=t.timescale||9e4,H(e,["tfdt"]).forEach((function(e){var t,r=e[0],i=l*n;i&&(t=F(e,4),0===r?(t-=i,V(e,4,t=Math.max(t,0))):(t=(t*=Math.pow(2,32))+F(e,8)-i,t=Math.max(t,0),r=Math.floor(t/(1+_r)),i=Math.floor(t%(1+_r)),V(e,4,r),V(e,8,i)))})))}))})),0<c?this.lastEndTime=e:(Qn.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp()),d="",(p=!!h.audio)&&(d+="audio"),(c=!!h.video)&&(d+="video"),v.audio="audio"===(h={data1:t,startPTS:a,startDTS:a,endPTS:e,endDTS:e,type:d,hasAudio:p,hasVideo:c,nb:1,dropped:0}).type?h:void 0,v.video="audio"!==h.type?h:void 0,v.initSegment=s,v.id3=Ct(n,i,f,f),r.samples.length&&(v.text=At(r,i,f))):Qn.warn("[passthrough-remuxer.ts]: Failed to generate initSegment.")),v},e}();try{Fn=self.performance.now.bind(self.performance)}catch(jt){Qn.debug("Unable to use Performance API on this environment"),Fn=null==ur?void 0:ur.Date.now}var aa,sa,oa=[{demux:Vi,remux:ia},{demux:zi,remux:na},{demux:Ni,remux:na},{demux:Di,remux:na}],ua=(oa.splice(2,0,{demux:Hi,remux:na}),function(){function e(e,t,n,r,i){this.async=!1,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=e,this.typeSupported=t,this.config=n,this.vendor=r,this.id=i}var t=e.prototype;return t.configure=function(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()},t.push=function(e,t,n,r){var i=this,a=n.transmuxing,s=(e=(a.executeStart=Fn(),new Uint8Array(e)),this.currentTransmuxState),o=this.transmuxConfig,u=(s=(r=(r&&(this.currentTransmuxState=r),r||s)).contiguous,r.discontinuity),l=r.trackSwitch,c=r.accurateTimeOffset,d=r.timeOffset,h=(r=r.initSegmentChange,o.audioCodec),f=o.videoCodec,p=o.defaultInitPts,v=o.duration,m=(o=o.initSegmentData,function(e,t){var n=null;return 0<e.byteLength&&null!=(null==t?void 0:t.key)&&null!==t.iv&&null!=t.method&&(n=t),n}(e,t));if(m&&E(m.method)){var g=this.getDecrypter(),y=k(m.method);if(!g.isSync())return this.decryptionPromise=g.webCryptoDecrypt(e,m.key.buffer,m.iv.buffer,y).then((function(e){return e=i.push(e,null,n),i.decryptionPromise=null,e})),this.decryptionPromise;if(y=g.softwareDecrypt(e,m.key.buffer,m.iv.buffer,y),!(y=-1<n.part?g.flush():y))return a.executeEnd=Fn(),la(n);e=new Uint8Array(y)}return(g=this.needsProbing(u,l))&&(y=this.configureTransmuxer(e))?(Qn.warn("[transmuxer] "+y.message),this.observer.emit(zn.ERROR,zn.ERROR,{type:Wn.MEDIA_ERROR,details:Kn.FRAG_PARSING_ERROR,fatal:!1,error:y,reason:y.message}),a.executeEnd=Fn(),la(n)):((u||l||r||g)&&this.resetInitSegment(o,h,f,v,t),(u||r||g)&&this.resetInitialTimestamp(p),s||this.resetContiguity(),y=this.transmux(e,m,d,c,n),(l=this.currentTransmuxState).contiguous=!0,l.discontinuity=!1,l.trackSwitch=!1,a.executeEnd=Fn(),y)},t.flush=function(e){var t,n=this,r=e.transmuxing,i=(r.executeStart=Fn(),this.decrypter),a=this.currentTransmuxState,s=this.decryptionPromise;return s?s.then((function(){return n.flush(e)})):(t=[],s=a.timeOffset,i&&(a=i.flush())&&t.push(this.push(a,null,e)),i=this.demuxer,a=this.remuxer,i&&a?Rt(a=i.flush(s))?a.then((function(r){return n.flushRemux(t,r,e),t})):(this.flushRemux(t,a,e),t):(r.executeEnd=Fn(),[la(e)]))},t.flushRemux=function(e,t,n){var r=t.audioTrack,i=t.videoTrack,a=t.id3Track,s=(t=t.textTrack,(o=this.currentTransmuxState).accurateTimeOffset),o=o.timeOffset;Qn.log("[transmuxer.ts]: Flushed fragment "+n.sn+(-1<n.part?" p: "+n.part:"")+" of level "+n.level),r=this.remuxer.remux(r,i,a,t,o,s,!0,this.id);e.push({remuxResult:r,chunkMeta:n}),n.transmuxing.executeEnd=Fn()},t.resetInitialTimestamp=function(e){var t=this.demuxer,n=this.remuxer;t&&n&&(t.resetTimeStamp(e),n.resetTimeStamp(e))},t.resetContiguity=function(){var e=this.demuxer,t=this.remuxer;e&&t&&(e.resetContiguity(),t.resetNextTimestamp())},t.resetInitSegment=function(e,t,n,r,i){var a=this.demuxer,s=this.remuxer;a&&s&&(a.resetInitSegment(e,t,n,r),s.resetInitSegment(e,t,n,i))},t.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},t.transmux=function(e,t,n,r,i){return t&&"SAMPLE-AES"===t.method?this.transmuxSampleAes(e,t,n,r,i):this.transmuxUnencrypted(e,n,r,i)},t.transmuxUnencrypted=function(e,t,n,r){var i=(e=this.demuxer.demux(e,t,!1,!this.config.progressive)).audioTrack,a=e.videoTrack,s=e.id3Track;e=e.textTrack;return{remuxResult:this.remuxer.remux(i,a,s,e,t,n,!1,this.id),chunkMeta:r}},t.transmuxSampleAes=function(e,t,n,r,i){var a=this;return this.demuxer.demuxSampleAes(e,t,n).then((function(e){return{remuxResult:a.remuxer.remux(e.audioTrack,e.videoTrack,e.id3Track,e.textTrack,n,r,!1,a.id),chunkMeta:i}}))},t.configureTransmuxer=function(e){for(var t,n,r=this.config,i=this.observer,a=this.typeSupported,s=this.vendor,o=0,u=oa.length;o<u;o++)if(null!=(n=oa[o].demux)&&n.probe(e)){t=oa[o];break}if(!t)return new Error("Failed to find demuxer by probing fragment data");var l=this.demuxer,c=this.remuxer,d=t.remux,h=t.demux;c&&c instanceof d||(this.remuxer=new d(i,r,a,s)),l&&l instanceof h||(this.demuxer=new h(i,r,a),this.probe=h.probe)},t.needsProbing=function(e,t){return!this.demuxer||!this.remuxer||e||t},t.getDecrypter=function(){return this.decrypter||(this.decrypter=new _i(this.config))},e}()),la=function(e){return{remuxResult:{},chunkMeta:e}};ia=Vi={exports:{}},aa=Object.prototype.hasOwnProperty,sa="~",Object.create&&(Ot.prototype=Object.create(null),(new Ot).__proto__||(sa=!1)),jt.prototype.eventNames=function(){var e,t,n=[];if(0===this._eventsCount)return n;for(t in e=this._events)aa.call(e,t)&&n.push(sa?t.slice(1):t);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},jt.prototype.listeners=function(e){e=sa?sa+e:e;var t=this._events[e];if(!t)return[];if(t.fn)return[t.fn];for(var n=0,r=t.length,i=new Array(r);n<r;n++)i[n]=t[n].fn;return i},jt.prototype.listenerCount=function(e){return e=sa?sa+e:e,(e=this._events[e])?e.fn?1:e.length:0},jt.prototype.emit=function(e,t,n,r,i,a){var s=sa?sa+e:e;if(!this._events[s])return!1;var o,u=this._events[s],l=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),l){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,r),!0;case 5:return u.fn.call(u.context,t,n,r,i),!0;case 6:return u.fn.call(u.context,t,n,r,i,a),!0}for(h=1,o=new Array(l-1);h<l;h++)o[h-1]=arguments[h];u.fn.apply(u.context,o)}else for(var c,d=u.length,h=0;h<d;h++)switch(u[h].once&&this.removeListener(e,u[h].fn,void 0,!0),l){case 1:u[h].fn.call(u[h].context);break;case 2:u[h].fn.call(u[h].context,t);break;case 3:u[h].fn.call(u[h].context,t,n);break;case 4:u[h].fn.call(u[h].context,t,n,r);break;default:if(!o)for(c=1,o=new Array(l-1);c<l;c++)o[c-1]=arguments[c];u[h].fn.apply(u[h].context,o)}return!0},jt.prototype.on=function(e,t,n){return Pt(this,e,t,n,!1)},jt.prototype.once=function(e,t,n){return Pt(this,e,t,n,!0)},jt.prototype.removeListener=function(e,t,n,r){if(e=sa?sa+e:e,this._events[e])if(t){var i=this._events[e];if(i.fn)i.fn!==t||r&&!i.once||n&&i.context!==n||Mt(this,e);else{for(var a=0,s=[],o=i.length;a<o;a++)(i[a].fn!==t||r&&!i[a].once||n&&i[a].context!==n)&&s.push(i[a]);s.length?this._events[e]=1===s.length?s[0]:s:Mt(this,e)}}else Mt(this,e);return this},jt.prototype.removeAllListeners=function(e){return e?(e=sa?sa+e:e,this._events[e]&&Mt(this,e)):(this._events=new Ot,this._eventsCount=0),this},jt.prototype.off=jt.prototype.removeListener,jt.prototype.addListener=jt.prototype.on,jt.prefixed=sa,ia.exports=jt.EventEmitter=jt;var ca,da,ha=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(Vi.exports);void 0!==s&&s&&(ca=self,(da=new ha).on(zn.FRAG_DECRYPTED,Ut),da.on(zn.ERROR,Ut),ca.addEventListener("message",(function(e){var t=e.data;switch(t.cmd){case"init":var n=JSON.parse(t.config);(function(e){for(var t in e)!function(t){e[t]=function(e){Ut("workerLog",{logType:t,message:e})}}(t)})(n=(ca.transmuxer=new ua(da,t.typeSupported,n,t.vendor,t.id),_(n.debug,t.id))),Ut("init",null);break;case"configure":ca.transmuxer.configure(t.config);break;case"demux":Rt(n=ca.transmuxer.push(t.data,t.decryptdata,t.chunkMeta,t.state))?(ca.transmuxer.async=!0,n.then((function(e){Bt(ca,e)})).catch((function(e){Ut(zn.ERROR,{type:Wn.MEDIA_ERROR,details:Kn.FRAG_PARSING_ERROR,chunkMeta:t.chunkMeta,fatal:!1,error:e,err:e,reason:"transmuxer-worker push error"})}))):(ca.transmuxer.async=!1,Bt(ca,n));break;case"flush":var r=t.chunkMeta;Rt(n=ca.transmuxer.flush(r))||ca.transmuxer.async?(n=Rt(n)?n:Promise.resolve(n)).then((function(e){Nt(ca,e,r)})).catch((function(e){Ut(zn.ERROR,{type:Wn.MEDIA_ERROR,details:Kn.FRAG_PARSING_ERROR,chunkMeta:t.chunkMeta,fatal:!1,error:e,err:e,reason:"transmuxer-worker flush error"})})):Nt(ca,n,r)}})));var fa,pa,va=function(){function e(e,t,n,r){function i(e,t){(t=t||{}).frag=u.frag,t.id=u.id,e===zn.ERROR&&(u.error=t.error),u.hls.trigger(e,t)}var s,o,u=this,l=(this.error=null,this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.workerContext=null,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,e.config);this.hls=e,this.id=t,this.useWorker=!!l.enableWorker,this.onTransmuxComplete=n,this.onFlush=r,this.observer=new ha,this.observer.on(zn.FRAG_DECRYPTED,i),this.observer.on(zn.ERROR,i),n={mpeg:(e=re(e=l.preferManagedMediaSource)||{isTypeSupported:function(){return!1}}).isTypeSupported("audio/mpeg"),mp3:e.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:e.isTypeSupported('audio/mp4; codecs="ac-3"')},r=navigator.vendor;if(!this.useWorker||"undefined"==typeof Worker||(l.workerPath,0))this.transmuxer=new ua(this.observer,n,l,r,t);else try{l.workerPath?(Qn.log("loading Web Worker "+l.workerPath+' for "'+t+'"'),this.workerContext=(o=l.workerPath,o=new self.URL(o,self.location.href).href,{worker:new self.Worker(o),scriptURL:o})):(Qn.log('injecting Web Worker for "'+t+'"'),this.workerContext=(s=new self.Blob(["var exports={};var module={exports:exports};function define(f){f()};define.amd=true;("+a.toString()+")(true);"],{type:"text/javascript"}),s=self.URL.createObjectURL(s),{worker:new self.Worker(s),objectURL:s})),this.onwmsg=function(e){return u.onWorkerMessage(e)};var c=this.workerContext.worker;c.addEventListener("message",this.onwmsg),c.onerror=function(e){e=new Error(e.message+" ("+e.filename+":"+e.lineno+")"),l.enableWorker=!1,Qn.warn('Error in "'+t+'" Web Worker, fallback to inline'),u.hls.trigger(zn.ERROR,{type:Wn.OTHER_ERROR,details:Kn.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:e})},c.postMessage({cmd:"init",typeSupported:n,vendor:r,id:t,config:JSON.stringify(l)})}catch(e){Qn.warn('Error setting up "'+t+'" Web Worker, fallback to inline',e),this.resetWorker(),this.error=null,this.transmuxer=new ua(this.observer,n,l,r,t)}}var t=e.prototype;return t.resetWorker=function(){var e,t;this.workerContext&&(e=(t=this.workerContext).worker,(t=t.objectURL)&&self.URL.revokeObjectURL(t),e.removeEventListener("message",this.onwmsg),e.onerror=null,e.terminate(),this.workerContext=null)},t.destroy=function(){this.workerContext?(this.resetWorker(),this.onwmsg=void 0):(e=this.transmuxer)&&(e.destroy(),this.transmuxer=null);var e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.observer=null,this.hls=null},t.push=function(e,t,n,r,i,a,s,o,u,l){var c=this,d=(u.transmuxing.start=self.performance.now(),this.transmuxer),h=(a||i).start,f=i.decryptdata,p=this.frag,v=!(p&&i.cc===p.cc),m=!(p&&u.level===p.level),g=p?u.sn-p.sn:-1,y=this.part?u.part-this.part.index:-1,_=0==g&&1<u.id&&u.id===(null==p?void 0:p.stats.chunkCount),b=(_=!m&&(1==g||0==g&&(1==y||_&&y<=0)),self.performance.now());g=new It(v,_,o,m,h,b=((m||g||0===i.stats.parsing.start)&&(i.stats.parsing.start=b),!a||!y&&_||(a.stats.parsing.start=b),!(p&&(null==(g=i.initSegment)?void 0:g.url)===(null==(y=p.initSegment)?void 0:y.url))));_&&!v&&!b||(Qn.log("[transmuxer-interface, "+i.type+"]: Starting new transmux session for sn: "+u.sn+" p: "+u.part+" level: "+u.level+" id: "+u.id+"\n discontinuity: "+v+"\n trackSwitch: "+m+"\n contiguous: "+_+"\n accurateTimeOffset: "+o+"\n timeOffset: "+h+"\n initSegmentChange: "+b),p=new xt(n,r,t,s,l),this.configureTransmuxer(p)),this.frag=i,this.part=a,this.workerContext?this.workerContext.worker.postMessage({cmd:"demux",data:e,decryptdata:f,chunkMeta:u,state:g},e instanceof ArrayBuffer?[e]:[]):d&&(Rt(y=d.push(e,f,u,g))?(d.async=!0,y.then((function(e){c.handleTransmuxComplete(e)})).catch((function(e){c.transmuxerError(e,u,"transmuxer-interface push error")}))):(d.async=!1,this.handleTransmuxComplete(y)))},t.flush=function(e){var t,n=this,r=(e.transmuxing.start=self.performance.now(),this.transmuxer);this.workerContext?this.workerContext.worker.postMessage({cmd:"flush",chunkMeta:e}):r&&(Rt(t=r.flush(e))||r.async?(t=Rt(t)?t:Promise.resolve(t)).then((function(t){n.handleFlushResult(t,e)})).catch((function(t){n.transmuxerError(t,e,"transmuxer-interface flush error")})):this.handleFlushResult(t,e))},t.transmuxerError=function(e,t,n){this.hls&&(this.error=e,this.hls.trigger(zn.ERROR,{type:Wn.MEDIA_ERROR,details:Kn.FRAG_PARSING_ERROR,chunkMeta:t,fatal:!1,error:e,err:e,reason:n}))},t.handleFlushResult=function(e,t){var n=this;e.forEach((function(e){n.handleTransmuxComplete(e)})),this.onFlush(t)},t.onWorkerMessage=function(e){var t=e.data,n=this.hls;switch(t.event){case"init":var r=null==(r=this.workerContext)?void 0:r.objectURL;r&&self.URL.revokeObjectURL(r);break;case"transmuxComplete":this.handleTransmuxComplete(t.data);break;case"flush":this.onFlush(t.data);break;case"workerLog":Qn[t.data.logType]&&Qn[t.data.logType](t.data.message);break;default:t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,n.trigger(t.event,t.data)}},t.configureTransmuxer=function(e){var t=this.transmuxer;this.workerContext?this.workerContext.worker.postMessage({cmd:"configure",config:e}):t&&t.configure(e)},t.handleTransmuxComplete=function(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)},e}(),ma=(zi=function(e){function t(t,n,r){return(t=e.call(this,t,n,r,"audio-stream-controller",Fr)||this).videoBuffer=null,t.videoTrackCC=-1,t.waitingVideoCC=-1,t.bufferedTrack=null,t.switchingTrack=null,t.trackId=-1,t.waitingData=null,t.mainDetails=null,t.flushing=!1,t.bufferFlushed=!1,t.cachedTrackLoadedData=null,t.registerListeners(),t}c(t,e);var r=t.prototype;return r.onHandlerDestroying=function(){this.unregisterListeners(),e.prototype.onHandlerDestroying.call(this),this.mainDetails=null,this.bufferedTrack=null,this.switchingTrack=null},r.registerListeners=function(){e.prototype.registerListeners.call(this);var t=this.hls;t.on(zn.LEVEL_LOADED,this.onLevelLoaded,this),t.on(zn.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),t.on(zn.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.on(zn.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.on(zn.BUFFER_RESET,this.onBufferReset,this),t.on(zn.BUFFER_CREATED,this.onBufferCreated,this),t.on(zn.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(zn.BUFFER_FLUSHED,this.onBufferFlushed,this),t.on(zn.INIT_PTS_FOUND,this.onInitPtsFound,this),t.on(zn.FRAG_BUFFERED,this.onFragBuffered,this)},r.unregisterListeners=function(){var t=this.hls;t&&(e.prototype.unregisterListeners.call(this),t.off(zn.LEVEL_LOADED,this.onLevelLoaded,this),t.off(zn.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),t.off(zn.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.off(zn.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.off(zn.BUFFER_RESET,this.onBufferReset,this),t.off(zn.BUFFER_CREATED,this.onBufferCreated,this),t.off(zn.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(zn.BUFFER_FLUSHED,this.onBufferFlushed,this),t.off(zn.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(zn.FRAG_BUFFERED,this.onFragBuffered,this))},r.onInitPtsFound=function(e,t){var n=t.frag,r=t.id,i=t.initPTS;t=t.timescale;"main"===r&&(r=n.cc,this.initPTS[n.cc]={baseTime:i,timescale:t},this.log("InitPTS for cc: "+r+" found from main: "+i),this.videoTrackCC=r,this.state===xi)&&this.tick()},r.startLoad=function(e){var t;this.levels?(t=this.lastCurrentTime,this.stopLoad(),this.setInterval(100),0<t&&-1===e?(this.log("Override startPosition with lastCurrentTime @"+t.toFixed(3)),e=t,this.state=Ti):(this.loadedmetadata=!1,this.state=wi),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()):(this.startPosition=e,this.state=bi)},r.doTick=function(){switch(this.state){case Ti:this.doTickIdle();break;case wi:var t=this.levels,n=this.trackId;if(n=null==t||null==(t=t[n])?void 0:t.details){if(this.waitForCdnTuneIn(n))break;this.state=xi}break;case ki:t=performance.now();(!(n=this.retryDate)||n<=t||null!=(n=this.media)&&n.seeking)&&(t=this.levels,n=this.trackId,this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded((null==t?void 0:t[n])||null),this.state=Ti);break;case xi:var r,i;(t=this.waitingData)?(n=t.frag,r=t.part,i=t.cache,t=t.complete,void 0!==this.initPTS[n.cc]?(this.waitingData=null,this.waitingVideoCC=-1,this.state=Ei,r={frag:n,part:r,payload:i.flush(),networkDetails:null},this._handleFragmentLoadProgress(r),t&&e.prototype._handleFragmentLoadComplete.call(this,r)):this.videoTrackCC!==this.waitingVideoCC?(this.log("Waiting fragment cc ("+n.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment()):(i=this.getLoadPosition(),Ve((t=hi.bufferInfo(this.mediaBuffer,i,this.config.maxBufferHole)).end,this.config.maxFragLookUpTolerance,n)<0&&(this.log("Waiting fragment cc ("+n.cc+") @ "+n.start+" cancelled because another fragment at "+t.end+" is needed"),this.clearWaitingFragment()))):this.state=Ti}this.onTickEnd()},r.clearWaitingFragment=function(){var e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state!==bi)&&(this.state=Ti)},r.resetLoadingState=function(){this.clearWaitingFragment(),e.prototype.resetLoadingState.call(this)},r.onTickEnd=function(){var e=this.media;null!=e&&e.readyState&&(this.lastCurrentTime=e.currentTime)},r.doTickIdle=function(){var e=this.hls,t=this.levels,n=this.media,r=this.trackId,i=e.config;if(this.buffering&&(n||!this.startFragRequested&&i.startFragPrefetch)&&null!=t&&t[r])if(!(t=(i=t[r]).details)||t.live&&this.levelLastLoaded!==i||this.waitForCdnTuneIn(t))this.state=wi;else if(r=this.mediaBuffer||this.media,this.bufferFlushed&&r&&(this.bufferFlushed=!1,this.afterBufferFlushed(r,er,Fr)),null!==(r=this.getFwdBufferInfo(r,Fr))){var a=this.bufferedTrack,s=this.switchingTrack;if(!s&&this._streamEnded(r,t))e.trigger(zn.BUFFER_EOS,{type:"audio"}),this.state=Li;else{var o=r.len,u=(e=e.maxBufferLength,t.fragments),l=u[0].start,c=this.flushing?this.getLoadPosition():r.end;if(s&&n&&(d=this.getLoadPosition(),a&&!Vt(s.attrs,a.attrs)&&(c=d),t.PTSKnown)&&d<l&&(r.end>l||r.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),n.currentTime=l+.05),!(e<=o&&!s&&c<u[u.length-1].start)){var d=!1;if((a=this.getNextFragment(c,t))&&this.isLoopLoading(a,c)&&(d=!!a.gap,a=this.getNextFragmentLoopLoading(a,t,r,Br,e)),a){if((!t.live||c<this.hls.liveSyncPosition)&&(n=this.getFwdBufferInfo(this.videoBuffer||this.media,Br))&&a.start>n.end+a.duration){if(null===(l=this.fragmentTracker.getFragAtPos(a.start,Br)))return;if(!(d=d||!!l.gap||0===n.len)||r.nextStart&&r.nextStart<l.end)return}this.loadFragment(a,i,c)}else this.bufferFlushed=!0}}}},r.onMediaDetaching=function(){this.videoBuffer=null,this.bufferFlushed=this.flushing=!1,e.prototype.onMediaDetaching.call(this)},r.onAudioTracksUpdated=function(e,t){t=t.audioTracks,this.resetTransmuxer(),this.levels=t.map((function(e){return new Xr(e)}))},r.onAudioTrackSwitching=function(e,t){var n=!!t.url,r=(this.trackId=t.id,this.fragCurrent);r&&(r.abortRequests(),this.removeUnbufferedFrags(r.start)),this.resetLoadingState(),n?(this.switchingTrack=t,this.flushAudioIfNeeded(t),this.state!==bi&&(this.setInterval(100),this.state=Ti,this.tick())):(this.resetTransmuxer(),this.switchingTrack=null,this.bufferedTrack=t,this.clearInterval())},r.onManifestLoading=function(){this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=this.flushing=!1,this.levels=this.mainDetails=this.waitingData=this.bufferedTrack=this.cachedTrackLoadedData=this.switchingTrack=null,this.startFragRequested=!1,this.trackId=this.videoTrackCC=this.waitingVideoCC=-1},r.onLevelLoaded=function(e,t){this.mainDetails=t.details,null!==this.cachedTrackLoadedData&&(this.hls.trigger(zn.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)},r.onAudioTrackLoaded=function(e,t){if(null==this.mainDetails)this.cachedTrackLoadedData=t;else{var n=this.levels,r=t.details;t=t.id;if(n){this.log("Audio track "+t+" loaded ["+r.startSN+","+r.endSN+"]"+(r.lastPartSn?"[part-"+r.lastPartSn+"-"+r.lastPartIndex+"]":"")+",duration:"+r.totalduration);n=n[t];var i=0;if(r.live||null!=(a=n.details)&&a.live){this.checkLiveUpdate(r);var a=this.mainDetails;if(r.deltaUpdateFailed||!a)return;i=!n.details&&r.hasProgramDateTime&&a.hasProgramDateTime?(nt(r,a),r.fragments[0].start):this.alignPlaylists(r,n.details,null==(a=this.levelLastLoaded)?void 0:a.details)}n.details=r,this.levelLastLoaded=n,this.startFragRequested||!this.mainDetails&&r.live||this.setStartPosition(this.mainDetails||r,i),this.state!==wi||this.waitForCdnTuneIn(r)||(this.state=Ti),this.tick()}else this.warn("Audio tracks were reset while loading level "+t)}},r._handleFragmentLoadProgress=function(e){var t,n,r,i,a=e.frag,s=e.part,o=(e=e.payload,this.config),u=this.trackId,l=this.levels;l?(l=l[u])?(t=l.details)?(o=o.defaultAudioCodec||l.audioCodec||"mp4a.40.2",l=(l=this.transmuxer)||(this.transmuxer=new va(this.hls,Fr,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this))),n=this.initPTS[a.cc],r=null==(r=a.initSegment)?void 0:r.data,void 0!==n?(i=s?s.index:-1,i=new Qe(a.level,a.sn,a.stats.chunkCount,e.byteLength,i,-1!==i),l.push(e,r,o,"",a,s,t.totalduration,!1,i,n)):(this.log("Unknown video PTS for cc "+a.cc+", waiting for video PTS before demuxing audio frag "+a.sn+" of ["+t.startSN+" ,"+t.endSN+"],track "+u),(this.waitingData=this.waitingData||{frag:a,part:s,cache:new Oi,complete:!1}).cache.push(new Uint8Array(e)),this.waitingVideoCC=this.videoTrackCC,this.state=xi)):(this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(a.start)):this.warn("Audio track is undefined on fragment load progress"):this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+a.sn+" of level "+a.level+" will not be buffered")},r._handleFragmentLoadComplete=function(t){this.waitingData?this.waitingData.complete=!0:e.prototype._handleFragmentLoadComplete.call(this,t)},r.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},r.onBufferCreated=function(e,t){var n=t.tracks.audio;n&&(this.mediaBuffer=n.buffer||null),t.tracks.video&&(this.videoBuffer=t.tracks.video.buffer||null)},r.onFragBuffered=function(e,t){var r,i=t.frag;t=t.part;i.type!==Fr?this.loadedmetadata||i.type!==Br||(r=this.videoBuffer||this.media)&&hi.getBuffered(r).length&&(this.loadedmetadata=!0):this.fragContextChanged(i)?this.warn("Fragment "+i.sn+(t?" p: "+t.index:"")+" of level "+i.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+(this.switchingTrack?this.switchingTrack.name:"false")):("initSegment"!==i.sn&&(this.fragPrevious=i,r=this.switchingTrack)&&(this.bufferedTrack=r,this.switchingTrack=null,this.hls.trigger(zn.AUDIO_TRACK_SWITCHED,n({},r))),this.fragBufferedComplete(i,t))},r.onError=function(t,n){var r;if(n.fatal)this.state=Ri;else switch(n.details){case Kn.FRAG_GAP:case Kn.FRAG_PARSING_ERROR:case Kn.FRAG_DECRYPT_ERROR:case Kn.FRAG_LOAD_ERROR:case Kn.FRAG_LOAD_TIMEOUT:case Kn.KEY_LOAD_ERROR:case Kn.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(Fr,n);break;case Kn.AUDIO_TRACK_LOAD_ERROR:case Kn.AUDIO_TRACK_LOAD_TIMEOUT:case Kn.LEVEL_PARSING_ERROR:n.levelRetry||this.state!==wi||(null==(r=n.context)?void 0:r.type)!==jr||(this.state=Ti);break;case Kn.BUFFER_APPEND_ERROR:case Kn.BUFFER_FULL_ERROR:n.parent&&"audio"===n.parent&&(n.details===Kn.BUFFER_APPEND_ERROR?this.resetLoadingState():this.reduceLengthAndFlushBuffer(n)&&(this.bufferedTrack=null,e.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")));break;case Kn.INTERNAL_EXCEPTION:this.recoverWorkerError(n)}},r.onBufferFlushing=function(e,t){t.type!==tr&&(this.flushing=!0)},r.onBufferFlushed=function(e,t){var n;(t=t.type)!==tr&&(this.flushing=!1,this.bufferFlushed=!0,this.state===Li&&(this.state=Ti),n=this.mediaBuffer||this.media)&&(this.afterBufferFlushed(n,t,Fr),this.tick())},r._handleTransmuxComplete=function(e){var t,n,r,i,a,s,o,u,c=this.hls,d=e.remuxResult,h=(e=e.chunkMeta,this.getCurrentContext(e));h?(t=h.frag,n=h.part,r=(h=h.level).details,i=d.audio,a=d.text,s=d.id3,d=d.initSegment,this.fragContextChanged(t)||!r?this.fragmentTracker.removeFragment(t):(this.state=Ci,this.switchingTrack&&i&&this.completeAudioSwitch(this.switchingTrack),null!=d&&d.tracks&&(u=t.initSegment||t,this._bufferInitSegment(h,d.tracks,u,e),c.trigger(zn.FRAG_PARSING_INIT_SEGMENT,{frag:u,id:"audio",tracks:d.tracks})),i&&(h=i.startPTS,u=i.endPTS,d=i.startDTS,o=i.endDTS,n&&(n.elementaryStreams[er]={startPTS:h,endPTS:u,startDTS:d,endDTS:o}),t.setElementaryStreamInfo(er,h,u,d,o),this.bufferFragmentData(i,t,n,e)),null!=s&&null!=(h=s.samples)&&h.length&&(u=l({id:"audio",frag:t,details:r},s),c.trigger(zn.FRAG_PARSING_METADATA,u)),a&&(d=l({id:"audio",frag:t,details:r},a),c.trigger(zn.FRAG_PARSING_USERDATA,d)))):this.resetWhenMissingContext(e)},r._bufferInitSegment=function(e,t,n,r){var i;this.state===Ci&&(t.video&&delete t.video,i=t.audio)&&(i.id="audio",e=e.audioCodec,this.log("Init audio buffer, container:"+i.container+", codecs[level/parsed]=["+e+"/"+i.codec+"]"),e&&1===e.split(",").length&&(i.levelCodec=e),this.hls.trigger(zn.BUFFER_CODECS,t),null!=(e=i.initSegment)&&e.byteLength&&(t={type:"audio",frag:n,part:null,chunkMeta:r,parent:n.type,data:e},this.hls.trigger(zn.BUFFER_APPENDING,t)),this.tickImmediate())},r.loadFragment=function(t,n,r){var i=this.fragmentTracker.getState(t);this.fragCurrent=t,this.switchingTrack||i===si||i===ui?"initSegment"===t.sn?this._loadInitSegment(t,n):null!=(i=n.details)&&i.live&&!this.initPTS[t.cc]?(this.log("Waiting for video PTS in continuity counter "+t.cc+" of live stream before loading audio fragment "+t.sn+" of level "+this.trackId),this.state=xi,(i=this.mainDetails)&&i.fragments[0].start!==n.details.fragments[0].start&&nt(n.details,i)):(this.startFragRequested=!0,e.prototype.loadFragment.call(this,t,n,r)):this.clearTrackerIfNeeded(t)},r.flushAudioIfNeeded=function(t){var n=this.media,r=this.bufferedTrack,i=null==r?void 0:r.attrs,a=t.attrs;n&&i&&(i.CHANNELS!==a.CHANNELS||r.name!==t.name||r.lang!==t.lang)&&(this.log("Switching audio track : flushing all audio"),e.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio"),this.bufferedTrack=null)},r.completeAudioSwitch=function(e){var t=this.hls;this.flushAudioIfNeeded(e),this.bufferedTrack=e,this.switchingTrack=null,t.trigger(zn.AUDIO_TRACK_SWITCHED,n({},e))},t}(ai),Ni=function(e){function t(t){return(t=e.call(this,t,"audio-track-controller")||this).tracks=[],t.groupIds=null,t.tracksInGroup=[],t.trackId=-1,t.currentTrack=null,t.selectDefaultTrack=!0,t.registerListeners(),t}c(t,e);var r=t.prototype;return r.registerListeners=function(){var e=this.hls;e.on(zn.MANIFEST_LOADING,this.onManifestLoading,this),e.on(zn.MANIFEST_PARSED,this.onManifestParsed,this),e.on(zn.LEVEL_LOADING,this.onLevelLoading,this),e.on(zn.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(zn.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(zn.ERROR,this.onError,this)},r.unregisterListeners=function(){var e=this.hls;e.off(zn.MANIFEST_LOADING,this.onManifestLoading,this),e.off(zn.MANIFEST_PARSED,this.onManifestParsed,this),e.off(zn.LEVEL_LOADING,this.onLevelLoading,this),e.off(zn.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(zn.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(zn.ERROR,this.onError,this)},r.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,e.prototype.destroy.call(this)},r.onManifestLoading=function(){this.tracks=[],this.tracksInGroup=[],this.groupIds=null,this.currentTrack=null,this.trackId=-1,this.selectDefaultTrack=!0},r.onManifestParsed=function(e,t){this.tracks=t.audioTracks||[]},r.onAudioTrackLoaded=function(e,t){var n,r=t.id,i=t.groupId,a=t.details,s=this.tracksInGroup[r];s&&s.groupId===i?(n=s.details,s.details=t.details,this.log("Audio track "+r+' "'+s.name+'" lang:'+s.lang+" group:"+i+" loaded ["+a.startSN+"-"+a.endSN+"]"),r===this.trackId&&this.playlistLoaded(r,t,n)):this.warn("Audio track with id:"+r+" and group:"+i+" not found in active group "+(null==s?void 0:s.groupId))},r.onLevelLoading=function(e,t){this.switchLevel(t.level)},r.onLevelSwitching=function(e,t){this.switchLevel(t.level)},r.switchLevel=function(e){if(e=this.hls.levels[e]){var t=e.audioGroups||null,n=this.groupIds;e=this.currentTrack;if(!t||(null==n?void 0:n.length)!==(null==t?void 0:t.length)||null!=t&&t.some((function(e){return-1===(null==n?void 0:n.indexOf(e))}))){this.groupIds=t,this.trackId=-1,this.currentTrack=null;var r=this.tracks.filter((function(e){return!t||-1!==t.indexOf(e.groupId)}));if(r.length)this.selectDefaultTrack&&!r.some((function(e){return e.default}))&&(this.selectDefaultTrack=!1),r.forEach((function(e,t){e.id=t}));else if(!e&&!this.tracksInGroup.length)return;this.tracksInGroup=r;var i=this.hls.config.audioPreference,a=(-1===(i=(!e&&i&&(e=-1<(a=Ke(i,r,$e))?r[a]:(a=Ke(i,this.tracks),this.tracks[a])),this.findTrackId(e)))&&e&&(i=this.findTrackId(null)),{audioTracks:r});a=(this.log("Updating audio tracks, "+r.length+" track(s) found in group(s): "+(null==t?void 0:t.join(","))),this.hls.trigger(zn.AUDIO_TRACKS_UPDATED,a),this.trackId);-1!==i&&-1===a?this.setAudioTrack(i):r.length&&-1===a&&(a=new Error("No audio track selected for current audio group-ID(s): "+(null==(i=this.groupIds)?void 0:i.join(","))+" track count: "+r.length),this.warn(a.message),this.hls.trigger(zn.ERROR,{type:Wn.MEDIA_ERROR,details:Kn.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:a}))}else this.shouldReloadPlaylist(e)&&this.setAudioTrack(this.trackId)}},r.onError=function(e,t){t.fatal||!t.context||t.context.type!==jr||t.context.id!==this.trackId||this.groupIds&&-1===this.groupIds.indexOf(t.context.groupId)||(this.requestScheduled=-1,this.checkRetry(t))},r.setAudioOption=function(e){var t,n,r,i,a,s,o=this.hls;if(o.config.audioPreference=e){var u=this.allAudioTracks;if(this.selectDefaultTrack=!1,u.length){var l,c=this.currentTrack;if(c&&qe(e,c,$e))return c;if(-1<(d=Ke(e,this.tracksInGroup,$e)))return l=this.tracksInGroup[d],this.setAudioTrack(d),l;if(c){var d;if(-1===(d=(-1===(d=o.loadLevel)&&(d=o.firstAutoLevel),t=e,l=o.levels,n=u,r=$e,d=l[c=d],1<(h=l.reduce((function(e,t,n){return(e[t=t.uri]||(e[t]=[])).push(n),e}),{})[d.uri]).length&&(c=Math.max.apply(Math,h)),i=d.videoRange,a=d.frameRate,s=d.codecSet.substring(0,4),-1<(h=Ye(l,c,(function(e){var o;if(e.videoRange===i&&e.frameRate===a&&e.codecSet.substring(0,4)===s)return o=e.audioGroups,e=n.filter((function(e){return!o||-1!==o.indexOf(e.groupId)})),-1<Ke(t,e,r)})))?h:Ye(l,c,(function(e){var i=e.audioGroups;e=n.filter((function(e){return!i||-1!==i.indexOf(e.groupId)}));return-1<Ke(t,e,r)})))))return null;o.nextLoadLevel=d}if(e.channels||e.audioCodec){var h=Ke(e,u);if(-1<h)return u[h]}}}return null},r.setAudioTrack=function(e){var t,r,i=this.tracksInGroup;e<0||e>=i.length?this.warn("Invalid audio track id: "+e):(this.clearTimer(),this.selectDefaultTrack=!1,t=this.currentTrack,r=(i=i[e]).details&&!i.details.live,e===this.trackId&&i===t&&r||(this.log("Switching to audio-track "+e+' "'+i.name+'" lang:'+i.lang+" group:"+i.groupId+" channels:"+i.channels),this.trackId=e,this.currentTrack=i,this.hls.trigger(zn.AUDIO_TRACK_SWITCHING,n({},i)),r)||(e=this.switchParams(i.url,null==t?void 0:t.details),this.loadPlaylist(e)))},r.findTrackId=function(e){for(var t=this.tracksInGroup,n=0;n<t.length;n++){var r=t[n];if((!this.selectDefaultTrack||r.default)&&(!e||qe(e,r,$e)))return n}if(e){for(var i=e.name,a=e.lang,s=e.assocLang,o=e.characteristics,u=e.audioCodec,l=e.channels,c=0;c<t.length;c++)if(qe({name:i,lang:a,assocLang:s,characteristics:o,audioCodec:u,channels:l},t[c],$e))return c;for(var d=0;d<t.length;d++){var h=t[d];if(Vt(e.attrs,h.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return d}for(var f=0;f<t.length;f++){var p=t[f];if(Vt(e.attrs,p.attrs,["LANGUAGE"]))return f}}return-1},r.loadPlaylist=function(t){var n=this.currentTrack;if(this.shouldLoadPlaylist(n)&&n){e.prototype.loadPlaylist.call(this);var r=n.id,i=n.groupId,a=n.url;if(t)try{a=t.addDirectives(a)}catch(t){this.warn("Could not construct new URL with HLS Delivery Directives: "+t)}this.log("loading audio-track playlist "+r+' "'+n.name+'" lang:'+n.lang+" group:"+i),this.clearTimer(),this.hls.trigger(zn.AUDIO_TRACK_LOADING,{url:a,id:r,groupId:i,deliveryDirectives:t||null})}},u(t,[{key:"allAudioTracks",get:function(){return this.tracks}},{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}}])}(Zr),Di=function(e){function t(t,n,r){return(t=e.call(this,t,n,r,"subtitle-stream-controller",Nr)||this).currentTrackId=-1,t.tracksBuffered=[],t.mainDetails=null,t.registerListeners(),t}c(t,e);var n=t.prototype;return n.onHandlerDestroying=function(){this.unregisterListeners(),e.prototype.onHandlerDestroying.call(this),this.mainDetails=null},n.registerListeners=function(){e.prototype.registerListeners.call(this);var t=this.hls;t.on(zn.LEVEL_LOADED,this.onLevelLoaded,this),t.on(zn.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(zn.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.on(zn.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(zn.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),t.on(zn.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(zn.FRAG_BUFFERED,this.onFragBuffered,this)},n.unregisterListeners=function(){e.prototype.unregisterListeners.call(this);var t=this.hls;t.off(zn.LEVEL_LOADED,this.onLevelLoaded,this),t.off(zn.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(zn.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.off(zn.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(zn.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),t.off(zn.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(zn.FRAG_BUFFERED,this.onFragBuffered,this)},n.startLoad=function(e){this.stopLoad(),this.state=Ti,this.setInterval(500),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()},n.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},n.onMediaDetaching=function(){this.tracksBuffered=[],e.prototype.onMediaDetaching.call(this)},n.onLevelLoaded=function(e,t){this.mainDetails=t.details},n.onSubtitleFragProcessed=function(e,t){var n=t.frag;t=t.success;if(this.fragPrevious=n,this.state=Ti,t){var r=this.tracksBuffered[this.currentTrackId];if(r){for(var i,a=n.start,s=0;s<r.length;s++)if(a>=r[s].start&&a<=r[s].end){i=r[s];break}t=n.start+n.duration,i?i.end=t:r.push(i={start:a,end:t}),this.fragmentTracker.fragBuffered(n),this.fragBufferedComplete(n,null)}}},n.onBufferFlushing=function(e,t){var n,r=t.startOffset,i=t.endOffset;0!==r||i===Number.POSITIVE_INFINITY||(n=i-1)<=0||(t.endOffsetSubtitles=Math.max(0,n),this.tracksBuffered.forEach((function(e){for(var t=0;t<e.length;)if(e[t].end<=n)e.shift();else{if(!(e[t].start<n))break;e[t].start=n,t++}})),this.fragmentTracker.removeFragmentsInRange(r,n,Nr))},n.onFragBuffered=function(e,t){this.loadedmetadata||t.frag.type!==Br||null!=(t=this.media)&&t.buffered.length&&(this.loadedmetadata=!0)},n.onError=function(e,t){(null==(t=t.frag)?void 0:t.type)===Nr&&(this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==bi)&&(this.state=Ti)},n.onSubtitleTracksUpdated=function(e,t){var n=this;t=t.subtitleTracks;this.levels&&Gt(this.levels,t)?this.levels=t.map((function(e){return new Xr(e)})):(this.tracksBuffered=[],this.levels=t.map((function(e){return e=new Xr(e),n.tracksBuffered[e.id]=[],e})),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,Nr),this.fragPrevious=null,this.mediaBuffer=null)},n.onSubtitleTrackSwitch=function(e,t){this.currentTrackId=t.id,null!=(t=this.levels)&&t.length&&-1!==this.currentTrackId?(null!=(t=this.levels[this.currentTrackId])&&t.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,t&&this.state!==bi&&this.setInterval(500)):this.clearInterval()},n.onSubtitleTrackLoaded=function(e,t){var n=this.currentTrackId,r=this.levels,i=t.details;t=t.id;if(r){var a=r[n];if(!(t>=r.length||t!==n)&&a){if(this.log("Subtitle track "+t+" loaded ["+i.startSN+","+i.endSN+"]"+(i.lastPartSn?"[part-"+i.lastPartSn+"-"+i.lastPartIndex+"]":"")+",duration:"+i.totalduration),this.mediaBuffer=this.mediaBufferTimeRanges,r=0,i.live||null!=(n=a.details)&&n.live){if(n=this.mainDetails,i.deltaUpdateFailed||!n)return;var s,o=n.fragments[0];a.details?0===(r=this.alignPlaylists(i,a.details,null==(s=this.levelLastLoaded)?void 0:s.details))&&o&&Oe(i,r=o.start):i.hasProgramDateTime&&n.hasProgramDateTime?(nt(i,n),r=i.fragments[0].start):o&&Oe(i,r=o.start)}a.details=i,this.levelLastLoaded=a,this.startFragRequested||!this.mainDetails&&i.live||this.setStartPosition(this.mainDetails||i,r),this.tick(),i.live&&!this.fragCurrent&&this.media&&this.state===Ti&&!Ge(null,i.fragments,this.media.currentTime,0)&&(this.warn("Subtitle playlist not aligned with playback"),a.details=void 0)}}else this.warn("Subtitle tracks were reset while loading level "+t)},n._handleFragmentLoadComplete=function(e){var t,n=this,r=e.frag,i=(e=e.payload,r.decryptdata),a=this.hls;this.fragContextChanged(r)||e&&0<e.byteLength&&null!=i&&i.key&&i.iv&&E(i.method)&&(t=performance.now(),this.decrypter.decrypt(new Uint8Array(e),i.key.buffer,i.iv.buffer,k(i.method)).catch((function(e){throw a.trigger(zn.ERROR,{type:Wn.MEDIA_ERROR,details:Kn.FRAG_DECRYPT_ERROR,fatal:!1,error:e,reason:e.message,frag:r}),e})).then((function(e){var n=performance.now();a.trigger(zn.FRAG_DECRYPTED,{frag:r,payload:e,stats:{tstart:t,tdecrypt:n}})})).catch((function(e){n.warn(e.name+": "+e.message),n.state=Ti})))},n.doTick=function(){var e,t,n,r,i,a,s,o,u;this.media?this.state===Ti&&(e=this.currentTrackId,e=null==(s=this.levels)?void 0:s[e])&&s.length&&e.details&&(s=this.config,r=this.getLoadPosition(),t=(r=hi.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],r,s.maxBufferHole)).end,r=r.len,n=e.details,this.hls.maxBufferLength+n.levelTargetDuration<r||(i=(r=n.fragments).length,u=n.edge,o=null,a=this.fragPrevious,t<u?(s=u-(u=s.maxFragLookUpTolerance)<t?0:u,!(o=Ge(a,r,Math.max(r[0].start,t),s))&&a&&a.start<r[0].start&&(o=r[0])):o=r[i-1],o&&("initSegment"!==(o=this.mapToInitFragWhenRequired(o)).sn&&(u=r[o.sn-n.startSN-1])&&u.cc===o.cc&&this.fragmentTracker.getState(u)===si&&(o=u),this.fragmentTracker.getState(o)===si)&&this.loadFragment(o,e,t))):this.state=Ti},n.loadFragment=function(t,n,r){"initSegment"===(this.fragCurrent=t).sn?this._loadInitSegment(t,n):(this.startFragRequested=!0,e.prototype.loadFragment.call(this,t,n,r))},u(t,[{key:"mediaBufferTimeRanges",get:function(){return new ma(this.tracksBuffered[this.currentTrackId]||[])}}])}(ai),function(e){function t(t,n,r){if(r-1<(n>>>=0))throw new DOMException("Failed to execute '"+t+"' on 'TimeRanges': The index provided ("+n+") is greater than the maximum bound ("+r+")");return e[n][t]}this.buffered=void 0,this.buffered={get length(){return e.length},end:function(n){return t("end",n,e.length)},start:function(n){return t("start",n,e.length)}}}),ga=(Hi=function(e){function t(t){var n=e.call(this,t,"subtitle-track-controller")||this;return n.media=null,n.tracks=[],n.groupIds=null,n.tracksInGroup=[],n.trackId=-1,n.currentTrack=null,n.selectDefaultTrack=!0,n.queuedDefaultTrack=-1,n.useTextTrackPolling=!1,n.subtitlePollingInterval=-1,n._subtitleDisplay=!0,n.asyncPollTrackChange=function(){return n.pollTrackChange(0)},n.onTextTracksChanged=function(){if(n.useTextTrackPolling||self.clearInterval(n.subtitlePollingInterval),n.media&&n.hls.config.renderTextTracksNatively){for(var e=null,t=Ee(n.media.textTracks),r=0;r<t.length;r++)if("hidden"===t[r].mode)e=t[r];else if("showing"===t[r].mode){e=t[r];break}var i=n.findTrackForTextTrack(e);n.subtitleTrack!==i&&n.setSubtitleTrack(i)}},n.registerListeners(),n}c(t,e);var n=t.prototype;return n.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,this.onTextTracksChanged=this.asyncPollTrackChange=null,e.prototype.destroy.call(this)},n.registerListeners=function(){var e=this.hls;e.on(zn.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(zn.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(zn.MANIFEST_LOADING,this.onManifestLoading,this),e.on(zn.MANIFEST_PARSED,this.onManifestParsed,this),e.on(zn.LEVEL_LOADING,this.onLevelLoading,this),e.on(zn.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(zn.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(zn.ERROR,this.onError,this)},n.unregisterListeners=function(){var e=this.hls;e.off(zn.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(zn.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(zn.MANIFEST_LOADING,this.onManifestLoading,this),e.off(zn.MANIFEST_PARSED,this.onManifestParsed,this),e.off(zn.LEVEL_LOADING,this.onLevelLoading,this),e.off(zn.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(zn.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(zn.ERROR,this.onError,this)},n.onMediaAttached=function(e,t){this.media=t.media,this.media&&(-1<this.queuedDefaultTrack&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))},n.pollTrackChange=function(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.onTextTracksChanged,e)},n.onMediaDetaching=function(){this.media&&(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),-1<this.trackId&&(this.queuedDefaultTrack=this.trackId),Ee(this.media.textTracks).forEach((function(e){Te(e)})),this.subtitleTrack=-1,this.media=null)},n.onManifestLoading=function(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0},n.onManifestParsed=function(e,t){this.tracks=t.subtitleTracks},n.onSubtitleTrackLoaded=function(e,t){var n,r=t.id,i=t.groupId,a=t.details,s=this.tracksInGroup[r];s&&s.groupId===i?(n=s.details,s.details=t.details,this.log("Subtitle track "+r+' "'+s.name+'" lang:'+s.lang+" group:"+i+" loaded ["+a.startSN+"-"+a.endSN+"]"),r===this.trackId&&this.playlistLoaded(r,t,n)):this.warn("Subtitle track with id:"+r+" and group:"+i+" not found in active group "+(null==s?void 0:s.groupId))},n.onLevelLoading=function(e,t){this.switchLevel(t.level)},n.onLevelSwitching=function(e,t){this.switchLevel(t.level)},n.switchLevel=function(e){if(e=this.hls.levels[e]){var t=e.subtitleGroups||null,n=this.groupIds;e=this.currentTrack;if(!t||(null==n?void 0:n.length)!==(null==t?void 0:t.length)||null!=t&&t.some((function(e){return-1===(null==n?void 0:n.indexOf(e))}))){this.groupIds=t,this.trackId=-1,this.currentTrack=null;var r=this.tracks.filter((function(e){return!t||-1!==t.indexOf(e.groupId)}));if(r.length)this.selectDefaultTrack&&!r.some((function(e){return e.default}))&&(this.selectDefaultTrack=!1),r.forEach((function(e,t){e.id=t}));else if(!e&&!this.tracksInGroup.length)return;this.tracksInGroup=r;var i=this.hls.config.subtitlePreference,a=(-1===(i=(!e&&i&&(this.selectDefaultTrack=!1,e=-1<(a=Ke(i,r))?r[a]:(a=Ke(i,this.tracks),this.tracks[a])),this.findTrackId(e)))&&e&&(i=this.findTrackId(null)),{subtitleTracks:r});this.log("Updating subtitle tracks, "+r.length+' track(s) found in "'+(null==t?void 0:t.join(","))+'" group-id'),this.hls.trigger(zn.SUBTITLE_TRACKS_UPDATED,a),-1!==i&&-1===this.trackId&&this.setSubtitleTrack(i)}else this.shouldReloadPlaylist(e)&&this.setSubtitleTrack(this.trackId)}},n.findTrackId=function(e){for(var t=this.tracksInGroup,n=this.selectDefaultTrack,r=0;r<t.length;r++){var i=t[r];if((!n||i.default)&&(n||e)&&(!e||qe(i,e)))return r}if(e){for(var a=0;a<t.length;a++){var s=t[a];if(Vt(e.attrs,s.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return a}for(var o=0;o<t.length;o++){var u=t[o];if(Vt(e.attrs,u.attrs,["LANGUAGE"]))return o}}return-1},n.findTrackForTextTrack=function(e){if(e)for(var t=this.tracksInGroup,n=0;n<t.length;n++)if(Ht(t[n],e))return n;return-1},n.onError=function(e,t){t.fatal||!t.context||t.context.type!==Ur||t.context.id!==this.trackId||this.groupIds&&-1===this.groupIds.indexOf(t.context.groupId)||this.checkRetry(t)},n.setSubtitleOption=function(e){if(this.hls.config.subtitlePreference=e){var t=this.allSubtitleTracks;if(this.selectDefaultTrack=!1,t.length){var n=this.currentTrack;if(n&&qe(e,n))return n;var r,i=Ke(e,this.tracksInGroup);if(-1<i)return r=this.tracksInGroup[i],this.setSubtitleTrack(i),r;if(n)return null;if(-1<(i=Ke(e,t)))return t[i]}}return null},n.loadPlaylist=function(t){e.prototype.loadPlaylist.call(this);var n=this.currentTrack;if(this.shouldLoadPlaylist(n)&&n){var r=n.id,i=n.groupId;n=n.url;if(t)try{n=t.addDirectives(n)}catch(t){this.warn("Could not construct new URL with HLS Delivery Directives: "+t)}this.log("Loading subtitle playlist for id "+r),this.hls.trigger(zn.SUBTITLE_TRACK_LOADING,{url:n,id:r,groupId:i,deliveryDirectives:t||null})}},n.toggleTrackModes=function(){var e,t,n=this.media;n&&(n=Ee(n.textTracks),(e=this.currentTrack)&&!(t=n.filter((function(t){return Ht(e,t)}))[0])&&this.warn('Unable to find subtitle TextTrack with name "'+e.name+'" and language "'+e.lang+'"'),[].slice.call(n).forEach((function(e){"disabled"!==e.mode&&e!==t&&(e.mode="disabled")})),t)&&(n=this.subtitleDisplay?"showing":"hidden",t.mode!==n)&&(t.mode=n)},n.setSubtitleTrack=function(e){var t,n,r,i,a,s,o=this.tracksInGroup;this.media?e<-1||e>=o.length||!Gn(e)?this.warn("Invalid subtitle track id: "+e):(this.clearTimer(),this.selectDefaultTrack=!1,t=this.currentTrack,o=o[e]||null,this.trackId=e,this.currentTrack=o,this.toggleTrackModes(),o?(s=!!o.details&&!o.details.live,e===this.trackId&&o===t&&s||(this.log("Switching to subtitle-track "+e+(o?' "'+o.name+'" lang:'+o.lang+" group:"+o.groupId:"")),s=o.id,n=o.groupId,r=o.name,i=o.type,a=o.url,this.hls.trigger(zn.SUBTITLE_TRACK_SWITCH,{id:s,groupId:void 0===n?"":n,name:r,type:i,url:a}),s=this.switchParams(o.url,null==t?void 0:t.details),this.loadPlaylist(s))):this.hls.trigger(zn.SUBTITLE_TRACK_SWITCH,{id:e})):this.queuedDefaultTrack=e},u(t,[{key:"subtitleDisplay",get:function(){return this._subtitleDisplay},set:function(e){this._subtitleDisplay=e,-1<this.trackId&&this.toggleTrackModes()}},{key:"allSubtitleTracks",get:function(){return this.tracks}},{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(e){this.selectDefaultTrack=!1,this.setSubtitleTrack(e)}}])}(Zr),function(){function e(e){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=e}var t=e.prototype;return t.append=function(e,t,n){var r=this.queues[t];r.push(e),1!==r.length||n||this.executeNext(t)},t.appendBlocker=function(e){var t=this;return new Promise((function(n){t.append({execute:n,onStart:function(){},onComplete:function(){},onError:function(){}},e)}))},t.unblockAudio=function(e){this.queues.audio[0]===e&&this.shiftAndExecuteNext("audio")},t.executeNext=function(e){var t=this.queues[e];if(t.length){t=t[0];try{t.execute()}catch(n){Qn.warn('[buffer-operation-queue]: Exception executing "'+e+'" SourceBuffer operation: '+n),t.onError(n),null!=(t=this.buffers[e])&&t.updating||this.shiftAndExecuteNext(e)}}},t.shiftAndExecuteNext=function(e){this.queues[e].shift(),this.executeNext(e)},t.current=function(e){return this.queues[e][0]},e}()),ya=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/,_a=(na=function(e){function t(t,n){var r=e.call(this,"buffer-controller",t.logger)||this;return r.details=null,r._objectUrl=null,r.operationQueue=void 0,r.listeners=void 0,r.hls=void 0,r.fragmentTracker=void 0,r.bufferCodecEventsExpected=0,r._bufferCodecEventsTotal=0,r.media=null,r.mediaSource=null,r.lastMpegAudioChunk=null,r.blockedAudioAppend=null,r.lastVideoAppendEnd=0,r.appendSource=void 0,r.appendErrors={audio:0,video:0,audiovideo:0},r.tracks={},r.pendingTracks={},r.sourceBuffer=void 0,r._onEndStreaming=function(e){r.hls&&r.hls.pauseBuffering()},r._onStartStreaming=function(e){r.hls&&r.hls.resumeBuffering()},r._onMediaSourceOpen=function(){var e,t=(n=r).media,n=n.mediaSource;r.log("Media source opened"),t&&(t.removeEventListener("emptied",r._onMediaEmptied),(e=r.getDurationAndRange())&&r.updateMediaSource(e),r.hls.trigger(zn.MEDIA_ATTACHED,{media:t,mediaSource:n})),n&&n.removeEventListener("sourceopen",r._onMediaSourceOpen),r.checkPendingTracks()},r._onMediaSourceClose=function(){r.log("Media source closed")},r._onMediaSourceEnded=function(){r.log("Media source ended")},r._onMediaEmptied=function(){var e,t=(e=r).mediaSrc;t!==(e=e._objectUrl)&&r.error("Media element src was set while attaching MediaSource ("+e+" > "+t+")")},r.hls=t,r.fragmentTracker=n,r.appendSource=t.config.preferManagedMediaSource&&"undefined"!=typeof self&&self.ManagedMediaSource,r._initSourceBuffer(),r.registerListeners(),r}c(t,e);var n=t.prototype;return n.hasSourceTypes=function(){return 0<this.getSourceBufferTypes().length||0<Object.keys(this.pendingTracks).length},n.destroy=function(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=null,this.hls=this.fragmentTracker=null,this._onMediaSourceOpen=this._onMediaSourceClose=null,this._onMediaSourceEnded=null,this._onStartStreaming=this._onEndStreaming=null},n.registerListeners=function(){var e=this.hls;e.on(zn.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(zn.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(zn.MANIFEST_LOADING,this.onManifestLoading,this),e.on(zn.MANIFEST_PARSED,this.onManifestParsed,this),e.on(zn.BUFFER_RESET,this.onBufferReset,this),e.on(zn.BUFFER_APPENDING,this.onBufferAppending,this),e.on(zn.BUFFER_CODECS,this.onBufferCodecs,this),e.on(zn.BUFFER_EOS,this.onBufferEos,this),e.on(zn.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(zn.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(zn.FRAG_PARSED,this.onFragParsed,this),e.on(zn.FRAG_CHANGED,this.onFragChanged,this)},n.unregisterListeners=function(){var e=this.hls;e.off(zn.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(zn.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(zn.MANIFEST_LOADING,this.onManifestLoading,this),e.off(zn.MANIFEST_PARSED,this.onManifestParsed,this),e.off(zn.BUFFER_RESET,this.onBufferReset,this),e.off(zn.BUFFER_APPENDING,this.onBufferAppending,this),e.off(zn.BUFFER_CODECS,this.onBufferCodecs,this),e.off(zn.BUFFER_EOS,this.onBufferEos,this),e.off(zn.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(zn.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(zn.FRAG_PARSED,this.onFragParsed,this),e.off(zn.FRAG_CHANGED,this.onFragChanged,this)},n._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new ga(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]},this.appendErrors={audio:0,video:0,audiovideo:0},this.lastMpegAudioChunk=null,this.blockedAudioAppend=null,this.lastVideoAppendEnd=0},n.onManifestLoading=function(){this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=0,this.details=null},n.onManifestParsed=function(e,t){var n=2;(!t.audio||t.video)&&t.altAudio||(n=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=n,this.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},n.onMediaAttaching=function(e,t){t=this.media=t.media;var n,r,i,a=re(this.appendSource);if(t&&a){a=this.mediaSource=new a;var s=(this.log("created media source: "+(null==(s=a.constructor)?void 0:s.name)),a.addEventListener("sourceopen",this._onMediaSourceOpen),a.addEventListener("sourceended",this._onMediaSourceEnded),a.addEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(a.addEventListener("startstreaming",this._onStartStreaming),a.addEventListener("endstreaming",this._onEndStreaming)),this._objectUrl=self.URL.createObjectURL(a));if(this.appendSource)try{t.removeAttribute("src");var o=self.ManagedMediaSource;t.disableRemotePlayback=t.disableRemotePlayback||o&&a instanceof o,zt(t),n=t,r=s,(i=self.document.createElement("source")).type="video/mp4",i.src=r,n.appendChild(i),t.load()}catch(e){t.src=s}else t.src=s;t.addEventListener("emptied",this._onMediaEmptied)}},n.onMediaDetaching=function(){var e=this.media,t=this.mediaSource,n=this._objectUrl;if(t){if(this.log("media source detaching"),"open"===t.readyState)try{t.endOfStream()}catch(e){this.warn("onMediaDetaching: "+e.message+" while calling endOfStream")}this.onBufferReset(),t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(t.removeEventListener("startstreaming",this._onStartStreaming),t.removeEventListener("endstreaming",this._onEndStreaming)),this.mediaSource=null,this._objectUrl=null}e&&(e.removeEventListener("emptied",this._onMediaEmptied),n&&self.URL.revokeObjectURL(n),this.mediaSrc===n?(e.removeAttribute("src"),this.appendSource&&zt(e),e.load()):this.warn("media|source.src was changed by a third party - skip cleanup"),this.media=null),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={},this.hls.trigger(zn.MEDIA_DETACHED,void 0)},n.onBufferReset=function(){var e=this;this.getSourceBufferTypes().forEach((function(t){e.resetBuffer(t)})),this._initSourceBuffer(),this.hls.resumeBuffering()},n.resetBuffer=function(e){var t,n=this.sourceBuffer[e];try{n&&(this.removeBufferListeners(e),this.sourceBuffer[e]=void 0,null!=(t=this.mediaSource))&&t.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(n)}catch(t){this.warn("onBufferReset "+e,t)}},n.onBufferCodecs=function(e,t){var n,r=this,i=this.getSourceBufferTypes().length,a=Object.keys(t);a.forEach((function(e){var n,a,s,o,u,l,c,d,h,f;i?(n=r.tracks[e])&&"function"==typeof(null==(l=n.buffer)?void 0:l.changeType)&&(a=(l=t[e]).id,s=l.codec,o=l.levelCodec,u=l.container,l=l.metadata,d=null==(c=ce(n.codec,n.levelCodec))?void 0:c.replace(ya,"$1"),f=null==(h=ce(s,o))?void 0:h.replace(ya,"$1"),h)&&d!==f&&("audio"===e.slice(0,5)&&(h=le(h,r.appendSource)),r.appendChangeType(e,u+";codecs="+h),r.log("switching codec "+c+" to "+h),r.tracks[e]={buffer:n.buffer,codec:s,container:u,levelCodec:o,metadata:l,id:a}):r.pendingTracks[e]=t[e]})),i||(n=Math.max(this.bufferCodecEventsExpected-1,0),this.bufferCodecEventsExpected!==n&&(this.log(n+" bufferCodec event(s) expected "+a.join(",")),this.bufferCodecEventsExpected=n),this.mediaSource&&"open"===this.mediaSource.readyState&&this.checkPendingTracks())},n.appendChangeType=function(e,t){var n=this,r=this.operationQueue;r.append({execute:function(){var i=n.sourceBuffer[e];i&&(n.log("changing "+e+" sourceBuffer type to "+t),i.changeType(t)),r.shiftAndExecuteNext(e)},onStart:function(){},onComplete:function(){},onError:function(t){n.warn("Failed to change "+e+" SourceBuffer type",t)}},e,!!this.pendingTracks[e])},n.blockAudio=function(e){var t=this,n=e.start,r=n+.05*e.duration;!0!==(null==(n=this.fragmentTracker.getAppendedFrag(n,Br))?void 0:n.gap)&&(this.blockedAudioAppend={op:n={execute:function(){var e;(t.lastVideoAppendEnd>r||t.sourceBuffer.video&&hi.isBuffered(t.sourceBuffer.video,r)||!0===(null==(e=t.fragmentTracker.getAppendedFrag(r,Br))?void 0:e.gap))&&(t.blockedAudioAppend=null,t.operationQueue.shiftAndExecuteNext("audio"))},onStart:function(){},onComplete:function(){},onError:function(){}},frag:e},this.operationQueue.append(n,"audio",!0))},n.unblockAudio=function(){var e=this.blockedAudioAppend;e&&(this.blockedAudioAppend=null,this.operationQueue.unblockAudio(e.op))},n.onBufferAppending=function(e,t){var n,r,i=this,a=this.operationQueue,s=this.tracks,o=t.data,u=t.type,l=t.parent,c=t.frag,d=t.part,h=t.chunkMeta,f=h.buffering[u],p=c.sn,v=(t=self.performance.now(),f.start=t,c.stats.buffering),m=d?d.stats.buffering:null,g=(t=(0===v.start&&(v.start=t),m&&0===m.start&&(m.start=t),s.audio),!1),y=((s=("audio"===u&&"audio/mpeg"===(null==t?void 0:t.container)&&(g=!this.lastMpegAudioChunk||1===h.id||this.lastMpegAudioChunk.sn!==h.sn,this.lastMpegAudioChunk=h),this.sourceBuffer.video))&&"initSegment"!==p&&(t=d||c,n=this.blockedAudioAppend,"audio"!==u||"main"===l||this.blockedAudioAppend?"video"===u&&(l=t.end,n&&((n=n.frag.start)<l||l<this.lastVideoAppendEnd||hi.isBuffered(s,n))&&this.unblockAudio(),this.lastVideoAppendEnd=l):(n=t.start+.05*t.duration,l=s.buffered,r=this.operationQueue.current("video"),(!l.length&&!r||!r&&!hi.isBuffered(s,n)&&this.lastVideoAppendEnd<n)&&this.blockAudio(t))),(d||c).start);a.append({execute:function(){var e,t;f.executeStart=self.performance.now(),g&&(e=i.sourceBuffer[u])&&(t=y-e.timestampOffset,.1<=Math.abs(t))&&(i.log("Updating audio SourceBuffer timestampOffset to "+y+" (delta: "+t+") sn: "+p+")"),e.timestampOffset=y),i.appendExecutor(o,u)},onStart:function(){},onComplete:function(){var e,t=self.performance.now(),n=(f.executeEnd=f.end=t,0===v.first&&(v.first=t),m&&0===m.first&&(m.first=t),i.sourceBuffer),r={};for(e in n)r[e]=hi.getBuffered(n[e]);i.appendErrors[u]=0,"audio"===u||"video"===u?i.appendErrors.audiovideo=0:(i.appendErrors.audio=0,i.appendErrors.video=0),i.hls.trigger(zn.BUFFER_APPENDED,{type:u,frag:c,part:d,chunkMeta:h,parent:c.type,timeRanges:r})},onError:function(e){var t={type:Wn.MEDIA_ERROR,parent:c.type,details:Kn.BUFFER_APPEND_ERROR,sourceBufferName:u,frag:c,part:d,chunkMeta:h,error:e,err:e,fatal:!1};e.code===DOMException.QUOTA_EXCEEDED_ERR?t.details=Kn.BUFFER_FULL_ERROR:(e=++i.appendErrors[u],t.details=Kn.BUFFER_APPEND_ERROR,i.warn("Failed "+e+"/"+i.hls.config.appendErrorMaxRetry+' times to append segment in "'+u+'" sourceBuffer'),e>=i.hls.config.appendErrorMaxRetry&&(t.fatal=!0)),i.hls.trigger(zn.ERROR,t)}},u,!!this.pendingTracks[u])},n.getFlushOp=function(e,t,n){var r=this;return{execute:function(){r.removeExecutor(e,t,n)},onStart:function(){},onComplete:function(){r.hls.trigger(zn.BUFFER_FLUSHED,{type:e})},onError:function(t){r.warn("Failed to remove from "+e+" SourceBuffer",t)}}},n.onBufferFlushing=function(e,t){var n=this,r=this.operationQueue,i=t.type,a=t.startOffset,s=t.endOffset;i?r.append(this.getFlushOp(i,a,s),i):this.getSourceBufferTypes().forEach((function(e){r.append(n.getFlushOp(e,a,s),e)}))},n.onFragParsed=function(e,t){var n=this,r=t.frag,i=t.part,a=(t=[],(i||r).elementaryStreams);a[nr]?t.push("audiovideo"):(a[er]&&t.push("audio"),a[tr]&&t.push("video")),0===t.length&&this.warn("Fragments must have at least one ElementaryStreamType set. type: "+r.type+" level: "+r.level+" sn: "+r.sn),this.blockBuffers((function(){var e=self.performance.now();r.stats.buffering.end=e,i&&(i.stats.buffering.end=e),e=(i||r).stats;n.hls.trigger(zn.FRAG_BUFFERED,{frag:r,part:i,stats:e,id:r.type})}),t)},n.onFragChanged=function(e,t){this.trimBuffers()},n.onBufferEos=function(e,t){var n=this;"video"===t.type&&this.unblockAudio(),this.getSourceBufferTypes().reduce((function(e,r){var i=n.sourceBuffer[r];return!i||t.type&&t.type!==r||(i.ending=!0,i.ended)||(i.ended=!0,n.log(r+" sourceBuffer now EOS")),e&&!(i&&!i.ended)}),!0)&&(this.log("Queueing mediaSource.endOfStream()"),this.blockBuffers((function(){n.getSourceBufferTypes().forEach((function(e){(e=n.sourceBuffer[e])&&(e.ending=!1)}));var e=n.mediaSource;e&&"open"===e.readyState?(n.log("Calling mediaSource.endOfStream()"),e.endOfStream()):e&&n.log("Could not call mediaSource.endOfStream(). mediaSource.readyState: "+e.readyState)})))},n.onLevelUpdated=function(e,t){var n,r=this;(t=t.details).fragments.length&&(this.details=t,n=this.getDurationAndRange())&&(this.getSourceBufferTypes().length?this.blockBuffers((function(){return r.updateMediaSource(n)})):this.updateMediaSource(n))},n.trimBuffers=function(){var e,t=this.hls,n=this.details,r=this.media;r&&null!==n&&this.getSourceBufferTypes().length&&(t=t.config,r=r.currentTime,e=n.levelTargetDuration,n=n.live&&null!==t.liveBackBufferLength?t.liveBackBufferLength:t.backBufferLength,Gn(n)&&0<n&&(n=Math.max(n,e),n=Math.floor(r/e)*e-n,this.flushBackBuffer(r,e,n)),Gn(t.frontBufferFlushThreshold))&&0<t.frontBufferFlushThreshold&&(n=Math.max(t.maxBufferLength,t.frontBufferFlushThreshold),t=Math.max(n,e),n=Math.floor(r/e)*e+t,this.flushFrontBuffer(r,e,n))},n.flushBackBuffer=function(e,t,n){var r=this,i=this.details,a=this.sourceBuffer;this.getSourceBufferTypes().forEach((function(s){var o=a[s];if(o){var u=hi.getBuffered(o);if(0<u.length&&n>u.start(0)){if(r.hls.trigger(zn.BACK_BUFFER_REACHED,{bufferEnd:n}),null!=i&&i.live)r.hls.trigger(zn.LIVE_BACK_BUFFER_REACHED,{bufferEnd:n});else if(o.ended&&u.end(u.length-1)-e<2*t)return void r.log("Cannot flush "+s+" back buffer while SourceBuffer is in ended state");r.hls.trigger(zn.BUFFER_FLUSHING,{startOffset:0,endOffset:n,type:s})}}}))},n.flushFrontBuffer=function(e,t,n){var r=this,i=this.sourceBuffer;this.getSourceBufferTypes().forEach((function(a){var s,o,u,l=i[a];!l||(s=(u=hi.getBuffered(l)).length)<2||(o=u.start(s-1),u=u.end(s-1),o<n)||o<=e&&e<=u||(l.ended&&e-u<2*t?r.log("Cannot flush "+a+" front buffer while SourceBuffer is in ended state"):r.hls.trigger(zn.BUFFER_FLUSHING,{startOffset:o,endOffset:1/0,type:a}))}))},n.getDurationAndRange=function(){var e,t,n,r,i,a;return this.details&&this.media&&this.mediaSource&&"open"===this.mediaSource.readyState?(e=this.details,a=this.hls,r=this.media,t=this.mediaSource,n=e.fragments[0].start+e.totalduration,r=r.duration,i=Gn(t.duration)?t.duration:0,e.live&&a.config.liveDurationInfinity?(t.duration=1/0,e.fragments.length&&e.live&&t.setLiveSeekableRange?{duration:1/0,start:a=Math.max(0,e.fragments[0].start),end:Math.max(a,a+e.totalduration)}:{duration:1/0}):i<n&&r<n||!Gn(r)?{duration:n}:null):null},n.updateMediaSource=function(e){var t=e.duration,n=e.start;e=e.end;this.media&&this.mediaSource&&"open"===this.mediaSource.readyState&&(Gn(t)&&this.log("Updating Media Source duration to "+t.toFixed(3)),this.mediaSource.duration=t,void 0!==n)&&void 0!==e&&(this.log("Media Source duration is set to "+this.mediaSource.duration+". Setting seekable range to "+n+"-"+e+"."),this.mediaSource.setLiveSeekableRange(n,e))},n.checkPendingTracks=function(){var e=this.bufferCodecEventsExpected,t=this.operationQueue,n=this.pendingTracks,r=Object.keys(n).length;r&&(!e||2===r||"audiovideo"in n)&&(this.createSourceBuffers(n),this.pendingTracks={},(e=this.getSourceBufferTypes()).length?(this.hls.trigger(zn.BUFFER_CREATED,{tracks:this.tracks}),e.forEach((function(e){t.executeNext(e)}))):(r=new Error("could not create source buffer for media codec(s)"),this.hls.trigger(zn.ERROR,{type:Wn.MEDIA_ERROR,details:Kn.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:r,reason:r.message})))},n.createSourceBuffers=function(e){var t=this,n=this.sourceBuffer,r=this.mediaSource;if(!r)throw Error("createSourceBuffers called when mediaSource was null");for(var i in e)!function(i){if(!n[i]){var a=e[i];if(!a)throw Error("source buffer exists for track "+i+", however track does not");var s=a.levelCodec||a.codec,o=(s&&"audio"===i.slice(0,5)&&(s=le(s,t.appendSource)),a.container+";codecs="+s);t.log("creating sourceBuffer("+o+")");try{var u=n[i]=r.addSourceBuffer(o),l=i;t.addBufferListener(l,"updatestart",t._onSBUpdateStart),t.addBufferListener(l,"updateend",t._onSBUpdateEnd),t.addBufferListener(l,"error",t._onSBUpdateError),t.appendSource&&t.addBufferListener(l,"bufferedchange",(function(e,n){null!=(n=n.removedRanges)&&n.length&&t.hls.trigger(zn.BUFFER_FLUSHED,{type:i})})),t.tracks[i]={buffer:u,codec:s,container:a.container,levelCodec:a.levelCodec,metadata:a.metadata,id:a.id}}catch(a){t.error("error while trying to add sourceBuffer: "+a.message),t.hls.trigger(zn.ERROR,{type:Wn.MEDIA_ERROR,details:Kn.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:a,sourceBufferName:i,mimeType:o})}}}(i)},n._onSBUpdateStart=function(e){this.operationQueue.current(e).onStart()},n._onSBUpdateEnd=function(e){var t;"closed"===(null==(t=this.mediaSource)?void 0:t.readyState)?this.resetBuffer(e):((t=this.operationQueue).current(e).onComplete(),t.shiftAndExecuteNext(e))},n._onSBUpdateError=function(e,t){var n=new Error(e+" SourceBuffer error. MediaSource readyState: "+(null==(n=this.mediaSource)?void 0:n.readyState));(t=(this.error(""+n,t),this.hls.trigger(zn.ERROR,{type:Wn.MEDIA_ERROR,details:Kn.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:n,fatal:!1}),this.operationQueue.current(e)))&&t.onError(n)},n.removeExecutor=function(e,t,n){var r=this.media,i=this.mediaSource,a=this.operationQueue,s=this.sourceBuffer[e];r&&i&&s?(r=Gn(r.duration)?r.duration:1/0,i=Gn(i.duration)?i.duration:1/0,(t=Math.max(0,t))<(n=Math.min(n,r,i))&&(!s.ending||s.ended)?(s.ended=!1,this.log("Removing ["+t+","+n+"] from the "+e+" SourceBuffer"),s.remove(t,n)):a.shiftAndExecuteNext(e)):(this.warn("Attempting to remove from the "+e+" SourceBuffer, but it does not exist"),a.shiftAndExecuteNext(e))},n.appendExecutor=function(e,t){var n=this.sourceBuffer[t];if(!n){if(this.pendingTracks[t])return;throw new Error("Attempting to append to the "+t+" SourceBuffer, but it does not exist")}n.ending=!1,n.ended=!1,n.appendBuffer(e)},n.blockBuffers=function(e,t){var n,r,i=this;(t=void 0===t?this.getSourceBufferTypes():t).length?(n=this.operationQueue,r=t.map((function(e){return n.appendBlocker(e)})),1<t.length&&!!this.blockedAudioAppend&&this.unblockAudio(),Promise.all(r).then((function(r){e(),t.forEach((function(e,t){var r=i.sourceBuffer[e];null!=r&&r.updating||n.shiftAndExecuteNext(e)}))}))):(this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(e))},n.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},n.addBufferListener=function(e,t,n){var r=this.sourceBuffer[e];r&&(n=n.bind(this,e),this.listeners[e].push({event:t,listener:n}),r.addEventListener(t,n))},n.removeBufferListeners=function(e){var t=this.sourceBuffer[e];t&&this.listeners[e].forEach((function(e){t.removeEventListener(e.event,e.listener)}))},u(t,[{key:"mediaSrc",get:function(){var e=(null==(e=this.media)?void 0:e.firstChild)||this.media;return null==e?void 0:e.src}}])}(v),{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}),ba=100,Ta={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},Sa={17:2,18:4,21:6,22:8,23:10,19:13,20:15},Ea={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},ka={25:2,26:4,29:6,30:8,31:10,27:13,28:15},wa=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],Ca=function(){function e(){this.time=null,this.verboseLevel=0}return e.prototype.log=function(e,t){this.verboseLevel>=e&&(t="function"==typeof t?t():t,Qn.log(this.time+" ["+e+"] "+t))},e}(),Aa=function(){function e(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}var t=e.prototype;return t.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},t.setStyles=function(e){for(var t=["foreground","underline","italics","background","flash"],n=0;n<t.length;n++){var r=t[n];e.hasOwnProperty(r)&&(this[r]=e[r])}},t.isDefault=function(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash},t.equals=function(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash},t.copy=function(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash},t.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},e}(),La=function(){function e(){this.uchar=" ",this.penState=new Aa}var t=e.prototype;return t.reset=function(){this.uchar=" ",this.penState.reset()},t.setChar=function(e,t){this.uchar=e,this.penState.copy(t)},t.setPenState=function(e){this.penState.copy(e)},t.equals=function(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)},t.copy=function(e){this.uchar=e.uchar,this.penState.copy(e.penState)},t.isEmpty=function(){return" "===this.uchar&&this.penState.isDefault()},e}(),Ra=function(){function e(e){this.chars=[],this.pos=0,this.currPenState=new Aa,this.cueStartTime=null,this.logger=void 0;for(var t=0;t<ba;t++)this.chars.push(new La);this.logger=e}var t=e.prototype;return t.equals=function(e){for(var t=0;t<ba;t++)if(!this.chars[t].equals(e.chars[t]))return!1;return!0},t.copy=function(e){for(var t=0;t<ba;t++)this.chars[t].copy(e.chars[t])},t.isEmpty=function(){for(var e=!0,t=0;t<ba;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e},t.setCursor=function(e){this.pos!==e&&(this.pos=e),this.pos<0?(this.logger.log(3,"Negative cursor position "+this.pos),this.pos=0):this.pos>ba&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=ba)},t.moveCursor=function(e){var t=this.pos+e;if(1<e)for(var n=this.pos+1;n<t+1;n++)this.chars[n].setPenState(this.currPenState);this.setCursor(t)},t.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},t.insertChar=function(e){var t=this,n=(144<=e&&this.backSpace(),Wt(e));this.pos>=ba?this.logger.log(0,(function(){return"Cannot insert "+e.toString(16)+" ("+n+") at position "+t.pos+". Skipping it!"})):(this.chars[this.pos].setChar(n,this.currPenState),this.moveCursor(1))},t.clearFromPos=function(e){for(var t=e;t<ba;t++)this.chars[t].reset()},t.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},t.clearToEndOfRow=function(){this.clearFromPos(this.pos)},t.getTextString=function(){for(var e=[],t=!0,n=0;n<ba;n++){var r=this.chars[n].uchar;" "!==r&&(t=!1),e.push(r)}return t?"":e.join("")},t.setPenStyles=function(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)},e}(),xa=function(){function e(e){this.rows=[],this.currRow=14,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(var t=0;t<15;t++)this.rows.push(new Ra(e));this.logger=e}var t=e.prototype;return t.reset=function(){for(var e=0;e<15;e++)this.rows[e].clear();this.currRow=14},t.equals=function(e){for(var t=!0,n=0;n<15;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t},t.copy=function(e){for(var t=0;t<15;t++)this.rows[t].copy(e.rows[t])},t.isEmpty=function(){for(var e=!0,t=0;t<15;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e},t.backSpace=function(){this.rows[this.currRow].backSpace()},t.clearToEndOfRow=function(){this.rows[this.currRow].clearToEndOfRow()},t.insertChar=function(e){this.rows[this.currRow].insertChar(e)},t.setPen=function(e){this.rows[this.currRow].setPenStyles(e)},t.moveCursor=function(e){this.rows[this.currRow].moveCursor(e)},t.setCursor=function(e){this.logger.log(2,"setCursor: "+e),this.rows[this.currRow].setCursor(e)},t.setPAC=function(e){this.logger.log(2,(function(){return"pacData = "+JSON.stringify(e)}));var t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(var n=0;n<15;n++)this.rows[n].clear();var r=this.currRow+1-this.nrRollUpRows,i=this.lastOutputScreen;if(i){var a=i.rows[r].cueStartTime,s=this.logger.time;if(null!==a&&null!==s&&a<s)for(var o=0;o<this.nrRollUpRows;o++)this.rows[t-this.nrRollUpRows+o+1].copy(i.rows[r+o])}}this.currRow=t,a=this.rows[this.currRow],null!==e.indent&&(s=e.indent,s=Math.max(s-1,0),a.setCursor(e.indent),e.color=a.chars[s].penState.foreground),a={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1},this.setPen(a)},t.setBkgData=function(e){this.logger.log(2,(function(){return"bkgData = "+JSON.stringify(e)})),this.backSpace(),this.setPen(e),this.insertChar(32)},t.setRollUpRows=function(e){this.nrRollUpRows=e},t.rollUp=function(){var e,t=this;null===this.nrRollUpRows?this.logger.log(3,"roll_up but nrRollUpRows not set yet"):(this.logger.log(1,(function(){return t.getDisplayText()})),e=this.currRow+1-this.nrRollUpRows,(e=this.rows.splice(e,1)[0]).clear(),this.rows.splice(this.currRow,0,e),this.logger.log(2,"Rolling up"))},t.getDisplayText=function(e){e=e||!1;for(var t=[],n="",r=0;r<15;r++){var i=this.rows[r].getTextString();i&&t.push(e?"Row "+(r+1)+": '"+i+"'":i.trim())}return 0<t.length?e?"["+t.join(" | ")+"]":t.join("\n"):n},t.getTextAndFormat=function(){return this.rows},e}(),Ia=function(){function e(e,t,n){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new xa(n),this.nonDisplayedMemory=new xa(n),this.lastOutputScreen=new xa(n),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=n}var t=e.prototype;return t.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},t.getHandler=function(){return this.outputFilter},t.setHandler=function(e){this.outputFilter=e},t.setPAC=function(e){this.writeScreen.setPAC(e)},t.setBkgData=function(e){this.writeScreen.setBkgData(e)},t.setMode=function(e){e!==this.mode&&(this.mode=e,this.logger.log(2,(function(){return"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)},t.insertChars=function(e){for(var t=this,n=0;n<e.length;n++)this.writeScreen.insertChar(e[n]);var r=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(2,(function(){return r+": "+t.writeScreen.getDisplayText(!0)})),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(this.logger.log(1,(function(){return"DISPLAYED: "+t.displayedMemory.getDisplayText(!0)})),this.outputDataUpdate())},t.ccRCL=function(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},t.ccBS=function(){this.logger.log(2,"BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory)&&this.outputDataUpdate()},t.ccAOF=function(){},t.ccAON=function(){},t.ccDER=function(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},t.ccRU=function(e){this.logger.log(2,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)},t.ccFON=function(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},t.ccRDC=function(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},t.ccTR=function(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")},t.ccRTD=function(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")},t.ccEDM=function(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},t.ccCR=function(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},t.ccENM=function(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},t.ccEOC=function(){var e,t=this;this.logger.log(2,"EOC - End Of Caption"),"MODE_POP-ON"===this.mode&&(e=this.displayedMemory,this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,(function(){return"DISP: "+t.displayedMemory.getDisplayText()}))),this.outputDataUpdate(!0)},t.ccTO=function(e){this.logger.log(2,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)},t.ccMIDROW=function(e){var t={flash:!1};t.underline=e%2==1,t.italics=46<=e,t.italics?t.foreground="white":(e=Math.floor(e/2)-16,t.foreground=["white","green","blue","cyan","red","yellow","magenta"][e]),this.logger.log(2,"MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)},t.outputDataUpdate=function(e){void 0===e&&(e=!1);var t=this.logger.time;null!==t&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t):this.cueStartTime=t,this.lastOutputScreen.copy(this.displayedMemory))},t.cueSplitAtTime=function(e){!this.outputFilter||this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e)},e}(),Oa=function(){function e(e,t,n){this.channels=void 0,this.currentChannel=0,this.cmdHistory={a:null,b:null},this.logger=void 0;var r=this.logger=new Ca;this.channels=[null,new Ia(e,t,r),new Ia(e+1,n,r)]}var t=e.prototype;return t.getHandler=function(e){return this.channels[e].getHandler()},t.setHandler=function(e,t){this.channels[e].setHandler(t)},t.addData=function(e,t){var n,r=!1;this.logger.time=e;for(var i=0;i<t.length;i+=2){var a,s=127&t[i],o=127&t[i+1];0==s&&0==o||(this.logger.log(3,"["+Kt([t[i],t[i+1]])+"] -> ("+Kt([s,o])+")"),(n=(n=(n=(n=this.parseCmd(s,o))||this.parseMidrow(s,o))||this.parsePAC(s,o))||this.parseBackgroundAttributes(s,o))||(r=this.parseChars(s,o))&&((a=this.currentChannel)&&0<a?this.channels[a].insertChars(r):this.logger.log(2,"No channel found yet. TEXT-MODE?")),n)||r||this.logger.log(2,"Couldn't parse cleaned data "+Kt([s,o])+" orig: "+Kt([t[i],t[i+1]]))}},t.parseCmd=function(e,t){var n,r,i=this.cmdHistory;return((20===e||28===e||21===e||29===e)&&32<=t&&t<=47||(23===e||31===e)&&33<=t&&t<=35)&&($t(e,t,i)?(qt(null,null,i),this.logger.log(3,"Repeated command ("+Kt([e,t])+") is dropped")):(r=this.channels[n=20===e||21===e||23===e?1:2],20===e||21===e||28===e||29===e?32===t?r.ccRCL():33===t?r.ccBS():34===t?r.ccAOF():35===t?r.ccAON():36===t?r.ccDER():37===t?r.ccRU(2):38===t?r.ccRU(3):39===t?r.ccRU(4):40===t?r.ccFON():41===t?r.ccRDC():42===t?r.ccTR():43===t?r.ccRTD():44===t?r.ccEDM():45===t?r.ccCR():46===t?r.ccENM():47===t&&r.ccEOC():r.ccTO(t-32),qt(e,t,i),this.currentChannel=n),!0)},t.parseMidrow=function(e,t){var n=0;return(17===e||25===e)&&32<=t&&t<=47&&((n=17===e?1:2)!==this.currentChannel?(this.logger.log(0,"Mismatch channel in midrow parsing"),!1):!!(n=this.channels[n])&&(n.ccMIDROW(t),this.logger.log(3,"MIDROW ("+Kt([e,t])+")"),!0))},t.parsePAC=function(e,t){var n=this.cmdHistory;if(!((17<=e&&e<=23||25<=e&&e<=31)&&64<=t&&t<=127||(16===e||24===e)&&64<=t&&t<=95))return!1;if($t(e,t,n))qt(null,null,n);else{var r=e<=23?1:2,i=(64<=t&&t<=95?1==r?Ta:Ea:1==r?Sa:ka)[e],a=this.channels[r];if(!a)return!1;a.setPAC(this.interpretPAC(i,t)),qt(e,t,n),this.currentChannel=r}return!0},t.interpretPAC=function(e,t){return(e={color:null,italics:!1,indent:null,underline:!1,row:e}).underline=1==(1&(t=95<t?t-96:t-64)),t<=13?e.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(t/2)]:t<=15?(e.italics=!0,e.color="white"):e.indent=4*Math.floor((t-16)/2),e},t.parseChars=function(e,t){var n,r=null,i=null;return 17<=(i=25<=e?(n=2,e-8):(n=1,e))&&i<=19?(this.logger.log(2,"Special char '"+Wt(i=17===i?t+80:18===i?t+112:t+144)+"' in channel "+n),r=[i]):32<=e&&e<=127&&(r=0===t?[e]:[e,t]),r&&(n=Kt(r),this.logger.log(3,"Char codes = "+n.join(",")),qt(e,t,this.cmdHistory)),r},t.parseBackgroundAttributes=function(e,t){var n,r;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=wa[n],t%2==1&&(r.background=r.background+"_semi")):45===t?r.background="transparent":(r.foreground="black",47===t&&(r.underline=!0)),this.channels[e<=23?1:2].setBkgData(r),qt(e,t,this.cmdHistory),!0)},t.reset=function(){for(var e=0;e<Object.keys(this.channels).length;e++){var t=this.channels[e];t&&t.reset()}this.cmdHistory={a:null,b:null}},t.cueSplitAtTime=function(e){for(var t=0;t<this.channels.length;t++){var n=this.channels[t];n&&n.cueSplitAtTime(e)}},e}(),Da=function(){function e(e,t){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=e,this.trackName=t}var t=e.prototype;return t.dispatchCue=function(){null!==this.startTime&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)},t.newCue=function(e,t,n){(null===this.startTime||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=n,this.timelineController.createCaptionsTrack(this.trackName)},t.reset=function(){this.cueRanges=[],this.startTime=null},e}(),Pa=null!=ur&&ur.VTTCue?self.VTTCue:(fa=["","lr","rl"],pa=["start","middle","end","left","right"],Qt.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},Qt),Ma=function(){function e(){}return e.prototype.decode=function(e,t){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))},e}(),ja=function(){function e(){this.values=Object.create(null)}var t=e.prototype;return t.set=function(e,t){this.get(e)||""===t||(this.values[e]=t)},t.get=function(e,t,n){return n?this.has(e)?this.values[e]:t[n]:this.has(e)?this.values[e]:t},t.has=function(e){return e in this.values},t.alt=function(e,t,n){for(var r=0;r<n.length;++r)if(t===n[r]){this.set(e,t);break}},t.integer=function(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))},t.percent=function(e,t){return!!(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)&&0<=(t=parseFloat(t))&&t<=100)&&(this.set(e,t),!0)},e}(),Ua=new Pa(0,0,""),Ba="middle"===Ua.align?"middle":"center",Fa=function(){function e(){this.state="INITIAL",this.buffer="",this.decoder=new Ma,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var t=e.prototype;return t.parse=function(e){function t(){for(var e=0,t=tn(t=n.buffer);e<t.length&&"\r"!==t[e]&&"\n"!==t[e];)++e;var r=t.slice(0,e);return"\r"===t[e]&&++e,"\n"===t[e]&&++e,n.buffer=t.slice(e),r}var n=this;e&&(n.buffer+=n.decoder.decode(e,{stream:!0}));try{var r="";if("INITIAL"===n.state){if(!/\r\n|\n/.test(n.buffer))return this;var i=(r=t()).match(/^()?WEBVTT([ \t].*)?$/);if(null==i||!i[0])throw new Error("Malformed WebVTT signature.");n.state="HEADER"}for(var a=!1;n.buffer;){if(!/\r\n|\n/.test(n.buffer))return this;switch(a?a=!1:r=t(),n.state){case"HEADER":/:/.test(r)?en(r,(function(e,t){}),/:/):r||(n.state="ID");continue;case"NOTE":r||(n.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(r)){n.state="NOTE";break}if(!r)continue;if(n.cue=new Pa(0,0,""),n.state="CUE",-1===r.indexOf("--\x3e")){n.cue.id=r;continue}case"CUE":if(!n.cue){n.state="BADCUE";continue}try{!function(e,t,n){function r(){var t=Zt(e);if(null===t)throw new Error("Malformed timestamp: "+o);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function i(){e=e.replace(/^\s+/,"")}var a,s,o=e;if(i(),t.startTime=r(),i(),"--\x3e"!==e.slice(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+o);e=e.slice(3),i(),t.endTime=r(),i(),a=e,t=t,s=new ja,en(a,(function(e,t){var r;switch(e){case"region":for(var i=n.length-1;0<=i;i--)if(n[i].id===t){s.set(e,n[i].region);break}break;case"vertical":s.alt(e,t,["rl","lr"]);break;case"line":r=t.split(","),s.integer(e,r[0]),s.percent(e,r[0])&&s.set("snapToLines",!1),s.alt(e,r[0],["auto"]),2===r.length&&s.alt("lineAlign",r[1],["start",Ba,"end"]);break;case"position":r=t.split(","),s.percent(e,r[0]),2===r.length&&s.alt("positionAlign",r[1],["start",Ba,"end","line-left","line-right","auto"]);break;case"size":s.percent(e,t);break;case"align":s.alt(e,t,["start",Ba,"end","left","right"])}}),/:/,/\s/),t.region=s.get("region",null),t.vertical=s.get("vertical",""),"auto"===(a=s.get("line","auto"))&&-1===Ua.line&&(a=-1),t.line=a,t.lineAlign=s.get("lineAlign","start"),t.snapToLines=s.get("snapToLines",!0),t.size=s.get("size",100),t.align=s.get("align",Ba),"auto"===(a=s.get("position","auto"))&&50===Ua.position&&(a="start"===t.align||"left"===t.align?0:"end"===t.align||"right"===t.align?100:50),t.position=a}(r,n.cue,n.regionList)}catch(e){n.cue=null,n.state="BADCUE";continue}n.state="CUETEXT";continue;case"CUETEXT":var s=-1!==r.indexOf("--\x3e");if(!r||s&&(a=!0)){n.oncue&&n.cue&&n.oncue(n.cue),n.cue=null,n.state="ID";continue}if(null===n.cue)continue;n.cue.text&&(n.cue.text+="\n"),n.cue.text+=r;continue;case"BADCUE":r||(n.state="ID")}}}catch(e){"CUETEXT"===n.state&&n.cue&&n.oncue&&n.oncue(n.cue),n.cue=null,n.state="INITIAL"===n.state?"BADWEBVTT":"BADCUE"}return this},t.flush=function(){var e=this;try{if(!e.cue&&"HEADER"!==e.state||(e.buffer+="\n\n",e.parse()),"INITIAL"===e.state||"BADWEBVTT"===e.state)throw new Error("Malformed WebVTT signature.")}catch(t){e.onparsingerror&&e.onparsingerror(t)}return e.onflush&&e.onflush(),this},e}(),Na=/\r\n|\n\r|\n|\r/g,Ga=function(e){for(var t=5381,n=e.length;n;)t=33*t^e.charCodeAt(--n);return(t>>>0).toString()},Va="stpp.ttml.im1t",Ha=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,za=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,Wa={left:"start",center:"center",right:"end",start:"start",end:"end"};ia=function(){function e(e){this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}},this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},e.on(zn.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(zn.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(zn.MANIFEST_LOADING,this.onManifestLoading,this),e.on(zn.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(zn.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(zn.FRAG_LOADING,this.onFragLoading,this),e.on(zn.FRAG_LOADED,this.onFragLoaded,this),e.on(zn.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(zn.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(zn.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(zn.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(zn.BUFFER_FLUSHING,this.onBufferFlushing,this)}var t=e.prototype;return t.destroy=function(){var e=this.hls;e.off(zn.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(zn.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(zn.MANIFEST_LOADING,this.onManifestLoading,this),e.off(zn.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(zn.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(zn.FRAG_LOADING,this.onFragLoading,this),e.off(zn.FRAG_LOADED,this.onFragLoaded,this),e.off(zn.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(zn.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(zn.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(zn.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(zn.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.media=null,this.cea608Parser1=this.cea608Parser2=void 0},t.initCea608Parsers=function(){var e=new Da(this,"textTrack1"),t=new Da(this,"textTrack2"),n=new Da(this,"textTrack3"),r=new Da(this,"textTrack4");this.cea608Parser1=new Oa(1,e,t),this.cea608Parser2=new Oa(3,n,r)},t.addCues=function(e,t,n,r,i){for(var a,s,o,u=!1,l=i.length;l--;){var c=i[l],d=(a=c[0],d=c[1],s=t,Math.min(d,n)-Math.max(a,s));if(0<=d&&(c[0]=Math.min(c[0],t),c[1]=Math.max(c[1],n),u=!0,.5<d/(n-t)))return}u||i.push([t,n]),this.config.renderTextTracksNatively?(o=this.captionsTracks[e],this.Cues.newCue(o,t,n,r)):(o=this.Cues.newCue(null,t,n,r),this.hls.trigger(zn.CUES_PARSED,{type:"captions",cues:o,track:e}))},t.onInitPtsFound=function(e,t){var n=this,r=t.frag,i=t.id,a=t.initPTS,s=(t=t.timescale,this.unparsedVttFrags);"main"===i&&(this.initPTS[r.cc]={baseTime:a,timescale:t}),s.length&&(this.unparsedVttFrags=[],s.forEach((function(e){n.onFragLoaded(zn.FRAG_LOADED,e)})))},t.getExistingTrack=function(e,t){var n=this.media;if(n)for(var r=0;r<n.textTracks.length;r++){var i=n.textTracks[r];if(hn(i,{name:e,lang:t,attrs:{}}))return i}return null},t.createCaptionsTrack=function(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)},t.createNativeTrack=function(e){var t,n,r,i,a;this.captionsTracks[e]||(i=this.captionsProperties,t=this.captionsTracks,n=this.media,r=(i=i[e]).label,i=i.languageCode,(a=this.getExistingTrack(r,i))?(t[e]=a,Te(t[e]),_e(t[e],n)):(a=this.createTextTrack("captions",r,i))&&(a[e]=!0,t[e]=a))},t.createNonNativeTrack=function(e){var t;this.nonNativeCaptionsTracks[e]||(t=this.captionsProperties[e])&&(t={_id:e,label:t.label,kind:"captions",default:!!t.media&&!!t.media.default,closedCaptions:t.media},this.nonNativeCaptionsTracks[e]=t,this.hls.trigger(zn.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[t]}))},t.createTextTrack=function(e,t,n){var r=this.media;if(r)return r.addTextTrack(e,t,n)},t.onMediaAttaching=function(e,t){this.media=t.media,this._cleanTracks()},t.onMediaDetaching=function(){var e=this.captionsTracks;Object.keys(e).forEach((function(t){Te(e[t]),delete e[t]})),this.nonNativeCaptionsTracks={},this.media=null},t.onManifestLoading=function(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}},this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},t._cleanTracks=function(){var e=this.media;if(e){var t=e.textTracks;if(t)for(var n=0;n<t.length;n++)Te(t[n])}},t.onSubtitleTracksUpdated=function(e,t){var n,r=this,i=(t=t.subtitleTracks||[]).some((function(e){return e.textCodec===Va}));(this.config.enableWebVTT||i&&this.config.enableIMSC1)&&(Gt(this.tracks,t)?this.tracks=t:(this.textTracks=[],this.tracks=t,this.config.renderTextTracksNatively?(i=this.media,n=i?Ee(i.textTracks):null,this.tracks.forEach((function(e,t){var i,a;if(n){for(var s=null,o=0;o<n.length;o++)if(n[o]&&hn(n[o],e)){s=n[o],n[o]=null;break}s&&(a=s)}a?Te(a):(i=dn(e),(a=r.createTextTrack(i,e.name,e.lang))&&(a.mode="disabled")),a&&r.textTracks.push(a)})),null!=n&&n.length&&(t=n.filter((function(e){return null!==e})).map((function(e){return e.label}))).length&&this.hls.logger.warn("Media element contains unused subtitle tracks: "+t.join(", ")+". Replace media element for each source to clear TextTracks and captions menu.")):this.tracks.length&&(i=this.tracks.map((function(e){return{label:e.name,kind:e.type.toLowerCase(),default:e.default,subtitleTrack:e}})),this.hls.trigger(zn.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:i}))))},t.onManifestLoaded=function(e,t){var n=this;this.config.enableCEA708Captions&&t.captions&&t.captions.forEach((function(e){var t=/(?:CC|SERVICE)([1-4])/.exec(e.instreamId);t&&(t="textTrack"+t[1],t=n.captionsProperties[t])&&(t.label=e.name,e.lang&&(t.languageCode=e.lang),t.media=e)}))},t.closedCaptionsForLevel=function(e){return null==(e=this.hls.levels[e.level])?void 0:e.attrs["CLOSED-CAPTIONS"]},t.onFragLoading=function(e,t){var n,r,i,a,s;this.enabled&&t.frag.type===Br&&(n=this.cea608Parser1,r=this.cea608Parser2,i=this.lastSn,n)&&r&&(a=(s=t.frag).cc,s=s.sn,t=null!=(t=null==(t=t.part)?void 0:t.index)?t:-1,s===i+1||s===i&&t===this.lastPartIndex+1||a===this.lastCc||(n.reset(),r.reset()),this.lastCc=a,this.lastSn=s,this.lastPartIndex=t)},t.onFragLoaded=function(e,t){var n,r,i=t.frag,a=t.payload;i.type===Nr&&(a.byteLength?(r="stats"in t,null!=(n=i.decryptdata)&&n.encrypted&&!r||(n=this.tracks[i.level],(r=this.vttCCs)[i.cc]||(r[i.cc]={start:i.start,prevCC:this.prevCC,new:!0},this.prevCC=i.cc),n&&n.textCodec===Va?this._parseIMSC1(i,a):this._parseVTTs(t))):this.hls.trigger(zn.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:new Error("Empty subtitle payload")}))},t._parseIMSC1=function(e,t){var n=this,r=this.hls;an(t,this.initPTS[e.cc],(function(t){n._appendCues(t,e.level),r.trigger(zn.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})}),(function(t){r.logger.log("Failed to parse IMSC1: "+t),r.trigger(zn.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:t})}))},t._parseVTTs=function(e){var t,n=this,r=e.frag,i=e.payload,a=this.initPTS,s=this.unparsedVttFrags,o=a.length-1;a[r.cc]||-1!=o?(t=this.hls,function(e,t,n,r,i,a,s){var o,u,l,c=new Fa,d=(e=gr(new Uint8Array(e)).trim().replace(Na,"\n").split("\n"),[]),h=t?(o=t.baseTime,u=t.timescale,Et(o,Zi,1/(u=void 0===u?1:u))):0,f="00:00.000",p=0,v=0,m=!0;c.oncue=function(e){var a=n[r],s=n.ccOffset,o=(p-h)/9e4;if(null!=a&&a.new)if(void 0!==v)s=n.ccOffset=a.start;else{var u=n,c=(a=o,u[r]),f=u[c.prevCC];if(!f||!f.new&&c.new)u.ccOffset=u.presentationOffset=c.start,c.new=!1;else{for(;null!=f&&f.new;)u.ccOffset+=c.start-f.start,c.new=!1,f=u[(c=f).prevCC];u.presentationOffset=a}}if(o){if(!t)return void(l=new Error("Missing initPTS for VTT MPEGTS"));s=o-n.presentationOffset}a=e.endTime-e.startTime,o=wt(9e4*(e.startTime+s-v),9e4*i)/9e4,e.startTime=Math.max(o,0),e.endTime=Math.max(o+a,0),s=e.text.trim(),e.text=decodeURIComponent(encodeURIComponent(s)),e.id||(e.id=rn(e.startTime,e.endTime,s)),0<e.endTime&&d.push(e)},c.onparsingerror=function(e){l=e},c.onflush=function(){l?s(l):a(d)},e.forEach((function(e){if(m){if(nn(e,"X-TIMESTAMP-MAP=")){m=!1,e.slice(16).split(",").forEach((function(e){nn(e,"LOCAL:")?f=e.slice(6):nn(e,"MPEGTS:")&&(p=parseInt(e.slice(7)))}));try{v=function(e){var t=parseInt(e.slice(-3)),n=parseInt(e.slice(-6,-4)),r=parseInt(e.slice(-9,-7)),i=9<e.length?parseInt(e.substring(0,e.indexOf(":"))):0;if(Gn(t)&&Gn(n)&&Gn(r)&&Gn(i))return(t+=1e3*n)+6e4*r+36e5*i;throw Error("Malformed X-TIMESTAMP-MAP: Local:"+e)}(f)/1e3}catch(e){l=e}return}""===e&&(m=!1)}c.parse(e+"\n")})),c.flush()}(null!=(a=r.initSegment)&&a.data?Y(r.initSegment.data,new Uint8Array(i)):i,this.initPTS[r.cc],this.vttCCs,r.cc,r.start,(function(e){n._appendCues(e,r.level),t.trigger(zn.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:r})}),(function(a){var u="Missing initPTS for VTT MPEGTS"===a.message;u?s.push(e):n._fallbackToIMSC1(r,i),t.logger.log("Failed to parse VTT cue: "+a),u&&o>r.cc||t.trigger(zn.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r,error:a})}))):s.push(e)},t._fallbackToIMSC1=function(e,t){var n=this,r=this.tracks[e.level];r.textCodec||an(t,this.initPTS[e.cc],(function(){r.textCodec=Va,n._parseIMSC1(e,t)}),(function(){r.textCodec="wvtt"}))},t._appendCues=function(e,t){var n,r,i=this.hls;this.config.renderTextTracksNatively?(n=this.textTracks[t])&&"disabled"!==n.mode&&e.forEach((function(e){return be(n,e)})):(r=this.tracks[t])&&(r=r.default?"default":"subtitles"+t,i.trigger(zn.CUES_PARSED,{type:"subtitles",cues:e,track:r}))},t.onFragDecrypted=function(e,t){t.frag.type===Nr&&this.onFragLoaded(zn.FRAG_LOADED,t)},t.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},t.onFragParsingUserdata=function(e,t){if(this.enabled&&this.config.enableCEA708Captions){var n=t.frag,r=t.samples;if(n.type!==Br||"NONE"!==this.closedCaptionsForLevel(n))for(var i=0;i<r.length;i++){var a=r[i].bytes;a&&(this.cea608Parser1||this.initCea608Parsers(),a=this.extractCea608Data(a),this.cea608Parser1.addData(r[i].pts,a[0]),this.cea608Parser2.addData(r[i].pts,a[1]))}}},t.onBufferFlushing=function(e,t){var n,r,i=t.startOffset,a=t.endOffset,s=t.endOffsetSubtitles,o=(t=t.type,this.media);!o||o.currentTime<a||(t&&"video"!==t||(n=this.captionsTracks,Object.keys(n).forEach((function(e){return Se(n[e],i,a)}))),this.config.renderTextTracksNatively&&0===i&&void 0!==s&&(r=this.textTracks,Object.keys(r).forEach((function(e){return Se(r[e],i,s)}))))},t.extractCea608Data=function(e){for(var t=[[],[]],n=31&e[0],r=2,i=0;i<n;i++){var a=e[r++],s=127&e[r++],o=127&e[r++];0==s&&0==o||0==(4&a)||0!=(a&=3)&&1!=a||(t[a].push(s),t[a].push(o))}return t},e}();Vi=function(){function e(e){this.hls=void 0,this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.clientRect=void 0,this.streamController=void 0,this.hls=e,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var t=e.prototype;return t.setStreamController=function(e){this.streamController=e},t.destroy=function(){this.hls&&this.unregisterListener(),this.timer&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},t.registerListeners=function(){var e=this.hls;e.on(zn.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(zn.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(zn.MANIFEST_PARSED,this.onManifestParsed,this),e.on(zn.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(zn.BUFFER_CODECS,this.onBufferCodecs,this),e.on(zn.MEDIA_DETACHING,this.onMediaDetaching,this)},t.unregisterListener=function(){var e=this.hls;e.off(zn.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(zn.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(zn.MANIFEST_PARSED,this.onManifestParsed,this),e.off(zn.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(zn.BUFFER_CODECS,this.onBufferCodecs,this),e.off(zn.MEDIA_DETACHING,this.onMediaDetaching,this)},t.onFpsDropLevelCapping=function(e,t){t=this.hls.levels[t.droppedLevel],this.isLevelAllowed(t)&&this.restrictedLevels.push({bitrate:t.bitrate,height:t.height,width:t.width})},t.onMediaAttaching=function(e,t){this.media=t.media instanceof HTMLVideoElement?t.media:null,this.clientRect=null,this.timer&&this.hls.levels.length&&this.detectPlayerSize()},t.onManifestParsed=function(e,t){var n=this.hls;this.restrictedLevels=[],this.firstLevel=t.firstLevel,n.config.capLevelToPlayerSize&&t.video&&this.startCapping()},t.onLevelsUpdated=function(e,t){this.timer&&Gn(this.autoLevelCapping)&&this.detectPlayerSize()},t.onBufferCodecs=function(e,t){this.hls.config.capLevelToPlayerSize&&t.video&&this.startCapping()},t.onMediaDetaching=function(){this.stopCapping(),this.media=null},t.detectPlayerSize=function(){var e,t,n;this.media&&(this.mediaHeight<=0||this.mediaWidth<=0?this.clientRect=null:(e=this.hls.levels).length&&(t=this.hls,(n=this.getMaxLevel(e.length-1))!==this.autoLevelCapping&&t.logger.log("Setting autoLevelCapping to "+n+": "+e[n].height+"p@"+e[n].bitrate+" for media "+this.mediaWidth+"x"+this.mediaHeight),t.autoLevelCapping=n,t.autoLevelEnabled&&t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping))},t.getMaxLevel=function(t){var n=this,r=this.hls.levels;return r.length?(r=r.filter((function(e,r){return n.isLevelAllowed(e)&&r<=t})),this.clientRect=null,e.getMaxLevelByMediaSize(r,this.mediaWidth,this.mediaHeight)):-1},t.startCapping=function(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())},t.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},t.getDimensions=function(){var e,t,n;return this.clientRect||(t={width:0,height:0},(e=this.media)&&(n=e.getBoundingClientRect(),t.width=n.width,t.height=n.height,t.width||t.height||(t.width=n.right-n.left||e.width||0,t.height=n.bottom-n.top||e.height||0)),this.clientRect=t)},t.isLevelAllowed=function(e){return!this.restrictedLevels.some((function(t){return e.bitrate===t.bitrate&&e.width===t.width&&e.height===t.height}))},e.getMaxLevelByMediaSize=function(e,t,n){if(null==e||!e.length)return-1;for(var r,i=e.length-1,a=Math.max(t,n),s=0;s<e.length;s+=1){var o=e[s];if((o.width>=a||o.height>=a)&&(o=o,!(r=e[s+1])||o.width!==r.width||o.height!==r.height)){i=s;break}}return i},u(e,[{key:"mediaWidth",get:function(){return this.getDimensions().width*this.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*this.contentScaleFactor}},{key:"contentScaleFactor",get:function(){var e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch(e){}return e}}])}(),ur=function(){function e(e){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=e,this.registerListeners()}var t=e.prototype;return t.setStreamController=function(e){this.streamController=e},t.registerListeners=function(){this.hls.on(zn.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.on(zn.MEDIA_DETACHING,this.onMediaDetaching,this)},t.unregisterListeners=function(){this.hls.off(zn.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.off(zn.MEDIA_DETACHING,this.onMediaDetaching,this)},t.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},t.onMediaAttaching=function(e,t){var n=this.hls.config;n.capLevelOnFPSDrop&&(t=t.media instanceof self.HTMLVideoElement?t.media:null,(this.media=t)&&"function"==typeof t.getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),n.fpsDroppedMonitoringPeriod))},t.onMediaDetaching=function(){this.media=null},t.checkFPS=function(e,t,n){var r,i,a,s,o=performance.now();t&&(this.lastTime&&(s=o-this.lastTime,r=n-this.lastDroppedFrames,i=t-this.lastDecodedFrames,s=1e3*r/s,(a=this.hls).trigger(zn.FPS_DROP,{currentDropped:r,currentDecoded:i,totalDroppedFrames:n}),0<s)&&r>a.config.fpsDroppedMonitoringThreshold*i&&(s=a.currentLevel,a.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+s),0<s)&&(-1===a.autoLevelCapping||a.autoLevelCapping>=s)&&(a.trigger(zn.FPS_DROP_LEVEL_CAPPING,{level:s-=1,droppedLevel:a.currentLevel}),a.autoLevelCapping=s,this.streamController.nextLevelSwitch()),this.lastTime=o,this.lastDroppedFrames=n,this.lastDecodedFrames=t)},t.checkFPSInterval=function(){var e,t=this.media;t&&(this.isVideoPlaybackQualityAvailable?(e=t.getVideoPlaybackQuality(),this.checkFPS(t,e.totalVideoFrames,e.droppedVideoFrames)):this.checkFPS(t,t.webkitDecodedFrameCount,t.webkitDroppedFrameCount))},e}();var Ka,qa,$a,Ya=function(e){function t(n){var r=e.call(this,"eme",n.logger)||this;return r.hls=void 0,r.config=void 0,r.media=null,r.keyFormatPromise=null,r.keySystemAccessPromises={},r._requestLicenseFailureCount=0,r.mediaKeySessions=[],r.keyIdToKeySessionPromise={},r.setMediaKeysQueue=t.CDMCleanupPromise?[t.CDMCleanupPromise]:[],r.onMediaEncrypted=function(e){var t,n,i=e.initDataType,a=e.initData;if(r.debug('"'+e.type+'" event: init data type: "'+i+'"'),null!==a){if("sinf"===i&&r.config.drmSystems[lr.FAIRPLAY]){e=U(new Uint8Array(a));try{var s=T(JSON.parse(e).sinf),o=$(new Uint8Array(s));if(!o)return;t=o.subarray(8,24),n=lr.FAIRPLAY}catch(e){return void r.warn('Failed to parse sinf "encrypted" event message initData')}}else{if(null===(e=function(e){if(!(e instanceof ArrayBuffer)||e.byteLength<32)return null;var t={version:0,systemId:"",kids:null,data:null},n=new DataView(e),r=n.getUint32(0);if(e.byteLength!==r&&44<r)return null;if(1886614376!==n.getUint32(4))return null;if(t.version=n.getUint32(8)>>>24,1<t.version)return null;t.systemId=yr(new Uint8Array(e,12,16));var i=n.getUint32(28);if(0===t.version){if(r-32<i)return null;t.data=new Uint8Array(e,32,i)}else if(1===t.version){t.kids=[];for(var a=0;a<i;a++)t.kids.push(new Uint8Array(e,32+16*a,16))}return t}(a)))return;0===e.version&&e.systemId===dr&&e.data&&(t=e.data.subarray(8,24)),n=function(e){if(e===dr)return lr.WIDEVINE}(e.systemId)}if(n&&t){for(var u,l=yr(t),c=(s=r).keyIdToKeySessionPromise,d=s.mediaKeySessions,h=c[l],f=0;f<d.length&&(0===(u=function(){var e,n=d[f],s=n.decryptdata;return s.pssh||!s.keyId?0:(e=yr(s.keyId),l===e||-1!==s.uri.replace(/-/g,"").indexOf(l)?(h=c[e],delete c[e],s.pssh=new Uint8Array(a),s.keyId=t,h=c[l]=h.then((function(){return r.generateRequestWithPreferredKeySession(n,i,a,"encrypted-event-key-match")})),1):void 0)}())||1!==u);f++);(h=h||(c[l]=r.getKeySystemSelectionPromise([n]).then((function(e){var n=e.keySystem,s=e.mediaKeys,o=(r.throwIfDestroyed(),new Er("ISO-23001-7",l,null!=(e=C(n))?e:""));return o.pssh=new Uint8Array(a),o.keyId=t,r.attemptSetMediaKeys(n,s).then((function(){r.throwIfDestroyed();var e=r.createMediaKeySessionContext({decryptdata:o,keySystem:n,mediaKeys:s});return r.generateRequestWithPreferredKeySession(e,i,a,"encrypted-event-no-match")}))})))).catch((function(e){return r.handleError(e)}))}}},r.onWaitingForKey=function(e){r.log('"'+e.type+'" event')},r.hls=n,r.config=n.config,r.registerListeners(),r}c(t,e);var r=t.prototype;return r.destroy=function(){this.unregisterListeners(),this.onMediaDetached();var e=this.config;e.requestMediaKeySystemAccessFunc=null,e.licenseXhrSetup=e.licenseResponseCallback=void 0,e.drmSystems=e.drmSystemOptions={},this.hls=this.config=this.keyIdToKeySessionPromise=null,this.onMediaEncrypted=this.onWaitingForKey=null},r.registerListeners=function(){this.hls.on(zn.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(zn.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(zn.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(zn.MANIFEST_LOADED,this.onManifestLoaded,this)},r.unregisterListeners=function(){this.hls.off(zn.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(zn.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(zn.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(zn.MANIFEST_LOADED,this.onManifestLoaded,this)},r.getLicenseServerUrl=function(e){var t=(n=this.config).drmSystems,n=n.widevineLicenseUrl;if(t=t[e])return t.licenseUrl;if(e===lr.WIDEVINE&&n)return n;throw new Error('no license server URL configured for key-system "'+e+'"')},r.getServerCertificateUrl=function(e){var t=this.config.drmSystems[e];if(t)return t.serverCertificateUrl;this.log('No Server Certificate in config.drmSystems["'+e+'"]')},r.attemptKeySystemAccess=function(e){function t(e,t,n){return!!e&&n.indexOf(e)===t}var n=this,r=this.hls.levels,i=r.map((function(e){return e.audioCodec})).filter(t),a=r.map((function(e){return e.videoCodec})).filter(t);return i.length+a.length===0&&a.push("avc1.42e01e"),new Promise((function(t,r){!function e(s){var o=s.shift();n.getMediaKeysPromise(o,i,a).then((function(e){return t({keySystem:o,mediaKeys:e})})).catch((function(t){s.length?e(s):r(t instanceof Xa?t:new Xa({type:Wn.KEY_SYSTEM_ERROR,details:Kn.KEY_SYSTEM_NO_ACCESS,error:t,fatal:!0},t.message))}))}(e)}))},r.requestMediaKeySystemAccess=function(e,t){var n,r=this.config.requestMediaKeySystemAccessFunc;return"function"!=typeof r?(n="Configured requestMediaKeySystemAccess is not a function "+r,null===hr&&"http:"===self.location.protocol&&(n="navigator.requestMediaKeySystemAccess is not available over insecure protocol "+location.protocol),Promise.reject(new Error(n))):r(e,t)},r.getMediaKeysPromise=function(e,t,n){var r,i=this,a=(t=function(e,t,n,r){var i,a;switch(e){case lr.FAIRPLAY:i=["cenc","sinf"];break;case lr.WIDEVINE:case lr.PLAYREADY:i=["cenc"];break;case lr.CLEARKEY:i=["cenc","keyids"];break;default:throw new Error("Unknown key-system: "+e)}return n=n,[{initDataTypes:i,persistentState:(a=r).persistentState||"optional",distinctiveIdentifier:a.distinctiveIdentifier||"optional",sessionTypes:a.sessionTypes||[a.sessionType||"temporary"],audioCapabilities:t.map((function(e){return{contentType:'audio/mp4; codecs="'+e+'"',robustness:a.audioRobustness||"",encryptionScheme:a.audioEncryptionScheme||null}})),videoCapabilities:n.map((function(e){return{contentType:'video/mp4; codecs="'+e+'"',robustness:a.videoRobustness||"",encryptionScheme:a.videoEncryptionScheme||null}}))}]}(e,t,n,this.config.drmSystemOptions),this.keySystemAccessPromises[e]);return(n=null==a?void 0:a.keySystemAccess)?n.then((function(){return a.mediaKeys})):(this.log('Requesting encrypted media "'+e+'" key-system access with config: '+JSON.stringify(t)),n=this.requestMediaKeySystemAccess(e,t),r=this.keySystemAccessPromises[e]={keySystemAccess:n},n.catch((function(t){i.log('Failed to obtain access to key-system "'+e+'": '+t)})),n.then((function(t){i.log('Access for key-system "'+t.keySystem+'" obtained');var n=i.fetchServerCertificate(e);return i.log('Create media-keys for "'+e+'"'),r.mediaKeys=t.createMediaKeys().then((function(t){return i.log('Media-keys created for "'+e+'"'),n.then((function(n){return n?i.setMediaKeysServerCertificate(t,e,n):t}))})),r.mediaKeys.catch((function(t){i.error('Failed to create media-keys for "'+e+'"}: '+t)})),r.mediaKeys})))},r.createMediaKeySessionContext=function(e){var t=e.decryptdata,n=e.keySystem,r=(e=e.mediaKeys,this.log('Creating key-system session "'+n+'" keyId: '+yr(t.keyId||[])),e.createSession());t={decryptdata:t,keySystem:n,mediaKeys:e,mediaKeysSession:r,keyStatus:"status-pending"};return this.mediaKeySessions.push(t),t},r.renewKeySession=function(e){var t,n,r=e.decryptdata;r.pssh?(t=this.createMediaKeySessionContext(e),n=this.getKeyIdString(r),this.keyIdToKeySessionPromise[n]=this.generateRequestWithPreferredKeySession(t,"cenc",r.pssh,"expired")):this.warn("Could not renew expired session. Missing pssh initData."),this.removeSession(e)},r.getKeyIdString=function(e){if(!e)throw new Error("Could not read keyId of undefined decryptdata");if(null===e.keyId)throw new Error("keyId is null");return yr(e.keyId)},r.updateKeySession=function(e,t){var n=e.mediaKeysSession;return this.log('Updating key-session "'+n.sessionId+'" for keyID '+yr((null==(e=e.decryptdata)?void 0:e.keyId)||[])+"\n } (data length: "+(t&&t.byteLength)+")"),n.update(t)},r.selectKeySystemFormat=function(e){var t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log("Selecting key-system from fragment (sn: "+e.sn+" "+e.type+": "+e.level+") key formats "+t.join(", ")),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise},r.getKeyFormatPromise=function(e){var t=this;return new Promise((function(n,r){var i=A(t.config),a=e.map(w).filter((function(e){return!!e&&-1!==i.indexOf(e)}));return t.getKeySystemSelectionPromise(a).then((function(e){var t=C(e=e.keySystem);t?n(t):r(new Error('Unable to find format for key-system "'+e+'"'))})).catch(r)}))},r.loadKey=function(e){var t=this,n=e.keyInfo.decryptdata,r=this.getKeyIdString(n),i="(keyId: "+r+' format: "'+n.keyFormat+'" method: '+n.method+" uri: "+n.uri+")",a=(this.log("Starting session for key "+i),this.keyIdToKeySessionPromise[r]);return a||(a=this.keyIdToKeySessionPromise[r]=this.getKeySystemForKeyPromise(n).then((function(r){var a=r.keySystem,s=r.mediaKeys;return t.throwIfDestroyed(),t.log("Handle encrypted media sn: "+e.frag.sn+" "+e.frag.type+": "+e.frag.level+" using key "+i),t.attemptSetMediaKeys(a,s).then((function(){t.throwIfDestroyed();var e=t.createMediaKeySessionContext({keySystem:a,mediaKeys:s,decryptdata:n});return t.generateRequestWithPreferredKeySession(e,"cenc",n.pssh,"playlist-key")}))}))).catch((function(e){return t.handleError(e)})),a},r.throwIfDestroyed=function(e){if(!this.hls)throw new Error("invalid state")},r.handleError=function(e){this.hls&&(this.error(e.message),e instanceof Xa?this.hls.trigger(zn.ERROR,e.data):this.hls.trigger(zn.ERROR,{type:Wn.KEY_SYSTEM_ERROR,details:Kn.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))},r.getKeySystemForKeyPromise=function(e){var t=this.getKeyIdString(e);return(t=this.keyIdToKeySessionPromise[t])||(e=(t=w(e.keyFormat))?[t]:A(this.config),this.attemptKeySystemAccess(e))},r.getKeySystemSelectionPromise=function(e){if(0===(e=e.length?e:A(this.config)).length)throw new Xa({type:Wn.KEY_SYSTEM_ERROR,details:Kn.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},"Missing key-system license configuration options "+JSON.stringify({drmSystems:this.config.drmSystems}));return this.attemptKeySystemAccess(e)},r.attemptSetMediaKeys=function(e,t){var n=this,r=this.setMediaKeysQueue.slice(),i=(this.log('Setting media-keys for "'+e+'"'),Promise.all(r).then((function(){if(n.media)return n.media.setMediaKeys(t);throw new Error("Attempted to set mediaKeys without media element attached")})));return this.setMediaKeysQueue.push(i),i.then((function(){n.log('Media-keys set for "'+e+'"'),r.push(i),n.setMediaKeysQueue=n.setMediaKeysQueue.filter((function(e){return-1===r.indexOf(e)}))}))},r.generateRequestWithPreferredKeySession=function(e,t,n,r){var i,a,s,o=this,u=null==(u=this.config.drmSystems)||null==(u=u[e.keySystem])?void 0:u.generateRequest;if(u)try{var l=u.call(this.hls,t,n,e);if(!l)throw new Error("Invalid response from configured generateRequest filter");t=l.initDataType,n=e.decryptdata.pssh=l.initData?new Uint8Array(l.initData):null}catch(t){if(this.warn(t.message),null!=(u=this.hls)&&u.config.debug)throw t}return null===n?(this.log('Skipping key-session request for "'+r+'" (no initData)'),Promise.resolve(e)):(i=this.getKeyIdString(e.decryptdata),this.log('Generating key-session request for "'+r+'": '+i+" (init data type: "+t+" length: "+(n?n.byteLength:null)+")"),a=new ha,l=e._onmessage=function(t){var n,r=e.mediaKeysSession;r?(n=t.messageType,t=t.message,o.log('"'+n+'" message event for session "'+r.sessionId+'" message size: '+t.byteLength),"license-request"===n||"license-renewal"===n?o.renewLicense(e,t).catch((function(e){o.handleError(e),a.emit("error",e)})):"license-release"===n?e.keySystem===lr.FAIRPLAY&&(o.updateKeySession(e,S("acknowledged")),o.removeSession(e)):o.warn('unhandled media key message type "'+n+'"')):a.emit("error",new Error("invalid state"))},u=e._onkeystatuseschange=function(t){var n;e.mediaKeysSession?(o.onKeyStatusChange(e),n=e.keyStatus,a.emit("keyStatus",n),"expired"===n&&(o.warn(e.keySystem+" expired for key "+i),o.renewKeySession(e))):a.emit("error",new Error("invalid state"))},e.mediaKeysSession.addEventListener("message",l),e.mediaKeysSession.addEventListener("keystatuseschange",u),s=new Promise((function(e,t){a.on("error",t),a.on("keyStatus",(function(n){n.startsWith("usable")?e():"output-restricted"===n?t(new Xa({type:Wn.KEY_SYSTEM_ERROR,details:Kn.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):"internal-error"===n?t(new Xa({type:Wn.KEY_SYSTEM_ERROR,details:Kn.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},'key status changed to "'+n+'"')):"expired"===n?t(new Error("key expired while generating request")):o.warn('unhandled key status change "'+n+'"')}))})),e.mediaKeysSession.generateRequest(t,n).then((function(){var t;o.log('Request generated for key-session "'+(null==(t=e.mediaKeysSession)?void 0:t.sessionId)+'" keyId: '+i)})).catch((function(e){throw new Xa({type:Wn.KEY_SYSTEM_ERROR,details:Kn.KEY_SYSTEM_NO_SESSION,error:e,fatal:!1},"Error generating key-session request: "+e)})).then((function(){return s})).catch((function(t){throw a.removeAllListeners(),o.removeSession(e),t})).then((function(){return a.removeAllListeners(),e})))},r.onKeyStatusChange=function(e){var t=this;e.mediaKeysSession.keyStatuses.forEach((function(n,r){t.log('key status change "'+n+'" for keyStatuses keyId: '+yr("buffer"in r?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):new Uint8Array(r))+" session keyId: "+yr(new Uint8Array(e.decryptdata.keyId||[]))+" uri: "+e.decryptdata.uri),e.keyStatus=n}))},r.fetchServerCertificate=function(e){var t=this.config,r=new t.loader(t),i=this.getServerCertificateUrl(e);return i?(this.log('Fetching server certificate for "'+e+'"'),new Promise((function(a,s){var o={responseType:"arraybuffer",url:i},u={loadPolicy:u=t.certLoadPolicy.default,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0};r.load(o,u,{onSuccess:function(e,t,n,r){a(e.data)},onError:function(t,r,a,u){s(new Xa({type:Wn.KEY_SYSTEM_ERROR,details:Kn.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:a,response:n({url:o.url,data:void 0},t)},'"'+e+'" certificate request failed ('+i+"). Status: "+t.code+" ("+t.text+")"))},onTimeout:function(t,n,r){s(new Xa({type:Wn.KEY_SYSTEM_ERROR,details:Kn.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:r,response:{url:o.url,data:void 0}},'"'+e+'" certificate request timed out ('+i+")"))},onAbort:function(e,t,n){s(new Error("aborted"))}})}))):Promise.resolve()},r.setMediaKeysServerCertificate=function(e,t,n){var r=this;return new Promise((function(i,a){e.setServerCertificate(n).then((function(a){r.log("setServerCertificate "+(a?"success":"not supported by CDM")+" ("+(null==n?void 0:n.byteLength)+') on "'+t+'"'),i(e)})).catch((function(e){a(new Xa({type:Wn.KEY_SYSTEM_ERROR,details:Kn.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:e,fatal:!0},e.message))}))}))},r.renewLicense=function(e,t){var n=this;return this.requestLicense(e,new Uint8Array(t)).then((function(t){return n.updateKeySession(e,new Uint8Array(t)).catch((function(e){throw new Xa({type:Wn.KEY_SYSTEM_ERROR,details:Kn.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:e,fatal:!0},e.message)}))}))},r.unpackPlayReadyKeyMessage=function(e,t){var n=String.fromCharCode.apply(null,new Uint16Array(t.buffer));if(!n.includes("PlayReadyKeyMessage"))return e.setRequestHeader("Content-Type","text/xml; charset=utf-8"),t;var r=(t=(new DOMParser).parseFromString(n,"application/xml")).querySelectorAll("HttpHeader");if(0<r.length)for(var i=0,a=r.length;i<a;i++){var s=null==(s=(o=r[i]).querySelector("name"))?void 0:s.textContent,o=null==(o=o.querySelector("value"))?void 0:o.textContent;s&&o&&e.setRequestHeader(s,o)}if(n=t.querySelector("Challenge"),t=null==n?void 0:n.textContent)return S(atob(t));throw new Error("Cannot find <Challenge> in key message")},r.setupLicenseXHR=function(e,t,n,r){var i=this,a=this.config.licenseXhrSetup;return a?Promise.resolve().then((function(){if(n.decryptdata)return a.call(i.hls,e,t,n,r);throw new Error("Key removed")})).catch((function(s){if(n.decryptdata)return e.open("POST",t,!0),a.call(i.hls,e,t,n,r);throw s})).then((function(n){return e.readyState||e.open("POST",t,!0),{xhr:e,licenseChallenge:n||r}})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:r}))},r.requestLicense=function(e,t){var n=this,r=this.config.keyLoadPolicy.default;return new Promise((function(i,a){var s=n.getLicenseServerUrl(e.keySystem),o=(n.log("Sending license request to URL: "+s),new XMLHttpRequest);o.responseType="arraybuffer",o.onreadystatechange=function(){if(!n.hls||!e.mediaKeysSession)return a(new Error("invalid state"));if(4===o.readyState)if(200===o.status){n._requestLicenseFailureCount=0;var u=o.response;if(l=(n.log("License received "+(u instanceof ArrayBuffer?u.byteLength:u)),n.config.licenseResponseCallback))try{u=l.call(n.hls,o,s,e)}catch(u){n.error(u)}i(u)}else{var l;u=(l=r.errorRetry)?l.maxNumRetry:0;n._requestLicenseFailureCount++,n._requestLicenseFailureCount>u||400<=o.status&&o.status<500?a(new Xa({type:Wn.KEY_SYSTEM_ERROR,details:Kn.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:o,response:{url:s,data:void 0,code:o.status,text:o.statusText}},"License Request XHR failed ("+s+"). Status: "+o.status+" ("+o.statusText+")")):(l=u-n._requestLicenseFailureCount+1,n.warn("Retrying license request, "+l+" attempts left"),n.requestLicense(e,t).then(i,a))}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=o,n.setupLicenseXHR(o,s,e,t).then((function(t){var r=t.xhr;t=t.licenseChallenge;e.keySystem==lr.PLAYREADY&&(t=n.unpackPlayReadyKeyMessage(r,t)),r.send(t)}))}))},r.onMediaAttached=function(e,t){this.config.emeEnabled&&(t=t.media,(this.media=t).addEventListener("encrypted",this.onMediaEncrypted),t.addEventListener("waitingforkey",this.onWaitingForKey))},r.onMediaDetached=function(){var e=this,n=this.media,r=this.mediaKeySessions,i=(n&&(n.removeEventListener("encrypted",this.onMediaEncrypted),n.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null),this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},Er.clearKeyUriToKeyIdMap(),r.length);t.CDMCleanupPromise=Promise.all(r.map((function(t){return e.removeSession(t)})).concat(null==n?void 0:n.setMediaKeys(null).catch((function(t){e.log("Could not clear media keys: "+t)})))).then((function(){i&&(e.log("finished closing key sessions and clearing media keys"),r.length=0)})).catch((function(t){e.log("Could not close sessions and clear media keys: "+t)}))},r.onManifestLoading=function(){this.keyFormatPromise=null},r.onManifestLoaded=function(e,t){(t=t.sessionKeys)&&this.config.emeEnabled&&(this.keyFormatPromise||(t=t.reduce((function(e,t){return-1===e.indexOf(t.keyFormat)&&e.push(t.keyFormat),e}),[]),this.log("Selecting key-system from session-keys "+t.join(", ")),this.keyFormatPromise=this.getKeyFormatPromise(t)))},r.removeSession=function(e){var t=this,n=e.mediaKeysSession,r=e.licenseXhr;if(n)return this.log("Remove licenses and keys and close session "+n.sessionId),e._onmessage&&(n.removeEventListener("message",e._onmessage),e._onmessage=void 0),e._onkeystatuseschange&&(n.removeEventListener("keystatuseschange",e._onkeystatuseschange),e._onkeystatuseschange=void 0),r&&r.readyState!==XMLHttpRequest.DONE&&r.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0,-1<(r=this.mediaKeySessions.indexOf(e))&&this.mediaKeySessions.splice(r,1),n.remove().catch((function(e){t.log("Could not remove session: "+e)})).then((function(){return n.close()})).catch((function(e){t.log("Could not close session: "+e)}))},t}(v),Xa=(Ya.CDMCleanupPromise=void 0,function(e){function t(t,n){var r=e.call(this,n)||this;return r.data=void 0,t.error||(t.error=new Error(n)),(r.data=t).err=t.error,r}return c(t,e),t}(f(Error))),Ja=((rs=Ka=Ka||{}).MANIFEST="m",rs.AUDIO="a",rs.VIDEO="v",rs.MUXED="av",rs.INIT="i",rs.CAPTION="c",rs.TIMED_TEXT="tt",rs.KEY="k",rs.OTHER="o",(rs=qa=qa||{}).DASH="d",rs.HLS="h",rs.SMOOTH="s",rs.OTHER="o",(rs=$a=$a||{}).OBJECT="CMCD-Object",rs.REQUEST="CMCD-Request",rs.SESSION="CMCD-Session",rs.STATUS="CMCD-Status",(rs={})[$a.OBJECT]=["br","d","ot","tb"],rs[$a.REQUEST]=["bl","dl","mtp","nor","nrr","su"],rs[$a.SESSION]=["cid","pr","sf","sid","st","v"],rs[$a.STATUS]=["bs","rtp"],rs),Qa="Bare Item",Za=/[\x00-\x1f\x7f]+/,es={br:En,d:En,bl:kn,dl:kn,mtp:kn,nor:function(e,t){return null!=t&&t.baseUrl&&(e=function(e,t){var n=new URL(e);t=new URL(t);if(n.origin!==t.origin)return e;for(var r=n.pathname.split("/").slice(1),i=t.pathname.split("/").slice(1,-1);r[0]===i[0];)r.shift(),i.shift();for(;i.length;)i.shift(),r.unshift("..");return r.join("/")}(e,t.baseUrl)),encodeURIComponent(e)},rtp:kn,tb:En},ts="CMCD",ns=/CMCD=[^&#]+/,rs=function(){function e(e){var t=this,n=(e=(this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.includeKeys=void 0,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){t.initialized&&(t.starved=!0),t.buffering=!0},this.onPlaying=function(){t.initialized||(t.initialized=!0),t.buffering=!1},this.applyPlaylistData=function(e){try{t.apply(e,{ot:Ka.MANIFEST,su:!t.initialized})}catch(e){t.hls.logger.warn("Could not generate manifest CMCD data.",e)}},this.applyFragmentData=function(e){try{var n=e.frag,r=t.hls.levels[n.level],i=t.getObjectType(n),a={d:1e3*n.duration,ot:i},s=(i!==Ka.VIDEO&&i!==Ka.AUDIO&&i!=Ka.MUXED||(a.br=r.bitrate/1e3,a.tb=t.getTopBandwidth(i)/1e3,a.bl=t.getBufferLength(i)),t.getNextFrag(n));s&&s.url&&s.url!==n.url&&(a.nor=s.url),t.apply(e,a)}catch(e){t.hls.logger.warn("Could not generate segment CMCD data.",e)}},this.hls=e,this.config=e.config)).cmcd;null!=n&&(e.pLoader=this.createPlaylistLoader(),e.fLoader=this.createFragmentLoader(),this.sid=n.sessionId||function(){try{return crypto.randomUUID()}catch(r){try{var e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)}catch(e){var n=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=(n+16*Math.random())%16|0;return n=Math.floor(n/16),("x"==e?t:3&t|8).toString(16)}))}}}(),this.cid=n.contentId,this.useHeaders=!0===n.useHeaders,this.includeKeys=n.includeKeys,this.registerListeners())}var t=e.prototype;return t.registerListeners=function(){var e=this.hls;e.on(zn.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(zn.MEDIA_DETACHED,this.onMediaDetached,this),e.on(zn.BUFFER_CREATED,this.onBufferCreated,this)},t.unregisterListeners=function(){var e=this.hls;e.off(zn.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(zn.MEDIA_DETACHED,this.onMediaDetached,this),e.off(zn.BUFFER_CREATED,this.onBufferCreated,this)},t.destroy=function(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=this.media=null},t.onMediaAttached=function(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},t.onMediaDetached=function(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)},t.onBufferCreated=function(e,t){var n;this.audioBuffer=null==(n=t.tracks.audio)?void 0:n.buffer,this.videoBuffer=null==(n=t.tracks.video)?void 0:n.buffer},t.createData=function(){var e;return{v:1,sf:qa.HLS,sid:this.sid,cid:this.cid,pr:null==(e=this.media)?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},t.apply=function(e,t){l(t=void 0===t?{}:t,this.createData());var n=t.ot===Ka.INIT||t.ot===Ka.VIDEO||t.ot===Ka.MUXED,r=(this.starved&&n&&(t.bs=!0,t.su=!0,this.starved=!1),null==t.su&&(t.su=this.buffering),this.includeKeys);r&&(t=Object.keys(t).reduce((function(e,n){return r.includes(n)&&(e[n]=t[n]),e}),{})),n={baseUrl:e.url};this.useHeaders?(e.headers||(e.headers={}),function(e,t,n){var r,i;l(e,(void 0===(r=n)&&(r={}),(e=t)?(e=Object.entries(e),i=Object.entries(Ja).concat(Object.entries((null==r?void 0:r.customHeaderMap)||{})),e=e.reduce((function(e,t){var n=t[0],r=(t=t[1],(null==(r=i.find((function(e){return e[1].includes(n)})))?void 0:r[0])||$a.REQUEST);return null==e[r]&&(e[r]={}),e[r][n]=t,e}),{}),Object.entries(e).reduce((function(e,t){var n=t[0];return t=t[1],e[n]=wn(t,r),e}),{})):{}))}(e.headers,t,n)):e.url=function(e,t,n){return void 0===(n=n)&&(n={}),(n=(t=t)?(t=wn(t,n),ts+"="+encodeURIComponent(t)):"")?ns.test(e)?e.replace(ns,n):(t=e.includes("?")?"&":"?",e+t+n):e}(e.url,t,n)},t.getNextFrag=function(e){var t=null==(t=this.hls.levels[e.level])?void 0:t.details;if(t)return e=e.sn-t.startSN,t.fragments[1+e]},t.getObjectType=function(e){var t=e.type;return"subtitle"===t?Ka.TIMED_TEXT:"initSegment"===e.sn?Ka.INIT:"audio"===t?Ka.AUDIO:"main"===t?this.hls.audioTracks.length?Ka.VIDEO:Ka.MUXED:void 0},t.getTopBandwidth=function(e){for(var t=0,n=this.hls,r=function(e,t){var n,r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){var n;if(e)return"string"==typeof e?p(e,t):"Map"===(n="Object"===(n=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,t):void 0}(e))||t&&e&&"number"==typeof e.length)return r&&(e=r),n=0,function(){return n>=e.length?{done:!0}:{done:!1,value:e[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.")}(e===Ka.AUDIO?n.audioTracks:(e=-1<(e=n.maxAutoLevel)?e+1:n.levels.length,n.levels.slice(0,e)));!(i=r()).done;){var i=i.value;i.bitrate>t&&(t=i.bitrate)}return 0<t?t:NaN},t.getBufferLength=function(e){var t=this.media;return(e=e===Ka.AUDIO?this.audioBuffer:this.videoBuffer)&&t?1e3*hi.bufferInfo(e,t.currentTime,this.config.maxBufferHole).len:NaN},t.createPlaylistLoader=function(){var e=this.config.pLoader,t=this.applyPlaylistData,n=e||this.config.loader;return function(){function e(e){this.loader=void 0,this.loader=new n(e)}var r=e.prototype;return r.destroy=function(){this.loader.destroy()},r.abort=function(){this.loader.abort()},r.load=function(e,n,r){t(e),this.loader.load(e,n,r)},u(e,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}])}()},t.createFragmentLoader=function(){var e=this.config.fLoader,t=this.applyFragmentData,n=e||this.config.loader;return function(){function e(e){this.loader=void 0,this.loader=new n(e)}var r=e.prototype;return r.destroy=function(){this.loader.destroy()},r.abort=function(){this.loader.abort()},r.load=function(e,n,r){t(e),this.loader.load(e,n,r)},u(e,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}])}()},e}(),is=function(e){function t(t){var n=e.call(this,"content-steering",t.logger)||this;return n.hls=void 0,n.loader=null,n.uri=null,n.pathwayId=".",n.pathwayPriority=null,n.timeToLoad=300,n.reloadTimer=-1,n.updated=0,n.started=!1,n.enabled=!0,n.levels=null,n.audioTracks=null,n.subtitleTracks=null,n.penalizedPathways={},n.hls=t,n.registerListeners(),n}c(t,e);var n=t.prototype;return n.registerListeners=function(){var e=this.hls;e.on(zn.MANIFEST_LOADING,this.onManifestLoading,this),e.on(zn.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(zn.MANIFEST_PARSED,this.onManifestParsed,this),e.on(zn.ERROR,this.onError,this)},n.unregisterListeners=function(){var e=this.hls;e&&(e.off(zn.MANIFEST_LOADING,this.onManifestLoading,this),e.off(zn.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(zn.MANIFEST_PARSED,this.onManifestParsed,this),e.off(zn.ERROR,this.onError,this))},n.startLoad=function(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){var e=1e3*this.timeToLoad-(performance.now()-this.updated);if(0<e)return void this.scheduleRefresh(this.uri,e)}this.loadSteeringManifest(this.uri)}},n.stopLoad=function(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),this.clearTimeout()},n.clearTimeout=function(){-1!==this.reloadTimer&&(self.clearTimeout(this.reloadTimer),this.reloadTimer=-1)},n.destroy=function(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null},n.removeLevel=function(e){var t=this.levels;t&&(this.levels=t.filter((function(t){return t!==e})))},n.onManifestLoading=function(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null},n.onManifestLoaded=function(e,t){null!==(t=t.contentSteering)&&(this.pathwayId=t.pathwayId,this.uri=t.uri,this.started)&&this.startLoad()},n.onManifestParsed=function(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks},n.onError=function(e,t){var n,r,i,a,s,o,u=t.errorAction;2===(null==u?void 0:u.action)&&1===u.flags&&(n=this.levels,r=this.pathwayPriority,i=this.pathwayId,t.context&&(a=(o=t.context).groupId,s=o.pathwayId,o=o.type,a&&n?i=this.getPathwayForGroupId(a,o,i):s&&(i=s)),i in this.penalizedPathways||(this.penalizedPathways[i]=performance.now()),(r=!r&&n?n.reduce((function(e,t){return-1===e.indexOf(t.pathwayId)&&e.push(t.pathwayId),e}),[]):r)&&1<r.length&&(this.updatePathwayPriority(r),u.resolved=this.pathwayId!==i),u.resolved||this.warn("Could not resolve "+t.details+' ("'+t.error.message+'") with content-steering for Pathway: '+i+" levels: "+(n&&n.length)+" priorities: "+JSON.stringify(r)+" penalized: "+JSON.stringify(this.penalizedPathways)))},n.filterParsedLevels=function(e){this.levels=e;var t,n=this.getLevelsForPathway(this.pathwayId);return 0===n.length&&(t=e[0].pathwayId,this.log("No levels found in Pathway "+this.pathwayId+'. Setting initial Pathway to "'+t+'"'),n=this.getLevelsForPathway(t),this.pathwayId=t),n.length!==e.length?(this.log("Found "+n.length+"/"+e.length+' levels in Pathway "'+this.pathwayId+'"'),n):e},n.getLevelsForPathway=function(e){return null===this.levels?[]:this.levels.filter((function(t){return e===t.pathwayId}))},n.updatePathwayPriority=function(e){this.pathwayPriority=e;var t=this.penalizedPathways,n=performance.now();Object.keys(t).forEach((function(e){3e5<n-t[e]&&delete t[e]}));for(var r=0;r<e.length;r++){var i=e[r];if(!(i in t)){if(i===this.pathwayId)return;var a,s=this.hls.nextLoadLevel,o=this.hls.levels[s];if(0<(a=this.getLevelsForPathway(i)).length){this.log('Setting Pathway to "'+i+'"'),this.pathwayId=i,Me(a),this.hls.trigger(zn.LEVELS_UPDATED,{levels:a}),i=this.hls.levels[s],o&&i&&this.levels&&(i.attrs["STABLE-VARIANT-ID"]!==o.attrs["STABLE-VARIANT-ID"]&&i.bitrate!==o.bitrate&&this.log("Unstable Pathways change from bitrate "+o.bitrate+" to "+i.bitrate),this.hls.nextLoadLevel=s);break}}}},n.getPathwayForGroupId=function(e,t,n){for(var r=this.getLevelsForPathway(n).concat(this.levels||[]),i=0;i<r.length;i++)if(t===jr&&r[i].hasAudioGroup(e)||t===Ur&&r[i].hasSubtitleGroup(e))return r[i].pathwayId;return n},n.clonePathways=function(e){var t,n,r=this,i=this.levels;i&&(t={},n={},e.forEach((function(e){var a=e.ID,s=e["BASE-ID"],o=e["URI-REPLACEMENT"];i.some((function(e){return e.pathwayId===a}))||(e=r.getLevelsForPathway(s).map((function(e){var r=new Yn(e.attrs),i=(r["PATHWAY-ID"]=a,r.AUDIO&&r.AUDIO+"_clone_"+a),s=r.SUBTITLES&&r.SUBTITLES+"_clone_"+a,u=(i=(i&&(t[r.AUDIO]=i,r.AUDIO=i),s&&(n[r.SUBTITLES]=s,r.SUBTITLES=s),An(e.uri,r["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",o)),new Xr({attrs:r,audioCodec:e.audioCodec,bitrate:e.bitrate,height:e.height,name:e.name,url:i,videoCodec:e.videoCodec,width:e.width}));if(e.audioGroups)for(var l=1;l<e.audioGroups.length;l++)u.addGroupId("audio",e.audioGroups[l]+"_clone_"+a);if(e.subtitleGroups)for(var c=1;c<e.subtitleGroups.length;c++)u.addGroupId("text",e.subtitleGroups[c]+"_clone_"+a);return u})),i.push.apply(i,e),Cn(r.audioTracks,t,o,a),Cn(r.subtitleTracks,n,o,a))})))},n.loadSteeringManifest=function(e){var t,n=this,r=this.hls.config,i=r.loader;this.loader&&this.loader.destroy(),this.loader=new i(r);try{t=new self.URL(e)}catch(r){return this.enabled=!1,void this.log("Failed to parse Steering Manifest URI: "+e)}"data:"!==t.protocol&&(i=0|(this.hls.bandwidthEstimate||r.abrEwmaDefaultEstimate),t.searchParams.set("_HLS_pathway",this.pathwayId),t.searchParams.set("_HLS_throughput",""+i)),e={responseType:"json",url:t.href},r=(i=r.steeringManifestLoadPolicy.default).errorRetry||i.timeoutRetry||{},i={loadPolicy:i,timeout:i.maxLoadTimeMs,maxRetry:r.maxNumRetry||0,retryDelay:r.retryDelayMs||0,maxRetryDelay:r.maxRetryDelayMs||0},r={onSuccess:function(e,r,i,a){if(n.log('Loaded steering manifest: "'+t+'"'),1!==(null==(e=e.data)?void 0:e.VERSION))n.log("Steering VERSION "+e.VERSION+" not supported!");else{n.updated=performance.now(),n.timeToLoad=e.TTL;var s=e["RELOAD-URI"],o=e["PATHWAY-CLONES"],u=e["PATHWAY-PRIORITY"];if(s)try{n.uri=new self.URL(s,t).href}catch(e){return n.enabled=!1,void n.log("Failed to parse Steering Manifest RELOAD-URI: "+s)}n.scheduleRefresh(n.uri||i.url),o&&n.clonePathways(o),s={steeringManifest:e,url:t.toString()},n.hls.trigger(zn.STEERING_MANIFEST_LOADED,s),u&&n.updatePathwayPriority(u)}},onError:function(e,t,r,i){var a;n.log("Error loading steering manifest: "+e.code+" "+e.text+" ("+t.url+")"),n.stopLoad(),410===e.code?(n.enabled=!1,n.log("Steering manifest "+t.url+" no longer available")):(a=1e3*n.timeToLoad,429===e.code?("function"==typeof(null==(e=n.loader)?void 0:e.getResponseHeader)&&(e=e.getResponseHeader("Retry-After"))&&(a=1e3*parseFloat(e)),n.log("Steering manifest "+t.url+" rate limited")):n.scheduleRefresh(n.uri||t.url,a))},onTimeout:function(e,t,r){n.log("Timeout loading steering manifest ("+t.url+")"),n.scheduleRefresh(n.uri||t.url)}},this.log("Requesting steering manifest: "+t),this.loader.load(e,i,r)},n.scheduleRefresh=function(e,t){var n=this;void 0===t&&(t=1e3*this.timeToLoad),this.clearTimeout(),this.reloadTimer=self.setTimeout((function(){var t=null==(t=n.hls)?void 0:t.media;t&&!t.ended?n.loadSteeringManifest(e):n.scheduleRefresh(e,1e3*n.timeToLoad)}),t)},t}(v),as=/^age:\s*[\d.]+\s*$/im,ss=function(){function e(e){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=null,this.loader=null,this.stats=void 0,this.xhrSetup=e&&e.xhrSetup||null,this.stats=new b,this.retryDelay=0}var t=e.prototype;return t.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null,this.stats=null},t.abortInternal=function(){var e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,4!==e.readyState)&&(this.stats.aborted=!0,e.abort())},t.abort=function(){var e;this.abortInternal(),null!=(e=this.callbacks)&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},t.load=function(e,t,n){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=n,this.loadInternal()},t.loadInternal=function(){var e,t,n,r=this,i=this.config,a=this.context;i&&a&&(e=this.loader=new self.XMLHttpRequest,(t=this.stats).loading.first=0,t.loaded=0,t.aborted=!1,(n=this.xhrSetup)?Promise.resolve().then((function(){if(!r.stats.aborted)return n(e,a.url)})).catch((function(t){return e.open("GET",a.url,!0),n(e,a.url)})).then((function(){r.stats.aborted||r.openAndSendXhr(e,a,i)})).catch((function(n){r.callbacks.onError({code:e.status,text:n.message},a,e,t)})):this.openAndSendXhr(e,a,i))},t.openAndSendXhr=function(e,t,n){e.readyState||e.open("GET",t.url,!0);var r=t.headers,i=(a=n.loadPolicy).maxTimeToFirstByteMs,a=a.maxLoadTimeMs;if(r)for(var s in r)e.setRequestHeader(s,r[s]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),n.timeout=i&&Gn(i)?i:a,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.timeout),e.send()},t.readystatechange=function(){var e,t,n,r,i=this.context,a=this.loader,s=this.stats;i&&a&&(t=a.readyState,e=this.config,s.aborted||2<=t&&(0===s.loading.first&&(s.loading.first=Math.max(self.performance.now(),s.loading.start),e.timeout!==e.loadPolicy.maxLoadTimeMs)&&(self.clearTimeout(this.requestTimeout),e.timeout=e.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),e.loadPolicy.maxLoadTimeMs-(s.loading.first-s.loading.start))),4===t)&&(self.clearTimeout(this.requestTimeout),a.onreadystatechange=null,a.onprogress=null,t=a.status,r="text"!==a.responseType,200<=t&&t<300&&(r&&a.response||null!==a.responseText)?(s.loading.end=Math.max(self.performance.now(),s.loading.first),r=r?a.response:a.responseText,n="arraybuffer"===a.responseType?r.byteLength:r.length,s.loaded=s.total=n,s.bwEstimate=8e3*s.total/(s.loading.end-s.loading.first),this.callbacks&&((n=this.callbacks.onProgress)&&n(s,i,r,a),this.callbacks)&&(n={url:a.responseURL,data:r,code:t},this.callbacks.onSuccess(n,s,i,a))):Ne(r=e.loadPolicy.errorRetry,s.retry,!1,{url:i.url,data:void 0,code:t})?this.retry(r):(Qn.error(t+" while loading "+i.url),this.callbacks.onError({code:t,text:a.statusText},i,a,s))))},t.loadtimeout=function(){var e=null==(e=this.config)?void 0:e.loadPolicy.timeoutRetry;Ne(e,this.stats.retry,!0)?this.retry(e):(Qn.warn("timeout while loading "+(null==(e=this.context)?void 0:e.url)),(e=this.callbacks)&&(this.abortInternal(),e.onTimeout(this.stats,this.context,this.loader)))},t.retry=function(e){var t=this.context,n=this.stats;this.retryDelay=Be(e,n.retry),n.retry++,Qn.warn((status?"HTTP Status "+status:"Timeout")+" while loading "+(null==t?void 0:t.url)+", retrying "+n.retry+"/"+e.maxNumRetry+" in "+this.retryDelay+"ms"),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)},t.loadprogress=function(e){var t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)},t.getCacheAge=function(){var e,t=null;return this.loader&&as.test(this.loader.getAllResponseHeaders())?(e=this.loader.getResponseHeader("age"))?parseFloat(e):null:t},t.getResponseHeader=function(e){return this.loader&&new RegExp("^"+e+":\\s*[\\d.]+\\s*$","im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null},e}(),os=/(\d+)-(\d+)\/(\d+)/,us=function(){function e(e){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=null,this.response=null,this.controller=void 0,this.context=null,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=e.fetchSetup||Ln,this.controller=new self.AbortController,this.stats=new b}var t=e.prototype;return t.destroy=function(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null},t.abortInternal=function(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())},t.abort=function(){var e;this.abortInternal(),null!=(e=this.callbacks)&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},t.load=function(e,t,n){var r=this,i=this.stats;if(i.loading.start)throw new Error("Loader can only be used once.");i.loading.start=self.performance.now();var a=function(e,t){return t={method:"GET",mode:"cors",credentials:"same-origin",signal:t,headers:new self.Headers(l({},e.headers))},e.rangeEnd&&t.headers.set("Range","bytes="+e.rangeStart+"-"+String(e.rangeEnd-1)),t}(e,this.controller.signal),s=n.onProgress,o="arraybuffer"===e.responseType,u=o?"byteLength":"length",c=t.loadPolicy,d=c.maxTimeToFirstByteMs,h=c.maxLoadTimeMs;this.context=e,this.config=t,this.callbacks=n,this.request=this.fetchSetup(e,a),self.clearTimeout(this.requestTimeout),t.timeout=d&&Gn(d)?d:h,this.requestTimeout=self.setTimeout((function(){r.abortInternal(),n.onTimeout(i,e,r.response)}),t.timeout),self.fetch(this.request).then((function(a){r.response=r.loader=a;var u,l=Math.max(self.performance.now(),i.loading.start);if(self.clearTimeout(r.requestTimeout),t.timeout=h,r.requestTimeout=self.setTimeout((function(){r.abortInternal(),n.onTimeout(i,e,r.response)}),h-(l-i.loading.start)),a.ok)return i.loading.first=l,i.total=function(e){var t=e.get("Content-Range");return t&&(t=function(e){if(e=os.exec(e))return parseInt(e[2])-parseInt(e[1])+1}(t),Gn(t))?t:(t=e.get("Content-Length"))?parseInt(t):void 0}(a.headers)||i.total,s&&Gn(t.highWaterMark)?r.loadProgressively(a,i,e,t.highWaterMark,s):o?a.arrayBuffer():"json"===e.responseType?a.json():a.text();throw l=a.status,u=a.statusText,new ls(u||"fetch, bad network response",l,a)})).then((function(a){var o=r.response;if(!o)throw new Error("loader destroyed");self.clearTimeout(r.requestTimeout),i.loading.end=Math.max(self.performance.now(),i.loading.first);var l=((l=a[u])&&(i.loaded=i.total=l),{url:o.url,data:a,code:o.status});s&&!Gn(t.highWaterMark)&&s(i,e,a,o),n.onSuccess(l,i,e,o)})).catch((function(t){var a,s;self.clearTimeout(r.requestTimeout),i.aborted||(a=t&&t.code||0,s=t?t.message:null,n.onError({code:a,text:s},e,t?t.details:null,i))}))},t.getCacheAge=function(){var e,t=null;return this.response?(e=this.response.headers.get("age"))?parseFloat(e):null:t},t.getResponseHeader=function(e){return this.response?this.response.headers.get(e):null},t.loadProgressively=function(e,t,n,r,i){void 0===r&&(r=0);var a=new Oi,s=e.body.getReader();return function o(){return s.read().then((function(s){var u;return s.done?(a.dataLength&&i(t,n,a.flush(),e),Promise.resolve(new ArrayBuffer(0))):(u=(s=s.value).length,t.loaded+=u,u<r||a.dataLength?(a.push(s),a.dataLength>=r&&i(t,n,a.flush(),e)):i(t,n,s,e),o())})).catch((function(){return Promise.reject()}))}()},e}(),ls=function(e){function t(t,n,r){return(t=e.call(this,t)||this).code=void 0,t.details=void 0,t.code=n,t.details=r,t}return c(t,e),t}(f(Error)),cs=/\s/,ds=n(n({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,maxBufferSize:6e7,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:ss,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:ii,bufferController:na,capLevelController:Vi,errorController:Qr,fpsController:ur,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrEwmaDefaultEstimateMax:5e6,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:hr,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0,useMediaCapabilities:!0,certLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null}},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},{cueHandler:{newCue:function(e,t,n,r){for(var i,a,s,o,u=[],l=self.VTTCue||self.TextTrackCue,c=0;c<r.rows.length;c++)if(a=!0,s=0,o="",!(i=r.rows[c]).isEmpty()){for(var d,h=0;h<i.chars.length;h++)cs.test(i.chars[h].uchar)&&a?s++:(o+=i.chars[h].uchar,a=!1);(i.cueStartTime=t)===n&&(n+=1e-4),16<=s?s--:s++;var f=tn(o.trim()),p=rn(t,n,f);null!=e&&null!=(d=e.cues)&&d.getCueById(p)||((d=new l(t,n,f)).id=p,d.line=c+1,d.align="left",d.position=10+Math.min(80,10*Math.floor(8*s/32)),u.push(d))}return e&&u.length&&(u.sort((function(e,t){return"auto"===e.line||"auto"===t.line?0:8<e.line&&8<t.line?t.line-e.line:e.line-t.line})),u.forEach((function(t){return be(e,t)}))),u}},enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}),{},{subtitleStreamController:Di,subtitleTrackController:Hi,timelineController:ia,audioStreamController:zi,audioTrackController:Ni,emeController:Ya,cmcdController:rs,contentSteeringController:is}),hs=function(e){function t(t,n){return(t=e.call(this,t,"level-controller")||this)._levels=[],t._firstLevel=-1,t._maxAutoLevel=-1,t._startLevel=void 0,t.currentLevel=null,t.currentLevelIndex=-1,t.manualLevelIndex=-1,t.steering=void 0,t.onParsedComplete=void 0,t.steering=n,t._registerListeners(),t}c(t,e);var n=t.prototype;return n._registerListeners=function(){var e=this.hls;e.on(zn.MANIFEST_LOADING,this.onManifestLoading,this),e.on(zn.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(zn.LEVEL_LOADED,this.onLevelLoaded,this),e.on(zn.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(zn.FRAG_BUFFERED,this.onFragBuffered,this),e.on(zn.ERROR,this.onError,this)},n._unregisterListeners=function(){var e=this.hls;e.off(zn.MANIFEST_LOADING,this.onManifestLoading,this),e.off(zn.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(zn.LEVEL_LOADED,this.onLevelLoaded,this),e.off(zn.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(zn.FRAG_BUFFERED,this.onFragBuffered,this),e.off(zn.ERROR,this.onError,this)},n.destroy=function(){this._unregisterListeners(),this.steering=null,this.resetLevels(),e.prototype.destroy.call(this)},n.stopLoad=function(){this._levels.forEach((function(e){e.loadError=0,e.fragmentError=0})),e.prototype.stopLoad.call(this)},n.resetLevels=function(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1},n.onManifestLoading=function(e,t){this.resetLevels()},n.onManifestLoaded=function(e,t){var n=this.hls.config.preferManagedMediaSource,r=[],i={},a={},s=!1,o=!1,u=!1;t.levels.forEach((function(e){var t,l,c,d,h=e.attrs,f=e.audioCodec,p=e.videoCodec,v=(f&&(e.audioCodec=f=le(f,n)||void 0),0===(null==p?void 0:p.indexOf("avc1"))&&(p=e.videoCodec=2<(m=(g=p).split(".")).length?(v=m.shift()+".",(v+=parseInt(m.shift()).toString(16))+("000"+parseInt(m.shift()).toString(16)).slice(-4)):g),e.width),m=e.height,g=e.unknownCodecs;s=s||!(!v||!m),o=o||!!p,u=u||!!f,null!=g&&g.length||f&&!ie(f,"audio",n)||p&&!ie(p,"video",n)||(f=h.CODECS,p=h["FRAME-RATE"],t=h["HDCP-LEVEL"],c=h["PATHWAY-ID"],d=h.RESOLUTION,l=h["VIDEO-RANGE"],c=(c||".")+"-"+e.bitrate+"-"+d+"-"+p+"-"+f+"-"+l+"-"+t,i[c]?i[c].uri===e.url||e.attrs["PATHWAY-ID"]?(i[c].addGroupId("audio",h.AUDIO),i[c].addGroupId("text",h.SUBTITLES)):(d=a[c]+=1,e.attrs["PATHWAY-ID"]=new Array(d+1).join("."),p=new Xr(e),r.push(i[c]=p)):(f=new Xr(e),i[c]=f,a[c]=1,r.push(f)))})),this.filterAndSortMediaOptions(r,t,s,o,u)},n.filterAndSortMediaOptions=function(e,t,n,r,i){var a=this,s=[],o=[],u=e;if(0===(u=(n||r)&&i?u.filter((function(e){var t=e.videoCodec,n=e.videoRange,r=e.width;e=e.height;return(!!t||!(!r||!e))&&!!(t=n)&&-1<$r.indexOf(t)})):u).length)Promise.resolve().then((function(){var e;a.hls&&(t.levels.length&&a.warn("One or more CODECS in variant not supported: "+JSON.stringify(t.levels[0].attrs)),e=new Error("no level with compatible codecs found in manifest"),a.hls.trigger(zn.ERROR,{type:Wn.MEDIA_ERROR,details:Kn.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:e,reason:e.message}))}));else{t.audioTracks&&(l=this.hls.config.preferManagedMediaSource,xn(s=t.audioTracks.filter((function(e){return!e.audioCodec||ie(e.audioCodec,"audio",l)})))),t.subtitles&&xn(o=t.subtitles);var l,c=u.slice(0),d=(u.sort((function(e,t){if(e.attrs["HDCP-LEVEL"]!==t.attrs["HDCP-LEVEL"])return(e.attrs["HDCP-LEVEL"]||"")>(t.attrs["HDCP-LEVEL"]||"")?1:-1;if(n&&e.height!==t.height)return e.height-t.height;if(e.frameRate!==t.frameRate)return e.frameRate-t.frameRate;if(e.videoRange!==t.videoRange)return $r.indexOf(e.videoRange)-$r.indexOf(t.videoRange);if(e.videoCodec!==t.videoCodec){var r=oe(e.videoCodec),i=oe(t.videoCodec);if(r!==i)return i-r}return e.uri===t.uri&&e.codecSet!==t.codecSet&&(i=ue(e.codecSet))!==(r=ue(t.codecSet))?r-i:e.averageBitrate!==t.averageBitrate?e.averageBitrate-t.averageBitrate:0})),c[0]);if(this.steering&&(u=this.steering.filterParsedLevels(u)).length!==c.length)for(var h=0;h<c.length;h++)if(c[h].pathwayId===u[0].pathwayId){d=c[h];break}this._levels=u;for(var f=0;f<u.length;f++)if(u[f]===d){this._firstLevel=f;var p,v=d.bitrate,m=this.hls.bandwidthEstimate;this.log("manifest loaded, "+u.length+" level(s) found, first bitrate: "+v),void 0===(null==(p=this.hls.userConfig)?void 0:p.abrEwmaDefaultEstimate)&&m<(p=Math.min(v,this.hls.config.abrEwmaDefaultEstimateMax))&&m===ds.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=p);break}e={levels:u,audioTracks:s,subtitleTracks:o,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:i,video:r,altAudio:!(i&&!r)&&s.some((function(e){return!!e.url}))},this.hls.trigger(zn.MANIFEST_PARSED,e),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}},n.onError=function(e,t){!t.fatal&&t.context&&t.context.type===Mr&&t.context.level===this.level&&this.checkRetry(t)},n.onFragBuffered=function(e,t){var n;void 0!==(t=t.frag)&&t.type===Br&&(n=t.elementaryStreams,Object.keys(n).some((function(e){return!!n[e]})))&&null!=(t=this._levels[t.level])&&t.loadError&&(this.log("Resetting level error count of "+t.loadError+" on frag buffered"),t.loadError=0)},n.onLevelLoaded=function(e,t){var n=t.level,r=t.details,i=this._levels[n];i?n===this.currentLevelIndex?(0===i.fragmentError&&(i.loadError=0),(i=i.details)===t.details&&i.advanced&&(i=void 0),this.playlistLoaded(n,t,i)):null!=(i=t.deliveryDirectives)&&i.skip&&(r.deltaUpdateFailed=!0):(this.warn("Invalid level index "+n),null!=(i=t.deliveryDirectives)&&i.skip&&(r.deltaUpdateFailed=!0))},n.loadPlaylist=function(t){e.prototype.loadPlaylist.call(this);var n=this.currentLevelIndex,r=this.currentLevel;if(r&&this.shouldLoadPlaylist(r)){var i=r.uri;if(t)try{i=t.addDirectives(i)}catch(t){this.warn("Could not construct new URL with HLS Delivery Directives: "+t)}var a=r.attrs["PATHWAY-ID"];this.log("Loading level index "+n+(void 0!==(null==t?void 0:t.msn)?" at sn "+t.msn+" part "+t.part:"")+" with"+(a?" Pathway "+a:"")+" "+i),this.clearTimer(),this.hls.trigger(zn.LEVEL_LOADING,{url:i,level:n,pathwayId:r.attrs["PATHWAY-ID"],id:0,deliveryDirectives:t||null})}},n.removeLevel=function(e){var t,n=this,r=this._levels.filter((function(t,r){return r!==e||(n.steering&&n.steering.removeLevel(t),t===n.currentLevel&&(n.currentLevel=null,n.currentLevelIndex=-1,t.details)&&t.details.fragments.forEach((function(e){return e.level=-1})),!1)}));Me(r),this._levels=r,-1<this.currentLevelIndex&&null!=(t=this.currentLevel)&&t.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.hls.trigger(zn.LEVELS_UPDATED,{levels:r})},n.onLevelsUpdated=function(e,t){t=t.levels,this._levels=t},n.checkMaxAutoUpdated=function(){var e=(n=this.hls).autoLevelCapping,t=n.maxAutoLevel,n=n.maxHdcpLevel;this._maxAutoLevel!==t&&(this._maxAutoLevel=t,this.hls.trigger(zn.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:n}))},u(t,[{key:"levels",get:function(){return 0===this._levels.length?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(e){if(0!==(r=this._levels).length){if(e<0||e>=r.length){var t=new Error("invalid level idx"),n=e<0;if(this.hls.trigger(zn.ERROR,{type:Wn.OTHER_ERROR,details:Kn.LEVEL_SWITCH_ERROR,level:e,fatal:n,error:t,reason:t.message}),n)return;e=Math.min(e,r.length-1)}t=this.currentLevelIndex;var r,i=(n=this.currentLevel)?n.attrs["PATHWAY-ID"]:void 0,a=(r=r[e]).attrs["PATHWAY-ID"];this.currentLevelIndex=e,this.currentLevel=r,t===e&&r.details&&n&&i===a||(this.log("Switching to level "+e+" ("+(r.height?r.height+"p ":"")+(r.videoRange?r.videoRange+" ":"")+(r.codecSet?r.codecSet+" ":"")+"@"+r.bitrate+")"+(a?" with Pathway "+a:"")+" from level "+t+(i?" with Pathway "+i:"")),a={level:e,attrs:r.attrs,details:r.details,bitrate:r.bitrate,averageBitrate:r.averageBitrate,maxBitrate:r.maxBitrate,realBitrate:r.realBitrate,width:r.width,height:r.height,codecSet:r.codecSet,audioCodec:r.audioCodec,videoCodec:r.videoCodec,audioGroups:r.audioGroups,subtitleGroups:r.subtitleGroups,loaded:r.loaded,loadError:r.loadError,fragmentError:r.fragmentError,name:r.name,id:r.id,uri:r.uri,url:r.url,urlId:0,audioGroupIds:r.audioGroupIds,textGroupIds:r.textGroupIds},this.hls.trigger(zn.LEVEL_SWITCHING,a),(t=r.details)&&!t.live)||(i=this.switchParams(r.uri,null==n?void 0:n.details),this.loadPlaylist(i))}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(e){this.manualLevelIndex=e,void 0===this._startLevel&&(this._startLevel=e),-1!==e&&(this.level=e)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(e){this._firstLevel=e}},{key:"startLevel",get:function(){var e;return void 0===this._startLevel?void 0!==(e=this.hls.config.startLevel)?e:this.hls.firstAutoLevel:this._startLevel},set:function(e){this._startLevel=e}},{key:"nextLoadLevel",get:function(){return-1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(e){this.level=e,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=e)}}])}(Zr),fs=function(){function e(e){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=e}var t=e.prototype;return t.abort=function(e){for(var t in this.keyUriToKeyInfo){var n;if(t=this.keyUriToKeyInfo[t].loader){if(e&&e!==(null==(n=t.context)?void 0:n.frag.type))return;t.abort()}}},t.detach=function(){for(var e in this.keyUriToKeyInfo){var t=this.keyUriToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[e]}},t.destroy=function(){for(var e in this.detach(),this.keyUriToKeyInfo)(e=this.keyUriToKeyInfo[e].loader)&&e.destroy();this.keyUriToKeyInfo={}},t.createKeyLoadError=function(e,t,n,r,i){return void 0===t&&(t=Kn.KEY_LOAD_ERROR),new vi({type:Wn.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:i,error:n,networkDetails:r})},t.loadClear=function(e,t){var n=this;if(this.emeController&&this.config.emeEnabled)for(var r=e.sn,i=e.cc,a=0;a<t.length&&!function(){var e=t[a];if(i<=e.cc&&("initSegment"===r||"initSegment"===e.sn||r<e.sn))return n.emeController.selectKeySystemFormat(e).then((function(t){e.setKeyFormat(t)})),1}();a++);},t.load=function(e){var t=this;return!e.decryptdata&&e.encrypted&&this.emeController?this.emeController.selectKeySystemFormat(e).then((function(n){return t.loadInternal(e,n)})):this.loadInternal(e)},t.loadInternal=function(e,t){t&&e.setKeyFormat(t);var n=e.decryptdata;if(!n)return t=new Error(t?"Expected frag.decryptdata to be defined after setting format "+t:"Missing decryption data on fragment in onKeyLoading"),Promise.reject(this.createKeyLoadError(e,Kn.KEY_LOAD_ERROR,t));if(!(t=n.uri))return Promise.reject(this.createKeyLoadError(e,Kn.KEY_LOAD_ERROR,new Error('Invalid key URI: "'+t+'"')));var r,i=this.keyUriToKeyInfo[t];if(null!=i&&i.decryptdata.key)return n.key=i.decryptdata.key,Promise.resolve({frag:e,keyInfo:i});if(null!=i&&i.keyLoadPromise)switch(null==(r=i.mediaKeySessionContext)?void 0:r.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return i.keyLoadPromise.then((function(t){return n.key=t.keyInfo.decryptdata.key,{frag:e,keyInfo:i}}))}switch(i=this.keyUriToKeyInfo[t]={decryptdata:n,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},n.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return"identity"===n.keyFormat?this.loadKeyHTTP(i,e):this.loadKeyEME(i,e);case"AES-128":case"AES-256":case"AES-256-CTR":return this.loadKeyHTTP(i,e);default:return Promise.reject(this.createKeyLoadError(e,Kn.KEY_LOAD_ERROR,new Error('Key supplied with unsupported METHOD: "'+n.method+'"')))}},t.loadKeyEME=function(e,t){var n={frag:t,keyInfo:e};return this.emeController&&this.config.emeEnabled&&(t=this.emeController.loadKey(n))?(e.keyLoadPromise=t.then((function(t){return e.mediaKeySessionContext=t,n}))).catch((function(t){throw e.keyLoadPromise=null,t})):Promise.resolve(n)},t.loadKeyHTTP=function(e,t){var r=this,i=this.config,a=new i.loader(i);return t.keyLoader=e.loader=a,e.keyLoadPromise=new Promise((function(s,o){var u={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},l={loadPolicy:l=i.keyLoadPolicy.default,timeout:l.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0};a.load(u,l,{onSuccess:function(e,t,n,i){var a=n.frag,u=n.keyInfo;n=n.url;if(!a.decryptdata||u!==r.keyUriToKeyInfo[n])return o(r.createKeyLoadError(a,Kn.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),i));u.decryptdata.key=a.decryptdata.key=new Uint8Array(e.data),a.keyLoader=null,u.loader=null,s({frag:a,keyInfo:u})},onError:function(e,i,a,s){r.resetLoader(i),o(r.createKeyLoadError(t,Kn.KEY_LOAD_ERROR,new Error("HTTP Error "+e.code+" loading key "+e.text),a,n({url:u.url,data:void 0},e)))},onTimeout:function(e,n,i){r.resetLoader(n),o(r.createKeyLoadError(t,Kn.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),i))},onAbort:function(e,n,i){r.resetLoader(n),o(r.createKeyLoadError(t,Kn.INTERNAL_ABORTED,new Error("key loading aborted"),i))}})}))},t.resetLoader=function(e){var t=e.frag,n=e.keyInfo,r=(e=e.url,n.loader);t.keyLoader===r&&(t.keyLoader=null,n.loader=null),delete this.keyUriToKeyInfo[e],r&&r.destroy()},e}(),ps=function(e){function t(t,n,r,i){var a=e.call(this,"gap-controller",i.logger)||this;return a.config=void 0,a.media=null,a.fragmentTracker=void 0,a.hls=void 0,a.nudgeRetry=0,a.stallReported=!1,a.stalled=null,a.moved=!1,a.seeking=!1,a.ended=0,a.config=t,a.media=n,a.fragmentTracker=r,a.hls=i,a}c(t,e);var n=t.prototype;return n.destroy=function(){this.media=null,this.hls=this.fragmentTracker=null},n.poll=function(e,t,n,r){var i=this.config,a=this.media,s=this.stalled;if(null!==a){var o=a.currentTime,u=a.seeking,l=this.seeking&&!u,c=!this.seeking&&u;if(this.seeking=u,o!==e)this.ended=0,this.moved=!0,u||(this.nudgeRetry=0),null!==s&&(this.stallReported&&(e=self.performance.now()-s,this.warn("playback not stuck anymore @"+o+", after "+Math.round(e)+"ms"),this.stallReported=!1),this.stalled=null);else if(c||l)this.stalled=null;else if(a.paused&&!u||a.ended||0===a.playbackRate||!hi.getBuffered(a).length)this.nudgeRetry=0;else{if(c=(e=hi.bufferInfo(a,o,0)).nextStart||0,u){if(l=2<e.len,t=!c||t&&t.start<=o||2<c-o&&!this.fragmentTracker.getPartialFragment(o),l||t)return;this.moved=!1}if(!this.moved&&null!==this.stalled){if(!(0<e.len||c))return;if(l=Math.max(c,e.start||0)-o,t=null!=n&&n.live?2*n.targetduration:2,c=this.fragmentTracker.getPartialFragment(o),0<l&&(l<=t||c))return void(a.paused||this._trySkipBufferHole(c))}if(l=self.performance.now(),null===s)this.stalled=l;else{if(t=l-s,!u&&250<=t){if(r===Li&&(!n||!n.live)&&Math.abs(o-((null==n?void 0:n.edge)||0))<1)return t<1e3||this.ended?void 0:(this.ended=o,void this.hls.trigger(zn.MEDIA_ENDED,{stalled:!0}));if(this._reportStall(e),!this.media)return}c=hi.bufferInfo(a,o,i.maxBufferHole),this._tryFixBufferStall(c,t)}}}},n._tryFixBufferStall=function(e,t){var n=this.config,r=this.fragmentTracker,i=this.media;if(null!==i){if(i=i.currentTime,(r=r.getPartialFragment(i))&&(this._trySkipBufferHole(r)||!this.media))return;(e.len>n.maxBufferHole||e.nextStart&&e.nextStart-i<n.maxBufferHole)&&t>1e3*n.highBufferWatchdogPeriod&&(this.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}},n._reportStall=function(e){var t=this.hls,n=this.media;!this.stallReported&&n&&(this.stallReported=!0,n=new Error("Playback stalling at @"+n.currentTime+" due to low buffer ("+JSON.stringify(e)+")"),this.warn(n.message),t.trigger(zn.ERROR,{type:Wn.MEDIA_ERROR,details:Kn.BUFFER_STALLED_ERROR,fatal:!1,error:n,buffer:e.len}))},n._trySkipBufferHole=function(e){var t=this.config,n=this.hls,r=this.media;if(null!==r){var i=r.currentTime,a=i<(o=hi.bufferInfo(r,i,0)).start?o.start:o.nextStart;if(a){var s=o.len<=t.maxBufferHole,o=0<o.len&&o.len<1&&r.readyState<3,u=a-i;if(0<u&&(s||o)){if(u>t.maxBufferHole){var l=this.fragmentTracker;s=!1;if(!(s=!!(0===i&&(o=l.getAppendedFrag(0,Br))&&a<o.end)||s)&&(u=e||l.getAppendedFrag(i,Br))){for(var c=!1,d=u.end;d<a;){var h=l.getPartialFragment(d);if(!h){c=!0;break}d+=h.duration}if(c)return 0}}return t=Math.max(a+.05,i+.1),this.warn("skipping hole, adjusting currentTime from "+i+" to "+t),this.moved=!0,this.stalled=null,r.currentTime=t,e&&!e.gap&&(o=new Error("fragment loaded with buffer holes, seeking from "+i+" to "+t),n.trigger(zn.ERROR,{type:Wn.MEDIA_ERROR,details:Kn.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:o,reason:o.message,frag:e})),t}}}return 0},n._tryNudgeBuffer=function(){var e,t,n=this.config,r=this.hls,i=this.media,a=this.nudgeRetry;null!==i&&(e=i.currentTime,this.nudgeRetry++,a<n.nudgeMaxRetry?(a=e+(a+1)*n.nudgeOffset,t=new Error("Nudging 'currentTime' from "+e+" to "+a),this.warn(t.message),i.currentTime=a,r.trigger(zn.ERROR,{type:Wn.MEDIA_ERROR,details:Kn.BUFFER_NUDGE_ON_STALL,error:t,fatal:!1})):(i=new Error("Playhead still not moving while enough data buffered @"+e+" after "+n.nudgeMaxRetry+" nudges"),this.error(i.message),r.trigger(zn.ERROR,{type:Wn.MEDIA_ERROR,details:Kn.BUFFER_STALLED_ERROR,error:i,fatal:!0})))},t}(v),vs=function(e){function t(t,n,r){var i=e.call(this,t,n,r,"stream-controller",Br)||this;return i.audioCodecSwap=!1,i.gapController=null,i.level=-1,i._forceStartLoad=!1,i.altAudio=!1,i.audioOnly=!1,i.fragPlaying=null,i.fragLastKbps=0,i.couldBacktrack=!1,i.backtrackFragment=null,i.audioCodecSwitch=!1,i.videoBuffer=null,i.onMediaPlaying=function(){i.tick()},i.onMediaSeeked=function(){var e=(e=i.media)?e.currentTime:null;null===(e=(Gn(e)&&i.log("Media seeked to "+e.toFixed(3)),i.getMainFwdBufferInfo()))||0===e.len?i.warn('Main forward buffer length on "seeked" event '+(e?e.len:"empty")+")"):i.tick()},i.registerListeners(),i}c(t,e);var n=t.prototype;return n.registerListeners=function(){e.prototype.registerListeners.call(this);var t=this.hls;t.on(zn.MANIFEST_PARSED,this.onManifestParsed,this),t.on(zn.LEVEL_LOADING,this.onLevelLoading,this),t.on(zn.LEVEL_LOADED,this.onLevelLoaded,this),t.on(zn.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),t.on(zn.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.on(zn.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.on(zn.BUFFER_CREATED,this.onBufferCreated,this),t.on(zn.BUFFER_FLUSHED,this.onBufferFlushed,this),t.on(zn.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(zn.FRAG_BUFFERED,this.onFragBuffered,this)},n.unregisterListeners=function(){e.prototype.unregisterListeners.call(this);var t=this.hls;t.off(zn.MANIFEST_PARSED,this.onManifestParsed,this),t.off(zn.LEVEL_LOADED,this.onLevelLoaded,this),t.off(zn.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),t.off(zn.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.off(zn.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.off(zn.BUFFER_CREATED,this.onBufferCreated,this),t.off(zn.BUFFER_FLUSHED,this.onBufferFlushed,this),t.off(zn.LEVELS_UPDATED,this.onLevelsUpdated,this),t.off(zn.FRAG_BUFFERED,this.onFragBuffered,this)},n.onHandlerDestroying=function(){this.onMediaPlaying=this.onMediaSeeked=null,this.unregisterListeners(),e.prototype.onHandlerDestroying.call(this)},n.startLoad=function(e){var t,n,r;this.levels?(t=this.lastCurrentTime,n=this.hls,this.stopLoad(),this.setInterval(100),this.level=-1,this.startFragRequested||(-1===(r=n.startLevel)&&(n.config.testBandwidth&&1<this.levels.length?this.bitrateTest=!(r=0):r=n.firstAutoLevel),n.nextLoadLevel=r,this.level=n.loadLevel,this.loadedmetadata=!1),0<t&&-1===e&&(this.log("Override startPosition with lastCurrentTime @"+t.toFixed(3)),e=t),this.state=Ti,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()):(this._forceStartLoad=!0,this.state=bi)},n.stopLoad=function(){this._forceStartLoad=!1,e.prototype.stopLoad.call(this)},n.doTick=function(){switch(this.state){case Ii:var e=this.levels,t=this.level;if(!(t=null==(e=null==e?void 0:e[t])?void 0:e.details)||t.live&&this.levelLastLoaded!==e)this.hls.nextLoadLevel!==this.level&&(this.state=Ti);else{if(this.waitForCdnTuneIn(t))break;this.state=Ti}break;case ki:e=self.performance.now();(!(t=this.retryDate)||t<=e||null!=(t=this.media)&&t.seeking)&&(e=this.levels,t=this.level,e=null==e?void 0:e[t],this.resetStartWhenNotLoaded(e||null),this.state=Ti)}this.state===Ti&&this.doTickIdle(),this.onTickEnd()},n.onTickEnd=function(){e.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},n.doTickIdle=function(){var e,t,n,r,i,a,s,o;this.buffering&&(i=this.hls,r=this.levelLastLoaded,t=this.levels,e=this.media,null===r||!(e||!this.startFragRequested&&i.config.startFragPrefetch)||this.altAudio&&this.audioOnly||(r=i.nextLoadLevel,null!=t&&t[r]&&(e=t[r],null!==(t=this.getMainFwdBufferInfo()))&&((n=this.getLevelDetails())&&this._streamEnded(t,n)?(n={},this.altAudio&&(n.type="video"),this.hls.trigger(zn.BUFFER_EOS,n),this.state=Li):(i.loadLevel!==r&&-1===i.manualLevel&&this.log("Adapting to level "+r+" from level "+this.level),this.level=i.nextLoadLevel=r,!(n=e.details)||this.state===Ii||n.live&&this.levelLastLoaded!==e?(this.level=r,this.state=Ii):(i=t.len,(r=this.getMaxBufferLength(e.maxBitrate))<=i||(this.backtrackFragment&&this.backtrackFragment.start>t.end&&(this.backtrackFragment=null),i=this.backtrackFragment?this.backtrackFragment.start:t.end,a=this.getNextFragment(i,n),this.couldBacktrack&&!this.fragPrevious&&a&&"initSegment"!==a.sn&&this.fragmentTracker.getState(a)!==li?(s=(null!=(s=this.backtrackFragment)?s:a).sn-n.startSN,(s=n.fragments[s-1])&&a.cc===s.cc&&this.fragmentTracker.removeFragment(a=s)):this.backtrackFragment&&t.len&&(this.backtrackFragment=null),a&&this.isLoopLoading(a,i)&&(a.gap||(o=((s=this.audioOnly&&!this.altAudio?er:tr)===tr?this.videoBuffer:this.mediaBuffer)||this.media)&&this.afterBufferFlushed(o,s,Br),a=this.getNextFragmentLoopLoading(a,n,t,Br,r)),a&&(!a.initSegment||a.initSegment.data||this.bitrateTest||(a=a.initSegment),this.loadFragment(a,e,i))))))))},n.loadFragment=function(t,n,r){var i=this.fragmentTracker.getState(t);this.fragCurrent=t,i===si||i===ui?"initSegment"===t.sn?this._loadInitSegment(t,n):this.bitrateTest?(this.log("Fragment "+t.sn+" of level "+t.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(t,n)):(this.startFragRequested=!0,e.prototype.loadFragment.call(this,t,n,r)):this.clearTrackerIfNeeded(t)},n.getBufferedFrag=function(e){return this.fragmentTracker.getBufferedFrag(e,Br)},n.followingBufferedFrag=function(e){return e?this.getBufferedFrag(e.end+.5):null},n.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},n.nextLevelSwitch=function(){var e=this.levels,t=this.media;if(null!=t&&t.readyState){var n;if(null!=(n=((n=this.getAppendedFrag(t.currentTime))&&1<n.start&&this.flushMainBuffer(0,n.start-1),this.getLevelDetails()))&&n.live){var r=this.getMainFwdBufferInfo();if(!r||r.len<2*n.targetduration)return}e=!t.paused&&e&&(r=e[this.hls.nextLoadLevel],n=this.fragLastKbps)&&this.fragCurrent?this.fragCurrent.duration*r.maxBitrate/(1e3*n)+1:0,(r=this.getBufferedFrag(t.currentTime+e))&&(n=this.followingBufferedFrag(r))&&(this.abortCurrentFrag(),t=n.maxStartPTS||n.start,e=n.duration,n=Math.max(r.end,t+Math.min(Math.max(e-this.config.maxFragLookUpTolerance,e*(this.couldBacktrack?.5:.125)),e*(this.couldBacktrack?.75:.25))),this.flushMainBuffer(n,Number.POSITIVE_INFINITY))}},n.abortCurrentFrag=function(){var e=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,e&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.state){case Si:case Ei:case ki:case Ci:case Ai:this.state=Ti}this.nextLoadPosition=this.getLoadPosition()},n.flushMainBuffer=function(t,n){e.prototype.flushMainBuffer.call(this,t,n,this.altAudio?"video":null)},n.onMediaAttached=function(t,n){e.prototype.onMediaAttached.call(this,t,n),(t=n.media).addEventListener("playing",this.onMediaPlaying),t.addEventListener("seeked",this.onMediaSeeked),this.gapController=new ps(this.config,t,this.fragmentTracker,this.hls)},n.onMediaDetaching=function(){var t=this.media;t&&(t.removeEventListener("playing",this.onMediaPlaying),t.removeEventListener("seeked",this.onMediaSeeked)),this.videoBuffer=null,this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),e.prototype.onMediaDetaching.call(this)},n.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(zn.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=!1,this.startPosition=this.lastCurrentTime=this.fragLastKbps=0,this.levels=this.fragPlaying=this.backtrackFragment=this.levelLastLoaded=null,this.altAudio=this.audioOnly=this.startFragRequested=!1},n.onManifestParsed=function(e,t){var n,r=!1,i=!1;t.levels.forEach((function(e){(e=e.audioCodec)&&(r=r||-1!==e.indexOf("mp4a.40.2"),i=i||-1!==e.indexOf("mp4a.40.5"))})),this.audioCodecSwitch=r&&i&&!("function"==typeof(null==(n=In())||null==(n=n.prototype)?void 0:n.changeType)),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1},n.onLevelLoading=function(e,t){var n=this.levels;n&&this.state===Ti&&(!(n=n[t.level]).details||n.details.live&&this.levelLastLoaded!==n||this.waitForCdnTuneIn(n.details))&&(this.state=Ii)},n.onLevelLoaded=function(e,t){var n=this.levels,r=t.level,i=t.details,a=i.totalduration;if(n){this.log("Level "+r+" loaded ["+i.startSN+","+i.endSN+"]"+(i.lastPartSn?"[part-"+i.lastPartSn+"-"+i.lastPartIndex+"]":"")+", cc ["+i.startCC+", "+i.endCC+"] duration:"+a);a=n[r],t=(!(n=this.fragCurrent)||this.state!==Ei&&this.state!==ki||n.level!==t.level&&n.loader&&this.abortCurrentFrag(),0);if(i.live||null!=(n=a.details)&&n.live){if(this.checkLiveUpdate(i),i.deltaUpdateFailed)return;t=this.alignPlaylists(i,a.details,null==(n=this.levelLastLoaded)?void 0:n.details)}if(a.details=i,this.levelLastLoaded=a,this.hls.trigger(zn.LEVEL_UPDATED,{details:i,level:r}),this.state===Ii){if(this.waitForCdnTuneIn(i))return;this.state=Ti}this.startFragRequested?i.live&&this.synchronizeToLiveEdge(i):this.setStartPosition(i,t),this.tick()}else this.warn("Levels were reset while loading level "+r)},n._handleFragmentLoadProgress=function(e){var t,n,r,i,a,s,o,u=e.frag,l=e.part,c=(e=e.payload,this.levels);c?(t=(c=c[u.level]).details)?(n=c.videoCodec,r=t.PTSKnown||!t.live,i=null==(i=u.initSegment)?void 0:i.data,c=this._getAudioCodec(c),a=this.transmuxer=this.transmuxer||new va(this.hls,Br,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),s=l?l.index:-1,s=new Qe(u.level,u.sn,u.stats.chunkCount,e.byteLength,s,-1!==s),o=this.initPTS[u.cc],a.push(e,i,c,n,u,l,t.totalduration,r,s,o)):(this.warn("Dropping fragment "+u.sn+" of level "+u.level+" after level details were reset"),this.fragmentTracker.removeFragment(u)):this.warn("Levels were reset while fragment load was in progress. Fragment "+u.sn+" of level "+u.level+" will not be buffered")},n.onAudioTrackSwitching=function(e,t){var n,r=this.altAudio;!t.url&&(this.mediaBuffer!==this.media?(this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media,(n=this.fragCurrent)&&(this.log("Switching to main audio track, cancel main fragment load"),n.abortRequests(),this.fragmentTracker.removeFragment(n)),this.resetTransmuxer(),this.resetLoadingState()):this.audioOnly&&this.resetTransmuxer(),n=this.hls,r&&(n.trigger(zn.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null}),this.fragmentTracker.removeAllFragments()),n.trigger(zn.AUDIO_TRACK_SWITCHED,t))},n.onAudioTrackSwitched=function(e,t){var n;t=t.id;(t=!!this.hls.audioTracks[t].url)&&(n=this.videoBuffer)&&this.mediaBuffer!==n&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=n),this.altAudio=t,this.tick()},n.onBufferCreated=function(e,t){var n,r=t.tracks,i=!1;for(n in r){var a,s,o=r[n];"main"===o.id?(s=o,"video"===(a=n)&&(o=r[n])&&(this.videoBuffer=o.buffer)):i=!0}i&&s?(this.log("Alternate track found, use "+a+".buffered to schedule main fragment loading"),this.mediaBuffer=s.buffer):this.mediaBuffer=this.media},n.onFragBuffered=function(e,t){var n,r=t.frag;t=t.part;r&&r.type!==Br||(this.fragContextChanged(r)?(this.warn("Fragment "+r.sn+(t?" p: "+t.index:"")+" of level "+r.level+" finished buffering, but was aborted. state: "+this.state),this.state===Ai&&(this.state=Ti)):(n=(t||r).stats,this.fragLastKbps=Math.round(8*n.total/(n.buffering.end-n.loading.first)),"initSegment"!==r.sn&&(this.fragPrevious=r),this.fragBufferedComplete(r,t)))},n.onError=function(e,t){var n;if(t.fatal)this.state=Ri;else switch(t.details){case Kn.FRAG_GAP:case Kn.FRAG_PARSING_ERROR:case Kn.FRAG_DECRYPT_ERROR:case Kn.FRAG_LOAD_ERROR:case Kn.FRAG_LOAD_TIMEOUT:case Kn.KEY_LOAD_ERROR:case Kn.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(Br,t);break;case Kn.LEVEL_LOAD_ERROR:case Kn.LEVEL_LOAD_TIMEOUT:case Kn.LEVEL_PARSING_ERROR:t.levelRetry||this.state!==Ii||(null==(n=t.context)?void 0:n.type)!==Mr||(this.state=Ti);break;case Kn.BUFFER_APPEND_ERROR:case Kn.BUFFER_FULL_ERROR:t.parent&&"main"===t.parent&&(t.details===Kn.BUFFER_APPEND_ERROR?this.resetLoadingState():this.reduceLengthAndFlushBuffer(t)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY));break;case Kn.INTERNAL_EXCEPTION:this.recoverWorkerError(t)}},n.checkBuffer=function(){var e,t,n,r=this.media,i=this.gapController;r&&i&&r.readyState&&(!this.loadedmetadata&&hi.getBuffered(r).length||(t=(e=this.state)!==Ti?this.fragCurrent:null,n=this.getLevelDetails(),i.poll(this.lastCurrentTime,t,n,e)),this.lastCurrentTime=r.currentTime)},n.onFragLoadEmergencyAborted=function(){this.state=Ti,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},n.onBufferFlushed=function(e,t){var n;((t=t.type)!==er||this.audioOnly&&!this.altAudio)&&(n=(t===tr?this.videoBuffer:this.mediaBuffer)||this.media,this.afterBufferFlushed(n,t,Br),this.tick())},n.onLevelsUpdated=function(e,t){-1<this.level&&this.fragCurrent&&(this.level=this.fragCurrent.level),this.levels=t.levels},n.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},n.seekToStartPos=function(){var e,t,n,r=this.media;r&&(e=r.currentTime,0<=(t=this.startPosition))&&e<t&&(r.seeking?this.log("could not seek to "+t+", already seeking at "+e):(0<(n=((n=hi.getBuffered(r)).length?n.start(0):0)-t)&&(n<this.config.maxBufferHole||n<this.config.maxFragLookUpTolerance)&&(this.log("adjusting start position by "+n+" to match buffer start"),this.startPosition=t+=n),this.log("seek to target start position "+t+" from current time "+e),r.currentTime=t))},n._getAudioCodec=function(e){return e=this.config.defaultAudioCodec||e.audioCodec,this.audioCodecSwap&&e&&(this.log("Swapping audio codec"),e=-1!==e.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),e},n._loadBitrateTestFrag=function(e,t){var n=this;e.bitrateTest=!0,this._doFragLoad(e,t).then((function(r){var i,a=n.hls;r&&!n.fragContextChanged(e)&&(t.fragmentError=0,n.state=Ti,n.startFragRequested=!1,n.bitrateTest=!1,(i=e.stats).parsing.start=i.parsing.end=i.buffering.start=i.buffering.end=self.performance.now(),a.trigger(zn.FRAG_LOADED,r),e.bitrateTest=!1)}))},n._handleTransmuxComplete=function(e){var t="main",n=this.hls,r=e.remuxResult;e=e.chunkMeta;if(s=this.getCurrentContext(e)){var i=s.frag,a=s.part,s=s.level,o=r.video,u=r.text,l=r.id3,c=r.initSegment,d=s.details,h=this.altAudio?void 0:r.audio;if(this.fragContextChanged(i))this.fragmentTracker.removeFragment(i);else{if(this.state=Ci,c&&(null!=c&&c.tracks&&(f=i.initSegment||i,this._bufferInitSegment(s,c.tracks,f,e),n.trigger(zn.FRAG_PARSING_INIT_SEGMENT,{frag:f,id:t,tracks:c.tracks})),s=c.initPTS,f=c.timescale,Gn(s))&&(this.initPTS[i.cc]={baseTime:s,timescale:f},n.trigger(zn.INIT_PTS_FOUND,{frag:i,id:t,initPTS:s,timescale:f})),o&&d&&"initSegment"!==i.sn){c=d.fragments[i.sn-1-d.startSN],s=i.sn===d.startSN;var f=!c||i.cc>c.cc;if(!1!==r.independent){c=o.startPTS,r=o.endPTS;var p=o.startDTS,v=o.endDTS;if(a)a.elementaryStreams[o.type]={startPTS:c,endPTS:r,startDTS:p,endDTS:v};else if(o.firstKeyFrame&&o.independent&&1===e.id&&!f&&(this.couldBacktrack=!0),o.dropped&&o.independent){var m=((m=this.getMainFwdBufferInfo())?m.end:this.getLoadPosition())+this.config.maxBufferHole,g=o.firstKeyFramePTS||c;if(!s&&m<g-this.config.maxBufferHole&&!f)return void this.backtrack(i);f&&(i.gap=!0),i.setElementaryStreamInfo(o.type,i.start,r,i.start,v,!0)}else s&&2<c&&(i.gap=!0);i.setElementaryStreamInfo(o.type,c,r,p,v),this.backtrackFragment&&(this.backtrackFragment=i),this.bufferFragmentData(o,i,a,e,s||f)}else{if(!s&&!f)return void this.backtrack(i);i.gap=!0}}h&&(m=h.startPTS,g=h.endPTS,c=h.startDTS,r=h.endDTS,a&&(a.elementaryStreams[er]={startPTS:m,endPTS:g,startDTS:c,endDTS:r}),i.setElementaryStreamInfo(er,m,g,c,r),this.bufferFragmentData(h,i,a,e)),d&&null!=l&&null!=(p=l.samples)&&p.length&&(v={id:t,frag:i,details:d,samples:l.samples},n.trigger(zn.FRAG_PARSING_METADATA,v)),d&&u&&(o={id:t,frag:i,details:d,samples:u.samples},n.trigger(zn.FRAG_PARSING_USERDATA,o))}}else this.resetWhenMissingContext(e)},n._bufferInitSegment=function(e,t,n,r){var i,a,s,o,u,l=this;this.state===Ci&&(this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&delete t.audio,i=t.audio,a=t.video,s=t.audiovideo,i&&(o=e.audioCodec,u=navigator.userAgent.toLowerCase(),(o=this.audioCodecSwitch&&(o=o&&(-1!==o.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),1!==i.metadata.channelCount)&&-1===u.indexOf("firefox")?"mp4a.40.5":o)&&-1!==o.indexOf("mp4a.40.5")&&-1!==u.indexOf("android")&&"audio/mpeg"!==i.container&&this.log("Android: force audio codec to "+(o="mp4a.40.2")),e.audioCodec&&e.audioCodec!==o&&this.log('Swapping manifest audio codec "'+e.audioCodec+'" for "'+o+'"'),i.levelCodec=o,i.id="main",this.log("Init audio buffer, container:"+i.container+", codecs[selected/level/parsed]=["+(o||"")+"/"+(e.audioCodec||"")+"/"+i.codec+"]")),a&&(a.levelCodec=e.videoCodec,a.id="main",this.log("Init video buffer, container:"+a.container+", codecs[level/parsed]=["+(e.videoCodec||"")+"/"+a.codec+"]")),s&&this.log("Init audiovideo buffer, container:"+s.container+", codecs[level/parsed]=["+e.codecs+"/"+s.codec+"]"),this.hls.trigger(zn.BUFFER_CODECS,t),Object.keys(t).forEach((function(e){var i=t[e].initSegment;null!=i&&i.byteLength&&l.hls.trigger(zn.BUFFER_APPENDING,{type:e,data:i,frag:n,part:null,chunkMeta:r,parent:n.type})})),this.tickImmediate())},n.getMainFwdBufferInfo=function(){return this.getFwdBufferInfo(this.mediaBuffer||this.media,Br)},n.backtrack=function(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=Ti},n.checkFragmentChanged=function(){var e,t=this.media,n=null;t&&1<t.readyState&&!1===t.seeking&&(e=t.currentTime,hi.isBuffered(t,e)?n=this.getAppendedFrag(e):hi.isBuffered(t,e+.1)&&(n=this.getAppendedFrag(e+.1)),n)&&(this.backtrackFragment=null,t=this.fragPlaying,e=n.level,t&&n.sn===t.sn&&t.level===e||(this.fragPlaying=n,this.hls.trigger(zn.FRAG_CHANGED,{frag:n}),t&&t.level===e)||this.hls.trigger(zn.LEVEL_SWITCHED,{level:e}))},u(t,[{key:"maxBufferLength",get:function(){var e=this.levels,t=this.level;return(e=null==e?void 0:e[t])?this.getMaxBufferLength(e.maxBitrate):this.config.maxBufferLength}},{key:"nextLevel",get:function(){var e=this.nextBufferedFrag;return e?e.level:-1}},{key:"currentFrag",get:function(){var e=this.media;return e?this.fragPlaying||this.getAppendedFrag(e.currentTime):null}},{key:"currentProgramDateTime",get:function(){if(e=this.media){var e=e.currentTime,t=this.currentFrag;if(t&&Gn(e)&&Gn(t.programDateTime))return e=t.programDateTime+1e3*(e-t.start),new Date(e)}return null}},{key:"currentLevel",get:function(){var e=this.currentFrag;return e?e.level:-1}},{key:"nextBufferedFrag",get:function(){var e=this.currentFrag;return e?this.followingBufferedFrag(e):null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}])}(ai);return(ii=function(){function e(t){void 0===t&&(t={}),this.config=void 0,this.userConfig=void 0,this.logger=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new ha,this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null,this.triggeringException=void 0;var r=this.logger=_(t.debug||!1,"Hls instance"),i=this.config=function(e,t,r){if((t.liveSyncDurationCount||t.liveMaxLatencyDurationCount)&&(t.liveSyncDuration||t.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(void 0!==t.liveMaxLatencyDurationCount&&(void 0===t.liveSyncDurationCount||t.liveMaxLatencyDurationCount<=t.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(void 0!==t.liveMaxLatencyDuration&&(void 0===t.liveSyncDuration||t.liveMaxLatencyDuration<=t.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');var i=Rn(e),a=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return["manifest","level","frag"].forEach((function(e){var n=("level"===e?"playlist":e)+"LoadPolicy",s=void 0===t[n],o=[];a.forEach((function(r){var a=e+"Loading"+r,u=t[a];if(void 0!==u&&s){o.push(a);var l=i[n].default;switch(t[n]={default:l},r){case"TimeOut":l.maxLoadTimeMs=u,l.maxTimeToFirstByteMs=u;break;case"MaxRetry":l.errorRetry.maxNumRetry=u,l.timeoutRetry.maxNumRetry=u;break;case"RetryDelay":l.errorRetry.retryDelayMs=u,l.timeoutRetry.retryDelayMs=u;break;case"MaxRetryTimeout":l.errorRetry.maxRetryDelayMs=u,l.timeoutRetry.maxRetryDelayMs=u}}})),o.length&&r.warn('hls.js config: "'+o.join('", "')+'" setting(s) are deprecated, use "'+n+'": '+JSON.stringify(t[n]))})),n(n({},i),t)}(e.DefaultConfig,t,r),a=(t=(this.userConfig=t,i.progressive&&function(e,t){var n=e.loader;n!==us&&n!==ss?(t.log("[config]: Custom loader detected, cannot enable progressive streaming"),e.progressive=!1):function(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(e){}return!1}()&&(e.loader=us,e.progressive=!0,e.enableSoftwareAES=!0,t.log("[config]: Progressive streaming enabled, using FetchLoader"))}(i,r),i.abrController),r=i.bufferController,i.capLevelController),s=i.errorController,o=i.fpsController,u=(s=new s(this),t=this.abrController=new t(this),new ci(this)),l=(r=this.bufferController=new r(this,u),a=this.capLevelController=new a(this),o=new o(this),new Gr(this)),c=new Wr(this),d=(d=i.contentSteeringController)?new d(this):null,h=this.levelController=new hs(this,d),f=new fs(this.config),p=this.streamController=new vs(this,u,f);a.setStreamController(p),o.setStreamController(p),l=[l,h,p],d&&l.splice(1,0,d),this.networkControllers=l,h=[t,r,a,o,c,u];"function"==typeof(t=((d=((p=(this.audioTrackController=this.createController(i.audioTrackController,l),i.audioStreamController))&&l.push(new p(this,u,f)),this.subtitleTrackController=this.createController(i.subtitleTrackController,l),i.subtitleStreamController))&&l.push(new d(this,u,f)),this.createController(i.timelineController,h),f.emeController=this.emeController=this.createController(i.emeController,h),this.cmcdController=this.createController(i.cmcdController,h),this.latencyController=this.createController(Kr,h),this.coreComponents=h,l.push(s),s.onErrorOut))&&this.on(zn.ERROR,t,s)}e.isMSESupported=On,e.isSupported=function(){return!!On()&&"function"==typeof(null==(e=re())?void 0:e.isTypeSupported)&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some((function(t){return e.isTypeSupported(se(t,"video"))}))||["mp4a.40.2","fLaC"].some((function(t){return e.isTypeSupported(se(t,"audio"))})));var e},e.getMediaSource=function(){return re()};var t=e.prototype;return t.createController=function(e,t){return e?(e=new e(this),t&&t.push(e),e):null},t.on=function(e,t,n){this._emitter.on(e,t,n=void 0===n?this:n)},t.once=function(e,t,n){this._emitter.once(e,t,n=void 0===n?this:n)},t.removeAllListeners=function(e){this._emitter.removeAllListeners(e)},t.off=function(e,t,n,r){this._emitter.off(e,t,n=void 0===n?this:n,r)},t.listeners=function(e){return this._emitter.listeners(e)},t.emit=function(e,t,n){return this._emitter.emit(e,t,n)},t.trigger=function(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(n){this.logger.error("An internal error happened while handling event "+e+'. Error message: "'+n.message+'". Here is a stacktrace:',n),this.triggeringException||(this.triggeringException=!0,t=e===zn.ERROR,this.trigger(zn.ERROR,{type:Wn.OTHER_ERROR,details:Kn.INTERNAL_EXCEPTION,fatal:t,event:e,error:n}),this.triggeringException=!1)}return!1},t.listenerCount=function(e){return this._emitter.listenerCount(e)},t.destroy=function(){this.logger.log("destroy"),this.trigger(zn.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach((function(e){return e.destroy()})),this.networkControllers.length=0,this.coreComponents.forEach((function(e){return e.destroy()})),this.coreComponents.length=0;var e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null},t.attachMedia=function(e){this.logger.log("attachMedia"),this._media=e,this.trigger(zn.MEDIA_ATTACHING,{media:e})},t.detachMedia=function(){this.logger.log("detachMedia"),this.trigger(zn.MEDIA_DETACHING,void 0),this._media=null},t.loadSource=function(e){this.stopLoad();var t=this.media,n=this.url,r=this.url=Nn.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.logger.log("loadSource:"+r),t&&n&&(n!==r||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(zn.MANIFEST_LOADING,{url:e})},t.startLoad=function(e){void 0===e&&(e=-1),this.logger.log("startLoad("+e+")"),this.networkControllers.forEach((function(t){t.startLoad(e)}))},t.stopLoad=function(){this.logger.log("stopLoad"),this.networkControllers.forEach((function(e){e.stopLoad()}))},t.resumeBuffering=function(){this.networkControllers.forEach((function(e){e.resumeBuffering&&e.resumeBuffering()}))},t.pauseBuffering=function(){this.networkControllers.forEach((function(e){e.pauseBuffering&&e.pauseBuffering()}))},t.swapAudioCodec=function(){this.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},t.recoverMediaError=function(){this.logger.log("recoverMediaError");var e=this._media;this.detachMedia(),e&&this.attachMedia(e)},t.removeLevel=function(e){this.levelController.removeLevel(e)},t.setAudioOption=function(e){var t;return null==(t=this.audioTrackController)?void 0:t.setAudioOption(e)},t.setSubtitleOption=function(e){var t;return null!=(t=this.subtitleTrackController)&&t.setSubtitleOption(e),null},u(e,[{key:"levels",get:function(){return this.levelController.levels||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(e){this.logger.log("set currentLevel:"+e),this.levelController.manualLevel=e,this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(e){this.logger.log("set nextLevel:"+e),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(e){this.logger.log("set loadLevel:"+e),this.levelController.manualLevel=e}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(e){this.levelController.nextLoadLevel=e}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(e){this.logger.log("set firstLevel:"+e),this.levelController.firstLevel=e}},{key:"startLevel",get:function(){var e=this.levelController.startLevel;return-1===e&&-1<this.abrController.forcedAutoLevel?this.abrController.forcedAutoLevel:e},set:function(e){this.logger.log("set startLevel:"+e),-1!==e&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(e){(e=!!e)!==this.config.capLevelToPlayerSize&&(e?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=e)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(e){this._autoLevelCapping!==e&&(this.logger.log("set autoLevelCapping:"+e),this._autoLevelCapping=e,this.levelController.checkMaxAutoUpdated())}},{key:"bandwidthEstimate",get:function(){var e=this.abrController.bwEstimator;return e?e.getEstimate():NaN},set:function(e){this.abrController.resetEstimator(e)}},{key:"ttfbEstimate",get:function(){var e=this.abrController.bwEstimator;return e?e.getEstimateTTFB():NaN}},{key:"maxHdcpLevel",get:function(){return this._maxHdcpLevel},set:function(e){-1<qr.indexOf(e)&&this._maxHdcpLevel!==e&&(this._maxHdcpLevel=e,this.levelController.checkMaxAutoUpdated())}},{key:"autoLevelEnabled",get:function(){return-1===this.levelController.manualLevel}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var e=this.levels,t=this.config.minAutoBitrate;if(e)for(var n=e.length,r=0;r<n;r++)if(e[r].maxBitrate>=t)return r;return 0}},{key:"maxAutoLevel",get:function(){var e=this.levels,t=this.autoLevelCapping,n=this.maxHdcpLevel;t=-1===t&&null!=e&&e.length?e.length-1:t;if(n)for(var r=t;r--;){var i=e[r].attrs["HDCP-LEVEL"];if(i&&i<=n)return r}return t}},{key:"firstAutoLevel",get:function(){return this.abrController.firstAutoLevel}},{key:"nextAutoLevel",get:function(){return this.abrController.nextAutoLevel},set:function(e){this.abrController.nextAutoLevel=e}},{key:"playingDate",get:function(){return this.streamController.currentProgramDateTime}},{key:"mainForwardBufferInfo",get:function(){return this.streamController.getMainFwdBufferInfo()}},{key:"maxBufferLength",get:function(){return this.streamController.maxBufferLength}},{key:"allAudioTracks",get:function(){var e=this.audioTrackController;return e?e.allAudioTracks:[]}},{key:"audioTracks",get:function(){var e=this.audioTrackController;return e?e.audioTracks:[]}},{key:"audioTrack",get:function(){var e=this.audioTrackController;return e?e.audioTrack:-1},set:function(e){var t=this.audioTrackController;t&&(t.audioTrack=e)}},{key:"allSubtitleTracks",get:function(){var e=this.subtitleTrackController;return e?e.allSubtitleTracks:[]}},{key:"subtitleTracks",get:function(){var e=this.subtitleTrackController;return e?e.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var e=this.subtitleTrackController;return e?e.subtitleTrack:-1},set:function(e){var t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var e=this.subtitleTrackController;return!!e&&e.subtitleDisplay},set:function(e){var t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(e){this.config.lowLatencyMode=e}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){}},{key:"Events",get:function(){return zn}},{key:"ErrorTypes",get:function(){return Wn}},{key:"ErrorDetails",get:function(){return Kn}},{key:"DefaultConfig",get:function(){return e.defaultConfig||ds},set:function(t){e.defaultConfig=t}}])}()).defaultConfig=void 0,ii},"object"===i(t)&&void 0!==e?e.exports=o():void 0!==(r="function"==typeof(r=o)?r.call(t,n,t,e):r)&&(e.exports=r)}(!1)}]),"object"==typeof module&&module.exports&&(module.exports=window.hlsSourceHandler),function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).adapter=e()}}((function(){return function e(t,n,r){function i(s,o){if(!n[s]){if(!t[s]){var u="function"==typeof require&&require;if(!o&&u)return u(s,!0);if(a)return a(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[s]={exports:{}};t[s][0].call(c.exports,(function(e){return i(t[s][1][e]||e)}),c,c.exports,e,t,n,r)}return n[s].exports}for(var a="function"==typeof require&&require,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(e,t,n){"use strict";var r=(0,e("./adapter_factory.js").adapterFactory)({window:"undefined"==typeof window?void 0:window});t.exports=r},{"./adapter_factory.js":2}],2:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}Object.defineProperty(n,"__esModule",{value:!0}),n.adapterFactory=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.window,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shimChrome:!0,shimFirefox:!0,shimEdge:!0,shimSafari:!0},r=i.log,c=i.detectBrowser(t),d={browserDetails:c,commonShim:l,extractVersion:i.extractVersion,disableLog:i.disableLog,disableWarnings:i.disableWarnings};switch(c.browser){case"chrome":if(!a||!a.shimPeerConnection||!n.shimChrome)return r("Chrome shim is not included in this adapter release."),d;if(null===c.version)return r("Chrome shim can not determine version, not shimming."),d;r("adapter.js shimming chrome."),d.browserShim=a,a.shimGetUserMedia(t),a.shimMediaStream(t),a.shimPeerConnection(t),a.shimOnTrack(t),a.shimAddTrackRemoveTrack(t),a.shimGetSendersWithDtmf(t),a.shimGetStats(t),a.shimSenderReceiverGetStats(t),a.fixNegotiationNeeded(t),l.shimRTCIceCandidate(t),l.shimConnectionState(t),l.shimMaxMessageSize(t),l.shimSendThrowTypeError(t),l.removeAllowExtmapMixed(t);break;case"firefox":if(!o||!o.shimPeerConnection||!n.shimFirefox)return r("Firefox shim is not included in this adapter release."),d;r("adapter.js shimming firefox."),d.browserShim=o,o.shimGetUserMedia(t),o.shimPeerConnection(t),o.shimOnTrack(t),o.shimRemoveStream(t),o.shimSenderGetStats(t),o.shimReceiverGetStats(t),o.shimRTCDataChannel(t),o.shimAddTransceiver(t),o.shimGetParameters(t),o.shimCreateOffer(t),o.shimCreateAnswer(t),l.shimRTCIceCandidate(t),l.shimConnectionState(t),l.shimMaxMessageSize(t),l.shimSendThrowTypeError(t);break;case"edge":if(!s||!s.shimPeerConnection||!n.shimEdge)return r("MS edge shim is not included in this adapter release."),d;r("adapter.js shimming edge."),d.browserShim=s,s.shimGetUserMedia(t),s.shimGetDisplayMedia(t),s.shimPeerConnection(t),s.shimReplaceTrack(t),l.shimMaxMessageSize(t),l.shimSendThrowTypeError(t);break;case"safari":if(!u||!n.shimSafari)return r("Safari shim is not included in this adapter release."),d;r("adapter.js shimming safari."),d.browserShim=u,u.shimRTCIceServerUrls(t),u.shimCreateOfferLegacy(t),u.shimCallbacksAPI(t),u.shimLocalStreamsAPI(t),u.shimRemoteStreamsAPI(t),u.shimTrackEventTransceiver(t),u.shimGetUserMedia(t),u.shimAudioContext(t),l.shimRTCIceCandidate(t),l.shimMaxMessageSize(t),l.shimSendThrowTypeError(t),l.removeAllowExtmapMixed(t);break;default:r("Unsupported browser!")}return d};var i=r(e("./utils")),a=r(e("./chrome/chrome_shim")),s=r(e("./edge/edge_shim")),o=r(e("./firefox/firefox_shim")),u=r(e("./safari/safari_shim")),l=r(e("./common_shim"))},{"./chrome/chrome_shim":3,"./common_shim":6,"./edge/edge_shim":7,"./firefox/firefox_shim":11,"./safari/safari_shim":14,"./utils":15}],3:[function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){var e=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map((function(t){return e._shimmedLocalStreams[t][0]}))};var t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){if(!n)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};var r=t.apply(this,arguments);return this._shimmedLocalStreams[n.id]?-1===this._shimmedLocalStreams[n.id].indexOf(r)&&this._shimmedLocalStreams[n.id].push(r):this._shimmedLocalStreams[n.id]=[n,r],r};var n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){var t=this;this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach((function(e){if(t.getSenders().find((function(t){return t.track===e})))throw new DOMException("Track already exists.","InvalidAccessError")}));var r=this.getSenders();n.apply(this,arguments);var i=this.getSenders().filter((function(e){return-1===r.indexOf(e)}));this._shimmedLocalStreams[e.id]=[e].concat(i)};var r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],r.apply(this,arguments)};var i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){var t=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach((function(n){var r=t._shimmedLocalStreams[n].indexOf(e);-1!==r&&t._shimmedLocalStreams[n].splice(r,1),1===t._shimmedLocalStreams[n].length&&delete t._shimmedLocalStreams[n]})),i.apply(this,arguments)}}Object.defineProperty(n,"__esModule",{value:!0}),n.shimGetDisplayMedia=n.shimGetUserMedia=void 0;var 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},s=e("./getusermedia");Object.defineProperty(n,"shimGetUserMedia",{enumerable:!0,get:function(){return s.shimGetUserMedia}});var o=e("./getdisplaymedia");Object.defineProperty(n,"shimGetDisplayMedia",{enumerable:!0,get:function(){return o.shimGetDisplayMedia}}),n.shimMediaStream=function(e){e.MediaStream=e.MediaStream||e.webkitMediaStream},n.shimOnTrack=function(e){if("object"!==(void 0===e?"undefined":a(e))||!e.RTCPeerConnection||"ontrack"in e.RTCPeerConnection.prototype)u.wrapPeerConnectionEvent(e,"track",(function(e){return e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e}));else{Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});var t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){var n=this;return this._ontrackpoly||(this._ontrackpoly=function(t){t.stream.addEventListener("addtrack",(function(r){var i;i=e.RTCPeerConnection.prototype.getReceivers?n.getReceivers().find((function(e){return e.track&&e.track.id===r.track.id})):{track:r.track};var a=new Event("track");a.track=r.track,a.receiver=i,a.transceiver={receiver:i},a.streams=[t.stream],n.dispatchEvent(a)})),t.stream.getTracks().forEach((function(r){var i;i=e.RTCPeerConnection.prototype.getReceivers?n.getReceivers().find((function(e){return e.track&&e.track.id===r.id})):{track:r};var a=new Event("track");a.track=r,a.receiver=i,a.transceiver={receiver:i},a.streams=[t.stream],n.dispatchEvent(a)}))},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}},n.shimGetSendersWithDtmf=function(e){if("object"===(void 0===e?"undefined":a(e))&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){var t=function(e,t){return{track:t,get dtmf(){return void 0===this._dtmf&&("audio"===t.kind?this._dtmf=e.createDTMFSender(t):this._dtmf=null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};var n=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,r){var i=n.apply(this,arguments);return i||(i=t(this,e),this._senders.push(i)),i};var r=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){r.apply(this,arguments);var t=this._senders.indexOf(e);-1!==t&&this._senders.splice(t,1)}}var i=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){var n=this;this._senders=this._senders||[],i.apply(this,[e]),e.getTracks().forEach((function(e){n._senders.push(t(n,e))}))};var s=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;this._senders=this._senders||[],s.apply(this,[e]),e.getTracks().forEach((function(e){var n=t._senders.find((function(t){return t.track===e}));n&&t._senders.splice(t._senders.indexOf(n),1)}))}}else if("object"===(void 0===e?"undefined":a(e))&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){var o=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){var e=this,t=o.apply(this,[]);return t.forEach((function(t){return t._pc=e})),t},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get:function(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}},n.shimGetStats=function(e){if(e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){var e=this,n=Array.prototype.slice.call(arguments),r=n[0],i=n[1],a=n[2];if(arguments.length>0&&"function"==typeof r)return t.apply(this,arguments);if(0===t.length&&(0===arguments.length||"function"!=typeof r))return t.apply(this,[]);var s=function(e){var t={};return e.result().forEach((function(e){var n={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach((function(t){n[t]=e.stat(t)})),t[n.id]=n})),t},o=function(e){return new Map(Object.keys(e).map((function(t){return[t,e[t]]})))};if(arguments.length>=2){var u=function(e){i(o(s(e)))};return t.apply(this,[u,r])}return new Promise((function(n,r){t.apply(e,[function(e){n(o(s(e)))},r])})).then(i,a)}}},n.shimSenderReceiverGetStats=function(e){if("object"===(void 0===e?"undefined":a(e))&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver){if(!("getStats"in e.RTCRtpSender.prototype)){var t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){var e=this,n=t.apply(this,[]);return n.forEach((function(t){return t._pc=e})),n});var n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){var e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){var e=this;return this._pc.getStats().then((function(t){return u.filterStats(t,e.track,!0)}))}}if(!("getStats"in e.RTCRtpReceiver.prototype)){var r=e.RTCPeerConnection.prototype.getReceivers;r&&(e.RTCPeerConnection.prototype.getReceivers=function(){var e=this,t=r.apply(this,[]);return t.forEach((function(t){return t._pc=e})),t}),u.wrapPeerConnectionEvent(e,"track",(function(e){return e.receiver._pc=e.srcElement,e})),e.RTCRtpReceiver.prototype.getStats=function(){var e=this;return this._pc.getStats().then((function(t){return u.filterStats(t,e.track,!1)}))}}if("getStats"in e.RTCRtpSender.prototype&&"getStats"in e.RTCRtpReceiver.prototype){var i=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){var t=arguments[0],n=void 0,r=void 0,a=void 0;return this.getSenders().forEach((function(e){e.track===t&&(n?a=!0:n=e)})),this.getReceivers().forEach((function(e){return e.track===t&&(r?a=!0:r=e),e.track===t})),a||n&&r?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):n?n.getStats():r?r.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return i.apply(this,arguments)}}}},n.shimAddTrackRemoveTrackWithNative=i,n.shimAddTrackRemoveTrack=function(e){function t(e,t){var n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((function(t){var r=e._reverseStreams[t],i=e._streams[r.id];n=n.replace(new RegExp(i.id,"g"),r.id)})),new RTCSessionDescription({type:t.type,sdp:n})}function n(e,t){var n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((function(t){var r=e._reverseStreams[t],i=e._streams[r.id];n=n.replace(new RegExp(r.id,"g"),i.id)})),new RTCSessionDescription({type:t.type,sdp:n})}if(e.RTCPeerConnection){var a=u.detectBrowser(e);if(e.RTCPeerConnection.prototype.addTrack&&a.version>=65)return i(e);var s=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){var e=this,t=s.apply(this);return this._reverseStreams=this._reverseStreams||{},t.map((function(t){return e._reverseStreams[t.id]}))};var o=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){var n=this;if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},t.getTracks().forEach((function(e){if(n.getSenders().find((function(t){return t.track===e})))throw new DOMException("Track already exists.","InvalidAccessError")})),!this._reverseStreams[t.id]){var r=new e.MediaStream(t.getTracks());this._streams[t.id]=r,this._reverseStreams[r.id]=t,t=r}o.apply(this,[t])};var l=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},l.apply(this,[this._streams[e.id]||e]),delete this._reverseStreams[this._streams[e.id]?this._streams[e.id].id:e.id],delete this._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,n){var r=this;if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");var i=[].slice.call(arguments,1);if(1!==i.length||!i[0].getTracks().find((function(e){return e===t})))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find((function(e){return e.track===t})))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};var a=this._streams[n.id];if(a)a.addTrack(t),Promise.resolve().then((function(){r.dispatchEvent(new Event("negotiationneeded"))}));else{var s=new e.MediaStream([t]);this._streams[n.id]=s,this._reverseStreams[s.id]=n,this.addStream(s)}return this.getSenders().find((function(e){return e.track===t}))},["createOffer","createAnswer"].forEach((function(n){var i=e.RTCPeerConnection.prototype[n],a=r({},n,(function(){var e=this,n=arguments;return arguments.length&&"function"==typeof arguments[0]?i.apply(this,[function(r){var i=t(e,r);n[0].apply(null,[i])},function(e){n[1]&&n[1].apply(null,e)},arguments[2]]):i.apply(this,arguments).then((function(n){return t(e,n)}))}));e.RTCPeerConnection.prototype[n]=a[n]}));var c=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=n(this,arguments[0]),c.apply(this,arguments)):c.apply(this,arguments)};var d=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get:function(){var e=d.get.apply(this);return""===e.type?e:t(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){var t=this;if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!e._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(e._pc!==this)throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{};var n=void 0;Object.keys(this._streams).forEach((function(r){t._streams[r].getTracks().find((function(t){return e.track===t}))&&(n=t._streams[r])})),n&&(1===n.getTracks().length?this.removeStream(this._reverseStreams[n.id]):n.removeTrack(e.track),this.dispatchEvent(new Event("negotiationneeded")))}}},n.shimPeerConnection=function(e){var t=u.detectBrowser(e);if(!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection){var n=0===e.RTCPeerConnection.prototype.addIceCandidate.length;t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){var n=e.RTCPeerConnection.prototype[t],i=r({},t,(function(){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}));e.RTCPeerConnection.prototype[t]=i[t]}));var i=e.RTCPeerConnection.prototype.addIceCandidate;e.RTCPeerConnection.prototype.addIceCandidate=function(){return n||arguments[0]?t.version<78&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():i.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())}}},n.fixNegotiationNeeded=function(e){var t=u.detectBrowser(e);u.wrapPeerConnectionEvent(e,"negotiationneeded",(function(e){var n=e.target;if(!(t.version<72||n.getConfiguration&&"plan-b"===n.getConfiguration().sdpSemantics)||"stable"===n.signalingState)return e}))};var u=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(e("../utils.js"))},{"../utils.js":15,"./getdisplaymedia":4,"./getusermedia":5}],4:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.shimGetDisplayMedia=function(e,t){if((!e.navigator.mediaDevices||!("getDisplayMedia"in e.navigator.mediaDevices))&&e.navigator.mediaDevices)return"function"!=typeof t?void console.error("shimGetDisplayMedia: getSourceId argument is not a function"):void(e.navigator.mediaDevices.getDisplayMedia=function(n){return t(n).then((function(t){var r=n.video&&n.video.width,i=n.video&&n.video.height,a=n.video&&n.video.frameRate;return n.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:a||3}},r&&(n.video.mandatory.maxWidth=r),i&&(n.video.mandatory.maxHeight=i),e.navigator.mediaDevices.getUserMedia(n)}))})}},{}],5:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r="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.shimGetUserMedia=function(e){var t=e&&e.navigator;if(t.mediaDevices){var n=i.detectBrowser(e),s=function(e){if("object"!==(void 0===e?"undefined":r(e))||e.mandatory||e.optional)return e;var t={};return Object.keys(e).forEach((function(n){if("require"!==n&&"advanced"!==n&&"mediaSource"!==n){var i="object"===r(e[n])?e[n]:{ideal:e[n]};void 0!==i.exact&&"number"==typeof i.exact&&(i.min=i.max=i.exact);var a=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==i.ideal){t.optional=t.optional||[];var s={};"number"==typeof i.ideal?(s[a("min",n)]=i.ideal,t.optional.push(s),(s={})[a("max",n)]=i.ideal,t.optional.push(s)):(s[a("",n)]=i.ideal,t.optional.push(s))}void 0!==i.exact&&"number"!=typeof i.exact?(t.mandatory=t.mandatory||{},t.mandatory[a("",n)]=i.exact):["min","max"].forEach((function(e){void 0!==i[e]&&(t.mandatory=t.mandatory||{},t.mandatory[a(e,n)]=i[e])}))}})),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},o=function(e,i){if(n.version>=61)return i(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"===r(e.audio)){var o=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])};o((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),o(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=s(e.audio)}if(e&&"object"===r(e.video)){var u=e.video.facingMode;u=u&&("object"===(void 0===u?"undefined":r(u))?u:{ideal:u});var l=n.version<66;if(u&&("user"===u.exact||"environment"===u.exact||"user"===u.ideal||"environment"===u.ideal)&&(!t.mediaDevices.getSupportedConstraints||!t.mediaDevices.getSupportedConstraints().facingMode||l)){delete e.video.facingMode;var c=void 0;if("environment"===u.exact||"environment"===u.ideal?c=["back","rear"]:"user"!==u.exact&&"user"!==u.ideal||(c=["front"]),c)return t.mediaDevices.enumerateDevices().then((function(t){var n=(t=t.filter((function(e){return"videoinput"===e.kind}))).find((function(e){return c.some((function(t){return e.label.toLowerCase().includes(t)}))}));return!n&&t.length&&c.includes("back")&&(n=t[t.length-1]),n&&(e.video.deviceId=u.exact?{exact:n.deviceId}:{ideal:n.deviceId}),e.video=s(e.video),a("chrome: "+JSON.stringify(e)),i(e)}))}e.video=s(e.video)}return a("chrome: "+JSON.stringify(e)),i(e)},u=function(e){return n.version>=64?e:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}};if(t.getUserMedia=function(e,n,r){o(e,(function(e){t.webkitGetUserMedia(e,n,(function(e){r&&r(u(e))}))}))}.bind(t),t.mediaDevices.getUserMedia){var l=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(e){return o(e,(function(e){return l(e).then((function(t){if(e.audio&&!t.getAudioTracks().length||e.video&&!t.getVideoTracks().length)throw t.getTracks().forEach((function(e){e.stop()})),new DOMException("","NotFoundError");return t}),(function(e){return Promise.reject(u(e))}))}))}}}};var i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(e("../utils.js")),a=i.log},{"../utils.js":15}],6:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r="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.shimRTCIceCandidate=function(e){if(e.RTCIceCandidate&&(!e.RTCIceCandidate||!("foundation"in e.RTCIceCandidate.prototype))){var t=e.RTCIceCandidate;e.RTCIceCandidate=function(e){if("object"===(void 0===e?"undefined":r(e))&&e.candidate&&0===e.candidate.indexOf("a=")&&((e=JSON.parse(JSON.stringify(e))).candidate=e.candidate.substr(2)),e.candidate&&e.candidate.length){var n=new t(e),a=i.default.parseCandidate(e.candidate),s=Object.assign(n,a);return s.toJSON=function(){return{candidate:s.candidate,sdpMid:s.sdpMid,sdpMLineIndex:s.sdpMLineIndex,usernameFragment:s.usernameFragment}},s}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,a.wrapPeerConnectionEvent(e,"icecandidate",(function(t){return t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t}))}},n.shimMaxMessageSize=function(e){if(e.RTCPeerConnection){var t=a.detectBrowser(e);"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get:function(){return void 0===this._sctp?null:this._sctp}});var n=function(e){if(!e||!e.sdp)return!1;var t=i.default.splitSections(e.sdp);return t.shift(),t.some((function(e){var t=i.default.parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")}))},r=function(e){var t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;var n=parseInt(t[1],10);return n!=n?-1:n},s=function(e){var n=65536;return"firefox"===t.browser&&(n=t.version<57?-1===e?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),n},o=function(e,n){var r=65536;"firefox"===t.browser&&57===t.version&&(r=65535);var a=i.default.matchPrefix(e.sdp,"a=max-message-size:");return a.length>0?r=parseInt(a[0].substr(19),10):"firefox"===t.browser&&-1!==n&&(r=2147483637),r},u=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===t.browser&&t.version>=76&&"plan-b"===this.getConfiguration().sdpSemantics&&Object.defineProperty(this,"sctp",{get:function(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0}),n(arguments[0])){var e=r(arguments[0]),i=s(e),a=o(arguments[0],e),l=void 0;l=0===i&&0===a?Number.POSITIVE_INFINITY:0===i||0===a?Math.max(i,a):Math.min(i,a);var c={};Object.defineProperty(c,"maxMessageSize",{get:function(){return l}}),this._sctp=c}return u.apply(this,arguments)}}},n.shimSendThrowTypeError=function(e){function t(e,t){var n=e.send;e.send=function(){var r=arguments[0],i=r.length||r.size||r.byteLength;if("open"===e.readyState&&t.sctp&&i>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return n.apply(e,arguments)}}if(e.RTCPeerConnection&&"createDataChannel"in e.RTCPeerConnection.prototype){var n=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){var e=n.apply(this,arguments);return t(e,this),e},a.wrapPeerConnectionEvent(e,"datachannel",(function(e){return t(e.channel,e.target),e}))}},n.shimConnectionState=function(e){if(e.RTCPeerConnection&&!("connectionState"in e.RTCPeerConnection.prototype)){var t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get:function(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get:function(){return this._onconnectionstatechange||null},set:function(e){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),e&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=e)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach((function(e){var n=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=function(e){var t=e.target;if(t._lastConnectionState!==t.connectionState){t._lastConnectionState=t.connectionState;var n=new Event("connectionstatechange",e);t.dispatchEvent(n)}return e},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),n.apply(this,arguments)}}))}},n.removeAllowExtmapMixed=function(e){if(e.RTCPeerConnection){var t=a.detectBrowser(e);if(!("chrome"===t.browser&&t.version>=71||"safari"===t.browser&&t.version>=605)){var n=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(e){return e&&e.sdp&&-1!==e.sdp.indexOf("\na=extmap-allow-mixed")&&(e.sdp=e.sdp.split("\n").filter((function(e){return"a=extmap-allow-mixed"!==e.trim()})).join("\n")),n.apply(this,arguments)}}}};var i=function(e){return e&&e.__esModule?e:{default:e}}(e("sdp")),a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(e("./utils"))},{"./utils":15,sdp:17}],7:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.shimGetDisplayMedia=n.shimGetUserMedia=void 0;var r=e("./getusermedia");Object.defineProperty(n,"shimGetUserMedia",{enumerable:!0,get:function(){return r.shimGetUserMedia}});var i=e("./getdisplaymedia");Object.defineProperty(n,"shimGetDisplayMedia",{enumerable:!0,get:function(){return i.shimGetDisplayMedia}}),n.shimPeerConnection=function(e){var t=a.detectBrowser(e);if(e.RTCIceGatherer&&(e.RTCIceCandidate||(e.RTCIceCandidate=function(e){return e}),e.RTCSessionDescription||(e.RTCSessionDescription=function(e){return e}),t.version<15025)){var n=Object.getOwnPropertyDescriptor(e.MediaStreamTrack.prototype,"enabled");Object.defineProperty(e.MediaStreamTrack.prototype,"enabled",{set:function(e){n.set.call(this,e);var t=new Event("enabled");t.enabled=e,this.dispatchEvent(t)}})}!e.RTCRtpSender||"dtmf"in e.RTCRtpSender.prototype||Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get:function(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=new e.RTCDtmfSender(this):"video"===this.track.kind&&(this._dtmf=null)),this._dtmf}}),e.RTCDtmfSender&&!e.RTCDTMFSender&&(e.RTCDTMFSender=e.RTCDtmfSender);var r=(0,o.default)(e,t.version);e.RTCPeerConnection=function(e){return e&&e.iceServers&&(e.iceServers=(0,s.filterIceServers)(e.iceServers,t.version),a.log("ICE servers after filtering:",e.iceServers)),new r(e)},e.RTCPeerConnection.prototype=r.prototype},n.shimReplaceTrack=function(e){!e.RTCRtpSender||"replaceTrack"in e.RTCRtpSender.prototype||(e.RTCRtpSender.prototype.replaceTrack=e.RTCRtpSender.prototype.setTrack)};var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(e("../utils")),s=e("./filtericeservers"),o=function(e){return e&&e.__esModule?e:{default:e}}(e("rtcpeerconnection-shim"))},{"../utils":15,"./filtericeservers":8,"./getdisplaymedia":9,"./getusermedia":10,"rtcpeerconnection-shim":16}],8:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.filterIceServers=function(e,t){var n=!1;return(e=JSON.parse(JSON.stringify(e))).filter((function(e){if(e&&(e.urls||e.url)){var t=e.urls||e.url;e.url&&!e.urls&&r.deprecated("RTCIceServer.url","RTCIceServer.urls");var i="string"==typeof t;return i&&(t=[t]),t=t.filter((function(e){if(0===e.indexOf("stun:"))return!1;var t=e.startsWith("turn")&&!e.startsWith("turn:[")&&e.includes("transport=udp");return t&&!n?(n=!0,!0):t&&!n})),delete e.url,e.urls=i?t[0]:t,!!t.length}}))};var r=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(e("../utils"))},{"../utils":15}],9:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.shimGetDisplayMedia=function(e){"getDisplayMedia"in e.navigator&&e.navigator.mediaDevices&&(e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||(e.navigator.mediaDevices.getDisplayMedia=e.navigator.getDisplayMedia.bind(e.navigator)))}},{}],10:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.shimGetUserMedia=function(e){var t=e&&e.navigator,n=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(e){return n(e).catch((function(e){return Promise.reject(function(e){return{name:{PermissionDeniedError:"NotAllowedError"}[e.name]||e.name,message:e.message,constraint:e.constraint,toString:function(){return this.name}}}(e))}))}}},{}],11:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.shimGetDisplayMedia=n.shimGetUserMedia=void 0;var r="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("./getusermedia");Object.defineProperty(n,"shimGetUserMedia",{enumerable:!0,get:function(){return i.shimGetUserMedia}});var a=e("./getdisplaymedia");Object.defineProperty(n,"shimGetDisplayMedia",{enumerable:!0,get:function(){return a.shimGetDisplayMedia}}),n.shimOnTrack=function(e){"object"===(void 0===e?"undefined":r(e))&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})},n.shimPeerConnection=function(e){var t=s.detectBrowser(e);if("object"===(void 0===e?"undefined":r(e))&&(e.RTCPeerConnection||e.mozRTCPeerConnection)){if(!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){var n=e.RTCPeerConnection.prototype[t],r=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},t,(function(){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}));e.RTCPeerConnection.prototype[t]=r[t]})),t.version<68){var n=e.RTCPeerConnection.prototype.addIceCandidate;e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?arguments[0]&&""===arguments[0].candidate?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())}}var i={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},a=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){var e=Array.prototype.slice.call(arguments),n=e[0],r=e[1],s=e[2];return a.apply(this,[n||null]).then((function(e){if(t.version<53&&!r)try{e.forEach((function(e){e.type=i[e.type]||e.type}))}catch(t){if("TypeError"!==t.name)throw t;e.forEach((function(t,n){e.set(n,Object.assign({},t,{type:i[t.type]||t.type}))}))}return e})).then(r,s)}}},n.shimSenderGetStats=function(e){if("object"===(void 0===e?"undefined":r(e))&&e.RTCPeerConnection&&e.RTCRtpSender&&(!e.RTCRtpSender||!("getStats"in e.RTCRtpSender.prototype))){var t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){var e=this,n=t.apply(this,[]);return n.forEach((function(t){return t._pc=e})),n});var n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){var e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}},n.shimReceiverGetStats=function(e){if("object"===(void 0===e?"undefined":r(e))&&e.RTCPeerConnection&&e.RTCRtpSender&&(!e.RTCRtpSender||!("getStats"in e.RTCRtpReceiver.prototype))){var t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){var e=this,n=t.apply(this,[]);return n.forEach((function(t){return t._pc=e})),n}),s.wrapPeerConnectionEvent(e,"track",(function(e){return e.receiver._pc=e.srcElement,e})),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}},n.shimRemoveStream=function(e){!e.RTCPeerConnection||"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;s.deprecated("removeStream","removeTrack"),this.getSenders().forEach((function(n){n.track&&e.getTracks().includes(n.track)&&t.removeTrack(n)}))})},n.shimRTCDataChannel=function(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)},n.shimAddTransceiver=function(e){if("object"===(void 0===e?"undefined":r(e))&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype.addTransceiver;t&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];var e=arguments[1],n=e&&"sendEncodings"in e;n&&e.sendEncodings.forEach((function(e){if("rid"in e&&!/^[a-z0-9]{0,16}$/i.test(e.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in e&&!(parseFloat(e.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in e&&!(parseFloat(e.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")}));var r=t.apply(this,arguments);if(n){var i=r.sender,a=i.getParameters();"encodings"in a&&(1!==a.encodings.length||0!==Object.keys(a.encodings[0]).length)||(a.encodings=e.sendEncodings,i.sendEncodings=e.sendEncodings,this.setParametersPromises.push(i.setParameters(a).then((function(){delete i.sendEncodings})).catch((function(){delete i.sendEncodings}))))}return r})}},n.shimGetParameters=function(e){if("object"===(void 0===e?"undefined":r(e))&&e.RTCRtpSender){var t=e.RTCRtpSender.prototype.getParameters;t&&(e.RTCRtpSender.prototype.getParameters=function(){var e=t.apply(this,arguments);return"encodings"in e||(e.encodings=[].concat(this.sendEncodings||[{}])),e})}},n.shimCreateOffer=function(e){if("object"===(void 0===e?"undefined":r(e))&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){var e=this,n=arguments;return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((function(){return t.apply(e,n)})).finally((function(){e.setParametersPromises=[]})):t.apply(this,arguments)}}},n.shimCreateAnswer=function(e){if("object"===(void 0===e?"undefined":r(e))&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){var e=this,n=arguments;return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((function(){return t.apply(e,n)})).finally((function(){e.setParametersPromises=[]})):t.apply(this,arguments)}}};var s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(e("../utils"))},{"../utils":15,"./getdisplaymedia":12,"./getusermedia":13}],12:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.shimGetDisplayMedia=function(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(n){if(!n||!n.video){var r=new DOMException("getDisplayMedia without video constraints is undefined");return r.name="NotFoundError",r.code=8,Promise.reject(r)}return!0===n.video?n.video={mediaSource:t}:n.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(n)})}},{}],13:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r="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.shimGetUserMedia=function(e){var t=i.detectBrowser(e),n=e&&e.navigator,a=e&&e.MediaStreamTrack;if(n.getUserMedia=function(e,t,r){i.deprecated("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(e).then(t,r)},!(t.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){var s=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])},o=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(e){return"object"===(void 0===e?"undefined":r(e))&&"object"===r(e.audio)&&(e=JSON.parse(JSON.stringify(e)),s(e.audio,"autoGainControl","mozAutoGainControl"),s(e.audio,"noiseSuppression","mozNoiseSuppression")),o(e)},a&&a.prototype.getSettings){var u=a.prototype.getSettings;a.prototype.getSettings=function(){var e=u.apply(this,arguments);return s(e,"mozAutoGainControl","autoGainControl"),s(e,"mozNoiseSuppression","noiseSuppression"),e}}if(a&&a.prototype.applyConstraints){var l=a.prototype.applyConstraints;a.prototype.applyConstraints=function(e){return"audio"===this.kind&&"object"===(void 0===e?"undefined":r(e))&&(e=JSON.parse(JSON.stringify(e)),s(e,"autoGainControl","mozAutoGainControl"),s(e,"noiseSuppression","mozNoiseSuppression")),l.apply(this,[e])}}}};var i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(e("../utils"))},{"../utils":15}],14:[function(e,t,n){"use strict";function r(e){return e&&void 0!==e.video?Object.assign({},e,{video:a.compactObject(e.video)}):e}Object.defineProperty(n,"__esModule",{value:!0});var 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};n.shimLocalStreamsAPI=function(e){if("object"===(void 0===e?"undefined":i(e))&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in e.RTCPeerConnection.prototype)){var t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){var n=this;this._localStreams||(this._localStreams=[]),this._localStreams.includes(e)||this._localStreams.push(e),e.getAudioTracks().forEach((function(r){return t.call(n,r,e)})),e.getVideoTracks().forEach((function(r){return t.call(n,r,e)}))},e.RTCPeerConnection.prototype.addTrack=function(e){for(var n=this,r=arguments.length,i=Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];return i&&i.forEach((function(e){n._localStreams?n._localStreams.includes(e)||n._localStreams.push(e):n._localStreams=[e]})),t.apply(this,arguments)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;this._localStreams||(this._localStreams=[]);var n=this._localStreams.indexOf(e);if(-1!==n){this._localStreams.splice(n,1);var r=e.getTracks();this.getSenders().forEach((function(e){r.includes(e.track)&&t.removeTrack(e)}))}})}},n.shimRemoteStreamsAPI=function(e){if("object"===(void 0===e?"undefined":i(e))&&e.RTCPeerConnection&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get:function(){return this._onaddstream},set:function(e){var t=this;this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=e),this.addEventListener("track",this._onaddstreampoly=function(e){e.streams.forEach((function(e){if(t._remoteStreams||(t._remoteStreams=[]),!t._remoteStreams.includes(e)){t._remoteStreams.push(e);var n=new Event("addstream");n.stream=e,t.dispatchEvent(n)}}))})}});var t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){var e=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(t){t.streams.forEach((function(t){if(e._remoteStreams||(e._remoteStreams=[]),!(e._remoteStreams.indexOf(t)>=0)){e._remoteStreams.push(t);var n=new Event("addstream");n.stream=t,e.dispatchEvent(n)}}))}),t.apply(e,arguments)}}},n.shimCallbacksAPI=function(e){if("object"===(void 0===e?"undefined":i(e))&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype,n=t.createOffer,r=t.createAnswer,a=t.setLocalDescription,s=t.setRemoteDescription,o=t.addIceCandidate;t.createOffer=function(e,t){var r=arguments.length>=2?arguments[2]:arguments[0],i=n.apply(this,[r]);return t?(i.then(e,t),Promise.resolve()):i},t.createAnswer=function(e,t){var n=arguments.length>=2?arguments[2]:arguments[0],i=r.apply(this,[n]);return t?(i.then(e,t),Promise.resolve()):i};var u=function(e,t,n){var r=a.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r};t.setLocalDescription=u,u=function(e,t,n){var r=s.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.setRemoteDescription=u,u=function(e,t,n){var r=o.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.addIceCandidate=u}},n.shimGetUserMedia=function(e){var t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){var n=t.mediaDevices,i=n.getUserMedia.bind(n);t.mediaDevices.getUserMedia=function(e){return i(r(e))}}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,n,r){t.mediaDevices.getUserMedia(e).then(n,r)}.bind(t))},n.shimConstraints=r,n.shimRTCIceServerUrls=function(e){if(e.RTCPeerConnection){var t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,n){if(e&&e.iceServers){for(var r=[],i=0;i<e.iceServers.length;i++){var s=e.iceServers[i];!s.hasOwnProperty("urls")&&s.hasOwnProperty("url")?(a.deprecated("RTCIceServer.url","RTCIceServer.urls"),(s=JSON.parse(JSON.stringify(s))).urls=s.url,delete s.url,r.push(s)):r.push(e.iceServers[i])}e.iceServers=r}return new t(e,n)},e.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in t&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:function(){return t.generateCertificate}})}},n.shimTrackEventTransceiver=function(e){"object"===(void 0===e?"undefined":i(e))&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})},n.shimCreateOfferLegacy=function(e){var t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){if(e){void 0!==e.offerToReceiveAudio&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);var n=this.getTransceivers().find((function(e){return"audio"===e.receiver.track.kind}));!1===e.offerToReceiveAudio&&n?"sendrecv"===n.direction?n.setDirection?n.setDirection("sendonly"):n.direction="sendonly":"recvonly"===n.direction&&(n.setDirection?n.setDirection("inactive"):n.direction="inactive"):!0!==e.offerToReceiveAudio||n||this.addTransceiver("audio"),void 0!==e.offerToReceiveVideo&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);var r=this.getTransceivers().find((function(e){return"video"===e.receiver.track.kind}));!1===e.offerToReceiveVideo&&r?"sendrecv"===r.direction?r.setDirection?r.setDirection("sendonly"):r.direction="sendonly":"recvonly"===r.direction&&(r.setDirection?r.setDirection("inactive"):r.direction="inactive"):!0!==e.offerToReceiveVideo||r||this.addTransceiver("video")}return t.apply(this,arguments)}},n.shimAudioContext=function(e){"object"!==(void 0===e?"undefined":i(e))||e.AudioContext||(e.AudioContext=e.webkitAudioContext)};var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(e("../utils"))},{"../utils":15}],15:[function(e,t,n){"use strict";function r(e,t,n){var r=e.match(t);return r&&r.length>=n&&parseInt(r[n],10)}function i(e){return"[object Object]"===Object.prototype.toString.call(e)}function a(e,t,n){t&&!n.has(t.id)&&(n.set(t.id,t),Object.keys(t).forEach((function(r){r.endsWith("Id")?a(e,e.get(t[r]),n):r.endsWith("Ids")&&t[r].forEach((function(t){a(e,e.get(t),n)}))})))}Object.defineProperty(n,"__esModule",{value:!0});var 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};n.extractVersion=r,n.wrapPeerConnectionEvent=function(e,t,n){if(e.RTCPeerConnection){var r=e.RTCPeerConnection.prototype,i=r.addEventListener;r.addEventListener=function(e,r){if(e!==t)return i.apply(this,arguments);var a=function(e){var t=n(e);t&&(r.handleEvent?r.handleEvent(t):r(t))};return this._eventMap=this._eventMap||{},this._eventMap[t]||(this._eventMap[t]=new Map),this._eventMap[t].set(r,a),i.apply(this,[e,a])};var a=r.removeEventListener;r.removeEventListener=function(e,n){if(e!==t||!this._eventMap||!this._eventMap[t])return a.apply(this,arguments);if(!this._eventMap[t].has(n))return a.apply(this,arguments);var r=this._eventMap[t].get(n);return this._eventMap[t].delete(n),0===this._eventMap[t].size&&delete this._eventMap[t],0===Object.keys(this._eventMap).length&&delete this._eventMap,a.apply(this,[e,r])},Object.defineProperty(r,"on"+t,{get:function(){return this["_on"+t]},set:function(e){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),e&&this.addEventListener(t,this["_on"+t]=e)},enumerable:!0,configurable:!0})}},n.disableLog=function(e){return"boolean"!=typeof e?new Error("Argument type: "+(void 0===e?"undefined":s(e))+". Please use a boolean."):(o=e,e?"adapter.js logging disabled":"adapter.js logging enabled")},n.disableWarnings=function(e){return"boolean"!=typeof e?new Error("Argument type: "+(void 0===e?"undefined":s(e))+". Please use a boolean."):(u=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))},n.log=function(){if("object"===("undefined"==typeof window?"undefined":s(window))){if(o)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}},n.deprecated=function(e,t){u&&console.warn(e+" is deprecated, please use "+t+" instead.")},n.detectBrowser=function(e){var t={browser:null,version:null};if(void 0===e||!e.navigator)return t.browser="Not a browser.",t;var n=e.navigator;if(n.mozGetUserMedia)t.browser="firefox",t.version=r(n.userAgent,/Firefox\/(\d+)\./,1);else if(n.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection&&!e.RTCIceGatherer)t.browser="chrome",t.version=r(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(n.mediaDevices&&n.userAgent.match(/Edge\/(\d+).(\d+)$/))t.browser="edge",t.version=r(n.userAgent,/Edge\/(\d+).(\d+)$/,2);else{if(!e.RTCPeerConnection||!n.userAgent.match(/AppleWebKit\/(\d+)\./))return t.browser="Not a supported browser.",t;t.browser="safari",t.version=r(n.userAgent,/AppleWebKit\/(\d+)\./,1),t.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype}return t},n.compactObject=function e(t){return i(t)?Object.keys(t).reduce((function(n,r){var a=i(t[r]),s=a?e(t[r]):t[r],o=a&&!Object.keys(s).length;return void 0===s||o?n:Object.assign(n,function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},r,s))}),{}):t},n.walkStats=a,n.filterStats=function(e,t,n){var r=n?"outbound-rtp":"inbound-rtp",i=new Map;if(null===t)return i;var s=[];return e.forEach((function(e){"track"===e.type&&e.trackIdentifier===t.id&&s.push(e)})),s.forEach((function(t){e.forEach((function(n){n.type===r&&n.trackId===t.id&&a(e,n,i)}))})),i};var o=!0,u=!0},{}],16:[function(e,t,n){"use strict";function r(e,t,n,r,i){var a=u.writeRtpDescription(e.kind,t);if(a+=u.writeIceParameters(e.iceGatherer.getLocalParameters()),a+=u.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===n?"actpass":i||"active"),a+="a=mid:"+e.mid+"\r\n",e.rtpSender&&e.rtpReceiver?a+="a=sendrecv\r\n":e.rtpSender?a+="a=sendonly\r\n":e.rtpReceiver?a+="a=recvonly\r\n":a+="a=inactive\r\n",e.rtpSender){var s=e.rtpSender._initialTrackId||e.rtpSender.track.id;e.rtpSender._initialTrackId=s;var o="msid:"+(r?r.id:"-")+" "+s+"\r\n";a+="a="+o,a+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+o,e.sendEncodingParameters[0].rtx&&(a+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+o,a+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return a+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+u.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(a+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+u.localCName+"\r\n"),a}function i(e,t){var n={codecs:[],headerExtensions:[],fecMechanisms:[]},r=function(e,t){e=parseInt(e,10);for(var n=0;n<t.length;n++)if(t[n].payloadType===e||t[n].preferredPayloadType===e)return t[n]},i=function(e,t,n,i){var a=r(e.parameters.apt,n),s=r(t.parameters.apt,i);return a&&s&&a.name.toLowerCase()===s.name.toLowerCase()};return e.codecs.forEach((function(r){for(var a=0;a<t.codecs.length;a++){var s=t.codecs[a];if(r.name.toLowerCase()===s.name.toLowerCase()&&r.clockRate===s.clockRate){if("rtx"===r.name.toLowerCase()&&r.parameters&&s.parameters.apt&&!i(r,s,e.codecs,t.codecs))continue;(s=JSON.parse(JSON.stringify(s))).numChannels=Math.min(r.numChannels,s.numChannels),n.codecs.push(s),s.rtcpFeedback=s.rtcpFeedback.filter((function(e){for(var t=0;t<r.rtcpFeedback.length;t++)if(r.rtcpFeedback[t].type===e.type&&r.rtcpFeedback[t].parameter===e.parameter)return!0;return!1}));break}}})),e.headerExtensions.forEach((function(e){for(var r=0;r<t.headerExtensions.length;r++){var i=t.headerExtensions[r];if(e.uri===i.uri){n.headerExtensions.push(i);break}}})),n}function a(e,t,n){return-1!=={offer:{setLocalDescription:["stable","have-local-offer"],setRemoteDescription:["stable","have-remote-offer"]},answer:{setLocalDescription:["have-remote-offer","have-local-pranswer"],setRemoteDescription:["have-local-offer","have-remote-pranswer"]}}[t][e].indexOf(n)}function s(e,t){var n=e.getRemoteCandidates().find((function(e){return t.foundation===e.foundation&&t.ip===e.ip&&t.port===e.port&&t.priority===e.priority&&t.protocol===e.protocol&&t.type===e.type}));return n||e.addRemoteCandidate(t),!n}function o(e,t){var n=new Error(t);return n.name=e,n.code={NotSupportedError:9,InvalidStateError:11,InvalidAccessError:15,TypeError:void 0,OperationError:void 0}[e],n}var u=e("sdp");t.exports=function(e,t){function n(t,n){n.addTrack(t),n.dispatchEvent(new e.MediaStreamTrackEvent("addtrack",{track:t}))}function l(t,n){n.removeTrack(t),n.dispatchEvent(new e.MediaStreamTrackEvent("removetrack",{track:t}))}function c(t,n,r,i){var a=new Event("track");a.track=n,a.receiver=r,a.transceiver={receiver:r},a.streams=i,e.setTimeout((function(){t._dispatchEvent("track",a)}))}var d=function(n){var r=this,i=document.createDocumentFragment();if(["addEventListener","removeEventListener","dispatchEvent"].forEach((function(e){r[e]=i[e].bind(i)})),this.canTrickleIceCandidates=null,this.needNegotiation=!1,this.localStreams=[],this.remoteStreams=[],this._localDescription=null,this._remoteDescription=null,this.signalingState="stable",this.iceConnectionState="new",this.connectionState="new",this.iceGatheringState="new",n=JSON.parse(JSON.stringify(n||{})),this.usingBundle="max-bundle"===n.bundlePolicy,"negotiate"===n.rtcpMuxPolicy)throw o("NotSupportedError","rtcpMuxPolicy 'negotiate' is not supported");switch(n.rtcpMuxPolicy||(n.rtcpMuxPolicy="require"),n.iceTransportPolicy){case"all":case"relay":break;default:n.iceTransportPolicy="all"}switch(n.bundlePolicy){case"balanced":case"max-compat":case"max-bundle":break;default:n.bundlePolicy="balanced"}if(n.iceServers=function(e,t){var n=!1;return(e=JSON.parse(JSON.stringify(e))).filter((function(e){if(e&&(e.urls||e.url)){var r=e.urls||e.url;e.url&&!e.urls&&console.warn("RTCIceServer.url is deprecated! Use urls instead.");var i="string"==typeof r;return i&&(r=[r]),r=r.filter((function(e){return 0!==e.indexOf("turn:")||-1===e.indexOf("transport=udp")||-1!==e.indexOf("turn:[")||n?0===e.indexOf("stun:")&&t>=14393&&-1===e.indexOf("?transport=udp"):(n=!0,!0)})),delete e.url,e.urls=i?r[0]:r,!!r.length}}))}(n.iceServers||[],t),this._iceGatherers=[],n.iceCandidatePoolSize)for(var a=n.iceCandidatePoolSize;a>0;a--)this._iceGatherers.push(new e.RTCIceGatherer({iceServers:n.iceServers,gatherPolicy:n.iceTransportPolicy}));else n.iceCandidatePoolSize=0;this._config=n,this.transceivers=[],this._sdpSessionId=u.generateSessionId(),this._sdpSessionVersion=0,this._dtlsRole=void 0,this._isClosed=!1};Object.defineProperty(d.prototype,"localDescription",{configurable:!0,get:function(){return this._localDescription}}),Object.defineProperty(d.prototype,"remoteDescription",{configurable:!0,get:function(){return this._remoteDescription}}),d.prototype.onicecandidate=null,d.prototype.onaddstream=null,d.prototype.ontrack=null,d.prototype.onremovestream=null,d.prototype.onsignalingstatechange=null,d.prototype.oniceconnectionstatechange=null,d.prototype.onconnectionstatechange=null,d.prototype.onicegatheringstatechange=null,d.prototype.onnegotiationneeded=null,d.prototype.ondatachannel=null,d.prototype._dispatchEvent=function(e,t){this._isClosed||(this.dispatchEvent(t),"function"==typeof this["on"+e]&&this["on"+e](t))},d.prototype._emitGatheringStateChange=function(){var e=new Event("icegatheringstatechange");this._dispatchEvent("icegatheringstatechange",e)},d.prototype.getConfiguration=function(){return this._config},d.prototype.getLocalStreams=function(){return this.localStreams},d.prototype.getRemoteStreams=function(){return this.remoteStreams},d.prototype._createTransceiver=function(e,t){var n=this.transceivers.length>0,r={track:null,iceGatherer:null,iceTransport:null,dtlsTransport:null,localCapabilities:null,remoteCapabilities:null,rtpSender:null,rtpReceiver:null,kind:e,mid:null,sendEncodingParameters:null,recvEncodingParameters:null,stream:null,associatedRemoteMediaStreams:[],wantReceive:!0};if(this.usingBundle&&n)r.iceTransport=this.transceivers[0].iceTransport,r.dtlsTransport=this.transceivers[0].dtlsTransport;else{var i=this._createIceAndDtlsTransports();r.iceTransport=i.iceTransport,r.dtlsTransport=i.dtlsTransport}return t||this.transceivers.push(r),r},d.prototype.addTrack=function(t,n){if(this._isClosed)throw o("InvalidStateError","Attempted to call addTrack on a closed peerconnection.");if(this.transceivers.find((function(e){return e.track===t})))throw o("InvalidAccessError","Track already exists.");for(var r,i=0;i<this.transceivers.length;i++)this.transceivers[i].track||this.transceivers[i].kind!==t.kind||(r=this.transceivers[i]);return r||(r=this._createTransceiver(t.kind)),this._maybeFireNegotiationNeeded(),-1===this.localStreams.indexOf(n)&&this.localStreams.push(n),r.track=t,r.stream=n,r.rtpSender=new e.RTCRtpSender(t,r.dtlsTransport),r.rtpSender},d.prototype.addStream=function(e){var n=this;if(t>=15025)e.getTracks().forEach((function(t){n.addTrack(t,e)}));else{var r=e.clone();e.getTracks().forEach((function(e,t){var n=r.getTracks()[t];e.addEventListener("enabled",(function(e){n.enabled=e.enabled}))})),r.getTracks().forEach((function(e){n.addTrack(e,r)}))}},d.prototype.removeTrack=function(t){if(this._isClosed)throw o("InvalidStateError","Attempted to call removeTrack on a closed peerconnection.");if(!(t instanceof e.RTCRtpSender))throw new TypeError("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.");var n=this.transceivers.find((function(e){return e.rtpSender===t}));if(!n)throw o("InvalidAccessError","Sender was not created by this connection.");var r=n.stream;n.rtpSender.stop(),n.rtpSender=null,n.track=null,n.stream=null,-1===this.transceivers.map((function(e){return e.stream})).indexOf(r)&&this.localStreams.indexOf(r)>-1&&this.localStreams.splice(this.localStreams.indexOf(r),1),this._maybeFireNegotiationNeeded()},d.prototype.removeStream=function(e){var t=this;e.getTracks().forEach((function(e){var n=t.getSenders().find((function(t){return t.track===e}));n&&t.removeTrack(n)}))},d.prototype.getSenders=function(){return this.transceivers.filter((function(e){return!!e.rtpSender})).map((function(e){return e.rtpSender}))},d.prototype.getReceivers=function(){return this.transceivers.filter((function(e){return!!e.rtpReceiver})).map((function(e){return e.rtpReceiver}))},d.prototype._createIceGatherer=function(t,n){var r=this;if(n&&t>0)return this.transceivers[0].iceGatherer;if(this._iceGatherers.length)return this._iceGatherers.shift();var i=new e.RTCIceGatherer({iceServers:this._config.iceServers,gatherPolicy:this._config.iceTransportPolicy});return Object.defineProperty(i,"state",{value:"new",writable:!0}),this.transceivers[t].bufferedCandidateEvents=[],this.transceivers[t].bufferCandidates=function(e){var n=!e.candidate||0===Object.keys(e.candidate).length;i.state=n?"completed":"gathering",null!==r.transceivers[t].bufferedCandidateEvents&&r.transceivers[t].bufferedCandidateEvents.push(e)},i.addEventListener("localcandidate",this.transceivers[t].bufferCandidates),i},d.prototype._gather=function(t,n){var r=this,i=this.transceivers[n].iceGatherer;if(!i.onlocalcandidate){var a=this.transceivers[n].bufferedCandidateEvents;this.transceivers[n].bufferedCandidateEvents=null,i.removeEventListener("localcandidate",this.transceivers[n].bufferCandidates),i.onlocalcandidate=function(e){if(!(r.usingBundle&&n>0)){var a=new Event("icecandidate");a.candidate={sdpMid:t,sdpMLineIndex:n};var s=e.candidate,o=!s||0===Object.keys(s).length;if(o)"new"!==i.state&&"gathering"!==i.state||(i.state="completed");else{"new"===i.state&&(i.state="gathering"),s.component=1,s.ufrag=i.getLocalParameters().usernameFragment;var l=u.writeCandidate(s);a.candidate=Object.assign(a.candidate,u.parseCandidate(l)),a.candidate.candidate=l,a.candidate.toJSON=function(){return{candidate:a.candidate.candidate,sdpMid:a.candidate.sdpMid,sdpMLineIndex:a.candidate.sdpMLineIndex,usernameFragment:a.candidate.usernameFragment}}}var c=u.getMediaSections(r._localDescription.sdp);c[a.candidate.sdpMLineIndex]+=o?"a=end-of-candidates\r\n":"a="+a.candidate.candidate+"\r\n",r._localDescription.sdp=u.getDescription(r._localDescription.sdp)+c.join("");var d=r.transceivers.every((function(e){return e.iceGatherer&&"completed"===e.iceGatherer.state}));"gathering"!==r.iceGatheringState&&(r.iceGatheringState="gathering",r._emitGatheringStateChange()),o||r._dispatchEvent("icecandidate",a),d&&(r._dispatchEvent("icecandidate",new Event("icecandidate")),r.iceGatheringState="complete",r._emitGatheringStateChange())}},e.setTimeout((function(){a.forEach((function(e){i.onlocalcandidate(e)}))}),0)}},d.prototype._createIceAndDtlsTransports=function(){var t=this,n=new e.RTCIceTransport(null);n.onicestatechange=function(){t._updateIceConnectionState(),t._updateConnectionState()};var r=new e.RTCDtlsTransport(n);return r.ondtlsstatechange=function(){t._updateConnectionState()},r.onerror=function(){Object.defineProperty(r,"state",{value:"failed",writable:!0}),t._updateConnectionState()},{iceTransport:n,dtlsTransport:r}},d.prototype._disposeIceAndDtlsTransports=function(e){var t=this.transceivers[e].iceGatherer;t&&(delete t.onlocalcandidate,delete this.transceivers[e].iceGatherer);var n=this.transceivers[e].iceTransport;n&&(delete n.onicestatechange,delete this.transceivers[e].iceTransport);var r=this.transceivers[e].dtlsTransport;r&&(delete r.ondtlsstatechange,delete r.onerror,delete this.transceivers[e].dtlsTransport)},d.prototype._transceive=function(e,n,r){var a=i(e.localCapabilities,e.remoteCapabilities);n&&e.rtpSender&&(a.encodings=e.sendEncodingParameters,a.rtcp={cname:u.localCName,compound:e.rtcpParameters.compound},e.recvEncodingParameters.length&&(a.rtcp.ssrc=e.recvEncodingParameters[0].ssrc),e.rtpSender.send(a)),r&&e.rtpReceiver&&a.codecs.length>0&&("video"===e.kind&&e.recvEncodingParameters&&t<15019&&e.recvEncodingParameters.forEach((function(e){delete e.rtx})),e.recvEncodingParameters.length?a.encodings=e.recvEncodingParameters:a.encodings=[{}],a.rtcp={compound:e.rtcpParameters.compound},e.rtcpParameters.cname&&(a.rtcp.cname=e.rtcpParameters.cname),e.sendEncodingParameters.length&&(a.rtcp.ssrc=e.sendEncodingParameters[0].ssrc),e.rtpReceiver.receive(a))},d.prototype.setLocalDescription=function(e){var t,n,r=this;if(-1===["offer","answer"].indexOf(e.type))return Promise.reject(o("TypeError",'Unsupported type "'+e.type+'"'));if(!a("setLocalDescription",e.type,r.signalingState)||r._isClosed)return Promise.reject(o("InvalidStateError","Can not set local "+e.type+" in state "+r.signalingState));if("offer"===e.type)t=u.splitSections(e.sdp),n=t.shift(),t.forEach((function(e,t){var n=u.parseRtpParameters(e);r.transceivers[t].localCapabilities=n})),r.transceivers.forEach((function(e,t){r._gather(e.mid,t)}));else if("answer"===e.type){t=u.splitSections(r._remoteDescription.sdp),n=t.shift();var s=u.matchPrefix(n,"a=ice-lite").length>0;t.forEach((function(e,t){var a=r.transceivers[t],o=a.iceGatherer,l=a.iceTransport,c=a.dtlsTransport,d=a.localCapabilities,h=a.remoteCapabilities;if(!(u.isRejected(e)&&0===u.matchPrefix(e,"a=bundle-only").length||a.rejected)){var f=u.getIceParameters(e,n),p=u.getDtlsParameters(e,n);s&&(p.role="server"),r.usingBundle&&0!==t||(r._gather(a.mid,t),"new"===l.state&&l.start(o,f,s?"controlling":"controlled"),"new"===c.state&&c.start(p));var v=i(d,h);r._transceive(a,v.codecs.length>0,!1)}}))}return r._localDescription={type:e.type,sdp:e.sdp},"offer"===e.type?r._updateSignalingState("have-local-offer"):r._updateSignalingState("stable"),Promise.resolve()},d.prototype.setRemoteDescription=function(r){var d=this;if(-1===["offer","answer"].indexOf(r.type))return Promise.reject(o("TypeError",'Unsupported type "'+r.type+'"'));if(!a("setRemoteDescription",r.type,d.signalingState)||d._isClosed)return Promise.reject(o("InvalidStateError","Can not set remote "+r.type+" in state "+d.signalingState));var h={};d.remoteStreams.forEach((function(e){h[e.id]=e}));var f=[],p=u.splitSections(r.sdp),v=p.shift(),m=u.matchPrefix(v,"a=ice-lite").length>0,g=u.matchPrefix(v,"a=group:BUNDLE ").length>0;d.usingBundle=g;var y=u.matchPrefix(v,"a=ice-options:")[0];return d.canTrickleIceCandidates=!!y&&y.substr(14).split(" ").indexOf("trickle")>=0,p.forEach((function(a,o){var c=u.splitLines(a),p=u.getKind(a),y=u.isRejected(a)&&0===u.matchPrefix(a,"a=bundle-only").length,_=c[0].substr(2).split(" ")[2],b=u.getDirection(a,v),T=u.parseMsid(a),S=u.getMid(a)||u.generateIdentifier();if(y||"application"===p&&("DTLS/SCTP"===_||"UDP/DTLS/SCTP"===_))d.transceivers[o]={mid:S,kind:p,protocol:_,rejected:!0};else{!y&&d.transceivers[o]&&d.transceivers[o].rejected&&(d.transceivers[o]=d._createTransceiver(p,!0));var E,k,w,C,A,L,R,x,I,O,D,P=u.parseRtpParameters(a);y||(O=u.getIceParameters(a,v),(D=u.getDtlsParameters(a,v)).role="client"),R=u.parseRtpEncodingParameters(a);var M=u.parseRtcpParameters(a),j=u.matchPrefix(a,"a=end-of-candidates",v).length>0,U=u.matchPrefix(a,"a=candidate:").map((function(e){return u.parseCandidate(e)})).filter((function(e){return 1===e.component}));if(("offer"===r.type||"answer"===r.type)&&!y&&g&&o>0&&d.transceivers[o]&&(d._disposeIceAndDtlsTransports(o),d.transceivers[o].iceGatherer=d.transceivers[0].iceGatherer,d.transceivers[o].iceTransport=d.transceivers[0].iceTransport,d.transceivers[o].dtlsTransport=d.transceivers[0].dtlsTransport,d.transceivers[o].rtpSender&&d.transceivers[o].rtpSender.setTransport(d.transceivers[0].dtlsTransport),d.transceivers[o].rtpReceiver&&d.transceivers[o].rtpReceiver.setTransport(d.transceivers[0].dtlsTransport)),"offer"!==r.type||y){if("answer"===r.type&&!y)k=(E=d.transceivers[o]).iceGatherer,w=E.iceTransport,C=E.dtlsTransport,A=E.rtpReceiver,L=E.sendEncodingParameters,x=E.localCapabilities,d.transceivers[o].recvEncodingParameters=R,d.transceivers[o].remoteCapabilities=P,d.transceivers[o].rtcpParameters=M,U.length&&"new"===w.state&&(!m&&!j||g&&0!==o?U.forEach((function(e){s(E.iceTransport,e)})):w.setRemoteCandidates(U)),g&&0!==o||("new"===w.state&&w.start(k,O,"controlling"),"new"===C.state&&C.start(D)),!i(E.localCapabilities,E.remoteCapabilities).codecs.filter((function(e){return"rtx"===e.name.toLowerCase()})).length&&E.sendEncodingParameters[0].rtx&&delete E.sendEncodingParameters[0].rtx,d._transceive(E,"sendrecv"===b||"recvonly"===b,"sendrecv"===b||"sendonly"===b),!A||"sendrecv"!==b&&"sendonly"!==b?delete E.rtpReceiver:(I=A.track,T?(h[T.stream]||(h[T.stream]=new e.MediaStream),n(I,h[T.stream]),f.push([I,A,h[T.stream]])):(h.default||(h.default=new e.MediaStream),n(I,h.default),f.push([I,A,h.default])))}else{(E=d.transceivers[o]||d._createTransceiver(p)).mid=S,E.iceGatherer||(E.iceGatherer=d._createIceGatherer(o,g)),U.length&&"new"===E.iceTransport.state&&(!j||g&&0!==o?U.forEach((function(e){s(E.iceTransport,e)})):E.iceTransport.setRemoteCandidates(U)),x=e.RTCRtpReceiver.getCapabilities(p),t<15019&&(x.codecs=x.codecs.filter((function(e){return"rtx"!==e.name}))),L=E.sendEncodingParameters||[{ssrc:1001*(2*o+2)}];var B,F=!1;if("sendrecv"===b||"sendonly"===b){if(F=!E.rtpReceiver,A=E.rtpReceiver||new e.RTCRtpReceiver(E.dtlsTransport,p),F)I=A.track,T&&"-"===T.stream||(T?(h[T.stream]||(h[T.stream]=new e.MediaStream,Object.defineProperty(h[T.stream],"id",{get:function(){return T.stream}})),Object.defineProperty(I,"id",{get:function(){return T.track}}),B=h[T.stream]):(h.default||(h.default=new e.MediaStream),B=h.default)),B&&(n(I,B),E.associatedRemoteMediaStreams.push(B)),f.push([I,A,B])}else E.rtpReceiver&&E.rtpReceiver.track&&(E.associatedRemoteMediaStreams.forEach((function(e){var t=e.getTracks().find((function(e){return e.id===E.rtpReceiver.track.id}));t&&l(t,e)})),E.associatedRemoteMediaStreams=[]);E.localCapabilities=x,E.remoteCapabilities=P,E.rtpReceiver=A,E.rtcpParameters=M,E.sendEncodingParameters=L,E.recvEncodingParameters=R,d._transceive(d.transceivers[o],!1,F)}}})),void 0===d._dtlsRole&&(d._dtlsRole="offer"===r.type?"active":"passive"),d._remoteDescription={type:r.type,sdp:r.sdp},"offer"===r.type?d._updateSignalingState("have-remote-offer"):d._updateSignalingState("stable"),Object.keys(h).forEach((function(t){var n=h[t];if(n.getTracks().length){if(-1===d.remoteStreams.indexOf(n)){d.remoteStreams.push(n);var r=new Event("addstream");r.stream=n,e.setTimeout((function(){d._dispatchEvent("addstream",r)}))}f.forEach((function(e){var t=e[0],r=e[1];n.id===e[2].id&&c(d,t,r,[n])}))}})),f.forEach((function(e){e[2]||c(d,e[0],e[1],[])})),e.setTimeout((function(){d&&d.transceivers&&d.transceivers.forEach((function(e){e.iceTransport&&"new"===e.iceTransport.state&&e.iceTransport.getRemoteCandidates().length>0&&(console.warn("Timeout for addRemoteCandidate. Consider sending an end-of-candidates notification"),e.iceTransport.addRemoteCandidate({}))}))}),4e3),Promise.resolve()},d.prototype.close=function(){this.transceivers.forEach((function(e){e.iceTransport&&e.iceTransport.stop(),e.dtlsTransport&&e.dtlsTransport.stop(),e.rtpSender&&e.rtpSender.stop(),e.rtpReceiver&&e.rtpReceiver.stop()})),this._isClosed=!0,this._updateSignalingState("closed")},d.prototype._updateSignalingState=function(e){this.signalingState=e;var t=new Event("signalingstatechange");this._dispatchEvent("signalingstatechange",t)},d.prototype._maybeFireNegotiationNeeded=function(){var t=this;"stable"===this.signalingState&&!0!==this.needNegotiation&&(this.needNegotiation=!0,e.setTimeout((function(){if(t.needNegotiation){t.needNegotiation=!1;var e=new Event("negotiationneeded");t._dispatchEvent("negotiationneeded",e)}}),0))},d.prototype._updateIceConnectionState=function(){var e,t={new:0,closed:0,checking:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach((function(e){e.iceTransport&&!e.rejected&&t[e.iceTransport.state]++})),e="new",t.failed>0?e="failed":t.checking>0?e="checking":t.disconnected>0?e="disconnected":t.new>0?e="new":t.connected>0?e="connected":t.completed>0&&(e="completed"),e!==this.iceConnectionState){this.iceConnectionState=e;var n=new Event("iceconnectionstatechange");this._dispatchEvent("iceconnectionstatechange",n)}},d.prototype._updateConnectionState=function(){var e,t={new:0,closed:0,connecting:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach((function(e){e.iceTransport&&e.dtlsTransport&&!e.rejected&&(t[e.iceTransport.state]++,t[e.dtlsTransport.state]++)})),t.connected+=t.completed,e="new",t.failed>0?e="failed":t.connecting>0?e="connecting":t.disconnected>0?e="disconnected":t.new>0?e="new":t.connected>0&&(e="connected"),e!==this.connectionState){this.connectionState=e;var n=new Event("connectionstatechange");this._dispatchEvent("connectionstatechange",n)}},d.prototype.createOffer=function(){var n=this;if(n._isClosed)return Promise.reject(o("InvalidStateError","Can not call createOffer after close"));var i=n.transceivers.filter((function(e){return"audio"===e.kind})).length,a=n.transceivers.filter((function(e){return"video"===e.kind})).length,s=arguments[0];if(s){if(s.mandatory||s.optional)throw new TypeError("Legacy mandatory/optional constraints not supported.");void 0!==s.offerToReceiveAudio&&(i=!0===s.offerToReceiveAudio?1:!1===s.offerToReceiveAudio?0:s.offerToReceiveAudio),void 0!==s.offerToReceiveVideo&&(a=!0===s.offerToReceiveVideo?1:!1===s.offerToReceiveVideo?0:s.offerToReceiveVideo)}for(n.transceivers.forEach((function(e){"audio"===e.kind?--i<0&&(e.wantReceive=!1):"video"===e.kind&&--a<0&&(e.wantReceive=!1)}));i>0||a>0;)i>0&&(n._createTransceiver("audio"),i--),a>0&&(n._createTransceiver("video"),a--);var l=u.writeSessionBoilerplate(n._sdpSessionId,n._sdpSessionVersion++);n.transceivers.forEach((function(r,i){var a=r.track,s=r.kind,o=r.mid||u.generateIdentifier();r.mid=o,r.iceGatherer||(r.iceGatherer=n._createIceGatherer(i,n.usingBundle));var l=e.RTCRtpSender.getCapabilities(s);t<15019&&(l.codecs=l.codecs.filter((function(e){return"rtx"!==e.name}))),l.codecs.forEach((function(e){"H264"===e.name&&void 0===e.parameters["level-asymmetry-allowed"]&&(e.parameters["level-asymmetry-allowed"]="1"),r.remoteCapabilities&&r.remoteCapabilities.codecs&&r.remoteCapabilities.codecs.forEach((function(t){e.name.toLowerCase()===t.name.toLowerCase()&&e.clockRate===t.clockRate&&(e.preferredPayloadType=t.payloadType)}))})),l.headerExtensions.forEach((function(e){(r.remoteCapabilities&&r.remoteCapabilities.headerExtensions||[]).forEach((function(t){e.uri===t.uri&&(e.id=t.id)}))}));var c=r.sendEncodingParameters||[{ssrc:1001*(2*i+1)}];a&&t>=15019&&"video"===s&&!c[0].rtx&&(c[0].rtx={ssrc:c[0].ssrc+1}),r.wantReceive&&(r.rtpReceiver=new e.RTCRtpReceiver(r.dtlsTransport,s)),r.localCapabilities=l,r.sendEncodingParameters=c})),"max-compat"!==n._config.bundlePolicy&&(l+="a=group:BUNDLE "+n.transceivers.map((function(e){return e.mid})).join(" ")+"\r\n"),l+="a=ice-options:trickle\r\n",n.transceivers.forEach((function(e,t){l+=r(e,e.localCapabilities,"offer",e.stream,n._dtlsRole),l+="a=rtcp-rsize\r\n",!e.iceGatherer||"new"===n.iceGatheringState||0!==t&&n.usingBundle||(e.iceGatherer.getLocalCandidates().forEach((function(e){e.component=1,l+="a="+u.writeCandidate(e)+"\r\n"})),"completed"===e.iceGatherer.state&&(l+="a=end-of-candidates\r\n"))}));var c=new e.RTCSessionDescription({type:"offer",sdp:l});return Promise.resolve(c)},d.prototype.createAnswer=function(){var n=this;if(n._isClosed)return Promise.reject(o("InvalidStateError","Can not call createAnswer after close"));if("have-remote-offer"!==n.signalingState&&"have-local-pranswer"!==n.signalingState)return Promise.reject(o("InvalidStateError","Can not call createAnswer in signalingState "+n.signalingState));var a=u.writeSessionBoilerplate(n._sdpSessionId,n._sdpSessionVersion++);n.usingBundle&&(a+="a=group:BUNDLE "+n.transceivers.map((function(e){return e.mid})).join(" ")+"\r\n"),a+="a=ice-options:trickle\r\n";var s=u.getMediaSections(n._remoteDescription.sdp).length;n.transceivers.forEach((function(e,o){if(!(o+1>s)){if(e.rejected)return"application"===e.kind?"DTLS/SCTP"===e.protocol?a+="m=application 0 DTLS/SCTP 5000\r\n":a+="m=application 0 "+e.protocol+" webrtc-datachannel\r\n":"audio"===e.kind?a+="m=audio 0 UDP/TLS/RTP/SAVPF 0\r\na=rtpmap:0 PCMU/8000\r\n":"video"===e.kind&&(a+="m=video 0 UDP/TLS/RTP/SAVPF 120\r\na=rtpmap:120 VP8/90000\r\n"),void(a+="c=IN IP4 0.0.0.0\r\na=inactive\r\na=mid:"+e.mid+"\r\n");var u;if(e.stream)"audio"===e.kind?u=e.stream.getAudioTracks()[0]:"video"===e.kind&&(u=e.stream.getVideoTracks()[0]),u&&t>=15019&&"video"===e.kind&&!e.sendEncodingParameters[0].rtx&&(e.sendEncodingParameters[0].rtx={ssrc:e.sendEncodingParameters[0].ssrc+1});var l=i(e.localCapabilities,e.remoteCapabilities);!l.codecs.filter((function(e){return"rtx"===e.name.toLowerCase()})).length&&e.sendEncodingParameters[0].rtx&&delete e.sendEncodingParameters[0].rtx,a+=r(e,l,"answer",e.stream,n._dtlsRole),e.rtcpParameters&&e.rtcpParameters.reducedSize&&(a+="a=rtcp-rsize\r\n")}}));var l=new e.RTCSessionDescription({type:"answer",sdp:a});return Promise.resolve(l)},d.prototype.addIceCandidate=function(e){var t,n=this;return e&&void 0===e.sdpMLineIndex&&!e.sdpMid?Promise.reject(new TypeError("sdpMLineIndex or sdpMid required")):new Promise((function(r,i){if(!n._remoteDescription)return i(o("InvalidStateError","Can not add ICE candidate without a remote description"));if(e&&""!==e.candidate){var a=e.sdpMLineIndex;if(e.sdpMid)for(var l=0;l<n.transceivers.length;l++)if(n.transceivers[l].mid===e.sdpMid){a=l;break}var c=n.transceivers[a];if(!c)return i(o("OperationError","Can not add ICE candidate"));if(c.rejected)return r();var d=Object.keys(e.candidate).length>0?u.parseCandidate(e.candidate):{};if("tcp"===d.protocol&&(0===d.port||9===d.port))return r();if(d.component&&1!==d.component)return r();if((0===a||a>0&&c.iceTransport!==n.transceivers[0].iceTransport)&&!s(c.iceTransport,d))return i(o("OperationError","Can not add ICE candidate"));var h=e.candidate.trim();0===h.indexOf("a=")&&(h=h.substr(2)),(t=u.getMediaSections(n._remoteDescription.sdp))[a]+="a="+(d.type?h:"end-of-candidates")+"\r\n",n._remoteDescription.sdp=u.getDescription(n._remoteDescription.sdp)+t.join("")}else for(var f=0;f<n.transceivers.length&&(n.transceivers[f].rejected||(n.transceivers[f].iceTransport.addRemoteCandidate({}),(t=u.getMediaSections(n._remoteDescription.sdp))[f]+="a=end-of-candidates\r\n",n._remoteDescription.sdp=u.getDescription(n._remoteDescription.sdp)+t.join(""),!n.usingBundle));f++);r()}))},d.prototype.getStats=function(t){if(t&&t instanceof e.MediaStreamTrack){var n=null;if(this.transceivers.forEach((function(e){e.rtpSender&&e.rtpSender.track===t?n=e.rtpSender:e.rtpReceiver&&e.rtpReceiver.track===t&&(n=e.rtpReceiver)})),!n)throw o("InvalidAccessError","Invalid selector.");return n.getStats()}var r=[];return this.transceivers.forEach((function(e){["rtpSender","rtpReceiver","iceGatherer","iceTransport","dtlsTransport"].forEach((function(t){e[t]&&r.push(e[t].getStats())}))})),Promise.all(r).then((function(e){var t=new Map;return e.forEach((function(e){e.forEach((function(e){t.set(e.id,e)}))})),t}))},["RTCRtpSender","RTCRtpReceiver","RTCIceGatherer","RTCIceTransport","RTCDtlsTransport"].forEach((function(t){var n=e[t];if(n&&n.prototype&&n.prototype.getStats){var r=n.prototype.getStats;n.prototype.getStats=function(){return r.apply(this).then((function(e){var t=new Map;return Object.keys(e).forEach((function(n){e[n].type=function(e){return{inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type}(e[n]),t.set(n,e[n])})),t}))}}}));var h=["createOffer","createAnswer"];return h.forEach((function(e){var t=d.prototype[e];d.prototype[e]=function(){var e=arguments;return"function"==typeof e[0]||"function"==typeof e[1]?t.apply(this,[arguments[2]]).then((function(t){"function"==typeof e[0]&&e[0].apply(null,[t])}),(function(t){"function"==typeof e[1]&&e[1].apply(null,[t])})):t.apply(this,arguments)}})),(h=["setLocalDescription","setRemoteDescription","addIceCandidate"]).forEach((function(e){var t=d.prototype[e];d.prototype[e]=function(){var e=arguments;return"function"==typeof e[1]||"function"==typeof e[2]?t.apply(this,arguments).then((function(){"function"==typeof e[1]&&e[1].apply(null)}),(function(t){"function"==typeof e[2]&&e[2].apply(null,[t])})):t.apply(this,arguments)}})),["getStats"].forEach((function(e){var t=d.prototype[e];d.prototype[e]=function(){var e=arguments;return"function"==typeof e[1]?t.apply(this,arguments).then((function(){"function"==typeof e[1]&&e[1].apply(null)})):t.apply(this,arguments)}})),d}},{sdp:17}],17:[function(e,t,n){"use strict";var r={generateIdentifier:function(){return Math.random().toString(36).substr(2,10)}};r.localCName=r.generateIdentifier(),r.splitLines=function(e){return e.trim().split("\n").map((function(e){return e.trim()}))},r.splitSections=function(e){return e.split("\nm=").map((function(e,t){return(t>0?"m="+e:e).trim()+"\r\n"}))},r.getDescription=function(e){var t=r.splitSections(e);return t&&t[0]},r.getMediaSections=function(e){var t=r.splitSections(e);return t.shift(),t},r.matchPrefix=function(e,t){return r.splitLines(e).filter((function(e){return 0===e.indexOf(t)}))},r.parseCandidate=function(e){for(var t,n={foundation:(t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" "))[0],component:parseInt(t[1],10),protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]},r=8;r<t.length;r+=2)switch(t[r]){case"raddr":n.relatedAddress=t[r+1];break;case"rport":n.relatedPort=parseInt(t[r+1],10);break;case"tcptype":n.tcpType=t[r+1];break;case"ufrag":n.ufrag=t[r+1],n.usernameFragment=t[r+1];break;default:n[t[r]]=t[r+1]}return n},r.writeCandidate=function(e){var t=[];t.push(e.foundation),t.push(e.component),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);var n=e.type;return t.push("typ"),t.push(n),"host"!==n&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},r.parseIceOptions=function(e){return e.substr(14).split(" ")},r.parseRtpMap=function(e){var t=e.substr(9).split(" "),n={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),n.name=t[0],n.clockRate=parseInt(t[1],10),n.channels=3===t.length?parseInt(t[2],10):1,n.numChannels=n.channels,n},r.writeRtpMap=function(e){var t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);var n=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==n?"/"+n:"")+"\r\n"},r.parseExtmap=function(e){var t=e.substr(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1]}},r.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+"\r\n"},r.parseFmtp=function(e){for(var t,n={},r=e.substr(e.indexOf(" ")+1).split(";"),i=0;i<r.length;i++)n[(t=r[i].trim().split("="))[0].trim()]=t[1];return n},r.writeFmtp=function(e){var t="",n=e.payloadType;if(void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){var r=[];Object.keys(e.parameters).forEach((function(t){e.parameters[t]?r.push(t+"="+e.parameters[t]):r.push(t)})),t+="a=fmtp:"+n+" "+r.join(";")+"\r\n"}return t},r.parseRtcpFb=function(e){var t=e.substr(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},r.writeRtcpFb=function(e){var t="",n=e.payloadType;return void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach((function(e){t+="a=rtcp-fb:"+n+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"})),t},r.parseSsrcMedia=function(e){var t=e.indexOf(" "),n={ssrc:parseInt(e.substr(7,t-7),10)},r=e.indexOf(":",t);return r>-1?(n.attribute=e.substr(t+1,r-t-1),n.value=e.substr(r+1)):n.attribute=e.substr(t+1),n},r.parseSsrcGroup=function(e){var t=e.substr(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((function(e){return parseInt(e,10)}))}},r.getMid=function(e){var t=r.matchPrefix(e,"a=mid:")[0];if(t)return t.substr(6)},r.parseFingerprint=function(e){var t=e.substr(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1]}},r.getDtlsParameters=function(e,t){return{role:"auto",fingerprints:r.matchPrefix(e+t,"a=fingerprint:").map(r.parseFingerprint)}},r.writeDtlsParameters=function(e,t){var n="a=setup:"+t+"\r\n";return e.fingerprints.forEach((function(e){n+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),n},r.parseCryptoLine=function(e){var t=e.substr(9).split(" ");return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},r.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+("object"==typeof e.keyParams?r.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+"\r\n"},r.parseCryptoKeyParams=function(e){if(0!==e.indexOf("inline:"))return null;var t=e.substr(7).split("|");return{keyMethod:"inline",keySalt:t[0],lifeTime:t[1],mkiValue:t[2]?t[2].split(":")[0]:void 0,mkiLength:t[2]?t[2].split(":")[1]:void 0}},r.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},r.getCryptoParameters=function(e,t){return r.matchPrefix(e+t,"a=crypto:").map(r.parseCryptoLine)},r.getIceParameters=function(e,t){var n=r.matchPrefix(e+t,"a=ice-ufrag:")[0],i=r.matchPrefix(e+t,"a=ice-pwd:")[0];return n&&i?{usernameFragment:n.substr(12),password:i.substr(10)}:null},r.writeIceParameters=function(e){return"a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n"},r.parseRtpParameters=function(e){for(var t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=r.splitLines(e)[0].split(" "),i=3;i<n.length;i++){var a=n[i],s=r.matchPrefix(e,"a=rtpmap:"+a+" ")[0];if(s){var o=r.parseRtpMap(s),u=r.matchPrefix(e,"a=fmtp:"+a+" ");switch(o.parameters=u.length?r.parseFmtp(u[0]):{},o.rtcpFeedback=r.matchPrefix(e,"a=rtcp-fb:"+a+" ").map(r.parseRtcpFb),t.codecs.push(o),o.name.toUpperCase()){case"RED":case"ULPFEC":t.fecMechanisms.push(o.name.toUpperCase())}}}return r.matchPrefix(e,"a=extmap:").forEach((function(e){t.headerExtensions.push(r.parseExtmap(e))})),t},r.writeRtpDescription=function(e,t){var n="";n+="m="+e+" ",n+=t.codecs.length>0?"9":"0",n+=" UDP/TLS/RTP/SAVPF ",n+=t.codecs.map((function(e){return void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType})).join(" ")+"\r\n",n+="c=IN IP4 0.0.0.0\r\n",n+="a=rtcp:9 IN IP4 0.0.0.0\r\n",t.codecs.forEach((function(e){n+=r.writeRtpMap(e),n+=r.writeFmtp(e),n+=r.writeRtcpFb(e)}));var i=0;return t.codecs.forEach((function(e){e.maxptime>i&&(i=e.maxptime)})),i>0&&(n+="a=maxptime:"+i+"\r\n"),n+="a=rtcp-mux\r\n",t.headerExtensions&&t.headerExtensions.forEach((function(e){n+=r.writeExtmap(e)})),n},r.parseRtpEncodingParameters=function(e){var t,n=[],i=r.parseRtpParameters(e),a=-1!==i.fecMechanisms.indexOf("RED"),s=-1!==i.fecMechanisms.indexOf("ULPFEC"),o=r.matchPrefix(e,"a=ssrc:").map((function(e){return r.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute})),u=o.length>0&&o[0].ssrc,l=r.matchPrefix(e,"a=ssrc-group:FID").map((function(e){return e.substr(17).split(" ").map((function(e){return parseInt(e,10)}))}));l.length>0&&l[0].length>1&&l[0][0]===u&&(t=l[0][1]),i.codecs.forEach((function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var r={ssrc:u,codecPayloadType:parseInt(e.parameters.apt,10)};u&&t&&(r.rtx={ssrc:t}),n.push(r),a&&((r=JSON.parse(JSON.stringify(r))).fec={ssrc:u,mechanism:s?"red+ulpfec":"red"},n.push(r))}})),0===n.length&&u&&n.push({ssrc:u});var c=r.matchPrefix(e,"b=");return c.length&&(c=0===c[0].indexOf("b=TIAS:")?parseInt(c[0].substr(7),10):0===c[0].indexOf("b=AS:")?1e3*parseInt(c[0].substr(5),10)*.95-16e3:void 0,n.forEach((function(e){e.maxBitrate=c}))),n},r.parseRtcpParameters=function(e){var t={},n=r.matchPrefix(e,"a=ssrc:").map((function(e){return r.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute}))[0];n&&(t.cname=n.value,t.ssrc=n.ssrc);var i=r.matchPrefix(e,"a=rtcp-rsize");t.reducedSize=i.length>0,t.compound=0===i.length;var a=r.matchPrefix(e,"a=rtcp-mux");return t.mux=a.length>0,t},r.parseMsid=function(e){var t,n=r.matchPrefix(e,"a=msid:");if(1===n.length)return{stream:(t=n[0].substr(7).split(" "))[0],track:t[1]};var i=r.matchPrefix(e,"a=ssrc:").map((function(e){return r.parseSsrcMedia(e)})).filter((function(e){return"msid"===e.attribute}));return i.length>0?{stream:(t=i[0].value.split(" "))[0],track:t[1]}:void 0},r.parseSctpDescription=function(e){var t,n=r.parseMLine(e),i=r.matchPrefix(e,"a=max-message-size:");i.length>0&&(t=parseInt(i[0].substr(19),10)),isNaN(t)&&(t=65536);var a=r.matchPrefix(e,"a=sctp-port:");if(a.length>0)return{port:parseInt(a[0].substr(12),10),protocol:n.fmt,maxMessageSize:t};if(r.matchPrefix(e,"a=sctpmap:").length>0){var s=r.matchPrefix(e,"a=sctpmap:")[0].substr(10).split(" ");return{port:parseInt(s[0],10),protocol:s[1],maxMessageSize:t}}},r.writeSctpDescription=function(e,t){var n=[];return n="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&n.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),n.join("")},r.generateSessionId=function(){return Math.random().toString().substr(2,21)},r.writeSessionBoilerplate=function(e,t,n){var i=void 0!==t?t:2;return"v=0\r\no="+(n||"thisisadapterortc")+" "+(e||r.generateSessionId())+" "+i+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},r.writeMediaSection=function(e,t,n,i){var a=r.writeRtpDescription(e.kind,t);if(a+=r.writeIceParameters(e.iceGatherer.getLocalParameters()),a+=r.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===n?"actpass":"active"),a+="a=mid:"+e.mid+"\r\n",e.direction?a+="a="+e.direction+"\r\n":e.rtpSender&&e.rtpReceiver?a+="a=sendrecv\r\n":e.rtpSender?a+="a=sendonly\r\n":e.rtpReceiver?a+="a=recvonly\r\n":a+="a=inactive\r\n",e.rtpSender){var s="msid:"+i.id+" "+e.rtpSender.track.id+"\r\n";a+="a="+s,a+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+s,e.sendEncodingParameters[0].rtx&&(a+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+s,a+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return a+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+r.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(a+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+r.localCName+"\r\n"),a},r.getDirection=function(e,t){for(var n=r.splitLines(e),i=0;i<n.length;i++)switch(n[i]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[i].substr(2)}return t?r.getDirection(t):"sendrecv"},r.getKind=function(e){return r.splitLines(e)[0].split(" ")[0].substr(2)},r.isRejected=function(e){return"0"===e.split(" ",2)[1]},r.parseMLine=function(e){var t=r.splitLines(e)[0].substr(2).split(" ");return{kind:t[0],port:parseInt(t[1],10),protocol:t[2],fmt:t.slice(3).join(" ")}},r.parseOLine=function(e){var t=r.matchPrefix(e,"o=")[0].substr(2).split(" ");return{username:t[0],sessionId:t[1],sessionVersion:parseInt(t[2],10),netType:t[3],addressType:t[4],address:t[5]}},r.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;for(var t=r.splitLines(e),n=0;n<t.length;n++)if(t[n].length<2||"="!==t[n].charAt(1))return!1;return!0},"object"==typeof t&&(t.exports=r)},{}]},{},[1])(1)})),function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).videojsFlvjs=e()}}((function(){return function e(t,n,r){function i(s,o){if(!n[s]){if(!t[s]){var u="function"==typeof require&&require;if(!o&&u)return u(s,!0);if(a)return a(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[s]={exports:{}};t[s][0].call(c.exports,(function(e){return i(t[s][1][e]||e)}),c,c.exports,e,t,n,r)}return n[s].exports}for(var a="function"==typeof require&&require,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(e,t,n){(function(e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),r=function(e){return e&&e.__esModule?e:{default:e}}("undefined"!=typeof window?window.videojs:void 0!==e?e.videojs:null),i=r.default.getTech("Html5"),a=r.default.mergeOptions||r.default.util.mergeOptions,s={dataInterval:3e3},o=function(e){function n(e,t){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),e=a(s,e),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e,t))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,e),t(n,[{key:"setSrc",value:function(e){var t=this,n=!!this.options_.debug;this.options_.autoplay,this.debug=n;var r=this.options_.dataInterval;n&&console.log("rtc debug on"),this.src=e,this.stream=new MediaStream;var i=new RTCPeerConnection;this.pc=i,i.ontrack=function(e){t.stream.addTrack(e.track),t.el_.srcObject!=t.stream&&(t.el_.srcObject=t.stream),n&&console.log(e.streams.length,"track",e.track.kind,"is delivered")},i.oniceconnectionstatechange=function(e){"disconnected"==i.iceConnectionState&&t.sendChannelTicker&&(t.eventBusEl_&&t.trigger({type:"error",name:"ice disconnected"}),clearInterval(t.sendChannelTicker),t.sendChannelTicker=0),n&&console.log("ice connection state change: "+i.iceConnectionState)};var a=i.createDataChannel("keepalive");this.sendChannel=a,a.onclose=function(){t.sendChannelTicker&&(t.eventBusEl_&&t.trigger({type:"error",name:"send channel closed"}),clearInterval(t.sendChannelTicker),t.sendChannelTicker=0),n&&console.log("sendChannel has closed")},a.onopen=function(){n&&console.log("sendChannel has opened"),a.send("ping");var e=setInterval((function(){n&&console.log("sendChannel ping..."),a.send("ping")}),r);t.sendChannelTicker=e},a.onmessage=function(e){n&&console.log("sendChannel message",e.data)},i.createOffer({offerToReceiveVideo:!0,offerToReceiveAudio:!0}).then((function(r){i.setLocalDescription(r).then((function(){var r=new XMLHttpRequest;r.open("POST",e.replace("webrtc","http"),!0),r.onreadystatechange=function(){if(4==r.readyState)if(r.status>=200&&r.status<300||304===r.status)try{i.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:atob(r.responseText)})).catch((function(e){t.eventBusEl_&&t.trigger({type:"error",name:"set rtc remote sdp failed"}),n&&console.log("set rtc remote sdp error",e)}))}catch(e){t.eventBusEl_&&t.trigger({type:"error",name:"set rtc remote sdp failed"}),n&&console.log("set rtc remote sdp error",e)}else t.eventBusEl_&&t.trigger({type:"error",name:"post rtc status "+r.status}),n&&console.log("post rtc status",r.status,r.statusText)},r.send(btoa(i.localDescription.sdp))})).catch((function(e){n&&console.log("pc setLocalDescription error",e)}))})).catch((function(e){n&&console.log("pc createOffer error",e)}))}},{key:"dispose",value:function(){this.debug&&console.log("rtc dispose"),this.sendChannelTicker&&(clearInterval(this.sendChannelTicker),this.sendChannelTicker=0),this.sendChannel&&(this.sendChannel.close(),this.sendChannel=null),this.pc&&(this.pc.close(),this.pc=null),this.el_.srcObject&&(this.el_.srcObject=null),function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,n,r)}if("value"in i)return i.value;var s=i.get;return void 0!==s?s.call(r):void 0}(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"dispose",this).call(this)}},{key:"reload",value:function(){this.sendChannelTicker&&(clearInterval(this.sendChannelTicker),this.sendChannelTicker=0),this.sendChannel&&(this.sendChannel.close(),this.sendChannel=null),this.pc&&(this.pc.close(),this.pc=null),this.el_.srcObject&&(this.el_.srcObject=null),this.src?this.setSrc(this.src):this.debug&&console.log("reload error, src not found")}}]),n}(i);o.isSupported=function(){return!!window.RTCPeerConnection},o.formats={"video/webrtc":"RTC"},o.canPlayType=function(e){return o.isSupported()?"maybe":""},o.canPlaySource=function(e,t){return o.canPlayType(e.type)},o.VERSION="0.2.0",r.default.registerTech("Webrtc",o),n.default=o}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)})),function(){"use strict";var e;e=void 0===window.videojs&&"function"==typeof require?require("video.js"):window.videojs,function(e,t){function n(e,t,n,r){return a={label:n,sources:t},"function"==typeof r?r(e,t,n):e.src(t.map((function(e){return{src:e.src,type:e.type,res:e.res}})))}var r,i={},a={},s={},o=t.getComponent("MenuItem"),u=t.extend(o,{constructor:function(e,t,n,r){this.onClickListener=n,this.label=r,o.call(this,e,t),this.src=t.src,this.on("click",this.onClick),this.on("touchstart",this.onClick),t.initialySelected&&(this.showAsLabel(),this.selected(!0),this.addClass("vjs-selected"))},showAsLabel:function(){this.label&&(this.label.innerHTML=this.options_.label)},onClick:function(e){this.onClickListener(this);var t=this.player_.currentTime(),r=this.player_.paused();this.showAsLabel(),this.addClass("vjs-selected"),r||this.player_.bigPlayButton.hide(),"function"!=typeof e&&"function"==typeof this.options_.customSourcePicker&&(e=this.options_.customSourcePicker);var i="loadeddata";"Youtube"!==this.player_.techName_&&"none"===this.player_.preload()&&"Flash"!==this.player_.techName_&&(i="timeupdate"),n(this.player_,this.src,this.options_.label,e),this.player_.one(i,(function(){this.player_.currentTime(t),this.player_.handleTechSeeked_(),this.player_.trigger("resolutionchange")}))}}),l=t.getComponent("MenuButton"),c=t.extend(l,{constructor:function(e,n,r,i){if(this.sources=n.sources,this.label=i,this.label.innerHTML=n.initialySelectedLabel,l.call(this,e,n,r),this.controlText("Quality"),r.dynamicLabel)this.el().appendChild(i);else{var a=document.createElement("span");t.dom.addClass(a,"vjs-resolution-button-staticlabel"),this.el().appendChild(a)}},createItems:function(){var e=[],t=this.sources&&this.sources.label||{},n=function(t){e.map((function(e){e.selected(e===t),e.removeClass("vjs-selected")}))};for(var r in t)t.hasOwnProperty(r)&&(e.push(new u(this.player_,{label:r,src:t[r],initialySelected:r===this.options_.initialySelectedLabel,customSourcePicker:this.options_.customSourcePicker},n,this.label)),s[r]=e[e.length-1]);return e}});r=function(e){function r(e,t){return e.res&&t.res?+t.res-+e.res:0}function o(e){var t={label:{},res:{},type:{}};return e.map((function(e){u(t,"label",e),u(t,"res",e),u(t,"type",e),l(t,"label",e),l(t,"res",e),l(t,"type",e)})),t}function u(e,t,n){null==e[t][n[t]]&&(e[t][n[t]]=[])}function l(e,t,n){e[t][n[t]].push(n)}var d=t.mergeOptions(i,e),h=this,f=document.createElement("span"),p={};t.dom.addClass(f,"vjs-menu"),t.browser.IE_VERSION?t.dom.addClass(f,"vjs-resolution-button-label-ie"):t.dom.addClass(f,"vjs-resolution-button-label"),h.updateSrc=function(e){if(!e)return h.src();h.controlBar.resolutionSwitcher&&(h.controlBar.resolutionSwitcher.dispose(),delete h.controlBar.resolutionSwitcher),e=e.sort(r);var i=function(e,t){var n=d.default,r="";return"high"===n?(n=t[0].res,r=t[0].label):"low"!==n&&null!=n&&e.res[n]?e.res[n]&&(r=e.res[n][0].label):(n=t[t.length-1].res,r=t[t.length-1].label),{res:n,label:r,sources:e.res[n]}}(p=o(e),e),a=new c(h,{sources:p,initialySelectedLabel:i.label,initialySelectedRes:i.res,customSourcePicker:d.customSourcePicker},d,f);return t.dom.addClass(a.el(),"vjs-resolution-button"),h.controlBar.resolutionSwitcher=h.controlBar.el_.insertBefore(a.el_,h.controlBar.getChild("fullscreenToggle").el_),h.controlBar.resolutionSwitcher.dispose=function(){this.parentNode.removeChild(this)},n(h,i.sources,i.label)},h.currentResolution=function(e,t){return null==e?a:(null!=s[e]&&s[e].onClick(t),h)},h.getGroupedSrc=function(){return p},h.ready((function(){h.options_.sources.length>1&&h.updateSrc(h.options_.sources),"Youtube"===h.techName_&&function(e){e.tech_.ytPlayer.setPlaybackQuality("default"),e.tech_.ytPlayer.addEventListener("onPlaybackQualityChange",(function(){e.trigger("resolutionchange")})),e.one("play",(function(){var t=e.tech_.ytPlayer.getAvailableQualityLevels(),n={highres:{res:1080,label:"1080",yt:"highres"},hd1080:{res:1080,label:"1080",yt:"hd1080"},hd720:{res:720,label:"720",yt:"hd720"},large:{res:480,label:"480",yt:"large"},medium:{res:360,label:"360",yt:"medium"},small:{res:240,label:"240",yt:"small"},tiny:{res:144,label:"144",yt:"tiny"},auto:{res:0,label:"auto",yt:"default"}},r=[];t.map((function(t){r.push({src:e.src().src,type:e.src().type,label:n[t].label,res:n[t].res,_yt:n[t].yt})}));var i="auto",a=0,s=((p=o(r)).label.auto,new c(e,{sources:p,initialySelectedLabel:i,initialySelectedRes:a,customSourcePicker:function(t,n,r){return e.tech_.ytPlayer.setPlaybackQuality(n[0]._yt),e}},d,f));s.el().classList.add("vjs-resolution-button"),e.controlBar.resolutionSwitcher=e.controlBar.addChild(s)}))}(h)}))},t.registerPlugin("videoJsResolutionSwitcher",r)}(window,e)}(),function(e,t){"undefined"!=typeof window&&window.videojs?t(window.videojs):"function"==typeof define&&define.amd?define("videojs-hotkeys",["video.js"],(function(e){return t(e.default||e)})):"undefined"!=typeof module&&module.exports&&(module.exports=t(require("video.js")))}(0,(function(e){"use strict";"undefined"!=typeof window&&(window.videojs_hotkeys={version:"0.2.22"});(e.registerPlugin||e.plugin)("hotkeys",(function(t){function n(e){return"function"==typeof l?l(e):l}var r=this,i=r.el(),a=document,s={volumeStep:.1,seekStep:5,enableMute:!0,enableVolumeScroll:!0,enableFullscreen:!0,enableNumbers:!0,enableJogStyle:!1,alwaysCaptureHotkeys:!1,enableModifiersForNumbers:!0,enableInactiveFocus:!0,skipInitialFocus:!1,playPauseKey:function(e){return 32===e.which||179===e.which},rewindKey:function(e){return 37===e.which||177===e.which},forwardKey:function(e){return 39===e.which||176===e.which},volumeUpKey:function(e){return 38===e.which},volumeDownKey:function(e){return 40===e.which},muteKey:function(e){return 77===e.which},fullscreenKey:function(e){return 70===e.which},customKeys:{}},o=e.mergeOptions||e.util.mergeOptions,u=(t=o(s,t||{})).volumeStep,l=t.seekStep,c=t.enableMute,d=t.enableVolumeScroll,h=t.enableFullscreen,f=t.enableNumbers,p=t.enableJogStyle,v=t.alwaysCaptureHotkeys,m=t.enableModifiersForNumbers,g=t.enableInactiveFocus,y=t.skipInitialFocus;i.hasAttribute("tabIndex")||i.setAttribute("tabIndex","-1"),i.style.outline="none",!v&&r.autoplay()||y||r.one("play",(function(){i.focus({preventScroll:!0})})),g&&r.on("userinactive",(function(){var e=function(){clearTimeout(t)},t=setTimeout((function(){r.off("useractive",e);var t=a.activeElement,n=i.querySelector(".vjs-control-bar");t&&t.parentElement==n&&i.focus()}),10);r.one("useractive",e)})),r.on("play",(function(){var e=i.querySelector(".iframeblocker");e&&""===e.style.display&&(e.style.display="block",e.style.bottom="39px")}));var _=function(e){if(r.controls()){var t=a.activeElement;if((v||t==i||t==i.querySelector(".vjs-tech")||t==i.querySelector(".iframeblocker")||t==i.querySelector(".vjs-control-bar"))&&d){e=window.event||e;var n=Math.max(-1,Math.min(1,e.wheelDelta||-e.detail));e.preventDefault(),1==n?r.volume(r.volume()+u):-1==n&&r.volume(r.volume()-u)}}},b=function(e,n){return t.playPauseKey(e,n)?1:t.rewindKey(e,n)?2:t.forwardKey(e,n)?3:t.volumeUpKey(e,n)?4:t.volumeDownKey(e,n)?5:t.muteKey(e,n)?6:t.fullscreenKey(e,n)?7:void 0};return r.on("keydown",(function(e){var s,o,l=e.which,d=e.preventDefault,g=r.duration();if(r.controls()){var y=a.activeElement;if(v||y==i||y==i.querySelector(".vjs-tech")||y==i.querySelector(".vjs-control-bar")||y==i.querySelector(".iframeblocker"))switch(b(e,r)){case 1:d(),v&&e.stopPropagation(),r.paused()?r.play():r.pause();break;case 2:s=!r.paused(),d(),s&&r.pause(),(o=r.currentTime()-n(e))<=0&&(o=0),r.currentTime(o),s&&r.play();break;case 3:s=!r.paused(),d(),s&&r.pause(),(o=r.currentTime()+n(e))>=g&&(o=s?g-.001:g),r.currentTime(o),s&&r.play();break;case 5:d(),p?(o=r.currentTime()-1,r.currentTime()<=1&&(o=0),r.currentTime(o)):r.volume(r.volume()-u);break;case 4:d(),p?((o=r.currentTime()+1)>=g&&(o=g),r.currentTime(o)):r.volume(r.volume()+u);break;case 6:c&&r.muted(!r.muted());break;case 7:h&&(r.isFullscreen()?r.exitFullscreen():r.requestFullscreen());break;default:if((l>47&&l<59||l>95&&l<106)&&(m||!(e.metaKey||e.ctrlKey||e.altKey))&&f){var _=48;l>95&&(_=96);var T=l-_;d(),r.currentTime(r.duration()*T*.1)}for(var S in t.customKeys){var E=t.customKeys[S];E&&E.key&&E.handler&&E.key(e)&&(d(),E.handler(r,t,e))}}}})),r.on("mousewheel",_),r.on("DOMMouseScroll",_),this}))})),function(e){e.URL=e.URL||e.webkitURL,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;var t=function(t,n){(n=n||{}).sampleBits=n.sampleBits||8,n.sampleRate=n.sampleRate||8e3;var r=new(e.webkitAudioContext||e.AudioContext),i=r.createMediaStreamSource(t),a=(r.createScriptProcessor||r.createJavaScriptNode).apply(r,[4096,1,1]),s=!1,o={size:0,buffer:[],level:0,inputSampleRate:r.sampleRate,inputSampleBits:16,outputSampleRate:n.sampleRate,oututSampleBits:n.sampleBits,input:function(e){this.buffer.push(new Float32Array(e)),this.size+=e.length,n.pcmCallback&&(n.pcmCallback(this.encodePCM(),this.level),this.buffer.splice(0,this.size),this.size=0)},compress:function(){for(var e=new Float32Array(this.size),t=0,n=0;n<this.buffer.length;n++)e.set(this.buffer[n],t),t+=this.buffer[n].length;for(var r=parseInt(this.inputSampleRate/this.outputSampleRate),i=e.length/r,a=new Float32Array(i),s=0,o=0;s<i;)a[s]=e[o],o+=r,s++;return a},powerLevel:function(e,t){var n=e/t||0;return n<1251?Math.round(n/1250*10):Math.round(Math.min(100,Math.max(0,100*(1+Math.log(n/1e4)/Math.log(10)))))},encodePCM:function(){var e=Math.min(this.inputSampleBits,this.oututSampleBits),t=this.compress(),n=t.length*(e/8),r=new ArrayBuffer(n),i=new DataView(r),a=0,s=0;if(8===e)for(var o=0;o<t.length;o++,a++){var u=(l=Math.max(-1,Math.min(1,t[o])))<0?32768*l:32767*l;u=parseInt(255/(65535/(u+32768))),s+=Math.abs(u),i.setInt8(a,u,!0)}else for(o=0;o<t.length;o++,a+=2){var l;u=(l=Math.max(-1,Math.min(1,t[o])))<0?32768*l:32767*l;s+=Math.abs(u),i.setInt16(a,u,!0)}return this.level=this.powerLevel(s,t.length),new Blob([i],{type:"audio/pcm"})},encodeWAV:function(){var e=Math.min(this.inputSampleRate,this.outputSampleRate),t=Math.min(this.inputSampleBits,this.oututSampleBits),n=this.compress(),r=n.length*(t/8),i=new ArrayBuffer(44+r),a=new DataView(i),s=0,o=0,u=function(e){for(var t=0;t<e.length;t++)a.setUint8(s+t,e.charCodeAt(t))};if(u("RIFF"),s+=4,a.setUint32(s,36+r,!0),s+=4,u("WAVE"),s+=4,u("fmt "),s+=4,a.setUint32(s,16,!0),s+=4,a.setUint16(s,1,!0),s+=2,a.setUint16(s,1,!0),s+=2,a.setUint32(s,e,!0),s+=4,a.setUint32(s,1*e*(t/8),!0),s+=4,a.setUint16(s,t/8*1,!0),s+=2,a.setUint16(s,t,!0),s+=2,u("data"),s+=4,a.setUint32(s,r,!0),s+=4,8===t)for(var l=0;l<n.length;l++,s++){var c=(d=Math.max(-1,Math.min(1,n[l])))<0?32768*d:32767*d;c=parseInt(255/(65535/(c+32768))),o+=Math.abs(c),a.setInt8(s,c,!0)}else for(l=0;l<n.length;l++,s+=2){var d;c=(d=Math.max(-1,Math.min(1,n[l])))<0?32768*d:32767*d;o+=Math.abs(c),a.setInt16(s,c,!0)}return this.level=this.powerLevel(o,n.length),new Blob([a],{type:"audio/wav"})}};this.start=function(){s||(i.connect(a),a.connect(r.destination),s=!0)},this.stop=function(){s&&(a.disconnect(),s=!1)},this.destroy=function(){this.stop(),r&&(r.close(),r=null,t.getAudioTracks().forEach((function(e){e.stop()})))},this.getBlob=function(){return this.stop(),o.encodeWAV()},this.getPCMBlob=function(){return this.stop(),o.encodePCM()},this.getLevel=function(){return o.level},this.play=function(t){t.src=e.URL.createObjectURL(this.getBlob())},this.recording=function(){return s},this.upload=function(e,t){var n=new FormData;n.append("audioData",this.getBlob()),n.append("pcmData",this.getPCMBlob());var r=new XMLHttpRequest;t&&(r.upload.addEventListener("progress",(function(e){t("uploading",e)}),!1),r.addEventListener("load",(function(e){t("ok",e)}),!1),r.addEventListener("error",(function(e){t("error",e)}),!1),r.addEventListener("abort",(function(e){t("cancel",e)}),!1)),r.open("POST",e),r.send(n)},a.onaudioprocess=function(e){o.input(e.inputBuffer.getChannelData(0))}};t.canRecording=null!=navigator.getUserMedia,t.get=function(e,n){if(e){if(!navigator.getUserMedia)return"https:"!=String(location.protocol).toLowerCase()?void e(null,"当前浏览器不支持录音功能, 请确认当前是否访问 HTTPS 服务!"):void e(null,"当前浏览器不支持录音功能。");navigator.getUserMedia({audio:!0},(function(r){var i=new t(r,n);e(i,null)}),(function(t){switch(t.name||t.code){case"PERMISSION_DENIED":case"PermissionDeniedError":e(null,"用户拒绝提供信息。");break;case"NOT_SUPPORTED_ERROR":case"NotSupportedError":e(null,"浏览器不支持硬件设备。");break;case"MANDATORY_UNSATISFIED_ERROR":case"MandatoryUnsatisfiedError":e(null,"无法发现指定的硬件设备。");break;default:e(null,"无法打开麦克风。异常信息:"+(t.name||t.code))}}))}},e.LiveRecorder=t}(window),videojs.addLanguage("zh-CN",{Play:"播放",Pause:"暂停","Current Time":"当前时间",Duration:"时长","Remaining Time":"剩余时间","Stream Type":"媒体流类型",LIVE:"直播",Loaded:"加载完毕",Progress:"进度",Fullscreen:"全屏","Non-Fullscreen":"退出全屏",Mute:"静音",Unmute:"取消静音","Playback Rate":"播放速度",Subtitles:"字幕","subtitles off":"关闭字幕",Captions:"内嵌字幕","captions off":"关闭内嵌字幕",Chapters:"节目段落","Close Modal Dialog":"关闭弹窗",Descriptions:"描述","descriptions off":"关闭描述","Audio Track":"音轨","You aborted the media playback":"视频播放被终止","A network error caused the media download to fail part-way.":"网络错误导致视频下载中途失败。","The media could not be loaded, either because the server or network failed or because the format is not supported.":"视频因格式不支持或者服务器或网络的问题无法加载。","The media playback was aborted due to a corruption problem or because the media used features your browser did not support.":"由于视频文件损坏或是该视频使用了你的浏览器不支持的功能,播放终止。","No compatible source was found for this media.":"无法找到此视频兼容的源。","The media is encrypted and we do not have the keys to decrypt it.":"视频已加密,无法解密。","Play Video":"播放视频",Close:"关闭","Modal Window":"弹窗","This is a modal window":"这是一个弹窗","This modal can be closed by pressing the Escape key or activating the close button.":"可以按ESC按键或启用关闭按钮来关闭此弹窗。",", opens captions settings dialog":", 开启标题设置弹窗",", opens subtitles settings dialog":", 开启字幕设置弹窗",", opens descriptions settings dialog":", 开启描述设置弹窗",", selected":", 选择","captions settings":"字幕设定","Audio Player":"音频播放器","Video Player":"视频播放器",Replay:"重播","Progress Bar":"进度条","Volume Level":"音量","subtitles settings":"字幕设定","descriptions settings":"描述设定",Text:"文字",White:"白",Black:"黑",Red:"红",Green:"绿",Blue:"蓝",Yellow:"黄",Magenta:"紫红",Cyan:"青",Background:"背景",Window:"视窗",Transparent:"透明","Semi-Transparent":"半透明",Opaque:"不透明","Font Size":"字体尺寸","Text Edge Style":"字体边缘样式",None:"无",Raised:"浮雕",Depressed:"压低",Uniform:"均匀",Dropshadow:"下阴影","Font Family":"字体库","Proportional Sans-Serif":"比例无细体","Monospace Sans-Serif":"单间隔无细体","Proportional Serif":"比例细体","Monospace Serif":"单间隔细体",Casual:"舒适",Script:"手写体","Small Caps":"小型大写字体",Reset:"重置","restore all settings to the default values":"恢复全部设定至预设值",Done:"完成","Caption Settings Dialog":"字幕设定视窗","Beginning of dialog window. Escape will cancel and close the window.":"开始对话视窗。离开会取消及关闭视窗","End of dialog window.":"结束对话视窗","Seek to live, currently behind live":"试图直播,当前延时播放","Seek to live, currently playing live":"试图直播,当前实时播放","progress bar timing: currentTime={1} duration={2}":"{1}/{2}","{1} is loading.":"正在加载 {1}。","Picture-in-Picture":"画中画","Exit Picture-in-Picture":"退出画中画",Snapshot:"截图",STD:"标准",STR:"拉伸","Click switch to standard display":"点击切换到标准显示","Click switch to stretch display":"点击切换到拉伸显示",Fluent:"流畅",Fast:"极速","Click switch to fast play":"点击切换到极速播放","Click switch to fluent play":"点击切换到流畅播放"}),function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}({"+40N":function(e,t,n){var r=n("8IOi"),i=n("Z/7P");r(r.G+r.F*(parseInt!=i),{parseInt:i})},"+4di":function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},"+9nT":function(e,t,n){n("+Uj0")("WeakSet")},"+TcE":function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},"+UUX":function(e,t,n){"use strict";var r=n("Qu5u"),i=n("b8c2"),a=n("Y3Md");e.exports=[].copyWithin||function(e,t){var n=r(this),s=a(n.length),o=i(e,s),u=i(t,s),l=arguments.length>2?arguments[2]:void 0,c=Math.min((void 0===l?s:i(l,s))-u,s-o),d=1;for(u<o&&o<u+c&&(d=-1,u+=c-1,o+=c-1);c-- >0;)u in n?n[o]=n[u]:delete n[o],o+=d,u+=d;return n}},"+Uj0":function(e,t,n){"use strict";var r=n("8IOi");e.exports=function(e){r(r.S,e,{of:function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];return new this(t)}})}},"+Wx6":function(e,t,n){var r=n("8IOi"),i=n("HC2Y");r(r.S,"Error",{isError:function(e){return"Error"===i(e)}})},"+X+Z":function(e,t,n){e.exports=!n("yU77")&&!n("+TcE")((function(){return 7!=Object.defineProperty(n("itdZ")("div"),"a",{get:function(){return 7}}).a}))},"+fNn":function(e,t,n){var r=n("8IOi"),i=n("hTk/");r(r.G+r.F*(parseFloat!=i),{parseFloat:i})},"+z8a":function(e,t,n){"use strict";var r=n("UVVG"),i={};i[n("3iRr")("toStringTag")]="z",i+""!="[object z]"&&n("d+oe")(Object.prototype,"toString",(function(){return"[object "+r(this)+"]"}),!0)},"+zL4":function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},"/Kal":function(e,t,n){var r=n("8IOi");r(r.S+r.F*!n("yU77"),"Object",{defineProperty:n("J2HX").f})},"/p3b":function(e,t,n){var r=n("8IOi");r(r.S,"Date",{now:function(){return(new Date).getTime()}})},"/vim":function(e,t,n){"use strict";var r=n("UVVG"),i=RegExp.prototype.exec;e.exports=function(e,t){var n=e.exec;if("function"==typeof n){var a=n.call(e,t);if("object"!=typeof a)throw new TypeError("RegExp exec method returned something other than an Object or null");return a}if("RegExp"!==r(e))throw new TypeError("RegExp#exec called on incompatible receiver");return i.call(e,t)}},0:function(e,t,n){n("201c"),e.exports=n("q/s7")},"0PTC":function(e,t,n){var r=n("n+hx"),i=n("TI2F").onFreeze;n("CmYC")("seal",(function(e){return function(t){return e&&r(t)?e(i(t)):t}}))},"0WhE":function(e,t,n){"use strict";var r=n("k+AJ"),i=n("8IOi"),a=n("d+oe"),s=n("xmgo"),o=n("TI2F"),u=n("j8TA"),l=n("kopD"),c=n("n+hx"),d=n("+TcE"),h=n("6+im"),f=n("J70Z"),p=n("EeL+");e.exports=function(e,t,n,v,m,g){var y=r[e],_=y,b=m?"set":"add",T=_&&_.prototype,S={},E=function(e){var t=T[e];a(T,e,"delete"==e||"has"==e?function(e){return!(g&&!c(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return g&&!c(e)?void 0:t.call(this,0===e?0:e)}:"add"==e?function(e){return t.call(this,0===e?0:e),this}:function(e,n){return t.call(this,0===e?0:e,n),this})};if("function"==typeof _&&(g||T.forEach&&!d((function(){(new _).entries().next()})))){var k=new _,w=k[b](g?{}:-0,1)!=k,C=d((function(){k.has(1)})),A=h((function(e){new _(e)})),L=!g&&d((function(){for(var e=new _,t=5;t--;)e[b](t,t);return!e.has(-0)}));A||((_=t((function(t,n){l(t,_,e);var r=p(new y,t,_);return null!=n&&u(n,m,r[b],r),r}))).prototype=T,T.constructor=_),(C||L)&&(E("delete"),E("has"),m&&E("get")),(L||w)&&E(b),g&&T.clear&&delete T.clear}else _=v.getConstructor(t,e,m,b),s(_.prototype,n),o.NEED=!0;return f(_,e),S[e]=_,i(i.G+i.W+i.F*(_!=y),S),g||v.setStrong(_,e,m),_}},"0khl":function(e,t,n){var r=n("8IOi");r(r.S,"Number",{isNaN:function(e){return e!=e}})},"0oS0":function(e,t,n){var r=n("n+hx"),i=n("TI2F").onFreeze;n("CmYC")("preventExtensions",(function(e){return function(t){return e&&r(t)?e(i(t)):t}}))},"138g":function(e,t,n){var r=n("n+hx");e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},"1JuZ":function(e,t,n){var r=n("e8l7"),i=Math.pow,a=i(2,-52),s=i(2,-23),o=i(2,127)*(2-s),u=i(2,-126);e.exports=Math.fround||function(e){var t,n,i=Math.abs(e),l=r(e);return i<u?l*(i/u/s+1/a-1/a)*u*s:(n=(t=(1+s/a)*i)-(t-i))>o||n!=n?l*(1/0):l*n}},"1RbY":function(e,t,n){"use strict";var r=n("zuiL"),i=n("8IOi"),a=n("d+oe"),s=n("BxPU"),o=n("wFMk"),u=n("atpN"),l=n("J70Z"),c=n("7WAm"),d=n("3iRr")("iterator"),h=!([].keys&&"next"in[].keys()),f="keys",p="values",v=function(){return this};e.exports=function(e,t,n,m,g,y,_){u(n,t,m);var b,T,S,E=function(e){if(!h&&e in A)return A[e];switch(e){case f:case p:return function(){return new n(this,e)}}return function(){return new n(this,e)}},k=t+" Iterator",w=g==p,C=!1,A=e.prototype,L=A[d]||A["@@iterator"]||g&&A[g],R=L||E(g),x=g?w?E("entries"):R:void 0,I="Array"==t&&A.entries||L;if(I&&(S=c(I.call(new e)))!==Object.prototype&&S.next&&(l(S,k,!0),r||"function"==typeof S[d]||s(S,d,v)),w&&L&&L.name!==p&&(C=!0,R=function(){return L.call(this)}),r&&!_||!h&&!C&&A[d]||s(A,d,R),o[t]=R,o[k]=v,g)if(b={values:w?R:E(p),keys:y?R:E(f),entries:x},_)for(T in b)T in A||a(A,T,b[T]);else i(i.P+i.F*(h||C),t,b);return b}},"1TfH":function(e,t,n){var r=n("8IOi"),i=n("R1kZ");i&&r(r.S,"Reflect",{setPrototypeOf:function(e,t){i.check(e,t);try{return i.set(e,t),!0}catch(e){return!1}}})},"1bKO":function(e,t,n){var r=n("HGrt"),i=n("138g"),a=r.key,s=r.map,o=r.store;r.exp({deleteMetadata:function(e,t){var n=arguments.length<3?void 0:a(arguments[2]),r=s(i(t),n,!1);if(void 0===r||!r.delete(e))return!1;if(r.size)return!0;var u=o.get(t);return u.delete(n),!!u.size||o.delete(t)}})},"1bh+":function(e,t,n){n("Oi8Z")("Array")},"1hBx":function(e,t,n){var r=n("8IOi"),i=n("ZiEV"),a=n("LOhj"),s=n("138g"),o=n("n+hx"),u=n("+TcE"),l=n("Au75"),c=(n("k+AJ").Reflect||{}).construct,d=u((function(){function e(){}return!(c((function(){}),[],e)instanceof e)})),h=!u((function(){c((function(){}))}));r(r.S+r.F*(d||h),"Reflect",{construct:function(e,t){a(e),s(t);var n=arguments.length<3?e:a(arguments[2]);if(h&&!d)return c(e,t,n);if(e==n){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var r=[null];return r.push.apply(r,t),new(l.apply(e,r))}var u=n.prototype,f=i(o(u)?u:Object.prototype),p=Function.apply.call(e,f,t);return o(p)?p:f}})},"201c":function(e,t,n){"use strict";(function(e){if(n("a5BC"),n("86LW"),n("dt6n"),e._babelPolyfill)throw new Error("only one instance of babel-polyfill is allowed");e._babelPolyfill=!0;function t(e,t,n){e[t]||Object.defineProperty(e,t,{writable:!0,configurable:!0,value:n})}t(String.prototype,"padLeft","".padStart),t(String.prototype,"padRight","".padEnd),"pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill".split(",").forEach((function(e){[][e]&&t(Array,e,Function.call.bind([][e]))}))}).call(this,n("yLpj"))},"26/4":function(e,t,n){var r=n("HC2Y");e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},"27JW":function(e,t,n){var r=n("MN4f"),i=n("aK63").concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},"28ya":function(e,t,n){"use strict";var r=n("8IOi"),i=n("UtW+");r(r.S+r.F*n("+TcE")((function(){function e(){}return!(Array.of.call(e)instanceof e)})),"Array",{of:function(){for(var e=0,t=arguments.length,n=new("function"==typeof this?this:Array)(t);t>e;)i(n,e,arguments[e++]);return n.length=t,n}})},"2ASh":function(e,t,n){var r=n("8IOi"),i=n("138g"),a=Object.isExtensible;r(r.S,"Reflect",{isExtensible:function(e){return i(e),!a||a(e)}})},"31m8":function(e,t,n){"use strict";var r=n("8IOi"),i=n("z/zB")(4);r(r.P+r.F*!n("Vcfr")([].every,!0),"Array",{every:function(e){return i(this,e,arguments[1])}})},"39GA":function(e,t,n){var r=n("J2HX"),i=n("8IOi"),a=n("138g"),s=n("AZ8a");i(i.S+i.F*n("+TcE")((function(){Reflect.defineProperty(r.f({},1,{value:1}),1,{value:2})})),"Reflect",{defineProperty:function(e,t,n){a(e),t=s(t,!0),a(n);try{return r.f(e,t,n),!0}catch(e){return!1}}})},"3D8Z":function(e,t){e.exports=Math.log1p||function(e){return(e=+e)>-1e-8&&e<1e-8?e-e*e/2:Math.log(1+e)}},"3Uai":function(e,t,n){"use strict";n("5oHw")("anchor",(function(e){return function(t){return e(this,"a","name",t)}}))},"3iRr":function(e,t,n){var r=n("3oW4")("wks"),i=n("Vol4"),a=n("k+AJ").Symbol,s="function"==typeof a;(e.exports=function(e){return r[e]||(r[e]=s&&a[e]||(s?a:i)("Symbol."+e))}).store=r},"3oW4":function(e,t,n){var r=n("CuJi"),i=n("k+AJ"),a="__core-js_shared__",s=i[a]||(i[a]={});(e.exports=function(e,t){return s[e]||(s[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n("zuiL")?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},"4D/n":function(e,t,n){var r=n("8IOi"),i=Math.asinh;r(r.S+r.F*!(i&&1/i(0)>0),"Math",{asinh:function e(t){return isFinite(t=+t)&&0!=t?t<0?-e(-t):Math.log(t+Math.sqrt(t*t+1)):t}})},"4Fav":function(e,t,n){"use strict";var r,i,a=n("ZqwW"),s=RegExp.prototype.exec,o=String.prototype.replace,u=s,l=(r=/a/,i=/b*/g,s.call(r,"a"),s.call(i,"a"),0!==r.lastIndex||0!==i.lastIndex),c=void 0!==/()??/.exec("")[1];(l||c)&&(u=function(e){var t,n,r,i,u=this;return c&&(n=new RegExp("^"+u.source+"$(?!\\s)",a.call(u))),l&&(t=u.lastIndex),r=s.call(u,e),l&&r&&(u.lastIndex=u.global?r.index+r[0].length:t),c&&r&&r.length>1&&o.call(r[0],n,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(r[i]=void 0)})),r}),e.exports=u},"4XFX":function(e,t){t.f={}.propertyIsEnumerable},"5/+w":function(e,t,n){"use strict";var r=n("LOhj");function i(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=r(t),this.reject=r(n)}e.exports.f=function(e){return new i(e)}},"5Kf4":function(e,t,n){"use strict";n("5oHw")("sub",(function(e){return function(){return e(this,"sub","","")}}))},"5arV":function(e,t,n){var r=n("138g");e.exports=function(e,t,n,i){try{return i?t(r(n)[0],n[1]):t(n)}catch(t){var a=e.return;throw void 0!==a&&r(a.call(e)),t}}},"5oHw":function(e,t,n){var r=n("8IOi"),i=n("+TcE"),a=n("aI2V"),s=/"/g,o=function(e,t,n,r){var i=String(a(e)),o="<"+t;return""!==n&&(o+=" "+n+'="'+String(r).replace(s,"&quot;")+'"'),o+">"+i+"</"+t+">"};e.exports=function(e,t){var n={};n[e]=t(o),r(r.P+r.F*i((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3})),"String",n)}},"5zUu":function(e,t,n){"use strict";var r=n("8IOi"),i=n("QotP"),a=n("Qu5u"),s=n("Y3Md"),o=n("m29h"),u=n("CkjT");r(r.P,"Array",{flatten:function(){var e=arguments[0],t=a(this),n=s(t.length),r=u(t,0);return i(r,t,t,n,0,void 0===e?1:o(e)),r}}),n("Zrcd")("flatten")},"6+im":function(e,t,n){var r=n("3iRr")("iterator"),i=!1;try{var a=[7][r]();a.return=function(){i=!0},Array.from(a,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;var n=!1;try{var a=[7],s=a[r]();s.next=function(){return{done:n=!0}},a[r]=function(){return s},e(a)}catch(e){}return n}},"64wf":function(e,t,n){"use strict";var r=n("n+hx"),i=n("7WAm"),a=n("3iRr")("hasInstance"),s=Function.prototype;a in s||n("J2HX").f(s,a,{value:function(e){if("function"!=typeof this||!r(e))return!1;if(!r(this.prototype))return e instanceof this;for(;e=i(e);)if(this.prototype===e)return!0;return!1}})},"65rS":function(e,t,n){var r,i,a,s=n("kRpC"),o=n("CdvW"),u=n("dDOX"),l=n("itdZ"),c=n("k+AJ"),d=c.process,h=c.setImmediate,f=c.clearImmediate,p=c.MessageChannel,v=c.Dispatch,m=0,g={},y="onreadystatechange",_=function(){var e=+this;if(g.hasOwnProperty(e)){var t=g[e];delete g[e],t()}},b=function(e){_.call(e.data)};h&&f||(h=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return g[++m]=function(){o("function"==typeof e?e:Function(e),t)},r(m),m},f=function(e){delete g[e]},"process"==n("HC2Y")(d)?r=function(e){d.nextTick(s(_,e,1))}:v&&v.now?r=function(e){v.now(s(_,e,1))}:p?(a=(i=new p).port2,i.port1.onmessage=b,r=s(a.postMessage,a,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(r=function(e){c.postMessage(e+"","*")},c.addEventListener("message",b,!1)):r=y in l("script")?function(e){u.appendChild(l("script")).onreadystatechange=function(){u.removeChild(this),_.call(e)}}:function(e){setTimeout(s(_,e,1),0)}),e.exports={set:h,clear:f}},"67f/":function(e,t,n){var r=n("8IOi"),i=Math.PI/180;r(r.S,"Math",{radians:function(e){return e*i}})},"6T8a":function(e,t,n){var r=n("k+AJ"),i=n("8IOi"),a=n("ZP9f"),s=[].slice,o=/MSIE .\./.test(a),u=function(e){return function(t,n){var r=arguments.length>2,i=!!r&&s.call(arguments,2);return e(r?function(){("function"==typeof t?t:Function(t)).apply(this,i)}:t,n)}};i(i.G+i.B+i.F*o,{setTimeout:u(r.setTimeout),setInterval:u(r.setInterval)})},"6WDs":function(e,t,n){var r=n("m29h"),i=n("aI2V");e.exports=function(e){return function(t,n){var a,s,o=String(i(t)),u=r(n),l=o.length;return u<0||u>=l?e?"":void 0:(a=o.charCodeAt(u))<55296||a>56319||u+1===l||(s=o.charCodeAt(u+1))<56320||s>57343?e?o.charAt(u):a:e?o.slice(u,u+2):s-56320+(a-55296<<10)+65536}}},"6dhg":function(e,t,n){var r=n("8IOi"),i=n("aI2V"),a=n("+TcE"),s=n("abT7"),o="["+s+"]",u=RegExp("^"+o+o+"*"),l=RegExp(o+o+"*$"),c=function(e,t,n){var i={},o=a((function(){return!!s[e]()||"…"!="…"[e]()})),u=i[e]=o?t(d):s[e];n&&(i[n]=u),r(r.P+r.F*o,"String",i)},d=c.trim=function(e,t){return e=String(i(e)),1&t&&(e=e.replace(u,"")),2&t&&(e=e.replace(l,"")),e};e.exports=c},"6uvR":function(e,t,n){var r=n("27JW"),i=n("EN0g"),a=n("138g"),s=n("k+AJ").Reflect;e.exports=s&&s.ownKeys||function(e){var t=r.f(a(e)),n=i.f;return n?t.concat(n(e)):t}},"7WAm":function(e,t,n){var r=n("L7KE"),i=n("Qu5u"),a=n("lk+t")("IE_PROTO"),s=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,a)?e[a]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?s:null}},"7n8s":function(e,t,n){var r=n("jYdD"),i=n("7WAm"),a=n("L7KE"),s=n("8IOi"),o=n("n+hx"),u=n("138g");s(s.S,"Reflect",{get:function e(t,n){var s,l,c=arguments.length<3?t:arguments[2];return u(t)===c?t[n]:(s=r.f(t,n))?a(s,"value")?s.value:void 0!==s.get?s.get.call(c):void 0:o(l=i(t))?e(l,n,c):void 0}})},"86LW":function(e,t,n){(function(t){!function(t){"use strict";var n,r=Object.prototype,i=r.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",o=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag",l="object"==typeof e,c=t.regeneratorRuntime;if(c)l&&(e.exports=c);else{(c=t.regeneratorRuntime=l?e.exports:{}).wrap=b;var d="suspendedStart",h="suspendedYield",f="executing",p="completed",v={},m={};m[s]=function(){return this};var g=Object.getPrototypeOf,y=g&&g(g(I([])));y&&y!==r&&i.call(y,s)&&(m=y);var _=k.prototype=S.prototype=Object.create(m);E.prototype=_.constructor=k,k.constructor=E,k[u]=E.displayName="GeneratorFunction",c.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===E||"GeneratorFunction"===(t.displayName||t.name))},c.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,k):(e.__proto__=k,u in e||(e[u]="GeneratorFunction")),e.prototype=Object.create(_),e},c.awrap=function(e){return{__await:e}},w(C.prototype),C.prototype[o]=function(){return this},c.AsyncIterator=C,c.async=function(e,t,n,r){var i=new C(b(e,t,n,r));return c.isGeneratorFunction(t)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},w(_),_[u]="Generator",_[s]=function(){return this},_.toString=function(){return"[object Generator]"},c.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},c.values=I,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(R),!e)for(var t in this)"t"===t.charAt(0)&&i.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=n)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(r,i){return o.type="throw",o.arg=e,t.next=r,i&&(t.method="next",t.arg=n),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var s=this.tryEntries[a],o=s.completion;if("root"===s.tryLoc)return r("end");if(s.tryLoc<=this.prev){var u=i.call(s,"catchLoc"),l=i.call(s,"finallyLoc");if(u&&l){if(this.prev<s.catchLoc)return r(s.catchLoc,!0);if(this.prev<s.finallyLoc)return r(s.finallyLoc)}else if(u){if(this.prev<s.catchLoc)return r(s.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return r(s.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var a=r;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var s=a?a.completion:{};return s.type=e,s.arg=t,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;R(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:I(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=n),v}}}function b(e,t,n,r){var i=t&&t.prototype instanceof S?t:S,a=Object.create(i.prototype),s=new x(r||[]);return a._invoke=function(e,t,n){var r=d;return function(i,a){if(r===f)throw new Error("Generator is already running");if(r===p){if("throw"===i)throw a;return O()}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var o=A(s,n);if(o){if(o===v)continue;return o}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===d)throw r=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=f;var u=T(e,t,n);if("normal"===u.type){if(r=n.done?p:h,u.arg===v)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=p,n.method="throw",n.arg=u.arg)}}}(e,n,s),a}function T(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function S(){}function E(){}function k(){}function w(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function C(e){function n(t,r,a,s){var o=T(e[t],e,r);if("throw"!==o.type){var u=o.arg,l=u.value;return l&&"object"==typeof l&&i.call(l,"__await")?Promise.resolve(l.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):Promise.resolve(l).then((function(e){u.value=e,a(u)}),s)}s(o.arg)}var r;"object"==typeof t.process&&t.process.domain&&(n=t.process.domain.bind(n)),this._invoke=function(e,t){function i(){return new Promise((function(r,i){n(e,t,r,i)}))}return r=r?r.then(i,i):i()}}function A(e,t){var r=e.iterator[t.method];if(r===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=n,A(e,t),"throw"===t.method))return v;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var i=T(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,v;var a=i.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=n),t.delegate=null,v):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,v)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function I(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,a=function t(){for(;++r<e.length;)if(i.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=n,t.done=!0,t};return a.next=a}}return{next:O}}function O(){return{value:n,done:!0}}}("object"==typeof t?t:"object"==typeof window?window:"object"==typeof self?self:this)}).call(this,n("yLpj"))},"8IOi":function(e,t,n){var r=n("k+AJ"),i=n("CuJi"),a=n("BxPU"),s=n("d+oe"),o=n("kRpC"),u=function(e,t,n){var l,c,d,h,f=e&u.F,p=e&u.G,v=e&u.S,m=e&u.P,g=e&u.B,y=p?r:v?r[t]||(r[t]={}):(r[t]||{}).prototype,_=p?i:i[t]||(i[t]={}),b=_.prototype||(_.prototype={});for(l in p&&(n=t),n)d=((c=!f&&y&&void 0!==y[l])?y:n)[l],h=g&&c?o(d,r):m&&"function"==typeof d?o(Function.call,d):d,y&&s(y,l,d,e&u.U),_[l]!=d&&a(_,l,h),m&&b[l]!=d&&(b[l]=d)};r.core=i,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},"8MIm":function(e,t,n){(e.exports=n("I1BE")(void 0)).push([e.i,'.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-modal-dialog,.vjs-button>.vjs-icon-placeholder:before,.vjs-modal-dialog .vjs-modal-dialog-content{position:absolute;top:0;left:0;width:100%;height:100%}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.vjs-button>.vjs-icon-placeholder:before{text-align:center}@font-face{font-family:VideoJS;src:url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAABDkAAsAAAAAG6gAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAPgAAAFZRiV3hY21hcAAAAYQAAADaAAADPv749/pnbHlmAAACYAAAC3AAABHQZg6OcWhlYWQAAA3QAAAAKwAAADYZw251aGhlYQAADfwAAAAdAAAAJA+RCLFobXR4AAAOHAAAABMAAACM744AAGxvY2EAAA4wAAAASAAAAEhF6kqubWF4cAAADngAAAAfAAAAIAE0AIFuYW1lAAAOmAAAASUAAAIK1cf1oHBvc3QAAA/AAAABJAAAAdPExYuNeJxjYGRgYOBiMGCwY2BycfMJYeDLSSzJY5BiYGGAAJA8MpsxJzM9kYEDxgPKsYBpDiBmg4gCACY7BUgAeJxjYGS7wTiBgZWBgaWQ5RkDA8MvCM0cwxDOeI6BgYmBlZkBKwhIc01hcPjI+FGJHcRdyA4RZgQRADK3CxEAAHic7dFZbsMgAEXRS0ycyZnnOeG7y+qC8pU1dHusIOXxuoxaOlwZYWQB0Aea4quIEN4E9LzKbKjzDeM6H/mua6Lmc/p8yhg0lvdYx15ZG8uOLQOGjMp3EzqmzJizYMmKNRu27Nhz4MiJMxeu3Ljz4Ekqm7T8P52G8PP3lnTOVk++Z6iN6QZzNN1F7ptuN7eGOjDUoaGODHVsuvU8MdTO9Hd5aqgzQ50b6sJQl4a6MtS1oW4MdWuoO0PdG+rBUI+GejLUs6FeDPVqqDdDvRvqw1CfhpqM9At0iFLaAAB4nJ1YDXBTVRZ+5/22TUlJ8we0pHlJm7RJf5O8F2j6EymlSPkpxaL8U2xpa3DKj0CBhc2IW4eWKSokIoLsuMqssM64f+jA4HSdWXXXscBq67IOs3FXZ1ZYWVyRFdo899yXtIBQZ90k7717zz3v3HPPOfd854YCCj9cL9dL0RQFOqCbGJnrHb5EayiKIWN8iA/hWBblo6hUWm8TtCDwE80WMJus/irwyxOdxeB0MDb14VNJHnXYoLLSl6FfCUYO9nYPTA8Epg9090LprfbBbZ2hY0UlJUXHQp3/vtWkS6EBv8+rPMq5u9692f/dNxJNiqwC1xPE9TCUgCsSdQWgE3XQD25lkG4CN2xmTcOXWBOyser6RN6KnGbKSbmQ3+d0OI1m2W8QzLLkI2sykrWAgJJEtA8vGGW/2Q+CmT3n8zS9wZwu2DCvtuZKZN3xkrLh36yCZuUomQSqGpY8t/25VfHVhw8z4ebGBtfLb0ya9PCaDc+8dGTvk2dsh6z7WzvowlXKUSWo9MJ15a3KrEP2loOr2Ojhw6iW6hf2BDdEccQvZGpaAy7YovSwq8kr7HGllxpd71rkS6G0Sf11sl9OvMK1+jwPPODxjUwkOim9CU3ix1wNjXDfmJSEn618Bs6lpWwUpU+8PCqLMY650zjq8VhCIP17NEKTx3eaLL+s5Pi6yJWaWjTHLR1jYzPSV9VF/6Ojdb/1kO3Mk3uhHC0x6gc1BjlKQ+nQFxTYdaJkZ7ySVxLBbhR1dsboNXp1tCYKW2LRaEzpYcIx2BKNxaL0ZaUnSqfFoiNhHKR/GkX6PWUSAaJelQaqZL1EpoHNsajSEyPSoJ9IjhIxTdjHLmwZvhRDOiFTY/YeQnvrVZmiTQtGncECXtFTBZLOVwwMRgoXHAkXzMzPn1nAJJ8jYSbMDaqN2waGLzNhih/bZynUBMpIWSg7VYi7DRx2m8ALkIdRCJwI6ArJx2EI8kaDWeTQKeAFk9fjl/1AvwktjQ1P7NjyMGQyfd4vjipX6M/i52D7Cq80kqlcxEcGXRr/FEcgs0u5uGgB4VWuMFfpdn2Re6Hi3PqzmxWKsz6+ae2Pn9hXXw/fqM859UiGC0oKYYILJBqJrsn1Z1E5qOs9rQCiUQRREjm8yJcbHF5cUJufX1vAHlefw0XgUoboS3ETfQlTxBC4SOtuE8VPRJTBSCQSjZCpk7Gqzu+masaZ2y7Zjehho4F3g82BNDkAHpORG4+OCS+f6JTPmtRn/PH1kch6d04sp7AQb25aQ/pqUyXeQ8vrebG8OYQdXOQ+585u0sdW9rqalzRURiJ+9F4MweRFrKUjl1GUYhH1A27WOHw5cTFSFPMo9EeUIGnQTZHIaJ7AHLaOKsOODaNF9jkBjYG2QEsQ2xjMUAx2bBEbeTBWMHwskBjngq56S/yfgkBnWBa4K9sqKtq2t1UI8S9He5XuBRbawAdatrQEAi30Aks2+LM8WeCbalVZkWNylvJ+dqJnzVb+OHlSoKW8nPCP7Rd+CcZ2DdWAGqJ2CBFOphgywFFCFBNtfAbGtNPBCwxvygHeYMZMY9ZboBqwq/pVrsbgN5tkv152ODlbMfiqwGMBgxa4Exz3QhovRIUp6acqZmQzRq0ypDXS2TPLT02YIkQETnOE445oOGxOmXAqUJNNG7XgupMjPq2ua9asrj5yY/yuKteO1Kx0YNJTufrirLe1mZnat7OL6rnUdCWenpW6I8mAnbsY8KWs1PuSovCW9A/Z25PQ24a7cNOqgmTkLmBMgh4THgc4b9k2IVv1/g/F5nGljwPLfOgHAzJzh45V/4+WenTzmMtR5Z7us2Tys909UHqrPY7KbckoxRvRHhmVc3cJGE97uml0R1S0jdULVl7EvZtDFVBF35N9cEdjpgmAiOlFZ+Dtoh93+D3zzHr8RRNZQhnCNMNbcegOvpEwZoL+06cJQ07h+th3fZ/7PVbVC6ngTAV/KoLFuO6+2KFcU651gEb5ugPSIb1D+Xp8V4+k3sEIGnw5mYe4If4k1lFYr6SCzmM2EQ8iWtmwjnBI9kTwe1TlfAmXh7H02by9fW2gsjKwtv0aaURKil4OdV7rDL1MXIFNrhdxohcZXYTnq47WisrKitaObbf5+yvkLi5J6lCNZZ+B6GC38VNBZBDidSS/+mSvh6s+srgC8pyKMvDtt+de3c9fU76ZPfuM8ud4Kv0fyP/LqfepMT/3oZxSqpZaTa1DaQYLY8TFsHYbWYsPoRhRWfL5eSSQbhUGgGC3YLbVMk6PitTFNGpAsNrC6D1VNBKgBHMejaiuRWEWGgsSDBTJjqWIl8kJLlsaLJ2tXDr6xGfT85bM2Q06a46x2HTgvdnV8z5YDy/27J4zt6x2VtkzjoYpkq36kaBr4eQSg7tyiVweWubXZugtadl58ydapfbORfKsDTuZ0OBgx4cfdjCf5tbWNITnL120fdOi1RV1C3uKGzNdwYLcMvZ3BxoPyTOCD1XvXTp7U10gWCVmTV9b3r2z0SkGWovb2hp9I89O8a2smlyaO8muMU+dRmtzp60IzAoFpjLr1n388boLyf0dRvxhsHZ0qbWqDkwqvvpkj4l0fY6EIXRi5sQSrAvsVYwXRy4qJ2EVtD1AN7a0HWth9ymvL1xc3WTUKK/TAHA/bXDVtVWfOMfuGxGZv4Ln/jVr9jc3j1yMv0tndmyt9Vq88Y9gH1wtLX3KWjot5++jWHgAoZZkQ14wGQ20Fli71UmKJAy4xKMSTGbVdybW7FDDAut9XpD5AzWrYO7zQ8qffqF8+Ynd/clrHcdyxGy3a/3+mfNnzC/cBsveTjnTvXf1o6vzOlZw7WtqtdmPK/Errz/6NNtD72zmNOZfbmYdTGHfoofqI79Oc+R2n1lrnL6pOm0Up7kwxhTW12Amm7WYkXR2qYrF2AmgmbAsxZjwy1xpg/m1Je2vrp8v/nz2xpmlBg4E9hrMU341wVpTOh/OfmGvAnra8q6uctr60ZQHV3Q+WMQJykMj8ZsWn2QBOmmHMB+m5pDIpTFonYigiaKAhGEiAHF7EliVnQkjoLVIMPtJpBKHYd3A8GYH9jJzrWwmHx5Qjp7vDAX0suGRym1vtm/9W1/HyR8vczfMs6Sk8DSv855/5dlX9oQq52hT8syyp2rx5Id17IAyAM3wIjQPMOHzytEB64q6D5zT91yNbnx3V/nqnd017S9Y0605k3izoXLpsxde2n38yoOV9s1LcjwzNjbdX6asnBVaBj/6/DwKwPkpcqbDG7BnsXoSqWnUAmottYF6jMSdVyYZh3zVXCjwTiwwHH6sGuRiEHQGzuRX6whZkp123oy1BWE2mEfJ/tvIRtM4ZM5bDXiMsPMaAKOTyc5uL57rqyyc5y5JE5pm1i2S2iUX0CcaQ6lC6Zog7JqSqZmYlosl2K6pwNA84zRnQW6SaALYZQGW5lhCtU/W34N6o+bKfZ8cf3/Cl/+iTX3wBzpOY4mRkeNf3rptycGSshQWgGbYt5jFc2e0+DglIrwl6DVWQ7BuwaJ3Xk1J4VL5urnLl/Wf+gHU/hZoZdKNym6lG+I34FaNeZKcSpJIo2IeCVvpdsDGfKvzJnAwmeD37Ow65ZWwSowpgwX5T69s/rB55dP5BcpgDKFV8p7q2sn/1uc93bVzT/w6UrCqDTWvfCq/oCD/qZXNoUj8BL5Kp6GU017frfNXkAtiiyf/SOCEeLqnd8R/Ql9GlCRfctS6k5chvIBuQ1zCCjoCHL2DHNHIXxMJ3kQeO8lbsUXONeSfA5EjcG6/E+KdhN4bP04vBhdi883+BFBzQbxFbvZzQeY9LNBZc0FNfn5NwfDn6rCTnTw6R8o+gfpf5hCom33cRuiTlss3KHmZjD+BPN+5gXuA2ziS/Q73mLxUkpbKN/eqwz5uK0X9F3h2d1V4nGNgZGBgAOJd776+iue3+crAzc4AAje5Bfcg0xz9YHEOBiYQBQA8FQlFAHicY2BkYGBnAAGOPgaG//85+hkYGVCBMgBGGwNYAAAAeJxjYGBgYB8EmKOPgQEAQ04BfgAAAAAAAA4AaAB+AMwA4AECAUIBbAGYAcICGAJYArQC4AMwA7AD3gQwBJYE3AUkBWYFigYgBmYGtAbqB1gIEghYCG4IhAi2COh4nGNgZGBgUGYoZWBnAAEmIOYCQgaG/2A+AwAYCQG2AHicXZBNaoNAGIZfE5PQCKFQ2lUps2oXBfOzzAESyDKBQJdGR2NQR3QSSE/QE/QEPUUPUHqsvsrXjTMw83zPvPMNCuAWP3DQDAejdm1GjzwS7pMmwi75XngAD4/CQ/oX4TFe4Qt7uMMbOzjuDc0EmXCP/C7cJ38Iu+RP4QEe8CU8pP8WHmOPX2EPz87TPo202ey2OjlnQSXV/6arOjWFmvszMWtd6CqwOlKHq6ovycLaWMWVydXKFFZnmVFlZU46tP7R2nI5ncbi/dDkfDtFBA2DDXbYkhKc+V0Bqs5Zt9JM1HQGBRTm/EezTmZNKtpcAMs9Yu6AK9caF76zoLWIWcfMGOSkVduvSWechqZsz040Ib2PY3urxBJTzriT95lipz+TN1fmAAAAeJxtkMl2wjAMRfOAhABlKm2h80C3+ajgCKKDY6cegP59TYBzukAL+z1Zsq8ctaJTTKPrsUQLbXQQI0EXKXroY4AbDDHCGBNMcYsZ7nCPB8yxwCOe8IwXvOIN7/jAJ76wxHfUqWX+OzgumWAjJMV17i0Ndlr6irLKO+qftdT7i6y4uFSUvCknay+lFYZIZaQcmfH/xIFdYn98bqhra1aKTM/6lWMnyaYirx1rFUQZFBkb2zJUtoXeJCeg0WnLtHeSFc3OtrnozNwqi0TkSpBMDB1nSde5oJXW23hTS2/T0LilglXX7dmFVxLnq5U0vYATHFk3zX3BOisoQHNDFDeZnqKDy9hRNawN7Vh727hFzcJ5c8TILrKZfH7tIPxAFP0BpLeJPA==) format("woff");font-weight:400;font-style:normal}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-play-control .vjs-icon-placeholder,.vjs-icon-play{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-play-control .vjs-icon-placeholder:before,.vjs-icon-play:before{content:"\\F101"}.vjs-icon-play-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-play-circle:before{content:"\\F102"}.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder,.vjs-icon-pause{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before,.vjs-icon-pause:before{content:"\\F103"}.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder,.vjs-icon-volume-mute{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before,.vjs-icon-volume-mute:before{content:"\\F104"}.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder,.vjs-icon-volume-low{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before,.vjs-icon-volume-low:before{content:"\\F105"}.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder,.vjs-icon-volume-mid{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before,.vjs-icon-volume-mid:before{content:"\\F106"}.video-js .vjs-mute-control .vjs-icon-placeholder,.vjs-icon-volume-high{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control .vjs-icon-placeholder:before,.vjs-icon-volume-high:before{content:"\\F107"}.video-js .vjs-fullscreen-control .vjs-icon-placeholder,.vjs-icon-fullscreen-enter{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-fullscreen-control .vjs-icon-placeholder:before,.vjs-icon-fullscreen-enter:before{content:"\\F108"}.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder,.vjs-icon-fullscreen-exit{font-family:VideoJS;font-weight:400;font-style:normal}.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder:before,.vjs-icon-fullscreen-exit:before{content:"\\F109"}.vjs-icon-square{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-square:before{content:"\\F10A"}.vjs-icon-spinner{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-spinner:before{content:"\\F10B"}.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js .vjs-subs-caps-button .vjs-icon-placeholder,.video-js .vjs-subtitles-button .vjs-icon-placeholder,.vjs-icon-subtitles{font-family:VideoJS;font-weight:400;font-style:normal}.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js .vjs-subtitles-button .vjs-icon-placeholder:before,.vjs-icon-subtitles:before{content:"\\F10C"}.video-js .vjs-captions-button .vjs-icon-placeholder,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder,.vjs-icon-captions{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-captions-button .vjs-icon-placeholder:before,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder:before,.vjs-icon-captions:before{content:"\\F10D"}.video-js .vjs-chapters-button .vjs-icon-placeholder,.vjs-icon-chapters{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-chapters-button .vjs-icon-placeholder:before,.vjs-icon-chapters:before{content:"\\F10E"}.vjs-icon-share{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-share:before{content:"\\F10F"}.vjs-icon-cog{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cog:before{content:"\\F110"}.video-js .vjs-play-progress,.video-js .vjs-volume-level,.vjs-icon-circle,.vjs-seek-to-live-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-play-progress:before,.video-js .vjs-volume-level:before,.vjs-icon-circle:before,.vjs-seek-to-live-control .vjs-icon-placeholder:before{content:"\\F111"}.vjs-icon-circle-outline{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-outline:before{content:"\\F112"}.vjs-icon-circle-inner-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-inner-circle:before{content:"\\F113"}.vjs-icon-hd{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-hd:before{content:"\\F114"}.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder,.vjs-icon-cancel{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder:before,.vjs-icon-cancel:before{content:"\\F115"}.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder,.vjs-icon-replay{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before,.vjs-icon-replay:before{content:"\\F116"}.vjs-icon-facebook{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-facebook:before{content:"\\F117"}.vjs-icon-gplus{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-gplus:before{content:"\\F118"}.vjs-icon-linkedin{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-linkedin:before{content:"\\F119"}.vjs-icon-twitter{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-twitter:before{content:"\\F11A"}.vjs-icon-tumblr{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-tumblr:before{content:"\\F11B"}.vjs-icon-pinterest{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-pinterest:before{content:"\\F11C"}.video-js .vjs-descriptions-button .vjs-icon-placeholder,.vjs-icon-audio-description{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-descriptions-button .vjs-icon-placeholder:before,.vjs-icon-audio-description:before{content:"\\F11D"}.video-js .vjs-audio-button .vjs-icon-placeholder,.vjs-icon-audio{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-audio-button .vjs-icon-placeholder:before,.vjs-icon-audio:before{content:"\\F11E"}.vjs-icon-next-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-next-item:before{content:"\\F11F"}.vjs-icon-previous-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-previous-item:before{content:"\\F120"}.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder,.vjs-icon-picture-in-picture-enter{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder:before,.vjs-icon-picture-in-picture-enter:before{content:"\\F121"}.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder,.vjs-icon-picture-in-picture-exit{font-family:VideoJS;font-weight:400;font-style:normal}.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder:before,.vjs-icon-picture-in-picture-exit:before{content:"\\F122"}.video-js{display:block;vertical-align:top;box-sizing:border-box;color:#fff;background-color:#000;position:relative;padding:0;font-size:10px;line-height:1;font-weight:400;font-style:normal;font-family:Arial,Helvetica,sans-serif;word-break:normal}.video-js:-moz-full-screen{position:absolute}.video-js:-webkit-full-screen{width:100%!important;height:100%!important}.video-js[tabindex="-1"]{outline:none}.video-js *,.video-js :after,.video-js :before{box-sizing:inherit}.video-js ul{font-family:inherit;font-size:inherit;line-height:inherit;list-style-position:outside;margin:0}.video-js.vjs-4-3,.video-js.vjs-16-9,.video-js.vjs-fluid{width:100%;max-width:100%;height:0}.video-js.vjs-16-9{padding-top:56.25%}.video-js.vjs-4-3{padding-top:75%}.video-js.vjs-fill,.video-js .vjs-tech{width:100%;height:100%}.video-js .vjs-tech{position:absolute;top:0;left:0}body.vjs-full-window{padding:0;margin:0;height:100%}.vjs-full-window .video-js.vjs-fullscreen{position:fixed;overflow:hidden;z-index:1000;left:0;top:0;bottom:0;right:0}.video-js.vjs-fullscreen{width:100%!important;height:100%!important;padding-top:0!important}.video-js.vjs-fullscreen.vjs-user-inactive{cursor:none}.vjs-hidden{display:none!important}.vjs-disabled{opacity:.5;cursor:default}.video-js .vjs-offscreen{height:1px;left:-9999px;position:absolute;top:0;width:1px}.vjs-lock-showing{display:block!important;opacity:1;visibility:visible}.vjs-no-js{padding:20px;color:#fff;background-color:#000;font-size:18px;font-family:Arial,Helvetica,sans-serif;text-align:center;width:300px;height:150px;margin:0 auto}.vjs-no-js a,.vjs-no-js a:visited{color:#66a8cc}.video-js .vjs-big-play-button{font-size:3em;line-height:1.5em;height:1.63332em;width:3em;display:block;position:absolute;top:10px;left:10px;padding:0;cursor:pointer;opacity:1;border:.06666em solid #fff;background-color:#2b333f;background-color:rgba(43,51,63,.7);border-radius:.3em;transition:all .4s}.vjs-big-play-centered .vjs-big-play-button{top:50%;left:50%;margin-top:-.81666em;margin-left:-1.5em}.video-js .vjs-big-play-button:focus,.video-js:hover .vjs-big-play-button{border-color:#fff;background-color:#73859f;background-color:rgba(115,133,159,.5);transition:all 0s}.vjs-controls-disabled .vjs-big-play-button,.vjs-error .vjs-big-play-button,.vjs-has-started .vjs-big-play-button,.vjs-using-native-controls .vjs-big-play-button{display:none}.vjs-has-started.vjs-paused.vjs-show-big-play-button-on-pause .vjs-big-play-button{display:block}.video-js button{background:none;border:none;color:inherit;display:inline-block;font-size:inherit;line-height:inherit;text-transform:none;text-decoration:none;transition:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.vjs-control .vjs-button{width:100%;height:100%}.video-js .vjs-control.vjs-close-button{cursor:pointer;height:3em;position:absolute;right:0;top:.5em;z-index:2}.video-js .vjs-modal-dialog{background:rgba(0,0,0,.8);background:linear-gradient(180deg,rgba(0,0,0,.8),hsla(0,0%,100%,0));overflow:auto}.video-js .vjs-modal-dialog>*{box-sizing:border-box}.vjs-modal-dialog .vjs-modal-dialog-content{font-size:1.2em;line-height:1.5;padding:20px 24px;z-index:1}.vjs-menu-button{cursor:pointer}.vjs-menu-button.vjs-disabled{cursor:default}.vjs-workinghover .vjs-menu-button.vjs-disabled:hover .vjs-menu{display:none}.vjs-menu .vjs-menu-content{display:block;padding:0;margin:0;font-family:Arial,Helvetica,sans-serif;overflow:auto}.vjs-menu .vjs-menu-content>*{box-sizing:border-box}.vjs-scrubbing .vjs-control.vjs-menu-button:hover .vjs-menu{display:none}.vjs-menu li{list-style:none;margin:0;padding:.2em 0;line-height:1.4em;font-size:1.2em;text-align:center;text-transform:lowercase}.js-focus-visible .vjs-menu li.vjs-menu-item:hover,.vjs-menu li.vjs-menu-item:focus,.vjs-menu li.vjs-menu-item:hover{background-color:#73859f;background-color:rgba(115,133,159,.5)}.js-focus-visible .vjs-menu li.vjs-selected:hover,.vjs-menu li.vjs-selected,.vjs-menu li.vjs-selected:focus,.vjs-menu li.vjs-selected:hover{background-color:#fff;color:#2b333f}.vjs-menu li.vjs-menu-title{text-align:center;text-transform:uppercase;font-size:1em;line-height:2em;padding:0;margin:0 0 .3em;font-weight:700;cursor:default}.vjs-menu-button-popup .vjs-menu{display:none;position:absolute;bottom:0;width:10em;left:-3em;height:0;margin-bottom:1.5em;border-top-color:rgba(43,51,63,.7)}.vjs-menu-button-popup .vjs-menu .vjs-menu-content{background-color:#2b333f;background-color:rgba(43,51,63,.7);position:absolute;width:100%;bottom:1.5em;max-height:15em}.vjs-layout-tiny .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:5em}.vjs-layout-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:10em}.vjs-layout-medium .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:14em}.vjs-layout-huge .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:25em}.vjs-menu-button-popup .vjs-menu.vjs-lock-showing,.vjs-workinghover .vjs-menu-button-popup.vjs-hover .vjs-menu{display:block}.video-js .vjs-menu-button-inline{transition:all .4s;overflow:hidden}.video-js .vjs-menu-button-inline:before{width:2.222222222em}.video-js .vjs-menu-button-inline.vjs-slider-active,.video-js .vjs-menu-button-inline:focus,.video-js .vjs-menu-button-inline:hover,.video-js.vjs-no-flex .vjs-menu-button-inline{width:12em}.vjs-menu-button-inline .vjs-menu{opacity:0;height:100%;width:auto;position:absolute;left:4em;top:0;padding:0;margin:0;transition:all .4s}.vjs-menu-button-inline.vjs-slider-active .vjs-menu,.vjs-menu-button-inline:focus .vjs-menu,.vjs-menu-button-inline:hover .vjs-menu{display:block;opacity:1}.vjs-no-flex .vjs-menu-button-inline .vjs-menu{display:block;opacity:1;position:relative;width:auto}.vjs-no-flex .vjs-menu-button-inline.vjs-slider-active .vjs-menu,.vjs-no-flex .vjs-menu-button-inline:focus .vjs-menu,.vjs-no-flex .vjs-menu-button-inline:hover .vjs-menu{width:auto}.vjs-menu-button-inline .vjs-menu-content{width:auto;height:100%;margin:0;overflow:hidden}.video-js .vjs-control-bar{display:none;width:100%;position:absolute;bottom:0;left:0;right:0;height:3em;background-color:#2b333f;background-color:rgba(43,51,63,.7)}.vjs-has-started .vjs-control-bar{display:flex;visibility:visible;opacity:1;transition:visibility .1s,opacity .1s}.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{visibility:visible;opacity:0;transition:visibility 1s,opacity 1s}.vjs-controls-disabled .vjs-control-bar,.vjs-error .vjs-control-bar,.vjs-using-native-controls .vjs-control-bar{display:none!important}.vjs-audio.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{opacity:1;visibility:visible}.vjs-has-started.vjs-no-flex .vjs-control-bar{display:table}.video-js .vjs-control{position:relative;text-align:center;margin:0;padding:0;height:100%;width:4em;flex:none}.vjs-button>.vjs-icon-placeholder:before{font-size:1.8em;line-height:1.67}.video-js .vjs-control:focus,.video-js .vjs-control:focus:before,.video-js .vjs-control:hover:before{text-shadow:0 0 1em #fff}.video-js .vjs-control-text{border:0;clip:rect(0 0 0 0);height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.vjs-no-flex .vjs-control{display:table-cell;vertical-align:middle}.video-js .vjs-custom-control-spacer{display:none}.video-js .vjs-progress-control{cursor:pointer;flex:auto;display:flex;align-items:center;min-width:4em;touch-action:none}.video-js .vjs-progress-control.disabled{cursor:default}.vjs-live .vjs-progress-control{display:none}.vjs-liveui .vjs-progress-control{display:flex;align-items:center}.vjs-no-flex .vjs-progress-control{width:auto}.video-js .vjs-progress-holder{flex:auto;transition:all .2s;height:.3em}.video-js .vjs-progress-control .vjs-progress-holder{margin:0 10px}.video-js .vjs-progress-control:hover .vjs-progress-holder{font-size:1.6666666667em}.video-js .vjs-progress-control:hover .vjs-progress-holder.disabled{font-size:1em}.video-js .vjs-progress-holder .vjs-load-progress,.video-js .vjs-progress-holder .vjs-load-progress div,.video-js .vjs-progress-holder .vjs-play-progress{position:absolute;display:block;height:100%;margin:0;padding:0;width:0}.video-js .vjs-play-progress{background-color:#fff}.video-js .vjs-play-progress:before{font-size:.9em;position:absolute;right:-.5em;top:-.3333333333em;z-index:1}.video-js .vjs-load-progress{background:rgba(115,133,159,.5)}.video-js .vjs-load-progress div{background:rgba(115,133,159,.75)}.video-js .vjs-time-tooltip{background-color:#fff;background-color:hsla(0,0%,100%,.8);border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-progress-holder:focus .vjs-time-tooltip{display:none}.video-js .vjs-progress-control:hover .vjs-progress-holder:focus .vjs-time-tooltip,.video-js .vjs-progress-control:hover .vjs-time-tooltip{display:block;font-size:.6em;visibility:visible}.video-js .vjs-progress-control.disabled:hover .vjs-time-tooltip{font-size:1em}.video-js .vjs-progress-control .vjs-mouse-display{display:none;position:absolute;width:1px;height:100%;background-color:#000;z-index:1}.vjs-no-flex .vjs-progress-control .vjs-mouse-display{z-index:0}.video-js .vjs-progress-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-progress-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.video-js.vjs-user-inactive.vjs-no-flex .vjs-progress-control .vjs-mouse-display{display:none}.vjs-mouse-display .vjs-time-tooltip{color:#fff;background-color:#000;background-color:rgba(0,0,0,.8)}.video-js .vjs-slider{position:relative;cursor:pointer;padding:0;margin:0 .45em;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#73859f;background-color:rgba(115,133,159,.5)}.video-js .vjs-slider.disabled{cursor:default}.video-js .vjs-slider:focus{text-shadow:0 0 1em #fff;box-shadow:0 0 1em #fff}.video-js .vjs-mute-control{cursor:pointer;flex:none}.video-js .vjs-volume-control{cursor:pointer;margin-right:1em;display:flex}.video-js .vjs-volume-control.vjs-volume-horizontal{width:5em}.video-js .vjs-volume-panel .vjs-volume-control{visibility:visible;opacity:0;width:1px;height:1px;margin-left:-1px}.video-js .vjs-volume-panel{transition:width 1s}.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control,.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control,.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active,.video-js .vjs-volume-panel .vjs-volume-control:active,.video-js .vjs-volume-panel:active .vjs-volume-control,.video-js .vjs-volume-panel:focus .vjs-volume-control{visibility:visible;opacity:1;position:relative;transition:visibility .1s,opacity .1s,height .1s,width .1s,left 0s,top 0s}.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-horizontal,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-horizontal,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-horizontal{width:5em;height:3em}.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-vertical,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-vertical,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-vertical{left:-3.5em;transition:left 0s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal:active{width:9em;transition:width .1s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-mute-toggle-only{width:4em}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical{height:8em;width:3em;left:-3000em;transition:visibility 1s,opacity 1s,height 1s 1s,width 1s 1s,left 1s 1s,top 1s 1s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal{transition:visibility 1s,opacity 1s,height 1s 1s,width 1s,left 1s 1s,top 1s 1s}.video-js.vjs-no-flex .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal{width:5em;height:3em;visibility:visible;opacity:1;position:relative;transition:none}.video-js.vjs-no-flex .vjs-volume-control.vjs-volume-vertical,.video-js.vjs-no-flex .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical{position:absolute;bottom:3em;left:.5em}.video-js .vjs-volume-panel{display:flex}.video-js .vjs-volume-bar{margin:1.35em .45em}.vjs-volume-bar.vjs-slider-horizontal{width:5em;height:.3em}.vjs-volume-bar.vjs-slider-vertical{width:.3em;height:5em;margin:1.35em auto}.video-js .vjs-volume-level{position:absolute;bottom:0;left:0;background-color:#fff}.video-js .vjs-volume-level:before{position:absolute;font-size:.9em}.vjs-slider-vertical .vjs-volume-level{width:.3em}.vjs-slider-vertical .vjs-volume-level:before{top:-.5em;left:-.3em}.vjs-slider-horizontal .vjs-volume-level{height:.3em}.vjs-slider-horizontal .vjs-volume-level:before{top:-.3em;right:-.5em}.video-js .vjs-volume-panel.vjs-volume-panel-vertical{width:4em}.vjs-volume-bar.vjs-slider-vertical .vjs-volume-level{height:100%}.vjs-volume-bar.vjs-slider-horizontal .vjs-volume-level{width:100%}.video-js .vjs-volume-vertical{width:3em;height:8em;bottom:8em;background-color:#2b333f;background-color:rgba(43,51,63,.7)}.video-js .vjs-volume-horizontal .vjs-menu{left:-2em}.vjs-poster{display:inline-block;vertical-align:middle;background-repeat:no-repeat;background-position:50% 50%;background-size:contain;background-color:#000;cursor:pointer;margin:0;padding:0;position:absolute;top:0;right:0;bottom:0;left:0;height:100%}.vjs-has-started .vjs-poster{display:none}.vjs-audio.vjs-has-started .vjs-poster{display:block}.vjs-using-native-controls .vjs-poster{display:none}.video-js .vjs-live-control{display:flex;align-items:flex-start;flex:auto;font-size:1em;line-height:3em}.vjs-no-flex .vjs-live-control{display:table-cell;width:auto;text-align:left}.video-js.vjs-liveui .vjs-live-control,.video-js:not(.vjs-live) .vjs-live-control{display:none}.video-js .vjs-seek-to-live-control{cursor:pointer;flex:none;display:inline-flex;height:100%;padding-left:.5em;padding-right:.5em;font-size:1em;line-height:3em;width:auto;min-width:4em}.vjs-no-flex .vjs-seek-to-live-control{display:table-cell;width:auto;text-align:left}.video-js.vjs-live:not(.vjs-liveui) .vjs-seek-to-live-control,.video-js:not(.vjs-live) .vjs-seek-to-live-control{display:none}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge{cursor:auto}.vjs-seek-to-live-control .vjs-icon-placeholder{margin-right:.5em;color:#888}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-icon-placeholder{color:red}.video-js .vjs-time-control{flex:none;font-size:1em;line-height:3em;min-width:2em;width:auto;padding-left:1em;padding-right:1em}.video-js .vjs-current-time,.video-js .vjs-duration,.vjs-live .vjs-time-control,.vjs-no-flex .vjs-current-time,.vjs-no-flex .vjs-duration{display:none}.vjs-time-divider{display:none;line-height:3em}.vjs-live .vjs-time-divider{display:none}.video-js .vjs-play-control{cursor:pointer}.video-js .vjs-play-control .vjs-icon-placeholder{flex:none}.vjs-text-track-display{position:absolute;bottom:3em;left:0;right:0;top:0;pointer-events:none}.video-js.vjs-user-inactive.vjs-playing .vjs-text-track-display{bottom:1em}.video-js .vjs-text-track{font-size:1.4em;text-align:center;margin-bottom:.1em}.vjs-subtitles{color:#fff}.vjs-captions{color:#fc6}.vjs-tt-cue{display:block}video::-webkit-media-text-track-display{transform:translateY(-3em)}.video-js.vjs-user-inactive.vjs-playing video::-webkit-media-text-track-display{transform:translateY(-1.5em)}.video-js .vjs-fullscreen-control,.video-js .vjs-picture-in-picture-control{cursor:pointer;flex:none}.vjs-playback-rate .vjs-playback-rate-value,.vjs-playback-rate>.vjs-menu-button{position:absolute;top:0;left:0;width:100%;height:100%}.vjs-playback-rate .vjs-playback-rate-value{pointer-events:none;font-size:1.5em;line-height:2;text-align:center}.vjs-playback-rate .vjs-menu{width:4em;left:0}.vjs-error .vjs-error-display .vjs-modal-dialog-content{font-size:1.4em;text-align:center}.vjs-error .vjs-error-display:before{color:#fff;content:"X";font-family:Arial,Helvetica,sans-serif;font-size:4em;left:0;line-height:1;margin-top:-.5em;position:absolute;text-shadow:.05em .05em .1em #000;text-align:center;top:50%;vertical-align:middle;width:100%}.vjs-loading-spinner{display:none;position:absolute;top:50%;left:50%;margin:-25px 0 0 -25px;opacity:.85;text-align:left;border:6px solid rgba(43,51,63,.7);box-sizing:border-box;background-clip:padding-box;width:50px;height:50px;border-radius:25px;visibility:hidden}.vjs-seeking .vjs-loading-spinner,.vjs-waiting .vjs-loading-spinner{display:block;-webkit-animation:vjs-spinner-show 0s linear .3s forwards;animation:vjs-spinner-show 0s linear .3s forwards}.vjs-loading-spinner:after,.vjs-loading-spinner:before{content:"";position:absolute;margin:-6px;box-sizing:inherit;width:inherit;height:inherit;border-radius:inherit;opacity:1;border:inherit;border-color:transparent;border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:after,.vjs-seeking .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:before{-webkit-animation:vjs-spinner-spin 1.1s cubic-bezier(.6,.2,0,.8) infinite,vjs-spinner-fade 1.1s linear infinite;animation:vjs-spinner-spin 1.1s cubic-bezier(.6,.2,0,.8) infinite,vjs-spinner-fade 1.1s linear infinite}.vjs-seeking .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:before{border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:after{border-top-color:#fff;-webkit-animation-delay:.44s;animation-delay:.44s}@keyframes vjs-spinner-show{to{visibility:visible}}@-webkit-keyframes vjs-spinner-show{to{visibility:visible}}@keyframes vjs-spinner-spin{to{transform:rotate(1turn)}}@-webkit-keyframes vjs-spinner-spin{to{-webkit-transform:rotate(1turn)}}@keyframes vjs-spinner-fade{0%{border-top-color:#73859f}20%{border-top-color:#73859f}35%{border-top-color:#fff}60%{border-top-color:#73859f}to{border-top-color:#73859f}}@-webkit-keyframes vjs-spinner-fade{0%{border-top-color:#73859f}20%{border-top-color:#73859f}35%{border-top-color:#fff}60%{border-top-color:#73859f}to{border-top-color:#73859f}}.vjs-chapters-button .vjs-menu ul{width:24em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:"\\F10D";font-size:1.5em;line-height:inherit}.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:" \\F11D";font-size:1.5em;line-height:inherit}.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-audio-button,.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-captions-button,.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-chapters-button,.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-current-time,.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-descriptions-button,.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-duration,.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-playback-rate,.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-remaining-time,.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-subtitles-button,.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-time-divider,.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-volume-control,.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-audio-button,.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-captions-button,.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-chapters-button,.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-current-time,.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-descriptions-button,.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-duration,.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-playback-rate,.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-remaining-time,.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-subtitles-button,.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-time-divider,.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-volume-control,.video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-audio-button,.video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-captions-button,.video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-chapters-button,.video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-current-time,.video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-descriptions-button,.video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-duration,.video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-playback-rate,.video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-remaining-time,.video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-subtitles-button,.video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-time-divider,.video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-volume-control{display:none}.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover{width:auto}.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-subs-caps-button,.video-js:not(.vjs-fullscreen).vjs-layout-x-small:not(.vjs-live) .vjs-subs-caps-button,.video-js:not(.vjs-fullscreen).vjs-layout-x-small:not(.vjs-liveui) .vjs-subs-caps-button{display:none}.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-custom-control-spacer,.video-js:not(.vjs-fullscreen).vjs-layout-x-small.vjs-liveui .vjs-custom-control-spacer{flex:auto;display:block}.video-js:not(.vjs-fullscreen).vjs-layout-tiny.vjs-no-flex .vjs-custom-control-spacer,.video-js:not(.vjs-fullscreen).vjs-layout-x-small.vjs-liveui.vjs-no-flex .vjs-custom-control-spacer{width:auto}.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-progress-control,.video-js:not(.vjs-fullscreen).vjs-layout-x-small.vjs-liveui .vjs-progress-control{display:none}.vjs-modal-dialog.vjs-text-track-settings{background-color:#2b333f;background-color:rgba(43,51,63,.75);color:#fff;height:70%}.vjs-text-track-settings .vjs-modal-dialog-content{display:table}.vjs-text-track-settings .vjs-track-settings-colors,.vjs-text-track-settings .vjs-track-settings-controls,.vjs-text-track-settings .vjs-track-settings-font{display:table-cell}.vjs-text-track-settings .vjs-track-settings-controls{text-align:right;vertical-align:bottom}@supports (display:grid){.vjs-text-track-settings .vjs-modal-dialog-content{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr;padding:20px 24px 0}.vjs-track-settings-controls .vjs-default-button{margin-bottom:20px}.vjs-text-track-settings .vjs-track-settings-controls{grid-column:1/-1}.vjs-layout-small .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-tiny .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-x-small .vjs-text-track-settings .vjs-modal-dialog-content{grid-template-columns:1fr}}.vjs-track-setting>select{margin-right:1em;margin-bottom:.5em}.vjs-text-track-settings fieldset{margin:5px;padding:3px;border:none}.vjs-text-track-settings fieldset span{display:inline-block}.vjs-text-track-settings fieldset span>select{max-width:7.3em}.vjs-text-track-settings legend{color:#fff;margin:0 0 5px}.vjs-text-track-settings .vjs-label{position:absolute;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px);display:block;margin:0 0 5px;padding:0;border:0;height:1px;width:1px;overflow:hidden}.vjs-track-settings-controls button:active,.vjs-track-settings-controls button:focus{outline-style:solid;outline-width:medium;background-image:linear-gradient(0deg,#fff 88%,#73859f)}.vjs-track-settings-controls button:hover{color:rgba(43,51,63,.75)}.vjs-track-settings-controls button{background-color:#fff;background-image:linear-gradient(-180deg,#fff 88%,#73859f);color:#2b333f;cursor:pointer;border-radius:2px}.vjs-track-settings-controls .vjs-default-button{margin-right:1em}@media print{.video-js>:not(.vjs-tech):not(.vjs-poster){visibility:hidden}}.vjs-resize-manager{position:absolute;top:0;left:0;width:100%;height:100%;border:none;z-index:-1000}.js-focus-visible .video-js :focus:not(.focus-visible),.video-js .vjs-menu :focus:not(:focus-visible),.video-js :focus:not(:focus-visible){outline:none;background:none}',""])},"8eWk":function(e,t,n){var r=n("LboF"),i=n("qFNJ");"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.i,i,""]]);var a={insert:"head",singleton:!1};r(i,a);e.exports=i.locals||{}},"8oxB":function(e,t){var n,r,i=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function o(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(e){r=s}}();var u,l=[],c=!1,d=-1;function h(){c&&u&&(c=!1,u.length?l=u.concat(l):d=-1,l.length&&f())}function f(){if(!c){var e=o(h);c=!0;for(var t=l.length;t;){for(u=l,l=[];++d<t;)u&&u[d].run();d=-1,t=l.length}u=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function v(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new p(e,t)),1!==l.length||c||o(f)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},"8wjV":function(e,t,n){for(var r,i=n("k+AJ"),a=n("BxPU"),s=n("Vol4"),o=s("typed_array"),u=s("view"),l=!(!i.ArrayBuffer||!i.DataView),c=l,d=0,h="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");d<9;)(r=i[h[d++]])?(a(r.prototype,o,!0),a(r.prototype,u,!0)):c=!1;e.exports={ABV:l,CONSTR:c,TYPED:o,VIEW:u}},"94c5":function(e,t,n){"use strict";n("5oHw")("small",(function(e){return function(){return e(this,"small","","")}}))},"9BWX":function(e,t,n){n("Gx54")("Int16",2,(function(e){return function(t,n,r){return e(this,t,n,r)}}))},"9Yzx":function(e,t,n){"use strict";var r=n("6WDs")(!0);n("1RbY")(String,"String",(function(e){this._t=String(e),this._i=0}),(function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})}))},AK2K:function(e,t,n){"use strict";var r=n("8IOi"),i=n("Y3Md"),a=n("RT9V"),s="startsWith",o="".startsWith;r(r.P+r.F*n("OvvV")(s),"String",{startsWith:function(e){var t=a(this,e,s),n=i(Math.min(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return o?o.call(t,r,n):t.slice(n,n+r.length)===r}})},AZ8a:function(e,t,n){var r=n("n+hx");e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},Agm5:function(e,t,n){"use strict";var r=n("8IOi"),i=n("z/zB")(2);r(r.P+r.F*!n("Vcfr")([].filter,!0),"Array",{filter:function(e){return i(this,e,arguments[1])}})},Au75:function(e,t,n){"use strict";var r=n("LOhj"),i=n("n+hx"),a=n("CdvW"),s=[].slice,o={},u=function(e,t,n){if(!(t in o)){for(var r=[],i=0;i<t;i++)r[i]="a["+i+"]";o[t]=Function("F,a","return new F("+r.join(",")+")")}return o[t](e,n)};e.exports=Function.bind||function(e){var t=r(this),n=s.call(arguments,1),o=function(){var r=n.concat(s.call(arguments));return this instanceof o?u(t,r.length,r):a(t,r,e)};return i(t.prototype)&&(o.prototype=t.prototype),o}},AvcM:function(e,t,n){n("yU77")&&"g"!=/./g.flags&&n("J2HX").f(RegExp.prototype,"flags",{configurable:!0,get:n("ZqwW")})},B28f:function(e,t,n){"use strict";var r=n("138g"),i=n("qHvq"),a=n("/vim");n("ntFk")("search",1,(function(e,t,n,s){return[function(n){var r=e(this),i=null==n?void 0:n[t];return void 0!==i?i.call(n,r):new RegExp(n)[t](String(r))},function(e){var t=s(n,e,this);if(t.done)return t.value;var o=r(e),u=String(this),l=o.lastIndex;i(l,0)||(o.lastIndex=0);var c=a(o,u);return i(o.lastIndex,l)||(o.lastIndex=l),null===c?-1:c.index}]}))},BPp8:function(e,t,n){for(var r=n("IdBN"),i=n("Wl3L"),a=n("d+oe"),s=n("k+AJ"),o=n("BxPU"),u=n("wFMk"),l=n("3iRr"),c=l("iterator"),d=l("toStringTag"),h=u.Array,f={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},p=i(f),v=0;v<p.length;v++){var m,g=p[v],y=f[g],_=s[g],b=_&&_.prototype;if(b&&(b[c]||o(b,c,h),b[d]||o(b,d,g),u[g]=h,y))for(m in r)b[m]||a(b,m,r[m],!0)}},BjUW:function(e,t,n){var r=n("n+hx");n("CmYC")("isFrozen",(function(e){return function(t){return!r(t)||!!e&&e(t)}}))},Bmui:function(e,t,n){var r=n("8IOi");r(r.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},BuMk:function(e,t,n){n("Gx54")("Int32",4,(function(e){return function(t,n,r){return e(this,t,n,r)}}))},BxPU:function(e,t,n){var r=n("J2HX"),i=n("+zL4");e.exports=n("yU77")?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},C2di:function(e,t,n){"use strict";var r=n("8IOi"),i=n("aI2V"),a=n("Y3Md"),s=n("N6L2"),o=n("ZqwW"),u=RegExp.prototype,l=function(e,t){this._r=e,this._s=t};n("atpN")(l,"RegExp String",(function(){var e=this._r.exec(this._s);return{value:e,done:null===e}})),r(r.P,"String",{matchAll:function(e){if(i(this),!s(e))throw TypeError(e+" is not a regexp!");var t=String(this),n="flags"in u?String(e.flags):o.call(e),r=new RegExp(e.source,~n.indexOf("g")?n:"g"+n);return r.lastIndex=a(e.lastIndex),new l(r,t)}})},C6Ke:function(e,t,n){"use strict";var r=n("Qu5u"),i=n("b8c2"),a=n("Y3Md");e.exports=function(e){for(var t=r(this),n=a(t.length),s=arguments.length,o=i(s>1?arguments[1]:void 0,n),u=s>2?arguments[2]:void 0,l=void 0===u?n:i(u,n);l>o;)t[o++]=e;return t}},C74u:function(e,t,n){"use strict";var r=n("138g"),i=n("Qu5u"),a=n("Y3Md"),s=n("m29h"),o=n("aXKq"),u=n("/vim"),l=Math.max,c=Math.min,d=Math.floor,h=/\$([$&`']|\d\d?|<[^>]*>)/g,f=/\$([$&`']|\d\d?)/g;n("ntFk")("replace",2,(function(e,t,n,p){return[function(r,i){var a=e(this),s=null==r?void 0:r[t];return void 0!==s?s.call(r,a,i):n.call(String(a),r,i)},function(e,t){var i=p(n,e,this,t);if(i.done)return i.value;var d=r(e),h=String(this),f="function"==typeof t;f||(t=String(t));var m=d.global;if(m){var g=d.unicode;d.lastIndex=0}for(var y=[];;){var _=u(d,h);if(null===_)break;if(y.push(_),!m)break;""===String(_[0])&&(d.lastIndex=o(h,a(d.lastIndex),g))}for(var b,T="",S=0,E=0;E<y.length;E++){_=y[E];for(var k=String(_[0]),w=l(c(s(_.index),h.length),0),C=[],A=1;A<_.length;A++)C.push(void 0===(b=_[A])?b:String(b));var L=_.groups;if(f){var R=[k].concat(C,w,h);void 0!==L&&R.push(L);var x=String(t.apply(void 0,R))}else x=v(k,h,w,C,L,t);w>=S&&(T+=h.slice(S,w)+x,S=w+k.length)}return T+h.slice(S)}];function v(e,t,r,a,s,o){var u=r+e.length,l=a.length,c=f;return void 0!==s&&(s=i(s),c=h),n.call(o,c,(function(n,i){var o;switch(i.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,r);case"'":return t.slice(u);case"<":o=s[i.slice(1,-1)];break;default:var c=+i;if(0===c)return n;if(c>l){var h=d(c/10);return 0===h?n:h<=l?void 0===a[h-1]?i.charAt(1):a[h-1]+i.charAt(1):n}o=a[c-1]}return void 0===o?"":o}))}}))},CCGS:function(e,t,n){"use strict";var r=n("8IOi"),i=n("LOhj"),a=n("Qu5u"),s=n("+TcE"),o=[].sort,u=[1,2,3];r(r.P+r.F*(s((function(){u.sort(void 0)}))||!s((function(){u.sort(null)}))||!n("Vcfr")(o)),"Array",{sort:function(e){return void 0===e?o.call(a(this)):o.call(a(this),i(e))}})},CEB3:function(e,t,n){n("Gx54")("Uint32",4,(function(e){return function(t,n,r){return e(this,t,n,r)}}))},CFo0:function(e,t,n){var r=n("8IOi");r(r.S,"Math",{clamp:function(e,t,n){return Math.min(n,Math.max(t,e))}})},CL8V:function(e,t,n){"use strict";n("5oHw")("link",(function(e){return function(t){return e(this,"a","href",t)}}))},CdvW:function(e,t){e.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},CkjT:function(e,t,n){var r=n("gyzL");e.exports=function(e,t){return new(r(e))(t)}},CmYC:function(e,t,n){var r=n("8IOi"),i=n("CuJi"),a=n("+TcE");e.exports=function(e,t){var n=(i.Object||{})[e]||Object[e],s={};s[e]=t(n),r(r.S+r.F*a((function(){n(1)})),"Object",s)}},CuJi:function(e,t){var n=e.exports={version:"2.6.5"};"number"==typeof __e&&(__e=n)},DbUx:function(e,t,n){var r=n("8IOi"),i=n("k+AJ").isFinite;r(r.S,"Number",{isFinite:function(e){return"number"==typeof e&&i(e)}})},DwDk:function(e,t,n){var r=n("8IOi");r(r.S,"Math",{iaddh:function(e,t,n,r){var i=e>>>0,a=n>>>0;return(t>>>0)+(r>>>0)+((i&a|(i|a)&~(i+a>>>0))>>>31)|0}})},EN0g:function(e,t){t.f=Object.getOwnPropertySymbols},EUev:function(e,t,n){var r=n("138g"),i=n("LOhj"),a=n("3iRr")("species");e.exports=function(e,t){var n,s=r(e).constructor;return void 0===s||null==(n=r(s)[a])?t:i(n)}},EdrQ:function(e,t,n){var r=n("8IOi"),i=Math.imul;r(r.S+r.F*n("+TcE")((function(){return-5!=i(4294967295,5)||2!=i.length})),"Math",{imul:function(e,t){var n=65535,r=+e,i=+t,a=n&r,s=n&i;return 0|a*s+((n&r>>>16)*s+a*(n&i>>>16)<<16>>>0)}})},"EeL+":function(e,t,n){var r=n("n+hx"),i=n("R1kZ").set;e.exports=function(e,t,n){var a,s=t.constructor;return s!==n&&"function"==typeof s&&(a=s.prototype)!==n.prototype&&r(a)&&i&&i(e,a),e}},EpbX:function(e,t,n){var r=n("8IOi");r(r.S,"Math",{log10:function(e){return Math.log(e)*Math.LOG10E}})},FMkX:function(e,t,n){"use strict";var r=n("8IOi"),i=n("k+AJ"),a=n("CuJi"),s=n("vejK")(),o=n("3iRr")("observable"),u=n("LOhj"),l=n("138g"),c=n("kopD"),d=n("xmgo"),h=n("BxPU"),f=n("j8TA"),p=f.RETURN,v=function(e){return null==e?void 0:u(e)},m=function(e){var t=e._c;t&&(e._c=void 0,t())},g=function(e){return void 0===e._o},y=function(e){g(e)||(e._o=void 0,m(e))},_=function(e,t){l(e),this._c=void 0,this._o=e,e=new b(this);try{var n=t(e),r=n;null!=n&&("function"==typeof n.unsubscribe?n=function(){r.unsubscribe()}:u(n),this._c=n)}catch(t){return void e.error(t)}g(this)&&m(this)};_.prototype=d({},{unsubscribe:function(){y(this)}});var b=function(e){this._s=e};b.prototype=d({},{next:function(e){var t=this._s;if(!g(t)){var n=t._o;try{var r=v(n.next);if(r)return r.call(n,e)}catch(e){try{y(t)}finally{throw e}}}},error:function(e){var t=this._s;if(g(t))throw e;var n=t._o;t._o=void 0;try{var r=v(n.error);if(!r)throw e;e=r.call(n,e)}catch(e){try{m(t)}finally{throw e}}return m(t),e},complete:function(e){var t=this._s;if(!g(t)){var n=t._o;t._o=void 0;try{var r=v(n.complete);e=r?r.call(n,e):void 0}catch(e){try{m(t)}finally{throw e}}return m(t),e}}});var T=function(e){c(this,T,"Observable","_f")._f=u(e)};d(T.prototype,{subscribe:function(e){return new _(e,this._f)},forEach:function(e){var t=this;return new(a.Promise||i.Promise)((function(n,r){u(e);var i=t.subscribe({next:function(t){try{return e(t)}catch(e){r(e),i.unsubscribe()}},error:r,complete:n})}))}}),d(T,{from:function(e){var t="function"==typeof this?this:T,n=v(l(e)[o]);if(n){var r=l(n.call(e));return r.constructor===t?r:new t((function(e){return r.subscribe(e)}))}return new t((function(t){var n=!1;return s((function(){if(!n){try{if(f(e,!1,(function(e){if(t.next(e),n)return p}))===p)return}catch(e){if(n)throw e;return void t.error(e)}t.complete()}})),function(){n=!0}}))},of:function(){for(var e=0,t=arguments.length,n=new Array(t);e<t;)n[e]=arguments[e++];return new("function"==typeof this?this:T)((function(e){var t=!1;return s((function(){if(!t){for(var r=0;r<n.length;++r)if(e.next(n[r]),t)return;e.complete()}})),function(){t=!0}}))}}),h(T.prototype,o,(function(){return this})),r(r.G,{Observable:T}),n("Oi8Z")("Observable")},FeNi:function(e,t,n){var r=n("HGrt"),i=n("138g"),a=r.has,s=r.key;r.exp({hasOwnMetadata:function(e,t){return a(e,i(t),arguments.length<3?void 0:s(arguments[2]))}})},Fnpj:function(e,t,n){n("+Uj0")("Set")},G1Bn:function(e,t,n){var r=n("8IOi");r(r.S,"Math",{trunc:function(e){return(e>0?Math.floor:Math.ceil)(e)}})},G966:function(e,t,n){"use strict";var r=n("q27k"),i=n("eYp2"),a="Map";e.exports=n("0WhE")(a,(function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}}),{get:function(e){var t=r.getEntry(i(this,a),e);return t&&t.v},set:function(e,t){return r.def(i(this,a),0===e?0:e,t)}},r,!0)},GPGB:function(e,t,n){var r=n("8IOi"),i=n("hTk/");r(r.S+r.F*(Number.parseFloat!=i),"Number",{parseFloat:i})},GvTA:function(e,t,n){var r=n("Y3Md"),i=n("YBJj"),a=n("aI2V");e.exports=function(e,t,n,s){var o=String(a(e)),u=o.length,l=void 0===n?" ":String(n),c=r(t);if(c<=u||""==l)return o;var d=c-u,h=i.call(l,Math.ceil(d/l.length));return h.length>d&&(h=h.slice(0,d)),s?h+o:o+h}},Gx54:function(e,t,n){"use strict";if(n("yU77")){var r=n("zuiL"),i=n("k+AJ"),a=n("+TcE"),s=n("8IOi"),o=n("8wjV"),u=n("t5lg"),l=n("kRpC"),c=n("kopD"),d=n("+zL4"),h=n("BxPU"),f=n("xmgo"),p=n("m29h"),v=n("Y3Md"),m=n("U9MG"),g=n("b8c2"),y=n("AZ8a"),_=n("L7KE"),b=n("UVVG"),T=n("n+hx"),S=n("Qu5u"),E=n("x4ZG"),k=n("ZiEV"),w=n("7WAm"),C=n("27JW").f,A=n("o3v7"),L=n("Vol4"),R=n("3iRr"),x=n("z/zB"),I=n("J8Qq"),O=n("EUev"),D=n("IdBN"),P=n("wFMk"),M=n("6+im"),j=n("Oi8Z"),U=n("C6Ke"),B=n("+UUX"),F=n("J2HX"),N=n("jYdD"),G=F.f,V=N.f,H=i.RangeError,z=i.TypeError,W=i.Uint8Array,K="ArrayBuffer",q="SharedArrayBuffer",$="BYTES_PER_ELEMENT",Y=Array.prototype,X=u.ArrayBuffer,J=u.DataView,Q=x(0),Z=x(2),ee=x(3),te=x(4),ne=x(5),re=x(6),ie=I(!0),ae=I(!1),se=D.values,oe=D.keys,ue=D.entries,le=Y.lastIndexOf,ce=Y.reduce,de=Y.reduceRight,he=Y.join,fe=Y.sort,pe=Y.slice,ve=Y.toString,me=Y.toLocaleString,ge=R("iterator"),ye=R("toStringTag"),_e=L("typed_constructor"),be=L("def_constructor"),Te=o.CONSTR,Se=o.TYPED,Ee=o.VIEW,ke="Wrong length!",we=x(1,(function(e,t){return xe(O(e,e[be]),t)})),Ce=a((function(){return 1===new W(new Uint16Array([1]).buffer)[0]})),Ae=!!W&&!!W.prototype.set&&a((function(){new W(1).set({})})),Le=function(e,t){var n=p(e);if(n<0||n%t)throw H("Wrong offset!");return n},Re=function(e){if(T(e)&&Se in e)return e;throw z(e+" is not a typed array!")},xe=function(e,t){if(!T(e)||!(_e in e))throw z("It is not a typed array constructor!");return new e(t)},Ie=function(e,t){return Oe(O(e,e[be]),t)},Oe=function(e,t){for(var n=0,r=t.length,i=xe(e,r);r>n;)i[n]=t[n++];return i},De=function(e,t,n){G(e,t,{get:function(){return this._d[n]}})},Pe=function(e){var t,n,r,i,a,s,o=S(e),u=arguments.length,c=u>1?arguments[1]:void 0,d=void 0!==c,h=A(o);if(null!=h&&!E(h)){for(s=h.call(o),r=[],t=0;!(a=s.next()).done;t++)r.push(a.value);o=r}for(d&&u>2&&(c=l(c,arguments[2],2)),t=0,n=v(o.length),i=xe(this,n);n>t;t++)i[t]=d?c(o[t],t):o[t];return i},Me=function(){for(var e=0,t=arguments.length,n=xe(this,t);t>e;)n[e]=arguments[e++];return n},je=!!W&&a((function(){me.call(new W(1))})),Ue=function(){return me.apply(je?pe.call(Re(this)):Re(this),arguments)},Be={copyWithin:function(e,t){return B.call(Re(this),e,t,arguments.length>2?arguments[2]:void 0)},every:function(e){return te(Re(this),e,arguments.length>1?arguments[1]:void 0)},fill:function(e){return U.apply(Re(this),arguments)},filter:function(e){return Ie(this,Z(Re(this),e,arguments.length>1?arguments[1]:void 0))},find:function(e){return ne(Re(this),e,arguments.length>1?arguments[1]:void 0)},findIndex:function(e){return re(Re(this),e,arguments.length>1?arguments[1]:void 0)},forEach:function(e){Q(Re(this),e,arguments.length>1?arguments[1]:void 0)},indexOf:function(e){return ae(Re(this),e,arguments.length>1?arguments[1]:void 0)},includes:function(e){return ie(Re(this),e,arguments.length>1?arguments[1]:void 0)},join:function(e){return he.apply(Re(this),arguments)},lastIndexOf:function(e){return le.apply(Re(this),arguments)},map:function(e){return we(Re(this),e,arguments.length>1?arguments[1]:void 0)},reduce:function(e){return ce.apply(Re(this),arguments)},reduceRight:function(e){return de.apply(Re(this),arguments)},reverse:function(){for(var e,t=this,n=Re(t).length,r=Math.floor(n/2),i=0;i<r;)e=t[i],t[i++]=t[--n],t[n]=e;return t},some:function(e){return ee(Re(this),e,arguments.length>1?arguments[1]:void 0)},sort:function(e){return fe.call(Re(this),e)},subarray:function(e,t){var n=Re(this),r=n.length,i=g(e,r);return new(O(n,n[be]))(n.buffer,n.byteOffset+i*n.BYTES_PER_ELEMENT,v((void 0===t?r:g(t,r))-i))}},Fe=function(e,t){return Ie(this,pe.call(Re(this),e,t))},Ne=function(e){Re(this);var t=Le(arguments[1],1),n=this.length,r=S(e),i=v(r.length),a=0;if(i+t>n)throw H(ke);for(;a<i;)this[t+a]=r[a++]},Ge={entries:function(){return ue.call(Re(this))},keys:function(){return oe.call(Re(this))},values:function(){return se.call(Re(this))}},Ve=function(e,t){return T(e)&&e[Se]&&"symbol"!=typeof t&&t in e&&String(+t)==String(t)},He=function(e,t){return Ve(e,t=y(t,!0))?d(2,e[t]):V(e,t)},ze=function(e,t,n){return!(Ve(e,t=y(t,!0))&&T(n)&&_(n,"value"))||_(n,"get")||_(n,"set")||n.configurable||_(n,"writable")&&!n.writable||_(n,"enumerable")&&!n.enumerable?G(e,t,n):(e[t]=n.value,e)};Te||(N.f=He,F.f=ze),s(s.S+s.F*!Te,"Object",{getOwnPropertyDescriptor:He,defineProperty:ze}),a((function(){ve.call({})}))&&(ve=me=function(){return he.call(this)});var We=f({},Be);f(We,Ge),h(We,ge,Ge.values),f(We,{slice:Fe,set:Ne,constructor:function(){},toString:ve,toLocaleString:Ue}),De(We,"buffer","b"),De(We,"byteOffset","o"),De(We,"byteLength","l"),De(We,"length","e"),G(We,ye,{get:function(){return this[Se]}}),e.exports=function(e,t,n,u){var l=e+((u=!!u)?"Clamped":"")+"Array",d="get"+e,f="set"+e,p=i[l],g=p||{},y=p&&w(p),_=!p||!o.ABV,S={},E=p&&p.prototype,A=function(e,n){G(e,n,{get:function(){return function(e,n){var r=e._d;return r.v[d](n*t+r.o,Ce)}(this,n)},set:function(e){return function(e,n,r){var i=e._d;u&&(r=(r=Math.round(r))<0?0:r>255?255:255&r),i.v[f](n*t+i.o,r,Ce)}(this,n,e)},enumerable:!0})};_?(p=n((function(e,n,r,i){c(e,p,l,"_d");var a,s,o,u,d=0,f=0;if(T(n)){if(!(n instanceof X||(u=b(n))==K||u==q))return Se in n?Oe(p,n):Pe.call(p,n);a=n,f=Le(r,t);var g=n.byteLength;if(void 0===i){if(g%t)throw H(ke);if((s=g-f)<0)throw H(ke)}else if((s=v(i)*t)+f>g)throw H(ke);o=s/t}else o=m(n),a=new X(s=o*t);for(h(e,"_d",{b:a,o:f,l:s,e:o,v:new J(a)});d<o;)A(e,d++)})),E=p.prototype=k(We),h(E,"constructor",p)):a((function(){p(1)}))&&a((function(){new p(-1)}))&&M((function(e){new p,new p(null),new p(1.5),new p(e)}),!0)||(p=n((function(e,n,r,i){var a;return c(e,p,l),T(n)?n instanceof X||(a=b(n))==K||a==q?void 0!==i?new g(n,Le(r,t),i):void 0!==r?new g(n,Le(r,t)):new g(n):Se in n?Oe(p,n):Pe.call(p,n):new g(m(n))})),Q(y!==Function.prototype?C(g).concat(C(y)):C(g),(function(e){e in p||h(p,e,g[e])})),p.prototype=E,r||(E.constructor=p));var L=E[ge],R=!!L&&("values"==L.name||null==L.name),x=Ge.values;h(p,_e,!0),h(E,Se,l),h(E,Ee,!0),h(E,be,p),(u?new p(1)[ye]==l:ye in E)||G(E,ye,{get:function(){return l}}),S[l]=p,s(s.G+s.W+s.F*(p!=g),S),s(s.S,l,{BYTES_PER_ELEMENT:t}),s(s.S+s.F*a((function(){g.of.call(p,1)})),l,{from:Pe,of:Me}),$ in E||h(E,$,t),s(s.P,l,Be),j(l),s(s.P+s.F*Ae,l,{set:Ne}),s(s.P+s.F*!R,l,Ge),r||E.toString==ve||(E.toString=ve),s(s.P+s.F*a((function(){new p(1).slice()})),l,{slice:Fe}),s(s.P+s.F*(a((function(){return[1,2].toLocaleString()!=new p([1,2]).toLocaleString()}))||!a((function(){E.toLocaleString.call([1,2])}))),l,{toLocaleString:Ue}),P[l]=R?L:x,r||R||h(E,ge,x)}}else e.exports=function(){}},GxgO:function(e,t,n){"use strict";var r=n("8IOi"),i=n("138g"),a=function(e){this._t=i(e),this._i=0;var t,n=this._k=[];for(t in e)n.push(t)};n("atpN")(a,"Object",(function(){var e,t=this,n=t._k;do{if(t._i>=n.length)return{value:void 0,done:!0}}while(!((e=n[t._i++])in t._t));return{value:e,done:!1}})),r(r.S,"Reflect",{enumerate:function(e){return new a(e)}})},"H/b1":function(e,t,n){var r=n("UVVG"),i=n("t2DD");e.exports=function(e){return function(){if(r(this)!=e)throw TypeError(e+"#toJSON isn't generic");return i(this)}}},HC2Y:function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},HGrt:function(e,t,n){var r=n("G966"),i=n("8IOi"),a=n("3oW4")("metadata"),s=a.store||(a.store=new(n("lLv2"))),o=function(e,t,n){var i=s.get(e);if(!i){if(!n)return;s.set(e,i=new r)}var a=i.get(t);if(!a){if(!n)return;i.set(t,a=new r)}return a};e.exports={store:s,map:o,has:function(e,t,n){var r=o(t,n,!1);return void 0!==r&&r.has(e)},get:function(e,t,n){var r=o(t,n,!1);return void 0===r?void 0:r.get(e)},set:function(e,t,n,r){o(n,r,!0).set(e,t)},keys:function(e,t){var n=o(e,t,!1),r=[];return n&&n.forEach((function(e,t){r.push(t)})),r},key:function(e){return void 0===e||"symbol"==typeof e?e:String(e)},exp:function(e){i(i.S,"Reflect",e)}}},HJwq:function(e,t,n){"use strict";var r=n("8IOi"),i=n("z/zB")(1);r(r.P+r.F*!n("Vcfr")([].map,!0),"Array",{map:function(e){return i(this,e,arguments[1])}})},HLcc:function(e,t,n){var r=n("k+AJ"),i=n("CuJi"),a=n("zuiL"),s=n("pDsQ"),o=n("J2HX").f;e.exports=function(e){var t=i.Symbol||(i.Symbol=a?{}:r.Symbol||{});"_"==e.charAt(0)||e in t||o(t,e,{value:s.f(e)})}},I1BE:function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var i=(s=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(s))))+" */"),a=r.sources.map((function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"}));return[n].concat(a).concat([i]).join("\n")}var s;return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n})).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},i=0;i<this.length;i++){var a=this[i][0];"number"==typeof a&&(r[a]=!0)}for(i=0;i<e.length;i++){var s=e[i];"number"==typeof s[0]&&r[s[0]]||(n&&!s[2]?s[2]=n:n&&(s[2]="("+s[2]+") and ("+n+")"),t.push(s))}},t}},IC4T:function(e,t,n){var r=n("8IOi");r(r.S,"Math",{sign:n("e8l7")})},IGqx:function(e,t,n){"use strict";n("5oHw")("blink",(function(e){return function(){return e(this,"blink","","")}}))},INkZ:function(e,t,n){"use strict";(function(t,n){var r=Object.freeze({});function i(e){return null==e}function a(e){return null!=e}function s(e){return!0===e}function o(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function u(e){return null!==e&&"object"==typeof e}var l=Object.prototype.toString;function c(e){return"[object Object]"===l.call(e)}function d(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function h(e){return a(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function f(e){return null==e?"":Array.isArray(e)||c(e)&&e.toString===l?JSON.stringify(e,null,2):String(e)}function p(e){var t=parseFloat(e);return isNaN(t)?e:t}function v(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i<r.length;i++)n[r[i]]=!0;return t?function(e){return n[e.toLowerCase()]}:function(e){return n[e]}}var m=v("slot,component",!0),g=v("key,ref,slot,slot-scope,is");function y(e,t){if(e.length){var n=e.indexOf(t);if(n>-1)return e.splice(n,1)}}var _=Object.prototype.hasOwnProperty;function b(e,t){return _.call(e,t)}function T(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var S=/-(\w)/g,E=T((function(e){return e.replace(S,(function(e,t){return t?t.toUpperCase():""}))})),k=T((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})),w=/\B([A-Z])/g,C=T((function(e){return e.replace(w,"-$1").toLowerCase()})),A=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function L(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function R(e,t){for(var n in t)e[n]=t[n];return e}function x(e){for(var t={},n=0;n<e.length;n++)e[n]&&R(t,e[n]);return t}function I(e,t,n){}var O=function(e,t,n){return!1},D=function(e){return e};function P(e,t){if(e===t)return!0;var n=u(e),r=u(t);if(!n||!r)return!n&&!r&&String(e)===String(t);try{var i=Array.isArray(e),a=Array.isArray(t);if(i&&a)return e.length===t.length&&e.every((function(e,n){return P(e,t[n])}));if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(i||a)return!1;var s=Object.keys(e),o=Object.keys(t);return s.length===o.length&&s.every((function(n){return P(e[n],t[n])}))}catch(e){return!1}}function M(e,t){for(var n=0;n<e.length;n++)if(P(e[n],t))return n;return-1}function j(e){var t=!1;return function(){t||(t=!0,e.apply(this,arguments))}}var U="data-server-rendered",B=["component","directive","filter"],F=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured","serverPrefetch"],N={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!1,devtools:!1,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:O,isReservedAttr:O,isUnknownElement:O,getTagNamespace:I,parsePlatformTagName:D,mustUseProp:O,async:!0,_lifecycleHooks:F},G=/a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;function V(e,t,n,r){Object.defineProperty(e,t,{value:n,enumerable:!!r,writable:!0,configurable:!0})}var H,z=new RegExp("[^"+G.source+".$_\\d]"),W="__proto__"in{},K="undefined"!=typeof window,q="undefined"!=typeof WXEnvironment&&!!WXEnvironment.platform,$=q&&WXEnvironment.platform.toLowerCase(),Y=K&&window.navigator.userAgent.toLowerCase(),X=Y&&/msie|trident/.test(Y),J=Y&&Y.indexOf("msie 9.0")>0,Q=Y&&Y.indexOf("edge/")>0,Z=(Y&&Y.indexOf("android"),Y&&/iphone|ipad|ipod|ios/.test(Y)||"ios"===$),ee=(Y&&/chrome\/\d+/.test(Y),Y&&/phantomjs/.test(Y),Y&&Y.match(/firefox\/(\d+)/)),te={}.watch,ne=!1;if(K)try{var re={};Object.defineProperty(re,"passive",{get:function(){ne=!0}}),window.addEventListener("test-passive",null,re)}catch(r){}var ie=function(){return void 0===H&&(H=!K&&!q&&void 0!==t&&t.process&&"server"===t.process.env.VUE_ENV),H},ae=K&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function se(e){return"function"==typeof e&&/native code/.test(e.toString())}var oe,ue="undefined"!=typeof Symbol&&se(Symbol)&&"undefined"!=typeof Reflect&&se(Reflect.ownKeys);oe="undefined"!=typeof Set&&se(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var le=I,ce=0,de=function(){this.id=ce++,this.subs=[]};de.prototype.addSub=function(e){this.subs.push(e)},de.prototype.removeSub=function(e){y(this.subs,e)},de.prototype.depend=function(){de.target&&de.target.addDep(this)},de.prototype.notify=function(){for(var e=this.subs.slice(),t=0,n=e.length;t<n;t++)e[t].update()},de.target=null;var he=[];function fe(e){he.push(e),de.target=e}function pe(){he.pop(),de.target=he[he.length-1]}var ve=function(e,t,n,r,i,a,s,o){this.tag=e,this.data=t,this.children=n,this.text=r,this.elm=i,this.ns=void 0,this.context=a,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=t&&t.key,this.componentOptions=s,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=o,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1},me={child:{configurable:!0}};me.child.get=function(){return this.componentInstance},Object.defineProperties(ve.prototype,me);var ge=function(e){void 0===e&&(e="");var t=new ve;return t.text=e,t.isComment=!0,t};function ye(e){return new ve(void 0,void 0,void 0,String(e))}function _e(e){var t=new ve(e.tag,e.data,e.children&&e.children.slice(),e.text,e.elm,e.context,e.componentOptions,e.asyncFactory);return t.ns=e.ns,t.isStatic=e.isStatic,t.key=e.key,t.isComment=e.isComment,t.fnContext=e.fnContext,t.fnOptions=e.fnOptions,t.fnScopeId=e.fnScopeId,t.asyncMeta=e.asyncMeta,t.isCloned=!0,t}var be=Array.prototype,Te=Object.create(be);["push","pop","shift","unshift","splice","sort","reverse"].forEach((function(e){var t=be[e];V(Te,e,(function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];var i,a=t.apply(this,n),s=this.__ob__;switch(e){case"push":case"unshift":i=n;break;case"splice":i=n.slice(2)}return i&&s.observeArray(i),s.dep.notify(),a}))}));var Se=Object.getOwnPropertyNames(Te),Ee=!0;function ke(e){Ee=e}var we=function(e){var t;this.value=e,this.dep=new de,this.vmCount=0,V(e,"__ob__",this),Array.isArray(e)?(W?(t=Te,e.__proto__=t):function(e,t,n){for(var r=0,i=n.length;r<i;r++){var a=n[r];V(e,a,t[a])}}(e,Te,Se),this.observeArray(e)):this.walk(e)};function Ce(e,t){var n;if(u(e)&&!(e instanceof ve))return b(e,"__ob__")&&e.__ob__ instanceof we?n=e.__ob__:Ee&&!ie()&&(Array.isArray(e)||c(e))&&Object.isExtensible(e)&&!e._isVue&&(n=new we(e)),t&&n&&n.vmCount++,n}function Ae(e,t,n,r,i){var a=new de,s=Object.getOwnPropertyDescriptor(e,t);if(!s||!1!==s.configurable){var o=s&&s.get,u=s&&s.set;o&&!u||2!==arguments.length||(n=e[t]);var l=!i&&Ce(n);Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){var t=o?o.call(e):n;return de.target&&(a.depend(),l&&(l.dep.depend(),Array.isArray(t)&&function e(t){for(var n=void 0,r=0,i=t.length;r<i;r++)(n=t[r])&&n.__ob__&&n.__ob__.dep.depend(),Array.isArray(n)&&e(n)}(t))),t},set:function(t){var r=o?o.call(e):n;t===r||t!=t&&r!=r||o&&!u||(u?u.call(e,t):n=t,l=!i&&Ce(t),a.notify())}})}}function Le(e,t,n){if(Array.isArray(e)&&d(t))return e.length=Math.max(e.length,t),e.splice(t,1,n),n;if(t in e&&!(t in Object.prototype))return e[t]=n,n;var r=e.__ob__;return e._isVue||r&&r.vmCount?n:r?(Ae(r.value,t,n),r.dep.notify(),n):(e[t]=n,n)}function Re(e,t){if(Array.isArray(e)&&d(t))e.splice(t,1);else{var n=e.__ob__;e._isVue||n&&n.vmCount||b(e,t)&&(delete e[t],n&&n.dep.notify())}}we.prototype.walk=function(e){for(var t=Object.keys(e),n=0;n<t.length;n++)Ae(e,t[n])},we.prototype.observeArray=function(e){for(var t=0,n=e.length;t<n;t++)Ce(e[t])};var xe=N.optionMergeStrategies;function Ie(e,t){if(!t)return e;for(var n,r,i,a=ue?Reflect.ownKeys(t):Object.keys(t),s=0;s<a.length;s++)"__ob__"!==(n=a[s])&&(r=e[n],i=t[n],b(e,n)?r!==i&&c(r)&&c(i)&&Ie(r,i):Le(e,n,i));return e}function Oe(e,t,n){return n?function(){var r="function"==typeof t?t.call(n,n):t,i="function"==typeof e?e.call(n,n):e;return r?Ie(r,i):i}:t?e?function(){return Ie("function"==typeof t?t.call(this,this):t,"function"==typeof e?e.call(this,this):e)}:t:e}function De(e,t){var n=t?e?e.concat(t):Array.isArray(t)?t:[t]:e;return n?function(e){for(var t=[],n=0;n<e.length;n++)-1===t.indexOf(e[n])&&t.push(e[n]);return t}(n):n}function Pe(e,t,n,r){var i=Object.create(e||null);return t?R(i,t):i}xe.data=function(e,t,n){return n?Oe(e,t,n):t&&"function"!=typeof t?e:Oe(e,t)},F.forEach((function(e){xe[e]=De})),B.forEach((function(e){xe[e+"s"]=Pe})),xe.watch=function(e,t,n,r){if(e===te&&(e=void 0),t===te&&(t=void 0),!t)return Object.create(e||null);if(!e)return t;var i={};for(var a in R(i,e),t){var s=i[a],o=t[a];s&&!Array.isArray(s)&&(s=[s]),i[a]=s?s.concat(o):Array.isArray(o)?o:[o]}return i},xe.props=xe.methods=xe.inject=xe.computed=function(e,t,n,r){if(!e)return t;var i=Object.create(null);return R(i,e),t&&R(i,t),i},xe.provide=Oe;var Me=function(e,t){return void 0===t?e:t};function je(e,t,n){if("function"==typeof t&&(t=t.options),function(e,t){var n=e.props;if(n){var r,i,a={};if(Array.isArray(n))for(r=n.length;r--;)"string"==typeof(i=n[r])&&(a[E(i)]={type:null});else if(c(n))for(var s in n)i=n[s],a[E(s)]=c(i)?i:{type:i};e.props=a}}(t),function(e,t){var n=e.inject;if(n){var r=e.inject={};if(Array.isArray(n))for(var i=0;i<n.length;i++)r[n[i]]={from:n[i]};else if(c(n))for(var a in n){var s=n[a];r[a]=c(s)?R({from:a},s):{from:s}}}}(t),function(e){var t=e.directives;if(t)for(var n in t){var r=t[n];"function"==typeof r&&(t[n]={bind:r,update:r})}}(t),!t._base&&(t.extends&&(e=je(e,t.extends,n)),t.mixins))for(var r=0,i=t.mixins.length;r<i;r++)e=je(e,t.mixins[r],n);var a,s={};for(a in e)o(a);for(a in t)b(e,a)||o(a);function o(r){var i=xe[r]||Me;s[r]=i(e[r],t[r],n,r)}return s}function Ue(e,t,n,r){if("string"==typeof n){var i=e[t];if(b(i,n))return i[n];var a=E(n);if(b(i,a))return i[a];var s=k(a);return b(i,s)?i[s]:i[n]||i[a]||i[s]}}function Be(e,t,n,r){var i=t[e],a=!b(n,e),s=n[e],o=Ge(Boolean,i.type);if(o>-1)if(a&&!b(i,"default"))s=!1;else if(""===s||s===C(e)){var u=Ge(String,i.type);(u<0||o<u)&&(s=!0)}if(void 0===s){s=function(e,t,n){if(b(t,"default")){var r=t.default;return e&&e.$options.propsData&&void 0===e.$options.propsData[n]&&void 0!==e._props[n]?e._props[n]:"function"==typeof r&&"Function"!==Fe(t.type)?r.call(e):r}}(r,i,e);var l=Ee;ke(!0),Ce(s),ke(l)}return s}function Fe(e){var t=e&&e.toString().match(/^\s*function (\w+)/);return t?t[1]:""}function Ne(e,t){return Fe(e)===Fe(t)}function Ge(e,t){if(!Array.isArray(t))return Ne(t,e)?0:-1;for(var n=0,r=t.length;n<r;n++)if(Ne(t[n],e))return n;return-1}function Ve(e,t,n){fe();try{if(t)for(var r=t;r=r.$parent;){var i=r.$options.errorCaptured;if(i)for(var a=0;a<i.length;a++)try{if(!1===i[a].call(r,e,t,n))return}catch(e){ze(e,r,"errorCaptured hook")}}ze(e,t,n)}finally{pe()}}function He(e,t,n,r,i){var a;try{(a=n?e.apply(t,n):e.call(t))&&!a._isVue&&h(a)&&!a._handled&&(a.catch((function(e){return Ve(e,r,i+" (Promise/async)")})),a._handled=!0)}catch(e){Ve(e,r,i)}return a}function ze(e,t,n){if(N.errorHandler)try{return N.errorHandler.call(null,e,t,n)}catch(t){t!==e&&We(t,null,"config.errorHandler")}We(e,t,n)}function We(e,t,n){if(!K&&!q||"undefined"==typeof console)throw e;console.error(e)}var Ke,qe=!1,$e=[],Ye=!1;function Xe(){Ye=!1;var e=$e.slice(0);$e.length=0;for(var t=0;t<e.length;t++)e[t]()}if("undefined"!=typeof Promise&&se(Promise)){var Je=Promise.resolve();Ke=function(){Je.then(Xe),Z&&setTimeout(I)},qe=!0}else if(X||"undefined"==typeof MutationObserver||!se(MutationObserver)&&"[object MutationObserverConstructor]"!==MutationObserver.toString())Ke=void 0!==n&&se(n)?function(){n(Xe)}:function(){setTimeout(Xe,0)};else{var Qe=1,Ze=new MutationObserver(Xe),et=document.createTextNode(String(Qe));Ze.observe(et,{characterData:!0}),Ke=function(){Qe=(Qe+1)%2,et.data=String(Qe)},qe=!0}function tt(e,t){var n;if($e.push((function(){if(e)try{e.call(t)}catch(e){Ve(e,t,"nextTick")}else n&&n(t)})),Ye||(Ye=!0,Ke()),!e&&"undefined"!=typeof Promise)return new Promise((function(e){n=e}))}var nt=new oe;function rt(e){!function e(t,n){var r,i,a=Array.isArray(t);if(!(!a&&!u(t)||Object.isFrozen(t)||t instanceof ve)){if(t.__ob__){var s=t.__ob__.dep.id;if(n.has(s))return;n.add(s)}if(a)for(r=t.length;r--;)e(t[r],n);else for(r=(i=Object.keys(t)).length;r--;)e(t[i[r]],n)}}(e,nt),nt.clear()}var it=T((function(e){var t="&"===e.charAt(0),n="~"===(e=t?e.slice(1):e).charAt(0),r="!"===(e=n?e.slice(1):e).charAt(0);return{name:e=r?e.slice(1):e,once:n,capture:r,passive:t}}));function at(e,t){function n(){var e=arguments,r=n.fns;if(!Array.isArray(r))return He(r,null,arguments,t,"v-on handler");for(var i=r.slice(),a=0;a<i.length;a++)He(i[a],null,e,t,"v-on handler")}return n.fns=e,n}function st(e,t,n,r,a,o){var u,l,c,d;for(u in e)l=e[u],c=t[u],d=it(u),i(l)||(i(c)?(i(l.fns)&&(l=e[u]=at(l,o)),s(d.once)&&(l=e[u]=a(d.name,l,d.capture)),n(d.name,l,d.capture,d.passive,d.params)):l!==c&&(c.fns=l,e[u]=c));for(u in t)i(e[u])&&r((d=it(u)).name,t[u],d.capture)}function ot(e,t,n){var r;e instanceof ve&&(e=e.data.hook||(e.data.hook={}));var o=e[t];function u(){n.apply(this,arguments),y(r.fns,u)}i(o)?r=at([u]):a(o.fns)&&s(o.merged)?(r=o).fns.push(u):r=at([o,u]),r.merged=!0,e[t]=r}function ut(e,t,n,r,i){if(a(t)){if(b(t,n))return e[n]=t[n],i||delete t[n],!0;if(b(t,r))return e[n]=t[r],i||delete t[r],!0}return!1}function lt(e){return o(e)?[ye(e)]:Array.isArray(e)?function e(t,n){var r,u,l,c,d=[];for(r=0;r<t.length;r++)i(u=t[r])||"boolean"==typeof u||(c=d[l=d.length-1],Array.isArray(u)?u.length>0&&(ct((u=e(u,(n||"")+"_"+r))[0])&&ct(c)&&(d[l]=ye(c.text+u[0].text),u.shift()),d.push.apply(d,u)):o(u)?ct(c)?d[l]=ye(c.text+u):""!==u&&d.push(ye(u)):ct(u)&&ct(c)?d[l]=ye(c.text+u.text):(s(t._isVList)&&a(u.tag)&&i(u.key)&&a(n)&&(u.key="__vlist"+n+"_"+r+"__"),d.push(u)));return d}(e):void 0}function ct(e){return a(e)&&a(e.text)&&!1===e.isComment}function dt(e,t){if(e){for(var n=Object.create(null),r=ue?Reflect.ownKeys(e):Object.keys(e),i=0;i<r.length;i++){var a=r[i];if("__ob__"!==a){for(var s=e[a].from,o=t;o;){if(o._provided&&b(o._provided,s)){n[a]=o._provided[s];break}o=o.$parent}if(!o&&"default"in e[a]){var u=e[a].default;n[a]="function"==typeof u?u.call(t):u}}}return n}}function ht(e,t){if(!e||!e.length)return{};for(var n={},r=0,i=e.length;r<i;r++){var a=e[r],s=a.data;if(s&&s.attrs&&s.attrs.slot&&delete s.attrs.slot,a.context!==t&&a.fnContext!==t||!s||null==s.slot)(n.default||(n.default=[])).push(a);else{var o=s.slot,u=n[o]||(n[o]=[]);"template"===a.tag?u.push.apply(u,a.children||[]):u.push(a)}}for(var l in n)n[l].every(ft)&&delete n[l];return n}function ft(e){return e.isComment&&!e.asyncFactory||" "===e.text}function pt(e,t,n){var i,a=Object.keys(t).length>0,s=e?!!e.$stable:!a,o=e&&e.$key;if(e){if(e._normalized)return e._normalized;if(s&&n&&n!==r&&o===n.$key&&!a&&!n.$hasNormal)return n;for(var u in i={},e)e[u]&&"$"!==u[0]&&(i[u]=vt(t,u,e[u]))}else i={};for(var l in t)l in i||(i[l]=mt(t,l));return e&&Object.isExtensible(e)&&(e._normalized=i),V(i,"$stable",s),V(i,"$key",o),V(i,"$hasNormal",a),i}function vt(e,t,n){var r=function(){var e=arguments.length?n.apply(null,arguments):n({});return(e=e&&"object"==typeof e&&!Array.isArray(e)?[e]:lt(e))&&(0===e.length||1===e.length&&e[0].isComment)?void 0:e};return n.proxy&&Object.defineProperty(e,t,{get:r,enumerable:!0,configurable:!0}),r}function mt(e,t){return function(){return e[t]}}function gt(e,t){var n,r,i,s,o;if(Array.isArray(e)||"string"==typeof e)for(n=new Array(e.length),r=0,i=e.length;r<i;r++)n[r]=t(e[r],r);else if("number"==typeof e)for(n=new Array(e),r=0;r<e;r++)n[r]=t(r+1,r);else if(u(e))if(ue&&e[Symbol.iterator]){n=[];for(var l=e[Symbol.iterator](),c=l.next();!c.done;)n.push(t(c.value,n.length)),c=l.next()}else for(s=Object.keys(e),n=new Array(s.length),r=0,i=s.length;r<i;r++)o=s[r],n[r]=t(e[o],o,r);return a(n)||(n=[]),n._isVList=!0,n}function yt(e,t,n,r){var i,a=this.$scopedSlots[e];a?(n=n||{},r&&(n=R(R({},r),n)),i=a(n)||t):i=this.$slots[e]||t;var s=n&&n.slot;return s?this.$createElement("template",{slot:s},i):i}function _t(e){return Ue(this.$options,"filters",e)||D}function bt(e,t){return Array.isArray(e)?-1===e.indexOf(t):e!==t}function Tt(e,t,n,r,i){var a=N.keyCodes[t]||n;return i&&r&&!N.keyCodes[t]?bt(i,r):a?bt(a,e):r?C(r)!==t:void 0}function St(e,t,n,r,i){if(n&&u(n)){var a;Array.isArray(n)&&(n=x(n));var s=function(s){if("class"===s||"style"===s||g(s))a=e;else{var o=e.attrs&&e.attrs.type;a=r||N.mustUseProp(t,o,s)?e.domProps||(e.domProps={}):e.attrs||(e.attrs={})}var u=E(s),l=C(s);u in a||l in a||(a[s]=n[s],i&&((e.on||(e.on={}))["update:"+s]=function(e){n[s]=e}))};for(var o in n)s(o)}return e}function Et(e,t){var n=this._staticTrees||(this._staticTrees=[]),r=n[e];return r&&!t||wt(r=n[e]=this.$options.staticRenderFns[e].call(this._renderProxy,null,this),"__static__"+e,!1),r}function kt(e,t,n){return wt(e,"__once__"+t+(n?"_"+n:""),!0),e}function wt(e,t,n){if(Array.isArray(e))for(var r=0;r<e.length;r++)e[r]&&"string"!=typeof e[r]&&Ct(e[r],t+"_"+r,n);else Ct(e,t,n)}function Ct(e,t,n){e.isStatic=!0,e.key=t,e.isOnce=n}function At(e,t){if(t&&c(t)){var n=e.on=e.on?R({},e.on):{};for(var r in t){var i=n[r],a=t[r];n[r]=i?[].concat(i,a):a}}return e}function Lt(e,t,n,r){t=t||{$stable:!n};for(var i=0;i<e.length;i++){var a=e[i];Array.isArray(a)?Lt(a,t,n):a&&(a.proxy&&(a.fn.proxy=!0),t[a.key]=a.fn)}return r&&(t.$key=r),t}function Rt(e,t){for(var n=0;n<t.length;n+=2){var r=t[n];"string"==typeof r&&r&&(e[t[n]]=t[n+1])}return e}function xt(e,t){return"string"==typeof e?t+e:e}function It(e){e._o=kt,e._n=p,e._s=f,e._l=gt,e._t=yt,e._q=P,e._i=M,e._m=Et,e._f=_t,e._k=Tt,e._b=St,e._v=ye,e._e=ge,e._u=Lt,e._g=At,e._d=Rt,e._p=xt}function Ot(e,t,n,i,a){var o,u=this,l=a.options;b(i,"_uid")?(o=Object.create(i))._original=i:(o=i,i=i._original);var c=s(l._compiled),d=!c;this.data=e,this.props=t,this.children=n,this.parent=i,this.listeners=e.on||r,this.injections=dt(l.inject,i),this.slots=function(){return u.$slots||pt(e.scopedSlots,u.$slots=ht(n,i)),u.$slots},Object.defineProperty(this,"scopedSlots",{enumerable:!0,get:function(){return pt(e.scopedSlots,this.slots())}}),c&&(this.$options=l,this.$slots=this.slots(),this.$scopedSlots=pt(e.scopedSlots,this.$slots)),l._scopeId?this._c=function(e,t,n,r){var a=Ft(o,e,t,n,r,d);return a&&!Array.isArray(a)&&(a.fnScopeId=l._scopeId,a.fnContext=i),a}:this._c=function(e,t,n,r){return Ft(o,e,t,n,r,d)}}function Dt(e,t,n,r,i){var a=_e(e);return a.fnContext=n,a.fnOptions=r,t.slot&&((a.data||(a.data={})).slot=t.slot),a}function Pt(e,t){for(var n in t)e[E(n)]=t[n]}It(Ot.prototype);var Mt={init:function(e,t){if(e.componentInstance&&!e.componentInstance._isDestroyed&&e.data.keepAlive){var n=e;Mt.prepatch(n,n)}else(e.componentInstance=function(e,t){var n={_isComponent:!0,_parentVnode:e,parent:t},r=e.data.inlineTemplate;return a(r)&&(n.render=r.render,n.staticRenderFns=r.staticRenderFns),new e.componentOptions.Ctor(n)}(e,Yt)).$mount(t?e.elm:void 0,t)},prepatch:function(e,t){var n=t.componentOptions;!function(e,t,n,i,a){var s=i.data.scopedSlots,o=e.$scopedSlots,u=!!(s&&!s.$stable||o!==r&&!o.$stable||s&&e.$scopedSlots.$key!==s.$key),l=!!(a||e.$options._renderChildren||u);if(e.$options._parentVnode=i,e.$vnode=i,e._vnode&&(e._vnode.parent=i),e.$options._renderChildren=a,e.$attrs=i.data.attrs||r,e.$listeners=n||r,t&&e.$options.props){ke(!1);for(var c=e._props,d=e.$options._propKeys||[],h=0;h<d.length;h++){var f=d[h],p=e.$options.props;c[f]=Be(f,p,t,e)}ke(!0),e.$options.propsData=t}n=n||r;var v=e.$options._parentListeners;e.$options._parentListeners=n,$t(e,n,v),l&&(e.$slots=ht(a,i.context),e.$forceUpdate())}(t.componentInstance=e.componentInstance,n.propsData,n.listeners,t,n.children)},insert:function(e){var t,n=e.context,r=e.componentInstance;r._isMounted||(r._isMounted=!0,Zt(r,"mounted")),e.data.keepAlive&&(n._isMounted?((t=r)._inactive=!1,tn.push(t)):Qt(r,!0))},destroy:function(e){var t=e.componentInstance;t._isDestroyed||(e.data.keepAlive?function e(t,n){if(!(n&&(t._directInactive=!0,Jt(t))||t._inactive)){t._inactive=!0;for(var r=0;r<t.$children.length;r++)e(t.$children[r]);Zt(t,"deactivated")}}(t,!0):t.$destroy())}},jt=Object.keys(Mt);function Ut(e,t,n,o,l){if(!i(e)){var c=n.$options._base;if(u(e)&&(e=c.extend(e)),"function"==typeof e){var d;if(i(e.cid)&&void 0===(e=function(e,t){if(s(e.error)&&a(e.errorComp))return e.errorComp;if(a(e.resolved))return e.resolved;var n=Gt;if(n&&a(e.owners)&&-1===e.owners.indexOf(n)&&e.owners.push(n),s(e.loading)&&a(e.loadingComp))return e.loadingComp;if(n&&!a(e.owners)){var r=e.owners=[n],o=!0,l=null,c=null;n.$on("hook:destroyed",(function(){return y(r,n)}));var d=function(e){for(var t=0,n=r.length;t<n;t++)r[t].$forceUpdate();e&&(r.length=0,null!==l&&(clearTimeout(l),l=null),null!==c&&(clearTimeout(c),c=null))},f=j((function(n){e.resolved=Vt(n,t),o?r.length=0:d(!0)})),p=j((function(t){a(e.errorComp)&&(e.error=!0,d(!0))})),v=e(f,p);return u(v)&&(h(v)?i(e.resolved)&&v.then(f,p):h(v.component)&&(v.component.then(f,p),a(v.error)&&(e.errorComp=Vt(v.error,t)),a(v.loading)&&(e.loadingComp=Vt(v.loading,t),0===v.delay?e.loading=!0:l=setTimeout((function(){l=null,i(e.resolved)&&i(e.error)&&(e.loading=!0,d(!1))}),v.delay||200)),a(v.timeout)&&(c=setTimeout((function(){c=null,i(e.resolved)&&p(null)}),v.timeout)))),o=!1,e.loading?e.loadingComp:e.resolved}}(d=e,c)))return function(e,t,n,r,i){var a=ge();return a.asyncFactory=e,a.asyncMeta={data:t,context:n,children:r,tag:i},a}(d,t,n,o,l);t=t||{},Tn(e),a(t.model)&&function(e,t){var n=e.model&&e.model.prop||"value",r=e.model&&e.model.event||"input";(t.attrs||(t.attrs={}))[n]=t.model.value;var i=t.on||(t.on={}),s=i[r],o=t.model.callback;a(s)?(Array.isArray(s)?-1===s.indexOf(o):s!==o)&&(i[r]=[o].concat(s)):i[r]=o}(e.options,t);var f=function(e,t,n){var r=t.options.props;if(!i(r)){var s={},o=e.attrs,u=e.props;if(a(o)||a(u))for(var l in r){var c=C(l);ut(s,u,l,c,!0)||ut(s,o,l,c,!1)}return s}}(t,e);if(s(e.options.functional))return function(e,t,n,i,s){var o=e.options,u={},l=o.props;if(a(l))for(var c in l)u[c]=Be(c,l,t||r);else a(n.attrs)&&Pt(u,n.attrs),a(n.props)&&Pt(u,n.props);var d=new Ot(n,u,s,i,e),h=o.render.call(null,d._c,d);if(h instanceof ve)return Dt(h,n,d.parent,o);if(Array.isArray(h)){for(var f=lt(h)||[],p=new Array(f.length),v=0;v<f.length;v++)p[v]=Dt(f[v],n,d.parent,o);return p}}(e,f,t,n,o);var p=t.on;if(t.on=t.nativeOn,s(e.options.abstract)){var v=t.slot;t={},v&&(t.slot=v)}!function(e){for(var t=e.hook||(e.hook={}),n=0;n<jt.length;n++){var r=jt[n],i=t[r],a=Mt[r];i===a||i&&i._merged||(t[r]=i?Bt(a,i):a)}}(t);var m=e.options.name||l;return new ve("vue-component-"+e.cid+(m?"-"+m:""),t,void 0,void 0,void 0,n,{Ctor:e,propsData:f,listeners:p,tag:l,children:o},d)}}}function Bt(e,t){var n=function(n,r){e(n,r),t(n,r)};return n._merged=!0,n}function Ft(e,t,n,r,l,c){return(Array.isArray(n)||o(n))&&(l=r,r=n,n=void 0),s(c)&&(l=2),function(e,t,n,r,o){if(a(n)&&a(n.__ob__))return ge();if(a(n)&&a(n.is)&&(t=n.is),!t)return ge();var l,c,d;(Array.isArray(r)&&"function"==typeof r[0]&&((n=n||{}).scopedSlots={default:r[0]},r.length=0),2===o?r=lt(r):1===o&&(r=function(e){for(var t=0;t<e.length;t++)if(Array.isArray(e[t]))return Array.prototype.concat.apply([],e);return e}(r)),"string"==typeof t)?(c=e.$vnode&&e.$vnode.ns||N.getTagNamespace(t),l=N.isReservedTag(t)?new ve(N.parsePlatformTagName(t),n,r,void 0,void 0,e):n&&n.pre||!a(d=Ue(e.$options,"components",t))?new ve(t,n,r,void 0,void 0,e):Ut(d,n,e,r,t)):l=Ut(t,n,e,r);return Array.isArray(l)?l:a(l)?(a(c)&&function e(t,n,r){if(t.ns=n,"foreignObject"===t.tag&&(n=void 0,r=!0),a(t.children))for(var o=0,u=t.children.length;o<u;o++){var l=t.children[o];a(l.tag)&&(i(l.ns)||s(r)&&"svg"!==l.tag)&&e(l,n,r)}}(l,c),a(n)&&function(e){u(e.style)&&rt(e.style),u(e.class)&&rt(e.class)}(n),l):ge()}(e,t,n,r,l)}var Nt,Gt=null;function Vt(e,t){return(e.__esModule||ue&&"Module"===e[Symbol.toStringTag])&&(e=e.default),u(e)?t.extend(e):e}function Ht(e){return e.isComment&&e.asyncFactory}function zt(e){if(Array.isArray(e))for(var t=0;t<e.length;t++){var n=e[t];if(a(n)&&(a(n.componentOptions)||Ht(n)))return n}}function Wt(e,t){Nt.$on(e,t)}function Kt(e,t){Nt.$off(e,t)}function qt(e,t){var n=Nt;return function r(){null!==t.apply(null,arguments)&&n.$off(e,r)}}function $t(e,t,n){Nt=e,st(t,n||{},Wt,Kt,qt,e),Nt=void 0}var Yt=null;function Xt(e){var t=Yt;return Yt=e,function(){Yt=t}}function Jt(e){for(;e&&(e=e.$parent);)if(e._inactive)return!0;return!1}function Qt(e,t){if(t){if(e._directInactive=!1,Jt(e))return}else if(e._directInactive)return;if(e._inactive||null===e._inactive){e._inactive=!1;for(var n=0;n<e.$children.length;n++)Qt(e.$children[n]);Zt(e,"activated")}}function Zt(e,t){fe();var n=e.$options[t],r=t+" hook";if(n)for(var i=0,a=n.length;i<a;i++)He(n[i],e,null,e,r);e._hasHookEvent&&e.$emit("hook:"+t),pe()}var en=[],tn=[],nn={},rn=!1,an=!1,sn=0,on=0,un=Date.now;if(K&&!X){var ln=window.performance;ln&&"function"==typeof ln.now&&un()>document.createEvent("Event").timeStamp&&(un=function(){return ln.now()})}function cn(){var e,t;for(on=un(),an=!0,en.sort((function(e,t){return e.id-t.id})),sn=0;sn<en.length;sn++)(e=en[sn]).before&&e.before(),t=e.id,nn[t]=null,e.run();var n=tn.slice(),r=en.slice();sn=en.length=tn.length=0,nn={},rn=an=!1,function(e){for(var t=0;t<e.length;t++)e[t]._inactive=!0,Qt(e[t],!0)}(n),function(e){for(var t=e.length;t--;){var n=e[t],r=n.vm;r._watcher===n&&r._isMounted&&!r._isDestroyed&&Zt(r,"updated")}}(r),ae&&N.devtools&&ae.emit("flush")}var dn=0,hn=function(e,t,n,r,i){this.vm=e,i&&(e._watcher=this),e._watchers.push(this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync,this.before=r.before):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++dn,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new oe,this.newDepIds=new oe,this.expression="","function"==typeof t?this.getter=t:(this.getter=function(e){if(!z.test(e)){var t=e.split(".");return function(e){for(var n=0;n<t.length;n++){if(!e)return;e=e[t[n]]}return e}}}(t),this.getter||(this.getter=I)),this.value=this.lazy?void 0:this.get()};hn.prototype.get=function(){var e;fe(this);var t=this.vm;try{e=this.getter.call(t,t)}catch(e){if(!this.user)throw e;Ve(e,t,'getter for watcher "'+this.expression+'"')}finally{this.deep&&rt(e),pe(),this.cleanupDeps()}return e},hn.prototype.addDep=function(e){var t=e.id;this.newDepIds.has(t)||(this.newDepIds.add(t),this.newDeps.push(e),this.depIds.has(t)||e.addSub(this))},hn.prototype.cleanupDeps=function(){for(var e=this.deps.length;e--;){var t=this.deps[e];this.newDepIds.has(t.id)||t.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},hn.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():function(e){var t=e.id;if(null==nn[t]){if(nn[t]=!0,an){for(var n=en.length-1;n>sn&&en[n].id>e.id;)n--;en.splice(n+1,0,e)}else en.push(e);rn||(rn=!0,tt(cn))}}(this)},hn.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||u(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(e){Ve(e,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,e,t)}}},hn.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},hn.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},hn.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||y(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var fn={enumerable:!0,configurable:!0,get:I,set:I};function pn(e,t,n){fn.get=function(){return this[t][n]},fn.set=function(e){this[t][n]=e},Object.defineProperty(e,n,fn)}var vn={lazy:!0};function mn(e,t,n){var r=!ie();"function"==typeof n?(fn.get=r?gn(t):yn(n),fn.set=I):(fn.get=n.get?r&&!1!==n.cache?gn(t):yn(n.get):I,fn.set=n.set||I),Object.defineProperty(e,t,fn)}function gn(e){return function(){var t=this._computedWatchers&&this._computedWatchers[e];if(t)return t.dirty&&t.evaluate(),de.target&&t.depend(),t.value}}function yn(e){return function(){return e.call(this,this)}}function _n(e,t,n,r){return c(n)&&(r=n,n=n.handler),"string"==typeof n&&(n=e[n]),e.$watch(t,n,r)}var bn=0;function Tn(e){var t=e.options;if(e.super){var n=Tn(e.super);if(n!==e.superOptions){e.superOptions=n;var r=function(e){var t,n=e.options,r=e.sealedOptions;for(var i in n)n[i]!==r[i]&&(t||(t={}),t[i]=n[i]);return t}(e);r&&R(e.extendOptions,r),(t=e.options=je(n,e.extendOptions)).name&&(t.components[t.name]=e)}}return t}function Sn(e){this._init(e)}function En(e){return e&&(e.Ctor.options.name||e.tag)}function kn(e,t){return Array.isArray(e)?e.indexOf(t)>-1:"string"==typeof e?e.split(",").indexOf(t)>-1:(n=e,"[object RegExp]"===l.call(n)&&e.test(t));var n}function wn(e,t){var n=e.cache,r=e.keys,i=e._vnode;for(var a in n){var s=n[a];if(s){var o=En(s.componentOptions);o&&!t(o)&&Cn(n,a,r,i)}}}function Cn(e,t,n,r){var i=e[t];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),e[t]=null,y(n,t)}!function(e){e.prototype._init=function(e){var t=this;t._uid=bn++,t._isVue=!0,e&&e._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(t,e):t.$options=je(Tn(t.constructor),e||{},t),t._renderProxy=t,t._self=t,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(t),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&$t(e,t)}(t),function(e){e._vnode=null,e._staticTrees=null;var t=e.$options,n=e.$vnode=t._parentVnode,i=n&&n.context;e.$slots=ht(t._renderChildren,i),e.$scopedSlots=r,e._c=function(t,n,r,i){return Ft(e,t,n,r,i,!1)},e.$createElement=function(t,n,r,i){return Ft(e,t,n,r,i,!0)};var a=n&&n.data;Ae(e,"$attrs",a&&a.attrs||r,null,!0),Ae(e,"$listeners",t._parentListeners||r,null,!0)}(t),Zt(t,"beforeCreate"),function(e){var t=dt(e.$options.inject,e);t&&(ke(!1),Object.keys(t).forEach((function(n){Ae(e,n,t[n])})),ke(!0))}(t),function(e){e._watchers=[];var t=e.$options;t.props&&function(e,t){var n=e.$options.propsData||{},r=e._props={},i=e.$options._propKeys=[];e.$parent&&ke(!1);var a=function(a){i.push(a);var s=Be(a,t,n,e);Ae(r,a,s),a in e||pn(e,"_props",a)};for(var s in t)a(s);ke(!0)}(e,t.props),t.methods&&function(e,t){for(var n in e.$options.props,t)e[n]="function"!=typeof t[n]?I:A(t[n],e)}(e,t.methods),t.data?function(e){var t=e.$options.data;c(t=e._data="function"==typeof t?function(e,t){fe();try{return e.call(t,t)}catch(e){return Ve(e,t,"data()"),{}}finally{pe()}}(t,e):t||{})||(t={});for(var n,r=Object.keys(t),i=e.$options.props,a=(e.$options.methods,r.length);a--;){var s=r[a];i&&b(i,s)||36!==(n=(s+"").charCodeAt(0))&&95!==n&&pn(e,"_data",s)}Ce(t,!0)}(e):Ce(e._data={},!0),t.computed&&function(e,t){var n=e._computedWatchers=Object.create(null),r=ie();for(var i in t){var a=t[i],s="function"==typeof a?a:a.get;r||(n[i]=new hn(e,s||I,I,vn)),i in e||mn(e,i,a)}}(e,t.computed),t.watch&&t.watch!==te&&function(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var i=0;i<r.length;i++)_n(e,n,r[i]);else _n(e,n,r)}}(e,t.watch)}(t),function(e){var t=e.$options.provide;t&&(e._provided="function"==typeof t?t.call(e):t)}(t),Zt(t,"created"),t.$options.el&&t.$mount(t.$options.el)}}(Sn),function(e){Object.defineProperty(e.prototype,"$data",{get:function(){return this._data}}),Object.defineProperty(e.prototype,"$props",{get:function(){return this._props}}),e.prototype.$set=Le,e.prototype.$delete=Re,e.prototype.$watch=function(e,t,n){if(c(t))return _n(this,e,t,n);(n=n||{}).user=!0;var r=new hn(this,e,t,n);if(n.immediate)try{t.call(this,r.value)}catch(e){Ve(e,this,'callback for immediate watcher "'+r.expression+'"')}return function(){r.teardown()}}}(Sn),function(e){var t=/^hook:/;e.prototype.$on=function(e,n){var r=this;if(Array.isArray(e))for(var i=0,a=e.length;i<a;i++)r.$on(e[i],n);else(r._events[e]||(r._events[e]=[])).push(n),t.test(e)&&(r._hasHookEvent=!0);return r},e.prototype.$once=function(e,t){var n=this;function r(){n.$off(e,r),t.apply(n,arguments)}return r.fn=t,n.$on(e,r),n},e.prototype.$off=function(e,t){var n=this;if(!arguments.length)return n._events=Object.create(null),n;if(Array.isArray(e)){for(var r=0,i=e.length;r<i;r++)n.$off(e[r],t);return n}var a,s=n._events[e];if(!s)return n;if(!t)return n._events[e]=null,n;for(var o=s.length;o--;)if((a=s[o])===t||a.fn===t){s.splice(o,1);break}return n},e.prototype.$emit=function(e){var t=this._events[e];if(t){t=t.length>1?L(t):t;for(var n=L(arguments,1),r='event handler for "'+e+'"',i=0,a=t.length;i<a;i++)He(t[i],this,n,this,r)}return this}}(Sn),function(e){e.prototype._update=function(e,t){var n=this,r=n.$el,i=n._vnode,a=Xt(n);n._vnode=e,n.$el=i?n.__patch__(i,e):n.__patch__(n.$el,e,t,!1),a(),r&&(r.__vue__=null),n.$el&&(n.$el.__vue__=n),n.$vnode&&n.$parent&&n.$vnode===n.$parent._vnode&&(n.$parent.$el=n.$el)},e.prototype.$forceUpdate=function(){this._watcher&&this._watcher.update()},e.prototype.$destroy=function(){var e=this;if(!e._isBeingDestroyed){Zt(e,"beforeDestroy"),e._isBeingDestroyed=!0;var t=e.$parent;!t||t._isBeingDestroyed||e.$options.abstract||y(t.$children,e),e._watcher&&e._watcher.teardown();for(var n=e._watchers.length;n--;)e._watchers[n].teardown();e._data.__ob__&&e._data.__ob__.vmCount--,e._isDestroyed=!0,e.__patch__(e._vnode,null),Zt(e,"destroyed"),e.$off(),e.$el&&(e.$el.__vue__=null),e.$vnode&&(e.$vnode.parent=null)}}}(Sn),function(e){It(e.prototype),e.prototype.$nextTick=function(e){return tt(e,this)},e.prototype._render=function(){var e,t=this,n=t.$options,r=n.render,i=n._parentVnode;i&&(t.$scopedSlots=pt(i.data.scopedSlots,t.$slots,t.$scopedSlots)),t.$vnode=i;try{Gt=t,e=r.call(t._renderProxy,t.$createElement)}catch(n){Ve(n,t,"render"),e=t._vnode}finally{Gt=null}return Array.isArray(e)&&1===e.length&&(e=e[0]),e instanceof ve||(e=ge()),e.parent=i,e}}(Sn);var An=[String,RegExp,Array],Ln={KeepAlive:{name:"keep-alive",abstract:!0,props:{include:An,exclude:An,max:[String,Number]},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var e in this.cache)Cn(this.cache,e,this.keys)},mounted:function(){var e=this;this.$watch("include",(function(t){wn(e,(function(e){return kn(t,e)}))})),this.$watch("exclude",(function(t){wn(e,(function(e){return!kn(t,e)}))}))},render:function(){var e=this.$slots.default,t=zt(e),n=t&&t.componentOptions;if(n){var r=En(n),i=this.include,a=this.exclude;if(i&&(!r||!kn(i,r))||a&&r&&kn(a,r))return t;var s=this.cache,o=this.keys,u=null==t.key?n.Ctor.cid+(n.tag?"::"+n.tag:""):t.key;s[u]?(t.componentInstance=s[u].componentInstance,y(o,u),o.push(u)):(s[u]=t,o.push(u),this.max&&o.length>parseInt(this.max)&&Cn(s,o[0],o,this._vnode)),t.data.keepAlive=!0}return t||e&&e[0]}}};!function(e){var t={get:function(){return N}};Object.defineProperty(e,"config",t),e.util={warn:le,extend:R,mergeOptions:je,defineReactive:Ae},e.set=Le,e.delete=Re,e.nextTick=tt,e.observable=function(e){return Ce(e),e},e.options=Object.create(null),B.forEach((function(t){e.options[t+"s"]=Object.create(null)})),e.options._base=e,R(e.options.components,Ln),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=L(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=je(this.options,e),this}}(e),function(e){e.cid=0;var t=1;e.extend=function(e){e=e||{};var n=this,r=n.cid,i=e._Ctor||(e._Ctor={});if(i[r])return i[r];var a=e.name||n.options.name,s=function(e){this._init(e)};return(s.prototype=Object.create(n.prototype)).constructor=s,s.cid=t++,s.options=je(n.options,e),s.super=n,s.options.props&&function(e){var t=e.options.props;for(var n in t)pn(e.prototype,"_props",n)}(s),s.options.computed&&function(e){var t=e.options.computed;for(var n in t)mn(e.prototype,n,t[n])}(s),s.extend=n.extend,s.mixin=n.mixin,s.use=n.use,B.forEach((function(e){s[e]=n[e]})),a&&(s.options.components[a]=s),s.superOptions=n.options,s.extendOptions=e,s.sealedOptions=R({},s.options),i[r]=s,s}}(e),function(e){B.forEach((function(t){e[t]=function(e,n){return n?("component"===t&&c(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"==typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}}))}(e)}(Sn),Object.defineProperty(Sn.prototype,"$isServer",{get:ie}),Object.defineProperty(Sn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Sn,"FunctionalRenderContext",{value:Ot}),Sn.version="2.6.12";var Rn=v("style,class"),xn=v("input,textarea,option,select,progress"),In=function(e,t,n){return"value"===n&&xn(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},On=v("contenteditable,draggable,spellcheck"),Dn=v("events,caret,typing,plaintext-only"),Pn=v("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),Mn="http://www.w3.org/1999/xlink",jn=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},Un=function(e){return jn(e)?e.slice(6,e.length):""},Bn=function(e){return null==e||!1===e};function Fn(e,t){return{staticClass:Nn(e.staticClass,t.staticClass),class:a(e.class)?[e.class,t.class]:t.class}}function Nn(e,t){return e?t?e+" "+t:e:t||""}function Gn(e){return Array.isArray(e)?function(e){for(var t,n="",r=0,i=e.length;r<i;r++)a(t=Gn(e[r]))&&""!==t&&(n&&(n+=" "),n+=t);return n}(e):u(e)?function(e){var t="";for(var n in e)e[n]&&(t&&(t+=" "),t+=n);return t}(e):"string"==typeof e?e:""}var Vn={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},Hn=v("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot"),zn=v("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),Wn=function(e){return Hn(e)||zn(e)};function Kn(e){return zn(e)?"svg":"math"===e?"math":void 0}var qn=Object.create(null),$n=v("text,number,password,search,email,tel,url");function Yn(e){return"string"==typeof e?document.querySelector(e)||document.createElement("div"):e}var Xn=Object.freeze({createElement:function(e,t){var n=document.createElement(e);return"select"!==e||t.data&&t.data.attrs&&void 0!==t.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n},createElementNS:function(e,t){return document.createElementNS(Vn[e],t)},createTextNode:function(e){return document.createTextNode(e)},createComment:function(e){return document.createComment(e)},insertBefore:function(e,t,n){e.insertBefore(t,n)},removeChild:function(e,t){e.removeChild(t)},appendChild:function(e,t){e.appendChild(t)},parentNode:function(e){return e.parentNode},nextSibling:function(e){return e.nextSibling},tagName:function(e){return e.tagName},setTextContent:function(e,t){e.textContent=t},setStyleScope:function(e,t){e.setAttribute(t,"")}}),Jn={create:function(e,t){Qn(t)},update:function(e,t){e.data.ref!==t.data.ref&&(Qn(e,!0),Qn(t))},destroy:function(e){Qn(e,!0)}};function Qn(e,t){var n=e.data.ref;if(a(n)){var r=e.context,i=e.componentInstance||e.elm,s=r.$refs;t?Array.isArray(s[n])?y(s[n],i):s[n]===i&&(s[n]=void 0):e.data.refInFor?Array.isArray(s[n])?s[n].indexOf(i)<0&&s[n].push(i):s[n]=[i]:s[n]=i}}var Zn=new ve("",{},[]),er=["create","activate","update","remove","destroy"];function tr(e,t){return e.key===t.key&&(e.tag===t.tag&&e.isComment===t.isComment&&a(e.data)===a(t.data)&&function(e,t){if("input"!==e.tag)return!0;var n,r=a(n=e.data)&&a(n=n.attrs)&&n.type,i=a(n=t.data)&&a(n=n.attrs)&&n.type;return r===i||$n(r)&&$n(i)}(e,t)||s(e.isAsyncPlaceholder)&&e.asyncFactory===t.asyncFactory&&i(t.asyncFactory.error))}function nr(e,t,n){var r,i,s={};for(r=t;r<=n;++r)a(i=e[r].key)&&(s[i]=r);return s}var rr={create:ir,update:ir,destroy:function(e){ir(e,Zn)}};function ir(e,t){(e.data.directives||t.data.directives)&&function(e,t){var n,r,i,a=e===Zn,s=t===Zn,o=sr(e.data.directives,e.context),u=sr(t.data.directives,t.context),l=[],c=[];for(n in u)r=o[n],i=u[n],r?(i.oldValue=r.value,i.oldArg=r.arg,ur(i,"update",t,e),i.def&&i.def.componentUpdated&&c.push(i)):(ur(i,"bind",t,e),i.def&&i.def.inserted&&l.push(i));if(l.length){var d=function(){for(var n=0;n<l.length;n++)ur(l[n],"inserted",t,e)};a?ot(t,"insert",d):d()}if(c.length&&ot(t,"postpatch",(function(){for(var n=0;n<c.length;n++)ur(c[n],"componentUpdated",t,e)})),!a)for(n in o)u[n]||ur(o[n],"unbind",e,e,s)}(e,t)}var ar=Object.create(null);function sr(e,t){var n,r,i=Object.create(null);if(!e)return i;for(n=0;n<e.length;n++)(r=e[n]).modifiers||(r.modifiers=ar),i[or(r)]=r,r.def=Ue(t.$options,"directives",r.name);return i}function or(e){return e.rawName||e.name+"."+Object.keys(e.modifiers||{}).join(".")}function ur(e,t,n,r,i){var a=e.def&&e.def[t];if(a)try{a(n.elm,e,n,r,i)}catch(r){Ve(r,n.context,"directive "+e.name+" "+t+" hook")}}var lr=[Jn,rr];function cr(e,t){var n=t.componentOptions;if(!(a(n)&&!1===n.Ctor.options.inheritAttrs||i(e.data.attrs)&&i(t.data.attrs))){var r,s,o=t.elm,u=e.data.attrs||{},l=t.data.attrs||{};for(r in a(l.__ob__)&&(l=t.data.attrs=R({},l)),l)s=l[r],u[r]!==s&&dr(o,r,s);for(r in(X||Q)&&l.value!==u.value&&dr(o,"value",l.value),u)i(l[r])&&(jn(r)?o.removeAttributeNS(Mn,Un(r)):On(r)||o.removeAttribute(r))}}function dr(e,t,n){e.tagName.indexOf("-")>-1?hr(e,t,n):Pn(t)?Bn(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):On(t)?e.setAttribute(t,function(e,t){return Bn(t)||"false"===t?"false":"contenteditable"===e&&Dn(t)?t:"true"}(t,n)):jn(t)?Bn(n)?e.removeAttributeNS(Mn,Un(t)):e.setAttributeNS(Mn,t,n):hr(e,t,n)}function hr(e,t,n){if(Bn(n))e.removeAttribute(t);else{if(X&&!J&&"TEXTAREA"===e.tagName&&"placeholder"===t&&""!==n&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}var fr={create:cr,update:cr};function pr(e,t){var n=t.elm,r=t.data,s=e.data;if(!(i(r.staticClass)&&i(r.class)&&(i(s)||i(s.staticClass)&&i(s.class)))){var o=function(e){for(var t=e.data,n=e,r=e;a(r.componentInstance);)(r=r.componentInstance._vnode)&&r.data&&(t=Fn(r.data,t));for(;a(n=n.parent);)n&&n.data&&(t=Fn(t,n.data));return function(e,t){return a(e)||a(t)?Nn(e,Gn(t)):""}(t.staticClass,t.class)}(t),u=n._transitionClasses;a(u)&&(o=Nn(o,Gn(u))),o!==n._prevClass&&(n.setAttribute("class",o),n._prevClass=o)}}var vr,mr,gr,yr,_r,br,Tr={create:pr,update:pr},Sr=/[\w).+\-_$\]]/;function Er(e){var t,n,r,i,a,s=!1,o=!1,u=!1,l=!1,c=0,d=0,h=0,f=0;for(r=0;r<e.length;r++)if(n=t,t=e.charCodeAt(r),s)39===t&&92!==n&&(s=!1);else if(o)34===t&&92!==n&&(o=!1);else if(u)96===t&&92!==n&&(u=!1);else if(l)47===t&&92!==n&&(l=!1);else if(124!==t||124===e.charCodeAt(r+1)||124===e.charCodeAt(r-1)||c||d||h){switch(t){case 34:o=!0;break;case 39:s=!0;break;case 96:u=!0;break;case 40:h++;break;case 41:h--;break;case 91:d++;break;case 93:d--;break;case 123:c++;break;case 125:c--}if(47===t){for(var p=r-1,v=void 0;p>=0&&" "===(v=e.charAt(p));p--);v&&Sr.test(v)||(l=!0)}}else void 0===i?(f=r+1,i=e.slice(0,r).trim()):m();function m(){(a||(a=[])).push(e.slice(f,r).trim()),f=r+1}if(void 0===i?i=e.slice(0,r).trim():0!==f&&m(),a)for(r=0;r<a.length;r++)i=kr(i,a[r]);return i}function kr(e,t){var n=t.indexOf("(");if(n<0)return'_f("'+t+'")('+e+")";var r=t.slice(0,n),i=t.slice(n+1);return'_f("'+r+'")('+e+(")"!==i?","+i:i)}function wr(e,t){console.error("[Vue compiler]: "+e)}function Cr(e,t){return e?e.map((function(e){return e[t]})).filter((function(e){return e})):[]}function Ar(e,t,n,r,i){(e.props||(e.props=[])).push(jr({name:t,value:n,dynamic:i},r)),e.plain=!1}function Lr(e,t,n,r,i){(i?e.dynamicAttrs||(e.dynamicAttrs=[]):e.attrs||(e.attrs=[])).push(jr({name:t,value:n,dynamic:i},r)),e.plain=!1}function Rr(e,t,n,r){e.attrsMap[t]=n,e.attrsList.push(jr({name:t,value:n},r))}function xr(e,t,n,r,i,a,s,o){(e.directives||(e.directives=[])).push(jr({name:t,rawName:n,value:r,arg:i,isDynamicArg:a,modifiers:s},o)),e.plain=!1}function Ir(e,t,n){return n?"_p("+t+',"'+e+'")':e+t}function Or(e,t,n,i,a,s,o,u){var l;(i=i||r).right?u?t="("+t+")==='click'?'contextmenu':("+t+")":"click"===t&&(t="contextmenu",delete i.right):i.middle&&(u?t="("+t+")==='click'?'mouseup':("+t+")":"click"===t&&(t="mouseup")),i.capture&&(delete i.capture,t=Ir("!",t,u)),i.once&&(delete i.once,t=Ir("~",t,u)),i.passive&&(delete i.passive,t=Ir("&",t,u)),i.native?(delete i.native,l=e.nativeEvents||(e.nativeEvents={})):l=e.events||(e.events={});var c=jr({value:n.trim(),dynamic:u},o);i!==r&&(c.modifiers=i);var d=l[t];Array.isArray(d)?a?d.unshift(c):d.push(c):l[t]=d?a?[c,d]:[d,c]:c,e.plain=!1}function Dr(e,t,n){var r=Pr(e,":"+t)||Pr(e,"v-bind:"+t);if(null!=r)return Er(r);if(!1!==n){var i=Pr(e,t);if(null!=i)return JSON.stringify(i)}}function Pr(e,t,n){var r;if(null!=(r=e.attrsMap[t]))for(var i=e.attrsList,a=0,s=i.length;a<s;a++)if(i[a].name===t){i.splice(a,1);break}return n&&delete e.attrsMap[t],r}function Mr(e,t){for(var n=e.attrsList,r=0,i=n.length;r<i;r++){var a=n[r];if(t.test(a.name))return n.splice(r,1),a}}function jr(e,t){return t&&(null!=t.start&&(e.start=t.start),null!=t.end&&(e.end=t.end)),e}function Ur(e,t,n){var r=n||{},i=r.number,a="$$v";r.trim&&(a="(typeof $$v === 'string'? $$v.trim(): $$v)"),i&&(a="_n("+a+")");var s=Br(t,a);e.model={value:"("+t+")",expression:JSON.stringify(t),callback:"function ($$v) {"+s+"}"}}function Br(e,t){var n=function(e){if(e=e.trim(),vr=e.length,e.indexOf("[")<0||e.lastIndexOf("]")<vr-1)return(yr=e.lastIndexOf("."))>-1?{exp:e.slice(0,yr),key:'"'+e.slice(yr+1)+'"'}:{exp:e,key:null};for(mr=e,yr=_r=br=0;!Nr();)Gr(gr=Fr())?Hr(gr):91===gr&&Vr(gr);return{exp:e.slice(0,_r),key:e.slice(_r+1,br)}}(e);return null===n.key?e+"="+t:"$set("+n.exp+", "+n.key+", "+t+")"}function Fr(){return mr.charCodeAt(++yr)}function Nr(){return yr>=vr}function Gr(e){return 34===e||39===e}function Vr(e){var t=1;for(_r=yr;!Nr();)if(Gr(e=Fr()))Hr(e);else if(91===e&&t++,93===e&&t--,0===t){br=yr;break}}function Hr(e){for(var t=e;!Nr()&&(e=Fr())!==t;);}var zr,Wr="__r";function Kr(e,t,n){var r=zr;return function i(){null!==t.apply(null,arguments)&&Yr(e,i,n,r)}}var qr=qe&&!(ee&&Number(ee[1])<=53);function $r(e,t,n,r){if(qr){var i=on,a=t;t=a._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=i||e.timeStamp<=0||e.target.ownerDocument!==document)return a.apply(this,arguments)}}zr.addEventListener(e,t,ne?{capture:n,passive:r}:n)}function Yr(e,t,n,r){(r||zr).removeEventListener(e,t._wrapper||t,n)}function Xr(e,t){if(!i(e.data.on)||!i(t.data.on)){var n=t.data.on||{},r=e.data.on||{};zr=t.elm,function(e){if(a(e.__r)){var t=X?"change":"input";e[t]=[].concat(e.__r,e[t]||[]),delete e.__r}a(e.__c)&&(e.change=[].concat(e.__c,e.change||[]),delete e.__c)}(n),st(n,r,$r,Yr,Kr,t.context),zr=void 0}}var Jr,Qr={create:Xr,update:Xr};function Zr(e,t){if(!i(e.data.domProps)||!i(t.data.domProps)){var n,r,s=t.elm,o=e.data.domProps||{},u=t.data.domProps||{};for(n in a(u.__ob__)&&(u=t.data.domProps=R({},u)),o)n in u||(s[n]="");for(n in u){if(r=u[n],"textContent"===n||"innerHTML"===n){if(t.children&&(t.children.length=0),r===o[n])continue;1===s.childNodes.length&&s.removeChild(s.childNodes[0])}if("value"===n&&"PROGRESS"!==s.tagName){s._value=r;var l=i(r)?"":String(r);ei(s,l)&&(s.value=l)}else if("innerHTML"===n&&zn(s.tagName)&&i(s.innerHTML)){(Jr=Jr||document.createElement("div")).innerHTML="<svg>"+r+"</svg>";for(var c=Jr.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;c.firstChild;)s.appendChild(c.firstChild)}else if(r!==o[n])try{s[n]=r}catch(e){}}}}function ei(e,t){return!e.composing&&("OPTION"===e.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(e,t)||function(e,t){var n=e.value,r=e._vModifiers;if(a(r)){if(r.number)return p(n)!==p(t);if(r.trim)return n.trim()!==t.trim()}return n!==t}(e,t))}var ti={create:Zr,update:Zr},ni=T((function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach((function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}})),t}));function ri(e){var t=ii(e.style);return e.staticStyle?R(e.staticStyle,t):t}function ii(e){return Array.isArray(e)?x(e):"string"==typeof e?ni(e):e}var ai,si=/^--/,oi=/\s*!important$/,ui=function(e,t,n){if(si.test(t))e.style.setProperty(t,n);else if(oi.test(n))e.style.setProperty(C(t),n.replace(oi,""),"important");else{var r=ci(t);if(Array.isArray(n))for(var i=0,a=n.length;i<a;i++)e.style[r]=n[i];else e.style[r]=n}},li=["Webkit","Moz","ms"],ci=T((function(e){if(ai=ai||document.createElement("div").style,"filter"!==(e=E(e))&&e in ai)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<li.length;n++){var r=li[n]+t;if(r in ai)return r}}));function di(e,t){var n=t.data,r=e.data;if(!(i(n.staticStyle)&&i(n.style)&&i(r.staticStyle)&&i(r.style))){var s,o,u=t.elm,l=r.staticStyle,c=r.normalizedStyle||r.style||{},d=l||c,h=ii(t.data.style)||{};t.data.normalizedStyle=a(h.__ob__)?R({},h):h;var f=function(e,t){for(var n,r={},i=e;i.componentInstance;)(i=i.componentInstance._vnode)&&i.data&&(n=ri(i.data))&&R(r,n);(n=ri(e.data))&&R(r,n);for(var a=e;a=a.parent;)a.data&&(n=ri(a.data))&&R(r,n);return r}(t);for(o in d)i(f[o])&&ui(u,o,"");for(o in f)(s=f[o])!==d[o]&&ui(u,o,null==s?"":s)}}var hi={create:di,update:di},fi=/\s+/;function pi(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(fi).forEach((function(t){return e.classList.add(t)})):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function vi(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(fi).forEach((function(t){return e.classList.remove(t)})):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" "+(e.getAttribute("class")||"")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function mi(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&R(t,gi(e.name||"v")),R(t,e),t}return"string"==typeof e?gi(e):void 0}}var gi=T((function(e){return{enterClass:e+"-enter",enterToClass:e+"-enter-to",enterActiveClass:e+"-enter-active",leaveClass:e+"-leave",leaveToClass:e+"-leave-to",leaveActiveClass:e+"-leave-active"}})),yi=K&&!J,_i="transition",bi="animation",Ti="transition",Si="transitionend",Ei="animation",ki="animationend";yi&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Ti="WebkitTransition",Si="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Ei="WebkitAnimation",ki="webkitAnimationEnd"));var wi=K?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function Ci(e){wi((function(){wi(e)}))}function Ai(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),pi(e,t))}function Li(e,t){e._transitionClasses&&y(e._transitionClasses,t),vi(e,t)}function Ri(e,t,n){var r=Ii(e,t),i=r.type,a=r.timeout,s=r.propCount;if(!i)return n();var o=i===_i?Si:ki,u=0,l=function(){e.removeEventListener(o,c),n()},c=function(t){t.target===e&&++u>=s&&l()};setTimeout((function(){u<s&&l()}),a+1),e.addEventListener(o,c)}var xi=/\b(transform|all)(,|$)/;function Ii(e,t){var n,r=window.getComputedStyle(e),i=(r[Ti+"Delay"]||"").split(", "),a=(r[Ti+"Duration"]||"").split(", "),s=Oi(i,a),o=(r[Ei+"Delay"]||"").split(", "),u=(r[Ei+"Duration"]||"").split(", "),l=Oi(o,u),c=0,d=0;return t===_i?s>0&&(n=_i,c=s,d=a.length):t===bi?l>0&&(n=bi,c=l,d=u.length):d=(n=(c=Math.max(s,l))>0?s>l?_i:bi:null)?n===_i?a.length:u.length:0,{type:n,timeout:c,propCount:d,hasTransform:n===_i&&xi.test(r[Ti+"Property"])}}function Oi(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max.apply(null,t.map((function(t,n){return Di(t)+Di(e[n])})))}function Di(e){return 1e3*Number(e.slice(0,-1).replace(",","."))}function Pi(e,t){var n=e.elm;a(n._leaveCb)&&(n._leaveCb.cancelled=!0,n._leaveCb());var r=mi(e.data.transition);if(!i(r)&&!a(n._enterCb)&&1===n.nodeType){for(var s=r.css,o=r.type,l=r.enterClass,c=r.enterToClass,d=r.enterActiveClass,h=r.appearClass,f=r.appearToClass,v=r.appearActiveClass,m=r.beforeEnter,g=r.enter,y=r.afterEnter,_=r.enterCancelled,b=r.beforeAppear,T=r.appear,S=r.afterAppear,E=r.appearCancelled,k=r.duration,w=Yt,C=Yt.$vnode;C&&C.parent;)w=C.context,C=C.parent;var A=!w._isMounted||!e.isRootInsert;if(!A||T||""===T){var L=A&&h?h:l,R=A&&v?v:d,x=A&&f?f:c,I=A&&b||m,O=A&&"function"==typeof T?T:g,D=A&&S||y,P=A&&E||_,M=p(u(k)?k.enter:k),U=!1!==s&&!J,B=Ui(O),F=n._enterCb=j((function(){U&&(Li(n,x),Li(n,R)),F.cancelled?(U&&Li(n,L),P&&P(n)):D&&D(n),n._enterCb=null}));e.data.show||ot(e,"insert",(function(){var t=n.parentNode,r=t&&t._pending&&t._pending[e.key];r&&r.tag===e.tag&&r.elm._leaveCb&&r.elm._leaveCb(),O&&O(n,F)})),I&&I(n),U&&(Ai(n,L),Ai(n,R),Ci((function(){Li(n,L),F.cancelled||(Ai(n,x),B||(ji(M)?setTimeout(F,M):Ri(n,o,F)))}))),e.data.show&&(t&&t(),O&&O(n,F)),U||B||F()}}}function Mi(e,t){var n=e.elm;a(n._enterCb)&&(n._enterCb.cancelled=!0,n._enterCb());var r=mi(e.data.transition);if(i(r)||1!==n.nodeType)return t();if(!a(n._leaveCb)){var s=r.css,o=r.type,l=r.leaveClass,c=r.leaveToClass,d=r.leaveActiveClass,h=r.beforeLeave,f=r.leave,v=r.afterLeave,m=r.leaveCancelled,g=r.delayLeave,y=r.duration,_=!1!==s&&!J,b=Ui(f),T=p(u(y)?y.leave:y),S=n._leaveCb=j((function(){n.parentNode&&n.parentNode._pending&&(n.parentNode._pending[e.key]=null),_&&(Li(n,c),Li(n,d)),S.cancelled?(_&&Li(n,l),m&&m(n)):(t(),v&&v(n)),n._leaveCb=null}));g?g(E):E()}function E(){S.cancelled||(!e.data.show&&n.parentNode&&((n.parentNode._pending||(n.parentNode._pending={}))[e.key]=e),h&&h(n),_&&(Ai(n,l),Ai(n,d),Ci((function(){Li(n,l),S.cancelled||(Ai(n,c),b||(ji(T)?setTimeout(S,T):Ri(n,o,S)))}))),f&&f(n,S),_||b||S())}}function ji(e){return"number"==typeof e&&!isNaN(e)}function Ui(e){if(i(e))return!1;var t=e.fns;return a(t)?Ui(Array.isArray(t)?t[0]:t):(e._length||e.length)>1}function Bi(e,t){!0!==t.data.show&&Pi(t)}var Fi=function(e){var t,n,r={},u=e.modules,l=e.nodeOps;for(t=0;t<er.length;++t)for(r[er[t]]=[],n=0;n<u.length;++n)a(u[n][er[t]])&&r[er[t]].push(u[n][er[t]]);function c(e){var t=l.parentNode(e);a(t)&&l.removeChild(t,e)}function d(e,t,n,i,o,u,c){if(a(e.elm)&&a(u)&&(e=u[c]=_e(e)),e.isRootInsert=!o,!function(e,t,n,i){var o=e.data;if(a(o)){var u=a(e.componentInstance)&&o.keepAlive;if(a(o=o.hook)&&a(o=o.init)&&o(e,!1),a(e.componentInstance))return h(e,t),f(n,e.elm,i),s(u)&&function(e,t,n,i){for(var s,o=e;o.componentInstance;)if(a(s=(o=o.componentInstance._vnode).data)&&a(s=s.transition)){for(s=0;s<r.activate.length;++s)r.activate[s](Zn,o);t.push(o);break}f(n,e.elm,i)}(e,t,n,i),!0}}(e,t,n,i)){var d=e.data,v=e.children,m=e.tag;a(m)?(e.elm=e.ns?l.createElementNS(e.ns,m):l.createElement(m,e),y(e),p(e,v,t),a(d)&&g(e,t),f(n,e.elm,i)):s(e.isComment)?(e.elm=l.createComment(e.text),f(n,e.elm,i)):(e.elm=l.createTextNode(e.text),f(n,e.elm,i))}}function h(e,t){a(e.data.pendingInsert)&&(t.push.apply(t,e.data.pendingInsert),e.data.pendingInsert=null),e.elm=e.componentInstance.$el,m(e)?(g(e,t),y(e)):(Qn(e),t.push(e))}function f(e,t,n){a(e)&&(a(n)?l.parentNode(n)===e&&l.insertBefore(e,t,n):l.appendChild(e,t))}function p(e,t,n){if(Array.isArray(t))for(var r=0;r<t.length;++r)d(t[r],n,e.elm,null,!0,t,r);else o(e.text)&&l.appendChild(e.elm,l.createTextNode(String(e.text)))}function m(e){for(;e.componentInstance;)e=e.componentInstance._vnode;return a(e.tag)}function g(e,n){for(var i=0;i<r.create.length;++i)r.create[i](Zn,e);a(t=e.data.hook)&&(a(t.create)&&t.create(Zn,e),a(t.insert)&&n.push(e))}function y(e){var t;if(a(t=e.fnScopeId))l.setStyleScope(e.elm,t);else for(var n=e;n;)a(t=n.context)&&a(t=t.$options._scopeId)&&l.setStyleScope(e.elm,t),n=n.parent;a(t=Yt)&&t!==e.context&&t!==e.fnContext&&a(t=t.$options._scopeId)&&l.setStyleScope(e.elm,t)}function _(e,t,n,r,i,a){for(;r<=i;++r)d(n[r],a,e,t,!1,n,r)}function b(e){var t,n,i=e.data;if(a(i))for(a(t=i.hook)&&a(t=t.destroy)&&t(e),t=0;t<r.destroy.length;++t)r.destroy[t](e);if(a(t=e.children))for(n=0;n<e.children.length;++n)b(e.children[n])}function T(e,t,n){for(;t<=n;++t){var r=e[t];a(r)&&(a(r.tag)?(S(r),b(r)):c(r.elm))}}function S(e,t){if(a(t)||a(e.data)){var n,i=r.remove.length+1;for(a(t)?t.listeners+=i:t=function(e,t){function n(){0==--n.listeners&&c(e)}return n.listeners=t,n}(e.elm,i),a(n=e.componentInstance)&&a(n=n._vnode)&&a(n.data)&&S(n,t),n=0;n<r.remove.length;++n)r.remove[n](e,t);a(n=e.data.hook)&&a(n=n.remove)?n(e,t):t()}else c(e.elm)}function E(e,t,n,r){for(var i=n;i<r;i++){var s=t[i];if(a(s)&&tr(e,s))return i}}function k(e,t,n,o,u,c){if(e!==t){a(t.elm)&&a(o)&&(t=o[u]=_e(t));var h=t.elm=e.elm;if(s(e.isAsyncPlaceholder))a(t.asyncFactory.resolved)?A(e.elm,t,n):t.isAsyncPlaceholder=!0;else if(s(t.isStatic)&&s(e.isStatic)&&t.key===e.key&&(s(t.isCloned)||s(t.isOnce)))t.componentInstance=e.componentInstance;else{var f,p=t.data;a(p)&&a(f=p.hook)&&a(f=f.prepatch)&&f(e,t);var v=e.children,g=t.children;if(a(p)&&m(t)){for(f=0;f<r.update.length;++f)r.update[f](e,t);a(f=p.hook)&&a(f=f.update)&&f(e,t)}i(t.text)?a(v)&&a(g)?v!==g&&function(e,t,n,r,s){for(var o,u,c,h=0,f=0,p=t.length-1,v=t[0],m=t[p],g=n.length-1,y=n[0],b=n[g],S=!s;h<=p&&f<=g;)i(v)?v=t[++h]:i(m)?m=t[--p]:tr(v,y)?(k(v,y,r,n,f),v=t[++h],y=n[++f]):tr(m,b)?(k(m,b,r,n,g),m=t[--p],b=n[--g]):tr(v,b)?(k(v,b,r,n,g),S&&l.insertBefore(e,v.elm,l.nextSibling(m.elm)),v=t[++h],b=n[--g]):tr(m,y)?(k(m,y,r,n,f),S&&l.insertBefore(e,m.elm,v.elm),m=t[--p],y=n[++f]):(i(o)&&(o=nr(t,h,p)),i(u=a(y.key)?o[y.key]:E(y,t,h,p))?d(y,r,e,v.elm,!1,n,f):tr(c=t[u],y)?(k(c,y,r,n,f),t[u]=void 0,S&&l.insertBefore(e,c.elm,v.elm)):d(y,r,e,v.elm,!1,n,f),y=n[++f]);h>p?_(e,i(n[g+1])?null:n[g+1].elm,n,f,g,r):f>g&&T(t,h,p)}(h,v,g,n,c):a(g)?(a(e.text)&&l.setTextContent(h,""),_(h,null,g,0,g.length-1,n)):a(v)?T(v,0,v.length-1):a(e.text)&&l.setTextContent(h,""):e.text!==t.text&&l.setTextContent(h,t.text),a(p)&&a(f=p.hook)&&a(f=f.postpatch)&&f(e,t)}}}function w(e,t,n){if(s(n)&&a(e.parent))e.parent.data.pendingInsert=t;else for(var r=0;r<t.length;++r)t[r].data.hook.insert(t[r])}var C=v("attrs,class,staticClass,staticStyle,key");function A(e,t,n,r){var i,o=t.tag,u=t.data,l=t.children;if(r=r||u&&u.pre,t.elm=e,s(t.isComment)&&a(t.asyncFactory))return t.isAsyncPlaceholder=!0,!0;if(a(u)&&(a(i=u.hook)&&a(i=i.init)&&i(t,!0),a(i=t.componentInstance)))return h(t,n),!0;if(a(o)){if(a(l))if(e.hasChildNodes())if(a(i=u)&&a(i=i.domProps)&&a(i=i.innerHTML)){if(i!==e.innerHTML)return!1}else{for(var c=!0,d=e.firstChild,f=0;f<l.length;f++){if(!d||!A(d,l[f],n,r)){c=!1;break}d=d.nextSibling}if(!c||d)return!1}else p(t,l,n);if(a(u)){var v=!1;for(var m in u)if(!C(m)){v=!0,g(t,n);break}!v&&u.class&&rt(u.class)}}else e.data!==t.text&&(e.data=t.text);return!0}return function(e,t,n,o){if(!i(t)){var u,c=!1,h=[];if(i(e))c=!0,d(t,h);else{var f=a(e.nodeType);if(!f&&tr(e,t))k(e,t,h,null,null,o);else{if(f){if(1===e.nodeType&&e.hasAttribute(U)&&(e.removeAttribute(U),n=!0),s(n)&&A(e,t,h))return w(t,h,!0),e;u=e,e=new ve(l.tagName(u).toLowerCase(),{},[],void 0,u)}var p=e.elm,v=l.parentNode(p);if(d(t,h,p._leaveCb?null:v,l.nextSibling(p)),a(t.parent))for(var g=t.parent,y=m(t);g;){for(var _=0;_<r.destroy.length;++_)r.destroy[_](g);if(g.elm=t.elm,y){for(var S=0;S<r.create.length;++S)r.create[S](Zn,g);var E=g.data.hook.insert;if(E.merged)for(var C=1;C<E.fns.length;C++)E.fns[C]()}else Qn(g);g=g.parent}a(v)?T([e],0,0):a(e.tag)&&b(e)}}return w(t,h,c),t.elm}a(e)&&b(e)}}({nodeOps:Xn,modules:[fr,Tr,Qr,ti,hi,K?{create:Bi,activate:Bi,remove:function(e,t){!0!==e.data.show?Mi(e,t):t()}}:{}].concat(lr)});J&&document.addEventListener("selectionchange",(function(){var e=document.activeElement;e&&e.vmodel&&qi(e,"input")}));var Ni={inserted:function(e,t,n,r){"select"===n.tag?(r.elm&&!r.elm._vOptions?ot(n,"postpatch",(function(){Ni.componentUpdated(e,t,n)})):Gi(e,t,n.context),e._vOptions=[].map.call(e.options,zi)):("textarea"===n.tag||$n(e.type))&&(e._vModifiers=t.modifiers,t.modifiers.lazy||(e.addEventListener("compositionstart",Wi),e.addEventListener("compositionend",Ki),e.addEventListener("change",Ki),J&&(e.vmodel=!0)))},componentUpdated:function(e,t,n){if("select"===n.tag){Gi(e,t,n.context);var r=e._vOptions,i=e._vOptions=[].map.call(e.options,zi);i.some((function(e,t){return!P(e,r[t])}))&&(e.multiple?t.value.some((function(e){return Hi(e,i)})):t.value!==t.oldValue&&Hi(t.value,i))&&qi(e,"change")}}};function Gi(e,t,n){Vi(e,t,n),(X||Q)&&setTimeout((function(){Vi(e,t,n)}),0)}function Vi(e,t,n){var r=t.value,i=e.multiple;if(!i||Array.isArray(r)){for(var a,s,o=0,u=e.options.length;o<u;o++)if(s=e.options[o],i)a=M(r,zi(s))>-1,s.selected!==a&&(s.selected=a);else if(P(zi(s),r))return void(e.selectedIndex!==o&&(e.selectedIndex=o));i||(e.selectedIndex=-1)}}function Hi(e,t){return t.every((function(t){return!P(t,e)}))}function zi(e){return"_value"in e?e._value:e.value}function Wi(e){e.target.composing=!0}function Ki(e){e.target.composing&&(e.target.composing=!1,qi(e.target,"input"))}function qi(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function $i(e){return!e.componentInstance||e.data&&e.data.transition?e:$i(e.componentInstance._vnode)}var Yi={model:Ni,show:{bind:function(e,t,n){var r=t.value,i=(n=$i(n)).data&&n.data.transition,a=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&i?(n.data.show=!0,Pi(n,(function(){e.style.display=a}))):e.style.display=r?a:"none"},update:function(e,t,n){var r=t.value;!r!=!t.oldValue&&((n=$i(n)).data&&n.data.transition?(n.data.show=!0,r?Pi(n,(function(){e.style.display=e.__vOriginalDisplay})):Mi(n,(function(){e.style.display="none"}))):e.style.display=r?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,r,i){i||(e.style.display=e.__vOriginalDisplay)}}},Xi={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function Ji(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?Ji(zt(t.children)):e}function Qi(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var i=n._parentListeners;for(var a in i)t[E(a)]=i[a];return t}function Zi(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}var ea=function(e){return e.tag||Ht(e)},ta=function(e){return"show"===e.name},na={name:"transition",props:Xi,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(ea)).length){var r=this.mode,i=n[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return i;var a=Ji(i);if(!a)return i;if(this._leaving)return Zi(e,i);var s="__transition-"+this._uid+"-";a.key=null==a.key?a.isComment?s+"comment":s+a.tag:o(a.key)?0===String(a.key).indexOf(s)?a.key:s+a.key:a.key;var u=(a.data||(a.data={})).transition=Qi(this),l=this._vnode,c=Ji(l);if(a.data.directives&&a.data.directives.some(ta)&&(a.data.show=!0),c&&c.data&&!function(e,t){return t.key===e.key&&t.tag===e.tag}(a,c)&&!Ht(c)&&(!c.componentInstance||!c.componentInstance._vnode.isComment)){var d=c.data.transition=R({},u);if("out-in"===r)return this._leaving=!0,ot(d,"afterLeave",(function(){t._leaving=!1,t.$forceUpdate()})),Zi(e,i);if("in-out"===r){if(Ht(a))return l;var h,f=function(){h()};ot(u,"afterEnter",f),ot(u,"enterCancelled",f),ot(d,"delayLeave",(function(e){h=e}))}}return i}}},ra=R({tag:String,moveClass:String},Xi);function ia(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function aa(e){e.data.newPos=e.elm.getBoundingClientRect()}function sa(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,i=t.top-n.top;if(r||i){e.data.moved=!0;var a=e.elm.style;a.transform=a.WebkitTransform="translate("+r+"px,"+i+"px)",a.transitionDuration="0s"}}delete ra.mode;var oa={Transition:na,TransitionGroup:{props:ra,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var i=Xt(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,i(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],a=this.children=[],s=Qi(this),o=0;o<i.length;o++){var u=i[o];u.tag&&null!=u.key&&0!==String(u.key).indexOf("__vlist")&&(a.push(u),n[u.key]=u,(u.data||(u.data={})).transition=s)}if(r){for(var l=[],c=[],d=0;d<r.length;d++){var h=r[d];h.data.transition=s,h.data.pos=h.elm.getBoundingClientRect(),n[h.key]?l.push(h):c.push(h)}this.kept=e(t,null,l),this.removed=c}return e(t,null,a)},updated:function(){var e=this.prevChildren,t=this.moveClass||(this.name||"v")+"-move";e.length&&this.hasMove(e[0].elm,t)&&(e.forEach(ia),e.forEach(aa),e.forEach(sa),this._reflow=document.body.offsetHeight,e.forEach((function(e){if(e.data.moved){var n=e.elm,r=n.style;Ai(n,t),r.transform=r.WebkitTransform=r.transitionDuration="",n.addEventListener(Si,n._moveCb=function e(r){r&&r.target!==n||r&&!/transform$/.test(r.propertyName)||(n.removeEventListener(Si,e),n._moveCb=null,Li(n,t))})}})))},methods:{hasMove:function(e,t){if(!yi)return!1;if(this._hasMove)return this._hasMove;var n=e.cloneNode();e._transitionClasses&&e._transitionClasses.forEach((function(e){vi(n,e)})),pi(n,t),n.style.display="none",this.$el.appendChild(n);var r=Ii(n);return this.$el.removeChild(n),this._hasMove=r.hasTransform}}}};Sn.config.mustUseProp=In,Sn.config.isReservedTag=Wn,Sn.config.isReservedAttr=Rn,Sn.config.getTagNamespace=Kn,Sn.config.isUnknownElement=function(e){if(!K)return!0;if(Wn(e))return!1;if(e=e.toLowerCase(),null!=qn[e])return qn[e];var t=document.createElement(e);return e.indexOf("-")>-1?qn[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:qn[e]=/HTMLUnknownElement/.test(t.toString())},R(Sn.options.directives,Yi),R(Sn.options.components,oa),Sn.prototype.__patch__=K?Fi:I,Sn.prototype.$mount=function(e,t){return function(e,t,n){var r;return e.$el=t,e.$options.render||(e.$options.render=ge),Zt(e,"beforeMount"),r=function(){e._update(e._render(),n)},new hn(e,r,I,{before:function(){e._isMounted&&!e._isDestroyed&&Zt(e,"beforeUpdate")}},!0),n=!1,null==e.$vnode&&(e._isMounted=!0,Zt(e,"mounted")),e}(this,e=e&&K?Yn(e):void 0,t)},K&&setTimeout((function(){N.devtools&&ae&&ae.emit("init",Sn)}),0);var ua,la=/\{\{((?:.|\r?\n)+?)\}\}/g,ca=/[-.*+?^${}()|[\]\/\\]/g,da=T((function(e){var t=e[0].replace(ca,"\\$&"),n=e[1].replace(ca,"\\$&");return new RegExp(t+"((?:.|\\n)+?)"+n,"g")})),ha={staticKeys:["staticClass"],transformNode:function(e,t){t.warn;var n=Pr(e,"class");n&&(e.staticClass=JSON.stringify(n));var r=Dr(e,"class",!1);r&&(e.classBinding=r)},genData:function(e){var t="";return e.staticClass&&(t+="staticClass:"+e.staticClass+","),e.classBinding&&(t+="class:"+e.classBinding+","),t}},fa={staticKeys:["staticStyle"],transformNode:function(e,t){t.warn;var n=Pr(e,"style");n&&(e.staticStyle=JSON.stringify(ni(n)));var r=Dr(e,"style",!1);r&&(e.styleBinding=r)},genData:function(e){var t="";return e.staticStyle&&(t+="staticStyle:"+e.staticStyle+","),e.styleBinding&&(t+="style:("+e.styleBinding+"),"),t}},pa=v("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),va=v("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),ma=v("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),ga=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,ya=/^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,_a="[a-zA-Z_][\\-\\.0-9_a-zA-Z"+G.source+"]*",ba="((?:"+_a+"\\:)?"+_a+")",Ta=new RegExp("^<"+ba),Sa=/^\s*(\/?)>/,Ea=new RegExp("^<\\/"+ba+"[^>]*>"),ka=/^<!DOCTYPE [^>]+>/i,wa=/^<!\--/,Ca=/^<!\[/,Aa=v("script,style,textarea",!0),La={},Ra={"&lt;":"<","&gt;":">","&quot;":'"',"&amp;":"&","&#10;":"\n","&#9;":"\t","&#39;":"'"},xa=/&(?:lt|gt|quot|amp|#39);/g,Ia=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,Oa=v("pre,textarea",!0),Da=function(e,t){return e&&Oa(e)&&"\n"===t[0]};function Pa(e,t){var n=t?Ia:xa;return e.replace(n,(function(e){return Ra[e]}))}var Ma,ja,Ua,Ba,Fa,Na,Ga,Va,Ha=/^@|^v-on:/,za=/^v-|^@|^:|^#/,Wa=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,Ka=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,qa=/^\(|\)$/g,$a=/^\[.*\]$/,Ya=/:(.*)$/,Xa=/^:|^\.|^v-bind:/,Ja=/\.[^.\]]+(?=[^\]]*$)/g,Qa=/^v-slot(:|$)|^#/,Za=/[\r\n]/,es=/\s+/g,ts=T((function(e){return(ua=ua||document.createElement("div")).innerHTML=e,ua.textContent})),ns="_empty_";function rs(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:ls(t),rawAttrsMap:{},parent:n,children:[]}}function is(e,t){var n,r;(r=Dr(n=e,"key"))&&(n.key=r),e.plain=!e.key&&!e.scopedSlots&&!e.attrsList.length,function(e){var t=Dr(e,"ref");t&&(e.ref=t,e.refInFor=function(e){for(var t=e;t;){if(void 0!==t.for)return!0;t=t.parent}return!1}(e))}(e),function(e){var t;"template"===e.tag?(t=Pr(e,"scope"),e.slotScope=t||Pr(e,"slot-scope")):(t=Pr(e,"slot-scope"))&&(e.slotScope=t);var n=Dr(e,"slot");if(n&&(e.slotTarget='""'===n?'"default"':n,e.slotTargetDynamic=!(!e.attrsMap[":slot"]&&!e.attrsMap["v-bind:slot"]),"template"===e.tag||e.slotScope||Lr(e,"slot",n,function(e,t){return e.rawAttrsMap[":"+t]||e.rawAttrsMap["v-bind:"+t]||e.rawAttrsMap[t]}(e,"slot"))),"template"===e.tag){var r=Mr(e,Qa);if(r){var i=os(r),a=i.name,s=i.dynamic;e.slotTarget=a,e.slotTargetDynamic=s,e.slotScope=r.value||ns}}else{var o=Mr(e,Qa);if(o){var u=e.scopedSlots||(e.scopedSlots={}),l=os(o),c=l.name,d=l.dynamic,h=u[c]=rs("template",[],e);h.slotTarget=c,h.slotTargetDynamic=d,h.children=e.children.filter((function(e){if(!e.slotScope)return e.parent=h,!0})),h.slotScope=o.value||ns,e.children=[],e.plain=!1}}}(e),function(e){"slot"===e.tag&&(e.slotName=Dr(e,"name"))}(e),function(e){var t;(t=Dr(e,"is"))&&(e.component=t),null!=Pr(e,"inline-template")&&(e.inlineTemplate=!0)}(e);for(var i=0;i<Ua.length;i++)e=Ua[i](e,t)||e;return function(e){var t,n,r,i,a,s,o,u,l=e.attrsList;for(t=0,n=l.length;t<n;t++)if(r=i=l[t].name,a=l[t].value,za.test(r))if(e.hasBindings=!0,(s=us(r.replace(za,"")))&&(r=r.replace(Ja,"")),Xa.test(r))r=r.replace(Xa,""),a=Er(a),(u=$a.test(r))&&(r=r.slice(1,-1)),s&&(s.prop&&!u&&"innerHtml"===(r=E(r))&&(r="innerHTML"),s.camel&&!u&&(r=E(r)),s.sync&&(o=Br(a,"$event"),u?Or(e,'"update:"+('+r+")",o,null,!1,0,l[t],!0):(Or(e,"update:"+E(r),o,null,!1,0,l[t]),C(r)!==E(r)&&Or(e,"update:"+C(r),o,null,!1,0,l[t])))),s&&s.prop||!e.component&&Ga(e.tag,e.attrsMap.type,r)?Ar(e,r,a,l[t],u):Lr(e,r,a,l[t],u);else if(Ha.test(r))r=r.replace(Ha,""),(u=$a.test(r))&&(r=r.slice(1,-1)),Or(e,r,a,s,!1,0,l[t],u);else{var c=(r=r.replace(za,"")).match(Ya),d=c&&c[1];u=!1,d&&(r=r.slice(0,-(d.length+1)),$a.test(d)&&(d=d.slice(1,-1),u=!0)),xr(e,r,i,a,d,u,s,l[t])}else Lr(e,r,JSON.stringify(a),l[t]),!e.component&&"muted"===r&&Ga(e.tag,e.attrsMap.type,r)&&Ar(e,r,"true",l[t])}(e),e}function as(e){var t;if(t=Pr(e,"v-for")){var n=function(e){var t=e.match(Wa);if(t){var n={};n.for=t[2].trim();var r=t[1].trim().replace(qa,""),i=r.match(Ka);return i?(n.alias=r.replace(Ka,"").trim(),n.iterator1=i[1].trim(),i[2]&&(n.iterator2=i[2].trim())):n.alias=r,n}}(t);n&&R(e,n)}}function ss(e,t){e.ifConditions||(e.ifConditions=[]),e.ifConditions.push(t)}function os(e){var t=e.name.replace(Qa,"");return t||"#"!==e.name[0]&&(t="default"),$a.test(t)?{name:t.slice(1,-1),dynamic:!0}:{name:'"'+t+'"',dynamic:!1}}function us(e){var t=e.match(Ja);if(t){var n={};return t.forEach((function(e){n[e.slice(1)]=!0})),n}}function ls(e){for(var t={},n=0,r=e.length;n<r;n++)t[e[n].name]=e[n].value;return t}var cs=/^xmlns:NS\d+/,ds=/^NS\d+:/;function hs(e){return rs(e.tag,e.attrsList.slice(),e.parent)}var fs,ps,vs=[ha,fa,{preTransformNode:function(e,t){if("input"===e.tag){var n,r=e.attrsMap;if(!r["v-model"])return;if((r[":type"]||r["v-bind:type"])&&(n=Dr(e,"type")),r.type||n||!r["v-bind"]||(n="("+r["v-bind"]+").type"),n){var i=Pr(e,"v-if",!0),a=i?"&&("+i+")":"",s=null!=Pr(e,"v-else",!0),o=Pr(e,"v-else-if",!0),u=hs(e);as(u),Rr(u,"type","checkbox"),is(u,t),u.processed=!0,u.if="("+n+")==='checkbox'"+a,ss(u,{exp:u.if,block:u});var l=hs(e);Pr(l,"v-for",!0),Rr(l,"type","radio"),is(l,t),ss(u,{exp:"("+n+")==='radio'"+a,block:l});var c=hs(e);return Pr(c,"v-for",!0),Rr(c,":type",n),is(c,t),ss(u,{exp:i,block:c}),s?u.else=!0:o&&(u.elseif=o),u}}}}],ms={expectHTML:!0,modules:vs,directives:{model:function(e,t,n){var r=t.value,i=t.modifiers,a=e.tag,s=e.attrsMap.type;if(e.component)return Ur(e,r,i),!1;if("select"===a)!function(e,t,n){var r='var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return '+(n&&n.number?"_n(val)":"val")+"});";Or(e,"change",r=r+" "+Br(t,"$event.target.multiple ? $$selectedVal : $$selectedVal[0]"),null,!0)}(e,r,i);else if("input"===a&&"checkbox"===s)!function(e,t,n){var r=n&&n.number,i=Dr(e,"value")||"null",a=Dr(e,"true-value")||"true",s=Dr(e,"false-value")||"false";Ar(e,"checked","Array.isArray("+t+")?_i("+t+","+i+")>-1"+("true"===a?":("+t+")":":_q("+t+","+a+")")),Or(e,"change","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+a+"):("+s+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+Br(t,"$$a.concat([$$v])")+")}else{$$i>-1&&("+Br(t,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+Br(t,"$$c")+"}",null,!0)}(e,r,i);else if("input"===a&&"radio"===s)!function(e,t,n){var r=n&&n.number,i=Dr(e,"value")||"null";Ar(e,"checked","_q("+t+","+(i=r?"_n("+i+")":i)+")"),Or(e,"change",Br(t,i),null,!0)}(e,r,i);else if("input"===a||"textarea"===a)!function(e,t,n){var r=e.attrsMap.type,i=n||{},a=i.lazy,s=i.number,o=i.trim,u=!a&&"range"!==r,l=a?"change":"range"===r?Wr:"input",c="$event.target.value";o&&(c="$event.target.value.trim()"),s&&(c="_n("+c+")");var d=Br(t,c);u&&(d="if($event.target.composing)return;"+d),Ar(e,"value","("+t+")"),Or(e,l,d,null,!0),(o||s)&&Or(e,"blur","$forceUpdate()")}(e,r,i);else if(!N.isReservedTag(a))return Ur(e,r,i),!1;return!0},text:function(e,t){t.value&&Ar(e,"textContent","_s("+t.value+")",t)},html:function(e,t){t.value&&Ar(e,"innerHTML","_s("+t.value+")",t)}},isPreTag:function(e){return"pre"===e},isUnaryTag:pa,mustUseProp:In,canBeLeftOpenTag:va,isReservedTag:Wn,getTagNamespace:Kn,staticKeys:function(e){return e.reduce((function(e,t){return e.concat(t.staticKeys||[])}),[]).join(",")}(vs)},gs=T((function(e){return v("type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap"+(e?","+e:""))}));var ys=/^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/,_s=/\([^)]*?\);*$/,bs=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,Ts={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},Ss={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},Es=function(e){return"if("+e+")return null;"},ks={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:Es("$event.target !== $event.currentTarget"),ctrl:Es("!$event.ctrlKey"),shift:Es("!$event.shiftKey"),alt:Es("!$event.altKey"),meta:Es("!$event.metaKey"),left:Es("'button' in $event && $event.button !== 0"),middle:Es("'button' in $event && $event.button !== 1"),right:Es("'button' in $event && $event.button !== 2")};function ws(e,t){var n=t?"nativeOn:":"on:",r="",i="";for(var a in e){var s=Cs(e[a]);e[a]&&e[a].dynamic?i+=a+","+s+",":r+='"'+a+'":'+s+","}return r="{"+r.slice(0,-1)+"}",i?n+"_d("+r+",["+i.slice(0,-1)+"])":n+r}function Cs(e){if(!e)return"function(){}";if(Array.isArray(e))return"["+e.map((function(e){return Cs(e)})).join(",")+"]";var t=bs.test(e.value),n=ys.test(e.value),r=bs.test(e.value.replace(_s,""));if(e.modifiers){var i="",a="",s=[];for(var o in e.modifiers)if(ks[o])a+=ks[o],Ts[o]&&s.push(o);else if("exact"===o){var u=e.modifiers;a+=Es(["ctrl","shift","alt","meta"].filter((function(e){return!u[e]})).map((function(e){return"$event."+e+"Key"})).join("||"))}else s.push(o);return s.length&&(i+=function(e){return"if(!$event.type.indexOf('key')&&"+e.map(As).join("&&")+")return null;"}(s)),a&&(i+=a),"function($event){"+i+(t?"return "+e.value+"($event)":n?"return ("+e.value+")($event)":r?"return "+e.value:e.value)+"}"}return t||n?e.value:"function($event){"+(r?"return "+e.value:e.value)+"}"}function As(e){var t=parseInt(e,10);if(t)return"$event.keyCode!=="+t;var n=Ts[e],r=Ss[e];return"_k($event.keyCode,"+JSON.stringify(e)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}var Ls={on:function(e,t){e.wrapListeners=function(e){return"_g("+e+","+t.value+")"}},bind:function(e,t){e.wrapData=function(n){return"_b("+n+",'"+e.tag+"',"+t.value+","+(t.modifiers&&t.modifiers.prop?"true":"false")+(t.modifiers&&t.modifiers.sync?",true":"")+")"}},cloak:I},Rs=function(e){this.options=e,this.warn=e.warn||wr,this.transforms=Cr(e.modules,"transformCode"),this.dataGenFns=Cr(e.modules,"genData"),this.directives=R(R({},Ls),e.directives);var t=e.isReservedTag||O;this.maybeComponent=function(e){return!!e.component||!t(e.tag)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function xs(e,t){var n=new Rs(t);return{render:"with(this){return "+(e?Is(e,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function Is(e,t){if(e.parent&&(e.pre=e.pre||e.parent.pre),e.staticRoot&&!e.staticProcessed)return Os(e,t);if(e.once&&!e.onceProcessed)return Ds(e,t);if(e.for&&!e.forProcessed)return Ms(e,t);if(e.if&&!e.ifProcessed)return Ps(e,t);if("template"!==e.tag||e.slotTarget||t.pre){if("slot"===e.tag)return function(e,t){var n=e.slotName||'"default"',r=Fs(e,t),i="_t("+n+(r?","+r:""),a=e.attrs||e.dynamicAttrs?Vs((e.attrs||[]).concat(e.dynamicAttrs||[]).map((function(e){return{name:E(e.name),value:e.value,dynamic:e.dynamic}}))):null,s=e.attrsMap["v-bind"];return!a&&!s||r||(i+=",null"),a&&(i+=","+a),s&&(i+=(a?"":",null")+","+s),i+")"}(e,t);var n;if(e.component)n=function(e,t,n){var r=t.inlineTemplate?null:Fs(t,n,!0);return"_c("+e+","+js(t,n)+(r?","+r:"")+")"}(e.component,e,t);else{var r;(!e.plain||e.pre&&t.maybeComponent(e))&&(r=js(e,t));var i=e.inlineTemplate?null:Fs(e,t,!0);n="_c('"+e.tag+"'"+(r?","+r:"")+(i?","+i:"")+")"}for(var a=0;a<t.transforms.length;a++)n=t.transforms[a](e,n);return n}return Fs(e,t)||"void 0"}function Os(e,t){e.staticProcessed=!0;var n=t.pre;return e.pre&&(t.pre=e.pre),t.staticRenderFns.push("with(this){return "+Is(e,t)+"}"),t.pre=n,"_m("+(t.staticRenderFns.length-1)+(e.staticInFor?",true":"")+")"}function Ds(e,t){if(e.onceProcessed=!0,e.if&&!e.ifProcessed)return Ps(e,t);if(e.staticInFor){for(var n="",r=e.parent;r;){if(r.for){n=r.key;break}r=r.parent}return n?"_o("+Is(e,t)+","+t.onceId+++","+n+")":Is(e,t)}return Os(e,t)}function Ps(e,t,n,r){return e.ifProcessed=!0,function e(t,n,r,i){if(!t.length)return i||"_e()";var a=t.shift();return a.exp?"("+a.exp+")?"+s(a.block)+":"+e(t,n,r,i):""+s(a.block);function s(e){return r?r(e,n):e.once?Ds(e,n):Is(e,n)}}(e.ifConditions.slice(),t,n,r)}function Ms(e,t,n,r){var i=e.for,a=e.alias,s=e.iterator1?","+e.iterator1:"",o=e.iterator2?","+e.iterator2:"";return e.forProcessed=!0,(r||"_l")+"(("+i+"),function("+a+s+o+"){return "+(n||Is)(e,t)+"})"}function js(e,t){var n="{",r=function(e,t){var n=e.directives;if(n){var r,i,a,s,o="directives:[",u=!1;for(r=0,i=n.length;r<i;r++){a=n[r],s=!0;var l=t.directives[a.name];l&&(s=!!l(e,a,t.warn)),s&&(u=!0,o+='{name:"'+a.name+'",rawName:"'+a.rawName+'"'+(a.value?",value:("+a.value+"),expression:"+JSON.stringify(a.value):"")+(a.arg?",arg:"+(a.isDynamicArg?a.arg:'"'+a.arg+'"'):"")+(a.modifiers?",modifiers:"+JSON.stringify(a.modifiers):"")+"},")}return u?o.slice(0,-1)+"]":void 0}}(e,t);r&&(n+=r+","),e.key&&(n+="key:"+e.key+","),e.ref&&(n+="ref:"+e.ref+","),e.refInFor&&(n+="refInFor:true,"),e.pre&&(n+="pre:true,"),e.component&&(n+='tag:"'+e.tag+'",');for(var i=0;i<t.dataGenFns.length;i++)n+=t.dataGenFns[i](e);if(e.attrs&&(n+="attrs:"+Vs(e.attrs)+","),e.props&&(n+="domProps:"+Vs(e.props)+","),e.events&&(n+=ws(e.events,!1)+","),e.nativeEvents&&(n+=ws(e.nativeEvents,!0)+","),e.slotTarget&&!e.slotScope&&(n+="slot:"+e.slotTarget+","),e.scopedSlots&&(n+=function(e,t,n){var r=e.for||Object.keys(t).some((function(e){var n=t[e];return n.slotTargetDynamic||n.if||n.for||Us(n)})),i=!!e.if;if(!r)for(var a=e.parent;a;){if(a.slotScope&&a.slotScope!==ns||a.for){r=!0;break}a.if&&(i=!0),a=a.parent}var s=Object.keys(t).map((function(e){return Bs(t[e],n)})).join(",");return"scopedSlots:_u(["+s+"]"+(r?",null,true":"")+(!r&&i?",null,false,"+function(e){for(var t=5381,n=e.length;n;)t=33*t^e.charCodeAt(--n);return t>>>0}(s):"")+")"}(e,e.scopedSlots,t)+","),e.model&&(n+="model:{value:"+e.model.value+",callback:"+e.model.callback+",expression:"+e.model.expression+"},"),e.inlineTemplate){var a=function(e,t){var n=e.children[0];if(n&&1===n.type){var r=xs(n,t.options);return"inlineTemplate:{render:function(){"+r.render+"},staticRenderFns:["+r.staticRenderFns.map((function(e){return"function(){"+e+"}"})).join(",")+"]}"}}(e,t);a&&(n+=a+",")}return n=n.replace(/,$/,"")+"}",e.dynamicAttrs&&(n="_b("+n+',"'+e.tag+'",'+Vs(e.dynamicAttrs)+")"),e.wrapData&&(n=e.wrapData(n)),e.wrapListeners&&(n=e.wrapListeners(n)),n}function Us(e){return 1===e.type&&("slot"===e.tag||e.children.some(Us))}function Bs(e,t){var n=e.attrsMap["slot-scope"];if(e.if&&!e.ifProcessed&&!n)return Ps(e,t,Bs,"null");if(e.for&&!e.forProcessed)return Ms(e,t,Bs);var r=e.slotScope===ns?"":String(e.slotScope),i="function("+r+"){return "+("template"===e.tag?e.if&&n?"("+e.if+")?"+(Fs(e,t)||"undefined")+":undefined":Fs(e,t)||"undefined":Is(e,t))+"}",a=r?"":",proxy:true";return"{key:"+(e.slotTarget||'"default"')+",fn:"+i+a+"}"}function Fs(e,t,n,r,i){var a=e.children;if(a.length){var s=a[0];if(1===a.length&&s.for&&"template"!==s.tag&&"slot"!==s.tag){var o=n?t.maybeComponent(s)?",1":",0":"";return""+(r||Is)(s,t)+o}var u=n?function(e,t){for(var n=0,r=0;r<e.length;r++){var i=e[r];if(1===i.type){if(Ns(i)||i.ifConditions&&i.ifConditions.some((function(e){return Ns(e.block)}))){n=2;break}(t(i)||i.ifConditions&&i.ifConditions.some((function(e){return t(e.block)})))&&(n=1)}}return n}(a,t.maybeComponent):0,l=i||Gs;return"["+a.map((function(e){return l(e,t)})).join(",")+"]"+(u?","+u:"")}}function Ns(e){return void 0!==e.for||"template"===e.tag||"slot"===e.tag}function Gs(e,t){return 1===e.type?Is(e,t):3===e.type&&e.isComment?(r=e,"_e("+JSON.stringify(r.text)+")"):"_v("+(2===(n=e).type?n.expression:Hs(JSON.stringify(n.text)))+")";var n,r}function Vs(e){for(var t="",n="",r=0;r<e.length;r++){var i=e[r],a=Hs(i.value);i.dynamic?n+=i.name+","+a+",":t+='"'+i.name+'":'+a+","}return t="{"+t.slice(0,-1)+"}",n?"_d("+t+",["+n.slice(0,-1)+"])":t}function Hs(e){return e.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function zs(e,t){try{return new Function(e)}catch(n){return t.push({err:n,code:e}),I}}function Ws(e){var t=Object.create(null);return function(n,r,i){(r=R({},r)).warn,delete r.warn;var a=r.delimiters?String(r.delimiters)+n:n;if(t[a])return t[a];var s=e(n,r),o={},u=[];return o.render=zs(s.render,u),o.staticRenderFns=s.staticRenderFns.map((function(e){return zs(e,u)})),t[a]=o}}new RegExp("\\b"+"do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,super,throw,while,yield,delete,export,import,return,switch,default,extends,finally,continue,debugger,function,arguments".split(",").join("\\b|\\b")+"\\b");var Ks,qs,$s=(Ks=function(e,t){var n=function(e,t){Ma=t.warn||wr,Na=t.isPreTag||O,Ga=t.mustUseProp||O,Va=t.getTagNamespace||O,t.isReservedTag,Ua=Cr(t.modules,"transformNode"),Ba=Cr(t.modules,"preTransformNode"),Fa=Cr(t.modules,"postTransformNode"),ja=t.delimiters;var n,r,i=[],a=!1!==t.preserveWhitespace,s=t.whitespace,o=!1,u=!1;function l(e){if(c(e),o||e.processed||(e=is(e,t)),i.length||e===n||n.if&&(e.elseif||e.else)&&ss(n,{exp:e.elseif,block:e}),r&&!e.forbidden)if(e.elseif||e.else)s=e,(l=function(e){for(var t=e.length;t--;){if(1===e[t].type)return e[t];e.pop()}}(r.children))&&l.if&&ss(l,{exp:s.elseif,block:s});else{if(e.slotScope){var a=e.slotTarget||'"default"';(r.scopedSlots||(r.scopedSlots={}))[a]=e}r.children.push(e),e.parent=r}var s,l;e.children=e.children.filter((function(e){return!e.slotScope})),c(e),e.pre&&(o=!1),Na(e.tag)&&(u=!1);for(var d=0;d<Fa.length;d++)Fa[d](e,t)}function c(e){if(!u)for(var t;(t=e.children[e.children.length-1])&&3===t.type&&" "===t.text;)e.children.pop()}return function(e,t){for(var n,r,i=[],a=t.expectHTML,s=t.isUnaryTag||O,o=t.canBeLeftOpenTag||O,u=0;e;){if(n=e,r&&Aa(r)){var l=0,c=r.toLowerCase(),d=La[c]||(La[c]=new RegExp("([\\s\\S]*?)(</"+c+"[^>]*>)","i")),h=e.replace(d,(function(e,n,r){return l=r.length,Aa(c)||"noscript"===c||(n=n.replace(/<!\--([\s\S]*?)-->/g,"$1").replace(/<!\[CDATA\[([\s\S]*?)]]>/g,"$1")),Da(c,n)&&(n=n.slice(1)),t.chars&&t.chars(n),""}));u+=e.length-h.length,e=h,C(c,u-l,u)}else{var f=e.indexOf("<");if(0===f){if(wa.test(e)){var p=e.indexOf("--\x3e");if(p>=0){t.shouldKeepComment&&t.comment(e.substring(4,p),u,u+p+3),E(p+3);continue}}if(Ca.test(e)){var v=e.indexOf("]>");if(v>=0){E(v+2);continue}}var m=e.match(ka);if(m){E(m[0].length);continue}var g=e.match(Ea);if(g){var y=u;E(g[0].length),C(g[1],y,u);continue}var _=k();if(_){w(_),Da(_.tagName,e)&&E(1);continue}}var b=void 0,T=void 0,S=void 0;if(f>=0){for(T=e.slice(f);!(Ea.test(T)||Ta.test(T)||wa.test(T)||Ca.test(T)||(S=T.indexOf("<",1))<0);)f+=S,T=e.slice(f);b=e.substring(0,f)}f<0&&(b=e),b&&E(b.length),t.chars&&b&&t.chars(b,u-b.length,u)}if(e===n){t.chars&&t.chars(e);break}}function E(t){u+=t,e=e.substring(t)}function k(){var t=e.match(Ta);if(t){var n,r,i={tagName:t[1],attrs:[],start:u};for(E(t[0].length);!(n=e.match(Sa))&&(r=e.match(ya)||e.match(ga));)r.start=u,E(r[0].length),r.end=u,i.attrs.push(r);if(n)return i.unarySlash=n[1],E(n[0].length),i.end=u,i}}function w(e){var n=e.tagName,u=e.unarySlash;a&&("p"===r&&ma(n)&&C(r),o(n)&&r===n&&C(n));for(var l=s(n)||!!u,c=e.attrs.length,d=new Array(c),h=0;h<c;h++){var f=e.attrs[h],p=f[3]||f[4]||f[5]||"",v="a"===n&&"href"===f[1]?t.shouldDecodeNewlinesForHref:t.shouldDecodeNewlines;d[h]={name:f[1],value:Pa(p,v)}}l||(i.push({tag:n,lowerCasedTag:n.toLowerCase(),attrs:d,start:e.start,end:e.end}),r=n),t.start&&t.start(n,d,l,e.start,e.end)}function C(e,n,a){var s,o;if(null==n&&(n=u),null==a&&(a=u),e)for(o=e.toLowerCase(),s=i.length-1;s>=0&&i[s].lowerCasedTag!==o;s--);else s=0;if(s>=0){for(var l=i.length-1;l>=s;l--)t.end&&t.end(i[l].tag,n,a);i.length=s,r=s&&i[s-1].tag}else"br"===o?t.start&&t.start(e,[],!0,n,a):"p"===o&&(t.start&&t.start(e,[],!1,n,a),t.end&&t.end(e,n,a))}C()}(e,{warn:Ma,expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,canBeLeftOpenTag:t.canBeLeftOpenTag,shouldDecodeNewlines:t.shouldDecodeNewlines,shouldDecodeNewlinesForHref:t.shouldDecodeNewlinesForHref,shouldKeepComment:t.comments,outputSourceRange:t.outputSourceRange,start:function(e,a,s,c,d){var h=r&&r.ns||Va(e);X&&"svg"===h&&(a=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];cs.test(r.name)||(r.name=r.name.replace(ds,""),t.push(r))}return t}(a));var f,p=rs(e,a,r);h&&(p.ns=h),"style"!==(f=p).tag&&("script"!==f.tag||f.attrsMap.type&&"text/javascript"!==f.attrsMap.type)||ie()||(p.forbidden=!0);for(var v=0;v<Ba.length;v++)p=Ba[v](p,t)||p;o||(function(e){null!=Pr(e,"v-pre")&&(e.pre=!0)}(p),p.pre&&(o=!0)),Na(p.tag)&&(u=!0),o?function(e){var t=e.attrsList,n=t.length;if(n)for(var r=e.attrs=new Array(n),i=0;i<n;i++)r[i]={name:t[i].name,value:JSON.stringify(t[i].value)},null!=t[i].start&&(r[i].start=t[i].start,r[i].end=t[i].end);else e.pre||(e.plain=!0)}(p):p.processed||(as(p),function(e){var t=Pr(e,"v-if");if(t)e.if=t,ss(e,{exp:t,block:e});else{null!=Pr(e,"v-else")&&(e.else=!0);var n=Pr(e,"v-else-if");n&&(e.elseif=n)}}(p),function(e){null!=Pr(e,"v-once")&&(e.once=!0)}(p)),n||(n=p),s?l(p):(r=p,i.push(p))},end:function(e,t,n){var a=i[i.length-1];i.length-=1,r=i[i.length-1],l(a)},chars:function(e,t,n){if(r&&(!X||"textarea"!==r.tag||r.attrsMap.placeholder!==e)){var i,l,c,d=r.children;(e=u||e.trim()?"script"===(i=r).tag||"style"===i.tag?e:ts(e):d.length?s?"condense"===s&&Za.test(e)?"":" ":a?" ":"":"")&&(u||"condense"!==s||(e=e.replace(es," ")),!o&&" "!==e&&(l=function(e,t){var n=t?da(t):la;if(n.test(e)){for(var r,i,a,s=[],o=[],u=n.lastIndex=0;r=n.exec(e);){(i=r.index)>u&&(o.push(a=e.slice(u,i)),s.push(JSON.stringify(a)));var l=Er(r[1].trim());s.push("_s("+l+")"),o.push({"@binding":l}),u=i+r[0].length}return u<e.length&&(o.push(a=e.slice(u)),s.push(JSON.stringify(a))),{expression:s.join("+"),tokens:o}}}(e,ja))?c={type:2,expression:l.expression,tokens:l.tokens,text:e}:" "===e&&d.length&&" "===d[d.length-1].text||(c={type:3,text:e}),c&&d.push(c))}},comment:function(e,t,n){if(r){var i={type:3,text:e,isComment:!0};r.children.push(i)}}}),n}(e.trim(),t);!1!==t.optimize&&function(e,t){e&&(fs=gs(t.staticKeys||""),ps=t.isReservedTag||O,function e(t){if(t.static=function(e){return 2!==e.type&&(3===e.type||!(!e.pre&&(e.hasBindings||e.if||e.for||m(e.tag)||!ps(e.tag)||function(e){for(;e.parent;){if("template"!==(e=e.parent).tag)return!1;if(e.for)return!0}return!1}(e)||!Object.keys(e).every(fs))))}(t),1===t.type){if(!ps(t.tag)&&"slot"!==t.tag&&null==t.attrsMap["inline-template"])return;for(var n=0,r=t.children.length;n<r;n++){var i=t.children[n];e(i),i.static||(t.static=!1)}if(t.ifConditions)for(var a=1,s=t.ifConditions.length;a<s;a++){var o=t.ifConditions[a].block;e(o),o.static||(t.static=!1)}}}(e),function e(t,n){if(1===t.type){if((t.static||t.once)&&(t.staticInFor=n),t.static&&t.children.length&&(1!==t.children.length||3!==t.children[0].type))return void(t.staticRoot=!0);if(t.staticRoot=!1,t.children)for(var r=0,i=t.children.length;r<i;r++)e(t.children[r],n||!!t.for);if(t.ifConditions)for(var a=1,s=t.ifConditions.length;a<s;a++)e(t.ifConditions[a].block,n)}}(e,!1))}(n,t);var r=xs(n,t);return{ast:n,render:r.render,staticRenderFns:r.staticRenderFns}},function(e){function t(t,n){var r=Object.create(e),i=[],a=[];if(n)for(var s in n.modules&&(r.modules=(e.modules||[]).concat(n.modules)),n.directives&&(r.directives=R(Object.create(e.directives||null),n.directives)),n)"modules"!==s&&"directives"!==s&&(r[s]=n[s]);r.warn=function(e,t,n){(n?a:i).push(e)};var o=Ks(t.trim(),r);return o.errors=i,o.tips=a,o}return{compile:t,compileToFunctions:Ws(t)}})(ms),Ys=($s.compile,$s.compileToFunctions);function Xs(e){return(qs=qs||document.createElement("div")).innerHTML=e?'<a href="\n"/>':'<div a="\n"/>',qs.innerHTML.indexOf("&#10;")>0}var Js=!!K&&Xs(!1),Qs=!!K&&Xs(!0),Zs=T((function(e){var t=Yn(e);return t&&t.innerHTML})),eo=Sn.prototype.$mount;Sn.prototype.$mount=function(e,t){if((e=e&&Yn(e))===document.body||e===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=Zs(r));else{if(!r.nodeType)return this;r=r.innerHTML}else e&&(r=function(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}(e));if(r){var i=Ys(r,{outputSourceRange:!1,shouldDecodeNewlines:Js,shouldDecodeNewlinesForHref:Qs,delimiters:n.delimiters,comments:n.comments},this),a=i.render,s=i.staticRenderFns;n.render=a,n.staticRenderFns=s}}return eo.call(this,e,t)},Sn.compile=Ys,e.exports=Sn}).call(this,n("yLpj"),n("URgk").setImmediate)},Iab2:function(e,t,n){(function(n){var r,i,a;i=[],void 0===(a="function"==typeof(r=function(){"use strict";function t(e,t){return void 0===t?t={autoBom:!1}:"object"!=typeof t&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e}function r(e,t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){o(r.response,t,n)},r.onerror=function(){console.error("could not download file")},r.send()}function i(e){var t=new XMLHttpRequest;return t.open("HEAD",e,!1),t.send(),200<=t.status&&299>=t.status}function a(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var s="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof n&&n.global===n?n:void 0,o=s.saveAs||("object"!=typeof window||window!==s?function(){}:"download"in HTMLAnchorElement.prototype?function(e,t,n){var o=s.URL||s.webkitURL,u=document.createElement("a");t=t||e.name||"download",u.download=t,u.rel="noopener","string"==typeof e?(u.href=e,u.origin===location.origin?a(u):i(u.href)?r(e,t,n):a(u,u.target="_blank")):(u.href=o.createObjectURL(e),setTimeout((function(){o.revokeObjectURL(u.href)}),4e4),setTimeout((function(){a(u)}),0))}:"msSaveOrOpenBlob"in navigator?function(e,n,s){if(n=n||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(t(e,s),n);else if(i(e))r(e,n,s);else{var o=document.createElement("a");o.href=e,o.target="_blank",setTimeout((function(){a(o)}))}}:function(e,t,n,i){if((i=i||open("","_blank"))&&(i.document.title=i.document.body.innerText="downloading..."),"string"==typeof e)return r(e,t,n);var a="application/octet-stream"===e.type,o=/constructor/i.test(s.HTMLElement)||s.safari,u=/CriOS\/[\d]+/.test(navigator.userAgent);if((u||a&&o)&&"object"==typeof FileReader){var l=new FileReader;l.onloadend=function(){var e=l.result;e=u?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=e:location=e,i=null},l.readAsDataURL(e)}else{var c=s.URL||s.webkitURL,d=c.createObjectURL(e);i?i.location=d:location.href=d,i=null,setTimeout((function(){c.revokeObjectURL(d)}),4e4)}});s.saveAs=o.saveAs=o,e.exports=o})?r.apply(t,i):r)||(e.exports=a)}).call(this,n("yLpj"))},IdBN:function(e,t,n){"use strict";var r=n("Zrcd"),i=n("+4di"),a=n("wFMk"),s=n("XW/+");e.exports=n("1RbY")(Array,"Array",(function(e,t){this._t=s(e),this._i=0,this._k=t}),(function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,i(1)):i(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])}),"values"),a.Arguments=a.Array,r("keys"),r("values"),r("entries")},IheE:function(e,t,n){"use strict";n("5oHw")("fontsize",(function(e){return function(t){return e(this,"font","size",t)}}))},Insd:function(e,t,n){"use strict";var r=n("8IOi"),i=n("Qu5u"),a=n("LOhj"),s=n("J2HX");n("yU77")&&r(r.P+n("rGBx"),"Object",{__defineSetter__:function(e,t){s.f(i(this),e,{set:a(t),enumerable:!0,configurable:!0})}})},J2HX:function(e,t,n){var r=n("138g"),i=n("+X+Z"),a=n("AZ8a"),s=Object.defineProperty;t.f=n("yU77")?Object.defineProperty:function(e,t,n){if(r(e),t=a(t,!0),r(n),i)try{return s(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},J70Z:function(e,t,n){var r=n("J2HX").f,i=n("L7KE"),a=n("3iRr")("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,a)&&r(e,a,{configurable:!0,value:t})}},J8Qq:function(e,t,n){var r=n("XW/+"),i=n("Y3Md"),a=n("b8c2");e.exports=function(e){return function(t,n,s){var o,u=r(t),l=i(u.length),c=a(s,l);if(e&&n!=n){for(;l>c;)if((o=u[c++])!=o)return!0}else for(;l>c;c++)if((e||c in u)&&u[c]===n)return e||c||0;return!e&&-1}}},JCQ5:function(e,t,n){"use strict";var r=n("8IOi"),i=n("RT9V"),a="includes";r(r.P+r.F*n("OvvV")(a),"String",{includes:function(e){return!!~i(this,e,a).indexOf(e,arguments.length>1?arguments[1]:void 0)}})},JNc5:function(e,t,n){"use strict";n("5oHw")("big",(function(e){return function(){return e(this,"big","","")}}))},JYSn:function(e,t,n){var r=n("Wl3L"),i=n("XW/+"),a=n("4XFX").f;e.exports=function(e){return function(t){for(var n,s=i(t),o=r(s),u=o.length,l=0,c=[];u>l;)a.call(s,n=o[l++])&&c.push(e?[n,s[n]]:s[n]);return c}}},Jkf2:function(e,t,n){var r=n("n+hx"),i=Math.floor;e.exports=function(e){return!r(e)&&isFinite(e)&&i(e)===e}},JvFK:function(e,t,n){"use strict";var r=n("q27k"),i=n("eYp2");e.exports=n("0WhE")("Set",(function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(e){return r.def(i(this,"Set"),e=0===e?0:e,e)}},r)},K3ax:function(e,t,n){var r=n("8IOi"),i=Math.abs;r(r.S,"Math",{hypot:function(e,t){for(var n,r,a=0,s=0,o=arguments.length,u=0;s<o;)u<(n=i(arguments[s++]))?(a=a*(r=u/n)*r+1,u=n):a+=n>0?(r=n/u)*r:n;return u===1/0?1/0:u*Math.sqrt(a)}})},KJ4T:function(e,t){!function(e,t){"use strict";function n(){var e=w.splice(0,w.length);for(Je=0;e.length;)e.shift().call(null,e.shift())}function r(e,t){for(var n=0,r=e.length;n<r;n++)p(e[n],t)}function i(e){return function(t){je(t)&&(p(t,e),ae.length&&r(t.querySelectorAll(ae),e))}}function a(e){var t=Ve.call(e,"is"),n=e.nodeName.toUpperCase(),r=oe.call(re,t?ee+t.toUpperCase():Z+n);return t&&-1<r&&!s(n,t)?-1:r}function s(e,t){return-1<ae.indexOf(e+'[is="'+t+'"]')}function o(e){var t=e.currentTarget,n=e.attrChange,r=e.attrName,i=e.target,a=e[$]||2,s=e[Y]||3;!rt||i&&i!==t||!t[V]||"style"===r||e.prevValue===e.newValue&&(""!==e.newValue||n!==a&&n!==s)||t[V](r,n===a?null:e.prevValue,n===s?null:e.newValue)}function u(e){var t=i(e);return function(e){w.push(t,e.target),Je&&clearTimeout(Je),Je=setTimeout(n,1)}}function l(e){nt&&(nt=!1,e.currentTarget.removeEventListener(J,l)),ae.length&&r((e.target||S).querySelectorAll(ae),e.detail===N?N:B),Pe&&function(){for(var e,t=0,n=Ue.length;t<n;t++)e=Ue[t],se.contains(e)||(n--,Ue.splice(t--,1),p(e,N))}()}function c(e,t){var n=this;We.call(n,e,t),C.call(n,{target:n})}function d(e,t,n){var r=t.apply(e,n),i=a(r);return-1<i&&O(r,ie[i]),n.pop()&&ae.length&&function(e){for(var t,n=0,r=e.length;n<r;n++)t=e[n],O(t,ie[a(t)])}(r.querySelectorAll(ae)),r}function h(e,t){xe(e,t),R?R.observe(e,Ye):(tt&&(e.setAttribute=c,e[j]=L(e),e[U](Q,C)),e[U](X,o)),e[K]&&rt&&(e.created=!0,e[K](),e.created=!1)}function f(e){throw new Error("A "+e+" type is already registered")}function p(e,t){var n,r,i=a(e);-1<i&&!Ne.call(e,"TEMPLATE")&&(I(e,ie[i]),i=0,t!==B||e[B]?t!==N||e[N]||(e[B]=!1,e[N]=!0,r="disconnected",i=1):(e[N]=!1,e[B]=!0,r="connected",i=1,Pe&&oe.call(Ue,e)<0&&Ue.push(e)),i&&(n=e[t+F]||e[r+F])&&n.call(e))}function v(){}function m(e,t,n){var r=n&&n[G]||"",i=t.prototype,a=Re(i),s=t.observedAttributes||he,o={prototype:a};Me(a,K,{value:function(){if(ke)ke=!1;else if(!this[ye]){this[ye]=!0,new t(this),i[K]&&i[K].call(this);var e=we[Ae.get(t)];(!be||e.create.length>1)&&_(this)}}}),Me(a,V,{value:function(e){-1<oe.call(s,e)&&i[V]&&i[V].apply(this,arguments)}}),i[z]&&Me(a,H,{value:i[z]}),i[W]&&Me(a,q,{value:i[W]}),r&&(o[G]=r),e=e.toUpperCase(),we[e]={constructor:t,create:r?[r,Le(e)]:[e]},Ae.set(t,e),S[P](e.toLowerCase(),o),b(e),Ce[e].r()}function g(e){var t=we[e.toUpperCase()];return t&&t.constructor}function y(e){return"string"==typeof e?e:e&&e.is||""}function _(e){for(var t,n=e[V],r=n?e.attributes:he,i=r.length;i--;)t=r[i],n.call(e,t.name||t.nodeName,null,t.value||t.nodeValue)}function b(e){return(e=e.toUpperCase())in Ce||(Ce[e]={},Ce[e].p=new Ee((function(t){Ce[e].r=t}))),Ce[e].p}function T(){_e&&delete e.customElements,de(e,"customElements",{configurable:!0,value:new v}),de(e,"CustomElementRegistry",{configurable:!0,value:v});for(var t=k.get(/^HTML[A-Z]*[a-z]/),n=t.length;n--;function(t){var n=e[t];if(n){e[t]=function(e){var t,r;return e||(e=this),e[ye]||(ke=!0,t=we[Ae.get(e.constructor)],(e=(r=be&&1===t.create.length)?Reflect.construct(n,he,t.constructor):S.createElement.apply(S,t.create))[ye]=!0,ke=!1,r||_(e)),e},e[t].prototype=n.prototype;try{n.prototype.constructor=e[t]}catch(r){!0,de(n,ye,{value:e[t]})}}}(t[n]));S.createElement=function(e,t){var n=y(t);return n?$e.call(this,e,Le(n)):$e.call(this,e)},Qe||(et=!0,S[P](""))}var S=e.document,E=e.Object,k=function(e){var t,n,r,i,a=/^[A-Z]+[a-z]/,s=function(e,t){(t=t.toLowerCase())in o||(o[e]=(o[e]||[]).concat(t),o[t]=o[t.toUpperCase()]=e)},o=(E.create||E)(null),u={};for(n in e)for(i in e[n])for(r=e[n][i],o[i]=r,t=0;t<r.length;t++)o[r[t].toLowerCase()]=o[r[t].toUpperCase()]=i;return u.get=function(e){return"string"==typeof e?o[e]||(a.test(e)?[]:""):function(e){var t,n=[];for(t in o)e.test(t)&&n.push(t);return n}(e)},u.set=function(e,t){return a.test(e)?s(e,t):s(t,e),u},u}({collections:{HTMLAllCollection:["all"],HTMLCollection:["forms"],HTMLFormControlsCollection:["elements"],HTMLOptionsCollection:["options"]},elements:{Element:["element"],HTMLAnchorElement:["a"],HTMLAppletElement:["applet"],HTMLAreaElement:["area"],HTMLAttachmentElement:["attachment"],HTMLAudioElement:["audio"],HTMLBRElement:["br"],HTMLBaseElement:["base"],HTMLBodyElement:["body"],HTMLButtonElement:["button"],HTMLCanvasElement:["canvas"],HTMLContentElement:["content"],HTMLDListElement:["dl"],HTMLDataElement:["data"],HTMLDataListElement:["datalist"],HTMLDetailsElement:["details"],HTMLDialogElement:["dialog"],HTMLDirectoryElement:["dir"],HTMLDivElement:["div"],HTMLDocument:["document"],HTMLElement:["element","abbr","address","article","aside","b","bdi","bdo","cite","code","command","dd","dfn","dt","em","figcaption","figure","footer","header","i","kbd","mark","nav","noscript","rp","rt","ruby","s","samp","section","small","strong","sub","summary","sup","u","var","wbr"],HTMLEmbedElement:["embed"],HTMLFieldSetElement:["fieldset"],HTMLFontElement:["font"],HTMLFormElement:["form"],HTMLFrameElement:["frame"],HTMLFrameSetElement:["frameset"],HTMLHRElement:["hr"],HTMLHeadElement:["head"],HTMLHeadingElement:["h1","h2","h3","h4","h5","h6"],HTMLHtmlElement:["html"],HTMLIFrameElement:["iframe"],HTMLImageElement:["img"],HTMLInputElement:["input"],HTMLKeygenElement:["keygen"],HTMLLIElement:["li"],HTMLLabelElement:["label"],HTMLLegendElement:["legend"],HTMLLinkElement:["link"],HTMLMapElement:["map"],HTMLMarqueeElement:["marquee"],HTMLMediaElement:["media"],HTMLMenuElement:["menu"],HTMLMenuItemElement:["menuitem"],HTMLMetaElement:["meta"],HTMLMeterElement:["meter"],HTMLModElement:["del","ins"],HTMLOListElement:["ol"],HTMLObjectElement:["object"],HTMLOptGroupElement:["optgroup"],HTMLOptionElement:["option"],HTMLOutputElement:["output"],HTMLParagraphElement:["p"],HTMLParamElement:["param"],HTMLPictureElement:["picture"],HTMLPreElement:["pre"],HTMLProgressElement:["progress"],HTMLQuoteElement:["blockquote","q","quote"],HTMLScriptElement:["script"],HTMLSelectElement:["select"],HTMLShadowElement:["shadow"],HTMLSlotElement:["slot"],HTMLSourceElement:["source"],HTMLSpanElement:["span"],HTMLStyleElement:["style"],HTMLTableCaptionElement:["caption"],HTMLTableCellElement:["td","th"],HTMLTableColElement:["col","colgroup"],HTMLTableElement:["table"],HTMLTableRowElement:["tr"],HTMLTableSectionElement:["thead","tbody","tfoot"],HTMLTemplateElement:["template"],HTMLTextAreaElement:["textarea"],HTMLTimeElement:["time"],HTMLTitleElement:["title"],HTMLTrackElement:["track"],HTMLUListElement:["ul"],HTMLUnknownElement:["unknown","vhgroupv","vkeygen"],HTMLVideoElement:["video"]},nodes:{Attr:["node"],Audio:["audio"],CDATASection:["node"],CharacterData:["node"],Comment:["#comment"],Document:["#document"],DocumentFragment:["#document-fragment"],DocumentType:["node"],HTMLDocument:["#document"],Image:["img"],Option:["option"],ProcessingInstruction:["node"],ShadowRoot:["#shadow-root"],Text:["#text"],XMLDocument:["xml"]}});"object"!=typeof t&&(t={type:t||"auto"});var w,C,A,L,R,x,I,O,D,P="registerElement",M=1e5*e.Math.random()>>0,j="__"+P+M,U="addEventListener",B="attached",F="Callback",N="detached",G="extends",V="attributeChanged"+F,H=B+F,z="connected"+F,W="disconnected"+F,K="created"+F,q=N+F,$="ADDITION",Y="REMOVAL",X="DOMAttrModified",J="DOMContentLoaded",Q="DOMSubtreeModified",Z="<",ee="=",te=/^[A-Z][._A-Z0-9]*-[-._A-Z0-9]*$/,ne=["ANNOTATION-XML","COLOR-PROFILE","FONT-FACE","FONT-FACE-SRC","FONT-FACE-URI","FONT-FACE-FORMAT","FONT-FACE-NAME","MISSING-GLYPH"],re=[],ie=[],ae="",se=S.documentElement,oe=re.indexOf||function(e){for(var t=this.length;t--&&this[t]!==e;);return t},ue=E.prototype,le=ue.hasOwnProperty,ce=ue.isPrototypeOf,de=E.defineProperty,he=[],fe=E.getOwnPropertyDescriptor,pe=E.getOwnPropertyNames,ve=E.getPrototypeOf,me=E.setPrototypeOf,ge=!!E.__proto__,ye="__dreCEv1",_e=e.customElements,be=!/^force/.test(t.type)&&!!(_e&&_e.define&&_e.get&&_e.whenDefined),Te=E.create||E,Se=e.Map||function(){var e,t=[],n=[];return{get:function(e){return n[oe.call(t,e)]},set:function(r,i){(e=oe.call(t,r))<0?n[t.push(r)-1]=i:n[e]=i}}},Ee=e.Promise||function(e){function t(e){for(r=!0;n.length;)n.shift()(e)}var n=[],r=!1,i={catch:function(){return i},then:function(e){return n.push(e),r&&setTimeout(t,1),i}};return e(t),i},ke=!1,we=Te(null),Ce=Te(null),Ae=new Se,Le=function(e){return e.toLowerCase()},Re=E.create||function e(t){return t?(e.prototype=t,new e):this},xe=me||(ge?function(e,t){return e.__proto__=t,e}:pe&&fe?function(){function e(e,t){for(var n,r=pe(t),i=0,a=r.length;i<a;i++)n=r[i],le.call(e,n)||de(e,n,fe(t,n))}return function(t,n){do{e(t,n)}while((n=ve(n))&&!ce.call(n,t));return t}}():function(e,t){for(var n in t)e[n]=t[n];return e}),Ie=e.MutationObserver||e.WebKitMutationObserver,Oe=e.HTMLAnchorElement,De=(e.HTMLElement||e.Element||e.Node).prototype,Pe=!ce.call(De,se),Me=Pe?function(e,t,n){return e[t]=n.value,e}:de,je=Pe?function(e){return 1===e.nodeType}:function(e){return ce.call(De,e)},Ue=Pe&&[],Be=De.attachShadow,Fe=De.cloneNode,Ne=De.closest||function(e){for(var t=this;t&&t.nodeName!==e;)t=t.parentNode;return t},Ge=De.dispatchEvent,Ve=De.getAttribute,He=De.hasAttribute,ze=De.removeAttribute,We=De.setAttribute,Ke=S.createElement,qe=S.importNode,$e=Ke,Ye=Ie&&{attributes:!0,characterData:!0,attributeOldValue:!0},Xe=Ie||function(e){tt=!1,se.removeEventListener(X,Xe)},Je=0,Qe=P in S&&!/^force-all/.test(t.type),Ze=!0,et=!1,tt=!0,nt=!0,rt=!0;if(Ie&&((D=S.createElement("div")).innerHTML="<div><div></div></div>",new Ie((function(e,t){if(e[0]&&"childList"==e[0].type&&!e[0].removedNodes[0].childNodes.length){var n=(D=fe(De,"innerHTML"))&&D.set;n&&de(De,"innerHTML",{set:function(e){for(;this.lastChild;)this.removeChild(this.lastChild);n.call(this,e)}})}t.disconnect(),D=null})).observe(D,{childList:!0,subtree:!0}),D.innerHTML=""),Qe||(me||ge?(I=function(e,t){ce.call(t,e)||h(e,t)},O=h):O=I=function(e,t){e[j]||(e[j]=E(!0),h(e,t))},Pe?(tt=!1,function(){var e=fe(De,U),t=e.value,n=function(e){var t=new CustomEvent(X,{bubbles:!0});t.attrName=e,t.prevValue=Ve.call(this,e),t.newValue=null,t[Y]=t.attrChange=2,ze.call(this,e),Ge.call(this,t)},r=function(e,t){var n=He.call(this,e),r=n&&Ve.call(this,e),i=new CustomEvent(X,{bubbles:!0});We.call(this,e,t),i.attrName=e,i.prevValue=n?r:null,i.newValue=t,n?i.MODIFICATION=i.attrChange=1:i[$]=i.attrChange=0,Ge.call(this,i)},i=function(e){var t,n=e.currentTarget,r=n[j],i=e.propertyName;r.hasOwnProperty(i)&&(r=r[i],(t=new CustomEvent(X,{bubbles:!0})).attrName=r.name,t.prevValue=r.value||null,t.newValue=r.value=n[i]||null,null==t.prevValue?t[$]=t.attrChange=0:t.MODIFICATION=t.attrChange=1,Ge.call(n,t))};e.value=function(e,a,s){e===X&&this[V]&&this.setAttribute!==r&&(this[j]={className:{name:"class",value:this.className}},this.setAttribute=r,this.removeAttribute=n,t.call(this,"propertychange",i)),t.call(this,e,a,s)},de(De,U,e)}()):Ie||(se[U](X,Xe),se.setAttribute(j,1),se.removeAttribute(j),tt&&(C=function(e){var t,n,r,i=this;if(i===e.target){for(r in t=i[j],i[j]=n=L(i),n){if(!(r in t))return A(0,i,r,t[r],n[r],$);if(n[r]!==t[r])return A(1,i,r,t[r],n[r],"MODIFICATION")}for(r in t)if(!(r in n))return A(2,i,r,t[r],n[r],Y)}},A=function(e,t,n,r,i,a){var s={attrChange:e,currentTarget:t,attrName:n,prevValue:r,newValue:i};s[a]=e,o(s)},L=function(e){for(var t,n,r={},i=e.attributes,a=0,s=i.length;a<s;a++)"setAttribute"!==(n=(t=i[a]).name)&&(r[n]=t.value);return r})),S[P]=function(e,t){if(n=e.toUpperCase(),Ze&&(Ze=!1,Ie?(R=function(e,t){function n(e,t){for(var n=0,r=e.length;n<r;t(e[n++]));}return new Ie((function(r){for(var i,a,s,o=0,u=r.length;o<u;o++)"childList"===(i=r[o]).type?(n(i.addedNodes,e),n(i.removedNodes,t)):(a=i.target,rt&&a[V]&&"style"!==i.attributeName&&(s=Ve.call(a,i.attributeName))!==i.oldValue&&a[V](i.attributeName,i.oldValue,s))}))}(i(B),i(N)),(x=function(e){return R.observe(e,{childList:!0,subtree:!0}),e})(S),Be&&(De.attachShadow=function(){return x(Be.apply(this,arguments))})):(w=[],S[U]("DOMNodeInserted",u(B)),S[U]("DOMNodeRemoved",u(N))),S[U](J,l),S[U]("readystatechange",l),S.importNode=function(e,t){switch(e.nodeType){case 1:return d(S,qe,[e,!!t]);case 11:for(var n=S.createDocumentFragment(),r=e.childNodes,i=r.length,a=0;a<i;a++)n.appendChild(S.importNode(r[a],!!t));return n;default:return Fe.call(e,!!t)}},De.cloneNode=function(e){return d(this,Fe,[!!e])}),et)return et=!1;if(-2<oe.call(re,ee+n)+oe.call(re,Z+n)&&f(e),!te.test(n)||-1<oe.call(ne,n))throw new Error("The type "+e+" is invalid");var n,a,s=function(){return c?S.createElement(h,n):S.createElement(h)},o=t||ue,c=le.call(o,G),h=c?t[G].toUpperCase():n;return c&&-1<oe.call(re,Z+h)&&f(h),a=re.push((c?ee:Z)+n)-1,ae=ae.concat(ae.length?",":"",c?h+'[is="'+e.toLowerCase()+'"]':h),s.prototype=ie[a]=le.call(o,"prototype")?o.prototype:Re(De),ae.length&&r(S.querySelectorAll(ae),B),s},S.createElement=$e=function(e,t){var n=y(t),r=n?Ke.call(S,e,Le(n)):Ke.call(S,e),i=""+e,a=oe.call(re,(n?ee:Z)+(n||i).toUpperCase()),o=-1<a;return n&&(r.setAttribute("is",n=n.toLowerCase()),o&&(o=s(i.toUpperCase(),n))),rt=!S.createElement.innerHTMLHelper,o&&O(r,ie[a]),r}),addEventListener("beforeunload",(function(){delete S.createElement,delete S.importNode,delete S[P]}),!1),v.prototype={constructor:v,define:be?function(e,t,n){if(n)m(e,t,n);else{var r=e.toUpperCase();we[r]={constructor:t,create:[r]},Ae.set(t,r),_e.define(e,t)}}:m,get:be?function(e){return _e.get(e)||g(e)}:g,whenDefined:be?function(e){return Ee.race([_e.whenDefined(e),b(e)])}:b},!_e||/^force/.test(t.type))T();else if(!t.noBuiltIn)try{!function(t,n,r){var i=new RegExp("^<a\\s+is=('|\")"+r+"\\1></a>$");if(n[G]="a",(t.prototype=Re(Oe.prototype)).constructor=t,e.customElements.define(r,t,n),!i.test(S.createElement("a",{is:r}).outerHTML)||!i.test((new t).outerHTML))throw n}((function e(){return Reflect.construct(Oe,[],e)}),{},"document-register-element-a"+M)}catch(e){T()}if(!t.noBuiltIn)try{if(Ke.call(S,"a","a").outerHTML.indexOf("is")<0)throw{}}catch(e){Le=function(e){return{is:e.toLowerCase()}}}}(window)},KYUM:function(e,t,n){var r=n("8IOi"),i=n("jYdD").f,a=n("138g");r(r.S,"Reflect",{deleteProperty:function(e,t){var n=i(a(e),t);return!(n&&!n.configurable)&&delete e[t]}})},Ki3G:function(e,t,n){var r=n("Qu5u"),i=n("7WAm");n("CmYC")("getPrototypeOf",(function(){return function(e){return i(r(e))}}))},KpXI:function(e,t,n){var r=n("8IOi"),i=n("RZL5"),a=Math.exp;r(r.S,"Math",{tanh:function(e){var t=i(e=+e),n=i(-e);return t==1/0?1:n==1/0?-1:(t-n)/(a(e)+a(-e))}})},Ku9J:function(e,t,n){var r=n("HC2Y");e.exports=function(e,t){if("number"!=typeof e&&"Number"!=r(e))throw TypeError(t);return+e}},"L6/l":function(e,t,n){"use strict";var r=n("8IOi"),i=n("z/zB")(5),a="find",s=!0;a in[]&&Array(1).find((function(){s=!1})),r(r.P+r.F*s,"Array",{find:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),n("Zrcd")(a)},L7KE:function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},LMzk:function(e,t,n){n("Gx54")("Float32",4,(function(e){return function(t,n,r){return e(this,t,n,r)}}))},LOhj:function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},LVuD:function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},LboF:function(e,t,n){"use strict";var r,i=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},a=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),s=[];function o(e){for(var t=-1,n=0;n<s.length;n++)if(s[n].identifier===e){t=n;break}return t}function u(e,t){for(var n={},r=[],i=0;i<e.length;i++){var a=e[i],u=t.base?a[0]+t.base:a[0],l=n[u]||0,c="".concat(u," ").concat(l);n[u]=l+1;var d=o(c),h={css:a[1],media:a[2],sourceMap:a[3]};-1!==d?(s[d].references++,s[d].updater(h)):s.push({identifier:c,updater:m(h,t),references:1}),r.push(c)}return r}function l(e){var t=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var i=n.nc;i&&(r.nonce=i)}if(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),"function"==typeof e.insert)e.insert(t);else{var s=a(e.insert||"head");if(!s)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");s.appendChild(t)}return t}var c,d=(c=[],function(e,t){return c[e]=t,c.filter(Boolean).join("\n")});function h(e,t,n,r){var i=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=d(t,i);else{var a=document.createTextNode(i),s=e.childNodes;s[t]&&e.removeChild(s[t]),s.length?e.insertBefore(a,s[t]):e.appendChild(a)}}function f(e,t,n){var r=n.css,i=n.media,a=n.sourceMap;if(i?e.setAttribute("media",i):e.removeAttribute("media"),a&&btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var p=null,v=0;function m(e,t){var n,r,i;if(t.singleton){var a=v++;n=p||(p=l(t)),r=h.bind(null,n,a,!1),i=h.bind(null,n,a,!0)}else n=l(t),r=f.bind(null,n,t),i=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else i()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=i());var n=u(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var r=0;r<n.length;r++){var i=o(n[r]);s[i].references--}for(var a=u(e,t),l=0;l<n.length;l++){var c=o(n[l]);0===s[c].references&&(s[c].updater(),s.splice(c,1))}n=a}}}},LvDl:function(e,t,n){(function(e,r){var i;(function(){var a,s="Expected a function",o="__lodash_hash_undefined__",u="__lodash_placeholder__",l=16,c=32,d=64,h=128,f=256,p=1/0,v=9007199254740991,m=NaN,g=4294967295,y=[["ary",h],["bind",1],["bindKey",2],["curry",8],["curryRight",l],["flip",512],["partial",c],["partialRight",d],["rearg",f]],_="[object Arguments]",b="[object Array]",T="[object Boolean]",S="[object Date]",E="[object Error]",k="[object Function]",w="[object GeneratorFunction]",C="[object Map]",A="[object Number]",L="[object Object]",R="[object Promise]",x="[object RegExp]",I="[object Set]",O="[object String]",D="[object Symbol]",P="[object WeakMap]",M="[object ArrayBuffer]",j="[object DataView]",U="[object Float32Array]",B="[object Float64Array]",F="[object Int8Array]",N="[object Int16Array]",G="[object Int32Array]",V="[object Uint8Array]",H="[object Uint8ClampedArray]",z="[object Uint16Array]",W="[object Uint32Array]",K=/\b__p \+= '';/g,q=/\b(__p \+=) '' \+/g,$=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Y=/&(?:amp|lt|gt|quot|#39);/g,X=/[&<>"']/g,J=RegExp(Y.source),Q=RegExp(X.source),Z=/<%-([\s\S]+?)%>/g,ee=/<%([\s\S]+?)%>/g,te=/<%=([\s\S]+?)%>/g,ne=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,re=/^\w*$/,ie=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ae=/[\\^$.*+?()[\]{}|]/g,se=RegExp(ae.source),oe=/^\s+/,ue=/\s/,le=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ce=/\{\n\/\* \[wrapped with (.+)\] \*/,de=/,? & /,he=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,fe=/[()=,{}\[\]\/\s]/,pe=/\\(\\)?/g,ve=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,me=/\w*$/,ge=/^[-+]0x[0-9a-f]+$/i,ye=/^0b[01]+$/i,_e=/^\[object .+?Constructor\]$/,be=/^0o[0-7]+$/i,Te=/^(?:0|[1-9]\d*)$/,Se=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ee=/($^)/,ke=/['\n\r\u2028\u2029\\]/g,we="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ce="\\u2700-\\u27bf",Ae="a-z\\xdf-\\xf6\\xf8-\\xff",Le="A-Z\\xc0-\\xd6\\xd8-\\xde",Re="\\ufe0e\\ufe0f",xe="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ie="[']",Oe="[\\ud800-\\udfff]",De="["+xe+"]",Pe="["+we+"]",Me="\\d+",je="[\\u2700-\\u27bf]",Ue="["+Ae+"]",Be="[^\\ud800-\\udfff"+xe+Me+Ce+Ae+Le+"]",Fe="\\ud83c[\\udffb-\\udfff]",Ne="[^\\ud800-\\udfff]",Ge="(?:\\ud83c[\\udde6-\\uddff]){2}",Ve="[\\ud800-\\udbff][\\udc00-\\udfff]",He="["+Le+"]",ze="(?:"+Ue+"|"+Be+")",We="(?:"+He+"|"+Be+")",Ke="(?:['](?:d|ll|m|re|s|t|ve))?",qe="(?:['](?:D|LL|M|RE|S|T|VE))?",$e="(?:"+Pe+"|"+Fe+")"+"?",Ye="[\\ufe0e\\ufe0f]?",Xe=Ye+$e+("(?:\\u200d(?:"+[Ne,Ge,Ve].join("|")+")"+Ye+$e+")*"),Je="(?:"+[je,Ge,Ve].join("|")+")"+Xe,Qe="(?:"+[Ne+Pe+"?",Pe,Ge,Ve,Oe].join("|")+")",Ze=RegExp(Ie,"g"),et=RegExp(Pe,"g"),tt=RegExp(Fe+"(?="+Fe+")|"+Qe+Xe,"g"),nt=RegExp([He+"?"+Ue+"+"+Ke+"(?="+[De,He,"$"].join("|")+")",We+"+"+qe+"(?="+[De,He+ze,"$"].join("|")+")",He+"?"+ze+"+"+Ke,He+"+"+qe,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Me,Je].join("|"),"g"),rt=RegExp("[\\u200d\\ud800-\\udfff"+we+Re+"]"),it=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,at=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],st=-1,ot={};ot[U]=ot[B]=ot[F]=ot[N]=ot[G]=ot[V]=ot[H]=ot[z]=ot[W]=!0,ot[_]=ot[b]=ot[M]=ot[T]=ot[j]=ot[S]=ot[E]=ot[k]=ot[C]=ot[A]=ot[L]=ot[x]=ot[I]=ot[O]=ot[P]=!1;var ut={};ut[_]=ut[b]=ut[M]=ut[j]=ut[T]=ut[S]=ut[U]=ut[B]=ut[F]=ut[N]=ut[G]=ut[C]=ut[A]=ut[L]=ut[x]=ut[I]=ut[O]=ut[D]=ut[V]=ut[H]=ut[z]=ut[W]=!0,ut[E]=ut[k]=ut[P]=!1;var lt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ct=parseFloat,dt=parseInt,ht="object"==typeof e&&e&&e.Object===Object&&e,ft="object"==typeof self&&self&&self.Object===Object&&self,pt=ht||ft||Function("return this")(),vt=t&&!t.nodeType&&t,mt=vt&&"object"==typeof r&&r&&!r.nodeType&&r,gt=mt&&mt.exports===vt,yt=gt&&ht.process,_t=function(){try{var e=mt&&mt.require&&mt.require("util").types;return e||yt&&yt.binding&&yt.binding("util")}catch(e){}}(),bt=_t&&_t.isArrayBuffer,Tt=_t&&_t.isDate,St=_t&&_t.isMap,Et=_t&&_t.isRegExp,kt=_t&&_t.isSet,wt=_t&&_t.isTypedArray;function Ct(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function At(e,t,n,r){for(var i=-1,a=null==e?0:e.length;++i<a;){var s=e[i];t(r,s,n(s),e)}return r}function Lt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function Rt(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function xt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function It(e,t){for(var n=-1,r=null==e?0:e.length,i=0,a=[];++n<r;){var s=e[n];t(s,n,e)&&(a[i++]=s)}return a}function Ot(e,t){return!!(null==e?0:e.length)&&Vt(e,t,0)>-1}function Dt(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function Pt(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function Mt(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function jt(e,t,n,r){var i=-1,a=null==e?0:e.length;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}function Ut(e,t,n,r){var i=null==e?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function Bt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var Ft=Kt("length");function Nt(e,t,n){var r;return n(e,(function(e,n,i){if(t(e,n,i))return r=n,!1})),r}function Gt(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}function Vt(e,t,n){return t==t?function(e,t,n){var r=n-1,i=e.length;for(;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):Gt(e,zt,n)}function Ht(e,t,n,r){for(var i=n-1,a=e.length;++i<a;)if(r(e[i],t))return i;return-1}function zt(e){return e!=e}function Wt(e,t){var n=null==e?0:e.length;return n?Yt(e,t)/n:m}function Kt(e){return function(t){return null==t?a:t[e]}}function qt(e){return function(t){return null==e?a:e[t]}}function $t(e,t,n,r,i){return i(e,(function(e,i,a){n=r?(r=!1,e):t(n,e,i,a)})),n}function Yt(e,t){for(var n,r=-1,i=e.length;++r<i;){var s=t(e[r]);s!==a&&(n=n===a?s:n+s)}return n}function Xt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Jt(e){return e?e.slice(0,mn(e)+1).replace(oe,""):e}function Qt(e){return function(t){return e(t)}}function Zt(e,t){return Pt(t,(function(t){return e[t]}))}function en(e,t){return e.has(t)}function tn(e,t){for(var n=-1,r=e.length;++n<r&&Vt(t,e[n],0)>-1;);return n}function nn(e,t){for(var n=e.length;n--&&Vt(t,e[n],0)>-1;);return n}function rn(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var an=qt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),sn=qt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function on(e){return"\\"+lt[e]}function un(e){return rt.test(e)}function ln(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function cn(e,t){return function(n){return e(t(n))}}function dn(e,t){for(var n=-1,r=e.length,i=0,a=[];++n<r;){var s=e[n];s!==t&&s!==u||(e[n]=u,a[i++]=n)}return a}function hn(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}function fn(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=[e,e]})),n}function pn(e){return un(e)?function(e){var t=tt.lastIndex=0;for(;tt.test(e);)++t;return t}(e):Ft(e)}function vn(e){return un(e)?function(e){return e.match(tt)||[]}(e):function(e){return e.split("")}(e)}function mn(e){for(var t=e.length;t--&&ue.test(e.charAt(t)););return t}var gn=qt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var yn=function e(t){var n,r=(t=null==t?pt:yn.defaults(pt.Object(),t,yn.pick(pt,at))).Array,i=t.Date,ue=t.Error,we=t.Function,Ce=t.Math,Ae=t.Object,Le=t.RegExp,Re=t.String,xe=t.TypeError,Ie=r.prototype,Oe=we.prototype,De=Ae.prototype,Pe=t["__core-js_shared__"],Me=Oe.toString,je=De.hasOwnProperty,Ue=0,Be=(n=/[^.]+$/.exec(Pe&&Pe.keys&&Pe.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Fe=De.toString,Ne=Me.call(Ae),Ge=pt._,Ve=Le("^"+Me.call(je).replace(ae,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),He=gt?t.Buffer:a,ze=t.Symbol,We=t.Uint8Array,Ke=He?He.allocUnsafe:a,qe=cn(Ae.getPrototypeOf,Ae),$e=Ae.create,Ye=De.propertyIsEnumerable,Xe=Ie.splice,Je=ze?ze.isConcatSpreadable:a,Qe=ze?ze.iterator:a,tt=ze?ze.toStringTag:a,rt=function(){try{var e=fa(Ae,"defineProperty");return e({},"",{}),e}catch(e){}}(),lt=t.clearTimeout!==pt.clearTimeout&&t.clearTimeout,ht=i&&i.now!==pt.Date.now&&i.now,ft=t.setTimeout!==pt.setTimeout&&t.setTimeout,vt=Ce.ceil,mt=Ce.floor,yt=Ae.getOwnPropertySymbols,_t=He?He.isBuffer:a,Ft=t.isFinite,qt=Ie.join,_n=cn(Ae.keys,Ae),bn=Ce.max,Tn=Ce.min,Sn=i.now,En=t.parseInt,kn=Ce.random,wn=Ie.reverse,Cn=fa(t,"DataView"),An=fa(t,"Map"),Ln=fa(t,"Promise"),Rn=fa(t,"Set"),xn=fa(t,"WeakMap"),In=fa(Ae,"create"),On=xn&&new xn,Dn={},Pn=Na(Cn),Mn=Na(An),jn=Na(Ln),Un=Na(Rn),Bn=Na(xn),Fn=ze?ze.prototype:a,Nn=Fn?Fn.valueOf:a,Gn=Fn?Fn.toString:a;function Vn(e){if(ro(e)&&!Ks(e)&&!(e instanceof Kn)){if(e instanceof Wn)return e;if(je.call(e,"__wrapped__"))return Ga(e)}return new Wn(e)}var Hn=function(){function e(){}return function(t){if(!no(t))return{};if($e)return $e(t);e.prototype=t;var n=new e;return e.prototype=a,n}}();function zn(){}function Wn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=a}function Kn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=g,this.__views__=[]}function qn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function $n(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Yn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Xn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Yn;++t<n;)this.add(e[t])}function Jn(e){var t=this.__data__=new $n(e);this.size=t.size}function Qn(e,t){var n=Ks(e),r=!n&&Ws(e),i=!n&&!r&&Xs(e),a=!n&&!r&&!i&&ho(e),s=n||r||i||a,o=s?Xt(e.length,Re):[],u=o.length;for(var l in e)!t&&!je.call(e,l)||s&&("length"==l||i&&("offset"==l||"parent"==l)||a&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||ba(l,u))||o.push(l);return o}function Zn(e){var t=e.length;return t?e[Xr(0,t-1)]:a}function er(e,t){return Ua(Ii(e),lr(t,0,e.length))}function tr(e){return Ua(Ii(e))}function nr(e,t,n){(n!==a&&!Vs(e[t],n)||n===a&&!(t in e))&&or(e,t,n)}function rr(e,t,n){var r=e[t];je.call(e,t)&&Vs(r,n)&&(n!==a||t in e)||or(e,t,n)}function ir(e,t){for(var n=e.length;n--;)if(Vs(e[n][0],t))return n;return-1}function ar(e,t,n,r){return pr(e,(function(e,i,a){t(r,e,n(e),a)})),r}function sr(e,t){return e&&Oi(t,Po(t),e)}function or(e,t,n){"__proto__"==t&&rt?rt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function ur(e,t){for(var n=-1,i=t.length,s=r(i),o=null==e;++n<i;)s[n]=o?a:Ro(e,t[n]);return s}function lr(e,t,n){return e==e&&(n!==a&&(e=e<=n?e:n),t!==a&&(e=e>=t?e:t)),e}function cr(e,t,n,r,i,s){var o,u=1&t,l=2&t,c=4&t;if(n&&(o=i?n(e,r,i,s):n(e)),o!==a)return o;if(!no(e))return e;var d=Ks(e);if(d){if(o=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&je.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!u)return Ii(e,o)}else{var h=ma(e),f=h==k||h==w;if(Xs(e))return wi(e,u);if(h==L||h==_||f&&!i){if(o=l||f?{}:ya(e),!u)return l?function(e,t){return Oi(e,va(e),t)}(e,function(e,t){return e&&Oi(t,Mo(t),e)}(o,e)):function(e,t){return Oi(e,pa(e),t)}(e,sr(o,e))}else{if(!ut[h])return i?e:{};o=function(e,t,n){var r=e.constructor;switch(t){case M:return Ci(e);case T:case S:return new r(+e);case j:return function(e,t){var n=t?Ci(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case U:case B:case F:case N:case G:case V:case H:case z:case W:return Ai(e,n);case C:return new r;case A:case O:return new r(e);case x:return function(e){var t=new e.constructor(e.source,me.exec(e));return t.lastIndex=e.lastIndex,t}(e);case I:return new r;case D:return i=e,Nn?Ae(Nn.call(i)):{}}var i}(e,h,u)}}s||(s=new Jn);var p=s.get(e);if(p)return p;s.set(e,o),uo(e)?e.forEach((function(r){o.add(cr(r,t,n,r,e,s))})):io(e)&&e.forEach((function(r,i){o.set(i,cr(r,t,n,i,e,s))}));var v=d?a:(c?l?sa:aa:l?Mo:Po)(e);return Lt(v||e,(function(r,i){v&&(r=e[i=r]),rr(o,i,cr(r,t,n,i,e,s))})),o}function dr(e,t,n){var r=n.length;if(null==e)return!r;for(e=Ae(e);r--;){var i=n[r],s=t[i],o=e[i];if(o===a&&!(i in e)||!s(o))return!1}return!0}function hr(e,t,n){if("function"!=typeof e)throw new xe(s);return Da((function(){e.apply(a,n)}),t)}function fr(e,t,n,r){var i=-1,a=Ot,s=!0,o=e.length,u=[],l=t.length;if(!o)return u;n&&(t=Pt(t,Qt(n))),r?(a=Dt,s=!1):t.length>=200&&(a=en,s=!1,t=new Xn(t));e:for(;++i<o;){var c=e[i],d=null==n?c:n(c);if(c=r||0!==c?c:0,s&&d==d){for(var h=l;h--;)if(t[h]===d)continue e;u.push(c)}else a(t,d,r)||u.push(c)}return u}Vn.templateSettings={escape:Z,evaluate:ee,interpolate:te,variable:"",imports:{_:Vn}},Vn.prototype=zn.prototype,Vn.prototype.constructor=Vn,Wn.prototype=Hn(zn.prototype),Wn.prototype.constructor=Wn,Kn.prototype=Hn(zn.prototype),Kn.prototype.constructor=Kn,qn.prototype.clear=function(){this.__data__=In?In(null):{},this.size=0},qn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},qn.prototype.get=function(e){var t=this.__data__;if(In){var n=t[e];return n===o?a:n}return je.call(t,e)?t[e]:a},qn.prototype.has=function(e){var t=this.__data__;return In?t[e]!==a:je.call(t,e)},qn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=In&&t===a?o:t,this},$n.prototype.clear=function(){this.__data__=[],this.size=0},$n.prototype.delete=function(e){var t=this.__data__,n=ir(t,e);return!(n<0)&&(n==t.length-1?t.pop():Xe.call(t,n,1),--this.size,!0)},$n.prototype.get=function(e){var t=this.__data__,n=ir(t,e);return n<0?a:t[n][1]},$n.prototype.has=function(e){return ir(this.__data__,e)>-1},$n.prototype.set=function(e,t){var n=this.__data__,r=ir(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Yn.prototype.clear=function(){this.size=0,this.__data__={hash:new qn,map:new(An||$n),string:new qn}},Yn.prototype.delete=function(e){var t=da(this,e).delete(e);return this.size-=t?1:0,t},Yn.prototype.get=function(e){return da(this,e).get(e)},Yn.prototype.has=function(e){return da(this,e).has(e)},Yn.prototype.set=function(e,t){var n=da(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Xn.prototype.add=Xn.prototype.push=function(e){return this.__data__.set(e,o),this},Xn.prototype.has=function(e){return this.__data__.has(e)},Jn.prototype.clear=function(){this.__data__=new $n,this.size=0},Jn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Jn.prototype.get=function(e){return this.__data__.get(e)},Jn.prototype.has=function(e){return this.__data__.has(e)},Jn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof $n){var r=n.__data__;if(!An||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Yn(r)}return n.set(e,t),this.size=n.size,this};var pr=Mi(Sr),vr=Mi(Er,!0);function mr(e,t){var n=!0;return pr(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function gr(e,t,n){for(var r=-1,i=e.length;++r<i;){var s=e[r],o=t(s);if(null!=o&&(u===a?o==o&&!co(o):n(o,u)))var u=o,l=s}return l}function yr(e,t){var n=[];return pr(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}function _r(e,t,n,r,i){var a=-1,s=e.length;for(n||(n=_a),i||(i=[]);++a<s;){var o=e[a];t>0&&n(o)?t>1?_r(o,t-1,n,r,i):Mt(i,o):r||(i[i.length]=o)}return i}var br=ji(),Tr=ji(!0);function Sr(e,t){return e&&br(e,t,Po)}function Er(e,t){return e&&Tr(e,t,Po)}function kr(e,t){return It(t,(function(t){return Zs(e[t])}))}function wr(e,t){for(var n=0,r=(t=Ti(t,e)).length;null!=e&&n<r;)e=e[Fa(t[n++])];return n&&n==r?e:a}function Cr(e,t,n){var r=t(e);return Ks(e)?r:Mt(r,n(e))}function Ar(e){return null==e?e===a?"[object Undefined]":"[object Null]":tt&&tt in Ae(e)?function(e){var t=je.call(e,tt),n=e[tt];try{e[tt]=a;var r=!0}catch(e){}var i=Fe.call(e);r&&(t?e[tt]=n:delete e[tt]);return i}(e):function(e){return Fe.call(e)}(e)}function Lr(e,t){return e>t}function Rr(e,t){return null!=e&&je.call(e,t)}function xr(e,t){return null!=e&&t in Ae(e)}function Ir(e,t,n){for(var i=n?Dt:Ot,s=e[0].length,o=e.length,u=o,l=r(o),c=1/0,d=[];u--;){var h=e[u];u&&t&&(h=Pt(h,Qt(t))),c=Tn(h.length,c),l[u]=!n&&(t||s>=120&&h.length>=120)?new Xn(u&&h):a}h=e[0];var f=-1,p=l[0];e:for(;++f<s&&d.length<c;){var v=h[f],m=t?t(v):v;if(v=n||0!==v?v:0,!(p?en(p,m):i(d,m,n))){for(u=o;--u;){var g=l[u];if(!(g?en(g,m):i(e[u],m,n)))continue e}p&&p.push(m),d.push(v)}}return d}function Or(e,t,n){var r=null==(e=Ra(e,t=Ti(t,e)))?e:e[Fa(Qa(t))];return null==r?a:Ct(r,e,n)}function Dr(e){return ro(e)&&Ar(e)==_}function Pr(e,t,n,r,i){return e===t||(null==e||null==t||!ro(e)&&!ro(t)?e!=e&&t!=t:function(e,t,n,r,i,s){var o=Ks(e),u=Ks(t),l=o?b:ma(e),c=u?b:ma(t),d=(l=l==_?L:l)==L,h=(c=c==_?L:c)==L,f=l==c;if(f&&Xs(e)){if(!Xs(t))return!1;o=!0,d=!1}if(f&&!d)return s||(s=new Jn),o||ho(e)?ra(e,t,n,r,i,s):function(e,t,n,r,i,a,s){switch(n){case j:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case M:return!(e.byteLength!=t.byteLength||!a(new We(e),new We(t)));case T:case S:case A:return Vs(+e,+t);case E:return e.name==t.name&&e.message==t.message;case x:case O:return e==t+"";case C:var o=ln;case I:var u=1&r;if(o||(o=hn),e.size!=t.size&&!u)return!1;var l=s.get(e);if(l)return l==t;r|=2,s.set(e,t);var c=ra(o(e),o(t),r,i,a,s);return s.delete(e),c;case D:if(Nn)return Nn.call(e)==Nn.call(t)}return!1}(e,t,l,n,r,i,s);if(!(1&n)){var p=d&&je.call(e,"__wrapped__"),v=h&&je.call(t,"__wrapped__");if(p||v){var m=p?e.value():e,g=v?t.value():t;return s||(s=new Jn),i(m,g,n,r,s)}}if(!f)return!1;return s||(s=new Jn),function(e,t,n,r,i,s){var o=1&n,u=aa(e),l=u.length,c=aa(t).length;if(l!=c&&!o)return!1;var d=l;for(;d--;){var h=u[d];if(!(o?h in t:je.call(t,h)))return!1}var f=s.get(e),p=s.get(t);if(f&&p)return f==t&&p==e;var v=!0;s.set(e,t),s.set(t,e);var m=o;for(;++d<l;){var g=e[h=u[d]],y=t[h];if(r)var _=o?r(y,g,h,t,e,s):r(g,y,h,e,t,s);if(!(_===a?g===y||i(g,y,n,r,s):_)){v=!1;break}m||(m="constructor"==h)}if(v&&!m){var b=e.constructor,T=t.constructor;b==T||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof T&&T instanceof T||(v=!1)}return s.delete(e),s.delete(t),v}(e,t,n,r,i,s)}(e,t,n,r,Pr,i))}function Mr(e,t,n,r){var i=n.length,s=i,o=!r;if(null==e)return!s;for(e=Ae(e);i--;){var u=n[i];if(o&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++i<s;){var l=(u=n[i])[0],c=e[l],d=u[1];if(o&&u[2]){if(c===a&&!(l in e))return!1}else{var h=new Jn;if(r)var f=r(c,d,l,e,t,h);if(!(f===a?Pr(d,c,3,r,h):f))return!1}}return!0}function jr(e){return!(!no(e)||(t=e,Be&&Be in t))&&(Zs(e)?Ve:_e).test(Na(e));var t}function Ur(e){return"function"==typeof e?e:null==e?su:"object"==typeof e?Ks(e)?Hr(e[0],e[1]):Vr(e):vu(e)}function Br(e){if(!wa(e))return _n(e);var t=[];for(var n in Ae(e))je.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Fr(e){if(!no(e))return function(e){var t=[];if(null!=e)for(var n in Ae(e))t.push(n);return t}(e);var t=wa(e),n=[];for(var r in e)("constructor"!=r||!t&&je.call(e,r))&&n.push(r);return n}function Nr(e,t){return e<t}function Gr(e,t){var n=-1,i=$s(e)?r(e.length):[];return pr(e,(function(e,r,a){i[++n]=t(e,r,a)})),i}function Vr(e){var t=ha(e);return 1==t.length&&t[0][2]?Aa(t[0][0],t[0][1]):function(n){return n===e||Mr(n,e,t)}}function Hr(e,t){return Sa(e)&&Ca(t)?Aa(Fa(e),t):function(n){var r=Ro(n,e);return r===a&&r===t?xo(n,e):Pr(t,r,3)}}function zr(e,t,n,r,i){e!==t&&br(t,(function(s,o){if(i||(i=new Jn),no(s))!function(e,t,n,r,i,s,o){var u=Ia(e,n),l=Ia(t,n),c=o.get(l);if(c)return void nr(e,n,c);var d=s?s(u,l,n+"",e,t,o):a,h=d===a;if(h){var f=Ks(l),p=!f&&Xs(l),v=!f&&!p&&ho(l);d=l,f||p||v?Ks(u)?d=u:Ys(u)?d=Ii(u):p?(h=!1,d=wi(l,!0)):v?(h=!1,d=Ai(l,!0)):d=[]:so(l)||Ws(l)?(d=u,Ws(u)?d=bo(u):no(u)&&!Zs(u)||(d=ya(l))):h=!1}h&&(o.set(l,d),i(d,l,r,s,o),o.delete(l));nr(e,n,d)}(e,t,o,n,zr,r,i);else{var u=r?r(Ia(e,o),s,o+"",e,t,i):a;u===a&&(u=s),nr(e,o,u)}}),Mo)}function Wr(e,t){var n=e.length;if(n)return ba(t+=t<0?n:0,n)?e[t]:a}function Kr(e,t,n){t=t.length?Pt(t,(function(e){return Ks(e)?function(t){return wr(t,1===e.length?e[0]:e)}:e})):[su];var r=-1;return t=Pt(t,Qt(ca())),function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}(Gr(e,(function(e,n,i){return{criteria:Pt(t,(function(t){return t(e)})),index:++r,value:e}})),(function(e,t){return function(e,t,n){var r=-1,i=e.criteria,a=t.criteria,s=i.length,o=n.length;for(;++r<s;){var u=Li(i[r],a[r]);if(u)return r>=o?u:u*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}))}function qr(e,t,n){for(var r=-1,i=t.length,a={};++r<i;){var s=t[r],o=wr(e,s);n(o,s)&&ti(a,Ti(s,e),o)}return a}function $r(e,t,n,r){var i=r?Ht:Vt,a=-1,s=t.length,o=e;for(e===t&&(t=Ii(t)),n&&(o=Pt(e,Qt(n)));++a<s;)for(var u=0,l=t[a],c=n?n(l):l;(u=i(o,c,u,r))>-1;)o!==e&&Xe.call(o,u,1),Xe.call(e,u,1);return e}function Yr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==a){var a=i;ba(i)?Xe.call(e,i,1):fi(e,i)}}return e}function Xr(e,t){return e+mt(kn()*(t-e+1))}function Jr(e,t){var n="";if(!e||t<1||t>v)return n;do{t%2&&(n+=e),(t=mt(t/2))&&(e+=e)}while(t);return n}function Qr(e,t){return Pa(La(e,t,su),e+"")}function Zr(e){return Zn(Ho(e))}function ei(e,t){var n=Ho(e);return Ua(n,lr(t,0,n.length))}function ti(e,t,n,r){if(!no(e))return e;for(var i=-1,s=(t=Ti(t,e)).length,o=s-1,u=e;null!=u&&++i<s;){var l=Fa(t[i]),c=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return e;if(i!=o){var d=u[l];(c=r?r(d,l,u):a)===a&&(c=no(d)?d:ba(t[i+1])?[]:{})}rr(u,l,c),u=u[l]}return e}var ni=On?function(e,t){return On.set(e,t),e}:su,ri=rt?function(e,t){return rt(e,"toString",{configurable:!0,enumerable:!1,value:ru(t),writable:!0})}:su;function ii(e){return Ua(Ho(e))}function ai(e,t,n){var i=-1,a=e.length;t<0&&(t=-t>a?0:a+t),(n=n>a?a:n)<0&&(n+=a),a=t>n?0:n-t>>>0,t>>>=0;for(var s=r(a);++i<a;)s[i]=e[i+t];return s}function si(e,t){var n;return pr(e,(function(e,r,i){return!(n=t(e,r,i))})),!!n}function oi(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;r<i;){var a=r+i>>>1,s=e[a];null!==s&&!co(s)&&(n?s<=t:s<t)?r=a+1:i=a}return i}return ui(e,t,su,n)}function ui(e,t,n,r){var i=0,s=null==e?0:e.length;if(0===s)return 0;for(var o=(t=n(t))!=t,u=null===t,l=co(t),c=t===a;i<s;){var d=mt((i+s)/2),h=n(e[d]),f=h!==a,p=null===h,v=h==h,m=co(h);if(o)var g=r||v;else g=c?v&&(r||f):u?v&&f&&(r||!p):l?v&&f&&!p&&(r||!m):!p&&!m&&(r?h<=t:h<t);g?i=d+1:s=d}return Tn(s,4294967294)}function li(e,t){for(var n=-1,r=e.length,i=0,a=[];++n<r;){var s=e[n],o=t?t(s):s;if(!n||!Vs(o,u)){var u=o;a[i++]=0===s?0:s}}return a}function ci(e){return"number"==typeof e?e:co(e)?m:+e}function di(e){if("string"==typeof e)return e;if(Ks(e))return Pt(e,di)+"";if(co(e))return Gn?Gn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function hi(e,t,n){var r=-1,i=Ot,a=e.length,s=!0,o=[],u=o;if(n)s=!1,i=Dt;else if(a>=200){var l=t?null:Ji(e);if(l)return hn(l);s=!1,i=en,u=new Xn}else u=t?[]:o;e:for(;++r<a;){var c=e[r],d=t?t(c):c;if(c=n||0!==c?c:0,s&&d==d){for(var h=u.length;h--;)if(u[h]===d)continue e;t&&u.push(d),o.push(c)}else i(u,d,n)||(u!==o&&u.push(d),o.push(c))}return o}function fi(e,t){return null==(e=Ra(e,t=Ti(t,e)))||delete e[Fa(Qa(t))]}function pi(e,t,n,r){return ti(e,t,n(wr(e,t)),r)}function vi(e,t,n,r){for(var i=e.length,a=r?i:-1;(r?a--:++a<i)&&t(e[a],a,e););return n?ai(e,r?0:a,r?a+1:i):ai(e,r?a+1:0,r?i:a)}function mi(e,t){var n=e;return n instanceof Kn&&(n=n.value()),jt(t,(function(e,t){return t.func.apply(t.thisArg,Mt([e],t.args))}),n)}function gi(e,t,n){var i=e.length;if(i<2)return i?hi(e[0]):[];for(var a=-1,s=r(i);++a<i;)for(var o=e[a],u=-1;++u<i;)u!=a&&(s[a]=fr(s[a]||o,e[u],t,n));return hi(_r(s,1),t,n)}function yi(e,t,n){for(var r=-1,i=e.length,s=t.length,o={};++r<i;){var u=r<s?t[r]:a;n(o,e[r],u)}return o}function _i(e){return Ys(e)?e:[]}function bi(e){return"function"==typeof e?e:su}function Ti(e,t){return Ks(e)?e:Sa(e,t)?[e]:Ba(To(e))}var Si=Qr;function Ei(e,t,n){var r=e.length;return n=n===a?r:n,!t&&n>=r?e:ai(e,t,n)}var ki=lt||function(e){return pt.clearTimeout(e)};function wi(e,t){if(t)return e.slice();var n=e.length,r=Ke?Ke(n):new e.constructor(n);return e.copy(r),r}function Ci(e){var t=new e.constructor(e.byteLength);return new We(t).set(new We(e)),t}function Ai(e,t){var n=t?Ci(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Li(e,t){if(e!==t){var n=e!==a,r=null===e,i=e==e,s=co(e),o=t!==a,u=null===t,l=t==t,c=co(t);if(!u&&!c&&!s&&e>t||s&&o&&l&&!u&&!c||r&&o&&l||!n&&l||!i)return 1;if(!r&&!s&&!c&&e<t||c&&n&&i&&!r&&!s||u&&n&&i||!o&&i||!l)return-1}return 0}function Ri(e,t,n,i){for(var a=-1,s=e.length,o=n.length,u=-1,l=t.length,c=bn(s-o,0),d=r(l+c),h=!i;++u<l;)d[u]=t[u];for(;++a<o;)(h||a<s)&&(d[n[a]]=e[a]);for(;c--;)d[u++]=e[a++];return d}function xi(e,t,n,i){for(var a=-1,s=e.length,o=-1,u=n.length,l=-1,c=t.length,d=bn(s-u,0),h=r(d+c),f=!i;++a<d;)h[a]=e[a];for(var p=a;++l<c;)h[p+l]=t[l];for(;++o<u;)(f||a<s)&&(h[p+n[o]]=e[a++]);return h}function Ii(e,t){var n=-1,i=e.length;for(t||(t=r(i));++n<i;)t[n]=e[n];return t}function Oi(e,t,n,r){var i=!n;n||(n={});for(var s=-1,o=t.length;++s<o;){var u=t[s],l=r?r(n[u],e[u],u,n,e):a;l===a&&(l=e[u]),i?or(n,u,l):rr(n,u,l)}return n}function Di(e,t){return function(n,r){var i=Ks(n)?At:ar,a=t?t():{};return i(n,e,ca(r,2),a)}}function Pi(e){return Qr((function(t,n){var r=-1,i=n.length,s=i>1?n[i-1]:a,o=i>2?n[2]:a;for(s=e.length>3&&"function"==typeof s?(i--,s):a,o&&Ta(n[0],n[1],o)&&(s=i<3?a:s,i=1),t=Ae(t);++r<i;){var u=n[r];u&&e(t,u,r,s)}return t}))}function Mi(e,t){return function(n,r){if(null==n)return n;if(!$s(n))return e(n,r);for(var i=n.length,a=t?i:-1,s=Ae(n);(t?a--:++a<i)&&!1!==r(s[a],a,s););return n}}function ji(e){return function(t,n,r){for(var i=-1,a=Ae(t),s=r(t),o=s.length;o--;){var u=s[e?o:++i];if(!1===n(a[u],u,a))break}return t}}function Ui(e){return function(t){var n=un(t=To(t))?vn(t):a,r=n?n[0]:t.charAt(0),i=n?Ei(n,1).join(""):t.slice(1);return r[e]()+i}}function Bi(e){return function(t){return jt(eu(Ko(t).replace(Ze,"")),e,"")}}function Fi(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Hn(e.prototype),r=e.apply(n,t);return no(r)?r:n}}function Ni(e){return function(t,n,r){var i=Ae(t);if(!$s(t)){var s=ca(n,3);t=Po(t),n=function(e){return s(i[e],e,i)}}var o=e(t,n,r);return o>-1?i[s?t[o]:o]:a}}function Gi(e){return ia((function(t){var n=t.length,r=n,i=Wn.prototype.thru;for(e&&t.reverse();r--;){var o=t[r];if("function"!=typeof o)throw new xe(s);if(i&&!u&&"wrapper"==ua(o))var u=new Wn([],!0)}for(r=u?r:n;++r<n;){var l=ua(o=t[r]),c="wrapper"==l?oa(o):a;u=c&&Ea(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?u[ua(c[0])].apply(u,c[3]):1==o.length&&Ea(o)?u[l]():u.thru(o)}return function(){var e=arguments,r=e[0];if(u&&1==e.length&&Ks(r))return u.plant(r).value();for(var i=0,a=n?t[i].apply(this,e):r;++i<n;)a=t[i].call(this,a);return a}}))}function Vi(e,t,n,i,s,o,u,l,c,d){var f=t&h,p=1&t,v=2&t,m=24&t,g=512&t,y=v?a:Fi(e);return function a(){for(var h=arguments.length,_=r(h),b=h;b--;)_[b]=arguments[b];if(m)var T=la(a),S=rn(_,T);if(i&&(_=Ri(_,i,s,m)),o&&(_=xi(_,o,u,m)),h-=S,m&&h<d){var E=dn(_,T);return Yi(e,t,Vi,a.placeholder,n,_,E,l,c,d-h)}var k=p?n:this,w=v?k[e]:e;return h=_.length,l?_=xa(_,l):g&&h>1&&_.reverse(),f&&c<h&&(_.length=c),this&&this!==pt&&this instanceof a&&(w=y||Fi(w)),w.apply(k,_)}}function Hi(e,t){return function(n,r){return function(e,t,n,r){return Sr(e,(function(e,i,a){t(r,n(e),i,a)})),r}(n,e,t(r),{})}}function zi(e,t){return function(n,r){var i;if(n===a&&r===a)return t;if(n!==a&&(i=n),r!==a){if(i===a)return r;"string"==typeof n||"string"==typeof r?(n=di(n),r=di(r)):(n=ci(n),r=ci(r)),i=e(n,r)}return i}}function Wi(e){return ia((function(t){return t=Pt(t,Qt(ca())),Qr((function(n){var r=this;return e(t,(function(e){return Ct(e,r,n)}))}))}))}function Ki(e,t){var n=(t=t===a?" ":di(t)).length;if(n<2)return n?Jr(t,e):t;var r=Jr(t,vt(e/pn(t)));return un(t)?Ei(vn(r),0,e).join(""):r.slice(0,e)}function qi(e){return function(t,n,i){return i&&"number"!=typeof i&&Ta(t,n,i)&&(n=i=a),t=mo(t),n===a?(n=t,t=0):n=mo(n),function(e,t,n,i){for(var a=-1,s=bn(vt((t-e)/(n||1)),0),o=r(s);s--;)o[i?s:++a]=e,e+=n;return o}(t,n,i=i===a?t<n?1:-1:mo(i),e)}}function $i(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=_o(t),n=_o(n)),e(t,n)}}function Yi(e,t,n,r,i,s,o,u,l,h){var f=8&t;t|=f?c:d,4&(t&=~(f?d:c))||(t&=-4);var p=[e,t,i,f?s:a,f?o:a,f?a:s,f?a:o,u,l,h],v=n.apply(a,p);return Ea(e)&&Oa(v,p),v.placeholder=r,Ma(v,e,t)}function Xi(e){var t=Ce[e];return function(e,n){if(e=_o(e),(n=null==n?0:Tn(go(n),292))&&Ft(e)){var r=(To(e)+"e").split("e");return+((r=(To(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var Ji=Rn&&1/hn(new Rn([,-0]))[1]==p?function(e){return new Rn(e)}:du;function Qi(e){return function(t){var n=ma(t);return n==C?ln(t):n==I?fn(t):function(e,t){return Pt(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Zi(e,t,n,i,o,p,v,m){var g=2&t;if(!g&&"function"!=typeof e)throw new xe(s);var y=i?i.length:0;if(y||(t&=-97,i=o=a),v=v===a?v:bn(go(v),0),m=m===a?m:go(m),y-=o?o.length:0,t&d){var _=i,b=o;i=o=a}var T=g?a:oa(e),S=[e,t,n,i,o,_,b,p,v,m];if(T&&function(e,t){var n=e[1],r=t[1],i=n|r,a=i<131,s=r==h&&8==n||r==h&&n==f&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!a&&!s)return e;1&r&&(e[2]=t[2],i|=1&n?0:4);var o=t[3];if(o){var l=e[3];e[3]=l?Ri(l,o,t[4]):o,e[4]=l?dn(e[3],u):t[4]}(o=t[5])&&(l=e[5],e[5]=l?xi(l,o,t[6]):o,e[6]=l?dn(e[5],u):t[6]);(o=t[7])&&(e[7]=o);r&h&&(e[8]=null==e[8]?t[8]:Tn(e[8],t[8]));null==e[9]&&(e[9]=t[9]);e[0]=t[0],e[1]=i}(S,T),e=S[0],t=S[1],n=S[2],i=S[3],o=S[4],!(m=S[9]=S[9]===a?g?0:e.length:bn(S[9]-y,0))&&24&t&&(t&=-25),t&&1!=t)E=8==t||t==l?function(e,t,n){var i=Fi(e);return function s(){for(var o=arguments.length,u=r(o),l=o,c=la(s);l--;)u[l]=arguments[l];var d=o<3&&u[0]!==c&&u[o-1]!==c?[]:dn(u,c);return(o-=d.length)<n?Yi(e,t,Vi,s.placeholder,a,u,d,a,a,n-o):Ct(this&&this!==pt&&this instanceof s?i:e,this,u)}}(e,t,m):t!=c&&33!=t||o.length?Vi.apply(a,S):function(e,t,n,i){var a=1&t,s=Fi(e);return function t(){for(var o=-1,u=arguments.length,l=-1,c=i.length,d=r(c+u),h=this&&this!==pt&&this instanceof t?s:e;++l<c;)d[l]=i[l];for(;u--;)d[l++]=arguments[++o];return Ct(h,a?n:this,d)}}(e,t,n,i);else var E=function(e,t,n){var r=1&t,i=Fi(e);return function t(){return(this&&this!==pt&&this instanceof t?i:e).apply(r?n:this,arguments)}}(e,t,n);return Ma((T?ni:Oa)(E,S),e,t)}function ea(e,t,n,r){return e===a||Vs(e,De[n])&&!je.call(r,n)?t:e}function ta(e,t,n,r,i,s){return no(e)&&no(t)&&(s.set(t,e),zr(e,t,a,ta,s),s.delete(t)),e}function na(e){return so(e)?a:e}function ra(e,t,n,r,i,s){var o=1&n,u=e.length,l=t.length;if(u!=l&&!(o&&l>u))return!1;var c=s.get(e),d=s.get(t);if(c&&d)return c==t&&d==e;var h=-1,f=!0,p=2&n?new Xn:a;for(s.set(e,t),s.set(t,e);++h<u;){var v=e[h],m=t[h];if(r)var g=o?r(m,v,h,t,e,s):r(v,m,h,e,t,s);if(g!==a){if(g)continue;f=!1;break}if(p){if(!Bt(t,(function(e,t){if(!en(p,t)&&(v===e||i(v,e,n,r,s)))return p.push(t)}))){f=!1;break}}else if(v!==m&&!i(v,m,n,r,s)){f=!1;break}}return s.delete(e),s.delete(t),f}function ia(e){return Pa(La(e,a,qa),e+"")}function aa(e){return Cr(e,Po,pa)}function sa(e){return Cr(e,Mo,va)}var oa=On?function(e){return On.get(e)}:du;function ua(e){for(var t=e.name+"",n=Dn[t],r=je.call(Dn,t)?n.length:0;r--;){var i=n[r],a=i.func;if(null==a||a==e)return i.name}return t}function la(e){return(je.call(Vn,"placeholder")?Vn:e).placeholder}function ca(){var e=Vn.iteratee||ou;return e=e===ou?Ur:e,arguments.length?e(arguments[0],arguments[1]):e}function da(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map}function ha(e){for(var t=Po(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Ca(i)]}return t}function fa(e,t){var n=function(e,t){return null==e?a:e[t]}(e,t);return jr(n)?n:a}var pa=yt?function(e){return null==e?[]:(e=Ae(e),It(yt(e),(function(t){return Ye.call(e,t)})))}:yu,va=yt?function(e){for(var t=[];e;)Mt(t,pa(e)),e=qe(e);return t}:yu,ma=Ar;function ga(e,t,n){for(var r=-1,i=(t=Ti(t,e)).length,a=!1;++r<i;){var s=Fa(t[r]);if(!(a=null!=e&&n(e,s)))break;e=e[s]}return a||++r!=i?a:!!(i=null==e?0:e.length)&&to(i)&&ba(s,i)&&(Ks(e)||Ws(e))}function ya(e){return"function"!=typeof e.constructor||wa(e)?{}:Hn(qe(e))}function _a(e){return Ks(e)||Ws(e)||!!(Je&&e&&e[Je])}function ba(e,t){var n=typeof e;return!!(t=null==t?v:t)&&("number"==n||"symbol"!=n&&Te.test(e))&&e>-1&&e%1==0&&e<t}function Ta(e,t,n){if(!no(n))return!1;var r=typeof t;return!!("number"==r?$s(n)&&ba(t,n.length):"string"==r&&t in n)&&Vs(n[t],e)}function Sa(e,t){if(Ks(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!co(e))||(re.test(e)||!ne.test(e)||null!=t&&e in Ae(t))}function Ea(e){var t=ua(e),n=Vn[t];if("function"!=typeof n||!(t in Kn.prototype))return!1;if(e===n)return!0;var r=oa(n);return!!r&&e===r[0]}(Cn&&ma(new Cn(new ArrayBuffer(1)))!=j||An&&ma(new An)!=C||Ln&&ma(Ln.resolve())!=R||Rn&&ma(new Rn)!=I||xn&&ma(new xn)!=P)&&(ma=function(e){var t=Ar(e),n=t==L?e.constructor:a,r=n?Na(n):"";if(r)switch(r){case Pn:return j;case Mn:return C;case jn:return R;case Un:return I;case Bn:return P}return t});var ka=Pe?Zs:_u;function wa(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||De)}function Ca(e){return e==e&&!no(e)}function Aa(e,t){return function(n){return null!=n&&(n[e]===t&&(t!==a||e in Ae(n)))}}function La(e,t,n){return t=bn(t===a?e.length-1:t,0),function(){for(var i=arguments,a=-1,s=bn(i.length-t,0),o=r(s);++a<s;)o[a]=i[t+a];a=-1;for(var u=r(t+1);++a<t;)u[a]=i[a];return u[t]=n(o),Ct(e,this,u)}}function Ra(e,t){return t.length<2?e:wr(e,ai(t,0,-1))}function xa(e,t){for(var n=e.length,r=Tn(t.length,n),i=Ii(e);r--;){var s=t[r];e[r]=ba(s,n)?i[s]:a}return e}function Ia(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Oa=ja(ni),Da=ft||function(e,t){return pt.setTimeout(e,t)},Pa=ja(ri);function Ma(e,t,n){var r=t+"";return Pa(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(le,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return Lt(y,(function(n){var r="_."+n[0];t&n[1]&&!Ot(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(ce);return t?t[1].split(de):[]}(r),n)))}function ja(e){var t=0,n=0;return function(){var r=Sn(),i=16-(r-n);if(n=r,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(a,arguments)}}function Ua(e,t){var n=-1,r=e.length,i=r-1;for(t=t===a?r:t;++n<t;){var s=Xr(n,i),o=e[s];e[s]=e[n],e[n]=o}return e.length=t,e}var Ba=function(e){var t=js(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ie,(function(e,n,r,i){t.push(r?i.replace(pe,"$1"):n||e)})),t}));function Fa(e){if("string"==typeof e||co(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Na(e){if(null!=e){try{return Me.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ga(e){if(e instanceof Kn)return e.clone();var t=new Wn(e.__wrapped__,e.__chain__);return t.__actions__=Ii(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Va=Qr((function(e,t){return Ys(e)?fr(e,_r(t,1,Ys,!0)):[]})),Ha=Qr((function(e,t){var n=Qa(t);return Ys(n)&&(n=a),Ys(e)?fr(e,_r(t,1,Ys,!0),ca(n,2)):[]})),za=Qr((function(e,t){var n=Qa(t);return Ys(n)&&(n=a),Ys(e)?fr(e,_r(t,1,Ys,!0),a,n):[]}));function Wa(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:go(n);return i<0&&(i=bn(r+i,0)),Gt(e,ca(t,3),i)}function Ka(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r-1;return n!==a&&(i=go(n),i=n<0?bn(r+i,0):Tn(i,r-1)),Gt(e,ca(t,3),i,!0)}function qa(e){return(null==e?0:e.length)?_r(e,1):[]}function $a(e){return e&&e.length?e[0]:a}var Ya=Qr((function(e){var t=Pt(e,_i);return t.length&&t[0]===e[0]?Ir(t):[]})),Xa=Qr((function(e){var t=Qa(e),n=Pt(e,_i);return t===Qa(n)?t=a:n.pop(),n.length&&n[0]===e[0]?Ir(n,ca(t,2)):[]})),Ja=Qr((function(e){var t=Qa(e),n=Pt(e,_i);return(t="function"==typeof t?t:a)&&n.pop(),n.length&&n[0]===e[0]?Ir(n,a,t):[]}));function Qa(e){var t=null==e?0:e.length;return t?e[t-1]:a}var Za=Qr(es);function es(e,t){return e&&e.length&&t&&t.length?$r(e,t):e}var ts=ia((function(e,t){var n=null==e?0:e.length,r=ur(e,t);return Yr(e,Pt(t,(function(e){return ba(e,n)?+e:e})).sort(Li)),r}));function ns(e){return null==e?e:wn.call(e)}var rs=Qr((function(e){return hi(_r(e,1,Ys,!0))})),is=Qr((function(e){var t=Qa(e);return Ys(t)&&(t=a),hi(_r(e,1,Ys,!0),ca(t,2))})),as=Qr((function(e){var t=Qa(e);return t="function"==typeof t?t:a,hi(_r(e,1,Ys,!0),a,t)}));function ss(e){if(!e||!e.length)return[];var t=0;return e=It(e,(function(e){if(Ys(e))return t=bn(e.length,t),!0})),Xt(t,(function(t){return Pt(e,Kt(t))}))}function os(e,t){if(!e||!e.length)return[];var n=ss(e);return null==t?n:Pt(n,(function(e){return Ct(t,a,e)}))}var us=Qr((function(e,t){return Ys(e)?fr(e,t):[]})),ls=Qr((function(e){return gi(It(e,Ys))})),cs=Qr((function(e){var t=Qa(e);return Ys(t)&&(t=a),gi(It(e,Ys),ca(t,2))})),ds=Qr((function(e){var t=Qa(e);return t="function"==typeof t?t:a,gi(It(e,Ys),a,t)})),hs=Qr(ss);var fs=Qr((function(e){var t=e.length,n=t>1?e[t-1]:a;return n="function"==typeof n?(e.pop(),n):a,os(e,n)}));function ps(e){var t=Vn(e);return t.__chain__=!0,t}function vs(e,t){return t(e)}var ms=ia((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,i=function(t){return ur(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Kn&&ba(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:vs,args:[i],thisArg:a}),new Wn(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(a),e}))):this.thru(i)}));var gs=Di((function(e,t,n){je.call(e,n)?++e[n]:or(e,n,1)}));var ys=Ni(Wa),_s=Ni(Ka);function bs(e,t){return(Ks(e)?Lt:pr)(e,ca(t,3))}function Ts(e,t){return(Ks(e)?Rt:vr)(e,ca(t,3))}var Ss=Di((function(e,t,n){je.call(e,n)?e[n].push(t):or(e,n,[t])}));var Es=Qr((function(e,t,n){var i=-1,a="function"==typeof t,s=$s(e)?r(e.length):[];return pr(e,(function(e){s[++i]=a?Ct(t,e,n):Or(e,t,n)})),s})),ks=Di((function(e,t,n){or(e,n,t)}));function ws(e,t){return(Ks(e)?Pt:Gr)(e,ca(t,3))}var Cs=Di((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var As=Qr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&Ta(e,t[0],t[1])?t=[]:n>2&&Ta(t[0],t[1],t[2])&&(t=[t[0]]),Kr(e,_r(t,1),[])})),Ls=ht||function(){return pt.Date.now()};function Rs(e,t,n){return t=n?a:t,t=e&&null==t?e.length:t,Zi(e,h,a,a,a,a,t)}function xs(e,t){var n;if("function"!=typeof t)throw new xe(s);return e=go(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=a),n}}var Is=Qr((function(e,t,n){var r=1;if(n.length){var i=dn(n,la(Is));r|=c}return Zi(e,r,t,n,i)})),Os=Qr((function(e,t,n){var r=3;if(n.length){var i=dn(n,la(Os));r|=c}return Zi(t,r,e,n,i)}));function Ds(e,t,n){var r,i,o,u,l,c,d=0,h=!1,f=!1,p=!0;if("function"!=typeof e)throw new xe(s);function v(t){var n=r,s=i;return r=i=a,d=t,u=e.apply(s,n)}function m(e){return d=e,l=Da(y,t),h?v(e):u}function g(e){var n=e-c;return c===a||n>=t||n<0||f&&e-d>=o}function y(){var e=Ls();if(g(e))return _(e);l=Da(y,function(e){var n=t-(e-c);return f?Tn(n,o-(e-d)):n}(e))}function _(e){return l=a,p&&r?v(e):(r=i=a,u)}function b(){var e=Ls(),n=g(e);if(r=arguments,i=this,c=e,n){if(l===a)return m(c);if(f)return ki(l),l=Da(y,t),v(c)}return l===a&&(l=Da(y,t)),u}return t=_o(t)||0,no(n)&&(h=!!n.leading,o=(f="maxWait"in n)?bn(_o(n.maxWait)||0,t):o,p="trailing"in n?!!n.trailing:p),b.cancel=function(){l!==a&&ki(l),d=0,r=c=i=l=a},b.flush=function(){return l===a?u:_(Ls())},b}var Ps=Qr((function(e,t){return hr(e,1,t)})),Ms=Qr((function(e,t,n){return hr(e,_o(t)||0,n)}));function js(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new xe(s);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var s=e.apply(this,r);return n.cache=a.set(i,s)||a,s};return n.cache=new(js.Cache||Yn),n}function Us(e){if("function"!=typeof e)throw new xe(s);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}js.Cache=Yn;var Bs=Si((function(e,t){var n=(t=1==t.length&&Ks(t[0])?Pt(t[0],Qt(ca())):Pt(_r(t,1),Qt(ca()))).length;return Qr((function(r){for(var i=-1,a=Tn(r.length,n);++i<a;)r[i]=t[i].call(this,r[i]);return Ct(e,this,r)}))})),Fs=Qr((function(e,t){var n=dn(t,la(Fs));return Zi(e,c,a,t,n)})),Ns=Qr((function(e,t){var n=dn(t,la(Ns));return Zi(e,d,a,t,n)})),Gs=ia((function(e,t){return Zi(e,f,a,a,a,t)}));function Vs(e,t){return e===t||e!=e&&t!=t}var Hs=$i(Lr),zs=$i((function(e,t){return e>=t})),Ws=Dr(function(){return arguments}())?Dr:function(e){return ro(e)&&je.call(e,"callee")&&!Ye.call(e,"callee")},Ks=r.isArray,qs=bt?Qt(bt):function(e){return ro(e)&&Ar(e)==M};function $s(e){return null!=e&&to(e.length)&&!Zs(e)}function Ys(e){return ro(e)&&$s(e)}var Xs=_t||_u,Js=Tt?Qt(Tt):function(e){return ro(e)&&Ar(e)==S};function Qs(e){if(!ro(e))return!1;var t=Ar(e);return t==E||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!so(e)}function Zs(e){if(!no(e))return!1;var t=Ar(e);return t==k||t==w||"[object AsyncFunction]"==t||"[object Proxy]"==t}function eo(e){return"number"==typeof e&&e==go(e)}function to(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=v}function no(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ro(e){return null!=e&&"object"==typeof e}var io=St?Qt(St):function(e){return ro(e)&&ma(e)==C};function ao(e){return"number"==typeof e||ro(e)&&Ar(e)==A}function so(e){if(!ro(e)||Ar(e)!=L)return!1;var t=qe(e);if(null===t)return!0;var n=je.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Me.call(n)==Ne}var oo=Et?Qt(Et):function(e){return ro(e)&&Ar(e)==x};var uo=kt?Qt(kt):function(e){return ro(e)&&ma(e)==I};function lo(e){return"string"==typeof e||!Ks(e)&&ro(e)&&Ar(e)==O}function co(e){return"symbol"==typeof e||ro(e)&&Ar(e)==D}var ho=wt?Qt(wt):function(e){return ro(e)&&to(e.length)&&!!ot[Ar(e)]};var fo=$i(Nr),po=$i((function(e,t){return e<=t}));function vo(e){if(!e)return[];if($s(e))return lo(e)?vn(e):Ii(e);if(Qe&&e[Qe])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Qe]());var t=ma(e);return(t==C?ln:t==I?hn:Ho)(e)}function mo(e){return e?(e=_o(e))===p||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function go(e){var t=mo(e),n=t%1;return t==t?n?t-n:t:0}function yo(e){return e?lr(go(e),0,g):0}function _o(e){if("number"==typeof e)return e;if(co(e))return m;if(no(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=no(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Jt(e);var n=ye.test(e);return n||be.test(e)?dt(e.slice(2),n?2:8):ge.test(e)?m:+e}function bo(e){return Oi(e,Mo(e))}function To(e){return null==e?"":di(e)}var So=Pi((function(e,t){if(wa(t)||$s(t))Oi(t,Po(t),e);else for(var n in t)je.call(t,n)&&rr(e,n,t[n])})),Eo=Pi((function(e,t){Oi(t,Mo(t),e)})),ko=Pi((function(e,t,n,r){Oi(t,Mo(t),e,r)})),wo=Pi((function(e,t,n,r){Oi(t,Po(t),e,r)})),Co=ia(ur);var Ao=Qr((function(e,t){e=Ae(e);var n=-1,r=t.length,i=r>2?t[2]:a;for(i&&Ta(t[0],t[1],i)&&(r=1);++n<r;)for(var s=t[n],o=Mo(s),u=-1,l=o.length;++u<l;){var c=o[u],d=e[c];(d===a||Vs(d,De[c])&&!je.call(e,c))&&(e[c]=s[c])}return e})),Lo=Qr((function(e){return e.push(a,ta),Ct(Uo,a,e)}));function Ro(e,t,n){var r=null==e?a:wr(e,t);return r===a?n:r}function xo(e,t){return null!=e&&ga(e,t,xr)}var Io=Hi((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Fe.call(t)),e[t]=n}),ru(su)),Oo=Hi((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Fe.call(t)),je.call(e,t)?e[t].push(n):e[t]=[n]}),ca),Do=Qr(Or);function Po(e){return $s(e)?Qn(e):Br(e)}function Mo(e){return $s(e)?Qn(e,!0):Fr(e)}var jo=Pi((function(e,t,n){zr(e,t,n)})),Uo=Pi((function(e,t,n,r){zr(e,t,n,r)})),Bo=ia((function(e,t){var n={};if(null==e)return n;var r=!1;t=Pt(t,(function(t){return t=Ti(t,e),r||(r=t.length>1),t})),Oi(e,sa(e),n),r&&(n=cr(n,7,na));for(var i=t.length;i--;)fi(n,t[i]);return n}));var Fo=ia((function(e,t){return null==e?{}:function(e,t){return qr(e,t,(function(t,n){return xo(e,n)}))}(e,t)}));function No(e,t){if(null==e)return{};var n=Pt(sa(e),(function(e){return[e]}));return t=ca(t),qr(e,n,(function(e,n){return t(e,n[0])}))}var Go=Qi(Po),Vo=Qi(Mo);function Ho(e){return null==e?[]:Zt(e,Po(e))}var zo=Bi((function(e,t,n){return t=t.toLowerCase(),e+(n?Wo(t):t)}));function Wo(e){return Zo(To(e).toLowerCase())}function Ko(e){return(e=To(e))&&e.replace(Se,an).replace(et,"")}var qo=Bi((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),$o=Bi((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Yo=Ui("toLowerCase");var Xo=Bi((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var Jo=Bi((function(e,t,n){return e+(n?" ":"")+Zo(t)}));var Qo=Bi((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Zo=Ui("toUpperCase");function eu(e,t,n){return e=To(e),(t=n?a:t)===a?function(e){return it.test(e)}(e)?function(e){return e.match(nt)||[]}(e):function(e){return e.match(he)||[]}(e):e.match(t)||[]}var tu=Qr((function(e,t){try{return Ct(e,a,t)}catch(e){return Qs(e)?e:new ue(e)}})),nu=ia((function(e,t){return Lt(t,(function(t){t=Fa(t),or(e,t,Is(e[t],e))})),e}));function ru(e){return function(){return e}}var iu=Gi(),au=Gi(!0);function su(e){return e}function ou(e){return Ur("function"==typeof e?e:cr(e,1))}var uu=Qr((function(e,t){return function(n){return Or(n,e,t)}})),lu=Qr((function(e,t){return function(n){return Or(e,n,t)}}));function cu(e,t,n){var r=Po(t),i=kr(t,r);null!=n||no(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=kr(t,Po(t)));var a=!(no(n)&&"chain"in n&&!n.chain),s=Zs(e);return Lt(i,(function(n){var r=t[n];e[n]=r,s&&(e.prototype[n]=function(){var t=this.__chain__;if(a||t){var n=e(this.__wrapped__),i=n.__actions__=Ii(this.__actions__);return i.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Mt([this.value()],arguments))})})),e}function du(){}var hu=Wi(Pt),fu=Wi(xt),pu=Wi(Bt);function vu(e){return Sa(e)?Kt(Fa(e)):function(e){return function(t){return wr(t,e)}}(e)}var mu=qi(),gu=qi(!0);function yu(){return[]}function _u(){return!1}var bu=zi((function(e,t){return e+t}),0),Tu=Xi("ceil"),Su=zi((function(e,t){return e/t}),1),Eu=Xi("floor");var ku,wu=zi((function(e,t){return e*t}),1),Cu=Xi("round"),Au=zi((function(e,t){return e-t}),0);return Vn.after=function(e,t){if("function"!=typeof t)throw new xe(s);return e=go(e),function(){if(--e<1)return t.apply(this,arguments)}},Vn.ary=Rs,Vn.assign=So,Vn.assignIn=Eo,Vn.assignInWith=ko,Vn.assignWith=wo,Vn.at=Co,Vn.before=xs,Vn.bind=Is,Vn.bindAll=nu,Vn.bindKey=Os,Vn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ks(e)?e:[e]},Vn.chain=ps,Vn.chunk=function(e,t,n){t=(n?Ta(e,t,n):t===a)?1:bn(go(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var s=0,o=0,u=r(vt(i/t));s<i;)u[o++]=ai(e,s,s+=t);return u},Vn.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var a=e[t];a&&(i[r++]=a)}return i},Vn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=r(e-1),n=arguments[0],i=e;i--;)t[i-1]=arguments[i];return Mt(Ks(n)?Ii(n):[n],_r(t,1))},Vn.cond=function(e){var t=null==e?0:e.length,n=ca();return e=t?Pt(e,(function(e){if("function"!=typeof e[1])throw new xe(s);return[n(e[0]),e[1]]})):[],Qr((function(n){for(var r=-1;++r<t;){var i=e[r];if(Ct(i[0],this,n))return Ct(i[1],this,n)}}))},Vn.conforms=function(e){return function(e){var t=Po(e);return function(n){return dr(n,e,t)}}(cr(e,1))},Vn.constant=ru,Vn.countBy=gs,Vn.create=function(e,t){var n=Hn(e);return null==t?n:sr(n,t)},Vn.curry=function e(t,n,r){var i=Zi(t,8,a,a,a,a,a,n=r?a:n);return i.placeholder=e.placeholder,i},Vn.curryRight=function e(t,n,r){var i=Zi(t,l,a,a,a,a,a,n=r?a:n);return i.placeholder=e.placeholder,i},Vn.debounce=Ds,Vn.defaults=Ao,Vn.defaultsDeep=Lo,Vn.defer=Ps,Vn.delay=Ms,Vn.difference=Va,Vn.differenceBy=Ha,Vn.differenceWith=za,Vn.drop=function(e,t,n){var r=null==e?0:e.length;return r?ai(e,(t=n||t===a?1:go(t))<0?0:t,r):[]},Vn.dropRight=function(e,t,n){var r=null==e?0:e.length;return r?ai(e,0,(t=r-(t=n||t===a?1:go(t)))<0?0:t):[]},Vn.dropRightWhile=function(e,t){return e&&e.length?vi(e,ca(t,3),!0,!0):[]},Vn.dropWhile=function(e,t){return e&&e.length?vi(e,ca(t,3),!0):[]},Vn.fill=function(e,t,n,r){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&Ta(e,t,n)&&(n=0,r=i),function(e,t,n,r){var i=e.length;for((n=go(n))<0&&(n=-n>i?0:i+n),(r=r===a||r>i?i:go(r))<0&&(r+=i),r=n>r?0:yo(r);n<r;)e[n++]=t;return e}(e,t,n,r)):[]},Vn.filter=function(e,t){return(Ks(e)?It:yr)(e,ca(t,3))},Vn.flatMap=function(e,t){return _r(ws(e,t),1)},Vn.flatMapDeep=function(e,t){return _r(ws(e,t),p)},Vn.flatMapDepth=function(e,t,n){return n=n===a?1:go(n),_r(ws(e,t),n)},Vn.flatten=qa,Vn.flattenDeep=function(e){return(null==e?0:e.length)?_r(e,p):[]},Vn.flattenDepth=function(e,t){return(null==e?0:e.length)?_r(e,t=t===a?1:go(t)):[]},Vn.flip=function(e){return Zi(e,512)},Vn.flow=iu,Vn.flowRight=au,Vn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r},Vn.functions=function(e){return null==e?[]:kr(e,Po(e))},Vn.functionsIn=function(e){return null==e?[]:kr(e,Mo(e))},Vn.groupBy=Ss,Vn.initial=function(e){return(null==e?0:e.length)?ai(e,0,-1):[]},Vn.intersection=Ya,Vn.intersectionBy=Xa,Vn.intersectionWith=Ja,Vn.invert=Io,Vn.invertBy=Oo,Vn.invokeMap=Es,Vn.iteratee=ou,Vn.keyBy=ks,Vn.keys=Po,Vn.keysIn=Mo,Vn.map=ws,Vn.mapKeys=function(e,t){var n={};return t=ca(t,3),Sr(e,(function(e,r,i){or(n,t(e,r,i),e)})),n},Vn.mapValues=function(e,t){var n={};return t=ca(t,3),Sr(e,(function(e,r,i){or(n,r,t(e,r,i))})),n},Vn.matches=function(e){return Vr(cr(e,1))},Vn.matchesProperty=function(e,t){return Hr(e,cr(t,1))},Vn.memoize=js,Vn.merge=jo,Vn.mergeWith=Uo,Vn.method=uu,Vn.methodOf=lu,Vn.mixin=cu,Vn.negate=Us,Vn.nthArg=function(e){return e=go(e),Qr((function(t){return Wr(t,e)}))},Vn.omit=Bo,Vn.omitBy=function(e,t){return No(e,Us(ca(t)))},Vn.once=function(e){return xs(2,e)},Vn.orderBy=function(e,t,n,r){return null==e?[]:(Ks(t)||(t=null==t?[]:[t]),Ks(n=r?a:n)||(n=null==n?[]:[n]),Kr(e,t,n))},Vn.over=hu,Vn.overArgs=Bs,Vn.overEvery=fu,Vn.overSome=pu,Vn.partial=Fs,Vn.partialRight=Ns,Vn.partition=Cs,Vn.pick=Fo,Vn.pickBy=No,Vn.property=vu,Vn.propertyOf=function(e){return function(t){return null==e?a:wr(e,t)}},Vn.pull=Za,Vn.pullAll=es,Vn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?$r(e,t,ca(n,2)):e},Vn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?$r(e,t,a,n):e},Vn.pullAt=ts,Vn.range=mu,Vn.rangeRight=gu,Vn.rearg=Gs,Vn.reject=function(e,t){return(Ks(e)?It:yr)(e,Us(ca(t,3)))},Vn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,i=[],a=e.length;for(t=ca(t,3);++r<a;){var s=e[r];t(s,r,e)&&(n.push(s),i.push(r))}return Yr(e,i),n},Vn.rest=function(e,t){if("function"!=typeof e)throw new xe(s);return Qr(e,t=t===a?t:go(t))},Vn.reverse=ns,Vn.sampleSize=function(e,t,n){return t=(n?Ta(e,t,n):t===a)?1:go(t),(Ks(e)?er:ei)(e,t)},Vn.set=function(e,t,n){return null==e?e:ti(e,t,n)},Vn.setWith=function(e,t,n,r){return r="function"==typeof r?r:a,null==e?e:ti(e,t,n,r)},Vn.shuffle=function(e){return(Ks(e)?tr:ii)(e)},Vn.slice=function(e,t,n){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&Ta(e,t,n)?(t=0,n=r):(t=null==t?0:go(t),n=n===a?r:go(n)),ai(e,t,n)):[]},Vn.sortBy=As,Vn.sortedUniq=function(e){return e&&e.length?li(e):[]},Vn.sortedUniqBy=function(e,t){return e&&e.length?li(e,ca(t,2)):[]},Vn.split=function(e,t,n){return n&&"number"!=typeof n&&Ta(e,t,n)&&(t=n=a),(n=n===a?g:n>>>0)?(e=To(e))&&("string"==typeof t||null!=t&&!oo(t))&&!(t=di(t))&&un(e)?Ei(vn(e),0,n):e.split(t,n):[]},Vn.spread=function(e,t){if("function"!=typeof e)throw new xe(s);return t=null==t?0:bn(go(t),0),Qr((function(n){var r=n[t],i=Ei(n,0,t);return r&&Mt(i,r),Ct(e,this,i)}))},Vn.tail=function(e){var t=null==e?0:e.length;return t?ai(e,1,t):[]},Vn.take=function(e,t,n){return e&&e.length?ai(e,0,(t=n||t===a?1:go(t))<0?0:t):[]},Vn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?ai(e,(t=r-(t=n||t===a?1:go(t)))<0?0:t,r):[]},Vn.takeRightWhile=function(e,t){return e&&e.length?vi(e,ca(t,3),!1,!0):[]},Vn.takeWhile=function(e,t){return e&&e.length?vi(e,ca(t,3)):[]},Vn.tap=function(e,t){return t(e),e},Vn.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new xe(s);return no(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Ds(e,t,{leading:r,maxWait:t,trailing:i})},Vn.thru=vs,Vn.toArray=vo,Vn.toPairs=Go,Vn.toPairsIn=Vo,Vn.toPath=function(e){return Ks(e)?Pt(e,Fa):co(e)?[e]:Ii(Ba(To(e)))},Vn.toPlainObject=bo,Vn.transform=function(e,t,n){var r=Ks(e),i=r||Xs(e)||ho(e);if(t=ca(t,4),null==n){var a=e&&e.constructor;n=i?r?new a:[]:no(e)&&Zs(a)?Hn(qe(e)):{}}return(i?Lt:Sr)(e,(function(e,r,i){return t(n,e,r,i)})),n},Vn.unary=function(e){return Rs(e,1)},Vn.union=rs,Vn.unionBy=is,Vn.unionWith=as,Vn.uniq=function(e){return e&&e.length?hi(e):[]},Vn.uniqBy=function(e,t){return e&&e.length?hi(e,ca(t,2)):[]},Vn.uniqWith=function(e,t){return t="function"==typeof t?t:a,e&&e.length?hi(e,a,t):[]},Vn.unset=function(e,t){return null==e||fi(e,t)},Vn.unzip=ss,Vn.unzipWith=os,Vn.update=function(e,t,n){return null==e?e:pi(e,t,bi(n))},Vn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:a,null==e?e:pi(e,t,bi(n),r)},Vn.values=Ho,Vn.valuesIn=function(e){return null==e?[]:Zt(e,Mo(e))},Vn.without=us,Vn.words=eu,Vn.wrap=function(e,t){return Fs(bi(t),e)},Vn.xor=ls,Vn.xorBy=cs,Vn.xorWith=ds,Vn.zip=hs,Vn.zipObject=function(e,t){return yi(e||[],t||[],rr)},Vn.zipObjectDeep=function(e,t){return yi(e||[],t||[],ti)},Vn.zipWith=fs,Vn.entries=Go,Vn.entriesIn=Vo,Vn.extend=Eo,Vn.extendWith=ko,cu(Vn,Vn),Vn.add=bu,Vn.attempt=tu,Vn.camelCase=zo,Vn.capitalize=Wo,Vn.ceil=Tu,Vn.clamp=function(e,t,n){return n===a&&(n=t,t=a),n!==a&&(n=(n=_o(n))==n?n:0),t!==a&&(t=(t=_o(t))==t?t:0),lr(_o(e),t,n)},Vn.clone=function(e){return cr(e,4)},Vn.cloneDeep=function(e){return cr(e,5)},Vn.cloneDeepWith=function(e,t){return cr(e,5,t="function"==typeof t?t:a)},Vn.cloneWith=function(e,t){return cr(e,4,t="function"==typeof t?t:a)},Vn.conformsTo=function(e,t){return null==t||dr(e,t,Po(t))},Vn.deburr=Ko,Vn.defaultTo=function(e,t){return null==e||e!=e?t:e},Vn.divide=Su,Vn.endsWith=function(e,t,n){e=To(e),t=di(t);var r=e.length,i=n=n===a?r:lr(go(n),0,r);return(n-=t.length)>=0&&e.slice(n,i)==t},Vn.eq=Vs,Vn.escape=function(e){return(e=To(e))&&Q.test(e)?e.replace(X,sn):e},Vn.escapeRegExp=function(e){return(e=To(e))&&se.test(e)?e.replace(ae,"\\$&"):e},Vn.every=function(e,t,n){var r=Ks(e)?xt:mr;return n&&Ta(e,t,n)&&(t=a),r(e,ca(t,3))},Vn.find=ys,Vn.findIndex=Wa,Vn.findKey=function(e,t){return Nt(e,ca(t,3),Sr)},Vn.findLast=_s,Vn.findLastIndex=Ka,Vn.findLastKey=function(e,t){return Nt(e,ca(t,3),Er)},Vn.floor=Eu,Vn.forEach=bs,Vn.forEachRight=Ts,Vn.forIn=function(e,t){return null==e?e:br(e,ca(t,3),Mo)},Vn.forInRight=function(e,t){return null==e?e:Tr(e,ca(t,3),Mo)},Vn.forOwn=function(e,t){return e&&Sr(e,ca(t,3))},Vn.forOwnRight=function(e,t){return e&&Er(e,ca(t,3))},Vn.get=Ro,Vn.gt=Hs,Vn.gte=zs,Vn.has=function(e,t){return null!=e&&ga(e,t,Rr)},Vn.hasIn=xo,Vn.head=$a,Vn.identity=su,Vn.includes=function(e,t,n,r){e=$s(e)?e:Ho(e),n=n&&!r?go(n):0;var i=e.length;return n<0&&(n=bn(i+n,0)),lo(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Vt(e,t,n)>-1},Vn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:go(n);return i<0&&(i=bn(r+i,0)),Vt(e,t,i)},Vn.inRange=function(e,t,n){return t=mo(t),n===a?(n=t,t=0):n=mo(n),function(e,t,n){return e>=Tn(t,n)&&e<bn(t,n)}(e=_o(e),t,n)},Vn.invoke=Do,Vn.isArguments=Ws,Vn.isArray=Ks,Vn.isArrayBuffer=qs,Vn.isArrayLike=$s,Vn.isArrayLikeObject=Ys,Vn.isBoolean=function(e){return!0===e||!1===e||ro(e)&&Ar(e)==T},Vn.isBuffer=Xs,Vn.isDate=Js,Vn.isElement=function(e){return ro(e)&&1===e.nodeType&&!so(e)},Vn.isEmpty=function(e){if(null==e)return!0;if($s(e)&&(Ks(e)||"string"==typeof e||"function"==typeof e.splice||Xs(e)||ho(e)||Ws(e)))return!e.length;var t=ma(e);if(t==C||t==I)return!e.size;if(wa(e))return!Br(e).length;for(var n in e)if(je.call(e,n))return!1;return!0},Vn.isEqual=function(e,t){return Pr(e,t)},Vn.isEqualWith=function(e,t,n){var r=(n="function"==typeof n?n:a)?n(e,t):a;return r===a?Pr(e,t,a,n):!!r},Vn.isError=Qs,Vn.isFinite=function(e){return"number"==typeof e&&Ft(e)},Vn.isFunction=Zs,Vn.isInteger=eo,Vn.isLength=to,Vn.isMap=io,Vn.isMatch=function(e,t){return e===t||Mr(e,t,ha(t))},Vn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:a,Mr(e,t,ha(t),n)},Vn.isNaN=function(e){return ao(e)&&e!=+e},Vn.isNative=function(e){if(ka(e))throw new ue("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return jr(e)},Vn.isNil=function(e){return null==e},Vn.isNull=function(e){return null===e},Vn.isNumber=ao,Vn.isObject=no,Vn.isObjectLike=ro,Vn.isPlainObject=so,Vn.isRegExp=oo,Vn.isSafeInteger=function(e){return eo(e)&&e>=-9007199254740991&&e<=v},Vn.isSet=uo,Vn.isString=lo,Vn.isSymbol=co,Vn.isTypedArray=ho,Vn.isUndefined=function(e){return e===a},Vn.isWeakMap=function(e){return ro(e)&&ma(e)==P},Vn.isWeakSet=function(e){return ro(e)&&"[object WeakSet]"==Ar(e)},Vn.join=function(e,t){return null==e?"":qt.call(e,t)},Vn.kebabCase=qo,Vn.last=Qa,Vn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r;return n!==a&&(i=(i=go(n))<0?bn(r+i,0):Tn(i,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,i):Gt(e,zt,i,!0)},Vn.lowerCase=$o,Vn.lowerFirst=Yo,Vn.lt=fo,Vn.lte=po,Vn.max=function(e){return e&&e.length?gr(e,su,Lr):a},Vn.maxBy=function(e,t){return e&&e.length?gr(e,ca(t,2),Lr):a},Vn.mean=function(e){return Wt(e,su)},Vn.meanBy=function(e,t){return Wt(e,ca(t,2))},Vn.min=function(e){return e&&e.length?gr(e,su,Nr):a},Vn.minBy=function(e,t){return e&&e.length?gr(e,ca(t,2),Nr):a},Vn.stubArray=yu,Vn.stubFalse=_u,Vn.stubObject=function(){return{}},Vn.stubString=function(){return""},Vn.stubTrue=function(){return!0},Vn.multiply=wu,Vn.nth=function(e,t){return e&&e.length?Wr(e,go(t)):a},Vn.noConflict=function(){return pt._===this&&(pt._=Ge),this},Vn.noop=du,Vn.now=Ls,Vn.pad=function(e,t,n){e=To(e);var r=(t=go(t))?pn(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Ki(mt(i),n)+e+Ki(vt(i),n)},Vn.padEnd=function(e,t,n){e=To(e);var r=(t=go(t))?pn(e):0;return t&&r<t?e+Ki(t-r,n):e},Vn.padStart=function(e,t,n){e=To(e);var r=(t=go(t))?pn(e):0;return t&&r<t?Ki(t-r,n)+e:e},Vn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),En(To(e).replace(oe,""),t||0)},Vn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&Ta(e,t,n)&&(t=n=a),n===a&&("boolean"==typeof t?(n=t,t=a):"boolean"==typeof e&&(n=e,e=a)),e===a&&t===a?(e=0,t=1):(e=mo(e),t===a?(t=e,e=0):t=mo(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var i=kn();return Tn(e+i*(t-e+ct("1e-"+((i+"").length-1))),t)}return Xr(e,t)},Vn.reduce=function(e,t,n){var r=Ks(e)?jt:$t,i=arguments.length<3;return r(e,ca(t,4),n,i,pr)},Vn.reduceRight=function(e,t,n){var r=Ks(e)?Ut:$t,i=arguments.length<3;return r(e,ca(t,4),n,i,vr)},Vn.repeat=function(e,t,n){return t=(n?Ta(e,t,n):t===a)?1:go(t),Jr(To(e),t)},Vn.replace=function(){var e=arguments,t=To(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Vn.result=function(e,t,n){var r=-1,i=(t=Ti(t,e)).length;for(i||(i=1,e=a);++r<i;){var s=null==e?a:e[Fa(t[r])];s===a&&(r=i,s=n),e=Zs(s)?s.call(e):s}return e},Vn.round=Cu,Vn.runInContext=e,Vn.sample=function(e){return(Ks(e)?Zn:Zr)(e)},Vn.size=function(e){if(null==e)return 0;if($s(e))return lo(e)?pn(e):e.length;var t=ma(e);return t==C||t==I?e.size:Br(e).length},Vn.snakeCase=Xo,Vn.some=function(e,t,n){var r=Ks(e)?Bt:si;return n&&Ta(e,t,n)&&(t=a),r(e,ca(t,3))},Vn.sortedIndex=function(e,t){return oi(e,t)},Vn.sortedIndexBy=function(e,t,n){return ui(e,t,ca(n,2))},Vn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=oi(e,t);if(r<n&&Vs(e[r],t))return r}return-1},Vn.sortedLastIndex=function(e,t){return oi(e,t,!0)},Vn.sortedLastIndexBy=function(e,t,n){return ui(e,t,ca(n,2),!0)},Vn.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var n=oi(e,t,!0)-1;if(Vs(e[n],t))return n}return-1},Vn.startCase=Jo,Vn.startsWith=function(e,t,n){return e=To(e),n=null==n?0:lr(go(n),0,e.length),t=di(t),e.slice(n,n+t.length)==t},Vn.subtract=Au,Vn.sum=function(e){return e&&e.length?Yt(e,su):0},Vn.sumBy=function(e,t){return e&&e.length?Yt(e,ca(t,2)):0},Vn.template=function(e,t,n){var r=Vn.templateSettings;n&&Ta(e,t,n)&&(t=a),e=To(e),t=ko({},t,r,ea);var i,s,o=ko({},t.imports,r.imports,ea),u=Po(o),l=Zt(o,u),c=0,d=t.interpolate||Ee,h="__p += '",f=Le((t.escape||Ee).source+"|"+d.source+"|"+(d===te?ve:Ee).source+"|"+(t.evaluate||Ee).source+"|$","g"),p="//# sourceURL="+(je.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++st+"]")+"\n";e.replace(f,(function(t,n,r,a,o,u){return r||(r=a),h+=e.slice(c,u).replace(ke,on),n&&(i=!0,h+="' +\n__e("+n+") +\n'"),o&&(s=!0,h+="';\n"+o+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),c=u+t.length,t})),h+="';\n";var v=je.call(t,"variable")&&t.variable;if(v){if(fe.test(v))throw new ue("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(s?h.replace(K,""):h).replace(q,"$1").replace($,"$1;"),h="function("+(v||"obj")+") {\n"+(v?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var m=tu((function(){return we(u,p+"return "+h).apply(a,l)}));if(m.source=h,Qs(m))throw m;return m},Vn.times=function(e,t){if((e=go(e))<1||e>v)return[];var n=g,r=Tn(e,g);t=ca(t),e-=g;for(var i=Xt(r,t);++n<e;)t(n);return i},Vn.toFinite=mo,Vn.toInteger=go,Vn.toLength=yo,Vn.toLower=function(e){return To(e).toLowerCase()},Vn.toNumber=_o,Vn.toSafeInteger=function(e){return e?lr(go(e),-9007199254740991,v):0===e?e:0},Vn.toString=To,Vn.toUpper=function(e){return To(e).toUpperCase()},Vn.trim=function(e,t,n){if((e=To(e))&&(n||t===a))return Jt(e);if(!e||!(t=di(t)))return e;var r=vn(e),i=vn(t);return Ei(r,tn(r,i),nn(r,i)+1).join("")},Vn.trimEnd=function(e,t,n){if((e=To(e))&&(n||t===a))return e.slice(0,mn(e)+1);if(!e||!(t=di(t)))return e;var r=vn(e);return Ei(r,0,nn(r,vn(t))+1).join("")},Vn.trimStart=function(e,t,n){if((e=To(e))&&(n||t===a))return e.replace(oe,"");if(!e||!(t=di(t)))return e;var r=vn(e);return Ei(r,tn(r,vn(t))).join("")},Vn.truncate=function(e,t){var n=30,r="...";if(no(t)){var i="separator"in t?t.separator:i;n="length"in t?go(t.length):n,r="omission"in t?di(t.omission):r}var s=(e=To(e)).length;if(un(e)){var o=vn(e);s=o.length}if(n>=s)return e;var u=n-pn(r);if(u<1)return r;var l=o?Ei(o,0,u).join(""):e.slice(0,u);if(i===a)return l+r;if(o&&(u+=l.length-u),oo(i)){if(e.slice(u).search(i)){var c,d=l;for(i.global||(i=Le(i.source,To(me.exec(i))+"g")),i.lastIndex=0;c=i.exec(d);)var h=c.index;l=l.slice(0,h===a?u:h)}}else if(e.indexOf(di(i),u)!=u){var f=l.lastIndexOf(i);f>-1&&(l=l.slice(0,f))}return l+r},Vn.unescape=function(e){return(e=To(e))&&J.test(e)?e.replace(Y,gn):e},Vn.uniqueId=function(e){var t=++Ue;return To(e)+t},Vn.upperCase=Qo,Vn.upperFirst=Zo,Vn.each=bs,Vn.eachRight=Ts,Vn.first=$a,cu(Vn,(ku={},Sr(Vn,(function(e,t){je.call(Vn.prototype,t)||(ku[t]=e)})),ku),{chain:!1}),Vn.VERSION="4.17.21",Lt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Vn[e].placeholder=Vn})),Lt(["drop","take"],(function(e,t){Kn.prototype[e]=function(n){n=n===a?1:bn(go(n),0);var r=this.__filtered__&&!t?new Kn(this):this.clone();return r.__filtered__?r.__takeCount__=Tn(n,r.__takeCount__):r.__views__.push({size:Tn(n,g),type:e+(r.__dir__<0?"Right":"")}),r},Kn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Lt(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Kn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:ca(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),Lt(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Kn.prototype[e]=function(){return this[n](1).value()[0]}})),Lt(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Kn.prototype[e]=function(){return this.__filtered__?new Kn(this):this[n](1)}})),Kn.prototype.compact=function(){return this.filter(su)},Kn.prototype.find=function(e){return this.filter(e).head()},Kn.prototype.findLast=function(e){return this.reverse().find(e)},Kn.prototype.invokeMap=Qr((function(e,t){return"function"==typeof e?new Kn(this):this.map((function(n){return Or(n,e,t)}))})),Kn.prototype.reject=function(e){return this.filter(Us(ca(e)))},Kn.prototype.slice=function(e,t){e=go(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Kn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==a&&(n=(t=go(t))<0?n.dropRight(-t):n.take(t-e)),n)},Kn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Kn.prototype.toArray=function(){return this.take(g)},Sr(Kn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),i=Vn[r?"take"+("last"==t?"Right":""):t],s=r||/^find/.test(t);i&&(Vn.prototype[t]=function(){var t=this.__wrapped__,o=r?[1]:arguments,u=t instanceof Kn,l=o[0],c=u||Ks(t),d=function(e){var t=i.apply(Vn,Mt([e],o));return r&&h?t[0]:t};c&&n&&"function"==typeof l&&1!=l.length&&(u=c=!1);var h=this.__chain__,f=!!this.__actions__.length,p=s&&!h,v=u&&!f;if(!s&&c){t=v?t:new Kn(this);var m=e.apply(t,o);return m.__actions__.push({func:vs,args:[d],thisArg:a}),new Wn(m,h)}return p&&v?e.apply(this,o):(m=this.thru(d),p?r?m.value()[0]:m.value():m)})})),Lt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Ie[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Vn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Ks(i)?i:[],e)}return this[n]((function(n){return t.apply(Ks(n)?n:[],e)}))}})),Sr(Kn.prototype,(function(e,t){var n=Vn[t];if(n){var r=n.name+"";je.call(Dn,r)||(Dn[r]=[]),Dn[r].push({name:t,func:n})}})),Dn[Vi(a,2).name]=[{name:"wrapper",func:a}],Kn.prototype.clone=function(){var e=new Kn(this.__wrapped__);return e.__actions__=Ii(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ii(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ii(this.__views__),e},Kn.prototype.reverse=function(){if(this.__filtered__){var e=new Kn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Kn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ks(e),r=t<0,i=n?e.length:0,a=function(e,t,n){var r=-1,i=n.length;for(;++r<i;){var a=n[r],s=a.size;switch(a.type){case"drop":e+=s;break;case"dropRight":t-=s;break;case"take":t=Tn(t,e+s);break;case"takeRight":e=bn(e,t-s)}}return{start:e,end:t}}(0,i,this.__views__),s=a.start,o=a.end,u=o-s,l=r?o:s-1,c=this.__iteratees__,d=c.length,h=0,f=Tn(u,this.__takeCount__);if(!n||!r&&i==u&&f==u)return mi(e,this.__actions__);var p=[];e:for(;u--&&h<f;){for(var v=-1,m=e[l+=t];++v<d;){var g=c[v],y=g.iteratee,_=g.type,b=y(m);if(2==_)m=b;else if(!b){if(1==_)continue e;break e}}p[h++]=m}return p},Vn.prototype.at=ms,Vn.prototype.chain=function(){return ps(this)},Vn.prototype.commit=function(){return new Wn(this.value(),this.__chain__)},Vn.prototype.next=function(){this.__values__===a&&(this.__values__=vo(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?a:this.__values__[this.__index__++]}},Vn.prototype.plant=function(e){for(var t,n=this;n instanceof zn;){var r=Ga(n);r.__index__=0,r.__values__=a,t?i.__wrapped__=r:t=r;var i=r;n=n.__wrapped__}return i.__wrapped__=e,t},Vn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Kn){var t=e;return this.__actions__.length&&(t=new Kn(this)),(t=t.reverse()).__actions__.push({func:vs,args:[ns],thisArg:a}),new Wn(t,this.__chain__)}return this.thru(ns)},Vn.prototype.toJSON=Vn.prototype.valueOf=Vn.prototype.value=function(){return mi(this.__wrapped__,this.__actions__)},Vn.prototype.first=Vn.prototype.head,Qe&&(Vn.prototype[Qe]=function(){return this}),Vn}();pt._=yn,(i=function(){return yn}.call(t,n,t,r))===a||(r.exports=i)}).call(this)}).call(this,n("yLpj"),n("YuTi")(e))},MN4f:function(e,t,n){var r=n("L7KE"),i=n("XW/+"),a=n("J8Qq")(!1),s=n("lk+t")("IE_PROTO");e.exports=function(e,t){var n,o=i(e),u=0,l=[];for(n in o)n!=s&&r(o,n)&&l.push(n);for(;t.length>u;)r(o,n=t[u++])&&(~a(l,n)||l.push(n));return l}},MVdI:function(e,t,n){var r=n("jYdD"),i=n("8IOi"),a=n("138g");i(i.S,"Reflect",{getOwnPropertyDescriptor:function(e,t){return r.f(a(e),t)}})},MWg1:function(e,t,n){n("e7D+")("Map")},"N+bU":function(e,t,n){n("HLcc")("observable")},N6L2:function(e,t,n){var r=n("n+hx"),i=n("HC2Y"),a=n("3iRr")("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[a])?!!t:"RegExp"==i(e))}},N8W1:function(e,t,n){"use strict";var r=n("4Fav");n("8IOi")({target:"RegExp",proto:!0,forced:r!==/./.exec},{exec:r})},Nrdp:function(e,t,n){"use strict";var r=n("QV8t"),i=n("eYp2"),a="WeakSet";n("0WhE")(a,(function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(e){return r.def(i(this,a),e,!0)}},r,!1,!0)},NrsN:function(e,t,n){"use strict";var r=n("8IOi"),i=n("z/zB")(6),a="findIndex",s=!0;a in[]&&Array(1)[a]((function(){s=!1})),r(r.P+r.F*s,"Array",{findIndex:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),n("Zrcd")(a)},OKyS:function(e,t,n){var r=n("LboF"),i=n("8MIm");"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.i,i,""]]);var a={insert:"head",singleton:!1};r(i,a);e.exports=i.locals||{}},OVpP:function(e,t,n){var r=n("8IOi"),i=n("vejK")(),a=n("k+AJ").process,s="process"==n("HC2Y")(a);r(r.G,{asap:function(e){var t=s&&a.domain;i(t?t.bind(e):e)}})},OWqD:function(e,t,n){var r=n("8IOi");r(r.S,"Number",{isInteger:n("Jkf2")})},OfMQ:function(e,t,n){var r=n("8IOi"),i=n("XW/+"),a=n("Y3Md");r(r.S,"String",{raw:function(e){for(var t=i(e.raw),n=a(t.length),r=arguments.length,s=[],o=0;n>o;)s.push(String(t[o++])),o<r&&s.push(String(arguments[o]));return s.join("")}})},Oi8Z:function(e,t,n){"use strict";var r=n("k+AJ"),i=n("J2HX"),a=n("yU77"),s=n("3iRr")("species");e.exports=function(e){var t=r[e];a&&t&&!t[s]&&i.f(t,s,{configurable:!0,get:function(){return this}})}},OvvV:function(e,t,n){var r=n("3iRr")("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,!"/./"[e](t)}catch(e){}}return!0}},P4R2:function(e,t,n){var r=n("8IOi");r(r.P,"Array",{copyWithin:n("+UUX")}),n("Zrcd")("copyWithin")},P6sA:function(e,t,n){var r=n("8IOi");r(r.P,"String",{repeat:n("YBJj")})},PHd1:function(e,t,n){var r=n("8IOi");r(r.G,{global:n("k+AJ")})},PsYO:function(e,t,n){var r=n("8IOi");r(r.S,"Reflect",{has:function(e,t){return t in e}})},QANz:function(e,t,n){var r=n("8IOi");r(r.S,"Math",{RAD_PER_DEG:180/Math.PI})},QJgN:function(e,t,n){var r=n("8IOi"),i=n("Z/7P");r(r.S+r.F*(Number.parseInt!=i),"Number",{parseInt:i})},QV8t:function(e,t,n){"use strict";var r=n("xmgo"),i=n("TI2F").getWeak,a=n("138g"),s=n("n+hx"),o=n("kopD"),u=n("j8TA"),l=n("z/zB"),c=n("L7KE"),d=n("eYp2"),h=l(5),f=l(6),p=0,v=function(e){return e._l||(e._l=new m)},m=function(){this.a=[]},g=function(e,t){return h(e.a,(function(e){return e[0]===t}))};m.prototype={get:function(e){var t=g(this,e);if(t)return t[1]},has:function(e){return!!g(this,e)},set:function(e,t){var n=g(this,e);n?n[1]=t:this.a.push([e,t])},delete:function(e){var t=f(this.a,(function(t){return t[0]===e}));return~t&&this.a.splice(t,1),!!~t}},e.exports={getConstructor:function(e,t,n,a){var l=e((function(e,r){o(e,l,t,"_i"),e._t=t,e._i=p++,e._l=void 0,null!=r&&u(r,n,e[a],e)}));return r(l.prototype,{delete:function(e){if(!s(e))return!1;var n=i(e);return!0===n?v(d(this,t)).delete(e):n&&c(n,this._i)&&delete n[this._i]},has:function(e){if(!s(e))return!1;var n=i(e);return!0===n?v(d(this,t)).has(e):n&&c(n,this._i)}}),l},def:function(e,t,n){var r=i(a(t),!0);return!0===r?v(e).set(t,n):r[e._i]=n,e},ufstore:v}},QYzQ:function(e,t,n){"use strict";n("6dhg")("trimLeft",(function(e){return function(){return e(this,1)}}),"trimStart")},QoI2:function(e,t,n){"use strict";var r=n("8IOi"),i=n("Qu5u"),a=n("AZ8a"),s=n("7WAm"),o=n("jYdD").f;n("yU77")&&r(r.P+n("rGBx"),"Object",{__lookupGetter__:function(e){var t,n=i(this),r=a(e,!0);do{if(t=o(n,r))return t.get}while(n=s(n))}})},QotP:function(e,t,n){"use strict";var r=n("fyHr"),i=n("n+hx"),a=n("Y3Md"),s=n("kRpC"),o=n("3iRr")("isConcatSpreadable");e.exports=function e(t,n,u,l,c,d,h,f){for(var p,v,m=c,g=0,y=!!h&&s(h,f,3);g<l;){if(g in u){if(p=y?y(u[g],g,n):u[g],v=!1,i(p)&&(v=void 0!==(v=p[o])?!!v:r(p)),v&&d>0)m=e(t,n,p,a(p.length),m,d-1)-1;else{if(m>=9007199254740991)throw TypeError();t[m]=p}m++}g++}return m}},QraV:function(e,t,n){n("CmYC")("getOwnPropertyNames",(function(){return n("Uyw2").f}))},Qu5u:function(e,t,n){var r=n("aI2V");e.exports=function(e){return Object(r(e))}},R1kZ:function(e,t,n){var r=n("n+hx"),i=n("138g"),a=function(e,t){if(i(e),!r(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,r){try{(r=n("kRpC")(Function.call,n("jYdD").f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return a(e,n),t?e.__proto__=n:r(e,n),e}}({},!1):void 0),check:a}},ROgi:function(e,t,n){var r=n("138g"),i=n("n+hx"),a=n("5/+w");e.exports=function(e,t){if(r(e),i(t)&&t.constructor===e)return t;var n=a.f(e);return(0,n.resolve)(t),n.promise}},RT9V:function(e,t,n){var r=n("N6L2"),i=n("aI2V");e.exports=function(e,t,n){if(r(t))throw TypeError("String#"+n+" doesn't accept regex!");return String(i(e))}},RZL5:function(e,t){var n=Math.expm1;e.exports=!n||n(10)>22025.465794806718||n(10)<22025.465794806718||-2e-17!=n(-2e-17)?function(e){return 0==(e=+e)?e:e>-1e-6&&e<1e-6?e+e*e/2:Math.exp(e)-1}:n},"Rby+":function(e,t,n){var r=n("3iRr")("toPrimitive"),i=Date.prototype;r in i||n("BxPU")(i,r,n("VwWS"))},Stof:function(e,t,n){var r=n("8IOi");r(r.S,"Math",{log2:function(e){return Math.log(e)/Math.LN2}})},Svsh:function(e,t,n){var r=n("8IOi");r(r.S+r.F*!n("yU77"),"Object",{defineProperties:n("d/Tf")})},SxLI:function(e,t,n){var r=n("8IOi");r(r.S,"Math",{umulh:function(e,t){var n=65535,r=+e,i=+t,a=r&n,s=i&n,o=r>>>16,u=i>>>16,l=(o*s>>>0)+(a*s>>>16);return o*u+(l>>>16)+((a*u>>>0)+(l&n)>>>16)}})},SzBd:function(e,t,n){var r=Date.prototype,i="Invalid Date",a="toString",s=r.toString,o=r.getTime;new Date(NaN)+""!=i&&n("d+oe")(r,a,(function(){var e=o.call(this);return e==e?s.call(this):i}))},T9Wu:function(e,t,n){var r=n("HGrt"),i=n("138g"),a=r.get,s=r.key;r.exp({getOwnMetadata:function(e,t){return a(e,i(t),arguments.length<3?void 0:s(arguments[2]))}})},TI2F:function(e,t,n){var r=n("Vol4")("meta"),i=n("n+hx"),a=n("L7KE"),s=n("J2HX").f,o=0,u=Object.isExtensible||function(){return!0},l=!n("+TcE")((function(){return u(Object.preventExtensions({}))})),c=function(e){s(e,r,{value:{i:"O"+ ++o,w:{}}})},d=e.exports={KEY:r,NEED:!1,fastKey:function(e,t){if(!i(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!a(e,r)){if(!u(e))return"F";if(!t)return"E";c(e)}return e[r].i},getWeak:function(e,t){if(!a(e,r)){if(!u(e))return!0;if(!t)return!1;c(e)}return e[r].w},onFreeze:function(e){return l&&d.NEED&&u(e)&&!a(e,r)&&c(e),e}}},TsBE:function(e,t,n){var r=n("n+hx");n("CmYC")("isExtensible",(function(e){return function(t){return!!r(t)&&(!e||e(t))}}))},U5hM:function(e,t,n){"use strict";n("6dhg")("trimRight",(function(e){return function(){return e(this,2)}}),"trimEnd")},U9MG:function(e,t,n){var r=n("m29h"),i=n("Y3Md");e.exports=function(e){if(void 0===e)return 0;var t=r(e),n=i(t);if(t!==n)throw RangeError("Wrong length!");return n}},UBDf:function(e,t,n){"use strict";var r=n("8IOi"),i=n("Qu5u"),a=n("AZ8a"),s=n("7WAm"),o=n("jYdD").f;n("yU77")&&r(r.P+n("rGBx"),"Object",{__lookupSetter__:function(e){var t,n=i(this),r=a(e,!0);do{if(t=o(n,r))return t.set}while(n=s(n))}})},UBF9:function(e,t,n){"use strict";var r=n("8eWk");n.n(r).a},UBN9:function(e,t,n){"use strict";var r=n("8IOi"),i=n("+TcE"),a=n("Ku9J"),s=1..toPrecision;r(r.P+r.F*(i((function(){return"1"!==s.call(1,void 0)}))||!i((function(){s.call({})}))),"Number",{toPrecision:function(e){var t=a(this,"Number#toPrecision: incorrect invocation!");return void 0===e?s.call(t):s.call(t,e)}})},UPwD:function(e,t,n){n("Gx54")("Int8",1,(function(e){return function(t,n,r){return e(this,t,n,r)}}))},URgk:function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function a(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new a(i.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new a(i.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(r,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))},n("YBdB"),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,n("yLpj"))},UUc1:function(e,t,n){n("Gx54")("Uint8",1,(function(e){return function(t,n,r){return e(this,t,n,r)}}),!0)},UVVG:function(e,t,n){var r=n("HC2Y"),i=n("3iRr")("toStringTag"),a="Arguments"==r(function(){return arguments}());e.exports=function(e){var t,n,s;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),i))?n:a?r(t):"Object"==(s=r(t))&&"function"==typeof t.callee?"Arguments":s}},"UtW+":function(e,t,n){"use strict";var r=n("J2HX"),i=n("+zL4");e.exports=function(e,t,n){t in e?r.f(e,t,i(0,n)):e[t]=n}},Uyw2:function(e,t,n){var r=n("XW/+"),i=n("27JW").f,a={}.toString,s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return s&&"[object Window]"==a.call(e)?function(e){try{return i(e)}catch(e){return s.slice()}}(e):i(r(e))}},V0HS:function(e,t,n){var r=n("XW/+"),i=n("jYdD").f;n("CmYC")("getOwnPropertyDescriptor",(function(){return function(e,t){return i(r(e),t)}}))},VAZH:function(e,t,n){var r=n("8IOi"),i=n("e8l7");r(r.S,"Math",{cbrt:function(e){return i(e=+e)*Math.pow(Math.abs(e),1/3)}})},Vcfr:function(e,t,n){"use strict";var r=n("+TcE");e.exports=function(e,t){return!!e&&r((function(){t?e.call(null,(function(){}),1):e.call(null)}))}},Vcm9:function(e,t,n){n("e7D+")("WeakSet")},Vol4:function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},VwWS:function(e,t,n){"use strict";var r=n("138g"),i=n("AZ8a"),a="number";e.exports=function(e){if("string"!==e&&e!==a&&"default"!==e)throw TypeError("Incorrect hint");return i(r(this),e!=a)}},"W73/":function(e,t,n){"use strict";var r,i,a,s,o=n("zuiL"),u=n("k+AJ"),l=n("kRpC"),c=n("UVVG"),d=n("8IOi"),h=n("n+hx"),f=n("LOhj"),p=n("kopD"),v=n("j8TA"),m=n("EUev"),g=n("65rS").set,y=n("vejK")(),_=n("5/+w"),b=n("LVuD"),T=n("ZP9f"),S=n("ROgi"),E="Promise",k=u.TypeError,w=u.process,C=w&&w.versions,A=C&&C.v8||"",L=u.Promise,R="process"==c(w),x=function(){},I=i=_.f,O=!!function(){try{var e=L.resolve(1),t=(e.constructor={})[n("3iRr")("species")]=function(e){e(x,x)};return(R||"function"==typeof PromiseRejectionEvent)&&e.then(x)instanceof t&&0!==A.indexOf("6.6")&&-1===T.indexOf("Chrome/66")}catch(e){}}(),D=function(e){var t;return!(!h(e)||"function"!=typeof(t=e.then))&&t},P=function(e,t){if(!e._n){e._n=!0;var n=e._c;y((function(){for(var r=e._v,i=1==e._s,a=0,s=function(t){var n,a,s,o=i?t.ok:t.fail,u=t.resolve,l=t.reject,c=t.domain;try{o?(i||(2==e._h&&U(e),e._h=1),!0===o?n=r:(c&&c.enter(),n=o(r),c&&(c.exit(),s=!0)),n===t.promise?l(k("Promise-chain cycle")):(a=D(n))?a.call(n,u,l):u(n)):l(r)}catch(e){c&&!s&&c.exit(),l(e)}};n.length>a;)s(n[a++]);e._c=[],e._n=!1,t&&!e._h&&M(e)}))}},M=function(e){g.call(u,(function(){var t,n,r,i=e._v,a=j(e);if(a&&(t=b((function(){R?w.emit("unhandledRejection",i,e):(n=u.onunhandledrejection)?n({promise:e,reason:i}):(r=u.console)&&r.error&&r.error("Unhandled promise rejection",i)})),e._h=R||j(e)?2:1),e._a=void 0,a&&t.e)throw t.v}))},j=function(e){return 1!==e._h&&0===(e._a||e._c).length},U=function(e){g.call(u,(function(){var t;R?w.emit("rejectionHandled",e):(t=u.onrejectionhandled)&&t({promise:e,reason:e._v})}))},B=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),P(t,!0))},F=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw k("Promise can't be resolved itself");(t=D(e))?y((function(){var r={_w:n,_d:!1};try{t.call(e,l(F,r,1),l(B,r,1))}catch(e){B.call(r,e)}})):(n._v=e,n._s=1,P(n,!1))}catch(e){B.call({_w:n,_d:!1},e)}}};O||(L=function(e){p(this,L,E,"_h"),f(e),r.call(this);try{e(l(F,this,1),l(B,this,1))}catch(e){B.call(this,e)}},(r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n("xmgo")(L.prototype,{then:function(e,t){var n=I(m(this,L));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=R?w.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&P(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),a=function(){var e=new r;this.promise=e,this.resolve=l(F,e,1),this.reject=l(B,e,1)},_.f=I=function(e){return e===L||e===s?new a(e):i(e)}),d(d.G+d.W+d.F*!O,{Promise:L}),n("J70Z")(L,E),n("Oi8Z")(E),s=n("CuJi").Promise,d(d.S+d.F*!O,E,{reject:function(e){var t=I(this);return(0,t.reject)(e),t.promise}}),d(d.S+d.F*(o||!O),E,{resolve:function(e){return S(o&&this===s?L:this,e)}}),d(d.S+d.F*!(O&&n("6+im")((function(e){L.all(e).catch(x)}))),E,{all:function(e){var t=this,n=I(t),r=n.resolve,i=n.reject,a=b((function(){var n=[],a=0,s=1;v(e,!1,(function(e){var o=a++,u=!1;n.push(void 0),s++,t.resolve(e).then((function(e){u||(u=!0,n[o]=e,--s||r(n))}),i)})),--s||r(n)}));return a.e&&i(a.v),n.promise},race:function(e){var t=this,n=I(t),r=n.reject,i=b((function(){v(e,!1,(function(e){t.resolve(e).then(n.resolve,r)}))}));return i.e&&r(i.v),n.promise}})},Wa0j:function(e,t){e.exports=Math.scale||function(e,t,n,r,i){return 0===arguments.length||e!=e||t!=t||n!=n||r!=r||i!=i?NaN:e===1/0||e===-1/0?e:(e-t)*(i-r)/(n-t)+r}},Wl3L:function(e,t,n){var r=n("MN4f"),i=n("aK63");e.exports=Object.keys||function(e){return r(e,i)}},WmvF:function(e,t,n){var r=n("8IOi"),i=n("JYSn")(!1);r(r.S,"Object",{values:function(e){return i(e)}})},Wx4D:function(e,t,n){"use strict";var r=n("8IOi"),i=n("XW/+"),a=n("m29h"),s=n("Y3Md"),o=[].lastIndexOf,u=!!o&&1/[1].lastIndexOf(1,-0)<0;r(r.P+r.F*(u||!n("Vcfr")(o)),"Array",{lastIndexOf:function(e){if(u)return o.apply(this,arguments)||0;var t=i(this),n=s(t.length),r=n-1;for(arguments.length>1&&(r=Math.min(r,a(arguments[1]))),r<0&&(r=n+r);r>=0;r--)if(r in t&&t[r]===e)return r||0;return-1}})},XAIu:function(e,t,n){var r=n("8IOi");r(r.S,"Math",{clz32:function(e){return(e>>>=0)?31-Math.floor(Math.log(e+.5)*Math.LOG2E):32}})},XAyX:function(e,t,n){var r=n("J2HX"),i=n("jYdD"),a=n("7WAm"),s=n("L7KE"),o=n("8IOi"),u=n("+zL4"),l=n("138g"),c=n("n+hx");o(o.S,"Reflect",{set:function e(t,n,o){var d,h,f=arguments.length<4?t:arguments[3],p=i.f(l(t),n);if(!p){if(c(h=a(t)))return e(h,n,o,f);p=u(0)}if(s(p,"value")){if(!1===p.writable||!c(f))return!1;if(d=i.f(f,n)){if(d.get||d.set||!1===d.writable)return!1;d.value=o,r.f(f,n,d)}else r.f(f,n,u(0,o));return!0}return void 0!==p.set&&(p.set.call(f,o),!0)}})},XBAu:function(e,t,n){"use strict";var r=n("8IOi"),i=n("dDOX"),a=n("HC2Y"),s=n("b8c2"),o=n("Y3Md"),u=[].slice;r(r.P+r.F*n("+TcE")((function(){i&&u.call(i)})),"Array",{slice:function(e,t){var n=o(this.length),r=a(this);if(t=void 0===t?n:t,"Array"==r)return u.call(this,e,t);for(var i=s(e,n),l=s(t,n),c=o(l-i),d=new Array(c),h=0;h<c;h++)d[h]="String"==r?this.charAt(i+h):this[i+h];return d}})},XO9W:function(e,t,n){"use strict";var r=n("8IOi"),i=n("z/zB")(0),a=n("Vcfr")([].forEach,!0);r(r.P+r.F*!a,"Array",{forEach:function(e){return i(this,e,arguments[1])}})},XSaa:function(e,t,n){"use strict";n("5oHw")("sup",(function(e){return function(){return e(this,"sup","","")}}))},XSnG:function(e,t,n){var r=n("n+hx");n("CmYC")("isSealed",(function(e){return function(t){return!r(t)||!!e&&e(t)}}))},"XW/+":function(e,t,n){var r=n("26/4"),i=n("aI2V");e.exports=function(e){return r(i(e))}},XuTJ:function(e,t,n){var r=n("8IOi"),i=n("dSQw")(/[\\^$*+?.()|[\]{}]/g,"\\$&");r(r.S,"RegExp",{escape:function(e){return i(e)}})},XuX8:function(e,t,n){e.exports=n("INkZ")},Y3Md:function(e,t,n){var r=n("m29h"),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},YBJj:function(e,t,n){"use strict";var r=n("m29h"),i=n("aI2V");e.exports=function(e){var t=String(i(this)),n="",a=r(e);if(a<0||a==1/0)throw RangeError("Count can't be negative");for(;a>0;(a>>>=1)&&(t+=t))1&a&&(n+=t);return n}},YBdB:function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,i,a,s,o,u=1,l={},c=!1,d=e.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(e);h=h&&h.setTimeout?h:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){p(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((a=new MessageChannel).port1.onmessage=function(e){p(e.data)},r=function(e){a.port2.postMessage(e)}):d&&"onreadystatechange"in d.createElement("script")?(i=d.documentElement,r=function(e){var t=d.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):r=function(e){setTimeout(p,0,e)}:(s="setImmediate$"+Math.random()+"$",o=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(s)&&p(+t.data.slice(s.length))},e.addEventListener?e.addEventListener("message",o,!1):e.attachEvent("onmessage",o),r=function(t){e.postMessage(s+t,"*")}),h.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 i={callback:e,args:t};return l[u]=i,r(u),u++},h.clearImmediate=f}function f(e){delete l[e]}function p(e){if(c)setTimeout(p,0,e);else{var t=l[e];if(t){c=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(void 0,n)}}(t)}finally{f(e),c=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n("yLpj"),n("8oxB"))},Yu6D:function(e,t,n){"use strict";n("5oHw")("strike",(function(e){return function(){return e(this,"strike","","")}}))},YuTi:function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},"Yvq+":function(e,t,n){"use strict";var r=n("8IOi"),i=n("m29h"),a=n("Ku9J"),s=n("YBJj"),o=1..toFixed,u=Math.floor,l=[0,0,0,0,0,0],c="Number.toFixed: incorrect invocation!",d="0",h=function(e,t){for(var n=-1,r=t;++n<6;)r+=e*l[n],l[n]=r%1e7,r=u(r/1e7)},f=function(e){for(var t=6,n=0;--t>=0;)n+=l[t],l[t]=u(n/e),n=n%e*1e7},p=function(){for(var e=6,t="";--e>=0;)if(""!==t||0===e||0!==l[e]){var n=String(l[e]);t=""===t?n:t+s.call(d,7-n.length)+n}return t},v=function(e,t,n){return 0===t?n:t%2==1?v(e,t-1,n*e):v(e*e,t/2,n)};r(r.P+r.F*(!!o&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!n("+TcE")((function(){o.call({})}))),"Number",{toFixed:function(e){var t,n,r,o,u=a(this,c),l=i(e),m="",g=d;if(l<0||l>20)throw RangeError(c);if(u!=u)return"NaN";if(u<=-1e21||u>=1e21)return String(u);if(u<0&&(m="-",u=-u),u>1e-21)if(n=(t=function(e){for(var t=0,n=e;n>=4096;)t+=12,n/=4096;for(;n>=2;)t+=1,n/=2;return t}(u*v(2,69,1))-69)<0?u*v(2,-t,1):u/v(2,t,1),n*=4503599627370496,(t=52-t)>0){for(h(0,n),r=l;r>=7;)h(1e7,0),r-=7;for(h(v(10,r,1),0),r=t-1;r>=23;)f(1<<23),r-=23;f(1<<r),h(1,1),f(2),g=p()}else h(0,n),h(1<<-t,0),g=p()+s.call(d,l);return g=l>0?m+((o=g.length)<=l?"0."+s.call(d,l-o)+g:g.slice(0,o-l)+"."+g.slice(o-l)):m+g}})},"Z/7P":function(e,t,n){var r=n("k+AJ").parseInt,i=n("6dhg").trim,a=n("abT7"),s=/^[-+]?0[xX]/;e.exports=8!==r(a+"08")||22!==r(a+"0x16")?function(e,t){var n=i(String(e),3);return r(n,t>>>0||(s.test(n)?16:10))}:r},ZBJ7:function(e,t,n){"use strict";var r=n("8IOi"),i=n("6WDs")(!0);r(r.P,"String",{at:function(e){return i(this,e)}})},ZGGh:function(e,t,n){"use strict";var r=n("8IOi"),i=n("GvTA"),a=n("ZP9f"),s=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(a);r(r.P+r.F*s,"String",{padStart:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0,!0)}})},ZJct:function(e,t,n){"use strict";n("5oHw")("bold",(function(e){return function(){return e(this,"b","","")}}))},ZLNw:function(e,t,n){var r=n("HGrt"),i=n("138g"),a=r.keys,s=r.key;r.exp({getOwnMetadataKeys:function(e){return a(i(e),arguments.length<2?void 0:s(arguments[1]))}})},ZP9f:function(e,t,n){var r=n("k+AJ").navigator;e.exports=r&&r.userAgent||""},ZUho:function(e,t,n){var r=n("JvFK"),i=n("t2DD"),a=n("HGrt"),s=n("138g"),o=n("7WAm"),u=a.keys,l=a.key,c=function(e,t){var n=u(e,t),a=o(e);if(null===a)return n;var s=c(a,t);return s.length?n.length?i(new r(n.concat(s))):s:n};a.exp({getMetadataKeys:function(e){return c(s(e),arguments.length<2?void 0:l(arguments[1]))}})},ZiEV:function(e,t,n){var r=n("138g"),i=n("d/Tf"),a=n("aK63"),s=n("lk+t")("IE_PROTO"),o=function(){},u=function(){var e,t=n("itdZ")("iframe"),r=a.length;for(t.style.display="none",n("dDOX").appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),u=e.F;r--;)delete u.prototype[a[r]];return u()};e.exports=Object.create||function(e,t){var n;return null!==e?(o.prototype=r(e),n=new o,o.prototype=null,n[s]=e):n=u(),void 0===t?n:i(n,t)}},ZqwW:function(e,t,n){"use strict";var r=n("138g");e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},Zrcd:function(e,t,n){var r=n("3iRr")("unscopables"),i=Array.prototype;null==i[r]&&n("BxPU")(i,r,{}),e.exports=function(e){i[r][e]=!0}},"a/cf":function(e,t,n){var r=n("8IOi");r(r.S,"Math",{scale:n("Wa0j")})},a5BC:function(e,t,n){n("rPJW"),n("uHQh"),n("/Kal"),n("Svsh"),n("V0HS"),n("Ki3G"),n("gRqh"),n("QraV"),n("einn"),n("0PTC"),n("0oS0"),n("BjUW"),n("XSnG"),n("TsBE"),n("l9Ni"),n("cGcf"),n("peKB"),n("+z8a"),n("rVFp"),n("mWBI"),n("64wf"),n("+40N"),n("+fNn"),n("qOR+"),n("Yvq+"),n("UBN9"),n("o9jk"),n("DbUx"),n("OWqD"),n("0khl"),n("jAPZ"),n("wpNZ"),n("Bmui"),n("GPGB"),n("QJgN"),n("kwta"),n("4D/n"),n("dwFp"),n("VAZH"),n("XAIu"),n("pYEy"),n("gHJP"),n("ffSk"),n("K3ax"),n("EdrQ"),n("EpbX"),n("oFtK"),n("Stof"),n("IC4T"),n("iEh4"),n("KpXI"),n("G1Bn"),n("c4L8"),n("OfMQ"),n("aMCu"),n("9Yzx"),n("rMxl"),n("skXq"),n("JCQ5"),n("P6sA"),n("AK2K"),n("3Uai"),n("JNc5"),n("IGqx"),n("ZJct"),n("ijSB"),n("nptS"),n("IheE"),n("e/nT"),n("CL8V"),n("94c5"),n("Yu6D"),n("5Kf4"),n("XSaa"),n("/p3b"),n("s+08"),n("gjM+"),n("SzBd"),n("Rby+"),n("tNXT"),n("pAas"),n("28ya"),n("aOXv"),n("XBAu"),n("CCGS"),n("XO9W"),n("HJwq"),n("Agm5"),n("aNYM"),n("31m8"),n("l6ZQ"),n("rqGp"),n("cmzs"),n("Wx4D"),n("P4R2"),n("rWL+"),n("L6/l"),n("NrsN"),n("1bh+"),n("IdBN"),n("fDzh"),n("N8W1"),n("iQRN"),n("AvcM"),n("g0Qz"),n("C74u"),n("B28f"),n("as79"),n("W73/"),n("G966"),n("JvFK"),n("lLv2"),n("Nrdp"),n("oKuV"),n("iAh5"),n("UPwD"),n("pLVf"),n("UUc1"),n("9BWX"),n("fSTx"),n("BuMk"),n("CEB3"),n("LMzk"),n("msPO"),n("eG8a"),n("1hBx"),n("39GA"),n("KYUM"),n("GxgO"),n("7n8s"),n("MVdI"),n("xRLh"),n("PsYO"),n("2ASh"),n("oTT8"),n("j4Nb"),n("XAyX"),n("1TfH"),n("oszf"),n("nAtQ"),n("5zUu"),n("ZBJ7"),n("ZGGh"),n("nOwm"),n("QYzQ"),n("U5hM"),n("C2di"),n("pSQQ"),n("N+bU"),n("uAa7"),n("WmvF"),n("ySsg"),n("p5hF"),n("Insd"),n("QoI2"),n("UBDf"),n("xcDT"),n("dO8U"),n("mFt4"),n("Fnpj"),n("j3qt"),n("+9nT"),n("MWg1"),n("c3Hg"),n("ibFI"),n("Vcm9"),n("PHd1"),n("ca6l"),n("+Wx6"),n("CFo0"),n("lCxz"),n("nx9P"),n("nR3n"),n("DwDk"),n("e9bc"),n("nas9"),n("QANz"),n("67f/"),n("a/cf"),n("SxLI"),n("srFW"),n("iHAW"),n("gqYs"),n("axHO"),n("1bKO"),n("kWVC"),n("ZUho"),n("T9Wu"),n("ZLNw"),n("x8o9"),n("FeNi"),n("unDq"),n("OVpP"),n("FMkX"),n("6T8a"),n("xO9r"),n("BPp8"),e.exports=n("CuJi")},aI2V:function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},aK63:function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},aMCu:function(e,t,n){"use strict";n("6dhg")("trim",(function(e){return function(){return e(this,3)}}))},aNYM:function(e,t,n){"use strict";var r=n("8IOi"),i=n("z/zB")(3);r(r.P+r.F*!n("Vcfr")([].some,!0),"Array",{some:function(e){return i(this,e,arguments[1])}})},aOXv:function(e,t,n){"use strict";var r=n("8IOi"),i=n("XW/+"),a=[].join;r(r.P+r.F*(n("26/4")!=Object||!n("Vcfr")(a)),"Array",{join:function(e){return a.call(i(this),void 0===e?",":e)}})},aXKq:function(e,t,n){"use strict";var r=n("6WDs")(!0);e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}},abT7:function(e,t){e.exports="\t\n\v\f\r    \u2028\u2029\ufeff"},as79:function(e,t,n){"use strict";var r=n("N6L2"),i=n("138g"),a=n("EUev"),s=n("aXKq"),o=n("Y3Md"),u=n("/vim"),l=n("4Fav"),c=n("+TcE"),d=Math.min,h=[].push,f=4294967295,p=!c((function(){RegExp(f,"y")}));n("ntFk")("split",2,(function(e,t,n,c){var v;return v="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,t){var i=String(this);if(void 0===e&&0===t)return[];if(!r(e))return n.call(i,e,t);for(var a,s,o,u=[],c=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),d=0,p=void 0===t?f:t>>>0,v=new RegExp(e.source,c+"g");(a=l.call(v,i))&&!((s=v.lastIndex)>d&&(u.push(i.slice(d,a.index)),a.length>1&&a.index<i.length&&h.apply(u,a.slice(1)),o=a[0].length,d=s,u.length>=p));)v.lastIndex===a.index&&v.lastIndex++;return d===i.length?!o&&v.test("")||u.push(""):u.push(i.slice(d)),u.length>p?u.slice(0,p):u}:"0".split(void 0,0).length?function(e,t){return void 0===e&&0===t?[]:n.call(this,e,t)}:n,[function(n,r){var i=e(this),a=null==n?void 0:n[t];return void 0!==a?a.call(n,i,r):v.call(String(i),n,r)},function(e,t){var r=c(v,e,this,t,v!==n);if(r.done)return r.value;var l=i(e),h=String(this),m=a(l,RegExp),g=l.unicode,y=(l.ignoreCase?"i":"")+(l.multiline?"m":"")+(l.unicode?"u":"")+(p?"y":"g"),_=new m(p?l:"^(?:"+l.source+")",y),b=void 0===t?f:t>>>0;if(0===b)return[];if(0===h.length)return null===u(_,h)?[h]:[];for(var T=0,S=0,E=[];S<h.length;){_.lastIndex=p?S:0;var k,w=u(_,p?h:h.slice(S));if(null===w||(k=d(o(_.lastIndex+(p?0:S)),h.length))===T)S=s(h,S,g);else{if(E.push(h.slice(T,S)),E.length===b)return E;for(var C=1;C<=w.length-1;C++)if(E.push(w[C]),E.length===b)return E;S=T=k}}return E.push(h.slice(T)),E}]}))},atpN:function(e,t,n){"use strict";var r=n("ZiEV"),i=n("+zL4"),a=n("J70Z"),s={};n("BxPU")(s,n("3iRr")("iterator"),(function(){return this})),e.exports=function(e,t,n){e.prototype=r(s,{next:i(1,n)}),a(e,t+" Iterator")}},axHO:function(e,t,n){var r=n("HGrt"),i=n("138g"),a=r.key,s=r.set;r.exp({defineMetadata:function(e,t,n,r){s(e,t,i(n),a(r))}})},b8c2:function(e,t,n){var r=n("m29h"),i=Math.max,a=Math.min;e.exports=function(e,t){return(e=r(e))<0?i(e+t,0):a(e,t)}},"bZ/h":function(e,t,n){var r=n("Wl3L"),i=n("EN0g"),a=n("4XFX");e.exports=function(e){var t=r(e),n=i.f;if(n)for(var s,o=n(e),u=a.f,l=0;o.length>l;)u.call(e,s=o[l++])&&t.push(s);return t}},c3Hg:function(e,t,n){n("e7D+")("Set")},c4L8:function(e,t,n){var r=n("8IOi"),i=n("b8c2"),a=String.fromCharCode,s=String.fromCodePoint;r(r.S+r.F*(!!s&&1!=s.length),"String",{fromCodePoint:function(e){for(var t,n=[],r=arguments.length,s=0;r>s;){if(t=+arguments[s++],i(t,1114111)!==t)throw RangeError(t+" is not a valid code point");n.push(t<65536?a(t):a(55296+((t-=65536)>>10),t%1024+56320))}return n.join("")}})},cGcf:function(e,t,n){var r=n("8IOi");r(r.S,"Object",{is:n("qHvq")})},ca6l:function(e,t,n){var r=n("8IOi");r(r.S,"System",{global:n("k+AJ")})},cmzs:function(e,t,n){"use strict";var r=n("8IOi"),i=n("J8Qq")(!1),a=[].indexOf,s=!!a&&1/[1].indexOf(1,-0)<0;r(r.P+r.F*(s||!n("Vcfr")(a)),"Array",{indexOf:function(e){return s?a.apply(this,arguments)||0:i(this,e,arguments[1])}})},"d+oe":function(e,t,n){var r=n("k+AJ"),i=n("BxPU"),a=n("L7KE"),s=n("Vol4")("src"),o=n("oHD3"),u="toString",l=(""+o).split(u);n("CuJi").inspectSource=function(e){return o.call(e)},(e.exports=function(e,t,n,o){var u="function"==typeof n;u&&(a(n,"name")||i(n,"name",t)),e[t]!==n&&(u&&(a(n,s)||i(n,s,e[t]?""+e[t]:l.join(String(t)))),e===r?e[t]=n:o?e[t]?e[t]=n:i(e,t,n):(delete e[t],i(e,t,n)))})(Function.prototype,u,(function(){return"function"==typeof this&&this[s]||o.call(this)}))},"d/Tf":function(e,t,n){var r=n("J2HX"),i=n("138g"),a=n("Wl3L");e.exports=n("yU77")?Object.defineProperties:function(e,t){i(e);for(var n,s=a(t),o=s.length,u=0;o>u;)r.f(e,n=s[u++],t[n]);return e}},dDOX:function(e,t,n){var r=n("k+AJ").document;e.exports=r&&r.documentElement},dO8U:function(e,t,n){var r=n("8IOi");r(r.P+r.R,"Set",{toJSON:n("H/b1")("Set")})},dSQw:function(e,t){e.exports=function(e,t){var n=t===Object(t)?function(e){return t[e]}:t;return function(t){return String(t).replace(e,n)}}},dt6n:function(e,t,n){n("XuTJ"),e.exports=n("CuJi").RegExp.escape},dwFp:function(e,t,n){var r=n("8IOi"),i=Math.atanh;r(r.S+r.F*!(i&&1/i(-0)<0),"Math",{atanh:function(e){return 0==(e=+e)?e:Math.log((1+e)/(1-e))/2}})},"e/nT":function(e,t,n){"use strict";n("5oHw")("italics",(function(e){return function(){return e(this,"i","","")}}))},"e7D+":function(e,t,n){"use strict";var r=n("8IOi"),i=n("LOhj"),a=n("kRpC"),s=n("j8TA");e.exports=function(e){r(r.S,e,{from:function(e){var t,n,r,o,u=arguments[1];return i(this),(t=void 0!==u)&&i(u),null==e?new this:(n=[],t?(r=0,o=a(u,arguments[2],2),s(e,!1,(function(e){n.push(o(e,r++))}))):s(e,!1,n.push,n),new this(n))}})}},e8l7:function(e,t){e.exports=Math.sign||function(e){return 0==(e=+e)||e!=e?e:e<0?-1:1}},e9bc:function(e,t,n){var r=n("8IOi");r(r.S,"Math",{isubh:function(e,t,n,r){var i=e>>>0,a=n>>>0;return(t>>>0)-(r>>>0)-((~i&a|~(i^a)&i-a>>>0)>>>31)|0}})},eG8a:function(e,t,n){var r=n("8IOi"),i=n("LOhj"),a=n("138g"),s=(n("k+AJ").Reflect||{}).apply,o=Function.apply;r(r.S+r.F*!n("+TcE")((function(){s((function(){}))})),"Reflect",{apply:function(e,t,n){var r=i(e),u=a(n);return s?s(r,t,u):o.call(r,t,u)}})},eYp2:function(e,t,n){var r=n("n+hx");e.exports=function(e,t){if(!r(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e}},einn:function(e,t,n){var r=n("n+hx"),i=n("TI2F").onFreeze;n("CmYC")("freeze",(function(e){return function(t){return e&&r(t)?e(i(t)):t}}))},fDzh:function(e,t,n){var r=n("k+AJ"),i=n("EeL+"),a=n("J2HX").f,s=n("27JW").f,o=n("N6L2"),u=n("ZqwW"),l=r.RegExp,c=l,d=l.prototype,h=/a/g,f=/a/g,p=new l(h)!==h;if(n("yU77")&&(!p||n("+TcE")((function(){return f[n("3iRr")("match")]=!1,l(h)!=h||l(f)==f||"/a/i"!=l(h,"i")})))){l=function(e,t){var n=this instanceof l,r=o(e),a=void 0===t;return!n&&r&&e.constructor===l&&a?e:i(p?new c(r&&!a?e.source:e,t):c((r=e instanceof l)?e.source:e,r&&a?u.call(e):t),n?this:d,l)};for(var v=function(e){e in l||a(l,e,{configurable:!0,get:function(){return c[e]},set:function(t){c[e]=t}})},m=s(c),g=0;m.length>g;)v(m[g++]);d.constructor=l,l.prototype=d,n("d+oe")(r,"RegExp",l)}n("Oi8Z")("RegExp")},fSTx:function(e,t,n){n("Gx54")("Uint16",2,(function(e){return function(t,n,r){return e(this,t,n,r)}}))},ffSk:function(e,t,n){var r=n("8IOi");r(r.S,"Math",{fround:n("1JuZ")})},fyHr:function(e,t,n){var r=n("HC2Y");e.exports=Array.isArray||function(e){return"Array"==r(e)}},g0Qz:function(e,t,n){"use strict";var r=n("138g"),i=n("Y3Md"),a=n("aXKq"),s=n("/vim");n("ntFk")("match",1,(function(e,t,n,o){return[function(n){var r=e(this),i=null==n?void 0:n[t];return void 0!==i?i.call(n,r):new RegExp(n)[t](String(r))},function(e){var t=o(n,e,this);if(t.done)return t.value;var u=r(e),l=String(this);if(!u.global)return s(u,l);var c=u.unicode;u.lastIndex=0;for(var d,h=[],f=0;null!==(d=s(u,l));){var p=String(d[0]);h[f]=p,""===p&&(u.lastIndex=a(l,i(u.lastIndex),c)),f++}return 0===f?null:h}]}))},gHJP:function(e,t,n){var r=n("8IOi"),i=n("RZL5");r(r.S+r.F*(i!=Math.expm1),"Math",{expm1:i})},gRqh:function(e,t,n){var r=n("Qu5u"),i=n("Wl3L");n("CmYC")("keys",(function(){return function(e){return i(r(e))}}))},"gjM+":function(e,t,n){var r=n("8IOi"),i=n("vNAk");r(r.P+r.F*(Date.prototype.toISOString!==i),"Date",{toISOString:i})},gqYs:function(e,t,n){"use strict";var r=n("8IOi"),i=n("5/+w"),a=n("LVuD");r(r.S,"Promise",{try:function(e){var t=i.f(this),n=a(e);return(n.e?t.reject:t.resolve)(n.v),t.promise}})},gyzL:function(e,t,n){var r=n("n+hx"),i=n("fyHr"),a=n("3iRr")("species");e.exports=function(e){var t;return i(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!i(t.prototype)||(t=void 0),r(t)&&null===(t=t[a])&&(t=void 0)),void 0===t?Array:t}},"hTk/":function(e,t,n){var r=n("k+AJ").parseFloat,i=n("6dhg").trim;e.exports=1/r(n("abT7")+"-0")!=-1/0?function(e){var t=i(String(e),3),n=r(t);return 0===n&&"-"==t.charAt(0)?-0:n}:r},iAh5:function(e,t,n){var r=n("8IOi");r(r.G+r.W+r.F*!n("8wjV").ABV,{DataView:n("t5lg").DataView})},iEh4:function(e,t,n){var r=n("8IOi"),i=n("RZL5"),a=Math.exp;r(r.S+r.F*n("+TcE")((function(){return-2e-17!=!Math.sinh(-2e-17)})),"Math",{sinh:function(e){return Math.abs(e=+e)<1?(i(e)-i(-e))/2:(a(e-1)-a(-e-1))*(Math.E/2)}})},iHAW:function(e,t,n){"use strict";var r=n("8IOi"),i=n("CuJi"),a=n("k+AJ"),s=n("EUev"),o=n("ROgi");r(r.P+r.R,"Promise",{finally:function(e){var t=s(this,i.Promise||a.Promise),n="function"==typeof e;return this.then(n?function(n){return o(t,e()).then((function(){return n}))}:e,n?function(n){return o(t,e()).then((function(){throw n}))}:e)}})},iQRN:function(e,t,n){"use strict";n("AvcM");var r=n("138g"),i=n("ZqwW"),a=n("yU77"),s="toString",o=/./.toString,u=function(e){n("d+oe")(RegExp.prototype,s,e,!0)};n("+TcE")((function(){return"/a/b"!=o.call({source:"a",flags:"b"})}))?u((function(){var e=r(this);return"/".concat(e.source,"/","flags"in e?e.flags:!a&&e instanceof RegExp?i.call(e):void 0)})):o.name!=s&&u((function(){return o.call(this)}))},ibFI:function(e,t,n){n("e7D+")("WeakMap")},ijSB:function(e,t,n){"use strict";n("5oHw")("fixed",(function(e){return function(){return e(this,"tt","","")}}))},itdZ:function(e,t,n){var r=n("n+hx"),i=n("k+AJ").document,a=r(i)&&r(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},j3qt:function(e,t,n){n("+Uj0")("WeakMap")},j4Nb:function(e,t,n){var r=n("8IOi"),i=n("138g"),a=Object.preventExtensions;r(r.S,"Reflect",{preventExtensions:function(e){i(e);try{return a&&a(e),!0}catch(e){return!1}}})},j8TA:function(e,t,n){var r=n("kRpC"),i=n("5arV"),a=n("x4ZG"),s=n("138g"),o=n("Y3Md"),u=n("o3v7"),l={},c={};(t=e.exports=function(e,t,n,d,h){var f,p,v,m,g=h?function(){return e}:u(e),y=r(n,d,t?2:1),_=0;if("function"!=typeof g)throw TypeError(e+" is not iterable!");if(a(g)){for(f=o(e.length);f>_;_++)if((m=t?y(s(p=e[_])[0],p[1]):y(e[_]))===l||m===c)return m}else for(v=g.call(e);!(p=v.next()).done;)if((m=i(v,y,p.value,t))===l||m===c)return m}).BREAK=l,t.RETURN=c},jAPZ:function(e,t,n){var r=n("8IOi"),i=n("Jkf2"),a=Math.abs;r(r.S,"Number",{isSafeInteger:function(e){return i(e)&&a(e)<=9007199254740991}})},jYdD:function(e,t,n){var r=n("4XFX"),i=n("+zL4"),a=n("XW/+"),s=n("AZ8a"),o=n("L7KE"),u=n("+X+Z"),l=Object.getOwnPropertyDescriptor;t.f=n("yU77")?l:function(e,t){if(e=a(e),t=s(t,!0),u)try{return l(e,t)}catch(e){}if(o(e,t))return i(!r.f.call(e,t),e[t])}},"k+AJ":function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},kRpC:function(e,t,n){var r=n("LOhj");e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},kWVC:function(e,t,n){var r=n("HGrt"),i=n("138g"),a=n("7WAm"),s=r.has,o=r.get,u=r.key,l=function(e,t,n){if(s(e,t,n))return o(e,t,n);var r=a(t);return null!==r?l(e,r,n):void 0};r.exp({getMetadata:function(e,t){return l(e,i(t),arguments.length<3?void 0:u(arguments[2]))}})},kopD:function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},kwta:function(e,t,n){var r=n("8IOi"),i=n("3D8Z"),a=Math.sqrt,s=Math.acosh;r(r.S+r.F*!(s&&710==Math.floor(s(Number.MAX_VALUE))&&s(1/0)==1/0),"Math",{acosh:function(e){return(e=+e)<1?NaN:e>94906265.62425156?Math.log(e)+Math.LN2:i(e-1+a(e-1)*a(e+1))}})},l0zq:function(e,t,n){"use strict";var r=n("Wl3L"),i=n("EN0g"),a=n("4XFX"),s=n("Qu5u"),o=n("26/4"),u=Object.assign;e.exports=!u||n("+TcE")((function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!=u({},e)[n]||Object.keys(u({},t)).join("")!=r}))?function(e,t){for(var n=s(e),u=arguments.length,l=1,c=i.f,d=a.f;u>l;)for(var h,f=o(arguments[l++]),p=c?r(f).concat(c(f)):r(f),v=p.length,m=0;v>m;)d.call(f,h=p[m++])&&(n[h]=f[h]);return n}:u},l6ZQ:function(e,t,n){"use strict";var r=n("8IOi"),i=n("x0dS");r(r.P+r.F*!n("Vcfr")([].reduce,!0),"Array",{reduce:function(e){return i(this,e,arguments.length,arguments[1],!1)}})},l9Ni:function(e,t,n){var r=n("8IOi");r(r.S+r.F,"Object",{assign:n("l0zq")})},lCxz:function(e,t,n){var r=n("8IOi");r(r.S,"Math",{DEG_PER_RAD:Math.PI/180})},lLv2:function(e,t,n){"use strict";var r,i=n("k+AJ"),a=n("z/zB")(0),s=n("d+oe"),o=n("TI2F"),u=n("l0zq"),l=n("QV8t"),c=n("n+hx"),d=n("eYp2"),h=n("eYp2"),f=!i.ActiveXObject&&"ActiveXObject"in i,p="WeakMap",v=o.getWeak,m=Object.isExtensible,g=l.ufstore,y=function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},_={get:function(e){if(c(e)){var t=v(e);return!0===t?g(d(this,p)).get(e):t?t[this._i]:void 0}},set:function(e,t){return l.def(d(this,p),e,t)}},b=e.exports=n("0WhE")(p,y,_,l,!0,!0);h&&f&&(u((r=l.getConstructor(y,p)).prototype,_),o.NEED=!0,a(["delete","has","get","set"],(function(e){var t=b.prototype,n=t[e];s(t,e,(function(t,i){if(c(t)&&!m(t)){this._f||(this._f=new r);var a=this._f[e](t,i);return"set"==e?this:a}return n.call(this,t,i)}))})))},"lk+t":function(e,t,n){var r=n("3oW4")("keys"),i=n("Vol4");e.exports=function(e){return r[e]||(r[e]=i(e))}},m29h:function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},mFt4:function(e,t,n){n("+Uj0")("Map")},mWBI:function(e,t,n){var r=n("J2HX").f,i=Function.prototype,a=/^\s*function ([^ (]*)/,s="name";s in i||n("yU77")&&r(i,s,{configurable:!0,get:function(){try{return(""+this).match(a)[1]}catch(e){return""}}})},msPO:function(e,t,n){n("Gx54")("Float64",8,(function(e){return function(t,n,r){return e(this,t,n,r)}}))},"n+hx":function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},nAtQ:function(e,t,n){"use strict";var r=n("8IOi"),i=n("QotP"),a=n("Qu5u"),s=n("Y3Md"),o=n("LOhj"),u=n("CkjT");r(r.P,"Array",{flatMap:function(e){var t,n,r=a(this);return o(e),t=s(r.length),n=u(r,0),i(n,r,r,t,0,1,e,arguments[1]),n}}),n("Zrcd")("flatMap")},nOwm:function(e,t,n){"use strict";var r=n("8IOi"),i=n("GvTA"),a=n("ZP9f"),s=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(a);r(r.P+r.F*s,"String",{padEnd:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0,!1)}})},nR3n:function(e,t,n){var r=n("8IOi"),i=n("Wa0j"),a=n("1JuZ");r(r.S,"Math",{fscale:function(e,t,n,r,s){return a(i(e,t,n,r,s))}})},nas9:function(e,t,n){var r=n("8IOi");r(r.S,"Math",{imulh:function(e,t){var n=65535,r=+e,i=+t,a=r&n,s=i&n,o=r>>16,u=i>>16,l=(o*s>>>0)+(a*s>>>16);return o*u+(l>>16)+((a*u>>>0)+(l&n)>>16)}})},nptS:function(e,t,n){"use strict";n("5oHw")("fontcolor",(function(e){return function(t){return e(this,"font","color",t)}}))},ntFk:function(e,t,n){"use strict";n("N8W1");var r=n("d+oe"),i=n("BxPU"),a=n("+TcE"),s=n("aI2V"),o=n("3iRr"),u=n("4Fav"),l=o("species"),c=!a((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})),d=function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();e.exports=function(e,t,n){var h=o(e),f=!a((function(){var t={};return t[h]=function(){return 7},7!=""[e](t)})),p=f?!a((function(){var t=!1,n=/a/;return n.exec=function(){return t=!0,null},"split"===e&&(n.constructor={},n.constructor[l]=function(){return n}),n[h](""),!t})):void 0;if(!f||!p||"replace"===e&&!c||"split"===e&&!d){var v=/./[h],m=n(s,h,""[e],(function(e,t,n,r,i){return t.exec===u?f&&!i?{done:!0,value:v.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}})),g=m[0],y=m[1];r(String.prototype,e,g),i(RegExp.prototype,h,2==t?function(e,t){return y.call(e,this,t)}:function(e){return y.call(e,this)})}}},nx9P:function(e,t,n){var r=n("8IOi"),i=180/Math.PI;r(r.S,"Math",{degrees:function(e){return e*i}})},o3v7:function(e,t,n){var r=n("UVVG"),i=n("3iRr")("iterator"),a=n("wFMk");e.exports=n("CuJi").getIteratorMethod=function(e){if(null!=e)return e[i]||e["@@iterator"]||a[r(e)]}},o9jk:function(e,t,n){var r=n("8IOi");r(r.S,"Number",{EPSILON:Math.pow(2,-52)})},oFtK:function(e,t,n){var r=n("8IOi");r(r.S,"Math",{log1p:n("3D8Z")})},oHD3:function(e,t,n){e.exports=n("3oW4")("native-function-to-string",Function.toString)},oKuV:function(e,t,n){"use strict";var r=n("8IOi"),i=n("8wjV"),a=n("t5lg"),s=n("138g"),o=n("b8c2"),u=n("Y3Md"),l=n("n+hx"),c=n("k+AJ").ArrayBuffer,d=n("EUev"),h=a.ArrayBuffer,f=a.DataView,p=i.ABV&&c.isView,v=h.prototype.slice,m=i.VIEW,g="ArrayBuffer";r(r.G+r.W+r.F*(c!==h),{ArrayBuffer:h}),r(r.S+r.F*!i.CONSTR,g,{isView:function(e){return p&&p(e)||l(e)&&m in e}}),r(r.P+r.U+r.F*n("+TcE")((function(){return!new h(2).slice(1,void 0).byteLength})),g,{slice:function(e,t){if(void 0!==v&&void 0===t)return v.call(s(this),e);for(var n=s(this).byteLength,r=o(e,n),i=o(void 0===t?n:t,n),a=new(d(this,h))(u(i-r)),l=new f(this),c=new f(a),p=0;r<i;)c.setUint8(p++,l.getUint8(r++));return a}}),n("Oi8Z")(g)},oTT8:function(e,t,n){var r=n("8IOi");r(r.S,"Reflect",{ownKeys:n("6uvR")})},oszf:function(e,t,n){"use strict";var r=n("8IOi"),i=n("J8Qq")(!0);r(r.P,"Array",{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),n("Zrcd")("includes")},p5hF:function(e,t,n){"use strict";var r=n("8IOi"),i=n("Qu5u"),a=n("LOhj"),s=n("J2HX");n("yU77")&&r(r.P+n("rGBx"),"Object",{__defineGetter__:function(e,t){s.f(i(this),e,{get:a(t),enumerable:!0,configurable:!0})}})},pAas:function(e,t,n){"use strict";var r=n("kRpC"),i=n("8IOi"),a=n("Qu5u"),s=n("5arV"),o=n("x4ZG"),u=n("Y3Md"),l=n("UtW+"),c=n("o3v7");i(i.S+i.F*!n("6+im")((function(e){Array.from(e)})),"Array",{from:function(e){var t,n,i,d,h=a(e),f="function"==typeof this?this:Array,p=arguments.length,v=p>1?arguments[1]:void 0,m=void 0!==v,g=0,y=c(h);if(m&&(v=r(v,p>2?arguments[2]:void 0,2)),null==y||f==Array&&o(y))for(n=new f(t=u(h.length));t>g;g++)l(n,g,m?v(h[g],g):h[g]);else for(d=y.call(h),n=new f;!(i=d.next()).done;g++)l(n,g,m?s(d,v,[i.value,g],!0):i.value);return n.length=g,n}})},pDsQ:function(e,t,n){t.f=n("3iRr")},pLVf:function(e,t,n){n("Gx54")("Uint8",1,(function(e){return function(t,n,r){return e(this,t,n,r)}}))},pSQQ:function(e,t,n){n("HLcc")("asyncIterator")},pYEy:function(e,t,n){var r=n("8IOi"),i=Math.exp;r(r.S,"Math",{cosh:function(e){return(i(e=+e)+i(-e))/2}})},peKB:function(e,t,n){var r=n("8IOi");r(r.S,"Object",{setPrototypeOf:n("R1kZ").set})},"q/s7":function(e,t,n){"use strict";n.r(t);var r=n("XuX8"),i=n.n(r);n("KJ4T");function a(e,t){return e.__proto__=t,e}Object.setPrototypeOf=Object.setPrototypeOf||a;a.bind(Object);var s="undefined"!=typeof Symbol&&"undefined"!=typeof Reflect&&"undefined"!=typeof Proxy&&!Object.isSealed(Proxy),o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function d(){return Reflect.construct(HTMLElement,[],this.__proto__.constructor)}function h(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("undefined"!=typeof customElements){if(s){var n=function(e){function n(e){u(this,n);var t=l(this,(n.__proto__||Object.getPrototypeOf(n)).call(this)),r=e?HTMLElement.call(e):t;return i.call(r),l(t,r)}return c(n,e),o(n,null,[{key:"observedAttributes",get:function(){return t.observedAttributes||[]}}]),n}(d);return n.prototype.connectedCallback=a,n.prototype.disconnectedCallback=h,n.prototype.attributeChangedCallback=f,p(e,n),n}var r=function(e){var t=e?HTMLElement.call(e):this;return i.call(t),t};return r.observedAttributes=t.observedAttributes||[],r.prototype=Object.create(HTMLElement.prototype,{constructor:{configurable:!0,writable:!0,value:r}}),r.prototype.connectedCallback=a,r.prototype.disconnectedCallback=h,r.prototype.attributeChangedCallback=f,p(e,r),r}function i(){!0===t.shadow&&HTMLElement.prototype.attachShadow&&this.attachShadow({mode:"open"}),"function"==typeof t.constructorCallback&&t.constructorCallback.call(this)}function a(){"function"==typeof t.connectedCallback&&t.connectedCallback.call(this)}function h(){"function"==typeof t.disconnectedCallback&&t.disconnectedCallback.call(this)}function f(e,n,r){"function"==typeof t.attributeChangedCallback&&t.attributeChangedCallback.call(this,e,n,r)}function p(e,t){var n=customElements.get(e);return void 0!==n?n:customElements.define(e,t)}}Object.setPrototypeOf(d.prototype,HTMLElement.prototype),Object.setPrototypeOf(d,HTMLElement);var f=/-(\w)/g,p=function(e){return e.replace(f,(function(e,t){return t?t.toUpperCase():""}))},v=/([^-])([A-Z])/g,m=function(e){return e.replace(v,"$1-$2").replace(v,"$1-$2").toLowerCase()};function g(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}var y="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};function _(e,t){var n=e,r=["true","false"].indexOf(e)>-1,i=parseFloat(n,10),a=!isNaN(i)&&isFinite(n)&&"string"==typeof n&&!n.match(/^0+[^.]\d*$/g);return t&&t!==Boolean&&(void 0===n?"undefined":y(n))!==t?n=t(e):r||t===Boolean?n=""===n||"true"===n:a&&(n=i),n}function b(e,t){if(e&&e.length)e.forEach((function(e){var n=p(e);-1===t.camelCase.indexOf(n)&&t.camelCase.push(n)}));else if(e&&"object"===(void 0===e?"undefined":y(e)))for(var n in e){var r=p(n);-1===t.camelCase.indexOf(r)&&t.camelCase.push(r),e[r]&&e[r].type&&(t.types[n]=[].concat(e[r].type)[0])}}function T(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={camelCase:[],hyphenate:[],types:{}};if(e.mixins&&e.mixins.forEach((function(e){b(e.props,t)})),e.extends&&e.extends.props){var n=e.extends.props;b(n,t)}return b(e.props,t),t.camelCase.forEach((function(e){t.hyphenate.push(m(e))})),t}function S(e){var t={};return g(e.attributes).forEach((function(e){t["vue-slot"===e.nodeName?"slot":e.nodeName]=e.nodeValue})),t}function E(e,t,n){var r=g(function(e){if(e.childNodes.length)return e.childNodes;if(e.content&&e.content.childNodes&&e.content.childNodes.length)return e.content.childNodes;var t=document.createElement("div");return t.innerHTML=e.innerHTML,t.childNodes}(t)).map((function(t){return"#text"===t.nodeName?t.nodeValue:e(t.tagName,{attrs:S(t),domProps:{innerHTML:t.innerHTML}})}));return n.slot=t.id,e("template",n,r)}function k(e,t){var n={bubbles:!1,cancelable:!1,detail:t},r=void 0;return"function"==typeof window.CustomEvent?r=new CustomEvent(e,n):(r=document.createEvent("CustomEvent")).initCustomEvent(e,n.bubbles,n.cancelable,n.detail),r}function w(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];var a=k(t,[].concat(r));e.dispatchEvent(a)}function C(e,t,n,r,i){if(!e.__vue_custom_element__){var a=t.util.extend({},n),s=function(e,t,n){var r=t.propsData||{};return n.hyphenate.forEach((function(t,i){var a=n.camelCase[i],s=e.attributes[t]||e[a],o=null;n.types[a]&&(o=n.types[a]),s instanceof Attr?r[a]=_(s.value,o):void 0!==s&&(r[a]=s)})),r}(e,a,r),o=t.version&&parseInt(t.version.split(".")[0],10)||0;if(a.beforeCreate=[].concat(a.beforeCreate||[],(function(){this.$emit=function(){for(var t,n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];w.apply(void 0,[e].concat(r)),this.__proto__&&(t=this.__proto__.$emit).call.apply(t,[this].concat(r))}})),a._compiled){var u={};a._Ctor&&(u=Object.values(a._Ctor)[0].options),u.beforeCreate=a.beforeCreate}var l=void 0;if(o>=2){var c=e.cloneNode(!0).childNodes;l={propsData:s,props:r.camelCase,computed:{reactiveProps:function(){var e=this,t={};return r.camelCase.forEach((function(n){void 0!==e[n]&&(t[n]=e[n])})),t}},render:function(e){var t={props:this.reactiveProps};return e(a,t,function(){var e=arguments[1],t=[];return g(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(n){if("#text"===n.nodeName)n.nodeValue.trim()&&t.push(e("span",n.nodeValue));else if("#comment"!==n.nodeName){var r=S(n),i={attrs:r,domProps:{innerHTML:""===n.innerHTML?n.innerText:n.innerHTML}};r.slot&&(i.slot=r.slot,r.slot=void 0);var a="TEMPLATE"===n.tagName?E(e,n,i):e(n.tagName,i);t.push(a)}})),t}(c,e))}}}else if(1===o)(l=a).propsData=s;else{l=a;var d={};Object.keys(s).forEach((function(e){d[e]={default:s[e]}})),l.props=d}var h=o>=2?"<div></div>":("<div>"+e.innerHTML+"</div>").replace(/vue-slot=/g,"slot=");if(i.shadow&&e.shadowRoot?(e.shadowRoot.innerHTML=h,l.el=e.shadowRoot.children[0]):(e.innerHTML=h,l.el=e.children[0]),function(e,t){t.camelCase.forEach((function(n,r){Object.defineProperty(e,n,{get:function(){return this.__vue_custom_element__[n]},set:function(e){if("object"!==(void 0===e?"undefined":y(e))&&"function"!=typeof e||!this.__vue_custom_element__){var n=t.types[t.camelCase[r]];this.setAttribute(t.hyphenate[r],_(e,n))}else{var i=t.camelCase[r];this.__vue_custom_element__[i]=e}}})}))}(e,r),"function"==typeof i.beforeCreateVueInstance&&(l=i.beforeCreateVueInstance(l)||l),e.__vue_custom_element__=new t(l),e.__vue_custom_element_props__=r,e.getVueInstance=function(){return e.__vue_custom_element__.$children[0]},i.shadow&&i.shadowCss&&e.shadowRoot){var f=document.createElement("style");f.type="text/css",f.appendChild(document.createTextNode(i.shadowCss)),e.shadowRoot.appendChild(f)}e.removeAttribute("vce-cloak"),e.setAttribute("vce-ready",""),w(e,"vce-ready")}}function A(e){e.customElement=function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i="function"==typeof n,a=i&&{props:r.props||[]},s=T(i?a:n),o=h(t,{constructorCallback:function(){"function"==typeof r.constructorCallback&&r.constructorCallback.call(this)},connectedCallback:function(){var a=this,o=i&&n(),u=o&&o.then&&"function"==typeof o.then;if("function"==typeof r.connectedCallback&&r.connectedCallback.call(this),i&&!u)throw new Error("Async component "+t+" do not returns Promise");this.__detached__||(u?o.then((function(t){var n=T(t);C(a,e,t,n,r),"function"==typeof r.vueInstanceCreatedCallback&&r.vueInstanceCreatedCallback.call(a)})):(C(this,e,n,s,r),"function"==typeof r.vueInstanceCreatedCallback&&r.vueInstanceCreatedCallback.call(this))),this.__detached__=!1},disconnectedCallback:function(){var e=this;this.__detached__=!0,"function"==typeof r.disconnectedCallback&&r.disconnectedCallback.call(this),null!==r.destroyTimeout&&setTimeout((function(){e.__detached__&&e.__vue_custom_element__&&(e.__vue_custom_element__.$destroy(!0),delete e.__vue_custom_element__,delete e.__vue_custom_element_props__)}),r.destroyTimeout||3e3)},attributeChangedCallback:function(e,t,n){if(this.__vue_custom_element__&&void 0!==n){var i=p(e);"function"==typeof r.attributeChangedCallback&&r.attributeChangedCallback.call(this,e,t,n);var a=this.__vue_custom_element_props__.types[i];this.__vue_custom_element__[i]=_(n,a)}},observedAttributes:s.hyphenate,shadow:!!r.shadow&&!!HTMLElement.prototype.attachShadow});return o}}"undefined"!=typeof window&&window.Vue&&(window.Vue.use(A),A.installed&&(A.installed=!1));var L=A,R=(n("OKyS"),n("LvDl")),x=n.n(R),I=n("Iab2"),O=n.n(I);videojs.options.controlBar={volumePanel:{inline:!1}},videojs.options.flash.swf="liveplayer.swf",videojs.options.techOrder=["html5","flash"],videojs.log.level("off"),flvjs.LoggingControl.enableAll=!1;var D={name:"live-player",data:function(){return{player:null,liveCheckTimer:0,hlsTimer:0,fluentBtnCls:"live-player-fluent-btn",stretchBtnCls:"live-player-stretch-btn",snapFromOutside:!1,snapForPoster:!1,snapForReload:!1,showSlot:!1,fluent_:!0,muted_:!0,stretch_:!1,poster_:"",subVideoUrl_:"",avLoading:!1,reloadCnt:0,updateTimeAt:0,startAt:0,playAt:0,pauseAt:0,pauseBgAt:0,endedAt:0,errorAt:0,flvMediaDataSource:{},flvConfig:{},resolutionName:{sd:"标清",hd:"高清",fhd:"超清",yh:"原画"},playbackRate_:1,fullscreen:!1,visible:!0,visibleChangeAt:0,speeds:[],zoomDrawing:!1}},props:{videoUrl:{type:String,default:""},subVideoUrl:{type:String,default:""},videoTitle:{type:String,default:""},poster:{default:""},autoplay:{type:Boolean,default:!0},live:{type:Boolean,default:!1},smart:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},currentTime:{type:Number,default:0},timeout:{type:Number,default:20},alt:{type:String,default:""},muted:{type:Boolean,default:!0},aspect:{type:String,default:"16:9"},videoBufferSize:{type:Number,default:204800},audioBufferSize:{type:Number,default:131072},hlsErrorSeek:{type:Number,default:5},hlsTestMethod:{type:String,default:"HEAD"},hlsTestInterval:{type:Number,default:1e3},reloadInterval:{type:Number,default:1e3},liveInterval:{type:Number,default:15e3},maxPauseSeconds:{type:Number,default:0},pauseWhenHidden:{type:Boolean,default:!0},fluent:{type:Boolean,default:!0},stretch:{type:Boolean,default:!1},loop:{type:Boolean,default:!1},controls:{type:Boolean,default:!0},hideBigPlayButton:{type:Boolean,default:!1},hideSnapshotButton:{type:Boolean,default:!1},hideFullscreenButton:{type:Boolean,default:!1},hideFluentButton:{type:Boolean,default:!1},hideStretchButton:{type:Boolean,default:!1},hidePicInPic:{type:Boolean,default:!0},hideWaiting:{type:Boolean,default:!0},hideLiveText:{type:Boolean,default:!1},showTime:{type:Boolean,default:function(){return!videojs.browser.IS_IOS&&!videojs.browser.IS_ANDROID}},showSpeed:{type:Boolean,default:!1},showCustomButton:{type:Boolean,default:!0},showCameraButton:{type:Boolean,default:!videojs.browser.IS_SAFARI&&!videojs.browser.IS_IOS&&!videojs.browser.IS_ANDROID},debug:{type:Boolean,default:!1},hasvideo:{type:Boolean,default:void 0},hasaudio:{type:Boolean,default:void 0},resolution:{type:String,default:""},resolutiondefault:{type:String,default:"hd"},playbackRates:{type:Array,default:function(){return videojs.browser.IS_IOS||videojs.browser.IS_ANDROID?[]:[.5,1,2,3]}},playbackRate:{type:Number,default:1},cors:{type:Boolean,default:!0},withCredentials:{type:Boolean,default:!1},customButtons:{type:String,default:""},autofocus:{type:Boolean,default:!1},dblclickFullscreen:{type:Boolean,default:!0},language:{type:String,default:navigator&&(navigator.languages&&navigator.languages[0]||navigator.userLanguage||navigator.language)||"en"},disableContextMenu:{type:Boolean,default:!1},water:{type:String,default:""},waterMark:{type:String,default:""},watermark:{type:String,default:""},wm:{type:String,default:""},waterFont:{type:String,default:""},waterColor:{type:String,default:"rgba(240, 240, 240, 0.25)"},waterWidth:{type:Number,default:256},waterHeight:{type:Number,default:144},waterRotate:{type:Number,default:-20*Math.PI/120},rotate:{type:Number,default:0},rotateX:{type:Number,default:0},rotateY:{type:Number,default:0},bgTimeout:{type:Number,default:0},digitalZoom:{type:Boolean,default:!1},digitalZoomColor:{type:String,default:"rgba(235, 235, 235, 0.8)"}},beforeDestroy:function(){this.destroyVideoJS()},deactivated:function(){this.destroyVideoJS()},watch:{videoUrl:function(e){this.videoUrl?this.poster_=this.poster:this.poster_="",this.smart&&!this.subVideoUrl&&this.videoUrl&&(0!=this.videoUrl.indexOf("webrtc")||/_sub(\?|$)/.test(this.videoUrl)?/.flv(\?|$)/.test(this.videoUrl)&&!/_sub.flv(\?|$)/.test(this.videoUrl)?this.subVideoUrl_=this.videoUrl.replace(/(.flv(\?|$))/,"_sub$1"):/\/live.m3u8(\?|$)/.test(this.videoUrl)&&!/_sub\/live.m3u8(\?|$)/.test(this.videoUrl)&&(this.subVideoUrl_=this.videoUrl.replace(/(\/live.m3u8(\?|$))/,"_sub$1")):this.subVideoUrl_=this.videoUrl.replace(/(\?|$)/,"_sub$1")),this.videoUrl||this.subVideoUrl||(this.subVideoUrl_=""),this.reload()},subVideoUrl:function(e){this.subVideoUrl_=this.subVideoUrl,this.smart&&!this.subVideoUrl_&&this.videoUrl&&(0!=this.videoUrl.indexOf("webrtc")||/_sub(\?|$)/.test(this.videoUrl)?/.flv(\?|$)/.test(this.videoUrl)&&!/_sub.flv(\?|$)/.test(this.videoUrl)?this.subVideoUrl_=this.videoUrl.replace(/(.flv(\?|$))/,"_sub$1"):/\/live.m3u8(\?|$)/.test(this.videoUrl)&&!/_sub\/live.m3u8(\?|$)/.test(this.videoUrl)&&(this.subVideoUrl_=this.videoUrl.replace(/(\/live.m3u8(\?|$))/,"_sub$1")):this.subVideoUrl_=this.videoUrl.replace(/(\?|$)/,"_sub$1")),this.videoUrl||this.subVideoUrl||(this.subVideoUrl_=""),this.reload()},fullscreen:function(e){this.videoUrl&&this.subVideoUrl_&&this.videoUrl!=this.subVideoUrl_&&(this.webrtc&&0==this.videoUrl.indexOf("webrtc")&&0==this.subVideoUrl_.indexOf("webrtc")?this.rtcReloadTech():(this.http||this.ws)&&this.flv&&/\.flv.*$/.test(this.videoUrl)&&/\.flv.*$/.test(this.subVideoUrl_)&&this.flvReloadTech())},fluent:function(e){this.fluent_=e,this.reload()},muted:function(e){this.muted_=e,this.reload()},stretch:function(e){this.stretch_=e,this.reload()},poster:function(e){this.poster_=e},loop:function(e){this.reload()},currentTime:function(e){this.player&&this.player.currentTime(e)},language:function(e){this.reload()}},mounted:function(){this.muted_=this.muted,this.fluent_=this.fluent,this.stretch_=this.stretch,this.poster_=this.poster,this.playbackRate_=this.playbackRate,this.subVideoUrl_=this.subVideoUrl,this.smart&&!this.subVideoUrl_&&this.videoUrl&&(0!=this.videoUrl.indexOf("webrtc")||/_sub(\?|$)/.test(this.videoUrl)?/.flv(\?|$)/.test(this.videoUrl)&&!/_sub.flv(\?|$)/.test(this.videoUrl)?this.subVideoUrl_=this.videoUrl.replace(/(.flv(\?|$))/,"_sub$1"):/\/live.m3u8(\?|$)/.test(this.videoUrl)&&!/_sub\/live.m3u8(\?|$)/.test(this.videoUrl)&&(this.subVideoUrl_=this.videoUrl.replace(/(\/live.m3u8(\?|$))/,"_sub$1")):this.subVideoUrl_=this.videoUrl.replace(/(\?|$)/,"_sub$1")),this.debug&&(videojs.log.level("info"),flvjs.LoggingControl.enableAll=!0),this.initVideoJS()},computed:{videoType:function(){var e="video/mp4";return this.rtmp?e="rtmp/mp4":(this.http||this.ws)&&this.flv?e="video/x-flv":this.m3u8&&(e="application/x-mpegURL"),e},videoWrapperStyle:function(){if("100%"==this.aspect||"fullscreen"==this.aspect)return{width:"100%",height:"100%"};var e=this.aspect.split(":"),t=parseInt(e[0])||16;return{paddingBottom:(parseInt(e[1])||9)/t*100+"%",position:"relative",margin:"0 auto",overflow:"hidden"}},waterStyle:function(){return this.waterText?{background:"url("+this.createBase64()+") left top repeat"}:{}},waterText:function(){return this.water||this.waterMark||this.watermark||this.wm},rtmp:function(){return 0==(this.src||"").indexOf("rtmp")},http:function(){return 0==(this.src||"").indexOf("http")},webrtc:function(){return 0==(this.src||"").indexOf("webrtc")},ws:function(){return 0==(this.src||"").indexOf("ws")},mp4:function(){return/\.mp4.*$/.test(this.src||"")},m3u8:function(){return/\.m3u8.*$/.test(this.src||"")},flv:function(){return/\.flv.*$/.test(this.src||"")},alt2:function(){return this.alt?this.alt:"zh-CN"===this.language?"无信号":"No Video"},src:function(){var e=this.subVideoUrl_||this.videoUrl;return this.fullscreen&&(e=this.videoUrl||this.subVideoUrl_),e?0===e.indexOf("//")?location.protocol+e:0===e.indexOf("/")?location.protocol+"//"+location.host+e:e:""},blankHtml:function(){return this.poster_&&this.src?'\n <div class="alt" style="background-image:url(\''+this.poster_+"');\">\n </div>\n ":'\n <div class="alt">\n <table>\n <tr>\n <td>'+this.alt2+"</td>\n </tr>\n </table>\n </div>\n "},videoHtml:function(){return this.src?this.rtmp||this.http||this.flv||this.mp4||this.webrtc?'\n <video class="video-js vjs-default-skin vjs-big-play-centered" style="width: 100%; height: 100%; '+(this.stretch_?"object-fit: fill;":"")+'"\n webkit-playsinline="" playsinline="" x-webkit-airplay="allow" x5-playsinline=""\n preload="none" poster="'+this.poster_+'" '+(this.muted_?"muted":"")+" "+(this.loop?"loop":"")+'>\n <source src="'+this.src+'" type="'+this.videoType+'"></source>\n <p class="vjs-no-js">\n To view this video please enable JavaScript, and consider upgrading to a web browser that\n <a href="http://videojs.com/html5-video-support/" target="_blank">\n supports HTML5 video\n </a>\n </p>\n </video>\n ':'\n <canvas style="width: 100%; height: 100%;"></canvas>\n ':this.blankHtml}},methods:{isMobile:function(){return videojs.browser.IS_IOS||videojs.browser.IS_ANDROID},hasUsableSWF:function(){return!!(void 0!==window.ActiveXObject?new ActiveXObject("ShockwaveFlash.ShockwaveFlash"):navigator.plugins["Shockwave Flash"])},reload:function(){this.reloadCnt++,this.debug&&console.log((new Date).toLocaleString()+" "+this.src+" reload["+this.reloadCnt+"]"),this.destroyVideoJS(),this.initVideoJS()},flvError:function(e){var t=this;this.debug&&console.log((new Date).toLocaleString()+" "+this.src+" error",e),this.$emit("error",e),this.live&&this.src&&this.reloadInterval>0&&(this.reloadCnt?setTimeout((function(){t.flvReload()}),this.reloadInterval):this.flvReload())},flvReload:function(){this.player&&(this.avLoading=!0,!this.endedAt&&!this.player.isFullscreen()&&this.player.cameraButton&&this.visible?this.snapForReload||(this.debug&&console.log((new Date).toLocaleString()+" "+this.src+" snap reload"),this.snapForReload=!0,this.pauseAt=0,this.player.cameraButton.el().click()):this.flvReloadTech())},flvReloadTech:function(){var e=this;if(this.debug&&console.log((new Date).toLocaleString()+" "+this.src+" tech reload"),this.reloadCnt++,this.pauseAt=0,this.player.tech_.flvPlayer.unload(),this.player.tech_.flvPlayer.detachMediaElement(),this.player.tech_.flvPlayer.destroy(),this.player.tech_.flvPlayer=window.flvjs.createPlayer(Object.assign({},this.flvMediaDataSource,{type:void 0===this.flvMediaDataSource.type?"flv":this.flvMediaDataSource.type,url:this.getVideoUrl()}),this.flvConfig),this.player.tech_.flvPlayer.attachMediaElement(this.player.tech_.el_),this.player.tech_.flvPlayer.on("error",(function(t){e.flvError(t)})),this.player.tech_.flvPlayer.on("media_info",(function(t){e.$emit("media_info",t)})),this.showSpeed){var t=null;this.player.tech_.flvPlayer.on("statistics_info",(function(n){if(n&&n.speed)if(e.speeds.length<3){if(e.speeds.push(n.speed),!t){var r=e.$el.querySelectorAll(".video-js .vjs-control-bar .vjs-live-display");r.length>0&&(t=r[0])}}else if(t){e.speeds.shift(),e.speeds.push(n.speed);for(var i=0,a=0;a<e.speeds.length;a++)i+=e.speeds[a]||0;var s=i/e.speeds.length;s=8*s.toFixed(0),t.innerHTML=s+"Kbps"}}))}this.player.tech_.flvPlayer.load()},rtcError:function(e){var t=this;this.live&&this.src&&this.reloadInterval>0&&setTimeout((function(){t.rtcReload()}),this.reloadInterval)},rtcReload:function(){this.player&&(this.avLoading=!0,!this.endedAt&&!this.player.isFullscreen()&&this.player.cameraButton&&this.visible?this.snapForReload||(this.debug&&console.log((new Date).toLocaleString()+" "+this.src+" snap reload"),this.snapForReload=!0,this.pauseAt=0,this.player.cameraButton.el().click()):this.rtcReloadTech())},rtcReloadTech:function(){this.debug&&console.log((new Date).toLocaleString()+" "+this.src+" tech reload"),this.reloadCnt++,this.pauseAt=0,this.player.tech_.src=this.getVideoUrl(),this.player.tech_.reload()},loadResolutionlist:function(e){var t=this;if(""!=this.resolution){for(var n,r=this.resolution.split(","),i=[],a=0;a<r.length;a++)r[a]==this.resolutiondefault&&a,n="yh"==r[a]?this.videoUrl:this.videoUrl.replace(".m3u8","_"+r[a]+".m3u8"),i.push({src:n,type:this.videoType,label:this.resolutionName[r[a]],res:r[a]});e.updateSrc(i),e.on("resolutionchange",(function(){t.debug&&console.log("change resolution")}))}},getCustomBtn:function(e){var t=this.$el.querySelectorAll(".video-js .vjs-control-bar .vjs-button."+e);return t.length>0?t[0]:null},customFlashButton:function(){var e=this;if(!this.getCustomBtn(this.fluentBtnCls)){for(var t=(i=this.player.controlBar.children().length)-1;t>=0;t--)if("FullscreenToggle"==this.player.controlBar.children()[t].name_)i=t;else if("SnapButton"==this.player.controlBar.children()[t].name_){i=t;break}var n=this.player.controlBar.addChild("button",{},i);n.name_="FluentButton",n.el_.classList.add(this.fluentBtnCls),n.el_.innerText=this.fluent_?this.player.localize("Fluent"):this.player.localize("Fast"),n.el_.title=this.fluent_?this.player.localize("Click switch to fast play"):this.player.localize("Click switch to fluent play");var r=function(){e.fluent_=!e.fluent_,n.el_.innerText=e.fluent_?e.player.localize("Fluent"):e.player.localize("Fast"),n.el_.title=e.fluent_?e.player.localize("Click switch to fast play"):e.player.localize("Click switch to fluent play"),e.player.tech_.setFluent(e.fluent_)};n.on("click",r),n.on("tap",r)}if(!this.getCustomBtn(this.stretchBtnCls)){var i;for(t=(i=this.player.controlBar.children().length)-1;t>=0;t--)if("FullscreenToggle"==this.player.controlBar.children()[t].name_)i=t;else if("SnapButton"==this.player.controlBar.children()[t].name_)i=t;else if("FluentButton"==this.player.controlBar.children()[t].name_){i=t;break}var a=this.player.controlBar.addChild("button",{},i);a.name_="StretchButton",a.el_.classList.add(this.stretchBtnCls),a.el_.innerText=this.stretch_?this.player.localize("STR"):this.player.localize("STD"),a.el_.title=this.stretch_?this.player.localize("Click switch to standard display"):this.player.localize("Click switch to stretch display");r=function(){e.stretch_=!e.stretch_,a.el_.innerText=e.stretch_?e.player.localize("STR"):e.player.localize("STD"),a.el_.title=e.stretch_?e.player.localize("Click switch to standard display"):e.player.localize("Click switch to stretch display"),e.player.tech_.setStretch(e.stretch_)};a.on("click",r),a.on("tap",r)}},customH5Button:function(){var e=this;if(!this.getCustomBtn(this.stretchBtnCls)&&!videojs.browser.IE_VERSION){for(var t=this.player.controlBar.children().length,n=t-1;n>=0;n--)if("FullscreenToggle"==this.player.controlBar.children()[n].name_)t=n;else if("SnapButton"==this.player.controlBar.children()[n].name_){t=n;break}var r=this.player.controlBar.addChild("button",{},t);r.name_="StretchButton",r.el_.classList.add(this.stretchBtnCls),r.el_.innerText=this.stretch_?this.player.localize("STR"):this.player.localize("STD"),r.el_.title=this.stretch_?this.player.localize("Click switch to standard display"):this.player.localize("Click switch to stretch display");var i=function(){e.stretch_=!e.stretch_,r.el_.innerText=e.stretch_?e.player.localize("STR"):e.player.localize("STD"),r.el_.title=e.stretch_?e.player.localize("Click switch to standard display"):e.player.localize("Click switch to stretch display");var t=e.$el.querySelector("video");t?t.style.objectFit=e.stretch_?"fill":"":e.player.tech_.setStretch(e.stretch_)};r.on("click",i),r.on("tap",i)}this.addCustomButtons()},addCustomButtons:function(){var e=this;if(""!=this.customButtons){for(var t=this.player.controlBar.children().length,n=t-1;n>=0;n--)if("FullscreenToggle"==this.player.controlBar.children()[n].name_)t=n;else if("SnapButton"==this.player.controlBar.children()[n].name_)t=n;else if("StretchButton"==this.player.controlBar.children()[n].name_){t=n;break}var r=this.customButtons.split(",");for(n=r.length-1;n>=0;n--){var i=r[n].split(":"),a=this.player.controlBar.addChild("button",{},t);a.el_.innerHTML=i.length>1?"<i class='"+i[1]+"'></i>":r[n],a.el_.title=i[0],a.name_=i[0];var s=function(t){e.$emit("customButtons",(t.currentTarget||t.target).getAttribute("title"))};a.on("click",s),a.on("tap",s)}}},hotkeysOpt:function(){var e={volumeStep:.1,seekStep:5,enableModifiersForNumbers:!1,enableVolumeScroll:!1};return this.autofocus||(e.skipInitialFocus=!0,e.enableInactiveFocus=!1),e},destroyVideoJS:function(){this.liveCheckTimer&&(clearInterval(this.liveCheckTimer),this.liveCheckTimer=0),this.hlsTimer&&(clearTimeout(this.hlsTimer),this.hlsTimer=0),document.removeEventListener("visibilitychange",this.onVisibleChange),this.updateTimeAt=0,this.startAt=0,this.playAt=0,this.pauseAt=0,this.pauseBgAt=0,this.endedAt=0,this.errorAt=0,this.visibleChangeAt=0,this.showSlot=!1;var e=this.$el.querySelector(".video-js"),t=this.$el.querySelector(".video-wrapper");if(e&&t){var n=e.querySelector(".video-water");n&&(e.removeChild(n),t.appendChild(n));var r=e.querySelector(".video-slot");r&&(e.removeChild(r),t.appendChild(r));var i=e.querySelector(".video-title");i&&(e.removeChild(i),t.appendChild(i))}this.player&&this.player.dispose&&(this.player.dispose(),this.player=null),this.player&&this.player.destroy&&(this.player.destroy(),this.player=null),this.flvMediaDataSource={},this.flvConfig={},this.$el.querySelector(".video-inner").innerHTML=this.blankHtml,this.$emit("update:loading",!1)},getCurrentTime:function(){return this.player&&"function"==typeof this.player.currentTime?this.player.currentTime():-1},setCurrentTime:function(e){this.player&&"function"==typeof this.player.currentTime&&this.player.currentTime(e)},snap:function(){this.player&&this.player.cameraButton?(this.snapFromOutside=!0,this.player.cameraButton.el().click()):console.log("snap not support")},play:function(){this.player&&this.player.play()},pause:function(){this.player&&this.player.pause()},paused:function(){return!!this.player&&this.player.paused()},setMuted:function(e){this.player&&this.player.muted(!!e)},getMuted:function(){return!!this.player&&this.player.muted()},setVolume:function(e){this.player&&this.player.volume(e)},getVolume:function(){return this.player?this.player.volume():0},setDuration:function(e){this.player&&this.player.duration(e)},getDuration:function(){return this.player?this.player.duration():0},getPlayer:function(){return this.player},getMediaInfo:function(){try{return this.player.tech_.flvPlayer._transmuxer._controller._demuxer._mediaInfo}catch(e){}return{}},isFullscreen:function(){return!!this.player&&this.player.isFullscreen()},getVideoUrl:function(){var e=this.subVideoUrl_||this.videoUrl;return this.isFullscreen()&&(e=this.videoUrl||this.subVideoUrl_),e?0===e.indexOf("//")?location.protocol+e:0===e.indexOf("/")?location.protocol+"//"+location.host+e:e:""},requestFullscreen:function(){this.player&&this.player.requestFullscreen()},exitFullscreen:function(){this.player&&this.player.exitFullscreen()},toggleFullscreen:function(){this.player&&(this.player.isFullscreen()?this.player.exitFullscreen():this.player.requestFullscreen())},convertDataURIToBinary:function(e){for(var t=";base64,",n=e.indexOf(t)+t.length,r=e.substring(n),i=window.atob(r),a=i.length,s=new Uint8Array(a),o=0;o<a;o++)s[o]=i.charCodeAt(o);return s},convertDataURIToMIME:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t="data:",n=";base64,",r=e.indexOf(t);0==r&&(r+=t.length);var i=e.indexOf(n);return r>=0&&i>r?e.substring(r,i):""},saveFile:function(e){if(e&&e.length>100){this.poster_=e;var t=this.$el.querySelector("video");t&&t.setAttribute("poster",e)}if(this.snapForReload)return this.snapForReload=!1,void this.reload();if(this.snapForPoster)this.snapForPoster=!1;else{if(this.snapFromOutside)return this.$emit("snapOutside",e),void(this.snapFromOutside=!1);if(this.$emit("snapInside",e),e&&e.length>100){var n=this.convertDataURIToBinary(e),r=this.convertDataURIToMIME(e),i=".jpg",a=r.indexOf("/");a>0&&(i="."+r.substring(a+1)),O.a.saveAs(new Blob([n],{type:r}),(this.videoTitle||"snap")+"_"+(new Date).getTime()+i)}}},onVisibleChange:function(){this.visible="visible"===document.visibilityState,this.debug&&console.log((new Date).toLocaleString()+" "+this.src+" visible["+this.visible+"]");var e=this.visibleChangeAt;if(this.visibleChangeAt=(new Date).getTime(),this.visible&&this.live&&this.videoUrl){var t;if(this.bgTimeout>0&&e)if((t=(new Date).getTime()-e)>=this.bgTimeout&&this.src&&(!this.player||!this.player.isFullscreen()))return this.debug&&console.log((new Date).toLocaleString()+" "+this.src+" visible bg timeout reload d = "+t),void this.reload();if(this.liveInterval>0&&this.pauseBgAt)if((t=(new Date).getTime()-this.pauseBgAt)>=this.liveInterval&&this.src&&(!this.player||!this.player.isFullscreen()))return this.debug&&console.log((new Date).toLocaleString()+" "+this.src+" visible bg pause reload d = "+t),void this.reload()}},debounceInitVideoJS:x.a.debounce((function(){this.initVideoJS()}),500),initVideoJSOK:function(){var e=this;this.player&&(document.addEventListener("visibilitychange",this.onVisibleChange),this.player.muted(this.muted_),this.player.on("pause",(function(){e.updateTimeAt=0,e.pauseAt=(new Date).getTime(),e.visible||(e.pauseBgAt=e.pauseAt),e.$emit("pause",e.player.currentTime()),e.debug&&console.log((new Date).toLocaleString()+" "+e.src+" pause")})),this.player.on("snap",(function(t,n){e.saveFile(n)})),this.player.on("volumechange",(function(t,n){e.muted_=e.player.muted()})),this.player.on("fullscreenchange",(function(){setTimeout((function(){e.fullscreen=e.isFullscreen(),e.$emit("fullscreen",e.fullscreen)}),0)})),(this.waterText||this.disableContextMenu)&&(this.player.tech_.el_.oncontextmenu=function(e){e.preventDefault()}),this.rotate&&(this.player.tech_.el_.style.transform="rotate("+this.rotate+"deg)"),this.rotateX&&(this.player.tech_.el_.style.transform="rotateX("+this.rotateX+"deg)"),this.rotateY&&(this.player.tech_.el_.style.transform="rotateY("+this.rotateY+"deg)"),this.startAt=(new Date).getTime(),this.initDigitalZoom());var t=this.$el.querySelector(".video-js"),n=this.$el.querySelector(".video-wrapper");if(t&&n){var r=n.querySelector(".video-water");r&&(n.removeChild(r),t.appendChild(r));var i=n.querySelector(".video-slot");i&&(n.removeChild(i),t.appendChild(i));var a=n.querySelector(".video-title");a&&(n.removeChild(a),t.appendChild(a))}this.showSlot=!0},initVideoJS:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.$el.querySelector(".video-inner").innerHTML=this.videoHtml,this.src){if(this.startAt=(new Date).getTime(),this.rtmp){var n=document.title;this.player=videojs(this.$el.querySelector("video"),{notSupportedMessage:"您的浏览器没有安装或开启Flash",tech:["flash"],autoplay:this.autoplay,stretch:this.stretch,fluent:this.fluent,controls:!0,userActions:{doubleClick:this.dblclickFullscreen},language:this.language}),this.showCameraButton&&!this.waterText&&this.player.snapshot(),this.player.one("ready",(function(){if(e.initVideoJSOK(),videojs.browser.IE_VERSION&&e.player.tech_.off("fullscreentoggle"),e.$emit("update:loading",!1),document.title=n,e.player.hotkeys(e.hotkeysOpt()),e.player.on("ended",(function(){e.endedAt=(new Date).getTime(),e.$emit("ended"),e.debug&&console.log((new Date).toLocaleString()+" "+e.src+" ended")})),e.player.on("error",(function(t){e.errorAt=(new Date).getTime(),e.$emit("error",t)})),e.player.on("timeupdate",(function(){e.updateTimeAt=(new Date).getTime(),e.pauseAt=0,e.endedAt=0,e.errorAt=0,e.reloadCnt=0,e.$emit("timeupdate",e.player.currentTime())})),e.player.on("playing",(function(){e.playAt=(new Date).getTime(),e.$emit("play",e.player.currentTime()),e.debug&&console.log((new Date).toLocaleString()+" "+e.src+" playing")})),e.showCustomButton&&e.customFlashButton(),!e.hasUsableSWF()){var t=e.$el.querySelector(".vjs-poster");t&&(t.style.display="none")}document.getElementsByClassName("vjs-picture-in-picture-control")[0].style.display="none"})),document.title=n,this.player.on("error",(function(t){(t=e.$el.querySelector(".vjs-error .vjs-error-display .vjs-modal-dialog-content")).innerHTML="<a href='http://www.adobe.com/go/getflashplayer' target='_blank'>"+t.textContent+"</a>"}))}else if((this.http||this.ws)&&this.flv)this.flvMediaDataSource={isLive:this.live,cors:this.cors,withCredentials:this.withCredentials},this.flvConfig={enableWorker:!1,enableStashBuffer:!1},videojs.browser.IE_VERSION&&(this.flvConfig.enableStashBuffer=!0,this.flvConfig.stashInitialSize=512e3),null!=this.hasaudio&&(this.flvMediaDataSource.hasAudio=this.hasaudio),null!=this.hasvideo&&(this.flvMediaDataSource.hasVideo=this.hasvideo),this.player=videojs(this.$el.querySelector("video"),{techOrder:["flvjs","html5"],controls:!0,flvjs:{mediaDataSource:this.flvMediaDataSource,config:this.flvConfig},userActions:{doubleClick:this.dblclickFullscreen},language:this.language}),this.showCameraButton&&!this.waterText&&this.player.snapshot(),this.player.one("ready",(function(){if(e.initVideoJSOK(),e.$emit("update:loading",!1),e.stretch_&&(e.player.tech_.el_.style.objectFit="fill"),e.player.hotkeys(e.hotkeysOpt()),e.player.tech_.flvPlayer.on("error",(function(t){e.errorAt=(new Date).getTime(),e.flvError(t)})),e.player.tech_.flvPlayer.on("media_info",(function(t){e.$emit("media_info",t)})),e.showSpeed){var t=null;e.player.tech_.flvPlayer.on("statistics_info",(function(n){if(n&&n.speed)if(e.speeds.length<3){if(e.speeds.push(n.speed),!t){var r=e.$el.querySelectorAll(".video-js .vjs-control-bar .vjs-live-display");r.length>0&&(t=r[0])}}else if(t){e.speeds.shift(),e.speeds.push(n.speed);for(var i=0,a=0;a<e.speeds.length;a++)i+=e.speeds[a]||0;var s=i/e.speeds.length;s=8*s.toFixed(0),t.innerHTML=s+"Kbps"}}))}e.player.on("canplay",(function(){e.autoplay&&e.player.tech_.flvPlayer.play().catch((function(){}))})),e.player.on("timeupdate",(function(){e.updateTimeAt=(new Date).getTime(),e.pauseAt=0,e.endedAt=0,e.errorAt=0;var t=e.player.currentTime();!e.snapForPoster&&!e.poster_&&t>2&&e.player.cameraButton&&(e.snapForPoster=!0,e.player.cameraButton.el().click()),e.reloadCnt=0,e.$emit("timeupdate",t)})),e.player.on("error",(function(t){e.errorAt=(new Date).getTime(),e.player.error_&&4===e.player.error_.code?e.flvError("MediaError"):e.flvError(e.player.error_||t)})),e.player.on("ended",(function(){e.endedAt=(new Date).getTime(),e.live&&e.flvError("ended"),e.$emit("ended"),e.debug&&console.log((new Date).toLocaleString()+" "+e.src+" ended")})),e.player.on("playing",(function(){e.playAt=(new Date).getTime(),e.avLoading=!1,e.$emit("play",e.player.currentTime()),e.debug&&console.log((new Date).toLocaleString()+" "+e.src+" playing")})),e.showCustomButton&&e.customH5Button()}));else if(this.http&&this.m3u8){var r=(new Date).getTime(),i=function(){if(!e.player){var n=document.title;""!=e.resolution?(-1==e.resolution.indexOf(e.resolutiondefault)&&(e.resolutiondefault="yh"),e.player=videojs(e.$el.querySelector("video"),{autoplay:e.autoplay,stretch:e.stretch,controls:!0,plugins:{videoJsResolutionSwitcher:{default:e.resolutiondefault,dynamicLabel:!0}},playbackRates:e.live?[]:e.playbackRates,userActions:{doubleClick:e.dblclickFullscreen},language:e.language}),e.loadResolutionlist(e.player)):e.player=videojs(e.$el.querySelector("video"),{autoplay:e.autoplay,stretch:e.stretch,controls:!0,playbackRates:e.live?[]:e.playbackRates,userActions:{doubleClick:e.dblclickFullscreen},language:e.language}),e.live||1==e.playbackRate_||e.player.playbackRate(e.playbackRate_),e.player.on("ratechange",(function(){e.playbackRate_=e.player.playbackRate()})),e.showCameraButton&&!e.waterText&&e.player.snapshot(),e.player.one("ready",(function(){if(e.initVideoJSOK(),e.avLoading=!1,e.$emit("update:loading",!1),document.title=n,e.player.hotkeys(e.hotkeysOpt()),e.player.on("ended",(function(){e.endedAt=(new Date).getTime(),e.$emit("ended"),e.debug&&console.log((new Date).toLocaleString()+" "+e.src+" ended")})),e.player.on("timeupdate",(function(){e.updateTimeAt=(new Date).getTime(),e.pauseAt=0,e.endedAt=0,e.errorAt=0,e.reloadCnt=0,e.$emit("timeupdate",e.player.currentTime())})),e.player.on("play",(function(){e.player.removeClass("vjs-has-started"),e.debug&&console.log((new Date).toLocaleString()+" "+e.src+" play")})),e.player.on("playing",(function(){e.player.addClass("vjs-has-started"),e.playAt=(new Date).getTime(),e.$emit("play",e.player.currentTime()),e.debug&&console.log((new Date).toLocaleString()+" "+e.src+" playing")})),e.player.tech().on("usage",(function(t){e.debug&&console.log((new Date).toLocaleString()+" "+e.src+" hls usage",t),t&&"hls-live-resync"===t.name&&e.$emit("error",t.name)})),e.player.one("unknow-segment-type",(function(t){e.debug&&(console.log((new Date).toLocaleString()+" "+e.src+" hls unknow-segment-type, reload"),t&&t.name&&console.log("unknow-segment-type: "+t.name)),e.reloadInterval>0&&setTimeout((function(){e.destroyVideoJS(),e.initVideoJS()}),e.reloadInterval/2)})),e.player.one("error",(function(t,n){e.errorAt=(new Date).getTime();var r=e.player.tech();if(r&&"livehls"==r.name_){var i=r.error();i&&3===i.code&&(t="MediaError")}if(e.$emit("error",t),e.live)e.reloadInterval>0&&setTimeout((function(){e.destroyVideoJS(),e.initVideoJS()}),e.reloadInterval);else if(e.hlsErrorSeek>0){var a=e.player.currentTime()+e.hlsErrorSeek;e.destroyVideoJS(),e.initVideoJS(a)}})),document.title=n,e.live)e.player&&e.player.reloadSourceOnError();else if(e.player&&(e.currentTime>0||t>0)){var r=t||e.currentTime;videojs.browser.IE_VERSION?e.player.on("loadeddata",(function(){setTimeout((function(){e.player.currentTime(r)}),500)})):e.isMobile()?setTimeout((function(){var t=e.$el.querySelector("video");t&&(t.currentTime=r)}),3200):e.player.currentTime(r)}e.autoplay&&setTimeout((function(){var t=e.$el.querySelector(".vjs-big-play-button");if(t){var n=window.getComputedStyle(t);n&&"block"===n.display&&t.click()}}),2e3),e.showCustomButton&&e.customH5Button()}))}},a=function t(){var n=(new Date).getTime();if(e.timeout>0&&n-r>1e3*e.timeout)return e.hlsTimer&&clearTimeout(e.hlsTimer),e.hlsTimer=0,e.$emit("update:loading",!1),e.avLoading=!1,void e.$emit("message",{type:"error",message:"加载播放资源失败"});if(!e.src)return e.hlsTimer&&clearTimeout(e.hlsTimer),e.hlsTimer=0,e.$emit("update:loading",!1),void(e.avLoading=!1);e.$emit("update:loading",!0);var a=new XMLHttpRequest;a.open(e.hlsTestMethod,e.src,!0),a.onreadystatechange=function(){4==a.readyState&&(a.status>=200&&a.status<300||304===a.status?(e.hlsTimer&&clearTimeout(e.hlsTimer),e.hlsTimer=0,i()):(e.debug&&console.log((new Date).toLocaleString()+" "+e.src+" HLS "+e.hlsTestMethod,a.status,a.statusText),e.hlsTimer=setTimeout(t,e.hlsTestInterval)))},a.send()};this.live&&this.hlsTestMethod&&this.hlsTestInterval>0?a():i()}else this.webrtc?(this.player=videojs(this.$el.querySelector("video"),{techOrder:["webrtc","html5"],autoplay:this.autoplay,stretch:this.stretch,controls:!0,webrtc:{debug:this.debug,autoplay:this.autoplay},userActions:{doubleClick:this.dblclickFullscreen},language:this.language}),this.showCameraButton&&!this.waterText&&this.player.snapshot(),this.player.one("ready",(function(){e.initVideoJSOK(),e.$emit("update:loading",!1),e.stretch_&&(e.player.tech_.el_.style.objectFit="fill"),e.player.hotkeys(e.hotkeysOpt()),e.player.on("error",(function(t){e.errorAt=(new Date).getTime(),e.$emit("error",t),e.rtcError(t),e.debug&&console.log((new Date).toLocaleString()+" "+e.src+" player error",t)})),e.player.tech().on("error",(function(t){e.errorAt=(new Date).getTime(),e.$emit("error",t),e.rtcError(t),e.debug&&console.log((new Date).toLocaleString()+" "+e.src+" rtc error",t)})),e.player.on("timeupdate",(function(){e.updateTimeAt=(new Date).getTime(),e.pauseAt=0,e.endedAt=0,e.errorAt=0;var t=e.player.currentTime();!e.snapForPoster&&!e.poster_&&t>2&&e.player.cameraButton&&(e.snapForPoster=!0,e.player.cameraButton.el().click()),e.reloadCnt=0,e.$emit("timeupdate",t)})),e.player.on("ended",(function(){e.endedAt=(new Date).getTime(),e.live&&e.rtcError("ended"),e.$emit("ended"),e.debug&&console.log((new Date).toLocaleString()+" "+e.src+" ended")})),e.player.on("playing",(function(){e.playAt=(new Date).getTime(),e.avLoading=!1,e.$emit("play",e.player.currentTime()),e.debug&&console.log((new Date).toLocaleString()+" "+e.src+" playing")})),e.showCustomButton&&e.customH5Button()}))):(this.player=videojs(this.$el.querySelector("video"),{autoplay:this.autoplay,stretch:this.stretch,controls:!0,playbackRates:this.live?[]:this.playbackRates,userActions:{doubleClick:this.dblclickFullscreen},language:this.language}),this.live||1==this.playbackRate_||this.player.playbackRate(this.playbackRate_),this.player.on("ratechange",(function(){e.playbackRate_=e.player.playbackRate()})),this.showCameraButton&&!this.waterText&&this.player.snapshot(),this.player.one("ready",(function(){e.initVideoJSOK(),e.$emit("update:loading",!1),e.stretch_&&(e.player.tech_.el_.style.objectFit="fill"),e.player.hotkeys(e.hotkeysOpt()),e.showCustomButton&&e.customH5Button(),e.player.on("ended",(function(){e.endedAt=(new Date).getTime(),e.$emit("ended"),e.debug&&console.log((new Date).toLocaleString()+" "+e.src+" ended")})),e.player.on("timeupdate",(function(){e.updateTimeAt=(new Date).getTime(),e.pauseAt=0,e.endedAt=0,e.errorAt=0,e.reloadCnt=0,e.$emit("timeupdate",e.player.currentTime())})),e.player.on("playing",(function(){e.playAt=(new Date).getTime(),e.avLoading=!1,e.$emit("play",e.player.currentTime()),e.debug&&console.log((new Date).toLocaleString()+" "+e.src+" playing")})),e.player.on("error",(function(t){e.errorAt=(new Date).getTime(),e.$emit("error",t)}))})));if(this.live&&this.liveInterval>0&&!(this.isMobile()&&this.http&&this.m3u8)){this.liveCheckTimer&&(clearInterval(this.liveCheckTimer),this.liveCheckTimer=0);var s=0;this.liveCheckTimer=setInterval((function(){if(!e.updateTimeAt){if(!e.playAt){var t=(new Date).getTime()-e.startAt;return e.debug&&console.log((new Date).toLocaleString()+" "+e.src+" live check never play d = "+t),void(!(t>=e.liveInterval&&e.src)||e.player&&e.player.isFullscreen()||(e.debug&&console.log((new Date).toLocaleString()+" "+e.src+" live check never play reload d = "+t),e.reload()))}if(e.pauseAt&&!e.errorAt&&!e.endedAt){t=(new Date).getTime()-e.pauseAt;return e.debug&&console.log((new Date).toLocaleString()+" "+e.src+" live check pause d = "+t),void(!(e.maxPauseSeconds>0&&t>=1e3*e.maxPauseSeconds&&e.src)||e.player&&e.player.isFullscreen()||(e.debug&&console.log((new Date).toLocaleString()+" "+e.src+" live check pause reload d = "+t),e.reload()))}return s++,e.debug&&console.log((new Date).toLocaleString()+" "+e.src+" live check update time error cnt = "+s),void(!(s>=3&&e.src)||e.player&&e.player.isFullscreen()||(e.debug&&console.log((new Date).toLocaleString()+" "+e.src+" live check update time error reload cnt = "+s),e.reload()))}s=0;t=(new Date).getTime()-e.updateTimeAt;e.debug&&console.log((new Date).toLocaleString()+" "+e.src+" live check d = "+t),!(t>=e.liveInterval&&e.src)||e.player&&e.player.isFullscreen()||(e.debug&&console.log((new Date).toLocaleString()+" "+e.src+" live check reload d = "+t),e.reload())}),this.liveInterval)}}},createBase64:function(){var e=this.waterWidth,t=this.waterHeight,n=document.createElement("canvas"),r=n.getContext("2d");if(r){r.fillStyle=this.waterColor,r.textAlign="left",r.textBaseline="middle";var i=24;this.waterFont?r.font=this.waterFont:(r.font="24px Arial, Helvetica, sans-serif",r.measureText(this.waterText+"田").width>e&&(i=20,r.font="20px Arial, Helvetica, sans-serif",r.measureText(this.waterText+"田").width>e&&(i=16,r.font="16px Arial, Helvetica, sans-serif",r.measureText(this.waterText+"田").width>e&&(i=12,r.font="12px Arial, Helvetica, sans-serif")))),r.rotate(this.waterRotate);for(var a=this.waterText.split(/\\n/),s=0;s<a.length;s++)r.fillText(a[s],e/20,t+s*(i+4))}return n.toDataURL("image/png")},initDigitalZoom:function(){var e=this;if(this.digitalZoom){var t=this.debug,n=this.$el.querySelector("video");if(this.player&&n){var r=this.player.getAttribute("id");if(r){t&&console.log("digital zoom init ok id is "+r);var i=document.getElementById(r);if(i){var a=null,s=!1,o=!1,u=!1,l=void 0,c=void 0,d=void 0,h=void 0,f=null,p=!1,v=this.digitalZoomColor,m=null,g=r+"digital-zoom-rectangle",y=0,_=!1;i.addEventListener("mousedown",(function(e){if(e.target==n&&0==(a=e.button)){var i=Date.now();if(i-y<500)return _=!0,s=!1,l=0,c=0,void(t&&console.log("digital zoom["+r+"] double click down ingnore"));_=!1,y=i,s=!0,l=e.offsetX,c=e.offsetY,t&&console.log("digital zoom["+r+"] mousedown",e)}})),i.addEventListener("mousemove",(function(y){if(!p&&!_&&0==a){if(u){if(u=!1,s||!(1==y.which||y.key&&1===y.key.length&&1==y.key.charCodeAt()))return n.style.cursor="",void(p?S():T());s=!0}if(!s)return;d=y.offsetX,h=y.offsetY;var E=Math.abs(d-l),k=Math.abs(h-c),w=void 0,C=void 0;if(C=h<c?h:c,(w=d<l?d:l)<0||C<0)return;if(E<3||k<3)return;m||(m=y.target),(f=document.querySelector("."+g))||((f=document.createElement("div")).className=g,f.style.cursor="zoom-in",f.style.position="absolute",f.style.border="2px dashed "+v,i.appendChild(f)),o=!0,n.style.cursor="zoom-in",e.zoomDrawing=!0,y.target==m?(f.style.left=w+"px",f.style.top=C+"px",f.style.width=E+"px",f.style.height=k+"px"):y&&y.target&&y.target.className==g?(f.style.width=Math.abs(d)+"px",f.style.height=Math.abs(h)+"px"):b(y),t&&console.log("digital zoom["+r+"] mousemove->left=",w,",top=",C,",width=",E,",height=",k,",currentX=",d,",startX=",l,",currentY=",h,",startY=",c)}})),i.addEventListener("mouseup",(function(e){s=!1,0!=a||_||(p?e.target==n&&S():T())}));var b=function(e){u=!0,0==a&&(s=!1)};i.addEventListener("mouseleave",b);var T=function(a){var s,u,l,c;if(f){if(s=parseInt(f.style.left),u=parseInt(f.style.top),l=parseInt(f.style.width),c=parseInt(f.style.height),i.removeChild(f),f=null,e.zoomDrawing=!1,!(l<3||c<3)){o&&(n.style.cursor="zoom-out"),t&&console.log("digital zoom["+r+"] 放大开始->left=",s,",top=",u,",width=",l,",height=",c);var d=n,h=d.offsetWidth,v=d.offsetHeight,m=h/l*100,g=v/c*100,y=u*(v/c),_=s*(h/l);e.stretch_||(h/l>v/c?(g=h/l*100,y=u*(h/l)):(m=v/c*100,_=s*(v/c))),d.style.top="-"+y+"px",d.style.left="-"+_+"px",d.style.width=m+"%",d.style.height=g+"%",t&&console.log("digital zoom["+r+"] 放大结束->outWidth=",h,",width=",l,",widthX=",m,",outHeight=",v,",height=",c,",heightX=",g,",top=",u,",topX=",y,",left=",s,",leftX=",_),p=!0}}else e.zoomDrawing=!1},S=function(e){n.style.cursor="",p=!1,o=!1,l=0,c=0,t&&console.log("digital zoom["+r+"] 触发恢复");var i=n;i.style.top="0px",i.style.left="0px",i.style.width="100%",i.style.height="100%",a=null}}else t&&console.log("digital zoom init error, drawing area not found")}else t&&console.log("digital zoom init error, id not found")}else t&&console.log("digital zoom init error player not ready")}}}};n("UBF9");var P=function(e,t,n,r,i,a,s,o){var u,l="function"==typeof e?e.options:e;if(t&&(l.render=t,l.staticRenderFns=n,l._compiled=!0),r&&(l.functional=!0),a&&(l._scopeId="data-v-"+a),s?(u=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),i&&i.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},l._ssrRegister=u):i&&(u=o?function(){i.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:i),u)if(l.functional){l._injectStyles=u;var c=l.render;l.render=function(e,t){return u.call(t),c(e,t)}}else{var d=l.beforeCreate;l.beforeCreate=d?[].concat(d,u):[u]}return{exports:e,options:l}}(D,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"player-wrapper"},[n("div",{class:["video-wrapper",{"video-wrapper-stretch":this.stretch_}],style:e.videoWrapperStyle},[n("div",{staticClass:"video-inner",class:{live:e.live,"av-loading":e.avLoading,"hide-waiting":e.hideWaiting,"hide-controls":!e.controls,"zoom-drawing":e.zoomDrawing,"hide-big-play-button":e.hideBigPlayButton,"hide-snapshot-button":e.hideSnapshotButton,"hide-fullscreen-button":e.hideFullscreenButton,"hide-stretch-button":e.hideStretchButton,"hide-fluent-button":e.hideFluentButton,"hide-pic-in-pic":e.hidePicInPic,"hide-live-text":e.hideLiveText,"show-time":e.showTime&&!e.live},staticStyle:{position:"absolute",top:"0",bottom:"0",left:"0",right:"0"}}),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:e.waterText&&e.showSlot,expression:"waterText && showSlot"}],staticClass:"video-water",style:e.waterStyle}),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:e.showSlot,expression:"showSlot"}],staticClass:"video-slot"},[e._t("default")],2),e._v(" "),n("span",{directives:[{name:"show",rawName:"v-show",value:e.videoTitle&&e.showSlot,expression:"videoTitle && showSlot"}],staticClass:"video-title",attrs:{title:e.videoTitle}},[e._v(e._s(e.videoTitle))])])])}),[],!1,null,null,null).exports;i.a.use(L),i.a.customElement(P.name,P)},q27k:function(e,t,n){"use strict";var r=n("J2HX").f,i=n("ZiEV"),a=n("xmgo"),s=n("kRpC"),o=n("kopD"),u=n("j8TA"),l=n("1RbY"),c=n("+4di"),d=n("Oi8Z"),h=n("yU77"),f=n("TI2F").fastKey,p=n("eYp2"),v=h?"_s":"size",m=function(e,t){var n,r=f(t);if("F"!==r)return e._i[r];for(n=e._f;n;n=n.n)if(n.k==t)return n};e.exports={getConstructor:function(e,t,n,l){var c=e((function(e,r){o(e,c,t,"_i"),e._t=t,e._i=i(null),e._f=void 0,e._l=void 0,e[v]=0,null!=r&&u(r,n,e[l],e)}));return a(c.prototype,{clear:function(){for(var e=p(this,t),n=e._i,r=e._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];e._f=e._l=void 0,e[v]=0},delete:function(e){var n=p(this,t),r=m(n,e);if(r){var i=r.n,a=r.p;delete n._i[r.i],r.r=!0,a&&(a.n=i),i&&(i.p=a),n._f==r&&(n._f=i),n._l==r&&(n._l=a),n[v]--}return!!r},forEach:function(e){p(this,t);for(var n,r=s(e,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(e){return!!m(p(this,t),e)}}),h&&r(c.prototype,"size",{get:function(){return p(this,t)[v]}}),c},def:function(e,t,n){var r,i,a=m(e,t);return a?a.v=n:(e._l=a={i:i=f(t,!0),k:t,v:n,p:r=e._l,n:void 0,r:!1},e._f||(e._f=a),r&&(r.n=a),e[v]++,"F"!==i&&(e._i[i]=a)),e},getEntry:m,setStrong:function(e,t,n){l(e,t,(function(e,n){this._t=p(e,t),this._k=n,this._l=void 0}),(function(){for(var e=this,t=e._k,n=e._l;n&&n.r;)n=n.p;return e._t&&(e._l=n=n?n.n:e._t._f)?c(0,"keys"==t?n.k:"values"==t?n.v:[n.k,n.v]):(e._t=void 0,c(1))}),n?"entries":"values",!n,!0),d(t)}}},qFNJ:function(e,t,n){(e.exports=n("I1BE")(void 0)).push([e.i,'.video-wrapper .show-time .video-js .vjs-time-control:not(.vjs-remaining-time){padding-left:.5em;padding-right:0;min-width:0;display:block}.video-wrapper .video-js .vjs-remaining-time{display:none}.video-wrapper .live .vjs-progress-control{visibility:hidden}.video-wrapper .av-loading .vjs-big-play-button,.video-wrapper .live .vjs-remaining-time,.video-wrapper .live .vjs-time-control{display:none}.video-wrapper .hide-big-play-button .vjs-big-play-button,.video-wrapper .hide-controls .vjs-control-bar,.video-wrapper .hide-fluent-button .live-player-fluent-btn,.video-wrapper .hide-fullscreen-button .vjs-fullscreen-control,.video-wrapper .hide-live-text .video-js .vjs-live-control .vjs-live-display,.video-wrapper .hide-pic-in-pic .video-js .vjs-picture-in-picture-control,.video-wrapper .hide-snapshot-button .vjs-snapshot-control,.video-wrapper .hide-stretch-button .live-player-stretch-btn,.video-wrapper .hide-waiting .vjs-seeking .vjs-loading-spinner,.video-wrapper .hide-waiting .vjs-waiting .vjs-loading-spinner,.video-wrapper .zoom-drawing .video-slot,.video-wrapper .zoom-drawing .video-title,.video-wrapper .zoom-drawing .vjs-control-bar{display:none!important}.video-wrapper .alt{position:absolute;left:0;top:0;right:0;bottom:0;vertical-align:middle;background-repeat:no-repeat;background-position:50% 50%;background-size:contain;background-color:#000;color:#fff;text-align:center}.video-wrapper .alt>table{width:100%;height:100%}.video-wrapper .alt>table tr>td{vertical-align:middle}.video-wrapper .video-js .video-water{pointer-events:none;left:0;top:0;right:0;bottom:0;position:absolute}.video-wrapper .video-js .video-slot{font-size:14px}.video-wrapper .video-js .video-title{font-size:14px;position:absolute;top:5px;right:5px;color:#fff;background-color:hsla(0,0%,50%,.5);border-radius:2px;padding:5px;max-width:120px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.video-wrapper .video-js .vjs-control-bar .vjs-button{cursor:pointer;outline:none}.video-wrapper .video-js .vjs-control-bar .vjs-icon-cog:before,.video-wrapper .video-js .vjs-control-bar .vjs-icon-spinner:before{font-size:1.4em;line-height:1.87}.video-wrapper .video-js .vjs-control-bar .vjs-playback-rate .vjs-menu :focus:not(:focus-visible){outline:none;background:#fff}.video-wrapper .vjs-error-display{display:none}.video-wrapper .video-js .vjs-time-control{font-size:1.035em;line-height:2.93em}.video-wrapper .vjs-resolution-button{color:#ccc;font-family:VideoJS}.video-wrapper .vjs-resolution-button .vjs-resolution-button-staticlabel:before{content:"\\F110";font-size:1.8em;line-height:1.7em}.video-wrapper .vjs-resolution-button .vjs-resolution-button-label{width:100%;height:.6em;display:block!important}.video-wrapper .vjs-resolution-button .vjs-resolution-button-label-ie{width:100%;height:.4em;display:block!important}.video-wrapper .vjs-resolution-button ul.vjs-menu-content{width:4em!important}.video-wrapper .vjs-resolution-button .vjs-menu{left:0}.video-wrapper .vjs-resolution-button .vjs-menu li{text-transform:none;font-size:1em;line-height:1.5em;font-family:Arial,Helvetica,sans-serif}.video-wrapper .vjs-audio-button{display:none!important}.video-wrapper .video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-wrapper .vjs-button>.vjs-icon-placeholder:before{position:relative!important}.video-wrapper .video-js .vjs-play-progress:before{top:-.33em!important}.video-wrapper .video-js .vjs-control:focus,.video-wrapper .video-js .vjs-control:focus:before,.video-wrapper .video-js .vjs-control:hover:before{text-shadow:none!important}@media screen and (-webkit-min-device-pixel-ratio:0){.video-wrapper .video-js .vjs-control-bar{font-size:14px}.video-wrapper .video-js .vjs-slider-vertical .vjs-volume-level:before{left:-.33em!important}}.video-wrapper.video-wrapper-stretch .alt,.video-wrapper.video-wrapper-stretch .video-js .vjs-poster{background-size:100% 100%}',""])},qHvq:function(e,t){e.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},"qOR+":function(e,t,n){"use strict";var r=n("k+AJ"),i=n("L7KE"),a=n("HC2Y"),s=n("EeL+"),o=n("AZ8a"),u=n("+TcE"),l=n("27JW").f,c=n("jYdD").f,d=n("J2HX").f,h=n("6dhg").trim,f="Number",p=r.Number,v=p,m=p.prototype,g=a(n("ZiEV")(m))==f,y="trim"in String.prototype,_=function(e){var t=o(e,!1);if("string"==typeof t&&t.length>2){var n,r,i,a=(t=y?t.trim():h(t,3)).charCodeAt(0);if(43===a||45===a){if(88===(n=t.charCodeAt(2))||120===n)return NaN}else if(48===a){switch(t.charCodeAt(1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+t}for(var s,u=t.slice(2),l=0,c=u.length;l<c;l++)if((s=u.charCodeAt(l))<48||s>i)return NaN;return parseInt(u,r)}}return+t};if(!p(" 0o1")||!p("0b1")||p("+0x1")){p=function(e){var t=arguments.length<1?0:e,n=this;return n instanceof p&&(g?u((function(){m.valueOf.call(n)})):a(n)!=f)?s(new v(_(t)),n,p):_(t)};for(var b,T=n("yU77")?l(v):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),S=0;T.length>S;S++)i(v,b=T[S])&&!i(p,b)&&d(p,b,c(v,b));p.prototype=m,m.constructor=p,n("d+oe")(r,f,p)}},rGBx:function(e,t,n){"use strict";e.exports=n("zuiL")||!n("+TcE")((function(){var e=Math.random();__defineSetter__.call(null,e,(function(){})),delete n("k+AJ")[e]}))},rMxl:function(e,t,n){"use strict";var r=n("8IOi"),i=n("6WDs")(!1);r(r.P,"String",{codePointAt:function(e){return i(this,e)}})},rPJW:function(e,t,n){"use strict";var r=n("k+AJ"),i=n("L7KE"),a=n("yU77"),s=n("8IOi"),o=n("d+oe"),u=n("TI2F").KEY,l=n("+TcE"),c=n("3oW4"),d=n("J70Z"),h=n("Vol4"),f=n("3iRr"),p=n("pDsQ"),v=n("HLcc"),m=n("bZ/h"),g=n("fyHr"),y=n("138g"),_=n("n+hx"),b=n("XW/+"),T=n("AZ8a"),S=n("+zL4"),E=n("ZiEV"),k=n("Uyw2"),w=n("jYdD"),C=n("J2HX"),A=n("Wl3L"),L=w.f,R=C.f,x=k.f,I=r.Symbol,O=r.JSON,D=O&&O.stringify,P=f("_hidden"),M=f("toPrimitive"),j={}.propertyIsEnumerable,U=c("symbol-registry"),B=c("symbols"),F=c("op-symbols"),N=Object.prototype,G="function"==typeof I,V=r.QObject,H=!V||!V.prototype||!V.prototype.findChild,z=a&&l((function(){return 7!=E(R({},"a",{get:function(){return R(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=L(N,t);r&&delete N[t],R(e,t,n),r&&e!==N&&R(N,t,r)}:R,W=function(e){var t=B[e]=E(I.prototype);return t._k=e,t},K=G&&"symbol"==typeof I.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof I},q=function(e,t,n){return e===N&&q(F,t,n),y(e),t=T(t,!0),y(n),i(B,t)?(n.enumerable?(i(e,P)&&e[P][t]&&(e[P][t]=!1),n=E(n,{enumerable:S(0,!1)})):(i(e,P)||R(e,P,S(1,{})),e[P][t]=!0),z(e,t,n)):R(e,t,n)},$=function(e,t){y(e);for(var n,r=m(t=b(t)),i=0,a=r.length;a>i;)q(e,n=r[i++],t[n]);return e},Y=function(e){var t=j.call(this,e=T(e,!0));return!(this===N&&i(B,e)&&!i(F,e))&&(!(t||!i(this,e)||!i(B,e)||i(this,P)&&this[P][e])||t)},X=function(e,t){if(e=b(e),t=T(t,!0),e!==N||!i(B,t)||i(F,t)){var n=L(e,t);return!n||!i(B,t)||i(e,P)&&e[P][t]||(n.enumerable=!0),n}},J=function(e){for(var t,n=x(b(e)),r=[],a=0;n.length>a;)i(B,t=n[a++])||t==P||t==u||r.push(t);return r},Q=function(e){for(var t,n=e===N,r=x(n?F:b(e)),a=[],s=0;r.length>s;)!i(B,t=r[s++])||n&&!i(N,t)||a.push(B[t]);return a};G||(o((I=function(){if(this instanceof I)throw TypeError("Symbol is not a constructor!");var e=h(arguments.length>0?arguments[0]:void 0),t=function(n){this===N&&t.call(F,n),i(this,P)&&i(this[P],e)&&(this[P][e]=!1),z(this,e,S(1,n))};return a&&H&&z(N,e,{configurable:!0,set:t}),W(e)}).prototype,"toString",(function(){return this._k})),w.f=X,C.f=q,n("27JW").f=k.f=J,n("4XFX").f=Y,n("EN0g").f=Q,a&&!n("zuiL")&&o(N,"propertyIsEnumerable",Y,!0),p.f=function(e){return W(f(e))}),s(s.G+s.W+s.F*!G,{Symbol:I});for(var Z="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ee=0;Z.length>ee;)f(Z[ee++]);for(var te=A(f.store),ne=0;te.length>ne;)v(te[ne++]);s(s.S+s.F*!G,"Symbol",{for:function(e){return i(U,e+="")?U[e]:U[e]=I(e)},keyFor:function(e){if(!K(e))throw TypeError(e+" is not a symbol!");for(var t in U)if(U[t]===e)return t},useSetter:function(){H=!0},useSimple:function(){H=!1}}),s(s.S+s.F*!G,"Object",{create:function(e,t){return void 0===t?E(e):$(E(e),t)},defineProperty:q,defineProperties:$,getOwnPropertyDescriptor:X,getOwnPropertyNames:J,getOwnPropertySymbols:Q}),O&&s(s.S+s.F*(!G||l((function(){var e=I();return"[null]"!=D([e])||"{}"!=D({a:e})||"{}"!=D(Object(e))}))),"JSON",{stringify:function(e){for(var t,n,r=[e],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=t=r[1],(_(t)||void 0!==e)&&!K(e))return g(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!K(t))return t}),r[1]=t,D.apply(O,r)}}),I.prototype[M]||n("BxPU")(I.prototype,M,I.prototype.valueOf),d(I,"Symbol"),d(Math,"Math",!0),d(r.JSON,"JSON",!0)},rVFp:function(e,t,n){var r=n("8IOi");r(r.P,"Function",{bind:n("Au75")})},"rWL+":function(e,t,n){var r=n("8IOi");r(r.P,"Array",{fill:n("C6Ke")}),n("Zrcd")("fill")},rqGp:function(e,t,n){"use strict";var r=n("8IOi"),i=n("x0dS");r(r.P+r.F*!n("Vcfr")([].reduceRight,!0),"Array",{reduceRight:function(e){return i(this,e,arguments.length,arguments[1],!0)}})},"s+08":function(e,t,n){"use strict";var r=n("8IOi"),i=n("Qu5u"),a=n("AZ8a");r(r.P+r.F*n("+TcE")((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})})),"Date",{toJSON:function(e){var t=i(this),n=a(t);return"number"!=typeof n||isFinite(n)?t.toISOString():null}})},skXq:function(e,t,n){"use strict";var r=n("8IOi"),i=n("Y3Md"),a=n("RT9V"),s="endsWith",o="".endsWith;r(r.P+r.F*n("OvvV")(s),"String",{endsWith:function(e){var t=a(this,e,s),n=arguments.length>1?arguments[1]:void 0,r=i(t.length),u=void 0===n?r:Math.min(i(n),r),l=String(e);return o?o.call(t,l,u):t.slice(u-l.length,u)===l}})},srFW:function(e,t,n){var r=n("8IOi");r(r.S,"Math",{signbit:function(e){return(e=+e)!=e?e:0==e?1/e==1/0:e>0}})},t2DD:function(e,t,n){var r=n("j8TA");e.exports=function(e,t){var n=[];return r(e,!1,n.push,n,t),n}},t5lg:function(e,t,n){"use strict";var r=n("k+AJ"),i=n("yU77"),a=n("zuiL"),s=n("8wjV"),o=n("BxPU"),u=n("xmgo"),l=n("+TcE"),c=n("kopD"),d=n("m29h"),h=n("Y3Md"),f=n("U9MG"),p=n("27JW").f,v=n("J2HX").f,m=n("C6Ke"),g=n("J70Z"),y="ArrayBuffer",_="DataView",b="Wrong index!",T=r.ArrayBuffer,S=r.DataView,E=r.Math,k=r.RangeError,w=r.Infinity,C=T,A=E.abs,L=E.pow,R=E.floor,x=E.log,I=E.LN2,O="buffer",D="byteLength",P="byteOffset",M=i?"_b":O,j=i?"_l":D,U=i?"_o":P;function B(e,t,n){var r,i,a,s=new Array(n),o=8*n-t-1,u=(1<<o)-1,l=u>>1,c=23===t?L(2,-24)-L(2,-77):0,d=0,h=e<0||0===e&&1/e<0?1:0;for((e=A(e))!=e||e===w?(i=e!=e?1:0,r=u):(r=R(x(e)/I),e*(a=L(2,-r))<1&&(r--,a*=2),(e+=r+l>=1?c/a:c*L(2,1-l))*a>=2&&(r++,a/=2),r+l>=u?(i=0,r=u):r+l>=1?(i=(e*a-1)*L(2,t),r+=l):(i=e*L(2,l-1)*L(2,t),r=0));t>=8;s[d++]=255&i,i/=256,t-=8);for(r=r<<t|i,o+=t;o>0;s[d++]=255&r,r/=256,o-=8);return s[--d]|=128*h,s}function F(e,t,n){var r,i=8*n-t-1,a=(1<<i)-1,s=a>>1,o=i-7,u=n-1,l=e[u--],c=127&l;for(l>>=7;o>0;c=256*c+e[u],u--,o-=8);for(r=c&(1<<-o)-1,c>>=-o,o+=t;o>0;r=256*r+e[u],u--,o-=8);if(0===c)c=1-s;else{if(c===a)return r?NaN:l?-w:w;r+=L(2,t),c-=s}return(l?-1:1)*r*L(2,c-t)}function N(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function G(e){return[255&e]}function V(e){return[255&e,e>>8&255]}function H(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function z(e){return B(e,52,8)}function W(e){return B(e,23,4)}function K(e,t,n){v(e.prototype,t,{get:function(){return this[n]}})}function q(e,t,n,r){var i=f(+n);if(i+t>e[j])throw k(b);var a=e[M]._b,s=i+e[U],o=a.slice(s,s+t);return r?o:o.reverse()}function $(e,t,n,r,i,a){var s=f(+n);if(s+t>e[j])throw k(b);for(var o=e[M]._b,u=s+e[U],l=r(+i),c=0;c<t;c++)o[u+c]=l[a?c:t-c-1]}if(s.ABV){if(!l((function(){T(1)}))||!l((function(){new T(-1)}))||l((function(){return new T,new T(1.5),new T(NaN),T.name!=y}))){for(var Y,X=(T=function(e){return c(this,T),new C(f(e))}).prototype=C.prototype,J=p(C),Q=0;J.length>Q;)(Y=J[Q++])in T||o(T,Y,C[Y]);a||(X.constructor=T)}var Z=new S(new T(2)),ee=S.prototype.setInt8;Z.setInt8(0,2147483648),Z.setInt8(1,2147483649),!Z.getInt8(0)&&Z.getInt8(1)||u(S.prototype,{setInt8:function(e,t){ee.call(this,e,t<<24>>24)},setUint8:function(e,t){ee.call(this,e,t<<24>>24)}},!0)}else T=function(e){c(this,T,y);var t=f(e);this._b=m.call(new Array(t),0),this[j]=t},S=function(e,t,n){c(this,S,_),c(e,T,_);var r=e[j],i=d(t);if(i<0||i>r)throw k("Wrong offset!");if(i+(n=void 0===n?r-i:h(n))>r)throw k("Wrong length!");this[M]=e,this[U]=i,this[j]=n},i&&(K(T,D,"_l"),K(S,O,"_b"),K(S,D,"_l"),K(S,P,"_o")),u(S.prototype,{getInt8:function(e){return q(this,1,e)[0]<<24>>24},getUint8:function(e){return q(this,1,e)[0]},getInt16:function(e){var t=q(this,2,e,arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=q(this,2,e,arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return N(q(this,4,e,arguments[1]))},getUint32:function(e){return N(q(this,4,e,arguments[1]))>>>0},getFloat32:function(e){return F(q(this,4,e,arguments[1]),23,4)},getFloat64:function(e){return F(q(this,8,e,arguments[1]),52,8)},setInt8:function(e,t){$(this,1,e,G,t)},setUint8:function(e,t){$(this,1,e,G,t)},setInt16:function(e,t){$(this,2,e,V,t,arguments[2])},setUint16:function(e,t){$(this,2,e,V,t,arguments[2])},setInt32:function(e,t){$(this,4,e,H,t,arguments[2])},setUint32:function(e,t){$(this,4,e,H,t,arguments[2])},setFloat32:function(e,t){$(this,4,e,W,t,arguments[2])},setFloat64:function(e,t){$(this,8,e,z,t,arguments[2])}});g(T,y),g(S,_),o(S.prototype,s.VIEW,!0),t.ArrayBuffer=T,t.DataView=S},tNXT:function(e,t,n){var r=n("8IOi");r(r.S,"Array",{isArray:n("fyHr")})},uAa7:function(e,t,n){var r=n("8IOi"),i=n("6uvR"),a=n("XW/+"),s=n("jYdD"),o=n("UtW+");r(r.S,"Object",{getOwnPropertyDescriptors:function(e){for(var t,n,r=a(e),u=s.f,l=i(r),c={},d=0;l.length>d;)void 0!==(n=u(r,t=l[d++]))&&o(c,t,n);return c}})},uHQh:function(e,t,n){var r=n("8IOi");r(r.S,"Object",{create:n("ZiEV")})},unDq:function(e,t,n){var r=n("HGrt"),i=n("138g"),a=n("LOhj"),s=r.key,o=r.set;r.exp({metadata:function(e,t){return function(n,r){o(e,t,(void 0!==r?i:a)(n),s(r))}}})},vNAk:function(e,t,n){"use strict";var r=n("+TcE"),i=Date.prototype.getTime,a=Date.prototype.toISOString,s=function(e){return e>9?e:"0"+e};e.exports=r((function(){return"0385-07-25T07:06:39.999Z"!=a.call(new Date(-50000000000001))}))||!r((function(){a.call(new Date(NaN))}))?function(){if(!isFinite(i.call(this)))throw RangeError("Invalid time value");var e=this,t=e.getUTCFullYear(),n=e.getUTCMilliseconds(),r=t<0?"-":t>9999?"+":"";return r+("00000"+Math.abs(t)).slice(r?-6:-4)+"-"+s(e.getUTCMonth()+1)+"-"+s(e.getUTCDate())+"T"+s(e.getUTCHours())+":"+s(e.getUTCMinutes())+":"+s(e.getUTCSeconds())+"."+(n>99?n:"0"+s(n))+"Z"}:a},vejK:function(e,t,n){var r=n("k+AJ"),i=n("65rS").set,a=r.MutationObserver||r.WebKitMutationObserver,s=r.process,o=r.Promise,u="process"==n("HC2Y")(s);e.exports=function(){var e,t,n,l=function(){var r,i;for(u&&(r=s.domain)&&r.exit();e;){i=e.fn,e=e.next;try{i()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(u)n=function(){s.nextTick(l)};else if(!a||r.navigator&&r.navigator.standalone)if(o&&o.resolve){var c=o.resolve(void 0);n=function(){c.then(l)}}else n=function(){i.call(r,l)};else{var d=!0,h=document.createTextNode("");new a(l).observe(h,{characterData:!0}),n=function(){h.data=d=!d}}return function(r){var i={fn:r,next:void 0};t&&(t.next=i),e||(e=i,n()),t=i}}},wFMk:function(e,t){e.exports={}},wpNZ:function(e,t,n){var r=n("8IOi");r(r.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},x0dS:function(e,t,n){var r=n("LOhj"),i=n("Qu5u"),a=n("26/4"),s=n("Y3Md");e.exports=function(e,t,n,o,u){r(t);var l=i(e),c=a(l),d=s(l.length),h=u?d-1:0,f=u?-1:1;if(n<2)for(;;){if(h in c){o=c[h],h+=f;break}if(h+=f,u?h<0:d<=h)throw TypeError("Reduce of empty array with no initial value")}for(;u?h>=0:d>h;h+=f)h in c&&(o=t(o,c[h],h,l));return o}},x4ZG:function(e,t,n){var r=n("wFMk"),i=n("3iRr")("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||a[i]===e)}},x8o9:function(e,t,n){var r=n("HGrt"),i=n("138g"),a=n("7WAm"),s=r.has,o=r.key,u=function(e,t,n){if(s(e,t,n))return!0;var r=a(t);return null!==r&&u(e,r,n)};r.exp({hasMetadata:function(e,t){return u(e,i(t),arguments.length<3?void 0:o(arguments[2]))}})},xO9r:function(e,t,n){var r=n("8IOi"),i=n("65rS");r(r.G+r.B,{setImmediate:i.set,clearImmediate:i.clear})},xRLh:function(e,t,n){var r=n("8IOi"),i=n("7WAm"),a=n("138g");r(r.S,"Reflect",{getPrototypeOf:function(e){return i(a(e))}})},xcDT:function(e,t,n){var r=n("8IOi");r(r.P+r.R,"Map",{toJSON:n("H/b1")("Map")})},xmgo:function(e,t,n){var r=n("d+oe");e.exports=function(e,t,n){for(var i in t)r(e,i,t[i],n);return e}},yLpj:function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},ySsg:function(e,t,n){var r=n("8IOi"),i=n("JYSn")(!0);r(r.S,"Object",{entries:function(e){return i(e)}})},yU77:function(e,t,n){e.exports=!n("+TcE")((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},"z/zB":function(e,t,n){var r=n("kRpC"),i=n("26/4"),a=n("Qu5u"),s=n("Y3Md"),o=n("CkjT");e.exports=function(e,t){var n=1==e,u=2==e,l=3==e,c=4==e,d=6==e,h=5==e||d,f=t||o;return function(t,o,p){for(var v,m,g=a(t),y=i(g),_=r(o,p,3),b=s(y.length),T=0,S=n?f(t,b):u?f(t,0):void 0;b>T;T++)if((h||T in y)&&(m=_(v=y[T],T,g),e))if(n)S[T]=m;else if(m)switch(e){case 3:return!0;case 5:return v;case 6:return T;case 2:S.push(v)}else if(c)return!1;return d?-1:l||c?c:S}}},zuiL:function(e,t){e.exports=!1}});