@volcengine/veplayer 1.5.16 → 1.6.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.min.js DELETED
@@ -1,2 +0,0 @@
1
- // @volcengine/veplayer@1.5.16 Built @Tue, 08 Aug 2023 09:12:04 GMT
2
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).VePlayer=t()}(this,(function(){"use strict";function ownKeys$7(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function _objectSpread2$5(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$7(Object(r),!0).forEach((function(t){_defineProperty$6(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys$7(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _regeneratorRuntime$2(){_regeneratorRuntime$2=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},n=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(P){s=function(e,t,r){return e[t]=r}}function l(e,t,r,i){var n,o,a,s,l=t&&t.prototype instanceof h?t:h,d=Object.create(l.prototype),p=new E(i||[]);return d._invoke=(n=e,o=r,a=p,s="suspendedStart",function(e,t){if("executing"===s)throw new Error("Generator is already running");if("completed"===s){if("throw"===e)throw t;return{value:void 0,done:!0}}for(a.method=e,a.arg=t;;){var r=a.delegate;if(r){var i=b(r,a);if(i){if(i===u)continue;return i}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if("suspendedStart"===s)throw s="completed",a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);s="executing";var l=c(n,o,a);if("normal"===l.type){if(s=a.done?"completed":"suspendedYield",l.arg===u)continue;return{value:l.arg,done:a.done}}"throw"===l.type&&(s="completed",a.method="throw",a.arg=l.arg)}}),d}function c(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(P){return{type:"throw",arg:P}}}e.wrap=l;var u={};function h(){}function d(){}function p(){}var f={};s(f,n,(function(){return this}));var g=Object.getPrototypeOf,y=g&&g(g($([])));y&&y!==t&&r.call(y,n)&&(f=y);var v=p.prototype=h.prototype=Object.create(f);function m(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function _(e,t){function i(n,o,a,s){var l=c(e[n],e,o);if("throw"!==l.type){var u=l.arg,h=u.value;return h&&"object"==typeof h&&r.call(h,"__await")?t.resolve(h.__await).then((function(e){i("next",e,a,s)}),(function(e){i("throw",e,a,s)})):t.resolve(h).then((function(e){u.value=e,a(u)}),(function(e){return i("throw",e,a,s)}))}s(l.arg)}var n;this._invoke=function(e,r){function o(){return new t((function(t,n){i(e,r,t,n)}))}return n=n?n.then(o,o):o()}}function b(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,b(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var i=c(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,u;var n=i.arg;return n?n.done?(t[e.resultName]=n.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):n:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}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 S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function $(e){if(e){var t=e[n];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function t(){for(;++i<e.length;)if(r.call(e,i))return t.value=e[i],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:C}}function C(){return{value:void 0,done:!0}}return d.prototype=p,s(v,"constructor",p),s(p,"constructor",d),d.displayName=s(p,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,s(e,a,"GeneratorFunction")),e.prototype=Object.create(v),e},e.awrap=function(e){return{__await:e}},m(_.prototype),s(_.prototype,o,(function(){return this})),e.AsyncIterator=_,e.async=function(t,r,i,n,o){void 0===o&&(o=Promise);var a=new _(l(t,r,i,n),o);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},m(v),s(v,a,"Generator"),s(v,n,(function(){return this})),s(v,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var i=t.pop();if(i in e)return r.value=i,r.done=!1,r}return r.done=!0,r}},e.values=$,E.prototype={constructor:E,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(S),!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 i(r,i){return a.type="throw",a.arg=e,t.next=r,i&&(t.method="next",t.arg=void 0),!!i}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],a=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(s&&l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&r.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;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,u):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),u},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),S(r),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var i=r.completion;if("throw"===i.type){var n=i.arg;S(r)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:$(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),u}},e}function _typeof$4(e){return(_typeof$4="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function asyncGeneratorStep$2(e,t,r,i,n,o,a){try{var s=e[o](a),l=s.value}catch(c){return void r(c)}s.done?t(l):Promise.resolve(l).then(i,n)}function _asyncToGenerator$2(e){return function(){var t=this,r=arguments;return new Promise((function(i,n){var o=e.apply(t,r);function a(e){asyncGeneratorStep$2(o,i,n,a,s,"next",e)}function s(e){asyncGeneratorStep$2(o,i,n,a,s,"throw",e)}a(void 0)}))}}function _classCallCheck$5(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties$6(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function _createClass$6(e,t,r){return t&&_defineProperties$6(e.prototype,t),r&&_defineProperties$6(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty$6(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$5(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$5(e,t)}function _getPrototypeOf$5(e){return(_getPrototypeOf$5=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _setPrototypeOf$5(e,t){return(_setPrototypeOf$5=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function _isNativeReflectConstruct$5(){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(e2){return!1}}function _objectWithoutPropertiesLoose$1(e,t){if(null==e)return{};var r,i,n={},o=Object.keys(e);for(i=0;i<o.length;i++)r=o[i],t.indexOf(r)>=0||(n[r]=e[r]);return n}function _objectWithoutProperties$1(e,t){if(null==e)return{};var r,i,n=_objectWithoutPropertiesLoose$1(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function _assertThisInitialized$5(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _possibleConstructorReturn$5(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$5(e)}function _createSuper$5(e){var t=_isNativeReflectConstruct$5();return function(){var r,i=_getPrototypeOf$5(e);if(t){var n=_getPrototypeOf$5(this).constructor;r=Reflect.construct(i,arguments,n)}else r=i.apply(this,arguments);return _possibleConstructorReturn$5(this,r)}}function _superPropBase$3(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf$5(e)););return e}function _get$3(){return _get$3="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var i=_superPropBase$3(e,t);if(i){var n=Object.getOwnPropertyDescriptor(i,t);return n.get?n.get.call(arguments.length<3?e:r):n.value}},_get$3.apply(this,arguments)}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray$2(e,t)||_nonIterableRest()}function _toConsumableArray$1(e){return _arrayWithoutHoles$1(e)||_iterableToArray$1(e)||_unsupportedIterableToArray$2(e)||_nonIterableSpread$1()}function _arrayWithoutHoles$1(e){if(Array.isArray(e))return _arrayLikeToArray$2(e)}function _arrayWithHoles(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(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i,n,o=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(i=r.next()).done)&&(o.push(i.value),!t||o.length!==t);a=!0);}catch(l){s=!0,n=l}finally{try{a||null==r.return||r.return()}finally{if(s)throw n}}return o}}function _unsupportedIterableToArray$2(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray$2(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$2(e,t):void 0}}function _arrayLikeToArray$2(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}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(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _createForOfIteratorHelper$1(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_unsupportedIterableToArray$2(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var i=0,n=function(){};return{s:n,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function listCacheClear(){this.__data__=[],this.size=0}function eq(e,t){return e===t||e!=e&&t!=t}function assocIndexOf(e,t){for(var r=e.length;r--;)if(eq(e[r][0],t))return r;return-1}var arrayProto=Array.prototype,splice$1=arrayProto.splice;function listCacheDelete(e){var t=this.__data__,r=assocIndexOf(t,e);return!(r<0)&&(r==t.length-1?t.pop():splice$1.call(t,r,1),--this.size,!0)}function listCacheGet(e){var t=this.__data__,r=assocIndexOf(t,e);return r<0?void 0:t[r][1]}function listCacheHas(e){return assocIndexOf(this.__data__,e)>-1}function listCacheSet(e,t){var r=this.__data__,i=assocIndexOf(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}function ListCache(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function stackClear(){this.__data__=new ListCache,this.size=0}function stackDelete(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function stackGet(e){return this.__data__.get(e)}function stackHas(e){return this.__data__.has(e)}ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet;var freeGlobal="object"==("undefined"==typeof global?"undefined":_typeof$4(global))&&global&&global.Object===Object&&global,freeGlobal$1=freeGlobal,freeSelf="object"==("undefined"==typeof self?"undefined":_typeof$4(self))&&self&&self.Object===Object&&self,root=freeGlobal$1||freeSelf||Function("return this")(),root$1=root,_Symbol$2=root$1.Symbol,_Symbol$3=_Symbol$2,objectProto$f=Object.prototype,hasOwnProperty$d=objectProto$f.hasOwnProperty,nativeObjectToString$1=objectProto$f.toString,symToStringTag$1=_Symbol$3?_Symbol$3.toStringTag:void 0;function getRawTag(e){var t=hasOwnProperty$d.call(e,symToStringTag$1),r=e[symToStringTag$1];try{e[symToStringTag$1]=void 0;var i=!0}catch(e2){}var n=nativeObjectToString$1.call(e);return i&&(t?e[symToStringTag$1]=r:delete e[symToStringTag$1]),n}var objectProto$e=Object.prototype,nativeObjectToString=objectProto$e.toString;function objectToString$1(e){return nativeObjectToString.call(e)}var nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=_Symbol$3?_Symbol$3.toStringTag:void 0;function baseGetTag(e){return null==e?void 0===e?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(e)?getRawTag(e):objectToString$1(e)}function isObject$n(e){var t=_typeof$4(e);return null!=e&&("object"==t||"function"==t)}var asyncTag="[object AsyncFunction]",funcTag$2="[object Function]",genTag$1="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction$1(e){if(!isObject$n(e))return!1;var t=baseGetTag(e);return t==funcTag$2||t==genTag$1||t==asyncTag||t==proxyTag}var coreJsData=root$1["__core-js_shared__"],coreJsData$1=coreJsData,maskSrcKey=(uid2=/[^.]+$/.exec(coreJsData$1&&coreJsData$1.keys&&coreJsData$1.keys.IE_PROTO||""),uid2?"Symbol(src)_1."+uid2:""),uid2;function isMasked(e){return!!maskSrcKey&&maskSrcKey in e}var funcProto$1=Function.prototype,funcToString$1=funcProto$1.toString;function toSource(e){if(null!=e){try{return funcToString$1.call(e)}catch(e2){}try{return e+""}catch(e2){}}return""}var reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,funcProto=Function.prototype,objectProto$d=Object.prototype,funcToString=funcProto.toString,hasOwnProperty$c=objectProto$d.hasOwnProperty,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty$c).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative(e){return!(!isObject$n(e)||isMasked(e))&&(isFunction$1(e)?reIsNative:reIsHostCtor).test(toSource(e))}function getValue(e,t){return null==e?void 0:e[t]}function getNative(e,t){var r=getValue(e,t);return baseIsNative(r)?r:void 0}var Map$1=getNative(root$1,"Map"),Map$2=Map$1,nativeCreate=getNative(Object,"create"),nativeCreate$1=nativeCreate;function hashClear(){this.__data__=nativeCreate$1?nativeCreate$1(null):{},this.size=0}function hashDelete(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var HASH_UNDEFINED$2="__lodash_hash_undefined__",objectProto$c=Object.prototype,hasOwnProperty$b=objectProto$c.hasOwnProperty;function hashGet(e){var t=this.__data__;if(nativeCreate$1){var r=t[e];return r===HASH_UNDEFINED$2?void 0:r}return hasOwnProperty$b.call(t,e)?t[e]:void 0}var objectProto$b=Object.prototype,hasOwnProperty$a=objectProto$b.hasOwnProperty;function hashHas(e){var t=this.__data__;return nativeCreate$1?void 0!==t[e]:hasOwnProperty$a.call(t,e)}var HASH_UNDEFINED$1="__lodash_hash_undefined__";function hashSet(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=nativeCreate$1&&void 0===t?HASH_UNDEFINED$1:t,this}function Hash(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Map$2||ListCache),string:new Hash}}function isKeyable(e){var t=_typeof$4(e);return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function getMapData(e,t){var r=e.__data__;return isKeyable(t)?r["string"==typeof t?"string":"hash"]:r.map}function mapCacheDelete(e){var t=getMapData(this,e).delete(e);return this.size-=t?1:0,t}function mapCacheGet(e){return getMapData(this,e).get(e)}function mapCacheHas(e){return getMapData(this,e).has(e)}function mapCacheSet(e,t){var r=getMapData(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}function MapCache(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet;var LARGE_ARRAY_SIZE$1=200;function stackSet(e,t){var r=this.__data__;if(r instanceof ListCache){var i=r.__data__;if(!Map$2||i.length<LARGE_ARRAY_SIZE$1-1)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new MapCache(i)}return r.set(e,t),this.size=r.size,this}function Stack(e){var t=this.__data__=new ListCache(e);this.size=t.size}function arrayEach(e,t){for(var r=-1,i=null==e?0:e.length;++r<i&&!1!==t(e[r],r,e););return e}Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var defineProperty$e=function(){try{var e=getNative(Object,"defineProperty");return e({},"",{}),e}catch(e2){}}(),defineProperty$f=defineProperty$e;function baseAssignValue(e,t,r){"__proto__"==t&&defineProperty$f?defineProperty$f(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var objectProto$a=Object.prototype,hasOwnProperty$9=objectProto$a.hasOwnProperty;function assignValue(e,t,r){var i=e[t];hasOwnProperty$9.call(e,t)&&eq(i,r)&&(void 0!==r||t in e)||baseAssignValue(e,t,r)}function copyObject(e,t,r,i){var n=!r;r||(r={});for(var o=-1,a=t.length;++o<a;){var s=t[o],l=i?i(r[s],e[s],s,r,e):void 0;void 0===l&&(l=e[s]),n?baseAssignValue(r,s,l):assignValue(r,s,l)}return r}function baseTimes(e,t){for(var r=-1,i=Array(e);++r<e;)i[r]=t(r);return i}function isObjectLike(e){return null!=e&&"object"==_typeof$4(e)}var argsTag$3="[object Arguments]";function baseIsArguments(e){return isObjectLike(e)&&baseGetTag(e)==argsTag$3}var objectProto$9=Object.prototype,hasOwnProperty$8=objectProto$9.hasOwnProperty,propertyIsEnumerable$2=objectProto$9.propertyIsEnumerable,isArguments=baseIsArguments(function(){return arguments}())?baseIsArguments:function(e){return isObjectLike(e)&&hasOwnProperty$8.call(e,"callee")&&!propertyIsEnumerable$2.call(e,"callee")},isArguments$1=isArguments,isArray$6=Array.isArray,isArray$7=isArray$6;function stubFalse(){return!1}var freeExports$2="object"==("undefined"==typeof exports?"undefined":_typeof$4(exports))&&exports&&!exports.nodeType&&exports,freeModule$2=freeExports$2&&"object"==("undefined"==typeof module?"undefined":_typeof$4(module))&&module&&!module.nodeType&&module,moduleExports$2=freeModule$2&&freeModule$2.exports===freeExports$2,Buffer$1=moduleExports$2?root$1.Buffer:void 0,nativeIsBuffer=Buffer$1?Buffer$1.isBuffer:void 0,isBuffer=nativeIsBuffer||stubFalse,isBuffer$1=isBuffer,MAX_SAFE_INTEGER$2=9007199254740991,reIsUint=/^(?:0|[1-9]\d*)$/;function isIndex(e,t){var r=_typeof$4(e);return!!(t=null==t?MAX_SAFE_INTEGER$2:t)&&("number"==r||"symbol"!=r&&reIsUint.test(e))&&e>-1&&e%1==0&&e<t}var MAX_SAFE_INTEGER$1=9007199254740991;function isLength(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=MAX_SAFE_INTEGER$1}var argsTag$2="[object Arguments]",arrayTag$2="[object Array]",boolTag$3="[object Boolean]",dateTag$3="[object Date]",errorTag$2="[object Error]",funcTag$1="[object Function]",mapTag$5="[object Map]",numberTag$3="[object Number]",objectTag$3="[object Object]",regexpTag$3="[object RegExp]",setTag$5="[object Set]",stringTag$3="[object String]",weakMapTag$2="[object WeakMap]",arrayBufferTag$3="[object ArrayBuffer]",dataViewTag$4="[object DataView]",float32Tag$2="[object Float32Array]",float64Tag$2="[object Float64Array]",int8Tag$2="[object Int8Array]",int16Tag$2="[object Int16Array]",int32Tag$2="[object Int32Array]",uint8Tag$2="[object Uint8Array]",uint8ClampedTag$2="[object Uint8ClampedArray]",uint16Tag$2="[object Uint16Array]",uint32Tag$2="[object Uint32Array]",typedArrayTags={};function baseIsTypedArray(e){return isObjectLike(e)&&isLength(e.length)&&!!typedArrayTags[baseGetTag(e)]}function baseUnary(e){return function(t){return e(t)}}typedArrayTags[float32Tag$2]=typedArrayTags[float64Tag$2]=typedArrayTags[int8Tag$2]=typedArrayTags[int16Tag$2]=typedArrayTags[int32Tag$2]=typedArrayTags[uint8Tag$2]=typedArrayTags[uint8ClampedTag$2]=typedArrayTags[uint16Tag$2]=typedArrayTags[uint32Tag$2]=!0,typedArrayTags[argsTag$2]=typedArrayTags[arrayTag$2]=typedArrayTags[arrayBufferTag$3]=typedArrayTags[boolTag$3]=typedArrayTags[dataViewTag$4]=typedArrayTags[dateTag$3]=typedArrayTags[errorTag$2]=typedArrayTags[funcTag$1]=typedArrayTags[mapTag$5]=typedArrayTags[numberTag$3]=typedArrayTags[objectTag$3]=typedArrayTags[regexpTag$3]=typedArrayTags[setTag$5]=typedArrayTags[stringTag$3]=typedArrayTags[weakMapTag$2]=!1;var freeExports$1="object"==("undefined"==typeof exports?"undefined":_typeof$4(exports))&&exports&&!exports.nodeType&&exports,freeModule$1=freeExports$1&&"object"==("undefined"==typeof module?"undefined":_typeof$4(module))&&module&&!module.nodeType&&module,moduleExports$1=freeModule$1&&freeModule$1.exports===freeExports$1,freeProcess=moduleExports$1&&freeGlobal$1.process,nodeUtil=function(){try{var e=freeModule$1&&freeModule$1.require&&freeModule$1.require("util").types;return e||freeProcess&&freeProcess.binding&&freeProcess.binding("util")}catch(e2){}}(),nodeUtil$1=nodeUtil,nodeIsTypedArray=nodeUtil$1&&nodeUtil$1.isTypedArray,isTypedArray$2=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray,isTypedArray$3=isTypedArray$2,objectProto$8=Object.prototype,hasOwnProperty$7=objectProto$8.hasOwnProperty;function arrayLikeKeys(e,t){var r=isArray$7(e),i=!r&&isArguments$1(e),n=!r&&!i&&isBuffer$1(e),o=!r&&!i&&!n&&isTypedArray$3(e),a=r||i||n||o,s=a?baseTimes(e.length,String):[],l=s.length;for(var c in e)!t&&!hasOwnProperty$7.call(e,c)||a&&("length"==c||n&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||isIndex(c,l))||s.push(c);return s}var objectProto$7=Object.prototype;function isPrototype(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||objectProto$7)}function overArg(e,t){return function(r){return e(t(r))}}var nativeKeys$1=overArg(Object.keys,Object),nativeKeys$2=nativeKeys$1,objectProto$6=Object.prototype,hasOwnProperty$6=objectProto$6.hasOwnProperty;function baseKeys(e){if(!isPrototype(e))return nativeKeys$2(e);var t=[];for(var r in Object(e))hasOwnProperty$6.call(e,r)&&"constructor"!=r&&t.push(r);return t}function isArrayLike(e){return null!=e&&isLength(e.length)&&!isFunction$1(e)}function keys$4(e){return isArrayLike(e)?arrayLikeKeys(e):baseKeys(e)}function baseAssign(e,t){return e&&copyObject(t,keys$4(t),e)}function nativeKeysIn(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}var objectProto$5=Object.prototype,hasOwnProperty$5=objectProto$5.hasOwnProperty;function baseKeysIn(e){if(!isObject$n(e))return nativeKeysIn(e);var t=isPrototype(e),r=[];for(var i in e)("constructor"!=i||!t&&hasOwnProperty$5.call(e,i))&&r.push(i);return r}function keysIn(e){return isArrayLike(e)?arrayLikeKeys(e,!0):baseKeysIn(e)}function baseAssignIn(e,t){return e&&copyObject(t,keysIn(t),e)}var freeExports="object"==("undefined"==typeof exports?"undefined":_typeof$4(exports))&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==("undefined"==typeof module?"undefined":_typeof$4(module))&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,Buffer=moduleExports?root$1.Buffer:void 0,allocUnsafe=Buffer?Buffer.allocUnsafe:void 0;function cloneBuffer(e,t){if(t)return e.slice();var r=e.length,i=allocUnsafe?allocUnsafe(r):new e.constructor(r);return e.copy(i),i}function copyArray(e,t){var r=-1,i=e.length;for(t||(t=Array(i));++r<i;)t[r]=e[r];return t}function arrayFilter(e,t){for(var r=-1,i=null==e?0:e.length,n=0,o=[];++r<i;){var a=e[r];t(a,r,e)&&(o[n++]=a)}return o}function stubArray(){return[]}var objectProto$4=Object.prototype,propertyIsEnumerable$1=objectProto$4.propertyIsEnumerable,nativeGetSymbols$1=Object.getOwnPropertySymbols,getSymbols=nativeGetSymbols$1?function(e){return null==e?[]:(e=Object(e),arrayFilter(nativeGetSymbols$1(e),(function(t){return propertyIsEnumerable$1.call(e,t)})))}:stubArray,getSymbols$1=getSymbols;function copySymbols(e,t){return copyObject(e,getSymbols$1(e),t)}function arrayPush(e,t){for(var r=-1,i=t.length,n=e.length;++r<i;)e[n+r]=t[r];return e}var getPrototype=overArg(Object.getPrototypeOf,Object),getPrototype$1=getPrototype,nativeGetSymbols=Object.getOwnPropertySymbols,getSymbolsIn=nativeGetSymbols?function(e){for(var t=[];e;)arrayPush(t,getSymbols$1(e)),e=getPrototype$1(e);return t}:stubArray,getSymbolsIn$1=getSymbolsIn;function copySymbolsIn(e,t){return copyObject(e,getSymbolsIn$1(e),t)}function baseGetAllKeys(e,t,r){var i=t(e);return isArray$7(e)?i:arrayPush(i,r(e))}function getAllKeys(e){return baseGetAllKeys(e,keys$4,getSymbols$1)}function getAllKeysIn(e){return baseGetAllKeys(e,keysIn,getSymbolsIn$1)}var DataView$2=getNative(root$1,"DataView"),DataView$3=DataView$2,Promise$2=getNative(root$1,"Promise"),Promise$3=Promise$2,Set$1=getNative(root$1,"Set"),Set$2=Set$1,WeakMap$2=getNative(root$1,"WeakMap"),WeakMap$3=WeakMap$2,mapTag$4="[object Map]",objectTag$2="[object Object]",promiseTag="[object Promise]",setTag$4="[object Set]",weakMapTag$1="[object WeakMap]",dataViewTag$3="[object DataView]",dataViewCtorString=toSource(DataView$3),mapCtorString=toSource(Map$2),promiseCtorString=toSource(Promise$3),setCtorString=toSource(Set$2),weakMapCtorString=toSource(WeakMap$3),getTag=baseGetTag;(DataView$3&&getTag(new DataView$3(new ArrayBuffer(1)))!=dataViewTag$3||Map$2&&getTag(new Map$2)!=mapTag$4||Promise$3&&getTag(Promise$3.resolve())!=promiseTag||Set$2&&getTag(new Set$2)!=setTag$4||WeakMap$3&&getTag(new WeakMap$3)!=weakMapTag$1)&&(getTag=function(e){var t=baseGetTag(e),r=t==objectTag$2?e.constructor:void 0,i=r?toSource(r):"";if(i)switch(i){case dataViewCtorString:return dataViewTag$3;case mapCtorString:return mapTag$4;case promiseCtorString:return promiseTag;case setCtorString:return setTag$4;case weakMapCtorString:return weakMapTag$1}return t});var getTag$1=getTag,objectProto$3=Object.prototype,hasOwnProperty$4=objectProto$3.hasOwnProperty;function initCloneArray(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&hasOwnProperty$4.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var Uint8Array$3=root$1.Uint8Array,Uint8Array$4=Uint8Array$3;function cloneArrayBuffer(e){var t=new e.constructor(e.byteLength);return new Uint8Array$4(t).set(new Uint8Array$4(e)),t}function cloneDataView(e,t){var r=t?cloneArrayBuffer(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var reFlags=/\w*$/;function cloneRegExp(e){var t=new e.constructor(e.source,reFlags.exec(e));return t.lastIndex=e.lastIndex,t}var symbolProto$2=_Symbol$3?_Symbol$3.prototype:void 0,symbolValueOf$1=symbolProto$2?symbolProto$2.valueOf:void 0;function cloneSymbol(e){return symbolValueOf$1?Object(symbolValueOf$1.call(e)):{}}function cloneTypedArray(e,t){var r=t?cloneArrayBuffer(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var boolTag$2="[object Boolean]",dateTag$2="[object Date]",mapTag$3="[object Map]",numberTag$2="[object Number]",regexpTag$2="[object RegExp]",setTag$3="[object Set]",stringTag$2="[object String]",symbolTag$3="[object Symbol]",arrayBufferTag$2="[object ArrayBuffer]",dataViewTag$2="[object DataView]",float32Tag$1="[object Float32Array]",float64Tag$1="[object Float64Array]",int8Tag$1="[object Int8Array]",int16Tag$1="[object Int16Array]",int32Tag$1="[object Int32Array]",uint8Tag$1="[object Uint8Array]",uint8ClampedTag$1="[object Uint8ClampedArray]",uint16Tag$1="[object Uint16Array]",uint32Tag$1="[object Uint32Array]";function initCloneByTag(e,t,r){var i=e.constructor;switch(t){case arrayBufferTag$2:return cloneArrayBuffer(e);case boolTag$2:case dateTag$2:return new i(+e);case dataViewTag$2:return cloneDataView(e,r);case float32Tag$1:case float64Tag$1:case int8Tag$1:case int16Tag$1:case int32Tag$1:case uint8Tag$1:case uint8ClampedTag$1:case uint16Tag$1:case uint32Tag$1:return cloneTypedArray(e,r);case mapTag$3:return new i;case numberTag$2:case stringTag$2:return new i(e);case regexpTag$2:return cloneRegExp(e);case setTag$3:return new i;case symbolTag$3:return cloneSymbol(e)}}var objectCreate$1=Object.create,baseCreate=function(){function e(){}return function(t){if(!isObject$n(t))return{};if(objectCreate$1)return objectCreate$1(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),baseCreate$1=baseCreate;function initCloneObject(e){return"function"!=typeof e.constructor||isPrototype(e)?{}:baseCreate$1(getPrototype$1(e))}var mapTag$2="[object Map]";function baseIsMap(e){return isObjectLike(e)&&getTag$1(e)==mapTag$2}var nodeIsMap=nodeUtil$1&&nodeUtil$1.isMap,isMap=nodeIsMap?baseUnary(nodeIsMap):baseIsMap,isMap$1=isMap,setTag$2="[object Set]";function baseIsSet(e){return isObjectLike(e)&&getTag$1(e)==setTag$2}var nodeIsSet=nodeUtil$1&&nodeUtil$1.isSet,isSet=nodeIsSet?baseUnary(nodeIsSet):baseIsSet,isSet$1=isSet,CLONE_DEEP_FLAG$1=1,CLONE_FLAT_FLAG=2,CLONE_SYMBOLS_FLAG$1=4,argsTag$1="[object Arguments]",arrayTag$1="[object Array]",boolTag$1="[object Boolean]",dateTag$1="[object Date]",errorTag$1="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag$1="[object Map]",numberTag$1="[object Number]",objectTag$1="[object Object]",regexpTag$1="[object RegExp]",setTag$1="[object Set]",stringTag$1="[object String]",symbolTag$2="[object Symbol]",weakMapTag="[object WeakMap]",arrayBufferTag$1="[object ArrayBuffer]",dataViewTag$1="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]",cloneableTags={};function baseClone(e,t,r,i,n,o){var a,s=t&CLONE_DEEP_FLAG$1,l=t&CLONE_FLAT_FLAG,c=t&CLONE_SYMBOLS_FLAG$1;if(r&&(a=n?r(e,i,n,o):r(e)),void 0!==a)return a;if(!isObject$n(e))return e;var u=isArray$7(e);if(u){if(a=initCloneArray(e),!s)return copyArray(e,a)}else{var h=getTag$1(e),d=h==funcTag||h==genTag;if(isBuffer$1(e))return cloneBuffer(e,s);if(h==objectTag$1||h==argsTag$1||d&&!n){if(a=l||d?{}:initCloneObject(e),!s)return l?copySymbolsIn(e,baseAssignIn(a,e)):copySymbols(e,baseAssign(a,e))}else{if(!cloneableTags[h])return n?e:{};a=initCloneByTag(e,h,s)}}o||(o=new Stack);var p=o.get(e);if(p)return p;o.set(e,a),isSet$1(e)?e.forEach((function(i){a.add(baseClone(i,t,r,i,e,o))})):isMap$1(e)&&e.forEach((function(i,n){a.set(n,baseClone(i,t,r,n,e,o))}));var f=u?void 0:(c?l?getAllKeysIn:getAllKeys:l?keysIn:keys$4)(e);return arrayEach(f||e,(function(i,n){f&&(i=e[n=i]),assignValue(a,n,baseClone(i,t,r,n,e,o))})),a}cloneableTags[argsTag$1]=cloneableTags[arrayTag$1]=cloneableTags[arrayBufferTag$1]=cloneableTags[dataViewTag$1]=cloneableTags[boolTag$1]=cloneableTags[dateTag$1]=cloneableTags[float32Tag]=cloneableTags[float64Tag]=cloneableTags[int8Tag]=cloneableTags[int16Tag]=cloneableTags[int32Tag]=cloneableTags[mapTag$1]=cloneableTags[numberTag$1]=cloneableTags[objectTag$1]=cloneableTags[regexpTag$1]=cloneableTags[setTag$1]=cloneableTags[stringTag$1]=cloneableTags[symbolTag$2]=cloneableTags[uint8Tag]=cloneableTags[uint8ClampedTag]=cloneableTags[uint16Tag]=cloneableTags[uint32Tag]=!0,cloneableTags[errorTag$1]=cloneableTags[funcTag]=cloneableTags[weakMapTag]=!1;var CLONE_DEEP_FLAG=1,CLONE_SYMBOLS_FLAG=4;function cloneDeep(e){return baseClone(e,CLONE_DEEP_FLAG|CLONE_SYMBOLS_FLAG)}var HASH_UNDEFINED="__lodash_hash_undefined__";function setCacheAdd(e){return this.__data__.set(e,HASH_UNDEFINED),this}function setCacheHas(e){return this.__data__.has(e)}function SetCache(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new MapCache;++t<r;)this.add(e[t])}function arraySome(e,t){for(var r=-1,i=null==e?0:e.length;++r<i;)if(t(e[r],r,e))return!0;return!1}function cacheHas(e,t){return e.has(t)}SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas;var COMPARE_PARTIAL_FLAG$5=1,COMPARE_UNORDERED_FLAG$3=2;function equalArrays(e,t,r,i,n,o){var a=r&COMPARE_PARTIAL_FLAG$5,s=e.length,l=t.length;if(s!=l&&!(a&&l>s))return!1;var c=o.get(e),u=o.get(t);if(c&&u)return c==t&&u==e;var h=-1,d=!0,p=r&COMPARE_UNORDERED_FLAG$3?new SetCache:void 0;for(o.set(e,t),o.set(t,e);++h<s;){var f=e[h],g=t[h];if(i)var y=a?i(g,f,h,t,e,o):i(f,g,h,e,t,o);if(void 0!==y){if(y)continue;d=!1;break}if(p){if(!arraySome(t,(function(e,t){if(!cacheHas(p,t)&&(f===e||n(f,e,r,i,o)))return p.push(t)}))){d=!1;break}}else if(f!==g&&!n(f,g,r,i,o)){d=!1;break}}return o.delete(e),o.delete(t),d}function mapToArray(e){var t=-1,r=Array(e.size);return e.forEach((function(e,i){r[++t]=[i,e]})),r}function setToArray(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}var COMPARE_PARTIAL_FLAG$4=1,COMPARE_UNORDERED_FLAG$2=2,boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",mapTag="[object Map]",numberTag="[object Number]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag$1="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",symbolProto$1=_Symbol$3?_Symbol$3.prototype:void 0,symbolValueOf=symbolProto$1?symbolProto$1.valueOf:void 0;function equalByTag(e,t,r,i,n,o,a){switch(r){case dataViewTag:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case arrayBufferTag:return!(e.byteLength!=t.byteLength||!o(new Uint8Array$4(e),new Uint8Array$4(t)));case boolTag:case dateTag:case numberTag:return eq(+e,+t);case errorTag:return e.name==t.name&&e.message==t.message;case regexpTag:case stringTag:return e==t+"";case mapTag:var s=mapToArray;case setTag:var l=i&COMPARE_PARTIAL_FLAG$4;if(s||(s=setToArray),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;i|=COMPARE_UNORDERED_FLAG$2,a.set(e,t);var u=equalArrays(s(e),s(t),i,n,o,a);return a.delete(e),u;case symbolTag$1:if(symbolValueOf)return symbolValueOf.call(e)==symbolValueOf.call(t)}return!1}var COMPARE_PARTIAL_FLAG$3=1,objectProto$2=Object.prototype,hasOwnProperty$3=objectProto$2.hasOwnProperty;function equalObjects(e,t,r,i,n,o){var a=r&COMPARE_PARTIAL_FLAG$3,s=getAllKeys(e),l=s.length;if(l!=getAllKeys(t).length&&!a)return!1;for(var c=l;c--;){var u=s[c];if(!(a?u in t:hasOwnProperty$3.call(t,u)))return!1}var h=o.get(e),d=o.get(t);if(h&&d)return h==t&&d==e;var p=!0;o.set(e,t),o.set(t,e);for(var f=a;++c<l;){var g=e[u=s[c]],y=t[u];if(i)var v=a?i(y,g,u,t,e,o):i(g,y,u,e,t,o);if(!(void 0===v?g===y||n(g,y,r,i,o):v)){p=!1;break}f||(f="constructor"==u)}if(p&&!f){var m=e.constructor,_=t.constructor;m==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof m&&m instanceof m&&"function"==typeof _&&_ instanceof _||(p=!1)}return o.delete(e),o.delete(t),p}var COMPARE_PARTIAL_FLAG$2=1,argsTag="[object Arguments]",arrayTag="[object Array]",objectTag="[object Object]",objectProto$1=Object.prototype,hasOwnProperty$2=objectProto$1.hasOwnProperty;function baseIsEqualDeep(e,t,r,i,n,o){var a=isArray$7(e),s=isArray$7(t),l=a?arrayTag:getTag$1(e),c=s?arrayTag:getTag$1(t),u=(l=l==argsTag?objectTag:l)==objectTag,h=(c=c==argsTag?objectTag:c)==objectTag,d=l==c;if(d&&isBuffer$1(e)){if(!isBuffer$1(t))return!1;a=!0,u=!1}if(d&&!u)return o||(o=new Stack),a||isTypedArray$3(e)?equalArrays(e,t,r,i,n,o):equalByTag(e,t,l,r,i,n,o);if(!(r&COMPARE_PARTIAL_FLAG$2)){var p=u&&hasOwnProperty$2.call(e,"__wrapped__"),f=h&&hasOwnProperty$2.call(t,"__wrapped__");if(p||f){var g=p?e.value():e,y=f?t.value():t;return o||(o=new Stack),n(g,y,r,i,o)}}return!!d&&(o||(o=new Stack),equalObjects(e,t,r,i,n,o))}function baseIsEqual(e,t,r,i,n){return e===t||(null==e||null==t||!isObjectLike(e)&&!isObjectLike(t)?e!=e&&t!=t:baseIsEqualDeep(e,t,r,i,baseIsEqual,n))}var COMPARE_PARTIAL_FLAG$1=1,COMPARE_UNORDERED_FLAG$1=2;function baseIsMatch(e,t,r,i){var n=r.length,o=n,a=!i;if(null==e)return!o;for(e=Object(e);n--;){var s=r[n];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++n<o;){var l=(s=r[n])[0],c=e[l],u=s[1];if(a&&s[2]){if(void 0===c&&!(l in e))return!1}else{var h=new Stack;if(i)var d=i(c,u,l,e,t,h);if(!(void 0===d?baseIsEqual(u,c,COMPARE_PARTIAL_FLAG$1|COMPARE_UNORDERED_FLAG$1,i,h):d))return!1}}return!0}function isStrictComparable(e){return e==e&&!isObject$n(e)}function getMatchData(e){for(var t=keys$4(e),r=t.length;r--;){var i=t[r],n=e[i];t[r]=[i,n,isStrictComparable(n)]}return t}function matchesStrictComparable(e,t){return function(r){return null!=r&&(r[e]===t&&(void 0!==t||e in Object(r)))}}function baseMatches(e){var t=getMatchData(e);return 1==t.length&&t[0][2]?matchesStrictComparable(t[0][0],t[0][1]):function(r){return r===e||baseIsMatch(r,e,t)}}var symbolTag="[object Symbol]";function isSymbol$7(e){return"symbol"==_typeof$4(e)||isObjectLike(e)&&baseGetTag(e)==symbolTag}var reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey(e,t){if(isArray$7(e))return!1;var r=_typeof$4(e);return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!isSymbol$7(e))||(reIsPlainProp.test(e)||!reIsDeepProp.test(e)||null!=t&&e in Object(t))}var FUNC_ERROR_TEXT$2="Expected a function";function memoize(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT$2);var r=function r(){var i=arguments,n=t?t.apply(this,i):i[0],o=r.cache;if(o.has(n))return o.get(n);var a=e.apply(this,i);return r.cache=o.set(n,a)||o,a};return r.cache=new(memoize.Cache||MapCache),r}memoize.Cache=MapCache;var MAX_MEMOIZE_SIZE=500;function memoizeCapped(e){var t=memoize(e,(function(e){return r.size===MAX_MEMOIZE_SIZE&&r.clear(),e})),r=t.cache;return t}var rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=memoizeCapped((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(rePropName,(function(e,r,i,n){t.push(i?n.replace(reEscapeChar,"$1"):r||e)})),t})),stringToPath$1=stringToPath;function arrayMap(e,t){for(var r=-1,i=null==e?0:e.length,n=Array(i);++r<i;)n[r]=t(e[r],r,e);return n}var INFINITY$2=1/0,symbolProto=_Symbol$3?_Symbol$3.prototype:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;function baseToString(e){if("string"==typeof e)return e;if(isArray$7(e))return arrayMap(e,baseToString)+"";if(isSymbol$7(e))return symbolToString?symbolToString.call(e):"";var t=e+"";return"0"==t&&1/e==-INFINITY$2?"-0":t}function toString$i(e){return null==e?"":baseToString(e)}function castPath(e,t){return isArray$7(e)?e:isKey(e,t)?[e]:stringToPath$1(toString$i(e))}var INFINITY$1=1/0;function toKey(e){if("string"==typeof e||isSymbol$7(e))return e;var t=e+"";return"0"==t&&1/e==-INFINITY$1?"-0":t}function baseGet(e,t){for(var r=0,i=(t=castPath(t,e)).length;null!=e&&r<i;)e=e[toKey(t[r++])];return r&&r==i?e:void 0}function get$2(e,t,r){var i=null==e?void 0:baseGet(e,t);return void 0===i?r:i}function baseHasIn(e,t){return null!=e&&t in Object(e)}function hasPath(e,t,r){for(var i=-1,n=(t=castPath(t,e)).length,o=!1;++i<n;){var a=toKey(t[i]);if(!(o=null!=e&&r(e,a)))break;e=e[a]}return o||++i!=n?o:!!(n=null==e?0:e.length)&&isLength(n)&&isIndex(a,n)&&(isArray$7(e)||isArguments$1(e))}function hasIn(e,t){return null!=e&&hasPath(e,t,baseHasIn)}var COMPARE_PARTIAL_FLAG=1,COMPARE_UNORDERED_FLAG=2;function baseMatchesProperty(e,t){return isKey(e)&&isStrictComparable(t)?matchesStrictComparable(toKey(e),t):function(r){var i=get$2(r,e);return void 0===i&&i===t?hasIn(r,e):baseIsEqual(t,i,COMPARE_PARTIAL_FLAG|COMPARE_UNORDERED_FLAG)}}function identity(e){return e}function baseProperty(e){return function(t){return null==t?void 0:t[e]}}function basePropertyDeep(e){return function(t){return baseGet(t,e)}}function property(e){return isKey(e)?baseProperty(toKey(e)):basePropertyDeep(e)}function baseIteratee(e){return"function"==typeof e?e:null==e?identity:"object"==_typeof$4(e)?isArray$7(e)?baseMatchesProperty(e[0],e[1]):baseMatches(e):property(e)}function baseFindIndex(e,t,r,i){for(var n=e.length,o=r+(i?1:-1);i?o--:++o<n;)if(t(e[o],o,e))return o;return-1}function baseIsNaN(e){return e!=e}function strictIndexOf(e,t,r){for(var i=r-1,n=e.length;++i<n;)if(e[i]===t)return i;return-1}function baseIndexOf(e,t,r){return t==t?strictIndexOf(e,t,r):baseFindIndex(e,baseIsNaN,r)}function arrayIncludes$1(e,t){return!!(null==e?0:e.length)&&baseIndexOf(e,t,0)>-1}function arrayIncludesWith(e,t,r){for(var i=-1,n=null==e?0:e.length;++i<n;)if(r(t,e[i]))return!0;return!1}function noop$1(){}var INFINITY=1/0,createSet=Set$2&&1/setToArray(new Set$2([,-0]))[1]==INFINITY?function(e){return new Set$2(e)}:noop$1,createSet$1=createSet,LARGE_ARRAY_SIZE=200;function baseUniq(e,t,r){var i=-1,n=arrayIncludes$1,o=e.length,a=!0,s=[],l=s;if(r)a=!1,n=arrayIncludesWith;else if(o>=LARGE_ARRAY_SIZE){var c=t?null:createSet$1(e);if(c)return setToArray(c);a=!1,n=cacheHas,l=new SetCache}else l=t?[]:s;e:for(;++i<o;){var u=e[i],h=t?t(u):u;if(u=r||0!==u?u:0,a&&h==h){for(var d=l.length;d--;)if(l[d]===h)continue e;t&&l.push(h),s.push(u)}else n(l,h,r)||(l!==s&&l.push(h),s.push(u))}return s}function uniqBy(e,t){return e&&e.length?baseUniq(e,baseIteratee(t)):[]}var CodecType=function(e){return e.H265="h265",e.H264="h264",e}(CodecType||{}),RTMCodec=function(e){return e.H264="h264",e}(RTMCodec||{}),commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},proxy=function(){var e,t=null;function r(e){return!!e&&("object"===_typeof$4(e)||"function"==typeof e)}function i(e){if(null!==e&&!r(e))throw new TypeError("Object prototype may only be an Object or null: "+e)}var n=Object,o=Boolean(n.create)||!({__proto__:null}instanceof n),a=n.create||(o?function(e){return i(e),{__proto__:e}}:function(e){if(i(e),null===e)throw new SyntaxError("Native Object.create is required to create objects with null prototype");var t=function(){};return t.prototype=e,new t}),s=function(){return null},l=n.getPrototypeOf||([].__proto__===Array.prototype?function(e){var t=e.__proto__;return r(t)?t:null}:s);return e=function(c,u){if(void 0===(this&&this instanceof e?this.constructor:void 0))throw new TypeError("Constructor Proxy requires 'new'");if(!r(c)||!r(u))throw new TypeError("Cannot create proxy with a non-object as target or handler");var h=function(){};t=function(){c=null,h=function(e){throw new TypeError("Cannot perform '".concat(e,"' on a proxy that has been revoked"))}},setTimeout((function(){t=null}),0);var d=u;for(var p in u={get:null,set:null,apply:null,construct:null},d){if(!(p in u))throw new TypeError("Proxy polyfill does not support trap '".concat(p,"'"));u[p]=d[p]}"function"==typeof d&&(u.apply=d.apply.bind(d));var f,g=l(c),y=!1,v=!1;"function"==typeof c?(f=function(){var e=this&&this.constructor===f,t=Array.prototype.slice.call(arguments);if(h(e?"construct":"apply"),e&&u.construct)return u.construct.call(this,c,t);if(!e&&u.apply)return u.apply(c,this,t);if(e){t.unshift(c);var r=c.bind.apply(c,t);return new r}return c.apply(this,t)},y=!0):c instanceof Array?(f=[],v=!0):f=o||null!==g?a(g):{};var m=u.get?function(e){return h("get"),u.get(this,e,f)}:function(e){return h("get"),this[e]},_=u.set?function(e,t){h("set"),u.set(this,e,t,f)}:function(e,t){h("set"),this[e]=t},b=n.getOwnPropertyNames(c),T={};b.forEach((function(e){if(!y&&!v||!(e in f)){var t=n.getOwnPropertyDescriptor(c,e),r={enumerable:Boolean(t.enumerable),get:m.bind(c,e),set:_.bind(c,e)};n.defineProperty(f,e,r),T[e]=!0}}));var S=!0;if(y||v){var E=n.setPrototypeOf||([].__proto__===Array.prototype?function(e,t){return i(t),e.__proto__=t,e}:s);g&&E(f,g)||(S=!1)}if(u.get||!S)for(var $ in c)T[$]||n.defineProperty(f,$,{get:m.bind(c,$)});return n.seal(c),n.seal(f),f},e.revocable=function(r,i){return{proxy:new e(r,i),revoke:t}},e},Proxy$1=proxy(),MyProxy=function(){function e(){_classCallCheck$5(this,e),this.subscribeId=0,this.watcherMap=new Map}return _createClass$6(e,[{key:"observe",value:function(e){var t=this,r=new Proxy$1(e,{set:function(e,i,n){var o=Reflect.get(e,i);Reflect.set(e,i,n);var a=t.watcherMap.get(r);return a&&(t.flushCallback(a),t.flushPropertyCallback(a,i,o,n)),!0}});return this.watcherMap.set(r,{pending:!1,queue:[],property:{}}),r}},{key:"subscribe",value:function(e,t){var r=this.watcherMap.get(e);if(r)return this.subscribeId++,r.queue.push({id:this.subscribeId,callback:t}),this.subscribeId}},{key:"unsubscribe",value:function(e,t){var r=this.watcherMap.get(e);if(r){var i=r.queue,n=i.findIndex((function(e){return e.id===t}));void 0!==n&&n>-1&&i.splice(n,1)}}},{key:"subscribeProperty",value:function(e,t,r){var i=this.watcherMap.get(e);i&&(this.subscribeId++,i.property[t]||(i.property[t]={pending:!1,timer:0,pre:null,queue:[]}),i.property[t].queue.push({id:this.subscribeId,callback:r}))}},{key:"unsubscribeProperty",value:function(e,t,r){var i=this.watcherMap.get(e);if(i){var n=i.property[t];if(n){var o=n.queue,a=o.findIndex((function(e){return e.id===r}));void 0!==a&&a>-1&&o.splice(a,1)}}}},{key:"flushCallback",value:function(e){e.pending||(e.pending=!0,setTimeout((function(){e.queue.forEach((function(e){return e.callback()})),e.pending=!1}),0))}},{key:"flushPropertyCallback",value:function(e,t,r,i){var n=e.property[t];n&&(clearTimeout(n.timer),!1===n.pending&&(n.pending=!0,n.pre=r),n.timer=setTimeout((function(){n.queue.forEach((function(e){return e.callback(n.pre,i)})),n.pending=!1}),0))}}]),e}(),MyProxy$1=new MyProxy;function ownKeys$6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function _objectSpread2$4(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$6(Object(r),!0).forEach((function(t){_defineProperty$5(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys$6(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _typeof$3(e){return(_typeof$3="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _classCallCheck$4(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties$5(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,_toPropertyKey$3(i.key),i)}}function _createClass$5(e,t,r){return t&&_defineProperties$5(e.prototype,t),r&&_defineProperties$5(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty$5(e,t,r){return(t=_toPropertyKey$3(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _inherits$4(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$4(e,t)}function _getPrototypeOf$4(e){return(_getPrototypeOf$4=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _setPrototypeOf$4(e,t){return(_setPrototypeOf$4=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function _isNativeReflectConstruct$4(){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(e2){return!1}}function _assertThisInitialized$4(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _possibleConstructorReturn$4(e,t){if(t&&("object"===_typeof$4(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$4(e)}function _createSuper$4(e){var t=_isNativeReflectConstruct$4();return function(){var r,i=_getPrototypeOf$4(e);if(t){var n=_getPrototypeOf$4(this).constructor;r=Reflect.construct(i,arguments,n)}else r=i.apply(this,arguments);return _possibleConstructorReturn$4(this,r)}}function _superPropBase$2(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf$4(e)););return e}function _get$2(){return _get$2="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var i=_superPropBase$2(e,t);if(i){var n=Object.getOwnPropertyDescriptor(i,t);return n.get?n.get.call(arguments.length<3?e:r):n.value}},_get$2.apply(this,arguments)}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray$1(e)||_nonIterableSpread()}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray$1(e)}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}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,i=new Array(t);r<t;r++)i[r]=e[r];return i}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 _toPrimitive$3(e,t){if("object"!==_typeof$4(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!==_typeof$4(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _toPropertyKey$3(e){var t=_toPrimitive$3(e,"string");return"symbol"===_typeof$4(t)?t:String(t)}var eventemitter3={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,r="~";function i(){}function n(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function o(e,t,i,o,a){if("function"!=typeof i)throw new TypeError("The listener must be a function");var s=new n(i,o||e,a),l=r?r+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new i:delete e._events[t]}function s(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(r=!1)),s.prototype.eventNames=function(){var e,i,n=[];if(0===this._eventsCount)return n;for(i in e=this._events)t.call(e,i)&&n.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},s.prototype.listeners=function(e){var t=r?r+e:e,i=this._events[t];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,o=i.length,a=new Array(o);n<o;n++)a[n]=i[n].fn;return a},s.prototype.listenerCount=function(e){var t=r?r+e:e,i=this._events[t];return i?i.fn?1:i.length:0},s.prototype.emit=function(e,t,i,n,o,a){var s=r?r+e:e;if(!this._events[s])return!1;var l,c,u=this._events[s],h=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),h){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,i),!0;case 4:return u.fn.call(u.context,t,i,n),!0;case 5:return u.fn.call(u.context,t,i,n,o),!0;case 6:return u.fn.call(u.context,t,i,n,o,a),!0}for(c=1,l=new Array(h-1);c<h;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var d,p=u.length;for(c=0;c<p;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),h){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,i);break;case 4:u[c].fn.call(u[c].context,t,i,n);break;default:if(!l)for(d=1,l=new Array(h-1);d<h;d++)l[d-1]=arguments[d];u[c].fn.apply(u[c].context,l)}}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,i,n){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||n&&!s.once||i&&s.context!==i||a(this,o);else{for(var l=0,c=[],u=s.length;l<u;l++)(s[l].fn!==t||n&&!s[l].once||i&&s[l].context!==i)&&c.push(s[l]);c.length?this._events[o]=1===c.length?c[0]:c: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 i,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 EventEmitter=eventemitter3.exports,XG_DEBUG_OPEN="undefined"!=typeof window&&window.location&&window.location.href.indexOf("xgplayerdebugger=1")>-1,STYLE={info:"color: #525252; background-color: #90ee90;",error:"color: #525252; background-color: red;",warn:"color: #525252; background-color: yellow; "},XGTAG="%c[xgplayer]",XG_DEBUG={config:{debug:XG_DEBUG_OPEN?3:0},logInfo:function(e){for(var t,r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];this.config.debug>=3&&(t=console).log.apply(t,[XGTAG,STYLE.info,e].concat(i))},logWarn:function(e){for(var t,r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];this.config.debug>=1&&(t=console).warn.apply(t,[XGTAG,STYLE.warn,e].concat(i))},logError:function(e){var t;if(!(this.config.debug<1)){for(var r=this.config.debug>=2?"trace":"error",i=arguments.length,n=new Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(t=console)[r].apply(t,[XGTAG,STYLE.error,e].concat(n))}}};function bindDebug(e){e.logInfo=XG_DEBUG.logInfo.bind(e),e.logWarn=XG_DEBUG.logWarn.bind(e),e.logError=XG_DEBUG.logError.bind(e)}var XgplayerTimeRange=function(){function e(t){_classCallCheck$4(this,e),this.bufferedList=t}return _createClass$5(e,[{key:"start",value:function(e){return this.bufferedList[e].start}},{key:"end",value:function(e){return this.bufferedList[e].end}},{key:"length",get:function(){return this.bufferedList.length}}]),e}(),util={};function checkIsIn(e,t){for(var r=0,i=t.length;r<i;r++)if(e.indexOf(t[r])>-1)return!0;return!1}function isObject$m(e){var t=_typeof$3(e);return null!==e&&("object"===t||"function"===t)}function debounce$2(e,t,r){var i,n,o,a,s,l,c=0,u=!1,h=!1,d=!0,p=!t&&0!==t&&"function"==typeof window.requestAnimationFrame;if("function"!=typeof e)throw new TypeError("Expected a function");function f(t){var r=i,o=n;return i=n=void 0,c=t,a=e.apply(o,r)}function g(e,t){return p?(window.cancelAnimationFrame(s),window.requestAnimationFrame(e)):setTimeout(e,t)}function y(e){return c=e,s=g(m,t),u?f(e):a}function v(e){var r=e-l;return void 0===l||r>=t||r<0||h&&e-c>=o}function m(){var e=Date.now();if(v(e))return _(e);s=g(m,function(e){var r=e-c,i=t-(e-l);return h?Math.min(i,o-r):i}(e))}function _(e){return s=void 0,d&&i?f(e):(i=n=void 0,a)}function b(){for(var e=Date.now(),r=v(e),o=arguments.length,c=new Array(o),u=0;u<o;u++)c[u]=arguments[u];if(i=c,n=this,l=e,r){if(void 0===s)return y(l);if(h)return s=g(m,t),f(l)}return void 0===s&&(s=g(m,t)),a}return t=+t||0,isObject$m(r)&&(u=!!r.leading,o=(h="maxWait"in r)?Math.max(+r.maxWait||0,t):o,d="trailing"in r?!!r.trailing:d),b.cancel=function(){void 0!==s&&function(e){if(p)return window.cancelAnimationFrame(e);clearTimeout(e)}(s),c=0,i=l=n=s=void 0},b.flush=function(){return void 0===s?a:_(Date.now())},b.pending=function(){return void 0!==s},b}function throttle$1(e,t,r){var i=!0,n=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return isObject$m(r)&&(i="leading"in r?!!r.leading:i,n="trailing"in r?!!r.trailing:n),debounce$2(e,t,{leading:i,trailing:n,maxWait:t})}function getLang$1(){var e=(document.documentElement.getAttribute("lang")||navigator.language||"zh-cn").toLocaleLowerCase();return"zh-cn"===e&&(e="zh"),e}function checkIsCurrentVideo(e,t,r){if(e){var i=e.getAttribute(r);return!(!i||i!==t||"VIDEO"!==e.tagName&&"AUDIO"!==e.tagName)}}util.createDom=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",n=document.createElement(e);return n.className=i,n.innerHTML=t,Object.keys(r).forEach((function(t){var i=t,o=r[t];"video"===e||"audio"===e||"live-video"===e?o&&n.setAttribute(i,o):n.setAttribute(i,o)})),n},util.createDomFromHtml=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";try{var i=document.createElement("div");i.innerHTML=e;var n=i.children;return i=null,n.length>0?(n=n[0],r&&util.addClass(n,r),t&&Object.keys(t).forEach((function(e){n.setAttribute(e,t[e])})),n):null}catch(o){return XG_DEBUG.logError("util.createDomFromHtml",o),null}},util.hasClass=function(e,t){if(!e||!t)return!1;try{return Array.prototype.some.call(e.classList,(function(e){return e===t}))}catch(e2){var r=e.className&&"object"===_typeof$3(e.className)?e.getAttribute("class"):e.className;return r&&!!r.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}},util.addClass=function(e,t){if(e&&t)try{t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.add(t)}))}catch(e2){util.hasClass(e,t)||(e.className&&"object"===_typeof$3(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t)}},util.removeClass=function(e,t){if(e&&t)try{t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.remove(t)}))}catch(e2){util.hasClass(e,t)&&t.split(/\s+/g).forEach((function(t){var r=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===_typeof$3(e.className)?e.setAttribute("class",e.getAttribute("class").replace(r," ")):e.className=e.className.replace(r," ")}))}},util.toggleClass=function(e,t){e&&t.split(/\s+/g).forEach((function(t){util.hasClass(e,t)?util.removeClass(e,t):util.addClass(e,t)}))},util.classNames=function(){for(var e=arguments,t=[],r=function(r){"String"===util.typeOf(e[r])?t.push(e[r]):"Object"===util.typeOf(e[r])&&Object.keys(e[r]).map((function(i){e[r][i]&&t.push(i)}))},i=0;i<arguments.length;i++)r(i);return t.join(" ")},util.findDom=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,r=arguments.length>1?arguments[1]:void 0;try{e=t.querySelector(r)}catch(e2){XG_DEBUG.logError("util.findDom",e2),0===r.indexOf("#")&&(e=t.getElementById(r.slice(1)))}return e},util.getCss=function(e,t){return e.currentStyle?e.currentStyle[t]:document.defaultView.getComputedStyle(e,!1)[t]},util.padStart=function(e,t,r){for(var i=String(r),n=t>>0,o=Math.ceil(n/i.length),a=[],s=String(e);o--;)a.push(i);return a.join("").substring(0,n-s.length)+s},util.format=function(e){if(window.isNaN(e))return"";e=Math.round(e);var t=util.padStart(Math.floor(e/3600),2,0),r=util.padStart(Math.floor((e-3600*t)/60),2,0),i=util.padStart(Math.floor(e-3600*t-60*r),2,0);return("00"===t?[r,i]:[t,r,i]).join(":")},util.event=function(e){if(e.touches){var t=e.touches[0]||e.changedTouches[0];e.clientX=t.clientX||0,e.clientY=t.clientY||0,e.offsetX=t.pageX-t.target.offsetLeft,e.offsetY=t.pageY-t.target.offsetTop}e._target=e.target||e.srcElement},util.typeOf=function(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]},util.deepCopy=function(e,t){if("Object"===util.typeOf(t)&&"Object"===util.typeOf(e))return Object.keys(t).forEach((function(r){"Object"!==util.typeOf(t[r])||t[r]instanceof Node?"Array"===util.typeOf(t[r])?e[r]="Array"===util.typeOf(e[r])?e[r].concat(t[r]):t[r]:e[r]=t[r]:void 0===e[r]||void 0===e[r]?e[r]=t[r]:util.deepCopy(e[r],t[r])})),e},util.deepMerge=function(e,t){return Object.keys(t).map((function(r){var i;"Array"===util.typeOf(t[r])&&"Array"===util.typeOf(e[r])?"Array"===util.typeOf(e[r])&&(i=e[r]).push.apply(i,_toConsumableArray(t[r])):util.typeOf(e[r])!==util.typeOf(t[r])||null===e[r]||"Object"!==util.typeOf(e[r])||t[r]instanceof window.Node?null!==t[r]&&(e[r]=t[r]):util.deepMerge(e[r],t[r])})),e},util.getBgImage=function(e){var t=(e.currentStyle||window.getComputedStyle(e,null)).backgroundImage;if(!t||"none"===t)return"";var r=document.createElement("a");return r.href=t.replace(/url\("|"\)/g,""),r.href},util.copyDom=function(e){if(e&&1===e.nodeType){var t=document.createElement(e.tagName);return Array.prototype.forEach.call(e.attributes,(function(e){t.setAttribute(e.name,e.value)})),e.innerHTML&&(t.innerHTML=e.innerHTML),t}return""},util.setInterval=function(e,t,r,i){e._interval[t]||(e._interval[t]=window.setInterval(r.bind(e),i))},util.clearInterval=function(e,t){clearInterval(e._interval[t]),e._interval[t]=null},util.setTimeout=function(e,t,r){e._timers||(e._timers=[]);var i=setTimeout((function(){t(),util.clearTimeout(e,i)}),r);return e._timers.push(i),i},util.clearTimeout=function(e,t){var r=e._timers;if("Array"===util.typeOf(r)){for(var i=0;i<r.length;i++)if(r[i]===t){r.splice(i,1),clearTimeout(t);break}}else clearTimeout(t)},util.clearAllTimers=function(e){var t=e._timers;"Array"===util.typeOf(t)&&(t.map((function(e){clearTimeout(e)})),e._timerIds=[])},util.createImgBtn=function(e,t,r,i){var n,o,a,s=util.createDom("xg-".concat(e),"",{},"xgplayer-".concat(e,"-img"));(s.style.backgroundImage='url("'.concat(t,'")'),r&&i)&&(["px","rem","em","pt","dp","vw","vh","vm","%"].every((function(e){return!(r.indexOf(e)>-1&&i.indexOf(e)>-1)||(n=parseFloat(r.slice(0,r.indexOf(e)).trim()),o=parseFloat(i.slice(0,i.indexOf(e)).trim()),a=e,!1)})),s.style.width="".concat(n).concat(a),s.style.height="".concat(o).concat(a),s.style.backgroundSize="".concat(n).concat(a," ").concat(o).concat(a),s.style.margin="start"===e?"-".concat(o/2).concat(a," auto auto -").concat(n/2).concat(a):"auto 5px auto 5px");return s},util.Hex2RGBA=function(e,t){var r=[];if(/^\#[0-9A-F]{3}$/i.test(e)){var i="#";e.replace(/[0-9A-F]/gi,(function(e){i+=e+e})),e=i}return/^#[0-9A-F]{6}$/i.test(e)?(e.replace(/[0-9A-F]{2}/gi,(function(e){r.push(parseInt(e,16))})),"rgba(".concat(r.join(","),", ").concat(t,")")):"rgba(255, 255, 255, 0.1)"},util.getFullScreenEl=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},util.checkIsFunction=function(e){return e&&"function"==typeof e},util.checkIsObject=function(e){return null!==e&&"object"===_typeof$3(e)},util.hide=function(e){e.style.display="none"},util.show=function(e,t){e.style.display=t||"block"},util.isUndefined=function(e){if(null==e)return!0},util.isNotNull=function(e){return!(null==e)},util.setStyleFromCsstext=function(e,t){t&&("String"===util.typeOf(t)?t.replace(/\s+/g,"").split(";").map((function(t){if(t){var r=t.split(":");r.length>1&&(e.style[r[0]]=r[1])}})):Object.keys(t).map((function(r){e.style[r]=t[r]})))},util.filterStyleFromText=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["width","height","top","left","bottom","right","position","z-index","padding","margin","transform"],r=e.style.cssText;if(!r)return{};var i=r.replace(/\s+/g,"").split(";"),n={},o={};return i.map((function(e){if(e){var r=e.split(":");r.length>1&&(checkIsIn(r[0],t)?n[r[0]]=r[1]:o[r[0]]=r[1])}})),e.setAttribute("style",""),Object.keys(o).map((function(t){e.style[t]=o[t]})),n},util.getStyleFromCsstext=function(e){var t=e.style.cssText;if(!t)return{};var r=t.replace(/\s+/g,"").split(";"),i={};return r.map((function(e){if(e){var t=e.split(":");t.length>1&&(i[t[0]]=t[1])}})),i},util.preloadImg=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(e){var i=new window.Image;i.onload=function(e){i=null,t&&t(e)},i.onerror=function(e){i=null,r&&r(e)},i.src=e}},util.stopPropagation=function(e){e&&(e.stopPropagation(),e.cancelable&&e.preventDefault())},util.scrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},util.scrollLeft=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},util.checkTouchSupport=function(){return"ontouchstart"in window},util.getBuffered2=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,r=[],i=0;i<e.length;i++)r.push({start:e.start(i)<.5?0:e.start(i),end:e.end(i)});r.sort((function(e,t){var r=e.start-t.start;return r||t.end-e.end}));var n=[];if(t)for(var o=0;o<r.length;o++){var a=n.length;if(a){var s=n[a-1].end;r[o].start-s<t?r[o].end>s&&(n[a-1].end=r[o].end):n.push(r[o])}else n.push(r[o])}else n=r;return new XgplayerTimeRange(n)},util.getEventPos=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return e.touches&&e.touches.length>0&&(e=e.touches[0]),{x:e.x/t,y:e.y/t,clientX:e.clientX/t,clientY:e.clientY/t,offsetX:e.offsetX/t,offsetY:e.offsetY/t,pageX:e.pageX/t,pageY:e.pageY/t}},util.requestAnimationFrame=function(e){var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(t)return t(e)},util.getHostFromUrl=function(e){if("String"!==util.typeOf(e))return"";var t=e.split("/"),r="";return t.length>3&&t[2]&&(r=t[2]),r},util.cancelAnimationFrame=function(e){var t=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.cancelRequestAnimationFrame;t&&t(e)},util.isMSE=function(e){return!!(e&&e instanceof HTMLMediaElement)&&(/^blob/.test(e.currentSrc)||/^blob/.test(e.src))},util.generateSessionId=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=(new Date).getTime();try{e=parseInt(e)}catch(e2){e=0}t+=e,window.performance&&"function"==typeof window.performance.now&&(t+=parseInt(window.performance.now()));var r="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var r=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?r:3&r|8).toString(16)}));return r},util.createEvent=function(e){var t;return"function"==typeof window.Event?t=new Event(e):(t=document.createEvent("Event")).initEvent(e,!0,!0),t},util.adjustTimeByDuration=function(e,t,r){return t&&e&&(e>t||r&&e<t)?t:e},util.createPositionBar=function(e,t){var r=util.createDom("xg-bar","",{"data-index":-1},e);return t.appendChild(r),r},util.getTransformStyle=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{x:0,y:0,scale:1,rotate:0};return"scale(".concat(e.scale||1,") translate(").concat(e.x||0,"%, ").concat(e.y||0,"%) rotate(").concat(e.rotate||0,"deg)")},util.convertDeg=function(e){return Math.abs(e)<=1?360*e:e%360};var VERSION_REG={android:/(Android)\s([\d.]+)/,ios:/(Version)\/([\d.]+)/},H264_MIMETYPES=["avc1.42E01E, mp4a.40.2","avc1.58A01E, mp4a.40.2","avc1.4D401E, mp4a.40.2","avc1.64001E, mp4a.40.2","avc1.42E01E","mp4v.20.8","avc1.42E01E, mp4a.40.2","avc1.58A01E, mp4a.40.2","avc1.4D401E, mp4a.40.2","avc1.64001E, mp4a.40.2","mp4v.20.8, mp4a.40.2","mp4v.20.240, mp4a.40.2"],sniffer$1={get device(){return sniffer$1.os.isPc?"pc":"mobile"},get browser(){if("undefined"==typeof navigator)return"";var e=navigator.userAgent.toLowerCase(),t={ie:/rv:([\d.]+)\) like gecko/,firefox:/firefox\/([\d.]+)/,chrome:/chrome\/([\d.]+)/,opera:/opera.([\d.]+)/,safari:/version\/([\d.]+).*safari/};return[].concat(Object.keys(t).filter((function(r){return t[r].test(e)})))[0]},get os(){if("undefined"==typeof navigator)return{};var e=navigator.userAgent,t=/(?:Windows Phone)/.test(e),r=/(?:SymbianOS)/.test(e)||t,i=/(?:Android)/.test(e),n=/(?:Firefox)/.test(e),o=/(?:iPad|PlayBook)/.test(e)||i&&!/(?:Mobile)/.test(e)||n&&/(?:Tablet)/.test(e),a=/(?:iPhone)/.test(e)&&!o,s=!(a||i||r||o),l=/(?:iPad|PlayBook)/.test(e);return{isTablet:o,isPhone:a,isIpad:l,isIos:a||l,isAndroid:i,isPc:s,isSymbian:r,isWindowsPhone:t,isFireFox:n}},get osVersion(){if("undefined"==typeof navigator)return 0;var e=navigator.userAgent,t="",r=(t=/(?:iPhone)|(?:iPad|PlayBook)/.test(e)?VERSION_REG.ios:VERSION_REG.android)?t.exec(e):[];if(r&&r.length>=3){var i=r[2].split(".");return i.length>0?parseInt(i[0]):0}return 0},get isWeixin(){if("undefined"==typeof navigator)return!1;return!!/(micromessenger)\/([\d.]+)/.exec(navigator.userAgent.toLocaleLowerCase())},isSupportMP4:function(){var e={isSupport:!1,mime:""};if("undefined"==typeof document)return e;if(this.supportResult)return this.supportResult;var t=document.createElement("video");return"function"==typeof t.canPlayType&&H264_MIMETYPES.map((function(r){"probably"===t.canPlayType('video/mp4; codecs="'.concat(r,'"'))&&(e.isSupport=!0,e.mime+="||".concat(r))})),this.supportResult=e,t=null,e},isMSESupport:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'video/mp4; codecs="avc1.42E01E,mp4a.40.2"';if("undefined"==typeof MediaSource||!MediaSource)return!1;try{return MediaSource.isTypeSupported(e)}catch(t){return this._logger.error(e,t),!1}},isHevcSupported:function(){return!("undefined"==typeof MediaSource||!MediaSource.isTypeSupported)&&(MediaSource.isTypeSupported('video/mp4;codecs="hev1.1.6.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.2.4.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.3.E.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.4.10.L120.90"'))},probeConfigSupported:function(e){var t={supported:!1,smooth:!1,powerEfficient:!1};if(!e||"undefined"==typeof navigator)return Promise.resolve(t);if(navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo)return navigator.mediaCapabilities.decodingInfo(e);var r=e.video||{},i=e.audio||{};try{var n=MediaSource.isTypeSupported(r.contentType),o=MediaSource.isTypeSupported(i.contentType);return Promise.resolve({supported:n&&o,smooth:!1,powerEfficient:!1})}catch(e2){return Promise.resolve(t)}}},version$2="3.0.7-alpha.3",ERROR_TYPE_MAP={1:"media",2:"media",3:"media",4:"media",5:"media",6:"media"},ERROR_MAP={1:5101,2:5102,3:5103,4:5104,5:5105,6:5106},Errors=_createClass$5((function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{errorType:"",errorCode:0,errorMessage:"",originError:"",ext:{},mediaError:null};_classCallCheck$4(this,e);var i=t&&t.i18n?t.i18n.ERROR_TYPES:null;if(t.media){var n=r.mediaError?r.mediaError:t.media.error||{},o=t.duration,a=t.currentTime,s=t.ended,l=t.src,c=t.currentSrc,u=t.media,h=u.readyState,d=u.networkState,p=r.errorCode||n.code;ERROR_MAP[p]&&(p=ERROR_MAP[p]);var f={playerVersion:version$2,currentTime:a,duration:o,ended:s,readyState:h,networkState:d,src:l||c,errorType:r.errorType,errorCode:p,message:r.errorMessage||n.message,mediaError:n,originError:r.originError?r.originError.stack:"",host:util.getHostFromUrl(l||c)};return r.ext&&Object.keys(r.ext).map((function(e){f[e]=r.ext[e]})),f}if(arguments.length>1){for(var g={playerVersion:version$2,domain:document.domain},y=["errorType","currentTime","duration","networkState","readyState","src","currentSrc","ended","errd","errorCode","mediaError"],v=0;v<arguments.length;v++)g[y[v]]=arguments[v];return g.ex=i?(i[arguments[0]]||{}).msg:"",g}})),PLAY="play",PLAYING="playing",ENDED="ended",PAUSE="pause",ERROR$1="error",SEEKING="seeking",SEEKED="seeked",TIME_UPDATE="timeupdate",WAITING="waiting",CANPLAY="canplay",CANPLAY_THROUGH="canplaythrough",DURATION_CHANGE="durationchange",VOLUME_CHANGE="volumechange",LOADED_DATA="loadeddata",RATE_CHANGE="ratechange",PROGRESS="progress",LOAD_START="loadstart",EMPTIED="emptied",STALLED="stalled",SUSPEND="suspend",ABORT="abort",BUFFER_CHANGE="bufferedChange",PLAYER_FOCUS="focus",PLAYER_BLUR="blur",READY="ready",URL_NULL="urlNull",AUTOPLAY_STARTED="autoplay_started",AUTOPLAY_PREVENTED="autoplay_was_prevented",COMPLETE="complete",REPLAY="replay",DESTROY="destroy",URL_CHANGE="urlchange",DOWNLOAD_SPEED_CHANGE="download_speed_change",FULLSCREEN_CHANGE="fullscreen_change",CSS_FULLSCREEN_CHANGE="cssFullscreen_change",MINI_STATE_CHANGE="mini_state_change",DEFINITION_CHANGE="definition_change",BEFORE_DEFINITION_CHANGE="before_definition_change",AFTER_DEFINITION_CHANGE="after_definition_change",SEI_PARSED="SEI_PARSED",RETRY="retry",VIDEO_RESIZE="video_resize",PIP_CHANGE="pip_change",ROTATE="rotate",SCREEN_SHOT="screenShot",PLAYNEXT="playnext",SHORTCUT="shortcut",XGLOG="xglog",USER_ACTION="user_action",RESET="reset",SOURCE_ERROR="source_error",SOURCE_SUCCESS="source_success",SWITCH_SUBTITLE="switch_subtitle",VIDEO_EVENTS=["play","playing","ended","pause","error","seeking","seeked","timeupdate","waiting","canplay","canplaythrough","durationchange","volumechange","loadeddata","ratechange","progress","loadstart","emptied","stalled","suspend","abort","lowdecode"],STATS_EVENTS$1={STATS_INFO:"stats_info",STATS_DOWNLOAD:"stats_download",STATS_RESET:"stats_reset"},FPS_STUCK="fps_stuck",Events=Object.freeze(Object.defineProperty({__proto__:null,ABORT:ABORT,AFTER_DEFINITION_CHANGE:AFTER_DEFINITION_CHANGE,AUTOPLAY_PREVENTED:AUTOPLAY_PREVENTED,AUTOPLAY_STARTED:AUTOPLAY_STARTED,BEFORE_DEFINITION_CHANGE:BEFORE_DEFINITION_CHANGE,BUFFER_CHANGE:BUFFER_CHANGE,CANPLAY:CANPLAY,CANPLAY_THROUGH:CANPLAY_THROUGH,COMPLETE:COMPLETE,CSS_FULLSCREEN_CHANGE:CSS_FULLSCREEN_CHANGE,DEFINITION_CHANGE:DEFINITION_CHANGE,DESTROY:DESTROY,DOWNLOAD_SPEED_CHANGE:DOWNLOAD_SPEED_CHANGE,DURATION_CHANGE:DURATION_CHANGE,EMPTIED:EMPTIED,ENDED:ENDED,ERROR:ERROR$1,FPS_STUCK:FPS_STUCK,FULLSCREEN_CHANGE:FULLSCREEN_CHANGE,LOADED_DATA:LOADED_DATA,LOAD_START:LOAD_START,MINI_STATE_CHANGE:MINI_STATE_CHANGE,PAUSE:PAUSE,PIP_CHANGE:PIP_CHANGE,PLAY:PLAY,PLAYER_BLUR:PLAYER_BLUR,PLAYER_FOCUS:PLAYER_FOCUS,PLAYING:PLAYING,PLAYNEXT:PLAYNEXT,PROGRESS:PROGRESS,RATE_CHANGE:RATE_CHANGE,READY:READY,REPLAY:REPLAY,RESET:RESET,RETRY:RETRY,ROTATE:ROTATE,SCREEN_SHOT:SCREEN_SHOT,SEEKED:SEEKED,SEEKING:SEEKING,SEI_PARSED:SEI_PARSED,SHORTCUT:SHORTCUT,SOURCE_ERROR:SOURCE_ERROR,SOURCE_SUCCESS:SOURCE_SUCCESS,STALLED:STALLED,STATS_EVENTS:STATS_EVENTS$1,SUSPEND:SUSPEND,SWITCH_SUBTITLE:SWITCH_SUBTITLE,TIME_UPDATE:TIME_UPDATE,URL_CHANGE:URL_CHANGE,URL_NULL:URL_NULL,USER_ACTION:USER_ACTION,VIDEO_EVENTS:VIDEO_EVENTS,VIDEO_RESIZE:VIDEO_RESIZE,VOLUME_CHANGE:VOLUME_CHANGE,WAITING:WAITING,XGLOG:XGLOG},Symbol.toStringTag,{value:"Module"}));function emitVideoEvent(e,t){this&&this.emit&&("error"===e?this.errorHandler(e,t.error):this.emit(e,t))}function getVideoEventHandler(e,t){return function(r,i){var n={player:t,eventName:e,originalEvent:r,detail:r.detail||{},timeStamp:r.timeStamp,currentTime:t.currentTime,duration:t.duration,paused:t.paused,ended:t.ended,isInternalOp:!!t._internalOp[r.type],muted:t.muted,volume:t.volume,host:util.getHostFromUrl(t.currentSrc),vtype:t.vtype};if(t.removeInnerOP(r.type),"timeupdate"===e&&(t._currentTime=t.media&&t.media.currentTime),"ratechange"===e){var o=t.media?t.media.playbackRate:0;if(o&&t._rate===o)return;t._rate=t.media&&t.media.playbackRate}if("durationchange"===e&&(t._duration=t.media.duration),"volumechange"===e&&(n.isMutedChange=t._lastMuted!==t.muted,t._lastMuted=t.muted),"error"===e&&(n.error=i||t.video.error),t.mediaEventMiddleware[e]){var a=emitVideoEvent.bind(t,e,n);try{t.mediaEventMiddleware[e].call(t,n,a)}catch(s){throw emitVideoEvent.call(t,e,n),s}}else emitVideoEvent.call(t,e,n)}}var MediaProxy=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(e){var i;_classCallCheck$4(this,r),(i=t.call(this,e))._hasStart=!1,i._currentTime=0,i._duration=0,i._internalOp={},i._lastMuted=!1,i.vtype="MP4",i._rate=-1,i.mediaConfig=Object.assign({},{controls:!1,autoplay:e.autoplay,playsinline:e.playsinline,"x5-playsinline":e.playsinline,"webkit-playsinline":e.playsinline,"x5-video-player-fullscreen":e["x5-video-player-fullscreen"]||e.x5VideoPlayerFullscreen,"x5-video-orientation":e["x5-video-orientation"]||e.x5VideoOrientation,airplay:e.airplay,"webkit-airplay":e.airplay,tabindex:0|e.tabindex,mediaType:e.mediaType||"video","data-index":-1},e.videoConfig,e.videoAttributes);var n=e["x5-video-player-type"]||e.x5VideoPlayerType;return sniffer$1.isWeixin&&sniffer$1.os.isAndroid&&n&&(i.mediaConfig["x5-video-player-type"]=n,delete i.mediaConfig.playsinline,delete i.mediaConfig["webkit-playsinline"],delete i.mediaConfig["x5-playsinline"]),e.loop&&(i.mediaConfig.loop="loop"),i.media=util.createDom(i.mediaConfig.mediaType,"",i.mediaConfig,""),e.defaultPlaybackRate&&(i.media.defaultPlaybackRate=i.media.playbackRate=e.defaultPlaybackRate),"Number"===util.typeOf(e.volume)&&(i.volume=e.volume),e.autoplayMuted&&(i.media.muted=!0,i._lastMuted=!0),e.autoplay&&(i.media.autoplay=!0),i._interval={},i.mediaEventMiddleware={},i.attachVideoEvents(),i}return _createClass$5(r,[{key:"setEventsMiddleware",value:function(e){var t=this;Object.keys(e).map((function(r){t.mediaEventMiddleware[r]=e[r]}))}},{key:"removeEventsMiddleware",value:function(e){var t=this;Object.keys(e).map((function(e){delete t.mediaEventMiddleware[e]}))}},{key:"attachVideoEvents",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.media;this._evHandlers||(this._evHandlers=VIDEO_EVENTS.map((function(t){var r="on".concat(t.charAt(0).toUpperCase()).concat(t.slice(1));return"function"==typeof e[r]&&e.on(t,e[r]),_defineProperty$5({},t,getVideoEventHandler(t,e))}))),this._evHandlers.forEach((function(e){var r=Object.keys(e)[0];t.addEventListener(r,e[r],!1)}))}},{key:"detachVideoEvents",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.media;this._evHandlers.forEach((function(e){var r=Object.keys(e)[0];t.removeEventListener(r,e[r],!1)})),this._evHandlers.forEach((function(t){var r=Object.keys(t)[0],i="on".concat(r.charAt(0).toUpperCase()).concat(r.slice(1));"function"==typeof e[i]&&e.off(r,e[i])})),this._evHandlers=null}},{key:"_attachSourceEvents",value:function(e,t){var r=this;e.removeAttribute("src"),e.load(),t.forEach((function(e){r.media.appendChild(util.createDom("source","",{src:"".concat(e.src),type:"".concat(e.type||"")}))}));var i=e.children;if(i){this._videoSourceCount=i.length,this._vLoadeddata=function(e){r.emit(SOURCE_SUCCESS,{src:e.target.currentSrc,host:util.getHostFromUrl(e.target.currentSrc)})};for(var n=null,o=0;o<this._evHandlers.length;o++)if("error"===Object.keys(this._evHandlers[o])[0]){n=this._evHandlers[o];break}!this._sourceError&&(this._sourceError=function(e){if(r._videoSourceCount--,0===r._videoSourceCount){var t={code:4,message:"sources_load_error"};n?n.error(e,t):r.errorHandler("error",t)}var i=ERROR_TYPE_MAP[4];r.emit(SOURCE_ERROR,new Errors(r,{errorType:i,errorCode:4,errorMessage:"sources_load_error",mediaError:{code:4,message:"sources_load_error"},src:e.target.src}))});for(var a=0;a<i.length;a++)i[a].addEventListener("error",this._sourceError);e.addEventListener("loadeddata",this._vLoadeddata)}}},{key:"_detachSourceEvents",value:function(e){var t=e.children;if(t&&0!==t.length&&this._sourceError){for(var r=0;r<t.length;r++)t[r].removeEventListener("error",this._sourceError);for(;t.length>0;)e.removeChild(t[0]);this._vLoadeddata&&e.removeEventListener("loadeddata",this._vLoadeddata)}}},{key:"errorHandler",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.media&&(this.media.error||t)){var r=this.media.error||t,i=r.code?ERROR_TYPE_MAP[r.code]:"other";r.message;this.media.currentSrc||(r={code:6,message:"empty_src"}),this.emit(e,new Errors(this,{errorType:i,errorCode:r.code,errorMessage:r.message||"",mediaError:r}))}}},{key:"destroy",value:function(){for(var e in this.media&&(this.media.pause&&(this.media.pause(),this.media.muted=!0),this.media.removeAttribute("src"),this.media.load()),this._currentTime=0,this._duration=0,this.mediaConfig=null,this._interval)Object.prototype.hasOwnProperty.call(this._interval,e)&&(clearInterval(this._interval[e]),this._interval[e]=null);this.detachVideoEvents(),this.media=null,this.mediaEventMiddleware={},this.removeAllListeners()}},{key:"video",get:function(){return this.media},set:function(e){this.media=e}},{key:"play",value:function(){return this.media?this.media.play():null}},{key:"pause",value:function(){this.media&&this.media.pause()}},{key:"load",value:function(){this.media&&this.media.load()}},{key:"canPlayType",value:function(e){return!!this.media&&this.media.canPlayType(e)}},{key:"getBufferedRange",value:function(e){var t=[0,0];if(!this.media)return t;e||(e=this.media.buffered);var r=this.media.currentTime;if(e)for(var i=0,n=e.length;i<n&&(t[0]=e.start(i),t[1]=e.end(i),!(t[0]<=r&&r<=t[1]));i++);return t[0]-r<=0&&r-t[1]<=0?t:[0,0]}},{key:"autoplay",get:function(){return!!this.media&&this.media.autoplay},set:function(e){this.media&&(this.media.autoplay=e)}},{key:"buffered",get:function(){return this.media?this.media.buffered:null}},{key:"buffered2",get:function(){return this.media&&this.media.buffered?util.getBuffered2(this.media.buffered):null}},{key:"bufferedPoint",get:function(){var e={start:0,end:0};if(!this.media)return e;var t=this.media.buffered;if(!t||0===t.length)return e;for(var r=0;r<t.length;r++)if((t.start(r)<=this.currentTime||t.start(r)<.1)&&t.end(r)>=this.currentTime)return{start:t.start(r),end:t.end(r)};return e}},{key:"crossOrigin",get:function(){return this.media?this.media.crossOrigin:""},set:function(e){this.media&&(this.media.crossOrigin=e)}},{key:"currentSrc",get:function(){return this.media?this.media.currentSrc:""},set:function(e){this.media&&(this.media.currentSrc=e)}},{key:"currentTime",get:function(){return this.media?void 0!==this.media.currentTime?this.media.currentTime:this._currentTime:0},set:function(e){this.media&&(this.media.currentTime=e)}},{key:"defaultMuted",get:function(){return!!this.media&&this.media.defaultMuted},set:function(e){this.media&&(this.media.defaultMuted=e)}},{key:"duration",get:function(){return this._duration}},{key:"ended",get:function(){return!!this.media&&this.media.ended}},{key:"error",get:function(){return this.media.error}},{key:"errorNote",get:function(){if(!this.media.error)return"";return["MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED"][this.media.error.code-1]}},{key:"loop",get:function(){return!!this.media&&this.media.loop},set:function(e){this.media&&(this.media.loop=e)}},{key:"muted",get:function(){return!!this.media&&this.media.muted},set:function(e){this.media&&this.media.muted!==e&&(this._lastMuted=this.media.muted,this.media.muted=e)}},{key:"networkState",get:function(){return this.media.networkState}},{key:"paused",get:function(){return!this.media||this.media.paused}},{key:"playbackRate",get:function(){return this.media?this.media.playbackRate:0},set:function(e){this.media&&e!==1/0&&(this.media.defaultPlaybackRate=e,this.media.playbackRate=e)}},{key:"played",get:function(){return this.media?this.media.played:null}},{key:"preload",get:function(){return!!this.media&&this.media.preload},set:function(e){this.media&&(this.media.preload=e)}},{key:"readyState",get:function(){return this.media.readyState}},{key:"seekable",get:function(){return!!this.media&&this.media.seekable}},{key:"seeking",get:function(){return!!this.media&&this.media.seeking}},{key:"src",get:function(){return this.media?this.media.src:""},set:function(e){this.media&&(this.emit(URL_CHANGE,e),this.emit(WAITING),this._currentTime=0,this._duration=0,/^blob/.test(this.media.currentSrc)||/^blob/.test(this.media.src)?this.onWaiting():(this._detachSourceEvents(this.media),"Array"===util.typeOf(e)?this._attachSourceEvents(this.media,e):e?this.media.src=e:this.media.removeAttribute("src"),this.load()))}},{key:"volume",get:function(){return this.media?this.media.volume:0},set:function(e){e!==1/0&&this.media&&(this.media.volume=e)}},{key:"addInnerOP",value:function(e){this._internalOp[e]=!0}},{key:"removeInnerOP",value:function(e){delete this._internalOp[e]}},{key:"emit",value:function(e,t){for(var i,n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];(i=_get$2(_getPrototypeOf$4(r.prototype),"emit",this)).call.apply(i,[this,e,t].concat(o))}},{key:"on",value:function(e,t){for(var i,n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];(i=_get$2(_getPrototypeOf$4(r.prototype),"on",this)).call.apply(i,[this,e,t].concat(o))}},{key:"once",value:function(e,t){for(var i,n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];(i=_get$2(_getPrototypeOf$4(r.prototype),"once",this)).call.apply(i,[this,e,t].concat(o))}},{key:"off",value:function(e,t){for(var i,n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];(i=_get$2(_getPrototypeOf$4(r.prototype),"off",this)).call.apply(i,[this,e,t].concat(o))}},{key:"offAll",value:function(){_get$2(_getPrototypeOf$4(r.prototype),"removeAllListeners",this).call(this)}}]),r}(EventEmitter),INDEXDB=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{name:"xgplayer",version:1,db:null,ojstore:{name:"xg-m4a",keypath:"vid"}};_classCallCheck$4(this,e),this.indexedDB=window.indexedDB||window.webkitindexedDB,this.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange,this.myDB=t}return _createClass$5(e,[{key:"openDB",value:function(e){var t=this,r=this,i=this.myDB.version||1,n=r.indexedDB.open(r.myDB.name,i);n.onerror=function(e){},n.onsuccess=function(i){t.myDB.db=i.target.result,e.call(r)},n.onupgradeneeded=function(e){var t=e.target.result;e.target.transaction,t.objectStoreNames.contains(r.myDB.ojstore.name)||t.createObjectStore(r.myDB.ojstore.name,{keyPath:r.myDB.ojstore.keypath})}}},{key:"deletedb",value:function(){this.indexedDB.deleteDatabase(this.myDB.name)}},{key:"closeDB",value:function(){this.myDB.db.close()}},{key:"addData",value:function(e,t){for(var r,i=this.myDB.db.transaction(e,"readwrite").objectStore(e),n=0;n<t.length;n++)(r=i.add(t[n])).onerror=function(){},r.onsuccess=function(){}}},{key:"putData",value:function(e,t){for(var r,i=this.myDB.db.transaction(e,"readwrite").objectStore(e),n=0;n<t.length;n++)(r=i.put(t[n])).onerror=function(){},r.onsuccess=function(){}}},{key:"getDataByKey",value:function(e,t,r){var i=this,n=this.myDB.db.transaction(e,"readwrite").objectStore(e).get(t);n.onerror=function(){r.call(i,null)},n.onsuccess=function(e){var t=e.target.result;r.call(i,t)}}},{key:"deleteData",value:function(e,t){this.myDB.db.transaction(e,"readwrite").objectStore(e).delete(t)}},{key:"clearData",value:function(e){this.myDB.db.transaction(e,"readwrite").objectStore(e).clear()}}]),e}(),FULLSCREEN_EVENTS=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],GET_FULLSCREEN_API=["requestFullscreen","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen"],EXIT_FULLSCREEN_API=["exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen"],PLATER_ID="data-xgplayerid";function callHandler(e,t,r){for(var i=arguments.length,n=new Array(i>3?i-3:0),o=3;o<i;o++)n[o-3]=arguments[o];var a=t.call.apply(t,[e].concat(n));r&&"function"==typeof r&&(a&&a.then?a.then((function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];r.call.apply(r,[e].concat(i))})):r.call.apply(r,[e].concat(n)))}function hook(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{pre:null,next:null};return this.__hooks||(this.__hooks={}),!this.__hooks[e]&&(this.__hooks[e]=null),function(){var i=arguments,n=this;if(r.pre)try{var o;(o=r.pre).call.apply(o,[this].concat(Array.prototype.slice.call(arguments)))}catch(e2){throw e2.message="[pluginName: ".concat(this.pluginName,":").concat(e,":pre error] >> ").concat(e2.message),e2}if(this.__hooks&&this.__hooks[e])try{var a,s=(a=this.__hooks[e]).call.apply(a,[this,this].concat(Array.prototype.slice.call(arguments)));s?s.then?s.then((function(e){!1!==e&&callHandler.apply(void 0,[n,t,r.next].concat(_toConsumableArray(i)))})).catch((function(e){throw e})):callHandler.apply(void 0,[this,t,r.next].concat(Array.prototype.slice.call(arguments))):void 0===s&&callHandler.apply(void 0,[this,t,r.next].concat(Array.prototype.slice.call(arguments)))}catch(e2){throw e2.message="[pluginName: ".concat(this.pluginName,":").concat(e,"] >> ").concat(e2.message),e2}else callHandler.apply(void 0,[this,t,r.next].concat(Array.prototype.slice.call(arguments)))}.bind(this)}function useHooks(e,t){var r=this.__hooks;if(r)return r.hasOwnProperty(e)?(r&&(r[e]=t),!0):(console.warn("has no supported hook which name [".concat(e,"]")),!1)}function removeHooks(e,t){var r=this.__hooks;r&&delete r[e]}function usePluginHooks(e){if(this.plugins&&this.plugins[e.toLowerCase()]){for(var t=this.plugins[e.toLowerCase()],r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];return t.useHooks&&t.useHooks.apply(t,i)}}function removePluginHooks(e){if(this.plugins&&this.plugins[e.toLowerCase()]){var t=this.plugins[e.toLowerCase()];if(t){for(var r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];return t.removeHooks&&t.removeHooks.apply(t,i)}}}function hooksDescriptor(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];e.__hooks={},t&&t.map((function(t){e.__hooks[t]=null})),Object.defineProperty(e,"hooks",{get:function(){return e.__hooks&&Object.keys(e.__hooks).map((function(t){if(e.__hooks[t])return t}))}})}function delHooksDescriptor(e){e.__hooks=null}function runHooks(e,t,r){for(var i=arguments.length,n=new Array(i>3?i-3:0),o=3;o<i;o++)n[o-3]=arguments[o];if(!e.__hooks||!e.__hooks[t])return r.call.apply(r,[e,e].concat(n));var a,s=(a=e.__hooks[t]).call.apply(a,[e,e].concat(n));if(s&&s.then)s.then((function(t){return!1===t?null:r.call.apply(r,[e,e].concat(n))})).catch((function(e){console.warn("[runHooks]".concat(t," reject"),e.message)}));else if(!1!==s)return r.call.apply(r,[e,e].concat(n))}function showErrorMsg(e,t){XG_DEBUG.logError("[".concat(e,"] event or callback cant be undefined or null when call ").concat(t))}var BasePlugin=function(){function e(t){_classCallCheck$4(this,e),util.checkIsFunction(this.beforeCreate)&&this.beforeCreate(t),hooksDescriptor(this),this.__args=t,this.__events={},this.__onceEvents={},this.config=t.config||{},this.player=null,this.playerConfig={},this.pluginName="",this.__init(t)}return _createClass$5(e,[{key:"beforeCreate",value:function(e){}},{key:"afterCreate",value:function(){}},{key:"beforePlayerInit",value:function(){}},{key:"onPluginsReady",value:function(){}},{key:"afterPlayerInit",value:function(){}},{key:"destroy",value:function(){}},{key:"__init",value:function(e){this.player=e.player,this.playerConfig=e.player&&e.player.config,this.pluginName=e.pluginName?e.pluginName.toLowerCase():this.constructor.pluginName.toLowerCase(),this.logger=e.player&&e.player.logger}},{key:"updateLang",value:function(e){e||(e=this.lang)}},{key:"lang",get:function(){return this.player.lang}},{key:"i18n",get:function(){return this.player.i18n}},{key:"i18nKeys",get:function(){return this.player.i18nKeys}},{key:"domEventType",get:function(){var e=util.checkTouchSupport()?"touch":"mouse";return!this.playerConfig||"touch"!==this.playerConfig.domEventType&&"mouse"!==this.playerConfig.domEventType||(e=this.playerConfig.domEventType),e}},{key:"on",value:function(e,t){var r=this;e&&t&&this.player?"string"==typeof e?(this.__events[e]=t,this.player.on(e,t)):Array.isArray(e)&&e.forEach((function(e){r.__events[e]=t,r.player.on(e,t)})):showErrorMsg(this.pluginName,"plugin.on(event, callback)")}},{key:"once",value:function(e,t){var r=this;e&&t&&this.player?"string"==typeof e?(this.__onceEvents[e]=t,this.player.once(e,t)):Array.isArray(e)&&e.forEach((function(i){r.__onceEvents[i]=t,r.player.once(e,t)})):showErrorMsg(this.pluginName,"plugin.once(event, callback)")}},{key:"off",value:function(e,t){var r=this;e&&t&&this.player?"string"==typeof e?(delete this.__events[e],this.player.off(e,t)):Array.isArray(e)&&e.forEach((function(i){delete r.__events[e],r.player.off(i,t)})):showErrorMsg(this.pluginName,"plugin.off(event, callback)")}},{key:"offAll",value:function(){var e=this;["__events","__onceEvents"].forEach((function(t){Object.keys(e[t]).forEach((function(r){e[t][r]&&e.off(r,e[t][r]),r&&delete e[t][r]}))})),this.__events={},this.__onceEvents={}}},{key:"emit",value:function(e){var t;if(this.player){for(var r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];(t=this.player).emit.apply(t,[e].concat(i))}}},{key:"emitUserAction",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.player){var i=_objectSpread2$4(_objectSpread2$4({},r),{},{pluginName:this.pluginName});this.player.emitUserAction(e,t,i)}}},{key:"hook",value:function(e,t){return hook.call.apply(hook,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(e,t){for(var r=arguments.length,i=new Array(r>2?r-2:0),n=2;n<r;n++)i[n-2]=arguments[n];return useHooks.call.apply(useHooks,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(e,t){for(var r=arguments.length,i=new Array(r>2?r-2:0),n=2;n<r;n++)i[n-2]=arguments[n];return removeHooks.call.apply(removeHooks,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(this.player)return r&&(t.pluginName=r),this.player.registerPlugin({plugin:e,options:t})}},{key:"getPlugin",value:function(e){return this.player?this.player.getPlugin(e):null}},{key:"__destroy",value:function(){var e=this,t=this.player,r=this.pluginName;this.offAll(),util.clearAllTimers(this),util.checkIsFunction(this.destroy)&&this.destroy(),["player","playerConfig","pluginName","logger","__args","__hooks"].map((function(t){e[t]=null})),t.unRegisterPlugin(r),delHooksDescriptor(this)}}],[{key:"defineGetterOrSetter",value:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&Object.defineProperty(e,r,t[r])}},{key:"defaultConfig",get:function(){return{}}},{key:"pluginName",get:function(){return"pluginName"}}]),e}(),DOCUMENT_NODE_TYPE=9;if("undefined"!=typeof Element&&!Element.prototype.matches){var proto=Element.prototype;proto.matches=proto.matchesSelector||proto.mozMatchesSelector||proto.msMatchesSelector||proto.oMatchesSelector||proto.webkitMatchesSelector}function closest$2(e,t){for(;e&&e.nodeType!==DOCUMENT_NODE_TYPE;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}}var closest_1=closest$2,closest$1=closest_1;function _delegate(e,t,r,i,n){var o=listener$1.apply(this,arguments);return e.addEventListener(r,o,n),{destroy:function(){e.removeEventListener(r,o,n)}}}function delegate(e,t,r,i,n){return"function"==typeof e.addEventListener?_delegate.apply(null,arguments):"function"==typeof r?_delegate.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return _delegate(e,t,r,i,n)})))}function listener$1(e,t,r,i){return function(r){r.delegateTarget=closest$1(r.target,t),r.delegateTarget&&i.call(e,r)}}var delegate_1=delegate,ROOT_TYPES={CONTROLS:"controls",ROOT:"root"},POSITIONS$a={ROOT:"root",ROOT_LEFT:"rootLeft",ROOT_RIGHT:"rootRight",ROOT_TOP:"rootTop",CONTROLS_LEFT:"controlsLeft",CONTROLS_RIGTH:"controlsRight",CONTROLS_RIGHT:"controlsRight",CONTROLS_CENTER:"controlsCenter",CONTROLS:"controls"};function isUrl$1(e){return!!e&&(e.indexOf&&/^(?:http|data:|\/)/.test(e))}function mergeIconClass(e,t){return"object"===_typeof$3(e)&&e.class&&"string"==typeof e.class?"".concat(t," ").concat(e.class):t}function mergeIconAttr(e,t){return"object"===_typeof$3(e)&&e.attr&&"object"===_typeof$3(e.attr)&&Object.keys(e.attr).map((function(r){t[r]=e.attr[r]})),t}function createIcon(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",o=null;if(e instanceof window.Element)return util.addClass(e,r),Object.keys(i).map((function(t){e.setAttribute(t,i[t])})),e;if(isUrl$1(e)||isUrl$1(e.url))return i.src=isUrl$1(e)?e:e.url||"",o=util.createDom(e.tag||"img","",i,"xg-img ".concat(r));if("function"==typeof e)try{return(o=e())instanceof window.Element?(util.addClass(o,r),Object.keys(i).map((function(e){o.setAttribute(e,i[e])})),o):(XG_DEBUG.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(n,"] is a function mast return an Element Object")),null)}catch(e2){return XG_DEBUG.logError("Plugin named [".concat(n,"]:createIcon"),e2),null}return"string"==typeof e?util.createDomFromHtml(e,i,r):(XG_DEBUG.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(n,"] is invalid")),null)}function registerIconsObj(e,t){var r=t.config.icons||t.playerConfig.icons;Object.keys(e).map((function(i){var n=e[i],o=n&&n.class?n.class:"",a=n&&n.attr?n.attr:{},s=null;r&&r[i]&&(o=mergeIconClass(r[i],o),a=mergeIconAttr(r[i],a),s=createIcon(r[i],i,o,a,t.pluginName)),!s&&n&&(s=createIcon(n.icon?n.icon:n,a,o,{},t.pluginName)),t.icons[i]=s}))}function registerTextObj(e,t){Object.keys(e).map((function(r){Object.defineProperty(t.langText,r,{get:function(){var i=t.lang,n=t.i18n;return n[r]?n[r]:e[r]&&e[r][i]||""}})}))}var Plugin=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck$4(this,r),(e=t.call(this,i)).__delegates=[],e}return _createClass$5(r,[{key:"__init",value:function(e){if(_get$2(_getPrototypeOf$4(r.prototype),"__init",this).call(this,e),e.root){var t=e.root,i=null;this.icons={},this.root=null,this.parent=null,registerIconsObj(this.registerIcons()||{},this),this.langText={},registerTextObj(this.registerLanguageTexts()||{},this);var n="";try{n=this.render()}catch(e2){throw XG_DEBUG.logError("Plugin:".concat(this.pluginName,":render"),e2),new Error("Plugin:".concat(this.pluginName,":render:").concat(e2.message))}if(n)(i=r.insert(n,t,e.index)).setAttribute("data-index",e.index);else{if(!e.tag)return;(i=util.createDom(e.tag,"",e.attr,e.name)).setAttribute("data-index",e.index),t.appendChild(i)}this.root=i,this.parent=t;var o=this.config.attr||{},a=this.config.style||{};this.setAttr(o),this.setStyle(a),this.config.index&&this.root.setAttribute("data-index",this.config.index),this.__registerChildren()}}},{key:"__registerChildren",value:function(){var e=this;if(this.root){this._children=[];var t=this.children();t&&"object"===_typeof$3(t)&&Object.keys(t).length>0&&Object.keys(t).map((function(r){var i,n,o=r,a=t[o],s={root:e.root};"function"==typeof a?(i=e.config[o]||{},n=a):"object"===_typeof$3(a)&&"function"==typeof a.plugin&&(i=a.options?util.deepCopy(e.config[o]||{},a.options):e.config[o]||{},n=a.plugin),s.config=i,void 0!==i.index&&(s.index=i.index),i.root&&(s.root=i.root),e.registerPlugin(n,s,o)}))}}},{key:"updateLang",value:function(e){e||(e=this.lang);var t=this.root,r=this.i18n,i=this.langText;t&&function e(t,r){for(var i=0;i<t.children.length;i++)t.children[i].children.length>0?e(t.children[i],r):r(t.children[i])}(t,(function(t){var n=t.getAttribute&&t.getAttribute("lang-key");if(n){var o=r[n.toUpperCase()]||i[n];o&&(t.innerHTML="function"==typeof o?o(e):o)}}))}},{key:"lang",get:function(){return this.player.lang}},{key:"changeLangTextKey",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=this.i18n||{},i=this.langText;e.setAttribute&&e.setAttribute("lang-key",t);var n=r[t]||i[t]||"";n&&(e.innerHTML=n)}},{key:"plugins",value:function(){return this._children}},{key:"children",value:function(){return{}}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";t.root=t.root||this.root;var n=_get$2(_getPrototypeOf$4(r.prototype),"registerPlugin",this).call(this,e,t,i);return this._children.push(n),n}},{key:"registerIcons",value:function(){return{}}},{key:"registerLanguageTexts",value:function(){return{}}},{key:"find",value:function(e){if(this.root)return this.root.querySelector(e)}},{key:"bind",value:function(e,t,i){var n=this;if(arguments.length<3&&"function"==typeof t)Array.isArray(e)?e.forEach((function(e){n.bindEL(e,t)})):this.bindEL(e,t);else{var o=r.delegate.call(this,this.root,e,t,i);this.__delegates=this.__delegates.concat(o)}}},{key:"unbind",value:function(e,t){var r=this;if(arguments.length<3&&"function"==typeof t)Array.isArray(e)?e.forEach((function(e){r.unbindEL(e,t)})):this.unbindEL(e,t);else for(var i="".concat(e,"_").concat(t),n=0;n<this.__delegates.length;n++)if(this.__delegates[n].key===i){this.__delegates[n].destroy(),this.__delegates.splice(n,1);break}}},{key:"setStyle",value:function(e,t){var r=this;if(this.root)return"String"===util.typeOf(e)?this.root.style[e]=t:void("Object"===util.typeOf(e)&&Object.keys(e).map((function(t){r.root.style[t]=e[t]})))}},{key:"setAttr",value:function(e,t){var r=this;if(this.root)return"String"===util.typeOf(e)?this.root.setAttribute(e,t):void("Object"===util.typeOf(e)&&Object.keys(e).map((function(t){r.root.setAttribute(t,e[t])})))}},{key:"setHtml",value:function(e,t){this.root&&(this.root.innerHTML=e,"function"==typeof t&&t())}},{key:"bindEL",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.root&&"on".concat(e)in this.root&&"function"==typeof t&&this.root.addEventListener(e,t,r)}},{key:"unbindEL",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.root&&"on".concat(e)in this.root&&"function"==typeof t&&this.root.removeEventListener(e,t,r)}},{key:"show",value:function(e){if(this.root)return this.root.style.display=void 0!==e?e:"block","none"===window.getComputedStyle(this.root,null).getPropertyValue("display")?this.root.style.display="block":void 0}},{key:"hide",value:function(){this.root&&(this.root.style.display="none")}},{key:"appendChild",value:function(e,t){if(!this.root)return null;if(arguments.length<2&&arguments[0]instanceof window.Element)return this.root.appendChild(arguments[0]);if(!(t&&t instanceof window.Element))return null;try{return"string"==typeof e?this.find(e).appendChild(t):e.appendChild(t)}catch(r){return XG_DEBUG.logError("Plugin:appendChild",r),null}}},{key:"render",value:function(){return""}},{key:"destroy",value:function(){}},{key:"__destroy",value:function(){var e=this,t=this.player;this.__delegates.map((function(e){e.destroy()})),this.__delegates=[],this._children instanceof Array&&(this._children.map((function(e){t.unRegisterPlugin(e.pluginName)})),this._children=null),this.root&&(this.root.hasOwnProperty("remove")?this.root.remove():this.root.parentNode&&this.root.parentNode.removeChild(this.root)),_get$2(_getPrototypeOf$4(r.prototype),"__destroy",this).call(this),this.icons={},["root","parent"].map((function(t){e[t]=null}))}}],[{key:"insert",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=t.children.length,n=Number(r),o=e instanceof window.Node;if(i){for(var a=0,s=null,l="";a<i;a++){s=t.children[a];var c=Number(s.getAttribute("data-index"));if(c>=n){l="beforebegin";break}c<n&&(l="afterend")}return o?"afterend"===l?t.appendChild(e):t.insertBefore(e,s):s.insertAdjacentHTML(l,e),"afterend"===l?t.children[t.children.length-1]:t.children[a]}return o?t.appendChild(e):t.insertAdjacentHTML("beforeend",e),t.children[t.children.length-1]}},{key:"defaultConfig",get:function(){return{}}},{key:"delegate",value:function(e,t,r,i){var n=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=[];if(e instanceof window.Node&&"function"==typeof i)if(Array.isArray(r))r.forEach((function(r){var a=delegate_1(e,t,r,i,n);a.key="".concat(t,"_").concat(r),o.push(a)}));else{var a=delegate_1(e,t,r,i,n);a.key="".concat(t,"_").concat(r),o.push(a)}return o}},{key:"ROOT_TYPES",get:function(){return ROOT_TYPES}},{key:"POSITIONS",get:function(){return POSITIONS$a}}]),r}(BasePlugin),ResizeObserver$1=function(){function e(){var t=this;if(_classCallCheck$4(this,e),_defineProperty$5(this,"__trigger",(function(e){var r=(new Date).getTime();t.timeStamp=r;for(var i=0;i<e.length;i++)t.__runHandler(e[i].target)})),this.__handlers=[],this.timeStamp=0,this.observer=null,window.ResizeObserver)try{this.observer=new window.ResizeObserver(throttle$1(this.__trigger,100,{trailing:!0})),this.timeStamp=(new Date).getTime()}catch(e2){console.error(e2)}}return _createClass$5(e,[{key:"addObserver",value:function(e,t){if(this.observer){this.observer&&this.observer.observe(e);for(var r=e.getAttribute(PLATER_ID),i=this.__handlers,n=-1,o=0;o<i.length;o++)i[o]&&e===i[o].target&&(n=o);n>-1?this.__handlers[n].handler=t:this.__handlers.push({target:e,handler:t,playerId:r})}}},{key:"unObserver",value:function(e){var t=-1;this.__handlers.map((function(r,i){e===r.target&&(t=i)}));try{this.observer&&this.observer.unobserve(e)}catch(e2){}this.observer&&this.observer.unobserve(e),t>-1&&this.__handlers.splice(t,1)}},{key:"destroyObserver",value:function(){this.observer&&this.observer.disconnect(),this.observer=null,this.__handlers=null}},{key:"__runHandler",value:function(e){for(var t=this.__handlers,r=0;r<t.length;r++)if(t[r]&&e===t[r].target){try{t[r].handler(e)}catch(i){console.error(i)}return!0}return!1}}]),e}(),resizeObserver$1=null;function addObserver$1(e,t){return resizeObserver$1||(resizeObserver$1=new ResizeObserver$1),resizeObserver$1.addObserver(e,t),resizeObserver$1}function unObserver$1(e,t){resizeObserver$1.unObserver(e,t)}var pluginsManager={pluginGroup:{},init:function(e){var t=e._pluginInfoId;t||(t=(new Date).getTime(),e._pluginInfoId=t),!e.config.closeResizeObserver&&addObserver$1(e.root,(function(){e.resize()})),0===Object.keys(this.pluginGroup).length&&(e.isUserActive=!0),this.pluginGroup[t]={_player:e,_originalOptions:e.config||{},_plugins:{}}},checkPlayerRoot:function(e){if(this.pluginGroup){for(var t=Object.keys(this.pluginGroup),r=0;r<t.length;r++){var i=this.pluginGroup[t[r]]._player;if(i.root===e)return i}return null}return null},formatPluginInfo:function(e,t){var r=null,i=null;return e.plugin&&"function"==typeof e.plugin?(r=e.plugin,i=e.options):(r=e,i={}),t&&(i.config=t||{}),{PLUFGIN:r,options:i}},checkPluginIfExits:function(e,t){for(var r=0;r<t.length;r++)if(e.toLowerCase()===t[r].pluginName.toLowerCase())return!0;return!1},getRootByConfig:function(e,t){for(var r=Object.keys(t),i=null,n=0;n<r.length;n++)if(e.toLowerCase()===r[n].toLowerCase()){i=t[r[n]];break}return"Object"===util.typeOf(i)?{root:i.root,position:i.position}:{}},lazyRegister:function(e,t){var r=this,i=t.timeout||1500;return Promise.race([t.loader().then((function(t){var i;i=t&&t.__esModule?t.default:t,r.register(e,i,t.options)})),new Promise((function(e,t){setTimeout((function(){t(new Error("timeout"))}),i)}))])},register:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e&&t&&"function"==typeof t&&void 0!==t.prototype){var i=e._pluginInfoId;if(i&&this.pluginGroup[i]){this.pluginGroup[i]._plugins||(this.pluginGroup[i]._plugins={});var n=this.pluginGroup[i]._plugins,o=this.pluginGroup[i]._originalOptions;r.player=this.pluginGroup[i]._player;var a=r.pluginName||t.pluginName;if(!a)throw new Error("The property pluginName is necessary");if(!t.isSupported||t.isSupported(e.config.mediaType,e.config.codecType)){r.config||(r.config={});for(var s=Object.keys(o),l=0;l<s.length;l++)if(a.toLowerCase()===s[l].toLowerCase()){var c=o[s[l]];"Object"===util.typeOf(c)?r.config=Object.assign({},r.config,o[s[l]]):"Boolean"===util.typeOf(c)&&(r.config.disable=!c);break}t.defaultConfig&&Object.keys(t.defaultConfig).forEach((function(e){void 0===r.config[e]&&(r.config[e]=t.defaultConfig[e])})),r.root?"string"==typeof r.root&&(r.root=e[r.root]):r.root=e.root,r.index=r.config.index||0;try{n[a.toLowerCase()]&&(this.unRegister(i,a.toLowerCase()),console.warn("the is one plugin with same pluginName [".concat(a,"] exist, destroy the old instance")));var u=new t(r);return n[a.toLowerCase()]=u,n[a.toLowerCase()].func=t,u&&"function"==typeof u.afterCreate&&u.afterCreate(),u}catch(h){throw console.error(h),h}}else console.warn("not supported plugin [".concat(a,"]"))}}},unRegister:function(e,t){e._pluginInfoId&&(e=e._pluginInfoId),t=t.toLowerCase();try{var r=this.pluginGroup[e]._plugins[t];r&&(r.pluginName&&r.__destroy(),delete this.pluginGroup[e]._plugins[t])}catch(e2){console.error("[unRegister:".concat(t,"] cgid:[").concat(e,"] error"),e2)}},deletePlugin:function(e,t){var r=e._pluginInfoId;r&&this.pluginGroup[r]&&this.pluginGroup[r]._plugins&&delete this.pluginGroup[r]._plugins[t]},getPlugins:function(e){var t=e._pluginInfoId;return t&&this.pluginGroup[t]?this.pluginGroup[t]._plugins:{}},findPlugin:function(e,t){var r=e._pluginInfoId;if(!r||!this.pluginGroup[r])return null;var i=t.toLowerCase();return this.pluginGroup[r]._plugins[i]},beforeInit:function(e){var t=this;function r(e){return e&&e.then?e:new Promise((function(e){e()}))}return new Promise((function(i){if(t.pluginGroup)return(e._loadingPlugins&&e._loadingPlugins.length?Promise.all(e._loadingPlugins):Promise.resolve()).then((function(){var n=e._pluginInfoId;if(t.pluginGroup[n]){var o=t.pluginGroup[n]._plugins,a=[];Object.keys(o).forEach((function(e){if(o[e]&&o[e].beforePlayerInit)try{var t=o[e].beforePlayerInit();a.push(r(t))}catch(e2){throw a.push(r(null)),e2}})),Promise.all([].concat(a)).then((function(){i()})).catch((function(e){console.error(e),i()}))}else i()}))}))},afterInit:function(e){var t=e._pluginInfoId;if(t&&this.pluginGroup[t]){var r=this.pluginGroup[t]._plugins;Object.keys(r).forEach((function(e){r[e]&&r[e].afterPlayerInit&&r[e].afterPlayerInit()}))}},setLang:function(e,t){var r=t._pluginInfoId;if(r&&this.pluginGroup[r]){var i=this.pluginGroup[r]._plugins;Object.keys(i).forEach((function(t){if(i[t].updateLang)i[t].updateLang(e);else try{i[t].lang=e}catch(r){console.warn("".concat(t," setLang"))}}))}},reRender:function(e){var t=this,r=e._pluginInfoId;if(r&&this.pluginGroup[r]){var i=[],n=this.pluginGroup[r]._plugins;Object.keys(n).forEach((function(e){"controls"!==e&&n[e]&&(i.push({plugin:n[e].func,options:n[e].__args}),t.unRegister(r,e))})),i.forEach((function(r){t.register(e,r.plugin,r.options)}))}},onPluginsReady:function(e){var t=e._pluginInfoId;if(t&&this.pluginGroup[t]){var r=this.pluginGroup[t]._plugins||{};Object.keys(r).forEach((function(e){r[e].onPluginsReady&&"function"==typeof r[e].onPluginsReady&&r[e].onPluginsReady()}))}},setCurrentUserActive:function(e,t){if(this.pluginGroup[e]){if(!t)return this.pluginGroup[e]._player.isUserActive=t,e;for(var r=Object.keys(this.pluginGroup),i=0;i<r.length;i++){var n=this.pluginGroup[r[i]];n&&n._player&&(this.pluginGroup[r[i]]._player.isUserActive=!1)}return this.pluginGroup[e]._player.isUserActive=t,e}},getCurrentUseActiveId:function(){if(this.pluginGroup){for(var e=Object.keys(this.pluginGroup),t=0;t<e.length;t++){var r=this.pluginGroup[e[t]];if(r&&r._player&&r._player.isUserActive)return e[t]}return null}},destroy:function(e){var t=e._pluginInfoId;if(this.pluginGroup[t]){unObserver$1(e.root);for(var r=this.pluginGroup[t]._plugins,i=0,n=Object.keys(r);i<n.length;i++){var o=n[i];this.unRegister(t,o)}var a=e.isUseActive;if(delete this.pluginGroup[t],delete e._pluginInfoId,a){var s=Object.keys(this.pluginGroup);s.length>0&&this.setCurrentUserActive(s[s.length-1],!0)}}}},STATE_CLASS={DEFAULT:"xgplayer",DEFAULT_SKIN:"xgplayer-skin-default",ENTER:"xgplayer-is-enter",PAUSED:"xgplayer-pause",PLAYING:"xgplayer-playing",ENDED:"xgplayer-ended",CANPLAY:"xgplayer-canplay",LOADING:"xgplayer-isloading",ERROR:"xgplayer-is-error",REPLAY:"xgplayer-replay",NO_START:"xgplayer-nostart",ACTIVE:"xgplayer-active",INACTIVE:"xgplayer-inactive",FULLSCREEN:"xgplayer-is-fullscreen",CSS_FULLSCREEN:"xgplayer-is-cssfullscreen",ROTATE_FULLSCREEN:"xgplayer-rotate-fullscreen",PARENT_ROTATE_FULLSCREEN:"xgplayer-rotate-parent",PARENT_FULLSCREEN:"xgplayer-fullscreen-parent",INNER_FULLSCREEN:"xgplayer-fullscreen-inner",NO_CONTROLS:"no-controls",FLEX_CONTROLS:"flex-controls",CONTROLS_FOLLOW:"controls-follow",CONTROLS_AUTOHIDE:"controls-autohide",TOP_BAR_AUTOHIDE:"top-bar-autohide",NOT_ALLOW_AUTOPLAY:"not-allow-autoplay",SEEKING:"seeking",PC:"xgplayer-pc",MOBILE:"xgplayer-mobile",MINI:"xgplayer-mini"};function getDefaultConfig$1(){return{id:"",el:null,url:"",domEventType:"default",nullUrlStart:!1,width:600,height:337.5,fluid:!1,fitVideoSize:"fixed",videoFillMode:"auto",volume:.6,autoplay:!1,autoplayMuted:!1,loop:!1,isLive:!1,zoom:1,videoInit:!0,poster:"",isMobileSimulateMode:!1,defaultPlaybackRate:1,execBeforePluginsCall:null,allowSeekAfterEnded:!0,enableContextmenu:!0,closeVideoClick:!1,closeVideoDblclick:!1,closePlayerBlur:!1,closeDelayBlur:!1,leavePlayerTime:3e3,closePlayVideoFocus:!1,closePauseVideoFocus:!1,closeFocusVideoFocus:!0,closeControlsBlur:!0,topBarAutoHide:!0,videoAttributes:{},startTime:0,seekedStatus:"play",miniprogress:!1,disableSwipeHandler:function(){},enableSwipeHandler:function(){},ignores:[],whitelist:[],inactive:3e3,lang:getLang$1(),controls:!0,marginControls:!1,fullscreenTarget:null,screenShot:!1,rotate:!1,pip:!1,download:!1,mini:!1,cssFullscreen:!0,keyShortcut:!0,presets:[],plugins:[],playbackRate:1,definition:{list:[]},playsinline:!0,customDuration:0,timeOffset:0,icons:{},i18n:[],tabindex:0,thumbnail:null,videoConfig:{},isHideTips:!1,minWaitDelay:200,commonStyle:{progressColor:"",playedColor:"",cachedColor:"",sliderBtnStyle:{},volumeColor:""}}}var usePreset=function(e,t){var r,i,n=t.preset&&t.options?new t.preset(t.options,e.config):new t({},e.config),o=n.plugins,a=void 0===o?[]:o,s=n.ignores,l=void 0===s?[]:s,c=n.icons,u=void 0===c?{}:c,h=n.i18n,d=void 0===h?[]:h;e.config.plugins||(e.config.plugins=[]),e.config.ignores||(e.config.ignores=[]),(r=e.config.plugins).push.apply(r,_toConsumableArray(a)),(i=e.config.ignores).push.apply(i,_toConsumableArray(l)),Object.keys(u).map((function(t){e.config.icons[t]||(e.config.icons[t]=u[t])}));var p=e.config.i18n||[];d.push.apply(d,_toConsumableArray(p)),e.config.i18n=d},Controls=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(){var e;_classCallCheck$4(this,r);for(var i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];return _defineProperty$5(_assertThisInitialized$4(e=t.call.apply(t,[this].concat(n))),"onMouseEnter",(function(t){var r=_assertThisInitialized$4(e),i=r.player;r.playerConfig.closeControlsBlur&&i.focus({autoHide:!1})})),_defineProperty$5(_assertThisInitialized$4(e),"onMouseLeave",(function(){_assertThisInitialized$4(e).player.focus()})),e}return _createClass$5(r,[{key:"beforeCreate",value:function(e){e.config.mode||"mobile"!==sniffer$1.device||(e.config.mode="flex"),e.player.config.marginControls&&(e.config.autoHide=!1)}},{key:"afterCreate",value:function(){var e=this,t=this.config,r=t.disable,i=t.height,n=t.mode;if(!r){"flex"===n&&this.player.addClass(STATE_CLASS.FLEX_CONTROLS);var o={height:"".concat(i,"px")};Object.keys(o).map((function(t){e.root.style[t]=o[t]})),this.left=this.find("xg-left-grid"),this.center=this.find("xg-center-grid"),this.right=this.find("xg-right-grid"),this.innerRoot=this.find("xg-inner-controls"),this.on(MINI_STATE_CHANGE,(function(t){t?util.addClass(e.root,"mini-controls"):util.removeClass(e.root,"mini-controls")}));var a=this.playerConfig.isMobileSimulateMode;"mobile"!==sniffer$1.device&&"mobile"!==a&&(this.bind("mouseenter",this.onMouseEnter),this.bind("mouseleave",this.onMouseLeave))}}},{key:"focus",value:function(){this.player.focus({autoHide:!1})}},{key:"focusAwhile",value:function(){this.player.focus({autoHide:!0})}},{key:"blur",value:function(){this.player.blur({ignorePaused:!0})}},{key:"recoverAutoHide",value:function(){this.config.autoHide&&util.addClass(this.root,STATE_CLASS.CONTROLS_AUTOHIDE)}},{key:"pauseAutoHide",value:function(){util.removeClass(this.root,STATE_CLASS.CONTROLS_AUTOHIDE)}},{key:"show",value:function(){util.addClass(this.root,"show")}},{key:"hide",value:function(){util.removeClass(this.root,"show")}},{key:"mode",get:function(){return this.config.mode}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;if(this.root){var n=e.defaultConfig||{};if(!t.root){var o=t.position?t.position:t.config&&t.config.position?t.config.position:n.position;switch(o){case POSITIONS$a.CONTROLS_LEFT:t.root=this.left;break;case POSITIONS$a.CONTROLS_RIGHT:t.root=this.right;break;case POSITIONS$a.CONTROLS_CENTER:t.root=this.center;break;case POSITIONS$a.CONTROLS:t.root=this.root;break;default:t.root=this.left}return _get$2(_getPrototypeOf$4(r.prototype),"registerPlugin",this).call(this,e,t,i)}}}},{key:"destroy",value:function(){"mobile"!==sniffer$1.device&&(this.unbind("mouseenter",this.onMouseEnter),this.unbind("mouseleave",this.onMouseLeave))}},{key:"render",value:function(){var e=this.config,t=e.mode,r=e.autoHide,i=e.initShow;if(!e.disable){var n=util.classNames({"xgplayer-controls":!0},{"flex-controls":"flex"===t},{"bottom-controls":"bottom"===t},_defineProperty$5({},STATE_CLASS.CONTROLS_AUTOHIDE,r),{"xgplayer-controls-initshow":i||!r});return'<xg-controls class="'.concat(n,'" unselectable="on">\n <xg-inner-controls class="xg-inner-controls xg-pos">\n <xg-left-grid class="xg-left-grid">\n </xg-left-grid>\n <xg-center-grid class="xg-center-grid"></xg-center-grid>\n <xg-right-grid class="xg-right-grid">\n </xg-right-grid>\n </xg-inner-controls>\n </xg-controls>')}}}],[{key:"pluginName",get:function(){return"controls"}},{key:"defaultConfig",get:function(){return{disable:!1,autoHide:!0,mode:"",initShow:!1}}}]),r}(Plugin),EN={LANG:"en",TEXT:{ERROR_TYPES:{network:{code:1,msg:"video download error"},mse:{code:2,msg:"stream append error"},parse:{code:3,msg:"parsing error"},format:{code:4,msg:"wrong format"},decoder:{code:5,msg:"decoding error"},runtime:{code:6,msg:"grammatical errors"},timeout:{code:7,msg:"play timeout"},other:{code:8,msg:"other errors"}},HAVE_NOTHING:"There is no information on whether audio/video is ready",HAVE_METADATA:"Audio/video metadata is ready ",HAVE_CURRENT_DATA:"Data about the current play location is available, but there is not enough data to play the next frame/millisecond",HAVE_FUTURE_DATA:"Current and at least one frame of data is available",HAVE_ENOUGH_DATA:"The available data is sufficient to start playing",NETWORK_EMPTY:"Audio/video has not been initialized",NETWORK_IDLE:"Audio/video is active and has been selected for resources, but no network is used",NETWORK_LOADING:"The browser is downloading the data",NETWORK_NO_SOURCE:"No audio/video source was found",MEDIA_ERR_ABORTED:"The fetch process is aborted by the user",MEDIA_ERR_NETWORK:"An error occurred while downloading",MEDIA_ERR_DECODE:"An error occurred while decoding",MEDIA_ERR_SRC_NOT_SUPPORTED:"Audio/video is not supported",REPLAY:"Replay",ERROR:"Network is offline",PLAY_TIPS:"Play",PAUSE_TIPS:"Pause",PLAYNEXT_TIPS:"Play next",DOWNLOAD_TIPS:"Download",ROTATE_TIPS:"Rotate",RELOAD_TIPS:"Reload",FULLSCREEN_TIPS:"Fullscreen",EXITFULLSCREEN_TIPS:"Exit fullscreen",CSSFULLSCREEN_TIPS:"Cssfullscreen",EXITCSSFULLSCREEN_TIPS:"Exit cssfullscreen",TEXTTRACK:"Caption",PIP:"PIP",SCREENSHOT:"Screenshot",LIVE:"LIVE",OFF:"Off",OPEN:"Open",MINI_DRAG:"Click and hold to drag",MINISCREEN:"Miniscreen",REFRESH_TIPS:"Please Try",REFRESH:"Refresh",FORWARD:"forward",LIVE_TIP:"Live"}},XGI18nLang={lang:{},langKeys:[],textKeys:[]};function deepMerge(e,t){return Object.keys(t).forEach((function(r){var i,n=util.typeOf(t[r]),o=util.typeOf(e[r]);"Array"===n?("Array"!==o&&(e[r]=[]),(i=e[r]).push.apply(i,_toConsumableArray(t[r]))):"Object"===n?("Object"!==o&&(e[r]={}),deepMerge(e[r],t[r])):e[r]=t[r]})),e}function updateKeys(){Object.keys(XGI18nLang.lang.en).map((function(e){XGI18nLang.textKeys[e]=e}))}function extend(e,t){var r=[];if(t||(t=XGI18nLang),t.lang){r="Array"!==util.typeOf(e)?Object.keys(e).map((function(t){return{LANG:"zh"===t?"zh-cn":t,TEXT:e[t]}})):e;var i=t.lang;r.map((function(e){"zh"===e.LANG&&(e.LANG="zh-cn"),i[e.LANG]?deepMerge(i[e.LANG]||{},e.TEXT||{}):use(e,t)})),updateKeys()}}function use(e,t){var r=e.LANG;if(t||(t=XGI18nLang),t.lang){var i=e.TEXT||{};"zh"===r&&(r="zh-cn"),t.lang[r]?deepMerge(t.lang[r],i):(t.langKeys.push(r),t.lang[r]=i),updateKeys()}}function init(e){var t,r={lang:{},langKeys:[],textKeys:{},pId:e};return deepMerge(r.lang,XGI18nLang.lang),(t=r.langKeys).push.apply(t,_toConsumableArray(XGI18nLang.langKeys)),deepMerge(r.textKeys,XGI18nLang.textKeys),r}use(EN);var I18N={get textKeys(){return XGI18nLang.textKeys},get langKeys(){return XGI18nLang.langKeys},get lang(){var e={};return XGI18nLang.langKeys.map((function(t){e[t]=XGI18nLang.lang[t]})),XGI18nLang.lang["zh-cn"]&&(e.zh=XGI18nLang.lang["zh-cn"]||{}),e},extend:extend,use:use,init:init},STATES={INITIAL:1,READY:2,ATTACHING:3,ATTACHED:4,NOTALLOW:5,RUNNING:6,ENDED:7,DESTROYED:8},STATE_ARRAY=["ERROR","INITIAL","READY","ATTACHING","ATTACHED","NOTALLOW","RUNNING","ENDED","DESTROYED"],PlAYER_HOOKS=["play","pause","replay","retry"],REAL_TIME_SPEED=0,AVG_SPEED=0,Player=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(e){var i;_classCallCheck$4(this,r);var n=util.deepMerge(getDefaultConfig$1(),e);_defineProperty$5(_assertThisInitialized$4(i=t.call(this,n)),"canPlayFunc",(function(){if(i.config){var e=i.config,t=e.autoplay,r=e.startTime,n=e.defaultPlaybackRate;XG_DEBUG.logInfo("player","canPlayFunc, startTime",r),r&&(i.currentTime=r>i.duration?i.duration:r,i.config.startTime=0),i.playbackRate=n,(t||i._useAutoplay)&&i.mediaPlay(),i.off(CANPLAY,i.canPlayFunc),i.removeClass(STATE_CLASS.ENTER)}})),_defineProperty$5(_assertThisInitialized$4(i),"onFullscreenChange",(function(e,t){var r=function(){util.setTimeout(_assertThisInitialized$4(i),(function(){i.resize()}),100)},n=util.getFullScreenEl();i._fullActionFrom?i._fullActionFrom="":i.emit(USER_ACTION,{eventType:"system",action:"switch_fullscreen",pluginName:"player",currentTime:i.currentTime,duration:i.duration,props:[{prop:"fullscreen",from:!0,to:!1}]});var o=checkIsCurrentVideo(n,i.playerId,PLATER_ID);if(t||n&&(n===i._fullscreenEl||o))r(),!i.config.closeFocusVideoFocus&&i.media.focus(),i.fullscreen=!0,i.changeFullStyle(i.root,n,STATE_CLASS.FULLSCREEN),i.emit(FULLSCREEN_CHANGE,!0,i._fullScreenOffset),i.cssfullscreen&&i.exitCssFullscreen();else if(i.fullscreen){r();var a=_assertThisInitialized$4(i),s=a._fullScreenOffset;a.config.needFullscreenScroll?(window.scrollTo(s.left,s.top),util.setTimeout(_assertThisInitialized$4(i),(function(){i.fullscreen=!1,i._fullScreenOffset=null}),100)):(!i.config.closeFocusVideoFocus&&i.media.focus(),i.fullscreen=!1,i._fullScreenOffset=null),i.cssfullscreen?i.removeClass(STATE_CLASS.FULLSCREEN):i.recoverFullStyle(i.root,i._fullscreenEl,STATE_CLASS.FULLSCREEN),i._fullscreenEl=null,i.emit(FULLSCREEN_CHANGE,!1)}})),_defineProperty$5(_assertThisInitialized$4(i),"_onWebkitbeginfullscreen",(function(e){i._fullscreenEl=i.media,i.onFullscreenChange(e,!0)})),_defineProperty$5(_assertThisInitialized$4(i),"_onWebkitendfullscreen",(function(e){i.onFullscreenChange(e,!1)})),hooksDescriptor(_assertThisInitialized$4(i),PlAYER_HOOKS),i.config=n,i._pluginInfoId=util.generateSessionId(),bindDebug(_assertThisInitialized$4(i));var o=i.constructor.defaultPreset;if(i.config.presets.length){var a=i.config.presets.indexOf("default");a>=0&&o&&(i.config.presets[a]=o)}else o&&i.config.presets.push(o);if(i.userTimer=null,i.waitTimer=null,i._state=STATES.INITIAL,i.isError=!1,i._hasStart=!1,i.isSeeking=!1,i.isCanplay=!1,i._useAutoplay=!1,i.rotateDeg=0,i.isActive=!1,i.fullscreen=!1,i.cssfullscreen=!1,i.isRotateFullscreen=!1,i._fullscreenEl=null,i._cssfullscreenEl=null,i.curDefinition=null,i._orgCss="",i._fullScreenOffset=null,i._videoHeight=0,i._videoWidth=0,i.videoPos={pi:1,scale:0,rotate:0,x:0,y:0,h:-1,w:-1,vy:0,vx:0},i._accPlayed={t:0,acc:0,loopAcc:0},i.innerContainer=null,i.controls=null,i.topBar=null,i.root=null,i.__i18n=I18N.init(i._pluginInfoId),sniffer$1.os.isAndroid&&sniffer$1.osVersion>0&&sniffer$1.osVersion<6&&(i.config.autoplay=!1),i.database=new INDEXDB,i.isUserActive=!1,i._onceSeekCanplay=null,i._isPauseBeforeSeek=0,!i._initDOM())return console.error(new Error("can't find the dom which id is ".concat(i.config.id," or this.config.el does not exist"))),_possibleConstructorReturn$4(i);var s=i.config,l=s.definition,c=void 0===l?{}:l;if(!s.url&&c.list&&c.list.length>0){var u=c.list.find((function(e){return e.definition&&e.definition===c.defaultDefinition}));u||(c.defaultDefinition=c.list[0].definition,u=c.list[0]),i.config.url=u.url,i.curDefinition=u}return i._bindEvents(),i._registerPresets(),i._registerPlugins(),pluginsManager.onPluginsReady(_assertThisInitialized$4(i)),i.getInitDefinition(),i.setState(STATES.READY),util.setTimeout(_assertThisInitialized$4(i),(function(){i.emit(READY)}),0),i.onReady&&i.onReady(),(i.config.videoInit||i.config.autoplay)&&(!i.hasStart||i.state<STATES.ATTACHED)&&i.start(),i}return _createClass$5(r,[{key:"_initDOM",value:function(){var e=this;if(this.root=this.config.id?document.getElementById(this.config.id):null,!this.root){var t=this.config.el;if(!t||1!==t.nodeType)return this.emit(ERROR$1,new Errors("use",this.config.vid,{line:32,handle:"Constructor",msg:"container id can't be empty"})),console.error("this.confg.id or this.config.el can't be empty"),!1;this.root=t}var r=pluginsManager.checkPlayerRoot(this.root);r&&(XG_DEBUG.logWarn("The is an Player instance already exists in this.root, destroy it and reinitialize"),r.destroy()),this.root.setAttribute(PLATER_ID,this.playerId),pluginsManager.init(this),this._initBaseDoms();var i=this.constructor.XgVideoProxy;if(i&&this.mediaConfig.mediaType===i.mediaType){var n=this.innerContainer||this.root;this.detachVideoEvents(this.media);var o=new i(n,this.config,this.mediaConfig);this.attachVideoEvents(o),this.media=o}if(this.media.setAttribute(PLATER_ID,this.playerId),this.config.controls){var a=this.config.controls.root||null,s=pluginsManager.register(this,Controls,{root:a});this.controls=s}var l="mobile"===this.config.isMobileSimulateMode?"mobile":sniffer$1.device;if(this.addClass("".concat(STATE_CLASS.DEFAULT," ").concat(STATE_CLASS.INACTIVE," xgplayer-").concat(l," ").concat(this.config.controls?"":STATE_CLASS.NO_CONTROLS)),this.config.autoplay?this.addClass(STATE_CLASS.ENTER):this.addClass(STATE_CLASS.NO_START),this.config.fluid){var c=this.config,u=c.width,h=c.height;"number"==typeof u&&"number"==typeof h||(u=600,h=337.5);var d={width:"100%",height:"0","max-width":"100%","padding-top":"".concat(100*h/u,"%")};Object.keys(d).forEach((function(t){e.root.style[t]=d[t]}))}else["width","height"].forEach((function(t){e.config[t]&&("number"!=typeof e.config[t]?e.root.style[t]=e.config[t]:e.root.style[t]="".concat(e.config[t],"px"))}));return!0}},{key:"_initBaseDoms",value:function(){this.topBar=null,this.leftBar=null,this.rightBar=null,this.config.marginControls&&(this.innerContainer=util.createDom("xg-video-container","",{"data-index":-1},"xg-video-container"),this.root.appendChild(this.innerContainer))}},{key:"_bindEvents",value:function(){var e=this;["focus","blur"].forEach((function(t){e.on(t,e["on"+t.charAt(0).toUpperCase()+t.slice(1)])})),FULLSCREEN_EVENTS.forEach((function(t){document&&document.addEventListener(t,e.onFullscreenChange)})),sniffer$1.os.isIos&&(this.media.addEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.media.addEventListener("webkitendfullscreen",this._onWebkitendfullscreen)),this.once(LOADED_DATA,this.resize),this.playFunc=function(){e.config.closeFocusVideoFocus||e.media.focus()},this.once(PLAY,this.playFunc)}},{key:"_unbindEvents",value:function(){var e=this;this.root.removeEventListener("mousemove",this.mousemoveFunc),FULLSCREEN_EVENTS.forEach((function(t){document.removeEventListener(t,e.onFullscreenChange)})),this.playFunc&&this.off(PLAY,this.playFunc),this.off(CANPLAY,this.canPlayFunc),this.media.removeEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.media.removeEventListener("webkitendfullscreen",this._onWebkitendfullscreen)}},{key:"_startInit",value:function(e){var t=this;if(this.media&&(e&&""!==e&&("Array"!==util.typeOf(e)||0!==e.length)||(e="",this.emit(URL_NULL),XG_DEBUG.logWarn("config.url is null, please get url and run player._startInit(url)"),!this.config.nullUrlStart))){this._detachSourceEvents(this.media),"Array"===util.typeOf(e)&&e.length>0?this._attachSourceEvents(this.media,e):this.media.src&&this.media.src===e?e||this.media.removeAttribute("src"):this.media.src=e,"Number"===util.typeOf(this.config.volume)&&(this.volume=this.config.volume);var r=this.innerContainer?this.innerContainer:this.root;this.media instanceof window.Element&&!r.contains(this.media)&&r.insertBefore(this.media,r.firstChild);var i=this.media.readyState;XG_DEBUG.logInfo("_startInit readyState",i),this.config.autoplay&&(!/^blob/.test(this.media.currentSrc)&&!/^blob/.test(this.media.src)&&this.load(),(sniffer$1.os.isIpad||sniffer$1.os.isPhone)&&this.mediaPlay()),i>=2?this.canPlayFunc():this.once(CANPLAY,this.canPlayFunc),(!this.hasStart||this.state<STATES.ATTACHED)&&pluginsManager.afterInit(this),this.hasStart=!0,this.setState(STATES.ATTACHED),util.setTimeout(this,(function(){t.emit(COMPLETE)}),0)}}},{key:"_registerPlugins",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._loadingPlugins=[];var r=this.config.ignores||[],i=this.config.plugins||[],n=this.config.i18n||[];t&&I18N.extend(n,this.__i18n);var o=r.join("||").toLowerCase().split("||"),a=this.plugins;i.forEach((function(r){try{var i=r.plugin?r.plugin.pluginName:r.pluginName;if(i&&o.indexOf(i.toLowerCase())>-1)return null;if(!t&&a[i.toLowerCase()])return;if(r.lazy&&r.loader){var n=pluginsManager.lazyRegister(e,r);return void(r.forceBeforeInit&&(n.then((function(){e._loadingPlugins.splice(e._loadingPlugins.indexOf(n),1)})).catch((function(t){XG_DEBUG.logError("_registerPlugins:loadingPlugin",t),e._loadingPlugins.splice(e._loadingPlugins.indexOf(n),1)})),e._loadingPlugins.push(n)))}return e.registerPlugin(r)}catch(s){XG_DEBUG.logError("_registerPlugins:",s)}}))}},{key:"_registerPresets",value:function(){var e=this;this.config.presets.forEach((function(t){usePreset(e,t)}))}},{key:"_getRootByPosition",value:function(e){var t=null;switch(e){case POSITIONS$a.ROOT_RIGHT:this.rightBar||(this.rightBar=util.createPositionBar("xg-right-bar",this.root)),t=this.rightBar;break;case POSITIONS$a.ROOT_LEFT:this.leftBar||(this.leftBar=util.createPositionBar("xg-left-bar",this.root)),t=this.leftBar;break;case POSITIONS$a.ROOT_TOP:this.topBar||(this.topBar=util.createPositionBar("xg-top-bar",this.root),this.config.topBarAutoHide&&util.addClass(this.topBar,STATE_CLASS.TOP_BAR_AUTOHIDE)),t=this.topBar;break;default:t=this.innerContainer||this.root}return t}},{key:"registerPlugin",value:function(e,t){var r=pluginsManager.formatPluginInfo(e,t),i=r.PLUFGIN,n=r.options,o=this.config.plugins;!pluginsManager.checkPluginIfExits(i.pluginName,o)&&o.push(i);var a=pluginsManager.getRootByConfig(i.pluginName,this.config);a.root&&(n.root=a.root),a.position&&(n.position=a.position);var s=n.position?n.position:n.config&&n.config.position||i.defaultConfig&&i.defaultConfig.position;return!n.root&&"string"==typeof s&&s.indexOf("controls")>-1?this.controls&&this.controls.registerPlugin(i,n,i.pluginName):(n.root||(n.root=this._getRootByPosition(s)),pluginsManager.register(this,i,n))}},{key:"deregister",value:function(e){"string"==typeof e?pluginsManager.unRegister(this,e):e instanceof BasePlugin&&pluginsManager.unRegister(this,e.pluginName)}},{key:"unRegisterPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.deregister(e),t&&this.removePluginFromConfig(e)}},{key:"removePluginFromConfig",value:function(e){var t;if("string"==typeof e?t=e:e instanceof BasePlugin&&(t=e.pluginName),t)for(var r=this.config.plugins.length-1;r>-1;r--){if(this.config.plugins[r].pluginName.toLowerCase()===t.toLowerCase()){this.config.plugins.splice(r,1);break}}}},{key:"plugins",get:function(){return pluginsManager.getPlugins(this)}},{key:"getPlugin",value:function(e){var t=pluginsManager.findPlugin(this,e);return t&&t.pluginName?t:null}},{key:"addClass",value:function(e){this.root&&(util.hasClass(this.root,e)||util.addClass(this.root,e))}},{key:"removeClass",value:function(e){this.root&&util.removeClass(this.root,e)}},{key:"hasClass",value:function(e){if(this.root)return util.hasClass(this.root,e)}},{key:"setAttribute",value:function(e,t){this.root&&this.root.setAttribute(e,t)}},{key:"removeAttribute",value:function(e,t){this.root&&this.root.removeAttribute(e,t)}},{key:"start",value:function(e){var t=this;if(!(this.state>STATES.ATTACHING))return e||this.config.url||this.getInitDefinition(),this.hasStart=!0,this.setState(STATES.ATTACHING),this._registerPlugins(!1),pluginsManager.beforeInit(this).then((function(){if(t.config)return e||(e=t.url||t.config.url),t._startInit(e)})).catch((function(e){throw e.fileName="player",e.lineNumber="236",XG_DEBUG.logError("start:beforeInit:",e),e}))}},{key:"switchURL",value:function(e,t){var r=this,i=e;"Object"===util.typeOf(e)&&(i=e.url);var n=this.currentTime,o=this.paused&&!this.isError;return this.src=i,new Promise((function(e,t){var a=function(e){r.off("timeupdate",s),r.off("canplay",s),t(e)},s=function(){r.currentTime=n,o&&r.pause(),r.off("error",a),e(!0)};r.once("error",a),i?(sniffer$1.os.isAndroid?r.once("timeupdate",s):r.once("canplay",s),r.play()):r.errorHandler("error",{code:6,message:"empty_src"})}))}},{key:"videoPlay",value:function(){this.mediaPlay()}},{key:"mediaPlay",value:function(){var e=this;if(!this.hasStart&&this.state<STATES.ATTACHED)return this.removeClass(STATE_CLASS.NO_START),this.addClass(STATE_CLASS.ENTER),this.start(),void(this._useAutoplay=!0);this.state<STATES.RUNNING&&(this.removeClass(STATE_CLASS.NO_START),!this.isCanplay&&this.addClass(STATE_CLASS.ENTER));var t=_get$2(_getPrototypeOf$4(r.prototype),"play",this).call(this);return void 0!==t&&t&&t.then?t.then((function(){e.removeClass(STATE_CLASS.NOT_ALLOW_AUTOPLAY),e.addClass(STATE_CLASS.PLAYING),e.state<STATES.RUNNING&&(XG_DEBUG.logInfo(">>>>playPromise.then"),e.setState(STATES.RUNNING),e.emit(AUTOPLAY_STARTED))})).catch((function(t){if(XG_DEBUG.logWarn(">>>>playPromise.catch",t.name),e.media&&e.media.error)return e.onError(),void e.removeClass(STATE_CLASS.ENTER);"NotAllowedError"===t.name&&(e._errorTimer=util.setTimeout(e,(function(){e._errorTimer=null,e.emit(AUTOPLAY_PREVENTED),e.addClass(STATE_CLASS.NOT_ALLOW_AUTOPLAY),e.removeClass(STATE_CLASS.ENTER),e.pause(),e.setState(STATES.NOTALLOW)}),0))})):(XG_DEBUG.logWarn("video.play not return promise"),this.state<STATES.RUNNING&&(this.setState(STATES.RUNNING),this.removeClass(STATE_CLASS.NOT_ALLOW_AUTOPLAY),this.removeClass(STATE_CLASS.NO_START),this.removeClass(STATE_CLASS.ENTER),this.addClass(STATE_CLASS.PLAYING),this.emit(AUTOPLAY_STARTED))),t}},{key:"mediaPause",value:function(){_get$2(_getPrototypeOf$4(r.prototype),"pause",this).call(this)}},{key:"videoPause",value:function(){_get$2(_getPrototypeOf$4(r.prototype),"pause",this).call(this)}},{key:"play",value:function(){var e=this;return this.removeClass(STATE_CLASS.PAUSED),runHooks(this,"play",(function(){return e.mediaPlay()}))}},{key:"pause",value:function(){var e=this;runHooks(this,"pause",(function(){_get$2(_getPrototypeOf$4(r.prototype),"pause",e).call(e)}))}},{key:"seek",value:function(e,t){var r=this;if(this.media&&!Number.isNaN(Number(e))&&this.hasStart){var i=this.config,n=i.isSeekedPlay,o=i.seekedStatus,a=t||(n?"play":o);e=e<0?0:e>this.duration?parseInt(this.duration,10):e,!this._isPauseBeforeSeek&&(this._isPauseBeforeSeek=this.paused?2:1),this._onceSeekCanplay&&this.off(SEEKED,this._onceSeekCanplay),this._onceSeekCanplay=function(){switch(r.removeClass(STATE_CLASS.ENTER),r.isSeeking=!1,a){case"play":r.play();break;case"pause":r.pause();break;default:r._isPauseBeforeSeek>1||r.paused?r.pause():r.play()}r._isPauseBeforeSeek=0,r._onceSeekCanplay=null},this.once(SEEKED,this._onceSeekCanplay),this.state<STATES.RUNNING?(this.removeClass(STATE_CLASS.NO_START),this.currentTime=e,this.play()):this.currentTime=e}}},{key:"getInitDefinition",value:function(){var e=this,t=this.config,r=t.definition;!t.url&&r&&r.list&&r.list.length>0&&r.defaultDefinition&&r.list.map((function(t){t.definition===r.defaultDefinition&&(e.config.url=t.url,e.curDefinition=t)}))}},{key:"changeDefinition",value:function(e,t){var r=this,i=this.config.definition;if(Array.isArray(null==i?void 0:i.list)&&i.list.forEach((function(t){(null==e?void 0:e.definition)===t.definition&&(r.curDefinition=t)})),null!=e&&e.bitrate&&"number"!=typeof e.bitrate&&(e.bitrate=parseInt(e.bitrate,10)||0),this.emit(DEFINITION_CHANGE,{from:t,to:e}),this.hasStart){var n=this.switchURL(e.url,_objectSpread2$4({seamless:!1!==i.seamless&&"undefined"!=typeof MediaSource&&"function"==typeof MediaSource.isTypeSupported},e));n&&n.then?n.then((function(){r.emit(AFTER_DEFINITION_CHANGE,{from:t,to:e})})):this.emit(AFTER_DEFINITION_CHANGE,{from:t,to:e})}else this.config.url=e.url}},{key:"reload",value:function(){this.load(),this.reloadFunc=function(){this.play()},this.once(LOADED_DATA,this.reloadFunc)}},{key:"resetState",value:function(){var e=this,t=[STATE_CLASS.NOT_ALLOW_AUTOPLAY,STATE_CLASS.PLAYING,STATE_CLASS.NO_START,STATE_CLASS.PAUSED,STATE_CLASS.REPLAY,STATE_CLASS.ENTER,STATE_CLASS.ENDED,STATE_CLASS.ERROR,STATE_CLASS.LOADING];this.hasStart=!1,this.isError=!1,this._useAutoplay=!1,this.mediaPause(),this._accPlayed.acc=0,this._accPlayed.t=0,this._accPlayed.loopAcc=0,t.forEach((function(t){e.removeClass(t)})),this.addClass(STATE_CLASS.ENTER),this.emit(RESET)}},{key:"reset",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1?arguments[1]:void 0;this.resetState();var i=this.plugins;if(i&&(t.map((function(t){e.deregister(t)})),r)){var n=getDefaultConfig$1();Object.keys(this.config).keys((function(t){"undefined"===e.config[t]||"plugins"!==t&&"presets"!==t&&"el"!==t&&"id"!==t||(e.config[t]=n[t])}))}}},{key:"destroy",value:function(){var e=this,t=this.innerContainer,i=this.root,n=this.media;if(i&&n){if(this.hasStart=!1,this._useAutoplay=!1,i.removeAttribute(PLATER_ID),this.updateAcc("destroy"),this._unbindEvents(),this._detachSourceEvents(this.media),util.clearAllTimers(this),this.emit(DESTROY),pluginsManager.destroy(this),delHooksDescriptor(this),_get$2(_getPrototypeOf$4(r.prototype),"destroy",this).call(this),this.fullscreen&&this._fullscreenEl===this.root&&this.exitFullscreen(),t)for(var o=t.children,a=0;a<o.length;a++)t.removeChild(o[a]);!t&&n instanceof window.Node&&i.contains(n)&&i.removeChild(n),["topBar","leftBar","rightBar","innerContainer"].map((function(t){e[t]&&i.removeChild(e[t]),e[t]=null}));var s=i.className.split(" ");s.length>0?i.className=s.filter((function(e){return e.indexOf("xgplayer")<0})).join(" "):i.className="",this.removeAttribute("data-xgfill"),["isSeeking","isCanplay","isActive","cssfullscreen","fullscreen"].forEach((function(t){e[t]=!1}))}}},{key:"replay",value:function(){var e=this;this.removeClass(STATE_CLASS.ENDED),this.currentTime=0,this.isSeeking=!1,runHooks(this,"replay",(function(){e.once(SEEKED,(function(){var t=e.mediaPlay();t&&t.catch&&t.catch((function(e){console.log(e)}))})),e.play(),e.emit(REPLAY),e.onPlay()}))}},{key:"retry",value:function(){var e=this;this.removeClass(STATE_CLASS.ERROR),this.addClass(STATE_CLASS.LOADING),runHooks(this,"retry",(function(){var t=e.currentTime;e.src=e.config.url,!e.config.isLive&&(e.currentTime=t),e.once(CANPLAY,(function(){e.mediaPlay()}))}))}},{key:"changeFullStyle",value:function(e,t,r,i){e&&(i||(i=STATE_CLASS.PARENT_FULLSCREEN),this._orgCss||(this._orgCss=util.filterStyleFromText(e)),util.addClass(e,r),t&&t!==e&&!this._orgPCss&&(this._orgPCss=util.filterStyleFromText(t),util.addClass(t,i),t.setAttribute(PLATER_ID,this.playerId)))}},{key:"recoverFullStyle",value:function(e,t,r,i){i||(i=STATE_CLASS.PARENT_FULLSCREEN),this._orgCss&&(util.setStyleFromCsstext(e,this._orgCss),this._orgCss=""),util.removeClass(e,r),t&&t!==e&&this._orgPCss&&(util.setStyleFromCsstext(t,this._orgPCss),this._orgPCss="",util.removeClass(t,i),t.removeAttribute(PLATER_ID))}},{key:"getFullscreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget,t=this.root,r=this.media;e||(e=t),this._fullScreenOffset={top:util.scrollTop(),left:util.scrollLeft()},this._fullscreenEl=e,this._fullActionFrom="get";var i=util.getFullScreenEl();if(i!==this._fullscreenEl)try{for(var n=0;n<GET_FULLSCREEN_API.length;n++){var o=GET_FULLSCREEN_API[n];if(e[o]){var a="webkitRequestFullscreen"===o?e.webkitRequestFullscreen(window.Element.ALLOW_KEYBOARD_INPUT):e[o]();return a&&a.then?a:Promise.resolve()}}return r.fullscreenEnabled||r.webkitSupportsFullscreen?(r.webkitEnterFullscreen(),Promise.resolve()):Promise.reject(new Error("call getFullscreen fail"))}catch(s){return Promise.reject(new Error("call getFullscreen fail"))}else this.onFullscreenChange()}},{key:"exitFullscreen",value:function(e){if(this.isRotateFullscreen&&this.exitRotateFullscreen(),this._fullscreenEl||util.getFullScreenEl()){this.root;var t=this.media;this._fullActionFrom="exit";try{for(var r=0;r<EXIT_FULLSCREEN_API.length;r++){var i=EXIT_FULLSCREEN_API[r];if(document[i]){var n=document[i]();return n&&n.then?n:Promise.resolve()}}return t&&t.webkitSupportsFullscreen?(t.webkitExitFullScreen(),Promise.resolve()):Promise.reject(new Error("call exitFullscreen fail"))}catch(o){return Promise.reject(new Error("call exitFullscreen fail"))}}}},{key:"getCssFullscreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget;this.isRotateFullscreen?this.exitRotateFullscreen():this.fullscreen&&this.exitFullscreen();var t=e?"".concat(STATE_CLASS.INNER_FULLSCREEN," ").concat(STATE_CLASS.CSS_FULLSCREEN):STATE_CLASS.CSS_FULLSCREEN;this.changeFullStyle(this.root,e,t);var r=this.config.fullscreen,i=void 0===r?{}:r,n=!0===i.useCssFullscreen||"function"==typeof i.useCssFullscreen&&i.useCssFullscreen();n&&(this.fullscreen=!0,this.emit(FULLSCREEN_CHANGE,!0)),this._cssfullscreenEl=e,this.cssfullscreen=!0,this.emit(CSS_FULLSCREEN_CHANGE,!0)}},{key:"exitCssFullscreen",value:function(){var e=this._cssfullscreenEl?"".concat(STATE_CLASS.INNER_FULLSCREEN," ").concat(STATE_CLASS.CSS_FULLSCREEN):STATE_CLASS.CSS_FULLSCREEN;if(this.fullscreen){var t=this.config.fullscreen,r=void 0===t?{}:t;!0===r.useCssFullscreen||"function"==typeof r.useCssFullscreen&&r.useCssFullscreen()?(this.recoverFullStyle(this.root,this._cssfullscreenEl,e),this.fullscreen=!1,this.emit(FULLSCREEN_CHANGE,!1)):this.removeClass(e)}else this.recoverFullStyle(this.root,this._cssfullscreenEl,e);this._cssfullscreenEl=null,this.cssfullscreen=!1,this.emit(CSS_FULLSCREEN_CHANGE,!1)}},{key:"getRotateFullscreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget;this.cssfullscreen&&this.exitCssFullscreen(e);var t=e?"".concat(STATE_CLASS.INNER_FULLSCREEN," ").concat(STATE_CLASS.ROTATE_FULLSCREEN):STATE_CLASS.ROTATE_FULLSCREEN;this._fullscreenEl=e||this.root,this.changeFullStyle(this.root,e,t,STATE_CLASS.PARENT_ROTATE_FULLSCREEN),this.isRotateFullscreen=!0,this.fullscreen=!0,this.setRotateDeg(90),this._rootStyle=this.root.getAttribute("style"),this.root.style.width="".concat(window.innerHeight,"px"),this.emit(FULLSCREEN_CHANGE,!0)}},{key:"exitRotateFullscreen",value:function(e){var t=this._fullscreenEl!==this.root?"".concat(STATE_CLASS.INNER_FULLSCREEN," ").concat(STATE_CLASS.ROTATE_FULLSCREEN):STATE_CLASS.ROTATE_FULLSCREEN;this.recoverFullStyle(this.root,this._fullscreenEl,t,STATE_CLASS.PARENT_ROTATE_FULLSCREEN),this.isRotateFullscreen=!1,this.fullscreen=!1,this.setRotateDeg(0),this.emit(FULLSCREEN_CHANGE,!1),this._rootStyle&&(this.root.style.style=this._rootStyle,this._rootStyle=!1)}},{key:"setRotateDeg",value:function(e){90===window.orientation||-90===window.orientation?this.rotateDeg=0:this.rotateDeg=e}},{key:"focus",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{autoHide:!this.config.closeDelayBlur,delay:this.config.inactive};this.isActive?this.onFocus(e):this.emit(PLAYER_FOCUS,_objectSpread2$4({paused:this.paused,ended:this.ended},e))}},{key:"blur",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{ignorePaused:!1};this.isActive?this.emit(PLAYER_BLUR,_objectSpread2$4({paused:this.paused,ended:this.ended},e)):this.onBlur(e)}},{key:"onFocus",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.autoHide,i=void 0===r?!this.config.closePlayerBlur:r,n=t.delay,o=void 0===n?this.config.inactive:n;this.isActive=!0,this.removeClass(STATE_CLASS.INACTIVE),this.userTimer&&(util.clearTimeout(this,this.userTimer),this.userTimer=null),i?this.userTimer=util.setTimeout(this,(function(){e.userTimer=null,e.blur()}),o):this.userTimer&&(util.clearTimeout(this,this.userTimer),this.userTimer=null)}},{key:"onBlur",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.ignorePaused,r=void 0!==t&&t;if(this.isActive){var i=this.config.closePauseVideoFocus;this.isActive=!1,(r||i||!this.paused&&!this.ended)&&this.addClass(STATE_CLASS.INACTIVE)}}},{key:"onEmptied",value:function(){this.updateAcc("emptied")}},{key:"onCanplay",value:function(){this.removeClass(STATE_CLASS.ENTER),this.removeClass(STATE_CLASS.ERROR),this.removeClass(STATE_CLASS.LOADING),this.isCanplay=!0,this.waitTimer&&util.clearTimeout(this,this.waitTimer)}},{key:"onLoadeddata",value:function(){this.isError=!1,this.isSeeking=!1}},{key:"onLoadstart",value:function(){this.removeClass(STATE_CLASS.ERROR),this.isCanplay=!1}},{key:"onPlay",value:function(){this.state===STATES.ENDED&&this.setState(STATES.RUNNING),this.removeClass(STATE_CLASS.PAUSED),this.ended&&this.removeClass(STATE_CLASS.ENDED),!this.config.closePlayVideoFocus&&this.focus()}},{key:"onPause",value:function(){this.addClass(STATE_CLASS.PAUSED),this.updateAcc("pause"),this.config.closePauseVideoFocus||(this.userTimer&&(util.clearTimeout(this,this.userTimer),this.userTimer=null),this.focus())}},{key:"onEnded",value:function(){this.updateAcc("ended"),this.addClass(STATE_CLASS.ENDED),this.setState(STATES.ENDED)}},{key:"onError",value:function(){this.isError=!0,this.updateAcc("error"),this.removeClass(STATE_CLASS.NOT_ALLOW_AUTOPLAY),this.removeClass(STATE_CLASS.NO_START),this.removeClass(STATE_CLASS.ENTER),this.removeClass(STATE_CLASS.LOADING),this.addClass(STATE_CLASS.ERROR)}},{key:"onSeeking",value:function(){this.isSeeking||this.updateAcc("seeking"),this.isSeeking=!0,this.addClass(STATE_CLASS.SEEKING)}},{key:"onSeeked",value:function(){this.isSeeking=!1,this.waitTimer&&util.clearTimeout(this,this.waitTimer),this.removeClass(STATE_CLASS.LOADING),this.removeClass(STATE_CLASS.SEEKING)}},{key:"onWaiting",value:function(){var e=this;this.waitTimer&&util.clearTimeout(this,this.waitTimer),this.updateAcc("waiting"),this.waitTimer=util.setTimeout(this,(function(){e.addClass(STATE_CLASS.LOADING),util.clearTimeout(e,e.waitTimer),e.waitTimer=null}),this.config.minWaitDelay)}},{key:"onPlaying",value:function(){var e=this;this.isError=!1,[STATE_CLASS.NO_START,STATE_CLASS.PAUSED,STATE_CLASS.ENDED,STATE_CLASS.ERROR,STATE_CLASS.REPLAY,STATE_CLASS.LOADING].forEach((function(t){e.removeClass(t)}))}},{key:"onTimeupdate",value:function(){!this._videoHeight&&this.resize(),(this.waitTimer||this.hasClass(STATE_CLASS.LOADING))&&this.media.readyState>2&&(this.removeClass(STATE_CLASS.LOADING),util.clearTimeout(this,this.waitTimer),this.waitTimer=null),!this.paused&&this.state<STATES.RUNNING&&this.duration&&(this.setState(STATES.RUNNING),this.emit(AUTOPLAY_STARTED)),this._accPlayed.t||this.paused||this.ended||(this._accPlayed.t=(new Date).getTime())}},{key:"onVolumechange",value:function(){"Number"===util.typeOf(this.config.volume)&&(this.config.volume=this.volume)}},{key:"onRatechange",value:function(){this.config.defaultPlaybackRate=this.playbackRate}},{key:"emitUserAction",value:function(e,t,r){if(this.media&&t&&e){var i="String"===util.typeOf(e)?e:e.type||"";r.props&&"Array"!==util.typeOf(r.props)&&(r.props=[r.props]),this.emit(USER_ACTION,_objectSpread2$4({eventType:i,action:t,currentTime:this.currentTime,duration:this.duration,ended:this.ended,event:e},r))}}},{key:"updateAcc",value:function(e){if(this._accPlayed.t){var t=(new Date).getTime()-this._accPlayed.t;this._accPlayed.acc+=t,this._accPlayed.t=0,("ended"===e||this.ended)&&(this._accPlayed.loopAcc=this._accPlayed.acc)}}},{key:"checkBuffer",value:function(e){var t=this.media.buffered;if(!t||0===t.length||!this.duration)return!0;for(var r=e||this.media.currentTime||.2,i=t.length,n=0;n<i;n++)if(t.start(n)<=r&&t.end(n)>r)return!0;return!1}},{key:"resizePosition",value:function(){var e=this.videoPos,t=e.rotate,r=e.vy,i=e.vx,n=e.h,o=e.w,a=this.videoPos._pi;if(a||(a=this.media.videoWidth/this.media.videoHeight*100),a){this.videoPos.pi=a;var s={rotate:t},l=0,c=0,u=1,h=Math.abs(t/90),d=this.root,p=this.innerContainer,f=d.offsetWidth,g=p?p.offsetHeight:d.offsetHeight,y=g,v=f;if(h%2==0)u=n>0?100/n:o>0?100/o:1,s.scale=u,l=r>0?(100-n)/2-r:0,s.y=2===h?0-l:l,c=i>0?(100-o)/2-i:0,s.x=2===h?0-c:c,this.media.style.width="".concat(v,"px"),this.media.style.height="".concat(y,"px");else if(h%2==1){y=f;var m=g-f;c=-m/2/(v=g)*100,s.x=3===h?c+r/2:c-r/2,l=m/2/y*100,s.y=3===h?l+i/2:l-i/2,s.scale=u,this.media.style.width="".concat(v,"px"),this.media.style.height="".concat(y,"px")}var _=util.getTransformStyle(s);this.media.style.transform=_,this.media.style.webkitTransform=_}}},{key:"position",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{h:0,y:0,x:0,w:0};if(this.media&&e&&e.h){var t=this.videoPos;t.h=100*e.h||0,t.w=100*e.w||0,t.vx=100*e.x||0,t.vy=100*e.y||0,this.resizePosition()}}},{key:"setConfig",value:function(e){var t=this;e&&Object.keys(e).map((function(r){if("plugins"!==r){t.config[r]=e[r];var i=t.plugins[r.toLowerCase()];i&&"Function"===util.typeOf(i.setConfig)&&i.setConfig(e[r])}}))}},{key:"playNext",value:function(e){var t=this;this.resetState(),this.setConfig(e),this._currentTime=0,this._duration=0,runHooks(this,"playnext",(function(){t.start(),t.emit(PLAYNEXT,e)}))}},{key:"resize",value:function(){var e=this;if(this.media){var t=this.media,r=t.videoWidth,i=t.videoHeight,n=this.config,o=n.fitVideoSize,a=n.videoFillMode;if("fill"!==a&&"cover"!==a||this.setAttribute("data-xgfill",a),i&&r){this._videoHeight=i,this._videoWidth=r;var s=this.root.getBoundingClientRect(),l=this.controls&&this.innerContainer?this.controls.root.getBoundingClientRect().height:0,c=s.width,u=s.height-l,h=parseInt(r/i*1e3,10),d=parseInt(c/u*1e3,10),p=c,f=u,g={};"auto"===o&&d>h||"fixWidth"===o?(f=c/h*1e3,this.config.fluid?g.paddingTop="".concat(100*f/p,"%"):g.height="".concat(f+l,"px")):("auto"===o&&d<h||"fixHeight"===o)&&(p=h*u/1e3,g.width="".concat(p,"px")),this.fullscreen||this.cssfullscreen||Object.keys(g).forEach((function(t){e.root.style[t]=g[t]})),("fillHeight"===a&&d<h||"fillWidth"===a&&d>h)&&this.setAttribute("data-xgfill","cover");var y={videoScale:h,vWidth:p,vHeight:f,cWidth:p,cHeight:f+l};this.resizePosition(),this.emit(VIDEO_RESIZE,y)}}}},{key:"updateObjectPosition",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.media.updateObjectPosition?this.media.updateObjectPosition(e,t):this.media.style.objectPosition="".concat(100*e,"% ").concat(100*t,"%")}},{key:"setState",value:function(e){XG_DEBUG.logInfo("setState","state from:".concat(STATE_ARRAY[this.state]," to:").concat(STATE_ARRAY[e])),this._state=e}},{key:"state",get:function(){return this._state}},{key:"isFullscreen",get:function(){return this.fullscreen}},{key:"isCssfullScreen",get:function(){return this.cssfullscreen}},{key:"hasStart",get:function(){return this._hasStart},set:function(e){"boolean"==typeof e&&(this._hasStart=e,!1===e&&this.setState(STATES.READY),this.emit("hasstart"))}},{key:"isPlaying",get:function(){return this._state===STATES.RUNNING||this._state===STATES.ENDED},set:function(e){e?this.setState(STATES.RUNNING):this._state>=STATES.RUNNING&&this.setState(STATES.ATTACHED)}},{key:"definitionList",get:function(){return this.config&&this.config.definition&&this.config.definition.list||[]},set:function(e){var t=this,r=this.config.definition,i=null,n=null;r.list=e,this.emit("resourceReady",e),e.forEach((function(e){var o;(null===(o=t.curDefinition)||void 0===o?void 0:o.definition)===e.definition&&(i=e),r.defaultDefinition===e.definition&&(n=e)})),!n&&e.length>0&&(n=e[0]),i?this.changeDefinition(i):n&&this.changeDefinition(n)}},{key:"videoFrameInfo",get:function(){var e={total:0,dropped:0,corrupted:0,droppedRate:0,droppedDuration:0};if(!this.media||!this.media.getVideoPlaybackQuality)return e;var t=this.media.getVideoPlaybackQuality();return e.dropped=t.droppedVideoFrames||0,e.total=t.totalVideoFrames||0,e.corrupted=t.corruptedVideoFrames||0,e.total>0&&(e.droppedRate=e.dropped/e.total*100,e.droppedDuration=parseInt(this.cumulateTime/e.total*e.dropped,0)),e}},{key:"lang",get:function(){return this.config.lang},set:function(e){0!==I18N.langKeys.filter((function(t){return t===e})).length||"zh"===e?(this.config.lang=e,pluginsManager.setLang(e,this)):console.error("Sorry, set lang fail, because the language [".concat(e,"] is not supported now, list of all supported languages is [").concat(I18N.langKeys.join(),"] "))}},{key:"i18n",get:function(){var e=this.config.lang;return"zh"===e&&(e="zh-cn"),this.__i18n.lang[e]||this.__i18n.lang.en}},{key:"i18nKeys",get:function(){return this.__i18n.textKeys||{}}},{key:"version",get:function(){return version$2}},{key:"playerId",get:function(){return this._pluginInfoId}},{key:"url",get:function(){return this.__url||this.config.url},set:function(e){this.__url=e}},{key:"poster",get:function(){return this.plugins.poster?this.plugins.poster.config.poster:this.config.poster},set:function(e){this.plugins.poster&&this.plugins.poster.update(e)}},{key:"readyState",get:function(){return _get$2(_getPrototypeOf$4(r.prototype),"readyState",this)}},{key:"error",get:function(){var e=_get$2(_getPrototypeOf$4(r.prototype),"error",this);return this.i18n[e]||e}},{key:"networkState",get:function(){return _get$2(_getPrototypeOf$4(r.prototype),"networkState",this)}},{key:"fullscreenChanging",get:function(){return!(null===this._fullScreenOffset)}},{key:"cumulateTime",get:function(){var e=this._accPlayed;return this.updateAcc("get"),e.acc}},{key:"zoom",get:function(){return this.config.zoom},set:function(e){this.config.zoom=e}},{key:"videoRotateDeg",get:function(){return this.videoPos.rotate},set:function(e){(e=util.convertDeg(e))%90==0&&e!==this.videoPos.rotate&&(this.videoPos.rotate=e,this.resizePosition())}},{key:"avgSpeed",get:function(){return AVG_SPEED},set:function(e){AVG_SPEED=e}},{key:"realTimeSpeed",get:function(){return REAL_TIME_SPEED},set:function(e){REAL_TIME_SPEED=e}},{key:"hook",value:function(e,t){return hook.call.apply(hook,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(e,t){return useHooks.call.apply(useHooks,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(e,t){return removeHooks.call.apply(removeHooks,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"usePluginHooks",value:function(e,t,r){for(var i=arguments.length,n=new Array(i>3?i-3:0),o=3;o<i;o++)n[o-3]=arguments[o];return usePluginHooks.call.apply(usePluginHooks,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removePluginHooks",value:function(e,t,r){for(var i=arguments.length,n=new Array(i>3?i-3:0),o=3;o<i;o++)n[o-3]=arguments[o];return removePluginHooks.call.apply(removePluginHooks,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"setUserActive",value:function(e,t){"boolean"==typeof t&&t!==this.muted&&(this.addInnerOP("volumechange"),this.muted=t),pluginsManager.setCurrentUserActive(this.playerId,e)}}],[{key:"debugger",get:function(){return XG_DEBUG.config.debug},set:function(e){XG_DEBUG.config.debug=e}},{key:"getCurrentUserActivePlayerId",value:function(){return pluginsManager.getCurrentUseActiveId()}},{key:"setCurrentUserActive",value:function(e,t){pluginsManager.setCurrentUserActive(e,t)}},{key:"isHevcSupported",value:function(){return sniffer$1.isHevcSupported()}},{key:"probeConfigSupported",value:function(e){return sniffer$1.probeConfigSupported(e)}},{key:"install",value:function(e,t){r.plugins||(r.plugins={}),r.plugins[e]||(r.plugins[e]=t)}},{key:"use",value:function(e,t){r.plugins||(r.plugins={}),r.plugins[e]=t}}]),r}(MediaProxy);function now$2(){return(new Date).getTime()}_defineProperty$5(Player,"defaultPreset",null),_defineProperty$5(Player,"XgVideoProxy",null);var LOG_TYPES$1={LOAD_START:"loadstart",LOADED_DATA:"loadeddata",FIRST_FRAME:"firstFrame",WAIT_START:"waitingStart",WAIT_END:"waitingEnd",SEEK_START:"seekStart",SEEK_END:"seekEnd"},XGLogger=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(){var e;_classCallCheck$4(this,r);for(var i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];return _defineProperty$5(_assertThisInitialized$4(e=t.call.apply(t,[this].concat(n))),"_onTimeupdate",(function(){e._state.isTimeUpdate=!0,e._state.autoplayStart&&(XG_DEBUG.logInfo("[xgLogger]".concat(e.player.playerId," _onTimeupdate")),e._sendFF("onTimeupdate"))})),_defineProperty$5(_assertThisInitialized$4(e),"_onAutoplayStart",(function(){XG_DEBUG.logInfo("[xgLogger]".concat(e.player.playerId," _onAutoplayStart")),e._state.autoplayStart=!0,e.vt&&e._sendFF("onAutoplayStart")})),_defineProperty$5(_assertThisInitialized$4(e),"_onReset",(function(){e._state={autoplayStart:!1,isFFLoading:!1,isTimeUpdate:!1,isFFSend:!1,isLs:!1},e.vt=0,e.pt=0,e.fvt=0,e.newPointTime=now$2(),e.loadedCostTime=0,e.startCostTime=0,e._isSeeking=!1,e.seekingStart=0,e.waitingStart=0,e.fixedWaitingStart=0,e._isWaiting=!1,e._waitTimer&&util.clearTimeout(_assertThisInitialized$4(e),e._waitTimer),e._waittTimer&&util.clearTimeout(_assertThisInitialized$4(e),e._waittTimer),e._waitTimer=null,e._waittTimer=null,e._waitType=0})),_defineProperty$5(_assertThisInitialized$4(e),"_onSeeking",(function(){e.seekingStart||(e.suspendWaitingStatus("seek"),e.seekingStart=now$2(),e.emitLog(LOG_TYPES$1.SEEK_START,{start:now$2()}))})),_defineProperty$5(_assertThisInitialized$4(e),"_onSeeked",(function(){e.suspendSeekingStatus("seeked")})),_defineProperty$5(_assertThisInitialized$4(e),"_onWaitingLoadStart",(function(){e._isWaiting||e.vt||(e._isWaiting=!0,e.waitingStart=now$2(),e.fixedWaitingStart=now$2(),e._waitType=1,e.emitLog(LOG_TYPES$1.WAIT_START,{fixedStart:e.fixedWaitingStart,start:e.waitingStart,type:1,endType:"loadstart"}))})),_defineProperty$5(_assertThisInitialized$4(e),"_onWaiting",(function(){!e._isWaiting&&e.vt&&(e._isWaiting=!0,e.vt?e.seekingStart?e._waitType=2:e._waitType=0:e._waitType=1,e.fixedWaitingStart=now$2(),e._waitTimer=util.setTimeout(_assertThisInitialized$4(e),(function(){e._isWaiting&&(e.waitingStart=now$2(),util.clearTimeout(_assertThisInitialized$4(e),e._waitTimer),e._waitTimer=null,e._startWaitTimeout(),e.emitLog(LOG_TYPES$1.WAIT_START,{fixedStart:e.fixedWaitingStart,start:e.waitingStart,type:e._waitType,endType:2===e._waitType?"seek":"playing"}))}),200))})),_defineProperty$5(_assertThisInitialized$4(e),"_onError",(function(){e.suspendSeekingStatus("error"),e.suspendWaitingStatus("error")})),_defineProperty$5(_assertThisInitialized$4(e),"_onPlaying",(function(){e._isWaiting&&e.suspendWaitingStatus("playing")})),e}return _createClass$5(r,[{key:"afterCreate",value:function(){var e=this;this._onReset(),this._waitType="firstFrame",this._initOnceEvents(),this.newPointTime=now$2(),this.loadedCostTime=0,this.startCostTime=0,this.on(LOAD_START,(function(){var t=e._state,r=t.autoplayStart,i=t.isFFSend;e.startCostTime=now$2()-e.newPointTime,XG_DEBUG.logInfo("[xgLogger]".concat(e.player.playerId," LOAD_START"),"autoplayStart:".concat(r," isFFSend:").concat(i," startCostTime:").concat(e.startCostTime," newPointTime").concat(e.newPointTime)),i||(!t.isLs&&e.emitLog(LOG_TYPES$1.LOAD_START,{}),t.isLs=!0,t.isTimeUpdate=!1,t.isFFLoading=!0,e.pt=now$2(),e.vt=0,e.fvt=0,e._initOnceEvents(),e._onWaitingLoadStart())})),this.on(LOADED_DATA,(function(){e.vt=now$2(),e.fvt=e.vt-e.pt,e.loadedCostTime=e.vt-e.newPointTime;var t=e._state,r=t.isTimeUpdate,i=t.isFFSend,n=t.autoplayStart;XG_DEBUG.logInfo("[xgLogger]".concat(e.player.playerId," LOADED_DATA"),"fvt:".concat(e.fvt," isTimeUpdate:").concat(e._state.isTimeUpdate," loadedCostTime:").concat(e.loadedCostTime)),(r||n)&&e._sendFF("loadedData"),i||e.emitLog(LOG_TYPES$1.LOADED_DATA,{}),e.suspendWaitingStatus("loadeddata")})),this.on(SEEKING,this._onSeeking),this.on(SEEKED,this._onSeeked),this.on(DESTROY,(function(){e.endState("destroy")})),this.on(URL_CHANGE,(function(){e.endState("urlChange"),XG_DEBUG.logInfo("[xgLogger]".concat(e.player.playerId," URL_CHANGE")),e._state.isFFSend&&e._onReset()})),this.on([PLAYING,CANPLAY],this._onPlaying),this.on(WAITING,this._onWaiting),this.on(ERROR$1,this._onError),this.on(RESET,(function(){XG_DEBUG.logInfo("[xgLogger]".concat(e.player.playerId," RESET")),e.endState("reset"),e._initOnceEvents(),e._onReset()}))}},{key:"_initOnceEvents",value:function(){this.off(AUTOPLAY_STARTED,this._onAutoplayStart),this.off(TIME_UPDATE,this._onTimeupdate),this.once(AUTOPLAY_STARTED,this._onAutoplayStart),this.once(TIME_UPDATE,this._onTimeupdate)}},{key:"_sendFF",value:function(e){this.s=now$2();var t=this._state,r=t.isFFLoading,i=t.isFFSend;XG_DEBUG.logInfo("[xgLogger]".concat(this.player.playerId," _sendFF"),"".concat(e," fvt:").concat(this.fvt," isFFLoading:").concat(r," !isFFSend:").concat(!i)),this.vt>0&&r&&!i&&(XG_DEBUG.logInfo("[xgLogger]".concat(this.player.playerId," emitLog_firstFrame"),e),this._state.isFFLoading=!1,this._state.isFFSend=!0,this.emitLog(LOG_TYPES$1.FIRST_FRAME,{fvt:this.fvt,costTime:this.fvt,vt:this.vt,startCostTime:this.startCostTime,loadedCostTime:this.loadedCostTime}))}},{key:"_startWaitTimeout",value:function(){var e=this;this._waittTimer&&util.clearTimeout(this,this._waittTimer),this._waittTimer=util.setTimeout(this,(function(){e.suspendWaitingStatus("timeout"),util.clearTimeout(e,e._waittTimer),e._waittTimer=null}),this.config.waitTimeout)}},{key:"endState",value:function(e){this.suspendWaitingStatus(e),this.suspendSeekingStatus(e)}},{key:"suspendSeekingStatus",value:function(e){if(this.seekingStart){var t=now$2(),r=t-this.seekingStart;this.seekingStart=0,this.emitLog(LOG_TYPES$1.SEEK_END,{end:t,costTime:r,endType:e})}}},{key:"suspendWaitingStatus",value:function(e){if(this._waitTimer&&(util.clearTimeout(this,this._waitTimer),this._waitTimer=null),this._waittTimer&&(util.clearTimeout(this,this._waittTimer),this._waittTimer=null),this._isWaiting=!1,this.waitingStart){var t=now$2(),r=t-this.waitingStart,i=t-this.fixedWaitingStart,n=this.config.waitTimeout;this._isWaiting=!1,this.waitingStart=0,this.fixedWaitingStart=0,this.emitLog(LOG_TYPES$1.WAIT_END,{fixedCostTime:i>n?n:i,costTime:r>n?n:r,type:"loadeddata"===e?1:this._waitType,endType:2===this._waitType?"seek":e})}}},{key:"emitLog",value:function(e,t){var r=this.player;this.emit(XGLOG,_objectSpread2$4({t:now$2(),host:util.getHostFromUrl(r.currentSrc),vtype:r.vtype,eventType:e,currentTime:this.player.currentTime,readyState:r.video.readyState,networkState:r.video.networkState},t))}}],[{key:"pluginName",get:function(){return"xgLogger"}},{key:"defaultConfig",get:function(){return{waitTimeout:1e4}}}]),r}(Plugin);function ReplaySvg(){return(new DOMParser).parseFromString('<svg class="xgplayer-replay-svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 78 78" width="78" height="78">\n <path fill="#fff" transform="translate(20, 20)" d="M8.22708362,13.8757234 L11.2677371,12.6472196 C11.7798067,12.4403301 12.3626381,12.6877273 12.5695276,13.1997969 L12.9441342,14.1269807 C13.1510237,14.6390502 12.9036264,15.2218816 12.3915569,15.4287712 L6.8284538,17.6764107 L5.90126995,18.0510173 C5.38920044,18.2579068 4.80636901,18.0105096 4.5994795,17.49844 L1.97723335,11.0081531 C1.77034384,10.4960836 2.0177411,9.91325213 2.52981061,9.70636262 L3.45699446,9.33175602 C3.96906396,9.12486652 4.5518954,9.37226378 4.75878491,9.88433329 L5.67885163,12.1615783 C7.99551726,6.6766934 13.3983951,3 19.5,3 C27.7842712,3 34.5,9.71572875 34.5,18 C34.5,26.2842712 27.7842712,33 19.5,33 C15.4573596,33 11.6658607,31.3912946 8.87004692,28.5831991 C8.28554571,27.9961303 8.28762719,27.0463851 8.87469603,26.4618839 C9.46176488,25.8773827 10.4115101,25.8794641 10.9960113,26.466533 C13.2344327,28.7147875 16.263503,30 19.5,30 C26.127417,30 31.5,24.627417 31.5,18 C31.5,11.372583 26.127417,6 19.5,6 C14.4183772,6 9.94214483,9.18783811 8.22708362,13.8757234 Z"></path>\n</svg>\n',"image/svg+xml").firstChild}var Replay=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(){return _classCallCheck$4(this,r),t.apply(this,arguments)}return _createClass$5(r,[{key:"registerIcons",value:function(){return{replay:ReplaySvg}}},{key:"afterCreate",value:function(){var e=this;Plugin.insert(this.icons.replay,this.root,0),this.__handleReplay=this.hook("replayClick",(function(){e.player.replay()}),{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.bind(".xgplayer-replay",["click","touchend"],this.__handleReplay),this.on(ENDED,(function(){if(e.playerConfig.loop||util.addClass(e.player.root,"replay"),!e.config.disable){e.show();var t=e.root.querySelector("path");if(t){var r=window.getComputedStyle(t).getPropertyValue("transform");if("string"==typeof r&&r.indexOf("none")>-1)return null;t.setAttribute("transform",r)}}})),this.on(PLAY,(function(){e.hide()}))}},{key:"handleReplay",value:function(e){e.preventDefault(),e.stopPropagation(),this.player.replay(),util.removeClass(this.player.root,"replay")}},{key:"show",value:function(){this.config.disable||(this.root.style.display="flex")}},{key:"enable",value:function(){this.config.disable=!1}},{key:"disable",value:function(){this.config.disable=!0,this.hide()}},{key:"destroy",value:function(){this.unbind(".xgplayer-replay",["click","touchend"],this.__handleReplay)}},{key:"render",value:function(){return'<xg-replay class="xgplayer-replay">\n <xg-replay-txt class="xgplayer-replay-txt" lang-key="'.concat(this.i18nKeys.REPLAY,'">').concat(this.i18n.REPLAY,"</xg-replay-txt>\n </xg-replay>")}}],[{key:"pluginName",get:function(){return"replay"}},{key:"defaultConfig",get:function(){return{disable:!1}}}]),r}(Plugin),Poster=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(){return _classCallCheck$4(this,r),t.apply(this,arguments)}return _createClass$5(r,[{key:"isEndedShow",get:function(){return this.config.isEndedShow},set:function(e){this.config.isEndedShow=e}},{key:"hide",value:function(){util.addClass(this.root,"hide")}},{key:"show",value:function(){util.removeClass(this.root,"hide")}},{key:"beforeCreate",value:function(e){"string"==typeof e.player.config.poster&&(e.config.poster=e.player.config.poster)}},{key:"afterCreate",value:function(){var e=this;this.on(ENDED,(function(){e.isEndedShow&&util.removeClass(e.root,"hide")})),this.config.hideCanplay?(this.once(TIME_UPDATE,(function(){e.onTimeUpdate()})),this.on(URL_CHANGE,(function(){util.removeClass(e.root,"hide"),util.addClass(e.root,"xg-showplay"),e.once(TIME_UPDATE,(function(){e.onTimeUpdate()}))}))):this.on(PLAY,(function(){util.addClass(e.root,"hide")}))}},{key:"onTimeUpdate",value:function(){var e=this;this.player.currentTime?util.removeClass(this.root,"xg-showplay"):this.once(TIME_UPDATE,(function(){e.onTimeUpdate()}))}},{key:"update",value:function(e){e&&(this.config.poster=e,this.root.style.backgroundImage="url(".concat(e,")"))}},{key:"render",value:function(){var e=this.config,t=e.poster,r=e.hideCanplay,i=t?"background-image:url(".concat(t,");"):"";return'<xg-poster class="xgplayer-poster '.concat(r?"xg-showplay":"",'" style="').concat(i,'">\n </xg-poster>')}}],[{key:"pluginName",get:function(){return"poster"}},{key:"defaultConfig",get:function(){return{isEndedShow:!0,hideCanplay:!1,poster:""}}}]),r}(Plugin);function PlaySvg(){return(new DOMParser).parseFromString('<svg class="play" xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="3 -4 28 40">\n <path fill="#fff" transform="scale(0.0320625 0.0320625)" d="M576,363L810,512L576,661zM342,214L576,363L576,661L342,810z"></path>\n</svg>\n',"image/svg+xml").firstChild}function PauseSvg(){return(new DOMParser).parseFromString('<svg class="pause" xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="3 -4 28 40">\n <path fill="#fff" transform="scale(0.0320625 0.0320625)" d="M598,214h170v596h-170v-596zM256 810v-596h170v596h-170z"></path>\n</svg>\n',"image/svg+xml").firstChild}var AnimateMap={};function addAnimate(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{start:null,end:null};return AnimateMap[e]&&window.clearTimeout(AnimateMap[e].id),AnimateMap[e]={},r.start&&r.start(),AnimateMap[e].id=window.setTimeout((function(){r.end&&r.end(),window.clearTimeout(AnimateMap[e].id),delete AnimateMap[e]}),t),AnimateMap[e].id}function clearAnimation(e){e?window.clearTimeout(e):Object.keys(AnimateMap).map((function(e){window.clearTimeout(AnimateMap[e].id),delete AnimateMap[e]}))}var Start=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(e){var i;return _classCallCheck$4(this,r),_defineProperty$5(_assertThisInitialized$4(i=t.call(this,e)),"onPlayerReset",(function(){i.autoPlayStart=!1;var e="auto"===i.config.mode?"auto-hide":"hide";i.setAttr("data-state","play"),util.removeClass(i.root,e),i.show()})),_defineProperty$5(_assertThisInitialized$4(i),"onAutoplayStart",(function(){if(!i.autoPlayStart){var e="auto"===i.config.mode?"auto-hide":"hide";util.addClass(i.root,e),i.autoPlayStart=!0,i.onPlayPause("play")}})),i.autoPlayStart=!1,i}return _createClass$5(r,[{key:"afterCreate",value:function(){var e=this,t=this.player,r=this.playerConfig;this.initIcons(),this.once(READY,(function(){r&&(r.lang&&"en"===r.lang?util.addClass(t.root,"lang-is-en"):"jp"===r.lang&&util.addClass(t.root,"lang-is-jp"))})),this.on(AUTOPLAY_STARTED,this.onAutoplayStart),r.autoplay||this.show(),this.on(AUTOPLAY_PREVENTED,(function(){var t="auto"===e.config.mode?"auto-hide":"hide";e.setAttr("data-state","play"),util.removeClass(e.root,t),e.show()})),this.on(PLAY,(function(){e.onPlayPause("play")})),this.on(PAUSE,(function(){e.onPlayPause("pause")})),this.on(RESET,(function(){e.onPlayerReset()})),this.clickHandler=this.hook("startClick",this.switchPausePlay,{pre:function(t){t.cancelable&&t.preventDefault(),t.stopPropagation();var r=e.player.paused;e.emitUserAction(t,"switch_play_pause",{props:"paused",from:r,to:!r})}}),this.bind(["click","touchend"],this.clickHandler)}},{key:"registerIcons",value:function(){return{startPlay:{icon:PlaySvg,class:"xg-icon-play"},startPause:{icon:PauseSvg,class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild("xg-start-inner",e.startPlay),this.appendChild("xg-start-inner",e.startPause)}},{key:"hide",value:function(){util.addClass(this.root,"hide")}},{key:"show",value:function(){util.removeClass(this.root,"hide")}},{key:"focusHide",value:function(){util.addClass(this.root,"focus-hide")}},{key:"recover",value:function(){util.removeClass(this.root,"focus-hide")}},{key:"switchStatus",value:function(e){e?this.setAttr("data-state",this.player.paused?"pause":"play"):this.setAttr("data-state",this.player.paused?"play":"pause")}},{key:"animate",value:function(e){var t=this;this._animateId=addAnimate("pauseplay",400,{start:function(){util.addClass(t.root,"interact"),t.show(),t.switchStatus(!0)},end:function(){util.removeClass(t.root,"interact"),!e&&t.hide(),t._animateId=null}})}},{key:"endAnimate",value:function(){util.removeClass(this.root,"interact"),clearAnimation(this._animateId),this._animateId=null}},{key:"switchPausePlay",value:function(e){var t=this.player;(e.cancelable&&e.preventDefault(),e.stopPropagation(),t.state<STATES.READY)||(this.player.paused||t.state!==STATES.RUNNING?t.play():t.pause())}},{key:"onPlayPause",value:function(e){var t=this.config,r=this.player;if(r&&!(r.state<STATES.RUNNING)&&this.autoPlayStart){if("show"===t.mode)return this.switchStatus(),void this.show();if("auto"!==t.mode){if(t.isShowPause&&r.paused&&!r.ended||t.isShowEnd&&r.ended)return this.switchStatus(),this.show(),void this.endAnimate();if(t.disableAnimate)return this.switchStatus(),void this.hide();if("play"===e)this.autoPlayStart?this.animate():this.hide();else{if(!this.autoPlayStart||r.ended)return;this.animate()}}else this.switchStatus()}}},{key:"destroy",value:function(){this.unbind(["click","touchend"],this.clickHandler),clearAnimation(this._animateId)}},{key:"render",value:function(){var e=this.playerConfig.autoplay?"auto"===this.config.mode?"auto-hide":"hide":"";return'\n <xg-start class="xgplayer-start '.concat(e,'">\n <xg-start-inner></xg-start-inner>\n </xg-start>')}}],[{key:"pluginName",get:function(){return"start"}},{key:"defaultConfig",get:function(){return{isShowPause:!1,isShowEnd:!1,disableAnimate:!1,mode:"hide"}}}]),r}(Plugin),Enter=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(){return _classCallCheck$4(this,r),t.apply(this,arguments)}return _createClass$5(r,[{key:"render",value:function(){var e=this.config.innerHtml,t=util.createDom("xg-enter","",{},"xgplayer-enter");if(e&&e instanceof window.HTMLElement)t.appendChild(e);else if(e&&"string"==typeof e)t.innerHTML=e;else{for(var r="",i=1;i<=12;i++)r+='<div class="xgplayer-enter-bar'.concat(i,'"></div>');t.innerHTML='<div class="xgplayer-enter-spinner">'.concat(r,"</div>")}return t}}],[{key:"pluginName",get:function(){return"enter"}},{key:"defaultConfig",get:function(){return{innerHtml:"",logo:""}}}]),r}(Plugin);function xgIconTips(e,t,r){try{return' <div class="xg-tips '.concat(r?"hide":" ",'" lang-key="').concat(e.i18nKeys[t],'">\n ').concat(e.i18n[t],"\n </div>")}catch(e2){return'<div class="xg-tips hide"></div>'}}var MiniScreenIcon=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(){return _classCallCheck$4(this,r),t.apply(this,arguments)}return _createClass$5(r,[{key:"afterCreate",value:function(){this.getMini=this.getMini.bind(this),this.exitMini=this.exitMini.bind(this),this.bind("click",this.getMini)}},{key:"getMini",value:function(){this.config.onClick&&this.config.onClick()}},{key:"exitMini",value:function(){this.config.onClick&&this.config.onClick()}},{key:"destroy",value:function(){this.unbind(["click","touchend"],this.getMini)}},{key:"render",value:function(){var e="MINISCREEN";return'\n <xg-icon class="xgplayer-miniicon">\n <div class="xgplayer-icon btn-text"><span class="icon-text" lang-key="'.concat(this.i18nKeys[e],'">').concat(this.i18n[e],"</span></div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"miniscreenIcon"}},{key:"defaultConfig",get:function(){return{position:POSITIONS$a.CONTROLS_RIGHT,index:10}}}]),r}(Plugin);function getStyleSize(e){var t=parseFloat(e);return-1===e.indexOf("%")&&!Number.isNaN(t)&&t}var measurements=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],measurementsLength=measurements.length;function getZeroSize(){for(var e={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},t=0;t<measurementsLength;t++){e[measurements[t]]=0}return e}function getStyle(e){return window.getComputedStyle(e)}function getSize(e){if("string"==typeof e&&(e=document.querySelector(e)),e&&"object"===_typeof$3(e)&&e.nodeType){var t=getStyle(e);if("none"===t.display)return getZeroSize();var r={};r.width=e.offsetWidth,r.height=e.offsetHeight;for(var i=r.isBorderBox="border-box"===t.boxSizing,n=0;n<measurementsLength;n++){var o=measurements[n],a=t[o],s=parseFloat(a);r[o]=Number.isNaN(s)?0:s}var l=r.paddingLeft+r.paddingRight,c=r.paddingTop+r.paddingBottom,u=r.marginLeft+r.marginRight,h=r.marginTop+r.marginBottom,d=r.borderLeftWidth+r.borderRightWidth,p=r.borderTopWidth+r.borderBottomWidth,f=i,g=getStyleSize(t.width);!1!==g&&(r.width=g+(f?0:l+d));var y=getStyleSize(t.height);return!1!==y&&(r.height=y+(f?0:c+p)),r.innerWidth=r.width-(l+d),r.innerHeight=r.height-(c+p),r.outerWidth=r.width+u,r.outerHeight=r.height+h,r}}function getTouch$1(e,t){for(var r=0;r<e.length;r++){var i=e[r];if(i.identifier===t)return i}}var EVENTS$3={START:"dragStart",MOVE:"dragMove",ENDED:"dragEnded"},POST_START_EVENTS={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]},Draggabilly=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return _classCallCheck$4(this,r),(i=t.call(this)).isEnabled=!0,i.isDragging=!1,i.isDown=!1,i.position={},i.downPoint={},i.dragPoint={x:0,y:0},i.startPos={x:0,y:0},i._root=e instanceof Element?e:document.querySelector(e),i._handlerDom=n.handle instanceof Element?n.handle:document.querySelector(n.handle),i._root&&i._handlerDom?(i._bindStartEvent(),i):_possibleConstructorReturn$4(i)}return _createClass$5(r,[{key:"_bindStartEvent",value:function(){var e=this;"ontouchstart"in window?this._startKey="touchstart":this._startKey="mousedown",this["on".concat(this._startKey)]=this["on".concat(this._startKey)].bind(this),this._handlerDom.addEventListener(this._startKey,this["on".concat(this._startKey)]),POST_START_EVENTS[this._startKey].map((function(t){e["on".concat(t)]=e["on".concat(t)].bind(e)}))}},{key:"_unbindStartEvent",value:function(){this._handlerDom.removeEventListener(this._startKey,this["on".concat(this._startKey)])}},{key:"_bindPostStartEvents",value:function(e){var t=this;if(e){var r=POST_START_EVENTS[this._startKey];r.map((function(e){window.addEventListener(e,t["on".concat(e)])})),this._boundPointerEvents=r}}},{key:"_unbindPostStartEvents",value:function(){var e=this;this._boundPointerEvents&&(this._boundPointerEvents.map((function(t){window.removeEventListener(t,e["on".concat(t)])})),delete this._boundPointerEvents)}},{key:"enable",value:function(){this.isEnabled=!0}},{key:"disable",value:function(){this.isEnabled=!1,this.isDragging&&this.onUp()}},{key:"onDocUp",value:function(e){this.onUp()}},{key:"animate",value:function(){var e=this;this.isDragging&&(this.positionDrag(),window.requestAnimationFrame((function(){e.animate()})))}},{key:"positionDrag",value:function(){var e="translate3d(".concat(this.dragPoint.x,"px, ").concat(this.dragPoint.y,"px, 0)");this._root.style.transform=e,this._root.style.webKitTransform=e}},{key:"setLeftTop",value:function(){this._root.style.left=this.position.x+"px",this._root.style.top=this.position.y+"px"}},{key:"onmousedown",value:function(e){this.dragStart(e,e)}},{key:"onmousemove",value:function(e){this.dragMove(e,e)}},{key:"onmouseup",value:function(e){this.dragEnd(e,e)}},{key:"ontouchstart",value:function(e){var t=e.changedTouches[0];this.dragStart(e,t),this.touchIdentifier=void 0!==t.pointerId?t.pointerId:t.identifier,e.preventDefault()}},{key:"ontouchmove",value:function(e){var t=getTouch$1(e.changedTouches,this.touchIdentifier);t&&this.dragMove(e,t)}},{key:"ontouchend",value:function(e){var t=getTouch$1(e.changedTouches,this.touchIdentifier);t&&this.dragEnd(e,t),e.preventDefault()}},{key:"ontouchcancel",value:function(e){var t=getTouch$1(e.changedTouches,this.touchIdentifier);t&&this.dragCancel(e,t)}},{key:"dragStart",value:function(e,t){if(this._root&&!this.isDown&&this.isEnabled){this.downPoint=t,this.dragPoint.x=0,this.dragPoint.y=0,this._getPosition();var r=getSize(this._root);this.startPos.x=this.position.x,this.startPos.y=this.position.y,this.startPos.maxY=window.innerHeight-r.height,this.startPos.maxX=window.innerWidth-r.width,this.setLeftTop(),this.isDown=!0,this._bindPostStartEvents(e)}}},{key:"dragRealStart",value:function(e,t){this.isDragging=!0,this.animate(),this.emit(EVENTS$3.START,this.startPos)}},{key:"dragEnd",value:function(e,t){this._root&&(this._unbindPostStartEvents(),this.isDragging&&(this._root.style.transform="",this.setLeftTop(),this.emit(EVENTS$3.ENDED)),this.presetInfo())}},{key:"_dragPointerMove",value:function(e,t){var r={x:t.pageX-this.downPoint.pageX,y:t.pageY-this.downPoint.pageY};return!this.isDragging&&this.hasDragStarted(r)&&this.dragRealStart(e,t),r}},{key:"dragMove",value:function(e,t){if(e=e||window.event,this.isDown){var r=this.startPos,i=r.x,n=r.y,o=this._dragPointerMove(e,t),a=o.x,s=o.y;a=this.checkContain("x",a,i),s=this.checkContain("y",s,n),this.position.x=i+a,this.position.y=n+s,this.dragPoint.x=a,this.dragPoint.y=s,this.emit(EVENTS$3.MOVE,this.position)}}},{key:"dragCancel",value:function(e,t){this.dragEnd(e,t)}},{key:"presetInfo",value:function(){this.isDragging=!1,this.startPos={x:0,y:0},this.dragPoint={x:0,y:0},this.isDown=!1}},{key:"destroy",value:function(){this._unbindStartEvent(),this._unbindPostStartEvents(),this.isDragging&&this.dragEnd(),this.removeAllListeners(),this._handlerDom=null}},{key:"hasDragStarted",value:function(e){return Math.abs(e.x)>3||Math.abs(e.y)>3}},{key:"checkContain",value:function(e,t,r){return t+r<0?0-r:"x"===e&&t+r>this.startPos.maxX?this.startPos.maxX-r:"y"===e&&t+r>this.startPos.maxY?this.startPos.maxY-r:t}},{key:"_getPosition",value:function(){var e=window.getComputedStyle(this._root),t=this._getPositionCoord(e.left,"width"),r=this._getPositionCoord(e.top,"height");this.position.x=Number.isNaN(t)?0:t,this.position.y=Number.isNaN(r)?0:r,this._addTransformPosition(e)}},{key:"_addTransformPosition",value:function(e){var t=e.transform;if(0===t.indexOf("matrix")){var r=t.split(","),i=0===t.indexOf("matrix3d")?12:4,n=parseInt(r[i],10),o=parseInt(r[i+1],10);this.position.x+=n,this.position.y+=o}}},{key:"_getPositionCoord",value:function(e,t){if(-1!==e.indexOf("%")){var r=getSize(this._root.parentNode);return r?parseFloat(e)/100*r[t]:0}return parseInt(e,10)}}]),r}(EventEmitter),MiniScreen=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(e){var i;_classCallCheck$4(this,r),_defineProperty$5(_assertThisInitialized$4(i=t.call(this,e)),"onCancelClick",(function(e){i.exitMini(),i.isClose=!0})),_defineProperty$5(_assertThisInitialized$4(i),"onCenterClick",(function(e){var t=_assertThisInitialized$4(i).player;t.paused?t.play():t.pause()})),_defineProperty$5(_assertThisInitialized$4(i),"onScroll",(function(e){if(!(!window.scrollY&&0!==window.scrollY||Math.abs(window.scrollY-i.pos.scrollY)<50)){var t=parseInt(util.getCss(i.player.root,"height"));t+=i.config.scrollTop,i.pos.scrollY=window.scrollY,window.scrollY>t+5?!i.isMini&&!i.isClose&&i.getMini():window.scrollY<=t&&(i.isMini&&i.exitMini(),i.isClose=!1)}})),i.isMini=!1,i.isClose=!1;var n=_assertThisInitialized$4(i).config;return i.pos={left:n.left<0?window.innerWidth-n.width-20:n.left,top:n.top<0?window.innerHeight-n.height-20:n.top,height:i.config.height,width:i.config.width,scrollY:window.scrollY||0},i.lastStyle=null,i}return _createClass$5(r,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.mini&&(e.config.isShowIcon=e.player.config.mini)}},{key:"afterCreate",value:function(){var e=this;this.initIcons(),this.on(PAUSE,(function(){e.setAttr("data-state","pause")})),this.on(PLAY,(function(){e.setAttr("data-state","play")}))}},{key:"onPluginsReady",value:function(){var e=this,t=this.player;if(!this.config.disable){if(this.config.isShowIcon){var r={config:{onClick:function(){e.getMini()}}};t.controls.registerPlugin(MiniScreenIcon,r,MiniScreenIcon.pluginName)}var i=util.checkTouchSupport()?"touchend":"click";this.bind(".mini-cancel-btn",i,this.onCancelClick),this.bind(".play-icon",i,this.onCenterClick),this.config.disableDrag||(this._draggabilly=new Draggabilly(this.player.root,{handle:this.root})),this.config.isScrollSwitch&&window.addEventListener("scroll",this.onScroll)}}},{key:"registerIcons",value:function(){return{play:{icon:PlaySvg,class:"xg-icon-play"},pause:{icon:PauseSvg,class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".play-icon",e.play),this.appendChild(".play-icon",e.pause)}},{key:"getMini",value:function(){var e=this;if(!this.isMini){var t=this.player,r=this.playerConfig,i=this.config.target||this.player.root;this.lastStyle={},util.addClass(t.root,"xgplayer-mini"),["width","height","top","left"].map((function(t){e.lastStyle[t]=i.style[t],i.style[t]="".concat(e.pos[t],"px")})),r.fluid&&(i.style["padding-top"]=""),this.emit(MINI_STATE_CHANGE,!0),t.isMini=this.isMini=!0}}},{key:"exitMini",value:function(){var e=this;if(!this.isMini)return!1;var t=this.player,r=this.playerConfig,i=this.config.target||this.player.root;util.removeClass(t.root,"xgplayer-mini"),this.lastStyle&&Object.keys(this.lastStyle).map((function(t){i.style[t]=e.lastStyle[t]})),this.lastStyle=null,r.fluid&&(t.root.style.width="100%",t.root.style.height="0",t.root.style["padding-top"]="".concat(100*r.height/r.width,"%")),this.emit(MINI_STATE_CHANGE,!1),this.isMini=t.isMini=!1}},{key:"destroy",value:function(){window.removeEventListener("scroll",this.onScroll);var e=util.checkTouchSupport()?"touchend":"click";this.unbind(".mini-cancel-btn",e,this.onCancelClick),this.unbind(".play-icon",e,this.onCenterClick),this._draggabilly&&this._draggabilly.destroy(),this._draggabilly=null,this.exitMini()}},{key:"render",value:function(){if(!this.config.disable)return'\n <xg-mini-layer class="xg-mini-layer">\n <xg-mini-header class="xgplayer-mini-header">\n '.concat(xgIconTips(this,"MINI_DRAG",this.playerConfig.isHideTips),'\n </xg-mini-header>\n <div class="mini-cancel-btn">\n <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">\n <path fill="#fff" fill-rule="evenodd" d="M3.99 3.49a1 1 0 0 1 1.414 0L10 8.085l4.596-4.595a1 1 0 1 1 1.414 1.414L11.414 9.5l4.596 4.596a1 1 0 0 1 .084 1.32l-.084.094a1 1 0 0 1-1.414 0L10 10.914 5.404 15.51a1 1 0 0 1-1.414-1.414L8.585 9.5 3.99 4.904a1 1 0 0 1-.084-1.32z"></path>\n </svg>\n </div>\n <div class="play-icon">\n </div>\n </xg-mini-layer>')}}],[{key:"pluginName",get:function(){return"miniscreen"}},{key:"defaultConfig",get:function(){return{index:10,disable:!1,width:320,height:180,left:-1,top:-1,isShowIcon:!1,isScrollSwitch:!1,scrollTop:0,disableDrag:!1}}}]),r}(Plugin),MOUSE_EVENTS={mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousemove:"onMouseMove"},HOOKS$1=["videoClick","videoDbClick"],PCPlugin=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(){var e;_classCallCheck$4(this,r);for(var i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];return _defineProperty$5(_assertThisInitialized$4(e=t.call.apply(t,[this].concat(n))),"onMouseMove",(function(t){var r=_assertThisInitialized$4(e),i=r.player,n=r.playerConfig;i.isActive||(i.focus({autoHide:!n.closeDelayBlur}),!n.closeFocusVideoFocus&&i.media.focus())})),_defineProperty$5(_assertThisInitialized$4(e),"onMouseEnter",(function(t){var r=_assertThisInitialized$4(e),i=r.playerConfig,n=r.player;!i.closeFocusVideoFocus&&n.media.focus(),i.closeDelayBlur?n.focus({autoHide:!1}):n.focus()})),_defineProperty$5(_assertThisInitialized$4(e),"onMouseLeave",(function(t){var r=e.playerConfig,i=r.closePlayerBlur,n=r.leavePlayerTime,o=r.closeDelayBlur;i||o||(n?e.player.focus({autoHide:!0,delay:n}):e.player.blur())})),_defineProperty$5(_assertThisInitialized$4(e),"onVideoClick",(function(t){var r=_assertThisInitialized$4(e),i=r.player,n=r.playerConfig;t.target&&n.closeVideoClick||t.target!==i.root&&t.target!==i.media&&t.target!==i.innerContainer&&t.target!==i.media.__canvas||(t.preventDefault(),n.closeVideoStopPropagation||t.stopPropagation(),e._clickCount++,e.clickTimer&&(clearTimeout(e.clickTimer),e.clickTimer=null),e.clickTimer=setTimeout((function(){e._clickCount&&(e._clickCount--,runHooks(_assertThisInitialized$4(e),HOOKS$1[0],(function(t,r){e.switchPlayPause(r.e)}),{e:t,paused:i.paused}),clearTimeout(e.clickTimer),e.clickTimer=null)}),300))})),_defineProperty$5(_assertThisInitialized$4(e),"onVideoDblClick",(function(t){var r=_assertThisInitialized$4(e),i=r.player,n=r.playerConfig;n.closeVideoDblclick||!t.target||t.target!==i.media&&t.target!==i.media.__canvas||(!n.closeVideoClick&&e._clickCount<2?e._clickCount=0:(e._clickCount=0,e.clickTimer&&(clearTimeout(e.clickTimer),e.clickTimer=null),t.preventDefault(),t.stopPropagation(),runHooks(_assertThisInitialized$4(e),HOOKS$1[1],(function(t,r){e.emitUserAction(r.e,"switch_fullscreen",{props:"fullscreen",from:i.fullscreen,to:!i.fullscreen}),i.fullscreen?i.exitFullscreen():i.getFullscreen()}),{e:t,fullscreen:i.fullscreen})))})),e}return _createClass$5(r,[{key:"afterCreate",value:function(){var e=this;this._clickCount=0,HOOKS$1.map((function(t){e.__hooks[t]=null})),"mobile"===this.playerConfig.isMobileSimulateMode||"mobile"===sniffer$1.device&&!sniffer$1.os.isIpad||this.initEvents()}},{key:"initEvents",value:function(){var e=this,t=this.player,r=t.video,i=t.root,n=this.playerConfig.enableContextmenu;i&&i.addEventListener("click",this.onVideoClick,!1),i&&i.addEventListener("dblclick",this.onVideoDblClick,!1),Object.keys(MOUSE_EVENTS).map((function(t){i.addEventListener(t,e[MOUSE_EVENTS[t]],!1)})),n&&r&&r.addEventListener("contextmenu",this.onContextmenu,!1)}},{key:"switchPlayPause",value:function(e){var t=this.player;this.emitUserAction(e,"switch_play_pause",{props:"paused",from:t.paused,to:!t.paused}),t.ended?t.duration!==1/0&&t.duration>0&&t.replay():t.paused?t.play():t.pause()}},{key:"onContextmenu",value:function(e){(e=e||window.event).preventDefault&&e.preventDefault(),e.stopPropagation?e.stopPropagation():(e.returnValue=!1,e.cancelBubble=!0)}},{key:"destroy",value:function(){var e=this,t=this.player,r=t.video,i=t.root;this.clickTimer&&clearTimeout(this.clickTimer),i.removeEventListener("click",this.onVideoClick,!1),i.removeEventListener("dblclick",this.onVideoDblClick,!1),r.removeEventListener("contextmenu",this.onContextmenu,!1),Object.keys(MOUSE_EVENTS).map((function(t){i.removeEventListener(t,e[MOUSE_EVENTS[t]],!1)}))}}],[{key:"pluginName",get:function(){return"pc"}},{key:"defaultConfig",get:function(){return{}}}]),r}(BasePlugin),EVENTS$2={PRESS:"press",PRESS_END:"pressend",DOUBlE_CLICK:"doubleclick",CLICK:"click",TOUCH_MOVE:"touchmove",TOUCH_START:"touchstart",TOUCH_END:"touchend"},TOUCHS={start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},MOUSES={start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseleave"};function getTouch(e){return e&&e.length>0?e[e.length-1]:null}function getDefaultConfig(){return{pressDelay:600,dbClickDelay:200,disablePress:!1,disableDbClick:!1,miniStep:2,needPreventDefault:!0}}var Touche=function(){function e(t){var r=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{eventType:"touch"};_classCallCheck$4(this,e),this._pos={moving:!1,start:!1,x:0,y:0},this.config=getDefaultConfig(),Object.keys(i).map((function(e){r.config[e]=i[e]})),this.root=t,this.events="mouse"===i.eventType?MOUSES:TOUCHS,this.pressIntrvalId=null,this.dbIntrvalId=null,this.__handlers={},this._initEvent()}return _createClass$5(e,[{key:"_initEvent",value:function(){this.onTouchStart=this.onTouchStart.bind(this),this.onTouchMove=this.onTouchMove.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this),this.onTouchCancel=this.onTouchCancel.bind(this),this.root.addEventListener(this.events.start,this.onTouchStart)}},{key:"__setPress",value:function(e){var t=this,r=this.config;this.pressIntrvalId&&this.__clearPress(),this.pressIntrvalId=setTimeout((function(){t.trigger(EVENTS$2.PRESS,e),t._pos.press=!0,t.__clearPress()}),r.pressDelay)}},{key:"__clearPress",value:function(){window.clearTimeout(this.pressIntrvalId),this.pressIntrvalId=null}},{key:"__setDb",value:function(e){var t=this,r=this.config;if(this.dbIntrvalId)return this.__clearDb(),void this.trigger(EVENTS$2.DOUBlE_CLICK,e);this.dbIntrvalId=setTimeout((function(){t.__clearDb(),t._pos.start||t._pos.press||t._pos.moving||t.trigger(EVENTS$2.CLICK,e)}),r.dbClickDelay)}},{key:"__clearDb",value:function(){clearTimeout(this.dbIntrvalId),this.dbIntrvalId=null}},{key:"on",value:function(e,t){this.__handlers[e]||(this.__handlers[e]=[]),this.__handlers[e].push(t)}},{key:"off",value:function(e,t){if(this.__handlers[e]){for(var r=this.__handlers[e],i=-1,n=0;n<r.length;n++)if(r[n]===t){i=n;break}i>=0&&this.__handlers[e].splice(i,1)}}},{key:"trigger",value:function(e,t){this.__handlers[e]&&this.__handlers[e].map((function(r){try{r(t)}catch(i){console.error("trigger>>:".concat(e),i)}}))}},{key:"onTouchStart",value:function(e){var t=this._pos,r=this.root,i=getTouch(e.touches);t.x=i?parseInt(i.pageX,10):e.pageX,t.y=i?parseInt(i.pageX,10):e.pageX,t.start=!0,this.__setPress(e),r.addEventListener(this.events.end,this.onTouchEnd),r.addEventListener(this.events.cancel,this.onTouchCancel),r.addEventListener(this.events.move,this.onTouchMove),this.trigger(EVENTS$2.TOUCH_START,e)}},{key:"onTouchCancel",value:function(e){this.onTouchEnd(e)}},{key:"onTouchEnd",value:function(e){var t=this._pos,r=this.root;this.__clearPress(),r.removeEventListener(this.events.cancel,this.onTouchCancel),r.removeEventListener(this.events.end,this.onTouchEnd),r.removeEventListener(this.events.move,this.onTouchMove),e.moving=t.moving,e.press=t.press,t.press&&this.trigger(EVENTS$2.PRESS_END,e),this.trigger(EVENTS$2.TOUCH_END,e),!t.press&&!t.moving&&this.__setDb(e),t.press=!1,t.start=!1,t.moving=!1}},{key:"onTouchMove",value:function(e){var t=this._pos,r=this.config,i=getTouch(e.touches),n=i?parseInt(i.pageX,10):e.pageX,o=i?parseInt(i.pageY,10):e.pageX,a=n-t.x,s=o-t.y;Math.abs(s)<r.miniStep&&Math.abs(a)<r.miniStep||(this.__clearPress(),t.press&&this.trigger(EVENTS$2.PRESS_END,e),t.press=!1,t.moving=!0,this.trigger(EVENTS$2.TOUCH_MOVE,e))}},{key:"destroy",value:function(){var e=this,t={touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"};Object.keys(t).map((function(r){e.root.removeEventListener("touchend",e[t[r]])}))}}]),e}();function SeekTipIcon(){return(new DOMParser).parseFromString('<svg width="20" height="9" viewBox="0 0 8 9" fill="none" xmlns="http://www.w3.org/2000/svg"\n xmlns:xlink="http://www.w3.org/1999/xlink">\n <path opacity="0.54"\n d="M7.5 3.63397C8.16667 4.01887 8.16667 4.98113 7.5 5.36603L1.5 8.83013C0.833334 9.21503 0 8.7339 0 7.9641L0 1.0359C0 0.266098 0.833333 -0.215027 1.5 0.169873L7.5 3.63397Z"\n fill="white" />\n <path transform="translate(5 0)" d="M7.5 3.63397C8.16667 4.01887 8.16667 4.98113 7.5 5.36603L1.5 8.83013C0.833334 9.21503 0 8.7339 0 7.9641L0 1.0359C0 0.266098 0.833333 -0.215027 1.5 0.169873L7.5 3.63397Z" fill="white"/>\n</svg>',"image/svg+xml").firstChild}var ACTIONS={AUTO:"auto",SEEKING:"seeking",PLAYBACK:"playbackrate",LIGHT:""},HOOKS=["videoClick","videoDbClick"],MobilePlugin=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(e){var i;return _classCallCheck$4(this,r),_defineProperty$5(_assertThisInitialized$4(i=t.call(this,e)),"onTouchStart",(function(e){var t=_assertThisInitialized$4(i),r=t.player,n=t.config,o=t.pos,a=t.playerConfig,s=i.getTouche(e);if(s&&!n.disableGesture&&i.duration>0&&!r.ended){o.isStart=!0,util.checkIsFunction(a.disableSwipeHandler)&&a.disableSwipeHandler(),i.find(".xg-dur").innerHTML=util.format(i.duration);var l=i.root.getBoundingClientRect();90===r.rotateDeg?(o.top=l.left,o.left=l.top,o.width=l.height,o.height=l.width):(o.top=l.top,o.left=l.left,o.width=l.width,o.height=l.height);var c=parseInt(s.pageX-o.left,10),u=parseInt(s.pageY-o.top,10);o.x=90===r.rotateDeg?u:c,o.y=90===r.rotateDeg?c:u,o.scopeL=n.scopeL*o.width,o.scopeR=(1-n.scopeR)*o.width,o.scopeM1=o.width*(1-n.scopeM)/2,o.scopeM2=o.width-o.scopeM1}})),_defineProperty$5(_assertThisInitialized$4(i),"onTouchMove",(function(e){var t=i.getTouche(e),r=_assertThisInitialized$4(i),n=r.pos,o=r.config,a=r.player;if(t&&!o.disableGesture&&i.duration&&n.isStart){var s=o.miniMoveStep,l=o.hideControlsActive,c=parseInt(t.pageX-n.left,10),u=parseInt(t.pageY-n.top,10),h=90===a.rotateDeg?u:c,d=90===a.rotateDeg?c:u;if(Math.abs(h-n.x)>s||Math.abs(d-n.y)>s){var p=h-n.x,f=d-n.y,g=n.scope;if(-1===g&&(0===(g=i.checkScope(h,d,p,f,n))&&(l?a.blur():a.focus({autoHide:!1}),!n.time&&(n.time=parseInt(1e3*a.currentTime,10)+1e3*i.timeOffset)),n.scope=g),-1===g||g>0&&!o.gestureY||0===g&&!o.gestureX)return;e.cancelable&&e.preventDefault(),i.executeMove(p,f,g,n.width,n.height),n.x=h,n.y=d}}})),_defineProperty$5(_assertThisInitialized$4(i),"onTouchEnd",(function(e){var t=_assertThisInitialized$4(i),r=t.player,n=t.pos,o=t.playerConfig;if(n.isStart){n.scope>-1&&e.cancelable&&e.preventDefault();var a=i.config,s=a.disableGesture,l=a.gestureX;!s&&l?(i.endLastMove(n.scope),setTimeout((function(){r.getPlugin("progress")&&r.getPlugin("progress").resetSeekState()}),10)):n.time=0,n.scope=-1,i.resetPos(),util.checkIsFunction(o.enableSwipeHandler)&&o.enableSwipeHandler(),i.changeAction(ACTIONS.AUTO)}})),_defineProperty$5(_assertThisInitialized$4(i),"onRootTouchMove",(function(e){!i.config.disableGesture&&i.config.gestureX&&i.checkIsRootTarget(e)&&(e.stopPropagation(),i.pos.isStart?i.onTouchMove(e):i.onTouchStart(e))})),_defineProperty$5(_assertThisInitialized$4(i),"onRootTouchEnd",(function(e){i.pos.isStart&&i.checkIsRootTarget(e)&&(e.stopPropagation(),i.onTouchEnd(e))})),i.pos={isStart:!1,x:0,y:0,time:0,volume:0,rate:1,light:0,width:0,height:0,scopeL:0,scopeR:0,scopeM1:0,scopeM2:0,scope:-1},i.timer=null,i}return _createClass$5(r,[{key:"duration",get:function(){return this.playerConfig.customDuration||this.player.duration}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"registerIcons",value:function(){return{seekTipIcon:{icon:SeekTipIcon,class:"xg-seek-pre"}}}},{key:"afterCreate",value:function(){var e=this;HOOKS.map((function(t){e.__hooks[t]=null}));var t=this.playerConfig,r=this.config,i=this.player;!0===t.closeVideoDblclick&&(r.closedbClick=!0),this.resetPos(),util.isUndefined(t.disableGesture)||(r.disableGesture=!!t.disableGesture),this.appendChild(".xg-seek-icon",this.icons.seekTipIcon),this.xgMask=util.createDom("xg-mask","",{},"xgmask"),i.root.appendChild(this.xgMask),this.initCustomStyle(),this.registerThumbnail();var n="mouse"===this.domEventType?"mouse":"touch";this.touch=new Touche(this.root,{eventType:n,needPreventDefault:!this.config.disableGesture}),this.root.addEventListener("contextmenu",(function(e){e.preventDefault()})),i.root.addEventListener("touchmove",this.onRootTouchMove,!0),i.root.addEventListener("touchend",this.onRootTouchEnd,!0),this.on(DURATION_CHANGE,(function(){var t=e.player,r=e.config;1e3*t.duration<r.moveDuration&&(r.moveDuration=1e3*t.duration)})),this.on([CANPLAY,ENDED],(function(){var t=e.pos,r=t.time;!t.isStart&&r>0&&(e.pos.time=0)}));var o={touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",press:"onPress",pressend:"onPressEnd",click:"onClick",doubleclick:"onDbClick"};if(Object.keys(o).map((function(t){e.touch.on(t,(function(r){e[o[t]](r)}))})),!r.disableActive){var a=i.plugins.progress;a&&(a.addCallBack("dragmove",(function(t){e.activeSeekNote(t.currentTime,t.forward)})),a.addCallBack("dragend",(function(){e.changeAction(ACTIONS.AUTO)})))}}},{key:"registerThumbnail",value:function(){var e=this.player.plugins.thumbnail;if(e&&e.usable){this.thumbnail=e.createThumbnail(null,"mobile-thumbnail");var t=this.find(".time-preview");t.insertBefore(this.thumbnail,t.children[0])}}},{key:"initCustomStyle",value:function(){var e=(this.playerConfig||{}).commonStyle,t=e.playedColor,r=e.progressColor;t&&(this.find(".xg-curbar").style.backgroundColor=t,this.find(".xg-cur").style.color=t),r&&(this.find(".xg-bar").style.backgroundColor=r,this.find(".time-preview").style.color=r),this.config.disableTimeProgress&&util.addClass(this.find(".xg-timebar"),"hide")}},{key:"resetPos",value:function(){var e=this;this.pos?(this.pos.isStart=!1,this.pos.scope=-1,["x","y","width","height","scopeL","scopeR","scopeM1","scopeM2"].map((function(t){e.pos[t]=0}))):this.pos={isStart:!1,x:0,y:0,volume:0,rate:1,light:0,width:0,height:0,scopeL:0,scopeR:0,scopeM1:0,scopeM2:0,scope:-1,time:0}}},{key:"changeAction",value:function(e){var t=this.player;this.root.setAttribute("data-xg-action",e);var r=t.plugins.start;r&&r.recover()}},{key:"getTouche",value:function(e){this.player.rotateDeg;var t=e.touches&&e.touches.length>0?e.touches[e.touches.length-1]:e;return{pageX:t.pageX,pageY:t.pageY}}},{key:"checkScope",value:function(e,t,r,i,n){var o=n.width,a=-1;if(e<0||e>o)return a;var s=0===i?Math.abs(r):Math.abs(r/i);return Math.abs(r)>0&&s>=1.73&&e>n.scopeM1&&e<n.scopeM2?a=0:(0===Math.abs(r)||s<=.57)&&(a=e<n.scopeL?1:e>n.scopeR?2:3),a}},{key:"executeMove",value:function(e,t,r,i,n){switch(r){case 0:this.updateTime(e/i*this.config.scopeM);break;case 1:this.updateBrightness(t/n);break;case 2:sniffer$1.os.isIos||this.updateVolume(t/n)}}},{key:"endLastMove",value:function(e){var t=this,r=this.pos,i=this.player,n=this.config,o=(r.time-this.timeOffset)/1e3;if(0===e)i.seek(Number(o).toFixed(1)),n.hideControlsEnd?i.blur():i.focus(),this.timer=setTimeout((function(){t.pos.time=0}),500);this.changeAction(ACTIONS.AUTO)}},{key:"checkIsRootTarget",value:function(e){var t=this.player.plugins||{};return(!t.progress||!t.progress.root.contains(e.target))&&(t.start&&t.start.root.contains(e.target)||t.controls&&t.controls.root.contains(e.target))}},{key:"sendUseAction",value:function(e){var t=this.player.paused;this.emitUserAction(e,"switch_play_pause",{prop:"paused",from:t,to:!t})}},{key:"clickHandler",value:function(e){var t=this.player,r=this.config,i=this.playerConfig;t.state<STATES.RUNNING?i.closeVideoClick||(this.sendUseAction(util.createEvent("click")),t.play()):!r.closedbClick||i.closeVideoClick?t.isActive?t.blur():t.focus():i.closeVideoClick||((t.isActive||r.focusVideoClick)&&(this.sendUseAction(util.createEvent("click")),this.switchPlayPause()),t.focus())}},{key:"dbClickHandler",value:function(e){var t=this.config,r=this.player;!t.closedbClick&&r.state>=STATES.RUNNING&&(this.sendUseAction(util.createEvent("dblclick")),this.switchPlayPause())}},{key:"onClick",value:function(e){var t=this,r=this.player;runHooks(this,HOOKS[0],(function(e,r){t.clickHandler(r.e)}),{e:e,paused:r.paused})}},{key:"onDbClick",value:function(e){var t=this,r=this.player;runHooks(this,HOOKS[1],(function(e,r){t.dbClickHandler(r.e)}),{e:e,paused:r.paused})}},{key:"onPress",value:function(e){var t=this.pos,r=this.config,i=this.player;r.disablePress||(t.rate=this.player.playbackRate,this.emitUserAction("press","change_rate",{prop:"playbackRate",from:i.playbackRate,to:r.pressRate}),i.playbackRate=r.pressRate,this.changeAction(ACTIONS.PLAYBACK))}},{key:"onPressEnd",value:function(e){var t=this.pos,r=this.config,i=this.player;r.disablePress||(this.emitUserAction("pressend","change_rate",{prop:"playbackRate",from:i.playbackRate,to:t.rate}),i.playbackRate=t.rate,t.rate=1,this.changeAction(ACTIONS.AUTO))}},{key:"updateTime",value:function(e){var t=this.player,r=this.config,i=this.player.duration;e=Number(e.toFixed(4));var n=parseInt(e*r.moveDuration,10)+this.timeOffset;n=(n+=this.pos.time)<0?0:n>1e3*i?1e3*i-200:n,t.getPlugin("time")&&t.getPlugin("time").updateTime(n/1e3),t.getPlugin("progress")&&t.getPlugin("progress").updatePercent(n/1e3/this.duration,!0),this.activeSeekNote(n/1e3,e>0),r.isTouchingSeek&&t.seek(Number((n-this.timeOffset)/1e3).toFixed(1)),this.pos.time=n}},{key:"updateVolume",value:function(e){this.player.rotateDeg&&(e=-e);var t=this.player,r=this.pos;if(e=parseInt(100*e,10),r.volume+=e,!(Math.abs(r.volume)<10)){var i=parseInt(10*t.volume,10)-parseInt(r.volume/10,10);i=i>10?10:i<1?0:i,t.volume=i/10,r.volume=0}}},{key:"updateBrightness",value:function(e){this.player.rotateDeg&&(e=-e);var t=this.pos,r=this.config,i=this.xgMask,n=t.light+.8*e;n=n>r.maxDarkness?r.maxDarkness:n<0?0:n,i&&(i.style.backgroundColor="rgba(0,0,0,".concat(n,")")),t.light=n}},{key:"activeSeekNote",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.player,i=this.config,n=!(this.duration!==1/0&&this.duration>0);if(e&&"number"==typeof e&&!n&&!i.disableActive){e<0?e=0:e>r.duration&&(e=r.duration-.2),this.changeAction(ACTIONS.SEEKING);var o=r.plugins.start;o&&o.focusHide(),this.find(".xg-dur").innerHTML=util.format(this.duration),this.find(".xg-cur").innerHTML=util.format(e),this.find(".xg-curbar").style.width="".concat(e/this.duration*100,"%"),t?util.removeClass(this.find(".xg-seek-show"),"xg-back"):util.addClass(this.find(".xg-seek-show"),"xg-back"),this.updateThumbnails(e)}}},{key:"updateThumbnails",value:function(e){var t=this.player.plugins.thumbnail;t&&t.usable&&this.thumbnail&&t.update(this.thumbnail,e,160,90)}},{key:"switchPlayPause",value:function(){var e=this.player;if(e.state<STATES.ATTACHED)return!1;e.ended||(e.paused?e.play():e.pause())}},{key:"disableGesture",value:function(){this.config.disableGesture=!1}},{key:"enableGesture",value:function(){this.config.disableGesture=!0}},{key:"destroy",value:function(){var e=this.player;this.timer&&clearTimeout(this.timer),this.thumbnail=null,e.root.removeChild(this.xgMask),this.xgMask=null,this.touch&&this.touch.destroy(),this.touch=null,e.root.removeEventListener("touchmove",this.onRootTouchMove,!0),e.root.removeEventListener("touchend",this.onRootTouchEnd,!0)}},{key:"render",value:function(){var e="normal"!==this.config.gradient?"gradient ".concat(this.config.gradient):"gradient";return'\n <xg-trigger class="trigger">\n <div class="'.concat(e,'"></div>\n <div class="time-preview">\n <div class="xg-seek-show ').concat(this.config.disableSeekIcon?" hide-seek-icon":"",'">\n <i class="xg-seek-icon"></i>\n <span class="xg-cur">00:00</span>\n <span>/</span>\n <span class="xg-dur">00:00</span>\n </div>\n <div class="xg-bar xg-timebar">\n <div class="xg-curbar"></div>\n </div>\n </div>\n <div class="xg-playbackrate xg-top-note">\n <span><i>').concat(this.config.pressRate,"X</i>").concat(this.i18n.FORWARD,"</span>\n </div>\n </xg-trigger>\n ")}}],[{key:"pluginName",get:function(){return"mobile"}},{key:"defaultConfig",get:function(){return{index:0,disableGesture:!1,gestureX:!0,gestureY:!0,gradient:"normal",isTouchingSeek:!1,miniMoveStep:5,miniYPer:5,scopeL:.25,scopeR:.25,scopeM:.9,pressRate:2,darkness:!0,maxDarkness:.8,disableActive:!1,disableTimeProgress:!1,hideControlsActive:!1,hideControlsEnd:!1,moveDuration:36e4,closedbClick:!1,disablePress:!0,disableSeekIcon:!1,focusVideoClick:!1}}}]),r}(Plugin);function preventDefault(e){e.preventDefault(),e.returnValue=!1}function isDisableTag(e){var t=e.tagName;return!("INPUT"!==t&&"TEXTAREA"!==t&&!e.isContentEditable)}var Keyboard=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(){var e;_classCallCheck$4(this,r);for(var i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];return _defineProperty$5(_assertThisInitialized$4(e=t.call.apply(t,[this].concat(n))),"onBodyKeyDown",(function(t){var r=t||window.event;if(e.player&&(e.player.isUserActive||e.config.isIgnoreUserActive)&&!(e.config.disable||e.config.disableBodyTrigger||!e.checkIsVisible()||r.metaKey||r.altKey||r.ctrlKey)){var i=r.keyCode;return!(r.target!==document.body&&(!e.config.isGlobalTrigger||isDisableTag(r.target))||!e.checkCode(i,!0))&&(preventDefault(r),e.handleKeyCode(i,t),!1)}})),_defineProperty$5(_assertThisInitialized$4(e),"onKeydown",(function(t){var r=t||window.event;if(!(e.config.disable||e.config.disableRootTrigger||r.metaKey||r.altKey||r.ctrlKey)&&(e.player.isUserActive||e.config.isIgnoreUserActive)&&(e.player.isUserActive||e.config.isIgnoreUserActive)){if(!r||37!==r.keyCode&&!e.checkCode(r.keyCode)||r.target!==e.player.root&&r.target!==e.player.video&&r.target!==e.player.controls.el)return!0;preventDefault(r),e.handleKeyCode(r.keyCode,t)}})),e}return _createClass$5(r,[{key:"mergekeyCodeMap",value:function(){var e=this,t=this.config.keyCodeMap;t&&Object.keys(t).map((function(r){e.keyCodeMap[r]?["keyCode","action","disable","isBodyTarget"].map((function(i){t[r][i]&&(e.keyCodeMap[r][i]=t[r][i])})):e.keyCodeMap[r]=t[r]}))}},{key:"afterCreate",value:function(){this.config.disable=!this.playerConfig.keyShortcut;var e="function"==typeof this.config.seekStep?this.config.seekStep(this.player):this.config.seekStep;e&&"number"==typeof e&&(this.seekStep=e),this.keyCodeMap={space:{keyCode:32,action:"playPause",disable:!1,noBodyTarget:!1},up:{keyCode:38,action:"upVolume",disable:!1,noBodyTarget:!0},down:{keyCode:40,action:"downVolume",disable:!1,noBodyTarget:!0},left:{keyCode:37,action:"seekBack",disable:!1},right:{keyCode:39,action:"seek",disable:!1},esc:{keyCode:27,action:"exitFullscreen",disable:!1}},this.mergekeyCodeMap(),this.player.root.addEventListener("keydown",this.onKeydown),document.addEventListener("keydown",this.onBodyKeyDown)}},{key:"checkIsVisible",value:function(){if(!this.config.checkVisible)return!0;var e=this.player.root.getBoundingClientRect(),t=e.height,r=e.top,i=e.bottom,n=window.innerHeight;return!(r<0&&r<0-.9*t||i>0&&i-n>.9*t)}},{key:"checkCode",value:function(e,t){var r=this,i=!1;return Object.keys(this.keyCodeMap).map((function(n){r.keyCodeMap[n]&&e===r.keyCodeMap[n].keyCode&&!r.keyCodeMap[n].disable&&(i=!t||t&&!r.keyCodeMap[n].noBodyTarget)})),i}},{key:"downVolume",value:function(e){var t=this.player,r=parseFloat((t.volume-.1).toFixed(1)),i={volume:{from:t.volume,to:r}};this.emitUserAction(e,"change_volume",{props:i}),t.volume=r>=0?r:0}},{key:"upVolume",value:function(e){var t=this.player,r=parseFloat((t.volume+.1).toFixed(1)),i={volume:{from:t.volume,to:r}};this.emitUserAction(e,"change_volume",{props:i}),t.volume=r<=1?r:1}},{key:"seek",value:function(e){var t=this.player,r=t.currentTime,i=t.duration,n=r,o={currentTime:{from:r,to:n=r+this.seekStep<=i?r+this.seekStep:i}};this.emitUserAction(e,"seek",{props:o}),this.player.currentTime=n}},{key:"seekBack",value:function(e){var t=this.player.currentTime,r=0;t-this.seekStep>=0&&(r=t-this.seekStep);var i={currentTime:{from:t,to:r}};this.emitUserAction(e,"seek",{props:i}),this.player.currentTime=r}},{key:"playPause",value:function(e){var t=this.player;t&&(this.emitUserAction(e,"switch_play_pause"),t.paused?t.play():t.pause())}},{key:"exitFullscreen",value:function(e){var t=this.player,r=t.fullscreen,i=t.cssfullscreen;r&&(this.emitUserAction("keyup","switch_fullscreen",{prop:"fullscreen",from:r,to:!r}),t.exitFullscreen()),i&&(this.emitUserAction("keyup","switch_css_fullscreen",{prop:"cssfullscreen",from:i,to:!i}),t.exitCssFullscreen())}},{key:"handleKeyCode",value:function(e,t){var r=this;Object.keys(this.keyCodeMap).map((function(i){var n=r.keyCodeMap[i],o=n.action,a=n.keyCode,s=n.disable;a!==e||s||("function"==typeof o?o(t,r.player):"string"==typeof o&&"function"==typeof r[o]&&r[o](t,r.player),r.emit(SHORTCUT,_objectSpread2$4({key:i,target:t.target},r.keyCodeMap[i])))}))}},{key:"destroy",value:function(){this.player.root.removeEventListener("keydown",this.onKeydown),document.removeEventListener("keydown",this.onBodyKeyDown)}},{key:"disable",value:function(){this.config.disable=!0}},{key:"enable",value:function(){this.config.disable=!1}}],[{key:"pluginName",get:function(){return"keyboard"}},{key:"defaultConfig",get:function(){return{seekStep:10,checkVisible:!0,disableBodyTrigger:!1,disableRootTrigger:!1,isGlobalTrigger:!1,keyCodeMap:{},disable:!1,isIgnoreUserActive:!1}}}]),r}(BasePlugin);function loadingIcon(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="-5 -5 110 110">\n <path d="M100,50A50,50,0,1,1,50,0" stroke-width="5" stroke="#ddd" stroke-dasharray="236" fill="none"></path>\n</svg>\n',"image/svg+xml").firstChild}var Loading=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(){return _classCallCheck$4(this,r),t.apply(this,arguments)}return _createClass$5(r,[{key:"registerIcons",value:function(){return{loadingIcon:loadingIcon}}},{key:"afterCreate",value:function(){this.appendChild("xg-loading-inner",this.icons.loadingIcon)}},{key:"render",value:function(){return'\n <xg-loading class="xgplayer-loading">\n <xg-loading-inner></xg-loading-inner>\n </xg-loading>'}}],[{key:"pluginName",get:function(){return"loading"}},{key:"defaultConfig",get:function(){return{position:POSITIONS$a.ROOT}}}]),r}(Plugin),TPL=[{tag:"xg-cache",className:"xgplayer-progress-cache",styleKey:"cachedColor"},{tag:"xg-played",className:"xgplayer-progress-played",styleKey:"playedColor"}],InnerList=function(){function e(t){_classCallCheck$4(this,e),this.fragments=t.fragments||[],0===this.fragments.length&&this.fragments.push({percent:1}),this._callBack=t.actionCallback,this.fragConfig={fragFocusClass:t.fragFocusClass||"inner-focus-point",fragAutoFocus:!!t.fragAutoFocus,fragClass:t.fragClass||""},this.style=t.style||{playedColor:"",cachedColor:"",progressColor:""},this.duration=0,this.cachedIndex=0,this.playedIndex=0,this.focusIndex=-1}return _createClass$5(e,[{key:"updateDuration",value:function(e){var t=this;this.duration=e;var r=0,i=this.fragments;this.fragments=i.map((function(e){return e.start=parseInt(r,10),e.end=parseInt(r+e.percent*t.duration,10),e.duration=parseInt(e.percent*t.duration,10),r+=e.percent*t.duration,e}))}},{key:"updateProgress",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"played",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{newIndex:0,curIndex:0,millisecond:0},r=this.progressList,i=this.fragments;if(!(r.length<1)){var n=t.newIndex,o=t.curIndex,a=t.millisecond;n!==o&&r.map((function(t,r){r<n?t[e].style.width="100%":r>n&&(t[e].style.width=0)}));var s=i[n],l=0===a?0:(a-s.start)/s.duration;r[n][e].style.width=l<0?0:"".concat(100*l,"%")}}},{key:"updateFocus",value:function(e){if(this.fragConfig.fragAutoFocus&&!(this.fragments.length<2))if(e){var t=this.findIndex(1e3*e.currentTime,this.focusIndex);if(t>=0&&t!==this.focusIndex){this.focusIndex>-1&&this.unHightLight(this.focusIndex),this.setHightLight(t);var r={index:t,preIndex:this.focusIndex,fragment:this.fragments[this.focusIndex]};this.focusIndex=t,this._callBack&&this._callBack(r)}}else if(this.focusIndex>-1){this.unHightLight(this.focusIndex);var i={index:-1,preIndex:this.focusIndex,fragment:null};this._callBack&&this._callBack(i),this.focusIndex=-1}}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{cached:0,played:0},t=arguments.length>1?arguments[1]:void 0;if(!this.duration||parseInt(1e3*t,10)!==this.duration){if(!t&&0!==t)return;this.updateDuration(parseInt(1e3*t,10))}var r=this.playedIndex,i=this.cachedIndex;if("Undefined"!==util.typeOf(e.played)){var n=this.findIndex(1e3*e.played,r);if(n<0)return;this.updateProgress("played",{newIndex:n,curIndex:r,millisecond:parseInt(1e3*e.played,10)}),this.playedIndex=n}if("Undefined"!==util.typeOf(e.cached)){var o=this.findIndex(1e3*e.cached,i);if(o<0)return;this.updateProgress("cached",{newIndex:o,curIndex:i,millisecond:parseInt(1e3*e.cached,10)}),this.cachedIndex=o}}},{key:"findIndex",value:function(e,t){var r=this.fragments;if(!r||0===r.length)return-1;if(1===r.length)return 0;if(t>-1&&t<r.length&&e>r[t].start&&e<r[t].end)return t;if(e>r[r.length-1].start)return r.length-1;for(var i=0;i<r.length;i++)if(e>r[i].start&&e<=r[i].end){t=i;break}return t}},{key:"findHightLight",value:function(){for(var e=this.root.children,t=0;t<e.length;t++)if(util.hasClass(e[t],this.fragConfig.fragFocusClass))return{dom:e[t],pos:e[t].getBoundingClientRect()}}},{key:"findFragment",value:function(e){var t=this.root.children;return e<0||e>=t.length?null:{dom:t[e],pos:t[e].getBoundingClientRect()}}},{key:"unHightLight",value:function(){for(var e=this.root.children,t=0;t<e.length;t++)util.removeClass(e[t],this.fragConfig.fragFocusClass)}},{key:"setHightLight",value:function(e){var t=this.root.children;if(e<t.length)return util.addClass(t[e],this.fragConfig.fragFocusClass),{dom:t[e],pos:t[e].getBoundingClientRect()}}},{key:"destroy",value:function(){this.progressList=null,this.fragments=null,this.root.innerHTML=""}},{key:"reset",value:function(e){var t=this;if(Object.keys(this.fragConfig).forEach((function(r){void 0!==e[r]&&(t.fragConfig[r]=e[r])})),e.fragments){if(this.fragments=0===e.fragments.length?[{percent:1}]:e.fragments,this.updateDuration(this.duration),this.playedIndex=0,this.cachedIndex=0,this.root)for(var r=this.root.children;r.length>0;)this.root.removeChild(r[0]);this.render()}}},{key:"render",value:function(){var e=this,t=this.style.progressColor;if(this.root||(this.root=util.createDom("xg-inners","",{},"progress-list")),this.fragments){var r=this.fragConfig,i=r.fragClass,n=r.fragFocusClass;this.progressList=this.fragments.map((function(r){var o=util.createDom("xg-inner","",{style:t?"background:".concat(t,"; flex: ").concat(r.percent):"flex: ".concat(r.percent)},"".concat(r.isFocus?n:""," xgplayer-progress-inner ").concat(i));return e.root.appendChild(o),TPL.forEach((function(t){o.appendChild(util.createDom(t.tag,"",{style:t.styleKey?"background: ".concat(e.style[t.styleKey],"; width:0;"):"width:0;"},t.className))})),{cached:o.children[0],played:o.children[1]}}))}return this.root}}]),e}(),FRAGMENT_FOCUS_CLASS={POINT:"inner-focus-point",HIGHLIGHT:"inner-focus-highlight"},Progress=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(e){var i;return _classCallCheck$4(this,r),_defineProperty$5(_assertThisInitialized$4(i=t.call(this,e)),"onMoveOnly",(function(e,t){var r=_assertThisInitialized$4(i),n=r.pos,o=r.config,a=r.player,s=t;if(e){util.event(e);var l=util.getEventPos(e,a.zoom),c=90===a.rotateDeg?l.clientY:l.clientX;if(n.moving&&Math.abs(n.x-c)<o.miniMoveStep)return;n.moving=!0,n.x=c,s=i.computeTime(e,c)}i.triggerCallbacks("dragmove",s,e),i._updateInnerFocus(s)})),_defineProperty$5(_assertThisInitialized$4(i),"onBodyClick",(function(e){i.pos.isLocked&&(i.pos.isLocked=!1,e.preventDefault(),e.stopPropagation())})),_defineProperty$5(_assertThisInitialized$4(i),"_mouseDownHandler",(function(e,t){i._state.time=t.currentTime,i.updateWidth(t.currentTime,t.percent,0),i._updateInnerFocus(t)})),_defineProperty$5(_assertThisInitialized$4(i),"_mouseUpHandler",(function(e,t){_assertThisInitialized$4(i).pos.moving&&i.updateWidth(t.currentTime,t.percent,2)})),_defineProperty$5(_assertThisInitialized$4(i),"_mouseMoveHandler",(function(e,t){var r=_assertThisInitialized$4(i),n=r._state,o=r.pos,a=r.config,s=r.player;n.time<t.currentTime?t.forward=!0:t.forward=!1,n.time=t.currentTime,o.isDown&&!o.moving&&(o.moving=!0,a.isPauseMoving&&s.pause(),i.triggerCallbacks("dragstart",t,e),i.emitUserAction("drag","dragstart",t)),i.updateWidth(t.currentTime,t.percent,1),i.triggerCallbacks("dragmove",t,e),i._updateInnerFocus(t)})),_defineProperty$5(_assertThisInitialized$4(i),"onMouseDown",(function(e){var t=_assertThisInitialized$4(i),r=t._state,n=t.player,o=t.pos,a=t.config,s=t.playerConfig,l=util.getEventPos(e,n.zoom),c=90===n.rotateDeg?l.clientY:l.clientX;if(!(n.isMini||a.closeMoveSeek||!s.allowSeekAfterEnded&&n.ended)){if(n.duration||n.isPlaying){e.stopPropagation(),i.focus(),util.checkIsFunction(s.disableSwipeHandler)&&s.disableSwipeHandler(),util.checkIsFunction(a.onMoveStart)&&a.onMoveStart(),util.event(e),o.x=c,o.isDown=!0,o.moving=!1,r.prePlayTime=n.currentTime,n.focus({autoHide:!1}),i.isProgressMoving=!0,util.addClass(i.progressBtn,"active");var u=i.computeTime(e,c);return u.prePlayTime=r.prePlayTime,i._mouseDownHandlerHook(e,u),"touchstart"===e.type?(i.root.addEventListener("touchmove",i.onMouseMove),i.root.addEventListener("touchend",i.onMouseUp)):(i.unbind("mousemove",i.onMoveOnly),document.addEventListener("mousemove",i.onMouseMove,!1),document.addEventListener("mouseup",i.onMouseUp,!1)),!0}n.play()}})),_defineProperty$5(_assertThisInitialized$4(i),"onMouseUp",(function(e){var t=_assertThisInitialized$4(i),r=t.player,n=t.config,o=t.pos,a=t.playerConfig,s=t._state;e.stopPropagation(),e.preventDefault(),util.checkIsFunction(a.enableSwipeHandler)&&a.enableSwipeHandler(),util.checkIsFunction(n.onMoveEnd)&&n.onMoveEnd(),util.event(e),util.removeClass(i.progressBtn,"active");var l=i.computeTime(e,o.x);l.prePlayTime=s.prePlayTime,o.moving?(i.triggerCallbacks("dragend",l,e),i.emitUserAction("drag","dragend",l)):(i.triggerCallbacks("click",l,e),i.emitUserAction("click","click",l)),i._mouseUpHandlerHook(e,l),o.moving=!1,o.isDown=!1,o.x=0,o.y=0,o.isLocked=!0,s.prePlayTime=0,s.time=0,"touchend"===e.type?(i.root.removeEventListener("touchmove",i.onMouseMove),i.root.removeEventListener("touchend",i.onMouseUp),i.blur()):(document.removeEventListener("mousemove",i.onMouseMove,!1),document.removeEventListener("mouseup",i.onMouseUp,!1),o.isEnter?"mobile"!==a.isMobileSimulateMode&&i.bind("mousemove",i.onMoveOnly):i.onMouseLeave(e)),util.setTimeout(_assertThisInitialized$4(i),(function(){i.resetSeekState()}),10),r.focus()})),_defineProperty$5(_assertThisInitialized$4(i),"onMouseMove",(function(e){var t=_assertThisInitialized$4(i),r=t._state,n=t.pos,o=t.player,a=t.config;util.checkTouchSupport()&&e.preventDefault(),util.event(e);var s=util.getEventPos(e,o.zoom),l=90===o.rotateDeg?s.clientY:s.clientX,c=Math.abs(n.x-l);if(!(n.moving&&c<a.miniMoveStep||!n.moving&&c<a.miniStartStep)){n.x=l;var u=i.computeTime(e,l);u.prePlayTime=r.prePlayTime,i._mouseMoveHandlerHook(e,u)}})),_defineProperty$5(_assertThisInitialized$4(i),"onMouseOut",(function(e){i.triggerCallbacks("mouseout",null,e)})),_defineProperty$5(_assertThisInitialized$4(i),"onMouseOver",(function(e){i.triggerCallbacks("mouseover",null,e)})),_defineProperty$5(_assertThisInitialized$4(i),"onMouseEnter",(function(e){var t=_assertThisInitialized$4(i),r=t.player,n=t.pos;if(!(n.isDown||n.isEnter||r.isMini||!r.config.allowSeekAfterEnded&&r.ended)){n.isEnter=!0,i.bind("mousemove",i.onMoveOnly),i.bind("mouseleave",i.onMouseLeave),util.event(e);var o=util.getEventPos(e,r.zoom),a=90===r.rotateDeg?o.clientY:o.clientX,s=i.computeTime(e,a);i.triggerCallbacks("mouseenter",s,e),i.focus()}})),_defineProperty$5(_assertThisInitialized$4(i),"onMouseLeave",(function(e){i.triggerCallbacks("mouseleave",null,e),i.unlock(),i._updateInnerFocus(null)})),_defineProperty$5(_assertThisInitialized$4(i),"onVideoResize",(function(){var e=i.pos,t=e.x,r=e.isDown;if(e.isEnter&&!r){var n=i.computeTime(null,t);i.onMoveOnly(null,n)}})),i.useable=!1,i.isProgressMoving=!1,i.__dragCallBacks=[],i._state={now:-1,direc:0,time:0,prePlayTime:-1},i._disableBlur=!1,i}return _createClass$5(r,[{key:"duration",get:function(){return this.playerConfig.customDuration||this.player.duration}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"changeState",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.useable=e}},{key:"show",value:function(){this.root&&(this.root.style.display="flex")}},{key:"_initInner",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t&&0!==t.length||(t=[{percent:1}]);var i=_objectSpread2$4(_objectSpread2$4({fragments:t},r),{},{actionCallback:function(t){e.emitUserAction("fragment_focus","fragment_focus",t)}});this.innerList?this.innerList.reset(i):(this.innerList=new InnerList(i),this.outer.insertBefore(this.innerList.render(),this.outer.children[0]),["findHightLight","unHightLight","setHightLight","findFragment"].map((function(t){e[t]=e.innerList[t].bind(e.innerList)})))}},{key:"_updateInnerFocus",value:function(e){this.innerList&&this.innerList.updateFocus(e)}},{key:"afterCreate",value:function(){var e=this;if(!this.config.disable&&!this.playerConfig.isLive){this.pos={x:0,y:0,moving:!1,isDown:!1,isEnter:!1,isLocked:!1},this.outer=this.find("xg-outer");var t=this.config,r=t.fragFocusClass,i=t.fragAutoFocus,n=t.fragClass;this._initInner(this.config.fragments,{fragFocusClass:r,fragAutoFocus:i,fragClass:n,style:this.playerConfig.commonStyle||{}}),"mobile"===sniffer$1.device&&(this.config.isDragingSeek=!1,this.isMobile=!0),this.progressBtn=this.find(".xgplayer-progress-btn"),this.on(DURATION_CHANGE,(function(){e.onMouseLeave()})),this.on(TIME_UPDATE,(function(){e.onTimeupdate()})),this.on(SEEKED,(function(){e.onTimeupdate(),e.onCacheUpdate()})),this.on(PROGRESS,(function(){e.onCacheUpdate()})),this.on(ENDED,(function(){e.onCacheUpdate(!0),e.onTimeupdate(!0),e._state.now=0})),this.on(EMPTIED,(function(){e.onReset()})),this.on(VIDEO_RESIZE,(function(){e.onVideoResize()})),this.bindDomEvents(),this.initCustomStyle()}}},{key:"setConfig",value:function(e){var t=this,r=null;Object.keys(e).forEach((function(i){t.config[i]=e[i],"fragments"===i&&(r=e[i])})),r&&this._initInner(r,e)}},{key:"initCustomStyle",value:function(){var e=(this.playerConfig||{}).commonStyle.sliderBtnStyle,t=this.progressBtn;e&&("string"==typeof e?t.style.boxShadow=e:"object"===_typeof$3(e)&&Object.keys(e).map((function(r){t.style[r]=e[r]})))}},{key:"triggerCallbacks",value:function(e,t,r){this.__dragCallBacks.length>0&&this.__dragCallBacks.map((function(i){if(i&&i.handler&&i.type===e)try{i.handler(t,r)}catch(n){console.error("[XGPLAYER][triggerCallbacks] ".concat(i," error"),n)}}))}},{key:"addCallBack",value:function(e,t){t&&"function"==typeof t&&this.__dragCallBacks.push({type:e,handler:t})}},{key:"removeCallBack",value:function(e,t){var r=this.__dragCallBacks,i=-1;r.map((function(r,n){r&&r.type===e&&r.handler===t&&(i=n)})),i>-1&&r.splice(i,1)}},{key:"unlock",value:function(){var e=this.player,t=this.pos;t.isEnter=!1,e.isMini||(this.unbind("mousemove",this.onMoveOnly),t.isDown?this.unbind("mouseleave",this.onMouseLeave):this.blur())}},{key:"bindDomEvents",value:function(){var e=this.player,t=e.controls,r=e.config;this._mouseDownHandlerHook=this.hook("dragstart",this._mouseDownHandler),this._mouseUpHandlerHook=this.hook("dragend",this._mouseUpHandler),this._mouseMoveHandlerHook=this.hook("drag",this._mouseMoveHandler),"touch"!==this.domEventType&&"compatible"!==this.domEventType||(this.root.addEventListener("touchstart",this.onMouseDown),t&&(t.root&&t.root.addEventListener("touchmove",util.stopPropagation),t.center&&t.center.addEventListener("touchend",util.stopPropagation))),"mouse"!==this.domEventType&&"compatible"!==this.domEventType||(this.bind("mousedown",this.onMouseDown),"mobile"!==r.isMobileSimulateMode&&this.bind("mouseenter",this.onMouseEnter),this.bind("mouseover",this.onMouseOver),this.bind("mouseout",this.onMouseOut),this.player.root.addEventListener("click",this.onBodyClick,!0))}},{key:"focus",value:function(){this.player.controls.pauseAutoHide(),util.addClass(this.root,"active")}},{key:"blur",value:function(){this._disableBlur||(this.player.controls.recoverAutoHide(),util.removeClass(this.root,"active"))}},{key:"disableBlur",value:function(){this._disableBlur=!0}},{key:"enableBlur",value:function(){this._disableBlur=!1}},{key:"updateWidth",value:function(e,t,r){var i=this.config,n=this.player;if(!i.isCloseClickSeek||0!==r){var o=e>=n.duration?n.duration-i.endedDiff:Number(e).toFixed(1);this.updatePercent(t),this.updateTime(e),(1!==r||i.isDragingSeek&&"audio"!==n.config.mediaType)&&(this._state.now=o,this._state.direc=o>n.currentTime?0:1,n.seek(o))}}},{key:"computeTime",value:function(e,t){var r,i,n=this.player,o=this.root.getBoundingClientRect(),a=o.width,s=o.height,l=o.top,c=o.left,u=t;90===n.rotateDeg?(r=s,i=l):(r=a,i=c);var h=u-i,d=(h=h>r?r:h<0?0:h)/r;return{percent:d=d<0?0:d>1?1:d,currentTime:parseInt(d*this.duration*1e3,10)/1e3,offset:h,width:r,left:i,e:e}}},{key:"updateTime",value:function(e){var t=this.player,r=this.duration;e>r?e=r:e<0&&(e=0);var i=t.plugins.time;i&&i.updateTime(e)}},{key:"resetSeekState",value:function(){this.isProgressMoving=!1;var e=this.player.plugins.time;e&&e.resetActive()}},{key:"updatePercent",value:function(e,t){if(this.isProgressMoving=!0,!this.config.disable){e=e>1?1:e<0?0:e,this.progressBtn.style.left="".concat(100*e,"%"),this.innerList.update({played:e*this.duration},this.duration);var r=this.player.plugins.miniprogress;r&&r.update({played:e*this.duration},this.duration)}}},{key:"onTimeupdate",value:function(e){var t=this.player,r=this._state,i=this.duration;if(!t.isSeeking&&!this.isProgressMoving){if(r.now>-1){var n=parseInt(1e3*r.now,10)-parseInt(1e3*t.currentTime,10);if(0===r.direc&&n>300||1===r.direc&&n>-300)return void(r.now=-1);r.now=-1}var o=this.timeOffset+t.currentTime;o=util.adjustTimeByDuration(o,i,e),this.innerList.update({played:o},i),this.progressBtn.style.left="".concat(o/i*100,"%");var a=this.player.plugins.miniprogress;a&&a.update({played:o},i)}}},{key:"onCacheUpdate",value:function(e){var t=this.player,r=this.duration;if(t){var i=t.bufferedPoint.end;i=util.adjustTimeByDuration(i,r,e),this.innerList.update({cached:i},r);var n=this.player.plugins.miniprogress;n&&n.update({cached:i},r)}}},{key:"onReset",value:function(){this.innerList.update({played:0,cached:0},0);var e=this.player.plugins.miniprogress;e&&e.update({cached:0,played:0},0)}},{key:"destroy",value:function(){var e=this.player,t=e.controls;this.thumbnailPlugin=null,this.innerList.destroy(),this.innerList=null;var r=this.domEventType;"touch"!==r&&"compatible"!==r||(this.root.removeEventListener("touchstart",this.onMouseDown),this.root.removeEventListener("touchmove",this.onMouseMove),this.root.removeEventListener("touchend",this.onMouseUp),t&&(t.root&&t.root.removeEventListener("touchmove",util.stopPropagation),t.center&&t.center.removeEventListener("touchend",util.stopPropagation))),"mouse"!==r&&"compatible"!==r||(this.unbind("mousedown",this.onMouseDown),this.unbind("mouseenter",this.onMouseEnter),this.unbind("mousemove",this.onMoveOnly),this.unbind("mouseleave",this.onMouseLeave),document.removeEventListener("mousemove",this.onMouseMove,!1),document.removeEventListener("mouseup",this.onMouseUp,!1),e.root.removeEventListener("click",this.onBodyClick,!0))}},{key:"render",value:function(){if(!this.config.disable&&!this.playerConfig.isLive){var e=this.player.controls?this.player.controls.config.mode:"";return'\n <xg-progress class="xgplayer-progress '.concat("bottom"===e?"xgplayer-progress-bottom":"",'">\n <xg-outer class="xgplayer-progress-outer">\n <xg-progress-btn class="xgplayer-progress-btn"></xg-progress-btn>\n </xg-outer>\n </xg-progress>\n ')}}}],[{key:"pluginName",get:function(){return"progress"}},{key:"defaultConfig",get:function(){return{position:POSITIONS$a.CONTROLS_CENTER,index:0,disable:!1,isDragingSeek:!0,closeMoveSeek:!1,isPauseMoving:!1,isCloseClickSeek:!1,fragments:[{percent:1}],fragFocusClass:FRAGMENT_FOCUS_CLASS.POINT,fragClass:"",fragAutoFocus:!1,miniMoveStep:5,miniStartStep:2,onMoveStart:function(){},onMoveEnd:function(){},endedDiff:.2}}},{key:"FRAGMENT_FOCUS_CLASS",get:function(){return FRAGMENT_FOCUS_CLASS}}]),r}(Plugin),Icon=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(){var e;_classCallCheck$4(this,r);for(var i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];return _defineProperty$5(_assertThisInitialized$4(e=t.call.apply(t,[this].concat(n))),"_onMouseenter",(function(t){e.emit("icon_mouseenter",{pluginName:e.pluginName})})),_defineProperty$5(_assertThisInitialized$4(e),"_onMouseLeave",(function(t){e.emit("icon_mouseleave",{pluginName:e.pluginName})})),e}return _createClass$5(r,[{key:"afterCreate",value:function(){this.bind("mouseenter",this._onMouseenter),this.bind("mouseleave",this._onMouseLeave)}},{key:"destroy",value:function(){this.unbind("mouseenter",this._onMouseenter),this.unbind("mouseleave",this._onMouseLeave)}}]),r}(Plugin),Play=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(){return _classCallCheck$4(this,r),t.apply(this,arguments)}return _createClass$5(r,[{key:"afterCreate",value:function(){var e=this;_get$2(_getPrototypeOf$4(r.prototype),"afterCreate",this).call(this);var t=this.player;this.config.disable||(this.initIcons(),this.btnClick=this.btnClick.bind(this),this.bind(["touchend","click"],this.btnClick),this.on([PAUSE,ERROR$1,EMPTIED],(function(){e.animate(t.paused)})),this.on(PLAY,(function(){e.animate(t.paused)})),this.animate(!0))}},{key:"registerIcons",value:function(){return{play:{icon:PlaySvg,class:"xg-icon-play"},pause:{icon:PauseSvg,class:"xg-icon-pause"}}}},{key:"btnClick",value:function(e){e.preventDefault(),e.stopPropagation();var t=this.player;return this.emitUserAction(e,"switch_play_pause",{prop:"paused",from:t.paused,to:!t.paused}),t.ended?t.replay():t.paused?(t.play(),this.animate(!1)):(t.pause(),this.animate(!0)),!1}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.play),this.appendChild(".xgplayer-icon",e.pause)}},{key:"animate",value:function(e){if(this.player){var t=this.i18nKeys,r=this.find(".xg-tips");e?(this.setAttr("data-state","pause"),r&&this.changeLangTextKey(r,t.PLAY_TIPS)):(this.setAttr("data-state","play"),r&&this.changeLangTextKey(r,t.PAUSE_TIPS))}}},{key:"destroy",value:function(){_get$2(_getPrototypeOf$4(r.prototype),"destroy",this).call(this),this.unbind(["touchend","click"],this.btnClick)}},{key:"render",value:function(){if(!this.config.disable)return'<xg-icon class="xgplayer-play">\n <div class="xgplayer-icon">\n </div>\n '.concat(xgIconTips(this,"PLAY_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"play"}},{key:"defaultConfig",get:function(){return{position:POSITIONS$a.CONTROLS_LEFT,index:0,disable:!1}}}]),r}(Icon);function BackSVG(){return(new DOMParser).parseFromString('<svg width="32px" height="40px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <path d="M11.2374369,14 L17.6187184,7.61871843 C17.9604272,7.27700968 17.9604272,6.72299032 17.6187184,6.38128157 C17.2770097,6.03957281 16.7229903,6.03957281 16.3812816,6.38128157 L9.38128157,13.3812816 C9.03957281,13.7229903 9.03957281,14.2770097 9.38128157,14.6187184 L16.3812816,21.6187184 C16.7229903,21.9604272 17.2770097,21.9604272 17.6187184,21.6187184 C17.9604272,21.2770097 17.9604272,20.7229903 17.6187184,20.3812816 L11.2374369,14 L11.2374369,14 Z" fill="#FFFFFF"></path>\n </g>\n</svg>',"image/svg+xml").firstChild}var TopBackIcon=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(){return _classCallCheck$4(this,r),t.apply(this,arguments)}return _createClass$5(r,[{key:"afterCreate",value:function(){var e=this;this.initIcons(),this.onClick=function(t){t.preventDefault(),t.stopPropagation(),e.config.onClick(t)},this.bind(["click","touchend"],this.onClick)}},{key:"registerIcons",value:function(){return{screenBack:{icon:BackSVG,class:"xg-fullscreen-back"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(this.root,e.screenBack)}},{key:"show",value:function(){util.addClass(this.root,"show")}},{key:"hide",value:function(){util.removeClass(this.root,"show")}},{key:"render",value:function(){return'<xg-icon class="xgplayer-back">\n </xg-icon>'}}],[{key:"pluginName",get:function(){return"topbackicon"}},{key:"defaultConfig",get:function(){return{position:POSITIONS$a.ROOT_TOP,index:0}}}]),r}(Plugin);function FullScreenSvg(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="2 -4 28 40">\n <path fill="#fff" transform="scale(0.0320625 0.0320625)" d="M598 214h212v212h-84v-128h-128v-84zM726 726v-128h84v212h-212v-84h128zM214 426v-212h212v84h-128v128h-84zM298 598v128h128v84h-212v-212h84z"></path>\n</svg>\n',"image/svg+xml").firstChild}function ExitFullScreenSvg(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="2 -4 28 40">\n <path fill="#fff" transform="scale(0.0320625 0.0320625)" d="M682 342h128v84h-212v-212h84v128zM598 810v-212h212v84h-128v128h-84zM342 342v-128h84v212h-212v-84h128zM214 682v-84h212v212h-84v-128h-128z"></path>\n</svg>\n',"image/svg+xml").firstChild}var Fullscreen=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(){var e;_classCallCheck$4(this,r);for(var i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];return _defineProperty$5(_assertThisInitialized$4(e=t.call.apply(t,[this].concat(n))),"_onOrientationChange",(function(t){e.player.fullscreen&&e.config.rotateFullscreen&&(90===window.orientation||-90===window.orientation?e.player.setRotateDeg(0):e.player.setRotateDeg(90))})),e}return _createClass$5(r,[{key:"afterCreate",value:function(){var e=this;_get$2(_getPrototypeOf$4(r.prototype),"afterCreate",this).call(this);var t=this.config,i=this.playerConfig;if(!t.disable){t.target&&(this.playerConfig.fullscreenTarget=this.config.target);var n=util.getFullScreenEl();i.fullscreenTarget===n&&this.player.getFullscreen().catch((function(e){})),this.initIcons(),this.handleFullscreen=this.hook("fullscreenChange",this.toggleFullScreen,{pre:function(t){var r=e.player.fullscreen;e.emitUserAction(t,"switch_fullscreen",{prop:"fullscreen",from:r,to:!r})}}),this.bind(".xgplayer-fullscreen",["touchend","click"],this.handleFullscreen),this.on(FULLSCREEN_CHANGE,(function(t){var r=e.find(".xg-tips");r&&e.changeLangTextKey(r,t?e.i18nKeys.EXITFULLSCREEN_TIPS:e.i18nKeys.FULLSCREEN_TIPS),e.animate(t)})),this.config.needBackIcon&&(this.topBackIcon=this.player.registerPlugin({plugin:TopBackIcon,options:{config:{onClick:function(t){e.handleFullscreen(t)}}}})),"mobile"===sniffer$1.device&&window.addEventListener("orientationchange",this._onOrientationChange)}}},{key:"registerIcons",value:function(){return{fullscreen:{icon:FullScreenSvg,class:"xg-get-fullscreen"},exitFullscreen:{icon:ExitFullScreenSvg,class:"xg-exit-fullscreen"}}}},{key:"destroy",value:function(){_get$2(_getPrototypeOf$4(r.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon","mobile"===sniffer$1.device?"touchend":"click",this.handleFullscreen),"mobile"===sniffer$1.device&&window.removeEventListener("orientationchange",this._onOrientationChange)}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.fullscreen),this.appendChild(".xgplayer-icon",e.exitFullscreen)}},{key:"toggleFullScreen",value:function(e){e&&(e.preventDefault(),e.stopPropagation());var t=this.player,r=this.config;!0===r.useCssFullscreen||"function"==typeof r.useCssFullscreen&&r.useCssFullscreen()?(t.fullscreen?t.exitCssFullscreen():t.getCssFullscreen(),this.animate(t.fullscreen)):r.rotateFullscreen?(t.fullscreen?t.exitRotateFullscreen():t.getRotateFullscreen(),this.animate(t.fullscreen)):r.switchCallback&&"function"==typeof r.switchCallback?r.switchCallback(t.fullscreen):t.fullscreen?t.exitFullscreen():t.getFullscreen().catch((function(e){}))}},{key:"animate",value:function(e){e?this.setAttr("data-state","full"):this.setAttr("data-state","normal"),this.topBackIcon&&(e?(this.topBackIcon.show(),this.hide()):(this.topBackIcon.hide(),this.show()))}},{key:"show",value:function(){_get$2(_getPrototypeOf$4(r.prototype),"show",this).call(this)}},{key:"hide",value:function(){_get$2(_getPrototypeOf$4(r.prototype),"hide",this).call(this)}},{key:"render",value:function(){if(!this.config.disable){return'<xg-icon class="xgplayer-fullscreen">\n <div class="xgplayer-icon">\n </div>\n '.concat(xgIconTips(this,"FULLSCREEN_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}}],[{key:"pluginName",get:function(){return"fullscreen"}},{key:"defaultConfig",get:function(){return{position:POSITIONS$a.CONTROLS_RIGHT,index:0,useCssFullscreen:!1,rotateFullscreen:!1,switchCallback:null,target:null,disable:!1,needBackIcon:!1}}}]),r}(Icon),Time=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(e){var i;return _classCallCheck$4(this,r),(i=t.call(this,e)).isActiving=!1,i}return _createClass$5(r,[{key:"duration",get:function(){return this.playerConfig.customDuration||this.player.duration}},{key:"currentTime",get:function(){return this.player.currentTime||0}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"afterCreate",value:function(){var e=this,t=this.player.controls.config.mode;this.mode="flex"===t?"flex":"normal",this.config.disable||("flex"===this.mode&&(this.createCenterTime(),this.root.style.display="none"),this.durationDom=this.find(".time-duration"),this.timeDom=this.find(".time-current"),this.on(DURATION_CHANGE,(function(){e.onTimeUpdate()})),this.on(TIME_UPDATE,(function(){e.onTimeUpdate()})),this.on(ENDED,(function(){e.onTimeUpdate(!0)})),this.on(EMPTIED,(function(){e.onReset()})))}},{key:"show",value:function(){if("flex"===this.mode)return this.centerCurDom&&(this.centerCurDom.style.display="block"),void(this.centerDurDom&&(this.centerDurDom.style.display="block"));this.root.style.display="block"}},{key:"hide",value:function(){if("flex"===this.mode)return this.centerCurDom&&(this.centerCurDom.style.display="none"),void(this.centerDurDom&&(this.centerDurDom.style.display="none"));this.root.style.display="none"}},{key:"onTimeUpdate",value:function(e){var t=this.player,r=this.config,i=this.duration;if(!r.disable&&!this.isActiving&&t.hasStart){var n=t.currentTime+this.timeOffset;n=util.adjustTimeByDuration(n,i,e),"flex"===this.mode?(this.centerCurDom.innerHTML=util.format(n),i!==1/0&&i>0&&(this.centerDurDom.innerHTML=util.format(i))):(this.timeDom.innerHTML=util.format(n),i!==1/0&&i>0&&(this.durationDom.innerHTML=util.format(i)))}}},{key:"onReset",value:function(){"flex"===this.mode?(this.centerCurDom.innerHTML=util.format(0),this.centerDurDom.innerHTML=util.format(0)):(this.timeDom.innerHTML=util.format(0),this.durationDom.innerHTML=util.format(0))}},{key:"createCenterTime",value:function(){var e=this.player;if(e.controls&&e.controls.center){var t=e.controls.center;this.centerCurDom=util.createDom("xg-icon","00:00",{},"xgplayer-time xg-time-left"),this.centerDurDom=util.createDom("xg-icon","00:00",{},"xgplayer-time xg-time-right"),t.children.length>0?t.insertBefore(this.centerCurDom,t.children[0]):t.appendChild(this.centerCurDom),t.appendChild(this.centerDurDom)}}},{key:"afterPlayerInit",value:function(){var e=this.config;this.duration===1/0||this.playerConfig.isLive?(util.hide(this.durationDom),util.hide(this.timeDom),util.hide(this.find(".time-separator")),util.show(this.find(".time-live-tag"))):util.hide(this.find(".time-live-tag")),e.hide?this.hide():this.show()}},{key:"changeLiveState",value:function(e){e?(util.hide(this.durationDom),util.hide(this.timeDom),util.hide(this.find(".time-separator")),util.show(this.find(".time-live-tag"))):(util.hide(this.find(".time-live-tag")),util.show(this.find(".time-separator")),util.show(this.durationDom),util.show(this.timeDom))}},{key:"updateTime",value:function(e){this.isActiving=!0,!e&&0!==e||e>this.duration||("flex"!==this.mode?this.timeDom.innerHTML=util.format(e):this.centerCurDom.innerHTML=util.format(e))}},{key:"resetActive",value:function(){var e=this,t=this.player,r=function(){e.isActiving=!1};this.off(SEEKED,r),t.isSeeking?this.once(SEEKED,r):this.isActiving=!1}},{key:"destroy",value:function(){var e=this.player.controls.center;this.centerCurDom&&e.removeChild(this.centerCurDom),this.centerCurDom=null,this.centerDurDom&&e.removeChild(this.centerDurDom),this.centerDurDom=null}},{key:"render",value:function(){if(!this.config.disable)return'<xg-icon class="xgplayer-time">\n <span class="time-current">00:00</span>\n <span class="time-separator">/</span>\n <span class="time-duration">00:00</span>\n <span class="time-live-tag">'.concat(this.i18n.LIVE_TIP,"</span>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"time"}},{key:"defaultConfig",get:function(){return{position:POSITIONS$a.CONTROLS_LEFT,index:2,disable:!1}}}]),r}(Plugin);function volumeLargeSvg(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="0 -10 28 40">\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M358.4 358.4h-204.8v307.2h204.8l256 256v-819.2l-256 256z"></path>\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M940.632 837.632l-72.192-72.192c65.114-64.745 105.412-154.386 105.412-253.44s-40.299-188.695-105.396-253.424l-0.016-0.016 72.192-72.192c83.639 83.197 135.401 198.37 135.401 325.632s-51.762 242.434-135.381 325.612l-0.020 0.020zM795.648 693.248l-72.704-72.704c27.756-27.789 44.921-66.162 44.921-108.544s-17.165-80.755-44.922-108.546l0.002 0.002 72.704-72.704c46.713 46.235 75.639 110.363 75.639 181.248s-28.926 135.013-75.617 181.227l-0.021 0.021z"></path>\n</svg>\n',"image/svg+xml").firstChild}function volumeSmallSvg(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="0 -10 28 40">\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M358.4 358.4h-204.8v307.2h204.8l256 256v-819.2l-256 256z"></path>\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M795.648 693.248l-72.704-72.704c27.756-27.789 44.921-66.162 44.921-108.544s-17.165-80.755-44.922-108.546l0.002 0.002 72.704-72.704c46.713 46.235 75.639 110.363 75.639 181.248s-28.926 135.013-75.617 181.227l-0.021 0.021zM795.648 693.248l-72.704-72.704c27.756-27.789 44.921-66.162 44.921-108.544s-17.165-80.755-44.922-108.546l0.002 0.002 72.704-72.704c46.713 46.235 75.639 110.363 75.639 181.248s-28.926 135.013-75.617 181.227l-0.021 0.021z"></path>\n</svg>\n',"image/svg+xml").firstChild}function volumeMutedSvg(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="0 -10 28 40">\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M358.4 358.4h-204.8v307.2h204.8l256 256v-819.2l-256 256z"></path>\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M920.4 439.808l-108.544-109.056-72.704 72.704 109.568 108.544-109.056 108.544 72.704 72.704 108.032-109.568 108.544 109.056 72.704-72.704-109.568-108.032 109.056-108.544-72.704-72.704-108.032 109.568z"></path>\n</svg>\n',"image/svg+xml").firstChild}var Volume=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(){var e;_classCallCheck$4(this,r);for(var i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];return _defineProperty$5(_assertThisInitialized$4(e=t.call.apply(t,[this].concat(n))),"onBarMousedown",(function(t){var r=_assertThisInitialized$4(e).player,i=e.find(".xgplayer-bar");util.event(t);var n=i.getBoundingClientRect(),o=util.getEventPos(t,r.zoom),a=n.height-(o.clientY-n.top);if(o.h=a,o.barH=n.height,e.pos=o,!(a<-2))return e.updateVolumePos(a,t),document.addEventListener("mouseup",e.onBarMouseUp),e._d.isStart=!0,!1})),_defineProperty$5(_assertThisInitialized$4(e),"onBarMouseMove",(function(t){var r=_assertThisInitialized$4(e)._d;if(r.isStart){var i=_assertThisInitialized$4(e),n=i.pos,o=i.player;t.preventDefault(),t.stopPropagation(),util.event(t);var a=util.getEventPos(t,o.zoom);r.isMoving=!0;var s=n.h-a.clientY+n.clientY;s>n.barH||e.updateVolumePos(s,t)}})),_defineProperty$5(_assertThisInitialized$4(e),"onBarMouseUp",(function(t){util.event(t),document.removeEventListener("mouseup",e.onBarMouseUp);var r=_assertThisInitialized$4(e)._d;r.isStart=!1,r.isMoving=!1})),_defineProperty$5(_assertThisInitialized$4(e),"onMouseenter",(function(t){e._d.isActive=!0,e.focus(),e.emit("icon_mouseenter",{pluginName:e.pluginName})})),_defineProperty$5(_assertThisInitialized$4(e),"onMouseleave",(function(t){e._d.isActive=!1,e.unFocus(100,!1,t),e.emit("icon_mouseleave",{pluginName:e.pluginName})})),_defineProperty$5(_assertThisInitialized$4(e),"onVolumeChange",(function(t){if(e.player){var r=e.player,i=r.muted,n=r.volume;e._d.isMoving||(e.find(".xgplayer-drag").style.height=i||0===n?"4px":"".concat(100*n,"%"),e.config.showValueLabel&&e.updateVolumeValue()),e.animate(i,n)}})),e}return _createClass$5(r,[{key:"registerIcons",value:function(){return{volumeSmall:{icon:volumeSmallSvg,class:"xg-volume-small"},volumeLarge:{icon:volumeLargeSvg,class:"xg-volume"},volumeMuted:{icon:volumeMutedSvg,class:"xg-volume-mute"}}}},{key:"afterCreate",value:function(){var e=this;if(this._timerId=null,this._d={isStart:!1,isMoving:!1,isActive:!1},!this.config.disable){this.initIcons();var t=this.playerConfig,r=t.commonStyle,i=t.volume;r.volumeColor&&(this.find(".xgplayer-drag").style.backgroundColor=r.volumeColor),this.changeMutedHandler=this.hook("mutedChange",(function(t){e.changeMuted(t)}),{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this._onMouseenterHandler=this.hook("mouseenter",this.onMouseenter),this._onMouseleaveHandler=this.hook("mouseleave",this.onMouseleave),"mobile"!==sniffer$1.device&&"mobile"!==this.playerConfig.isMobileSimulateMode&&(this.bind("mouseenter",this._onMouseenterHandler),this.bind(["blur","mouseleave"],this._onMouseleaveHandler),this.bind(".xgplayer-slider","mousedown",this.onBarMousedown),this.bind(".xgplayer-slider","mousemove",this.onBarMouseMove),this.bind(".xgplayer-slider","mouseup",this.onBarMouseUp)),this.bind(".xgplayer-icon",["touchend","click"],this.changeMutedHandler),this.on(VOLUME_CHANGE,this.onVolumeChange),this.once(LOADED_DATA,this.onVolumeChange),"Number"!==util.typeOf(i)&&(this.player.volume=this.config.default),this.onVolumeChange()}}},{key:"updateVolumePos",value:function(e,t){var r=this.player,i=this.find(".xgplayer-drag"),n=this.find(".xgplayer-bar");if(n&&i){var o=parseInt(e/n.getBoundingClientRect().height*1e3,10);i.style.height="".concat(e,"px");var a=Math.max(Math.min(o/1e3,1),0),s={volume:{from:r.volume,to:a}};r.muted&&(s.muted={from:!0,to:!1}),this.emitUserAction(t,"change_volume",{muted:r.muted,volume:r.volume,props:s}),r.volume=Math.max(Math.min(o/1e3,1),0),r.muted&&(r.muted=!1),this.config.showValueLabel&&this.updateVolumeValue()}}},{key:"updateVolumeValue",value:function(){var e=this.player,t=e.volume,r=e.muted,i=this.find(".xgplayer-value-label"),n=Math.max(Math.min(t,1),0);i.innerText=r?0:Math.ceil(100*n)}},{key:"focus",value:function(){this.player.focus({autoHide:!1}),this._timerId&&(util.clearTimeout(this,this._timerId),this._timerId=null),util.addClass(this.root,"slide-show")}},{key:"unFocus",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2?arguments[2]:void 0,n=this._d,o=this.player;n.isActive||(this._timerId&&(util.clearTimeout(this,this._timerId),this._timerId=null),this._timerId=util.setTimeout(this,(function(){n.isActive||(r?o.blur():o.focus(),util.removeClass(e.root,"slide-show"),n.isStart&&e.onBarMouseUp(i)),e._timerId=null}),t))}},{key:"changeMuted",value:function(e){e&&e.stopPropagation();var t=this.player;this._d.isStart&&this.onBarMouseUp(e),this.emitUserAction(e,"change_muted",{muted:t.muted,volume:t.volume,props:{muted:{from:t.muted,to:!t.muted}}}),t.volume>0&&(t.muted=!t.muted),t.volume<.01&&(t.volume=this.config.miniVolume)}},{key:"animate",value:function(e,t){e||0===t?this.setAttr("data-state","mute"):t<.5&&this.icons.volumeSmall?this.setAttr("data-state","small"):this.setAttr("data-state","normal")}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.volumeSmall),this.appendChild(".xgplayer-icon",e.volumeLarge),this.appendChild(".xgplayer-icon",e.volumeMuted)}},{key:"destroy",value:function(){this._timerId&&(util.clearTimeout(this,this._timerId),this._timerId=null),this.unbind("mouseenter",this.onMouseenter),this.unbind(["blur","mouseleave"],this.onMouseleave),this.unbind(".xgplayer-slider","mousedown",this.onBarMousedown),this.unbind(".xgplayer-slider","mousemove",this.onBarMouseMove),this.unbind(".xgplayer-slider","mouseup",this.onBarMouseUp),document.removeEventListener("mouseup",this.onBarMouseUp),this.unbind(".xgplayer-icon","mobile"===sniffer$1.device?"touchend":"click",this.changeMutedHandler)}},{key:"render",value:function(){if(!this.config.disable){var e=this.config.default||this.player.volume,t=this.config.showValueLabel;return'\n <xg-icon class="xgplayer-volume" data-state="normal">\n <div class="xgplayer-icon">\n </div>\n <xg-slider class="xgplayer-slider">\n '.concat(t?'<div class="xgplayer-value-label">'.concat(100*e,"</div>"):"",'\n <div class="xgplayer-bar">\n <xg-drag class="xgplayer-drag" style="height: ').concat(100*e,'%"></xg-drag>\n </div>\n </xg-slider>\n </xg-icon>')}}}],[{key:"pluginName",get:function(){return"volume"}},{key:"defaultConfig",get:function(){return{position:POSITIONS$a.CONTROLS_RIGHT,index:1,disable:!1,showValueLabel:!1,default:.6,miniVolume:.2}}}]),r}(Plugin);function RotateSvg(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="-4 -6 40 40" fill="none">\n <g clip-path="url(#clip0)">\n <path transform="scale(1.5 1.5)" d="M11.6665 9.16663H4.1665C2.78579 9.16663 1.6665 10.2859 1.6665 11.6666V15.8333C1.6665 17.214 2.78579 18.3333 4.1665 18.3333H11.6665C13.0472 18.3333 14.1665 17.214 14.1665 15.8333V11.6666C14.1665 10.2859 13.0472 9.16663 11.6665 9.16663Z" fill="white"/>\n <path transform="scale(1.5 1.5)" fill-rule="evenodd" clip-rule="evenodd" d="M3.88148 4.06298C3.75371 4.21005 3.67667 4.40231 3.67749 4.61242C3.67847 4.87253 3.79852 5.10435 3.98581 5.25646L6.99111 8.05895C7.32771 8.37283 7.85502 8.35443 8.16891 8.01782C8.48279 7.68122 8.46437 7.15391 8.12778 6.84003L6.62061 5.43457L9.8198 5.4224C9.82848 5.42239 9.8372 5.42221 9.84591 5.4219C10.9714 5.38233 12.0885 5.6285 13.0931 6.13744C14.0976 6.64635 14.957 7.40148 15.5908 8.33234C16.2246 9.2632 16.6122 10.3394 16.7177 11.4606C16.823 12.5819 16.6427 13.7115 16.1934 14.7442C16.0098 15.1661 16.203 15.6571 16.6251 15.8408C17.0471 16.0243 17.5381 15.8311 17.7216 15.4091C18.2833 14.1183 18.5087 12.7063 18.3771 11.3047C18.2453 9.90318 17.7607 8.55792 16.9684 7.39433C16.1761 6.23073 15.1021 5.28683 13.8463 4.65065C12.5946 4.01651 11.203 3.70872 9.80072 3.75583L6.43415 3.76862L7.96326 2.12885C8.27715 1.79225 8.25872 1.26494 7.92213 0.951061C7.58553 0.63718 7.05822 0.655585 6.74433 0.99219L3.90268 4.0395C3.89545 4.04724 3.88841 4.05509 3.88154 4.06303L3.88148 4.06298Z" fill="white"/>\n </g>\n <defs>\n <clipPath id="clip0">\n <rect width="40" height="40" fill="white"/>\n </clipPath>\n </defs>\n</svg>\n',"image/svg+xml").firstChild}var Rotate=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(e){var i;return _classCallCheck$4(this,r),(i=t.call(this,e)).rotateDeg=i.config.rotateDeg||0,i}return _createClass$5(r,[{key:"afterCreate",value:function(){var e=this;this.config.disable||(_get$2(_getPrototypeOf$4(r.prototype),"afterCreate",this).call(this),this.appendChild(".xgplayer-icon",this.icons.rotate),this.onBtnClick=this.onBtnClick.bind(this),this.bind(".xgplayer-icon",["click","touchend"],this.onBtnClick),this.on(VIDEO_RESIZE,(function(){e.rotateDeg&&util.setTimeout(e,(function(){e.updateRotateDeg(e.rotateDeg,e.config.innerRotate)}),100)})),this.rotateDeg&&this.updateRotateDeg(this.rotateDeg,this.config.innerRotate))}},{key:"destroy",value:function(){_get$2(_getPrototypeOf$4(r.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon",["click","touchend"],this.onBtnClick)}},{key:"onBtnClick",value:function(e){e.preventDefault(),e.stopPropagation(),this.emitUserAction(e,"rotate"),this.rotate(this.config.clockwise,this.config.innerRotate,1)}},{key:"updateRotateDeg",value:function(e,t){var r=this.player;if(e||(e=0),t)this.player.videoRotateDeg=e;else{var i=this.player,n=i.root,o=i.innerContainer,a=this.player.media,s=n.offsetWidth,l=o&&t?o.offsetHeight:n.offsetHeight,c="100%",u="100%",h=0,d=0;.75!==e&&.25!==e||(c="".concat(l,"px"),u="".concat(s,"px"),h=-(l-s)/2,d=-(s-l)/2);var p="translate(".concat(h,"px,").concat(d,"px) rotate(").concat(e,"turn)"),f={transformOrigin:"center center",transform:p,webKitTransform:p,height:u,width:c},g=t?a:n,y=t?r.getPlugin("poster"):null;Object.keys(f).map((function(e){g.style[e]=f[e],y&&y.root&&(y.root.style[e]=f[e])}))}}},{key:"rotate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=this.player;this.rotateDeg||(this.rotateDeg=0);var n=e?1:-1;this.rotateDeg=(this.rotateDeg+1+.25*n*r)%1,this.updateRotateDeg(this.rotateDeg,t),i.emit(ROTATE,360*this.rotateDeg)}},{key:"registerIcons",value:function(){return{rotate:RotateSvg}}},{key:"render",value:function(){if(!this.config.disable)return'\n <xg-icon class="xgplayer-rotate">\n <div class="xgplayer-icon">\n </div>\n '.concat(xgIconTips(this,"ROTATE_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"rotate"}},{key:"defaultConfig",get:function(){return{position:POSITIONS$a.CONTROLS_RIGHT,index:6,innerRotate:!0,clockwise:!1,rotateDeg:0,disable:!1}}}]),r}(Icon);function PipIcon(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M16.5 4.3H3.5C3.38954 4.3 3.3 4.38954 3.3 4.5V15.5C3.3 15.6105 3.38954 15.7 3.5 15.7H8.50005L8.50006 17.5H3.5C2.39543 17.5 1.5 16.6046 1.5 15.5V4.5C1.5 3.39543 2.39543 2.5 3.5 2.5H16.5C17.6046 2.5 18.5 3.39543 18.5 4.5V8.5H16.7V4.5C16.7 4.38954 16.6105 4.3 16.5 4.3ZM12 11.5C11.4477 11.5 11 11.9477 11 12.5L11 16.5C11 17.0523 11.4478 17.5 12 17.5H17.5C18.0523 17.5 18.5 17.0523 18.5 16.5L18.5 12.5C18.5 11.9477 18.0523 11.5 17.5 11.5H12Z"\n fill="white" />\n</svg>',"image/svg+xml").firstChild}function PipIconExit(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M16.5 4.3H3.5C3.38954 4.3 3.3 4.38954 3.3 4.5V15.5C3.3 15.6105 3.38954 15.7 3.5 15.7H8.50005L8.50006 17.5H3.5C2.39543 17.5 1.5 16.6046 1.5 15.5V4.5C1.5 3.39543 2.39543 2.5 3.5 2.5H16.5C17.6046 2.5 18.5 3.39543 18.5 4.5V8.5H16.7V4.5C16.7 4.38954 16.6105 4.3 16.5 4.3ZM12 11.5C11.4477 11.5 11 11.9477 11 12.5L11 16.5C11 17.0523 11.4478 17.5 12 17.5H17.5C18.0523 17.5 18.5 17.0523 18.5 16.5L18.5 12.5C18.5 11.9477 18.0523 11.5 17.5 11.5H12Z"\n fill="white" />\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M9.4998 7.7C9.77595 7.7 9.9998 7.47614 9.9998 7.2V6.5C9.9998 6.22386 9.77595 6 9.4998 6H5.5402L5.52754 6.00016H5.5C5.22386 6.00016 5 6.22401 5 6.50016V10.4598C5 10.7359 5.22386 10.9598 5.5 10.9598H6.2C6.47614 10.9598 6.7 10.7359 6.7 10.4598V8.83005L8.76983 10.9386C8.96327 11.1357 9.27984 11.1386 9.47691 10.9451L9.97645 10.4548C10.1735 10.2613 10.1764 9.94476 9.983 9.7477L7.97289 7.7H9.4998Z"\n fill="white" />\n</svg>',"image/svg+xml").firstChild}var PresentationMode={PIP:"picture-in-picture",INLINE:"inline",FULLSCREEN:"fullscreen"},PIP=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(){var e;_classCallCheck$4(this,r);for(var i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];return _defineProperty$5(_assertThisInitialized$4(e=t.call.apply(t,[this].concat(n))),"switchPIP",(function(t){if(!e.isPIPAvailable())return!1;t.stopPropagation&&t.stopPropagation(),e.isPip?(e.exitPIP(),e.emitUserAction(t,"change_pip",{props:"pip",from:!0,to:!1}),e.setAttr("data-state","normal")):4===e.player.media.readyState&&(e.requestPIP(),e.emitUserAction(t,"change_pip",{props:"pip",from:!1,to:!0}),e.setAttr("data-state","pip"))})),e}return _createClass$5(r,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.pip&&(e.config.showIcon=e.player.config.pip)}},{key:"afterCreate",value:function(){var e=this;this.isPIPAvailable()&&(_get$2(_getPrototypeOf$4(r.prototype),"afterCreate",this).call(this),this.pMode=PresentationMode.INLINE,this.initPipEvents(),this.config.showIcon&&this.initIcons(),this.once(COMPLETE,(function(){e.config.showIcon&&(util.removeClass(e.find(".xgplayer-icon"),"xg-icon-disable"),e.bind("click",e.switchPIP))})))}},{key:"registerIcons",value:function(){return{pipIcon:{icon:PipIcon,class:"xg-get-pip"},pipIconExit:{icon:PipIconExit,class:"xg-exit-pip"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.pipIcon),this.appendChild(".xgplayer-icon",e.pipIconExit)}},{key:"initPipEvents",value:function(){var e=this,t=this.player;this.leavePIPCallback=function(){var r=t.paused;util.setTimeout(e,(function(){!r&&t.mediaPlay()}),0),!r&&t.mediaPlay(),e.setAttr("data-state","normal"),t.emit(PIP_CHANGE,!1)},this.enterPIPCallback=function(r){t.emit(PIP_CHANGE,!0),e.pipWindow=r.pictureInPictureWindow,e.setAttr("data-state","pip")},this.onWebkitpresentationmodechanged=function(r){var i=t.media.webkitPresentationMode;e.pMode===PresentationMode.FULLSCREEN&&i!==PresentationMode.FULLSCREEN&&t.onFullscreenChange(null,!1),e.pMode=i,i===PresentationMode.PIP?e.enterPIPCallback(r):i===PresentationMode.INLINE&&e.leavePIPCallback(r)},t.media&&(t.media.addEventListener("enterpictureinpicture",this.enterPIPCallback),t.media.addEventListener("leavepictureinpicture",this.leavePIPCallback),r.checkWebkitSetPresentationMode(t.media)&&t.media.addEventListener("webkitpresentationmodechanged",this.onWebkitpresentationmodechanged))}},{key:"requestPIP",value:function(){var e=this.player,t=this.playerConfig;if(this.isPIPAvailable()&&!this.isPip)try{var i=t.poster;return i&&(e.media.poster="String"===util.typeOf(i)?i:i.poster),r.checkWebkitSetPresentationMode(e.media)?e.media.webkitSetPresentationMode("picture-in-picture"):e.media.requestPictureInPicture(),!0}catch(n){return console.error("requestPiP",n),!1}}},{key:"exitPIP",value:function(){var e=this.player;try{return this.isPIPAvailable()&&this.isPip&&(r.checkWebkitSetPresentationMode(e.media)?e.media.webkitSetPresentationMode("inline"):document.exitPictureInPicture()),!0}catch(t){return console.error("exitPIP",t),!1}}},{key:"isPip",get:function(){var e=this.player;return document.pictureInPictureElement&&document.pictureInPictureElement===e.media||e.media.webkitPresentationMode===PresentationMode.PIP}},{key:"isPIPAvailable",value:function(){var e=this.player.media;return("Boolean"!==util.typeOf(document.pictureInPictureEnabled)||document.pictureInPictureEnabled)&&("Boolean"===util.typeOf(e.disablePictureInPicture)&&!e.disablePictureInPicture||e.webkitSupportsPresentationMode&&"Function"===util.typeOf(e.webkitSetPresentationMode))}},{key:"destroy",value:function(){_get$2(_getPrototypeOf$4(r.prototype),"destroy",this).call(this);var e=this.player;e.media.removeEventListener("enterpictureinpicture",this.enterPIPCallback),e.media.removeEventListener("leavepictureinpicture",this.leavePIPCallback),r.checkWebkitSetPresentationMode(e.media)&&e.media.removeEventListener("webkitpresentationmodechanged",this.onWebkitpresentationmodechanged),this.exitPIP(),this.unbind("click",this.btnClick)}},{key:"render",value:function(){if(this.config.showIcon&&this.isPIPAvailable())return'<xg-icon class="xgplayer-pip">\n <div class="xgplayer-icon xg-icon-disable">\n </div>\n '.concat(xgIconTips(this,"PIP",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"pip"}},{key:"defaultConfig",get:function(){return{position:POSITIONS$a.CONTROLS_RIGHT,index:6,showIcon:!1}}},{key:"checkWebkitSetPresentationMode",value:function(e){return"function"==typeof e.webkitSetPresentationMode}}]),r}(Icon);function Next(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="40" viewBox="10 0 24 40">\n <path transform="scale(0.038 0.028)" d="M800 380v768h-128v-352l-320 320v-704l320 320v-352z"></path>\n</svg>\n',"image/svg+xml").firstChild}var PlayNextIcon=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(e){var i;return _classCallCheck$4(this,r),_defineProperty$5(_assertThisInitialized$4(i=t.call(this,e)),"playNext",(function(e){var t=_assertThisInitialized$4(i).player;e.preventDefault(),e.stopPropagation(),i.idx+1<i.config.urlList.length?(i.idx++,i.nextHandler(i.config.urlList[i.idx],i.idx),t.emit(PLAYNEXT,i.idx+1)):(i.nextHandler(),t.emit(PLAYNEXT))})),i.idx=-1,i}return _createClass$5(r,[{key:"afterCreate",value:function(){this.config.urlList&&0!==this.config.urlList.length&&(this.appendChild(".xgplayer-icon",this.icons.playNext),this.initEvents())}},{key:"registerIcons",value:function(){return{playNext:Next}}},{key:"initEvents",value:function(){this.nextHandler=this.hook("nextClick",this.changeSrc);var e="mobile"===sniffer$1.device?"touchend":"click";this.bind(e,this.playNext),this.show()}},{key:"changeSrc",value:function(e){var t=this.player;e&&(t.pause(),t.currentTime=0,t.switchURL?t.switchURL(e):t.src=e,t.config.url=e,t.play())}},{key:"destroy",value:function(){this.unbind(["touchend","click"],this.playNext)}},{key:"render",value:function(){if(this.config.urlList&&0!==this.config.urlList.length)return'\n <xg-icon class="xgplayer-playnext">\n <div class="xgplayer-icon">\n </div>\n '.concat(xgIconTips(this,"PLAYNEXT_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>\n ")}}],[{key:"pluginName",get:function(){return"playNext"}},{key:"defaultConfig",get:function(){return{position:POSITIONS$a.CONTROLS_LEFT,index:1,url:null,urlList:[]}}}]),r}(Plugin),download={exports:{}},module2;module2=download,module2.exports=function e(t,r,i){var n,o,a=window,s="application/octet-stream",l=i||s,c=t,u=!r&&!i&&c,h=document.createElement("a"),d=function(e){return String(e)},p=a.Blob||a.MozBlob||a.WebKitBlob||d,f=r||"download";if(p=p.call?p.bind(a):Blob,"true"===String(this)&&(l=(c=[c,l])[0],c=c[1]),u&&u.length<2048&&(f=u.split("/").pop().split("?")[0],h.href=u,-1!==h.href.indexOf(u))){var g=new XMLHttpRequest;return g.open("GET",u,!0),g.responseType="blob",g.onload=function(t){e(t.target.response,f,s)},setTimeout((function(){g.send()}),0),g}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(c)){if(!(c.length>2096103.424&&p!==d))return navigator.msSaveBlob?navigator.msSaveBlob(_(c),f):b(c);l=(c=_(c)).type||s}else if(/([\x80-\xff])/.test(c)){for(var y=0,v=new Uint8Array(c.length),m=v.length;y<m;++y)v[y]=c.charCodeAt(y);c=new p([v],{type:l})}function _(e){for(var t=e.split(/[:;,]/),r=t[1],i=("base64"==t[2]?atob:decodeURIComponent)(t.pop()),n=i.length,o=0,a=new Uint8Array(n);o<n;++o)a[o]=i.charCodeAt(o);return new p([a],{type:r})}function b(e,t){if("download"in h)return h.href=e,h.setAttribute("download",f),h.className="download-js-link",h.innerHTML="downloading...",h.style.display="none",document.body.appendChild(h),setTimeout((function(){h.click(),document.body.removeChild(h),!0===t&&setTimeout((function(){a.URL.revokeObjectURL(h.href)}),250)}),66),!0;if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent))return/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,s)),window.open(e)||confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")&&(location.href=e),!0;var r=document.createElement("iframe");document.body.appendChild(r),!t&&/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,s)),r.src=e,setTimeout((function(){document.body.removeChild(r)}),333)}if(n=c instanceof p?c:new p([c],{type:l}),navigator.msSaveBlob)return navigator.msSaveBlob(n,f);if(a.URL)b(a.URL.createObjectURL(n),!0);else{if("string"==typeof n||n.constructor===d)try{return b("data:"+l+";base64,"+a.btoa(n))}catch(T){return b("data:"+l+","+encodeURIComponent(n))}(o=new FileReader).onload=function(e){b(this.result)},o.readAsDataURL(n)}return!0};var downloadUtil=download.exports;function DownloadSvg(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24">\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g transform="translate(-488.000000, -340.000000)" fill="#FFFFFF">\n <g id="Group-2">\n <g id="volme_big-copy" transform="translate(488.000000, 340.000000)">\n <rect id="Rectangle-18" x="11" y="4" width="2" height="12" rx="1"></rect>\n <rect id="Rectangle-2" x="3" y="18" width="18" height="2" rx="1"></rect>\n <rect id="Rectangle-2" transform="translate(4.000000, 17.500000) rotate(90.000000) translate(-4.000000, -17.500000) " x="1.5" y="16.5" width="5" height="2" rx="1"></rect><rect id="Rectangle-2-Copy-3" transform="translate(20.000000, 17.500000) rotate(90.000000) translate(-20.000000, -17.500000) " x="17.5" y="16.5" width="5" height="2" rx="1"></rect>\n <path d="M9.48791171,8.26502656 L9.48791171,14.2650266 C9.48791171,14.8173113 9.04019646,15.2650266 8.48791171,15.2650266 C7.93562696,15.2650266 7.48791171,14.8173113 7.48791171,14.2650266 L7.48791171,7.26502656 C7.48791171,6.71274181 7.93562696,6.26502656 8.48791171,6.26502656 L15.4879117,6.26502656 C16.0401965,6.26502656 16.4879117,6.71274181 16.4879117,7.26502656 C16.4879117,7.81731131 16.0401965,8.26502656 15.4879117,8.26502656 L9.48791171,8.26502656 Z" id="Combined-Shape" transform="translate(11.987912, 10.765027) scale(1, -1) rotate(45.000000) translate(-11.987912, -10.765027) "></path>\n </g>\n </g>\n </g>\n </g>\n</svg>\n',"image/svg+xml").firstChild}var Download=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(e){var i;return _classCallCheck$4(this,r),_defineProperty$5(_assertThisInitialized$4(i=t.call(this,e)),"download",(function(e){if(!i.isLock){i.emitUserAction(e,"download");var t=i.getAbsoluteURL(i.player.src);downloadUtil(t),i.isLock=!0,i.timer=window.setTimeout((function(){i.isLock=!1,window.clearTimeout(i.timer),i.timer=null}),300)}})),i.timer=null,i.isLock=!1,i}return _createClass$5(r,[{key:"afterCreate",value:function(){_get$2(_getPrototypeOf$4(r.prototype),"afterCreate",this).call(this),this.config.disable||(this.appendChild(".xgplayer-icon",this.icons.download),this._handler=this.hook("click",this.download,{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.bind(["click","touchend"],this._handler))}},{key:"registerIcons",value:function(){return{download:DownloadSvg}}},{key:"getAbsoluteURL",value:function(e){if(!e.match(/^https?:\/\//)){var t=document.createElement("div");t.innerHTML='<a href="'.concat(e,'">x</a>'),e=t.firstChild.href}return e}},{key:"destroy",value:function(){_get$2(_getPrototypeOf$4(r.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.download),window.clearTimeout(this.timer),this.timer=null}},{key:"render",value:function(){if(!this.config.disable)return'<xg-icon class="xgplayer-download">\n <div class="xgplayer-icon">\n </div>\n '.concat(xgIconTips(this,"DOWNLOAD_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"download"}},{key:"defaultConfig",get:function(){return{position:POSITIONS$a.CONTROLS_RIGHT,index:3,disable:!0}}}]),r}(Icon),ScreenShot=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(){return _classCallCheck$4(this,r),t.apply(this,arguments)}return _createClass$5(r,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.screenShot&&(e.config.disable=!e.player.config.screenShot)}},{key:"afterCreate",value:function(){_get$2(_getPrototypeOf$4(r.prototype),"afterCreate",this).call(this),this.appendChild(".xgplayer-icon",this.icons.screenshotIcon);var e=this.config;this.initSize=function(t){e.fitVideo&&(e.width=t.vWidth,e.height=t.vHeight)},this.once(VIDEO_RESIZE,this.initSize)}},{key:"onPluginsReady",value:function(){this.show(),this.onClickBtn=this.onClickBtn.bind(this),this.bind(["click","touchend"],this.onClickBtn)}},{key:"saveScreenShot",value:function(e,t){var r=document.createElement("a");r.href=e,r.download=t;var i=document.createEvent("MouseEvents");i.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),r.dispatchEvent(i)}},{key:"createCanvas",value:function(e,t){var r=document.createElement("canvas"),i=r.getContext("2d");this.canvasCtx=i,this.canvas=r,r.width=e||this.config.width,r.height=t||this.config.height,i.imageSmoothingEnabled=!0,i.imageSmoothingEnabled&&(i.imageSmoothingQuality="high")}},{key:"onClickBtn",value:function(e){var t=this;e.preventDefault(),e.stopPropagation(),this.emitUserAction(e,"shot"),this.shot().then((function(e){t.emit(SCREEN_SHOT,e),t.saveScreenShot(e,t.config.name+t.config.format)}))}},{key:"shot",value:function(e,t){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{quality:.92,type:"image/png"},n=this.config,o=this.player,a=i.quality||n.quality,s=i.type||n.type;return new Promise((function(i,l){var c,u=null;if(o.media.canvas)u=o.media.canvas;else{r.canvas?(r.canvas.width=e||n.width,r.canvas.height=t||n.height):r.createCanvas(e,t),u=r.canvas,c=r.canvasCtx;var h,d,p,f,g=o.media.videoWidth/o.media.videoHeight,y=u.width/u.height,v=o.media.videoWidth,m=o.media.videoHeight;g>y?(p=u.width,f=u.width/g,h=0,d=Math.round((u.height-f)/2)):g===y?(p=u.width,f=u.height,h=0,d=0):g<y&&(p=u.height*g,f=u.height,h=Math.round((u.width-p)/2),d=0),c.drawImage(o.media,0,0,v,m,h,d,p,f)}var _=u.toDataURL(s,a).replace(s,"image/octet-stream");i(_=_.replace(/^data:image\/[^;]+/,"data:application/octet-stream"))}))}},{key:"registerIcons",value:function(){return{screenshotIcon:null}}},{key:"destroy",value:function(){_get$2(_getPrototypeOf$4(r.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.onClickBtn),this.off(VIDEO_RESIZE,this.initSize)}},{key:"render",value:function(){if(!this.config.disable){var e=this.icons.screenshotIcon?"xgplayer-icon":"xgplayer-icon btn-text",t="SCREENSHOT";return'\n <xg-icon class="xgplayer-shot">\n <div class="'.concat(e,'">\n ').concat(this.icons.screenshotIcon?"":'<span lang-key="'.concat(this.i18nKeys[t],'">').concat(this.i18n[t],"</span>"),"\n </div>\n </xg-icon>")}}}],[{key:"pluginName",get:function(){return"screenShot"}},{key:"defaultConfig",get:function(){return{position:POSITIONS$a.CONTROLS_RIGHT,index:5,quality:.92,type:"image/png",format:".png",width:600,height:337,fitVideo:!0,disable:!1,name:"screenshot"}}}]),r}(Icon),OptionList=function(){function e(t){_classCallCheck$4(this,e),this.config=t.config,this.parent=t.root,this.root=util.createDom("ul","",{},"xg-options-list ".concat(this.config.className)),t.root.appendChild(this.root),this.onItemClick=this.onItemClick.bind(this),this.renderItemList();var r="mobile"===sniffer$1.device?"touchend":"click";this._delegates=Plugin.delegate.call(this,this.root,"li",r,this.onItemClick)}return _createClass$5(e,[{key:"renderItemList",value:function(e){var t=this,r=this.config,i=this.root;e?r.data=e:e=r.data,r.style&&Object.keys(r.style).map((function(e){i.style[e]=r[e]})),e.length>0&&(this.attrKeys=Object.keys(e[0])),this.root.innerHTML="",e.map((function(e,r){var i=e.selected?"option-item selected":"option-item";e["data-index"]=r,t.root.appendChild(util.createDom("li","<span>".concat(e.showText,"</span>"),e,i))}))}},{key:"onItemClick",value:function(e){e.delegateTarget||(e.delegateTarget=e.target);var t=e.delegateTarget;if(t&&util.hasClass(t,"selected"))return!1;var r="function"==typeof this.config.onItemClick?this.config.onItemClick:null,i=this.root.querySelector(".selected");util.addClass(t,"selected"),i&&util.removeClass(i,"selected"),r(e,{from:i?this.getAttrObj(i,this.attrKeys):null,to:this.getAttrObj(t,this.attrKeys)})}},{key:"getAttrObj",value:function(e,t){if(!e||!t)return{};var r={};t.map((function(t){r[t]=e.getAttribute(t)}));var i=e.getAttribute("data-index");return i&&(r.index=Number(i)),r}},{key:"show",value:function(){util.removeClass(this.root,"hide"),util.addClass(this.root,"active")}},{key:"hide",value:function(){util.removeClass(this.root,"active"),util.addClass(this.root,"hide")}},{key:"setStyle",value:function(e){var t=this;Object.keys(e).forEach((function(r){t.root.style[r]=e[r]}))}},{key:"destroy",value:function(){this._delegates&&(this._delegates.map((function(e){e.destroy&&e.destroy()})),this._delegates=null),this.root.innerHTML=null,this.parent.removeChild(this.root),this.root=null}}]),e}(),LIST_TYPES={SIDE:"side",MIDDLE:"middle"},TOGGLE_MODES={CLICK:"click",HOVER:"hover"};function getListClassName(e,t){return e===LIST_TYPES.SIDE?t===POSITIONS$a.CONTROLS_LEFT?"xg-side-list xg-left-side":"xg-side-list xg-right-side":""}var IS_MOBILE$2="mobile"===sniffer$1.device,OptionsIcon=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(e){var i;return _classCallCheck$4(this,r),_defineProperty$5(_assertThisInitialized$4(i=t.call(this,e)),"onEnter",(function(e){e.preventDefault(),e.stopPropagation(),i.emit("icon_mouseenter",{pluginName:i.pluginName}),i.switchActiveState(e)})),_defineProperty$5(_assertThisInitialized$4(i),"switchActiveState",(function(e){e.preventDefault(),e.stopPropagation(),i.config.toggleMode===TOGGLE_MODES.CLICK?i.toggle(!i.isActive):i.toggle(!0)})),_defineProperty$5(_assertThisInitialized$4(i),"onLeave",(function(e){e.preventDefault(),e.stopPropagation(),i.emit("icon_mouseleave",{pluginName:i.pluginName}),i.config.listType!==LIST_TYPES.SIDE&&i.isActive&&i.toggle(!1)})),_defineProperty$5(_assertThisInitialized$4(i),"onListEnter",(function(e){i.enterType=2})),_defineProperty$5(_assertThisInitialized$4(i),"onListLeave",(function(e){i.enterType=0,i.isActive&&i.toggle(!1)})),i.isIcons=!1,i.isActive=!1,i.curValue=null,i.curIndex=0,i}return _createClass$5(r,[{key:"updateLang",value:function(e){this.renderItemList(this.config.list,this.curIndex)}},{key:"afterCreate",value:function(){var e=this,t=this.config;this.initIcons(),IS_MOBILE$2&&t.listType!==LIST_TYPES.MIDDLE&&(t.listType=LIST_TYPES.SIDE),t.hidePortrait&&util.addClass(this.root,"portrait"),this.once(CANPLAY,(function(){t.list&&t.list.length>0&&(e.renderItemList(t.list),e.show())})),IS_MOBILE$2&&this.on(PLAYER_FOCUS,(function(){e.isActive&&(e.optionsList&&e.optionsList.hide(),e.isActive=!1)})),IS_MOBILE$2?(t.toggleMode=TOGGLE_MODES.CLICK,this.activeEvent="touchend"):this.activeEvent=t.toggleMode===TOGGLE_MODES.CLICK?"click":"mouseenter",t.toggleMode===TOGGLE_MODES.CLICK?this.bind(this.activeEvent,this.switchActiveState):(this.bind(this.activeEvent,this.onEnter),this.bind("mouseleave",this.onLeave)),this.isIcons&&this.bind("click",this.onIconClick)}},{key:"initIcons",value:function(){var e=this,t=this.icons,r=Object.keys(t),i=!1;r.length>0&&(r.forEach((function(r){e.appendChild(".xgplayer-icon",t[r]),!i&&(i=t[r])})),this.isIcons=i),i||(this.appendChild(".xgplayer-icon",util.createDom("span","",{},"icon-text")),util.addClass(this.find(".xgplayer-icon"),"btn-text"))}},{key:"show",value:function(){!this.config.list||this.config.list.length<2||util.addClass(this.root,"show")}},{key:"hide",value:function(){util.removeClass(this.root,"show")}},{key:"getTextByLang",value:function(e,t,r){if(void 0===e)return"";var i=this.config.list;!r&&(r=this.player.lang),t=!t||util.isUndefined(e[t])?"text":t,"number"==typeof e&&(e=i[e]);try{return"object"===_typeof$3(e[t])?e[t][r]||e[t].en:e[t]}catch(n){return console.warn(n),""}}},{key:"toggle",value:function(e){if(e!==this.isActive){var t=this.player.controls,r=this.config.listType;e?(r===LIST_TYPES.SIDE?t.blur():t.focus(),this.optionsList&&this.optionsList.show()):(r===LIST_TYPES.SIDE?t.focus():t.focusAwhile(),this.optionsList&&this.optionsList.hide()),this.isActive=e}}},{key:"onItemClick",value:function(e,t){e.preventDefault(),e.stopPropagation();var r=this.config,i=r.listType,n=r.list;this.curIndex=t.to.index,this.curItem=n[this.curIndex],this.changeCurrentText(),(this.config.isItemClickHide||IS_MOBILE$2||i===LIST_TYPES.SIDE)&&this.toggle(!1)}},{key:"onIconClick",value:function(e){}},{key:"changeCurrentText",value:function(){if(!this.isIcons){var e=this.config.list,t=e[this.curIndex<e.length?this.curIndex:0];t&&(this.find(".icon-text").innerHTML=this.getTextByLang(t,"iconText"))}}},{key:"renderItemList",value:function(e,t){var r=this,i=this.config,n=this.optionsList,o=this.player;if("number"==typeof t&&(this.curIndex=t,this.curItem=i.list[t]),n)return n.renderItemList(e),void this.changeCurrentText();var a={config:{data:e||[],className:getListClassName(i.listType,i.position),onItemClick:function(e,t){r.onItemClick(e,t)}},root:i.listType===LIST_TYPES.SIDE?o.innerContainer||o.root:this.root};this.config.isShowIcon&&(this.optionsList=new OptionList(a),this.changeCurrentText(),this.show());var s=this.player.root.getBoundingClientRect().height,l=i.listType===LIST_TYPES.MIDDLE?s-50:s;this.optionsList&&this.optionsList.setStyle({maxHeight:"".concat(l,"px")})}},{key:"destroy",value:function(){this.config.toggleMode===TOGGLE_MODES.CLICK?this.unbind(this.activeEvent,this.switchActiveState):(this.unbind(this.activeEvent,this.onEnter),this.unbind("mouseleave",this.onLeave)),this.isIcons&&this.unbind("click",this.onIconClick),this.optionsList&&(this.optionsList.destroy(),this.optionsList=null)}},{key:"render",value:function(){if(this.config.isShowIcon)return'<xg-icon class="xg-options-icon '.concat(this.config.className||"",'">\n <div class="xgplayer-icon">\n </div>\n </xg-icon>')}}],[{key:"pluginName",get:function(){return"optionsIcon"}},{key:"defaultConfig",get:function(){return{position:POSITIONS$a.CONTROLS_RIGHT,index:100,list:[],listType:"middle",listStyle:{},hidePortrait:!0,isShowIcon:!1,isItemClickHide:!0,toggleMode:TOGGLE_MODES.HOVER}}}]),r}(Plugin),DefinitionIcon=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(e){var i;return _classCallCheck$4(this,r),(i=t.call(this,e)).curTime=0,i.isPaused=!0,i}return _createClass$5(r,[{key:"beforeCreate",value:function(e){var t=e.config.list;Array.isArray(t)&&t.length>0&&(e.config.list=t.map((function(e){return!e.text&&e.name&&(e.text=e.name),e.text||(e.text=e.definition),e})))}},{key:"afterCreate",value:function(){var e=this;_get$2(_getPrototypeOf$4(r.prototype),"afterCreate",this).call(this),this.on("resourceReady",(function(t){e.changeDefinitionList(t)})),this.on(DEFINITION_CHANGE,(function(t){e.renderItemList(e.config.list,t.to)})),this.player.definitionList.length<2&&this.hide()}},{key:"show",value:function(){!this.config.list||this.config.list.length<2||util.addClass(this.root,"show")}},{key:"initDefinition",value:function(){var e=this.config,t=e.list,r=e.defaultDefinition;if(t.length>0){var i=null;t.map((function(e){e.definition===r&&(i=e)})),i||(i=t[0]),this.changeDefinition(i)}}},{key:"renderItemList",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.list||[],i=arguments.length>1?arguments[1]:void 0,n=i&&i.definition?i.definition:this.config.defaultDefinition;i&&t.forEach((function(e){e.selected=!1}));var o=0,a=t.map((function(t,r){var i=_objectSpread2$4(_objectSpread2$4({},t),{},{showText:e.getTextByLang(t)||t.definition,selected:!1});return(t.selected||t.definition&&t.definition==n)&&(i.selected=!0,o=r),i}));_get$2(_getPrototypeOf$4(r.prototype),"renderItemList",this).call(this,a,o)}},{key:"changeDefinitionList",value:function(e){Array.isArray(e)&&(this.config.list=e.map((function(e){return!e.text&&e.name&&(e.text=e.name),e.text||(e.text=e.definition),e})),this.renderItemList(),this.config.list.length<2?this.hide():this.show())}},{key:"changeDefinition",value:function(e,t){this.player.changeDefinition(e,t)}},{key:"onItemClick",value:function(e,t){var i=this.player.definitionList;_get$2(_getPrototypeOf$4(r.prototype),"onItemClick",this).apply(this,arguments),this.emitUserAction(e,"change_definition",{from:t.from,to:t.to});for(var n=0;n<i.length;n++)t.to&&i[n].definition===t.to.definition&&(t.to.url=i[n].url),t.from&&i[n].definition===t.from.definition&&(t.from.url=i[n].url);this.player.changeDefinition(t.to,t.from)}}],[{key:"pluginName",get:function(){return"definition"}},{key:"defaultConfig",get:function(){return _objectSpread2$4(_objectSpread2$4({},OptionsIcon.defaultConfig),{},{position:POSITIONS$a.CONTROLS_RIGHT,index:3,list:[],defaultDefinition:"",disable:!1,hidePortrait:!1,className:"xgplayer-definition",isShowIcon:!0})}}]),r}(OptionsIcon),PlaybackRate=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(e){var i;return _classCallCheck$4(this,r),(i=t.call(this,e)).curRate=1,i}return _createClass$5(r,[{key:"beforeCreate",value:function(e){var t=e.player.config.playbackRate,r=t?Array.isArray(t)?t:e.config.list:[];Array.isArray(r)&&(e.config.list=r.map((function(e){return"number"==typeof e?e={rate:e,text:"".concat(e,"x")}:!e.text&&e.rate&&(e.text="".concat(e.rate,"x")),e})))}},{key:"afterCreate",value:function(){var e=this;_get$2(_getPrototypeOf$4(r.prototype),"afterCreate",this).call(this),this.on(RATE_CHANGE,(function(){e.curValue!==e.player.playbackRate&&e.renderItemList()})),this.renderItemList()}},{key:"show",value:function(){this.config.list&&0!==this.config.list.length&&_get$2(_getPrototypeOf$4(r.prototype),"show",this).call(this)}},{key:"onItemClick",value:function(e,t){_get$2(_getPrototypeOf$4(r.prototype),"onItemClick",this).apply(this,arguments);var i=e.delegateTarget,n=Number(i.getAttribute("rate"));if(!n||n===this.curValue)return!1;var o={playbackRate:{from:this.player.playbackRate,to:n}};this.emitUserAction(e,"change_rate",{props:o}),this.curValue=n,this.player.playbackRate=n}},{key:"renderItemList",value:function(){var e=this,t=this.player.playbackRate||1;this.curValue=t;var i=-1,n=this.config.list.map((function(r,n){var o={rate:r.rate};return o.rate===t&&(o.selected=!0,i=n),o.showText=e.getTextByLang(r),o}));_get$2(_getPrototypeOf$4(r.prototype),"renderItemList",this).call(this,n,i)}},{key:"changeCurrentText",value:function(){if(!this.isIcons){var e=this.config.list,t=e[this.curIndex<e.length?this.curIndex:0],r="";r=!t||this.curIndex<0?"".concat(this.player.playbackRate,"x"):this.getTextByLang(t,"iconText"),this.find(".icon-text").innerHTML=r}}},{key:"destroy",value:function(){_get$2(_getPrototypeOf$4(r.prototype),"destroy",this).call(this)}}],[{key:"pluginName",get:function(){return"playbackRate"}},{key:"defaultConfig",get:function(){return _objectSpread2$4(_objectSpread2$4({},OptionsIcon.defaultConfig),{},{position:POSITIONS$a.CONTROLS_RIGHT,index:4,list:[2,1.5,1,.75,.5],className:"xgplayer-playbackrate",isShowIcon:!0,hidePortrait:!1})}}]),r}(OptionsIcon);function CssFullSceenSvg(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="31" height="40" viewBox="0 -5 31 40">\n <path fill="#fff" transform="scale(1.3, 1.3)" class=\'path_full\' d="M9,10v1a.9.9,0,0,1-1,1,.9.9,0,0,1-1-1V9A.9.9,0,0,1,8,8h2a.9.9,0,0,1,1,1,.9.9,0,0,1-1,1Zm6,4V13a1,1,0,0,1,2,0v2a.9.9,0,0,1-1,1H14a1,1,0,0,1,0-2Zm3-7H6V17H18Zm2,0V17a2,2,0,0,1-2,2H6a2,2,0,0,1-2-2V7A2,2,0,0,1,6,5H18A2,2,0,0,1,20,7Z"></path>\n</svg>\n',"image/svg+xml").firstChild}function ExitCssFullSceenSvg(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="31" height="40" viewBox="0 -5 31 40">\n <path fill="#fff" transform="scale(1.3, 1.3)" d="M9,10V9a.9.9,0,0,1,1-1,.9.9,0,0,1,1,1v2a.9.9,0,0,1-1,1H8a.9.9,0,0,1-1-1,.9.9,0,0,1,1-1Zm6,4v1a1,1,0,0,1-2,0V13a.9.9,0,0,1,1-1h2a1,1,0,0,1,0,2Zm3-7H6V17H18Zm2,0V17a2,2,0,0,1-2,2H6a2,2,0,0,1-2-2V7A2,2,0,0,1,6,5H18A2,2,0,0,1,20,7Z"></path>\n</svg>\n',"image/svg+xml").firstChild}var CssFullScreen=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(){return _classCallCheck$4(this,r),t.apply(this,arguments)}return _createClass$5(r,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.cssFullscreen&&(e.config.disable=!e.player.config.cssFullscreen)}},{key:"afterCreate",value:function(){var e=this;_get$2(_getPrototypeOf$4(r.prototype),"afterCreate",this).call(this),this.config.disable||(this.config.target&&(this.playerConfig.fullscreenTarget=this.config.target),this.initIcons(),this.on(CSS_FULLSCREEN_CHANGE,(function(t){e.animate(t)})),this.btnClick=this.btnClick.bind(this),this.handleCssFullscreen=this.hook("cssFullscreen_change",this.btnClick,{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.bind(["click","touchend"],this.handleCssFullscreen))}},{key:"initIcons",value:function(){var e=this.icons,t=this.find(".xgplayer-icon");t.appendChild(e.cssFullscreen),t.appendChild(e.exitCssFullscreen)}},{key:"btnClick",value:function(e){e.preventDefault(),e.stopPropagation();var t=this.player.isCssfullScreen;this.emitUserAction(e,"switch_cssfullscreen",{cssfullscreen:t}),t?this.player.exitCssFullscreen():this.player.getCssFullscreen()}},{key:"animate",value:function(e){this.root&&(e?this.setAttr("data-state","full"):this.setAttr("data-state","normal"),this.switchTips(e))}},{key:"switchTips",value:function(e){var t=this.i18nKeys,r=this.find(".xg-tips");r&&this.changeLangTextKey(r,e?t.EXITCSSFULLSCREEN_TIPS:t.CSSFULLSCREEN_TIPS)}},{key:"registerIcons",value:function(){return{cssFullscreen:{icon:CssFullSceenSvg,class:"xg-get-cssfull"},exitCssFullscreen:{icon:ExitCssFullSceenSvg,class:"xg-exit-cssfull"}}}},{key:"destroy",value:function(){_get$2(_getPrototypeOf$4(r.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.btnClick)}},{key:"render",value:function(){if(!this.config.disable)return"<xg-icon class='xgplayer-cssfullscreen'>\n <div class=\"xgplayer-icon\">\n </div>\n ".concat(xgIconTips(this,"CSSFULLSCREEN_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"cssFullscreen"}},{key:"defaultConfig",get:function(){return{position:POSITIONS$a.CONTROLS_RIGHT,index:1,disable:!1,target:null}}}]),r}(Icon),ErrorPlugin$1=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(){return _classCallCheck$4(this,r),t.apply(this,arguments)}return _createClass$5(r,[{key:"afterCreate",value:function(){var e=this;this.clickHandler=this.hook("errorRetry",this.errorRetry,{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.onError=this.hook("showError",this.handleError),this.bind(".xgplayer-error-refresh","click",this.clickHandler),this.on(ERROR$1,(function(t){e.onError(t)}))}},{key:"errorRetry",value:function(e){this.emitUserAction(e,"error_retry",{}),this.player.retry()}},{key:"handleError",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.player,r=e.errorType,i=t.errorNote?this.i18n[t.errorNote]:"";if(!i)switch(r){case"decoder":i=this.i18n.MEDIA_ERR_DECODE;break;case"network":i=this.i18n.MEDIA_ERR_NETWORK;break;default:i=this.i18n.MEDIA_ERR_SRC_NOT_SUPPORTED}this.find(".xgplayer-error-text").innerHTML=i,this.find(".xgplayer-error-tips").innerHTML="".concat(this.i18n.REFRESH_TIPS,'<span class="xgplayer-error-refresh">').concat(this.i18n.REFRESH,"</span>")}},{key:"destroy",value:function(){this.unbind(".xgplayer-error-refresh","click",this.clickHandler)}},{key:"render",value:function(){return'<xg-error class="xgplayer-error">\n <div class="xgplayer-errornote">\n <span class="xgplayer-error-text"></span>\n <span class="xgplayer-error-tips"><em class="xgplayer-error-refresh"></em></span>\n </div>\n </xg-error>'}}],[{key:"pluginName",get:function(){return"error"}}]),r}(Plugin),Prompt=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(){return _classCallCheck$4(this,r),t.apply(this,arguments)}return _createClass$5(r,[{key:"afterCreate",value:function(){var e=this;this.intervalId=0,this.customConfig=null,this.bind(".highlight",["click","touchend"],(function(t){(e.config.onClick||e.customOnClick)&&(t.preventDefault(),t.stopPropagation(),e.customOnClick?e.customOnClick(t):e.config.onClick(t))})),this.player.showPrompt=function(){e.show.apply(e,arguments)},this.player.hidePrompt=function(){e.hide()}}},{key:"setStyle",value:function(e){var t=this;Object.keys(e).map((function(r){t.root.style[r]=e[r]}))}},{key:"show",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(e){this.customOnClick=i;var n=this.config.interval;this.intervalId&&(clearTimeout(this.intervalId),this.intervalId=null),util.addClass(this.root,"show"),"arrow"===r.mode&&util.addClass(this.root,"arrow"),this.find(".xgplayer-prompt-detail").innerHTML="string"==typeof e?e:"".concat(e.text||"")+"".concat(e.highlight?'<i class="highlight">'.concat(e.highlight,"</i>"):""),r.style&&this.setStyle(r.style);var o="boolean"==typeof r.autoHide?r.autoHide:this.config.autoHide;if(o){var a=r.interval||n;this.intervalId=setTimeout((function(){t.hide()}),a)}}}},{key:"hide",value:function(){util.removeClass(this.root,"show"),util.removeClass(this.root,"arrow"),this.root.removeAttribute("style"),this.customOnClick=null}},{key:"render",value:function(){return'<xg-prompt class="xgplayer-prompt '.concat(STATE_CLASS.CONTROLS_FOLLOW,'">\n <span class="xgplayer-prompt-detail"></span>\n </xg-prompt>')}}],[{key:"pluginName",get:function(){return"prompt"}},{key:"defaultConfig",get:function(){return{interval:3e3,style:{},mode:"arrow",autoHide:!0,detail:{text:"",highlight:""},onClick:function(){}}}}]),r}(Plugin),ISPOT={time:0,text:"",id:1,duration:1,color:"#fff",style:{},width:6,height:6};function mergeISPOT(e){Object.keys(ISPOT).map((function(t){void 0===e[t]&&(e[t]=ISPOT[t])}))}var APIS={_updateDotDom:function(e,t){if(t){var r=this.calcuPosition(e.time,e.duration),i=e.style||{};i.left="".concat(r.left,"%"),i.width="".concat(r.width,"%"),t.setAttribute("data-text",e.text),t.setAttribute("data-time",e.time),r.isMini?util.addClass(t,"mini"):util.removeClass(t,"mini"),Object.keys(i).map((function(e){t.style[e]=i[e]}))}},initDots:function(){var e=this;this._ispots.map((function(t){e.createDot(t,!1)})),this.ispotsInit=!0},createDot:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.player.plugins.progress;if(r&&(t&&(mergeISPOT(e),this._ispots.push(e)),this.ispotsInit||!t)){var i=this.calcuPosition(e.time,e.duration),n=e.style||{};n.left="".concat(i.left,"%"),n.width="".concat(i.width,"%");var o="xgspot_".concat(e.id," xgplayer-spot");i.isMini&&(o+=" mini");var a=util.createDom("xg-spot",e.template||"",{"data-text":e.text,"data-time":e.time,"data-id":e.id},o);Object.keys(n).map((function(e){a.style[e]=n[e]})),r.outer&&r.outer.appendChild(a)}},findDot:function(e){if(this.player.plugins.progress){var t=this._ispots.filter((function(t,r){return t.id===e}));return t.length>0?t[0]:null}},updateDot:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.player.plugins.progress;if(r){var i=this.findDot(e.id);if(i&&Object.keys(e).map((function(t){i[t]=e[t]})),this.ispotsInit){var n=r.find('xg-spot[data-id="'.concat(e.id,'"]'));n&&(this._updateDotDom(e,n),t&&this.showDot(e.id))}}},deleteDot:function(e){var t=this._ispots,r=this.player.plugins.progress;if(r){for(var i=[],n=0;n<t.length;n++)t[n].id===e&&i.push(n);for(var o=i.length-1;o>=0;o--)if(t.splice(i[o],1),this.ispotsInit){var a=r.find('xg-spot[data-id="'.concat(e,'"]'));a&&a.parentElement.removeChild(a)}}},deleteAllDots:function(){var e=this.player.plugins.progress;if(e)if(this.ispotsInit){for(var t=e.root.getElementsByTagName("xg-spot"),r=t.length-1;r>=0;r--)e.outer.removeChild(t[r]);this._ispots=[]}else this._ispots=[]},updateAllDots:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=this.player.plugins.progress;if(r)if(this.ispotsInit){this._ispots=[];var i=r.root.getElementsByTagName("xg-spot"),n=i.length;if(n>t.length)for(var o=n-1;o>t.length-1;o--)r.outer.removeChild(i[o]);t.forEach((function(t,r){r<n?(i[r].setAttribute("data-id","".concat(t.id)),e._ispots.push(t),e.updateDot(t)):e.createDot(t)}))}else this._ispots=t},updateDuration:function(){var e=this,t=this.player.plugins.progress;t&&this._ispots.forEach((function(r){var i=t.find('xg-spot[data-id="'.concat(r.id,'"]'));e._updateDotDom(r,i)}))},getAllDotsDom:function(){var e=this.player.plugins.progress;return e?e.root.getElementsByTagName("xg-spot"):[]},getDotDom:function(e){var t=this.player.plugins.progress;if(t)return t.find('xg-spot[data-id="'.concat(e,'"]'))}};function initDotsAPI(e){var t=e.config,r=e.player;Object.keys(APIS).map((function(t){e[t]=APIS[t].bind(e)}));var i=r.config.progressDot||t.ispots||[];e._ispots=i.map((function(e){return mergeISPOT(e),e})),e.ispotsInit=!1,e.on(DURATION_CHANGE,(function(){e.ispotsInit?e.updateDuration():e.initDots()}))}var CALLBACK_MAP={dragmove:"onProgressMove",dragstart:"onProgressDragStart",dragend:"onProgressDragEnd",click:"onProgressClick",mouseover:"onProgressMouseOver",mouseenter:"onProgressMove"},ProgressPreview=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(e){var i;return _classCallCheck$4(this,r),_defineProperty$5(_assertThisInitialized$4(i=t.call(this,e)),"onMousemove",(function(e){i.config.disable||(util.hasClass(e.target,"xg-spot-content")&&i.config.isHideThumbnailHover?i.player.plugins.progress.onMouseLeave(e):(i._state.f||util.hasClass(e.target,"xg-spot-content"))&&(util.event(e),e.stopPropagation()))})),_defineProperty$5(_assertThisInitialized$4(i),"onMousedown",(function(e){i.config.disable||(i._state.f||util.hasClass(e.target,"xg-spot-content"))&&(util.event(e),e.stopPropagation())})),_defineProperty$5(_assertThisInitialized$4(i),"onMouseup",(function(e){if(i.isDrag){var t=i.player.plugins.progress;t&&t.pos&&(t.onMouseUp(e),!t.pos.isEnter&&t.onMouseLeave(e))}})),_defineProperty$5(_assertThisInitialized$4(i),"onDotMouseLeave",(function(e){if(!i.config.disable){i._curDot.removeEventListener("mouseleave",i.onDotMouseLeave),i.blurDot(e.target),i._curDot=null;var t=i.player.plugins.progress;t&&t.enableBlur(),i.show()}})),_defineProperty$5(_assertThisInitialized$4(i),"onProgressMouseOver",(function(e,t){if(!i.config.disable&&util.hasClass(t.target,"xgplayer-spot")&&!i._curDot){i._curDot=t.target,i.focusDot(t.target),i._curDot.children.length>0&&i.hide();var r=i.player.plugins.progress;r&&r.disableBlur(),i._curDot.addEventListener("mouseleave",i.onDotMouseLeave)}})),i._ispots=[],i.videoPreview=null,i.videothumbnail=null,i.thumbnail=null,i.timeStr="",i._state={now:0,f:!1},i}return _createClass$5(r,[{key:"beforeCreate",value:function(e){var t=e.player.plugins.progress;t&&(e.root=t.root)}},{key:"afterCreate",value:function(){var e=this;this._curDot=null,this.handlerSpotClick=this.hook("spotClick",(function(t,r){r.currentTime&&e.player.seek(r.currentTime)})),this.transformTimeHook=this.hook("transformTime",(function(t){e.setTimeContent(util.format(t))})),initDotsAPI(this),this.on(DURATION_CHANGE,(function(){e.show()})),this.config.disable&&this.disable(),this.extTextRoot=this.find(".xg-spot-ext-text")}},{key:"setConfig",value:function(e){var t=this;e&&Object.keys(e).map((function(r){t.config[r]=e[r]}))}},{key:"onPluginsReady",value:function(){this.player.plugins.progress&&(this.previewLine=this.find(".xg-spot-line"),this.timePoint=this.find(".xgplayer-progress-point"),this.timeText=this.find(".xg-spot-time"),this.tipText=this.find(".spot-inner-text"),this._hasThumnail=!1,this.registerThumbnail(),this.bindEvents())}},{key:"bindEvents",value:function(){var e=this,t=this.player.plugins.progress;if(t&&(Object.keys(CALLBACK_MAP).map((function(r){e[CALLBACK_MAP[r]]=e[CALLBACK_MAP[r]].bind(e),t.addCallBack(r,e[CALLBACK_MAP[r]])})),"mobile"!==sniffer$1.device)){this.bind(".xg-spot-info","mousemove",this.onMousemove),this.bind(".xg-spot-info","mousedown",this.onMousedown),this.bind(".xg-spot-info","mouseup",this.onMouseup);var r=this.hook("previewClick",(function(){}));this.handlerPreviewClick=function(t){t.stopPropagation(),r(parseInt(1e3*e._state.now,10)/1e3,t)},this.bind(".xg-spot-content","mouseup",this.handlerPreviewClick)}}},{key:"onProgressMove",value:function(e,t){!this.config.disable&&this.player.duration&&this.updatePosition(e.offset,e.width,e.currentTime,e.e)}},{key:"onProgressDragStart",value:function(e){!this.config.disable&&this.player.duration&&(this.isDrag=!0,this.videoPreview&&util.addClass(this.videoPreview,"show"))}},{key:"onProgressDragEnd",value:function(e){!this.config.disable&&this.player.duration&&(this.isDrag=!1,this.videoPreview&&util.removeClass(this.videoPreview,"show"))}},{key:"onProgressClick",value:function(e,t){this.config.disable||util.hasClass(t.target,"xgplayer-spot")&&(t.stopPropagation(),t.preventDefault(),["time","id","text"].map((function(r){e[r]=t.target.getAttribute("data-".concat(r))})),e.time&&(e.time=Number(e.time)),this.handlerSpotClick(t,e))}},{key:"updateLinePos",value:function(e,t){var r=this.root,i=this.previewLine,n=this.player,o=this.config,a="flex"===n.controls.mode,s=r.getBoundingClientRect().width;if(s){var l,c=e-(s=this._hasThumnail&&s<o.width?o.width:s)/2;c<0&&!a?(c=0,l=e-s/2):c>t-s&&!a?(l=c-(t-s),c=t-s):l=0,void 0!==l&&(i.style.transform="translateX(".concat(l.toFixed(2),"px)")),r.style.transform="translateX(".concat(c.toFixed(2),"px) translateZ(0)")}}},{key:"updateTimeText",value:function(e){var t=this.timeText,r=this.timePoint;t.innerHTML=e,!this.thumbnail&&(r.innerHTML=e)}},{key:"updatePosition",value:function(e,t,r,i){var n=this.root,o=this.config,a=this._state;if(n){a.now=r,this.transformTimeHook(r);var s=this.timeStr;i&&i.target&&util.hasClass(i.target,"xgplayer-spot")?(this.showTips(i.target.getAttribute("data-text"),!1,s),this.focusDot(i.target),a.f=!0,o.isFocusDots&&a.f&&(a.now=parseInt(i.target.getAttribute("data-time"),10))):o.defaultText?(a.f=!1,this.showTips(o.defaultText,!0,s)):(a.f=!1,this.hideTips("")),this.updateTimeText(s),this.updateThumbnails(a.now),this.updateLinePos(e,t)}}},{key:"setTimeContent",value:function(e){this.timeStr=e}},{key:"updateThumbnails",value:function(e){var t=this.player,r=this.videoPreview,i=this.config,n=t.plugins.thumbnail;if(n&&n.usable){this.thumbnail&&n.update(this.thumbnail,e,i.width,i.height);var o=r&&r.getBoundingClientRect();this.videothumbnail&&n.update(this.videothumbnail,e,o.width,o.height)}}},{key:"registerThumbnail",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("mobile"!==sniffer$1.device){var t=this.player,r=this.config,i=t.getPlugin("thumbnail");if(i&&i.setConfig(e),i&&i.usable&&r.isShowThumbnail){util.removeClass(this.root,"short-line no-thumbnail"),"short"===r.mode&&util.addClass(this.root,"short-line"),this._hasThumnail=!0;var n=this.find(".xg-spot-thumbnail");this.thumbnail=i.createThumbnail(n,"progress-thumbnail"),r.isShowCoverPreview&&(this.videoPreview=util.createDom("xg-video-preview","",{},"xgvideo-preview"),t.root.appendChild(this.videoPreview),this.videothumbnail=i.createThumbnail(this.videoPreview,"xgvideo-thumbnail")),this.updateThumbnails(0)}else util.addClass(this.root,"short-line no-thumbnail")}}},{key:"calcuPosition",value:function(e,t){var r=this.player.plugins.progress,i=this.player,n=r.root.getBoundingClientRect().width,o=i.duration/n*6;return e+t>i.duration&&(t=i.duration-e),i.duration,i.duration,{left:e/i.duration*100,width:t/i.duration*100,isMini:t<o}}},{key:"showDot",value:function(e){var t=this.findDot(e);if(t){var r=this.root.getBoundingClientRect().width,i=t.time/this.player.duration*r;this.updatePosition(i,r,t.time)}}},{key:"focusDot",value:function(e,t){e&&(t||(t=e.getAttribute("data-id")),util.addClass(e,"active"),this._activeDotId=t)}},{key:"blurDot",value:function(e){if(!e){var t=this._activeDotId;e=this.getDotDom(t)}e&&(util.removeClass(e,"active"),this._activeDotId=null)}},{key:"showTips",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";util.addClass(this.root,"no-timepoint"),e&&(util.addClass(this.find(".xg-spot-content"),"show-text"),t&&"production"===this.config.mode?(util.addClass(this.root,"product"),this.tipText.textContent=e):(util.removeClass(this.root,"product"),this.tipText.textContent=this._hasThumnail?e:"".concat(r," ").concat(e)))}},{key:"hideTips",value:function(){util.removeClass(this.root,"no-timepoint"),this.tipText.textContent="",util.removeClass(this.find(".xg-spot-content"),"show-text"),util.removeClass(this.root,"product")}},{key:"hide",value:function(){util.addClass(this.root,"hide")}},{key:"show",value:function(){util.removeClass(this.root,"hide")}},{key:"enable",value:function(){var e=this.config,t=this.playerConfig;this.config.disable=!1,this.show(),!this.thumbnail&&e.isShowThumbnail&&this.registerThumbnail(t.thumbnail||{})}},{key:"disable",value:function(){this.config.disable=!0,this.hide()}},{key:"destroy",value:function(){var e=this,t=this.player.plugins.progress;t&&Object.keys(CALLBACK_MAP).map((function(r){t.removeCallBack(r,e[CALLBACK_MAP[r]])})),this.videothumbnail=null,this.thumbnail=null,this.videoPreview&&this.player.root.removeChild(this.videoPreview),this.unbind(".xg-spot-info","mousemove",this.onMousemove),this.unbind(".xg-spot-info","mousedown",this.onMousedown),this.unbind(".xg-spot-info","mouseup",this.onMouseup),this.unbind(".xg-spot-content","mouseup",this.handlerPreviewClick)}},{key:"render",value:function(){return"mobile"===sniffer$1.device||"mobile"===this.playerConfig.isMobileSimulateMode?"":'<div class="xg-spot-info hide '.concat("short"===this.config.mode?"short-line":"",'">\n <div class="xg-spot-content">\n <div class="xg-spot-thumbnail">\n <span class="xg-spot-time"></span>\n </div>\n <div class="xg-spot-text"><span class="spot-inner-text"></span></div>\n </div>\n <div class="xgplayer-progress-point">00:00</div>\n <div class="xg-spot-ext-text"></div>\n <div class="xg-spot-line"></div>\n </div>')}}],[{key:"pluginName",get:function(){return"progresspreview"}},{key:"defaultConfig",get:function(){return{index:1,miniWidth:6,ispots:[],defaultText:"",isFocusDots:!0,isHideThumbnailHover:!0,isShowThumbnail:!0,isShowCoverPreview:!1,mode:"",disable:!1,width:160,height:90}}}]),r}(Plugin),Thumbnail=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(e){var i;return _classCallCheck$4(this,r),(i=t.call(this,e)).ratio=1,i.interval=null,i._preloadMark={},i}return _createClass$5(r,[{key:"afterCreate",value:function(){var e=this;this.usable&&this.initThumbnail(),this.on([DURATION_CHANGE],(function(){var t=e.config,r=t.pic_num,i=t.interval;e.usable&&(e.interval=i>0?i:Math.round(1e3*e.player.duration/r)/1e3)}))}},{key:"setConfig",value:function(e){var t=this;if(e){var r=Object.keys(e);r.length<1||(r.forEach((function(r){t.config[r]=e[r]})),this.usable&&this.initThumbnail())}}},{key:"usable",get:function(){var e=this.config,t=e.urls,r=e.pic_num;return t&&t.length>0&&r>0}},{key:"initThumbnail",value:function(){var e=this.config,t=e.width,r=e.height,i=e.pic_num,n=e.interval;this.ratio=t/r*100,this.interval=n||Math.round(this.player.duration/i),this._preloadMark={}}},{key:"getUrlByIndex",value:function(e){return e>=0&&e<this.config.urls.length?this.config.urls[e]:""}},{key:"preload",value:function(e){var t=this;if(!this._preloadMark[e]){var r=this.config.urls,i=r.length,n=[];e>0&&n.push(e-1),n.push(e),e>0&&e<i-1&&n.push(e+1),n.map((function(e){!t._preloadMark[e]&&e>=0&&e<i&&(t._preloadMark[e]=1,util.preloadImg(r[e],(function(){t._preloadMark[e]=2})))}))}}},{key:"getPosition",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.config,n=i.pic_num,o=i.row,a=i.col,s=i.width,l=i.height;this.interval=Math.round(this.player.duration/n);var c=Math.ceil(e/this.interval),u=(c=c>n?n:c)<o*a?0:Math.ceil(c/(o*a))-1,h=c-u*(a*o),d=h>0?Math.ceil(h/a)-1:0,p=h>0?h-d*a-1:0,f=0,g=0;if(t&&r){var y=t/r;y<s/l?f=(g=r)*(s/l):g=(f=t)/(s/l)}else r?t||(f=(g=r||l)*(s/l)):g=(f=t||s)/(s/l);var v=this.getUrlByIndex(u);return{urlIndex:u,rowIndex:d,colIndex:p,url:v,height:g,width:f,style:{backgroundImage:"url(".concat(v,")"),backgroundSize:"".concat(f*a,"px auto"),backgroundPosition:"-".concat(p*f,"px -").concat(d*g,"px"),width:"".concat(f,"px"),height:"".concat(g,"px")}}}},{key:"update",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",o=this.config,a=o.pic_num,s=o.urls;if(!(a<=0)&&s&&0!==s.length){var l=this.getPosition(t,r,i);this.preload(l.urlIndex),Object.keys(l.style).map((function(t){e.style[t]=l.style[t]})),Object.keys(n).map((function(t){e.style[t]=n[t]}))}}},{key:"changeConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.setConfig(e)}},{key:"createThumbnail",value:function(e,t){var r=util.createDom("xg-thumbnail","",{},"thumbnail ".concat(t));return e&&e.appendChild(r),r}}],[{key:"pluginName",get:function(){return"thumbnail"}},{key:"defaultConfig",get:function(){return{isShow:!1,urls:[],pic_num:0,col:0,row:0,height:90,width:160,scale:1,className:"",hidePortrait:!1}}}]),r}(Plugin),MiniProgress=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(){return _classCallCheck$4(this,r),t.apply(this,arguments)}return _createClass$5(r,[{key:"afterCreate",value:function(){}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{cached:0,played:0},t=arguments.length>1?arguments[1]:void 0;t&&this.root&&(e.cached&&(this.find("xg-mini-progress-cache").style.width="".concat(e.cached/t*100,"%")),e.played&&(this.find("xg-mini-progress-played").style.width="".concat(e.played/t*100,"%")))}},{key:"render",value:function(){if(this.playerConfig.progress&&this.playerConfig.miniprogress)return'<xg-mini-progress class="xg-mini-progress">\n <xg-mini-progress-cache class="xg-mini-progress-cache"></xg-mini-progress-cache>\n <xg-mini-progress-played class="xg-mini-progress-played"></xg-mini-progress-played>\n </xg-mini-progress>'}}],[{key:"pluginName",get:function(){return"MiniProgress"}},{key:"defaultConfig",get:function(){return{}}}]),r}(Plugin),MODES={REAL_TIME:"realtime",FIRST_FRAME:"firstframe",FRAME_RATE:"framerate",POSTER:"poster"};function nowTime$1(){try{return parseInt(window.performance.now(),10)}catch(e2){return(new Date).getTime()}}function checkIsSupportCanvas(){try{return!!document.createElement("canvas").getContext}catch(e2){return!1}}var isSupportCanvas=null,DynamicBg=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(){var e;_classCallCheck$4(this,r);for(var i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];return _defineProperty$5(_assertThisInitialized$4(e=t.call.apply(t,[this].concat(n))),"onLoadedData",(function(t){e.player&&(e._frameCount=e.config.startFrameCount,e.renderOnTimeupdate(t),e.off(TIME_UPDATE,e.renderOnTimeupdate),e.on(TIME_UPDATE,e.renderOnTimeupdate))})),_defineProperty$5(_assertThisInitialized$4(e),"renderOnTimeupdate",(function(t){e._frameCount>0?(e.renderOnce(),e._frameCount--):(e._isLoaded=!0,e.off(TIME_UPDATE,e.renderOnTimeupdate),!e.player.paused&&e._checkIfCanStart()&&e.start())})),_defineProperty$5(_assertThisInitialized$4(e),"start",(function(){var t=e.player.media,r=nowTime$1(),i=e.checkVideoIsSupport(t);i&&e.canvasCtx&&(e.stop(),t.videoWidth&&t.videoHeight&&(e.videoPI=t.videoHeight>0?parseInt(t.videoWidth/t.videoHeight*100,10):0,(e.config.mode===MODES.REAL_TIME||r-e.preTime>=e.interval)&&(t&&t.videoWidth&&e.update(i,e.videoPI),e.preTime=r)),e.frameId=util.requestAnimationFrame(e.start))})),_defineProperty$5(_assertThisInitialized$4(e),"stop",(function(){e.frameId&&(util.cancelAnimationFrame(e.frameId),e.frameId=null)})),e}return _createClass$5(r,[{key:"afterCreate",value:function(){var e=this;!0===this.playerConfig.dynamicBg&&(this.config.disable=!1),r.isSupport||(this.config.disable=!0);var t=this.config,i=t.disable,n=t.mode,o=t.frameRate;i||(this._pos={width:0,height:0,rwidth:0,rheight:0,x:0,y:0,pi:0},this.isStart=!1,this._isLoaded=!1,this.videoPI=0,this.preTime=0,this.interval=parseInt(1e3/o,10),this.canvas=null,this.canvasCtx=null,this._frameCount=0,this.once(COMPLETE,(function(){e.player&&(e.init(),e.player.paused||e.start())})),n!==MODES.POSTER&&(n!==MODES.FIRST_FRAME&&(this.on(EMPTIED,(function(){e.stop()})),this.on(PLAY,(function(){e._checkIfCanStart()&&e.start()})),this.on(PAUSE,(function(){e.stop()}))),this.on(LOADED_DATA,this.onLoadedData),this.on(LOAD_START,(function(){e._isLoaded=!1,e.stop()}))))}},{key:"init",value:function(){var e=this.player,t=this.config;this.canvasFilter=r.supportCanvasFilter();try{var i=this.config.isInnerRender&&e.innerContainer||e.root;i.insertAdjacentHTML("afterbegin",'<div class="xgplayer-dynamic-bg" data-index="'.concat(t.index,'"><canvas>\n </canvas><xgmask></xgmask></div>')),this.root=i.children[0],this.canvas=this.find("canvas"),this.canvasFilter||(this.canvas.style.filter=t.filter,this.canvas.style.webkitFilter=t.filter),this.mask=this.find("xgmask"),t.addMask&&(this.mask.style.background=t.maskBg),this.canvasCtx=this.canvas.getContext("2d"),this.renderByPoster()}catch(e2){XG_DEBUG.logError("plugin:DynamicBg",e2)}}},{key:"checkVideoIsSupport",value:function(e){if(!e)return null;var t=e&&e instanceof window.HTMLVideoElement?e:e.canvas?e.canvas:e.flyVideo?e.flyVideo:null;if(t&&("safari"!==sniffer$1.browser||!/^blob/.test(t.currentSrc)&&!/^blob/.test(t.src)))return t;var r=t?t.tagName.toLowerCase():"";return"canvas"===r||"img"===r?t:null}},{key:"renderByPoster",value:function(){var e=this.playerConfig.poster;if(e){var t="String"===util.typeOf(e)?e:"String"===util.typeOf(e.poster)?e.poster:null;this.updateImg(t)}}},{key:"_checkIfCanStart",value:function(){var e=this.config.mode;return this._isLoaded&&e!==MODES.FIRST_FRAME&&e!==MODES.POSTER}},{key:"renderOnce",value:function(){var e=this.player.media;if(e.videoWidth&&e.videoHeight){this.videoPI=parseInt(e.videoWidth/e.videoHeight*100,10);var t=this.checkVideoIsSupport(e);t&&e.videoWidth&&this.update(t,this.videoPI)}}},{key:"updateImg",value:function(e){var t=this;if(e){var r=this.canvas.getBoundingClientRect(),i=r.width,n=r.height,o=new window.Image;o.onload=function(){if(t.canvas&&!t.frameId&&!t.isStart){t.canvas.height=n,t.canvas.width=i;var e=parseInt(i/n*100,10);t.update(o,e),o=null}},o.src=e}}},{key:"update",value:function(e,t){if(this.canvas&&this.canvasCtx&&t)try{var r=this._pos,i=this.config,n=this.canvas.getBoundingClientRect(),o=n.width,a=n.height;if(o!==r.width||a!==r.height||r.pi!==t){var s=parseInt(o/a*100,10);r.pi=t,r.width=this.canvas.width=o,r.height=this.canvas.height=a;var l=a,c=o;s<t?c=parseInt(a*t/100,10):s>t&&(l=parseInt(100*o/t,10)),r.rwidth=c*i.multiple,r.rheight=l*i.multiple,r.x=(o-r.rwidth)/2,r.y=(a-r.rheight)/2}this.canvasFilter&&(this.canvasCtx.filter=i.filter),this.canvasCtx.drawImage(e,r.x,r.y,r.rwidth,r.rheight)}catch(e2){XG_DEBUG.logError("plugin:DynamicBg",e2)}}},{key:"destroy",value:function(){this.stop(),this.canvasCtx=null,this.canvas=null}},{key:"render",value:function(){return""}}],[{key:"pluginName",get:function(){return"dynamicBg"}},{key:"defaultConfig",get:function(){return{isInnerRender:!1,disable:!0,index:-1,mode:"framerate",frameRate:10,filter:"blur(50px)",startFrameCount:2,addMask:!0,multiple:1.2,maskBg:"rgba(0,0,0,0.7)"}}},{key:"isSupport",get:function(){return"boolean"==typeof isSupportCanvas?isSupportCanvas:isSupportCanvas=checkIsSupportCanvas()}},{key:"supportCanvasFilter",value:function(){return!("safari"===sniffer$1.browser||"firefox"===sniffer$1.browser)}}]),r}(Plugin),ZH={LANG:"zh-cn",TEXT:{ERROR_TYPES:{network:{code:1,msg:"视频下载错误"},mse:{code:2,msg:"流追加错误"},parse:{code:3,msg:"解析错误"},format:{code:4,msg:"格式错误"},decoder:{code:5,msg:"解码错误"},runtime:{code:6,msg:"语法错误"},timeout:{code:7,msg:"播放超时"},other:{code:8,msg:"其他错误"}},HAVE_NOTHING:"没有关于音频/视频是否就绪的信息",HAVE_METADATA:"音频/视频的元数据已就绪",HAVE_CURRENT_DATA:"关于当前播放位置的数据是可用的,但没有足够的数据来播放下一帧/毫秒",HAVE_FUTURE_DATA:"当前及至少下一帧的数据是可用的",HAVE_ENOUGH_DATA:"可用数据足以开始播放",NETWORK_EMPTY:"音频/视频尚未初始化",NETWORK_IDLE:"音频/视频是活动的且已选取资源,但并未使用网络",NETWORK_LOADING:"浏览器正在下载数据",NETWORK_NO_SOURCE:"未找到音频/视频来源",MEDIA_ERR_ABORTED:"取回过程被用户中止",MEDIA_ERR_NETWORK:"网络错误",MEDIA_ERR_DECODE:"解码错误",MEDIA_ERR_SRC_NOT_SUPPORTED:"不支持的音频/视频格式",REPLAY:"重播",ERROR:"网络连接似乎出现了问题",PLAY_TIPS:"播放",PAUSE_TIPS:"暂停",PLAYNEXT_TIPS:"下一集",DOWNLOAD_TIPS:"下载",ROTATE_TIPS:"旋转",RELOAD_TIPS:"重新载入",FULLSCREEN_TIPS:"进入全屏",EXITFULLSCREEN_TIPS:"退出全屏",CSSFULLSCREEN_TIPS:"进入样式全屏",EXITCSSFULLSCREEN_TIPS:"退出样式全屏",TEXTTRACK:"字幕",PIP:"画中画",SCREENSHOT:"截图",LIVE:"正在直播",OFF:"关闭",OPEN:"开启",MINI_DRAG:"点击按住可拖动视频",MINISCREEN:"小屏幕",REFRESH_TIPS:"请试试",REFRESH:"刷新",FORWARD:"快进中",LIVE_TIP:"直播"}},INFO="info",STATS_EVENTS=STATS_EVENTS$1,Stats=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(){var e;_classCallCheck$4(this,r);for(var i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];return _defineProperty$5(_assertThisInitialized$4(e=t.call.apply(t,[this].concat(n))),"_recordUserActions",(function(t){var r=e._getTime(),i=Object.assign({},t,{msg:t.msg||t.action});e._stats[INFO].push(_objectSpread2$4(_objectSpread2$4({type:"userAction"},r),{},{payload:i}))})),_defineProperty$5(_assertThisInitialized$4(e),"_onReset",(function(){e.reset()})),_defineProperty$5(_assertThisInitialized$4(e),"_recordInfo",(function(t){e.info(t)})),_defineProperty$5(_assertThisInitialized$4(e),"_downloadStats",(function(){var t=e.getStats(),r=new Blob([JSON.stringify(t)],{type:"application/json"}),i=window.URL.createObjectURL(r),n=document.createElement("a");n.style.display="none",n.href=i,n.download="player.txt",n.disabled=!1,n.click()})),e}return _createClass$5(r,[{key:"_getTime",value:function(){return{timestamp:Date.now(),timeFormat:(new Date).toISOString()}}},{key:"afterCreate",value:function(){this.reset(),this.on(USER_ACTION,this._recordUserActions),this.on(STATS_EVENTS.STATS_INFO,this._recordInfo),this.on(STATS_EVENTS.STATS_DOWNLOAD,this._downloadStats),this.on(STATS_EVENTS.STATS_RESET,this._onReset)}},{key:"destroy",value:function(){this.offAll()}},{key:"downloadStats",value:function(){this._downloadStats()}},{key:"info",value:function(e){e.profile?this._infoProfile(e):this._info(e)}},{key:"_info",value:function(e){var t=this._getTime();this._stats[INFO].push(_objectSpread2$4(_objectSpread2$4({},t),{},{payload:e}))}},{key:"_infoProfile",value:function(e){if(e&&e.startMs){var t=_objectSpread2$4({cat:"function",dur:Date.now()-e.startMs,name:e.name||e.msg,ph:"X",pid:0,tid:0,ts:e.startMs,profile:!0},e);this._info(t)}else console.warn("infoProfile need object data, include startMs")}},{key:"reset",value:function(){var e;this._stats=(_defineProperty$5(e={},INFO,[]),_defineProperty$5(e,"media",{}),e)}},{key:"getStats",value:function(){for(var e=this.player.media,t=[],r=0;r<e.buffered.length;r++)t.push({start:e.buffered.start(r),end:e.buffered.end(r)});var i={currentTime:e.currentTime,readyState:e.readyState,buffered:t,paused:e.paused,ended:e.ended};return this._stats.media=i,{raw:this._stats,timestat:this._getTimeStats(),profile:this._getProfile()}}},{key:"_getTimeStats",value:function(){return this._stats[INFO].map((function(e){var t=e.payload.data,r="";try{t instanceof Error?r=t.msg:void 0!==t&&(r=JSON.stringify(t))}catch(i){console.log("err",i)}return"[".concat(e.timeFormat,"] : ").concat(e.payload.msg," ").concat(r," ")}))}},{key:"_getProfile",value:function(){var e={traceEvents:[]};return this._stats[INFO].forEach((function(t){t.payload.profile&&e.traceEvents.push(t.payload)})),e}}],[{key:"pluginName",get:function(){return"stats"}},{key:"defaultConfig",get:function(){return{}}}]),r}(BasePlugin),GapJump=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(){var e;_classCallCheck$4(this,r);for(var i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];return _defineProperty$5(_assertThisInitialized$4(e=t.call.apply(t,[this].concat(n))),"onGapJump",(function(){var t=_assertThisInitialized$4(e),i=t.player,n=t.config;if(i.media.readyState!==HTMLMediaElement.HAVE_NOTHING){if(i.media.seeking){if(!e.seekingEventReceived)return}else e.seekingEventReceived=!1;if(!i.media.paused||0===i.media.currentTime||!e.hasPlayed){var o=i.media.buffered,a=n.smallGapLimit||.5,s=n.gapDetectionThreshold||.3,l=i.media.currentTime,c=e._getIndex(o,l,s);if(null!==c&&0!==c){console.log("GapJump bufferRange ",o.start(c),o.end(c));var u=o.start(c)+.1;if(!(u>i.media.duration)){var h=u-l,d=h<=a;h<r.BROWSER_GAP_TOLERANCE||d&&(!1!==n.useGapJump&&(i.media.currentTime=e.isSafari?u+.1:u),e.player&&e.player.emit("detectGap"),console.log("gapJump gapIndex",c," isGapSamll:",d," currentTime:",i.media.currentTime," jumpSize:",l-i.media.currentTime),.08!==u&&i&&i.emit("log",{type:"oneevent",end_type:"gap",vid:i.config.vid,ext:{video_postion:Math.floor(1e3*u)}}))}}}}})),e}return _createClass$5(r,[{key:"afterCreate",value:function(){var e=this;!1!==this.config.useGapJump&&(this.hasPlayed=!1,this.seekingEventReceived=!1,this.isSafari=/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),this.on(WAITING,this.onGapJump),this.on(PLAY,(function(){e.hasPlayed=!0})),this.on(SEEKING,(function(){e.seekingEventReceived=!0})))}},{key:"_getIndex",value:function(e,t,r){if(!e||!e.length)return null;if(1===e.length&&e.end(0)-e.start(0)<1e-6)return null;for(var i=this._getBuffered(e),n=null,o=0;o<i.length;o++){if(i[o].start>t&&(0===o||i[o-1].end-t<=r)){n=o;break}}return n}},{key:"_getBuffered",value:function(e){if(!e)return[];for(var t=[],r=0;r<e.length;r++)t.push({start:e.start(r),end:e.end(r)});return t}}],[{key:"pluginName",get:function(){return"gapJump"}},{key:"defaultConfig",get:function(){return{useGapJump:!1,smallGapLimit:.5,gapDetectionThreshold:.3}}}]),r}(Plugin);GapJump.BROWSER_GAP_TOLERANCE=.001;var WaitingTimeoutJump=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(){var e;_classCallCheck$4(this,r);for(var i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];return _defineProperty$5(_assertThisInitialized$4(e=t.call.apply(t,[this].concat(n))),"onWaiting",(function(){var t=_assertThisInitialized$4(e).config;e.jumpCnt>t.jumpCntMax||e.timer||!1===t.useWaitingTimeoutJump||(e.timer=setTimeout(e.onJump,1e3*t.waitingTime))})),_defineProperty$5(_assertThisInitialized$4(e),"onJump",(function(){var t=_assertThisInitialized$4(e),r=t.player,i=t.config;if(clearTimeout(e.timer),e.timer=null,!(e.jumpCnt>i.jumpCntMax||!1===i.useWaitingTimeoutJump||r.media.paused&&0!==r.media.currentTime&&e.hasPlayed)){e.jumpSize=i.jumpSize*(e.jumpCnt+1),e.jumpCnt===i.jumpSize&&e.jumpSize<6&&(e.jumpSize=6);var n=r.currentTime+e.jumpSize;n>r.media.duration||(console.log("waitintTimeout, currentTime:",r.currentTime,", jumpTo:",n),e.jumpCnt++,r.currentTime=n)}})),e}return _createClass$5(r,[{key:"afterCreate",value:function(){var e=this,t=this.config,r=t.useWaitingTimeoutJump,i=t.jumpSize;!1!==r&&(this.hasPlayed=!1,this.jumpCnt=0,this.timer=null,this.jumpSize=i,this.on(WAITING,this.onWaiting),this.on([PLAYING,CANPLAY],(function(){clearTimeout(e.timer),e.timer=null,e.jumpSize=e.config.jumpSize})),this.on(PLAY,(function(){e.hasPlayed=!0})))}}],[{key:"pluginName",get:function(){return"waitingTimeoutJump"}},{key:"defaultConfig",get:function(){return{useWaitingTimeoutJump:!1,waitingTime:15,jumpSize:2,jumpCntMax:4}}}]),r}(Plugin),TestSpeed=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(){var e;_classCallCheck$4(this,r);for(var i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];return _defineProperty$5(_assertThisInitialized$4(e=t.call.apply(t,[this].concat(n))),"getSpeed",(function(t){if(e.speedListCache.length<=0)return 0;var r=0;return e.speedListCache.map((function(e){r+=e})),Math.floor(r/e.speedListCache.length)})),_defineProperty$5(_assertThisInitialized$4(e),"_onRealSpeedChange",(function(t){t.speed&&e.appendList(t.speed)})),_defineProperty$5(_assertThisInitialized$4(e),"testSpeed",(function(){if(clearTimeout(e.timer),e.timer=null,e.player&&e.config.openSpeed){var t=e.config,r=t.url,i=t.loadSize,n=t.testCnt,o=t.testTimeStep,a=r+(r.indexOf("?")<0?"?testst=":"&testst=")+Date.now();if(!(e.cnt>=n)){e.cnt++;try{var s=(new Date).getTime(),l=null,c=new XMLHttpRequest;e.xhr=c,c.open("GET",a);var u={},h=Math.floor(10*Math.random());u.Range="bytes="+h+"-"+(i+h),u&&Object.keys(u).forEach((function(e){c.setRequestHeader(e,u[e])})),c.onreadystatechange=function(){if(4===c.readyState){e.xhr=null,l=(new Date).getTime();var t=c.getResponseHeader("Content-Length")/1024*8,r=Math.round(1e3*t/(l-s));e.appendList(r),e.timer=setTimeout(e.testSpeed,o)}},c.send()}catch(e2){console.error(e2)}}}})),_defineProperty$5(_assertThisInitialized$4(e),"appendList",(function(t){var r=e.config.saveSpeedMax;e.speedListCache.length>=r&&e.speedListCache.shift(),e.speedListCache.push(t),e.player&&(e.player.realTimeSpeed=t),e.updateSpeed()})),_defineProperty$5(_assertThisInitialized$4(e),"updateSpeed",(function(){var t=e.getSpeed(),r=_assertThisInitialized$4(e).player;!r||r.avgSpeed&&t===r.avgSpeed||(r.avgSpeed=t,r.emit(DOWNLOAD_SPEED_CHANGE,{speed:t,realTimeSpeed:r.realTimeSpeed}))})),e}return _createClass$5(r,[{key:"afterCreate",value:function(){var e=this;this.speedListCache=[];var t=this.config,r=t.openSpeed,i=t.testTimeStep;this.timer=null,this.cnt=0,this.xhr=null,r&&(this.on("real_time_speed",this._onRealSpeedChange),this.on([LOADED_DATA,REPLAY],(function(){util.isMSE(e.player.video)||(e.speedListCache=[],e.cnt=0,e.timer=setTimeout(e.testSpeed,i))})))}},{key:"openSpeed",get:function(){return this.config.openSpeed},set:function(e){if(this.config.openSpeed=e,!e&&this.timer)return clearTimeout(this.timer),void(this.timer=null);if(this.config.openSpeed){if(this.timer)return;this.timer=setTimeout(this.testSpeed,this.config.testTimeStep)}}},{key:"destroy",value:function(){clearTimeout(this.timer),this.timer=null,this.xhr&&4!==this.xhr.readyState&&(this.xhr.cancel(),this.xhr=null)}}],[{key:"pluginName",get:function(){return"testspeed"}},{key:"defaultConfig",get:function(){return{openSpeed:!1,testCnt:3,loadSize:204800,testTimeStep:3e3,url:"",saveSpeedMax:5}}}]),r}(Plugin),FpsDetect=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(){return _classCallCheck$4(this,r),t.apply(this,arguments)}return _createClass$5(r,[{key:"afterCreate",value:function(){var e=this,t=this.player,r=this.config;(this.timer=null,this._lastDecodedFrames=0,this._currentStuckCount=0,this._lastCheckPoint=null,this._payload=[],r.disabled)||t.media.getVideoPlaybackQuality&&(this.on(PLAY,(function(){e._startTick()})),this.on(PAUSE,(function(){e._stopTick()})),this.on(ENDED,(function(){e._stopTick()})),this.on(EMPTIED,(function(){e._stopTick()})))}},{key:"_startTick",value:function(){var e=this;this._stopTick(),this._timer=setTimeout((function(){e._checkDecodeFPS(),e._startTick()}),this.config.tick)}},{key:"_stopTick",value:function(){clearTimeout(this._timer),this._timer=null}},{key:"_checkStuck",value:function(e,t,r,i){var n=this.player.media,o=document.hidden,a=n.paused;if("boolean"==typeof o&&!o&&!a){for(var s=n.currentTime,l=n.buffered,c=!1,u=[],h=0;h<l.length;h++){var d=l.start(h),p=l.end(h);if(u.push({start:d,end:p}),d<=s&&s<=p-1){c=!0;break}}4===n.readyState&&c&&(this._currentStuckCount>this.config.stuckCount?(this.emit(FPS_STUCK,this._payload),this._reset()):e<=this.config.reportFrame?(this._currentStuckCount++,this._payload.push({bufs:u,currentTime:n.currentTime,curDecodedFrames:e,totalVideoFrames:t,droppedVideoFrames:r,checkInterval:i})):this._reset())}}},{key:"_reset",value:function(){this._payload=[],this._currentStuckCount=0}},{key:"_checkDecodeFPS",value:function(){if(this.player.media){var e=this.player.media.getVideoPlaybackQuality(),t=e.totalVideoFrames,r=e.droppedVideoFrames,i=performance.now();if(t&&this._lastCheckPoint){var n=t-this._lastDecodedFrames,o=i-this._lastCheckPoint;this._checkStuck(n,t,r,o)}this._lastDecodedFrames=t,this._lastCheckPoint=i}}},{key:"destroy",value:function(){this._stopTick()}}],[{key:"pluginName",get:function(){return"FpsDetect"}},{key:"defaultConfig",get:function(){return{disabled:!1,tick:1e3,stuckCount:3,reportFrame:0}}}]),r}(Plugin);I18N.use(ZH);var DefaultPreset=_createClass$5((function e(t,r){var i,n,o;_classCallCheck$4(this,e);var a=r&&"mobile"===r.isMobileSimulateMode,s=r.isLive,l=[].concat(s?[]:[Progress,MiniProgress,ProgressPreview,Time],[Play,Fullscreen,Rotate,PlayNextIcon,DefinitionIcon,PlaybackRate,Download,ScreenShot,Volume,PIP]),c=[Replay,Poster,Start,Loading,Enter,ErrorPlugin$1,Prompt,Thumbnail,MiniScreen];this.plugins=[Stats,XGLogger].concat(_toConsumableArray(l),c,[GapJump,WaitingTimeoutJump]);var u=a?"mobile":sniffer$1.device;switch(u){case"pc":(i=this.plugins).push.apply(i,[Keyboard,PCPlugin,CssFullScreen,TestSpeed,FpsDetect]);break;case"mobile":(n=this.plugins).push.apply(n,[MobilePlugin]);break;default:(o=this.plugins).push.apply(o,[Keyboard,PCPlugin,CssFullScreen])}(sniffer$1.os.isIpad||"pc"===u)&&this.plugins.push(DynamicBg),sniffer$1.os.isIpad&&this.plugins.push(PCPlugin),this.ignores=[],this.i18n=[]})),PresetPlayer=function(e){_inherits$4(r,e);var t=_createSuper$4(r);function r(){return _classCallCheck$4(this,r),t.apply(this,arguments)}return _createClass$5(r)}(Player);_defineProperty$5(PresetPlayer,"defaultPreset",DefaultPreset),_defineProperty$5(PresetPlayer,"Util",util),_defineProperty$5(PresetPlayer,"Sniffer",sniffer$1),_defineProperty$5(PresetPlayer,"Errors",Errors),_defineProperty$5(PresetPlayer,"Events",Events),_defineProperty$5(PresetPlayer,"Plugin",Plugin),_defineProperty$5(PresetPlayer,"BasePlugin",BasePlugin),_defineProperty$5(PresetPlayer,"I18N",I18N),_defineProperty$5(PresetPlayer,"STATE_CLASS",STATE_CLASS);var zhHk={LANG:"zh-hk",TEXT:{ERROR_TYPES:{network:{code:1,msg:"視頻下載錯誤"},mse:{code:2,msg:"劉追加錯誤"},parse:{code:3,msg:"解析錯誤"},format:{code:4,msg:"格式錯誤"},decoder:{code:5,msg:"解碼錯誤"},runtime:{code:6,msg:"語法錯誤"},timeout:{code:7,msg:"播放超時"},other:{code:8,msg:"其他錯誤"}},HAVE_NOTHING:"沒有關於音頻/視頻是否就緒的信息",HAVE_METADATA:"音頻/視頻的元數據已就緒",HAVE_CURRENT_DATA:"關於當前播放位置的數據是可用的,但沒有足夠的數據來播放下壹幀/毫秒",HAVE_FUTURE_DATA:"當前及至少下壹幀的數據是可用的",HAVE_ENOUGH_DATA:"可用數據足以開始播放",NETWORK_EMPTY:"音頻/視頻尚未初始化",NETWORK_IDLE:"音頻/視頻是活動的且已選取資源,但並未使用網絡",NETWORK_LOADING:"瀏覽器正在下載數據",NETWORK_NO_SOURCE:"未找到音頻/視頻來源",MEDIA_ERR_ABORTED:"取回過程被用戶中止",MEDIA_ERR_NETWORK:"下載錯誤",MEDIA_ERR_DECODE:"解碼錯誤",MEDIA_ERR_SRC_NOT_SUPPORTED:"不支持的音頻/視頻格式",REPLAY:"重播",ERROR:"網絡連接似乎出現了問題",PLAY_TIPS:"播放",PAUSE_TIPS:"暫停",PLAYNEXT_TIPS:"下壹集",DOWNLOAD_TIPS:"下載",ROTATE_TIPS:"旋轉",RELOAD_TIPS:"重新載入",FULLSCREEN_TIPS:"進入全屏",EXITFULLSCREEN_TIPS:"退出全屏",CSSFULLSCREEN_TIPS:"進入樣式全屏",EXITCSSFULLSCREEN_TIPS:"退出樣式全屏",TEXTTRACK:"字幕",PIP:"畫中畫",SCREENSHOT:"截圖",LIVE:"正在直播",OFF:"關閉",OPEN:"開啟",MINI_DRAG:"點擊按住可拖動視頻",MINISCREEN:"小屏幕",REFRESH_TIPS:"請試試",REFRESH:"刷新",FORWARD:"快进中",LIVE_TIP:"直播"}},jp$1={LANG:"jp",TEXT:{ERROR_TYPES:{network:{code:1,msg:"ビデオダウンロードエラー"},mse:{code:2,msg:"ストリーム追加エラー"},parse:{code:3,msg:"解析エラー"},format:{code:4,msg:"間違ったフォーマット"},decoder:{code:5,msg:"デコードエラー"},runtime:{code:6,msg:"文法エラー"},timeout:{code:7,msg:"再生タイムアウト"},other:{code:8,msg:"その他のエラー"}},HAVE_NOTHING:"オーディオ/ビデオが準備できているか情報がありません",HAVE_METADATA:"オーディオ/ビデオのメタデータは準備できています",HAVE_CURRENT_DATA:"現在の再生位置に関するデータは利用可能ですが、次のフレーム/ミリ秒を再生するのに十分なデータがありません",HAVE_FUTURE_DATA:"現在、少なくとも次のフレームのデータが利用可能です",HAVE_ENOUGH_DATA:"利用可能なデータは再生を開始するのに十分です",NETWORK_EMPTY:"オーディオ/ビデオが初期化されていません",NETWORK_IDLE:"オーディオ/ビデオはアクティブでリソースが選択されていますが、ネットワークが使用されていません",NETWORK_LOADING:"ブラウザーはデータをダウンロードしています",NETWORK_NO_SOURCE:"オーディオ/ビデオ のソースが見つかりません",MEDIA_ERR_ABORTED:"ユーザーによってフェッチプロセスが中止されました",MEDIA_ERR_NETWORK:"ダウンロード中にエラーが発生しました",MEDIA_ERR_DECODE:"デコード中にエラーが発生しました",MEDIA_ERR_SRC_NOT_SUPPORTED:"オーディオ/ビデオ の形式がサポートされていません",REPLAY:"リプレイ",ERROR:"ネットワークの接続に問題が発生しました",PLAY_TIPS:"プレイ",PAUSE_TIPS:"一時停止",PLAYNEXT_TIPS:"次をプレイ",DOWNLOAD_TIPS:"ダウンロード",ROTATE_TIPS:"回転",RELOAD_TIPS:"再読み込み",FULLSCREEN_TIPS:"フルスクリーン",EXITFULLSCREEN_TIPS:"フルスクリーンを終了",CSSFULLSCREEN_TIPS:"シアターモード",EXITCSSFULLSCREEN_TIPS:"シアターモードを終了",TEXTTRACK:"字幕",PIP:"ミニプレーヤー",SCREENSHOT:"スクリーンショット",LIVE:"生放送",OFF:"オフ",OPEN:"開いた",MINI_DRAG:"ボタンを押して働画をドラッグする",MINISCREEN:"小さな画面",REFRESH:"リフレッシュ",REFRESH_TIPS:"してみてください",FORWARD:"早送り",LIVE_TIP:"生放送"}};function ownKeys$5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function _objectSpread2$3(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$5(Object(r),!0).forEach((function(t){_defineProperty$4(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys$5(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _typeof$2(e){return(_typeof$2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _classCallCheck$3(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties$4(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,_toPropertyKey$2(i.key),i)}}function _createClass$4(e,t,r){return t&&_defineProperties$4(e.prototype,t),r&&_defineProperties$4(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty$4(e,t,r){return(t=_toPropertyKey$2(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _inherits$3(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$3(e,t)}function _getPrototypeOf$3(e){return(_getPrototypeOf$3=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _setPrototypeOf$3(e,t){return(_setPrototypeOf$3=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function _isNativeReflectConstruct$3(){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(e2){return!1}}function _assertThisInitialized$3(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _possibleConstructorReturn$3(e,t){if(t&&("object"===_typeof$4(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$3(e)}function _createSuper$3(e){var t=_isNativeReflectConstruct$3();return function(){var r,i=_getPrototypeOf$3(e);if(t){var n=_getPrototypeOf$3(this).constructor;r=Reflect.construct(i,arguments,n)}else r=i.apply(this,arguments);return _possibleConstructorReturn$3(this,r)}}function _superPropBase$1(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf$3(e)););return e}function _get$1(){return _get$1="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var i=_superPropBase$1(e,t);if(i){var n=Object.getOwnPropertyDescriptor(i,t);return n.get?n.get.call(arguments.length<3?e:r):n.value}},_get$1.apply(this,arguments)}function _toPrimitive$2(e,t){if("object"!==_typeof$4(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!==_typeof$4(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _toPropertyKey$2(e){var t=_toPrimitive$2(e,"string");return"symbol"===_typeof$4(t)?t:String(t)}var VTT_CHECK=/^WEBVTT/,VTT_STYLE=/^STYLE+$/,VTT_CUE=/^\:\:cue/,VTT_CUEND=/^}+$/,ASS_CHECK=/^\[Script Info\].*/,TIME_REGEX_LIST=[/[0-9]{1,3}:[0-9]{2}:[0-9]{2}\.[0-9]{1,3}-->[0-9]{1,3}:[0-9]{2}:[0-9]{2}\.[0-9]{1,3}/,/[0-9]{1,2}:[0-9]{2}\.[0-9]{1,3}-->[0-9]{1,2}:[0-9]{2}\.[0-9]{1,3}/,/[0-9]{1,2}\.[0-9]{1,3}-->[0-9]{1,2}\.[0-9]{1,3}/],MAX_COUNT=50,ASS_FORMAT=/^Format:\s/,ASS_STYLE=/^Style:\s/,ASS_DIALOGUE=/^Dialogue:\s/;function getSecond(e){var t=e.length;return 3===t?(60*(60*Number(e[0])+Number(e[1]))*1e3+1e3*Number(e[2]))/1e3:2===t?(60*Number(e[0])*1e3+1e3*Number(e[1]))/1e3:Number(e[0])}function isNumber(e){return/^(\-|\+)?\d+(\.\d+)?$/.test(e)}function htmlEncodeAll(e){return e}function getByIndex(e,t){return e>=0&&e<t.length?t[e]:""}var SubTitleParser=function(){function e(){_classCallCheck$3(this,e)}return _createClass$4(e,null,[{key:"parseJson",value:function(e){for(var t=[],r=0,i=0;i<e.length;i++){if(r>=MAX_COUNT&&(r=0),0===r){var n={start:e[i].start,list:[e[i]],end:e[i].end};t.push(n)}else t[t.length-1].list.push(e[i]),t[t.length-1].end=e[i].end;r++}return t}},{key:"parse",value:function(t,r){var i=e.checkFormat(t);i||r({format:i});try{var n=[];"ass"===i?n=e.parseASS(t):"vtt"===i&&(n=e.parseVTT(t)),r({format:i,list:n.list,styles:n.styles})}catch(o){console.error(o),r({format:i},o)}}},{key:"parseASSItem",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=e.split(","),i={},n="";try{var o=r.length-t.length;return n=htmlEncodeAll(n=(n=o>0?r.splice(t.length-1,o+1).join(",")+"":r[r.length-1]+"").replace(/\\n+/g,"")),r[t.length-1]=n,t.map((function(e,t){"end"===e||"start"===e?i[e]=getSecond(r[t].split(":")):"text"===e?i[e]=[r[t]]:"layer"===e?(i[e]=[r[t]],i.textTag=[r[t]]):i[e]="style"===e?[r[t]]:Number(r[t])?Number(r[t]):r[t]})),i}catch(a){return console.error(a),{}}}},{key:"parseASS",value:function(t){for(var r=t.split("\n"),i=[],n=0,o=0,a=[],s=[],l=null;n<r.length;){if(ASS_FORMAT.test(r[n]))s=(s=r[n].replace(ASS_FORMAT,"").replace(/\s+/g,"").split(",")).map((function(e){return e.toLocaleLowerCase()}));else if(ASS_STYLE.test(r[n]))a.push(r[n].replace(ASS_STYLE,"").replace(/\s+/g,""));else if(ASS_DIALOGUE.test(r[n])){var c=e.parseASSItem(r[n].replace(ASS_DIALOGUE,""),s);if(l&&c.start===l.start&&c.end===l.end)try{var u=l,h=u.text,d=u.textTag,p=u.style;h.push(c.text[0]),d.push(c.textTag[0]),p.push(c.style[0])}catch(g){console.error(g)}else{l=c;var f=null;o%MAX_COUNT==0?((f={start:l.start,end:l.end,list:[]}).list.push(l),i.push(f)):((f=i[i.length-1]).end=l.end,f.list.push(l)),o++}}n++}return{list:i,style:{}}}},{key:"parseVTTStyle",value:function(e,t){var r=e.split(":");if(r.length>1){var i=r[0].trim().split("-"),n="";i.length>1?i.map((function(e,t){n+=0===t?e:e.charAt(0).toUpperCase()+e.slice(1)})):n=i[0],t[n]=r[1].trim().replace(/;$/,"")}return t}},{key:"parseVTT",value:function(e){for(var t=(e=e.replace(VTT_CHECK,"")).split("\n"),r=[],i=0,n=0,o=null,a=!1,s=!1,l=null,c=null,u=[];i<t.length;){var h=getByIndex(i,t).trim();if(!h||a&&isNumber(h))a=!h;else if(VTT_CUE.test(h)&&VTT_STYLE.test(getByIndex(i-1,t).trim())){s=!0;var d=/\((.+?)\)/g.exec(h);c=d?d[1]:"",l=""}else if(s)VTT_CUEND.test(h)?(u.push({key:c,style:l}),l=null,c=null,s=!1):l+=h;else if(h){a=!1;var p=this.checkIsTime(t[i]);if(p){var f=this.parseVttTime(p);if(!o||f.start!==o.start||f.end!==o.end){(o=f).text=[],o.textTag=[];var g=null;n%MAX_COUNT==0?((g={start:o.start,end:o.end,list:[]}).list.push(o),r.push(g)):((g=r[r.length-1]).end=o.end,g.list.push(o)),n++}}else if(o){var y=o,v=y.text,m=y.textTag,_=this.parseVttText(t[i]);v.push(_.text),m.push(_.tag)}a=!1}i++}return{list:r,styles:u}}},{key:"checkIsTime",value:function(e){e=e.replace(/\s+/g,"");for(var t=0,r=null;t<TIME_REGEX_LIST.length&&!(r=TIME_REGEX_LIST[t].exec(e));)t++;return r?r[0]:null}},{key:"parseVttText",value:function(e){var t=/^(<?.+?>)/g.exec(e),r="",i="default";if(t){i=t[0].replace(/\<|\>|\&/g,"");var n=RegExp("^<".concat(i,">(([\\s\\S])*?)</").concat(i,">$")).exec(e);n?r=n[1]:(r=e,i="")}else r=e;for(var o=/<(\w+).(\w+)>/g,a=o.exec(r);a&&a.length>2;)r=r.replace(a[0],"<".concat(a[1],' class="').concat(a[2],'">')),a=o.exec(r);return{tag:i,text:htmlEncodeAll(r.replace(/\\n+/g,"<br/>"))}}},{key:"parseVttTime",value:function(e){var t,r=e.split("--\x3e"),i=0;if(2===r.length){var n=r[0].split(":"),o=r[1].split(":");t=getSecond(n),i=getSecond(o)}return{start:t,end:i,time:e}}},{key:"isVTT",value:function(e){return VTT_CHECK.test(e)}},{key:"isASS",value:function(e){return ASS_CHECK.test(e)}},{key:"checkFormat",value:function(e){return e?VTT_CHECK.test(e)?"vtt":ASS_CHECK.test(e)?"ass":null:null}}]),e}(),ERROR=[{code:0,msg:"SUCCESS"},{code:1,msg:"LOAD_ERROR"},{code:2,msg:"PARSER_ERROR"},{code:3,msg:"FORMAT_NOT_SUPPORTED"},{code:4,msg:"ID_OR_LANGUAGE_NOT_EXIST"},{code:5,msg:"PARAMETERS_ERROR"},{code:6,msg:"ABORT"},{code:7,msg:"UNKNOWN"},{code:8,msg:"DATA_ERROR:subtitle.url is null"},{code:9,msg:"DATA_ERROR:subtitle.url length is 0"}];function _ERROR(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={code:ERROR[e].code,msg:ERROR[e].msg};return Object.keys(t).map((function(e){r[e]=t[e]})),r}var XHR$1=_createClass$4((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.url,i=t.method,n=void 0===i?"GET":i,o=t.type,a=void 0===o?"arraybuffer":o,s=t.timeout,l=void 0===s?1e4:s,c=t.data,u=void 0===c?{}:c,h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return _classCallCheck$3(this,e),new Promise((function(e,t){var i=new window.XMLHttpRequest,o=n.toUpperCase(),s=[];if(a&&(i.responseType=a),l&&(i.timeout=l),Object.keys(u).forEach((function(e){s.push("k=".concat(u[e]))})),i.onload=function(){200===i.status||206===i.status?e({context:h,res:i}):t(new Error({context:h,res:i,type:"error"}))},i.onerror=function(e){t(new Error({context:h,res:i,type:"error"}))},i.ontimeout=function(e){t(new Error({context:h,res:i,type:"error"}))},i.onabort=function(){t(new Error({context:h,res:i,type:"error"}))},"GET"===o)i.open(o,"".concat(r)),i.send();else{if("post"!==o)throw new Error("xhr ".concat(o," is not supported"));i.open(o,r),i.setRequestHeader("Content-type","application/x-www-form-urlencoded"),i.send(s.join("&"))}}))})),ProxyPromise=function(){function e(){var t,r;_classCallCheck$3(this,e);var i=new Promise((function(e,i){t=e,r=i}));return i.resolve=function(e){t(e),i.state="fulfilled"},i.reject=function(e){r(e),i.state="rejected",i.isBreak="DESTROYED"===e},i.state="pending",i}return _createClass$4(e,[{key:"resolve",value:function(e){}},{key:"reject",value:function(e){}}]),e}();function hasClass$1(e,t){if(!e)return!1;if(e.classList)return Array.prototype.some.call(e.classList,(function(e){return e===t}));var r=e.className&&"object"===_typeof$2(e.className)?e.getAttribute("class"):e.className;return r&&!!r.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}function addClass$1(e,t){e&&(e.classList?t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.add(t)})):hasClass$1(e,t)||(e.className&&"object"===_typeof$2(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t))}function removeClass$1(e,t){e&&(e.classList?t.split(/\s+/g).forEach((function(t){e.classList.remove(t)})):hasClass$1(e,t)&&t.split(/\s+/g).forEach((function(t){var r=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===_typeof$2(e.className)?e.setAttribute("class",e.getAttribute("class").replace(r," ")):e.className=e.className.replace(r," ")})))}function findIndexByTime(e,t,r){var i=t.length;if(i<1)return-1;if(t[r=r<0?0:r>=i?i-1:r].start<=e&&e<t[r].end)return r;for(var n=t[r].end<=e?r+1:0;n<i;n++){if(t[n].start<=e&&e<t[n].end)return n;if(e>t[n].end&&n+1<i&&e<t[n+1].start)return-1;if(e>t[n].end&&n+1>=i)return-1}return-1}function findCIndexByTime(e,t,r){var i=t.length;if(i<1)return[];var n=[];if((r=r<0?0:r>=i?i-1:r)<i)for(var o=t[r].end<=e?r:0;o<i&&(t[o].start<=e&&e<t[o].end&&n.push(o),!(e<t[o].start));o++);return n}function getItemsByIndex(e,t,r){if(0===e.length||t<0||t>e.length-1)return[];var i=e[t].list;if(0===r.length)return[];var n=i.splice(r[0],r.length);return t>0&&e.splice(0,t),0===i.length&&e.splice(0,1),n}function typeOf(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]}function createDom(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",n=document.createElement(e);return n.className=i,n.innerHTML=t,Object.keys(r).forEach((function(t){var i=t,o=r[t];"video"===e||"audio"===e||"live-video"===e?o&&n.setAttribute(i,o):n.setAttribute(i,o)})),n}function isMobile(){var e=navigator.userAgent,t=/(?:Windows Phone)/.test(e),r=/(?:SymbianOS)/.test(e)||t,i=/(?:Android)/.test(e),n=/(?:Firefox)/.test(e),o=/(?:iPad|PlayBook)/.test(e)||i&&!/(?:Mobile)/.test(e)||n&&/(?:Tablet)/.test(e);return/(?:iPhone)/.test(e)&&!o||i||r||o}function addCSS(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r="";e.map((function(e){r+=" ".concat(t," ").concat(e.key," {").concat(e.style,"}")}));var i=document.createElement("style"),n=document.head||document.getElementsByTagName("head")[0];if(i.type="text/css",i.id="ssss",i.styleSheet){var o=function(){try{i.styleSheet.cssText=r}catch(e2){}};i.styleSheet.disabled?setTimeout(o,10):o()}else{var a=document.createTextNode(r);i.appendChild(a)}n.appendChild(i)}function parse(e,t,r){if(r||(r=new ProxyPromise),"json"===t){var i=SubTitleParser.parseJson(e);r.resolve({list:i,format:"json"})}else"string"===t&&SubTitleParser.parse(e,(function(e,t){if(t){var i=_ERROR(2,t);r.reject(i,{format:e.format})}else if(e.format)r.resolve({styles:e.styles,list:e.list,format:e.format});else{var n=_ERROR(3);r.reject(n)}}));return r}function loadSubTitle(e,t){return t||(t=new ProxyPromise),new XHR$1({url:e.url,type:"text"}).then((function(r){parse(r.res.response,"string").then((function(r){t.resolve(_objectSpread2$3(_objectSpread2$3({},r),e))})).catch((function(e){t.reject(e)}))})).catch((function(r){var i=_ERROR(1,_objectSpread2$3({statusText:r.statusText,status:r.status,type:r.type,message:"http load error",url:e.src},e));t.reject(i)})),t}function checkSubtitle(e,t){return!!(e.id&&t.id&&e.id===t.id||e.language&&t.language&&e.language===t.language)}var ResizeObserver=function(){function e(){var t=this;_classCallCheck$3(this,e),this.__handlers=[],window.ResizeObserver&&(this.observer=new window.ResizeObserver((function(e){t.__trigger(e)})))}return _createClass$4(e,[{key:"addObserver",value:function(e,t){if(this.observer){this.observer&&this.observer.observe(e);for(var r=this.__handlers,i=-1,n=0;n<r.length;n++)r[n]&&e===r[n].target&&(i=n);i>-1?this.__handlers[i].handler.push(t):this.__handlers.push({target:e,handler:[t]})}}},{key:"unObserver",value:function(e){var t=-1;this.__handlers.map((function(r,i){e===r.target&&(t=i)})),this.observer&&this.observer.unobserve(e),t>-1&&this.__handlers.splice(t,1)}},{key:"destroyObserver",value:function(){this.observer&&this.observer.disconnect(),this.observer=null,this.__handlers=null}},{key:"__runHandler",value:function(e,t){for(var r=this.__handlers,i=0;i<r.length;i++)if(r[i]&&e===r[i].target){r[i].handler&&r[i].handler.forEach((function(r){try{r(e,t)}catch(i){console.error(i)}}));break}}},{key:"__trigger",value:function(e){var t=this;e.map((function(e){var r=e.contentRect;t.__runHandler(e.target,r)}))}}]),e}(),resizeObserver=null;function addObserver(e,t){resizeObserver||(resizeObserver=new ResizeObserver),resizeObserver.addObserver(e,t)}function unObserver(e,t){resizeObserver&&resizeObserver.unObserver(e,t)}var EVENTS$1={RESIZE:"resize",CHANGE:"change",OFF:"off",UPDATE:"update"};function formatUrl(e){var t=[];return e&&"String"===typeOf(e)?t.push({url:e,index:0,start:-1,end:-1}):"Array"===typeOf(e)&&e.forEach((function(e,r){t.push({url:e.url||e.src,index:r,start:e.start||-1,end:e.end||-1})})),t}var IS_MOBILE$1=!1,Subtitle$1=function(e){_inherits$3(r,e);var t=_createSuper$3(r);function r(e){var i;return _classCallCheck$3(this,r),_defineProperty$4(_assertThisInitialized$3(i=t.call(this)),"_onTimeupdate",(function(){if(i._isOpen){var e=i.player.video,t=e.videoWidth,r=e.videoHeight;!i._videoMeta.scale&&t&&r&&i._onResize(i.player.root);var n=i._getPlayerCurrentTime();Math.round(Math.abs(1e3*n-i._ctime))<200||(i._ctime=1e3*n,i.currentText&&i.currentText.list&&("live"===i.config.updateMode?i._liveUpdate(n):i._update(n)))}})),_defineProperty$4(_assertThisInitialized$3(i),"getItemsByIndex",void 0),_defineProperty$4(_assertThisInitialized$3(i),"_onResize",(function(e){var t=_assertThisInitialized$3(i),r=t._videoMeta;if(t.config.domRender){if(e&&e instanceof window.Element||(e=i.player.root),i._iId&&(clearTimeout(i._iId),i._iId=null),!r.scale){if(!i.player.video)return;var n=i.player.video,o=n.videoWidth,a=n.videoHeight;if(!o||!a)return;r.videoWidth=o,r.videoHeight=a,r.scale=parseInt(a/o*100,10)}i.__startResize(e)}})),_defineProperty$4(_assertThisInitialized$3(i),"_onCoreEvents",(function(e){try{switch(e.eventName){case"core.subtitlesegments":i._onSubtitleSegment(e.list||[]);break;case"core.subtitleplaylist":i._onSubtitlePlaylist(e.list||[]);break;case"core.seipayloadtime":i._onCoreSeiintime(e)}}catch(t){console.error(t)}})),_defineProperty$4(_assertThisInitialized$3(i),"destroy",(function(){i.detachPlayer(),i.removeAllListeners(),i.player=null,i.textTrack=null})),IS_MOBILE$1=isMobile(),i.currentText=null,i.currentExtText=null,i.textTrack=[],i._cid=-1,i._gid=-1,i._cids=[],i._iId=null,i._iC=0,i.player=null,i.root=null,i.config={line:"double",bottom:0,mode:"stroke",defaultOpen:!1,baseSizeX:49,baseSizeY:28,minSize:16,minMobileSize:13,fitVideo:!0,offsetBottom:2,fontColor:"#fff",domRender:!0,updateMode:"vod",debugger:!1},i._ctime=0,i._loadingTrack={},Object.keys(i.config).map((function(t){void 0!==e[t]&&null!==e[t]&&(i.config[t]=e[t])})),i._isOpen=i.config.defaultOpen||!1,i._videoMeta={scale:0,videoHeight:0,videoWidth:0,lwidth:0,lheight:0,vWidth:0,vHeight:0,vBottom:0,vLeft:0,marginBottom:0},e.subTitles&&"Array"===typeOf(e.subTitles)?(e.player&&i.attachPlayer(e.player),i.seiTime=0,i.lastSeiTime=0,i._curTexts=[],i.setSubTitles(e.subTitles,i.config.defaultOpen),i):_possibleConstructorReturn$3(i)}return _createClass$4(r,[{key:"version",get:function(){return"3.0.7-alpha.3"}},{key:"setSubTitles",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=this._isOpen||r;i&&this.innerRoot&&this.switchOff(),this.currentText=null,this.textTrack=[],t.forEach((function(t){var r={};Object.keys(t).map((function(e){r[e]=t[e]})),r.url=formatUrl(r.url),r.isDefault&&(e.currentText=r),e.textTrack.push(r)})),this._log("setSubTitles",n),n&&this.switch().catch((function(t){e._log("[switch]",t)})),this.currentText&&this._loadTrack(this.currentText).then((function(t){e.addStyles(t)})),this.emit("reset",{list:this.textTrack,isOpen:n})}},{key:"updateSubTitle",value:function(e){for(var t=this,r=-1,i=0;i<this.textTrack.length;i++)if(checkSubtitle(e,this.textTrack[i])){r=i;break}if(this._log("updateSubTitle",r,e),r>-1){var n=checkSubtitle(this.currentText,this.textTrack[r]);if(this._log("updateSubTitle","_isCurrent",n,"this.isOpen",this.isOpen,this.currentText),!n)return;var o=formatUrl(e.url);this.isOpen?(o.forEach((function(e){t.textTrack[r].url.push(e)})),this._log("updateSubTitle _loadTrackUrls",this.textTrack[r]),this._loadTrackUrls(this.currentText,2)):this.textTrack[r].url=o}}},{key:"addStyles",value:function(e){var t=e.styles,r=e.format;t&&"vtt"===r&&(t.map((function(e){e.key||(e.key="xg-text-track-span")})),addCSS(t,"xg-text-track"))}},{key:"attachPlayer",value:function(e){var t=this;if(this._log("attachPlayer"),e){this.player&&this.detachPlayer();var r=this.config,i=r.fontColor,n=r.mode,o=r.fitVideo,a=r.domRender;this.player=e,a&&(this.root=document.createElement("xg-text-track"),this.root.className="xg-text-track",!this._isOpen&&addClass$1(this.root,"text-track-hide"),!o&&addClass$1(this.root,"text-track-no-fitvideo"),n&&addClass$1(this.root,"text-track-".concat(n)),this.innerRoot=document.createElement("xg-text-track-inner"),this.root.appendChild(this.innerRoot),i&&(this.root.style.color=i),this.currentText&&["language","id","label"].map((function(e){t.root.setAttribute("data-".concat(e),t.currentText[e]||"")})),this.player.root.appendChild(this.root),addObserver(e.root,this._onResize)),this.player.on("destroy",this.destroy),this.player.on("timeupdate",this._onTimeupdate),this.player.on("core_event",this._onCoreEvents),this._isOpen&&this.switch().catch((function(e){t._log("[switch]",e)}))}}},{key:"detachPlayer",value:function(){var e=this.player,t=this.config;e&&(e.off("destroy",this.destroy),e.off("timeupdate",this._onTimeupdate),e.on("core_event",this._onCoreEvents),t.domRender&&(e.root&&(unObserver(e.root,this._onResize),e.root.removeChild(this.root)),this.innerRoot=null,this.root=null),this.player=null)}},{key:"switch",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:"",language:""};return this._log("switch",t),this._loadingTrack=t,new Promise((function(r,i){if(t.id||t.language)if(e.currentText&&checkSubtitle(t,e.currentText))e._loadingTrack={},e._updateCurrent(e.currentText),e.switchOn(),r(_ERROR(0));else{var n=null;e.__removeByTime(e._curTexts,0);for(var o=0;o<e.textTrack.length;o++)if(checkSubtitle(t,e.textTrack[o])){n=e.textTrack[o];break}if(e._log("nextSubtitle",n),n)e._emitPlayerSwitch(e.currentText,n),n.list?(e._loadingTrack={},e._updateCurrent(n),e.switchOn(),r(_ERROR(0))):(e._log("this._loadTrack",n),e._updateCurrent(n),e._loadTrack(n).then((function(t){if(e.addStyles(t),e._loadingTrack.id===n.id||e._loadingTrack.language===t.language)e._loadingTrack={},e._updateCurrent(t),e.switchOn(),r(_ERROR(0));else{var o=_ERROR(6,{message:"check _loadingTrack fail id: ".concat(e._loadingTrack.id," nextSubtitle:").concat(t.id)});i(o)}})).catch((function(e){i(e)})));else{var a=_ERROR(4,new Error("The is no subtitle with id:[{".concat(t.id,"}] or language:[").concat(t.language,"]")));i(a)}}else{if(e.currentText){e._loadingTrack={},e._updateCurrent(e.currentText),e.switchOn();var s=_ERROR(0,{message:"switch default subtitle success"});return void r(s)}var l=_ERROR(5,{message:"no default subtitle"});i(l)}}))}},{key:"switchExt",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:"",language:""};return new Promise((function(r,i){if(t.id||t.language){for(var n=null,o=0;o<e.textTrack.length;o++)if(checkSubtitle(t,e.textTrack[o])){n=e.textTrack[o];break}n&&!checkSubtitle(n,e.currentText)&&e._loadTrack(n).then((function(t){e.currentExtText=t,r(_ERROR(0))}))}else e.currentExtText=null,r(_ERROR(0))}))}},{key:"switchOn",value:function(){this._log("switchOn"),this._isOpen=!0,this.show(),this.emit(EVENTS$1.CHANGE,this.currentText)}},{key:"switchOff",value:function(){this._isOpen=!1,this.hide(),this.emit(EVENTS$1.OFF)}},{key:"isOpen",get:function(){return this._isOpen}},{key:"_log",value:function(){if(this.config.debugger){for(var e,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];(e=console).log.apply(e,["[xgSubtitle]"].concat(r))}}},{key:"_loadTrack",value:function(e){var t=this;this._log("_loadTrack",e.language,e);var r=new ProxyPromise,i="",n="";if(e.json?(i="json",n=e.json):e.stringContent&&!e.url&&(i="string",n=e.stringContent),n)return parse(n,i).then((function(t){e.format=t.format,e.styles=t.styles,e.list=t.list,r.resolve(e)})).catch((function(e){r.reject(e)})),r;var o=e.url;return 0===o.length?(r.resolve(e),r):(loadSubTitle(o.splice(0,1)[0]).then((function(i){e.format=i.format,e.styles=i.styles,e.list||(e.list=[]),t._pushList(e.list,i.list),o.length>1&&t._loadTrackUrls(e,2),r.resolve(e)})).catch((function(e){r.reject(e)})),r)}},{key:"_emitPlayerSwitch",value:function(e,t){e&&"live"===this.config.updateMode&&(e.list=[],e.url=[]);var r=_objectSpread2$3({lang:t.language},t);this._log("emit subtile_switch ",t,r),this.player&&this.player.emit("switch_subtitle",r)}},{key:"_loadTrackUrls",value:function(e,t,r){var i=this,n=e.url.length,o=n>t?e.url.splice(0,t):e.url.splice(0,n),a=o.length;this._log("_loadTrackUrls",e.language,n,o.length,a),o.forEach((function(t,n){loadSubTitle(_objectSpread2$3(_objectSpread2$3({},t),{},{index:n})).then((function(t){e.format=t.format,e.styles=t.format,e.list||(e.list=[]),i._pushList(e.list,t.list),a--})).catch((function(e){a--})).finally((function(t){0===a&&(r&&r.resolve(e),i._loadTrackUrls(e,2))}))}))}},{key:"_freshUrl",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{url:""},r=-1;e.url.forEach((function(e,i){e.url===t.url&&(r=i)})),r>-1&&e.url.splice(r,1)}},{key:"_pushList",value:function(e,t){var r=t[0].start,i=t[t.length-1].end;if(0===e.length||r>=e[e.length-1].end)t.forEach((function(t){e.push(t)}));else{for(var n=-1,o=0;o<e.length;o++)if(e[o].start>i){n=o;break}n>-1&&t.forEach((function(t,r){e.splice(n+r,0,t)}))}return e}},{key:"_updateCurrent",value:function(e){var t=this;this.currentText=e,this.config.domRender&&this.root&&(["language","id","label"].map((function(e){t.root.setAttribute("data-".concat(e),t.currentText[e]||"")})),this.__remove(this._cids)),this._cids=[],this._gid=-1,this._cid=-1,this._curTexts=[];var r=this._getPlayerCurrentTime();r&&("live"===this.config.updateMode?this._liveUpdate(r):this._update(r))}},{key:"__loadAll",value:function(){var e=this;this.textTrack.forEach((function(t){e._loadTrack(t)}))}},{key:"getDelCid",value:function(e,t){for(var r=[],i=0;i<e.length;i++)t.includes(e[i])||r.push(e[i]);return r}},{key:"getNewCid",value:function(e,t){for(var r=[],i=0;i<t.length;i++)e.includes(t[i])||r.push(t[i]);return r}},{key:"_liveUpdate",value:function(e){var t=this;if(this.currentText&&this.currentText.list&&this.currentText.list.length){var r=[],i=findIndexByTime(e,this.currentText.list,this._gid);if(i>-1&&(r=findCIndexByTime(e,this.currentText.list[i].list,this._cid)),this.__removeByTime(this._curTexts,e),this._log("_liveUpdate",e,i,r,this.currentText.list[0].list[0].start,this.currentText.list[0].list[0].end),r.length>0){var n=getItemsByIndex(this.currentText.list,i,r),o=this._curTexts.length,a=o>0?this._curTexts[o-1].index:0;n.forEach((function(e,r){e.index=r+a,t._curTexts.push(e)})),this.__render(n)}this.emit("update",this._curTexts)}}},{key:"_update",value:function(e){var t=this;if(this.currentText&&this.currentText.list&&this.currentText.list.length){var r=findIndexByTime(e,this.currentText.list,this._gid),i=[];if(r>-1&&(i=findCIndexByTime(e,this.currentText.list[r].list,this._cid)),i.length<1)return this._cids.length>0&&this.config.domRender&&this.__remove(this._cids),void(this._cids=[]);if(this._cids!==i||r!==this._gid){this._gid=r,this._cid=i[0];var n=this.getDelCid(this._cids,i),o=this.getNewCid(this._cids,i);this._cids=i,this.config.domRender&&this.__remove(n);var a=[];o.map((function(e){var i=t.currentText.list[r].list[e];i.index=e,a.push(i)})),this.currentExtText&&o.map((function(e){var i=t.currentText.list[r].list[e];i.index=e,a.push(i)})),this.emit("update",a),this.__render(a,e)}}}},{key:"_getPlayerCurrentTime",value:function(){if(!this.player)return 0;var e=this.player.currentTime;return parseInt(1e3*e+1e3*this.seiTime-1e3*this.lastSeiTime,10)/1e3}},{key:"_onSubtitlePlaylist",value:function(e){this._log("_onSubtitlePlaylist",e);var t=e.map((function(e){return{label:e.name,language:e.lang,id:e.id,isDefault:e.default,url:[],mUrl:e.url}}));this.setSubTitles(t)}},{key:"_onSubtitleSegment",value:function(e){if(this._log("_onSubtitleSegment",e.length,e[0].lang,e[0].sn,e[e.length-1].sn,e[0].start,e[e.length-1].end),e&&0!==e.length){var t={language:e[0].lang,url:e.map((function(e){return{id:e.sn,url:e.url,duration:e.duration,start:e.start,end:e.end}}))};checkSubtitle(t,this.currentText)&&this.updateSubTitle(t)}}},{key:"_onCoreSeiintime",value:function(e){try{var t=e.time/1e3;this._log("_onCoreSeiintime sei",t,this.seiTime,this.lastSeiTime),this.seiTime=t,this.lastSeiTime=this.player?this.player.currentTime:0}catch(r){}}},{key:"resize",value:function(e,t){var r,i=this,n=this.config,o=n.baseSizeX,a=n.baseSizeY,s=n.minMobileSize,l=n.minSize,c=n.fitVideo,u=n.offsetBottom,h=this._videoMeta.scale;this._videoMeta.lwidth=e,this._videoMeta.lheight=t;var d=0;t/e*100>=h?(d=parseInt(h*e,10)/100,r=e):(d=t,r=parseInt(t/h*100,10)),this._videoMeta.vWidth=r,this._videoMeta.vHeight=d;var p=0,f=0;h>120?(p=a,f=parseInt(p*d/1080,10)):(p=o,f=parseInt(p*r/1920,10));var g=IS_MOBILE$1?s:l,y={fontSize:f=f<g?g:f>p?p:f},v=parseInt((t-d)/2,10),m=parseInt((e-r)/2,10),_=parseInt(d*u,10)/100;this._videoMeta.vBottom=v,this._videoMeta.vLeft=m,this._videoMeta.marginBottom=_,c&&(y.bottom=v+_,y.left=y.right=m),Object.keys(y).map((function(e){i.root.style[e]="".concat(y[e],"px")})),this.emit(EVENTS$1.RESIZE,{vLeft:m,vBottom:v,marginBottom:_,vWidth:r,vHeight:d,fontSize:f,scale:h})}},{key:"__startResize",value:function(e){var t=this,r=e.getBoundingClientRect(),i=this._videoMeta,n=r.width,o=r.height;if(this._iId&&(clearTimeout(this._iId),this._iId=null),n>0&&o>0&&(n!==i.lwidth||o!==i.lheight))this._iC=0,this.resize(n,o);else{if(this._iC>=5)return void(this._iC=0);this._iC++,this._iId=setTimeout((function(){t.__startResize(e)}),50)}}},{key:"__removeByTime",value:function(e,t){for(var r=[],i=0;i<e.length;i++)(!t||e[i].end<t)&&r.push(i);0!==r.length&&(e.splice(r[0],r.length),this.config.domRender&&this.__remove(r))}},{key:"__remove",value:function(e){var t=this;if(e&&!(e.length<1)){for(var r=this.innerRoot.children,i=[],n=0;n<r.length;n++){var o=Number(r[n].getAttribute("data-index"));e.includes(o)&&i.push(r[n])}i.map((function(e){t.innerRoot.removeChild(e)}))}}},{key:"__render",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this._log("__render",t.length,this.config.domRender),t.length>0&&this.config.domRender&&t.map((function(t){var r="text-track-".concat(e.config.line);t.text.map((function(i,n){n>0&&(r+=" text-track-deputy");var o={"data-start":t.start,"data-end":t.end,"data-index":t.index};e.innerRoot.appendChild(createDom("xg-text-track-span",i,o,r))}))}))}},{key:"show",value:function(){this.config.domRender&&removeClass$1(this.root,"text-track-hide")}},{key:"hide",value:function(){this.config.domRender&&(addClass$1(this.root,"text-track-hide"),this.innerRoot.innerHTML="")}},{key:"emit",value:function(e,t){for(var i,n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];(i=_get$1(_getPrototypeOf$3(r.prototype),"emit",this)).call.apply(i,[this,e,t].concat(o))}},{key:"on",value:function(e,t){for(var i,n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];(i=_get$1(_getPrototypeOf$3(r.prototype),"on",this)).call.apply(i,[this,e,t].concat(o))}},{key:"once",value:function(e,t){for(var i,n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];(i=_get$1(_getPrototypeOf$3(r.prototype),"once",this)).call.apply(i,[this,e,t].concat(o))}},{key:"off",value:function(e,t){for(var i,n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];(i=_get$1(_getPrototypeOf$3(r.prototype),"off",this)).call.apply(i,[this,e,t].concat(o))}},{key:"offAll",value:function(){_get$1(_getPrototypeOf$3(r.prototype),"removeAllListeners",this).call(this)}},{key:"marginBottom",get:function(){var e=this._videoMeta,t=e.bottom,r=e.marginBottom;return this.config.fitVideo?t+r:r}}]),r}(EventEmitter),DefinitionLinked={origin:{index:1,next:"uhd",prev:null},uhd:{index:2,next:"hd",prev:"origin"},hd:{index:3,next:"sd",prev:"uhd"},sd:{index:4,next:"ld",prev:"hd"},ld:{index:5,next:"ao",prev:"sd"},ao:{index:6,next:null,prev:"ld"}},PLAYER_LANGS=["zh","en","jp","zh-hk"],PLAYER_MODE={NORMAL:0,INNER:1,FULLSCREEN:2},VIDEO_STATUS_TYPE=function(e){return e[e.VALID=10]="VALID",e[e.TRANSCODING=30]="TRANSCODING",e[e.NO_SET_AUDIT=1e3]="NO_SET_AUDIT",e[e.OFFLINE=1002]="OFFLINE",e[e.NO_AUTH=2001]="NO_AUTH",e[e.UN_AUTH=2002]="UN_AUTH",e}(VIDEO_STATUS_TYPE||{}),MIN_EXPIRE_INTERVAL=300,dayjs_min={exports:{}};!function(e,t){e.exports=function(){var e=1e3,t=6e4,r=36e5,i="millisecond",n="second",o="minute",a="hour",s="day",l="week",c="month",u="quarter",h="year",d="date",p="Invalid Date",f=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],r=e%100;return"["+e+(t[(r-20)%10]||t[r]||t[0])+"]"}},v=function(e,t,r){var i=String(e);return!i||i.length>=t?e:""+Array(t+1-i.length).join(r)+e},m={s:v,z:function(e){var t=-e.utcOffset(),r=Math.abs(t),i=Math.floor(r/60),n=r%60;return(t<=0?"+":"-")+v(i,2,"0")+":"+v(n,2,"0")},m:function e(t,r){if(t.date()<r.date())return-e(r,t);var i=12*(r.year()-t.year())+(r.month()-t.month()),n=t.clone().add(i,c),o=r-n<0,a=t.clone().add(i+(o?-1:1),c);return+(-(i+(r-n)/(o?n-a:a-n))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:c,y:h,w:l,d:s,D:d,h:a,m:o,s:n,ms:i,Q:u}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},_="en",b={};b[_]=y;var T=function(e){return e instanceof C},S=function e(t,r,i){var n;if(!t)return _;if("string"==typeof t){var o=t.toLowerCase();b[o]&&(n=o),r&&(b[o]=r,n=o);var a=t.split("-");if(!n&&a.length>1)return e(a[0])}else{var s=t.name;b[s]=t,n=s}return!i&&n&&(_=n),n||!i&&_},E=function(e,t){if(T(e))return e.clone();var r="object"==_typeof$4(t)?t:{};return r.date=e,r.args=arguments,new C(r)},$=m;$.l=S,$.i=T,$.w=function(e,t){return E(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var C=function(){function y(e){this.$L=S(e.locale,null,!0),this.parse(e)}var v=y.prototype;return v.parse=function(e){this.$d=function(e){var t=e.date,r=e.utc;if(null===t)return new Date(NaN);if($.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var i=t.match(f);if(i){var n=i[2]-1||0,o=(i[7]||"0").substring(0,3);return r?new Date(Date.UTC(i[1],n,i[3]||1,i[4]||0,i[5]||0,i[6]||0,o)):new Date(i[1],n,i[3]||1,i[4]||0,i[5]||0,i[6]||0,o)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},v.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},v.$utils=function(){return $},v.isValid=function(){return!(this.$d.toString()===p)},v.isSame=function(e,t){var r=E(e);return this.startOf(t)<=r&&r<=this.endOf(t)},v.isAfter=function(e,t){return E(e)<this.startOf(t)},v.isBefore=function(e,t){return this.endOf(t)<E(e)},v.$g=function(e,t,r){return $.u(e)?this[t]:this.set(r,e)},v.unix=function(){return Math.floor(this.valueOf()/1e3)},v.valueOf=function(){return this.$d.getTime()},v.startOf=function(e,t){var r=this,i=!!$.u(t)||t,u=$.p(e),p=function(e,t){var n=$.w(r.$u?Date.UTC(r.$y,t,e):new Date(r.$y,t,e),r);return i?n:n.endOf(s)},f=function(e,t){return $.w(r.toDate()[e].apply(r.toDate("s"),(i?[0,0,0,0]:[23,59,59,999]).slice(t)),r)},g=this.$W,y=this.$M,v=this.$D,m="set"+(this.$u?"UTC":"");switch(u){case h:return i?p(1,0):p(31,11);case c:return i?p(1,y):p(0,y+1);case l:var _=this.$locale().weekStart||0,b=(g<_?g+7:g)-_;return p(i?v-b:v+(6-b),y);case s:case d:return f(m+"Hours",0);case a:return f(m+"Minutes",1);case o:return f(m+"Seconds",2);case n:return f(m+"Milliseconds",3);default:return this.clone()}},v.endOf=function(e){return this.startOf(e,!1)},v.$set=function(e,t){var r,l=$.p(e),u="set"+(this.$u?"UTC":""),p=(r={},r[s]=u+"Date",r[d]=u+"Date",r[c]=u+"Month",r[h]=u+"FullYear",r[a]=u+"Hours",r[o]=u+"Minutes",r[n]=u+"Seconds",r[i]=u+"Milliseconds",r)[l],f=l===s?this.$D+(t-this.$W):t;if(l===c||l===h){var g=this.clone().set(d,1);g.$d[p](f),g.init(),this.$d=g.set(d,Math.min(this.$D,g.daysInMonth())).$d}else p&&this.$d[p](f);return this.init(),this},v.set=function(e,t){return this.clone().$set(e,t)},v.get=function(e){return this[$.p(e)]()},v.add=function(i,u){var d,p=this;i=Number(i);var f=$.p(u),g=function(e){var t=E(p);return $.w(t.date(t.date()+Math.round(e*i)),p)};if(f===c)return this.set(c,this.$M+i);if(f===h)return this.set(h,this.$y+i);if(f===s)return g(1);if(f===l)return g(7);var y=(d={},d[o]=t,d[a]=r,d[n]=e,d)[f]||1,v=this.$d.getTime()+i*y;return $.w(v,this)},v.subtract=function(e,t){return this.add(-1*e,t)},v.format=function(e){var t=this,r=this.$locale();if(!this.isValid())return r.invalidDate||p;var i=e||"YYYY-MM-DDTHH:mm:ssZ",n=$.z(this),o=this.$H,a=this.$m,s=this.$M,l=r.weekdays,c=r.months,u=function(e,r,n,o){return e&&(e[r]||e(t,i))||n[r].slice(0,o)},h=function(e){return $.s(o%12||12,e,"0")},d=r.meridiem||function(e,t,r){var i=e<12?"AM":"PM";return r?i.toLowerCase():i},f={YY:String(this.$y).slice(-2),YYYY:this.$y,M:s+1,MM:$.s(s+1,2,"0"),MMM:u(r.monthsShort,s,c,3),MMMM:u(c,s),D:this.$D,DD:$.s(this.$D,2,"0"),d:String(this.$W),dd:u(r.weekdaysMin,this.$W,l,2),ddd:u(r.weekdaysShort,this.$W,l,3),dddd:l[this.$W],H:String(o),HH:$.s(o,2,"0"),h:h(1),hh:h(2),a:d(o,a,!0),A:d(o,a,!1),m:String(a),mm:$.s(a,2,"0"),s:String(this.$s),ss:$.s(this.$s,2,"0"),SSS:$.s(this.$ms,3,"0"),Z:n};return i.replace(g,(function(e,t){return t||f[e]||n.replace(":","")}))},v.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},v.diff=function(i,d,p){var f,g=$.p(d),y=E(i),v=(y.utcOffset()-this.utcOffset())*t,m=this-y,_=$.m(this,y);return _=(f={},f[h]=_/12,f[c]=_,f[u]=_/3,f[l]=(m-v)/6048e5,f[s]=(m-v)/864e5,f[a]=m/r,f[o]=m/t,f[n]=m/e,f)[g]||m,p?_:$.a(_)},v.daysInMonth=function(){return this.endOf(c).$D},v.$locale=function(){return b[this.$L]},v.locale=function(e,t){if(!e)return this.$L;var r=this.clone(),i=S(e,t,!0);return i&&(r.$L=i),r},v.clone=function(){return $.w(this.$d,this)},v.toDate=function(){return new Date(this.valueOf())},v.toJSON=function(){return this.isValid()?this.toISOString():null},v.toISOString=function(){return this.$d.toISOString()},v.toString=function(){return this.$d.toUTCString()},y}(),P=C.prototype;return E.prototype=P,[["$ms",i],["$s",n],["$m",o],["$H",a],["$W",s],["$M",c],["$y",h],["$D",d]].forEach((function(e){P[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),E.extend=function(e,t){return e.$i||(e(t,C,E),e.$i=!0),E},E.locale=S,E.isDayjs=T,E.unix=function(e){return E(1e3*e)},E.en=b[_],E.Ls=b,E.p={},E}()}(dayjs_min);var dayjs=dayjs_min.exports,utc$1={exports:{}};!function(e,t){var r,i,n;e.exports=(r="minute",i=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g,function(e,t,o){var a=t.prototype;o.utc=function(e){return new t({date:e,utc:!0,args:arguments})},a.utc=function(e){var t=o(this.toDate(),{locale:this.$L,utc:!0});return e?t.add(this.utcOffset(),r):t},a.local=function(){return o(this.toDate(),{locale:this.$L,utc:!1})};var s=a.parse;a.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),s.call(this,e)};var l=a.init;a.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else l.call(this)};var c=a.utcOffset;a.utcOffset=function(e,t){var o=this.$utils().u;if(o(e))return this.$u?0:o(this.$offset)?c.call(this):this.$offset;if("string"==typeof e&&null===(e=function(e){void 0===e&&(e="");var t=e.match(i);if(!t)return null;var r=(""+t[0]).match(n)||["-",0,0],o=r[0],a=60*+r[1]+ +r[2];return 0===a?0:"+"===o?a:-a}(e)))return this;var a=Math.abs(e)<=16?60*e:e,s=this;if(t)return s.$offset=a,s.$u=0===e,s;if(0!==e){var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(s=this.local().add(a+l,r)).$offset=a,s.$x.$localOffset=l}else s=this.utc();return s};var u=a.format;a.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return u.call(this,t)},a.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var h=a.toDate;a.toDate=function(e){return"s"===e&&this.$offset?o(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():h.call(this)};var d=a.diff;a.diff=function(e,t,r){if(e&&this.$u===e.$u)return d.call(this,e,t,r);var i=this.local(),n=o(e).local();return d.call(i,n,t,r)}})}(utc$1);var utc=utc$1.exports,dist=function(e){var t={};function r(i){if(t[i])return t[i].exports;var n=t[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==_typeof$4(e)&&e&&e.__esModule)return e;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(i,n,function(t){return e[t]}.bind(null,n));return i},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=22)}([function(e,t,r){var i=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=i)},function(e,t,r){var i=r(12)("wks"),n=r(13),o=r(0).Symbol,a="function"==typeof o;(e.exports=function(e){return i[e]||(i[e]=a&&o[e]||(a?o:n)("Symbol."+e))}).store=i},function(e,t,r){var i=e.exports={version:"2.6.12"};"number"==typeof __e&&(__e=i)},function(e,t,r){var i=r(4);e.exports=function(e){if(!i(e))throw TypeError(e+" is not an object!");return e}},function(e,t,r){var i="function"==typeof Symbol&&"symbol"==_typeof$4(Symbol.iterator)?function(e){return _typeof$4(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_typeof$4(e)};e.exports=function(e){return"object"===(void 0===e?"undefined":i(e))?null!==e:"function"==typeof e}},function(e,t,r){var i=r(6);e.exports=function(e,t,r){if(i(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,i){return e.call(t,r,i)};case 3:return function(r,i,n){return e.call(t,r,i,n)}}return function(){return e.apply(t,arguments)}}},function(e,t,r){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,r){e.exports=!r(15)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(e,t,r){var i={}.toString;e.exports=function(e){return i.call(e).slice(8,-1)}},function(e,t,r){var i=r(3),n=r(26),o=r(27),a=Object.defineProperty;t.f=r(7)?Object.defineProperty:function(e,t,r){if(i(e),t=o(t,!0),i(r),n)try{return a(e,t,r)}catch(s){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(e[t]=r.value),e}},function(e,t,r){e.exports=!1},function(e,t,r){var i=r(8),n=r(1)("toStringTag"),o="Arguments"==i(function(){return arguments}());e.exports=function(e){var t,r,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(r){}}(t=Object(e),n))?r:o?i(t):"Object"==(a=i(t))&&"function"==typeof t.callee?"Arguments":a}},function(e,t,r){var i=r(2),n=r(0),o=n["__core-js_shared__"]||(n["__core-js_shared__"]={});(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:i.version,mode:r(10)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(e,t,r){var i=0,n=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++i+n).toString(36))}},function(e,t,r){var i=r(9),n=r(28);e.exports=r(7)?function(e,t,r){return i.f(e,t,n(1,r))}:function(e,t,r){return e[t]=r,e}},function(e,t,r){e.exports=function(e){try{return!!e()}catch(t){return!0}}},function(e,t,r){var i=r(4),n=r(0).document,o=i(n)&&i(n.createElement);e.exports=function(e){return o?n.createElement(e):{}}},function(e,t,r){var i=r(0),n=r(14),o=r(18),a=r(13)("src"),s=r(29),l=(""+s).split("toString");r(2).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,r,s){var c="function"==typeof r;c&&(o(r,"name")||n(r,"name",t)),e[t]!==r&&(c&&(o(r,a)||n(r,a,e[t]?""+e[t]:l.join(String(t)))),e===i?e[t]=r:s?e[t]?e[t]=r:n(e,t,r):(delete e[t],n(e,t,r)))})(Function.prototype,"toString",(function(){return"function"==typeof this&&this[a]||s.call(this)}))},function(e,t,r){var i={}.hasOwnProperty;e.exports=function(e,t){return i.call(e,t)}},function(e,t,r){e.exports={}},function(e,t,r){var i,n,o,a=r(5),s=r(38),l=r(39),c=r(16),u=r(0),h=u.process,d=u.setImmediate,p=u.clearImmediate,f=u.MessageChannel,g=u.Dispatch,y=0,v={},m=function(){var e=+this;if(v.hasOwnProperty(e)){var t=v[e];delete v[e],t()}},_=function(e){m.call(e.data)};d&&p||(d=function(e){for(var t=[],r=1;arguments.length>r;)t.push(arguments[r++]);return v[++y]=function(){s("function"==typeof e?e:Function(e),t)},i(y),y},p=function(e){delete v[e]},"process"==r(8)(h)?i=function(e){h.nextTick(a(m,e,1))}:g&&g.now?i=function(e){g.now(a(m,e,1))}:f?(o=(n=new f).port2,n.port1.onmessage=_,i=a(o.postMessage,o,1)):u.addEventListener&&"function"==typeof postMessage&&!u.importScripts?(i=function(e){u.postMessage(e+"","*")},u.addEventListener("message",_,!1)):i="onreadystatechange"in c("script")?function(e){l.appendChild(c("script")).onreadystatechange=function(){l.removeChild(this),m.call(e)}}:function(e){setTimeout(a(m,e,1),0)}),e.exports={set:d,clear:p}},function(e,t,r){var i=r(6);function n(e){var t,r;this.promise=new e((function(e,i){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=i})),this.resolve=i(t),this.reject=i(r)}e.exports.f=function(e){return new n(e)}},function(e,t,r){e.exports=r(23)},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),r(24);var i,n=(i=r(48))&&i.__esModule?i:{default:i};t.default={url:n.default},e.exports=t.default},function(e,t,r){var i,n,o,a,s=r(10),l=r(0),c=r(5),u=r(11),h=r(25),d=r(4),p=r(6),f=r(30),g=r(31),y=r(37),v=r(20).set,m=r(40)(),_=r(21),b=r(41),T=r(42),S=r(43),E=l.TypeError,$=l.process,C=$&&$.versions,P=C&&C.v8||"",w=l.Promise,O="process"==u($),k=function(){},I=n=_.f,A=!!function(){try{var e=w.resolve(1),t=(e.constructor={})[r(1)("species")]=function(e){e(k,k)};return(O||"function"==typeof PromiseRejectionEvent)&&e.then(k)instanceof t&&0!==P.indexOf("6.6")&&-1===T.indexOf("Chrome/66")}catch(i){}}(),x=function(e){var t;return!(!d(e)||"function"!=typeof(t=e.then))&&t},R=function(e,t){if(!e._n){e._n=!0;var r=e._c;m((function(){for(var i=e._v,n=1==e._s,o=0,a=function(t){var r,o,a,s=n?t.ok:t.fail,l=t.resolve,c=t.reject,u=t.domain;try{s?(n||(2==e._h&&M(e),e._h=1),!0===s?r=i:(u&&u.enter(),r=s(i),u&&(u.exit(),a=!0)),r===t.promise?c(E("Promise-chain cycle")):(o=x(r))?o.call(r,l,c):l(r)):c(i)}catch(h){u&&!a&&u.exit(),c(h)}};r.length>o;)a(r[o++]);e._c=[],e._n=!1,t&&!e._h&&L(e)}))}},L=function(e){v.call(l,(function(){var t,r,i,n=e._v,o=D(e);if(o&&(t=b((function(){O?$.emit("unhandledRejection",n,e):(r=l.onunhandledrejection)?r({promise:e,reason:n}):(i=l.console)&&i.error&&i.error("Unhandled promise rejection",n)})),e._h=O||D(e)?2:1),e._a=void 0,o&&t.e)throw t.v}))},D=function(e){return 1!==e._h&&0===(e._a||e._c).length},M=function(e){v.call(l,(function(){var t;O?$.emit("rejectionHandled",e):(t=l.onrejectionhandled)&&t({promise:e,reason:e._v})}))},N=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),R(t,!0))},j=function e(t){var r,i=this;if(!i._d){i._d=!0,i=i._w||i;try{if(i===t)throw E("Promise can't be resolved itself");(r=x(t))?m((function(){var n={_w:i,_d:!1};try{r.call(t,c(e,n,1),c(N,n,1))}catch(o){N.call(n,o)}})):(i._v=t,i._s=1,R(i,!1))}catch(n){N.call({_w:i,_d:!1},n)}}};A||(w=function(e){f(this,w,"Promise","_h"),p(e),i.call(this);try{e(c(j,this,1),c(N,this,1))}catch(t){N.call(this,t)}},(i=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=r(44)(w.prototype,{then:function(e,t){var r=I(y(this,w));return r.ok="function"!=typeof e||e,r.fail="function"==typeof t&&t,r.domain=O?$.domain:void 0,this._c.push(r),this._a&&this._a.push(r),this._s&&R(this,!1),r.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new i;this.promise=e,this.resolve=c(j,e,1),this.reject=c(N,e,1)},_.f=I=function(e){return e===w||e===a?new o(e):n(e)}),h(h.G+h.W+h.F*!A,{Promise:w}),r(45)(w,"Promise"),r(46)("Promise"),a=r(2).Promise,h(h.S+h.F*!A,"Promise",{reject:function(e){var t=I(this);return(0,t.reject)(e),t.promise}}),h(h.S+h.F*(s||!A),"Promise",{resolve:function(e){return S(s&&this===a?w:this,e)}}),h(h.S+h.F*!(A&&r(47)((function(e){w.all(e).catch(k)}))),"Promise",{all:function(e){var t=this,r=I(t),i=r.resolve,n=r.reject,o=b((function(){var r=[],o=0,a=1;g(e,!1,(function(e){var s=o++,l=!1;r.push(void 0),a++,t.resolve(e).then((function(e){l||(l=!0,r[s]=e,--a||i(r))}),n)})),--a||i(r)}));return o.e&&n(o.v),r.promise},race:function(e){var t=this,r=I(t),i=r.reject,n=b((function(){g(e,!1,(function(e){t.resolve(e).then(r.resolve,i)}))}));return n.e&&i(n.v),r.promise}})},function(e,t,r){var i=r(0),n=r(2),o=r(14),a=r(17),s=r(5),l=function e(t,r,l){var c,u,h,d,p=t&e.F,f=t&e.G,g=t&e.P,y=t&e.B,v=f?i:t&e.S?i[r]||(i[r]={}):(i[r]||{}).prototype,m=f?n:n[r]||(n[r]={}),_=m.prototype||(m.prototype={});for(c in f&&(l=r),l)h=((u=!p&&v&&void 0!==v[c])?v:l)[c],d=y&&u?s(h,i):g&&"function"==typeof h?s(Function.call,h):h,v&&a(v,c,h,t&e.U),m[c]!=h&&o(m,c,d),g&&_[c]!=h&&(_[c]=h)};i.core=n,l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,e.exports=l},function(e,t,r){e.exports=!r(7)&&!r(15)((function(){return 7!=Object.defineProperty(r(16)("div"),"a",{get:function(){return 7}}).a}))},function(e,t,r){var i=r(4);e.exports=function(e,t){if(!i(e))return e;var r,n;if(t&&"function"==typeof(r=e.toString)&&!i(n=r.call(e)))return n;if("function"==typeof(r=e.valueOf)&&!i(n=r.call(e)))return n;if(!t&&"function"==typeof(r=e.toString)&&!i(n=r.call(e)))return n;throw TypeError("Can't convert object to primitive value")}},function(e,t,r){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,r){e.exports=r(12)("native-function-to-string",Function.toString)},function(e,t,r){e.exports=function(e,t,r,i){if(!(e instanceof t)||void 0!==i&&i in e)throw TypeError(r+": incorrect invocation!");return e}},function(e,t,r){var i=r(5),n=r(32),o=r(33),a=r(3),s=r(34),l=r(36),c={},u={},h=e.exports=function(e,t,r,h,d){var p,f,g,y,v=d?function(){return e}:l(e),m=i(r,h,t?2:1),_=0;if("function"!=typeof v)throw TypeError(e+" is not iterable!");if(o(v)){for(p=s(e.length);p>_;_++)if((y=t?m(a(f=e[_])[0],f[1]):m(e[_]))===c||y===u)return y}else for(g=v.call(e);!(f=g.next()).done;)if((y=n(g,m,f.value,t))===c||y===u)return y};h.BREAK=c,h.RETURN=u},function(e,t,r){var i=r(3);e.exports=function(e,t,r,n){try{return n?t(i(r)[0],r[1]):t(r)}catch(a){var o=e.return;throw void 0!==o&&i(o.call(e)),a}}},function(e,t,r){var i=r(19),n=r(1)("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||o[n]===e)}},function(e,t,r){var i=r(35),n=Math.min;e.exports=function(e){return e>0?n(i(e),9007199254740991):0}},function(e,t,r){var i=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:i)(e)}},function(e,t,r){var i=r(11),n=r(1)("iterator"),o=r(19);e.exports=r(2).getIteratorMethod=function(e){if(null!=e)return e[n]||e["@@iterator"]||o[i(e)]}},function(e,t,r){var i=r(3),n=r(6),o=r(1)("species");e.exports=function(e,t){var r,a=i(e).constructor;return void 0===a||null==(r=i(a)[o])?t:n(r)}},function(e,t,r){e.exports=function(e,t,r){var i=void 0===r;switch(t.length){case 0:return i?e():e.call(r);case 1:return i?e(t[0]):e.call(r,t[0]);case 2:return i?e(t[0],t[1]):e.call(r,t[0],t[1]);case 3:return i?e(t[0],t[1],t[2]):e.call(r,t[0],t[1],t[2]);case 4:return i?e(t[0],t[1],t[2],t[3]):e.call(r,t[0],t[1],t[2],t[3])}return e.apply(r,t)}},function(e,t,r){var i=r(0).document;e.exports=i&&i.documentElement},function(e,t,r){var i=r(0),n=r(20).set,o=i.MutationObserver||i.WebKitMutationObserver,a=i.process,s=i.Promise,l="process"==r(8)(a);e.exports=function(){var e,t,r,c=function(){var i,n;for(l&&(i=a.domain)&&i.exit();e;){n=e.fn,e=e.next;try{n()}catch(o){throw e?r():t=void 0,o}}t=void 0,i&&i.enter()};if(l)r=function(){a.nextTick(c)};else if(!o||i.navigator&&i.navigator.standalone)if(s&&s.resolve){var u=s.resolve(void 0);r=function(){u.then(c)}}else r=function(){n.call(i,c)};else{var h=!0,d=document.createTextNode("");new o(c).observe(d,{characterData:!0}),r=function(){d.data=h=!h}}return function(i){var n={fn:i,next:void 0};t&&(t.next=n),e||(e=n,r()),t=n}}},function(e,t,r){e.exports=function(e){try{return{e:!1,v:e()}}catch(t){return{e:!0,v:t}}}},function(e,t,r){var i=r(0).navigator;e.exports=i&&i.userAgent||""},function(e,t,r){var i=r(3),n=r(4),o=r(21);e.exports=function(e,t){if(i(e),n(t)&&t.constructor===e)return t;var r=o.f(e);return(0,r.resolve)(t),r.promise}},function(e,t,r){var i=r(17);e.exports=function(e,t,r){for(var n in t)i(e,n,t[n],r);return e}},function(e,t,r){var i=r(9).f,n=r(18),o=r(1)("toStringTag");e.exports=function(e,t,r){e&&!n(e=r?e:e.prototype,o)&&i(e,o,{configurable:!0,value:t})}},function(e,t,r){var i=r(0),n=r(9),o=r(7),a=r(1)("species");e.exports=function(e){var t=i[e];o&&t&&!t[a]&&n.f(t,a,{configurable:!0,get:function(){return this}})}},function(e,t,r){var i=r(1)("iterator"),n=!1;try{var o=[7][i]();o.return=function(){n=!0},Array.from(o,(function(){throw 2}))}catch(a){}e.exports=function(e,t){if(!t&&!n)return!1;var r=!1;try{var o=[7],a=o[i]();a.next=function(){return{done:r=!0}},o[i]=function(){return a},e(o)}catch(s){}return r}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==_typeof$4(Symbol.iterator)?function(e){return _typeof$4(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_typeof$4(e)};t.default=function(e,t,r){if(e&&t){var n=void 0;try{n=(0,o.getUri)(e,t,r)}catch(s){return Promise.reject(s.message)}return new a.default({type:"json",method:"GET",url:n}).then((function(e){return e&&e.response?"string"==typeof e.response?JSON.parse(e.response).Result:"object"===i(e.response)?e.response.Result:e.response:e}))}return Promise.reject("vid, host and token can't be empty")};var n,o=r(49),a=(n=r(51))&&n.__esModule?n:{default:n};e.exports=t.default},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.getUri=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{e=JSON.parse((0,i.decode)(e))}catch(s){throw new Error("base64 decode error: "+s.message)}var n=[];for(var o in r)n.push(o+"="+r[o]);var a=(/^http/.test(t)?t:"//"+t)+"?"+e.GetPlayInfoToken+"&ssl=true";return n.length>0&&(a+="&"+n.join("&")),a};var i=r(50)},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){var t,r,i,n,o,a,s,l=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1];for(a=e.length,o=0,s="";o<a;){do{t=l[255&e.charCodeAt(o++)]}while(o<a&&-1===t);if(-1===t)break;do{r=l[255&e.charCodeAt(o++)]}while(o<a&&-1===r);if(-1===r)break;s+=String.fromCharCode(t<<2|(48&r)>>4);do{if(61==(i=255&e.charCodeAt(o++)))return s;i=l[i]}while(o<a&&-1===i);if(-1===i)break;s+=String.fromCharCode((15&r)<<4|(60&i)>>2);do{if(61==(n=255&e.charCodeAt(o++)))return s;n=l[n]}while(o<a&&-1===n);if(-1===n)break;s+=String.fromCharCode((3&i)<<6|n)}return s}},function(e,t,r){function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.url,n=t.method,o=void 0===n?"GET":n,a=(t.type,t.data),s=void 0===a?{}:a,l=t.headers,c=void 0===l?{}:l;return i(this,e),new Promise((function(e,t){var i=new window.XMLHttpRequest,n=o.toUpperCase(),a=[];for(var l in s)a.push(l+"="+s[l]);if("GET"!==n)throw new Error("xhr "+n+" is not supported");for(var u in i.open(n,""+r,!0),i.responseType="",c)i.setRequestHeader(u,""+c[u]);i.send(),i.onload=function(){200===i.status||206===i.status?e(i):t(i)},i.onerror=function(){t(i)},i.ontimeout=function(){t(i)}}))},e.exports=t.default}]);dayjs.extend(utc);var VideoFileTypes=function(e){return e.VIDEO="video",e.EVIDEO="evideo",e}(VideoFileTypes||{}),safeJSONDecode=function(e){try{return JSON.parse(e)}catch(e2){return console.warn("[utils/json] decode fail: ".concat(e),e2),null}},parseToken=function(e){if(e){var t={},r=isBase64(e)?window.atob(e):e,i=safeJSONDecode(r);if(i&&"string"==typeof i.GetPlayInfoToken)i.GetPlayInfoToken.split("&").map((function(e){var r=e.split("=");r[0]&&r[1]&&(t[r[0]]=r[1])}));return t}},getQueryParams=function(e){var t={};return e.split("&").map((function(e){var r=e.split("=");r[0]&&r[1]&&(t[r[0]]=r[1])})),t},isEncryptPlay=function(e){var t,r;if(null==e||!e.playAuthToken)return!1;var i=parseToken(null==e?void 0:e.playAuthToken),n=null!==(t=null==i||null===(r=i.FileType)||void 0===r?void 0:r.toLowerCase())&&void 0!==t?t:"video";return!!i&&("evideo"===n||"eaudio"===n)},getFormat=function(e){var t,r,i;if(null==e||!e.playAuthToken)return"";var n=parseToken(null==e?void 0:e.playAuthToken),o=null!==(t=null==n||null===(r=n.FileType)||void 0===r?void 0:r.toLowerCase())&&void 0!==t?t:"video",a=null==n||null===(i=n.Format)||void 0===i?void 0:i.toLowerCase();return a||(Object.values(VideoFileTypes).includes(o)?"mp4":"m4a")},isTokenExpired=function(e){if(!e["X-Expires"]||!e["X-Date"])return!1;var t=parseInt(e["X-Expires"]);if(isNaN(t))return!1;var r=e["X-Date"].replace(/T/g," ").replace(/Z/g,""),i=dayjs.utc(r,"YYYYMMDD hhmmss");return!!i.isValid()&&i.add(t,"seconds").isBefore(dayjs())};function getPlayInfoByAuthToken(e){var t=e.playAuthToken,r=e.playDomain,i=e.reqParams,n=void 0===i?{}:i,o=e.definitionMap,a=e.needThumbs,s=void 0!==a&&a,l=e.needBarrageMask,c=void 0!==l&&l;if(t){var u=_objectSpread2$5(_objectSpread2$5({},n),{},{NeedThumbs:s?1:0,NeedBarrageMask:c?1:0});return new Promise((function(e,i){dist.url(t,r,u).then((function(t){var r=t.Data||t,i=r.Status,n=r.PlayInfoList,a=void 0===n?[]:n,s=r.PosterUrl,l=r.Vid,c=r.Duration,u=r.BarrageMaskUrl,h=r.ThumbInfoList,d=void 0===h?[]:h;if(i===VIDEO_STATUS_TYPE.VALID&&a.length){var p=a.map((function(e){return _objectSpread2$5(_objectSpread2$5({vid:l,lineId:1,lineName:"1",url:e.MainPlayUrl,streamType:e.Format,backUrlList:[e.BackupPlayUrl],bitrate:e.Bitrate,size:e.Size,kid:e.PlayAuthId,vwidth:e.Width,vheight:e.Height,codec:e.Codec},e),getDefinitionInfo(e,o))})).sort((function(e,t){return t.Bitrate&&e.Bitrate?t.Bitrate-e.Bitrate:-1}));e({playList:p,poster:s,vid:l,duration:c,dashOpts:t.Data?t:{Data:t},thumbs:d,barrageMaskUrl:u})}else e({playList:[],poster:s,vid:l,duration:c,dashOpts:t.Data?t:{Data:t},thumbs:d,barrageMaskUrl:u}),console.error("HAS NO VIDEO INFORMATION CORRECTLY, PLEASE CHECK THE TOKEN.")})).catch((function(e){console.log("err",e),i(e)}))}))}return Promise.resolve()}function retryByError(e,t,r,i){return _retryByError.apply(this,arguments)}function _retryByError(){return(_retryByError=_asyncToGenerator$2(_regeneratorRuntime$2().mark((function e(t,r,i,n){return _regeneratorRuntime$2().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t();case 3:case 15:return e.abrupt("return",e.sent);case 6:if(e.prev=6,e.t0=e.catch(0),!--r||!i(e.t0)){e.next=12;break}return e.abrupt("return",retryByError(t,r,i,n));case 12:if(!n||"function"!=typeof n){e.next=16;break}return e.next=15,n(e.t0);case 16:throw e.t0;case 17:case"end":return e.stop()}}),e,null,[[0,6]])})))).apply(this,arguments)}var formatDemotePriority=function(e){return(null==e?void 0:e.length)&&e.reduce((function(t,r,i){return t[r]={next:i+1>=e.length?null:e[i+1],pre:0===i?null:e[i-1]},t}),{})},getDefinitionInfo=function(e,t){if(!e||!e.Definition&&!e.Quality)return{definition:"240P"};var r=e.Definition||e.Quality;if(t){var i=t[r];return i?"string"==typeof i?{definition:i}:_objectSpread2$5({},i||{}):{definition:r}}return{definition:r}},IntervalTimer=function(){function e(){_classCallCheck$5(this,e),this.timeID=null,this.func=null}return _createClass$6(e,[{key:"repeat",value:function(e,t){this.timeID=1,this.repeatInterval(e,t)}},{key:"repeatInterval",value:function(e,t){var r=this;this.timeID&&(null===this.func&&(this.func=e),this.func===e&&(this.timeID&&clearTimeout(this.timeID),this.timeID=null,this.timeID=setTimeout((function(){e(),r.repeatInterval(e,t)}),t)))}},{key:"clear",value:function(){clearTimeout(this.timeID),this.timeID=null}}]),e}(),XHR=_createClass$6((function e(t){var r=t.url,i=t.method,n=void 0===i?"GET":i,o=t.type,a=t.timeout,s=void 0===a?1e4:a,l=t.body,c=t.xhrSetup,u=t.cache,h=void 0===u||u;return _classCallCheck$5(this,e),new Promise((function(e,t){var i=new window.XMLHttpRequest,a=n.toUpperCase();if("GET"!==a&&"POST"!==a&&"HEAD"!==a)throw new Error("XHR ".concat(a," is not allowed"));if(o&&(i.responseType=o),s&&(i.timeout=s),i.onload=function(){200===i.status||206===i.status?e(i):t(i)},i.onerror=function(){t(i)},i.ontimeout=function(){t(i)},i.onabort=function(){t(i)},"GET"===a&&!h){var u=/\?/gi.test(r)?"&":"?";r+="".concat(u,"_=").concat((new Date).getTime())}if(i.open(a,"".concat(r),!0),c)try{c(i,r)}catch(e2){console.error("xhr setup failure: ".concat(e2.stack||e2.message))}switch(a){case"POST":"text"===o&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"),i.send(l);break;case"GET":case"HEAD":i.send()}}))})),isHls=function(e){return e&&0<e.toLowerCase().indexOf(".m3u8")},isMp4=function(e){return e&&0<e.toLowerCase().indexOf(".mp4")},isFlv=function(e){return e&&0<e.toLowerCase().indexOf(".flv")},isRtm=function(e){return e&&0<e.toLowerCase().indexOf(".sdp")},isDash=function(e){return e&&0<e.toLowerCase().indexOf(".mpd")},getStreamType=function(e){return isHls(e)?"hls":isFlv(e)?"flv":isRtm(e)?"rtm":isMp4(e)?"mp4":isDash(e)?"dash":"mp4"},retPromise$1=function(e){return e&&e.then?e:new Promise((function(e){e(null)}))},addUrlParam=function(e,t){if(!t)return e;var r=Object.entries(t).map((function(e){var t=_slicedToArray(e,2),r=t[0],i=t[1];return"".concat(r,"=").concat(null!=i?i:"")})).join("&");return e+=(-1===e.indexOf("?")?"?":"&")+r},getPluginConfig=function(e,t){var r;if(t&&e)return Object.keys(e).map((function(i){i.toLowerCase()===t.toLowerCase()&&(r=e[i])})),r},handleIcons=function(e){var t={};return e&&Object.entries(e).forEach((function(e){var r=_slicedToArray(e,2),i=r[0],n=r[1];n&&"string"!=typeof n&&(t[i]=n)})),t},isHevcSupported=function(){var e=window.navigator.userAgent.toLocaleLowerCase(),t=/(iphone)/.test(e)||/(ipad)/.test(e),r=/(quark)/.test(e);return!!(t&&!r||window.MediaSource&&window.MediaSource.isTypeSupported&&(window.MediaSource.isTypeSupported('video/mp4;codecs="hev1.1.6.L120.90"')||window.MediaSource.isTypeSupported('video/mp4;codecs="hev1.2.4.L120.90"')||window.MediaSource.isTypeSupported('video/mp4;codecs="hev1.3.E.L120.90"')||window.MediaSource.isTypeSupported('video/mp4;codecs="hev1.4.10.L120.90"')))};function isBase64(e){return/^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$/.test(e)}function getLang(){var e=(document.documentElement.getAttribute("lang")||navigator.language||"zh-cn").toLocaleLowerCase();return"zh-cn"===e&&(e="zh"),e}function exeFunTimeoutWarn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=setTimeout((function(){r&&console.warn(r),i=null}),t);return e.then?e.then((function(){return clearTimeout(i)})):(clearTimeout(i),i=null),e}function isUrl(e){return!!e&&(e.indexOf&&/^(?:http|data:|\/)/.test(e))}function retry(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return new Promise((function(i,n){e().then(i).catch((function(o){setTimeout((function(){1!==t?retry(e,t-1,r).then(i,n):n(o)}),r)}))}))}function isMSESupport(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'video/mp4; codecs="avc1.42E01E,mp4a.40.2"';if(!window.MediaSource)return!1;try{return window.MediaSource.isTypeSupported(e)}catch(t){return console.error("mse error",t),!1}}var isBrowser="undefined"!=typeof window,ua=isBrowser&&navigator.userAgent.toLocaleLowerCase(),isSafari=isBrowser&&/^((?!chrome|android).)*safari/.test(ua),matchHtmlRegExp=/["'&<>]/,_PLATFORM_API;function escapeHtml(e){var t,r=""+e,i=matchHtmlRegExp.exec(r);if(!i)return r;var n,o="",a=0;for(n=i.index;n<r.length;n++){switch(r.charCodeAt(n)){case 34:t="&quot;";break;case 38:t="&amp;";break;case 39:t="&#x27;";break;case 60:t="&lt;";break;case 62:t="&gt;";break;default:continue}a!==n&&(o+=r.substring(a,n)),a=n+1,o+=t}return a!==n?o+r.substring(a,n):o}var PlatformEnum=function(e){return e.VOLC_ENGINE="volcengine",e.BYTE_PLUS="byteplus",e}(PlatformEnum||{}),PLATFORM_API=(_PLATFORM_API={},_defineProperty$6(_PLATFORM_API,"volcengine",{playDomain:"//vod.volcengineapi.com",backupPlayDomain:"//open.volcengineapi.com",licenseUrl:"https://webmedia.zijieapi.com/video/drm/v1/play_licenses",keyDomain:"https://kds.bytedance.com"}),_defineProperty$6(_PLATFORM_API,"byteplus",{playDomain:"//vod.byteplusapi.com",licenseUrl:"https://webmedia.zijieapi.com/video/drm/v1/play_licenses",keyDomain:"https://kds.bytedance.com"}),_PLATFORM_API),_excluded$1=["options","type","isLive","id","root","plugins","defaultConfig","languages","url","codec","playList","streamType","isMobile","useSoftDecoding","enableH265Degrade","checkExpireInterval","expireDetectType","onMediaExpired","onTokenExpired","platform","unionId","isMusic","useHlsPluginForSafari"],PlayerData=function(){function e(t){_classCallCheck$5(this,e),this.id="",this.type="",this.isLive=!1,this.options=null,this.isMobile=!1,this.playList=[],this.plugins=[],this.openSoftDecoding=!1,this.current={lineId:0,language:"",definition:"",streamType:"",codec:void 0};var r=t.options,i=t.type,n=t.isLive,o=t.id,a=t.root,s=t.plugins,l=void 0===s?[]:s,c=t.defaultConfig,u=t.languages;t.url;var h=t.codec;t.playList,t.streamType;var d=t.isMobile,p=void 0!==d&&d,f=t.useSoftDecoding,g=void 0!==f&&f,y=t.enableH265Degrade,v=void 0!==y&&y,m=t.checkExpireInterval,_=void 0===m?400:m,b=t.expireDetectType,T=void 0===b?[]:b,S=t.onMediaExpired,E=t.onTokenExpired,$=t.platform,C=t.unionId,P=t.isMusic,w=void 0!==P&&P,O=t.useHlsPluginForSafari,k=void 0===O||O,I=_objectWithoutProperties$1(t,_excluded$1);this.configs=t,this.options=Object.assign({},r,I),this.options.poster="string"==typeof this.options.poster?escapeHtml(this.options.poster):void 0,this.options.icons=handleIcons(this.options.icons),this.id=o,this.root=a,this.type=i,this.isLive=!!(null!=n?n:"live"===i),this.defaultConfig=c,this.languageData=this.initI18nData(u),this.isMobile=p||"mobile"===sniffer$1.device,this.openSoftDecoding=g,this.enableH265Degrade=v,this.codec=h,this.checkExpireInterval=_,this.expireDetectType=T,this.onMediaExpired=S,this.onTokenExpired=E,this.initPlayData(t),this.current=MyProxy$1.observe(this.current),this.playList=MyProxy$1.observe(this.playList),this.plugins=_toConsumableArray$1(l),this.isMusic=w,this.platform=$,this.unionId=C,this.apiMap=Object.values(PlatformEnum).includes(this.platform)?PLATFORM_API[this.platform]:PLATFORM_API[PlatformEnum.VOLC_ENGINE],this.useHlsPluginForSafari=k}return _createClass$6(e,[{key:"initPlayData",value:function(e){var t=this.initPlaylistAndGetCurrent(e);this.initCurrent(t)}},{key:"initPlaylistAndGetCurrent",value:function(e){var t,r=e.url,i=e.playList,n=e.streamType,o=void 0===n?"":n,a=null;if(i&&(this.playList=_toConsumableArray$1(i)),r)if(0===this.playList.length)this.playList=[_objectSpread2$5(_objectSpread2$5({},this.current),{},{url:r,streamType:o})];else{var s=this.getUrlList({url:r});s.length>0?a=s[0]:console.log("默认url不在Playlist中")}var l=this.getCurrentByDefaultConfig();return l&&(a=l),null!==(t=a)&&void 0!==t?t:this.playList[0]}},{key:"isCurrentH265",value:function(){return!!this.codec&&this.codec.replace(".","").toLowerCase()===CodecType.H265}},{key:"getCurrentByDefaultConfig",value:function(){if(this.defaultConfig){var e=this.defaultConfig,t=e.type,r=e.isLive,i=e.lineId,n=void 0===i?"":i,o=e.definition,a=void 0===o?"":o;if((null!=r?r:"live"===t)===this.isLive){if(!n&&!a)return console.log("默认配置未设置默认线路或默认清晰度"),void(this.isHitDefault=!1);var s=this.getUrlList({lineId:n,definition:a});return s.length>0?(this.isHitDefault=!0,s[0]):(console.log("playlist中没有满足默认配置的流"),void(this.isHitDefault=!1))}}}},{key:"initCurrent",value:function(e){var t=this;Object.keys(this.current).forEach((function(r){t.current[r]=null==e?void 0:e[r]}));var r=(null==e?void 0:e.codec)||(null==e?void 0:e.Codec);r&&1===this.playList.length&&(this.codec=r)}},{key:"initI18nData",value:function(e){var t=[jp$1,zhHk],r=e&&Object.entries(e).reduce((function(e,r){var i=_slicedToArray(r,2),n=i[0],o=i[1];return PLAYER_LANGS.includes(n)?e.push({LANG:"zh"===n?"zh-cn":n,TEXT:o}):t.push({LANG:n,TEXT:o}),e}),[]);return{extraLangList:t,extendLangList:r}}},{key:"getCurrentUrl",value:function(){var e;return null===(e=this.getCurrentStreams()[0])||void 0===e?void 0:e.url}},{key:"getCurrentStreamType",value:function(){var e=this.getCurrentStreams();if(e.length){var t=e[0],r=t.url;return t.streamType||getStreamType(r)}return this.configs.streamType}},{key:"getCurrentStreams",value:function(){var e=this.current;return this.getUrlList(e)}},{key:"getLineList",value:function(){return cloneDeep(uniqBy(this.playList,"lineId"))}},{key:"getLineListByLineId",value:function(e){return this.playList.filter((function(t){var r;return(null==e?void 0:e.toString())===(null===(r=t.lineId)||void 0===r?void 0:r.toString())}))}},{key:"getDefinitionListByLineId",value:function(e){return cloneDeep(uniqBy(this.getLineListByLineId(e),"definition"))}},{key:"getUrlList",value:function(e){return this.playList.filter((function(t){return Object.keys(e).every((function(r){var i,n,o=(null===(i=e[r])||void 0===i?void 0:i.toString())===(null===(n=t[r])||void 0===n?void 0:n.toString()),a=!e[r];return o||a}))}))}},{key:"getNextDefinition",value:function(){var e,t,r=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],i=arguments.length>1?arguments[1]:void 0,n=r?"next":"prev",o=this.current,a=o.definition,s=o.lineId;if(a){var l=null===(e=this.getCurrentStreams())||void 0===e?void 0:e[0],c="auto"===a?l.mapDefinition:a,u=formatDemotePriority(i)||DefinitionLinked,h=Object.keys(u);if(h.includes(c)){for(var d=null===(t=u[c])||void 0===t?void 0:t[n],p=this.getDefinitionListByLineId(s);0===p.filter((function(e){return e.definition===d})).length&&d;){var f;d=null===(f=u[d])||void 0===f?void 0:f[n]}if(d)return"auto"===a&&d&&(l.mapDefinition=d),this.getUrlList({lineId:s,definition:d});console.log("已经降至最低级")}}}}]),e}(),index_b={exports:{}},es_array_concat={},check=function(e){return e&&e.Math==Math&&e},global$H=check("object"==("undefined"==typeof globalThis?"undefined":_typeof$4(globalThis))&&globalThis)||check("object"==("undefined"==typeof window?"undefined":_typeof$4(window))&&window)||check("object"==("undefined"==typeof self?"undefined":_typeof$4(self))&&self)||check("object"==_typeof$4(commonjsGlobal)&&commonjsGlobal)||function(){return this}()||Function("return this")(),objectGetOwnPropertyDescriptor={},fails$K=function(e){try{return!!e()}catch(t){return!0}},fails$J=fails$K,descriptors=!fails$J((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),fails$I=fails$K,functionBindNative=!fails$I((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),NATIVE_BIND$4=functionBindNative,call$t=Function.prototype.call,functionCall=NATIVE_BIND$4?call$t.bind(call$t):function(){return call$t.apply(call$t,arguments)},objectPropertyIsEnumerable={},$propertyIsEnumerable$2={}.propertyIsEnumerable,getOwnPropertyDescriptor$5=Object.getOwnPropertyDescriptor,NASHORN_BUG=getOwnPropertyDescriptor$5&&!$propertyIsEnumerable$2.call({1:2},1);objectPropertyIsEnumerable.f=NASHORN_BUG?function(e){var t=getOwnPropertyDescriptor$5(this,e);return!!t&&t.enumerable}:$propertyIsEnumerable$2;var createPropertyDescriptor$7=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},NATIVE_BIND$3=functionBindNative,FunctionPrototype$3=Function.prototype,call$s=FunctionPrototype$3.call,uncurryThisWithBind=NATIVE_BIND$3&&FunctionPrototype$3.bind.bind(call$s,call$s),functionUncurryThisRaw=NATIVE_BIND$3?uncurryThisWithBind:function(e){return function(){return call$s.apply(e,arguments)}},uncurryThisRaw$1=functionUncurryThisRaw,toString$h=uncurryThisRaw$1({}.toString),stringSlice$a=uncurryThisRaw$1("".slice),classofRaw$2=function(e){return stringSlice$a(toString$h(e),8,-1)},classofRaw$1=classofRaw$2,uncurryThisRaw=functionUncurryThisRaw,functionUncurryThis=function(e){if("Function"===classofRaw$1(e))return uncurryThisRaw(e)},uncurryThis$H=functionUncurryThis,fails$H=fails$K,classof$f=classofRaw$2,$Object$4=Object,split$3=uncurryThis$H("".split),indexedObject=fails$H((function(){return!$Object$4("z").propertyIsEnumerable(0)}))?function(e){return"String"==classof$f(e)?split$3(e,""):$Object$4(e)}:$Object$4,isNullOrUndefined$7=function(e){return null==e},isNullOrUndefined$6=isNullOrUndefined$7,$TypeError$i=TypeError,requireObjectCoercible$9=function(e){if(isNullOrUndefined$6(e))throw $TypeError$i("Can't call method on "+e);return e},IndexedObject$5=indexedObject,requireObjectCoercible$8=requireObjectCoercible$9,toIndexedObject$c=function(e){return IndexedObject$5(requireObjectCoercible$8(e))},documentAll$2="object"==("undefined"==typeof document?"undefined":_typeof$4(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$t=$documentAll$1.IS_HTMLDDA?function(e){return"function"==typeof e||e===documentAll$1}:function(e){return"function"==typeof e},isCallable$s=isCallable$t,$documentAll=documentAll_1,documentAll=$documentAll.all,isObject$l=$documentAll.IS_HTMLDDA?function(e){return"object"==_typeof$4(e)?null!==e:isCallable$s(e)||e===documentAll}:function(e){return"object"==_typeof$4(e)?null!==e:isCallable$s(e)},global$G=global$H,isCallable$r=isCallable$t,aFunction=function(e){return isCallable$r(e)?e:void 0},getBuiltIn$d=function(e,t){return arguments.length<2?aFunction(global$G[e]):global$G[e]&&global$G[e][t]},uncurryThis$G=functionUncurryThis,objectIsPrototypeOf=uncurryThis$G({}.isPrototypeOf),getBuiltIn$c=getBuiltIn$d,engineUserAgent=getBuiltIn$c("navigator","userAgent")||"",global$F=global$H,userAgent$6=engineUserAgent,process$3=global$F.process,Deno$1=global$F.Deno,versions=process$3&&process$3.versions||Deno$1&&Deno$1.version,v8=versions&&versions.v8,match,version$1;v8&&(match=v8.split("."),version$1=match[0]>0&&match[0]<4?1:+(match[0]+match[1])),!version$1&&userAgent$6&&(match=userAgent$6.match(/Edge\/(\d+)/),(!match||match[1]>=74)&&(match=userAgent$6.match(/Chrome\/(\d+)/),match&&(version$1=+match[1])));var engineV8Version=version$1,V8_VERSION$3=engineV8Version,fails$G=fails$K,symbolConstructorDetection=!!Object.getOwnPropertySymbols&&!fails$G((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&V8_VERSION$3&&V8_VERSION$3<41})),NATIVE_SYMBOL$6=symbolConstructorDetection,useSymbolAsUid=NATIVE_SYMBOL$6&&!Symbol.sham&&"symbol"==_typeof$4(Symbol.iterator),getBuiltIn$b=getBuiltIn$d,isCallable$q=isCallable$t,isPrototypeOf$9=objectIsPrototypeOf,USE_SYMBOL_AS_UID$1=useSymbolAsUid,$Object$3=Object,isSymbol$6=USE_SYMBOL_AS_UID$1?function(e){return"symbol"==_typeof$4(e)}:function(e){var t=getBuiltIn$b("Symbol");return isCallable$q(t)&&isPrototypeOf$9(t.prototype,$Object$3(e))},$String$4=String,tryToString$7=function(e){try{return $String$4(e)}catch(t){return"Object"}},isCallable$p=isCallable$t,tryToString$6=tryToString$7,$TypeError$h=TypeError,aCallable$a=function(e){if(isCallable$p(e))return e;throw $TypeError$h(tryToString$6(e)+" is not a function")},aCallable$9=aCallable$a,isNullOrUndefined$5=isNullOrUndefined$7,getMethod$6=function(e,t){var r=e[t];return isNullOrUndefined$5(r)?void 0:aCallable$9(r)},call$r=functionCall,isCallable$o=isCallable$t,isObject$k=isObject$l,$TypeError$g=TypeError,ordinaryToPrimitive$1=function(e,t){var r,i;if("string"===t&&isCallable$o(r=e.toString)&&!isObject$k(i=call$r(r,e)))return i;if(isCallable$o(r=e.valueOf)&&!isObject$k(i=call$r(r,e)))return i;if("string"!==t&&isCallable$o(r=e.toString)&&!isObject$k(i=call$r(r,e)))return i;throw $TypeError$g("Can't convert object to primitive value")},shared$7={exports:{}},isPure=!1,global$E=global$H,defineProperty$d=Object.defineProperty,defineGlobalProperty$3=function(e,t){try{defineProperty$d(global$E,e,{value:t,configurable:!0,writable:!0})}catch(r){global$E[e]=t}return t},global$D=global$H,defineGlobalProperty$2=defineGlobalProperty$3,SHARED="__core-js_shared__",store$3=global$D[SHARED]||defineGlobalProperty$2(SHARED,{}),sharedStore=store$3,store$2=sharedStore;(shared$7.exports=function(e,t){return store$2[e]||(store$2[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.26.0",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.26.0/LICENSE",source:"https://github.com/zloirock/core-js"});var requireObjectCoercible$7=requireObjectCoercible$9,$Object$2=Object,toObject$g=function(e){return $Object$2(requireObjectCoercible$7(e))},uncurryThis$F=functionUncurryThis,toObject$f=toObject$g,hasOwnProperty$1=uncurryThis$F({}.hasOwnProperty),hasOwnProperty_1=Object.hasOwn||function(e,t){return hasOwnProperty$1(toObject$f(e),t)},uncurryThis$E=functionUncurryThis,id=0,postfix=Math.random(),toString$g=uncurryThis$E(1..toString),uid$4=function(e){return"Symbol("+(void 0===e?"":e)+")_"+toString$g(++id+postfix,36)},global$C=global$H,shared$6=shared$7.exports,hasOwn$m=hasOwnProperty_1,uid$3=uid$4,NATIVE_SYMBOL$5=symbolConstructorDetection,USE_SYMBOL_AS_UID=useSymbolAsUid,WellKnownSymbolsStore$1=shared$6("wks"),_Symbol$1=global$C.Symbol,symbolFor=_Symbol$1&&_Symbol$1.for,createWellKnownSymbol=USE_SYMBOL_AS_UID?_Symbol$1:_Symbol$1&&_Symbol$1.withoutSetter||uid$3,wellKnownSymbol$t=function(e){if(!hasOwn$m(WellKnownSymbolsStore$1,e)||!NATIVE_SYMBOL$5&&"string"!=typeof WellKnownSymbolsStore$1[e]){var t="Symbol."+e;NATIVE_SYMBOL$5&&hasOwn$m(_Symbol$1,e)?WellKnownSymbolsStore$1[e]=_Symbol$1[e]:WellKnownSymbolsStore$1[e]=USE_SYMBOL_AS_UID&&symbolFor?symbolFor(t):createWellKnownSymbol(t)}return WellKnownSymbolsStore$1[e]},call$q=functionCall,isObject$j=isObject$l,isSymbol$5=isSymbol$6,getMethod$5=getMethod$6,ordinaryToPrimitive=ordinaryToPrimitive$1,wellKnownSymbol$s=wellKnownSymbol$t,$TypeError$f=TypeError,TO_PRIMITIVE=wellKnownSymbol$s("toPrimitive"),toPrimitive$3=function(e,t){if(!isObject$j(e)||isSymbol$5(e))return e;var r,i=getMethod$5(e,TO_PRIMITIVE);if(i){if(void 0===t&&(t="default"),r=call$q(i,e,t),!isObject$j(r)||isSymbol$5(r))return r;throw $TypeError$f("Can't convert object to primitive value")}return void 0===t&&(t="number"),ordinaryToPrimitive(e,t)},toPrimitive$2=toPrimitive$3,isSymbol$4=isSymbol$6,toPropertyKey$5=function(e){var t=toPrimitive$2(e,"string");return isSymbol$4(t)?t:t+""},global$B=global$H,isObject$i=isObject$l,document$3=global$B.document,EXISTS$1=isObject$i(document$3)&&isObject$i(document$3.createElement),documentCreateElement$2=function(e){return EXISTS$1?document$3.createElement(e):{}},DESCRIPTORS$m=descriptors,fails$F=fails$K,createElement$1=documentCreateElement$2,ie8DomDefine=!DESCRIPTORS$m&&!fails$F((function(){return 7!=Object.defineProperty(createElement$1("div"),"a",{get:function(){return 7}}).a})),DESCRIPTORS$l=descriptors,call$p=functionCall,propertyIsEnumerableModule$2=objectPropertyIsEnumerable,createPropertyDescriptor$6=createPropertyDescriptor$7,toIndexedObject$b=toIndexedObject$c,toPropertyKey$4=toPropertyKey$5,hasOwn$l=hasOwnProperty_1,IE8_DOM_DEFINE$1=ie8DomDefine,$getOwnPropertyDescriptor$2=Object.getOwnPropertyDescriptor;objectGetOwnPropertyDescriptor.f=DESCRIPTORS$l?$getOwnPropertyDescriptor$2:function(e,t){if(e=toIndexedObject$b(e),t=toPropertyKey$4(t),IE8_DOM_DEFINE$1)try{return $getOwnPropertyDescriptor$2(e,t)}catch(r){}if(hasOwn$l(e,t))return createPropertyDescriptor$6(!call$p(propertyIsEnumerableModule$2.f,e,t),e[t])};var objectDefineProperty={},DESCRIPTORS$k=descriptors,fails$E=fails$K,v8PrototypeDefineBug=DESCRIPTORS$k&&fails$E((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),isObject$h=isObject$l,$String$3=String,$TypeError$e=TypeError,anObject$k=function(e){if(isObject$h(e))return e;throw $TypeError$e($String$3(e)+" is not an object")},DESCRIPTORS$j=descriptors,IE8_DOM_DEFINE=ie8DomDefine,V8_PROTOTYPE_DEFINE_BUG$1=v8PrototypeDefineBug,anObject$j=anObject$k,toPropertyKey$3=toPropertyKey$5,$TypeError$d=TypeError,$defineProperty$1=Object.defineProperty,$getOwnPropertyDescriptor$1=Object.getOwnPropertyDescriptor,ENUMERABLE="enumerable",CONFIGURABLE$1="configurable",WRITABLE="writable";objectDefineProperty.f=DESCRIPTORS$j?V8_PROTOTYPE_DEFINE_BUG$1?function(e,t,r){if(anObject$j(e),t=toPropertyKey$3(t),anObject$j(r),"function"==typeof e&&"prototype"===t&&"value"in r&&WRITABLE in r&&!r[WRITABLE]){var i=$getOwnPropertyDescriptor$1(e,t);i&&i[WRITABLE]&&(e[t]=r.value,r={configurable:CONFIGURABLE$1 in r?r[CONFIGURABLE$1]:i[CONFIGURABLE$1],enumerable:ENUMERABLE in r?r[ENUMERABLE]:i[ENUMERABLE],writable:!1})}return $defineProperty$1(e,t,r)}:$defineProperty$1:function(e,t,r){if(anObject$j(e),t=toPropertyKey$3(t),anObject$j(r),IE8_DOM_DEFINE)try{return $defineProperty$1(e,t,r)}catch(i){}if("get"in r||"set"in r)throw $TypeError$d("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var DESCRIPTORS$i=descriptors,definePropertyModule$7=objectDefineProperty,createPropertyDescriptor$5=createPropertyDescriptor$7,createNonEnumerableProperty$a=DESCRIPTORS$i?function(e,t,r){return definePropertyModule$7.f(e,t,createPropertyDescriptor$5(1,r))}:function(e,t,r){return e[t]=r,e},makeBuiltIn$3={exports:{}},DESCRIPTORS$h=descriptors,hasOwn$k=hasOwnProperty_1,FunctionPrototype$2=Function.prototype,getDescriptor=DESCRIPTORS$h&&Object.getOwnPropertyDescriptor,EXISTS=hasOwn$k(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$D=functionUncurryThis,isCallable$n=isCallable$t,store$1=sharedStore,functionToString$1=uncurryThis$D(Function.toString);isCallable$n(store$1.inspectSource)||(store$1.inspectSource=function(e){return functionToString$1(e)});var inspectSource$3=store$1.inspectSource,global$A=global$H,isCallable$m=isCallable$t,WeakMap$1=global$A.WeakMap,weakMapBasicDetection=isCallable$m(WeakMap$1)&&/native code/.test(String(WeakMap$1)),shared$5=shared$7.exports,uid$2=uid$4,keys$3=shared$5("keys"),sharedKey$4=function(e){return keys$3[e]||(keys$3[e]=uid$2(e))},hiddenKeys$5={},NATIVE_WEAK_MAP=weakMapBasicDetection,global$z=global$H,isObject$g=isObject$l,createNonEnumerableProperty$9=createNonEnumerableProperty$a,hasOwn$j=hasOwnProperty_1,shared$4=sharedStore,sharedKey$3=sharedKey$4,hiddenKeys$4=hiddenKeys$5,OBJECT_ALREADY_INITIALIZED="Object already initialized",TypeError$7=global$z.TypeError,WeakMap=global$z.WeakMap,set$2,get$1,has,enforce=function(e){return has(e)?get$1(e):set$2(e,{})},getterFor=function(e){return function(t){var r;if(!isObject$g(t)||(r=get$1(t)).type!==e)throw TypeError$7("Incompatible receiver, "+e+" required");return r}};if(NATIVE_WEAK_MAP||shared$4.state){var store=shared$4.state||(shared$4.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$7(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$3("state");hiddenKeys$4[STATE]=!0,set$2=function(e,t){if(hasOwn$j(e,STATE))throw TypeError$7(OBJECT_ALREADY_INITIALIZED);return t.facade=e,createNonEnumerableProperty$9(e,STATE,t),t},get$1=function(e){return hasOwn$j(e,STATE)?e[STATE]:{}},has=function(e){return hasOwn$j(e,STATE)}}var internalState={set:set$2,get:get$1,has:has,enforce:enforce,getterFor:getterFor},fails$D=fails$K,isCallable$l=isCallable$t,hasOwn$i=hasOwnProperty_1,DESCRIPTORS$g=descriptors,CONFIGURABLE_FUNCTION_NAME$2=functionName.CONFIGURABLE,inspectSource$2=inspectSource$3,InternalStateModule$9=internalState,enforceInternalState$3=InternalStateModule$9.enforce,getInternalState$7=InternalStateModule$9.get,defineProperty$c=Object.defineProperty,CONFIGURABLE_LENGTH=DESCRIPTORS$g&&!fails$D((function(){return 8!==defineProperty$c((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$i(e,"name")||CONFIGURABLE_FUNCTION_NAME$2&&e.name!==t)&&(DESCRIPTORS$g?defineProperty$c(e,"name",{value:t,configurable:!0}):e.name=t),CONFIGURABLE_LENGTH&&r&&hasOwn$i(r,"arity")&&e.length!==r.arity&&defineProperty$c(e,"length",{value:r.arity});try{r&&hasOwn$i(r,"constructor")&&r.constructor?DESCRIPTORS$g&&defineProperty$c(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(n){}var i=enforceInternalState$3(e);return hasOwn$i(i,"source")||(i.source=TEMPLATE.join("string"==typeof t?t:"")),e};Function.prototype.toString=makeBuiltIn$2((function(){return isCallable$l(this)&&getInternalState$7(this).source||inspectSource$2(this)}),"toString");var isCallable$k=isCallable$t,definePropertyModule$6=objectDefineProperty,makeBuiltIn$1=makeBuiltIn$3.exports,defineGlobalProperty$1=defineGlobalProperty$3,defineBuiltIn$i=function(e,t,r,i){i||(i={});var n=i.enumerable,o=void 0!==i.name?i.name:t;if(isCallable$k(r)&&makeBuiltIn$1(r,o,i),i.global)n?e[t]=r:defineGlobalProperty$1(t,r);else{try{i.unsafe?e[t]&&(n=!0):delete e[t]}catch(a){}n?e[t]=r:definePropertyModule$6.f(e,t,{value:r,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return e},objectGetOwnPropertyNames={},ceil=Math.ceil,floor$8=Math.floor,mathTrunc=Math.trunc||function(e){var t=+e;return(t>0?floor$8:ceil)(t)},trunc=mathTrunc,toIntegerOrInfinity$d=function(e){var t=+e;return t!=t||0===t?0:trunc(t)},toIntegerOrInfinity$c=toIntegerOrInfinity$d,max$4=Math.max,min$6=Math.min,toAbsoluteIndex$7=function(e,t){var r=toIntegerOrInfinity$c(e);return r<0?max$4(r+t,0):min$6(r,t)},toIntegerOrInfinity$b=toIntegerOrInfinity$d,min$5=Math.min,toLength$8=function(e){return e>0?min$5(toIntegerOrInfinity$b(e),9007199254740991):0},toLength$7=toLength$8,lengthOfArrayLike$h=function(e){return toLength$7(e.length)},toIndexedObject$a=toIndexedObject$c,toAbsoluteIndex$6=toAbsoluteIndex$7,lengthOfArrayLike$g=lengthOfArrayLike$h,createMethod$6=function(e){return function(t,r,i){var n,o=toIndexedObject$a(t),a=lengthOfArrayLike$g(o),s=toAbsoluteIndex$6(i,a);if(e&&r!=r){for(;a>s;)if((n=o[s++])!=n)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$6(!0),indexOf:createMethod$6(!1)},uncurryThis$C=functionUncurryThis,hasOwn$h=hasOwnProperty_1,toIndexedObject$9=toIndexedObject$c,indexOf$1=arrayIncludes.indexOf,hiddenKeys$3=hiddenKeys$5,push$9=uncurryThis$C([].push),objectKeysInternal=function(e,t){var r,i=toIndexedObject$9(e),n=0,o=[];for(r in i)!hasOwn$h(hiddenKeys$3,r)&&hasOwn$h(i,r)&&push$9(o,r);for(;t.length>n;)hasOwn$h(i,r=t[n++])&&(~indexOf$1(o,r)||push$9(o,r));return o},enumBugKeys$3=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],internalObjectKeys$1=objectKeysInternal,enumBugKeys$2=enumBugKeys$3,hiddenKeys$2=enumBugKeys$2.concat("length","prototype");objectGetOwnPropertyNames.f=Object.getOwnPropertyNames||function(e){return internalObjectKeys$1(e,hiddenKeys$2)};var objectGetOwnPropertySymbols={};objectGetOwnPropertySymbols.f=Object.getOwnPropertySymbols;var getBuiltIn$a=getBuiltIn$d,uncurryThis$B=functionUncurryThis,getOwnPropertyNamesModule$1=objectGetOwnPropertyNames,getOwnPropertySymbolsModule$3=objectGetOwnPropertySymbols,anObject$i=anObject$k,concat$3=uncurryThis$B([].concat),ownKeys$4=getBuiltIn$a("Reflect","ownKeys")||function(e){var t=getOwnPropertyNamesModule$1.f(anObject$i(e)),r=getOwnPropertySymbolsModule$3.f;return r?concat$3(t,r(e)):t},hasOwn$g=hasOwnProperty_1,ownKeys$3=ownKeys$4,getOwnPropertyDescriptorModule$2=objectGetOwnPropertyDescriptor,definePropertyModule$5=objectDefineProperty,copyConstructorProperties$2=function(e,t,r){for(var i=ownKeys$3(t),n=definePropertyModule$5.f,o=getOwnPropertyDescriptorModule$2.f,a=0;a<i.length;a++){var s=i[a];hasOwn$g(e,s)||r&&hasOwn$g(r,s)||n(e,s,o(t,s))}},fails$C=fails$K,isCallable$j=isCallable$t,replacement=/#|\.prototype\./,isForced$4=function(e,t){var r=data[normalize(e)];return r==POLYFILL||r!=NATIVE&&(isCallable$j(t)?fails$C(t):!!t)},normalize=isForced$4.normalize=function(e){return String(e).replace(replacement,".").toLowerCase()},data=isForced$4.data={},NATIVE=isForced$4.NATIVE="N",POLYFILL=isForced$4.POLYFILL="P",isForced_1=isForced$4,global$y=global$H,getOwnPropertyDescriptor$4=objectGetOwnPropertyDescriptor.f,createNonEnumerableProperty$8=createNonEnumerableProperty$a,defineBuiltIn$h=defineBuiltIn$i,defineGlobalProperty=defineGlobalProperty$3,copyConstructorProperties$1=copyConstructorProperties$2,isForced$3=isForced_1,_export=function(e,t){var r,i,n,o,a,s=e.target,l=e.global,c=e.stat;if(r=l?global$y:c?global$y[s]||defineGlobalProperty(s,{}):(global$y[s]||{}).prototype)for(i in t){if(o=t[i],n=e.dontCallGetSet?(a=getOwnPropertyDescriptor$4(r,i))&&a.value:r[i],!isForced$3(l?i:s+(c?".":"#")+i,e.forced)&&void 0!==n){if(_typeof$4(o)==_typeof$4(n))continue;copyConstructorProperties$1(o,n)}(e.sham||n&&n.sham)&&createNonEnumerableProperty$8(o,"sham",!0),defineBuiltIn$h(r,i,o,e)}},classof$e=classofRaw$2,isArray$5=Array.isArray||function(e){return"Array"==classof$e(e)},$TypeError$c=TypeError,MAX_SAFE_INTEGER=9007199254740991,doesNotExceedSafeInteger$2=function(e){if(e>MAX_SAFE_INTEGER)throw $TypeError$c("Maximum allowed index exceeded");return e},toPropertyKey$2=toPropertyKey$5,definePropertyModule$4=objectDefineProperty,createPropertyDescriptor$4=createPropertyDescriptor$7,createProperty$5=function(e,t,r){var i=toPropertyKey$2(t);i in e?definePropertyModule$4.f(e,i,createPropertyDescriptor$4(0,r)):e[i]=r},wellKnownSymbol$r=wellKnownSymbol$t,TO_STRING_TAG$4=wellKnownSymbol$r("toStringTag"),test={};test[TO_STRING_TAG$4]="z";var toStringTagSupport="[object z]"===String(test),TO_STRING_TAG_SUPPORT$2=toStringTagSupport,isCallable$i=isCallable$t,classofRaw=classofRaw$2,wellKnownSymbol$q=wellKnownSymbol$t,TO_STRING_TAG$3=wellKnownSymbol$q("toStringTag"),$Object$1=Object,CORRECT_ARGUMENTS="Arguments"==classofRaw(function(){return arguments}()),tryGet=function(e,t){try{return e[t]}catch(r){}},classof$d=TO_STRING_TAG_SUPPORT$2?classofRaw:function(e){var t,r,i;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=tryGet(t=$Object$1(e),TO_STRING_TAG$3))?r:CORRECT_ARGUMENTS?classofRaw(t):"Object"==(i=classofRaw(t))&&isCallable$i(t.callee)?"Arguments":i},uncurryThis$A=functionUncurryThis,fails$B=fails$K,isCallable$h=isCallable$t,classof$c=classof$d,getBuiltIn$9=getBuiltIn$d,inspectSource$1=inspectSource$3,noop=function(){},empty=[],construct$1=getBuiltIn$9("Reflect","construct"),constructorRegExp=/^\s*(?:class|function)\b/,exec$6=uncurryThis$A(constructorRegExp.exec),INCORRECT_TO_STRING=!constructorRegExp.exec(noop),isConstructorModern=function(e){if(!isCallable$h(e))return!1;try{return construct$1(noop,empty,e),!0}catch(t){return!1}},isConstructorLegacy=function(e){if(!isCallable$h(e))return!1;switch(classof$c(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return INCORRECT_TO_STRING||!!exec$6(constructorRegExp,inspectSource$1(e))}catch(t){return!0}};isConstructorLegacy.sham=!0;var isConstructor$4=!construct$1||fails$B((function(){var e;return isConstructorModern(isConstructorModern.call)||!isConstructorModern(Object)||!isConstructorModern((function(){e=!0}))||e}))?isConstructorLegacy:isConstructorModern,isArray$4=isArray$5,isConstructor$3=isConstructor$4,isObject$f=isObject$l,wellKnownSymbol$p=wellKnownSymbol$t,SPECIES$6=wellKnownSymbol$p("species"),$Array$4=Array,arraySpeciesConstructor$1=function(e){var t;return isArray$4(e)&&(t=e.constructor,(isConstructor$3(t)&&(t===$Array$4||isArray$4(t.prototype))||isObject$f(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)},fails$A=fails$K,wellKnownSymbol$o=wellKnownSymbol$t,V8_VERSION$2=engineV8Version,SPECIES$5=wellKnownSymbol$o("species"),arrayMethodHasSpeciesSupport$5=function(e){return V8_VERSION$2>=51||!fails$A((function(){var t=[];return(t.constructor={})[SPECIES$5]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},$$B=_export,fails$z=fails$K,isArray$3=isArray$5,isObject$e=isObject$l,toObject$e=toObject$g,lengthOfArrayLike$f=lengthOfArrayLike$h,doesNotExceedSafeInteger$1=doesNotExceedSafeInteger$2,createProperty$4=createProperty$5,arraySpeciesCreate$2=arraySpeciesCreate$3,arrayMethodHasSpeciesSupport$4=arrayMethodHasSpeciesSupport$5,wellKnownSymbol$n=wellKnownSymbol$t,V8_VERSION$1=engineV8Version,IS_CONCAT_SPREADABLE=wellKnownSymbol$n("isConcatSpreadable"),IS_CONCAT_SPREADABLE_SUPPORT=V8_VERSION$1>=51||!fails$z((function(){var e=[];return e[IS_CONCAT_SPREADABLE]=!1,e.concat()[0]!==e})),SPECIES_SUPPORT=arrayMethodHasSpeciesSupport$4("concat"),isConcatSpreadable=function(e){if(!isObject$e(e))return!1;var t=e[IS_CONCAT_SPREADABLE];return void 0!==t?!!t:isArray$3(e)},FORCED$7=!IS_CONCAT_SPREADABLE_SUPPORT||!SPECIES_SUPPORT;$$B({target:"Array",proto:!0,arity:1,forced:FORCED$7},{concat:function(e){var t,r,i,n,o,a=toObject$e(this),s=arraySpeciesCreate$2(a,0),l=0;for(t=-1,i=arguments.length;t<i;t++)if(isConcatSpreadable(o=-1===t?a:arguments[t]))for(n=lengthOfArrayLike$f(o),doesNotExceedSafeInteger$1(l+n),r=0;r<n;r++,l++)r in o&&createProperty$4(s,l,o[r]);else doesNotExceedSafeInteger$1(l+1),createProperty$4(s,l++,o);return s.length=l,s}});var es_array_map={},uncurryThis$z=functionUncurryThis,aCallable$8=aCallable$a,NATIVE_BIND$2=functionBindNative,bind$c=uncurryThis$z(uncurryThis$z.bind),functionBindContext=function(e,t){return aCallable$8(e),void 0===t?e:NATIVE_BIND$2?bind$c(e,t):function(){return e.apply(t,arguments)}},bind$b=functionBindContext,uncurryThis$y=functionUncurryThis,IndexedObject$4=indexedObject,toObject$d=toObject$g,lengthOfArrayLike$e=lengthOfArrayLike$h,arraySpeciesCreate$1=arraySpeciesCreate$3,push$8=uncurryThis$y([].push),createMethod$5=function(e){var t=1==e,r=2==e,i=3==e,n=4==e,o=6==e,a=7==e,s=5==e||o;return function(l,c,u,h){for(var d,p,f=toObject$d(l),g=IndexedObject$4(f),y=bind$b(c,u),v=lengthOfArrayLike$e(g),m=0,_=h||arraySpeciesCreate$1,b=t?_(l,v):r||a?_(l,0):void 0;v>m;m++)if((s||m in g)&&(p=y(d=g[m],m,f),e))if(t)b[m]=p;else if(p)switch(e){case 3:return!0;case 5:return d;case 6:return m;case 2:push$8(b,d)}else switch(e){case 4:return!1;case 7:push$8(b,d)}return o?-1:i||n?n:b}},arrayIteration={forEach:createMethod$5(0),map:createMethod$5(1),filter:createMethod$5(2),some:createMethod$5(3),every:createMethod$5(4),find:createMethod$5(5),findIndex:createMethod$5(6),filterReject:createMethod$5(7)},$$A=_export,$map$1=arrayIteration.map,arrayMethodHasSpeciesSupport$3=arrayMethodHasSpeciesSupport$5,HAS_SPECIES_SUPPORT$3=arrayMethodHasSpeciesSupport$3("map");$$A({target:"Array",proto:!0,forced:!HAS_SPECIES_SUPPORT$3},{map:function(e){return $map$1(this,e,arguments.length>1?arguments[1]:void 0)}});var es_object_keys={},internalObjectKeys=objectKeysInternal,enumBugKeys$1=enumBugKeys$3,objectKeys$4=Object.keys||function(e){return internalObjectKeys(e,enumBugKeys$1)},$$z=_export,toObject$c=toObject$g,nativeKeys=objectKeys$4,fails$y=fails$K,FAILS_ON_PRIMITIVES$1=fails$y((function(){nativeKeys(1)}));$$z({target:"Object",stat:!0,forced:FAILS_ON_PRIMITIVES$1},{keys:function(e){return nativeKeys(toObject$c(e))}});var esnext_string_at={},classof$b=classof$d,$String$2=String,toString$f=function(e){if("Symbol"===classof$b(e))throw TypeError("Cannot convert a Symbol value to a string");return $String$2(e)},uncurryThis$x=functionUncurryThis,toIntegerOrInfinity$a=toIntegerOrInfinity$d,toString$e=toString$f,requireObjectCoercible$6=requireObjectCoercible$9,charAt$a=uncurryThis$x("".charAt),charCodeAt$3=uncurryThis$x("".charCodeAt),stringSlice$9=uncurryThis$x("".slice),createMethod$4=function(e){return function(t,r){var i,n,o=toString$e(requireObjectCoercible$6(t)),a=toIntegerOrInfinity$a(r),s=o.length;return a<0||a>=s?e?"":void 0:(i=charCodeAt$3(o,a))<55296||i>56319||a+1===s||(n=charCodeAt$3(o,a+1))<56320||n>57343?e?charAt$a(o,a):i:e?stringSlice$9(o,a,a+2):n-56320+(i-55296<<10)+65536}},stringMultibyte={codeAt:createMethod$4(!1),charAt:createMethod$4(!0)},$$y=_export,charAt$9=stringMultibyte.charAt,requireObjectCoercible$5=requireObjectCoercible$9,toIntegerOrInfinity$9=toIntegerOrInfinity$d,toString$d=toString$f;$$y({target:"String",proto:!0,forced:!0},{at:function(e){var t=toString$d(requireObjectCoercible$5(this)),r=t.length,i=toIntegerOrInfinity$9(e),n=i>=0?i:r+i;return n<0||n>=r?void 0:charAt$9(t,n)}});var es_object_toString={},TO_STRING_TAG_SUPPORT$1=toStringTagSupport,classof$a=classof$d,objectToString=TO_STRING_TAG_SUPPORT$1?{}.toString:function(){return"[object "+classof$a(this)+"]"},TO_STRING_TAG_SUPPORT=toStringTagSupport,defineBuiltIn$g=defineBuiltIn$i,toString$c=objectToString;TO_STRING_TAG_SUPPORT||defineBuiltIn$g(Object.prototype,"toString",toString$c,{unsafe:!0});var es_regexp_toString={},anObject$h=anObject$k,regexpFlags$1=function(){var e=anObject$h(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},call$o=functionCall,hasOwn$f=hasOwnProperty_1,isPrototypeOf$8=objectIsPrototypeOf,regExpFlags=regexpFlags$1,RegExpPrototype$3=RegExp.prototype,regexpGetFlags=function(e){var t=e.flags;return void 0!==t||"flags"in RegExpPrototype$3||hasOwn$f(e,"flags")||!isPrototypeOf$8(RegExpPrototype$3,e)?t:call$o(regExpFlags,e)},PROPER_FUNCTION_NAME$3=functionName.PROPER,defineBuiltIn$f=defineBuiltIn$i,anObject$g=anObject$k,$toString$3=toString$f,fails$x=fails$K,getRegExpFlags$1=regexpGetFlags,TO_STRING$1="toString",RegExpPrototype$2=RegExp.prototype,nativeToString=RegExpPrototype$2[TO_STRING$1],NOT_GENERIC=fails$x((function(){return"/a/b"!=nativeToString.call({source:"a",flags:"b"})})),INCORRECT_NAME=PROPER_FUNCTION_NAME$3&&nativeToString.name!=TO_STRING$1;(NOT_GENERIC||INCORRECT_NAME)&&defineBuiltIn$f(RegExp.prototype,TO_STRING$1,(function(){var e=anObject$g(this);return"/"+$toString$3(e.source)+"/"+$toString$3(getRegExpFlags$1(e))}),{unsafe:!0});var web_domCollections_forEach={},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,fails$w=fails$K,arrayMethodIsStrict$3=function(e,t){var r=[][e];return!!r&&fails$w((function(){r.call(null,t||function(){return 1},1)}))},$forEach$2=arrayIteration.forEach,arrayMethodIsStrict$2=arrayMethodIsStrict$3,STRICT_METHOD$2=arrayMethodIsStrict$2("forEach"),arrayForEach=STRICT_METHOD$2?[].forEach:function(e){return $forEach$2(this,e,arguments.length>1?arguments[1]:void 0)},global$x=global$H,DOMIterables$1=domIterables,DOMTokenListPrototype$1=domTokenListPrototype,forEach$1=arrayForEach,createNonEnumerableProperty$7=createNonEnumerableProperty$a,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$x[COLLECTION_NAME$1]&&global$x[COLLECTION_NAME$1].prototype);handlePrototype$1(DOMTokenListPrototype$1);var es_number_constructor={},isCallable$g=isCallable$t,$String$1=String,$TypeError$b=TypeError,aPossiblePrototype$1=function(e){if("object"==_typeof$4(e)||isCallable$g(e))return e;throw $TypeError$b("Can't set "+$String$1(e)+" as a prototype")},uncurryThis$w=functionUncurryThis,anObject$f=anObject$k,aPossiblePrototype=aPossiblePrototype$1,objectSetPrototypeOf=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=uncurryThis$w(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),t=r instanceof Array}catch(i){}return function(r,i){return anObject$f(r),aPossiblePrototype(i),t?e(r,i):r.__proto__=i,r}}():void 0),isCallable$f=isCallable$t,isObject$d=isObject$l,setPrototypeOf$5=objectSetPrototypeOf,inheritIfRequired$3=function(e,t,r){var i,n;return setPrototypeOf$5&&isCallable$f(i=t.constructor)&&i!==r&&isObject$d(n=i.prototype)&&n!==r.prototype&&setPrototypeOf$5(e,n),e},uncurryThis$v=functionUncurryThis,thisNumberValue$2=uncurryThis$v(1..valueOf),whitespaces$3="\t\n\v\f\r                 \u2028\u2029\ufeff",uncurryThis$u=functionUncurryThis,requireObjectCoercible$4=requireObjectCoercible$9,toString$b=toString$f,whitespaces$2=whitespaces$3,replace$8=uncurryThis$u("".replace),whitespace="["+whitespaces$2+"]",ltrim=RegExp("^"+whitespace+whitespace+"*"),rtrim=RegExp(whitespace+whitespace+"*$"),createMethod$3=function(e){return function(t){var r=toString$b(requireObjectCoercible$4(t));return 1&e&&(r=replace$8(r,ltrim,"")),2&e&&(r=replace$8(r,rtrim,"")),r}},stringTrim={start:createMethod$3(1),end:createMethod$3(2),trim:createMethod$3(3)},DESCRIPTORS$f=descriptors,global$w=global$H,uncurryThis$t=functionUncurryThis,isForced$2=isForced_1,defineBuiltIn$e=defineBuiltIn$i,hasOwn$e=hasOwnProperty_1,inheritIfRequired$2=inheritIfRequired$3,isPrototypeOf$7=objectIsPrototypeOf,isSymbol$3=isSymbol$6,toPrimitive$1=toPrimitive$3,fails$v=fails$K,getOwnPropertyNames$3=objectGetOwnPropertyNames.f,getOwnPropertyDescriptor$3=objectGetOwnPropertyDescriptor.f,defineProperty$b=objectDefineProperty.f,thisNumberValue$1=thisNumberValue$2,trim$1=stringTrim.trim,NUMBER="Number",NativeNumber=global$w[NUMBER],NumberPrototype=NativeNumber.prototype,TypeError$6=global$w.TypeError,arraySlice$c=uncurryThis$t("".slice),charCodeAt$2=uncurryThis$t("".charCodeAt),toNumeric=function(e){var t=toPrimitive$1(e,"number");return"bigint"==typeof t?t:toNumber$1(t)},toNumber$1=function(e){var t,r,i,n,o,a,s,l,c=toPrimitive$1(e,"number");if(isSymbol$3(c))throw TypeError$6("Cannot convert a Symbol value to a number");if("string"==typeof c&&c.length>2)if(c=trim$1(c),43===(t=charCodeAt$2(c,0))||45===t){if(88===(r=charCodeAt$2(c,2))||120===r)return NaN}else if(48===t){switch(charCodeAt$2(c,1)){case 66:case 98:i=2,n=49;break;case 79:case 111:i=8,n=55;break;default:return+c}for(a=(o=arraySlice$c(c,2)).length,s=0;s<a;s++)if((l=charCodeAt$2(o,s))<48||l>n)return NaN;return parseInt(o,i)}return+c};if(isForced$2(NUMBER,!NativeNumber(" 0o1")||!NativeNumber("0b1")||NativeNumber("+0x1"))){for(var NumberWrapper=function(e){var t=arguments.length<1?0:NativeNumber(toNumeric(e)),r=this;return isPrototypeOf$7(NumberPrototype,r)&&fails$v((function(){thisNumberValue$1(r)}))?inheritIfRequired$2(Object(t),r,NumberWrapper):t},keys$2=DESCRIPTORS$f?getOwnPropertyNames$3(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,key$1;keys$2.length>j$1;j$1++)hasOwn$e(NativeNumber,key$1=keys$2[j$1])&&!hasOwn$e(NumberWrapper,key$1)&&defineProperty$b(NumberWrapper,key$1,getOwnPropertyDescriptor$3(NativeNumber,key$1));NumberWrapper.prototype=NumberPrototype,NumberPrototype.constructor=NumberWrapper,defineBuiltIn$e(global$w,NUMBER,NumberWrapper,{constructor:!0})}var es_function_name={},DESCRIPTORS$e=descriptors,FUNCTION_NAME_EXISTS=functionName.EXISTS,uncurryThis$s=functionUncurryThis,defineProperty$a=objectDefineProperty.f,FunctionPrototype$1=Function.prototype,functionToString=uncurryThis$s(FunctionPrototype$1.toString),nameRE=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,regExpExec$2=uncurryThis$s(nameRE.exec),NAME$1="name";DESCRIPTORS$e&&!FUNCTION_NAME_EXISTS&&defineProperty$a(FunctionPrototype$1,NAME$1,{configurable:!0,get:function(){try{return regExpExec$2(nameRE,functionToString(this))[1]}catch(e){return""}}});var es_array_join={},$$x=_export,uncurryThis$r=functionUncurryThis,IndexedObject$3=indexedObject,toIndexedObject$8=toIndexedObject$c,arrayMethodIsStrict$1=arrayMethodIsStrict$3,nativeJoin=uncurryThis$r([].join),ES3_STRINGS=IndexedObject$3!=Object,STRICT_METHOD$1=arrayMethodIsStrict$1("join",",");$$x({target:"Array",proto:!0,forced:ES3_STRINGS||!STRICT_METHOD$1},{join:function(e){return nativeJoin(toIndexedObject$8(this),void 0===e?",":e)}});var es_promise={},classof$9=classofRaw$2,global$v=global$H,engineIsNode="process"==classof$9(global$v.process),defineProperty$9=objectDefineProperty.f,hasOwn$d=hasOwnProperty_1,wellKnownSymbol$m=wellKnownSymbol$t,TO_STRING_TAG$2=wellKnownSymbol$m("toStringTag"),setToStringTag$7=function(e,t,r){e&&!r&&(e=e.prototype),e&&!hasOwn$d(e,TO_STRING_TAG$2)&&defineProperty$9(e,TO_STRING_TAG$2,{configurable:!0,value:t})},getBuiltIn$8=getBuiltIn$d,definePropertyModule$3=objectDefineProperty,wellKnownSymbol$l=wellKnownSymbol$t,DESCRIPTORS$d=descriptors,SPECIES$4=wellKnownSymbol$l("species"),setSpecies$3=function(e){var t=getBuiltIn$8(e),r=definePropertyModule$3.f;DESCRIPTORS$d&&t&&!t[SPECIES$4]&&r(t,SPECIES$4,{configurable:!0,get:function(){return this}})},isPrototypeOf$6=objectIsPrototypeOf,$TypeError$a=TypeError,anInstance$5=function(e,t){if(isPrototypeOf$6(t,e))return e;throw $TypeError$a("Incorrect invocation")},isConstructor$2=isConstructor$4,tryToString$5=tryToString$7,$TypeError$9=TypeError,aConstructor$3=function(e){if(isConstructor$2(e))return e;throw $TypeError$9(tryToString$5(e)+" is not a constructor")},anObject$e=anObject$k,aConstructor$2=aConstructor$3,isNullOrUndefined$4=isNullOrUndefined$7,wellKnownSymbol$k=wellKnownSymbol$t,SPECIES$3=wellKnownSymbol$k("species"),speciesConstructor$4=function(e,t){var r,i=anObject$e(e).constructor;return void 0===i||isNullOrUndefined$4(r=anObject$e(i)[SPECIES$3])?t:aConstructor$2(r)},NATIVE_BIND$1=functionBindNative,FunctionPrototype=Function.prototype,apply$a=FunctionPrototype.apply,call$n=FunctionPrototype.call,functionApply="object"==("undefined"==typeof Reflect?"undefined":_typeof$4(Reflect))&&Reflect.apply||(NATIVE_BIND$1?call$n.bind(apply$a):function(){return call$n.apply(apply$a,arguments)}),getBuiltIn$7=getBuiltIn$d,html$2=getBuiltIn$7("document","documentElement"),uncurryThis$q=functionUncurryThis,arraySlice$b=uncurryThis$q([].slice),$TypeError$8=TypeError,validateArgumentsLength$4=function(e,t){if(e<t)throw $TypeError$8("Not enough arguments");return e},userAgent$5=engineUserAgent,engineIsIos=/(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$5),global$u=global$H,apply$9=functionApply,bind$a=functionBindContext,isCallable$e=isCallable$t,hasOwn$c=hasOwnProperty_1,fails$u=fails$K,html$1=html$2,arraySlice$a=arraySlice$b,createElement=documentCreateElement$2,validateArgumentsLength$3=validateArgumentsLength$4,IS_IOS$1=engineIsIos,IS_NODE$3=engineIsNode,set$1=global$u.setImmediate,clear$1=global$u.clearImmediate,process$2=global$u.process,Dispatch=global$u.Dispatch,Function$2=global$u.Function,MessageChannel=global$u.MessageChannel,String$1=global$u.String,counter=0,queue$1={},ONREADYSTATECHANGE="onreadystatechange",$location,defer,channel,port;try{$location=global$u.location}catch(error){}var run=function(e){if(hasOwn$c(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$u.postMessage(String$1(e),$location.protocol+"//"+$location.host)};set$1&&clear$1||(set$1=function(e){validateArgumentsLength$3(arguments.length,1);var t=isCallable$e(e)?e:Function$2(e),r=arraySlice$a(arguments,1);return queue$1[++counter]=function(){apply$9(t,void 0,r)},defer(counter),counter},clear$1=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?(channel=new MessageChannel,port=channel.port2,channel.port1.onmessage=listener,defer=bind$a(port.postMessage,port)):global$u.addEventListener&&isCallable$e(global$u.postMessage)&&!global$u.importScripts&&$location&&"file:"!==$location.protocol&&!fails$u(post)?(defer=post,global$u.addEventListener("message",listener,!1)):defer=ONREADYSTATECHANGE in createElement("script")?function(e){html$1.appendChild(createElement("script"))[ONREADYSTATECHANGE]=function(){html$1.removeChild(this),run(e)}}:function(e){setTimeout(runner(e),0)});var task$1={set:set$1,clear:clear$1},userAgent$4=engineUserAgent,global$t=global$H,engineIsIosPebble=/ipad|iphone|ipod/i.test(userAgent$4)&&void 0!==global$t.Pebble,userAgent$3=engineUserAgent,engineIsWebosWebkit=/web0s(?!.*chrome)/i.test(userAgent$3),global$s=global$H,bind$9=functionBindContext,getOwnPropertyDescriptor$2=objectGetOwnPropertyDescriptor.f,macrotask=task$1.set,IS_IOS=engineIsIos,IS_IOS_PEBBLE=engineIsIosPebble,IS_WEBOS_WEBKIT=engineIsWebosWebkit,IS_NODE$2=engineIsNode,MutationObserver$1=global$s.MutationObserver||global$s.WebKitMutationObserver,document$2=global$s.document,process$1=global$s.process,Promise$1=global$s.Promise,queueMicrotaskDescriptor=getOwnPropertyDescriptor$2(global$s,"queueMicrotask"),queueMicrotask=queueMicrotaskDescriptor&&queueMicrotaskDescriptor.value,flush,head,last,notify$1,toggle,node,promise,then;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(error){throw head?notify$1():last=void 0,error}}last=void 0,e&&e.enter()},IS_IOS||IS_NODE$2||IS_WEBOS_WEBKIT||!MutationObserver$1||!document$2?!IS_IOS_PEBBLE&&Promise$1&&Promise$1.resolve?(promise=Promise$1.resolve(void 0),promise.constructor=Promise$1,then=bind$9(promise.then,promise),notify$1=function(){then(flush)}):IS_NODE$2?notify$1=function(){process$1.nextTick(flush)}:(macrotask=bind$9(macrotask,global$s),notify$1=function(){macrotask(flush)}):(toggle=!0,node=document$2.createTextNode(""),new MutationObserver$1(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$r=global$H,hostReportErrors$1=function(e,t){var r=global$r.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(error){return{error:!0,value:error}}},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$q=global$H,promiseNativeConstructor=global$q.Promise,engineIsDeno="object"==("undefined"==typeof Deno?"undefined":_typeof$4(Deno))&&Deno&&"object"==_typeof$4(Deno.version),IS_DENO$1=engineIsDeno,IS_NODE$1=engineIsNode,engineIsBrowser=!IS_DENO$1&&!IS_NODE$1&&"object"==("undefined"==typeof window?"undefined":_typeof$4(window))&&"object"==("undefined"==typeof document?"undefined":_typeof$4(document)),global$p=global$H,NativePromiseConstructor$4=promiseNativeConstructor,isCallable$d=isCallable$t,isForced$1=isForced_1,inspectSource=inspectSource$3,wellKnownSymbol$j=wellKnownSymbol$t,IS_BROWSER=engineIsBrowser,IS_DENO=engineIsDeno,V8_VERSION=engineV8Version;NativePromiseConstructor$4&&NativePromiseConstructor$4.prototype;var SPECIES$2=wellKnownSymbol$j("species"),SUBCLASSING=!1,NATIVE_PROMISE_REJECTION_EVENT$1=isCallable$d(global$p.PromiseRejectionEvent),FORCED_PROMISE_CONSTRUCTOR$5=isForced$1("Promise",(function(){var e=inspectSource(NativePromiseConstructor$4),t=e!==String(NativePromiseConstructor$4);if(!t&&66===V8_VERSION)return!0;if(!V8_VERSION||V8_VERSION<51||!/native code/.test(e)){var r=new NativePromiseConstructor$4((function(e){e(1)})),i=function(e){e((function(){}),(function(){}))};if((r.constructor={})[SPECIES$2]=i,!(SUBCLASSING=r.then((function(){}))instanceof i))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,i){if(void 0!==t||void 0!==r)throw $TypeError$7("Bad Promise constructor");t=e,r=i})),this.resolve=aCallable$7(t),this.reject=aCallable$7(r)};newPromiseCapability$2.f=function(e){return new PromiseCapability(e)};var $$w=_export,IS_NODE=engineIsNode,global$o=global$H,call$m=functionCall,defineBuiltIn$d=defineBuiltIn$i,setPrototypeOf$4=objectSetPrototypeOf,setToStringTag$6=setToStringTag$7,setSpecies$2=setSpecies$3,aCallable$6=aCallable$a,isCallable$c=isCallable$t,isObject$c=isObject$l,anInstance$4=anInstance$5,speciesConstructor$3=speciesConstructor$4,task=task$1.set,microtask=microtask$1,hostReportErrors=hostReportErrors$1,perform$2=perform$3,Queue=queue,InternalStateModule$8=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$8.getterFor(PROMISE),setInternalState$7=InternalStateModule$8.set,NativePromisePrototype$2=NativePromiseConstructor$3&&NativePromiseConstructor$3.prototype,PromiseConstructor=NativePromiseConstructor$3,PromisePrototype=NativePromisePrototype$2,TypeError$5=global$o.TypeError,document$1=global$o.document,process=global$o.process,newPromiseCapability$1=newPromiseCapabilityModule$3.f,newGenericPromiseCapability=newPromiseCapability$1,DISPATCH_EVENT=!!(document$1&&document$1.createEvent&&global$o.dispatchEvent),UNHANDLED_REJECTION="unhandledrejection",REJECTION_HANDLED="rejectionhandled",PENDING=0,FULFILLED=1,REJECTED=2,HANDLED=1,UNHANDLED=2,Internal,OwnPromiseCapability,PromiseWrapper,nativeThen,isThenable=function(e){var t;return!(!isObject$c(e)||!isCallable$c(t=e.then))&&t},callReaction=function(e,t){var r,i,n,o=t.value,a=t.state==FULFILLED,s=a?e.ok:e.fail,l=e.resolve,c=e.reject,u=e.domain;try{s?(a||(t.rejection===UNHANDLED&&onHandleUnhandled(t),t.rejection=HANDLED),!0===s?r=o:(u&&u.enter(),r=s(o),u&&(u.exit(),n=!0)),r===e.promise?c(TypeError$5("Promise-chain cycle")):(i=isThenable(r))?call$m(i,r,l,c):l(r)):c(o)}catch(error){u&&!n&&u.exit(),c(error)}},notify=function(e,t){e.notified||(e.notified=!0,microtask((function(){for(var r,i=e.reactions;r=i.get();)callReaction(r,e);e.notified=!1,t&&!e.rejection&&onUnhandled(e)})))},dispatchEvent=function(e,t,r){var i,n;DISPATCH_EVENT?((i=document$1.createEvent("Event")).promise=t,i.reason=r,i.initEvent(e,!1,!0),global$o.dispatchEvent(i)):i={promise:t,reason:r},!NATIVE_PROMISE_REJECTION_EVENT&&(n=global$o["on"+e])?n(i):e===UNHANDLED_REJECTION&&hostReportErrors("Unhandled promise rejection",r)},onUnhandled=function(e){call$m(task,global$o,(function(){var t,r=e.facade,i=e.value;if(isUnhandled(e)&&(t=perform$2((function(){IS_NODE?process.emit("unhandledRejection",i,r):dispatchEvent(UNHANDLED_REJECTION,r,i)})),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$m(task,global$o,(function(){var t=e.facade;IS_NODE?process.emit("rejectionHandled",t):dispatchEvent(REJECTION_HANDLED,t,e.value)}))},bind$8=function(e,t,r){return function(i){e(t,i,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,i){if(!t.done){t.done=!0,i&&(t=i);try{if(t.facade===r)throw TypeError$5("Promise can't be resolved itself");var n=isThenable(r);n?microtask((function(){var i={done:!1};try{call$m(n,r,bind$8(e,i,t),bind$8(internalReject,i,t))}catch(error){internalReject(i,error,t)}})):(t.value=r,t.state=FULFILLED,notify(t,!1))}catch(error){internalReject({done:!1},error,t)}}};if(FORCED_PROMISE_CONSTRUCTOR$4&&(PromiseConstructor=function(e){anInstance$4(this,PromisePrototype),aCallable$6(e),call$m(Internal,this);var t=getInternalPromiseState(this);try{e(bind$8(internalResolve,t),bind$8(internalReject,t))}catch(error){internalReject(t,error)}},PromisePrototype=PromiseConstructor.prototype,Internal=function(e){setInternalState$7(this,{type:PROMISE,done:!1,notified:!1,parent:!1,reactions:new Queue,rejection:!1,state:PENDING,value:void 0})},Internal.prototype=defineBuiltIn$d(PromisePrototype,"then",(function(e,t){var r=getInternalPromiseState(this),i=newPromiseCapability$1(speciesConstructor$3(this,PromiseConstructor));return r.parent=!0,i.ok=!isCallable$c(e)||e,i.fail=isCallable$c(t)&&t,i.domain=IS_NODE?process.domain:void 0,r.state==PENDING?r.reactions.add(i):microtask((function(){callReaction(i,r)})),i.promise})),OwnPromiseCapability=function(){var e=new Internal,t=getInternalPromiseState(e);this.promise=e,this.resolve=bind$8(internalResolve,t),this.reject=bind$8(internalReject,t)},newPromiseCapabilityModule$3.f=newPromiseCapability$1=function(e){return e===PromiseConstructor||e===PromiseWrapper?new OwnPromiseCapability(e):newGenericPromiseCapability(e)},isCallable$c(NativePromiseConstructor$3)&&NativePromisePrototype$2!==Object.prototype)){nativeThen=NativePromisePrototype$2.then,NATIVE_PROMISE_SUBCLASSING||defineBuiltIn$d(NativePromisePrototype$2,"then",(function(e,t){var r=this;return new PromiseConstructor((function(e,t){call$m(nativeThen,r,e,t)})).then(e,t)}),{unsafe:!0});try{delete NativePromisePrototype$2.constructor}catch(error){}setPrototypeOf$4&&setPrototypeOf$4(NativePromisePrototype$2,PromisePrototype)}$$w({global:!0,constructor:!0,wrap:!0,forced:FORCED_PROMISE_CONSTRUCTOR$4},{Promise:PromiseConstructor}),setToStringTag$6(PromiseConstructor,PROMISE,!1),setSpecies$2(PROMISE);var iterators={},wellKnownSymbol$i=wellKnownSymbol$t,Iterators$4=iterators,ITERATOR$9=wellKnownSymbol$i("iterator"),ArrayPrototype$1=Array.prototype,isArrayIteratorMethod$3=function(e){return void 0!==e&&(Iterators$4.Array===e||ArrayPrototype$1[ITERATOR$9]===e)},classof$8=classof$d,getMethod$4=getMethod$6,isNullOrUndefined$3=isNullOrUndefined$7,Iterators$3=iterators,wellKnownSymbol$h=wellKnownSymbol$t,ITERATOR$8=wellKnownSymbol$h("iterator"),getIteratorMethod$5=function(e){if(!isNullOrUndefined$3(e))return getMethod$4(e,ITERATOR$8)||getMethod$4(e,"@@iterator")||Iterators$3[classof$8(e)]},call$l=functionCall,aCallable$5=aCallable$a,anObject$d=anObject$k,tryToString$4=tryToString$7,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$d(call$l(r,e));throw $TypeError$6(tryToString$4(e)+" is not iterable")},call$k=functionCall,anObject$c=anObject$k,getMethod$3=getMethod$6,iteratorClose$2=function(e,t,r){var i,n;anObject$c(e);try{if(!(i=getMethod$3(e,"return"))){if("throw"===t)throw r;return r}i=call$k(i,e)}catch(error){n=!0,i=error}if("throw"===t)throw r;if(n)throw i;return anObject$c(i),r},bind$7=functionBindContext,call$j=functionCall,anObject$b=anObject$k,tryToString$3=tryToString$7,isArrayIteratorMethod$2=isArrayIteratorMethod$3,lengthOfArrayLike$d=lengthOfArrayLike$h,isPrototypeOf$5=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 i,n,o,a,s,l,c,u=r&&r.that,h=!(!r||!r.AS_ENTRIES),d=!(!r||!r.IS_RECORD),p=!(!r||!r.IS_ITERATOR),f=!(!r||!r.INTERRUPTED),g=bind$7(t,u),y=function(e){return i&&iteratorClose$1(i,"normal",e),new Result(!0,e)},v=function(e){return h?(anObject$b(e),f?g(e[0],e[1],y):g(e[0],e[1])):f?g(e,y):g(e)};if(d)i=e.iterator;else if(p)i=e;else{if(!(n=getIteratorMethod$3(e)))throw $TypeError$5(tryToString$3(e)+" is not iterable");if(isArrayIteratorMethod$2(n)){for(o=0,a=lengthOfArrayLike$d(e);a>o;o++)if((s=v(e[o]))&&isPrototypeOf$5(ResultPrototype,s))return s;return new Result(!1)}i=getIterator$3(e,n)}for(l=d?e.next:i.next;!(c=call$j(l,i)).done;){try{s=v(c.value)}catch(error){iteratorClose$1(i,"throw",error)}if("object"==_typeof$4(s)&&s&&isPrototypeOf$5(ResultPrototype,s))return s}return new Result(!1)},wellKnownSymbol$g=wellKnownSymbol$t,ITERATOR$7=wellKnownSymbol$g("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(error){}var checkCorrectnessOfIteration$2=function(e,t){if(!t&&!SAFE_CLOSING)return!1;var r=!1;try{var i={};i[ITERATOR$7]=function(){return{next:function(){return{done:r=!0}}}},e(i)}catch(error){}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(){}))})),$$v=_export,call$i=functionCall,aCallable$4=aCallable$a,newPromiseCapabilityModule$2=newPromiseCapability$2,perform$1=perform$3,iterate$1=iterate$2,PROMISE_STATICS_INCORRECT_ITERATION$1=promiseStaticsIncorrectIteration;$$v({target:"Promise",stat:!0,forced:PROMISE_STATICS_INCORRECT_ITERATION$1},{all:function(e){var t=this,r=newPromiseCapabilityModule$2.f(t),i=r.resolve,n=r.reject,o=perform$1((function(){var r=aCallable$4(t.resolve),o=[],a=0,s=1;iterate$1(e,(function(e){var l=a++,c=!1;s++,call$i(r,t,e).then((function(e){c||(c=!0,o[l]=e,--s||i(o))}),n)})),--s||i(o)}));return o.error&&n(o.value),r.promise}});var $$u=_export,FORCED_PROMISE_CONSTRUCTOR$2=promiseConstructorDetection.CONSTRUCTOR,NativePromiseConstructor$1=promiseNativeConstructor,getBuiltIn$6=getBuiltIn$d,isCallable$b=isCallable$t,defineBuiltIn$c=defineBuiltIn$i,NativePromisePrototype$1=NativePromiseConstructor$1&&NativePromiseConstructor$1.prototype;if($$u({target:"Promise",proto:!0,forced:FORCED_PROMISE_CONSTRUCTOR$2,real:!0},{catch:function(e){return this.then(void 0,e)}}),isCallable$b(NativePromiseConstructor$1)){var method$1=getBuiltIn$6("Promise").prototype.catch;NativePromisePrototype$1.catch!==method$1&&defineBuiltIn$c(NativePromisePrototype$1,"catch",method$1,{unsafe:!0})}var $$t=_export,call$h=functionCall,aCallable$3=aCallable$a,newPromiseCapabilityModule$1=newPromiseCapability$2,perform=perform$3,iterate=iterate$2,PROMISE_STATICS_INCORRECT_ITERATION=promiseStaticsIncorrectIteration;$$t({target:"Promise",stat:!0,forced:PROMISE_STATICS_INCORRECT_ITERATION},{race:function(e){var t=this,r=newPromiseCapabilityModule$1.f(t),i=r.reject,n=perform((function(){var n=aCallable$3(t.resolve);iterate(e,(function(e){call$h(n,t,e).then(r.resolve,i)}))}));return n.error&&i(n.value),r.promise}});var $$s=_export,call$g=functionCall,newPromiseCapabilityModule=newPromiseCapability$2,FORCED_PROMISE_CONSTRUCTOR$1=promiseConstructorDetection.CONSTRUCTOR;$$s({target:"Promise",stat:!0,forced:FORCED_PROMISE_CONSTRUCTOR$1},{reject:function(e){var t=newPromiseCapabilityModule.f(this);return call$g(t.reject,void 0,e),t.promise}});var anObject$a=anObject$k,isObject$b=isObject$l,newPromiseCapability=newPromiseCapability$2,promiseResolve$2=function(e,t){if(anObject$a(e),isObject$b(t)&&t.constructor===e)return t;var r=newPromiseCapability.f(e);return(0,r.resolve)(t),r.promise},$$r=_export,getBuiltIn$5=getBuiltIn$d,FORCED_PROMISE_CONSTRUCTOR=promiseConstructorDetection.CONSTRUCTOR,promiseResolve$1=promiseResolve$2;getBuiltIn$5("Promise"),$$r({target:"Promise",stat:!0,forced:FORCED_PROMISE_CONSTRUCTOR},{resolve:function(e){return promiseResolve$1(this,e)}});var es_promise_finally={},$$q=_export,NativePromiseConstructor=promiseNativeConstructor,fails$t=fails$K,getBuiltIn$4=getBuiltIn$d,isCallable$a=isCallable$t,speciesConstructor$2=speciesConstructor$4,promiseResolve=promiseResolve$2,defineBuiltIn$b=defineBuiltIn$i,NativePromisePrototype=NativePromiseConstructor&&NativePromiseConstructor.prototype,NON_GENERIC=!!NativePromiseConstructor&&fails$t((function(){NativePromisePrototype.finally.call({then:function(){}},(function(){}))}));if($$q({target:"Promise",proto:!0,real:!0,forced:NON_GENERIC},{finally:function(e){var t=speciesConstructor$2(this,getBuiltIn$4("Promise")),r=isCallable$a(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$a(NativePromiseConstructor)){var method=getBuiltIn$4("Promise").prototype.finally;NativePromisePrototype.finally!==method&&defineBuiltIn$b(NativePromisePrototype,"finally",method,{unsafe:!0})}var es_array_splice={},DESCRIPTORS$c=descriptors,isArray$2=isArray$5,$TypeError$4=TypeError,getOwnPropertyDescriptor$1=Object.getOwnPropertyDescriptor,SILENT_ON_NON_WRITABLE_LENGTH_SET=DESCRIPTORS$c&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(error){return error instanceof TypeError}}(),arraySetLength=SILENT_ON_NON_WRITABLE_LENGTH_SET?function(e,t){if(isArray$2(e)&&!getOwnPropertyDescriptor$1(e,"length").writable)throw $TypeError$4("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t},tryToString$2=tryToString$7,$TypeError$3=TypeError,deletePropertyOrThrow$2=function(e,t){if(!delete e[t])throw $TypeError$3("Cannot delete property "+tryToString$2(t)+" of "+tryToString$2(e))},$$p=_export,toObject$b=toObject$g,toAbsoluteIndex$5=toAbsoluteIndex$7,toIntegerOrInfinity$8=toIntegerOrInfinity$d,lengthOfArrayLike$c=lengthOfArrayLike$h,setArrayLength=arraySetLength,doesNotExceedSafeInteger=doesNotExceedSafeInteger$2,arraySpeciesCreate=arraySpeciesCreate$3,createProperty$3=createProperty$5,deletePropertyOrThrow$1=deletePropertyOrThrow$2,arrayMethodHasSpeciesSupport$2=arrayMethodHasSpeciesSupport$5,HAS_SPECIES_SUPPORT$2=arrayMethodHasSpeciesSupport$2("splice"),max$3=Math.max,min$4=Math.min;$$p({target:"Array",proto:!0,forced:!HAS_SPECIES_SUPPORT$2},{splice:function(e,t){var r,i,n,o,a,s,l=toObject$b(this),c=lengthOfArrayLike$c(l),u=toAbsoluteIndex$5(e,c),h=arguments.length;for(0===h?r=i=0:1===h?(r=0,i=c-u):(r=h-2,i=min$4(max$3(toIntegerOrInfinity$8(t),0),c-u)),doesNotExceedSafeInteger(c+r-i),n=arraySpeciesCreate(l,i),o=0;o<i;o++)(a=u+o)in l&&createProperty$3(n,o,l[a]);if(n.length=i,r<i){for(o=u;o<c-i;o++)s=o+r,(a=o+i)in l?l[s]=l[a]:deletePropertyOrThrow$1(l,s);for(o=c;o>c-i+r;o--)deletePropertyOrThrow$1(l,o-1)}else if(r>i)for(o=c-i;o>u;o--)s=o+r-1,(a=o+i-1)in l?l[s]=l[a]:deletePropertyOrThrow$1(l,s);for(o=0;o<r;o++)l[o+u]=arguments[o+2];return setArrayLength(l,c-i+r),n}});var es_number_toFixed={},toIntegerOrInfinity$7=toIntegerOrInfinity$d,toString$a=toString$f,requireObjectCoercible$3=requireObjectCoercible$9,$RangeError$5=RangeError,stringRepeat=function(e){var t=toString$a(requireObjectCoercible$3(this)),r="",i=toIntegerOrInfinity$7(e);if(i<0||i==1/0)throw $RangeError$5("Wrong number of repetitions");for(;i>0;(i>>>=1)&&(t+=t))1&i&&(r+=t);return r},$$o=_export,uncurryThis$p=functionUncurryThis,toIntegerOrInfinity$6=toIntegerOrInfinity$d,thisNumberValue=thisNumberValue$2,$repeat=stringRepeat,fails$s=fails$K,$RangeError$4=RangeError,$String=String,floor$7=Math.floor,repeat=uncurryThis$p($repeat),stringSlice$8=uncurryThis$p("".slice),nativeToFixed=uncurryThis$p(1..toFixed),pow$2=function e(t,r,i){return 0===r?i:r%2==1?e(t,r-1,i*t):e(t*t,r/2,i)},log$1=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 i=-1,n=r;++i<6;)n+=t*e[i],e[i]=n%1e7,n=floor$7(n/1e7)},divide=function(e,t){for(var r=6,i=0;--r>=0;)i+=e[r],e[r]=floor$7(i/t),i=i%t*1e7},dataToString=function(e){for(var t=6,r="";--t>=0;)if(""!==r||0===t||0!==e[t]){var i=$String(e[t]);r=""===r?i:r+repeat("0",7-i.length)+i}return r},FORCED$6=fails$s((function(){return"0.000"!==nativeToFixed(8e-5,3)||"1"!==nativeToFixed(.9,0)||"1.25"!==nativeToFixed(1.255,2)||"1000000000000000128"!==nativeToFixed(0xde0b6b3a7640080,0)}))||!fails$s((function(){nativeToFixed({})}));$$o({target:"Number",proto:!0,forced:FORCED$6},{toFixed:function(e){var t,r,i,n,o=thisNumberValue(this),a=toIntegerOrInfinity$6(e),s=[0,0,0,0,0,0],l="",c="0";if(a<0||a>20)throw $RangeError$4("Incorrect fraction digits");if(o!=o)return"NaN";if(o<=-1e21||o>=1e21)return $String(o);if(o<0&&(l="-",o=-o),o>1e-21)if(r=(t=log$1(o*pow$2(2,69,1))-69)<0?o*pow$2(2,-t,1):o/pow$2(2,t,1),r*=4503599627370496,(t=52-t)>0){for(multiply(s,0,r),i=a;i>=7;)multiply(s,1e7,0),i-=7;for(multiply(s,pow$2(10,i,1),0),i=t-1;i>=23;)divide(s,1<<23),i-=23;divide(s,1<<i),multiply(s,1,1),divide(s,2),c=dataToString(s)}else multiply(s,0,r),multiply(s,1<<-t,0),c=dataToString(s)+repeat("0",a);return c=a>0?l+((n=c.length)<=a?"0."+repeat("0",a-n)+c:stringSlice$8(c,0,n-a)+"."+stringSlice$8(c,n-a)):l+c}});var es_regexp_exec={},fails$r=fails$K,global$n=global$H,$RegExp$2=global$n.RegExp,UNSUPPORTED_Y$3=fails$r((function(){var e=$RegExp$2("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),MISSED_STICKY$1=UNSUPPORTED_Y$3||fails$r((function(){return!$RegExp$2("a","y").sticky})),BROKEN_CARET=UNSUPPORTED_Y$3||fails$r((function(){var e=$RegExp$2("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),regexpStickyHelpers={BROKEN_CARET:BROKEN_CARET,MISSED_STICKY:MISSED_STICKY$1,UNSUPPORTED_Y:UNSUPPORTED_Y$3},objectDefineProperties={},DESCRIPTORS$b=descriptors,V8_PROTOTYPE_DEFINE_BUG=v8PrototypeDefineBug,definePropertyModule$2=objectDefineProperty,anObject$9=anObject$k,toIndexedObject$7=toIndexedObject$c,objectKeys$3=objectKeys$4;objectDefineProperties.f=DESCRIPTORS$b&&!V8_PROTOTYPE_DEFINE_BUG?Object.defineProperties:function(e,t){anObject$9(e);for(var r,i=toIndexedObject$7(t),n=objectKeys$3(t),o=n.length,a=0;o>a;)definePropertyModule$2.f(e,r=n[a++],i[r]);return e};var anObject$8=anObject$k,definePropertiesModule$1=objectDefineProperties,enumBugKeys=enumBugKeys$3,hiddenKeys$1=hiddenKeys$5,html=html$2,documentCreateElement=documentCreateElement$2,sharedKey$2=sharedKey$4,GT=">",LT="<",PROTOTYPE$2="prototype",SCRIPT="script",IE_PROTO$1=sharedKey$2("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.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(scriptTag("document.F=Object")),e.close(),e.F},activeXDocument,_NullProtoObject=function(){try{activeXDocument=new ActiveXObject("htmlfile")}catch(error){}_NullProtoObject="undefined"!=typeof document?document.domain&&activeXDocument?NullProtoObjectViaActiveX(activeXDocument):NullProtoObjectViaIFrame():NullProtoObjectViaActiveX(activeXDocument);for(var e=enumBugKeys.length;e--;)delete _NullProtoObject[PROTOTYPE$2][enumBugKeys[e]];return _NullProtoObject()};hiddenKeys$1[IE_PROTO$1]=!0;var objectCreate=Object.create||function(e,t){var r;return null!==e?(EmptyConstructor[PROTOTYPE$2]=anObject$8(e),r=new EmptyConstructor,EmptyConstructor[PROTOTYPE$2]=null,r[IE_PROTO$1]=e):r=_NullProtoObject(),void 0===t?r:definePropertiesModule$1.f(r,t)},fails$q=fails$K,global$m=global$H,$RegExp$1=global$m.RegExp,regexpUnsupportedDotAll=fails$q((function(){var e=$RegExp$1(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),fails$p=fails$K,global$l=global$H,$RegExp=global$l.RegExp,regexpUnsupportedNcg=fails$p((function(){var e=$RegExp("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),call$f=functionCall,uncurryThis$o=functionUncurryThis,toString$9=toString$f,regexpFlags=regexpFlags$1,stickyHelpers$2=regexpStickyHelpers,shared$3=shared$7.exports,create$5=objectCreate,getInternalState$6=internalState.get,UNSUPPORTED_DOT_ALL$1=regexpUnsupportedDotAll,UNSUPPORTED_NCG$1=regexpUnsupportedNcg,nativeReplace=shared$3("native-string-replace",String.prototype.replace),nativeExec=RegExp.prototype.exec,patchedExec=nativeExec,charAt$8=uncurryThis$o("".charAt),indexOf=uncurryThis$o("".indexOf),replace$7=uncurryThis$o("".replace),stringSlice$7=uncurryThis$o("".slice),UPDATES_LAST_INDEX_WRONG=(re12=/a/,re22=/b*/g,call$f(nativeExec,re12,"a"),call$f(nativeExec,re22,"a"),0!==re12.lastIndex||0!==re22.lastIndex),re12,re22,UNSUPPORTED_Y$2=stickyHelpers$2.BROKEN_CARET,NPCG_INCLUDED=void 0!==/()??/.exec("")[1],PATCH=UPDATES_LAST_INDEX_WRONG||NPCG_INCLUDED||UNSUPPORTED_Y$2||UNSUPPORTED_DOT_ALL$1||UNSUPPORTED_NCG$1;PATCH&&(patchedExec=function(e){var t,r,i,n,o,a,s,l=this,c=getInternalState$6(l),u=toString$9(e),h=c.raw;if(h)return h.lastIndex=l.lastIndex,t=call$f(patchedExec,h,u),l.lastIndex=h.lastIndex,t;var d=c.groups,p=UNSUPPORTED_Y$2&&l.sticky,f=call$f(regexpFlags,l),g=l.source,y=0,v=u;if(p&&(f=replace$7(f,"y",""),-1===indexOf(f,"g")&&(f+="g"),v=stringSlice$7(u,l.lastIndex),l.lastIndex>0&&(!l.multiline||l.multiline&&"\n"!==charAt$8(u,l.lastIndex-1))&&(g="(?: "+g+")",v=" "+v,y++),r=new RegExp("^(?:"+g+")",f)),NPCG_INCLUDED&&(r=new RegExp("^"+g+"$(?!\\s)",f)),UPDATES_LAST_INDEX_WRONG&&(i=l.lastIndex),n=call$f(nativeExec,p?r:l,v),p?n?(n.input=stringSlice$7(n.input,y),n[0]=stringSlice$7(n[0],y),n.index=l.lastIndex,l.lastIndex+=n[0].length):l.lastIndex=0:UPDATES_LAST_INDEX_WRONG&&n&&(l.lastIndex=l.global?n.index+n[0].length:i),NPCG_INCLUDED&&n&&n.length>1&&call$f(nativeReplace,n[0],r,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(n[o]=void 0)})),n&&d)for(n.groups=a=create$5(null),o=0;o<d.length;o++)a[(s=d[o])[0]]=n[s[1]];return n});var regexpExec$3=patchedExec,$$n=_export,exec$5=regexpExec$3;$$n({target:"RegExp",proto:!0,forced:/./.exec!==exec$5},{exec:exec$5});var es_string_replace={},uncurryThis$n=functionUncurryThis,defineBuiltIn$a=defineBuiltIn$i,regexpExec$2=regexpExec$3,fails$o=fails$K,wellKnownSymbol$f=wellKnownSymbol$t,createNonEnumerableProperty$6=createNonEnumerableProperty$a,SPECIES$1=wellKnownSymbol$f("species"),RegExpPrototype$1=RegExp.prototype,fixRegexpWellKnownSymbolLogic=function(e,t,r,i){var n=wellKnownSymbol$f(e),o=!fails$o((function(){var t={};return t[n]=function(){return 7},7!=""[e](t)})),a=o&&!fails$o((function(){var t=!1,r=/a/;return"split"===e&&((r={}).constructor={},r.constructor[SPECIES$1]=function(){return r},r.flags="",r[n]=/./[n]),r.exec=function(){return t=!0,null},r[n](""),!t}));if(!o||!a||r){var s=uncurryThis$n(/./[n]),l=t(n,""[e],(function(e,t,r,i,n){var a=uncurryThis$n(e),l=t.exec;return l===regexpExec$2||l===RegExpPrototype$1.exec?o&&!n?{done:!0,value:s(t,r,i)}:{done:!0,value:a(r,t,i)}:{done:!1}}));defineBuiltIn$a(String.prototype,e,l[0]),defineBuiltIn$a(RegExpPrototype$1,n,l[1])}i&&createNonEnumerableProperty$6(RegExpPrototype$1[n],"sham",!0)},charAt$7=stringMultibyte.charAt,advanceStringIndex$3=function(e,t,r){return t+(r?charAt$7(e,t).length:1)},uncurryThis$m=functionUncurryThis,toObject$a=toObject$g,floor$6=Math.floor,charAt$6=uncurryThis$m("".charAt),replace$6=uncurryThis$m("".replace),stringSlice$6=uncurryThis$m("".slice),SUBSTITUTION_SYMBOLS=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,SUBSTITUTION_SYMBOLS_NO_NAMED=/\$([$&'`]|\d{1,2})/g,getSubstitution$1=function(e,t,r,i,n,o){var a=r+e.length,s=i.length,l=SUBSTITUTION_SYMBOLS_NO_NAMED;return void 0!==n&&(n=toObject$a(n),l=SUBSTITUTION_SYMBOLS),replace$6(o,l,(function(o,l){var c;switch(charAt$6(l,0)){case"$":return"$";case"&":return e;case"`":return stringSlice$6(t,0,r);case"'":return stringSlice$6(t,a);case"<":c=n[stringSlice$6(l,1,-1)];break;default:var u=+l;if(0===u)return o;if(u>s){var h=floor$6(u/10);return 0===h?o:h<=s?void 0===i[h-1]?charAt$6(l,1):i[h-1]+charAt$6(l,1):o}c=i[u-1]}return void 0===c?"":c}))},call$e=functionCall,anObject$7=anObject$k,isCallable$9=isCallable$t,classof$7=classofRaw$2,regexpExec$1=regexpExec$3,$TypeError$2=TypeError,regexpExecAbstract=function(e,t){var r=e.exec;if(isCallable$9(r)){var i=call$e(r,e,t);return null!==i&&anObject$7(i),i}if("RegExp"===classof$7(e))return call$e(regexpExec$1,e,t);throw $TypeError$2("RegExp#exec called on incompatible receiver")},apply$8=functionApply,call$d=functionCall,uncurryThis$l=functionUncurryThis,fixRegExpWellKnownSymbolLogic$2=fixRegexpWellKnownSymbolLogic,fails$n=fails$K,anObject$6=anObject$k,isCallable$8=isCallable$t,isNullOrUndefined$2=isNullOrUndefined$7,toIntegerOrInfinity$5=toIntegerOrInfinity$d,toLength$6=toLength$8,toString$8=toString$f,requireObjectCoercible$2=requireObjectCoercible$9,advanceStringIndex$2=advanceStringIndex$3,getMethod$2=getMethod$6,getSubstitution=getSubstitution$1,regExpExec$1=regexpExecAbstract,wellKnownSymbol$e=wellKnownSymbol$t,REPLACE=wellKnownSymbol$e("replace"),max$2=Math.max,min$3=Math.min,concat$2=uncurryThis$l([].concat),push$7=uncurryThis$l([].push),stringIndexOf$1=uncurryThis$l("".indexOf),stringSlice$5=uncurryThis$l("".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$n((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}));fixRegExpWellKnownSymbolLogic$2("replace",(function(e,t,r){var i=REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE?"$":"$0";return[function(e,r){var i=requireObjectCoercible$2(this),n=isNullOrUndefined$2(e)?void 0:getMethod$2(e,REPLACE);return n?call$d(n,e,i,r):call$d(t,toString$8(i),e,r)},function(e,n){var o=anObject$6(this),a=toString$8(e);if("string"==typeof n&&-1===stringIndexOf$1(n,i)&&-1===stringIndexOf$1(n,"$<")){var s=r(t,o,a,n);if(s.done)return s.value}var l=isCallable$8(n);l||(n=toString$8(n));var c=o.global;if(c){var u=o.unicode;o.lastIndex=0}for(var h=[];;){var d=regExpExec$1(o,a);if(null===d)break;if(push$7(h,d),!c)break;""===toString$8(d[0])&&(o.lastIndex=advanceStringIndex$2(a,toLength$6(o.lastIndex),u))}for(var p="",f=0,g=0;g<h.length;g++){for(var y=toString$8((d=h[g])[0]),v=max$2(min$3(toIntegerOrInfinity$5(d.index),a.length),0),m=[],_=1;_<d.length;_++)push$7(m,maybeToString(d[_]));var b=d.groups;if(l){var T=concat$2([y],m,v,a);void 0!==b&&push$7(T,b);var S=toString$8(apply$8(n,void 0,T))}else S=getSubstitution(y,a,v,m,b,n);v>=f&&(p+=stringSlice$5(a,f,v)+S,f=v+y.length)}return p+stringSlice$5(a,f)}]}),!REPLACE_SUPPORTS_NAMED_GROUPS||!REPLACE_KEEPS_$0||REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);var es_string_split={},isObject$a=isObject$l,classof$6=classofRaw$2,wellKnownSymbol$d=wellKnownSymbol$t,MATCH$1=wellKnownSymbol$d("match"),isRegexp=function(e){var t;return isObject$a(e)&&(void 0!==(t=e[MATCH$1])?!!t:"RegExp"==classof$6(e))},toAbsoluteIndex$4=toAbsoluteIndex$7,lengthOfArrayLike$b=lengthOfArrayLike$h,createProperty$2=createProperty$5,$Array$3=Array,max$1=Math.max,arraySliceSimple=function(e,t,r){for(var i=lengthOfArrayLike$b(e),n=toAbsoluteIndex$4(t,i),o=toAbsoluteIndex$4(void 0===r?i:r,i),a=$Array$3(max$1(o-n,0)),s=0;n<o;n++,s++)createProperty$2(a,s,e[n]);return a.length=s,a},apply$7=functionApply,call$c=functionCall,uncurryThis$k=functionUncurryThis,fixRegExpWellKnownSymbolLogic$1=fixRegexpWellKnownSymbolLogic,anObject$5=anObject$k,isNullOrUndefined$1=isNullOrUndefined$7,isRegExp$1=isRegexp,requireObjectCoercible$1=requireObjectCoercible$9,speciesConstructor$1=speciesConstructor$4,advanceStringIndex$1=advanceStringIndex$3,toLength$5=toLength$8,toString$7=toString$f,getMethod$1=getMethod$6,arraySlice$9=arraySliceSimple,callRegExpExec=regexpExecAbstract,regexpExec=regexpExec$3,stickyHelpers$1=regexpStickyHelpers,fails$m=fails$K,UNSUPPORTED_Y$1=stickyHelpers$1.UNSUPPORTED_Y,MAX_UINT32=4294967295,min$2=Math.min,$push=[].push,exec$4=uncurryThis$k(/./.exec),push$6=uncurryThis$k($push),stringSlice$4=uncurryThis$k("".slice),SPLIT_WORKS_WITH_OVERWRITTEN_EXEC=!fails$m((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var r="ab".split(e);return 2!==r.length||"a"!==r[0]||"b"!==r[1]}));fixRegExpWellKnownSymbolLogic$1("split",(function(e,t,r){var i;return i="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,r){var i=toString$7(requireObjectCoercible$1(this)),n=void 0===r?MAX_UINT32:r>>>0;if(0===n)return[];if(void 0===e)return[i];if(!isRegExp$1(e))return call$c(t,i,e,n);for(var o,a,s,l=[],c=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),u=0,h=new RegExp(e.source,c+"g");(o=call$c(regexpExec,h,i))&&!((a=h.lastIndex)>u&&(push$6(l,stringSlice$4(i,u,o.index)),o.length>1&&o.index<i.length&&apply$7($push,l,arraySlice$9(o,1)),s=o[0].length,u=a,l.length>=n));)h.lastIndex===o.index&&h.lastIndex++;return u===i.length?!s&&exec$4(h,"")||push$6(l,""):push$6(l,stringSlice$4(i,u)),l.length>n?arraySlice$9(l,0,n):l}:"0".split(void 0,0).length?function(e,r){return void 0===e&&0===r?[]:call$c(t,this,e,r)}:t,[function(t,r){var n=requireObjectCoercible$1(this),o=isNullOrUndefined$1(t)?void 0:getMethod$1(t,e);return o?call$c(o,t,n,r):call$c(i,toString$7(n),t,r)},function(e,n){var o=anObject$5(this),a=toString$7(e),s=r(i,o,a,n,i!==t);if(s.done)return s.value;var l=speciesConstructor$1(o,RegExp),c=o.unicode,u=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(UNSUPPORTED_Y$1?"g":"y"),h=new l(UNSUPPORTED_Y$1?"^(?:"+o.source+")":o,u),d=void 0===n?MAX_UINT32:n>>>0;if(0===d)return[];if(0===a.length)return null===callRegExpExec(h,a)?[a]:[];for(var p=0,f=0,g=[];f<a.length;){h.lastIndex=UNSUPPORTED_Y$1?0:f;var y,v=callRegExpExec(h,UNSUPPORTED_Y$1?stringSlice$4(a,f):a);if(null===v||(y=min$2(toLength$5(h.lastIndex+(UNSUPPORTED_Y$1?f:0)),a.length))===p)f=advanceStringIndex$1(a,f,c);else{if(push$6(g,stringSlice$4(a,p,f)),g.length===d)return g;for(var m=1;m<=v.length-1;m++)if(push$6(g,v[m]),g.length===d)return g;f=p=y}}return push$6(g,stringSlice$4(a,p)),g}]}),!SPLIT_WORKS_WITH_OVERWRITTEN_EXEC,UNSUPPORTED_Y$1);var es_string_trim={},PROPER_FUNCTION_NAME$2=functionName.PROPER,fails$l=fails$K,whitespaces$1=whitespaces$3,non="​…᠎",stringTrimForced=function(e){return fails$l((function(){return!!whitespaces$1[e]()||non[e]()!==non||PROPER_FUNCTION_NAME$2&&whitespaces$1[e].name!==e}))},$$m=_export,$trim=stringTrim.trim,forcedStringTrimMethod=stringTrimForced;$$m({target:"String",proto:!0,forced:forcedStringTrimMethod("trim")},{trim:function(){return $trim(this)}});var es_array_filter={},$$l=_export,$filter$1=arrayIteration.filter,arrayMethodHasSpeciesSupport$1=arrayMethodHasSpeciesSupport$5,HAS_SPECIES_SUPPORT$1=arrayMethodHasSpeciesSupport$1("filter");$$l({target:"Array",proto:!0,forced:!HAS_SPECIES_SUPPORT$1},{filter:function(e){return $filter$1(this,e,arguments.length>1?arguments[1]:void 0)}});var es_string_match={},call$b=functionCall,fixRegExpWellKnownSymbolLogic=fixRegexpWellKnownSymbolLogic,anObject$4=anObject$k,isNullOrUndefined=isNullOrUndefined$7,toLength$4=toLength$8,toString$6=toString$f,requireObjectCoercible=requireObjectCoercible$9,getMethod=getMethod$6,advanceStringIndex=advanceStringIndex$3,regExpExec=regexpExecAbstract;fixRegExpWellKnownSymbolLogic("match",(function(e,t,r){return[function(t){var r=requireObjectCoercible(this),i=isNullOrUndefined(t)?void 0:getMethod(t,e);return i?call$b(i,t,r):new RegExp(t)[e](toString$6(r))},function(e){var i=anObject$4(this),n=toString$6(e),o=r(t,i,n);if(o.done)return o.value;if(!i.global)return regExpExec(i,n);var a=i.unicode;i.lastIndex=0;for(var s,l=[],c=0;null!==(s=regExpExec(i,n));){var u=toString$6(s[0]);l[c]=u,""===u&&(i.lastIndex=advanceStringIndex(n,toLength$4(i.lastIndex),a)),c++}return 0===c?null:l}]}));var es_regexp_constructor={},defineProperty$8=objectDefineProperty.f,proxyAccessor$1=function(e,t,r){r in e||defineProperty$8(e,r,{configurable:!0,get:function(){return t[r]},set:function(e){t[r]=e}})},DESCRIPTORS$a=descriptors,global$k=global$H,uncurryThis$j=functionUncurryThis,isForced=isForced_1,inheritIfRequired$1=inheritIfRequired$3,createNonEnumerableProperty$5=createNonEnumerableProperty$a,getOwnPropertyNames$2=objectGetOwnPropertyNames.f,isPrototypeOf$4=objectIsPrototypeOf,isRegExp=isRegexp,toString$5=toString$f,getRegExpFlags=regexpGetFlags,stickyHelpers=regexpStickyHelpers,proxyAccessor=proxyAccessor$1,defineBuiltIn$9=defineBuiltIn$i,fails$k=fails$K,hasOwn$b=hasOwnProperty_1,enforceInternalState$2=internalState.enforce,setSpecies$1=setSpecies$3,wellKnownSymbol$c=wellKnownSymbol$t,UNSUPPORTED_DOT_ALL=regexpUnsupportedDotAll,UNSUPPORTED_NCG=regexpUnsupportedNcg,MATCH=wellKnownSymbol$c("match"),NativeRegExp=global$k.RegExp,RegExpPrototype=NativeRegExp.prototype,SyntaxError$1=global$k.SyntaxError,exec$3=uncurryThis$j(RegExpPrototype.exec),charAt$5=uncurryThis$j("".charAt),replace$5=uncurryThis$j("".replace),stringIndexOf=uncurryThis$j("".indexOf),stringSlice$3=uncurryThis$j("".slice),IS_NCG=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,re1=/a/g,re2=/a/g,CORRECT_NEW=new NativeRegExp(re1)!==re1,MISSED_STICKY=stickyHelpers.MISSED_STICKY,UNSUPPORTED_Y=stickyHelpers.UNSUPPORTED_Y,BASE_FORCED=DESCRIPTORS$a&&(!CORRECT_NEW||MISSED_STICKY||UNSUPPORTED_DOT_ALL||UNSUPPORTED_NCG||fails$k((function(){return re2[MATCH]=!1,NativeRegExp(re1)!=re1||NativeRegExp(re2)==re2||"/a/i"!=NativeRegExp(re1,"i")}))),handleDotAll=function(e){for(var t,r=e.length,i=0,n="",o=!1;i<=r;i++)"\\"!==(t=charAt$5(e,i))?o||"."!==t?("["===t?o=!0:"]"===t&&(o=!1),n+=t):n+="[\\s\\S]":n+=t+charAt$5(e,++i);return n},handleNCG=function(e){for(var t,r=e.length,i=0,n="",o=[],a={},s=!1,l=!1,c=0,u="";i<=r;i++){if("\\"===(t=charAt$5(e,i)))t+=charAt$5(e,++i);else if("]"===t)s=!1;else if(!s)switch(!0){case"["===t:s=!0;break;case"("===t:exec$3(IS_NCG,stringSlice$3(e,i+1))&&(i+=2,l=!0),n+=t,c++;continue;case">"===t&&l:if(""===u||hasOwn$b(a,u))throw new SyntaxError$1("Invalid capture group name");a[u]=!0,o[o.length]=[u,c],l=!1,u="";continue}l?u+=t:n+=t}return[n,o]};if(isForced("RegExp",BASE_FORCED)){for(var RegExpWrapper=function(e,t){var r,i,n,o,a,s,l=isPrototypeOf$4(RegExpPrototype,this),c=isRegExp(e),u=void 0===t,h=[],d=e;if(!l&&c&&u&&e.constructor===RegExpWrapper)return e;if((c||isPrototypeOf$4(RegExpPrototype,e))&&(e=e.source,u&&(t=getRegExpFlags(d))),e=void 0===e?"":toString$5(e),t=void 0===t?"":toString$5(t),d=e,UNSUPPORTED_DOT_ALL&&"dotAll"in re1&&(i=!!t&&stringIndexOf(t,"s")>-1)&&(t=replace$5(t,/s/g,"")),r=t,MISSED_STICKY&&"sticky"in re1&&(n=!!t&&stringIndexOf(t,"y")>-1)&&UNSUPPORTED_Y&&(t=replace$5(t,/y/g,"")),UNSUPPORTED_NCG&&(e=(o=handleNCG(e))[0],h=o[1]),a=inheritIfRequired$1(NativeRegExp(e,t),l?this:RegExpPrototype,RegExpWrapper),(i||n||h.length)&&(s=enforceInternalState$2(a),i&&(s.dotAll=!0,s.raw=RegExpWrapper(handleDotAll(e),r)),n&&(s.sticky=!0),h.length&&(s.groups=h)),e!==d)try{createNonEnumerableProperty$5(a,"source",""===d?"(?:)":d)}catch(error){}return a},keys$1=getOwnPropertyNames$2(NativeRegExp),index$4=0;keys$1.length>index$4;)proxyAccessor(RegExpWrapper,NativeRegExp,keys$1[index$4++]);RegExpPrototype.constructor=RegExpWrapper,RegExpWrapper.prototype=RegExpPrototype,defineBuiltIn$9(global$k,"RegExp",RegExpWrapper,{constructor:!0})}setSpecies$1("RegExp");var es_symbol={},objectGetOwnPropertyNamesExternal={},classof$5=classofRaw$2,toIndexedObject$6=toIndexedObject$c,$getOwnPropertyNames$1=objectGetOwnPropertyNames.f,arraySlice$8=arraySliceSimple,windowNames="object"==("undefined"==typeof window?"undefined":_typeof$4(window))&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],getWindowNames=function(e){try{return $getOwnPropertyNames$1(e)}catch(error){return arraySlice$8(windowNames)}};objectGetOwnPropertyNamesExternal.f=function(e){return windowNames&&"Window"==classof$5(e)?getWindowNames(e):$getOwnPropertyNames$1(toIndexedObject$6(e))};var wellKnownSymbolWrapped={},wellKnownSymbol$b=wellKnownSymbol$t;wellKnownSymbolWrapped.f=wellKnownSymbol$b;var global$j=global$H,path$1=global$j,path=path$1,hasOwn$a=hasOwnProperty_1,wrappedWellKnownSymbolModule$1=wellKnownSymbolWrapped,defineProperty$7=objectDefineProperty.f,wellKnownSymbolDefine=function(e){var t=path.Symbol||(path.Symbol={});hasOwn$a(t,e)||defineProperty$7(t,e,{value:wrappedWellKnownSymbolModule$1.f(e)})},call$a=functionCall,getBuiltIn$3=getBuiltIn$d,wellKnownSymbol$a=wellKnownSymbol$t,defineBuiltIn$8=defineBuiltIn$i,symbolDefineToPrimitive=function(){var e=getBuiltIn$3("Symbol"),t=e&&e.prototype,r=t&&t.valueOf,i=wellKnownSymbol$a("toPrimitive");t&&!t[i]&&defineBuiltIn$8(t,i,(function(e){return call$a(r,this)}),{arity:1})},$$k=_export,global$i=global$H,call$9=functionCall,uncurryThis$i=functionUncurryThis,DESCRIPTORS$9=descriptors,NATIVE_SYMBOL$4=symbolConstructorDetection,fails$j=fails$K,hasOwn$9=hasOwnProperty_1,isPrototypeOf$3=objectIsPrototypeOf,anObject$3=anObject$k,toIndexedObject$5=toIndexedObject$c,toPropertyKey$1=toPropertyKey$5,$toString$2=toString$f,createPropertyDescriptor$3=createPropertyDescriptor$7,nativeObjectCreate=objectCreate,objectKeys$2=objectKeys$4,getOwnPropertyNamesModule=objectGetOwnPropertyNames,getOwnPropertyNamesExternal=objectGetOwnPropertyNamesExternal,getOwnPropertySymbolsModule$2=objectGetOwnPropertySymbols,getOwnPropertyDescriptorModule$1=objectGetOwnPropertyDescriptor,definePropertyModule$1=objectDefineProperty,definePropertiesModule=objectDefineProperties,propertyIsEnumerableModule$1=objectPropertyIsEnumerable,defineBuiltIn$7=defineBuiltIn$i,shared$2=shared$7.exports,sharedKey$1=sharedKey$4,hiddenKeys=hiddenKeys$5,uid$1=uid$4,wellKnownSymbol$9=wellKnownSymbol$t,wrappedWellKnownSymbolModule=wellKnownSymbolWrapped,defineWellKnownSymbol=wellKnownSymbolDefine,defineSymbolToPrimitive=symbolDefineToPrimitive,setToStringTag$5=setToStringTag$7,InternalStateModule$7=internalState,$forEach$1=arrayIteration.forEach,HIDDEN=sharedKey$1("hidden"),SYMBOL="Symbol",PROTOTYPE$1="prototype",setInternalState$6=InternalStateModule$7.set,getInternalState$5=InternalStateModule$7.getterFor(SYMBOL),ObjectPrototype$4=Object[PROTOTYPE$1],$Symbol=global$i.Symbol,SymbolPrototype$1=$Symbol&&$Symbol[PROTOTYPE$1],TypeError$4=global$i.TypeError,QObject=global$i.QObject,nativeGetOwnPropertyDescriptor$1=getOwnPropertyDescriptorModule$1.f,nativeDefineProperty$1=definePropertyModule$1.f,nativeGetOwnPropertyNames=getOwnPropertyNamesExternal.f,nativePropertyIsEnumerable=propertyIsEnumerableModule$1.f,push$5=uncurryThis$i([].push),AllSymbols=shared$2("symbols"),ObjectPrototypeSymbols=shared$2("op-symbols"),WellKnownSymbolsStore=shared$2("wks"),USE_SETTER=!QObject||!QObject[PROTOTYPE$1]||!QObject[PROTOTYPE$1].findChild,setSymbolDescriptor=DESCRIPTORS$9&&fails$j((function(){return 7!=nativeObjectCreate(nativeDefineProperty$1({},"a",{get:function(){return nativeDefineProperty$1(this,"a",{value:7}).a}})).a}))?function(e,t,r){var i=nativeGetOwnPropertyDescriptor$1(ObjectPrototype$4,t);i&&delete ObjectPrototype$4[t],nativeDefineProperty$1(e,t,r),i&&e!==ObjectPrototype$4&&nativeDefineProperty$1(ObjectPrototype$4,t,i)}:nativeDefineProperty$1,wrap$1=function(e,t){var r=AllSymbols[e]=nativeObjectCreate(SymbolPrototype$1);return setInternalState$6(r,{type:SYMBOL,tag:e,description:t}),DESCRIPTORS$9||(r.description=t),r},$defineProperty=function(e,t,r){e===ObjectPrototype$4&&$defineProperty(ObjectPrototypeSymbols,t,r),anObject$3(e);var i=toPropertyKey$1(t);return anObject$3(r),hasOwn$9(AllSymbols,i)?(r.enumerable?(hasOwn$9(e,HIDDEN)&&e[HIDDEN][i]&&(e[HIDDEN][i]=!1),r=nativeObjectCreate(r,{enumerable:createPropertyDescriptor$3(0,!1)})):(hasOwn$9(e,HIDDEN)||nativeDefineProperty$1(e,HIDDEN,createPropertyDescriptor$3(1,{})),e[HIDDEN][i]=!0),setSymbolDescriptor(e,i,r)):nativeDefineProperty$1(e,i,r)},$defineProperties=function(e,t){anObject$3(e);var r=toIndexedObject$5(t),i=objectKeys$2(r).concat($getOwnPropertySymbols(r));return $forEach$1(i,(function(t){DESCRIPTORS$9&&!call$9($propertyIsEnumerable$1,r,t)||$defineProperty(e,t,r[t])})),e},$create=function(e,t){return void 0===t?nativeObjectCreate(e):$defineProperties(nativeObjectCreate(e),t)},$propertyIsEnumerable$1=function(e){var t=toPropertyKey$1(e),r=call$9(nativePropertyIsEnumerable,this,t);return!(this===ObjectPrototype$4&&hasOwn$9(AllSymbols,t)&&!hasOwn$9(ObjectPrototypeSymbols,t))&&(!(r||!hasOwn$9(this,t)||!hasOwn$9(AllSymbols,t)||hasOwn$9(this,HIDDEN)&&this[HIDDEN][t])||r)},$getOwnPropertyDescriptor=function(e,t){var r=toIndexedObject$5(e),i=toPropertyKey$1(t);if(r!==ObjectPrototype$4||!hasOwn$9(AllSymbols,i)||hasOwn$9(ObjectPrototypeSymbols,i)){var n=nativeGetOwnPropertyDescriptor$1(r,i);return!n||!hasOwn$9(AllSymbols,i)||hasOwn$9(r,HIDDEN)&&r[HIDDEN][i]||(n.enumerable=!0),n}},$getOwnPropertyNames=function(e){var t=nativeGetOwnPropertyNames(toIndexedObject$5(e)),r=[];return $forEach$1(t,(function(e){hasOwn$9(AllSymbols,e)||hasOwn$9(hiddenKeys,e)||push$5(r,e)})),r},$getOwnPropertySymbols=function(e){var t=e===ObjectPrototype$4,r=nativeGetOwnPropertyNames(t?ObjectPrototypeSymbols:toIndexedObject$5(e)),i=[];return $forEach$1(r,(function(e){!hasOwn$9(AllSymbols,e)||t&&!hasOwn$9(ObjectPrototype$4,e)||push$5(i,AllSymbols[e])})),i};NATIVE_SYMBOL$4||($Symbol=function(){if(isPrototypeOf$3(SymbolPrototype$1,this))throw TypeError$4("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?$toString$2(arguments[0]):void 0,t=uid$1(e),r=function e(r){this===ObjectPrototype$4&&call$9(e,ObjectPrototypeSymbols,r),hasOwn$9(this,HIDDEN)&&hasOwn$9(this[HIDDEN],t)&&(this[HIDDEN][t]=!1),setSymbolDescriptor(this,t,createPropertyDescriptor$3(1,r))};return DESCRIPTORS$9&&USE_SETTER&&setSymbolDescriptor(ObjectPrototype$4,t,{configurable:!0,set:r}),wrap$1(t,e)},SymbolPrototype$1=$Symbol[PROTOTYPE$1],defineBuiltIn$7(SymbolPrototype$1,"toString",(function(){return getInternalState$5(this).tag})),defineBuiltIn$7($Symbol,"withoutSetter",(function(e){return wrap$1(uid$1(e),e)})),propertyIsEnumerableModule$1.f=$propertyIsEnumerable$1,definePropertyModule$1.f=$defineProperty,definePropertiesModule.f=$defineProperties,getOwnPropertyDescriptorModule$1.f=$getOwnPropertyDescriptor,getOwnPropertyNamesModule.f=getOwnPropertyNamesExternal.f=$getOwnPropertyNames,getOwnPropertySymbolsModule$2.f=$getOwnPropertySymbols,wrappedWellKnownSymbolModule.f=function(e){return wrap$1(wellKnownSymbol$9(e),e)},DESCRIPTORS$9&&(nativeDefineProperty$1(SymbolPrototype$1,"description",{configurable:!0,get:function(){return getInternalState$5(this).description}}),defineBuiltIn$7(ObjectPrototype$4,"propertyIsEnumerable",$propertyIsEnumerable$1,{unsafe:!0}))),$$k({global:!0,constructor:!0,wrap:!0,forced:!NATIVE_SYMBOL$4,sham:!NATIVE_SYMBOL$4},{Symbol:$Symbol}),$forEach$1(objectKeys$2(WellKnownSymbolsStore),(function(e){defineWellKnownSymbol(e)})),$$k({target:SYMBOL,stat:!0,forced:!NATIVE_SYMBOL$4},{useSetter:function(){USE_SETTER=!0},useSimple:function(){USE_SETTER=!1}}),$$k({target:"Object",stat:!0,forced:!NATIVE_SYMBOL$4,sham:!DESCRIPTORS$9},{create:$create,defineProperty:$defineProperty,defineProperties:$defineProperties,getOwnPropertyDescriptor:$getOwnPropertyDescriptor}),$$k({target:"Object",stat:!0,forced:!NATIVE_SYMBOL$4},{getOwnPropertyNames:$getOwnPropertyNames}),defineSymbolToPrimitive(),setToStringTag$5($Symbol,SYMBOL),hiddenKeys[HIDDEN]=!0;var NATIVE_SYMBOL$3=symbolConstructorDetection,symbolRegistryDetection=NATIVE_SYMBOL$3&&!!Symbol.for&&!!Symbol.keyFor,$$j=_export,getBuiltIn$2=getBuiltIn$d,hasOwn$8=hasOwnProperty_1,toString$4=toString$f,shared$1=shared$7.exports,NATIVE_SYMBOL_REGISTRY$1=symbolRegistryDetection,StringToSymbolRegistry=shared$1("string-to-symbol-registry"),SymbolToStringRegistry$1=shared$1("symbol-to-string-registry");$$j({target:"Symbol",stat:!0,forced:!NATIVE_SYMBOL_REGISTRY$1},{for:function(e){var t=toString$4(e);if(hasOwn$8(StringToSymbolRegistry,t))return StringToSymbolRegistry[t];var r=getBuiltIn$2("Symbol")(t);return StringToSymbolRegistry[t]=r,SymbolToStringRegistry$1[r]=t,r}});var $$i=_export,hasOwn$7=hasOwnProperty_1,isSymbol$2=isSymbol$6,tryToString$1=tryToString$7,shared=shared$7.exports,NATIVE_SYMBOL_REGISTRY=symbolRegistryDetection,SymbolToStringRegistry=shared("symbol-to-string-registry");$$i({target:"Symbol",stat:!0,forced:!NATIVE_SYMBOL_REGISTRY},{keyFor:function(e){if(!isSymbol$2(e))throw TypeError(tryToString$1(e)+" is not a symbol");if(hasOwn$7(SymbolToStringRegistry,e))return SymbolToStringRegistry[e]}});var $$h=_export,getBuiltIn$1=getBuiltIn$d,apply$6=functionApply,call$8=functionCall,uncurryThis$h=functionUncurryThis,fails$i=fails$K,isArray$1=isArray$5,isCallable$7=isCallable$t,isObject$9=isObject$l,isSymbol$1=isSymbol$6,arraySlice$7=arraySlice$b,NATIVE_SYMBOL$2=symbolConstructorDetection,$stringify=getBuiltIn$1("JSON","stringify"),exec$2=uncurryThis$h(/./.exec),charAt$4=uncurryThis$h("".charAt),charCodeAt$1=uncurryThis$h("".charCodeAt),replace$4=uncurryThis$h("".replace),numberToString$1=uncurryThis$h(1..toString),tester=/[\uD800-\uDFFF]/g,low=/^[\uD800-\uDBFF]$/,hi=/^[\uDC00-\uDFFF]$/,WRONG_SYMBOLS_CONVERSION=!NATIVE_SYMBOL$2||fails$i((function(){var e=getBuiltIn$1("Symbol")();return"[null]"!=$stringify([e])||"{}"!=$stringify({a:e})||"{}"!=$stringify(Object(e))})),ILL_FORMED_UNICODE=fails$i((function(){return'"\\udf06\\ud834"'!==$stringify("\udf06\ud834")||'"\\udead"'!==$stringify("\udead")})),stringifyWithSymbolsFix=function(e,t){var r=arraySlice$7(arguments),i=t;if((isObject$9(t)||void 0!==e)&&!isSymbol$1(e))return isArray$1(t)||(t=function(e,t){if(isCallable$7(i)&&(t=call$8(i,this,e,t)),!isSymbol$1(t))return t}),r[1]=t,apply$6($stringify,null,r)},fixIllFormed=function(e,t,r){var i=charAt$4(r,t-1),n=charAt$4(r,t+1);return exec$2(low,e)&&!exec$2(hi,n)||exec$2(hi,e)&&!exec$2(low,i)?"\\u"+numberToString$1(charCodeAt$1(e,0),16):e};$stringify&&$$h({target:"JSON",stat:!0,arity:3,forced:WRONG_SYMBOLS_CONVERSION||ILL_FORMED_UNICODE},{stringify:function(e,t,r){var i=arraySlice$7(arguments),n=apply$6(WRONG_SYMBOLS_CONVERSION?stringifyWithSymbolsFix:$stringify,null,i);return ILL_FORMED_UNICODE&&"string"==typeof n?replace$4(n,tester,fixIllFormed):n}});var $$g=_export,NATIVE_SYMBOL$1=symbolConstructorDetection,fails$h=fails$K,getOwnPropertySymbolsModule$1=objectGetOwnPropertySymbols,toObject$9=toObject$g,FORCED$5=!NATIVE_SYMBOL$1||fails$h((function(){getOwnPropertySymbolsModule$1.f(1)}));$$g({target:"Object",stat:!0,forced:FORCED$5},{getOwnPropertySymbols:function(e){var t=getOwnPropertySymbolsModule$1.f;return t?t(toObject$9(e)):[]}});var es_symbol_description={},$$f=_export,DESCRIPTORS$8=descriptors,global$h=global$H,uncurryThis$g=functionUncurryThis,hasOwn$6=hasOwnProperty_1,isCallable$6=isCallable$t,isPrototypeOf$2=objectIsPrototypeOf,toString$3=toString$f,defineProperty$6=objectDefineProperty.f,copyConstructorProperties=copyConstructorProperties$2,NativeSymbol=global$h.Symbol,SymbolPrototype=NativeSymbol&&NativeSymbol.prototype;if(DESCRIPTORS$8&&isCallable$6(NativeSymbol)&&(!("description"in SymbolPrototype)||void 0!==NativeSymbol().description)){var EmptyStringDescriptionStore={},SymbolWrapper=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:toString$3(arguments[0]),t=isPrototypeOf$2(SymbolPrototype,this)?new NativeSymbol(e):void 0===e?NativeSymbol():NativeSymbol(e);return""===e&&(EmptyStringDescriptionStore[t]=!0),t};copyConstructorProperties(SymbolWrapper,NativeSymbol),SymbolWrapper.prototype=SymbolPrototype,SymbolPrototype.constructor=SymbolWrapper;var NATIVE_SYMBOL="Symbol(test)"==String(NativeSymbol("test")),thisSymbolValue=uncurryThis$g(SymbolPrototype.valueOf),symbolDescriptiveString=uncurryThis$g(SymbolPrototype.toString),regexp=/^Symbol\((.*)\)[^)]+$/,replace$3=uncurryThis$g("".replace),stringSlice$2=uncurryThis$g("".slice);defineProperty$6(SymbolPrototype,"description",{configurable:!0,get:function(){var e=thisSymbolValue(this);if(hasOwn$6(EmptyStringDescriptionStore,e))return"";var t=symbolDescriptiveString(e),r=NATIVE_SYMBOL?stringSlice$2(t,7,-1):replace$3(t,regexp,"$1");return""===r?void 0:r}}),$$f({global:!0,constructor:!0,forced:!0},{Symbol:SymbolWrapper})}(function(module,exports){var t2;t2=function(){var __assign=function(){return(__assign=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};function __rest(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(e);n<i.length;n++)t.indexOf(i[n])<0&&(r[i[n]]=e[i[n]])}return r}function __values(e){var t="function"==typeof Symbol&&e[Symbol.iterator],r=0;return t?t.call(e):{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}function __read(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(s){n={error:s}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return a}function __spread(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(__read(arguments[t]));return e}var Hook=function(){function e(){this._hooks={},this._cache=[],this._hooksCache={}}return e.prototype.on=function(e,t){e&&t&&"function"==typeof t&&(this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(t))},e.prototype.once=function(e,t){var r=this;e&&t&&"function"==typeof t&&this.on(e,(function i(n){t(n),r.off(e,i)}))},e.prototype.off=function(e,t){if(e&&this._hooks[e]&&this._hooks[e].length)if(t){var r=this._hooks[e].indexOf(t);-1!==r&&this._hooks[e].splice(r,1)}else this._hooks[e]=[]},e.prototype.emit=function(e,t,r){if(r){if(!e)return;-1!==this._cache.indexOf(r)?this._emit(e,t):(this._hooksCache.hasOwnProperty(r)||(this._hooksCache[r]={}),this._hooksCache[r].hasOwnProperty(e)||(this._hooksCache[r][e]=[]),this._hooksCache[r][e].push(t))}else this._emit(e,t)},e.prototype._emit=function(e,t){e&&this._hooks[e]&&this._hooks[e].length&&__spread(this._hooks[e]).forEach((function(e){try{e(t)}catch(r){}}))},e.prototype.set=function(e){e&&-1===this._cache.indexOf(e)&&this._cache.push(e)},e}(),isObject$1=function(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)},isNumber=function(e){return"number"==typeof e&&!isNaN(e)},isString=function(e){return"string"==typeof e},isArray=function(e){return Array.isArray(e)},getIndex=(lastEventId=+Date.now()+Number((""+Math.random()).slice(2,8)),function(){return lastEventId+=1}),lastEventId,decrypto=function(e,t,r){if("string"==typeof e&&"number"==typeof t&&"number"==typeof r){var i,n=[];r=r<=25?r:r%25;var o=String.fromCharCode(r+97);i=e.split(o);for(var a=0;a<i.length;a++){var s=parseInt(i[a],r);s=1*s^t;var l=String.fromCharCode(s);n.push(l)}return n.join("")}},decodeUrl=function(e){return decrypto(e,64,25)},beforePageUnload=function(e){navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)?window.addEventListener("pagehide",e,!1):window.addEventListener("beforeunload",e,!1)},getIframeUrl=function(){try{return JSON.parse(atob(window.name))||void 0}catch(e2){return}},loadScript=function(e,t,r){var i=document.createElement("script");i.src=e,i.onerror=function(){r(e)},i.onload=function(){t()},document.getElementsByTagName("head")[0].appendChild(i)},isSupVisChange=function(){var e=0;return["hidden","msHidden","webkitHidden"].forEach((function(t){void 0!==document[t]&&(e=1)})),e},selfAdjust=function(e,t){void 0===e&&(e=function(){}),void 0===t&&(t=1e3);var r,i=Date.now()+t;return r=window.setTimeout((function n(){var o=Date.now()-i;e(),i+=t,r=window.setTimeout(n,Math.max(0,t-o))}),t),function(){window.clearTimeout(r)}},parseURL=function(e){var t=document.createElement("a");return t.href=e,t},parseUrlQuery=function(e){var t={};try{var r=parseURL(e).search;if(!r)return t;(r=r.slice(1)).split("&").forEach((function(e){var r,i,n=e.split("=");n.length&&(r=n[0],i=n[1]);try{t[r]=decodeURIComponent(void 0===i?"":i)}catch(o){t[r]=i}}))}catch(i){}return t},hashCode=function(e){for(var t=0,r=0,i=(e+="").length,n=0;n<i;n++)((t=31*t+e.charCodeAt(r++))>0x7fffffffffff||t<-0x800000000000)&&(t&=0xffffffffffff);return t<0&&(t+=0x7ffffffffffff),t};function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var js_cookie=createCommonjsModule((function(e,t){var r;r=function(){function e(){for(var e=0,t={};e<arguments.length;e++){var r=arguments[e];for(var i in r)t[i]=r[i]}return t}function t(e){return e.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function r(i){function n(){}function o(t,r,o){if("undefined"!=typeof document){"number"==typeof(o=e({path:"/"},n.defaults,o)).expires&&(o.expires=new Date(1*new Date+864e5*o.expires)),o.expires=o.expires?o.expires.toUTCString():"";try{var a=JSON.stringify(r);/^[\{\[]/.test(a)&&(r=a)}catch(c){}r=i.write?i.write(r,t):encodeURIComponent(String(r)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var s="";for(var l in o)o[l]&&(s+="; "+l,!0!==o[l]&&(s+="="+o[l].split(";")[0]));return document.cookie=t+"="+r+s}}function a(e,r){if("undefined"!=typeof document){for(var n={},o=document.cookie?document.cookie.split("; "):[],a=0;a<o.length;a++){var s=o[a].split("="),l=s.slice(1).join("=");r||'"'!==l.charAt(0)||(l=l.slice(1,-1));try{var c=t(s[0]);if(l=(i.read||i)(l,c)||t(l),r)try{l=JSON.parse(l)}catch(u){}if(n[c]=l,e===c)break}catch(u){}}return e?n[e]:n}}return n.set=o,n.get=function(e){return a(e,!1)},n.getJSON=function(e){return a(e,!0)},n.remove=function(t,r){o(t,"",e(r,{expires:-1}))},n.defaults={},n.withConverter=r,n}((function(){}))},e.exports=r()})),_getCookie=function(e,t){try{return e?js_cookie.get(e,{domain:t||document.domain}):js_cookie.get()}catch(r){return""}},_setCookie=function(e,t,r,i){try{var n=i||document.domain,o=+new Date+(r||6048e5);js_cookie.set(e,t,{expires:new Date(o),path:"/",domain:n})}catch(a){}},Memory=function(){function e(){this.cache={}}return e.prototype.setItem=function(e,t){this.cache[e]=t},e.prototype.getItem=function(e){return this.cache[e]},e.prototype.removeItem=function(e){this.cache[e]=void 0},e.prototype.getCookie=function(e,t){return _getCookie(e,t)},e.prototype.setCookie=function(e,t,r,i){_setCookie(e,t,r,i)},e}();function isSupportLS(){try{return localStorage.setItem("_ranger-test-key","hi"),localStorage.getItem("_ranger-test-key"),localStorage.removeItem("_ranger-test-key"),!0}catch(e2){return!1}}function isSupportSession(){try{return sessionStorage.setItem("_ranger-test-key","hi"),sessionStorage.getItem("_ranger-test-key"),sessionStorage.removeItem("_ranger-test-key"),!0}catch(e2){return!1}}var local={getItem:function(e){try{var t=localStorage.getItem(e),r=t;try{t&&"string"==typeof t&&(r=JSON.parse(t))}catch(i){}return r||{}}catch(i){}return{}},setItem:function(e,t){try{var r="string"==typeof t?t:JSON.stringify(t);localStorage.setItem(e,r)}catch(i){}},removeItem:function(e){try{localStorage.removeItem(e)}catch(t2){}},getCookie:function(e,t){return _getCookie(e,t)},setCookie:function(e,t,r,i){_setCookie(e,t,r,i)},isSupportLS:isSupportLS()},session={getItem:function(e){try{var t=sessionStorage.getItem(e),r=t;try{t&&"string"==typeof t&&(r=JSON.parse(t))}catch(i){}return r||{}}catch(i){}return{}},setItem:function(e,t){try{var r="string"==typeof t?t:JSON.stringify(t);sessionStorage.setItem(e,r)}catch(i){}},removeItem:function(e){try{sessionStorage.removeItem(e)}catch(t2){}},getCookie:function(e,t){return _getCookie(e,t)},setCookie:function(e,t,r,i){_setCookie(e,t,r,i)},isSupportSession:isSupportSession()},Storage=function(){function e(e,t){this._storage=t&&"session"===t?session:!e&&local.isSupportLS?local:new Memory}return e.prototype.getItem=function(e){return this._storage.getItem(e)},e.prototype.setItem=function(e,t){this._storage.setItem(e,t)},e.prototype.getCookie=function(e,t){return this._storage.getCookie(e,t)},e.prototype.setCookie=function(e,t,r,i){this._storage.setCookie(e,t,r,i)},e.prototype.removeItem=function(e){this._storage.removeItem(e)},e}(),UTM=function(e,t,r,i){var n=new Storage(!1),o=new Storage(!1,"session"),a=e?"_tea_utm_cache_"+e:"_tea_utm_cache",s=e?"_$utm_from_url_"+e:"_$utm_from_url",l={},c=["tr_shareuser","tr_admaster","tr_param1","tr_param2","tr_param3","tr_param4","$utm_from_url"],u={ad_id:Number(t.ad_id)||void 0,campaign_id:Number(t.campaign_id)||void 0,creative_id:Number(t.creative_id)||void 0,utm_source:t.utm_source,utm_medium:t.utm_medium,utm_campaign:t.utm_campaign,utm_term:t.utm_term,utm_content:t.utm_content,tr_shareuser:t.tr_shareuser,tr_admaster:t.tr_admaster,tr_param1:t.tr_param1,tr_param2:t.tr_param2,tr_param3:t.tr_param3,tr_param4:t.tr_param4};try{var h=!1;for(var d in u)u[d]&&(-1!==c.indexOf(d)?(l.hasOwnProperty("tracer_data")||(l.tracer_data={}),l.tracer_data[d]=u[d]):l[d]=u[d],h=!0);if(h)o.setItem(s,"1"),n.setCookie(a,JSON.stringify(l),i,r);else{var p=n.getCookie(a,r);p&&(l=JSON.parse(p))}o.getItem(s)&&(l.hasOwnProperty("tracer_data")||(l.tracer_data={}),l.tracer_data.$utm_from_url=1)}catch(f){return u}return l},Client=function(){function e(e,t,r){this.appid=e,this.domain=t,this.userAgent=window.navigator.userAgent,this.appVersion=window.navigator.appVersion,this.cookie_expire=r}return e.prototype.init=function(){var e=window.navigator.userAgent,t=window.navigator.language,r=document.referrer,i=r?parseURL(r).hostname:"",n=parseUrlQuery(window.location.href),o=/Mobile|htc|mini|Android|iP(ad|od|hone)/.test(this.appVersion)?"wap":"web";this.utm=UTM(this.appid,n,this.domain,this.cookie_expire);var a=this.browser(),s=this.os();return{browser:a.browser,browser_version:a.browser_version,platform:o,os_name:s.os_name,os_version:s.os_version,userAgent:e,screen_width:window.screen&&window.screen.width,screen_height:window.screen&&window.screen.height,device_model:this.getDeviceModel(s.os_name),language:t,referrer:r,referrer_host:i,utm:this.utm,latest_data:this.last(r,i)}},e.prototype.last=function(e,t){var r="",i="",n="",o=location.hostname,a=!1;if(e&&t&&o!==t){r=e,i=t,a=!0;var s=parseUrlQuery(e);s.keyword&&(n=s.keyword)}return{$latest_referrer:r,$latest_referrer_host:i,$latest_search_keyword:n,isLast:a}},e.prototype.browser=function(){var e,t,r="",i=""+parseFloat(this.appVersion),n=this.userAgent;return-1!==n.indexOf("Edge")||-1!==n.indexOf("Edg")?(r="Microsoft Edge",-1!==n.indexOf("Edge")?(e=n.indexOf("Edge"),i=n.substring(e+5)):(e=n.indexOf("Edg"),i=n.substring(e+4))):-1!==(e=n.indexOf("MSIE"))?(r="Microsoft Internet Explorer",i=n.substring(e+5)):-1!==(e=n.indexOf("Lark"))?(r="Lark",i=n.substring(e+5,e+11)):-1!==(e=n.indexOf("MetaSr"))?(r="sougoubrowser",i=n.substring(e+7,e+10)):-1!==n.indexOf("MQQBrowser")||-1!==n.indexOf("QQBrowser")?(r="qqbrowser",-1!==n.indexOf("MQQBrowser")?(e=n.indexOf("MQQBrowser"),i=n.substring(e+11,e+15)):-1!==n.indexOf("QQBrowser")&&(e=n.indexOf("QQBrowser"),i=n.substring(e+10,e+17))):-1!==n.indexOf("Chrome")?-1!==(e=n.indexOf("MicroMessenger"))?(r="weixin",i=n.substring(e+15,e+20)):-1!==(e=n.indexOf("360"))?(r="360browser",i=n.substring(n.indexOf("Chrome")+7)):-1!==n.indexOf("baidubrowser")||-1!==n.indexOf("BIDUBrowser")?(-1!==n.indexOf("baidubrowser")?(e=n.indexOf("baidubrowser"),i=n.substring(e+13,e+16)):-1!==n.indexOf("BIDUBrowser")&&(e=n.indexOf("BIDUBrowser"),i=n.substring(e+12,e+15)),r="baidubrowser"):-1!==(e=n.indexOf("xiaomi"))?-1!==n.indexOf("openlanguagexiaomi")?(r="openlanguage xiaomi",i=n.substring(e+7,e+13)):(r="xiaomi",i=n.substring(e-7,e-1)):-1!==(e=n.indexOf("TTWebView"))?(r="TTWebView",i=n.substring(e+10,e+23)):(-1!==(e=n.indexOf("Chrome"))||-1!==(e=n.indexOf("Chrome")))&&(r="Chrome",i=n.substring(e+7)):-1!==n.indexOf("Safari")?-1!==(e=n.indexOf("QQ"))?(r="qqbrowser",i=n.substring(e+10,e+16)):-1!==(e=n.indexOf("Safari"))&&(r="Safari",i=n.substring(e+7),-1!==(e=n.indexOf("Version"))&&(i=n.substring(e+8))):-1!==(e=n.indexOf("Firefox"))?(r="Firefox",i=n.substring(e+8)):-1!==(e=n.indexOf("MicroMessenger"))?(r="weixin",i=n.substring(e+15,e+20)):-1!==(e=n.indexOf("QQ"))&&(r="qqbrowser",i=n.substring(e+3,e+8)),-1!==(t=i.indexOf(";"))&&(i=i.substring(0,t)),-1!==(t=i.indexOf(" "))&&(i=i.substring(0,t)),-1!==(t=i.indexOf(")"))&&(i=i.substring(0,t)),{browser:r,browser_version:i}},e.prototype.os=function(){for(var e="",t="",r=[{s:"Windows 10",r:/(Windows 10.0|Windows NT 10.0|Windows NT 10.1)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Android",r:/Android/},{s:"Sun OS",r:/SunOS/},{s:"Linux",r:/(Linux|X11)/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/}],i=0;i<r.length;i++){var n=r[i];if(n.r.test(this.userAgent)){"Mac OS X"===(e=n.s)&&this.isNewIpad()&&(e="iOS");break}}var o,a,s=function(e,t){var r=e.exec(t);return r&&r[1]?r[1]:""},l=function(e,t){var r=RegExp("(?:^|[^A-Z0-9-_]|[^A-Z0-9-]_|sprd-)(?:"+e+")","i").exec(t);return r?r.slice(1)[0]:""};switch(/Windows/.test(e)&&(t=s(/Windows (.*)/,e),e="windows"),e){case"Mac OS X":t=l("Mac[ +]OS[ +]X(?:[ /](?:Version )?(\\d+(?:[_\\.]\\d+)+))?",this.userAgent),e="mac";break;case"Android":(a=s(/Android ([\.\_\d]+)/,o=this.userAgent))||(a=s(/Android\/([\.\_\d]+)/,o)),t=a,e="android";break;case"iOS":t=this.isNewIpad()?l("Mac[ +]OS[ +]X(?:[ /](?:Version )?(\\d+(?:[_\\.]\\d+)+))?",this.userAgent):(t=/OS (\d+)_(\d+)_?(\d+)?/.exec(this.appVersion))?t[1]+"."+t[2]+"."+(0|t[3]):"",e="ios"}return{os_name:e,os_version:t}},e.prototype.getDeviceModel=function(e){var t="";try{if("android"===e)navigator.userAgent.split(";").forEach((function(e){e.indexOf("Build/")>-1&&(t=e.slice(0,e.indexOf("Build/")))}));else if("ios"===e||"mac"===e||"windows"===e)if(this.isNewIpad())t="iPad";else{var r=navigator.userAgent.replace("Mozilla/5.0 (",""),i=r.indexOf(";");t=r.slice(0,i)}}catch(n){return t.trim()}return t.trim()},e.prototype.isNewIpad=function(){return void 0!==this.userAgent&&"MacIntel"===navigator.platform&&"number"==typeof navigator.maxTouchPoints&&navigator.maxTouchPoints>1},e}(),LOG;LOG={cn:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az28z1gz1hz1gz1cz18z1nz1gz4az1az1mz1k",sg:"1fz22z22z1nz21z4mz4bz4bz21z1ez18z1jz1gz49z1kz1az21z4az19z27z22z1cz1mz24z1cz20z21z1cz18z4az1az1mz1k",va:"1fz22z22z1nz21z4mz4bz4bz1kz18z1jz1gz24z18z49z1kz1az21z4az19z27z22z1cz1mz24z1cz20z21z1cz18z4az1az1mz1k"};var AB_DOMAINS={cn:"1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az1az22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k",va:"1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az1gz22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k",sg:"1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k"},LOG_URL=LOG,SDK_VERSION="5.0.38",SDK_USE_TYPE="npm",SDK_TYPE=SDK_USE_TYPE,VISUAL_EDITOR_RANGERS="https://lf-cdn-tos.bytescm.com/obj/static/log-sdk/collect/visual-editor-rangers.js",VISUAL_AB_CORE="https://lf-cdn-tos.bytescm.com/obj/static/log-sdk/collect/visual-ab-core.js",VISUAL_AB_LOADER="https://lf-cdn-tos.bytescm.com/obj/static/log-sdk/collect/visual-ab-loader.js",HOT_PIC_URL="https://lf-cdn-tos.bytescm.com/obj/static/log-sdk/collect/heatmap-core",VISUAL_URL_INSPECTOR="https://lf3-data.volccdn.com/obj/data-static/log-sdk/collect/tester-event-inspector",EventCheck=function(){function e(e,t){this.collector=e,this.config=t,this.eventNameWhiteList=["__bav_page","__bav_beat","__bav_page_statistics","__bav_click","__bav_page_exposure"],this.paramsNameWhiteList=["$inactive","$inline","$target_uuid_list","$source_uuid","$is_spider","$source_id","$is_first_time","_staging_flag"],this.regStr=new RegExp("^[a-zA-Z0-9][a-z0-9A-Z_.-]{1,255}$")}return e.prototype.checkVerify=function(e){var t=this;if(!e||!e.length)return!1;var r=e[0];if(!r)return!1;var i=r.events,n=r.header;if(!i||!i.length)return!1;var o=!0;return i.forEach((function(e){if(!e)return o=!1,void(e.checkEvent="事件异常");t.checkEventName(e.event)||(o=!1,e.checkEvent="事件名不能以 $ or __开头"),t.checkEventParams(e.params)||(o=!1,e.checkParams="属性名不能以 $ or __开头")})),this.checkEventParams(n)||(o=!1),o},e.prototype.checkEventName=function(e){return!!e&&this.calculate(e,"event")},e.prototype.checkEventParams=function(e){var t=e;if("string"==typeof e&&(t=JSON.parse(t)),!Object.keys(t).length)return!0;for(var r in t)return!(!this.calculate(r,"params")||"string"==typeof t[r]&&t[r].length>1024&&(console.warn("params: "+r+" can not over 1024 byte, please check;"),1));return!0},e.prototype.calculate=function(e,t){return-1!==("event"===t?this.eventNameWhiteList:this.paramsNameWhiteList).indexOf(e)||!new RegExp("^\\$").test(e)&&!new RegExp("^__").test(e)||(console.warn(("event"===t?"event":"params")+" name: "+e+" can not start with $ or __, pleace check;"),!1)},e}(),Types,DebuggerMesssge$1,e,e2;e=Types||(Types={}),e.Init="init",e.Config="config",e.Start="start",e.Ready="ready",e.TokenComplete="token-complete",e.TokenStorage="token-storage",e.TokenFetch="token-fetch",e.TokenError="token-error",e.ConfigUuid="config-uuid",e.ConfigWebId="config-webid",e.ConfigDomain="config-domain",e.CustomWebId="custom-webid",e.TokenChange="token-change",e.TokenReset="token-reset",e.ConfigTransform="config-transform",e.EnvTransform="env-transform",e.SessionReset="session-reset",e.SessionResetTime="session-reset-time",e.Event="event",e.Events="events",e.EventNow="event-now",e.CleanEvents="clean-events",e.BeconEvent="becon-event",e.SubmitBefore="submit-before",e.SubmitScuess="submit-scuess",e.SubmitAfter="submit-after",e.SubmitError="submit-error",e.SubmitVerify="submit-verify",e.Stay="stay",e.ResetStay="reset-stay",e.StayReady="stay-ready",e.SetStay="set-stay",e.RouteChange="route-change",e.RouteReady="route-ready",e.Ab="ab",e.AbVar="ab-var",e.AbAllVars="ab-all-vars",e.AbConfig="ab-config",e.AbExternalVersion="ab-external-version",e.AbVersionChangeOn="ab-version-change-on",e.AbVersionChangeOff="ab-version-change-off",e.AbOpenLayer="ab-open-layer",e.AbCloseLayer="ab-close-layer",e.AbReady="ab-ready",e.AbComplete="ab-complete",e.AbTimeout="ab-timeout",e.Profile="profile",e.ProfileSet="profile-set",e.ProfileSetOnce="profile-set-once",e.ProfileUnset="profile-unset",e.ProfileIncrement="profile-increment",e.ProfileAppend="profile-append",e.ProfileClear="profile-clear",e.Autotrack="autotrack",e.AutotrackReady="autotrack-ready",e.CepReady="cep-ready",e.TracerReady="tracer-ready",e.sessionRecord="session-record",e.SessionRecordStart="session-record-start",e.SessionRecordPause="session-record-pause",e.SessionRecordEnd="session-record-end",e.SessionRecordReport="session-record-report",e2=DebuggerMesssge$1||(DebuggerMesssge$1={}),e2.DEBUGGER_MESSAGE="debugger-message",e2.DEBUGGER_MESSAGE_SDK="debugger-message-sdk",e2.DEBUGGER_MESSAGE_FETCH="debugger-message-fetch",e2.DEBUGGER_MESSAGE_FETCH_RESULT="debugger-message-fetch-result",e2.DEBUGGER_MESSAGE_EVENT="debugger-message-event",e2.DEVTOOL_WEB_READY="devtool-web-ready";var Types$1=Types,undef=void 0,date=new Date,timeZoneMin=date.getTimezoneOffset(),timezone=parseInt(""+-timeZoneMin/60,10),tz_offset=60*timeZoneMin,WEBID_URL="/webid",TOB_URL="/tobid",REPORT_URL="/list",EXPIRE_TIME=7776e6,ConfigManager=function(){function e(e,t){this.is_first_time=!0,this.configPersist=!1,this.initConfig=t,this.collect=e;var r=new Client(t.app_id,t.cookie_domain||"",t.cookie_expire||EXPIRE_TIME).init();this.eventCheck=new EventCheck(e,t);var i="__tea_cache_first_"+t.app_id;this.configKey="__tea_cache_config_"+t.app_id,this.sessionStorage=new Storage(!1,"session"),this.localStorage=new Storage(!1,"local"),t.configPersist&&(this.configPersist=!0,this.storage=1===t.configPersist?this.sessionStorage:this.localStorage);var n=this.localStorage.getItem(i);n&&1==n?this.is_first_time=!1:(this.is_first_time=!0,this.localStorage.setItem(i,"1")),this.envInfo={user:{user_unique_id:undef,user_type:undef,user_id:undef,user_is_auth:undef,user_is_login:undef,device_id:undef,web_id:undef,ip_addr_id:undef,user_unique_id_type:undef},header:{app_id:undef,app_name:undef,app_install_id:undef,install_id:undef,app_package:undef,app_channel:undef,app_version:undef,ab_version:undef,os_name:r.os_name,os_version:r.os_version,device_model:r.device_model,ab_client:undef,traffic_type:undef,client_ip:undef,device_brand:undef,os_api:undef,access:undef,language:r.language,region:undef,app_language:undef,app_region:undef,creative_id:r.utm.creative_id,ad_id:r.utm.ad_id,campaign_id:r.utm.campaign_id,log_type:undef,rnd:undef,platform:r.platform,sdk_version:SDK_VERSION,sdk_lib:"js",province:undef,city:undef,timezone:timezone,tz_offset:tz_offset,tz_name:undef,sim_region:undef,carrier:undef,resolution:r.screen_width+"x"+r.screen_height,browser:r.browser,browser_version:r.browser_version,referrer:r.referrer,referrer_host:r.referrer_host,width:r.screen_width,height:r.screen_height,screen_width:r.screen_width,screen_height:r.screen_height,utm_term:r.utm.utm_term,utm_content:r.utm.utm_content,utm_source:r.utm.utm_source,utm_medium:r.utm.utm_medium,utm_campaign:r.utm.utm_campaign,tracer_data:JSON.stringify(r.utm.tracer_data),custom:{},wechat_unionid:undef,wechat_openid:undef}},this.ab_version="",this.evtParams={},this.reportErrorCallback=function(){},this.isLast=!1,this.setCustom(r),this.initDomain(),this.initABData()}return e.prototype.initDomain=function(){var e=this.initConfig.channel_domain;if(e)this.domain=e;else{var t=this.initConfig.channel;this.domain=decodeUrl(LOG_URL[t])}},e.prototype.setDomain=function(e){this.domain=e},e.prototype.getDomain=function(){return this.domain},e.prototype.initABData=function(){var e="__tea_sdk_ab_version_"+this.initConfig.app_id,t=null;if(this.initConfig.ab_cross){var r=this.localStorage.getCookie(e,this.initConfig.ab_cookie_domain);t=r?JSON.parse(r):null}else t=this.localStorage.getItem(e);this.setAbCache(t)},e.prototype.setAbCache=function(e){this.ab_cache=e},e.prototype.getAbCache=function(){return this.ab_cache},e.prototype.setAbVersion=function(e){this.ab_version=e},e.prototype.getAbVersion=function(){return this.ab_version},e.prototype.getUrl=function(e){var t="";switch(e){case"event":t=this.initConfig.report_url||REPORT_URL;break;case"webid":t=WEBID_URL;break;case"tobid":t=TOB_URL}var r="";return this.initConfig.caller&&(r="?sdk_version="+SDK_VERSION+"&sdk_name=web&app_id="+this.initConfig.app_id+"&caller="+this.initConfig.caller),""+this.getDomain()+t+r},e.prototype.setCustom=function(e){if(e&&e.latest_data&&e.latest_data.isLast)for(var t in delete e.latest_data.isLast,this.isLast=!0,e.latest_data)this.envInfo.header.custom[t]=e.latest_data[t]},e.prototype.set=function(e){var t=this;Object.keys(e).forEach((function(r){void 0!==e[r]&&null!==e[r]||t.delete(r);try{t.eventCheck.calculate(r,"config")}catch(a){}if("traffic_type"===r&&t.isLast&&(t.envInfo.header.custom.$latest_traffic_source_type=e[r]),"evtParams"===r)t.evtParams=__assign({},t.evtParams||{},e.evtParams||{});else if("_staging_flag"===r)t.evtParams=__assign({},t.evtParams||{},{_staging_flag:e._staging_flag});else if("reportErrorCallback"===r&&"function"==typeof e[r])t.reportErrorCallback=e[r];else{var i="",n="";if(r.indexOf(".")>-1){var o=r.split(".");i=o[0],n=o[1]}i?"user"===i||"header"===i?t.envInfo[i][n]=e[r]:t.envInfo.header.custom[n]=e[r]:Object.hasOwnProperty.call(t.envInfo.user,r)?["user_type","ip_addr_id"].indexOf(r)>-1?t.envInfo.user[r]=e[r]?Number(e[r]):e[r]:["user_id","web_id","user_unique_id","user_unique_id_type"].indexOf(r)>-1?t.envInfo.user[r]=e[r]?String(e[r]):e[r]:["user_is_auth","user_is_login"].indexOf(r)>-1?t.envInfo.user[r]=Boolean(e[r]):"device_id"===r&&(t.envInfo.user[r]=e[r]):Object.hasOwnProperty.call(t.envInfo.header,r)?t.envInfo.header[r]=e[r]:t.envInfo.header.custom[r]=e[r]}}))},e.prototype.get=function(e){try{return e?"evtParams"===e?this.evtParams:"reportErrorCallback"===e?this[e]:Object.hasOwnProperty.call(this.envInfo.user,e)?this.envInfo.user[e]:Object.hasOwnProperty.call(this.envInfo.header,e)?this.envInfo.header[e]:JSON.parse(JSON.stringify(this.envInfo[e])):JSON.parse(JSON.stringify(this.envInfo))}catch(t2){console.log("get config stringify error "),this.collect.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:t2.message})}},e.prototype.setStore=function(e){try{if(!this.configPersist)return;var t=this.storage.getItem(this.configKey)||{};if(t&&Object.keys(e).length){var r=Object.assign(e,t);this.storage.setItem(this.configKey,r)}}catch(i){console.log("setStore error"),this.collect.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:i.message})}},e.prototype.getStore=function(){try{if(!this.configPersist)return null;var e=this.storage.getItem(this.configKey)||{};return e&&Object.keys(e).length?e:null}catch(t2){return this.collect.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:t2.message}),null}},e.prototype.delete=function(e){try{if(!this.configPersist)return;var t=this.storage.getItem(this.configKey)||{};t&&Object.hasOwnProperty.call(t,e)&&(delete t[e],this.storage.setItem(this.configKey,t))}catch(r){this.collect.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:r.message}),console.log("delete error")}},e}(),Logger=function(){function e(e,t){this.isLog=t||!1,this.name=e||""}return e.prototype.info=function(e){this.isLog&&console.log("%c %s","color: yellow; background-color: black;","[instance: "+this.name+"] "+e)},e.prototype.warn=function(e){this.isLog&&console.warn("[instance: "+this.name+"] "+e)},e.prototype.error=function(e){this.isLog&&console.error("[instance: "+this.name+"] "+e)},e.prototype.throw=function(e){throw this.error(this.name),new Error(e)},e}(),AppBridge=function(){function e(e,t){this.collect=e,this.native=t}var t=e.prototype;return t.bridgeInject=function(){try{return!!this.native&&(AppLogBridge?(console.log("AppLogBridge is injected"),!0):(console.log("AppLogBridge is not inject"),!1))}catch(e){return console.log("AppLogBridge is not inject"),!1}},t.bridgeReady=function(){var e=this;return new Promise((function(t,r){try{e.bridgeInject()?AppLogBridge.hasStarted((function(e){console.log("AppLogBridge is started? : "+e),e?t(!0):r(!1)})):r(!1)}catch(i){console.log("AppLogBridge, error:"+JSON.stringify(i.stack)),r(!1)}}))},t.setNativeAppId=function(e){try{AppLogBridge.setNativeAppId(JSON.stringify(e)),console.log("change bridge appid, event report with appid: "+e)}catch(t){console.error("setNativeAppId error")}},t.setConfig=function(e){var t=this;try{Object.keys(e).forEach((function(r){"user_unique_id"===r?t.setUserUniqueId(e[r]):e[r]?t.addHeaderInfo(r,e[r]):t.removeHeaderInfo(r)}))}catch(r){console.error("setConfig error")}},t.setUserUniqueId=function(e){try{AppLogBridge.setUserUniqueId(e)}catch(t){console.error("setUserUniqueId error")}},t.addHeaderInfo=function(e,t){try{AppLogBridge.addHeaderInfo(e,t)}catch(r){console.error("addHeaderInfo error")}},t.setHeaderInfo=function(e){try{AppLogBridge.setHeaderInfo(JSON.stringify(e))}catch(t){console.error("setHeaderInfo error")}},t.removeHeaderInfo=function(e){try{AppLogBridge.removeHeaderInfo(e)}catch(t){console.error("removeHeaderInfo error")}},t.reportPv=function(e){this.onEventV3("predefine_pageview",e)},t.onEventV3=function(e,t){try{AppLogBridge.onEventV3(e,t),this.collect.emit(DebuggerMesssge.DEBUGGER_MESSAGE,{type:DebuggerMesssge.DEBUGGER_MESSAGE_EVENT,info:"bridge埋点上报",time:Date.now(),data:[{events:[{event:e,params:t}]}],code:200,status:"success"})}catch(r){console.error("onEventV3 error")}},t.profileSet=function(e){try{AppLogBridge.profileSet(e)}catch(t){console.error("profileSet error")}},t.profileSetOnce=function(e){try{AppLogBridge.profileSetOnce(e)}catch(t){console.error("profileSetOnce error")}},t.profileIncrement=function(e){try{AppLogBridge.profileIncrement(e)}catch(t){console.error("profileIncrement error")}},t.profileUnset=function(e){try{AppLogBridge.profileUnset(e)}catch(t){console.error("profileUnset error")}},t.profileAppend=function(e){try{AppLogBridge.profileAppend(e)}catch(t){console.error("profileAppend error")}},e}(),ERROR={NO_URL:4001,IMG_ON:4e3,IMG_CATCH:4002,BEACON_FALSE:4003,XHR_ON:500,RESPONSE:5001,TIMEOUT:5005};function fetch$1(e,t,r,i,n,o,a,s,l){try{var c=new XMLHttpRequest,u=s||"POST";c.open(u,""+e,!0),c.setRequestHeader("Content-Type","application/json; charset=utf-8"),a&&c.setRequestHeader("X-MCS-AppKey",""+a),i&&(c.withCredentials=!0),r&&(c.timeout=r,c.ontimeout=function(){o&&o(t,ERROR.TIMEOUT)}),c.onload=function(){if(n){var e=null;if(c.responseText){try{e=JSON.parse(c.responseText)}catch(r){e={}}n(e,t)}}},c.onerror=function(){c.abort(),o&&o(t,ERROR.XHR_ON)},l?c.send(t):c.send(JSON.stringify(t))}catch(h){}}var GIF_URL="/gif",ERROR$1={NO_URL:4001,IMG_ON:4e3,IMG_CATCH:4002,BEACON_FALSE:4003,XHR_ON:500,RESPONSE:5001,TIMEOUT:5005},isSupportBeacon=function(){return!(!window.navigator||!window.navigator.sendBeacon)},encodePayload=function(e){var t="";for(var r in e)e.hasOwnProperty(r)&&void 0!==e[r]&&(t+="&"+r+"="+encodeURIComponent(JSON.stringify(e[r])));return"&"===t[0]?t.slice(1):t},sendByImg=function(e,t,r,i){try{var n,o=e.match(/\/v\d\//);n=o?o[0]:-1!==e.indexOf("/v1/")?"/v1/":"/v2/";var a=e.split(n)[0];if(!a)return void i(e,t,ERROR$1.NO_URL);t.forEach((function(n){var o=encodePayload(n),s=new Image(1,1);s.onload=function(){s=null,r&&r()},s.onerror=function(){s=null,i&&i(e,t,ERROR$1.IMG_ON)},s.src=""+a+GIF_URL+"?"+o}))}catch(s){i&&i(e,t,ERROR$1.IMG_CATCH,s.message)}},request=function(e,t,r,i,n,o,a,s){var l=window.navigator.userAgent;if(-1===window.navigator.appName.indexOf("Microsoft Internet Explorer")||-1===l.indexOf("MSIE 8.0")&&-1===l.indexOf("MSIE 9.0")){if(a)return isSupportBeacon()?void(window.navigator.sendBeacon(e,JSON.stringify(t))?n():o(e,t,ERROR$1.BEACON_FALSE)):void sendByImg(e,t,n,o)}else sendByImg(e,t,n,o);fetch$1(e,t,r,i,n,o,"","",s)},sessionId=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},Session=function(){function e(){}return e.prototype.apply=function(e,t){var r=this;this.collect=e,this.storage=new Storage(!1,"session"),this.sessionKey="__tea_session_id_"+t.app_id,this.expireTime=t.expireTime||18e5,this.disableSession=t.disable_session,this.disableSession||(this.setSessionId(),this.collect.on(Types$1.SessionReset,(function(){r.resetSessionId()})),this.collect.on(Types$1.SessionResetTime,(function(){r.updateSessionIdTime()})))},e.prototype.updateSessionIdTime=function(){var e=this.storage.getItem(this.sessionKey);if(e&&e.sessionId){var t=e.timestamp;Date.now()-t>this.expireTime?e={sessionId:sessionId(),timestamp:Date.now()}:e.timestamp=Date.now(),this.storage.setItem(this.sessionKey,e),this.resetExpTime()}},e.prototype.setSessionId=function(){var e=this,t=this.storage.getItem(this.sessionKey);t&&t.sessionId?t.timestamp=Date.now():t={sessionId:sessionId(),timestamp:Date.now()},this.storage.setItem(this.sessionKey,t),this.sessionExp=setInterval((function(){e.checkEXp()}),this.expireTime)},e.prototype.getSessionId=function(){var e=this.storage.getItem(this.sessionKey);return this.disableSession?"":e&&e.sessionId?e.sessionId:""},e.prototype.resetExpTime=function(){var e=this;this.sessionExp&&(clearInterval(this.sessionExp),this.sessionExp=setInterval((function(){e.checkEXp()}),this.expireTime))},e.prototype.resetSessionId=function(){var e={sessionId:sessionId(),timestamp:Date.now()};this.storage.setItem(this.sessionKey,e)},e.prototype.checkEXp=function(){var e=this.storage.getItem(this.sessionKey);e&&e.sessionId&&Date.now()-e.timestamp+30>=this.expireTime&&(e={sessionId:sessionId(),timestamp:Date.now()},this.storage.setItem(this.sessionKey,e))},e}(),Event=function(){function e(){this.eventLimit=50,this.enable_ttwebid=!1,this.eventCache=[],this.beconEventCache=[]}return e.prototype.apply=function(e,t){var r=this;this.collect=e,this.config=t,this.configManager=e.configManager,this.eventCheck=new EventCheck(e,t),this.cacheStorgae=new Storage(!0),this.localStorage=new Storage(!1),this.maxReport=t.max_report||10,this.reportTime=t.reportTime||30,this.timeout=t.timeout||1e5,this.enable_ttwebid=t.enable_ttwebid,this.reportUrl=this.configManager.getUrl("event"),this.eventKey="__tea_cache_events_"+this.configManager.get("app_id"),this.beconKey="__tea_cache_events_becon_"+this.configManager.get("app_id"),this.abKey="__tea_sdk_ab_version_"+this.configManager.get("app_id"),this.pageId=sessionId(),this.collect.on(Types$1.Ready,(function(){r.reportAll(!1)})),this.collect.on(Types$1.ConfigDomain,(function(){r.reportUrl=r.configManager.getUrl("event")})),this.collect.on(Types$1.Event,(function(e){r.event(e)})),this.collect.on(Types$1.BeconEvent,(function(e){r.beconEvent(e)})),this.collect.on(Types$1.CleanEvents,(function(){r.reportAll(!1)})),this.linster()},e.prototype.linster=function(){var e=this;window.addEventListener("unload",(function(){e.reportAll(!0)}),!1),beforePageUnload((function(){e.reportAll(!0)})),document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e.reportAll(!0)}),!1)},e.prototype.reportAll=function(e){this.report(e),this.reportBecon()},e.prototype.event=function(e){var t=this;try{var r=__spread(e,this.cacheStorgae.getItem(this.eventKey)||[]);if(this.cacheStorgae.setItem(this.eventKey,r),this.reportTimeout&&clearTimeout(this.reportTimeout),r.length>=this.maxReport)this.report(!1);else{var i=this.reportTime;this.reportTimeout=setTimeout((function(){t.report(!1),t.reportTimeout=null}),i)}}catch(n){this.collect.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:n.message})}},e.prototype.beconEvent=function(e){var t=__spread(e,this.cacheStorgae.getItem(this.beconKey)||[]);this.cacheStorgae.setItem(this.beconKey,t),this.collect.destroyInstance||this.collect.tokenManager.getReady()&&this.collect.sdkReady&&(this.cacheStorgae.removeItem(this.beconKey),this.send(this.split(this.merge(t)),!0))},e.prototype.reportBecon=function(){if(!this.collect.destroyInstance&&this.collect.tokenManager.getReady()&&this.collect.sdkReady){var e=this.cacheStorgae.getItem(this.beconKey)||[];e&&e.length&&(this.cacheStorgae.removeItem(this.beconKey),this.send(this.split(this.merge(e)),!0))}},e.prototype.report=function(e){if(!this.collect.destroyInstance&&this.collect.tokenManager.getReady()&&this.collect.sdkReady){var t=this.cacheStorgae.getItem(this.eventKey)||[];t.length&&(this.cacheStorgae.removeItem(this.eventKey),this.sliceEvent(t,e))}},e.prototype.sliceEvent=function(e,t){if(e.length>this.eventLimit)for(var r=0;r<e.length;r+=this.eventLimit){var i;i=e.slice(r,r+this.eventLimit);var n=this.split(this.merge(i));this.send(n,t)}else n=this.split(this.merge(e)),this.send(n,t)},e.prototype.merge=function(e,t){var r=this,i=this.configManager.get(),n=i.header,o=i.user;this.config.enable_pageid&&(n.custom.page_id=this.pageId),n.custom=JSON.stringify(n.custom);var a=this.configManager.get("evtParams"),s=this.configManager.get("user_unique_id_type"),l=e.map((function(e){try{Object.keys(a).length&&!t&&(e.params=__assign({},a,e.params)),s&&(e.params.$user_unique_id_type=s);var i=r.configManager.getAbCache();return i&&i.uuid&&i.uuid===o.user_unique_id&&r.configManager.getAbVersion()&&(e.ab_sdk_version=r.configManager.getAbVersion()),e.session_id=r.collect.sessionManager.getSessionId(),e.params=JSON.stringify(e.params),e}catch(n){return r.collect.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:n.message}),e}})),c=JSON.parse(JSON.stringify({events:l,user:o,header:n}));c.local_time=Math.floor(Date.now()/1e3),c.user_unique_type=this.config.enable_ttwebid?this.config.user_unique_type:void 0,c.verbose=1;var u=[];return u.push(c),u},e.prototype.split=function(e){return e.map((function(e){var t=[];return t.push(e),t}))},e.prototype.send=function(e,t){var r=this;e.length&&(this.config.disable_track_event||e.forEach((function(e){try{var i=JSON.parse(JSON.stringify(e));r.config.filter&&((i=r.config.filter(i))||console.warn("filter must return data !!")),r.collect.eventFilter&&i&&((i=r.collect.eventFilter(i))||console.warn("filterEvent api must return data !!"));var n=i||e,o=JSON.parse(JSON.stringify(n));if(r.eventCheck.checkVerify(o),!n.length)return;r.collect.emit(Types$1.SubmitBefore,n),r.collect.emit(Types$1.SubmitVerify,n),request(r.reportUrl,n,r.timeout,r.enable_ttwebid,(function(e,t){e&&0!==e.e?(r.collect.emit(Types$1.SubmitError,{type:"f_data",eventData:t,errorCode:e.e,response:e}),r.collect.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_EVENT,info:"埋点上报失败",time:Date.now(),data:o,code:e.e,failType:"数据异常",status:"fail"})):(r.collect.emit(Types$1.SubmitScuess,{eventData:t,res:e}),r.collect.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_EVENT,info:"埋点上报成功",time:Date.now(),data:o,code:200,status:"success"}))}),(function(e,t){r.configManager.get("reportErrorCallback")(e,t),r.collect.emit(Types$1.SubmitError,{type:"f_net",eventData:e,errorCode:t}),r.collect.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_EVENT,info:"埋点上报网络异常",time:Date.now(),data:o,code:t,failType:"网络异常",status:"fail"})}),t,!1),r.collect.emit(Types$1.SubmitAfter,n)}catch(a){console.warn("something error, "+JSON.stringify(a.stack)),r.collect.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:a.message})}})))},e}(),b=function e(t){return t?(t^16*Math.random()>>t/4).toString(10):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e)},localWebId=function(){return b().replace(/-/g,"").slice(0,19)},Token=function(){function e(){this.cacheToken={},this.enableCookie=!1,this.enable_ttwebid=!1,this.enableCustomWebid=!1}return e.prototype.apply=function(e,t){var r=this;this.collect=e,this.config=t,this.configManager=this.collect.configManager,this.storage=new Storage(!1),this.tokenKey="__tea_cache_tokens_"+t.app_id,this.enable_ttwebid=t.enable_ttwebid,this.enableCustomWebid=t.enable_custom_webid,this.collect.on(Types$1.ConfigUuid,(function(e){r.setUuid(e)})),this.collect.on(Types$1.ConfigWebId,(function(e){r.setWebId(e)})),this.enableCookie=t.cross_subdomain,this.expiresTime=t.cookie_expire||6048e5,this.cookieDomain=t.cookie_domain||"",this.checkStorage()},e.prototype.checkStorage=function(){var e=this;if(this.enableCookie){var t=this.storage.getCookie(this.tokenKey,this.cookieDomain);this.cacheToken=t&&"string"==typeof t?JSON.parse(t):{}}else this.cacheToken=this.storage.getItem(this.tokenKey)||{};this.tokenType=this.cacheToken&&this.cacheToken._type_?this.cacheToken._type_:"default","custom"!==this.tokenType||this.enableCustomWebid?this.enableCustomWebid?this.collect.on(Types$1.CustomWebId,(function(){e.tokenReady=!0,e.collect.emit(Types$1.TokenComplete)})):this.checkEnv()||(this.enable_ttwebid?this.completeTtWid(this.cacheToken):this.check()):this.remoteWebid()},e.prototype.check=function(){this.cacheToken&&this.cacheToken.web_id?this.complete(this.cacheToken):this.config.disable_webid?this.complete({web_id:localWebId(),user_unique_id:this.configManager.get("user_unique_id")||localWebId()}):this.remoteWebid()},e.prototype.checkEnv=function(){var e=window.navigator.userAgent;if(-1!==e.indexOf("miniProgram")||-1!==e.indexOf("MiniProgram")){var t=parseUrlQuery(window.location.href);return!(!t||!t.Web_ID||(this.complete({web_id:""+t.Web_ID,user_unique_id:this.configManager.get("user_unique_id")||""+t.Web_ID}),0))}return!1},e.prototype.remoteWebid=function(){var e=this,t=this.configManager.getUrl("webid"),r={app_key:this.config.app_key,app_id:this.config.app_id,url:location.href,user_agent:window.navigator.userAgent,referer:document.referrer,user_unique_id:""};this.collect.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"SDK 发起WEBID请求",logType:"fetch",level:"info",time:Date.now(),data:r}),fetch$1(t,r,3e3,!1,(function(t){t&&0===t.e?e.complete({web_id:e.configManager.get("web_id")||t.web_id,user_unique_id:e.configManager.get("user_unique_id")||t.web_id}):(e.collect.emit(Types$1.TokenError),console.warn("[]appid: "+e.config.app_id+" webid error, init error~")),e.collect.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"WEBID请求成功",logType:"fetch",level:"info",time:Date.now(),data:t})}),(function(){e.collect.emit(Types$1.TokenError),e.collect.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"WEBID请求网络异常",logType:"fetch",level:"error",time:Date.now(),data:null}),console.warn("[]appid: "+e.config.app_id+", get webid error, init error~")}))},e.prototype.complete=function(e){var t=e.web_id,r=e.user_unique_id;e.timestamp=Date.now(),this.collect.configManager.set({web_id:t,user_unique_id:r}),this.setStorage(e),this.tokenReady=!0,this.collect.emit(Types$1.TokenComplete)},e.prototype.completeTtWid=function(e){var t=e.user_unique_id||"",r=this.configManager.get("user_unique_id");(r||t)&&this.configManager.set({user_unique_id:r||t}),this.setStorage(e),this.tokenReady=!0,this.collect.emit(Types$1.TokenComplete)},e.prototype.setUuid=function(e){if(e&&-1===["null","undefined","Null","None"].indexOf(e)){var t=String(e),r=this.configManager.get("user_unique_id"),i=this.cacheToken&&this.cacheToken.user_unique_id;if(t===r&&t===i)return;this.configManager.set({user_unique_id:t}),this.cacheToken||(this.cacheToken={}),this.cacheToken.user_unique_id=t,this.cacheToken.timestamp=Date.now(),this.setStorage(this.cacheToken),this.collect.emit(Types$1.TokenChange,"uuid"),this.collect.emit(Types$1.SessionReset)}else this.clearUuid()},e.prototype.clearUuid=function(){this.config.enable_ttwebid||this.configManager.get("web_id")&&this.configManager.get("user_unique_id")!==this.configManager.get("web_id")&&(this.configManager.set({user_unique_id:this.configManager.get("web_id")}),this.cacheToken&&this.cacheToken.web_id&&(this.cacheToken.user_unique_id=this.cacheToken.web_id,this.cacheToken.timestamp=Date.now(),this.setStorage(this.cacheToken)),this.collect.emit(Types$1.TokenReset,"uuid"))},e.prototype.setWebId=function(e){if(e&&!this.config.enable_ttwebid){this.cacheToken&&this.cacheToken.web_id?this.cacheToken.web_id!==e&&(this.cacheToken.user_unique_id=this.cacheToken.web_id===this.cacheToken.user_unique_id?e:this.cacheToken.user_unique_id,this.cacheToken.web_id=e):(this.cacheToken={},this.cacheToken.web_id=e,this.cacheToken.user_unique_id=e),this.cacheToken.timestamp=Date.now();var t=this.configManager.get("web_id"),r=this.configManager.get("user_unique_id");r&&r!==t||(this.configManager.set({user_unique_id:e}),this.collect.emit(Types$1.TokenChange,"uuid")),t!==e&&(this.configManager.set({web_id:e}),this.collect.emit(Types$1.TokenChange,"webid")),this.setStorage(this.cacheToken)}},e.prototype.setStorage=function(e){e._type_=this.enableCustomWebid?"custom":"default",delete e["diss".split("").reverse().join("")],this.enableCookie||this.enable_ttwebid?(this.storage.setCookie(this.tokenKey,e,this.expiresTime,this.cookieDomain),this.enable_ttwebid&&(delete e.web_id,this.storage.setItem(this.tokenKey,e))):this.storage.setItem(this.tokenKey,e),this.cacheToken=e},e.prototype.getReady=function(){return this.tokenReady},e.prototype.getTobId=function(){var e=this,t=this.configManager.getUrl("tobid");return new Promise((function(r){fetch$1(t,{app_id:e.config.app_id,user_unique_id:e.configManager.get("user_unique_id"),web_id:e.configManager.get("web_id"),user_unique_id_type:e.configManager.get("user_unique_id_type")},3e4,e.enable_ttwebid,(function(e){e&&0===e.e?r(e.tobid):r("")}),(function(){r("")}))}))},e}(),AutoBase=function(e){var t=e.app_id,r=e.channel,i=e.onTokenReady,n=LOG_URL[r]+"/webid",o=new Storage(!1),a="__tea_cache_tokens_"+t,s=o.getItem(a);s&&s.web_id?i(s.web_id):request(n,{app_key:"",app_id:t,url:location.href,user_agent:window.navigator.userAgent,referer:document.referrer},3e3,!1,(function(e){if(e&&0===e.e){i(e.web_id);var t={web_id:e.web_id,user_unique_id:e.web_id,timestamp:Date.now()};o.setItem(a,t)}else i("")}),(function(){i("")}),!0)},Debugger=function(){function e(e,t){this.devToolReady=!1,this.devToolOrigin="*",this.sendAlready=!1,this.collect=e,this.config=t,this.app_id=t.app_id,this.filterEvent=["__bav_page","__bav_beat","__bav_page_statistics","__bav_click","__bav_page_exposure","bav2b_page","bav2b_beat","bav2b_page_statistics","bav2b_click","bav2b_page_exposure","_be_active","predefine_pageview","__profile_set","__profile_set_once","__profile_increment","__profile_unset","__profile_append","predefine_page_alive","predefine_page_close","abtest_exposure"],this.load()}return e.prototype.loadScript=function(e){try{var t=document.createElement("script");t.src=e,t.onerror=function(){console.log("load DevTool render fail")},t.onload=function(){console.log("load DevTool render success")},document.getElementsByTagName("body")[0].appendChild(t)}catch(r){console.log("devTool load fail, "+r.message)}},e.prototype.load=function(){try{this.loadBaseInfo(),this.loadHook();var e=parseUrlQuery(window.location.href);if(!e.open_devtool_web||parseInt(e.app_id)!==this.app_id)return;this.addLintener(),this.loadDebuggerModule(),this.loadDevTool()}catch(t2){console.log("debug fail, "+t2.message)}},e.prototype.loadDevTool=function(){this.loadScript("https://lf3-cdn-tos.bytescm.com/obj/static/log-sdk/collect/devtool/debug-web.js")},e.prototype.loadBaseInfo=function(){var e=this;this.info=[{title:"基本信息",type:1,infoName:{app_id:this.config.app_id,channel:this.config.channel,"上报域名":this.collect.configManager.getDomain(),"SDK版本":SDK_VERSION,"SDK引入方式":SDK_TYPE}},{title:"用户信息",type:2,infoName:{uuid:this.collect.configManager.get("user").user_unique_id||"",web_id:this.collect.configManager.get("user").web_id||"",ssid:"点击获取SSID"}},{title:"公共参数信息",type:2,infoName:{"浏览器":this.collect.configManager.get("browser"),"浏览器版本":this.collect.configManager.get("browser_version"),"平台":this.collect.configManager.get("platform"),"设备型号":this.collect.configManager.get("device_model"),"操作系统":this.collect.configManager.get("os_name"),"操作系统版本":this.collect.configManager.get("os_version"),"屏幕分辨率":this.collect.configManager.get("resolution"),"来源":this.collect.configManager.get("referrer"),"自定义信息":""}},{title:"配置信息",type:3,infoName:{"全埋点":!!this.config.autotrack,"停留时长":!!this.config.enable_stay_duration}},{title:"A/B配置信息",type:4,infoName:{"A/B实验":!!this.config.enable_ab_test}},{title:"客户端信息",type:3,infoName:{"打通开关":!!this.config.Native}}],this.log=[],this.event=[],this.collect.on(Types$1.Ready,(function(){e.info[1].infoName.uuid=e.collect.configManager.get("user").user_unique_id,e.info[1].infoName.web_id=e.collect.configManager.get("user").web_id,e.info[2].infoName["自定义信息"]=JSON.stringify(e.collect.configManager.get("custom")),e.config.enable_ab_test&&(e.info[4].infoName["已曝光VID"]=e.collect.configManager.getAbVersion(),e.info[4].infoName["A/B域名"]=e.config.ab_channel_domain||decodeUrl(AB_DOMAINS[e.config.channel]),e.info[4].infoName["全部配置"]=e.collect.configManager.getAbData()),e.config.Native&&(e.info[5].infoName["是否打通"]=!!e.collect.bridgeReport)}))},e.prototype.loadHook=function(){var e=this;this.collect.on(DebuggerMesssge$1.DEBUGGER_MESSAGE,(function(t){switch(t.type){case DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK:var r={time:t.time,type:t.logType||"sdk",level:t.level,name:t.info,show:!0,levelShow:!0,needDesc:!!t.data};return t.data&&(r.desc={content:JSON.stringify(t.data)}),e.updateLog(r),t.secType&&"AB"===t.secType?(e.info[4].infoName["已曝光VID"]=e.collect.configManager.getAbVersion(),e.info[4].infoName["全部配置"]=e.collect.configManager.getAbData()):"USER"===t.secType&&(e.info[1].infoName.uuid=e.collect.configManager.get("user").user_unique_id,e.info[1].infoName.web_id=e.collect.configManager.get("user").web_id),void e.updateInfo();case DebuggerMesssge$1.DEBUGGER_MESSAGE_EVENT:if(t.data&&t.data.length){var i=t.data[0],n=i.events;if(!n.length)return;n.forEach((function(r){r.checkShow=!0,r.searchShow=!0,r.success=t.status,r.type=-1!==e.filterEvent.indexOf(r.event)?"sdk":"cus",r.type=e.collect.bridgeReport?"bridge":r.type,r.info="","fail"===t.status&&(r.info={message:"code: "+t.code+", msg: "+t.failType})})),e.updateEvent(i)}return}}))},e.prototype.addLintener=function(){var e=this;window.addEventListener("message",(function(t){if(t&&t.data&&"devtool:web:ready"===t.data.type){if(e.devToolOrigin=t.origin,e.devToolReady=!0,e.sendAlready)return;console.log("inittttt"),e.sendData("devtool:web:init",{info:e.info,log:e.log,event:e.event}),e.sendAlready=!0}t&&t.data&&"devtool:web:ssid"===t.data.type&&e.collect.getToken((function(t){e.info[1].infoName.ssid=t.tobid,e.updateInfo()}))}))},e.prototype.sendData=function(e,t){try{var r={type:e,payload:t};(window.opener||window.parent).postMessage(r,this.devToolOrigin)}catch(i){}},e.prototype.updateInfo=function(){this.devToolReady&&this.sendData("devtool:web:info",this.info)},e.prototype.updateLog=function(e){this.devToolReady?this.sendData("devtool:web:log",e):this.log.push(e)},e.prototype.updateEvent=function(e){this.devToolReady?this.sendData("devtool:web:event",e):this.event.push(e)},e.prototype.loadDebuggerModule=function(){var e=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.appendChild(document.createTextNode("#debugger-applog-web {\n position: absolute;\n width: 90px;\n height: 30px;\n background: #23c243;\n border-radius: 6px;\n color: #fff;\n font-size: 12px;\n bottom: 5%;\n right: 10%;\n text-align: center;\n line-height: 30px;\n cursor: pointer;\n z-index:100;\n }")),e.appendChild(t);var r=document.createElement("div");r.innerHTML='<div id="debugger-applog-web" class="debugger-applog-web">AppLog调试</div>';var i=document.createElement("div");i.innerHTML='<div id="debugger-container" class="debugger-container"></div>',document.getElementsByTagName("body")[0].appendChild(r),document.getElementsByTagName("body")[0].appendChild(i),document.getElementById("debugger-applog-web").addEventListener("click",(function(){(window.opener||window.parent).postMessage({type:"devtool:web:open-draw"},location.origin)}))},e}(),sdk_type="base";sdk_type="full";var Collector$1=function(){function e(e){this.disableAutoPageView=!1,this.bridgeReport=!1,this.staging=!1,this.pluginInstances=[],this.sended=!1,this.started=!1,this.destroyInstance=!1,this.sdkReady=!1,this.adapters={},this.name=e,this.hook=new Hook,this.remotePlugin=new Map,this.Types=Types$1,this.adapters.fetch=fetch$1,this.adapters.storage=Storage}return e.usePlugin=function(t,r,i){if(r){for(var n=!1,o=0,a=e.plugins.length;o<a;o++)if(e.plugins[o].name===r){e.plugins[o].plugin=t,e.plugins[o].options=i||{},n=!0;break}n||e.plugins.push({name:r,plugin:t,options:i})}else e.plugins.push({plugin:t})},e.prototype.usePlugin=function(e,t,r){e&&("full"===sdk_type&&this.remotePlugin.get(e)?console.info("your sdk version has "+e+" already ~"):t?"string"==typeof t?this.remotePlugin.get(e)||this.remotePlugin.set(e,{src:t,call:r}):this.remotePlugin.get(e)||this.remotePlugin.set(e,{instance:t}):this.remotePlugin.get(e)||this.remotePlugin.set(e,"sdk"))},e.prototype.init=function(t){var r=this;this.inited?console.warn("[instance: "+this.name+"], every instance's api: init, can be call only one time!"):t&&isObject$1(t)?t.app_id&&isNumber(t.app_id)?!t.app_key||isString(t.app_key)?(t.channel_domain||-1!==["cn","sg","va"].indexOf(t.channel)||(console.warn("channel must be `cn`, `sg`,`va` !!!"),t.channel="cn"),this.logger=new Logger(this.name,t.log),this.appBridge=new AppBridge(this,t.enable_native),this.bridgeReport=this.appBridge.bridgeInject(),this.configManager=new ConfigManager(this,t),this.debugger=new Debugger(this,t),this.initConfig=t,this.emit(Types$1.Init),this.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"SDK 执行INIT",data:t,level:"info",time:Date.now()}),t.disable_auto_pv&&(this.disableAutoPageView=!0),this.bridgeReport||(this.configManager.set({app_id:t.app_id}),this.eventManager=new Event,this.tokenManager=new Token,this.sessionManager=new Session,Promise.all([new Promise((function(e){r.once(Types$1.TokenComplete,(function(){e(!0)}))})),new Promise((function(e){r.once(Types$1.Start,(function(){e(!0)}))}))]).then((function(){try{e.plugins.reduce((function(e,t){var i=t.plugin,n=t.options,o=Object.assign(r.initConfig,n),a=new i;return a.apply(r,o),e.push(a),e}),r.pluginInstances)}catch(i){console.log("load plugin error, "+i.message),r.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:i.message})}r.sdkReady=!0,r.emit(Types$1.Ready),r.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"SDK 初始化完成",time:Date.now(),level:"info",data:r.configManager.get("user")}),r.logger.info("appid: "+t.app_id+", userInfo:"+JSON.stringify(r.configManager.get("user"))),r.logger.info("appid: "+t.app_id+", sdk is ready, version is "+SDK_VERSION+", you can report now !!!"),t.disable_auto_pv&&(r.disableAutoPageView=!0);try{(t.enable_ab_test||t.autotrack)&&(window.opener||window.parent).postMessage("[tea-sdk]ready","*")}catch(i){r.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:i.message})}r.pageView(),r.on(Types$1.TokenChange,(function(e){"webid"===e&&r.pageView(),r.logger.info("appid: "+t.app_id+" token change, new userInfo:"+JSON.stringify(r.configManager.get("user"))),r.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"SDK 设置了用户信息",time:Date.now(),secType:"USER",level:"info",data:r.configManager.get("user")})})),r.on(Types$1.TokenReset,(function(){r.logger.info("appid: "+t.app_id+" token reset, new userInfo:"+JSON.stringify(r.configManager.get("user"))),r.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"SDK 重置了用户信息",time:Date.now(),secType:"USER",level:"info",data:r.configManager.get("user")})})),r.on(Types$1.RouteChange,(function(e){e.init||t.disable_route_report||r.pageView()}));try{(window.opener||window.parent).postMessage("[tea-sdk]ready","*")}catch(i){}})),this.tokenManager.apply(this,t),this.eventManager.apply(this,t),this.sessionManager.apply(this,t)),this.inited=!0):console.warn("app_key param is error, must be string, please check!"):console.warn("app_id param is error, must be number, please check!"):console.warn("init params error,please check")},e.prototype.config=function(e){if(this.inited)if(e&&isObject$1(e))if(this.bridgeReport)this.appBridge.setConfig(e);else{e._staging_flag&&1===e._staging_flag&&(this.staging=!0),e.disable_auto_pv&&(this.disableAutoPageView=!0,delete e.disable_auto_pv);var t=__assign({},e);if(this.initConfig&&this.initConfig.configPersist){var r=this.configManager.getStore();r&&(t=Object.assign(r,e)),this.configManager.setStore(e)}t.web_id,t.user_unique_id;var i=__rest(t,["web_id","user_unique_id"]);this.configManager.set(i),t.hasOwnProperty("web_id")&&this.emit(Types$1.ConfigWebId,t.web_id),t.hasOwnProperty("user_unique_id")&&this.emit(Types$1.ConfigUuid,t.user_unique_id),this.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"SDK 执行CONFIG",level:"info",time:Date.now(),data:t})}else console.warn("config params is error, please check");else console.warn("config must be use after function init")},e.prototype.setUserUniqueID=function(e){this.config({user_unique_id:e})},e.prototype.setHeaderInfo=function(e,t){var r={};r[e]=t,this.config(r)},e.prototype.removeHeaderInfo=function(e){var t={};t[e]=void 0,this.config(t)},e.prototype.setDomain=function(e){this.configManager&&this.configManager.setDomain(e),this.emit(Types$1.ConfigDomain)},e.prototype.getConfig=function(e){return this.configManager.get(e)},e.prototype.send=function(){this.start()},e.prototype.start=function(){this.inited&&!this.sended&&(this.sended=!0,this.started=!0,this.emit(Types$1.Start),this.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"SDK 执行START",level:"info",time:Date.now()}),this.bridgeReport&&(this.pageView(),this.emit(Types$1.Ready)))},e.prototype.event=function(e,t){var r=this;try{var i=[];if(Array.isArray(e))e.forEach((function(e){var t=r.processEvent(e[0],e[1]||{});t&&i.push(t)}));else{var n=this.processEvent(e,t);if(!n)return;i.push(n)}this.bridgeReport?i.forEach((function(e){var t=e.event,i=e.params;r.appBridge.onEventV3(t,JSON.stringify(i))})):i.length&&(this.emit(Types$1.Event,i),this.emit(Types$1.SessionResetTime))}catch(o){console.warn("something error, please check"),this.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:o.message})}},e.prototype.beconEvent=function(e,t){if(Array.isArray(e))console.warn("beconEvent not support batch report, please check");else{var r=[],i=this.processEvent(e,t||{});i&&(r.push(i),r.length&&(this.emit(Types$1.BeconEvent,r),this.emit(Types$1.SessionResetTime)))}},e.prototype.processEvent=function(e,t){void 0===t&&(t={});try{if(!e)return this.logger.warn("eventName is null, please check"),null;var r=e;/^event\./.test(e)&&(r=e.slice(6));var i=t;"object"!=typeof i&&(i={}),i.profile?delete i.profile:i.event_index=getIndex();var n=void 0;return i.local_ms?(n=i.local_ms,delete i.local_ms):n=+new Date,{event:r,params:i,local_time_ms:n,is_bav:this.initConfig&&this.initConfig.autotrack?1:0}}catch(o){return this.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:o.message}),{event:e,params:t}}},e.prototype.filterEvent=function(e){this.eventFilter=e},e.prototype.on=function(e,t){this.hook.on(e,t)},e.prototype.once=function(e,t){this.hook.once(e,t)},e.prototype.off=function(e,t){this.hook.off(e,t)},e.prototype.emit=function(e,t,r){this.hook.emit(e,t,r)},e.prototype.set=function(e){this.hook.set(e)},e.prototype.pageView=function(){this.disableAutoPageView||this.predefinePageView()},e.prototype.predefinePageView=function(e){void 0===e&&(e={});var t={title:document.title||location.pathname,url:location.href,url_path:location.pathname,time:Date.now(),referrer:window.document.referrer,$is_first_time:""+this.configManager.is_first_time},r=__assign({},t,e);this.event("predefine_pageview",r)},e.prototype.clearEventCache=function(){this.emit(Types$1.CleanEvents)},e.prototype.setWebIDviaUnionID=function(e){if(e){var t=hashCode(e);this.config({web_id:""+t,wechat_unionid:e}),this.emit(Types$1.CustomWebId)}},e.prototype.setWebId=function(e){this.config({web_id:""+e})},e.prototype.setWebIDviaOpenID=function(e){if(e){var t=hashCode(e);this.config({web_id:""+t,wechat_openid:e}),this.emit(Types$1.CustomWebId)}},e.prototype.setNativeAppId=function(e){this.bridgeReport&&this.appBridge.setNativeAppId(e)},e.prototype.resetStayDuration=function(e,t,r){this.emit(Types$1.ResetStay,{url_path:e,title:t,url:r},Types$1.Stay)},e.prototype.resetStayParams=function(e,t,r){void 0===e&&(e=""),void 0===t&&(t=""),void 0===r&&(r=""),this.emit(Types$1.SetStay,{url_path:e,title:t,url:r},Types$1.Stay)},e.prototype.getToken=function(e,t){var r=this,i=!1,n=function(t){if(!i){i=!0;var n=r.configManager.get().user;return t&&(n.tobid=t,n["diss".split("").reverse().join("")]=t),e(__assign({},n))}},o=function(){r.tokenManager.getTobId().then((function(e){n(e)}))};this.sdkReady?o():(t&&setTimeout((function(){n()}),t),this.on(Types$1.Ready,(function(){o()})))},e.prototype.profileSet=function(e){this.bridgeReport?this.appBridge.profileSet(JSON.stringify(e)):this.emit(Types$1.ProfileSet,e,Types$1.Profile),this.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"SDK 执行profileSet",level:"info",time:Date.now(),data:e})},e.prototype.profileSetOnce=function(e){this.bridgeReport?this.appBridge.profileSetOnce(JSON.stringify(e)):this.emit(Types$1.ProfileSetOnce,e,Types$1.Profile),this.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"SDK 执行profileSetOnce",level:"info",time:Date.now(),data:e})},e.prototype.profileIncrement=function(e){this.bridgeReport?this.appBridge.profileIncrement(JSON.stringify(e)):this.emit(Types$1.ProfileIncrement,e,Types$1.Profile),this.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"SDK 执行profileIncrement",level:"info",time:Date.now(),data:e})},e.prototype.profileUnset=function(e){this.bridgeReport?this.appBridge.profileUnset(e):this.emit(Types$1.ProfileUnset,e,Types$1.Profile),this.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"SDK 执行profileUnset",level:"info",time:Date.now(),data:e})},e.prototype.profileAppend=function(e){this.bridgeReport?this.appBridge.profileAppend(JSON.stringify(e)):this.emit(Types$1.ProfileAppend,e,Types$1.Profile),this.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"SDK 执行profileAppend",level:"info",time:Date.now(),data:e})},e.prototype.setExternalAbVersion=function(e){this.emit(Types$1.AbExternalVersion,"string"==typeof e&&e?(""+e).trim():null,Types$1.Ab)},e.prototype.getVar=function(e,t,r){this.emit(Types$1.AbVar,{name:e,defaultValue:t,callback:r},Types$1.Ab)},e.prototype.getABconfig=function(e,t){this.emit(Types$1.AbConfig,{params:e,callback:t},Types$1.Ab)},e.prototype.getAbSdkVersion=function(){return this.configManager.getAbVersion()},e.prototype.onAbSdkVersionChange=function(e){var t=this;return this.emit(Types$1.AbVersionChangeOn,e,Types$1.Ab),function(){t.emit(Types$1.AbVersionChangeOff,e,Types$1.Ab)}},e.prototype.offAbSdkVersionChange=function(e){this.emit(Types$1.AbVersionChangeOff,e,Types$1.Ab)},e.prototype.openOverlayer=function(){this.emit(Types$1.AbOpenLayer,"",Types$1.Ab)},e.prototype.closeOverlayer=function(){this.emit(Types$1.AbCloseLayer,"",Types$1.Ab)},e.prototype.getAllVars=function(e){this.emit(Types$1.AbAllVars,e,Types$1.Ab)},e.prototype.autoInitializationRangers=function(e){AutoBase(e)},e.prototype.destoryInstace=function(){this.destroyInstance||(this.destroyInstance=!0,this.off(Types$1.TokenComplete))},e.plugins=[],e}(),STYLE_ID="__rangers_ab_style__";function openOverlayer(){if(!document.getElementById(STYLE_ID)){var e="body { opacity: 0 !important; }",t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.id=STYLE_ID,r.type="text/css",r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e)),t.appendChild(r)}}function closeOverlayer(){var e=document.getElementById(STYLE_ID);e&&e.parentElement.removeChild(e)}var msgQueueMap={},allowdOrigins=[],addAllowdOrigin=function(e){e.length&&e.forEach((function(e){allowdOrigins.push(e)}))};function dispatchMsg(e,t,r,i){var n=e&&e.source||window.opener||window.parent,o=e&&e.origin||i||"*",a={type:t,payload:r};n.postMessage(JSON.stringify(a),o)}function receiveMsg(e,t){msgQueueMap[e]=msgQueueMap[e]||[],msgQueueMap[e].push(t)}function processMsg(e){if(allowdOrigins.some((function(e){return"*"===e}))||allowdOrigins.some((function(t){return e.origin.indexOf(t)>-1}))){var t=e.data;if("string"==typeof e.data)try{t=JSON.parse(e.data)}catch(n){t=void 0}if(!t)return;var r=t.type,i=t.payload;msgQueueMap[r]&&msgQueueMap[r].forEach((function(t){"function"==typeof t&&t(e,i)}))}}function init(e,t){var r=__assign({},e);delete r.filter,(window.opener||window.parent).postMessage({type:"tea:sdk:info",config:r,version:t},"*"),window.addEventListener("message",processMsg,!1)}var VISUAL_URL="",isLoaded=!1;function loadEditorScript(e){var t=e.event,r=e.editorUrl;e.collectInstance,e.fromSession,isLoaded||(isLoaded=!0,loadScript(r,(function(){dispatchMsg(t,"abEditorScriptloadSuccess")}),(function(){t&&dispatchMsg(t,"abEditorScriptloadError"),isLoaded=!1})))}function readyToLoadEditor(e,t){window.TEAVisualEditor=window.TEAVisualEditor||{},addAllowdOrigin(["*"]);var r,i="";init(t,SDK_VERSION);var n="";try{var o=window.performance.getEntriesByType("resource");if(o&&o.length&&(o.forEach((function(e){"script"===e.initiatorType&&e.name&&-1!==e.name.indexOf("collect")&&(n=e.name)})),n||document.currentScript&&(n=document.currentScript.src),n&&(r=n.split("/"))&&r.length)){i="https:/";for(var a=2;a<r.length&&a!==r.length-1;a++)i=i+"/"+r[a];i+="/visual-ab-core"}}catch(s){}receiveMsg("tea:openVisualABEditor",(function(r){var n=r.data;if("string"==typeof r.data)try{n=JSON.parse(r.data)}catch(s){n=void 0}if(n){var o=n.lang;if(n.appId!==t.app_id)return dispatchMsg(r,"appIdError"),void console.error("abtest appid is not belong the page appid please check");var a=n.version;VISUAL_URL=a&&i?i+(a?"."+a:".1.0.1")+".js?query="+Date.now():VISUAL_AB_CORE+"?query="+Date.now(),window.TEAVisualEditor.lang=o,window.TEAVisualEditor.__ab_domin=t.channel_domain||"",loadEditorScript({event:r,editorUrl:VISUAL_URL,collectInstance:e})}}))}var loadMuiltlink=function(e,t){window.TEAVisualEditor=window.TEAVisualEditor||{},window.TEAVisualEditor.appId=t.app_id,receiveMsg("tea:openTesterEventInspector",(function(t){var r=t.data;if("string"==typeof t.data)try{r=JSON.parse(t.data)}catch(a){r=void 0}if(r){var i=r.referrer,n=r.lang,o=r.appId;window.TEAVisualEditor.__editor_ajax_domain=i||"",window.TEAVisualEditor.__ab_appId=o||"",window.TEAVisualEditor.lang=n||"",loadEditorScript({event:t,editorUrl:VISUAL_URL_INSPECTOR+".js?query="+Date.now(),collectInstance:e})}}))},loadVisual=function(e){window.TEAVisualEditor=window.TEAVisualEditor||{},window.TEAVisualEditor.__ab_config=e,loadScript(VISUAL_AB_LOADER+"?query="+Date.now(),(function(){console.log("load visual render success")}),(function(){console.log("load visual render fail")}))},CallbackType;!function(e){e[e.Var=0]="Var",e[e.All=1]="All"}(CallbackType||(CallbackType={}));var STORAGE_EXPRIRE=2592e6,API="/service/2/abtest_config/",Ab=function(){function e(){this.fetchStatus="no",this.refreshFetchStatus="complete",this.versions=[],this.extVersions=[],this.mulilinkVersions=[],this.enable_multilink=!1,this.enable_ab_visual=!1,this.editMode=!1,this.callbacks=[],this.data=null,this.changeListener=new Map,this.readyStatus=!1,this.exposureCache=[]}return e.prototype.apply=function(e,t){var r=this;if(this.collect=e,this.config=t,this.config.enable_ab_test){var i=t.enable_multilink,n=t.ab_channel_domain,o=t.enable_ab_visual,a=t.ab_cross,s=t.ab_cookie_domain,l=n||decodeUrl(AB_DOMAINS[t.channel||"cn"]),c=e.adapters,u=c.storage,h=c.fetch;this.cacheStorgae=new u(!1),this.fetch=h,this.enable_multilink=i,this.enable_ab_visual=o,this.abKey="__tea_sdk_ab_version_"+t.app_id,this.ab_cross=a,this.ab_cookie_domain=s||"",this.fetchUrl=""+l+API,this.reportUrl=""+e.configManager.getUrl("event"),this.exposureLimit=t.exposure_limit||20,this.ab_batch_time=t.ab_batch_time||500;var d=this.collect.Types;this.types=d,this.collect.on(d.TokenChange,(function(e){"uuid"===e&&r.readyStatus&&(r.clearCache(),r.fetchAB())})),this.collect.on(d.TokenReset,(function(e){"uuid"===e&&r.readyStatus&&(r.clearCache(),r.fetchAB())})),this.collect.on(d.AbVar,(function(e){var t=e.name,i=e.defaultValue,n=e.callback;r.getVar(t,i,n)})),this.collect.on(d.AbAllVars,(function(e){r.getAllVars(e)})),this.collect.on(d.AbConfig,(function(e){var t=e.params,i=e.callback;r.getABconfig(t,i)})),this.collect.on(d.AbExternalVersion,(function(e){r.setExternalAbVersion(e)})),this.collect.on(d.AbOpenLayer,(function(){r.openOverlayer()})),this.collect.on(d.AbCloseLayer,(function(){r.closeOverlayer()})),this.collect.on(d.AbVersionChangeOn,(function(e){r.changeListener.set(e,e)})),this.collect.on(d.AbVersionChangeOff,(function(e){r.changeListener.get(e)&&r.changeListener.delete(e)})),this.loadMode(),(this.enable_ab_visual||this.enable_multilink)&&this.openOverlayer(this.config.multilink_timeout_ms||500),this.checkLocal(),this.ready("ab"),this.readyStatus||(this.fetchAB(),this.readyStatus=!0),this.collect.emit(d.AbReady)}},e.prototype.ready=function(e){var t=this;if(this.collect.set(e),this.collect.hook._hooksCache.hasOwnProperty(e)){var r=this.collect.hook._hooksCache[e];if(!Object.keys(r).length)return;var i=function(e){r[e].length&&r[e].forEach((function(r){t.collect.hook.emit(e,r)}))};for(var n in r)i(n)}},e.prototype.loadMode=function(){var e=getIframeUrl(),t="";if(e){var r=e.scenario,i=e.href;r?(this.editMode=!0,t=r):!i||-1===i.indexOf("datatester")&&-1===i.indexOf("visual-editor")||(this.editMode=!0,t="visual-editor")}this.enable_ab_visual&&(readyToLoadEditor(this.collect,this.config),"visual-editor"===t)?this.collect.destoryInstace():this.enable_multilink&&loadMuiltlink(this.collect,this.config)},e.prototype.checkLocal=function(){var e=this.getABCache(),t=e.ab_version,r=e.ab_ext_version,i=e.ab_version_multilink,n=e.data,o=this.checkFromUrl();o?this.mulilinkVersions.push(o):this.mulilinkVersions=i||[],this.extVersions=r||[],this.versions=t||[],this.data=n;var a=this.versions.concat(this.extVersions);this.enable_multilink&&(a=a.concat(this.mulilinkVersions)),this.configVersions(a.join(","))},e.prototype.checkFromUrl=function(){var e=parseUrlQuery(window.location.href);return e&&e.vid?e.vid:""},e.prototype.updateVersions=function(){var e=this.extVersions.length?this.versions.concat(this.extVersions):this.versions;this.enable_multilink&&(e=e.concat(this.mulilinkVersions)),this.configVersions(e.join(",")),this.updateABCache(),this.changeListener.size>0&&this.changeListener.forEach((function(t){"function"==typeof t&&t(e)}))},e.prototype.configVersions=function(e){this.collect.configManager.setAbVersion(e)},e.prototype.getVar=function(e,t,r){if(!e)throw new Error("variable must not be empty");if(void 0===t)throw new Error("variable no default value");if("function"!=typeof r)throw new Error("callback must be a function");var i={name:e,defaultValue:t,callback:r,type:CallbackType.Var};"complete"===this.fetchStatus&&"complete"===this.refreshFetchStatus?this.getRealVar(i,e):this.callbacks.push(i)},e.prototype.getRealVar=function(e,t){var r=e.name,i=e.defaultValue,n=e.callback,o=this.data;if(o){if(isObject$1(o[r])){var a=o[r].vid;return"$ab_url"===t?this.mulilinkVersions.includes(a)||this.mulilinkVersions.push(a):this.versions.includes(a)||this.versions.push(a),this.updateVersions(),this.fechEvent(a,t,i),n(o[r].val),void this.collect.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"SDK 曝光了实验"+r,level:"info",time:Date.now(),data:o[r]})}this.collect.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"SDK 调用getVar",level:"info",time:Date.now(),data:i}),n(i)}else n(i)},e.prototype.getAllVars=function(e){if("function"!=typeof e)throw new Error("callback must be a function");var t={callback:e,type:CallbackType.All};"complete"===this.fetchStatus&&"complete"===this.refreshFetchStatus?this.getRealAllVars(t):this.callbacks.push(t)},e.prototype.getRealAllVars=function(e){(0,e.callback)(this.data?JSON.parse(JSON.stringify(this.data)):{}),this.collect.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"SDK 调用getAllVars",level:"info",time:Date.now(),data:this.data})},e.prototype.fechEvent=function(e,t,r){try{if(this.config.disable_track_event)return;if(!e)return;var i=this.collect.configManager.get(),n=i.header,o=i.user,a=this.getABCache();if(a&&a.uuid&&a.uuid!==o.user_unique_id)return;var s={event:"abtest_exposure",ab_sdk_version:""+e,params:JSON.stringify({app_id:this.config.appId,ab_url:"$ab_url"===t?r:window.location.href}),local_time_ms:Date.now()};n.custom=JSON.stringify(n.custom);var l={events:[s],user:o,header:n};"$ab_url"===t&&window.navigator.sendBeacon?window.navigator.sendBeacon(this.reportUrl,JSON.stringify([l])):this.reportExposure(l)}catch(c){this.collect.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:c.message})}},e.prototype.reportExposure=function(e){var t=this;this.exposureCache.push(e),this.reportTimeout&&clearTimeout(this.reportTimeout),this.exposureCache.length>=this.exposureLimit?this.report():this.reportTimeout=setTimeout((function(){t.report(),clearTimeout(t.reportTimeout)}),this.ab_batch_time)},e.prototype.report=function(){var e=this;this.fetch(this.reportUrl,this.exposureCache,2e4),this.exposureCache.forEach((function(t){e.collect.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_EVENT,info:"埋点上报成功",time:Date.now(),data:[t],code:200,status:"success"})})),this.exposureCache=[]},e.prototype.setExternalAbVersion=function(e){this.extVersions=[e],this.updateVersions()},e.prototype.getABconfig=function(e,t){var r=Object.keys(e);r&&r.length&&this.collect.configManager.set(e),this.fetchAB(t)},e.prototype.get=function(e){if(this.ab_cross){var t=this.cacheStorgae.getCookie(e,this.ab_cookie_domain);return t?JSON.parse(t):null}return this.cacheStorgae.getItem(e)},e.prototype.set=function(e,t){this.ab_cross?this.cacheStorgae.setCookie(e,t,STORAGE_EXPRIRE,this.ab_cookie_domain):this.cacheStorgae.setItem(e,t),this.collect.configManager.setAbCache(t)},e.prototype.getABCache=function(e){var t={ab_version:[],ab_ext_version:[],ab_version_multilink:[],data:null,timestamp:+new Date,uuid:""};return t=this.get(this.abKey)||t,Date.now()-t.timestamp>=STORAGE_EXPRIRE?(this.cacheStorgae.removeItem(this.abKey),null):e?t[e]:t},e.prototype.updateABCache=function(){var e=this.getABCache();e.ab_version_multilink=this.mulilinkVersions,e.ab_ext_version=this.extVersions,e.ab_version=this.versions,e.timestamp=Date.now(),this.set(this.abKey,e)},e.prototype.setAbCache=function(e){var t=this.getABCache();t.data=this.data,t.uuid=e,t.timestamp=Date.now(),this.set(this.abKey,t)},e.prototype.clearCache=function(){this.refreshFetchStatus="ing",this.data={},this.extVersions=[],this.mulilinkVersions=[],this.versions=[]},e.prototype.openOverlayer=function(e){var t=this;if(openOverlayer(),e)var r=setTimeout((function(){t.closeOverlayer(),clearTimeout(r)}),e)},e.prototype.closeOverlayer=function(){closeOverlayer()},e.prototype.fetchComplete=function(e,t){var r=this;if(e&&"[object Object]"==Object.prototype.toString.call(e)){this.data=e,this.setAbCache(t);var i=[];Object.keys(e).forEach((function(t){var r=e[t].vid;r&&i.push(r)})),this.versions=this.versions.filter((function(e){return i.includes(e)}));var n=e.$ab_url,o=e.$ab_modification;if(o&&o.val&&this.enable_ab_visual){if(this.collect.destroyInstance)return;this.getVar("$ab_modification",window.location.href,(function(){loadVisual(o.val),r.closeOverlayer()}))}else if(n&&this.enable_multilink){this.mulilinkVersions=this.mulilinkVersions.filter((function(e){return i.includes(e)}));var a=n.val,s=n.vid;a&&s&&this.getVar("$ab_url",a,(function(){r.editMode||(a!==window.location.href?setTimeout((function(){if(!r.collect.destroyInstance){var e=""+a;e=-1===e.indexOf("http")?"https://"+e:e,parseURL(e).host!==location.host?e=e+"&vid="+s:window.history.replaceState("","",e),window.location.href=e}}),100):r.closeOverlayer())}))}this.updateVersions()}else this.closeOverlayer();this.callbacks.forEach((function(e){return r[e.type===CallbackType.Var?"getRealVar":"getRealAllVars"](e,"")})),this.callbacks=[]},e.prototype.fetchAB=function(e){var t=this,r=this.collect.configManager.get(),i={header:__assign({aid:this.config.app_id},r.user||{},r.header||{},{ab_sdk_version:this.collect.configManager.getAbVersion(),ab_url:window.location.href})};this.collect.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"SDK 发起AB实验请求",level:"info",logType:"fetch",time:Date.now(),data:i}),this.fetch(this.fetchUrl,i,this.config.ab_timeout||3e3,!1,(function(i){t.fetchStatus="complete",t.refreshFetchStatus="complete";var n=i.data;"success"===i.message?(t.fetchComplete(n,r.user.user_unique_id),e&&e(n)):(t.fetchComplete(null,r.user.user_unique_id),e&&e(null)),t.collect.emit(t.types.AbComplete,n),t.collect.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"AB实验请求成功",level:"info",logType:"fetch",time:Date.now(),data:n})}),(function(){t.fetchStatus="complete",t.refreshFetchStatus="complete",t.fetchComplete(null,r.user.user_unique_id),t.collect.emit(t.types.AbTimeout),e&&e(null),t.collect.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"AB实验请求网络异常",level:"error",logType:"fetch",time:Date.now()})}))},e.prototype.filterUrl=function(e){try{var t="";-1!==e.indexOf("&multilink=true")?t="&multilink=true[\0-ÿ]*":-1!==e.indexOf("?multilink=true")&&(t="\\?multilink=true[\0-ÿ]*");var r=new RegExp(t,"g");e=e.replace(r,"")}catch(i){}return e},e}(),Et=function(){function e(){}return e.prototype.apply=function(e,t){var r=this;if(e.adapters.fetch,t.event_verify_url)if("string"==typeof t.event_verify_url){if(this.url=t.event_verify_url+"/v1/list_test",this.url){var i=e.Types;e.on(i.SubmitBefore,(function(e){window.navigator.sendBeacon(r.url,JSON.stringify(e))}))}}else console.log("please use correct et_test url")},e}(),Alive=function(){function e(e,t){this.maxDuration=432e5,this.aliveDTime=6e4,this.options={aliveName:"predefine_page_alive",params:{}},this.collect=e,this.config=t,this.pageStartTime=Date.now(),this.sessionStartTime=this.pageStartTime,this.timerHandler=null,isObject$1(t.enable_stay_duration)&&(this.options=Object.assign(this.options,t.enable_stay_duration))}return e.prototype.setParams=function(e,t,r){this.set_path=e,this.set_url=r,this.set_title=t},e.prototype.enable=function(e,t,r){this.url_path=e,this.url=r,this.title=t,this.disableCallback=this.enablePageAlive()},e.prototype.disable=function(){this.disableCallback(),this.pageStartTime=Date.now()},e.prototype.sendEvent=function(e,t){void 0===t&&(t=!1);var r=t?this.aliveDTime:Date.now()-this.sessionStartTime;r<0||r>this.aliveDTime||Date.now()-this.pageStartTime>this.maxDuration||(this.collect.beconEvent(this.options.aliveName,__assign({url_path:this.getParams("url_path"),title:this.getParams("title"),url:this.getParams("url"),duration:r,is_support_visibility_change:isSupVisChange(),startTime:this.sessionStartTime,hidden:document.visibilityState,leave:e},this.options.params)),this.set_path||this.set_title||this.set_url||this.setParams(location.pathname,location.href,document.title),this.sessionStartTime=Date.now())},e.prototype.getParams=function(e){switch(e){case"url_path":return this.set_path||this.url_path||location.pathname;case"title":return this.set_title||this.title||document.title||location.pathname;case"url":return this.set_url||this.url||location.href}},e.prototype.setUpTimer=function(){var e=this;return this.timerHandler&&clearInterval(this.timerHandler),setInterval((function(){Date.now()-e.sessionStartTime>e.aliveDTime&&e.sendEvent(!1,!0)}),1e3)},e.prototype.visibilitychange=function(){"hidden"===document.visibilityState?this.timerHandler&&(clearInterval(this.timerHandler),this.sendEvent(!1)):"visible"===document.visibilityState&&(this.sessionStartTime=Date.now(),this.timerHandler=this.setUpTimer())},e.prototype.beforeunload=function(){document.hidden||this.sendEvent(!0)},e.prototype.enablePageAlive=function(){var e=this;this.timerHandler=this.setUpTimer();var t=this.visibilitychange.bind(this),r=this.beforeunload.bind(this);return document.addEventListener("visibilitychange",t),window.addEventListener("pagehide",r),function(){e.beforeunload(),document.removeEventListener("visibilitychange",t),window.removeEventListener("pagehide",r)}},e}(),Close=function(){function e(e,t){var r=this;this.maxDuration=432e5,this.aliveDTime=6e4,this.options={closeName:"predefine_page_close",params:{}},this.visibilitychange=function(){"hidden"===document.visibilityState?r.activeEndTime=Date.now():"visible"===document.visibilityState&&(r.activeEndTime&&(r.totalTime+=r.activeEndTime-r.activeStartTime,r.activeTimes+=1),r.activeEndTime=void 0,r.activeStartTime=Date.now())},this.beforeunload=function(){if(r.totalTime+=(r.activeEndTime||Date.now())-r.activeStartTime,r.config.autotrack)try{window.sessionStorage.setItem("_tea_cache_duration",JSON.stringify({duration:r.totalTime,page_title:document.title||location.pathname}))}catch(e){}r.sendEventPageClose()},this.collect=e,this.config=t,this.maxDuration=t.maxDuration||864e5,this.pageStartTime=Date.now(),isObject$1(t.enable_stay_duration)&&(this.options=Object.assign(this.options,t.enable_stay_duration)),this.resetData()}return e.prototype.setParams=function(e,t,r){this.set_path=e,this.set_url=r,this.set_title=t},e.prototype.enable=function(e,t,r){this.url_path=e,this.url=r,this.title=t,this.disableCallback=this.enablePageClose()},e.prototype.disable=function(){this.disableCallback()},e.prototype.resetData=function(){this.activeStartTime=void 0===this.activeStartTime?this.pageStartTime:Date.now(),this.activeEndTime=void 0,this.activeTimes=1,this.totalTime=0},e.prototype.sendEventPageClose=function(){var e=Date.now()-this.pageStartTime;this.totalTime<0||e<0||this.totalTime>=this.maxDuration||(this.collect.beconEvent(this.options.closeName,__assign({url_path:this.getParams("url_path"),title:this.getParams("title"),url:this.getParams("url"),active_times:this.activeTimes,duration:this.totalTime,total_duration:e,is_support_visibility_change:isSupVisChange()},this.options.params)),this.pageStartTime=Date.now(),this.set_path||this.set_title||this.set_url||this.setParams(location.pathname,location.href,document.title),this.resetData())},e.prototype.getParams=function(e){switch(e){case"url_path":return this.set_path||this.url_path||location.pathname;case"title":return this.set_title||this.title||document.title||location.pathname;case"url":return this.set_url||this.url||location.href}},e.prototype.enablePageClose=function(){var e=this,t=this.visibilitychange.bind(this),r=this.beforeunload.bind(this);return document.addEventListener("visibilitychange",t),window.addEventListener("pagehide",r),function(){e.beforeunload(),document.removeEventListener("visibilitychange",t),window.removeEventListener("pagehide",r)}},e}(),Stay=function(){function e(){}return e.prototype.apply=function(e,t){var r=this;if(this.collect=e,this.config=t,this.config.enable_stay_duration){this.title=document.title||location.pathname,this.url=location.href,this.url_path=location.pathname,this.pageAlive=new Alive(e,t),this.pageClose=new Close(e,t);var i=this.collect.Types;this.collect.on(i.ResetStay,(function(e){var t=e.url_path,i=e.title,n=e.url;r.resetStayDuration(t,i,n)})),this.collect.on(i.RouteChange,(function(e){e.init||t.disable_route_report||r.resetStayDuration()})),this.collect.on(i.SetStay,(function(e){var t=e.url_path,i=e.title,n=e.url;r.setStayParmas(t,i,n)})),this.enable(this.url_path,this.title,this.url),this.ready(i.Stay),this.collect.emit(i.StayReady)}},e.prototype.ready=function(e){var t=this;if(this.collect.set(e),this.collect.hook._hooksCache.hasOwnProperty(e)){var r=this.collect.hook._hooksCache[e];if(!Object.keys(r).length)return;var i=function(e){r[e].length&&r[e].forEach((function(r){t.collect.hook.emit(e,r)}))};for(var n in r)i(n)}},e.prototype.enable=function(e,t,r){this.pageAlive.enable(e,t,r),this.pageClose.enable(e,t,r)},e.prototype.disable=function(){this.pageAlive.disable(),this.pageClose.disable()},e.prototype.setStayParmas=function(e,t,r){void 0===e&&(e=""),void 0===t&&(t=""),void 0===r&&(r=""),this.pageAlive.setParams(e,t,r),this.pageClose.setParams(e,t,r),this.collect.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"SDK 执行 resetStayParams",level:"info",time:Date.now(),data:{url_path:e,title:t,url:r}})},e.prototype.reset=function(e,t,r){this.disable(),this.enable(e,t,r)},e.prototype.resetStayDuration=function(e,t,r){this.reset(e,t,r),this.collect.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"SDK 执行 resetStayDuration",level:"info",time:Date.now(),data:{url_path:e,title:t,url:r}})},e}(),Profile=function(){function e(){}return e.prototype.apply=function(e,t){var r=this;this.collect=e,this.config=t,this.duration=6e4,this.reportUrl=e.configManager.getDomain()+"/profile/list";var i=e.Types,n=e.adapters.fetch;this.eventCheck=new EventCheck(e,t),this.fetch=n,this.cache={},this.collect.on(i.ProfileSet,(function(e){r.setProfile(e)})),this.collect.on(i.ProfileSetOnce,(function(e){r.setOnceProfile(e)})),this.collect.on(i.ProfileUnset,(function(e){r.unsetProfile(e)})),this.collect.on(i.ProfileIncrement,(function(e){r.incrementProfile(e)})),this.collect.on(i.ProfileAppend,(function(e){r.appendProfile(e)})),this.collect.on(i.ProfileClear,(function(){r.cache={}})),this.ready(i.Profile)},e.prototype.ready=function(e){var t=this;if(this.collect.set(e),this.collect.hook._hooksCache.hasOwnProperty(e)){var r=this.collect.hook._hooksCache[e];if(!Object.keys(r).length)return;var i=function(e){r[e].length&&r[e].forEach((function(r){t.collect.hook.emit(e,r)}))};for(var n in r)i(n)}},e.prototype.report=function(e,t){void 0===t&&(t={});try{if(this.config.disable_track_event)return;var r=[];r.push(this.collect.processEvent(e,t));var i=this.collect.eventManager.merge(r);this.fetch(this.reportUrl,i),this.collect.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_EVENT,info:"埋点上报成功",time:Date.now(),data:i,code:200,status:"success"})}catch(n){this.collect.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:n.message})}},e.prototype.setProfile=function(e){var t=this.formatParams(e);t&&Object.keys(t).length&&(this.pushCache(t),this.report("__profile_set",__assign({},t,{profile:!0})))},e.prototype.setOnceProfile=function(e){var t=this.formatParams(e,!0);t&&Object.keys(t).length&&(this.pushCache(t),this.report("__profile_set_once",__assign({},t,{profile:!0})))},e.prototype.incrementProfile=function(e){e?this.report("__profile_increment",__assign({},e,{profile:!0})):console.warn("please check the params, must be object!!!")},e.prototype.unsetProfile=function(e){if(e){var t={};t[e]="1",this.report("__profile_unset",__assign({},t,{profile:!0}))}else console.warn("please check the key, must be string!!!")},e.prototype.appendProfile=function(e){if(e){var t={};for(var r in e)"string"==typeof e[r]||"Array"===Object.prototype.toString.call(e[r]).slice(8,-1)?t[r]=e[r]:console.warn("please check the value of param: "+r+", must be string or array !!!");Object.keys(t).length&&this.report("__profile_append",__assign({},t,{profile:!0}))}else console.warn("please check the params, must be object!!!")},e.prototype.pushCache=function(e){var t=this;Object.keys(e).forEach((function(r){t.cache[r]={val:t.clone(e[r]),timestamp:Date.now()}}))},e.prototype.formatParams=function(e,t){var r=this;void 0===t&&(t=!1);try{if(!e||"[object Object]"!==Object.prototype.toString.call(e))return void console.warn("please check the params type, must be object !!!");var i={};for(var n in e)"string"==typeof e[n]||"number"==typeof e[n]||"Array"===Object.prototype.toString.call(e[n]).slice(8,-1)?i[n]=e[n]:console.warn("please check the value of params:"+n+", must be string,number,Array !!!");var o=Object.keys(i);if(!o.length)return;if(!this.eventCheck.checkEventParams(i))return;var a=Date.now();return o.filter((function(i){var n=r.cache[i];return t?!n:!(n&&r.compare(n.val,e[i])&&a-n.timestamp<r.duration)})).reduce((function(e,t){return e[t]=i[t],e}),{})}catch(s){this.collect.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:s.message}),console.log("error")}},e.prototype.compare=function(e,t){try{return JSON.stringify(e)===JSON.stringify(t)}catch(r){return this.collect.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:r.message}),!1}},e.prototype.clone=function(e){try{return JSON.parse(JSON.stringify(e))}catch(t2){return this.collect.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:t2.message}),e}},e.prototype.unReady=function(){console.warn("sdk is not ready, please use this api after start")},e}(),HeartBeat=function(){function e(){var e=this;this.setInterval=function(){e.clearIntervalFunc=selfAdjust((function(){e.isSessionhasEvent&&e.endCurrentSession()}),e.sessionInterval)},this.clearInterval=function(){e.clearIntervalFunc&&e.clearIntervalFunc()}}return e.prototype.apply=function(e,t){var r=this;if(this.collect=e,!t.disable_heartbeat){this.sessionInterval=6e4,this.startTime=0,this.lastTime=0,this.setInterval();var i=this.collect.Types;this.collect.on(i.SessionReset,(function(){r.process()}))}},e.prototype.endCurrentSession=function(){this.collect.event("_be_active",{start_time:this.startTime,end_time:this.lastTime,url:window.location.href,referrer:window.document.referrer,title:document.title||location.pathname}),this.isSessionhasEvent=!1,this.startTime=0},e.prototype.process=function(){this.isSessionhasEvent||(this.isSessionhasEvent=!0,this.startTime=+new Date);var e=this.lastTime||+new Date;this.lastTime=+new Date,this.lastTime-e>this.sessionInterval&&(this.clearInterval(),this.endCurrentSession(),this.setInterval())},e}(),Monitor=function(){function e(){}return e.prototype.apply=function(e,t){var r=this;if(this.collect=e,this.config=t,!this.config.channel_domain){var i=e.adapters.fetch;if(this.fetch=i,!t.disable_track_event&&!t.disable_sdk_monitor){this.url=e.configManager.getUrl("event");var n=this.collect.Types;this.collect.on(n.Ready,(function(){r.sdkOnload()})),this.collect.on(n.SubmitError,(function(e){var t=e.type,i=e.eventData,n=e.errorCode;"f_data"===t&&r.sdkError(i,n)}))}}},e.prototype.sdkOnload=function(){var e=this;try{var t=this.collect.configManager.get(),r=t.header,i=t.user,n=r.app_id,o=r.app_name,a=r.sdk_version,s=i.web_id,l={events:[{event:"onload",params:JSON.stringify({app_id:n,app_name:o||"",sdk_version:a,sdk_type:SDK_TYPE,sdk_config:this.config,sdk_desc:"TOC"}),local_time_ms:Date.now()}],user:{user_unique_id:s},header:{}};setTimeout((function(){e.fetch(e.url,[l],3e4,!1,(function(){}),(function(){}),"566f58151b0ed37e")}),16)}catch(c){}},e.prototype.sdkError=function(e,t){var r=this;try{var i=e[0],n=i.user,o=i.header,a=[];e.forEach((function(e){e.events.forEach((function(e){a.push(e)}))}));var s={events:a.map((function(e){return{event:"on_error",params:JSON.stringify({error_code:t,app_id:o.app_id,app_name:o.app_name||"",error_event:e.event,sdk_version:o.sdk_version,local_time_ms:e.local_time_ms,tea_event_index:Date.now(),params:e.params,header:JSON.stringify(o),user:JSON.stringify(n)}),local_time_ms:Date.now()}})),user:{user_unique_id:n.user_unique_id},header:{}};setTimeout((function(){r.fetch(r.url,[s],3e4,!1,(function(){}),(function(){}),"566f58151b0ed37e")}),16)}catch(l){}},e}();function isNeedElement(e,t){if(void 0===t&&(t="list"),!e)return!1;if(t&&"list"===t){if(["LI","TR","DL"].includes(e.nodeName))return!0;if(e.dataset&&e.dataset.hasOwnProperty("teaIdx"))return!0;if(e.hasAttribute&&e.hasAttribute("data-tea-idx"))return!0}else{if(["A","BUTTON"].includes(e.nodeName))return!0;if(e.dataset&&e.dataset.hasOwnProperty("teaContainer"))return!0;if(e.hasAttribute&&e.hasAttribute("data-tea-container"))return!0}return!1}var isAttrFilter=function(e,t){return!!hasAttributes(e,t)};function getContainer(e){for(var t=e;t&&!isNeedElement(t,"container");){if("HTML"===t.nodeName||"BODY"===t.nodeName)return e;t=t.parentElement}return t||e}function getNodeText(e){var t="";return 3===e.nodeType?t=e.textContent.trim():e.dataset&&e.dataset.hasOwnProperty("teaTitle")||e.hasAttribute("ata-tea-title")?t=e.getAttribute("data-tea-title"):e.hasAttribute("title")?t=e.getAttribute("title"):"INPUT"===e.nodeName&&["button","submit"].includes(e.getAttribute("type"))?t=e.getAttribute("value"):"IMG"===e.nodeName&&e.getAttribute("alt")&&(t=e.getAttribute("alt")),t.slice(0,200)}function getText(e){var t=getContainer(e),r=[];return function e(t){var i=getNodeText(t);if(i&&-1===r.indexOf(i)&&r.push(i),t.childNodes.length>0)for(var n=t.childNodes,o=0;o<n.length;o++)8!==n[o].nodeType&&e(n[o])}(t),r}function getTextSingle(e){var t=getContainer(e),r="";return function e(t){var i=getNodeText(t);if(i&&(r+=i),t.childNodes.length>0)for(var n=t.childNodes,o=0;o<n.length;o++)3===n[o].nodeType&&e(n[o])}(t),r}function ignore(e){for(var t=e;t&&t.parentNode;){if(t.hasAttribute("data-tea-ignore"))return!0;if("HTML"===t.nodeName||"body"===t.nodeName)return!1;t=t.parentNode}return!1}var hasAttribute=function(e,t){return e.hasAttribute?e.hasAttribute(t):e.attributes?!(!e.attributes[t]||!e.attributes[t].specified):void 0},hasAttributes=function(e,t){if("string"==typeof t)return hasAttribute(e,t);if(isArray(t)){for(var r=!1,i=0;i<t.length;i++)if(hasAttribute(e,t[i])){r=!0;break}return r}},getAttributes=function(e,t){var r={};if("string"==typeof t)hasAttribute(e,t)&&(r.attrs=e.getAttribute(t));else if(isArray(t))for(var i=0;i<t.length;i++)hasAttribute(e,t[i])&&(r[t[i]]=e.getAttribute(t[i]));return r},elementLevel=function(e){if(e.children.length){var t=e.children;return![].slice.call(t).some((function(e){return e.children.length>0}))}return!0},isSVG=function(e){if("svg"===e.tagName.toLowerCase())return!0;for(var t=e.parentElement,r=!1;t;)"svg"===t.tagName.toLowerCase()?(t=null,r=!0):t=t.parentElement;return r};function isTrack(e,t){if(1!==e.nodeType)return!1;if(!t.svg&&isSVG(e))return!1;if(["HTML","BODY"].includes(e.tagName.toUpperCase()))return!1;var r=e;return!("none"===r.style.display||!isNeedElement(r,"container")&&!elementLevel(r)&&!t.svg)}var Listener=function(){function e(e,t,r){var i=this;this.clickEvent=function(e){isTrack(e.target,i.options)&&i.eventHandel({eventType:"dom",eventName:"click"},e)},this.changeEvent=function(e){i.eventHandel({eventType:"dom",eventName:"change"},e)},this.submitEvent=function(e){i.eventHandel({eventType:"dom",eventName:"submit"},e)},this.getPageViewEvent=function(e,t){t&&"pushState"===t&&i.eventHandel({eventType:"dom",eventName:"beat"},__assign({beat_type:0},e)),i.eventHandel({eventType:"dom",eventName:"page_view"},e)},this.getPageLoadEvent=function(e){i.eventHandel({eventType:"dom",eventName:"page_statistics"},{lcp:e})},this.config=r.getConfig().eventConfig,this.collect=t,this.options=e,this.beatTime=e.beat,this.statistics=!1}return e.prototype.init=function(e){this.eventHandel=e;var t=this.config.mode;this.addListener(t)},e.prototype.addListener=function(e){var t=this;if("proxy-capturing"===e&&(this.config.click&&window.document.addEventListener("click",this.clickEvent,!0),this.config.change&&window.document.addEventListener("change",this.changeEvent,!0),this.config.submit&&window.document.addEventListener("submit",this.submitEvent,!0),this.config.pv&&this.collect.on("route-change",(function(e){var r=e.config,i=e.name;t.getPageViewEvent(r,i)})),this.config.beat)){try{"complete"===document.readyState?this.beatEvent(this.beatTime):window.addEventListener("load",(function(){t.beatEvent(t.beatTime)}));var r=0,i=null;window.addEventListener("scroll",(function(){clearTimeout(i),i=setTimeout(n,500),r=document.documentElement.scrollTop||document.body.scrollTop}));var n=function(){(document.documentElement.scrollTop||document.body.scrollTop)==r&&t.eventHandel({eventType:"dom",eventName:"beat"},{beat_type:1})}}catch(a){}try{var o=window.performance&&window.performance.getEntriesByType("paint");o&&o.length?(new PerformanceObserver((function(e){var r=e.getEntries(),i=r[r.length-1],n=i.renderTime||i.loadTime;t.statistics||(t.getPageLoadEvent(n),t.statistics=!0)})).observe({entryTypes:["largest-contentful-paint"]}),setTimeout((function(){t.statistics||(t.getPageLoadEvent(o[0].startTime||0),t.statistics=!0)}),2e3)):this.getPageLoadEvent(0)}catch(a){this.getPageLoadEvent(0)}}},e.prototype.removeListener=function(){window.document.removeEventListener("click",this.clickEvent,!0),window.document.removeEventListener("change",this.changeEvent,!0),window.document.removeEventListener("submit",this.submitEvent,!0)},e.prototype.beatEvent=function(e){var t=this;try{var r;this.eventHandel({eventType:"dom",eventName:"beat"},{beat_type:3}),this.beatTime&&(r=setInterval((function(){t.eventHandel({eventType:"dom",eventName:"beat"},{beat_type:2})}),e)),beforePageUnload((function(){t.eventHandel({eventType:"dom",eventName:"beat",eventSend:"becon"},{beat_type:0}),t.beatTime&&clearInterval(r)}))}catch(i){}},e}(),defaultConfig$1={eventConfig:{mode:"proxy-capturing",submit:!1,click:!0,change:!1,pv:!0,beat:!0,hashTag:!1,impr:!1},scoutConfig:{mode:"xpath"}},Config=function(){function e(e,t){this.config=e,this.config.eventConfig=Object.assign(this.config.eventConfig,t)}return e.prototype.getConfig=function(){return this.config},e.prototype.setConfig=function(e){return this.config=e},e}();function getPositionData(e){if(e){var t=e.getBoundingClientRect(),r=t.width,i=t.height;return{left:t.left,top:t.top,element_width:r,element_height:i}}}function getEventData(e,t){void 0===e&&(e={}),void 0===t&&(t={});var r=e.clientX,i=e.clientY,n=t.left,o=t.top,a=r-n>=0?r-n:0,s=i-o>=0?i-o:0;return{touch_x:Math.floor(a),touch_y:Math.floor(s)}}function getXpath(e){for(var t=[];null!==e.parentElement;)t.push(e),e=e.parentElement;var r=[],i=[];return t.forEach((function(e){var t=getXpathIndex(e),n=t.str,o=t.index;r.unshift(n),i.unshift(o)})),{element_path:"/"+r.join("/"),positions:i}}function getXpathIndex(e){if(null===e)return{str:"",index:0};var t=0,r=e.parentElement;if(r)for(var i=r.children,n=0;n<i.length&&i[n]!==e;n++)i[n].nodeName===e.nodeName&&t++;return{str:[e.nodeName.toLowerCase(),isNeedElement(e,"list")?"[]":""].join(""),index:t}}function getElementData(e,t,r,i){var n={},o=getPositionData(t),a=getEventData(e,o),s=o.element_width,l=o.element_height,c=a.touch_x,u=a.touch_y,h=getXpath(t),d=h.element_path,p=h.positions,f=getText(t),g=window.performance.timing.navigationStart,y=Date.now()-g,v=p.map((function(e){return""+e})),m=null;if(window.TEAVisualEditor&&window.TEAVisualEditor.getOriginXpath&&(m=window.TEAVisualEditor.getOriginXpath({xpath:d,positions:v})),n.element_path=m&&m.xpath||d,n.positions=m&&m.positions||v,i&&!i.text&&(n.texts=f,n.element_title=getTextSingle(t)),n.element_id=t.getAttribute("id")||"",n.element_class_name=t.getAttribute("class")||"",n.element_type=t.nodeType,n.element_width=Math.floor(s),n.element_height=Math.floor(l),n.touch_x=c,n.touch_y=u,n.page_manual_key="",n.elememt_manual_key="",n.since_page_start_ms=y,n.page_start_ms=g,n.page_path=location.pathname,n.page_host=location.host,r.track_attr&&isAttrFilter(t,r.track_attr)){var _=getAttributes(t,r.track_attr);for(var b in _)n[b]=_[b]}var T=getContainer(t);return"A"===T.tagName&&(n.href=T.getAttribute("href")),"IMG"===t.tagName&&(n.src=t.getAttribute("src")),n}var getEventData$1=function(e,t,r,i,n){return __assign({event:e},getElementData(t,r,i,n),{is_html:1,page_key:window.location.href,page_title:document.title})},getExtraEventData=function(e,t){try{if("bav2b_change"===e)return t.hasAttribute("data-tea-track")?{value:t.value}:{}}catch(r){return{}}},EventHandle=function(){function e(e,t){this.ignore={text:!1},this.initConfig=e,this.options=t,this.eventName=t&&"tea"===t.custom?{click:"__bav_click",page:"__bav_page",beat:"__bav_beat",static:"__bav_page_statistics",exposure:"__bav_page_exposure"}:{click:"bav2b_click",page:"bav2b_page",beat:"bav2b_beat",static:"bav2b_page_statistics",exposure:"bav2b_exposure"},t&&!1===t.text&&(this.ignore.text=!0),t&&t.exposure&&t.exposure.eventName&&(this.eventName.exposure=t.exposure.eventName)}return e.prototype.handleEvent=function(e,t){try{if(ignore(e.target))return null;var r="bav2b_click";switch(t){case"click":return r=this.eventName.click,getEventData$1(r,e,e.target,this.options,this.ignore);case"exposure":return r=this.eventName.exposure,getEventData$1(r,e,e.target,this.options,this.ignore);case"change":return __assign({},getEventData$1(r="bav2b_change",e,e.target,this.options),getExtraEventData(r,e.target));case"submit":return getEventData$1(r="bav2b_submit",e,e.target,this.options)}}catch(i){return console.error(i),null}},e.prototype.handleViewEvent=function(e){e.event=this.eventName.page,e.page_title=document.title,e.page_total_width=window.innerWidth,e.page_total_height=window.innerHeight;try{var t=window.sessionStorage.getItem("_tea_cache_duration");if(t){var r=JSON.parse(t);e.refer_page_duration_ms=r?r.duration:""}e.scroll_width=document.documentElement.scrollLeft?document.documentElement.scrollLeft+window.innerWidth:window.innerWidth,e.scroll_height=document.documentElement.scrollTop?document.documentElement.scrollTop+window.innerHeight:window.innerHeight,e.page_start_ms=window.performance.timing.navigationStart}catch(i){console.log("page event error "+JSON.stringify(i))}return e},e.prototype.handleStatisticsEvent=function(e){var t={};t.event=this.eventName.static,t.is_html=1,t.page_key=location.href,t.refer_page_key=document.referrer||"",t.page_title=document.title,t.page_manual_key=this.initConfig.autotrack.page_manual_key||"",t.refer_page_manual_key="";try{var r=e.lcp,i=window.performance.timing,n=i.loadEventEnd-i.navigationStart;t.page_init_cost_ms=parseInt(r||(n>0?n:0)),t.page_start_ms=i.navigationStart}catch(o){console.log("page_statistics event error "+JSON.stringify(o))}return t},e.prototype.handleBeadtEvent=function(e){e.event=this.eventName.beat,e.page_key=window.location.href,e.is_html=1,e.page_title=document.title,e.page_manual_key=this.initConfig.autotrack.page_manual_key||"";try{e.page_viewport_width=window.innerWidth,e.page_viewport_height=window.innerHeight,e.page_total_width=document.documentElement.scrollWidth,e.page_total_height=document.documentElement.scrollHeight,e.scroll_width=document.documentElement.scrollLeft+window.innerWidth,e.scroll_height=document.documentElement.scrollTop+window.innerHeight,e.since_page_start_ms=Date.now()-window.performance.timing.navigationStart,e.page_start_ms=window.performance.timing.navigationStart}catch(t2){console.log("beat event error "+JSON.stringify(t2))}return e},e}(),Request=function(){function e(e){this.collect=e,this.eventNameList=["report_click_event","report_change_event","report_submit_event","report_exposure_event","report_page_view_event","report_page_statistics_event","report_beat_event"]}return e.prototype.send=function(e,t){var r=e.eventSend,i=t.event;delete t.event,r&&"becon"===r?this.collect.beconEvent(i,t):this.collect.event(i,t)},e.prototype.get=function(e,t){var r=Object.assign({headers:{"content-type":"application/json"},method:"GET"},t);fetch(e,r)},e.prototype.post=function(e,t){var r=Object.assign({headers:{"content-type":"application/json"},method:"POST"},t);fetch(e,r)},e}(),COOKIE_KEY="_TEA_VE_OPEN",COOKIE_KEY_HOST="_TEA_VE_APIHOST",COOKIE_LANG="lang",COOKIE_EDIT_VERISON="_VISUAL_EDITOR_V",COOKIE_EDIT_URL="_VISUAL_EDITOR_U";function checkSession(){return"1"===js_cookie.get(COOKIE_KEY)}function checkSessionHost(){var e=js_cookie.get(COOKIE_KEY_HOST);try{e=JSON.parse(e)}catch(t2){}return e}function checkEditUrl(){return js_cookie.get(COOKIE_EDIT_URL)}function setSession(){try{var e=window.TEAVisualEditor.lang=window.TEAVisualEditor.lang||js_cookie.get(COOKIE_LANG),t=window.TEAVisualEditor.__editor_ajax_domain=window.TEAVisualEditor.__editor_ajax_domain||js_cookie.get(COOKIE_KEY_HOST),r=window.TEAVisualEditor.__editor_verison=window.TEAVisualEditor.__editor_verison||js_cookie.get(COOKIE_EDIT_VERISON),i=window.TEAVisualEditor.__editor_url=window.TEAVisualEditor.__editor_url||js_cookie.get(COOKIE_EDIT_URL),n=+new Date,o=new Date(n+18e5);js_cookie.set(COOKIE_KEY,"1",{expires:o}),js_cookie.set(COOKIE_KEY_HOST,t,{expires:o}),js_cookie.set(COOKIE_EDIT_URL,i,{expires:o}),js_cookie.set(COOKIE_LANG,e,{expires:o}),js_cookie.set(COOKIE_EDIT_VERISON,r||"",{expires:o})}catch(a){console.log("set cookie err")}}var isLoaded$1=!1;function loadEditorScript$1(e){var t=e.event,r=e.editorUrl,i=e.autoTrackInstance;isLoaded$1||(isLoaded$1=!0,loadScript(r,(function(){dispatchMsg(t,"editorScriptloadSuccess"),i.destroy()}),(function(){t&&dispatchMsg(t,"editorScriptloadError"),isLoaded$1=!1})))}function readyToLoadEditor$1(e,t){window.TEAVisualEditor=window.TEAVisualEditor||{};var r="",i=VISUAL_EDITOR_RANGERS+"?query="+Date.now();window.TEAVisualEditor.appId=t.app_id;var n=t.channel_domain,o="";if(addAllowdOrigin(["*"]),n){var a,s="";try{var l=window.performance.getEntriesByType("resource");if(l&&l.length&&(l.forEach((function(e){"script"===e.initiatorType&&e.name&&-1!==e.name.indexOf("collect")&&(s=e.name)})),s&&(a=s.split("/"))&&a.length)){o="https:/";for(var c=2;c<a.length&&c!==a.length-1;c++)o=o+"/"+a[c];if(o&&o.indexOf("/5.0")){var u=o.split("/5.0");o=u[0]||o}}}catch(p){}}if(init(t,SDK_VERSION),checkSession()){var h=checkSessionHost(),d="";h&&(window.TEAVisualEditor.__editor_ajax_domain=h,d=checkEditUrl()),loadEditorScript$1({event:null,editorUrl:d||i,autoTrackInstance:e}),setSession()}else try{receiveMsg("tea:openVisualEditor",(function(t){var a=t.data;if("string"==typeof t.data)try{a=JSON.parse(t.data)}catch(p){a=void 0}if(a){var s=a.referrer,l=a.lang;if(s&&(window.TEAVisualEditor.__editor_ajax_domain=s),r=i,n){var c=a.version;r=o?o+(c?"/visual-editor-rangers-v"+c:"/visual-editor-rangers-v1.0.0")+".js":i,window.TEAVisualEditor.__editor_verison=c}window.TEAVisualEditor.__editor_url=r,window.TEAVisualEditor.lang=l,loadEditorScript$1({event:t,editorUrl:r,autoTrackInstance:e}),setSession()}})),window.TEAVisualEditor.openAutotrackEditor=function(){loadEditorScript$1({event:null,editorUrl:window.TEAVisualEditor.__editor_url,autoTrackInstance:e})}}catch(p){console.log("receive message error")}try{receiveMsg("tea:openHeatMapCore",(function(r){var i=HOT_PIC_URL,n=r.data.app_id;n&&n!==t.app_id||loadEditorScript$1({event:r,editorUrl:i+".js?query="+Date.now(),autoTrackInstance:e})}))}catch(p){console.log("openHeatMapCore error")}}var Observer=function(){function e(e){this._instance=null,this._intersection=e,this.init()}return e.prototype.init=function(){var e=this;this._instance=new MutationObserver((function(t){t.forEach((function(t){"attributes"===t.type&&e.attributeChangeObserve(t),"childList"===t.type&&e.modifyNodeObserve(t)}))})),this._instance.observe(document.body,{childList:!0,attributes:!0,subtree:!0,attributeOldValue:!1})},e.prototype.attributeChangeObserve=function(e){e.target.hasAttribute("data-exposure")?this.exposureAdd(e,"mutation"):this.exposureRemove(e)},e.prototype.modifyNodeObserve=function(e){var t=this;Array.prototype.forEach.call(e.addedNodes,(function(e){1===e.nodeType&&e.hasAttribute("data-exposure")&&t.exposureAdd(e,"intersect"),t.mapChild(e,t.exposureAdd)})),Array.prototype.forEach.call(e.removedNodes,(function(e){1===e.nodeType&&e.hasAttribute("data-exposure")&&t.exposureRemove(e),t.mapChild(e,t.exposureRemove)}))},e.prototype.mapChild=function(e,t){var r=this;1===e.nodeType&&e.children.length&&Array.prototype.forEach.call(e.children,(function(e){1===e.nodeType&&e.hasAttribute("data-exposure")&&t(e),r.mapChild(e,t)}))},e.prototype.exposureAdd=function(e,t){this._intersection.exposureAdd(e,t)},e.prototype.exposureRemove=function(e){this._intersection.exposureRemove(e)},e._exposure_observer=null,e}(),Intersection=function(){function e(t,r){this.count=1,this.instance=this.buildObserver(),this.observeMap=e._observer_map,t.autotrack.exposure.ratio?this.Ratio=t.autotrack.exposure.ratio:0===t.autotrack.exposure.ratio?this.Ratio=0:this.Ratio=.5,this.EventHandle=r}return e.prototype.buildObserver=function(){var t=this;if(!e._observer_instance)return IntersectionObserver&&(e._observer_instance=new IntersectionObserver((function(e){e.forEach((function(e){t.observeMap.get(e.target._observeId)&&t.exposureEvent(e)}))}),{threshold:[.01,.25,.5,.75,1]})),e._observer_instance},e.prototype.exposureAdd=function(e,t){var r=e;"mutation"===t&&(r=e.target);var i=r._observeId;if(i||this.observeMap.has(i)){if(!1===r.visible){var n=r.getBoundingClientRect(),o=n.top,a=n.left,s=n.right,l=n.bottom;o>=0&&l<=window.innerHeight&&a>=0&&s<=window.innerWidth&&(r.visible=!0,this.EventHandle({eventType:"dom",eventName:"exposure"},e))}}else r._observeId=this.count,r.visible=!1,this.observeMap.set(this.count,r),this.observe(r),this.count++},e.prototype.exposureRemove=function(e){this.observeMap.has(e._observeId)&&(this.observeMap.delete(e._observeId),this.unobserve(e))},e.prototype.exposureEvent=function(e){if(e.intersectionRatio>=this.Ratio&&e.isIntersecting){if("0"===e.target.style.opacity||"hidden"===e.target.style.visibility)return;if(!0===e.target.visible)return;e.target.visible=!0,this.EventHandle({eventType:"dom",eventName:"exposure"},e)}else e.target.visible=!1},e.prototype.observe=function(e){this.instance.observe(e)},e.prototype.unobserve=function(e){this.instance.unobserve(e)},e._observer_instance=null,e._observer_map=new Map,e}(),Exposure=function(){function e(e,t){e.autotrack&&e.autotrack.exposure&&(this._intersection=new Intersection(e,t),this._observer=new Observer(this._intersection),this.initObserver())}return e.prototype.initObserver=function(){var e=this;Array.prototype.forEach.call(document.querySelectorAll("[data-exposure]"),(function(t){e._intersection.exposureAdd(t,"intersect")}))},e}(),defaultOpt={hashTag:!1,impr:!1},AutoTrack=function(){function e(){}return e.prototype.apply=function(e,t){if(this.autoTrackStart=!1,this.collect=e,this.config=t,t.autotrack){var r=e.Types;t.autotrack&&t.autotrack.collect_url&&!t.autotrack.collect_url()||(this.ready(r.Autotrack),this.collect.emit(r.AutotrackReady))}},e.prototype.ready=function(e){this.collect.set(e);var t=this.config.autotrack;t="object"==typeof t?t:{},t=Object.assign(defaultOpt,t),this.destroyed=!1,this.options=t,this.Config=new Config(defaultConfig$1,this.options),this.Exposure=new Exposure(this.config,this.handle.bind(this)),this.Listener=new Listener(t,this.collect,this.Config),this.EventHandle=new EventHandle(this.config,t),this.Request=new Request(this.collect),this.autoTrackStart=!0,this.init(),readyToLoadEditor$1(this,this.config)},e.prototype.init=function(){this.Listener.init(this.handle.bind(this))},e.prototype.handle=function(e,t){"dom"===e.eventType&&this.handleDom(e,t)},e.prototype.handleDom=function(e,t){try{var r=e.eventName;if("click"===r||"exposure"===r||"change"===r||"submit"===r){var i=this.EventHandle.handleEvent(t,r);null!==i&&this.Request.send({eventType:"custom",eventName:"report_"+r+"_event",extra:{methods:"GET"}},i)}else if("page_view"===r||"page_statistics"===r){var n;n="page_view"===r?this.EventHandle.handleViewEvent(t):this.EventHandle.handleStatisticsEvent(t),this.Request.send({eventType:"custom",eventName:"report_${eventName}_event",extra:{methods:"GET"}},n)}else if("beat"===r){var o=this.EventHandle.handleBeadtEvent(t),a=e.eventSend;this.Request.send({eventType:"custom",eventName:"report_${eventName}_event",extra:{methods:"GET"},eventSend:a},o)}}catch(s){console.log("handel dom event error "+JSON.stringify(s))}},e.prototype.destroy=function(){if(!this.autoTrackStart)return console.warn("engine is undefined, make sure you have called autoTrack.start()");this.autoTrackStart=!1,this.Listener.removeListener()},e}(),State;!function(e){e.Net="net",e.FailNet="f_net",e.FailData="f_data"}(State||(State={}));var EventList={pv:["predefine_pageview"],sdk:["_be_active","predefine_page_alive","predefine_page_close","__profile_set","__profile_set_once","__profile_increment","__profile_unset","__profile_append"],autotrack:["bav2b_click","bav2b_page","bav2b_beat","bav2b_page_statistics","__bav_click","__bav_page","__bav_beat","__bav_page_statistics"]},Tracer=function(){function e(){}return e.prototype.apply=function(e,t){var r=this;if(this.ready=t.app_id&&t.enable_tracer&&!t.disable_track_event,this.ready){this.limit={pv:1,sdk:3,autotrack:3,log:3},this.errorCode={f_net:0,f_data:0},this.tracerCache=new Map,this.collect=e,this.appid=t.app_id,this.reportUrl=e.configManager.getUrl("event");var i=this.collect.Types,n=e.adapters.fetch;this.fetch=n,this.collect.on(i.Event,(function(){r.addCount("log")})),this.collect.on(i.SubmitError,(function(e){var t=e.type,i=e.eventDate,n=e.errorCode,o=e.response;r.addErrorCount(i,t,n,o)})),this.listener(),this.collect.emit(i.TracerReady)}},e.prototype.addCount=function(e,t,r){void 0===t&&(t="net"),void 0===r&&(r=1);try{this.tracerCache||(this.tracerCache=new Map);var i=void 0;if(this.tracerCache.has(e))(n=this.tracerCache.get(e)).has(t)?(i=n.get(t).params.count,i++,n.set(t,this.processTracer(i,e,t))):(i=r,n.set(t,this.processTracer(r,e,t)));else{var n=new Map;i=r,n.set(t,this.processTracer(r,e,t)),this.tracerCache.set(e,n)}"net"===t&&i>=this.limit[e]&&this.report(!1)}catch(o){console.log(o)}},e.prototype.addErrorCount=function(e,t,r,i){var n=this;try{if(e&&e.length){var o=e[0].events;o&&o.length&&("f_data"===t?(i&&i.hasOwnProperty("sc")?this.addCount("log",t,o.length-i.sc):this.addCount("log",t,o.length),this.errorCode[t]=r):o.forEach((function(e){var i="log";for(var o in EventList)if(-1!==EventList[o].indexOf(e.event)){i=o;break}n.addCount(i,t,1),n.errorCode[t]=r})))}}catch(a){}},e.prototype.report=function(e){if(this.tracerCache){var t=[];this.tracerCache.forEach((function(e){console.log(e),e.forEach((function(e){t.push(e)}))})),t&&t.length&&this.sendTracer(t,e)}},e.prototype.sendTracer=function(e,t){try{var r=this.collect.eventManager.merge(e);t&&window.navigator.sendBeacon?window.navigator.sendBeacon(this.reportUrl,JSON.stringify(r)):this.fetch(this.reportUrl,r),this.tracerCache=null}catch(i){}},e.prototype.processTracer=function(e,t,r){var i={count:e,state:r,key:t,params_for_special:"applog_trace",aid:this.appid,platform:"web",_staging_flag:1,sdk_version:SDK_VERSION};"f_net"!==r&&"f_data"!==r||(i.errorCode=this.errorCode[r]);var n=this.collect.processEvent("applog_trace",i);if(n&&n.event)return delete n.is_bav,n},e.prototype.listener=function(){var e=this;document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e.leavePage()})),beforePageUnload((function(){e.leavePage()}))},e.prototype.leavePage=function(){this.report(!0)},e}(),dayjs_min=createCommonjsModule((function(e,t){e.exports=function(){var e="millisecond",t="second",r="minute",i="hour",n="day",o="week",a="month",s="quarter",l="year",c="date",u="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,d=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},f=function(e,t,r){var i=String(e);return!i||i.length>=t?e:""+Array(t+1-i.length).join(r)+e},g={s:f,z:function(e){var t=-e.utcOffset(),r=Math.abs(t),i=Math.floor(r/60),n=r%60;return(t<=0?"+":"-")+f(i,2,"0")+":"+f(n,2,"0")},m:function e(t,r){if(t.date()<r.date())return-e(r,t);var i=12*(r.year()-t.year())+(r.month()-t.month()),n=t.clone().add(i,a),o=r-n<0,s=t.clone().add(i+(o?-1:1),a);return+(-(i+(r-n)/(o?n-s:s-n))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(u){return{M:a,y:l,w:o,d:n,D:c,h:i,m:r,s:t,ms:e,Q:s}[u]||String(u||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},y="en",v={};v[y]=p;var m=function(e){return e instanceof S},_=function(e,t,r){var i;if(!e)return y;if("string"==typeof e)v[e]&&(i=e),t&&(v[e]=t,i=e);else{var n=e.name;v[n]=e,i=n}return!r&&i&&(y=i),i||!r&&y},b=function(e,t){if(m(e))return e.clone();var r="object"==typeof t?t:{};return r.date=e,r.args=arguments,new S(r)},T=g;T.l=_,T.i=m,T.w=function(e,t){return b(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var S=function(){function p(e){this.$L=_(e.locale,null,!0),this.parse(e)}var f=p.prototype;return f.parse=function(e){this.$d=function(e){var t=e.date,r=e.utc;if(null===t)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var i=t.match(h);if(i){var n=i[2]-1||0,o=(i[7]||"0").substring(0,3);return r?new Date(Date.UTC(i[1],n,i[3]||1,i[4]||0,i[5]||0,i[6]||0,o)):new Date(i[1],n,i[3]||1,i[4]||0,i[5]||0,i[6]||0,o)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},f.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},f.$utils=function(){return T},f.isValid=function(){return!(this.$d.toString()===u)},f.isSame=function(e,t){var r=b(e);return this.startOf(t)<=r&&r<=this.endOf(t)},f.isAfter=function(e,t){return b(e)<this.startOf(t)},f.isBefore=function(e,t){return this.endOf(t)<b(e)},f.$g=function(e,t,r){return T.u(e)?this[t]:this.set(r,e)},f.unix=function(){return Math.floor(this.valueOf()/1e3)},f.valueOf=function(){return this.$d.getTime()},f.startOf=function(e,s){var u=this,h=!!T.u(s)||s,d=T.p(e),p=function(e,t){var r=T.w(u.$u?Date.UTC(u.$y,t,e):new Date(u.$y,t,e),u);return h?r:r.endOf(n)},f=function(e,t){return T.w(u.toDate()[e].apply(u.toDate("s"),(h?[0,0,0,0]:[23,59,59,999]).slice(t)),u)},g=this.$W,y=this.$M,v=this.$D,m="set"+(this.$u?"UTC":"");switch(d){case l:return h?p(1,0):p(31,11);case a:return h?p(1,y):p(0,y+1);case o:var _=this.$locale().weekStart||0,b=(g<_?g+7:g)-_;return p(h?v-b:v+(6-b),y);case n:case c:return f(m+"Hours",0);case i:return f(m+"Minutes",1);case r:return f(m+"Seconds",2);case t:return f(m+"Milliseconds",3);default:return this.clone()}},f.endOf=function(e){return this.startOf(e,!1)},f.$set=function(o,s){var u,h=T.p(o),d="set"+(this.$u?"UTC":""),p=(u={},u[n]=d+"Date",u[c]=d+"Date",u[a]=d+"Month",u[l]=d+"FullYear",u[i]=d+"Hours",u[r]=d+"Minutes",u[t]=d+"Seconds",u[e]=d+"Milliseconds",u)[h],f=h===n?this.$D+(s-this.$W):s;if(h===a||h===l){var g=this.clone().set(c,1);g.$d[p](f),g.init(),this.$d=g.set(c,Math.min(this.$D,g.daysInMonth())).$d}else p&&this.$d[p](f);return this.init(),this},f.set=function(e,t){return this.clone().$set(e,t)},f.get=function(e){return this[T.p(e)]()},f.add=function(e,s){var c,u=this;e=Number(e);var h=T.p(s),d=function(t){var r=b(u);return T.w(r.date(r.date()+Math.round(t*e)),u)};if(h===a)return this.set(a,this.$M+e);if(h===l)return this.set(l,this.$y+e);if(h===n)return d(1);if(h===o)return d(7);var p=(c={},c[r]=6e4,c[i]=36e5,c[t]=1e3,c)[h]||1,f=this.$d.getTime()+e*p;return T.w(f,this)},f.subtract=function(e,t){return this.add(-1*e,t)},f.format=function(e){var t=this,r=this.$locale();if(!this.isValid())return r.invalidDate||u;var i=e||"YYYY-MM-DDTHH:mm:ssZ",n=T.z(this),o=this.$H,a=this.$m,s=this.$M,l=r.weekdays,c=r.months,h=function(e,r,n,o){return e&&(e[r]||e(t,i))||n[r].substr(0,o)},p=function(e){return T.s(o%12||12,e,"0")},f=r.meridiem||function(e,t,r){var i=e<12?"AM":"PM";return r?i.toLowerCase():i},g={YY:String(this.$y).slice(-2),YYYY:this.$y,M:s+1,MM:T.s(s+1,2,"0"),MMM:h(r.monthsShort,s,c,3),MMMM:h(c,s),D:this.$D,DD:T.s(this.$D,2,"0"),d:String(this.$W),dd:h(r.weekdaysMin,this.$W,l,2),ddd:h(r.weekdaysShort,this.$W,l,3),dddd:l[this.$W],H:String(o),HH:T.s(o,2,"0"),h:p(1),hh:p(2),a:f(o,a,!0),A:f(o,a,!1),m:String(a),mm:T.s(a,2,"0"),s:String(this.$s),ss:T.s(this.$s,2,"0"),SSS:T.s(this.$ms,3,"0"),Z:n};return i.replace(d,(function(e,t){return t||g[e]||n.replace(":","")}))},f.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},f.diff=function(e,c,u){var h,d=T.p(c),p=b(e),f=6e4*(p.utcOffset()-this.utcOffset()),g=this-p,y=T.m(this,p);return y=(h={},h[l]=y/12,h[a]=y,h[s]=y/3,h[o]=(g-f)/6048e5,h[n]=(g-f)/864e5,h[i]=g/36e5,h[r]=g/6e4,h[t]=g/1e3,h)[d]||g,u?y:T.a(y)},f.daysInMonth=function(){return this.endOf(a).$D},f.$locale=function(){return v[this.$L]},f.locale=function(e,t){if(!e)return this.$L;var r=this.clone(),i=_(e,t,!0);return i&&(r.$L=i),r},f.clone=function(){return T.w(this.$d,this)},f.toDate=function(){return new Date(this.valueOf())},f.toJSON=function(){return this.isValid()?this.toISOString():null},f.toISOString=function(){return this.$d.toISOString()},f.toString=function(){return this.$d.toUTCString()},p}(),E=S.prototype;return b.prototype=E,[["$ms",e],["$s",t],["$m",r],["$H",i],["$W",n],["$M",a],["$y",l],["$D",c]].forEach((function(e){E[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),b.extend=function(e,t){return e.$i||(e(t,S,b),e.$i=!0),b},b.locale=_,b.isDayjs=m,b.unix=function(e){return b(1e3*e)},b.en=v[y],b.Ls=v,b.p={},b}()})),duration=createCommonjsModule((function(e,t){var r,i,n,o,a,s,l,c,u,h,d,p,f,g,y,v,m;e.exports=(a=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,u={years:s=31536e6,months:l=2592e6,days:o=864e5,hours:n=36e5,minutes:6e4,seconds:1e3,milliseconds:1,weeks:6048e5},h=function(e){return e instanceof m},d=function(e,t,r){return new m(e,r,t.$l)},p=function(e){return i.p(e)+"s"},f=function(e){return e<0},g=function(e){return f(e)?Math.ceil(e):Math.floor(e)},y=function(e){return Math.abs(e)},v=function(e,t){return e?f(e)?{negative:!0,format:""+y(e)+t}:{negative:!1,format:""+e+t}:{negative:!1,format:""}},m=function(){function e(e,t,r){var i=this;if(this.$d={},this.$l=r,void 0===e&&(this.$ms=0,this.parseFromMilliseconds()),t)return d(e*u[p(t)],this);if("number"==typeof e)return this.$ms=e,this.parseFromMilliseconds(),this;if("object"==typeof e)return Object.keys(e).forEach((function(t){i.$d[p(t)]=e[t]})),this.calMilliseconds(),this;if("string"==typeof e){var n=e.match(c);if(n){var o=n.slice(2).map((function(e){return Number(e)}));return this.$d.years=o[0],this.$d.months=o[1],this.$d.weeks=o[2],this.$d.days=o[3],this.$d.hours=o[4],this.$d.minutes=o[5],this.$d.seconds=o[6],this.calMilliseconds(),this}}return this}var t=e.prototype;return t.calMilliseconds=function(){var e=this;this.$ms=Object.keys(this.$d).reduce((function(t,r){return t+(e.$d[r]||0)*u[r]}),0)},t.parseFromMilliseconds=function(){var e=this.$ms;this.$d.years=g(e/s),e%=s,this.$d.months=g(e/l),e%=l,this.$d.days=g(e/o),e%=o,this.$d.hours=g(e/n),e%=n,this.$d.minutes=g(e/6e4),e%=6e4,this.$d.seconds=g(e/1e3),e%=1e3,this.$d.milliseconds=e},t.toISOString=function(){var e=v(this.$d.years,"Y"),t=v(this.$d.months,"M"),r=+this.$d.days||0;this.$d.weeks&&(r+=7*this.$d.weeks);var i=v(r,"D"),n=v(this.$d.hours,"H"),o=v(this.$d.minutes,"M"),a=this.$d.seconds||0;this.$d.milliseconds&&(a+=this.$d.milliseconds/1e3);var s=v(a,"S"),l=e.negative||t.negative||i.negative||n.negative||o.negative||s.negative,c=n.format||o.format||s.format?"T":"",u=(l?"-":"")+"P"+e.format+t.format+i.format+c+n.format+o.format+s.format;return"P"===u||"-P"===u?"P0D":u},t.toJSON=function(){return this.toISOString()},t.format=function(e){var t=e||"YYYY-MM-DDTHH:mm:ss",r={Y:this.$d.years,YY:i.s(this.$d.years,2,"0"),YYYY:i.s(this.$d.years,4,"0"),M:this.$d.months,MM:i.s(this.$d.months,2,"0"),D:this.$d.days,DD:i.s(this.$d.days,2,"0"),H:this.$d.hours,HH:i.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:i.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:i.s(this.$d.seconds,2,"0"),SSS:i.s(this.$d.milliseconds,3,"0")};return t.replace(a,(function(e,t){return t||String(r[e])}))},t.as=function(e){return this.$ms/u[p(e)]},t.get=function(e){var t=this.$ms,r=p(e);return"milliseconds"===r?t%=1e3:t="weeks"===r?g(t/u[r]):this.$d[r],0===t?0:t},t.add=function(e,t,r){var i;return i=t?e*u[p(t)]:h(e)?e.$ms:d(e,this).$ms,d(this.$ms+i*(r?-1:1),this)},t.subtract=function(e,t){return this.add(e,t,!0)},t.locale=function(e){var t=this.clone();return t.$l=e,t},t.clone=function(){return d(this.$ms,this)},t.humanize=function(e){return r().add(this.$ms,"ms").locale(this.$l).fromNow(!e)},t.milliseconds=function(){return this.get("milliseconds")},t.asMilliseconds=function(){return this.as("milliseconds")},t.seconds=function(){return this.get("seconds")},t.asSeconds=function(){return this.as("seconds")},t.minutes=function(){return this.get("minutes")},t.asMinutes=function(){return this.as("minutes")},t.hours=function(){return this.get("hours")},t.asHours=function(){return this.as("hours")},t.days=function(){return this.get("days")},t.asDays=function(){return this.as("days")},t.weeks=function(){return this.get("weeks")},t.asWeeks=function(){return this.as("weeks")},t.months=function(){return this.get("months")},t.asMonths=function(){return this.as("months")},t.years=function(){return this.get("years")},t.asYears=function(){return this.as("years")},e}(),function(e,t,n){r=n,i=n().$utils(),n.duration=function(e,t){var r=n.locale();return d(e,{$l:r},t)},n.isDuration=h;var o=t.prototype.add,a=t.prototype.subtract;t.prototype.add=function(e,t){return h(e)&&(e=e.asMilliseconds()),o.bind(this)(e,t)},t.prototype.subtract=function(e,t){return h(e)&&(e=e.asMilliseconds()),a.bind(this)(e,t)}})}));dayjs_min.extend(duration);var ignoreList=["__cep_sdk_onboard","__cep_trigger_sdk","_be_active"],moreOP=["and","or","not"],CepRule=function(){function CepRule(){this.support=!0,this.currentPlan=1,this.shouldSendEvent=!1,this.staing=!1,this.test=!1,this.cepReady=!1,this.eventCache=[]}return CepRule.prototype.apply=function(e,t){var r=this;if(this.collect=e,this.config=t,this.config.cep){var i=e.adapters,n=i.fetch,o=i.storage,a=e.Types;this.types=a,this.storage=new o(!1),this.fetch=n,this.configManager=e.configManager,this.url=t.cep_url?""+t.cep_url:e.configManager.getDomain()+"/service/2/cep_settings/",this.reportUrl=e.configManager.getUrl("event"),this.key="__tea_cep_plan_"+t.app_id,this.quotasKey="__tea_cep_plan_quotas_"+t.app_id,this.isWait=!1,this.eventCache=[],this.test=e.configManager.staging,this.collect.on(a.SubmitAfter,(function(e){r.matchEvent(e)})),this.init()}},CepRule.prototype.init=function(){var e=this,t=!0,r=0,i=0,n=0,o=!1,a=this.storage.getItem(this.key)||{};if(a&&Object.keys(a).length&&(o=!0,r=a.last_update_time,i=a.fetch_interval,n=a.config_version||0,t=Date.now()-r>1e3*i),t){var s=this.configManager.get(),l=s.header,c=s.user;this.fetch(this.url,{header:l,user:c,local_time:Date.now(),config_version:n},1e4,!1,(function(t){t&&0===t.code?(a.fetch_interval=t.fetch_interval,a.data=t.data,a.last_update_time=Date.now(),a.config_version=t.config_version,e.clearQuotas(),e.initState(t.data),e.storage.setItem(e.key,a),t.data.forEach((function(t){e.event("__cep_sdk_onboard",t.plan_id)}))):304!==t.code&&400!==t.code||!o?console.log("code: "+t.code+", request error,please try leater"):(console.log("code: "+t.code+", use old rules~"),a.last_update_time=Date.now(),e.storage.setItem(e.key,a),e.initState(a.data))}),(function(){o?(e.planData=a.data,e.initState(a.data)):(e.support=!1,console.log("request error,please try leater"))}))}else a.last_update_time=Date.now(),this.storage.setItem(this.key,a),console.log("rule still work, use cache"),this.initState(a.data)},CepRule.prototype.initState=function(e){var t=this;e&&e.length&&(this.stateArray=new Map,this.waitArray=new Map,this.planData=e,e.forEach((function(e){var r=new Map;if(e.pattern&&e.pattern.events){var i=1===e.pattern.events.length;e.pattern.events.forEach((function(e){r.set(e.id,{id:e.id,isMatch:!1,event:null,after:e.after||null,connection:e.connection||null,window:e.window||null,matchTime:0,initTime:Date.now(),singleRule:i})})),t.stateArray.set(e.plan_id,{patternState:r,singleRule:i,pattern:{aid:e.aid,biz_id:e.biz_id,end_time:e.end_time,start_time:e.start_time,web_sdk_version:e.web_sdk_version,stage:e.stage},quotas:e.quotas})}})),this.cepReady=!0,this.dealCache(),this.collect.emit(this.types.CepReady))},CepRule.prototype.check=function(e){var t=Date.now();return Date.now()>1e3*e.end_time?(console.log("event rules:"+e.plan_id+" is over"),!1):t<1e3*e.start_time||t>1e3*e.end_time?(console.log("rule:"+e.plan_id+" time error"),!1):(this.staing="testing"===e.staing,!(SDK_VERSION<e.web_sdk_version&&(this.support=!1,console.log("you sdk version is old,please update to "+e.web_sdk_version+" at least"),1)))},CepRule.prototype.dealCache=function(){var e=this;if(this.eventCache.length){var t=1;this.eventCache.forEach((function(r){e.matchEvent(r),t++})),t===this.eventCache.length&&(this.eventCache=[])}},CepRule.prototype.matchEvent=function(e){if(this.support&&(!this.staing||this.test)&&e&&e.length)try{if(!this.cepReady)return void this.eventCache.push(e);var t=e[0],r=t.header,i=t.user,n=t.events;n.length&&n.reverse();for(var o=0;o<n.length;o++){var a=n[o].event;if(-1!==ignoreList.indexOf(a))return!1;this.matchRule(r,i,n[o])}}catch(s){return this.collect.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:s.message}),void console.log(s.message)}},CepRule.prototype.matchRule=function(e,t,r){try{for(var i=0;i<this.planData.length;i++){var n=this.planData[i],o=n.plan_id;if(this.check(n)&&this.checkQuotas(o)&&n.pattern&&n.pattern.events)for(var a=n.pattern.events,s=0;s<a.length;s++)if(this.rule(e,t,r,a[s].condition)){var l=this.stateArray.get(o).patternState,c=l.get(a[s].id);if(this.stateArray.get(o).singleRule){this.changeStatus(o,a[s].id,r),this.publish([r],o,a[s].id);break}if(!c.isMatch){c.after&&l.get(c.after).isMatch?this.changeStatus(o,a[s].id,r):c.after||this.changeStatus(o,a[s].id,r);break}}}this.statusCheck()}catch(u){return this.collect.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:u.message}),void console.log(u.message)}},CepRule.prototype.changeStatus=function(e,t,r){var i=this.stateArray.get(e),n=i.patternState.get(t);n.isMatch=!0,n.event=r,n.matchTime=r.local_time_ms||Date.now(),i.patternState.set(t,n),this.stateArray.set(e,i)},CepRule.prototype.statusCheck=function(){var e,t,r,i;try{for(var n=__values(this.stateArray),o=n.next();!o.done;o=n.next()){var a=__read(o.value,2),s=a[0],l=a[1],c=l.patternState;if(l.isSingle)break;try{for(var u=__values(c),h=u.next();!h.done;h=u.next()){var d=__read(h.value,2),p=d[0],f=d[1];if(f.after&&(!f.after||c.get(f.after).isMatch)){if("NOT_FOLLOWED_BY"===f.connection){f.isMatch?this.reset(s,p):Date.now()-c.get(f.after).matchTime>f.window?this.publish([c.get(f.after).event,f.event],s,p):this.startWait(s,p,f);break}f.isMatch?f.matchTime-c.get(f.after).matchTime<=f.window?this.publish([c.get(f.after).event,f.event],s,p):this.reset(s,p):Date.now()-c.get(f.after).matchTime>f.window?this.reset(s,p):this.startWait(s,p,f);break}}}catch(g){r={error:g}}finally{try{h&&!h.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}}}catch(y){e={error:y}}finally{try{o&&!o.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},CepRule.prototype.startWait=function(e,t,r){var i=this;try{this.waitArray.get(e)||this.waitArray.set(e,new Map);var n=this.waitArray.get(e);if(!n.get(t)){var o=setTimeout((function(){var n=i.stateArray.get(e).patternState,o=n.get(t);if("NOT_FOLLOWED_BY"===o.connection)!o.isMatch&&n.get(o.after).isMatch||o.matchTime-n.get(o.after).matchTime>r.window?((a=i.waitArray.get(e).get(t)).triggerWait=!0,i.waitArray.set(e,i.waitArray.get(e).set(t,a)),i.publish([n.get(o.after).event],e,t)):i.reset(e,t);else if("FOLLOWED_BY"===o.connection){var a;o.isMatch&&n.get(o.after).isMatch?((a=i.waitArray.get(e).get(t)).triggerWait=!0,i.waitArray.set(e,i.waitArray.get(e).set(t,a)),i.publish([n.get(o.after).event],e,t)):i.reset(e,t)}}),r.window);n.set(t,{waitFn:o,triggerWait:!1}),this.waitArray.set(e,n)}}catch(a){this.collect.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:a.message}),console.log(a.message,a.stack)}},CepRule.prototype.rule=function(e,t,r,i){var n=this;try{var o=r.event,a=r.params;if(a=JSON.parse(a),-1!==moreOP.indexOf(i.op)){if(i.conditions&&i.conditions.length){var s=i.conditions,l=0,c=new Map;c.set(l,{op:i.op,result:void 0,resultList:[],resultKey:[],resultLength:s.length}),function r(i,s){for(var u=0;u<i.length;u++)if(l++,-1!==moreOP.indexOf(i[u].op)&&i[u].hasOwnProperty("conditions"))c.set(l,{op:i[u].op,result:void 0,fatherKey:s,resultList:[],resultKey:[],resultLength:i[u].conditions.length}),r(i[u].conditions,l);else{var h=n.scope(i[u].key),d=h.scope,p=h.key,f=h.key2,g=d?"header"===d?f?JSON.parse(e[f])[p]:e[p]:"user"===d?t[p]:a[p]:o,y=n.calculate(i[u].op,g,i[u].value);c.set(l,{op:i[u].op,result:y,fatherKey:s})}}(s,l);for(var u=c.get(0);void 0===u.result||u.resultList.length<u.resultLength;)c.forEach((function(e,t){if(void 0!==e.result&&void 0!==e.fatherKey){var r=c.get(e.fatherKey);r.resultList.length<r.resultLength&&-1===r.resultKey.indexOf(t)&&(r.resultKey.push(t),r.resultList.push(e.result),c.set(e.fatherKey,r))}})),c.forEach((function(e){e.resultList&&e.resultList.length===e.resultLength&&("and"===e.op&&(e.result=-1===e.resultList.indexOf(!1)),"or"===e.op&&(e.result=-1!==e.resultList.indexOf(!0)))}));return c.get(0).result}return!1}var h=this.scope(i.key),d=h.scope,p=h.key,f=h.key2,g=d?"header"===d?f?JSON.parse(e[f])[p]:e[p]:"user"===d?t[p]:a[p]:o;return this.calculate(i.op,g,i.value)}catch(y){return this.collect.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:y.message}),console.log(y.message),!1}},CepRule.prototype.publish=function(e,t,r){try{var i=this.configManager.get().user,n={biz_id:this.stateArray.get(t).pattern.biz_id,plan_id:t,uid:i.user_id||"",did:i.device_id||"",uuid:i.user_unique_id,events:e,extra:{url:window.location.href}};this.collect.emit("__cep_match",n),(window.opener||window.parent).postMessage({type:"__cep_match",data:n},"*"),this.event("__cep_trigger_sdk",t),this.addQuotas(t),this.reset(t,r),console.log(this.stateArray)}catch(o){return this.collect.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:o.message}),void console.log(o.message)}},CepRule.prototype.addQuotas=function(e){var t=this.stateArray.get(e).quotas;if(t&&t.length){var r=this.storage.getItem(this.quotasKey)||{};r[e]||(r[e]={value:0,lastTime:Date.now()});var i=r[e].value;0===i&&(r[e].lastTime=Date.now()),r[e].value=i+1,this.storage.setItem(this.quotasKey,r)}},CepRule.prototype.checkQuotas=function(e){var t=this.stateArray.get(e).quotas,r=this.storage.getItem(this.quotasKey)||{};if(r[e]||(r[e]={value:0,lastTime:Date.now()}),t&&t.length){var i=t[0].granularity,n=t[0].value;if("per_keyid"!==t[0].type)return!0;var o=this.release(i);return"all"===o?!(r[e].value>=n&&(console.log("plan:"+e+" limit"),1)):Date.now()-r[e].lastTime>=o?(r[e].value=0,r[e].lastTime=Date.now(),this.storage.setItem(this.quotasKey,r),!0):!(r[e].value>=n&&(console.log("plan:"+e+" limit"),1))}return!0},CepRule.prototype.clearQuotas=function(){this.storage.setItem(this.quotasKey,null)},CepRule.prototype.release=function(e){if("all"===e)return e;var t=dayjs_min.duration(e);return t?t.asMilliseconds():"all"},CepRule.prototype.reset=function(e,t){var r=this.stateArray.get(e);if(r.singleRule){var i=r.patternState.get(t);i.isMatch=!1,i.event=null,i.matchTime=0,i.initTime=Date.now(),r.patternState.set(t,i)}else r.patternState.forEach((function(e){e.isMatch=!1,e.event=null,e.matchTime=0,e.initTime=Date.now()}));this.stateArray.set(e,r);var n=this.waitArray.get(e);n&&n.get(t)&&(clearTimeout(n.get(t).waitFn),n.delete(t))},CepRule.prototype.event=function(e,t){try{var r={event:e,params:JSON.stringify({plan_id:t||"",biz_id:this.stateArray.get(t).pattern.biz_id}),local_time_ms:Date.now()},i=this.configManager.get(),n=i.header,o=i.user;n.custom=JSON.stringify(n.custom);var a={events:[r],user:o,header:n};this.fetch(this.reportUrl,[a])}catch(s){return this.collect.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:s.message}),void console.log(s.message)}},CepRule.prototype.scope=function(e){var t="",r="";if(e.indexOf(".")>-1){var i=e.split(".");t=i[0],e=i[1],"header"===t&&"custom"===e&&(e=i[2],r=i[1])}return{scope:t,key:e,key2:r}},CepRule.prototype.calculate=function(op,paramA,paramB){try{if("="===op)return paramA===paramB;if(-1!==["=","<",">",">=","<=","!="].indexOf(op))return eval(""+paramA+op+paramB);if(-1!==["in","contains"].indexOf(op))return-1!==paramB.indexOf(paramA);if(-1!==["is not null","is null"].indexOf(op))return"is null"===op?null==paramA:null!=paramA;if(-1!==["startswith","endswith"].indexOf(op)){if("startswith"===op)return 0===paramA.indexOf(paramB);var start=paramA.length-paramB.length,str=paramA.substr(start,paramB.length);return str===paramB}}catch(e2){return this.collect.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:e2.message}),console.log(e2.message),!1}},CepRule}(),pluginExtendList={autotrack:{src:{cn:"https://lf3-cdn-tos.bytescm.com/obj/static/log-sdk/collect/5.0/plugin/autotrack.js",sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/autotrack.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/autotrack.js"},object:"LogAutoTrack"},ab:{src:{cn:"https://lf3-cdn-tos.bytescm.com/obj/static/log-sdk/collect/5.0/plugin/ab.js",sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/ab.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/ab.js"},object:"LogAb"},stay:{src:{cn:"https://lf3-cdn-tos.bytescm.com/obj/static/log-sdk/collect/5.0/plugin/stay.js",sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/stay.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/stay.js"},object:"LogStay"},route:{src:{cn:"https://lf3-cdn-tos.bytescm.com/obj/static/log-sdk/collect/5.0/plugin/route.js",sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/route.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/route.js"},object:"LogRoute"},cep:{src:{cn:"https://lf3-cdn-tos.bytescm.com/obj/static/log-sdk/collect/5.0/plugin/cep.js",sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/cep.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/cep.js"},object:"LogCep"},tracer:{src:{cn:"https://lf3-cdn-tos.bytescm.com/obj/static/log-sdk/collect/5.0/plugin/tracer.js",sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/tracer.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/tracer.js"},object:"LogTracer"},visual:{src:{cn:"https://lf3-cdn-tos.bytescm.com/obj/static/log-sdk/collect/5.0/plugin/visual.js",sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/visual.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/visual.js"},object:"LogVisual"}},getLogPluginSpace=function(){return"undefined"!=typeof window?(window.LogPluginObject||(window.LogPluginObject={}),window.LogPluginObject):null},pluginObject=getLogPluginSpace(),PluginExtend=function(){function e(){}return e.prototype.apply=function(e,t){this._plugin={},this.config=t,this.collect=e,this.channel=t.channel||"cn",this.loadExtend()},e.prototype.loadExtend=function(){var e=this;try{this.collect.remotePlugin.forEach((function(t,r){if("sdk"===t)if(pluginExtendList.hasOwnProperty(r)){var i=pluginExtendList[r].object,n=pluginExtendList[r].src[e.channel]+"?query="+Date.now();e.exist(r,i,n)}else console.warn("your "+r+" is not exist,please check plugin name");else"object"==typeof t&&(t.src?e.exist(r,t.call,t.src):e.process(r,t.instance,"INSTANCE"))}))}catch(t2){this.collect.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:t2.message}),console.log("load extend error")}},e.prototype.exist=function(e,t,r){var i=this;pluginObject[t]?(this.process(e,pluginObject[t]),console.log("已有"+e+"插件,避免重复加载~")):this.loadPlugin(e,r,(function(){i.process(e,pluginObject[t]),console.log(" %c %s %s %s","color: yellow; background-color: black;","–","load plugin:"+e+" success","-")}),(function(){console.log(" %c %s %s %s","color: red; background-color: yellow;","–","load plugin:"+e+" error","-")}))},e.prototype.process=function(e,t,r){try{if(r){var i=new t;i.apply&&i.apply(this.collect,this.config),console.log("excude "+e+" success")}else t&&t(this.collect,this.config)}catch(n){this.collect.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:n.message}),console.log("excude "+e+" error, message:"+n.message)}},e.prototype.loadPlugin=function(e,t,r,i){var n=this;try{var o=document.createElement("script");o.src=t,this._plugin[e]||(this._plugin[e]=[]),this._plugin[e].push(r),o.onerror=function(){i(t)},o.onload=function(){n._plugin[e].forEach((function(e){e()}))},document.getElementsByTagName("head")[0].appendChild(o)}catch(a){this.collect.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:a.message})}},e}(),Verify=function(){function e(){this.verifyReady=!1,this.waitTime=5e3,this.cleanStatus=!1}return e.prototype.apply=function(e,t){var r=this;this.collector=e,this.config=t;var i=e.adapters.storage;this.cacheStorgae=new i(!1,"session"),this.eventStorage=[],this.collector.on("submit-verify",(function(e){e&&e.length&&r.eventStore(e[0])})),this.checkCache()},e.prototype.checkCache=function(){var e=this;this.verifyCookieKey="__applog_verify_set_"+this.config.app_id,this.cacheStorgae.getCookie(this.verifyCookieKey);var t=this.cacheStorgae.getItem(this.verifyCookieKey);this.sign=t&&t.sign||"",this.origin=t&&t.origin||"*";var r=setTimeout((function(){e.cleanVerify(),clearTimeout(r),e.collector.off("submit-verify")}),this.waitTime);window.addEventListener("message",(function(t){t&&t.data&&"simulator:verify"===t.data.type&&(clearTimeout(r),e.receMessage(t))}),!0)},e.prototype.receMessage=function(e){if(!this.cleanStatus){var t=e.data;this.verifyReady=!0,this.sign=t.sign,this.origin=e.origin,this.cacheStorgae.setItem(this.verifyCookieKey,JSON.stringify({sign:t.sign,origin:e.origin})),this.eventStorage.length&&this.postVerify(this.eventStorage,t.sign,e.origin)}},e.prototype.eventStore=function(e){this.cleanStatus||(this.verifyReady?this.postVerify(e,this.sign,this.origin):this.eventStorage.push(e))},e.prototype.cleanVerify=function(){this.cleanStatus=!0,this.eventStorage=[]},e.prototype.postVerify=function(e,t,r){try{var i=[];isArray(e)?e.forEach((function(e){i.push(e)})):i.push(e);var n={type:"simulator:verify:event",sign:t,pageUrl:window.location.href,events:i};(window.opener||window.parent).postMessage(n,r)}catch(o){console.log("web verify post message error ~")}},e}(),RuotePage=function(){function e(){this.autotrack=!1,this.spa=!1,this.cache={},this.allowHash=!1}return e.prototype.apply=function(e,t){if(t.spa||t.autotrack){var r=e.Types;this.collect=e,this.config=t,this.appid=t.app_id,this.allowHash=t.allow_hash,this.fncArray=new Map,this.setKey(),this.setLocation(),this.hack(),this.init(),this.listener(),e.emit(r.RouteReady)}},e.prototype.setKey=function(){var e=this.collect.adapters.storage;this.storage=new e(!1),this.cache_key="__tea_cache_refer_"+this.appid,this.cache={refer_key:location.href,refer_title:document.title||location.pathname,refer_manual_key:""},this.config.autotrack&&"object"==typeof this.config.autotrack&&this.config.autotrack.page_manual_key&&(this.cache.refer_manual_key=this.config.autotrack.page_manual_key),this.storage.setItem(this.cache_key,this.cache)},e.prototype.hack=function(){var e=this,t=window.history.pushState;history.pushState=function(r){for(var i=[],n=1;n<arguments.length;n++)i[n-1]=arguments[n];"function"==typeof history.onpushstate&&history.onpushstate({state:r});var o=t.call.apply(t,__spread([history,r],i));if(e.lastLocation!==location.href){var a=e.getPopStateChangeEventData();return e.lastLocation=location.href,e.sendPv(a,"pushState"),o}};var r=history.replaceState;history.replaceState=function(t){for(var i=[],n=1;n<arguments.length;n++)i[n-1]=arguments[n];"function"==typeof history.onreplacestate&&history.onreplacestate({state:t});var o=r.call.apply(r,__spread([history,t],i));if(e.lastLocation!==location.href){var a=e.getPopStateChangeEventData();return e.lastLocation=location.href,e.sendPv(a),o}}},e.prototype.setLocation=function(){"undefined"!=typeof window&&(this.lastLocation=window.location.href)},e.prototype.init=function(){var e=this.getPopStateChangeEventData();this.collect.emit("route-change",{config:e,init:!0})},e.prototype.listener=function(){var e=this,t=null;window.addEventListener("hashchange",(function(r){if(e.lastLocation!==window.location.href&&(clearTimeout(t),e.allowHash)){e.lastLocation=window.location.href;var i=e.getPopStateChangeEventData();e.sendPv(i)}})),window.addEventListener("popstate",(function(r){e.lastLocation!==window.location.href&&(t=setTimeout((function(){e.lastLocation=window.location.href;var t=e.getPopStateChangeEventData();e.sendPv(t)}),10))}))},e.prototype.getPopStateChangeEventData=function(){var e=this.pageConfig();return e.is_back=0,e},e.prototype.pageConfig=function(){try{var e,t,r=this.storage.getItem(this.cache_key)||{};e=document.referrer?document.referrer:r&&r.refer_key||"";var i=this.storage.getItem("__tea_cache_first_"+this.appid);return t=!i||1!=i,{is_html:1,url:location.href,referrer:e,page_key:location.href,refer_page_key:e,page_title:document.title||location.pathname,page_manual_key:this.config.autotrack&&this.config.autotrack.page_manual_key||"",refer_page_manual_key:r&&r.refer_manual_key||"",refer_page_title:r&&r.refer_title||"",page_path:location.pathname,page_host:location.host,is_first_time:""+t}}catch(n){return this.collect.emit(DebuggerMesssge$1.DEBUGGER_MESSAGE,{type:DebuggerMesssge$1.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:n.message}),{}}},e.prototype.sendPv=function(e,t){this.collect.emit("route-change",{config:e,init:!1})},e}();Collector$1.usePlugin(PluginExtend,"extend"),Collector$1.usePlugin(Ab,"ab"),Collector$1.usePlugin(Stay,"stay"),Collector$1.usePlugin(AutoTrack,"autotrack"),Collector$1.usePlugin(Verify,"verify"),Collector$1.usePlugin(Et,"et"),Collector$1.usePlugin(Profile,"profile"),Collector$1.usePlugin(CepRule,"cep"),Collector$1.usePlugin(HeartBeat,"heartbeat"),Collector$1.usePlugin(Monitor,"monitor"),Collector$1.usePlugin(RuotePage,"route"),Collector$1.usePlugin(Tracer,"tracer"),new Collector$1("default");var Collector$1$1=Collector$1;function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _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 i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,_toPropertyKey(i.key),i)}}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=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPrimitive(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"==typeof t?t:String(t)}var DEBUG="undefined"!=typeof window&&window.location.href.indexOf("loggerdebug")>-1;function computeWatchDur(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=0,r=0;r<e.length;r++)isNaN(Number(e[r].end))||isNaN(Number(e[r].begin))||e[r].begin<0||e[r].end<0||e[r].end<e[r].begin||(t+=e[r].end-e[r].begin);return parseInt(1e3*t,10)}function getHostFromUrl(e){if(null==e||""===e||"string"!=typeof e)return"";var t=e.split("/"),r="";return t.length>3&&t[2]&&(r=t[2]),r}function generateSessionId(e){var t=(new Date).getTime();try{e=parseInt(e)}catch(e2){e=0}return t+=e,window.performance&&"function"==typeof window.performance.now&&(t+=window.performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var r=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?r:3&r|8).toString(16)}))}function isType(e){return function(t){return Object.prototype.toString.call(t)==="[object ".concat(e,"]")}}function getResponseHeaders(e){var t={};if(e instanceof window.XMLHttpRequest)try{e.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((function(e){var r=e.split(": "),i=r.shift(),n=r.join(": ");t[i]=n}))}catch(r){}return t}function log(e){for(var t,r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];DEBUG&&(t=console).log.apply(t,["[logger]",e].concat(i))}function nowTime(){try{return Math.round(window.performance.now())}catch(e2){return(new Date).getTime()}}function curTimestamp(){return(new Date).getTime()}function formatData(e,t){var r={ext:e.ext||{},data:{}};return Object.keys(e).map((function(i){t[i]?r.data[t[i]]=e[i]:"ext"!==i&&(r.ext[i]=e[i])})),r}function getXhr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(r,i){try{e||i(new Error("url is undefined"));var n=nowTime(),o=n,a={},s=new window.XMLHttpRequest;s.open("get",e),s.onreadystatechange=function(){2===s.readyState&&(a.headers=getResponseHeaders(s),a.connectTime=nowTime()-o,a.status=s.status,a.statusText=s.statusText,n=nowTime())},s.onload=function(){r(a)},s.onprogress=function(e){var t,r=nowTime()-n;t=parseInt(e.loaded/1e3/(r/1e3),10),a.speed=0|t,a.costTime=r},s.onerror=function(e){a.status||(a.status=-1,a.costTime=nowTime()-n),i(a)},s.ontimeout=function(){a.status||(a.status=-2,a.costTime=nowTime()-n),r(a)},s.onabort=function(){r(a)},s.responseType="arraybuffer",s.timeout=t.timeout||1e4,s.setRequestHeader("Range","bytes=".concat(t.range||"0-1048576")),s.send()}catch(e2){i(e2)}}))}function checkVideoSrcIsEmpty(e){return!e||window.location.href.indexOf(e)>-1}function checkIsBlob(e){return!!e&&/^blob:/.test(e)}var KEYMAP={x_response_sinfo:"x-response-sinfo",x_response_cache:"x-response-cache",x_response_cinfo:"x-response-cinfo"};function transformHeader(e){if(!e)return{};var t={};return Object.keys(KEYMAP).map((function(r){if(e[r]||"string"!=typeof KEYMAP[r]){if(!e[r]&&KEYMAP[r]instanceof Array){var i=KEYMAP[r].filter((function(t){return void 0!==e[t]}));i.length>0?t[r]=e[i[0]]:t[r]=""}}else t[r]=e[KEYMAP[r]]||""})),t}function appendData(e,t){return!e||"string"!=typeof t&&"number"!=typeof t?t:e+""+t}function typeOf(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]}function parseTempData(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return Object.keys(t).map((function(i){e[i]="append"===r?appendData(e[i],t[i]):t[i]})),e}function hasClass(e,t){if(!e||!t)return!1;try{return Array.prototype.some.call(e.classList,(function(e){return e===t}))}catch(e2){var r=e.className&&"object"===_typeof(e.className)?e.getAttribute("class"):e.className;return r&&!!r.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}}function formatDefinition(e){return"String"===typeOf(e)?e.replace("P","p"):e?"Number"===typeOf(e)?"".concat(e):void 0:""}function toJsonString(e){try{return JSON.stringify(e)}catch(e2){return""}}function checkUrlIsExpired(e){if(!e||"String"!==typeOf(e))return 0;var t=0;try{var r=new RegExp("(\\?|&)x-tos-expires=([^&]*)(&|$)"),i=e.match(r);if(null!==i)t=parseInt(i[2],10);else{var n=e.split("/");n.length>5&&8===n[4].length&&(t=parseInt(n[4],16))}return t>0?t<parseInt((new Date).getTime()/1e3,10)?1:2:0}catch(e2){return 0}}var ENTRIES=[],MAX_COUNT=30;function findPerformanceInfo(e){var t={};try{e=e.replace(/^http:|^https:/,"");for(var r=ENTRIES||[],i=function(i){if(r[i].name.replace(/^http:|^https:/,"")===e)return["domainLookupEnd","domainLookupStart","startTime","requestStart","responseEnd","responseStart","connectStart","connectEnd","fetchStart"].map((function(e){t[e]=Math.round(r[i][e])})),t.url=r[i].name,t.duration=Math.round(r[i].duration),t.domainDuration=t.domainLookupEnd-t.domainLookupStart,t.connectDuration=t.connectEnd-t.connectStart,"break"},n=r.length-1;n>=0&&"break"!==i(n);n--);return t}catch(e2){return t}}function addPerformaceObserver(){try{new window.PerformanceObserver((function(e,t){var r=e.getEntriesByType("resource");ENTRIES.length>MAX_COUNT&&ENTRIES.splice(0,ENTRIES.length-MAX_COUNT);for(var i=0;i<r.length;i++)ENTRIES.push(r[i])})).observe({entryTypes:["resource"]})}catch(e2){console.warn("PerformanceObserver not support",e2)}}"undefined"!=typeof window&&addPerformaceObserver();var REPORT_EVENTS={ONE_PLAY:"videoplayer_oneplay",ONE_OPERA:"videoplayer_oneopera",ONE_ERROR:"videoplayer_oneerror",ONE_EVENT:"videoplayer_oneevent",ONE_TEMP:"videoplayer_onetemp"},ERROR_TYPES={data:1e3,runtime:1002,parse:1004,network:1003,no_error_handler:9997,custom_error:9998,other:9999,notSupport:1005},ERROR_CODES={1:-499991,2:-499992,3:-499993,4:-499994,5:-499995},PLAYBACK_STATE={STOP:0,PLAYING:1,PAUSE:2,ERROR:3,LOADING:4},LOAD_STATES={UNKNOWN:0,PLAYABLE:1,STALLED:2,ERROR:3},ENDED_TYPE={ERROR:1,NEXT:2,ENDED:3,UNLOAD:4,DESTROY:5,PLAY_CATCH:6,PLAY_ERROR:7},LOGTYPES={RETRY:"error_retry",ONEERROR:"oneerror",ONEEVENT:"oneevent",ONETEMP:"onetemp"},CACHE_FILE_TYPE={NO_CACHE:0,CACHED:1},MAX_TIME=432e5,MAX_COST=36e5,COMMON_KEYS=["tag","subtag","device_type"],MIN_WAITIONG=200,MAX_STALL_TIME=6e4,isSupport=_isLocalStorageUsable();function probeSupport(){try{return"undefined"!=typeof localStorage&&"setItem"in window.localStorage&&!!window.localStorage.setItem}catch(e2){return!1}}function checkIfLocalStorageThrows(){var e="_localstorage_support_test";try{return window.localStorage.setItem(e,!0),window.localStorage.removeItem(e),!1}catch(e2){return!0}}function _isLocalStorageUsable(){return probeSupport()&&!checkIfLocalStorageThrows()}var Strorage=isSupport?window.localStorage:{},LOGKEY="__xgplayerlogkey",LOCAL_LOG={set:function(e){try{var t=this.get();t.push(e),Strorage.setItem(LOGKEY,JSON.stringify(t))}catch(r){}},get:function(){try{var e=Strorage.getItem(LOGKEY);return e?JSON.parse(e):[]}catch(t2){return[]}},remove:function(){try{Strorage.removeItem(LOGKEY)}catch(e2){}},clear:function(){try{Strorage.clear()}catch(e2){}}},RegMap=[{key:"QQBrowser",reg:/(qqbrowser)\/([\d.]+)/},{key:"QIHU360EE",reg:/qihu 360ee/},{key:"QIHU360SE",reg:/qihu 360se/},{key:"2345Explorer",reg:/(2345explorer)\/([\d.]+)/},{key:"Sogou",reg:/(metasr)/},{key:"Wexin",reg:/(micromessenger)\/([\d.]+)/},{key:"Openlanguage",reg:/(openlanguage)\/([\d.]+)/},{key:"NewsArticle",reg:/(newsarticle)\/([\d.]+)/},{key:"VideoArticle",reg:/(videoarticle)\/([\d.]+)/},{key:"Hotsoon",reg:/(live_stream)_([\d.]+)/},{key:"Aweme",reg:/(aweme)_([\d.]+)/},{key:"Lark",reg:/(lark)\/([\d.]+)/},{key:"PlayStation",reg:/(playstation)/},{key:"BingPreview",reg:/(bingpreview)\/([\d.]+)/},{key:"Baiduspider",reg:/(baiduspider-render)\/([\d.]+)/},{key:"YandexBot",reg:/(yandexbot)\/([\d.]+)/},{key:"Chrome",reg:/(chrome)\/([\d.]+)/},{key:"Safari",reg:/(version)\/([\d.]+)\s*(safari)/}],IERegMap=[{key:"Trident",reg:/(rv:)([\d.]+)/},{key:"Trident",reg:/(msie)\s*([\d.]+)/}];function isSupportMP4(){var e={isSupport:!1,mime:""};if("undefined"==typeof document)return e;var t=document.createElement("video");return"function"==typeof t.canPlayType?(["avc1.42E01E, mp4a.40.2","avc1.58A01E, mp4a.40.2","avc1.4D401E, mp4a.40.2","avc1.64001E, mp4a.40.2","avc1.42E01E","mp4v.20.8","avc1.42E01E, mp4a.40.2","avc1.58A01E, mp4a.40.2","avc1.4D401E, mp4a.40.2","avc1.64001E, mp4a.40.2","mp4v.20.8, mp4a.40.2","mp4v.20.240, mp4a.40.2"].map((function(r){"probably"===t.canPlayType('video/mp4; codecs="'.concat(r,'"'))&&(e.isSupport=!0,e.mime+="||".concat(r))})),e):(t=null,e)}var SPIDER_UA=["Baiduspider","YandexBot"];function checkIsSpider(e,t){var r=!1;return SPIDER_UA.map((function(t){t===e&&(r=!0)})),/(\+http|; http|\(http):\/\/([\w.]+\/?)\S*/.test(t)&&(r=!0),r}function detect(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";e=e.toLocaleLowerCase();var t=/(iphone)/.test(e)||/(ipad)/.test(e),r=/(android)/.test(e),i=/(windows phone)/.test(e),n=t||r||i,o={isIOS:t,isAndroid:r,isMobile:n,isPC:!n,isPad:/(ipad)/.test(e)},a=isSupportMP4();o.isSupportMP4=a.isSupport,o.mime=a.mime;var s="",l=0,c=[],u=RegMap;/trident/.test(e)&&(u=IERegMap);for(var h=0;h<u.length;h++)if(c=u[h].reg.exec(e)){s=u[h].key,l=c.length>2?c[2]:"";break}if(s)o["is".concat(s)]=!0,o.name=s,o.appVersion=l;else{var d=checkIs360();d&&(o.name="360EE")}if(o.name&&"Trident"!==o.name){var p=/(trident)/.exec(e);p&&(o.name=o.name?"".concat(o.name,"_Trident"):"Trident")}return o.isSpider=checkIsSpider(o.name),o}function checkIs360(){var e=navigator.mimeTypes;if(e){for(var t=0;t<e.length;t++){if(e[t].type&&e[t].type.indexOf("360")>-1)return!0;if(e[t].type&&e[t].type.indexOf("application/vnd.chromium.remoting-viewer")>-1)return!0;if(e[t].description&&e[t].description.indexOf("360")>-1)return!0}return!1}}var Browser="undefined"!=typeof navigator&&detect(navigator.userAgent);function isHevcSupported(){return!("undefined"==typeof MediaSource||!MediaSource.isTypeSupported)&&(MediaSource.isTypeSupported('video/mp4;codecs="hev1.1.6.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.2.4.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.3.E.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.4.10.L120.90"'))}function probeConfigSupported(e){var t={supported:!1,smooth:!1,powerEfficient:!1};if(!e||"undefined"==typeof navigator)return Promise.resolve(t);if(navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo)return navigator.mediaCapabilities.decodingInfo(e);var r=e.video||{},i=e.audio||{};try{var n=MediaSource.isTypeSupported(r.contentType),o=MediaSource.isTypeSupported(i.contentType);return Promise.resolve({supported:n&&o,smooth:!1,powerEfficient:!1})}catch(e2){return Promise.resolve(t)}}var defaultConfig={range:"0-1048576",timer:6e4,timeout:15e3},SpeedCheckTask=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};_classCallCheck(this,e),Object.keys(defaultConfig).map((function(e){void 0!==t[e]&&null!==t[e]||(t[e]=defaultConfig[e])})),this.options=t,this._headers={},this.intervalId=null,this.ishangUp=!1,this._data={contentLength:0,statusText:"",status:-1,speed:0,costTime:0,connectTime:0,contentType:""},this.url=[]}return _createClass(e,[{key:"setData",value:function(e,t){var r=this;if(Object.keys(e).map((function(t){"headers"!==t&&(r._data[t]=e[t])})),e.headers&&Object.keys(e.headers).length>0){this._headers=transformHeader(e.headers),e.headers["content-type"]&&(this._data.contentType=e.headers["content-type"]);var i=(e.headers["content-range"]||"").split("/");i&&i.length>1&&(this._data.contentLength=parseInt(i[1]))}}},{key:"contentLength",get:function(){return this._data.length||0}},{key:"trigger",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"start",i=this.options;this.url=e,!this.url||"start"!==r&&(this.ishangUp||this.intervalId)?log("task>>cant`t trigger url",this.ishangUp,this.intervalId):(log("task>>trigger url ",e),this.ishangUp=!0,this.intervalId&&this.clear(),this.intervalId=setTimeout((function(){t.clear()}),"start"===r?500:i.timer),getXhr(this.url,{range:"start"===r?"0-1024":i.range,timeout:i.timeout}).then((function(e){log("getXhr>>check result ",e),t.setData(e||{}),t.ishangUp=!1})).catch((function(e){log("getXhr>>error ",e),t.ishangUp=!1,t._data.status=-1})))}},{key:"url",get:function(){return this.options.url},set:function(e){e&&(this.options.url=e)}},{key:"serverIp",get:function(){return this._headers.x_response_sinfo||""}},{key:"headers",get:function(){return this._headers||{}}},{key:"status",get:function(){return this._data.status||-1}},{key:"speed",get:function(){return this._data.speed}},{key:"clear",value:function(){clearTimeout(this.intervalId),this.intervalId=null}}]),e}(),VERSION="0.11.15";log("xgVodLogger version is ".concat(VERSION));var isObject=isType("Object"),TEA_ID=1300,LS_KEY="__tea_cache_tokens_".concat(TEA_ID),DEFAULT_INTERVAL=-1,AB_SDK_VERSION="",Collector=null,__support=Browser.isSupportMP4?1:0;__support=isHevcSupported()?__support+2:__support,probeConfigSupported({type:"file",video:{contentType:'video/mp4;codecs="hev1.1.6.L120.90"',width:1920,height:1080,bitrate:1e4,framerate:30}}).then((function(e){e&&e.supported&&(__support+=1)})).catch((function(e){}));var XGPlayerAppLogger=function(){function e(t,r){var i=this;if(_classCallCheck(this,e),_defineProperty(this,"initializeUrlLog",(function(e){var t=e&&e.url?e.url:"String"===typeOf(e)?e:"";"String"!==typeOf(t)&&(t=""),i.urlLog={initial_url:t,initial_host:getHostFromUrl(t),initial_ip:""}})),_defineProperty(this,"onXgLogCache",(function(){var e,t,r=null===(e=i.player)||void 0===e?void 0:e.getLogCache();r&&(i._templog={vtype:null===(t=i.player)||void 0===t?void 0:t.vtype,log:r},i.onOneTemp())})),_defineProperty(this,"onMediaFormatError",(function(e){i.onOneEvent({end_type:(e.error_type||"")+"Error"})})),_defineProperty(this,"onDrmTypeChange",(function(e){i.addIfExist("drm_type",{drm_type:e},i._options)})),_defineProperty(this,"onReplayBtnClick",(function(){i.resetLoggerParams()})),_defineProperty(this,"onBeforeDefinitionChange",(function(){i.resLogs.ldst=nowTime(),i._endType="switch"})),_defineProperty(this,"onDefinitionChange",(function(e){var t=e.from,r=e.to;i.changeResolution({from:t,to:r,startTime:i.resLogs.ldst,operaType:"switch"}),log("onDefinitionChange from:".concat(t,", to:").concat(r))})),_defineProperty(this,"onDefiChangeSuccess",(function(){log("onDefinitionChangeSuccess"),i.updateVideoSize(),i.triggerTask("start")})),_defineProperty(this,"onAbrChange",(function(e){var t=e.prev,r=e.cur,n=e.abrInfo;if(i.player.abrInstance){var o=i.player.abrInstance.eventInfo;log("abrChange",o),o.last_definition=t,o.now_definition=r,i.abrInfo.abr_event_info.video_switch.push(o),i.changeResolution({from:t,to:r,startTime:nowTime(),operaType:"abr_switch",abrInfo:n})}})),_defineProperty(this,"onAbrPrestallEnd",(function(e){i.abrInfo.abr_user_info.cancel_abr=e?1:0})),_defineProperty(this,"onTimeUpdate",(function(){var e=i.playlogs,t=i.resLogs,r=i.player;if(i.errorLog.try_err_c=0,e.vt||1!==i.startStep||(e.vt=curTimestamp(),log("onTimeUpdate: first frame inited","currentTime11:".concat(r.currentTime," vt-pt:").concat(e.vt-e.pt," vt-nt:").concat(e.vt-e.nt," vt-rt:").concat(e.vt-e.rt)),i.startStep=2),!t.initial_resolution){var n=r.currentDefitionFromPler&&r.currentDefitionFromPlayer.definition?r.currentDefitionFromPlayer.definition:r.config.defaultDefinition||r.video.videoHeight+"p"||"";n=formatDefinition(n),t.initial_resolution=n}t.final_resolution||(t.final_resolution=t.initial_resolution);var o=e.played.length;o<1?e.played.push({begin:r.currentTime,end:-1}):e.played[o-1].end=r.currentTime;var a=t.played.length;a<1?t.played.push({begin:r.currentTime,end:-1}):t.played[a-1].end=r.currentTime,i.lastVideoTime=r.currentTime||0})),_defineProperty(this,"onCanplay",(function(){log("onCanplay","this.startStep:".concat(i.startStep," ").concat(curTimestamp())),i.setVt()})),_defineProperty(this,"onLoadeddata",(function(){log("onLoadeddata","this.startStep:".concat(i.startStep," ").concat(curTimestamp())),i.setVt(),i.updateVideoSize()})),_defineProperty(this,"onLoadStart",(function(){var e=checkVideoSrcIsEmpty(i.player.currentSrc);i.triggerTask("start"),log("onLoadStart","this.startStep:".concat(i.startStep," ").concat(curTimestamp()," isSrcEmpty:").concat(e," player.src:").concat(i.player.src)),0!==i.startStep||e||"visible"!==document.visibilityState||i.setPt()})),_defineProperty(this,"onDashStateChange",(function(e){log("onDashStateChange","this.startStep:".concat(i.startStep," ").concat(nowTime()," state:").concat(e));var t=i.playlogs;if(i.startStep<2)switch(e){case"player_start":t.dash_pst=nowTime();break;case"wasm_start":t.dash_wst=nowTime();break;case"wasm_ready":t.dash_wrt=nowTime();break;case"init_finished":t.dash_ift=nowTime();break;case"core_start":t.dash_cst=nowTime();break;case"start_play":t.dash_spt=nowTime()}})),_defineProperty(this,"onBufferedChange",(function(){var e=i.player.video&&i.player.video.buffered;if(e){var t=e.length;t>0&&e.end(t-1)+1>i.player.duration&&(i.bft=curTimestamp())}})),_defineProperty(this,"onPlayerInited",(function(){log("player init"),i._playerCreatedTime=curTimestamp(),i.playlogs.rt=curTimestamp()})),_defineProperty(this,"onNotAutoPlay",(function(){log("onNotAutoPlay","autoplay:".concat(i.isAutoplay)),0===i.isAutoplay?i.isAutoplay=2:1===i.isAutoplay&&(i.isAutoplay=3)})),_defineProperty(this,"onDashError",(function(e){e=e||{};var t=i.errorLog;t.last_errors.push(e.errorCode),t.accu_errc++,i.onOneError({errorType:e.errorTypeCode,code:e.errorCode,url:e.url||"",headers:e.headers||{}},0)})),_defineProperty(this,"onPlayerError",(function(e){e=e||{};var t=i.errorLog,r=i.player;if(log("onPlayerError","this.player.type:".concat(i.player.type," this.player.replayRunning:").concat(i.player.replayRunning," isSupportMP4:").concat(Browser.isSupportMP4," isPC:").concat(Browser.isPC)),log("onPlayerError",e),i.load_state=LOAD_STATES.ERROR,i._endType="error",i.suspendWaitingStatus("onPlayerError"),"dash"!==r.type||!r.replayRunning){if(e.url||(e.url=i.player.currentSrc),Browser.isPC&&!Browser.isSupportMP4||Browser.isSpider)return t.errc=ERROR_CODES[5],t.errt=ERROR_TYPES.notSupport,i.onOneError({errorType:t.errt,code:t.errc,url:e.url,headers:e.headers||{},message:e.message||""},0),void(i._isOnePlayReport=!0);t.errt=e.errorTypeCode||(e.errorType&&ERROR_TYPES[e.errorType]?ERROR_TYPES[e.errorType]:9999),e.errorCode?t.errc=e.errorCode>0&&ERROR_CODES[e.errorCode]?ERROR_CODES[e.errorCode]:e.errorCode:e.code&&(t.errc=e.code>0&&ERROR_CODES[e.code]?ERROR_CODES[e.code]:e.code),t.last_errors.push(t.errc),0===t.fir_errc&&(t.fir_errc=t.errc),i.onOnePlay(ENDED_TYPE.ERROR),i.onOneTemp(ENDED_TYPE.ERROR),i.sendDegradeLog("playCatch_end",i.playlogs.degrade);var n=!1;!i._options.needXhrCheck||4!==e.errorCode&&2!==e.errorCode||(n=!0),i.onOneError({endState:ENDED_TYPE.PLAY_ERROR,errorType:t.errt,code:t.errc,url:e.url,headers:e.headers||{},message:e.message||""},0,n),i.sendEventsQueue()}})),_defineProperty(this,"onPlayInterfaceInfo",(function(e){log("onPlayInterfaceInfo",e);var t=i.errorLog,r=i.apiLog,n=i.playlogs;if(e&&Object.keys(e).map((function(t){"code"===t?r.vsc=e[t]:"message"===t?r.vsc_message=e.message||"success,视频可正常播放":r[t]=e[t]})),n.at=e.timestamep||(new Date).getTime(),(!e.error||-9988!==e.error.errc)&&(r.vsc=e.code||10,r.vsc_message=e.message||"success,视频可正常播放",e.error)){var o=e.error;t.errt=1e3,t.errc=o.errc||-9998,t.last_errors.push(o.errc||-9998),0===t.fir_errc&&(t.fir_errc=o.errc||-9998),t.accu_errc++,1===t.accu_errc&&(t.fir_errt=nowTime()),i.onOneError({errorType:1e3,code:o.errc||-9998,url:"",headers:{}})}})),_defineProperty(this,"onProgressEvent",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=i.netLog;if(e.speed){var r=e.speed>1e6?Math.floor(e.speed/1e3):e.speed;t.downloadSpeed=r,t.totalSpeed+=r,t.rqCount++}"oversize"!==e.type&&t.requestCount++,e.connectTime&&(t.connectCost=e.connectTime);var n=t.rqCount<7?100:e.costTime>=5e3?20:10;if(!("success"===e.type&&parseInt(100*Math.random(),10)<=n)){var o=findPerformanceInfo(e.cdnUrl),a=e.xhr||{},s=e.type?"progress_".concat(e.type):"progress",l=e.headers;l||(l=getResponseHeaders(a));var c=_objectSpread2(_objectSpread2({},l=transformHeader(l)),{},{download_speed:t.downloadSpeed,connect_cost:t.connectCost,c_dur:o.connectDuration||0,d_dur:o.domainDuration||0,r_dur:o.duration||0,rqtt:(new Date).getTime(),x_cache:l.x_response_cache||"",server_ip:l.x_response_sinfo});e.status?t.status=e.status:a&&a instanceof window.XMLHttpRequest&&(t.status=a.status||0),c.status=t.status;var u=e.cdnUrl||e.url;"error"===e.type&&i.merror.cdn.push(_objectSpread2(_objectSpread2({costTime:e.costTime,cur_play_pos:e.pos,cdn_url:u,cdn_host:getHostFromUrl(u)},c),l)),i.onOneEvent({costTime:e.costTime,vid:e.vid,end_type:s,cur_play_pos:e.pos,cdn_url:u,cdn_host:getHostFromUrl(u)},c,"error"===e.type?0:2)}})),_defineProperty(this,"onNext",(function(e){if(log("onNext:startStep:",i.startStep),i.startStep>0){if(i._reportInvalidVV(ENDED_TYPE.NEXT))return;i.onOnePlay(ENDED_TYPE.NEXT),i.onOneTemp(ENDED_TYPE.NEXT),i.sendEventsQueue()}i.vtype=null,i.playlogs.lc=0,i.resetLoggerParams()})),_defineProperty(this,"onNextEnded",(function(){var e=i.player,t=i.resLogs,r=formatDefinition(e.config.defaultDefinition||"");t.initial_resolution=r,t.final_resolution=r})),_defineProperty(this,"onXgLogWaiting",(function(e){var t=i.playlogs,r=i.resLogs,n=i.stall;if(i._options.checkByInnerLog&&0===e.type){log("onXgLogWaiting",e);var o=e.endType,a=e.costTime,s=e.start,l={download_speed:i.realSpeed,avg_speed:i.avgSpeed,mse_op:i.mp4MseOpLength,mp4_load_range:i.mp4LoadSegmentTimeRange,bitrate:i.curBitrate};if("waitingStart"===e.eventType)return i.onOneEvent({costTime:a,end_type:"waitstart"},l,2),void i.appendStallInfo("start",s);if("waitingEnd"===e.eventType){var c=nowTime();log("onXgLogWaiting>>".concat(o,"|costTime:").concat(a," vt:").concat(t.vt)),i.appendStallInfo("end",c,o),t.bc++,i.checkInBuffer(i.player.currentTime)?(t.de_bu_acu_t+=a,t.dbc++):(t.nbc++,t.n_bu_acu_t+=a),r.bc++,t.bu_acu_t+=a,r.bu_acu_t+=a,n.stall_end=c,n.stall_last_interval=n.stall_end-n.stall_start,n.stall_acc_time+=n.stall_last_interval,1===n.sc&&(n.first_buf_endt=c),i.onOneEvent({costTime:a,end_type:"waitend"},l,2)}}})),_defineProperty(this,"onSeeking",(function(){if(!checkVideoSrcIsEmpty(i.player.src)){var e=i.resLogs,t=i.playlogs,r=i.player,n=i.seekLog;log("onSeeking","currentTime:".concat(r.currentTime)),0===i.startStep&&i.setPt(),i.suspendWaitingStatus("seek"),i.isSeeking&&i.suspendSeekStatus("seek",!1),i.isSeeking=!0,t.played.push({begin:i.player.currentTime,end:-1}),e.played.push({begin:i.player.currentTime,end:-1}),n.lastSeekStartTime=nowTime(),n.seekBefore=i.lastVideoTime.toString(),n.intervalId=setTimeout((function(){i.isSeeking&&i.suspendSeekStatus("seekTimeout",!0)}),MAX_STALL_TIME)}})),_defineProperty(this,"onSeeked",(function(){checkVideoSrcIsEmpty(i.player.src)||i.isSeeking&&i.suspendSeekStatus("seeked",!0)})),_defineProperty(this,"onPlaying",(function(){i.suspendWaitingStatus("play"),i.load_state=LOAD_STATES.PLAYABLE;var e=nowTime();i.pauseLog.isPausing&&(i.pauseLog.isPausing=!1,i.pauseLog.pause_acu_t+=e-i.pauseLog.pause_start)})),_defineProperty(this,"onPlayCatch",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{errorType:"",errorTypeCode:0,errorCode:0,url:"",headers:{},status:0};if(log("onPlayCatch",e,t),e){switch(e){case"mp42dash":i.vtype="DASH_2";break;case"dash2mp4":i.vtype="MP4_2";break;case"dash1mp4":i.vtype="MP4_1";break;default:i.vtype=e}var r=i.errorLog,n=i.playlogs,o=i.merror;o.playCatch.push(_objectSpread2({errc:t.errorCode,errt:t.errorType},t.headers)),i.setBr("playcatch"),r.accu_errc++,r.try_err_c++,r.fir_errc=t.errorCode,t.errorCode&&r.last_errors.push(t.errorCode),i.suspendWaitingStatus("playcatch"),i.sendDegradeLog("playCatch",n.degrade,{cdn_url:t.url}),n.degrade=e,i.onOneError({errorType:t.errorTypeCode,code:t.errorCode,url:t.url||"",status:t.httpCode||t.status,headers:t.headers||{},vid:t.vid||i.vid,preload_hit:t.preloadHit||0,preload_cached:t.preloadCached||0,endState:ENDED_TYPE.PLAY_CATCH,costTime:t.costTime,message:t.errorMessage||t.message},0)}})),_defineProperty(this,"onMediaExpied",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{errorType:"",errorTypeCode:0,errorCode:0,url:"",headers:{},status:0},t=i.errorLog,r=i.playlogs;log("onMediaExpied",e),i.suspendWaitingStatus("expied"),i.setBr("expied"),t.accu_errc++,t.try_err_c++,t.last_errors.push(e.errorCode),r.at=(new Date).getTime(),i.merror.expied.push(_objectSpread2({errorType:e.errorTypeCode||e.errorType,code:e.errorCode,url:e.url||"",status:e.status},transformHeader(e.headers||{}))),i.onOneError({errorType:e.errorTypeCode||e.errorType,code:e.errorCode,url:e.url||"",status:e.status,headers:e.headers||{}},0)})),_defineProperty(this,"onLog",(function(e){log("onLog",e);var t=e.type;if(delete e.type,t)switch(t){case LOGTYPES.RETRY:break;case LOGTYPES.ONETEMP:i._templog||(i._templog={}),i._templog=parseTempData(i._templog,e.data,e.action),i._templog.preload_hit&&(i._cacheFile=CACHE_FILE_TYPE.CACHED);break;case LOGTYPES.ONEERROR:var r=i.errorLog;r.accu_errc++,r.try_err_c++,i.setBr("mp4error"),r.last_errors.push(e.code),i.onOneError(e,0);break;case LOGTYPES.ONEEVENT:var n=formatData(e,{costTime:"costTime",vid:"vid",end_type:"end_type",pos:"cur_play_pos",cdnUrl:"cdn_url"});n.ext&&["start","end"].map((function(e){n.ext[e]&&(n.ext["ext_".concat(e)]=n.ext[e],delete n.ext[e])})),i.onOneEvent(n.data,n.ext,2)}})),_defineProperty(this,"onPlay",(function(){log("onPlay","this.startStep :".concat(i.startStep," this.isEnded:").concat(i.isEnded)),i.isEnded&&(i.resetLoggerParams(),i.setPt())})),_defineProperty(this,"onPause",(function(){log("onPause");var e=i.pauseLog;e.isPausing=!0,e.pause_start=nowTime()})),_defineProperty(this,"onWaiting",(function(){var e=i.stall,t=i._options;i.updateCurBuffer("onWaiting"),t.checkByInnerLog||(log("onWaiting>","isSeeking:".concat(i.isSeeking," startStep:").concat(i.startStep," intervalId:").concat(e.intervalId)),i.isSeeking||0===i.playlogs.vt||i.inWaitingStart>0||(e.intervalId&&(window.clearTimeout(e.intervalId),e.intervalId=null),i.inWaitingStart=nowTime(),e.intervalId=window.setTimeout((function(){var e=i.stall;log("stall.intervalId>>".concat(e.intervalId," cost: ").concat(nowTime()-i.inWaitingStart)),i._endType="wait",i.load_state=LOAD_STATES.STALLED,i.vtype.indexOf("MP4")>-1&&i.player.currentTime>10&&i.task&&(i.triggerTask("waiting",i.initial_url),i.requestCount++),e.stall_start=i.inWaitingStart,1===e.sc&&(e.first_buf_startt=i.inWaitingStart),window.clearTimeout(e.intervalId),e.intervalId=null,i.startWaitingStatus(i.inWaitingStart,nowTime()-i.inWaitingStart),e.intervalId=setTimeout((function(){i.inWaitingStart>0&&i.suspendWaitingStatus("waitTimeout")}),MAX_STALL_TIME)}),MIN_WAITIONG)))})),_defineProperty(this,"onEnded",(function(){if(i.initial_url){log("onEnded","watchDur:".concat(i.watchDur," vt:").concat(i.vt," pt:").concat(i.pt)),i.isEnded=!0;var e=i.resLogs.df;i.changeResolution({from:e,to:e,startTime:nowTime(),operaType:"leave_switch",endType:"ended"}),i.onOnePlay(ENDED_TYPE.ENDED),i.sendDegradeLog("playCatch_end",i.playlogs.degrade),i.onOneTemp(ENDED_TYPE.ENDED),i.sendEventsQueue(),i.playlogs.lc++}})),_defineProperty(this,"onUnload",(function(){0!==i.startStep&&i.initial_url&&(i.onOneTemp(ENDED_TYPE.UNLOAD),i.sendDegradeLog("playCatch_end",i.playlogs.degrade),i._reportInvalidVV(ENDED_TYPE.UNLOAD)||i.onOnePlay(ENDED_TYPE.UNLOAD,!0))})),_defineProperty(this,"onVisibilitychange",(function(){var e=i.playlogs.vt;"visible"===document.visibilityState&&(e||i.setPt())})),_defineProperty(this,"onDestroy",(function(){log("onDestroy:this.startStep:".concat(i.startStep," initial_url:").concat(i.initial_url," ").concat(!!i.initial_url)),i.onOnePlay(ENDED_TYPE.DESTROY),i.startStep>0&&i.initial_url&&(i.onOneTemp(ENDED_TYPE.DESTROY),i.sendDegradeLog("playCatch_end",i.playlogs.degrade));var e=i.resLogs.df;i.changeResolution({from:e,to:e,startTime:nowTime(),operaType:"leave_switch",endType:"destroy"}),i.sendEventsQueue(),Browser.isPC?window.removeEventListener("beforeunload",i.onUnload):(Browser.isMobile||Browser.isPad)&&window.removeEventListener("pagehide",i.onUnload),document.removeEventListener("visibilitychange",i.onVisibilitychange),i.listeners.forEach((function(e){i.player.off(e.evt,e.handler)})),i.clearTimers(),i.player.off("destroy",i.onDestroy),i.task&&i.task.clear()})),_defineProperty(this,"onOnePlay",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(log("onOnePlay _isOnePlayReport:".concat(i._isOnePlayReport," isLeave: ").concat(t," endState:").concat(e)),!i._isOnePlayReport){var r=i.errorLog,n=i.playlogs,o=i.abrInfo,a=i.resLogs,s=i.player,l=i.apiLog,c=i.pauseLog,u=i.stall,h=i.netLog,d=i.watchDur;i._isOnePlayReport=!0;var p=curTimestamp(),f=i.getBufferTime(s),g=i.getPerformance();i.setExt();var y=_objectSpread2(_objectSpread2(_objectSpread2({local_time:(new Date).getTime(),log_type:"video_playq",plugin_exception:0,player_create_exception:"",v:i.vid,initial_url:i.initial_url,initial_host:i.initial_host,initial_ip:i.curHeaders.x_response_sinfo||0,initial_type:i.initial_type},i.curHeaders),{},{initial_resolution:a.initial_resolution,final_resolution:a.final_resolution,pt:i.pt,prepare_start_time:n.nt,prepare_end_time:n.rt||curTimestamp(),vt:i.vt,lt:i.lt,lpt:i.lpt,fvt:i.fvt,nvt:i.nvt,bft:i.bft,sc:i.seekLog.sc,sat:i.seekLog.sat,bc:i.bc,dbc:n.dbc||0,nbc:n.nbc||0,video_net_s:i.videoNetworkState,status:i.curStatus,first_buf_startt:u.first_buf_startt,first_buf_endt:u.first_buf_endt,lc:n.lc,bu_acu_t:i.bu_acu_t>MAX_TIME?0:i.bu_acu_t,de_bu_acu_t:n.de_bu_acu_t||0,n_bu_acu_t:n.n_bu_acu_t||0,pause_acu_t:c.pause_acu_t,cur_play_pos:i.cur_play_pos,load_state:i.load_state,play_speed:i.playbackRate,playback_state:i.playback_state,end_state:e,watch_dur:d>MAX_TIME?0:d,switch_resolution_c:i.switchResolutionCount,is_start_play_automatically:i.isAutoplay,start_time:i.start_time,finish:i.finish,errt:r.errt,errc:r.errc,vsc:l.vsc,vsc_message:l.vsc_message,api_str:l.api_str,auth:l.auth||l.logid,width:i.videoWidth,height:i.videoHeight,vd:i.vd,video_length:parseInt(f.video,10),audio_length:parseInt(f.audio,10),df:i.resolution,lf:a.lf,play_c:0,player_created_t:i.player_created_t,fir_errt:r.fir_errt,fir_errc:r.fir_errc,lv_method:0,ldst:a.ldst,ldet:a.ldet,is_disable_short_seek:0,mute:i.mute,volume:i.volume,download_speed:i.realSpeed?i.realSpeed:i.task&&i.task.speed?i.task.speed:h.downloadSpeed,avg_speed:i.avgSpeed?i.avgSpeed:h.rqCount>0?parseInt(h.totalSpeed/h.rqCount,10):0,bitrate:i.curBitrate,preload_state:i.preloadState,preload_hit:i.preLoadData.hit||0,preload_cached:i.preLoadData.duration||i.preLoadData.byteLength||0,mdl_req_num:h.requestCount,watingcost:i.watingCost,br:n.br,fbrt:n.fbrt,try_err_c:r.try_err_c,accu_errc:r.accu_errc,dash_pst:i.dash_pst,dash_wst:i.dash_wst,dash_wrt:i.dash_wrt,dash_ift:i.dash_ift,dash_cst:i.dash_cst,dash_spt:i.dash_spt,dash_break:2===s.dashBufferBreak?1:0,merror:toJsonString(i.merror),ex:toJsonString(i.exInfo),perf:toJsonString(g),bufs:toJsonString(i.buffers.allBuffer),vs:a.vs,vds:a.vds,vps:a.vps},i.buffers.curBuffer),{},{degrade:n.degrade,cache_file:i._cacheFile});if(0!==i.vt&&(y.et=p),s&&s.dashState&&(y.dash_state=s.dashState),s.abrInstance){var v=s.abrInstance;if(i.updateAbrInfo(o,v,s.playbackRate),v.getAbrVVStats){var m=v.getAbrVVStats();Object.keys(m).forEach((function(e){y[e]=m[e]}))}}if(o.abr_init_opts=s.config.autoBitrateOpts||{},y.abr_info=toJsonString(i.abrInfo),t){var _=!i._options.disableLocalCache;i.reportLog(REPORT_EVENTS.ONE_PLAY,y,_?1:0)}else i.reportLog(REPORT_EVENTS.ONE_PLAY,y)}})),_defineProperty(this,"onOneEvent",(function(e){var t=e.costTime,r=e.vid,n=e.end_type,o=e.cur_play_pos,a=e.cdn_url,s=e.cdn_host,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=arguments.length>2?arguments[2]:void 0;log("onOneEvent",n);var u=i.buffers.curBuffer,h=_objectSpread2({local_time:(new Date).getTime(),v:r||i.vid,cost_time:t,end_type:n||i.end_type,cdn_url:a||i.url,cdn_host:s||"",initial_type:i.initial_type,resolution:i.resolution,play_speed:i.playbackRate,first_frame_interval:nowTime()-i.pt,last_switch_interval:i.getLastInterval("lastSwitchStartTime",i.resLogs,!1),last_seek_interval:i.updateSeekPt(!1),last_event_interval:i.getLastInterval("lastEventTime"),cur_play_pos:o||i.cur_play_pos,video_ready_s:i.videoReadyState,video_seeking:i.videoSeeking,video_paused:i.videoPaused,bufs:toJsonString(i.buffers.allBuffer),retry_count:i._retryCount,at:i.playlogs.at,stay_seconds:parseInt(((new Date).getTime()-i.playlogs.at)/1e3,10),preload_state:i.preloadState,preload_hit:i.preLoadData.hit,preload_cached:i.preLoadData.duration||i.preLoadData.byteLength},u);if("waitstart"===n&&"function"==typeof i._options.getPageFPS){var d=i._options.getPageFPS();h.cur_fps=d.curFPS||0,h.avg_fps=d.avgFPS||0}var p=i.player;p&&p.dashState&&(h.dash_state=i.player.dashState),Object.keys(l).forEach((function(e){h[e]=l[e]})),h.ex=toJsonString(i.getPlayerExt()),i.addIfExist("drm_type",i._options,h),i.reportLog(REPORT_EVENTS.ONE_EVENT,h,c)})),_defineProperty(this,"onOneTemp",(function(){if(log("onOneTemp>>",!i._templog),i._templog){var e=i.player,t=i.playlogs,r=i.pauseLog,n=i.errorLog,o=i.resLogs,a=i.watchDur,s=_objectSpread2(_objectSpread2(_objectSpread2({local_time:(new Date).getTime()},i._templog),{},{v:i.vid,initial_type:i.initial_type,pt:i.pt,vt:i.vt,lt:i.lt,fvt:i.fvt,bc:i.bc,bu_acu_t:i.bu_acu_t>MAX_TIME?0:i.bu_acu_t,pause_acu_t:r.pause_acu_t,cur_play_pos:i.cur_play_pos,watch_dur:a>MAX_TIME?0:a,finish:i.finish,errt:n.errt,errc:n.errc,vd:i.vd,df:i.resolution,lf:o.lf,br:t.br,fbrt:t.fbrt,try_err_c:n.try_err_c,accu_errc:n.accu_errc,dash_break:2===e.dashBufferBreak?1:0,bufs:toJsonString(i.buffers.allBuffer),vs:o.vs,vds:o.vds,vps:o.vps},i.buffers.curBuffer),{},{degrade:t.degrade});0!==i.vt&&(s.et=curTimestamp()),["drm_type","dynamic_type"].forEach((function(e){i.addIfExist(e,i._options,s)})),i.reportLog(REPORT_EVENTS.ONE_TEMP,s,0),i._templog=null}})),this.player=t,void 0===this.player||null===this.player)throw new Error("player is ".concat(this.player));if(r&&r.line_app_id){r.isTask&&(this.task=new SpeedCheckTask),this.eventQueue=[],this._instanceCreateTime=(new Date).getTime(),r.codec_type=r.codec_type||"h264",this._options=r,!this._options.maxQueueCount&&(this._options.maxQueueCount=5),this.line_app_id=parseInt(r.line_app_id,10)||0,this.line_user_id=(r.line_user_id||"").toString(),this.playerCoreVersion=t.version,this.playerVersion=r.playerVersion,this.closeSeekLog=r.closeSeekLog||!1,this.start_time=1e3*(r.start_time||0),this._initial_resolution="",this.__vtype=null,this.__dt="",this.resetLoggerParams();try{this.initializeTracker(),this.sendLocalLog(),this.bindEvt(),log("logger constructor:"+this.player.video)}catch(e2){console.error(e2)}}else console.warn("player.config.vodLogOpts.line_app_id is necessary for plugin xgVodLogger")}return _createClass(e,[{key:"resetLoggerParams",value:function(){log("resetLoggerParams");var e=this.playlogs?this.playlogs.lc:0;this.playlogs={nt:curTimestamp(),vt:0,rt:this.isEnded?curTimestamp():0,at:0,pt:0,bu_acu_t:0,bc:0,br:0,fbrt:"",dbc:0,de_bu_acu_t:0,nbc:0,n_bu_acu_t:0,played:[{begin:0,end:-1}],dash_pst:0,dash_wst:0,dash_wrt:0,dash_ift:0,dash_cst:0,dash_spt:0,interruptCount:0,degrade:"none",lc:e},this.degradeLog={bu_acu_t:0,bc:0,watch_dur:0,hasSendEnd:!1},this.buffers={allBuffer:[],curBuffer:{buf_diff:0,buf_s_pos:0,buf_e_pos:0,buf_include:0}},this.netLog={downloadSpeed:0,requestCount:0,connectCost:0,totalSpeed:0,rqCount:0,status:0},this.merror={cdn:[],player:[],playCatch:[],expied:[]},this.exInfo={stall:[]},this._templog=null,this._isOnePlayReport=!1,this.startStep=0,this.bft=0,this.initializeLogDatas(),this.initializeUrlLog()}},{key:"initializeLogDatas",value:function(){this.startStep=0,this.inWaitingStart=0,this.lastVideoTime=0,this._endType="",this._retryCount=0,this.lastOperaTime=DEFAULT_INTERVAL,this.lastEventTime=DEFAULT_INTERVAL,this.seekLog={intervalId:0,lastSeekStartTime:nowTime(),seekBefore:0,sat:0,sc:0},this.resLogs={lastSwitchStartTime:DEFAULT_INTERVAL,switch_count:0,abr_switch_count:0,initial_resolution:"",final_resolution:"",ldst:0,ldet:0,df:"",lf:"",played:[],bc:0,bu_acu_t:0,sc:0,sat:0,buf:0,lbuf:0,lplayed:0,vs:0,vds:0,vps:0,vis:0,bitrate:0},this.apiLog={code:0,message:"",logid:"",api:"",auth:"",error:{}},this.errorLog={accu_errc:0,try_err_c:0,errt:0,errc:0,fir_errt:0,fir_errc:Browser.isSupportMP4?0:1005,last_errors:[]},this.pauseLog={pause_acu_t:0,isPausing:!1,pause_start:0},this.stall={intervalId:0,stall_count:0,first_buf_startt:0,first_buf_endt:0,stall_start:0,stall_end:0,stall_last_interval:0,stall_acc_time:0},this._playerCreatedTime=0,this.load_state=LOAD_STATES.UNKNOWN,this.lv_method=6,this.isSeeking=!1,this.isEnded=!1,this.startStep=0,this.isAutoplay=this.player.config&&this.player.config.autoplay?1:0,this.abrInfo={abr_general_info:{},abr_event_info:{video_switch:[],video_stall:[],video_exit:{}},abr_play_info:{start_play_time_ms:0,is_hint:0,playback_info:{internet_speed_record:[],play_bitrate_record:[],buffer_length_record:[],play_speed_record:[]}},abr_user_info:{cancel_abr:0},abr_init_opts:this.player.config.autoBitrateOpts||{}},this._cacheFile=CACHE_FILE_TYPE.NO_CACHE}},{key:"initSessionId",value:function(){var e="0";try{e=window.localStorage.getItem(LS_KEY).web_id||"0"}catch(t){e="0"}this._sessionId=generateSessionId(e),log("sessionId ".concat(this._sessionId))}},{key:"initializeTracker",value:function(){var e=this,t=this._options;if(window.__xgplayer_vod_log__)this.tracker=window.__xgplayer_vod_log__;else{this.tracker=window.__xgplayer_vod_log__=new Collector("tracker");var r=t.channel||"cn",i={app_id:"cn"===(r="va"===r||"sg"===r?r:"cn")?TEA_ID:1300===TEA_ID?323254:TEA_ID,channel:r,log:!1,disable_sdk_monitor:!0};t.channelDomain&&(i.channel_domain=t.channelDomain),i.enable_ab_test=!!t.enableAbTest,this.tracker.init(i)}this.initSessionId();var n=navigator?navigator.hardwareConcurrency:0,o=navigator?navigator.deviceMemory:0;this.commonParams={play_type:0,source_type:"vid",sdk_version:VERSION,pc:this.playerCoreVersion,pv:this.playerVersion,line_app_id:this.line_app_id,line_user_id:this.line_user_id,app_version:t.appVersion||"",platform:Browser.isPad?"pad":Browser.isMobile?"mobile":"pc",cpu_core:Number(n)||0,memory_size:Number(o)||0,support:__support,webdriver:navigator&&navigator.webdriver?1:0},log("commonParams ",this.commonParams);var a={evtParams:this.commonParams,disable_auto_pv:!0};log("Browser.name ",Browser.name),!Browser.name||Browser.isChrome||Browser.isSafari||(a.browser=Browser.name,Browser.appVersion&&(a.browser_version=Browser.appVersion)),this.line_user_id&&(a.user_unique_id=this.line_user_id,a.web_id=this.line_user_id),t.referrer&&(a.referrer=t.referrer,a.referrer_host=getHostFromUrl(t.referrer)),t.ext&&Object.keys(t.ext).map((function(r){e.exInfo[r]=t.ext[r]})),this.tracker.config(a),this.tracker.start()}},{key:"resetDefiInfo",value:function(){var e=this.resLogs;e.played=[],e.bc=0,e.bu_acu_t=0,e.sc=0,e.sat=0}},{key:"sendLocalLog",value:function(){var e=this,t=LOCAL_LOG.get();LOCAL_LOG.remove(),t.map((function(t){Object.keys(t).map((function(r){if(log("sendLocalLog",r,t[r]),e.player){e.player.emit("abLog",r,t[r]);var i=e._options.sendLocalCallback;i&&"function"==typeof i&&i(r,t[r])}e._track(r,t[r])}))}))}},{key:"_track",value:function(e,t){"function"==typeof this.tracker?this.tracker(e,t):this.tracker.event(e,t)}},{key:"bindEvt",value:function(){var e=this;this.listeners=[{evt:"play",handler:this.onPlay},{evt:"playing",handler:this.onPlaying},{evt:"pause",handler:this.onPause},{evt:"waiting",handler:this.onWaiting},{evt:"playInterfaceInfo",handler:this.onPlayInterfaceInfo},{evt:"DRM_ERROR",handler:this.onDashError},{evt:"ended",handler:this.onEnded},{evt:"loadeddata",handler:this.onLoadeddata},{evt:"loadstart",handler:this.onLoadStart},{evt:"canplay",handler:this.onCanplay},{evt:"dashStateChange",handler:this.onDashStateChange},{evt:"autoplay was prevented",handler:this.onNotAutoPlay},{evt:"autoplay_was_prevented",handler:this.onNotAutoPlay},{evt:"seeking",handler:this.onSeeking},{evt:"seeked",handler:this.onSeeked},{evt:"complete",handler:this.onPlayerInited},{evt:"timeupdate",handler:this.onTimeUpdate},{evt:"bufferedChange",handler:this.onBufferedChange},{evt:"beforeDefinitionChange",handler:this.onBeforeDefinitionChange},{evt:"definitionChange",handler:this.onDefinitionChange},{evt:"definitionChangeSuccess",handler:this.onDefiChangeSuccess},{evt:"drmTypeChange",handler:this.onDrmTypeChange},{evt:"replayBtnClick",handler:this.onReplayBtnClick},{evt:"initialUrl",handler:this.initializeUrlLog},{evt:"ABR_CHANGE",handler:this.onAbrChange},{evt:"playCatch",handler:this.onPlayCatch},{evt:"log",handler:this.onLog},{evt:"ABR_PRESTALL_END",handler:this.onAbrPrestallEnd},{evt:"progress_event",handler:this.onProgressEvent},{evt:"logger_next",handler:this.onNext},{evt:"playnext",handler:this.onNext},{evt:"nextEnded",handler:this.onNextEnded},{evt:"media_format_error",handler:this.onMediaFormatError},{evt:"xglog",handler:this.onXgLogWaiting},{evt:"xglog_cache",handler:this.onXgLogCache}];var t=this.player.config.errorKey;log(">>>errorKey",t);var r={evt:"error",handler:this.onPlayerError};t&&(r.evt=t),this.listeners.push(r),this.listeners.forEach((function(t){e.player.on(t.evt,t.handler)})),this.bindUnload()}},{key:"addIfExist",value:function(e,t,r){if(isObject(t)){var i=t[e];null!=i&&(r[e]=i)}}},{key:"changeResolution",value:function(e){var t=e.from,r=e.to,i=e.startTime,n=e.operaType,o=e.abrInfo,a=e.endType,s=void 0===a?"":a,l=this.resLogs;t=formatDefinition(t),r=formatDefinition(r),l.ldet=nowTime(),l.df=r,l.lf=t,l.final_resolution=r,l.switch_count++;var c=l.ldet-i,u={bc:l.bc,bu_acu_t:l.bu_acu_t,sc:l.sc,sat:l.sat,watch_dur:computeWatchDur(l.played)};o&&(u.abrInfo=o),this.updateVds(),this.resetDefiInfo(),this._options.closeResolutionLog||this.onOneOperator({costTime:c,operaType:n,endType:s,stateBefore:t,stateAfter:r},u,0)}},{key:"getLastInterval",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=t[e],n=nowTime(),o=i===DEFAULT_INTERVAL?DEFAULT_INTERVAL:n-i;return r&&(t[e]=n),o}},{key:"updateSeekPt",value:function(e){return this.getLastInterval("lastSeekStartTime",this.seekLog,e)}},{key:"_reportInvalidVV",value:function(e){return!!this._isInvaidVV()&&(this.onOneError({endState:e,errorType:9998,code:-1,url:this.player.currentSrc,headers:{}},0),this._isOnePlayReport=!0,!0)}},{key:"_isInvaidVV",value:function(){return 0===this.vt&&-1===this.curStatus}},{key:"bindUnload",value:function(){Browser.isPC?window.addEventListener("beforeunload",this.onUnload):(Browser.isMobile||Browser.isPad)&&window.addEventListener("pagehide",this.onUnload),document.addEventListener("visibilitychange",this.onVisibilitychange),this.player.once("destroy",this.onDestroy)}},{key:"clearTimers",value:function(){var e=this.seekLog,t=this.stall;e.intervalId&&window.clearTimeout(e.intervalId),t.intervalId&&window.clearTimeout(t.intervalId)}},{key:"sendDegradeLog",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"playCatch",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};log("sendDegradeLog",e,t,r);var i=this.degradeLog;if(!(i.hasSendEnd||"playCatch_end"===e&&"none"===t)){"playCatch_end"===e&&(i.hasSendEnd=!0);var n=this.bu_acu_t-i.bu_acu_t;this.onOneEvent({costTime:this.vd,vid:this.vid,end_type:e,cur_play_pos:this.player.currentTime,cdn_url:r.url},_objectSpread2({degrade:t,vt:this.vt,pt:this.pt,fvt:this.fvt,bc:this.bc-i.bc,bu_acu_t:n>MAX_TIME?0:n,watch_dur:this.watchDur-i.watch_dur},r),0)}}},{key:"getBufferTime",value:function(e){var t=0,r=0,i=e.video&&e.video.buffered;if(i){for(var n=i.length,o=0,a=0;a<n;a++)o+=i.end(a)-i.start(a);t=r=1e3*o}return{video:t,audio:r}}},{key:"updateAbrInfo",value:function(e,t,r){e.abr_general_info=t.generalInfo,e.abr_event_info.video_exit={local_time_ms:(new Date).getTime(),buffer_length:t.bufferLength,internet_speed:t.downloadSpeed,now_bitrate:t.nowBitrate,play_speed:r},t.getAbrPlayInfo&&(e.abr_play_info=t.getAbrPlayInfo())}},{key:"getPerformance",value:function(){return this.player.performance||{}}},{key:"setExt",value:function(){var e=this,t=this.player.ext||{};t.performance&&delete t.performance,Object.keys(t).map((function(r){"performance"!==r&&(e.exInfo[r]=t[r])}))}},{key:"onOneOperator",value:function(e){var t=e.costTime,r=e.operaType,i=e.stateBefore,n=e.stateAfter,o=e.endType,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,l=this.getLastInterval("lastOperaTime"),c={local_time:(new Date).getTime(),v:this.vid,opera_type:r,state_before:i,state_after:n,cost_time:t,end_type:o||this.end_type,cdn_url:this.url,resolution:this.resolution,last_interval:l,bufs:toJsonString(this.buffers.allBuffer),cur_play_pos:this.cur_play_pos,retry_count:this._retryCount},u=this.player;u&&u.dashState&&(c.dash_state=this.player.dashState),Object.keys(a).forEach((function(e){c[e]=a[e]})),this.addIfExist("drm_type",this._options,c),this.reportLog(REPORT_EVENTS.ONE_OPERA,c,s)}},{key:"onOneError",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{errorType:0,code:0,url:"",headers:{},costTime:0,vid:"",message:"",preload_hit:0,preload_cached:0},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];log("onOneError",t);var n=this.errorLog,o=this.apiLog,a=this.resLogs,s=this.player,l=this.playlogs,c=transformHeader(t.headers||{}),u=this.getPerformance();this.setExt();var h=_objectSpread2(_objectSpread2(_objectSpread2({v:t.vid||this.vid,video_pos:this.cur_play_pos,local_time:(new Date).getTime(),cost_time:t&&t.costTime?t.costTime:0,errt:t.errorType,errc:t.code,es:this.es,cdn_url:t.url||this.url,bufs:toJsonString(this.buffers.allBuffer),resolution:a.final_resolution,last_errors:n.last_errors.join(";"),vsc:o.vsc,vsc_message:t.message||o.vsc_message,server_ip:c.x_response_sinfo||0,initial_url:this.initial_url,initial_host:this.initial_host},c),{},{cur_play_pos:this.cur_play_pos},this.buffers.curBuffer),{},{degrade:l.degrade,end_state:t.endState||ENDED_TYPE.ERROR,preload_hit:t.preload_hit||0,preload_cached:t.preload_cached||0,ex:toJsonString(this.exInfo),pref:toJsonString(u),video_ready_s:this.videoReadyState});s&&s.dashState&&(h.dash_state=s.dashState);var d=this.player.currentSrc,p=checkIsBlob(d)?checkIsBlob(t.url)?this.initial_url:t.url:d,f={connectTime:0,status:0,statusText:"",isexpired:0,isBlob:checkIsBlob(d)?1:0};if(i&&"String"===typeOf(p)){var g={};getXhr(p,{range:"0-8",timeout:2e3}).then((function(e){log("getXhr>>check result ",e);var t=transformHeader(e.headers||{});h.server_ip=t.x_response_sinfo,g=_objectSpread2(_objectSpread2({},f),{},{statusText:e.statusText||"",status:e.status||0,connectTime:0|e.connectTime,sinfo:t.x_response_sinfo||"",cinfo:t.x_response_cinfo||""})})).catch((function(e){g=_objectSpread2(_objectSpread2({},f),{},{statusText:-2===e.status?"timeout":"error",status:e.status})})).finally((function(){var t=checkUrlIsExpired(p);g.isexpired=t,h.net=toJsonString(g),e.reportLog(REPORT_EVENTS.ONE_ERROR,h,r)}))}else h.net=toJsonString(f),this.reportLog(REPORT_EVENTS.ONE_ERROR,h,r)}},{key:"reportLog",value:function(t,r,i){var n=this,o=this._options,a=this.player.ABTestTag,s=this.commonParams;!r.player_sessionid&&(r.player_sessionid=this.sessionId),!r.web_url&&(r.web_url=window.location.href),r.user_agent=navigator.userAgent,r.dynamic_type=this.dynamicType;var l="Array"===typeOf(o.absdkVersion)?o.absdkVersion.join(","):o.absdkVersion;r.absdkVersion=l||e.AB_SDK_VERSION,null!=a&&(r.abtest_tag=a);var c=this._options;if(r.codec_type=this.codecType,isObject(c)&&(COMMON_KEYS.forEach((function(e){n.addIfExist(e,c,r)})),Object.keys(s).forEach((function(e){n.addIfExist(e,s,r)})),r.vtype=this.vtype),1===i){var u={};return u[t]=r,void LOCAL_LOG.set(u)}2!==i?(this.player&&this.player.emit("abLog",t,r),this._track(t,r)):this.addEventsQueue(t,r)}},{key:"addEventsQueue",value:function(e,t){this.eventQueue.push({event:e,params:t}),this.eventQueue.length>=this._options.maxQueueCount&&this.sendEventsQueue()}},{key:"sendEventsQueue",value:function(){for(;this.eventQueue.length>0;){var e=this.eventQueue.pop();this._track(e.event,e.params)}}},{key:"startWaitingStatus",value:function(e,t){this.onOneEvent({costTime:t,end_type:"waitstart"},{},2),this.appendStallInfo("start",e),this.updateCurBuffer("startWaitingStatus")}},{key:"triggerTask",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"start",t=arguments.length>1?arguments[1]:void 0;log("triggerTask>>",e);var r=checkVideoSrcIsEmpty(t=t||this.player.src);!r&&this.vtype.indexOf("MP4")>-1&&this.task&&this.task.trigger(t,e)}},{key:"appendStallInfo",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"start",t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;if(!this.player.ext){this.exInfo.stall||(this.exInfo.stall=[]);var i=this.exInfo.stall;if("start"===e){i.length>6&&i.splice(0,i.length-6);var n=this.buffers.curBuffer;i.push({start:t,end:-1,endType:"waitstart",cost:0,cur:this.cur_play_pos,buf_s:n.buf_s_pos,buf_e:n.buf_e_pos,buf_i:n.buf_include})}else if("end"===e){var o=i.length-1;if(o<0)return;i[o].end<0&&(i[o].end=t,i[o].endType=r,i[o].cost=t-i[o].start)}log("appendStallInfo",i)}}},{key:"suspendWaitingStatus",value:function(e){var t=nowTime(),r=this.playlogs,i=this.resLogs,n=this.stall,o=this.inWaitingStart;if(!(o<=0||this.isSeeking||r.vt<=0)){if(log("suspendWaitingStatus>>".concat(e,"|costTime:").concat(t-o," isSeeking:").concat(this.isSeeking," vt:").concat(r.vt)),this.appendStallInfo("end",t,e),t-o>MIN_WAITIONG){var a=t-this.inWaitingStart;if(r.bc++,this.checkInBuffer(this.player.currentTime)?(r.de_bu_acu_t+=a,r.dbc++):(r.nbc++,r.n_bu_acu_t+=a),i.bc++,r.bu_acu_t+=a,i.bu_acu_t+=a,n.stall_end=t,n.stall_last_interval=n.stall_end-n.stall_start,n.stall_acc_time+=n.stall_last_interval,1===n.sc&&(n.first_buf_endt=t),this.player.abrInstance&&!this.isSeeking&&this.playlogs.vt){var s=this.player.abrInstance;this.abrInfo.abr_event_info.video_stall.push({local_time_ms:(new Date).getTime(),stall_duration:parseFloat((a/1e3).toFixed(2)),buffer_length:s.bufferLength,internet_speed:s.downloadSpeed,now_bitrate:s.nowBitrate,play_speed:this.player.playbackRate,is_abr:s.isCurrentInAbr?1:0})}this.onOneEvent({costTime:a,end_type:e||"wait"},{},2)}this._endType="",this.load_state=LOAD_STATES.PLAYABLE,this.inWaitingStart=0,window.clearTimeout(n.intervalId),n.intervalId=null}}},{key:"suspendSeekStatus",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.isSeeking){var r=this.seekLog,i=this.resLogs,n=this.player,o=nowTime()-r.lastSeekStartTime;log("suspendSeekStatus>>","".concat(e," currentTime:").concat(n.currentTime," costTime:").concat(o," sat:").concat(r.sat," resLogs.sat:").concat(i.sat)),r.intervalId&&window.clearTimeout(r.intervalId),r.intervalId=null,this.isSeeking=!1;var a=this._endType="seek",s=r.seekBefore,l=(n.currentTime||0).toString();r.sc++,r.sat+=o>MAX_COST?0:o,i.sc++,i.sat+=o>MAX_COST?0:o,this.updateSeekPt(!0),!this.closeSeekLog&&t&&this.onOneOperator({costTime:o,operaType:a,stateBefore:s,stateAfter:l,endType:e})}}},{key:"setPt",value:function(){var e=this.playlogs;this.startStep=1,!e.pt&&this.player.currentTime&&(this.isSeeking=!0),e.pt||(e.pt=curTimestamp(),log("setPt","init pt :".concat(e.pt,", document.visibilityState:").concat(document.visibilityState)))}},{key:"setVt",value:function(){var e=this.playlogs;1===this.startStep&&(e.vt||(e.vt=curTimestamp(),log("setVt: first frame inited","vt-pt:".concat(e.vt-e.pt," vt-nt:").concat(e.vt-e.nt))),this.startStep=2)}},{key:"setBr",value:function(e){var t=this.playlogs;t.vt>0&&(0===t.br&&(t.fbrt=e||""),t.br++)}},{key:"codecType",get:function(){var e=this.player;return e&&e.config&&e.config.codecType?e.config.codecType:this._options.codec_type||"h264"}},{key:"url",get:function(){var e=this.player;return e&&e.config?e.config.url:""}},{key:"vid",get:function(){var e=this.player;return e&&e.config?e.config.vid:""}},{key:"bc",get:function(){return this.playlogs.bc}},{key:"bu_acu_t",get:function(){return this.playlogs.bu_acu_t}},{key:"pt",get:function(){return this.playlogs.pt||curTimestamp()}},{key:"vt",get:function(){var e=this.playlogs,t=e.vt;return e.pt>0?t:0}},{key:"fvt",get:function(){var e=this.playlogs,t=e.vt,r=e.pt;return t>0&&r>0?parseInt(t-r,10):0}},{key:"nvt",get:function(){var e=this.playlogs,t=e.vt,r=e.nt;return t>0&&r>0?parseInt(t-r,10):0}},{key:"dash_pst",get:function(){return this.playlogs.dash_pst}},{key:"dash_wst",get:function(){return this.playlogs.dash_wst}},{key:"dash_wrt",get:function(){return this.playlogs.dash_wrt}},{key:"dash_ift",get:function(){return this.playlogs.dash_ift}},{key:"dash_cst",get:function(){return this.playlogs.dash_cst}},{key:"dash_spt",get:function(){return this.playlogs.dash_spt}},{key:"vd",get:function(){var e=this.player;return e.duration&&"number"==typeof e.duration&&e.duration>0?parseInt(1e3*e.duration,10):e.config.duration&&"number"==typeof e.config.duration?parseInt(1e3*e.config.duration,10):0}},{key:"cur_play_pos",get:function(){return parseInt(1e3*this.player.currentTime,10)}},{key:"volume",get:function(){return this.player.volume}},{key:"buffer_time",get:function(){var e=0;try{var t=this.player.getBufferedRange();e=t[1]-t[0]}catch(e2){e=0}return e}},{key:"player_created_t",get:function(){return this._playerCreatedTime}},{key:"playbackRate",get:function(){return this.player.playbackRate}},{key:"mute",get:function(){return this.player.muted?0:1}},{key:"videoWidth",get:function(){var e=this.player;return e&&e.video?e.video.videoWidth:0}},{key:"videoHeight",get:function(){var e=this.player;return e&&e.video?e.video.videoHeight:0}},{key:"preload",get:function(){var e=this.player;return!(!e||!e.video)&&e.video.preload}},{key:"initial_url",get:function(){var e=this.player.currentSrc;return e.indexOf("blob:")>-1&&this.urlLog.initial_url?this.urlLog.initial_url:checkVideoSrcIsEmpty(e)?"":e}},{key:"initial_host",get:function(){var e=this.player.currentSrc;return e.indexOf("blob:")>-1&&this.urlLog.initial_host?this.urlLog.initial_host:getHostFromUrl(checkVideoSrcIsEmpty(e)?"":e)}},{key:"curHeaders",get:function(){var e=this.player,t=this.task;return e&&e.__dash__&&e.__dash__.curReqVideoSegInfo?transformHeader(e.__dash__.curReqVideoSegInfo.headers||{}):t?t.headers:{}}},{key:"curStatus",get:function(){var e=this.task,t=this.vtype,r=this.netLog;return t.indexOf("MP4")>-1?e?e.status:0:r.status}},{key:"play_type",get:function(){return 0}},{key:"resolution",get:function(){var e=this.player.curDefinition;return e?e.definition+"":this.resLogs.df}},{key:"sessionId",get:function(){return this._sessionId}},{key:"finish",get:function(){return this.isEnded?1:0}},{key:"end_type",get:function(){return this._endType}},{key:"avgSpeed",get:function(){return this.player&&this.player.avgSpeed?this.player.avgSpeed:0}},{key:"realSpeed",get:function(){return this.player&&this.player.realTimeSpeed?this.player.realTimeSpeed:0}},{key:"mp4MseOpLength",get:function(){if(!this.player||!this.player.plugins)return-1;var e=this.player.plugins.mp4encryptplayer;return e?e.opQueueLen||0:-1}},{key:"mp4LoadSegmentTimeRange",get:function(){if(!this.player||!this.player.plugins)return"";var e=this.player.plugins.mp4encryptplayer;return e?e.loadSegmentTimeRange.join(","):""}},{key:"preLoadData",get:function(){if(!this.player||!this.player.plugins)return[];var e=this.player.plugins.mp4encryptplayer;if(e&&e.preLoadData)return{hit:1,duration:e.preLoadData.duration,length:e.preLoadData.byteLength};var t=this.player.stat||{};if(t.preLoadData){var r=t.preLoadData.length;return{hit:r>0,length:r}}return{hit:0,duration:0,length:0}}},{key:"preloadState",get:function(){if(!this.player||!this.player.plugins)return 0;if(void 0!==this.player.preloadState)return this.player.preloadState||0;var e=this.player.plugins.mp4encryptplayer;return e&&e.preloadState?e.preloadState:0}},{key:"curBitrate",get:function(){var e=this.player,t=e.config,r=e.curDefinition;return r&&r.bitrate?r.bitrate:t.defaultBitrate?t.defaultBitrate:0}},{key:"videoReadyState",get:function(){var e=this.player;return e&&e.video?e.video.readyState:-1}},{key:"videoSeeking",get:function(){var e=this.player;return e&&e.video&&e.video.seeking?1:0}},{key:"videoPaused",get:function(){var e=this.player;return e&&e.video&&e.video.paused?1:0}},{key:"switchResolutionCount",get:function(){return this.resLogs.switch_count}},{key:"isError",get:function(){return this.player._isError||this.player.video.error}},{key:"isPlaying",get:function(){return hasClass(this.player.root,"xgplayer-playing")}},{key:"isStop",get:function(){return hasClass(this.player.root,"xgplayer-ended")||hasClass(this.player.root,"xgplayer-nostart")}},{key:"isPause",get:function(){return hasClass(this.player.root,"xgplayer-pause")}},{key:"isLoading",get:function(){return hasClass(this.player.root,"xgplayer-isloading")}},{key:"es",get:function(){return this.isPlaying?"playing":"beforePlay"}},{key:"lt",get:function(){var e=0;return 0===this.vt&&(log("lt init",this.playlogs.lt),e=curTimestamp()),e}},{key:"lpt",get:function(){return this.lt?this.lt-this.pt:0}},{key:"playback_state",get:function(){return this.isError?PLAYBACK_STATE.ERROR:this.isStop?PLAYBACK_STATE.STOP:this.isPause?PLAYBACK_STATE.PAUSE:this.isLoading?PLAYBACK_STATE.LOADING:PLAYBACK_STATE.PLAYING}},{key:"is_start_play_automatically",get:function(){return this.isAutoplay+""}},{key:"watchDur",get:function(){var e=this.player,t=this.playlogs,r=e.cumulateTime?e.cumulateTime:computeWatchDur(t.played);return r>=0?r:0}},{key:"vtype",get:function(){return this.__vtype?this.__vtype:(this.player?this.player.vtype||this.player.config.vtype:"")||(this.player.dash?"DASH":this._options.vtype||"MP4")},set:function(e){this.__vtype=e}},{key:"getPlayerExt",value:function(){var e=this.player.ext;if(e)return e}},{key:"watingCost",get:function(){if(this.inWaitingStart>0){var e=nowTime()-this.inWaitingStart;return e>MAX_COST?0:e}return 0}},{key:"videoNetworkState",get:function(){var e=this.player;return e&&e.video?e.video.networkState:-1}},{key:"eagleid",get:function(){var e=this.player;return e&&e.__dash__&&e.__dash__.curReqVideoSegInfo?(e.__dash__.curReqVideoSegInfo.headers||{}).eagleid:""}},{key:"initial_type",get:function(){var e=this.player.config||{};return e&&e.vodLogOpts&&void 0!==e.vodLogOpts.currentDashType?parseInt(e.vodLogOpts.currentDashType,10):-1}},{key:"dynamicType",get:function(){var e=this.player;return this.__dt?this.__dt:e&&e.__dash__&&e.__dash__.dash&&e.__dash__.dash.mpd?(this.__dt=e.__dash__.dash.mpd.dashType,this.__dt):""}},{key:"updateCurBuffer",value:function(e){var t=this.player,r=t.buffered,i=t.currentTime,n={buf_s_pos:0,buf_e_pos:0,buf_include:0,buf_diff:0},o=[];if(!r||r.length<1)return n;for(var a=-1,s=-1,l=parseInt(1e3*i,10),c=r.length-1;c>-1;c--){var u=parseInt(1e3*r.start(c),10),h=parseInt(1e3*r.end(c),10);o.push({start:u,end:h}),l>u&&l<h?(n.buf_include=1,n.buf_s_pos=u,n.buf_e_pos=h,n.buf_diff=h-l):l<u&&(a<0||u-l<a)?(a=u-l,s=c):l>h&&(a<0||l-h<a)&&(a=l-h,s=c)}1!==n.buf_include&&(s<0&&(s=r.length-1),n.buf_s_pos=parseInt(1e3*r.start(s),10),n.buf_e_pos=parseInt(1e3*r.end(s),10)),this.buffers.allBuffer=o,this.buffers.curBuffer=n}},{key:"checkInBuffer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.player.buffered;if(!r)return!1;e=parseInt(1e3*e,10);for(var i=0;i<r.length;i++){var n=parseInt(1e3*r.start(i),10)+t,o=parseInt(1e3*r.end(i),10)+t;if(e>n&&e<o)return!0}return!1}},{key:"updateVideoSize",value:function(){var e=this._options,t=this.player,r=this.resLogs,i=0,n=0;if(t.__dash__&&t.__dash__.dash&&t.__dash__.dash.mpd.mediaList){var o=t.__dash__.dash.mpd.mediaList.video,a=o[o.selectedIdx];log("updateVideoSize》》videoItem",a),n=a?a.bitrate||a.bandwidth:0,i=a?a.size:0}else{var s=this.player.curDefinition;s?(n=s.bitrate||t.config.bitrate||0,i=parseInt(s.bitrate*t.duration/8,10)):(i=e.videoSize||t.config.videoSize||0,n=e.bitrate||t.config.bitrate||0)}log("updateVideoSize","bitrate:".concat(n,", vs:").concat(i)),i&&(r.vs=i,r.vis=parseInt(i/t.duration,10),r.bitrate=n||r.vis)}},{key:"updateVds",value:function(){var e=this.resLogs,t=this.playlogs,r=this.player;if(0!==e.vis){for(var i=parseInt(computeWatchDur(t.played)/1e3,10),n=r.buffered,o=0,a=0;a<n.length;a++)o+=parseInt(n.end(a)-n.start(a),10);log("updateVds","pdur:".concat(i," bdur:").concat(o," \n lbuf:").concat(e.lbuf," lplayed:").concat(e.lplayed," bitrate: ").concat(e.bitrate," vis:").concat(e.vis," vs:").concat(e.vs)),e.vps+=parseInt((i-e.lplayed)*e.vis,10),e.vds+=parseInt((o-e.lbuf)*e.vis,10),e.lplayed=i,e.lbuf=o}else log("updateVds","vis:".concat(e.vis))}}],[{key:"TEA_ID",get:function(){return TEA_ID},set:function(e){LS_KEY="__tea_cache_tokens_".concat(TEA_ID=e)}},{key:"AB_SDK_VERSION",get:function(){return AB_SDK_VERSION},set:function(e){AB_SDK_VERSION="Array"===typeOf(e)?e.join(","):e}},{key:"Collector",set:function(e){Collector=e}},{key:"defaultConfig",value:function(){return{line_app_id:"",line_user_id:"",isTask:!1,codec_type:"",playerCoreVersion:"",playerVersion:"",start_time:0,maxQueueCount:5,channel:"cn",channelDomain:"",absdkVersion:"",checkByInnerLog:!0,drm_type:0,vtype:"MP4",tag:"普通视频",subtag:"",dynamic_type:"",sendLocalCallback:function(e,t){},disableLocalCache:!1,closeResolutionLog:!1,closeSeekLog:!1,needXhrCheck:!1}}}]),e}();XGPlayerAppLogger.TEA_ID=4951,XGPlayerAppLogger.Collector=Collector$1$1;var xgVodLogger=function(e){if(e&&e.player){var t=e.player.config.vodLogOpts||{};e.player.vodLogger=new XGPlayerAppLogger(e.player,t),e.player.plugins.xgVodLogger=e.player.vodLogger}else this.vodLogger=new XGPlayerAppLogger(this,this.config.vodLogOpts||{})};return xgVodLogger.pluginName="__xgVodLogger",xgVodLogger.playerConfig={},xgVodLogger.Collector=Collector$1$1,xgVodLogger.setABSdkVersion=function(e){XGPlayerAppLogger.AB_SDK_VERSION=e},xgVodLogger},module.exports=t2(es_array_concat,es_array_map,es_object_keys,esnext_string_at,es_object_toString,es_regexp_toString,web_domCollections_forEach,es_number_constructor,es_function_name,es_array_join,es_promise,es_promise_finally,es_array_splice,es_number_toFixed,es_regexp_exec,es_string_replace,es_string_split,es_string_trim,es_array_filter,es_string_match,es_regexp_constructor,es_symbol,es_symbol_description)})(index_b);var xgVodLogger=index_b.exports;function ownKeys$2(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function _objectSpread2$2(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$3(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,i=Object.defineProperty||function(e,t,r){e[t]=r.value},n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",s=n.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(O){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var o=t&&t.prototype instanceof d?t:d,a=Object.create(o.prototype),s=new C(n||[]);return i(a,"_invoke",{value:T(e,r,s)}),a}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(O){return{type:"throw",arg:O}}}e.wrap=c;var h={};function d(){}function p(){}function f(){}var g={};l(g,o,(function(){return this}));var y=Object.getPrototypeOf,v=y&&y(y(P([])));v&&v!==t&&r.call(v,o)&&(g=v);var m=f.prototype=d.prototype=Object.create(g);function _(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function n(i,o,a,s){var l=u(e[i],e,o);if("throw"!==l.type){var c=l.arg,h=c.value;return h&&"object"==_typeof$4(h)&&r.call(h,"__await")?t.resolve(h.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(h).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,s)}))}s(l.arg)}var o;i(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return o=o?o.then(i,i):i()}})}function T(e,t,r){var i="suspendedStart";return function(n,o){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===n)throw o;return{value:void 0,done:!0}}for(r.method=n,r.arg=o;;){var a=r.delegate;if(a){var s=S(a,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===i)throw i="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i="executing";var l=u(e,t,r);if("normal"===l.type){if(i=r.done?"completed":"suspendedYield",l.arg===h)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i="completed",r.method="throw",r.arg=l.arg)}}}function S(e,t){var r=t.method,i=e.iterator[r];if(void 0===i)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var n=u(i,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,h;var o=n.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function E(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 $(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function P(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 i=-1,n=function t(){for(;++i<e.length;)if(r.call(e,i))return t.value=e[i],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:w}}function w(){return{value:void 0,done:!0}}return p.prototype=f,i(m,"constructor",{value:f,configurable:!0}),i(f,"constructor",{value:p,configurable:!0}),p.displayName=l(f,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,l(e,s,"GeneratorFunction")),e.prototype=Object.create(m),e},e.awrap=function(e){return{__await:e}},_(b.prototype),l(b.prototype,a,(function(){return this})),e.AsyncIterator=b,e.async=function(t,r,i,n,o){void 0===o&&(o=Promise);var a=new b(c(t,r,i,n),o);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},_(m),l(m,s,"Generator"),l(m,o,(function(){return this})),l(m,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var i in t)r.push(i);return r.reverse(),function e(){for(;r.length;){var i=r.pop();if(i in t)return e.value=i,e.done=!1,e}return e.done=!0,e}},e.values=P,C.prototype={constructor:C,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($),!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 i(r,i){return a.type="throw",a.arg=e,t.next=r,i&&(t.method="next",t.arg=void 0),!!i}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],a=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(s&&l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&r.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;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,h):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),h},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),$(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var i=r.completion;if("throw"===i.type){var n=i.arg;$(r)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:P(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}function asyncGeneratorStep$1(e,t,r,i,n,o,a){try{var s=e[o](a),l=s.value}catch(error){return void r(error)}s.done?t(l):Promise.resolve(l).then(i,n)}function _asyncToGenerator$1(e){return function(){var t=this,r=arguments;return new Promise((function(i,n){var o=e.apply(t,r);function a(e){asyncGeneratorStep$1(o,i,n,a,s,"next",e)}function s(e){asyncGeneratorStep$1(o,i,n,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$3(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,_toPropertyKey$1(i.key),i)}}function _createClass$3(e,t,r){return t&&_defineProperties$3(e.prototype,t),r&&_defineProperties$3(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty$3(e,t,r){return(t=_toPropertyKey$1(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _inherits$2(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$2(e,t)}function _getPrototypeOf$2(e){return(_getPrototypeOf$2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _setPrototypeOf$2(e,t){return(_setPrototypeOf$2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function _isNativeReflectConstruct$2(){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(e2){return!1}}function _assertThisInitialized$2(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _possibleConstructorReturn$2(e,t){if(t&&("object"===_typeof$4(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$2(e)}function _createSuper$2(e){var t=_isNativeReflectConstruct$2();return function(){var r,i=_getPrototypeOf$2(e);if(t){var n=_getPrototypeOf$2(this).constructor;r=Reflect.construct(i,arguments,n)}else r=i.apply(this,arguments);return _possibleConstructorReturn$2(this,r)}}function _toPrimitive$1(e,t){if("object"!==_typeof$4(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!==_typeof$4(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _toPropertyKey$1(e){var t=_toPrimitive$1(e,"string");return"symbol"===_typeof$4(t)?t:String(t)}var wellKnownSymbol$8=wellKnownSymbol$t,create$4=objectCreate,defineProperty$5=objectDefineProperty.f,UNSCOPABLES=wellKnownSymbol$8("unscopables"),ArrayPrototype=Array.prototype;null==ArrayPrototype[UNSCOPABLES]&&defineProperty$5(ArrayPrototype,UNSCOPABLES,{configurable:!0,value:create$4(null)});var addToUnscopables$2=function(e){ArrayPrototype[UNSCOPABLES][e]=!0},fails$g=fails$K,correctPrototypeGetter=!fails$g((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),hasOwn$5=hasOwnProperty_1,isCallable$5=isCallable$t,toObject$8=toObject$g,sharedKey=sharedKey$4,CORRECT_PROTOTYPE_GETTER$1=correctPrototypeGetter,IE_PROTO=sharedKey("IE_PROTO"),$Object=Object,ObjectPrototype$3=$Object.prototype,objectGetPrototypeOf=CORRECT_PROTOTYPE_GETTER$1?$Object.getPrototypeOf:function(e){var t=toObject$8(e);if(hasOwn$5(t,IE_PROTO))return t[IE_PROTO];var r=t.constructor;return isCallable$5(r)&&t instanceof r?r.prototype:t instanceof $Object?ObjectPrototype$3:null},fails$f=fails$K,isCallable$4=isCallable$t,isObject$8=isObject$l,getPrototypeOf$3=objectGetPrototypeOf,defineBuiltIn$6=defineBuiltIn$i,wellKnownSymbol$7=wellKnownSymbol$t,ITERATOR$6=wellKnownSymbol$7("iterator"),BUGGY_SAFARI_ITERATORS$1=!1,IteratorPrototype$2,PrototypeOfArrayIteratorPrototype,arrayIterator;[].keys&&(arrayIterator=[].keys(),"next"in arrayIterator?(PrototypeOfArrayIteratorPrototype=getPrototypeOf$3(getPrototypeOf$3(arrayIterator)),PrototypeOfArrayIteratorPrototype!==Object.prototype&&(IteratorPrototype$2=PrototypeOfArrayIteratorPrototype)):BUGGY_SAFARI_ITERATORS$1=!0);var NEW_ITERATOR_PROTOTYPE=!isObject$8(IteratorPrototype$2)||fails$f((function(){var e={};return IteratorPrototype$2[ITERATOR$6].call(e)!==e}));NEW_ITERATOR_PROTOTYPE&&(IteratorPrototype$2={}),isCallable$4(IteratorPrototype$2[ITERATOR$6])||defineBuiltIn$6(IteratorPrototype$2,ITERATOR$6,(function(){return this}));var iteratorsCore={IteratorPrototype:IteratorPrototype$2,BUGGY_SAFARI_ITERATORS:BUGGY_SAFARI_ITERATORS$1},IteratorPrototype$1=iteratorsCore.IteratorPrototype,create$3=objectCreate,createPropertyDescriptor$2=createPropertyDescriptor$7,setToStringTag$4=setToStringTag$7,Iterators$2=iterators,returnThis$1=function(){return this},iteratorCreateConstructor=function(e,t,r,i){var n=t+" Iterator";return e.prototype=create$3(IteratorPrototype$1,{next:createPropertyDescriptor$2(+!i,r)}),setToStringTag$4(e,n,!1),Iterators$2[n]=returnThis$1,e},$$e=_export,call$7=functionCall,FunctionName$1=functionName,isCallable$3=isCallable$t,createIteratorConstructor$1=iteratorCreateConstructor,getPrototypeOf$2=objectGetPrototypeOf,setPrototypeOf$3=objectSetPrototypeOf,setToStringTag$3=setToStringTag$7,createNonEnumerableProperty$4=createNonEnumerableProperty$a,defineBuiltIn$5=defineBuiltIn$i,wellKnownSymbol$6=wellKnownSymbol$t,Iterators$1=iterators,IteratorsCore=iteratorsCore,PROPER_FUNCTION_NAME$1=FunctionName$1.PROPER,CONFIGURABLE_FUNCTION_NAME$1=FunctionName$1.CONFIGURABLE,IteratorPrototype=IteratorsCore.IteratorPrototype,BUGGY_SAFARI_ITERATORS=IteratorsCore.BUGGY_SAFARI_ITERATORS,ITERATOR$5=wellKnownSymbol$6("iterator"),KEYS="keys",VALUES="values",ENTRIES="entries",returnThis=function(){return this},iteratorDefine=function(e,t,r,i,n,o,a){createIteratorConstructor$1(r,t,i);var s,l,c,u=function(e){if(e===n&&g)return g;if(!BUGGY_SAFARI_ITERATORS&&e in p)return p[e];switch(e){case KEYS:case VALUES:case ENTRIES:return function(){return new r(this,e)}}return function(){return new r(this)}},h=t+" Iterator",d=!1,p=e.prototype,f=p[ITERATOR$5]||p["@@iterator"]||n&&p[n],g=!BUGGY_SAFARI_ITERATORS&&f||u(n),y="Array"==t&&p.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$3(s[ITERATOR$5])||defineBuiltIn$5(s,ITERATOR$5,returnThis)),setToStringTag$3(s,h,!0)),PROPER_FUNCTION_NAME$1&&n==VALUES&&f&&f.name!==VALUES&&(CONFIGURABLE_FUNCTION_NAME$1?createNonEnumerableProperty$4(p,"name",VALUES):(d=!0,g=function(){return call$7(f,this)})),n)if(l={values:u(VALUES),keys:o?g:u(KEYS),entries:u(ENTRIES)},a)for(c in l)(BUGGY_SAFARI_ITERATORS||d||!(c in p))&&defineBuiltIn$5(p,c,l[c]);else $$e({target:t,proto:!0,forced:BUGGY_SAFARI_ITERATORS||d},l);return p[ITERATOR$5]!==g&&defineBuiltIn$5(p,ITERATOR$5,g,{name:n}),Iterators$1[t]=g,l},createIterResultObject$2=function(e,t){return{value:e,done:t}},toIndexedObject$4=toIndexedObject$c,addToUnscopables$1=addToUnscopables$2,Iterators=iterators,InternalStateModule$6=internalState,defineProperty$4=objectDefineProperty.f,defineIterator$1=iteratorDefine,createIterResultObject$1=createIterResultObject$2,DESCRIPTORS$7=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$4(e),index:0,kind:t})}),(function(){var e=getInternalState$4(this),t=e.target,r=e.kind,i=e.index++;return!t||i>=t.length?(e.target=void 0,createIterResultObject$1(void 0,!0)):createIterResultObject$1("keys"==r?i:"values"==r?t[i]:[i,t[i]],!1)}),"values"),values=Iterators.Arguments=Iterators.Array;if(addToUnscopables$1("keys"),addToUnscopables$1("values"),addToUnscopables$1("entries"),DESCRIPTORS$7&&"values"!==values.name)try{defineProperty$4(values,"name",{value:"values"})}catch(error){}var charAt$3=stringMultibyte.charAt,toString$2=toString$f,InternalStateModule$5=internalState,defineIterator=iteratorDefine,createIterResultObject=createIterResultObject$2,STRING_ITERATOR="String Iterator",setInternalState$4=InternalStateModule$5.set,getInternalState$3=InternalStateModule$5.getterFor(STRING_ITERATOR);defineIterator(String,"String",(function(e){setInternalState$4(this,{type:STRING_ITERATOR,string:toString$2(e),index:0})}),(function(){var e,t=getInternalState$3(this),r=t.string,i=t.index;return i>=r.length?createIterResultObject(void 0,!0):(e=charAt$3(r,i),t.index+=e.length,createIterResultObject(e,!1))}));var global$g=global$H,DOMIterables=domIterables,DOMTokenListPrototype=domTokenListPrototype,ArrayIteratorMethods=es_array_iterator,createNonEnumerableProperty$3=createNonEnumerableProperty$a,wellKnownSymbol$5=wellKnownSymbol$t,ITERATOR$4=wellKnownSymbol$5("iterator"),TO_STRING_TAG$1=wellKnownSymbol$5("toStringTag"),ArrayValues=ArrayIteratorMethods.values,handlePrototype=function(e,t){if(e){if(e[ITERATOR$4]!==ArrayValues)try{createNonEnumerableProperty$3(e,ITERATOR$4,ArrayValues)}catch(error){e[ITERATOR$4]=ArrayValues}if(e[TO_STRING_TAG$1]||createNonEnumerableProperty$3(e,TO_STRING_TAG$1,t),DOMIterables[t])for(var r in ArrayIteratorMethods)if(e[r]!==ArrayIteratorMethods[r])try{createNonEnumerableProperty$3(e,r,ArrayIteratorMethods[r])}catch(error){e[r]=ArrayIteratorMethods[r]}}};for(var COLLECTION_NAME in DOMIterables)handlePrototype(global$g[COLLECTION_NAME]&&global$g[COLLECTION_NAME].prototype,COLLECTION_NAME);handlePrototype(DOMTokenListPrototype,"DOMTokenList");var fails$e=fails$K,wellKnownSymbol$4=wellKnownSymbol$t,IS_PURE=isPure,ITERATOR$3=wellKnownSymbol$4("iterator"),urlConstructorDetection=!fails$e((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,i){t.delete("b"),r+=i+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$3]||"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})),makeBuiltIn=makeBuiltIn$3.exports,defineProperty$3=objectDefineProperty,defineBuiltInAccessor$1=function(e,t,r){return r.get&&makeBuiltIn(r.get,t,{getter:!0}),r.set&&makeBuiltIn(r.set,t,{setter:!0}),defineProperty$3.f(e,t,r)},DESCRIPTORS$6=descriptors,uncurryThis$f=functionUncurryThis,call$6=functionCall,fails$d=fails$K,objectKeys$1=objectKeys$4,getOwnPropertySymbolsModule=objectGetOwnPropertySymbols,propertyIsEnumerableModule=objectPropertyIsEnumerable,toObject$7=toObject$g,IndexedObject$2=indexedObject,$assign=Object.assign,defineProperty$2=Object.defineProperty,concat$1=uncurryThis$f([].concat),objectAssign=!$assign||fails$d((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(),i="abcdefghijklmnopqrst";return e[r]=7,i.split("").forEach((function(e){t[e]=e})),7!=$assign({},e)[r]||objectKeys$1($assign({},t)).join("")!=i}))?function(e,t){for(var r=toObject$7(e),i=arguments.length,n=1,o=getOwnPropertySymbolsModule.f,a=propertyIsEnumerableModule.f;i>n;)for(var s,l=IndexedObject$2(arguments[n++]),c=o?concat$1(objectKeys$1(l),o(l)):objectKeys$1(l),u=c.length,h=0;u>h;)s=c[h++],DESCRIPTORS$6&&!call$6(a,l,s)||(r[s]=l[s]);return r}:$assign,anObject$2=anObject$k,iteratorClose=iteratorClose$2,callWithSafeIterationClosing$1=function(e,t,r,i){try{return i?t(anObject$2(r)[0],r[1]):t(r)}catch(error){iteratorClose(e,"throw",error)}},bind$6=functionBindContext,call$5=functionCall,toObject$6=toObject$g,callWithSafeIterationClosing=callWithSafeIterationClosing$1,isArrayIteratorMethod$1=isArrayIteratorMethod$3,isConstructor$1=isConstructor$4,lengthOfArrayLike$a=lengthOfArrayLike$h,createProperty$1=createProperty$5,getIterator$2=getIterator$4,getIteratorMethod$2=getIteratorMethod$5,$Array$2=Array,arrayFrom$1=function(e){var t=toObject$6(e),r=isConstructor$1(this),i=arguments.length,n=i>1?arguments[1]:void 0,o=void 0!==n;o&&(n=bind$6(n,i>2?arguments[2]:void 0));var a,s,l,c,u,h,d=getIteratorMethod$2(t),p=0;if(!d||this===$Array$2&&isArrayIteratorMethod$1(d))for(a=lengthOfArrayLike$a(t),s=r?new this(a):$Array$2(a);a>p;p++)h=o?n(t[p],p):t[p],createProperty$1(s,p,h);else for(u=(c=getIterator$2(t,d)).next,s=r?new this:[];!(l=call$5(u,c)).done;p++)h=o?callWithSafeIterationClosing(c,n,[l.value,p],!0):l.value,createProperty$1(s,p,h);return s.length=p,s},uncurryThis$e=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$3=RangeError,exec$1=uncurryThis$e(regexSeparators.exec),floor$5=Math.floor,fromCharCode=String.fromCharCode,charCodeAt=uncurryThis$e("".charCodeAt),join$4=uncurryThis$e([].join),push$4=uncurryThis$e([].push),replace$2=uncurryThis$e("".replace),split$2=uncurryThis$e("".split),toLowerCase$1=uncurryThis$e("".toLowerCase),ucs2decode=function(e){for(var t=[],r=0,i=e.length;r<i;){var n=charCodeAt(e,r++);if(n>=55296&&n<=56319&&r<i){var o=charCodeAt(e,r++);56320==(64512&o)?push$4(t,((1023&n)<<10)+(1023&o)+65536):(push$4(t,n),r--)}else push$4(t,n)}return t},digitToBasic=function(e){return e+22+75*(e<26)},adapt=function(e,t,r){var i=0;for(e=r?floor$5(e/damp):e>>1,e+=floor$5(e/t);e>baseMinusTMin*tMax>>1;)e=floor$5(e/baseMinusTMin),i+=base;return floor$5(i+(baseMinusTMin+1)*e/(e+skew))},encode$1=function(e){var t,r,i=[],n=(e=ucs2decode(e)).length,o=initialN,a=0,s=initialBias;for(t=0;t<e.length;t++)(r=e[t])<128&&push$4(i,fromCharCode(r));var l=i.length,c=l;for(l&&push$4(i,delimiter);c<n;){var u=maxInt;for(t=0;t<e.length;t++)(r=e[t])>=o&&r<u&&(u=r);var h=c+1;if(u-o>floor$5((maxInt-a)/h))throw $RangeError$3(OVERFLOW_ERROR);for(a+=(u-o)*h,o=u,t=0;t<e.length;t++){if((r=e[t])<o&&++a>maxInt)throw $RangeError$3(OVERFLOW_ERROR);if(r==o){for(var d=a,p=base;;){var f=p<=s?tMin:p>=s+tMax?tMax:p-s;if(d<f)break;var g=d-f,y=base-f;push$4(i,fromCharCode(digitToBasic(f+g%y))),d=floor$5(g/y),p+=base}push$4(i,fromCharCode(digitToBasic(d))),s=adapt(a,h,c==l),a=0,c++}}a++,o++}return join$4(i,"")},stringPunycodeToAscii=function(e){var t,r,i=[],n=split$2(replace$2(toLowerCase$1(e),regexSeparators,"."),".");for(t=0;t<n.length;t++)r=n[t],push$4(i,exec$1(regexNonASCII,r)?"xn--"+encode$1(r):r);return join$4(i,".")},defineBuiltIn$4=defineBuiltIn$i,defineBuiltIns$2=function(e,t,r){for(var i in t)defineBuiltIn$4(e,i,t[i],r);return e},arraySlice$6=arraySliceSimple,floor$4=Math.floor,mergeSort=function e(t,r){var i=t.length,n=floor$4(i/2);return i<8?insertionSort(t,r):merge(t,e(arraySlice$6(t,0,n),r),e(arraySlice$6(t,n),r),r)},insertionSort=function(e,t){for(var r,i,n=e.length,o=1;o<n;){for(i=o,r=e[o];i&&t(e[i-1],r)>0;)e[i]=e[--i];i!==o++&&(e[i]=r)}return e},merge=function(e,t,r,i){for(var n=t.length,o=r.length,a=0,s=0;a<n||s<o;)e[a+s]=a<n&&s<o?i(t[a],r[s])<=0?t[a++]:r[s++]:a<n?t[a++]:r[s++];return e},arraySort$1=mergeSort,$$d=_export,global$f=global$H,call$4=functionCall,uncurryThis$d=functionUncurryThis,DESCRIPTORS$5=descriptors,USE_NATIVE_URL$1=urlConstructorDetection,defineBuiltIn$3=defineBuiltIn$i,defineBuiltIns$1=defineBuiltIns$2,setToStringTag$2=setToStringTag$7,createIteratorConstructor=iteratorCreateConstructor,InternalStateModule$4=internalState,anInstance$3=anInstance$5,isCallable$2=isCallable$t,hasOwn$4=hasOwnProperty_1,bind$5=functionBindContext,classof$4=classof$d,anObject$1=anObject$k,isObject$7=isObject$l,$toString$1=toString$f,create$2=objectCreate,createPropertyDescriptor$1=createPropertyDescriptor$7,getIterator$1=getIterator$4,getIteratorMethod$1=getIteratorMethod$5,validateArgumentsLength$2=validateArgumentsLength$4,wellKnownSymbol$3=wellKnownSymbol$t,arraySort=arraySort$1,ITERATOR$2=wellKnownSymbol$3("iterator"),URL_SEARCH_PARAMS="URLSearchParams",URL_SEARCH_PARAMS_ITERATOR=URL_SEARCH_PARAMS+"Iterator",setInternalState$3=InternalStateModule$4.set,getInternalParamsState=InternalStateModule$4.getterFor(URL_SEARCH_PARAMS),getInternalIteratorState=InternalStateModule$4.getterFor(URL_SEARCH_PARAMS_ITERATOR),getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor,safeGetBuiltIn=function(e){if(!DESCRIPTORS$5)return global$f[e];var t=getOwnPropertyDescriptor(global$f,e);return t&&t.value},nativeFetch=safeGetBuiltIn("fetch"),NativeRequest=safeGetBuiltIn("Request"),Headers$1=safeGetBuiltIn("Headers"),RequestPrototype=NativeRequest&&NativeRequest.prototype,HeadersPrototype=Headers$1&&Headers$1.prototype,RegExp$1=global$f.RegExp,TypeError$3=global$f.TypeError,decodeURIComponent$1=global$f.decodeURIComponent,encodeURIComponent$1=global$f.encodeURIComponent,charAt$2=uncurryThis$d("".charAt),join$3=uncurryThis$d([].join),push$3=uncurryThis$d([].push),replace$1=uncurryThis$d("".replace),shift$1=uncurryThis$d([].shift),splice=uncurryThis$d([].splice),split$1=uncurryThis$d("".split),stringSlice$1=uncurryThis$d("".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$1(e)}catch(error){return e}},deserialize=function(e){var t=replace$1(e,plus," "),r=4;try{return decodeURIComponent$1(t)}catch(error){for(;r;)t=replace$1(t,percentSequence(r--),percentDecode);return t}},find=/[!'()~]|%20/g,replacements={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},replacer=function(e){return replacements[e]},_serialize=function(e){return replace$1(encodeURIComponent$1(e),find,replacer)},URLSearchParamsIterator=createIteratorConstructor((function(e,t){setInternalState$3(this,{type:URL_SEARCH_PARAMS_ITERATOR,iterator:getIterator$1(getInternalParamsState(e).entries),kind:t})}),"Iterator",(function(){var e=getInternalIteratorState(this),t=e.kind,r=e.iterator.next(),i=r.value;return r.done||(r.value="keys"===t?i.key:"values"===t?i.value:[i.key,i.value]),r}),!0),URLSearchParamsState=function(e){this.entries=[],this.url=null,void 0!==e&&(isObject$7(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===charAt$2(e,0)?stringSlice$1(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,i,n,o,a,s,l=getIteratorMethod$1(e);if(l)for(r=(t=getIterator$1(e,l)).next;!(i=call$4(r,t)).done;){if(o=(n=getIterator$1(anObject$1(i.value))).next,(a=call$4(o,n)).done||(s=call$4(o,n)).done||!call$4(o,n).done)throw TypeError$3("Expected sequence with length 2");push$3(this.entries,{key:$toString$1(a.value),value:$toString$1(s.value)})}else for(var c in e)hasOwn$4(e,c)&&push$3(this.entries,{key:c,value:$toString$1(e[c])})},parseQuery:function(e){if(e)for(var t,r,i=split$1(e,"&"),n=0;n<i.length;)(t=i[n++]).length&&(r=split$1(t,"="),push$3(this.entries,{key:deserialize(shift$1(r)),value:deserialize(join$3(r,"="))}))},serialize:function(){for(var e,t=this.entries,r=[],i=0;i<t.length;)e=t[i++],push$3(r,_serialize(e.key)+"="+_serialize(e.value));return join$3(r,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var URLSearchParamsConstructor=function(){anInstance$3(this,URLSearchParamsPrototype);var e=arguments.length>0?arguments[0]:void 0;setInternalState$3(this,new URLSearchParamsState(e))},URLSearchParamsPrototype=URLSearchParamsConstructor.prototype;if(defineBuiltIns$1(URLSearchParamsPrototype,{append:function(e,t){validateArgumentsLength$2(arguments.length,2);var r=getInternalParamsState(this);push$3(r.entries,{key:$toString$1(e),value:$toString$1(t)}),r.updateURL()},delete:function(e){validateArgumentsLength$2(arguments.length,1);for(var t=getInternalParamsState(this),r=t.entries,i=$toString$1(e),n=0;n<r.length;)r[n].key===i?splice(r,n,1):n++;t.updateURL()},get:function(e){validateArgumentsLength$2(arguments.length,1);for(var t=getInternalParamsState(this).entries,r=$toString$1(e),i=0;i<t.length;i++)if(t[i].key===r)return t[i].value;return null},getAll:function(e){validateArgumentsLength$2(arguments.length,1);for(var t=getInternalParamsState(this).entries,r=$toString$1(e),i=[],n=0;n<t.length;n++)t[n].key===r&&push$3(i,t[n].value);return i},has:function(e){validateArgumentsLength$2(arguments.length,1);for(var t=getInternalParamsState(this).entries,r=$toString$1(e),i=0;i<t.length;)if(t[i++].key===r)return!0;return!1},set:function(e,t){validateArgumentsLength$2(arguments.length,1);for(var r,i=getInternalParamsState(this),n=i.entries,o=!1,a=$toString$1(e),s=$toString$1(t),l=0;l<n.length;l++)(r=n[l]).key===a&&(o?splice(n,l--,1):(o=!0,r.value=s));o||push$3(n,{key:a,value:s}),i.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,i=bind$5(e,arguments.length>1?arguments[1]:void 0),n=0;n<r.length;)i((t=r[n++]).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$3(URLSearchParamsPrototype,ITERATOR$2,URLSearchParamsPrototype.entries,{name:"entries"}),defineBuiltIn$3(URLSearchParamsPrototype,"toString",(function(){return getInternalParamsState(this).serialize()}),{enumerable:!0}),setToStringTag$2(URLSearchParamsConstructor,URL_SEARCH_PARAMS),$$d({global:!0,constructor:!0,forced:!USE_NATIVE_URL$1},{URLSearchParams:URLSearchParamsConstructor}),!USE_NATIVE_URL$1&&isCallable$2(Headers$1)){var headersHas=uncurryThis$d(HeadersPrototype.has),headersSet=uncurryThis$d(HeadersPrototype.set),wrapRequestOptions=function(e){if(isObject$7(e)){var t,r=e.body;if(classof$4(r)===URL_SEARCH_PARAMS)return t=e.headers?new Headers$1(e.headers):new Headers$1,headersHas(t,"content-type")||headersSet(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),create$2(e,{body:createPropertyDescriptor$1(0,$toString$1(r)),headers:createPropertyDescriptor$1(0,t)})}return e};if(isCallable$2(nativeFetch)&&$$d({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return nativeFetch(e,arguments.length>1?wrapRequestOptions(arguments[1]):{})}}),isCallable$2(NativeRequest)){var RequestConstructor=function(e){return anInstance$3(this,RequestPrototype),new NativeRequest(e,arguments.length>1?wrapRequestOptions(arguments[1]):{})};RequestPrototype.constructor=RequestConstructor,RequestConstructor.prototype=RequestPrototype,$$d({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:RequestConstructor})}}var web_urlSearchParams_constructor={URLSearchParams:URLSearchParamsConstructor,getState:getInternalParamsState},$$c=_export,DESCRIPTORS$4=descriptors,USE_NATIVE_URL=urlConstructorDetection,global$e=global$H,bind$4=functionBindContext,uncurryThis$c=functionUncurryThis,defineBuiltIn$2=defineBuiltIn$i,defineBuiltInAccessor=defineBuiltInAccessor$1,anInstance$2=anInstance$5,hasOwn$3=hasOwnProperty_1,assign$3=objectAssign,arrayFrom=arrayFrom$1,arraySlice$5=arraySliceSimple,codeAt=stringMultibyte.codeAt,toASCII=stringPunycodeToAscii,$toString=toString$f,setToStringTag$1=setToStringTag$7,validateArgumentsLength$1=validateArgumentsLength$4,URLSearchParamsModule=web_urlSearchParams_constructor,InternalStateModule$3=internalState,setInternalState$2=InternalStateModule$3.set,getInternalURLState=InternalStateModule$3.getterFor("URL"),URLSearchParams$1=URLSearchParamsModule.URLSearchParams,getInternalSearchParamsState=URLSearchParamsModule.getState,NativeURL=global$e.URL,TypeError$2=global$e.TypeError,parseInt$1=global$e.parseInt,floor$3=Math.floor,pow$1=Math.pow,charAt$1=uncurryThis$c("".charAt),exec=uncurryThis$c(/./.exec),join$2=uncurryThis$c([].join),numberToString=uncurryThis$c(1..toString),pop=uncurryThis$c([].pop),push$2=uncurryThis$c([].push),replace=uncurryThis$c("".replace),shift=uncurryThis$c([].shift),split=uncurryThis$c("".split),stringSlice=uncurryThis$c("".slice),toLowerCase=uncurryThis$c("".toLowerCase),unshift=uncurryThis$c([].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,EOF,parseIPv4=function(e){var t,r,i,n,o,a,s,l=split(e,".");if(l.length&&""==l[l.length-1]&&l.length--,(t=l.length)>4)return e;for(r=[],i=0;i<t;i++){if(""==(n=l[i]))return e;if(o=10,n.length>1&&"0"==charAt$1(n,0)&&(o=exec(HEX_START,n)?16:8,n=stringSlice(n,8==o?1:2)),""===n)a=0;else{if(!exec(10==o?DEC:8==o?OCT:HEX,n))return e;a=parseInt$1(n,o)}push$2(r,a)}for(i=0;i<t;i++)if(a=r[i],i==t-1){if(a>=pow$1(256,5-t))return null}else if(a>255)return null;for(s=pop(r),i=0;i<r.length;i++)s+=r[i]*pow$1(256,3-i);return s},parseIPv6=function(e){var t,r,i,n,o,a,s,l=[0,0,0,0,0,0,0,0],c=0,u=null,h=0,d=function(){return charAt$1(e,h)};if(":"==d()){if(":"!=charAt$1(e,1))return;h+=2,u=++c}for(;d();){if(8==c)return;if(":"!=d()){for(t=r=0;r<4&&exec(HEX,d());)t=16*t+parseInt$1(d(),16),h++,r++;if("."==d()){if(0==r)return;if(h-=r,c>6)return;for(i=0;d();){if(n=null,i>0){if(!("."==d()&&i<4))return;h++}if(!exec(DIGIT,d()))return;for(;exec(DIGIT,d());){if(o=parseInt$1(d(),10),null===n)n=o;else{if(0==n)return;n=10*n+o}if(n>255)return;h++}l[c]=256*l[c]+n,2!=++i&&4!=i||c++}if(4!=i)return;break}if(":"==d()){if(h++,!d())return}else if(d())return;l[c++]=t}else{if(null!==u)return;h++,u=++c}}if(null!==u)for(a=c-u,c=7;0!=c&&a>0;)s=l[c],l[c--]=l[u+a-1],l[u+--a]=s;else if(8!=c)return;return l},findLongestZeroSequence=function(e){for(var t=null,r=1,i=null,n=0,o=0;o<8;o++)0!==e[o]?(n>r&&(t=i,r=n),i=null,n=0):(null===i&&(i=o),++n);return n>r&&(t=i,r=n),t},serializeHost=function(e){var t,r,i,n;if("number"==typeof e){for(t=[],r=0;r<4;r++)unshift(t,e%256),e=floor$3(e/256);return join$2(t,".")}if("object"==_typeof$4(e)){for(t="",i=findLongestZeroSequence(e),r=0;r<8;r++)n&&0===e[r]||(n&&(n=!1),i===r?(t+=r?":":"::",n=!0):(t+=numberToString(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},C0ControlPercentEncodeSet={},fragmentPercentEncodeSet=assign$3({},C0ControlPercentEncodeSet,{" ":1,'"':1,"<":1,">":1,"`":1}),pathPercentEncodeSet=assign$3({},fragmentPercentEncodeSet,{"#":1,"?":1,"{":1,"}":1}),userinfoPercentEncodeSet=assign$3({},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&&!hasOwn$3(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$1(e,0))&&(":"==(r=charAt$1(e,1))||!t&&"|"==r)},startsWithWindowsDriveLetter=function(e){var t;return e.length>1&&isWindowsDriveLetter(stringSlice(e,0,2))&&(2==e.length||"/"===(t=charAt$1(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,i){var n,o,a,s=$toString(t);if(r){if(o=this.parse(s))throw TypeError$2(o);this.searchParams=null}else{if(void 0!==i&&(n=new e(i,!0)),o=this.parse(s,null,n))throw TypeError$2(o);(a=getInternalSearchParamsState(new URLSearchParams$1)).bindURL(this),this.searchParams=a}};URLState.prototype={type:"URL",parse:function(e,t,r){var i,n,o,a,s=this,l=t||SCHEME_START,c=0,u="",h=!1,d=!1,p=!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,""),i=arrayFrom(e);c<=i.length;){switch(n=i[c],l){case SCHEME_START:if(!n||!exec(ALPHA,n)){if(t)return INVALID_SCHEME;l=NO_SCHEME;continue}u+=toLowerCase(n),l=SCHEME;break;case SCHEME:if(n&&(exec(ALPHANUMERIC,n)||"+"==n||"-"==n||"."==n))u+=toLowerCase(n);else{if(":"!=n){if(t)return INVALID_SCHEME;u="",l=NO_SCHEME,c=0;continue}if(t&&(s.isSpecial()!=hasOwn$3(specialSchemes,u)||"file"==u&&(s.includesCredentials()||null!==s.port)||"file"==s.scheme&&!s.host))return;if(s.scheme=u,t)return void(s.isSpecial()&&specialSchemes[s.scheme]==s.port&&(s.port=null));u="","file"==s.scheme?l=FILE:s.isSpecial()&&r&&r.scheme==s.scheme?l=SPECIAL_RELATIVE_OR_AUTHORITY:s.isSpecial()?l=SPECIAL_AUTHORITY_SLASHES:"/"==i[c+1]?(l=PATH_OR_AUTHORITY,c++):(s.cannotBeABaseURL=!0,push$2(s.path,""),l=CANNOT_BE_A_BASE_URL_PATH)}break;case NO_SCHEME:if(!r||r.cannotBeABaseURL&&"#"!=n)return INVALID_SCHEME;if(r.cannotBeABaseURL&&"#"==n){s.scheme=r.scheme,s.path=arraySlice$5(r.path),s.query=r.query,s.fragment="",s.cannotBeABaseURL=!0,l=FRAGMENT;break}l="file"==r.scheme?FILE:RELATIVE;continue;case SPECIAL_RELATIVE_OR_AUTHORITY:if("/"!=n||"/"!=i[c+1]){l=RELATIVE;continue}l=SPECIAL_AUTHORITY_IGNORE_SLASHES,c++;break;case PATH_OR_AUTHORITY:if("/"==n){l=AUTHORITY;break}l=PATH;continue;case RELATIVE:if(s.scheme=r.scheme,n==EOF)s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,s.path=arraySlice$5(r.path),s.query=r.query;else if("/"==n||"\\"==n&&s.isSpecial())l=RELATIVE_SLASH;else if("?"==n)s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,s.path=arraySlice$5(r.path),s.query="",l=QUERY;else{if("#"!=n){s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,s.path=arraySlice$5(r.path),s.path.length--,l=PATH;continue}s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,s.path=arraySlice$5(r.path),s.query=r.query,s.fragment="",l=FRAGMENT}break;case RELATIVE_SLASH:if(!s.isSpecial()||"/"!=n&&"\\"!=n){if("/"!=n){s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,l=PATH;continue}l=AUTHORITY}else l=SPECIAL_AUTHORITY_IGNORE_SLASHES;break;case SPECIAL_AUTHORITY_SLASHES:if(l=SPECIAL_AUTHORITY_IGNORE_SLASHES,"/"!=n||"/"!=charAt$1(u,c+1))continue;c++;break;case SPECIAL_AUTHORITY_IGNORE_SLASHES:if("/"!=n&&"\\"!=n){l=AUTHORITY;continue}break;case AUTHORITY:if("@"==n){h&&(u="%40"+u),h=!0,o=arrayFrom(u);for(var f=0;f<o.length;f++){var g=o[f];if(":"!=g||p){var y=percentEncode(g,userinfoPercentEncodeSet);p?s.password+=y:s.username+=y}else p=!0}u=""}else if(n==EOF||"/"==n||"?"==n||"#"==n||"\\"==n&&s.isSpecial()){if(h&&""==u)return INVALID_AUTHORITY;c-=arrayFrom(u).length+1,u="",l=HOST}else u+=n;break;case HOST:case HOSTNAME:if(t&&"file"==s.scheme){l=FILE_HOST;continue}if(":"!=n||d){if(n==EOF||"/"==n||"?"==n||"#"==n||"\\"==n&&s.isSpecial()){if(s.isSpecial()&&""==u)return INVALID_HOST;if(t&&""==u&&(s.includesCredentials()||null!==s.port))return;if(a=s.parseHost(u))return a;if(u="",l=PATH_START,t)return;continue}"["==n?d=!0:"]"==n&&(d=!1),u+=n}else{if(""==u)return INVALID_HOST;if(a=s.parseHost(u))return a;if(u="",l=PORT,t==HOSTNAME)return}break;case PORT:if(!exec(DIGIT,n)){if(n==EOF||"/"==n||"?"==n||"#"==n||"\\"==n&&s.isSpecial()||t){if(""!=u){var v=parseInt$1(u,10);if(v>65535)return INVALID_PORT;s.port=s.isSpecial()&&v===specialSchemes[s.scheme]?null:v,u=""}if(t)return;l=PATH_START;continue}return INVALID_PORT}u+=n;break;case FILE:if(s.scheme="file","/"==n||"\\"==n)l=FILE_SLASH;else{if(!r||"file"!=r.scheme){l=PATH;continue}if(n==EOF)s.host=r.host,s.path=arraySlice$5(r.path),s.query=r.query;else if("?"==n)s.host=r.host,s.path=arraySlice$5(r.path),s.query="",l=QUERY;else{if("#"!=n){startsWithWindowsDriveLetter(join$2(arraySlice$5(i,c),""))||(s.host=r.host,s.path=arraySlice$5(r.path),s.shortenPath()),l=PATH;continue}s.host=r.host,s.path=arraySlice$5(r.path),s.query=r.query,s.fragment="",l=FRAGMENT}}break;case FILE_SLASH:if("/"==n||"\\"==n){l=FILE_HOST;break}r&&"file"==r.scheme&&!startsWithWindowsDriveLetter(join$2(arraySlice$5(i,c),""))&&(isWindowsDriveLetter(r.path[0],!0)?push$2(s.path,r.path[0]):s.host=r.host),l=PATH;continue;case FILE_HOST:if(n==EOF||"/"==n||"\\"==n||"?"==n||"#"==n){if(!t&&isWindowsDriveLetter(u))l=PATH;else if(""==u){if(s.host="",t)return;l=PATH_START}else{if(a=s.parseHost(u))return a;if("localhost"==s.host&&(s.host=""),t)return;u="",l=PATH_START}continue}u+=n;break;case PATH_START:if(s.isSpecial()){if(l=PATH,"/"!=n&&"\\"!=n)continue}else if(t||"?"!=n)if(t||"#"!=n){if(n!=EOF&&(l=PATH,"/"!=n))continue}else s.fragment="",l=FRAGMENT;else s.query="",l=QUERY;break;case PATH:if(n==EOF||"/"==n||"\\"==n&&s.isSpecial()||!t&&("?"==n||"#"==n)){if(isDoubleDot(u)?(s.shortenPath(),"/"==n||"\\"==n&&s.isSpecial()||push$2(s.path,"")):isSingleDot(u)?"/"==n||"\\"==n&&s.isSpecial()||push$2(s.path,""):("file"==s.scheme&&!s.path.length&&isWindowsDriveLetter(u)&&(s.host&&(s.host=""),u=charAt$1(u,0)+":"),push$2(s.path,u)),u="","file"==s.scheme&&(n==EOF||"?"==n||"#"==n))for(;s.path.length>1&&""===s.path[0];)shift(s.path);"?"==n?(s.query="",l=QUERY):"#"==n&&(s.fragment="",l=FRAGMENT)}else u+=percentEncode(n,pathPercentEncodeSet);break;case CANNOT_BE_A_BASE_URL_PATH:"?"==n?(s.query="",l=QUERY):"#"==n?(s.fragment="",l=FRAGMENT):n!=EOF&&(s.path[0]+=percentEncode(n,C0ControlPercentEncodeSet));break;case QUERY:t||"#"!=n?n!=EOF&&("'"==n&&s.isSpecial()?s.query+="%27":s.query+="#"==n?"%23":percentEncode(n,C0ControlPercentEncodeSet)):(s.fragment="",l=FRAGMENT);break;case FRAGMENT:n!=EOF&&(s.fragment+=percentEncode(n,fragmentPercentEncodeSet))}c++}},parseHost:function(e){var t,r,i;if("["==charAt$1(e,0)){if("]"!=charAt$1(e,e.length-1))return INVALID_HOST;if(!(t=parseIPv6(stringSlice(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),i=0;i<r.length;i++)t+=percentEncode(r[i],C0ControlPercentEncodeSet);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return hasOwn$3(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,i=e.password,n=e.host,o=e.port,a=e.path,s=e.query,l=e.fragment,c=t+":";return null!==n?(c+="//",e.includesCredentials()&&(c+=r+(i?":"+i:"")+"@"),c+=serializeHost(n),null!==o&&(c+=":"+o)):"file"==t&&(c+="//"),c+=e.cannotBeABaseURL?a[0]:a.length?"/"+join$2(a,"/"):"",null!==s&&(c+="?"+s),null!==l&&(c+="#"+l),c},setHref:function(e){var t=this.parse(e);if(t)throw TypeError$2(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(error){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?"/"+join$2(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$1(e,0)&&(e=stringSlice(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$1(e,0)&&(e=stringSlice(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$2(this,URLPrototype),r=validateArgumentsLength$1(arguments.length,1)>1?arguments[1]:void 0,i=setInternalState$2(t,new URLState(e,!1,r));DESCRIPTORS$4||(t.href=i.serialize(),t.origin=i.getOrigin(),t.protocol=i.getProtocol(),t.username=i.getUsername(),t.password=i.getPassword(),t.host=i.getHost(),t.hostname=i.getHostname(),t.port=i.getPort(),t.pathname=i.getPathname(),t.search=i.getSearch(),t.searchParams=i.getSearchParams(),t.hash=i.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$4&&(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$2(URLPrototype,"toJSON",(function(){return getInternalURLState(this).serialize()}),{enumerable:!0}),defineBuiltIn$2(URLPrototype,"toString",(function(){return getInternalURLState(this).serialize()}),{enumerable:!0}),NativeURL){var nativeCreateObjectURL=NativeURL.createObjectURL,nativeRevokeObjectURL=NativeURL.revokeObjectURL;nativeCreateObjectURL&&defineBuiltIn$2(URLConstructor,"createObjectURL",bind$4(nativeCreateObjectURL,NativeURL)),nativeRevokeObjectURL&&defineBuiltIn$2(URLConstructor,"revokeObjectURL",bind$4(nativeRevokeObjectURL,NativeURL))}function ownKeys$1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function _objectSpread2$1(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$1(Object(r),!0).forEach((function(t){_defineProperty$2(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys$1(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _regeneratorRuntime(){_regeneratorRuntime=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",s=n.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(O){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var o=t&&t.prototype instanceof d?t:d,a=Object.create(o.prototype),s=new C(n||[]);return i(a,"_invoke",{value:T(e,r,s)}),a}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(O){return{type:"throw",arg:O}}}e.wrap=c;var h={};function d(){}function p(){}function f(){}var g={};l(g,o,(function(){return this}));var y=Object.getPrototypeOf,v=y&&y(y(P([])));v&&v!==t&&r.call(v,o)&&(g=v);var m=f.prototype=d.prototype=Object.create(g);function _(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function n(i,o,a,s){var l=u(e[i],e,o);if("throw"!==l.type){var c=l.arg,h=c.value;return h&&"object"==_typeof$4(h)&&r.call(h,"__await")?t.resolve(h.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(h).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,s)}))}s(l.arg)}var o;i(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return o=o?o.then(i,i):i()}})}function T(e,t,r){var i="suspendedStart";return function(n,o){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===n)throw o;return{value:void 0,done:!0}}for(r.method=n,r.arg=o;;){var a=r.delegate;if(a){var s=S(a,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===i)throw i="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i="executing";var l=u(e,t,r);if("normal"===l.type){if(i=r.done?"completed":"suspendedYield",l.arg===h)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i="completed",r.method="throw",r.arg=l.arg)}}}function S(e,t){var r=t.method,i=e.iterator[r];if(void 0===i)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var n=u(i,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,h;var o=n.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function E(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 $(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function P(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 i=-1,n=function t(){for(;++i<e.length;)if(r.call(e,i))return t.value=e[i],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:w}}function w(){return{value:void 0,done:!0}}return p.prototype=f,i(m,"constructor",{value:f,configurable:!0}),i(f,"constructor",{value:p,configurable:!0}),p.displayName=l(f,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,l(e,s,"GeneratorFunction")),e.prototype=Object.create(m),e},e.awrap=function(e){return{__await:e}},_(b.prototype),l(b.prototype,a,(function(){return this})),e.AsyncIterator=b,e.async=function(t,r,i,n,o){void 0===o&&(o=Promise);var a=new b(c(t,r,i,n),o);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},_(m),l(m,s,"Generator"),l(m,o,(function(){return this})),l(m,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var i in t)r.push(i);return r.reverse(),function e(){for(;r.length;){var i=r.pop();if(i in t)return e.value=i,e.done=!1,e}return e.done=!0,e}},e.values=P,C.prototype={constructor:C,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($),!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 i(r,i){return a.type="throw",a.arg=e,t.next=r,i&&(t.method="next",t.arg=void 0),!!i}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],a=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(s&&l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&r.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;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,h):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),h},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),$(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var i=r.completion;if("throw"===i.type){var n=i.arg;$(r)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:P(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}function _typeof$1(e){return(_typeof$1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function asyncGeneratorStep(e,t,r,i,n,o,a){try{var s=e[o](a),l=s.value}catch(error){return void r(error)}s.done?t(l):Promise.resolve(l).then(i,n)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(i,n){var o=e.apply(t,r);function a(e){asyncGeneratorStep(o,i,n,a,s,"next",e)}function s(e){asyncGeneratorStep(o,i,n,a,s,"throw",e)}a(void 0)}))}}function _classCallCheck$1(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 i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,_toPropertyKey(i.key),i)}}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=_toPropertyKey(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(e2){return!1}}function _construct(e,t,r){return(_construct=_isNativeReflectConstruct$1()?Reflect.construct.bind():function(e,t,r){var i=[null];i.push.apply(i,t);var n=new(Function.bind.apply(e,i));return r&&_setPrototypeOf$1(n,r.prototype),n}).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$1(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf$1(r,e)},_wrapNativeSuper(e)}function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var r,i,n={},o=Object.keys(e);for(i=0;i<o.length;i++)r=o[i],t.indexOf(r)>=0||(n[r]=e[r]);return n}function _objectWithoutProperties(e,t){if(null==e)return{};var r,i,n=_objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}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$4(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,i=_getPrototypeOf$1(e);if(t){var n=_getPrototypeOf$1(this).constructor;r=Reflect.construct(i,arguments,n)}else r=i.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 i=_superPropBase(e,t);if(i){var n=Object.getOwnPropertyDescriptor(i,t);return n.get?n.get.call(arguments.length<3?e:r):n.value}},_get.apply(this,arguments)}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,i=new Array(t);r<t;r++)i[r]=e[r];return i}function _createForOfIteratorHelper(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var i=0,n=function(){};return{s:n,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function _toPrimitive(e,t){if("object"!==_typeof$4(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!==_typeof$4(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof$4(t)?t:String(t)}setToStringTag$1(URLConstructor,"URL"),$$c({global:!0,constructor:!0,forced:!USE_NATIVE_URL,sham:!DESCRIPTORS$4},{URL:URLConstructor});var $$b=_export,assign$2=objectAssign;$$b({target:"Object",stat:!0,arity:2,forced:Object.assign!==assign$2},{assign:assign$2});var $$a=_export,isArray=isArray$5,isConstructor=isConstructor$4,isObject$6=isObject$l,toAbsoluteIndex$3=toAbsoluteIndex$7,lengthOfArrayLike$9=lengthOfArrayLike$h,toIndexedObject$3=toIndexedObject$c,createProperty=createProperty$5,wellKnownSymbol$2=wellKnownSymbol$t,arrayMethodHasSpeciesSupport=arrayMethodHasSpeciesSupport$5,nativeSlice=arraySlice$b,HAS_SPECIES_SUPPORT=arrayMethodHasSpeciesSupport("slice"),SPECIES=wellKnownSymbol$2("species"),$Array$1=Array,max=Math.max,_ERR_CODE;function createPublicPromise(){var e,t,r=new Promise((function(r,i){e=r,t=i}));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}$$a({target:"Array",proto:!0,forced:!HAS_SPECIES_SUPPORT},{slice:function(e,t){var r,i,n,o=toIndexedObject$3(this),a=lengthOfArrayLike$9(o),s=toAbsoluteIndex$3(e,a),l=toAbsoluteIndex$3(void 0===t?a:t,a);if(isArray(o)&&(r=o.constructor,(isConstructor(r)&&(r===$Array$1||isArray(r.prototype))||isObject$6(r)&&null===(r=r[SPECIES]))&&(r=void 0),r===$Array$1||void 0===r))return nativeSlice(o,s,l);for(i=new(void 0===r?$Array$1:r)(max(l-s,0)),n=0;s<l;s++,n++)s in o&&createProperty(i,n,o[s]);return i.length=n,i}});var 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=(_ERR_CODE={},_defineProperty$2(_ERR_CODE,ERR.MANIFEST,{HLS:1100}),_defineProperty$2(_ERR_CODE,ERR.NETWORK,2100),_defineProperty$2(_ERR_CODE,ERR.NETWORK_TIMEOUT,2101),_defineProperty$2(_ERR_CODE,ERR.DEMUX,{FLV:3100,HLS:3200,MP4:3300,FMP4:3400}),_defineProperty$2(_ERR_CODE,ERR.REMUX,{FMP4:4100,MP4:4200}),_defineProperty$2(_ERR_CODE,ERR.MEDIA,{MSE_ADD_SB:5200,MSE_APPEND_BUFFER:5201,MSE_OTHER:5202,MSE_FULL:5203}),_defineProperty$2(_ERR_CODE,ERR.OTHER,8e3),_ERR_CODE),StreamingError=function(e){_inherits$1(r,e);var t=_createSuper$1(r);function r(e,i,n,o,a){var s;return _classCallCheck$1(this,r),(s=t.call(this,a||(null==n?void 0:n.message))).errorType=e===ERR.NETWORK_TIMEOUT?ERR.NETWORK:e,s.originError=n,s.ext=o,s.errorCode=ERR_CODE[e][i]||ERR_CODE[e],s.errorMessage=s.message,s.errorCode||(s.errorType=ERR.OTHER,s.errorCode=ERR_CODE[s.errorType]),s}return _createClass$2(r,null,[{key:"create",value:function(e,t,i,n,o){return e instanceof r?e:(e instanceof Error&&(i=e,e=""),e||(e=ERR.OTHER),new r(e,t,i,n,o))}},{key:"network",value:function(e){var t;return new r(null!=e&&e.isTimeout?ERR.NETWORK_TIMEOUT:ERR.NETWORK,null,e instanceof Error?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}(_wrapNativeSuper(Error)),$$9=_export,$includes$1=arrayIncludes.includes,fails$c=fails$K,addToUnscopables=addToUnscopables$2,BROKEN_ON_SPARSE=fails$c((function(){return!Array(1).includes()}));$$9({target:"Array",proto:!0,forced:BROKEN_ON_SPARSE},{includes:function(e){return $includes$1(this,e,arguments.length>1?arguments[1]:void 0)}}),addToUnscopables("includes");var LogCacheLevel={DEBUG:1,LOG:2,WARN:3,ERROR:4},LOG_MAX_SIZE=204800,SIMPLE_TYPE=["Boolean","Number","String","Undefined","Null","Date","Object"],Logger=function(){function e(t,r){_classCallCheck$1(this,e),this.name=t||"",this._prefix="[".concat(this.name,"]"),e.disabled=(null==r?void 0:r.disabled)||!0,this.logCacheLevel=(null==r?void 0:r.logCacheLevel)||3,this.logMaxSize=(null==r?void 0:r.logMaxSize)||LOG_MAX_SIZE,this.logSize=0,this.logTextArray=[]}return _createClass$2(e,[{key:"debug",value:function(){for(var t,r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];this.logCache.apply(this,[LogCacheLevel.DEBUG].concat(i)),e.disabled||(t=console).debug.apply(t,[this._prefix,nowTime()].concat(i))}},{key:"log",value:function(){for(var t,r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];this.logCache.apply(this,[LogCacheLevel.LOG].concat(i)),e.disabled||(t=console).log.apply(t,[this._prefix,nowTime()].concat(i))}},{key:"warn",value:function(){for(var t,r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];this.logCache.apply(this,[LogCacheLevel.WARN].concat(i)),e.disabled||(t=console).warn.apply(t,[this._prefix,nowTime()].concat(i))}},{key:"error",value:function(){for(var t,r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];this.logCache.apply(this,[LogCacheLevel.ERROR].concat(i)),e.disabled||(t=console).error.apply(t,[this._prefix,nowTime()].concat(i))}},{key:"logCache",value:function(e){if(!(e<this.logCacheLevel)){var t="";try{for(var r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];var o=i.map((function(e){return logable(e)}));t=this._prefix+nowTime()+JSON.stringify(o)}catch(e2){return}if(e>=this.logCacheLevel&&(this.logSize+=t.length,this.logTextArray.push(t)),this.logSize>this.logMaxSize){var a=this.logTextArray.shift();this.logSize-=a.length}}}},{key:"getLogCache",value:function(){var e=this.logTextArray.join("\n");return this.reset(),e}},{key:"reset",value:function(){this.logTextArray=[],this.logSize=0}},{key:"table",value:function(){var t;e.disabled||(console.group(this._prefix),(t=console).table.apply(t,arguments),console.groupEnd())}},{key:"setLogLevel",value:function(e){this.logCacheLevel=e}}],[{key:"enable",value:function(){e.disabled=!1}},{key:"disable",value:function(){e.disabled=!0}}]),e}();function nowTime(){return(new Date).toLocaleString()}function reduceDepth(e){if("object"!==_typeof$1(e))return e;var t=Object.prototype.toString.call(e).slice(8,-1);switch(t){case"Array":case"Uint8Array":case"ArrayBuffer":return t+"["+e.length+"]";case"Object":return"{}";default:return t}}function logable(e,t,r){r||(r=1),t||(t=2);var i={};if(!e||"object"!==_typeof$1(e))return e;var n=Object.prototype.toString.call(e).slice(8,-1);if(!SIMPLE_TYPE.includes(n))return n;if(!(r>t)){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r===t?i[o]=reduceDepth(e[o]):"object"===_typeof$1(e[o])?i[o]=logable(e[o],t,r+1):i[o]=e[o]);return i}}_defineProperty$2(Logger,"disabled",!0);var typedArrayConstructor={exports:{}},arrayBufferBasicDetection="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,NATIVE_ARRAY_BUFFER$1=arrayBufferBasicDetection,DESCRIPTORS$3=descriptors,global$d=global$H,isCallable$1=isCallable$t,isObject$5=isObject$l,hasOwn$2=hasOwnProperty_1,classof$3=classof$d,tryToString=tryToString$7,createNonEnumerableProperty$2=createNonEnumerableProperty$a,defineBuiltIn$1=defineBuiltIn$i,defineProperty$1=objectDefineProperty.f,isPrototypeOf$1=objectIsPrototypeOf,getPrototypeOf$1=objectGetPrototypeOf,setPrototypeOf$2=objectSetPrototypeOf,wellKnownSymbol$1=wellKnownSymbol$t,uid=uid$4,InternalStateModule$2=internalState,enforceInternalState$1=InternalStateModule$2.enforce,getInternalState$2=InternalStateModule$2.get,Int8Array$4=global$d.Int8Array,Int8ArrayPrototype$1=Int8Array$4&&Int8Array$4.prototype,Uint8ClampedArray$1=global$d.Uint8ClampedArray,Uint8ClampedArrayPrototype=Uint8ClampedArray$1&&Uint8ClampedArray$1.prototype,TypedArray$1=Int8Array$4&&getPrototypeOf$1(Int8Array$4),TypedArrayPrototype$2=Int8ArrayPrototype$1&&getPrototypeOf$1(Int8ArrayPrototype$1),ObjectPrototype$2=Object.prototype,TypeError$1=global$d.TypeError,TO_STRING_TAG=wellKnownSymbol$1("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$3(global$d.opera),TYPED_ARRAY_TAG_REQUIRED=!1,NAME,Constructor,Prototype,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$5(e))return!1;var t=classof$3(e);return"DataView"===t||hasOwn$2(TypedArrayConstructorsList,t)||hasOwn$2(BigIntArrayConstructorsList,t)},getTypedArrayConstructor$1=function e(t){var r=getPrototypeOf$1(t);if(isObject$5(r)){var i=getInternalState$2(r);return i&&hasOwn$2(i,TYPED_ARRAY_CONSTRUCTOR)?i[TYPED_ARRAY_CONSTRUCTOR]:e(r)}},isTypedArray$1=function(e){if(!isObject$5(e))return!1;var t=classof$3(e);return hasOwn$2(TypedArrayConstructorsList,t)||hasOwn$2(BigIntArrayConstructorsList,t)},aTypedArray$p=function(e){if(isTypedArray$1(e))return e;throw TypeError$1("Target is not a typed array")},aTypedArrayConstructor$3=function(e){if(isCallable$1(e)&&(!setPrototypeOf$2||isPrototypeOf$1(TypedArray$1,e)))return e;throw TypeError$1(tryToString(e)+" is not a typed array constructor")},exportTypedArrayMethod$q=function(e,t,r,i){if(DESCRIPTORS$3){if(r)for(var n in TypedArrayConstructorsList){var o=global$d[n];if(o&&hasOwn$2(o.prototype,e))try{delete o.prototype[e]}catch(error){try{o.prototype[e]=t}catch(a){}}}TypedArrayPrototype$2[e]&&!r||defineBuiltIn$1(TypedArrayPrototype$2,e,r?t:NATIVE_ARRAY_BUFFER_VIEWS$2&&Int8ArrayPrototype$1[e]||t,i)}},exportTypedArrayStaticMethod=function(e,t,r){var i,n;if(DESCRIPTORS$3){if(setPrototypeOf$2){if(r)for(i in TypedArrayConstructorsList)if((n=global$d[i])&&hasOwn$2(n,e))try{delete n[e]}catch(error){}if(TypedArray$1[e]&&!r)return;try{return defineBuiltIn$1(TypedArray$1,e,r?t:NATIVE_ARRAY_BUFFER_VIEWS$2&&TypedArray$1[e]||t)}catch(error){}}for(i in TypedArrayConstructorsList)!(n=global$d[i])||n[e]&&!r||defineBuiltIn$1(n,e,t)}};for(NAME in TypedArrayConstructorsList)Constructor=global$d[NAME],Prototype=Constructor&&Constructor.prototype,Prototype?enforceInternalState$1(Prototype)[TYPED_ARRAY_CONSTRUCTOR]=Constructor:NATIVE_ARRAY_BUFFER_VIEWS$2=!1;for(NAME in BigIntArrayConstructorsList)Constructor=global$d[NAME],Prototype=Constructor&&Constructor.prototype,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$1("Incorrect invocation")},NATIVE_ARRAY_BUFFER_VIEWS$2))for(NAME in TypedArrayConstructorsList)global$d[NAME]&&setPrototypeOf$2(global$d[NAME],TypedArray$1);if((!NATIVE_ARRAY_BUFFER_VIEWS$2||!TypedArrayPrototype$2||TypedArrayPrototype$2===ObjectPrototype$2)&&(TypedArrayPrototype$2=TypedArray$1.prototype,NATIVE_ARRAY_BUFFER_VIEWS$2))for(NAME in TypedArrayConstructorsList)global$d[NAME]&&setPrototypeOf$2(global$d[NAME].prototype,TypedArrayPrototype$2);if(NATIVE_ARRAY_BUFFER_VIEWS$2&&getPrototypeOf$1(Uint8ClampedArrayPrototype)!==TypedArrayPrototype$2&&setPrototypeOf$2(Uint8ClampedArrayPrototype,TypedArrayPrototype$2),DESCRIPTORS$3&&!hasOwn$2(TypedArrayPrototype$2,TO_STRING_TAG))for(NAME in TYPED_ARRAY_TAG_REQUIRED=!0,defineProperty$1(TypedArrayPrototype$2,TO_STRING_TAG,{get:function(){return isObject$5(this)?this[TYPED_ARRAY_TAG$1]:void 0}}),TypedArrayConstructorsList)global$d[NAME]&&createNonEnumerableProperty$2(global$d[NAME],TYPED_ARRAY_TAG$1,NAME);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$c=global$H,fails$b=fails$K,checkCorrectnessOfIteration=checkCorrectnessOfIteration$2,NATIVE_ARRAY_BUFFER_VIEWS$1=arrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS,ArrayBuffer$2=global$c.ArrayBuffer,Int8Array$3=global$c.Int8Array,typedArrayConstructorsRequireWrappers=!NATIVE_ARRAY_BUFFER_VIEWS$1||!fails$b((function(){Int8Array$3(1)}))||!fails$b((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$b((function(){return 1!==new Int8Array$3(new ArrayBuffer$2(2),1,void 0).length})),toIntegerOrInfinity$4=toIntegerOrInfinity$d,toLength$3=toLength$8,$RangeError$2=RangeError,toIndex$2=function(e){if(void 0===e)return 0;var t=toIntegerOrInfinity$4(e),r=toLength$3(t);if(t!==r)throw $RangeError$2("Wrong length or index");return r},$Array=Array,abs=Math.abs,pow=Math.pow,floor$2=Math.floor,log=Math.log,LN2=Math.LN2,pack=function(e,t,r){var i,n,o,a=$Array(r),s=8*r-t-1,l=(1<<s)-1,c=l>>1,u=23===t?pow(2,-24)-pow(2,-77):0,h=e<0||0===e&&1/e<0?1:0,d=0;for((e=abs(e))!=e||e===1/0?(n=e!=e?1:0,i=l):(i=floor$2(log(e)/LN2),e*(o=pow(2,-i))<1&&(i--,o*=2),(e+=i+c>=1?u/o:u*pow(2,1-c))*o>=2&&(i++,o/=2),i+c>=l?(n=0,i=l):i+c>=1?(n=(e*o-1)*pow(2,t),i+=c):(n=e*pow(2,c-1)*pow(2,t),i=0));t>=8;)a[d++]=255&n,n/=256,t-=8;for(i=i<<t|n,s+=t;s>0;)a[d++]=255&i,i/=256,s-=8;return a[--d]|=128*h,a},unpack=function(e,t){var r,i=e.length,n=8*i-t-1,o=(1<<n)-1,a=o>>1,s=n-7,l=i-1,c=e[l--],u=127&c;for(c>>=7;s>0;)u=256*u+e[l--],s-=8;for(r=u&(1<<-s)-1,u>>=-s,s+=t;s>0;)r=256*r+e[l--],s-=8;if(0===u)u=1-a;else{if(u===o)return r?NaN:c?-1/0:1/0;r+=pow(2,t),u-=a}return(c?-1:1)*r*pow(2,u-t)},ieee754={pack:pack,unpack:unpack},toObject$5=toObject$g,toAbsoluteIndex$2=toAbsoluteIndex$7,lengthOfArrayLike$8=lengthOfArrayLike$h,arrayFill$1=function(e){for(var t=toObject$5(this),r=lengthOfArrayLike$8(t),i=arguments.length,n=toAbsoluteIndex$2(i>1?arguments[1]:void 0,r),o=i>2?arguments[2]:void 0,a=void 0===o?r:toAbsoluteIndex$2(o,r);a>n;)t[n++]=e;return t},global$b=global$H,uncurryThis$b=functionUncurryThis,DESCRIPTORS$2=descriptors,NATIVE_ARRAY_BUFFER=arrayBufferBasicDetection,FunctionName=functionName,createNonEnumerableProperty$1=createNonEnumerableProperty$a,defineBuiltIns=defineBuiltIns$2,fails$a=fails$K,anInstance$1=anInstance$5,toIntegerOrInfinity$3=toIntegerOrInfinity$d,toLength$2=toLength$8,toIndex$1=toIndex$2,IEEE754=ieee754,getPrototypeOf=objectGetPrototypeOf,setPrototypeOf$1=objectSetPrototypeOf,getOwnPropertyNames$1=objectGetOwnPropertyNames.f,defineProperty=objectDefineProperty.f,arrayFill=arrayFill$1,arraySlice$4=arraySliceSimple,setToStringTag=setToStringTag$7,InternalStateModule$1=internalState,PROPER_FUNCTION_NAME=FunctionName.PROPER,CONFIGURABLE_FUNCTION_NAME=FunctionName.CONFIGURABLE,getInternalState$1=InternalStateModule$1.get,setInternalState$1=InternalStateModule$1.set,ARRAY_BUFFER="ArrayBuffer",DATA_VIEW="DataView",PROTOTYPE="prototype",WRONG_LENGTH$1="Wrong length",WRONG_INDEX="Wrong index",NativeArrayBuffer=global$b[ARRAY_BUFFER],$ArrayBuffer=NativeArrayBuffer,ArrayBufferPrototype$1=$ArrayBuffer&&$ArrayBuffer[PROTOTYPE],$DataView=global$b[DATA_VIEW],DataViewPrototype=$DataView&&$DataView[PROTOTYPE],ObjectPrototype$1=Object.prototype,Array$1=global$b.Array,RangeError$3=global$b.RangeError,fill=uncurryThis$b(arrayFill),reverse=uncurryThis$b([].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(e[PROTOTYPE],t,{get:function(){return getInternalState$1(this)[t]}})},get=function(e,t,r,i){var n=toIndex$1(r),o=getInternalState$1(e);if(n+t>o.byteLength)throw RangeError$3(WRONG_INDEX);var a=getInternalState$1(o.buffer).bytes,s=n+o.byteOffset,l=arraySlice$4(a,s,s+t);return i?l:reverse(l)},set=function(e,t,r,i,n,o){var a=toIndex$1(r),s=getInternalState$1(e);if(a+t>s.byteLength)throw RangeError$3(WRONG_INDEX);for(var l=getInternalState$1(s.buffer).bytes,c=a+s.byteOffset,u=i(+n),h=0;h<t;h++)l[c+h]=u[o?h:t-h-1]};if(NATIVE_ARRAY_BUFFER){var INCORRECT_ARRAY_BUFFER_NAME=PROPER_FUNCTION_NAME&&NativeArrayBuffer.name!==ARRAY_BUFFER;if(fails$a((function(){NativeArrayBuffer(1)}))&&fails$a((function(){new NativeArrayBuffer(-1)}))&&!fails$a((function(){return new NativeArrayBuffer,new NativeArrayBuffer(1.5),new NativeArrayBuffer(NaN),1!=NativeArrayBuffer.length||INCORRECT_ARRAY_BUFFER_NAME&&!CONFIGURABLE_FUNCTION_NAME})))INCORRECT_ARRAY_BUFFER_NAME&&CONFIGURABLE_FUNCTION_NAME&&createNonEnumerableProperty$1(NativeArrayBuffer,"name",ARRAY_BUFFER);else{$ArrayBuffer=function(e){return anInstance$1(this,ArrayBufferPrototype$1),new NativeArrayBuffer(toIndex$1(e))},$ArrayBuffer[PROTOTYPE]=ArrayBufferPrototype$1;for(var keys=getOwnPropertyNames$1(NativeArrayBuffer),j=0,key;keys.length>j;)(key=keys[j++])in $ArrayBuffer||createNonEnumerableProperty$1($ArrayBuffer,key,NativeArrayBuffer[key]);ArrayBufferPrototype$1.constructor=$ArrayBuffer}setPrototypeOf$1&&getPrototypeOf(DataViewPrototype)!==ObjectPrototype$1&&setPrototypeOf$1(DataViewPrototype,ObjectPrototype$1);var testView=new $DataView(new $ArrayBuffer(2)),$setInt8=uncurryThis$b(DataViewPrototype.setInt8);testView.setInt8(0,2147483648),testView.setInt8(1,2147483649),!testView.getInt8(0)&&testView.getInt8(1)||defineBuiltIns(DataViewPrototype,{setInt8:function(e,t){$setInt8(this,e,t<<24>>24)},setUint8:function(e,t){$setInt8(this,e,t<<24>>24)}},{unsafe:!0})}else $ArrayBuffer=function(e){anInstance$1(this,ArrayBufferPrototype$1);var t=toIndex$1(e);setInternalState$1(this,{bytes:fill(Array$1(t),0),byteLength:t}),DESCRIPTORS$2||(this.byteLength=t)},ArrayBufferPrototype$1=$ArrayBuffer[PROTOTYPE],$DataView=function(e,t,r){anInstance$1(this,DataViewPrototype),anInstance$1(e,ArrayBufferPrototype$1);var i=getInternalState$1(e).byteLength,n=toIntegerOrInfinity$3(t);if(n<0||n>i)throw RangeError$3("Wrong offset");if(n+(r=void 0===r?i-n:toLength$2(r))>i)throw RangeError$3(WRONG_LENGTH$1);setInternalState$1(this,{buffer:e,byteLength:r,byteOffset:n}),DESCRIPTORS$2||(this.buffer=e,this.byteLength=r,this.byteOffset=n)},DataViewPrototype=$DataView[PROTOTYPE],DESCRIPTORS$2&&(addGetter$1($ArrayBuffer,"byteLength"),addGetter$1($DataView,"buffer"),addGetter$1($DataView,"byteLength"),addGetter$1($DataView,"byteOffset")),defineBuiltIns(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($ArrayBuffer,ARRAY_BUFFER),setToStringTag($DataView,DATA_VIEW);var arrayBuffer={ArrayBuffer:$ArrayBuffer,DataView:$DataView},isObject$4=isObject$l,floor$1=Math.floor,isIntegralNumber$1=Number.isInteger||function(e){return!isObject$4(e)&&isFinite(e)&&floor$1(e)===e},toIntegerOrInfinity$2=toIntegerOrInfinity$d,$RangeError$1=RangeError,toPositiveInteger$1=function(e){var t=toIntegerOrInfinity$2(e);if(t<0)throw $RangeError$1("The argument can't be less than 0");return t},toPositiveInteger=toPositiveInteger$1,$RangeError=RangeError,toOffset$2=function(e,t){var r=toPositiveInteger(e);if(r%t)throw $RangeError("Wrong offset");return r},classof$2=classof$d,uncurryThis$a=functionUncurryThis,slice$1=uncurryThis$a("".slice),isBigIntArray$1=function(e){return"Big"===slice$1(classof$2(e),0,3)},toPrimitive=toPrimitive$3,$TypeError$1=TypeError,toBigInt$2=function(e){var t=toPrimitive(e,"number");if("number"==typeof t)throw $TypeError$1("Can't convert number to bigint");return BigInt(t)},bind$3=functionBindContext,call$3=functionCall,aConstructor$1=aConstructor$3,toObject$4=toObject$g,lengthOfArrayLike$7=lengthOfArrayLike$h,getIterator=getIterator$4,getIteratorMethod=getIteratorMethod$5,isArrayIteratorMethod=isArrayIteratorMethod$3,isBigIntArray=isBigIntArray$1,aTypedArrayConstructor$2=arrayBufferViewCore.aTypedArrayConstructor,toBigInt$1=toBigInt$2,typedArrayFrom$1=function(e){var t,r,i,n,o,a,s,l,c=aConstructor$1(this),u=toObject$4(e),h=arguments.length,d=h>1?arguments[1]:void 0,p=void 0!==d,f=getIteratorMethod(u);if(f&&!isArrayIteratorMethod(f))for(l=(s=getIterator(u,f)).next,u=[];!(a=call$3(l,s)).done;)u.push(a.value);for(p&&h>2&&(d=bind$3(d,arguments[2])),r=lengthOfArrayLike$7(u),i=new(aTypedArrayConstructor$2(c))(r),n=isBigIntArray(i),t=0;r>t;t++)o=p?d(u[t],t):u[t],i[t]=n?toBigInt$1(o):+o;return i},$$8=_export,global$a=global$H,call$2=functionCall,DESCRIPTORS$1=descriptors,TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS=typedArrayConstructorsRequireWrappers,ArrayBufferViewCore$q=arrayBufferViewCore,ArrayBufferModule=arrayBuffer,anInstance=anInstance$5,createPropertyDescriptor=createPropertyDescriptor$7,createNonEnumerableProperty=createNonEnumerableProperty$a,isIntegralNumber=isIntegralNumber$1,toLength$1=toLength$8,toIndex=toIndex$2,toOffset$1=toOffset$2,toPropertyKey=toPropertyKey$5,hasOwn$1=hasOwnProperty_1,classof$1=classof$d,isObject$3=isObject$l,isSymbol=isSymbol$6,create$1=objectCreate,isPrototypeOf=objectIsPrototypeOf,setPrototypeOf=objectSetPrototypeOf,getOwnPropertyNames=objectGetOwnPropertyNames.f,typedArrayFrom=typedArrayFrom$1,forEach=arrayIteration.forEach,setSpecies=setSpecies$3,definePropertyModule=objectDefineProperty,getOwnPropertyDescriptorModule=objectGetOwnPropertyDescriptor,InternalStateModule=internalState,inheritIfRequired=inheritIfRequired$3,getInternalState=InternalStateModule.get,setInternalState=InternalStateModule.set,enforceInternalState=InternalStateModule.enforce,nativeDefineProperty=definePropertyModule.f,nativeGetOwnPropertyDescriptor=getOwnPropertyDescriptorModule.f,round=Math.round,RangeError$2=global$a.RangeError,ArrayBuffer$1=ArrayBufferModule.ArrayBuffer,ArrayBufferPrototype=ArrayBuffer$1.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,i=t.length,n=new e(i);i>r;)n[r]=t[r++];return n},addGetter=function(e,t){nativeDefineProperty(e,t,{get:function(){return getInternalState(this)[t]}})},isArrayBuffer=function(e){var t;return isPrototypeOf(ArrayBufferPrototype,e)||"ArrayBuffer"==(t=classof$1(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(2,e[t]):nativeGetOwnPropertyDescriptor(e,t)},wrappedDefineProperty=function(e,t,r){return t=toPropertyKey(t),!(isTypedArrayIndex(e,t)&&isObject$3(r)&&hasOwn$1(r,"value"))||hasOwn$1(r,"get")||hasOwn$1(r,"set")||r.configurable||hasOwn$1(r,"writable")&&!r.writable||hasOwn$1(r,"enumerable")&&!r.enumerable?nativeDefineProperty(e,t,r):(e[t]=r.value,e)};DESCRIPTORS$1?(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")),$$8({target:"Object",stat:!0,forced:!NATIVE_ARRAY_BUFFER_VIEWS},{getOwnPropertyDescriptor:wrappedGetOwnPropertyDescriptor,defineProperty:wrappedDefineProperty}),typedArrayConstructor.exports=function(e,t,r){var i=e.match(/\d+$/)[0]/8,n=e+(r?"Clamped":"")+"Array",o="get"+e,a="set"+e,s=global$a[n],l=s,c=l&&l.prototype,u={},h=function(e,t){nativeDefineProperty(e,t,{get:function(){return function(e,t){var r=getInternalState(e);return r.view[o](t*i+r.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,n){var o=getInternalState(e);r&&(n=(n=round(n))<0?0:n>255?255:255&n),o.view[a](t*i+o.byteOffset,n,!0)}(this,t,e)},enumerable:!0})};NATIVE_ARRAY_BUFFER_VIEWS?TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS&&(l=t((function(e,t,r,n){return anInstance(e,c),inheritIfRequired(isObject$3(t)?isArrayBuffer(t)?void 0!==n?new s(t,toOffset$1(r,i),n):void 0!==r?new s(t,toOffset$1(r,i)):new s(t):isTypedArray(t)?fromList(l,t):call$2(typedArrayFrom,l,t):new s(toIndex(t)),e,l)})),setPrototypeOf&&setPrototypeOf(l,TypedArray),forEach(getOwnPropertyNames(s),(function(e){e in l||createNonEnumerableProperty(l,e,s[e])})),l.prototype=c):(l=t((function(e,t,r,n){anInstance(e,c);var o,a,s,u=0,d=0;if(isObject$3(t)){if(!isArrayBuffer(t))return isTypedArray(t)?fromList(l,t):call$2(typedArrayFrom,l,t);o=t,d=toOffset$1(r,i);var p=t.byteLength;if(void 0===n){if(p%i)throw RangeError$2(WRONG_LENGTH);if((a=p-d)<0)throw RangeError$2(WRONG_LENGTH)}else if((a=toLength$1(n)*i)+d>p)throw RangeError$2(WRONG_LENGTH);s=a/i}else s=toIndex(t),o=new ArrayBuffer$1(a=s*i);for(setInternalState(e,{buffer:o,byteOffset:d,byteLength:a,length:s,view:new DataView$1(o)});u<s;)h(e,u++)})),setPrototypeOf&&setPrototypeOf(l,TypedArray),c=l.prototype=create$1(TypedArrayPrototype$1)),c.constructor!==l&&createNonEnumerableProperty(c,"constructor",l),enforceInternalState(c).TypedArrayConstructor=l,TYPED_ARRAY_TAG&&createNonEnumerableProperty(c,TYPED_ARRAY_TAG,n);var d=l!=s;u[n]=l,$$8({global:!0,constructor:!0,forced:d,sham:!NATIVE_ARRAY_BUFFER_VIEWS},u),BYTES_PER_ELEMENT in l||createNonEnumerableProperty(l,BYTES_PER_ELEMENT,i),BYTES_PER_ELEMENT in c||createNonEnumerableProperty(c,BYTES_PER_ELEMENT,i),setSpecies(n)}):typedArrayConstructor.exports=function(){};var createTypedArrayConstructor=typedArrayConstructor.exports;createTypedArrayConstructor("Uint8",(function(e){return function(t,r,i){return e(this,t,r,i)}}));var ArrayBufferViewCore$p=arrayBufferViewCore,lengthOfArrayLike$6=lengthOfArrayLike$h,toIntegerOrInfinity$1=toIntegerOrInfinity$d,aTypedArray$o=ArrayBufferViewCore$p.aTypedArray,exportTypedArrayMethod$p=ArrayBufferViewCore$p.exportTypedArrayMethod;exportTypedArrayMethod$p("at",(function(e){var t=aTypedArray$o(this),r=lengthOfArrayLike$6(t),i=toIntegerOrInfinity$1(e),n=i>=0?i:r+i;return n<0||n>=r?void 0:t[n]}));var toObject$3=toObject$g,toAbsoluteIndex$1=toAbsoluteIndex$7,lengthOfArrayLike$5=lengthOfArrayLike$h,deletePropertyOrThrow=deletePropertyOrThrow$2,min$1=Math.min,arrayCopyWithin=[].copyWithin||function(e,t){var r=toObject$3(this),i=lengthOfArrayLike$5(r),n=toAbsoluteIndex$1(e,i),o=toAbsoluteIndex$1(t,i),a=arguments.length>2?arguments[2]:void 0,s=min$1((void 0===a?i:toAbsoluteIndex$1(a,i))-o,i-n),l=1;for(o<n&&n<o+s&&(l=-1,o+=s-1,n+=s-1);s-- >0;)o in r?r[n]=r[o]:deletePropertyOrThrow(r,n),n+=l,o+=l;return r},uncurryThis$9=functionUncurryThis,ArrayBufferViewCore$o=arrayBufferViewCore,$ArrayCopyWithin=arrayCopyWithin,u$ArrayCopyWithin=uncurryThis$9($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=classof$d,call$1=functionCall,uncurryThis$8=functionUncurryThis,fails$9=fails$K,aTypedArray$l=ArrayBufferViewCore$m.aTypedArray,exportTypedArrayMethod$m=ArrayBufferViewCore$m.exportTypedArrayMethod,slice=uncurryThis$8("".slice),CONVERSION_BUG=fails$9((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(this),0,3)?toBigInt(e):+e;return call$1($fill,this,r,t>1?arguments[1]:void 0,t>2?arguments[2]:void 0)}),CONVERSION_BUG);var lengthOfArrayLike$4=lengthOfArrayLike$h,arrayFromConstructorAndList$1=function(e,t){for(var r=0,i=lengthOfArrayLike$4(t),n=new e(i);i>r;)n[r]=t[r++];return n},ArrayBufferViewCore$l=arrayBufferViewCore,speciesConstructor=speciesConstructor$4,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=arrayIteration.find,aTypedArray$j=ArrayBufferViewCore$j.aTypedArray,exportTypedArrayMethod$k=ArrayBufferViewCore$j.exportTypedArrayMethod;exportTypedArrayMethod$k("find",(function(e){return $find(aTypedArray$j(this),e,arguments.length>1?arguments[1]:void 0)}));var ArrayBufferViewCore$i=arrayBufferViewCore,$findIndex=arrayIteration.findIndex,aTypedArray$i=ArrayBufferViewCore$i.aTypedArray,exportTypedArrayMethod$j=ArrayBufferViewCore$i.exportTypedArrayMethod;exportTypedArrayMethod$j("findIndex",(function(e){return $findIndex(aTypedArray$i(this),e,arguments.length>1?arguments[1]:void 0)}));var bind$2=functionBindContext,IndexedObject$1=indexedObject,toObject$2=toObject$g,lengthOfArrayLike$3=lengthOfArrayLike$h,createMethod$2=function(e){var t=1==e;return function(r,i,n){for(var o,a=toObject$2(r),s=IndexedObject$1(a),l=bind$2(i,n),c=lengthOfArrayLike$3(s);c-- >0;)if(l(o=s[c],c,a))switch(e){case 0:return o;case 1:return c}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$9=global$H,fails$8=fails$K,uncurryThis$7=functionUncurryThis,ArrayBufferViewCore$c=arrayBufferViewCore,ArrayIterators=es_array_iterator,wellKnownSymbol=wellKnownSymbol$t,ITERATOR$1=wellKnownSymbol("iterator"),Uint8Array$2=global$9.Uint8Array,arrayValues=uncurryThis$7(ArrayIterators.values),arrayKeys=uncurryThis$7(ArrayIterators.keys),arrayEntries=uncurryThis$7(ArrayIterators.entries),aTypedArray$c=ArrayBufferViewCore$c.aTypedArray,exportTypedArrayMethod$d=ArrayBufferViewCore$c.exportTypedArrayMethod,TypedArrayPrototype=Uint8Array$2&&Uint8Array$2.prototype,GENERIC=!fails$8((function(){TypedArrayPrototype[ITERATOR$1].call([1])})),ITERATOR_IS_VALUES=!!TypedArrayPrototype&&TypedArrayPrototype.values&&TypedArrayPrototype[ITERATOR$1]===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$1,typedArrayValues,GENERIC||!ITERATOR_IS_VALUES,{name:"values"});var ArrayBufferViewCore$b=arrayBufferViewCore,uncurryThis$6=functionUncurryThis,aTypedArray$b=ArrayBufferViewCore$b.aTypedArray,exportTypedArrayMethod$c=ArrayBufferViewCore$b.exportTypedArrayMethod,$join=uncurryThis$6([].join);exportTypedArrayMethod$c("join",(function(e){return $join(aTypedArray$b(this),e)}));var apply$5=functionApply,toIndexedObject$2=toIndexedObject$c,toIntegerOrInfinity=toIntegerOrInfinity$d,lengthOfArrayLike$2=lengthOfArrayLike$h,arrayMethodIsStrict=arrayMethodIsStrict$3,min=Math.min,$lastIndexOf$1=[].lastIndexOf,NEGATIVE_ZERO=!!$lastIndexOf$1&&1/[1].lastIndexOf(1,-0)<0,STRICT_METHOD=arrayMethodIsStrict("lastIndexOf"),FORCED$4=NEGATIVE_ZERO||!STRICT_METHOD,arrayLastIndexOf=FORCED$4?function(e){if(NEGATIVE_ZERO)return apply$5($lastIndexOf$1,this,arguments)||0;var t=toIndexedObject$2(this),r=lengthOfArrayLike$2(t),i=r-1;for(arguments.length>1&&(i=min(i,toIntegerOrInfinity(arguments[1]))),i<0&&(i=r+i);i>=0;i--)if(i in t&&t[i]===e)return i||0;return-1}:$lastIndexOf$1,ArrayBufferViewCore$a=arrayBufferViewCore,apply$4=functionApply,$lastIndexOf=arrayLastIndexOf,aTypedArray$a=ArrayBufferViewCore$a.aTypedArray,exportTypedArrayMethod$b=ArrayBufferViewCore$a.exportTypedArrayMethod;exportTypedArrayMethod$b("lastIndexOf",(function(e){var t=arguments.length;return apply$4($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$1=toObject$g,IndexedObject=indexedObject,lengthOfArrayLike$1=lengthOfArrayLike$h,$TypeError=TypeError,createMethod$1=function(e){return function(t,r,i,n){aCallable$2(r);var o=toObject$1(t),a=IndexedObject(o),s=lengthOfArrayLike$1(o),l=e?s-1:0,c=e?-1:1;if(i<2)for(;;){if(l in a){n=a[l],l+=c;break}if(l+=c,e?l<0:s<=l)throw $TypeError("Reduce of empty array with no initial value")}for(;e?l>=0:s>l;l+=c)l in a&&(n=r(n,a[l],l,o));return n}},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=Math.floor;exportTypedArrayMethod$7("reverse",(function(){for(var e,t=this,r=aTypedArray$6(t).length,i=floor(r/2),n=0;n<i;)e=t[n],t[n++]=t[--r],t[r]=e;return t}));var global$8=global$H,call=functionCall,ArrayBufferViewCore$5=arrayBufferViewCore,lengthOfArrayLike=lengthOfArrayLike$h,toOffset=toOffset$2,toIndexedObject$1=toObject$g,fails$7=fails$K,RangeError$1=global$8.RangeError,Int8Array$2=global$8.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$7((function(){var e=new Uint8ClampedArray(2);return call($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$7((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$1(e);if(WORKS_WITH_OBJECTS_AND_GEERIC_ON_TYPED_ARRAYS)return call($set,this,r,t);var i=this.length,n=lengthOfArrayLike(r),o=0;if(n+t>i)throw RangeError$1("Wrong length");for(;o<n;)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$6=fails$K,arraySlice$3=arraySlice$b,aTypedArray$4=ArrayBufferViewCore$4.aTypedArray,exportTypedArrayMethod$5=ArrayBufferViewCore$4.exportTypedArrayMethod,FORCED$3=fails$6((function(){new Int8Array(1).slice()}));exportTypedArrayMethod$5("slice",(function(e,t){for(var r=arraySlice$3(aTypedArray$4(this),e,t),i=typedArraySpeciesConstructor$1(this),n=0,o=r.length,a=new i(o);o>n;)a[n]=r[n++];return a}),FORCED$3);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 userAgent$2=engineUserAgent,firefox=userAgent$2.match(/firefox\/(\d+)/i),engineFfVersion=!!firefox&&+firefox[1],UA=engineUserAgent,engineIsIeOrEdge=/MSIE|Trident/.test(UA),userAgent$1=engineUserAgent,webkit=userAgent$1.match(/AppleWebKit\/(\d+)\./),engineWebkitVersion=!!webkit&&+webkit[1],global$7=global$H,uncurryThis$5=functionUncurryThis,fails$5=fails$K,aCallable$1=aCallable$a,internalSort=arraySort$1,ArrayBufferViewCore$2=arrayBufferViewCore,FF=engineFfVersion,IE_OR_EDGE=engineIsIeOrEdge,V8=engineV8Version,WEBKIT=engineWebkitVersion,aTypedArray$2=ArrayBufferViewCore$2.aTypedArray,exportTypedArrayMethod$3=ArrayBufferViewCore$2.exportTypedArrayMethod,Uint16Array=global$7.Uint16Array,nativeSort=Uint16Array&&uncurryThis$5(Uint16Array.prototype.sort),ACCEPT_INCORRECT_ARGUMENTS=!(!nativeSort||fails$5((function(){nativeSort(new Uint16Array(2),null)}))&&fails$5((function(){nativeSort(new Uint16Array(2),{})}))),STABLE_SORT=!!nativeSort&&!fails$5((function(){if(V8)return V8<74;if(FF)return FF<67;if(IE_OR_EDGE)return!0;if(WEBKIT)return WEBKIT<602;var e,t,r=new Uint16Array(516),i=Array(516);for(e=0;e<516;e++)t=e%4,r[e]=515-e,i[e]=e-2*t+3;for(nativeSort(r,(function(e,t){return(e/4|0)-(t/4|0)})),e=0;e<516;e++)if(r[e]!==i[e])return!0})),getSortCompare=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?nativeSort(this,e):internalSort(aTypedArray$2(this),getSortCompare(e))}),!STABLE_SORT||ACCEPT_INCORRECT_ARGUMENTS);var ArrayBufferViewCore$1=arrayBufferViewCore,toLength=toLength$8,toAbsoluteIndex=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),i=r.length,n=toAbsoluteIndex(e,i);return new(typedArraySpeciesConstructor(r))(r.buffer,r.byteOffset+n*r.BYTES_PER_ELEMENT,toLength((void 0===t?i:toAbsoluteIndex(t,i))-n))}));var global$6=global$H,apply$3=functionApply,ArrayBufferViewCore=arrayBufferViewCore,fails$4=fails$K,arraySlice$2=arraySlice$b,Int8Array$1=global$6.Int8Array,aTypedArray=ArrayBufferViewCore.aTypedArray,exportTypedArrayMethod$1=ArrayBufferViewCore.exportTypedArrayMethod,$toLocaleString=[].toLocaleString,TO_LOCALE_STRING_BUG=!!Int8Array$1&&fails$4((function(){$toLocaleString.call(new Int8Array$1(1))})),FORCED$2=fails$4((function(){return[1,2].toLocaleString()!=new Int8Array$1([1,2]).toLocaleString()}))||!fails$4((function(){Int8Array$1.prototype.toLocaleString.call([1,2])}));exportTypedArrayMethod$1("toLocaleString",(function(){return apply$3($toLocaleString,TO_LOCALE_STRING_BUG?arraySlice$2(aTypedArray(this)):aTypedArray(this),arraySlice$2(arguments))}),FORCED$2);var exportTypedArrayMethod=arrayBufferViewCore.exportTypedArrayMethod,fails$3=fails$K,global$5=global$H,uncurryThis$4=functionUncurryThis,Uint8Array$1=global$5.Uint8Array,Uint8ArrayPrototype=Uint8Array$1&&Uint8Array$1.prototype||{},arrayToString=[].toString,join$1=uncurryThis$4([].join);fails$3((function(){arrayToString.call({})}))&&(arrayToString=function(){return join$1(this)});var IS_NOT_ARRAY_METHOD=Uint8ArrayPrototype.toString!=arrayToString;exportTypedArrayMethod("toString",arrayToString,IS_NOT_ARRAY_METHOD);var LoaderType={FETCH:"fetch",XHR:"xhr"},ResponseType={ARRAY_BUFFER:"arraybuffer",TEXT:"text",JSON:"json"},NetError=function(e){_inherits$1(r,e);var t=_createSuper$1(r);function r(e,i,n,o){var a;return _classCallCheck$1(this,r),_defineProperty$2(_assertThisInitialized$1(a=t.call(this,o)),"retryCount",0),_defineProperty$2(_assertThisInitialized$1(a),"isTimeout",!1),_defineProperty$2(_assertThisInitialized$1(a),"loaderType",LoaderType.FETCH),_defineProperty$2(_assertThisInitialized$1(a),"startTime",0),_defineProperty$2(_assertThisInitialized$1(a),"endTime",0),_defineProperty$2(_assertThisInitialized$1(a),"options",{}),a.url=e,a.request=i,a.response=n,a}return _createClass$2(r)}(_wrapNativeSuper(Error)),$$7=_export;$$7({target:"Number",stat:!0},{isNaN:function(e){return e!=e}});var $$6=_export,fails$2=fails$K,toObject=toObject$g,nativeGetPrototypeOf=objectGetPrototypeOf,CORRECT_PROTOTYPE_GETTER=correctPrototypeGetter,FAILS_ON_PRIMITIVES=fails$2((function(){nativeGetPrototypeOf(1)}));$$6({target:"Object",stat:!0,forced:FAILS_ON_PRIMITIVES,sham:!CORRECT_PROTOTYPE_GETTER},{getPrototypeOf:function(e){return nativeGetPrototypeOf(toObject(e))}});var toString$1=Object.prototype.toString;function isObject$2(e){return null!==e&&"object"===_typeof$1(e)}function isPlainObject(e){if("[object Object]"!==toString$1.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function isDate(e){return"[object Date]"===toString$1.call(e)}function getRangeValue(e){if(e&&null!==e[0]&&void 0!==e[0]&&(0!==e[0]||null!==e[1]&&void 0!==e[1])){var t="bytes="+e[0]+"-";return e[1]&&(t+=e[1]),t}}function encode(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function setUrlParams(e,t){if(e){if(!t)return e;var r,i=Object.keys(t).map((function(e){if(null!=(r=t[e]))return Array.isArray(r)?e+="[]":r=[r],r.map((function(t){return isDate(t)?t=t.toISOString():isObject$2(t)&&(t=JSON.stringify(t)),"".concat(encode(e),"=").concat(encode(t))})).join("&")})).filter(Boolean).join("&");if(i){var n=e.indexOf("#");-1!==n&&(e=e.slice(0,n)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}}function createResponse(e,t,r,i,n,o,a,s,l,c,u){return n=null!=n?parseFloat(n):null,i=parseInt(i||"0",10),Number.isNaN(i)&&(i=0),{data:e,done:t,option:{range:l,vid:c,index:s,contentLength:i,age:n,startTime:o,firstByteTime:a,endTime:Date.now(),priOptions:u},response:r}}function calculateSpeed(e,t){return Math.round(8*e*1e3/t/1024)}var EVENT={ERROR:"error",TTFB:"core.ttfb",LOAD_START:"core.loadstart",LOAD_RESPONSE_HEADERS:"core.loadresponseheaders",LOAD_COMPLETE:"core.loadcomplete",LOAD_RETRY:"core.loadretry",SOURCEBUFFER_CREATED:"core.sourcebuffercreated",ANALYZE_DURATION_EXCEEDED:"core.analyzedurationexceeded",REMOVE_BUFFER:"core.removebuffer",BUFFEREOS:"core.buffereos",KEYFRAME:"core.keyframe",METADATA_PARSED:"core.metadataparsed",SEI:"core.sei",SEI_IN_TIME:"core.seiintime",FLV_SCRIPT_DATA:"core.flvscriptdata",LOWDECODE:"core.lowdecode",SWITCH_URL_SUCCESS:"core.switchurlsuccess",SWITCH_URL_FAILED:"core.switchurlfailed",SPEED:"core.speed",HLS_MANIFEST_LOADED:"core.hlsmanifestloaded",HLS_LEVEL_LOADED:"core.hlslevelloaded",DEMUXED_TRACK:"demuxedtrack",STREAM_EXCEPTION:"core.streamexception",LARGE_AV_FIRST_FRAME_GAP_DETECT:"LARGE_AV_FIRST_FRAME_GAP_DETECT",LARGE_VIDEO_DTS_GAP_DETECT:"LARGE_VIDEO_DTS_GAP_DETECT",LARGE_AUDIO_DTS_GAP_DETECT:"LARGE_AUDIO_DTS_GAP_DETECT",AUDIO_GAP_DETECT:"AUDIO_GAP_DETECT",AUDIO_OVERLAP_DETECT:"AUDIO_OVERLAP_DETECT",MAX_DTS_DELTA_WITH_NEXT_SEGMENT_DETECT:"MAX_DTS_DELTA_WITH_NEXT_SEGMENT_DETECT",REAL_TIME_SPEED:"real_time_speed"},CACHESIZE=2097152,FetchLoader=function(e){_inherits$1(i,e);var t,r=_createSuper$1(i);function i(){var e;return _classCallCheck$1(this,i),_defineProperty$2(_assertThisInitialized$1(e=r.call(this)),"_abortController",null),_defineProperty$2(_assertThisInitialized$1(e),"_timeoutTimer",null),_defineProperty$2(_assertThisInitialized$1(e),"_reader",null),_defineProperty$2(_assertThisInitialized$1(e),"_response",null),_defineProperty$2(_assertThisInitialized$1(e),"_aborted",!1),_defineProperty$2(_assertThisInitialized$1(e),"_index",-1),_defineProperty$2(_assertThisInitialized$1(e),"_range",null),_defineProperty$2(_assertThisInitialized$1(e),"_receivedLength",0),_defineProperty$2(_assertThisInitialized$1(e),"_running",!1),_defineProperty$2(_assertThisInitialized$1(e),"_logger",null),_defineProperty$2(_assertThisInitialized$1(e),"_vid",""),_defineProperty$2(_assertThisInitialized$1(e),"_onProcessMinLen",0),_defineProperty$2(_assertThisInitialized$1(e),"_onCancel",null),_defineProperty$2(_assertThisInitialized$1(e),"_priOptions",null),e}return _createClass$2(i,[{key:"load",value:function(e){var t,r=this,i=e.url,n=e.vid,o=e.timeout,a=e.responseType,s=e.onProgress,l=e.index,c=e.onTimeout,u=e.onCancel,h=e.range,d=e.transformResponse,p=e.request,f=e.params,g=e.logger,y=e.method,v=e.headers,m=e.body,_=e.mode,b=e.credentials,T=e.cache,S=e.redirect,E=e.referrer,$=e.referrerPolicy,C=e.onProcessMinLen,P=e.priOptions;this._logger=g,this._aborted=!1,this._onProcessMinLen=C,this._onCancel=u,this._abortController="undefined"!=typeof AbortController&&new AbortController,this._running=!0,this._index=l,this._range=h||[0,0],this._vid=n||i,this._priOptions=P||{};var w={method:y,headers:v,body:m,mode:_,credentials:b,cache:T,redirect:S,referrer:E,referrerPolicy:$,signal:null===(t=this._abortController)||void 0===t?void 0:t.signal},O=!1;clearTimeout(this._timeoutTimer),i=setUrlParams(i,f);var k=getRangeValue(h);k&&(v=p?p.headers:w.headers=w.headers||(Headers?new Headers:{}),Headers&&v instanceof Headers?v.append("Range",k):v.Range=k),o&&(this._timeoutTimer=setTimeout((function(){if(O=!0,r.cancel(),c){var e=new NetError(i,w,null,"timeout");e.isTimeout=!0,c(e,{index:r._index,range:r._range,vid:r._vid,priOptions:r._priOptions})}}),o));var I=Date.now();return this._logger.debug("[fetch load start], index,",l,",range,",h),new Promise((function(e,t){fetch(p||i,p?void 0:w).then(function(){var n=_asyncToGenerator(_regeneratorRuntime().mark((function n(o){var c,u,p,f;return _regeneratorRuntime().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(clearTimeout(r._timeoutTimer),r._response=o,!r._aborted&&r._running){n.next=4;break}return n.abrupt("return");case 4:if(d&&(o=d(o,i)||o),o.ok){n.next=7;break}throw new NetError(i,w,o,"bad network response");case 7:if(c=Date.now(),a!==ResponseType.TEXT){n.next=15;break}return n.next=11,o.text();case 11:u=n.sent,r._running=!1,n.next=37;break;case 15:if(a!==ResponseType.JSON){n.next=22;break}return n.next=18,o.json();case 18:u=n.sent,r._running=!1,n.next=37;break;case 22:if(!s){n.next=29;break}return r.resolve=e,r.reject=t,r._loadChunk(o,s,I,c),n.abrupt("return");case 29:return n.next=31,o.arrayBuffer();case 31:u=n.sent,u=new Uint8Array(u),r._running=!1,p=Date.now()-I,f=calculateSpeed(u.byteLength,p),r.emit(EVENT.REAL_TIME_SPEED,{speed:f,len:u.byteLength,time:p,vid:r._vid,index:r._index,range:r._range,priOptions:r._priOptions});case 37:r._logger.debug("[fetch load end], index,",l,",range,",h),e(createResponse(u,!0,o,o.headers.get("Content-Length"),o.headers.get("age"),I,c,l,h,r._vid,r._priOptions));case 39:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()).catch((function(e){var n;clearTimeout(r._timeoutTimer),r._running=!1,r._aborted&&!O||((e=e instanceof NetError?e:new NetError(i,w,null,null===(n=e)||void 0===n?void 0:n.message)).startTime=I,e.endTime=Date.now(),e.isTimeout=O,e.options={index:r._index,range:r._range,vid:r._vid,priOptions:r._priOptions},t(e))}))}))}},{key:"cancel",value:(t=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._aborted){e.next=2;break}return e.abrupt("return");case 2:if(this._aborted=!0,this._running=!1,!this._response){e.next=14;break}if(e.prev=5,!this._reader){e.next=9;break}return e.next=9,this._reader.cancel();case 9:e.next=13;break;case 11:e.prev=11,e.t0=e.catch(5);case 13:this._response=this._reader=null;case 14:if(this._abortController){try{this._abortController.abort()}catch(error){}this._abortController=null}this._onCancel&&this._onCancel({index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions});case 16:case"end":return e.stop()}}),e,this,[[5,11]])}))),function(){return t.apply(this,arguments)})},{key:"_loadChunk",value:function(e,t,r,i){var n=this;if(!e.body||!e.body.getReader){this._running=!1;var o=new NetError(e.url,"",e,"onProgress of bad response.body.getReader");return o.options={index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions},void this.reject(o)}this._onProcessMinLen>0&&(this._cache=new Uint8Array(CACHESIZE),this._writeIdx=0);var a,s,l,c=this._reader=e.body.getReader(),u=function(){var o=_asyncToGenerator(_regeneratorRuntime().mark((function o(){var h,d,p,f,g,y,v,m;return _regeneratorRuntime().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return s=Date.now(),o.prev=1,o.next=4,c.read();case 4:a=o.sent,l=Date.now(),o.next=13;break;case 8:return o.prev=8,o.t0=o.catch(1),l=Date.now(),n._aborted||(n._running=!1,o.t0.options={index:n._index,range:n._range,vid:n._vid,priOptions:n._priOptions},n.reject(o.t0)),o.abrupt("return");case 13:if(d=(null===(h=n._range)||void 0===h?void 0:h.length)>0?n._range[0]:0,p=d+n._receivedLength,!n._aborted){o.next=19;break}return n._running=!1,t(void 0,!1,{range:[p,p],vid:n._vid,index:n._index,startTime:s,endTime:l,st:r,firstByteTime:i,priOptions:n._priOptions},e),o.abrupt("return");case 19:f=a.value?a.value.byteLength:0,n._receivedLength+=f,n._logger.debug("【fetchLoader,onProgress call】,task,",n._range,", start,",p,", end,",d+n._receivedLength,", done,",a.done),n._onProcessMinLen>0?n._writeIdx+f>=n._onProcessMinLen||a.done?((g=new Uint8Array(n._writeIdx+f)).set(n._cache.slice(0,n._writeIdx),0),f>0&&g.set(a.value,n._writeIdx),n._writeIdx=0,n._logger.debug("【fetchLoader,onProgress enough】,done,",a.done,",len,",g.byteLength,", writeIdx,",n._writeIdx)):f>0&&n._writeIdx+f<CACHESIZE?(n._cache.set(a.value,n._writeIdx),n._writeIdx+=f,n._logger.debug("【fetchLoader,onProgress cache】,len,",f,", writeIdx,",n._writeIdx)):f>0&&(y=new Uint8Array(n._writeIdx+f+2048),n._logger.debug("【fetchLoader,onProgress extra start】,size,",n._writeIdx+f+2048,", datalen,",f,", writeIdx,",n._writeIdx),y.set(n._cache.slice(0,n._writeIdx),0),f>0&&y.set(a.value,n._writeIdx),n._writeIdx+=f,delete n._cache,n._cache=y,n._logger.debug("【fetchLoader,onProgress extra end】,len,",f,", writeIdx,",n._writeIdx)):g=a.value,(g&&g.byteLength>0||a.done)&&t(g,a.done,{range:[n._range[0]+n._receivedLength-(g?g.byteLength:0),n._range[0]+n._receivedLength],vid:n._vid,index:n._index,startTime:s,endTime:l,st:r,firstByteTime:i,priOptions:n._priOptions},e),a.done?(v=Date.now()-r,m=calculateSpeed(n._receivedLength,v),n.emit(EVENT.REAL_TIME_SPEED,{speed:m,len:n._receivedLength,time:v,vid:n._vid,index:n._index,range:n._range,priOptions:n._priOptions}),n._running=!1,n._logger.debug("[fetchLoader onProgress end],task,",n._range,",done,",a.done),n.resolve(createResponse(a,!0,e,e.headers.get("Content-Length"),e.headers.get("age"),r,i,n._index,n._range,n._vid,n._priOptions))):u();case 25:case"end":return o.stop()}}),o,null,[[1,8]])})));return function(){return o.apply(this,arguments)}}();u()}},{key:"receiveLen",get:function(){return this._receivedLength}},{key:"running",get:function(){return this._running},set:function(e){this._running=e}}],[{key:"isSupported",value:function(){return!("undefined"==typeof fetch)}}]),i}(EventEmitter);function getConfig(e){return _objectSpread2$1({loaderType:LoaderType.FETCH,retry:0,retryDelay:0,timeout:0,request:null,onTimeout:void 0,onProgress:void 0,onRetryError:void 0,transformRequest:void 0,transformResponse:void 0,transformError:void 0,responseType:ResponseType.TEXT,range:void 0,url:"",params:void 0,method:"GET",headers:{},body:void 0,mode:void 0,credentials:void 0,cache:void 0,redirect:void 0,referrer:void 0,referrerPolicy:void 0,integrity:void 0,onProcessMinLen:0},e)}var XhrLoader=function(e){_inherits$1(r,e);var t=_createSuper$1(r);function r(){var e;return _classCallCheck$1(this,r),_defineProperty$2(_assertThisInitialized$1(e=t.call(this)),"_xhr",null),_defineProperty$2(_assertThisInitialized$1(e),"_aborted",!1),_defineProperty$2(_assertThisInitialized$1(e),"_timeoutTimer",null),_defineProperty$2(_assertThisInitialized$1(e),"_range",null),_defineProperty$2(_assertThisInitialized$1(e),"_receivedLength",0),_defineProperty$2(_assertThisInitialized$1(e),"_url",null),_defineProperty$2(_assertThisInitialized$1(e),"_onProgress",null),_defineProperty$2(_assertThisInitialized$1(e),"_index",-1),_defineProperty$2(_assertThisInitialized$1(e),"_headers",null),_defineProperty$2(_assertThisInitialized$1(e),"_currentChunkSizeKB",384),_defineProperty$2(_assertThisInitialized$1(e),"_timeout",null),_defineProperty$2(_assertThisInitialized$1(e),"_xhr",null),_defineProperty$2(_assertThisInitialized$1(e),"_withCredentials",null),_defineProperty$2(_assertThisInitialized$1(e),"_startTime",-1),_defineProperty$2(_assertThisInitialized$1(e),"_loadCompleteResolve",null),_defineProperty$2(_assertThisInitialized$1(e),"_loadCompleteReject",null),_defineProperty$2(_assertThisInitialized$1(e),"_runing",!1),_defineProperty$2(_assertThisInitialized$1(e),"_logger",!1),_defineProperty$2(_assertThisInitialized$1(e),"_vid",""),_defineProperty$2(_assertThisInitialized$1(e),"_responseType",void 0),_defineProperty$2(_assertThisInitialized$1(e),"_credentials",void 0),_defineProperty$2(_assertThisInitialized$1(e),"_method",void 0),_defineProperty$2(_assertThisInitialized$1(e),"_transformResponse",void 0),_defineProperty$2(_assertThisInitialized$1(e),"_firstRtt",void 0),_defineProperty$2(_assertThisInitialized$1(e),"_onCancel",null),_defineProperty$2(_assertThisInitialized$1(e),"_priOptions",null),e}return _createClass$2(r,[{key:"load",value:function(e){var t=this;clearTimeout(this._timeoutTimer),this._logger=e.logger,this._range=e.range,this._onProgress=e.onProgress,this._index=e.index,this._headers=e.headers,this._withCredentials="include"===e.credentials||"same-origin"===e.credentials,this._body=e.body||null,e.method&&(this._method=e.method),this._timeout=e.timeout||null,this._runing=!0,this._vid=e.vid||e.url,this._responseType=e.responseType,this._firstRtt=-1,this._onTimeout=e.onTimeout,this._onCancel=e.onCancel,this._request=e.request,this._priOptions=e.priOptions||{},this._logger.debug("【xhrLoader task】, range",this._range),this._url=setUrlParams(e.url,e.params);var r=Date.now();return new Promise((function(e,r){t._loadCompleteResolve=e,t._loadCompleteReject=r,t._startLoad()})).catch((function(e){if(clearTimeout(t._timeoutTimer),t._runing=!1,!t._aborted)throw(e=e instanceof NetError?e:new NetError(t._url,t._request)).startTime=r,e.endTime=Date.now(),e.options={index:t._index,vid:t._vid,priOptions:t._priOptions},e}))}},{key:"_startLoad",value:function(){var e=null;if(this._responseType===ResponseType.ARRAY_BUFFER&&this._range&&this._range.length>1)if(this._onProgress){this._firstRtt=-1;var t=1024*this._currentChunkSizeKB,r=this._range[0]+this._receivedLength,i=this._range[1];t<this._range[1]-r&&(i=r+t),e=[r,i],this._logger.debug("[xhr_loader->],tast :",this._range,", SubRange, ",e)}else e=this._range,this._logger.debug("[xhr_loader->],tast :",this._range,", allRange, ",e);this._internalOpen(e)}},{key:"_internalOpen",value:function(e){var t=this;try{this._startTime=Date.now();var r=this._xhr=new XMLHttpRequest;r.open(this._method||"GET",this._url,!0),r.responseType=this._responseType,this._timeout&&(r.timeout=this._timeout),r.withCredentials=this._withCredentials,r.onload=this._onLoad.bind(this),r.onreadystatechange=this._onReadyStatechange.bind(this),r.onerror=function(e){var r,i,n;t._running=!1;var o=new NetError(t._url,t._request,null==e||null===(r=e.currentTarget)||void 0===r?void 0:r.response,"xhr.onerror.status:"+(null==e||null===(i=e.currentTarget)||void 0===i?void 0:i.status)+",statusText,"+(null==e||null===(n=e.currentTarget)||void 0===n?void 0:n.statusText));o.options={index:t._index,range:t._range,vid:t._vid,priOptions:t._priOptions},t._loadCompleteReject(o)},r.ontimeout=function(e){t.cancel();var r=new NetError(t._url,t._request,{status:408},"timeout");t._onTimeout&&(r.isTimeout=!0,t._onTimeout(r,{index:t._index,range:t._range,vid:t._vid,priOptions:t._priOptions})),r.options={index:t._index,range:t._range,vid:t._vid,priOptions:t._priOptions},t._loadCompleteReject(r)};var i=this._headers||{},n=getRangeValue(e);n&&(i.Range=n),i&&Object.keys(i).forEach((function(e){r.setRequestHeader(e,i[e])})),this._logger.debug("[xhr.send->] tast,",this._range,",load sub range, ",e),r.send(this._body)}catch(e2){e2.options={index:this._index,range:e,vid:this._vid,priOptions:this._priOptions},this._loadCompleteReject(e2)}}},{key:"_onReadyStatechange",value:function(e){2===e.target.readyState&&this._firstRtt<0&&(this._firstRtt=Date.now())}},{key:"_onLoad",value:function(e){var t,r=e.target.status;if(r<200||r>299){var i=new NetError(this._url,null,_objectSpread2$1(_objectSpread2$1({},e.target.response),{},{status:r}),"bad response,status:"+r);return i.options={index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions},this._loadCompleteReject(i)}var n,o=null,a=!1,s=(null===(t=this._range)||void 0===t?void 0:t.length)>0?this._range[0]:0;if(this._responseType===ResponseType.ARRAY_BUFFER){var l,c=new Uint8Array(e.target.response);if(n=s+this._receivedLength,c&&c.byteLength>0){this._receivedLength+=c.byteLength;var u=Date.now()-this._startTime,h=calculateSpeed(this._receivedLength,u);this.emit(EVENT.REAL_TIME_SPEED,{speed:h,len:this._receivedLength,time:u,vid:this._vid,index:this._index,range:[n,s+this._receivedLength],priOptions:this._priOptions})}o=c,a=!((null===(l=this._range)||void 0===l?void 0:l.length)>1&&this._range[1]&&this._receivedLength<this._range[1]-this._range[0]),this._logger.debug("[xhr load done->], tast :",this._range,", start",n,"end ",s+this._receivedLength,",dataLen,",c?c.byteLength:0,",receivedLength",this._receivedLength,",index,",this._index,", done,",a)}else a=!0,o=e.target.response;var d={ok:r>=200&&r<300,status:r,statusText:this._xhr.statusText,url:this._xhr.responseURL,headers:this._getHeaders(this._xhr),body:this._xhr.response};this._transformResponse&&(d=this._transformResponse(d,this._url)||d),this._onProgress&&this._onProgress(o,a,{index:this._index,vid:this._vid,range:[n,s+this._receivedLength],startTime:this._startTime,endTime:Date.now(),priOptions:this._priOptions},d),a?(this._runing=!1,this._loadCompleteResolve&&this._loadCompleteResolve(createResponse(this._onProgress?null:o,a,d,d.headers["content-length"],d.headers.age,this._startTime,this._firstRtt,this._index,this._range,this._vid,this._priOptions))):this._startLoad()}},{key:"cancel",value:function(){if(!this._aborted)return this._aborted=!0,this._runing=!1,_get(_getPrototypeOf$1(r.prototype),"removeAllListeners",this).call(this),this._onCancel&&this._onCancel({index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions}),this._xhr?this._xhr.abort():void 0}},{key:"receiveLen",get:function(){return this._receivedLength}},{key:"running",get:function(){return this._running},set:function(e){this._running=e}},{key:"_getHeaders",value:function(e){var t,r={},i=_createForOfIteratorHelper(e.getAllResponseHeaders().trim().split("\r\n"));try{for(i.s();!(t=i.n()).done;){var n=t.value.split(": ");r[n[0].toLowerCase()]=n.slice(1).join(": ")}}catch(o){i.e(o)}finally{i.f()}return r}}],[{key:"isSupported",value:function(){return"undefined"!=typeof XMLHttpRequest}}]),r}(EventEmitter),_excluded=["retry","retryDelay","onRetryError","transformError"],Task=function(){function e(t,r){_classCallCheck$1(this,e),this.promise=createPublicPromise(),this.alive=!!r.onProgress,!r.logger&&(r.logger=new Logger("Loader")),this._loaderType=t,this._loader=t===LoaderType.FETCH&&window.fetch?new FetchLoader:new XhrLoader,this._config=r,this._retryCount=0,this._retryTimer=null,this._canceled=!1,this._retryCheckFunc=r.retryCheckFunc,this._logger=r.logger}var t;return _createClass$2(e,[{key:"exec",value:function(){var e=this,t=this._config,r=t.retry,i=t.retryDelay,n=t.onRetryError,o=t.transformError,a=_objectWithoutProperties(t,_excluded),s=function(){var t=_asyncToGenerator(_regeneratorRuntime().mark((function t(){var l,c,u;return _regeneratorRuntime().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e._loader.load(a);case 3:l=t.sent,e.promise.resolve(l),t.next=27;break;case 7:if(t.prev=7,t.t0=t.catch(0),e._loader.running=!1,e._logger.debug("[task request catch err]",t.t0),!e._canceled){t.next=13;break}return t.abrupt("return");case 13:if(t.t0.loaderType=e._loaderType,t.t0.retryCount=e._retryCount,c=t.t0,o&&(c=o(c)||c),n&&e._retryCount>0&&n(c,e._retryCount,{index:a.index,vid:a.vid,range:a.range,priOptions:a.priOptions}),e._retryCount++,u=!0,e._retryCheckFunc&&(u=e._retryCheckFunc(t.t0)),!(u&&e._retryCount<=r)){t.next=26;break}return clearTimeout(e._retryTimer),e._logger.debug("[task request setTimeout],retry",e._retryCount,",retry range,",a.range),e._retryTimer=setTimeout(s,i),t.abrupt("return");case 26:e.promise.reject(c);case 27:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(){return t.apply(this,arguments)}}();return s(),this.promise}},{key:"cancel",value:(t=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return clearTimeout(this._retryTimer),this._canceled=!0,this._loader.running=!1,e.abrupt("return",this._loader.cancel());case 4:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"running",get:function(){return this._loader&&this._loader.running}},{key:"loader",get:function(){return this._loader}}]),e}();function sleep(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(t){return setTimeout(t,e)}))}var NetLoader=function(e){_inherits$1(i,e);var t,r=_createSuper$1(i);function i(e){var t;return _classCallCheck$1(this,i),_defineProperty$2(_assertThisInitialized$1(t=r.call(this,e)),"type",LoaderType.FETCH),_defineProperty$2(_assertThisInitialized$1(t),"_queue",[]),_defineProperty$2(_assertThisInitialized$1(t),"_alive",[]),_defineProperty$2(_assertThisInitialized$1(t),"_currentTask",null),_defineProperty$2(_assertThisInitialized$1(t),"_config",void 0),t._config=getConfig(e),t._config.loaderType!==LoaderType.XHR&&FetchLoader.isSupported()||(t.type=LoaderType.XHR),t.log=e.logger,t}return _createClass$2(i,[{key:"isFetch",value:function(){return this.type===LoaderType.FETCH}},{key:"load",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"string"!=typeof e&&e?r=e:r.url=e||r.url||this._config.url,(r=Object.assign({},this._config,r)).params&&(r.params=Object.assign({},r.params)),r.headers&&isPlainObject(r.headers)&&(r.headers=Object.assign({},r.headers)),r.body&&isPlainObject(r.body)&&(r.body=Object.assign({},r.body)),r.transformRequest&&(r=r.transformRequest(r)||r),r.logger=this.log;var i=new Task(this.type,r);return i.loader.on(EVENT.REAL_TIME_SPEED,(function(e){t.emit(EVENT.REAL_TIME_SPEED,e)})),this._queue.push(i),1!==this._queue.length||this._currentTask&&this._currentTask.running||this._processTask(),i.promise}},{key:"cancel",value:(t=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this._queue.map((function(e){return e.cancel()})).concat(this._alive.map((function(e){return e.cancel()}))),this._currentTask&&t.push(this._currentTask.cancel()),this._queue=[],this._alive=[],e.next=6,Promise.all(t);case 6:return e.next=8,sleep();case 8:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"_processTask",value:function(){var e=this;if(this._currentTask=this._queue.shift(),this._currentTask){this._currentTask.alive&&this._alive.push(this._currentTask);var t=this._currentTask.exec().catch((function(e){}));t&&"function"==typeof t.finally&&t.finally((function(){var t,r;null!==(t=e._currentTask)&&void 0!==t&&t.alive&&(null===(r=e._alive)||void 0===r?void 0:r.length)>0&&(e._alive=e._alive.filter((function(t){return t&&t!==e._currentTask}))),e._processTask()}))}}}],[{key:"isFetchSupport",value:function(){return FetchLoader.isSupported()}}]),i}(EventEmitter),EXTEND_EVENTS={RTC_STATE_CHANGE:"core.rtcstatechange"},lib={},parser$1={},grammar$2={exports:{}},grammar$1=grammar$2.exports={v:[{name:"version",reg:/^(\d*)$/}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:["username","sessionId","sessionVersion","netType","ipVer","address"],format:"%s %s %d %s IP%d %s"}],s:[{name:"name"}],i:[{name:"description"}],u:[{name:"uri"}],e:[{name:"email"}],p:[{name:"phone"}],z:[{name:"timezones"}],r:[{name:"repeats"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,names:["start","stop"],format:"%d %d"}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,names:["version","ip"],format:"IN IP%d %s"}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:["type","limit"],format:"%s:%s"}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],format:function(e){return e.encoding?"rtpmap:%d %s/%s/%s":e.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,format:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],format:function(e){return null!=e.address?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],format:"rtcp-fb:%s trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],format:function(e){return null!=e.subtype?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:["value","direction","encrypt-uri","uri","config"],format:function(e){return"extmap:%d"+(e.direction?"/%s":"%v")+(e["encrypt-uri"]?" %s":"%v")+" %s"+(e.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(e){return null!=e.sessionConfig?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,format:"setup:%s"},{name:"connectionType",reg:/^connection:(new|existing)/,format:"connection:%s"},{name:"mid",reg:/^mid:([^\s]*)/,format:"mid:%s"},{name:"msid",reg:/^msid:(.*)/,format:"msid:%s"},{name:"ptime",reg:/^ptime:(\d*(?:\.\d*)*)/,format:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*(?:\.\d*)*)/,format:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:"icelite",reg:/^(ice-lite)/},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,format:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,format:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],format:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],format:function(e){var t="candidate:%s %d %s %d %s %d typ %s";return t+=null!=e.raddr?" raddr %s rport %d":"%v%v",t+=null!=e.tcptype?" tcptype %s":"%v",null!=e.generation&&(t+=" generation %d"),t+=null!=e["network-id"]?" network-id %d":"%v",t+=null!=e["network-cost"]?" network-cost %d":"%v"}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],format:function(e){var t="ssrc:%d";return null!=e.attribute&&(t+=" %s",null!=e.value&&(t+=":%s")),t}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],format:function(e){return null!=e.maxMessageSize?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,format:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],format:function(e){return e.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],format:function(e){return"imageattr:%s %s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),names:["dir1","list1","dir2","list2"],format:function(e){return"simulcast:%s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],format:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,format:"framerate:%s"},{name:"sourceFilter",reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:["filterMode","netType","addressTypes","destAddress","srcList"],format:"source-filter: %s %s %s %s %s"},{name:"bundleOnly",reg:/^(bundle-only)/},{name:"label",reg:/^label:(.+)/,format:"label:%s"},{name:"sctpPort",reg:/^sctp-port:(\d+)$/,format:"sctp-port:%s"},{name:"maxMessageSize",reg:/^max-message-size:(\d+)$/,format:"max-message-size:%s"},{push:"tsRefClocks",reg:/^ts-refclk:([^\s=]*)(?:=(\S*))?/,names:["clksrc","clksrcExt"],format:function(e){return"ts-refclk:%s"+(null!=e.clksrcExt?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(e){var t="mediaclk:";return t+=null!=e.id?"id=%s %s":"%v%s",t+=null!=e.mediaClockValue?"=%s":"",t+=null!=e.rateNumerator?" rate=%s":"",t+=null!=e.rateDenominator?"/%s":""}},{name:"keywords",reg:/^keywds:(.+)$/,format:"keywds:%s"},{name:"content",reg:/^content:(.+)/,format:"content:%s"},{name:"bfcpFloorCtrl",reg:/^floorctrl:(c-only|s-only|c-s)/,format:"floorctrl:%s"},{name:"bfcpConfId",reg:/^confid:(\d+)/,format:"confid:%s"},{name:"bfcpUserId",reg:/^userid:(\d+)/,format:"userid:%s"},{name:"bfcpFloorId",reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:["id","mStream"],format:"floorid:%s mstrm:%s"},{push:"invalid",names:["value"]}]};Object.keys(grammar$1).forEach((function(e){grammar$1[e].forEach((function(e){e.reg||(e.reg=/(.*)/),e.format||(e.format="%s")}))})),function(e){var t=function(e){return String(Number(e))===e?Number(e):e},r=function(e,r,i){var n=e.name&&e.names;e.push&&!r[e.push]?r[e.push]=[]:n&&!r[e.name]&&(r[e.name]={});var o=e.push?{}:n?r[e.name]:r;!function(e,r,i,n){if(n&&!i)r[n]=t(e[1]);else for(var o=0;o<i.length;o+=1)null!=e[o+1]&&(r[i[o]]=t(e[o+1]))}(i.match(e.reg),o,e.names,e.name),e.push&&r[e.push].push(o)},i=grammar$2.exports,n=RegExp.prototype.test.bind(/^([a-z])=(.*)/);e.parse=function(e){var t={},o=[],a=t;return e.split(/(\r\n|\r|\n)/).filter(n).forEach((function(e){var t=e[0],n=e.slice(2);"m"===t&&(o.push({rtp:[],fmtp:[]}),a=o[o.length-1]);for(var s=0;s<(i[t]||[]).length;s+=1){var l=i[t][s];if(l.reg.test(n))return r(l,a,n)}})),t.media=o,t};var o=function(e,r){var i=r.split(/=(.+)/,2);return 2===i.length?e[i[0]]=t(i[1]):1===i.length&&r.length>1&&(e[i[0]]=void 0),e};e.parseParams=function(e){return e.split(/;\s?/).reduce(o,{})},e.parseFmtpConfig=e.parseParams,e.parsePayloads=function(e){return e.toString().split(" ").map(Number)},e.parseRemoteCandidates=function(e){for(var r=[],i=e.split(" ").map(t),n=0;n<i.length;n+=3)r.push({component:i[n],ip:i[n+1],port:i[n+2]});return r},e.parseImageAttributes=function(e){return e.split(" ").map((function(e){return e.substring(1,e.length-1).split(",").reduce(o,{})}))},e.parseSimulcastStreamList=function(e){return e.split(";").map((function(e){return e.split(",").map((function(e){var r,i=!1;return"~"!==e[0]?r=t(e):(r=t(e.substring(1,e.length)),i=!0),{scid:r,paused:i}}))}))}}(parser$1);var grammar=grammar$2.exports,formatRegExp=/%[sdv%]/g,format=function(e){var t=1,r=arguments,i=r.length;return e.replace(formatRegExp,(function(e){if(t>=i)return e;var n=r[t];switch(t+=1,e){case"%%":return"%";case"%s":return String(n);case"%d":return Number(n);case"%v":return""}}))},makeLine=function(e,t,r){var i=[e+"="+(t.format instanceof Function?t.format(t.push?r:r[t.name]):t.format)];if(t.names)for(var n=0;n<t.names.length;n+=1){var o=t.names[n];t.name?i.push(r[t.name][o]):i.push(r[t.names[n]])}else i.push(r[t.name]);return format.apply(null,i)},defaultOuterOrder=["v","o","s","i","u","e","p","c","b","t","r","z","a"],defaultInnerOrder=["i","c","b","a"],writer$1=function(e,t){t=t||{},null==e.version&&(e.version=0),null==e.name&&(e.name=" "),e.media.forEach((function(e){null==e.payloads&&(e.payloads="")}));var r=t.outerOrder||defaultOuterOrder,i=t.innerOrder||defaultInnerOrder,n=[];return r.forEach((function(t){grammar[t].forEach((function(r){r.name in e&&null!=e[r.name]?n.push(makeLine(t,r,e)):r.push in e&&null!=e[r.push]&&e[r.push].forEach((function(e){n.push(makeLine(t,r,e))}))}))})),e.media.forEach((function(e){n.push(makeLine("m",grammar.m[0],e)),i.forEach((function(t){grammar[t].forEach((function(r){r.name in e&&null!=e[r.name]?n.push(makeLine(t,r,e)):r.push in e&&null!=e[r.push]&&e[r.push].forEach((function(e){n.push(makeLine(t,r,e))}))}))}))})),n.join("\r\n")+"\r\n"},parser=parser$1,writer=writer$1;function getOption(e){return _objectSpread2$2({retryCount:0,retryDelay:1e3,loadTimeout:5e3,stallInterval:400,delayHint:0},e)}function _getStats(e){var t=[];return e.forEach((function(e){"inbound-rtp"===e.type&&t.push(e)})),t.map((function(t){var r=e.get(t.codecId),i=e.get(t.trackId);return{type:t.mediaType,inboundRtp:t,codec:r,track:i}}))}function getStats(e){return new Promise((function(t){var r;null===(r=e.getStats(null))||void 0===r||r.then((function(e){t(_getStats(e))}))})).catch((function(){}))}function getStatsSnapshoot(e){var t,r,i,n,o,a,s,l,c,u,h,d,p,f,g,y,v,m,_,b,T,S,E,$,C,P,w,O,k,I=null==e?void 0:e.filter((function(e){return"video"===e.type}))[0],A=null==e?void 0:e.filter((function(e){return"audio"===e.type}))[0];return{video:I?{codec:null===(t=I.codec)||void 0===t?void 0:t.mimeType,payloadType:null===(r=I.codec)||void 0===r?void 0:r.payloadType,sdpFmtpLine:null===(i=I.codec)||void 0===i?void 0:i.sdpFmtpLine,bytesReceived:null===(n=I.inboundRtp)||void 0===n?void 0:n.bytesReceived,firCount:null===(o=I.inboundRtp)||void 0===o?void 0:o.firCount,pliCount:null===(a=I.inboundRtp)||void 0===a?void 0:a.pliCount,frameHeight:null===(s=I.inboundRtp)||void 0===s?void 0:s.frameHeight,frameWidth:null===(l=I.inboundRtp)||void 0===l?void 0:l.frameWidth,framesDecoded:null===(c=I.inboundRtp)||void 0===c?void 0:c.framesDecoded,framesDropped:null===(u=I.inboundRtp)||void 0===u?void 0:u.framesDropped,framesPerSecond:null===(h=I.inboundRtp)||void 0===h?void 0:h.framesPerSecond,framesReceived:null===(d=I.inboundRtp)||void 0===d?void 0:d.framesReceived,jitter:null===(p=I.inboundRtp)||void 0===p?void 0:p.jitter,jitterBufferDelay:null===(f=I.inboundRtp)||void 0===f?void 0:f.jitterBufferDelay,keyFramesDecoded:null===(g=I.inboundRtp)||void 0===g?void 0:g.keyFramesDecoded,nackCount:null===(y=I.inboundRtp)||void 0===y?void 0:y.nackCount,packetsLost:null===(v=I.inboundRtp)||void 0===v?void 0:v.packetsLost,packetsReceived:null===(m=I.inboundRtp)||void 0===m?void 0:m.packetsReceived}:void 0,audio:A?{codec:null===(_=A.codec)||void 0===_?void 0:_.mimeType,payloadType:null===(b=A.codec)||void 0===b?void 0:b.payloadType,sdpFmtpLine:null===(T=A.codec)||void 0===T?void 0:T.sdpFmtpLine,bytesReceived:null===(S=A.inboundRtp)||void 0===S?void 0:S.bytesReceived,audioLevel:null===(E=A.inboundRtp)||void 0===E?void 0:E.audioLevel,jitter:null===($=A.inboundRtp)||void 0===$?void 0:$.jitter,jitterBufferDelay:null===(C=A.inboundRtp)||void 0===C?void 0:C.jitterBufferDelay,packetsLost:null===(P=A.inboundRtp)||void 0===P?void 0:P.packetsLost,packetsReceived:null===(w=A.inboundRtp)||void 0===w?void 0:w.packetsReceived,totalSamplesDuration:null===(O=A.inboundRtp)||void 0===O?void 0:O.totalSamplesDuration,totalSamplesReceived:null===(k=A.inboundRtp)||void 0===k?void 0:k.totalSamplesReceived}:void 0}}lib.write=writer,lib.parse=parser.parse,lib.parseParams=parser.parseParams,lib.parseFmtpConfig=parser.parseFmtpConfig,lib.parsePayloads=parser.parsePayloads,lib.parseRemoteCandidates=parser.parseRemoteCandidates,lib.parseImageAttributes=parser.parseImageAttributes,lib.parseSimulcastStreamList=parser.parseSimulcastStreamList;var logger=new Logger("rts"),Rts=function(e){_inherits$2(n,e);var t,r,i=_createSuper$2(n);function n(e){var t;return _classCallCheck$2(this,n),_defineProperty$3(_assertThisInitialized$2(t=i.call(this)),"_url",""),_defineProperty$3(_assertThisInitialized$2(t),"_pc",null),_defineProperty$3(_assertThisInitialized$2(t),"_audioTransceicer",null),_defineProperty$3(_assertThisInitialized$2(t),"_videoTransceicer",null),_defineProperty$3(_assertThisInitialized$2(t),"_mediaStream",null),_defineProperty$3(_assertThisInitialized$2(t),"_media",null),_defineProperty$3(_assertThisInitialized$2(t),"_opts",null),_defineProperty$3(_assertThisInitialized$2(t),"_loader",null),_defineProperty$3(_assertThisInitialized$2(t),"_retry",0),_defineProperty$3(_assertThisInitialized$2(t),"_waitingTimer",0),_defineProperty$3(_assertThisInitialized$2(t),"_rctConnectStartTs",0),_defineProperty$3(_assertThisInitialized$2(t),"_onTrack",(function(e){if(logger.log("addTrack: ",e.track,e.streams),t["_".concat(e.track.kind)]=e.track,!t._mediaStream){t._mediaStream=new MediaStream,t._media.srcObject=t._mediaStream;var r=t._media.play();r&&r.catch&&r.catch((function(e){}))}t._mediaStream.addTrack(e.track)})),_defineProperty$3(_assertThisInitialized$2(t),"_mockWaitingByTimeupdate",(function(){var e,r;"connected"!==(null===(e=t._pc)||void 0===e?void 0:e.connectionState)&&"connected"!==(null===(r=t._pc)||void 0===r?void 0:r.iceConnectionState)||(clearTimeout(t._waitingTimer),t._waitingTimer=setTimeout((function(){var e;null!==(e=t._media)&&void 0!==e&&e.paused||t.emit("waiting")}),t._opts.stallInterval))})),_defineProperty$3(_assertThisInitialized$2(t),"_onLoadedData",(function(){logger.log("loadeddata emit"),t.getStatsSnapshoot().then((function(e){t.emit(EVENT.METADATA_PARSED,{type:"video",elapsed:Date.now()-t._rctConnectStartTs,meta:e.video}),t.emit(EVENT.METADATA_PARSED,{type:"audio",elapsed:Date.now()-t._rctConnectStartTs,meta:e.audio})}))})),_defineProperty$3(_assertThisInitialized$2(t),"_onLoaderRetry",(function(e,r){t.emit(EVENT.LOAD_RETRY,{error:StreamingError.network(e),retryTime:r})})),t._opts=getOption(e),t._media=t._opts.media,t._loader=new NetLoader(_objectSpread2$2(_objectSpread2$2({},e.fetchOptions),{},{responseType:"json",method:"POST",retry:t._opts.retryCount,retryDelay:t._opts.retryDelay,timeout:t._opts.loadTimeout,onRetryError:t._onLoaderRetry,logger:logger})),t._retry=t._opts.retryCount,t._bindMediaEvent(),t}return _createClass$3(n,[{key:"pc",get:function(){return this._pc}},{key:"audioTrack",get:function(){return this._audio}},{key:"videoTack",get:function(){return this._video}},{key:"getStats",value:function(){return getStats(this._pc)}},{key:"getStatsSnapshoot",value:function(){return this.getStats().then((function(e){return getStatsSnapshoot(e)}))}},{key:"load",value:(r=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(t){var r,i=this;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._disconnect(),this._url=t,this._retry=this._opts.retryCount,r=this._pc,e.prev=4,this._pc=new RTCPeerConnection,this._bindRTCEvents(),e.next=9,this._connect(t);case 9:r&&r.close(),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(4),setTimeout((function(){return i._emitError(StreamingError.create(ERR.OTHER,null,e.t0))}));case 15:case"end":return e.stop()}}),e,this,[[4,12]])}))),function(e){return r.apply(this,arguments)})},{key:"switchURL",value:function(e){this.load(e||this._url)}},{key:"_bindRTCEvents",value:function(){var e=this,t=this._pc;t.addEventListener("track",this._onTrack),t.addEventListener("connectionstatechange",(function(){if(logger.warn("onconnectionstatechange:",t.connectionState),e.emit(EXTEND_EVENTS.RTC_STATE_CHANGE,{state:t.connectionState,url:e._url}),"disconnected"!==t.connectionState&&"failed"!==t.connectionState||e.emit("waiting"),"failed"===t.connectionState){if(0===e._retry)return void e._emitError(StreamingError.network(new Error("rtc connect failed")));e._retry--,e.load(e._url)}"connected"===t.connectionState&&e.emit(EVENT.TTFB,{url:e._url,responseUrl:e._url,elapsed:Date.now()-e._rctConnectStartTs})}))}},{key:"_bindMediaEvent",value:function(){this._media.addEventListener("timeupdate",this._mockWaitingByTimeupdate),this._media.addEventListener("loadeddata",this._onLoadedData)}},{key:"_connect",value:(t=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(){var t,r,i,n,o,a,s,l,c,u;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=this._pc).addTransceiver){e.next=11;break}return this._audioTransceicer=t.addTransceiver("audio",{direction:"recvonly"}),this._videoTransceicer=t.addTransceiver("video",{direction:"recvonly"}),(i=this._opts.delayHint)&&(this._audioTransceicer.receiver.playoutDelayHint=i,this._audioTransceicer.receiver.jitterBufferDelayHint=i,this._videoTransceicer.receiver.playoutDelayHint=i,this._videoTransceicer.receiver.jitterBufferDelayHint=i),e.next=8,t.createOffer();case 8:r=e.sent,e.next=14;break;case 11:return e.next=13,t.createOffer({iceRestart:!0,offerToReceiveAudio:!0,offerToReceiveVideo:!0});case 13:r=e.sent;case 14:return logger.log("local offer"),logger.log(r.sdp),(n=lib.parse(r.sdp)).media.filter((function(e){return"audio"===e.type})).forEach((function(e){var t,r=null===(t=e.rtp.filter((function(e){return"opus"===e.codec}))[0])||void 0===t?void 0:t.payload;r&&e.fmtp.forEach((function(e){e.payload===r&&(e.config="minptime=10;stereo=1;useinbandfec=1")}))})),r.sdp=lib.write(n),logger.log("local offer modified:\n",r.sdp),e.next=22,t.setLocalDescription(r);case 22:return e.prev=22,a=/_?session_id=([^&$]+)/.exec(this._url),s=a?a[1]:Date.now()+"",this.emit(EVENT.LOAD_START,{url:this._url}),this._rctConnectStartTs=Date.now(),e.next=29,this._loader.load(this._url,{body:JSON.stringify({sessionId:s,version:"1.0-html",localSdp:r})});case 29:if(l=e.sent,this.emit(EVENT.LOAD_RESPONSE_HEADERS,{headers:l.response.headers}),200===(null==(c=null==l?void 0:l.data)?void 0:c.code)){e.next=34;break}throw new Error("code: ".concat(null==c?void 0:c.code,", message:").concat(null==c?void 0:c.message));case 34:return logger.log("answer:"),logger.log(null===(o=c.remoteSdp)||void 0===o?void 0:o.sdp),(u=lib.parse(c.remoteSdp.sdp)).media.forEach((function(e){e.fingerprint.hash=e.fingerprint.hash.toUpperCase()})),c.remoteSdp.sdp=lib.write(u),logger.log("answer modified:\n",c.remoteSdp.sdp),e.next=42,this._pc.setRemoteDescription(c.remoteSdp);case 42:e.next=47;break;case 44:e.prev=44,e.t0=e.catch(22),this._emitError(StreamingError.network(e.t0));case 47:case"end":return e.stop()}}),e,this,[[22,44]])}))),function(){return t.apply(this,arguments)})},{key:"_disconnect",value:function(){this._audioTransceicer=null,this._videoTransceicer=null,this._mediaStream=null}},{key:"_emitError",value:function(e){this.emit(EVENT.ERROR,e)}},{key:"destroy",value:function(){var e;this._disconnect(),null===(e=this._media)||void 0===e||e.removeEventListener("timeupdate",this._mockWaitingByTimeupdate),this._media&&(this._media.srcObject=null),this._pc&&this._pc.close(),this._loader=null,this._media=null,this._pc=null}}],[{key:"enableLogger",value:function(){Logger.enable()}},{key:"disableLogger",value:function(){Logger.disable()}}]),n}(EventEmitter);try{localStorage.getItem("xgd")?Rts.enableLogger():Rts.disableLogger()}catch(error){}function isSupported(){return!(!window.RTCPeerConnection||!window.RTCPeerConnection.prototype.addTransceiver)}function getCapacity(){if(!isSupported())return Promise.reject("RTCPeerConnection no support");var e;try{(e=new RTCPeerConnection).addTransceiver("video",{direction:"recvonly"}),e.addTransceiver("audio",{direction:"recvonly"})}catch(e2){return Promise.reject(null==e2?void 0:e2.message)}return e.createOffer().then((function(t){var r,i,n,o;logger.log(t.sdp);var a=lib.parse(t.sdp),s=null===(r=a.media)||void 0===r?void 0:r.filter((function(e){return"video"===e.type}))[0],l=null===(i=a.media)||void 0===i?void 0:i.filter((function(e){return"audio"===e.type}))[0],c=null==s||null===(n=s.rtp)||void 0===n?void 0:n.filter((function(e){return"VP8"===e.codec||"VP9"===e.codec||"H264"===e.codec})),u=null==l||null===(o=l.rtp)||void 0===o?void 0:o.filter((function(e){return"opus"===e.codec})),h=null==s?void 0:s.fmtp,d=null==l?void 0:l.fmtp;return h&&c.map((function(e){var t;e.config=null===(t=h.filter((function(t){return t.payload===e.payload}))[0])||void 0===t?void 0:t.config})),d&&u.map((function(e){var t;e.config=null===(t=d.filter((function(t){return t.payload===e.payload}))[0])||void 0===t?void 0:t.config})),e.close(),{video:c,audio:u}}))}var RtsPlugin=function(e){_inherits$2(i,e);var t,r=_createSuper$2(i);function i(){var e;_classCallCheck$2(this,i);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return _defineProperty$3(_assertThisInitialized$2(e=r.call.apply(r,[this].concat(n))),"_rts",null),_defineProperty$3(_assertThisInitialized$2(e),"_rtsOpts",null),_defineProperty$3(_assertThisInitialized$2(e),"_init",(function(){var t;null===(t=e._rts)||void 0===t||t.destroy();var r=e.player.config,i=r.rts||{};e._rtsOpts=i,e._rts=new Rts(_objectSpread2$2({media:e.player.video},i)),e._rts.load(r.url)})),_defineProperty$3(_assertThisInitialized$2(e),"_onSwitchURL",(function(t){e._rts&&(e.player.config.url=t,e._rts.switchURL(t))})),e}return _createClass$3(i,[{key:"pc",get:function(){var e;return null===(e=this._rts)||void 0===e?void 0:e.pc}},{key:"videoTrack",get:function(){var e;return null===(e=this._rts)||void 0===e?void 0:e.videoTack}},{key:"audioTrack",get:function(){var e;return null===(e=this._rts)||void 0===e?void 0:e.audioTrack}},{key:"core",get:function(){return this._rts}},{key:"version",get:function(){return"0.1.13"}},{key:"beforePlayerInit",value:function(){var e,t=this;this._init(),this.player.switchURL=this._onSwitchURL,null===(e=this.player)||void 0===e||e.useHooks("replay",(function(){var e;return null===(e=t._rts)||void 0===e?void 0:e.switchURL()})),this.on(URL_CHANGE,this._onSwitchURL),this.on(DESTROY,this.destroy),this._transErrorEvent(),this._transCoreEvent(EVENT.LOAD_START),this._transCoreEvent(EVENT.TTFB),this._transCoreEvent(EVENT.LOAD_RESPONSE_HEADERS),this._transCoreEvent(EVENT.LOAD_RETRY),this._transCoreEvent(EVENT.METADATA_PARSED),this._transCoreEvent(EXTEND_EVENTS.RTC_STATE_CHANGE);try{BasePlugin.defineGetterOrSetter(this.player,{__url:{get:function(){try{return URL.createObjectURL(new MediaSource)}catch(e2){var e,r;null!==(e=t.player)&&void 0!==e&&null!==(r=e.video)&&void 0!==r&&r.srcObject||(t.player.video.srcObject=new MediaStream)}}}})}catch(e2){}}},{key:"getStats",value:function(){var e;return null===(e=this._rts)||void 0===e?void 0:e.getStats()}},{key:"getStatsSnapshoot",value:function(){var e;return null===(e=this._rts)||void 0===e?void 0:e.getStatsSnapshoot()}},{key:"_transErrorEvent",value:function(){var e=this;this._rts.on(EVENT.ERROR,(function(t){if(e.player){var r=new Errors(e.player,t),i=e._rtsOpts,n=i.backupConstruct,o=i.backupURL;if(o){var a,s=e.player;s.emit("core_event",_objectSpread2$2(_objectSpread2$2({},{url:s.config.url,code:r.errorCode,message:r.message,httpCode:r.httpCode}),{},{eventName:"core.degrade"})),s.emit("degrade",{url:s.config.url,code:r.errorCode,message:r.message,httpCode:r.httpCode}),s.unRegisterPlugin("rts"),e._rts=null,s.rts=null,null!==(a=s.video)&&void 0!==a&&a.srcObject&&(s.video.srcObject=null),s.config.url=o,n?s.registerPlugin(n).beforePlayerInit():s.video.src=o}else e.player.emit(ERROR$1,r)}})),this._rts.on("waiting",(function(){var t;null===(t=e.player)||void 0===t||t.emit("waiting")}))}},{key:"_transCoreEvent",value:function(e){var t=this;this._rts.on(e,(function(r){t.player&&t.player.emit("core_event",_objectSpread2$2(_objectSpread2$2({},r),{},{eventName:e}))}))}},{key:"destroy",value:function(){var e;null===(e=this._rts)||void 0===e||e.destroy()}}],[{key:"pluginName",get:function(){return"rts"}},{key:"isSupported",value:function(){return isSupported()}},{key:"getCapacity",value:function(){return getCapacity()}},{key:"isSupportedH264",value:(t=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(t){var r,n,o,a,s;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,i.getCapacity();case 3:if(n=e.sent,o=null===(r=n.video)||void 0===r?void 0:r.filter((function(e){return"H264"===e.codec&&(!t||-1!==e.config.indexOf(t))})).length){e.next=10;break}return e.next=8,i.getCapacity();case 8:s=e.sent,o=null===(a=s.video)||void 0===a?void 0:a.filter((function(e){return"H264"===e.codec&&(!t||-1!==e.config.indexOf(t))})).length;case 10:return e.abrupt("return",!!o);case 13:return e.prev=13,e.t0=e.catch(0),e.abrupt("return",!1);case 16:case"end":return e.stop()}}),e,null,[[0,13]])}))),function(e){return t.apply(this,arguments)})}]),i}(BasePlugin);function apply$2(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var nativeMax$1=Math.max;function overRest(e,t,r){return t=nativeMax$1(void 0===t?e.length-1:t,0),function(){for(var i=arguments,n=-1,o=nativeMax$1(i.length-t,0),a=Array(o);++n<o;)a[n]=i[t+n];n=-1;for(var s=Array(t+1);++n<t;)s[n]=i[n];return s[t]=r(a),apply$2(e,this,s)}}function constant(e){return function(){return e}}var baseSetToString=defineProperty$f?function(e,t){return defineProperty$f(e,"toString",{configurable:!0,enumerable:!1,value:constant(t),writable:!0})}:identity,baseSetToString$1=baseSetToString,HOT_COUNT=800,HOT_SPAN=16,nativeNow=Date.now;function shortOut(e){var t=0,r=0;return function(){var i=nativeNow(),n=HOT_SPAN-(i-r);if(r=i,n>0){if(++t>=HOT_COUNT)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var setToString=shortOut(baseSetToString$1),setToString$1=setToString;function baseRest(e,t){return setToString$1(overRest(e,t,identity),e+"")}function isIterateeCall(e,t,r){if(!isObject$n(r))return!1;var i=_typeof$4(t);return!!("number"==i?isArrayLike(r)&&isIndex(t,r.length):"string"==i&&t in r)&&eq(r[t],e)}function createAssigner(e){return baseRest((function(t,r){var i=-1,n=r.length,o=n>1?r[n-1]:void 0,a=n>2?r[2]:void 0;for(o=e.length>3&&"function"==typeof o?(n--,o):void 0,a&&isIterateeCall(r[0],r[1],a)&&(o=n<3?void 0:o,n=1),t=Object(t);++i<n;){var s=r[i];s&&e(t,s,i,o)}return t}))}var objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,assign=createAssigner((function(e,t){if(isPrototype(t)||isArrayLike(t))copyObject(t,keys$4(t),e);else for(var r in t)hasOwnProperty.call(t,r)&&assignValue(e,r,t[r])})),assign$1=assign,RtmPlugin=function(e){_inherits$5(r,e);var t=_createSuper$5(r);function r(){return _classCallCheck$5(this,r),t.apply(this,arguments)}return _createClass$6(r,[{key:"beforeCreate",value:function(e){var t=(e.player.config.rtm||{}).backupStreamType,r={flv:window.FlvPlayer,hls:window.HlsPlayer};e.player.config.rts=assign$1({},e.player.config.rtm,{backupConstruct:r[t]})}},{key:"afterCreate",value:function(){var e=this.player;e.on("degrade",(function(){e.unRegisterPlugin("rtm")}))}}],[{key:"pluginName",get:function(){return"rtm"}}]),r}(RtsPlugin),SDKEvents=function(e){return e.PLAYER_CREATED_FINISH="player_create_finish",e.PLAYER_REBUILD="player_rebuild",e.NOT_SUPPORT_HARDWARE_DECODER="not_support_hardware_decoder",e.NOT_SUPPORT_SOFT_DECODER="not_support_soft_decoder",e.TOKEN_EXPIRED="playAuthToken_expired",e.UMD_LOAD_FAIL="umd_load_fail",e}(SDKEvents||{}),PluginEvents=function(e){return e.DANMU_CHANGE="danmu_change",e.TIME_SHIFT_CHANGE="time_shift_change",e.AI_SUBTITLE_LANG_CHANGE="ai_subtitle_lang_change",e.AI_SUBTITLE_MATCH="ai_subtitle_match",e.CANCEL_UNMUTE="cancel_unmute",e.REFRESH_CLICK="refresh_click",e.PLAY_BACKUP_CHANGE="play_backup_change",e.PLAY_BACKUP_CHANGE_FINISH="play_backup_change_finish",e.PLAY_ERROR_BUTTON_CLICK="play_error_button_click",e.PlAY_URL_CHANGE="play_url_change",e.SHOW_PLAY_ERROR="show_play_error",e.PLAYER_EXTEND_BUTTON="player_extend_button",e.LONG_WAITING="long_waiting",e.OFTEN_WAITING="often_waiting",e.DEFINITION_DEMOTE="definition_demote",e.LARKWINDOW_CHANGE="larkWindow_change",e.PANEL_MODE_CHANGE="panel_mode_change",e.INNER_DEFINITION_CHANGE="inner_definition_change",e.LINE_CHANGE="line_change",e.GET_PLAY_URL_ERR="get_play_url_err",e.MEDIA_EXPIRED="MEDIA_EXPIRED",e.MIRROR_CHANGE="mirror_change",e.TIME_SCALE_CHANGE="time_scale_change",e.MUSIC_MODE_CHANGE="music_mode_change",e.MUSIC_CHANGE="music_change",e.MUSIC_LIST_CHANGE="music_list_change",e}(PluginEvents||{}),Event$1=Object.freeze(Object.defineProperty({__proto__:null,SDKEvents:SDKEvents,PluginEvents:PluginEvents},Symbol.toStringTag,{value:"Module"})),CONTROL_ICON_INDEX={sdkDefinitionPlugin:3,DanmuPlugin:3,sdkMultilinePlugin:4,mirrorPlugin:5,Subtitle:6},MultilinePlugin=function(e){_inherits$5(r,e);var t=_createSuper$5(r);function r(e){var i;return _classCallCheck$5(this,r),(i=t.call(this,e)).playerData=null,i.playerData=i.playerConfig.playerData,i}return _createClass$6(r,[{key:"beforeCreate",value:function(e){var t=e.player.config.playerData,r=t.getLineList(),i=t.current.lineId;Array.isArray(r)&&r.length>0&&(e.config.list=r.map((function(t){return t.text=e.player.i18n[t.lineTextKey]||t.lineTextKey,t}))),e.config.defaultLine=i}},{key:"afterCreate",value:function(){_get$3(_getPrototypeOf$5(r.prototype),"afterCreate",this).call(this),this.config.list.length<2&&this.hide()}},{key:"afterPlayerInit",value:function(){}},{key:"renderItemList",value:function(){var e=this,t=this.config,i=t.list,n=t.defaultLine,o=0,a=i.map((function(t,r){var i,a={lineId:t.lineId||"",showText:e.i18n[t.lineTextKey]||t.lineTextKey,isCurrent:!1,selected:!1};return util.isUndefined(t.lineId)||(null===(i=t.lineId)||void 0===i?void 0:i.toString())!==(null==n?void 0:n.toString())||(a.isCurrent=!0,a.selected=!0,o=r),a}));_get$3(_getPrototypeOf$5(r.prototype),"renderItemList",this).call(this,a,o)}},{key:"onItemClick",value:function(e,t){this.player.emit(PluginEvents.LINE_CHANGE,{from:this.playerData.current.lineId,to:t.to.lineId}),this.playerData.current.lineId=t.to.lineId,this.player.emit(SDKEvents.PLAYER_REBUILD)}}],[{key:"pluginName",get:function(){return"sdkMultilinePlugin"}},{key:"defaultConfig",get:function(){return{position:Plugin.POSITIONS.CONTROLS_RIGHT,index:CONTROL_ICON_INDEX.sdkMultilinePlugin,list:[],defaultLine:0,className:"xgplayer-multiline",hidePortrait:!1,isShowIcon:!0}}}]),r}(OptionsIcon),DefinitionPlugin=function(e){_inherits$5(r,e);var t=_createSuper$5(r);function r(e){var i;return _classCallCheck$5(this,r),(i=t.call(this,e)).playerData=null,i.toastInfo={},i.canChange=!0,i.playerData=i.playerConfig.playerData,i.dataMonitoring(),i}return _createClass$6(r,[{key:"registerLanguageTexts",value:function(){return{switching:{jp:"に切り替える",en:"Switching to",zh:"正在切换至","zh-hk":"正在切換至"}}}},{key:"beforeCreate",value:function(e){this.toastInfo={},this.canChange=!0;var t=this.getConfig(e.player),r=t.defaultDefinition,i=t.list;e.config.defaultDefinition=r,e.config.list=i}},{key:"getConfig",value:function(e){var t=this,r={list:[],defaultDefinition:""},i=e.config.playerData;this.toastInfo={},this.canChange=!0;var n=i.current,o=n.lineId,a=n.definition,s=i.getDefinitionListByLineId(o);return Array.isArray(s)&&s.length>0&&(r.list=s.map((function(r){return r.text||(r.text=t.getShowText(e.i18n,r)),r}))),r.defaultDefinition=a,r}},{key:"dataMonitoring",value:function(){var e=this;MyProxy$1.subscribeProperty(this.playerData.current,"definition",(function(t,r){if(e.canChange&&t!==r&&e.player){var i=e.config.list,n=(void 0===i?[]:i).find((function(e){return e.definition===r}));n&&n.url&&(e.player.changeDefinition(_objectSpread2$5(_objectSpread2$5({},n),{},{definition:r,url:n.url})),e.player.emit(PluginEvents.INNER_DEFINITION_CHANGE,{from:t,to:r,url:n.url}),e.player.emit(PluginEvents.PlAY_URL_CHANGE,{url:n.url,from:PluginEvents.INNER_DEFINITION_CHANGE}),e.renderItemList(r),e.player.config.isLive&&setTimeout((function(){e.player.ended?e.player.replay():e.player.paused&&e.player.play()}),1e3))}}))}},{key:"showToast",value:function(e){var t,r=this,i=null===(t=this.player)||void 0===t?void 0:t.getPlugin("sdkToastPlugin");if(i){var n=e.showText,o=i.add("".concat(this.langText.switching).concat(n,"..."),0,!0);this.toastInfo[o]={showTime:Date.now(),delayClose:!1},setTimeout((function(){var e;null!==(e=r.toastInfo[o])&&void 0!==e&&e.delayClose&&(i.remove(o),r.toastInfo[o].delayClose=!1)}),2e3),this.player.once(AFTER_DEFINITION_CHANGE,(function(){var e;Date.now()-(null===(e=r.toastInfo[o])||void 0===e?void 0:e.showTime)>2e3?i.remove(o):r.toastInfo[o].delayClose=!0}))}}},{key:"afterCreate",value:function(){_get$3(_getPrototypeOf$5(r.prototype),"afterCreate",this).call(this),this.config.list&&this.config.list.length>0&&(this.config.list.length<2?this.hide():(this.renderItemList(this.config.list),this.show()))}},{key:"afterPlayerInit",value:function(){}},{key:"getShowText",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return e[t.definitionTextKey]||t.definitionTextKey||t.definition}},{key:"renderItemList",value:function(e){var t=this,i=this.config,n=i.list,o=i.defaultDefinition,a=0,s=n.map((function(r,i){var n={url:r.url,definition:r.definition||"",showText:t.getShowText(t.i18n,r),isCurrent:!1,selected:!1},s="string"==typeof e?r.definition===e:r.definition===o;return!util.isUndefined(r.definition)&&s&&(n.isCurrent=!0,n.selected=!0,a=i),n}));_get$3(_getPrototypeOf$5(r.prototype),"renderItemList",this).call(this,s,a)}},{key:"onItemClick",value:function(e,t){this.showToast(t.to),this.playerData.current.definition=t.to.definition}}],[{key:"pluginName",get:function(){return"sdkDefinitionPlugin"}},{key:"defaultConfig",get:function(){return{position:Plugin.POSITIONS.CONTROLS_RIGHT,index:CONTROL_ICON_INDEX.sdkDefinitionPlugin,list:[],defaultDefinition:"",hidePortrait:!1,className:"xgplayer-definition",isShowIcon:!0}}}]),r}(OptionsIcon),UnmutePlugin=function(e){_inherits$5(r,e);var t=_createSuper$5(r);function r(e){var i;return _classCallCheck$5(this,r),(i=t.call(this,e)).state={isSupportAutoplay:!0,showUnmuteBt:!1},i}return _createClass$6(r,[{key:"beforePlayerInit",value:function(){}},{key:"afterPlayerInit",value:function(){}},{key:"afterCreate",value:function(){this.player.autoplay&&this.player.config.autoplayMuted&&this.initEvents()}},{key:"registerLanguageTexts",value:function(){return{unmute:{jp:"ミュートを解除する",en:"Click to unmute",zh:"点击取消静音","zh-hk":"點擊取消靜音"}}}},{key:"updateLang",value:function(){this.renderUnmuteBt()}},{key:"initEvents",value:function(){this.player.once("autoplay_was_prevented",this.handleAutoplayPrevented.bind(this)),this.player.once("autoplay_started",this.handleAutoplayStart.bind(this)),this.player.once("volumechange",this.handleVolumechange.bind(this))}},{key:"handleAutoplayPrevented",value:function(){console.warn("静音自动启播失败"),this.state.isSupportAutoplay=!1,this.player.muted=!1}},{key:"handleAutoplayStart",value:function(){this.state.isSupportAutoplay?(this.state.showUnmuteBt=!0,this.renderUnmuteBt()):this.player.muted=!1}},{key:"handleVolumechange",value:function(){this.state.showUnmuteBt=!1,this.renderUnmuteBt(),this.player.paused&&this.player.readyState>=1&&this.player.play()}},{key:"renderUnmuteBt",value:function(){var e=this.root;if(e&&(e.innerHTML="",this.state.showUnmuteBt)){var t=this.langText.unmute,r=util.createDom("div",t,void 0,"xgplayer-unmute-bt");e.appendChild(r),this.bind(".xgplayer-unmute-bt","click",this.cancelUnmute.bind(this))}}},{key:"cancelUnmute",value:function(){var e,t;this.player.muted=!1,this.state.showUnmuteBt=!1,this.renderUnmuteBt(),"mobile"===sniffer$1.device&&isRtm(null===(e=this.player)||void 0===e||null===(t=e.config)||void 0===t?void 0:t.url)&&(this.player.volume>.5?this.player.volume=this.player.volume-.1:this.player.volume=this.player.volume+.1),this.player.emit(PluginEvents.CANCEL_UNMUTE)}},{key:"destroy",value:function(){this.player.off("autoplay_was_prevented",this.handleAutoplayPrevented.bind(this)),this.player.off("autoplay_started",this.handleAutoplayStart.bind(this)),this.player.off("volumechange",this.handleVolumechange.bind(this))}},{key:"render",value:function(){return'<div class="xgplayer-unmute"></div>'}}],[{key:"pluginName",get:function(){return"sdkUnmutePlugin"}},{key:"defaultConfig",get:function(){return{position:Plugin.POSITIONS.ROOT}}}]),r}(Plugin);function refreshSVG$1(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M10 2.488a7.48 7.48 0 00-4.154 1.253.908.908 0 101.005 1.512 5.695 5.695 0 018.844 4.746h-.908a.33.33 0 00-.264.528l1.816 2.422a.33.33 0 00.529 0l1.815-2.422A.33.33 0 0018.42 10h-.908A7.511 7.511 0 0010 2.49zM2.489 10a7.511 7.511 0 0011.665 6.26.908.908 0 00-1.005-1.513A5.695 5.695 0 014.305 10h.908a.33.33 0 00.264-.528L3.66 7.05a.33.33 0 00-.528 0L1.317 9.47a.33.33 0 00.264.53h.908z" fill="#fff"/></svg>',"image/svg+xml").firstChild}var now=function(){return root$1.Date.now()},now$1=now,reWhitespace=/\s/;function trimmedEndIndex(e){for(var t=e.length;t--&&reWhitespace.test(e.charAt(t)););return t}var reTrimStart=/^\s+/;function baseTrim(e){return e?e.slice(0,trimmedEndIndex(e)+1).replace(reTrimStart,""):e}var NAN=NaN,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt;function toNumber(e){if("number"==typeof e)return e;if(isSymbol$7(e))return NAN;if(isObject$n(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=isObject$n(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=baseTrim(e);var r=reIsBinary.test(e);return r||reIsOctal.test(e)?freeParseInt(e.slice(2),r?2:8):reIsBadHex.test(e)?NAN:+e}var FUNC_ERROR_TEXT$1="Expected a function",nativeMax=Math.max,nativeMin=Math.min;function debounce$1(e,t,r){var i,n,o,a,s,l,c=0,u=!1,h=!1,d=!0;if("function"!=typeof e)throw new TypeError(FUNC_ERROR_TEXT$1);function p(t){var r=i,o=n;return i=n=void 0,c=t,a=e.apply(o,r)}function f(e){return c=e,s=setTimeout(y,t),u?p(e):a}function g(e){var r=e-l;return void 0===l||r>=t||r<0||h&&e-c>=o}function y(){var e=now$1();if(g(e))return v(e);s=setTimeout(y,function(e){var r=t-(e-l);return h?nativeMin(r,o-(e-c)):r}(e))}function v(e){return s=void 0,d&&i?p(e):(i=n=void 0,a)}function m(){var e=now$1(),r=g(e);if(i=arguments,n=this,l=e,r){if(void 0===s)return f(l);if(h)return clearTimeout(s),s=setTimeout(y,t),p(l)}return void 0===s&&(s=setTimeout(y,t)),a}return t=toNumber(t)||0,isObject$n(r)&&(u=!!r.leading,o=(h="maxWait"in r)?nativeMax(toNumber(r.maxWait)||0,t):o,d="trailing"in r?!!r.trailing:d),m.cancel=function(){void 0!==s&&clearTimeout(s),c=0,i=l=n=s=void 0},m.flush=function(){return void 0===s?a:v(now$1())},m}var POSITIONS$9=Plugin.POSITIONS,RefreshPlugin=function(e){_inherits$5(r,e);var t=_createSuper$5(r);function r(){return _classCallCheck$5(this,r),t.apply(this,arguments)}return _createClass$6(r,[{key:"afterCreate",value:function(){this.appendChild(".xgplayer-icon",this.icons.refresh),this.initEvents()}},{key:"registerIcons",value:function(){return{refresh:{icon:refreshSVG$1,class:"xgplayer-refresh-svg"}}}},{key:"registerLanguageTexts",value:function(){return{refresh:{jp:"リフレッシュ",en:"Refresh",zh:"刷新","zh-hk":"刷新"}}}},{key:"initEvents",value:function(){this.handleRefresh=debounce$1(this.handleRefresh.bind(this),200);var e="mobile"===sniffer$1.device?"touchend":"click";this.bind(e,this.handleRefresh),this.show()}},{key:"handleRefresh",value:function(e){var t=this.player;t&&(e.preventDefault(),e.stopPropagation(),t.addClass("xgplayer-is-enter"),t.pause(),t.emit(PluginEvents.REFRESH_CLICK),setTimeout((function(){t&&t.retry(),t.once("canplay",(function(){t.removeClass("xgplayer-is-enter")}))})))}},{key:"destroy",value:function(){this.unbind(["touchend","click"],this.handleRefresh)}},{key:"render",value:function(){return'\n <xg-icon class="xgplayer-refresh">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="refresh">'.concat(this.langText.refresh,"</div>\n </xg-icon>\n ")}}],[{key:"pluginName",get:function(){return"refresh"}},{key:"defaultConfig",get:function(){return{position:POSITIONS$9.CONTROLS_LEFT,index:1}}}]),r}(Plugin);function MoreIconSVG(){return(new DOMParser).parseFromString('<svg width="18" height="18" viewBox="0 0 23 22" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M5.75 11C5.75 11.9665 4.9665 12.75 4 12.75C3.0335 12.75 2.25 11.9665 2.25 11C2.25 10.0335 3.0335 9.25 4 9.25C4.9665 9.25 5.75 10.0335 5.75 11ZM13.25 11C13.25 11.9665 12.4665 12.75 11.5 12.75C10.5335 12.75 9.75 11.9665 9.75 11C9.75 10.0335 10.5335 9.25 11.5 9.25C12.4665 9.25 13.25 10.0335 13.25 11ZM19 12.75C19.9665 12.75 20.75 11.9665 20.75 11C20.75 10.0335 19.9665 9.25 19 9.25C18.0335 9.25 17.25 10.0335 17.25 11C17.25 11.9665 18.0335 12.75 19 12.75Z" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}var MoreButtonPlugin=function(e){_inherits$5(r,e);var t=_createSuper$5(r);function r(e){var i;return _classCallCheck$5(this,r),(i=t.call(this,e)).panel=null,i.panelContainer=null,i}return _createClass$6(r,[{key:"beforePlayerInit",value:function(){}},{key:"afterPlayerInit",value:function(){}},{key:"afterCreate",value:function(){this.renderMoreIcon()}},{key:"updateLang",value:function(e){if(this.panelContainer){var t=this.panelContainer.querySelectorAll(".panel-icon-bt-text"),r=this.getAndSplitList().extraList;t.forEach((function(t){var i,n,o=Number(t.getAttribute("plugin-index"));null!==(i=r[o])&&void 0!==i&&null!==(n=i.textTips)&&void 0!==n&&n[e]&&(t.innerHTML=r[o].textTips[e])}))}}},{key:"registerIcons",value:function(){return{more:{icon:MoreIconSVG,class:"xgplayer-more-svg"}}}},{key:"getAndSplitList",value:function(){var e,t,r,i,n,o=(null!==(e=this.player.config.ignores)&&void 0!==e?e:[]).map((function(e){return e.toLowerCase()})),a=this.config.iconPlugins.filter((function(e){return!o.includes(e.pluginName.toLowerCase())}));return a.length>this.config.maxShowNum+1?(i=a.slice(0,this.config.maxShowNum),n=a.slice(-(a.length-this.config.maxShowNum))):i=_toConsumableArray$1(a),{list:null!==(t=i)&&void 0!==t?t:[],extraList:null!==(r=n)&&void 0!==r?r:[]}}},{key:"children",value:function(){var e=this,t=this.getAndSplitList().list,r={};return t.forEach((function(t){r[t.pluginName]={plugin:t,options:{root:e.root}}})),r}},{key:"renderMoreIcon",value:function(){var e=this,t=this.getAndSplitList().extraList;if(0!==t.length){var r=this.root,i=util.createDom("div","",{},"xgplayer-icon");i.appendChild(this.icons.more),i.addEventListener("click",(function(){e.renderPanel(t)}));var n=util.createDom("xg-icon","",{"data-index":0},"xgplayer-more");n.appendChild(i),r.appendChild(n)}}},{key:"renderPanel",value:function(e){var t=this;this.panelContainer||(this.panelContainer=util.createDom("div","",{},"panel-content"),e.forEach((function(e,r){var i,n,o=util.createDom("div","",{},"panel-icon-bt"),a=util.createDom("div","",{},"panel-icon-svg");o.appendChild(a),t.registerExtraPlugin(e,a);var s="zh-cn"===t.player.lang?"zh":t.player.lang,l=null!==(i=null===(n=e.textTips)||void 0===n?void 0:n[s])&&void 0!==i?i:e.pluginName;o.appendChild(util.createDom("span",l,{"plugin-index":r},"panel-icon-bt-text")),t.panelContainer.appendChild(o)}))),this.player.panel.showPanel(this.panelContainer)}},{key:"registerExtraPlugin",value:function(e,t){this.player.registerPlugin({plugin:e,options:{root:t}})}},{key:"destroy",value:function(){}},{key:"render",value:function(){return'<div class="xgplayer-rightTop-iconList"></div>'}}],[{key:"pluginName",get:function(){return"MoreButtonPlugin"}},{key:"defaultConfig",get:function(){return{position:Plugin.POSITIONS.ROOT_TOP,iconPlugins:[],maxShowNum:2}}}]),r}(Plugin);function ErrorImg(){return(new DOMParser).parseFromString('<svg width="150" height="162" viewBox="0 0 150 162" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M127.718 112.831H6.13675C4.19663 112.831 2.25651 108.974 2.90322 104.475C3.54993 99.9761 8.07687 99.9761 13.8972 99.9761C11.9571 97.4052 9.37028 88.4069 15.8373 81.3369C22.3044 74.2668 25.5379 74.2668 34.5918 75.5526C33.9451 63.9837 47.526 34.4178 77.2744 35.0605C107.023 35.7032 116.077 54.3421 119.957 63.3404C129.011 62.6976 147.765 66.554 149.706 87.1214C151.258 103.575 135.694 111.117 127.718 112.831Z" fill="#F1F4F8"/>\n<path d="M44.9346 91.6022L43.6782 99.8032" stroke="#D0D6E0" stroke-width="2" stroke-linecap="round"/>\n<path d="M47.3545 125.695L48.6109 117.494" stroke="#D0D6E0" stroke-width="2" stroke-linecap="round"/>\n<path d="M31.5347 97.7378L38.7295 101.869" stroke="#D0D6E0" stroke-width="2" stroke-linecap="round"/>\n<path d="M60.7544 119.559L53.5595 115.428" stroke="#D0D6E0" stroke-width="2" stroke-linecap="round"/>\n<path d="M69.6755 44.5318L138.35 26.0209C139.115 25.8148 139.804 26.5367 139.563 27.2909L121.081 85.1146C120.982 85.4243 120.739 85.6665 120.429 85.7641L52.0645 107.28C51.2996 107.521 50.5766 106.809 50.8062 106.04L68.9776 45.2111C69.0768 44.879 69.3409 44.622 69.6755 44.5318Z" fill="#D0D6E0" stroke="#D0D6E0" stroke-width="4" stroke-linecap="round"/>\n<path d="M83.1285 52.7415C91.6454 54.3438 107.322 62.0019 101.894 79.8155" stroke="white" stroke-width="3" stroke-linecap="round"/>\n<path d="M84.138 62.3385C88.3894 63.1384 96.2148 66.9611 93.5053 75.8531" stroke="white" stroke-width="3" stroke-linecap="round"/>\n<ellipse cx="83.6417" cy="71.98" rx="3.08443" ry="3.07025" transform="rotate(12.6375 83.6417 71.98)" fill="white"/>\n<path d="M43.4699 110.358C39.5425 109.114 30.6316 108.203 26.4077 114.511C21.1278 122.397 36.5031 152.755 2.11053 160.141" stroke="#D0D6E0" stroke-width="2" stroke-linecap="round"/>\n</svg>\n',"image/svg+xml").firstChild}var ErrorPlugin=function(e){_inherits$5(r,e);var t=_createSuper$5(r);function r(e){var i;return _classCallCheck$5(this,r),(i=t.call(this,e)).playerData=null,i.state={showError:!1,retryTimes:0,idx:0},i._errDetailList=[],i.playerData=e.player.config.playerData,i}return _createClass$6(r,[{key:"afterCreate",value:function(){var e,t,r;this.initEvents(),this.errNoteMap={other:null!==(e=null===(t=this.i18n.ERROR_TYPES)||void 0===t||null===(r=t.other)||void 0===r?void 0:r.msg)&&void 0!==e?e:"error",1:this.i18n.MEDIA_ERR_ABORTED,2:this.i18n.MEDIA_ERR_NETWORK,3:this.i18n.MEDIA_ERR_DECODE,4:this.i18n.MEDIA_ERR_SRC_NOT_SUPPORTED,2100:this.i18n.NETWORK_ERROR,2101:this.i18n.NETWORK_TIMEOUT,9100:this.i18n.GET_URL_ERR_BY_TOKEN,9101:this.i18n.PLAY_AUTH_TOKEN_EXPIRED,9102:this.i18n.HLS_KEY_TOKEN_EXPIRED,5200:this.i18n.MEDIA_SOURCE_CANNOT_PLAY_TYPE}}},{key:"registerLanguageTexts",value:function(){return{clickButton:{jp:"リフレッシュ",en:"Refresh",zh:"刷新","zh-hk":"刷新"},errorTips:{jp:"再生中にエラーが発生しました。[更新]をクリックして試してください",en:"An error occurred while playing, click refresh to try",zh:"播放发生错误,点击刷新试试吧","zh-hk":"播放發生錯誤,點擊刷新試試吧"}}}},{key:"registerIcons",value:function(){return{errorImg:{icon:ErrorImg,class:"xgplayer-error-svg"}}}},{key:"updateLang",value:function(){if(this.$errorDom){var e=this.$errorDom.querySelector(".xgplayer-error-tips");if(e){var t,r,i=null!==(t=null===(r=this.config.errorTipsText)||void 0===r?void 0:r[this.lang])&&void 0!==t?t:this.langText.errorTips;e.innerHTML=i}var n=this.$errorDom.querySelector(".xgplayer-error-button");n&&(n.innerHTML=this.langText.clickButton)}}},{key:"initEvents",value:function(){this.player.on(ERROR$1,this.handleError.bind(this)),this.playerData.isLive&&(this.player.on(ENDED,this.handleEnd.bind(this)),this.player.on(PluginEvents.REFRESH_CLICK,this.closeError.bind(this))),this.on(CANPLAY,this.closeError.bind(this)),this.on(PLAY,this.closeError.bind(this))}},{key:"handleError",value:function(e){this.player&&this.player.pause(),this.config.isNeedDemoteBack?(this.state.showError=!1,this.changeMainOrBackup()):this.state.showError=!0,this.renderError(e)}},{key:"handleEnd",value:function(){this.player&&this.player.pause(),this.config.isNeedDemoteBack&&this.changeMainOrBackup()}},{key:"getRetryList",value:function(){var e,t=this.playerData.getCurrentStreams()[0];return[null==t?void 0:t.url].concat(_toConsumableArray$1(null!==(e=null==t?void 0:t.backUrlList)&&void 0!==e?e:[]))}},{key:"changeMainOrBackup",value:function(){var e=this;this.player.addClass(STATE_CLASS.ENTER);var t=this.getRetryList(),r=this.config.retryLoopNum*t.length,i=(t.indexOf(this.player.config.url)+1)%t.length;this.state.idx=i;var n=t[i];if(!n||this.state.retryTimes===r)return this.player.removeClass(STATE_CLASS.ENTER),this.state.retryTimes===r&&this.player.emit(PluginEvents.PLAY_BACKUP_CHANGE_FINISH),this.state.showError=!0,this.renderError(),void this.resetTimes();this.player.once("canplay",(function(){e.state.retryTimes=0})),console.log("重试第".concat(this.state.retryTimes,"次"),n),this.player.emit(PluginEvents.PLAY_BACKUP_CHANGE,{currentUrl:this.player.config.url,nextUrl:n,retryTimes:this.state.retryTimes}),this.changeUrl(n),this.state.retryTimes=this.state.retryTimes+1}},{key:"changeUrl",value:function(e){this.player.config.url=e,this.player.switchURL(e,!1),this.player.emit(PluginEvents.PlAY_URL_CHANGE,{url:e,from:PluginEvents.PLAY_BACKUP_CHANGE})}},{key:"resetTimes",value:function(){this.state.retryTimes=0,this.state.idx=0}},{key:"renderError",value:function(e){var t=this.root;t&&(t.innerHTML="",t.style.display="none",this.state.showError&&(this.player.emit(PluginEvents.SHOW_PLAY_ERROR),t.style.display="block",t.appendChild(this.getErrorDom(e))))}},{key:"addErrDetail",value:function(e){Array.isArray(e)?this._errDetailList=[].concat(_toConsumableArray$1(this._errDetailList),_toConsumableArray$1(e)):this._errDetailList.push(e)}},{key:"getErrorDom",value:function(e){var t=this;if(!this.$errorDom){var r,i;if(this.$errorDom=util.createDom("div","",void 0,"xgplayer-error-cover"),this.config.errorImg){var n=util.createDom("div","",void 0,"xgplayer-error-img");n.appendChild(this.icons.errorImg),this.$errorDom.appendChild(n)}if(this.config.errorTips){var o,a,s,l="";if(null!==(o=this.config)&&void 0!==o&&null!==(a=o.errorTipsText)&&void 0!==a&&a[this.lang])l=null===(s=this.config.errorTipsText)||void 0===s?void 0:s[this.lang];else if(e){var c,u,h=e.errorCode,d=this.player.errorNote?this.i18n[this.player.errorNote]:"";if(!d)d=null!==(c=null!==(u=this.errNoteMap[h])&&void 0!==u?u:this.errNoteMap.other)&&void 0!==c?c:"error";l=d}else l=this.langText.errorTips;var p=util.createDom("div",l,void 0,"xgplayer-error-tips");this.$errorDom.appendChild(p)}if(this.config.isNeedRefreshButton){var f=util.createDom("div",this.langText.clickButton,void 0,"xgplayer-error-button");this.bind(".xgplayer-error-button","click",this.handleButtonClick.bind(this)),this.$errorDom.appendChild(f)}if(null!==(r=this._errDetailList)&&void 0!==r&&r.length)null===(i=this._errDetailList)||void 0===i||i.forEach((function(e){var r="function"==typeof e?e():e;if(r){var i=util.createDom("div","".concat(r.label,": ").concat(r.value),void 0,"xgplayer-error-detail-info");t.$errorDom.appendChild(i)}}));this.emit("sdkerrorplugin_render",this.$errorDom)}return this.$errorDom}},{key:"handleButtonClick",value:function(){var e,t;null===(e=this.player)||void 0===e||e.emit(PluginEvents.PLAY_ERROR_BUTTON_CLICK),null===(t=this.player)||void 0===t||t.retry(),this.closeError()}},{key:"closeError",value:function(){this.state.showError=!1,this.renderError()}},{key:"destroy",value:function(){this.player.off(ERROR$1,this.handleError.bind(this)),this.playerData.isLive&&this.player.off(ENDED,this.handleEnd.bind(this))}},{key:"render",value:function(){return'<xgplayer-error class="xgplayer-error"></xgplayer-error>'}}],[{key:"pluginName",get:function(){return"sdkErrorPlugin"}},{key:"defaultConfig",get:function(){return{errorImg:!0,errorTips:!0,isNeedRefreshButton:!0,isNeedDemoteBack:!1,retryLoopNum:1,errorTipsText:null,position:Plugin.POSITIONS.ROOT}}}]),r}(Plugin);function danmuActiveSVG$1(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M16.5 4.106h-13a.3.3 0 00-.3.3v11.186a.3.3 0 00.3.3h7.111v1.7H3.5a2 2 0 01-2-2V4.406a2 2 0 012-2h13a2 2 0 012 2V10h-1.7V4.406a.3.3 0 00-.3-.3zM6 7.722c0-.42.34-.76.76-.76h6.58a.76.76 0 110 1.52H6.76a.76.76 0 01-.76-.76zm0 3.037c0-.42.34-.759.76-.759h3.543a.76.76 0 110 1.519H6.76a.76.76 0 01-.76-.76z" fill="#fff"/><circle cx="15.1" cy="14.201" r="3.4" fill="#3370FF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M13.185 13.756a.5.5 0 01.707 0l.866.866 1.78-1.78a.5.5 0 11.707.707l-2.133 2.134a.5.5 0 01-.707 0l-1.22-1.22a.5.5 0 010-.707z" fill="#fff"/></svg>',"image/svg+xml").firstChild}function Default(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M16.5 4.106h-13a.3.3 0 00-.3.3v11.186a.3.3 0 00.3.3h7.111v1.7H3.5a2 2 0 01-2-2V4.406a2 2 0 012-2h13a2 2 0 012 2V10h-1.7V4.406a.3.3 0 00-.3-.3zM6 7.722c0-.42.34-.76.76-.76h6.58a.76.76 0 110 1.52H6.76a.76.76 0 01-.76-.76zm0 3.037c0-.42.34-.759.76-.759h3.543a.76.76 0 110 1.519H6.759a.76.76 0 01-.759-.76zm7.202 2.303a2.2 2.2 0 003.011 3.011l-3.011-3.01zm3.915 1.992a2.2 2.2 0 00-2.896-2.896l2.896 2.896zm1.383-.879a3.4 3.4 0 11-6.8 0 3.4 3.4 0 016.8 0z" fill="#fff"/></svg>',"image/svg+xml").firstChild}function resetIcon(){return(new DOMParser).parseFromString('<svg fill="none" stroke="currentColor" stroke-width="4" viewBox="0 0 48 48" width="1em" height="1em"\n class="arco-icon arco-icon-refresh">\n <path\n d="M38.837 18C36.463 12.136 30.715 8 24 8 15.163 8 8 15.163 8 24s7.163 16 16 16c7.455 0 13.72-5.1 15.496-12M40 8v10H30">\n </path>\n</svg>',"image/svg+xml").firstChild}function ownerDocument(e){return e&&e.ownerDocument||document}function activeElement(e){void 0===e&&(e=ownerDocument());try{var t=e.activeElement;return t&&t.nodeName?t:null}catch(e2){return e.body}}function hasClass(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}function addClass(e,t){e.classList?e.classList.add(t):hasClass(e,t)||("string"==typeof e.className?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}var canUseDOM=!("undefined"==typeof window||!window.document||!window.document.createElement),optionsSupported=!1,onceSupported=!1;try{var options={get passive(){return optionsSupported=!0},get once(){return onceSupported=optionsSupported=!0}};canUseDOM&&(window.addEventListener("test",options,options),window.removeEventListener("test",options,!0))}catch(e2){}function addEventListener(e,t,r,i){if(i&&"boolean"!=typeof i&&!onceSupported){var n=i.once,o=i.capture,a=r;!onceSupported&&n&&(a=r.__once||function e(i){this.removeEventListener(t,e,o),r.call(this,i)},r.__once=a),e.addEventListener(t,a,optionsSupported?i:o)}e.addEventListener(t,r,i)}function ownerWindow(e){var t=ownerDocument(e);return t&&t.defaultView||window}function getComputedStyle(e,t){return ownerWindow(e).getComputedStyle(e,t)}var rUpper=/([A-Z])/g;function hyphenate(e){return e.replace(rUpper,"-$1").toLowerCase()}var msPattern=/^ms-/;function hyphenateStyleName(e){return hyphenate(e).replace(msPattern,"-ms-")}var supportedTransforms=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;function isTransform(e){return!(!e||!supportedTransforms.test(e))}function style(e,t){var r="",i="";if("string"==typeof t)return e.style.getPropertyValue(hyphenateStyleName(t))||getComputedStyle(e).getPropertyValue(hyphenateStyleName(t));Object.keys(t).forEach((function(n){var o=t[n];o||0===o?isTransform(n)?i+=n+"("+o+") ":r+=hyphenateStyleName(n)+": "+o+";":e.style.removeProperty(hyphenateStyleName(n))})),i&&(r+="transform: "+i+";"),e.style.cssText+=";"+r}function removeEventListener(e,t,r,i){var n=i&&"boolean"!=typeof i?i.capture:i;e.removeEventListener(t,r,n),r.__once&&e.removeEventListener(t,r.__once,n)}function listen(e,t,r,i){return addEventListener(e,t,r,i),function(){removeEventListener(e,t,r,i)}}function triggerEvent(e,t,r,i){if(void 0===r&&(r=!1),void 0===i&&(i=!0),e){var n=document.createEvent("HTMLEvents");n.initEvent(t,r,i),e.dispatchEvent(n)}}function parseDuration(e){var t=style(e,"transitionDuration")||"",r=-1===t.indexOf("ms")?1e3:1;return parseFloat(t)*r}function emulateTransitionEnd(e,t,r){void 0===r&&(r=5);var i=!1,n=setTimeout((function(){i||triggerEvent(e,"transitionend",!0)}),t+r),o=listen(e,"transitionend",(function(){i=!0}),{once:!0});return function(){clearTimeout(n),o()}}function transitionEnd(e,t,r,i){null==r&&(r=parseDuration(e)||0);var n=emulateTransitionEnd(e,r,i),o=listen(e,"transitionend",t);return function(){n(),o()}}var reset={transition:"","transition-duration":"","transition-delay":"","transition-timing-function":""};function _animate(e){var t=e.node,r=e.properties,i=e.duration,n=void 0===i?200:i,o=e.easing,a=e.callback,s=[],l={},c="";Object.keys(r).forEach((function(e){var t=r[e];isTransform(e)?c+=e+"("+t+") ":(l[e]=t,s.push(hyphenate(e)))})),c&&(l.transform=c,s.push("transform")),n>0&&(l.transition=s.join(", "),l["transition-duration"]=n/1e3+"s",l["transition-delay"]="0s",l["transition-timing-function"]=o||"linear");var u=transitionEnd(t,(function(e){e.target===e.currentTarget&&(style(t,reset),a&&a.call(this,e))}),n);return t.clientLeft,style(t,l),{cancel:function(){u(),style(t,reset)}}}function animate(e,t,r,i,n){if(!("nodeType"in e))return _animate(e);if(!t)throw new Error("must include properties to animate");return"function"==typeof i&&(n=i,i=""),_animate({node:e,properties:t,duration:r,easing:i,callback:n})}var prev=(new Date).getTime();function fallback(e){var t=(new Date).getTime(),r=Math.max(0,16-(t-prev)),i=setTimeout(e,r);return prev=t,i}var vendors=["","webkit","moz","o","ms"],cancelMethod="clearTimeout",rafImpl=fallback,getKey=function(e,t){return e+(e?t[0].toUpperCase()+t.substr(1):t)+"AnimationFrame"};canUseDOM&&vendors.some((function(e){var t=getKey(e,"request");return t in window&&(cancelMethod=getKey(e,"cancel"),rafImpl=function(e){return window[t](e)}),!!rafImpl}));var cancel=function(e){"function"==typeof window[cancelMethod]&&window[cancelMethod](e)},request=rafImpl,matchesImpl;function attribute(e,t,r){if(e){if(void 0===r)return e.getAttribute(t);r||""===r?e.setAttribute(t,String(r)):e.removeAttribute(t)}}function childElements(e){return e?Array.from(e.children):[]}function clear(e){if(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}return null}function matches(e,t){if(!matchesImpl){var r=document.body,i=r.matches||r.matchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector||r.msMatchesSelector;matchesImpl=function(e,t){return i.call(e,t)}}return matchesImpl(e,t)}function closest(e,t,r){e.closest&&!r&&e.closest(t);var i=e;do{if(matches(i,t))return i;i=i.parentElement}while(i&&i!==r&&i.nodeType===document.ELEMENT_NODE);return null}function contains(e,t){return e.contains?e.contains(t):e.compareDocumentPosition?e===t||!!(16&e.compareDocumentPosition(t)):void 0}var toArray$1=Function.prototype.bind.call(Function.prototype.call,[].slice);function childNodes(e){return e?toArray$1(e.childNodes):[]}var toArray=Function.prototype.bind.call(Function.prototype.call,[].slice);function qsa(e,t){return toArray(e.querySelectorAll(t))}function filterEvents(e,t){return function(r){var i=r.currentTarget,n=r.target;qsa(i,e).some((function(e){return contains(e,n)}))&&t.call(this,r)}}function isDocument(e){return"nodeType"in e&&e.nodeType===document.DOCUMENT_NODE}function isWindow(e){return"window"in e&&e.window===e?e:isDocument(e)&&e.defaultView||!1}function getscrollAccessor(e){var t="pageXOffset"===e?"scrollLeft":"scrollTop";return function(r,i){var n=isWindow(r);if(void 0===i)return n?n[e]:r[t];n?n.scrollTo(n[e],i):r[t]=i}}var scrollLeft=getscrollAccessor("pageXOffset"),scrollTop=getscrollAccessor("pageYOffset");function offset(e){var t=ownerDocument(e),r={top:0,left:0,height:0,width:0},i=t&&t.documentElement;return i&&contains(i,e)?(void 0!==e.getBoundingClientRect&&(r=e.getBoundingClientRect()),r={top:r.top+scrollTop(i)-(i.clientTop||0),left:r.left+scrollLeft(i)-(i.clientLeft||0),width:r.width,height:r.height}):r}function height(e,t){var r=isWindow(e);return r?r.innerHeight:t?e.clientHeight:offset(e).height}function insertAfter(e,t){return e&&t&&t.parentNode?(t.nextSibling?t.parentNode.insertBefore(e,t.nextSibling):t.parentNode.appendChild(e),e):null}var regExpInputs=/^(?:input|select|textarea|button)$/i;function isInput(e){return!!e&&regExpInputs.test(e.nodeName)}function isVisible(e){return!!e&&!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}function collectSiblings(e,t,r){void 0===t&&(t=null),void 0===r&&(r=null);for(var i=[];e;e=e.nextElementSibling)if(e!==t){if(r&&matches(e,r))break;i.push(e)}return i}function nextUntil(e,t){return collectSiblings(e,e,t)}var isHTMLElement=function(e){return!!e&&"offsetParent"in e};function offsetParent(e){for(var t=ownerDocument(e),r=e&&e.offsetParent;isHTMLElement(r)&&"HTML"!==r.nodeName&&"static"===style(r,"position");)r=r.offsetParent;return r||t.documentElement}function collectElements(e,t){var r=null,i=[];for(r=e?e[t]:null;r&&9!==r.nodeType;)i.push(r),r=r[t]||null;return i}function parents(e){return collectElements(e,"parentElement")}function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},_extends.apply(this,arguments)}var nodeName=function(e){return e.nodeName&&e.nodeName.toLowerCase()},size;function position(e,t){var r,i={top:0,left:0};if("fixed"===style(e,"position"))r=e.getBoundingClientRect();else{var n=t||offsetParent(e);r=offset(e),"html"!==nodeName(n)&&(i=offset(n));var o=String(style(n,"borderTopWidth")||0);i.top+=parseInt(o,10)-scrollTop(n)||0;var a=String(style(n,"borderLeftWidth")||0);i.left+=parseInt(a,10)-scrollLeft(n)||0}var s=String(style(e,"marginTop")||0),l=String(style(e,"marginLeft")||0);return _extends({},r,{top:r.top-i.top-(parseInt(s,10)||0),left:r.left-i.left-(parseInt(l,10)||0)})}function prepend(e,t){return e&&t?(t.firstElementChild?t.insertBefore(e,t.firstElementChild):t.appendChild(e),e):null}function remove(e){return e&&e.parentNode?(e.parentNode.removeChild(e),e):null}function replaceClassName(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function removeClass(e,t){e.classList?e.classList.remove(t):"string"==typeof e.className?e.className=replaceClassName(e.className,t):e.setAttribute("class",replaceClassName(e.className&&e.className.baseVal||"",t))}function scrollbarSize(e){if((!size&&0!==size||e)&&canUseDOM){var t=document.createElement("div");t.style.position="absolute",t.style.top="-9999px",t.style.width="50px",t.style.height="50px",t.style.overflow="scroll",document.body.appendChild(t),size=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return size}function scrollParent(e,t){var r=style(e,"position"),i="absolute"===r,n=e.ownerDocument;if("fixed"===r)return n||document;for(;(e=e.parentNode)&&!isDocument(e);){var o=i&&"static"===style(e,"position"),a=(style(e,"overflow")||"")+(style(e,"overflow-y")||"")+style(e,"overflow-x");if(!o&&(/(auto|scroll)/.test(a)&&(t||height(e)<e.scrollHeight)))return e}return n||document}function scrollTo(e,t){var r=offset(e),i={top:0,left:0};if(e){var n=t||scrollParent(e),o=isWindow(n),a=scrollTop(n),s=height(n,!0);o||(i=offset(n));var l=(r={top:r.top-i.top,left:r.left-i.left,height:r.height,width:r.width}).height,c=r.top+(o?0:a),u=c+l;a=a>c?c:u>a+s?u-s:a;var h=request((function(){return scrollTop(n,a)}));return function(){return cancel(h)}}}function siblings(e){return collectSiblings(e&&e.parentElement?e.parentElement.firstElementChild:null,e)}var regExpNbspEntity=/&nbsp;/gi,regExpNbspHex=/\xA0/g,regExpSpaces=/\s+([^\s])/gm;function text(e,t,r){void 0===t&&(t=!0),void 0===r&&(r=!0);var i="";return e&&(i=(e.textContent||"").replace(regExpNbspEntity," ").replace(regExpNbspHex," "),t&&(i=i.trim()),r&&(i=i.replace(regExpSpaces," $1"))),i}function toggleClass(e,t){e.classList?e.classList.toggle(t):hasClass(e,t)?removeClass(e,t):addClass(e,t)}function getWidth(e,t){var r=isWindow(e);return r?r.innerWidth:t?e.clientWidth:offset(e).width}var helpers={addEventListener:addEventListener,removeEventListener:removeEventListener,triggerEvent:triggerEvent,animate:animate,filter:filterEvents,listen:listen,style:style,getComputedStyle:getComputedStyle,attribute:attribute,activeElement:activeElement,ownerDocument:ownerDocument,ownerWindow:ownerWindow,requestAnimationFrame:request,cancelAnimationFrame:cancel,matches:matches,height:height,width:getWidth,offset:offset,offsetParent:offsetParent,position:position,contains:contains,scrollbarSize:scrollbarSize,scrollLeft:scrollLeft,scrollParent:scrollParent,scrollTo:scrollTo,scrollTop:scrollTop,querySelectorAll:qsa,closest:closest,addClass:addClass,removeClass:removeClass,hasClass:hasClass,toggleClass:toggleClass,transitionEnd:transitionEnd,childNodes:childNodes,childElements:childElements,nextUntil:nextUntil,parents:parents,siblings:siblings,clear:clear,insertAfter:insertAfter,isInput:isInput,isVisible:isVisible,prepend:prepend,remove:remove,text:text},FUNC_ERROR_TEXT="Expected a function";function throttle(e,t,r){var i=!0,n=!0;if("function"!=typeof e)throw new TypeError(FUNC_ERROR_TEXT);return isObject$n(r)&&(i="leading"in r?!!r.leading:i,n="trailing"in r?!!r.trailing:n),debounce$1(e,t,{leading:i,maxWait:t,trailing:n})}var Slider=function(){function e(t,r){_classCallCheck$5(this,e),this.ticks=[],this.range=[0,100],this.currentValue=0,this.currentTick={name:"",val:0,renderVal:0},this.buttonStatus=1,this.startClientX=0,this.wrapperWidth=1,this.wrapperLeft=0,this.handleChange=function(){},this.parent=t,this.ticks=r.ticks,this.itemProps=r,this.sliderTitle=document.createElement("div"),this.sliderTitle.innerHTML=r.name,this.sliderContent=document.createElement("div"),this.sliderValue=document.createElement("div"),this.wrapper=document.createElement("div"),this.inner=document.createElement("div"),this.button=document.createElement("div"),helpers.addClass(this.wrapper,"wrapper"),helpers.addClass(this.parent,"xg-player-slider"),helpers.addClass(this.sliderContent,"line-slider"),helpers.addClass(this.sliderTitle,"line-title"),helpers.addClass(this.sliderValue,"line-value"),this.renderTicks(),this.rendInner(),this.parent.appendChild(this.sliderTitle),this.parent.appendChild(this.sliderContent),this.parent.appendChild(this.sliderValue),this.sliderContent.appendChild(this.wrapper),this.bindEvents(),this.setValue(r.defaultValue)}return _createClass$6(e,[{key:"renderTicks",value:function(){var e=this.wrapper,t=document.createElement("div");helpers.addClass(t,"ticks");for(var r=1;r<this.ticks.length-1;r++){var i=this.ticks[r],n=document.createElement("div");helpers.addClass(n,"tick"),helpers.style(n,{left:i.val+"%"}),t.appendChild(n)}e.appendChild(t)}},{key:"rendInner",value:function(){var e=this.wrapper,t=this.inner;helpers.addClass(t,"inner");var r=this.button;helpers.addClass(r,"button"),e.appendChild(t),e.appendChild(r)}},{key:"bindEvents",value:function(){helpers.addEventListener(this.wrapper,"click",this.onClick.bind(this)),helpers.addEventListener(this.button,"touchstart",this.onTouchStart.bind(this)),helpers.addEventListener(this.button,"touchmove",throttle(this.onTouchmove.bind(this),30)),helpers.addEventListener(this.button,"touchend",this.onTouchend.bind(this)),helpers.addEventListener(this.button,"touchcancel",this.onTouchend.bind(this))}},{key:"setValue",value:function(e){var t=this;if(e>this.range[1]||e<this.range[0])return!1;this.currentTick=this.getCurrentTick(e),this.currentValue=this.currentTick.val;var r=this.currentValue+"%";return setTimeout((function(){helpers.style(t.inner,{width:r}),helpers.style(t.button,{left:r})})),this.sliderValue.innerHTML=this.currentTick.name,this.handleChange(this.currentValue),!0}},{key:"renderText",value:function(e){var t=this;this.ticks=e.ticks,this.itemProps=e,this.sliderTitle.innerHTML=e.name,this.currentTick=this.ticks.filter((function(e){return e.val===t.currentValue}))[0],this.sliderValue.innerHTML=this.currentTick.name}},{key:"onChange",value:function(e){this.handleChange=e}},{key:"getCurrentTick",value:function(e){for(var t=0;t<this.ticks.length-1;t++)if(this.ticks[t].val<=e&&this.ticks[t+1].val>=e)return e-this.ticks[t].val>this.ticks[t+1].val-e?this.ticks[t+1]:this.ticks[t];return this.ticks[0]}},{key:"onMousedown",value:function(e){this.startClientX=e.clientX,this.onStart()}},{key:"onTouchStart",value:function(e){e.stopPropagation(),this.startClientX=e.touches[0].clientX,this.onStart()}},{key:"onStart",value:function(){this.buttonStatus=2;var e=helpers.offset(this.wrapper);this.wrapperWidth=e.width,this.wrapperLeft=e.left}},{key:"onMousemove",value:function(e){if(2===this.buttonStatus){var t=e.clientX-this.startClientX;this.onMove(t)}}},{key:"onTouchmove",value:function(e){e.stopPropagation();var t=e.touches[0].clientX-this.startClientX;this.onMove(t)}},{key:"onMove",value:function(e){var t=this.startClientX+e;if(!(t-this.wrapperLeft<0||t-this.wrapperLeft>this.wrapperWidth)){this.startClientX=this.startClientX+e;var r=(this.startClientX-this.wrapperLeft)*(this.range[1]-this.range[0])/this.wrapperWidth;helpers.style(this.inner,{width:r+"%"}),helpers.style(this.button,{left:r+"%"})}}},{key:"onMouseup",value:function(e){console.log("mouse up",e.clientX),this.onEnd()}},{key:"onTouchend",value:function(){this.onEnd()}},{key:"onEnd",value:function(){this.buttonStatus=3;var e=(this.startClientX-this.wrapperLeft)*(this.range[1]-this.range[0])/this.wrapperWidth;this.setValue(e)}},{key:"onClick",value:function(e){e.stopPropagation();var t=helpers.offset(this.wrapper);this.wrapperWidth=t.width,this.wrapperLeft=t.left;var r=(e.clientX-this.wrapperLeft)*(this.range[1]-this.range[0])/this.wrapperWidth;this.setValue(r)}}]),e}(),zh={danmuSwitch:"弹幕开关",danmuSetting:"弹幕设置",openDanmu:"打开弹幕",reset:"重置",opacity:"不透明度",area:"显示区域",speed:"弹幕速度",fontSize:"字体大小",danmuMask:"智能挡板",screen0:"1/4屏",screen1:"半屏",screen2:"3/4屏",screen3:"全屏",opacity0:"0",opacity1:"1/3",opacity2:"2/3",opacity3:"1",speed0:"0.25",speed1:"0.5",speed2:"正常",speed3:"1.25",speed4:"1.5",speed5:"2",fontSize0:"极小",fontSize1:"适中",fontSize2:"极大"},en={danmuSwitch:"Barrage switch",danmuSetting:"Barrage settings",openDanmu:"Open Barrage",reset:"Reset",opacity:"Opacity",area:"Display area",speed:"Barrage speed",fontSize:"Font size",danmuMask:"Intelligent blocking",screen0:"1/4 screen",screen1:"Half screen",screen2:"3/4 screen",screen3:"Full screen",opacity0:"0",opacity1:"1/3",opacity2:"2/3",opacity3:"1",speed0:"0.25",speed1:"0.5",speed2:"Normal",speed3:"1.25",speed4:"1.5",speed5:"2",fontSize0:"Minimal",fontSize1:"Moderate",fontSize2:"Great"},jp=en,zhHK={danmuSwitch:"彈幕開關",danmuSetting:"彈幕設置",openDanmu:"打開彈幕",reset:"重置",opacity:"不透明度",area:"顯示區域",speed:"彈幕速度",fontSize:"字體大小",danmuMask:"智能擋板",screen0:"1/4屏",screen1:"半屏",screen2:"3/4屏",screen3:"全屏",opacity0:"0",opacity1:"1/3",opacity2:"2/3",opacity3:"1",speed0:"0.25",speed1:"0.5",speed2:"正常",speed3:"1.25",speed4:"1.5",speed5:"2",fontSize0:"極小",fontSize1:"適中",fontSize2:"極大"},lang={zh:zh,"zh-cn":zh,en:en,jp:jp,"zh-hk":zhHK},State=function(){function e(t){_classCallCheck$5(this,e),this.curLang="en",this._defaultConfig={opacity:99,area:99,fontSize:50,speed:40,active:!1,usePanel:!0,danmuItems:[],maskConfig:{maskUrl:"",maskOffset:0,interval:200},maskActive:!1,external:[]},Object.assign(this._defaultConfig,t)}return _createClass$6(e,[{key:"updateLang",value:function(e){this.curLang=e,this.curLangMap=lang[e]||lang.en;var t=this.curLangMap;this.sliderItemsProps=[{key:"opacity",name:t.opacity,defaultValue:99,ticks:[{name:t.opacity0,val:0,renderVal:0},{name:t.opacity1,val:33,renderVal:.33},{name:t.opacity2,val:66,renderVal:.66},{name:t.opacity3,val:99,renderVal:1}]},{key:"area",name:t.area,defaultValue:99,ticks:[{name:t.screen0,val:0,renderVal:1/4},{name:t.screen1,val:33,renderVal:.5},{name:t.screen2,val:66,renderVal:3/4},{name:t.screen3,val:99,renderVal:1}]},{key:"speed",name:t.speed,defaultValue:40,ticks:[{name:t.speed0,val:0,renderVal:1/4},{name:t.speed1,val:20,renderVal:.5},{name:t.speed2,val:40,renderVal:1},{name:t.speed3,val:60,renderVal:5/4},{name:t.speed4,val:80,renderVal:1.5},{name:t.speed5,val:100,renderVal:2}]},{key:"fontSize",name:t.fontSize,defaultValue:50,ticks:[{name:t.fontSize0,val:0,renderVal:14},{name:t.fontSize1,val:50,renderVal:16},{name:t.fontSize2,val:100,renderVal:20}]}],this._defaultConfig.external.forEach((function(t){t.name=t.lang[e]||t.lang.en}))}},{key:"getConfig",value:function(){return this._defaultConfig}},{key:"updateConfig",value:function(e){Object.assign(this._defaultConfig,e)}},{key:"updateComments",value:function(e){this._defaultConfig.danmuItems=e}},{key:"getRenderVal",value:function(e,t){var r=this.sliderItemsProps.find((function(t){return t.key===e}))||this.sliderItemsProps[0];return(r.ticks.find((function(e){return e.val===t}))||r.ticks[0]).renderVal}}]),e}(),NormalSpeed=1e4,Container=function(){function e(t){_classCallCheck$5(this,e),this.state=t,this.root=util.createDom("xg-danmu"),helpers.addClass(this.root,"xgplayer-danmu-container")}var t;return _createClass$6(e,[{key:"initDanmuContainer",value:function(){var e=this.state.getConfig(),t=e.opacity,r=void 0===t?1:t,i=e.fontSize,n=void 0===i?16:i,o=e.area,a=void 0===o?1:o,s=e.danmuItems,l=void 0===s?[]:s,c=e.active,u=e.speed,h=void 0===u?40:u,d=(c?l:[]).map((function(e){return!e.style&&(e.style={}),e})),p={container:this.root,comments:d,live:!1,area:{start:0,end:this.state.getRenderVal("area",a)}};this.danmuJs=new window["danmu.js"](p),this.setOpacity(this.state.getRenderVal("opacity",r)),this.setFontSize(this.state.getRenderVal("fontSize",n)),this.setSpeed(this.state.getRenderVal("speed",h))}},{key:"start",value:function(){this.danmuJs.start()}},{key:"pause",value:function(){this.danmuJs.pause()}},{key:"play",value:function(){this.danmuJs.play()}},{key:"stop",value:function(){this.danmuJs.stop()}},{key:"resize",value:function(){this.danmuJs.resize()}},{key:"sendDanmu",value:function(e){this.state.getConfig().active&&this.danmuJs.sendComment(e)}},{key:"clear",value:function(){this.danmuJs.clear()}},{key:"setProperty",value:function(e,t){return"opacity"===e?this.setOpacity(this.state.getRenderVal(e,t)):"area"===e?this.setArea(this.state.getRenderVal(e,t)):"speed"===e?this.setSpeed(this.state.getRenderVal(e,t)):"fontSize"===e?this.setFontSize(this.state.getRenderVal(e,t)):void 0}},{key:"setOpacity",value:function(e){this.danmuJs.setOpacity(e)}},{key:"setFontSize",value:function(e){this.danmuJs.setFontSize(e)}},{key:"setArea",value:function(e){this.danmuJs.setArea({start:0,end:this.state.getRenderVal("area",e)})}},{key:"setSpeed",value:function(e){this.danmuJs.setAllDuration("scroll",NormalSpeed/e)}},{key:"destroy",value:(t=_asyncToGenerator$2(_regeneratorRuntime$2().mark((function e(){return _regeneratorRuntime$2().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.danmuJs){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this.danmuJs.stop();case 4:return e.next=6,this.danmuJs.destroy();case 6:this.danmuJs=null,this.root.parentNode.removeChild(this.root),this.root=null;case 10:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),Panel=function(){function e(t){_classCallCheck$5(this,e),this.state=t,this.root=document.createElement("div"),helpers.addClass(this.root,"panel-box"),helpers.addEventListener(this.root,"click",(function(e){e.stopPropagation()}))}return _createClass$6(e,[{key:"destroy",value:function(){this.root.parentNode&&this.root.parentNode.removeChild(this.root),this.root=null}}]),e}(),Switch=function(){function e(t){_classCallCheck$5(this,e),this.callback=function(){},this.key=t.key,this.name=t.name,this.value=t.value,this.root=document.createElement("div"),helpers.addClass(this.root,"xg-player-switch-wrapper"),this.render()}return _createClass$6(e,[{key:"render",value:function(){var e=this;if(!this.root.childNodes.length){var t=document.createElement("div");this.$left=t,helpers.addClass(t,"left"),t.innerHTML=this.name;var r=document.createElement("div");this.$right=r,helpers.addClass(r,"right"),r.innerHTML='<label class="switch">\n <input type="checkbox">\n <span class="slider round"></span>\n </label>',this.root.appendChild(t),this.root.appendChild(r);var i=this.$right.querySelector("input");helpers.addEventListener(this.$right,"click",debounce$1((function(t){t.stopPropagation(),e.value=!e.value,e.value?null==i||i.setAttribute("checked","checked"):null==i||i.removeAttribute("checked"),e.callback(e.value)}),50))}var n=this.$right.querySelector("input");this.value?null==n||n.setAttribute("checked","checked"):n.removeAttribute("checked"),n.checked=this.value}},{key:"renderName",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.$left.innerHTML=e}},{key:"onChange",value:function(e){this.callback=e}}]),e}(),isPC="pc"===sniffer$1.device,MIN_INTERVAL=300,POSITIONS$8=Plugin.POSITIONS,DanmuPlugin=function(e){_inherits$5(r,e);var t=_createSuper$5(r);function r(e){var i;return _classCallCheck$5(this,r),(i=t.call(this,e)).seekCost=window.performance.now(),i.eventBus=new EventEmitter,window["danmu.js"]?(i.state=new State(e.config),i.state.updateLang(i.player.lang),i.iconWrap=document.createElement("div"),helpers.addClass(i.iconWrap,"icon-warp"),i.tipsWrap=document.createElement("div"),helpers.addClass(i.tipsWrap,"tips-wrap"),i.container=new Container(i.state),i.panel=new Panel(i.state),i):_possibleConstructorReturn$5(i)}return _createClass$6(r,[{key:"afterCreate",value:function(){var e;null===(e=this.player.root)||void 0===e||e.appendChild(this.container.root),this.renderIcon(),this.renderBox(),this.root.appendChild(this.iconWrap),isPC&&(this.state.getConfig().usePanel&&this.root.appendChild(this.panel.root),this.renderTips(),helpers.addClass(this.panel.root,"pc-panel"),this.root.appendChild(this.tipsWrap)),this.initEvents(),this.container.initDanmuContainer()}},{key:"afterPlayerInit",value:function(){this.initDanmuMask()}},{key:"updateLang",value:function(e){this.state.updateLang(this.player.lang),this.eventBus.emit("updateLang")}},{key:"registerIcons",value:function(){return{open:{icon:danmuActiveSVG$1,class:"xgplayer-danmu-open-svg"},close:{icon:Default,class:"xgplayer-danmu-close-svg"},reset:{icon:resetIcon,class:"xgplayer-danmu-reset-svg"}}}},{key:"initEvents",value:function(){isPC?this.bindPCEvent():this.bindMobileEvent(),this.bindPlayerEvent()}},{key:"bindPlayerEvent",value:function(){var e=this;this.once(TIME_UPDATE,(function(){e.container.start()})),this.on(PAUSE,(function(){e.container.pause()})),this.on(PLAY,(function(){e.container.play()})),this.on(SEEKING,(function(){e.seekCost=window.performance.now(),e.container.stop()})),this.on(SEEKED,debounce$1((function(){e.container.start()}),MIN_INTERVAL)),this.on([FULLSCREEN_CHANGE,CSS_FULLSCREEN_CHANGE,MINI_STATE_CHANGE],(function(){e.container.resize(),e.handleResize()})),this.on(PIP_CHANGE,this.handlePIP.bind(this))}},{key:"bindPCEvent",value:function(){var e=this;helpers.addEventListener(this.root,"click",this.onClick.bind(this)),helpers.addEventListener(this.root,"mouseenter",(function(){var t=e.state.getConfig().active,r=e.player.controls;"rightSide"===e.config.listType?r.blur():r.focus(),t?(helpers.style(e.panel.root,{display:"block"}),helpers.style(e.tipsWrap,{display:"none"})):(helpers.style(e.panel.root,{display:"none"}),helpers.style(e.tipsWrap,{display:"block"}))})),helpers.addEventListener(this.root,"mouseleave",(function(){var t=e.player.controls;"rightSide"===e.config.listType?t.focus():t.focusAwhile(),helpers.style(e.panel.root,{display:"none"}),helpers.style(e.tipsWrap,{display:"none"})}))}},{key:"bindMobileEvent",value:function(){var e=this;helpers.addEventListener(this.root,"click",(function(){e.state.getConfig().usePanel?e.player.panel.showPanel(e.panel.root):e.onClick()}))}},{key:"onClick",value:function(){this.toggleDanmu(),this.renderIcon()}},{key:"toggleDanmu",value:function(){var e=this.state.getConfig(),t=e.active,r=e.maskActive,i=!t;i?(this.state.updateConfig({active:i}),r&&this.initMask()):(null==this||this.container.clear(),this.destroyMask(),this.state.updateConfig({active:i})),this.player.emit(PluginEvents.DANMU_CHANGE,{active:i}),this.danmuSwitchInSettingPanel&&(this.danmuSwitchInSettingPanel.value=i,this.danmuSwitchInSettingPanel.render())}},{key:"renderIcon",value:function(){this.iconWrap.innerHTML="",this.state.getConfig().active?this.iconWrap.appendChild(this.icons.open):this.iconWrap.appendChild(this.icons.close)}},{key:"renderTips",value:function(){this.tipsWrap.innerHTML=this.state.curLangMap.openDanmu}},{key:"renderBox",value:function(){var e=this;this.panel.root.innerHTML="";var t=document.createElement("div");helpers.addClass(t,"box-header"),t.innerHTML='<div class="header-setting">'+this.state.curLangMap.danmuSetting+'</div> <div class="header-reset"></div>';var r=t.querySelector(".header-reset");r.appendChild(this.icons.reset),helpers.addEventListener(r,"click",(function(t){t.stopPropagation(),e.eventBus.emit("reset")}),{capture:!0});var i=document.createElement("span");i.innerHTML=this.state.curLangMap.reset,r.appendChild(i),this.eventBus.on("updateLang",(function(){i.innerHTML=e.state.curLangMap.reset,t.querySelector(".header-setting").innerHTML=e.state.curLangMap.danmuSetting})),this.panel.root.appendChild(t),isPC||this.renderTurnOff(),this.renderSliders(),this.renderSwitches()}},{key:"renderTurnOff",value:function(){var e=this,t={name:this.state.curLangMap.danmuSwitch,key:"active",value:this.state.getConfig().active||!1},r=new Switch(t);this.danmuSwitchInSettingPanel=r,this.panel.root.appendChild(r.root),r.onChange((function(t){e.toggleDanmu(),e.renderIcon()})),this.eventBus.on("updateLang",(function(){r.renderName(e.state.curLangMap.danmuSwitch)}))}},{key:"renderSwitches",value:function(){var e,t=this;null===(e=this.state.getConfig().external)||void 0===e||e.forEach((function(e){var r=new Switch(e);t.panel.root.appendChild(r.root),t.eventBus.on("updateLang",(function(){r.renderName(e.name)})),r.onChange((function(r){var i=t.state.getConfig().external||[];i.forEach((function(t){t.key===e.key&&(t.value=r)})),t.state.updateConfig({external:i}),t.player.emit(PluginEvents.DANMU_CHANGE,{external:i})}))}))}},{key:"renderSliders",value:function(){var e=this;this.state.sliderItemsProps.forEach((function(t,r){var i,n,o=document.createElement("div"),a=new Slider(o,t);null!=(null===(i=e.state.getConfig())||void 0===i?void 0:i[t.key])&&a.setValue(null===(n=e.state.getConfig())||void 0===n?void 0:n[t.key]);a.onChange((function(r){e.state.updateConfig(_defineProperty$6({},t.key,r)),console.log("val",e.state.getConfig()),e.player.emit(PluginEvents.DANMU_CHANGE,_defineProperty$6({},t.key,r)),e.container.setProperty(t.key,r)})),e.eventBus.on("reset",(function(){a.setValue(t.defaultValue)})),e.eventBus.on("updateLang",(function(){a.renderText(e.state.sliderItemsProps[r])})),e.panel.root.appendChild(o)}))}},{key:"sendDanmu",value:function(e){return this.container.sendDanmu(e)}},{key:"updateConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.state.updateConfig(e)}},{key:"getConfig",value:function(){return this.state.getConfig()}},{key:"initDanmuMask",value:function(){if(this.player){var e=this.state.getConfig(),t=e.maskConfig,r=e.active,i=e.maskActive;t.maskUrl&&(this.renderDanmuMaskTurnOff(),r&&i&&this.initMask())}}},{key:"renderDanmuMaskTurnOff",value:function(){var e=this,t={name:this.state.curLangMap.danmuMask,key:"maskActive",value:this.state.getConfig().maskActive||!1},r=new Switch(t);this.panel.root.appendChild(r.root),r.onChange((function(t){e.state.updateConfig({maskActive:t}),t?e.initMask():e.destroyMask(),e.renderIcon()})),this.eventBus.on("updateLang",(function(){r.renderName(e.state.curLangMap.danmuMask)}))}},{key:"initMask",value:function(){this.destroyMask();var e=this.state.getConfig(),t=e.maskConfig,r=e.maskActive,i=e.active;t.maskUrl&&r&&i&&(window.DanmuMask&&"function"==typeof window.DanmuMask&&(this.mask=new window.DanmuMask({player:this.player,url:t.maskUrl,originStart:t.maskOffset,interval:t.interval})),this.mask.init())}},{key:"destroyMask",value:function(){this.mask&&(this.mask.destroy(),this.mask=null)}},{key:"handleResize",value:function(){var e,t,r,i;if(this.mask){var n=this.player;this.mask.setContainerSize(null!==(e=null==n||null===(t=n.root)||void 0===t?void 0:t.offsetWidth)&&void 0!==e?e:0,null!==(r=null==n||null===(i=n.root)||void 0===i?void 0:i.offsetHeight)&&void 0!==r?r:0)}}},{key:"handlePIP",value:function(e){e?this.destroyMask():this.initMask()}},{key:"destroy",value:function(){this.destroyMask(),this.container.destroy(),this.panel.destroy()}},{key:"render",value:function(){return'<div class="xgplayer-danmu"></div>'}}],[{key:"pluginName",get:function(){return"DanmuPlugin"}},{key:"defaultConfig",get:function(){return{position:POSITIONS$8.CONTROLS_RIGHT,index:CONTROL_ICON_INDEX.DanmuPlugin}}}]),r}(Plugin),uncurryThis$3=functionUncurryThis,aCallable=aCallable$a,isObject$1=isObject$l,hasOwn=hasOwnProperty_1,arraySlice$1=arraySlice$b,NATIVE_BIND=functionBindNative,$Function=Function,concat=uncurryThis$3([].concat),join=uncurryThis$3([].join),factories={},construct=function(e,t,r){if(!hasOwn(factories,t)){for(var i=[],n=0;n<t;n++)i[n]="a["+n+"]";factories[t]=$Function("C,a","return new C("+join(i,",")+")")}return factories[t](e,r)},functionBind=NATIVE_BIND?$Function.bind:function(e){var t=aCallable(this),r=t.prototype,i=arraySlice$1(arguments,1),n=function(){var r=concat(i,arraySlice$1(arguments));return this instanceof n?construct(t,r.length,r):t.apply(e,r)};return isObject$1(r)&&(n.prototype=r),n},$$5=_export,getBuiltIn=getBuiltIn$d,apply$1=functionApply,bind$1=functionBind,aConstructor=aConstructor$3,anObject=anObject$k,isObject=isObject$l,create=objectCreate,fails$1=fails$K,nativeConstruct=getBuiltIn("Reflect","construct"),ObjectPrototype=Object.prototype,push$1=[].push,NEW_TARGET_BUG=fails$1((function(){function e(){}return!(nativeConstruct((function(){}),[],e)instanceof e)})),ARGS_BUG=!fails$1((function(){nativeConstruct((function(){}))})),FORCED$1=NEW_TARGET_BUG||ARGS_BUG;function _classCallCheck(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 i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}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 _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}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 _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _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 _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(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}$$5({target:"Reflect",stat:!0,forced:FORCED$1,sham:FORCED$1},{construct:function(e,t){aConstructor(e),anObject(t);var r=arguments.length<3?e:aConstructor(arguments[2]);if(ARGS_BUG&&!NEW_TARGET_BUG)return nativeConstruct(e,t,r);if(e==r){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var i=[null];return apply$1(push$1,i,t),new(apply$1(bind$1,e,i))}var n=r.prototype,o=create(isObject(n)?n:ObjectPrototype),a=apply$1(e,o,t);return isObject(a)?a:o}});var uncurryThis$2=functionUncurryThis,defineBuiltIn=defineBuiltIn$i,DatePrototype=Date.prototype,INVALID_DATE="Invalid Date",TO_STRING="toString",nativeDateToString=uncurryThis$2(DatePrototype[TO_STRING]),thisTimeValue=uncurryThis$2(DatePrototype.getTime);String(new Date(NaN))!=INVALID_DATE&&defineBuiltIn(DatePrototype,TO_STRING,(function(){var e=thisTimeValue(this);return e==e?nativeDateToString(this):INVALID_DATE}));var $$4=_export,bind=functionBind;$$4({target:"Function",proto:!0,forced:Function.bind!==bind},{bind:bind});var global$4=global$H,apply=functionApply,isCallable=isCallable$t,userAgent=engineUserAgent,arraySlice=arraySlice$b,validateArgumentsLength=validateArgumentsLength$4,MSIE=/MSIE .\./.test(userAgent),Function$1=global$4.Function,wrap=function(e){return MSIE?function(t,r){var i=validateArgumentsLength(arguments.length,1)>2,n=isCallable(t)?t:Function$1(t),o=i?arraySlice(arguments,2):void 0;return e(i?function(){apply(n,this,o)}:n,r)}:e},schedulersFix={setTimeout:wrap(global$4.setTimeout),setInterval:wrap(global$4.setInterval)},$$3=_export,global$3=global$H,setInterval$1=schedulersFix.setInterval;$$3({global:!0,bind:!0,forced:global$3.setInterval!==setInterval$1},{setInterval:setInterval$1});var $$2=_export,global$2=global$H,setTimeout$1=schedulersFix.setTimeout;$$2({global:!0,bind:!0,forced:global$2.setTimeout!==setTimeout$1},{setTimeout:setTimeout$1});var DESCRIPTORS=descriptors,uncurryThis$1=functionUncurryThis,objectKeys=objectKeys$4,toIndexedObject=toIndexedObject$c,$propertyIsEnumerable=objectPropertyIsEnumerable.f,propertyIsEnumerable=uncurryThis$1($propertyIsEnumerable),push=uncurryThis$1([].push),createMethod=function(e){return function(t){for(var r,i=toIndexedObject(t),n=objectKeys(i),o=n.length,a=0,s=[];o>a;)r=n[a++],DESCRIPTORS&&!propertyIsEnumerable(i,r)||push(s,e?[r,i[r]]:i[r]);return s}},objectToArray={entries:createMethod(!0),values:createMethod(!1)},$$1=_export,$values=objectToArray.values;$$1({target:"Object",stat:!0},{values:function(e){return $values(e)}});var global$1=global$H,fails=fails$K,uncurryThis=functionUncurryThis,toString=toString$f,trim=stringTrim.trim,whitespaces=whitespaces$3,charAt=uncurryThis("".charAt),$parseFloat$1=global$1.parseFloat,_Symbol=global$1.Symbol,ITERATOR=_Symbol&&_Symbol.iterator,FORCED=1/$parseFloat$1(whitespaces+"-0")!=-1/0||ITERATOR&&!fails((function(){$parseFloat$1(Object(ITERATOR))})),numberParseFloat=FORCED?function(e){var t=trim(toString(e)),r=$parseFloat$1(t);return 0===r&&"-"==charAt(t,0)?-0:r}:$parseFloat$1,$=_export,$parseFloat=numberParseFloat;function debounce(e,t,r){var i;return function(){var n=this,o=arguments,a=function(){i=null,r||e.apply(n,o)},s=r&&!i;clearTimeout(i),i=setTimeout(a,t),s&&e.apply(n,o)}}$({global:!0,forced:parseFloat!=$parseFloat},{parseFloat:$parseFloat});var EVENTS={MENU_REPORT:"MENU_REPORT",MENU_LOG:"MENU_LOG"},INFO_TYPES={VID:5,TYPE:10,CODECS:20,SPEED:30,BUFFER:40,PLAY_QUALITY:50,SCHEME:60,RESOLUTION:70,VIEWPORT:80,VOLUME:90,CDN:100,P2P:110,PLAYER_VERSION:120},LOG_TYPES={MENU:0,INTERACT:1,CONTEXTMENU:2},MENU_TYPES={STATS:0,REPORT:1},INTERACT_TYPES={CLOSE:0,COPY:1},CONTEXTMENU_TYPES={SHOW:0,HIDE:1},LOG_EVENTS={STATS:"STATS",REPORT:"REPORT",CLOSE:"CLOSE",COPY:"COPY",CONTEXTMENU_SHOW:"CONTEXTMENU_SHOW",CONTEXTMENU_HIDE:"CONTEXTMENU_HIDE"},events=Object.freeze(Object.defineProperty({__proto__:null,CONTEXTMENU_TYPES:CONTEXTMENU_TYPES,EVENTS:EVENTS,INFO_TYPES:INFO_TYPES,INTERACT_TYPES:INTERACT_TYPES,LOG_EVENTS:LOG_EVENTS,LOG_TYPES:LOG_TYPES,MENU_TYPES:MENU_TYPES},Symbol.toStringTag,{value:"Module"})),_cn,_en;function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var r,i=_getPrototypeOf(e);if(t){var n=_getPrototypeOf(this).constructor;r=Reflect.construct(i,arguments,n)}else r=i.apply(this,arguments);return _possibleConstructorReturn(this,r)}}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(e2){return!1}}var LANG_CONFIGS={cn:(_cn={},_defineProperty$1(_cn,INFO_TYPES.VID,"VID"),_defineProperty$1(_cn,INFO_TYPES.TYPE,"类型"),_defineProperty$1(_cn,INFO_TYPES.CODECS,"编码"),_defineProperty$1(_cn,INFO_TYPES.SPEED,"加载速度"),_defineProperty$1(_cn,INFO_TYPES.BUFFER,"缓冲时长"),_defineProperty$1(_cn,INFO_TYPES.PLAY_QUALITY,"丢帧率"),_defineProperty$1(_cn,INFO_TYPES.SCHEME,"视频协议"),_defineProperty$1(_cn,INFO_TYPES.RESOLUTION,"分辨率"),_defineProperty$1(_cn,INFO_TYPES.VIEWPORT,"视图尺寸"),_defineProperty$1(_cn,INFO_TYPES.VOLUME,"音量大小"),_defineProperty$1(_cn,INFO_TYPES.CDN,"CDN"),_defineProperty$1(_cn,INFO_TYPES.P2P,"P2P"),_defineProperty$1(_cn,INFO_TYPES.PLAYER_VERSION,"播放器版本"),_cn),en:(_en={},_defineProperty$1(_en,INFO_TYPES.VID,"Video ID"),_defineProperty$1(_en,INFO_TYPES.TYPE,"Video Type"),_defineProperty$1(_en,INFO_TYPES.CODECS,"Codecs"),_defineProperty$1(_en,INFO_TYPES.SPEED,"Connection Speed"),_defineProperty$1(_en,INFO_TYPES.BUFFER,"Buffer Health"),_defineProperty$1(_en,INFO_TYPES.PLAY_QUALITY,"Dropped Frames"),_defineProperty$1(_en,INFO_TYPES.SCHEME,"Protocol"),_defineProperty$1(_en,INFO_TYPES.RESOLUTION,"Res"),_defineProperty$1(_en,INFO_TYPES.VIEWPORT,"Viewport"),_defineProperty$1(_en,INFO_TYPES.VOLUME,"Volume"),_defineProperty$1(_en,INFO_TYPES.CDN,"CDN"),_defineProperty$1(_en,INFO_TYPES.P2P,"P2P"),_defineProperty$1(_en,INFO_TYPES.PLAYER_VERSION,"Player Version"),_en)},MenuPlugin=function(e){_inherits(r,e);var t=_createSuper(r);function r(){return _classCallCheck(this,r),t.apply(this,arguments)}return _createClass$1(r,[{key:"afterCreate",value:function(){}},{key:"onPluginsReady",value:function(){var e=this.player.plugins.stats;this.menuInst=new Menu(this.player,this.config||{},e)}}],[{key:"pluginName",get:function(){return"MenuPlugin"}},{key:"defaultConfig",get:function(){return{enableDebug:!0}}}]),r}(BasePlugin),ReportIcon='<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M5.71429 5C5.3198 5 5 5.3198 5 5.71429V14.2857C5 14.6802 5.3198 15 5.71429 15H14.2857C14.6802 15 15 14.6802 15 14.2857V10C15 9.44772 15.4477 9 16 9C16.5523 9 17 9.44772 17 10V14.2857C17 15.7848 15.7848 17 14.2857 17H5.71429C4.21523 17 3 15.7848 3 14.2857V5.71429C3 4.21523 4.21523 3 5.71429 3H10C10.5523 3 11 3.44772 11 4C11 4.55228 10.5523 5 10 5H5.71429Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M16.7071 3.29289C17.0976 3.68342 17.0976 4.31658 16.7071 4.70711L10.7071 10.7071C10.3166 11.0976 9.68342 11.0976 9.29289 10.7071C8.90237 10.3166 8.90237 9.68342 9.29289 9.29289L15.2929 3.29289C15.6834 2.90237 16.3166 2.90237 16.7071 3.29289Z" fill="currentColor"/></svg>',StatsIcon='<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9 10C9 9.44771 9.44771 9 10 9C10.5523 9 11 9.44772 11 10V13C11 13.5523 10.5523 14 10 14C9.44771 14 9 13.5523 9 13V10Z" fill="currentColor"/><path d="M10 6C9.44771 6 9 6.44772 9 7C9 7.55228 9.44771 8 10 8C10.5523 8 11 7.55228 11 7C11 6.44772 10.5523 6 10 6Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M18 10C18 14.4183 14.4183 18 10 18C5.58172 18 2 14.4183 2 10C2 5.58172 5.58172 2 10 2C14.4183 2 18 5.58172 18 10ZM10 16C13.3137 16 16 13.3137 16 10C16 6.68629 13.3137 4 10 4C6.68629 4 4 6.68629 4 10C4 13.3137 6.68629 16 10 16Z" fill="currentColor"/></svg>',CloseIcon$1='<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M16.1231 4.08053C16.5136 4.47105 16.5136 5.10422 16.1231 5.49474L11.453 10.1648L16.1231 14.8349C16.5136 15.2254 16.5136 15.8586 16.1231 16.2491C15.7326 16.6397 15.0994 16.6397 14.7089 16.2491L10.0388 11.579L5.36873 16.2491C4.9782 16.6397 4.34504 16.6397 3.95451 16.2491C3.56399 15.8586 3.56399 15.2254 3.95451 14.8349L8.6246 10.1648L3.95451 5.49474C3.56399 5.10422 3.56399 4.47105 3.95451 4.08053C4.34504 3.69001 4.9782 3.69001 5.36873 4.08053L10.0388 8.75061L14.7089 4.08053C15.0994 3.69 15.7326 3.69 16.1231 4.08053Z" fill="currentColor"/></svg>',CopyIcon='<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M6 3C5.44772 3 5 3.44772 5 4C5 4.55228 5.44772 5 6 5H13.5C14.3284 5 15 5.67157 15 6.5V14C15 14.5523 15.4477 15 16 15C16.5523 15 17 14.5523 17 14V6.5C17 4.567 15.433 3 13.5 3H6ZM4 8H12V16H4L4 8ZM2 8C2 6.89543 2.89543 6 4 6H12C13.1046 6 14 6.89543 14 8V16C14 17.1046 13.1046 18 12 18H4C2.89543 18 2 17.1046 2 16V8ZM5.75 9.5C5.33579 9.5 5 9.83579 5 10.25C5 10.6642 5.33579 11 5.75 11H10.25C10.6642 11 11 10.6642 11 10.25C11 9.83579 10.6642 9.5 10.25 9.5H5.75ZM5 13.75C5 13.3358 5.33579 13 5.75 13H10.25C10.6642 13 11 13.3358 11 13.75C11 14.1642 10.6642 14.5 10.25 14.5H5.75C5.33579 14.5 5 14.1642 5 13.75Z" fill="currentColor"/></g></svg>',Menu=function(){function e(t,r,i){_classCallCheck(this,e),this.player=t,this.options=r||{},this.statsPlugin=i;var n={report:ReportIcon,stats:StatsIcon,close:CloseIcon$1,copy:CopyIcon},o=Object.assign({},n,this.options.icons);this.options.icons=o,this.playerInstance="dash_"+(new Date).getTime(),window[this.playerInstance]=this.player,this.menuItems=[{name:"视频统计信息",handler:this.showPanelInfo.bind(this),type:MENU_TYPES.STATS,icon:o.stats,eventName:LOG_EVENTS.STATS},{name:"播放问题反馈",handler:this._handleReport.bind(this),type:MENU_TYPES.REPORT,icon:o.report,eventName:LOG_EVENTS.REPORT}],this.playerHandler=[{evt:"RESOLUTION_UPDATE",handler:this._resolutionUpdate.bind(this)},{evt:"menusegment",handler:this._recordLastSegment.bind(this)},{evt:"resourceReady",handler:this._startup.bind(this)},{evt:"canplay",handler:this._startup.bind(this)},{evt:"ended",handler:this.destroyDOM.bind(this)},{evt:"destroy",handler:this.destroy.bind(this)},{evt:"playertypechange",handler:this.destroyDOM.bind(this)},{evt:"codecsupdate",handler:this._codecsUpdate.bind(this)}];for(var a=0;a<this.playerHandler.length;a++){var s=this.playerHandler[a],l=s.evt,c=s.handler;this.player.on(l,c)}this.debugInfo={ua:navigator.userAgent,version:this.player.playerVersion},this._pollTimer=null,this.hasInitDOM=!1,this._cacheMap={},this.menuHandler=this._menuHandler.bind(this),this.munuHideHandler=this._munuHideHandler.bind(this),this.rootClickHandler=this._rootClickHandler.bind(this),this._initDatas()}return _createClass$1(e,[{key:"_reset",value:function(){this.hasInitDOM=!1,this._cacheMap={},this._lastSegment=null}},{key:"_noop",value:function(){}},{key:"_recordLastSegment",value:function(e){this._lastSegment=e}},{key:"_resolutionUpdate",value:function(e){if(!this._cacheUpdate(INFO_TYPES.RESOLUTION)){var t=this.infoItems[INFO_TYPES.RESOLUTION];e?(t.value=e,this.updateInfoItem(t)):(t.hide=!0,this.createPanelInfo())}}},{key:"_codecsUpdate",value:function(e){if(!this._cacheUpdate(INFO_TYPES.CODECS)){var t=this.infoItems[INFO_TYPES.CODECS];t.value=e,this.updateInfoItem(t)}}},{key:"_cacheUpdate",value:function(e){return!this.hasInitDOM&&(this._cacheMap[e]=!0,!0)}},{key:"_handleReport",value:function(){for(var e=this.player.video.readyState,t=this.player.video.buffered,r=[],i=0;i<t.length;i++){var n=t.start(i),o=t.end(i);r.push({start:n,end:o})}var a={readyState:e,curTime:this.player.video.currentTime,err:this.player.video.error||-1,buffer:r},s=Object.assign({debug_date:new Date,type:this.type},this.debugInfo,{videoInfo:a});this._lastSegment&&(s.segment=this._lastSegment),this.options.enableDebug&&this.statsPlugin&&(s.stats=this.statsPlugin.getStats()),this.player.emit(EVENTS.MENU_REPORT,s)}},{key:"_startup",value:function(){if(!this.hasInitDOM){this.type=this.player.currentFormat,this._initDatas(),this._initDOM();for(var e=Object.keys(this._cacheMap),t=0;t<e.length;t++){var r=e[t],i=this.infoItems[r];this.updateInfoItem(i,!0)}}}},{key:"_initDatas",value:function(){var e;this.parentNode=this.player.root,this._isPlayQualitySupported=this.player.video&&"function"==typeof this.player.video.getVideoPlaybackQuality;var t=this.player.playerType,r=LANG_CONFIGS.cn,i=this.options.lang||"cn";this.langConfig=this.options.langConfig||LANG_CONFIGS[i]||r,this.infoItems=(_defineProperty$1(e={},INFO_TYPES.VID,{name:"VID",value:this.player.config.vid,render:renderPlainText,hide:!this.player.config.vid,key:"vid"}),_defineProperty$1(e,INFO_TYPES.TYPE,{name:"类型",value:t,render:renderPlainText,key:"player_type"}),_defineProperty$1(e,INFO_TYPES.CODECS,{name:"编码",value:this.player.menuCodeType,render:renderPlainText,key:"menuCodeType",hide:!this.player.menuCodeType}),_defineProperty$1(e,INFO_TYPES.SPEED,{name:"加载速度",value:0,render:renderPlainText,posfix:" KB/s",hide:!this._isMenusHide("speed"),key:"speed"}),_defineProperty$1(e,INFO_TYPES.BUFFER,{name:"缓冲时长",value:0,render:renderPlainText,posfix:"s",key:"buffer"}),_defineProperty$1(e,INFO_TYPES.PLAY_QUALITY,{name:"丢帧率",value:{droppedVideoFrames:0,totalVideoFrames:0},render:renderPlayQuality,hide:null===this.player.video.getVideoPlaybackQuality,key:"frames_info"}),_defineProperty$1(e,INFO_TYPES.SCHEME,{name:"视频协议",value:"HTTPS",render:renderPlainText,key:"scheme"}),_defineProperty$1(e,INFO_TYPES.CDN,{name:"CDN",value:this.player.CDNUrl?this.player.CDNUrl:"false",render:renderPlainText,hide:!this._isMenusHide("cdn"),key:"CDN"}),_defineProperty$1(e,INFO_TYPES.P2P,{name:"P2P",value:"false",render:renderPlainText,hide:!0,key:"p2p"}),_defineProperty$1(e,INFO_TYPES.RESOLUTION,{name:"分辨率",value:{width:0,height:0,fps:void 0},render:renderResolution,hide:!this._isMenusHide("resolution"),key:"resolution"}),_defineProperty$1(e,INFO_TYPES.VIEWPORT,{name:"视图尺寸",value:{width:0,height:0},render:renderResolution,key:"viewport"}),_defineProperty$1(e,INFO_TYPES.VOLUME,{name:"音量大小",value:(100*this.player.config.volume).toFixed(0)+"%",render:renderPlainText,key:"volume"}),_defineProperty$1(e,INFO_TYPES.PLAYER_VERSION,{name:"播放器版本",value:this.player.playerVersion,render:renderPlainText,key:"player_version"}),e);for(var n=Object.keys(this.infoItems),o=0;o<n.length;o++){var a=n[o];this.infoItems[a].type=a}for(var s=this.options.infoItems||[],l=0;l<s.length;l++){var c=s[l];c.name&&c.type&&c.key?(c.render&&isFunction(c.render)||(c.render=renderPlainText),this.infoItems[c.type]=c):warn("".concat(c.name))}}},{key:"_isMenusHide",value:function(e){return!0===(this.player.supportMenus||{})[e]}},{key:"renderItemByType",value:function(e,t){var r=this.infoItems[e];r?(r.value=t,this._cacheUpdate(e)||this.updateInfoItem(r)):warn("".concat(e," item null"))}},{key:"_initDOM",value:function(){if(this.parentNode&&util){this.hasInitDOM=!0;var e=document.createDocumentFragment(),t=document.createElement("xg-menu");util.addClass(t,"xg-menu"),this.rightMenu=t;for(var r=this.menuItems.filter((function(e){return!e.hide})),i=0;i<r.length;i++)e.appendChild(this.createMenuItem(r[i]));t.appendChild(e),this.toggle(this.rightMenu,!1),this.parentNode.appendChild(t),this.parentNode.addEventListener("contextmenu",this.menuHandler,!1),document.addEventListener("click",this.munuHideHandler,!1),this.parentNode.addEventListener("click",this.rootClickHandler,!0),this.createPanelInfo(),this.bindEvents(),this.tick()}}},{key:"_menuHandler",value:function(e){if(e.preventDefault(),e.stopPropagation(),this.isPIPMode())return!1;var t=this.getOffset(),r=e.clientX-t.x+document.body.scrollLeft+document.documentElement.scrollLeft,i=e.clientY-t.y+document.body.scrollTop+document.documentElement.scrollTop,n=this.parentNode.clientWidth,o=this.parentNode.clientHeight;this.toggle(this.rightMenu,!0);var a=this.rightMenu.offsetWidth,s=this.rightMenu.offsetHeight,l=r+a>n?n-a:r,c=i+s>o?o-s:i;this.rightMenu.style.left=l+"px",this.rightMenu.style.top=c+"px",this.emitLog(LOG_TYPES.CONTEXTMENU,CONTEXTMENU_TYPES.SHOW,LOG_EVENTS.CONTEXTMENU_SHOW)}},{key:"getOffset",value:function(){for(var e=this.parentNode,t=0,r=0;e&&!Number.isNaN(e.offsetLeft)&&!Number.isNaN(e.offsetTop);)t+=e.offsetLeft-e.scrollLeft,r+=e.offsetTop-e.scrollTop,e=e.offsetParent;return{x:t,y:r}}},{key:"_munuHideHandler",value:function(){this.rightMenu&&"block"===this.rightMenu.style.display&&this.emitLog(LOG_TYPES.CONTEXTMENU,CONTEXTMENU_TYPES.HIDE,LOG_EVENTS.CONTEXTMENU_HIDE),this.toggle(this.rightMenu,!1)}},{key:"_rootClickHandler",value:function(e){"block"===this.rightMenu.style.display&&e.target===this.player.video&&(e.stopPropagation(),e.preventDefault(),this._munuHideHandler())}},{key:"tick",value:function(){var e=this;this._pollTimer=setTimeout((function(){clearTimeout(e._pollTimer),e._poll(),e.tick(),e.isPIPMode()&&(e.toggle(e.rightMenu,!1),e.toggle(e.panelInfo,!1))}),500)}},{key:"_poll",value:function(){var e=this.bufferLength,t=this.infoItems[INFO_TYPES.BUFFER];if(t.value=e,this.updateInfoItem(t),this.player.video.getVideoPlaybackQuality){var r=this.player.video.getVideoPlaybackQuality(),i=this.infoItems[INFO_TYPES.PLAY_QUALITY];i.value={totalVideoFrames:r.totalVideoFrames,droppedVideoFrames:r.droppedVideoFrames},this.updateInfoItem(i)}var n=this.infoItems[INFO_TYPES.SPEED];if(!n.hide){var o=Math.floor(this.player.downloadSpeed);n.value=o,this.updateInfoItem(n)}}},{key:"bindEvents",value:function(){var e=this,t=this.player.video;this.handleVolumeChange=this._handleVolumeChange.bind(this),t.addEventListener("volumechange",this.handleVolumeChange);t.addEventListener("DOMNodeInserted",(function r(){t.removeEventListener("DOMNodeInserted",r),e._onWinElemSizeChange()})),this.onWinSizeChange=debounce(this._onWinElemSizeChange.bind(this),1e3,!1),window.addEventListener("resize",this.onWinSizeChange),e._onWinElemSizeChange()}},{key:"_onWinElemSizeChange",value:function(){if(this.player&&this.player.video){var e=this.player.video.getBoundingClientRect(),t=this.infoItems[INFO_TYPES.VIEWPORT];if(t.value={width:Math.floor(e.width),height:Math.floor(e.height)},this._cacheUpdate(INFO_TYPES.VIEWPORT))return;this.updateInfoItem(t)}}},{key:"_handleVolumeChange",value:function(){var e=this.infoItems[INFO_TYPES.VOLUME];e.value=(100*this.player.video.volume).toFixed(0)+"%",this._cacheUpdate(INFO_TYPES.VOLUME)||this.updateInfoItem(e)}},{key:"createMenuItem",value:function(e){var t=this,r=document.createElement("div");if(r.classList.add("v-menu-item"),e.clsName&&r.classList.add(e.clsName),e.icon){var i=document.createElement("div");util.addClass(i,"menu-item-icon"),i.innerHTML=e.icon,r.appendChild(i)}var n=document.createElement("div");return util.addClass(n,"menu-item-content"),n.textContent=e.name,r.appendChild(n),!1!==r.clickable&&r.addEventListener("click",(function(r){r.stopPropagation(),r.preventDefault(),t.toggle(t.rightMenu,!1),e.handler(),t.emitLog(LOG_TYPES.MENU,e.type,e.eventName)})),r}},{key:"createIconBtn",value:function(e,t,r,i){var n=document.createElement("div");return util.addClass(n,e),n.innerHTML=t+"<div class='svg-hover'>".concat(r,"</div>"),i.appendChild(n),n}},{key:"createPanelInfo",value:function(){var e=this,t=document.createElement("xg-panel-info");util.addClass(t,"xg-panel-info"),this.createIconBtn("xg-info-close xg-interact-icon",this.options.icons.close,"关闭",t).addEventListener("click",(function(){e.toggle(t,!1),e.panelVisible=!1,e.emitLog(LOG_TYPES.INTERACT,INTERACT_TYPES.CLOSE,LOG_EVENTS.CLOSE)})),this.createIconBtn("xg-info-copy xg-interact-icon",this.options.icons.copy,"复制",t).addEventListener("click",(function(){for(var t=Object.values(e.infoItems).filter((function(e){return!e.hide})),r={},i=0;i<t.length;i++){var n=t[i],o=n.key,a=void 0;a=e.options.connectPrefix&&n.posfix?"".concat(n.value).concat(n.posfix):n.value,r[o]=a}e.options.enableDebug&&e.statsPlugin&&Object.assign(r,{stats:e.statsPlugin.getStats()}),e.copyToClipboard(JSON.stringify(r)),e.emitLog(LOG_TYPES.INTERACT,INTERACT_TYPES.COPY,LOG_EVENTS.COPY)}));var r=document.createElement("ul");util.addClass(r,"xg-panel-detail");for(var i=Object.values(this.infoItems).filter((function(e){return!e.hide})),n=document.createDocumentFragment(),o=0;o<i.length;o++){var a=this.createInfoItem(i[o]);n.appendChild(a)}r.appendChild(n),t.appendChild(r),this.panelInfo=t,this.player.root.appendChild(t)}},{key:"createInfoItem",value:function(e){var t=document.createElement("li");return e.elem=t,this.updateInfoItem(e),t}},{key:"showPanelInfo",value:function(){this.toggle(this.panelInfo,!0),this.panelVisible=!0;for(var e=Object.values(this.infoItems).filter((function(e){return!e.hide})),t=0;t<e.length;t++)this.updateInfoItem(e[t])}},{key:"copyToClipboard",value:function(e){var t=document.createElement("textarea");t.style.height="0px",t.style.width="1px",document.body.appendChild(t),t.value=e,t.select(),document.execCommand("copy"),document.body.removeChild(t)}},{key:"updateInfoItem",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.panelVisible||t){var r=e.elem;removeAllChildren(r);var i=document.createElement("label"),n=this.langConfig[e.type]||e.name;i.textContent=n+"",util.addClass(i,"xg-item-label"),r.appendChild(i);var o=document.createElement("span"),a=e.ctx||null,s=e.render.call(a,e.value);s instanceof Element?o.appendChild(s):o.textContent="".concat(s).concat(e.posfix?e.posfix:""),r.appendChild(o)}}},{key:"toggle",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e&&(e.style.display=t?"block":"none")}},{key:"bufferLength",get:function(){var e=this.player.getBufferedRange(),t=this.player.video.currentTime,r=e[1]-Math.max(e[0],t);return r=Math.max(0,r).toFixed(2),parseFloat(r)}},{key:"destroyDOM",value:function(){this.parentNode.removeEventListener("contextmenu",this.menuHandler),document.removeEventListener("click",this.munuHideHandler,!1),this.parentNode.removeEventListener("click",this.rootClickHandler,!0),this._reset(),this.removeElement(this.rightMenu),this.removeElement(this.panelInfo),this.rightMenu=null,this.panelInfo=null,this._pollTimer&&clearTimeout(this._pollTimer)}},{key:"destroy",value:function(){this.destroyDOM(),this.destroyEvents()}},{key:"destroyEvents",value:function(){for(var e=0;e<this.playerHandler.length;e++){var t=this.playerHandler[e],r=t.evt,i=t.handler;this.player.off(r,i)}window.removeEventListener("resize",this.onWinSizeChange)}},{key:"removeElement",value:function(e){e&&e.parentNode&&e.parentNode.removeChild(e)}},{key:"isPIPMode",value:function(){return util.hasClass(this.parentNode,"xgplayer-pip-active")}},{key:"emitLog",value:function(e,t,r){this.player.emit(EVENTS.MENU_LOG,{logType:e,code:t,event:r})}}]),e}();function renderPlainText(e){return e}function renderPlayQuality(e){var t=e.droppedVideoFrames,r=e.totalVideoFrames,i=0;i=0===r?0:t/r*100;var n=document.createElement("span"),o=document.createElement("span");o.textContent=t,n.appendChild(o);var a=document.createElement("span");return a.textContent="/".concat(r,", ").concat(i.toFixed(2),"%"),n.appendChild(a),n}function renderResolution(e){var t=e.width,r=e.height,i=e.fps;return"".concat(t," * ").concat(r).concat(void 0!==i?" / ".concat(i,"fps"):"")}function removeAllChildren(e){for(;e&&e.firstChild;)e.removeChild(e.firstChild)}function warn(e){console&&console.warn&&console.warn(e)}function isFunction(e){return"[object Function]"===Object.prototype.toString.call(e)}MenuPlugin.MenuEvents=events,MenuPlugin.Menu=Menu;var NativeSubTitle=function(e){_inherits$5(r,e);var t=_createSuper$5(r);function r(e){var i;return _classCallCheck$5(this,r),_defineProperty$6(_assertThisInitialized$5(i=t.call(this)),"_onChange",(function(e){var t=i._media.textTracks;if(t&&0!==t.length){for(var r=[],n=[],o=-1,a=0;a<t.length;a++){var s=t[a];"subtitles"===s.kind&&(r.push({id:s.id||s.language,language:s.language,text:s.label,isDefault:"showing"===s.mode}),-1===o&&"showing"===s.mode&&(o=a),n.push(s.language))}n.join("|")!==i._languages?(i._languages=n.join("|"),i.emit("reset",{list:r,isOpen:o>-1})):-1===o?i.emit("off"):i.curIndex!==o&&i.emit("change",r[o]),i.curIndex=o}})),i._media=e,i._list=[],i._languages="",i.curIndex=-1,i._init(),i}return _createClass$6(r,[{key:"_init",value:function(){var e=this._media.textTracks;e?(e.addEventListener("change",this._onChange),e.addEventListener("addtrack",this._onChange)):console.warn("current browser not support native subtitle")}},{key:"switch",value:function(e){var t=this;return new Promise((function(r,i){if(!e)return i({code:1,message:"no subtitle data"});for(var n=t._media.textTracks,o=0;o<n.length;o++){var a=n[o];a.language===e.language?a.mode="showing":"showing"===a.mode&&(a.mode="disabled")}return r({code:0})}))}},{key:"switchOff",value:function(){for(var e=this._media.textTracks,t=0;t<e.length;t++)e[t].mode="disabled";this.curIndex=-1}},{key:"destroy",value:function(){this._media.textTracks.removeEventListener("change",this._onChange),this._media=null,this._list=[],this._languages="",this.curIndex=-1}}]),r}(EventEmitter);function OpenIcon(){return(new DOMParser).parseFromString('<svg width="18" height="16" viewBox="0 0 18 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2 0.5C0.895431 0.5 0 1.39543 0 2.5V13.5C0 14.6046 0.89543 15.5 2 15.5H16C17.1046 15.5 18 14.6046 18 13.5V2.5C18 1.39543 17.1046 0.5 16 0.5H2ZM7.49634 11.0454C8.00741 10.606 8.29061 10.0037 8.34595 9.23877H6.8811C6.84855 9.67171 6.71997 9.99235 6.49536 10.2007C6.27401 10.4058 5.93709 10.5083 5.48462 10.5083C4.98332 10.5083 4.61548 10.3309 4.3811 9.97607C4.14998 9.62126 4.03442 9.05973 4.03442 8.2915V7.75439C4.04093 7.01872 4.16463 6.47673 4.40552 6.12842C4.64966 5.77686 5.01587 5.60107 5.50415 5.60107C5.95337 5.60107 6.28703 5.70524 6.50513 5.91357C6.72648 6.11865 6.85506 6.45068 6.89087 6.90967H8.35571C8.27759 6.1154 7.98787 5.49854 7.48657 5.05908C6.98527 4.61963 6.32446 4.3999 5.50415 4.3999C4.9117 4.3999 4.39087 4.53988 3.94165 4.81982C3.49569 5.09652 3.15226 5.49528 2.91138 6.01611C2.67049 6.53695 2.55005 7.13916 2.55005 7.82275V8.25732C2.55005 9.32829 2.81047 10.1714 3.3313 10.7866C3.85539 11.3986 4.57316 11.7046 5.48462 11.7046C6.31795 11.7046 6.98853 11.4849 7.49634 11.0454ZM14.5393 11.0454C15.0504 10.606 15.3336 10.0037 15.3889 9.23877H13.9241C13.8915 9.67171 13.7629 9.99235 13.5383 10.2007C13.317 10.4058 12.9801 10.5083 12.5276 10.5083C12.0263 10.5083 11.6584 10.3309 11.4241 9.97607C11.193 9.62126 11.0774 9.05973 11.0774 8.2915V7.75439C11.0839 7.01872 11.2076 6.47673 11.4485 6.12842C11.6926 5.77686 12.0588 5.60107 12.5471 5.60107C12.9963 5.60107 13.33 5.70524 13.5481 5.91357C13.7695 6.11865 13.898 6.45068 13.9338 6.90967H15.3987C15.3206 6.1154 15.0308 5.49854 14.5295 5.05908C14.0282 4.61963 13.3674 4.3999 12.5471 4.3999C11.9547 4.3999 11.4338 4.53988 10.9846 4.81982C10.5387 5.09652 10.1952 5.49528 9.95435 6.01611C9.71346 6.53695 9.59302 7.13916 9.59302 7.82275V8.25732C9.59302 9.32829 9.85343 10.1714 10.3743 10.7866C10.8984 11.3986 11.6161 11.7046 12.5276 11.7046C13.3609 11.7046 14.0315 11.4849 14.5393 11.0454Z" fill="white"/>\n</svg>',"image/svg+xml").firstChild}function CloseIcon(){return(new DOMParser).parseFromString('<svg width="18" height="16" viewBox="0 0 18 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M7.49609 11.0454C8.00716 10.606 8.29037 10.0037 8.3457 9.23877H6.88086C6.84831 9.67171 6.71973 9.99235 6.49512 10.2007C6.27376 10.4058 5.93685 10.5083 5.48438 10.5083C4.98307 10.5083 4.61523 10.3309 4.38086 9.97607C4.14974 9.62126 4.03418 9.05973 4.03418 8.2915V7.75439C4.04069 7.01872 4.16439 6.47673 4.40527 6.12842C4.64941 5.77686 5.01562 5.60107 5.50391 5.60107C5.95312 5.60107 6.28678 5.70524 6.50488 5.91357C6.72624 6.11865 6.85482 6.45068 6.89062 6.90967H8.35547C8.27734 6.1154 7.98763 5.49854 7.48633 5.05908C6.98503 4.61963 6.32422 4.3999 5.50391 4.3999C4.91146 4.3999 4.39062 4.53988 3.94141 4.81982C3.49544 5.09652 3.15202 5.49528 2.91113 6.01611C2.67025 6.53695 2.5498 7.13916 2.5498 7.82275V8.25732C2.5498 9.32829 2.81022 10.1714 3.33105 10.7866C3.85514 11.3986 4.57292 11.7046 5.48438 11.7046C6.31771 11.7046 6.98828 11.4849 7.49609 11.0454Z" fill="white"/>\n<path d="M14.5391 11.0454C15.0501 10.606 15.3333 10.0037 15.3887 9.23877H13.9238C13.8913 9.67171 13.7627 9.99235 13.5381 10.2007C13.3167 10.4058 12.9798 10.5083 12.5273 10.5083C12.026 10.5083 11.6582 10.3309 11.4238 9.97607C11.1927 9.62126 11.0771 9.05973 11.0771 8.2915V7.75439C11.0837 7.01872 11.2074 6.47673 11.4482 6.12842C11.6924 5.77686 12.0586 5.60107 12.5469 5.60107C12.9961 5.60107 13.3298 5.70524 13.5479 5.91357C13.7692 6.11865 13.8978 6.45068 13.9336 6.90967H15.3984C15.3203 6.1154 15.0306 5.49854 14.5293 5.05908C14.028 4.61963 13.3672 4.3999 12.5469 4.3999C11.9544 4.3999 11.4336 4.53988 10.9844 4.81982C10.5384 5.09652 10.195 5.49528 9.9541 6.01611C9.71322 6.53695 9.59277 7.13916 9.59277 7.82275V8.25732C9.59277 9.32829 9.85319 10.1714 10.374 10.7866C10.8981 11.3986 11.6159 11.7046 12.5273 11.7046C13.3607 11.7046 14.0312 11.4849 14.5391 11.0454Z" fill="white"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M0 2.5C0 1.39543 0.895431 0.5 2 0.5H16C17.1046 0.5 18 1.39543 18 2.5V13.5C18 14.6046 17.1046 15.5 16 15.5H2C0.89543 15.5 0 14.6046 0 13.5V2.5ZM2 2.3H16C16.1105 2.3 16.2 2.38954 16.2 2.5V13.5C16.2 13.6105 16.1105 13.7 16 13.7H2C1.88954 13.7 1.8 13.6105 1.8 13.5V2.5C1.8 2.38954 1.88954 2.3 2 2.3Z" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}var index_min$1="",POSITIONS$7=Plugin.POSITIONS,IS_MOBILE="mobile"===sniffer$1.device,DEFAULT_CLOSE_TYPE="text-close";function formatList(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=-1;return e.map((function(e,r){e.id||e.language||(e.id=""+r),!e.url&&(e.url=e.src),!e.text&&(e.text=e.label),!e.language&&(e.language=e.srclang),void 0===e.isDefault&&(e.isDefault=e.default),(e.isDefault||e.default)&&(t<0?t=r:e.isDefault=e.default=!1)})),t}var Subtitle=function(e){_inherits$5(r,e);var t=_createSuper$5(r);function r(e){var i;_classCallCheck$5(this,r),(i=t.call(this,e)).isOpenState=!0,i.optionList=null,i.currentLang="",i.handlerClickSwitch=function(e,t){e.stopPropagation(),e.preventDefault(),i.subTitles&&(t.type===DEFAULT_CLOSE_TYPE?i.switchOffSubtitle():i.switchSubTitle({language:t.language,id:t.id}))},i.onPlayerFocus=function(e){i.subTitles&&i.config.style.follow&&i.rePosition()},i.onPlayerBlur=function(e){i.subTitles&&i.config.style.follow&&!i.playerConfig.marginControls&&i.subTitles.root&&(i.subTitles.root.style.transform="translate(0, 0)")};var n=e.player;return e.config,n.config.isLive&&(e.config.updateMode="live",sniffer$1.os.isIos&&(e.config.mode="native")),i}return _createClass$6(r,[{key:"afterCreate",value:function(){var e=this.config.list,t=void 0===e?[]:e;this.curIndex=-1,this.curItem=null;var i=formatList(t);_get$3(_getPrototypeOf$5(r.prototype),"afterCreate",this).call(this),"native"===this.config.mode?this._initNativeSubtitle(i):this._initExtSubTitle(i)}},{key:"_initNativeSubtitle",value:function(e){var t=this.player;t._subTitles||(t._subTitles=new NativeSubTitle(t.video)),this.subTitles=t._subTitles,this.subTitles.on("off",this._onOff.bind(this)),this.subTitles.on("change",this._onChange.bind(this)),this.subTitles.on("reset",this._onListReset.bind(this)),this._renderList(e)}},{key:"_initExtSubTitle",value:function(e){var t=this.config,r=t.list,i=void 0===r?[]:r,n=t.style,o=t.isDefaultOpen,a={subTitles:i,defaultOpen:o,debugger:!1,updateMode:t.updateMode};this.isOpenState=o,Object.keys(n).map((function(e){a[e]=n[e]})),!this.playerConfig.marginControls&&this.player.controls.root&&(this.on(PLAYER_FOCUS,this.onPlayerFocus),this.on(PLAYER_BLUR,this.onPlayerBlur));var s=this.player;s._subTitles?s._subTitles._isOpen&&(e=this.getSubTitleIndex(this.config.list,s._subTitles.currentText)):(s._subTitles=new Subtitle$1(a),s._subTitles.attachPlayer(this.player),this.changeTipText()),this.subTitles=s._subTitles,this.subTitles.on("off",this._onOff.bind(this)),this.subTitles.on("change",this._onChange.bind(this)),this.subTitles.on("reset",this._onListReset.bind(this)),n.follow&&this.subTitles.root&&util.addClass(this.subTitles.root,"follow-control"),this._renderList(e)}},{key:"_renderList",value:function(e){var t=this.config,r=t.list,i=void 0===r?[]:r,n=t.isDefaultOpen;i.length&&(n&&e<0?(i[0].isDefault=!0,this.curIndex=0,this.curItem=i[0]):(this.curIndex=e,this.curItem=i[e])),this.appendChild(".xgplayer-icon",this.icons.vttSubOpen),this.appendChild(".xgplayer-icon",this.icons.vttSubClose),this.creatOptionList(),this.initEvents(),this.isOpenState?util.addClass(this.root,"isOpen"):util.addClass(this.root,"isClose")}},{key:"_onOff",value:function(){this.noShowSubtitle()}},{key:"_onChange",value:function(e){var t=this.getSubTitleIndex(this.config.list,e);t<0||this.updateCurItem(t,e)}},{key:"_onListReset",value:function(e){this.updateList(e)}},{key:"updateCurItem",value:function(e,t){this.curIndex=e,this.curItem=this.config.list[e-1],this.renderItemList(),this.emit("subtitle_change",_objectSpread2$5({off:!1,isListUpdate:!1,list:[]},t))}},{key:"initEvents",value:function(){this.bind(["click"],this.handleButtonChange.bind(this)),this.bind(["mouseenter"],this.showList.bind(this)),this.bind(["mouseleave"],this.hideList.bind(this)),this._delegates=[]}},{key:"handleButtonChange",value:function(e){e.preventDefault(),e.stopPropagation(),e.delegateTarget||(IS_MOBILE?this.showMobilePanel():this.isOpenState?this.switchOffSubtitle():this.openSubtitle())}},{key:"showList",value:function(){var e;!IS_MOBILE&&this.isOpenState&&(null===(e=this.optionList)||void 0===e||e.show())}},{key:"hideList",value:function(){var e;!IS_MOBILE&&this.isOpenState&&(null===(e=this.optionList)||void 0===e||e.hide())}},{key:"openSubtitle",value:function(){this.curIndex>-1&&this.curItem&&this.switchSubTitle(this.curItem)}},{key:"getSubTitleIndex",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{id:"",language:""},r=-1;return t&&(t.id||t.language)?(e.forEach((function(e,i){e.id!==t.id&&e.language!==t.language||(r=i)})),r):r}},{key:"registerIcons",value:function(){return{vttSubOpen:{icon:OpenIcon,class:"xgplayer-vttsub-open-svg"},vttSubClose:{icon:CloseIcon,class:"xgplayer-vttsub-close-svg"}}}},{key:"registerLanguageTexts",value:function(){return{sub:{jp:"字幕",en:"Subtitles",zh:"字幕","zh-hk":"字幕"},subOpen:{jp:"字幕をオンにする",en:"Show subtitles",zh:"开启字幕","zh-hk":"開啟字幕"},subClose:{jp:"クローズドキャプション",en:"Hide subtitles",zh:"关闭字幕","zh-hk":"關閉字幕"}}}},{key:"creatOptionList",value:function(){var e=this;if(!IS_MOBILE){var t={config:{data:this.getList(),className:"",onItemClick:function(t,r){e.handlerClickSwitch(t,null==r?void 0:r.to)}},root:this.root};this.optionList=new OptionList(t)}}},{key:"getList",value:function(){var e=this;return this.config.list.map((function(t,r){return r===e.curIndex&&e.isOpenState?(t.isCurrent=!0,t.selected=!0):(t.isCurrent=!1,t.selected=!1),t.showText=e.getTextByLang(t),t}))}},{key:"renderOptionList",value:function(){this.optionList.renderItemList(this.getList())}},{key:"switchSubTitle",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:"",language:""},r=-1;if(t&&(t.id||t.language)&&(this.config.list.map((function(e,i){e.id+""==t.id+""&&e.language+""==t.language+""&&(r=i)})),!(r<0||this.isOpenState&&r===this.curIndex)))return this.subTitles.switch(t).then((function(i){0===i.code&&(t.off=!1,t.isListUpdate=!1,t.list=[],e.curIndex=r,e.curItem=e.config.list[r],e.isOpenState=!0,util.removeClass(e.root,"isClose"),util.addClass(e.root,"isOpen"),e.renderItemList(),e.changeTipText(),e.emit("subtitle_change",t))})).catch((function(e){return console.error("switch subtitle err: ",e)}))}},{key:"switchOffSubtitle",value:function(){this.subTitles.switchOff(),this.noShowSubtitle()}},{key:"noShowSubtitle",value:function(){var e;this.emit("subtitle_change",{off:!0,isListUpdate:!1,list:[]}),this.isOpenState=!1,util.addClass(this.root,"isClose"),util.removeClass(this.root,"isOpen"),this.renderItemList(),this.changeTipText(),null===(e=this.optionList)||void 0===e||e.hide()}},{key:"renderItemList",value:function(){IS_MOBILE?this.updatePanel():this.renderOptionList()}},{key:"updateSubtitles",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(this.updateList(),this.subTitles&&this.subTitles.setSubTitles(this.config.list,this.curIndex>-1,t))}},{key:"updateList",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.list){var t=[];e.list.map((function(e){t.push(e)}));var r,i=formatList(t);if(e.isOpen)this.isOpenState=!0,this.curIndex=i,this.curItem=i>-1?t[i]:null,util.removeClass(this.root,"isClose"),util.addClass(this.root,"isOpen");else this.isOpenState=!1,this.curIndex=-1,this.curItem=null,util.removeClass(this.root,"isOpen"),util.addClass(this.root,"isClose"),this.changeTipText(),null===(r=this.optionList)||void 0===r||r.hide();if(this.config.list=t,t.length>0){var n;if(!IS_MOBILE)null===(n=this.optionList)||void 0===n||n.hide()}else{var o,a;if(this.switchOffSubtitle(),IS_MOBILE?this.showMobilePanel():null===(o=this.optionList)||void 0===o||o.show(),!IS_MOBILE)null===(a=this.optionList)||void 0===a||a.hide();this.hide()}this.renderItemList()}}},{key:"changeTipText",value:function(){this.isOpenState?this.find(".xg-tips").innerHTML=this.langText.subClose:this.find(".xg-tips").innerHTML=this.langText.subOpen}},{key:"showMobilePanel",value:function(){var e,t=this.renderPanel();null===(e=this.player.panel)||void 0===e||e.showPanel(t,this.langText.sub,!0)}},{key:"updatePanel",value:function(){var e,t=this.renderPanel();null===(e=this.player.panel)||void 0===e||e.updatePanel(t)}},{key:"renderPanel",value:function(){var e=this,t=_toConsumableArray$1(this.config.list),r=util.createDom("div","",{},"ai-panel-content");t.map((function(t,i){var n=_objectSpread2$5({language:t.language||t.srclang,"data-id":t.id,selected:e.isOpenState&&e.curIndex===i,showText:e.getTextByLang(t)},t),o=e.renderPanelItem(n);r.appendChild(o)}));var i={showText:this.langText.subClose,"data-type":DEFAULT_CLOSE_TYPE,selected:!this.isOpenState};return r.appendChild(this.renderPanelItem(i)),r}},{key:"renderPanelItem",value:function(e){var t=this,r=e.showText,i=e.selected,n=util.createDom("div","",{language:e.language,"data-id":e["data-id"],"data-type":e["data-type"]},"panel-Item ".concat(i?"select-in":""));n.innerHTML=r;var o=IS_MOBILE?"touchend":"click",a=Plugin.delegate(n,".panel-Item",o,(function(r){e["data-type"]===DEFAULT_CLOSE_TYPE?(r.stopPropagation(),r.preventDefault(),t.switchOffSubtitle()):t.handlerClickSwitch(r,e)}));return this._delegates.push(a),n}},{key:"getTextByLang",value:function(e,t,r){if(void 0===e)return"";var i=this.config.list;return!r&&(r=this.player.lang),t=!t||util.isUndefined(e[t])?"text":t,"number"==typeof e&&(e=i[e]),"object"===_typeof$4(e[t])?e[t][r]||e[t].zh:e[t]||""}},{key:"rePosition",value:function(){var e=this.config.style.fitVideo,t=0-this.player.controls.root.getBoundingClientRect().height;if(e){var r=this.player,i=r.video,n=r.root.getBoundingClientRect(),o=n.height,a=n.width,s=i.videoHeight,l=i.videoWidth,c=parseInt(s/l*100,10)*a/100;c>o&&(c=o);var u=(o-c)/2-t;u<0&&(this.subTitles.root.style.transform="translate(0, ".concat(u,"px)"))}else this.subTitles.root.style.transform="translate(0, ".concat(t,"px)")}},{key:"destroy",value:function(){var e;this.subTitles&&(this.subTitles.destroy(),this.subTitles=null),this.unbind(["click"],this.handleButtonChange.bind(this)),this.unbind(["mouseenter"],this.showList.bind(this)),this.unbind(["mouseleave"],this.hideList.bind(this)),null===(e=this.optionList)||void 0===e||e.destroy(),this._delegates&&this._delegates.length>0&&(this._delegates.map((function(e){Array.isArray(e)&&e.map((function(e){e.destroy&&e.destroy()})),e.destroy&&e.destroy()})),this._delegates=null),_get$3(_getPrototypeOf$5(r.prototype),"destroy",this).call(this)}},{key:"render",value:function(){return'\n <xg-icon class="xgplayer-vttsub">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="vttSubOpen">'.concat(this.langText.subOpen,"</div>\n </xg-icon>\n ")}}],[{key:"pluginName",get:function(){return"Subtitle"}},{key:"defaultConfig",get:function(){return{position:POSITIONS$7.CONTROLS_RIGHT,index:CONTROL_ICON_INDEX.Subtitle,list:[],isDefaultOpen:!0,style:{follow:!0,mode:"stroke",followBottom:50,fitVideo:!0,offsetBottom:4,baseSizeX:49,baseSizeY:28,minSize:16,minMobileSize:13,line:"double",fontColor:"#fff"},isShowIcon:!0,mode:"external",updateMode:"vod"}}}]),r}(Plugin),index$3="",ToastPlugin=function(e){_inherits$5(r,e);var t=_createSuper$5(r);function r(e){var i;return _classCallCheck$5(this,r),(i=t.call(this,e)).toastNumber=0,i.toastMaps={},i}return _createClass$6(r,[{key:"beforePlayerInit",value:function(){}},{key:"afterPlayerInit",value:function(){}},{key:"afterCreate",value:function(){}},{key:"destroy",value:function(){}},{key:"add",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2e3,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=this.toastNumber+1;this.toastNumber=n;var o=this.renderToast(e,i,n);return this.root.appendChild(o),this.toastMaps[n]=o,r&&setTimeout((function(){t.remove(n)}),r),n}},{key:"remove",value:function(e){var t=this.toastMaps[e];t&&(this.root.contains(t)&&this.root.removeChild(t),delete this.toastMaps[e])}},{key:"renderToast",value:function(e,t,r){var i=this,n=util.createDom("div","",void 0,"toast-container"),o=util.checkIsObject(e)?e:util.createDom("div",e,void 0,"toast-txt");if(n.appendChild(o),t){var a=util.createDom("span","×",void 0,"toast-close-bt");a.addEventListener("click",(function(){i.remove(r)})),n.appendChild(a)}return n}},{key:"render",value:function(){return'<xg-sdk-toast class="xgplayer-sdk-toast"></xg-sdk-toast>'}}],[{key:"pluginName",get:function(){return"sdkToastPlugin"}},{key:"defaultConfig",get:function(){return{index:5}}}]),r}(Plugin);function _defineProperties(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),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 ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var device_id_key="xgplayer_device_id",user_id_key="xgplayer_user_id",getCookie=function(e){if(!document.cookie)return null;for(var t=document.cookie.split(";"),r=0,i=t.length;r<i;r++){var n=t[r];if(t[r].indexOf(e)>=0)return n.split("=")[1]||null}},genRandomID$1=function(e){return String(Math.floor(Math.random()*Math.pow(10,e)))},getDeviceID$1=function(){var e=getCookie(device_id_key);if(e)return e;var t=genRandomID$1(11);return document.cookie=device_id_key+"="+t+";max-age=31536000;path=/",t},getUserId$1=function(){var e=getCookie(user_id_key);if(e)return e;var t=genRandomID$1(12);return document.cookie=user_id_key+"="+t+";max-age=31536000;path=/",t},getLogId=function(){return genRandomID$1(12)};function getBrowser(){var e=navigator.userAgent.toLowerCase(),t={},r={IE:window.ActiveXObject||"ActiveXObject"in window,Chrome:e.indexOf("chrome")>-1&&e.indexOf("safari")>-1,Firefox:e.indexOf("firefox")>-1,Opera:e.indexOf("opera")>-1,Safari:e.indexOf("safari")>-1&&-1==e.indexOf("chrome"),Edge:e.indexOf("edge")>-1,QQBrowser:/qqbrowser/.test(e),WeixinBrowser:/MicroMessenger/i.test(e)};for(var i in r)if(r[i]){var n="";if("IE"===i)n=e.match(/(msie\s|trident.*rv:)([\w.]+)/)[2];else if("Chrome"===i){for(var o in navigator.mimeTypes)"application/360softmgrplugin"===navigator.mimeTypes[o].type&&(i="360");var a=e.match(/chrome\/([\d.]+)/);n=a?a[1]:"-1"}else if("Firefox"===i){var s=e.match(/firefox\/([\d.]+)/);n=s?s[1]:"-1"}else if("Opera"===i){var l=e.match(/opera\/([\d.]+)/);n=l?l[1]:"-1"}else if("Safari"===i){var c=e.match(/version\/([\d.]+)/);n=c?c[1]:"-1"}else if("Edge"===i){var u=e.match(/edge\/([\d.]+)/);n=u?u[1]:"-1"}else if("QQBrowser"===i){var h=e.match(/qqbrowser\/([\d.]+)/);n=h?h[1]:"-1"}t.type=i,t.versions=parseInt(n)}return t}var sniffer={get device(){return sniffer.os.isPc?"pc":"mobile"},get browser(){var e=getBrowser();return e.type+"_"+e.versions},get os(){var e=navigator.userAgent;navigator.platform.toLowerCase();var t=/(?:Windows Phone)/.test(e),r=/(?:SymbianOS)/.test(e)||t,i=/(?:Android)/.test(e),n=/(?:Firefox)/.test(e),o=/(?:iPad|PlayBook)/.test(e)||i&&!/(?:Mobile)/.test(e)||n&&/(?:Tablet)/.test(e),a=/(?:iPhone)/.test(e)&&!o;return{isTablet:o,isPhone:a,isAndroid:i,isPc:!(a||i||r||o),isSymbian:r,isWindowsPhone:t,isFireFox:n}},get operation_os(){for(var e=navigator.userAgent,t=[{s:"windows",r:/(Windows 10.0|Windows NT 10.0|Windows NT 10.1|Windows 8.1|Windows NT 6.3|Windows 8|Windows NT 6.2|Windows 7|Windows NT 6.1)/},{s:"android",r:/Android/},{s:"linux",r:/(Linux|X11)/},{s:"ios",r:/(iPhone|iPad|iPod)/},{s:"mac",r:/Mac OS X/},{s:"mac",r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/}],r=0;r<t.length;r++){var i=t[r];if(i.r.test(e))return i.s}return"unknown"}};function getCurrentTime(){return(new Date).getTime()}function getPlayFormat(e){var t="unknown";return"string"!=typeof e?t:e.indexOf(".flv")>-1?"flv":e.indexOf(".m3u8")>-1?"m3u8":e.indexOf(".mp4")>-1?"mp4":e.indexOf(".sdp")>-1?"rts":t}function isCodecSupport(e){return"undefined"!=typeof MediaSource?+MediaSource.isTypeSupported("video/mp4; codecs="+e):0}function getUrlQuery(e,t){return new URLSearchParams(e.split("?")[1]).get(t)}function getDeviceInfo(){var e={cpu_core_number:-1,memory_usage:-1,network_downlink:-1};try{e.cpu_core_number=navigator.hardwareConcurrency||-1,e.memory_usage=navigator.deviceMemory||-1,e.network_downlink=navigator.connection&&navigator.connection.downlink,null==e.network_downlink&&(e.network_downlink=-1)}catch(error){}return e}function getPlayerCore(e){if(e.plugins){if(e.plugins.flv)return e.plugins.flv;if(e.plugins.hls)return e.plugins.hls;if(e.plugins.rts)return e.plugins.rts;if(e.plugins.flvlive)return e.plugins.flvlive;if(e.plugins.hlslive)return e.plugins.hlslive;if(e.plugins.hlsvod)return e.plugins.hlsvod;if(e.plugins.hlslivemobile)return e.plugins.hlslivemobile;if(e.plugins.flvlivemobile)return e.plugins.flvlivemobile}return e.newHls||e.newFlv||e.__core__||e.flv}function getDefaultOptions(e){return{device_id:e.device_id||getDeviceID$1(),user_id:e.user_id||getUserId$1(),error_report_stop:!!e.error_report_stop,project_key:e.project_key||"live",product_line:e.product_line||"live",onReport:e.onReport||function(){}}}function getDefaultLog(){return{start_play:{start_play_time:0,event_key:"start_play"},first_frame:{start:0,first_frame_view:0,event_key:"first_frame",first_sei_delay:0,ntp_sync:0,ntp_delta:0,ttfb:-1,ttdb:-1,ttfb_end:0},first_frame_failed:{code:void 0,msg:"",event_key:"first_frame_failed"},stall_start:{ready_state:-1,stall_start_time:0,event_key:"stall_start"},stalling:{event_key:"stalling"},stall:{reason:0,stall_start:0,stall_end:0,ready_state:0,event_key:"stall"},play_stop:{code:0,stop_time:0,drop_percent:0,is_stream_received:0,stall_count:0,stall_time:0,retry_count:0,duration:0,stall_count_per_100sec:0,stall_time_per_100sec:0,event_key:"play_stop",dns_parse_time:-1,redirect:-1,ttfb:-1,buffered:[],is_firstframe_received:0,meta:null},playing:{index:0,stall_count:0,stall_time:0,play_time:1e4,retry_count:0,is_last:0,video_buffer_time:0,audio_buffer_time:0,speed_switch_count:0,speed_switch_info:"none",download_speed:0,decode_fps:0,render_fps:0,drop_count:0,drop_percent:0,sei_source:"",sei_delay:0,ntp_sync:0,ntp_delta:0,event_key:"playing",stop_time:0,duration:0,stall_count_per_100sec:0,stall_time_per_100sec:0},play_error:{code:void 0,info:"",event_key:"play_error"},play_low_decode:{fps:-1,decode_fps:-1,bitrate:-1,url:-1,msg:"",event_key:"play_low_decode"},play_av_unsync:{aDts:-1,vDts:-1,frameLength:-1,currentTime:-1,duration:0,event_key:"play_av_unsync"},play_loadstream:{loadstream_url:"",event_key:"play_loadstream"},play_stream_loaded:{event_key:"play_stream_loaded"},play_metadata_loaded:{metadata_type:"",event_key:"play_metadata_loaded"},stream_exception:{event_key:"stream_exception"},pause:{event_key:"pause"},play_url_change:{event_key:"play_url_change"},source_opened:{event_key:"source_opened"},source_updateend:{event_key:"source_updateend"},play_result:{event_key:"play_result",result:0,threshold:15e3,is_threshold:0},degrade:{event_key:"degrade",payload:{}},rtcstatechange:{event_key:"rtcstatechange"}}}function getCommonLog(e){var t=e.player,r=t.config.mediaType;return _objectSpread2({project_key:e.project_key,live_sdk_version:getPlayerCore(t)||t.hlsOps?"2":"-1",player_sdk_version:t.version,logger_version:"1.1.0-alpha.3",report_version:"5",product_line:e.product_line,user_id:e.user_id,device_id:e.device_id,logger_id:getLogId(),app_name:e.app_name,cdn_ip:e.cdn_ip,is_wasm:+(!!r&&"video"!==r),review_is_live:t.config.isLive?2:1,aid:e.aid,live_id:e.live_id||e.aid+"-"+e.user_id+"-"+Date.now(),is_preview:e.is_preview?1:0,codec_type:e.codec_type||"h264",width:Math.floor(t.config.width),height:Math.floor(t.config.height),browser:sniffer.browser,ua:navigator.userAgent,href:window.location.href,timestamp:0,fps:-1,logger_init_time:Date.now(),play_current_time:0,cdn_play_url:t.config.url&&t.config.url.startsWith("//")?window.location.protocol+t.config.url:t.config.url,play_format:getPlayFormat(t.config.url),codec_support:-1},e.ext)}function Utf8ArrayToStr(e){var t,r,i,n,o,a;for(t="",i=e.length,r=0;r<i;)switch((n=e[r++])>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:t+=String.fromCharCode(n);break;case 12:case 13:o=e[r++],t+=String.fromCharCode((31&n)<<6|63&o);break;case 14:o=e[r++],a=e[r++],t+=String.fromCharCode((15&n)<<12|(63&o)<<6|(63&a)<<0)}return t}var getResourceTiming=function(e){var t=performance.getEntriesByType("resource").filter((function(t){return t.name===e}));if(t.length){var r=t[0],i=t[t.length-1];return{dns_parse_time:Number.parseInt(r.domainLookupEnd-r.domainLookupStart),redirect:Number.parseInt(r.redirectEnd-r.redirectStart),ttfb:Number.parseInt(i.responseStart-i.requestStart)}}return{dns_parse_time:-1,redirect:-1,ttfb:-1}},video_error={1:"MEDIA_ERR_ABORTED",2:"MEDIA_ERR_NETWORK",3:"MEDIA_ERR_DECODE",4:"MEDIA_ERR_SRC_NOT_SUPPORTED"},Manage=function(){function e(e){var t=e.Tea;if(!t)throw new Error("lack Tea option");t.event?this.Tea=t.event.bind(t):this.Tea=t,this.logOptions=e,this._player=e.player}_createClass(e,[{key:"videoSize",get:function(){return this._player&&this._player.video?{width:this._player.video.videoWidth,height:this._player.video.videoHeight}:{width:0,height:0}}}]);var t=e.prototype;return t.push=function(e){var t=this._player.config.url;this._player.video&&(e.play_current_time=this._player.currentTime),e.cdn_play_url=t&&t.startsWith("//")?window.location.protocol+t:t,e.live_stream_session_id=getUrlQuery(t,"session_id"),e.play_format=getPlayFormat(t),e.timestamp=getCurrentTime();var r=getDeviceInfo(),i=r.cpu_core_number,n=r.memory_usage,o=r.network_downlink;e.cpu_core_number=i,e.memory_usage=n,e.network_downlink=o,Object.assign(e,_objectSpread2({},this.videoSize)),this.send(e)},t.send=function(e){e.event_key&&(this.logOptions.onReport&&this.logOptions.onReport(e.event_key,e),this.Tea(e.event_key,_objectSpread2({},e)))},e}(),navgatorOnlineSupported=function(){return void 0!==navigator.onLine},navigatorConnectionType=function(){var e=navigator.connection;return e&&(e.effectiveType||e.type)},getNetStat=function(){return navgatorOnlineSupported()?navigator.onLine?navigatorConnectionType()||sniffer.device:"none":"unknown"},videoEvts=["play","playing","pause","ended","error","seeking","seeked","timeupdate","waiting","canplay","canplaythrough","durationchange","ratechange","volumechange","loadeddata"],LoggerControl=function(){function e(e){this.options=e,this.logger=new XgLiveLogger(e),this.restart=this.restart.bind(this),this.bindUrlChange(),sniffer.browser.includes("Chrome")}var t=e.prototype;return t.restart=function(e){this.destroy("string"!=typeof e&&Boolean(e)),this.logger=new XgLiveLogger(this.options),this.bindUrlChange(),this.logger.reportStartPlay(),this.logger.handlePlayerComlete()},t.bindUrlChange=function(){this.options&&this.options.player&&!this.options.manual_restart&&this.options.player.on("urlchange",this.restart)},t.setNTP=function(e){this.logger.setNTP(e)},t.updateExt=function(e){this.options.ext=Object.assign(this.options.ext||{},e),this.logger&&this.logger.updateExt(e)},t.destroy=function(e){this.logger.destroy(e),this.logger=null,this.options&&this.options.player&&!this.options.manual_restart&&this.options.player.off("urlchange",this.restart)},e}(),XgLiveLogger=function(){function e(e){if(!e.player)throw new Error("option player is necessary");this.options=Object.assign({},e,getDefaultOptions(e)),this._player=this.options.player,this._url=this._player.config.url,this.project_key=e.project_key||"live",this.product_line=e.product_line||"live",this.ntpDelta=this.options.ntp?Date.now()-this.options.ntp:0,this.inWaitingStart=0,this.errorNumber=0,this.tempDroppedFrameCount=0,this.tempTotalFrameCount=0,this._logmanager=new Manage(this.options),this.init(),this.started=!1,this.destroyed=!1,this.completed=!1,this.firstFrameViewed=!1,this.cacheRtcStats={}}_createClass(e,[{key:"videoSize",get:function(){return this.player?{width:this.player.video.videoWidth,height:this.player.video.videoHeight}:{width:0,height:0}}},{key:"player",get:function(){return this._player}},{key:"logmanager",get:function(){return this._logmanager}},{key:"ntpTime",get:function(){return Date.now()-this.ntpDelta}}]);var t=e.prototype;return t.setNTP=function(e){this.options&&(this.options.ntp=e,this.ntpDelta=Date.now()-this.options.ntp)},t.init=function(){this.bindCtx(),this.initLog(),this.initEvt()},t.bindCtx=function(){this.handlePlayerComlete=this.handlePlayerComlete.bind(this),this.handlePlayerPlaying=this.handlePlayerPlaying.bind(this),this.destroyFunc=this.destroyFunc.bind(this),this.handleUserLeave=this.handleUserLeave.bind(this),this.handlePlayerError=this.handlePlayerError.bind(this),this.handlePlayerReady=this.handlePlayerReady.bind(this),this.handlePlayerWaiting=this.handlePlayerWaiting.bind(this),this.handleAVUnsync=this.handleAVUnsync.bind(this),this.handlePlayerPause=this.handlePlayerPause.bind(this),this.handleTTFB=this.handleTTFB.bind(this),this.handleUrlChange=this.handleUrlChange.bind(this),this.handleKeyframe=this.handleKeyframe.bind(this),this.handleSourceOpen=this.handleSourceOpen.bind(this),this.handleBufferAppend=this.handleBufferAppend.bind(this),this.handleCoreEvent=this.handleCoreEvent.bind(this),this.handleDegrade=this.handleDegrade.bind(this)},t.initLog=function(){var e=this,t=this.options,r=t.player,i=void 0!==r.hlsOps;this.commonParams=_objectSpread2({os:sniffer.operation_os},getCommonLog(t)),this.log=Object.assign({},getDefaultLog());var n=this;for(var o in this.log){var a=function(t){Object.defineProperty(e.log[o],t,{get:function(){return null==this["_"+t]?n.commonParams[t]:this["_"+t]},set:function(e){this["_"+t]=e},enumerable:!0})};for(var s in this.commonParams)a(s);i&&Object.defineProperty(this.log[o],"m3u8",{get:function(){if(r.__core__){var e=r.__core__.m3u8Text;return e?e.slice(0,25e4):""}return""},enumerable:!0}),Object.defineProperty(this.log[o],"volume",{get:function(){if(r&&r.video)return r.volume||0},enumerable:!0}),Object.defineProperty(this.log[o],"access",{get:function(){return getNetStat()},enumerable:!0})}},t.updateExt=function(e){for(var t in this.log)for(var r in e)this.log[t][r]=e[r]},t.reportStartPlay=function(){this.started||(this.started=!0,this.log.start_play.start_play_time=this.log.start_play.timestamp=getCurrentTime(),this.logmanager.push(this.log.start_play,!0))},t.initWindowListener=function(){"pc"===sniffer.device?window.addEventListener("beforeunload",this.handleUserLeave):"mobile"===sniffer.device&&(window.addEventListener("beforeunload",this.handleUserLeave),window.addEventListener("pagehide",this.handleUserLeave))},t.removeWindowListener=function(){"pc"===sniffer.device?window.removeEventListener("beforeunload",this.handleUserLeave):"mobile"===sniffer.device&&(window.removeEventListener("beforeunload",this.handleUserLeave),window.removeEventListener("pagehide",this.handleUserLeave))},t.initEvt=function(){var e=this,t=this.player;videoEvts.forEach((function(t){e["handleVideo"+t+"Evt"]=function(){e["handleVideo"+t]&&e["handleVideo"+t]()},e.initWindowListener(),e.bindVideoEvt(t,e["handleVideo"+t+"Evt"])})),t.once("error",this.handlePlayerError),t.once("complete",this.handlePlayerComlete),t.once("playing",this.handlePlayerPlaying),t.once("timeupdate",this.handlePlayerPlaying),t.once("destroy",this.destroyFunc),t.on("ready",this.handlePlayerReady),t.on("waiting",this.handlePlayerWaiting),t.on("pause",this.handlePlayerPause),t.on("urlchange",this.handleUrlChange),t.once("sourceopen",this.handleSourceOpen),t.once("bufferappend",this.handleBufferAppend),t.on("core_event",this.handleCoreEvent),t.on("degrade",this.handleDegrade),this.hiJackPlayerStart()},t.handleCoreEvent=function(e){var t=e.eventName,r=e.headers,i=e.pts,n=e.type,o=e.meta,a=e.sei,s=e.decodeFps,l=e.url,c=e.state;switch(t){case"core.ttfb":this.handleTTFB(e);break;case"core.loadresponseheaders":var u=r.get("X-Server-Ip");void 0!==this.player.hlsOps&&(this.log.play_stop.review_ts_count+=1),u&&(this.commonParams.cdn_ip=u);break;case"core.loadretry":this.log.play_stop.retry_count++;break;case"core.keyframe":this.handleKeyframe(i);break;case"core.metadataparsed":this.handleMetaDataLoaded(n,o);break;case"core.sei":this.handleSEIParsed(a);break;case"core.lowdecode":this.commonParams.is_wasm&&(Object.assign(this.log.play_low_decode,e||{}),this.log.play_low_decode.decode_fps=s,this.log.play_low_decode.timestamp=getCurrentTime(),this.logmanager.push(this.log.play_low_decode,!0),this.commonParams.is_wasm=0);break;case"core.largeavgap":this.handleAVUnsync(e);break;case"core.loadstart":this.handlePlayerLoadStream(l),this.reportStartPlay();break;case"core.loadcomplete":this.handlePlayerLoadedStream();break;case"core.streamexception":this.handleStreamException(e);break;case"core.rtcstatechange":this.logmanager.push(Object.assign({url:l,state:c},this.log.rtcstatechange))}},t.handleDegrade=function(e){this.log.degrade.payload=e,this.logmanager.push(this.log.degrade,!0)},t.hiJackPlayerStart=function(){var e=arguments,t=this;this.player._start=this.player.start;var r=this.player;r.start=function(){try{if(r._start)return r._start.apply(r,Array.prototype.slice.call(e,0))}catch(e2){}t.destroyed||t.handlePlayerComlete()}},t.handleTTFB=function(e){var t=e||{},r=t.end,i=t.elapsed;this.log.first_frame.ttfb=i||-1,this.log.first_frame.ttfb_end=r||0},t.handleUrlChange=function(e){this.logmanager.push(Object.assign(this.log.play_url_change,{url:e,timestamp:getCurrentTime()}))},t.handleKeyframe=function(e){this.log.play_stop.is_firstframe_received=1,this.log.play_stop.firstframe_pts=e},t.handleSourceOpen=function(){this.log.source_opened.timestamp=getCurrentTime(),this.logmanager.push(this.log.source_opened)},t.handleBufferAppend=function(){this.log.source_updateend.timestamp=getCurrentTime(),this.logmanager.push(this.log.source_updateend)},t.handlePlayerPause=function(){this.log.pause.timestamp=getCurrentTime(),this.logmanager.push(this.log.pause,!0),this.stallEnd()},t.handlePlayerError=function(e){this.errorNumber=1;var t=e.errorType,r=e.errorCode;Object.assign(this.log.play_error,_objectSpread2({timestamp:getCurrentTime(),code:e.httpCode||r||("parse"===t?31:21),info:e.message,detail:JSON.stringify(e)},this.videoSize)),this.logmanager.push(this.log.play_error,!0),this.destroyed||(0===this.log.first_frame.first_frame_view&&(Object.assign(this.log.first_frame_failed,{code:r||("parse"===t?31:21),msg:e.message}),void 0!==this.log.first_frame_failed.timestamp&&(this.log.first_frame_failed.timestamp=getCurrentTime()),this.logmanager.push(this.log.first_frame_failed,!0),this.log.play_result.is_threshold||(this.clearPlayResultTimer(),this.log.play_result.reason=e.message||"first frame failed",this.log.play_result.code=this.log.play_error.code,this.logmanager.push(this.log.play_result,!0))),this.options.error_report_stop?this.handleUserLeave():this.updatePlayStopParams())},t.handlePlayerLoadStream=function(e){if("string"==typeof e){var t=this.log.play_loadstream;t.timestamp=getCurrentTime(),t.loadstream_url=e,this.logmanager.push(t)}},t.handlePlayerLoadedStream=function(){var e=this.log.play_stream_loaded;e.timestamp=getCurrentTime(),this.logmanager.push(e)},t.handleSEIParsed=function(e){var t=this.log,r=t.playing,i=t.first_frame;if(100===e.code){var n=Utf8ArrayToStr(e.content);n=n.slice(n.indexOf("{"),n.lastIndexOf("}")+1);try{var o=JSON.parse(n),a=this.getPlayerBuffer()+this.ntpTime-o.ts;r.sei_delay=a,r.sei_source=o.source,r.ntp_sync=this.options.ntp?1:0,r.ntp_delta=this.ntp_delta,i.first_sei_delay=a,i.ntp_sync=this.options.ntp?1:0,i.ntp_delta=this.ntp_delta}catch(e2){}}},t.handleMetaDataLoaded=function(e,t){this.log.play_stop.meta=this.log.play_stop.meta||{},e&&(this.log.play_stop.meta[e]=t),this.log.play_metadata_loaded.timestamp=getCurrentTime(),this.log.play_metadata_loaded.metadata_type=e,t&&(this.log.play_metadata_loaded.meta=t,this.log.play_metadata_loaded.codec=t.codec,"video"===e&&(this.commonParams.codec_type=t.codec,this.commonParams.codec_support=isCodecSupport(t.codec))),t||(this.log.play_metadata_loaded.meta=void 0,this.log.play_metadata_loaded.codec=void 0,"video"===e&&(this.commonParams.codec_type="unknown")),this.logmanager.push(this.log.play_metadata_loaded)},t.handleAVUnsync=function(e){Object.assign(this.log.play_av_unsync,e||{}),this.log.play_av_unsync.timestamp=getCurrentTime(),this.logmanager.push(this.log.play_av_unsync,!1)},t.handleStreamException=function(e){this.logmanager.push(Object.assign({},this.log.stream_exception,e))},t.handlePlayerComlete=function(){this.completed||(this.completed=!0,this.core=getPlayerCore(this.player),this.core&&(this.commonParams.live_sdk_version="2"),(this.player.config.autoplay||this.player.config.videoInit)&&this.reportStartPlay())},t.getPlayerBuffer=function(){var e=this.player.video.buffered;if(e){var t=Math.max(0,e.length-1);try{var r=Number.parseInt(1e3*(e.end(t)-this.player.video.currentTime));return this.log.playing.audio_buffer_time=this.log.playing.video_buffer_time=r,r}catch(e2){return 0}}},t.getPlayerDownloadSpeed=function(){if(this.core&&this.core.core&&"function"==typeof this.core.core.speedInfo)return this.core.core.speedInfo().speed},t.getPlayerQuality=function(){var e=this.player.video;if(e.getVideoPlaybackQuality){var t=e.getVideoPlaybackQuality();this.log.playing.drop_count=t.droppedVideoFrames-this.tempDroppedFrameCount,this.log.playing.drop_percent=Number.parseFloat(this.tempTotalFrameCount/t.totalVideoFrames).toFixed(1),this.log.play_stop.drop_percent=Number.parseFloat(t.droppedVideoFrames/t.totalVideoFrames).toFixed(1),this.tempDroppedFrameCount=t.droppedVideoFrames,this.tempTotalFrameCount=t.totalVideoFrames}},t.getRtcStats=function(e,t){try{var r=this,i=r.player.plugins.rts&&r.player.plugins.rts.pc;if(!i)return Promise.resolve();var n={};return Promise.resolve(i.getStats()).then((function(t){t.forEach((function(t){var i=t.type,o=t.mediaType,a=t.bytesReceived,s=t.packetsReceived,l=t.audioLevel,c=t.concealmentEvents,u=t.remoteTimestamp,h=t.timestamp,d=t.framesDropped,p=t.keyFramesDecoded,f=t.totalDecodeTime,g=t.framesDecoded,y=t.frameHeight,v=t.frameWidth,m=t.framesReceived,_=t.jitterBufferDelay,b=t.jitterBufferEmittedCount,T=t.jitter,S=t.nackCount,E=t.packetsLost,$=t.pliCount,C=t.totalSamplesReceived,P=t.concealedSamples,w=t.currentRoundTripTime,O=t.decoderImplementation,k=t.mimeType,I=t.freezeCount,A=t.totalFreezesDuration,x=t.totalPausesDuration;switch(i){case"inbound-rtp":"audio"===o?(n.audio_bytes_received=a-(r.cacheRtcStats.audioBytesReceived||0),r.cacheRtcStats.audioBytesReceived=a,n.audio_packets_lost=E-(r.cacheRtcStats.audioPacketsLost||0),n.audio_packets_received=s-(r.cacheRtcStats.audioPacketsReceived||0),r.cacheRtcStats.audioPacketsLost=E,r.cacheRtcStats.audioPacketsReceived=s,n.audio_level=l,n.concealment_event=c,n.audio_fraction_lost=n.audio_packets_lost/n.audio_packets_received,void 0!==r.cacheRtcStats.totalSamplesReceived&&(n.audio_rec_sample_rate=(C-r.cacheRtcStats.totalSamplesReceived)/e),r.cacheRtcStats.totalSamplesReceived=C,n.concealed_samples=P,n.total_samples_received=C):(n.frames_dropped=d,n.iframes_decoded=p,n.video_bytes_received=a-(r.cacheRtcStats.videoBytesReceived||0),r.cacheRtcStats.videoBytesReceived=a,n.video_dec_time=f,n.video_decoded_delay_ms=n.video_dec_elapse/g,n.video_frame_height=y,n.video_frame_width=v,void 0!==r.cacheRtcStats.framesDecoded&&(n.video_decode_framerate=(g-r.cacheRtcStats.framesDecoded)/e),r.cacheRtcStats.framesDecoded=g,void 0!==r.cacheRtcStats.framesReceived&&(n.video_recv_framerate=(m-r.cacheRtcStats.framesReceived)/e),void 0!==r.cacheRtcStats.freezeCount&&(n.freeze_count=I-r.cacheRtcStats.freezeCount,n.freeze_duration=A-r.cacheRtcStats.totalFreezesDuration),r.cacheRtcStats.freezeCount=I,r.cacheRtcStats.totalFreezesDuration=A,r.cacheRtcStats.framesReceived=m,n.total_pauses_duration=x,n.video_jb_delay=_/b*1e3,n.video_jitter=1e3*T,n.video_nack_count=S,n.video_packets_lost=E-(r.cacheRtcStats.videoPacketsLost||0),n.video_packets_received=s-(r.cacheRtcStats.videoPacketsReceived||0),n.video_fraction_lost=n.video_packets_lost/n.video_packets_received,r.cacheRtcStats.videoPacketsLost=E,r.cacheRtcStats.videoPacketsReceived=s,n.video_pli_count=$,n.decoder_name=O);break;case"remote-outbound-rtp":n.e2e_delay_ms=h-u;break;case"track":void 0!==v&&(n.video_frame_width=v,n.video_frame_height=y);break;case"candidate-pair":n.rtt=1e3*w;break;case"codec":k.includes("video")?n.video_codec=k:n.audio_codec=o}n.total_delay=n.e2e_delay_ms+(n.video_decoded_delay_ms||0)+(n.video_jb_delay||0)})),Object.assign(r.log.playing,{video_download_size:n.video_bytes_received,decode_fps:n.video_decode_framerate,sei_delay:n.total_delay,sei_network_delay:n.e2e_delay_ms,width:n.video_frame_width,height:n.video_frame_height,current_speed:(n.audio_bytes_received+n.video_bytes_received)/e}),r.log.playing.rtc_stats=n}))}catch(e2){return Promise.reject(e2)}},t.reportPlaying=function(e){try{var t=this;t.commonParams.is_wasm&&(t.commonParams.fps=t.player.video.fps,t.log.playing.render_fps=t.player.video.fps,t.log.playing.decode_fps=t.player.video.decodeFps),t.log.playing.index++;var r,i=t.log.playing.timestamp;t.inWaitingStart&&t.inWaitingStart<getCurrentTime()&&(r=Math.min(t.options.playingInterval||t.log.playing.play_time,getCurrentTime()-Math.max(t.inWaitingStart,i))),t.getPlayerQuality(),t.getPlayerBuffer(),t.options.downloadSpeedInterval||(t.log.playing.current_speed=t.getPlayerDownloadSpeed());var n=getCurrentTime(),o=n-i,a=(r>200?r:0)+t.log.playing.stall_time,s=(r>200?1:0)+t.log.playing.stall_count;return t.options.aggregationDowngradeStallTime&&(t.log.playing.aggregation_downgrade_stall=(r>t.options.aggregationDowngradeStallTime?r:0)+(t.log.playing.aggregation_downgrade_stall||0)),Object.assign(t.log.playing,_objectSpread2({timestamp:n,stop_time:n,duration:e?0:o/1e3,stall_time_per_100sec:a/o*100,stall_count_per_100sec:1e3*s/o*100,stall_count:s,stall_time:a,play_current_time:t.player.currentTime},t.videoSize)),Promise.resolve(t.getRtcStats(o,e)).then((function(){t.logmanager.push(Object.assign({},t.log.playing,{play_time:e?0:o}),!0),t.log.playing.download_speed_array=[],t.log.playing.stall_time=0,t.log.playing.stall_count=0,t.options.aggregationDowngradeStallTime&&(t.log.playing.aggregation_downgrade_stall=0)}))}catch(e2){return Promise.reject(e2)}},t.handlePlayerPlaying=function(){try{var e=this;if(e.player&&e.player.video.readyState<3)return Promise.resolve();if(e.player.off("playing",e.handlePlayerPlaying),e.player.off("timeupdate",e.handlePlayerPlaying),e.core){var t=(e.core.getStats()||{}).fps;e.commonParams.fps=t}return Promise.resolve(e.reportPlaying(!0)).then((function(){e.clearPlayingInterval();var t=e.options.playingInterval||e.log.playing.play_time;e.intervalId=setInterval((function(){try{var r=function(){if(Math.abs(Date.now()-e.log.playing.timestamp-t)<100||Date.now()-e.log.playing.timestamp>=t)return Promise.resolve(e.reportPlaying()).then((function(){}))}();return Promise.resolve(r&&r.then?r.then((function(){})):void 0)}catch(e2){return Promise.reject(e2)}}),1e3),e.clearStallTimer(),e.handleVideoplaying(),e.started||e.reportStartPlay(),e.saveBuffered()}))}catch(e2){return Promise.reject(e2)}},t.handlePlayerReady=function(){var e=this;this.log.start_play.start_play_time=getCurrentTime(),this.player.config.autoplay&&this.reportStartPlay(),this.options.playResultThreshold&&(this.log.play_result.threshold=this.options.playResultThreshold),this.clearPlayResultTimer(),this.log.play_result.start=getCurrentTime(),this.playResultTimer=setTimeout((function(){e.log.play_result.timestamp>=e.log.play_result.start||(e.log.play_result.is_threshold=1,e.logmanager.push(e.log.play_result,!0))}),this.log.play_result.threshold)},t.handlePlayerWaiting=function(){var e=this;!this.inWaitingStart&&this.log.first_frame.timestamp&&(this.log.stall.timestamp=this.inWaitingStart=this.log.stall.stall_start=getCurrentTime(),this.log.stall_start.ready_state=this.log.stall.ready_state=this.player.video.readyState,this.log.stall_start.timestamp=getCurrentTime(),this.log.stall_start.stall_start_time=getCurrentTime(),this.log.stall_start.video_buffer_time=this.player.video.readyState,this.log.stall_start.play_current_time=this.player.currentTime,this.log.stall.play_current_time=this.player.currentTime,this.log.stall_start.buffered=this.getBuffered(),this.log.stall.buffered=this.log.stall_start.buffered,this.log.stall.current_speed=this.getPlayerDownloadSpeed(),Object.assign(this.log.stall_start,this.videoSize),this.clearStallTimer(),this.stallStartTimer=setTimeout((function(){e.logmanager.push(e.log.stall_start,!0)}),205))},t.handleVideoseeking=function(){this.player&&this.player.video&&this.inWaitingStart&&this.player.video.duration<1/0&&(this.inWaitingStart=0,this.clearStallTimer())},t.handleVideoseeked=function(){this.player&&this.player.video&&this.inWaitingStart&&this.player.video.duration<1/0&&(this.inWaitingStart=0,this.log.play_stop.stall_count>0&&this.log.play_stop.stall_count--)},t.handleVideoplay=function(){this.reportStartPlay(),this.removeVideoEvt("play",this.handleVideoplay)},t.handleVideotimeupdate=function(){Math.abs(this.player.currentTime-this.log.stall_start.play_current_time)>.2&&this.stallEnd(),this.saveBuffered()},t.handleVideocanplay=function(){this.stallEnd(),this.reportFirstframe()},t.handleVideoplaying=function(){this.stallEnd(),this.log.play_stop.is_stream_received=1;var e=getCurrentTime();this.reportStartPlay(),this.log.first_frame.start=e},t.stallEnd=function(){this.clearStallTimer();var e=getCurrentTime();if(this.inWaitingStart){var t=e-this.inWaitingStart;t>200&&(this.log.play_stop.stall_count++,this.log.play_stop.stall_time+=e-this.inWaitingStart,this.log.playing.stall_time+=e-Math.max(this.inWaitingStart,this.log.playing.timestamp),this.log.stall.stall_end=e,this.log.stall.timestamp=getCurrentTime(),this.log.playing.stall_count++,Object.assign(this.log.stall,_objectSpread2({},this.videoSize)),this.logmanager.push(this.log.stall,!0)),this.options.aggregationDowngradeStallTime&&t>this.options.aggregationDowngradeStallTime&&(this.log.playing.aggregation_downgrade_stall=(this.log.playing.aggregation_downgrade_stall||0)+(e-Math.max(this.inWaitingStart,this.log.playing.timestamp)))}this.inWaitingStart=0},t.handleVideoloadeddata=function(){this.reportFirstframe()},t.handleVideoratechange=function(){this.log.playing.speed_switch_count++,this.log.playing.speed_switch_info=this.player.video.playbackRate},t.handleVideoended=function(){this.clearPlayingInterval(),this.clearStallTimer(),Object.assign(this.log.playing,_objectSpread2({timestamp:getCurrentTime(),is_last:1},this.videoSize)),this.logmanager.push(this.log.playing)},t.handleVideoerror=function(){var e=this;this.errorNumber=1;var t=this.player.video.error;Object.assign(this.log.play_error,_objectSpread2(_objectSpread2({timestamp:getCurrentTime()},this.videoSize),t&&{code:t.code,info:t.message})),this.logmanager.push(this.log.play_error,!0),0!==e.log.first_frame.first_frame_view||e.log.first_frame_failed.code||t&&(e.log.first_frame_failed.code=t.code,e.log.first_frame_failed.msg=video_error[t.code],void 0!==e.log.first_frame_failed.timestamp&&(e.log.first_frame_failed.timestamp=getCurrentTime()),e.logmanager.push(e.log.first_frame_failed,!0),e.log.play_result.is_threshold||(e.log.play_result.reason=video_error[t.code]||"first frame failed",e.log.play_result.code=t.code,e.clearPlayResultTimer(),e.logmanager.push(e.log.play_result,!0))),e.options.error_report_stop?e.handleUserLeave():e.updatePlayStopParams()},t.handleVideopause=function(){this.stallEnd(),this.clearPlayingInterval(),this.clearStallTimer(),clearTimeout(this.collectDownloadSpeedTimer),this.player.once("playing",this.handlePlayerPlaying),this.player.once("timeupdate",this.handlePlayerPlaying)},t.destroyFunc=function(e){var t=this;this.destroyed||(e||this.handleUserLeave(),this.destroyed=!0,"pc"===sniffer.device?window.removeEventListener("beforeunload",this.handleUserLeave):"mobile"===sniffer.device&&window.removeEventListener("pagehide",this.handleUserLeave),videoEvts.forEach((function(e){t.removeVideoEvt(e,t["handleVideo"+e+"Evt"])})),this.player&&(this.player._start&&(this.player.start=this.player._start,delete this.player._start),this.player.off("destroy",this.destroyFunc),this.player.off("complete",this.handlePlayerComlete),this.player.off("playing",this.handlePlayerPlaying),this.player.off("timeupdate",this.handlePlayerPlaying),this.player.off("ready",this.handlePlayerReady),this.player.off("waiting",this.handlePlayerWaiting),this.player.off("largeavgap",this.handleAVUnsync),this.player.off("error",this.handlePlayerError),this.player.off("SEI_PARSED",this.handleSEIParsed),this.player.off("pause",this.handlePlayerPause),this.player.off("ttfb",this.handleTTFB),this.player.off("urlchange",this.handleUrlChange),this.player.off("isKeyframe",this.handleKeyframe),this.player.off("sourceopen",this.handleSourceOpen),this.player.off("bufferappend",this.handleBufferAppend),this.player.off("core_event",this.handleCoreEvent),this.player.off("degrade",this.handleDegrade),this.clearPlayingInterval(),this.clearStallTimer(),this.clearPlayResultTimer(),clearTimeout(this.collectDownloadSpeedTimer),this._player=null))},t.handleUserLeave=function(){!this.destroyed&&this.started&&(this.destroyed=!0,this.updatePlayStopParams(),this.reportPlayStop(),this.clearPlayingInterval(),this.clearStallTimer(),clearTimeout(this.collectDownloadSpeedTimer),this.removeWindowListener())},t.saveBuffered=function(){try{var e=this.getBuffered();e&&e.length&&(this.log.play_stop.buffered=e)}catch(error){}},t.getBuffered=function(){try{for(var e=[],t=this.player.video,r=0;r<t.buffered.length;r++)e.push([t.buffered.start(r),t.buffered.end(r)]);return e}catch(error){}},t.reportPlayStop=function(){this.log.play_stop.play_current_time=this.player.currentTime||this.log.playing.play_current_time,this.saveBuffered(),this.logmanager.push(this.log.play_stop,!0)},t.reportFirstframe=function(){if(!this.firstFrameViewed){if(this.core){var e=(this.core.getStats()||{}).fps;this.commonParams.fps=e}this.firstFrameViewed=!0;var t=getCurrentTime();Object.assign(this.log.first_frame,_objectSpread2({first_frame_view:t-this.log.start_play.start_play_time||t,timestamp:t},this.videoSize)),this.log.first_frame.ttfb_end&&(this.log.first_frame.ttdb=t-this.log.first_frame.ttfb_end),this.logmanager.push(this.log.first_frame,!0),this.clearPlayResultTimer(),this.log.play_result.result=1,this.logmanager.push(this.log.play_result,!0),this.log.play_stop.is_stream_received=1}},t.updatePlayStopParams=function(){var e=getResourceTiming(this._url),t=getCurrentTime();this.playedTime=t-this.log.start_play.start_play_time;var r=this.log.play_stop;Object.assign(r,_objectSpread2({},0===r.stall_count&&{stall_time:0})),this.inWaitingStart&&t-this.inWaitingStart>200&&(r.stall_time+=t-this.inWaitingStart),this.inWaitingStart=0,Object.assign(r,_objectSpread2({stall_time_per_100sec:r.stall_time/this.playedTime*100,stall_count_per_100sec:1e3*r.stall_count/this.playedTime*100},e)),0===this.log.play_stop.stall_count_per_100sec&&(this.log.play_stop.stall_time_per_100sec=0),this.log.play_stop.stall_time_per_100sec>100||this.log.play_stop.stall_time_per_100sec<0||(this.log.playing.index?(Object.assign(this.log.playing,_objectSpread2({timestamp:getCurrentTime(),is_last:1},this.videoSize)),this.logmanager.push(this.log.playing,!0)):(this.log.play_stop.error_code=this.log.play_error.code,this.log.play_stop.error_info=this.log.play_error.info),t=getCurrentTime(),Object.assign(r,_objectSpread2({timestamp:t,stop_time:t,duration:this.playedTime/1e3,play_time:this.playedTime/1e3},this.videoSize)),0===this.errorNumber&&(r.play_time_on_no_frame=r.stop_time-this.log.start_play.start_play_time))},t.clearPlayingInterval=function(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null)},t.clearStallTimer=function(){clearTimeout(this.stallStartTimer)},t.clearPlayResultTimer=function(){clearTimeout(this.playResultTimer)},t.destroy=function(e){this.destroyFunc(!e)},t.bindVideoEvt=function(e,t){this.player&&this.player.video.addEventListener(e,t,!1)},t.removeVideoEvt=function(e,t){this.player&&this.player.video&&this.player.video.removeEventListener(e,t,!1)},t.send=function(e,t){this.logmanager.send(e,t)},e}(),_e=function(){return _e=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},_e.apply(this,arguments)};function t(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(s){n={error:s}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return a}function i(){for(var e=[],r=0;r<arguments.length;r++)e=e.concat(t(arguments[r]));return e}var n,o=function(){function e(){this._hooks={},this._cache=[],this._hooksCache={}}return e.prototype.on=function(e,t){e&&t&&"function"==typeof t&&(this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(t))},e.prototype.once=function(e,t){var r=this;e&&t&&"function"==typeof t&&this.on(e,(function i(n){t(n),r.off(e,i)}))},e.prototype.off=function(e,t){if(e&&this._hooks[e]&&this._hooks[e].length)if(t){var r=this._hooks[e].indexOf(t);-1!==r&&this._hooks[e].splice(r,1)}else this._hooks[e]=[]},e.prototype.emit=function(e,t,r){if(r){if(!e)return;-1!==this._cache.indexOf(r)?this._emit(e,t):(this._hooksCache.hasOwnProperty(r)||(this._hooksCache[r]={}),this._hooksCache[r].hasOwnProperty(e)||(this._hooksCache[r][e]=[]),this._hooksCache[r][e].push(t))}else this._emit(e,t)},e.prototype._emit=function(e,t){e&&this._hooks[e]&&this._hooks[e].length&&i(this._hooks[e]).forEach((function(e){try{e(t)}catch(r){}}))},e.prototype.set=function(e){e&&-1===this._cache.indexOf(e)&&this._cache.push(e)},e}(),r=function(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)},s=(n=+Date.now()+Number((""+Math.random()).slice(2,8)),function(){return n+=1}),a=function(e){return function(e,t,r){if("string"==typeof e&&"number"==typeof r){var i,n=[];r=r<=25?r:r%25;var o=String.fromCharCode(r+97);i=e.split(o);for(var a=0;a<i.length;a++){var s=parseInt(i[a],r);s=1*s^64;var l=String.fromCharCode(s);n.push(l)}return n.join("")}}(e,0,25)},c=function(e){var t=document.createElement("a");return t.href=e,t},h=function(){function e(e){this.appid=e,this.userAgent=window.navigator.userAgent,this.appVersion=window.navigator.appVersion}return e.prototype.init=function(){var e=window.navigator.userAgent,t=window.navigator.language,r=document.referrer,i=r?c(r).hostname:"";!function(e){var t={};try{var r=c(e).search;(r=r.slice(1)).split("&").forEach((function(e){var r,i,n=e.split("=");n.length&&(r=n[0],i=n[1]);try{t[r]=decodeURIComponent(void 0===i?"":i)}catch(o){t[r]=i}}))}catch(i){}}(window.location.href);var n=/Mobile|htc|mini|Android|iP(ad|od|hone)/.test(this.appVersion)?"wap":"web",o=this.browser(),a=this.os();return{browser:o.browser,browser_version:o.browser_version,platform:n,os_name:a.os_name,os_version:a.os_version,userAgent:e,screen_width:window.screen&&window.screen.width,screen_height:window.screen&&window.screen.height,device_model:this.getDeviceModel(a.os_name),language:t,referrer:r,referrer_host:i}},e.prototype.browser=function(){var e,t,r="",i=""+parseFloat(this.appVersion),n=this.userAgent;return-1!==n.indexOf("Edge")||-1!==n.indexOf("Edg")?(r="Microsoft Edge",-1!==n.indexOf("Edge")?(e=n.indexOf("Edge"),i=n.substring(e+5)):(e=n.indexOf("Edg"),i=n.substring(e+4))):-1!==(e=n.indexOf("MSIE"))?(r="Microsoft Internet Explorer",i=n.substring(e+5)):-1!==(e=n.indexOf("Lark"))?(r="Lark",i=n.substring(e+5,e+11)):-1!==(e=n.indexOf("MetaSr"))?(r="sougoubrowser",i=n.substring(e+7,e+10)):-1!==n.indexOf("MQQBrowser")||-1!==n.indexOf("QQBrowser")?(r="qqbrowser",-1!==n.indexOf("MQQBrowser")?(e=n.indexOf("MQQBrowser"),i=n.substring(e+11,e+15)):-1!==n.indexOf("QQBrowser")&&(e=n.indexOf("QQBrowser"),i=n.substring(e+10,e+17))):-1!==n.indexOf("Chrome")?-1!==(e=n.indexOf("MicroMessenger"))?(r="weixin",i=n.substring(e+15,e+20)):-1!==(e=n.indexOf("360"))?(r="360browser",i=n.substring(n.indexOf("Chrome")+7)):-1!==n.indexOf("baidubrowser")||-1!==n.indexOf("BIDUBrowser")?(-1!==n.indexOf("baidubrowser")?(e=n.indexOf("baidubrowser"),i=n.substring(e+13,e+16)):-1!==n.indexOf("BIDUBrowser")&&(e=n.indexOf("BIDUBrowser"),i=n.substring(e+12,e+15)),r="baidubrowser"):-1!==(e=n.indexOf("xiaomi"))?-1!==n.indexOf("openlanguagexiaomi")?(r="openlanguage xiaomi",i=n.substring(e+7,e+13)):(r="xiaomi",i=n.substring(e-7,e-1)):-1!==(e=n.indexOf("TTWebView"))?(r="TTWebView",i=n.substring(e+10,e+23)):(-1!==(e=n.indexOf("Chrome"))||-1!==(e=n.indexOf("Chrome")))&&(r="Chrome",i=n.substring(e+7)):-1!==n.indexOf("Safari")?-1!==(e=n.indexOf("QQ"))?(r="qqbrowser",i=n.substring(e+10,e+16)):-1!==(e=n.indexOf("Safari"))&&(r="Safari",i=n.substring(e+7),-1!==(e=n.indexOf("Version"))&&(i=n.substring(e+8))):-1!==(e=n.indexOf("Firefox"))?(r="Firefox",i=n.substring(e+8)):-1!==(e=n.indexOf("MicroMessenger"))?(r="weixin",i=n.substring(e+15,e+20)):-1!==(e=n.indexOf("QQ"))?(r="qqbrowser",i=n.substring(e+3,e+8)):-1!==(e=n.indexOf("Opera"))&&(r="Opera",i=n.substring(e+6),-1!==(e=n.indexOf("Version"))&&(i=n.substring(e+8))),-1!==(t=i.indexOf(";"))&&(i=i.substring(0,t)),-1!==(t=i.indexOf(" "))&&(i=i.substring(0,t)),-1!==(t=i.indexOf(")"))&&(i=i.substring(0,t)),{browser:r,browser_version:i}},e.prototype.os=function(){for(var e="",t="",r=[{s:"Windows 10",r:/(Windows 10.0|Windows NT 10.0|Windows NT 10.1)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Android",r:/Android/},{s:"Sun OS",r:/SunOS/},{s:"Linux",r:/(Linux|X11)/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/}],i=0;i<r.length;i++){var n=r[i];if(n.r.test(this.userAgent)){"Mac OS X"===(e=n.s)&&this.isNewIpad()&&(e="iOS");break}}var o,a,s=function(e,t){var r=e.exec(t);return r&&r[1]?r[1]:""},l=function(e,t){var r=RegExp("(?:^|[^A-Z0-9-_]|[^A-Z0-9-]_|sprd-)(?:"+e+")","i").exec(t);return r?r.slice(1)[0]:""};switch(/Windows/.test(e)&&(t=s(/Windows (.*)/,e),e="windows"),e){case"Mac OS X":t=l("Mac[ +]OS[ +]X(?:[ /](?:Version )?(\\d+(?:[_\\.]\\d+)+))?",this.userAgent),e="mac";break;case"Android":(a=s(/Android ([\.\_\d]+)/,o=this.userAgent))||(a=s(/Android\/([\.\_\d]+)/,o)),t=a,e="android";break;case"iOS":t=this.isNewIpad()?l("Mac[ +]OS[ +]X(?:[ /](?:Version )?(\\d+(?:[_\\.]\\d+)+))?",this.userAgent):(t=/OS (\d+)_(\d+)_?(\d+)?/.exec(this.appVersion))?t[1]+"."+t[2]+"."+(0|t[3]):"",e="ios"}return{os_name:e,os_version:t}},e.prototype.getDeviceModel=function(e){var t="";try{if("android"===e)navigator.userAgent.split(";").forEach((function(e){e.indexOf("Build/")>-1&&(t=e.slice(0,e.indexOf("Build/")))}));else if("ios"===e||"mac"===e||"windows"===e)if(this.isNewIpad())t="iPad";else{var r=navigator.userAgent.replace("Mozilla/5.0 (",""),i=r.indexOf(";");t=r.slice(0,i)}}catch(n){return t.trim()}return t.trim()},e.prototype.isNewIpad=function(){return void 0!==this.userAgent&&"MacIntel"===navigator.platform&&"number"==typeof navigator.maxTouchPoints&&navigator.maxTouchPoints>1},e}(),u,p,f=(u=function(e,t){e.exports=function(){function e(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)e[i]=r[i]}return e}return function t(r,i){function n(t,n,o){if("undefined"!=typeof document){"number"==typeof(o=e({},i,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var s in o)o[s]&&(a+="; "+s,!0!==o[s]&&(a+="="+o[s].split(";")[0]));return document.cookie=t+"="+r.write(n,t)+a}}return Object.create({set:n,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var t=document.cookie?document.cookie.split("; "):[],i={},n=0;n<t.length;n++){var o=t[n].split("="),a=o.slice(1).join("=");try{var s=decodeURIComponent(o[0]);if(i[s]=r.read(a,s),e===s)break}catch(l){}}return e?i[e]:i}},remove:function(t,r){n(t,"",e({},r,{expires:-1}))},withAttributes:function(r){return t(this.converter,e({},this.attributes,r))},withConverter:function(r){return t(e({},this.converter,r),this.attributes)}},{attributes:{value:Object.freeze(i)},converter:{value:Object.freeze(r)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"})}()},u(p={exports:{}},p.exports),p.exports),d=f,g=function(){function e(){this.cache={}}return e.prototype.setItem=function(e,t){this.cache[e]=t},e.prototype.getItem=function(e){return this.cache[e]},e.prototype.removeItem=function(e){this.cache[e]=void 0},e.prototype.getCookie=function(e){this.getItem(e)},e.prototype.setCookie=function(e,t){this.setItem(e,t)},e}(),l,m={getItem:function(e){try{var t=localStorage.getItem(e),r=t;try{t&&"string"==typeof t&&(r=JSON.parse(t))}catch(i){}return r||{}}catch(i){}return{}},setItem:function(e,t){try{var r="string"==typeof t?t:JSON.stringify(t);localStorage.setItem(e,r)}catch(i){}},removeItem:function(e){try{localStorage.removeItem(e)}catch(t){}},getCookie:function(e,t){try{return d.get(e,{domain:t||document.domain})}catch(r){return""}},setCookie:function(e,t,r,i){try{var n=i||document.domain,o=+new Date+r;d.set(e,t,{expires:new Date(o),path:"/",domain:n})}catch(a){}},isSupportLS:function(){try{return localStorage.setItem("_ranger-test-key","hi"),localStorage.getItem("_ranger-test-key"),localStorage.removeItem("_ranger-test-key"),!0}catch(e2){return!1}}()},_={getItem:function(e){try{var t=sessionStorage.getItem(e),r=t;try{t&&"string"==typeof t&&(r=JSON.parse(t))}catch(i){}return r||{}}catch(i){}return{}},setItem:function(e,t){try{var r="string"==typeof t?t:JSON.stringify(t);sessionStorage.setItem(e,r)}catch(i){}},removeItem:function(e){try{sessionStorage.removeItem(e)}catch(t){}},getCookie:function(e){this.getItem(e)},setCookie:function(e,t){this.setItem(e,t)},isSupportSession:function(){try{return sessionStorage.setItem("_ranger-test-key","hi"),sessionStorage.getItem("_ranger-test-key"),sessionStorage.removeItem("_ranger-test-key"),!0}catch(e2){return!1}}()},v=function(){function e(e,t){this._storage=t&&"session"===t?_:!e&&m.isSupportLS?m:new g}return e.prototype.getItem=function(e){return this._storage.getItem(e)},e.prototype.setItem=function(e,t){this._storage.setItem(e,t)},e.prototype.getCookie=function(e,t){return this._storage.getCookie(e,t)},e.prototype.setCookie=function(e,t,r,i){this._storage.setCookie(e,t,r,i)},e.prototype.removeItem=function(e){this._storage.removeItem(e)},e}(),y={cn:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az24z1mz1jz1az1cz18z1nz1nz1jz1mz1ez4az1az1mz1k",va:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az1gz22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k",sg:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k"},w=void 0,b=(new Date).getTimezoneOffset(),k=parseInt(""+-b/60,10),x=60*b,O=function(){function e(e,t){this.is_first_time=!0,this.initConfig=t,this.collect=e;var r=new h(t.app_id).init(),i="__tea_cache_first_"+t.app_id;this.configKey="__tea_cache_config_"+t.app_id,this.sessionStorage=new v(!1,"session"),this.localStorage=new v(!1,"local");var n=this.localStorage.getItem(i);n&&1==n?this.is_first_time=!1:(this.is_first_time=!0,this.localStorage.setItem(i,"1")),this.envInfo={user:{user_unique_id:w,user_type:w,user_id:w,user_is_auth:w,user_is_login:w,device_id:w,web_id:w,user_unique_id_type:w},header:{app_id:w,app_name:w,app_install_id:w,install_id:w,app_package:w,app_channel:w,app_version:w,ab_version:w,os_name:r.os_name,os_version:r.os_version,device_model:r.device_model,ab_client:w,traffic_type:w,client_ip:w,device_brand:w,os_api:w,access:w,language:r.language,region:w,app_language:w,app_region:w,creative_id:w,ad_id:w,campaign_id:w,log_type:w,rnd:w,platform:r.platform,sdk_version:"0.0.3-lite",sdk_lib:"js",province:w,city:w,timezone:k,tz_offset:x,tz_name:w,sim_region:w,carrier:w,resolution:r.screen_width+"x"+r.screen_height,browser:r.browser,browser_version:r.browser_version,referrer:r.referrer,referrer_host:r.referrer_host,width:r.screen_width,height:r.screen_height,screen_width:r.screen_width,screen_height:r.screen_height,utm_term:w,utm_content:w,utm_source:w,utm_medium:w,utm_campaign:w,custom:{},wechat_unionid:w,wechat_openid:w}},this.evtParams={},this.reportErrorCallback=function(){},this.initDomain()}return e.prototype.initDomain=function(){var e=this.initConfig.channel_domain;if(e)this.domain=e;else{var t=this.initConfig.channel;this.domain=a(y[t])}},e.prototype.setDomain=function(e){this.domain=e},e.prototype.getDomain=function(){return this.domain},e.prototype.getUrl=function(e){var t="";switch(e){case"event":t=this.initConfig.report_url||"/list";break;case"webid":t="/webid"}return""+this.getDomain()+t},e.prototype.set=function(e){var t=this;Object.keys(e).forEach((function(r){"evtParams"===r?t.evtParams=_e({},t.evtParams||{},e.evtParams||{}):"_staging_flag"===r?t.evtParams=_e({},t.evtParams||{},{_staging_flag:e._staging_flag}):"reportErrorCallback"===r&&"function"==typeof e[r]?t.reportErrorCallback=e[r]:Object.hasOwnProperty.call(t.envInfo.user,r)?["user_id","web_id","user_unique_id"].indexOf(r)>-1&&(t.envInfo.user[r]=e[r]?String(e[r]):e[r]):Object.hasOwnProperty.call(t.envInfo.header,r)?t.envInfo.header[r]=e[r]:t.envInfo.header.custom[r]=e[r]}))},e.prototype.get=function(e){try{return e?"evtParams"===e?this.evtParams:"reportErrorCallback"===e?this[e]:Object.hasOwnProperty.call(this.envInfo.user,e)?this.envInfo.user[e]:Object.hasOwnProperty.call(this.envInfo.header,e)?this.envInfo.header[e]:JSON.parse(JSON.stringify(this.envInfo[e])):JSON.parse(JSON.stringify(this.envInfo))}catch(t){console.log("get config stringify error ")}},e}(),e2;e2=l||(l={}),e2.Init="init",e2.Config="config",e2.Start="start",e2.Ready="ready",e2.TokenComplete="token-complete",e2.TokenStorage="token-storage",e2.TokenFetch="token-fetch",e2.TokenError="token-error",e2.ConfigUuid="config-uuid",e2.TokenChange="token-change",e2.TokenReset="token-reset",e2.SessionReset="session-reset",e2.SessionResetTime="session-reset-time",e2.Event="event",e2.Events="events",e2.EventNow="event-now",e2.CleanEvents="clean-events",e2.BeconEvent="becon-event";var I=l,S=500,z=5005;function M(e,t,r,i,n,o,a,s,l){try{var c=new XMLHttpRequest,u=s||"POST";c.open(u,""+e,!0),c.setRequestHeader("Content-Type","application/json; charset=utf-8"),r&&(c.timeout=r,c.ontimeout=function(){o&&o(t,z)}),c.onload=function(){if(n){var e=null;if(c.responseText){try{e=JSON.parse(c.responseText)}catch(r){e={}}n(e,t)}}},c.onerror=function(){c.abort(),o&&o(t,S)},l?c.send(t):c.send(JSON.stringify(t))}catch(h){}}var T=4003,C=function(){function e(){this.eventLimit=50,this.eventCache=[],this.beconEventCache=[]}return e.prototype.apply=function(e,t){var r=this;this.collect=e,this.config=t,this.configManager=e.configManager,this.cacheStorgae=new v(!0),this.localStorage=new v(!1),this.maxReport=t.max_report||20,this.reportTime=t.reportTime||30,this.timeout=t.timeout||1e5,this.reportUrl=this.configManager.getUrl("event"),this.eventKey="__tea_cache_events_"+this.configManager.get("app_id"),this.beconKey="__tea_cache_events_becon_"+this.configManager.get("app_id"),this.collect.on(I.Ready,(function(){r.reportAll(!1)})),this.collect.on(I.Event,(function(e){r.event(e)})),this.collect.on(I.BeconEvent,(function(e){r.beconEvent(e)})),this.linster()},e.prototype.linster=function(){var e,t=this;window.addEventListener("unload",(function(){t.reportAll(!0)}),!1),e=function(){t.reportAll(!0)},navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)?window.addEventListener("pagehide",e,!1):window.addEventListener("beforeunload",e,!1),document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&t.reportAll(!0)}),!1)},e.prototype.reportAll=function(e){this.report(e),this.reportBecon()},e.prototype.event=function(e){var t=this;try{var r=i(e,this.cacheStorgae.getItem(this.eventKey)||[]);if(this.cacheStorgae.setItem(this.eventKey,r),this.reportTimeout&&clearTimeout(this.reportTimeout),r.length>=this.maxReport)this.report(!1);else{var n=this.reportTime;this.reportTimeout=setTimeout((function(){t.report(!1),t.reportTimeout=null}),n)}}catch(o){}},e.prototype.beconEvent=function(e){var t=i(e,this.cacheStorgae.getItem(this.beconKey)||[]);this.cacheStorgae.setItem(this.beconKey,t),this.collect.destroyInstance||this.collect.tokenManager.getReady()&&this.collect.sdkReady&&(this.cacheStorgae.removeItem(this.beconKey),this.send(this.split(this.merge(t)),!0))},e.prototype.reportBecon=function(){var e=this.cacheStorgae.getItem(this.beconKey)||[];e&&e.length&&(this.cacheStorgae.removeItem(this.beconKey),this.send(this.split(this.merge(e)),!0))},e.prototype.report=function(e){if(!this.collect.destroyInstance&&this.collect.tokenManager.getReady()&&this.collect.sdkReady){var t=this.cacheStorgae.getItem(this.eventKey)||[];t.length&&(this.cacheStorgae.removeItem(this.eventKey),this.sliceEvent(t,e))}},e.prototype.sliceEvent=function(e,t){if(e.length>this.eventLimit)for(var r=0;r<e.length;r+=this.eventLimit){var i;i=e.slice(r,r+this.eventLimit);var n=this.split(this.merge(i));this.send(n,t)}else n=this.split(this.merge(e)),this.send(n,t)},e.prototype.merge=function(e){var t=this,r=this.configManager.get(),i=r.header,n=r.user;i.custom=JSON.stringify(i.custom);var o=this.configManager.get("evtParams"),a=e.map((function(e){try{return Object.keys(o).length&&(e.params=_e({},o,e.params)),e.session_id=t.collect.sessionManager.getSessionId(),e.params=JSON.stringify(e.params),e}catch(e2){return e}})),s=[];if(!Object.keys(n).length)return console.warn("user info error,cant report"),s;var l=JSON.parse(JSON.stringify({events:a,user:n,header:i}));return l.local_time=Math.floor(Date.now()/1e3),l.verbose=1,s.push(l),s},e.prototype.split=function(e){return e.map((function(e){var t=[];return t.push(e),t}))},e.prototype.send=function(e,t){var r=this;e.length&&e.forEach((function(e){try{if(!e.length)return;i=r.reportUrl,n=e,o=r.timeout,a=function(e,t){},s=function(e,t){r.configManager.get("reportErrorCallback")(e,t)},!1,t&&window.navigator&&window.navigator.sendBeacon?window.navigator.sendBeacon(i,JSON.stringify(n))||s(i,n):M(i,n,o,0,a,s,0,"",false)}catch(l){console.warn("something error, "+JSON.stringify(l.stack))}var i,n,o,a,s}))},e}(),E=function e(t){return t?(t^16*Math.random()>>t/4).toString(10):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e)},P=function(){return E().replace(/-/g,"").slice(0,19)},A=function(){function e(){this.cacheToken={}}return e.prototype.apply=function(e,t){var r=this;this.collect=e,this.config=t,this.configManager=this.collect.configManager,this.storage=new v(!1),this.tokenKey="__tea_cache_tokens_"+t.app_id,this.collect.on(I.ConfigUuid,(function(e){r.setUuid(e)})),this.checkStorage()},e.prototype.checkStorage=function(){this.cacheToken=this.storage.getItem(this.tokenKey)||{},this.check()},e.prototype.check=function(){this.cacheToken&&this.cacheToken.web_id?this.complete(this.cacheToken):this.remoteWebid()},e.prototype.remoteWebid=function(){var e=this,t=this.configManager.getUrl("webid"),r={app_key:this.config.app_key,app_id:this.config.app_id,url:location.href,user_agent:window.navigator.userAgent,referer:document.referrer,user_unique_id:""},i=P();M(t,r,3e5,0,(function(t){var r;t&&0===t.e?r=t.web_id:(r=i,e.collect.configManager.set({localWebId:i}),e.collect.logger.warn("appid: "+e.config.app_id+" get webid error, use local webid~")),e.complete({web_id:e.configManager.get("web_id")||r,user_unique_id:e.configManager.get("user_unique_id")||r})}),(function(){e.complete({web_id:e.configManager.get("web_id")||i,user_unique_id:e.configManager.get("user_unique_id")||i}),e.collect.configManager.set({localWebId:i}),e.collect.logger.warn("appid: "+e.config.app_id+", get webid error, use local webid~")}))},e.prototype.complete=function(e){var t=e.web_id,r=e.user_unique_id;t||r?(e.timestamp=Date.now(),this.collect.configManager.set({web_id:t,user_unique_id:r}),this.setStorage(e),this.tokenReady=!0,this.collect.emit(I.TokenComplete)):console.warn("token error")},e.prototype.setUuid=function(e){if(e&&-1===["null","undefined","Null","None"].indexOf(e)){var t=String(e),r=this.configManager.get("user_unique_id"),i=this.cacheToken&&this.cacheToken.user_unique_id;if(t===r&&t===i)return;this.configManager.set({user_unique_id:t}),this.cacheToken||(this.cacheToken={}),this.cacheToken.user_unique_id=t,this.cacheToken.timestamp=Date.now(),this.setStorage(this.cacheToken)}else this.clearUuid()},e.prototype.clearUuid=function(){this.config.enable_ttwebid||this.configManager.get("web_id")&&(this.configManager.set({user_unique_id:this.configManager.get("web_id")}),this.cacheToken&&this.cacheToken.web_id&&(this.cacheToken.user_unique_id=this.cacheToken.web_id,this.cacheToken.timestamp=Date.now(),this.setStorage(this.cacheToken)),this.collect.emit(I.TokenReset))},e.prototype.setStorage=function(e){e._type_="default",this.storage.setItem(this.tokenKey,e),this.cacheToken=e},e.prototype.getReady=function(){return this.tokenReady},e}(),D=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},N=function(){function e(){}return e.prototype.apply=function(e,t){var r=this;this.collect=e,this.storage=new v(!1,"session"),this.sessionKey="__tea_session_id_"+t.app_id,this.expireTime=t.expireTime||18e5,this.disableSession=t.disable_session,this.disableSession||(this.setSessionId(),this.collect.on(I.SessionReset,(function(){r.resetSessionId()})),this.collect.on(I.SessionResetTime,(function(){r.updateSessionIdTime()})))},e.prototype.updateSessionIdTime=function(){var e=this.storage.getItem(this.sessionKey);if(e&&e.sessionId){var t=e.timestamp;Date.now()-t>this.expireTime?e={sessionId:D(),timestamp:Date.now()}:e.timestamp=Date.now(),this.storage.setItem(this.sessionKey,e),this.resetExpTime()}},e.prototype.setSessionId=function(){var e=this,t=this.storage.getItem(this.sessionKey);t&&t.sessionId?t.timestamp=Date.now():t={sessionId:D(),timestamp:Date.now()},this.storage.setItem(this.sessionKey,t),this.sessionExp=setInterval((function(){e.checkEXp()}),this.expireTime)},e.prototype.getSessionId=function(){var e=this.storage.getItem(this.sessionKey);return this.disableSession?"":e&&e.sessionId?e.sessionId:""},e.prototype.resetExpTime=function(){var e=this;this.sessionExp&&(clearInterval(this.sessionExp),this.sessionExp=setInterval((function(){e.checkEXp()}),this.expireTime))},e.prototype.resetSessionId=function(){var e={sessionId:D(),timestamp:Date.now()};this.storage.setItem(this.sessionKey,e)},e.prototype.checkEXp=function(){var e=this.storage.getItem(this.sessionKey);e&&e.sessionId&&Date.now()-e.timestamp+30>=this.expireTime&&(e={sessionId:D(),timestamp:Date.now()},this.storage.setItem(this.sessionKey,e))},e}(),R=function(){function e(e){this.disableAutoPageView=!1,this.staging=!1,this.sended=!1,this.started=!1,this.adapters={},this.sdkReady=!1,this.name=e,this.hook=new o,this.Types=I,this.adapters.fetch=M,this.adapters.storage=v}return e.prototype.init=function(e){var t,i=this;this.inited?console.log("init can be call only one time"):e&&r(e)?e.app_id&&"number"==typeof(t=e.app_id)&&!isNaN(t)?e.app_key&&"string"!=typeof e.app_key?console.warn("app_key param is error, must be string, please check!"):(e.channel_domain||-1!==["cn","sg","va"].indexOf(e.channel)||(console.warn("channel must be `cn`, `sg`,`va` !!!"),e.channel="cn"),this.inited=!0,this.configManager=new O(this,e),this.initConfig=e,e.disable_auto_pv&&(this.disableAutoPageView=!0),this.configManager.set({app_id:e.app_id}),this.eventManager=new C,this.tokenManager=new A,this.sessionManager=new N,Promise.all([new Promise((function(e){i.once(I.TokenComplete,(function(){e(!0)}))})),new Promise((function(e){i.once(I.Start,(function(){e(!0)}))}))]).then((function(){i.sdkReady=!0,i.emit(I.Ready),console.info("appid: "+e.app_id+", userInfo:"+JSON.stringify(i.configManager.get("user"))),console.info("appid: "+e.app_id+", sdk is ready, version is 0.0.3-lite, you can report now !!!"),i.pageView()})),this.tokenManager.apply(this,e),this.eventManager.apply(this,e),this.sessionManager.apply(this,e),this.emit(I.Init)):console.warn("app_id param is error, must be number, please check!"):console.warn("init params error,please check")},e.prototype.config=function(e){if(this.inited)if(e&&r(e)){e._staging_flag&&1===e._staging_flag&&(this.staging=!0),e.disable_auto_pv&&(this.disableAutoPageView=!0,delete e.disable_auto_pv);var t=_e({},e);t.user_unique_id;var i=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(e);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(e,i[n])&&(r[i[n]]=e[i[n]])}return r}(t,["user_unique_id"]);t.hasOwnProperty("user_unique_id")&&this.emit(I.ConfigUuid,t.user_unique_id),this.configManager.set(i)}else console.warn("config params is error, please check");else console.warn("config must be use after function init")},e.prototype.getConfig=function(e){return this.configManager.get(e)},e.prototype.start=function(){this.inited&&!this.sended&&(this.sended=!0,this.emit(I.Start))},e.prototype.event=function(e,t){var r=this;try{var i=[];Array.isArray(e)?e.forEach((function(e){i.push(r.processEvent(e[0],e[1]||{}))})):i.push(this.processEvent(e,t)),i.length&&(this.emit(I.Event,i),this.emit(I.SessionResetTime))}catch(n){console.warn("something error, please check")}},e.prototype.beconEvent=function(e,t){if(Array.isArray(e))console.warn("beconEvent not support batch report, please check");else{var r=[];r.push(this.processEvent(e,t||{})),r.length&&(this.emit(I.BeconEvent,r),this.emit(I.SessionResetTime))}},e.prototype.processEvent=function(e,t){void 0===t&&(t={});try{var r=e;/^event\./.test(e)&&(r=e.slice(6));var i=t;"object"!=_typeof$4(i)&&(i={}),i.event_index=s();var n=void 0;return i.local_ms?(n=i.local_ms,delete i.local_ms):n=+new Date,{event:r,params:i,local_time_ms:n}}catch(o){return{event:e,params:t}}},e.prototype.on=function(e,t){this.hook.on(e,t)},e.prototype.once=function(e,t){this.hook.once(e,t)},e.prototype.off=function(e,t){this.hook.off(e,t)},e.prototype.emit=function(e,t,r){this.hook.emit(e,t,r)},e.prototype.set=function(e){this.hook.set(e)},e.prototype.pageView=function(){this.disableAutoPageView||this.predefinePageView()},e.prototype.predefinePageView=function(e){void 0===e&&(e={});var t={title:document.title||location.pathname,url:location.href,url_path:location.pathname,time:Date.now(),referrer:window.document.referrer,$is_first_time:""+(this.configManager&&this.configManager.is_first_time)},r=_e({},t,e);this.event("predefine_pageview",r)},e}(),q=new R("default"),CN_APPID=468759,CHANNEL="cn",DEVICE_ID_KEY="veplayer_live_device_id",USER_ID_Key="veplayer_live_user_id",genRandomID=function(e){return Math.floor((9*Math.random()+1)*Math.pow(10,e-1)).toString()},getDeviceID=function(){var e=localStorage.getItem(DEVICE_ID_KEY);return e||(e=genRandomID(11),localStorage.setItem(DEVICE_ID_KEY,e),e)},getUserId=function(){var e=localStorage.getItem(USER_ID_Key);return e||(e=genRandomID(12),localStorage.setItem(USER_ID_Key,e),e)},LiveLogger=function(e){_inherits$5(r,e);var t=_createSuper$5(r);function r(){return _classCallCheck$5(this,r),t.apply(this,arguments)}return _createClass$6(r,[{key:"afterCreate",value:function(){var e,t,r=this;this.config.enable&&(this.config.appId?(this.openLog(this.config),null===(e=this.player.plugins)||void 0===e||null===(t=e.sdkerrorplugin)||void 0===t||t.addErrDetail((function(){var e,t,i;if(r._liveLogger)return{label:"userId",value:null===(e=r._liveLogger)||void 0===e||null===(t=e.logger)||void 0===t||null===(i=t.options)||void 0===i?void 0:i.user_id}}))):console.info("not found appid, logger is closed"))}},{key:"_createTea",value:function(e){var t=e.userId,r=e.deviceId;q.init({app_id:CN_APPID,channel:CHANNEL}),q.start(),q.config({user_unique_id:t||getUserId(),device_id:r||getDeviceID()})}},{key:"startLog",value:function(e){this._createTea(e),this._liveLogger=new LoggerControl({Tea:q,player:this.player,aid:e.appId,project_key:e.appId,app_name:e.appId})}},{key:"closeLog",value:function(){this._liveLogger.destroy(),this._liveLogger=null}},{key:"openLog",value:function(e){!this._liveLogger&&this.startLog(_objectSpread2$5(_objectSpread2$5({},this.config),e))}}],[{key:"pluginName",get:function(){return"liveLogger"}},{key:"defaultConfig",get:function(){return{appId:"",enable:!0}}}]),r}(Plugin);const hls={name:"HlsPlayer",url:"//unpkg.byted-static.com/xgplayer-hls/3.0.0-next.36-1/dist/index.min.js"},flv={name:"FlvPlayer",url:"//unpkg.byted-static.com/xgplayer-flv/3.0.0-next.23/dist/index.min.js"},XGVideo={name:"XGVideo",url:"//unpkg.byted-static.com/byted/xgplayer-xgvideo/0.1.16/dist/index.min.js"},hlsEncrypt={name:"EncryptHlsPlugin",url:"//unpkg.byted-static.com/byted/xgplayer-encrypt-hls/4.1.5/dist/index.min.js"},dash={name:"DashPlugin",url:"//unpkg.byted-static.com/byted/xgplayer-encrypt/3.3.0/dist/index.min.js"},shaka={name:"ShakaPlugin",url:"//unpkg.byted-static.com/xgplayer-shaka/3.0.0-alpha.1/dist/index.min.js"},mp4Encrypt={name:"Mp4EncryptPlayer",url:"//unpkg.byted-static.com/byted/xgplayer-encrypt-mp4/3.0.0-alpha.36-25/dist/index.min.js"},danmujs={name:"danmu.js",url:"//unpkg.byted-static.com/danmu.js/0.6.4/dist/index.js"},danmuMask={name:"DanmuMask",url:"//unpkg.byted-static.com/byted/danmu-mask/0.3.6/browser/index.js"},subtitle={name:"XgSubtitle",url:"//unpkg.byted-static.com/xgplayer-subtitles/1.0.22/dist/index.min.js"},streamprobe={name:"StreamProbe",url:"//unpkg.byted-static.com/byted/streamprobe/1.0.2/dist/index.min.js"};var umdUrlMap={hls:hls,flv:flv,XGVideo:XGVideo,hlsEncrypt:hlsEncrypt,dash:dash,shaka:shaka,mp4Encrypt:mp4Encrypt,danmujs:danmujs,danmuMask:danmuMask,subtitle:subtitle,streamprobe:streamprobe},umdLoader=function(){function e(){_classCallCheck$5(this,e),this.umdUrlMap=umdUrlMap,this.backupUmdUrlMap={},this.jsLoadMap={}}return _createClass$6(e,[{key:"updateBackupMap",value:function(e){this.backupUmdUrlMap=e}},{key:"loadExtraCdn",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return new Promise((function(r,i){var n=t?document.createElement("script"):document.createElement("link");t?n.src=e:(n.rel="stylesheet",n.type="text/css",n.href=e),document.body.appendChild(n),n.onerror=function(){i("url: ".concat(e))},n.onload=n.onreadystatechange=function(){this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||(n.onload=n.onreadystatechange=null,r())}}))}},{key:"loadPlugins",value:function(e,t){var r=this;if(this.umdUrlMap[e]){var i="".concat(e,"_load");return new Promise((function(n){if(Reflect.get(r.jsLoadMap,i))n(r.jsLoadMap[i]);else{var o=r.umdUrlMap[e],a=function(t){r.failCallback&&"function"==typeof r.failCallback&&r.failCallback&&r.failCallback(e,t),n(null)};if(!o)return console.error("".concat(e," umd info not exit")),a(void 0);var s=o.name,l=o.url;if(s&&window[s])return r.jsLoadMap[i]=window[s],t&&t(),n(r.jsLoadMap[i]);retry((function(){return r.loadExtraCdn(l,!0)}),2).then((function(){s?(r.jsLoadMap[i]=window[s],t&&t(),n(window[s])):(r.jsLoadMap[i]=!0,t&&t(),n(null))})).catch((function(o){var l=r.backupUmdUrlMap[e];return l?isUrl(l)?void r.loadExtraCdn(r.backupUmdUrlMap[e]).then((function(){r.jsLoadMap[i]=window[s],t&&t(),n(r.jsLoadMap[i])})).catch((function(t){console.error("load ".concat(e," error, ").concat(t)),a(void 0)})):(console.error("umdUrlMap.".concat(e," isn't a valid url")),a(void 0)):(console.error("load ".concat(e," error, ").concat(o)),a(o))}))}}))}}}]),e}(),sdkUmdLoader=new umdLoader;function createSDKPreset(e){return _createSDKPreset.apply(this,arguments)}function _createSDKPreset(){return(_createSDKPreset=_asyncToGenerator$2(_regeneratorRuntime$2().mark((function e(t){var r,i,n,o,a,s,l,c,u,h,d,p,f,g,y,v,m,_,b,T,S,E;return _regeneratorRuntime$2().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.isLive,o=void 0!==n&&n,a=t.type,s=t.isMobile,l=void 0!==s&&s,c=t.playerData,u=t.getSoftOptionTask,h=["default",getDefaultPreset(o)],d=c.openSoftDecoding,p=c.isMusic,f=c.configs,g=!(null===(r=c.playList)||void 0===r||null===(i=r[0])||void 0===i||!i.kid),y=getPluginConfig(f,"EncryptHlsPlugin"),v=!!y||"hls"===a&&g,m=[],_=[],l?h.push(getMobilePreset({isLive:o,playerData:c})):h.push(getPCPreset({isLive:o,playerData:c})),e.t0=a,e.next="flv"===e.t0?12:"rtm"===e.t0?14:"dash"===e.t0?16:18;break;case 12:return _.push(_asyncToGenerator$2(_regeneratorRuntime$2().mark((function e(){var t,r;return _regeneratorRuntime$2().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!l){e.next=8;break}if(!isMSESupport()&&!d){e.next=6;break}return e.next=4,sdkUmdLoader.loadPlugins("flv");case 4:t=e.sent,m.push(t);case 6:e.next=12;break;case 8:return e.next=10,sdkUmdLoader.loadPlugins("flv");case 10:r=e.sent,m.push(r);case 12:case"end":return e.stop()}}),e)})))()),e.abrupt("break",19);case 14:return _.push(_asyncToGenerator$2(_regeneratorRuntime$2().mark((function e(){return _regeneratorRuntime$2().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([sdkUmdLoader.loadPlugins("hls"),sdkUmdLoader.loadPlugins("flv")]);case 2:m.push(RtmPlugin);case 3:case"end":return e.stop()}}),e)})))()),e.abrupt("break",19);case 16:return _.push(_asyncToGenerator$2(_regeneratorRuntime$2().mark((function e(){var t;return _regeneratorRuntime$2().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!f.url){e.next=5;break}return e.next=3,sdkUmdLoader.loadPlugins("shaka");case 3:t=e.sent,m.push(t);case 5:case"end":return e.stop()}}),e)})))()),e.abrupt("break",19);case 18:return e.abrupt("break",19);case 19:return!p&&getPluginConfig(c.options,"DanmuPlugin")&&_.push(_asyncToGenerator$2(_regeneratorRuntime$2().mark((function e(){var t;return _regeneratorRuntime$2().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([sdkUmdLoader.loadPlugins("danmujs"),sdkUmdLoader.loadPlugins("danmuMask")]);case 2:(t=e.sent)[0]&&t[1]&&m.push(DanmuPlugin);case 4:case"end":return e.stop()}}),e)})))()),getPluginConfig(c.options,"Subtitle")&&c.plugins.every((function(e){return"subtitle"!==e.pluginName.toLowerCase()}))&&m.push(Subtitle),e.next=23,Promise.all([u(),getPluginByConfig({isMobile:l,isLive:o,openSoftDecoding:d,type:a,isHlsEncrypt:v,playerData:c,plugins:m})].concat(_));case 23:return b=e.sent,T=_slicedToArray(b,2),S=T[0],E=T[1],e.abrupt("return",{presets:h,softDecodingOption:S,plugins:[].concat(m,_toConsumableArray$1(E)).filter(Boolean)});case 28:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function getDefaultPreset(e){var t=[ErrorPlugin,ToastPlugin,UnmutePlugin];return e&&t.push(RefreshPlugin,LiveLogger),_createClass$6((function e(){_classCallCheck$5(this,e),this.plugins=t,this.ignores=["error"]}))}function getMobilePreset(e){var t,r=e.isLive,i=e.playerData,n=["error","playbackRate"],o=i.configs,a=getPluginConfig(o,"EncryptHlsPlugin"),s=null==o||null===(t=o.autoBitrateOpts)||void 0===t?void 0:t.isOpenAutoDefi;null!=a&&a.playAuthToken||s||n.push("definition");var l=["time","playnext","progress","progresspreview","replay","playbackRate","discontinue","PlaybackRateMobilePlugin"],c=[MoreButtonPlugin];return _createClass$6((function e(){_classCallCheck$5(this,e),this.plugins=c,this.ignores=r?[].concat(l,n):[].concat(n)}))}function getPCPreset(e){var t,r=e.isLive,i=e.playerData,n=["cssfullscreen"],o=["time","playnext","progress","progresspreview","replay","playbackRate","discontinue"],a=r?[MultilinePlugin]:[],s=i.configs,l=getPluginConfig(s,"EncryptHlsPlugin"),c=null==s||null===(t=s.autoBitrateOpts)||void 0===t?void 0:t.isOpenAutoDefi;return null!=l&&l.playAuthToken||c||(n.push("definition"),a.push(DefinitionPlugin)),_createClass$6((function e(){_classCallCheck$5(this,e),this.plugins=a,this.ignores=r?[].concat(o,n):[].concat(n)}))}function getPluginByConfig(e){return _getPluginByConfig.apply(this,arguments)}function _getPluginByConfig(){return(_getPluginByConfig=_asyncToGenerator$2(_regeneratorRuntime$2().mark((function e(t){var r,i,n,o,a,s,l,c,u,h,d,p,f,g,y,v,m,_,b,T,S,E,$,C,P,w;return _regeneratorRuntime$2().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=t.isMobile,a=t.isLive,s=t.openSoftDecoding,l=t.type,c=t.isHlsEncrypt,u=t.playerData,h=t.plugins,d=[],p=u.configs,f=u.options,g=u.useHlsPluginForSafari,y=!(null===(r=u.playList)||void 0===r||null===(i=r[0])||void 0===i||!i.kid)||isEncryptPlay(null==p?void 0:p.getVideoByToken),"hls"!==l){e.next=29;break}if(!c){e.next=12;break}return e.next=8,sdkUmdLoader.loadPlugins("hlsEncrypt");case 8:v=e.sent,d.push(v),e.next=29;break;case 12:if(!o){e.next=24;break}if(m=getPluginConfig(f,"Subtitle"),_=a&&m,b=(isMSESupport()||window.WebAssembly)&&s,T=p.enableHlsMSE,!(b||_||T)){e.next=22;break}return e.next=20,sdkUmdLoader.loadPlugins("hls");case 20:S=e.sent,d.push(S);case 22:e.next=29;break;case 24:if(isSafari&&!g){e.next=29;break}return e.next=27,sdkUmdLoader.loadPlugins("hls");case 27:E=e.sent,d.push(E);case 29:if(("dash"!==l||p.url)&&!getPluginConfig(f,"DASHPlugin")){e.next=34;break}return e.next=32,sdkUmdLoader.loadPlugins("dash");case 32:null!=(P=e.sent)&&null!==($=P.encryptUtils)&&void 0!==$&&null!==(C=$.isSupported)&&void 0!==C&&C.call($)&&h.push(P);case 34:if(getPluginConfig(f,"vodLogOpts")&&d.push(xgVodLogger),p.enableContextmenu&&d.push(MenuPlugin),!(p.enableMp4MSE||getPluginConfig(f,"Mp4EncryptPlayer")||"mp4"===l&&(y||null!=p&&null!==(n=p.autoBitrateOpts)&&void 0!==n&&n.isOpenAutoDefi||u.openSoftDecoding))){e.next=41;break}return e.next=39,sdkUmdLoader.loadPlugins("mp4Encrypt");case 39:w=e.sent,d.push(w);case 41:return e.abrupt("return",d.filter((function(e){var t,r,i,n,o;return"encrypthlsplugin"===(null==e||null===(t=e.pluginName)||void 0===t?void 0:t.toLowerCase())?!(null==e||null===(i=e.isSupported)||void 0===i||!i.call(e))||(console.warn("当前浏览器环境不支持HLS格式视频的加密播放"),!1):"dashplugin"!==(null==e||null===(r=e.pluginName)||void 0===r?void 0:r.toLowerCase())||(!(null==e||null===(n=e.encryptUtils)||void 0===n||null===(o=n.isSupported)||void 0===o||!o.call(n))||(console.warn("当前浏览器环境不支持DASH格式视频播放"),!1))})));case 42:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function danmuSettingsSVG$1(){return(new DOMParser).parseFromString('<svg width="22" height="19" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd" opacity=".6"><path d="M-4-4h28v28H-4z"/><path d="M1 19a1 1 0 01-1-1V1a1 1 0 011-1h17.2a1 1 0 011 1v3.75h-.001l.001 1.475a.9.9 0 11-1.8 0V1.8H1.8v15.4h8.442l-.029.019h.296a.89.89 0 01.017 1.78h7.691L18.2 19H1z" fill="#FFF" fill-rule="nonzero"/><path d="M5.507 7.698L5.33 9.279h2.511c0 2.015-.075 3.362-.2 4.042-.151.68-.792 1.054-1.934 1.124-.327 0-.653-.023-1.005-.047l-.339-1.136c.327.035.678.059 1.03.059.628 0 .98-.188 1.067-.563.088-.374.138-1.183.138-2.424H4l.352-3.679h2.122V5.132H4.113V4.09h3.654v3.608h-2.26zm3.089-2.214h1.507A8.91 8.91 0 009.16 4.03l1.193-.375c.351.469.665.96.93 1.5l-.792.328h1.733a14.68 14.68 0 00.93-1.921l1.242.41a8.956 8.956 0 01-.854 1.51H15v4.933h-2.587v.902h2.446l-1.014 1.148h-1.432v2.097h-1.28v-2.097h-2.99v-1.148h2.99v-.902H8.595V5.484zm5.249 3.912v-.913h-1.432v.913h1.432zm-2.713 0v-.913H9.764v.913h1.368zm-1.368-1.92h1.368v-.961H9.764v.96zm2.65-.961v.96h1.43v-.96h-1.43z" fill="#FFF" fill-rule="nonzero"/><path d="M17.595 9.84l2.957 1.69a1.2 1.2 0 01.605 1.041v3.358c0 .43-.23.828-.605 1.041l-2.957 1.69a1.2 1.2 0 01-1.19 0l-2.957-1.69a1.2 1.2 0 01-.605-1.041V12.57c0-.43.23-.828.605-1.041l2.957-1.69a1.2 1.2 0 011.19 0zM17 12.47c-.994 0-1.8.797-1.8 1.781a1.79 1.79 0 001.8 1.781c.994 0 1.8-.797 1.8-1.781a1.79 1.79 0 00-1.8-1.781z" fill="#FFF"/></g></svg>',"image/svg+xml").firstChild}function fullscreenActiveSVG$1(){return(new DOMParser).parseFromString('<svg width="21" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M3.892 2h4.445v1.778H3.892v4.444H2.114V3.778C2.114 2.796 2.91 2 3.892 2zm4.445 16v-4.444c0-.982-.796-1.778-1.778-1.778H2.114v1.778h2.944L2.264 16.35a.9.9 0 001.272 1.273l2.988-2.987a.918.918 0 00.035-.037V18h1.778zm8-6.222v4.444h-4.445V18h4.445c.981 0 1.777-.796 1.777-1.778v-4.444h-1.777zM11.892 2v4.445c0 .981.796 1.777 1.778 1.777h4.444V6.445H15.17l2.568-2.568a.9.9 0 10-1.273-1.273L13.67 5.4V2h-1.778z" fill="#fff"/></svg>',"image/svg+xml").firstChild}function fullscreenDefaultSVG$1(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M3.778 2h4.444v1.778H3.778v4.444H2V3.778C2 2.796 2.796 2 3.778 2zM2 11.778v4.444C2 17.204 2.796 18 3.778 18h4.444v-1.778H4.823l2.313-2.313a.9.9 0 00-1.272-1.273l-2.086 2.086v-2.944H2zm14.222 0v4.444h-4.444V18h4.444c.982 0 1.778-.796 1.778-1.778v-4.444h-1.778zM18 8.222V3.778C18 2.796 17.204 2 16.222 2h-4.444v1.778h2.945l-2.587 2.586a.9.9 0 101.273 1.273l2.813-2.813v3.398H18z" fill="#fff"/></svg>',"image/svg+xml").firstChild}function pauseSVG$1(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="5.313" y="3.75" width="3.125" height="12.5" rx=".625" fill="#fff"/><rect x="11.563" y="3.75" width="3.125" height="12.5" rx=".625" fill="#fff"/></svg>',"image/svg+xml").firstChild}function playSVG$1(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14.121 8.299a2 2 0 010 3.402l-7.94 4.91c-1.332.825-3.051-.133-3.051-1.7V5.09c0-1.567 1.72-2.525 3.052-1.701l7.939 4.911z" fill="#fff"/></svg>',"image/svg+xml").firstChild}function playNextSVG$1(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14.03 8.312a2 2 0 010 3.376l-7.642 4.858c-1.332.847-3.073-.11-3.073-1.687V5.14c0-1.577 1.741-2.534 3.073-1.687l7.642 4.858z" fill="#fff"/><path d="M13 3.5a.5.5 0 01.5-.5h1a.5.5 0 01.5.5v13a.5.5 0 01-.5.5h-1a.5.5 0 01-.5-.5v-13z" fill="#fff"/></svg>',"image/svg+xml").firstChild}function replaySVG(){return(new DOMParser).parseFromString('<svg width="72" height="72" viewBox="0 0 72 72" xmlns="http://www.w3.org/2000/svg"><g fill="#FFF" fill-rule="evenodd"><circle fill-opacity=".3" cx="36" cy="36" r="36"/><path d="M40.167 32.667a.833.833 0 01-.834-.834v-1.666c0-.46.373-.834.834-.834h5.409a11.653 11.653 0 00-9.576-5c-6.443 0-11.667 5.224-11.667 11.667S29.557 47.667 36 47.667c5.285 0 9.749-3.514 11.183-8.333h3.445C49.112 46.014 43.138 51 36 51c-8.284 0-15-6.716-15-15 0-8.284 6.716-15 15-15 4.713 0 8.918 2.173 11.668 5.572l-.001-4.739c0-.46.373-.833.833-.833h1.667c.46 0 .833.373.833.833V31c0 .879-.68 1.598-1.542 1.662l-.125.005h-9.166z"/></g></svg>',"image/svg+xml").firstChild}function startPlaySVG(){return(new DOMParser).parseFromString('<svg width="60" height="60" viewBox="0 0 60 60" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="60" height="60" rx="30" fill="#000" fill-opacity=".4"/><path d="M40.243 28.3a2 2 0 010 3.401L24.06 41.712c-1.332.825-3.052-.134-3.052-1.7V19.988c0-1.566 1.72-2.525 3.052-1.7l16.184 10.01z" fill="#fff"/></svg>',"image/svg+xml").firstChild}function volumeLargeSVG(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.867 2.5h.55c.44 0 .799.34.83.771l.003.062v13.334c0 .44-.34.799-.771.83l-.062.003h-.55a.833.833 0 01-.444-.128l-.064-.045-4.867-3.744a.831.831 0 01-.322-.59l-.003-.07V7.077c0-.235.099-.458.271-.615l.054-.045L9.36 2.673a.832.832 0 01.43-.17l.078-.003h.55-.55zm6.767 2.278A7.474 7.474 0 0118.75 10a7.477 7.477 0 01-2.128 5.234.4.4 0 01-.57-.004l-.587-.586a.442.442 0 01.005-.617A5.812 5.812 0 0017.083 10c0-1.557-.61-2.97-1.603-4.017a.442.442 0 01-.003-.615l.586-.586a.4.4 0 01.57-.004zM2.5 6.667c.23 0 .417.186.417.416v5.834c0 .23-.187.416-.417.416h-.833a.417.417 0 01-.417-.416V7.083c0-.23.187-.416.417-.416H2.5zm11.768.46A4.153 4.153 0 0115.417 10c0 1.12-.442 2.137-1.162 2.886a.388.388 0 01-.555-.007l-.577-.578c-.176-.176-.156-.467.009-.655A2.49 2.49 0 0013.75 10a2.49 2.49 0 00-.61-1.636c-.163-.188-.182-.477-.006-.653l.578-.578a.388.388 0 01.556-.006z" fill="#fff"/></svg>',"image/svg+xml").firstChild}function volumeMutedSVG(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.045 2.5h.55c.44 0 .8.34.831.771l.003.062v13.334c0 .44-.34.799-.771.83l-.063.003h-.55a.833.833 0 01-.443-.128l-.065-.045-4.866-3.744a.831.831 0 01-.323-.59l-.003-.07V7.077c0-.235.1-.458.272-.615l.054-.045 4.866-3.744a.832.832 0 01.43-.17l.078-.003h.55-.55zM2.68 6.667c.23 0 .416.186.416.416v5.834c0 .23-.186.416-.416.416h-.834a.417.417 0 01-.416-.416V7.083c0-.23.186-.416.416-.416h.834zm10.467.294a.417.417 0 01.59 0l1.767 1.768L17.27 6.96a.417.417 0 01.589 0l.59.59a.417.417 0 010 .589L16.68 9.908l1.768 1.767c.15.15.162.387.035.55l-.035.04-.589.589a.417.417 0 01-.59 0l-1.767-1.768-1.768 1.768a.417.417 0 01-.59 0l-.588-.59a.417.417 0 010-.589l1.767-1.768-1.767-1.767a.417.417 0 01-.035-.55l.035-.04.589-.589z" fill="#fff"/></svg>',"image/svg+xml").firstChild}function volumeSmallSVG(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.867 2.5h.55c.44 0 .799.34.83.771l.003.062v13.334c0 .44-.34.799-.771.83l-.062.003h-.55a.833.833 0 01-.444-.128l-.064-.045-4.867-3.744a.831.831 0 01-.322-.59l-.003-.07V7.077c0-.235.099-.458.271-.615l.054-.045L9.36 2.673a.832.832 0 01.43-.17l.078-.003h.55-.55zM2.5 6.667c.23 0 .417.186.417.416v5.834c0 .23-.187.416-.417.416h-.833a.417.417 0 01-.417-.416V7.083c0-.23.187-.416.417-.416H2.5zm11.768.46A4.153 4.153 0 0115.417 10c0 1.12-.442 2.137-1.162 2.886a.388.388 0 01-.555-.007l-.577-.578c-.176-.176-.156-.467.009-.655A2.49 2.49 0 0013.75 10a2.49 2.49 0 00-.61-1.636c-.163-.188-.182-.477-.006-.653l.578-.578a.388.388 0 01.556-.006z" fill="#fff"/></svg>',"image/svg+xml").firstChild}var iconsOption$1={startPlay:startPlaySVG,play:playSVG$1,pause:pauseSVG$1,fullscreen:fullscreenDefaultSVG$1,exitFullscreen:fullscreenActiveSVG$1,playNext:playNextSVG$1,replay:replaySVG,refresh:refreshSVG$1,danmuSetting:danmuSettingsSVG$1,openDanmu:Default,closeDanmu:danmuActiveSVG$1,volumeLarge:volumeLargeSVG,volumeMuted:volumeMutedSVG,volumeSmall:volumeSmallSVG},initOption$1={whitelist:[""],widescreen:!0,width:"100%",height:"100%",lang:getLang(),fitVideoSize:!1,inactive:2e3,playsinline:!0,keyShortcut:"off",closeVideoClick:!0,closeVideoDblclick:!0,closePlayerBlur:!1,closeControlsBlur:!1,closePlayVideoFocus:!0,leavePlayerTime:0,mini:!1,pip:{position:"controlsRight",index:2.5,showIcon:!0},volume:{index:2.6},miniscreen:{left:window.innerWidth-360,top:window.innerHeight-450},time:{index:3},icons:_objectSpread2$5({},iconsOption$1),flv:{retryCount:0},hls:{retryCount:3}},liveOption$1={isLive:!0,closeVideoClick:!0,autoplay:!0,autoplayMuted:!0,preloadTime:8,start:{isShowPause:!1,isShowEnd:!1,mode:"hide",disableAnimate:!0},retry:{count:0}},vodOption$1={isLive:!1,closeVideoClick:!1,defaultPlaybackRate:1,closeVideoStopPropagation:!0,autoplay:!1,autoplayMuted:!1,playbackRate:[2,1.5,1.25,{rate:1,iconText:{zh:"倍速",en:"Speed",jp:"Speed"}},.75,.5],start:{isShowPause:!0,isShowEnd:!1,mode:"hide",disableAnimate:!0},progresspreview:{isShowCoverPreview:!0},progress:{isPauseMoving:!0}};function createPlayerOption$1(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=_objectSpread2$5({},initOption$1),r=_objectSpread2$5({},e?liveOption$1:vodOption$1);return _objectSpread2$5(_objectSpread2$5({},t),r)}function danmuSVG(){return(new DOMParser).parseFromString('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M3.746 12.444a1 1 0 00-.62.216L1.75 13.75V2.166c0-.23.187-.417.417-.417h11.666c.23 0 .417.187.417.417v6.687c.44.044.86.156 1.25.326V2.167c0-.92-.746-1.667-1.667-1.667H2.167C1.247.5.5 1.246.5 2.167V14.61a.833.833 0 001.35.653l1.71-1.354a1 1 0 01.621-.216h5.543a4.195 4.195 0 01-.02-1.25H3.745z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M4.5 4a.5.5 0 00-.5.5V5a.5.5 0 00.5.5h5A.5.5 0 0010 5v-.5a.5.5 0 00-.5-.5h-5zm2.333 4.167a.5.5 0 00-.5.5v.666a.5.5 0 00.5.5h4.292c.311-.266.662-.487 1.042-.653v-.513a.5.5 0 00-.5-.5H6.834zm-3 .5a.5.5 0 01.5-.5H5a.5.5 0 01.5.5v.666a.5.5 0 01-.5.5h-.667a.5.5 0 01-.5-.5v-.666z" fill="#fff"/><path d="M11 4.5a.5.5 0 01.5-.5h.5a.5.5 0 01.5.5V5a.5.5 0 01-.5.5h-.5A.5.5 0 0111 5v-.5z" fill="#fff"/><circle cx="13.833" cy="13" r="3.333" fill="#3370FF"/><path d="M15.591 12.011l-2.133 2.134-1.22-1.22" stroke="#fff" stroke-linecap="round" stroke-linejoin="round"/></svg>',"image/svg+xml").firstChild}function danmuActiveSVG(){return(new DOMParser).parseFromString('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M3.746 12.444a1 1 0 00-.62.216L1.75 13.75V2.166c0-.23.187-.417.417-.417h11.666c.23 0 .417.187.417.417v6.687c.44.044.86.156 1.25.326V2.167c0-.92-.746-1.667-1.667-1.667H2.167C1.247.5.5 1.246.5 2.167V14.61a.833.833 0 001.35.653l1.71-1.354a1 1 0 01.621-.216h5.543a4.195 4.195 0 01-.02-1.25H3.745z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M4.5 4a.5.5 0 00-.5.5V5a.5.5 0 00.5.5h5A.5.5 0 0010 5v-.5a.5.5 0 00-.5-.5h-5zm2.333 4.167a.5.5 0 00-.5.5v.666a.5.5 0 00.5.5h4.292c.311-.266.662-.487 1.042-.653v-.513a.5.5 0 00-.5-.5H6.834zm-3 .5a.5.5 0 01.5-.5H5a.5.5 0 01.5.5v.666a.5.5 0 01-.5.5h-.667a.5.5 0 01-.5-.5v-.666z" fill="#fff"/><path d="M11 4.5a.5.5 0 01.5-.5h.5a.5.5 0 01.5.5V5a.5.5 0 01-.5.5h-.5A.5.5 0 0111 5v-.5z" fill="#fff"/><circle cx="13.833" cy="13" r="2.733" stroke="#fff" stroke-width="1.2"/><path fill="#fff" d="M12.833 10.77l3.473 3.472-1.063 1.064-3.474-3.473z"/></svg>',"image/svg+xml").firstChild}function danmuSettingsSVG(){return(new DOMParser).parseFromString('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M3.746 12.444a1 1 0 00-.62.216L1.75 13.75V2.166c0-.23.187-.417.417-.417h11.666c.23 0 .417.187.417.417v6.687c.44.044.86.156 1.25.326V2.167c0-.92-.746-1.667-1.667-1.667H2.167C1.247.5.5 1.246.5 2.167V14.61a.833.833 0 001.35.653l1.71-1.354a1 1 0 01.621-.216h5.543a4.195 4.195 0 01-.02-1.25H3.745z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M4.5 4a.5.5 0 00-.5.5V5a.5.5 0 00.5.5h5A.5.5 0 0010 5v-.5a.5.5 0 00-.5-.5h-5zm2.333 4.167a.5.5 0 00-.5.5v.666a.5.5 0 00.5.5h4.292c.311-.266.662-.487 1.042-.653v-.513a.5.5 0 00-.5-.5H6.834zm-3 .5a.5.5 0 01.5-.5H5a.5.5 0 01.5.5v.666a.5.5 0 01-.5.5h-.667a.5.5 0 01-.5-.5v-.666z" fill="#fff"/><path d="M11 4.5a.5.5 0 01.5-.5h.5a.5.5 0 01.5.5V5a.5.5 0 01-.5.5h-.5A.5.5 0 0111 5v-.5z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M14.387 10.134a1 1 0 00-1 0l-1.887 1.09a1 1 0 00-.5.865v2.179a1 1 0 00.5.866l1.887 1.09a1 1 0 001 0l1.886-1.09a1 1 0 00.5-.866v-2.179a1 1 0 00-.5-.866l-1.886-1.089zm-.5 4.711a1.667 1.667 0 100-3.333 1.667 1.667 0 000 3.333z" fill="#fff"/></svg>',"image/svg+xml").firstChild}function fullscreenActiveSVG(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M17.5 8.333h-4.167c-.92 0-1.666-.746-1.666-1.666V2.5h1.666v4.167H17.5v1.666zM2.5 6.667v1.666h4.167c.92 0 1.666-.746 1.666-1.666V2.5H6.667v4.167H2.5zM2.5 13.333h4.167V17.5h1.666v-4.167c0-.92-.746-1.666-1.666-1.666H2.5v1.666zM13.333 17.5v-4.167H17.5v-1.666h-4.167c-.92 0-1.666.746-1.666 1.666V17.5h1.666z" fill="#fff"/></svg>',"image/svg+xml").firstChild}function fullscreenDefaultSVG(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.125 3a.375.375 0 00-.375.375v.75c0 .207.168.375.375.375H15.5v3.375c0 .207.168.375.375.375h.75A.375.375 0 0017 7.875v-4.5A.375.375 0 0016.625 3h-4.5zm0 12.5a.375.375 0 00-.375.375v.75c0 .207.168.375.375.375h4.5a.375.375 0 00.375-.375v-4.5a.375.375 0 00-.375-.375h-.75a.375.375 0 00-.375.375V15.5h-3.375zM3 3.375C3 3.168 3.168 3 3.375 3h4.5c.207 0 .375.168.375.375v.75a.375.375 0 01-.375.375H4.5v3.375a.375.375 0 01-.375.375h-.75A.375.375 0 013 7.875v-4.5zM7.875 15.5H4.5v-3.375a.375.375 0 00-.375-.375h-.75a.375.375 0 00-.375.375v4.5c0 .207.168.375.375.375h4.5a.375.375 0 00.375-.375v-.75a.375.375 0 00-.375-.375z" fill="#fff"/></svg>',"image/svg+xml").firstChild}function pauseSVG(){return(new DOMParser).parseFromString('<svg style="\n height: 18px;\n width: 18px;\n" width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="7.438" y="5.25" width="4.375" height="17.5" rx=".875" fill="#fff"/><rect x="16.188" y="5.25" width="4.375" height="17.5" rx=".875" fill="#fff"/></svg>',"image/svg+xml").firstChild}function playSVG(){return(new DOMParser).parseFromString('<svg style="\n height: 18px;\n width: 18px;\n" width="28" height="28" fill="none" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg"><path d="M19.77 11.619c1.768 1.094 1.768 3.668 0 4.762L8.653 23.257c-1.865 1.154-4.273-.188-4.273-2.381V7.125c0-2.194 2.408-3.536 4.273-2.382L19.77 11.62z" fill="#fff"/></svg>',"image/svg+xml").firstChild}function playNextSVG(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M4.77 4.124l8.358 5.07c.38.23.486.704.238 1.056a.807.807 0 01-.238.22L4.77 15.543c-.38.231-.889.132-1.137-.221a.723.723 0 01-.134-.417V4.762c0-.421.368-.762.822-.762.159 0 .316.042.449.124z" stroke="#fff" stroke-width="1.5"/><path d="M15.5 4.5A.5.5 0 0116 4h.5a.5.5 0 01.5.5v11a.5.5 0 01-.5.5H16a.5.5 0 01-.5-.5v-11z" fill="#fff"/></svg>',"image/svg+xml").firstChild}function refreshSVG(){return(new DOMParser).parseFromString('<svg width="18" height="18" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><path d="M0 0h18v18H0z"/><path d="M10.875 7.5a.375.375 0 01-.375-.375v-.75c0-.207.168-.375.375-.375h2.434a5.25 5.25 0 10.723 4.5h1.55a6.75 6.75 0 11-1.332-5.743V2.626c0-.207.168-.375.375-.375h.75c.207 0 .375.168.375.375V6.75a.75.75 0 01-.694.748L15 7.5h-4.125z" fill="#FFF"/></g></svg>',"image/svg+xml").firstChild}var iconsOption={startPlay:startPlaySVG,play:playSVG,pause:pauseSVG,fullscreen:fullscreenDefaultSVG,exitFullscreen:fullscreenActiveSVG,playNext:playNextSVG,replay:replaySVG,refresh:refreshSVG,danmuSetting:danmuSettingsSVG,openDanmu:danmuSVG,closeDanmu:danmuActiveSVG,volumeLarge:volumeLargeSVG,volumeMuted:volumeMutedSVG,volumeSmall:volumeSmallSVG},initOption={width:"100%",height:"100%",lang:getLang(),playsinline:!0,closeVideoClick:!0,closeVideoTouch:!0,whitelist:[""],"x5-video-player-type":"h5-page","x5-video-player-fullscreen":!1,"x5-video-orientation":"landscape|portrait",enterTips:{background:"linear-gradient(90deg,#000,#49e6d3,#49e6d3,#138afc,#000)"},retainPlay:!0,start:{isShowPause:!0,isShowEnd:!0,disableAnimate:!1},fullscreen:{useCssFullscreen:!1},plugins:[],time:{mode:"pc",index:2.5},controls:{mode:"flex"},danmusettings:{index:"2"},danmuicon:{index:"3"},cusPlaybackRatePlugin:{needCheck:!0,needPanel:!1},icons:_objectSpread2$5({},iconsOption),flv:{innerDegrade:1,retryCount:0},hls:{innerDegrade:1,retryCount:3}},liveOption={isLive:!0,closeVideoClick:!0,autoplay:!0,autoplayMuted:!0,start:{isShowPause:!1,isShowEnd:!1,disableAnimate:!1,mode:"hide"},retry:{count:0},longwaiting:{duration:3e4},mobile:{gestureY:!1,gestureX:!1,disableActive:!0}},vodOption={isLive:!1,closeVideoClick:!1,autoplay:!1,autoplayMuted:!1,playbackRate:[2,1.5,1.25,{rate:1,iconText:"倍速",en:"speed",jp:"speed"},.75,.5],defaultPlaybackRate:1,closeVideoStopPropagation:!0,mobile:{gestureY:!1},start:{isShowPause:!0,isShowEnd:!1,disableAnimate:!1,mode:"hide"}};function createPlayerOption(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=_objectSpread2$5({},initOption),r=_objectSpread2$5({},e?liveOption:vodOption);return _objectSpread2$5(_objectSpread2$5({},t),r)}var POSITIONS$6=Plugin.POSITIONS,extendPlugin=function(e){var t="mobile"===sniffer$1.device,r=e.pluginName,i=void 0===r?"ExtendPlugin".concat(Math.random().toString().slice(-5)):r,n=e.type,o=void 0===n?t?"inner":"normal":n,a=e.position,s=void 0===a?POSITIONS$6.CONTROLS_LEFT:a,l=e.icon,c=void 0===l?Default:l,u=e.index,h=void 0===u?1:u,d=e.hideAtFullScreen,p=void 0===d||d,f=e.tips,g=void 0===f?{jp:"custom",en:"custom",zh:"自定义","zh-hk":"自定义"}:f;return function(e){_inherits$5(r,e);var t=_createSuper$5(r);function r(){return _classCallCheck$5(this,r),t.apply(this,arguments)}return _createClass$6(r,[{key:"afterCreate",value:function(){var e;this.appendChild(".xgplayer-icon",this.icons[i]),this.initEvents(),p&&null!==(e=this.player)&&void 0!==e&&e.fullscreen&&this.handleFullScreenChange()}},{key:"registerIcons",value:function(){return _defineProperty$6({},i,{icon:c,class:"xgplayer-extendicon-svg"})}},{key:"updateIcons",value:function(e){var t=this.find(".xgplayer-icon");t&&(t.innerHTML=e)}},{key:"registerLanguageTexts",value:function(){return _defineProperty$6({},i,g)}},{key:"initEvents",value:function(){this.handleCallback=debounce$1(this.handleCallback.bind(this),200);var e,t="mobile"===sniffer$1.device?"touchend":"click";(this.bind(t,this.handleCallback),this.show(),p)&&(null===(e=this.player)||void 0===e||e.on(FULLSCREEN_CHANGE,this.handleFullScreenChange.bind(this)))}},{key:"handleFullScreenChange",value:function(){var e,t=this.player;null===(e=this.player)||void 0===e||e.changePluginsIcon(i,!(null!=t&&t.fullscreen))}},{key:"handleCallback",value:function(e){var t=this.player;t&&(e.preventDefault(),e.stopPropagation(),t.emit(PluginEvents.PLAYER_EXTEND_BUTTON,i))}},{key:"destroy",value:function(){var e;(this.unbind(["touchend","click"],this.handleCallback),p)&&(null===(e=this.player)||void 0===e||e.off(FULLSCREEN_CHANGE,this.handleFullScreenChange.bind(this)))}},{key:"render",value:function(){return'\n <xg-icon class="xgplayer-extend-icon">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(i,'">').concat(this.langText[i],"</div>\n </xg-icon>\n ")}}],[{key:"isExtendPlugin",get:function(){return!0}},{key:"type",get:function(){return o}},{key:"textTips",get:function(){return g}},{key:"pluginName",get:function(){return i}},{key:"defaultConfig",get:function(){return{position:s,index:h}}}]),r}(Plugin)},MobilePlayerPanel=function(){function e(t){var r,i;_classCallCheck$5(this,e);var n=t.config,o=t.root,a=t.player;this.config=n,this.parent=o,this.player=a,this.mode=null!==(r=null==n?void 0:n.mode)&&void 0!==r?r:PLAYER_MODE.INNER,this.isAutoChange=null!==(i=null==n?void 0:n.isAutoChange)&&void 0!==i&&i,this.isShow=!1,this.initEvents(),this.renderPanel()}var t;return _createClass$6(e,[{key:"initEvents",value:function(){var e;this.isAutoChange&&(window.addEventListener("orientationchange",this.handleOrientationChange.bind(this)),null===(e=this.player)||void 0===e||e.on(FULLSCREEN_CHANGE,this.handleOrientationChange.bind(this)))}},{key:"handleOrientationChange",value:function(){var e,t,r,i=[90,-90,"90","-90"].includes(window.orientation);null!==(e=this.player)&&void 0!==e&&e.fullscreen&&i?this.changeMode(PLAYER_MODE.FULLSCREEN):this.changeMode(null!==(t=null===(r=this.config)||void 0===r?void 0:r.mode)&&void 0!==t?t:PLAYER_MODE.INNER)}},{key:"changeConfig",value:function(e){this.config=e}},{key:"changeMode",value:function(e){this.mode=e,this.player.emit(PluginEvents.PANEL_MODE_CHANGE,{mode:e}),this.destroy(),this.renderPanel()}},{key:"renderPanel",value:function(){var e="xg-mobile-panel panel-".concat(["normal","inner","fullscreen"][this.mode]);switch(this.root=util.createDom("div","",{},e),this.parent&&(this.parent.appendChild(this.root),this.hide()),this.bind("click",this.handleHide.bind(this)),this.mode){case PLAYER_MODE.NORMAL:var t=util.createDom("div","",{},"xg-mobile-panel-content");this.root.appendChild(t),this.container=t,t.addEventListener("click",(function(e){e.stopPropagation(),e.preventDefault()}));break;case PLAYER_MODE.INNER:this.container=this.root;break;case PLAYER_MODE.FULLSCREEN:var r=util.createDom("div","",{},"xg-mobile-panel-content");this.root.appendChild(r),this.container=r,r.addEventListener("click",(function(e){e.stopPropagation(),e.preventDefault()}))}}},{key:"showPanel",value:(t=_asyncToGenerator$2(_regeneratorRuntime$2().mark((function e(t){var r,i=this,n=arguments;return _regeneratorRuntime$2().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.length>1&&void 0!==n[1]?n[1]:"",n.length>2&&void 0!==n[2]&&n[2]&&util.addClass(t,"item-list-panel-content"),this.setTitle(r),!this.children){e.next=9;break}return e.next=7,this.hide();case 7:return setTimeout((function(){i.children=t,i.container&&(i.title&&i.container.appendChild(i.title),i.container.appendChild(t)),i.show()})),e.abrupt("return");case 9:this.children=t,this.container&&(this.title&&this.container.appendChild(this.title),this.container.appendChild(t)),this.show();case 12:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"updatePanel",value:function(e){this.children&&util.hasClass(this.children,"item-list-panel-content")&&util.addClass(e,"item-list-panel-content"),this.children=e,this.container&&(this.container.innerHTML="",this.title&&this.container.appendChild(this.title),this.container.appendChild(e)),this.show()}},{key:"setTitle",value:function(e){e&&this.mode!==PLAYER_MODE.INNER?this.title?this.title.innerHTML=e:this.title=this.renderTitle(e):this.title=void 0}},{key:"renderTitle",value:function(e){return util.createDom("div",e,{},"xg-mobile-panel-title")}},{key:"show",value:function(){this.isShow=!0,util.removeClass(this.root,"hide"),util.addClass(this.root,"active")}},{key:"hide",value:function(){this.isShow=!1,util.removeClass(this.root,"active"),util.addClass(this.root,"hide"),this.container&&(this.container.innerHTML="")}},{key:"handleHide",value:function(e){e.stopPropagation(),e.preventDefault(),this.hide()}},{key:"bind",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.root&&"on".concat(e)in this.root&&"function"==typeof t&&this.root.addEventListener(e,t,r)}},{key:"destroy",value:function(){var e;this.parent&&this.root&&this.parent.contains(this.root)&&(this.parent.removeChild(this.root),this.root=null),window.removeEventListener("orientationchange",this.handleOrientationChange.bind(this)),null===(e=this.player)||void 0===e||e.off(FULLSCREEN_CHANGE,this.handleOrientationChange.bind(this))}}]),e}();function DefinitionIconSVG(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M16 3.8001H4C3.55817 3.8001 3.2 4.15827 3.2 4.6001V12.6001C3.2 13.0419 3.55817 13.4001 4 13.4001H16C16.4418 13.4001 16.8 13.0419 16.8 12.6001V4.6001C16.8 4.15827 16.4418 3.8001 16 3.8001ZM4 2.6001C2.89543 2.6001 2 3.49553 2 4.6001V12.6001C2 13.7047 2.89543 14.6001 4 14.6001H16C17.1046 14.6001 18 13.7047 18 12.6001V4.6001C18 3.49553 17.1046 2.6001 16 2.6001H4ZM5.0249 6.24509V11.6001H5.9024V9.23009H8.6174V11.6001H9.4949V6.24509H8.6174V8.48009H5.9024V6.24509H5.0249ZM10.5474 6.24509V11.6001H12.5049C13.3749 11.6001 14.0274 11.3601 14.4774 10.8801C14.9049 10.4226 15.1224 9.77009 15.1224 8.92259C15.1224 8.06759 14.9049 7.41509 14.4774 6.96509C14.0274 6.48509 13.3749 6.24509 12.5049 6.24509H10.5474ZM11.4249 6.99509H12.3399C13.0074 6.99509 13.4949 7.14509 13.8024 7.45259C14.1024 7.75259 14.2524 8.24759 14.2524 8.92259C14.2524 9.58259 14.1024 10.0701 13.8024 10.3851C13.4949 10.6926 13.0074 10.8501 12.3399 10.8501H11.4249V6.99509ZM4.15 16.1001C3.79101 16.1001 3.5 16.3911 3.5 16.7501C3.5 17.1091 3.79101 17.4001 4.15 17.4001H15.85C16.209 17.4001 16.5 17.1091 16.5 16.7501C16.5 16.3911 16.209 16.1001 15.85 16.1001H4.15Z" fill="#ffffff"/>\n</svg>',"image/svg+xml").firstChild}var POSITIONS$5=Plugin.POSITIONS,DefinitionMobilePlugin=function(e){_inherits$5(r,e);var t=_createSuper$5(r);function r(e){var i;return _classCallCheck$5(this,r),(i=t.call(this,e)).toastInfo={},i.playerData=null,i.playerData=e.player.config.playerData,i.dataMonitoring(),i}return _createClass$6(r,[{key:"dataMonitoring",value:function(){var e=this;this.playerData&&MyProxy$1.subscribeProperty(this.playerData.current,"definition",(function(t,r){if(t!==r&&e.player){var i=e.playerData.current.lineId,n=e.playerData.getDefinitionListByLineId(i).find((function(e){return e.definition===r}));n&&n.url&&(e.player.changeDefinition(_objectSpread2$5(_objectSpread2$5({},n),{},{definition:r,url:n.url})),e.updatePanel(),e.player.emit(PluginEvents.INNER_DEFINITION_CHANGE,{from:t,to:r,url:n.url}),e.player.emit(PluginEvents.PlAY_URL_CHANGE,{url:n.url,from:PluginEvents.INNER_DEFINITION_CHANGE}),e.player.config.isLive&&setTimeout((function(){e.player.ended?e.player.replay():e.player.paused&&e.player.play()}),1e3))}}))}},{key:"registerIcons",value:function(){return{definition:{icon:DefinitionIconSVG,class:"xgplayer-definition-svg"}}}},{key:"registerLanguageTexts",value:function(){return{definition:{jp:"明快さ",en:"Definition",zh:"清晰度","zh-hk":"清晰度"},definitionSelect:{jp:"クラリティセレクション",en:"Definition Choose",zh:"清晰度选择","zh-hk":"清晰度選擇"},switching:{jp:"に切り替える",en:"Switching to",zh:"正在切换至","zh-hk":"正在切換至"}}}},{key:"afterCreate",value:function(){this.toastInfo={},this.appendChild(".xgplayer-icon",this.icons.definition),this.initEvents()}},{key:"afterPlayerInit",value:function(){}},{key:"initEvents",value:function(){this.bind(["click"],this.handleButtonChange.bind(this))}},{key:"handleButtonChange",value:function(){var e=this.renderItemList();this.renderPanel(e)}},{key:"renderItemList",value:function(){var e=this,t=this.playerData.current.lineId,r=this.playerData.getDefinitionListByLineId(t),i=util.createDom("div","",{},"definition-panel-content");return r.forEach((function(t){var r=e.renderItem(t);i.appendChild(r)})),i}},{key:"renderItem",value:function(e){var t=this,r=this.playerData.current.definition,i=util.createDom("div","",{},"panel-Item ".concat(r===e.definition?"select-in":""));return i.innerHTML=this.getShowText(this.i18n,e),i.addEventListener("click",(function(r){r.stopPropagation(),r.preventDefault(),t.showToast(e),t.playerData.current.definition=e.definition})),i}},{key:"getShowText",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return e[t.definitionTextKey]||t.definitionTextKey||t.definition}},{key:"showToast",value:function(e){var t,r=this,i=null===(t=this.player)||void 0===t?void 0:t.getPlugin("sdkToastPlugin");if(i){var n=this.getShowText(this.i18n,e),o=i.add("".concat(this.langText.switching).concat(n,"..."),0,!0),a=Date.now();this.toastInfo[o]={showTime:a,delayClose:!1},setTimeout((function(){var e;null!==(e=r.toastInfo[o])&&void 0!==e&&e.delayClose&&(i.remove(o),r.toastInfo[o].delayClose=!1)}),2e3),this.player.once(AFTER_DEFINITION_CHANGE,(function(){var e;Date.now()-(null===(e=r.toastInfo[o])||void 0===e?void 0:e.showTime)>2e3?i.remove(o):r.toastInfo[o].delayClose=!0}))}}},{key:"renderPanel",value:function(e){var t,r;null===(t=this.player)||void 0===t||null===(r=t.panel)||void 0===r||r.showPanel(e,this.langText.definitionSelect,!0)}},{key:"updatePanel",value:function(){var e,t,r=this.renderItemList();null===(e=this.player)||void 0===e||null===(t=e.panel)||void 0===t||t.updatePanel(r)}},{key:"destroy",value:function(){this.unbind(["click"],this.handleButtonChange.bind(this))}},{key:"render",value:function(){return'\n <xg-icon class="xgplayer-mobile-definition">\n <div class="xgplayer-icon">\n </div>\n </xg-icon>\n '}}],[{key:"pluginName",get:function(){return"DefinitionMobilePlugin"}},{key:"textTips",get:function(){return{jp:"明快さ",en:"Definition",zh:"清晰度","zh-hk":"清晰度"}}},{key:"defaultConfig",get:function(){return{position:POSITIONS$5.CONTROLS_RIGHT,index:2.7}}}]),r}(Plugin);function LineIconSVG(){return(new DOMParser).parseFromString('<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M12.7123 1C11.85 1 11.1173 1.55472 10.8516 2.32675L4.94973 2.32675C3.16413 2.32675 1.71662 3.77427 1.71662 5.55987C1.71662 7.34547 3.16413 8.79298 4.94973 8.79298L11.0483 8.79298L11.1134 8.79418C11.9936 8.82748 12.697 9.55166 12.697 10.44C12.697 11.3497 11.9596 12.0871 11.05 12.0871H5.01323C4.67882 11.4781 4.03143 11.0654 3.28763 11.0654C2.20111 11.0654 1.32031 11.9462 1.32031 13.0327C1.32031 14.1192 2.20111 15 3.28763 15C4.14992 15 4.88264 14.4452 5.14834 13.6732H11.05C12.8356 13.6732 14.2831 12.2256 14.2831 10.44C14.2831 8.65444 12.8356 7.20693 11.05 7.20693L4.94973 7.20693C4.04009 7.20693 3.30267 6.46951 3.30267 5.55987C3.30267 4.65022 4.04009 3.91281 4.94973 3.91281L10.9866 3.91281C11.321 4.52183 11.9685 4.93464 12.7123 4.93464C13.7988 4.93464 14.6796 4.05384 14.6796 2.96732C14.6796 1.8808 13.7988 1 12.7123 1ZM12.7123 2.18954C12.2827 2.18954 11.9345 2.53777 11.9345 2.96732C11.9345 3.39688 12.2827 3.7451 12.7123 3.7451C13.1418 3.7451 13.4901 3.39688 13.4901 2.96732C13.4901 2.53777 13.1418 2.18954 12.7123 2.18954ZM2.50986 13.0327C2.50986 12.6031 2.85808 12.2549 3.28763 12.2549C3.71719 12.2549 4.06541 12.6031 4.06541 13.0327C4.06541 13.4622 3.71719 13.8105 3.28763 13.8105C2.85808 13.8105 2.50986 13.4622 2.50986 13.0327Z" fill="#FFFFFF"/>\n</svg>',"image/svg+xml").firstChild}var POSITIONS$4=Plugin.POSITIONS,LineMobilePlugin=function(e){_inherits$5(r,e);var t=_createSuper$5(r);function r(e){var i;return _classCallCheck$5(this,r),(i=t.call(this,e)).playerData=null,i.playerData=e.player.config.playerData,i.dataMonitoring(),i}return _createClass$6(r,[{key:"dataMonitoring",value:function(){var e=this;this.playerData&&MyProxy$1.subscribeProperty(this.playerData.current,"definition",(function(t,r){if(t!==r&&e.player){var i=e.playerData.getCurrentUrl();e.player.changeDefinition({definition:r,url:i}),e.updatePanel(),setTimeout((function(){e.player.paused&&e.player.play()}),1e3)}}))}},{key:"registerIcons",value:function(){return{line:{icon:LineIconSVG,class:"xgplayer-line-svg"}}}},{key:"registerLanguageTexts",value:function(){return{line:{jp:"ライン",en:"Line",zh:"线路","zh-hk":"線路"},lineSelect:{jp:"ライン選ぶ",en:"Line Choose",zh:"线路选择","zh-hk":"線路選擇"}}}},{key:"afterCreate",value:function(){this.appendChild(".xgplayer-icon",this.icons.line),this.initEvents()}},{key:"afterPlayerInit",value:function(){}},{key:"initEvents",value:function(){this.bind(["click"],this.handleButtonChange.bind(this))}},{key:"handleButtonChange",value:function(){var e=this.renderItemList();this.renderPanel(e)}},{key:"renderItemList",value:function(){var e=this,t=this.playerData.getLineList(),r=util.createDom("div","",{},"line-panel-content");return t.forEach((function(t){var i=e.renderItem(t);r.appendChild(i)})),r}},{key:"renderItem",value:function(e){var t=this,r=this.playerData.current.lineId,i=util.createDom("div","",{},"panel-Item ".concat(r===e.lineId?"select-in":""));return i.innerHTML=this.i18n[e.lineTextKey]||e.lineTextKey,i.addEventListener("click",(function(r){r.stopPropagation(),r.preventDefault(),t.player.emit(PluginEvents.LINE_CHANGE,{from:t.playerData.current.lineId,to:e.lineId}),t.playerData.current.lineId=e.lineId,t.player.emit(SDKEvents.PLAYER_REBUILD)})),i}},{key:"renderPanel",value:function(e){var t,r;null===(t=this.player)||void 0===t||null===(r=t.panel)||void 0===r||r.showPanel(e,this.langText.lineSelect,!0)}},{key:"updatePanel",value:function(){var e,t=this.renderItemList();null===(e=this.player)||void 0===e||e.panel.updatePanel(t)}},{key:"destroy",value:function(){this.unbind(["click"],this.handleButtonChange.bind(this))}},{key:"render",value:function(){return'\n <xg-icon class="xgplayer-mobile-line">\n <div class="xgplayer-icon">\n </div>\n </xg-icon>\n '}}],[{key:"pluginName",get:function(){return"LineMobilePlugin"}},{key:"textTips",get:function(){return{jp:"ライン",en:"Line",zh:"线路","zh-hk":"線路"}}},{key:"defaultConfig",get:function(){return{position:POSITIONS$4.CONTROLS_RIGHT,index:2.8}}}]),r}(Plugin);function RateIconSVG(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M14.6879 3.64579C14.7387 3.60575 14.7387 3.52868 14.6879 3.48864L13.3089 2.40296C13.2433 2.35132 13.147 2.39805 13.147 2.48153V4.6529C13.147 4.73639 13.2433 4.78312 13.3089 4.73147L14.6879 3.64579ZM4 2.61914H11.3001V3.91914H4C3.6134 3.91914 3.3 4.23254 3.3 4.61914V15.6191C3.3 16.0057 3.6134 16.3191 4 16.3191H16C16.3866 16.3191 16.7 16.0057 16.7 15.6191V6.75253H18V15.6191C18 16.7237 17.1046 17.6191 16 17.6191H4C2.89543 17.6191 2 16.7237 2 15.6191V4.61914C2 3.51457 2.89543 2.61914 4 2.61914ZM17.7879 3.48864C17.8388 3.52868 17.8388 3.60575 17.7879 3.64579L16.4089 4.73147C16.3433 4.78312 16.2471 4.73639 16.2471 4.6529V2.48153C16.2471 2.39805 16.3433 2.35132 16.4089 2.40296L17.7879 3.48864Z" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}var POSITIONS$3=Plugin.POSITIONS,PlaybackRateMobilePlugin=function(e){_inherits$5(r,e);var t=_createSuper$5(r);function r(e){var i;return _classCallCheck$5(this,r),(i=t.call(this,e)).playerData=null,i.state={currentRate:1,isSupport:!0},i.playerData=e.player.config.playerData,i}return _createClass$6(r,[{key:"registerIcons",value:function(){return{playbackRate:{icon:RateIconSVG,class:"xgplayer-rate-svg"}}}},{key:"registerLanguageTexts",value:function(){return{rate:{jp:"倍速",en:"PlaybackRate",zh:"倍速","zh-hk":"倍速"},rateSelect:{jp:"倍速選ぶ",en:"PlaybackRate",zh:"倍速选择","zh-hk":"倍速選擇"}}}},{key:"afterCreate",value:function(){this.appendChild(".xgplayer-icon",this.icons.playbackRate),this.initEvents(),this.state.currentRate=this.player.playbackRate||1,this.changeIconText()}},{key:"afterPlayerInit",value:function(){}},{key:"initEvents",value:function(){var e=this;this.bind(["click"],this.renderList.bind(this)),this.on(RATE_CHANGE,(function(){var t,r;e.state.currentRate!==e.player.playbackRate&&(e.state.currentRate=e.player.playbackRate,null!==(t=e.player)&&void 0!==t&&null!==(r=t.panel)&&void 0!==r&&r.isShow&&e.updatePanel(),e.changeIconText())}))}},{key:"renderList",value:function(){var e=this.renderItemList();this.renderPanel(e)}},{key:"renderItemList",value:function(){var e=this,t=util.createDom("div","",{},"playbackRate-panel-content");return this.config.list.forEach((function(r){var i=e.renderItem(r);t.appendChild(i)})),t}},{key:"renderItem",value:function(e){var t=this,r=isObject$n(e)?e:{textKey:e+"X",value:e},i=util.createDom("div","",{},"panel-Item ".concat(this.state.currentRate===r.value?"select-in":""));return i.innerHTML=this.i18n[r.textKey]||r.textKey,i.addEventListener("click",(function(e){e.stopPropagation(),e.preventDefault(),t.emit(RATE_CHANGE,{from:t.player.playbackRate,to:r.value}),t.state.currentRate=r.value,t.player.playbackRate=r.value,t.updatePanel(),t.changeIconText()})),i}},{key:"renderPanel",value:function(e){var t,r;null===(t=this.player)||void 0===t||null===(r=t.panel)||void 0===r||r.showPanel(e,this.langText.rateSelect,!0)}},{key:"updatePanel",value:function(){var e,t=this.renderItemList();null===(e=this.player)||void 0===e||e.panel.updatePanel(t)}},{key:"changeIconText",value:function(){var e,t=this.state.currentRate,r=t%1==0?t.toFixed(1):t+"";switch(r.length){case 1:case 2:case 3:default:e=.7;break;case 4:e=.5}var i=this.find(".icon-text");i.style.transform="scale(".concat(e,")"),i.innerHTML=r}},{key:"destroy",value:function(){this.unbind(["click"],this.renderList.bind(this))}},{key:"render",value:function(){return'\n <xg-icon class="xgplayer-mobile-playBackRate">\n <div class="xgplayer-icon">\n <div class="icon-text"></div>\n </div>\n </xg-icon>\n '}}],[{key:"pluginName",get:function(){return"PlaybackRateMobilePlugin"}},{key:"textTips",get:function(){return{jp:"倍速",en:"PlaybackRate",zh:"倍速","zh-hk":"倍速"}}},{key:"defaultConfig",get:function(){return{position:POSITIONS$3.CONTROLS_RIGHT,index:2.9,list:[2,1.5,1.25,1,.75,.5],default:1}}}]),r}(Plugin),SdkPlugin=function(){function e(t){_classCallCheck$5(this,e),this.__args=null,this.sdk=null,this.playerData=null,this.player=null,this._emitter=null,this.beforeCreate&&"function"==typeof this.beforeCreate&&this.beforeCreate(),this.__args=t,this.pluginName="",this.__init(t)}return _createClass$6(e,[{key:"beforeCreate",value:function(){}},{key:"afterCreate",value:function(){}},{key:"beforePlayerCreate",value:function(){}},{key:"afterPlayerCreate",value:function(){}},{key:"destroy",value:function(){}},{key:"__init",value:function(t){var r=this;e.defineGetterOrSetter(this,{sdk:{get:function(){return t.sdk},configurable:!0},player:{get:function(){return t.sdk.getPlayerInstance()},configurable:!0},playerData:{get:function(){return t.sdk.playerData},configurable:!0},pluginName:{get:function(){return t.pluginName?t.pluginName.toLowerCase():r.constructor.pluginName.toLowerCase()},configurable:!0},_emitter:{get:function(){return t.sdk._emitter},configurable:!0}})}},{key:"__destroy",value:function(){var e=this,t=this.sdk,r=this.pluginName;this.destroy&&"function"==typeof this.destroy&&this.destroy(),["sdk","player","playerData","pluginName","_emitter"].map((function(t){Object.defineProperty(e,t,{writable:!0})})),Object.keys(this).map((function(t){e[t]=null,delete e[t]})),Object.setPrototypeOf&&Object.setPrototypeOf(this,null),delete t._sdkPlugins[r]}}],[{key:"defineGetterOrSetter",value:function(e,t){for(var r in t)Object.defineProperty(e,r,t[r])}},{key:"pluginName",get:function(){return"pluginName"}}]),e}(),defaultConfig={playAuthToken:"",needDefinitionList:!0},AuthToken=function(e){_inherits$5(a,e);var t,r,i,n,o=_createSuper$5(a);function a(e){var t;return _classCallCheck$5(this,a),(t=o.call(this,e)).isPlayByToken=!1,t.isEncrypt=!1,t.config=null,t.retryCount=1,t.init(),t}return _createClass$6(a,[{key:"beforePlayerCreate",value:(n=_asyncToGenerator$2(_regeneratorRuntime$2().mark((function e(){return _regeneratorRuntime$2().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isPlayByToken){e.next=3;break}return e.next=3,this.getConfig();case 3:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"getConfig",value:(i=_asyncToGenerator$2(_regeneratorRuntime$2().mark((function e(){var t,r,i,n,o,a,s,l,c,u,h,d,p,f,g,y,v,m,_,b,T=this;return _regeneratorRuntime$2().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!isTokenExpired(this.tokenInfo)){e.next=8;break}return console.error("playAuthToken is expired, please check or update your playAuthToken"),this.sdk.emit(SDKEvents.TOKEN_EXPIRED,{type:"playAuthToken",token:this.tokenInfo}),n={errorType:"token",errorCode:9101,errorMessage:"playAuthToken has expired",ext:{token:this.tokenInfo,config:this.config},originError:void 0},null===(i=this.sdk)||void 0===i||i.delayError.push(n),e.abrupt("return");case 8:if(!this.keyTokenInfo){e.next=16;break}if(!isTokenExpired(this.keyTokenInfo)){e.next=16;break}return console.error("keyToken is expired, please check or update your keyToken"),this.sdk.emit(SDKEvents.TOKEN_EXPIRED,{type:"keyToken",token:this.keyTokenInfo}),a={errorType:"token",errorCode:9102,errorMessage:"keyToken for hls encrypt play has expired",ext:{token:this.keyTokenInfo,config:this.config},originError:void 0},null===(o=this.sdk)||void 0===o||o.delayError.push(a),e.abrupt("return");case 16:return s=getFormat(this.config),this.playerData.codec=(null===(t=this.tokenInfo)||void 0===t||null===(r=t.Codec)||void 0===r?void 0:r.toLowerCase())||CodecType.H264,e.next=20,this.getVideos();case 20:if(e.t0=e.sent,e.t0){e.next=23;break}e.t0={};case 23:return l=e.t0,c=l.playList,u=void 0===c?[]:c,h=l.poster,d=l.vid,p=l.dashOpts,f=l.thumbs,g=l.barrageMaskUrl,null==u||u.forEach((function(e){e.getLicenseUrl=T.playerData.apiMap.licenseUrl})),e.next=34,this.getPrivateDrmInfo(u,d,s);case 34:this.playerData.options.vid=d,this.config.needPoster&&h&&(this.playerData.options.poster=h),this.config.needThumbs&&f.length>0&&this.getThumbnailConfig(f),this.config.needBarrageMask&&g&&this.getBarrageMaskUrl(g),u.length>0?(this.isEncrypt=!!u[0].kid,"hls"===s&&this.isEncrypt&&this.getEncryptHlsConfig({vid:d,playList:u}),("dash"===s||this.playerData.configs.DASHPlugin)&&this.getDashPluginConfig({vid:d,dashOpts:p,playList:u}),y=this.playerData.configs,v=y.autoBitrateOpts,m=y.Mp4EncryptPlayer,_=y.enableMp4MSE,("mp4"===s&&this.isEncrypt||"mp4"===s&&null!=v&&v.isOpenAutoDefi||m||_)&&this.getMp4EncryptConfig({vid:d,playList:u}),"dash"===s||this.playerData.configs.DASHPlugin?(b=u.filter((function(e){return"video"===e.FileType}))).length&&(this.playerData.playList=b,this.playerData.initCurrent(b[0])):(this.playerData.playList=this.config.needDefinitionList?u:[u[0]],this.playerData.initCurrent(this.playerData.playList[0]))):console.error("got no video by playAuthToken"),e.next=44;break;case 41:e.prev=41,e.t1=e.catch(0),console.error(e.t1);case 44:case"end":return e.stop()}}),e,this,[[0,41]])}))),function(){return i.apply(this,arguments)})},{key:"getVideos",value:(r=_asyncToGenerator$2(_regeneratorRuntime$2().mark((function e(){var t,r,i=this;return _regeneratorRuntime$2().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=function(e){var t,r;try{100006===get$2(JSON.parse(e.response),"ResponseMetadata.Error.CodeN")&&(console.error("playAuthToken is expired, please check or update your playAuthToken"),i.sdk.emit(SDKEvents.TOKEN_EXPIRED,e))}catch(o){console.log(o)}null===(t=i._emitter)||void 0===t||t.emit(PluginEvents.GET_PLAY_URL_ERR,e);var n={errorType:"token",errorCode:9100,errorMessage:"get play url error by playAuthToken, please check playAuthToken",ext:{},originError:e};null===(r=i.sdk)||void 0===r||r.delayError.push(n)},r=function(){var e=_asyncToGenerator$2(_regeneratorRuntime$2().mark((function e(r){return _regeneratorRuntime$2().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(502!==(null==r?void 0:r.status)||!i.playerData.apiMap.backupPlayDomain){e.next=7;break}return i.playerData.apiMap.playDomain=i.playerData.apiMap.backupPlayDomain,e.next=4,retryByError((function(){return getPlayInfoByAuthToken(_objectSpread2$5(_objectSpread2$5({},i.playerData.apiMap),i.config))}),i.retryCount,(function(e){return 502===e.status}),t);case 4:return e.abrupt("return",e.sent);case 7:t(r);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.next=4,retryByError((function(){return getPlayInfoByAuthToken(_objectSpread2$5(_objectSpread2$5({},i.playerData.apiMap),i.config))}),this.retryCount,(function(e){return 502===e.status}),r);case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"getPrivateDrmInfo",value:(t=_asyncToGenerator$2(_regeneratorRuntime$2().mark((function e(t,r,i){var n,o,a,s,l,c,u=this;return _regeneratorRuntime$2().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.config.getDrmAuthToken||"function"!=typeof this.config.getDrmAuthToken||!this.playerData.unionId){e.next=34;break}if(this.sessionId=(new Date).getTime().toString(),"hls"!==i){e.next=9;break}return e.next=5,sdkUmdLoader.loadPlugins("hlsEncrypt");case 5:o=e.sent,n=o.updateUnionInfo(this.playerData.unionId,this.sessionId),e.next=21;break;case 9:if("dash"!==i){e.next=16;break}return e.next=12,sdkUmdLoader.loadPlugins("dash");case 12:a=e.sent,n=a.updateUnionInfo(this.playerData.unionId,this.sessionId),e.next=21;break;case 16:if("mp4"!==i){e.next=21;break}return e.next=19,sdkUmdLoader.loadPlugins("mp4Encrypt");case 19:s=e.sent,n=s.updateUnionInfo(this.playerData.unionId,this.sessionId);case 21:if(n){e.next=23;break}return e.abrupt("return");case 23:return l=_toConsumableArray$1(new Set(t.map((function(e){return e.kid})))).join(","),e.prev=24,e.next=27,exeFunTimeoutWarn(retPromise$1(this.config.getDrmAuthToken(l,r,n)),200,"The execution time of obtaining privateDrmAuthToken by getDrmAuthToken function of options has exceeded more than 200ms");case 27:(c=e.sent)&&"string"==typeof c&&(this.privateDrmAuthToken=c,t.forEach((function(e){e.drmKeyToken=u.privateDrmAuthToken}))),e.next=34;break;case 31:e.prev=31,e.t0=e.catch(24),console.error("get privaterDrmToken fail");case 34:case"end":return e.stop()}}),e,this,[[24,31]])}))),function(e,r,i){return t.apply(this,arguments)})},{key:"getEncryptHlsConfig",value:function(e){var t,r=e||{},i=r.playList,n=r.vid,o=this.config,a=o.playDomain,s=o.keyToken,l=o.getKeyType,c=o.keyDomain,u=_objectSpread2$5({},this.playerData.configs.EncryptHlsPlugin||{}),h=null==i||null===(t=i[0])||void 0===t?void 0:t.kid;if(s)this.playerData.options.EncryptHlsPlugin=_objectSpread2$5({keyToken:s,playDomain:a||this.playerData.apiMap.playDomain,getKeyType:l||"TOP",keyDomain:c||this.playerData.apiMap.keyDomain},u);else if(this.privateDrmAuthToken&&this.sessionId){var d=getQueryParams(this.privateDrmAuthToken),p=parseInt(d["X-Expires"]),f=isNaN(p)?30:p;this.playerData.options.EncryptHlsPlugin=_objectSpread2$5({vid:n,kid:h,useUnionInfoDRM:!0,keyTokenExpiredDuration:f,drmKeyToken:this.privateDrmAuthToken,sessionId:this.sessionId,playDomain:a||this.playerData.apiMap.playDomain},u)}else this.config.disDrmDegraded||(this.playerData.options.EncryptHlsPlugin=_objectSpread2$5({vid:n,kid:h,getLicenseUrl:this.playerData.apiMap.licenseUrl},u))}},{key:"getThumbnailConfig",value:function(e){var t=e[0],r=_objectSpread2$5({},this.playerData.configs.thumbnail||{});this.playerData.options.thumbnail=_objectSpread2$5({pic_num:t.CaptureNum,urls:t.StoreUrls,width:t.CellWidth,height:t.CellHeight,col:t.ImgXLen,row:t.ImgYLen},r)}},{key:"getBarrageMaskUrl",value:function(e){var t,r,i=_objectSpread2$5({},(null===(t=this.playerData.configs)||void 0===t||null===(r=t.DanmuPlugin)||void 0===r?void 0:r.maskConfig)||{});this.playerData.configs.DanmuPlugin?(this.playerData.options.DanmuPlugin.active=!0,this.playerData.options.DanmuPlugin.maskActive=!0,this.playerData.options.DanmuPlugin.maskConfig=_objectSpread2$5({maskUrl:e},i)):this.playerData.options.DanmuPlugin={active:!0,maskActive:!0,maskConfig:_objectSpread2$5({maskUrl:e},i)}}},{key:"getDashPluginConfig",value:function(e){var t,r,i=e||{},n=i.vid,o=i.playList,a=i.dashOpts,s=this.config.playDomain,l=_objectSpread2$5({},(null===(t=this.playerData.configs)||void 0===t?void 0:t.DASHPlugin)||{}),c=null==o||null===(r=o[0])||void 0===r?void 0:r.kid;if(this.privateDrmAuthToken&&this.sessionId){var u=getQueryParams(this.privateDrmAuthToken),h=parseInt(u["X-Expires"]),d=isNaN(h)?30:h;this.playerData.options.DASHPlugin=_objectSpread2$5({playInfoType:"TOP",vid:n,dashOpts:a,defaultFormat:"dash",definitionText:this.config.definitionMap,kid:c,useUnionInfoDRM:!0,keyTokenExpiredDuration:d,sessionId:this.sessionId,drmKeyToken:this.privateDrmAuthToken,playDomain:s||this.playerData.apiMap.playDomain},l)}else this.config.disDrmDegraded||(this.playerData.options.DASHPlugin=_objectSpread2$5({getLicenseUrl:this.playerData.apiMap.licenseUrl,playInfoType:"TOP",vid:n,dashOpts:a,defaultFormat:"dash",definitionText:this.config.definitionMap},l))}},{key:"getMp4EncryptConfig",value:function(e){var t,r,i=e.playList,n=e.vid,o=this.config.playDomain,a=null==i||null===(t=i[0])||void 0===t?void 0:t.kid,s=_objectSpread2$5({},(null===(r=this.playerData.configs)||void 0===r?void 0:r.Mp4EncryptPlayer)||{});if(this.isEncrypt)if(this.privateDrmAuthToken&&this.sessionId){var l=getQueryParams(this.privateDrmAuthToken),c=parseInt(l["X-Expires"]),u=isNaN(c)?30:c;this.playerData.options.Mp4EncryptPlayer=_objectSpread2$5({vid:n,useEME:!1,isEncrypt:!0,bitrate:null==i?void 0:i[0].Bitrate,kid:a,drmKeyToken:this.privateDrmAuthToken,useUnionInfoDRM:!0,keyTokenExpiredDuration:u,sessionId:this.sessionId,playDomain:o||this.playerData.apiMap.playDomain},s)}else this.config.disDrmDegraded||(this.playerData.options.Mp4EncryptPlayer=_objectSpread2$5({vid:n,isEncrypt:!0,bitrate:null==i?void 0:i[0].Bitrate,kid:a,getLicenseUrl:this.playerData.apiMap.licenseUrl},s));else this.playerData.options.Mp4EncryptPlayer=_objectSpread2$5({vid:n,bitrate:null==i?void 0:i[0].Bitrate},s)}},{key:"init",value:function(){var e=this.playerData.configs.getVideoByToken,t=void 0===e?{}:e;this.initConfig(t)}},{key:"initConfig",value:function(e){if(this.isPlayByToken=!!e.playAuthToken,this.isPlayByToken){if(this.config=Object.assign(defaultConfig,e),this.tokenInfo=parseToken(e.playAuthToken),e.keyToken){var t=isBase64(e.keyToken)?window.atob(e.keyToken):e.keyToken;this.keyTokenInfo=getQueryParams(t)}e.retryCount&&(this.retryCount=e.retryCount)}}},{key:"switchAuthToken",value:function(e){return this.initConfig(e),this.getConfig()}}],[{key:"pluginName",get:function(){return"AuthToken"}}]),a}(SdkPlugin),sdkPluginManager={init:function(e){var t;e&&(null!==(t=e.playerData)&&void 0!==t&&t.isLive?e.sdkPlugins=[]:e.sdkPlugins=[AuthToken],e._sdkPlugins={})},registerPlugin:function(e,t){if(e&&t){var r=null,i=null;e.plugin&&"function"==typeof e.plugin?(r=e.plugin,i=e.options):(r=e,i={}),i.sdk=t;var n=i.pluginName||r.pluginName;if(!n)throw new Error("The property pluginName is necessary");var o=t._sdkPlugins;try{o[n.toLowerCase()]&&this.unRegister(n);var a=new r(i);return o[n.toLowerCase()]=a,o[n.toLowerCase()].func=r,a&&"function"==typeof a.afterCreate&&a.afterCreate(),a}catch(s){console.error(s)}}},unRegister:function(e,t){if(e&&t){e=e.toLowerCase();try{var r=t._sdkPlugins[e];r&&(r.pluginName&&r.__destroy(),delete t._sdkPlugins[e])}catch(i){console.error(i)}}},beforePlayerCreate:function(e){if(e){e._sdkPlugins||this.init(e);for(var t=e._sdkPlugins,r=[],i=0,n=Object.keys(t);i<n.length;i++){var o=n[i];if(t[o]&&t[o].beforePlayerCreate)try{var a=t[o].beforePlayerCreate();r.push(retPromise$1(a))}catch(e2){throw r.push(retPromise$1(null)),e2}}return new Promise((function(e){Promise.all([].concat(r)).then((function(){e(null)})).catch((function(t){console.error(t),e(null)}))}))}},afterPlayerCreate:function(e){if(e)for(var t=e._sdkPlugins,r=0,i=Object.keys(t);r<i.length;r++){var n=i[r];if(t[n]&&t[n].beforePlayerCreate)try{t[n].afterPlayerCreate()}catch(e2){throw e2}}},destroy:function(e){if(e){for(var t=e._sdkPlugins,r=0,i=Object.keys(t);r<i.length;r++){var n=i[r];this.unRegister(n,e)}delete e._sdkPlugins}}};const name="@volcengine/veplayer",version="1.5.16",main="dist/index.min.js",module$1="dist/index.min.js",typings="dist/index.d.ts",sideEffects=["*.css","*.less"],files=["dist"],unpkg=!0,unpkgFiles=["*"],scripts={"test:e2e":"echo 'test'",lint:"npx lint-staged",dev:"libd dev demo","dev:vod":"libd dev demo/vod","dev:hth":"libd dev fixtures/hth",build:"libd build",release:"libd release",doc:"docg",changelog:"libd changelog -s"},author="",license="BSD-3-Clause",devDependencies={"@babel/runtime-corejs3":"^7.20.13","@byted/docg":"^0.5.1","@byted/docg-plugin-sdkhub":"^0.1.5","@byted/libd":"1.1.21","@commitlint/cli":"^16.2.1","@commitlint/config-conventional":"^16.2.1","@types/lodash":"^4.14.178","@typescript-eslint/eslint-plugin":"^5.12.0","@typescript-eslint/parser":"^5.12.0","cross-env":"^7.0.3",eslint:"^8.9.0","eslint-config-prettier":"^6.7.0","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.0","git-cz":"^4.7.6",husky:"^8.0.1",less:"^4.1.2","lint-staged":"^11.1.2","node-fetch":"^2.6.7","postcss-less":"^6.0.0",prettier:"^2.2.1","rollup-plugin-visualizer":"^5.9.0",shelljs:"^0.8.5",stylelint:"^14.5.2","stylelint-config-standard":"^24.0.0","stylelint-prettier":"^2.0.0",typescript:"^4.5.5"},dependencies={"@byted/xgplayer-live-logger":"1.1.0-alpha.3","@datarangers/sdk-javascript":"0.0.3-lite","@byted/xgplayer-app-logger":"^0.11.28","@byted/xgplayer-rts":"0.1.13","@byted/xgplayer-vod-menu":"3.0.3",dayjs:"^1.11.6","dom-helpers":"^5.2.1",eventemitter3:"^4.0.7","globalthis-polyfill":"^1.0.0","js-cookie":"^3.0.1","lodash-es":"^4.17.21","proxy-polyfill":"^0.3.2",xgplayer:"3.0.7-alpha.3","xgplayer-service":"^0.4.2"},publishConfig={tag:"latest",registry:"https://registry.npmjs.org"},browserslist=["iOS >= 10","android >= 5","Chrome > 40","ChromeAndroid >= 39","IE 11"];var pkgJson={name:name,version:version,main:main,module:module$1,typings:typings,sideEffects:sideEffects,files:files,unpkg:unpkg,unpkgFiles:unpkgFiles,scripts:scripts,author:author,license:license,devDependencies:devDependencies,dependencies:dependencies,"lint-staged":{"*.{less}":'stylelint --fix "src/**/*.less" --custom-syntax postcss-less',"*.{js,jsx,ts,tsx}":["eslint --fix"]},publishConfig:publishConfig,browserslist:browserslist},defaultExtendLang=[{LANG:"en",TEXT:{MEDIA_ERR_SRC_NOT_SUPPORTED:"Audio/video is not supported or no playable source found",GET_URL_ERR_BY_TOKEN:"Failed to get video url",PLAY_AUTH_TOKEN_EXPIRED:"Token has expired",HLS_KEY_TOKEN_EXPIRED:"Play certificate has expired",MEDIA_SOURCE_CANNOT_PLAY_TYPE:"Video type cannot play",NETWORK_ERROR:"Network error",NETWORK_TIMEOUT:"Network timeout"}},{LANG:"zh",TEXT:{MEDIA_ERR_SRC_NOT_SUPPORTED:"音/视频格式不支持,或未找到可用资源",GET_URL_ERR_BY_TOKEN:"获取视频地址失败",PLAY_AUTH_TOKEN_EXPIRED:"token已过期",HLS_KEY_TOKEN_EXPIRED:"播放凭证已过期",MEDIA_SOURCE_CANNOT_PLAY_TYPE:"不支持的视频格式",NETWORK_ERROR:"网络错误",NETWORK_TIMEOUT:"网络超时"}},{LANG:"zh-hk",TEXT:{MEDIA_ERR_SRC_NOT_SUPPORTED:"音/視頻格式不支持,或未找到可用資源",GET_URL_ERR_BY_TOKEN:"獲取視頻地址失敗",PLAY_AUTH_TOKEN_EXPIRED:"Token已過期",HLS_KEY_TOKEN_EXPIRED:"播放憑證已過期",MEDIA_SOURCE_CANNOT_PLAY_TYPE:"不支持的視頻格式",NETWORK_ERROR:"網絡錯誤",NETWORK_TIMEOUT:"網絡超時"}},{LANG:"jp",TEXT:{MEDIA_ERR_SRC_NOT_SUPPORTED:"オーディオ/ビデオ形式がサポートされていないか、利用可能なリソースが見つかりませんでした",GET_URL_ERR_BY_TOKEN:"動画の URL を取得できませんでした",PLAY_AUTH_TOKEN_EXPIRED:"playAuthTokenは期限切れです",HLS_KEY_TOKEN_EXPIRED:"プレイ証明書の有効期限が切れています",MEDIA_SOURCE_CANNOT_PLAY_TYPE:"サポートされていないビデオ形式",NETWORK_ERROR:"ネットワークエラー",NETWORK_TIMEOUT:"ネットワークタイムアウト"}}],Xhr=function(){function e(t,r){_classCallCheck$5(this,e),this.url=t;var i=new window.XMLHttpRequest;i.target=this,i.responseType="arraybuffer",i.open("get",t),i.onload=function(){200!==i.status&&206!==i.status||r&&r instanceof Function&&r(i.response)},i.onerror=function(e){},this.xhr=i,this.run()}return _createClass$6(e,[{key:"cancel",value:function(){this.xhr.abort()}},{key:"run",value:function(){1===this.xhr.readyState&&this.xhr.send()}}]),e}(),PLAY_MODES={ORDER:"order",SLOOP:"sloop",LOOP:"loop",RANDOM:"random"},CLASS_NAME="xgplayer-music";function _randomIndex(e,t,r){var i=Math.floor(Math.random()*(t-e)+e);return i===r?(i>t/2?t/=2:e=t/2,t-e>2?_randomIndex(e,t,r):i):i}var Music=function(e){_inherits$5(r,e);var t=_createSuper$5(r);function r(){var e;return _classCallCheck$5(this,r),(e=t.apply(this,arguments))._onEnded=function(){if("order"===e.mode&&e.index+1>=e.list.length)return e.player.pause(),void(e.player.currentTime=0);switch(e.mode){case PLAY_MODES.SLOOP:e.change();break;case PLAY_MODES.ORDER:case PLAY_MODES.LOOP:default:e.next()}},e._onDurationChange=function(){var t=e.config.abCycle;e._initABCycle(t,e.player)},e._onTimeUpdate=function(){var t=_assertThisInitialized$5(e),r=t.config,i=t.player;if(!e.halfPass&&i.currentTime>i.duration/2&&e.confirmOrder(),r.abCycle){var n=r.abCycle,o=n.end>i.duration?i.duration:n.end;i.currentTime>=o?(n.loop||(i.pause(),e.emit("abCycle_ended")),i.currentTime=n.start||0):i.currentTime<n.start&&(i.currentTime=n.start||0)}},e}return _createClass$6(r,[{key:"afterCreate",value:function(){var e,t,r,i,n,o,a,s,l,c,u=this.player,h=this.playerConfig;(util.addClass(u.root,CLASS_NAME),this.halfPass=!1,this.list=this.config.list||[],this.emit(PluginEvents.MUSIC_LIST_CHANGE,this.list),this.nextIndex=-1,this.prevIndex=-1,this.history=[],this.disable=!(this.list.length>0),!h.url&&this.list.length>0)&&(h.url=null===(e=this.list)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.src);h.poster||(h.poster=null===(r=this.list)||void 0===r||null===(i=r[0])||void 0===i?void 0:i.poster);h.title||(h.title=null!==(n=null===(o=this.list)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.title)&&void 0!==n?n:"");h.vid||(h.vid=null!==(s=null===(l=this.list)||void 0===l||null===(c=l[0])||void 0===c?void 0:c.vid)&&void 0!==s?s:"");this._curInfo={src:h.url,poster:h.poster,title:h.title,vid:h.vid},this.index=0,this.on(TIME_UPDATE,this._onTimeUpdate),this.on(ENDED,this._onEnded),this.on(DURATION_CHANGE,this._onDurationChange),this.config.offline&&this.checkOffline(this._curInfo.src,this._curInfo.vid).then((function(e){0===e.code&&(h.url=e.url,u.state>=4&&(u.src=e.url))})).catch((function(e){console.error(e)}))}},{key:"destroy",value:function(){util.removeClass(this.player.root,CLASS_NAME)}},{key:"_nextCompute",value:function(){if(!this.disable)switch(this.mode){case PLAY_MODES.SLOOP:this.nextIndex=this.index;break;case PLAY_MODES.ORDER:case PLAY_MODES.LOOP:this.index+1<this.list.length?this.nextIndex=this.index+1:this.nextIndex=0;break;default:this.nextIndex=_randomIndex(0,this.list.length,this.index)}}},{key:"_prevCompute",value:function(){if(!this.disable)switch(this.mode){case PLAY_MODES.SLOOP:this.nextIndex=this.index;break;case PLAY_MODES.ORDER:case PLAY_MODES.LOOP:this.index-1>=0?this.prevIndex=this.index-1:this.prevIndex=this.list.length-1;break;default:this.prevIndex=_randomIndex(0,this.list.length,this.index)}}},{key:"_emitChange",value:function(){this.emit(PluginEvents.MUSIC_CHANGE,this._curInfo)}},{key:"_initABCycle",value:function(e,t){var r=t.plugins.progresspreview;if(e&&t){var i=e.end>this.player.duration?this.player.duration:e.end,n=e.start>this.player.duration?0:e.start,o={id:t.playerId,time:e.start,duration:i-n,text:e.text,color:e.color};r.findDot(o.id)?r.updateDot(o):r.createDot(o)}else r.findDot(t.playerId)&&r.deleteDot(t.playerId)}},{key:"random",value:function(){if(this.list.length<0)return null;var e=_randomIndex(0,this.list.length,this.index);return this.list[e]}},{key:"next",value:function(){this.disable||(this.halfPass||(this.halfPass=!0,this._nextCompute()),this.index=this.nextIndex,this.change())}},{key:"prev",value:function(){this.disable||(this.halfPass||(this.halfPass=!0,this._prevCompute()),this.index=this.prevIndex,this.change())}},{key:"forward",value:function(){var e=this.player,t=this.config.timeScale;e.currentTime=e.currentTime+t<e.duration?e.currentTime+t:e.duration-.1}},{key:"backward",value:function(){var e=this.player,t=this.config.timeScale;e.currentTime=e.currentTime-t>0?e.currentTime-t:0}},{key:"add",value:function(e){this.list.push({src:e.src,title:e.title,vid:e.vid,poster:e.poster}),this.disable=!(this.list.length>0),this.emit(PluginEvents.MUSIC_LIST_CHANGE,this.list)}},{key:"remove",value:function(e){var t=-1;this.list.every((function(r,i){return r.vid!==e||(t=i,!1)})),t>-1&&(this.list.splice(t,1),this.emit(PluginEvents.MUSIC_LIST_CHANGE,this.list)),this.disable=!(this.list.length>0)}},{key:"setAbCycle",value:function(e,t,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};e&&"Object"===util.typeOf(e)?this.config.abCycle=_objectSpread2$5({},e):this.config.abCycle=_objectSpread2$5({start:e||0,end:t||this.player.duration,loop:r},i),this._initABCycle(this.config.abCycle,this.player)}},{key:"removeAbCycle",value:function(){this.config.abCycle=null,this._initABCycle(null,this.player)}},{key:"updateList",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.removeAbCycle(),this.player.pause(),this.player.currentTime=0,this.list=e,this.nextIndex=0,this.index=0,this.change(),this.disable=!(this.list.length>0),this.emit(PluginEvents.MUSIC_LIST_CHANGE,this.list)}},{key:"setIndex",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;e<0||e>=this.list.length||(this.nextIndex=e,this.index=e,this.change())}},{key:"change",value:function(){var e=this;if(!this.disable){var t=this.player,r=this.list,i=this.index,n=r[i].vid;this.halfPass=!1,this.checkOffline(r[i].src,n).then((function(r){e._curInfo={title:e.list[e.index].title||"",vid:e.list[e.index].vid,poster:e.list[e.index].poster||"",src:r.url},t.playNext({url:r.url,vid:e.list[e.index].vid||0,poster:e.list[e.index].poster||"",autoplay:!0}),t.off("timeupdate",e._emitChange.bind(e)),t.once("timeupdate",e._emitChange.bind(e)),t.play()}))}}},{key:"checkOffline",value:function(e,t){var r=this;return new Promise((function(i,n){if(!r.config.offline||r.disable)return i({url:e,code:-1,vid:t});var o=r.player.database;o.openDB((function(){o.getDataByKey(o.myDB.ojstore.name,t,(function(r){setTimeout((function(){o.closeDB()}),5e3),i(r?{url:URL.createObjectURL(r.blob),code:0,vid:r.vid}:{url:e,code:-2,vid:t})}))}))}))}},{key:"confirmOrder",value:function(){this.halfPass=!0,this._nextCompute(),this._prevCompute(),this.config.preloadNext&&this.preload(this.nextIndex)}},{key:"preload",value:function(e){if(!(e<0||e>=this.list.length)){var t=this.list[e],r=this.player;this.checkOffline(t.src,t.vid).then((function(e){if(-2===e.code){var i=t.vid;new Xhr(t.src,(function(e){r.database.openDB((function(){r.database.addData(r.database.myDB.ojstore.name,[{vid:i,blob:new Blob([e],{type:'audio/mp4; codecs="mp4a.40.5"'})}]),setTimeout((function(){r.database.closeDB()}),5e3)}))}))}}))}}},{key:"timeScale",get:function(){return this.config.timeScale||15},set:function(e){this.config.timeScale=e,this.emit(PluginEvents.TIME_SCALE_CHANGE,e)}},{key:"mode",get:function(){return this.config.mode||PLAY_MODES.RANDOM},set:function(e){Object.values(PLAY_MODES).includes(e)&&(this.config.mode=e,this.emit(PluginEvents.MUSIC_MODE_CHANGE,e))}}],[{key:"pluginName",get:function(){return"music"}},{key:"defaultConfig",get:function(){return{offline:!1,preloadNext:!0,abCycle:null,timeScale:15,mode:PLAY_MODES.ORDER,list:[]}}},{key:"ModeType",get:function(){return Object.keys(PLAY_MODES).map((function(e){return PLAY_MODES[e]}))}}]),r}(BasePlugin),MusicCover=function(e){_inherits$5(r,e);var t=_createSuper$5(r);function r(){return _classCallCheck$5(this,r),t.apply(this,arguments)}return _createClass$6(r,[{key:"afterCreate",value:function(){var e=this;this.on(PluginEvents.MUSIC_CHANGE,(function(t){if(t&&t.poster){var r=e.find("img");r?r.src=t.poster:e.root.innerHTML="<img src=".concat(t.poster,' alt=""/>'),e.show()}else e.hide()}))}},{key:"render",value:function(){var e,t,r=this.playerConfig;return r.poster||null!=r&&null!==(e=r.url)&&void 0!==e&&e[0].poster?'<xg-icon class="xgplayer-cover">\n <img src="'.concat(r.poster||(null==r||null===(t=r.url)||void 0===t?void 0:t[0].poster),'" alt="">\n </xg-icon>'):'<xg-icon class="xgplayer-cover"></xg-icon>'}}],[{key:"pluginName",get:function(){return"musiccover"}},{key:"defaultConfig",get:function(){return{index:0,position:Plugin.POSITIONS.CONTROLS_LEFT}}}]),r}(Plugin);function backwardIcon(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M10.2478 0C6.32662 0 2.94593 2.3143 1.39715 5.65152L0.558008 5.42701C0.321533 5.36365 0.0784664 5.50398 0.0151043 5.74046C-0.00971985 5.8331 -0.00382614 5.9313 0.0319023 6.02031L1.13271 8.76283C1.22391 8.99003 1.48202 9.10028 1.70921 9.00908C1.74819 8.99344 1.78475 8.97233 1.81779 8.94639L4.14238 7.12171C4.33496 6.97055 4.36853 6.69189 4.21737 6.49932C4.15815 6.42387 4.07605 6.36967 3.98341 6.34485L3.14176 6.1196C4.46348 3.53919 7.14942 1.77312 10.2478 1.77312C14.6545 1.77312 18.2269 5.34545 18.2269 9.75215C18.2269 14.1589 14.6545 17.7312 10.2478 17.7312C6.45067 17.7312 3.273 15.0787 2.4666 11.5256L0.656528 11.5254C1.49041 16.0647 5.46745 19.5043 10.2478 19.5043C15.6338 19.5043 20 15.1381 20 9.75215C20 4.36619 15.6338 0 10.2478 0Z" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}var MusicBackward=function(e){_inherits$5(r,e);var t=_createSuper$5(r);function r(){var e;return _classCallCheck$5(this,r),(e=t.apply(this,arguments)).onClick=function(t){var r=_assertThisInitialized$5(e).player;t.preventDefault(),t.stopPropagation(),r.plugins.music.backward()},e}return _createClass$6(r,[{key:"afterCreate",value:function(){var e=this;this.initIcons();["click","touchstart"].forEach((function(t){e.bind(t,e.onClick)})),this.timeScaleDom=this.find(".xgplayer-timescale"),this.on(PluginEvents.TIME_SCALE_CHANGE,(function(t){e.timeScaleDom.innerHTML=t}))}},{key:"registerIcons",value:function(){return{musicBackward:{icon:backwardIcon,class:"xg-icon-mbackward"}}}},{key:"registerLanguageTexts",value:function(){return{backward:{jp:"あとずさりする",en:"MusicBackward",zh:"后退","zh-hk":"後退"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.musicBackward)}},{key:"destroy",value:function(){var e=this;["click","touchstart"].forEach((function(t){e.unbind(t,e.onClick)}))}},{key:"render",value:function(){var e=this.player.plugins.music.config.timeScale||15;return'<xg-icon class="xgplayer-backward">\n <div class="xgplayer-icon">\n <span class="xgplayer-timescale">'.concat(e,'</span>\n </div>\n <div class="xg-tips" lang-key="backward">').concat(this.langText.backward,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"musicbackword"}},{key:"defaultConfig",get:function(){return{index:1,position:Plugin.POSITIONS.CONTROLS_LEFT}}}]),r}(Plugin),MusicPrev=function(e){_inherits$5(r,e);var t=_createSuper$5(r);function r(){var e;return _classCallCheck$5(this,r),(e=t.apply(this,arguments)).onClick=function(t){var r=_assertThisInitialized$5(e).player;t.preventDefault(),t.stopPropagation(),r.plugins.music.prev()},e}return _createClass$6(r,[{key:"afterCreate",value:function(){var e=this;this.initIcons();["click","touchstart"].forEach((function(t){e.bind(t,e.onClick)})),this.updateVisible(),this.on(PluginEvents.MUSIC_LIST_CHANGE,this.updateVisible.bind(this))}},{key:"updateVisible",value:function(){var e,t,r;(null===(e=this.player.plugins)||void 0===e||null===(t=e.music)||void 0===t||null===(r=t.list)||void 0===r?void 0:r.length)>1?this.show():this.hide()}},{key:"registerIcons",value:function(){return{musicPrev:{icon:' <svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <g clip-path="url(#clip0_20323_25783)">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M21.2 1.20196V22.798C21.2 23.7867 20.0711 24.3511 19.28 23.7579L4.88002 12.9598C4.24002 12.4799 4.24002 11.5201 4.88002 11.0402L19.28 0.242135C20.0711 -0.35107 21.2 0.213286 21.2 1.20196Z" fill="white"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M3.8 0.00219727C4.13137 0.00219727 4.4 0.270826 4.4 0.602197V23.3978C4.4 23.7292 4.13137 23.9978 3.8 23.9978H2.6C2.26863 23.9978 2 23.7292 2 23.3978V0.602197C2 0.270826 2.26863 0.00219727 2.6 0.00219727H3.8Z" fill="white"/>\n </g>\n <defs>\n <clipPath id="clip0_20323_25783">\n <rect width="24" height="24" fill="white"/>\n </clipPath>\n </defs>\n </svg>\n ',class:"xg-icon-mprev"}}}},{key:"registerLanguageTexts",value:function(){return{musicPrev:{jp:"前の曲",en:"MusicPrev",zh:"上一首","zh-hk":"上一首"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.musicPrev)}},{key:"destroy",value:function(){var e=this;["click","touchstart"].forEach((function(t){e.unbind(t,e.onClick)}))}},{key:"render",value:function(){return'<xg-icon class="xgplayer-next">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="musicPrev">'.concat(this.langText.musicPrev,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"musicprev"}},{key:"defaultConfig",get:function(){return{index:2,position:Plugin.POSITIONS.CONTROLS_LEFT}}}]),r}(Plugin);function forwardIcon(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M9.75215 0C13.6734 0 17.0541 2.3143 18.6029 5.65152L19.442 5.42701C19.6785 5.36365 19.9215 5.50398 19.9849 5.74046C20.0097 5.8331 20.0038 5.9313 19.9681 6.02031L18.8673 8.76283C18.7761 8.99003 18.518 9.10028 18.2908 9.00908C18.2518 8.99344 18.2152 8.97233 18.1822 8.94639L15.8576 7.12171C15.665 6.97055 15.6315 6.69189 15.7826 6.49932C15.8419 6.42387 15.9239 6.36967 16.0166 6.34485L16.8582 6.1196C15.5365 3.53919 12.8506 1.77312 9.75215 1.77312C5.34545 1.77312 1.77312 5.34545 1.77312 9.75215C1.77312 14.1589 5.34545 17.7312 9.75215 17.7312C13.5493 17.7312 16.727 15.0787 17.5334 11.5256L19.3435 11.5254C18.5096 16.0647 14.5325 19.5043 9.75215 19.5043C4.36619 19.5043 0 15.1381 0 9.75215C0 4.36619 4.36619 0 9.75215 0Z" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}var MusicForward=function(e){_inherits$5(r,e);var t=_createSuper$5(r);function r(){var e;return _classCallCheck$5(this,r),(e=t.apply(this,arguments)).onClick=function(t){var r=_assertThisInitialized$5(e).player;t.preventDefault(),t.stopPropagation(),r.plugins.music.forward()},e}return _createClass$6(r,[{key:"afterCreate",value:function(){var e=this;this.initIcons();["click","touchstart"].forEach((function(t){e.bind(t,e.onClick)})),this.timeScaleDom=this.find(".xgplayer-timescale"),this.on(PluginEvents.TIME_SCALE_CHANGE,(function(t){e.timeScaleDom.innerHTML=t}))}},{key:"registerIcons",value:function(){return{musicForward:{icon:forwardIcon,class:"xg-icon-mforward"}}}},{key:"registerLanguageTexts",value:function(){return{forward:{jp:"早送り",en:"MusicForward",zh:"快进","zh-hk":"快進"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.musicForward)}},{key:"destroy",value:function(){var e=this;["click","touchstart"].forEach((function(t){e.unbind(t,e.onClick)}))}},{key:"render",value:function(){var e=this.player.plugins.music.config.timeScale||15;return'<xg-icon class="xgplayer-forward">\n <div class="xgplayer-icon">\n <span class="xgplayer-timescale">'.concat(e,'</span>\n </div>\n <div class="xg-tips" lang-key="forward">').concat(this.langText.forward,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"musicforward"}},{key:"defaultConfig",get:function(){return{index:5,position:Plugin.POSITIONS.CONTROLS_LEFT}}}]),r}(Plugin),MusicNext=function(e){_inherits$5(r,e);var t=_createSuper$5(r);function r(){var e;return _classCallCheck$5(this,r),(e=t.apply(this,arguments)).onClick=function(t){var r=_assertThisInitialized$5(e).player;t.preventDefault(),t.stopPropagation(),r.plugins.music.next()},e}return _createClass$6(r,[{key:"afterCreate",value:function(){var e=this;this.initIcons();["click","touchstart"].forEach((function(t){e.bind(t,e.onClick)})),this.updateVisible(),this.on(PluginEvents.MUSIC_LIST_CHANGE,this.updateVisible.bind(this))}},{key:"updateVisible",value:function(){var e,t,r;(null===(e=this.player.plugins)||void 0===e||null===(t=e.music)||void 0===t||null===(r=t.list)||void 0===r?void 0:r.length)>1?this.show():this.hide()}},{key:"registerIcons",value:function(){return{musicNext:{icon:' <svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <g clip-path="url(#clip0_20323_25776)">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M3.92 0.242135L18.32 11.0402C18.96 11.5201 18.96 12.4799 18.32 12.9598L3.92 23.7579C3.12892 24.3511 2 23.7867 2 22.798V1.20196C2 0.213286 3.12892 -0.35107 3.92 0.242135Z" fill="white"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M20.6 0.00219727C20.9314 0.00219727 21.2 0.270826 21.2 0.602197V23.3978C21.2 23.7292 20.9314 23.9978 20.6 23.9978H19.4C19.0687 23.9978 18.8 23.7292 18.8 23.3978V0.602197C18.8 0.270826 19.0687 0.00219727 19.4 0.00219727H20.6Z" fill="white"/>\n </g>\n <defs>\n <clipPath id="clip0_20323_25776">\n <rect width="24" height="24" fill="white"/>\n </clipPath>\n </defs>\n </svg>\n ',class:"xg-icon-mnext"}}}},{key:"registerLanguageTexts",value:function(){return{musicNext:{jp:"次の曲",en:"MusicNext",zh:"下一首","zh-hk":"下一首"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.musicNext)}},{key:"destroy",value:function(){var e=this;["click","touchstart"].forEach((function(t){e.unbind(t,e.onClick)}))}},{key:"render",value:function(){return'<xg-icon class="xgplayer-next">\n <div class="xgplayer-icon"></div>\n <div class="xg-tips" lang-key="musicNext">'.concat(this.langText.musicNext,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"musicnext"}},{key:"defaultConfig",get:function(){return{index:4,position:Plugin.POSITIONS.CONTROLS_LEFT}}}]),r}(Plugin),MusicMeta=function(e){_inherits$5(r,e);var t=_createSuper$5(r);function r(){return _classCallCheck$5(this,r),t.apply(this,arguments)}return _createClass$6(r,[{key:"afterCreate",value:function(){var e=this;this.on(PluginEvents.MUSIC_CHANGE,(function(t){t&&t.title?e.root.innerHTML="".concat(t.title):e.root.innerHTML=""}))}},{key:"render",value:function(){var e=this.playerConfig;return'<xg-title class="xgplayer-name">\n '.concat(e.title||"","\n </xg-title>")}}],[{key:"pluginName",get:function(){return"musicmeta"}},{key:"defaultConfig",get:function(){return{index:0,position:Plugin.POSITIONS.CONTROLS_LEFT}}}]),r}(Plugin);function OrderSvg(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g clip-path="url(#clip0_20779_14791)">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M39 8C39.5523 8 40 8.44772 40 9V11C40 11.5523 39.5523 12 39 12H7C6.44772 12 6 11.5523 6 11V9C6 8.44772 6.44772 8 7 8H39ZM30 23C30 22.4477 29.5523 22 29 22H7C6.44772 22 6 22.4477 6 23V25C6 25.5523 6.44772 26 7 26H29C29.5523 26 30 25.5523 30 25V23ZM46.0725 31C46.0725 31.2113 46.0056 31.4173 45.8812 31.5882L39.845 39.888C39.5202 40.3346 38.8948 40.4334 38.4481 40.1086C38.3635 40.047 38.2891 39.9726 38.2275 39.888L32.1913 31.5882C31.8665 31.1415 31.9652 30.5161 32.4119 30.1913C32.5828 30.067 32.7887 30 33 30H37V19.5C37 19.2239 37.2239 19 37.5 19H40.5C40.7761 19 41 19.2239 41 19.5V30H45.0725C45.6248 30 46.0725 30.4477 46.0725 31ZM29 36C29.5523 36 30 36.4477 30 37V39C30 39.5523 29.5523 40 29 40H7C6.44772 40 6 39.5523 6 39V37C6 36.4477 6.44772 36 7 36H29Z" fill="white"/>\n</g>\n<defs>\n<clipPath id="clip0_20779_14791">\n<rect width="48" height="48" fill="white"/>\n</clipPath>\n</defs>\n</svg>\n',"image/svg+xml").firstChild}function LoopSvg(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g clip-path="url(#clip0_20731_14771)">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M42.0018 23V29.024C42.0018 34.569 37.5247 39.064 32.0018 39.064H17.9999V42.6585C17.9999 43.2108 17.5522 43.6585 16.9999 43.6585C16.7991 43.6585 16.603 43.598 16.437 43.485L8.20729 37.8803C7.75081 37.5694 7.63278 36.9473 7.94366 36.4908C8.01331 36.3886 8.10134 36.3001 8.20327 36.23L16.433 30.5662C16.888 30.2531 17.5106 30.3681 17.8237 30.8231C17.9385 30.9899 17.9999 31.1875 17.9999 31.39V35.048H32.0018C35.3155 35.048 38.0018 32.351 38.0018 29.024V23H42.0018ZM31.0019 5.89087C31.2027 5.89087 31.3988 5.95132 31.5648 6.06434L39.7945 11.6691C40.251 11.98 40.369 12.602 40.0582 13.0585C39.9885 13.1608 39.9005 13.2492 39.7986 13.3194L31.5688 18.9831C31.1139 19.2962 30.4912 19.1812 30.1781 18.7263C30.0633 18.5595 30.0019 18.3618 30.0019 18.1593V14.5013H16C12.6863 14.5013 10 17.1984 10 20.5254V26.5494H6V20.5254C6 14.9804 10.4772 10.4853 16 10.4853H30.0019V6.89087C30.0019 6.33858 30.4496 5.89087 31.0019 5.89087Z" fill="white"/>\n</g>\n<defs>\n<clipPath id="clip0_20731_14771">\n<rect width="48" height="48" fill="white"/>\n</clipPath>\n</defs>\n</svg>\n',"image/svg+xml").firstChild}function RandomSvg(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g clip-path="url(#clip0_20731_14777)">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M35.0194 27.9598C35.2314 27.9598 35.4379 28.0272 35.6091 28.1522L41.8863 32.736C42.3323 33.0617 42.4298 33.6873 42.1041 34.1333C42.0419 34.2186 41.9665 34.2934 41.8809 34.3551L35.6037 38.875C35.1556 39.1977 34.5306 39.096 34.2079 38.6478C34.0853 38.4776 34.0194 38.2732 34.0194 38.0635V35.5556C30.1354 35.5195 27.7656 34.3892 25.642 31.7548C26.4304 30.621 27.1705 29.3627 27.8834 27.9788C29.5719 30.6143 31.112 31.5275 34.0194 31.5546V28.9598C34.0194 28.4075 34.4671 27.9598 35.0194 27.9598ZM35.0112 7.94434C35.2205 7.94434 35.4246 8.01001 35.5946 8.13211L41.8792 12.6458C42.3278 12.968 42.4303 13.5928 42.1081 14.0414C42.0464 14.1273 41.9715 14.2028 41.8861 14.2652L35.6015 18.8607C35.1557 19.1867 34.53 19.0895 34.204 18.6437C34.0787 18.4724 34.0112 18.2657 34.0112 18.0535V15.4606C29.9521 15.4984 28.443 17.234 25.7897 23.0253C25.4916 23.6778 25.333 24.0244 25.1845 24.3452C21.6243 32.0396 17.983 35.4364 10.0186 35.5591H6V31.5394L9.98762 31.5397C16.0421 31.4462 18.5555 29.1016 21.5376 22.6568C21.6818 22.3451 21.8361 22.0079 22.1364 21.3507C25.3774 14.2767 27.8951 11.4978 34.0112 11.4409V8.94434C34.0112 8.39205 34.4589 7.94434 35.0112 7.94434ZM10.0186 11.4409C14.8213 11.5149 18.0519 12.7794 20.6407 15.459C19.9655 16.6111 19.3108 17.8933 18.6522 19.3098C16.5567 16.6161 14.0817 15.5236 9.98762 15.4604L6 15.4606V11.4409H10.0186Z" fill="white"/>\n</g>\n<defs>\n<clipPath id="clip0_20731_14777">\n<rect width="48" height="48" fill="white"/>\n</clipPath>\n</defs>\n</svg>\n',"image/svg+xml").firstChild}function SloopSvg(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g clip-path="url(#clip0_20731_14784)">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M42.0018 22.1091V28.1331C42.0018 33.6781 37.5247 38.1732 32.0018 38.1732H17.9999V41.7676C17.9999 42.3199 17.5522 42.7676 16.9999 42.7676C16.7991 42.7676 16.603 42.7072 16.437 42.5941L8.20729 36.9894C7.75081 36.6785 7.63278 36.0564 7.94366 35.6C8.01331 35.4977 8.10134 35.4092 8.20327 35.3391L16.433 29.6754C16.888 29.3623 17.5106 29.4773 17.8237 29.9322C17.9385 30.099 17.9999 30.2967 17.9999 30.4991V34.1572H32.0018C35.3155 34.1572 38.0018 31.4601 38.0018 28.1331V22.1091H42.0018ZM26.05 18V29.664H23.19V21.08L21 22.852V19.772L23.19 18H26.05ZM31.0019 5C31.2027 5 31.3988 5.06045 31.5648 5.17347L39.7945 10.7782C40.251 11.0891 40.369 11.7112 40.0582 12.1677C39.9885 12.2699 39.9005 12.3584 39.7986 12.4285L31.5688 18.0922C31.1139 18.4054 30.4912 18.2904 30.1781 17.8354C30.0633 17.6686 30.0019 17.4709 30.0019 17.2685V13.6105H16C12.6863 13.6105 10 16.3075 10 19.6345V25.6585H6V19.6345C6 14.0895 10.4772 9.59443 16 9.59443H30.0019V6C30.0019 5.44772 30.4496 5 31.0019 5Z" fill="white"/>\n</g>\n<defs>\n<clipPath id="clip0_20731_14784">\n<rect width="48" height="48" fill="white"/>\n</clipPath>\n</defs>\n</svg>\n',"image/svg+xml").firstChild}var MusicMode=function(e){_inherits$5(r,e);var t=_createSuper$5(r);function r(){return _classCallCheck$5(this,r),t.apply(this,arguments)}return _createClass$6(r,[{key:"afterCreate",value:function(){var e,t,i,n=this;if(_get$3(_getPrototypeOf$5(r.prototype),"afterCreate",this).call(this),this.player.plugins.music&&!this.config.disable){this.initIcons(),this.btnClick=this.btnClick.bind(this),this.bind(["touchend","click"],this.btnClick),this.on(PluginEvents.MUSIC_MODE_CHANGE,(function(e){n.animate(e)}));var o=null===(e=this.player.plugins)||void 0===e||null===(t=e.music)||void 0===t||null===(i=t.config)||void 0===i?void 0:i.mode;this.animate(o),this.updateVisible(),this.on(PluginEvents.MUSIC_LIST_CHANGE,this.updateVisible.bind(this))}}},{key:"updateVisible",value:function(){var e,t,r;(null===(e=this.player.plugins)||void 0===e||null===(t=e.music)||void 0===t||null===(r=t.list)||void 0===r?void 0:r.length)>1?this.show():this.hide()}},{key:"registerIcons",value:function(){return{order:{icon:OrderSvg,class:"xg-icon-order"},loop:{icon:LoopSvg,class:"xg-icon-loop"},sloop:{icon:SloopSvg,class:"xg-icon-sloop"},random:{icon:RandomSvg,class:"xg-icon-random"}}}},{key:"registerLanguageTexts",value:function(){return{order:{jp:"順番に遊ぶ",en:"Play in order",zh:"顺序播放","zh-hk":"順序播放"},loop:{jp:"リストループ",en:"List loop",zh:"列表循环","zh-hk":"列表循環"},sloop:{jp:"シングルサイクル",en:"Single loop",zh:"单曲循环","zh-hk":"單曲循環"},random:{jp:"シャッフル再生",en:"Play in shuffle",zh:"随机播放","zh-hk":"隨機播放"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.order),this.appendChild(".xgplayer-icon",e.sloop),this.appendChild(".xgplayer-icon",e.loop),this.appendChild(".xgplayer-icon",e.random)}},{key:"btnClick",value:function(e){var t,r,i;e.preventDefault(),e.stopPropagation();var n=null===(t=this.player.plugins)||void 0===t||null===(r=t.music)||void 0===r||null===(i=r.config)||void 0===i?void 0:i.mode,o=Music.ModeType.findIndex((function(e){return e===n})),a=0;o+1<Music.ModeType.length&&(a=o+1),this.player.plugins.music.mode=Music.ModeType[a]}},{key:"animate",value:function(e){switch(e){case PLAY_MODES.ORDER:this.setAttr("data-state","order"),this.changeLangTextKey(this.find(".xg-tips"),"order");break;case PLAY_MODES.LOOP:this.setAttr("data-state","loop"),this.changeLangTextKey(this.find(".xg-tips"),"loop");break;case PLAY_MODES.SLOOP:this.setAttr("data-state","sloop"),this.changeLangTextKey(this.find(".xg-tips"),"sloop");break;case PLAY_MODES.RANDOM:this.setAttr("data-state","random"),this.changeLangTextKey(this.find(".xg-tips"),"random");break;default:this.setAttr("data-state","order"),this.changeLangTextKey(this.find(".xg-tips"),"order")}}},{key:"destroy",value:function(){this.unbind(["touchend","click"],this.btnClick)}},{key:"render",value:function(){return'\n <xg-icon class="xgplayer-music-mode">\n <div class="xgplayer-icon"></div>\n <div class="xg-tips" lang-key="musicMode">'.concat(this.langText.order,"</div>\n </xg-icon>\n ")}}],[{key:"pluginName",get:function(){return"MusicMode"}},{key:"defaultConfig",get:function(){return{position:Plugin.POSITIONS.CONTROLS_RIGHT,index:9,disable:!1}}}]),r}(Plugin);function musicPlaySVG(){return(new DOMParser).parseFromString('<svg width="30" height="30" viewBox="0 0 50 50" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g clip-path="url(#clip0_20323_25753)">\n<g filter="url(#filter0_d_20323_25753)">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M25 0C38.8071 0 50 11.1929 50 25C50 38.8071 38.8071 50 25 50C11.1929 50 0 38.8071 0 25C0 11.1929 11.1929 0 25 0Z" fill="#1664FF"/>\n</g>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M19.3863 11.7091L37.5681 23.0728C38.9924 23.9629 38.9924 26.0372 37.5681 26.9273L19.3863 38.2909C17.8726 39.237 15.9091 38.1488 15.9091 36.3637V13.6364C15.9091 11.8513 17.8726 10.763 19.3863 11.7091Z" fill="white"/>\n</g>\n<defs>\n<filter id="filter0_d_20323_25753" x="-8" y="-6" width="66" height="66" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">\n<feFlood flood-opacity="0" result="BackgroundImageFix"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dy="2"/>\n<feGaussianBlur stdDeviation="4"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"/>\n<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_20323_25753"/>\n<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_20323_25753" result="shape"/>\n</filter>\n<clipPath id="clip0_20323_25753">\n<rect width="50" height="50" fill="white"/>\n</clipPath>\n</defs>\n</svg>\n',"image/svg+xml").firstChild}function musicPauseSVG(){return(new DOMParser).parseFromString('<svg width="30" height="30" viewBox="0 0 50 50" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g clip-path="url(#clip0_20330_26170)">\n<g filter="url(#filter0_d_20330_26170)">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M25 0C38.8071 0 50 11.1929 50 25C50 38.8071 38.8071 50 25 50C11.1929 50 0 38.8071 0 25C0 11.1929 11.1929 0 25 0Z" fill="#1664FF"/>\n</g>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M20.75 11C21.4404 11 22 11.6044 22 12.35V36.65C22 37.3956 21.4404 38 20.75 38H18.25C17.5596 38 17 37.3956 17 36.65V12.35C17 11.6044 17.5596 11 18.25 11H20.75Z" fill="white"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M31.75 11C32.4404 11 33 11.6044 33 12.35V36.65C33 37.3956 32.4404 38 31.75 38H29.25C28.5596 38 28 37.3956 28 36.65V12.35C28 11.6044 28.5596 11 29.25 11H31.75Z" fill="white"/>\n</g>\n<defs>\n<filter id="filter0_d_20330_26170" x="-8" y="-6" width="66" height="66" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">\n<feFlood flood-opacity="0" result="BackgroundImageFix"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dy="2"/>\n<feGaussianBlur stdDeviation="4"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"/>\n<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_20330_26170"/>\n<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_20330_26170" result="shape"/>\n</filter>\n<clipPath id="clip0_20330_26170">\n<rect width="50" height="50" fill="white"/>\n</clipPath>\n</defs>\n</svg>\n',"image/svg+xml").firstChild}var index$2="";function initMusicConfig(e){if("Object"!==util.typeOf(e.controls))e.controls={mode:"flex",initShow:!0};else{var t=e.controls;e.controls=_objectSpread2$5({mode:"flex",initShow:!0},t)}var r=e.play||{};e.play=_objectSpread2$5({index:3},r),e.marginControls=!0,e.icons=_objectSpread2$5({play:musicPlaySVG,pause:musicPauseSVG},e.icons||{})}var MusicPreset=_createClass$6((function e(t,r){_classCallCheck$5(this,e),initMusicConfig(r);var i="mobile"===sniffer$1.device;this.plugins=[Music,MusicMeta,MusicCover].concat(_toConsumableArray$1(i?[]:[MusicBackward,MusicPrev,MusicForward,MusicNext,MusicMode])),this.ignores=["start","cssFullScreen","fullscreen","pip","enter","replay","pc","loading","poster","error","playbackrate","mobile"]})),index_min="";window&&!window.Player&&(window.Player=PresetPlayer);var VePlayer=function(){function e(t){_classCallCheck$5(this,e),this.player=null,this.mountingDom=null,this.playerContainer=null,this.mobilePanel=null,this._isFirstCreated=!0,this.sdkPlugins=[],this._sdkPlugins={},this.delayError=[],this.isFirstEmitted=!0,this._init(t)}var t,r,i,n,o,a;return _createClass$6(e,[{key:"_init",value:function(e){this.initUmdLoader(e),this.playerData=new PlayerData(e),this._emitter=new EventEmitter,this.on(SDKEvents.TOKEN_EXPIRED,this.onTokenExpiredAction.bind(this)),this._initSdkPlugins(),this.renderDom(),this.createPlayer(),this._initI18N(this.playerData.languageData)}},{key:"_initSdkPlugins",value:function(){var e=this;sdkPluginManager.init(this),_toConsumableArray$1(this.sdkPlugins).map((function(t){return sdkPluginManager.registerPlugin(t,e)}))}},{key:"initCheckExpire",value:function(){var e=this;this.checkExpireTimer=new IntervalTimer,this.checkExpireTimer.repeat((function(){e.onRepeat()}),this.playerData.checkExpireInterval)}},{key:"initUmdLoader",value:function(e){var t=this;this.sdkUmdLoader=sdkUmdLoader,this.sdkUmdLoader.failCallback=function(e,r){return t.umdLoadErr(e,r)},e.umdUrlMap&&"object"===_typeof$4(e.umdUrlMap)&&this.sdkUmdLoader.updateBackupMap(e.umdUrlMap)}},{key:"umdLoadErr",value:function(e,t){this.emit(SDKEvents.UMD_LOAD_FAIL,{name:e,error:t})}},{key:"onRepeat",value:function(){var e,t=this,r=this.playerData.expireDetectType;r.indexOf("getUrlTime")>-1&&(this.getUrlTime&&null!==(e=this.player)&&void 0!==e&&e.duration&&(new Date).getTime()/1e3>this.getUrlTime+3300+this.player.duration+500&&(this.getUrlTime=0,this.emitExpireEvent()));r.indexOf("xhrStatus")>-1&&this._playOriginalUrl&&Math.random()<1/7.5&&new XHR({url:this._playOriginalUrl,method:"HEAD"}).catch((function(e){e&&void 0!==e.status&&(t.isFirstEmitted?(t.emitExpireEvent(),t.isFirstEmitted=!1):(t.expireCount=void 0===t.expireCount?1:t.expireCount+1,t.expireCount>3&&(t.expireCount=0,t.emitExpireEvent())))}))}},{key:"emitExpireEvent",value:function(){var e=this.player,t=(new Date).getTime()/1e3;e.emitExpireTimestamp?t-e.emitExpireTimestamp>MIN_EXPIRE_INTERVAL&&(e.emitExpireTimestamp=t,e.emit("MEDIA_EXPIRED")):(e.emitExpireTimestamp=t,e.emit("MEDIA_EXPIRED"))}},{key:"getUrlTimestamp",value:function(e){if(e){var t;e.startsWith("//")&&(e=location.protocol+e);try{var r,i=_createForOfIteratorHelper$1(new URL(e).searchParams);try{for(i.s();!(r=i.n()).done;){var n=_slicedToArray(r.value,2),o=n[0],a=n[1];if("auth_key"===o||"sign"===o){var s=parseInt(a.split("-")[0]);if(!isNaN(s)){t=s;break}}}}catch(h){i.e(h)}finally{i.f()}}catch(h){console.error(h)}try{var l,c=null===(l=new URL(e).pathname.split("/"))||void 0===l?void 0:l[2];if(c){var u=parseInt(c,16);isNaN(u)||(t=u)}}catch(h){console.error(h)}this.getUrlTime=t||(new Date).getTime()/1e3}}},{key:"on",value:function(e,t){this._emitter.on(e,t)}},{key:"emit",value:function(e,t){this._emitter.emit(e,t)}},{key:"once",value:function(e,t){this._emitter.once(e,t)}},{key:"off",value:function(e,t){this._emitter.off(e,t)}},{key:"renderDom",value:function(){var e=this.playerData,t=e.id,r=e.root,i=document.createElement("div");this.playerContainer=i;var n=r||document.querySelector("#".concat(t));n&&(n.appendChild(i),this.mountingDom=n)}},{key:"renderPoster",value:function(){if(this.playerContainer){var e=this.playerData.options,t=e.poster,r=void 0===t?"":t,i=e.width,n=e.height;r&&(this.playerContainer.style.cssText='background: url("'.concat(r,'");\n background-size: cover;\n width:').concat(i?i+"px":"100%",";\n height:").concat(n?n+"px":"100%",";\n "))}}},{key:"createPlayer",value:(a=_asyncToGenerator$2(_regeneratorRuntime$2().mark((function e(){var t,r,i,n,o,a,s,l,c,u,h,d,p,f,g,y,v,m,_,b,T,S,E,$,C,P,w,O,k,I,A,x,R,L=this;return _regeneratorRuntime$2().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._destroyPlayer();case 2:return e.next=4,this.beforePlayerCreate();case 4:return a=this.playerData,s=a.isLive,l=a.options,c=a.plugins,u=a.isMobile,h=a.openSoftDecoding,d=a.configs,p=a.isMusic,f=this.playerData.getCurrentUrl(),g=this.playerData.getCurrentStreamType()||getFormat(null==d?void 0:d.getVideoByToken),getPluginConfig(d,"EncryptHlsPlugin")||f&&g||p?(this._playOriginalUrl=f,this.getUrlTimestamp(f)):(console.warn("url is empty or streamType is empty: url:".concat(f,", streamType").concat(g)),this.renderPoster()),y={defaultDefinition:null===(t=this.playerData.playList[0])||void 0===t?void 0:t.definition,list:this.playerData.playList},v=function(){var e=_asyncToGenerator$2(_regeneratorRuntime$2().mark((function e(){return _regeneratorRuntime$2().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,L.getSoftDecodingOption(h,f,g);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),e.next=13,createSDKPreset({isLive:s,isMobile:u,type:g,playerData:this.playerData,getSoftOptionTask:v});case 13:return m=e.sent,_=m.presets,b=m.softDecodingOption,T=m.plugins,S=u?createPlayerOption(s):createPlayerOption$1(s),E=this._analyzeExtendPlugins(),$=E.basicPlugins,C=void 0===$?[]:$,P=E.iconPlugins,w=void 0===P?[]:P,O=this.playerData.getLineList(),k=this.playerData.current.lineId,I=this.playerData.getDefinitionListByLineId(k),A=_objectSpread2$5(_objectSpread2$5(_objectSpread2$5(_objectSpread2$5({},S),l),b||{}),{},{definition:y,icons:_objectSpread2$5(_objectSpread2$5(_objectSpread2$5({},S.icons),p?{play:musicPlaySVG,pause:musicPauseSVG}:{}),null!==(r=null==l?void 0:l.icons)&&void 0!==r?r:{}),MoreButtonPlugin:{iconPlugins:[].concat(_toConsumableArray$1(null!==(i=null===(n=l.MoreButtonPlugin)||void 0===n?void 0:n.iconPlugins)&&void 0!==i?i:[]),_toConsumableArray$1(w),[PlaybackRateMobilePlugin])},playerData:this.playerData}),O.length>1&&A.MoreButtonPlugin.iconPlugins.push(LineMobilePlugin),I.length>1&&A.MoreButtonPlugin.iconPlugins.push(DefinitionMobilePlugin),this.setDefaultConfigOptions(A),x=[].concat(_toConsumableArray$1(C),_toConsumableArray$1(c),_toConsumableArray$1(T)),A.ignores=[].concat(_toConsumableArray$1(null!==(o=null==A?void 0:A.ignores)&&void 0!==o?o:[]),_toConsumableArray$1(p?["sdkErrorPlugin","sdkToastPlugin","MoreButtonPlugin","DanmuPlugin"]:[])),this._isFirstCreated?this._isFirstCreated=!1:(A.autoplayMuted=!1,A.ignores=[].concat(_toConsumableArray$1(null!==(R=null==A?void 0:A.ignores)&&void 0!==R?R:[]),["sdkUnmutePlugin"])),this.setPluginConfig(A),this.player=new PresetPlayer(_objectSpread2$5(_objectSpread2$5(p?{el:this.playerContainer,controls:{mode:"flex",initShow:!0},marginControls:!0,presets:[].concat(_toConsumableArray$1(_),[MusicPreset]),mediaType:["mp4","hls"].includes(g)?"video":"audio",url:f}:{el:this.playerContainer,presets:_,url:f,isLive:s},A),{},{plugins:_toConsumableArray$1(x)})),this.player.playerData=this.playerData,this._emitter.emit(SDKEvents.PLAYER_CREATED_FINISH),this.afterPlayerCreate(),e.abrupt("return",this.player);case 35:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"setPluginConfig",value:function(e){var t,r=this.playerData,i=r.apiMap,n=r.configs,o=r.unionInfo,a=r.playList,s=r.useHlsPluginForSafari,l=r.isMobile,c=this.playerData.getCurrentStreamType()||getFormat(null==n?void 0:n.getVideoByToken),u=getPluginConfig(n,"EncryptHlsPlugin"),h=getPluginConfig(n,"Mp4EncryptPlayer"),d=getPluginConfig(n,"DASHPlugin"),p=getPluginConfig(n,"vodLogOpts"),f=!(null==a||null===(t=a[0])||void 0===t||!t.kid)||!!u;u&&(e.EncryptHlsPlugin=_objectSpread2$5(_objectSpread2$5({playDomain:i.playDomain,getKeyType:"TOP"},l||!isSafari||s?{}:{useHls:!1}),u)),h&&(e.Mp4EncryptPlayer=_objectSpread2$5({playDomain:i.playDomain,getKeyType:"TOP"},h)),d&&(e.DASHPlugin=_objectSpread2$5({playDomain:i.playDomain,getKeyType:"TOP"},d)),n.privateDrmAuthToken&&n.kid&&o&&("hls"===c?e.EncryptHlsPlugin=_objectSpread2$5({kid:n.kid,drmKeyToken:n.privateDrmAuthToken,playDomain:i.playDomain},u||{}):"dash"===c?e.DASHPlugin=_objectSpread2$5({kid:n.kid,drmKeyToken:n.privateDrmAuthToken,playDomain:i.playDomain},d||{}):"mp4"===c&&(e.Mp4EncryptPlayer=_objectSpread2$5({kid:n.kid,drmKeyToken:n.privateDrmAuthToken,playDomain:i.playDomain},h||{}))),p&&(e.vodLogOpts=_objectSpread2$5({vtype:(c||"mp4").toUpperCase(),drm_type:f?1:0,playerVersion:pkgJson.version},p))}},{key:"detectCodec",value:(o=_asyncToGenerator$2(_regeneratorRuntime$2().mark((function e(t){var r,i,n,o,a;return _regeneratorRuntime$2().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,sdkUmdLoader.loadPlugins("streamprobe");case 3:if(e.t0=e.sent,e.t0){e.next=6;break}e.t0={};case 6:if(r=e.t0,!(i=r.LoadProbe)){e.next=14;break}return e.next=11,null===(n=new i)||void 0===n?void 0:n.parseUrl(t);case 11:o=e.sent,"bytevc1"===(a=(o||{}).codec)?this.playerData.codec=CodecType.H265:"avc"===a&&(this.playerData.codec=CodecType.H264);case 14:e.next=19;break;case 16:e.prev=16,e.t1=e.catch(0),console.warn("detect codec error: ",e.t1);case 19:case"end":return e.stop()}}),e,this,[[0,16]])}))),function(e){return o.apply(this,arguments)})},{key:"setDefaultConfigOptions",value:function(e){if(this._isFirstCreated){var t=this.playerData,r=t.defaultConfig,i=t.isHitDefault;if(r){var n=null!=r?r:{},o=n.volume,a=n.startTime,s=n.DanmuPlugin,l=n.LiveSubtitlesIconPlugin;if(o&&(e.volume=e.volume?_objectSpread2$5(_objectSpread2$5({},e.volume),{},{default:o}):o),i){var c,u;if(a&&(e.startTime=a),s)e.DanmuPlugin=_objectSpread2$5(_objectSpread2$5({},null!==(c=e.DanmuPlugin)&&void 0!==c?c:{}),s);if(l)e.LiveSubtitlesIconPlugin=_objectSpread2$5(_objectSpread2$5({},null!==(u=e.LiveSubtitlesIconPlugin)&&void 0!==u?u:{}),l)}}}}},{key:"getCurrentPlayerConfig",value:function(){var e,t,r=this.playerData,i=r.isLive,n=r.current,o=n.lineId,a={type:i?"live":"vod",isLive:i,definition:n.definition,lineId:o,volume:null!==(e=this.player.volume)&&void 0!==e?e:.6};i||(a.startTime=null!==(t=this.player.currentTime)&&void 0!==t?t:0);return _objectSpread2$5({},a)}},{key:"_analyzeExtendPlugins",value:function(){var e,t=this.playerData.options,r=t.extendPlugin||[],i=null!==(e=null==t?void 0:t.ignore)&&void 0!==e?e:[],n=[],o=[];return r.forEach((function(e){var t=extendPlugin(e);"inner"!==t.type||i[e.pluginName]?n.push(t):o.push(t)})),{basicPlugins:n,iconPlugins:o}}},{key:"beforePlayerCreate",value:(n=_asyncToGenerator$2(_regeneratorRuntime$2().mark((function e(){return _regeneratorRuntime$2().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,sdkPluginManager.beforePlayerCreate(this);case 2:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"afterPlayerCreate",value:function(){var e=this.playerData.isMobile;this._mountingPlayerPanel(e),this._mountingExtendMethods(),this._bindSdkEvents(),this._bindPlayerEvents(),this._setPlayerInfo(),sdkPluginManager.afterPlayerCreate(this),this.emitDelayError()}},{key:"emitDelayError",value:function(){var e=this;setTimeout((function(){e.player&&e.delayError.forEach((function(t){var r=new Errors(e.player,t);e.player.emit("error",r)})),e.delayError=[]}),0)}},{key:"_setPlayerInfo",value:function(){var e,t;if(this.player){this.player.playerVersion=pkgJson.version;var r=this.playerData.getCurrentStreamType()||getFormat(null===(e=this.playerData)||void 0===e||null===(t=e.configs)||void 0===t?void 0:t.getVideoByToken);this.player.playerType||(this.player.playerType=r)}}},{key:"_mountingPlayerPanel",value:function(e){var t,r=this.playerData,i=r.options,n=r.isLive;this.player&&e&&(this.mobilePanel=new MobilePlayerPanel({config:null!==(t=i.panel)&&void 0!==t?t:{mode:n?PLAYER_MODE.INNER:PLAYER_MODE.NORMAL,isAutoChange:!0},root:this.player.root,player:this.player}),this.player.panel=this.mobilePanel)}},{key:"_bindPlayerEvents",value:function(){this.player&&(this.player.on(SDKEvents.PLAYER_REBUILD,this.createPlayer.bind(this)),this.player.on(PluginEvents.MEDIA_EXPIRED,this.onMediaExpiredAction.bind(this)),this.player.once(COMPLETE,this.emitDelayError.bind(this)))}},{key:"onMediaExpiredAction",value:function(){var e,t,r=this;if(null!==(e=this.playerData)&&void 0!==e&&e.onMediaExpired&&"function"==typeof(null===(t=this.playerData)||void 0===t?void 0:t.onMediaExpired)){var i=retPromise$1(this.playerData.onMediaExpired());null!=i&&i.then&&i.then((function(e){return r.playNext(e)}))}}},{key:"onTokenExpiredAction",value:function(){var e,t,r=this;if(null!==(e=this.playerData)&&void 0!==e&&e.onTokenExpired&&"function"==typeof(null===(t=this.playerData)||void 0===t?void 0:t.onTokenExpired)){var i=retPromise$1(this.playerData.onTokenExpired());null!=i&&i.then&&i.then((function(e){return r.updateAuthToken(e)}))}}},{key:"_bindSdkEvents",value:function(){var e=this;[].concat(_toConsumableArray$1(Object.values(PluginEvents)),_toConsumableArray$1(Object.values(SDKEvents)),_toConsumableArray$1(Object.values(Events))).forEach((function(t){"string"==typeof t&&e.player.on(t,(function(){for(var r,i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];(r=e._emitter).emit.apply(r,[t].concat(n))}))}))}},{key:"_mountingExtendMethods",value:function(){this.player&&(this.player.changePluginsIcon=this.changePluginsIcon.bind(this))}},{key:"_offPlayerEvents",value:function(){this.player&&this.player.off(SDKEvents.PLAYER_REBUILD,this.createPlayer.bind(this))}},{key:"changePluginsIcon",value:function(e,t){var r;if(this.player){var i=this.player.getPlugin(e);if(i&&null!=i&&i.root){var n=util.hasClass(null==i?void 0:i.parent,"panel-icon-svg")?null==i||null===(r=i.parent)||void 0===r?void 0:r.parentNode:null==i?void 0:i.root;n&&(t?util.show(n,"block"):util.hide(n))}}}},{key:"getSdkPlugin",value:function(e){var t=this._sdkPlugins[e.toLowerCase()];return t&&t.pluginName?t:null}},{key:"switchAuthToken",value:function(e){var t=this,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=r?0:this.player.currentTime,n=this.getSdkPlugin("AuthToken"),o=this.player.paused&&!this.player.isError,a=this.player.state,s=this.player.getPlugin("sdkDefinitionPlugin");return s&&(s.canChange=!1),new Promise((function(r,l){n?n.switchAuthToken(e).then((function(){var e,n=t.playerData.getCurrentUrl();t._playOriginalUrl=n;var c={defaultDefinition:null===(e=t.playerData.playList[0])||void 0===e?void 0:e.definition,list:t.playerData.playList};if(s&&(s.config=s.getConfig(t.player),s.renderItemList(),s.canChange=!0),t.player){var u=_objectSpread2$5(_objectSpread2$5({},t.playerData.options),{},{definition:c,startTime:i,url:n});if(t.player.playNext(u),6===a)t.player.once(CANPLAY,(function(){o&&t.player.pause(),r()}));else{var h=u.autoplay||u.autoplayMuted;t.player.once(CANPLAY,(function(){h?t.player.play():t.player.pause(),r()}))}}else console.error("no player created"),l()})):(console.error("current is not playAuthToken play"),l())}))}},{key:"updateAuthToken",value:function(e){var t=this,r=this.player.config,i=this.getSdkPlugin("AuthToken");return new Promise((function(n,o){i?i.switchAuthToken(e).then((function(){var e=t.playerData.getCurrentUrl();if(t._playOriginalUrl=e,t.getUrlTimestamp(e),t.player){t.player.resetState(),t.player.setConfig(_objectSpread2$5(_objectSpread2$5(_objectSpread2$5({},r),t.playerData.options),{},{url:e}));var i=t.player.start(e);i&&i.then?i.then((function(){return n()})):n()}else console.error("player not created"),o()})):(console.error("current is not playAuthToken play"),o())}))}},{key:"src",get:function(){var e;return null===(e=this.player)||void 0===e?void 0:e.src},set:function(e){this.player&&(this.player.src=e)}},{key:"switchURL",value:function(e){var t=this;this.resetUrlState(e);var r=this.player.switchURL(e,!1),i=this.player.currentTime;return r&&r.then?r:new Promise((function(e){var r=t.player.paused&&!t.player.isError,n=function(){t.player.currentTime=i,r&&t.player.once(CANPLAY,(function(){t.player.pause()})),e()};sniffer$1.os.isAndroid?t.once("timeupdate",(function(){n()})):t.once(CANPLAY,(function(){n()})),t.player.play()}))}},{key:"next",value:function(e){var t,r=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=i?0:this.player.currentTime,o=this.playerData.configs,a=_objectSpread2$5(_objectSpread2$5({},o),{},{startTime:n,autoplay:!0},e);return null!=e&&null!==(t=e.getVideoByToken)&&void 0!==t&&t.playAuthToken&&(a.streamType=getFormat(null==e?void 0:e.getVideoByToken)||"mp4"),this.destroy().then((function(){return r._init(a)})).catch((function(e){console.error("next_error",e)}))}},{key:"playNext",value:function(e){var t,r,i=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!e)return Promise.reject();var o=e.url,a=e.getVideoByToken,s=!(null===(t=this.player)||void 0===t||null===(r=t.plugins)||void 0===r||!r.dashplugin),l=this.player.paused&&!this.player.isError,c=n?0:this.player.currentTime;if(o){this.resetUrlState(o);var u=this.player.config,h=this.player.state,d=_objectSpread2$5(_objectSpread2$5({},u),{},{startTime:c},e);return this.setPluginConfig(d),this.player.playNext(d),new Promise((function(e,t){if(i.player.once(ERROR$1,(function(e){t(e)})),6===h)i.player.once(EMPTIED,(function(){i.player.once(CANPLAY,(function(){l&&i.player.pause(),e(void 0)}))}));else{var r=d.autoplay||d.autoplayMuted;i.player.once(EMPTIED,(function(){i.player.once(CANPLAY,(function(){r?i.player.play():i.player.pause(),e(void 0)}))}))}}))}if(null!=a&&a.playAuthToken){var p,f=this.playerData.getCurrentStreamType()||getFormat(null===(p=this.playerData.configs)||void 0===p?void 0:p.getVideoByToken),g=e.streamType||getFormat(null==e?void 0:e.getVideoByToken)||"mp4";return f!==g?this.next(e,n):s?dist.url(null==a?void 0:a.playAuthToken,this.playerData.apiMap.playDomain).then((function(e){var t=getPluginConfig(i.player.config,"DASHPlugin");t.dashOpts={Data:e},i.player.plugins.dashplugin.next(i.player.currentTime,"MEDIA_EXPIRED",t,!0)})):this.switchAuthToken(a,n)}return this.next(e,n)}},{key:"resetUrlState",value:function(e){this.playerData.playList=[],this.playerData.initPlayData(_objectSpread2$5(_objectSpread2$5({},this.playerData.configs),{},{url:e})),this._playOriginalUrl=e,this.getUrlTimestamp(e)}},{key:"_destroyPlayer",value:(i=_asyncToGenerator$2(_regeneratorRuntime$2().mark((function e(){var t,r;return _regeneratorRuntime$2().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._offPlayerEvents(),e.next=3,null===(t=this.mobilePanel)||void 0===t?void 0:t.destroy();case 3:return e.next=5,null===(r=this.player)||void 0===r?void 0:r.destroy();case 5:this.player=null;case 6:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"getPlayerInstance",value:function(){return this.player}},{key:"getSoftDecodingOption",value:(r=_asyncToGenerator$2(_regeneratorRuntime$2().mark((function e(t,r,i){var n,o,a,s,l,c,u,h,d,p,f,g;return _regeneratorRuntime$2().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=this.playerData,a=o.enableH265Degrade,s=o.codec,l=o.configs,c=isEncryptPlay(null==l?void 0:l.getVideoByToken),u=!!(l.enableMp4MSE||getPluginConfig(this.playerData.options,"Mp4EncryptPlayer")||"mp4"===i&&(c||null!=l&&null!==(n=l.autoBitrateOpts)&&void 0!==n&&n.isOpenAutoDefi)),!t){e.next=20;break}return e.next=6,sdkUmdLoader.loadPlugins("XGVideo");case 6:if(!(null==(h=e.sent)?void 0:h.isSupported())){e.next=14;break}return s&&h.setDecodeCapacity({preloadDecoder:this.playerData.codec,wasmFallbackToAsm:!1,reuseWasmDecoder:!1,disabledWhenErrorOccur:!1}),this.setH265SoftPlayList(),e.abrupt("return",{mediaType:u?this.playerData.isCurrentH265()?"xg-video":"video":"xg-video",innerDegrade:1,codecType:null!=s?s:"h264"});case 14:this.emit(SDKEvents.NOT_SUPPORT_SOFT_DECODER),d={errorType:"decoder",errorCode:3,errorMessage:"soft decode is not support by current browser",ext:{},originError:void 0},this.delayError.push(d),console.error("soft decode is not support by current browser");case 18:e.next=46;break;case 20:if(!a||s){e.next=23;break}return e.next=23,this.detectCodec(r);case 23:if(!this.playerData.isCurrentH265()||isHevcSupported()){e.next=46;break}if(!a){e.next=42;break}return e.next=27,sdkUmdLoader.loadPlugins("XGVideo");case 27:if(!(null==(p=e.sent)?void 0:p.isSupported())){e.next=36;break}return null==p||p.setDecodeCapacity({preloadDecoder:this.playerData.codec,wasmFallbackToAsm:!1,reuseWasmDecoder:!1,disabledWhenErrorOccur:!1}),this.setH265SoftPlayList(),this.playerData.openSoftDecoding=!0,e.abrupt("return",{mediaType:u?this.playerData.isCurrentH265()?"xg-video":"video":"xg-video",innerDegrade:1,codecType:this.playerData.codec});case 36:this.emit(SDKEvents.NOT_SUPPORT_SOFT_DECODER),f={errorType:"decoder",errorCode:3,errorMessage:"soft decode is not support by current browser",ext:{},originError:void 0},this.delayError.push(f),console.error("soft decode is not support by current browser");case 40:e.next=46;break;case 42:this.emit(SDKEvents.NOT_SUPPORT_HARDWARE_DECODER),g={ext:{},originError:void 0,errorType:"decoder",errorCode:3,errorMessage:"h265 hardware decode is not supported by this browser"},this.delayError.push(g),console.error("h265 hardware decode is not supported by this browser");case 46:return e.abrupt("return",{});case 47:case"end":return e.stop()}}),e,this)}))),function(e,t,i){return r.apply(this,arguments)})},{key:"setH265SoftPlayList",value:function(){if(this.playerData.isCurrentH265()){var e=this.playerData.playList;e.length>1&&(this.playerData.playList=e.filter((function(e){var t;return(null==e||null===(t=e.codec)||void 0===t?void 0:t.toLowerCase())===CodecType.H265}))),this.playerData.initCurrent(this.playerData.playList[0])}}},{key:"_initI18N",value:function(e){var t=e.extraLangList,r=e.extendLangList;null==t||t.forEach((function(e){I18N.use(e)})),I18N.extend(defaultExtendLang),r&&I18N.extend(r)}},{key:"musicMode",get:function(){var e,t;return null===(e=this.player.plugins)||void 0===e||null===(t=e.music)||void 0===t?void 0:t.mode},set:function(e){var t;null!==(t=this.player.plugins)&&void 0!==t&&t.music&&(this.player.plugins.music.mode=e)}},{key:"musicTimeScale",get:function(){var e,t;return null===(e=this.player.plugins)||void 0===e||null===(t=e.music)||void 0===t?void 0:t.timeScale},set:function(e){var t;null!==(t=this.player.plugins)&&void 0!==t&&t.music&&(this.player.plugins.music.timeScale=e)}},{key:"musicList",get:function(){var e,t;return null===(e=this.player.plugins)||void 0===e||null===(t=e.music)||void 0===t?void 0:t.list},set:function(e){var t,r;null===(t=this.player.plugins)||void 0===t||null===(r=t.music)||void 0===r||r.updateList(e)}},{key:"musicAdd",value:function(e){var t,r,i;null===(t=this.player.plugins)||void 0===t||null===(r=t.music)||void 0===r||null===(i=r.add)||void 0===i||i.call(r,e)}},{key:"musicRandom",value:function(){var e,t,r;return null===(e=this.player.plugins)||void 0===e||null===(t=e.music)||void 0===t||null===(r=t.random)||void 0===r?void 0:r.call(t)}},{key:"musicNext",value:function(){var e,t,r;null===(e=this.player.plugins)||void 0===e||null===(t=e.music)||void 0===t||null===(r=t.next)||void 0===r||r.call(t)}},{key:"musicPrev",value:function(){var e,t,r;null===(e=this.player.plugins)||void 0===e||null===(t=e.music)||void 0===t||null===(r=t.prev)||void 0===r||r.call(t)}},{key:"musicSetIndex",value:function(e){var t,r,i;null===(t=this.player.plugins)||void 0===t||null===(r=t.music)||void 0===r||null===(i=r.setIndex)||void 0===i||i.call(r,e)}},{key:"musicForward",value:function(){var e,t,r;null===(e=this.player.plugins)||void 0===e||null===(t=e.music)||void 0===t||null===(r=t.forward)||void 0===r||r.call(t)}},{key:"musicBackward",value:function(){var e,t,r;null===(e=this.player.plugins)||void 0===e||null===(t=e.music)||void 0===t||null===(r=t.backward)||void 0===r||r.call(t)}},{key:"musicRemove",value:function(e){var t,r,i;null===(t=this.player.plugins)||void 0===t||null===(r=t.music)||void 0===r||null===(i=r.remove)||void 0===i||i.call(r,e)}},{key:"musicSetAbCycle",value:function(e,t,r,i){var n,o,a;null===(n=this.player.plugins)||void 0===n||null===(o=n.music)||void 0===o||null===(a=o.setAbCycle)||void 0===a||a.call(o,e,t,r,i)}},{key:"musicRemoveAbCycle",value:function(){var e,t,r;null===(e=this.player.plugins)||void 0===e||null===(t=e.music)||void 0===t||null===(r=t.removeAbCycle)||void 0===r||r.call(t)}},{key:"destroy",value:(t=_asyncToGenerator$2(_regeneratorRuntime$2().mark((function e(){return _regeneratorRuntime$2().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._destroyPlayer();case 2:this.checkExpireTimer&&(this.checkExpireTimer.clear(),this.checkExpireTimer=null),this.mountingDom&&this.mountingDom.removeChild(this.playerContainer),this._emitter.removeAllListeners(),this._emitter=null,sdkPluginManager.destroy(this);case 7:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}();function getI18N(){return I18N}VePlayer.isMSESupported=isMSESupport,VePlayer.isRTMSupported=RtmPlugin.isSupported,VePlayer.isRTMSupportCodec=function(e,t){if(e===RTMCodec.H264)return RtmPlugin.isSupportedH264(null==t?void 0:t.targetProfileLevel)},VePlayer.playerVersion=pkgJson.version;var index$1="",aisub="",aisubIcon="",index="";function Uint8ArrayToString(e){var t=String.fromCharCode.apply(null,e);return t.slice(t.indexOf("{"),t.lastIndexOf("}")+1)}var LiveSubTitlesPlugin=function(e){_inherits$5(r,e);var t=_createSuper$5(r);function r(e){var i;return _classCallCheck$5(this,r),(i=t.call(this,e)).state={showLang:"",subTitleList:[],rtmpDtsGap:0,dtsBase:0,showingSubtitle:"",currentSub:null},i.clearLineTimer=null,i.showTimer=null,i.state.showLang=e.showLang,i}return _createClass$6(r,[{key:"beforePlayerInit",value:function(){var e=this;this.on(TIME_UPDATE,this.handleVideoTimeupdate.bind(this)),this.on(PAUSE,this.onPause.bind(this)),this.on(PLAY,this.onPlay.bind(this)),this.on(DESTROY,this.destroy.bind(this)),this.on(URL_CHANGE,this.clearRtmpDtsGap.bind(this)),this.on(SEI_PARSED,this.handleSEIParsed.bind(this)),this.on("core_event",(function(t){"core.sei"===t.eventName&&e.handleSEIParsed(t.sei,t.originPts)}))}},{key:"onPause",value:function(){this.clearSubTitle(!1)}},{key:"onPlay",value:function(){this.clearSubTitle(!0)}},{key:"destroy",value:function(){this.clearSubTitle(!0),this.off(TIME_UPDATE,this.handleVideoTimeupdate.bind(this)),this.off(SEI_PARSED,this.handleSEIParsed.bind(this)),this.off(PAUSE,this.onPause.bind(this)),this.off(PLAY,this.onPlay.bind(this)),this.off(DESTROY,this.destroy.bind(this)),this.off(URL_CHANGE,this.clearRtmpDtsGap.bind(this))}},{key:"clearRtmpDtsGap",value:function(){this.state.rtmpDtsGap=0,this.state.dtsBase=0,this.clearSubTitle(!0)}},{key:"clearSubTitle",value:function(e){if(this.state.subTitleList=[],this.state.showingSubtitle="",this.state.currentSub=null,clearTimeout(this.showTimer),clearTimeout(this.clearLineTimer),e){var t=this.find(".xgplayer-subtitles-inner");t&&this.resetDom(t)}}},{key:"getIsSoft",value:function(){var e;return"LIVE-VIDEO"===(null!==(e=this.player.video)&&void 0!==e?e:{}).tagName}},{key:"handleVideoTimeupdate",value:function(e){var t,r,i=this.player.video.currentTime,n=this.getIsSoft(),o=(null==e||null===(t=e.detail)||void 0===t?void 0:t.pts)/1e3,a=n?o:i;if(this.state.showLang&&a&&this.player.isPlaying){var s=this.findSubTitleByTime(a);s&&s.text!==this.state.showingSubtitle&&null!==(r=s.wordpiece)&&void 0!==r&&r.length&&(this.renderSubtitle(s),this.player.emit(PluginEvents.AI_SUBTITLE_MATCH,{subTitle:s,lang:this.state.showLang}),this.state.subTitleList.length>1e3&&(this.state.subTitleList=this.state.subTitleList.filter((function(e){return e.timestamp+e.duration/1e3>=a}))))}}},{key:"renderSubtitle",value:function(e){var t=this,r=this.root,i=this.find(".xgplayer-subtitles-inner"),n=this.find(".xgplayer-subtitles-helper");if(i){this.clearLineTimer&&clearTimeout(this.clearLineTimer),this.showTimer&&(clearTimeout(this.showTimer),this.showSurplus());var o=this.createNewDom(i);this.state.showingSubtitle=e.text,this.state.currentSub={subObj:e,dom:o,index:0};var a=Date.now(),s="",l=0;!function c(){var u,h=e.wordpiece,d=void 0===h?[]:h,p=e.delimiter;if(l===d.length)return s="",t.showTimer=null,void(t.clearLineTimer=setTimeout((function(){t.resetDom(i),t.clearLineTimer=null}),1e3));var f=d[l].duration-(Date.now()-a-d[l].OffsetMs);if(f<0)for(;f<0&&l<d.length-1;)s=s+p+d[l+=1].text,f=d[l].duration-(Date.now()-a-d[l].OffsetMs);else s=s+p+d[l].text;n.textContent=s;var g=null!==(u=null==r?void 0:r.offsetWidth)&&void 0!==u?u:300;n.offsetWidth>g&&(o=t.createNewDom(i),t.state.currentSub.dom=o,s=d[l].text),o.textContent=s,t.showTimer=setTimeout(c,f),l+=1,t.state.currentSub.index=l}()}}},{key:"handleSEIParsed",value:function(e,t){var r=e.dts;if(5===e.code)try{var i="string"==typeof e.content?e.content:Uint8ArrayToString(e.content),n=JSON.parse(i).rtmp_dts;if(n&&r){var o=t||r;this.state.rtmpDtsGap=n-o}}catch(e2){}}},{key:"insertSubTitle",value:function(){for(var e,t=this,r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];i.forEach((function(e){e.timestamp=t.adjustSubTitleTime(e.timestamp)})),(e=this.state.subTitleList).push.apply(e,i)}},{key:"setCurrentLang",value:function(e){this.state.showLang=e,this.player.emit(PluginEvents.AI_SUBTITLE_LANG_CHANGE,e)}},{key:"adjustSubTitleTime",value:function(e){var t,r,i,n,o,a,s,l;if(this.getIsSoft())return(e-this.state.rtmpDtsGap)/1e3;var c=(null===(t=this.player)||void 0===t||null===(r=t.plugins)||void 0===r?void 0:r.flvlive)||(null===(i=this.player)||void 0===i||null===(n=i.plugins)||void 0===n?void 0:n.hlslive);if(c){var u,h,d,p,f,g,y,v=null!==(u=null==c||null===(h=c._context)||void 0===h||null===(d=h.getInstance("COMPATIBILITY"))||void 0===d?void 0:d._videoLargeGap)&&void 0!==u?u:0,m=null==c||null===(p=c._context)||void 0===p?void 0:p.getInstance("MP4_REMUXER"),_=null!==(f=null!==(g=null===(y=m.remuxer)||void 0===y?void 0:y.videoDtsBase)&&void 0!==g?g:null==m?void 0:m.videoDtsBase)&&void 0!==f?f:0;return this.state.dtsBase=_-v,(e+v-_-this.state.rtmpDtsGap)/1e3}var b=(null===(o=this.player)||void 0===o||null===(a=o.plugins)||void 0===a?void 0:a.flv)||(null===(s=this.player)||void 0===s||null===(l=s.plugins)||void 0===l?void 0:l.hls);if(b){var T,S,E,$=null===(T=b.core._bufferService)||void 0===T||null===(S=T._demuxer)||void 0===S||null===(E=S._fixer)||void 0===E?void 0:E._baseDts;return this.state.dtsBase=$,(e-$-this.state.rtmpDtsGap)/1e3}return(e-this.state.rtmpDtsGap)/1e3}},{key:"findSubTitleByTime",value:function(e){var t=this,r=this.state.subTitleList,i=r.findIndex((function(r){var i=t.player,n=r.lang===t.state.showLang,o=((null==i?void 0:i.__curUrl)||i.config.url)===r.url,a=r.timestamp;return a+r.duration/1e3>=e&&a<=e&&o&&n}));if(!(i<0)){var n=r.splice(0,i+1),o=n[n.length-1];return this.splitSubTitle(o)}}},{key:"splitSubTitle",value:function(e){var t="en"===e.lang?" ":"",r=e.text.split(t);if(!e.wordpiece){var i=e.duration/r.length,n=r.map((function(e,t){return{text:e,OffsetMs:i*t,duration:i}}));return _objectSpread2$5(_objectSpread2$5({},e),{},{delimiter:t,textArr:r,wordpiece:n})}return _objectSpread2$5(_objectSpread2$5({},e),{},{delimiter:t,textArr:r})}},{key:"showSurplus",value:function(){var e,t=this;if(this.state.currentSub){var r=this.state.currentSub,i=r.index,n=r.subObj,o=r.dom,a=null!=n?n:{},s=a.wordpiece,l=a.delimiter;if(!(i>=s.length)){var c=this.find(".xgplayer-subtitles-helper"),u=this.find(".xgplayer-subtitles-inner"),h=this.root,d=null!==(e=null==h?void 0:h.offsetWidth)&&void 0!==e?e:300,p=s.length,f=o.textContent;s.slice(i,p).forEach((function(e){f=f+l+e.text,c.textContent=f,c.offsetWidth>d&&(t.state.currentSub.dom=t.createNewDom(u),f=e.text),t.state.currentSub.dom.textContent=f}))}}}},{key:"createNewDom",value:function(e){if(e){e.children.length>2&&e.firstElementChild&&e.removeChild(e.firstElementChild);var t=document.createElement("span");if(e.appendChild(t),e.children.length>2){var r=e.classList.contains("scroll-1"),i=e.classList.contains("scroll-2");r&&e.classList.replace("scroll-1","scroll-2"),i&&e.classList.replace("scroll-2","scroll-1"),r||i||e.classList.add("scroll-1")}return t}}},{key:"test",value:function(){var e=this,t=this.splitSubTitle({duration:1e4,lang:"zh",text:"你呼吸 已改变 停滞于某段流年 离别的你我 才明白挥霍有期限,逝去的人不曾走远 像 突如其来温暖我的晴天 像 倾盆大雨我躲避的屋檐",timestamp:0,url:"xxx"});this.renderSubtitle(t),setTimeout((function(){e.test()}),1e4)}},{key:"getPlayTime",value:function(){var e=this,t=this.getIsSoft();this.on(TIME_UPDATE,(function(r){if(t){var i,n={pts:null==r||null===(i=r.detail)||void 0===i?void 0:i.pts,rtmpDtsGap:e.state.rtmpDtsGap};n.timestamp=n.pts+n.rtmpDtsGap,console.log("直播当前时间戳:",n.timestamp,n)}else{var o={currentTime:1e3*e.player.video.currentTime,dtsBase:e.state.dtsBase,rtmpDtsGap:e.state.rtmpDtsGap};o.timestamp=o.currentTime+o.dtsBase+o.rtmpDtsGap,console.log("直播当前时间戳:",o.timestamp,o)}}))}},{key:"resetDom",value:function(e){e&&(this.state.currentSub=null,e&&(e.innerHTML="",e.classList.remove("scroll-1","scroll-2")))}},{key:"render",value:function(){return'<xg-subtitles class="xgplayer-subtitles"><xg-subtitles-inner class="xgplayer-subtitles-inner"></xg-subtitles-inner><xg-subtitles-helper class="xgplayer-subtitles-helper"></xg-helper></xg-subtitles>'}}],[{key:"pluginName",get:function(){return"LiveSubtitlesPlugin"}},{key:"defaultConfig",get:function(){return{position:Plugin.POSITIONS.ROOT,showLang:""}}}]),r}(Plugin),POSITIONS$2=Plugin.POSITIONS,LiveSubtitlesIconPlugin=function(e){_inherits$5(r,e);var t=_createSuper$5(r);function r(e){var i;return _classCallCheck$5(this,r),(i=t.call(this,e)).isMobile="mobile"===sniffer$1.device,i.isOpenState=!0,i.optionList=null,i.currentLang="",i}return _createClass$6(r,[{key:"afterCreate",value:function(){this.appendChild(".xgplayer-icon",this.icons.aiSubOpen),this.appendChild(".xgplayer-icon",this.icons.aiSubClose),this.renderOptionList(),this.initEvents(),this.currentLang=this.config.default,this.config.defaultOpen?this.open(!0):this.close()}},{key:"afterPlayerInit",value:function(){this.config.defaultOpen&&this.changeSubTitleLang(this.config.default,!0)}},{key:"registerIcons",value:function(){return{aiSubOpen:{icon:OpenIcon,class:"xgplayer-aisub-open-svg"},aiSubClose:{icon:CloseIcon,class:"xgplayer-aisub-close-svg"}}}},{key:"registerLanguageTexts",value:function(){return{sub:{jp:"AI 字幕",en:"AI Subtitles",zh:"AI 字幕","zh-hk":"AI 字幕"},subOpen:{jp:"字幕をオンにする",en:"Show subtitles",zh:"开启字幕","zh-hk":"開啟字幕"},subClose:{jp:"クローズドキャプション",en:"Hide subtitles",zh:"关闭字幕","zh-hk":"關閉字幕"}}}},{key:"children",value:function(){return{LiveSubTitlesPlugin:{plugin:LiveSubTitlesPlugin,options:{root:this.player.root,showLang:this.currentLang}}}}},{key:"initEvents",value:function(){this.bind(["click"],this.handleButtonChange.bind(this)),this.bind(["mouseenter"],this.showPanel.bind(this)),this.bind(["mouseleave"],this.hidePanel.bind(this))}},{key:"handleButtonChange",value:function(){(this.close=this.close.bind(this),this.open=this.open.bind(this),this.isMobile)?this.showMobilePanel():(this.isOpenState?this.close:this.open)()}},{key:"showMobilePanel",value:function(){var e,t=this.renderItemList();null===(e=this.player.panel)||void 0===e||e.showPanel(t,this.langText.sub,!0)}},{key:"renderItemList",value:function(){var e=this,t=_toConsumableArray$1(this.config.list),r=util.createDom("div","",{},"ai-panel-content");return t.push({key:"",showText:this.langText.subClose}),t.forEach((function(t){var i=e.renderItem(t);r.appendChild(i)})),r}},{key:"renderItem",value:function(e){var t=this,r=""===e.key&&!this.isOpenState||this.currentLang===e.key&&this.isOpenState,i=util.createDom("div","",{},"panel-Item ".concat(r?"select-in":""));return i.innerHTML=e.showText,i.addEventListener("click",(function(r){r.stopPropagation(),r.preventDefault(),t.changeSubTitleLang(e.key),t.updatePanel()})),i}},{key:"updatePanel",value:function(){var e,t=this.renderItemList();null===(e=this.player.panel)||void 0===e||e.updatePanel(t)}},{key:"showPanel",value:function(){var e;!this.isMobile&&this.isOpenState&&(null===(e=this.optionList)||void 0===e||e.show())}},{key:"hidePanel",value:function(){var e;!this.isMobile&&this.isOpenState&&(null===(e=this.optionList)||void 0===e||e.hide())}},{key:"open",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.isOpenState=!0,util.removeClass(this.root,"isClose"),util.addClass(this.root,"isOpen"),!e&&this.showPanel(),this.toggleSubTitle()}},{key:"close",value:function(){var e;this.isOpenState=!1,util.removeClass(this.root,"isOpen"),util.addClass(this.root,"isClose"),null===(e=this.optionList)||void 0===e||e.hide(),this.toggleSubTitle()}},{key:"renderOptionList",value:function(){var e,t=this;if(!((null===(e=this.config.list)||void 0===e?void 0:e.length)<2||this.isMobile)){var r={config:{data:this.config.list.map((function(e){return e.key===t.config.default&&(e.isCurrent=!0,e.selected=!0),e})),className:"",onItemClick:function(e,r){var i;e.stopPropagation(),e.preventDefault(),t.changeSubTitleLang(null===(i=r.to)||void 0===i?void 0:i.key)}},root:this.root};this.optionList=new OptionList(r)}}},{key:"changeSubTitleLang",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.currentLang=e,e?this.open(t):this.close()}},{key:"toggleSubTitle",value:function(){var e;null===(e=this.player.getPlugin("LiveSubtitlesPlugin"))||void 0===e||e.setCurrentLang(this.isOpenState?this.currentLang:"")}},{key:"destroy",value:function(){var e;this.unbind(["click"],this.handleButtonChange.bind(this)),this.unbind(["mouseenter"],this.showPanel.bind(this)),this.unbind(["mouseleave"],this.hidePanel.bind(this)),null===(e=this.optionList)||void 0===e||e.destroy()}},{key:"render",value:function(){return'\n <xg-icon class="xgplayer-aisub">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="subOpen">'.concat(this.langText.subOpen,"</div>\n </xg-icon>\n ")}}],[{key:"pluginName",get:function(){return"LiveSubtitlesIconPlugin"}},{key:"defaultConfig",get:function(){return{position:POSITIONS$2.CONTROLS_RIGHT,index:2.7,defaultOpen:!0,default:"en",list:[{key:"zh",showText:"中文"},{key:"en",showText:"En"}]}}}]),r}(Plugin),DefinitionDemotePlugin=function(e){_inherits$5(r,e);var t=_createSuper$5(r);function r(e){var i;return _classCallCheck$5(this,r),(i=t.call(this,e)).waitings=[],i.longWaitingEmitTime=0,i.waitingStartTime=0,i.playerData=null,i.isNeedShowTips=!0,i.playerData=i.playerConfig.playerData,i}return _createClass$6(r,[{key:"registerLanguageTexts",value:function(){return{definition_demote_txt:{jp:"現在のネットワークは不安定です。に切り替えることをお勧めします",en:"The current network is unstable, it is recommended to switch to ",zh:"当前网络不稳定,建议切换到","zh-hk":"當前網絡不穩定,建議切換到"}}}},{key:"afterCreate",value:function(){this.bindCtx(),this.bindEvents()}},{key:"bindCtx",value:function(){this._count=this._count.bind(this),this._time=this._time.bind(this),this._waiting=this._waiting.bind(this),this._clearTime=this._clearTime.bind(this)}},{key:"bindEvents",value:function(){var e=this;this.on(WAITING,this._waiting),this.on(PLAYING,this._clearTime),this.on(PAUSE,this._clearTime),this.on(TIME_UPDATE,this._clearTime),this.on(PLAY,this._clearTime),this.on(CANPLAY,(function(){e.isNeedShowTips=!0})),this.config.isNeedAutoDemote&&this.player.on(PluginEvents.LONG_WAITING,this.demote.bind(this))}},{key:"_waiting",value:function(){this._count(),this._time()}},{key:"_count",value:function(){var e=Date.now();if(this.waitings.push(e),this.waitings.length===this.config.oftenWaitingCount){var t=this.waitings.shift();t&&e-t<=this.config.oftenWaitingTime&&(this.player.emit(PluginEvents.OFTEN_WAITING),this.clearState())}}},{key:"_time",value:function(){var e=this;if(this.timer)console.log("连续触发了waiting,距离上次waiting时间:",Date.now()-this.waitingStartTime);else{this.waitingStartTime=Date.now();var t=this.player.currentTime;this.timer=setTimeout((function(){e.player&&e.player.currentTime<=t+.1&&(console.log("waiting持续时间超过 ".concat(e.config.longWaitingTime," 秒")),e.player.emit(PluginEvents.LONG_WAITING),e.clearState())}),this.config.longWaitingTime)}}},{key:"_clearTime",value:function(){this.waitingStartTime&&console.log("waiting持续时长:",Date.now()-this.waitingStartTime),this.clearState()}},{key:"clearState",value:function(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.waitings.length>0&&(this.waitings=[]),this.waitingStartTime&&(this.waitingStartTime=0)}},{key:"demote",value:function(){if(this.playerData){var e=this.playerData.getNextDefinition(!0,this.config.demotePriority),t=null==e?void 0:e[0];if(t){var r=t.definition;if(r){var i=this.playerData.current.definition;if(this.player.emit(PluginEvents.DEFINITION_DEMOTE,{currentDef:i,willChangeDef:r,next:t}),"auto"===i){var n=t.url;this.changeUrl(n)}else r!==i&&this.showToast(t)}}}}},{key:"changeUrl",value:function(e){this.player&&e&&(this.player.config.url=e,this.player.switchURL(e,!1),this.player.emit(PluginEvents.PlAY_URL_CHANGE,{url:e,from:"definition_demote"}))}},{key:"showToast",value:function(e){var t,r=this,i=null===(t=this.player)||void 0===t?void 0:t.getPlugin("sdkToastPlugin");if(i&&this.isNeedShowTips){var n=this.i18n[e.definitionTextKey]||e.definitionTextKey||e.definition,o=util.createDom("div",this.langText.definition_demote_txt,void 0,"toast-txt"),a=util.createDom("span",n,void 0,"toast-txt-bt");o.appendChild(a);var s=i.add(o,5e3,!0);a.addEventListener("click",(function(){r.playerData&&(r.playerData.current.definition=e.definition,i.remove(s))})),this.isNeedShowTips=!1,setTimeout((function(){r.isNeedShowTips=!0}),3e4)}}},{key:"destroy",value:function(){this.clearState()}}],[{key:"pluginName",get:function(){return"DefinitionDemotePlugin"}},{key:"defaultConfig",get:function(){return{oftenWaitingCount:3,oftenWaitingTime:5e3,longWaitingTime:5e3,isNeedAutoDemote:!1,demotePriority:[]}}}]),r}(Plugin),formatTime=function(e){var t=Math.floor(e/3600),r=e%3600,i=Math.floor(r/60),n=Math.round(r%60);return t>0?(i<10&&(i="0"+i),n<10&&(n="0"+n),"".concat(t,":").concat(i,":").concat(n)):(n<10&&(n="0"+n),"".concat(i,":").concat(n))},POSITIONS$1=Plugin.POSITIONS,UpperLimit=604800,MinMoveTime=6,TimeShiftPlugin=function(e){_inherits$5(r,e);var t=_createSuper$5(r);function r(){var e;return _classCallCheck$5(this,r),(e=t.apply(this,arguments)).isMobile="mobile"===sniffer$1.device,e.playedBar=null,e.cachedBar=null,e.innerBar=null,e.progressBtn=null,e.progressPoint=null,e.backLiveBt=null,e.cardDomList=[],e.initTime=0,e.liveGap=0,e.shiftTimeGap=0,e.isProgressMoving=!1,e.isPlayTimeShift=!1,e.liveUrl="",e.onBodyClick=function(e){e.preventDefault(),e.stopPropagation(),util.event(e)},e}return _createClass$6(r,[{key:"duration",get:function(){var e,t=this.liveGap+Math.floor(Date.now()/1e3-this.initTime),r=(null!==(e=this.config)&&void 0!==e?e:{}).maxMoveTime;return r&&t>r?r:t>UpperLimit?UpperLimit:t}},{key:"registerLanguageTexts",value:function(){return{BACKLIVE:{jp:"ライブに戻る",en:"Back to live",zh:"返回直播","zh-hk":"返回直播"}}}},{key:"updateLang",value:function(){this.backLiveBt&&(this.backLiveBt.innerHTML=this.langText.BACKLIVE)}},{key:"afterCreate",value:function(){this.liveUrl=this.player.config.url,this.playedBar=this.find(".xgplayer-progress-played"),this.cachedBar=this.find(".xgplayer-progress-cache"),this.progressBtn=this.find(".xgplayer-progress-btn"),this.progressPoint=this.find(".xgplayer-shift-progress-point"),this.innerBar=this.find(".xgplayer-progress-inner"),this.createBackLiveBtDom(),this.clacTime(),this.initEvents(),this.bindDomEvents(),this.isMobile||this.createTimeShiftCard()}},{key:"clacTime",value:function(){var e,t=null!==(e=this.config)&&void 0!==e?e:{},r=t.livingStartTime,i=t.currentTime;this.initTime=Math.floor(Date.now()/1e3),this.liveGap=Math.floor(i-r)}},{key:"initEvents",value:function(){this.on(TIME_UPDATE,this.handleTimeUpdate.bind(this))}},{key:"bindDomEvents",value:function(){if(this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseEnter=this.handleMouseEnter.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.tipsUpdate=this.tipsUpdate.bind(this),this.isMobile){this.bind("touchstart",this.handleMouseDown);var e=this.player.controls;e&&(e.root&&e.root.addEventListener("touchmove",util.stopPropagation),e.center&&e.center.addEventListener("touchend",util.stopPropagation))}else this.bind("mousedown",this.handleMouseDown),this.bind("mouseenter",this.handleMouseEnter)}},{key:"handleTimeUpdate",value:function(){this.isProgressMoving||this.progressUpdate()}},{key:"handleMouseDown",value:function(e){if(e.target!==this.backLiveBt){this.onBodyClick(e),this.focus(),util.addClass(this.progressBtn,"active");var t=this.computeTime(e);this.updateShiftTime(t.percent),this.isProgressMoving=!0,this.isMobile?(this.bind("touchmove",this.handleMouseMove),this.bind("touchend",this.handleMouseUp)):(document.addEventListener("mousemove",this.handleMouseMove,!1),document.addEventListener("mouseup",this.handleMouseUp,!1))}}},{key:"handleMouseMove",value:function(e){this.onBodyClick(e);var t=this.computeTime(e);this.updateShiftTime(t.percent)}},{key:"handleMouseUp",value:function(e){this.onBodyClick(e),this.isProgressMoving=!1,util.removeClass(this.progressBtn,"active"),this.changeTimeUrl(),this.isMobile?(this.unbind("touchmove",this.handleMouseMove),this.unbind("touchend",this.handleMouseUp)):(document.removeEventListener("mousemove",this.handleMouseMove,!1),document.removeEventListener("mouseup",this.handleMouseUp,!1))}},{key:"handleMouseEnter",value:function(e){this.bind("mouseleave",this.handleMouseLeave),this.bind("mousemove",this.tipsUpdate),this.tipsUpdate(e),this.focus()}},{key:"handleMouseLeave",value:function(){this.unbind("mouseleave",this.handleMouseLeave),this.unbind("mousemove",this.tipsUpdate),this.blur()}},{key:"focus",value:function(){this.player.controls.pauseAutoHide(),util.addClass(this.root,"active")}},{key:"blur",value:function(){this.player.controls.recoverAutoHide(),util.removeClass(this.root,"active")}},{key:"computeTime",value:function(e){var t,r,i,n=this.player,o=this.root.getBoundingClientRect(),a=o.width,s=o.height,l=o.top,c=o.left,u=util.getEventPos(e,n.zoom);90===n.rotateDeg?(t=s,r=l,i=u.clientY):(t=a,r=c,i=u.clientX);var h=i-r,d=(h=h>t?t:h<0?0:h)/t;return{percent:d=d<0?0:d>1?1:d,offset:h,width:t,left:r,e:e}}},{key:"tipsUpdate",value:function(e){var t=this.computeTime(e),r=Math.floor(this.duration*(1-t.percent));this.progressPoint.style.left="".concat(100*t.percent,"%"),this.progressPoint.innerHTML="-".concat(formatTime(r))}},{key:"updateShiftTime",value:function(e){this.shiftTimeGap=Math.floor(this.duration*(1-e)),this.progressUpdate()}},{key:"getCurrentProgress",value:function(){return Math.floor(this.duration-this.shiftTimeGap)}},{key:"progressUpdate",value:function(){var e=this.getCurrentProgress()/this.duration;this.progressBtn.style.left="".concat(100*e,"%"),this.playedBar.style.width="".concat(100*e,"%"),this.cardProcessUpdate()}},{key:"changeTimeShift",value:function(e){var t=this.calcCardProcess(e);t<0||(this.updateShiftTime(t),this.changeTimeUrl())}},{key:"changeTimeUrl",value:function(){var e=this.config.timeShiftUrl,t="";this.isPlayTimeShift=!0,this.toggleBackButton();var r=this.shiftTimeGap<MinMoveTime?MinMoveTime:this.shiftTimeGap;t=e?e.replace("{}",r):addUrlParam(this.liveUrl,{timeshift:r}),this.player.src=t,this.player.config.url=t,this.player.emit(PluginEvents.TIME_SHIFT_CHANGE,!0),this.player.emit(PluginEvents.PlAY_URL_CHANGE,{shiftUrl:t,from:PluginEvents.TIME_SHIFT_CHANGE})}},{key:"createBackLiveBtDom",value:function(){var e,t=this;if(this.backLiveBt)return this.backLiveBt;this.backLiveBt=util.createDom("xg-back-live-bt",this.langText.BACKLIVE,void 0,"xgplayer-back-live-bt"),this.backLiveBt.addEventListener("click",(function(e){t.onBodyClick(e),t.backLive()})),null===(e=this.player.root)||void 0===e||e.appendChild(this.backLiveBt)}},{key:"backLive",value:function(){this.liveUrl&&(this.player.src=this.liveUrl,this.player.config.url=this.liveUrl,this.shiftTimeGap=0,this.isPlayTimeShift=!1,this.toggleBackButton(),this.player.emit(PluginEvents.TIME_SHIFT_CHANGE,!1),this.player.emit(PluginEvents.PlAY_URL_CHANGE,{url:this.liveUrl,from:PluginEvents.TIME_SHIFT_CHANGE}))}},{key:"toggleBackButton",value:function(){this.backLiveBt&&(this.backLiveBt.style.display=this.isPlayTimeShift?"flex":"none")}},{key:"updateCardList",value:function(e){this.config.cardList=_toConsumableArray$1(e),this.clearCardDom(),this.createTimeShiftCard()}},{key:"clearCardDom",value:function(){var e=this;this.cardDomList.forEach((function(t){t.dom&&e.innerBar.contains(t.dom)&&e.innerBar.removeChild(t.dom)})),this.cardDomList=[]}},{key:"createTimeShiftCard",value:function(){var e,t=this;(null===(e=this.config.cardList)||void 0===e?void 0:e.length)<=0||this.config.cardList.forEach((function(e){t.renderCard(e)}))}},{key:"renderCard",value:function(e){if(e.img){var t=util.createDom("xg-card","",void 0,"xgplayer-shift-progress-card"),r=util.createDom("img","",{src:e.img},"xgplayer-shift-progress-card-img"),i=util.createDom("div","",void 0,"xgplayer-shift-progress-card-point");t.appendChild(r),t.appendChild(i),this.cardDomList.push(_objectSpread2$5(_objectSpread2$5({},e),{},{dom:t}))}}},{key:"cardProcessUpdate",value:function(){var e=this;0!==this.cardDomList.length&&this.cardDomList.forEach((function(t){if(t.dom){var r=e.calcCardProcess(t.timestamp);if(!(r>1)){var i=e.innerBar.contains(t.dom);r<0?i&&e.innerBar.removeChild(t.dom):(i||e.innerBar.appendChild(t.dom),t.dom.style.left="".concat(100*r,"%"))}}}))}},{key:"calcCardProcess",value:function(e){var t,r=null!==(t=this.config)&&void 0!==t?t:{},i=r.maxMoveTime,n=r.livingStartTime,o=this.liveGap+Math.floor(Date.now()/1e3-this.initTime);return i&&o>i&&(n=o-i),e<n?-1:(e-n)/this.duration}},{key:"destroy",value:function(){if(this.off(TIME_UPDATE,this.handleTimeUpdate.bind(this)),this.isMobile){this.unbind("touchstart",this.handleMouseDown);var e=this.player.controls;e&&(e.root&&e.root.removerEventListener("touchmove",util.stopPropagation),e.center&&e.center.removerEventListener("touchend",util.stopPropagation))}else this.unbind("mousedown",this.handleMouseDown),this.unbind("mouseenter",this.handleMouseEnter);var t;this.backLiveBt&&(null===(t=this.player.root)||void 0===t||t.removeChild(this.backLiveBt),this.backLiveBt=null)}},{key:"render",value:function(){if(this.config.disable)return"";var e=this.player.controls?this.player.controls.config.mode:"";return'\n <xg-progress class="xgplayer-progress '.concat("bottom"===e?"xgplayer-progress-bottom":"",' xgplayer-shift">\n <xg-outer class="xgplayer-progress-outer">\n <xg-inners class="progress-list">\n <xg-inner class="xgplayer-progress-inner" style="flex: 1">\n <xg-cache class="xgplayer-progress-cache" style="width: 100%;"></xg-cache>\n <xg-played class="xgplayer-progress-played" style="width: 100%;"></xg-played>\n </xg-inner>\n </xg-inners>\n <xg-progress-btn class="xgplayer-progress-btn"></xg-progress-btn>\n <xg-point class="xgplayer-shift-progress-point">00:00</xg-point>\n </xg-outer>\n </xg-progress>\n ')}}],[{key:"pluginName",get:function(){return"TimeShiftPlugin"}},{key:"defaultConfig",get:function(){return{position:POSITIONS$1.CONTROLS_CENTER,livingStartTime:Date.now()/1e3,maxMoveTime:0,currentTime:Date.now()/1e3,timeShiftUrl:"",cardList:[]}}}]),r}(Plugin);function GetMirrorSvg(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 18 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M8.5 0.199997C8.5 0.0895386 8.5896 0 8.69995 0H9.30005C9.4104 0 9.5 0.0895386 9.5 0.199997V1.8C9.5 1.91046 9.4104 2 9.30005 2H8.69995C8.5896 2 8.5 1.91046 8.5 1.8V0.199997Z" fill="white"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M0 1.95424C0 1.85173 0.0773926 1.76582 0.179443 1.75529L7.27954 1.02277C7.34546 1.01596 7.40649 1.04182 7.44751 1.08664C7.47998 1.12207 7.5 1.16936 7.5 1.22171V14.7783C7.5 14.8969 7.39746 14.9894 7.27954 14.9773L0.179443 14.2447C0.0773926 14.2342 0 14.1483 0 14.0458V1.95424ZM1.5 12.873V3.12701L6 2.66273V13.3373L1.5 12.873Z" fill="white"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M18 1.95424C18 1.85173 17.9226 1.76582 17.8206 1.75529L10.7205 1.02277C10.6025 1.01059 10.5 1.10313 10.5 1.22171V14.7783C10.5 14.8969 10.6025 14.9894 10.7205 14.9773L17.8206 14.2447C17.9226 14.2342 18 14.1483 18 14.0458V1.95424ZM16.5 3.12701L12 2.66273V13.3373L16.5 12.873V3.12701Z" fill="white"/>\n <path d="M8.69995 3C8.5896 3 8.5 3.08954 8.5 3.2V4.8C8.5 4.91046 8.5896 5 8.69995 5H9.30005C9.32642 5 9.35156 4.9949 9.37451 4.98564C9.39111 4.97896 9.40674 4.97011 9.4209 4.95944C9.46899 4.92293 9.5 4.8651 9.5 4.8V3.2C9.5 3.14664 9.47925 3.09818 9.44507 3.06232C9.40869 3.02393 9.35718 3 9.30005 3H8.69995Z" fill="white"/>\n <path d="M8.5 6.2C8.5 6.08954 8.5896 6 8.69995 6H9.30005C9.34277 6 9.38232 6.01344 9.41479 6.03635C9.46631 6.07254 9.5 6.13234 9.5 6.2V7.8C9.5 7.85072 9.48096 7.89703 9.44995 7.9323C9.41821 7.96826 9.37354 7.99272 9.32373 7.99861C9.31592 7.99953 9.30811 8 9.30005 8H8.69995C8.5896 8 8.5 7.91046 8.5 7.8V6.2Z" fill="white"/>\n <path d="M8.53711 9.08395C8.51367 9.11667 8.5 9.15674 8.5 9.20001V10.8C8.5 10.9105 8.5896 11 8.69995 11H9.30005C9.4104 11 9.5 10.9105 9.5 10.8V9.20001C9.5 9.08954 9.4104 9 9.30005 9H8.69995C8.68384 9 8.66821 9.00189 8.65332 9.00546C8.60571 9.01688 8.5647 9.04529 8.53711 9.08395Z" fill="white"/>\n <path d="M8.5 12.2C8.5 12.1371 8.52905 12.081 8.57446 12.0443C8.60864 12.0166 8.65234 12 8.69995 12H9.30005C9.4104 12 9.5 12.0895 9.5 12.2V13.8C9.5 13.8664 9.46753 13.9253 9.41772 13.9616C9.38477 13.9857 9.34399 14 9.30005 14H8.69995C8.5896 14 8.5 13.9105 8.5 13.8V12.2Z" fill="white"/>\n <path d="M8.69995 15C8.5896 15 8.5 15.0895 8.5 15.2V15.8C8.5 15.9105 8.5896 16 8.69995 16H9.30005C9.4104 16 9.5 15.9105 9.5 15.8V15.2C9.5 15.0895 9.4104 15 9.30005 15H8.69995Z" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}function ExitMirrorSvg(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 18 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M8.5 0.2C8.5 0.0895431 8.58954 0 8.7 0H9.3C9.41046 0 9.5 0.0895431 9.5 0.2V1.8C9.5 1.91046 9.41046 2 9.3 2H8.7C8.58954 2 8.5 1.91046 8.5 1.8V0.2Z" fill="white"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M0 1.95424C0 1.85173 0.0775055 1.76582 0.179474 1.7553L7.27947 1.02276C7.39742 1.01059 7.5 1.10313 7.5 1.2217V14.7783C7.5 14.8969 7.39742 14.9894 7.27947 14.9773L0.179474 14.2447C0.0775053 14.2342 0 14.1483 0 14.0458V1.95424ZM1.5 12.873V3.12702L6 2.66273V13.3373L1.5 12.873Z" fill="white"/>\n <path d="M17.8205 1.7553C17.9225 1.76582 18 1.85173 18 1.95424V14.0458C18 14.1483 17.9225 14.2342 17.8205 14.2447L10.7205 14.9773C10.6026 14.9894 10.5 14.8969 10.5 14.7783V1.2217C10.5 1.10313 10.6026 1.01059 10.7205 1.02276L17.8205 1.7553Z" fill="white"/>\n <path d="M8.7 3C8.58954 3 8.5 3.08954 8.5 3.2V4.8C8.5 4.91046 8.58954 5 8.7 5H9.3C9.41046 5 9.5 4.91046 9.5 4.8V3.2C9.5 3.08954 9.41046 3 9.3 3H8.7Z" fill="white"/>\n <path d="M8.5 6.2C8.5 6.08954 8.58954 6 8.7 6H9.3C9.41046 6 9.5 6.08954 9.5 6.2V7.8C9.5 7.91046 9.41046 8 9.3 8H8.7C8.58954 8 8.5 7.91046 8.5 7.8V6.2Z" fill="white"/>\n <path d="M8.7 9C8.58954 9 8.5 9.08954 8.5 9.2V10.8C8.5 10.9105 8.58954 11 8.7 11H9.3C9.41046 11 9.5 10.9105 9.5 10.8V9.2C9.5 9.08954 9.41046 9 9.3 9H8.7Z" fill="white"/>\n <path d="M8.5 12.2C8.5 12.0895 8.58954 12 8.7 12H9.3C9.41046 12 9.5 12.0895 9.5 12.2V13.8C9.5 13.9105 9.41046 14 9.3 14H8.7C8.58954 14 8.5 13.9105 8.5 13.8V12.2Z" fill="white"/>\n <path d="M8.7 15C8.58954 15 8.5 15.0895 8.5 15.2V15.8C8.5 15.9105 8.58954 16 8.7 16H9.3C9.41046 16 9.5 15.9105 9.5 15.8V15.2C9.5 15.0895 9.41046 15 9.3 15H8.7Z" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}var POSITIONS=Plugin.POSITIONS,MirrorStateKeys={GetMirror:"getMirror",ExitMirror:"exitMirror"},MirrorPlugin=function(e){_inherits$5(r,e);var t=_createSuper$5(r);function r(e){var i;return _classCallCheck$5(this,r),(i=t.call(this,e)).isEnableMirror=!0,i.isEnableMirror=i.config.defaultEnable,i}return _createClass$6(r,[{key:"afterCreate",value:function(){this.config.disable||(this.initIcons(),this.btnClick=this.btnClick.bind(this),this.bind(["touchend","click"],this.btnClick),this.updateMirrorState(this.isEnableMirror))}},{key:"registerIcons",value:function(){var e;return _defineProperty$6(e={},MirrorStateKeys.GetMirror,{icon:GetMirrorSvg,class:"xg-get-mirror"}),_defineProperty$6(e,MirrorStateKeys.ExitMirror,{icon:ExitMirrorSvg,class:"xg-exit-mirror"}),e}},{key:"initIcons",value:function(){var e=this.icons,t=this.find(".xgplayer-icon");t.appendChild(e[MirrorStateKeys.GetMirror]),t.appendChild(e[MirrorStateKeys.ExitMirror])}},{key:"registerLanguageTexts",value:function(){return{getMirror:{jp:"ミラーを開く",en:"Turn on mirroring",zh:"开启镜像","zh-hk":"開啟鏡像"},exitMirror:{jp:"ミラーを閉じる",en:"Turn off mirroring",zh:"关闭镜像","zh-hk":"關閉鏡像"}}}},{key:"btnClick",value:function(e){e.preventDefault(),e.stopPropagation(),this.isEnableMirror?this.action(!1):this.action(!0)}},{key:"action",value:function(e){this.isEnableMirror=e,this.updateMirrorState(this.isEnableMirror),this.player.emit(PluginEvents.MIRROR_CHANGE,this.isEnableMirror)}},{key:"updateMirrorState",value:function(e){var t=this.player;e?t.addClass("xgplayer-mirror"):t.removeClass("xgplayer-mirror"),this.animate(e)}},{key:"animate",value:function(e){this.root&&(e?this.setAttr("data-state","enable"):this.setAttr("data-state","normal"),this.switchTips(e))}},{key:"switchTips",value:function(e){this.changeLangTextKey(this.find(".xg-tips"),e?MirrorStateKeys.ExitMirror:MirrorStateKeys.GetMirror)}},{key:"destroy",value:function(){this.unbind(["click","touchend"],this.btnClick)}},{key:"render",value:function(){if(!this.config.disable)return'<xg-icon class=\'xgplayer-mirror-icon\'>\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="mirror">'.concat(this.langText[MirrorStateKeys.GetMirror],"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"mirrorPlugin"}},{key:"defaultConfig",get:function(){return{position:POSITIONS.CONTROLS_RIGHT,index:CONTROL_ICON_INDEX.mirrorPlugin,disable:!1,defaultEnable:!1}}}]),r}(Plugin);function retPromise(e){return e&&e.then?e:new Promise((function(t){t(e)}))}var MemoryPlay=function(e){_inherits$5(r,e);var t=_createSuper$5(r);function r(e){var i;return _classCallCheck$5(this,r),(i=t.call(this,e)).memoryId="",i.canJump=!1,i.saveTimeFun=util.checkIsFunction(i.config.saveTime)?i.config.saveTime:i.saveTimeByStorage,i.getTimeFun=util.checkIsFunction(i.config.getTime)?i.config.getTime:i.getTimeByStorage,i.startTime=0,i.memoryId=i.config.memoryId,i.showToast=i.showToast.bind(_assertThisInitialized$5(i)),i}return _createClass$6(r,[{key:"registerLanguageTexts",value:function(){return{preText:{jp:"に位置付けられました",en:"Has located for you to ",zh:"已为您定位至","zh-hk":"已為您定位至"}}}},{key:"children",value:function(){return{toast:ToastPlugin}}},{key:"afterCreate",value:function(){this.once(CANPLAY,this.showToast)}},{key:"beforePlayerInit",value:function(){return this.memoryId||(this.playerConfig.vid?this.memoryId=this.playerConfig.vid:this.player.url&&(this.memoryId=this.player.url.replace(/\?.*$/,""))),this.setSave(),this.getTime()}},{key:"destroy",value:function(){0!==this.player.currentTime&&this.player.currentTime!==this.player.duration&&this.saveTimeFun(this.memoryId,this.player.currentTime)}},{key:"getTime",value:function(){var e=this;return new Promise((function(t){retPromise(e.getTimeFun(e.memoryId)).then((function(r){var i=parseFloat(r);isNaN(i)||0===i?console.warn("the time got is invalid",r):(e.startTime=i,e.canJump=!0,e.playerConfig.startTime=e.startTime,"mobile"===sniffer$1.device&&e.player.once("canplay",(function(){e.player.currentTime=e.startTime}))),t()})).catch((function(e){console.error("getTime function occur error",e),t()}))}))}},{key:"setSave",value:function(){var e=this;document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&0!==e.player.currentTime&&e.player.currentTime!==e.player.duration&&e.saveTimeFun(e.memoryId,e.player.currentTime)})),document.addEventListener("pagehide",(function(){0!==e.player.currentTime&&e.player.currentTime!==e.player.duration&&e.saveTimeFun(e.memoryId,e.player.currentTime)})),window.addEventListener("beforeunload",(function(){0!==e.player.currentTime&&e.player.currentTime!==e.player.duration&&e.saveTimeFun(e.memoryId,e.player.currentTime)}))}},{key:"showToast",value:function(){if(this.canJump){var e,t=null===(e=this.player)||void 0===e?void 0:e.getPlugin("sdkToastPlugin");if(!t)return;var r=util.format(this.startTime);t.add("".concat(this.langText.preText).concat(r),4e3,!0)}}},{key:"saveTimeByStorage",value:function(e,t){localStorage.setItem(e,t)}},{key:"getTimeByStorage",value:function(e){return localStorage.getItem(e)}}],[{key:"pluginName",get:function(){return"memoryPlay"}},{key:"defaultConfig",get:function(){return{getTime:null,saveTime:null,memoryId:""}}}]),r}(Plugin),LiveInfoPanel=function(e){_inherits$5(r,e);var t=_createSuper$5(r);function r(){var e;return _classCallCheck$5(this,r),(e=t.apply(this,arguments))._infoItems=[],e}return _createClass$6(r,[{key:"streamType",get:function(){return this.playerConfig.playerData.getCurrentStreamType()}},{key:"afterCreate",value:function(){var e=this;["flv","hls"].includes(this.streamType)?(this.player.on("error",(function(){return e._handleError()})),this.player.on("loadeddata",(function(){return e._handleLoadedData()}))):this.close()}},{key:"registerLanguageTexts",value:function(){return{DECODEFPS:{en:"decodeFps",zh:"解码效率"},DECODECOST:{en:"decodeCost",zh:"解码消耗"},FORMAT:{en:"format",zh:"格式"},FPS:{en:"fps",zh:"帧率"},BITRATE:{en:"birate",zh:"码率"},GOP:{en:"GOP",zh:"GOP"},RESOLUTION:{en:"resolution",zh:"分辨率"},ENCODETYPE:{en:"encodeType",zh:"编码方式"},BUFFEREND:{en:"bufferEnd",zh:"buffer水位"},CURRENTTIME:{en:"currentTime",zh:"播放进度"}}}},{key:"_getDefaultInfo",value:function(e){var t={h265Title:{key:"h265Title",label:"H265解码",type:"title"},decodeEfficiency:{key:"decodeEfficiency",label:"解码效率",labelTextKey:"DECODEFPS",value:e.decodeFps,render:function(e){return e+"frames/s"}},decodeCost:{key:"decodeCost",label:"解码消耗",labelTextKey:"DECODECOST",value:e.decodeFps,render:function(e){return e?(1e3/e).toFixed()+"ms":""}}};return _objectSpread2$5({format:{key:"format",label:"格式",labelTextKey:"FORMAT",value:e.format},framerate:{key:"framerate",label:"帧率",labelTextKey:"FPS",value:e.fps,render:function(e){return"".concat(e," fps")}},bitrate:{key:"bitrate",label:"码率",labelTextKey:"BITRATE",value:e.bitrate,render:function(e){return"".concat(e/1e3," kbps")}},gop:{key:"gop",label:"GOP",labelTextKey:"GOP",value:e.gop,render:function(e){return"".concat(e," frames")}},resolution:{key:"resolution",label:"视频分辨率",labelTextKey:"RESOLUTION",value:{width:e.width,height:e.height},render:function(e){return"".concat(e.width," * ").concat(e.height)}},encodeType:{key:"encodeType",label:"编码方式",labelTextKey:"ENCODETYPE",value:e.encodeType},bufferEnd:{key:"bufferEnd",label:"buffer水位",labelTextKey:"BUFFEREND",value:e.bufferEnd},currentTime:{key:"currentTime",label:"播放进度",labelTextKey:"CURRENTTIME",value:e.currentTime,render:function(e){return e?e.toFixed(6)+"s":""}}},e.isOpenSoftDecoding&&this.config.showH265Info?t:{})}},{key:"_init",value:function(){var e=this,t=this._initDom(this._getInfoListData());this._infoItems=new Proxy(t,{set:function(t,r,i){return e._updateDom(t[r].dom,i),Reflect.set(t,r,i)}}),this._tick()}},{key:"_getStats",value:function(){var e,t;return"flv"===this.streamType?null===(e=this.player.plugins.flv)||void 0===e?void 0:e.getStats():"hls"===this.streamType?null===(t=this.player.plugins.hls)||void 0===t?void 0:t.getStats():{}}},{key:"_getInfoListData",value:function(){var e=this._getStats()||{};return this._getDefaultInfo(Object.assign(e,{format:"".concat(this.streamType,"_live"),isOpenSoftDecoding:"live-video"==this.playerConfig.mediaType}))}},{key:"_initDom",value:function(e){var t=this,r=this.find(".veplayer-livepanel-container");return r.innerHTML="",Object.values(e).forEach((function(e){var i=util.createDom("veplayer-livepanel-div","",void 0,"veplayer-livepanel-container-row");"title"===e.type?t._updateTitle(i,e):t._updateDom(i,e),r.appendChild(i),e.dom=i})),e}},{key:"_updateTitle",value:function(e,t){e.innerHTML="";var r=util.createDom("veplayer-livepanel-span",t.label,void 0,"veplayer-livepanel-container-row-title");e.appendChild(r)}},{key:"_updateDom",value:function(e,t){e.innerHTML="";var r=util.createDom("veplayer-livepanel-span",this._renderLabel(t),void 0,"veplayer-livepanel-container-row-label");if(e.appendChild(r),"title"!==t.type){var i=util.createDom("veplayer-livepanel-span",this._renderValue(t));e.appendChild(i)}}},{key:"_renderLabel",value:function(e){return e.labelTextKey&&this.langText[e.labelTextKey]}},{key:"_renderValue",value:function(e){return e.render?e.render(e.value):e.value}},{key:"_handleDataChange",value:function(){var e=this,t=this._getInfoListData();Object.values(this._infoItems).forEach((function(r){"title"!==r.type&&e._renderValue(r)!==e._renderValue(t[r.key])&&(e._infoItems[r.key]=_objectSpread2$5(_objectSpread2$5({},r),t[r.key]))}))}},{key:"_tick",value:function(){var e=this;this._pollTimer=setTimeout((function(){clearTimeout(e._pollTimer),e._poll(),e._tick()}),500)}},{key:"_poll",value:function(){this._handleDataChange()}},{key:"destroy",value:function(){clearTimeout(this._pollTimer)}},{key:"_handleError",value:function(){this._close()}},{key:"_handleLoadedData",value:function(){this.config.visible&&this._open()}},{key:"_open",value:function(){var e=this.find(".veplayer-livepanel-container");util.removeClass(e,"veplayer-livepanel-hidden"),this._init()}},{key:"_close",value:function(){var e=this.find(".veplayer-livepanel-container");util.addClass(e,"veplayer-livepanel-hidden"),clearTimeout(this._pollTimer)}},{key:"open",value:function(){this._open(),this.config.visible=!0}},{key:"close",value:function(){this._close(),this.config.visible=!1}},{key:"render",value:function(){return'\n <xg-livepanel class="xgplayer-livepanel">\n <xg-livepanel-container class="veplayer-livepanel-container '.concat(!this.config.visible&&"veplayer-livepanel-hidden",'">\n </xg-livepanel-container></xg-livepanel>\n ')}}],[{key:"pluginName",get:function(){return"LiveInfoPanel"}},{key:"defaultConfig",get:function(){return{visible:!0,showH265Info:!1}}}]),r}(Plugin),VePlayerUmd=function(e){_inherits$5(r,e);var t=_createSuper$5(r);function r(){return _classCallCheck$5(this,r),t.apply(this,arguments)}return _createClass$6(r)}(VePlayer);return VePlayerUmd.Music=MusicPreset,VePlayerUmd.LiveSubtitlesIconPlugin=LiveSubtitlesIconPlugin,VePlayerUmd.LiveSubtitlesPlugin=LiveSubTitlesPlugin,VePlayerUmd.DefinitionDemotePlugin=DefinitionDemotePlugin,VePlayerUmd.TimeShiftPlugin=TimeShiftPlugin,VePlayerUmd.MirrorPlugin=MirrorPlugin,VePlayerUmd.MemoryPlay=MemoryPlay,VePlayerUmd.Subtitle=Subtitle,VePlayerUmd.Service=dist,VePlayerUmd.LiveInfoPanel=LiveInfoPanel,VePlayerUmd.Event=Event$1,VePlayerUmd.getI18N=getI18N,VePlayerUmd.BasePlugin=BasePlugin,VePlayerUmd.Plugin=Plugin,VePlayerUmd.Sniffer=sniffer$1,VePlayerUmd.Util=util,VePlayerUmd.STATE_CLASS=STATE_CLASS,VePlayerUmd.I18N=I18N,VePlayerUmd.STATES=STATES,VePlayerUmd}));