@byteplus/veplayer 1.15.3-rc.34 → 1.15.3-rc.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +54 -6
- package/index.min.js +2 -2
- package/lite.cjs +2 -2
- package/lite.d.ts +30 -0
- package/lite.esm.mjs +2 -2
- package/lite.min.js +2 -2
- package/package.json +1 -1
- package/plugin/modules/DashAbralgo.mjs +1 -1
- package/plugin/modules/XGVideo.mjs +1 -1
- package/plugin/modules/danmuMask.mjs +1 -1
- package/plugin/modules/danmujs.mjs +1 -1
- package/plugin/modules/dash.mjs +1 -1
- package/plugin/modules/flv.mjs +1 -1
- package/plugin/modules/hls.mjs +1 -1
- package/plugin/modules/hlsEncrypt.mjs +1 -1
- package/plugin/modules/mp4Encrypt.mjs +1 -1
- package/plugin/modules/preloader.mjs +1 -1
- package/plugin/modules/streamprobe.mjs +1 -1
- package/plugin/modules/vestrategy.mjs +1 -1
- package/plugin/modules/vestrategy_adapt_range.mjs +1 -1
- package/plugin/modules/vestrategy_h265.mjs +1 -1
- package/plugin/modules/vestrategy_preload.mjs +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// @byteplus/veplayer@1.15.3-rc.
|
|
1
|
+
// @byteplus/veplayer@1.15.3-rc.36 Built @8/10/2026, 4:48:34 PM
|
|
2
2
|
function ownKeys$2(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$2(Object(r),!0).forEach((function(t){_defineProperty$2(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys$2(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _regeneratorRuntime$1(){_regeneratorRuntime$1=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function u(e,t,r,i){var o=t&&t.prototype instanceof d?t:d,a=Object.create(o.prototype),s=new I(i||[]);return n(a,"_invoke",{value:$(e,r,s)}),a}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var A={};function d(){}function h(){}function f(){}var p={};c(p,o,(function(){return this}));var y=Object.getPrototypeOf,_=y&&y(y(S([])));_&&_!==t&&r.call(_,o)&&(p=_);var E=f.prototype=d.prototype=Object.create(p);function g(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function m(e,t){function i(n,o,a,s){var c=l(e[n],e,o);if("throw"!==c.type){var u=c.arg,A=u.value;return A&&"object"==typeof A&&r.call(A,"__await")?t.resolve(A.__await).then((function(e){i("next",e,a,s)}),(function(e){i("throw",e,a,s)})):t.resolve(A).then((function(e){u.value=e,a(u)}),(function(e){return i("throw",e,a,s)}))}s(c.arg)}var o;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){i(e,r,t,n)}))}return o=o?o.then(n,n):n()}})}function $(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return{value:void 0,done:!0}}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=v(a,r);if(s){if(s===A)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=l(e,t,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===A)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function v(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,v(e,t),"throw"===t.method))return A;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return A}var n=l(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,A;var i=n.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,A):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,A)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function b(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:R}}function R(){return{value:void 0,done:!0}}return h.prototype=f,n(E,"constructor",{value:f,configurable:!0}),n(f,"constructor",{value:h,configurable:!0}),h.displayName=c(f,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,c(e,s,"GeneratorFunction")),e.prototype=Object.create(E),e},e.awrap=function(e){return{__await:e}},g(m.prototype),c(m.prototype,a,(function(){return this})),e.AsyncIterator=m,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new m(u(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},g(E),c(E,s,"Generator"),c(E,o,(function(){return this})),c(E,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(b),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,A):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),A},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),b(r),A}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;b(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),A}},e}function asyncGeneratorStep$1(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,i)}function _asyncToGenerator$1(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){asyncGeneratorStep$1(o,n,i,a,s,"next",e)}function s(e){asyncGeneratorStep$1(o,n,i,a,s,"throw",e)}a(void 0)}))}}function _classCallCheck$2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties$2(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass$2(e,t,r){return t&&_defineProperties$2(e.prototype,t),r&&_defineProperties$2(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty$2(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _inherits$1(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf$1(e,t)}function _getPrototypeOf$1(e){return(_getPrototypeOf$1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _setPrototypeOf$1(e,t){return(_setPrototypeOf$1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function _isNativeReflectConstruct$1(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _assertThisInitialized$1(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _possibleConstructorReturn$1(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$1(e)}function _createSuper$1(e){var t=_isNativeReflectConstruct$1();return function(){var r,n=_getPrototypeOf$1(e);if(t){var i=_getPrototypeOf$1(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return _possibleConstructorReturn$1(this,r)}}function _superPropBase(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf$1(e)););return e}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=_superPropBase(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},_get.apply(this,arguments)}function _slicedToArray$1(e,t){return _arrayWithHoles$1(e)||_iterableToArrayLimit$1(e,t)||_unsupportedIterableToArray$1(e,t)||_nonIterableRest$1()}function _toConsumableArray$1(e){return _arrayWithoutHoles$1(e)||_iterableToArray$1(e)||_unsupportedIterableToArray$1(e)||_nonIterableSpread$1()}function _arrayWithoutHoles$1(e){if(Array.isArray(e))return _arrayLikeToArray$1(e)}function _arrayWithHoles$1(e){if(Array.isArray(e))return e}function _iterableToArray$1(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _iterableToArrayLimit$1(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}}function _unsupportedIterableToArray$1(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray$1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray$1(e,t):void 0}}function _arrayLikeToArray$1(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _nonIterableSpread$1(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _nonIterableRest$1(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var check=function(e){return e&&e.Math==Math&&e},global$D=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof commonjsGlobal&&commonjsGlobal)||function(){return this}()||Function("return this")(),shared$4={exports:{}},isPure=!1,global$C=global$D,defineProperty$a=Object.defineProperty,defineGlobalProperty$3=function(e,t){try{defineProperty$a(global$C,e,{value:t,configurable:!0,writable:!0})}catch(r){global$C[e]=t}return t},global$B=global$D,defineGlobalProperty$2=defineGlobalProperty$3,SHARED="__core-js_shared__",store$3=global$B[SHARED]||defineGlobalProperty$2(SHARED,{}),sharedStore=store$3,store$2=sharedStore;(shared$4.exports=function(e,t){return store$2[e]||(store$2[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.26.1",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.26.1/LICENSE",source:"https://github.com/zloirock/core-js"});var match,version,sharedExports=shared$4.exports,fails$E=function(e){try{return!!e()}catch(e){return!0}},fails$D=fails$E,functionBindNative=!fails$D((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),NATIVE_BIND$3=functionBindNative,FunctionPrototype$3=Function.prototype,call$p=FunctionPrototype$3.call,uncurryThisWithBind=NATIVE_BIND$3&&FunctionPrototype$3.bind.bind(call$p,call$p),functionUncurryThis=NATIVE_BIND$3?uncurryThisWithBind:function(e){return function(){return call$p.apply(e,arguments)}},isNullOrUndefined$5=function(e){return null==e},isNullOrUndefined$4=isNullOrUndefined$5,$TypeError$i=TypeError,requireObjectCoercible$6=function(e){if(isNullOrUndefined$4(e))throw $TypeError$i("Can't call method on "+e);return e},requireObjectCoercible$5=requireObjectCoercible$6,$Object$4=Object,toObject$f=function(e){return $Object$4(requireObjectCoercible$5(e))},uncurryThis$D=functionUncurryThis,toObject$e=toObject$f,hasOwnProperty=uncurryThis$D({}.hasOwnProperty),hasOwnProperty_1=Object.hasOwn||function(e,t){return hasOwnProperty(toObject$e(e),t)},uncurryThis$C=functionUncurryThis,id=0,postfix=Math.random(),toString$c=uncurryThis$C(1..toString),uid$3=function(e){return"Symbol("+(void 0===e?"":e)+")_"+toString$c(++id+postfix,36)},documentAll$2="object"==typeof document&&document.all,IS_HTMLDDA=void 0===documentAll$2&&void 0!==documentAll$2,documentAll_1={all:documentAll$2,IS_HTMLDDA:IS_HTMLDDA},$documentAll$1=documentAll_1,documentAll$1=$documentAll$1.all,isCallable$r=$documentAll$1.IS_HTMLDDA?function(e){return"function"==typeof e||e===documentAll$1}:function(e){return"function"==typeof e},global$A=global$D,isCallable$q=isCallable$r,aFunction=function(e){return isCallable$q(e)?e:void 0},getBuiltIn$9=function(e,t){return arguments.length<2?aFunction(global$A[e]):global$A[e]&&global$A[e][t]},getBuiltIn$8=getBuiltIn$9,engineUserAgent=getBuiltIn$8("navigator","userAgent")||"",global$z=global$D,userAgent$5=engineUserAgent,process$3=global$z.process,Deno$1=global$z.Deno,versions=process$3&&process$3.versions||Deno$1&&Deno$1.version,v8=versions&&versions.v8;v8&&(version=(match=v8.split("."))[0]>0&&match[0]<4?1:+(match[0]+match[1])),!version&&userAgent$5&&(!(match=userAgent$5.match(/Edge\/(\d+)/))||match[1]>=74)&&(match=userAgent$5.match(/Chrome\/(\d+)/))&&(version=+match[1]);var engineV8Version=version,V8_VERSION$3=engineV8Version,fails$C=fails$E,symbolConstructorDetection=!!Object.getOwnPropertySymbols&&!fails$C((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&V8_VERSION$3&&V8_VERSION$3<41})),NATIVE_SYMBOL$1=symbolConstructorDetection,useSymbolAsUid=NATIVE_SYMBOL$1&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,global$y=global$D,shared$3=sharedExports,hasOwn$f=hasOwnProperty_1,uid$2=uid$3,NATIVE_SYMBOL=symbolConstructorDetection,USE_SYMBOL_AS_UID$1=useSymbolAsUid,WellKnownSymbolsStore=shared$3("wks"),Symbol$2=global$y.Symbol,symbolFor=Symbol$2&&Symbol$2.for,createWellKnownSymbol=USE_SYMBOL_AS_UID$1?Symbol$2:Symbol$2&&Symbol$2.withoutSetter||uid$2,wellKnownSymbol$o=function(e){if(!hasOwn$f(WellKnownSymbolsStore,e)||!NATIVE_SYMBOL&&"string"!=typeof WellKnownSymbolsStore[e]){var t="Symbol."+e;NATIVE_SYMBOL&&hasOwn$f(Symbol$2,e)?WellKnownSymbolsStore[e]=Symbol$2[e]:WellKnownSymbolsStore[e]=USE_SYMBOL_AS_UID$1&&symbolFor?symbolFor(t):createWellKnownSymbol(t)}return WellKnownSymbolsStore[e]},wellKnownSymbol$n=wellKnownSymbol$o,TO_STRING_TAG$4=wellKnownSymbol$n("toStringTag"),test$1={};test$1[TO_STRING_TAG$4]="z";var toStringTagSupport="[object z]"===String(test$1),objectDefineProperty={},fails$B=fails$E,descriptors=!fails$B((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),isCallable$p=isCallable$r,$documentAll=documentAll_1,documentAll=$documentAll.all,isObject$g=$documentAll.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:isCallable$p(e)||e===documentAll}:function(e){return"object"==typeof e?null!==e:isCallable$p(e)},global$x=global$D,isObject$f=isObject$g,document$3=global$x.document,EXISTS$1=isObject$f(document$3)&&isObject$f(document$3.createElement),documentCreateElement$2=function(e){return EXISTS$1?document$3.createElement(e):{}},DESCRIPTORS$k=descriptors,fails$A=fails$E,createElement$1=documentCreateElement$2,ie8DomDefine=!DESCRIPTORS$k&&!fails$A((function(){return 7!=Object.defineProperty(createElement$1("div"),"a",{get:function(){return 7}}).a})),DESCRIPTORS$j=descriptors,fails$z=fails$E,v8PrototypeDefineBug=DESCRIPTORS$j&&fails$z((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),isObject$e=isObject$g,$String$4=String,$TypeError$h=TypeError,anObject$h=function(e){if(isObject$e(e))return e;throw $TypeError$h($String$4(e)+" is not an object")},NATIVE_BIND$2=functionBindNative,call$o=Function.prototype.call,functionCall=NATIVE_BIND$2?call$o.bind(call$o):function(){return call$o.apply(call$o,arguments)},uncurryThis$B=functionUncurryThis,objectIsPrototypeOf=uncurryThis$B({}.isPrototypeOf),getBuiltIn$7=getBuiltIn$9,isCallable$o=isCallable$r,isPrototypeOf$6=objectIsPrototypeOf,USE_SYMBOL_AS_UID=useSymbolAsUid,$Object$3=Object,isSymbol$4=USE_SYMBOL_AS_UID?function(e){return"symbol"==typeof e}:function(e){var t=getBuiltIn$7("Symbol");return isCallable$o(t)&&isPrototypeOf$6(t.prototype,$Object$3(e))},$String$3=String,tryToString$6=function(e){try{return $String$3(e)}catch(e){return"Object"}},isCallable$n=isCallable$r,tryToString$5=tryToString$6,$TypeError$g=TypeError,aCallable$a=function(e){if(isCallable$n(e))return e;throw $TypeError$g(tryToString$5(e)+" is not a function")},aCallable$9=aCallable$a,isNullOrUndefined$3=isNullOrUndefined$5,getMethod$4=function(e,t){var r=e[t];return isNullOrUndefined$3(r)?void 0:aCallable$9(r)},call$n=functionCall,isCallable$m=isCallable$r,isObject$d=isObject$g,$TypeError$f=TypeError,ordinaryToPrimitive$1=function(e,t){var r,n;if("string"===t&&isCallable$m(r=e.toString)&&!isObject$d(n=call$n(r,e)))return n;if(isCallable$m(r=e.valueOf)&&!isObject$d(n=call$n(r,e)))return n;if("string"!==t&&isCallable$m(r=e.toString)&&!isObject$d(n=call$n(r,e)))return n;throw $TypeError$f("Can't convert object to primitive value")},call$m=functionCall,isObject$c=isObject$g,isSymbol$3=isSymbol$4,getMethod$3=getMethod$4,ordinaryToPrimitive=ordinaryToPrimitive$1,wellKnownSymbol$m=wellKnownSymbol$o,$TypeError$e=TypeError,TO_PRIMITIVE=wellKnownSymbol$m("toPrimitive"),toPrimitive$3=function(e,t){if(!isObject$c(e)||isSymbol$3(e))return e;var r,n=getMethod$3(e,TO_PRIMITIVE);if(n){if(void 0===t&&(t="default"),r=call$m(n,e,t),!isObject$c(r)||isSymbol$3(r))return r;throw $TypeError$e("Can't convert object to primitive value")}return void 0===t&&(t="number"),ordinaryToPrimitive(e,t)},toPrimitive$2=toPrimitive$3,isSymbol$2=isSymbol$4,toPropertyKey$4=function(e){var t=toPrimitive$2(e,"string");return isSymbol$2(t)?t:t+""},DESCRIPTORS$i=descriptors,IE8_DOM_DEFINE$1=ie8DomDefine,V8_PROTOTYPE_DEFINE_BUG$1=v8PrototypeDefineBug,anObject$g=anObject$h,toPropertyKey$3=toPropertyKey$4,$TypeError$d=TypeError,$defineProperty=Object.defineProperty,$getOwnPropertyDescriptor$1=Object.getOwnPropertyDescriptor,ENUMERABLE="enumerable",CONFIGURABLE$1="configurable",WRITABLE="writable";objectDefineProperty.f=DESCRIPTORS$i?V8_PROTOTYPE_DEFINE_BUG$1?function(e,t,r){if(anObject$g(e),t=toPropertyKey$3(t),anObject$g(r),"function"==typeof e&&"prototype"===t&&"value"in r&&WRITABLE in r&&!r[WRITABLE]){var n=$getOwnPropertyDescriptor$1(e,t);n&&n[WRITABLE]&&(e[t]=r.value,r={configurable:CONFIGURABLE$1 in r?r[CONFIGURABLE$1]:n[CONFIGURABLE$1],enumerable:ENUMERABLE in r?r[ENUMERABLE]:n[ENUMERABLE],writable:!1})}return $defineProperty(e,t,r)}:$defineProperty:function(e,t,r){if(anObject$g(e),t=toPropertyKey$3(t),anObject$g(r),IE8_DOM_DEFINE$1)try{return $defineProperty(e,t,r)}catch(e){}if("get"in r||"set"in r)throw $TypeError$d("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var makeBuiltIn$3={exports:{}},DESCRIPTORS$h=descriptors,hasOwn$e=hasOwnProperty_1,FunctionPrototype$2=Function.prototype,getDescriptor=DESCRIPTORS$h&&Object.getOwnPropertyDescriptor,EXISTS=hasOwn$e(FunctionPrototype$2,"name"),PROPER=EXISTS&&"something"===function(){}.name,CONFIGURABLE=EXISTS&&(!DESCRIPTORS$h||DESCRIPTORS$h&&getDescriptor(FunctionPrototype$2,"name").configurable),functionName={EXISTS:EXISTS,PROPER:PROPER,CONFIGURABLE:CONFIGURABLE},uncurryThis$A=functionUncurryThis,isCallable$l=isCallable$r,store$1=sharedStore,functionToString$1=uncurryThis$A(Function.toString);isCallable$l(store$1.inspectSource)||(store$1.inspectSource=function(e){return functionToString$1(e)});var set$2,get$1,has,inspectSource$3=store$1.inspectSource,global$w=global$D,isCallable$k=isCallable$r,WeakMap$1=global$w.WeakMap,weakMapBasicDetection=isCallable$k(WeakMap$1)&&/native code/.test(String(WeakMap$1)),createPropertyDescriptor$6=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},DESCRIPTORS$g=descriptors,definePropertyModule$6=objectDefineProperty,createPropertyDescriptor$5=createPropertyDescriptor$6,createNonEnumerableProperty$9=DESCRIPTORS$g?function(e,t,r){return definePropertyModule$6.f(e,t,createPropertyDescriptor$5(1,r))}:function(e,t,r){return e[t]=r,e},shared$2=sharedExports,uid$1=uid$3,keys$2=shared$2("keys"),sharedKey$3=function(e){return keys$2[e]||(keys$2[e]=uid$1(e))},hiddenKeys$4={},NATIVE_WEAK_MAP=weakMapBasicDetection,global$v=global$D,isObject$b=isObject$g,createNonEnumerableProperty$8=createNonEnumerableProperty$9,hasOwn$d=hasOwnProperty_1,shared$1=sharedStore,sharedKey$2=sharedKey$3,hiddenKeys$3=hiddenKeys$4,OBJECT_ALREADY_INITIALIZED="Object already initialized",TypeError$6=global$v.TypeError,WeakMap=global$v.WeakMap,enforce=function(e){return has(e)?get$1(e):set$2(e,{})},getterFor=function(e){return function(t){var r;if(!isObject$b(t)||(r=get$1(t)).type!==e)throw TypeError$6("Incompatible receiver, "+e+" required");return r}};if(NATIVE_WEAK_MAP||shared$1.state){var store=shared$1.state||(shared$1.state=new WeakMap);store.get=store.get,store.has=store.has,store.set=store.set,set$2=function(e,t){if(store.has(e))throw TypeError$6(OBJECT_ALREADY_INITIALIZED);return t.facade=e,store.set(e,t),t},get$1=function(e){return store.get(e)||{}},has=function(e){return store.has(e)}}else{var STATE=sharedKey$2("state");hiddenKeys$3[STATE]=!0,set$2=function(e,t){if(hasOwn$d(e,STATE))throw TypeError$6(OBJECT_ALREADY_INITIALIZED);return t.facade=e,createNonEnumerableProperty$8(e,STATE,t),t},get$1=function(e){return hasOwn$d(e,STATE)?e[STATE]:{}},has=function(e){return hasOwn$d(e,STATE)}}var internalState={set:set$2,get:get$1,has:has,enforce:enforce,getterFor:getterFor},fails$y=fails$E,isCallable$j=isCallable$r,hasOwn$c=hasOwnProperty_1,DESCRIPTORS$f=descriptors,CONFIGURABLE_FUNCTION_NAME$2=functionName.CONFIGURABLE,inspectSource$2=inspectSource$3,InternalStateModule$8=internalState,enforceInternalState$2=InternalStateModule$8.enforce,getInternalState$6=InternalStateModule$8.get,defineProperty$9=Object.defineProperty,CONFIGURABLE_LENGTH=DESCRIPTORS$f&&!fails$y((function(){return 8!==defineProperty$9((function(){}),"length",{value:8}).length})),TEMPLATE=String(String).split("String"),makeBuiltIn$2=makeBuiltIn$3.exports=function(e,t,r){"Symbol("===String(t).slice(0,7)&&(t="["+String(t).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!hasOwn$c(e,"name")||CONFIGURABLE_FUNCTION_NAME$2&&e.name!==t)&&(DESCRIPTORS$f?defineProperty$9(e,"name",{value:t,configurable:!0}):e.name=t),CONFIGURABLE_LENGTH&&r&&hasOwn$c(r,"arity")&&e.length!==r.arity&&defineProperty$9(e,"length",{value:r.arity});try{r&&hasOwn$c(r,"constructor")&&r.constructor?DESCRIPTORS$f&&defineProperty$9(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=enforceInternalState$2(e);return hasOwn$c(n,"source")||(n.source=TEMPLATE.join("string"==typeof t?t:"")),e};Function.prototype.toString=makeBuiltIn$2((function(){return isCallable$j(this)&&getInternalState$6(this).source||inspectSource$2(this)}),"toString");var makeBuiltInExports=makeBuiltIn$3.exports,isCallable$i=isCallable$r,definePropertyModule$5=objectDefineProperty,makeBuiltIn$1=makeBuiltInExports,defineGlobalProperty$1=defineGlobalProperty$3,defineBuiltIn$e=function(e,t,r,n){n||(n={});var i=n.enumerable,o=void 0!==n.name?n.name:t;if(isCallable$i(r)&&makeBuiltIn$1(r,o,n),n.global)i?e[t]=r:defineGlobalProperty$1(t,r);else{try{n.unsafe?e[t]&&(i=!0):delete e[t]}catch(e){}i?e[t]=r:definePropertyModule$5.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},uncurryThis$z=functionUncurryThis,toString$b=uncurryThis$z({}.toString),stringSlice$7=uncurryThis$z("".slice),classofRaw$2=function(e){return stringSlice$7(toString$b(e),8,-1)},TO_STRING_TAG_SUPPORT$2=toStringTagSupport,isCallable$h=isCallable$r,classofRaw$1=classofRaw$2,wellKnownSymbol$l=wellKnownSymbol$o,TO_STRING_TAG$3=wellKnownSymbol$l("toStringTag"),$Object$2=Object,CORRECT_ARGUMENTS="Arguments"==classofRaw$1(function(){return arguments}()),tryGet=function(e,t){try{return e[t]}catch(e){}},classof$e=TO_STRING_TAG_SUPPORT$2?classofRaw$1:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=tryGet(t=$Object$2(e),TO_STRING_TAG$3))?r:CORRECT_ARGUMENTS?classofRaw$1(t):"Object"==(n=classofRaw$1(t))&&isCallable$h(t.callee)?"Arguments":n},TO_STRING_TAG_SUPPORT$1=toStringTagSupport,classof$d=classof$e,objectToString=TO_STRING_TAG_SUPPORT$1?{}.toString:function(){return"[object "+classof$d(this)+"]"},TO_STRING_TAG_SUPPORT=toStringTagSupport,defineBuiltIn$d=defineBuiltIn$e,toString$a=objectToString;TO_STRING_TAG_SUPPORT||defineBuiltIn$d(Object.prototype,"toString",toString$a,{unsafe:!0});var domIterables={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},documentCreateElement$1=documentCreateElement$2,classList=documentCreateElement$1("span").classList,DOMTokenListPrototype$2=classList&&classList.constructor&&classList.constructor.prototype,domTokenListPrototype=DOMTokenListPrototype$2===Object.prototype?void 0:DOMTokenListPrototype$2,classofRaw=classofRaw$2,uncurryThis$y=functionUncurryThis,functionUncurryThisClause=function(e){if("Function"===classofRaw(e))return uncurryThis$y(e)},uncurryThis$x=functionUncurryThisClause,aCallable$8=aCallable$a,NATIVE_BIND$1=functionBindNative,bind$a=functionUncurryThisClause(functionUncurryThisClause.bind),functionBindContext=function(e,t){return aCallable$8(e),void 0===t?e:NATIVE_BIND$1?bind$a(e,t):function(){return e.apply(t,arguments)}},uncurryThis$w=functionUncurryThis,fails$x=fails$E,classof$c=classofRaw$2,$Object$1=Object,split$3=uncurryThis$w("".split),indexedObject=fails$x((function(){return!$Object$1("z").propertyIsEnumerable(0)}))?function(e){return"String"==classof$c(e)?split$3(e,""):$Object$1(e)}:$Object$1,ceil=Math.ceil,floor$8=Math.floor,mathTrunc=Math.trunc||function(e){var t=+e;return(t>0?floor$8:ceil)(t)},trunc2=mathTrunc,toIntegerOrInfinity$c=function(e){var t=+e;return t!=t||0===t?0:trunc2(t)},toIntegerOrInfinity$b=toIntegerOrInfinity$c,min$5=Math.min,toLength$6=function(e){return e>0?min$5(toIntegerOrInfinity$b(e),9007199254740991):0},toLength$5=toLength$6,lengthOfArrayLike$i=function(e){return toLength$5(e.length)},classof$b=classofRaw$2,isArray$4=Array.isArray||function(e){return"Array"==classof$b(e)},uncurryThis$v=functionUncurryThis,fails$w=fails$E,isCallable$g=isCallable$r,classof$a=classof$e,getBuiltIn$6=getBuiltIn$9,inspectSource$1=inspectSource$3,noop=function(){},empty=[],construct=getBuiltIn$6("Reflect","construct"),constructorRegExp=/^\s*(?:class|function)\b/,exec$3=uncurryThis$v(constructorRegExp.exec),INCORRECT_TO_STRING=!constructorRegExp.exec(noop),isConstructorModern=function(e){if(!isCallable$g(e))return!1;try{return construct(noop,empty,e),!0}catch(e){return!1}},isConstructorLegacy=function(e){if(!isCallable$g(e))return!1;switch(classof$a(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return INCORRECT_TO_STRING||!!exec$3(constructorRegExp,inspectSource$1(e))}catch(e){return!0}};isConstructorLegacy.sham=!0;var isConstructor$4=!construct||fails$w((function(){var e;return isConstructorModern(isConstructorModern.call)||!isConstructorModern(Object)||!isConstructorModern((function(){e=!0}))||e}))?isConstructorLegacy:isConstructorModern,isArray$3=isArray$4,isConstructor$3=isConstructor$4,isObject$a=isObject$g,wellKnownSymbol$k=wellKnownSymbol$o,SPECIES$6=wellKnownSymbol$k("species"),$Array$4=Array,arraySpeciesConstructor$1=function(e){var t;return isArray$3(e)&&(t=e.constructor,(isConstructor$3(t)&&(t===$Array$4||isArray$3(t.prototype))||isObject$a(t)&&null===(t=t[SPECIES$6]))&&(t=void 0)),void 0===t?$Array$4:t},arraySpeciesConstructor=arraySpeciesConstructor$1,arraySpeciesCreate$3=function(e,t){return new(arraySpeciesConstructor(e))(0===t?0:t)},bind$9=functionBindContext,uncurryThis$u=functionUncurryThis,IndexedObject$5=indexedObject,toObject$d=toObject$f,lengthOfArrayLike$h=lengthOfArrayLike$i,arraySpeciesCreate$2=arraySpeciesCreate$3,push$7=uncurryThis$u([].push),createMethod$6=function(e){var t=1==e,r=2==e,n=3==e,i=4==e,o=6==e,a=7==e,s=5==e||o;return function(c,u,l,A){for(var d,h,f=toObject$d(c),p=IndexedObject$5(f),y=bind$9(u,l),_=lengthOfArrayLike$h(p),E=0,g=A||arraySpeciesCreate$2,m=t?g(c,_):r||a?g(c,0):void 0;_>E;E++)if((s||E in p)&&(h=y(d=p[E],E,f),e))if(t)m[E]=h;else if(h)switch(e){case 3:return!0;case 5:return d;case 6:return E;case 2:push$7(m,d)}else switch(e){case 4:return!1;case 7:push$7(m,d)}return o?-1:n||i?i:m}},arrayIteration={forEach:createMethod$6(0),map:createMethod$6(1),filter:createMethod$6(2),some:createMethod$6(3),every:createMethod$6(4),find:createMethod$6(5),findIndex:createMethod$6(6),filterReject:createMethod$6(7)},fails$v=fails$E,arrayMethodIsStrict$4=function(e,t){var r=[][e];return!!r&&fails$v((function(){r.call(null,t||function(){return 1},1)}))},$forEach$1=arrayIteration.forEach,arrayMethodIsStrict$3=arrayMethodIsStrict$4,STRICT_METHOD$3=arrayMethodIsStrict$3("forEach"),arrayForEach=STRICT_METHOD$3?[].forEach:function(e){return $forEach$1(this,e,arguments.length>1?arguments[1]:void 0)},global$u=global$D,DOMIterables$1=domIterables,DOMTokenListPrototype$1=domTokenListPrototype,forEach$1=arrayForEach,createNonEnumerableProperty$7=createNonEnumerableProperty$9,handlePrototype$1=function(e){if(e&&e.forEach!==forEach$1)try{createNonEnumerableProperty$7(e,"forEach",forEach$1)}catch(t){e.forEach=forEach$1}};for(var COLLECTION_NAME$1 in DOMIterables$1)DOMIterables$1[COLLECTION_NAME$1]&&handlePrototype$1(global$u[COLLECTION_NAME$1]&&global$u[COLLECTION_NAME$1].prototype);handlePrototype$1(DOMTokenListPrototype$1);var objectGetOwnPropertyDescriptor={},objectPropertyIsEnumerable={},$propertyIsEnumerable$1={}.propertyIsEnumerable,getOwnPropertyDescriptor$5=Object.getOwnPropertyDescriptor,NASHORN_BUG=getOwnPropertyDescriptor$5&&!$propertyIsEnumerable$1.call({1:2},1);objectPropertyIsEnumerable.f=NASHORN_BUG?function(e){var t=getOwnPropertyDescriptor$5(this,e);return!!t&&t.enumerable}:$propertyIsEnumerable$1;var IndexedObject$4=indexedObject,requireObjectCoercible$4=requireObjectCoercible$6,toIndexedObject$b=function(e){return IndexedObject$4(requireObjectCoercible$4(e))},DESCRIPTORS$e=descriptors,call$l=functionCall,propertyIsEnumerableModule$1=objectPropertyIsEnumerable,createPropertyDescriptor$4=createPropertyDescriptor$6,toIndexedObject$a=toIndexedObject$b,toPropertyKey$2=toPropertyKey$4,hasOwn$b=hasOwnProperty_1,IE8_DOM_DEFINE=ie8DomDefine,$getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor;objectGetOwnPropertyDescriptor.f=DESCRIPTORS$e?$getOwnPropertyDescriptor:function(e,t){if(e=toIndexedObject$a(e),t=toPropertyKey$2(t),IE8_DOM_DEFINE)try{return $getOwnPropertyDescriptor(e,t)}catch(e){}if(hasOwn$b(e,t))return createPropertyDescriptor$4(!call$l(propertyIsEnumerableModule$1.f,e,t),e[t])};var objectGetOwnPropertyNames={},toIntegerOrInfinity$a=toIntegerOrInfinity$c,max$4=Math.max,min$4=Math.min,toAbsoluteIndex$7=function(e,t){var r=toIntegerOrInfinity$a(e);return r<0?max$4(r+t,0):min$4(r,t)},toIndexedObject$9=toIndexedObject$b,toAbsoluteIndex$6=toAbsoluteIndex$7,lengthOfArrayLike$g=lengthOfArrayLike$i,createMethod$5=function(e){return function(t,r,n){var i,o=toIndexedObject$9(t),a=lengthOfArrayLike$g(o),s=toAbsoluteIndex$6(n,a);if(e&&r!=r){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===r)return e||s||0;return!e&&-1}},arrayIncludes={includes:createMethod$5(!0),indexOf:createMethod$5(!1)},uncurryThis$t=functionUncurryThis,hasOwn$a=hasOwnProperty_1,toIndexedObject$8=toIndexedObject$b,indexOf$1=arrayIncludes.indexOf,hiddenKeys$2=hiddenKeys$4,push$6=uncurryThis$t([].push),objectKeysInternal=function(e,t){var r,n=toIndexedObject$8(e),i=0,o=[];for(r in n)!hasOwn$a(hiddenKeys$2,r)&&hasOwn$a(n,r)&&push$6(o,r);for(;t.length>i;)hasOwn$a(n,r=t[i++])&&(~indexOf$1(o,r)||push$6(o,r));return o},enumBugKeys$3=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],internalObjectKeys$1=objectKeysInternal,enumBugKeys$2=enumBugKeys$3,hiddenKeys$1=enumBugKeys$2.concat("length","prototype");objectGetOwnPropertyNames.f=Object.getOwnPropertyNames||function(e){return internalObjectKeys$1(e,hiddenKeys$1)};var objectGetOwnPropertySymbols={};objectGetOwnPropertySymbols.f=Object.getOwnPropertySymbols;var getBuiltIn$5=getBuiltIn$9,uncurryThis$s=functionUncurryThis,getOwnPropertyNamesModule=objectGetOwnPropertyNames,getOwnPropertySymbolsModule$1=objectGetOwnPropertySymbols,anObject$f=anObject$h,concat$2=uncurryThis$s([].concat),ownKeys$1=getBuiltIn$5("Reflect","ownKeys")||function(e){var t=getOwnPropertyNamesModule.f(anObject$f(e)),r=getOwnPropertySymbolsModule$1.f;return r?concat$2(t,r(e)):t},hasOwn$9=hasOwnProperty_1,ownKeys2=ownKeys$1,getOwnPropertyDescriptorModule$1=objectGetOwnPropertyDescriptor,definePropertyModule$4=objectDefineProperty,copyConstructorProperties$1=function(e,t,r){for(var n=ownKeys2(t),i=definePropertyModule$4.f,o=getOwnPropertyDescriptorModule$1.f,a=0;a<n.length;a++){var s=n[a];hasOwn$9(e,s)||r&&hasOwn$9(r,s)||i(e,s,o(t,s))}},fails$u=fails$E,isCallable$f=isCallable$r,replacement=/#|\.prototype\./,isForced$3=function(e,t){var r=data[normalize(e)];return r==POLYFILL||r!=NATIVE&&(isCallable$f(t)?fails$u(t):!!t)},normalize=isForced$3.normalize=function(e){return String(e).replace(replacement,".").toLowerCase()},data=isForced$3.data={},NATIVE=isForced$3.NATIVE="N",POLYFILL=isForced$3.POLYFILL="P",isForced_1=isForced$3,global$t=global$D,getOwnPropertyDescriptor$4=objectGetOwnPropertyDescriptor.f,createNonEnumerableProperty$6=createNonEnumerableProperty$9,defineBuiltIn$c=defineBuiltIn$e,defineGlobalProperty=defineGlobalProperty$3,copyConstructorProperties=copyConstructorProperties$1,isForced$2=isForced_1,_export=function(e,t){var r,n,i,o,a,s=e.target,c=e.global,u=e.stat;if(r=c?global$t:u?global$t[s]||defineGlobalProperty(s,{}):(global$t[s]||{}).prototype)for(n in t){if(o=t[n],i=e.dontCallGetSet?(a=getOwnPropertyDescriptor$4(r,n))&&a.value:r[n],!isForced$2(c?n:s+(u?".":"#")+n,e.forced)&&void 0!==i){if(typeof o==typeof i)continue;copyConstructorProperties(o,i)}(e.sham||i&&i.sham)&&createNonEnumerableProperty$6(o,"sham",!0),defineBuiltIn$c(r,n,o,e)}},objectGetOwnPropertyNamesExternal={},toPropertyKey$1=toPropertyKey$4,definePropertyModule$3=objectDefineProperty,createPropertyDescriptor$3=createPropertyDescriptor$6,createProperty$5=function(e,t,r){var n=toPropertyKey$1(t);n in e?definePropertyModule$3.f(e,n,createPropertyDescriptor$3(0,r)):e[n]=r},toAbsoluteIndex$5=toAbsoluteIndex$7,lengthOfArrayLike$f=lengthOfArrayLike$i,createProperty$4=createProperty$5,$Array$3=Array,max$3=Math.max,arraySliceSimple=function(e,t,r){for(var n=lengthOfArrayLike$f(e),i=toAbsoluteIndex$5(t,n),o=toAbsoluteIndex$5(void 0===r?n:r,n),a=$Array$3(max$3(o-i,0)),s=0;i<o;i++,s++)createProperty$4(a,s,e[i]);return a.length=s,a},classof$9=classofRaw$2,toIndexedObject$7=toIndexedObject$b,$getOwnPropertyNames=objectGetOwnPropertyNames.f,arraySlice$8=arraySliceSimple,windowNames="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],getWindowNames=function(e){try{return $getOwnPropertyNames(e)}catch(e){return arraySlice$8(windowNames)}};objectGetOwnPropertyNamesExternal.f=function(e){return windowNames&&"Window"==classof$9(e)?getWindowNames(e):$getOwnPropertyNames(toIndexedObject$7(e))};var $$v=_export,fails$t=fails$E,getOwnPropertyNames$3=objectGetOwnPropertyNamesExternal.f,FAILS_ON_PRIMITIVES$1=fails$t((function(){return!Object.getOwnPropertyNames(1)}));$$v({target:"Object",stat:!0,forced:FAILS_ON_PRIMITIVES$1},{getOwnPropertyNames:getOwnPropertyNames$3});var classof$8=classof$e,$String$2=String,toString$9=function(e){if("Symbol"===classof$8(e))throw TypeError("Cannot convert a Symbol value to a string");return $String$2(e)},anObject$e=anObject$h,regexpFlags$1=function(){var e=anObject$e(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},fails$s=fails$E,global$s=global$D,$RegExp$2=global$s.RegExp,UNSUPPORTED_Y$1=fails$s((function(){var e=$RegExp$2("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),MISSED_STICKY=UNSUPPORTED_Y$1||fails$s((function(){return!$RegExp$2("a","y").sticky})),BROKEN_CARET=UNSUPPORTED_Y$1||fails$s((function(){var e=$RegExp$2("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),regexpStickyHelpers={BROKEN_CARET:BROKEN_CARET,MISSED_STICKY:MISSED_STICKY,UNSUPPORTED_Y:UNSUPPORTED_Y$1},objectDefineProperties={},internalObjectKeys=objectKeysInternal,enumBugKeys$1=enumBugKeys$3,objectKeys$3=Object.keys||function(e){return internalObjectKeys(e,enumBugKeys$1)},DESCRIPTORS$d=descriptors,V8_PROTOTYPE_DEFINE_BUG=v8PrototypeDefineBug,definePropertyModule$2=objectDefineProperty,anObject$d=anObject$h,toIndexedObject$6=toIndexedObject$b,objectKeys$2=objectKeys$3;objectDefineProperties.f=DESCRIPTORS$d&&!V8_PROTOTYPE_DEFINE_BUG?Object.defineProperties:function(e,t){anObject$d(e);for(var r,n=toIndexedObject$6(t),i=objectKeys$2(t),o=i.length,a=0;o>a;)definePropertyModule$2.f(e,r=i[a++],n[r]);return e};var activeXDocument,getBuiltIn$4=getBuiltIn$9,html$2=getBuiltIn$4("document","documentElement"),anObject$c=anObject$h,definePropertiesModule=objectDefineProperties,enumBugKeys=enumBugKeys$3,hiddenKeys=hiddenKeys$4,html$1=html$2,documentCreateElement=documentCreateElement$2,sharedKey$1=sharedKey$3,GT=">",LT="<",PROTOTYPE$1="prototype",SCRIPT="script",IE_PROTO$1=sharedKey$1("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(e){return LT+SCRIPT+GT+e+LT+"/"+SCRIPT+GT},NullProtoObjectViaActiveX=function(e){e.write(scriptTag("")),e.close();var t=e.parentWindow.Object;return e=null,t},NullProtoObjectViaIFrame=function(){var e,t=documentCreateElement("iframe"),r="java"+SCRIPT+":";return t.style.display="none",html$1.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(scriptTag("document.F=Object")),e.close(),e.F},NullProtoObject=function(){try{activeXDocument=new ActiveXObject("htmlfile")}catch(e){}NullProtoObject="undefined"!=typeof document?document.domain&&activeXDocument?NullProtoObjectViaActiveX(activeXDocument):NullProtoObjectViaIFrame():NullProtoObjectViaActiveX(activeXDocument);for(var e=enumBugKeys.length;e--;)delete NullProtoObject[PROTOTYPE$1][enumBugKeys[e]];return NullProtoObject()};hiddenKeys[IE_PROTO$1]=!0;var objectCreate=Object.create||function(e,t){var r;return null!==e?(EmptyConstructor[PROTOTYPE$1]=anObject$c(e),r=new EmptyConstructor,EmptyConstructor[PROTOTYPE$1]=null,r[IE_PROTO$1]=e):r=NullProtoObject(),void 0===t?r:definePropertiesModule.f(r,t)},fails$r=fails$E,global$r=global$D,$RegExp$1=global$r.RegExp,regexpUnsupportedDotAll=fails$r((function(){var e=$RegExp$1(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),fails$q=fails$E,global$q=global$D,$RegExp=global$q.RegExp,regexpUnsupportedNcg=fails$q((function(){var e=$RegExp("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),call$k=functionCall,uncurryThis$r=functionUncurryThis,toString$8=toString$9,regexpFlags=regexpFlags$1,stickyHelpers=regexpStickyHelpers,shared=sharedExports,create$4=objectCreate,getInternalState$5=internalState.get,UNSUPPORTED_DOT_ALL=regexpUnsupportedDotAll,UNSUPPORTED_NCG=regexpUnsupportedNcg,nativeReplace=shared("native-string-replace",String.prototype.replace),nativeExec=RegExp.prototype.exec,patchedExec=nativeExec,charAt$7=uncurryThis$r("".charAt),indexOf=uncurryThis$r("".indexOf),replace$5=uncurryThis$r("".replace),stringSlice$6=uncurryThis$r("".slice),UPDATES_LAST_INDEX_WRONG=function(){var e=/a/,t=/b*/g;return call$k(nativeExec,e,"a"),call$k(nativeExec,t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),UNSUPPORTED_Y=stickyHelpers.BROKEN_CARET,NPCG_INCLUDED=void 0!==/()??/.exec("")[1],PATCH=UPDATES_LAST_INDEX_WRONG||NPCG_INCLUDED||UNSUPPORTED_Y||UNSUPPORTED_DOT_ALL||UNSUPPORTED_NCG;PATCH&&(patchedExec=function(e){var t,r,n,i,o,a,s,c=this,u=getInternalState$5(c),l=toString$8(e),A=u.raw;if(A)return A.lastIndex=c.lastIndex,t=call$k(patchedExec,A,l),c.lastIndex=A.lastIndex,t;var d=u.groups,h=UNSUPPORTED_Y&&c.sticky,f=call$k(regexpFlags,c),p=c.source,y=0,_=l;if(h&&(f=replace$5(f,"y",""),-1===indexOf(f,"g")&&(f+="g"),_=stringSlice$6(l,c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&"\n"!==charAt$7(l,c.lastIndex-1))&&(p="(?: "+p+")",_=" "+_,y++),r=new RegExp("^(?:"+p+")",f)),NPCG_INCLUDED&&(r=new RegExp("^"+p+"$(?!\\s)",f)),UPDATES_LAST_INDEX_WRONG&&(n=c.lastIndex),i=call$k(nativeExec,h?r:c,_),h?i?(i.input=stringSlice$6(i.input,y),i[0]=stringSlice$6(i[0],y),i.index=c.lastIndex,c.lastIndex+=i[0].length):c.lastIndex=0:UPDATES_LAST_INDEX_WRONG&&i&&(c.lastIndex=c.global?i.index+i[0].length:n),NPCG_INCLUDED&&i&&i.length>1&&call$k(nativeReplace,i[0],r,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(i[o]=void 0)})),i&&d)for(i.groups=a=create$4(null),o=0;o<d.length;o++)a[(s=d[o])[0]]=i[s[1]];return i});var regexpExec$2=patchedExec,$$u=_export,exec$2=regexpExec$2;$$u({target:"RegExp",proto:!0,forced:/./.exec!==regexpExec$2},{exec:regexpExec$2});var $$t=_export,call$j=functionCall,isCallable$e=isCallable$r,anObject$b=anObject$h,toString$7=toString$9,DELEGATES_TO_EXEC=function(){var e=!1,t=/[ac]/;return t.exec=function(){return e=!0,/./.exec.apply(this,arguments)},!0===t.test("abc")&&e}(),nativeTest=/./.test;$$t({target:"RegExp",proto:!0,forced:!DELEGATES_TO_EXEC},{test:function(e){var t=anObject$b(this),r=toString$7(e),n=t.exec;if(!isCallable$e(n))return call$j(nativeTest,t,r);var i=call$j(n,t,r);return null!==i&&(anObject$b(i),!0)}});var NATIVE_BIND=functionBindNative,FunctionPrototype$1=Function.prototype,apply$5=FunctionPrototype$1.apply,call$i=FunctionPrototype$1.call,functionApply="object"==typeof Reflect&&Reflect.apply||(NATIVE_BIND?call$i.bind(apply$5):function(){return call$i.apply(apply$5,arguments)}),uncurryThis$q=functionUncurryThisClause,defineBuiltIn$b=defineBuiltIn$e,regexpExec$1=regexpExec$2,fails$p=fails$E,wellKnownSymbol$j=wellKnownSymbol$o,createNonEnumerableProperty$5=createNonEnumerableProperty$9,SPECIES$5=wellKnownSymbol$j("species"),RegExpPrototype$3=RegExp.prototype,fixRegexpWellKnownSymbolLogic=function(e,t,r,n){var i=wellKnownSymbol$j(e),o=!fails$p((function(){var t={};return t[i]=function(){return 7},7!=""[e](t)})),a=o&&!fails$p((function(){var t=!1,r=/a/;return"split"===e&&((r={}).constructor={},r.constructor[SPECIES$5]=function(){return r},r.flags="",r[i]=/./[i]),r.exec=function(){return t=!0,null},r[i](""),!t}));if(!o||!a||r){var s=uncurryThis$q(/./[i]),c=t(i,""[e],(function(e,t,r,n,i){var a=uncurryThis$q(e),c=t.exec;return c===regexpExec$1||c===RegExpPrototype$3.exec?o&&!i?{done:!0,value:s(t,r,n)}:{done:!0,value:a(r,t,n)}:{done:!1}}));defineBuiltIn$b(String.prototype,e,c[0]),defineBuiltIn$b(RegExpPrototype$3,i,c[1])}n&&createNonEnumerableProperty$5(RegExpPrototype$3[i],"sham",!0)},uncurryThis$p=functionUncurryThis,toIntegerOrInfinity$9=toIntegerOrInfinity$c,toString$6=toString$9,requireObjectCoercible$3=requireObjectCoercible$6,charAt$6=uncurryThis$p("".charAt),charCodeAt$2=uncurryThis$p("".charCodeAt),stringSlice$5=uncurryThis$p("".slice),createMethod$4=function(e){return function(t,r){var n,i,o=toString$6(requireObjectCoercible$3(t)),a=toIntegerOrInfinity$9(r),s=o.length;return a<0||a>=s?e?"":void 0:(n=charCodeAt$2(o,a))<55296||n>56319||a+1===s||(i=charCodeAt$2(o,a+1))<56320||i>57343?e?charAt$6(o,a):n:e?stringSlice$5(o,a,a+2):i-56320+(n-55296<<10)+65536}},stringMultibyte={codeAt:createMethod$4(!1),charAt:createMethod$4(!0)},charAt$5=stringMultibyte.charAt,advanceStringIndex$1=function(e,t,r){return t+(r?charAt$5(e,t).length:1)},uncurryThis$o=functionUncurryThis,toObject$c=toObject$f,floor$7=Math.floor,charAt$4=uncurryThis$o("".charAt),replace$4=uncurryThis$o("".replace),stringSlice$4=uncurryThis$o("".slice),SUBSTITUTION_SYMBOLS=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,SUBSTITUTION_SYMBOLS_NO_NAMED=/\$([$&'`]|\d{1,2})/g,getSubstitution$1=function(e,t,r,n,i,o){var a=r+e.length,s=n.length,c=SUBSTITUTION_SYMBOLS_NO_NAMED;return void 0!==i&&(i=toObject$c(i),c=SUBSTITUTION_SYMBOLS),replace$4(o,c,(function(o,c){var u;switch(charAt$4(c,0)){case"$":return"$";case"&":return e;case"`":return stringSlice$4(t,0,r);case"'":return stringSlice$4(t,a);case"<":u=i[stringSlice$4(c,1,-1)];break;default:var l=+c;if(0===l)return o;if(l>s){var A=floor$7(l/10);return 0===A?o:A<=s?void 0===n[A-1]?charAt$4(c,1):n[A-1]+charAt$4(c,1):o}u=n[l-1]}return void 0===u?"":u}))},call$h=functionCall,anObject$a=anObject$h,isCallable$d=isCallable$r,classof$7=classofRaw$2,regexpExec=regexpExec$2,$TypeError$c=TypeError,regexpExecAbstract=function(e,t){var r=e.exec;if(isCallable$d(r)){var n=call$h(r,e,t);return null!==n&&anObject$a(n),n}if("RegExp"===classof$7(e))return call$h(regexpExec,e,t);throw $TypeError$c("RegExp#exec called on incompatible receiver")},apply$4=functionApply,call$g=functionCall,uncurryThis$n=functionUncurryThis,fixRegExpWellKnownSymbolLogic=fixRegexpWellKnownSymbolLogic,fails$o=fails$E,anObject$9=anObject$h,isCallable$c=isCallable$r,isNullOrUndefined$2=isNullOrUndefined$5,toIntegerOrInfinity$8=toIntegerOrInfinity$c,toLength$4=toLength$6,toString$5=toString$9,requireObjectCoercible$2=requireObjectCoercible$6,advanceStringIndex=advanceStringIndex$1,getMethod$2=getMethod$4,getSubstitution=getSubstitution$1,regExpExec$1=regexpExecAbstract,wellKnownSymbol$i=wellKnownSymbol$o,REPLACE=wellKnownSymbol$i("replace"),max$2=Math.max,min$3=Math.min,concat$1=uncurryThis$n([].concat),push$5=uncurryThis$n([].push),stringIndexOf=uncurryThis$n("".indexOf),stringSlice$3=uncurryThis$n("".slice),maybeToString=function(e){return void 0===e?e:String(e)},REPLACE_KEEPS_$0="$0"==="a".replace(/./,"$0"),REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE=!!/./[REPLACE]&&""===/./[REPLACE]("a","$0"),REPLACE_SUPPORTS_NAMED_GROUPS=!fails$o((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}));fixRegExpWellKnownSymbolLogic("replace",(function(e,t,r){var n=REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE?"$":"$0";return[function(e,r){var n=requireObjectCoercible$2(this),i=isNullOrUndefined$2(e)?void 0:getMethod$2(e,REPLACE);return i?call$g(i,e,n,r):call$g(t,toString$5(n),e,r)},function(e,i){var o=anObject$9(this),a=toString$5(e);if("string"==typeof i&&-1===stringIndexOf(i,n)&&-1===stringIndexOf(i,"$<")){var s=r(t,o,a,i);if(s.done)return s.value}var c=isCallable$c(i);c||(i=toString$5(i));var u=o.global;if(u){var l=o.unicode;o.lastIndex=0}for(var A=[];;){var d=regExpExec$1(o,a);if(null===d)break;if(push$5(A,d),!u)break;""===toString$5(d[0])&&(o.lastIndex=advanceStringIndex(a,toLength$4(o.lastIndex),l))}for(var h="",f=0,p=0;p<A.length;p++){for(var y=toString$5((d=A[p])[0]),_=max$2(min$3(toIntegerOrInfinity$8(d.index),a.length),0),E=[],g=1;g<d.length;g++)push$5(E,maybeToString(d[g]));var m=d.groups;if(c){var $=concat$1([y],E,_,a);void 0!==m&&push$5($,m);var v=toString$5(apply$4(i,void 0,$))}else v=getSubstitution(y,a,_,E,m,i);_>=f&&(h+=stringSlice$3(a,f,_)+v,f=_+y.length)}return h+stringSlice$3(a,f)}]}),!REPLACE_SUPPORTS_NAMED_GROUPS||!REPLACE_KEEPS_$0||REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);var fails$n=fails$E,wellKnownSymbol$h=wellKnownSymbol$o,V8_VERSION$2=engineV8Version,SPECIES$4=wellKnownSymbol$h("species"),arrayMethodHasSpeciesSupport$5=function(e){return V8_VERSION$2>=51||!fails$n((function(){var t=[];return(t.constructor={})[SPECIES$4]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},$$s=_export,$filter$1=arrayIteration.filter,arrayMethodHasSpeciesSupport$4=arrayMethodHasSpeciesSupport$5,HAS_SPECIES_SUPPORT$3=arrayMethodHasSpeciesSupport$4("filter");$$s({target:"Array",proto:!0,forced:!HAS_SPECIES_SUPPORT$3},{filter:function(e){return $filter$1(this,e,arguments.length>1?arguments[1]:void 0)}});var $location,defer,channel,port,classof$6=classofRaw$2,global$p=global$D,engineIsNode="process"==classof$6(global$p.process),isCallable$b=isCallable$r,$String$1=String,$TypeError$b=TypeError,aPossiblePrototype$1=function(e){if("object"==typeof e||isCallable$b(e))return e;throw $TypeError$b("Can't set "+$String$1(e)+" as a prototype")},uncurryThis$m=functionUncurryThis,anObject$8=anObject$h,aPossiblePrototype=aPossiblePrototype$1,objectSetPrototypeOf=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=uncurryThis$m(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return anObject$8(r),aPossiblePrototype(n),t?e(r,n):r.__proto__=n,r}}():void 0),defineProperty$8=objectDefineProperty.f,hasOwn$8=hasOwnProperty_1,wellKnownSymbol$g=wellKnownSymbol$o,TO_STRING_TAG$2=wellKnownSymbol$g("toStringTag"),setToStringTag$6=function(e,t,r){e&&!r&&(e=e.prototype),e&&!hasOwn$8(e,TO_STRING_TAG$2)&&defineProperty$8(e,TO_STRING_TAG$2,{configurable:!0,value:t})},getBuiltIn$3=getBuiltIn$9,definePropertyModule$1=objectDefineProperty,wellKnownSymbol$f=wellKnownSymbol$o,DESCRIPTORS$c=descriptors,SPECIES$3=wellKnownSymbol$f("species"),setSpecies$3=function(e){var t=getBuiltIn$3(e),r=definePropertyModule$1.f;DESCRIPTORS$c&&t&&!t[SPECIES$3]&&r(t,SPECIES$3,{configurable:!0,get:function(){return this}})},isPrototypeOf$5=objectIsPrototypeOf,$TypeError$a=TypeError,anInstance$5=function(e,t){if(isPrototypeOf$5(t,e))return e;throw $TypeError$a("Incorrect invocation")},isConstructor$2=isConstructor$4,tryToString$4=tryToString$6,$TypeError$9=TypeError,aConstructor$2=function(e){if(isConstructor$2(e))return e;throw $TypeError$9(tryToString$4(e)+" is not a constructor")},anObject$7=anObject$h,aConstructor$1=aConstructor$2,isNullOrUndefined$1=isNullOrUndefined$5,wellKnownSymbol$e=wellKnownSymbol$o,SPECIES$2=wellKnownSymbol$e("species"),speciesConstructor$3=function(e,t){var r,n=anObject$7(e).constructor;return void 0===n||isNullOrUndefined$1(r=anObject$7(n)[SPECIES$2])?t:aConstructor$1(r)},uncurryThis$l=functionUncurryThis,arraySlice$7=uncurryThis$l([].slice),$TypeError$8=TypeError,validateArgumentsLength$3=function(e,t){if(e<t)throw $TypeError$8("Not enough arguments");return e},userAgent$4=engineUserAgent,engineIsIos=/(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$4),global$o=global$D,apply$3=functionApply,bind$8=functionBindContext,isCallable$a=isCallable$r,hasOwn$7=hasOwnProperty_1,fails$m=fails$E,html=html$2,arraySlice$6=arraySlice$7,createElement=documentCreateElement$2,validateArgumentsLength$2=validateArgumentsLength$3,IS_IOS$1=engineIsIos,IS_NODE$3=engineIsNode,set$1=global$o.setImmediate,clear=global$o.clearImmediate,process$2=global$o.process,Dispatch=global$o.Dispatch,Function$1=global$o.Function,MessageChannel=global$o.MessageChannel,String$1=global$o.String,counter=0,queue$1={},ONREADYSTATECHANGE="onreadystatechange";try{$location=global$o.location}catch(e){}var run=function(e){if(hasOwn$7(queue$1,e)){var t=queue$1[e];delete queue$1[e],t()}},runner=function(e){return function(){run(e)}},listener=function(e){run(e.data)},post=function(e){global$o.postMessage(String$1(e),$location.protocol+"//"+$location.host)};set$1&&clear||(set$1=function(e){validateArgumentsLength$2(arguments.length,1);var t=isCallable$a(e)?e:Function$1(e),r=arraySlice$6(arguments,1);return queue$1[++counter]=function(){apply$3(t,void 0,r)},defer(counter),counter},clear=function(e){delete queue$1[e]},IS_NODE$3?defer=function(e){process$2.nextTick(runner(e))}:Dispatch&&Dispatch.now?defer=function(e){Dispatch.now(runner(e))}:MessageChannel&&!IS_IOS$1?(port=(channel=new MessageChannel).port2,channel.port1.onmessage=listener,defer=bind$8(port.postMessage,port)):global$o.addEventListener&&isCallable$a(global$o.postMessage)&&!global$o.importScripts&&$location&&"file:"!==$location.protocol&&!fails$m(post)?(defer=post,global$o.addEventListener("message",listener,!1)):defer=ONREADYSTATECHANGE in createElement("script")?function(e){html.appendChild(createElement("script"))[ONREADYSTATECHANGE]=function(){html.removeChild(this),run(e)}}:function(e){setTimeout(runner(e),0)});var flush,head,last,notify$1,toggle,node,promise,then,task$1={set:set$1,clear:clear},userAgent$3=engineUserAgent,global$n=global$D,engineIsIosPebble=/ipad|iphone|ipod/i.test(userAgent$3)&&void 0!==global$n.Pebble,userAgent$2=engineUserAgent,engineIsWebosWebkit=/web0s(?!.*chrome)/i.test(userAgent$2),global$m=global$D,bind$7=functionBindContext,getOwnPropertyDescriptor$3=objectGetOwnPropertyDescriptor.f,macrotask=task$1.set,IS_IOS=engineIsIos,IS_IOS_PEBBLE=engineIsIosPebble,IS_WEBOS_WEBKIT=engineIsWebosWebkit,IS_NODE$2=engineIsNode,MutationObserver=global$m.MutationObserver||global$m.WebKitMutationObserver,document$2=global$m.document,process$1=global$m.process,Promise$1=global$m.Promise,queueMicrotaskDescriptor=getOwnPropertyDescriptor$3(global$m,"queueMicrotask"),queueMicrotask=queueMicrotaskDescriptor&&queueMicrotaskDescriptor.value;queueMicrotask||(flush=function(){var e,t;for(IS_NODE$2&&(e=process$1.domain)&&e.exit();head;){t=head.fn,head=head.next;try{t()}catch(e){throw head?notify$1():last=void 0,e}}last=void 0,e&&e.enter()},IS_IOS||IS_NODE$2||IS_WEBOS_WEBKIT||!MutationObserver||!document$2?!IS_IOS_PEBBLE&&Promise$1&&Promise$1.resolve?((promise=Promise$1.resolve(void 0)).constructor=Promise$1,then=bind$7(promise.then,promise),notify$1=function(){then(flush)}):IS_NODE$2?notify$1=function(){process$1.nextTick(flush)}:(macrotask=bind$7(macrotask,global$m),notify$1=function(){macrotask(flush)}):(toggle=!0,node=document$2.createTextNode(""),new MutationObserver(flush).observe(node,{characterData:!0}),notify$1=function(){node.data=toggle=!toggle}));var microtask$1=queueMicrotask||function(e){var t={fn:e,next:void 0};last&&(last.next=t),head||(head=t,notify$1()),last=t},global$l=global$D,hostReportErrors$1=function(e,t){var r=global$l.console;r&&r.error&&(1==arguments.length?r.error(e):r.error(e,t))},perform$3=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},Queue$1=function(){this.head=null,this.tail=null};Queue$1.prototype={add:function(e){var t={item:e,next:null};this.head?this.tail.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}};var queue=Queue$1,global$k=global$D,promiseNativeConstructor=global$k.Promise,engineIsDeno="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,IS_DENO$1=engineIsDeno,IS_NODE$1=engineIsNode,engineIsBrowser=!IS_DENO$1&&!IS_NODE$1&&"object"==typeof window&&"object"==typeof document,global$j=global$D,NativePromiseConstructor$4=promiseNativeConstructor,isCallable$9=isCallable$r,isForced$1=isForced_1,inspectSource=inspectSource$3,wellKnownSymbol$d=wellKnownSymbol$o,IS_BROWSER=engineIsBrowser,IS_DENO=engineIsDeno,V8_VERSION$1=engineV8Version;NativePromiseConstructor$4&&NativePromiseConstructor$4.prototype;var SPECIES$1=wellKnownSymbol$d("species"),SUBCLASSING=!1,NATIVE_PROMISE_REJECTION_EVENT$1=isCallable$9(global$j.PromiseRejectionEvent),FORCED_PROMISE_CONSTRUCTOR$5=isForced$1("Promise",(function(){var e=inspectSource(NativePromiseConstructor$4),t=e!==String(NativePromiseConstructor$4);if(!t&&66===V8_VERSION$1)return!0;if(!V8_VERSION$1||V8_VERSION$1<51||!/native code/.test(e)){var r=new NativePromiseConstructor$4((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};if((r.constructor={})[SPECIES$1]=n,!(SUBCLASSING=r.then((function(){}))instanceof n))return!0}return!t&&(IS_BROWSER||IS_DENO)&&!NATIVE_PROMISE_REJECTION_EVENT$1})),promiseConstructorDetection={CONSTRUCTOR:FORCED_PROMISE_CONSTRUCTOR$5,REJECTION_EVENT:NATIVE_PROMISE_REJECTION_EVENT$1,SUBCLASSING:SUBCLASSING},newPromiseCapability$2={},aCallable$7=aCallable$a,$TypeError$7=TypeError,PromiseCapability=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw $TypeError$7("Bad Promise constructor");t=e,r=n})),this.resolve=aCallable$7(t),this.reject=aCallable$7(r)};newPromiseCapability$2.f=function(e){return new PromiseCapability(e)};var Internal,OwnPromiseCapability,PromiseWrapper,nativeThen,$$r=_export,IS_NODE=engineIsNode,global$i=global$D,call$f=functionCall,defineBuiltIn$a=defineBuiltIn$e,setPrototypeOf$5=objectSetPrototypeOf,setToStringTag$5=setToStringTag$6,setSpecies$2=setSpecies$3,aCallable$6=aCallable$a,isCallable$8=isCallable$r,isObject$9=isObject$g,anInstance$4=anInstance$5,speciesConstructor$2=speciesConstructor$3,task=task$1.set,microtask=microtask$1,hostReportErrors=hostReportErrors$1,perform$2=perform$3,Queue=queue,InternalStateModule$7=internalState,NativePromiseConstructor$3=promiseNativeConstructor,PromiseConstructorDetection=promiseConstructorDetection,newPromiseCapabilityModule$3=newPromiseCapability$2,PROMISE="Promise",FORCED_PROMISE_CONSTRUCTOR$4=PromiseConstructorDetection.CONSTRUCTOR,NATIVE_PROMISE_REJECTION_EVENT=PromiseConstructorDetection.REJECTION_EVENT,NATIVE_PROMISE_SUBCLASSING=PromiseConstructorDetection.SUBCLASSING,getInternalPromiseState=InternalStateModule$7.getterFor(PROMISE),setInternalState$6=InternalStateModule$7.set,NativePromisePrototype$2=NativePromiseConstructor$3&&NativePromiseConstructor$3.prototype,PromiseConstructor=NativePromiseConstructor$3,PromisePrototype=NativePromisePrototype$2,TypeError$5=global$i.TypeError,document$1=global$i.document,process=global$i.process,newPromiseCapability$1=newPromiseCapabilityModule$3.f,newGenericPromiseCapability=newPromiseCapability$1,DISPATCH_EVENT=!!(document$1&&document$1.createEvent&&global$i.dispatchEvent),UNHANDLED_REJECTION="unhandledrejection",REJECTION_HANDLED="rejectionhandled",PENDING=0,FULFILLED=1,REJECTED=2,HANDLED=1,UNHANDLED=2,isThenable=function(e){var t;return!(!isObject$9(e)||!isCallable$8(t=e.then))&&t},callReaction=function(e,t){var r,n,i,o=t.value,a=t.state==FULFILLED,s=a?e.ok:e.fail,c=e.resolve,u=e.reject,l=e.domain;try{s?(a||(t.rejection===UNHANDLED&&onHandleUnhandled(t),t.rejection=HANDLED),!0===s?r=o:(l&&l.enter(),r=s(o),l&&(l.exit(),i=!0)),r===e.promise?u(TypeError$5("Promise-chain cycle")):(n=isThenable(r))?call$f(n,r,c,u):c(r)):u(o)}catch(e){l&&!i&&l.exit(),u(e)}},notify=function(e,t){e.notified||(e.notified=!0,microtask((function(){for(var r,n=e.reactions;r=n.get();)callReaction(r,e);e.notified=!1,t&&!e.rejection&&onUnhandled(e)})))},dispatchEvent=function(e,t,r){var n,i;DISPATCH_EVENT?((n=document$1.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),global$i.dispatchEvent(n)):n={promise:t,reason:r},!NATIVE_PROMISE_REJECTION_EVENT&&(i=global$i["on"+e])?i(n):e===UNHANDLED_REJECTION&&hostReportErrors("Unhandled promise rejection",r)},onUnhandled=function(e){call$f(task,global$i,(function(){var t,r=e.facade,n=e.value;if(isUnhandled(e)&&(t=perform$2((function(){IS_NODE?process.emit("unhandledRejection",n,r):dispatchEvent(UNHANDLED_REJECTION,r,n)})),e.rejection=IS_NODE||isUnhandled(e)?UNHANDLED:HANDLED,t.error))throw t.value}))},isUnhandled=function(e){return e.rejection!==HANDLED&&!e.parent},onHandleUnhandled=function(e){call$f(task,global$i,(function(){var t=e.facade;IS_NODE?process.emit("rejectionHandled",t):dispatchEvent(REJECTION_HANDLED,t,e.value)}))},bind$6=function(e,t,r){return function(n){e(t,n,r)}},internalReject=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=REJECTED,notify(e,!0))},internalResolve=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw TypeError$5("Promise can't be resolved itself");var n=isThenable(t);n?microtask((function(){var r={done:!1};try{call$f(n,t,bind$6(internalResolve,r,e),bind$6(internalReject,r,e))}catch(t){internalReject(r,t,e)}})):(e.value=t,e.state=FULFILLED,notify(e,!1))}catch(t){internalReject({done:!1},t,e)}}};if(FORCED_PROMISE_CONSTRUCTOR$4&&(PromisePrototype=(PromiseConstructor=function(e){anInstance$4(this,PromisePrototype),aCallable$6(e),call$f(Internal,this);var t=getInternalPromiseState(this);try{e(bind$6(internalResolve,t),bind$6(internalReject,t))}catch(e){internalReject(t,e)}}).prototype,(Internal=function(e){setInternalState$6(this,{type:PROMISE,done:!1,notified:!1,parent:!1,reactions:new Queue,rejection:!1,state:PENDING,value:void 0})}).prototype=defineBuiltIn$a(PromisePrototype,"then",(function(e,t){var r=getInternalPromiseState(this),n=newPromiseCapability$1(speciesConstructor$2(this,PromiseConstructor));return r.parent=!0,n.ok=!isCallable$8(e)||e,n.fail=isCallable$8(t)&&t,n.domain=IS_NODE?process.domain:void 0,r.state==PENDING?r.reactions.add(n):microtask((function(){callReaction(n,r)})),n.promise})),OwnPromiseCapability=function(){var e=new Internal,t=getInternalPromiseState(e);this.promise=e,this.resolve=bind$6(internalResolve,t),this.reject=bind$6(internalReject,t)},newPromiseCapabilityModule$3.f=newPromiseCapability$1=function(e){return e===PromiseConstructor||e===PromiseWrapper?new OwnPromiseCapability(e):newGenericPromiseCapability(e)},isCallable$8(NativePromiseConstructor$3)&&NativePromisePrototype$2!==Object.prototype)){nativeThen=NativePromisePrototype$2.then,NATIVE_PROMISE_SUBCLASSING||defineBuiltIn$a(NativePromisePrototype$2,"then",(function(e,t){var r=this;return new PromiseConstructor((function(e,t){call$f(nativeThen,r,e,t)})).then(e,t)}),{unsafe:!0});try{delete NativePromisePrototype$2.constructor}catch(e){}setPrototypeOf$5&&setPrototypeOf$5(NativePromisePrototype$2,PromisePrototype)}$$r({global:!0,constructor:!0,wrap:!0,forced:FORCED_PROMISE_CONSTRUCTOR$4},{Promise:PromiseConstructor}),setToStringTag$5(PromiseConstructor,PROMISE,!1),setSpecies$2(PROMISE);var iterators={},wellKnownSymbol$c=wellKnownSymbol$o,Iterators$4=iterators,ITERATOR$9=wellKnownSymbol$c("iterator"),ArrayPrototype$1=Array.prototype,isArrayIteratorMethod$3=function(e){return void 0!==e&&(Iterators$4.Array===e||ArrayPrototype$1[ITERATOR$9]===e)},classof$5=classof$e,getMethod$1=getMethod$4,isNullOrUndefined=isNullOrUndefined$5,Iterators$3=iterators,wellKnownSymbol$b=wellKnownSymbol$o,ITERATOR$8=wellKnownSymbol$b("iterator"),getIteratorMethod$5=function(e){if(!isNullOrUndefined(e))return getMethod$1(e,ITERATOR$8)||getMethod$1(e,"@@iterator")||Iterators$3[classof$5(e)]},call$e=functionCall,aCallable$5=aCallable$a,anObject$6=anObject$h,tryToString$3=tryToString$6,getIteratorMethod$4=getIteratorMethod$5,$TypeError$6=TypeError,getIterator$4=function(e,t){var r=arguments.length<2?getIteratorMethod$4(e):t;if(aCallable$5(r))return anObject$6(call$e(r,e));throw $TypeError$6(tryToString$3(e)+" is not iterable")},call$d=functionCall,anObject$5=anObject$h,getMethod=getMethod$4,iteratorClose$2=function(e,t,r){var n,i;anObject$5(e);try{if(!(n=getMethod(e,"return"))){if("throw"===t)throw r;return r}n=call$d(n,e)}catch(e){i=!0,n=e}if("throw"===t)throw r;if(i)throw n;return anObject$5(n),r},bind$5=functionBindContext,call$c=functionCall,anObject$4=anObject$h,tryToString$2=tryToString$6,isArrayIteratorMethod$2=isArrayIteratorMethod$3,lengthOfArrayLike$e=lengthOfArrayLike$i,isPrototypeOf$4=objectIsPrototypeOf,getIterator$3=getIterator$4,getIteratorMethod$3=getIteratorMethod$5,iteratorClose$1=iteratorClose$2,$TypeError$5=TypeError,Result=function(e,t){this.stopped=e,this.result=t},ResultPrototype=Result.prototype,iterate$2=function(e,t,r){var n,i,o,a,s,c,u,l=r&&r.that,A=!(!r||!r.AS_ENTRIES),d=!(!r||!r.IS_RECORD),h=!(!r||!r.IS_ITERATOR),f=!(!r||!r.INTERRUPTED),p=bind$5(t,l),y=function(e){return n&&iteratorClose$1(n,"normal",e),new Result(!0,e)},_=function(e){return A?(anObject$4(e),f?p(e[0],e[1],y):p(e[0],e[1])):f?p(e,y):p(e)};if(d)n=e.iterator;else if(h)n=e;else{if(!(i=getIteratorMethod$3(e)))throw $TypeError$5(tryToString$2(e)+" is not iterable");if(isArrayIteratorMethod$2(i)){for(o=0,a=lengthOfArrayLike$e(e);a>o;o++)if((s=_(e[o]))&&isPrototypeOf$4(ResultPrototype,s))return s;return new Result(!1)}n=getIterator$3(e,i)}for(c=d?e.next:n.next;!(u=call$c(c,n)).done;){try{s=_(u.value)}catch(e){iteratorClose$1(n,"throw",e)}if("object"==typeof s&&s&&isPrototypeOf$4(ResultPrototype,s))return s}return new Result(!1)},wellKnownSymbol$a=wellKnownSymbol$o,ITERATOR$7=wellKnownSymbol$a("iterator"),SAFE_CLOSING=!1;try{var called=0,iteratorWithReturn={next:function(){return{done:!!called++}},return:function(){SAFE_CLOSING=!0}};iteratorWithReturn[ITERATOR$7]=function(){return this},Array.from(iteratorWithReturn,(function(){throw 2}))}catch(e){}var checkCorrectnessOfIteration$2=function(e,t){if(!t&&!SAFE_CLOSING)return!1;var r=!1;try{var n={};n[ITERATOR$7]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(e){}return r},NativePromiseConstructor$2=promiseNativeConstructor,checkCorrectnessOfIteration$1=checkCorrectnessOfIteration$2,FORCED_PROMISE_CONSTRUCTOR$3=promiseConstructorDetection.CONSTRUCTOR,promiseStaticsIncorrectIteration=FORCED_PROMISE_CONSTRUCTOR$3||!checkCorrectnessOfIteration$1((function(e){NativePromiseConstructor$2.all(e).then(void 0,(function(){}))})),$$q=_export,call$b=functionCall,aCallable$4=aCallable$a,newPromiseCapabilityModule$2=newPromiseCapability$2,perform$1=perform$3,iterate$1=iterate$2,PROMISE_STATICS_INCORRECT_ITERATION$1=promiseStaticsIncorrectIteration;$$q({target:"Promise",stat:!0,forced:PROMISE_STATICS_INCORRECT_ITERATION$1},{all:function(e){var t=this,r=newPromiseCapabilityModule$2.f(t),n=r.resolve,i=r.reject,o=perform$1((function(){var r=aCallable$4(t.resolve),o=[],a=0,s=1;iterate$1(e,(function(e){var c=a++,u=!1;s++,call$b(r,t,e).then((function(e){u||(u=!0,o[c]=e,--s||n(o))}),i)})),--s||n(o)}));return o.error&&i(o.value),r.promise}});var $$p=_export,FORCED_PROMISE_CONSTRUCTOR$2=promiseConstructorDetection.CONSTRUCTOR,NativePromiseConstructor$1=promiseNativeConstructor,getBuiltIn$2=getBuiltIn$9,isCallable$7=isCallable$r,defineBuiltIn$9=defineBuiltIn$e,NativePromisePrototype$1=NativePromiseConstructor$1&&NativePromiseConstructor$1.prototype;if($$p({target:"Promise",proto:!0,forced:FORCED_PROMISE_CONSTRUCTOR$2,real:!0},{catch:function(e){return this.then(void 0,e)}}),isCallable$7(NativePromiseConstructor$1)){var method$1=getBuiltIn$2("Promise").prototype.catch;NativePromisePrototype$1.catch!==method$1&&defineBuiltIn$9(NativePromisePrototype$1,"catch",method$1,{unsafe:!0})}var $$o=_export,call$a=functionCall,aCallable$3=aCallable$a,newPromiseCapabilityModule$1=newPromiseCapability$2,perform=perform$3,iterate=iterate$2,PROMISE_STATICS_INCORRECT_ITERATION=promiseStaticsIncorrectIteration;$$o({target:"Promise",stat:!0,forced:PROMISE_STATICS_INCORRECT_ITERATION},{race:function(e){var t=this,r=newPromiseCapabilityModule$1.f(t),n=r.reject,i=perform((function(){var i=aCallable$3(t.resolve);iterate(e,(function(e){call$a(i,t,e).then(r.resolve,n)}))}));return i.error&&n(i.value),r.promise}});var $$n=_export,call$9=functionCall,newPromiseCapabilityModule=newPromiseCapability$2,FORCED_PROMISE_CONSTRUCTOR$1=promiseConstructorDetection.CONSTRUCTOR;$$n({target:"Promise",stat:!0,forced:FORCED_PROMISE_CONSTRUCTOR$1},{reject:function(e){var t=newPromiseCapabilityModule.f(this);return call$9(t.reject,void 0,e),t.promise}});var anObject$3=anObject$h,isObject$8=isObject$g,newPromiseCapability=newPromiseCapability$2,promiseResolve$2=function(e,t){if(anObject$3(e),isObject$8(t)&&t.constructor===e)return t;var r=newPromiseCapability.f(e);return(0,r.resolve)(t),r.promise},$$m=_export,getBuiltIn$1=getBuiltIn$9,FORCED_PROMISE_CONSTRUCTOR=promiseConstructorDetection.CONSTRUCTOR,promiseResolve$1=promiseResolve$2;getBuiltIn$1("Promise"),$$m({target:"Promise",stat:!0,forced:FORCED_PROMISE_CONSTRUCTOR},{resolve:function(e){return promiseResolve$1(this,e)}});var $TypeError$4=TypeError,MAX_SAFE_INTEGER=9007199254740991,doesNotExceedSafeInteger$2=function(e){if(e>MAX_SAFE_INTEGER)throw $TypeError$4("Maximum allowed index exceeded");return e},$$l=_export,fails$l=fails$E,isArray$2=isArray$4,isObject$7=isObject$g,toObject$b=toObject$f,lengthOfArrayLike$d=lengthOfArrayLike$i,doesNotExceedSafeInteger$1=doesNotExceedSafeInteger$2,createProperty$3=createProperty$5,arraySpeciesCreate$1=arraySpeciesCreate$3,arrayMethodHasSpeciesSupport$3=arrayMethodHasSpeciesSupport$5,wellKnownSymbol$9=wellKnownSymbol$o,V8_VERSION=engineV8Version,IS_CONCAT_SPREADABLE=wellKnownSymbol$9("isConcatSpreadable"),IS_CONCAT_SPREADABLE_SUPPORT=V8_VERSION>=51||!fails$l((function(){var e=[];return e[IS_CONCAT_SPREADABLE]=!1,e.concat()[0]!==e})),SPECIES_SUPPORT=arrayMethodHasSpeciesSupport$3("concat"),isConcatSpreadable=function(e){if(!isObject$7(e))return!1;var t=e[IS_CONCAT_SPREADABLE];return void 0!==t?!!t:isArray$2(e)},FORCED$7=!IS_CONCAT_SPREADABLE_SUPPORT||!SPECIES_SUPPORT;$$l({target:"Array",proto:!0,arity:1,forced:FORCED$7},{concat:function(e){var t,r,n,i,o,a=toObject$b(this),s=arraySpeciesCreate$1(a,0),c=0;for(t=-1,n=arguments.length;t<n;t++)if(isConcatSpreadable(o=-1===t?a:arguments[t]))for(i=lengthOfArrayLike$d(o),doesNotExceedSafeInteger$1(c+i),r=0;r<i;r++,c++)r in o&&createProperty$3(s,c,o[r]);else doesNotExceedSafeInteger$1(c+1),createProperty$3(s,c++,o);return s.length=c,s}});var $$k=_export,NativePromiseConstructor=promiseNativeConstructor,fails$k=fails$E,getBuiltIn=getBuiltIn$9,isCallable$6=isCallable$r,speciesConstructor$1=speciesConstructor$3,promiseResolve=promiseResolve$2,defineBuiltIn$8=defineBuiltIn$e,NativePromisePrototype=NativePromiseConstructor&&NativePromiseConstructor.prototype,NON_GENERIC=!!NativePromiseConstructor&&fails$k((function(){NativePromisePrototype.finally.call({then:function(){}},(function(){}))}));if($$k({target:"Promise",proto:!0,real:!0,forced:NON_GENERIC},{finally:function(e){var t=speciesConstructor$1(this,getBuiltIn("Promise")),r=isCallable$6(e);return this.then(r?function(r){return promiseResolve(t,e()).then((function(){return r}))}:e,r?function(r){return promiseResolve(t,e()).then((function(){throw r}))}:e)}}),isCallable$6(NativePromiseConstructor)){var method=getBuiltIn("Promise").prototype.finally;NativePromisePrototype.finally!==method&&defineBuiltIn$8(NativePromisePrototype,"finally",method,{unsafe:!0})}var isCallable$5=isCallable$r,isObject$6=isObject$g,setPrototypeOf$4=objectSetPrototypeOf,inheritIfRequired$2=function(e,t,r){var n,i;return setPrototypeOf$4&&isCallable$5(n=t.constructor)&&n!==r&&isObject$6(i=n.prototype)&&i!==r.prototype&&setPrototypeOf$4(e,i),e},uncurryThis$k=functionUncurryThis,thisNumberValue$2=uncurryThis$k(1..valueOf),whitespaces$2="\t\n\v\f\r \u2028\u2029\ufeff",uncurryThis$j=functionUncurryThis,requireObjectCoercible$1=requireObjectCoercible$6,toString$4=toString$9,whitespaces$1=whitespaces$2,replace$3=uncurryThis$j("".replace),whitespace="["+whitespaces$1+"]",ltrim=RegExp("^"+whitespace+whitespace+"*"),rtrim=RegExp(whitespace+whitespace+"*$"),createMethod$3=function(e){return function(t){var r=toString$4(requireObjectCoercible$1(t));return 1&e&&(r=replace$3(r,ltrim,"")),2&e&&(r=replace$3(r,rtrim,"")),r}},stringTrim={start:createMethod$3(1),end:createMethod$3(2),trim:createMethod$3(3)},DESCRIPTORS$b=descriptors,global$h=global$D,uncurryThis$i=functionUncurryThis,isForced=isForced_1,defineBuiltIn$7=defineBuiltIn$e,hasOwn$6=hasOwnProperty_1,inheritIfRequired$1=inheritIfRequired$2,isPrototypeOf$3=objectIsPrototypeOf,isSymbol$1=isSymbol$4,toPrimitive$1=toPrimitive$3,fails$j=fails$E,getOwnPropertyNames$2=objectGetOwnPropertyNames.f,getOwnPropertyDescriptor$2=objectGetOwnPropertyDescriptor.f,defineProperty$7=objectDefineProperty.f,thisNumberValue$1=thisNumberValue$2,trim$1=stringTrim.trim,NUMBER="Number",NativeNumber=global$h[NUMBER],NumberPrototype=NativeNumber.prototype,TypeError$4=global$h.TypeError,arraySlice$5=uncurryThis$i("".slice),charCodeAt$1=uncurryThis$i("".charCodeAt),toNumeric=function(e){var t=toPrimitive$1(e,"number");return"bigint"==typeof t?t:toNumber(t)},toNumber=function(e){var t,r,n,i,o,a,s,c,u=toPrimitive$1(e,"number");if(isSymbol$1(u))throw TypeError$4("Cannot convert a Symbol value to a number");if("string"==typeof u&&u.length>2)if(u=trim$1(u),43===(t=charCodeAt$1(u,0))||45===t){if(88===(r=charCodeAt$1(u,2))||120===r)return NaN}else if(48===t){switch(charCodeAt$1(u,1)){case 66:case 98:n=2,i=49;break;case 79:case 111:n=8,i=55;break;default:return+u}for(a=(o=arraySlice$5(u,2)).length,s=0;s<a;s++)if((c=charCodeAt$1(o,s))<48||c>i)return NaN;return parseInt(o,n)}return+u};if(isForced(NUMBER,!NativeNumber(" 0o1")||!NativeNumber("0b1")||NativeNumber("+0x1"))){for(var key$1,NumberWrapper=function(e){var t=arguments.length<1?0:NativeNumber(toNumeric(e)),r=this;return isPrototypeOf$3(NumberPrototype,r)&&fails$j((function(){thisNumberValue$1(r)}))?inheritIfRequired$1(Object(t),r,NumberWrapper):t},keys$1=DESCRIPTORS$b?getOwnPropertyNames$2(NativeNumber):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),j$1=0;keys$1.length>j$1;j$1++)hasOwn$6(NativeNumber,key$1=keys$1[j$1])&&!hasOwn$6(NumberWrapper,key$1)&&defineProperty$7(NumberWrapper,key$1,getOwnPropertyDescriptor$2(NativeNumber,key$1));NumberWrapper.prototype=NumberPrototype,NumberPrototype.constructor=NumberWrapper,defineBuiltIn$7(global$h,NUMBER,NumberWrapper,{constructor:!0})}var global$g=global$D,fails$i=fails$E,uncurryThis$h=functionUncurryThis,toString$3=toString$9,trim=stringTrim.trim,whitespaces=whitespaces$2,charAt$3=uncurryThis$h("".charAt),$parseFloat=global$g.parseFloat,Symbol$1=global$g.Symbol,ITERATOR$6=Symbol$1&&Symbol$1.iterator,FORCED$6=1/$parseFloat(whitespaces+"-0")!=-1/0||ITERATOR$6&&!fails$i((function(){$parseFloat(Object(ITERATOR$6))})),numberParseFloat=FORCED$6?function(e){var t=trim(toString$3(e)),r=$parseFloat(t);return 0===r&&"-"==charAt$3(t,0)?-0:r}:$parseFloat,$$j=_export,parseFloat$1=numberParseFloat;$$j({target:"Number",stat:!0,forced:Number.parseFloat!=parseFloat$1},{parseFloat:parseFloat$1});var $$i=_export;$$i({target:"Number",stat:!0},{isNaN:function(e){return e!=e}});var $$h=_export,$map$1=arrayIteration.map,arrayMethodHasSpeciesSupport$2=arrayMethodHasSpeciesSupport$5,HAS_SPECIES_SUPPORT$2=arrayMethodHasSpeciesSupport$2("map");$$h({target:"Array",proto:!0,forced:!HAS_SPECIES_SUPPORT$2},{map:function(e){return $map$1(this,e,arguments.length>1?arguments[1]:void 0)}});var toObject$a=toObject$f,toAbsoluteIndex$4=toAbsoluteIndex$7,lengthOfArrayLike$c=lengthOfArrayLike$i,arrayFill$1=function(e){for(var t=toObject$a(this),r=lengthOfArrayLike$c(t),n=arguments.length,i=toAbsoluteIndex$4(n>1?arguments[1]:void 0,r),o=n>2?arguments[2]:void 0,a=void 0===o?r:toAbsoluteIndex$4(o,r);a>i;)t[i++]=e;return t},wellKnownSymbol$8=wellKnownSymbol$o,create$3=objectCreate,defineProperty$6=objectDefineProperty.f,UNSCOPABLES=wellKnownSymbol$8("unscopables"),ArrayPrototype=Array.prototype;null==ArrayPrototype[UNSCOPABLES]&&defineProperty$6(ArrayPrototype,UNSCOPABLES,{configurable:!0,value:create$3(null)});var addToUnscopables$4=function(e){ArrayPrototype[UNSCOPABLES][e]=!0},$$g=_export,fill$1=arrayFill$1,addToUnscopables$3=addToUnscopables$4;$$g({target:"Array",proto:!0},{fill:fill$1}),addToUnscopables$3("fill");var ele,webm="data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAAAAAAAWVK5rAQAAAAAAD++uAQAAAAAAADLXgQFzxYEBnIEAIrWcg3VuZIaFVl9WUDiDgQEj44OEAmJaAOABAAAAAAAABrCBsLqBkK4BAAAAAAAPq9eBAnPFgQKcgQAitZyDdW5khohBX1ZPUkJJU4OBAuEBAAAAAAAAEZ+BArWIQOdwAAAAAABiZIEgY6JPbwIeVgF2b3JiaXMAAAAAAoC7AAAAAAAAgLUBAAAAAAC4AQN2b3JiaXMtAAAAWGlwaC5PcmcgbGliVm9yYmlzIEkgMjAxMDExMDEgKFNjaGF1ZmVudWdnZXQpAQAAABUAAABlbmNvZGVyPUxhdmM1NS41Mi4xMDIBBXZvcmJpcyVCQ1YBAEAAACRzGCpGpXMWhBAaQlAZ4xxCzmvsGUJMEYIcMkxbyyVzkCGkoEKIWyiB0JBVAABAAACHQXgUhIpBCCGEJT1YkoMnPQghhIg5eBSEaUEIIYQQQgghhBBCCCGERTlokoMnQQgdhOMwOAyD5Tj4HIRFOVgQgydB6CCED0K4moOsOQghhCQ1SFCDBjnoHITCLCiKgsQwuBaEBDUojILkMMjUgwtCiJqDSTX4GoRnQXgWhGlBCCGEJEFIkIMGQcgYhEZBWJKDBjm4FITLQagahCo5CB+EIDRkFQCQAACgoiiKoigKEBqyCgDIAAAQQFEUx3EcyZEcybEcCwgNWQUAAAEACAAAoEiKpEiO5EiSJFmSJVmSJVmS5omqLMuyLMuyLMsyEBqyCgBIAABQUQxFcRQHCA1ZBQBkAAAIoDiKpViKpWiK54iOCISGrAIAgAAABAAAEDRDUzxHlETPVFXXtm3btm3btm3btm3btm1blmUZCA1ZBQBAAAAQ0mlmqQaIMAMZBkJDVgEACAAAgBGKMMSA0JBVAABAAACAGEoOogmtOd+c46BZDppKsTkdnEi1eZKbirk555xzzsnmnDHOOeecopxZDJoJrTnnnMSgWQqaCa0555wnsXnQmiqtOeeccc7pYJwRxjnnnCateZCajbU555wFrWmOmkuxOeecSLl5UptLtTnnnHPOOeecc84555zqxekcnBPOOeecqL25lpvQxTnnnE/G6d6cEM4555xzzjnnnHPOOeecIDRkFQAABABAEIaNYdwpCNLnaCBGEWIaMulB9+gwCRqDnELq0ehopJQ6CCWVcVJKJwgNWQUAAAIAQAghhRRSSCGFFFJIIYUUYoghhhhyyimnoIJKKqmooowyyyyzzDLLLLPMOuyssw47DDHEEEMrrcRSU2011lhr7jnnmoO0VlprrbVSSimllFIKQkNWAQAgAAAEQgYZZJBRSCGFFGKIKaeccgoqqIDQkFUAACAAgAAAAABP8hzRER3RER3RER3RER3R8RzPESVREiVREi3TMjXTU0VVdWXXlnVZt31b2IVd933d933d+HVhWJZlWZZlWZZlWZZlWZZlWZYgNGQVAAACAAAghBBCSCGFFFJIKcYYc8w56CSUEAgNWQUAAAIACAAAAHAUR3EcyZEcSbIkS9IkzdIsT/M0TxM9URRF0zRV0RVdUTdtUTZl0zVdUzZdVVZtV5ZtW7Z125dl2/d93/d93/d93/d93/d9XQdCQ1YBABIAADqSIymSIimS4ziOJElAaMgqAEAGAEAAAIriKI7jOJIkSZIlaZJneZaomZrpmZ4qqkBoyCoAABAAQAAAAAAAAIqmeIqpeIqoeI7oiJJomZaoqZoryqbsuq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq4LhIasAgAkAAB0JEdyJEdSJEVSJEdygNCQVQCADACAAAAcwzEkRXIsy9I0T/M0TxM90RM901NFV3SB0JBVAAAgAIAAAAAAAAAMybAUy9EcTRIl1VItVVMt1VJF1VNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVN0zRNEwgNWQkAkAEAkBBTLS3GmgmLJGLSaqugYwxS7KWxSCpntbfKMYUYtV4ah5RREHupJGOKQcwtpNApJq3WVEKFFKSYYyoVUg5SIDRkhQAQmgHgcBxAsixAsiwAAAAAAAAAkDQN0DwPsDQPAAAAAAAAACRNAyxPAzTPAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABA0jRA8zxA8zwAAAAAAAAA0DwP8DwR8EQRAAAAAAAAACzPAzTRAzxRBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABA0jRA8zxA8zwAAAAAAAAAsDwP8EQR0DwRAAAAAAAAACzPAzxRBDzRAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAEOAAABBgIRQasiIAiBMAcEgSJAmSBM0DSJYFTYOmwTQBkmVB06BpME0AAAAAAAAAAAAAJE2DpkHTIIoASdOgadA0iCIAAAAAAAAAAAAAkqZB06BpEEWApGnQNGgaRBEAAAAAAAAAAAAAzzQhihBFmCbAM02IIkQRpgkAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAGHAAAAgwoQwUGrIiAIgTAHA4imUBAIDjOJYFAACO41gWAABYliWKAABgWZooAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAYcAAACDChDBQashIAiAIAcCiKZQHHsSzgOJYFJMmyAJYF0DyApgFEEQAIAAAocAAACLBBU2JxgEJDVgIAUQAABsWxLE0TRZKkaZoniiRJ0zxPFGma53meacLzPM80IYqiaJoQRVE0TZimaaoqME1VFQAAUOAAABBgg6bE4gCFhqwEAEICAByKYlma5nmeJ4qmqZokSdM8TxRF0TRNU1VJkqZ5niiKommapqqyLE3zPFEURdNUVVWFpnmeKIqiaaqq6sLzPE8URdE0VdV14XmeJ4qiaJqq6roQRVE0TdNUTVV1XSCKpmmaqqqqrgtETxRNU1Vd13WB54miaaqqq7ouEE3TVFVVdV1ZBpimaaqq68oyQFVV1XVdV5YBqqqqruu6sgxQVdd1XVmWZQCu67qyLMsCAAAOHAAAAoygk4wqi7DRhAsPQKEhKwKAKAAAwBimFFPKMCYhpBAaxiSEFEImJaXSUqogpFJSKRWEVEoqJaOUUmopVRBSKamUCkIqJZVSAADYgQMA2IGFUGjISgAgDwCAMEYpxhhzTiKkFGPOOScRUoox55yTSjHmnHPOSSkZc8w556SUzjnnnHNSSuacc845KaVzzjnnnJRSSuecc05KKSWEzkEnpZTSOeecEwAAVOAAABBgo8jmBCNBhYasBABSAQAMjmNZmuZ5omialiRpmud5niiapiZJmuZ5nieKqsnzPE8URdE0VZXneZ4oiqJpqirXFUXTNE1VVV2yLIqmaZqq6rowTdNUVdd1XZimaaqq67oubFtVVdV1ZRm2raqq6rqyDFzXdWXZloEsu67s2rIAAPAEBwCgAhtWRzgpGgssNGQlAJABAEAYg5BCCCFlEEIKIYSUUggJAAAYcAAACDChDBQashIASAUAAIyx1lprrbXWQGettdZaa62AzFprrbXWWmuttdZaa6211lJrrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmstpZRSSimllFJKKaWUUkoppZRSSgUA+lU4APg/2LA6wknRWGChISsBgHAAAMAYpRhzDEIppVQIMeacdFRai7FCiDHnJKTUWmzFc85BKCGV1mIsnnMOQikpxVZjUSmEUlJKLbZYi0qho5JSSq3VWIwxqaTWWoutxmKMSSm01FqLMRYjbE2ptdhqq7EYY2sqLbQYY4zFCF9kbC2m2moNxggjWywt1VprMMYY3VuLpbaaizE++NpSLDHWXAAAd4MDAESCjTOsJJ0VjgYXGrISAAgJACAQUooxxhhzzjnnpFKMOeaccw5CCKFUijHGnHMOQgghlIwx5pxzEEIIIYRSSsaccxBCCCGEkFLqnHMQQgghhBBKKZ1zDkIIIYQQQimlgxBCCCGEEEoopaQUQgghhBBCCKmklEIIIYRSQighlZRSCCGEEEIpJaSUUgohhFJCCKGElFJKKYUQQgillJJSSimlEkoJJYQSUikppRRKCCGUUkpKKaVUSgmhhBJKKSWllFJKIYQQSikFAAAcOAAABBhBJxlVFmGjCRcegEJDVgIAZAAAkKKUUiktRYIipRikGEtGFXNQWoqocgxSzalSziDmJJaIMYSUk1Qy5hRCDELqHHVMKQYtlRhCxhik2HJLoXMOAAAAQQCAgJAAAAMEBTMAwOAA4XMQdAIERxsAgCBEZohEw0JweFAJEBFTAUBigkIuAFRYXKRdXECXAS7o4q4DIQQhCEEsDqCABByccMMTb3jCDU7QKSp1IAAAAAAADADwAACQXAAREdHMYWRobHB0eHyAhIiMkAgAAAAAABcAfAAAJCVAREQ0cxgZGhscHR4fICEiIyQBAIAAAgAAAAAggAAEBAQAAAAAAAIAAAAEBB9DtnUBAAAAAAAEPueBAKOFggAAgACjzoEAA4BwBwCdASqwAJAAAEcIhYWIhYSIAgIABhwJ7kPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99YAD+/6tQgKOFggADgAqjhYIAD4AOo4WCACSADqOZgQArADECAAEQEAAYABhYL/QACIBDmAYAAKOFggA6gA6jhYIAT4AOo5mBAFMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAGSADqOFggB6gA6jmYEAewAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIAj4AOo5mBAKMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAKSADqOFggC6gA6jmYEAywAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIAz4AOo4WCAOSADqOZgQDzADECAAEQEAAYABhYL/QACIBDmAYAAKOFggD6gA6jhYIBD4AOo5iBARsAEQIAARAQFGAAYWC/0AAiAQ5gGACjhYIBJIAOo4WCATqADqOZgQFDADECAAEQEAAYABhYL/QACIBDmAYAAKOFggFPgA6jhYIBZIAOo5mBAWsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAXqADqOFggGPgA6jmYEBkwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIBpIAOo4WCAbqADqOZgQG7ADECAAEQEAAYABhYL/QACIBDmAYAAKOFggHPgA6jmYEB4wAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIB5IAOo4WCAfqADqOZgQILADECAAEQEAAYABhYL/QACIBDmAYAAKOFggIPgA6jhYICJIAOo5mBAjMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAjqADqOFggJPgA6jmYECWwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYICZIAOo4WCAnqADqOZgQKDADECAAEQEAAYABhYL/QACIBDmAYAAKOFggKPgA6jhYICpIAOo5mBAqsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCArqADqOFggLPgA6jmIEC0wARAgABEBAUYABhYL/QACIBDmAYAKOFggLkgA6jhYIC+oAOo5mBAvsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAw+ADqOZgQMjADECAAEQEAAYABhYL/QACIBDmAYAAKOFggMkgA6jhYIDOoAOo5mBA0sAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCA0+ADqOFggNkgA6jmYEDcwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIDeoAOo4WCA4+ADqOZgQObADECAAEQEAAYABhYL/QACIBDmAYAAKOFggOkgA6jhYIDuoAOo5mBA8MAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCA8+ADqOFggPkgA6jhYID+oAOo4WCBA+ADhxTu2sBAAAAAAAAEbuPs4EDt4r3gQHxghEr8IEK",mp4="data:video/mp4;base64, AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjMQAAAAhmcmVlAAAGF21kYXTeBAAAbGliZmFhYyAxLjI4AABCAJMgBDIARwAAArEGBf//rdxF6b3m2Ui3lizYINkj7u94MjY0IC0gY29yZSAxNDIgcjIgOTU2YzhkOCAtIEguMjY0L01QRUctNCBBVkMgY29kZWMgLSBDb3B5bGVmdCAyMDAzLTIwMTQgLSBodHRwOi8vd3d3LnZpZGVvbGFuLm9yZy94MjY0Lmh0bWwgLSBvcHRpb25zOiBjYWJhYz0wIHJlZj0zIGRlYmxvY2s9MTowOjAgYW5hbHlzZT0weDE6MHgxMTEgbWU9aGV4IHN1Ym1lPTcgcHN5PTEgcHN5X3JkPTEuMDA6MC4wMCBtaXhlZF9yZWY9MSBtZV9yYW5nZT0xNiBjaHJvbWFfbWU9MSB0cmVsbGlzPTEgOHg4ZGN0PTAgY3FtPTAgZGVhZHpvbmU9MjEsMTEgZmFzdF9wc2tpcD0xIGNocm9tYV9xcF9vZmZzZXQ9LTIgdGhyZWFkcz02IGxvb2thaGVhZF90aHJlYWRzPTEgc2xpY2VkX3RocmVhZHM9MCBucj0wIGRlY2ltYXRlPTEgaW50ZXJsYWNlZD0wIGJsdXJheV9jb21wYXQ9MCBjb25zdHJhaW5lZF9pbnRyYT0wIGJmcmFtZXM9MCB3ZWlnaHRwPTAga2V5aW50PTI1MCBrZXlpbnRfbWluPTI1IHNjZW5lY3V0PTQwIGludHJhX3JlZnJlc2g9MCByY19sb29rYWhlYWQ9NDAgcmM9Y3JmIG1idHJlZT0xIGNyZj0yMy4wIHFjb21wPTAuNjAgcXBtaW49MCBxcG1heD02OSBxcHN0ZXA9NCB2YnZfbWF4cmF0ZT03NjggdmJ2X2J1ZnNpemU9MzAwMCBjcmZfbWF4PTAuMCBuYWxfaHJkPW5vbmUgZmlsbGVyPTAgaXBfcmF0aW89MS40MCBhcT0xOjEuMDAAgAAAAFZliIQL8mKAAKvMnJycnJycnJycnXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXiEASZACGQAjgCEASZACGQAjgAAAAAdBmjgX4GSAIQBJkAIZACOAAAAAB0GaVAX4GSAhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZpgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGagC/AySEASZACGQAjgAAAAAZBmqAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZrAL8DJIQBJkAIZACOAAAAABkGa4C/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmwAvwMkhAEmQAhkAI4AAAAAGQZsgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGbQC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBm2AvwMkhAEmQAhkAI4AAAAAGQZuAL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGboC/AySEASZACGQAjgAAAAAZBm8AvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZvgL8DJIQBJkAIZACOAAAAABkGaAC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmiAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZpAL8DJIQBJkAIZACOAAAAABkGaYC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmoAvwMkhAEmQAhkAI4AAAAAGQZqgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGawC/AySEASZACGQAjgAAAAAZBmuAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZsAL8DJIQBJkAIZACOAAAAABkGbIC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBm0AvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZtgL8DJIQBJkAIZACOAAAAABkGbgCvAySEASZACGQAjgCEASZACGQAjgAAAAAZBm6AnwMkhAEmQAhkAI4AhAEmQAhkAI4AhAEmQAhkAI4AhAEmQAhkAI4AAAAhubW9vdgAAAGxtdmhkAAAAAAAAAAAAAAAAAAAD6AAABDcAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAzB0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAABAAAAAAAAA+kAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAALAAAACQAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAPpAAAAAAABAAAAAAKobWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAB1MAAAdU5VxAAAAAAALWhkbHIAAAAAAAAAAHZpZGUAAAAAAAAAAAAAAABWaWRlb0hhbmRsZXIAAAACU21pbmYAAAAUdm1oZAAAAAEAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAhNzdGJsAAAAr3N0c2QAAAAAAAAAAQAAAJ9hdmMxAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAALAAkABIAAAASAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGP//AAAALWF2Y0MBQsAN/+EAFWdCwA3ZAsTsBEAAAPpAADqYA8UKkgEABWjLg8sgAAAAHHV1aWRraEDyXyRPxbo5pRvPAyPzAAAAAAAAABhzdHRzAAAAAAAAAAEAAAAeAAAD6QAAABRzdHNzAAAAAAAAAAEAAAABAAAAHHN0c2MAAAAAAAAAAQAAAAEAAAABAAAAAQAAAIxzdHN6AAAAAAAAAAAAAAAeAAADDwAAAAsAAAALAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAAiHN0Y28AAAAAAAAAHgAAAEYAAANnAAADewAAA5gAAAO0AAADxwAAA+MAAAP2AAAEEgAABCUAAARBAAAEXQAABHAAAASMAAAEnwAABLsAAATOAAAE6gAABQYAAAUZAAAFNQAABUgAAAVkAAAFdwAABZMAAAWmAAAFwgAABd4AAAXxAAAGDQAABGh0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAACAAAAAAAABDcAAAAAAAAAAAAAAAEBAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAQkAAADcAABAAAAAAPgbWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAC7gAAAykBVxAAAAAAALWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABTb3VuZEhhbmRsZXIAAAADi21pbmYAAAAQc21oZAAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAADT3N0YmwAAABnc3RzZAAAAAAAAAABAAAAV21wNGEAAAAAAAAAAQAAAAAAAAAAAAIAEAAAAAC7gAAAAAAAM2VzZHMAAAAAA4CAgCIAAgAEgICAFEAVBbjYAAu4AAAADcoFgICAAhGQBoCAgAECAAAAIHN0dHMAAAAAAAAAAgAAADIAAAQAAAAAAQAAAkAAAAFUc3RzYwAAAAAAAAAbAAAAAQAAAAEAAAABAAAAAgAAAAIAAAABAAAAAwAAAAEAAAABAAAABAAAAAIAAAABAAAABgAAAAEAAAABAAAABwAAAAIAAAABAAAACAAAAAEAAAABAAAACQAAAAIAAAABAAAACgAAAAEAAAABAAAACwAAAAIAAAABAAAADQAAAAEAAAABAAAADgAAAAIAAAABAAAADwAAAAEAAAABAAAAEAAAAAIAAAABAAAAEQAAAAEAAAABAAAAEgAAAAIAAAABAAAAFAAAAAEAAAABAAAAFQAAAAIAAAABAAAAFgAAAAEAAAABAAAAFwAAAAIAAAABAAAAGAAAAAEAAAABAAAAGQAAAAIAAAABAAAAGgAAAAEAAAABAAAAGwAAAAIAAAABAAAAHQAAAAEAAAABAAAAHgAAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw",oldIOS=function(){return"undefined"!=typeof navigator&&parseFloat((""+(/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))<10&&!window.MSStream},nativeWakeLock=function(){return"wakeLock"in navigator},NoSleep=function(){function e(){var t=this;_classCallCheck$2(this,e),this.enabled=!1,nativeWakeLock()?(this._wakeLock=null,this.handleVisibilityChange=function(){null!==t._wakeLock&&t.visible&&t.enable()},document.addEventListener("visibilitychange",this.handleVisibilityChange),document.addEventListener("fullscreenchange",this.handleVisibilityChange)):oldIOS()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"mp4",mp4),this._addSourceToVideo(this.noSleepVideo,"webm",webm),this.noSleepVideo.addEventListener("loadedmetadata",(function(){t.noSleepVideo&&(t.noSleepVideo.duration<=1?t.noSleepVideo.setAttribute("loop",""):(t.onTimeupdate=function(){t.noSleepVideo.currentTime>.5&&(t.noSleepVideo.currentTime=Math.random())},t.noSleepVideo.addEventListener("timeupdate",t.onTimeupdate)))})))}return _createClass$2(e,[{key:"_addSourceToVideo",value:function(e,t,r){var n=document.createElement("source");n.src=r,n.type="video/".concat(t),e.appendChild(n)}},{key:"visible",get:function(){return"visible"===document.visibilityState}},{key:"isEnabled",get:function(){return this.enabled}},{key:"enable",value:function(){var e,t=this;if(nativeWakeLock()&&this.visible)return navigator.wakeLock.request("screen").then((function(e){t._wakeLock=e,t.enabled=!0,t._wakeLock.addEventListener("release",(function(){}))})).catch((function(){t.enabled=!1}));if(oldIOS())return this.disable(),console.warn("\n NoSleep enabled for older iOS devices. This can interrupt\n active or long-running network requests from completing successfully.\n See https://github.com/richtr/NoSleep.js/issues/15 for more details.\n "),this.noSleepTimer=window.setInterval((function(){document.hidden||(window.location.href=window.location.href.split("#")[0],window.setTimeout(window.stop,0))}),15e3),this.enabled=!0,Promise.resolve();if(null!==(e=this.noSleepVideo)&&void 0!==e&&e.paused){var r=this.noSleepVideo.play();return r&&r.then((function(e){return t.enabled=!0,e})).catch((function(e){console.log("noSleep: ",e.message),t.enabled=!1}))}}},{key:"disable",value:function(){nativeWakeLock()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):oldIOS()?this.noSleepTimer&&(console.warn("\n NoSleep now disabled for older iOS devices.\n "),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}},{key:"toPlay",value:function(){if(this.noSleepVideo&&this.noSleepVideo.paused){var e=performance.now();this.lastTs||(this.lastTs=e),e-this.lastTs>1e4&&(this.enable(),this.lastTs=e)}}},{key:"destroy",value:function(){this.disable(),this.handleVisibilityChange&&(document.removeEventListener("visibilitychange",this.handleVisibilityChange),document.removeEventListener("fullscreenchange",this.handleVisibilityChange)),this.onTimeupdate&&this.noSleepVideo.removeEventListener("timeupdate",this.onTimeupdate),this.noSleepVideo=null}}]),e}();function initBgSilenceAudio(){if(!document.querySelector("#hackAudioPP")){var e=document.createElement("div");e.innerHTML="<audio id='hackAudioPP'></audio>",document.body.appendChild(e);var t=e.children.item(0);t.controls=!1,t.preload="auto",t.innerHTML="<source src=".concat("data:audio/mpeg;base64,//uQxAAAAAAAAAAAAAAAAAAAAAAAWGluZwAAAA8AAAACAAACcQCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA//////////////////////////////////////////////////////////////////8AAABhTEFNRTMuMTAwA8MAAAAAAAAAABQgJAUHQQAB9AAAAnGMHkkIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//sQxAADgnABGiAAQBCqgCRMAAgEAH///////////////7+n/9FTuQsQH//////2NG0jWUGlio5gLQTOtIoeR2WX////X4s9Atb/JRVCbBUpeRUq//////////////////9RUi0f2jn/+xDECgPCjAEQAABN4AAANIAAAAQVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVQ==",' type="audio/mpeg"></source>'),t.muted=!0,t.loop=!0,t.play().catch((function(){}))}}function playSlienceAudio(){var e=ele||(ele=document.querySelector("#hackAudioPP"));e?!1===e.paused&&!1===e.muted||(e.muted=!1,e.play().catch((function(e){console.log("bgAudio: ",e.message)}))):initBgSilenceAudio()}function pauseSlienceAudio(){var e=ele||(ele=document.querySelector("#hackAudioPP"));e&&e.pause()}var IteratorPrototype$2,PrototypeOfArrayIteratorPrototype,arrayIterator,fails$h=fails$E,correctPrototypeGetter=!fails$h((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),hasOwn$5=hasOwnProperty_1,isCallable$4=isCallable$r,toObject$9=toObject$f,sharedKey=sharedKey$3,CORRECT_PROTOTYPE_GETTER=correctPrototypeGetter,IE_PROTO=sharedKey("IE_PROTO"),$Object=Object,ObjectPrototype$2=$Object.prototype,objectGetPrototypeOf=CORRECT_PROTOTYPE_GETTER?$Object.getPrototypeOf:function(e){var t=toObject$9(e);if(hasOwn$5(t,IE_PROTO))return t[IE_PROTO];var r=t.constructor;return isCallable$4(r)&&t instanceof r?r.prototype:t instanceof $Object?ObjectPrototype$2:null},fails$g=fails$E,isCallable$3=isCallable$r,isObject$5=isObject$g,getPrototypeOf$3=objectGetPrototypeOf,defineBuiltIn$6=defineBuiltIn$e,wellKnownSymbol$7=wellKnownSymbol$o,ITERATOR$5=wellKnownSymbol$7("iterator"),BUGGY_SAFARI_ITERATORS$1=!1;[].keys&&("next"in(arrayIterator=[].keys())?(PrototypeOfArrayIteratorPrototype=getPrototypeOf$3(getPrototypeOf$3(arrayIterator)))!==Object.prototype&&(IteratorPrototype$2=PrototypeOfArrayIteratorPrototype):BUGGY_SAFARI_ITERATORS$1=!0);var NEW_ITERATOR_PROTOTYPE=!isObject$5(IteratorPrototype$2)||fails$g((function(){var e={};return IteratorPrototype$2[ITERATOR$5].call(e)!==e}));NEW_ITERATOR_PROTOTYPE&&(IteratorPrototype$2={}),isCallable$3(IteratorPrototype$2[ITERATOR$5])||defineBuiltIn$6(IteratorPrototype$2,ITERATOR$5,(function(){return this}));var iteratorsCore={IteratorPrototype:IteratorPrototype$2,BUGGY_SAFARI_ITERATORS:BUGGY_SAFARI_ITERATORS$1},IteratorPrototype$1=iteratorsCore.IteratorPrototype,create$2=objectCreate,createPropertyDescriptor$2=createPropertyDescriptor$6,setToStringTag$4=setToStringTag$6,Iterators$2=iterators,returnThis$1=function(){return this},iteratorCreateConstructor=function(e,t,r,n){var i=t+" Iterator";return e.prototype=create$2(IteratorPrototype$1,{next:createPropertyDescriptor$2(+!n,r)}),setToStringTag$4(e,i,!1),Iterators$2[i]=returnThis$1,e},$$f=_export,call$8=functionCall,FunctionName$1=functionName,isCallable$2=isCallable$r,createIteratorConstructor$1=iteratorCreateConstructor,getPrototypeOf$2=objectGetPrototypeOf,setPrototypeOf$3=objectSetPrototypeOf,setToStringTag$3=setToStringTag$6,createNonEnumerableProperty$4=createNonEnumerableProperty$9,defineBuiltIn$5=defineBuiltIn$e,wellKnownSymbol$6=wellKnownSymbol$o,Iterators$1=iterators,IteratorsCore=iteratorsCore,PROPER_FUNCTION_NAME$2=FunctionName$1.PROPER,CONFIGURABLE_FUNCTION_NAME$1=FunctionName$1.CONFIGURABLE,IteratorPrototype=IteratorsCore.IteratorPrototype,BUGGY_SAFARI_ITERATORS=IteratorsCore.BUGGY_SAFARI_ITERATORS,ITERATOR$4=wellKnownSymbol$6("iterator"),KEYS="keys",VALUES="values",ENTRIES="entries",returnThis=function(){return this},iteratorDefine=function(e,t,r,n,i,o,a){createIteratorConstructor$1(r,t,n);var s,c,u,l=function(e){if(e===i&&p)return p;if(!BUGGY_SAFARI_ITERATORS&&e in h)return h[e];switch(e){case KEYS:case VALUES:case ENTRIES:return function(){return new r(this,e)}}return function(){return new r(this)}},A=t+" Iterator",d=!1,h=e.prototype,f=h[ITERATOR$4]||h["@@iterator"]||i&&h[i],p=!BUGGY_SAFARI_ITERATORS&&f||l(i),y="Array"==t&&h.entries||f;if(y&&(s=getPrototypeOf$2(y.call(new e)))!==Object.prototype&&s.next&&(getPrototypeOf$2(s)!==IteratorPrototype&&(setPrototypeOf$3?setPrototypeOf$3(s,IteratorPrototype):isCallable$2(s[ITERATOR$4])||defineBuiltIn$5(s,ITERATOR$4,returnThis)),setToStringTag$3(s,A,!0)),PROPER_FUNCTION_NAME$2&&i==VALUES&&f&&f.name!==VALUES&&(CONFIGURABLE_FUNCTION_NAME$1?createNonEnumerableProperty$4(h,"name",VALUES):(d=!0,p=function(){return call$8(f,this)})),i)if(c={values:l(VALUES),keys:o?p:l(KEYS),entries:l(ENTRIES)},a)for(u in c)(BUGGY_SAFARI_ITERATORS||d||!(u in h))&&defineBuiltIn$5(h,u,c[u]);else $$f({target:t,proto:!0,forced:BUGGY_SAFARI_ITERATORS||d},c);return h[ITERATOR$4]!==p&&defineBuiltIn$5(h,ITERATOR$4,p,{name:i}),Iterators$1[t]=p,c},createIterResultObject$2=function(e,t){return{value:e,done:t}},toIndexedObject$5=toIndexedObject$b,addToUnscopables$2=addToUnscopables$4,Iterators=iterators,InternalStateModule$6=internalState,defineProperty$5=objectDefineProperty.f,defineIterator$1=iteratorDefine,createIterResultObject$1=createIterResultObject$2,DESCRIPTORS$a=descriptors,ARRAY_ITERATOR="Array Iterator",setInternalState$5=InternalStateModule$6.set,getInternalState$4=InternalStateModule$6.getterFor(ARRAY_ITERATOR),es_array_iterator=defineIterator$1(Array,"Array",(function(e,t){setInternalState$5(this,{type:ARRAY_ITERATOR,target:toIndexedObject$5(e),index:0,kind:t})}),(function(){var e=getInternalState$4(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,createIterResultObject$1(void 0,!0)):createIterResultObject$1("keys"==r?n:"values"==r?t[n]:[n,t[n]],!1)}),"values"),values=Iterators.Arguments=Iterators.Array;if(addToUnscopables$2("keys"),addToUnscopables$2("values"),addToUnscopables$2("entries"),DESCRIPTORS$a&&"values"!==values.name)try{defineProperty$5(values,"name",{value:"values"})}catch(e){}var NAME$1,Constructor,Prototype,typedArrayConstructor={exports:{}},arrayBufferBasicDetection="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,NATIVE_ARRAY_BUFFER$1=arrayBufferBasicDetection,DESCRIPTORS$9=descriptors,global$f=global$D,isCallable$1=isCallable$r,isObject$4=isObject$g,hasOwn$4=hasOwnProperty_1,classof$4=classof$e,tryToString$1=tryToString$6,createNonEnumerableProperty$3=createNonEnumerableProperty$9,defineBuiltIn$4=defineBuiltIn$e,defineProperty$4=objectDefineProperty.f,isPrototypeOf$2=objectIsPrototypeOf,getPrototypeOf$1=objectGetPrototypeOf,setPrototypeOf$2=objectSetPrototypeOf,wellKnownSymbol$5=wellKnownSymbol$o,uid=uid$3,InternalStateModule$5=internalState,enforceInternalState$1=InternalStateModule$5.enforce,getInternalState$3=InternalStateModule$5.get,Int8Array$4=global$f.Int8Array,Int8ArrayPrototype$1=Int8Array$4&&Int8Array$4.prototype,Uint8ClampedArray$1=global$f.Uint8ClampedArray,Uint8ClampedArrayPrototype=Uint8ClampedArray$1&&Uint8ClampedArray$1.prototype,TypedArray$1=Int8Array$4&&getPrototypeOf$1(Int8Array$4),TypedArrayPrototype$2=Int8ArrayPrototype$1&&getPrototypeOf$1(Int8ArrayPrototype$1),ObjectPrototype$1=Object.prototype,TypeError$3=global$f.TypeError,TO_STRING_TAG$1=wellKnownSymbol$5("toStringTag"),TYPED_ARRAY_TAG$1=uid("TYPED_ARRAY_TAG"),TYPED_ARRAY_CONSTRUCTOR="TypedArrayConstructor",NATIVE_ARRAY_BUFFER_VIEWS$2=NATIVE_ARRAY_BUFFER$1&&!!setPrototypeOf$2&&"Opera"!==classof$4(global$f.opera),TYPED_ARRAY_TAG_REQUIRED=!1,TypedArrayConstructorsList={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},BigIntArrayConstructorsList={BigInt64Array:8,BigUint64Array:8},isView=function(e){if(!isObject$4(e))return!1;var t=classof$4(e);return"DataView"===t||hasOwn$4(TypedArrayConstructorsList,t)||hasOwn$4(BigIntArrayConstructorsList,t)},getTypedArrayConstructor$1=function(e){var t=getPrototypeOf$1(e);if(isObject$4(t)){var r=getInternalState$3(t);return r&&hasOwn$4(r,TYPED_ARRAY_CONSTRUCTOR)?r[TYPED_ARRAY_CONSTRUCTOR]:getTypedArrayConstructor$1(t)}},isTypedArray$1=function(e){if(!isObject$4(e))return!1;var t=classof$4(e);return hasOwn$4(TypedArrayConstructorsList,t)||hasOwn$4(BigIntArrayConstructorsList,t)},aTypedArray$p=function(e){if(isTypedArray$1(e))return e;throw TypeError$3("Target is not a typed array")},aTypedArrayConstructor$3=function(e){if(isCallable$1(e)&&(!setPrototypeOf$2||isPrototypeOf$2(TypedArray$1,e)))return e;throw TypeError$3(tryToString$1(e)+" is not a typed array constructor")},exportTypedArrayMethod$q=function(e,t,r,n){if(DESCRIPTORS$9){if(r)for(var i in TypedArrayConstructorsList){var o=global$f[i];if(o&&hasOwn$4(o.prototype,e))try{delete o.prototype[e]}catch(r){try{o.prototype[e]=t}catch(e){}}}TypedArrayPrototype$2[e]&&!r||defineBuiltIn$4(TypedArrayPrototype$2,e,r?t:NATIVE_ARRAY_BUFFER_VIEWS$2&&Int8ArrayPrototype$1[e]||t,n)}},exportTypedArrayStaticMethod=function(e,t,r){var n,i;if(DESCRIPTORS$9){if(setPrototypeOf$2){if(r)for(n in TypedArrayConstructorsList)if((i=global$f[n])&&hasOwn$4(i,e))try{delete i[e]}catch(e){}if(TypedArray$1[e]&&!r)return;try{return defineBuiltIn$4(TypedArray$1,e,r?t:NATIVE_ARRAY_BUFFER_VIEWS$2&&TypedArray$1[e]||t)}catch(e){}}for(n in TypedArrayConstructorsList)!(i=global$f[n])||i[e]&&!r||defineBuiltIn$4(i,e,t)}};for(NAME$1 in TypedArrayConstructorsList)(Prototype=(Constructor=global$f[NAME$1])&&Constructor.prototype)?enforceInternalState$1(Prototype)[TYPED_ARRAY_CONSTRUCTOR]=Constructor:NATIVE_ARRAY_BUFFER_VIEWS$2=!1;for(NAME$1 in BigIntArrayConstructorsList)(Prototype=(Constructor=global$f[NAME$1])&&Constructor.prototype)&&(enforceInternalState$1(Prototype)[TYPED_ARRAY_CONSTRUCTOR]=Constructor);if((!NATIVE_ARRAY_BUFFER_VIEWS$2||!isCallable$1(TypedArray$1)||TypedArray$1===Function.prototype)&&(TypedArray$1=function(){throw TypeError$3("Incorrect invocation")},NATIVE_ARRAY_BUFFER_VIEWS$2))for(NAME$1 in TypedArrayConstructorsList)global$f[NAME$1]&&setPrototypeOf$2(global$f[NAME$1],TypedArray$1);if((!NATIVE_ARRAY_BUFFER_VIEWS$2||!TypedArrayPrototype$2||TypedArrayPrototype$2===ObjectPrototype$1)&&(TypedArrayPrototype$2=TypedArray$1.prototype,NATIVE_ARRAY_BUFFER_VIEWS$2))for(NAME$1 in TypedArrayConstructorsList)global$f[NAME$1]&&setPrototypeOf$2(global$f[NAME$1].prototype,TypedArrayPrototype$2);if(NATIVE_ARRAY_BUFFER_VIEWS$2&&getPrototypeOf$1(Uint8ClampedArrayPrototype)!==TypedArrayPrototype$2&&setPrototypeOf$2(Uint8ClampedArrayPrototype,TypedArrayPrototype$2),DESCRIPTORS$9&&!hasOwn$4(TypedArrayPrototype$2,TO_STRING_TAG$1))for(NAME$1 in TYPED_ARRAY_TAG_REQUIRED=!0,defineProperty$4(TypedArrayPrototype$2,TO_STRING_TAG$1,{get:function(){return isObject$4(this)?this[TYPED_ARRAY_TAG$1]:void 0}}),TypedArrayConstructorsList)global$f[NAME$1]&&createNonEnumerableProperty$3(global$f[NAME$1],TYPED_ARRAY_TAG$1,NAME$1);var arrayBufferViewCore={NATIVE_ARRAY_BUFFER_VIEWS:NATIVE_ARRAY_BUFFER_VIEWS$2,TYPED_ARRAY_TAG:TYPED_ARRAY_TAG_REQUIRED&&TYPED_ARRAY_TAG$1,aTypedArray:aTypedArray$p,aTypedArrayConstructor:aTypedArrayConstructor$3,exportTypedArrayMethod:exportTypedArrayMethod$q,exportTypedArrayStaticMethod:exportTypedArrayStaticMethod,getTypedArrayConstructor:getTypedArrayConstructor$1,isView:isView,isTypedArray:isTypedArray$1,TypedArray:TypedArray$1,TypedArrayPrototype:TypedArrayPrototype$2},global$e=global$D,fails$f=fails$E,checkCorrectnessOfIteration=checkCorrectnessOfIteration$2,NATIVE_ARRAY_BUFFER_VIEWS$1=arrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS,ArrayBuffer$3=global$e.ArrayBuffer,Int8Array$3=global$e.Int8Array,typedArrayConstructorsRequireWrappers=!NATIVE_ARRAY_BUFFER_VIEWS$1||!fails$f((function(){Int8Array$3(1)}))||!fails$f((function(){new Int8Array$3(-1)}))||!checkCorrectnessOfIteration((function(e){new Int8Array$3,new Int8Array$3(null),new Int8Array$3(1.5),new Int8Array$3(e)}),!0)||fails$f((function(){return 1!==new Int8Array$3(new ArrayBuffer$3(2),1,void 0).length})),defineBuiltIn$3=defineBuiltIn$e,defineBuiltIns$2=function(e,t,r){for(var n in t)defineBuiltIn$3(e,n,t[n],r);return e},toIntegerOrInfinity$7=toIntegerOrInfinity$c,toLength$3=toLength$6,$RangeError$5=RangeError,toIndex$2=function(e){if(void 0===e)return 0;var t=toIntegerOrInfinity$7(e),r=toLength$3(t);if(t!==r)throw $RangeError$5("Wrong length or index");return r},$Array$2=Array,abs=Math.abs,pow$2=Math.pow,floor$6=Math.floor,log$1=Math.log,LN2=Math.LN2,pack=function(e,t,r){var n,i,o,a=$Array$2(r),s=8*r-t-1,c=(1<<s)-1,u=c>>1,l=23===t?pow$2(2,-24)-pow$2(2,-77):0,A=e<0||0===e&&1/e<0?1:0,d=0;for((e=abs(e))!=e||e===1/0?(i=e!=e?1:0,n=c):(n=floor$6(log$1(e)/LN2),e*(o=pow$2(2,-n))<1&&(n--,o*=2),(e+=n+u>=1?l/o:l*pow$2(2,1-u))*o>=2&&(n++,o/=2),n+u>=c?(i=0,n=c):n+u>=1?(i=(e*o-1)*pow$2(2,t),n+=u):(i=e*pow$2(2,u-1)*pow$2(2,t),n=0));t>=8;)a[d++]=255&i,i/=256,t-=8;for(n=n<<t|i,s+=t;s>0;)a[d++]=255&n,n/=256,s-=8;return a[--d]|=128*A,a},unpack=function(e,t){var r,n=e.length,i=8*n-t-1,o=(1<<i)-1,a=o>>1,s=i-7,c=n-1,u=e[c--],l=127&u;for(u>>=7;s>0;)l=256*l+e[c--],s-=8;for(r=l&(1<<-s)-1,l>>=-s,s+=t;s>0;)r=256*r+e[c--],s-=8;if(0===l)l=1-a;else{if(l===o)return r?NaN:u?-1/0:1/0;r+=pow$2(2,t),l-=a}return(u?-1:1)*r*pow$2(2,l-t)},ieee754={pack:pack,unpack:unpack},global$d=global$D,uncurryThis$g=functionUncurryThis,DESCRIPTORS$8=descriptors,NATIVE_ARRAY_BUFFER=arrayBufferBasicDetection,FunctionName=functionName,createNonEnumerableProperty$2=createNonEnumerableProperty$9,defineBuiltIns$1=defineBuiltIns$2,fails$e=fails$E,anInstance$3=anInstance$5,toIntegerOrInfinity$6=toIntegerOrInfinity$c,toLength$2=toLength$6,toIndex$1=toIndex$2,IEEE754=ieee754,getPrototypeOf=objectGetPrototypeOf,setPrototypeOf$1=objectSetPrototypeOf,getOwnPropertyNames$1=objectGetOwnPropertyNames.f,defineProperty$3=objectDefineProperty.f,arrayFill=arrayFill$1,arraySlice$4=arraySliceSimple,setToStringTag$2=setToStringTag$6,InternalStateModule$4=internalState,PROPER_FUNCTION_NAME$1=FunctionName.PROPER,CONFIGURABLE_FUNCTION_NAME=FunctionName.CONFIGURABLE,getInternalState$2=InternalStateModule$4.get,setInternalState$4=InternalStateModule$4.set,ARRAY_BUFFER$1="ArrayBuffer",DATA_VIEW="DataView",PROTOTYPE="prototype",WRONG_LENGTH$1="Wrong length",WRONG_INDEX="Wrong index",NativeArrayBuffer$1=global$d[ARRAY_BUFFER$1],$ArrayBuffer=NativeArrayBuffer$1,ArrayBufferPrototype$1=$ArrayBuffer&&$ArrayBuffer[PROTOTYPE],$DataView=global$d[DATA_VIEW],DataViewPrototype=$DataView&&$DataView[PROTOTYPE],ObjectPrototype=Object.prototype,Array$1=global$d.Array,RangeError$3=global$d.RangeError,fill2=uncurryThis$g(arrayFill),reverse=uncurryThis$g([].reverse),packIEEE754=IEEE754.pack,unpackIEEE754=IEEE754.unpack,packInt8=function(e){return[255&e]},packInt16=function(e){return[255&e,e>>8&255]},packInt32=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},unpackInt32=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},packFloat32=function(e){return packIEEE754(e,23,4)},packFloat64=function(e){return packIEEE754(e,52,8)},addGetter$1=function(e,t){defineProperty$3(e[PROTOTYPE],t,{get:function(){return getInternalState$2(this)[t]}})},get=function(e,t,r,n){var i=toIndex$1(r),o=getInternalState$2(e);if(i+t>o.byteLength)throw RangeError$3(WRONG_INDEX);var a=getInternalState$2(o.buffer).bytes,s=i+o.byteOffset,c=arraySlice$4(a,s,s+t);return n?c:reverse(c)},set=function(e,t,r,n,i,o){var a=toIndex$1(r),s=getInternalState$2(e);if(a+t>s.byteLength)throw RangeError$3(WRONG_INDEX);for(var c=getInternalState$2(s.buffer).bytes,u=a+s.byteOffset,l=n(+i),A=0;A<t;A++)c[u+A]=l[o?A:t-A-1]};if(NATIVE_ARRAY_BUFFER){var INCORRECT_ARRAY_BUFFER_NAME=PROPER_FUNCTION_NAME$1&&NativeArrayBuffer$1.name!==ARRAY_BUFFER$1;if(fails$e((function(){NativeArrayBuffer$1(1)}))&&fails$e((function(){new NativeArrayBuffer$1(-1)}))&&!fails$e((function(){return new NativeArrayBuffer$1,new NativeArrayBuffer$1(1.5),new NativeArrayBuffer$1(NaN),1!=NativeArrayBuffer$1.length||INCORRECT_ARRAY_BUFFER_NAME&&!CONFIGURABLE_FUNCTION_NAME})))INCORRECT_ARRAY_BUFFER_NAME&&CONFIGURABLE_FUNCTION_NAME&&createNonEnumerableProperty$2(NativeArrayBuffer$1,"name",ARRAY_BUFFER$1);else{($ArrayBuffer=function(e){return anInstance$3(this,ArrayBufferPrototype$1),new NativeArrayBuffer$1(toIndex$1(e))})[PROTOTYPE]=ArrayBufferPrototype$1;for(var key,keys5=getOwnPropertyNames$1(NativeArrayBuffer$1),j=0;keys5.length>j;)(key=keys5[j++])in $ArrayBuffer||createNonEnumerableProperty$2($ArrayBuffer,key,NativeArrayBuffer$1[key]);ArrayBufferPrototype$1.constructor=$ArrayBuffer}setPrototypeOf$1&&getPrototypeOf(DataViewPrototype)!==ObjectPrototype&&setPrototypeOf$1(DataViewPrototype,ObjectPrototype);var testView=new $DataView(new $ArrayBuffer(2)),$setInt8=uncurryThis$g(DataViewPrototype.setInt8);testView.setInt8(0,2147483648),testView.setInt8(1,2147483649),!testView.getInt8(0)&&testView.getInt8(1)||defineBuiltIns$1(DataViewPrototype,{setInt8:function(e,t){$setInt8(this,e,t<<24>>24)},setUint8:function(e,t){$setInt8(this,e,t<<24>>24)}},{unsafe:!0})}else ArrayBufferPrototype$1=($ArrayBuffer=function(e){anInstance$3(this,ArrayBufferPrototype$1);var t=toIndex$1(e);setInternalState$4(this,{bytes:fill2(Array$1(t),0),byteLength:t}),DESCRIPTORS$8||(this.byteLength=t)})[PROTOTYPE],DataViewPrototype=($DataView=function(e,t,r){anInstance$3(this,DataViewPrototype),anInstance$3(e,ArrayBufferPrototype$1);var n=getInternalState$2(e).byteLength,i=toIntegerOrInfinity$6(t);if(i<0||i>n)throw RangeError$3("Wrong offset");if(i+(r=void 0===r?n-i:toLength$2(r))>n)throw RangeError$3(WRONG_LENGTH$1);setInternalState$4(this,{buffer:e,byteLength:r,byteOffset:i}),DESCRIPTORS$8||(this.buffer=e,this.byteLength=r,this.byteOffset=i)})[PROTOTYPE],DESCRIPTORS$8&&(addGetter$1($ArrayBuffer,"byteLength"),addGetter$1($DataView,"buffer"),addGetter$1($DataView,"byteLength"),addGetter$1($DataView,"byteOffset")),defineBuiltIns$1(DataViewPrototype,{getInt8:function(e){return get(this,1,e)[0]<<24>>24},getUint8:function(e){return get(this,1,e)[0]},getInt16:function(e){var t=get(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=get(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return unpackInt32(get(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return unpackInt32(get(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return unpackIEEE754(get(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return unpackIEEE754(get(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){set(this,1,e,packInt8,t)},setUint8:function(e,t){set(this,1,e,packInt8,t)},setInt16:function(e,t){set(this,2,e,packInt16,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){set(this,2,e,packInt16,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){set(this,4,e,packInt32,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){set(this,4,e,packInt32,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){set(this,4,e,packFloat32,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){set(this,8,e,packFloat64,t,arguments.length>2?arguments[2]:void 0)}});setToStringTag$2($ArrayBuffer,ARRAY_BUFFER$1),setToStringTag$2($DataView,DATA_VIEW);var arrayBuffer={ArrayBuffer:$ArrayBuffer,DataView:$DataView},isObject$3=isObject$g,floor$5=Math.floor,isIntegralNumber$1=Number.isInteger||function(e){return!isObject$3(e)&&isFinite(e)&&floor$5(e)===e},toIntegerOrInfinity$5=toIntegerOrInfinity$c,$RangeError$4=RangeError,toPositiveInteger$1=function(e){var t=toIntegerOrInfinity$5(e);if(t<0)throw $RangeError$4("The argument can't be less than 0");return t},toPositiveInteger=toPositiveInteger$1,$RangeError$3=RangeError,toOffset$2=function(e,t){var r=toPositiveInteger(e);if(r%t)throw $RangeError$3("Wrong offset");return r},classof$3=classof$e,uncurryThis$f=functionUncurryThis,slice$1=uncurryThis$f("".slice),isBigIntArray$1=function(e){return"Big"===slice$1(classof$3(e),0,3)},toPrimitive=toPrimitive$3,$TypeError$3=TypeError,toBigInt$2=function(e){var t=toPrimitive(e,"number");if("number"==typeof t)throw $TypeError$3("Can't convert number to bigint");return BigInt(t)},bind$4=functionBindContext,call$7=functionCall,aConstructor=aConstructor$2,toObject$8=toObject$f,lengthOfArrayLike$b=lengthOfArrayLike$i,getIterator$2=getIterator$4,getIteratorMethod$2=getIteratorMethod$5,isArrayIteratorMethod$1=isArrayIteratorMethod$3,isBigIntArray=isBigIntArray$1,aTypedArrayConstructor$2=arrayBufferViewCore.aTypedArrayConstructor,toBigInt$1=toBigInt$2,typedArrayFrom$1=function(e){var t,r,n,i,o,a,s,c,u=aConstructor(this),l=toObject$8(e),A=arguments.length,d=A>1?arguments[1]:void 0,h=void 0!==d,f=getIteratorMethod$2(l);if(f&&!isArrayIteratorMethod$1(f))for(c=(s=getIterator$2(l,f)).next,l=[];!(a=call$7(c,s)).done;)l.push(a.value);for(h&&A>2&&(d=bind$4(d,arguments[2])),r=lengthOfArrayLike$b(l),n=new(aTypedArrayConstructor$2(u))(r),i=isBigIntArray(n),t=0;r>t;t++)o=h?d(l[t],t):l[t],n[t]=i?toBigInt$1(o):+o;return n},$$e=_export,global$c=global$D,call$6=functionCall,DESCRIPTORS$7=descriptors,TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS=typedArrayConstructorsRequireWrappers,ArrayBufferViewCore$q=arrayBufferViewCore,ArrayBufferModule=arrayBuffer,anInstance$2=anInstance$5,createPropertyDescriptor$1=createPropertyDescriptor$6,createNonEnumerableProperty$1=createNonEnumerableProperty$9,isIntegralNumber=isIntegralNumber$1,toLength$1=toLength$6,toIndex=toIndex$2,toOffset$1=toOffset$2,toPropertyKey=toPropertyKey$4,hasOwn$3=hasOwnProperty_1,classof$2=classof$e,isObject$2=isObject$g,isSymbol=isSymbol$4,create$1=objectCreate,isPrototypeOf$1=objectIsPrototypeOf,setPrototypeOf=objectSetPrototypeOf,getOwnPropertyNames3=objectGetOwnPropertyNames.f,typedArrayFrom=typedArrayFrom$1,forEach2=arrayIteration.forEach,setSpecies$1=setSpecies$3,definePropertyModule=objectDefineProperty,getOwnPropertyDescriptorModule=objectGetOwnPropertyDescriptor,InternalStateModule$3=internalState,inheritIfRequired=inheritIfRequired$2,getInternalState$1=InternalStateModule$3.get,setInternalState$3=InternalStateModule$3.set,enforceInternalState=InternalStateModule$3.enforce,nativeDefineProperty=definePropertyModule.f,nativeGetOwnPropertyDescriptor=getOwnPropertyDescriptorModule.f,round=Math.round,RangeError$2=global$c.RangeError,ArrayBuffer$2=ArrayBufferModule.ArrayBuffer,ArrayBufferPrototype=ArrayBuffer$2.prototype,DataView$1=ArrayBufferModule.DataView,NATIVE_ARRAY_BUFFER_VIEWS=ArrayBufferViewCore$q.NATIVE_ARRAY_BUFFER_VIEWS,TYPED_ARRAY_TAG=ArrayBufferViewCore$q.TYPED_ARRAY_TAG,TypedArray=ArrayBufferViewCore$q.TypedArray,TypedArrayPrototype$1=ArrayBufferViewCore$q.TypedArrayPrototype,aTypedArrayConstructor$1=ArrayBufferViewCore$q.aTypedArrayConstructor,isTypedArray=ArrayBufferViewCore$q.isTypedArray,BYTES_PER_ELEMENT="BYTES_PER_ELEMENT",WRONG_LENGTH="Wrong length",fromList=function(e,t){aTypedArrayConstructor$1(e);for(var r=0,n=t.length,i=new e(n);n>r;)i[r]=t[r++];return i},addGetter=function(e,t){nativeDefineProperty(e,t,{get:function(){return getInternalState$1(this)[t]}})},isArrayBuffer=function(e){var t;return isPrototypeOf$1(ArrayBufferPrototype,e)||"ArrayBuffer"==(t=classof$2(e))||"SharedArrayBuffer"==t},isTypedArrayIndex=function(e,t){return isTypedArray(e)&&!isSymbol(t)&&t in e&&isIntegralNumber(+t)&&t>=0},wrappedGetOwnPropertyDescriptor=function(e,t){return t=toPropertyKey(t),isTypedArrayIndex(e,t)?createPropertyDescriptor$1(2,e[t]):nativeGetOwnPropertyDescriptor(e,t)},wrappedDefineProperty=function(e,t,r){return t=toPropertyKey(t),!(isTypedArrayIndex(e,t)&&isObject$2(r)&&hasOwn$3(r,"value"))||hasOwn$3(r,"get")||hasOwn$3(r,"set")||r.configurable||hasOwn$3(r,"writable")&&!r.writable||hasOwn$3(r,"enumerable")&&!r.enumerable?nativeDefineProperty(e,t,r):(e[t]=r.value,e)};DESCRIPTORS$7?(NATIVE_ARRAY_BUFFER_VIEWS||(getOwnPropertyDescriptorModule.f=wrappedGetOwnPropertyDescriptor,definePropertyModule.f=wrappedDefineProperty,addGetter(TypedArrayPrototype$1,"buffer"),addGetter(TypedArrayPrototype$1,"byteOffset"),addGetter(TypedArrayPrototype$1,"byteLength"),addGetter(TypedArrayPrototype$1,"length")),$$e({target:"Object",stat:!0,forced:!NATIVE_ARRAY_BUFFER_VIEWS},{getOwnPropertyDescriptor:wrappedGetOwnPropertyDescriptor,defineProperty:wrappedDefineProperty}),typedArrayConstructor.exports=function(e,t,r){var n=e.match(/\d+$/)[0]/8,i=e+(r?"Clamped":"")+"Array",o="get"+e,a="set"+e,s=global$c[i],c=s,u=c&&c.prototype,l={},A=function(e,t){nativeDefineProperty(e,t,{get:function(){return function(e,t){var r=getInternalState$1(e);return r.view[o](t*n+r.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,i){var o=getInternalState$1(e);r&&(i=(i=round(i))<0?0:i>255?255:255&i),o.view[a](t*n+o.byteOffset,i,!0)}(this,t,e)},enumerable:!0})};NATIVE_ARRAY_BUFFER_VIEWS?TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS&&(c=t((function(e,t,r,i){return anInstance$2(e,u),inheritIfRequired(isObject$2(t)?isArrayBuffer(t)?void 0!==i?new s(t,toOffset$1(r,n),i):void 0!==r?new s(t,toOffset$1(r,n)):new s(t):isTypedArray(t)?fromList(c,t):call$6(typedArrayFrom,c,t):new s(toIndex(t)),e,c)})),setPrototypeOf&&setPrototypeOf(c,TypedArray),forEach2(getOwnPropertyNames3(s),(function(e){e in c||createNonEnumerableProperty$1(c,e,s[e])})),c.prototype=u):(c=t((function(e,t,r,i){anInstance$2(e,u);var o,a,s,l=0,d=0;if(isObject$2(t)){if(!isArrayBuffer(t))return isTypedArray(t)?fromList(c,t):call$6(typedArrayFrom,c,t);o=t,d=toOffset$1(r,n);var h=t.byteLength;if(void 0===i){if(h%n)throw RangeError$2(WRONG_LENGTH);if((a=h-d)<0)throw RangeError$2(WRONG_LENGTH)}else if((a=toLength$1(i)*n)+d>h)throw RangeError$2(WRONG_LENGTH);s=a/n}else s=toIndex(t),o=new ArrayBuffer$2(a=s*n);for(setInternalState$3(e,{buffer:o,byteOffset:d,byteLength:a,length:s,view:new DataView$1(o)});l<s;)A(e,l++)})),setPrototypeOf&&setPrototypeOf(c,TypedArray),u=c.prototype=create$1(TypedArrayPrototype$1)),u.constructor!==c&&createNonEnumerableProperty$1(u,"constructor",c),enforceInternalState(u).TypedArrayConstructor=c,TYPED_ARRAY_TAG&&createNonEnumerableProperty$1(u,TYPED_ARRAY_TAG,i);var d=c!=s;l[i]=c,$$e({global:!0,constructor:!0,forced:d,sham:!NATIVE_ARRAY_BUFFER_VIEWS},l),BYTES_PER_ELEMENT in c||createNonEnumerableProperty$1(c,BYTES_PER_ELEMENT,n),BYTES_PER_ELEMENT in u||createNonEnumerableProperty$1(u,BYTES_PER_ELEMENT,n),setSpecies$1(i)}):typedArrayConstructor.exports=function(){};var typedArrayConstructorExports=typedArrayConstructor.exports,createTypedArrayConstructor$1=typedArrayConstructorExports;createTypedArrayConstructor$1("Uint8",(function(e){return function(t,r,n){return e(this,t,r,n)}}));var ArrayBufferViewCore$p=arrayBufferViewCore,lengthOfArrayLike$a=lengthOfArrayLike$i,toIntegerOrInfinity$4=toIntegerOrInfinity$c,aTypedArray$o=ArrayBufferViewCore$p.aTypedArray,exportTypedArrayMethod$p=ArrayBufferViewCore$p.exportTypedArrayMethod;exportTypedArrayMethod$p("at",(function(e){var t=aTypedArray$o(this),r=lengthOfArrayLike$a(t),n=toIntegerOrInfinity$4(e),i=n>=0?n:r+n;return i<0||i>=r?void 0:t[i]}));var tryToString=tryToString$6,$TypeError$2=TypeError,deletePropertyOrThrow$3=function(e,t){if(!delete e[t])throw $TypeError$2("Cannot delete property "+tryToString(t)+" of "+tryToString(e))},toObject$7=toObject$f,toAbsoluteIndex$3=toAbsoluteIndex$7,lengthOfArrayLike$9=lengthOfArrayLike$i,deletePropertyOrThrow$2=deletePropertyOrThrow$3,min$2=Math.min,arrayCopyWithin=[].copyWithin||function(e,t){var r=toObject$7(this),n=lengthOfArrayLike$9(r),i=toAbsoluteIndex$3(e,n),o=toAbsoluteIndex$3(t,n),a=arguments.length>2?arguments[2]:void 0,s=min$2((void 0===a?n:toAbsoluteIndex$3(a,n))-o,n-i),c=1;for(o<i&&i<o+s&&(c=-1,o+=s-1,i+=s-1);s-- >0;)o in r?r[i]=r[o]:deletePropertyOrThrow$2(r,i),i+=c,o+=c;return r},uncurryThis$e=functionUncurryThis,ArrayBufferViewCore$o=arrayBufferViewCore,$ArrayCopyWithin=arrayCopyWithin,u$ArrayCopyWithin=uncurryThis$e($ArrayCopyWithin),aTypedArray$n=ArrayBufferViewCore$o.aTypedArray,exportTypedArrayMethod$o=ArrayBufferViewCore$o.exportTypedArrayMethod;exportTypedArrayMethod$o("copyWithin",(function(e,t){return u$ArrayCopyWithin(aTypedArray$n(this),e,t,arguments.length>2?arguments[2]:void 0)}));var ArrayBufferViewCore$n=arrayBufferViewCore,$every=arrayIteration.every,aTypedArray$m=ArrayBufferViewCore$n.aTypedArray,exportTypedArrayMethod$n=ArrayBufferViewCore$n.exportTypedArrayMethod;exportTypedArrayMethod$n("every",(function(e){return $every(aTypedArray$m(this),e,arguments.length>1?arguments[1]:void 0)}));var ArrayBufferViewCore$m=arrayBufferViewCore,$fill=arrayFill$1,toBigInt=toBigInt$2,classof$1=classof$e,call$5=functionCall,uncurryThis$d=functionUncurryThis,fails$d=fails$E,aTypedArray$l=ArrayBufferViewCore$m.aTypedArray,exportTypedArrayMethod$m=ArrayBufferViewCore$m.exportTypedArrayMethod,slice=uncurryThis$d("".slice),CONVERSION_BUG=fails$d((function(){var e=0;return new Int8Array(2).fill({valueOf:function(){return e++}}),1!==e}));exportTypedArrayMethod$m("fill",(function(e){var t=arguments.length;aTypedArray$l(this);var r="Big"===slice(classof$1(this),0,3)?toBigInt(e):+e;return call$5($fill,this,r,t>1?arguments[1]:void 0,t>2?arguments[2]:void 0)}),CONVERSION_BUG);var lengthOfArrayLike$8=lengthOfArrayLike$i,arrayFromConstructorAndList$1=function(e,t){for(var r=0,n=lengthOfArrayLike$8(t),i=new e(n);n>r;)i[r]=t[r++];return i},ArrayBufferViewCore$l=arrayBufferViewCore,speciesConstructor=speciesConstructor$3,aTypedArrayConstructor=ArrayBufferViewCore$l.aTypedArrayConstructor,getTypedArrayConstructor=ArrayBufferViewCore$l.getTypedArrayConstructor,typedArraySpeciesConstructor$4=function(e){return aTypedArrayConstructor(speciesConstructor(e,getTypedArrayConstructor(e)))},arrayFromConstructorAndList=arrayFromConstructorAndList$1,typedArraySpeciesConstructor$3=typedArraySpeciesConstructor$4,typedArrayFromSpeciesAndList=function(e,t){return arrayFromConstructorAndList(typedArraySpeciesConstructor$3(e),t)},ArrayBufferViewCore$k=arrayBufferViewCore,$filter=arrayIteration.filter,fromSpeciesAndList=typedArrayFromSpeciesAndList,aTypedArray$k=ArrayBufferViewCore$k.aTypedArray,exportTypedArrayMethod$l=ArrayBufferViewCore$k.exportTypedArrayMethod;exportTypedArrayMethod$l("filter",(function(e){var t=$filter(aTypedArray$k(this),e,arguments.length>1?arguments[1]:void 0);return fromSpeciesAndList(this,t)}));var ArrayBufferViewCore$j=arrayBufferViewCore,$find$1=arrayIteration.find,aTypedArray$j=ArrayBufferViewCore$j.aTypedArray,exportTypedArrayMethod$k=ArrayBufferViewCore$j.exportTypedArrayMethod;exportTypedArrayMethod$k("find",(function(e){return $find$1(aTypedArray$j(this),e,arguments.length>1?arguments[1]:void 0)}));var ArrayBufferViewCore$i=arrayBufferViewCore,$findIndex$1=arrayIteration.findIndex,aTypedArray$i=ArrayBufferViewCore$i.aTypedArray,exportTypedArrayMethod$j=ArrayBufferViewCore$i.exportTypedArrayMethod;exportTypedArrayMethod$j("findIndex",(function(e){return $findIndex$1(aTypedArray$i(this),e,arguments.length>1?arguments[1]:void 0)}));var bind$3=functionBindContext,IndexedObject$3=indexedObject,toObject$6=toObject$f,lengthOfArrayLike$7=lengthOfArrayLike$i,createMethod$2=function(e){var t=1==e;return function(r,n,i){for(var o,a=toObject$6(r),s=IndexedObject$3(a),c=bind$3(n,i),u=lengthOfArrayLike$7(s);u-- >0;)if(c(o=s[u],u,a))switch(e){case 0:return o;case 1:return u}return t?-1:void 0}},arrayIterationFromLast={findLast:createMethod$2(0),findLastIndex:createMethod$2(1)},ArrayBufferViewCore$h=arrayBufferViewCore,$findLast=arrayIterationFromLast.findLast,aTypedArray$h=ArrayBufferViewCore$h.aTypedArray,exportTypedArrayMethod$i=ArrayBufferViewCore$h.exportTypedArrayMethod;exportTypedArrayMethod$i("findLast",(function(e){return $findLast(aTypedArray$h(this),e,arguments.length>1?arguments[1]:void 0)}));var ArrayBufferViewCore$g=arrayBufferViewCore,$findLastIndex=arrayIterationFromLast.findLastIndex,aTypedArray$g=ArrayBufferViewCore$g.aTypedArray,exportTypedArrayMethod$h=ArrayBufferViewCore$g.exportTypedArrayMethod;exportTypedArrayMethod$h("findLastIndex",(function(e){return $findLastIndex(aTypedArray$g(this),e,arguments.length>1?arguments[1]:void 0)}));var ArrayBufferViewCore$f=arrayBufferViewCore,$forEach=arrayIteration.forEach,aTypedArray$f=ArrayBufferViewCore$f.aTypedArray,exportTypedArrayMethod$g=ArrayBufferViewCore$f.exportTypedArrayMethod;exportTypedArrayMethod$g("forEach",(function(e){$forEach(aTypedArray$f(this),e,arguments.length>1?arguments[1]:void 0)}));var ArrayBufferViewCore$e=arrayBufferViewCore,$includes=arrayIncludes.includes,aTypedArray$e=ArrayBufferViewCore$e.aTypedArray,exportTypedArrayMethod$f=ArrayBufferViewCore$e.exportTypedArrayMethod;exportTypedArrayMethod$f("includes",(function(e){return $includes(aTypedArray$e(this),e,arguments.length>1?arguments[1]:void 0)}));var ArrayBufferViewCore$d=arrayBufferViewCore,$indexOf=arrayIncludes.indexOf,aTypedArray$d=ArrayBufferViewCore$d.aTypedArray,exportTypedArrayMethod$e=ArrayBufferViewCore$d.exportTypedArrayMethod;exportTypedArrayMethod$e("indexOf",(function(e){return $indexOf(aTypedArray$d(this),e,arguments.length>1?arguments[1]:void 0)}));var global$b=global$D,fails$c=fails$E,uncurryThis$c=functionUncurryThis,ArrayBufferViewCore$c=arrayBufferViewCore,ArrayIterators=es_array_iterator,wellKnownSymbol$4=wellKnownSymbol$o,ITERATOR$3=wellKnownSymbol$4("iterator"),Uint8Array$2=global$b.Uint8Array,arrayValues=uncurryThis$c(ArrayIterators.values),arrayKeys=uncurryThis$c(ArrayIterators.keys),arrayEntries=uncurryThis$c(ArrayIterators.entries),aTypedArray$c=ArrayBufferViewCore$c.aTypedArray,exportTypedArrayMethod$d=ArrayBufferViewCore$c.exportTypedArrayMethod,TypedArrayPrototype=Uint8Array$2&&Uint8Array$2.prototype,GENERIC=!fails$c((function(){TypedArrayPrototype[ITERATOR$3].call([1])})),ITERATOR_IS_VALUES=!!TypedArrayPrototype&&TypedArrayPrototype.values&&TypedArrayPrototype[ITERATOR$3]===TypedArrayPrototype.values&&"values"===TypedArrayPrototype.values.name,typedArrayValues=function(){return arrayValues(aTypedArray$c(this))};exportTypedArrayMethod$d("entries",(function(){return arrayEntries(aTypedArray$c(this))}),GENERIC),exportTypedArrayMethod$d("keys",(function(){return arrayKeys(aTypedArray$c(this))}),GENERIC),exportTypedArrayMethod$d("values",typedArrayValues,GENERIC||!ITERATOR_IS_VALUES,{name:"values"}),exportTypedArrayMethod$d(ITERATOR$3,typedArrayValues,GENERIC||!ITERATOR_IS_VALUES,{name:"values"});var ArrayBufferViewCore$b=arrayBufferViewCore,uncurryThis$b=functionUncurryThis,aTypedArray$b=ArrayBufferViewCore$b.aTypedArray,exportTypedArrayMethod$c=ArrayBufferViewCore$b.exportTypedArrayMethod,$join=uncurryThis$b([].join);exportTypedArrayMethod$c("join",(function(e){return $join(aTypedArray$b(this),e)}));var apply$2=functionApply,toIndexedObject$4=toIndexedObject$b,toIntegerOrInfinity$3=toIntegerOrInfinity$c,lengthOfArrayLike$6=lengthOfArrayLike$i,arrayMethodIsStrict$2=arrayMethodIsStrict$4,min$1=Math.min,$lastIndexOf$1=[].lastIndexOf,NEGATIVE_ZERO=!!$lastIndexOf$1&&1/[1].lastIndexOf(1,-0)<0,STRICT_METHOD$2=arrayMethodIsStrict$2("lastIndexOf"),FORCED$5=NEGATIVE_ZERO||!STRICT_METHOD$2,arrayLastIndexOf=FORCED$5?function(e){if(NEGATIVE_ZERO)return apply$2($lastIndexOf$1,this,arguments)||0;var t=toIndexedObject$4(this),r=lengthOfArrayLike$6(t),n=r-1;for(arguments.length>1&&(n=min$1(n,toIntegerOrInfinity$3(arguments[1]))),n<0&&(n=r+n);n>=0;n--)if(n in t&&t[n]===e)return n||0;return-1}:$lastIndexOf$1,ArrayBufferViewCore$a=arrayBufferViewCore,apply$1=functionApply,$lastIndexOf=arrayLastIndexOf,aTypedArray$a=ArrayBufferViewCore$a.aTypedArray,exportTypedArrayMethod$b=ArrayBufferViewCore$a.exportTypedArrayMethod;exportTypedArrayMethod$b("lastIndexOf",(function(e){var t=arguments.length;return apply$1($lastIndexOf,aTypedArray$a(this),t>1?[e,arguments[1]]:[e])}));var ArrayBufferViewCore$9=arrayBufferViewCore,$map=arrayIteration.map,typedArraySpeciesConstructor$2=typedArraySpeciesConstructor$4,aTypedArray$9=ArrayBufferViewCore$9.aTypedArray,exportTypedArrayMethod$a=ArrayBufferViewCore$9.exportTypedArrayMethod;exportTypedArrayMethod$a("map",(function(e){return $map(aTypedArray$9(this),e,arguments.length>1?arguments[1]:void 0,(function(e,t){return new(typedArraySpeciesConstructor$2(e))(t)}))}));var aCallable$2=aCallable$a,toObject$5=toObject$f,IndexedObject$2=indexedObject,lengthOfArrayLike$5=lengthOfArrayLike$i,$TypeError$1=TypeError,createMethod$1=function(e){return function(t,r,n,i){aCallable$2(r);var o=toObject$5(t),a=IndexedObject$2(o),s=lengthOfArrayLike$5(o),c=e?s-1:0,u=e?-1:1;if(n<2)for(;;){if(c in a){i=a[c],c+=u;break}if(c+=u,e?c<0:s<=c)throw $TypeError$1("Reduce of empty array with no initial value")}for(;e?c>=0:s>c;c+=u)c in a&&(i=r(i,a[c],c,o));return i}},arrayReduce={left:createMethod$1(!1),right:createMethod$1(!0)},ArrayBufferViewCore$8=arrayBufferViewCore,$reduce=arrayReduce.left,aTypedArray$8=ArrayBufferViewCore$8.aTypedArray,exportTypedArrayMethod$9=ArrayBufferViewCore$8.exportTypedArrayMethod;exportTypedArrayMethod$9("reduce",(function(e){var t=arguments.length;return $reduce(aTypedArray$8(this),e,t,t>1?arguments[1]:void 0)}));var ArrayBufferViewCore$7=arrayBufferViewCore,$reduceRight=arrayReduce.right,aTypedArray$7=ArrayBufferViewCore$7.aTypedArray,exportTypedArrayMethod$8=ArrayBufferViewCore$7.exportTypedArrayMethod;exportTypedArrayMethod$8("reduceRight",(function(e){var t=arguments.length;return $reduceRight(aTypedArray$7(this),e,t,t>1?arguments[1]:void 0)}));var ArrayBufferViewCore$6=arrayBufferViewCore,aTypedArray$6=ArrayBufferViewCore$6.aTypedArray,exportTypedArrayMethod$7=ArrayBufferViewCore$6.exportTypedArrayMethod,floor$4=Math.floor;exportTypedArrayMethod$7("reverse",(function(){for(var e,t=this,r=aTypedArray$6(t).length,n=floor$4(r/2),i=0;i<n;)e=t[i],t[i++]=t[--r],t[r]=e;return t}));var global$a=global$D,call$4=functionCall,ArrayBufferViewCore$5=arrayBufferViewCore,lengthOfArrayLike$4=lengthOfArrayLike$i,toOffset=toOffset$2,toIndexedObject$3=toObject$f,fails$b=fails$E,RangeError$1=global$a.RangeError,Int8Array$2=global$a.Int8Array,Int8ArrayPrototype=Int8Array$2&&Int8Array$2.prototype,$set=Int8ArrayPrototype&&Int8ArrayPrototype.set,aTypedArray$5=ArrayBufferViewCore$5.aTypedArray,exportTypedArrayMethod$6=ArrayBufferViewCore$5.exportTypedArrayMethod,WORKS_WITH_OBJECTS_AND_GEERIC_ON_TYPED_ARRAYS=!fails$b((function(){var e=new Uint8ClampedArray(2);return call$4($set,e,{length:1,0:3},1),3!==e[1]})),TO_OBJECT_BUG=WORKS_WITH_OBJECTS_AND_GEERIC_ON_TYPED_ARRAYS&&ArrayBufferViewCore$5.NATIVE_ARRAY_BUFFER_VIEWS&&fails$b((function(){var e=new Int8Array$2(2);return e.set(1),e.set("2",1),0!==e[0]||2!==e[1]}));exportTypedArrayMethod$6("set",(function(e){aTypedArray$5(this);var t=toOffset(arguments.length>1?arguments[1]:void 0,1),r=toIndexedObject$3(e);if(WORKS_WITH_OBJECTS_AND_GEERIC_ON_TYPED_ARRAYS)return call$4($set,this,r,t);var n=this.length,i=lengthOfArrayLike$4(r),o=0;if(i+t>n)throw RangeError$1("Wrong length");for(;o<i;)this[t+o]=r[o++]}),!WORKS_WITH_OBJECTS_AND_GEERIC_ON_TYPED_ARRAYS||TO_OBJECT_BUG);var ArrayBufferViewCore$4=arrayBufferViewCore,typedArraySpeciesConstructor$1=typedArraySpeciesConstructor$4,fails$a=fails$E,arraySlice$3=arraySlice$7,aTypedArray$4=ArrayBufferViewCore$4.aTypedArray,exportTypedArrayMethod$5=ArrayBufferViewCore$4.exportTypedArrayMethod,FORCED$4=fails$a((function(){new Int8Array(1).slice()}));exportTypedArrayMethod$5("slice",(function(e,t){for(var r=arraySlice$3(aTypedArray$4(this),e,t),n=typedArraySpeciesConstructor$1(this),i=0,o=r.length,a=new n(o);o>i;)a[i]=r[i++];return a}),FORCED$4);var ArrayBufferViewCore$3=arrayBufferViewCore,$some=arrayIteration.some,aTypedArray$3=ArrayBufferViewCore$3.aTypedArray,exportTypedArrayMethod$4=ArrayBufferViewCore$3.exportTypedArrayMethod;exportTypedArrayMethod$4("some",(function(e){return $some(aTypedArray$3(this),e,arguments.length>1?arguments[1]:void 0)}));var arraySlice$2=arraySliceSimple,floor$3=Math.floor,mergeSort=function(e,t){var r=e.length,n=floor$3(r/2);return r<8?insertionSort(e,t):merge(e,mergeSort(arraySlice$2(e,0,n),t),mergeSort(arraySlice$2(e,n),t),t)},insertionSort=function(e,t){for(var r,n,i=e.length,o=1;o<i;){for(n=o,r=e[o];n&&t(e[n-1],r)>0;)e[n]=e[--n];n!==o++&&(e[n]=r)}return e},merge=function(e,t,r,n){for(var i=t.length,o=r.length,a=0,s=0;a<i||s<o;)e[a+s]=a<i&&s<o?n(t[a],r[s])<=0?t[a++]:r[s++]:a<i?t[a++]:r[s++];return e},arraySort$1=mergeSort,userAgent$1=engineUserAgent,firefox=userAgent$1.match(/firefox\/(\d+)/i),engineFfVersion=!!firefox&&+firefox[1],UA=engineUserAgent,engineIsIeOrEdge=/MSIE|Trident/.test(UA),userAgent=engineUserAgent,webkit=userAgent.match(/AppleWebKit\/(\d+)\./),engineWebkitVersion=!!webkit&&+webkit[1],global$9=global$D,uncurryThis$a=functionUncurryThisClause,fails$9=fails$E,aCallable$1=aCallable$a,internalSort$1=arraySort$1,ArrayBufferViewCore$2=arrayBufferViewCore,FF$1=engineFfVersion,IE_OR_EDGE$1=engineIsIeOrEdge,V8$1=engineV8Version,WEBKIT$1=engineWebkitVersion,aTypedArray$2=ArrayBufferViewCore$2.aTypedArray,exportTypedArrayMethod$3=ArrayBufferViewCore$2.exportTypedArrayMethod,Uint16Array=global$9.Uint16Array,nativeSort$1=Uint16Array&&uncurryThis$a(Uint16Array.prototype.sort),ACCEPT_INCORRECT_ARGUMENTS=!(!nativeSort$1||fails$9((function(){nativeSort$1(new Uint16Array(2),null)}))&&fails$9((function(){nativeSort$1(new Uint16Array(2),{})}))),STABLE_SORT$1=!!nativeSort$1&&!fails$9((function(){if(V8$1)return V8$1<74;if(FF$1)return FF$1<67;if(IE_OR_EDGE$1)return!0;if(WEBKIT$1)return WEBKIT$1<602;var e,t,r=new Uint16Array(516),n=Array(516);for(e=0;e<516;e++)t=e%4,r[e]=515-e,n[e]=e-2*t+3;for(nativeSort$1(r,(function(e,t){return(e/4|0)-(t/4|0)})),e=0;e<516;e++)if(r[e]!==n[e])return!0})),getSortCompare$1=function(e){return function(t,r){return void 0!==e?+e(t,r)||0:r!=r?-1:t!=t?1:0===t&&0===r?1/t>0&&1/r<0?1:-1:t>r}};exportTypedArrayMethod$3("sort",(function(e){return void 0!==e&&aCallable$1(e),STABLE_SORT$1?nativeSort$1(this,e):internalSort$1(aTypedArray$2(this),getSortCompare$1(e))}),!STABLE_SORT$1||ACCEPT_INCORRECT_ARGUMENTS);var ArrayBufferViewCore$1=arrayBufferViewCore,toLength=toLength$6,toAbsoluteIndex$2=toAbsoluteIndex$7,typedArraySpeciesConstructor=typedArraySpeciesConstructor$4,aTypedArray$1=ArrayBufferViewCore$1.aTypedArray,exportTypedArrayMethod$2=ArrayBufferViewCore$1.exportTypedArrayMethod;exportTypedArrayMethod$2("subarray",(function(e,t){var r=aTypedArray$1(this),n=r.length,i=toAbsoluteIndex$2(e,n);return new(typedArraySpeciesConstructor(r))(r.buffer,r.byteOffset+i*r.BYTES_PER_ELEMENT,toLength((void 0===t?n:toAbsoluteIndex$2(t,n))-i))}));var global$8=global$D,apply=functionApply,ArrayBufferViewCore=arrayBufferViewCore,fails$8=fails$E,arraySlice$1=arraySlice$7,Int8Array$1=global$8.Int8Array,aTypedArray=ArrayBufferViewCore.aTypedArray,exportTypedArrayMethod$1=ArrayBufferViewCore.exportTypedArrayMethod,$toLocaleString=[].toLocaleString,TO_LOCALE_STRING_BUG=!!Int8Array$1&&fails$8((function(){$toLocaleString.call(new Int8Array$1(1))})),FORCED$3=fails$8((function(){return[1,2].toLocaleString()!=new Int8Array$1([1,2]).toLocaleString()}))||!fails$8((function(){Int8Array$1.prototype.toLocaleString.call([1,2])}));exportTypedArrayMethod$1("toLocaleString",(function(){return apply($toLocaleString,TO_LOCALE_STRING_BUG?arraySlice$1(aTypedArray(this)):aTypedArray(this),arraySlice$1(arguments))}),FORCED$3);var exportTypedArrayMethod=arrayBufferViewCore.exportTypedArrayMethod,fails$7=fails$E,global$7=global$D,uncurryThis$9=functionUncurryThis,Uint8Array$1=global$7.Uint8Array,Uint8ArrayPrototype=Uint8Array$1&&Uint8Array$1.prototype||{},arrayToString=[].toString,join$3=uncurryThis$9([].join);fails$7((function(){arrayToString.call({})}))&&(arrayToString=function(){return join$3(this)});var IS_NOT_ARRAY_METHOD=Uint8ArrayPrototype.toString!=arrayToString;exportTypedArrayMethod("toString",arrayToString,IS_NOT_ARRAY_METHOD);var DevLogger=function(){function e(){var t=this;_classCallCheck$2(this,e);try{var r=/xgd=(\d)/.exec(document.cookie);this._status=!!r,this._level=r&&r[1]}catch(e){this._status=!1}["group","groupEnd","log","warn","error"].forEach((function(e){t[e]=function(r,n,i,o,a,s,c,u,l,A){var d;if(t._status){var h=r,f=[n,i,o,a,s,c,u,l,A].filter((function(e){return void 0!==e}));(d=console)[e].apply(d,["["+h+"]:"].concat(_toConsumableArray$1(f)))}}}))}return _createClass$2(e,[{key:"enable",get:function(){return this._status}},{key:"long",get:function(){return"2"===this._level}}]),e}(),logger=new DevLogger;function debounce(e,t){var r=Date.now(),n=null,i=!0;return function(){for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];var c=Date.now();i&&(r=Date.now(),i=!1,e.apply(void 0,a)),c-r>t?(r=c,e.apply(void 0,a)):(n&&window.clearTimeout(n),n=setTimeout((function(){e.apply(void 0,a)}),t))}}function getAvcc(e,t){if(e&&t){var r=new Uint8Array(e.byteLength+t.byteLength+11);r[0]=1,r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=255,r[5]=225;var n=6;return r.set(new Uint8Array([e.byteLength>>>8&255,255&e.byteLength]),n),n+=2,r.set(e,n),r[n+=e.byteLength]=1,n++,r.set(new Uint8Array([t.byteLength>>>8&255,255&t.byteLength]),n),n+=2,r.set(t,n),r}}function promiseDelayed(){var e,t,r=new Promise((function(r,n){e=r,t=n}));return r.resolve=e,r.reject=t,r}var DESCRIPTORS$6=descriptors,uncurryThis$8=functionUncurryThis,call$3=functionCall,fails$6=fails$E,objectKeys$1=objectKeys$3,getOwnPropertySymbolsModule=objectGetOwnPropertySymbols,propertyIsEnumerableModule=objectPropertyIsEnumerable,toObject$4=toObject$f,IndexedObject$1=indexedObject,$assign=Object.assign,defineProperty$2=Object.defineProperty,concat2=uncurryThis$8([].concat),objectAssign=!$assign||fails$6((function(){if(DESCRIPTORS$6&&1!==$assign({b:1},$assign(defineProperty$2({},"a",{enumerable:!0,get:function(){defineProperty$2(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach((function(e){t[e]=e})),7!=$assign({},e)[r]||objectKeys$1($assign({},t)).join("")!=n}))?function(e,t){for(var r=toObject$4(e),n=arguments.length,i=1,o=getOwnPropertySymbolsModule.f,a=propertyIsEnumerableModule.f;n>i;)for(var s,c=IndexedObject$1(arguments[i++]),u=o?concat2(objectKeys$1(c),o(c)):objectKeys$1(c),l=u.length,A=0;l>A;)s=u[A++],DESCRIPTORS$6&&!call$3(a,c,s)||(r[s]=c[s]);return r}:$assign,$$d=_export,assign$1=objectAssign;$$d({target:"Object",stat:!0,arity:2,forced:Object.assign!==assign$1},{assign:assign$1});var EleName="xg-video",simdCanused=!1;try{simdCanused=WebAssembly&&WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]))}catch(e){}var decodeCapacity={preloadDecoder:!1,reuseWasmDecoder:!0,reuseMseForAudio:!1,preciseSeek:0,h264WithWebcodec:!0,lowDecodeThreshold:100,wasmFallbackToAsm:!1,audioWithMse:!0,canUseThreadMode:!1,disabledWhenErrorOccur:!0,disabledDuration:43200,evaluateVVCount:0,disabledByLowdecodePrecent:.5,maxDecodeOnceWasm:simdCanused?6:8,maxDecodeOnceFirstTime:8,maxDecodeOnceWebcodec:20};function getEleName(){return EleName}function setEleName(e){EleName=e}function setDecodeCapacity(e){decodeCapacity=Object.assign({},decodeCapacity,e)}function getDecodeCapacaity(){return decodeCapacity}function getDecoderUrls(){var e="undefined"!=typeof customElements&&customElements.get(EleName);return e?{H264_DECODER_URL:e.h264Url,ASM_H264_DECODER_URL:e.h264AsmUrl,H265_DECODER_URL:e.h265Url,H265_THREAD_DECODER_URL:e.h265ThreadUrl,H265_SIMD_DECODER_URL:e.h265SimdUrl,ASM_H265_DECODER_URL:e.h265AsmUrl}:{}}function simdSupported(){if("undefined"==typeof customElements)return!1;var e=customElements.get(EleName);return simdCanused&&!(null==e||!e.h265SimdUrl)}function threadSupported(){if("undefined"==typeof customElements)return!1;var e=customElements.get(EleName);return!!window.SharedArrayBuffer&&!(null==e||!e.h265ThreadUrl)}var _softDecodeSupport=!1;try{var _localStorage,_localStorage$getItem;_softDecodeSupport="1"===(null===(_localStorage=localStorage)||void 0===_localStorage||null===(_localStorage$getItem=_localStorage.getItem)||void 0===_localStorage$getItem?void 0:_localStorage$getItem.call(_localStorage,"_sds"))}catch(e){}function softDecodeSupported(){if("undefined"==typeof customElements)return!1;if(_softDecodeSupport)return!0;var e=!1,t=!1;try{var r=new(window.AudioContext||window.webkitAudioContext);r.close(),r=null,e=!0}catch(e){}try{for(var n=document.createElement("canvas"),i=["webgl","experimental-webgl","moz-webgl","webkit-3d"],o=0;o<i.length;o++){var a=n.getContext(i[o]);if(a){a=null,n=null,t=!0;break}}_softDecodeSupport=e&&t&&!!WebAssembly,localStorage.setItem("_sds",_softDecodeSupport?1:0)}catch(e){}return _softDecodeSupport}function getDeviceCapacity(){return{simd:simdCanused,thread:threadSupported(),nbCpu:navigator.hardwareConcurrency}}var vv=0,lowdecodeVV=0,lowdecodePercent=0,disabledHevc=!1;function updateVV(){vv++}function getVV(){return vv}function updateLowdecodeVV(){lowdecodeVV++}function getLowdecodeVV(){return lowdecodeVV}function getLowdecodePercent(){return lowdecodePercent}function _getDisabledByEvaluateVV(){return!!disabledHevc||0!==getDecodeCapacaity().evaluateVVCount&&(vv===getDecodeCapacaity().evaluateVVCount&&(lowdecodePercent=lowdecodeVV/vv),lowdecodePercent>=getDecodeCapacaity().disabledByLowdecodePrecent&&(disabledHevc=!0),disabledHevc)}function persistenceDisabledStatus(e){localStorage.setItem("xgv_dis",e),2===e&&localStorage.setItem("xgv_dist",(new Date).getTime())}function getDisabledStatus(){if(!0===_getDisabledByEvaluateVV())return!0;var e=localStorage.getItem("xgv_dis");if(!e)return!1;if("1"===e)return!0;if("2"===e){var t=localStorage.getItem("xgv_dist")||0;if(t=Number(t),((new Date).getTime()-t)/1e3<getDecodeCapacaity().disabledDuration)return!0;cleanDisabledStatus()}}function cleanDisabledStatus(){localStorage.removeItem("xgv_dist"),localStorage.removeItem("xgv_dis")}var eventemitter3={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}function i(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function o(e,t,n,o,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new i(n,o||e,a),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function s(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),s.prototype.eventNames=function(){var e,n,i=[];if(0===this._eventsCount)return i;for(n in e=this._events)t.call(e,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},s.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,a=new Array(o);i<o;i++)a[i]=n[i].fn;return a},s.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},s.prototype.emit=function(e,t,n,i,o,a){var s=r?r+e:e;if(!this._events[s])return!1;var c,u,l=this._events[s],A=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),A){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,n),!0;case 4:return l.fn.call(l.context,t,n,i),!0;case 5:return l.fn.call(l.context,t,n,i,o),!0;case 6:return l.fn.call(l.context,t,n,i,o,a),!0}for(u=1,c=new Array(A-1);u<A;u++)c[u-1]=arguments[u];l.fn.apply(l.context,c)}else{var d,h=l.length;for(u=0;u<h;u++)switch(l[u].once&&this.removeListener(e,l[u].fn,void 0,!0),A){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,t);break;case 3:l[u].fn.call(l[u].context,t,n);break;case 4:l[u].fn.call(l[u].context,t,n,i);break;default:if(!c)for(d=1,c=new Array(A-1);d<A;d++)c[d-1]=arguments[d];l[u].fn.apply(l[u].context,c)}}return!0},s.prototype.on=function(e,t,r){return o(this,e,t,r,!1)},s.prototype.once=function(e,t,r){return o(this,e,t,r,!0)},s.prototype.removeListener=function(e,t,n,i){var o=r?r+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||i&&!s.once||n&&s.context!==n||a(this,o);else{for(var c=0,u=[],l=s.length;c<l;c++)(s[c].fn!==t||i&&!s[c].once||n&&s[c].context!==n)&&u.push(s[c]);u.length?this._events[o]=1===u.length?u[0]:u:a(this,o)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&a(this,t)):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=r,s.EventEmitter=s,e.exports=s}(eventemitter3);var eventemitter3Exports=eventemitter3.exports,EventEmitter=getDefaultExportFromCjs(eventemitter3Exports),global$6=global$D,globalIsFinite=global$6.isFinite,numberIsFinite$1=Number.isFinite||function(e){return"number"==typeof e&&globalIsFinite(e)},$$c=_export,numberIsFinite=numberIsFinite$1;$$c({target:"Number",stat:!0},{isFinite:numberIsFinite});var $$b=_export,isArray$1=isArray$4,isConstructor$1=isConstructor$4,isObject$1=isObject$g,toAbsoluteIndex$1=toAbsoluteIndex$7,lengthOfArrayLike$3=lengthOfArrayLike$i,toIndexedObject$2=toIndexedObject$b,createProperty$2=createProperty$5,wellKnownSymbol$3=wellKnownSymbol$o,arrayMethodHasSpeciesSupport$1=arrayMethodHasSpeciesSupport$5,nativeSlice=arraySlice$7,HAS_SPECIES_SUPPORT$1=arrayMethodHasSpeciesSupport$1("slice"),SPECIES=wellKnownSymbol$3("species"),$Array$1=Array,max$1=Math.max;$$b({target:"Array",proto:!0,forced:!HAS_SPECIES_SUPPORT$1},{slice:function(e,t){var r,n,i,o=toIndexedObject$2(this),a=lengthOfArrayLike$3(o),s=toAbsoluteIndex$1(e,a),c=toAbsoluteIndex$1(void 0===t?a:t,a);if(isArray$1(o)&&(r=o.constructor,(isConstructor$1(r)&&(r===$Array$1||isArray$1(r.prototype))||isObject$1(r)&&null===(r=r[SPECIES]))&&(r=void 0),r===$Array$1||void 0===r))return nativeSlice(o,s,c);for(n=new(void 0===r?$Array$1:r)(max$1(c-s,0)),i=0;s<c;s++,i++)s in o&&createProperty$2(n,i,o[s]);return n.length=i,n}});var VIDEO_EVENTS={WAITING:0,CANPLAY:1,PLAY:2,PLAYING:3,PAUSE:4,SEEKING:5,SEEKED:6,LOADEDDATA:7,LOADEDMETADATA:8,TIMEUPDATE:9,DURATION_CHANGE:10,VOLUME_CHANGE:11,PROGRESS:12,ERROR:13,ENDED:14,RESIZE:15,LOADSTART:16,DECODE_FPS:17,LOW_DECODE:18,LARGE_AV_GAP:19,FIRST_FRAME:20},VIDEO_EVENTS_ARR=["waiting","canplay","play","playing","pause","seeking","seeked","loadeddata","loadedmetadata","timeupdate","durationchange","volumechange","progress","error","ended","resize","loadstart","decodefps","lowdecode","largeavgap","firstframe"],Events={AUDIO:{AUDIO_READY:"audio_ready",AUDIO_NOT_ALLOWED_AUTOPLAY:"audio_not_allowed_autoplay",AUDIO_WAITING:"audio_waiting",AUDIO_SYNC_DTS:"audio_sync_dts"},VIDEO:{VIDEO_DECODER_INIT:"video_decode_init",VIDEO_READY:"video_ready",VIDEO_WAITING:"video_waiting",AUTO_RUN:"auto_run",DECODE_LOW_FPS:"decode_low_fps",UPDATE_VIDEO_FILLTYPE:"update_video_filltype",UPDATE_VIDEO_COVER_POSITION:"update_video_cover_position"},TIMELINE:{PLAY_EVENT:"play_event",SET_METADATA:"set_metadata",APPEND_CHUNKS:"append_chunks",START_RENDER:"start_render",DO_PLAY:"do_play",DO_PAUSE:"do_pause",DO_SEEK:"do_seek",SET_PLAYBACKRATE:"set_playbackrate",SYNC_DTS:"sync_dts",RESET_BASE_DTS:"reset_base_dts",UPDATE_VOLUME:"update_volume",SINGLE_TRACK:"single_track",DESTROY:"destroy",READY:"ready",UPDATE_GL_OPTIONS:"update_gl_options",SET_VIDEO_DURATION:"set_video_duration",SET_PLAY_MODE:"set_play_mode",UPDATE_CAPABILITY_LEVEL:"update_capability_level",INNER_DEGRADE:"inner_degrade",ADJUST_SEEK_TIME:"adjust_seek_time",CHASE_FRAME:"chase_frame",END_OF_STREAM:"end_of_stream",UPDATE_SEGMENT_END:"update_segment_end"},VIDEO_EVENTS:VIDEO_EVENTS,DECODE_EVENTS:{INIT:"init",READY:"decoderready",REMUX:"remux",INIT_FAILED:"initfailed",DATAREADY:"dataReady",PLAY_FAILED:"playfailed",FRAGMENT_END:"fragmentEnd",APPEND_VIDEO:"appendVideo",FIRST_FRAME:"firstFrame",DECODED:"decoded",RENDE_END:"rendeEnd",CHASE_VIDEO_FRAME:"chaseVideoFrame",CHASE_VIDEO_FRAME_END:"chaseVideoFrameEnd",CHASE_AUDIO_FRAME:"chaseAudioFrame",INIT_SEGMENT:"initSegment",MEDIA_SEGMENT:"mediaSegment",FRAME_MAX_COUNY:"frameMaxCount",FRAME_MIN_COUNY:"frameMinCount"}},BaseRender=function(e){_inherits$1(r,EventEmitter);var t=_createSuper$1(r);function r(e,n){var i;return _classCallCheck$2(this,r),(i=t.call(this))._config=e,i._parent=n,i._meta=null,i._ready=!1,i._isLive=!0,i._innerDegrade=!1,i._singleTrack=-1,i}return _createClass$2(r,[{key:"analyse",get:function(){return this._parent.analyse}},{key:"isLive",get:function(){return this._isLive}},{key:"innerDegrade",get:function(){return this._innerDegrade}},{key:"noAudio",get:function(){return 1===this._singleTrack||2===this._singleTrack}},{key:"noVideo",get:function(){return 3===this._singleTrack}},{key:"duration",get:function(){return this._timeRange.duration},set:function(e){this._timeRange&&(this._timeRange.duration=e)}},{key:"_bindEvents",value:function(){var e=this;this._parent.on(Events.TIMELINE.APPEND_CHUNKS,this._appendChunk.bind(this)),this._parent.on(Events.TIMELINE.RESET_BASE_DTS,this._resetDts.bind(this)),this._parent.on(Events.TIMELINE.START_RENDER,this._startRender.bind(this)),this._parent.on(Events.TIMELINE.DO_PLAY,this._doPlay.bind(this)),this._parent.on(Events.TIMELINE.DO_PAUSE,this._doPause.bind(this)),this._parent.on(Events.TIMELINE.DO_SEEK,this._doSeek.bind(this)),this._parent.on(Events.TIMELINE.DESTROY,this._destroy.bind(this)),this._parent.on(Events.TIMELINE.CHASE_FRAME,this._doChaseFrame.bind(this)),this._parent.on(Events.TIMELINE.SINGLE_TRACK,(function(t){e._singleTrack=t})),this._parent.on(Events.TIMELINE.SET_PLAY_MODE,(function(t){e._isLive="LIVE"===t})),this._parent.on(Events.TIMELINE.INNER_DEGRADE,(function(){e._innerDegrade=!0})),this._parent.on(Events.TIMELINE.SET_VIDEO_DURATION,(function(t){e.duration=t}))}}]),r}(),$$a=_export,uncurryThis$7=functionUncurryThis,aCallable=aCallable$a,toObject$3=toObject$f,lengthOfArrayLike$2=lengthOfArrayLike$i,deletePropertyOrThrow$1=deletePropertyOrThrow$3,toString$2=toString$9,fails$5=fails$E,internalSort=arraySort$1,arrayMethodIsStrict$1=arrayMethodIsStrict$4,FF=engineFfVersion,IE_OR_EDGE=engineIsIeOrEdge,V8=engineV8Version,WEBKIT=engineWebkitVersion,test=[],nativeSort=uncurryThis$7(test.sort),push$4=uncurryThis$7(test.push),FAILS_ON_UNDEFINED=fails$5((function(){test.sort(void 0)})),FAILS_ON_NULL=fails$5((function(){test.sort(null)})),STRICT_METHOD$1=arrayMethodIsStrict$1("sort"),STABLE_SORT=!fails$5((function(){if(V8)return V8<70;if(!(FF&&FF>3)){if(IE_OR_EDGE)return!0;if(WEBKIT)return WEBKIT<603;var e,t,r,n,i="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(n=0;n<47;n++)test.push({k:t+n,v:r})}for(test.sort((function(e,t){return t.v-e.v})),n=0;n<test.length;n++)t=test[n].k.charAt(0),i.charAt(i.length-1)!==t&&(i+=t);return"DGBEFHACIJK"!==i}})),FORCED$2=FAILS_ON_UNDEFINED||!FAILS_ON_NULL||!STRICT_METHOD$1||!STABLE_SORT,getSortCompare=function(e){return function(t,r){return void 0===r?-1:void 0===t?1:void 0!==e?+e(t,r)||0:toString$2(t)>toString$2(r)?1:-1}};$$a({target:"Array",proto:!0,forced:FORCED$2},{sort:function(e){void 0!==e&&aCallable(e);var t=toObject$3(this);if(STABLE_SORT)return void 0===e?nativeSort(t):nativeSort(t,e);var r,n,i=[],o=lengthOfArrayLike$2(t);for(n=0;n<o;n++)n in t&&push$4(i,t[n]);for(internalSort(i,getSortCompare(e)),r=lengthOfArrayLike$2(i),n=0;n<r;)t[n]=i[n++];for(;n<o;)deletePropertyOrThrow$1(t,n++);return t}});var TOLERANCE$2=.5,AudioTimeRange=function(){function e(t){_classCallCheck$2(this,e),this.TAG="AudioTimeRange",this._parent=t,this._buffers=[],this._duration=0,this._baseDts=0,this._lastBuffer=null}return _createClass$2(e,[{key:"isLive",get:function(){return this._parent.isLive}},{key:"duration",get:function(){return this._duration},set:function(e){this._duration=e}},{key:"buffered",get:function(){var e=this;if(this.isLive)return{length:this._duration?1:0,start:function(){return 0},end:function(){return e._duration}};var t=this._mergeBufferRanges();return{length:t.length,start:function(e){var r=t[e];return r?r.start:0},end:function(e){var r=t[e];return r?r.end:1/0}}}},{key:"resetDts",value:function(e){this._baseDts=e}},{key:"_transitionSamples",value:function(e){for(var t=e.numberOfChannels,r=e.length,n=512,i=0;i<t;i++){for(var o=e.getChannelData(i),a=0;a<n;a++)o[a]=o[a]*a/n;for(var s=r-n;s<r;s++)o[s]=o[s]*(r-s)/n}}},{key:"append",value:function(e,t,r,n){-1===this._baseDts&&(this._baseDts=r),this._transitionSamples(e);var i=(r-this._baseDts)/1e3,o=i+t,a={start:i,end:o,startDts:r,source:e,duration:t,delay:n};if(logger.log(this.TAG,"add new buffer range, startDts:".concat(r,", [").concat(a.start," , ").concat(a.end,"]")),!this._buffers.filter((function(e){return e.start===i})).length)return this._buffers.push(a),this.isLive&&(this._duration=o),a.start;console.error("音频重复")}},{key:"deletePassed",value:function(e){return this._buffers=this._buffers.filter((function(t){return t.start>=e})),this._buffers[0]}},{key:"canSeek",value:function(e){var t=this._buffers[this._buffers.length-1];return!!t&&!(t.start<e)}},{key:"_mergeBufferRanges",value:function(){var e=this._buffers.slice().sort((function(e,t){return e.start>t.start?1:-1})),t=e.length,r=[];if(!t)return r;for(var n={start:e[0].start,end:e[0].end},i=1;i<t;i++){var o=e[i];Math.abs(n.end-o.start)<TOLERANCE$2?n.end=o.end:(r.push(n),n={start:o.start,end:o.end})}return r.push(n),r}},{key:"getBuffer",value:function(e){if(this.isLive)return this._buffers.shift();var t=this._buffers.filter((function(t){return t.start<e+TOLERANCE$2&&t.end>e+TOLERANCE$2}))[0];return logger.log(this.TAG,"get audio buffer , currentTime:".concat(e," ,buffer:[").concat(t&&t.start," , ").concat(t&&t.end,"]")),0!==e||t?t:this._buffers[0]}},{key:"hasBuffer",value:function(){var e;return!(null===(e=this._buffers)||void 0===e||!e.length)}}]),e}(),Alaw2lpcm=[-5504,-5248,-6016,-5760,-4480,-4224,-4992,-4736,-7552,-7296,-8064,-7808,-6528,-6272,-7040,-6784,-2752,-2624,-3008,-2880,-2240,-2112,-2496,-2368,-3776,-3648,-4032,-3904,-3264,-3136,-3520,-3392,-22016,-20992,-24064,-23040,-17920,-16896,-19968,-18944,-30208,-29184,-32256,-31232,-26112,-25088,-28160,-27136,-11008,-10496,-12032,-11520,-8960,-8448,-9984,-9472,-15104,-14592,-16128,-15616,-13056,-12544,-14080,-13568,-344,-328,-376,-360,-280,-264,-312,-296,-472,-456,-504,-488,-408,-392,-440,-424,-88,-72,-120,-104,-24,-8,-56,-40,-216,-200,-248,-232,-152,-136,-184,-168,-1376,-1312,-1504,-1440,-1120,-1056,-1248,-1184,-1888,-1824,-2016,-1952,-1632,-1568,-1760,-1696,-688,-656,-752,-720,-560,-528,-624,-592,-944,-912,-1008,-976,-816,-784,-880,-848,5504,5248,6016,5760,4480,4224,4992,4736,7552,7296,8064,7808,6528,6272,7040,6784,2752,2624,3008,2880,2240,2112,2496,2368,3776,3648,4032,3904,3264,3136,3520,3392,22016,20992,24064,23040,17920,16896,19968,18944,30208,29184,32256,31232,26112,25088,28160,27136,11008,10496,12032,11520,8960,8448,9984,9472,15104,14592,16128,15616,13056,12544,14080,13568,344,328,376,360,280,264,312,296,472,456,504,488,408,392,440,424,88,72,120,104,24,8,56,40,216,200,248,232,152,136,184,168,1376,1312,1504,1440,1120,1056,1248,1184,1888,1824,2016,1952,1632,1568,1760,1696,688,656,752,720,560,528,624,592,944,912,1008,976,816,784,880,848],Ulaw2lpcm=[-32124,-31100,-30076,-29052,-28028,-27004,-25980,-24956,-23932,-22908,-21884,-20860,-19836,-18812,-17788,-16764,-15996,-15484,-14972,-14460,-13948,-13436,-12924,-12412,-11900,-11388,-10876,-10364,-9852,-9340,-8828,-8316,-7932,-7676,-7420,-7164,-6908,-6652,-6396,-6140,-5884,-5628,-5372,-5116,-4860,-4604,-4348,-4092,-3900,-3772,-3644,-3516,-3388,-3260,-3132,-3004,-2876,-2748,-2620,-2492,-2364,-2236,-2108,-1980,-1884,-1820,-1756,-1692,-1628,-1564,-1500,-1436,-1372,-1308,-1244,-1180,-1116,-1052,-988,-924,-876,-844,-812,-780,-748,-716,-684,-652,-620,-588,-556,-524,-492,-460,-428,-396,-372,-356,-340,-324,-308,-292,-276,-260,-244,-228,-212,-196,-180,-164,-148,-132,-120,-112,-104,-96,-88,-80,-72,-64,-56,-48,-40,-32,-24,-16,-8,0,32124,31100,30076,29052,28028,27004,25980,24956,23932,22908,21884,20860,19836,18812,17788,16764,15996,15484,14972,14460,13948,13436,12924,12412,11900,11388,10876,10364,9852,9340,8828,8316,7932,7676,7420,7164,6908,6652,6396,6140,5884,5628,5372,5116,4860,4604,4348,4092,3900,3772,3644,3516,3388,3260,3132,3004,2876,2748,2620,2492,2364,2236,2108,1980,1884,1820,1756,1692,1628,1564,1500,1436,1372,1308,1244,1180,1116,1052,988,924,876,844,812,780,748,716,684,652,620,588,556,524,492,460,428,396,372,356,340,324,308,292,276,260,244,228,212,196,180,164,148,132,120,112,104,96,88,80,72,64,56,48,40,32,24,16,8,0],silenceFrame=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]);function _doubleCheckSampleRateIndex(e,t){var r=(7&e[0])<<1|e[1]>>>7;return r!==t?r:t}function _constructAdtsHeader(e,t){var r=e.sampleRateIndex,n=e.channelCount;r=_doubleCheckSampleRateIndex(e.config,r);var i=new Uint8Array(7);i[0]=255,i[1]=240,i[1]=1|i[1],i[2]=64,i[2]=i[2]|60&r<<2,i[2]=i[2]|1&n>>2,i[3]=192&n<<6;var o=t.byteLength+7;return i[3]=i[3]|3&o>>11,i[4]=255&o>>3,i[5]=224&o<<5,i[5]=31|i[5],i[6]=252,i}function packageAACToAdts(e,t){var r=new Uint8Array(t.data.byteLength+7),n=_constructAdtsHeader(e,t.data);return r.set(n),r.set(t.data,7),r}function concatAdts(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=0,n=0,i=e.length;n<i;n++)t&&n%t==0||(r+=e[n].byteLength);for(var o=new Uint8Array(r),a=0,s=0,c=e.length;s<c;s++)t&&s%t==0||(o.set(e[s],a),a+=e[s].byteLength);return o}function _decodeAlaw(e){for(var t=new Uint8Array(2*e.length),r=0,n=0;r<e.length;){var i=Alaw2lpcm[e[r]];if(void 0===i)throw new Error("can not decode g711 alaw data!");t[n]=255&i,t[n+1]=i>>8,r+=1,n+=2}return t}function _decodeUlaw(e){for(var t=new Uint8Array(2*e.length),r=0,n=0;r<e.length;){var i=Ulaw2lpcm[e[r]];if(void 0===i)throw new Error("can not decode g711 ulaw data!");t[n]=255&i,t[n+1]=i>>8,r+=1,n+=2}return t}function decodeG711(e,t){if("g7110a"===t)return _decodeAlaw(e);if("g7110m"===t)return _decodeUlaw(e);throw new Error("no supported format=".concat(t," for g711"))}function _getSampleCount(e,t,r){return e/t/r}function _uint16ToFloat32(e){return e>=32768?-(65536-e)/32768:e/32767}function createAudioBufferFromPcm(e,t,r,n,i){for(var o=_getSampleCount(t.byteLength,r,i),a=e.createBuffer(r,o,n),s=new DataView(t),c=0;c<r;c++)for(var u=a.getChannelData(c),l=void 0,A=0;A<o;A++)l=s.getUint16(A*(2*r)+2*c,!0),u[A]=_uint16ToFloat32(l);return{audioBuffer:a,duration:o/n}}function checkRefillFrame(e){var t=e[0].dts,r=e.filter((function(e){return e.dts===t})).length;if(!(r<=1))for(var n=0;n<r;n++)e[n].data=silenceFrame}var AudioHelper={decodeG711:decodeG711,createAudioBufferFromPcm:createAudioBufferFromPcm,packageAACToAdts:packageAACToAdts,concatAdts:concatAdts,checkRefillFrame:checkRefillFrame},MEDIA_ERR_DECODE$1=3,ERROR_MSG={INIT_AUDIO_ERR:"create new AudioContext error",DECODE_ERR:"audio data decode error"},AudioRender=function(e){_inherits$1(i,BaseRender);var t,r,n=_createSuper$1(i);function i(e,t){var r;return _classCallCheck$2(this,i),_defineProperty$2(_assertThisInitialized$1(r=n.call(this,e,t)),"doPause",r._doPause),r.TAG="AudioRender",r._timeRange=new AudioTimeRange(_assertThisInitialized$1(r)),r._lastTimeLineTime=0,r._sampleQueue=[],r._source=null,r._audioCanAutoplay=!0,r._lastBuffer=null,r._inDecoding=!1,r._endOfStream=!1,r._delay=0,r._isSourceBufferEnd=-1,r._onSourceBufferEnded=r._onSourceBufferEnded.bind(_assertThisInitialized$1(r)),r._initAudioCtx(e.volume||.6),r._bindEvents(),r}return _createClass$2(i,[{key:"baseDts",get:function(){return this._timeRange._baseDts}},{key:"currentTime",get:function(){return this._audioCtx?this._lastTimeLineTime+this._audioCtx.currentTime:0}},{key:"preloadTime",get:function(){return this.isLive?1:0}},{key:"timescale",get:function(){return 1e3}},{key:"buffered",get:function(){return this._timeRange.buffered}},{key:"ctxState",get:function(){return this._audioCtx.state}},{key:"audioCanAutoplay",get:function(){return this._audioCanAutoplay}},{key:"resume",value:function(){if(this._audioCtx&&"suspended"===this._audioCtx.state)return this._audioCtx.resume().catch((function(e){}))}},{key:"canSeek",value:function(e){return this._timeRange.canSeek(e)}},{key:"_assembleErr",value:function(e){var t=new Error(e);return t.code=MEDIA_ERR_DECODE$1,t}},{key:"_emitTimelineEvents",value:function(e,t,r){var n,i;null===(n=this._parent)||void 0===n||null===(i=n.emit)||void 0===i||i.call(n,e,t,r)}},{key:"_initAudioCtx",value:function(e){var t=this;logger.log(this.TAG,"init audioCtx");var r=window.AudioContext||window.webkitAudioContext;return this._audioCtx=new r,this._audioCtx?(this._gainNode=this._audioCtx.createGain(),this._gainNode.gain.value=e,this._gainNode.connect(this._audioCtx.destination),this._audioCanAutoplay="running"===this._audioCtx.state,logger.log(this.TAG,"webAudio state:",this._audioCtx.state),initBgSilenceAudio(),this._bindAudioCtxEvent(),this._audioCtx.suspend()):(logger.warn(this.TAG,"create webaudio error!"),void setTimeout((function(){t._emitTimelineEvents(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.ERROR,t._assembleErr(ERROR_MSG.INIT_AUDIO_ERR))})))}},{key:"_bindAudioCtxEvent",value:function(){var e=this;this._onStateChange=function(){e._audioCtx&&"running"===e._audioCtx.state&&e._ready&&e._emitTimelineEvents(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.PLAYING)},this._audioCtx.addEventListener("statechange",this._onStateChange)}},{key:"_bindEvents",value:function(){var e=this;_get(_getPrototypeOf$1(i.prototype),"_bindEvents",this).call(this),this._parent.on(Events.DECODE_EVENTS.CHASE_AUDIO_FRAME,this._doChaseFrame.bind(this)),this._parent.on(Events.TIMELINE.UPDATE_VOLUME,(function(t){e._gainNode&&(e._gainNode.gain.value=Number.isFinite(t)?t:1,e._emitTimelineEvents(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.VOLUME_CHANGE))})),this._parent.on(Events.TIMELINE.END_OF_STREAM,(function(){var t;e._endOfStream=!0,e.noAudio||null!==(t=e._timeRange)&&void 0!==t&&t.hasBuffer()||null==e||e._emitTimelineEvents(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.ENDED)}))}},{key:"_appendChunk",value:function(e,t){if(!this.noAudio){this._meta||(this._meta=t,logger.warn(this.TAG,"audio set metadata",this._meta));var r=t.samples;if(r.length)if(this._sampleQueue=this._sampleQueue.concat(r),t.samples=[],"aac"===this._meta.codecType){if(this._inDecoding)return;this._decodeAACWrapper()}else this._decodeG711()}}},{key:"_resetDts",value:function(e,t){"video"!==t&&this._timeRange.resetDts(e)}},{key:"_doPlay",value:function(){this.noAudio||this._parent.seeking||(this._source||!this.currentTime?this.resume():this._startRender())}},{key:"_doPause",value:function(){this.noAudio||this._audioCtx.suspend()}},{key:"_reInitAudioCtx",value:function(e){var t=this;if(this._lastTimeLineTime=e,this._lastBuffer=null,this._lastAudioBufferInfo=null,this._delay=0,!this._ready||!this._audioCtx.currentTime)return Promise.resolve();var r=this._gainNode.gain.value;return this._audioCtx.close().then((function(){return t._audioCtx.removeEventListener("statechange",t._onStateChange),t._audioCtx=null,t._source&&t._source.removeEventListener("ended",t._onSourceBufferEnded),t._source=null,t._initAudioCtx(r)}))}},{key:"_doSeek",value:function(e){var t=this;this._reInitAudioCtx(e).then((function(){t._getAudioBuffer(!0)})).catch((function(e){}))}},{key:"_doChaseFrame",value:function(e){var t=this,r=e.position,n=this._timeRange.deletePassed(r);n&&(logger.log(this.TAG,"_doChaseFrame","startTime:",n.start,"buffeLength:",this.buffered.end(0)-n.start),this._reInitAudioCtx(n.start).then((function(){t._startRender(),t._emitTimelineEvents(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.TIMEUPDATE)})).catch((function(e){})))}},{key:"_decodeAACWrapper",value:(r=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(){var t,r,n,i,o,a,s,c,u,l;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this._sampleQueue.length,r=this._sampleQueue[0],n=this._sampleQueue[t-1],!((i=(n.dts-r.dts)/this.timescale)<1)){e.next=6;break}return e.abrupt("return");case 6:for(o=parseInt(i/3-1)||1,a=parseInt(t/o),s=[],c=0;c<o;c++)c<o-1?s.push(this._sampleQueue.slice(c*a,(c+1)*a)):s.push(this._sampleQueue.slice(c*a));return this._sampleQueue=[],this._inDecoding=!0,e.prev=12,e.next=15,this._decodeCycle(s);case 15:this._isLive||(u=this._timeRange._buffers,(l=u[u.length-1])&&this._emitTimelineEvents(Events.TIMELINE.UPDATE_SEGMENT_END,l.end)),e.next=21;break;case 18:e.prev=18,e.t0=e.catch(12),this._emitTimelineEvents(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.ERROR,this._assembleErr("ERROR_MSG.DECODE_ERR:".concat(e.t0&&e.t0.message)));case 21:this._inDecoding=!1;case 22:case"end":return e.stop()}}),e,this,[[12,18]])}))),function(){return r.apply(this,arguments)})},{key:"_decodeCycle",value:(t=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(t){var r;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.shift()){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,this._decodeAAC(r);case 5:return e.next=7,this._decodeCycle(t);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"_decodeAAC",value:function(e){var t=this,r=e[0],n=0;AudioHelper.checkRefillFrame(e);var i=e.map((function(e){return AudioHelper.packageAACToAdts(t._meta,e)})),o=AudioHelper.concatAdts(i,0);return new Promise((function(e,i){var a=t._audioCtx.decodeAudioData(o.buffer,(function(i){if(t._timeRange){if(t._lastAudioBufferInfo&&t.isLive){var o=t._lastAudioBufferInfo,a=o.dts+o.duration;(n=r.dts-a)>1&&(t._timeRange._duration+=n/1e3,logger.log(t.TAG,"_decodeAAC","audio data dts is not continue, last end dts:",a,",now start Dts:",r.dts,"delay:",n))}t._lastAudioBufferInfo={duration:Math.floor(1e3*i.duration),dts:r.dts};var s=t._timeRange.append(i,i.duration,r.dts,n/1e3);if(!t._ready){var c=Math.abs(s+i.duration-t.currentTime)<.5;(t.isLive||!c)&&(t._ready=!0,logger.log(t.TAG,"_decodeAAC","set ready true start=",s),t.emit(Events.AUDIO.AUDIO_READY,s))}t._emitTimelineEvents(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.PROGRESS),t._emitTimelineEvents(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.DURATION_CHANGE),e()}}),i);a.catch&&a.catch(i)}))}},{key:"_decodeG711",value:function(){var e=this._sampleQueue.length,t=this._sampleQueue[0];if(!((this._sampleQueue[e-1].dts-t.dts)/this.timescale<.5)){var r=this._sampleQueue.reduce((function(e,t){return e+=t.data.byteLength}),0),n=new Uint8Array(r),i=0,o=0;this._sampleQueue.forEach((function(e,t){0===t&&(i=e.dts),n.set(e.data,o),o+=e.data.byteLength})),this._sampleQueue=[];try{var a=this._meta,s=a.codecType,c=a.channelCount,u=a.sampleSize,l=a.sampleRate,A=AudioHelper.decodeG711(n,s),d=AudioHelper.createAudioBufferFromPcm(this._audioCtx,A.buffer,c,l,u/8),h=d.audioBuffer,f=d.duration,p=this._timeRange.append(h,f,i,0);this._ready||(this._ready=!0,logger.log(this.TAG,"_decodeG711","set ready true"),this.emit(Events.AUDIO.AUDIO_READY,p)),this._emitTimelineEvents(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.PROGRESS),this._emitTimelineEvents(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.DURATION_CHANGE)}catch(e){this._emitTimelineEvents(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.ERROR,this._assembleErr("ERROR_MSG.DECODE_ERR:".concat(e&&e.message)))}}}},{key:"_onSourceBufferEnded",value:function(){this._isSourceBufferEnd=!0,logger.long&&logger.log(this.TAG,"source play end! currentTime:".concat(this.currentTime," , duration:").concat(this.duration)),this._startRender()}},{key:"_ajustSeekTime",value:function(e){var t=this._timeRange.getBuffer(e,0);t&&(logger.log(this.TAG,"ajust seek time to:",t.start),this._lastTimeLineTime=t.start)}},{key:"_getAudioBuffer",value:function(e){var t=this;if(this._timeRange){var r=this._timeRange.getBuffer(this._lastBuffer?this._lastBuffer.end:this.currentTime,0);return r?e?(this._ajustSeekTime(r.start),void this.emit(Events.AUDIO.AUDIO_READY)):r:(this._endOfStream||!this._isLive)&&this.currentTime-this.duration>-.5?(this._emitTimelineEvents(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.TIMEUPDATE),void this._emitTimelineEvents(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.ENDED)):(this._ready=!1,this._audioCtx.suspend(),this.emit(Events.AUDIO.AUDIO_WAITING),void(e&&(this._onAudioReady||(this._onAudioReady=function(e){t._ajustSeekTime(e)}),this.removeListener(Events.AUDIO.AUDIO_READY,this._onAudioReady),this.once(Events.AUDIO.AUDIO_READY,this._onAudioReady))))}}},{key:"_startRender",value:function(e){if(!this.noAudio){if("video"===e&&this.isLive&&this._ready&&!this._isSourceBufferEnd)return console.log(this.TAG,"_startRender, audio currentTime",this.currentTime,"from:",e,"_isSourceBufferEnd:",this._isSourceBufferEnd,"ready:",this._ready),void this._doPlay();var t=this._getAudioBuffer();if(t){"suspended"===this._audioCtx.state&&(this._audioCtx.resume().catch((function(e){})),playSlienceAudio()),this._lastBuffer=t,this._source=null;var r=this._audioCtx.createBufferSource();r.buffer=t.source,r.loop=!1,this._source=r,r.addEventListener("ended",this._onSourceBufferEnded),r.connect(this._gainNode),t.delay&&t.delay>.001&&(this._delay+=t.delay),this.startDts=t.startDts;try{this._isSourceBufferEnd=!1,r.start()}catch(e){}t.startDts&&this._emitTimelineEvents(Events.TIMELINE.SYNC_DTS,t.startDts)}}}},{key:"_destroy",value:function(){logger.log(this.TAG,"destroy audio..."),this._source&&this._source.removeEventListener("ended",this._onSourceBufferEnded),this._audioCtx&&"closed"!==this.ctxState&&this._audioCtx.close(),this._audioCtx=null,this._sampleQueue=null,this._timeRange=null,this._parent=null,this.removeAllListeners()}}]),i}(),$$9=_export,$findIndex=arrayIteration.findIndex,addToUnscopables$1=addToUnscopables$4,FIND_INDEX="findIndex",SKIPS_HOLES$1=!0;FIND_INDEX in[]&&Array(1)[FIND_INDEX]((function(){SKIPS_HOLES$1=!1})),$$9({target:"Array",proto:!0,forced:SKIPS_HOLES$1},{findIndex:function(e){return $findIndex(this,e,arguments.length>1?arguments[1]:void 0)}}),addToUnscopables$1(FIND_INDEX);var DESCRIPTORS$5=descriptors,isArray2=isArray$4,$TypeError=TypeError,getOwnPropertyDescriptor$1=Object.getOwnPropertyDescriptor,SILENT_ON_NON_WRITABLE_LENGTH_SET=DESCRIPTORS$5&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}(),arraySetLength=SILENT_ON_NON_WRITABLE_LENGTH_SET?function(e,t){if(isArray2(e)&&!getOwnPropertyDescriptor$1(e,"length").writable)throw $TypeError("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t},$$8=_export,toObject$2=toObject$f,toAbsoluteIndex=toAbsoluteIndex$7,toIntegerOrInfinity$2=toIntegerOrInfinity$c,lengthOfArrayLike$1=lengthOfArrayLike$i,setArrayLength=arraySetLength,doesNotExceedSafeInteger=doesNotExceedSafeInteger$2,arraySpeciesCreate=arraySpeciesCreate$3,createProperty$1=createProperty$5,deletePropertyOrThrow=deletePropertyOrThrow$3,arrayMethodHasSpeciesSupport=arrayMethodHasSpeciesSupport$5,HAS_SPECIES_SUPPORT=arrayMethodHasSpeciesSupport("splice"),max=Math.max,min=Math.min;$$8({target:"Array",proto:!0,forced:!HAS_SPECIES_SUPPORT},{splice:function(e,t){var r,n,i,o,a,s,c=toObject$2(this),u=lengthOfArrayLike$1(c),l=toAbsoluteIndex(e,u),A=arguments.length;for(0===A?r=n=0:1===A?(r=0,n=u-l):(r=A-2,n=min(max(toIntegerOrInfinity$2(t),0),u-l)),doesNotExceedSafeInteger(u+r-n),i=arraySpeciesCreate(c,n),o=0;o<n;o++)(a=l+o)in c&&createProperty$1(i,o,c[a]);if(i.length=n,r<n){for(o=l;o<u-n;o++)s=o+r,(a=o+n)in c?c[s]=c[a]:deletePropertyOrThrow(c,s);for(o=u;o>u-n+r;o--)deletePropertyOrThrow(c,o-1)}else if(r>n)for(o=u-n;o>l;o--)s=o+r-1,(a=o+n-1)in c?c[s]=c[a]:deletePropertyOrThrow(c,s);for(o=0;o<r;o++)c[o+l]=arguments[o+2];return setArrayLength(c,u-n+r),i}});var $$7=_export,toObject$1=toObject$f,nativeKeys=objectKeys$3,fails$4=fails$E,FAILS_ON_PRIMITIVES=fails$4((function(){nativeKeys(1)}));$$7({target:"Object",stat:!0,forced:FAILS_ON_PRIMITIVES},{keys:function(e){return nativeKeys(toObject$1(e))}});var charAt$2=stringMultibyte.charAt,toString$1=toString$9,InternalStateModule$2=internalState,defineIterator=iteratorDefine,createIterResultObject=createIterResultObject$2,STRING_ITERATOR="String Iterator",setInternalState$2=InternalStateModule$2.set,getInternalState=InternalStateModule$2.getterFor(STRING_ITERATOR);defineIterator(String,"String",(function(e){setInternalState$2(this,{type:STRING_ITERATOR,string:toString$1(e),index:0})}),(function(){var e,t=getInternalState(this),r=t.string,n=t.index;return n>=r.length?createIterResultObject(void 0,!0):(e=charAt$2(r,n),t.index+=e.length,createIterResultObject(e,!1))}));var global$5=global$D,DOMIterables=domIterables,DOMTokenListPrototype=domTokenListPrototype,ArrayIteratorMethods=es_array_iterator,createNonEnumerableProperty=createNonEnumerableProperty$9,wellKnownSymbol$2=wellKnownSymbol$o,ITERATOR$2=wellKnownSymbol$2("iterator"),TO_STRING_TAG=wellKnownSymbol$2("toStringTag"),ArrayValues=ArrayIteratorMethods.values,handlePrototype=function(e,t){if(e){if(e[ITERATOR$2]!==ArrayValues)try{createNonEnumerableProperty(e,ITERATOR$2,ArrayValues)}catch(t){e[ITERATOR$2]=ArrayValues}if(e[TO_STRING_TAG]||createNonEnumerableProperty(e,TO_STRING_TAG,t),DOMIterables[t])for(var r in ArrayIteratorMethods)if(e[r]!==ArrayIteratorMethods[r])try{createNonEnumerableProperty(e,r,ArrayIteratorMethods[r])}catch(t){e[r]=ArrayIteratorMethods[r]}}};for(var COLLECTION_NAME in DOMIterables)handlePrototype(global$5[COLLECTION_NAME]&&global$5[COLLECTION_NAME].prototype,COLLECTION_NAME);function _classCallCheck$1(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties$1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass$1(e,t,r){return t&&_defineProperties$1(e.prototype,t),r&&_defineProperties$1(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty$1(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}handlePrototype(DOMTokenListPrototype,"DOMTokenList");var TrackType={VIDEO:"video",AUDIO:"audio",METADATA:"metadata"},VideoCodecType={AVC:"avc",HEVC:"hevc"},call$2=functionCall,hasOwn$2=hasOwnProperty_1,isPrototypeOf=objectIsPrototypeOf,regExpFlags$1=regexpFlags$1,RegExpPrototype$2=RegExp.prototype,regexpGetFlags=function(e){var t=e.flags;return void 0!==t||"flags"in RegExpPrototype$2||hasOwn$2(e,"flags")||!isPrototypeOf(RegExpPrototype$2,e)?t:call$2(regExpFlags$1,e)},PROPER_FUNCTION_NAME=functionName.PROPER,defineBuiltIn$2=defineBuiltIn$e,anObject$2=anObject$h,$toString$2=toString$9,fails$3=fails$E,getRegExpFlags=regexpGetFlags,TO_STRING="toString",RegExpPrototype$1=RegExp.prototype,nativeToString=RegExpPrototype$1[TO_STRING],NOT_GENERIC=fails$3((function(){return"/a/b"!=nativeToString.call({source:"a",flags:"b"})})),INCORRECT_NAME=PROPER_FUNCTION_NAME&&nativeToString.name!=TO_STRING;(NOT_GENERIC||INCORRECT_NAME)&&defineBuiltIn$2(RegExp.prototype,TO_STRING,(function(){var e=anObject$2(this);return"/"+$toString$2(e.source)+"/"+$toString$2(getRegExpFlags(e))}),{unsafe:!0});var DESCRIPTORS$4=descriptors,FUNCTION_NAME_EXISTS=functionName.EXISTS,uncurryThis$6=functionUncurryThis,defineProperty$1=objectDefineProperty.f,FunctionPrototype=Function.prototype,functionToString=uncurryThis$6(FunctionPrototype.toString),nameRE=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,regExpExec=uncurryThis$6(nameRE.exec),NAME="name";DESCRIPTORS$4&&!FUNCTION_NAME_EXISTS&&defineProperty$1(FunctionPrototype,NAME,{configurable:!0,get:function(){try{return regExpExec(nameRE,functionToString(this))[1]}catch(e){return""}}});var $$6=_export,uncurryThis$5=functionUncurryThis,IndexedObject=indexedObject,toIndexedObject$1=toIndexedObject$b,arrayMethodIsStrict=arrayMethodIsStrict$4,nativeJoin=uncurryThis$5([].join),ES3_STRINGS=IndexedObject!=Object,STRICT_METHOD=arrayMethodIsStrict("join",",");function concatUint8Array(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];t=t.filter(Boolean);var n=new Uint8Array(t.reduce((function(e,t){return e+t.byteLength}),0)),i=0;return t.forEach((function(e){n.set(e,i),i+=e.byteLength})),n}function parse(e){if(!Array.isArray(e)){for(var t=[],r="",n=0;n<e.length;n++)n%2&&(r=e[n-1]+e[n],t.push(parseInt(r,16)),r="");return t}return e.map((function(e){return parseInt(e,16)}))}$$6({target:"Array",proto:!0,forced:ES3_STRINGS||!STRICT_METHOD},{join:function(e){return nativeJoin(toIndexedObject$1(this),void 0===e?",":e)}});var makeBuiltIn=makeBuiltInExports,defineProperty4=objectDefineProperty,defineBuiltInAccessor$2=function(e,t,r){return r.get&&makeBuiltIn(r.get,t,{getter:!0}),r.set&&makeBuiltIn(r.set,t,{setter:!0}),defineProperty4.f(e,t,r)},global$4=global$D,DESCRIPTORS$3=descriptors,defineBuiltInAccessor$1=defineBuiltInAccessor$2,regExpFlags=regexpFlags$1,fails$2=fails$E,RegExp$2=global$4.RegExp,RegExpPrototype=RegExp$2.prototype,FORCED$1=DESCRIPTORS$3&&fails$2((function(){var e=!0;try{RegExp$2(".","d")}catch(t){e=!1}var t={},r="",n=e?"dgimsy":"gimsy",i=function(e,n){Object.defineProperty(t,e,{get:function(){return r+=n,!0}})},o={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var a in e&&(o.hasIndices="d"),o)i(a,o[a]);return Object.getOwnPropertyDescriptor(RegExpPrototype,"flags").get.call(t)!==n||r!==n}));FORCED$1&&defineBuiltInAccessor$1(RegExpPrototype,"flags",{configurable:!0,get:regExpFlags});var toIntegerOrInfinity$1=toIntegerOrInfinity$c,toString3=toString$9,requireObjectCoercible=requireObjectCoercible$6,$RangeError$2=RangeError,stringRepeat=function(e){var t=toString3(requireObjectCoercible(this)),r="",n=toIntegerOrInfinity$1(e);if(n<0||n==1/0)throw $RangeError$2("Wrong number of repetitions");for(;n>0;(n>>>=1)&&(t+=t))1&n&&(r+=t);return r},$$5=_export,$find=arrayIteration.find,addToUnscopables=addToUnscopables$4,FIND="find",SKIPS_HOLES=!0;FIND in[]&&Array(1)[FIND]((function(){SKIPS_HOLES=!1})),$$5({target:"Array",proto:!0,forced:SKIPS_HOLES},{find:function(e){return $find(this,e,arguments.length>1?arguments[1]:void 0)}}),addToUnscopables(FIND);var anObject$1=anObject$h,iteratorClose=iteratorClose$2,callWithSafeIterationClosing$1=function(e,t,r,n){try{return n?t(anObject$1(r)[0],r[1]):t(r)}catch(t){iteratorClose(e,"throw",t)}},bind$2=functionBindContext,call$1=functionCall,toObject=toObject$f,callWithSafeIterationClosing=callWithSafeIterationClosing$1,isArrayIteratorMethod=isArrayIteratorMethod$3,isConstructor3=isConstructor$4,lengthOfArrayLike=lengthOfArrayLike$i,createProperty=createProperty$5,getIterator$1=getIterator$4,getIteratorMethod$1=getIteratorMethod$5,$Array=Array,arrayFrom$1=function(e){var t=toObject(e),r=isConstructor3(this),n=arguments.length,i=n>1?arguments[1]:void 0,o=void 0!==i;o&&(i=bind$2(i,n>2?arguments[2]:void 0));var a,s,c,u,l,A,d=getIteratorMethod$1(t),h=0;if(!d||this===$Array&&isArrayIteratorMethod(d))for(a=lengthOfArrayLike(t),s=r?new this(a):$Array(a);a>h;h++)A=o?i(t[h],h):t[h],createProperty(s,h,A);else for(l=(u=getIterator$1(t,d)).next,s=r?new this:[];!(c=call$1(l,u)).done;h++)A=o?callWithSafeIterationClosing(u,i,[c.value,h],!0):c.value,createProperty(s,h,A);return s.length=h,s},$$4=_export,global$3=global$D,arrayBufferModule=arrayBuffer,setSpecies=setSpecies$3,ARRAY_BUFFER="ArrayBuffer",ArrayBuffer$1=arrayBufferModule[ARRAY_BUFFER],NativeArrayBuffer=global$3[ARRAY_BUFFER];function Concat(e){for(var t=0,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];n.forEach((function(e){t+=e.length}));var o=new e(t),a=0;return n.forEach((function(e){o.set(e,a),a+=e.length})),o}$$4({global:!0,constructor:!0,forced:NativeArrayBuffer!==ArrayBuffer$1},{ArrayBuffer:ArrayBuffer$1}),setSpecies(ARRAY_BUFFER);var Buffer$1=function(){function e(){_classCallCheck$1(this,e),this.buffer=new Uint8Array(0)}return _createClass$1(e,[{key:"write",value:function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];r.forEach((function(t){t?e.buffer=Concat(Uint8Array,e.buffer,t):window.console.warn(t)}))}}],[{key:"writeUint16",value:function(e){return new Uint8Array([e>>8&255,255&e])}},{key:"writeUint32",value:function(e){return new Uint8Array([e>>24,e>>16&255,e>>8&255,255&e])}}]),e}(),UINT32_MAX=Math.pow(2,32)-1,MP4=function(){function e(){_classCallCheck$1(this,e)}return _createClass$1(e,null,[{key:"box",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var i=8+(r=r.filter(Boolean)).reduce((function(e,t){return e+t.byteLength}),0),o=new Uint8Array(i);o[0]=i>>24&255,o[1]=i>>16&255,o[2]=i>>8&255,o[3]=255&i,o.set(e,4);var a=8;return r.forEach((function(e){o.set(e,a),a+=e.byteLength})),o}},{key:"ftyp",value:function(t){return t.find((function(e){return e.type===TrackType.VIDEO&&e.codecType===VideoCodecType.HEVC}))?e.FTYPHEV1:e.FTYPAVC1}},{key:"initSegment",value:function(t){return concatUint8Array(e.ftyp(t),e.moov(t))}},{key:"pssh",value:function(t){var r=new Uint8Array([1,0,0,0].concat([16,119,239,236,192,178,77,2,172,227,60,30,82,226,251,75],[0,0,0,1],parse(t.kid),[0,0,0,0]));return e.box(e.types.pssh,r)}},{key:"moov",value:function(t){if(t[0].useEME&&(t[0].encv||t[0].enca)){t[0].pssh||(t[0].pssh={kid:t[0].kid});var r=this.pssh(t[0].pssh);return e.box.apply(e,[e.types.moov,e.mvhd(t[0].mvhdDurtion||t[0].duration,t[0].mvhdTimecale||t[0].timescale),e.mvex(t)].concat(_toConsumableArray(t.map((function(t){return e.trak(t)}))),[r]))}return e.box.apply(e,[e.types.moov,e.mvhd(t[0].mvhdDurtion||t[0].duration,t[0].mvhdTimecale||t[0].timescale)].concat(_toConsumableArray(t.map((function(t){return e.trak(t)}))),[e.mvex(t)]))}},{key:"mvhd",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9e4;return e.box(e.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,r>>24&255,r>>16&255,r>>8&255,255&r,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]))}},{key:"trak",value:function(t){return e.box(e.types.trak,e.tkhd(t.id,t.tkhdDuration||0,t.width,t.height),e.mdia(t))}},{key:"tkhd",value:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return e.box(e.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,r>>24&255,r>>16&255,r>>8&255,255&r,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,n>>8&255,255&n,0,0,i>>8&255,255&i,0,0]))}},{key:"mdia",value:function(t){return e.box(e.types.mdia,e.mdhd(t.duration,t.timescale),e.hdlr(t.type),e.minf(t))}},{key:"mdhd",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9e4;return e.box(e.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,r>>24&255,r>>16&255,r>>8&255,255&r,t>>24&255,t>>16&255,t>>8&255,255&t,85,196,0,0]))}},{key:"hdlr",value:function(t){return e.box(e.types.hdlr,e.HDLR_TYPES[t])}},{key:"minf",value:function(t){return e.box(e.types.minf,t.type===TrackType.VIDEO?e.VMHD:e.SMHD,e.DINF,e.stbl(t))}},{key:"stbl",value:function(t){var r=[];return t&&t.ext&&t.ext.stss&&r.push(e.stss(t.ext.stss.entries)),e.box(e.types.stbl,e.stsd(t),e.STTS,r[0],e.STSC,e.STSZ,e.STCO)}},{key:"stsd",value:function(t){var r;return r="audio"===t.type?t.useEME&&t.enca?e.enca(t):e.mp4a(t):t.useEME&&t.encv?e.encv(t):e.avc1hev1(t),e.box(e.types.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),r)}},{key:"enca",value:function(t){var r=t.enca.channelCount,n=t.enca.sampleRate,i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,r,0,16,0,0,0,0,n>>8&255,255&n,0,0]),o=e.esds(t.config),a=e.sinf(t.enca);return e.box(e.types.enca,i,o,a)}},{key:"encv",value:function(t){var r,n,i=t.sps.length>0?t.sps[0]:[],o=t.pps.length>0?t.pps[0]:[],a=t.width,s=t.height,c=t.sarRatio[0],u=t.sarRatio[1],l=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,a>>8&255,255&a,s>>8&255,255&s,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),A=new Uint8Array((r=(n=[1,i[1],i[2],i[3],255,225,i.length>>>8&255,255&i.length]).concat.apply(n,_toConsumableArray(i)).concat([1,o.length>>>8&255,255&o.length])).concat.apply(r,_toConsumableArray(o))),d=new Uint8Array([0,0,88,57,0,15,200,192,0,4,86,72]),h=e.sinf(t.encv),f=new Uint8Array([c>>24,c>>16&255,c>>8&255,255&c,u>>24,u>>16&255,u>>8&255,255&u]);return e.box(e.types.encv,l,e.box(e.types.avcC,A),e.box(e.types.btrt,d),h,e.box(e.types.pasp,f))}},{key:"schi",value:function(t){var r=new Uint8Array([]),n=e.tenc(t);return e.box(e.types.schi,r,n)}},{key:"tenc",value:function(t){var r=new Uint8Array([0,0,0,0,0,0,255&t.default_IsEncrypted,255&t.default_IV_size].concat(parse(t.default_KID)));return e.box(e.types.tenc,r)}},{key:"sinf",value:function(t){var r=new Uint8Array([]),n=new Uint8Array([t.data_format.charCodeAt(0),t.data_format.charCodeAt(1),t.data_format.charCodeAt(2),t.data_format.charCodeAt(3)]),i=new Uint8Array([0,0,0,0,99,101,110,99,0,1,0,0]),o=e.schi(t);return e.box(e.types.sinf,r,e.box(e.types.frma,n),e.box(e.types.schm,i),o)}},{key:"avc1hev1",value:function(t){var r=t.codecType===VideoCodecType.HEVC,n=r?e.types.hvc1:e.types.avc1,i=r?e.hvcC(t):e.avcC(t),o=[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,t.width>>8&255,255&t.width,t.height>>8&255,255&t.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,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,0,0,0,0,0,0,24,17,17]),i];return r?o.push(e.box(e.types.fiel,new Uint8Array([1,0]))):t.sarRatio&&t.sarRatio.length>1&&o.push(e.pasp(t.sarRatio)),e.box.apply(e,[n].concat(o))}},{key:"avcC",value:function(t){var r,n,i,o=[],a=[];return t.sps.forEach((function(e){i=e.byteLength,o.push(i>>>8&255),o.push(255&i),o.push.apply(o,_toConsumableArray(e))})),t.pps.forEach((function(e){i=e.byteLength,a.push(i>>>8&255),a.push(255&i),a.push.apply(a,_toConsumableArray(e))})),e.box(e.types.avcC,new Uint8Array((r=(n=[1,o[3],o[4],o[5],255,224|t.sps.length]).concat.apply(n,o).concat([t.pps.length])).concat.apply(r,a)))}},{key:"hvcC",value:function(t){var r=t.hvcC;if(r instanceof ArrayBuffer||r instanceof Uint8Array)return r;var n,i=t.vps,o=t.sps,a=t.pps;if(r){var s=r.generalProfileCompatibilityFlags,c=r.generalConstraintIndicatorFlags,u=(i.length&&1)+(o.length&&1)+(a.length&&1);n=[1,r.generalProfileSpace<<6|r.generalTierFlag<<5|r.generalProfileIdc,s>>>24,s>>>16,s>>>8,s,c[0],c[1],c[2],c[3],c[4],c[5],r.generalLevelIdc,240,0,252,252|r.chromaFormatIdc,248|r.bitDepthLumaMinus8,248|r.bitDepthChromaMinus8,0,0,r.numTemporalLayers<<3|r.temporalIdNested<<2|3,u];var l=function(e){var t;n.push(e.length>>8,e.length),(t=n).push.apply(t,_toConsumableArray(e))};i.length&&(n.push(160,0,i.length),i.forEach(l)),o.length&&(n.push(161,0,o.length),o.forEach(l)),a.length&&(n.push(162,0,a.length),a.forEach(l))}else n=[1,1,96,0,0,0,144,0,0,0,0,0,93,240,0,252,253,248,248,0,0,15,3,160,0,1,0,24,64,1,12,1,255,255,1,96,0,0,3,0,144,0,0,3,0,0,3,0,93,153,152,9,161,0,1,0,45,66,1,1,1,96,0,0,3,0,144,0,0,3,0,0,3,0,93,160,2,128,128,45,22,89,153,164,147,43,154,128,128,128,130,0,0,3,0,2,0,0,3,0,50,16,162,0,1,0,7,68,1,193,114,180,98,64];return e.box(e.types.hvcC,new Uint8Array(n))}},{key:"pasp",value:function(t){var r=_slicedToArray(t,2),n=r[0],i=r[1];return e.box(e.types.pasp,new Uint8Array([n>>24,n>>16&255,n>>8&255,255&n,i>>24,i>>16&255,i>>8&255,255&i]))}},{key:"mp4a",value:function(t){return e.box(e.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,t.sampleRate>>8&255,255&t.sampleRate,0,0]),t.config.length?e.esds(t.config):void 0)}},{key:"esds",value:function(t){var r=t.length;return e.box(e.types.esds,new Uint8Array([0,0,0,0,3,23+r,0,0,0,4,15+r,64,21,0,6,0,0,0,218,192,0,0,218,192,5].concat([r]).concat(t).concat([6,1,2])))}},{key:"mvex",value:function(t){return e.box.apply(e,[e.types.mvex].concat(_toConsumableArray(t.map((function(t){return e.trex(t.id)})))))}},{key:"trex",value:function(t){return e.box(e.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}},{key:"trex1",value:function(t){return e.box(e.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t,0,0,0,1,0,0,2,0,0,0,0,0,0,1,0,0]))}},{key:"trex2",value:function(t){return e.box(e.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t,0,0,0,1,0,0,4,0,0,0,0,0,2,0,0,0]))}},{key:"moof",value:function(t){return e.box.apply(e,[e.types.moof,e.mfhd(t[0].samples?t[0].samples[0].gopId:0)].concat(_toConsumableArray(t.map((function(t){return e.traf(t)})))))}},{key:"mfhd",value:function(t){return e.box(e.types.mfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))}},{key:"traf",value:function(t){var r=e.tfhd(t.id),n=e.tfdt(t,t.baseMediaDecodeTime),i=0;if(t.isVideo&&t.videoSenc&&t.videoSenc.forEach((function(e){i+=8,e.subsamples&&e.subsamples.length&&(i+=2,i+=6*e.subsamples.length)})),t.videoSencLength=i,t.useEME&&(t.isVideoEncryption||t.isAudioEncryption)){if(t.isVideoEncryption){if(t.isVideo){var o=e.saiz(t),a=e.saio(t),s=e.trun1(t),c=e.senc(t);return e.box(e.types.traf,r,n,o,a,s,c)}if(t.isAudioEncryption){var u=e.sbgp(),l=e.saiz(t),A=e.saio(t),d=e.senc(t),h=e.trun1(t);return e.box(e.types.traf,r,n,u,l,A,d,h)}var f=e.sbgp(),p=e.trun1(t);return e.box(e.types.traf,r,n,f,p)}if(t.isVideo){var y=e.trun1(t);return e.box(e.types.traf,r,n,y)}var _=e.sbgp(),E=e.saiz(t),g=e.saio(t),m=e.senc(t),$=e.trun1(t);return e.box(e.types.traf,r,n,_,E,g,m,$)}var v=e.sdtp(t);return e.box(e.types.traf,r,n,v,e.trun(t.samples,v.byteLength+76))}},{key:"sdtp",value:function(t){var r=new Buffer$1;return t.samples.forEach((function(e){r.write(new Uint8Array(t.isVideo?[e.keyframe?32:16]:[16]))})),e.box(e.types.sdtp,this.extension(0,0),r.buffer)}},{key:"trun1",value:function(t){var r=new Buffer$1,n=Buffer$1.writeUint32(t.samples.length),i=null;if(t.isVideo){var o=t.videoSencLength;i=Buffer$1.writeUint32(16*t.samples.length+o+149),!t.isVideoEncryption&&t.isAudioEncryption&&(i=Buffer$1.writeUint32(16*t.samples.length+92))}else{var a=12*t.samples.length+124;t.isAudioEncryption&&(a=12*t.samples.length+8*t.audioSenc.length+177),i=Buffer$1.writeUint32(a)}return t.samples.forEach((function(e){r.write(Buffer$1.writeUint32(e.duration)),r.write(Buffer$1.writeUint32(e.size)),r.write(Buffer$1.writeUint32(e.keyframe?33554432:65536)),t.isVideo&&r.write(Buffer$1.writeUint32(e.cts?e.cts:0))})),e.box(e.types.trun,this.extension(0,t.flags),n,i,r.buffer)}},{key:"senc",value:function(t){var r=new Buffer$1,n=t.samples.length,i=t.isVideo?16:8,o=t.isVideo?2:0,a=[],s=0;return t.isVideo?(a=t.videoSenc,s=t.videoSencLength):a=t.audioSenc,s=s||i*n,r.write(Buffer$1.writeUint32(16+s),e.types.senc,this.extension(0,o)),r.write(Buffer$1.writeUint32(n)),a.forEach((function(e){for(var t=0;t<e.InitializationVector.length;t++)r.write(new Uint8Array([e.InitializationVector[t]]));e.subsamples&&e.subsamples.length&&(r.write(Buffer$1.writeUint16(e.subsamples.length)),e.subsamples.forEach((function(e){r.write(Buffer$1.writeUint16(e.BytesOfClearData)),r.write(Buffer$1.writeUint32(e.BytesOfProtectedData))})))})),r.buffer}},{key:"saio",value:function(t){var r=12*t.samples.length+141;!t.isVideo&&t.isAudioEncryption&&(r=149);var n=new Uint8Array([1,0,0,0,0,0,0,1,0,0,0,0,r>>24&255,r>>16&255,r>>8&255,255&r]);return e.box(e.types.saio,n)}},{key:"saiz",value:function(t){var r=t.samples.length,n=new Uint8Array([0,0,0,0,16,r>>24&255,r>>16&255,r>>8&255,255&r]);return e.box(e.types.saiz,n)}},{key:"sbgp",value:function(){var t=new Uint8Array([114,111,108,108,0,0,0,1,0,0,1,25,0,0,0,1]);return e.box(e.types.sbgp,this.extension(0,0),t)}},{key:"extension",value:function(e,t){return new Uint8Array([e,t>>16&255,t>>8&255,255&t])}},{key:"tfhd",value:function(t){return e.box(e.types.tfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))}},{key:"tfdt",value:function(t,r){var n=Math.floor(r/(UINT32_MAX+1)),i=Math.floor(r%(UINT32_MAX+1));return t.useEME&&(t.isVideoEncryption||t.isAudioEncryption)?e.box(e.types.tfdt,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,255&i])):e.box(e.types.tfdt,new Uint8Array([1,0,0,0,n>>24,n>>16&255,n>>8&255,255&n,i>>24,i>>16&255,i>>8&255,255&i]))}},{key:"trun",value:function(t,r){var n=t.length,i=12+16*n;r+=8+i;var o=new Uint8Array(i);o.set([0,0,15,1,n>>>24&255,n>>>16&255,n>>>8&255,255&n,r>>>24&255,r>>>16&255,r>>>8&255,255&r],0);for(var a=0;a<n;a++){var s=t[a],c=s.duration,u=s.size,l=s.flag,A=void 0===l?{}:l,d=s.cts,h=void 0===d?0:d;o.set([c>>>24&255,c>>>16&255,c>>>8&255,255&c,u>>>24&255,u>>>16&255,u>>>8&255,255&u,A.isLeading<<2|(null===A.dependsOn||void 0===A.dependsOn?1:A.dependsOn),A.isDependedOn<<6|A.hasRedundancy<<4|A.paddingValue<<1|(null===A.isNonSyncSample||void 0===A.isNonSyncSample?1:A.isNonSyncSample),61440&A.degradationPriority,15&A.degradationPriority,h>>>24&255,h>>>16&255,h>>>8&255,255&h],12+16*a)}return e.box(e.types.trun,o)}},{key:"moovMP4",value:function(t){return e.box.apply(e,[e.types.moov,e.mvhd(t[0].duration,t[0].timescale)].concat(_toConsumableArray(t.map((function(t){return e.trackMP4(t)})))))}},{key:"trackMP4",value:function(t){return e.box(e.types.trak,e.tkhd(t.id,t.duration,t.width,t.height),e.mdiaMP4(t))}},{key:"mdiaMP4",value:function(t){return e.box(e.types.mdia,e.mdhd(t.duration,t.timescale),e.hdlr(t.type),e.minfMP4(t))}},{key:"minfMP4",value:function(t){return e.box(e.types.minf,t.type===TrackType.VIDEO?e.VMHD:e.SMHD,e.DINF,e.stblMP4(t))}},{key:"stblMP4",value:function(t){var r=t.ext,n=[e.stsd(t),e.stts(r.stts),e.stsc(r.stsc),e.stsz(r.stsz),e.stco(r.stco)];return r.stss.length&&n.push(e.stss(r.stss)),r.ctts.length&&n.push(e.ctts(r.ctts)),e.box.apply(e,[e.types.stbl].concat(n))}},{key:"stts",value:function(t){var r=t.length,n=new Uint8Array(8*r),i=0;return t.forEach((function(e){var t=e.value,r=e.count;n.set([r>>24,r>>16&255,r>>8&255,255&r,t>>24,t>>16&255,t>>8&255,255&t],i),i+=8})),e.box(e.types.stts,concatUint8Array(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"stsc",value:function(t){var r=t.length,n=new Uint8Array(12*r),i=0;return t.forEach((function(e){var t=e.firstChunk,r=e.samplesPerChunk,o=e.sampleDescIndex;n.set([t>>24,t>>16&255,t>>8&255,255&t,r>>24,r>>16&255,r>>8&255,255&r,o>>24,o>>16&255,o>>8&255,255&o],i),i+=12})),e.box(e.types.stsc,concatUint8Array(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"stsz",value:function(t){var r=t.length,n=new Uint8Array(4*r),i=0;return t.forEach((function(e){n.set([e>>24,e>>16&255,e>>8&255,255&e],i),i+=4})),e.box(e.types.stsz,concatUint8Array(new Uint8Array([0,0,0,0,0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"stco",value:function(t){var r=t.length,n=new Uint8Array(4*r),i=0;return t.forEach((function(e){n.set([e>>24,e>>16&255,e>>8&255,255&e],i),i+=4})),e.box(e.types.stco,concatUint8Array(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"stss",value:function(t){var r=t.length,n=new Uint8Array(4*r),i=0;return t.forEach((function(e){n.set([e>>24,e>>16&255,e>>8&255,255&e],i),i+=4})),e.box(e.types.stss,concatUint8Array(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"ctts",value:function(t){var r=t.length,n=new Uint8Array(8*r),i=0;return t.forEach((function(e){var t=e.value,r=e.count;n.set([r>>24,r>>16&255,r>>8&255,255&r,t>>24,t>>16&255,t>>8&255,255&t],i),i+=8})),e.box(e.types.ctts,concatUint8Array(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"styp",value:function(){return e.box(e.types.styp,new Uint8Array([109,115,100,104,0,0,0,0,109,115,100,104,109,115,105,120]))}},{key:"sidx",value:function(t){var r=t.timescale,n=t.samples[0].duration,i=n*t.samples.length,o=t.samples[0].sampleOffset*n,a=8;t.samples.forEach((function(e){a+=e.size}));var s=0;if(t.isVideo){var c,u=0;t.videoSenc&&(c=t.videoSenc),t.isVideo&&c.forEach((function(e){u+=8,e.subsamples&&e.subsamples.length&&(u+=2,u+=6*e.subsamples.length)})),t.videoSencLength=u,s=a+141+16*t.samples.length+u,t.useEME&&t.isAudioEncryption&&!t.isVideoEncryption&&(s=a+16*t.samples.length+84)}else s=a+116+12*t.samples.length,t.useEME&&t.isAudioEncryption&&(s=a+169+12*t.samples.length+8*t.audioSenc.length);var l=new Uint8Array([0,0,0,0,0,0,0,255&t.id,r>>24&255,r>>16&255,r>>8&255,255&r,o>>24&255,o>>16&255,o>>8&255,255&o,0,0,0,0,0,0,0,1,0,s>>16&255,s>>8&255,255&s,i>>24&255,i>>16&255,i>>8&255,255&i,144,0,0,0]);return e.box(e.types.sidx,l)}},{key:"mdat",value:function(t){return e.box(e.types.mdat,t)}}]),e}();_defineProperty$1(MP4,"types",["avc1","avcC","hvc1","hvcC","dinf","dref","esds","ftyp","hdlr","mdat","mdhd","mdia","mfhd","minf","moof","moov","mp4a","mvex","mvhd","pasp","stbl","stco","stsc","stsd","stsz","stts","tfdt","tfhd","traf","trak","trex","tkhd","vmhd","smhd","ctts","stss","styp","pssh","sidx","sbgp","saiz","saio","senc","trun","encv","enca","sinf","btrt","frma","tenc","schm","schi","mehd","fiel","sdtp"].reduce((function(e,t){return e[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)],e}),Object.create(null))),_defineProperty$1(MP4,"HDLR_TYPES",{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]),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])}),_defineProperty$1(MP4,"FTYPAVC1",MP4.box(MP4.types.ftyp,new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]))),_defineProperty$1(MP4,"FTYPHEV1",MP4.box(MP4.types.ftyp,new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,104,101,118,49]))),_defineProperty$1(MP4,"DINF",MP4.box(MP4.types.dinf,MP4.box(MP4.types.dref,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1])))),_defineProperty$1(MP4,"VMHD",MP4.box(MP4.types.vmhd,new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]))),_defineProperty$1(MP4,"SMHD",MP4.box(MP4.types.smhd,new Uint8Array([0,0,0,0,0,0,0,0]))),_defineProperty$1(MP4,"StblTable",new Uint8Array([0,0,0,0,0,0,0,0])),_defineProperty$1(MP4,"STTS",MP4.box(MP4.types.stts,MP4.StblTable)),_defineProperty$1(MP4,"STSC",MP4.box(MP4.types.stsc,MP4.StblTable)),_defineProperty$1(MP4,"STSZ",MP4.box(MP4.types.stsz,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]))),_defineProperty$1(MP4,"STCO",MP4.box(MP4.types.stco,MP4.StblTable));var Logger$1=function(){function e(t,r){_classCallCheck$1(this,e),this.name=t||"",this._prefix="[".concat(this.name,"]"),e.disabled=r}return _createClass$1(e,[{key:"debug",value:function(){var t;if(!e.disabled){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];(t=console).debug.apply(t,[this._prefix].concat(n))}}},{key:"log",value:function(){var t;if(!e.disabled){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];(t=console).log.apply(t,[this._prefix].concat(n))}}},{key:"warn",value:function(){var t;if(!e.disabled){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];(t=console).warn.apply(t,[this._prefix].concat(n))}}},{key:"error",value:function(){var t;if(!e.disabled){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];(t=console).error.apply(t,[this._prefix].concat(n))}}},{key:"table",value:function(){var t;e.disabled||(console.group(this._prefix),(t=console).table.apply(t,arguments),console.groupEnd())}}],[{key:"enable",value:function(){e.disabled=!1}},{key:"disable",value:function(){e.disabled=!0}}]),e}();_defineProperty$1(Logger$1,"disabled",!0);var FMP4Remuxer=function(){function e(t,r,n){_classCallCheck$1(this,e),this.videoTrack=t,this.audioTrack=r;var i=/Chrome\/([^.]+)/.exec(navigator.userAgent);this.forceFirstIDR=i&&Number(i[1])<50,this.log=new Logger$1("FMP4Remuxer",!n||!n.openLog||!n.openLog)}return _createClass$1(e,[{key:"remux",value:function(){var e,t,r,n,i,o=arguments.length>0&&void 0!==arguments[0]&&arguments[0],a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=this.videoTrack,c=this.audioTrack,u=s.exist(),l=c.exist(),A=[];return o&&(a&&a.initMerge?(u&&A.push(this.videoTrack),l&&A.push(this.audioTrack),r=MP4.initSegment(A)):(u&&(e=MP4.initSegment([this.videoTrack])),l&&(t=MP4.initSegment([this.audioTrack])))),u&&s.hasSample()&&(n=this._remuxVideo()),l&&c.hasSample()&&(i=this._remuxAudio()),s.samples=[],c.samples=[],{initSegment:r,videoInitSegment:e,audioInitSegment:t,videoSegment:n,audioSegment:i}}},{key:"_remuxVideo",value:function(){var e=this.videoTrack;this.forceFirstIDR&&(e.samples[0].flag={dependsOn:2,isNonSyncSample:0});var t=e.samples,r=0;t.forEach((function(e){r+=e.units.reduce((function(e,t){return e+t.byteLength}),0),r+=4*e.units.length}));for(var n,i=new Uint8Array(r),o=new DataView(i.buffer),a=function(e,r,a,s){s=t[e];var c=0;s.units.forEach((function(e){o.setUint32(a,e.byteLength),a+=4,i.set(e,a),a+=e.byteLength,c+=4+e.byteLength})),s.size=c,u=a,n=s},s=0,c=t.length,u=0;s<c;s++)a(s,0,u,n);var l=MP4.mdat(i);return concatUint8Array(MP4.moof([e]),l)}},{key:"_remuxAudio",value:function(){var e=this.audioTrack,t=new Uint8Array(e.samples.reduce((function(e,t){return e+t.size}),0));e.samples.reduce((function(e,r){return t.set(r.data,e),e+r.size}),0);var r=MP4.mdat(t);return concatUint8Array(MP4.moof([e]),r)}},{key:"reset",value:function(){this.videoTrack.reset(),this.audioTrack.reset()}}]),e}(),MP4Remuxer=function(){function e(t,r){_classCallCheck$1(this,e),this.videoTrack=t,this.audioTrack=r}return _createClass$1(e,[{key:"remux",value:function(e,t){this.videoTrack=e||this.videoTrack,this.audioTrack=t||this.audioTrack;var r,n,i=(null==e?void 0:e.exist())&&(null==e?void 0:e.hasSample()),o=(null==t?void 0:t.exist())&&(null==t?void 0:t.hasSample());return i&&o?r=this._remuxMix(e,t):i?r=this._remuxTrack(e):o&&(n=this._remuxTrack(t)),e&&(e.samples=[]),t&&(t.samples=[]),{videoSegment:r,audioSegment:n}}},{key:"_remuxMix",value:function(e,t){var r=MP4.ftyp([e,t]),n=this._remuxData(e,r.byteLength+8),i=n.mdatData,o=n.chunkOffset,a=this._remuxData(t,o).mdatData,s=MP4.mdat(concatUint8Array(i,a)),c=MP4.moovMP4([e,t]);return e.ext=void 0,t.ext=void 0,e.samples=[],t.samples=[],concatUint8Array(r,s,c)}},{key:"_remuxTrack",value:function(e){var t=MP4.ftyp([e]),r=this._remuxData(e,t.byteLength+8).mdatData,n=MP4.mdat(r),i=MP4.moovMP4([e]);return e.ext=void 0,e.samples=[],concatUint8Array(t,n,i)}},{key:"_remuxData",value:function(e,t){var r=e.type===TrackType.VIDEO,n=e.samples,i=0;r?n.forEach((function(e){i+=e.units.reduce((function(e,t){return e+t.byteLength}),0),i+=4*e.units.length})):i=n.reduce((function(e,t){return e+t.size}),0);for(var o,a=new Uint8Array(i),s=new DataView(a.buffer),c=e.ext={stts:[],stsc:[],stsz:[],stco:[],stss:[],ctts:[]},u=0,l=0,A=n.length,d=0;d<A;d++){l+=(o=n[d]).duration;var h=r?0:o.size;r?o.units.forEach((function(e){s.setUint32(u,e.byteLength),u+=4,a.set(e,u),u+=e.byteLength,h+=4+e.byteLength})):(a.set(o.data,u),u+=h),o.size=h,c.stsz.push(h),r&&this._fillCttsSamples(c.ctts,o.cts),this._fillSttsSamples(c.stts,o,n[d+1]),this._fillStcoSamples(c.stco,d,1,t),t+=h,r&&o.keyframe&&c.stss.push(d+1)}return e.duration=l,this._fillStscSamples(c.stsc,A,1),{mdatData:a,chunkOffset:t}}},{key:"_fillSttsSamples",value:function(e,t,r){var n=e[e.length-1];r?n&&n.value===t.duration?n.count++:e.push({value:t.duration,count:1}):n?n.count++:e.push({value:40,count:1})}},{key:"_fillCttsSamples",value:function(e,t){var r=e[e.length-1];r&&r.value===t?r.count++:e.push({value:t,count:1})}},{key:"_fillStcoSamples",value:function(e,t,r,n){t%r||e.push(n)}},{key:"_fillStscSamples",value:function(e,t,r){if(t<=r)e.push({firstChunk:1,samplesPerChunk:t,sampleDescIndex:1});else{var n=Math.floor(t/r),i=t%r;e.push({firstChunk:1,samplesPerChunk:r,sampleDescIndex:1}),i&&e.push({firstChunk:n+1,samplesPerChunk:i,sampleDescIndex:1})}}}]),e}();function _regeneratorRuntime(){_regeneratorRuntime=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function u(e,t,r,i){var o=t&&t.prototype instanceof d?t:d,a=Object.create(o.prototype),s=new I(i||[]);return n(a,"_invoke",{value:$(e,r,s)}),a}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var A={};function d(){}function h(){}function f(){}var p={};c(p,o,(function(){return this}));var y=Object.getPrototypeOf,_=y&&y(y(S([])));_&&_!==t&&r.call(_,o)&&(p=_);var E=f.prototype=d.prototype=Object.create(p);function g(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function m(e,t){function i(n,o,a,s){var c=l(e[n],e,o);if("throw"!==c.type){var u=c.arg,A=u.value;return A&&"object"==typeof A&&r.call(A,"__await")?t.resolve(A.__await).then((function(e){i("next",e,a,s)}),(function(e){i("throw",e,a,s)})):t.resolve(A).then((function(e){u.value=e,a(u)}),(function(e){return i("throw",e,a,s)}))}s(c.arg)}var o;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){i(e,r,t,n)}))}return o=o?o.then(n,n):n()}})}function $(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return{value:void 0,done:!0}}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=v(a,r);if(s){if(s===A)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=l(e,t,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===A)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function v(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,v(e,t),"throw"===t.method))return A;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return A}var n=l(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,A;var i=n.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,A):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,A)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function b(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:R}}function R(){return{value:void 0,done:!0}}return h.prototype=f,n(E,"constructor",{value:f,configurable:!0}),n(f,"constructor",{value:h,configurable:!0}),h.displayName=c(f,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,c(e,s,"GeneratorFunction")),e.prototype=Object.create(E),e},e.awrap=function(e){return{__await:e}},g(m.prototype),c(m.prototype,a,(function(){return this})),e.AsyncIterator=m,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new m(u(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},g(E),c(E,s,"Generator"),c(E,o,(function(){return this})),c(E,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(b),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,A):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),A},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),b(r),A}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;b(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),A}},e}function asyncGeneratorStep(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,i)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){asyncGeneratorStep(o,n,i,a,s,"next",e)}function s(e){asyncGeneratorStep(o,n,i,a,s,"throw",e)}a(void 0)}))}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _construct(e,t,r){return(_construct=_isNativeReflectConstruct()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&_setPrototypeOf(i,r.prototype),i}).apply(null,arguments)}function _isNativeFunction(e){return-1!==Function.toString.call(e).indexOf("[native code]")}function _wrapNativeSuper(e){var t="function"==typeof Map?new Map:void 0;return _wrapNativeSuper=function(e){if(null===e||!_isNativeFunction(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return _construct(e,arguments,_getPrototypeOf(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(r,e)},_wrapNativeSuper(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _possibleConstructorReturn(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var r,n=_getPrototypeOf(e);if(t){var i=_getPrototypeOf(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return _possibleConstructorReturn(this,r)}}var fails$1=fails$E,wellKnownSymbol$1=wellKnownSymbol$o,IS_PURE=isPure,ITERATOR$1=wellKnownSymbol$1("iterator"),urlConstructorDetection=!fails$1((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,r="";return e.pathname="c%20d",t.forEach((function(e,n){t.delete("b"),r+=n+e})),IS_PURE&&!e.toJSON||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[ITERATOR$1]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==r||"x"!==new URL("http://x",void 0).host})),uncurryThis$4=functionUncurryThis,maxInt=2147483647,base=36,tMin=1,tMax=26,skew=38,damp=700,initialBias=72,initialN=128,delimiter="-",regexNonASCII=/[^\0-\u007E]/,regexSeparators=/[.\u3002\uFF0E\uFF61]/g,OVERFLOW_ERROR="Overflow: input needs wider integers to process",baseMinusTMin=base-tMin,$RangeError$1=RangeError,exec$1=uncurryThis$4(regexSeparators.exec),floor$2=Math.floor,fromCharCode=String.fromCharCode,charCodeAt=uncurryThis$4("".charCodeAt),join$2=uncurryThis$4([].join),push$3=uncurryThis$4([].push),replace$2=uncurryThis$4("".replace),split$2=uncurryThis$4("".split),toLowerCase$1=uncurryThis$4("".toLowerCase),ucs2decode=function(e){for(var t=[],r=0,n=e.length;r<n;){var i=charCodeAt(e,r++);if(i>=55296&&i<=56319&&r<n){var o=charCodeAt(e,r++);56320==(64512&o)?push$3(t,((1023&i)<<10)+(1023&o)+65536):(push$3(t,i),r--)}else push$3(t,i)}return t},digitToBasic=function(e){return e+22+75*(e<26)},adapt=function(e,t,r){var n=0;for(e=r?floor$2(e/damp):e>>1,e+=floor$2(e/t);e>baseMinusTMin*tMax>>1;)e=floor$2(e/baseMinusTMin),n+=base;return floor$2(n+(baseMinusTMin+1)*e/(e+skew))},encode=function(e){var t,r,n=[],i=(e=ucs2decode(e)).length,o=initialN,a=0,s=initialBias;for(t=0;t<e.length;t++)(r=e[t])<128&&push$3(n,fromCharCode(r));var c=n.length,u=c;for(c&&push$3(n,delimiter);u<i;){var l=maxInt;for(t=0;t<e.length;t++)(r=e[t])>=o&&r<l&&(l=r);var A=u+1;if(l-o>floor$2((maxInt-a)/A))throw $RangeError$1(OVERFLOW_ERROR);for(a+=(l-o)*A,o=l,t=0;t<e.length;t++){if((r=e[t])<o&&++a>maxInt)throw $RangeError$1(OVERFLOW_ERROR);if(r==o){for(var d=a,h=base;;){var f=h<=s?tMin:h>=s+tMax?tMax:h-s;if(d<f)break;var p=d-f,y=base-f;push$3(n,fromCharCode(digitToBasic(f+p%y))),d=floor$2(p/y),h+=base}push$3(n,fromCharCode(digitToBasic(d))),s=adapt(a,A,u==c),a=0,u++}}a++,o++}return join$2(n,"")},stringPunycodeToAscii=function(e){var t,r,n=[],i=split$2(replace$2(toLowerCase$1(e),regexSeparators,"."),".");for(t=0;t<i.length;t++)r=i[t],push$3(n,exec$1(regexNonASCII,r)?"xn--"+encode(r):r);return join$2(n,".")},$$3=_export,global$2=global$D,call=functionCall,uncurryThis$3=functionUncurryThis,DESCRIPTORS$2=descriptors,USE_NATIVE_URL$1=urlConstructorDetection,defineBuiltIn$1=defineBuiltIn$e,defineBuiltIns=defineBuiltIns$2,setToStringTag$1=setToStringTag$6,createIteratorConstructor=iteratorCreateConstructor,InternalStateModule$1=internalState,anInstance$1=anInstance$5,isCallable=isCallable$r,hasOwn$1=hasOwnProperty_1,bind$1=functionBindContext,classof=classof$e,anObject=anObject$h,isObject=isObject$g,$toString$1=toString$9,create2=objectCreate,createPropertyDescriptor=createPropertyDescriptor$6,getIterator=getIterator$4,getIteratorMethod=getIteratorMethod$5,validateArgumentsLength$1=validateArgumentsLength$3,wellKnownSymbol=wellKnownSymbol$o,arraySort=arraySort$1,ITERATOR=wellKnownSymbol("iterator"),URL_SEARCH_PARAMS="URLSearchParams",URL_SEARCH_PARAMS_ITERATOR=URL_SEARCH_PARAMS+"Iterator",setInternalState$1=InternalStateModule$1.set,getInternalParamsState=InternalStateModule$1.getterFor(URL_SEARCH_PARAMS),getInternalIteratorState=InternalStateModule$1.getterFor(URL_SEARCH_PARAMS_ITERATOR),getOwnPropertyDescriptor3=Object.getOwnPropertyDescriptor,safeGetBuiltIn=function(e){if(!DESCRIPTORS$2)return global$2[e];var t=getOwnPropertyDescriptor3(global$2,e);return t&&t.value},nativeFetch=safeGetBuiltIn("fetch"),NativeRequest=safeGetBuiltIn("Request"),Headers=safeGetBuiltIn("Headers"),RequestPrototype=NativeRequest&&NativeRequest.prototype,HeadersPrototype=Headers&&Headers.prototype,RegExp$1=global$2.RegExp,TypeError$2=global$2.TypeError,decodeURIComponent=global$2.decodeURIComponent,encodeURIComponent$1=global$2.encodeURIComponent,charAt$1=uncurryThis$3("".charAt),join$1=uncurryThis$3([].join),push$2=uncurryThis$3([].push),replace$1=uncurryThis$3("".replace),shift$1=uncurryThis$3([].shift),splice2=uncurryThis$3([].splice),split$1=uncurryThis$3("".split),stringSlice$2=uncurryThis$3("".slice),plus=/\+/g,sequences=Array(4),percentSequence=function(e){return sequences[e-1]||(sequences[e-1]=RegExp$1("((?:%[\\da-f]{2}){"+e+"})","gi"))},percentDecode=function(e){try{return decodeURIComponent(e)}catch(t){return e}},deserialize=function(e){var t=replace$1(e,plus," "),r=4;try{return decodeURIComponent(t)}catch(e){for(;r;)t=replace$1(t,percentSequence(r--),percentDecode);return t}},find3=/[!'()~]|%20/g,replacements={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},replacer=function(e){return replacements[e]},serialize=function(e){return replace$1(encodeURIComponent$1(e),find3,replacer)},URLSearchParamsIterator=createIteratorConstructor((function(e,t){setInternalState$1(this,{type:URL_SEARCH_PARAMS_ITERATOR,iterator:getIterator(getInternalParamsState(e).entries),kind:t})}),"Iterator",(function(){var e=getInternalIteratorState(this),t=e.kind,r=e.iterator.next(),n=r.value;return r.done||(r.value="keys"===t?n.key:"values"===t?n.value:[n.key,n.value]),r}),!0),URLSearchParamsState=function(e){this.entries=[],this.url=null,void 0!==e&&(isObject(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===charAt$1(e,0)?stringSlice$2(e,1):e:$toString$1(e)))};URLSearchParamsState.prototype={type:URL_SEARCH_PARAMS,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,r,n,i,o,a,s,c=getIteratorMethod(e);if(c)for(r=(t=getIterator(e,c)).next;!(n=call(r,t)).done;){if(o=(i=getIterator(anObject(n.value))).next,(a=call(o,i)).done||(s=call(o,i)).done||!call(o,i).done)throw TypeError$2("Expected sequence with length 2");push$2(this.entries,{key:$toString$1(a.value),value:$toString$1(s.value)})}else for(var u in e)hasOwn$1(e,u)&&push$2(this.entries,{key:u,value:$toString$1(e[u])})},parseQuery:function(e){if(e)for(var t,r,n=split$1(e,"&"),i=0;i<n.length;)(t=n[i++]).length&&(r=split$1(t,"="),push$2(this.entries,{key:deserialize(shift$1(r)),value:deserialize(join$1(r,"="))}))},serialize:function(){for(var e,t=this.entries,r=[],n=0;n<t.length;)e=t[n++],push$2(r,serialize(e.key)+"="+serialize(e.value));return join$1(r,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var URLSearchParamsConstructor=function(){anInstance$1(this,URLSearchParamsPrototype),setInternalState$1(this,new URLSearchParamsState(arguments.length>0?arguments[0]:void 0))},URLSearchParamsPrototype=URLSearchParamsConstructor.prototype;if(defineBuiltIns(URLSearchParamsPrototype,{append:function(e,t){validateArgumentsLength$1(arguments.length,2);var r=getInternalParamsState(this);push$2(r.entries,{key:$toString$1(e),value:$toString$1(t)}),r.updateURL()},delete:function(e){validateArgumentsLength$1(arguments.length,1);for(var t=getInternalParamsState(this),r=t.entries,n=$toString$1(e),i=0;i<r.length;)r[i].key===n?splice2(r,i,1):i++;t.updateURL()},get:function(e){validateArgumentsLength$1(arguments.length,1);for(var t=getInternalParamsState(this).entries,r=$toString$1(e),n=0;n<t.length;n++)if(t[n].key===r)return t[n].value;return null},getAll:function(e){validateArgumentsLength$1(arguments.length,1);for(var t=getInternalParamsState(this).entries,r=$toString$1(e),n=[],i=0;i<t.length;i++)t[i].key===r&&push$2(n,t[i].value);return n},has:function(e){validateArgumentsLength$1(arguments.length,1);for(var t=getInternalParamsState(this).entries,r=$toString$1(e),n=0;n<t.length;)if(t[n++].key===r)return!0;return!1},set:function(e,t){validateArgumentsLength$1(arguments.length,1);for(var r,n=getInternalParamsState(this),i=n.entries,o=!1,a=$toString$1(e),s=$toString$1(t),c=0;c<i.length;c++)(r=i[c]).key===a&&(o?splice2(i,c--,1):(o=!0,r.value=s));o||push$2(i,{key:a,value:s}),n.updateURL()},sort:function(){var e=getInternalParamsState(this);arraySort(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,r=getInternalParamsState(this).entries,n=bind$1(e,arguments.length>1?arguments[1]:void 0),i=0;i<r.length;)n((t=r[i++]).value,t.key,this)},keys:function(){return new URLSearchParamsIterator(this,"keys")},values:function(){return new URLSearchParamsIterator(this,"values")},entries:function(){return new URLSearchParamsIterator(this,"entries")}},{enumerable:!0}),defineBuiltIn$1(URLSearchParamsPrototype,ITERATOR,URLSearchParamsPrototype.entries,{name:"entries"}),defineBuiltIn$1(URLSearchParamsPrototype,"toString",(function(){return getInternalParamsState(this).serialize()}),{enumerable:!0}),setToStringTag$1(URLSearchParamsConstructor,URL_SEARCH_PARAMS),$$3({global:!0,constructor:!0,forced:!USE_NATIVE_URL$1},{URLSearchParams:URLSearchParamsConstructor}),!USE_NATIVE_URL$1&&isCallable(Headers)){var headersHas=uncurryThis$3(HeadersPrototype.has),headersSet=uncurryThis$3(HeadersPrototype.set),wrapRequestOptions=function(e){if(isObject(e)){var t,r=e.body;if(classof(r)===URL_SEARCH_PARAMS)return t=e.headers?new Headers(e.headers):new Headers,headersHas(t,"content-type")||headersSet(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),create2(e,{body:createPropertyDescriptor(0,$toString$1(r)),headers:createPropertyDescriptor(0,t)})}return e};if(isCallable(nativeFetch)&&$$3({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return nativeFetch(e,arguments.length>1?wrapRequestOptions(arguments[1]):{})}}),isCallable(NativeRequest)){var RequestConstructor=function(e){return anInstance$1(this,RequestPrototype),new NativeRequest(e,arguments.length>1?wrapRequestOptions(arguments[1]):{})};RequestPrototype.constructor=RequestConstructor,RequestConstructor.prototype=RequestPrototype,$$3({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:RequestConstructor})}}var EOF,web_urlSearchParams_constructor={URLSearchParams:URLSearchParamsConstructor,getState:getInternalParamsState},$$2=_export,DESCRIPTORS$1=descriptors,USE_NATIVE_URL=urlConstructorDetection,global$1=global$D,bind=functionBindContext,uncurryThis$2=functionUncurryThis,defineBuiltIn=defineBuiltIn$e,defineBuiltInAccessor=defineBuiltInAccessor$2,anInstance=anInstance$5,hasOwn2=hasOwnProperty_1,assign2=objectAssign,arrayFrom=arrayFrom$1,arraySlice=arraySliceSimple,codeAt=stringMultibyte.codeAt,toASCII=stringPunycodeToAscii,$toString=toString$9,setToStringTag=setToStringTag$6,validateArgumentsLength=validateArgumentsLength$3,URLSearchParamsModule=web_urlSearchParams_constructor,InternalStateModule=internalState,setInternalState=InternalStateModule.set,getInternalURLState=InternalStateModule.getterFor("URL"),URLSearchParams$1=URLSearchParamsModule.URLSearchParams,getInternalSearchParamsState=URLSearchParamsModule.getState,NativeURL=global$1.URL,TypeError$1=global$1.TypeError,parseInt$1=global$1.parseInt,floor$1=Math.floor,pow$1=Math.pow,charAt=uncurryThis$2("".charAt),exec=uncurryThis$2(/./.exec),join3=uncurryThis$2([].join),numberToString=uncurryThis$2(1..toString),pop=uncurryThis$2([].pop),push$1=uncurryThis$2([].push),replace=uncurryThis$2("".replace),shift=uncurryThis$2([].shift),split=uncurryThis$2("".split),stringSlice$1=uncurryThis$2("".slice),toLowerCase=uncurryThis$2("".toLowerCase),unshift=uncurryThis$2([].unshift),INVALID_AUTHORITY="Invalid authority",INVALID_SCHEME="Invalid scheme",INVALID_HOST="Invalid host",INVALID_PORT="Invalid port",ALPHA=/[a-z]/i,ALPHANUMERIC=/[\d+-.a-z]/i,DIGIT=/\d/,HEX_START=/^0x/i,OCT=/^[0-7]+$/,DEC=/^\d+$/,HEX=/^[\da-f]+$/i,FORBIDDEN_HOST_CODE_POINT=/[\0\t\n\r #%/:<>?@[\\\]^|]/,FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT=/[\0\t\n\r #/:<>?@[\\\]^|]/,LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,TAB_AND_NEW_LINE=/[\t\n\r]/g,parseIPv4=function(e){var t,r,n,i,o,a,s,c=split(e,".");if(c.length&&""==c[c.length-1]&&c.length--,(t=c.length)>4)return e;for(r=[],n=0;n<t;n++){if(""==(i=c[n]))return e;if(o=10,i.length>1&&"0"==charAt(i,0)&&(o=exec(HEX_START,i)?16:8,i=stringSlice$1(i,8==o?1:2)),""===i)a=0;else{if(!exec(10==o?DEC:8==o?OCT:HEX,i))return e;a=parseInt$1(i,o)}push$1(r,a)}for(n=0;n<t;n++)if(a=r[n],n==t-1){if(a>=pow$1(256,5-t))return null}else if(a>255)return null;for(s=pop(r),n=0;n<r.length;n++)s+=r[n]*pow$1(256,3-n);return s},parseIPv6=function(e){var t,r,n,i,o,a,s,c=[0,0,0,0,0,0,0,0],u=0,l=null,A=0,d=function(){return charAt(e,A)};if(":"==d()){if(":"!=charAt(e,1))return;A+=2,l=++u}for(;d();){if(8==u)return;if(":"!=d()){for(t=r=0;r<4&&exec(HEX,d());)t=16*t+parseInt$1(d(),16),A++,r++;if("."==d()){if(0==r)return;if(A-=r,u>6)return;for(n=0;d();){if(i=null,n>0){if(!("."==d()&&n<4))return;A++}if(!exec(DIGIT,d()))return;for(;exec(DIGIT,d());){if(o=parseInt$1(d(),10),null===i)i=o;else{if(0==i)return;i=10*i+o}if(i>255)return;A++}c[u]=256*c[u]+i,2!=++n&&4!=n||u++}if(4!=n)return;break}if(":"==d()){if(A++,!d())return}else if(d())return;c[u++]=t}else{if(null!==l)return;A++,l=++u}}if(null!==l)for(a=u-l,u=7;0!=u&&a>0;)s=c[u],c[u--]=c[l+a-1],c[l+--a]=s;else if(8!=u)return;return c},findLongestZeroSequence=function(e){for(var t=null,r=1,n=null,i=0,o=0;o<8;o++)0!==e[o]?(i>r&&(t=n,r=i),n=null,i=0):(null===n&&(n=o),++i);return i>r&&(t=n,r=i),t},serializeHost=function(e){var t,r,n,i;if("number"==typeof e){for(t=[],r=0;r<4;r++)unshift(t,e%256),e=floor$1(e/256);return join3(t,".")}if("object"==typeof e){for(t="",n=findLongestZeroSequence(e),r=0;r<8;r++)i&&0===e[r]||(i&&(i=!1),n===r?(t+=r?":":"::",i=!0):(t+=numberToString(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},C0ControlPercentEncodeSet={},fragmentPercentEncodeSet=assign2({},C0ControlPercentEncodeSet,{" ":1,'"':1,"<":1,">":1,"`":1}),pathPercentEncodeSet=assign2({},fragmentPercentEncodeSet,{"#":1,"?":1,"{":1,"}":1}),userinfoPercentEncodeSet=assign2({},pathPercentEncodeSet,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),percentEncode=function(e,t){var r=codeAt(e,0);return r>32&&r<127&&!hasOwn2(t,e)?e:encodeURIComponent(e)},specialSchemes={ftp:21,file:null,http:80,https:443,ws:80,wss:443},isWindowsDriveLetter=function(e,t){var r;return 2==e.length&&exec(ALPHA,charAt(e,0))&&(":"==(r=charAt(e,1))||!t&&"|"==r)},startsWithWindowsDriveLetter=function(e){var t;return e.length>1&&isWindowsDriveLetter(stringSlice$1(e,0,2))&&(2==e.length||"/"===(t=charAt(e,2))||"\\"===t||"?"===t||"#"===t)},isSingleDot=function(e){return"."===e||"%2e"===toLowerCase(e)},isDoubleDot=function(e){return".."===(e=toLowerCase(e))||"%2e."===e||".%2e"===e||"%2e%2e"===e},SCHEME_START={},SCHEME={},NO_SCHEME={},SPECIAL_RELATIVE_OR_AUTHORITY={},PATH_OR_AUTHORITY={},RELATIVE={},RELATIVE_SLASH={},SPECIAL_AUTHORITY_SLASHES={},SPECIAL_AUTHORITY_IGNORE_SLASHES={},AUTHORITY={},HOST={},HOSTNAME={},PORT={},FILE={},FILE_SLASH={},FILE_HOST={},PATH_START={},PATH={},CANNOT_BE_A_BASE_URL_PATH={},QUERY={},FRAGMENT={},URLState=function(e,t,r){var n,i,o,a=$toString(e);if(t){if(i=this.parse(a))throw TypeError$1(i);this.searchParams=null}else{if(void 0!==r&&(n=new URLState(r,!0)),i=this.parse(a,null,n))throw TypeError$1(i);(o=getInternalSearchParamsState(new URLSearchParams$1)).bindURL(this),this.searchParams=o}};URLState.prototype={type:"URL",parse:function(e,t,r){var n,i,o,a,s=this,c=t||SCHEME_START,u=0,l="",A=!1,d=!1,h=!1;for(e=$toString(e),t||(s.scheme="",s.username="",s.password="",s.host=null,s.port=null,s.path=[],s.query=null,s.fragment=null,s.cannotBeABaseURL=!1,e=replace(e,LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE,"")),e=replace(e,TAB_AND_NEW_LINE,""),n=arrayFrom(e);u<=n.length;){switch(i=n[u],c){case SCHEME_START:if(!i||!exec(ALPHA,i)){if(t)return INVALID_SCHEME;c=NO_SCHEME;continue}l+=toLowerCase(i),c=SCHEME;break;case SCHEME:if(i&&(exec(ALPHANUMERIC,i)||"+"==i||"-"==i||"."==i))l+=toLowerCase(i);else{if(":"!=i){if(t)return INVALID_SCHEME;l="",c=NO_SCHEME,u=0;continue}if(t&&(s.isSpecial()!=hasOwn2(specialSchemes,l)||"file"==l&&(s.includesCredentials()||null!==s.port)||"file"==s.scheme&&!s.host))return;if(s.scheme=l,t)return void(s.isSpecial()&&specialSchemes[s.scheme]==s.port&&(s.port=null));l="","file"==s.scheme?c=FILE:s.isSpecial()&&r&&r.scheme==s.scheme?c=SPECIAL_RELATIVE_OR_AUTHORITY:s.isSpecial()?c=SPECIAL_AUTHORITY_SLASHES:"/"==n[u+1]?(c=PATH_OR_AUTHORITY,u++):(s.cannotBeABaseURL=!0,push$1(s.path,""),c=CANNOT_BE_A_BASE_URL_PATH)}break;case NO_SCHEME:if(!r||r.cannotBeABaseURL&&"#"!=i)return INVALID_SCHEME;if(r.cannotBeABaseURL&&"#"==i){s.scheme=r.scheme,s.path=arraySlice(r.path),s.query=r.query,s.fragment="",s.cannotBeABaseURL=!0,c=FRAGMENT;break}c="file"==r.scheme?FILE:RELATIVE;continue;case SPECIAL_RELATIVE_OR_AUTHORITY:if("/"!=i||"/"!=n[u+1]){c=RELATIVE;continue}c=SPECIAL_AUTHORITY_IGNORE_SLASHES,u++;break;case PATH_OR_AUTHORITY:if("/"==i){c=AUTHORITY;break}c=PATH;continue;case RELATIVE:if(s.scheme=r.scheme,i==EOF)s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,s.path=arraySlice(r.path),s.query=r.query;else if("/"==i||"\\"==i&&s.isSpecial())c=RELATIVE_SLASH;else if("?"==i)s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,s.path=arraySlice(r.path),s.query="",c=QUERY;else{if("#"!=i){s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,s.path=arraySlice(r.path),s.path.length--,c=PATH;continue}s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,s.path=arraySlice(r.path),s.query=r.query,s.fragment="",c=FRAGMENT}break;case RELATIVE_SLASH:if(!s.isSpecial()||"/"!=i&&"\\"!=i){if("/"!=i){s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,c=PATH;continue}c=AUTHORITY}else c=SPECIAL_AUTHORITY_IGNORE_SLASHES;break;case SPECIAL_AUTHORITY_SLASHES:if(c=SPECIAL_AUTHORITY_IGNORE_SLASHES,"/"!=i||"/"!=charAt(l,u+1))continue;u++;break;case SPECIAL_AUTHORITY_IGNORE_SLASHES:if("/"!=i&&"\\"!=i){c=AUTHORITY;continue}break;case AUTHORITY:if("@"==i){A&&(l="%40"+l),A=!0,o=arrayFrom(l);for(var f=0;f<o.length;f++){var p=o[f];if(":"!=p||h){var y=percentEncode(p,userinfoPercentEncodeSet);h?s.password+=y:s.username+=y}else h=!0}l=""}else if(i==EOF||"/"==i||"?"==i||"#"==i||"\\"==i&&s.isSpecial()){if(A&&""==l)return INVALID_AUTHORITY;u-=arrayFrom(l).length+1,l="",c=HOST}else l+=i;break;case HOST:case HOSTNAME:if(t&&"file"==s.scheme){c=FILE_HOST;continue}if(":"!=i||d){if(i==EOF||"/"==i||"?"==i||"#"==i||"\\"==i&&s.isSpecial()){if(s.isSpecial()&&""==l)return INVALID_HOST;if(t&&""==l&&(s.includesCredentials()||null!==s.port))return;if(a=s.parseHost(l))return a;if(l="",c=PATH_START,t)return;continue}"["==i?d=!0:"]"==i&&(d=!1),l+=i}else{if(""==l)return INVALID_HOST;if(a=s.parseHost(l))return a;if(l="",c=PORT,t==HOSTNAME)return}break;case PORT:if(!exec(DIGIT,i)){if(i==EOF||"/"==i||"?"==i||"#"==i||"\\"==i&&s.isSpecial()||t){if(""!=l){var _=parseInt$1(l,10);if(_>65535)return INVALID_PORT;s.port=s.isSpecial()&&_===specialSchemes[s.scheme]?null:_,l=""}if(t)return;c=PATH_START;continue}return INVALID_PORT}l+=i;break;case FILE:if(s.scheme="file","/"==i||"\\"==i)c=FILE_SLASH;else{if(!r||"file"!=r.scheme){c=PATH;continue}if(i==EOF)s.host=r.host,s.path=arraySlice(r.path),s.query=r.query;else if("?"==i)s.host=r.host,s.path=arraySlice(r.path),s.query="",c=QUERY;else{if("#"!=i){startsWithWindowsDriveLetter(join3(arraySlice(n,u),""))||(s.host=r.host,s.path=arraySlice(r.path),s.shortenPath()),c=PATH;continue}s.host=r.host,s.path=arraySlice(r.path),s.query=r.query,s.fragment="",c=FRAGMENT}}break;case FILE_SLASH:if("/"==i||"\\"==i){c=FILE_HOST;break}r&&"file"==r.scheme&&!startsWithWindowsDriveLetter(join3(arraySlice(n,u),""))&&(isWindowsDriveLetter(r.path[0],!0)?push$1(s.path,r.path[0]):s.host=r.host),c=PATH;continue;case FILE_HOST:if(i==EOF||"/"==i||"\\"==i||"?"==i||"#"==i){if(!t&&isWindowsDriveLetter(l))c=PATH;else if(""==l){if(s.host="",t)return;c=PATH_START}else{if(a=s.parseHost(l))return a;if("localhost"==s.host&&(s.host=""),t)return;l="",c=PATH_START}continue}l+=i;break;case PATH_START:if(s.isSpecial()){if(c=PATH,"/"!=i&&"\\"!=i)continue}else if(t||"?"!=i)if(t||"#"!=i){if(i!=EOF&&(c=PATH,"/"!=i))continue}else s.fragment="",c=FRAGMENT;else s.query="",c=QUERY;break;case PATH:if(i==EOF||"/"==i||"\\"==i&&s.isSpecial()||!t&&("?"==i||"#"==i)){if(isDoubleDot(l)?(s.shortenPath(),"/"==i||"\\"==i&&s.isSpecial()||push$1(s.path,"")):isSingleDot(l)?"/"==i||"\\"==i&&s.isSpecial()||push$1(s.path,""):("file"==s.scheme&&!s.path.length&&isWindowsDriveLetter(l)&&(s.host&&(s.host=""),l=charAt(l,0)+":"),push$1(s.path,l)),l="","file"==s.scheme&&(i==EOF||"?"==i||"#"==i))for(;s.path.length>1&&""===s.path[0];)shift(s.path);"?"==i?(s.query="",c=QUERY):"#"==i&&(s.fragment="",c=FRAGMENT)}else l+=percentEncode(i,pathPercentEncodeSet);break;case CANNOT_BE_A_BASE_URL_PATH:"?"==i?(s.query="",c=QUERY):"#"==i?(s.fragment="",c=FRAGMENT):i!=EOF&&(s.path[0]+=percentEncode(i,C0ControlPercentEncodeSet));break;case QUERY:t||"#"!=i?i!=EOF&&("'"==i&&s.isSpecial()?s.query+="%27":s.query+="#"==i?"%23":percentEncode(i,C0ControlPercentEncodeSet)):(s.fragment="",c=FRAGMENT);break;case FRAGMENT:i!=EOF&&(s.fragment+=percentEncode(i,fragmentPercentEncodeSet))}u++}},parseHost:function(e){var t,r,n;if("["==charAt(e,0)){if("]"!=charAt(e,e.length-1))return INVALID_HOST;if(!(t=parseIPv6(stringSlice$1(e,1,-1))))return INVALID_HOST;this.host=t}else if(this.isSpecial()){if(e=toASCII(e),exec(FORBIDDEN_HOST_CODE_POINT,e))return INVALID_HOST;if(null===(t=parseIPv4(e)))return INVALID_HOST;this.host=t}else{if(exec(FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT,e))return INVALID_HOST;for(t="",r=arrayFrom(e),n=0;n<r.length;n++)t+=percentEncode(r[n],C0ControlPercentEncodeSet);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return hasOwn2(specialSchemes,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"==this.scheme&&1==t&&isWindowsDriveLetter(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,r=e.username,n=e.password,i=e.host,o=e.port,a=e.path,s=e.query,c=e.fragment,u=t+":";return null!==i?(u+="//",e.includesCredentials()&&(u+=r+(n?":"+n:"")+"@"),u+=serializeHost(i),null!==o&&(u+=":"+o)):"file"==t&&(u+="//"),u+=e.cannotBeABaseURL?a[0]:a.length?"/"+join3(a,"/"):"",null!==s&&(u+="?"+s),null!==c&&(u+="#"+c),u},setHref:function(e){var t=this.parse(e);if(t)throw TypeError$1(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"==e)try{return new URLConstructor(e.path[0]).origin}catch(e){return"null"}return"file"!=e&&this.isSpecial()?e+"://"+serializeHost(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse($toString(e)+":",SCHEME_START)},getUsername:function(){return this.username},setUsername:function(e){var t=arrayFrom($toString(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=percentEncode(t[r],userinfoPercentEncodeSet)}},getPassword:function(){return this.password},setPassword:function(e){var t=arrayFrom($toString(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=percentEncode(t[r],userinfoPercentEncodeSet)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?serializeHost(e):serializeHost(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,HOST)},getHostname:function(){var e=this.host;return null===e?"":serializeHost(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,HOSTNAME)},getPort:function(){var e=this.port;return null===e?"":$toString(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""==(e=$toString(e))?this.port=null:this.parse(e,PORT))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+join3(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,PATH_START))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""==(e=$toString(e))?this.query=null:("?"==charAt(e,0)&&(e=stringSlice$1(e,1)),this.query="",this.parse(e,QUERY)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!=(e=$toString(e))?("#"==charAt(e,0)&&(e=stringSlice$1(e,1)),this.fragment="",this.parse(e,FRAGMENT)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var URLConstructor=function(e){var t=anInstance(this,URLPrototype),r=validateArgumentsLength(arguments.length,1)>1?arguments[1]:void 0,n=setInternalState(t,new URLState(e,!1,r));DESCRIPTORS$1||(t.href=n.serialize(),t.origin=n.getOrigin(),t.protocol=n.getProtocol(),t.username=n.getUsername(),t.password=n.getPassword(),t.host=n.getHost(),t.hostname=n.getHostname(),t.port=n.getPort(),t.pathname=n.getPathname(),t.search=n.getSearch(),t.searchParams=n.getSearchParams(),t.hash=n.getHash())},URLPrototype=URLConstructor.prototype,accessorDescriptor=function(e,t){return{get:function(){return getInternalURLState(this)[e]()},set:t&&function(e){return getInternalURLState(this)[t](e)},configurable:!0,enumerable:!0}};if(DESCRIPTORS$1&&(defineBuiltInAccessor(URLPrototype,"href",accessorDescriptor("serialize","setHref")),defineBuiltInAccessor(URLPrototype,"origin",accessorDescriptor("getOrigin")),defineBuiltInAccessor(URLPrototype,"protocol",accessorDescriptor("getProtocol","setProtocol")),defineBuiltInAccessor(URLPrototype,"username",accessorDescriptor("getUsername","setUsername")),defineBuiltInAccessor(URLPrototype,"password",accessorDescriptor("getPassword","setPassword")),defineBuiltInAccessor(URLPrototype,"host",accessorDescriptor("getHost","setHost")),defineBuiltInAccessor(URLPrototype,"hostname",accessorDescriptor("getHostname","setHostname")),defineBuiltInAccessor(URLPrototype,"port",accessorDescriptor("getPort","setPort")),defineBuiltInAccessor(URLPrototype,"pathname",accessorDescriptor("getPathname","setPathname")),defineBuiltInAccessor(URLPrototype,"search",accessorDescriptor("getSearch","setSearch")),defineBuiltInAccessor(URLPrototype,"searchParams",accessorDescriptor("getSearchParams")),defineBuiltInAccessor(URLPrototype,"hash",accessorDescriptor("getHash","setHash"))),defineBuiltIn(URLPrototype,"toJSON",(function(){return getInternalURLState(this).serialize()}),{enumerable:!0}),defineBuiltIn(URLPrototype,"toString",(function(){return getInternalURLState(this).serialize()}),{enumerable:!0}),NativeURL){var nativeCreateObjectURL=NativeURL.createObjectURL,nativeRevokeObjectURL=NativeURL.revokeObjectURL;nativeCreateObjectURL&&defineBuiltIn(URLConstructor,"createObjectURL",bind(nativeCreateObjectURL,NativeURL)),nativeRevokeObjectURL&&defineBuiltIn(URLConstructor,"revokeObjectURL",bind(nativeRevokeObjectURL,NativeURL))}function createPublicPromise(){var e,t,r=new Promise((function(r,n){e=r,t=n}));return r.used=!1,r.resolve=function(){return r.used=!0,e.apply(void 0,arguments)},r.reject=function(){return r.used=!0,t.apply(void 0,arguments)},r}function nowTime(){try{return parseInt(performance.now(),10)}catch(e){return(new Date).getTime()}}setToStringTag(URLConstructor,"URL"),$$2({global:!0,constructor:!0,forced:!USE_NATIVE_URL,sham:!DESCRIPTORS$1},{URL:URLConstructor});var _ERR_CODE,Buffer=function(){function e(){_classCallCheck(this,e)}return _createClass(e,null,[{key:"start",value:function(e){return e&&e.length?1===e.length&&e.end(0)-e.start(0)<1e-6||1===e.length&&e.start(0)<0?0:e.start(0):0}},{key:"end",value:function(e){return e&&e.length?1===e.length&&e.end(0)-e.start(0)<1e-6?0:e.end(e.length-1):0}},{key:"get",value:function(e){if(e)try{return e.buffered}catch(e){}}},{key:"buffers",value:function(e,t){if(!e||!e.length)return[];for(var r=[],n=0,i=e.length;n<i;n++){var o=r.length;if(o&&t){var a=r[o-1],s=a[1];if(e.start(n)-s<=t){var c=e.end(n);c>s&&(a[1]=c)}else r.push([e.start(n),e.end(n)])}else r.push([e.start(n),e.end(n)])}return r}},{key:"totalLength",value:function(e){return e&&e.length?e.reduce((function(e,t){return e+(t[1]-t[0])}),0):0}},{key:"info",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!t||!t.length)return{start:0,end:0,buffers:[]};for(var i=0,o=0,a=0,s=0,c=0,u=0,l=0,A=e.buffers(t,n),d=0,h=A.length;d<h;d++){var f=A[d];if(r+n>=f[0]&&r<f[1])i=f[0],o=f[1],a=d;else{if(r+n<f[0]){s=f[0],c=f[1];break}r+n>f[1]&&(u=f[0],l=f[1])}}return{start:i,end:o,index:a,buffers:A,nextStart:s,nextEnd:c,prevStart:u,prevEnd:l,currentTime:r,behind:r-i,remaining:o?o-r:0,length:e.totalLength&&e.totalLength(A)}}}]),e}(),ERR={MANIFEST:"manifest",NETWORK:"network",NETWORK_TIMEOUT:"network_timeout",DEMUX:"demux",REMUX:"remux",MEDIA:"media",DRM:"drm",OTHER:"other",SUB_TYPES:{FLV:"FLV",HLS:"HLS",MP4:"MP4",FMP4:"FMP4",MSE_ADD_SB:"MSE_ADD_SB",MSE_APPEND_BUFFER:"MSE_APPEND_BUFFER",MSE_OTHER:"MSE_OTHER",MSE_FULL:"MSE_FULL",OPTION:"OPTION"}},ERR_CODE=(_defineProperty(_ERR_CODE={},ERR.MANIFEST,{HLS:1100}),_defineProperty(_ERR_CODE,ERR.NETWORK,2100),_defineProperty(_ERR_CODE,ERR.NETWORK_TIMEOUT,2101),_defineProperty(_ERR_CODE,ERR.DEMUX,{FLV:3100,HLS:3200,MP4:3300,FMP4:3400}),_defineProperty(_ERR_CODE,ERR.REMUX,{FMP4:4100,MP4:4200}),_defineProperty(_ERR_CODE,ERR.MEDIA,{MSE_ADD_SB:5200,MSE_APPEND_BUFFER:5201,MSE_OTHER:5202,MSE_FULL:5203}),_defineProperty(_ERR_CODE,ERR.OTHER,8e3),_ERR_CODE),StreamingError=function(e){_inherits(r,_wrapNativeSuper(Error));var t=_createSuper(r);function r(e,n,i,o,a){var s;return _classCallCheck(this,r),(s=t.call(this,a||(null==i?void 0:i.message))).errorType=e===ERR.NETWORK_TIMEOUT?ERR.NETWORK:e,s.originError=i,s.ext=o,s.errorCode=ERR_CODE[e][n]||ERR_CODE[e],s.errorMessage=s.message,s.errorCode||(s.errorType=ERR.OTHER,s.errorCode=ERR_CODE[s.errorType]),s}return _createClass(r,null,[{key:"create",value:function(e,t,n,i,o){return e instanceof r?e:(e instanceof Error&&(n=e,e=""),e||(e=ERR.OTHER),new r(e,t,n,i,o))}},{key:"network",value:function(e){var t;return new r(null!=e&&e.isTimeout?ERR.NETWORK_TIMEOUT:ERR.NETWORK,e,null,{url:null==e?void 0:e.url,response:null==e?void 0:e.response,httpCode:null==e||null===(t=e.response)||void 0===t?void 0:t.status})}}]),r}(),isBrowser="undefined"!=typeof window,Logger=function(){function e(t){_classCallCheck(this,e),this.name=t||"",this._prefix="[".concat(this.name,"]")}return _createClass(e,[{key:"debug",value:function(){var t;if(!e.disabled){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];(t=console).debug.apply(t,[this._prefix,nowTime()].concat(n))}}},{key:"log",value:function(){var t;if(!e.disabled){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];(t=console).log.apply(t,[this._prefix,nowTime()].concat(n))}}},{key:"warn",value:function(){var t;if(!e.disabled){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];(t=console).warn.apply(t,[this._prefix,nowTime()].concat(n))}}},{key:"error",value:function(){var t;if(!e.disabled){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];(t=console).error.apply(t,[this._prefix,nowTime()].concat(n))}}},{key:"table",value:function(){var t;e.disabled||(console.group(this._prefix),(t=console).table.apply(t,arguments),console.groupEnd())}}],[{key:"enable",value:function(){e.disabled=!1}},{key:"disable",value:function(){e.disabled=!0}}]),e}();function getMediaSource(){try{return isBrowser?window.MediaSource:null}catch(e){}}_defineProperty(Logger,"disabled",!0);var MediaSource=getMediaSource(),OP_NAME={APPEND:"appendBuffer",REMOVE:"removeBuffer"},MSE=function(){function e(t,r){var n=this;_classCallCheck(this,e),_defineProperty(this,"media",null),_defineProperty(this,"mediaSource",null),_defineProperty(this,"_openPromise",createPublicPromise()),_defineProperty(this,"_queue",Object.create(null)),_defineProperty(this,"_sourceBuffer",Object.create(null)),_defineProperty(this,"_mseFullFlag",{}),_defineProperty(this,"_st",0),_defineProperty(this,"_opst",0),_defineProperty(this,"_logger",null),_defineProperty(this,"_config",null),_defineProperty(this,"_url",null),_defineProperty(this,"_onSBUpdateEnd",(function(e){var t=n._queue[e];if(t){var r=t.shift();if(r){var i=nowTime()-n._opst;n._logger.debug("UpdateEnd",r.opName,i,r.context),r.promise.resolve({name:r.opName,context:r.context,costtime:i}),n._startQueue(e)}}})),_defineProperty(this,"_onSBUpdateError",(function(e,t){var r=n._queue[e];if(r){var i=r[0];i&&(n._logger.error("UpdateError",e,i.opName,i.context),i.promise.reject(new StreamingError(ERR.MEDIA,ERR.SUB_TYPES.MSE_APPEND_BUFFER,t)))}})),this._config=Object.assign(e.getDefaultConfig(),r),t&&this.bindMedia(t),this._logger=new Logger("MSE"),this._config.openLog&&Logger.enable()}var t,r,n;return _createClass(e,[{key:"isOpened",get:function(){var e;return"open"===(null===(e=this.mediaSource)||void 0===e?void 0:e.readyState)}},{key:"url",get:function(){return this._url}},{key:"duration",get:function(){var e;return(null===(e=this.mediaSource)||void 0===e?void 0:e.duration)||-1}},{key:"isEnded",get:function(){return!!this.mediaSource&&"ended"===this.mediaSource.readyState}},{key:"isFull",value:function(t){return t?this._mseFullFlag[t]:this._mseFullFlag[e.VIDEO]}},{key:"updateDuration",value:function(e){var t=this;return this.mediaSource&&this.mediaSource.duration>e?Promise.resolve():this._enqueueBlockingOp((function(){t.isEnded?t._logger.debug("[debug mse] setDuration ended"):t.mediaSource&&(t.mediaSource.duration=e,t._logger.debug("[debug mse] setDuration"))}),"updateDuration")}},{key:"open",value:function(){var e=this;if(this._openPromise.used&&!this.isOpened&&this.mediaSource){var t=this.mediaSource;t.addEventListener("sourceopen",(function r(){var n=nowTime()-e._st;e._logger.debug("MSE OPEN",n),t.removeEventListener("sourceopen",r),e._openPromise.resolve({costtime:n})})),this._openPromise=createPublicPromise()}return this._openPromise}},{key:"bindMedia",value:(n=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n,i=this;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.mediaSource&&!this.media){e.next=3;break}return e.next=3,this.unbindMedia();case 3:if(t&&MediaSource){e.next=5;break}throw new Error("Param media or MediaSource does not exist");case 5:return this.media=t,r=this.mediaSource=new MediaSource,this._st=nowTime(),n=function e(){var n=nowTime()-i._st;i._logger.debug("MSE OPEN"),r.removeEventListener("sourceopen",e),URL.revokeObjectURL(t.src),i._openPromise.resolve({costtime:n})},r.addEventListener("sourceopen",n),this._url=URL.createObjectURL(r),t.src=this._url,e.abrupt("return",this._openPromise);case 13:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"unbindMedia",value:(r=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t,r,n,i=this;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._openPromise.used||this._openPromise.resolve(),t=this.mediaSource){if(Object.keys(this._queue).forEach((function(e){var t=i._queue[e];t&&t.forEach((function(e){return e.promise.resolve}))})),r=!!this.media&&this.media.readyState>=1,n="open"===t.readyState,r&&n)try{t.endOfStream()}catch(e){}Object.keys(this._sourceBuffer).forEach((function(e){try{t.removeSourceBuffer(i._sourceBuffer[e])}catch(e){}}))}if(this.media){this.media.removeAttribute("src");try{this.media.load()}catch(e){}this.media=null}this.mediaSource=null,this._openPromise=createPublicPromise(),this._queue=Object.create(null),this._sourceBuffer=Object.create(null);case 8:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"createSource",value:function(e,t){if(!this._sourceBuffer[e]&&this.mediaSource){var r;try{r=this._sourceBuffer[e]=this.mediaSource.addSourceBuffer(t)}catch(e){throw new StreamingError(ERR.MEDIA,ERR.SUB_TYPES.MSE_ADD_SB,e)}r.mimeType=t,r.addEventListener("updateend",this._onSBUpdateEnd.bind(this,e)),r.addEventListener("error",this._onSBUpdateError.bind(this,e))}}},{key:"changeType",value:function(e,t){var r=this,n=this._sourceBuffer[e];return this.mediaSource&&n&&n.mimeType!==t&&"function"==typeof n.changeType?this._enqueueOp(e,(function(){n.changeType(t),n.mimeType=t,r._onSBUpdateEnd(e)})):Promise.resolve()}},{key:"createOrChangeSource",value:function(e,t){return this.createSource(e,t),this.changeType(e,t)}},{key:"append",value:function(e,t,r){var n=this;return t&&t.byteLength&&this._sourceBuffer[e]?this._enqueueOp(e,(function(){var i;n.mediaSource&&(n._logger.debug("MSE APPEND START",r),n._opst=nowTime(),null===(i=n._sourceBuffer[e])||void 0===i||i.appendBuffer(t))}),OP_NAME.APPEND,r):Promise.resolve()}},{key:"remove",value:function(e,t,r,n){var i=this,o=!1;return this._mseFullFlag[e]&&(o=!0),this._enqueueOp(e,(function(){if(i.mediaSource){var o=i._sourceBuffer[e];t>=r||!o?i._onSBUpdateEnd(e):(i._opst=nowTime(),i._logger.debug("MSE REMOVE START",e,t,r,n),o.remove(t,r))}}),OP_NAME.REMOVE,n,o)}},{key:"clearBuffer",value:function(e,t){var r,n=this;return Object.keys(this._sourceBuffer).forEach((function(i){r=n._enqueueOp(i,(function(){if(n.mediaSource){var r=n._sourceBuffer[i];n._logger.debug("MSE clearBuffer START",i,e,t),r.remove(e,t)}}))})),r}},{key:"clearAllBuffer",value:function(){var e,t=this;return Object.keys(this._sourceBuffer).forEach((function(r){e=t._enqueueOp(r,(function(){if(t.mediaSource){var e=t._sourceBuffer[r];t._logger.debug("MSE clearAllBuffer START",r),e.remove(0,Buffer.end(Buffer.get(e)))}}))})),e}},{key:"clearOpQueues",value:function(e){var t;this._logger.debug("MSE clearOpQueue START");var r=this._queue[e];if(r&&r[e]&&!(r.length<5)){var n=[];r.forEach((function(e){e.context&&e.context.isinit&&n.push(e)})),this._queue[e]=r.slice(0,2),n.length>0&&(t=this._queue[e]).push.apply(t,n)}}},{key:"endOfStream",value:function(e){var t=this;return this.mediaSource&&"open"===this.mediaSource.readyState?this._enqueueBlockingOp((function(){var r=t.mediaSource;r&&"open"===r.readyState&&(t._logger.debug("MSE endOfStream START"),e?r.endOfStream(e):r.endOfStream())}),"endOfStream"):Promise.resolve()}},{key:"setLiveSeekableRange",value:function(e,t){var r=this.mediaSource;e<0||t<e||null==r||!r.setLiveSeekableRange||"open"!==r.readyState||r.setLiveSeekableRange(e,t)}},{key:"getSourceBuffer",value:function(e){return this._sourceBuffer[e]}},{key:"buffered",value:function(e){return Buffer.get(this._sourceBuffer[e])}},{key:"bufferStart",value:function(e){return Buffer.start(this.buffered(e))}},{key:"bufferEnd",value:function(e){return Buffer.end(this.buffered(e))}},{key:"_enqueueOp",value:function(e,t,r,n,i){var o=this;if(!this.mediaSource)return Promise.resolve();var a=this._queue[e]=this._queue[e]||[],s={exec:t,promise:createPublicPromise(),opName:r,context:n};return i?(a.splice(0,0,s),this._mseFullFlag[e]=!1,this._startQueue(e)):a.push(s),this.isOpened?1===a.length&&this._startQueue(e):this._openPromise.then((function(){1===a.length&&o._startQueue(e)})),s.promise}},{key:"_enqueueBlockingOp",value:(t=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){var n,i,o=this;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.mediaSource){e.next=2;break}return e.abrupt("return",Promise.resolve());case 2:if((n=Object.keys(this._sourceBuffer)).length){e.next=5;break}return e.abrupt("return",t());case 5:return i=[],n.forEach((function(e){var t=o._queue[e],n=createPublicPromise();i.push(n),t.push({exec:function(){return n.resolve()},promise:n,opName:r}),1===t.length&&o._startQueue(e)})),e.abrupt("return",Promise.all(i).then((function(){try{return t()}finally{n.forEach((function(e){var t=o._queue[e],r=o._sourceBuffer[e];null==t||t.shift(),r&&r.updating||o._startQueue(e)}))}})));case 8:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})},{key:"_startQueue",value:function(e){var t=this._queue[e];if(t){var r=t[0];if(r&&!this._mseFullFlag[e])try{r.exec()}catch(n){n&&n.message&&n.message.indexOf("SourceBuffer is full")>=0?(this._mseFullFlag[e]=!0,this._logger.error("[MSE error], context,",r.context," ,name,",r.opName,",err,SourceBuffer is full"),r.promise.reject(new StreamingError(ERR.MEDIA,ERR.SUB_TYPES.MSE_FULL,n))):(this._logger.error(n),r.promise.reject(new StreamingError(ERR.MEDIA,ERR.SUB_TYPES.MSE_OTHER,n)),t.shift(),this._startQueue(e))}}}},{key:"setTimeoffset",value:function(e,t,r){var n=this;return this._enqueueOp(e,(function(){t<0&&(t+=.001),n._sourceBuffer[e].timestampOffset=t,n._onSBUpdateEnd(e)}),"setTimeoffset",r)}},{key:"abort",value:function(e,t){var r=this;return this.isOpened?this._enqueueOp(e,(function(){r._sourceBuffer[e].abort(),r._onSBUpdateEnd(e)}),"abort",t):Promise.resolve()}}],[{key:"getDefaultConfig",value:function(){return{openLog:!1}}},{key:"isSupported",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'video/mp4; codecs="avc1.42E01E,mp4a.40.2"';if(!MediaSource)return!1;try{return MediaSource.isTypeSupported(e)}catch(t){return this._logger.error(e,t),!1}}}]),e}();_defineProperty(MSE,"VIDEO","video"),_defineProperty(MSE,"AUDIO","audio");var AUDIO_ERROR_SUBCODE=3,CODEC_MAP={"mp4a.40.5":1,"mp4a.40.2":2},JUMP_GAP_STEP=.05,MediaCache=function(){function e(){_classCallCheck$2(this,e),_defineProperty$2(this,"_queue",[]),"undefined"!=typeof document&&(this._tempMedia=document.createElement("video"))}return _createClass$2(e,[{key:"tempMedia",get:function(){return this._tempMedia}},{key:"hasCached",get:function(){return-1!==this._queue.findIndex((function(e){return 1===e.codec}))&&-1!==this._queue.findIndex((function(e){return 2===e.codec}))}},{key:"getCachedMedia",value:function(e){var t=this._queue.findIndex((function(t){return t.codec===e}));return-1!==t?this._queue.splice(t,1)[0]:null}},{key:"cacheMedia",value:function(e){var t=e.codec,r=e.media,n=e.mse,i=CODEC_MAP[t];if(this._queue=this._queue.filter((function(e){var t;return e.mse&&!e.mse.isOpened&&e.mse.unbindMedia(),null===(t=e.mse)||void 0===t?void 0:t.isOpened})),!t||this._queue.filter((function(e){return e.codec===i})).length>2)return null==n||n.endOfStream(),void(null==n||n.unbindMedia());this._queue.push({codec:i,media:r,mse:n})}}]),e}(),mediaCache=new MediaCache,AudioMseRender=function(e){_inherits$1(o,BaseRender);var t,r,n,i=_createSuper$1(o);function o(e,t){var r;return _classCallCheck$2(this,o),_defineProperty$2(_assertThisInitialized$1(r=i.call(this,e,t)),"_media",void 0),_defineProperty$2(_assertThisInitialized$1(r),"_isTempMedia",!1),_defineProperty$2(_assertThisInitialized$1(r),"_mse",void 0),_defineProperty$2(_assertThisInitialized$1(r),"_remuxer",null),_defineProperty$2(_assertThisInitialized$1(r),"_codec",""),_defineProperty$2(_assertThisInitialized$1(r),"_sourceCreated",!1),_defineProperty$2(_assertThisInitialized$1(r),"_needInitSegment",!0),_defineProperty$2(_assertThisInitialized$1(r),"_seekNoSideEffect",!1),_defineProperty$2(_assertThisInitialized$1(r),"_startRendered",!1),_defineProperty$2(_assertThisInitialized$1(r),"_firstTimeAppendedBuffer",!1),_defineProperty$2(_assertThisInitialized$1(r),"_sampleQueue",[]),_defineProperty$2(_assertThisInitialized$1(r),"_inProcessing",!1),_defineProperty$2(_assertThisInitialized$1(r),"_duration",0),_defineProperty$2(_assertThisInitialized$1(r),"_mediaCache",mediaCache),_defineProperty$2(_assertThisInitialized$1(r),"_resetDts",(function(){})),_defineProperty$2(_assertThisInitialized$1(r),"_onCanplay",(function(){r._ready||(r._ready=!0,r.emit(Events.AUDIO.AUDIO_READY))})),_defineProperty$2(_assertThisInitialized$1(r),"_onPlaying",(function(){r._parent.ready&&(r._audioCanAutoplay=!0,r._emitTimelineEvents(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.PLAYING))})),_defineProperty$2(_assertThisInitialized$1(r),"_onWaiting",(function(){if(!r._seekNoSideEffect){try{for(var e,t=r._media.buffered,n=r._media.currentTime,i=0,o=0,a=t.length;o<a;o++)t.start(o)<n&&t.end(o)>n&&(i=t.end(o)-n);if(Math.abs(i)>.5)return;if(Math.abs(r._media.duration-r._media.currentTime)<.3)return r._reuseMse||r._mse.endOfStream(),void(null===(e=_assertThisInitialized$1(r))||void 0===e||e._emitTimelineEvents(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.ENDED))}catch(e){}r._ready=!1,r.emit(Events.AUDIO.AUDIO_WAITING)}})),_defineProperty$2(_assertThisInitialized$1(r),"_onSeeked",(function(){r._seekNoSideEffect||r._isLive?r._seekNoSideEffect=!1:(logger.log(r.TAG,"seeked"),r._ready||(r._media.pause(),r._ready=!0,r.emit(Events.AUDIO.AUDIO_READY)))})),_defineProperty$2(_assertThisInitialized$1(r),"_onProgress",(function(){if(r._media.readyState<=1){var e=r._getBufferGap();e>0&&e<1&&(r._media.currentTime+=e+JUMP_GAP_STEP,logger.warn(r.TAG,"progress, gap=",e))}r._emitTimelineEvents(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.PROGRESS),r._emitTimelineEvents(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.DURATION_CHANGE)})),_defineProperty$2(_assertThisInitialized$1(r),"_onEnded",(function(){var e;logger.log(r.TAG,"ended!"),null===(e=_assertThisInitialized$1(r))||void 0===e||e._emitTimelineEvents(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.ENDED)})),_defineProperty$2(_assertThisInitialized$1(r),"_onOnceProgress",(function(){if(r._media.buffered.length){var e=r._media.buffered.start(0);e&&(r._media.currentTime=e+JUMP_GAP_STEP,logger.log(r.TAG,"start gap:",e)),r._media.removeEventListener("progress",r._onOnceProgress)}})),_defineProperty$2(_assertThisInitialized$1(r),"_onError",(function(){var e;r._emitTimelineEvents(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.ERROR,r._assembleErr("audio error: ".concat(null===(e=r._media.error)||void 0===e?void 0:e.message),AUDIO_ERROR_SUBCODE))})),_defineProperty$2(_assertThisInitialized$1(r),"_appendChunk",(function(e,t){if(!r.noAudio&&t.samples.length){if(r._codec||(2!==t.objectType&&5!==t.objectType?r._codec="mp4a.40.5":r._codec=t.codec,r._isTempMedia&&r._switchMedia(r._codec)),t.samples.forEach((function(e){e.baseMediaDecodeTime=t.baseMediaDecodeTime,r._sampleQueue.push(e)})),t.samples=[],!r._meta)return r._meta=_objectSpread2(_objectSpread2({},t),{},{exist:function(){return!0},hasSample:function(){return!0},samples:[]}),logger.warn(r.TAG,"audio set metadata",r._meta),void r._doAppendWrapper();r._meta.sampleRate!==t.sampleRate&&(logger.warn(r.TAG,"discontinue: ".concat(r._meta.sampleRate," -> ").concat(t.sampleRate)),r._needInitSegment=!0,Object.keys(t).forEach((function(e){r._meta[e]=t[e]}))),!r._inProcessing&&r._sampleQueue.length&&r._doAppendWrapper()}})),_defineProperty$2(_assertThisInitialized$1(r),"_doAppend",function(){var e=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(t){var n,i,o;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r._remuxer||(r._remuxer=new FMP4Remuxer({samples:[],exist:function(){return!1}},t)),n=t.samples,r._sourceCreated){e.next=12;break}return r.analyse.addAudioMseOpenStart(),e.next=6,r._mse.open();case 6:r._sourceCreated=!0,logger.log(r.TAG,"video/mp4;codecs=".concat(r._codec)),r._mse.createSource(t.type,"video/mp4;codecs=".concat(r._codec)),r.analyse.addAudioMseOpend(),logger.log(r.TAG,"sb created!"),r._checkAutoPlay();case 12:if(i=r._remuxer.remux(r._needInitSegment),!r._needInitSegment||i.audioInitSegment){e.next=15;break}return e.abrupt("return");case 15:return r._needInitSegment=!1,o=[],i.audioInitSegment&&o.push(r._mse.append(t.type,i.audioInitSegment)),i.audioSegment&&o.push(r._mse.append(t.type,i.audioSegment)),e.abrupt("return",Promise.all(o).then((function(){return n[n.length-1].dts/1e3})).then((function(){r._firstTimeAppendedBuffer||(r._firstTimeAppendedBuffer=!0,r.analyse.addAudioFirstTimeAppended())})));case 20:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),_defineProperty$2(_assertThisInitialized$1(r),"_doPlay",(function(){r._media.play().catch((function(){}))})),_defineProperty$2(_assertThisInitialized$1(r),"_doPause",(function(){r._media.pause()})),_defineProperty$2(_assertThisInitialized$1(r),"_doSeek",(function(e){r._ready=!1,r._media.currentTime=e})),_defineProperty$2(_assertThisInitialized$1(r),"_doChaseFrame",(function(e){var t=e.position;r._seekNoSideEffect=!0,r._media.currentTime=t})),_defineProperty$2(_assertThisInitialized$1(r),"_startRender",(function(){logger.log(r.TAG,"start render"),r._startRendered=!0,r._media.play().catch((function(){}))})),r.TAG="AudioMseRender",r._reuseMse=getDecodeCapacaity().reuseMseForAudio,r._initMedia(),r}return _createClass$2(o,[{key:"isMse",get:function(){return!0}},{key:"media",get:function(){return this._media}},{key:"currentTime",get:function(){return this._media.currentTime}},{key:"buffered",get:function(){return this._media.buffered}},{key:"duration",get:function(){return Number.isNaN(this._media.duration)?1/0:this._media.duration},set:function(e){this._duration=e,this._updateDuration(e)}},{key:"audioCanAutoplay",get:function(){return this._audioCanAutoplay||this.noAudio}},{key:"_initMedia",value:function(){if(!this._reuseMse||!mediaCache.hasCached)return logger.log(this.TAG,"init media and mse directly"),this._media=document.createElement("video"),this._media.autoplay=!0,this._mse=new MSE,this._bindEvents(),this._bindMediaEvents(),void this._mse.bindMedia(this._media);logger.log(this.TAG,"bind media temporary"),this._media=mediaCache.tempMedia,this._bindEvents(),this._isTempMedia=!0}},{key:"_switchMedia",value:function(e){var t=this._media,r=mediaCache.getCachedMedia(CODEC_MAP[e]);r?(logger.warn(this.TAG,"switch to cached media for audio play! codec=".concat(e)),this._media=r.media,this._mse=r.mse,this._bindMediaEvents(),this._updateDuration(this._duration),this._media.currentTime=JUMP_GAP_STEP,this._sourceCreated=!0,this._audioCanAutoplay=!0,this.analyse.addAudioMseOpend()):this._initMedia(),this._media.volume=t.volume,this._media.playbackRate=t.playbackRate,this._isTempMedia=!1}},{key:"_getBufferGap",value:function(){for(var e=this.buffered,t=0,r=e.length;t<r;t++)if(!(e.end(t)<this.currentTime))return e.start(t)-this.currentTime;return 0}},{key:"canSeek",value:function(){return!0}},{key:"resume",value:function(){return this._media.play()}},{key:"pause",value:function(){return this._media.pause()}},{key:"seekNoSideEffect",value:function(e){this._doChaseFrame(e)}},{key:"dump",value:function(){}},{key:"_emitTimelineEvents",value:function(e,t,r){var n,i;null===(n=this._parent)||void 0===n||null===(i=n.emit)||void 0===i||i.call(n,e,t,r)}},{key:"_assembleErr",value:function(e,t){var r=new Error(e);return r.code=3,r.subCode=t,r}},{key:"_bindEvents",value:function(){var e=this;_get(_getPrototypeOf$1(o.prototype),"_bindEvents",this).call(this),this._parent.on(Events.DECODE_EVENTS.CHASE_AUDIO_FRAME,this._doChaseFrame),this._parent.on(Events.TIMELINE.UPDATE_VOLUME,(function(t){e._media.volume=t,e._emitTimelineEvents(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.VOLUME_CHANGE)})),this._parent.on(Events.TIMELINE.END_OF_STREAM,(function(){var t;e.reuseMseForAudio||(null===(t=e._mse)||void 0===t||t.endOfStream())})),this._parent.on(Events.TIMELINE.SET_PLAYBACKRATE,(function(t){logger.log(e.TAG,"change playbackrate, ",t),e._media.playbackRate=t}))}},{key:"_bindMediaEvents",value:function(){this._media.addEventListener("canplay",this._onCanplay),this._media.addEventListener("playing",this._onPlaying),this._media.addEventListener("waiting",this._onWaiting),this._media.addEventListener("seeked",this._onSeeked),this._media.addEventListener("progress",this._onProgress),this._media.addEventListener("ended",this._onEnded),this._media.addEventListener("progress",this._onOnceProgress),this._media.addEventListener("error",this._onError)}},{key:"_updateDuration",value:(n=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(t){return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._mse){e.next=7;break}if(this._mse.isOpened){e.next=4;break}return e.next=4,this._mse.open();case 4:return e.next=6,this._mse.updateDuration(t);case 6:logger.log(this.TAG,"update duration",t);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"_doAppendWrapper",value:(r=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(){var t;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._meta.samples=this._sampleQueue.slice(),this._meta.baseMediaDecodeTime=this._meta.samples[0].baseMediaDecodeTime,this._sampleQueue=[],e.prev=3,this._inProcessing=!0,e.next=7,this._doAppend(this._meta);case 7:if(t=e.sent,this.isLive&&this._emitTimelineEvents(Events.TIMELINE.UPDATE_SEGMENT_END,t),this._inProcessing=!1,!this._sampleQueue.length){e.next=13;break}return e.next=13,this._doAppendWrapper();case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(3),this._emitTimelineEvents(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.ERROR,this._assembleErr("audio error: ".concat(null===e.t0||void 0===e.t0?void 0:e.t0.message),AUDIO_ERROR_SUBCODE));case 18:case"end":return e.stop()}}),e,this,[[3,15]])}))),function(){return r.apply(this,arguments)})},{key:"_checkAutoPlay",value:function(){var e=this;this._media.addEventListener("canplay",(function t(){var r=e._media.volume;e._media.volume=Math.min(r,.1);var n=e._media.play();(n=n.then?n:Promise.reject()).then((function(){logger.log(e.TAG,"auto play by checkAutoPlay!"),e._audioCanAutoplay=!0})).catch((function(){logger.warn(e.TAG,"can’t auto play!"),e._audioCanAutoplay=!1,e.emit(Events.AUDIO.AUDIO_NOT_ALLOWED_AUTOPLAY)})).finally((function(){e._media.volume=r,e._startRendered||(e._media.pause(),logger.log(e.TAG,"auto paused by checkAutoPlay!")),e._media.removeEventListener("canplay",t)}))}))}},{key:"_destroy",value:(t=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(){var t,r,n;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(logger.log(this.TAG,"destroy audio render"),this._remuxer=null,this.removeAllListeners(),this._media.removeEventListener("canplay",this._onCanplay),this._media.removeEventListener("playing",this._onPlaying),this._media.removeEventListener("waiting",this._onWaiting),this._media.removeEventListener("seeked",this._onSeeked),this._media.removeEventListener("progress",this._onProgress),this._media.removeEventListener("ended",this._onEnded),this._media.removeEventListener("progress",this._onOnceProgress),this._media.removeEventListener("error",this._onError),this._reuseMse){e.next=17;break}return null===(t=this._mse)||void 0===t||t.endOfStream(),e.next=15,null===(r=this._mse)||void 0===r?void 0:r.unbindMedia();case 15:e.next=20;break;case 17:null===(n=this._mse)||void 0===n||n.clearAllBuffer(),mediaCache.cacheMedia({codec:this._codec,media:this._media,mse:this._mse}),logger.log(this.TAG,"cache media for audio play, codec=",this._codec);case 20:this._meta&&(this._meta.duration=0),this._mse=null,this._media=null;case 23:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}],[{key:"isSupported",value:function(){return getDecodeCapacaity().audioWithMse&&!!window.MediaSource&&window.MediaSource.isTypeSupported('video/mp4; codecs="mp4a.40.5"')}}]),o}(),TOLERANCE$1=.1,MAX_TOLERANCE=1,VideoTimeRange=function(){function e(t){_classCallCheck$2(this,e),this.TAG="VideoTimeRange",this._parent=t,this._baseDts=0,this._lastDuration=0,this._duration=0,this._bitrate=0,this._totalSize=0,this._buffers=[],this._currentFrameQueue=[],this._frameIndexInQueue=0,this._delayEstimateList=[],this._keyframeQueue=[]}return _createClass$2(e,[{key:"isLive",get:function(){return this._parent.isLive}},{key:"baseDts",get:function(){return this._baseDts}},{key:"duration",get:function(){return this._duration},set:function(e){this._duration=e}},{key:"buffered",get:function(){var e=this;if(this.isLive)return{length:this._duration?1:0,start:function(){return 0},end:function(){return e._duration}};var t=this._mergeBufferRanges();return{length:t.length,start:function(e){var r=t[e];return r?r.start:0},end:function(e){var r=t[e];return r?r.end:1/0}}}},{key:"bufferStart",get:function(){var e;return(null===(e=this._buffers[0])||void 0===e?void 0:e.start)||0}},{key:"frameLength",get:function(){return this._currentFrameQueue.length}},{key:"keyFrameLength",get:function(){return this._keyframeQueue.length}},{key:"totalSize",get:function(){return this._totalSize}},{key:"bitrate",get:function(){return this._bitrate},set:function(e){this._bitrate=e}},{key:"lastDuration",get:function(){return this._lastDuration}},{key:"frames",get:function(){return this._currentFrameQueue}},{key:"getCurrentTime",value:function(e){return this._lastDuration+(e-this._baseDts)/1e3}},{key:"resetDts",value:function(e){this._baseDts=e}},{key:"_mergeBufferRanges",value:function(){var e=this._buffers.sort((function(e,t){return e.start>t.start?1:-1})),t=e.length,r=[];if(!t)return r;for(var n={start:e[0].start,end:e[0].end},i=1;i<t;i++){var o=e[i];Math.abs(n.end-o.start)<TOLERANCE$1?n.end=o.end:(r.push(n),n={start:o.start,end:o.end})}return r.push(n),r}},{key:"_caclBaseDts",value:function(e){-1===this._baseDts&&e&&(this._baseDts=e.dts,logger.log(this.TAG,"set baseDts: ",this._baseDts,"frame len:",this._currentFrameQueue.length))}},{key:"_updateDuration",value:function(e){for(var t=e.length,r=e[t-1],n=0;n<t;n++){var i=e[n];if(i&&i.options&&i.options.meta){var o=e[n-1]||this._currentFrameQueue[this._currentFrameQueue.length-1];o?this._lastDuration+=(o.dts-this._baseDts)/1e3:this._lastDuration=this._duration,logger.log(this.TAG,"updateBaseDts,record lastDuration:",this._lastDuration),this._baseDts=i.dts;break}}r&&(this._duration=(r.dts-this._baseDts)/1e3+this._lastDuration)}},{key:"_estimateBitRate",value:function(e){var t=e.length;if(t<=2){if(this._delayEstimateList=this._delayEstimateList.concat(e),(t=this._delayEstimateList.length)<=30)return;e=this._delayEstimateList,this._delayEstimateList=[]}for(var r=0,n=0;n<t;n++){var i=e[n];r+=i.data?i.data.length:i.units.reduce((function(e,t){return e+t.byteLength}),0)}this._totalSize+=r;var o=r/(e[t-1].dts-e[0].dts);this._bitrate=parseInt(8e3*o)}},{key:"_beforeAppendVodBuffer",value:function(e){var t=this;if(e.length){for(var r=[],n=[],i=0,o=e.length;i<o;i++)e[i].keyframe&&(r.push(n),n=[]),n.push(e[i]);n.length&&r.push(n),r.forEach((function(e){return t._appendVodBuffer(e)}))}}},{key:"_appendVodBuffer",value:function(e){if(e.length){var t=e[0],r=e[e.length-1],n=(t.dts-this._baseDts)/1e3,i=(r.dts-this._baseDts)/1e3;logger.enable&&logger.log(this.TAG,"add new buffer range [".concat(n," , ").concat(i,"]")),this._buffers.filter((function(e){return n>=e.start&&i<=e.end})).length||(this._buffers.push({start:n,end:i,duartion:i-n,frames:e.slice()}),this._buffers.sort((function(e,t){return e.start>t.start?1:-1})),this._afterAppendVodBuffer())}}},{key:"_afterAppendVodBuffer",value:function(){if(this._buffers.filter((function(e){var t;return!(null!==(t=e.frames[0])&&void 0!==t&&t.keyframe)})).length){for(var e=this._buffers,t=this._buffers.length,r=[],n=this._buffers[0],i=1;i<t;i++){var o;null!==(o=e[i].frames[0])&&void 0!==o&&o.keyframe?(r.push(n),n=e[i]):(n.frames=n.frames.concat(e[i].frames),n.end=e[i].end,n.duartion=n.end-n.start)}r.push(n),this._buffers=r}}},{key:"_recordKeyframes",value:function(e){var t=this;e.forEach((function(e){if(e.keyframe){var r=(e.dts-t._baseDts)/1e3;t._keyframeQueue.push({position:r,frame:e})}})),this._keyframeQueue=this._keyframeQueue.sort((function(e,t){return e.position>t.position?1:-1})),this.isLive&&this._keyframeQueue.length>40&&this._keyframeQueue.splice(0,20)}},{key:"toAnnexBNalu",value:function(e){e.forEach((function(e){var t=e.units;if(t){var r=t.reduce((function(e,t){return e+4+t.byteLength}),0),n=new Uint8Array(r),i=0;t.forEach((function(e){n.set([0,0,0,1],i),i+=4,n.set(e,i),i+=e.byteLength})),e.units=null,e.data=n}}))}},{key:"append",value:function(e,t,r){r&&this.toAnnexBNalu(e),this._caclBaseDts(e[0]),t&&this._updateDuration(e),this._estimateBitRate(e),this._recordKeyframes(e),this.isLive?this._currentFrameQueue=this._currentFrameQueue.concat(e):this._beforeAppendVodBuffer(e)}},{key:"updateSegmentEnd",value:function(e){var t=this._buffers[this._buffers.length-1];t&&(Math.abs(t.end-e)<.5||(t.end=e,t.duartion=e-t.start,logger.log(this.TAG,"video data lack, reset end:",e)))}},{key:"getFrame",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.isLive)return this._currentFrameQueue.shift();if(!(e=this._currentFrameQueue[this._frameIndexInQueue])){if(!(e=this._currentFrameQueue[--this._frameIndexInQueue]))return;if(!this.switchBuffer((e.dts-this._baseDts)/1e3,this._frameIndexInQueue++,t))return;return this.getFrame(++t)}return this._frameIndexInQueue++,e}},{key:"getFramesForPreciseSeek",value:function(e){return this._currentFrameQueue.filter((function(t){return t.dts<=e}))}},{key:"updateFrameIndexForPreciseSeek",value:function(e){this._frameIndexInQueue=e}},{key:"switchBuffer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!((arguments.length>2&&void 0!==arguments[2]?arguments[2]:0)>=20)){e=e||this.bufferStart;var r=this._buffers.filter((function(t){return t.start<e+TOLERANCE$1&&t.end>=e+TOLERANCE$1}))[0];if(!r){var n=this._buffers.find((function(t){return t.start>=e}));return n&&n.start-e<MAX_TOLERANCE?(this._currentFrameQueue=n.frames.slice(0),this._frameIndexInQueue=0,n):void 0}return r.frames[0].dts>=e?(this._currentFrameQueue=r.frames.slice(0),this._frameIndexInQueue=0,logger.log(this.TAG,"switch video buffer, time:".concat(e," , buffer:[").concat(r.start," , ").concat(r.end,"], index=0")),r):r.frames.length>t?(this._currentFrameQueue=r.frames.slice(0),logger.log(this.TAG,"switch video buffer, in the same gop and more frame got, time:".concat(e," , buffer:[").concat(r.start," , ").concat(r.end,"], index=").concat(t)),r):void logger.log(this.TAG,"switch video buffer, in the same gop and no more frame got, time:".concat(e," , buffer:[").concat(r.start," , ").concat(r.end,"], index=").concat(t))}}},{key:"getSeekStartPosition",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(this._keyframeQueue.forEach((function(r){r.position<=e&&(t=r)})),t)return e-t.position<r?t:void 0}},{key:"nextFrame",value:function(){return this._currentFrameQueue[0]}},{key:"deletePassed",value:function(e){this._currentFrameQueue=this._currentFrameQueue.filter((function(t){return t.dts>=e}))}},{key:"getDtsOfTime",value:function(e){var t=e-this._lastDuration;return this._baseDts+1e3*t}},{key:"clean",value:function(){this._currentFrameQueue=[]}},{key:"destroy",value:function(){this._currentFrameQueue=[],this._buffers=[]}}]),e}();function _checkClose(e){var t;(null===(t=e.buffer)||void 0===t?void 0:t.close)&&e.buffer.close()}var FrameQueue=function(){function e(t){_classCallCheck$2(this,e),this.TAG="FrameQueue",this._parent=t,this._lastGopId=0,this._frames=[]}return _createClass$2(e,[{key:"currentTimeDts",get:function(){return this._parent.preciseVideoDts}},{key:"length",get:function(){return this._frames.length}},{key:"frames",get:function(){return this._frames}},{key:"append",value:function(e){e.info?this._frames.push(e):_checkClose(e)}},{key:"appendVodFrame",value:function(e){this._frames.push(e)}},{key:"nextFrame",value:function(){var e=this._frames.length;return 1===this._parent.noAudio&&e>3&&(this._frames=this._frames.slice(e-2)),this._frames[0]}},{key:"shift",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=this._frames.shift();return this.deletePassed(e),t}},{key:"deletePassed",value:function(e){this._frames=this._frames.filter((function(t){return!!(t.info&&t.info.dts>e)||(_checkClose(t),!1)}))}},{key:"empty",value:function(){this._frames.forEach((function(e){return _checkClose(e)})),this._frames=[]}},{key:"destroy",value:function(){this.empty(),this._lastGopId=0}}]),e}(),createTypedArrayConstructor=typedArrayConstructorExports;createTypedArrayConstructor("Float32",(function(e){return function(t,r,n){return e(this,t,r,n)}}));var FrameRenderCache=function(){function e(){_classCallCheck$2(this,e),_defineProperty$2(this,"_queue",[]),_defineProperty$2(this,"TAG","FrameRenderCache")}return _createClass$2(e,[{key:"cacheCvs",value:function(e){this._queue.push(e),logger.log(this.TAG,"cache canvas!")}},{key:"getCachedCvs",value:function(){var e=this._queue.pop();return e&&logger.log(this.TAG,"get cached canvas!"),e}}]),e}(),frameRenderCache=new FrameRenderCache,FrameRender=function(){function e(t,r){_classCallCheck$2(this,e),this.TAG="FrameRender",this.configs=Object.assign({},t),this.parent=r,this.canvas=this.configs.canvas,this.canvas.glInstance=this,this.meta=Object.assign({},this.configs.meta),this.frameRenderCache=frameRenderCache,this._initMeta(),this._initContextGL(),this.contextGL&&(this._initProgram(),this._initBuffers(),this._initTextures())}return _createClass$2(e,[{key:"_initMeta",value:function(){this.chroma=this.meta.chromaFormat,this.height=this.meta.height,this.width=this.meta.width,this.canvas.width===this.meta.width&&this.canvas.height===this.meta.height||(this.canvas.width=this.meta.width,this.canvas.height=this.meta.height,this.parent.emitResizeEvent())}},{key:"_initContextGL",value:function(){if("2d"!==this.configs.type){for(var e=this.canvas,t=null,r=["webgl","experimental-webgl","moz-webgl","webkit-3d"],n=0;!t&&n<r.length;){var i=r[n];try{t=e.getContext(i,this.configs.glCtxOptions),logger.log("FrameRender","use=",i,this.configs.glCtxOptions);break}catch(e){t=null}t&&"function"==typeof t.getParameter||(t=null),++n}this.contextGL=t}else this.ctx=this.canvas.getContext("2d")}},{key:"_initProgram",value:function(){var e=this.contextGL,t=["attribute vec4 vertexPos;","attribute vec4 texturePos;","attribute vec4 uTexturePos;","attribute vec4 vTexturePos;","varying vec2 textureCoord;","varying vec2 uTextureCoord;","varying vec2 vTextureCoord;","void main()","{"," gl_Position = vertexPos;"," textureCoord = texturePos.xy;"," uTextureCoord = uTexturePos.xy;"," vTextureCoord = vTexturePos.xy;","}"].join("\n"),r=["precision highp float;","varying highp vec2 textureCoord;","varying highp vec2 uTextureCoord;","varying highp vec2 vTextureCoord;","uniform sampler2D ySampler;","uniform sampler2D uSampler;","uniform sampler2D vSampler;","uniform mat4 YUV2RGB;","void main(void) {"," highp float y = texture2D(ySampler, textureCoord).r;"," highp float u = texture2D(uSampler, uTextureCoord).r;"," highp float v = texture2D(vSampler, vTextureCoord).r;"," gl_FragColor = vec4(y, u, v, 1) * YUV2RGB;","}"].join("\n"),n=e.createShader(e.VERTEX_SHADER);e.shaderSource(n,t),e.compileShader(n),e.getShaderParameter(n,e.COMPILE_STATUS)||console.log("Vertex shader failed to compile: "+e.getShaderInfoLog(n));var i=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(i,r),e.compileShader(i),e.getShaderParameter(i,e.COMPILE_STATUS)||console.log("Fragment shader failed to compile: "+e.getShaderInfoLog(i));var o=e.createProgram();e.attachShader(o,n),e.attachShader(o,i),e.linkProgram(o),e.getProgramParameter(o,e.LINK_STATUS)||console.log("Program failed to compile: "+e.getProgramInfoLog(o)),e.useProgram(o);var a=e.getUniformLocation(o,"YUV2RGB");e.uniformMatrix4fv(a,!1,[1.16438,0,1.59603,-.87079,1.16438,-.39176,-.81297,.52959,1.16438,2.01723,0,-1.08139,0,0,0,1]),this.shaderProgram=o}},{key:"_initBuffers",value:function(){var e=this.contextGL,t=this.shaderProgram,r=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,r),e.bufferData(e.ARRAY_BUFFER,new Float32Array([1,1,-1,1,1,-1,-1,-1]),e.STATIC_DRAW);var n=e.getAttribLocation(t,"vertexPos");e.enableVertexAttribArray(n),e.vertexAttribPointer(n,2,e.FLOAT,!1,0,0);var i=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,i),e.bufferData(e.ARRAY_BUFFER,new Float32Array([1,0,0,0,1,1,0,1]),e.STATIC_DRAW);var o=e.getAttribLocation(t,"texturePos");e.enableVertexAttribArray(o),e.vertexAttribPointer(o,2,e.FLOAT,!1,0,0),this.texturePosBuffer=i;var a=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,a),e.bufferData(e.ARRAY_BUFFER,new Float32Array([1,0,0,0,1,1,0,1]),e.STATIC_DRAW);var s=e.getAttribLocation(t,"uTexturePos");e.enableVertexAttribArray(s),e.vertexAttribPointer(s,2,e.FLOAT,!1,0,0),this.uTexturePosBuffer=a;var c=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,c),e.bufferData(e.ARRAY_BUFFER,new Float32Array([1,0,0,0,1,1,0,1]),e.STATIC_DRAW);var u=e.getAttribLocation(t,"vTexturePos");e.enableVertexAttribArray(u),e.vertexAttribPointer(u,2,e.FLOAT,!1,0,0),this.vTexturePosBuffer=c}},{key:"_initTextures",value:function(){var e=this.contextGL,t=this.shaderProgram,r=this._initTexture(),n=e.getUniformLocation(t,"ySampler");e.uniform1i(n,0),this.yTextureRef=r;var i=this._initTexture(),o=e.getUniformLocation(t,"uSampler");e.uniform1i(o,1),this.uTextureRef=i;var a=this._initTexture(),s=e.getUniformLocation(t,"vSampler");e.uniform1i(s,2),this.vTextureRef=a,e.pixelStorei(e.UNPACK_ALIGNMENT,1)}},{key:"_initTexture",value:function(){var e=this.contextGL,t=e.createTexture();return e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.bindTexture(e.TEXTURE_2D,null),t}},{key:"_drawPictureGL",value:function(e,t,r,n,i){var o=n*r,a=i*r/2;444!==this.chroma&&422!==this.chroma||(a*=2);var s={yData:(e=new Uint8Array(e)).subarray(0,o),uData:e.subarray(o,o+a),vData:e.subarray(o+a,o+a+a)};this._drawPictureGL420(s,t,r,n,i)}},{key:"_drawPictureGL420",value:function(e,t,r,n,i){var o=this.contextGL,a=this.texturePosBuffer,s=this.uTexturePosBuffer,c=this.vTexturePosBuffer,u=this.yTextureRef,l=this.uTextureRef,A=this.vTextureRef,d=e.yData,h=e.uData,f=e.vData,p=n,y=r,_=i,E=r/2;422!==this.chroma&&444!==this.chroma||(E=r);var g=i,m=E,$=this.canvas.width/this.width,v=this.canvas.height/this.height,T=0,b=0,I=this.canvas.width,S=this.canvas.height;$<v?(S=this.height*this.canvas.width/this.width,b=parseInt((this.canvas.height-this.height*this.canvas.width/this.width)/2)):(I=this.width*this.canvas.height/this.height,T=parseInt((this.canvas.width-this.width*this.canvas.height/this.height)/2)),o.viewport(T,b,I,S);var R=new Float32Array([1,0,0,0,1,1,0,1]);o.bindBuffer(o.ARRAY_BUFFER,a),o.bufferData(o.ARRAY_BUFFER,R,o.DYNAMIC_DRAW);var O=new Float32Array([1,0,0,0,1,1,0,1]);o.bindBuffer(o.ARRAY_BUFFER,s),o.bufferData(o.ARRAY_BUFFER,O,o.DYNAMIC_DRAW);var C=new Float32Array([1,0,0,0,1,1,0,1]);o.bindBuffer(o.ARRAY_BUFFER,c),o.bufferData(o.ARRAY_BUFFER,C,o.DYNAMIC_DRAW),o.activeTexture(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,u),o.texImage2D(o.TEXTURE_2D,0,o.LUMINANCE,p,y,0,o.LUMINANCE,o.UNSIGNED_BYTE,d),o.activeTexture(o.TEXTURE1),o.bindTexture(o.TEXTURE_2D,l),o.texImage2D(o.TEXTURE_2D,0,o.LUMINANCE,_,E,0,o.LUMINANCE,o.UNSIGNED_BYTE,h),o.activeTexture(o.TEXTURE2),o.bindTexture(o.TEXTURE_2D,A),o.texImage2D(o.TEXTURE_2D,0,o.LUMINANCE,g,m,0,o.LUMINANCE,o.UNSIGNED_BYTE,f),o.drawArrays(o.TRIANGLE_STRIP,0,4)}},{key:"_drawPicture2d",value:function(e){if(e&&this.canvas){this.ctx||(this.ctx=this.canvas.getContext("2d"));var t=e.displayWidth||e.width,r=e.displayHeight||e.height;this.canvas.height===r&&this.canvas.width===t||(this.canvas.height=r,this.canvas.width=t);try{this.ctx.drawImage(e.dom||e,0,0,t,r)}catch(t){console.error(this.TAG,"_drawPicture2d",e,e.dom,t,t.message)}}}},{key:"_resize",value:function(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this.canvas.width=e,this.canvas.height=t,this.parent.emitResizeEvent())}},{key:"render",value:function(e,t,r,n,i){this._resize(t,r),this.contextGL?this._drawPictureGL(e,t,r,n,i):this._drawPicture2d(e)}},{key:"resetMeta",value:function(e){this.meta=Object.assign({},e)}},{key:"updateBind",value:function(e,t){this.parent=e,this.resetMeta(t)}},{key:"destroy",value:function(e){this.parent=null,this.canvas.style.display="none",e&&(this.contextGL&&this.contextGL.clear(this.contextGL.DEPTH_BUFFER_BIT|this.contextGL.COLOR_BUFFER_BIT),frameRenderCache.cacheCvs(this.canvas))}}]),e}(),MAX_QUEUE_LENGTH=5,DecodeEstimate=function(){function e(t){_classCallCheck$2(this,e),_defineProperty$2(this,"_lowDecodeThreshold",getDecodeCapacaity().lowDecodeThreshold/MAX_QUEUE_LENGTH),this.TAG="DecodeEstimate",this._needEstimate=!0,this._parent=t,this._lastDecodeDot=0,this._lastDecodeCost=0,this._lastFrameDts=0,this._dtsDeltas=[],this._decodeCosts=[],this._lowDecodeQueue=[],this._fps=0,this._decodeFps=0,this._gopLength=0,this._webcodec=!1}return _createClass$2(e,[{key:"fps",get:function(){return this._fps}},{key:"decodeFps",get:function(){return this._decodeFps}},{key:"decodeCost",get:function(){return this._lastDecodeCost}},{key:"gopLength",get:function(){return this._gopLength}},{key:"webcodec",set:function(e){this._webcodec=e}},{key:"updateGopCount",value:function(){this._gopLength++}},{key:"needEstimateFps",value:function(){this._needEstimate=!0}},{key:"addDecodeInfo",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{dts:0};this._estimateDecodeFps(e),this._estimateFps(e)}},{key:"resetDecodeDot",value:function(e){this._lastDecodeDot=e||0}},{key:"reset",value:function(){this._decodeCosts=[],this._lowDecodeQueue=[]}},{key:"_estimateFps",value:function(e){if(this._needEstimate)if(this._lastFrameDts){var t=e.dts-this._lastFrameDts;if(this._lastFrameDts=e.dts,!(Math.abs(t)>200)){this._dtsDeltas.push(t);var r=this._dtsDeltas.length;r<MAX_QUEUE_LENGTH||(this._fps=Math.ceil(1e3/this._avg(this._dtsDeltas,r)),logger.log(this.TAG,"estimate fps:",this._fps),this._needEstimate=!1)}}else this._lastFrameDts=e.dts}},{key:"_estimateDecodeFps",value:function(e){if(this._lastDecodeDot){var t=performance.now(),r=t-this._lastDecodeDot;this._lastDecodeDot=t,e.cost=r,this._lastDecodeCost=r,this._decodeCosts.push(r);var n=this._decodeCosts.length;if(!(n<MAX_QUEUE_LENGTH)){var i=this._avg(this._decodeCosts,n);this._decodeFps=Math.floor(1e3/i),this._decodeCosts=[],this._lowDecodeDetect()}}else this._lastDecodeDot=performance.now()}},{key:"_avg",value:function(e,t){var r=e.reduce((function(e,t){return e+=t}),0);return Math.floor(r/t)||1}},{key:"_lowDecodeDetect",value:function(){this._decodeFps?(this._decodeFps<this._fps*this._parent.playbackRate+(this.webcodec?0:3)?this._lowDecodeQueue.push(this._decodeFps):this._lowDecodeQueue.pop(),this._lowDecodeQueue.length>this._lowDecodeThreshold&&(this._lowDecodeQueue=[],logger.log(this.TAG,"解码效率过低,应该降级"),this._parent.emit(Events.VIDEO.DECODE_LOW_FPS))):this._parent.emit(Events.VIDEO.DECODE_LOW_FPS)}}]),e}(),shell="\n var timer;\n\n function initTimer (interval) {\n destroy()\n clearInterval(timer);\n timer = setInterval(() => {\n self.postMessage({type: 'NEXT_TICK'});\n }, interval)\n }\n\n function destroy () {\n clearInterval(timer);\n }\n\n self.onmessage = function (e) {\n var {type,interval} = e.data;\n switch (type) {\n case 'START':\n initTimer(interval);\n break;\n case 'DESTROY':\n destroy();\n break;\n }\n }\n",timerWorkerCache=[],TickTimer=function(){function e(t){var r=this;_classCallCheck$2(this,e),_defineProperty$2(this,"_doTask",(function(){var e;null===(e=r._task)||void 0===e||e.call(r)})),this._task=t;var n=new Blob([shell],{type:"application/javascript"});this._worker=timerWorkerCache.pop()||new Worker(URL.createObjectURL(n)),this._bindEvent()}return _createClass$2(e,[{key:"_bindEvent",value:function(){this._worker.addEventListener("message",this._doTask)}},{key:"start",value:function(e){(e=parseInt(e))<10&&(e=10),e>60?e=60:e>25&&(e=25),this._worker.postMessage({type:"START",interval:e})}},{key:"stop",value:function(){this._worker.postMessage({type:"DESTROY"})}},{key:"destroy",value:function(){this._worker&&(this._worker.postMessage({type:"DESTROY"}),this._worker.removeEventListener("message",this._doTask),timerWorkerCache.push(this._worker),logger.log("TickTimer","unbind timer event"),this._worker=null,this._task=null)}}]),e}(),HAVE_NOTHING=0,HAVE_METADATA=1,HAVE_CURRENT_DATA=2,HAVE_FUTURE_DATA=3,HAVE_ENOUGH_DATA=4,MEDIA_ERR_DECODE=3,VideoBaseRender=function(e){_inherits$1(r,BaseRender);var t=_createSuper$1(r);function r(e,n){var i;return _classCallCheck$2(this,r),(i=t.call(this,e,n))._timeRange=new VideoTimeRange(_assertThisInitialized$1(i)),i._decodeEstimate=new DecodeEstimate(_assertThisInitialized$1(i)),i._frameQueue=new FrameQueue(_assertThisInitialized$1(i)),i._lastTimeupdate=0,i._renderCost=0,i._canAutoPlay=!0,i._videoDecode=!1,i._inSeeking=!1,i._frameRender=null,i._configuration=null,i._render=i._render.bind(_assertThisInitialized$1(i)),i._tickTimer=new TickTimer(i._render),i._initCanvas(e),i._bindEvents(),i}return _createClass$2(r,[{key:"canAutoPlay",get:function(){return this._canAutoPlay}},{key:"canvas",get:function(){return this._canvas}},{key:"timescale",get:function(){return 1e3}},{key:"fps",get:function(){return this._decodeEstimate.fps||this._meta&&this._meta.fpsNum/this._meta.fpsDen||24}},{key:"decodeFps",get:function(){return this._decodeEstimate.decodeFps}},{key:"decodeCost",get:function(){return this._decodeEstimate.decodeCost}},{key:"renderCost",get:function(){return this._renderCost}},{key:"totalSize",get:function(){return this._timeRange.totalSize}},{key:"bitrate",get:function(){return this._timeRange.bitrate},set:function(e){this._timeRange.bitrate=e}},{key:"gopLength",get:function(){return this._decodeEstimate.gopLength}},{key:"is540p",get:function(){return this._canvas.height<720}},{key:"buffered",get:function(){return this._timeRange.buffered}},{key:"inSeeking",get:function(){return this._inSeeking}},{key:"interval",get:function(){return Math.floor(1e3/this.fps/this.playbackRate)}},{key:"playbackRate",get:function(){return this._playbackRate||1}},{key:"baseDts",get:function(){return this._timeRange.baseDts}},{key:"currentTime",get:function(){return this._timeRange.getCurrentTime(this.preciseVideoDts)}},{key:"timelinePosition",get:function(){return this._parent.timelinePosition}},{key:"lastTimelinePosition",get:function(){return this._lastTimelinePosition||0},set:function(e){this._lastTimelinePosition=e}},{key:"audioSyncDts",get:function(){return this._audioDts||this.baseDts},set:function(e){this._audioDts=e}},{key:"preciseVideoDts",get:function(){return this.audioSyncDts+Math.floor(1e3*(this.timelinePosition-this.lastTimelinePosition))}},{key:"readyState",get:function(){var e=this._frameQueue.length||(this.currentTime?1:0);return e?e>=8?HAVE_ENOUGH_DATA:e>=4?HAVE_FUTURE_DATA:e>=2?HAVE_CURRENT_DATA:HAVE_METADATA:HAVE_NOTHING}},{key:"isHevc",get:function(){return!("hev1.1.6.L93.B0"!==(this._meta||{}).codec)}},{key:"videoDecode",get:function(){return this._videoDecode}},{key:"decoderMode",get:function(){var e;return null===(e=this._decodeController)||void 0===e?void 0:e.decoderMode}},{key:"configuration",get:function(){var e,t;return this._configuration||(this._configuration=this._meta.configuration||getAvcc(null===(e=this._meta)||void 0===e?void 0:e.sps[0],null===(t=this._meta)||void 0===t?void 0:t.pps[0])),this._configuration},set:function(e){this._configuration=e.configuration||getAvcc(e.sps[0],e.pps[0])}},{key:"setSeekingStatus",value:function(e){this._inSeeking=e}},{key:"getDtsOfTime",value:function(e){return this._timeRange.getDtsOfTime(e)}},{key:"updateReady",value:function(){this._whenReady()}},{key:"forceRender",value:function(){this._render(!0)}},{key:"getSeekStartPosition",value:function(e,t){return this._timeRange.getSeekStartPosition(e,t)}},{key:"canSeek",value:function(){throw new Error("need override by children")}},{key:"emitResizeEvent",value:function(){null==this||this._emitTimelineEvents(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.RESIZE)}},{key:"_assembleErr",value:function(e,t){var r=new Error(e);return r.code=MEDIA_ERR_DECODE,r.subCode=t,r}},{key:"_emitTimelineEvents",value:function(e,t,r){var n;null===(n=this._parent)||void 0===n||n.emit(e,t,r)}},{key:"_initCanvas",value:function(e){e.canvas?this._canvas=e.canvas:this._canvas=frameRenderCache.getCachedCvs()||document.createElement("canvas"),this._canvas.style.margin="auto",this._canvas.style.position="absolute",this._canvas.style.pointerEvents="none"}},{key:"_bindEvents",value:function(){var e=this;_get(_getPrototypeOf$1(r.prototype),"_bindEvents",this).call(this);var t=function(t){var r=t.width,n=t.height,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=e._canvas,s=a.width,c=a.height,u=n*s/c,l=r*c/s,A=r-u,d=n-l,h=A*i+"px",f=d*o+"px";e._canvas.style.left=h,e._canvas.style.top=f,logger.warn(e.TAG,"cvsWidth=".concat(s,", cvsHeight=").concat(c,", scaleCvsWidth=").concat(u,", scaleCvsHeight=").concat(l)),logger.warn(e.TAG,"cover position: deltaX=".concat(A,", deltaY=").concat(d,", width=").concat(r,", height=").concat(n,", pX=").concat(h,", pY=").concat(f))};this._parent.on(Events.VIDEO.UPDATE_VIDEO_FILLTYPE,(function(r,n){var i=n.width,o=n.height,a=e._canvas,s=a.width,c=a.height,u=!i||i/o>s/c;if(logger.warn(e.TAG,"UPDATE_VIDEO_FILLTYPE isGapX =",u,"type =",r,s,c,i,o),e._canvas.style.maxWidth="initial",e._canvas.style.maxHeight="initial","cover"===r)return u?(e._canvas.style.left=0,e._canvas.style.top=0,e._canvas.style.height="auto",e._canvas.style.width="100%",void t({width:i,height:o},0,.5)):(e._canvas.style.left=0,e._canvas.style.top=0,e._canvas.style.width="auto",e._canvas.style.height="100%",void t({width:i,height:o},.5,0));if("fill"===r)return e._canvas.style.width="100%",void(e._canvas.style.height="100%");(e._canvas.style.top=0,e._canvas.style.bottom=0,e._canvas.style.left=0,e._canvas.style.right=0,e._canvas.style.maxWidth="100%",e._canvas.style.maxHeight="100%",e._canvas.style.width="initial",e._canvas.style.height="initial",s<i&&c<o)&&(s/i>c/o?e._canvas.style.width="100%":e._canvas.style.height="100%")})),this._parent.on(Events.VIDEO.UPDATE_VIDEO_COVER_POSITION,t),this._parent.on(Events.TIMELINE.SYNC_DTS,(function(t){var r,n=e._frameQueue.nextFrame(),i=n&&n.info&&n.info.dts;if(e.lastTimelinePosition=e.timelinePosition,e.noAudio){var o=e._timeRange.nextFrame();t=t||i||o&&o.dts||0}if(e.audioSyncDts=t,i&&i-t>500&&e._emitTimelineEvents(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.LARGE_AV_GAP,{aDts:t,vDts:i,frameLength:e._frameQueue.length,currentTime:e._parent.currentTime,duration:e._parent.duration}),logger.log(e.TAG,"audio current buffer play finish, next buffer dts=",t,"currentTime:",e._parent.currentTime,"preciseVideoDts:",e.preciseVideoDts,"next video frame dts:",i,"frame length:",e._frameQueue.length),!(e._isLive||null!==(r=e._parent)&&void 0!==r&&r.seeking)){var a=e._timeRange.nextFrame();if(a){var s=(a.dts-a.baseDts)/1e3;e._parent.currentTime-s>1&&(logger.warn(e.TAG,"丢帧!"),e.ajustSeekTime(e._parent.currentTime))}}})),this._parent.on(Events.TIMELINE.UPDATE_GL_OPTIONS,(function(t){e._config.glCtxOptions=t})),this._parent.on(Events.TIMELINE.UPDATE_SEGMENT_END,this._updateSegmentEnd.bind(this)),this.on(Events.VIDEO.AUTO_RUN,this._startRender.bind(this)),this._parent.on(Events.TIMELINE.SET_PLAYBACKRATE,(function(t){e._playbackRate=t,e._startRender()}))}},{key:"ajustSeekTime",value:function(){throw new Error("need override by children")}},{key:"_resetDts",value:function(e,t){"audio"!==t&&this._timeRange.resetDts(e)}},{key:"_setMetadata",value:function(e,t){if("audio"!==e){logger.warn(this.TAG,"video set metadata"),this._meta=t;var r=t&&t.frameRate&&t.frameRate.fps;r?logger.log(this.TAG,"detect fps:",r):logger.warn(this.TAG,"no detect fps,start estimate"),this._initDecoder()}}},{key:"_initDecoder",value:function(){throw new Error("need override by children")}},{key:"_whenDecoderReady",value:function(){throw new Error("need override by children")}},{key:"_appendChunk",value:function(){throw new Error("need override by children")}},{key:"_startDecode",value:function(){throw new Error("need override by children")}},{key:"_receiveFrame",value:function(e,t){if(this._parent&&this._timeRange){var r=e.info||{};if(this._decodeEstimate.addDecodeInfo(r),!this._isLive&&((r.output||r.keyframe)&&(this.setSeekingStatus(!1),logger.warn(this.TAG,"set seeking status=",!1)),this.inSeeking))return logger.log(this.TAG,"drop frame"),void _checkClose(e);this._isLive?this._frameQueue.append(e):this._frameQueue.appendVodFrame(e),t&&t(),this._ready||this.readyState>=HAVE_METADATA&&this._whenReady()}}},{key:"_startRender",value:function(){logger.log(this.TAG,"start render"),this._tickTimer.start(this.interval)}},{key:"_render",value:function(){throw new Error("need override by children")}},{key:"_updateSegmentEnd",value:function(){throw new Error("need override by children")}},{key:"_whenReady",value:function(){this._ready=!0,this.emit(Events.VIDEO.VIDEO_READY),this.noAudio&&this._emitTimelineEvents(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.PLAYING)}},{key:"_doPlay",value:function(){this._tickTimer.start()}},{key:"_doPause",value:function(){this._tickTimer.stop()}},{key:"_doSeek",value:function(){this._ready=!1,this._frameQueue.destroy()}},{key:"_doChaseFrame",value:function(){throw new Error("need override by children")}},{key:"destroy",value:function(e){var t,r,n,i;null===(t=this._tickTimer)||void 0===t||t.destroy(),null===(r=this._timeRange)||void 0===r||r.destroy(),null===(n=this._frameQueue)||void 0===n||n.destroy(),null===(i=this._frameRender)||void 0===i||i.destroy(e),this._tickTimer=null,this._canvas=null,this._timeRange=null,this._frameQueue=null,this._frameRender=null,this._decodeEstimate=null,this._parent=null,this.removeAllListeners()}}]),r}(),DEFAULT_PLAYBACKRATE=2,CANVAS_COUNT=45,FRAME_DURATION=25,MAX_VIDEO_HEIGHT=720,MAX_FPS=30,MIN_FPS=15,VideoDecoder=function(e){_inherits$1(r,EventEmitter);var t=_createSuper$1(r);function r(e){var n;return _classCallCheck$2(this,r),(n=t.call(this)).TAG="VideoDecoder",n._video=n._createVideo(),n._IsInDecoding=!1,n._fps=0,n._framId=null,n._screenShotNum=0,n._allPicNum=0,n._currentBlob=null,n._basePTS=0,n._totleTime=0,n._isVideoONRun=!0,n.firstEmit=!1,n.ptsArray=[],n._currentCanvasHeight=0,n._canvasList=[],n._realFrameDuration=FRAME_DURATION,n._maxVideoHeight=e.maxVideoHeight||MAX_VIDEO_HEIGHT,n._minFPSTime=0,n._maxFPSTime=0,n._playFailed=!1,n._isPhoneSafari=!1,n._createCanvasList(),n._bindEvents(),n}return _createClass$2(r,[{key:"_createCanvasList",value:function(){this._canvas=document.createElement("canvas"),this._ctx=this._canvas.getContext("2d",{alpha:!1});for(var e=0;e<CANVAS_COUNT;e++){var t=this._createCanvas(),r=t.dom,n=t.ctx;this._canvasList.push({dom:r,ctx:n})}}},{key:"_createCanvas",value:function(){var e=document.createElement("canvas"),t=e.getContext("2d");return{dom:e,ctx:t}}},{key:"_createVideo",value:function(){var e=document.createElement("video");return e.setAttribute("muted",!0),e.setAttribute("autoplay",!0),e.setAttribute("controls",!0),e.setAttribute("webkit-playsinline",!0),e.setAttribute("playsinline",!0),e.setAttribute("x5-video-player-type","h5"),e.setAttribute("x5-video-player-type","h5-page"),e.style.position="absolute",e}},{key:"_initVideo",value:function(e,t){if(e.blobUrl&&void 0!==e.dts){var r=e.blobUrl;this._currentBlob=r,this._basePTS=e.dts,this._currentDuration=e.duration;try{logger.log(this.TAG,"_initVideo, basePTS:",e.dts),this._setVideoSrc(r,t),this._video.paused&&this._videoPlay("_initVideo")}catch(e){console.error(this.TAG,"_initVideo, load error",e)}}else console.error(this.TAG,"_initVideo","input info is error, blobUrl:",e.blobUrl,"dts:",e.dts)}},{key:"_setVideoSrc",value:function(e,t){try{var r=this._video;r.src=e,r.load(),r.playbackRate=DEFAULT_PLAYBACKRATE}catch(e){console.error(this.TAG,"_setVideoSrc",e)}}},{key:"_videoPlay",value:function(e){var t=this,r=this._video;if(logger.log(this.TAG,"_videoPlay, video is pause:",r.paused,e),r&&r.paused){var n=r.play();void 0!==n&&n.then((function(){t._playFailed=!1,logger.log(t.TAG,"_videoPlay success")})).catch((function(e){console.error(t.TAG,"_videoPlay failed,",e.message),t._playFailed=!0,t.emit(Events.DECODE_EVENTS.PLAY_FAILED,t.firstEmit)}))}}},{key:"_removeEvents",value:function(){var e=this._video;e.removeEventListener("playing",this._onPlaying.bind(this)),e.removeEventListener("ended",this._onEnded.bind(this)),e.removeEventListener("error",this._onError.bind(this)),e.removeEventListener("loadeddata",this._onLoadeddata.bind(this)),e.removeEventListener("timeupdate",this._onTimeUpdate.bind(this))}},{key:"_bindEvents",value:function(){var e=this,t=this._video;t?(document.addEventListener("visibilitychange",this._onVisibilityChange.bind(this)),t.addEventListener("playing",this._onPlaying.bind(this)),t.addEventListener("ended",this._onEnded.bind(this)),t.addEventListener("error",this._onError.bind(this)),t.addEventListener("loadeddata",this._onLoadeddata.bind(this)),t.addEventListener("timeupdate",this._onTimeUpdate.bind(this)),t.addEventListener("pause",(function(){logger.log("on pause, currentTime, duration:",e._vCurrentTime,e._vDuration)})),this.on("outputresolutionchange",this._onChange.bind(this)),this.on("fpsreduce",(function(t){e._adaptFrameDuration(t)}))):console.error(this.TAG,"_bindEvents")}},{key:"_onTimeUpdate",value:function(){this._lastCurrentTime=this._vCurrentTime}},{key:"_onVisibilityChange",value:function(){this._isVideoONRun="visible"===document.visibilityState}},{key:"_onChange",value:function(e,t){this._width=e,this._height=t}},{key:"_onPlaying",value:function(){this._IsInDecoding&&(console.warn(this.TAG,"_onPlaying","last video not correct end"),this._framId&&(window.cancelAnimationFrame(this._framId),this._framId=null)),logger.log(this.TAG,"_onPlaying, video duration:",this._vDuration,"currentTime:",this._vCurrentTime,"_lastPts:",this._lastPts),this._isInDecoding=!0,this._lastCurrentTime=this._vCurrentTime,this.ptsArray=[],this.playingTime||(this.playingTime=!0),this._getFrame()}},{key:"_onEnded",value:function(e,t){logger.log(this.TAG,"_onEnded","current fmp4 duration is:",this._vDuration,"_isInDecoding:",this._isInDecoding,"_lastPts:",this._lastPts,"_realFrameDuration:",this._realFrameDuration,"from:",t),this._isInDecoding&&(this._isInDecoding=!1,this._lastMp4Duration=Math.min(this._vDuration,this._vCurrentTime),this._framId&&(logger.log(this.TAG,"_onEnded","cancelAnimationFrame"),window.cancelAnimationFrame(this._framId),this._framId=null),this._decodeFPS=parseInt(this._screenShotNum/(this._vDuration/1e3)),this.emit("fps",this._screenShotNum,this._totleTime,this._vDuration,this._metaFPS,{height:this._currentCanvasHeight,relHeight:this._video.videoHeight}),logger.log("_timePerFrame",this._totleTime/this._screenShotNum),this._timePerFrame=this._totleTime/this._screenShotNum,this._screenShotNum=0,this._allPicNum=0,this._totleTime=0,this._currentBlob&&(URL.revokeObjectURL(this._currentBlob),this._currentBlob=null,this._basePTS=0),this.emit(Events.DECODE_EVENTS.FRAGMENT_END,this._decodeFPS,this._video.duration))}},{key:"_onError",value:function(){this._isInDecoding=!1;var e=this._video;console.error("video error:",e.error.code,e.error.message),this.emit("error",e.error,this.firstEmit)}},{key:"_onLoadeddata",value:function(){var e=this,t=this._video;t.currentTime=.001,this.firstEmit||(this._playFailed?(t.style.visibility="hidden",this.emit(Events.DECODE_EVENTS.APPEND_VIDEO,t),setTimeout((function(){logger.log(e.TAG,"onloadeddata, setTimeout firstEmit:",e.firstEmit),e._getFirstFrame()}),40)):(logger.log(this.TAG,"onloadeddata, firstEmit:",this.firstEmit),this._getFirstFrame()))}},{key:"_getFirstFrame",value:function(){this.firstTime=Date.now();var e=this._vCurrentTime,t=this._basePTS+e,r=this._getImageData(t).imageData;this.firstEmit=!0,this.emit(Events.DECODE_EVENTS.FIRST_FRAME,r,t)}},{key:"_getFrame",value:function(){var e=this._video,t=e.videoWidth,r=e.videoHeight;if(this._allPicNum++,this._isInDecoding){if(t||r){var n=this._vCurrentTime,i=this._basePTS+n;if(this.ptsArray.push(i),this._lastCurrentTime&&this._lastCurrentTime===this._vDuration&&(logger.log(this.TAG,"_getFrame, video ended, lastCurrentTime",this._lastCurrentTime,"duration:",this._vDuration,"isInDecoding:",this._isInDecoding),this._onEnded(null,"getFrame")),this._lastPts&&i<=this._lastPts)return void(this._framId=window.requestAnimationFrame(this._getFrame.bind(this)));if(this._lastPts&&i-this._lastPts<this._realFrameDuration)return void(this._framId=window.requestAnimationFrame(this._getFrame.bind(this)));this._screenShotNum++;var o,a=null,s=Date.now();try{a=(o=this._getImageData(i)).imageData}catch(e){console.error(e,o,this._canvasList.length)}this._lastPts=i;var c=Date.now()-s;return this._totleTime+=c,this.emit(Events.DECODE_EVENTS.DECODED,a,i),void(this._framId=window.requestAnimationFrame(this._getFrame.bind(this)))}this._framId=window.requestAnimationFrame(this._getFrame.bind(this))}else this._framId&&(window.cancelAnimationFrame(this._framId),this._framId=null)}},{key:"_getImageData",value:function(){var e,t=this._video,r=t.videoWidth,n=t.videoHeight,i=r,o=n;this._width&&this._height&&(i=this._width,o=this._height),o>this._maxVideoHeight&&(o=this._maxVideoHeight,i=parseInt(o*(r/n))),(e=this._canvasList.shift())||(console.warn(this.TAG,"_getImageData, _canvansList length is 0"),e=this._createCanvas()),e.width=i,e.height=o;var a=e.dom,s=e.ctx;if(this._currentCanvasHeight=o,!a)return{imageData:e};a.width!==i&&(a.width=i,a.height=o);try{n&&r&&i&&o&&s.drawImage(t,0,0,r,n,0,0,i,o)}catch(e){console.error(this.TAG,"_getImageData, drawImage:",e)}return{imageData:e}}},{key:"_adaptFrameDuration",value:function(e){e<MIN_FPS?this._minFPSTime++:this._minFPSTime=0,e>MAX_FPS?this._maxFPSTime++:this._maxFPSTime=0,this._minFPSTime>0&&this._decodeFPS<MIN_FPS&&(this._realFrameDuration-=this._timePerFrame,this._realFrameDuration<15&&(this._realFrameDuration=15),this._minFPSTime=0),this._maxFPSTime>0&&this._decodeFPS>MAX_FPS&&(this._realFrameDuration+=this._timePerFrame,this._maxFPSTime=0)}},{key:"_vDuration",get:function(){return parseInt(1e3*this._video.duration)}},{key:"_vCurrentTime",get:function(){return parseInt(1e3*this._video.currentTime)}},{key:"_reset",value:function(){this._isInDecoding=!1,this._lastPts=0,this._screenShotNum=0,this._allPicNum=0,this._totleTime=0}},{key:"reStartDecode",value:function(){this._video.pause(),this._reset();var e=this._currentBlob,t=this._basePTS;this._framId&&(window.cancelAnimationFrame(this._framId),this._framId=null),this._initVideo({blobUrl:e,dts:t})}},{key:"doSeek",value:function(e){if(this._isInDecoding){if(e<=0)return;var t=this._vCurrentTime/1e3+e>=this._vDuration/1e3?this._vDuration/1e3:this._vCurrentTime/1e3+1;console.error("doSeek",t),this._video.currentTime=t}}},{key:"pause",value:function(){this._isInDecoding&&this._video.pause()}},{key:"play",value:function(){if(this._isInDecoding&&this._video.paused)return logger.log("video play",this._vCurrentTime),this._video.play()}},{key:"startDecode",value:function(e,t,r){this._initVideo(e,r),this._metaFPS=t}},{key:"stopDecode",value:function(){this._video.paused||(this._video.pause(),this._reset())}},{key:"canPlayType",value:function(e){return this._video.canPlayType(e)}},{key:"destroy",value:function(){this._isInDecoding=!1,window.cancelAnimationFrame(this._framId),this._video.pause(),this._removeEvents()}},{key:"videoWidth",get:function(){return this._video?this._video.videoWidth:0}},{key:"videoHeight",get:function(){return this._video?this._video.videoHeight:0}}]),r}(),MAX_FRAMESIZE=40,MIN_FRAMESIZE=25,DEFAULT_FPS=20,LEVELS=[{base:720,level:1},{base:540,level:2},{base:360,level:3},{base:280,level:4}],VideoDecoderController=function(e){_inherits$1(r,EventEmitter);var t=_createSuper$1(r);function r(e,n){var i;return _classCallCheck$2(this,r),(i=t.call(this)).TAG="VideoDecoderController",i._decoder=new VideoDecoder(e),i._remux=new MP4Remuxer,i._bindEvents(),i._isInit=!1,i._isDataReady=!1,i._ready=!1,i._blobURLList=[],i._isInDecoding=!1,i._mediaSegmentReady=!1,i._parent=n,i._isDecodePause=!1,i._playSuccess=!0,i._isVideoOnRun=!0,i._startDts=0,i._fDuration=0,i._minFPSTime=0,i._lastPts=0,i._frameLengthPerFragment=0,i._gopBufferLength=0,i._maxGopDuration=0,i._minGopDuration=0,i._currentLevel=-1,i._endLevel=e.endLevel||2,i.currentFragmentDuration=0,i._handleKeyFrameVideo=i._handleKeyFrameVideo.bind(_assertThisInitialized$1(i)),i}return _createClass$2(r,[{key:"_bindEvents",value:function(){var e=this;document.addEventListener("visibilitychange",this._onVisibilityChange.bind(this)),this._decoder.on(Events.DECODE_EVENTS.APPEND_VIDEO,this._onAppendVideo.bind(this)),this._decoder.on(Events.DECODE_EVENTS.PLAY_FAILED,this._onPlayFailed.bind(this)),this._decoder.on("error",this._onError.bind(this)),this._decoder.on(Events.DECODE_EVENTS.DECODED,this._onDecoded.bind(this)),this._decoder.on(Events.DECODE_EVENTS.FIRST_FRAME,this._onFirstFrame.bind(this)),this._decoder.on(Events.DECODE_EVENTS.FRAGMENT_END,this._onFragmentEnd.bind(this)),this._decoder.on("fps",(function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=[e._metaFPS].concat(r,[e._frameLengthPerFragment]);e.emit.apply(e,["fps"].concat(_toConsumableArray$1(i)))})),this.on("keyFrame",this._handleKeyFrameVideo)}},{key:"_onRemuxed",value:function(e){var t={blobUrl:this._createBlobURL(e),dts:this.currentFragmentDts,duration:this.currentFragmentDuration,frameDuration:Math.floor(1e3/this._metaFPS)};this._recordGopDuration(this.currentFragmentDuration),this._pushBlob(t),logger.log(this.TAG,"_onRemuxed","maxgopduration:",this._maxGopDuration,"_gopBufferLength:",this._gopBufferLength),!this._isDataReady&&this._gopBufferLength>=this._maxGopDuration&&this._checkDataReady()}},{key:"_onPlayFailed",value:function(e){this._isInDecoding=!1,this._parent.emit(Events.DECODE_EVENTS.PLAY_FAILED,e)}},{key:"_onAppendVideo",value:function(e){this._parent.emit(Events.DECODE_EVENTS.APPEND_VIDEO,e)}},{key:"_onVisibilityChange",value:function(){this._isVideoOnRun="visible"===document.visibilityState}},{key:"_onDecoded",value:function(e,t){this._frameLengthPerFragment++;var r=this._buildFrameInfo(e,t);this._parent.emit(Events.DECODE_EVENTS.DECODED,r),this._lastPts=t}},{key:"_onFirstFrame",value:function(e,t){var r=this._buildFrameInfo(e,t);this._parent.emit(Events.DECODE_EVENTS.FIRST_FRAME,r)}},{key:"_onFragmentEnd",value:function(e,t){var r=this;logger.log(this.TAG,"_onFragmentEnd ,_isDecodePause:",this._isDecodePause,"decodeFPS:",e),e&&this._reduceResolution(e),this._isInDecoding=!1,this._inDecodeId=-1,this._currentInfo=null,this._frameLengthPerFragment=0,this._getBlobLength()&&!this._isDecodePause?this.startDecode():this.loadNextHandle=setInterval((function(){r._getBlobLength()&&!r._isDecodePause&&r._isVideoOnRun&&!r._isInDecoding&&(logger.log(r.TAG,"_onFragmentEnd, setInterval start next mp4 decode"),r.startDecode(),clearInterval(r.loadNextHandle))}))}},{key:"_onError",value:function(e,t){this._isInDecoding=!1,this._parent.emit("error",e,t)}},{key:"_checkReady",value:function(){this._isDataReady&&this._isInit&&(this.ready=!0,logger.log(this.TAG,"checkReady trigger ready"),this._parent.emit(Events.DECODE_EVENTS.READY))}},{key:"_checkDataReady",value:function(){this._isDataReady=!0,this._checkReady()}},{key:"_reduceResolution",value:function(e){if(logger.log(this.TAG,"_reduceResolution","currentLevel:",this._currentLevel,"endLevel:",this._endLevel),this._videoHeight>720&&(logger.log(this.TAG,"_reduceResolution","trigger DECODE_LOW_FPS"),this._parent.emit(Events.VIDEO.DECODE_LOW_FPS)),e&&e<DEFAULT_FPS?(this._minFPSTime++,this._decoder.emit("fpsreduce",e)):this._minFPSTime=0,this._currentLevel>=this._endLevel)return logger.log(this.TAG,"_reduceResolution","trigger DECODE_LOW_FPS",this._currentLevel,this._endLevel),void this._parent.emit(Events.VIDEO.DECODE_LOW_FPS);if(this._minFPSTime>2){var t,r=this._videoWidth,n=this._videoHeight;if(t=this._findLevel(n,this._currentLevel)){if(this._currentLevel=t.level,4===this._currentLevel)return logger.log(this.TAG,"_reduceResolution","trigger DECODE_LOW_FPS, _currentLevel: ",this._currentLevel),void this._parent.emit(Events.VIDEO.DECODE_LOW_FPS);this.width=t.base*(r/n),this.height=t.base,this._decoder.emit("outputresolutionchange",this.width,this.height)}this._minFPSTime=0}}},{key:"_findLevel",value:function(e,t){return LEVELS.find((function(r){return r.base<e&&r.level>t}))}},{key:"_buildFrameInfo",value:function(e,t){try{var r=e.width,n=e.height;return{msg:"DECODED",width:r,height:n,buffer:e,yLinesize:r,uvLinesize:r/2,info:{baseDts:void 0,dts:t,gopId:0,isGop:void 0,key:!1,pts:t},type:"rgb"}}catch(e){logger.log(this.TAG,e)}}},{key:"_pushBlob",value:function(e){logger.log("push blob",e.dts,e.duration),e&&e.duration&&(this._gopBufferLength+=e.duration),this._blobURLList.push(e)}},{key:"_shiftBlob",value:function(){var e=this._blobURLList.shift();return e&&e.duration&&(this._gopBufferLength-=e.duration),e}},{key:"_filterBlob",value:function(e){var t=this;this._blobURLList=this._blobURLList.filter((function(r){return r.dts<e&&(URL.revokeObjectURL(r.blobUrl),r.duration&&(t._gopBufferLength-=r.duration)),r.dts>=e}))}},{key:"_emptyBlobList",value:function(){this._blobURLList=[],this._gopBufferLength=0}},{key:"_getBlobLength",value:function(){return this._blobURLList.length}},{key:"_handleKeyFrameVideo",value:function(e){try{var t=this._parent._timeRange.frames||[];if(this._parent._timeRange.clean(),!t.length)return;var r=t[0].dts,n=t[t.length-1].dts,i=r-this.endDts;logger.log(this.TAG,"_handleKeyFrameVideo","startDts:",r,"endDts:",n,"samples length:",t.length),this.endDts&&i>Math.floor(1e3/this._metaFPS)+1&&logger.log(this.TAG,"_handleKeyFrame, keyFrame dts:",r,"sample length:",t.length,"endDts:",n,"delay:",i);var o=n-r;if(this._fDuration||(this._fDuration=o),o<1500)return void logger.log(this.TAG,"_handleKeyFrame gopDuration :",o,"sample length:",t.length,"gopStartDts:",r,"gopEndDts:",n);if(this.firstDts||(this.firstDts=t[0].dts),this.currentFragmentDts=t[0].dts,this.currentFragmentDuration=this._getFragmentDuration(t),this.endDts=n,this.currentFragmentDts<this._startDts)return console.warn(this.TAG,"_handleKeyFrameVideo","currentFragmentDts < this._startDts",this.currentFragmentDts,this._startDts),void(t=[]);this.startRemux(t),t=[]}catch(e){console.error(this.TAG,"_handleKeyFrameVideo",e)}}},{key:"_getFragmentDuration",value:function(e){var t=0,r=0;return e[0].keyframe||console.error(this.TAG,"_getFragmentDuration","gop firstFrame is not keyframe"),e.forEach((function(n,i){n.keyframe&&i&&(t+=e[i-1].dts-e[r].dts,r=i)})),t+=e[e.length-1].dts-e[r].dts}},{key:"_createBlobURL",value:function(e){if(e){var t=new window.Blob([e.buffer],{type:"video/mp4"});return window.URL.createObjectURL(t)}}},{key:"_recordGopDuration",value:function(e){var t=e;this._minGopDuration||(this._minGopDuration=t),t>this._maxGopDuration&&(this._maxGopDuration=t),t<this._minGopDuration&&(this._minGopDuration=t)}},{key:"checkMaxFrames",value:function(e){"number"==typeof e&&(this._isDecodePause=e>MAX_FRAMESIZE,this._playSuccess&&this._isDecodePause&&this._decoder.pause())}},{key:"checkMinFrames",value:function(e){var t=this;if("number"==typeof e&&(this._isDecodePause=!(e<MIN_FRAMESIZE),!this._isDecodePause)){var r=this._decoder.play();void 0!==r?r.then((function(){t._playSuccess=!0})).catch((function(){t._playSuccess=!1})):setTimeout((function(){t._playSuccess=!0}),20)}}},{key:"frameRendend",value:function(e){if(e.dom){if(e.dom.width=0,e.dom.height=0,this._decoder._canvasList.length>MAX_FRAMESIZE)return;this._decoder._canvasList.push(e)}else logger.error(this.TAG,"_onRendend","imageObj. is error",e)}},{key:"checkValidBlob",value:function(e){this._filterBlob(e)}},{key:"chaseVideoFrame",value:function(e){logger.log(this.TAG,e,e.frame.dts,this.currentFragmentDts);var t=e.frame.dts;if(this._startDts=t,t===this.currentFragmentDts){if(logger.log(this.TAG,"_onChaseFrame","_inDecodeId:",this._inDecodeId,"currentFragmentDts:",this.currentFragmentDts),this._inDecodeId>0&&this._inDecodeId<t)return logger.log(this.TAG,"_onChaseFrame, _inDecodeId > 0 && _inDecodeId < startDts, _inDecodeId:",this._inDecodeId,"startDts:",t),this.stopDecode(),this._filterBlob(t),void this.startDecode();if(this._inDecodeId===t)return logger.log(this.TAG,"_onChaseFrame, _inDecodeId === startDts, startDts:",t),this.stopDecode(),void this.reStrartDecode(this._currentInfo);-1===this._inDecodeId&&(logger.log(this.TAG,"_onChaseFrame","_inDecodeId==-1"),this.startDecode())}t>this.currentFragmentDts&&(logger.log(this.TAG,"_onChaseFrame, startDts > currentFragmentDts, startDts:",t,"currentFragmentDts:",this.currentFragmentDts),this.stopDecode(),this._emptyBlobList()),t<this.currentFragmentDts&&(logger.log(this.TAG,"_onChaseFrame, startDts < currentFragmentDts, startDts:",t,"currentFragmentDts:",this.currentFragmentDts),t>this._inDecodeId&&(this._filterBlob(t),this.stopDecode(),this.startDecode()))}},{key:"init",value:function(e){this._isInit||(this._metaFPS=e.fpsNum/e.fpsDen||25,this._videoWidth=e.width,this._videoHeight=e.height,this._width=this._videoWidth,this._height=this._videoHeight,this._frameDuration=parseInt(1e3/this._metaFPS),this._isInit=!0,logger.log("".concat(this.TAG," has inited")),this._isInit=!0,this._checkReady())}},{key:"reStrartDecode",value:function(e){if(e)try{logger.log(this.TAG,"reStrartDecode"),this._isInDecoding=!0,this._inDecodeId=e.dts,this._currentInfo=e,this._decoder.startDecode(e,this._metaFPS,this._startTime),this._startTime=0}catch(e){console.error("load error",e)}}},{key:"stopDecode",value:function(){this._isInDecoding=!1,this._inDecodeId=-1,this._currentInfo=null,this._frameLengthPerFragment=0,this._decoder.stopDecode()}},{key:"startDecode",value:function(){if(this._isInDecoding)logger.log(this.TAG,"startDecode","this decoder is in decoding");else{var e=this._getBlobLength();if(this._decoder&&e){logger.log(this.TAG,"startDecode","blob url length:",e);var t=this._shiftBlob()||{};try{logger.log(this.TAG,"startDecode",t.dts,t.duration),this._isInDecoding=!0,this._inDecodeId=t.dts,this._currentInfo=t,this._decoder.startDecode(t,this._metaFPS)}catch(e){console.error(this.TAG,"startDecode","load error",e)}}}}},{key:"canSeek",value:function(e){var t=e.frame.dts;return!!(this.currentFragmentDts>=t&&this._isInDecoding)&&(this._inDecodeId!==t&&this._inDecodeId<t)}},{key:"startRemux",value:function(e){if(logger.log("startRemux samples length:",e.length),e.length){var t=this._parent._meta;t.samples=e;var r=this._remux.remux(t).videoSegment;this._onRemuxed(r)}else console.error("frame length is 0")}},{key:"canPlayType",value:function(e){if(this._decoder)try{return this._decoder.canPlayType('video/mp4;codecs="'+e.codec+'"')}catch(e){console.error(e)}}},{key:"destroy",value:function(){this._blobURLList=[],this._decoder.destroy()}},{key:"empty",value:function(){if(logger.log("empty"),this._decoder){var e=this._decoder._canvasList;return logger.log(this.TAG,"empty >>>>>>>>>>>>>>>>>>length:",e.length),e.forEach((function(e){e.dom&&(logger.log("clear >>>>>>>>>>>>>>>>>>"),e.dom.width=0,e.dom.height=0,e.dom=null)})),e.length}}},{key:"isIDLE",get:function(){return logger.log(this.TAG,"isIDEL","blob length:",this._getBlobLength(),"_isInDecoding:",this._isInDecoding,"isVideoOnRun:",this._isVideoOnRun,"_isDecodePause",this._isDecodePause),!this._getBlobLength()&&!this._isInDecoding&&this._isVideoOnRun}},{key:"ready",get:function(){return this._ready},set:function(e){this._ready=e}},{key:"remux",get:function(){return this._remux}},{key:"isInit",get:function(){return this._isInit}}]),r}(),VideoRenderFromVideo=function(e){_inherits$1(r,VideoBaseRender);var t=_createSuper$1(r);function r(e,n){var i;return _classCallCheck$2(this,r),(i=t.call(this,e,n)).TAG="VideoRenderFromVideo",i._videoDecodeController=new VideoDecoderController(e,_assertThisInitialized$1(i)),i._canAutoPlay=!0,i._videoDecode=e.videoDecode,i._chaseToFrame=null,i}return _createClass$2(r,[{key:"videoDecode",get:function(){return this._videoDecode},set:function(e){this._videoDecode=e}},{key:"_bindEvents",value:function(){var e=this;_get(_getPrototypeOf$1(r.prototype),"_bindEvents",this).call(this),this.on("keyFrame",this._onKeyFrame.bind(this)),this.on(Events.DECODE_EVENTS.READY,this._onReady.bind(this)),this.on(Events.DECODE_EVENTS.DECODED,this._onDecoded.bind(this)),this.on(Events.DECODE_EVENTS.PLAY_FAILED,this._onPlayFailed.bind(this)),this.on("error",this._onError.bind(this)),this.on(Events.DECODE_EVENTS.APPEND_VIDEO,this._onAppendVideo.bind(this)),this.on(Events.DECODE_EVENTS.FIRST_FRAME,this._onFirstFrame.bind(this)),this._parent.on(Events.DECODE_EVENTS.CHASE_VIDEO_FRAME,this._onChaseVideoFrame.bind(this)),this._parent.on(Events.TIMELINE.SYNC_DTS,this._onTimeLineSyncDTS.bind(this)),window.addEventListener("unload",(function(){e._empty()}))}},{key:"_onTimeLineSyncDTS",value:function(e){this._videoDecodeController.checkValidBlob(e)}},{key:"_onChaseVideoFrame",value:function(e){this._doChaseVideoFrame(e)}},{key:"_onAppendVideo",value:function(e){try{this._parent._parent.appendChild(e)}catch(e){cosole.error(this.TAG,"onAppendVideo",e)}}},{key:"_onKeyFrame",value:function(){logger.log(this.TAG,"_onKeyFrame, keyframe"),this._videoDecodeController.emit("keyFrame")}},{key:"_onError",value:function(e,t){console.error(this.TAG,"decoder error",e,t),t||this._emitTimelineEvents(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.ERROR,this._assembleErr(e&&e.message))}},{key:"_onReady",value:function(){if(!this._frameRender){var e=Object.assign(this._config,{meta:this._meta,canvas:this._canvas,type:"2d"});try{this._frameRender=new FrameRender(e,this)}catch(e){this._emitTimelineEvents(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.ERROR,this._assembleErr(e&&e.message))}}this._startDecode()}},{key:"_onFirstFrame",value:function(e){logger.log(this.TAG,"onFirstFrame"),this._receiveFrame(e),this._firstFrame=!0}},{key:"_onDecoded",value:function(e){var t=this;if(this._inChaseFrame){if(this.chaseFrameAfter++,1===this.chaseFrameAfter&&this._chaseToFrame){if(this._parent.emit(Events.DECODE_EVENTS.CHASE_VIDEO_FRAME_END,this._chaseToFrame),this._frameQueue.length)this._frameQueue.frames.forEach((function(e){t._videoDecodeController.frameRendend(e.buffer)}));this._frameQueue.empty(),this._videoDecodeController.checkMinFrames(this._frameQueue.length),this._timeRange.deletePassed(this._chaseToFrame.frame.dts),this._inChaseFrame=!1,this._chaseToFrame=null,console.warn(this.TAG,"onDecoded","_inChaseFrame end")}}else this.chaseFrameAfter=0;this._receiveFrame(e)}},{key:"_onPlayFailed",value:function(e){console.warn(this.TAG,"onPlayFailed, this._ready:",this._ready,",firstEmit:",e,",frame length:",this._frameQueue.length),this._ready||e||this._whenReady(),this._canAutoPlay=!1}},{key:"canSeek",value:function(e){return this._videoDecodeController.canSeek(e)}},{key:"_initDecoder",value:function(){this._isInit||(logger.log(this.TAG,"_initDecoder"),this._videoDecodeController.isInit||this._videoDecodeController.init(this._meta),this._isInit=!0)}},{key:"_receiveFrame",value:function(e){_get(_getPrototypeOf$1(r.prototype),"_receiveFrame",this).call(this,e),this._videoDecodeController.checkMaxFrames(this._frameQueue._frames.length)}},{key:"_setMetadata",value:function(e){logger.warn(this.TAG,"video set metadata",e),this._meta=e;var t=e.fpsNum/e.fpsDen;t?logger.log(this.TAG,"detect fps:",t):logger.warn(this.TAG,"no detect fps,start estimate"),this._initDecoder(e)}},{key:"_doChaseVideoFrame",value:function(e){this._inChaseFrame=!0,this._chaseToFrame=e,this._videoDecodeController.chaseVideoFrame(e)}},{key:"_appendChunk",value:function(e){this._meta||this._setMetadata(e);for(var t=e.samples.slice(),r=t.length,n=0;n<r;n++){var i=t.shift();i.keyframe&&this.emit("keyFrame"),this._timeRange.append([i],this.noAudio,!1)}}},{key:"_startDecode",value:function(){this._videoDecodeController.startDecode()}},{key:"_checkToDecode",value:function(){this._startDecode()}},{key:"_startRender",value:function(){logger.log(this.TAG,"_startRender interval",this.interval),this._tickTimer.start(this.interval)}},{key:"_render",value:function(e){var t=this,r=this._frameQueue.nextFrame(),n=this.preciseVideoDts;if(r&&this._timeRange){var i=r.info;if(!i)return this._frameQueue.shift(),void console.error("not info");this._renderDts=i.dts;var o=i.dts-n;if(o<-150){this.lastPrecise;var a=this._frameQueue.frames,s=this._getDeleteFrames(a,n),c=s.deleteFrames,u=s.useFrames;return a.splice(0),u.forEach((function(e){a.push(e)})),c.forEach((function(e){t._videoDecodeController.frameRendend(e.buffer)})),this._videoDecodeController.emit("renderDelay",o,this._frameQueue._frames.length),void this._videoDecodeController.checkMinFrames(this._frameQueue.length)}if(!(!e&&o>30&&o<6e4)){Math.abs(this._lastTimeupdate-i.dts)>250&&(this._emitTimelineEvents(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.TIMEUPDATE),this._lastTimeupdate=i.dts),logger.long&&logger.log(this.TAG,"render delay:".concat(o," , timelinePosition:").concat(n," , dts:").concat(i.dts," , cost:").concat(i.cost," , gopID:").concat(i.gopId," , rest:").concat(this._frameQueue.length,", buffer frame:").concat(this._timeRange.frameLength));var l=performance.now();this._frameRender.render(r.buffer,r.width,r.height,r.yLinesize,r.uvLinesize),this.hasFirstFrame||e||(this.hasFirstFrame=!0,this._parent.emit(Events.TIMELINE.PLAY_EVENT,"firstframe")),this._videoDecodeController.frameRendend(r.buffer),this._frameQueue.shift(),this._videoDecodeController.checkMinFrames(this._frameQueue.length),this._videoDecodeController.emit("renderDelay",o,this._frameQueue._frames.length),this._renderCost=performance.now()-l,e||(this.lastTime&&(this.lastPrecise,Date.now(),this.lastTime),this.lastFrameinfo=i.dts,this.lastPrecise=n,this.lastTime=Date.now(),this.lastAudioTime=this._parent.audioRender.currentTime)}}else{if(this._videoDecodeController.checkMinFrames(this._frameQueue._frames.length),this._parent._paused)return;if(!this._firstFrame)return void logger.log(this.TAG,"_render","not first frame return");var A=this._videoDecodeController;if(logger.log(this.TAG,",lack frame, _inDecoding:",this._videoDecodeController._isInDecoding,this._videoDecodeController._isDecodePause,",_frameQueue.length:",this._frameQueue.length),!this._frameQueue.length&&A.isIDLE){this._ready=!1;var d=this._parent.audioRender;console.warn(this.TAG,"trigger video waiting vdecode, preciseVideoDts:",n,d.currentTime,d.duration,d.buffered.end(0),d.baseDts),this.emit(Events.VIDEO.VIDEO_WAITING)}this._checkToDecode()}}},{key:"_updateSegmentEnd",value:function(){}},{key:"_destroy",value:function(e){this._empty(),_get(_getPrototypeOf$1(r.prototype),"destroy",this).call(this,e),this._videoDecodeController.destroy()}},{key:"_doPause",value:function(){logger.log(this.TAG,">>>>>>>>doPause"),this._tickTimer.stop()}},{key:"_getDeleteFrames",value:function(e,t){var r=[],n=[];return e.forEach((function(e){e.info&&e.info.dts>t?n.push(e):e.info&&e.info.dts<=t&&r.push(e)})),{deleteFrames:r,useFrames:n}}},{key:"_empty",value:function(){this._videoDecodeController&&(this._videoDecodeController.empty(),this._frameQueue.frames.forEach((function(e){e.buffer&&e.buffer.dom&&(e.buffer.dom.width=0,e.buffer.dom.height=0,e.buffer.dom=null)})))}}]),r}(),DecodeController=function(e){_inherits$1(r,EventEmitter);var t=_createSuper$1(r);function r(e){var n;return _classCallCheck$2(this,r),_defineProperty$2(_assertThisInitialized$1(n=t.call(this)),"_parent",null),_defineProperty$2(_assertThisInitialized$1(n),"_decoderReady",!1),_defineProperty$2(_assertThisInitialized$1(n),"_inDecoding",!1),_defineProperty$2(_assertThisInitialized$1(n),"_toDecodeFirstframe",!0),_defineProperty$2(_assertThisInitialized$1(n),"_id",(new Date).getMilliseconds()),_defineProperty$2(_assertThisInitialized$1(n),"_workerErrorCallback",null),_defineProperty$2(_assertThisInitialized$1(n),"_workerMessageCallback",null),_defineProperty$2(_assertThisInitialized$1(n),"_decoderWorker",null),n._parent=e,n}return _createClass$2(r,[{key:"analyse",get:function(){return this._parent.analyse}},{key:"inDecoding",get:function(){return this._inDecoding}},{key:"decoderMode",get:function(){return this._decoderMode}},{key:"decoderReady",get:function(){return this._decoderReady}},{key:"needToDecode",get:function(){return this._inDecoding?0:this._continueDecodeThreshold}},{key:"maxDecodeOnce",get:function(){return this._maxDecodeOnce}},{key:"meta",get:function(){var e;return null===(e=this._parent)||void 0===e?void 0:e._meta},set:function(e){this._parent&&(this._parent._meta=e)}},{key:"init",value:function(e,t){this._workerMessageCallback=e,this._workerErrorCallback=t,this._initWorker()}},{key:"_initWorker",value:function(){throw new Error("need override by children")}},{key:"checkToDecode",value:function(e){this.webcodec?e<=this.needToDecode&&this.doDecode():!this._inDecoding&&e<=this.needToDecode&&this.doDecode()}},{key:"doDecode",value:function(){var e=this,t=this._getFramesToDecode();t&&t.length&&this.meta&&(this._toDecodeFirstframe&&(this._toDecodeFirstframe=!1,this.analyse.addFirstFrameToDecode()),this._avccpushed||this._initDecoderWithConfiguration(this._decoderWorker,this.meta),logger.enable&&logger.log(this.TAG,"doDecode ".concat(t.length," frames")),t.forEach((function(t){e._doDecodeInternal(t)})),this._inDecoding=!0,this._decoderWorker.postMessage({msg:"finish_flag"}))}},{key:"preciseSeek",value:function(e){var t,r,n,i,o=this,a=1e3*e,s=null===(t=this._parent)||void 0===t||null===(r=t._timeRange)||void 0===r?void 0:r.getFramesForPreciseSeek(a),c=s.length;c<this.maxDecodeOnce?this.doDecode():(null===(n=this._parent)||void 0===n||null===(i=n._timeRange)||void 0===i||i.updateFrameIndexForPreciseSeek(c),logger.enable&&logger.log(this.TAG,"doDecode ".concat(s.length," frames for precise seek")),s.forEach((function(e,t){o._doDecodeInternal(e,!0,t>=c-6)})),this._inDecoding=!0,this._decoderWorker.postMessage({msg:"finish_flag"}))}},{key:"_getFramesToDecode",value:function(){var e=this._parent,t=e._timeRange,r=e._decodeEstimate;if(this._decoderReady&&t){var n=t.frameLength;if(n){var i=this._toDecodeFirstframe?getDecodeCapacaity().maxDecodeOnceFirstTime:this.maxDecodeOnce;1===n&&r.resetDecodeDot(performance.now());for(var o=[];i>0;){var a=t&&t.getFrame();if(!a)break;o.push(a),a.gopId&&a.gopId-1==0&&r.updateGopCount(),i--}return o}}}},{key:"_doDecodeInternal",value:function(e,t,r){null!=e&&e.meta&&(this.meta=e.meta,logger.warn(this.TAG,"detect metadata! flush decoder"),this._initDecoderWithConfiguration(this.__decoderWorker,e.meta));var n={dts:e.dts,pts:e.pts||e.dts+e.cts,keyframe:e.keyframe,gopId:e.gopId,id:this._id};t&&(n.preciseSeek=!0,n.output=r);var i=e.data.slice();this._decoderWorker.postMessage({msg:"decode",data:i,info:n},[i.buffer])}},{key:"_initDecoderWithConfiguration",value:function(){throw new Error("need override by children")}},{key:"flushDecoder",value:function(){this._decoderWorker.postMessage({msg:"flush"})}},{key:"destroy",value:function(){throw new Error("need override by children")}}]),r}(),encodedJs$3="IWZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3ZhciBlPW51bGwsdD1bXSxzPTAsYT0hMTtzZWxmLmFkZEV2ZW50TGlzdGVuZXIoIm1lc3NhZ2UiLChmdW5jdGlvbihvKXtzd2l0Y2goby5kYXRhLm1zZyl7Y2FzZSJjb25maWd1cmF0aW9uIjplPW5ldyBzZWxmLlZpZGVvRGVjb2Rlcih7b3V0cHV0OmZ1bmN0aW9uKG8pe2E9ITAscyYmY2xlYXJUaW1lb3V0KHMpO3ZhciBuPXQuc2hpZnQoKTtuP3NlbGYucG9zdE1lc3NhZ2Uoe3R5cGU6IkRFQ09ERUQiLHdpZHRoOm8uZGlzcGxheVdpZHRoLGhlaWdodDpvLmRpc3BsYXlIZWlnaHQsaW5mbzpuLGJ1ZmZlcjpvfSxbb10pOm8uY2xvc2UoKSxlLmRlY29kZVF1ZXVlU2l6ZT09PXQubGVuZ3RoJiZzZWxmLnBvc3RNZXNzYWdlKHt0eXBlOiJCQVRDSF9GSU5JU0hfRkxBRyJ9KX0sZXJyb3I6ZnVuY3Rpb24oZSl7Y29uc29sZS5sb2coIltXZWJjb2RlY1dvcmtlcl06IixlKSwiQ29kZWMgcmVjbGFpbWVkIGR1ZSB0byBpbmFjdGl2aXR5LiIhPT1lLm1lc3NhZ2UmJnNlbGYucG9zdE1lc3NhZ2Uoe3R5cGU6IkZBSUxFRCIsbWVzc2FnZTplJiZlLm1lc3NhZ2V9KX19KSxzZWxmLlZpZGVvRGVjb2Rlci5pc0NvbmZpZ1N1cHBvcnRlZChvLmRhdGEuZGF0YSkudGhlbigoZnVuY3Rpb24odCl7dC5zdXBwb3J0ZWQmJihlLmNvbmZpZ3VyZShvLmRhdGEuZGF0YSksY29uc29sZS5sb2coIltXZWJjb2RlY1dvcmtlcl06IiwiaXNDb25maWdTdXBwb3J0ZWQiLHQpKX0pKS50aGVuKChmdW5jdGlvbigpe3NlbGYucG9zdE1lc3NhZ2Uoe3R5cGU6IkRFQ09ERVJfUkVBRFkifSkscz1zZXRUaW1lb3V0KChmdW5jdGlvbigpe2F8fHNlbGYucG9zdE1lc3NhZ2Uoe3R5cGU6IkZBSUxFRCIsbWVzc2FnZToibm8gZnJhbWUgb3V0cHV0In0pfSksMmUzKX0pKS5jYXRjaCgoZnVuY3Rpb24oZSl7c2VsZi5wb3N0TWVzc2FnZSh7dHlwZToiRkFJTEVEIixtZXNzYWdlOmUmJmUubWVzc2FnZX0pfSkpO2JyZWFrO2Nhc2UiZGVjb2RlIjp2YXIgbj1vLmRhdGEuZGF0YSxpPW8uZGF0YS5pbmZvO3QucHVzaChpKTt2YXIgZD1uLmJ5dGVMZW5ndGgtNCxjPW5ldyBEYXRhVmlldyhuZXcgQXJyYXlCdWZmZXIoNCkpO2Muc2V0VWludDMyKDAsZCwhMSksbi5zZXQobmV3IFVpbnQ4QXJyYXkoYy5idWZmZXIpLDApLGkua2V5ZnJhbWUmJmUuZmx1c2goKTt2YXIgcj1uZXcgc2VsZi5FbmNvZGVkVmlkZW9DaHVuayh7dHlwZTppLmtleWZyYW1lPyJrZXkiOiJkZWx0YSIsdGltZXN0YW1wOmkucHRzLGRhdGE6bn0pO2UuZGVjb2RlKHIpO2JyZWFrO2Nhc2UiZGVzdHJveSI6ZSYmKGUuZmx1c2goKSxlLmNsb3NlKCkpLGNsZWFyVGltZW91dChzKTticmVhaztjYXNlImNoZWNrRGVjb2RlIjpzZWxmLnBvc3RNZXNzYWdlKHt0eXBlOiJDSEVDS19UT19ERUNPREUiLGRhdGE6MD09PU1hdGguYWJzKGUuZGVjb2RlUXVldWVTaXplLXQubGVuZ3RoKX0pfX0pKX0oKTsK",blob$3="undefined"!=typeof window&&window.Blob&&new Blob([atob(encodedJs$3)],{type:"text/javascript;charset=utf-8"});function WorkerWrapper$3(){var e=blob$3&&(window.URL||window.webkitURL).createObjectURL(blob$3);try{return e?new Worker(e,{}):new Worker("data:application/javascript;base64,"+encodedJs$3,{type:"module"})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}var MAX_DECODE_ONCE_DEFAULT$1=getDecodeCapacaity().maxDecodeOnceWebcodec,WebCodecDecodeController=function(e){_inherits$1(r,DecodeController);var t=_createSuper$1(r);function r(){var e;_classCallCheck$2(this,r);for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return _defineProperty$2(_assertThisInitialized$1(e=t.call.apply(t,[this].concat(i))),"TAG","WebCodecController"),_defineProperty$2(_assertThisInitialized$1(e),"_decoderMode",5),_defineProperty$2(_assertThisInitialized$1(e),"_maxDecodeOnce",MAX_DECODE_ONCE_DEFAULT$1),_defineProperty$2(_assertThisInitialized$1(e),"_continueDecodeThreshold",MAX_DECODE_ONCE_DEFAULT$1/2),_defineProperty$2(_assertThisInitialized$1(e),"_avccpushed",!1),e}return _createClass$2(r,[{key:"webcodec",get:function(){return!0}},{key:"needToDecode",get:function(){return this._inDecoding?(this._checkToDecode(),0):this._continueDecodeThreshold}},{key:"_initWorker",value:function(){var e=this;logger.log(this.TAG,"start init webcodec worker");var t=new WorkerWrapper$3;t.onMessage=function(t){var r,n;switch(t.data.type){case"DECODER_READY":logger.log(e.TAG,"webcodec worker ready "),e._decoderReady=!0,e._workerMessageCallback({type:"DECODER_READY"});break;case"DECODED":if(e._inDecoding=!0,(null===(r=t.data)||void 0===r||null===(n=r.info)||void 0===n?void 0:n.id)!==e._id)return;e._workerMessageCallback({type:"RECEIVE_FRAME",data:t.data});break;case"BATCH_FINISH_FLAG":if(e._inDecoding=!1,!e._workerMessageCallback)return;e._workerMessageCallback({type:"BATCH_FINISH"});break;case"CHECK_TO_DECODE":e._inDecoding=t.data.data;break;case"FAILED":e._whenError(t.data.message)}},t.onError=function(t){var r,n,i=null===(r=e._parent)||void 0===r||null===(n=r._parent)||void 0===n?void 0:n._parent;i&&i.removeChild(i.querySelector("canvas")),e._whenError(t.message)},t.addEventListener("message",t.onMessage),t.addEventListener("error",t.onError),this._decoderWorker=t,this._initDecoderWithConfiguration(t,this._parent.configuration)}},{key:"_whenError",value:function(e){r.canUse=!1,this._workerErrorCallback(e)}},{key:"_initDecoderWithConfiguration",value:function(e,t){e.postMessage({msg:"configuration",data:{codec:this._parent._meta.codec,codedHeight:this._parent._meta.height,codedWidth:this._parent._meta.width,description:t}}),this._avccpushed=!0}},{key:"_checkToDecode",value:function(){this._decoderWorker.postMessage({msg:"checkDecode"})}},{key:"destroy",value:function(){var e=this._decoderWorker;e.removeEventListener("message",e.onMessage),e.removeEventListener("error",e.onError),e.postMessage({msg:"destroy"}),e.terminate(),this._decoderWorker=null}}],[{key:"isSupported",value:function(){return getDecodeCapacaity().h264WithWebcodec&&!!window.VideoDecoder&&!1!==r.canUse}}]),r}(),encodedJs$2="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2Z1bmN0aW9uIHNoaW1JbXBvcnRTY3JpcHRzKHNyYyl7cmV0dXJuIGZldGNoKHNyYykudGhlbigoZnVuY3Rpb24oZSl7cmV0dXJuIGUudGV4dCgpfSkpLnRoZW4oKGZ1bmN0aW9uKHRleHQpe3NlbGYuZXhwb3J0cz17fSxldmFsKHRleHQpLHNlbGYubT1leHBvcnRzLm19KSl9dmFyIE1BWF9TVFJFQU1fQlVGRkVSX0xFTkdUSD0zMTQ1NzI4LGluaXRUcz0wLERlY29kZXI9ZnVuY3Rpb24oZSl7dGhpcy5pbml0ZWQ9ITEsdGhpcy5pbmZvSWQ9MCx0aGlzLnNlbGY9ZSx0aGlzLm1ldGE9dGhpcy5zZWxmLm1ldGEsdGhpcy50cz0wLHRoaXMuaW5mb2xpc3Q9W10sZS5wYXJfYnJvYWR3YXlPbkJyb2Fkd2F5SW5pdGVkPXRoaXMuYnJvYWR3YXlPbkJyb2Fkd2F5SW5pdGVkLmJpbmQodGhpcyksZS5wYXJfYnJvYWR3YXlPblBpY3R1cmVEZWNvZGVkPXRoaXMuYnJvYWR3YXlPblBpY3R1cmVEZWNvZGVkLmJpbmQodGhpcyl9LGRlY29kZXI7ZnVuY3Rpb24gb25Qb3N0UnVuKCl7KGRlY29kZXI9bmV3IERlY29kZXIodGhpcykpLmluaXQoKX1EZWNvZGVyLnByb3RvdHlwZS50b1U4QXJyYXk9ZnVuY3Rpb24oZSx0KXtyZXR1cm4gTW9kdWxlLkhFQVBVOC5zdWJhcnJheShlLGUrdCl9LERlY29kZXIucHJvdG90eXBlLmluaXQ9ZnVuY3Rpb24oKXtNb2R1bGUuX2Jyb2Fkd2F5SW5pdCgwLDEpLHRoaXMub2Zmc2V0PU1vZHVsZS5fYnJvYWR3YXlDcmVhdGVTdHJlYW0oTUFYX1NUUkVBTV9CVUZGRVJfTEVOR1RIKX0sRGVjb2Rlci5wcm90b3R5cGUuYnJvYWR3YXlPblBpY3R1cmVEZWNvZGVkPWZ1bmN0aW9uKGUsdCxvLG4saSl7dmFyIHM9dGhpcy5pbmZvbGlzdC5zaGlmdCgpLHI9byxhPW8vMixjPXQsZD10LzI7aWYoIXRoaXMubWV0YXx8NDQ0IT09dGhpcy5tZXRhLmNocm9tYUZvcm1hdCYmNDIyIT09dGhpcy5tZXRhLmNocm9tYUZvcm1hdHx8KGE9byksIXN8fCFzLnByZWNpc2VTZWVrfHxzLm91dHB1dCl7dmFyIGY9dGhpcy50b1U4QXJyYXkoZSxjKnIrZCphKjIpLHU9bmV3IFVpbnQ4QXJyYXkoZi5sZW5ndGgpO3Uuc2V0KGYpO3ZhciBsPXUuYnVmZmVyO3RoaXMuc2VsZi5wb3N0TWVzc2FnZSh7bXNnOiJERUNPREVEIix3aWR0aDp0LGhlaWdodDpvLHlMaW5lc2l6ZTpjLHV2TGluZXNpemU6ZCxpbmZvOnMsYnVmZmVyOmx9LFtsXSl9fSxEZWNvZGVyLnByb3RvdHlwZS5icm9hZHdheU9uQnJvYWR3YXlJbml0ZWQ9ZnVuY3Rpb24oKXtpZighdGhpcy5pbml0ZWQpe3RoaXMuaW5pdGVkPSEwO3ZhciBlPTA7aW5pdFRzJiYoZT1wZXJmb3JtYW5jZS5ub3coKS1pbml0VHMpLHRoaXMuc2VsZi5wb3N0TWVzc2FnZSh7bXNnOiJERUNPREVSX1JFQURZIixjb3N0OmV9KX19LERlY29kZXIucHJvdG90eXBlLmRlY29kZT1mdW5jdGlvbihlLHQpe3ZhciBvPXBhcnNlSW50KChuZXcgRGF0ZSkuZ2V0VGltZSgpKSxuPW8tMWU5Kk1hdGguZmxvb3Ioby8xZTkpO3RoaXMuaW5mb2xpc3QucHVzaCh0KSx0JiZ0LmtleWZyYW1lJiYodGhpcy5pbmZvbGlzdD1bdF0sTW9kdWxlLl9icm9hZHdheUZsdXNoU3RyZWFtKG4pKSxNb2R1bGUuSEVBUFU4LnNldChlLHRoaXMub2Zmc2V0KSxNb2R1bGUuX2Jyb2Fkd2F5UGxheVN0cmVhbShlLmxlbmd0aCx0aGlzLmluZm9JZCl9LERlY29kZXIucHJvdG90eXBlLmZsdXNoPWZ1bmN0aW9uKCl7TW9kdWxlLl9icm9hZHdheUZsdXNoU3RyZWFtKCl9LERlY29kZXIucHJvdG90eXBlLmRlc3Ryb3k9ZnVuY3Rpb24oKXtNb2R1bGUuX2Jyb2Fkd2F5RXhpdCgpfSxEZWNvZGVyLnByb3RvdHlwZS51cGRhdGVNZXRhPWZ1bmN0aW9uKGUpe3RoaXMubWV0YT1lfTt2YXIgV0FTTV9DRE5fUEFUSF9QUkVGSVg9IiI7ZnVuY3Rpb24gaW5pdChlKXtXQVNNX0NETl9QQVRIX1BSRUZJWD1lLnNwbGl0KCIvIikuc2xpY2UoMCwtMSkuam9pbigiLyIpLGluaXRUcz1wZXJmb3JtYW5jZS5ub3coKTt2YXIgdD0vYXNtLy50ZXN0KGUpO2RlY29kZXJ8fChzZWxmLmltcG9ydFNjcmlwdHM/bmV3IFByb21pc2UoKGZ1bmN0aW9uKHQsbyl7c2VsZi5jb25zb2xlfHwoc2VsZi5jb25zb2xlPXtsb2c6ZnVuY3Rpb24oKXt9LHdhcm46ZnVuY3Rpb24oKXt9LGluZm86ZnVuY3Rpb24oKXt9LGVycm9yOmZ1bmN0aW9uKCl7fX0pO3RyeXtzZWxmLmltcG9ydFNjcmlwdHMoZSksdCgpfWNhdGNoKG4pe2lmKG4ubWVzc2FnZS5pbmNsdWRlcygiTW9kdWxlIHNjcmlwdHMgZG9uJ3Qgc3VwcG9ydCBpbXBvcnRTY3JpcHRzIikpcmV0dXJuIHQoc2hpbUltcG9ydFNjcmlwdHMoZSkpO28obil9fSkpOnNoaW1JbXBvcnRTY3JpcHRzKGUpKS50aGVuKChmdW5jdGlvbigpe3JldHVybiB0Pyhjb25zb2xlLmxvZygiYXV0byBpbnN0YW5jZSBEZWNvZGVyISIpLG5ldyBQcm9taXNlKChmdW5jdGlvbihlLHQpe3NldFRpbWVvdXQoKGZ1bmN0aW9uKCl7dHJ5e29uUG9zdFJ1bi5jYWxsKHNlbGYpLGUoKX1jYXRjaChvKXt0KG8pfX0pKX0pKSk6c2VsZi5tP3NlbGYubSh7aW5zdGFudGlhdGVXYXNtOmZ1bmN0aW9uKGUsdCl7ZmV0Y2goIiIuY29uY2F0KFdBU01fQ0ROX1BBVEhfUFJFRklYLCIvZGVjb2Rlci53YXNtLmpzIikpLnRoZW4oKGZ1bmN0aW9uKGUpe3JldHVybiBlLmFycmF5QnVmZmVyKCl9KSkudGhlbigoZnVuY3Rpb24odCl7cmV0dXJuIFdlYkFzc2VtYmx5Lmluc3RhbnRpYXRlKHQsZSl9KSkudGhlbigoZnVuY3Rpb24oZSl7cmV0dXJuIHQoZS5pbnN0YW5jZSl9KSl9fSkudGhlbigoZnVuY3Rpb24oZSl7c2VsZi5Nb2R1bGU9ZSxvblBvc3RSdW4uY2FsbChzZWxmKX0pKTpuZXcgUHJvbWlzZSgoZnVuY3Rpb24oZSx0KXthZGRPblBvc3RSdW4ob25Qb3N0UnVuLmJpbmQoc2VsZikpLE1vZHVsZS5vblJ1bnRpbWVJbml0aWFsaXplZD1mdW5jdGlvbigpe2UoKX0sTW9kdWxlLm9uQWJvcnQ9ZnVuY3Rpb24oZSl7dChlJiZlLm1lc3NhZ2U/ZTpuZXcgRXJyb3IoIndhc20gaW5pdCBlcnJvciIpKX0sc2V0VGltZW91dCgoZnVuY3Rpb24oKXt0KG5ldyBFcnJvcigid2FzbSBsb2FkIHRpbWVvdXQiKSl9KSw2ZTMpfSkpfSkpLmNhdGNoKChmdW5jdGlvbihlKXtzZWxmLnBvc3RNZXNzYWdlKHttc2c6IklOSVRfRkFJTEVEIixsb2c6ZS5tZXNzYWdlfSl9KSl9c2VsZi5vbm1lc3NhZ2U9ZnVuY3Rpb24oZSl7dmFyIHQ9ZS5kYXRhO2lmKHQubXNnKXtpZigiaW5pdCIhPT10Lm1zZyYmInByZWxvYWQiIT09dC5tc2cmJiFkZWNvZGVyKXJldHVybjtzd2l0Y2godC5tc2cpe2Nhc2UicHJlbG9hZCI6aW5pdCh0LnVybCk7YnJlYWs7Y2FzZSJpbml0IjpzZWxmLm1ldGE9dC5tZXRhLGluaXQodC51cmwpO2JyZWFrO2Nhc2UidXBkYXRlbWV0YSI6c2VsZi5tZXRhPXQubWV0YSxkZWNvZGVyLnVwZGF0ZU1ldGEodC5tZXRhKTticmVhaztjYXNlImluaXREZWNvZGVyIjpkZWNvZGVyLmRlY29kZSh0LmRhdGEpO2JyZWFrO2Nhc2UiZGVjb2RlIjpkZWNvZGVyLmRlY29kZSh0LmRhdGEsdC5pbmZvKTticmVhaztjYXNlImZsdXNoIjpkZWNvZGVyLmZsdXNoKCk7YnJlYWs7Y2FzZSJmaW5pc2hfZmxhZyI6c2VsZi5wb3N0TWVzc2FnZSh7bXNnOiJCQVRDSF9GSU5JU0hfRkxBRyJ9KTticmVhaztjYXNlImRlc3RvcnkiOmRlY29kZXIuZGVzdHJveSgpfX1lbHNlIHNlbGYucG9zdE1lc3NhZ2Uoe21zZzoiRVJST1I6aW52YWxpZCBtZXNzYWdlIn0pfX0pKCk7Cg==",blob$2="undefined"!=typeof window&&window.Blob&&new Blob([atob(encodedJs$2)],{type:"text/javascript;charset=utf-8"});function WorkerWrapper$2(){var e=blob$2&&(window.URL||window.webkitURL).createObjectURL(blob$2);try{return e?new Worker(e,{}):new Worker("data:application/javascript;base64,"+encodedJs$2,{type:"module"})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}var encodedJs$1="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2Z1bmN0aW9uIHNoaW1JbXBvcnRTY3JpcHRzKHNyYyl7cmV0dXJuIGZldGNoKHNyYykudGhlbigoZnVuY3Rpb24oZSl7cmV0dXJuIGUudGV4dCgpfSkpLnRoZW4oKGZ1bmN0aW9uKHRleHQpe3NlbGYuZXhwb3J0cz17fSxldmFsKHRleHQpLHNlbGYubT1leHBvcnRzLm19KSl9dmFyIE1BWF9TVFJFQU1fQlVGRkVSX0xFTkdUSD01MjQyODgwLEJBVENIX0RFQ09ERV9TSVpFPTgsaW5pdFRzPTAsRGVjb2Rlcj1mdW5jdGlvbihlKXt0aGlzLmluaXRlZD0hMSx0aGlzLmluZm9JZD0wLHRoaXMuc2VsZj1lLHRoaXMubWV0YT1lLm1ldGEsdGhpcy50cz0wLHRoaXMuaW5mb2xpc3Q9W10sZS5wYXJfYnJvYWR3YXlPbkJyb2Fkd2F5SW5pdGVkPXRoaXMuYnJvYWR3YXlPbkJyb2Fkd2F5SW5pdGVkLmJpbmQodGhpcyksZS5wYXJfYnJvYWR3YXlPblBpY3R1cmVEZWNvZGVkPXRoaXMuYnJvYWR3YXlPblBpY3R1cmVEZWNvZGVkLmJpbmQodGhpcyl9LGRlY29kZXI7ZnVuY3Rpb24gb25Qb3N0UnVuKCl7KGRlY29kZXI9bmV3IERlY29kZXIodGhpcykpLmluaXQoKX1EZWNvZGVyLnByb3RvdHlwZS50b1U4QXJyYXk9ZnVuY3Rpb24oZSx0KXtyZXR1cm4gTW9kdWxlLkhFQVBVOC5zdWJhcnJheShlLGUrdCl9LERlY29kZXIucHJvdG90eXBlLmluaXQ9ZnVuY3Rpb24oKXtNb2R1bGUuX2Jyb2Fkd2F5SW5pdCgwLDIpLHRoaXMuc3RyZWFtQnVmZmVyUHRyPU1vZHVsZS5fYnJvYWR3YXlDcmVhdGVTdHJlYW0oTUFYX1NUUkVBTV9CVUZGRVJfTEVOR1RIKSx0aGlzLnN0cmVhbUJ1ZmZlcj10aGlzLnRvVThBcnJheSh0aGlzLnN0cmVhbUJ1ZmZlclB0cixNQVhfU1RSRUFNX0JVRkZFUl9MRU5HVEgpLHRoaXMuYnVmZmVyU2l6ZXNQdHI9TW9kdWxlLl9tYWxsb2MoNCpCQVRDSF9ERUNPREVfU0laRSksdGhpcy5idWZmZXJTaXplcz10aGlzLnRvVThBcnJheSh0aGlzLmJ1ZmZlclNpemVzUHRyLDQqQkFUQ0hfREVDT0RFX1NJWkUpLHRoaXMuc3RyZWFtQnVmZmVyT2Zmc2V0PTAsdGhpcy5mcmFtZUxlbnNPZmZzZXQ9MCx0aGlzLmZyYW1lTGVuc0J1ZmZlcj1uZXcgVWludDMyQXJyYXkoQkFUQ0hfREVDT0RFX1NJWkUpfSxEZWNvZGVyLnByb3RvdHlwZS5icm9hZHdheU9uUGljdHVyZURlY29kZWQ9ZnVuY3Rpb24oZSx0LHIpe3ZhciBzPXRoaXMuaW5mb2xpc3Quc2hpZnQoKSxvPXIsaT1yLzIsbj10LGY9dC8yOyF0aGlzLm1ldGF8fDQ0NCE9PXRoaXMubWV0YS5jaHJvbWFGb3JtYXQmJjQyMiE9PXRoaXMubWV0YS5jaHJvbWFGb3JtYXR8fChpPXIpO3ZhciBhPXRoaXMudG9VOEFycmF5KGUsbipvK2YqaSoyKSxjPW5ldyBVaW50OEFycmF5KGEubGVuZ3RoKTtjLnNldChhKTt2YXIgZD1jLmJ1ZmZlcjt0aGlzLnNlbGYucG9zdE1lc3NhZ2Uoe21zZzoiREVDT0RFRCIsd2lkdGg6dCxoZWlnaHQ6cix5TGluZXNpemU6bix1dkxpbmVzaXplOmYsaW5mbzpzLGJ1ZmZlcjpkfSxbZF0pfSxEZWNvZGVyLnByb3RvdHlwZS5icm9hZHdheU9uQnJvYWR3YXlJbml0ZWQ9ZnVuY3Rpb24oKXtpZighdGhpcy5pbml0ZWQpe3RoaXMuaW5pdGVkPSEwO3ZhciBlPTA7aW5pdFRzJiYoZT1wZXJmb3JtYW5jZS5ub3coKS1pbml0VHMpLHRoaXMuc2VsZi5wb3N0TWVzc2FnZSh7bXNnOiJERUNPREVSX1JFQURZIixjb3N0OmV9KX19LERlY29kZXIucHJvdG90eXBlLnN0b3JlQnVmZmVyPWZ1bmN0aW9uKGUsdCl7dCYmdC5rZXlmcmFtZSYmdGhpcy5mbHVzaCgpLHRoaXMuaW5mb2xpc3QucHVzaCh0KSx0aGlzLnN0cmVhbUJ1ZmZlci5zZXQoZSx0aGlzLnN0cmVhbUJ1ZmZlck9mZnNldCksdGhpcy5mcmFtZUxlbnNCdWZmZXJbdGhpcy5mcmFtZUxlbnNPZmZzZXRdPWUubGVuZ3RoLHRoaXMuc3RyZWFtQnVmZmVyT2Zmc2V0Kz1lLmxlbmd0aCx0aGlzLmZyYW1lTGVuc09mZnNldCs9MSx0aGlzLmJhdGNoRGVjb2RlKCl9LERlY29kZXIucHJvdG90eXBlLmJhdGNoRGVjb2RlPWZ1bmN0aW9uKGUpeyh0aGlzLmZyYW1lTGVuc09mZnNldD49QkFUQ0hfREVDT0RFX1NJWkV8fGUmJnRoaXMuZnJhbWVMZW5zT2Zmc2V0KSYmKHRoaXMuYnVmZmVyU2l6ZXMuc2V0KG5ldyBVaW50OEFycmF5KHRoaXMuZnJhbWVMZW5zQnVmZmVyLmJ1ZmZlciksMCksTW9kdWxlLl9icm9hZHdheVBsYXlTdHJlYW0xKHRoaXMuYnVmZmVyU2l6ZXNQdHIsdGhpcy5mcmFtZUxlbnNPZmZzZXQpLHRoaXMuZnJhbWVMZW5zT2Zmc2V0PTAsdGhpcy5zdHJlYW1CdWZmZXJPZmZzZXQ9MCl9LERlY29kZXIucHJvdG90eXBlLmRlY29kZT1mdW5jdGlvbihlKXt0aGlzLnN0cmVhbUJ1ZmZlci5zZXQoZSksTW9kdWxlLl9icm9hZHdheVBsYXlTdHJlYW0oZS5sZW5ndGgsMCl9LERlY29kZXIucHJvdG90eXBlLmZsdXNoPWZ1bmN0aW9uKCl7dGhpcy5iYXRjaERlY29kZSghMCksTW9kdWxlLl9icm9hZHdheUZsdXNoU3RyZWFtKCl9LERlY29kZXIucHJvdG90eXBlLmRlc3Ryb3k9ZnVuY3Rpb24oKXtNb2R1bGUuX2Jyb2Fkd2F5RXhpdCgpfSxEZWNvZGVyLnByb3RvdHlwZS51cGRhdGVNZXRhPWZ1bmN0aW9uKGUpe3RoaXMubWV0YT1lfTt2YXIgV0FTTV9DRE5fUEFUSF9QUkVGSVg9IiI7ZnVuY3Rpb24gaW5pdChlKXsoV0FTTV9DRE5fUEFUSF9QUkVGSVg9ZS5zcGxpdCgiLyIpLnNsaWNlKDAsLTEpLmpvaW4oIi8iKSxpbml0VHM9cGVyZm9ybWFuY2Uubm93KCksZGVjb2Rlcil8fChzZWxmLmltcG9ydFNjcmlwdHM/bmV3IFByb21pc2UoKGZ1bmN0aW9uKHQscil7c2VsZi5jb25zb2xlfHwoc2VsZi5jb25zb2xlPXtsb2c6ZnVuY3Rpb24oKXt9LHdhcm46ZnVuY3Rpb24oKXt9LGluZm86ZnVuY3Rpb24oKXt9LGVycm9yOmZ1bmN0aW9uKCl7fX0pO3RyeXtzZWxmLmltcG9ydFNjcmlwdHMoZSksdCgpfWNhdGNoKHMpe2lmKHMubWVzc2FnZS5pbmNsdWRlcygiTW9kdWxlIHNjcmlwdHMgZG9uJ3Qgc3VwcG9ydCBpbXBvcnRTY3JpcHRzIikpcmV0dXJuIHQoc2hpbUltcG9ydFNjcmlwdHMoZSkpO3Iocyl9fSkpOnNoaW1JbXBvcnRTY3JpcHRzKGUpKS50aGVuKChmdW5jdGlvbigpe3JldHVybiBmZXRjaChXQVNNX0NETl9QQVRIX1BSRUZJWCsiL2RlY29kZXIud29ya2VyLmpzIikudGhlbigoZnVuY3Rpb24oZSl7cmV0dXJuIGUuYmxvYigpfSkpLnRoZW4oKGZ1bmN0aW9uKGUpe3JldHVybiBzZWxmLm0oe2xvY2F0ZUZpbGU6ZnVuY3Rpb24odCl7cmV0dXJuL1wud29ya2VyXC5qcyQvLnRlc3QodCk/VVJMLmNyZWF0ZU9iamVjdFVSTChlKTovXC53YXNtJC8udGVzdCh0KT9XQVNNX0NETl9QQVRIX1BSRUZJWCsiL2RlY29kZXIud2FzbSI6L1wubWVtJC8udGVzdCh0KT9XQVNNX0NETl9QQVRIX1BSRUZJWCsiL2RlY29kZXIuanMubWVtIjp2b2lkIDB9LG1haW5TY3JpcHRVcmxPckJsb2I6V0FTTV9DRE5fUEFUSF9QUkVGSVgrIi9kZWNvZGVyLmpzIn0pfSkpLnRoZW4oKGZ1bmN0aW9uKGUpe3NlbGYuTW9kdWxlPWUsb25Qb3N0UnVuLmNhbGwoc2VsZil9KSl9KSkuY2F0Y2goKGZ1bmN0aW9uKGUpe3NlbGYucG9zdE1lc3NhZ2Uoe21zZzoiSU5JVF9GQUlMRUQiLGxvZzplLm1lc3NhZ2V9KX0pKX1zZWxmLm9ubWVzc2FnZT1mdW5jdGlvbihlKXt2YXIgdD1lLmRhdGE7aWYoImluaXQiPT09dC5tc2d8fCJwcmVsb2FkIj09PXQubXNnfHxkZWNvZGVyKXN3aXRjaCh0Lm1zZyl7Y2FzZSJwcmVsb2FkIjppbml0KHQudXJsKSxCQVRDSF9ERUNPREVfU0laRT10LmJhdGNoRGVjb2RlQ291bnQ7YnJlYWs7Y2FzZSJpbml0IjpzZWxmLm1ldGE9dC5tZXRhLEJBVENIX0RFQ09ERV9TSVpFPXQuYmF0Y2hEZWNvZGVDb3VudCxpbml0KHQudXJsKTticmVhaztjYXNlInVwZGF0ZW1ldGEiOnNlbGYubWV0YT10Lm1ldGEsZGVjb2Rlci51cGRhdGVNZXRhKHQubWV0YSk7YnJlYWs7Y2FzZSJpbml0RGVjb2RlciI6ZGVjb2Rlci5mcmFtZUxlbnNPZmZzZXQmJmRlY29kZXIuYmF0Y2hEZWNvZGUoITApLGRlY29kZXIuZmx1c2goKSxkZWNvZGVyLmRlY29kZSh0LmRhdGEpO2JyZWFrO2Nhc2UiZGVjb2RlIjpkZWNvZGVyLnN0b3JlQnVmZmVyKHQuZGF0YSx0LmluZm8pO2JyZWFrO2Nhc2UiZmx1c2giOmRlY29kZXIuZmx1c2goKTticmVhaztjYXNlImZpbmlzaF9mbGFnIjpzZWxmLnBvc3RNZXNzYWdlKHttc2c6IkJBVENIX0ZJTklTSF9GTEFHIn0pO2JyZWFrO2Nhc2UiZGVzdG9yeSI6ZGVjb2Rlci5kZXN0cm95KCl9fX0pKCk7Cg==",blob$1="undefined"!=typeof window&&window.Blob&&new Blob([atob(encodedJs$1)],{type:"text/javascript;charset=utf-8"});function WorkerWrapper$1(){var e=blob$1&&(window.URL||window.webkitURL).createObjectURL(blob$1);try{return e?new Worker(e,{}):new Worker("data:application/javascript;base64,"+encodedJs$1,{type:"module"})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}var encodedJs="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2Z1bmN0aW9uIHNoaW1JbXBvcnRTY3JpcHRzKHNyYyl7cmV0dXJuIGZldGNoKHNyYykudGhlbigoZnVuY3Rpb24oZSl7cmV0dXJuIGUudGV4dCgpfSkpLnRoZW4oKGZ1bmN0aW9uKHRleHQpe3NlbGYuZXhwb3J0cz17fSxldmFsKHRleHQpLHNlbGYubT1leHBvcnRzLm19KSl9dmFyIE1BWF9TVFJFQU1fQlVGRkVSX0xFTkdUSD0xMDQ4NTc2LGluaXRUcz0wLERlY29kZXI9ZnVuY3Rpb24oZSl7dGhpcy5pbml0ZWQ9ITEsdGhpcy5zZWxmPWUsdGhpcy5tZXRhPWUubWV0YSx0aGlzLmluZm9saXN0PVtdLGUucGFyX2Jyb2Fkd2F5T25Ccm9hZHdheUluaXRlZD10aGlzLmJyb2Fkd2F5T25Ccm9hZHdheUluaXRlZC5iaW5kKHRoaXMpLGUucGFyX2Jyb2Fkd2F5T25QaWN0dXJlRGVjb2RlZD10aGlzLmJyb2Fkd2F5T25QaWN0dXJlRGVjb2RlZC5iaW5kKHRoaXMpfSxkZWNvZGVyO2Z1bmN0aW9uIG9uUG9zdFJ1bigpeyhkZWNvZGVyPW5ldyBEZWNvZGVyKHRoaXMpKS5pbml0KCl9RGVjb2Rlci5wcm90b3R5cGUudG9VOEFycmF5PWZ1bmN0aW9uKGUsdCl7cmV0dXJuIE1vZHVsZS5IRUFQVTguc3ViYXJyYXkoZSxlK3QpfSxEZWNvZGVyLnByb3RvdHlwZS5pbml0PWZ1bmN0aW9uKCl7TW9kdWxlLl9icm9hZHdheUluaXQoKSx0aGlzLnN0cmVhbUJ1ZmZlcj10aGlzLnRvVThBcnJheShNb2R1bGUuX2Jyb2Fkd2F5Q3JlYXRlU3RyZWFtKE1BWF9TVFJFQU1fQlVGRkVSX0xFTkdUSCwwKSxNQVhfU1RSRUFNX0JVRkZFUl9MRU5HVEgpfSxEZWNvZGVyLnByb3RvdHlwZS5icm9hZHdheU9uUGljdHVyZURlY29kZWQ9ZnVuY3Rpb24oZSx0LG8saSxuLHMscil7dmFyIGE9dGhpcy5pbmZvbGlzdFswXTtpZighYXx8IWEua2V5ZnJhbWV8fHIpe3ZhciBjPU9iamVjdC5hc3NpZ24oe30sdGhpcy5pbmZvbGlzdC5zaGlmdCgpKSxkPW8sZj1vLzI7IXRoaXMubWV0YXx8NDQ0IT09dGhpcy5tZXRhLmNocm9tYUZvcm1hdCYmNDIyIT09dGhpcy5tZXRhLmNocm9tYUZvcm1hdHx8KGY9byk7dmFyIHU9dGhpcy50b1U4QXJyYXkoZSxpKmQrbipmKjIpLGw9bmV3IFVpbnQ4QXJyYXkodS5sZW5ndGgpO2wuc2V0KHUpO3ZhciBtPWwuYnVmZmVyO3RoaXMuc2VsZi5wb3N0TWVzc2FnZSh7bXNnOiJERUNPREVEIix3aWR0aDp0LGhlaWdodDpvLHlMaW5lc2l6ZTppLHV2TGluZXNpemU6bixpbmZvOmMsYnVmZmVyOm19LFttXSl9fSxEZWNvZGVyLnByb3RvdHlwZS5icm9hZHdheU9uQnJvYWR3YXlJbml0ZWQ9ZnVuY3Rpb24oKXt0aGlzLmluaXRlZD0hMDt2YXIgZT0wO2luaXRUcyYmKGU9cGVyZm9ybWFuY2Uubm93KCktaW5pdFRzKSx0aGlzLnNlbGYucG9zdE1lc3NhZ2Uoe21zZzoiREVDT0RFUl9SRUFEWSIsY29zdDplfSl9LERlY29kZXIucHJvdG90eXBlLmRlY29kZT1mdW5jdGlvbihlLHQpe3QmJnRoaXMuaW5mb2xpc3QucHVzaCh0KSx0JiZ0LmtleWZyYW1lJiYodGhpcy5pbmZvbGlzdD1bdF0pLHRoaXMuc3RyZWFtQnVmZmVyLnNldChlKSxNb2R1bGUuX2Jyb2Fkd2F5UGxheVN0cmVhbShlLmxlbmd0aCwwKX0sRGVjb2Rlci5wcm90b3R5cGUuZGVzdHJveT1mdW5jdGlvbigpe01vZHVsZS5fYnJvYWR3YXlFeGl0KCl9LERlY29kZXIucHJvdG90eXBlLnVwZGF0ZU1ldGE9ZnVuY3Rpb24oZSl7dGhpcy5tZXRhPWV9O3ZhciBXQVNNX0NETl9QQVRIX1BSRUZJWD0iIjtmdW5jdGlvbiBpbml0KGUpe1dBU01fQ0ROX1BBVEhfUFJFRklYPWUuc3BsaXQoIi8iKS5zbGljZSgwLC0xKS5qb2luKCIvIiksaW5pdFRzPXBlcmZvcm1hbmNlLm5vdygpO3ZhciB0PS9hc20vLnRlc3QoZSk7ZGVjb2Rlcnx8KHNlbGYuaW1wb3J0U2NyaXB0cz9uZXcgUHJvbWlzZSgoZnVuY3Rpb24odCxvKXtzZWxmLmNvbnNvbGV8fChzZWxmLmNvbnNvbGU9e2xvZzpmdW5jdGlvbigpe30sd2FybjpmdW5jdGlvbigpe30saW5mbzpmdW5jdGlvbigpe30sZXJyb3I6ZnVuY3Rpb24oKXt9fSk7dHJ5e3NlbGYuaW1wb3J0U2NyaXB0cyhlKSx0KCl9Y2F0Y2goaSl7aWYoaS5tZXNzYWdlLmluY2x1ZGVzKCJNb2R1bGUgc2NyaXB0cyBkb24ndCBzdXBwb3J0IGltcG9ydFNjcmlwdHMiKSlyZXR1cm4gdChzaGltSW1wb3J0U2NyaXB0cyhlKSk7byhpKX19KSk6c2hpbUltcG9ydFNjcmlwdHMoZSkpLnRoZW4oKGZ1bmN0aW9uKCl7cmV0dXJuIHQ/KGNvbnNvbGUubG9nKCJhdXRvIGluc3RhbmNlIERlY29kZXIhIiksbmV3IFByb21pc2UoKGZ1bmN0aW9uKGUsdCl7c2V0VGltZW91dCgoZnVuY3Rpb24oKXt0cnl7b25Qb3N0UnVuLmNhbGwoc2VsZiksZSgpfWNhdGNoKG8pe3Qobyl9fSkpfSkpKTpzZWxmLm0oe2luc3RhbnRpYXRlV2FzbTpmdW5jdGlvbihlLHQpe2ZldGNoKCIiLmNvbmNhdChXQVNNX0NETl9QQVRIX1BSRUZJWCwiL2RlY29kZXIud2FzbS5qcyIpKS50aGVuKChmdW5jdGlvbihlKXtyZXR1cm4gZS5hcnJheUJ1ZmZlcigpfSkpLnRoZW4oKGZ1bmN0aW9uKHQpe3JldHVybiBXZWJBc3NlbWJseS5pbnN0YW50aWF0ZSh0LGUpfSkpLnRoZW4oKGZ1bmN0aW9uKGUpe3JldHVybiB0KGUuaW5zdGFuY2UpfSkpfX0pLnRoZW4oKGZ1bmN0aW9uKGUpe3NlbGYuTW9kdWxlPWUsb25Qb3N0UnVuLmNhbGwoc2VsZil9KSl9KSkuY2F0Y2goKGZ1bmN0aW9uKGUpe3NlbGYucG9zdE1lc3NhZ2Uoe21zZzoiSU5JVF9GQUlMRUQiLGxvZzplLm1lc3NhZ2V9KX0pKX1zZWxmLm9ubWVzc2FnZT1mdW5jdGlvbihlKXt2YXIgdD1lLmRhdGE7aWYoImluaXQiPT09dC5tc2d8fCJwcmVsb2FkIj09PXQubXNnfHxkZWNvZGVyKXN3aXRjaCh0Lm1zZyl7Y2FzZSJwcmVsb2FkIjppbml0KHQudXJsKTticmVhaztjYXNlImluaXQiOnNlbGYubWV0YT10Lm1ldGEsc2VsZi5wb3N0TWVzc2FnZSh7bXNnOiJMT0ciLGxvZzoid29ya2VyIGluaXRlZCJ9KSxpbml0KHQudXJsKTticmVhaztjYXNlInVwZGF0ZW1ldGEiOnNlbGYubWV0YT10Lm1ldGEsZGVjb2Rlci51cGRhdGVNZXRhKHQubWV0YSk7YnJlYWs7Y2FzZSJpbml0RGVjb2RlciI6ZGVjb2Rlci5kZWNvZGUodC5kYXRhKTticmVhaztjYXNlImRlY29kZSI6ZGVjb2Rlci5kZWNvZGUodC5kYXRhLHQuaW5mbyk7YnJlYWs7Y2FzZSJmaW5pc2hfZmxhZyI6c2VsZi5wb3N0TWVzc2FnZSh7bXNnOiJCQVRDSF9GSU5JU0hfRkxBRyJ9KTticmVhaztjYXNlImRlc3RvcnkiOmRlY29kZXIuZGVzdHJveSgpfX19KSgpOwo=",blob="undefined"!=typeof window&&window.Blob&&new Blob([atob(encodedJs)],{type:"text/javascript;charset=utf-8"});function WorkerWrapper(){var e=blob&&(window.URL||window.webkitURL).createObjectURL(blob);try{return e?new Worker(e,{}):new Worker("data:application/javascript;base64,"+encodedJs,{type:"module"})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}var DecoderCache=function(){function e(){_classCallCheck$2(this,e),_defineProperty$2(this,"_queue",[]),_defineProperty$2(this,"_pendingDecoder",null),_defineProperty$2(this,"TAG","DecoderCache")}return _createClass$2(e,[{key:"genDecoder",value:function(e){return this._initDecoder(e)}},{key:"_initDecoder",value:function(e){var t=this,r=getDecodeCapacaity(),n=r.preloadDecoder,i=r.maxDecodeOnceWasm;e=e||n;var o,a,s=getDecoderUrls(),c=s.H264_DECODER_URL,u=s.H265_SIMD_DECODER_URL,l=s.H265_DECODER_URL,A=s.H265_THREAD_DECODER_URL,d=1;if("h265"===e&&(simdSupported()?(o=new WorkerWrapper$2,a=u,d=2):threadSupported()&&getDecodeCapacaity().canUseThreadMode?(o=new WorkerWrapper$1,a=A,d=1):(o=new WorkerWrapper$2,a=l,d=3)),"h264"===e&&(o=new WorkerWrapper,a=c,d=3),!o)return Promise.resolve();var h=promiseDelayed();o.postMessage({msg:"preload",batchDecodeCount:i,url:a}),this._pendingDecoder=o,o.id=Date.now()+parseInt(1e3*Math.random()),o.isHevc="h265"===e,o.using=!1,o.ready=!1,logger.log(this.TAG,"start init decoder worker, id=",o.id,"hevc=",o.isHevc,"mode=",d);var f=function e(r){t._pendingDecoder=null;var n=r.data.msg;switch("DECODER_READY"!==n&&"INIT_FAILED"!==n||(o.removeEventListener("message",e),o.removeEventListener("error",p)),n){case"DECODER_READY":logger.log(t.TAG,"decoder worker inited!, id=",o.id,"cost:",r.data.cost),o.ready=!0,o.using||t._queue.push(o),h.resolve();break;case"INIT_FAILED":logger.log(t.TAG,"decoder worker init failed!",r.data.log),h.reject(r.data.log)}},p=function e(t){o.removeEventListener("message",f),o.removeEventListener("error",e),h.reject(null==t?void 0:t.message)};return o.addEventListener("message",f),o.addEventListener("error",p),h}},{key:"cacheDecoder",value:function(e){e.using=!1,e.ready=!0,e.id||(e.id=Date.now()+parseInt(1e3*Math.random())),this._queue.push(e),logger.log(this.TAG,"cache decoder, id=",e.id),"h265"===getDecodeCapacaity().preloadDecoder&&1===this._queue.filter((function(e){return!e.using&&e.isHevc})).length&&this.genDecoder("h265")}},{key:"getCachedDecoder",value:function(e){var t,r=this._queue.findIndex((function(t){return!t.using&&t.isHevc===e}));if(-1!==r&&(t=this._queue.splice(r,1)[0]),!t&&this._pendingDecoder&&(t=this._pendingDecoder,this._pendingDecoder=null),t)return t.using=!0,logger.warn(this.TAG,"get cached decoder, id=".concat(t.id,", ready=").concat(t.ready)),t}}]),e}(),decoderCache=new DecoderCache,MAX_DECODE_ONCE_DEFAULT=getDecodeCapacaity().maxDecodeOnceWasm,WasmDecodeController=function(e){_inherits$1(r,DecodeController);var t=_createSuper$1(r);function r(){var e;_classCallCheck$2(this,r);for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return _defineProperty$2(_assertThisInitialized$1(e=t.call.apply(t,[this].concat(i))),"TAG","WasmController"),_defineProperty$2(_assertThisInitialized$1(e),"_avccpushed",!1),_defineProperty$2(_assertThisInitialized$1(e),"_maxDecodeOnce",MAX_DECODE_ONCE_DEFAULT),_defineProperty$2(_assertThisInitialized$1(e),"_continueDecodeThreshold",MAX_DECODE_ONCE_DEFAULT/2),_defineProperty$2(_assertThisInitialized$1(e),"_wasmInitCost",0),_defineProperty$2(_assertThisInitialized$1(e),"_threadSupported",threadSupported()&&getDecodeCapacaity().canUseThreadMode),_defineProperty$2(_assertThisInitialized$1(e),"_simdSuppported",simdSupported()),_defineProperty$2(_assertThisInitialized$1(e),"_decoderMode",window.WebAssembly?3:4),e}return _createClass$2(r,[{key:"wasmInitCost",get:function(){var e;return null===(e=this._decoderWorker)||void 0===e?void 0:e._wasmInitCost}},{key:"isHevc",get:function(){var e;return null===(e=this._parent)||void 0===e?void 0:e.isHevc}},{key:"_selectDecodeWorker",value:function(){this.analyse.addWasmInit();var e,t=getDecoderUrls(),r=t.H264_DECODER_URL,n=t.H265_DECODER_URL,i=t.H265_THREAD_DECODER_URL,o=t.H265_SIMD_DECODER_URL,a=t.ASM_H264_DECODER_URL,s=t.ASM_H265_DECODER_URL;return logger.log(this.TAG,"start init wasm worker:",performance.now(),"hevc:",this.isHevc,"decoderMode:",this._decoderMode),this.isHevc?(e=1===this._decoderMode?i:2===this._decoderMode?o:3===this._decoderMode?n:s)?{decoder:1===this._decoderMode?new WorkerWrapper$1:new WorkerWrapper$2,url:e}:void this._workerErrorCallback("no found decoder url, decodeMode:".concat(this._decoderMode)):(e=4===this._decoderMode?a:r)?{decoder:new WorkerWrapper,url:e}:void this._workerErrorCallback("no found decoder url, decodeMode:".concat(this._decoderMode))}},{key:"_initWorker",value:function(){this.isHevc&&(this._threadSupported&&(this._decoderMode=1),this._simdSuppported&&(this._decoderMode=2)),this._initDecodeWorkerInternal()}},{key:"_initDecodeWorkerInternal",value:function(){var e=decoderCache.getCachedDecoder(this.isHevc);if(e)return logger.warn(this.TAG,"select decoder from cache"),this.analyse.addWasmInit(),this._avccpushed=!1,this._bindWorkerEvent(e),this._decoderWorker=e,void(e.ready&&(this._decoderReady=!0,this._initDecoderWithConfiguration(e,this.meta),this._workerMessageCallback({type:"DECODER_READY",data:e}),logger.log(this.TAG,"decoder ready!")));var t=this._selectDecodeWorker()||{},r=t.decoder,n=t.url;r&&(this._avccpushed=!1,this._bindWorkerEvent(r),r.isHevc=this.isHevc,r.postMessage({msg:"init",meta:this.meta,batchDecodeCount:MAX_DECODE_ONCE_DEFAULT,url:n}),this._decoderWorker=r)}},{key:"_bindWorkerEvent",value:function(e){var t=this,r=function(r,n){logger.log(t.TAG,"worker failed: ",r,n),t._terminateWorker(e),t._decoderWorker=null,!1===getDecodeCapacaity().wasmFallbackToAsm||4===t._decoderMode?t._workerErrorCallback(r):(t._decoderMode=1===t._decoderMode||2===t._decoderMode?3:4,t._initDecodeWorkerInternal())};e._onMessage=function(n){var i,o;switch(n.data.msg){case"DECODER_READY":if(logger.log(t.TAG,"wasm worker ready!","cost:",n.data.cost),t._decoderReady=!0,e._wasmInitCost=parseInt(n.data.cost),!t.meta)return;t._avccpushed||t._initDecoderWithConfiguration(e,t.meta),t.emit(Events.VIDEO.VIDEO_DECODER_INIT,e),t._workerMessageCallback({type:"DECODER_READY",data:e});break;case"DECODED":if(t._inDecoding=!0,(null===(i=n.data)||void 0===i||null===(o=i.info)||void 0===o?void 0:o.id)!==t._id)return;t._workerMessageCallback({type:"RECEIVE_FRAME",data:n.data});break;case"BATCH_FINISH_FLAG":if(t._inDecoding=!1,!t._workerMessageCallback)return;t._workerMessageCallback({type:"BATCH_FINISH"});break;case"INIT_FAILED":r(n.data.log,1)}},e._onError=function(e){r(e.message,2)},e.addEventListener("message",e._onMessage),e.addEventListener("error",e._onError)}},{key:"_initDecoderWithConfiguration",value:function(e,t){logger.log(this.TAG,"init decoder with configuration"),this._avccpushed=!0,e.postMessage({msg:"updatemeta",meta:t});var r=[t.rawVps||t.vps[0],t.rawSps||t.sps[0],t.rawPps||t.pps[0]].filter(Boolean),n=r.reduce((function(e,t){return e+(t.byteLength+4)}),0),i=new Uint8Array(n),o=0;r.forEach((function(e){i.set([0,0,0,1],o),o+=4,i.set(e,o),o+=e.byteLength})),e.postMessage({msg:"initDecoder",data:i})}},{key:"destroy",value:function(){if(this._decoderWorker)return getDecodeCapacaity().reuseWasmDecoder?(this._offWorkerBind(this._decoderWorker),void decoderCache.cacheDecoder(this._decoderWorker)):void this._terminateWorker(this._decoderWorker)}},{key:"_offWorkerBind",value:function(e){e.removeEventListener("message",e._onMessage),e.removeEventListener("error",e._onError),e.postMessage({msg:"flush"}),e._onMessage=null,e._onError=null,logger.log(this.TAG,"flush decoder and unbind worker event")}},{key:"_terminateWorker",value:function(e){this._offWorkerBind(e),e.postMessage({msg:"destroy"}),e.terminate(),logger.log(this.TAG,"destroy decoder worker")}}]),r}(),DECODER_ERROR_SUBCODE=1,WEBGL_ERROR_SUBCODE=2,VideoRenderWithDecoder=function(e){_inherits$1(r,VideoBaseRender);var t=_createSuper$1(r);function r(){var e;_classCallCheck$2(this,r);for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return _defineProperty$2(_assertThisInitialized$1(e=t.call.apply(t,[this].concat(i))),"TAG","VideoRenderWithDecoder"),_defineProperty$2(_assertThisInitialized$1(e),"_hideRenderFlag",0),_defineProperty$2(_assertThisInitialized$1(e),"_recentMeta",null),_defineProperty$2(_assertThisInitialized$1(e),"_inChaseFrame",!1),_defineProperty$2(_assertThisInitialized$1(e),"_decoderErrorCallback",(function(t){e._emitTimelineEvents(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.ERROR,e._assembleErr(t,DECODER_ERROR_SUBCODE))})),_defineProperty$2(_assertThisInitialized$1(e),"_decoderMessageCallback",(function(t){var r,n,i,o=t.type,a=t.data;switch(o){case"DECODER_READY":if(e.analyse.addWasmReady(),!e._frameRender){var s=Object.assign(e._config,{meta:e._meta,canvas:e._canvas,type:e._decodeController.webcodec?"2d":""});try{e._canvas.glInstance?(e._frameRender=e._canvas.glInstance,e._frameRender.updateBind(_assertThisInitialized$1(e),e._meta),logger.warn(e.TAG,"reuse canvas and context")):(e._frameRender=new FrameRender(s,_assertThisInitialized$1(e)),logger.log(e.TAG,"create frameRender with config",s))}catch(t){e._emitTimelineEvents(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.ERROR,e._assembleErr(t&&t.message,WEBGL_ERROR_SUBCODE))}}e._startDecode();break;case"RECEIVE_FRAME":if(e._inChaseFrame&&(null===(r=e._decodeController)||void 0===r||!r.webcodec))return;e._receiveFrame(a);break;case"BATCH_FINISH":null===(n=_assertThisInitialized$1(e))||void 0===n||n._decodeEstimate.resetDecodeDot(),e._inChaseFrame&&(e._inChaseFrame=!1,e._frameQueue.empty()),e._ready||e.inSeeking||null===(i=e._decodeController)||void 0===i||!i.decoderReady||e._startDecode()}})),e}return _createClass$2(r,[{key:"wasmInitCost",get:function(){var e;return null===(e=this._decodeController)||void 0===e?void 0:e.wasmInitCost}},{key:"hevcThread",get:function(){return 1===this.decodeMode}},{key:"lowlatency",get:function(){return this._parent.lowlatency}},{key:"nextFrameTime",get:function(){var e=this._frameQueue.nextFrame();return(e&&e.info&&e.info.dts||0)/1e3}},{key:"ajustSeekTime",value:function(e,t){var r;logger.log(this.TAG,"ajust seek time: ",e),this._frameQueue.empty(),null===(r=this._decodeController)||void 0===r||r.flushDecoder(),this._switchVideoBuffer(e,t)}},{key:"canSeek",value:function(){return!0}},{key:"_appendChunk",value:function(e){var t;if(!this.noVideo&&this._timeRange){if(this._meta){if(this._recentMeta.width!==e.width||this._recentMeta.height!==e.height){logger.warn(this.TAG,"metadata changed! width: ".concat(this._recentMeta.width," -> ").concat(e.width,", height: ").concat(this._recentMeta.height," -> ").concat(e.height));var r=e.samples[0];r&&(this._recentMeta=r.meta=Object.assign({},e,{samples:null}))}}else{this._emitTimelineEvents(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.LOADEDMETADATA),this._recentMeta=this._meta=Object.assign({},e,{samples:null}),logger.warn(this.TAG,"video set metadata",this._meta,"configuration:",this.configuration);var n=e.fpsNum/e.fpsDen;n?logger.log(this.TAG,"detect fps:",n):logger.warn(this.TAG,"no detect fps,start estimate"),this._selectDecoder(),this._initDecoder()}if(this._timeRange.append(e.samples,this._isLive&&this.noAudio,!this.videoDecode),e.samples=[],!this.inSeeking){var i;if(this.isLive||this._timeRange.frameLength||this._switchVideoBuffer(this._parent.currentTime),!this._ready&&null!==(t=this._decodeController)&&void 0!==t&&t.decoderReady)!this.noAudio&&null!==(i=this._decodeController)&&void 0!==i&&i.inDecoding||this._startDecode();this.noAudio&&this._emitTimelineEvents(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.DURATION_CHANGE)}}}},{key:"_selectDecoder",value:function(){if(!this.isHevc&&WebCodecDecodeController.isSupported())return this._decodeController=new WebCodecDecodeController(this),void(this._decodeEstimate.webcodec=!0);this._decodeController=new WasmDecodeController(this)}},{key:"_initDecoder",value:function(){var e;null===(e=this._decodeController)||void 0===e||e.init(this._decoderMessageCallback,this._decoderErrorCallback)}},{key:"_startDecode",value:function(){var e;null===(e=this._decodeController)||void 0===e||e.doDecode()}},{key:"_switchVideoBuffer",value:function(e,t){var r=this._timeRange.switchBuffer(e);if(r){var n;if(this.noAudio&&this._parent.emit(Events.TIMELINE.SYNC_DTS,this.getDtsOfTime(r.start)),t)return void(null===(n=this._decodeController)||void 0===n||n.preciseSeek(e));this._startDecode(t)}}},{key:"_checkToDecode",value:function(){var e;this.inSeeking||null===(e=this._decodeController)||void 0===e||e.checkToDecode(this._frameQueue.length)}},{key:"_render",value:function(e){var t;if(!this.noVideo){var r=this._frameQueue&&this._frameQueue.nextFrame();if(r){var n=r.info;if(!n)return this._frameQueue.shift(),void console.error("not info");this._renderDts=n.dts;var i=n.dts-this.preciseVideoDts;if(!(!e&&i>0&&i<6e4)){this._frameQueue.shift(this.preciseVideoDts),Math.abs(this._lastTimeupdate-n.dts)>250&&(this._emitTimelineEvents(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.TIMEUPDATE,{pts:n.originPts/90}),this._lastTimeupdate=n.dts),logger.long&&logger.log(this.TAG,"render delay:".concat(i," , timelinePosition:").concat(this.preciseVideoDts," , dts:").concat(n.dts," , cost:").concat(n.cost," , gopID:").concat(n.gopId," , rest:").concat(this._frameQueue.length,", buffer frame:").concat(this._timeRange.frameLength));var o=performance.now();this._hideRenderFlag++,("visible"===document.visibilityState||this._hideRenderFlag%15)&&this._frameRender.render(r.buffer,r.width,r.height,r.yLinesize,r.uvLinesize),null!==(t=this._decodeController)&&void 0!==t&&t.webcodec&&r.buffer.close(),this._renderCost=performance.now()-o,this._checkToDecode()}}else{var a;if(logger.log(this.TAG,"lack frame, ","inDecoding:",null===(a=this._decodeController)||void 0===a?void 0:a.inDecoding),this._checkToDecode(),this.noAudio){var s;if(!this.isLive&&Math.abs(this.currentTime-this.duration)<.5)return null==this||this._emitTimelineEvents(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.TIMEUPDATE),null==this||this._emitTimelineEvents(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.ENDED),void(null===(s=this._timeRange)||void 0===s||s.clean());this._timeRange.frameLength||(this._ready=!1,this.emit(Events.VIDEO.VIDEO_WAITING))}}}}},{key:"_updateSegmentEnd",value:function(e){var t;null===(t=this._timeRange)||void 0===t||t.updateSegmentEnd(e)}},{key:"_doChaseFrame",value:function(e){var t=e.frame;this._inChaseFrame=!0,this._timeRange.deletePassed(t.dts),this._frameQueue.empty(),this.noAudio&&this._parent.emit(Events.TIMELINE.SYNC_DTS,t.dts)}},{key:"_destroy",value:function(e){var t;logger.log(this.TAG,"destroy video render"),_get(_getPrototypeOf$1(r.prototype),"destroy",this).call(this,e),null===(t=this._decodeController)||void 0===t||t.destroy(),this._decodeController=null}}]),r}(),TOLERANCE=.1,TimeLine=function(e){_inherits$1(r,EventEmitter);var t=_createSuper$1(r);function r(e,n){var i;return _classCallCheck$2(this,r),(i=t.call(this)).TAG="TimeLine",i._parent=n,i._seeking=!1,i.audioRender=AudioMseRender.isSupported()?new AudioMseRender(e,_assertThisInitialized$1(i)):new AudioRender(e,_assertThisInitialized$1(i)),i.videoRender=new VideoRenderWithDecoder(e,_assertThisInitialized$1(i)),i._readyStatus={audio:!1,video:!1},i._paused=!0,i._switchToMultiWorker=!1,i._lowdecodeEmited=!1,i._startPlayed=!1,i._emitReady=!1,i._lastSeekTime=1e-4,i._singleTrack=-1,i._bindEvent(),i._decodeVideo=e.video,i}return _createClass$2(r,[{key:"analyse",get:function(){return this._parent.analyse}},{key:"ready",get:function(){return this._readyStatus.video&&this._readyStatus.audio}},{key:"played",get:function(){var e=this;return{length:this.currentTime?1:0,start:function(){return 0},end:function(){return e.currentTime}}}},{key:"noAudio",get:function(){return 1===this._singleTrack||2===this._singleTrack}},{key:"isLive",get:function(){return this._parent.live}},{key:"seeking",get:function(){return this._seeking}},{key:"decodeFps",get:function(){return this.videoRender.decodeFps}},{key:"decodeCost",get:function(){return this.videoRender.decodeCost}},{key:"renderCost",get:function(){return this.videoRender.renderCost}},{key:"wasmInitCost",get:function(){return this.videoRender.wasmInitCost}},{key:"fps",get:function(){return this.videoRender.fps}},{key:"totalSize",get:function(){return this.videoRender.totalSize}},{key:"bitrate",get:function(){return this.videoRender.bitrate}},{key:"gopLength",get:function(){return this.videoRender.gopLength}},{key:"currentTime",get:function(){return this.noAudio?this.paused?this.videoRender.nextFrameTime:this.videoRender.currentTime:this.audioRender.currentTime}},{key:"timelinePosition",get:function(){return this.noAudio?performance.now()/1e3:this.audioRender.currentTime}},{key:"canvas",get:function(){return this.videoRender.canvas}},{key:"readyState",get:function(){return this.videoRender.readyState}},{key:"buffered",get:function(){var e=this;return this.noAudio?this.videoRender.buffered:this.isLive?this.audioRender.buffered:{length:this.audioRender.buffered.length,start:function(t){return Math.max(e.audioRender.buffered.start(t),e.videoRender.buffered.start(t))},end:function(t){return Math.min(e.audioRender.buffered.end(t),e.videoRender.buffered.end(t))}}}},{key:"duration",get:function(){return this.noAudio?this.videoRender.duration:this.isLive?this.audioRender.duration:Math.min(this.audioRender.duration,this.videoRender.duration)}},{key:"paused",get:function(){return this._paused},set:function(e){this._paused=e}},{key:"lowlatency",get:function(){return this._parent.lowlatency}},{key:"decoderMode",get:function(){return this.videoRender.decoderMode}},{key:"currentAudioCanAutoplay",get:function(){return this.audioRender.audioCanAutoplay}},{key:"_getController",value:function(e,t){return e?new VideoRenderFromVideo(t,this):new VideoRenderWithDecoder(t,this)}},{key:"_checkInBuffer",value:function(){for(var e=this.buffered,t=0,r=e.length;t<r;t++)if(e.start(t)<=this.currentTime+TOLERANCE&&e.end(t)>=this.currentTime)return!0;return!1}},{key:"_resetReadyStatus",value:function(){this._readyStatus.audio=!1,this._readyStatus.video=!1}},{key:"_bindEvent",value:function(){var e=this;this.on(Events.DECODE_EVENTS.REMUX,(function(t){e.videoRender.setRemux(t)})),this.on(Events.DECODE_EVENTS.CHASE_VIDEO_FRAME_END,(function(t){e.emit(Events.DECODE_EVENTS.CHASE_AUDIO_FRAME,t)})),this.audioRender.on(Events.AUDIO.AUDIO_READY,(function(){logger.log(e.TAG,"audio ready! seeking=",e._seeking),e._seeking&&setTimeout((function(){try{var t=e.videoRender.getSeekStartPosition(e.currentTime,1/0);if(e.audioRender.isMse&&t)return getDecodeCapacaity().preciseSeek>e.duration&&e.currentTime>TOLERANCE?(e.audioRender.seekNoSideEffect({position:e.currentTime+TOLERANCE}),void e.videoRender.ajustSeekTime(e.currentTime,!0)):(e.audioRender.seekNoSideEffect({position:t.position+TOLERANCE}),void e.videoRender.ajustSeekTime(t.position));e.videoRender.ajustSeekTime(e.currentTime)}catch(e){}}),10),e._readyStatus.video&&e._startRender(),e._readyStatus.audio=!0,e._startPlayed||e.analyse.addAudioReady()})),this.audioRender.on(Events.AUDIO.AUDIO_NOT_ALLOWED_AUTOPLAY,(function(){e._emitReady&&e.pause()})),this.audioRender.on(Events.AUDIO.AUDIO_WAITING,(function(){!e.noAudio&&e.currentTime&&(logger.warn(e.TAG,"lack data, audio waiting,currentTime:",e.currentTime),e.emit(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.TIMEUPDATE),e.emit(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.WAITING),e.emit(Events.TIMELINE.DO_PAUSE),e._readyStatus.audio=!1)})),this.videoRender.on(Events.VIDEO.VIDEO_WAITING,(function(){logger.warn(e.TAG,"lack data, video waiting"),e.emit(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.WAITING),e.emit(Events.TIMELINE.DO_PAUSE),e._readyStatus.video=!1})),this.videoRender.on(Events.VIDEO.VIDEO_READY,(function(){logger.log(e.TAG,"video ready!"),e._startPlayed||e.analyse.addVideoReady(),e._readyStatus.audio&&e._startRender("video"),e._readyStatus.video=!0})),this.videoRender.on(Events.VIDEO.DECODE_LOW_FPS,(function(){e.currentTime<2||(e.analyse.increaseLowDecodeCount(),e._lowdecodeEmited||(updateLowdecodeVV(),e._lowdecodeEmited=!0),e.emit(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.LOW_DECODE))})),this.on(Events.TIMELINE.SINGLE_TRACK,(function(t){e._singleTrack=t,1!==t&&2!==t||(e._readyStatus.audio=!0),3===t&&(e._readyStatus.video=!0),e.emit(Events.TIMELINE.SYNC_DTS,0)})),this.on(Events.TIMELINE.DESTROY,(function(){e.removeAllListeners(),e.videoRender=null,e.audioRender=null})),this.on(Events.TIMELINE.DO_PLAY,(function(){e.emit(Events.TIMELINE.START_RENDER),e._paused=!1,e._lastSeekTime=1e-4,e.noAudio&&e.emit(Events.TIMELINE.SYNC_DTS,0)}))}},{key:"_startRender",value:function(e){if(!this._parent.error&&this.videoRender){if(this.noAudio&&this.emit(Events.TIMELINE.SYNC_DTS,0),this.videoRender.forceRender(),!this.isLive&&this._paused&&this.seeking&&this._checkInBuffer())return logger.log(this.TAG,"set seeking = false"),this._seeking=!1,this.emit(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.SEEKED),void logger.groupEnd();this._startPlayed||(this.analyse.addFirstframe(),this.emit(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.LOADEDDATA),this.emit(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.FIRST_FRAME),this._startPlayed=!0),logger.log(this.TAG,"emit canplay"),this.emit(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.CANPLAY),this._parent.autoplay?(logger.warn(this.TAG,"startRender: time=",this.currentTime,"paused:",this.paused,"seeking:",this.seeking),this.emit(Events.TIMELINE.START_RENDER,e)):(this._parent.autoplay=!0,this.emit(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.PAUSE)),this.emit(Events.TIMELINE.READY),this._emitReady=!0,this._seeking&&this._checkInBuffer()&&(logger.log(this.TAG,"set seeking = false"),this._seeking=!1,this.emit(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.SEEKED),logger.groupEnd())}}},{key:"_checkHlsTracks",value:function(e){if(!(null==e?void 0:e.samples[0])){if(!this.buffered.length){var t=new Error("lack video sample");t.code=3,this.emit(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.ERROR,t)}return!1}return!0}},{key:"appendBuffer",value:function(e,t){this.emit(Events.TIMELINE.APPEND_CHUNKS,e,t),this.noAudio&&this._seeking&&this.videoRender.ajustSeekTime(this.currentTime)}},{key:"play",value:function(){var e=this;return new Promise((function(t,r){var n=e.currentAudioCanAutoplay;e.noAudio?n=!0:e.audioRender&&e.audioRender.resume().then((function(){if(logger.log(e.TAG,"audio render resumed, pause status: ".concat(e._paused,", audioCanAutoplay:").concat(e.currentAudioCanAutoplay)),e._paused||!e.currentAudioCanAutoplay)return n=!1,void e.emit(Events.TIMELINE.DO_PAUSE);n=!0})).catch((function(){})),setTimeout((function(){return logger.log(e.TAG,"play() timer done, resumed=".concat(n,", paused=").concat(e.paused)),n?e.videoRender&&!e.videoRender.canAutoPlay?(console.warn("video render an't autoplay"),e.pause(),void t()):(e._paused=!1,void t()):e.paused?void 0:(logger.log(e.TAG,"audioCtx can't autoplay"),e.pause(),void r({name:"NotAllowedError"}))}),e.audioRender.isMse?10:60)}))}},{key:"pause",value:function(){this._paused||!this.ready&&!this._seeking||(this.emit(Events.TIMELINE.DO_PAUSE),this._paused=!0,this.emit(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.PAUSE))}},{key:"seek",value:function(e){var t=this;if(this._seeking&&logger.groupEnd(),this.isLive){if(this.currentTime<TOLERANCE||!this.currentAudioCanAutoplay||this.paused)return;var r=this.videoRender.getSeekStartPosition(e,this._parent.preloadTime+1);if(r){if(r.position<this.currentTime)return;var n=this.audioRender.canSeek(r.position),i=this.videoRender.canSeek(r);if(!n||!i)return void logger.log(this.TAG,"seek, !!!!!!!!!can not seek, audioCanSeek:",n,"videoCanSeek:",i);logger.warn(this.TAG,"seek, chase frame to time: ",r.position,"currentTime:",this.currentTime,"duration:",this.duration),this.videoRender.videoDecode?(this.audioRender.doPause(),r.position=r.position-1.5,this.emit(Events.DECODE_EVENTS.CHASE_VIDEO_FRAME,r)):this.emit(Events.TIMELINE.CHASE_FRAME,r)}}else this._lastSeekTime!==e&&(e&&Math.abs(this._lastSeekTime-e)<=.2||(this._lastSeekTime=e,e>=this.duration&&(e=this.duration-1),e<0&&(e=0),logger.group(this.TAG,"start seek to:".concat(e,", set seeking status=true")),this._seeking=!0,this.videoRender.setSeekingStatus(!0),this.noAudio?(this.emit(Events.TIMELINE.SYNC_DTS,this.videoRender.getDtsOfTime(e)),this.videoRender.ajustSeekTime(e)):this._resetReadyStatus(),this.emit(Events.TIMELINE.DO_SEEK,e),new Promise((function(e){t.emit(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.SEEKING),e()}))))}}]),r}(),DESCRIPTORS=descriptors,uncurryThis$1=functionUncurryThis,objectKeys=objectKeys$3,toIndexedObject=toIndexedObject$b,$propertyIsEnumerable=objectPropertyIsEnumerable.f,propertyIsEnumerable2=uncurryThis$1($propertyIsEnumerable),push=uncurryThis$1([].push),createMethod=function(e){return function(t){for(var r,n=toIndexedObject(t),i=objectKeys(n),o=i.length,a=0,s=[];o>a;)r=i[a++],DESCRIPTORS&&!propertyIsEnumerable2(n,r)||push(s,e?[r,n[r]]:n[r]);return s}},objectToArray={entries:createMethod(!0),values:createMethod(!1)},$$1=_export,$entries=objectToArray.entries;$$1({target:"Object",stat:!0},{entries:function(e){return $entries(e)}});var $=_export,uncurryThis=functionUncurryThis,toIntegerOrInfinity=toIntegerOrInfinity$c,thisNumberValue=thisNumberValue$2,$repeat=stringRepeat,fails=fails$E,$RangeError=RangeError,$String=String,floor=Math.floor,repeat2=uncurryThis($repeat),stringSlice=uncurryThis("".slice),nativeToFixed=uncurryThis(1..toFixed),pow=function(e,t,r){return 0===t?r:t%2==1?pow(e,t-1,r*e):pow(e*e,t/2,r)},log=function(e){for(var t=0,r=e;r>=4096;)t+=12,r/=4096;for(;r>=2;)t+=1,r/=2;return t},multiply=function(e,t,r){for(var n=-1,i=r;++n<6;)i+=t*e[n],e[n]=i%1e7,i=floor(i/1e7)},divide=function(e,t){for(var r=6,n=0;--r>=0;)n+=e[r],e[r]=floor(n/t),n=n%t*1e7},dataToString=function(e){for(var t=6,r="";--t>=0;)if(""!==r||0===t||0!==e[t]){var n=$String(e[t]);r=""===r?n:r+repeat2("0",7-n.length)+n}return r},FORCED=fails((function(){return"0.000"!==nativeToFixed(8e-5,3)||"1"!==nativeToFixed(.9,0)||"1.25"!==nativeToFixed(1.255,2)||"1000000000000000128"!==nativeToFixed(0xde0b6b3a7640080,0)}))||!fails((function(){nativeToFixed({})}));$({target:"Number",proto:!0,forced:FORCED},{toFixed:function(e){var t,r,n,i,o=thisNumberValue(this),a=toIntegerOrInfinity(e),s=[0,0,0,0,0,0],c="",u="0";if(a<0||a>20)throw $RangeError("Incorrect fraction digits");if(o!=o)return"NaN";if(o<=-1e21||o>=1e21)return $String(o);if(o<0&&(c="-",o=-o),o>1e-21)if(r=(t=log(o*pow(2,69,1))-69)<0?o*pow(2,-t,1):o/pow(2,t,1),r*=4503599627370496,(t=52-t)>0){for(multiply(s,0,r),n=a;n>=7;)multiply(s,1e7,0),n-=7;for(multiply(s,pow(10,n,1),0),n=t-1;n>=23;)divide(s,1<<23),n-=23;divide(s,1<<n),multiply(s,1,1),divide(s,2),u=dataToString(s)}else multiply(s,0,r),multiply(s,1<<-t,0),u=dataToString(s)+repeat2("0",a);return u=a>0?c+((i=u.length)<=a?"0."+repeat2("0",a-i)+u:stringSlice(u,0,i-a)+"."+stringSlice(u,i-a)):c+u}});var AnalyseDots={FIRST_DATA:1,AUDIO_MSE_OPEN_START:2,AUDIO_MSE_OPEND:3,AUDIO_FIRSTTIME_APPENDED:4,AUDIO_READY:5,WASM_WORKER_INIT:6,WASM_WORKER_READY:7,FIRST_FRAME_TODECODE:8,VIDEO_READY:9,FIRST_FRAME:10,WAITIGN:11,SEEKING:12,SEEKED:13},AnalyseDotsFlat=Object.entries(AnalyseDots),Analyse=function(){function e(){_classCallCheck$2(this,e),_defineProperty$2(this,"_dot",[]),_defineProperty$2(this,"_currentLowDecodeCount",0)}return _createClass$2(e,[{key:"getBootStats",value:function(){var e,t=(null===(e=this._dot[0])||void 0===e?void 0:e.dot)||0;return this._dot.map((function(e){return{action:AnalyseDotsFlat.filter((function(t){return t[1]===e.action}))[0][1],dot:parseInt(e.dot-t)}}))}},{key:"getStats",value:function(e){var t,r=this.getBootStats();return{bootStats:r,bitrate:Math.abs(e.bitrate/1e3),decodeFps:e.decodeFps,fps:e.fps,playbackRate:e.playbackRate,firstframe:null===(t=r.filter((function(e){return 10===e.action}))[0])||void 0===t?void 0:t.dot,width:e.videoWidth,height:e.videoHeight,decoderMode:e.decoderMode,vv:getVV(),lowdecodeVV:getLowdecodeVV(),h265FailureRate:Number((100*getLowdecodePercent()).toFixed(2)),currentLowDecodeCount:this._currentLowDecodeCount}}},{key:"seekElapses",value:function(){for(var e=this.getBootStats(),t=[],r=0,n=0,i=e.length;n<i;n++){var o=e[n];o.action===AnalyseDots.SEEKING&&(r=o.dot),o.action===AnalyseDots.SEEKED&&t.push(o.dot-r)}return t}},{key:"addFirstData",value:function(){this._dot.push({action:AnalyseDots.FIRST_DATA,dot:this._getTimestap()})}},{key:"addAudioBoundMedia",value:function(){this._dot.push({action:AnalyseDots.AUDIO_BOUND_MEDIA,dot:this._getTimestap()})}},{key:"addAudioMseOpenStart",value:function(){this._dot.push({action:AnalyseDots.AUDIO_MSE_OPEN_START,dot:this._getTimestap()})}},{key:"addAudioMseOpend",value:function(){this._dot.push({action:AnalyseDots.AUDIO_MSE_OPEND,dot:this._getTimestap()})}},{key:"addAudioFirstTimeAppended",value:function(){this._dot.push({action:AnalyseDots.AUDIO_FIRSTTIME_APPENDED,dot:this._getTimestap()})}},{key:"addAudioReady",value:function(){this._dot.push({action:AnalyseDots.AUDIO_READY,dot:this._getTimestap()})}},{key:"addWasmInit",value:function(){this._dot.push({action:AnalyseDots.WASM_WORKER_INIT,dot:this._getTimestap()})}},{key:"addWasmReady",value:function(){this._dot.push({action:AnalyseDots.WASM_WORKER_READY,dot:this._getTimestap()})}},{key:"addFirstFrameToDecode",value:function(){this._dot.push({action:AnalyseDots.FIRST_FRAME_TODECODE,dot:this._getTimestap()})}},{key:"addVideoReady",value:function(){this._dot.push({action:AnalyseDots.VIDEO_READY,dot:this._getTimestap()})}},{key:"addFirstframe",value:function(){this._dot.push({action:AnalyseDots.FIRST_FRAME,dot:this._getTimestap()})}},{key:"addWaiting",value:function(){this._dot.push({action:AnalyseDots.WAITIGN,dot:this._getTimestap()})}},{key:"addSeeking",value:function(){this._dot.push({action:AnalyseDots.SEEKING,dot:this._getTimestap()})}},{key:"addSeeked",value:function(){this._dot.push({action:AnalyseDots.SEEKED,dot:this._getTimestap()})}},{key:"_getTimestap",value:function(){return performance.now()}},{key:"increaseLowDecodeCount",value:function(){this._currentLowDecodeCount++}},{key:"reset",value:function(){this._currentLowDecodeCount=0,this._dot=[]}}]),e}(),VIDEO_DECODE_MODE_VALUE="7",SINGLE_TRACK_TYPE={LOW_LATENCY:1,NO_AUDIO:2,NO_VIDEO:3},Parent="undefined"!=typeof HTMLElement?HTMLElement:function(){},XGVideo=function(e){_inherits$1(r,Parent);var t=_createSuper$1(r);function r(){var e;return _classCallCheck$2(this,r),(e=t.call(this)).TAG="XGVideo",e._proxyProps(),e._isLive=!0,e._vMeta=null,e._aMeta=null,e._resizeObserver=null,e._eventsBackup=[],e._hevc="h265"===getDecodeCapacaity().preloadDecoder,e._hevc||(e._degradeVideo=document.createElement("video")),e._debounceSeek=debounce(e._seek.bind(_assertThisInitialized$1(e)),300),e._onTouchEnd=e._onTouchEnd.bind(_assertThisInitialized$1(e)),e.analyse=new Analyse,e}return _createClass$2(r,[{key:"_proxyProps",value:function(){var e=this;Object.getOwnPropertyNames(r.prototype).forEach((function(t){if(/^__/.test(t)){var r=t.replace("__","");Object.defineProperty(e,r,{get:function(){try{return this[t]}catch(e){}return 0},set:function(e){try{this[t]=e}catch(e){}}})}}))}},{key:"addEventListener",value:function(e,t,n){_get(_getPrototypeOf$1(r.prototype),"addEventListener",this).call(this,e,t,n),this._degradeVideo&&this._eventsBackup.push([e,t,n])}},{key:"removeEventListener",value:function(e,t,n){_get(_getPrototypeOf$1(r.prototype),"removeEventListener",this).call(this,e,t,n),this._degradeVideo&&(this._eventsBackup=this._eventsBackup.filter((function(r){return!(r.eventName===e&&r.handler===t&&r.capture===n)})))}},{key:"setAttribute",value:function(e,t){var n;_get(_getPrototypeOf$1(r.prototype),"setAttribute",this).call(this,e,t),"src"!==e&&(null===(n=this._degradeVideo)||void 0===n||n.setAttribute(e,t))}},{key:"_init",value:function(){this.analyse.reset(),this.timeline=new TimeLine({volume:this.volume,canvas:this.querySelector("canvas"),videoContext:this.videoContext,videoDecode:this.videoDecode,maxVideoHeight:this.getAttribute("maxVideoHeight"),endLevel:parseInt(this.getAttribute("endLevel"))},this),logger.log(this.TAG,"timeline init"),this._noSleep=new NoSleep,this._logFirstFrame=!1,this._playRequest=null,this._degradeVideoUserGestured=!1,this._bindEvents(),this._vMeta&&!this.videoDecode&&this.setVideoMeta(this._vMeta),this._glCtxOptions&&(this.glCtxOptions=this._glCtxOptions),this.timeline&&(this.innerDegrade&&this.timeline.emit(Events.TIMELINE.INNER_DEGRADE),this.timeline.emit(Events.TIMELINE.SET_PLAY_MODE,this._isLive?"LIVE":"VOD"),this.timeline.emit(Events.TIMELINE.SET_PLAYBACKRATE,this.playbackRate),this.muted=this.muted)}},{key:"_bindEvents",value:function(){var e=this;this.timeline.on(Events.TIMELINE.PLAY_EVENT,(function(t,r){var n;t===VIDEO_EVENTS.LOADEDDATA&&(e.querySelector("canvas")||(logger.log(e.TAG,"_bindEvents, appendChild canvas"),e.appendChild(e.canvas)),e.canvas.style.display="block",null===(n=e.timeline)||void 0===n||n.emit(Events.TIMELINE.SET_PLAYBACKRATE,e.playbackRate));if(t!==VIDEO_EVENTS.LOADEDMETADATA&&t!==VIDEO_EVENTS.RESIZE||Promise.resolve().then((function(){e.updateVideoPostion()})),t===VIDEO_EVENTS.ERROR){if(logger.warn(e.TAG,"detect error:",null==r?void 0:r.message),e.pause(),e._disabled(!0),e.innerDegrade||5===e.decoderMode)return e.degradeInfo={decodeFps:e.decodeFps,bitrate:e.bitrate,wasmInitCost:e.wasmInitCost,fps:e.fps,url:e.src,msg:null==r?void 0:r.message,decoderMode:e.decoderMode},void e._innerDispatchEvent("lowdecode");e._err=r}if(t===VIDEO_EVENTS.LOW_DECODE)return e._disabled(),e.degradeInfo={decodeFps:e.decodeFps,bitrate:e.bitrate,wasmInitCost:e.wasmInitCost,fps:e.fps,url:e.src,decoderMode:e.decoderMode},void e._innerDispatchEvent(VIDEO_EVENTS_ARR[t],e.degradeInfo);if(t===VIDEO_EVENTS.LARGE_AV_GAP&&(e.unsyncInfo=r),t===VIDEO_EVENTS.ENDED){if(e.paused)return;e.pause()}t===VIDEO_EVENTS.PROGRESS&&e._noSleep.toPlay(),t===VIDEO_EVENTS.WAITING&&e.analyse.addWaiting(),t===VIDEO_EVENTS.SEEKING&&e.analyse.addSeeking(),t===VIDEO_EVENTS.SEEKED&&e.analyse.addSeeked(),e._innerDispatchEvent(VIDEO_EVENTS_ARR[t],r)}))}},{key:"_disabled",value:function(e){(this.innerDegrade||e)&&(e?getDecodeCapacaity().disabledWhenErrorOccur&&persistenceDisabledStatus(1):getDecodeCapacaity().evaluateVVCount||(this.decodeFps/this.fps<=.6&&this.bitrate<2e6?persistenceDisabledStatus(1):persistenceDisabledStatus(2)))}},{key:"degrade",value:function(e){var t=this;!!this.querySelector("canvas")?this.replaceChild(this._degradeVideo,this.canvas):this.appendChild(this._degradeVideo),this.destroy(),this._eventsBackup.forEach((function(e){var n,i=_slicedToArray$1(e,3),o=i[0],a=i[1],s=i[2];_get(_getPrototypeOf$1(r.prototype),"removeEventListener",t).call(t,o,a,s),null===(n=t._degradeVideo)||void 0===n||n.addEventListener(o,a,s)})),this._eventsBackup=[],e&&(this._degradeVideo.muted=!1,this._degradeVideo.src=e,this._degradeVideo.load())}},{key:"disconnectedCallback",value:function(){logger.log(this.TAG,"video disconnected"),document.removeEventListener("touchend",this._onTouchEnd,!0),this.destroy(!0),this._resizeObserver&&this._resizeObserver.disconnect(this)}},{key:"connectedCallback",value:function(){var e=this;logger.log(this.TAG,"video connected to document",performance.now()),this.timeline||this._init(),this.style.width="100%",this.style.height="100%",this.style.position="absolute",this.style.left="0px",this.style.top="0px",document.addEventListener("touchend",this._onTouchEnd,!0),ResizeObserver&&(this._resizeObserver=new ResizeObserver((function(t){var r;null!==(r=e.timeline)&&void 0!==r&&r.ready&&e.updateVideoPostion()})),this._resizeObserver.observe(this))}},{key:"_onTouchEnd",value:function(){playSlienceAudio(),this._degradeVideoInteract(),this._noSleep&&this._noSleep.enable()}},{key:"_degradeVideoInteract",value:function(){var e=this;if(this._degradeVideo&&(1===this.innerDegrade||3===this.innerDegrade)){if(this._degradeVideoUserGestured)return;var t=this._degradeVideo.play();t&&t.then((function(){e._degradeVideo.pause(),e._degradeVideoUserGestured=!0})).catch((function(e){console.log("degrade video: ",e.message)}))}}},{key:"play",value:function(e){var t=this;if(this.timeline){logger.log(this.TAG,"play() called, ready:".concat(this.timeline.ready,", paused:").concat(this.timeline.paused,", force:").concat(e)),this._degradeVideoInteract();var r=0;if(this.timeline.ready&&this.timeline.paused||e){if(e=e||this._isLive,this._playRequest=null,!e)return this.timeline.emit(Events.TIMELINE.DO_PLAY),this._innerDispatchEvent("play"),Promise.resolve();this.destroy(),this._init(),r=setTimeout((function(){try{t._innerDispatchEvent("waiting")}catch(e){}}),300)}return this._playRequest||!this.timeline.ready||this.timeline.paused?(logger.log(this.TAG,"request play!"),this._playRequest=this._playRequest||new Promise((function(e,n){t.timeline._paused=!1,t._innerDispatchEvent("play"),t._noSleep.enable(),t.timeline.once("ready",(function(){logger.log(t.TAG,"timeline emit ready"),clearTimeout(r),t.timeline.play().then(e).catch(n).finally((function(){t._playRequest=null}))}))})),this.autoplay=!0,this._playRequest):Promise.resolve()}}},{key:"pause",value:function(){this._playRequest=null,this.timeline&&this.timeline.pause();try{this._noSleep.disable(),pauseSlienceAudio()}catch(e){}}},{key:"load",value:function(){}},{key:"appendBuffer",value:function(e,t){if(this.timeline&&!this._err){if(!this._logFirstFrame){var r=e&&e.samples[0],n=t&&t.samples[0];if(!r&&!n)return;if(r||n){var i=(null==e?void 0:e.duration)/((null==e?void 0:e.formatTimescale)||1/0),o=(null==t?void 0:t.duration)/((null==t?void 0:t.formatTimescale)||1/0);logger.warn(this.TAG,"video firstDts:".concat(r&&r.dts," , audio firstDts:").concat(n&&n.dts," videoTrack.duration=").concat(i,", audioTrack.duration=").concat(o)),this._logFirstFrame=!0,(i||o)&&(this.setPlayMode("VOD"),this.timeline.emit(Events.TIMELINE.SET_PLAY_MODE,this._isLive?"LIVE":"VOD"),this.duration=Math.min(i||o,o||i)),this.analyse.addFirstData()}this.lowlatency&&(logger.warn(this.TAG,"single track! type=",SINGLE_TRACK_TYPE.LOW_LATENCY),this.timeline.emit(Events.TIMELINE.SINGLE_TRACK,SINGLE_TRACK_TYPE.LOW_LATENCY)),t.exist()||(logger.warn(this.TAG,"single track! type=",SINGLE_TRACK_TYPE.NO_AUDIO),this.timeline.emit(Events.TIMELINE.SINGLE_TRACK,SINGLE_TRACK_TYPE.NO_AUDIO)),e.exist()||(logger.warn(this.TAG,"single track! type=",SINGLE_TRACK_TYPE.NO_VIDEO),this.timeline.emit(Events.TIMELINE.SINGLE_TRACK,SINGLE_TRACK_TYPE.NO_VIDEO))}e.formatTimescale&&e.samples.forEach((function(t){t.dts=Math.floor(t.dts/e.formatTimescale*1e3),t.pts=Math.floor(t.pts/e.formatTimescale*1e3)})),t.formatTimescale&&t.samples.forEach((function(e){e.dts=Math.floor(e.dts/t.formatTimescale*1e3),e.pts=Math.floor(e.pts/t.formatTimescale*1e3)})),this.timeline.appendBuffer(e,t)}}},{key:"setAudioMeta",value:function(e){this._aMeta=e,this.timeline.emit(Events.TIMELINE.SET_METADATA,"audio",e)}},{key:"setVideoMeta",value:function(e){!this._isLive&&this._vMeta||(this.timeline.emit(Events.TIMELINE.SET_METADATA,"video",e),this._vMeta=e)}},{key:"setDecodeMode",value:function(e){this.setAttribute("decodeMode",e)}},{key:"setPlayMode",value:function(e){this._isLive="LIVE"===e}},{key:"endOfStream",value:function(){var e;this.currentTime&&(null===(e=this.timeline)||void 0===e||e.emit(Events.TIMELINE.END_OF_STREAM))}},{key:"updateVideoPostion",value:function(){var e;null===(e=this.timeline)||void 0===e||e.emit(Events.VIDEO.UPDATE_VIDEO_FILLTYPE,this.xgfillType,this.containerLayout)}},{key:"_innerDispatchEvent",value:function(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t}))}},{key:"destroy",value:function(e){this.timeline&&(this._noSleep.destroy(),logger.log(this.TAG,"call destroy"),this.timeline.emit(Events.TIMELINE.DESTROY,e),this.querySelector("video")&&this.removeChild(this.querySelector("video")),this.timeline=null,this._err=null,this._noSleep=null,this._eventsBackup=null)}},{key:"updateObjectPosition",value:function(e,t){this.timeline.emit(Events.VIDEO.UPDATE_VIDEO_COVER_POSITION,this.containerLayout,e,t),this._degradeVideo&&(this._degradeVideo.style.objectPosition="".concat(100*e,"% ").concat(100*t,"%"))}},{key:"setVideoDecode",value:function(){logger.log(this.TAG,"set videoDecode",this.videoDecode),this.videoDecode&&this.timeline&&this.timeline.videoRender&&(this.timeline.videoRender.videoDecode=this.videoDecode)}},{key:"live",get:function(){return this._isLive}},{key:"lowlatency",get:function(){return"true"===this.getAttribute("lowlatency")},set:function(e){this.setAttribute("lowlatency",e)}},{key:"autoplay",get:function(){return"true"===this.getAttribute("autoplay")},set:function(e){this.setAttribute("autoplay",e)}},{key:"__canvas",get:function(){return this.timeline.canvas}},{key:"__ended",get:function(){return Math.abs(this.currentTime-this.duration)<.5}},{key:"__width",get:function(){return this.getAttribute("width")||this.videoWidth},set:function(e){var t="number"==typeof e?"".concat(e,"px"):e;this.setAttribute("width",t),this.canvas.width=e}},{key:"__height",get:function(){return this.getAttribute("height")},set:function(e){var t="number"==typeof e?"".concat(e,"px"):e;this.setAttribute("height",t),this.canvas.height=e}},{key:"__videoWidth",get:function(){return this.canvas.width}},{key:"__videoHeight",get:function(){return this.canvas.height}},{key:"__volume",get:function(){return Number(this.getAttribute("volume"))},set:function(e){e<=0&&(e=0),e>=1&&(e=1),this.setAttribute("volume",e),this.muted||this.timeline.emit(Events.TIMELINE.UPDATE_VOLUME,e)}},{key:"__muted",get:function(){return"true"===this.getAttribute("muted")},set:function(e){this.setAttribute("muted",e),this._degradeVideoInteract(),this._noSleep.enable(),this.timeline.emit(Events.TIMELINE.UPDATE_VOLUME,e?0:this.volume)}},{key:"__currentTime",get:function(){if(!this.timeline)return 0;var e=this.timeline.currentTime,t=this.timeline.duration;return Math.min(e,t)},set:function(e){this._debounceSeek(e)}},{key:"_seek",value:function(e){this.timeline&&(this.buffered.length||this.play(),this.paused&&!this._isLive&&0===e&&this.play(),this.timeline.seek(Number(e)))}},{key:"__duration",get:function(){return this._isLive?1/0:this.timeline.duration},set:function(e){this.timeline.emit(Events.TIMELINE.SET_VIDEO_DURATION,e),this._innerDispatchEvent("durationchange")}},{key:"__seeking",get:function(){return this.timeline.seeking}},{key:"__paused",get:function(){return this.timeline.paused}},{key:"__fps",get:function(){return this.timeline.fps}},{key:"__decodeFps",get:function(){return this.timeline.decodeFps}},{key:"__decodeCost",get:function(){return parseInt(this.timeline.decodeCost)}},{key:"__renderCost",get:function(){return this.timeline.renderCost}},{key:"__wasmInitCost",get:function(){return this.timeline.wasmInitCost}},{key:"__totalSize",get:function(){return this.timeline.totalSize}},{key:"__bitrate",get:function(){return this.timeline.bitrate}},{key:"__gopLength",get:function(){return this.timeline.gopLength}},{key:"__readyState",get:function(){return this.timeline.readyState}},{key:"__buffered",get:function(){return this.timeline.buffered}},{key:"__decoderMode",get:function(){return this.timeline.decoderMode}},{key:"src",get:function(){return this.getAttribute("src")||""},set:function(e){logger.log(this.TAG,"set src ",e),this.setAttribute("src",e),this._vMeta=null,this.play(!0),this.timeline||this._init(),this._innerDispatchEvent("loadstart"),updateVV()}},{key:"currentSrc",get:function(){return this.getAttribute("src")||""}},{key:"playbackRate",get:function(){return parseFloat(this.getAttribute("playbackrate")||1)},set:function(e){var t;this.setAttribute("playbackrate",e),null===(t=this.timeline)||void 0===t||t.emit(Events.TIMELINE.SET_PLAYBACKRATE,e)}},{key:"networkState",get:function(){return 1}},{key:"preloadTime",get:function(){var e=this.getAttribute("preloadtime");if(e){var t=Number.parseFloat(e);if(t>0&&!Number.isNaN(t))return t}return 1/0},set:function(e){e&&Number(e)>0&&this.setAttribute("preloadtime",e)}},{key:"innerDegrade",get:function(){var e=this.getAttribute("innerdegrade");return parseInt(e)}},{key:"__glCtxOptions",set:function(e){this._glCtxOptions=e,this.timeline.emit(Events.TIMELINE.UPDATE_GL_OPTIONS,e)}},{key:"__error",get:function(){return this._err},set:function(e){this.timeline.emit(Events.TIMELINE.PLAY_EVENT,VIDEO_EVENTS.ERROR,e)}},{key:"degradeVideo",get:function(){return this._degradeVideo}},{key:"degradeInfo",get:function(){return this._deradeInfo},set:function(e){this._deradeInfo=e}},{key:"unsyncInfo",get:function(){return this._unsyncInfo},set:function(e){this._unsyncInfo=e}},{key:"xgfillType",get:function(){return this.parentNode.getAttribute("data-xgfill")}},{key:"containerLayout",get:function(){var e=this.parentNode;return{width:e.clientWidth,height:e.clientHeight}}},{key:"videoDecode",get:function(){return this.getAttribute("decodeMode")===VIDEO_DECODE_MODE_VALUE}},{key:"audioMedia",get:function(){var e,t;return null===(e=this.timeline)||void 0===e||null===(t=e.audioRender)||void 0===t?void 0:t.media}},{key:"getStats",value:function(){return this.analyse.getStats(this)}},{key:"getSeekElapses",value:function(){return this.analyse.seekElapses()}},{key:"dump",value:function(){var e=this.buffered;return console.log(e),new Array(e.length).fill(0).map((function(t,r){return[e.start(r),e.end(r)]}))}}],[{key:"version",get:function(){return"0.1.16"}},{key:"init",value:function(e){var t=e.h264Url,n=e.h264AsmUrl,i=e.h265AsmUrl,o=e.h265Url,a=e.h265ThreadUrl,s=e.h265SimdUrl;r.h264Url=t,r.h265Url=o,r.h265AsmUrl=i,r.h264AsmUrl=n,r.h265ThreadUrl=a,r.h265SimdUrl=s}},{key:"getDecodeCapacity",value:function(){return getDecodeCapacaity()}},{key:"getDeviceCapacity",value:function(){return getDeviceCapacity()}},{key:"setDecodeCapacity",value:function(e){setDecodeCapacity(e),e.preloadDecoder&&decoderCache.genDecoder().catch((function(){}))}},{key:"genDecoder",value:function(e){return decoderCache.genDecoder(e)}},{key:"cleanDisabled",value:function(){cleanDisabledStatus()}},{key:"isSupported",value:function(){return!!softDecodeSupported()&&!1===getDisabledStatus()}}]),r}();_defineProperty$2(XGVideo,"decoderCache",decoderCache);var H264_DECODER_URL="https://sf1-cdn-tos.huoshanstatic.com/obj/media-fe/decoder/1.1.1/h264/decoder.js",ASM_H264_DECODER_URL="https://sf1-cdn-tos.huoshanstatic.com/obj/media-fe/decoder/1.1.1/h264/decoder_asm.js",H265_SIMD_DECODER_URL="https://sf1-cdn-tos.huoshanstatic.com/obj/media-fe/codec/high/decoder_1656041798666.js",H265_THREAD_DECODER_URL="https://sf1-cdn-tos.huoshanstatic.com/obj/media-fe/codec/main/decoder.js",H265_DECODER_URL="https://sf1-cdn-tos.huoshanstatic.com/obj/media-fe/codec/base/decoder.js",ASM_H265_DECODER_URL="https://sf1-cdn-tos.huoshanstatic.com/obj/media-fe/codec/high/decoder_asm.js";XGVideo.init({h264Url:H264_DECODER_URL,h264AsmUrl:ASM_H264_DECODER_URL,h265Url:H265_DECODER_URL,h265SimdUrl:H265_SIMD_DECODER_URL,h265ThreadUrl:H265_THREAD_DECODER_URL,h265AsmUrl:ASM_H265_DECODER_URL}),XGVideo.setEleName=function(e){setEleName(e);var t=function(e){_inherits$1(r,XGVideo);var t=_createSuper$1(r);function r(){return _classCallCheck$2(this,r),t.apply(this,arguments)}return _createClass$2(r)}();customElements.get(getEleName())||customElements.define(getEleName(),t)};try{customElements.get(getEleName())||customElements.define(getEleName(),XGVideo)}catch(e){}export{XGVideo as default};
|