!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var i=t();for(var n in i)("object"==typeof exports?exports:e)[n]=i[n]}}(window,(function(){return function(e){var t={};function i(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=18)}([function(e,t,i){"use strict";e.exports=i(9)},function(e,t,i){"use strict";var n,r="object"==typeof Reflect?Reflect:null,s=r&&"function"==typeof r.apply?r.apply:function(e,t,i){return Function.prototype.apply.call(e,t,i)};n=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(i,n){function r(){void 0!==s&&e.removeListener("error",s),i([].slice.call(arguments))}var s;"error"!==t&&(s=function(i){e.removeListener(t,r),n(i)},e.once("error",s)),e.once(t,r)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var l=10;function h(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function d(e,t,i,n){var r,s,a,o;if(h(i),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,i.listener?i.listener:i),s=e._events),a=s[t]),void 0===a)a=s[t]=i,++e._eventsCount;else if("function"==typeof a?a=s[t]=n?[i,a]:[a,i]:n?a.unshift(i):a.push(i),(r=u(e))>0&&a.length>r&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=a.length,o=l,console&&console.warn&&console.warn(o)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,i){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:i},r=c.bind(n);return r.listener=i,n.wrapFn=r,r}function _(e,t,i){var n=e._events;if(void 0===n)return[];var r=n[t];return void 0===r?[]:"function"==typeof r?i?[r.listener||r]:[r]:i?function(e){for(var t=new Array(e.length),i=0;i0&&(a=t[0]),a instanceof Error)throw a;var o=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw o.context=a,o}var l=r[e];if(void 0===l)return!1;if("function"==typeof l)s(l,this,t);else{var h=l.length,u=p(l,h);for(i=0;i=0;s--)if(i[s]===t||i[s].listener===t){a=i[s].listener,r=s;break}if(r<0)return this;0===r?i.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return _(this,e,!0)},o.prototype.rawListeners=function(e){return _(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},o.prototype.listenerCount=m,o.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(e,t,i){"use strict";var n,r=function(){return void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n},s=function(){var e={};return function(t){if(void 0===e[t]){var i=document.querySelector(t);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(e){i=null}e[t]=i}return e[t]}}(),a=[];function o(e){for(var t=-1,i=0;i>>0;for(t=0;t0)for(i=0;i=0?i?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+n}var x=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,U=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,P={},B={};function N(e,t,i,n){var r=n;"string"==typeof n&&(r=function(){return this[n]()}),e&&(B[e]=r),t&&(B[t[0]]=function(){return I(r.apply(this,arguments),t[1],t[2])}),i&&(B[i]=function(){return this.localeData().ordinal(r.apply(this,arguments),e)})}function F(e,t){return e.isValid()?(t=V(t,e.localeData()),P[t]=P[t]||function(e){var t,i,n,r=e.match(x);for(t=0,i=r.length;t=0&&U.test(e);)e=e.replace(U,n),U.lastIndex=0,i-=1;return e}var Y={};function q(e,t){var i=e.toLowerCase();Y[i]=Y[i+"s"]=Y[t]=e}function j(e){return"string"==typeof e?Y[e]||Y[e.toLowerCase()]:void 0}function W(e){var t,i,n={};for(i in e)h(e,i)&&(t=j(i))&&(n[t]=e[i]);return n}var G={};function z(e,t){G[e]=t}function H(e){return e%4==0&&e%100!=0||e%400==0}function K(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function Q(e){var t=+e,i=0;return 0!==t&&isFinite(t)&&(i=K(t)),i}function X(e,t){return function(i){return null!=i?(J(this,e,i),a.updateOffset(this,t),this):Z(this,e)}}function Z(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function J(e,t,i){e.isValid()&&!isNaN(i)&&("FullYear"===t&&H(e.year())&&1===e.month()&&29===e.date()?(i=Q(i),e._d["set"+(e._isUTC?"UTC":"")+t](i,e.month(),we(i,e.month()))):e._d["set"+(e._isUTC?"UTC":"")+t](i))}var $,ee=/\d/,te=/\d\d/,ie=/\d{3}/,ne=/\d{4}/,re=/[+-]?\d{6}/,se=/\d\d?/,ae=/\d\d\d\d?/,oe=/\d\d\d\d\d\d?/,le=/\d{1,3}/,he=/\d{1,4}/,ue=/[+-]?\d{1,6}/,de=/\d+/,ce=/[+-]?\d+/,fe=/Z|[+-]\d\d:?\d\d/gi,_e=/Z|[+-]\d\d(?::?\d\d)?/gi,me=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;function pe(e,t,i){$[e]=M(t)?t:function(e,n){return e&&i?i:t}}function ge(e,t){return h($,e)?$[e](t._strict,t._locale):new RegExp(ye(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(e,t,i,n,r){return t||i||n||r}))))}function ye(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}$={};var ve={};function Ae(e,t){var i,n=t;for("string"==typeof e&&(e=[e]),c(t)&&(n=function(e,i){i[t]=Q(e)}),i=0;i68?1900:2e3)};var Ue=X("FullYear",!0);function Pe(e,t,i,n,r,s,a){var o;return e<100&&e>=0?(o=new Date(e+400,t,i,n,r,s,a),isFinite(o.getFullYear())&&o.setFullYear(e)):o=new Date(e,t,i,n,r,s,a),o}function Be(e){var t,i;return e<100&&e>=0?((i=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,i)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function Ne(e,t,i){var n=7+t-i;return-((7+Be(e,0,n).getUTCDay()-t)%7)+n-1}function Fe(e,t,i,n,r){var s,a,o=1+7*(t-1)+(7+i-n)%7+Ne(e,n,r);return o<=0?a=xe(s=e-1)+o:o>xe(e)?(s=e+1,a=o-xe(e)):(s=e,a=o),{year:s,dayOfYear:a}}function Ve(e,t,i){var n,r,s=Ne(e.year(),t,i),a=Math.floor((e.dayOfYear()-s-1)/7)+1;return a<1?n=a+Ye(r=e.year()-1,t,i):a>Ye(e.year(),t,i)?(n=a-Ye(e.year(),t,i),r=e.year()+1):(r=e.year(),n=a),{week:n,year:r}}function Ye(e,t,i){var n=Ne(e,t,i),r=Ne(e+1,t,i);return(xe(e)-n+r)/7}N("w",["ww",2],"wo","week"),N("W",["WW",2],"Wo","isoWeek"),q("week","w"),q("isoWeek","W"),z("week",5),z("isoWeek",5),pe("w",se),pe("ww",se,te),pe("W",se),pe("WW",se,te),Se(["w","ww","W","WW"],(function(e,t,i,n){t[n.substr(0,1)]=Q(e)}));function qe(e,t){return e.slice(t,7).concat(e.slice(0,t))}N("d",0,"do","day"),N("dd",0,0,(function(e){return this.localeData().weekdaysMin(this,e)})),N("ddd",0,0,(function(e){return this.localeData().weekdaysShort(this,e)})),N("dddd",0,0,(function(e){return this.localeData().weekdays(this,e)})),N("e",0,0,"weekday"),N("E",0,0,"isoWeekday"),q("day","d"),q("weekday","e"),q("isoWeekday","E"),z("day",11),z("weekday",11),z("isoWeekday",11),pe("d",se),pe("e",se),pe("E",se),pe("dd",(function(e,t){return t.weekdaysMinRegex(e)})),pe("ddd",(function(e,t){return t.weekdaysShortRegex(e)})),pe("dddd",(function(e,t){return t.weekdaysRegex(e)})),Se(["dd","ddd","dddd"],(function(e,t,i,n){var r=i._locale.weekdaysParse(e,n,i._strict);null!=r?t.d=r:g(i).invalidWeekday=e})),Se(["d","e","E"],(function(e,t,i,n){t[n]=Q(e)}));var je="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),We="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Ge="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ze=me,He=me,Ke=me;function Qe(e,t,i){var n,r,s,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)s=p([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(s,"").toLocaleLowerCase();return i?"dddd"===t?-1!==(r=Ee.call(this._weekdaysParse,a))?r:null:"ddd"===t?-1!==(r=Ee.call(this._shortWeekdaysParse,a))?r:null:-1!==(r=Ee.call(this._minWeekdaysParse,a))?r:null:"dddd"===t?-1!==(r=Ee.call(this._weekdaysParse,a))||-1!==(r=Ee.call(this._shortWeekdaysParse,a))||-1!==(r=Ee.call(this._minWeekdaysParse,a))?r:null:"ddd"===t?-1!==(r=Ee.call(this._shortWeekdaysParse,a))||-1!==(r=Ee.call(this._weekdaysParse,a))||-1!==(r=Ee.call(this._minWeekdaysParse,a))?r:null:-1!==(r=Ee.call(this._minWeekdaysParse,a))||-1!==(r=Ee.call(this._weekdaysParse,a))||-1!==(r=Ee.call(this._shortWeekdaysParse,a))?r:null}function Xe(){function e(e,t){return t.length-e.length}var t,i,n,r,s,a=[],o=[],l=[],h=[];for(t=0;t<7;t++)i=p([2e3,1]).day(t),n=ye(this.weekdaysMin(i,"")),r=ye(this.weekdaysShort(i,"")),s=ye(this.weekdays(i,"")),a.push(n),o.push(r),l.push(s),h.push(n),h.push(r),h.push(s);a.sort(e),o.sort(e),l.sort(e),h.sort(e),this._weekdaysRegex=new RegExp("^("+h.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Ze(){return this.hours()%12||12}function Je(e,t){N(e,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)}))}function $e(e,t){return t._meridiemParse}N("H",["HH",2],0,"hour"),N("h",["hh",2],0,Ze),N("k",["kk",2],0,(function(){return this.hours()||24})),N("hmm",0,0,(function(){return""+Ze.apply(this)+I(this.minutes(),2)})),N("hmmss",0,0,(function(){return""+Ze.apply(this)+I(this.minutes(),2)+I(this.seconds(),2)})),N("Hmm",0,0,(function(){return""+this.hours()+I(this.minutes(),2)})),N("Hmmss",0,0,(function(){return""+this.hours()+I(this.minutes(),2)+I(this.seconds(),2)})),Je("a",!0),Je("A",!1),q("hour","h"),z("hour",13),pe("a",$e),pe("A",$e),pe("H",se),pe("h",se),pe("k",se),pe("HH",se,te),pe("hh",se,te),pe("kk",se,te),pe("hmm",ae),pe("hmmss",oe),pe("Hmm",ae),pe("Hmmss",oe),Ae(["H","HH"],3),Ae(["k","kk"],(function(e,t,i){var n=Q(e);t[3]=24===n?0:n})),Ae(["a","A"],(function(e,t,i){i._isPm=i._locale.isPM(e),i._meridiem=e})),Ae(["h","hh"],(function(e,t,i){t[3]=Q(e),g(i).bigHour=!0})),Ae("hmm",(function(e,t,i){var n=e.length-2;t[3]=Q(e.substr(0,n)),t[4]=Q(e.substr(n)),g(i).bigHour=!0})),Ae("hmmss",(function(e,t,i){var n=e.length-4,r=e.length-2;t[3]=Q(e.substr(0,n)),t[4]=Q(e.substr(n,2)),t[5]=Q(e.substr(r)),g(i).bigHour=!0})),Ae("Hmm",(function(e,t,i){var n=e.length-2;t[3]=Q(e.substr(0,n)),t[4]=Q(e.substr(n))})),Ae("Hmmss",(function(e,t,i){var n=e.length-4,r=e.length-2;t[3]=Q(e.substr(0,n)),t[4]=Q(e.substr(n,2)),t[5]=Q(e.substr(r))}));var et=X("Hours",!0);var tt,it={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Re,monthsShort:ke,week:{dow:0,doy:6},weekdays:je,weekdaysMin:Ge,weekdaysShort:We,meridiemParse:/[ap]\.?m?\.?/i},nt={},rt={};function st(e,t){var i,n=Math.min(e.length,t.length);for(i=0;i0;){if(n=ot(r.slice(0,t).join("-")))return n;if(i&&i.length>=t&&st(r,i)>=t-1)break;t--}s++}return tt}(e)}function dt(e){var t,i=e._a;return i&&-2===g(e).overflow&&(t=i[1]<0||i[1]>11?1:i[2]<1||i[2]>we(i[0],i[1])?2:i[3]<0||i[3]>24||24===i[3]&&(0!==i[4]||0!==i[5]||0!==i[6])?3:i[4]<0||i[4]>59?4:i[5]<0||i[5]>59?5:i[6]<0||i[6]>999?6:-1,g(e)._overflowDayOfYear&&(t<0||t>2)&&(t=2),g(e)._overflowWeeks&&-1===t&&(t=7),g(e)._overflowWeekday&&-1===t&&(t=8),g(e).overflow=t),e}var ct=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ft=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,_t=/Z|[+-]\d\d(?::?\d\d)?/,mt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],pt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],gt=/^\/?Date\((-?\d+)/i,yt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,vt={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function At(e){var t,i,n,r,s,a,o=e._i,l=ct.exec(o)||ft.exec(o);if(l){for(g(e).iso=!0,t=0,i=mt.length;t7)&&(l=!0)):(s=e._locale._week.dow,a=e._locale._week.doy,h=Ve(Tt(),s,a),i=Et(t.gg,e._a[0],h.year),n=Et(t.w,h.week),null!=t.d?((r=t.d)<0||r>6)&&(l=!0):null!=t.e?(r=t.e+s,(t.e<0||t.e>6)&&(l=!0)):r=s);n<1||n>Ye(i,s,a)?g(e)._overflowWeeks=!0:null!=l?g(e)._overflowWeekday=!0:(o=Fe(i,n,r,s,a),e._a[0]=o.year,e._dayOfYear=o.dayOfYear)}(e),null!=e._dayOfYear&&(s=Et(e._a[0],n[0]),(e._dayOfYear>xe(s)||0===e._dayOfYear)&&(g(e)._overflowDayOfYear=!0),i=Be(s,0,e._dayOfYear),e._a[1]=i.getUTCMonth(),e._a[2]=i.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=o[t]=n[t];for(;t<7;t++)e._a[t]=o[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[3]&&0===e._a[4]&&0===e._a[5]&&0===e._a[6]&&(e._nextDay=!0,e._a[3]=0),e._d=(e._useUTC?Be:Pe).apply(null,o),r=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[3]=24),e._w&&void 0!==e._w.d&&e._w.d!==r&&(g(e).weekdayMismatch=!0)}}function Rt(e){if(e._f!==a.ISO_8601)if(e._f!==a.RFC_2822){e._a=[],g(e).empty=!0;var t,i,n,r,s,o,l=""+e._i,h=l.length,u=0;for(n=V(e._f,e._locale).match(x)||[],t=0;t0&&g(e).unusedInput.push(s),l=l.slice(l.indexOf(i)+i.length),u+=i.length),B[r]?(i?g(e).empty=!1:g(e).unusedTokens.push(r),be(r,i,e)):e._strict&&!i&&g(e).unusedTokens.push(r);g(e).charsLeftOver=h-u,l.length>0&&g(e).unusedInput.push(l),e._a[3]<=12&&!0===g(e).bigHour&&e._a[3]>0&&(g(e).bigHour=void 0),g(e).parsedDateParts=e._a.slice(0),g(e).meridiem=e._meridiem,e._a[3]=function(e,t,i){var n;if(null==i)return t;return null!=e.meridiemHour?e.meridiemHour(t,i):null!=e.isPM?((n=e.isPM(i))&&t<12&&(t+=12),n||12!==t||(t=0),t):t}(e._locale,e._a[3],e._meridiem),null!==(o=g(e).era)&&(e._a[0]=e._locale.erasConvertYear(o,e._a[0])),wt(e),dt(e)}else bt(e);else At(e)}function kt(e){var t=e._i,i=e._f;return e._locale=e._locale||ut(e._l),null===t||void 0===i&&""===t?v({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),w(t)?new E(dt(t)):(f(t)?e._d=t:o(i)?function(e){var t,i,n,r,s,a,o=!1;if(0===e._f.length)return g(e).invalidFormat=!0,void(e._d=new Date(NaN));for(r=0;rthis?this:e:v()}));function Ot(e,t){var i,n;if(1===t.length&&o(t[0])&&(t=t[0]),!t.length)return Tt();for(i=t[0],n=1;n=0?new Date(e+400,t,i)-126227808e5:new Date(e,t,i).valueOf()}function ai(e,t,i){return e<100&&e>=0?Date.UTC(e+400,t,i)-126227808e5:Date.UTC(e,t,i)}function oi(e,t){return t.erasAbbrRegex(e)}function li(){var e,t,i=[],n=[],r=[],s=[],a=this.eras();for(e=0,t=a.length;e(s=Ye(e,n,r))&&(t=s),di.call(this,e,t,i,n,r))}function di(e,t,i,n,r){var s=Fe(e,t,i,n,r),a=Be(s.year,0,s.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}N("N",0,0,"eraAbbr"),N("NN",0,0,"eraAbbr"),N("NNN",0,0,"eraAbbr"),N("NNNN",0,0,"eraName"),N("NNNNN",0,0,"eraNarrow"),N("y",["y",1],"yo","eraYear"),N("y",["yy",2],0,"eraYear"),N("y",["yyy",3],0,"eraYear"),N("y",["yyyy",4],0,"eraYear"),pe("N",oi),pe("NN",oi),pe("NNN",oi),pe("NNNN",(function(e,t){return t.erasNameRegex(e)})),pe("NNNNN",(function(e,t){return t.erasNarrowRegex(e)})),Ae(["N","NN","NNN","NNNN","NNNNN"],(function(e,t,i,n){var r=i._locale.erasParse(e,n,i._strict);r?g(i).era=r:g(i).invalidEra=e})),pe("y",de),pe("yy",de),pe("yyy",de),pe("yyyy",de),pe("yo",(function(e,t){return t._eraYearOrdinalRegex||de})),Ae(["y","yy","yyy","yyyy"],0),Ae(["yo"],(function(e,t,i,n){var r;i._locale._eraYearOrdinalRegex&&(r=e.match(i._locale._eraYearOrdinalRegex)),i._locale.eraYearOrdinalParse?t[0]=i._locale.eraYearOrdinalParse(e,r):t[0]=parseInt(e,10)})),N(0,["gg",2],0,(function(){return this.weekYear()%100})),N(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),hi("gggg","weekYear"),hi("ggggg","weekYear"),hi("GGGG","isoWeekYear"),hi("GGGGG","isoWeekYear"),q("weekYear","gg"),q("isoWeekYear","GG"),z("weekYear",1),z("isoWeekYear",1),pe("G",ce),pe("g",ce),pe("GG",se,te),pe("gg",se,te),pe("GGGG",he,ne),pe("gggg",he,ne),pe("GGGGG",ue,re),pe("ggggg",ue,re),Se(["gggg","ggggg","GGGG","GGGGG"],(function(e,t,i,n){t[n.substr(0,2)]=Q(e)})),Se(["gg","GG"],(function(e,t,i,n){t[n]=a.parseTwoDigitYear(e)})),N("Q",0,"Qo","quarter"),q("quarter","Q"),z("quarter",7),pe("Q",ee),Ae("Q",(function(e,t){t[1]=3*(Q(e)-1)})),N("D",["DD",2],"Do","date"),q("date","D"),z("date",9),pe("D",se),pe("DD",se,te),pe("Do",(function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient})),Ae(["D","DD"],2),Ae("Do",(function(e,t){t[2]=Q(e.match(se)[0])}));var ci=X("Date",!0);N("DDD",["DDDD",3],"DDDo","dayOfYear"),q("dayOfYear","DDD"),z("dayOfYear",4),pe("DDD",le),pe("DDDD",ie),Ae(["DDD","DDDD"],(function(e,t,i){i._dayOfYear=Q(e)})),N("m",["mm",2],0,"minute"),q("minute","m"),z("minute",14),pe("m",se),pe("mm",se,te),Ae(["m","mm"],4);var fi=X("Minutes",!1);N("s",["ss",2],0,"second"),q("second","s"),z("second",15),pe("s",se),pe("ss",se,te),Ae(["s","ss"],5);var _i,mi,pi=X("Seconds",!1);for(N("S",0,0,(function(){return~~(this.millisecond()/100)})),N(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),N(0,["SSS",3],0,"millisecond"),N(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),N(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),N(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),N(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),N(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),N(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),q("millisecond","ms"),z("millisecond",16),pe("S",le,ee),pe("SS",le,te),pe("SSS",le,ie),_i="SSSS";_i.length<=9;_i+="S")pe(_i,de);function gi(e,t){t[6]=Q(1e3*("0."+e))}for(_i="S";_i.length<=9;_i+="S")Ae(_i,gi);mi=X("Milliseconds",!1),N("z",0,0,"zoneAbbr"),N("zz",0,0,"zoneName");var yi=E.prototype;function vi(e){return e}yi.add=Qt,yi.calendar=function(e,t){1===arguments.length&&(arguments[0]?Jt(arguments[0])?(e=arguments[0],t=void 0):$t(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var i=e||Tt(),n=Ft(i,this).startOf("day"),r=a.calendarFormat(this,n)||"sameElse",s=t&&(M(t[r])?t[r].call(this,i):t[r]);return this.format(s||this.localeData().calendar(r,this,Tt(i)))},yi.clone=function(){return new E(this)},yi.diff=function(e,t,i){var n,r,s;if(!this.isValid())return NaN;if(!(n=Ft(e,this)).isValid())return NaN;switch(r=6e4*(n.utcOffset()-this.utcOffset()),t=j(t)){case"year":s=ei(this,n)/12;break;case"month":s=ei(this,n);break;case"quarter":s=ei(this,n)/3;break;case"second":s=(this-n)/1e3;break;case"minute":s=(this-n)/6e4;break;case"hour":s=(this-n)/36e5;break;case"day":s=(this-n-r)/864e5;break;case"week":s=(this-n-r)/6048e5;break;default:s=this-n}return i?s:K(s)},yi.endOf=function(e){var t,i;if(void 0===(e=j(e))||"millisecond"===e||!this.isValid())return this;switch(i=this._isUTC?ai:si,e){case"year":t=i(this.year()+1,0,1)-1;break;case"quarter":t=i(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=i(this.year(),this.month()+1,1)-1;break;case"week":t=i(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=i(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=i(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=36e5-ri(t+(this._isUTC?0:6e4*this.utcOffset()),36e5)-1;break;case"minute":t=this._d.valueOf(),t+=6e4-ri(t,6e4)-1;break;case"second":t=this._d.valueOf(),t+=1e3-ri(t,1e3)-1}return this._d.setTime(t),a.updateOffset(this,!0),this},yi.format=function(e){e||(e=this.isUtc()?a.defaultFormatUtc:a.defaultFormat);var t=F(this,e);return this.localeData().postformat(t)},yi.from=function(e,t){return this.isValid()&&(w(e)&&e.isValid()||Tt(e).isValid())?Wt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},yi.fromNow=function(e){return this.from(Tt(),e)},yi.to=function(e,t){return this.isValid()&&(w(e)&&e.isValid()||Tt(e).isValid())?Wt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},yi.toNow=function(e){return this.to(Tt(),e)},yi.get=function(e){return M(this[e=j(e)])?this[e]():this},yi.invalidAt=function(){return g(this).overflow},yi.isAfter=function(e,t){var i=w(e)?e:Tt(e);return!(!this.isValid()||!i.isValid())&&("millisecond"===(t=j(t)||"millisecond")?this.valueOf()>i.valueOf():i.valueOf()9999?F(i,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):M(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",F(i,"Z")):F(i,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},yi.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,i,n="moment",r="";return this.isLocal()||(n=0===this.utcOffset()?"moment.utc":"moment.parseZone",r="Z"),e="["+n+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY","-MM-DD[T]HH:mm:ss.SSS",i=r+'[")]',this.format(e+t+"-MM-DD[T]HH:mm:ss.SSS"+i)},"undefined"!=typeof Symbol&&null!=Symbol.for&&(yi[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),yi.toJSON=function(){return this.isValid()?this.toISOString():null},yi.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},yi.unix=function(){return Math.floor(this.valueOf()/1e3)},yi.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},yi.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},yi.eraName=function(){var e,t,i,n=this.localeData().eras();for(e=0,t=n.length;ethis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},yi.isLocal=function(){return!!this.isValid()&&!this._isUTC},yi.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},yi.isUtc=Yt,yi.isUTC=Yt,yi.zoneAbbr=function(){return this._isUTC?"UTC":""},yi.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},yi.dates=k("dates accessor is deprecated. Use date instead.",ci),yi.months=k("months accessor is deprecated. Use month instead",Ce),yi.years=k("years accessor is deprecated. Use year instead",Ue),yi.zone=k("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",(function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()})),yi.isDSTShifted=k("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",(function(){if(!d(this._isDSTShifted))return this._isDSTShifted;var e,t={};return b(t,this),(t=kt(t))._a?(e=t._isUTC?p(t._a):Tt(t._a),this._isDSTShifted=this.isValid()&&function(e,t,i){var n,r=Math.min(e.length,t.length),s=Math.abs(e.length-t.length),a=0;for(n=0;n0):this._isDSTShifted=!1,this._isDSTShifted}));var Ai=C.prototype;function Si(e,t,i,n){var r=ut(),s=p().set(n,t);return r[i](s,e)}function bi(e,t,i){if(c(e)&&(t=e,e=void 0),e=e||"",null!=t)return Si(e,t,i,"month");var n,r=[];for(n=0;n<12;n++)r[n]=Si(e,n,i,"month");return r}function Ei(e,t,i,n){"boolean"==typeof e?(c(t)&&(i=t,t=void 0),t=t||""):(i=t=e,e=!1,c(t)&&(i=t,t=void 0),t=t||"");var r,s=ut(),a=e?s._week.dow:0,o=[];if(null!=i)return Si(t,(i+a)%7,n,"day");for(r=0;r<7;r++)o[r]=Si(t,(r+a)%7,n,"day");return o}Ai.calendar=function(e,t,i){var n=this._calendar[e]||this._calendar.sameElse;return M(n)?n.call(t,i):n},Ai.longDateFormat=function(e){var t=this._longDateFormat[e],i=this._longDateFormat[e.toUpperCase()];return t||!i?t:(this._longDateFormat[e]=i.match(x).map((function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e})).join(""),this._longDateFormat[e])},Ai.invalidDate=function(){return this._invalidDate},Ai.ordinal=function(e){return this._ordinal.replace("%d",e)},Ai.preparse=vi,Ai.postformat=vi,Ai.relativeTime=function(e,t,i,n){var r=this._relativeTime[i];return M(r)?r(e,t,i,n):r.replace(/%d/i,e)},Ai.pastFuture=function(e,t){var i=this._relativeTime[e>0?"future":"past"];return M(i)?i(t):i.replace(/%s/i,t)},Ai.set=function(e){var t,i;for(i in e)h(e,i)&&(M(t=e[i])?this[i]=t:this["_"+i]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},Ai.eras=function(e,t){var i,n,r,o=this._eras||ut("en")._eras;for(i=0,n=o.length;i=0)return l[n]},Ai.erasConvertYear=function(e,t){var i=e.since<=e.until?1:-1;return void 0===t?a(e.since).year():a(e.since).year()+(t-e.offset)*i},Ai.erasAbbrRegex=function(e){return h(this,"_erasAbbrRegex")||li.call(this),e?this._erasAbbrRegex:this._erasRegex},Ai.erasNameRegex=function(e){return h(this,"_erasNameRegex")||li.call(this),e?this._erasNameRegex:this._erasRegex},Ai.erasNarrowRegex=function(e){return h(this,"_erasNarrowRegex")||li.call(this),e?this._erasNarrowRegex:this._erasRegex},Ai.months=function(e,t){return e?o(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||De).test(t)?"format":"standalone"][e.month()]:o(this._months)?this._months:this._months.standalone},Ai.monthsShort=function(e,t){return e?o(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[De.test(t)?"format":"standalone"][e.month()]:o(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},Ai.monthsParse=function(e,t,i){var n,r,s;if(this._monthsParseExact)return Me.call(this,e,t,i);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(r=p([2e3,n]),i&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(r,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(r,"").replace(".","")+"$","i")),i||this._monthsParse[n]||(s="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[n]=new RegExp(s.replace(".",""),"i")),i&&"MMMM"===t&&this._longMonthsParse[n].test(e))return n;if(i&&"MMM"===t&&this._shortMonthsParse[n].test(e))return n;if(!i&&this._monthsParse[n].test(e))return n}},Ai.monthsRegex=function(e){return this._monthsParseExact?(h(this,"_monthsRegex")||Ie.call(this),e?this._monthsStrictRegex:this._monthsRegex):(h(this,"_monthsRegex")||(this._monthsRegex=Le),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},Ai.monthsShortRegex=function(e){return this._monthsParseExact?(h(this,"_monthsRegex")||Ie.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(h(this,"_monthsShortRegex")||(this._monthsShortRegex=Te),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},Ai.week=function(e){return Ve(e,this._week.dow,this._week.doy).week},Ai.firstDayOfYear=function(){return this._week.doy},Ai.firstDayOfWeek=function(){return this._week.dow},Ai.weekdays=function(e,t){var i=o(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?qe(i,this._week.dow):e?i[e.day()]:i},Ai.weekdaysMin=function(e){return!0===e?qe(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},Ai.weekdaysShort=function(e){return!0===e?qe(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},Ai.weekdaysParse=function(e,t,i){var n,r,s;if(this._weekdaysParseExact)return Qe.call(this,e,t,i);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(r=p([2e3,1]).day(n),i&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(r,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(r,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(r,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(s="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[n]=new RegExp(s.replace(".",""),"i")),i&&"dddd"===t&&this._fullWeekdaysParse[n].test(e))return n;if(i&&"ddd"===t&&this._shortWeekdaysParse[n].test(e))return n;if(i&&"dd"===t&&this._minWeekdaysParse[n].test(e))return n;if(!i&&this._weekdaysParse[n].test(e))return n}},Ai.weekdaysRegex=function(e){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||Xe.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(h(this,"_weekdaysRegex")||(this._weekdaysRegex=ze),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},Ai.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||Xe.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(h(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=He),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},Ai.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||Xe.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(h(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Ke),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},Ai.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},Ai.meridiem=function(e,t,i){return e>11?i?"pm":"PM":i?"am":"AM"},lt("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===Q(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),a.lang=k("moment.lang is deprecated. Use moment.locale instead.",lt),a.langData=k("moment.langData is deprecated. Use moment.localeData instead.",ut);var wi=Math.abs;function Ri(e,t,i,n){var r=Wt(t,i);return e._milliseconds+=n*r._milliseconds,e._days+=n*r._days,e._months+=n*r._months,e._bubble()}function ki(e){return e<0?Math.floor(e):Math.ceil(e)}function Di(e){return 4800*e/146097}function Ti(e){return 146097*e/4800}function Li(e){return function(){return this.as(e)}}var Mi=Li("ms"),Oi=Li("s"),Ci=Li("m"),Ii=Li("h"),xi=Li("d"),Ui=Li("w"),Pi=Li("M"),Bi=Li("Q"),Ni=Li("y");function Fi(e){return function(){return this.isValid()?this._data[e]:NaN}}var Vi=Fi("milliseconds"),Yi=Fi("seconds"),qi=Fi("minutes"),ji=Fi("hours"),Wi=Fi("days"),Gi=Fi("months"),zi=Fi("years");var Hi=Math.round,Ki={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Qi(e,t,i,n,r){return r.relativeTime(t||1,!!i,e,n)}var Xi=Math.abs;function Zi(e){return(e>0)-(e<0)||+e}function Ji(){if(!this.isValid())return this.localeData().invalidDate();var e,t,i,n,r,s,a,o,l=Xi(this._milliseconds)/1e3,h=Xi(this._days),u=Xi(this._months),d=this.asSeconds();return d?(e=K(l/60),t=K(e/60),l%=60,e%=60,i=K(u/12),u%=12,n=l?l.toFixed(3).replace(/\.?0+$/,""):"",r=d<0?"-":"",s=Zi(this._months)!==Zi(d)?"-":"",a=Zi(this._days)!==Zi(d)?"-":"",o=Zi(this._milliseconds)!==Zi(d)?"-":"",r+"P"+(i?s+i+"Y":"")+(u?s+u+"M":"")+(h?a+h+"D":"")+(t||e||l?"T":"")+(t?o+t+"H":"")+(e?o+e+"M":"")+(l?o+n+"S":"")):"P0D"}var $i=It.prototype;$i.isValid=function(){return this._isValid},$i.abs=function(){var e=this._data;return this._milliseconds=wi(this._milliseconds),this._days=wi(this._days),this._months=wi(this._months),e.milliseconds=wi(e.milliseconds),e.seconds=wi(e.seconds),e.minutes=wi(e.minutes),e.hours=wi(e.hours),e.months=wi(e.months),e.years=wi(e.years),this},$i.add=function(e,t){return Ri(this,e,t,1)},$i.subtract=function(e,t){return Ri(this,e,t,-1)},$i.as=function(e){if(!this.isValid())return NaN;var t,i,n=this._milliseconds;if("month"===(e=j(e))||"quarter"===e||"year"===e)switch(t=this._days+n/864e5,i=this._months+Di(t),e){case"month":return i;case"quarter":return i/3;case"year":return i/12}else switch(t=this._days+Math.round(Ti(this._months)),e){case"week":return t/7+n/6048e5;case"day":return t+n/864e5;case"hour":return 24*t+n/36e5;case"minute":return 1440*t+n/6e4;case"second":return 86400*t+n/1e3;case"millisecond":return Math.floor(864e5*t)+n;default:throw new Error("Unknown unit "+e)}},$i.asMilliseconds=Mi,$i.asSeconds=Oi,$i.asMinutes=Ci,$i.asHours=Ii,$i.asDays=xi,$i.asWeeks=Ui,$i.asMonths=Pi,$i.asQuarters=Bi,$i.asYears=Ni,$i.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*Q(this._months/12):NaN},$i._bubble=function(){var e,t,i,n,r,s=this._milliseconds,a=this._days,o=this._months,l=this._data;return s>=0&&a>=0&&o>=0||s<=0&&a<=0&&o<=0||(s+=864e5*ki(Ti(o)+a),a=0,o=0),l.milliseconds=s%1e3,e=K(s/1e3),l.seconds=e%60,t=K(e/60),l.minutes=t%60,i=K(t/60),l.hours=i%24,a+=K(i/24),o+=r=K(Di(a)),a-=ki(Ti(r)),n=K(o/12),o%=12,l.days=a,l.months=o,l.years=n,this},$i.clone=function(){return Wt(this)},$i.get=function(e){return e=j(e),this.isValid()?this[e+"s"]():NaN},$i.milliseconds=Vi,$i.seconds=Yi,$i.minutes=qi,$i.hours=ji,$i.days=Wi,$i.weeks=function(){return K(this.days()/7)},$i.months=Gi,$i.years=zi,$i.humanize=function(e,t){if(!this.isValid())return this.localeData().invalidDate();var i,n,r=!1,a=Ki;return"object"===s(e)&&(t=e,e=!1),"boolean"==typeof e&&(r=e),"object"===s(t)&&(a=Object.assign({},Ki,t),null!=t.s&&null==t.ss&&(a.ss=t.s-1)),n=function(e,t,i,n){var r=Wt(e).abs(),s=Hi(r.as("s")),a=Hi(r.as("m")),o=Hi(r.as("h")),l=Hi(r.as("d")),h=Hi(r.as("M")),u=Hi(r.as("w")),d=Hi(r.as("y")),c=s<=i.ss&&["s",s]||s0,c[4]=n,Qi.apply(null,c)}(this,!r,a,i=this.localeData()),r&&(n=i.pastFuture(+this,n)),i.postformat(n)},$i.toISOString=Ji,$i.toString=Ji,$i.toJSON=Ji,$i.locale=ti,$i.localeData=ni,$i.toIsoString=k("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Ji),$i.lang=ii,N("X",0,0,"unix"),N("x",0,0,"valueOf"),pe("x",ce),pe("X",/[+-]?\d+(\.\d{1,3})?/),Ae("X",(function(e,t,i){i._d=new Date(1e3*parseFloat(e))})),Ae("x",(function(e,t,i){i._d=new Date(Q(e))})),//! moment.js a.version="2.29.1",n=Tt,a.fn=yi,a.min=function(){var e=[].slice.call(arguments,0);return Ot("isBefore",e)},a.max=function(){var e=[].slice.call(arguments,0);return Ot("isAfter",e)},a.now=function(){return Date.now?Date.now():+new Date},a.utc=p,a.unix=function(e){return Tt(1e3*e)},a.months=function(e,t){return bi(e,t,"months")},a.isDate=f,a.locale=lt,a.invalid=v,a.duration=Wt,a.isMoment=w,a.weekdays=function(e,t,i){return Ei(e,t,i,"weekdays")},a.parseZone=function(){return Tt.apply(null,arguments).parseZone()},a.localeData=ut,a.isDuration=xt,a.monthsShort=function(e,t){return bi(e,t,"monthsShort")},a.weekdaysMin=function(e,t,i){return Ei(e,t,i,"weekdaysMin")},a.defineLocale=ht,a.updateLocale=function(e,t){if(null!=t){var i,n,r=it;null!=nt[e]&&null!=nt[e].parentLocale?nt[e].set(O(nt[e]._config,t)):(null!=(n=ot(e))&&(r=n._config),t=O(r,t),null==n&&(t.abbr=e),(i=new C(t)).parentLocale=nt[e],nt[e]=i),lt(e)}else null!=nt[e]&&(null!=nt[e].parentLocale?(nt[e]=nt[e].parentLocale,e===lt()&<(e)):null!=nt[e]&&delete nt[e]);return nt[e]},a.locales=function(){return D(nt)},a.weekdaysShort=function(e,t,i){return Ei(e,t,i,"weekdaysShort")},a.normalizeUnits=j,a.relativeTimeRounding=function(e){return void 0===e?Hi:"function"==typeof e&&(Hi=e,!0)},a.relativeTimeThreshold=function(e,t){return void 0!==Ki[e]&&(void 0===t?Ki[e]:(Ki[e]=t,"s"===e&&(Ki.ss=t-1),!0))},a.calendarFormat=function(e,t){var i=e.diff(t,"days",!0);return i<-6?"sameElse":i<-1?"lastWeek":i<0?"lastDay":i<1?"sameDay":i<2?"nextDay":i<7?"nextWeek":"sameElse"},a.prototype=yi,a.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},t.a=a}).call(this,i(15)(e))},function(e,t,i){"use strict";var n=i(3),r=i.n(n)()((function(e){return e[1]}));r.push([e.i,".flvWai,.flvWai>.videoFlv{\r\n width: 100%; \r\n height: 100%; \r\n}\r\n.flvWai>.videoFlv:hover{\r\n outline: none;\r\n}",""]),t.a=r},function(e,t,i){"use strict";var n=i(3),r=i.n(n)()((function(e){return e[1]}));r.push([e.i,'.timerComCss{\r\n font-family: "fontInit";\r\n color: rgb(47, 233, 242);\r\n font-size: 20px;\r\n letter-spacing: 2px;\r\n}\r\np{\r\n margin: 0;\r\n padding: 0;\r\n}',""]),t.a=r},function(e,t,i){"use strict";var n=i(3),r=i.n(n)()((function(e){return e[1]}));r.push([e.i,"img{\r\n width: 100%;\r\n}",""]),t.a=r},function(e,t,i){"use strict";i.r(t);var n=i(4); //! moment.js locale configuration //! locale : Chinese (China) [zh-cn] //! author : suupic : https://github.com/suupic //! author : Zeno Zeng : https://github.com/zenozeng //! author : uu109 : https://github.com/uu109 t.default=n.a.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"下午"===t||"晚上"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,i){var n=100*e+t;return n<600?"凌晨":n<900?"早上":n<1130?"上午":n<1230?"中午":n<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:function(e){return e.week()!==this.week()?"[下]dddLT":"[本]dddLT"},lastDay:"[昨天]LT",lastWeek:function(e){return this.week()!==e.week()?"[上]dddLT":"[本]dddLT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|周)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"周";default:return e}},relativeTime:{future:"%s后",past:"%s前",s:"几秒",ss:"%d 秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",w:"1 周",ww:"%d 周",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},week:{dow:1,doy:4}})},function(e,t,i){"use strict"; /** @license React v17.0.1 * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var n=i(10),r=60103,s=60106;t.Fragment=60107,t.StrictMode=60108,t.Profiler=60114;var a=60109,o=60110,l=60112;t.Suspense=60113;var h=60115,u=60116;if("function"==typeof Symbol&&Symbol.for){var d=Symbol.for;r=d("react.element"),s=d("react.portal"),t.Fragment=d("react.fragment"),t.StrictMode=d("react.strict_mode"),t.Profiler=d("react.profiler"),a=d("react.provider"),o=d("react.context"),l=d("react.forward_ref"),t.Suspense=d("react.suspense"),h=d("react.memo"),u=d("react.lazy")}var c="function"==typeof Symbol&&Symbol.iterator;function f(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,i=1;i1)for(var i=1;i ${t}`;h.ENABLE_CALLBACK&&h.emitter.emit("log","error",i),h.ENABLE_ERROR&&(console.error?console.error(i):console.warn?console.warn(i):console.log(i))}static i(e,t){e&&!h.FORCE_GLOBAL_TAG||(e=h.GLOBAL_TAG);let i=`[${e}] > ${t}`;h.ENABLE_CALLBACK&&h.emitter.emit("log","info",i),h.ENABLE_INFO&&(console.info?console.info(i):console.log(i))}static w(e,t){e&&!h.FORCE_GLOBAL_TAG||(e=h.GLOBAL_TAG);let i=`[${e}] > ${t}`;h.ENABLE_CALLBACK&&h.emitter.emit("log","warn",i),h.ENABLE_WARN&&(console.warn?console.warn(i):console.log(i))}static d(e,t){e&&!h.FORCE_GLOBAL_TAG||(e=h.GLOBAL_TAG);let i=`[${e}] > ${t}`;h.ENABLE_CALLBACK&&h.emitter.emit("log","debug",i),h.ENABLE_DEBUG&&(console.debug?console.debug(i):console.log(i))}static v(e,t){e&&!h.FORCE_GLOBAL_TAG||(e=h.GLOBAL_TAG);let i=`[${e}] > ${t}`;h.ENABLE_CALLBACK&&h.emitter.emit("log","verbose",i),h.ENABLE_VERBOSE&&console.log(i)}}h.GLOBAL_TAG="flv.js",h.FORCE_GLOBAL_TAG=!1,h.ENABLE_ERROR=!0,h.ENABLE_INFO=!0,h.ENABLE_WARN=!0,h.ENABLE_DEBUG=!0,h.ENABLE_VERBOSE=!0,h.ENABLE_CALLBACK=!1,h.emitter=new l.a;var u=h;var d=class{constructor(){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}reset(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0}addBytes(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())}get currentKBps(){this.addBytes(0);let e=(this._now()-this._lastCheckpoint)/1e3;return 0==e&&(e=1),this._intervalBytes/e/1024}get lastSecondKBps(){return this.addBytes(0),0!==this._lastSecondBytes?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0}get averageKBps(){let e=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/e/1024}};class c{constructor(e){this._message=e}get name(){return"RuntimeException"}get message(){return this._message}toString(){return this.name+": "+this.message}}class f extends c{constructor(e){super(e)}get name(){return"IllegalStateException"}}class _ extends c{constructor(e){super(e)}get name(){return"InvalidArgumentException"}}class m extends c{constructor(e){super(e)}get name(){return"NotImplementedException"}}const p={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},g={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"};class y{constructor(e){this._type=e||"undefined",this._status=p.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}destroy(){this._status=p.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}isWorking(){return this._status===p.kConnecting||this._status===p.kBuffering}get type(){return this._type}get status(){return this._status}get needStashBuffer(){return this._needStash}get onContentLengthKnown(){return this._onContentLengthKnown}set onContentLengthKnown(e){this._onContentLengthKnown=e}get onURLRedirect(){return this._onURLRedirect}set onURLRedirect(e){this._onURLRedirect=e}get onDataArrival(){return this._onDataArrival}set onDataArrival(e){this._onDataArrival=e}get onError(){return this._onError}set onError(e){this._onError=e}get onComplete(){return this._onComplete}set onComplete(e){this._onComplete=e}open(e,t){throw new m("Unimplemented abstract function!")}abort(){throw new m("Unimplemented abstract function!")}}let v={};!function(){let 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)||[],i=/(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)||[],n={browser:t[5]||t[3]||t[1]||"",version:t[2]||t[4]||"0",majorVersion:t[4]||t[2]||"0",platform:i[0]||""},r={};if(n.browser){r[n.browser]=!0;let e=n.majorVersion.split(".");r.version={major:parseInt(n.majorVersion,10),string:n.version},e.length>1&&(r.version.minor=parseInt(e[1],10)),e.length>2&&(r.version.build=parseInt(e[2],10))}if(n.platform&&(r[n.platform]=!0),(r.chrome||r.opr||r.safari)&&(r.webkit=!0),r.rv||r.iemobile){r.rv&&delete r.rv;let e="msie";n.browser=e,r[e]=!0}if(r.edge){delete r.edge;let e="msedge";n.browser=e,r[e]=!0}if(r.opr){let e="opera";n.browser=e,r[e]=!0}if(r.safari&&r.android){let e="android";n.browser=e,r[e]=!0}r.name=n.browser,r.platform=n.platform;for(let e in v)v.hasOwnProperty(e)&&delete v[e];Object.assign(v,r)}();var A=v;var S=class extends y{static isSupported(){try{let e=A.msedge&&A.version.minor>=15048,t=!A.msedge||e;return self.fetch&&self.ReadableStream&&t}catch(e){return!1}}constructor(e,t){super("fetch-stream-loader"),this.TAG="FetchStreamLoader",this._seekHandler=e,this._config=t,this._needStash=!0,this._requestAbort=!1,this._contentLength=null,this._receivedLength=0}destroy(){this.isWorking()&&this.abort(),super.destroy()}open(e,t){this._dataSource=e,this._range=t;let i=e.url;this._config.reuseRedirectedURL&&null!=e.redirectedURL&&(i=e.redirectedURL);let n=this._seekHandler.getConfig(i,t),r=new self.Headers;if("object"==typeof n.headers){let e=n.headers;for(let t in e)e.hasOwnProperty(t)&&r.append(t,e[t])}let s={method:"GET",headers:r,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if("object"==typeof this._config.headers)for(let e in this._config.headers)r.append(e,this._config.headers[e]);!1===e.cors&&(s.mode="same-origin"),e.withCredentials&&(s.credentials="include"),e.referrerPolicy&&(s.referrerPolicy=e.referrerPolicy),this._status=p.kConnecting,self.fetch(n.url,s).then(e=>{if(this._requestAbort)return this._requestAbort=!1,void(this._status=p.kIdle);if(e.ok&&e.status>=200&&e.status<=299){if(e.url!==n.url&&this._onURLRedirect){let t=this._seekHandler.removeURLParameters(e.url);this._onURLRedirect(t)}let t=e.headers.get("Content-Length");return null!=t&&(this._contentLength=parseInt(t),0!==this._contentLength&&this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)),this._pump.call(this,e.body.getReader())}if(this._status=p.kError,!this._onError)throw new c("FetchStreamLoader: Http code invalid, "+e.status+" "+e.statusText);this._onError(g.HTTP_STATUS_CODE_INVALID,{code:e.status,msg:e.statusText})}).catch(e=>{if(this._status=p.kError,!this._onError)throw e;this._onError(g.EXCEPTION,{code:-1,msg:e.message})})}abort(){this._requestAbort=!0}_pump(e){return e.read().then(t=>{if(t.done)if(null!==this._contentLength&&this._receivedLength{if(11===e.code&&A.msedge)return;this._status=p.kError;let t=0,i=null;if(19!==e.code&&"network error"!==e.message||!(null===this._contentLength||null!==this._contentLength&&this._receivedLength299)){if(this._status=p.kError,!this._onError)throw new c("MozChunkedLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(g.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}else this._status=p.kBuffering}}_onProgress(e){if(this._status===p.kError)return;null===this._contentLength&&null!==e.total&&0!==e.total&&(this._contentLength=e.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));let t=e.target.response,i=this._range.from+this._receivedLength;this._receivedLength+=t.byteLength,this._onDataArrival&&this._onDataArrival(t,i,this._receivedLength)}_onLoadEnd(e){!0!==this._requestAbort?this._status!==p.kError&&(this._status=p.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)):this._requestAbort=!1}_onXhrError(e){this._status=p.kError;let t=0,i=null;if(this._contentLength&&e.loaded=this._contentLength&&(i=this._range.from+this._contentLength-1),this._currentRequestRange={from:t,to:i},this._internalOpen(this._dataSource,this._currentRequestRange)}_internalOpen(e,t){this._lastTimeLoaded=0;let i=e.url;this._config.reuseRedirectedURL&&(null!=this._currentRedirectedURL?i=this._currentRedirectedURL:null!=e.redirectedURL&&(i=e.redirectedURL));let n=this._seekHandler.getConfig(i,t);this._currentRequestURL=n.url;let r=this._xhr=new XMLHttpRequest;if(r.open("GET",n.url,!0),r.responseType="arraybuffer",r.onreadystatechange=this._onReadyStateChange.bind(this),r.onprogress=this._onProgress.bind(this),r.onload=this._onLoad.bind(this),r.onerror=this._onXhrError.bind(this),e.withCredentials&&(r.withCredentials=!0),"object"==typeof n.headers){let e=n.headers;for(let t in e)e.hasOwnProperty(t)&&r.setRequestHeader(t,e[t])}if("object"==typeof this._config.headers){let e=this._config.headers;for(let t in e)e.hasOwnProperty(t)&&r.setRequestHeader(t,e[t])}r.send()}abort(){this._requestAbort=!0,this._internalAbort(),this._status=p.kComplete}_internalAbort(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)}_onReadyStateChange(e){let t=e.target;if(2===t.readyState){if(null!=t.responseURL){let e=this._seekHandler.removeURLParameters(t.responseURL);t.responseURL!==this._currentRequestURL&&e!==this._currentRedirectedURL&&(this._currentRedirectedURL=e,this._onURLRedirect&&this._onURLRedirect(e))}if(t.status>=200&&t.status<=299){if(this._waitForTotalLength)return;this._status=p.kBuffering}else{if(this._status=p.kError,!this._onError)throw new c("RangeLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(g.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}}}_onProgress(e){if(this._status===p.kError)return;if(null===this._contentLength){let t=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,t=!0;let i=e.total;this._internalAbort(),null!=i&0!==i&&(this._totalLength=i)}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)}let t=e.loaded-this._lastTimeLoaded;this._lastTimeLoaded=e.loaded,this._speedSampler.addBytes(t)}_normalizeSpeed(e){let t=this._chunkSizeKBList,i=t.length-1,n=0,r=0,s=i;if(e=t[n]&&e=3&&(t=this._speedSampler.currentKBps)),0!==t){let e=this._normalizeSpeed(t);this._currentSpeedNormalized!==e&&(this._currentSpeedNormalized=e,this._currentChunkSizeKB=e)}let i=e.target.response,n=this._range.from+this._receivedLength;this._receivedLength+=i.byteLength;let r=!1;null!=this._contentLength&&this._receivedLength0&&this._receivedLength{this._dispatchArrayBuffer(t.result)},t.readAsArrayBuffer(e.data)}else{this._status=p.kError;let t={code:-1,msg:"Unsupported WebSocket message type: "+e.data.constructor.name};if(!this._onError)throw new c(t.msg);this._onError(g.EXCEPTION,t)}}_dispatchArrayBuffer(e){let t=e,i=this._receivedLength;this._receivedLength+=t.byteLength,this._onDataArrival&&this._onDataArrival(t,i,this._receivedLength)}_onWebSocketError(e){this._status=p.kError;let t={code:e.code,msg:e.message};if(!this._onError)throw new c(t.msg);this._onError(g.EXCEPTION,t)}};var R=class{constructor(e){this._zeroStart=e||!1}getConfig(e,t){let i={};if(0!==t.from||-1!==t.to){let e;e=-1!==t.to?`bytes=${t.from.toString()}-${t.to.toString()}`:`bytes=${t.from.toString()}-`,i.Range=e}else this._zeroStart&&(i.Range="bytes=0-");return{url:e,headers:i}}removeURLParameters(e){return e}};var k=class{constructor(e,t){this._startName=e,this._endName=t}getConfig(e,t){let i=e;if(0!==t.from||-1!==t.to){let e=!0;-1===i.indexOf("?")&&(i+="?",e=!1),e&&(i+="&"),i+=`${this._startName}=${t.from.toString()}`,-1!==t.to&&(i+=`&${this._endName}=${t.to.toString()}`)}return{url:i,headers:{}}}removeURLParameters(e){let t=e.split("?")[0],i=void 0,n=e.indexOf("?");-1!==n&&(i=e.substring(n+1));let r="";if(null!=i&&i.length>0){let e=i.split("&");for(let t=0;t0;i[0]!==this._startName&&i[0]!==this._endName&&(n&&(r+="&"),r+=e[t])}}return 0===r.length?t:t+"?"+r}};var D=class{constructor(e,t,i){this.TAG="IOController",this._config=t,this._extraData=i,this._stashInitialSize=393216,null!=t.stashInitialSize&&t.stashInitialSize>0&&(this._stashInitialSize=t.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=3145728,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,!1===t.enableStashBuffer&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=e,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(e.url),this._refTotalLength=e.filesize?e.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new d,this._speedNormalizeList=[64,128,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()}destroy(){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}isWorking(){return this._loader&&this._loader.isWorking()&&!this._paused}isPaused(){return this._paused}get status(){return this._loader.status}get extraData(){return this._extraData}set extraData(e){this._extraData=e}get onDataArrival(){return this._onDataArrival}set onDataArrival(e){this._onDataArrival=e}get onSeeked(){return this._onSeeked}set onSeeked(e){this._onSeeked=e}get onError(){return this._onError}set onError(e){this._onError=e}get onComplete(){return this._onComplete}set onComplete(e){this._onComplete=e}get onRedirect(){return this._onRedirect}set onRedirect(e){this._onRedirect=e}get onRecoveredEarlyEof(){return this._onRecoveredEarlyEof}set onRecoveredEarlyEof(e){this._onRecoveredEarlyEof=e}get currentURL(){return this._dataSource.url}get hasRedirect(){return null!=this._redirectedURL||null!=this._dataSource.redirectedURL}get currentRedirectedURL(){return this._redirectedURL||this._dataSource.redirectedURL}get currentSpeed(){return this._loaderClass===E?this._loader.currentSpeed:this._speedSampler.lastSecondKBps}get loaderType(){return this._loader.type}_selectSeekHandler(){let e=this._config;if("range"===e.seekType)this._seekHandler=new R(this._config.rangeLoadZeroStart);else if("param"===e.seekType){let t=e.seekParamStart||"bstart",i=e.seekParamEnd||"bend";this._seekHandler=new k(t,i)}else{if("custom"!==e.seekType)throw new _("Invalid seekType in config: "+e.seekType);if("function"!=typeof e.customSeekHandler)throw new _("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new e.customSeekHandler}}_selectLoader(){if(null!=this._config.customLoader)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=w;else if(S.isSupported())this._loaderClass=S;else if(b.isSupported())this._loaderClass=b;else{if(!E.isSupported())throw new c("Your browser doesn't support xhr with arraybuffer responseType!");this._loaderClass=E}}_createLoader(){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)}open(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))}abort(){this._loader.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)}pause(){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)}resume(){if(this._paused){this._paused=!1;let e=this._resumeFrom;this._resumeFrom=0,this._internalSeek(e,!0)}}seek(e){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(e,!0)}_internalSeek(e,t){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(t),this._loader.destroy(),this._loader=null;let i={from:e,to:-1};this._currentRange={from:i.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,i),this._onSeeked&&this._onSeeked()}updateUrl(e){if(!e||"string"!=typeof e||0===e.length)throw new _("Url must be a non-empty string!");this._dataSource.url=e}_expandBuffer(e){let t=this._stashSize;for(;t+10485760){let e=new Uint8Array(this._stashBuffer,0,this._stashUsed);new Uint8Array(i,0,t).set(e,0)}this._stashBuffer=i,this._bufferSize=t}_normalizeSpeed(e){let t=this._speedNormalizeList,i=t.length-1,n=0,r=0,s=i;if(e=t[n]&&e=512&&e<=1024?Math.floor(1.5*e):2*e,t>8192&&(t=8192);let i=1024*t+1048576;this._bufferSize0){let t=this._stashBuffer.slice(0,this._stashUsed),n=this._dispatchChunks(t,this._stashByteStart);if(n0){let e=new Uint8Array(t,n);i.set(e,0),this._stashUsed=e.byteLength,this._stashByteStart+=n}}else this._stashUsed=0,this._stashByteStart+=n;this._stashUsed+e.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+e.byteLength),i=new Uint8Array(this._stashBuffer,0,this._bufferSize)),i.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength}else{let n=this._dispatchChunks(e,t);if(nthis._bufferSize&&(this._expandBuffer(r),i=new Uint8Array(this._stashBuffer,0,this._bufferSize)),i.set(new Uint8Array(e,n),0),this._stashUsed+=r,this._stashByteStart=t+n}}}else if(0===this._stashUsed){let i=this._dispatchChunks(e,t);if(ithis._bufferSize&&this._expandBuffer(n),new Uint8Array(this._stashBuffer,0,this._bufferSize).set(new Uint8Array(e,i),0),this._stashUsed+=n,this._stashByteStart=t+i}}else{this._stashUsed+e.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+e.byteLength);let t=new Uint8Array(this._stashBuffer,0,this._bufferSize);t.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength;let i=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(i0){let e=new Uint8Array(this._stashBuffer,i);t.set(e,0)}this._stashUsed-=i,this._stashByteStart+=i}}_flushStashBuffer(e){if(this._stashUsed>0){let t=this._stashBuffer.slice(0,this._stashUsed),i=this._dispatchChunks(t,this._stashByteStart),n=t.byteLength-i;if(i0){let e=new Uint8Array(this._stashBuffer,0,this._bufferSize),n=new Uint8Array(t,i);e.set(n,0),this._stashUsed=n.byteLength,this._stashByteStart+=i}return 0}u.w(this.TAG,n+" bytes unconsumed data remain when flush buffer, dropped")}return this._stashUsed=0,this._stashByteStart=0,n}return 0}_onLoaderComplete(e,t){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)}_onLoaderError(e,t){switch(u.e(this.TAG,`Loader error, code = ${t.code}, msg = ${t.msg}`),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,e=g.UNRECOVERABLE_EARLY_EOF),e){case g.EARLY_EOF:if(!this._config.isLive&&this._totalLength){let e=this._currentRange.to+1;return void(e0){let t=I.getConfig();e.emit("change",t)}}static registerListener(e){I.emitter.addListener("change",e)}static removeListener(e){I.emitter.removeListener("change",e)}static addLogListener(e){u.emitter.addListener("log",e),u.emitter.listenerCount("log")>0&&(u.ENABLE_CALLBACK=!0,I._notifyChange())}static removeLogListener(e){u.emitter.removeListener("log",e),0===u.emitter.listenerCount("log")&&(u.ENABLE_CALLBACK=!1,I._notifyChange())}}I.emitter=new l.a;var x=I;var U=class{constructor(){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}isComplete(){let 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&&null!=this.duration&&null!=this.metadata&&null!=this.hasKeyframesIndex&&e&&t}isSeekable(){return!0===this.hasKeyframesIndex}getNearestKeyframe(e){if(null==this.keyframesIndex)return null;let t=this.keyframesIndex,i=this._search(t.times,e);return{index:i,milliseconds:t.times[i],fileposition:t.filepositions[i]}}_search(e,t){let i=0,n=e.length-1,r=0,s=0,a=n;for(t=e[r]&&t=128){t.push(String.fromCharCode(65535&e)),n+=2;continue}}}else if(i[n]<240){if(P(i,n,2)){let e=(15&i[n])<<12|(63&i[n+1])<<6|63&i[n+2];if(e>=2048&&55296!=(63488&e)){t.push(String.fromCharCode(65535&e)),n+=3;continue}}}else if(i[n]<248&&P(i,n,3)){let e=(7&i[n])<<18|(63&i[n+1])<<12|(63&i[n+2])<<6|63&i[n+3];if(e>65536&&e<1114112){e-=65536,t.push(String.fromCharCode(e>>>10|55296)),t.push(String.fromCharCode(1023&e|56320)),n+=4;continue}}t.push(String.fromCharCode(65533)),++n}return t.join("")};let N=function(){let e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),256===new Int16Array(e)[0]}();class F{static parseScriptData(e,t,i){let n={};try{let r=F.parseValue(e,t,i),s=F.parseValue(e,t+r.size,i-r.size);n[r.data]=s.data}catch(e){u.e("AMF",e.toString())}return n}static parseObject(e,t,i){if(i<3)throw new f("Data not enough when parse ScriptDataObject");let n=F.parseString(e,t,i),r=F.parseValue(e,t+n.size,i-n.size),s=r.objectEnd;return{data:{name:n.data,value:r.data},size:n.size+r.size,objectEnd:s}}static parseVariable(e,t,i){return F.parseObject(e,t,i)}static parseString(e,t,i){if(i<2)throw new f("Data not enough when parse String");let n,r=new DataView(e,t,i).getUint16(0,!N);return n=r>0?B(new Uint8Array(e,t+2,r)):"",{data:n,size:2+r}}static parseLongString(e,t,i){if(i<4)throw new f("Data not enough when parse LongString");let n,r=new DataView(e,t,i).getUint32(0,!N);return n=r>0?B(new Uint8Array(e,t+4,r)):"",{data:n,size:4+r}}static parseDate(e,t,i){if(i<10)throw new f("Data size invalid when parse Date");let n=new DataView(e,t,i),r=n.getFloat64(0,!N);return r+=60*n.getInt16(8,!N)*1e3,{data:new Date(r),size:10}}static parseValue(e,t,i){if(i<1)throw new f("Data not enough when parse Value");let n,r=new DataView(e,t,i),s=1,a=r.getUint8(0),o=!1;try{switch(a){case 0:n=r.getFloat64(1,!N),s+=8;break;case 1:n=!!r.getUint8(1),s+=1;break;case 2:{let r=F.parseString(e,t+1,i-1);n=r.data,s+=r.size;break}case 3:{n={};let a=0;for(9==(16777215&r.getUint32(i-4,!N))&&(a=3);s32)throw new _("ExpGolomb: readBits() bits exceeded max 32bits!");if(e<=this._current_word_bits_left){let t=this._current_word>>>32-e;return this._current_word<<=e,this._current_word_bits_left-=e,t}let t=this._current_word_bits_left?this._current_word:0;t>>>=32-this._current_word_bits_left;let i=e-this._current_word_bits_left;this._fillCurrentWord();let n=Math.min(i,this._current_word_bits_left),r=this._current_word>>>32-n;return this._current_word<<=n,this._current_word_bits_left-=n,t=t<>>e))return this._current_word<<=e,this._current_word_bits_left-=e,e;return this._fillCurrentWord(),e+this._skipLeadingZero()}readUEG(){let e=this._skipLeadingZero();return this.readBits(e+1)-1}readSEG(){let e=this.readUEG();return 1&e?e+1>>>1:-1*(e>>>1)}};class q{static _ebsp2rbsp(e){let t=e,i=t.byteLength,n=new Uint8Array(i),r=0;for(let e=0;e=2&&3===t[e]&&0===t[e-1]&&0===t[e-2]||(n[r]=t[e],r++);return new Uint8Array(n.buffer,0,r)}static parseSPS(e){let t=q._ebsp2rbsp(e),i=new Y(t);i.readByte();let n=i.readByte();i.readByte();let r=i.readByte();i.readUEG();let s=q.getProfileString(n),a=q.getLevelString(r),o=1,l=420,h=[0,420,422,444],u=8;if((100===n||110===n||122===n||244===n||44===n||83===n||86===n||118===n||128===n||138===n||144===n)&&(o=i.readUEG(),3===o&&i.readBits(1),o<=3&&(l=h[o]),u=i.readUEG()+8,i.readUEG(),i.readBits(1),i.readBool())){let e=3!==o?8:12;for(let t=0;t0&&e<16?(A=t[e-1],S=n[e-1]):255===e&&(A=i.readByte()<<8|i.readByte(),S=i.readByte()<<8|i.readByte())}if(i.readBool()&&i.readBool(),i.readBool()&&(i.readBits(4),i.readBool()&&i.readBits(24)),i.readBool()&&(i.readUEG(),i.readUEG()),i.readBool()){let e=i.readBits(32),t=i.readBits(32);E=i.readBool(),w=t,R=2*e,b=w/R}}let k=1;1===A&&1===S||(k=A/S);let D=0,T=0;if(0===o)D=1,T=2-m;else{D=3===o?1:2,T=(1===o?2:1)*(2-m)}let L=16*(f+1),M=16*(_+1)*(2-m);L-=(p+g)*D,M-=(y+v)*T;let O=Math.ceil(L*k);return i.destroy(),i=null,{profile_string:s,level_string:a,bit_depth:u,ref_frames:c,chroma_format:l,chroma_format_string:q.getChromaFormatString(l),frame_rate:{fixed:E,fps:b,fps_den:R,fps_num:w},sar_ratio:{width:A,height:S},codec_size:{width:L,height:M},present_size:{width:O,height:M}}}static _skipScalingList(e,t){let i=8,n=8,r=0;for(let s=0;s>>2!=0,r=0!=(1&t[4]),s=(a=t)[o=5]<<24|a[o+1]<<16|a[o+2]<<8|a[o+3];var a,o;return s<9?i:{match:!0,consumed:s,dataOffset:s,hasAudioTrack:n,hasVideoTrack:r}}bindDataSource(e){return e.onDataArrival=this.parseChunks.bind(this),this}get onTrackMetadata(){return this._onTrackMetadata}set onTrackMetadata(e){this._onTrackMetadata=e}get onMediaInfo(){return this._onMediaInfo}set onMediaInfo(e){this._onMediaInfo=e}get onMetaDataArrived(){return this._onMetaDataArrived}set onMetaDataArrived(e){this._onMetaDataArrived=e}get onScriptDataArrived(){return this._onScriptDataArrived}set onScriptDataArrived(e){this._onScriptDataArrived=e}get onError(){return this._onError}set onError(e){this._onError=e}get onDataAvailable(){return this._onDataAvailable}set onDataAvailable(e){this._onDataAvailable=e}get timestampBase(){return this._timestampBase}set timestampBase(e){this._timestampBase=e}get overridedDuration(){return this._duration}set overridedDuration(e){this._durationOverrided=!0,this._duration=e,this._mediaInfo.duration=e}set overridedHasAudio(e){this._hasAudioFlagOverrided=!0,this._hasAudio=e,this._mediaInfo.hasAudio=e}set overridedHasVideo(e){this._hasVideoFlagOverrided=!0,this._hasVideo=e,this._mediaInfo.hasVideo=e}resetMediaInfo(){this._mediaInfo=new U}_isInitialMetadataDispatched(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!(this._hasAudio||!this._hasVideo)&&this._videoInitialMetadataDispatched}parseChunks(e,t){if(!(this._onError&&this._onMediaInfo&&this._onTrackMetadata&&this._onDataAvailable))throw new f("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");let i=0,n=this._littleEndian;if(0===t){if(!(e.byteLength>13))return 0;i=G.probe(e).dataOffset}if(this._firstParse){this._firstParse=!1,t+i!==this._dataOffset&&u.w(this.TAG,"First time parsing but chunk byteStart invalid!"),0!==new DataView(e,i).getUint32(0,!n)&&u.w(this.TAG,"PrevTagSize0 !== 0 !!!"),i+=4}for(;ie.byteLength)break;let s=r.getUint8(0),a=16777215&r.getUint32(0,!n);if(i+11+a+4>e.byteLength)break;if(8!==s&&9!==s&&18!==s){u.w(this.TAG,`Unsupported tag type ${s}, skipped`),i+=11+a+4;continue}let o=r.getUint8(4),l=r.getUint8(5),h=r.getUint8(6)|l<<8|o<<16|r.getUint8(7)<<24;0!==(16777215&r.getUint32(7,!n))&&u.w(this.TAG,"Meet tag which has StreamID != 0!");let d=i+11;switch(s){case 8:this._parseAudioData(e,d,a,h);break;case 9:this._parseVideoData(e,d,a,h,t+i);break;case 18:this._parseScriptData(e,d,a)}let c=r.getUint32(11+a,!n);c!==11+a&&u.w(this.TAG,"Invalid PrevTagSize "+c),i+=11+a+4}return this._isInitialMetadataDispatched()&&this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack),i}_parseScriptData(e,t,i){let n=V.parseScriptData(e,t,i);if(n.hasOwnProperty("onMetaData")){if(null==n.onMetaData||"object"!=typeof n.onMetaData)return void u.w(this.TAG,"Invalid onMetaData structure!");this._metadata&&u.w(this.TAG,"Found another onMetaData tag!"),this._metadata=n;let e=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},e)),"boolean"==typeof e.hasAudio&&!1===this._hasAudioFlagOverrided&&(this._hasAudio=e.hasAudio,this._mediaInfo.hasAudio=this._hasAudio),"boolean"==typeof e.hasVideo&&!1===this._hasVideoFlagOverrided&&(this._hasVideo=e.hasVideo,this._mediaInfo.hasVideo=this._hasVideo),"number"==typeof e.audiodatarate&&(this._mediaInfo.audioDataRate=e.audiodatarate),"number"==typeof e.videodatarate&&(this._mediaInfo.videoDataRate=e.videodatarate),"number"==typeof e.width&&(this._mediaInfo.width=e.width),"number"==typeof e.height&&(this._mediaInfo.height=e.height),"number"==typeof e.duration){if(!this._durationOverrided){let t=Math.floor(e.duration*this._timescale);this._duration=t,this._mediaInfo.duration=t}}else this._mediaInfo.duration=0;if("number"==typeof e.framerate){let t=Math.floor(1e3*e.framerate);if(t>0){let e=t/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=e,this._referenceFrameRate.fps_num=t,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=e}}if("object"==typeof e.keyframes){this._mediaInfo.hasKeyframesIndex=!0;let t=e.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(t),e.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=e,u.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(n).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},n))}_parseKeyframesIndex(e){let t=[],i=[];for(let n=1;n>>4;if(2!==s&&10!==s)return void this._onError(W.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+s);let a=0,o=(12&r)>>>2;if(!(o>=0&&o<=4))return void this._onError(W.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+o);a=this._flvSoundRateTable[o];let l=1&r,h=this._audioMetadata,d=this._audioTrack;if(h||(!1===this._hasAudio&&!1===this._hasAudioFlagOverrided&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),h=this._audioMetadata={},h.type="audio",h.id=d.id,h.timescale=this._timescale,h.duration=this._duration,h.audioSampleRate=a,h.channelCount=0===l?1:2),10===s){let r=this._parseAACAudioData(e,t+1,i-1);if(null==r)return;if(0===r.packetType){h.config&&u.w(this.TAG,"Found another AudioSpecificConfig!");let e=r.data;h.audioSampleRate=e.samplingRate,h.channelCount=e.channelCount,h.codec=e.codec,h.originalCodec=e.originalCodec,h.config=e.config,h.refSampleDuration=1024/h.audioSampleRate*h.timescale,u.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",h);let t=this._mediaInfo;t.audioCodec=h.originalCodec,t.audioSampleRate=h.audioSampleRate,t.audioChannelCount=h.channelCount,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)}else if(1===r.packetType){let e=this._timestampBase+n,t={unit:r.data,length:r.data.byteLength,dts:e,pts:e};d.samples.push(t),d.length+=r.data.length}else u.e(this.TAG,"Flv: Unsupported AAC data type "+r.packetType)}else if(2===s){if(!h.codec){let n=this._parseMP3AudioData(e,t+1,i-1,!0);if(null==n)return;h.audioSampleRate=n.samplingRate,h.channelCount=n.channelCount,h.codec=n.codec,h.originalCodec=n.originalCodec,h.refSampleDuration=1152/h.audioSampleRate*h.timescale,u.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",h);let r=this._mediaInfo;r.audioCodec=h.codec,r.audioSampleRate=h.audioSampleRate,r.audioChannelCount=h.channelCount,r.audioDataRate=n.bitRate,r.hasVideo?null!=r.videoCodec&&(r.mimeType='video/x-flv; codecs="'+r.videoCodec+","+r.audioCodec+'"'):r.mimeType='video/x-flv; codecs="'+r.audioCodec+'"',r.isComplete()&&this._onMediaInfo(r)}let r=this._parseMP3AudioData(e,t+1,i-1,!1);if(null==r)return;let s=this._timestampBase+n,a={unit:r,length:r.byteLength,dts:s,pts:s};d.samples.push(a),d.length+=r.length}}_parseAACAudioData(e,t,i){if(i<=1)return void u.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!");let n={},r=new Uint8Array(e,t,i);return n.packetType=r[0],0===r[0]?n.data=this._parseAACAudioSpecificConfig(e,t+1,i-1):n.data=r.subarray(1),n}_parseAACAudioSpecificConfig(e,t,i){let n=new Uint8Array(e,t,i),r=null,s=0,a=0,o=null,l=0,h=null;if(s=a=n[0]>>>3,l=(7&n[0])<<1|n[1]>>>7,l<0||l>=this._mpegSamplingRates.length)return void this._onError(W.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");let u=this._mpegSamplingRates[l],d=(120&n[1])>>>3;if(d<0||d>=8)return void this._onError(W.FORMAT_ERROR,"Flv: AAC invalid channel configuration");5===s&&(h=(7&n[1])<<1|n[2]>>>7,o=(124&n[2])>>>2);let c=self.navigator.userAgent.toLowerCase();return-1!==c.indexOf("firefox")?l>=6?(s=5,r=new Array(4),h=l-3):(s=2,r=new Array(2),h=l):-1!==c.indexOf("android")?(s=2,r=new Array(2),h=l):(s=5,h=l,r=new Array(4),l>=6?h=l-3:1===d&&(s=2,r=new Array(2),h=l)),r[0]=s<<3,r[0]|=(15&l)>>>1,r[1]=(15&l)<<7,r[1]|=(15&d)<<3,5===s&&(r[1]|=(15&h)>>>1,r[2]=(1&h)<<7,r[2]|=8,r[3]=0),{config:r,samplingRate:u,channelCount:d,codec:"mp4a.40."+s,originalCodec:"mp4a.40."+a}}_parseMP3AudioData(e,t,i,n){if(i<4)return void u.w(this.TAG,"Flv: Invalid MP3 packet, header missing!");this._littleEndian;let r=new Uint8Array(e,t,i),s=null;if(n){if(255!==r[0])return;let e=r[1]>>>3&3,t=(6&r[1])>>1,i=(240&r[2])>>>4,n=(12&r[2])>>>2,a=3!==(r[3]>>>6&3)?2:1,o=0,l=0,h=34,u="mp3";switch(e){case 0:o=this._mpegAudioV25SampleRateTable[n];break;case 2:o=this._mpegAudioV20SampleRateTable[n];break;case 3:o=this._mpegAudioV10SampleRateTable[n]}switch(t){case 1:h=34,i>>4,o=15&s;7===o?this._parseAVCVideoPacket(e,t+1,i-1,n,r,a):this._onError(W.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: "+o)}_parseAVCVideoPacket(e,t,i,n,r,s){if(i<4)return void u.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");let a=this._littleEndian,o=new DataView(e,t,i),l=o.getUint8(0),h=(16777215&o.getUint32(0,!a))<<8>>8;if(0===l)this._parseAVCDecoderConfigurationRecord(e,t+4,i-4);else if(1===l)this._parseAVCVideoData(e,t+4,i-4,n,r,s,h);else if(2!==l)return void this._onError(W.FORMAT_ERROR,"Flv: Invalid video packet type "+l)}_parseAVCDecoderConfigurationRecord(e,t,i){if(i<7)return void u.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");let n=this._videoMetadata,r=this._videoTrack,s=this._littleEndian,a=new DataView(e,t,i);n?void 0!==n.avcc&&u.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(!1===this._hasVideo&&!1===this._hasVideoFlagOverrided&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),n=this._videoMetadata={},n.type="video",n.id=r.id,n.timescale=this._timescale,n.duration=this._duration);let o=a.getUint8(0),l=a.getUint8(1);a.getUint8(2),a.getUint8(3);if(1!==o||0===l)return void this._onError(W.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord");if(this._naluLengthSize=1+(3&a.getUint8(4)),3!==this._naluLengthSize&&4!==this._naluLengthSize)return void this._onError(W.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: "+(this._naluLengthSize-1));let h=31&a.getUint8(5);if(0===h)return void this._onError(W.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS");h>1&&u.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = "+h);let d=6;for(let i=0;i1&&u.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = "+c),d++;for(let e=0;e=i){u.w(this.TAG,`Malformed Nalu near timestamp ${_}, offset = ${c}, dataSize = ${i}`);break}let n=l.getUint32(c,!o);if(3===f&&(n>>>=8),n>i-f)return void u.w(this.TAG,`Malformed Nalus near timestamp ${_}, NaluSize > DataSize!`);let r=31&l.getUint8(c+f);5===r&&(m=!0);let s=new Uint8Array(e,t+c,f+n),a={type:r,data:s};h.push(a),d+=s.byteLength,c+=f+n}if(h.length){let e=this._videoTrack,t={units:h,length:d,isKeyframe:m,dts:_,cts:a,pts:_+a};m&&(t.fileposition=r),e.samples.push(t),e.length+=d}}}var z=G;class H{static init(){H.types={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:[],".mp3":[]};for(let e in H.types)H.types.hasOwnProperty(e)&&(H.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);let e=H.constants={};e.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),e.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),e.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),e.STSC=e.STCO=e.STTS,e.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),e.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]),e.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]),e.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),e.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),e.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}static box(e){let t=8,i=null,n=Array.prototype.slice.call(arguments,1),r=n.length;for(let e=0;e>>24&255,i[1]=t>>>16&255,i[2]=t>>>8&255,i[3]=255&t,i.set(e,4);let s=8;for(let e=0;e>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,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]))}static trak(e){return H.box(H.types.trak,H.tkhd(e),H.mdia(e))}static tkhd(e){let t=e.id,i=e.duration,n=e.presentWidth,r=e.presentHeight;return H.box(H.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t,0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,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,n>>>8&255,255&n,0,0,r>>>8&255,255&r,0,0]))}static mdia(e){return H.box(H.types.mdia,H.mdhd(e),H.hdlr(e),H.minf(e))}static mdhd(e){let t=e.timescale,i=e.duration;return H.box(H.types.mdhd,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,i>>>24&255,i>>>16&255,i>>>8&255,255&i,85,196,0,0]))}static hdlr(e){let t=null;return t="audio"===e.type?H.constants.HDLR_AUDIO:H.constants.HDLR_VIDEO,H.box(H.types.hdlr,t)}static minf(e){let t=null;return t="audio"===e.type?H.box(H.types.smhd,H.constants.SMHD):H.box(H.types.vmhd,H.constants.VMHD),H.box(H.types.minf,t,H.dinf(),H.stbl(e))}static dinf(){return H.box(H.types.dinf,H.box(H.types.dref,H.constants.DREF))}static stbl(e){return H.box(H.types.stbl,H.stsd(e),H.box(H.types.stts,H.constants.STTS),H.box(H.types.stsc,H.constants.STSC),H.box(H.types.stsz,H.constants.STSZ),H.box(H.types.stco,H.constants.STCO))}static stsd(e){return"audio"===e.type?"mp3"===e.codec?H.box(H.types.stsd,H.constants.STSD_PREFIX,H.mp3(e)):H.box(H.types.stsd,H.constants.STSD_PREFIX,H.mp4a(e)):H.box(H.types.stsd,H.constants.STSD_PREFIX,H.avc1(e))}static mp3(e){let t=e.channelCount,i=e.audioSampleRate,n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t,0,16,0,0,0,0,i>>>8&255,255&i,0,0]);return H.box(H.types[".mp3"],n)}static mp4a(e){let t=e.channelCount,i=e.audioSampleRate,n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t,0,16,0,0,0,0,i>>>8&255,255&i,0,0]);return H.box(H.types.mp4a,n,H.esds(e))}static esds(e){let t=e.config||[],i=t.length,n=new Uint8Array([0,0,0,0,3,23+i,0,1,0,4,15+i,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([i]).concat(t).concat([6,1,2]));return H.box(H.types.esds,n)}static avc1(e){let t=e.avcc,i=e.codecWidth,n=e.codecHeight,r=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,i>>>8&255,255&i,n>>>8&255,255&n,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 H.box(H.types.avc1,r,H.box(H.types.avcC,t))}static mvex(e){return H.box(H.types.mvex,H.trex(e))}static trex(e){let t=e.id,i=new Uint8Array([0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return H.box(H.types.trex,i)}static moof(e,t){return H.box(H.types.moof,H.mfhd(e.sequenceNumber),H.traf(e,t))}static mfhd(e){let t=new Uint8Array([0,0,0,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e]);return H.box(H.types.mfhd,t)}static traf(e,t){let i=e.id,n=H.box(H.types.tfhd,new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i])),r=H.box(H.types.tfdt,new Uint8Array([0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t])),s=H.sdtp(e),a=H.trun(e,s.byteLength+16+16+8+16+8+8);return H.box(H.types.traf,n,r,a,s)}static sdtp(e){let t=e.samples||[],i=t.length,n=new Uint8Array(4+i);for(let e=0;e>>24&255,n>>>16&255,n>>>8&255,255&n,t>>>24&255,t>>>16&255,t>>>8&255,255&t],0);for(let e=0;e>>24&255,t>>>16&255,t>>>8&255,255&t,n>>>24&255,n>>>16&255,n>>>8&255,255&n,r.isLeading<<2|r.dependsOn,r.isDependedOn<<6|r.hasRedundancy<<4|r.isNonSync,0,0,a>>>24&255,a>>>16&255,a>>>8&255,255&a],12+16*e)}return H.box(H.types.trun,s)}static mdat(e){return H.box(H.types.mdat,e)}}H.init();var K=H;var Q=class{static getSilentFrame(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}};class X{constructor(e,t,i,n,r){this.dts=e,this.pts=t,this.duration=i,this.originalDts=n,this.isSyncPoint=r,this.fileposition=null}}class Z{constructor(){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}appendSyncPoint(e){e.isSyncPoint=!0,this.syncPoints.push(e)}}class J{constructor(){this._list=[]}clear(){this._list=[]}appendArray(e){let t=this._list;0!==e.length&&(t.length>0&&e[0].originalDts=t[r].dts&&et[n].lastSample.originalDts&&e=t[n].lastSample.originalDts&&(n===t.length-1||n0&&(r=this._searchNearestSegmentBefore(i.originalBeginDts)+1),this._lastAppendLocation=r,this._list.splice(r,0,i)}getLastSegmentBefore(e){let t=this._searchNearestSegmentBefore(e);return t>=0?this._list[t]:null}getLastSampleBefore(e){let t=this.getLastSegmentBefore(e);return null!=t?t.lastSample:null}getLastSyncPointBefore(e){let t=this._searchNearestSegmentBefore(e),i=this._list[t].syncPoints;for(;0===i.length&&t>0;)t--,i=this._list[t].syncPoints;return i.length>0?i[i.length-1]:null}}var ee=class{constructor(e){this.TAG="MP4Remuxer",this._config=e,this._isLive=!0===e.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 $("audio"),this._videoSegmentInfoList=new $("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!(!A.chrome||!(A.version.major<50||50===A.version.major&&A.version.build<2661)),this._fillSilentAfterSeek=A.msedge||A.msie,this._mp3UseMpegAudio=!A.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}destroy(){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}bindDataSource(e){return e.onDataAvailable=this.remux.bind(this),e.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this}get onInitSegment(){return this._onInitSegment}set onInitSegment(e){this._onInitSegment=e}get onMediaSegment(){return this._onMediaSegment}set onMediaSegment(e){this._onMediaSegment=e}insertDiscontinuity(){this._audioNextDts=this._videoNextDts=void 0}seek(e){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()}remux(e,t){if(!this._onMediaSegment)throw new f("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(e,t),this._remuxVideo(t),this._remuxAudio(e)}_onTrackMetadataReceived(e,t){let i=null,n="mp4",r=t.codec;if("audio"===e)this._audioMeta=t,"mp3"===t.codec&&this._mp3UseMpegAudio?(n="mpeg",r="",i=new Uint8Array):i=K.generateInitSegment(t);else{if("video"!==e)return;this._videoMeta=t,i=K.generateInitSegment(t)}if(!this._onInitSegment)throw new f("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(e,{type:e,data:i.buffer,codec:r,container:`${e}/${n}`,mediaDuration:t.duration})}_calculateDtsBase(e,t){this._dtsBaseInited||(e.samples&&e.samples.length&&(this._audioDtsBase=e.samples[0].dts),t.samples&&t.samples.length&&(this._videoDtsBase=t.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)}flushStashedSamples(){let e=this._videoStashedLastSample,t=this._audioStashedLastSample,i={type:"video",id:1,sequenceNumber:0,samples:[],length:0};null!=e&&(i.samples.push(e),i.length=e.length);let n={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};null!=t&&(n.samples.push(t),n.length=t.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(i,!0),this._remuxAudio(n,!0)}_remuxAudio(e,t){if(null==this._audioMeta)return;let i=e,n=i.samples,r=void 0,s=-1,a=-1,o=this._audioMeta.refSampleDuration,l="mp3"===this._audioMeta.codec&&this._mp3UseMpegAudio,h=this._dtsBaseInited&&void 0===this._audioNextDts,d=!1;if(!n||0===n.length)return;if(1===n.length&&!t)return;let c=0,f=null,_=0;l?(c=0,_=i.length):(c=8,_=8+i.length);let m=null;if(n.length>1&&(m=n.pop(),_-=m.length),null!=this._audioStashedLastSample){let e=this._audioStashedLastSample;this._audioStashedLastSample=null,n.unshift(e),_+=e.length}null!=m&&(this._audioStashedLastSample=m);let p=n[0].dts-this._dtsBase;if(this._audioNextDts)r=p-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())r=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&"mp3"!==this._audioMeta.originalCodec&&(d=!0);else{let e=this._audioSegmentInfoList.getLastSampleBefore(p);if(null!=e){let t=p-(e.originalDts+e.duration);t<=3&&(t=0),r=p-(e.dts+e.duration+t)}else r=0}if(d){let e=p-r,t=this._videoSegmentInfoList.getLastSegmentBefore(p);if(null!=t&&t.beginDts=1?g[g.length-1].duration:Math.floor(o);let d=!1,c=null;if(h>1.5*o&&"mp3"!==this._audioMeta.codec&&this._fillAudioTimestampGap&&!A.safari){d=!0;let e=Math.abs(h-o),t=Math.ceil(e/o),n=l+o;u.w(this.TAG,`Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.\ndts: ${l+h} ms, expected: ${l+Math.round(o)} ms, delta: ${Math.round(e)} ms, generate: ${t} frames`);let r=Q.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);null==r&&(u.w(this.TAG,`Unable to generate silent frame for ${this._audioMeta.originalCodec} with ${this._audioMeta.channelCount} channels, repeat last frame`),r=i),c=[];for(let e=0;e0){let t=c[c.length-1];t.duration=e-t.dts}let t={dts:e,pts:e,cts:0,unit:r,size:r.byteLength,duration:0,originalDts:a,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};c.push(t),_+=t.size,n+=o}let s=c[c.length-1];s.duration=l+h-s.dts,h=Math.round(o)}g.push({dts:l,pts:l,cts:0,unit:t.unit,size:t.unit.byteLength,duration:h,originalDts:a,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),d&&g.push.apply(g,c)}l?f=new Uint8Array(_):(f=new Uint8Array(_),f[0]=_>>>24&255,f[1]=_>>>16&255,f[2]=_>>>8&255,f[3]=255&_,f.set(K.types.mdat,4));for(let e=0;e1&&(c=n.pop(),d-=c.length),null!=this._videoStashedLastSample){let e=this._videoStashedLastSample;this._videoStashedLastSample=null,n.unshift(e),d+=e.length}null!=c&&(this._videoStashedLastSample=c);let f=n[0].dts-this._dtsBase;if(this._videoNextDts)r=f-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())r=0;else{let e=this._videoSegmentInfoList.getLastSampleBefore(f);if(null!=e){let t=f-(e.originalDts+e.duration);t<=3&&(t=0),r=f-(e.dts+e.duration+t)}else r=0}let _=new Z,m=[];for(let e=0;e=1?m[m.length-1].duration:Math.floor(this._videoMeta.refSampleDuration);if(a){let e=new X(l,u,d,t.dts,!0);e.fileposition=t.fileposition,_.appendSyncPoint(e)}m.push({dts:l,pts:u,cts:h,units:t.units,size:t.length,isKeyframe:a,duration:d,originalDts:i,flags:{isLeading:0,dependsOn:a?2:1,isDependedOn:a?1:0,hasRedundancy:0,isNonSync:a?0:1}})}u=new Uint8Array(d),u[0]=d>>>24&255,u[1]=d>>>16&255,u[2]=d>>>8&255,u[3]=255&d,u.set(K.types.mdat,4);for(let e=0;e{n.timestampBase=i,i+=n.duration,n.cors=e.cors,n.withCredentials=e.withCredentials,t.referrerPolicy&&(n.referrerPolicy=t.referrerPolicy)}),isNaN(i)||this._mediaDataSource.duration===i||(this._mediaDataSource.duration=i),this._mediaInfo=null,this._demuxer=null,this._remuxer=null,this._ioctl=null,this._pendingSeekTime=null,this._pendingResolveSeekPoint=null,this._statisticsReporter=null}destroy(){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.removeAllListeners(),this._emitter=null}on(e,t){this._emitter.addListener(e,t)}off(e,t){this._emitter.removeListener(e,t)}start(){this._loadSegment(0),this._enableStatisticsReporter()}_loadSegment(e,t){this._currentSegmentIndex=e;let i=this._mediaDataSource.segments[e],n=this._ioctl=new D(i,this._config,e);n.onError=this._onIOException.bind(this),n.onSeeked=this._onIOSeeked.bind(this),n.onComplete=this._onIOComplete.bind(this),n.onRedirect=this._onIORedirect.bind(this),n.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),t?this._demuxer.bindDataSource(this._ioctl):n.onDataArrival=this._onInitChunkArrival.bind(this),n.open(t)}stop(){this._internalAbort(),this._disableStatisticsReporter()}_internalAbort(){this._ioctl&&(this._ioctl.destroy(),this._ioctl=null)}pause(){this._ioctl&&this._ioctl.isWorking()&&(this._ioctl.pause(),this._disableStatisticsReporter())}resume(){this._ioctl&&this._ioctl.isPaused()&&(this._ioctl.resume(),this._enableStatisticsReporter())}seek(e){if(null==this._mediaInfo||!this._mediaInfo.isSeekable())return;let t=this._searchSegmentIndexContains(e);if(t===this._currentSegmentIndex){let i=this._mediaInfo.segments[t];if(null==i)this._pendingSeekTime=e;else{let t=i.getNearestKeyframe(e);this._remuxer.seek(t.milliseconds),this._ioctl.seek(t.fileposition),this._pendingResolveSeekPoint=t.milliseconds}}else{let i=this._mediaInfo.segments[t];if(null==i)this._pendingSeekTime=e,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment(t);else{let n=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,n.fileposition),this._pendingResolveSeekPoint=n.milliseconds,this._reportSegmentMediaInfo(t)}}this._enableStatisticsReporter()}_searchSegmentIndexContains(e){let t=this._mediaDataSource.segments,i=t.length-1;for(let n=0;n0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,n=this._demuxer.parseChunks(e,t);else if((i=z.probe(e)).match){this._demuxer=new z(i,this._config),this._remuxer||(this._remuxer=new ee(this._config));let r=this._mediaDataSource;null==r.duration||isNaN(r.duration)||(this._demuxer.overridedDuration=r.duration),"boolean"==typeof r.hasAudio&&(this._demuxer.overridedHasAudio=r.hasAudio),"boolean"==typeof r.hasVideo&&(this._demuxer.overridedHasVideo=r.hasVideo),this._demuxer.timestampBase=r.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),n=this._demuxer.parseChunks(e,t)}else i=null,u.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then(()=>{this._internalAbort()}),this._emitter.emit(te.DEMUX_ERROR,W.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),n=0;return n}_onMediaInfo(e){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.prototype));let t=Object.assign({},e);Object.setPrototypeOf(t,U.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=t,this._reportSegmentMediaInfo(this._currentSegmentIndex),null!=this._pendingSeekTime&&Promise.resolve().then(()=>{let e=this._pendingSeekTime;this._pendingSeekTime=null,this.seek(e)})}_onMetaDataArrived(e){this._emitter.emit(te.METADATA_ARRIVED,e)}_onScriptDataArrived(e){this._emitter.emit(te.SCRIPTDATA_ARRIVED,e)}_onIOSeeked(){this._remuxer.insertDiscontinuity()}_onIOComplete(e){let t=e+1;t0&&e[0].originalDts===i&&(i=e[0].pts),this._emitter.emit(te.RECOMMEND_SEEKPOINT,i)}}_enableStatisticsReporter(){null==this._statisticsReporter&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))}_disableStatisticsReporter(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}_reportSegmentMediaInfo(e){let t=this._mediaInfo.segments[e],i=Object.assign({},t);i.duration=this._mediaInfo.duration,i.segmentCount=this._mediaInfo.segmentCount,delete i.segments,delete i.keyframesIndex,this._emitter.emit(te.MEDIA_INFO,i)}_reportStatisticsInfo(){let 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(te.STATISTICS_INFO,e)}};var ne=function(e){let t=null,i=function(t,i){e.postMessage({msg:"logcat_callback",data:{type:t,logcat:i}})}.bind(this);function n(t,i){let n={msg:te.INIT_SEGMENT,data:{type:t,data:i}};e.postMessage(n,[i.data])}function r(t,i){let n={msg:te.MEDIA_SEGMENT,data:{type:t,data:i}};e.postMessage(n,[i.data])}function s(){let t={msg:te.LOADING_COMPLETE};e.postMessage(t)}function o(){let t={msg:te.RECOVERED_EARLY_EOF};e.postMessage(t)}function l(t){let i={msg:te.MEDIA_INFO,data:t};e.postMessage(i)}function h(t){let i={msg:te.METADATA_ARRIVED,data:t};e.postMessage(i)}function u(t){let i={msg:te.SCRIPTDATA_ARRIVED,data:t};e.postMessage(i)}function d(t){let i={msg:te.STATISTICS_INFO,data:t};e.postMessage(i)}function c(t,i){e.postMessage({msg:te.IO_ERROR,data:{type:t,info:i}})}function f(t,i){e.postMessage({msg:te.DEMUX_ERROR,data:{type:t,info:i}})}function _(t){e.postMessage({msg:te.RECOMMEND_SEEKPOINT,data:t})}a.install(),e.addEventListener("message",(function(a){switch(a.data.cmd){case"init":t=new ie(a.data.param[0],a.data.param[1]),t.on(te.IO_ERROR,c.bind(this)),t.on(te.DEMUX_ERROR,f.bind(this)),t.on(te.INIT_SEGMENT,n.bind(this)),t.on(te.MEDIA_SEGMENT,r.bind(this)),t.on(te.LOADING_COMPLETE,s.bind(this)),t.on(te.RECOVERED_EARLY_EOF,o.bind(this)),t.on(te.MEDIA_INFO,l.bind(this)),t.on(te.METADATA_ARRIVED,h.bind(this)),t.on(te.SCRIPTDATA_ARRIVED,u.bind(this)),t.on(te.STATISTICS_INFO,d.bind(this)),t.on(te.RECOMMEND_SEEKPOINT,_.bind(this));break;case"destroy":t&&(t.destroy(),t=null),e.postMessage({msg:"destroyed"});break;case"start":t.start();break;case"stop":t.stop();break;case"seek":t.seek(a.data.param);break;case"pause":t.pause();break;case"resume":t.resume();break;case"logging_config":{let e=a.data.param;x.applyConfig(e),!0===e.enableCallback?x.addLogListener(i):x.removeLogListener(i);break}}}))};var re=class{constructor(e,t){if(this.TAG="Transmuxer",this._emitter=new l.a,t.enableWorker&&"undefined"!=typeof Worker)try{let n=i(14);this._worker=n(ne),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[e,t]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},x.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:x.getConfig()})}catch(i){u.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new ie(e,t)}else this._controller=new ie(e,t);if(this._controller){let e=this._controller;e.on(te.IO_ERROR,this._onIOError.bind(this)),e.on(te.DEMUX_ERROR,this._onDemuxError.bind(this)),e.on(te.INIT_SEGMENT,this._onInitSegment.bind(this)),e.on(te.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),e.on(te.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),e.on(te.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),e.on(te.MEDIA_INFO,this._onMediaInfo.bind(this)),e.on(te.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),e.on(te.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),e.on(te.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),e.on(te.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}destroy(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),x.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null}on(e,t){this._emitter.addListener(e,t)}off(e,t){this._emitter.removeListener(e,t)}hasWorker(){return null!=this._worker}open(){this._worker?this._worker.postMessage({cmd:"start"}):this._controller.start()}close(){this._worker?this._worker.postMessage({cmd:"stop"}):this._controller.stop()}seek(e){this._worker?this._worker.postMessage({cmd:"seek",param:e}):this._controller.seek(e)}pause(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()}resume(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()}_onInitSegment(e,t){Promise.resolve().then(()=>{this._emitter.emit(te.INIT_SEGMENT,e,t)})}_onMediaSegment(e,t){Promise.resolve().then(()=>{this._emitter.emit(te.MEDIA_SEGMENT,e,t)})}_onLoadingComplete(){Promise.resolve().then(()=>{this._emitter.emit(te.LOADING_COMPLETE)})}_onRecoveredEarlyEof(){Promise.resolve().then(()=>{this._emitter.emit(te.RECOVERED_EARLY_EOF)})}_onMediaInfo(e){Promise.resolve().then(()=>{this._emitter.emit(te.MEDIA_INFO,e)})}_onMetaDataArrived(e){Promise.resolve().then(()=>{this._emitter.emit(te.METADATA_ARRIVED,e)})}_onScriptDataArrived(e){Promise.resolve().then(()=>{this._emitter.emit(te.SCRIPTDATA_ARRIVED,e)})}_onStatisticsInfo(e){Promise.resolve().then(()=>{this._emitter.emit(te.STATISTICS_INFO,e)})}_onIOError(e,t){Promise.resolve().then(()=>{this._emitter.emit(te.IO_ERROR,e,t)})}_onDemuxError(e,t){Promise.resolve().then(()=>{this._emitter.emit(te.DEMUX_ERROR,e,t)})}_onRecommendSeekpoint(e){Promise.resolve().then(()=>{this._emitter.emit(te.RECOMMEND_SEEKPOINT,e)})}_onLoggingConfigChanged(e){this._worker&&this._worker.postMessage({cmd:"logging_config",param:e})}_onWorkerMessage(e){let t=e.data,i=t.data;if("destroyed"===t.msg||this._workerDestroying)return this._workerDestroying=!1,this._worker.terminate(),void(this._worker=null);switch(t.msg){case te.INIT_SEGMENT:case te.MEDIA_SEGMENT:this._emitter.emit(t.msg,i.type,i.data);break;case te.LOADING_COMPLETE:case te.RECOVERED_EARLY_EOF:this._emitter.emit(t.msg);break;case te.MEDIA_INFO:Object.setPrototypeOf(i,U.prototype),this._emitter.emit(t.msg,i);break;case te.METADATA_ARRIVED:case te.SCRIPTDATA_ARRIVED:case te.STATISTICS_INFO:this._emitter.emit(t.msg,i);break;case te.IO_ERROR:case te.DEMUX_ERROR:this._emitter.emit(t.msg,i.type,i.info);break;case te.RECOMMEND_SEEKPOINT:this._emitter.emit(t.msg,i);break;case"logcat_callback":u.emitter.emit("log",i.type,i.logcat)}}};var se={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"};var ae=class{constructor(e){this.TAG="MSEController",this._config=e,this._emitter=new l.a,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),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},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 J}destroy(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null}on(e,t){this._emitter.addListener(e,t)}off(e,t){this._emitter.removeListener(e,t)}attachMediaElement(e){if(this._mediaSource)throw new f("MediaSource has been attached to an HTMLMediaElement!");let t=this._mediaSource=new window.MediaSource;t.addEventListener("sourceopen",this.e.onSourceOpen),t.addEventListener("sourceended",this.e.onSourceEnded),t.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=e,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),e.src=this._mediaSourceObjectURL}detachMediaElement(){if(this._mediaSource){let e=this._mediaSource;for(let t in this._sourceBuffers){let i=this._pendingSegments[t];i.splice(0,i.length),this._pendingSegments[t]=null,this._pendingRemoveRanges[t]=null,this._lastInitSegments[t]=null;let n=this._sourceBuffers[t];if(n){if("closed"!==e.readyState){try{e.removeSourceBuffer(n)}catch(e){u.e(this.TAG,e.message)}n.removeEventListener("error",this.e.onSourceBufferError),n.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[t]=null,this._sourceBuffers[t]=null}}if("open"===e.readyState)try{e.endOfStream()}catch(e){u.e(this.TAG,e.message)}e.removeEventListener("sourceopen",this.e.onSourceOpen),e.removeEventListener("sourceended",this.e.onSourceEnded),e.removeEventListener("sourceclose",this.e.onSourceClose),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)}appendInitSegment(e,t){if(!this._mediaSource||"open"!==this._mediaSource.readyState)return this._pendingSourceBufferInit.push(e),void this._pendingSegments[e.type].push(e);let i=e,n=""+i.container;i.codec&&i.codec.length>0&&(n+=";codecs="+i.codec);let r=!1;if(u.v(this.TAG,"Received Initialization Segment, mimeType: "+n),this._lastInitSegments[i.type]=i,n!==this._mimeTypes[i.type]){if(this._mimeTypes[i.type])u.v(this.TAG,`Notice: ${i.type} mimeType changed, origin: ${this._mimeTypes[i.type]}, target: ${n}`);else{r=!0;try{let e=this._sourceBuffers[i.type]=this._mediaSource.addSourceBuffer(n);e.addEventListener("error",this.e.onSourceBufferError),e.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(e){return u.e(this.TAG,e.message),void this._emitter.emit(se.ERROR,{code:e.code,msg:e.message})}}this._mimeTypes[i.type]=n}t||this._pendingSegments[i.type].push(i),r||this._sourceBuffers[i.type]&&!this._sourceBuffers[i.type].updating&&this._doAppendSegments(),A.safari&&"audio/mpeg"===i.container&&i.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=i.mediaDuration/1e3,this._updateMediaSourceDuration())}appendMediaSegment(e){let t=e;this._pendingSegments[t.type].push(t),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();let i=this._sourceBuffers[t.type];!i||i.updating||this._hasPendingRemoveRanges()||this._doAppendSegments()}seek(e){for(let e in this._sourceBuffers){if(!this._sourceBuffers[e])continue;let t=this._sourceBuffers[e];if("open"===this._mediaSource.readyState)try{t.abort()}catch(e){u.e(this.TAG,e.message)}this._idrList.clear();let i=this._pendingSegments[e];if(i.splice(0,i.length),"closed"!==this._mediaSource.readyState){for(let i=0;i=1&&e-t.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1}_doCleanupSourceBuffer(){let e=this._mediaElement.currentTime;for(let t in this._sourceBuffers){let i=this._sourceBuffers[t];if(i){let n=i.buffered,r=!1;for(let i=0;i=this._config.autoCleanupMaxBackwardDuration){r=!0;let i=e-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[t].push({start:s,end:i})}}else a0&&(isNaN(t)||i>t)&&(u.v(this.TAG,`Update MediaSource duration from ${t} to ${i}`),this._mediaSource.duration=i),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}_doRemoveRanges(){for(let e in this._pendingRemoveRanges){if(!this._sourceBuffers[e]||this._sourceBuffers[e].updating)continue;let t=this._sourceBuffers[e],i=this._pendingRemoveRanges[e];for(;i.length&&!t.updating;){let e=i.shift();t.remove(e.start,e.end)}}}_doAppendSegments(){let e=this._pendingSegments;for(let t in e)if(this._sourceBuffers[t]&&!this._sourceBuffers[t].updating&&e[t].length>0){let i=e[t].shift();if(i.timestampOffset){let e=this._sourceBuffers[t].timestampOffset,n=i.timestampOffset/1e3;Math.abs(e-n)>.1&&(u.v(this.TAG,`Update MPEG audio timestampOffset from ${e} to ${n}`),this._sourceBuffers[t].timestampOffset=n),delete i.timestampOffset}if(!i.data||0===i.data.byteLength)continue;try{this._sourceBuffers[t].appendBuffer(i.data),this._isBufferFull=!1,"video"===t&&i.hasOwnProperty("info")&&this._idrList.appendArray(i.info.syncPoints)}catch(e){this._pendingSegments[t].unshift(i),22===e.code?(this._isBufferFull||this._emitter.emit(se.BUFFER_FULL),this._isBufferFull=!0):(u.e(this.TAG,e.message),this._emitter.emit(se.ERROR,{code:e.code,msg:e.message}))}}}_onSourceOpen(){if(u.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0){let e=this._pendingSourceBufferInit;for(;e.length;){let t=e.shift();this.appendInitSegment(t,!0)}}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(se.SOURCE_OPEN)}_onSourceEnded(){u.v(this.TAG,"MediaSource onSourceEnded")}_onSourceClose(){u.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))}_hasPendingSegments(){let e=this._pendingSegments;return e.video.length>0||e.audio.length>0}_hasPendingRemoveRanges(){let e=this._pendingRemoveRanges;return e.video.length>0||e.audio.length>0}_onSourceBufferUpdateEnd(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(se.UPDATE_END)}_onSourceBufferError(e){u.e(this.TAG,"SourceBuffer Error: "+e)}};const oe={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},le={NETWORK_EXCEPTION:g.EXCEPTION,NETWORK_STATUS_CODE_INVALID:g.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:g.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:g.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:W.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:W.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:W.CODEC_UNSUPPORTED};var he=class{constructor(e,t){if(this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new l.a,this._config=L(),"object"==typeof t&&Object.assign(this._config,t),"flv"!==e.type.toLowerCase())throw new _("FlvPlayer requires an flv MediaDataSource input!");!0===e.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=e,this._mediaElement=null,this._msectl=null,this._transmuxer=null,this._mseSourceOpened=!1,this._hasPendingLoad=!1,this._receivedCanPlay=!1,this._mediaInfo=null,this._statisticsInfo=null;let i=A.chrome&&(A.version.major<50||50===A.version.major&&A.version.build<2661);this._alwaysSeekKeyframe=!!(i||A.msedge||A.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}destroy(){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.removeAllListeners(),this._emitter=null}on(e,t){e===C.MEDIA_INFO?null!=this._mediaInfo&&Promise.resolve().then(()=>{this._emitter.emit(C.MEDIA_INFO,this.mediaInfo)}):e===C.STATISTICS_INFO&&null!=this._statisticsInfo&&Promise.resolve().then(()=>{this._emitter.emit(C.STATISTICS_INFO,this.statisticsInfo)}),this._emitter.addListener(e,t)}off(e,t){this._emitter.removeListener(e,t)}attachMediaElement(e){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 ae(this._config),this._msectl.on(se.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(se.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(se.SOURCE_OPEN,()=>{this._mseSourceOpened=!0,this._hasPendingLoad&&(this._hasPendingLoad=!1,this.load())}),this._msectl.on(se.ERROR,e=>{this._emitter.emit(C.ERROR,oe.MEDIA_ERROR,le.MEDIA_MSE_ERROR,e)}),this._msectl.attachMediaElement(e),null!=this._pendingSeekTime)try{e.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(e){}}detachMediaElement(){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)}load(){if(!this._mediaElement)throw new f("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new f("FlvPlayer.load() has been called, please call unload() first!");this._hasPendingLoad||(this._config.deferLoadAfterSourceOpen&&!1===this._mseSourceOpened?this._hasPendingLoad=!0:(this._mediaElement.readyState>0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new re(this._mediaDataSource,this._config),this._transmuxer.on(te.INIT_SEGMENT,(e,t)=>{this._msectl.appendInitSegment(t)}),this._transmuxer.on(te.MEDIA_SEGMENT,(e,t)=>{if(this._msectl.appendMediaSegment(t),this._config.lazyLoad&&!this._config.isLive){let e=this._mediaElement.currentTime;t.info.endDts>=1e3*(e+this._config.lazyLoadMaxDuration)&&null==this._progressChecker&&(u.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}}),this._transmuxer.on(te.LOADING_COMPLETE,()=>{this._msectl.endOfStream(),this._emitter.emit(C.LOADING_COMPLETE)}),this._transmuxer.on(te.RECOVERED_EARLY_EOF,()=>{this._emitter.emit(C.RECOVERED_EARLY_EOF)}),this._transmuxer.on(te.IO_ERROR,(e,t)=>{this._emitter.emit(C.ERROR,oe.NETWORK_ERROR,e,t)}),this._transmuxer.on(te.DEMUX_ERROR,(e,t)=>{this._emitter.emit(C.ERROR,oe.MEDIA_ERROR,e,{code:-1,msg:t})}),this._transmuxer.on(te.MEDIA_INFO,e=>{this._mediaInfo=e,this._emitter.emit(C.MEDIA_INFO,Object.assign({},e))}),this._transmuxer.on(te.METADATA_ARRIVED,e=>{this._emitter.emit(C.METADATA_ARRIVED,e)}),this._transmuxer.on(te.SCRIPTDATA_ARRIVED,e=>{this._emitter.emit(C.SCRIPTDATA_ARRIVED,e)}),this._transmuxer.on(te.STATISTICS_INFO,e=>{this._statisticsInfo=this._fillStatisticsInfo(e),this._emitter.emit(C.STATISTICS_INFO,Object.assign({},this._statisticsInfo))}),this._transmuxer.on(te.RECOMMEND_SEEKPOINT,e=>{this._mediaElement&&!this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=e/1e3)}),this._transmuxer.open()))}unload(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)}play(){return this._mediaElement.play()}pause(){this._mediaElement.pause()}get type(){return this._type}get buffered(){return this._mediaElement.buffered}get duration(){return this._mediaElement.duration}get volume(){return this._mediaElement.volume}set volume(e){this._mediaElement.volume=e}get muted(){return this._mediaElement.muted}set muted(e){this._mediaElement.muted=e}get currentTime(){return this._mediaElement?this._mediaElement.currentTime:0}set currentTime(e){this._mediaElement?this._internalSeek(e):this._pendingSeekTime=e}get mediaInfo(){return Object.assign({},this._mediaInfo)}get statisticsInfo(){return null==this._statisticsInfo&&(this._statisticsInfo={}),this._statisticsInfo=this._fillStatisticsInfo(this._statisticsInfo),Object.assign({},this._statisticsInfo)}_fillStatisticsInfo(e){if(e.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return e;let t=!0,i=0,n=0;if(this._mediaElement.getVideoPlaybackQuality){let e=this._mediaElement.getVideoPlaybackQuality();i=e.totalVideoFrames,n=e.droppedVideoFrames}else null!=this._mediaElement.webkitDecodedFrameCount?(i=this._mediaElement.webkitDecodedFrameCount,n=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=i,e.droppedFrames=n),e}_onmseUpdateEnd(){if(!this._config.lazyLoad||this._config.isLive)return;let e=this._mediaElement.buffered,t=this._mediaElement.currentTime,i=0,n=0;for(let r=0;r=t+this._config.lazyLoadMaxDuration&&null==this._progressChecker&&(u.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}_onmseBufferFull(){u.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),null==this._progressChecker&&this._suspendTransmuxer()}_suspendTransmuxer(){this._transmuxer&&(this._transmuxer.pause(),null==this._progressChecker&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))}_checkProgressAndResume(){let e=this._mediaElement.currentTime,t=this._mediaElement.buffered,i=!1;for(let n=0;n=r&&e=s-this._config.lazyLoadRecoverDuration&&(i=!0);break}}i&&(window.clearInterval(this._progressChecker),this._progressChecker=null,i&&(u.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))}_isTimepointBuffered(e){let t=this._mediaElement.buffered;for(let i=0;i=n&&e0){let t=this._mediaElement.buffered.start(0);(t<1&&e0&&t.currentTime0){let e=i.start(0);if(e<1&&t{this._emitter.emit(C.MEDIA_INFO,this.mediaInfo)}):e===C.STATISTICS_INFO&&null!=this._mediaElement&&0!==this._mediaElement.readyState&&Promise.resolve().then(()=>{this._emitter.emit(C.STATISTICS_INFO,this.statisticsInfo)}),this._emitter.addListener(e,t)}off(e,t){this._emitter.removeListener(e,t)}attachMediaElement(e){if(this._mediaElement=e,e.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),null!=this._pendingSeekTime)try{e.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(e){}}detachMediaElement(){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)}load(){if(!this._mediaElement)throw new f("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)}unload(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),null!=this._statisticsReporter&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}play(){return this._mediaElement.play()}pause(){this._mediaElement.pause()}get type(){return this._type}get buffered(){return this._mediaElement.buffered}get duration(){return this._mediaElement.duration}get volume(){return this._mediaElement.volume}set volume(e){this._mediaElement.volume=e}get muted(){return this._mediaElement.muted}set muted(e){this._mediaElement.muted=e}get currentTime(){return this._mediaElement?this._mediaElement.currentTime:0}set currentTime(e){this._mediaElement?this._mediaElement.currentTime=e:this._pendingSeekTime=e}get mediaInfo(){let 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}get statisticsInfo(){let e={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return e;let t=!0,i=0,n=0;if(this._mediaElement.getVideoPlaybackQuality){let e=this._mediaElement.getVideoPlaybackQuality();i=e.totalVideoFrames,n=e.droppedVideoFrames}else null!=this._mediaElement.webkitDecodedFrameCount?(i=this._mediaElement.webkitDecodedFrameCount,n=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=i,e.droppedFrames=n),e}_onvLoadedMetadata(e){null!=this._pendingSeekTime&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(C.MEDIA_INFO,this.mediaInfo)}_reportStatisticsInfo(){this._emitter.emit(C.STATISTICS_INFO,this.statisticsInfo)}};a.install();let de={createPlayer:function(e,t){let i=e;if(null==i||"object"!=typeof i)throw new _("MediaDataSource must be an javascript object!");if(!i.hasOwnProperty("type"))throw new _("MediaDataSource must has type field to indicate video file type!");switch(i.type){case"flv":return new he(i,t);default:return new ue(i,t)}},isSupported:function(){return O.supportMSEH264Playback()},getFeatureList:function(){return O.getFeatureList()}};de.BaseLoader=y,de.LoaderStatus=p,de.LoaderErrors=g,de.Events=C,de.ErrorTypes=oe,de.ErrorDetails=le,de.FlvPlayer=he,de.NativePlayer=ue,de.LoggingControl=x,Object.defineProperty(de,"version",{enumerable:!0,get:function(){return"__VERSION__"}});var ce=de,fe=i(2),_e=i.n(fe),me=i(5),pe={insert:"head",singleton:!1};_e()(me.a,pe),me.a.locals;function ge(e){return(ge="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})(e)}function ye(e,t){for(var i=0;i0?i:null}}],(i=[{key:"shouldComponentUpdate",value:function(e){return this.props.serviceData.length!==e.serviceData}},{key:"componentDidMount",value:function(){var e=this;this.init(),window.addEventListener("resize",(function(){e.init()}))}},{key:"init",value:function(){this.setCanvasSize()}},{key:"setCanvasSize",value:function(){var e=this.state.id,t=document.getElementById(e).parentNode,i=t.offsetWidth,n=t.offsetHeight;this.setData({width:i+"px",height:n+"px"})}},{key:"draw",value:function(){var e=this.state,t=e.id,i=e.serviceData,n=e.width,r=e.height,s=e.mode,a=e.disabled,o=document.getElementById(t).getContext("2d");o.clearRect(0,0,parseFloat(n),parseFloat(r)),this.drawLine(o,i),this.drawCircleAll(o,i),this.drawWriting(o,i),"false"===a&&("click"===s?this.isontouchend()?this.touchMove():this.clickMove():this.isontouchend()?this.touchMove():this.mouseMove())}},{key:"isontouchend",value:function(){return"ontouchend"in document}},{key:"drawCircleAll",value:function(e,t){for(var i=0;ih&&(h=parseFloat(t[d][0])),parseFloat(t[d][1])0?i:null}}],(i=[{key:"componentDidMount",value:function(){var e=this.state.mode;"react"===e?this.setReact():"polygon"===e&&this.setPolygon()}},{key:"isNull",value:function(){var e=document.getElementById(this.myRef.state.id),t=document.createElement("canvas");return t.width=e.width,t.height=e.height,e.toDataURL()==t.toDataURL()}},{key:"setReact",value:function(){var e=this;this.count=0;var t=document.getElementById(this.myRef.state.id),i=function(t){var i=JSON.parse(JSON.stringify(e.state.serviceData)),n=t.layerX,r=t.layerY;if(0===e.count)i[1][1]=r,i[2]=[n,r],i[3][0]=n;else if(e.myRef.selectedIndex||0===e.myRef.selectedIndex)switch(i[e.myRef.selectedIndex]=[n,r],e.myRef.selectedIndex){case 0:i[1][0]=n,i[3][1]=r;break;case 1:i[0][0]=n,i[2][1]=r;break;case 2:i[1][1]=r,i[3][0]=n;break;case 3:i[0][1]=r,i[2][0]=n}e.setState({serviceData:i},(function(){e.myRef.draw()}))};t.addEventListener("mousedown",(function(n){if(2!==n.button){var r=[n.layerX,n.layerY];if(0===e.state.serviceData.length){e.count++;var s=[[].concat(r),[].concat(r),[].concat(r),[].concat(r)];e.setState({serviceData:s},(function(){e.myRef.draw()}))}t.addEventListener("mousemove",i)}})),t.addEventListener("mouseup",(function(e){t.removeEventListener("mousemove",i)})),t.oncontextmenu=function(e){e.preventDefault()}}},{key:"setPolygon",value:function(){var e=this;this.polygonCount=0;var t=document.getElementById(this.myRef.state.id);t.onclick=function(t){var i=t.layerX,n=t.layerY,r=e.state.serviceData;r.push([i,n]),e.setState({serviceData:r},(function(){e.myRef.draw()}))},t.oncontextmenu=function(i){i.preventDefault(),2===i.button&&(0==e.polygonCount&&(e.polygonCount++,e.sendFather(e.state.serviceData)),t.onclick=null)}}},{key:"change",value:function(e){this.sendFather(e)}},{key:"sendFather",value:function(e){"true"!==this.state.disabled&&this.props.change(e)}},{key:"render",value:function(){var e=this,t=this.state.serviceData;return r.a.createElement(Qe,{ref:function(t){e.myRef=t},serviceData:t,change:function(t){return e.change(t)}})}}])&&Ze(t.prototype,i),n&&Ze(t,n),a}(n.Component);function nt(e){return(nt="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})(e)}function rt(e,t){for(var i=0;iMath.min(n[0],r[0])&&e[0]<=Math.max(n[0],r[0])&&e[1]<=Math.max(n[1],r[1])&&n[0]!=r[0]&&(i=(e[0]-n[0])*(r[1]-n[1])/(r[0]-n[0])+n[1],(n[1]==r[1]||e[1]<=i)&&s++),n=r;return s%2!=0}},{key:"render",value:function(){var e=this,t=this.state,i=t.id,n=t.list;return r.a.createElement("div",{id:i,style:{width:"100%",height:"100%",position:"relative"}},r.a.createElement("button",{style:{position:"absolute",right:"-20px",top:"0"},onClick:function(){return e.clickIt()}},"添加"),n.map((function(t,i){return r.a.createElement(it,{key:i,ref:t.id+t.mode,mode:t.mode,change:function(t){return e.change(t)}})})))}}])&&rt(t.prototype,i),n&&rt(t,n),a}(n.Component)}])}));