@byteplus/veplayer 1.18.0-rc.5 → 1.18.0-rc.6

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.
Files changed (47) hide show
  1. package/index.d.ts +1086 -375
  2. package/index.min.css +1 -1
  3. package/index.min.js +2 -2
  4. package/lite.cjs +2 -0
  5. package/lite.cjs.css +1 -0
  6. package/lite.d.ts +644 -0
  7. package/lite.esm.css +1 -0
  8. package/lite.esm.mjs +2 -0
  9. package/lite.min.css +1 -0
  10. package/lite.min.js +2 -0
  11. package/package.json +25 -1
  12. package/plugin/hlsjs.js +1 -0
  13. package/plugin/modules/DashAbralgo.d.ts +2 -0
  14. package/plugin/modules/DashAbralgo.mjs +2 -0
  15. package/plugin/modules/XGVideo.d.ts +2 -0
  16. package/plugin/modules/XGVideo.mjs +2 -0
  17. package/plugin/modules/danmuMask.d.ts +2 -0
  18. package/plugin/modules/danmuMask.mjs +2 -0
  19. package/plugin/modules/danmujs.d.ts +2 -0
  20. package/plugin/modules/danmujs.mjs +3 -0
  21. package/plugin/modules/dash.d.ts +2 -0
  22. package/plugin/modules/dash.mjs +2 -0
  23. package/plugin/modules/flv.d.ts +2 -0
  24. package/plugin/modules/flv.mjs +2 -0
  25. package/plugin/modules/hls.d.ts +2 -0
  26. package/plugin/modules/hls.mjs +2 -0
  27. package/plugin/modules/hlsEncrypt.d.ts +2 -0
  28. package/plugin/modules/hlsEncrypt.mjs +2 -0
  29. package/plugin/modules/hlsjs.d.ts +2 -0
  30. package/plugin/modules/hlsjs.mjs +2 -0
  31. package/plugin/modules/hlsjsPro.d.ts +2 -0
  32. package/plugin/modules/hlsjsPro.mjs +2 -0
  33. package/plugin/modules/mp4Encrypt.d.ts +2 -0
  34. package/plugin/modules/mp4Encrypt.mjs +2 -0
  35. package/plugin/modules/preloader.d.ts +2 -0
  36. package/plugin/modules/preloader.mjs +2 -0
  37. package/plugin/modules/streamprobe.d.ts +2 -0
  38. package/plugin/modules/streamprobe.mjs +2 -0
  39. package/plugin/modules/vestrategy.d.ts +2 -0
  40. package/plugin/modules/vestrategy.mjs +2 -0
  41. package/plugin/modules/vestrategy_adapt_range.d.ts +2 -0
  42. package/plugin/modules/vestrategy_adapt_range.mjs +2 -0
  43. package/plugin/modules/vestrategy_h265.d.ts +2 -0
  44. package/plugin/modules/vestrategy_h265.mjs +2 -0
  45. package/plugin/modules/vestrategy_preload.d.ts +2 -0
  46. package/plugin/modules/vestrategy_preload.mjs +2 -0
  47. package/plugin/vestrategy.js +1 -1
package/lite.esm.mjs ADDED
@@ -0,0 +1,2 @@
1
+ // @byteplus/veplayer@1.18.0-rc.6 Built @8/21/2026, 4:50:01 PM
2
+ var _a,__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__pow=Math.pow,__defNormalProp=(e,t,i)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,__spreadValues=(e,t)=>{for(var i in t||(t={}))__hasOwnProp.call(t,i)&&__defNormalProp(e,i,t[i]);if(__getOwnPropSymbols)for(var i of __getOwnPropSymbols(t))__propIsEnum.call(t,i)&&__defNormalProp(e,i,t[i]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__objRest=(e,t)=>{var i={};for(var r in e)__hasOwnProp.call(e,r)&&t.indexOf(r)<0&&(i[r]=e[r]);if(null!=e&&__getOwnPropSymbols)for(var r of __getOwnPropSymbols(e))t.indexOf(r)<0&&__propIsEnum.call(e,r)&&(i[r]=e[r]);return i},__async=(e,t,i)=>new Promise(((r,n)=>{var o=e=>{try{s(i.next(e))}catch(e){n(e)}},a=e=>{try{s(i.throw(e))}catch(e){n(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(o,a);s((i=i.apply(e,t)).next())}));function listCacheClear(){this.__data__=[],this.size=0}function eq(e,t){return e===t||e!=e&&t!=t}function assocIndexOf(e,t){for(var i=e.length;i--;)if(eq(e[i][0],t))return i;return-1}var arrayProto=Array.prototype,splice=arrayProto.splice;function listCacheDelete(e){var t=this.__data__,i=assocIndexOf(t,e);return!(i<0)&&(i==t.length-1?t.pop():splice.call(t,i,1),--this.size,!0)}function listCacheGet(e){var t=this.__data__,i=assocIndexOf(t,e);return i<0?void 0:t[i][1]}function listCacheHas(e){return assocIndexOf(this.__data__,e)>-1}function listCacheSet(e,t){var i=this.__data__,r=assocIndexOf(i,e);return r<0?(++this.size,i.push([e,t])):i[r][1]=t,this}function ListCache(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var r=e[t];this.set(r[0],r[1])}}function stackClear(){this.__data__=new ListCache,this.size=0}function stackDelete(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i}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"==typeof global&&global&&global.Object===Object&&global;const freeGlobal$1=freeGlobal;var freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal$1||freeSelf||Function("return this")();const root$1=root;var Symbol$2=root$1.Symbol;const Symbol$3=Symbol$2;var 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),i=e[symToStringTag$1];try{e[symToStringTag$1]=void 0;var r=!0}catch(e){}var n=nativeObjectToString$1.call(e);return r&&(t?e[symToStringTag$1]=i: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$g(e){var t=typeof 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(e){if(!isObject$g(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__"];const coreJsData$1=coreJsData;var maskSrcKey=function(){var e=/[^.]+$/.exec(coreJsData$1&&coreJsData$1.keys&&coreJsData$1.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function isMasked(e){return!!maskSrcKey&&maskSrcKey in e}var funcProto$2=Function.prototype,funcToString$2=funcProto$2.toString;function toSource(e){if(null!=e){try{return funcToString$2.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,funcProto$1=Function.prototype,objectProto$d=Object.prototype,funcToString$1=funcProto$1.toString,hasOwnProperty$c=objectProto$d.hasOwnProperty,reIsNative=RegExp("^"+funcToString$1.call(hasOwnProperty$c).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative(e){return!(!isObject$g(e)||isMasked(e))&&(isFunction(e)?reIsNative:reIsHostCtor).test(toSource(e))}function getValue(e,t){return null==e?void 0:e[t]}function getNative(e,t){var i=getValue(e,t);return baseIsNative(i)?i:void 0}var Map$1=getNative(root$1,"Map");const Map$2=Map$1;var nativeCreate=getNative(Object,"create");const 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 i=t[e];return i===HASH_UNDEFINED$2?void 0:i}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 i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=nativeCreate$1&&void 0===t?HASH_UNDEFINED$1:t,this}function Hash(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var r=e[t];this.set(r[0],r[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 e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function getMapData(e,t){var i=e.__data__;return isKeyable(t)?i["string"==typeof t?"string":"hash"]:i.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 i=getMapData(this,e),r=i.size;return i.set(e,t),this.size+=i.size==r?0:1,this}function MapCache(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var r=e[t];this.set(r[0],r[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 i=this.__data__;if(i instanceof ListCache){var r=i.__data__;if(!Map$2||r.length<LARGE_ARRAY_SIZE$1-1)return r.push([e,t]),this.size=++i.size,this;i=this.__data__=new MapCache(r)}return i.set(e,t),this.size=i.size,this}function Stack(e){var t=this.__data__=new ListCache(e);this.size=t.size}function arrayEach(e,t){for(var i=-1,r=null==e?0:e.length;++i<r&&!1!==t(e[i],i,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$8=function(){try{var e=getNative(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();const defineProperty$9=defineProperty$8;function baseAssignValue(e,t,i){"__proto__"==t&&defineProperty$9?defineProperty$9(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i}var objectProto$a=Object.prototype,hasOwnProperty$9=objectProto$a.hasOwnProperty;function assignValue(e,t,i){var r=e[t];hasOwnProperty$9.call(e,t)&&eq(r,i)&&(void 0!==i||t in e)||baseAssignValue(e,t,i)}function copyObject(e,t,i,r){var n=!i;i||(i={});for(var o=-1,a=t.length;++o<a;){var s=t[o],l=r?r(i[s],e[s],s,i,e):void 0;void 0===l&&(l=e[s]),n?baseAssignValue(i,s,l):assignValue(i,s,l)}return i}function baseTimes(e,t){for(var i=-1,r=Array(e);++i<e;)r[i]=t(i);return r}function isObjectLike$1(e){return null!=e&&"object"==typeof e}var argsTag$3="[object Arguments]";function baseIsArguments(e){return isObjectLike$1(e)&&baseGetTag(e)==argsTag$3}var objectProto$9=Object.prototype,hasOwnProperty$8=objectProto$9.hasOwnProperty,propertyIsEnumerable$1=objectProto$9.propertyIsEnumerable,isArguments=baseIsArguments(function(){return arguments}())?baseIsArguments:function(e){return isObjectLike$1(e)&&hasOwnProperty$8.call(e,"callee")&&!propertyIsEnumerable$1.call(e,"callee")};const isArguments$1=isArguments;var isArray$6=Array.isArray;const isArray$7=isArray$6;function stubFalse(){return!1}var freeExports$2="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule$2=freeExports$2&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports$2=freeModule$2&&freeModule$2.exports===freeExports$2,Buffer$2=moduleExports$2?root$1.Buffer:void 0,nativeIsBuffer=Buffer$2?Buffer$2.isBuffer:void 0,isBuffer=nativeIsBuffer||stubFalse;const isBuffer$1=isBuffer;var MAX_SAFE_INTEGER$2=9007199254740991,reIsUint=/^(?:0|[1-9]\d*)$/;function isIndex(e,t){var i=typeof e;return!!(t=null==t?MAX_SAFE_INTEGER$2:t)&&("number"==i||"symbol"!=i&&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$4="[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$1(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$4]=typedArrayTags[regexpTag$3]=typedArrayTags[setTag$5]=typedArrayTags[stringTag$3]=typedArrayTags[weakMapTag$2]=!1;var freeExports$1="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule$1=freeExports$1&&"object"==typeof 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(e){}}();const nodeUtil$1=nodeUtil;var nodeIsTypedArray=nodeUtil$1&&nodeUtil$1.isTypedArray,isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray;const isTypedArray$1=isTypedArray;var objectProto$8=Object.prototype,hasOwnProperty$7=objectProto$8.hasOwnProperty;function arrayLikeKeys(e,t){var i=isArray$7(e),r=!i&&isArguments$1(e),n=!i&&!r&&isBuffer$1(e),o=!i&&!r&&!n&&isTypedArray$1(e),a=i||r||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(i){return e(t(i))}}var nativeKeys$1=overArg(Object.keys,Object);const nativeKeys$2=nativeKeys$1;var objectProto$6=Object.prototype,hasOwnProperty$6=objectProto$6.hasOwnProperty;function baseKeys(e){if(!isPrototype(e))return nativeKeys$2(e);var t=[];for(var i in Object(e))hasOwnProperty$6.call(e,i)&&"constructor"!=i&&t.push(i);return t}function isArrayLike(e){return null!=e&&isLength(e.length)&&!isFunction(e)}function keys$3(e){return isArrayLike(e)?arrayLikeKeys(e):baseKeys(e)}function baseAssign(e,t){return e&&copyObject(t,keys$3(t),e)}function nativeKeysIn(e){var t=[];if(null!=e)for(var i in Object(e))t.push(i);return t}var objectProto$5=Object.prototype,hasOwnProperty$5=objectProto$5.hasOwnProperty;function baseKeysIn(e){if(!isObject$g(e))return nativeKeysIn(e);var t=isPrototype(e),i=[];for(var r in e)("constructor"!=r||!t&&hasOwnProperty$5.call(e,r))&&i.push(r);return i}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"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,Buffer$1=moduleExports?root$1.Buffer:void 0,allocUnsafe=Buffer$1?Buffer$1.allocUnsafe:void 0;function cloneBuffer(e,t){if(t)return e.slice();var i=e.length,r=allocUnsafe?allocUnsafe(i):new e.constructor(i);return e.copy(r),r}function copyArray(e,t){var i=-1,r=e.length;for(t||(t=Array(r));++i<r;)t[i]=e[i];return t}function arrayFilter(e,t){for(var i=-1,r=null==e?0:e.length,n=0,o=[];++i<r;){var a=e[i];t(a,i,e)&&(o[n++]=a)}return o}function stubArray(){return[]}var objectProto$4=Object.prototype,propertyIsEnumerable=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.call(e,t)})))}:stubArray;const getSymbols$1=getSymbols;function copySymbols(e,t){return copyObject(e,getSymbols$1(e),t)}function arrayPush(e,t){for(var i=-1,r=t.length,n=e.length;++i<r;)e[n+i]=t[i];return e}var getPrototype=overArg(Object.getPrototypeOf,Object);const getPrototype$1=getPrototype;var nativeGetSymbols=Object.getOwnPropertySymbols,getSymbolsIn=nativeGetSymbols?function(e){for(var t=[];e;)arrayPush(t,getSymbols$1(e)),e=getPrototype$1(e);return t}:stubArray;const getSymbolsIn$1=getSymbolsIn;function copySymbolsIn(e,t){return copyObject(e,getSymbolsIn$1(e),t)}function baseGetAllKeys(e,t,i){var r=t(e);return isArray$7(e)?r:arrayPush(r,i(e))}function getAllKeys(e){return baseGetAllKeys(e,keys$3,getSymbols$1)}function getAllKeysIn(e){return baseGetAllKeys(e,keysIn,getSymbolsIn$1)}var DataView=getNative(root$1,"DataView");const DataView$1=DataView;var Promise$2=getNative(root$1,"Promise");const Promise$3=Promise$2;var Set$1=getNative(root$1,"Set");const Set$2=Set$1;var WeakMap$2=getNative(root$1,"WeakMap");const WeakMap$3=WeakMap$2;var mapTag$4="[object Map]",objectTag$3="[object Object]",promiseTag="[object Promise]",setTag$4="[object Set]",weakMapTag$1="[object WeakMap]",dataViewTag$3="[object DataView]",dataViewCtorString=toSource(DataView$1),mapCtorString=toSource(Map$2),promiseCtorString=toSource(Promise$3),setCtorString=toSource(Set$2),weakMapCtorString=toSource(WeakMap$3),getTag=baseGetTag;(DataView$1&&getTag(new DataView$1(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),i=t==objectTag$3?e.constructor:void 0,r=i?toSource(i):"";if(r)switch(r){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});const getTag$1=getTag;var objectProto$3=Object.prototype,hasOwnProperty$4=objectProto$3.hasOwnProperty;function initCloneArray(e){var t=e.length,i=new e.constructor(t);return t&&"string"==typeof e[0]&&hasOwnProperty$4.call(e,"index")&&(i.index=e.index,i.input=e.input),i}var Uint8Array$1=root$1.Uint8Array;const Uint8Array$2=Uint8Array$1;function cloneArrayBuffer(e){var t=new e.constructor(e.byteLength);return new Uint8Array$2(t).set(new Uint8Array$2(e)),t}function cloneDataView(e,t){var i=t?cloneArrayBuffer(e.buffer):e.buffer;return new e.constructor(i,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 i=t?cloneArrayBuffer(e.buffer):e.buffer;return new e.constructor(i,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,i){var r=e.constructor;switch(t){case arrayBufferTag$2:return cloneArrayBuffer(e);case boolTag$2:case dateTag$2:return new r(+e);case dataViewTag$2:return cloneDataView(e,i);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,i);case mapTag$3:return new r;case numberTag$2:case stringTag$2:return new r(e);case regexpTag$2:return cloneRegExp(e);case setTag$3:return new r;case symbolTag$3:return cloneSymbol(e)}}var objectCreate$1=Object.create,baseCreate=function(){function e(){}return function(t){if(!isObject$g(t))return{};if(objectCreate$1)return objectCreate$1(t);e.prototype=t;var i=new e;return e.prototype=void 0,i}}();const 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$1(e)&&getTag$1(e)==mapTag$2}var nodeIsMap=nodeUtil$1&&nodeUtil$1.isMap,isMap=nodeIsMap?baseUnary(nodeIsMap):baseIsMap;const isMap$1=isMap;var setTag$2="[object Set]";function baseIsSet(e){return isObjectLike$1(e)&&getTag$1(e)==setTag$2}var nodeIsSet=nodeUtil$1&&nodeUtil$1.isSet,isSet=nodeIsSet?baseUnary(nodeIsSet):baseIsSet;const isSet$1=isSet;var 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$2="[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,i,r,n,o){var a,s=t&CLONE_DEEP_FLAG$1,l=t&CLONE_FLAT_FLAG,c=t&CLONE_SYMBOLS_FLAG$1;if(i&&(a=n?i(e,r,n,o):i(e)),void 0!==a)return a;if(!isObject$g(e))return e;var u=isArray$7(e);if(u){if(a=initCloneArray(e),!s)return copyArray(e,a)}else{var d=getTag$1(e),h=d==funcTag||d==genTag;if(isBuffer$1(e))return cloneBuffer(e,s);if(d==objectTag$2||d==argsTag$1||h&&!n){if(a=l||h?{}:initCloneObject(e),!s)return l?copySymbolsIn(e,baseAssignIn(a,e)):copySymbols(e,baseAssign(a,e))}else{if(!cloneableTags[d])return n?e:{};a=initCloneByTag(e,d,s)}}o||(o=new Stack);var p=o.get(e);if(p)return p;o.set(e,a),isSet$1(e)?e.forEach((function(r){a.add(baseClone(r,t,i,r,e,o))})):isMap$1(e)&&e.forEach((function(r,n){a.set(n,baseClone(r,t,i,n,e,o))}));var f=u?void 0:(c?l?getAllKeysIn:getAllKeys:l?keysIn:keys$3)(e);return arrayEach(f||e,(function(r,n){f&&(r=e[n=r]),assignValue(a,n,baseClone(r,t,i,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$2]=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)}function assignMergeValue(e,t,i){(void 0!==i&&!eq(e[t],i)||void 0===i&&!(t in e))&&baseAssignValue(e,t,i)}function createBaseFor(e){return function(t,i,r){for(var n=-1,o=Object(t),a=r(t),s=a.length;s--;){var l=a[e?s:++n];if(!1===i(o[l],l,o))break}return t}}var baseFor=createBaseFor();const baseFor$1=baseFor;function isArrayLikeObject(e){return isObjectLike$1(e)&&isArrayLike(e)}var objectTag$1="[object Object]",funcProto=Function.prototype,objectProto$2=Object.prototype,funcToString=funcProto.toString,hasOwnProperty$3=objectProto$2.hasOwnProperty,objectCtorString=funcToString.call(Object);function isPlainObject(e){if(!isObjectLike$1(e)||baseGetTag(e)!=objectTag$1)return!1;var t=getPrototype$1(e);if(null===t)return!0;var i=hasOwnProperty$3.call(t,"constructor")&&t.constructor;return"function"==typeof i&&i instanceof i&&funcToString.call(i)==objectCtorString}function safeGet(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}function toPlainObject(e){return copyObject(e,keysIn(e))}function baseMergeDeep(e,t,i,r,n,o,a){var s=safeGet(e,i),l=safeGet(t,i),c=a.get(l);if(c)assignMergeValue(e,i,c);else{var u=o?o(s,l,i+"",e,t,a):void 0,d=void 0===u;if(d){var h=isArray$7(l),p=!h&&isBuffer$1(l),f=!h&&!p&&isTypedArray$1(l);u=l,h||p||f?isArray$7(s)?u=s:isArrayLikeObject(s)?u=copyArray(s):p?(d=!1,u=cloneBuffer(l,!0)):f?(d=!1,u=cloneTypedArray(l,!0)):u=[]:isPlainObject(l)||isArguments$1(l)?(u=s,isArguments$1(s)?u=toPlainObject(s):isObject$g(s)&&!isFunction(s)||(u=initCloneObject(l))):d=!1}d&&(a.set(l,u),n(u,l,r,o,a),a.delete(l)),assignMergeValue(e,i,u)}}function baseMerge(e,t,i,r,n){e!==t&&baseFor$1(t,(function(o,a){if(n||(n=new Stack),isObject$g(o))baseMergeDeep(e,t,a,i,baseMerge,r,n);else{var s=r?r(safeGet(e,a),o,a+"",e,t,n):void 0;void 0===s&&(s=o),assignMergeValue(e,a,s)}}),keysIn)}function identity(e){return e}function apply$5(e,t,i){switch(i.length){case 0:return e.call(t);case 1:return e.call(t,i[0]);case 2:return e.call(t,i[0],i[1]);case 3:return e.call(t,i[0],i[1],i[2])}return e.apply(t,i)}var nativeMax$1=Math.max;function overRest(e,t,i){return t=nativeMax$1(void 0===t?e.length-1:t,0),function(){for(var r=arguments,n=-1,o=nativeMax$1(r.length-t,0),a=Array(o);++n<o;)a[n]=r[t+n];n=-1;for(var s=Array(t+1);++n<t;)s[n]=r[n];return s[t]=i(a),apply$5(e,this,s)}}function constant(e){return function(){return e}}var baseSetToString=defineProperty$9?function(e,t){return defineProperty$9(e,"toString",{configurable:!0,enumerable:!1,value:constant(t),writable:!0})}:identity;const baseSetToString$1=baseSetToString;var HOT_COUNT=800,HOT_SPAN=16,nativeNow=Date.now;function shortOut(e){var t=0,i=0;return function(){var r=nativeNow(),n=HOT_SPAN-(r-i);if(i=r,n>0){if(++t>=HOT_COUNT)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var setToString=shortOut(baseSetToString$1);const setToString$1=setToString;function baseRest(e,t){return setToString$1(overRest(e,t,identity),e+"")}function isIterateeCall(e,t,i){if(!isObject$g(i))return!1;var r=typeof t;return!!("number"==r?isArrayLike(i)&&isIndex(t,i.length):"string"==r&&t in i)&&eq(i[t],e)}function createAssigner(e){return baseRest((function(t,i){var r=-1,n=i.length,o=n>1?i[n-1]:void 0,a=n>2?i[2]:void 0;for(o=e.length>3&&"function"==typeof o?(n--,o):void 0,a&&isIterateeCall(i[0],i[1],a)&&(o=n<3?void 0:o,n=1),t=Object(t);++r<n;){var s=i[r];s&&e(t,s,r,o)}return t}))}var mergeWith=createAssigner((function(e,t,i,r){baseMerge(e,t,i,r)}));const mergeWith$1=mergeWith;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,i=null==e?0:e.length;for(this.__data__=new MapCache;++t<i;)this.add(e[t])}function arraySome(e,t){for(var i=-1,r=null==e?0:e.length;++i<r;)if(t(e[i],i,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,i,r,n,o){var a=i&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 d=-1,h=!0,p=i&COMPARE_UNORDERED_FLAG$3?new SetCache:void 0;for(o.set(e,t),o.set(t,e);++d<s;){var f=e[d],g=t[d];if(r)var y=a?r(g,f,d,t,e,o):r(f,g,d,e,t,o);if(void 0!==y){if(y)continue;h=!1;break}if(p){if(!arraySome(t,(function(e,t){if(!cacheHas(p,t)&&(f===e||n(f,e,i,r,o)))return p.push(t)}))){h=!1;break}}else if(f!==g&&!n(f,g,i,r,o)){h=!1;break}}return o.delete(e),o.delete(t),h}function mapToArray(e){var t=-1,i=Array(e.size);return e.forEach((function(e,r){i[++t]=[r,e]})),i}function setToArray(e){var t=-1,i=Array(e.size);return e.forEach((function(e){i[++t]=e})),i}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,i,r,n,o,a){switch(i){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$2(e),new Uint8Array$2(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=r&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;r|=COMPARE_UNORDERED_FLAG$2,a.set(e,t);var u=equalArrays(s(e),s(t),r,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$1=Object.prototype,hasOwnProperty$2=objectProto$1.hasOwnProperty;function equalObjects(e,t,i,r,n,o){var a=i&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$2.call(t,u)))return!1}var d=o.get(e),h=o.get(t);if(d&&h)return d==t&&h==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(r)var _=a?r(y,g,u,t,e,o):r(g,y,u,e,t,o);if(!(void 0===_?g===y||n(g,y,i,r,o):_)){p=!1;break}f||(f="constructor"==u)}if(p&&!f){var m=e.constructor,v=t.constructor;m==v||!("constructor"in e)||!("constructor"in t)||"function"==typeof m&&m instanceof m&&"function"==typeof v&&v instanceof v||(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=Object.prototype,hasOwnProperty$1=objectProto.hasOwnProperty;function baseIsEqualDeep(e,t,i,r,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,d=(c=c==argsTag?objectTag:c)==objectTag,h=l==c;if(h&&isBuffer$1(e)){if(!isBuffer$1(t))return!1;a=!0,u=!1}if(h&&!u)return o||(o=new Stack),a||isTypedArray$1(e)?equalArrays(e,t,i,r,n,o):equalByTag(e,t,l,i,r,n,o);if(!(i&COMPARE_PARTIAL_FLAG$2)){var p=u&&hasOwnProperty$1.call(e,"__wrapped__"),f=d&&hasOwnProperty$1.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,i,r,o)}}return!!h&&(o||(o=new Stack),equalObjects(e,t,i,r,n,o))}function baseIsEqual(e,t,i,r,n){return e===t||(null==e||null==t||!isObjectLike$1(e)&&!isObjectLike$1(t)?e!=e&&t!=t:baseIsEqualDeep(e,t,i,r,baseIsEqual,n))}var COMPARE_PARTIAL_FLAG$1=1,COMPARE_UNORDERED_FLAG$1=2;function baseIsMatch(e,t,i,r){var n=i.length,o=n,a=!r;if(null==e)return!o;for(e=Object(e);n--;){var s=i[n];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++n<o;){var l=(s=i[n])[0],c=e[l],u=s[1];if(a&&s[2]){if(void 0===c&&!(l in e))return!1}else{var d=new Stack;if(r)var h=r(c,u,l,e,t,d);if(!(void 0===h?baseIsEqual(u,c,COMPARE_PARTIAL_FLAG$1|COMPARE_UNORDERED_FLAG$1,r,d):h))return!1}}return!0}function isStrictComparable(e){return e==e&&!isObject$g(e)}function getMatchData(e){for(var t=keys$3(e),i=t.length;i--;){var r=t[i],n=e[r];t[i]=[r,n,isStrictComparable(n)]}return t}function matchesStrictComparable(e,t){return function(i){return null!=i&&(i[e]===t&&(void 0!==t||e in Object(i)))}}function baseMatches(e){var t=getMatchData(e);return 1==t.length&&t[0][2]?matchesStrictComparable(t[0][0],t[0][1]):function(i){return i===e||baseIsMatch(i,e,t)}}var symbolTag="[object Symbol]";function isSymbol$6(e){return"symbol"==typeof e||isObjectLike$1(e)&&baseGetTag(e)==symbolTag}var reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey(e,t){if(isArray$7(e))return!1;var i=typeof e;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=e&&!isSymbol$6(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 i=function(){var r=arguments,n=t?t.apply(this,r):r[0],o=i.cache;if(o.has(n))return o.get(n);var a=e.apply(this,r);return i.cache=o.set(n,a)||o,a};return i.cache=new(memoize.Cache||MapCache),i}memoize.Cache=MapCache;var MAX_MEMOIZE_SIZE=500;function memoizeCapped(e){var t=memoize(e,(function(e){return i.size===MAX_MEMOIZE_SIZE&&i.clear(),e})),i=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,i,r,n){t.push(r?n.replace(reEscapeChar,"$1"):i||e)})),t}));const stringToPath$1=stringToPath;function arrayMap(e,t){for(var i=-1,r=null==e?0:e.length,n=Array(r);++i<r;)n[i]=t(e[i],i,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$6(e))return symbolToString?symbolToString.call(e):"";var t=e+"";return"0"==t&&1/e==-INFINITY$2?"-0":t}function toString$f(e){return null==e?"":baseToString(e)}function castPath(e,t){return isArray$7(e)?e:isKey(e,t)?[e]:stringToPath$1(toString$f(e))}var INFINITY$1=1/0;function toKey(e){if("string"==typeof e||isSymbol$6(e))return e;var t=e+"";return"0"==t&&1/e==-INFINITY$1?"-0":t}function baseGet(e,t){for(var i=0,r=(t=castPath(t,e)).length;null!=e&&i<r;)e=e[toKey(t[i++])];return i&&i==r?e:void 0}function get$1(e,t,i){var r=null==e?void 0:baseGet(e,t);return void 0===r?i:r}function baseHasIn(e,t){return null!=e&&t in Object(e)}function hasPath(e,t,i){for(var r=-1,n=(t=castPath(t,e)).length,o=!1;++r<n;){var a=toKey(t[r]);if(!(o=null!=e&&i(e,a)))break;e=e[a]}return o||++r!=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(i){var r=get$1(i,e);return void 0===r&&r===t?hasIn(i,e):baseIsEqual(t,r,COMPARE_PARTIAL_FLAG|COMPARE_UNORDERED_FLAG)}}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 e?isArray$7(e)?baseMatchesProperty(e[0],e[1]):baseMatches(e):property(e)}function baseFindIndex(e,t,i,r){for(var n=e.length,o=i+(r?1:-1);r?o--:++o<n;)if(t(e[o],o,e))return o;return-1}function baseIsNaN(e){return e!=e}function strictIndexOf(e,t,i){for(var r=i-1,n=e.length;++r<n;)if(e[r]===t)return r;return-1}function baseIndexOf(e,t,i){return t==t?strictIndexOf(e,t,i):baseFindIndex(e,baseIsNaN,i)}function arrayIncludes$1(e,t){return!!(null==e?0:e.length)&&baseIndexOf(e,t,0)>-1}function arrayIncludesWith(e,t,i){for(var r=-1,n=null==e?0:e.length;++r<n;)if(i(t,e[r]))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;const createSet$1=createSet;var LARGE_ARRAY_SIZE=200;function baseUniq(e,t,i){var r=-1,n=arrayIncludes$1,o=e.length,a=!0,s=[],l=s;if(i)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(;++r<o;){var u=e[r],d=t?t(u):u;if(u=i||0!==u?u:0,a&&d==d){for(var h=l.length;h--;)if(l[h]===d)continue e;t&&l.push(d),s.push(u)}else n(l,d,i)||(l!==s&&l.push(d),s.push(u))}return s}function uniqBy(e,t){return e&&e.length?baseUniq(e,baseIteratee(t)):[]}const CodecType={H264:"h264",H265:"h265",H266:"h266",AAC:"aac",MP3:"mp3",OPUS:"opus",UNKNOWN:"unknown"},ContentType={[CodecType.H265]:'video/mp4; codecs="hev1.1.6.L120.90"',[CodecType.H264]:'video/mp4; codecs="avc1.42c01e"'};var EVideoFormat=(e=>(e.MP4="mp4",e.DASH="dash",e.HLS="hls",e))(EVideoFormat||{}),EAudioFormat=(e=>(e.M4A="m4a",e.MP4="mp4",e.MP3="mp3",e.DASH="dash",e.HLS="hls",e.OGG="ogg",e))(EAudioFormat||{}),EDRMTYPE=(e=>(e.DRM_ENCRYPT="drm_encrypt",e.PRIVATE_ENCRYPT="private_encrypt",e.PRIVATE_ENCRYPT_UPGRADE="private_encrypt_upgrade",e.STANDARD_ENCRYPT="standard_encrypt",e))(EDRMTYPE||{}),POSITIONS$8=(e=>(e.ROOT="root",e.ROOT_LEFT="rootLeft",e.ROOT_RIGHT="rootRight",e.ROOT_TOP="rootTop",e.CONTROLS_LEFT="controlsLeft",e.CONTROLS_RIGTH="controlsRight",e.CONTROLS_RIGHT="controlsRight",e.CONTROLS_CENTER="controlsCenter",e.CONTROLS="controls",e))(POSITIONS$8||{}),commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var proxy=function(){let e,t=null;function i(e){return!!e&&("object"==typeof e||"function"==typeof e)}function r(e){if(null!==e&&!i(e))throw new TypeError("Object prototype may only be an Object or null: "+e)}const n=Object,o=Boolean(n.create)||!({__proto__:null}instanceof n),a=n.create||(o?function(e){return r(e),{__proto__:e}}:function(e){if(r(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){const t=e.__proto__;return i(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(!i(c)||!i(u))throw new TypeError("Cannot create proxy with a non-object as target or handler");let d=function(){};t=function(){c=null,d=function(e){throw new TypeError(`Cannot perform '${e}' on a proxy that has been revoked`)}},setTimeout((function(){t=null}),0);const h=u;u={get:null,set:null,apply:null,construct:null};for(let e in h){if(!(e in u))throw new TypeError(`Proxy polyfill does not support trap '${e}'`);u[e]=h[e]}"function"==typeof h&&(u.apply=h.apply.bind(h));const p=l(c);let f,g=!1,y=!1;"function"==typeof c?(f=function(){const e=this&&this.constructor===f,t=Array.prototype.slice.call(arguments);if(d(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);return new(c.bind.apply(c,t))}return c.apply(this,t)},g=!0):c instanceof Array?(f=[],y=!0):f=o||null!==p?a(p):{};const _=u.get?function(e){return d("get"),u.get(this,e,f)}:function(e){return d("get"),this[e]},m=u.set?function(e,t){d("set"),u.set(this,e,t,f)}:function(e,t){d("set"),this[e]=t},v=n.getOwnPropertyNames(c),E={};v.forEach((function(e){if((g||y)&&e in f)return;const t=n.getOwnPropertyDescriptor(c,e),i={enumerable:Boolean(t.enumerable),get:_.bind(c,e),set:m.bind(c,e)};n.defineProperty(f,e,i),E[e]=!0}));let T=!0;if(g||y){const e=n.setPrototypeOf||([].__proto__===Array.prototype?function(e,t){return r(t),e.__proto__=t,e}:s);p&&e(f,p)||(T=!1)}if(u.get||!T)for(let e in c)E[e]||n.defineProperty(f,e,{get:_.bind(c,e)});return n.seal(c),n.seal(f),f},e.revocable=function(i,r){return{proxy:new e(i,r),revoke:t}},e};const ProxyPolyfill=getDefaultExportFromCjs(proxy),Proxy$1=ProxyPolyfill();class MyProxy{constructor(){this.subscribeId=0,this.watcherMap=new Map}observe(e){const t=new Proxy$1(e,{set:(e,i,r)=>{const n=Reflect.get(e,i);Reflect.set(e,i,r);const o=this.watcherMap.get(t);return o&&(this.flushCallback(o),this.flushPropertyCallback(o,i,n,r)),!0}});return this.watcherMap.set(t,{pending:!1,queue:[],property:{}}),t}subscribe(e,t){const i=this.watcherMap.get(e);if(!i)return;this.subscribeId++;return i.queue.push({id:this.subscribeId,callback:t}),this.subscribeId}unsubscribe(e,t){const i=this.watcherMap.get(e);if(!i)return;const r=i.queue,n=r.findIndex((e=>e.id===t));void 0!==n&&n>-1&&r.splice(n,1)}subscribeProperty(e,t,i){const r=this.watcherMap.get(e);if(r){this.subscribeId++,r.property[t]||(r.property[t]={pending:!1,timer:0,pre:null,queue:[]});return r.property[t].queue.push({id:this.subscribeId,callback:i}),this.subscribeId}}unsubscribeProperty(e,t,i){const r=this.watcherMap.get(e);if(r){const e=r.property[t];if(e){const t=e.queue,r=t.findIndex((e=>e.id===i));void 0!==r&&r>-1&&t.splice(r,1)}}}flushCallback(e){e.pending||(e.pending=!0,setTimeout((()=>{e.queue.forEach((e=>e.callback())),e.pending=!1}),0))}flushPropertyCallback(e,t,i,r){const n=e.property[t];n&&(clearTimeout(n.timer),!1===n.pending&&(n.pending=!0,n.pre=i),n.timer=setTimeout((()=>{n.queue.forEach((e=>e.callback(n.pre,r))),n.pending=!1}),0))}}const MyProxy$1=new MyProxy;function ownKeys$4(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,r)}return i}function _objectSpread2$2(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$4(Object(i),!0).forEach((function(t){_defineProperty$2(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):ownKeys$4(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,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$2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties$2(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_toPropertyKey$2(r.key),r)}}function _createClass$2(e,t,i){return t&&_defineProperties$2(e.prototype,t),i&&_defineProperties$2(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty$2(e,t,i){return(t=_toPropertyKey$2(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function _inherits$1(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf$1(e,t)}function _getPrototypeOf$1(e){return(_getPrototypeOf$1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _setPrototypeOf$1(e,t){return(_setPrototypeOf$1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function _isNativeReflectConstruct$1(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _assertThisInitialized$1(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _possibleConstructorReturn$1(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$1(e)}function _createSuper$1(e){var t=_isNativeReflectConstruct$1();return function(){var i,r=_getPrototypeOf$1(e);if(t){var n=_getPrototypeOf$1(this).constructor;i=Reflect.construct(r,arguments,n)}else i=r.apply(this,arguments);return _possibleConstructorReturn$1(this,i)}}function _superPropBase$1(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf$1(e)););return e}function _get$1(){return _get$1="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,i){var r=_superPropBase$1(e,t);if(r){var n=Object.getOwnPropertyDescriptor(r,t);return n.get?n.get.call(arguments.length<3?e:i):n.value}},_get$1.apply(this,arguments)}function _toConsumableArray$1(e){return _arrayWithoutHoles$1(e)||_iterableToArray$1(e)||_unsupportedIterableToArray$1(e)||_nonIterableSpread$1()}function _arrayWithoutHoles$1(e){if(Array.isArray(e))return _arrayLikeToArray$1(e)}function _iterableToArray$1(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 i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?_arrayLikeToArray$1(e,t):void 0}}function _arrayLikeToArray$1(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,r=new Array(t);i<t;i++)r[i]=e[i];return r}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 _toPrimitive$2(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!=typeof r)return r;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 t?t:String(t)}var eventemitter3={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,i="~";function r(){}function n(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function o(e,t,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new n(r,o||e,a),l=i?i+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 r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(i=!1)),s.prototype.eventNames=function(){var e,r,n=[];if(0===this._eventsCount)return n;for(r in e=this._events)t.call(e,r)&&n.push(i?r.slice(1):r);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},s.prototype.listeners=function(e){var t=i?i+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,o=r.length,a=new Array(o);n<o;n++)a[n]=r[n].fn;return a},s.prototype.listenerCount=function(e){var t=i?i+e:e,r=this._events[t];return r?r.fn?1:r.length:0},s.prototype.emit=function(e,t,r,n,o,a){var s=i?i+e:e;if(!this._events[s])return!1;var l,c,u=this._events[s],d=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){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,r),!0;case 4:return u.fn.call(u.context,t,r,n),!0;case 5:return u.fn.call(u.context,t,r,n,o),!0;case 6:return u.fn.call(u.context,t,r,n,o,a),!0}for(c=1,l=new Array(d-1);c<d;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var h,p=u.length;for(c=0;c<p;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),d){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,r);break;case 4:u[c].fn.call(u[c].context,t,r,n);break;default:if(!l)for(h=1,l=new Array(d-1);h<d;h++)l[h-1]=arguments[h];u[c].fn.apply(u[c].context,l)}}return!0},s.prototype.on=function(e,t,i){return o(this,e,t,i,!1)},s.prototype.once=function(e,t,i){return o(this,e,t,i,!0)},s.prototype.removeListener=function(e,t,r,n){var o=i?i+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||r&&s.context!==r||a(this,o);else{for(var l=0,c=[],u=s.length;l<u;l++)(s[l].fn!==t||n&&!s[l].once||r&&s[l].context!==r)&&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=i?i+e:e,this._events[t]&&a(this,t)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=i,s.EventEmitter=s,e.exports=s}(eventemitter3);var eventemitter3Exports=eventemitter3.exports;const EventEmitter=getDefaultExportFromCjs(eventemitter3Exports);var XG_DEBUG_OPEN="undefined"!=typeof window&&window.location&&window.location.href.indexOf("xgplayerdebugger=1")>-1,STYLE$1={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,i=arguments.length,r=new Array(i>1?i-1:0),n=1;n<i;n++)r[n-1]=arguments[n];this.config.debug>=3&&(t=console).log.apply(t,[XGTAG,STYLE$1.info,e].concat(r))},logWarn:function(e){for(var t,i=arguments.length,r=new Array(i>1?i-1:0),n=1;n<i;n++)r[n-1]=arguments[n];this.config.debug>=1&&(t=console).warn.apply(t,[XGTAG,STYLE$1.warn,e].concat(r))},logError:function(e){var t;if(!(this.config.debug<1)){for(var i=this.config.debug>=2?"trace":"error",r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];(t=console)[i].apply(t,[XGTAG,STYLE$1.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$2(this,e),this.bufferedList=t}return _createClass$2(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 i=0,r=t.length;i<r;i++)if(e.indexOf(t[i])>-1)return!0;return!1}function isObject$f(e){var t=_typeof$2(e);return null!==e&&("object"===t||"function"===t)}function debounce$1(e,t,i){var r,n,o,a,s,l,c=0,u=!1,d=!1,h=!0,p=!t&&0!==t&&"function"==typeof window.requestAnimationFrame;if("function"!=typeof e)throw new TypeError("Expected a function");function f(t){var i=r,o=n;return r=n=void 0,c=t,a=e.apply(o,i)}function g(e,t){return p?(window.cancelAnimationFrame(s),window.requestAnimationFrame(e)):setTimeout(e,t)}function y(e){var i=e-l;return void 0===l||i>=t||i<0||d&&e-c>=o}function _(){var e=Date.now();if(y(e))return m(e);s=g(_,function(e){var i=e-c,r=t-(e-l);return d?Math.min(r,o-i):r}(e))}function m(e){return s=void 0,h&&r?f(e):(r=n=void 0,a)}function v(){for(var e=Date.now(),i=y(e),o=arguments.length,h=new Array(o),p=0;p<o;p++)h[p]=arguments[p];if(r=h,n=this,l=e,i){if(void 0===s)return function(e){return c=e,s=g(_,t),u?f(e):a}(l);if(d)return s=g(_,t),f(l)}return void 0===s&&(s=g(_,t)),a}return t=+t||0,isObject$f(i)&&(u=!!i.leading,o=(d="maxWait"in i)?Math.max(+i.maxWait||0,t):o,h="trailing"in i?!!i.trailing:h),v.cancel=function(){void 0!==s&&function(e){if(p)return window.cancelAnimationFrame(e);clearTimeout(e)}(s),c=0,r=l=n=s=void 0},v.flush=function(){return void 0===s?a:m(Date.now())},v.pending=function(){return void 0!==s},v}function throttle$1(e,t,i){var r=!0,n=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return isObject$f(i)&&(r="leading"in i?!!i.leading:r,n="trailing"in i?!!i.trailing:n),debounce$1(e,t,{leading:r,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,i){if(e){var r=e.getAttribute(i);return!(!r||r!==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]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",n=document.createElement(e);return n.className=r,n.innerHTML=t,Object.keys(i).forEach((function(t){var r=t,o=i[t];"video"===e||"audio"===e||"live-video"===e?o&&n.setAttribute(r,o):n.setAttribute(r,o)})),n},util.createDomFromHtml=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";try{var r=document.createElement("div");r.innerHTML=e;var n=r.children;return r=null,n.length>0?(n=n[0],i&&util.addClass(n,i),t&&Object.keys(t).forEach((function(e){n.setAttribute(e,t[e])})),n):null}catch(e){return XG_DEBUG.logError("util.createDomFromHtml",e),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(r){var i=e.className&&"object"===_typeof$2(e.className)?e.getAttribute("class"):e.className;return i&&!!i.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(i){util.hasClass(e,t)||(e.className&&"object"===_typeof$2(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(i){util.hasClass(e,t)&&t.split(/\s+/g).forEach((function(t){var i=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===_typeof$2(e.className)?e.setAttribute("class",e.getAttribute("class").replace(i," ")):e.className=e.className.replace(i," ")}))}},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=[],i=function(i){"String"===util.typeOf(e[i])?t.push(e[i]):"Object"===util.typeOf(e[i])&&Object.keys(e[i]).map((function(r){e[i][r]&&t.push(r)}))},r=0;r<arguments.length;r++)i(r);return t.join(" ")},util.findDom=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,i=arguments.length>1?arguments[1]:void 0;try{e=t.querySelector(i)}catch(r){XG_DEBUG.logError("util.findDom",r),0===i.indexOf("#")&&(e=t.getElementById(i.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,i){for(var r=String(i),n=t>>0,o=Math.ceil(n/r.length),a=[],s=String(e);o--;)a.push(r);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),i=util.padStart(Math.floor((e-3600*t)/60),2,0),r=util.padStart(Math.floor(e-3600*t-60*i),2,0);return("00"===t?[i,r]:[t,i,r]).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(i){"Object"!==util.typeOf(t[i])||t[i]instanceof Node?"Array"===util.typeOf(t[i])?e[i]="Array"===util.typeOf(e[i])?e[i].concat(t[i]):t[i]:e[i]=t[i]:void 0===e[i]||void 0===e[i]?e[i]=t[i]:util.deepCopy(e[i],t[i])})),e},util.deepMerge=function(e,t){return Object.keys(t).map((function(i){var r;"Array"===util.typeOf(t[i])&&"Array"===util.typeOf(e[i])?"Array"===util.typeOf(e[i])&&(r=e[i]).push.apply(r,_toConsumableArray$1(t[i])):util.typeOf(e[i])!==util.typeOf(t[i])||null===e[i]||"Object"!==util.typeOf(e[i])||t[i]instanceof window.Node?null!==t[i]&&(e[i]=t[i]):util.deepMerge(e[i],t[i])})),e},util.getBgImage=function(e){var t=(e.currentStyle||window.getComputedStyle(e,null)).backgroundImage;if(!t||"none"===t)return"";var i=document.createElement("a");return i.href=t.replace(/url\("|"\)/g,""),i.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,i,r){e._interval[t]||(e._interval[t]=window.setInterval(i.bind(e),r))},util.clearInterval=function(e,t){clearInterval(e._interval[t]),e._interval[t]=null},util.setTimeout=function(e,t,i){e._timers||(e._timers=[]);var r=setTimeout((function(){t(),util.clearTimeout(e,r)}),i);return e._timers.push(r),r},util.clearTimeout=function(e,t){var i=e._timers;if("Array"===util.typeOf(i)){for(var r=0;r<i.length;r++)if(i[r]===t){i.splice(r,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,i,r){var n,o,a,s=util.createDom("xg-".concat(e),"",{},"xgplayer-".concat(e,"-img"));(s.style.backgroundImage='url("'.concat(t,'")'),i&&r)&&(["px","rem","em","pt","dp","vw","vh","vm","%"].every((function(e){return!(i.indexOf(e)>-1&&r.indexOf(e)>-1)||(n=parseFloat(i.slice(0,i.indexOf(e)).trim()),o=parseFloat(r.slice(0,r.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 i=[];if(/^\#[0-9A-F]{3}$/i.test(e)){var r="#";e.replace(/[0-9A-F]/gi,(function(e){r+=e+e})),e=r}return/^#[0-9A-F]{6}$/i.test(e)?(e.replace(/[0-9A-F]{2}/gi,(function(e){i.push(parseInt(e,16))})),"rgba(".concat(i.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$2(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 i=t.split(":");i.length>1&&(e.style[i[0]]=i[1])}})):Object.keys(t).map((function(i){e.style[i]=t[i]})))},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"],i=e.style.cssText;if(!i)return{};var r=i.replace(/\s+/g,"").split(";"),n={},o={};return r.map((function(e){if(e){var i=e.split(":");i.length>1&&(checkIsIn(i[0],t)?n[i[0]]=i[1]:o[i[0]]=i[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 i=t.replace(/\s+/g,"").split(";"),r={};return i.map((function(e){if(e){var t=e.split(":");t.length>1&&(r[t[0]]=t[1])}})),r},util.preloadImg=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(e){var r=new window.Image;r.onload=function(e){r=null,t&&t(e)},r.onerror=function(e){r=null,i&&i(e)},r.src=e}},util.stopPropagation=function(e){e&&e.stopPropagation()},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,i=[],r=0;r<e.length;r++)i.push({start:e.start(r)<.5?0:e.start(r),end:e.end(r)});i.sort((function(e,t){var i=e.start-t.start;return i||t.end-e.end}));var n=[];if(t)for(var o=0;o<i.length;o++){var a=n.length;if(a){var s=n[a-1].end;i[o].start-s<t?i[o].end>s&&(n[a-1].end=i[o].end):n.push(i[o])}else n.push(i[o])}else n=i;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("/"),i="";return t.length>3&&t[2]&&(i=t[2]),i},util.cancelAnimationFrame=function(e){var t=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.cancelRequestAnimationFrame;t&&t(e)},util.isMSE=function(e){return e.media&&(e=e.media),!!(e&&e instanceof HTMLMediaElement)&&(/^blob/.test(e.currentSrc)||/^blob/.test(e.src))},util.isBlob=function(e){return"string"==typeof e&&/^blob/.test(e)},util.generateSessionId=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=(new Date).getTime();try{e=parseInt(e)}catch(t){e=0}return t+=e,window.performance&&"function"==typeof window.performance.now&&(t+=parseInt(window.performance.now())),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var i=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?i:3&i|8).toString(16)}))},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,i){return t&&e&&(e>t||i&&e<t)?t:e},util.createPositionBar=function(e,t){var i=util.createDom("xg-bar","",{"data-index":-1},e);return t.appendChild(i),i},util.getTransformStyle=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{x:0,y:0,scale:1,rotate:0},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i={scale:"".concat(e.scale||1),translate:"".concat(e.x||0,"%, ").concat(e.y||0,"%"),rotate:"".concat(e.rotate||0,"deg")};return Object.keys(i).forEach((function(e){var r=new RegExp("".concat(e,"\\([^\\(]+\\)"),"g"),n="".concat(e,"(").concat(i[e],")");r.test(t)?(r.lastIndex=-1,t=t.replace(r,n)):t+="".concat(n," ")})),t},util.convertDeg=function(e){return Math.abs(e)<=1?360*e:e%360},util.getIndexByTime=function(e,t){var i=t.length,r=-1;if(i<1)return r;if(e<=t[0].end||i<2)r=0;else if(e>t[i-1].end)r=i-1;else for(var n=1;n<i;n++)if(e>t[n-1].end&&e<=t[n].end){r=n;break}return r},util.getOffsetCurrentTime=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,r=-1;if((r=i>=0&&i<t.length?i:util.getIndexByTime(e,t))<0)return-1;var n=t.length,o=t[r],a=o.start,s=o.end,l=o.cTime,c=o.offset;return e<a?l:e>=a&&e<=s?e-c:e>s&&r>=n-1?s:-1},util.getCurrentTimeByOffset=function(e,t){var i=-1;if(!t||t.length<0)return e;for(var r=0;r<t.length;r++)if(e<=t[r].duration){i=r;break}if(-1!==i){var n=t[i].start;return i-1<0?n+e:n+(e-t[i-1].duration)}return e};var VERSION_REG={android:/(Android)\s([\d.]+)/,ios:/(Version)\/([\d.]+)/},H264_MIMETYPES$1=["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","mp4v.20.8, mp4a.40.2","mp4v.20.240, mp4a.40.2"],sniffer={get device(){return sniffer.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(i){return t[i].test(e)})))[0]},get os(){if("undefined"==typeof navigator)return{};var e=navigator.userAgent,t=/(?:Windows Phone)/.test(e),i=/(?:SymbianOS)/.test(e)||t,r=/(?:Tizen)/gi.test(e),n=/(?:Web0S)/gi.test(e),o=/(?:Android)/.test(e),a=/(?:Firefox)/.test(e),s=/(?:iPad|PlayBook)/.test(e)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,l=s||o&&!/(?:Mobile)/.test(e)||a&&/(?:Tablet)/.test(e),c=/(?:iPhone)/.test(e)&&!l;return{isTablet:l,isPhone:c,isIpad:s,isIos:c||s,isAndroid:o,isPc:!(c||o||i||l),isSymbian:i,isWindowsPhone:t,isFireFox:a,isTizen:r,isWebOS:n}},get osVersion(){if("undefined"==typeof navigator)return 0;var e=navigator.userAgent,t="",i=(t=/(?:iPhone)|(?:iPad|PlayBook)/.test(e)?VERSION_REG.ios:VERSION_REG.android)?t.exec(e):[];if(i&&i.length>=3){var r=i[2].split(".");return r.length>0?parseInt(r[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$1.map((function(i){"probably"===t.canPlayType('video/mp4; codecs="'.concat(i,'"'))&&(e.isSupport=!0,e.mime+="||".concat(i))})),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 i=e.video||{},r=e.audio||{};try{var n=MediaSource.isTypeSupported(i.contentType),o=MediaSource.isTypeSupported(r.contentType);return Promise.resolve({supported:n&&o,smooth:!1,powerEfficient:!1})}catch(e){return Promise.resolve(t)}}},version$2="3.0.23-rc.3",ERROR_TYPE_MAP={1:"media",2:"media",3:"media",4:"media",5:"media",6:"media"},ERROR_MAP$1={1:5101,2:5102,3:5103,4:5104,5:5105,6:5106},Errors=_createClass$2((function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{errorType:"",errorCode:0,errorMessage:"",originError:"",ext:{},mediaError:null};_classCallCheck$2(this,e);var r=t&&t.i18n?t.i18n.ERROR_TYPES:null;if(t.media){var n=i.mediaError?i.mediaError:t.media.error||{},o=t.duration,a=t.currentTime,s=t.ended,l=t.src,c=t.currentSrc,u=t.media,d=u.readyState,h=u.networkState,p=i.errorCode||n.code;ERROR_MAP$1[p]&&(p=ERROR_MAP$1[p]);var f={playerVersion:version$2,currentTime:a,duration:o,ended:s,readyState:d,networkState:h,src:l||c,errorType:i.errorType,errorCode:p,message:i.errorMessage||n.message,mediaError:n,originError:i.originError?i.originError.stack:"",host:util.getHostFromUrl(l||c)};return i.ext&&Object.keys(i.ext).map((function(e){f[e]=i.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"],_=0;_<arguments.length;_++)g[y[_]]=arguments[_];return g.ex=r?(r[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",LOADED_METADATA="loadedmetadata",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",LEAVE_PLAYER="leaveplayer",ENTER_PLAYER="enterplayer",LOADING="loading",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","loadedmetadata","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";const XGEvents=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,ENTER_PLAYER:ENTER_PLAYER,ERROR:ERROR$1,FPS_STUCK:FPS_STUCK,FULLSCREEN_CHANGE:FULLSCREEN_CHANGE,LEAVE_PLAYER:LEAVE_PLAYER,LOADED_DATA:LOADED_DATA,LOADED_METADATA:LOADED_METADATA,LOADING:LOADING,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(i,r){var n={player:t,eventName:e,originalEvent:i,detail:i.detail||{},timeStamp:i.timeStamp,currentTime:t.currentTime,duration:t.duration,paused:t.paused,ended:t.ended,isInternalOp:!!t._internalOp[i.type],muted:t.muted,volume:t.volume,host:util.getHostFromUrl(t.currentSrc),vtype:t.vtype};if(t.removeInnerOP(i.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=r||t.video.error),t.mediaEventMiddleware[e]){var a=emitVideoEvent.bind(t,e,n);try{t.mediaEventMiddleware[e].call(t,n,a)}catch(i){throw emitVideoEvent.call(t,e,n),i}}else emitVideoEvent.call(t,e,n)}}var MediaProxy=function(e){_inherits$1(i,EventEmitter);var t=_createSuper$1(i);function i(e){var r;_classCallCheck$2(this,i),(r=t.call(this,e))._hasStart=!1,r._currentTime=0,r._duration=0,r._internalOp={},r._lastMuted=!1,r.vtype="MP4",r._rate=-1,r.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.isWeixin&&sniffer.os.isAndroid&&n&&(r.mediaConfig["x5-video-player-type"]=n,delete r.mediaConfig.playsinline,delete r.mediaConfig["webkit-playsinline"],delete r.mediaConfig["x5-playsinline"]),e.loop&&(r.mediaConfig.loop="loop"),e.autoplayMuted&&!Object.prototype.hasOwnProperty.call(r.mediaConfig,"muted")&&(r.mediaConfig.muted=!0),r.media=e.mediaEl instanceof HTMLMediaElement?e.mediaEl:"function"==typeof e.mediaEl?e.mediaEl(r.mediaConfig):util.createDom(r.mediaConfig.mediaType,"",r.mediaConfig,""),e.defaultPlaybackRate&&(r.media.defaultPlaybackRate=r.media.playbackRate=e.defaultPlaybackRate),"Number"===util.typeOf(e.volume)&&(r.volume=e.volume),e.autoplayMuted&&(r.media.muted=!0,r._lastMuted=!0),e.autoplay&&(r.media.autoplay=!0),e.playsinline&&(r.media.playsinline=!0),r._interval={},r.mediaEventMiddleware={},r.attachVideoEvents(),r}return _createClass$2(i,[{key:"setEventsMiddleware",value:function(e){var t=this;Object.keys(e).map((function(i){t.mediaEventMiddleware[i]=e[i]}))}},{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 i="on".concat(t.charAt(0).toUpperCase()).concat(t.slice(1));return"function"==typeof e[i]&&e.on(t,e[i]),_defineProperty$2({},t,getVideoEventHandler(t,e))}))),this._evHandlers.forEach((function(e){var i=Object.keys(e)[0];t.addEventListener(i,e[i],!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 i=Object.keys(e)[0];t.removeEventListener(i,e[i],!1)})),this._evHandlers.forEach((function(t){var i=Object.keys(t)[0],r="on".concat(i.charAt(0).toUpperCase()).concat(i.slice(1));"function"==typeof e[r]&&e.off(i,e[r])})),this._evHandlers=null}},{key:"_attachSourceEvents",value:function(e,t){var i=this;e.removeAttribute("src"),e.load(),t.forEach((function(e,t){i.media.appendChild(util.createDom("source","",{src:"".concat(e.src),type:"".concat(e.type||""),"data-index":t+1}))}));var r=e.children;if(r){this._videoSourceCount=r.length,this._videoSourceIndex=r.length,this._vLoadeddata=function(e){i.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){var t=parseInt(e.target.getAttribute("data-index"),10);if(i._videoSourceIndex--,0===i._videoSourceIndex||t>=i._videoSourceCount){var r={code:4,message:"sources_load_error"};n?n.error(e,r):i.errorHandler("error",r)}var o=ERROR_TYPE_MAP[4];i.emit(SOURCE_ERROR,new Errors(i,{errorType:o,errorCode:4,errorMessage:"sources_load_error",mediaError:{code:4,message:"sources_load_error"},src:e.target.src}))});for(var a=0;a<r.length;a++)r[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 i=0;i<t.length;i++)t[i].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 i=this.media.error||t,r=i.code?ERROR_TYPE_MAP[i.code]:"other";i.message;this.media.currentSrc||this.media.srcObject||(i={code:6,message:"empty_src"}),this.emit(e,new Errors(this,{errorType:r,errorCode:i.code,errorMessage:i.message||"",mediaError:i}))}}},{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 i=this.media.currentTime;if(e)for(var r=0,n=e.length;r<n&&(t[0]=e.start(r),t[1]=e.end(r),!(t[0]<=i&&i<=t[1]));r++);return t[0]-i<=0&&i-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 i=0;i<t.length;i++)if((t.start(i)<=this.currentTime||t.start(i)<.1)&&t.end(i)>=this.currentTime)return{start:t.start(i),end:t.end(i)};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,util.isMSE(this.media)?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:"aspectRatio",get:function(){return this.media?this.media.videoWidth/this.media.videoHeight:0}},{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 r,n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];(r=_get$1(_getPrototypeOf$1(i.prototype),"emit",this)).call.apply(r,[this,e,t].concat(o))}},{key:"on",value:function(e,t){for(var r,n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];(r=_get$1(_getPrototypeOf$1(i.prototype),"on",this)).call.apply(r,[this,e,t].concat(o))}},{key:"once",value:function(e,t){for(var r,n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];(r=_get$1(_getPrototypeOf$1(i.prototype),"once",this)).call.apply(r,[this,e,t].concat(o))}},{key:"off",value:function(e,t){for(var r,n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];(r=_get$1(_getPrototypeOf$1(i.prototype),"off",this)).call.apply(r,[this,e,t].concat(o))}},{key:"offAll",value:function(){_get$1(_getPrototypeOf$1(i.prototype),"removeAllListeners",this).call(this)}}]),i}(),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$2(this,e),this.indexedDB=window.indexedDB||window.webkitindexedDB,this.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange,this.myDB=t}return _createClass$2(e,[{key:"openDB",value:function(e){var t=this,i=this,r=this.myDB.version||1,n=i.indexedDB.open(i.myDB.name,r);n.onerror=function(e){},n.onsuccess=function(r){t.myDB.db=r.target.result,e.call(i)},n.onupgradeneeded=function(e){var t=e.target.result;e.target.transaction,t.objectStoreNames.contains(i.myDB.ojstore.name)||t.createObjectStore(i.myDB.ojstore.name,{keyPath:i.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 i,r=this.myDB.db.transaction(e,"readwrite").objectStore(e),n=0;n<t.length;n++)(i=r.add(t[n])).onerror=function(){},i.onsuccess=function(){}}},{key:"putData",value:function(e,t){for(var i,r=this.myDB.db.transaction(e,"readwrite").objectStore(e),n=0;n<t.length;n++)(i=r.put(t[n])).onerror=function(){},i.onsuccess=function(){}}},{key:"getDataByKey",value:function(e,t,i){var r=this,n=this.myDB.db.transaction(e,"readwrite").objectStore(e).get(t);n.onerror=function(){i.call(r,null)},n.onsuccess=function(e){var t=e.target.result;i.call(r,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,i){for(var r=arguments.length,n=new Array(r>3?r-3:0),o=3;o<r;o++)n[o-3]=arguments[o];var a=t.call.apply(t,[e].concat(n));i&&"function"==typeof i&&(a&&a.then?a.then((function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];i.call.apply(i,[e].concat(r))})):i.call.apply(i,[e].concat(n)))}function hook(e,t){var i=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 r=arguments,n=this;if(i.pre)try{var o;(o=i.pre).call.apply(o,[this].concat(Array.prototype.slice.call(arguments)))}catch(t){throw t.message="[pluginName: ".concat(this.pluginName,":").concat(e,":pre error] >> ").concat(t.message),t}if(this.__hooks&&this.__hooks[e])try{var a=runHooks.apply(void 0,[this,e,t].concat(Array.prototype.slice.call(arguments)));a?a.then?a.then((function(e){!1!==e&&callHandler.apply(void 0,[n,t,i.next].concat(_toConsumableArray$1(r)))})).catch((function(e){throw e})):callHandler.apply(void 0,[this,t,i.next].concat(Array.prototype.slice.call(arguments))):void 0===a&&callHandler.apply(void 0,[this,t,i.next].concat(Array.prototype.slice.call(arguments)))}catch(t){throw t.message="[pluginName: ".concat(this.pluginName,":").concat(e,"] >> ").concat(t.message),t}else callHandler.apply(void 0,[this,t,i.next].concat(Array.prototype.slice.call(arguments)))}.bind(this)}function findHookIndex(e,t){var i=this.__hooks;if(!i||!Array.isArray(i[e]))return-1;for(var r=i[e],n=0;n<r.length;n++)if(r[n]===t)return n;return-1}function useHooks(e,t){var i=this.__hooks;if(i)return i.hasOwnProperty(e)?(Array.isArray(i[e])||(i[e]=[]),-1===findHookIndex.call(this,e,t)&&i[e].push(t),!0):(console.warn("has no supported hook which name [".concat(e,"]")),!1)}function removeHooks(e,t){var i=this.__hooks;if(i)if(Array.isArray(i[e])){var r=i[e],n=findHookIndex.call(this,e,t);-1!==n&&r.splice(n,1)}else i[e]&&(i[e]=null)}function usePluginHooks(e){if(this.plugins&&this.plugins[e.toLowerCase()]){for(var t=this.plugins[e.toLowerCase()],i=arguments.length,r=new Array(i>1?i-1:0),n=1;n<i;n++)r[n-1]=arguments[n];return t.useHooks&&t.useHooks.apply(t,r)}}function removePluginHooks(e){if(this.plugins&&this.plugins[e.toLowerCase()]){var t=this.plugins[e.toLowerCase()];if(t){for(var i=arguments.length,r=new Array(i>1?i-1:0),n=1;n<i;n++)r[n-1]=arguments[n];return t.removeHooks&&t.removeHooks.apply(t,r)}}}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,i){for(var r=arguments.length,n=new Array(r>3?r-3:0),o=3;o<r;o++)n[o-3]=arguments[o];if(e.__hooks&&Array.isArray(e.__hooks[t])){var a=e.__hooks[t],s=-1;return function e(t,i,r){for(var n=arguments.length,o=new Array(n>3?n-3:0),l=3;l<n;l++)o[l-3]=arguments[l];if(s++,0===a.length||s===a.length)return r.call.apply(r,[t,t].concat(o));var c=a[s],u=c.call.apply(c,[t,t].concat(o));return u&&u.then?u.then((function(n){return!1===n?null:e.apply(void 0,[t,i,r].concat(o))})).catch((function(e){console.warn("[runHooks]".concat(i," reject"),e.message)})):!1!==u?e.apply(void 0,[t,i,r].concat(o)):void 0}.apply(void 0,[e,t,i].concat(n))}return i.call.apply(i,[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$2(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$2(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 i=this;e&&t&&this.player?"string"==typeof e?(this.__events[e]=t,this.player.on(e,t)):Array.isArray(e)&&e.forEach((function(e){i.__events[e]=t,i.player.on(e,t)})):showErrorMsg(this.pluginName,"plugin.on(event, callback)")}},{key:"once",value:function(e,t){var i=this;e&&t&&this.player?"string"==typeof e?(this.__onceEvents[e]=t,this.player.once(e,t)):Array.isArray(e)&&e.forEach((function(r){i.__onceEvents[r]=t,i.player.once(e,t)})):showErrorMsg(this.pluginName,"plugin.once(event, callback)")}},{key:"off",value:function(e,t){var i=this;e&&t&&this.player?"string"==typeof e?(delete this.__events[e],this.player.off(e,t)):Array.isArray(e)&&e.forEach((function(r){delete i.__events[e],i.player.off(r,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(i){e[t][i]&&e.off(i,e[t][i]),i&&delete e[t][i]}))})),this.__events={},this.__onceEvents={}}},{key:"emit",value:function(e){var t;if(this.player){for(var i=arguments.length,r=new Array(i>1?i-1:0),n=1;n<i;n++)r[n-1]=arguments[n];(t=this.player).emit.apply(t,[e].concat(r))}}},{key:"emitUserAction",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.player){var r=_objectSpread2$2(_objectSpread2$2({},i),{},{pluginName:this.pluginName});this.player.emitUserAction(e,t,r)}}},{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 i=arguments.length,r=new Array(i>2?i-2:0),n=2;n<i;n++)r[n-2]=arguments[n];return useHooks.call.apply(useHooks,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(e,t){for(var i=arguments.length,r=new Array(i>2?i-2:0),n=2;n<i;n++)r[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]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(this.player)return i&&(t.pluginName=i),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,i=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(i),delHooksDescriptor(this)}}],[{key:"defineGetterOrSetter",value:function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&Object.defineProperty(e,i,t[i])}},{key:"defineMethod",value:function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&"function"==typeof t[i]&&Object.defineProperty(e,i,{configurable:!0,value:t[i]})}},{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$1(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$1,closest=closest_1;function _delegate(e,t,i,r,n){var o=listener$1.apply(this,arguments);return e.addEventListener(i,o,n),{destroy:function(){e.removeEventListener(i,o,n)}}}function delegate(e,t,i,r,n){return"function"==typeof e.addEventListener?_delegate.apply(null,arguments):"function"==typeof i?_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,i,r,n)})))}function listener$1(e,t,i,r){return function(i){i.delegateTarget=closest(i.target,t),i.delegateTarget&&r.call(e,i)}}var delegate_1=delegate;const _delegate$1=getDefaultExportFromCjs(delegate_1);var ROOT_TYPES={CONTROLS:"controls",ROOT:"root"},POSITIONS$7={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"},PLUGIN_STATE_CLASS={ICON_DISABLE:"xg-icon-disable",ICON_HIDE:"xg-icon-hide"};function isUrl$1(e){return!!e&&(e.indexOf&&/^(?:http|data:|\/)/.test(e))}function mergeIconClass(e,t){return"object"===_typeof$2(e)&&e.class&&"string"==typeof e.class?"".concat(t," ").concat(e.class):t}function mergeIconAttr(e,t){return"object"===_typeof$2(e)&&e.attr&&"object"===_typeof$2(e.attr)&&Object.keys(e.attr).map((function(i){t[i]=e.attr[i]})),t}function createIcon(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=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,i),Object.keys(r).map((function(t){e.setAttribute(t,r[t])})),e;if(isUrl$1(e)||isUrl$1(e.url))return r.src=isUrl$1(e)?e:e.url||"",o=util.createDom(e.tag||"img","",r,"xg-img ".concat(i));if("function"==typeof e)try{return(o=e())instanceof window.Element?(util.addClass(o,i),Object.keys(r).map((function(e){o.setAttribute(e,r[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(e){return XG_DEBUG.logError("Plugin named [".concat(n,"]:createIcon"),e),null}return"string"==typeof e?util.createDomFromHtml(e,r,i):(XG_DEBUG.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(n,"] is invalid")),null)}function registerIconsObj(e,t){var i=t.config.icons||t.playerConfig.icons;Object.keys(e).map((function(r){var n=e[r],o=n&&n.class?n.class:"",a=n&&n.attr?n.attr:{},s=null;i&&i[r]&&(o=mergeIconClass(i[r],o),a=mergeIconAttr(i[r],a),s=createIcon(i[r],r,o,a,t.pluginName)),!s&&n&&(s=createIcon(n.icon?n.icon:n,a,o,{},t.pluginName)),t.icons[r]=s}))}function registerTextObj(e,t){Object.keys(e).map((function(i){Object.defineProperty(t.langText,i,{get:function(){var r=t.lang,n=t.i18n;return n[i]?n[i]:e[i]&&e[i][r]||""}})}))}var Plugin=function(e){_inherits$1(i,BasePlugin);var t=_createSuper$1(i);function i(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck$2(this,i),(e=t.call(this,r)).__delegates=[],e}return _createClass$2(i,[{key:"__init",value:function(e){if(_get$1(_getPrototypeOf$1(i.prototype),"__init",this).call(this,e),e.root){var t=e.root,r=null;this.icons={},this.root=null,this.parent=null,this.extraEls=[],registerIconsObj(this.registerIcons()||{},this),this.langText={},registerTextObj(this.registerLanguageTexts()||{},this);var n="";try{n=this.render()}catch(e){throw XG_DEBUG.logError("Plugin:".concat(this.pluginName,":render"),e),new Error("Plugin:".concat(this.pluginName,":render:").concat(e.message))}if(n)(r=i.insert(n,t,e.index)).setAttribute("data-index",e.index);else{if(!e.tag)return;(r=util.createDom(e.tag,"",e.attr,e.name)).setAttribute("data-index",e.index),t.appendChild(r)}this.root=r,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$2(t)&&Object.keys(t).length>0&&Object.keys(t).map((function(i){var r,n,o=i,a=t[o],s={root:e.root};"function"==typeof a?(r=e.config[o]||{},n=a):"object"===_typeof$2(a)&&"function"==typeof a.plugin&&(r=a.options?util.deepCopy(e.config[o]||{},a.options):e.config[o]||{},n=a.plugin),s.config=r,void 0!==r.index&&(s.index=r.index),r.root&&(s.root=r.root),e.registerPlugin(n,s,o)}))}}},{key:"updateLang",value:function(e){e||(e=this.lang);var t=this.root,i=this.i18n,r=this.langText;t&&function e(t,i){for(var r=0;r<t.children.length;r++)t.children[r].children.length>0?e(t.children[r],i):i(t.children[r])}(t,(function(t){var n=t.getAttribute&&t.getAttribute("lang-key");if(n){var o=i[n.toUpperCase()]||r[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]:"",i=this.i18n||{},r=this.langText;e.setAttribute&&e.setAttribute("lang-key",t);var n=i[t]||r[t]||"";n&&(e.innerHTML=n)}},{key:"plugins",value:function(){return this._children}},{key:"disable",value:function(){this.config.disable=!0,util.addClass(this.find(".xgplayer-icon"),PLUGIN_STATE_CLASS.ICON_DISABLE)}},{key:"enable",value:function(){this.config.disable=!1,util.removeClass(this.find(".xgplayer-icon"),PLUGIN_STATE_CLASS.ICON_DISABLE)}},{key:"children",value:function(){return{}}},{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]:"";t.root=t.root||this.root;var n=_get$1(_getPrototypeOf$1(i.prototype),"registerPlugin",this).call(this,e,t,r);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,r){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=i.delegate.call(this,this.root,e,t,r);this.__delegates=this.__delegates.concat(o)}}},{key:"unbind",value:function(e,t){var i=this;if(arguments.length<3&&"function"==typeof t)Array.isArray(e)?e.forEach((function(e){i.unbindEL(e,t)})):this.unbindEL(e,t);else for(var r="".concat(e,"_").concat(t),n=0;n<this.__delegates.length;n++)if(this.__delegates[n].key===r){this.__delegates[n].destroy(),this.__delegates.splice(n,1);break}}},{key:"setStyle",value:function(e,t){var i=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){i.root.style[t]=e[t]})))}},{key:"setAttr",value:function(e,t){var i=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){i.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 i=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,i)}},{key:"unbindEL",value:function(e,t){var i=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,i)}},{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(e){return XG_DEBUG.logError("Plugin:appendChild",e),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$1(_getPrototypeOf$1(i.prototype),"__destroy",this).call(this),this.icons={},["root","parent"].map((function(t){e[t]=null})),this.extraEls=[]}}],[{key:"insert",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=t.children.length,n=Number(i),o=e instanceof window.Node;if(r){for(var a=0,s=null,l="";a<r;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,i,r){var n=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=[];if(e instanceof window.Node&&"function"==typeof r)if(Array.isArray(i))i.forEach((function(i){var a=_delegate$1(e,t,i,r,n);a.key="".concat(t,"_").concat(i),o.push(a)}));else{var a=_delegate$1(e,t,i,r,n);a.key="".concat(t,"_").concat(i),o.push(a)}return o}},{key:"ROOT_TYPES",get:function(){return ROOT_TYPES}},{key:"POSITIONS",get:function(){return POSITIONS$7}}]),i}(),ResizeObserver$1=function(){function e(){var t=this;if(_classCallCheck$2(this,e),_defineProperty$2(this,"__trigger",(function(e){var i=(new Date).getTime();t.timeStamp=i;for(var r=0;r<e.length;r++)t.__runHandler(e[r].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(e){console.error(e)}}return _createClass$2(e,[{key:"addObserver",value:function(e,t){if(this.observer){this.observer.observe(e);for(var i=e.getAttribute(PLATER_ID),r=this.__handlers,n=-1,o=0;o<r.length;o++)r[o]&&e===r[o].target&&(n=o);n>-1?this.__handlers[n].handler=t:this.__handlers.push({target:e,handler:t,playerId:i})}}},{key:"unObserver",value:function(e){var t=-1;this.__handlers.map((function(i,r){e===i.target&&(t=r)}));try{var i;null===(i=this.observer)||void 0===i||i.unobserve(e)}catch(e){}t>-1&&this.__handlers.splice(t,1)}},{key:"destroyObserver",value:function(){var e;null===(e=this.observer)||void 0===e||e.disconnect(),this.observer=null,this.__handlers=null}},{key:"__runHandler",value:function(e){for(var t=this.__handlers,i=0;i<t.length;i++)if(t[i]&&e===t[i].target){try{t[i].handler(e)}catch(e){console.error(e)}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){var i;null===(i=resizeObserver$1)||void 0===i||i.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()})),this.pluginGroup[t]={_originalOptions:e.config||{},_plugins:{}}},formatPluginInfo:function(e,t){var i=null,r=null;return e.plugin&&"function"==typeof e.plugin?(i=e.plugin,r=e.options):(i=e,r={}),t&&(r.config=t||{}),{PLUFGIN:i,options:r}},checkPluginIfExits:function(e,t){for(var i=0;i<t.length;i++)if(e.toLowerCase()===t[i].pluginName.toLowerCase())return!0;return!1},getRootByConfig:function(e,t){for(var i=Object.keys(t),r=null,n=0;n<i.length;n++)if(e.toLowerCase()===i[n].toLowerCase()){r=t[i[n]];break}return"Object"===util.typeOf(r)?{root:r.root,position:r.position}:{}},lazyRegister:function(e,t){var i=this,r=t.timeout||1500;return Promise.race([t.loader().then((function(t){var r;r=t&&t.__esModule?t.default:t,i.register(e,r,t.options)})),new Promise((function(e,t){setTimeout((function(){t(new Error("timeout"))}),r)}))])},register:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e&&t&&"function"==typeof t&&void 0!==t.prototype){var r=e._pluginInfoId;if(r&&this.pluginGroup[r]){this.pluginGroup[r]._plugins||(this.pluginGroup[r]._plugins={});var n=this.pluginGroup[r]._plugins,o=this.pluginGroup[r]._originalOptions;i.player=e;var a=i.pluginName||t.pluginName;if(!a)throw new Error("The property pluginName is necessary");if(!t.isSupported||t.isSupported(e.config.mediaType,e.config.codecType)){i.config||(i.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)?i.config=Object.assign({},i.config,o[s[l]]):"Boolean"===util.typeOf(c)&&(i.config.disable=!c);break}t.defaultConfig&&Object.keys(t.defaultConfig).forEach((function(e){void 0===i.config[e]&&(i.config[e]=t.defaultConfig[e])})),i.root?"string"==typeof i.root&&(i.root=e[i.root]):i.root=e.root,i.index=i.config.index||0;try{n[a.toLowerCase()]&&(this.unRegister(r,a.toLowerCase()),console.warn("the is one plugin with same pluginName [".concat(a,"] exist, destroy the old instance")));var u=new t(i);return n[a.toLowerCase()]=u,n[a.toLowerCase()].func=t,u&&"function"==typeof u.afterCreate&&u.afterCreate(),u}catch(e){throw console.error(e),e}}else console.warn("not supported plugin [".concat(a,"]"))}}},unRegister:function(e,t){e._pluginInfoId&&(e=e._pluginInfoId),t=t.toLowerCase();try{var i=this.pluginGroup[e]._plugins[t];i&&(i.pluginName&&i.__destroy(),delete this.pluginGroup[e]._plugins[t])}catch(i){console.error("[unRegister:".concat(t,"] cgid:[").concat(e,"] error"),i)}},deletePlugin:function(e,t){var i=e._pluginInfoId;i&&this.pluginGroup[i]&&this.pluginGroup[i]._plugins&&delete this.pluginGroup[i]._plugins[t]},getPlugins:function(e){var t=e._pluginInfoId;return t&&this.pluginGroup[t]?this.pluginGroup[t]._plugins:{}},findPlugin:function(e,t){var i=e._pluginInfoId;if(!i||!this.pluginGroup[i])return null;var r=t.toLowerCase();return this.pluginGroup[i]._plugins[r]},beforeInit:function(e){var t=this;function i(e){return e&&e.then?e:new Promise((function(e){e()}))}return new Promise((function(r){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(i(t))}catch(e){throw a.push(i(null)),e}})),Promise.all([].concat(a)).then((function(){r()})).catch((function(e){console.error(e),r()}))}else r()}))}))},afterInit:function(e){var t=e._pluginInfoId;if(t&&this.pluginGroup[t]){var i=this.pluginGroup[t]._plugins;Object.keys(i).forEach((function(e){i[e]&&i[e].afterPlayerInit&&i[e].afterPlayerInit()}))}},setLang:function(e,t){var i=t._pluginInfoId;if(i&&this.pluginGroup[i]){var r=this.pluginGroup[i]._plugins;Object.keys(r).forEach((function(t){if(r[t].updateLang)r[t].updateLang(e);else try{r[t].lang=e}catch(e){console.warn("".concat(t," setLang"))}}))}},reRender:function(e){var t=this,i=e._pluginInfoId;if(i&&this.pluginGroup[i]){var r=[],n=this.pluginGroup[i]._plugins;Object.keys(n).forEach((function(e){"controls"!==e&&n[e]&&(r.push({plugin:n[e].func,options:n[e].__args}),t.unRegister(i,e))})),r.forEach((function(i){t.register(e,i.plugin,i.options)}))}},onPluginsReady:function(e){var t=e._pluginInfoId;if(t&&this.pluginGroup[t]){var i=this.pluginGroup[t]._plugins||{};Object.keys(i).forEach((function(e){i[e].onPluginsReady&&"function"==typeof i[e].onPluginsReady&&i[e].onPluginsReady()}))}},destroy:function(e){var t=e._pluginInfoId;if(this.pluginGroup[t]){unObserver$1(e.root);for(var i=this.pluginGroup[t]._plugins,r=0,n=Object.keys(i);r<n.length;r++){var o=n[r];this.unRegister(t,o)}delete this.pluginGroup[t],delete e._pluginInfoId}}},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(){},preProcessUrl:null,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 i,r,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,d=n.i18n,h=void 0===d?[]:d;e.config.plugins||(e.config.plugins=[]),e.config.ignores||(e.config.ignores=[]),(i=e.config.plugins).push.apply(i,_toConsumableArray$1(a)),(r=e.config.ignores).push.apply(r,_toConsumableArray$1(l)),Object.keys(u).map((function(t){e.config.icons[t]||(e.config.icons[t]=u[t])}));var p=e.config.i18n||[];h.push.apply(h,_toConsumableArray$1(p)),e.config.i18n=h},Controls=function(e){_inherits$1(i,Plugin);var t=_createSuper$1(i);function i(){var e;_classCallCheck$2(this,i);for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return _defineProperty$2(_assertThisInitialized$1(e=t.call.apply(t,[this].concat(n))),"onMouseEnter",(function(t){var i=_assertThisInitialized$1(e),r=i.player;i.playerConfig.closeControlsBlur&&r.focus({autoHide:!1})})),_defineProperty$2(_assertThisInitialized$1(e),"onMouseLeave",(function(t){_assertThisInitialized$1(e).player.focus()})),e}return _createClass$2(i,[{key:"beforeCreate",value:function(e){e.config.mode||"mobile"!==sniffer.device||(e.config.mode="flex"),e.player.config.marginControls&&(e.config.autoHide=!1)}},{key:"afterCreate",value:function(){var e=this,t=this.config,i=t.disable,r=t.height,n=t.mode;if(!i){"flex"===n&&this.player.addClass(STATE_CLASS.FLEX_CONTROLS);var o={height:"".concat(r,"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.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(e){this.root.style.display="",this.player.focus()}},{key:"hide",value:function(){this.root.style.display="none"}},{key:"mode",get:function(){return this.config.mode}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;if(this.root){var n=e.defaultConfig||{};if(!t.root){switch(t.position?t.position:t.config&&t.config.position?t.config.position:n.position){case POSITIONS$7.CONTROLS_LEFT:t.root=this.left;break;case POSITIONS$7.CONTROLS_RIGHT:t.root=this.right;break;case POSITIONS$7.CONTROLS_CENTER:t.root=this.center;break;case POSITIONS$7.CONTROLS:t.root=this.root;break;default:t.root=this.left}return _get$1(_getPrototypeOf$1(i.prototype),"registerPlugin",this).call(this,e,t,r)}}}},{key:"destroy",value:function(){"mobile"!==sniffer.device&&(this.unbind("mouseenter",this.onMouseEnter),this.unbind("mouseleave",this.onMouseLeave)),this.left=null,this.center=null,this.right=null,this.innerRoot=null}},{key:"render",value:function(){var e=this.config,t=e.mode,i=e.autoHide,r=e.initShow;if(!e.disable){var n=util.classNames({"xgplayer-controls":!0},{"flex-controls":"flex"===t},{"bottom-controls":"bottom"===t},_defineProperty$2({},STATE_CLASS.CONTROLS_AUTOHIDE,i),{"xgplayer-controls-initshow":r||!i});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}}}]),i}(),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(i){var r,n=util.typeOf(t[i]),o=util.typeOf(e[i]);"Array"===n?("Array"!==o&&(e[i]=[]),(r=e[i]).push.apply(r,_toConsumableArray$1(t[i]))):"Object"===n?("Object"!==o&&(e[i]={}),deepMerge(e[i],t[i])):e[i]=t[i]})),e}function updateKeys(){Object.keys(XGI18nLang.lang.en).map((function(e){XGI18nLang.textKeys[e]=e}))}function extend(e,t){var i=[];if(t||(t=XGI18nLang),t.lang){i="Array"!==util.typeOf(e)?Object.keys(e).map((function(t){return{LANG:"zh"===t?"zh-cn":t,TEXT:e[t]}})):e;var r=t.lang;i.map((function(e){"zh"===e.LANG&&(e.LANG="zh-cn"),r[e.LANG]?deepMerge(r[e.LANG]||{},e.TEXT||{}):use(e,t)})),updateKeys()}}function use(e,t){var i=e.LANG;if(t||(t=XGI18nLang),t.lang){var r=e.TEXT||{};"zh"===i&&(i="zh-cn"),t.lang[i]?deepMerge(t.lang[i],r):(t.langKeys.push(i),t.lang[i]=r),updateKeys()}}function init2(e){var t,i={lang:{},langKeys:[],textKeys:{},pId:e};return deepMerge(i.lang,XGI18nLang.lang),(t=i.langKeys).push.apply(t,_toConsumableArray$1(XGI18nLang.langKeys)),deepMerge(i.textKeys,XGI18nLang.textKeys),i}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:init2},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"],store$4={},instance=null,InstManager=function(e){_inherits$1(i,eventemitter3Exports.EventEmitter);var t=_createSuper$1(i);function i(){return _classCallCheck$2(this,i),t.apply(this,arguments)}return _createClass$2(i,[{key:"add",value:function(e){e&&(store$4[e.playerId]=e,1===Object.keys(store$4).length&&this.setActive(e.playerId,!0))}},{key:"remove",value:function(e){e&&(e.isUserActive,delete store$4[e.playerId])}},{key:"_iterate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(var i in store$4)if(Object.prototype.hasOwnProperty.call(store$4,i)){var r=store$4[i];if(t){if(e(r))break}else e(r)}}},{key:"forEach",value:function(e){this._iterate(e)}},{key:"find",value:function(e){var t=null;return this._iterate((function(i){var r=e(i);return r&&(t=i),r}),!0),t}},{key:"findAll",value:function(e){var t=[];return this._iterate((function(i){e(i)&&t.push(i)})),t}},{key:"setActive",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(store$4[e])return t?this.forEach((function(t){e===t.playerId?(t.isUserActive=!0,t.isInstNext=!1):t.isUserActive=!1})):store$4[e].isUserActive=t,e}},{key:"getActiveId",value:function(){for(var e=Object.keys(store$4),t=0;t<e.length;t++){var i=store$4[e[t]];if(i&&i.isUserActive)return e[t]}return null}},{key:"setNext",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(store$4[e])return t?this.forEach((function(t){e===t.playerId?(t.isUserActive=!1,t.isInstNext=!0):t.isInstNext=!1})):store$4[e].isInstNext=t,e}}],[{key:"getInstance",value:function(){return instance||(instance=new i),instance}}]),i}();function checkPlayerRoot(e){for(var t=Object.keys(store$4),i=0;i<t.length;i++){var r=store$4[t[i]];if(r.root===e)return r}return null}var PlAYER_HOOKS=["play","pause","replay","retry"],REAL_TIME_SPEED=0,AVG_SPEED=0,instManager=null,Player=function(e){_inherits$1(i,MediaProxy);var t=_createSuper$1(i);function i(e){var r;_classCallCheck$2(this,i);var n=util.deepMerge(getDefaultConfig$1(),e);_defineProperty$2(_assertThisInitialized$1(r=t.call(this,n)),"canPlayFunc",(function(){if(r.config){var e=r.config,t=e.autoplay,i=e.defaultPlaybackRate;XG_DEBUG.logInfo("player","canPlayFunc, startTime",r.__startTime),r._seekToStartTime(),r.playbackRate=i,(t||r._useAutoplay)&&r.mediaPlay(),r.off(CANPLAY,r.canPlayFunc),r.removeClass(STATE_CLASS.ENTER)}})),_defineProperty$2(_assertThisInitialized$1(r),"onFullscreenChange",(function(e,t){var i=function(){util.setTimeout(_assertThisInitialized$1(r),(function(){r.resize()}),100)},n=util.getFullScreenEl();r._fullActionFrom?r._fullActionFrom="":r.emit(USER_ACTION,{eventType:"system",action:"switch_fullscreen",pluginName:"player",currentTime:r.currentTime,duration:r.duration,props:[{prop:"fullscreen",from:!0,to:!1}]});var o=checkIsCurrentVideo(n,r.playerId,PLATER_ID);if(t||n&&(n===r._fullscreenEl||o))i(),!r.config.closeFocusVideoFocus&&r.media.focus(),r.fullscreen=!0,r.changeFullStyle(r.root,n,STATE_CLASS.FULLSCREEN),r.emit(FULLSCREEN_CHANGE,!0,r._fullScreenOffset),r.cssfullscreen&&r.exitCssFullscreen();else if(r.fullscreen){i();var a=_assertThisInitialized$1(r),s=a._fullScreenOffset;if(a.config.needFullscreenScroll?(window.scrollTo(s.left,s.top),util.setTimeout(_assertThisInitialized$1(r),(function(){r.fullscreen=!1,r._fullScreenOffset=null}),100)):(!r.config.closeFocusVideoFocus&&r.media.focus(),r.fullscreen=!1,r._fullScreenOffset=null),r.cssfullscreen)r.removeClass(STATE_CLASS.FULLSCREEN);else{var l=r._fullscreenEl;l||!r.root.contains(e.target)&&e.target!==r.root||(l=e.target),r.recoverFullStyle(r.root,l,STATE_CLASS.FULLSCREEN)}r._fullscreenEl=null,r.emit(FULLSCREEN_CHANGE,!1)}})),_defineProperty$2(_assertThisInitialized$1(r),"_onWebkitbeginfullscreen",(function(e){r._fullscreenEl=r.media,r.onFullscreenChange(e,!0)})),_defineProperty$2(_assertThisInitialized$1(r),"_onWebkitendfullscreen",(function(e){r.onFullscreenChange(e,!1)})),hooksDescriptor(_assertThisInitialized$1(r),PlAYER_HOOKS),r.config=n,r._pluginInfoId=util.generateSessionId(),bindDebug(_assertThisInitialized$1(r));var o=r.constructor.defaultPreset;if(r.config.presets.length){var a=r.config.presets.indexOf("default");a>=0&&o&&(r.config.presets[a]=o)}else o&&r.config.presets.push(o);if(r.userTimer=null,r.waitTimer=null,r.handleSource=!0,r._state=STATES.INITIAL,r.isAd=!1,r.isError=!1,r._hasStart=!1,r.isSeeking=!1,r.isCanplay=!1,r._useAutoplay=!1,r.__startTime=-1,r.rotateDeg=0,r.isActive=!1,r.fullscreen=!1,r.cssfullscreen=!1,r.isRotateFullscreen=!1,r._fullscreenEl=null,r.timeSegments=[],r._cssfullscreenEl=null,r.curDefinition=null,r._orgCss="",r._fullScreenOffset=null,r._videoHeight=0,r._videoWidth=0,r.videoPos={pi:1,scale:0,rotate:-1,x:0,y:0,h:-1,w:-1,vy:0,vx:0},r.sizeInfo={width:0,height:0,left:0,top:0},r._accPlayed={t:0,acc:0,loopAcc:0},r._offsetInfo={currentTime:-1,duration:0},r.innerContainer=null,r.controls=null,r.topBar=null,r.root=null,r.__i18n=I18N.init(r._pluginInfoId),sniffer.os.isAndroid&&sniffer.osVersion>0&&sniffer.osVersion<6&&(r.config.autoplay=!1),r.database=new INDEXDB,r.isUserActive=!1,r._onceSeekCanplay=null,r._isPauseBeforeSeek=0,r.innerStates={isActiveLocked:!1},r.instManager=instManager,!r._initDOM())return console.error(new Error("can't find the dom which id is ".concat(r.config.id," or this.config.el does not exist"))),_possibleConstructorReturn$1(r);var s=r.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]),r.config.url=u.url,r.curDefinition=u}return r._bindEvents(),r._registerPresets(),r._registerPlugins(),pluginsManager.onPluginsReady(_assertThisInitialized$1(r)),r.getInitDefinition(),r.setState(STATES.READY),util.setTimeout(_assertThisInitialized$1(r),(function(){r.emit(READY)}),0),r.onReady&&r.onReady(),(r.config.videoInit||r.config.autoplay)&&(!r.hasStart||r.state<STATES.ATTACHED)&&r.start(),r}return _createClass$2(i,[{key:"_initDOM",value:function(){var e,t=this;if(this.root=this.config.id?document.getElementById(this.config.id):null,!this.root){var i=this.config.el;if(!i||1!==i.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=i}var r=checkPlayerRoot(this.root);if(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),this.media.setAttribute(PLATER_ID,this.playerId),null===(e=instManager)||void 0===e||e.add(this),pluginsManager.init(this),this._initBaseDoms(),this.config.controls){var n=this.config.controls.root||null,o=pluginsManager.register(this,Controls,{root:n});this.controls=o}var a="mobile"===this.config.isMobileSimulateMode?"mobile":sniffer.device;if(this.addClass("".concat(STATE_CLASS.DEFAULT," ").concat(STATE_CLASS.INACTIVE," xgplayer-").concat(a," ").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 s=this.config,l=s.width,c=s.height;"number"==typeof l&&"number"==typeof c||(l=600,c=337.5);var u={width:"100%",height:"0","max-width":"100%","padding-top":"".concat(100*c/l,"%")};Object.keys(u).forEach((function(e){t.root.style[e]=u[e]}))}else["width","height"].forEach((function(e){t.config[e]&&("number"!=typeof t.config[e]?t.root.style[e]=t.config[e]:t.root.style[e]="".concat(t.config[e],"px"))}));var d=this.root.getBoundingClientRect(),h=d.width,p=d.height,f=d.left,g=d.top;return this.sizeInfo.width=h,this.sizeInfo.height=p,this.sizeInfo.left=f,this.sizeInfo.top=g,!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.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:"_clearUserTimer",value:function(){this.userTimer&&(util.clearTimeout(this,this.userTimer),this.userTimer=null)}},{key:"_startInit",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};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))){util.isNotNull(i.playSessionId)&&(this._playSessionId=i.playSessionId),this.handleSource&&(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 n=this.media.readyState;XG_DEBUG.logInfo("_startInit readyState",n),this.config.autoplay&&(!util.isMSE(this.media)&&this.load(),(sniffer.os.isIpad||sniffer.os.isPhone)&&this.mediaPlay());var o=this.config.startTime;this.__startTime=o>0?o:-1,this.config.startTime=0,n>=2&&this.duration>0?this.canPlayFunc():this.on(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 i=this.config.ignores||[],r=this.config.plugins||[],n=this.config.i18n||[];t&&I18N.extend(n,this.__i18n);var o=i.join("||").toLowerCase().split("||"),a=this.plugins;r.forEach((function(i){try{var r=i.plugin?i.plugin.pluginName:i.pluginName;if(r&&o.indexOf(r.toLowerCase())>-1)return null;if(!t&&a[r.toLowerCase()])return;if(i.lazy&&i.loader){var n=pluginsManager.lazyRegister(e,i);return void(i.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(i)}catch(e){XG_DEBUG.logError("_registerPlugins:",e)}}))}},{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$7.ROOT_RIGHT:this.rightBar||(this.rightBar=util.createPositionBar("xg-right-bar",this.root)),t=this.rightBar;break;case POSITIONS$7.ROOT_LEFT:this.leftBar||(this.leftBar=util.createPositionBar("xg-left-bar",this.root)),t=this.leftBar;break;case POSITIONS$7.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 i=pluginsManager.formatPluginInfo(e,t),r=i.PLUFGIN,n=i.options,o=this.config.plugins;!pluginsManager.checkPluginIfExits(r.pluginName,o)&&o.push(r);var a=pluginsManager.getRootByConfig(r.pluginName,this.config);a.root&&(n.root=a.root),a.position&&(n.position=a.position);var s,l=n.position?n.position:n.config&&n.config.position||r.defaultConfig&&r.defaultConfig.position;return!n.root&&"string"==typeof l&&l.indexOf("controls")>-1?null===(s=this.controls)||void 0===s?void 0:s.registerPlugin(r,n,r.pluginName):(n.root||(n.root=this._getRootByPosition(l)),pluginsManager.register(this,r,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 i=this.config.plugins.length-1;i>-1;i--){if(this.config.plugins[i].pluginName.toLowerCase()===t.toLowerCase()){this.config.plugins.splice(i,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)){var i=this._playSessionId;return util.isNotNull(i)&&(this._playSessionId=void 0),e||this.config.url||this.getInitDefinition(),this.hasStart=!0,this.setState(STATES.ATTACHING),this._registerPlugins(!1),pluginsManager.beforeInit(this).then((function(){if(t.config){e||(e=t.url||t.config.url);var r=t.preProcessUrl(e);return t._startInit(r.url,{playSessionId:i})}})).catch((function(e){throw e.fileName="player",e.lineNumber="236",XG_DEBUG.logError("start:beforeInit:",e),e}))}}},{key:"switchURL",value:function(e,t){var i=this,r=e;"Object"===util.typeOf(e)&&(r=e.url),r=this.preProcessUrl(r).url;var n=this.currentTime;this.__startTime=n;var o=this.paused&&!this.isError;return this.src=r,new Promise((function(e,t){var n=function(e){i.off("timeupdate",a),i.off("canplay",a),t(e)},a=function(){i._seekToStartTime(),o&&i.pause(),i.off("error",n),e(!0)};i.once("error",n),r?(sniffer.os.isAndroid?i.once("timeupdate",a):i.once("canplay",a),i.play()):i.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$1(_getPrototypeOf$1(i.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$1(_getPrototypeOf$1(i.prototype),"pause",this).call(this)}},{key:"videoPause",value:function(){_get$1(_getPrototypeOf$1(i.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$1(_getPrototypeOf$1(i.prototype),"pause",e).call(e)}))}},{key:"seek",value:function(e,t){var i=this;if(this.media&&!Number.isNaN(Number(e))&&this.hasStart){var r=this.config,n=r.isSeekedPlay,o=r.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(i.removeClass(STATE_CLASS.ENTER),i.isSeeking=!1,a){case"play":i.play();break;case"pause":i.pause();break;default:i._isPauseBeforeSeek>1||i.paused?i.pause():i.play()}i._isPauseBeforeSeek=0,i._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,i=t.definition;!t.url&&i&&i.list&&i.list.length>0&&i.defaultDefinition&&i.list.map((function(t){t.definition===i.defaultDefinition&&(e.config.url=t.url,e.curDefinition=t)}))}},{key:"changeDefinition",value:function(e,t){var i=this,r=this.config.definition;if(Array.isArray(null==r?void 0:r.list)&&r.list.forEach((function(t){(null==e?void 0:e.definition)===t.definition&&(i.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$2({seamless:!1!==r.seamless&&"undefined"!=typeof MediaSource&&"function"==typeof MediaSource.isTypeSupported},e));n&&n.then?n.then((function(){i.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.NO_START),this.emit(RESET)}},{key:"reset",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1?arguments[1]:void 0;if(this.resetState(),this.plugins&&(t.map((function(t){e.deregister(t)})),i)){var r=getDefaultConfig$1();Object.keys(this.config).keys((function(t){"undefined"===e.config[t]||"plugins"!==t&&"presets"!==t&&"el"!==t&&"id"!==t||(e.config[t]=r[t])}))}}},{key:"destroy",value:function(){var e,t=this,r=this.innerContainer,n=this.root,o=this.media;if(n&&o){if(this.hasStart=!1,this._useAutoplay=!1,n.removeAttribute(PLATER_ID),o.removeAttribute(PLATER_ID),this.updateAcc("destroy"),this._unbindEvents(),this._detachSourceEvents(this.media),util.clearAllTimers(this),this.emit(DESTROY),null===(e=instManager)||void 0===e||e.remove(this),pluginsManager.destroy(this),delHooksDescriptor(this),_get$1(_getPrototypeOf$1(i.prototype),"destroy",this).call(this),this.fullscreen&&this._fullscreenEl===this.root&&this.exitFullscreen(),r)for(var a=r.children,s=0;s<a.length;s++)r.removeChild(a[s]);!r&&o instanceof window.Node&&n.contains(o)&&!this.config.remainMediaAfterDestroy&&n.removeChild(o),["topBar","leftBar","rightBar","innerContainer"].map((function(e){t[e]&&n.removeChild(t[e]),t[e]=null}));var l=n.className.split(" ");l.length>0?n.className=l.filter((function(e){return e.indexOf("xgplayer")<0})).join(" "):n.className="",this.removeAttribute("data-xgfill"),["isSeeking","isCanplay","isActive","cssfullscreen","fullscreen"].forEach((function(e){t[e]=!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.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,i=e.config.url,r=util.isMSE(e.media)?{url:i}:e.preProcessUrl(i);e.src=r.url,!e.config.isLive&&(e.currentTime=t),e.once(CANPLAY,(function(){e.mediaPlay()}))}))}},{key:"changeFullStyle",value:function(e,t,i,r){e&&(r||(r=STATE_CLASS.PARENT_FULLSCREEN),this._orgCss||(this._orgCss=util.filterStyleFromText(e)),util.addClass(e,i),t&&t!==e&&!this._orgPCss&&(this._orgPCss=util.filterStyleFromText(t),util.addClass(t,r),t.setAttribute(PLATER_ID,this.playerId)))}},{key:"recoverFullStyle",value:function(e,t,i,r){r||(r=STATE_CLASS.PARENT_FULLSCREEN),this._orgCss&&(util.setStyleFromCsstext(e,this._orgCss),this._orgCss=""),util.removeClass(e,i),t&&t!==e&&this._orgPCss&&(util.setStyleFromCsstext(t,this._orgPCss),this._orgPCss="",util.removeClass(t,r),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,i=this.media;if("video"!==e&&"media"!==e||(e=this[e]),e||(e=t),this._fullScreenOffset={top:util.scrollTop(),left:util.scrollLeft()},this._fullscreenEl=e,this._fullActionFrom="get",util.getFullScreenEl()===this._fullscreenEl)return this.onFullscreenChange(),Promise.resolve();try{for(var r=0;r<GET_FULLSCREEN_API.length;r++){var n=GET_FULLSCREEN_API[r];if(e[n]){var o="webkitRequestFullscreen"===n?e.webkitRequestFullscreen(window.Element.ALLOW_KEYBOARD_INPUT):e[n]();return o&&o.then?o:Promise.resolve()}}return i.fullscreenEnabled||i.webkitSupportsFullscreen?(i.webkitEnterFullscreen(),Promise.resolve()):Promise.reject(new Error("call getFullscreen fail"))}catch(e){return Promise.reject(new Error("call getFullscreen fail"))}}},{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 i=0;i<EXIT_FULLSCREEN_API.length;i++){var r=EXIT_FULLSCREEN_API[i];if(document[r]){var n=document[r]();return n&&n.then?n:Promise.resolve()}}return t&&t.webkitSupportsFullscreen?(t.webkitExitFullScreen(),Promise.resolve()):Promise.reject(new Error("call exitFullscreen fail"))}catch(e){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 i=this.config.fullscreen,r=void 0===i?{}:i;(!0===r.useCssFullscreen||"function"==typeof r.useCssFullscreen&&r.useCssFullscreen())&&(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,i=void 0===t?{}:t;!0===i.useCssFullscreen||"function"==typeof i.useCssFullscreen&&i.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");var i=90===Math.abs(window.orientation)||90===Math.abs(screen.orientation.angle);this.root.style.width="".concat(i?window.innerWidth: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$2({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._clearUserTimer(),this.emit(PLAYER_BLUR,_objectSpread2$2({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]:{autoHide:!0,delay:3e3},i=this.innerStates;if(this.isActive=!0,this.removeClass(STATE_CLASS.INACTIVE),this._clearUserTimer(),void 0!==t.isLock&&(i.isActiveLocked=t.isLock),!1===t.autoHide||!0===t.isLock||i.isActiveLocked)this._clearUserTimer();else{var r=t&&t.delay?t.delay:this.config.inactive;this.userTimer=util.setTimeout(this,(function(){e.userTimer=null,e.blur()}),r)}}},{key:"onBlur",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).ignorePaused,t=void 0!==e&&e;if(!this.innerStates.isActiveLocked){var i=this.config.closePauseVideoFocus;this.isActive=!1,(t||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(){var e=this;this.isError=!1,this.isSeeking=!1,this.__startTime>0&&(this.duration>0?this._seekToStartTime():this.once(DURATION_CHANGE,(function(){e._seekToStartTime()})))}},{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._clearUserTimer(),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),e.emit(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)})),this._accPlayed.t||this.paused||this.ended||(this._accPlayed.t=(new Date).getTime())}},{key:"onTimeupdate",value:function(){!this._videoHeight&&this.media.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.NOTALLOW&&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,i){if(this.media&&t&&e){var r="String"===util.typeOf(e)?e:e.type||"";i.props&&"Array"!==util.typeOf(i.props)&&(i.props=[i.props]),this.emit(USER_ACTION,_objectSpread2$2({eventType:r,action:t,currentTime:this.currentTime,duration:this.duration,ended:this.ended,event:e},i))}}},{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=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{startDiff:0,endDiff:0})||{},i=t.startDiff,r=void 0===i?0:i,n=t.endDiff,o=void 0===n?0:n,a=this.media.buffered;if(!a||0===a.length||!this.duration)return!0;for(var s=e||this.media.currentTime||.2,l=a.length,c=0;c<l;c++)if(a.start(c)+r<=s&&a.end(c)-o>s)return!0;return!1}},{key:"resizePosition",value:function(){var e=this,t=this.videoPos,i=t.vy,r=t.vx,n=t.h,o=t.w,a=this.videoPos.rotate;if(!(a<0&&n<0&&o<0)){var s=this.videoPos._pi;if(!s&&this.media.videoHeight&&(s=this.media.videoWidth/this.media.videoHeight*100),s){this.videoPos.pi=s;var l={rotate:a=a<0?0:a},c=0,u=0,d=1,h=Math.abs(a/90),p=this.root,f=this.innerContainer,g=p.offsetWidth,y=f?f.offsetHeight:p.offsetHeight,_={},m=y,v=g;if(h%2==0)d=n>0?100/n:o>0?100/o:1,l.scale=d,c=i>0?(100-n)/2-i:0,l.y=2===h?0-c:c,u=r>0?(100-o)/2-r:0,l.x=2===h?0-u:u,_.width="".concat(v,"px"),_.height="".concat(m,"px"),_.maxWidth="",_.maxHeight="";else if(h%2==1){m=g;var E=y-g;u=-E/2/(v=y)*100,l.x=3===h?u+i/2:u-i/2,c=E/2/m*100,l.y=3===h?c+r/2:c-r/2,l.scale=d,_.width="".concat(v,"px"),_.maxWidth="".concat(v,"px"),_.height="".concat(m,"px"),_.maxHeight="".concat(m,"px")}var T=util.getTransformStyle(l,this.media.style.transform||this.media.style.webkitTransform);_.transform=T,_.webkitTransform=T,Object.keys(_).map((function(t){e.media.style[t]=_[t]}))}}}},{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(i){if("plugins"!==i){t.config[i]=e[i];var r=t.plugins[i.toLowerCase()];r&&"Function"===util.typeOf(r.setConfig)&&r.setConfig(e[i])}}))}},{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&&this.root){var t=this.root.getBoundingClientRect();this.sizeInfo.width=t.width,this.sizeInfo.height=t.height,this.sizeInfo.left=t.left,this.sizeInfo.top=t.top;var i=this.media,r=i.videoWidth,n=i.videoHeight,o=this.config,a=o.fitVideoSize,s=o.videoFillMode;if("fill"!==s&&"cover"!==s&&"contain"!==s||this.setAttribute("data-xgfill",s),n&&r){this._videoHeight=n,this._videoWidth=r;var l=this.controls&&this.innerContainer?this.controls.root.getBoundingClientRect().height:0,c=t.width,u=t.height-l,d=parseInt(r/n*1e3,10),h=parseInt(c/u*1e3,10),p=c,f=u,g={};"auto"===a&&h>d||"fixWidth"===a?(f=c/d*1e3,this.config.fluid?g.paddingTop="".concat(100*f/p,"%"):g.height="".concat(f+l,"px")):("auto"===a&&h<d||"fixHeight"===a)&&(p=d*u/1e3,g.width="".concat(p,"px")),this.fullscreen||this.cssfullscreen||Object.keys(g).forEach((function(t){e.root.style[t]=g[t]})),("fillHeight"===s&&h<d||"fillWidth"===s&&h>d)&&this.setAttribute("data-xgfill","cover");var y={videoScale:d,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:"preProcessUrl",value:function(e,t){var i=this.config,r=i.preProcessUrl,n=i.preProcessUrlOptions,o=Object.assign({},n,t);return util.isBlob(e)||"function"!=typeof r?{url:e}:r(e,o)}},{key:"_seekToStartTime",value:function(){this.__startTime>0&&this.duration>0&&(this.currentTime=this.__startTime>this.duration?this.duration:this.__startTime,this.__startTime=-1)}},{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,i=this.config.definition,r=null,n=null;i.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&&(r=e),i.defaultDefinition===e.definition&&(n=e)})),!n&&e.length>0&&(n=e[0]),r?this.changeDefinition(r):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){var t=I18N.langKeys.filter((function(t){return t===e}));0!==t.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$1(_getPrototypeOf$1(i.prototype),"readyState",this)}},{key:"error",get:function(){var e=_get$1(_getPrototypeOf$1(i.prototype),"error",this);return this.i18n[e]||e}},{key:"networkState",get:function(){return _get$1(_getPrototypeOf$1(i.prototype),"networkState",this)}},{key:"fullscreenChanging",get:function(){return!(null===this._fullScreenOffset)}},{key:"cumulateTime",get:function(){var e=this._accPlayed,t=e.acc,i=e.t;return i?(new Date).getTime()-i+t:t}},{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:"offsetCurrentTime",get:function(){return this._offsetInfo.currentTime||0},set:function(e){this._offsetInfo.currentTime=e}},{key:"offsetDuration",get:function(){return this._offsetInfo.duration||0},set:function(e){this._offsetInfo.duration=e||0}},{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,i){for(var r=arguments.length,n=new Array(r>3?r-3:0),o=3;o<r;o++)n[o-3]=arguments[o];return usePluginHooks.call.apply(usePluginHooks,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removePluginHooks",value:function(e,t,i){for(var r=arguments.length,n=new Array(r>3?r-3:0),o=3;o<r;o++)n[o-3]=arguments[o];return removePluginHooks.call.apply(removePluginHooks,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"setUserActive",value:function(e,t){var i;"boolean"==typeof t&&t!==this.muted&&(this.addInnerOP("volumechange"),util.typeOf(t)===Boolean&&(this.muted=t)),null===(i=instManager)||void 0===i||i.setActive(this.playerId,e)}}],[{key:"debugger",get:function(){return XG_DEBUG.config.debug},set:function(e){XG_DEBUG.config.debug=e}},{key:"instManager",get:function(){return instManager},set:function(e){instManager=e}},{key:"getCurrentUserActivePlayerId",value:function(){var e;return null===(e=instManager)||void 0===e?void 0:e.getActiveId()}},{key:"setCurrentUserActive",value:function(e,t){var i;null===(i=instManager)||void 0===i||i.setActive(e,t)}},{key:"isHevcSupported",value:function(){return sniffer.isHevcSupported()}},{key:"probeConfigSupported",value:function(e){return sniffer.probeConfigSupported(e)}},{key:"install",value:function(e,t){i.plugins||(i.plugins={}),i.plugins[e]||(i.plugins[e]=t)}},{key:"use",value:function(e,t){i.plugins||(i.plugins={}),i.plugins[e]=t}}]),i}();_defineProperty$2(Player,"defaultPreset",null),_defineProperty$2(Player,"XgVideoProxy",null),Player.instManager=InstManager.getInstance();const 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};var VIDEO_STATUS_TYPE=(e=>(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||{});const MAX_TIMESTAMP=5e9,DEFAULT_URL_EXPIRE_DIFF=60,DEFAULT_URL_CHECK_EXPIRE_INTERVAL=400,MIN_EXPIRE_INTERVAL=300,cancelTips={jp:"キャンセル",en:"Cancel",zh:"取消","zh-hk":"取消"};var KeySystemType=(e=>(e.WIDEVINE="widevine",e.FAIRPLAY="fairplay",e.PLAYREADY="playready",e))(KeySystemType||{}),jp={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:"生放送"}},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:"直播"}};const VE_DEBUG_OPEN="undefined"!=typeof window&&window.location&&window.location.href.indexOf("veplayerdebugger=1")>-1,STYLE={info:"color: #fff; background-color: #5f5f5f;",error:"color: #fff; background-color: #f53f3f;",warn:"color: #fff; background-color: #ff7d00;"},VERSION_STYLE="color: #fff; background: #4281ff",VETAG="%c VePlayer %c 1.18.0-rc.6 ",VE_DEBUG={config:{debug:VE_DEBUG_OPEN?3:1},log:function(e,...t){this.config.debug>=3&&console.log(VETAG,STYLE.info,VERSION_STYLE,e,...t)},warn:function(e,...t){this.config.debug>=1&&console.warn(VETAG,STYLE.warn,VERSION_STYLE,e,...t)},error:function(e,...t){if(this.config.debug<1)return;const i=this.config.debug>=2?"trace":"error";console[i](VETAG,STYLE.error,VERSION_STYLE,e,...t)}};function setDebug(e){VE_DEBUG.config.debug=e?3:1}localStorage.getItem("velog")&&(VE_DEBUG.config.debug=3);var dayjs_min={exports:{}};dayjs_min.exports=function(){var e=1e3,t=6e4,i=36e5,r="millisecond",n="second",o="minute",a="hour",s="day",l="week",c="month",u="quarter",d="year",h="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"],i=e%100;return"["+e+(t[(i-20)%10]||t[i]||t[0])+"]"}},_=function(e,t,i){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(i)+e},m={s:_,z:function(e){var t=-e.utcOffset(),i=Math.abs(t),r=Math.floor(i/60),n=i%60;return(t<=0?"+":"-")+_(r,2,"0")+":"+_(n,2,"0")},m:function e(t,i){if(t.date()<i.date())return-e(i,t);var r=12*(i.year()-t.year())+(i.month()-t.month()),n=t.clone().add(r,c),o=i-n<0,a=t.clone().add(r+(o?-1:1),c);return+(-(r+(i-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:d,w:l,d:s,D:h,h:a,m:o,s:n,ms:r,Q:u}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},v="en",E={};E[v]=y;var T=function(e){return e instanceof b},S=function e(t,i,r){var n;if(!t)return v;if("string"==typeof t){var o=t.toLowerCase();E[o]&&(n=o),i&&(E[o]=i,n=o);var a=t.split("-");if(!n&&a.length>1)return e(a[0])}else{var s=t.name;E[s]=t,n=s}return!r&&n&&(v=n),n||!r&&v},P=function(e,t){if(T(e))return e.clone();var i="object"==typeof t?t:{};return i.date=e,i.args=arguments,new b(i)},C=m;C.l=S,C.i=T,C.w=function(e,t){return P(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var b=function(){function y(e){this.$L=S(e.locale,null,!0),this.parse(e)}var _=y.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,i=e.utc;if(null===t)return new Date(NaN);if(C.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(f);if(r){var n=r[2]-1||0,o=(r[7]||"0").substring(0,3);return i?new Date(Date.UTC(r[1],n,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)):new Date(r[1],n,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},_.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()},_.$utils=function(){return C},_.isValid=function(){return!(this.$d.toString()===p)},_.isSame=function(e,t){var i=P(e);return this.startOf(t)<=i&&i<=this.endOf(t)},_.isAfter=function(e,t){return P(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<P(e)},_.$g=function(e,t,i){return C.u(e)?this[t]:this.set(i,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var i=this,r=!!C.u(t)||t,u=C.p(e),p=function(e,t){var n=C.w(i.$u?Date.UTC(i.$y,t,e):new Date(i.$y,t,e),i);return r?n:n.endOf(s)},f=function(e,t){return C.w(i.toDate()[e].apply(i.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),i)},g=this.$W,y=this.$M,_=this.$D,m="set"+(this.$u?"UTC":"");switch(u){case d:return r?p(1,0):p(31,11);case c:return r?p(1,y):p(0,y+1);case l:var v=this.$locale().weekStart||0,E=(g<v?g+7:g)-v;return p(r?_-E:_+(6-E),y);case s:case h: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()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var i,l=C.p(e),u="set"+(this.$u?"UTC":""),p=(i={},i[s]=u+"Date",i[h]=u+"Date",i[c]=u+"Month",i[d]=u+"FullYear",i[a]=u+"Hours",i[o]=u+"Minutes",i[n]=u+"Seconds",i[r]=u+"Milliseconds",i)[l],f=l===s?this.$D+(t-this.$W):t;if(l===c||l===d){var g=this.clone().set(h,1);g.$d[p](f),g.init(),this.$d=g.set(h,Math.min(this.$D,g.daysInMonth())).$d}else p&&this.$d[p](f);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[C.p(e)]()},_.add=function(r,u){var h,p=this;r=Number(r);var f=C.p(u),g=function(e){var t=P(p);return C.w(t.date(t.date()+Math.round(e*r)),p)};if(f===c)return this.set(c,this.$M+r);if(f===d)return this.set(d,this.$y+r);if(f===s)return g(1);if(f===l)return g(7);var y=(h={},h[o]=t,h[a]=i,h[n]=e,h)[f]||1,_=this.$d.getTime()+r*y;return C.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,i=this.$locale();if(!this.isValid())return i.invalidDate||p;var r=e||"YYYY-MM-DDTHH:mm:ssZ",n=C.z(this),o=this.$H,a=this.$m,s=this.$M,l=i.weekdays,c=i.months,u=function(e,i,n,o){return e&&(e[i]||e(t,r))||n[i].slice(0,o)},d=function(e){return C.s(o%12||12,e,"0")},h=i.meridiem||function(e,t,i){var r=e<12?"AM":"PM";return i?r.toLowerCase():r},f={YY:String(this.$y).slice(-2),YYYY:this.$y,M:s+1,MM:C.s(s+1,2,"0"),MMM:u(i.monthsShort,s,c,3),MMMM:u(c,s),D:this.$D,DD:C.s(this.$D,2,"0"),d:String(this.$W),dd:u(i.weekdaysMin,this.$W,l,2),ddd:u(i.weekdaysShort,this.$W,l,3),dddd:l[this.$W],H:String(o),HH:C.s(o,2,"0"),h:d(1),hh:d(2),a:h(o,a,!0),A:h(o,a,!1),m:String(a),mm:C.s(a,2,"0"),s:String(this.$s),ss:C.s(this.$s,2,"0"),SSS:C.s(this.$ms,3,"0"),Z:n};return r.replace(g,(function(e,t){return t||f[e]||n.replace(":","")}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,h,p){var f,g=C.p(h),y=P(r),_=(y.utcOffset()-this.utcOffset())*t,m=this-y,v=C.m(this,y);return v=(f={},f[d]=v/12,f[c]=v,f[u]=v/3,f[l]=(m-_)/6048e5,f[s]=(m-_)/864e5,f[a]=m/i,f[o]=m/t,f[n]=m/e,f)[g]||m,p?v:C.a(v)},_.daysInMonth=function(){return this.endOf(c).$D},_.$locale=function(){return E[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var i=this.clone(),r=S(e,t,!0);return r&&(i.$L=r),i},_.clone=function(){return C.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},y}(),I=b.prototype;return P.prototype=I,[["$ms",r],["$s",n],["$m",o],["$H",a],["$W",s],["$M",c],["$y",d],["$D",h]].forEach((function(e){I[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),P.extend=function(e,t){return e.$i||(e(t,b,P),e.$i=!0),P},P.locale=S,P.isDayjs=T,P.unix=function(e){return P(1e3*e)},P.en=E[v],P.Ls=E,P.p={},P}();var dayjs_minExports=dayjs_min.exports;const dayjs=getDefaultExportFromCjs(dayjs_minExports);var utc$1={exports:{}};!function(e,t){var i,r,n;utc$1.exports=(i="minute",r=/[+-]\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(),i):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(r);if(!t)return null;var i=(""+t[0]).match(n)||["-",0,0],o=i[0],a=60*+i[1]+ +i[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,i)).$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 d=a.toDate;a.toDate=function(e){return"s"===e&&this.$offset?o(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():d.call(this)};var h=a.diff;a.diff=function(e,t,i){if(e&&this.$u===e.$u)return h.call(this,e,t,i);var r=this.local(),n=o(e).local();return h.call(r,n,t,i)}})}();var utcExports=utc$1.exports;const utc=getDefaultExportFromCjs(utcExports);var dist=function(e){var t={};function i(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=e,i.c=t,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=22)}([function(e,t,i){var r=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(e,t,i){var r=i(12)("wks"),n=i(13),o=i(0).Symbol,a="function"==typeof o;(e.exports=function(e){return r[e]||(r[e]=a&&o[e]||(a?o:n)("Symbol."+e))}).store=r},function(e,t,i){var r=e.exports={version:"2.6.12"};"number"==typeof __e&&(__e=r)},function(e,t,i){var r=i(4);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t,i){var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};e.exports=function(e){return"object"===(void 0===e?"undefined":r(e))?null!==e:"function"==typeof e}},function(e,t,i){var r=i(6);e.exports=function(e,t,i){if(r(e),void 0===t)return e;switch(i){case 1:return function(i){return e.call(t,i)};case 2:return function(i,r){return e.call(t,i,r)};case 3:return function(i,r,n){return e.call(t,i,r,n)}}return function(){return e.apply(t,arguments)}}},function(e,t,i){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,i){e.exports=!i(15)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(e,t,i){var r={}.toString;e.exports=function(e){return r.call(e).slice(8,-1)}},function(e,t,i){var r=i(3),n=i(26),o=i(27),a=Object.defineProperty;t.f=i(7)?Object.defineProperty:function(e,t,i){if(r(e),t=o(t,!0),r(i),n)try{return a(e,t,i)}catch(e){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(e[t]=i.value),e}},function(e,t,i){e.exports=!1},function(e,t,i){var r=i(8),n=i(1)("toStringTag"),o="Arguments"==r(function(){return arguments}());e.exports=function(e){var t,i,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),n))?i:o?r(t):"Object"==(a=r(t))&&"function"==typeof t.callee?"Arguments":a}},function(e,t,i){var r=i(2),n=i(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:r.version,mode:i(10)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(e,t,i){var r=0,n=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++r+n).toString(36))}},function(e,t,i){var r=i(9),n=i(28);e.exports=i(7)?function(e,t,i){return r.f(e,t,n(1,i))}:function(e,t,i){return e[t]=i,e}},function(e,t,i){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,i){var r=i(4),n=i(0).document,o=r(n)&&r(n.createElement);e.exports=function(e){return o?n.createElement(e):{}}},function(e,t,i){var r=i(0),n=i(14),o=i(18),a=i(13)("src"),s=i(29),l=(""+s).split("toString");i(2).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,i,s){var c="function"==typeof i;c&&(o(i,"name")||n(i,"name",t)),e[t]!==i&&(c&&(o(i,a)||n(i,a,e[t]?""+e[t]:l.join(String(t)))),e===r?e[t]=i:s?e[t]?e[t]=i:n(e,t,i):(delete e[t],n(e,t,i)))})(Function.prototype,"toString",(function(){return"function"==typeof this&&this[a]||s.call(this)}))},function(e,t,i){var r={}.hasOwnProperty;e.exports=function(e,t){return r.call(e,t)}},function(e,t,i){e.exports={}},function(e,t,i){var r,n,o,a=i(5),s=i(38),l=i(39),c=i(16),u=i(0),d=u.process,h=u.setImmediate,p=u.clearImmediate,f=u.MessageChannel,g=u.Dispatch,y=0,_={},m=function(){var e=+this;if(_.hasOwnProperty(e)){var t=_[e];delete _[e],t()}},v=function(e){m.call(e.data)};h&&p||(h=function(e){for(var t=[],i=1;arguments.length>i;)t.push(arguments[i++]);return _[++y]=function(){s("function"==typeof e?e:Function(e),t)},r(y),y},p=function(e){delete _[e]},"process"==i(8)(d)?r=function(e){d.nextTick(a(m,e,1))}:g&&g.now?r=function(e){g.now(a(m,e,1))}:f?(o=(n=new f).port2,n.port1.onmessage=v,r=a(o.postMessage,o,1)):u.addEventListener&&"function"==typeof postMessage&&!u.importScripts?(r=function(e){u.postMessage(e+"","*")},u.addEventListener("message",v,!1)):r="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:h,clear:p}},function(e,t,i){var r=i(6);function n(e){var t,i;this.promise=new e((function(e,r){if(void 0!==t||void 0!==i)throw TypeError("Bad Promise constructor");t=e,i=r})),this.resolve=r(t),this.reject=r(i)}e.exports.f=function(e){return new n(e)}},function(e,t,i){e.exports=i(23)},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),i(24);var r,n=(r=i(48))&&r.__esModule?r:{default:r};t.default={url:n.default},e.exports=t.default},function(e,t,i){var r,n,o,a,s=i(10),l=i(0),c=i(5),u=i(11),d=i(25),h=i(4),p=i(6),f=i(30),g=i(31),y=i(37),_=i(20).set,m=i(40)(),v=i(21),E=i(41),T=i(42),S=i(43),P=l.TypeError,C=l.process,b=C&&C.versions,I=b&&b.v8||"",A=l.Promise,O="process"==u(C),D=function(){},R=n=v.f,$=!!function(){try{var e=A.resolve(1),t=(e.constructor={})[i(1)("species")]=function(e){e(D,D)};return(O||"function"==typeof PromiseRejectionEvent)&&e.then(D)instanceof t&&0!==I.indexOf("6.6")&&-1===T.indexOf("Chrome/66")}catch(e){}}(),L=function(e){var t;return!(!h(e)||"function"!=typeof(t=e.then))&&t},k=function(e,t){if(!e._n){e._n=!0;var i=e._c;m((function(){for(var r=e._v,n=1==e._s,o=0,a=function(t){var i,o,a,s=n?t.ok:t.fail,l=t.resolve,c=t.reject,u=t.domain;try{s?(n||(2==e._h&&w(e),e._h=1),!0===s?i=r:(u&&u.enter(),i=s(r),u&&(u.exit(),a=!0)),i===t.promise?c(P("Promise-chain cycle")):(o=L(i))?o.call(i,l,c):l(i)):c(r)}catch(e){u&&!a&&u.exit(),c(e)}};i.length>o;)a(i[o++]);e._c=[],e._n=!1,t&&!e._h&&x(e)}))}},x=function(e){_.call(l,(function(){var t,i,r,n=e._v,o=N(e);if(o&&(t=E((function(){O?C.emit("unhandledRejection",n,e):(i=l.onunhandledrejection)?i({promise:e,reason:n}):(r=l.console)&&r.error&&r.error("Unhandled promise rejection",n)})),e._h=O||N(e)?2:1),e._a=void 0,o&&t.e)throw t.v}))},N=function(e){return 1!==e._h&&0===(e._a||e._c).length},w=function(e){_.call(l,(function(){var t;O?C.emit("rejectionHandled",e):(t=l.onrejectionhandled)&&t({promise:e,reason:e._v})}))},M=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()),k(t,!0))},U=function e(t){var i,r=this;if(!r._d){r._d=!0,r=r._w||r;try{if(r===t)throw P("Promise can't be resolved itself");(i=L(t))?m((function(){var n={_w:r,_d:!1};try{i.call(t,c(e,n,1),c(M,n,1))}catch(e){M.call(n,e)}})):(r._v=t,r._s=1,k(r,!1))}catch(e){M.call({_w:r,_d:!1},e)}}};$||(A=function(e){f(this,A,"Promise","_h"),p(e),r.call(this);try{e(c(U,this,1),c(M,this,1))}catch(e){M.call(this,e)}},(r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=i(44)(A.prototype,{then:function(e,t){var i=R(y(this,A));return i.ok="function"!=typeof e||e,i.fail="function"==typeof t&&t,i.domain=O?C.domain:void 0,this._c.push(i),this._a&&this._a.push(i),this._s&&k(this,!1),i.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new r;this.promise=e,this.resolve=c(U,e,1),this.reject=c(M,e,1)},v.f=R=function(e){return e===A||e===a?new o(e):n(e)}),d(d.G+d.W+d.F*!$,{Promise:A}),i(45)(A,"Promise"),i(46)("Promise"),a=i(2).Promise,d(d.S+d.F*!$,"Promise",{reject:function(e){var t=R(this);return(0,t.reject)(e),t.promise}}),d(d.S+d.F*(s||!$),"Promise",{resolve:function(e){return S(s&&this===a?A:this,e)}}),d(d.S+d.F*!($&&i(47)((function(e){A.all(e).catch(D)}))),"Promise",{all:function(e){var t=this,i=R(t),r=i.resolve,n=i.reject,o=E((function(){var i=[],o=0,a=1;g(e,!1,(function(e){var s=o++,l=!1;i.push(void 0),a++,t.resolve(e).then((function(e){l||(l=!0,i[s]=e,--a||r(i))}),n)})),--a||r(i)}));return o.e&&n(o.v),i.promise},race:function(e){var t=this,i=R(t),r=i.reject,n=E((function(){g(e,!1,(function(e){t.resolve(e).then(i.resolve,r)}))}));return n.e&&r(n.v),i.promise}})},function(e,t,i){var r=i(0),n=i(2),o=i(14),a=i(17),s=i(5),l=function e(t,i,l){var c,u,d,h,p=t&e.F,f=t&e.G,g=t&e.P,y=t&e.B,_=f?r:t&e.S?r[i]||(r[i]={}):(r[i]||{}).prototype,m=f?n:n[i]||(n[i]={}),v=m.prototype||(m.prototype={});for(c in f&&(l=i),l)d=((u=!p&&_&&void 0!==_[c])?_:l)[c],h=y&&u?s(d,r):g&&"function"==typeof d?s(Function.call,d):d,_&&a(_,c,d,t&e.U),m[c]!=d&&o(m,c,h),g&&v[c]!=d&&(v[c]=d)};r.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,i){e.exports=!i(7)&&!i(15)((function(){return 7!=Object.defineProperty(i(16)("div"),"a",{get:function(){return 7}}).a}))},function(e,t,i){var r=i(4);e.exports=function(e,t){if(!r(e))return e;var i,n;if(t&&"function"==typeof(i=e.toString)&&!r(n=i.call(e)))return n;if("function"==typeof(i=e.valueOf)&&!r(n=i.call(e)))return n;if(!t&&"function"==typeof(i=e.toString)&&!r(n=i.call(e)))return n;throw TypeError("Can't convert object to primitive value")}},function(e,t,i){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,i){e.exports=i(12)("native-function-to-string",Function.toString)},function(e,t,i){e.exports=function(e,t,i,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(i+": incorrect invocation!");return e}},function(e,t,i){var r=i(5),n=i(32),o=i(33),a=i(3),s=i(34),l=i(36),c={},u={},d=e.exports=function(e,t,i,d,h){var p,f,g,y,_=h?function(){return e}:l(e),m=r(i,d,t?2:1),v=0;if("function"!=typeof _)throw TypeError(e+" is not iterable!");if(o(_)){for(p=s(e.length);p>v;v++)if((y=t?m(a(f=e[v])[0],f[1]):m(e[v]))===c||y===u)return y}else for(g=_.call(e);!(f=g.next()).done;)if((y=n(g,m,f.value,t))===c||y===u)return y};d.BREAK=c,d.RETURN=u},function(e,t,i){var r=i(3);e.exports=function(e,t,i,n){try{return n?t(r(i)[0],i[1]):t(i)}catch(t){var o=e.return;throw void 0!==o&&r(o.call(e)),t}}},function(e,t,i){var r=i(19),n=i(1)("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||o[n]===e)}},function(e,t,i){var r=i(35),n=Math.min;e.exports=function(e){return e>0?n(r(e),9007199254740991):0}},function(e,t,i){var r=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:r)(e)}},function(e,t,i){var r=i(11),n=i(1)("iterator"),o=i(19);e.exports=i(2).getIteratorMethod=function(e){if(null!=e)return e[n]||e["@@iterator"]||o[r(e)]}},function(e,t,i){var r=i(3),n=i(6),o=i(1)("species");e.exports=function(e,t){var i,a=r(e).constructor;return void 0===a||null==(i=r(a)[o])?t:n(i)}},function(e,t,i){e.exports=function(e,t,i){var r=void 0===i;switch(t.length){case 0:return r?e():e.call(i);case 1:return r?e(t[0]):e.call(i,t[0]);case 2:return r?e(t[0],t[1]):e.call(i,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(i,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(i,t[0],t[1],t[2],t[3])}return e.apply(i,t)}},function(e,t,i){var r=i(0).document;e.exports=r&&r.documentElement},function(e,t,i){var r=i(0),n=i(20).set,o=r.MutationObserver||r.WebKitMutationObserver,a=r.process,s=r.Promise,l="process"==i(8)(a);e.exports=function(){var e,t,i,c=function(){var r,n;for(l&&(r=a.domain)&&r.exit();e;){n=e.fn,e=e.next;try{n()}catch(r){throw e?i():t=void 0,r}}t=void 0,r&&r.enter()};if(l)i=function(){a.nextTick(c)};else if(!o||r.navigator&&r.navigator.standalone)if(s&&s.resolve){var u=s.resolve(void 0);i=function(){u.then(c)}}else i=function(){n.call(r,c)};else{var d=!0,h=document.createTextNode("");new o(c).observe(h,{characterData:!0}),i=function(){h.data=d=!d}}return function(r){var n={fn:r,next:void 0};t&&(t.next=n),e||(e=n,i()),t=n}}},function(e,t,i){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,i){var r=i(0).navigator;e.exports=r&&r.userAgent||""},function(e,t,i){var r=i(3),n=i(4),o=i(21);e.exports=function(e,t){if(r(e),n(t)&&t.constructor===e)return t;var i=o.f(e);return(0,i.resolve)(t),i.promise}},function(e,t,i){var r=i(17);e.exports=function(e,t,i){for(var n in t)r(e,n,t[n],i);return e}},function(e,t,i){var r=i(9).f,n=i(18),o=i(1)("toStringTag");e.exports=function(e,t,i){e&&!n(e=i?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},function(e,t,i){var r=i(0),n=i(9),o=i(7),a=i(1)("species");e.exports=function(e){var t=r[e];o&&t&&!t[a]&&n.f(t,a,{configurable:!0,get:function(){return this}})}},function(e,t,i){var r=i(1)("iterator"),n=!1;try{var o=[7][r]();o.return=function(){n=!0},Array.from(o,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!n)return!1;var i=!1;try{var o=[7],a=o[r]();a.next=function(){return{done:i=!0}},o[r]=function(){return a},e(o)}catch(e){}return i}},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.default=function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!e||!t)return Promise.reject("vid, host and token can't be empty");var s=void 0;try{s=(0,o.getUri)(e,t,i,n)}catch(e){return Promise.reject(e.message)}return new a.default({type:"json",method:"GET",url:s}).then((function(e){var t=void 0;if(e&&e.response)switch(r(e.response)){case"string":t=JSON.parse(e.response).Result;break;case"object":t=e.response.Result;break;default:t=e.response}else t=e;return t}))};var n,o=i(49),a=(n=i(51))&&n.__esModule?n:{default:n};e.exports=t.default},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.getUri=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments[3];try{e=JSON.parse((0,r.decode)(e))}catch(e){throw new Error("base64 decode error: "+e.message)}!1===o.jointSsl||n(i,"ssl")||n(i,"Ssl")||(i.Ssl=1);var a=(/^http/.test(t)?t:"//"+t)+"?"+e.GetPlayInfoToken+function(e){var t=[];for(var i in e)n(e,i)&&t.push(i+"="+e[i]);return t.length>0?"&"+t.join("&"):""}(i);return a};var r=i(50),n=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){var t=void 0,i=void 0,r=void 0,n=void 0,o=void 0,a=void 0,s=[-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],l=e.length;for(o=0,a="";o<l;){do{t=s[255&e.charCodeAt(o++)]}while(o<l&&-1===t);if(-1===t)break;do{i=s[255&e.charCodeAt(o++)]}while(o<l&&-1===i);if(-1===i)break;a+=String.fromCharCode(t<<2|(48&i)>>4);do{if(61==(r=255&e.charCodeAt(o++)))return a;r=s[r]}while(o<l&&-1===r);if(-1===r)break;a+=String.fromCharCode((15&i)<<4|(60&r)>>2);do{if(61==(n=255&e.charCodeAt(o++)))return a;n=s[n]}while(o<l&&-1===n);if(-1===n)break;a+=String.fromCharCode((3&r)<<6|n)}return a}},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var i=t.url,r=t.method,n=void 0===r?"GET":r,o=t.data,a=void 0===o?{}:o,s=t.headers,l=void 0===s?{}:s;return new Promise((function(e,t){var r=new window.XMLHttpRequest,o=n.toUpperCase(),s=[];if("GET"!==o)throw new Error("xhr "+o+" is not supported");for(var c in a)s.push(c+"="+a[c]);for(var u in r.open(o,""+i,!0),r.responseType="",l)Object.prototype.hasOwnProperty.call(l,u)&&r.setRequestHeader(u,""+l[u]);r.onload=function(){200===r.status||206===r.status?e(r):t(r)},r.onerror=r.ontimeout=function(){return t(r)},r.send()}))},e.exports=t.default}]);const Service=getDefaultExportFromCjs(dist);dayjs.extend(utc);var VideoFileTypes=(e=>(e.VIDEO="video",e.EVIDEO="evideo",e.DRM_EVIDEO="drm_evideo",e))(VideoFileTypes||{});function safeJSONDecode(e){try{return JSON.parse(e)}catch(t){return VE_DEBUG.warn(`[utils/json] decode fail: ${e}`,t),null}}function parseToken(e,t="GetPlayInfoToken"){if(!e)return;const i={},r=safeJSONDecode(window.atob(e));if(r&&"string"==typeof r[t]){r[t].split("&").map((e=>{const t=e.split("=");t[0]&&t[1]&&(i[t[0]]=t[1])}))}return i}function getAtobToken(e,t="GetPlayInfoToken"){const i=safeJSONDecode(window.atob(e));return i?i[t]:""}function getQueryParams(e){const t={};return decodeURIComponent(e).split("&").map((e=>{const i=e.split("=");i[0]&&i[1]&&(t[decodeURIComponent(i[0])]=decodeURIComponent(i[1]))})),t}const isEncryptPlay=function(e){var t,i;if(!(null==e?void 0:e.playAuthToken))return!1;const r=parseToken(null==e?void 0:e.playAuthToken),n=null!=(i=null==(t=null==r?void 0:r.FileType)?void 0:t.toLowerCase())?i:"video";return!!r&&("evideo"===n||"eaudio"===n)},getFormat=e=>{var t,i,r;if(!(null==e?void 0:e.playAuthToken))return;const n=parseToken(null==e?void 0:e.playAuthToken),o=null!=(i=null==(t=null==n?void 0:n.FileType)?void 0:t.toLowerCase())?i:"video",a=null==(r=null==n?void 0:n.Format)?void 0:r.toLowerCase();return a||(Object.values(VideoFileTypes).includes(o)?EVideoFormat.MP4:EAudioFormat.M4A)},isTokenExpired=function(e){if(!e["X-Expires"]||!e["X-Date"])return!1;const t=parseInt(e["X-Expires"]);if(isNaN(t))return!1;const i=e["X-Date"].replace(/T/g," ").replace(/Z/g,""),r=dayjs.utc(i,"YYYYMMDD hhmmss");if(!r.isValid())return!1;return r.add(t,"seconds").isBefore(dayjs())};function playListSort(e,t){const i=["240p","360p","480p","540p","720p","1080p","2k","4k","od","oe"],r=e.Definition,n=t.Definition;if(i.includes(r)&&i.includes(n)){const e=i.findIndex((e=>e.toLocaleLowerCase()===r.toLocaleLowerCase()));return i.findIndex((e=>e.toLocaleLowerCase()===n.toLocaleLowerCase()))-e}return t.Bitrate&&e.Bitrate?t.Bitrate-e.Bitrate:-1}function getPlayInfoByAuthToken(e){const{playAuthToken:t,playDomain:i,reqParams:r={},definitionMap:n,needThumbs:o=!1,needBarrageMask:a=!1,autoDemoteDefinition:s,autoDemoteDefinitionTextKey:l,urlQueryParams:c}=e;if(t){const e=__spreadProps(__spreadValues({},r),{NeedThumbs:o?1:0,NeedBarrageMask:a?1:0});return new Promise(((r,o)=>{Service.url(t,i,e).then((e=>{var t;const{Status:i,PlayInfoList:o=[],PosterUrl:a,Vid:u,Duration:d,BarrageMaskUrl:h,ThumbInfoList:p=[],EnableAdaptive:f,AdaptiveBitrateStreamingInfo:g}=e.Data||e;if(i===VIDEO_STATUS_TYPE.VALID&&o.length){const i=o.map((e=>{var t;const i=c?addUrlParam$1(e.MainPlayUrl,c):e.MainPlayUrl,r=c?addUrlParam$1(e.BackupPlayUrl,c):e.BackupPlayUrl;return __spreadValues(__spreadValues({vid:u,url:i,_mainURL:i,_backupURL:r,streamType:e.Format,backupUrl:r,backUrlList:[r],fileType:e.FileType,format:e.Format,bitrate:e.Bitrate,size:e.Size,kid:e.PlayAuthId,playAuthId:e.PlayAuthId,playAuth:e.PlayAuth,secretKey:e.PlayAuth,vwidth:e.Width,vheight:e.Height,vtype:null==(t=e.Format)?void 0:t.toLocaleUpperCase(),codec:e.Codec,urlExpireTimestamp:getIntNumber$1(e.MainUrlExpire,10,MAX_TIMESTAMP),drmType:e.DrmType},e),getDefinitionInfo(e,{definitionMap:n,autoDemoteDefinition:s,autoDemoteDefinitionTextKey:l}))})).sort(playListSort);r({playList:i,type:null==(t=i[0])?void 0:t.Format,poster:a,vid:u,duration:d,dashOpts:e.Data?e:{Data:__spreadProps(__spreadValues({},e),{VideoID:u})},thumbs:p,barrageMaskUrl:h,enableAdaptive:f,adaptiveBitrateStreamingInfo:g})}else r({playList:[],poster:a,vid:u,duration:d,dashOpts:e.Data?e:{Data:e},thumbs:p,barrageMaskUrl:h,enableAdaptive:f,adaptiveBitrateStreamingInfo:g}),VE_DEBUG.error("HAS NO VIDEO INFORMATION CORRECTLY, PLEASE CHECK THE TOKEN.")})).catch((e=>{VE_DEBUG.log("err",e),o(e)}))}))}return Promise.resolve(void 0)}function retryByError(e,t,i,r){return __async(this,null,(function*(){try{return yield e()}catch(n){if(--t&&i(n))return retryByError(e,t,i,r);if(r&&"function"==typeof r)return yield r(n);throw n}}))}function getServerProcessSPCPath(e,t,i,r){return i+"/?"+r+"&"+genQueryString$1({ThirdPartyDrmType:e,Kid:t})}const storageKeyPrefix="__veplayer_";function saveInfoByStorage(e,t="",i){if(!e)return;const r=storageKeyPrefix+t+"_"+e;localStorage.setItem(r,i+"")}function getInfoByStorage(e,t=""){if(!e)return;const i=storageKeyPrefix+t+"_"+e;return localStorage.getItem(i)}function createLineUserId(){var e,t;try{const i=null==(t=null==(e=globalThis.crypto)?void 0:e.randomUUID)?void 0:t.call(e);if("string"==typeof i&&i.length>0)return i}catch(e){}return`ve_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,14)}`}function getOrCreateDramaVodLineUserId(e){if(!e)return createLineUserId();const t=`line_user_${encodeURIComponent(e)}`;try{const e=getInfoByStorage(t,"ttdrama");if(e)return e;const i=createLineUserId();return saveInfoByStorage(t,"ttdrama",i),i}catch(e){return createLineUserId()}}function getResponseHeaders$1(e){const t={};if(e instanceof window.XMLHttpRequest)try{const i=e.getAllResponseHeaders();i.trim().split(/[\r\n]+/).forEach((function(e){const i=e.split(": "),r=i.shift();t[r]=i.join(": ")}))}catch(e){return t}return t}function nowTime$2(){try{return Math.round(window.performance.now())}catch(e){return(new Date).getTime()}}var XHRCustomStatus=(e=>(e[e.DEFAULT=0]="DEFAULT",e[e.ERROR=-1]="ERROR",e[e.TIMEOUT=-2]="TIMEOUT",e))(XHRCustomStatus||{});function getXhr$1(e,t){return new Promise(((i,r)=>{try{e||r(new Error("url is undefined"));let n=nowTime$2();const o=n,a=new window.XMLHttpRequest,s={status:0,statusText:"",connectTime:0,raw:a};a.open("get",e),a.onreadystatechange=()=>{2===a.readyState&&(s.headers=getResponseHeaders$1(a),s.connectTime=nowTime$2()-o,s.status=a.status,s.statusText=a.statusText,n=nowTime$2())},a.onload=()=>{s.response=a.response,i(s)},a.onprogress=e=>{const t=nowTime$2()-n;let i=0;i=parseInt(""+e.loaded/1e3/(t/1e3),10),s.speed=0|i,s.costTime=t},a.onerror=()=>{s.status||(s.status=-1,s.costTime=nowTime$2()-n),r(s)},a.ontimeout=()=>{s.status||(s.status=-2,s.costTime=nowTime$2()-n),i(s)},a.onabort=()=>{i(s)},(null==t?void 0:t.type)&&(a.responseType=t.type),a.timeout=(null==t?void 0:t.timeout)||1e4,a.setRequestHeader("Range",`bytes=${(null==t?void 0:t.range)||"0-1048576"}`),a.send()}catch(e){r(e)}}))}function isXHRResponse(e){return!(!e||"object"!=typeof e)&&("responseText"in e&&"status"in e&&"statusText"in e)}function isFetchResponse(e){return!(!e||"object"!=typeof e)&&("json"in e&&"text"in e&&"status"in e)}function getResponseText(e){return isXHRResponse(e)?e.responseText:isFetchResponse(e)?e.text():e}function isMSE(e){var t,i,r;if(e.url)return(null==(i=null==(t=null==e?void 0:e.plugins)?void 0:t.encrypthlsplugin)?void 0:i.hls)||(null==(r=null==e?void 0:e.plugins)?void 0:r.mp4encryptplayer)?1:+util.isMSE(e.media)}function getCurrentPlayerSumNum(e){var t,i;let r=0;return null==(i=null==(t=null==e?void 0:e.instManager)?void 0:t.forEach)||i.call(t,(()=>(r++,!0))),r}function canPlayHLSByNative(){return!!document.createElement("video").canPlayType("application/vnd.apple.mpegurl")}function getNow(){const e=globalThis.performance;return(null==e?void 0:e.now)&&"function"==typeof e.now?()=>e.now():()=>Date.now()}function toMsInt(e){return Number.isFinite(e)?Math.max(0,Math.round(e)):0}class CreatePlayerPerfCollector{constructor(){this.timings=[],this.timingMap={},this.now=getNow(),this.startAt=this.now()}markDuration(e,t){const i=toMsInt(t);this.timings.push({name:e,duration:i}),this.timingMap[e]=i}measure(e,t){const i=this.now();try{return t()}finally{this.markDuration(e,this.now()-i)}}measureAsync(e,t){return __async(this,null,(function*(){const i=this.now();try{return yield t()}finally{this.markDuration(e,this.now()-i)}}))}finish(){return{totalDuration:toMsInt(this.now()-this.startAt),timings:[...this.timings],timingMap:__spreadValues({},this.timingMap)}}}let collector;const setCollector=e=>{collector=e},getCollector=()=>collector,formatDemotePriority=e=>(null==e?void 0:e.length)&&e.reduce(((t,i,r)=>(t[i]={next:r+1>=e.length?null:e[r+1],pre:0===r?null:e[r-1]},t)),{}),getDefinitionInfo=function(e,t){var i;const{definitionMap:r,autoDemoteDefinition:n,autoDemoteDefinitionTextKey:o}=t||{},a=e,s=a.Definition||a.Quality||a.definition||a.quality;if(!e||!s)return{definition:"240P"};if(r){let e={definition:s};const t=r[s];return e=t?"string"==typeof t?{definition:t}:__spreadValues({definition:s},t||{}):{definition:s},n&&n.toLocaleLowerCase()===(null==(i=null==e?void 0:e.definition)?void 0:i.toLocaleLowerCase())&&(e={definition:"auto",definitionTextKey:o,mapDefinition:e.definition}),e}return{definition:s}};class IntervalTimer{constructor(){this.timeID=null,this.func=null}repeat(e,t){this.timeID=1,this.repeatInterval(e,t)}repeatInterval(e,t){this.timeID&&(null===this.func&&(this.func=e),this.func===e&&(this.timeID&&clearTimeout(this.timeID),this.timeID=null,this.timeID=setTimeout((()=>{e(),this.repeatInterval(e,t)}),t)))}clear(){clearTimeout(this.timeID),this.timeID=null}}const IntervalTimer$1=IntervalTimer,H264_MIME='video/mp4; codecs="avc1.42E01E,mp4a.40.2"',H265_MIME=['video/mp4;codecs="hev1.1.6.L120.90"','video/mp4;codecs="hev1.2.4.L120.90"','video/mp4;codecs="hev1.3.E.L120.90"','video/mp4;codecs="hev1.4.10.L120.90"'],transSourceTypeMap={mp4:["video/mp4","audio/mp4"],hls:["application/vnd.apple.mpegurl","application/x-mpegurl","audio/mpegurl"],webm:["audio/webm","video/webm"],mov:["video/quicktime"]},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")},isDash=function(e){return e&&0<e.toLowerCase().indexOf(".mpd")};function getStreamType(e){var t;let i;if(Array.isArray(e)&&e.length){if(e[0].type){let e="";for(const t of Object.entries(transSourceTypeMap)){const[i,r]=t;if(r.includes(i)){e=i;break}}if(e)return e}i=null==(t=e[0])?void 0:t.src}else i="string"==typeof e?e:"";return isHls(i)?"hls":isFlv(i)?"flv":isMp4(i)?"mp4":isDash(i)?"dash":"mp4"}function retPromise$1(e){return e&&e.then?e:Promise.resolve(e)}const addUrlParam$1=(e,t)=>t?e+=(-1===e.indexOf("?")?"?":"&")+genQueryString$1(t):e,getPluginConfig=(e,t)=>{if(!t||!e)return;let i;return Object.keys(e).map((r=>{r.toLowerCase()===t.toLowerCase()&&(i=e[r])})),i},handleIcons=e=>{const t={};return e&&Object.entries(e).forEach((([e,i])=>{i&&"string"!=typeof i&&(t[e]=i)})),t},isHevcSupported$1=function(){const e=window.navigator.userAgent.toLocaleLowerCase(),t=/(iphone)/.test(e)||/(ipad)/.test(e);if(/(VivoBrowser)/.test(e)){const t=e.match(/VivoBrowser\/(\d+)?/);if((null==t?void 0:t[1])>=22)return!0}return!!(t||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(){let e=(document.documentElement.getAttribute("lang")||navigator.language||"zh-cn").toLocaleLowerCase();return"zh-cn"!==e&&"cn"!==e||(e="zh"),e}function exeFunTimeoutWarn(e,t=200,i=""){let r=setTimeout((()=>{i&&VE_DEBUG.warn(i),r=null}),t);return e.then?e.then((()=>clearTimeout(r))):(clearTimeout(r),r=null),e}function isUrl(e){return!!e&&(e.indexOf&&/^(?:http|data:|\/)/.test(e))}function retry(e,t=1,i=0){return new Promise(((r,n)=>{e().then(r).catch((o=>{setTimeout((()=>{1!==t?retry(e,t-1,i).then(r,n):n(o)}),i)}))}))}function isMSESupport2(e='video/mp4; codecs="avc1.42E01E,mp4a.40.2"'){if(!window.MediaSource)return!1;try{return window.MediaSource.isTypeSupported(e)}catch(e){return VE_DEBUG.error("mse error",e),!1}}function isMMSSupported(e="h264"){return void 0!==window.ManagedMediaSource&&("h264"===e?window.ManagedMediaSource.isTypeSupported(H264_MIME):"h265"===e?H265_MIME.some((e=>window.ManagedMediaSource.isTypeSupported(e))):window.ManagedMediaSource.isTypeSupported(e))}const isBrowser="undefined"!=typeof window,ua=isBrowser&&navigator.userAgent.toLocaleLowerCase(),isSafari=isBrowser&&/^((?!chrome|android).)*safari/.test(ua);function getCurUserRegionConfig(e,t){const i={sg:{__LOG_TEA_ID__:323254,__LOG_CHANNEL__:"sg",__LOG_CUSTOM_REGION__:"byteplus",__LOG_CHANNEL_DOMAIN__:"https://mcs-nontt.byteintlapi.com",__UMD_PRE_PATH__:"https://sf-unpkg.bytepluscdn.com/obj/byteplusfe-sg/sdk/@byteplus/veplayer/1.18.0-rc.6/plugin"}},r=t||"sg";return e&&i[e]||i[r]}function uniqPlugins(e){const t=[];return e.forEach((e=>{t.find((t=>{var i,r;return(null==(i=null==t?void 0:t.pluginName)?void 0:i.toLowerCase())===(null==(r=null==e?void 0:e.pluginName)?void 0:r.toLowerCase())}))||t.push(e)})),t}function isObject$e(e){const t=typeof e;return null!==e&&("object"===t||"function"===t)}function genQueryString$1(e){return Object.entries(e).map((([e,t])=>Array.isArray(t)?t.map((t=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`)).join("&"):`${encodeURIComponent(e)}=${encodeURIComponent(t)}`)).join("&")}function getDetectUrl(e){var t;return"string"==typeof e?e:null==(t=null==e?void 0:e[0])?void 0:t.src}function getIntNumber$1(e,t=10,i=0){const r=parseInt(e,t);return Number.isNaN(r)?i:r}function getFloatNumber(e,t=0){const i=parseFloat(e);return Number.isNaN(i)?t:i}function getDrmType(e){var t,i,r,n,o,a,s;const l=e.getPlugin("drm"),c=e.getPlugin("EncryptHlsPlugin"),u=e.getPlugin("Mp4EncryptPlayer"),d=e.getPlugin("DASHPlugin"),h=(null==(t=null==c?void 0:c.config)?void 0:t.drmKeyToken)||(null==(i=null==u?void 0:u.config)?void 0:i.drmKeyToken)||(null==(r=null==d?void 0:d.config)?void 0:r.drmKeyToken),p=((null==(n=null==c?void 0:c.config)?void 0:n.drmType)||(null==(o=null==u?void 0:u.config)?void 0:o.drmType)||(null==(a=null==d?void 0:d.config)?void 0:a.drmType))===EDRMTYPE.PRIVATE_ENCRYPT_UPGRADE,f=null==(s=null==c?void 0:c.config)?void 0:s.keyToken;return l?EDRMTYPE.DRM_ENCRYPT:h?EDRMTYPE.PRIVATE_ENCRYPT:f?EDRMTYPE.STANDARD_ENCRYPT:p?EDRMTYPE.PRIVATE_ENCRYPT_UPGRADE:void 0}function defineMethod(e,t){for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&"function"==typeof t[i]&&Object.defineProperty(e,i,{configurable:!0,value:t[i]})}function getPlayerCurrentUrl(e){var t,i,r,n;const o=null==(i=null==(t=null==e?void 0:e.plugins)?void 0:t.encrypthlsplugin)?void 0:i._playOriginalUrl,a=null==(r=null==e?void 0:e.curDefinition)?void 0:r.main_url;return o||a||(null==(n=e.curDefinition)?void 0:n.url)||e.config.url}function omit(e,t){const i=__spreadValues({},e);return t.forEach((e=>delete i[e])),i}const matchHtmlRegExp=/["'&<>]/;function escapeHtml(e){const t=""+e,i=matchHtmlRegExp.exec(t);if(!i)return t;let r,n,o="",a=0;for(n=i.index;n<t.length;n++){switch(t.charCodeAt(n)){case 34:r="&quot;";break;case 38:r="&amp;";break;case 39:r="&#x27;";break;case 60:r="&lt;";break;case 62:r="&gt;";break;default:continue}a!==n&&(o+=t.substring(a,n)),a=n+1,o+=r}return a!==n?o+t.substring(a,n):o}function ownKeys$3(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,r)}return i}function _objectSpread2$1(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$3(Object(i),!0).forEach((function(t){_defineProperty$1(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):ownKeys$3(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return 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 _classCallCheck$1(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties$1(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_toPropertyKey$1(r.key),r)}}function _createClass$1(e,t,i){return t&&_defineProperties$1(e.prototype,t),i&&_defineProperties$1(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty$1(e,t,i){return(t=_toPropertyKey$1(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var i,r,n={},o=Object.keys(e);for(r=0;r<o.length;r++)i=o[r],t.indexOf(i)>=0||(n[i]=e[i]);return n}function _objectWithoutProperties(e,t){if(null==e)return{};var i,r,n=_objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)i=o[r],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function _toPrimitive$1(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!=typeof r)return r;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 t?t:String(t)}var check=function(e){return e&&e.Math==Math&&e},global$r=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof commonjsGlobal&&commonjsGlobal)||function(){return this}()||Function("return this")(),objectGetOwnPropertyDescriptor={},fails$t=function(e){try{return!!e()}catch(e){return!0}},fails$s=fails$t,descriptors=!fails$s((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),fails$r=fails$t,functionBindNative=!fails$r((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),NATIVE_BIND$3=functionBindNative,call$l=Function.prototype.call,functionCall=NATIVE_BIND$3?call$l.bind(call$l):function(){return call$l.apply(call$l,arguments)},objectPropertyIsEnumerable={},$propertyIsEnumerable$1={}.propertyIsEnumerable,getOwnPropertyDescriptor$4=Object.getOwnPropertyDescriptor,NASHORN_BUG=getOwnPropertyDescriptor$4&&!$propertyIsEnumerable$1.call({1:2},1);objectPropertyIsEnumerable.f=NASHORN_BUG?function(e){var t=getOwnPropertyDescriptor$4(this,e);return!!t&&t.enumerable}:$propertyIsEnumerable$1;var match,version$1,createPropertyDescriptor$4=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},NATIVE_BIND$2=functionBindNative,FunctionPrototype$3=Function.prototype,call$k=FunctionPrototype$3.call,uncurryThisWithBind=NATIVE_BIND$2&&FunctionPrototype$3.bind.bind(call$k,call$k),functionUncurryThis=NATIVE_BIND$2?uncurryThisWithBind:function(e){return function(){return call$k.apply(e,arguments)}},uncurryThis$t=functionUncurryThis,toString$e=uncurryThis$t({}.toString),stringSlice$8=uncurryThis$t("".slice),classofRaw$2=function(e){return stringSlice$8(toString$e(e),8,-1)},uncurryThis$s=functionUncurryThis,fails$q=fails$t,classof$a=classofRaw$2,$Object$3=Object,split=uncurryThis$s("".split),indexedObject=fails$q((function(){return!$Object$3("z").propertyIsEnumerable(0)}))?function(e){return"String"==classof$a(e)?split(e,""):$Object$3(e)}:$Object$3,isNullOrUndefined$7=function(e){return null==e},isNullOrUndefined$6=isNullOrUndefined$7,$TypeError$g=TypeError,requireObjectCoercible$9=function(e){if(isNullOrUndefined$6(e))throw $TypeError$g("Can't call method on "+e);return e},IndexedObject$2=indexedObject,requireObjectCoercible$8=requireObjectCoercible$9,toIndexedObject$7=function(e){return IndexedObject$2(requireObjectCoercible$8(e))},documentAll$2="object"==typeof document&&document.all,IS_HTMLDDA=void 0===documentAll$2&&void 0!==documentAll$2,documentAll_1={all:documentAll$2,IS_HTMLDDA:IS_HTMLDDA},$documentAll$1=documentAll_1,documentAll$1=$documentAll$1.all,isCallable$n=$documentAll$1.IS_HTMLDDA?function(e){return"function"==typeof e||e===documentAll$1}:function(e){return"function"==typeof e},isCallable$m=isCallable$n,$documentAll=documentAll_1,documentAll=$documentAll.all,isObject$d=$documentAll.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:isCallable$m(e)||e===documentAll}:function(e){return"object"==typeof e?null!==e:isCallable$m(e)},global$q=global$r,isCallable$l=isCallable$n,aFunction=function(e){return isCallable$l(e)?e:void 0},getBuiltIn$c=function(e,t){return arguments.length<2?aFunction(global$q[e]):global$q[e]&&global$q[e][t]},uncurryThis$r=functionUncurryThis,objectIsPrototypeOf=uncurryThis$r({}.isPrototypeOf),getBuiltIn$b=getBuiltIn$c,engineUserAgent=getBuiltIn$b("navigator","userAgent")||"",global$p=global$r,userAgent$3=engineUserAgent,process$3=global$p.process,Deno$1=global$p.Deno,versions=process$3&&process$3.versions||Deno$1&&Deno$1.version,v8=versions&&versions.v8;v8&&(version$1=(match=v8.split("."))[0]>0&&match[0]<4?1:+(match[0]+match[1])),!version$1&&userAgent$3&&(!(match=userAgent$3.match(/Edge\/(\d+)/))||match[1]>=74)&&(match=userAgent$3.match(/Chrome\/(\d+)/))&&(version$1=+match[1]);var engineV8Version=version$1,V8_VERSION$3=engineV8Version,fails$p=fails$t,symbolConstructorDetection=!!Object.getOwnPropertySymbols&&!fails$p((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 Symbol.iterator,getBuiltIn$a=getBuiltIn$c,isCallable$k=isCallable$n,isPrototypeOf$7=objectIsPrototypeOf,USE_SYMBOL_AS_UID$1=useSymbolAsUid,$Object$2=Object,isSymbol$5=USE_SYMBOL_AS_UID$1?function(e){return"symbol"==typeof e}:function(e){var t=getBuiltIn$a("Symbol");return isCallable$k(t)&&isPrototypeOf$7(t.prototype,$Object$2(e))},$String$4=String,tryToString$6=function(e){try{return $String$4(e)}catch(e){return"Object"}},isCallable$j=isCallable$n,tryToString$5=tryToString$6,$TypeError$f=TypeError,aCallable$7=function(e){if(isCallable$j(e))return e;throw $TypeError$f(tryToString$5(e)+" is not a function")},aCallable$6=aCallable$7,isNullOrUndefined$5=isNullOrUndefined$7,getMethod$6=function(e,t){var i=e[t];return isNullOrUndefined$5(i)?void 0:aCallable$6(i)},call$j=functionCall,isCallable$i=isCallable$n,isObject$c=isObject$d,$TypeError$e=TypeError,ordinaryToPrimitive$1=function(e,t){var i,r;if("string"===t&&isCallable$i(i=e.toString)&&!isObject$c(r=call$j(i,e)))return r;if(isCallable$i(i=e.valueOf)&&!isObject$c(r=call$j(i,e)))return r;if("string"!==t&&isCallable$i(i=e.toString)&&!isObject$c(r=call$j(i,e)))return r;throw $TypeError$e("Can't convert object to primitive value")},shared$7={exports:{}},global$o=global$r,defineProperty$7=Object.defineProperty,defineGlobalProperty$3=function(e,t){try{defineProperty$7(global$o,e,{value:t,configurable:!0,writable:!0})}catch(i){global$o[e]=t}return t},global$n=global$r,defineGlobalProperty$2=defineGlobalProperty$3,SHARED="__core-js_shared__",store$3=global$n[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.1",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.26.1/LICENSE",source:"https://github.com/zloirock/core-js"});var sharedExports=shared$7.exports,requireObjectCoercible$7=requireObjectCoercible$9,$Object$1=Object,toObject$7=function(e){return $Object$1(requireObjectCoercible$7(e))},uncurryThis$q=functionUncurryThis,toObject$6=toObject$7,hasOwnProperty=uncurryThis$q({}.hasOwnProperty),hasOwnProperty_1=Object.hasOwn||function(e,t){return hasOwnProperty(toObject$6(e),t)},uncurryThis$p=functionUncurryThis,id=0,postfix=Math.random(),toString$d=uncurryThis$p(1..toString),uid$3=function(e){return"Symbol("+(void 0===e?"":e)+")_"+toString$d(++id+postfix,36)},global$m=global$r,shared$6=sharedExports,hasOwn$g=hasOwnProperty_1,uid$2=uid$3,NATIVE_SYMBOL$5=symbolConstructorDetection,USE_SYMBOL_AS_UID=useSymbolAsUid,WellKnownSymbolsStore$1=shared$6("wks"),Symbol$1=global$m.Symbol,symbolFor=Symbol$1&&Symbol$1.for,createWellKnownSymbol=USE_SYMBOL_AS_UID?Symbol$1:Symbol$1&&Symbol$1.withoutSetter||uid$2,wellKnownSymbol$k=function(e){if(!hasOwn$g(WellKnownSymbolsStore$1,e)||!NATIVE_SYMBOL$5&&"string"!=typeof WellKnownSymbolsStore$1[e]){var t="Symbol."+e;NATIVE_SYMBOL$5&&hasOwn$g(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$i=functionCall,isObject$b=isObject$d,isSymbol$4=isSymbol$5,getMethod$5=getMethod$6,ordinaryToPrimitive=ordinaryToPrimitive$1,wellKnownSymbol$j=wellKnownSymbol$k,$TypeError$d=TypeError,TO_PRIMITIVE=wellKnownSymbol$j("toPrimitive"),toPrimitive$2=function(e,t){if(!isObject$b(e)||isSymbol$4(e))return e;var i,r=getMethod$5(e,TO_PRIMITIVE);if(r){if(void 0===t&&(t="default"),i=call$i(r,e,t),!isObject$b(i)||isSymbol$4(i))return i;throw $TypeError$d("Can't convert object to primitive value")}return void 0===t&&(t="number"),ordinaryToPrimitive(e,t)},toPrimitive$1=toPrimitive$2,isSymbol$3=isSymbol$5,toPropertyKey$4=function(e){var t=toPrimitive$1(e,"string");return isSymbol$3(t)?t:t+""},global$l=global$r,isObject$a=isObject$d,document$3=global$l.document,EXISTS$1=isObject$a(document$3)&&isObject$a(document$3.createElement),documentCreateElement$2=function(e){return EXISTS$1?document$3.createElement(e):{}},DESCRIPTORS$e=descriptors,fails$o=fails$t,createElement$1=documentCreateElement$2,ie8DomDefine=!DESCRIPTORS$e&&!fails$o((function(){return 7!=Object.defineProperty(createElement$1("div"),"a",{get:function(){return 7}}).a})),DESCRIPTORS$d=descriptors,call$h=functionCall,propertyIsEnumerableModule$1=objectPropertyIsEnumerable,createPropertyDescriptor$3=createPropertyDescriptor$4,toIndexedObject$6=toIndexedObject$7,toPropertyKey$3=toPropertyKey$4,hasOwn$f=hasOwnProperty_1,IE8_DOM_DEFINE$1=ie8DomDefine,$getOwnPropertyDescriptor$2=Object.getOwnPropertyDescriptor;objectGetOwnPropertyDescriptor.f=DESCRIPTORS$d?$getOwnPropertyDescriptor$2:function(e,t){if(e=toIndexedObject$6(e),t=toPropertyKey$3(t),IE8_DOM_DEFINE$1)try{return $getOwnPropertyDescriptor$2(e,t)}catch(e){}if(hasOwn$f(e,t))return createPropertyDescriptor$3(!call$h(propertyIsEnumerableModule$1.f,e,t),e[t])};var objectDefineProperty={},DESCRIPTORS$c=descriptors,fails$n=fails$t,v8PrototypeDefineBug=DESCRIPTORS$c&&fails$n((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),isObject$9=isObject$d,$String$3=String,$TypeError$c=TypeError,anObject$h=function(e){if(isObject$9(e))return e;throw $TypeError$c($String$3(e)+" is not an object")},DESCRIPTORS$b=descriptors,IE8_DOM_DEFINE=ie8DomDefine,V8_PROTOTYPE_DEFINE_BUG$1=v8PrototypeDefineBug,anObject$g=anObject$h,toPropertyKey$2=toPropertyKey$4,$TypeError$b=TypeError,$defineProperty$1=Object.defineProperty,$getOwnPropertyDescriptor$1=Object.getOwnPropertyDescriptor,ENUMERABLE="enumerable",CONFIGURABLE$1="configurable",WRITABLE="writable";objectDefineProperty.f=DESCRIPTORS$b?V8_PROTOTYPE_DEFINE_BUG$1?function(e,t,i){if(anObject$g(e),t=toPropertyKey$2(t),anObject$g(i),"function"==typeof e&&"prototype"===t&&"value"in i&&WRITABLE in i&&!i[WRITABLE]){var r=$getOwnPropertyDescriptor$1(e,t);r&&r[WRITABLE]&&(e[t]=i.value,i={configurable:CONFIGURABLE$1 in i?i[CONFIGURABLE$1]:r[CONFIGURABLE$1],enumerable:ENUMERABLE in i?i[ENUMERABLE]:r[ENUMERABLE],writable:!1})}return $defineProperty$1(e,t,i)}:$defineProperty$1:function(e,t,i){if(anObject$g(e),t=toPropertyKey$2(t),anObject$g(i),IE8_DOM_DEFINE)try{return $defineProperty$1(e,t,i)}catch(e){}if("get"in i||"set"in i)throw $TypeError$b("Accessors not supported");return"value"in i&&(e[t]=i.value),e};var DESCRIPTORS$a=descriptors,definePropertyModule$6=objectDefineProperty,createPropertyDescriptor$2=createPropertyDescriptor$4,createNonEnumerableProperty$5=DESCRIPTORS$a?function(e,t,i){return definePropertyModule$6.f(e,t,createPropertyDescriptor$2(1,i))}:function(e,t,i){return e[t]=i,e},makeBuiltIn$2={exports:{}},DESCRIPTORS$9=descriptors,hasOwn$e=hasOwnProperty_1,FunctionPrototype$2=Function.prototype,getDescriptor=DESCRIPTORS$9&&Object.getOwnPropertyDescriptor,EXISTS=hasOwn$e(FunctionPrototype$2,"name"),PROPER=EXISTS&&"something"===function(){}.name,CONFIGURABLE=EXISTS&&(!DESCRIPTORS$9||DESCRIPTORS$9&&getDescriptor(FunctionPrototype$2,"name").configurable),functionName={EXISTS:EXISTS,PROPER:PROPER,CONFIGURABLE:CONFIGURABLE},uncurryThis$o=functionUncurryThis,isCallable$h=isCallable$n,store$1=sharedStore,functionToString$1=uncurryThis$o(Function.toString);isCallable$h(store$1.inspectSource)||(store$1.inspectSource=function(e){return functionToString$1(e)});var set$1,get,has,inspectSource$3=store$1.inspectSource,global$k=global$r,isCallable$g=isCallable$n,WeakMap$1=global$k.WeakMap,weakMapBasicDetection=isCallable$g(WeakMap$1)&&/native code/.test(String(WeakMap$1)),shared$5=sharedExports,uid$1=uid$3,keys$2=shared$5("keys"),sharedKey$3=function(e){return keys$2[e]||(keys$2[e]=uid$1(e))},hiddenKeys$5={},NATIVE_WEAK_MAP=weakMapBasicDetection,global$j=global$r,isObject$8=isObject$d,createNonEnumerableProperty$4=createNonEnumerableProperty$5,hasOwn$d=hasOwnProperty_1,shared$4=sharedStore,sharedKey$2=sharedKey$3,hiddenKeys$4=hiddenKeys$5,OBJECT_ALREADY_INITIALIZED="Object already initialized",TypeError$4=global$j.TypeError,WeakMap=global$j.WeakMap,enforce=function(e){return has(e)?get(e):set$1(e,{})},getterFor=function(e){return function(t){var i;if(!isObject$8(t)||(i=get(t)).type!==e)throw TypeError$4("Incompatible receiver, "+e+" required");return i}};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$1=function(e,t){if(store.has(e))throw TypeError$4(OBJECT_ALREADY_INITIALIZED);return t.facade=e,store.set(e,t),t},get=function(e){return store.get(e)||{}},has=function(e){return store.has(e)}}else{var STATE=sharedKey$2("state");hiddenKeys$4[STATE]=!0,set$1=function(e,t){if(hasOwn$d(e,STATE))throw TypeError$4(OBJECT_ALREADY_INITIALIZED);return t.facade=e,createNonEnumerableProperty$4(e,STATE,t),t},get=function(e){return hasOwn$d(e,STATE)?e[STATE]:{}},has=function(e){return hasOwn$d(e,STATE)}}var internalState={set:set$1,get:get,has:has,enforce:enforce,getterFor:getterFor},fails$m=fails$t,isCallable$f=isCallable$n,hasOwn$c=hasOwnProperty_1,DESCRIPTORS$8=descriptors,CONFIGURABLE_FUNCTION_NAME=functionName.CONFIGURABLE,inspectSource$2=inspectSource$3,InternalStateModule$2=internalState,enforceInternalState$1=InternalStateModule$2.enforce,getInternalState$2=InternalStateModule$2.get,defineProperty$6=Object.defineProperty,CONFIGURABLE_LENGTH=DESCRIPTORS$8&&!fails$m((function(){return 8!==defineProperty$6((function(){}),"length",{value:8}).length})),TEMPLATE=String(String).split("String"),makeBuiltIn$1=makeBuiltIn$2.exports=function(e,t,i){"Symbol("===String(t).slice(0,7)&&(t="["+String(t).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),i&&i.getter&&(t="get "+t),i&&i.setter&&(t="set "+t),(!hasOwn$c(e,"name")||CONFIGURABLE_FUNCTION_NAME&&e.name!==t)&&(DESCRIPTORS$8?defineProperty$6(e,"name",{value:t,configurable:!0}):e.name=t),CONFIGURABLE_LENGTH&&i&&hasOwn$c(i,"arity")&&e.length!==i.arity&&defineProperty$6(e,"length",{value:i.arity});try{i&&hasOwn$c(i,"constructor")&&i.constructor?DESCRIPTORS$8&&defineProperty$6(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var r=enforceInternalState$1(e);return hasOwn$c(r,"source")||(r.source=TEMPLATE.join("string"==typeof t?t:"")),e};Function.prototype.toString=makeBuiltIn$1((function(){return isCallable$f(this)&&getInternalState$2(this).source||inspectSource$2(this)}),"toString");var makeBuiltInExports=makeBuiltIn$2.exports,isCallable$e=isCallable$n,definePropertyModule$5=objectDefineProperty,makeBuiltIn=makeBuiltInExports,defineGlobalProperty$1=defineGlobalProperty$3,defineBuiltIn$b=function(e,t,i,r){r||(r={});var n=r.enumerable,o=void 0!==r.name?r.name:t;if(isCallable$e(i)&&makeBuiltIn(i,o,r),r.global)n?e[t]=i:defineGlobalProperty$1(t,i);else{try{r.unsafe?e[t]&&(n=!0):delete e[t]}catch(e){}n?e[t]=i:definePropertyModule$5.f(e,t,{value:i,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return e},objectGetOwnPropertyNames={},ceil=Math.ceil,floor$2=Math.floor,mathTrunc=Math.trunc||function(e){var t=+e;return(t>0?floor$2:ceil)(t)},trunc2=mathTrunc,toIntegerOrInfinity$8=function(e){var t=+e;return t!=t||0===t?0:trunc2(t)},toIntegerOrInfinity$7=toIntegerOrInfinity$8,max$3=Math.max,min$4=Math.min,toAbsoluteIndex$3=function(e,t){var i=toIntegerOrInfinity$7(e);return i<0?max$3(i+t,0):min$4(i,t)},toIntegerOrInfinity$6=toIntegerOrInfinity$8,min$3=Math.min,toLength$4=function(e){return e>0?min$3(toIntegerOrInfinity$6(e),9007199254740991):0},toLength$3=toLength$4,lengthOfArrayLike$6=function(e){return toLength$3(e.length)},toIndexedObject$5=toIndexedObject$7,toAbsoluteIndex$2=toAbsoluteIndex$3,lengthOfArrayLike$5=lengthOfArrayLike$6,createMethod$3=function(e){return function(t,i,r){var n,o=toIndexedObject$5(t),a=lengthOfArrayLike$5(o),s=toAbsoluteIndex$2(r,a);if(e&&i!=i){for(;a>s;)if((n=o[s++])!=n)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===i)return e||s||0;return!e&&-1}},arrayIncludes={includes:createMethod$3(!0),indexOf:createMethod$3(!1)},uncurryThis$n=functionUncurryThis,hasOwn$b=hasOwnProperty_1,toIndexedObject$4=toIndexedObject$7,indexOf$1=arrayIncludes.indexOf,hiddenKeys$3=hiddenKeys$5,push$4=uncurryThis$n([].push),objectKeysInternal=function(e,t){var i,r=toIndexedObject$4(e),n=0,o=[];for(i in r)!hasOwn$b(hiddenKeys$3,i)&&hasOwn$b(r,i)&&push$4(o,i);for(;t.length>n;)hasOwn$b(r,i=t[n++])&&(~indexOf$1(o,i)||push$4(o,i));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$9=getBuiltIn$c,uncurryThis$m=functionUncurryThis,getOwnPropertyNamesModule$1=objectGetOwnPropertyNames,getOwnPropertySymbolsModule$2=objectGetOwnPropertySymbols,anObject$f=anObject$h,concat$1=uncurryThis$m([].concat),ownKeys$2=getBuiltIn$9("Reflect","ownKeys")||function(e){var t=getOwnPropertyNamesModule$1.f(anObject$f(e)),i=getOwnPropertySymbolsModule$2.f;return i?concat$1(t,i(e)):t},hasOwn$a=hasOwnProperty_1,ownKeys$1=ownKeys$2,getOwnPropertyDescriptorModule$1=objectGetOwnPropertyDescriptor,definePropertyModule$4=objectDefineProperty,copyConstructorProperties$2=function(e,t,i){for(var r=ownKeys$1(t),n=definePropertyModule$4.f,o=getOwnPropertyDescriptorModule$1.f,a=0;a<r.length;a++){var s=r[a];hasOwn$a(e,s)||i&&hasOwn$a(i,s)||n(e,s,o(t,s))}},fails$l=fails$t,isCallable$d=isCallable$n,replacement=/#|\.prototype\./,isForced$4=function(e,t){var i=data[normalize(e)];return i==POLYFILL||i!=NATIVE&&(isCallable$d(t)?fails$l(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$i=global$r,getOwnPropertyDescriptor$3=objectGetOwnPropertyDescriptor.f,createNonEnumerableProperty$3=createNonEnumerableProperty$5,defineBuiltIn$a=defineBuiltIn$b,defineGlobalProperty=defineGlobalProperty$3,copyConstructorProperties$1=copyConstructorProperties$2,isForced$3=isForced_1,_export=function(e,t){var i,r,n,o,a,s=e.target,l=e.global,c=e.stat;if(i=l?global$i:c?global$i[s]||defineGlobalProperty(s,{}):(global$i[s]||{}).prototype)for(r in t){if(o=t[r],n=e.dontCallGetSet?(a=getOwnPropertyDescriptor$3(i,r))&&a.value:i[r],!isForced$3(l?r:s+(c?".":"#")+r,e.forced)&&void 0!==n){if(typeof o==typeof n)continue;copyConstructorProperties$1(o,n)}(e.sham||n&&n.sham)&&createNonEnumerableProperty$3(o,"sham",!0),defineBuiltIn$a(i,r,o,e)}},classof$9=classofRaw$2,isArray$5=Array.isArray||function(e){return"Array"==classof$9(e)},$TypeError$a=TypeError,MAX_SAFE_INTEGER=9007199254740991,doesNotExceedSafeInteger$2=function(e){if(e>MAX_SAFE_INTEGER)throw $TypeError$a("Maximum allowed index exceeded");return e},toPropertyKey$1=toPropertyKey$4,definePropertyModule$3=objectDefineProperty,createPropertyDescriptor$1=createPropertyDescriptor$4,createProperty$3=function(e,t,i){var r=toPropertyKey$1(t);r in e?definePropertyModule$3.f(e,r,createPropertyDescriptor$1(0,i)):e[r]=i},wellKnownSymbol$i=wellKnownSymbol$k,TO_STRING_TAG$2=wellKnownSymbol$i("toStringTag"),test={};test[TO_STRING_TAG$2]="z";var toStringTagSupport="[object z]"===String(test),TO_STRING_TAG_SUPPORT$2=toStringTagSupport,isCallable$c=isCallable$n,classofRaw$1=classofRaw$2,wellKnownSymbol$h=wellKnownSymbol$k,TO_STRING_TAG$1=wellKnownSymbol$h("toStringTag"),$Object=Object,CORRECT_ARGUMENTS="Arguments"==classofRaw$1(function(){return arguments}()),tryGet=function(e,t){try{return e[t]}catch(e){}},classof$8=TO_STRING_TAG_SUPPORT$2?classofRaw$1:function(e){var t,i,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=tryGet(t=$Object(e),TO_STRING_TAG$1))?i:CORRECT_ARGUMENTS?classofRaw$1(t):"Object"==(r=classofRaw$1(t))&&isCallable$c(t.callee)?"Arguments":r},uncurryThis$l=functionUncurryThis,fails$k=fails$t,isCallable$b=isCallable$n,classof$7=classof$8,getBuiltIn$8=getBuiltIn$c,inspectSource$1=inspectSource$3,noop=function(){},empty$1=[],construct=getBuiltIn$8("Reflect","construct"),constructorRegExp=/^\s*(?:class|function)\b/,exec$4=uncurryThis$l(constructorRegExp.exec),INCORRECT_TO_STRING=!constructorRegExp.exec(noop),isConstructorModern=function(e){if(!isCallable$b(e))return!1;try{return construct(noop,empty$1,e),!0}catch(e){return!1}},isConstructorLegacy=function(e){if(!isCallable$b(e))return!1;switch(classof$7(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return INCORRECT_TO_STRING||!!exec$4(constructorRegExp,inspectSource$1(e))}catch(e){return!0}};isConstructorLegacy.sham=!0;var isConstructor$2=!construct||fails$k((function(){var e;return isConstructorModern(isConstructorModern.call)||!isConstructorModern(Object)||!isConstructorModern((function(){e=!0}))||e}))?isConstructorLegacy:isConstructorModern,isArray$4=isArray$5,isConstructor$1=isConstructor$2,isObject$7=isObject$d,wellKnownSymbol$g=wellKnownSymbol$k,SPECIES$5=wellKnownSymbol$g("species"),$Array$1=Array,arraySpeciesConstructor$1=function(e){var t;return isArray$4(e)&&(t=e.constructor,(isConstructor$1(t)&&(t===$Array$1||isArray$4(t.prototype))||isObject$7(t)&&null===(t=t[SPECIES$5]))&&(t=void 0)),void 0===t?$Array$1:t},arraySpeciesConstructor=arraySpeciesConstructor$1,arraySpeciesCreate$3=function(e,t){return new(arraySpeciesConstructor(e))(0===t?0:t)},fails$j=fails$t,wellKnownSymbol$f=wellKnownSymbol$k,V8_VERSION$2=engineV8Version,SPECIES$4=wellKnownSymbol$f("species"),arrayMethodHasSpeciesSupport$4=function(e){return V8_VERSION$2>=51||!fails$j((function(){var t=[];return(t.constructor={})[SPECIES$4]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},$$n=_export,fails$i=fails$t,isArray$3=isArray$5,isObject$6=isObject$d,toObject$5=toObject$7,lengthOfArrayLike$4=lengthOfArrayLike$6,doesNotExceedSafeInteger$1=doesNotExceedSafeInteger$2,createProperty$2=createProperty$3,arraySpeciesCreate$2=arraySpeciesCreate$3,arrayMethodHasSpeciesSupport$3=arrayMethodHasSpeciesSupport$4,wellKnownSymbol$e=wellKnownSymbol$k,V8_VERSION$1=engineV8Version,IS_CONCAT_SPREADABLE=wellKnownSymbol$e("isConcatSpreadable"),IS_CONCAT_SPREADABLE_SUPPORT=V8_VERSION$1>=51||!fails$i((function(){var e=[];return e[IS_CONCAT_SPREADABLE]=!1,e.concat()[0]!==e})),SPECIES_SUPPORT=arrayMethodHasSpeciesSupport$3("concat"),isConcatSpreadable=function(e){if(!isObject$6(e))return!1;var t=e[IS_CONCAT_SPREADABLE];return void 0!==t?!!t:isArray$3(e)},FORCED$2=!IS_CONCAT_SPREADABLE_SUPPORT||!SPECIES_SUPPORT;$$n({target:"Array",proto:!0,arity:1,forced:FORCED$2},{concat:function(e){var t,i,r,n,o,a=toObject$5(this),s=arraySpeciesCreate$2(a,0),l=0;for(t=-1,r=arguments.length;t<r;t++)if(isConcatSpreadable(o=-1===t?a:arguments[t]))for(n=lengthOfArrayLike$4(o),doesNotExceedSafeInteger$1(l+n),i=0;i<n;i++,l++)i in o&&createProperty$2(s,l,o[i]);else doesNotExceedSafeInteger$1(l+1),createProperty$2(s,l++,o);return s.length=l,s}});var classofRaw=classofRaw$2,uncurryThis$k=functionUncurryThis,functionUncurryThisClause=function(e){if("Function"===classofRaw(e))return uncurryThis$k(e)},uncurryThis$j=functionUncurryThisClause,aCallable$5=aCallable$7,NATIVE_BIND$1=functionBindNative,bind$5=functionUncurryThisClause(functionUncurryThisClause.bind),functionBindContext=function(e,t){return aCallable$5(e),void 0===t?e:NATIVE_BIND$1?bind$5(e,t):function(){return e.apply(t,arguments)}},bind$4=functionBindContext,uncurryThis$i=functionUncurryThis,IndexedObject$1=indexedObject,toObject$4=toObject$7,lengthOfArrayLike$3=lengthOfArrayLike$6,arraySpeciesCreate$1=arraySpeciesCreate$3,push$3=uncurryThis$i([].push),createMethod$2=function(e){var t=1==e,i=2==e,r=3==e,n=4==e,o=6==e,a=7==e,s=5==e||o;return function(l,c,u,d){for(var h,p,f=toObject$4(l),g=IndexedObject$1(f),y=bind$4(c,u),_=lengthOfArrayLike$3(g),m=0,v=d||arraySpeciesCreate$1,E=t?v(l,_):i||a?v(l,0):void 0;_>m;m++)if((s||m in g)&&(p=y(h=g[m],m,f),e))if(t)E[m]=p;else if(p)switch(e){case 3:return!0;case 5:return h;case 6:return m;case 2:push$3(E,h)}else switch(e){case 4:return!1;case 7:push$3(E,h)}return o?-1:r||n?n:E}},arrayIteration={forEach:createMethod$2(0),map:createMethod$2(1),filter:createMethod$2(2),some:createMethod$2(3),every:createMethod$2(4),find:createMethod$2(5),findIndex:createMethod$2(6),filterReject:createMethod$2(7)},$$m=_export,$map=arrayIteration.map,arrayMethodHasSpeciesSupport$2=arrayMethodHasSpeciesSupport$4,HAS_SPECIES_SUPPORT$2=arrayMethodHasSpeciesSupport$2("map");$$m({target:"Array",proto:!0,forced:!HAS_SPECIES_SUPPORT$2},{map:function(e){return $map(this,e,arguments.length>1?arguments[1]:void 0)}});var internalObjectKeys=objectKeysInternal,enumBugKeys$1=enumBugKeys$3,objectKeys$2=Object.keys||function(e){return internalObjectKeys(e,enumBugKeys$1)},$$l=_export,toObject$3=toObject$7,nativeKeys=objectKeys$2,fails$h=fails$t,FAILS_ON_PRIMITIVES=fails$h((function(){nativeKeys(1)}));$$l({target:"Object",stat:!0,forced:FAILS_ON_PRIMITIVES},{keys:function(e){return nativeKeys(toObject$3(e))}});var classof$6=classof$8,$String$2=String,toString$c=function(e){if("Symbol"===classof$6(e))throw TypeError("Cannot convert a Symbol value to a string");return $String$2(e)},uncurryThis$h=functionUncurryThis,toIntegerOrInfinity$5=toIntegerOrInfinity$8,toString$b=toString$c,requireObjectCoercible$6=requireObjectCoercible$9,charAt$6=uncurryThis$h("".charAt),charCodeAt$2=uncurryThis$h("".charCodeAt),stringSlice$7=uncurryThis$h("".slice),createMethod$1=function(e){return function(t,i){var r,n,o=toString$b(requireObjectCoercible$6(t)),a=toIntegerOrInfinity$5(i),s=o.length;return a<0||a>=s?e?"":void 0:(r=charCodeAt$2(o,a))<55296||r>56319||a+1===s||(n=charCodeAt$2(o,a+1))<56320||n>57343?e?charAt$6(o,a):r:e?stringSlice$7(o,a,a+2):n-56320+(r-55296<<10)+65536}},stringMultibyte={codeAt:createMethod$1(!1),charAt:createMethod$1(!0)},$$k=_export,charAt$5=stringMultibyte.charAt,requireObjectCoercible$5=requireObjectCoercible$9,toIntegerOrInfinity$4=toIntegerOrInfinity$8,toString$a=toString$c;$$k({target:"String",proto:!0,forced:!0},{at:function(e){var t=toString$a(requireObjectCoercible$5(this)),i=t.length,r=toIntegerOrInfinity$4(e),n=r>=0?r:i+r;return n<0||n>=i?void 0:charAt$5(t,n)}});var TO_STRING_TAG_SUPPORT$1=toStringTagSupport,classof$5=classof$8,objectToString=TO_STRING_TAG_SUPPORT$1?{}.toString:function(){return"[object "+classof$5(this)+"]"},TO_STRING_TAG_SUPPORT=toStringTagSupport,defineBuiltIn$9=defineBuiltIn$b,toString$9=objectToString;TO_STRING_TAG_SUPPORT||defineBuiltIn$9(Object.prototype,"toString",toString$9,{unsafe:!0});var anObject$e=anObject$h,regexpFlags$1=function(){var e=anObject$e(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},call$g=functionCall,hasOwn$9=hasOwnProperty_1,isPrototypeOf$6=objectIsPrototypeOf,regExpFlags=regexpFlags$1,RegExpPrototype$3=RegExp.prototype,regexpGetFlags=function(e){var t=e.flags;return void 0!==t||"flags"in RegExpPrototype$3||hasOwn$9(e,"flags")||!isPrototypeOf$6(RegExpPrototype$3,e)?t:call$g(regExpFlags,e)},PROPER_FUNCTION_NAME$1=functionName.PROPER,defineBuiltIn$8=defineBuiltIn$b,anObject$d=anObject$h,$toString$1=toString$c,fails$g=fails$t,getRegExpFlags$1=regexpGetFlags,TO_STRING="toString",RegExpPrototype$2=RegExp.prototype,nativeToString=RegExpPrototype$2[TO_STRING],NOT_GENERIC=fails$g((function(){return"/a/b"!=nativeToString.call({source:"a",flags:"b"})})),INCORRECT_NAME=PROPER_FUNCTION_NAME$1&&nativeToString.name!=TO_STRING;(NOT_GENERIC||INCORRECT_NAME)&&defineBuiltIn$8(RegExp.prototype,TO_STRING,(function(){var e=anObject$d(this);return"/"+$toString$1(e.source)+"/"+$toString$1(getRegExpFlags$1(e))}),{unsafe:!0});var domIterables={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},documentCreateElement$1=documentCreateElement$2,classList=documentCreateElement$1("span").classList,DOMTokenListPrototype$1=classList&&classList.constructor&&classList.constructor.prototype,domTokenListPrototype=DOMTokenListPrototype$1===Object.prototype?void 0:DOMTokenListPrototype$1,fails$f=fails$t,arrayMethodIsStrict$2=function(e,t){var i=[][e];return!!i&&fails$f((function(){i.call(null,t||function(){return 1},1)}))},$forEach$1=arrayIteration.forEach,arrayMethodIsStrict$1=arrayMethodIsStrict$2,STRICT_METHOD$1=arrayMethodIsStrict$1("forEach"),arrayForEach=STRICT_METHOD$1?[].forEach:function(e){return $forEach$1(this,e,arguments.length>1?arguments[1]:void 0)},global$h=global$r,DOMIterables=domIterables,DOMTokenListPrototype=domTokenListPrototype,forEach2=arrayForEach,createNonEnumerableProperty$2=createNonEnumerableProperty$5,handlePrototype=function(e){if(e&&e.forEach!==forEach2)try{createNonEnumerableProperty$2(e,"forEach",forEach2)}catch(t){e.forEach=forEach2}};for(var COLLECTION_NAME in DOMIterables)DOMIterables[COLLECTION_NAME]&&handlePrototype(global$h[COLLECTION_NAME]&&global$h[COLLECTION_NAME].prototype);handlePrototype(DOMTokenListPrototype);var isCallable$a=isCallable$n,$String$1=String,$TypeError$9=TypeError,aPossiblePrototype$1=function(e){if("object"==typeof e||isCallable$a(e))return e;throw $TypeError$9("Can't set "+$String$1(e)+" as a prototype")},uncurryThis$g=functionUncurryThis,anObject$c=anObject$h,aPossiblePrototype=aPossiblePrototype$1,objectSetPrototypeOf=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,i={};try{(e=uncurryThis$g(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(i,[]),t=i instanceof Array}catch(e){}return function(i,r){return anObject$c(i),aPossiblePrototype(r),t?e(i,r):i.__proto__=r,i}}():void 0),isCallable$9=isCallable$n,isObject$5=isObject$d,setPrototypeOf$1=objectSetPrototypeOf,inheritIfRequired$2=function(e,t,i){var r,n;return setPrototypeOf$1&&isCallable$9(r=t.constructor)&&r!==i&&isObject$5(n=r.prototype)&&n!==i.prototype&&setPrototypeOf$1(e,n),e},uncurryThis$f=functionUncurryThis,thisNumberValue$2=uncurryThis$f(1..valueOf),whitespaces$2="\t\n\v\f\r                 \u2028\u2029\ufeff",uncurryThis$e=functionUncurryThis,requireObjectCoercible$4=requireObjectCoercible$9,toString$8=toString$c,whitespaces$1=whitespaces$2,replace$5=uncurryThis$e("".replace),whitespace="["+whitespaces$1+"]",ltrim=RegExp("^"+whitespace+whitespace+"*"),rtrim=RegExp(whitespace+whitespace+"*$"),createMethod=function(e){return function(t){var i=toString$8(requireObjectCoercible$4(t));return 1&e&&(i=replace$5(i,ltrim,"")),2&e&&(i=replace$5(i,rtrim,"")),i}},stringTrim={start:createMethod(1),end:createMethod(2),trim:createMethod(3)},DESCRIPTORS$7=descriptors,global$g=global$r,uncurryThis$d=functionUncurryThis,isForced$2=isForced_1,defineBuiltIn$7=defineBuiltIn$b,hasOwn$8=hasOwnProperty_1,inheritIfRequired$1=inheritIfRequired$2,isPrototypeOf$5=objectIsPrototypeOf,isSymbol$2=isSymbol$5,toPrimitive=toPrimitive$2,fails$e=fails$t,getOwnPropertyNames$1=objectGetOwnPropertyNames.f,getOwnPropertyDescriptor$2=objectGetOwnPropertyDescriptor.f,defineProperty$5=objectDefineProperty.f,thisNumberValue$1=thisNumberValue$2,trim=stringTrim.trim,NUMBER="Number",NativeNumber=global$g[NUMBER],NumberPrototype=NativeNumber.prototype,TypeError$3=global$g.TypeError,arraySlice$5=uncurryThis$d("".slice),charCodeAt$1=uncurryThis$d("".charCodeAt),toNumeric=function(e){var t=toPrimitive(e,"number");return"bigint"==typeof t?t:toNumber$1(t)},toNumber$1=function(e){var t,i,r,n,o,a,s,l,c=toPrimitive(e,"number");if(isSymbol$2(c))throw TypeError$3("Cannot convert a Symbol value to a number");if("string"==typeof c&&c.length>2)if(c=trim(c),43===(t=charCodeAt$1(c,0))||45===t){if(88===(i=charCodeAt$1(c,2))||120===i)return NaN}else if(48===t){switch(charCodeAt$1(c,1)){case 66:case 98:r=2,n=49;break;case 79:case 111:r=8,n=55;break;default:return+c}for(a=(o=arraySlice$5(c,2)).length,s=0;s<a;s++)if((l=charCodeAt$1(o,s))<48||l>n)return NaN;return parseInt(o,r)}return+c};if(isForced$2(NUMBER,!NativeNumber(" 0o1")||!NativeNumber("0b1")||NativeNumber("+0x1"))){for(var key,NumberWrapper=function(e){var t=arguments.length<1?0:NativeNumber(toNumeric(e)),i=this;return isPrototypeOf$5(NumberPrototype,i)&&fails$e((function(){thisNumberValue$1(i)}))?inheritIfRequired$1(Object(t),i,NumberWrapper):t},keys$1=DESCRIPTORS$7?getOwnPropertyNames$1(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=0;keys$1.length>j;j++)hasOwn$8(NativeNumber,key=keys$1[j])&&!hasOwn$8(NumberWrapper,key)&&defineProperty$5(NumberWrapper,key,getOwnPropertyDescriptor$2(NativeNumber,key));NumberWrapper.prototype=NumberPrototype,NumberPrototype.constructor=NumberWrapper,defineBuiltIn$7(global$g,NUMBER,NumberWrapper,{constructor:!0})}var DESCRIPTORS$6=descriptors,FUNCTION_NAME_EXISTS=functionName.EXISTS,uncurryThis$c=functionUncurryThis,defineProperty$4=objectDefineProperty.f,FunctionPrototype$1=Function.prototype,functionToString=uncurryThis$c(FunctionPrototype$1.toString),nameRE=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,regExpExec$2=uncurryThis$c(nameRE.exec),NAME="name";DESCRIPTORS$6&&!FUNCTION_NAME_EXISTS&&defineProperty$4(FunctionPrototype$1,NAME,{configurable:!0,get:function(){try{return regExpExec$2(nameRE,functionToString(this))[1]}catch(e){return""}}});var $$j=_export,uncurryThis$b=functionUncurryThis,IndexedObject=indexedObject,toIndexedObject$3=toIndexedObject$7,arrayMethodIsStrict=arrayMethodIsStrict$2,nativeJoin=uncurryThis$b([].join),ES3_STRINGS=IndexedObject!=Object,STRICT_METHOD=arrayMethodIsStrict("join",",");$$j({target:"Array",proto:!0,forced:ES3_STRINGS||!STRICT_METHOD},{join:function(e){return nativeJoin(toIndexedObject$3(this),void 0===e?",":e)}});var $location,defer,channel,port,classof$4=classofRaw$2,global$f=global$r,engineIsNode="process"==classof$4(global$f.process),defineProperty$3=objectDefineProperty.f,hasOwn$7=hasOwnProperty_1,wellKnownSymbol$d=wellKnownSymbol$k,TO_STRING_TAG=wellKnownSymbol$d("toStringTag"),setToStringTag$2=function(e,t,i){e&&!i&&(e=e.prototype),e&&!hasOwn$7(e,TO_STRING_TAG)&&defineProperty$3(e,TO_STRING_TAG,{configurable:!0,value:t})},getBuiltIn$7=getBuiltIn$c,definePropertyModule$2=objectDefineProperty,wellKnownSymbol$c=wellKnownSymbol$k,DESCRIPTORS$5=descriptors,SPECIES$3=wellKnownSymbol$c("species"),setSpecies$2=function(e){var t=getBuiltIn$7(e),i=definePropertyModule$2.f;DESCRIPTORS$5&&t&&!t[SPECIES$3]&&i(t,SPECIES$3,{configurable:!0,get:function(){return this}})},isPrototypeOf$4=objectIsPrototypeOf,$TypeError$8=TypeError,anInstance$1=function(e,t){if(isPrototypeOf$4(t,e))return e;throw $TypeError$8("Incorrect invocation")},isConstructor3=isConstructor$2,tryToString$4=tryToString$6,$TypeError$7=TypeError,aConstructor$1=function(e){if(isConstructor3(e))return e;throw $TypeError$7(tryToString$4(e)+" is not a constructor")},anObject$b=anObject$h,aConstructor=aConstructor$1,isNullOrUndefined$4=isNullOrUndefined$7,wellKnownSymbol$b=wellKnownSymbol$k,SPECIES$2=wellKnownSymbol$b("species"),speciesConstructor$3=function(e,t){var i,r=anObject$b(e).constructor;return void 0===r||isNullOrUndefined$4(i=anObject$b(r)[SPECIES$2])?t:aConstructor(i)},NATIVE_BIND=functionBindNative,FunctionPrototype=Function.prototype,apply$4=FunctionPrototype.apply,call$f=FunctionPrototype.call,functionApply="object"==typeof Reflect&&Reflect.apply||(NATIVE_BIND?call$f.bind(apply$4):function(){return call$f.apply(apply$4,arguments)}),getBuiltIn$6=getBuiltIn$c,html$2=getBuiltIn$6("document","documentElement"),uncurryThis$a=functionUncurryThis,arraySlice$4=uncurryThis$a([].slice),$TypeError$6=TypeError,validateArgumentsLength$1=function(e,t){if(e<t)throw $TypeError$6("Not enough arguments");return e},userAgent$2=engineUserAgent,engineIsIos=/(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$2),global$e=global$r,apply$3=functionApply,bind$3=functionBindContext,isCallable$8=isCallable$n,hasOwn$6=hasOwnProperty_1,fails$d=fails$t,html$1=html$2,arraySlice$3=arraySlice$4,createElement=documentCreateElement$2,validateArgumentsLength=validateArgumentsLength$1,IS_IOS$1=engineIsIos,IS_NODE$3=engineIsNode,set=global$e.setImmediate,clear=global$e.clearImmediate,process$2=global$e.process,Dispatch=global$e.Dispatch,Function$1=global$e.Function,MessageChannel=global$e.MessageChannel,String$1=global$e.String,counter=0,queue$1={},ONREADYSTATECHANGE="onreadystatechange";try{$location=global$e.location}catch(e){}var run=function(e){if(hasOwn$6(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$e.postMessage(String$1(e),$location.protocol+"//"+$location.host)};set&&clear||(set=function(e){validateArgumentsLength(arguments.length,1);var t=isCallable$8(e)?e:Function$1(e),i=arraySlice$3(arguments,1);return queue$1[++counter]=function(){apply$3(t,void 0,i)},defer(counter),counter},clear=function(e){delete queue$1[e]},IS_NODE$3?defer=function(e){process$2.nextTick(runner(e))}:Dispatch&&Dispatch.now?defer=function(e){Dispatch.now(runner(e))}:MessageChannel&&!IS_IOS$1?(port=(channel=new MessageChannel).port2,channel.port1.onmessage=listener,defer=bind$3(port.postMessage,port)):global$e.addEventListener&&isCallable$8(global$e.postMessage)&&!global$e.importScripts&&$location&&"file:"!==$location.protocol&&!fails$d(post)?(defer=post,global$e.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 flush,head,last$1,notify$1,toggle,node,promise,then,task$1={set:set,clear:clear},userAgent$1=engineUserAgent,global$d=global$r,engineIsIosPebble=/ipad|iphone|ipod/i.test(userAgent$1)&&void 0!==global$d.Pebble,userAgent=engineUserAgent,engineIsWebosWebkit=/web0s(?!.*chrome)/i.test(userAgent),global$c=global$r,bind$2=functionBindContext,getOwnPropertyDescriptor$1=objectGetOwnPropertyDescriptor.f,macrotask=task$1.set,IS_IOS=engineIsIos,IS_IOS_PEBBLE=engineIsIosPebble,IS_WEBOS_WEBKIT=engineIsWebosWebkit,IS_NODE$2=engineIsNode,MutationObserver=global$c.MutationObserver||global$c.WebKitMutationObserver,document$2=global$c.document,process$1=global$c.process,Promise$1=global$c.Promise,queueMicrotaskDescriptor=getOwnPropertyDescriptor$1(global$c,"queueMicrotask"),queueMicrotask=queueMicrotaskDescriptor&&queueMicrotaskDescriptor.value;queueMicrotask||(flush=function(){var e,t;for(IS_NODE$2&&(e=process$1.domain)&&e.exit();head;){t=head.fn,head=head.next;try{t()}catch(e){throw head?notify$1():last$1=void 0,e}}last$1=void 0,e&&e.enter()},IS_IOS||IS_NODE$2||IS_WEBOS_WEBKIT||!MutationObserver||!document$2?!IS_IOS_PEBBLE&&Promise$1&&Promise$1.resolve?((promise=Promise$1.resolve(void 0)).constructor=Promise$1,then=bind$2(promise.then,promise),notify$1=function(){then(flush)}):IS_NODE$2?notify$1=function(){process$1.nextTick(flush)}:(macrotask=bind$2(macrotask,global$c),notify$1=function(){macrotask(flush)}):(toggle=!0,node=document$2.createTextNode(""),new MutationObserver(flush).observe(node,{characterData:!0}),notify$1=function(){node.data=toggle=!toggle}));var microtask$1=queueMicrotask||function(e){var t={fn:e,next:void 0};last$1&&(last$1.next=t),head||(head=t,notify$1()),last$1=t},global$b=global$r,hostReportErrors$1=function(e,t){var i=global$b.console;i&&i.error&&(1==arguments.length?i.error(e):i.error(e,t))},perform$3=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},Queue$1=function(){this.head=null,this.tail=null};Queue$1.prototype={add:function(e){var t={item:e,next:null};this.head?this.tail.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}};var queue=Queue$1,global$a=global$r,promiseNativeConstructor=global$a.Promise,engineIsDeno="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,IS_DENO$1=engineIsDeno,IS_NODE$1=engineIsNode,engineIsBrowser=!IS_DENO$1&&!IS_NODE$1&&"object"==typeof window&&"object"==typeof document,global$9=global$r,NativePromiseConstructor$4=promiseNativeConstructor,isCallable$7=isCallable$n,isForced$1=isForced_1,inspectSource=inspectSource$3,wellKnownSymbol$a=wellKnownSymbol$k,IS_BROWSER=engineIsBrowser,IS_DENO=engineIsDeno,V8_VERSION=engineV8Version;NativePromiseConstructor$4&&NativePromiseConstructor$4.prototype;var SPECIES$1=wellKnownSymbol$a("species"),SUBCLASSING=!1,NATIVE_PROMISE_REJECTION_EVENT$1=isCallable$7(global$9.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 i=new NativePromiseConstructor$4((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))};if((i.constructor={})[SPECIES$1]=r,!(SUBCLASSING=i.then((function(){}))instanceof r))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$4=aCallable$7,$TypeError$5=TypeError,PromiseCapability=function(e){var t,i;this.promise=new e((function(e,r){if(void 0!==t||void 0!==i)throw $TypeError$5("Bad Promise constructor");t=e,i=r})),this.resolve=aCallable$4(t),this.reject=aCallable$4(i)};newPromiseCapability$2.f=function(e){return new PromiseCapability(e)};var Internal,OwnPromiseCapability,PromiseWrapper,nativeThen,$$i=_export,IS_NODE=engineIsNode,global$8=global$r,call$e=functionCall,defineBuiltIn$6=defineBuiltIn$b,setPrototypeOf=objectSetPrototypeOf,setToStringTag$1=setToStringTag$2,setSpecies$1=setSpecies$2,aCallable$3=aCallable$7,isCallable$6=isCallable$n,isObject$4=isObject$d,anInstance=anInstance$1,speciesConstructor$2=speciesConstructor$3,task=task$1.set,microtask=microtask$1,hostReportErrors=hostReportErrors$1,perform$2=perform$3,Queue=queue,InternalStateModule$1=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$1.getterFor(PROMISE),setInternalState$1=InternalStateModule$1.set,NativePromisePrototype$2=NativePromiseConstructor$3&&NativePromiseConstructor$3.prototype,PromiseConstructor=NativePromiseConstructor$3,PromisePrototype=NativePromisePrototype$2,TypeError$2=global$8.TypeError,document$1=global$8.document,process=global$8.process,newPromiseCapability$1=newPromiseCapabilityModule$3.f,newGenericPromiseCapability=newPromiseCapability$1,DISPATCH_EVENT=!!(document$1&&document$1.createEvent&&global$8.dispatchEvent),UNHANDLED_REJECTION="unhandledrejection",REJECTION_HANDLED="rejectionhandled",PENDING=0,FULFILLED=1,REJECTED=2,HANDLED=1,UNHANDLED=2,isThenable=function(e){var t;return!(!isObject$4(e)||!isCallable$6(t=e.then))&&t},callReaction=function(e,t){var i,r,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?i=o:(u&&u.enter(),i=s(o),u&&(u.exit(),n=!0)),i===e.promise?c(TypeError$2("Promise-chain cycle")):(r=isThenable(i))?call$e(r,i,l,c):l(i)):c(o)}catch(e){u&&!n&&u.exit(),c(e)}},notify=function(e,t){e.notified||(e.notified=!0,microtask((function(){for(var i,r=e.reactions;i=r.get();)callReaction(i,e);e.notified=!1,t&&!e.rejection&&onUnhandled(e)})))},dispatchEvent=function(e,t,i){var r,n;DISPATCH_EVENT?((r=document$1.createEvent("Event")).promise=t,r.reason=i,r.initEvent(e,!1,!0),global$8.dispatchEvent(r)):r={promise:t,reason:i},!NATIVE_PROMISE_REJECTION_EVENT&&(n=global$8["on"+e])?n(r):e===UNHANDLED_REJECTION&&hostReportErrors("Unhandled promise rejection",i)},onUnhandled=function(e){call$e(task,global$8,(function(){var t,i=e.facade,r=e.value;if(isUnhandled(e)&&(t=perform$2((function(){IS_NODE?process.emit("unhandledRejection",r,i):dispatchEvent(UNHANDLED_REJECTION,i,r)})),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$e(task,global$8,(function(){var t=e.facade;IS_NODE?process.emit("rejectionHandled",t):dispatchEvent(REJECTION_HANDLED,t,e.value)}))},bind$1=function(e,t,i){return function(r){e(t,r,i)}},internalReject=function(e,t,i){e.done||(e.done=!0,i&&(e=i),e.value=t,e.state=REJECTED,notify(e,!0))},internalResolve=function(e,t,i){if(!e.done){e.done=!0,i&&(e=i);try{if(e.facade===t)throw TypeError$2("Promise can't be resolved itself");var r=isThenable(t);r?microtask((function(){var i={done:!1};try{call$e(r,t,bind$1(internalResolve,i,e),bind$1(internalReject,i,e))}catch(t){internalReject(i,t,e)}})):(e.value=t,e.state=FULFILLED,notify(e,!1))}catch(t){internalReject({done:!1},t,e)}}};if(FORCED_PROMISE_CONSTRUCTOR$4&&(PromisePrototype=(PromiseConstructor=function(e){anInstance(this,PromisePrototype),aCallable$3(e),call$e(Internal,this);var t=getInternalPromiseState(this);try{e(bind$1(internalResolve,t),bind$1(internalReject,t))}catch(e){internalReject(t,e)}}).prototype,(Internal=function(e){setInternalState$1(this,{type:PROMISE,done:!1,notified:!1,parent:!1,reactions:new Queue,rejection:!1,state:PENDING,value:void 0})}).prototype=defineBuiltIn$6(PromisePrototype,"then",(function(e,t){var i=getInternalPromiseState(this),r=newPromiseCapability$1(speciesConstructor$2(this,PromiseConstructor));return i.parent=!0,r.ok=!isCallable$6(e)||e,r.fail=isCallable$6(t)&&t,r.domain=IS_NODE?process.domain:void 0,i.state==PENDING?i.reactions.add(r):microtask((function(){callReaction(r,i)})),r.promise})),OwnPromiseCapability=function(){var e=new Internal,t=getInternalPromiseState(e);this.promise=e,this.resolve=bind$1(internalResolve,t),this.reject=bind$1(internalReject,t)},newPromiseCapabilityModule$3.f=newPromiseCapability$1=function(e){return e===PromiseConstructor||e===PromiseWrapper?new OwnPromiseCapability(e):newGenericPromiseCapability(e)},isCallable$6(NativePromiseConstructor$3)&&NativePromisePrototype$2!==Object.prototype)){nativeThen=NativePromisePrototype$2.then,NATIVE_PROMISE_SUBCLASSING||defineBuiltIn$6(NativePromisePrototype$2,"then",(function(e,t){var i=this;return new PromiseConstructor((function(e,t){call$e(nativeThen,i,e,t)})).then(e,t)}),{unsafe:!0});try{delete NativePromisePrototype$2.constructor}catch(e){}setPrototypeOf&&setPrototypeOf(NativePromisePrototype$2,PromisePrototype)}$$i({global:!0,constructor:!0,wrap:!0,forced:FORCED_PROMISE_CONSTRUCTOR$4},{Promise:PromiseConstructor}),setToStringTag$1(PromiseConstructor,PROMISE,!1),setSpecies$1(PROMISE);var iterators={},wellKnownSymbol$9=wellKnownSymbol$k,Iterators$1=iterators,ITERATOR$2=wellKnownSymbol$9("iterator"),ArrayPrototype=Array.prototype,isArrayIteratorMethod$1=function(e){return void 0!==e&&(Iterators$1.Array===e||ArrayPrototype[ITERATOR$2]===e)},classof$3=classof$8,getMethod$4=getMethod$6,isNullOrUndefined$3=isNullOrUndefined$7,Iterators=iterators,wellKnownSymbol$8=wellKnownSymbol$k,ITERATOR$1=wellKnownSymbol$8("iterator"),getIteratorMethod$2=function(e){if(!isNullOrUndefined$3(e))return getMethod$4(e,ITERATOR$1)||getMethod$4(e,"@@iterator")||Iterators[classof$3(e)]},call$d=functionCall,aCallable$2=aCallable$7,anObject$a=anObject$h,tryToString$3=tryToString$6,getIteratorMethod$1=getIteratorMethod$2,$TypeError$4=TypeError,getIterator$1=function(e,t){var i=arguments.length<2?getIteratorMethod$1(e):t;if(aCallable$2(i))return anObject$a(call$d(i,e));throw $TypeError$4(tryToString$3(e)+" is not iterable")},call$c=functionCall,anObject$9=anObject$h,getMethod$3=getMethod$6,iteratorClose$1=function(e,t,i){var r,n;anObject$9(e);try{if(!(r=getMethod$3(e,"return"))){if("throw"===t)throw i;return i}r=call$c(r,e)}catch(e){n=!0,r=e}if("throw"===t)throw i;if(n)throw r;return anObject$9(r),i},bind=functionBindContext,call$b=functionCall,anObject$8=anObject$h,tryToString$2=tryToString$6,isArrayIteratorMethod=isArrayIteratorMethod$1,lengthOfArrayLike$2=lengthOfArrayLike$6,isPrototypeOf$3=objectIsPrototypeOf,getIterator=getIterator$1,getIteratorMethod=getIteratorMethod$2,iteratorClose=iteratorClose$1,$TypeError$3=TypeError,Result=function(e,t){this.stopped=e,this.result=t},ResultPrototype=Result.prototype,iterate$2=function(e,t,i){var r,n,o,a,s,l,c,u=i&&i.that,d=!(!i||!i.AS_ENTRIES),h=!(!i||!i.IS_RECORD),p=!(!i||!i.IS_ITERATOR),f=!(!i||!i.INTERRUPTED),g=bind(t,u),y=function(e){return r&&iteratorClose(r,"normal",e),new Result(!0,e)},_=function(e){return d?(anObject$8(e),f?g(e[0],e[1],y):g(e[0],e[1])):f?g(e,y):g(e)};if(h)r=e.iterator;else if(p)r=e;else{if(!(n=getIteratorMethod(e)))throw $TypeError$3(tryToString$2(e)+" is not iterable");if(isArrayIteratorMethod(n)){for(o=0,a=lengthOfArrayLike$2(e);a>o;o++)if((s=_(e[o]))&&isPrototypeOf$3(ResultPrototype,s))return s;return new Result(!1)}r=getIterator(e,n)}for(l=h?e.next:r.next;!(c=call$b(l,r)).done;){try{s=_(c.value)}catch(e){iteratorClose(r,"throw",e)}if("object"==typeof s&&s&&isPrototypeOf$3(ResultPrototype,s))return s}return new Result(!1)},wellKnownSymbol$7=wellKnownSymbol$k,ITERATOR=wellKnownSymbol$7("iterator"),SAFE_CLOSING=!1;try{var called=0,iteratorWithReturn={next:function(){return{done:!!called++}},return:function(){SAFE_CLOSING=!0}};iteratorWithReturn[ITERATOR]=function(){return this},Array.from(iteratorWithReturn,(function(){throw 2}))}catch(e){}var checkCorrectnessOfIteration$1=function(e,t){if(!t&&!SAFE_CLOSING)return!1;var i=!1;try{var r={};r[ITERATOR]=function(){return{next:function(){return{done:i=!0}}}},e(r)}catch(e){}return i},NativePromiseConstructor$2=promiseNativeConstructor,checkCorrectnessOfIteration=checkCorrectnessOfIteration$1,FORCED_PROMISE_CONSTRUCTOR$3=promiseConstructorDetection.CONSTRUCTOR,promiseStaticsIncorrectIteration=FORCED_PROMISE_CONSTRUCTOR$3||!checkCorrectnessOfIteration((function(e){NativePromiseConstructor$2.all(e).then(void 0,(function(){}))})),$$h=_export,call$a=functionCall,aCallable$1=aCallable$7,newPromiseCapabilityModule$2=newPromiseCapability$2,perform$1=perform$3,iterate$1=iterate$2,PROMISE_STATICS_INCORRECT_ITERATION$1=promiseStaticsIncorrectIteration;$$h({target:"Promise",stat:!0,forced:PROMISE_STATICS_INCORRECT_ITERATION$1},{all:function(e){var t=this,i=newPromiseCapabilityModule$2.f(t),r=i.resolve,n=i.reject,o=perform$1((function(){var i=aCallable$1(t.resolve),o=[],a=0,s=1;iterate$1(e,(function(e){var l=a++,c=!1;s++,call$a(i,t,e).then((function(e){c||(c=!0,o[l]=e,--s||r(o))}),n)})),--s||r(o)}));return o.error&&n(o.value),i.promise}});var $$g=_export,FORCED_PROMISE_CONSTRUCTOR$2=promiseConstructorDetection.CONSTRUCTOR,NativePromiseConstructor$1=promiseNativeConstructor,getBuiltIn$5=getBuiltIn$c,isCallable$5=isCallable$n,defineBuiltIn$5=defineBuiltIn$b,NativePromisePrototype$1=NativePromiseConstructor$1&&NativePromiseConstructor$1.prototype;if($$g({target:"Promise",proto:!0,forced:FORCED_PROMISE_CONSTRUCTOR$2,real:!0},{catch:function(e){return this.then(void 0,e)}}),isCallable$5(NativePromiseConstructor$1)){var method$1=getBuiltIn$5("Promise").prototype.catch;NativePromisePrototype$1.catch!==method$1&&defineBuiltIn$5(NativePromisePrototype$1,"catch",method$1,{unsafe:!0})}var $$f=_export,call$9=functionCall,aCallable=aCallable$7,newPromiseCapabilityModule$1=newPromiseCapability$2,perform=perform$3,iterate=iterate$2,PROMISE_STATICS_INCORRECT_ITERATION=promiseStaticsIncorrectIteration;$$f({target:"Promise",stat:!0,forced:PROMISE_STATICS_INCORRECT_ITERATION},{race:function(e){var t=this,i=newPromiseCapabilityModule$1.f(t),r=i.reject,n=perform((function(){var n=aCallable(t.resolve);iterate(e,(function(e){call$9(n,t,e).then(i.resolve,r)}))}));return n.error&&r(n.value),i.promise}});var $$e=_export,call$8=functionCall,newPromiseCapabilityModule=newPromiseCapability$2,FORCED_PROMISE_CONSTRUCTOR$1=promiseConstructorDetection.CONSTRUCTOR;$$e({target:"Promise",stat:!0,forced:FORCED_PROMISE_CONSTRUCTOR$1},{reject:function(e){var t=newPromiseCapabilityModule.f(this);return call$8(t.reject,void 0,e),t.promise}});var anObject$7=anObject$h,isObject$3=isObject$d,newPromiseCapability=newPromiseCapability$2,promiseResolve$2=function(e,t){if(anObject$7(e),isObject$3(t)&&t.constructor===e)return t;var i=newPromiseCapability.f(e);return(0,i.resolve)(t),i.promise},$$d=_export,getBuiltIn$4=getBuiltIn$c,FORCED_PROMISE_CONSTRUCTOR=promiseConstructorDetection.CONSTRUCTOR,promiseResolve$1=promiseResolve$2;getBuiltIn$4("Promise"),$$d({target:"Promise",stat:!0,forced:FORCED_PROMISE_CONSTRUCTOR},{resolve:function(e){return promiseResolve$1(this,e)}});var $$c=_export,NativePromiseConstructor=promiseNativeConstructor,fails$c=fails$t,getBuiltIn$3=getBuiltIn$c,isCallable$4=isCallable$n,speciesConstructor$1=speciesConstructor$3,promiseResolve=promiseResolve$2,defineBuiltIn$4=defineBuiltIn$b,NativePromisePrototype=NativePromiseConstructor&&NativePromiseConstructor.prototype,NON_GENERIC=!!NativePromiseConstructor&&fails$c((function(){NativePromisePrototype.finally.call({then:function(){}},(function(){}))}));if($$c({target:"Promise",proto:!0,real:!0,forced:NON_GENERIC},{finally:function(e){var t=speciesConstructor$1(this,getBuiltIn$3("Promise")),i=isCallable$4(e);return this.then(i?function(i){return promiseResolve(t,e()).then((function(){return i}))}:e,i?function(i){return promiseResolve(t,e()).then((function(){throw i}))}:e)}}),isCallable$4(NativePromiseConstructor)){var method=getBuiltIn$3("Promise").prototype.finally;NativePromisePrototype.finally!==method&&defineBuiltIn$4(NativePromisePrototype,"finally",method,{unsafe:!0})}var DESCRIPTORS$4=descriptors,isArray$2=isArray$5,$TypeError$2=TypeError,getOwnPropertyDescriptor2=Object.getOwnPropertyDescriptor,SILENT_ON_NON_WRITABLE_LENGTH_SET=DESCRIPTORS$4&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}(),arraySetLength=SILENT_ON_NON_WRITABLE_LENGTH_SET?function(e,t){if(isArray$2(e)&&!getOwnPropertyDescriptor2(e,"length").writable)throw $TypeError$2("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t},tryToString$1=tryToString$6,$TypeError$1=TypeError,deletePropertyOrThrow$1=function(e,t){if(!delete e[t])throw $TypeError$1("Cannot delete property "+tryToString$1(t)+" of "+tryToString$1(e))},$$b=_export,toObject$2=toObject$7,toAbsoluteIndex$1=toAbsoluteIndex$3,toIntegerOrInfinity$3=toIntegerOrInfinity$8,lengthOfArrayLike$1=lengthOfArrayLike$6,setArrayLength=arraySetLength,doesNotExceedSafeInteger=doesNotExceedSafeInteger$2,arraySpeciesCreate=arraySpeciesCreate$3,createProperty$1=createProperty$3,deletePropertyOrThrow=deletePropertyOrThrow$1,arrayMethodHasSpeciesSupport$1=arrayMethodHasSpeciesSupport$4,HAS_SPECIES_SUPPORT$1=arrayMethodHasSpeciesSupport$1("splice"),max$2=Math.max,min$2=Math.min;$$b({target:"Array",proto:!0,forced:!HAS_SPECIES_SUPPORT$1},{splice:function(e,t){var i,r,n,o,a,s,l=toObject$2(this),c=lengthOfArrayLike$1(l),u=toAbsoluteIndex$1(e,c),d=arguments.length;for(0===d?i=r=0:1===d?(i=0,r=c-u):(i=d-2,r=min$2(max$2(toIntegerOrInfinity$3(t),0),c-u)),doesNotExceedSafeInteger(c+i-r),n=arraySpeciesCreate(l,r),o=0;o<r;o++)(a=u+o)in l&&createProperty$1(n,o,l[a]);if(n.length=r,i<r){for(o=u;o<c-r;o++)s=o+i,(a=o+r)in l?l[s]=l[a]:deletePropertyOrThrow(l,s);for(o=c;o>c-r+i;o--)deletePropertyOrThrow(l,o-1)}else if(i>r)for(o=c-r;o>u;o--)s=o+i-1,(a=o+r-1)in l?l[s]=l[a]:deletePropertyOrThrow(l,s);for(o=0;o<i;o++)l[o+u]=arguments[o+2];return setArrayLength(l,c-r+i),n}});var toIntegerOrInfinity$2=toIntegerOrInfinity$8,toString$7=toString$c,requireObjectCoercible$3=requireObjectCoercible$9,$RangeError$1=RangeError,stringRepeat=function(e){var t=toString$7(requireObjectCoercible$3(this)),i="",r=toIntegerOrInfinity$2(e);if(r<0||r==1/0)throw $RangeError$1("Wrong number of repetitions");for(;r>0;(r>>>=1)&&(t+=t))1&r&&(i+=t);return i},$$a=_export,uncurryThis$9=functionUncurryThis,toIntegerOrInfinity$1=toIntegerOrInfinity$8,thisNumberValue=thisNumberValue$2,$repeat=stringRepeat,fails$b=fails$t,$RangeError=RangeError,$String=String,floor$1=Math.floor,repeat2=uncurryThis$9($repeat),stringSlice$6=uncurryThis$9("".slice),nativeToFixed=uncurryThis$9(1..toFixed),pow=function(e,t,i){return 0===t?i:t%2==1?pow(e,t-1,i*e):pow(e*e,t/2,i)},log$1=function(e){for(var t=0,i=e;i>=4096;)t+=12,i/=4096;for(;i>=2;)t+=1,i/=2;return t},multiply=function(e,t,i){for(var r=-1,n=i;++r<6;)n+=t*e[r],e[r]=n%1e7,n=floor$1(n/1e7)},divide=function(e,t){for(var i=6,r=0;--i>=0;)r+=e[i],e[i]=floor$1(r/t),r=r%t*1e7},dataToString=function(e){for(var t=6,i="";--t>=0;)if(""!==i||0===t||0!==e[t]){var r=$String(e[t]);i=""===i?r:i+repeat2("0",7-r.length)+r}return i},FORCED$1=fails$b((function(){return"0.000"!==nativeToFixed(8e-5,3)||"1"!==nativeToFixed(.9,0)||"1.25"!==nativeToFixed(1.255,2)||"1000000000000000128"!==nativeToFixed(0xde0b6b3a7640080,0)}))||!fails$b((function(){nativeToFixed({})}));$$a({target:"Number",proto:!0,forced:FORCED$1},{toFixed:function(e){var t,i,r,n,o=thisNumberValue(this),a=toIntegerOrInfinity$1(e),s=[0,0,0,0,0,0],l="",c="0";if(a<0||a>20)throw $RangeError("Incorrect fraction digits");if(o!=o)return"NaN";if(o<=-1e21||o>=1e21)return $String(o);if(o<0&&(l="-",o=-o),o>1e-21)if(i=(t=log$1(o*pow(2,69,1))-69)<0?o*pow(2,-t,1):o/pow(2,t,1),i*=4503599627370496,(t=52-t)>0){for(multiply(s,0,i),r=a;r>=7;)multiply(s,1e7,0),r-=7;for(multiply(s,pow(10,r,1),0),r=t-1;r>=23;)divide(s,1<<23),r-=23;divide(s,1<<r),multiply(s,1,1),divide(s,2),c=dataToString(s)}else multiply(s,0,i),multiply(s,1<<-t,0),c=dataToString(s)+repeat2("0",a);return c=a>0?l+((n=c.length)<=a?"0."+repeat2("0",a-n)+c:stringSlice$6(c,0,n-a)+"."+stringSlice$6(c,n-a)):l+c}});var $$9=_export;$$9({target:"Number",stat:!0},{isNaN:function(e){return e!=e}});var fails$a=fails$t,global$7=global$r,$RegExp$2=global$7.RegExp,UNSUPPORTED_Y$3=fails$a((function(){var e=$RegExp$2("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),MISSED_STICKY$1=UNSUPPORTED_Y$3||fails$a((function(){return!$RegExp$2("a","y").sticky})),BROKEN_CARET=UNSUPPORTED_Y$3||fails$a((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$3=descriptors,V8_PROTOTYPE_DEFINE_BUG=v8PrototypeDefineBug,definePropertyModule$1=objectDefineProperty,anObject$6=anObject$h,toIndexedObject$2=toIndexedObject$7,objectKeys$1=objectKeys$2;objectDefineProperties.f=DESCRIPTORS$3&&!V8_PROTOTYPE_DEFINE_BUG?Object.defineProperties:function(e,t){anObject$6(e);for(var i,r=toIndexedObject$2(t),n=objectKeys$1(t),o=n.length,a=0;o>a;)definePropertyModule$1.f(e,i=n[a++],r[i]);return e};var activeXDocument,anObject$5=anObject$h,definePropertiesModule$1=objectDefineProperties,enumBugKeys=enumBugKeys$3,hiddenKeys$1=hiddenKeys$5,html=html$2,documentCreateElement=documentCreateElement$2,sharedKey$1=sharedKey$3,GT=">",LT="<",PROTOTYPE$1="prototype",SCRIPT="script",IE_PROTO=sharedKey$1("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(e){return LT+SCRIPT+GT+e+LT+"/"+SCRIPT+GT},NullProtoObjectViaActiveX=function(e){e.write(scriptTag("")),e.close();var t=e.parentWindow.Object;return e=null,t},NullProtoObjectViaIFrame=function(){var e,t=documentCreateElement("iframe"),i="java"+SCRIPT+":";return t.style.display="none",html.appendChild(t),t.src=String(i),(e=t.contentWindow.document).open(),e.write(scriptTag("document.F=Object")),e.close(),e.F},NullProtoObject=function(){try{activeXDocument=new ActiveXObject("htmlfile")}catch(e){}NullProtoObject="undefined"!=typeof document?document.domain&&activeXDocument?NullProtoObjectViaActiveX(activeXDocument):NullProtoObjectViaIFrame():NullProtoObjectViaActiveX(activeXDocument);for(var e=enumBugKeys.length;e--;)delete NullProtoObject[PROTOTYPE$1][enumBugKeys[e]];return NullProtoObject()};hiddenKeys$1[IE_PROTO]=!0;var objectCreate=Object.create||function(e,t){var i;return null!==e?(EmptyConstructor[PROTOTYPE$1]=anObject$5(e),i=new EmptyConstructor,EmptyConstructor[PROTOTYPE$1]=null,i[IE_PROTO]=e):i=NullProtoObject(),void 0===t?i:definePropertiesModule$1.f(i,t)},fails$9=fails$t,global$6=global$r,$RegExp$1=global$6.RegExp,regexpUnsupportedDotAll=fails$9((function(){var e=$RegExp$1(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),fails$8=fails$t,global$5=global$r,$RegExp=global$5.RegExp,regexpUnsupportedNcg=fails$8((function(){var e=$RegExp("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),call$7=functionCall,uncurryThis$8=functionUncurryThis,toString$6=toString$c,regexpFlags=regexpFlags$1,stickyHelpers$2=regexpStickyHelpers,shared$3=sharedExports,create2=objectCreate,getInternalState$1=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$4=uncurryThis$8("".charAt),indexOf=uncurryThis$8("".indexOf),replace$4=uncurryThis$8("".replace),stringSlice$5=uncurryThis$8("".slice),UPDATES_LAST_INDEX_WRONG=function(){var e=/a/,t=/b*/g;return call$7(nativeExec,e,"a"),call$7(nativeExec,t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),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,i,r,n,o,a,s,l=this,c=getInternalState$1(l),u=toString$6(e),d=c.raw;if(d)return d.lastIndex=l.lastIndex,t=call$7(patchedExec,d,u),l.lastIndex=d.lastIndex,t;var h=c.groups,p=UNSUPPORTED_Y$2&&l.sticky,f=call$7(regexpFlags,l),g=l.source,y=0,_=u;if(p&&(f=replace$4(f,"y",""),-1===indexOf(f,"g")&&(f+="g"),_=stringSlice$5(u,l.lastIndex),l.lastIndex>0&&(!l.multiline||l.multiline&&"\n"!==charAt$4(u,l.lastIndex-1))&&(g="(?: "+g+")",_=" "+_,y++),i=new RegExp("^(?:"+g+")",f)),NPCG_INCLUDED&&(i=new RegExp("^"+g+"$(?!\\s)",f)),UPDATES_LAST_INDEX_WRONG&&(r=l.lastIndex),n=call$7(nativeExec,p?i:l,_),p?n?(n.input=stringSlice$5(n.input,y),n[0]=stringSlice$5(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:r),NPCG_INCLUDED&&n&&n.length>1&&call$7(nativeReplace,n[0],i,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(n[o]=void 0)})),n&&h)for(n.groups=a=create2(null),o=0;o<h.length;o++)a[(s=h[o])[0]]=n[s[1]];return n});var regexpExec$3=patchedExec,$$8=_export,exec$3=regexpExec$3;$$8({target:"RegExp",proto:!0,forced:/./.exec!==regexpExec$3},{exec:regexpExec$3});var uncurryThis$7=functionUncurryThisClause,defineBuiltIn$3=defineBuiltIn$b,regexpExec$2=regexpExec$3,fails$7=fails$t,wellKnownSymbol$6=wellKnownSymbol$k,createNonEnumerableProperty$1=createNonEnumerableProperty$5,SPECIES=wellKnownSymbol$6("species"),RegExpPrototype$1=RegExp.prototype,fixRegexpWellKnownSymbolLogic=function(e,t,i,r){var n=wellKnownSymbol$6(e),o=!fails$7((function(){var t={};return t[n]=function(){return 7},7!=""[e](t)})),a=o&&!fails$7((function(){var t=!1,i=/a/;return"split"===e&&((i={}).constructor={},i.constructor[SPECIES]=function(){return i},i.flags="",i[n]=/./[n]),i.exec=function(){return t=!0,null},i[n](""),!t}));if(!o||!a||i){var s=uncurryThis$7(/./[n]),l=t(n,""[e],(function(e,t,i,r,n){var a=uncurryThis$7(e),l=t.exec;return l===regexpExec$2||l===RegExpPrototype$1.exec?o&&!n?{done:!0,value:s(t,i,r)}:{done:!0,value:a(i,t,r)}:{done:!1}}));defineBuiltIn$3(String.prototype,e,l[0]),defineBuiltIn$3(RegExpPrototype$1,n,l[1])}r&&createNonEnumerableProperty$1(RegExpPrototype$1[n],"sham",!0)},charAt$3=stringMultibyte.charAt,advanceStringIndex$3=function(e,t,i){return t+(i?charAt$3(e,t).length:1)},uncurryThis$6=functionUncurryThis,toObject$1=toObject$7,floor=Math.floor,charAt$2=uncurryThis$6("".charAt),replace$3=uncurryThis$6("".replace),stringSlice$4=uncurryThis$6("".slice),SUBSTITUTION_SYMBOLS=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,SUBSTITUTION_SYMBOLS_NO_NAMED=/\$([$&'`]|\d{1,2})/g,getSubstitution$1=function(e,t,i,r,n,o){var a=i+e.length,s=r.length,l=SUBSTITUTION_SYMBOLS_NO_NAMED;return void 0!==n&&(n=toObject$1(n),l=SUBSTITUTION_SYMBOLS),replace$3(o,l,(function(o,l){var c;switch(charAt$2(l,0)){case"$":return"$";case"&":return e;case"`":return stringSlice$4(t,0,i);case"'":return stringSlice$4(t,a);case"<":c=n[stringSlice$4(l,1,-1)];break;default:var u=+l;if(0===u)return o;if(u>s){var d=floor(u/10);return 0===d?o:d<=s?void 0===r[d-1]?charAt$2(l,1):r[d-1]+charAt$2(l,1):o}c=r[u-1]}return void 0===c?"":c}))},call$6=functionCall,anObject$4=anObject$h,isCallable$3=isCallable$n,classof$2=classofRaw$2,regexpExec$1=regexpExec$3,$TypeError=TypeError,regexpExecAbstract=function(e,t){var i=e.exec;if(isCallable$3(i)){var r=call$6(i,e,t);return null!==r&&anObject$4(r),r}if("RegExp"===classof$2(e))return call$6(regexpExec$1,e,t);throw $TypeError("RegExp#exec called on incompatible receiver")},apply$2=functionApply,call$5=functionCall,uncurryThis$5=functionUncurryThis,fixRegExpWellKnownSymbolLogic$2=fixRegexpWellKnownSymbolLogic,fails$6=fails$t,anObject$3=anObject$h,isCallable$2=isCallable$n,isNullOrUndefined$2=isNullOrUndefined$7,toIntegerOrInfinity=toIntegerOrInfinity$8,toLength$2=toLength$4,toString$5=toString$c,requireObjectCoercible$2=requireObjectCoercible$9,advanceStringIndex$2=advanceStringIndex$3,getMethod$2=getMethod$6,getSubstitution=getSubstitution$1,regExpExec$1=regexpExecAbstract,wellKnownSymbol$5=wellKnownSymbol$k,REPLACE=wellKnownSymbol$5("replace"),max$1=Math.max,min$1=Math.min,concat2=uncurryThis$5([].concat),push$2=uncurryThis$5([].push),stringIndexOf$1=uncurryThis$5("".indexOf),stringSlice$3=uncurryThis$5("".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$6((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,i){var r=REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE?"$":"$0";return[function(e,i){var r=requireObjectCoercible$2(this),n=isNullOrUndefined$2(e)?void 0:getMethod$2(e,REPLACE);return n?call$5(n,e,r,i):call$5(t,toString$5(r),e,i)},function(e,n){var o=anObject$3(this),a=toString$5(e);if("string"==typeof n&&-1===stringIndexOf$1(n,r)&&-1===stringIndexOf$1(n,"$<")){var s=i(t,o,a,n);if(s.done)return s.value}var l=isCallable$2(n);l||(n=toString$5(n));var c=o.global;if(c){var u=o.unicode;o.lastIndex=0}for(var d=[];;){var h=regExpExec$1(o,a);if(null===h)break;if(push$2(d,h),!c)break;""===toString$5(h[0])&&(o.lastIndex=advanceStringIndex$2(a,toLength$2(o.lastIndex),u))}for(var p="",f=0,g=0;g<d.length;g++){for(var y=toString$5((h=d[g])[0]),_=max$1(min$1(toIntegerOrInfinity(h.index),a.length),0),m=[],v=1;v<h.length;v++)push$2(m,maybeToString(h[v]));var E=h.groups;if(l){var T=concat2([y],m,_,a);void 0!==E&&push$2(T,E);var S=toString$5(apply$2(n,void 0,T))}else S=getSubstitution(y,a,_,m,E,n);_>=f&&(p+=stringSlice$3(a,f,_)+S,f=_+y.length)}return p+stringSlice$3(a,f)}]}),!REPLACE_SUPPORTS_NAMED_GROUPS||!REPLACE_KEEPS_$0||REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);var isObject$2=isObject$d,classof$1=classofRaw$2,wellKnownSymbol$4=wellKnownSymbol$k,MATCH$1=wellKnownSymbol$4("match"),isRegexp=function(e){var t;return isObject$2(e)&&(void 0!==(t=e[MATCH$1])?!!t:"RegExp"==classof$1(e))},toAbsoluteIndex=toAbsoluteIndex$3,lengthOfArrayLike=lengthOfArrayLike$6,createProperty=createProperty$3,$Array=Array,max=Math.max,arraySliceSimple=function(e,t,i){for(var r=lengthOfArrayLike(e),n=toAbsoluteIndex(t,r),o=toAbsoluteIndex(void 0===i?r:i,r),a=$Array(max(o-n,0)),s=0;n<o;n++,s++)createProperty(a,s,e[n]);return a.length=s,a},apply$1=functionApply,call$4=functionCall,uncurryThis$4=functionUncurryThis,fixRegExpWellKnownSymbolLogic$1=fixRegexpWellKnownSymbolLogic,anObject$2=anObject$h,isNullOrUndefined$1=isNullOrUndefined$7,isRegExp$1=isRegexp,requireObjectCoercible$1=requireObjectCoercible$9,speciesConstructor=speciesConstructor$3,advanceStringIndex$1=advanceStringIndex$3,toLength$1=toLength$4,toString$4=toString$c,getMethod$1=getMethod$6,arraySlice$2=arraySliceSimple,callRegExpExec=regexpExecAbstract,regexpExec=regexpExec$3,stickyHelpers$1=regexpStickyHelpers,fails$5=fails$t,UNSUPPORTED_Y$1=stickyHelpers$1.UNSUPPORTED_Y,MAX_UINT32=4294967295,min=Math.min,$push=[].push,exec$2=uncurryThis$4(/./.exec),push$1=uncurryThis$4($push),stringSlice$2=uncurryThis$4("".slice),SPLIT_WORKS_WITH_OVERWRITTEN_EXEC=!fails$5((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var i="ab".split(e);return 2!==i.length||"a"!==i[0]||"b"!==i[1]}));fixRegExpWellKnownSymbolLogic$1("split",(function(e,t,i){var r;return r="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,i){var r=toString$4(requireObjectCoercible$1(this)),n=void 0===i?MAX_UINT32:i>>>0;if(0===n)return[];if(void 0===e)return[r];if(!isRegExp$1(e))return call$4(t,r,e,n);for(var o,a,s,l=[],c=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),u=0,d=new RegExp(e.source,c+"g");(o=call$4(regexpExec,d,r))&&!((a=d.lastIndex)>u&&(push$1(l,stringSlice$2(r,u,o.index)),o.length>1&&o.index<r.length&&apply$1($push,l,arraySlice$2(o,1)),s=o[0].length,u=a,l.length>=n));)d.lastIndex===o.index&&d.lastIndex++;return u===r.length?!s&&exec$2(d,"")||push$1(l,""):push$1(l,stringSlice$2(r,u)),l.length>n?arraySlice$2(l,0,n):l}:"0".split(void 0,0).length?function(e,i){return void 0===e&&0===i?[]:call$4(t,this,e,i)}:t,[function(t,i){var n=requireObjectCoercible$1(this),o=isNullOrUndefined$1(t)?void 0:getMethod$1(t,e);return o?call$4(o,t,n,i):call$4(r,toString$4(n),t,i)},function(e,n){var o=anObject$2(this),a=toString$4(e),s=i(r,o,a,n,r!==t);if(s.done)return s.value;var l=speciesConstructor(o,RegExp),c=o.unicode,u=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(UNSUPPORTED_Y$1?"g":"y"),d=new l(UNSUPPORTED_Y$1?"^(?:"+o.source+")":o,u),h=void 0===n?MAX_UINT32:n>>>0;if(0===h)return[];if(0===a.length)return null===callRegExpExec(d,a)?[a]:[];for(var p=0,f=0,g=[];f<a.length;){d.lastIndex=UNSUPPORTED_Y$1?0:f;var y,_=callRegExpExec(d,UNSUPPORTED_Y$1?stringSlice$2(a,f):a);if(null===_||(y=min(toLength$1(d.lastIndex+(UNSUPPORTED_Y$1?f:0)),a.length))===p)f=advanceStringIndex$1(a,f,c);else{if(push$1(g,stringSlice$2(a,p,f)),g.length===h)return g;for(var m=1;m<=_.length-1;m++)if(push$1(g,_[m]),g.length===h)return g;f=p=y}}return push$1(g,stringSlice$2(a,p)),g}]}),!SPLIT_WORKS_WITH_OVERWRITTEN_EXEC,UNSUPPORTED_Y$1);var PROPER_FUNCTION_NAME=functionName.PROPER,fails$4=fails$t,whitespaces=whitespaces$2,non="​…᠎",stringTrimForced=function(e){return fails$4((function(){return!!whitespaces[e]()||non[e]()!==non||PROPER_FUNCTION_NAME&&whitespaces[e].name!==e}))},$$7=_export,$trim=stringTrim.trim,forcedStringTrimMethod=stringTrimForced;$$7({target:"String",proto:!0,forced:forcedStringTrimMethod("trim")},{trim:function(){return $trim(this)}});var $$6=_export,$filter=arrayIteration.filter,arrayMethodHasSpeciesSupport=arrayMethodHasSpeciesSupport$4,HAS_SPECIES_SUPPORT=arrayMethodHasSpeciesSupport("filter");$$6({target:"Array",proto:!0,forced:!HAS_SPECIES_SUPPORT},{filter:function(e){return $filter(this,e,arguments.length>1?arguments[1]:void 0)}});var call$3=functionCall,fixRegExpWellKnownSymbolLogic=fixRegexpWellKnownSymbolLogic,anObject$1=anObject$h,isNullOrUndefined=isNullOrUndefined$7,toLength=toLength$4,toString$3=toString$c,requireObjectCoercible=requireObjectCoercible$9,getMethod=getMethod$6,advanceStringIndex=advanceStringIndex$3,regExpExec=regexpExecAbstract;fixRegExpWellKnownSymbolLogic("match",(function(e,t,i){return[function(t){var i=requireObjectCoercible(this),r=isNullOrUndefined(t)?void 0:getMethod(t,e);return r?call$3(r,t,i):new RegExp(t)[e](toString$3(i))},function(e){var r=anObject$1(this),n=toString$3(e),o=i(t,r,n);if(o.done)return o.value;if(!r.global)return regExpExec(r,n);var a=r.unicode;r.lastIndex=0;for(var s,l=[],c=0;null!==(s=regExpExec(r,n));){var u=toString$3(s[0]);l[c]=u,""===u&&(r.lastIndex=advanceStringIndex(n,toLength(r.lastIndex),a)),c++}return 0===c?null:l}]}));var defineProperty$2=objectDefineProperty.f,proxyAccessor$1=function(e,t,i){i in e||defineProperty$2(e,i,{configurable:!0,get:function(){return t[i]},set:function(e){t[i]=e}})},DESCRIPTORS$2=descriptors,global$4=global$r,uncurryThis$3=functionUncurryThis,isForced=isForced_1,inheritIfRequired=inheritIfRequired$2,createNonEnumerableProperty=createNonEnumerableProperty$5,getOwnPropertyNames2=objectGetOwnPropertyNames.f,isPrototypeOf$2=objectIsPrototypeOf,isRegExp=isRegexp,toString$2=toString$c,getRegExpFlags=regexpGetFlags,stickyHelpers=regexpStickyHelpers,proxyAccessor=proxyAccessor$1,defineBuiltIn$2=defineBuiltIn$b,fails$3=fails$t,hasOwn$5=hasOwnProperty_1,enforceInternalState=internalState.enforce,setSpecies=setSpecies$2,wellKnownSymbol$3=wellKnownSymbol$k,UNSUPPORTED_DOT_ALL=regexpUnsupportedDotAll,UNSUPPORTED_NCG=regexpUnsupportedNcg,MATCH=wellKnownSymbol$3("match"),NativeRegExp=global$4.RegExp,RegExpPrototype=NativeRegExp.prototype,SyntaxError$1=global$4.SyntaxError,exec$1=uncurryThis$3(RegExpPrototype.exec),charAt$1=uncurryThis$3("".charAt),replace$2=uncurryThis$3("".replace),stringIndexOf=uncurryThis$3("".indexOf),stringSlice$1=uncurryThis$3("".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$2&&(!CORRECT_NEW||MISSED_STICKY||UNSUPPORTED_DOT_ALL||UNSUPPORTED_NCG||fails$3((function(){return re2[MATCH]=!1,NativeRegExp(re1)!=re1||NativeRegExp(re2)==re2||"/a/i"!=NativeRegExp(re1,"i")}))),handleDotAll=function(e){for(var t,i=e.length,r=0,n="",o=!1;r<=i;r++)"\\"!==(t=charAt$1(e,r))?o||"."!==t?("["===t?o=!0:"]"===t&&(o=!1),n+=t):n+="[\\s\\S]":n+=t+charAt$1(e,++r);return n},handleNCG=function(e){for(var t,i=e.length,r=0,n="",o=[],a={},s=!1,l=!1,c=0,u="";r<=i;r++){if("\\"===(t=charAt$1(e,r)))t+=charAt$1(e,++r);else if("]"===t)s=!1;else if(!s)switch(!0){case"["===t:s=!0;break;case"("===t:exec$1(IS_NCG,stringSlice$1(e,r+1))&&(r+=2,l=!0),n+=t,c++;continue;case">"===t&&l:if(""===u||hasOwn$5(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 i,r,n,o,a,s,l=isPrototypeOf$2(RegExpPrototype,this),c=isRegExp(e),u=void 0===t,d=[],h=e;if(!l&&c&&u&&e.constructor===RegExpWrapper)return e;if((c||isPrototypeOf$2(RegExpPrototype,e))&&(e=e.source,u&&(t=getRegExpFlags(h))),e=void 0===e?"":toString$2(e),t=void 0===t?"":toString$2(t),h=e,UNSUPPORTED_DOT_ALL&&"dotAll"in re1&&(r=!!t&&stringIndexOf(t,"s")>-1)&&(t=replace$2(t,/s/g,"")),i=t,MISSED_STICKY&&"sticky"in re1&&(n=!!t&&stringIndexOf(t,"y")>-1)&&UNSUPPORTED_Y&&(t=replace$2(t,/y/g,"")),UNSUPPORTED_NCG&&(e=(o=handleNCG(e))[0],d=o[1]),a=inheritIfRequired(NativeRegExp(e,t),l?this:RegExpPrototype,RegExpWrapper),(r||n||d.length)&&(s=enforceInternalState(a),r&&(s.dotAll=!0,s.raw=RegExpWrapper(handleDotAll(e),i)),n&&(s.sticky=!0),d.length&&(s.groups=d)),e!==h)try{createNonEnumerableProperty(a,"source",""===h?"(?:)":h)}catch(e){}return a},keys3=getOwnPropertyNames2(NativeRegExp),index$3=0;keys3.length>index$3;)proxyAccessor(RegExpWrapper,NativeRegExp,keys3[index$3++]);RegExpPrototype.constructor=RegExpWrapper,RegExpWrapper.prototype=RegExpPrototype,defineBuiltIn$2(global$4,"RegExp",RegExpWrapper,{constructor:!0})}setSpecies("RegExp");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,i=0;i<e.length;i++){var r=e[i].end,n=e[i].begin;Number.isNaN(Number(r))||Number.isNaN(Number(n))||n<0||r<0||r<n||(t+=e[i].end-e[i].begin)}return t=parseInt(1e3*t,10)}function getHostFromUrl(e){if(null==e||""===e||"string"!=typeof e)return"";var t=e.split("/"),i="";return t.length>3&&t[2]&&(i=t[2]),i}function generateSessionId(e){var t=(new Date).getTime();try{e=parseInt(e)}catch(t){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 i=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?i:3&i|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 i=e.split(": "),r=i.shift(),n=i.join(": ");t[r]=n}))}catch(e){return t}return t}function log(e){for(var t,i=arguments.length,r=new Array(i>1?i-1:0),n=1;n<i;n++)r[n-1]=arguments[n];DEBUG&&(t=console).log.apply(t,["[logger]",e].concat(r))}function nowTime$1(){try{return Math.round(window.performance.now())}catch(e){return(new Date).getTime()}}function curTimestamp(){return(new Date).getTime()}function formatData(e,t){var i={ext:e.ext||{},data:{}};return Object.keys(e).map((function(r){t[r]?i.data[t[r]]=e[r]:"ext"!==r&&(i.ext[r]=e[r])})),i}function getXhr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(i,r){try{e||r(new Error("url is undefined"));var n=nowTime$1(),o=n,a={},s=new window.XMLHttpRequest;s.open("get",e),s.onreadystatechange=function(){2===s.readyState&&(a.headers=getResponseHeaders(s),a.connectTime=nowTime$1()-o,a.status=s.status,a.statusText=s.statusText,n=nowTime$1())},s.onload=function(){i(a)},s.onprogress=function(e){var t,i=nowTime$1()-n;t=parseInt(e.loaded/1e3/(i/1e3),10),a.speed=0|t,a.costTime=i},s.onerror=function(){a.status||(a.status=-1,a.costTime=nowTime$1()-n),r(a)},s.ontimeout=function(){a.status||(a.status=-2,a.costTime=nowTime$1()-n),i(a)},s.onabort=function(){i(a)},s.responseType="arraybuffer",s.timeout=t.timeout||1e4,s.setRequestHeader("Range","bytes=".concat(t.range||"0-1048576")),s.send()}catch(e){r(e)}}))}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(i){if(e[i]||"string"!=typeof KEYMAP[i]){if(!e[i]&&KEYMAP[i]instanceof Array){var r=KEYMAP[i].filter((function(t){return void 0!==e[t]}));r.length>0?t[i]=e[r[0]]:t[i]=""}}else t[i]=e[KEYMAP[i]]||""})),t}function appendData(e,t){return e&&("string"==typeof t||"number"==typeof t)?"".concat(e," ").concat(t):t}function typeOf$1(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]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return Object.keys(t).map((function(r){e[r]="append"===i?appendData(e[r],t[r]):t[r]})),e}function hasClass$1(e,t){if(!e||!t)return!1;try{return Array.prototype.some.call(e.classList,(function(e){return e===t}))}catch(r){var i=e.className&&"object"===_typeof$1(e.className)?e.getAttribute("class"):e.className;return i&&!!i.match(new RegExp("(\\s|^)".concat(t,"(\\s|$)")))}}function formatDefinition(e){return"String"===typeOf$1(e)?e.replace("P","p"):e?"Number"===typeOf$1(e)?"".concat(e):void 0:""}function toJsonString(e){try{return JSON.stringify(e)}catch(e){return""}}var URL_EXPIRED_TYPES={UN_KNOW:0,EXPIRED:1,NO_EXPIRED:2};function checkUrlIsExpired(e){if(!e||"String"!==typeOf$1(e))return 0;var t=0;try{var i=new RegExp("(\\?|&)x-tos-expires=([^&]*)(&|$)"),r=e.match(i);if(null!==r)t=parseInt(r[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)?URL_EXPIRED_TYPES.EXPIRED:URL_EXPIRED_TYPES.NO_EXPIRED:URL_EXPIRED_TYPES.UN_KNOW}catch(e){return URL_EXPIRED_TYPES.UN_KNOW}}function getPageVisibility(){return"undefined"==typeof document?0:"visible"===document.visibilityState?1:0}function getPer100(e,t){return Math.round(t/e*1e3*100)}var ENTRIES=[],MAX_COUNT$1=30;function findPerformanceInfo(e){var t={};try{e=e.replace(/^http:|^https:/,"");for(var i=ENTRIES||[],r=function(r){if(i[r].name.replace(/^http:|^https:/,"")===e)return["domainLookupEnd","domainLookupStart","startTime","requestStart","responseEnd","responseStart","connectStart","connectEnd","fetchStart"].map((function(e){t[e]=Math.round(i[r][e])})),t.url=i[r].name,t.duration=Math.round(i[r].duration),t.domainDuration=t.domainLookupEnd-t.domainLookupStart,t.connectDuration=t.connectEnd-t.connectStart,"break"},n=i.length-1;n>=0;n--){if("break"===r(n))break}return t}catch(e){return t}}function addPerformaceObserver(){try{new window.PerformanceObserver((function(e){var t=e.getEntriesByType("resource");ENTRIES.length>MAX_COUNT$1&&ENTRIES.splice(0,ENTRIES.length-MAX_COUNT$1);for(var i=0;i<t.length;i++)ENTRIES.push(t[i])})).observe({entryTypes:["resource"]})}catch(e){console.warn("PerformanceObserver not support",e)}}"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=864e5,MAX_COST=36e5,COMMON_KEYS=["tag","subtag","device_type"],MIN_WAITIONG=200,MAX_STALL_TIME=6e4,MAX_FVT=6e4,FULLSCREEN_TYPE={NO_FULLSCREEN:0,FULLSCREEN:1,CSS:2},isSupport=_isLocalStorageUsable();function probeSupport(){try{return"undefined"!=typeof localStorage&&"setItem"in window.localStorage&&!!window.localStorage.setItem}catch(e){return!1}}function checkIfLocalStorageThrows(){var e="_localstorage_support_test";try{return window.localStorage.setItem(e,!0),window.localStorage.removeItem(e),!1}catch(e){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(e){}},get:function(){try{var e=Strorage.getItem(LOGKEY);return e=e?JSON.parse(e):[]}catch(e){return[]}},remove:function(){try{Strorage.removeItem(LOGKEY)}catch(e){}},clear:function(){try{Strorage.clear()}catch(e){}}},objectGetOwnPropertyNamesExternal={},classof=classofRaw$2,toIndexedObject$1=toIndexedObject$7,$getOwnPropertyNames$1=objectGetOwnPropertyNames.f,arraySlice$1=arraySliceSimple,windowNames="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],getWindowNames=function(e){try{return $getOwnPropertyNames$1(e)}catch(e){return arraySlice$1(windowNames)}};objectGetOwnPropertyNamesExternal.f=function(e){return windowNames&&"Window"==classof(e)?getWindowNames(e):$getOwnPropertyNames$1(toIndexedObject$1(e))};var wellKnownSymbolWrapped={},wellKnownSymbol$2=wellKnownSymbol$k;wellKnownSymbolWrapped.f=wellKnownSymbol$2;var global$3=global$r,path$1=global$3,path=path$1,hasOwn$4=hasOwnProperty_1,wrappedWellKnownSymbolModule$1=wellKnownSymbolWrapped,defineProperty$1=objectDefineProperty.f,wellKnownSymbolDefine=function(e){var t=path.Symbol||(path.Symbol={});hasOwn$4(t,e)||defineProperty$1(t,e,{value:wrappedWellKnownSymbolModule$1.f(e)})},call$2=functionCall,getBuiltIn$2=getBuiltIn$c,wellKnownSymbol$1=wellKnownSymbol$k,defineBuiltIn$1=defineBuiltIn$b,symbolDefineToPrimitive=function(){var e=getBuiltIn$2("Symbol"),t=e&&e.prototype,i=t&&t.valueOf,r=wellKnownSymbol$1("toPrimitive");t&&!t[r]&&defineBuiltIn$1(t,r,(function(e){return call$2(i,this)}),{arity:1})},$$5=_export,global$2=global$r,call$1=functionCall,uncurryThis$2=functionUncurryThis,DESCRIPTORS$1=descriptors,NATIVE_SYMBOL$4=symbolConstructorDetection,fails$2=fails$t,hasOwn$3=hasOwnProperty_1,isPrototypeOf$1=objectIsPrototypeOf,anObject=anObject$h,toIndexedObject=toIndexedObject$7,toPropertyKey=toPropertyKey$4,$toString=toString$c,createPropertyDescriptor=createPropertyDescriptor$4,nativeObjectCreate=objectCreate,objectKeys=objectKeys$2,getOwnPropertyNamesModule=objectGetOwnPropertyNames,getOwnPropertyNamesExternal=objectGetOwnPropertyNamesExternal,getOwnPropertySymbolsModule$1=objectGetOwnPropertySymbols,getOwnPropertyDescriptorModule=objectGetOwnPropertyDescriptor,definePropertyModule=objectDefineProperty,definePropertiesModule=objectDefineProperties,propertyIsEnumerableModule=objectPropertyIsEnumerable,defineBuiltIn=defineBuiltIn$b,shared$2=sharedExports,sharedKey=sharedKey$3,hiddenKeys=hiddenKeys$5,uid=uid$3,wellKnownSymbol=wellKnownSymbol$k,wrappedWellKnownSymbolModule=wellKnownSymbolWrapped,defineWellKnownSymbol=wellKnownSymbolDefine,defineSymbolToPrimitive=symbolDefineToPrimitive,setToStringTag=setToStringTag$2,InternalStateModule=internalState,$forEach=arrayIteration.forEach,HIDDEN=sharedKey("hidden"),SYMBOL="Symbol",PROTOTYPE="prototype",setInternalState=InternalStateModule.set,getInternalState=InternalStateModule.getterFor(SYMBOL),ObjectPrototype=Object[PROTOTYPE],$Symbol=global$2.Symbol,SymbolPrototype$1=$Symbol&&$Symbol[PROTOTYPE],TypeError$1=global$2.TypeError,QObject=global$2.QObject,nativeGetOwnPropertyDescriptor=getOwnPropertyDescriptorModule.f,nativeDefineProperty=definePropertyModule.f,nativeGetOwnPropertyNames=getOwnPropertyNamesExternal.f,nativePropertyIsEnumerable=propertyIsEnumerableModule.f,push=uncurryThis$2([].push),AllSymbols=shared$2("symbols"),ObjectPrototypeSymbols=shared$2("op-symbols"),WellKnownSymbolsStore=shared$2("wks"),USE_SETTER=!QObject||!QObject[PROTOTYPE]||!QObject[PROTOTYPE].findChild,setSymbolDescriptor=DESCRIPTORS$1&&fails$2((function(){return 7!=nativeObjectCreate(nativeDefineProperty({},"a",{get:function(){return nativeDefineProperty(this,"a",{value:7}).a}})).a}))?function(e,t,i){var r=nativeGetOwnPropertyDescriptor(ObjectPrototype,t);r&&delete ObjectPrototype[t],nativeDefineProperty(e,t,i),r&&e!==ObjectPrototype&&nativeDefineProperty(ObjectPrototype,t,r)}:nativeDefineProperty,wrap=function(e,t){var i=AllSymbols[e]=nativeObjectCreate(SymbolPrototype$1);return setInternalState(i,{type:SYMBOL,tag:e,description:t}),DESCRIPTORS$1||(i.description=t),i},$defineProperty=function(e,t,i){e===ObjectPrototype&&$defineProperty(ObjectPrototypeSymbols,t,i),anObject(e);var r=toPropertyKey(t);return anObject(i),hasOwn$3(AllSymbols,r)?(i.enumerable?(hasOwn$3(e,HIDDEN)&&e[HIDDEN][r]&&(e[HIDDEN][r]=!1),i=nativeObjectCreate(i,{enumerable:createPropertyDescriptor(0,!1)})):(hasOwn$3(e,HIDDEN)||nativeDefineProperty(e,HIDDEN,createPropertyDescriptor(1,{})),e[HIDDEN][r]=!0),setSymbolDescriptor(e,r,i)):nativeDefineProperty(e,r,i)},$defineProperties=function(e,t){anObject(e);var i=toIndexedObject(t),r=objectKeys(i).concat($getOwnPropertySymbols(i));return $forEach(r,(function(t){DESCRIPTORS$1&&!call$1($propertyIsEnumerable,i,t)||$defineProperty(e,t,i[t])})),e},$create=function(e,t){return void 0===t?nativeObjectCreate(e):$defineProperties(nativeObjectCreate(e),t)},$propertyIsEnumerable=function(e){var t=toPropertyKey(e),i=call$1(nativePropertyIsEnumerable,this,t);return!(this===ObjectPrototype&&hasOwn$3(AllSymbols,t)&&!hasOwn$3(ObjectPrototypeSymbols,t))&&(!(i||!hasOwn$3(this,t)||!hasOwn$3(AllSymbols,t)||hasOwn$3(this,HIDDEN)&&this[HIDDEN][t])||i)},$getOwnPropertyDescriptor=function(e,t){var i=toIndexedObject(e),r=toPropertyKey(t);if(i!==ObjectPrototype||!hasOwn$3(AllSymbols,r)||hasOwn$3(ObjectPrototypeSymbols,r)){var n=nativeGetOwnPropertyDescriptor(i,r);return!n||!hasOwn$3(AllSymbols,r)||hasOwn$3(i,HIDDEN)&&i[HIDDEN][r]||(n.enumerable=!0),n}},$getOwnPropertyNames=function(e){var t=nativeGetOwnPropertyNames(toIndexedObject(e)),i=[];return $forEach(t,(function(e){hasOwn$3(AllSymbols,e)||hasOwn$3(hiddenKeys,e)||push(i,e)})),i},$getOwnPropertySymbols=function(e){var t=e===ObjectPrototype,i=nativeGetOwnPropertyNames(t?ObjectPrototypeSymbols:toIndexedObject(e)),r=[];return $forEach(i,(function(e){!hasOwn$3(AllSymbols,e)||t&&!hasOwn$3(ObjectPrototype,e)||push(r,AllSymbols[e])})),r};NATIVE_SYMBOL$4||(defineBuiltIn(SymbolPrototype$1=($Symbol=function(){if(isPrototypeOf$1(SymbolPrototype$1,this))throw TypeError$1("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?$toString(arguments[0]):void 0,t=uid(e),i=function(e){this===ObjectPrototype&&call$1(i,ObjectPrototypeSymbols,e),hasOwn$3(this,HIDDEN)&&hasOwn$3(this[HIDDEN],t)&&(this[HIDDEN][t]=!1),setSymbolDescriptor(this,t,createPropertyDescriptor(1,e))};return DESCRIPTORS$1&&USE_SETTER&&setSymbolDescriptor(ObjectPrototype,t,{configurable:!0,set:i}),wrap(t,e)})[PROTOTYPE],"toString",(function(){return getInternalState(this).tag})),defineBuiltIn($Symbol,"withoutSetter",(function(e){return wrap(uid(e),e)})),propertyIsEnumerableModule.f=$propertyIsEnumerable,definePropertyModule.f=$defineProperty,definePropertiesModule.f=$defineProperties,getOwnPropertyDescriptorModule.f=$getOwnPropertyDescriptor,getOwnPropertyNamesModule.f=getOwnPropertyNamesExternal.f=$getOwnPropertyNames,getOwnPropertySymbolsModule$1.f=$getOwnPropertySymbols,wrappedWellKnownSymbolModule.f=function(e){return wrap(wellKnownSymbol(e),e)},DESCRIPTORS$1&&(nativeDefineProperty(SymbolPrototype$1,"description",{configurable:!0,get:function(){return getInternalState(this).description}}),defineBuiltIn(ObjectPrototype,"propertyIsEnumerable",$propertyIsEnumerable,{unsafe:!0}))),$$5({global:!0,constructor:!0,wrap:!0,forced:!NATIVE_SYMBOL$4,sham:!NATIVE_SYMBOL$4},{Symbol:$Symbol}),$forEach(objectKeys(WellKnownSymbolsStore),(function(e){defineWellKnownSymbol(e)})),$$5({target:SYMBOL,stat:!0,forced:!NATIVE_SYMBOL$4},{useSetter:function(){USE_SETTER=!0},useSimple:function(){USE_SETTER=!1}}),$$5({target:"Object",stat:!0,forced:!NATIVE_SYMBOL$4,sham:!DESCRIPTORS$1},{create:$create,defineProperty:$defineProperty,defineProperties:$defineProperties,getOwnPropertyDescriptor:$getOwnPropertyDescriptor}),$$5({target:"Object",stat:!0,forced:!NATIVE_SYMBOL$4},{getOwnPropertyNames:$getOwnPropertyNames}),defineSymbolToPrimitive(),setToStringTag($Symbol,SYMBOL),hiddenKeys[HIDDEN]=!0;var NATIVE_SYMBOL$3=symbolConstructorDetection,symbolRegistryDetection=NATIVE_SYMBOL$3&&!!Symbol.for&&!!Symbol.keyFor,$$4=_export,getBuiltIn$1=getBuiltIn$c,hasOwn$2=hasOwnProperty_1,toString$1=toString$c,shared$1=sharedExports,NATIVE_SYMBOL_REGISTRY$1=symbolRegistryDetection,StringToSymbolRegistry=shared$1("string-to-symbol-registry"),SymbolToStringRegistry$1=shared$1("symbol-to-string-registry");$$4({target:"Symbol",stat:!0,forced:!NATIVE_SYMBOL_REGISTRY$1},{for:function(e){var t=toString$1(e);if(hasOwn$2(StringToSymbolRegistry,t))return StringToSymbolRegistry[t];var i=getBuiltIn$1("Symbol")(t);return StringToSymbolRegistry[t]=i,SymbolToStringRegistry$1[i]=t,i}});var $$3=_export,hasOwn$1=hasOwnProperty_1,isSymbol$1=isSymbol$5,tryToString=tryToString$6,shared=sharedExports,NATIVE_SYMBOL_REGISTRY=symbolRegistryDetection,SymbolToStringRegistry=shared("symbol-to-string-registry");$$3({target:"Symbol",stat:!0,forced:!NATIVE_SYMBOL_REGISTRY},{keyFor:function(e){if(!isSymbol$1(e))throw TypeError(tryToString(e)+" is not a symbol");if(hasOwn$1(SymbolToStringRegistry,e))return SymbolToStringRegistry[e]}});var $$2=_export,getBuiltIn=getBuiltIn$c,apply=functionApply,call=functionCall,uncurryThis$1=functionUncurryThis,fails$1=fails$t,isArray$1=isArray$5,isCallable$1=isCallable$n,isObject$1=isObject$d,isSymbol=isSymbol$5,arraySlice=arraySlice$4,NATIVE_SYMBOL$2=symbolConstructorDetection,$stringify=getBuiltIn("JSON","stringify"),exec=uncurryThis$1(/./.exec),charAt=uncurryThis$1("".charAt),charCodeAt=uncurryThis$1("".charCodeAt),replace$1=uncurryThis$1("".replace),numberToString=uncurryThis$1(1..toString),tester=/[\uD800-\uDFFF]/g,low=/^[\uD800-\uDBFF]$/,hi=/^[\uDC00-\uDFFF]$/,WRONG_SYMBOLS_CONVERSION=!NATIVE_SYMBOL$2||fails$1((function(){var e=getBuiltIn("Symbol")();return"[null]"!=$stringify([e])||"{}"!=$stringify({a:e})||"{}"!=$stringify(Object(e))})),ILL_FORMED_UNICODE=fails$1((function(){return'"\\udf06\\ud834"'!==$stringify("\udf06\ud834")||'"\\udead"'!==$stringify("\udead")})),stringifyWithSymbolsFix=function(e,t){var i=arraySlice(arguments),r=t;if((isObject$1(t)||void 0!==e)&&!isSymbol(e))return isArray$1(t)||(t=function(e,t){if(isCallable$1(r)&&(t=call(r,this,e,t)),!isSymbol(t))return t}),i[1]=t,apply($stringify,null,i)},fixIllFormed=function(e,t,i){var r=charAt(i,t-1),n=charAt(i,t+1);return exec(low,e)&&!exec(hi,n)||exec(hi,e)&&!exec(low,r)?"\\u"+numberToString(charCodeAt(e,0),16):e};$stringify&&$$2({target:"JSON",stat:!0,arity:3,forced:WRONG_SYMBOLS_CONVERSION||ILL_FORMED_UNICODE},{stringify:function(e,t,i){var r=arraySlice(arguments),n=apply(WRONG_SYMBOLS_CONVERSION?stringifyWithSymbolsFix:$stringify,null,r);return ILL_FORMED_UNICODE&&"string"==typeof n?replace$1(n,tester,fixIllFormed):n}});var $$1=_export,NATIVE_SYMBOL$1=symbolConstructorDetection,fails=fails$t,getOwnPropertySymbolsModule=objectGetOwnPropertySymbols,toObject=toObject$7,FORCED=!NATIVE_SYMBOL$1||fails((function(){getOwnPropertySymbolsModule.f(1)}));$$1({target:"Object",stat:!0,forced:FORCED},{getOwnPropertySymbols:function(e){var t=getOwnPropertySymbolsModule.f;return t?t(toObject(e)):[]}});var $=_export,DESCRIPTORS=descriptors,global$1=global$r,uncurryThis=functionUncurryThis,hasOwn2=hasOwnProperty_1,isCallable=isCallable$n,isPrototypeOf=objectIsPrototypeOf,toString3=toString$c,defineProperty4=objectDefineProperty.f,copyConstructorProperties=copyConstructorProperties$2,NativeSymbol=global$1.Symbol,SymbolPrototype=NativeSymbol&&NativeSymbol.prototype;if(DESCRIPTORS&&isCallable(NativeSymbol)&&(!("description"in SymbolPrototype)||void 0!==NativeSymbol().description)){var EmptyStringDescriptionStore={},SymbolWrapper=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:toString3(arguments[0]),t=isPrototypeOf(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(SymbolPrototype.valueOf),symbolDescriptiveString=uncurryThis(SymbolPrototype.toString),regexp=/^Symbol\((.*)\)[^)]+$/,replace=uncurryThis("".replace),stringSlice=uncurryThis("".slice);defineProperty4(SymbolPrototype,"description",{configurable:!0,get:function(){var e=thisSymbolValue(this);if(hasOwn2(EmptyStringDescriptionStore,e))return"";var t=symbolDescriptiveString(e),i=NATIVE_SYMBOL?stringSlice(t,7,-1):replace(t,regexp,"$1");return""===i?void 0:i}}),$({global:!0,constructor:!0,forced:!0},{Symbol:SymbolWrapper})}var 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.]+)/}],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"];function isSupportMP42(){var e={isSupport:!1,mime:""};if("undefined"==typeof document)return e;var t=document.createElement("video");return"function"==typeof t.canPlayType?(H264_MIMETYPES.map((function(i){"probably"===t.canPlayType('video/mp4; codecs="'.concat(i,'"'))&&(e.isSupport=!0,e.mime+="||".concat(i))})),e):(t=null,e)}var SPIDER_UA=["Baiduspider","YandexBot"],SPIDER_BOT=["Baiduspider","googlebot","360Spider","haosouspider","YoudaoBot","Sogou News Spider","Yisouspider","Googlebot","Headless","Applebot","Bingbot","PetalBot"];function checkIsSpider(e,t){var i=!1;SPIDER_UA.map((function(t){t===e&&(i=!0)}));for(var r=0;r<SPIDER_BOT.length;r++){var n=SPIDER_BOT[r];if(-1!==t.indexOf(n)){i=!0;break}}return i}function detect(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";e=e.toLocaleLowerCase();var t=/(iphone)/.test(e)||/(ipad)/.test(e),i=/(android)/.test(e),r=/(windows phone)/.test(e),n=t||i||r,o={isIOS:t,isAndroid:i,isMobile:n,isPC:!n,isPad:/(ipad)/.test(e)},a=isSupportMP42();o.isSupportMP4=a.isSupport,o.mime=a.mime;var s="",l=0,c=[],u=RegMap;/trident/.test(e)&&(u=IERegMap);for(var d=0;d<u.length;d++)if(c=u[d].reg.exec(e)){s=u[d].key,l=c.length>2?c[2]:"";break}s?(o["is".concat(s)]=!0,o.name=s,o.appVersion=l):checkIs360()&&(o.name="360EE");o.name&&"Trident"!==o.name&&(/(trident)/.exec(e)&&(o.name=o.name?"".concat(o.name,"_Trident"):"Trident"));return o.isSpider=checkIsSpider(o.name,e),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 isHevcSupported2(){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 isAvcSupported(){if("undefined"==typeof MediaSource||!MediaSource.isTypeSupported)return{support:!1,message:"MediaSource API not support"};for(var e=!1,t="",i=0;i<H264_MIMETYPES.length;i++){var r='video/mp4; codecs="'.concat(H264_MIMETYPES[i],'"'),n=MediaSource.isTypeSupported(r);t+="".concat(r," is ").concat(n," "),n&&(e=!0)}return{support:e,message:t}}function probeConfigSupported2(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 i=e.video||{},r=e.audio||{};try{var n=MediaSource.isTypeSupported(i.contentType),o=MediaSource.isTypeSupported(r.contentType);return Promise.resolve({supported:n&&o,smooth:!1,powerEfficient:!1})}catch(e){return Promise.resolve(t)}}var __support=[1,1,1,1,1];function initSupport(){__support[0]=Browser.isSupportMP4?__support[1]+1:__support[1],__support[1]=isHevcSupported2()?__support[1]+1:__support[1],probeConfigSupported2({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[2]=__support[2]+1:__support[2]=1})).catch((function(){__support[2]=__support[2]-1}))}function getSupport(){return parseInt(__support.join(""),10)}initSupport();var defaultConfig$1={range:"0-1048576",timer:6e4,timeout:15e3},SpeedCheckTask=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};_classCallCheck$1(this,e),Object.keys(defaultConfig$1).map((function(e){void 0!==t[e]&&null!==t[e]||(t[e]=defaultConfig$1[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$1(e,[{key:"setData",value:function(e){var t=this;if(Object.keys(e).map((function(i){"headers"!==i&&(t._data[i]=e[i])})),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,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"start",r=this.options;this.url=e,!this.url||"start"!==i&&(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"===i?500:r.timer),getXhr(this.url,{range:"start"===i?"0-1024":r.range,timeout:r.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}(),TAG="ProgressInfo";function getBuffers(e){var t=[];if(!e||e.length<1)return t;for(var i=0;i<e.length;i++){var r=parseInt(1e3*e.start(i),10)/1e3,n=parseInt(1e3*e.end(i),10)/1e3;t.push({start:r,end:n})}return t}function getDiff(e,t){return parseInt(1e3*e-1e3*t,10)/1e3}function getDuration(e){for(var t=0,i=0;i<e.length;i++){var r=e[i];r.end<0||(t+=r.end-r.start)}return t}var ProgressInfo=function(){function e(){_classCallCheck$1(this,e),this._init()}return _createClass$1(e,[{key:"_init",value:function(){this.played=[],this.playedSize=0,this.cachedSize=0,this.pcdnCached=0,this.cachedVideoSize=0,this.pcdnVideoCached=0,this.file={audio:0,video:0},this.lastBitrate=null,this.curBitrate={vBitrate:0,aBitrate:0,cdnSize:0,pcdnSize:0,definition:"",fileid:""},this.nextBitrate={start:-1},this.currentTime=0,this.buffered=[],this.cachedTime=0,this.duration=0}},{key:"reset",value:function(){this._init()}},{key:"getFileSize",value:function(e){var t=this.curBitrate,i=t.vBitrate,r=t.aBitrate;return{audio:Math.round(e*r/8),video:Math.round(e*i/8),total:Math.round(e*(i+r)/8)}}},{key:"updatePlayed",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=this.played,r=i.length;if(0===t||r<1){var n=r>0?i[r-1]:null,o=this.curBitrate,a=o.vBitrate,s=o.aBitrate;n&&(n.end<0||n.end-n.start<1)?(n.end<0?n.start=e:n.end=e,n.vBitrate=a,n.aBitrate=s):i.push({start:e,end:-1,vBitrate:a,aBitrate:s})}else i[r-1].end=e}},{key:"calculatePlaySize",value:function(){var e=this.played,t=this.curBitrate,i=getDuration(e),r=Math.round((t.aBitrate+t.vBitrate)*i/8);return this.playedSize+=r,log(TAG,"calculatePlaySize","duration: ".concat(i," playedSize:").concat(this.playedSize),this.played),this.played=[],this.playedSize}},{key:"copyBitrateInfo",value:function(e,t){return["aBitrate","vBitrate","definition","fileid","cdnSize","pcdnSize"].forEach((function(i){e[i]&&(t[i]=e[i])})),t.cdnSize=e.cdnSize,t.pcdnSize=e.pcdnSize,t}},{key:"checkNextBitrate",value:function(e){var t=this.nextBitrate;if(t.start>-1&&e>=t.start){var i=this.curBitrate;this.calculatePlaySize(),log(TAG,"checkNextBitrate",e,t.start,this.cachedSize),this.copyBitrateInfo(t,i),this.updatePlayed(e,0),t.start=-1,t.fileid="",["vBitrate","aBitrate","cdnSize","pcdnSize"].forEach((function(e){t[e]=0}))}}},{key:"updateLastDefInfo",value:function(){var e=this.curBitrate;if(e.vBitrate>0){var t={};this.copyBitrateInfo(e,t),this.lastBitrate=t}}},{key:"updateDefInfo",value:function(e,t){log(TAG,"updateDefInfo",t,this.curBitrate.vBitrate,e);var i=e.mediaType,r=e.start,n=e.bitrate,o=e.definition,a=e.fileid,s={cdnSize:0,pcdnSize:0};"audio"===i?s.aBitrate=n:(s.vBitrate=n,s.definition=o,s.fileid=a,this.updateLastDefInfo()),s.start=r,this.nextBitrate=s,this.checkNextBitrate(t)}},{key:"upDateDownload",value:function(e){var t=e.cdn_size,i=e.pcdn_size,r=e.mediaType,n=this.curBitrate,o=this.nextBitrate,a=0,s=0;i?(a=1,s=i):t&&(s=t),this.cachedSize+=s,"video"===r&&(this.cachedVideoSize+=s,a>0&&(this.pcdnVideoCached+=s)),a>0&&(this.pcdnCached+=s);var l=o.start>=0?o:n;l.cdnSize+=s,a>0&&(l.pcdnSize+=s)}},{key:"updateBuffered",value:function(e){var t=getBuffers(e),i=0;t.forEach((function(e){i+=getDiff(e.end,e.start)})),this.buffered=t,this.cachedTime=i}},{key:"isDefInfoFirstChange",value:function(){return!(this.curBitrate&&this.curBitrate.vBitrate>0)}}]),e}();const VERSION$1="0.12.10";var _excluded=["try_req_num","req_node_succ","conn_req_num","has_ret_node","conn_fail_num","conn_jump_num"];log("xgVodLogger version is ".concat("0.12.10"));var isObject=isType("Object"),TEA_ID=1300,LS_KEY="__tea_cache_tokens_".concat(TEA_ID),DEFAULT_INTERVAL=-1,AB_SDK_VERSION="",Collector=null,XGPlayerAppLogger=function(){function e(t,i){var r=this;if(_classCallCheck$1(this,e),_defineProperty$1(this,"initializeUrlLog",(function(e){var t=e&&e.url?e.url:"String"===typeOf$1(e)?e:"";"String"!==typeOf$1(t)&&(t=""),r.urlLog={initial_url:t,initial_host:getHostFromUrl(t),initial_ip:""}})),_defineProperty$1(this,"onXgLogCache",(function(){var e,t=r._getLogCache();t&&(r._templog={vtype:null===(e=r.player)||void 0===e?void 0:e.vtype,log:t},r.onOneTemp())})),_defineProperty$1(this,"onPrfDataSize",(function(e){r._progressInfo.upDateDownload(e)})),_defineProperty$1(this,"onDegrade",(function(e){e&&(e.local_time=(new Date).getTime(),r.onOneEvent({end_type:"degrade"},e))})),_defineProperty$1(this,"onMediaFormatError",(function(e){r.onOneEvent({end_type:"".concat(e.error_type||"","Error")})})),_defineProperty$1(this,"onReplayBtnClick",(function(){r.resetLoggerParams()})),_defineProperty$1(this,"onBeforeDefinitionChange",(function(){r.resLogs.ldst=nowTime$1(),r._endType="switch"})),_defineProperty$1(this,"onDefinitionChangeDetail",(function(e){var t=r._progressInfo;t.updateDefInfo(e,r.player.currentTime),t.lastBitrate&&"video"===e.mediaType&&r.sendSwitchOpera("changedetail")})),_defineProperty$1(this,"onDefinitionChange",(function(e){var t=e.from,i=e.to;r.changeResolution({from:t,to:i,startTime:r.resLogs.ldst,operaType:"switch"}),log("onDefinitionChange from:".concat(t,", to:").concat(i))})),_defineProperty$1(this,"onDefiChangeSuccess",(function(){log("onDefinitionChangeSuccess"),r.updateVideoSize(),r.triggerTask("start")})),_defineProperty$1(this,"onAbrChange",(function(e){var t=e.prev,i=e.cur,n=e.abrInfo;if(r.player.abrInstance){var o=r.player.abrInstance.eventInfo;log("abrChange",o),o.last_definition=t,o.now_definition=i,r.abrInfo.abr_event_info.video_switch.push(o),r.changeResolution({from:t,to:i,startTime:nowTime$1(),operaType:"abr_switch",abrInfo:n})}})),_defineProperty$1(this,"onTimeUpdate",(function(){var e=r.playlogs,t=r.resLogs,i=r.player;if(r.errorLog.try_err_c=0,e.vt||1!==r.startStep||(e.vt=curTimestamp(),log("onTimeUpdate: first frame inited","currentTime11:".concat(i.currentTime," vt-pt:").concat(e.vt-e.pt," vt-nt:").concat(e.vt-e.nt," vt-rt:").concat(e.vt-e.rt)),r.startStep=2),!t.initial_resolution){var n=i.currentDefitionFromPlayer&&i.currentDefitionFromPlayer.definition?i.currentDefitionFromPlayer.definition:i.config.defaultDefinition||"".concat(i.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:i.currentTime,end:-1}):e.played[o-1].end=i.currentTime,r._progressInfo.updatePlayed(i.currentTime),r._progressInfo.checkNextBitrate(i.currentTime);var a=t.played.length;a<1?t.played.push({begin:i.currentTime,end:-1}):t.played[a-1].end=i.currentTime,r.lastVideoTime=i.currentTime||0})),_defineProperty$1(this,"onVideoProgress",(function(){r.updateBuffers(),r._progressInfo.updateBuffered(r.player.buffered)})),_defineProperty$1(this,"onCanplay",(function(){log("onCanplay","this.startStep:".concat(r.startStep," ").concat(curTimestamp())),r.setVt()})),_defineProperty$1(this,"onLoadeddata",(function(){log("onLoadeddata","this.startStep:".concat(r.startStep," ").concat(curTimestamp())),r.setVt(),r.updateVideoSize()})),_defineProperty$1(this,"onLoadStart",(function(){r.commonParams.web_url=location.href;var e=checkVideoSrcIsEmpty(r.player.currentSrc);r.triggerTask("start"),log("onLoadStart","this.startStep:".concat(r.startStep," ").concat(curTimestamp()," isSrcEmpty:").concat(e," player.src:").concat(r.player.src)),0!==r.startStep||e||"visible"!==document.visibilityState||r.setPt()})),_defineProperty$1(this,"onBufferedChange",(function(){var e=r.player.video&&r.player.video.buffered;if(e){var t=e.length;t>0&&e.end(t-1)+1>r.player.duration&&(r.bft=curTimestamp())}})),_defineProperty$1(this,"onPlayerInited",(function(){log("player init"),r._playerCreatedTime=curTimestamp(),r.playlogs.rt=curTimestamp()})),_defineProperty$1(this,"onNotAutoPlay",(function(){log("onNotAutoPlay","autoplay:".concat(r.isAutoplay)),0===r.isAutoplay?r.isAutoplay=2:1===r.isAutoplay&&(r.isAutoplay=3)})),_defineProperty$1(this,"onPlayerError",(function(e){e=e||{};var t=r.errorLog,i=r.player;if(log("onPlayerError","this.player.type:".concat(r.player.type," this.player.replayRunning:").concat(r.player.replayRunning," isSupportMP4:").concat(Browser.isSupportMP4," isPC:").concat(Browser.isPC)),log("onPlayerError",e),r.load_state=LOAD_STATES.ERROR,r._endType="error",r.suspendWaitingStatus("onPlayerError"),r._progressInfo.calculatePlaySize(),"dash"!==i.type||!i.replayRunning){if(e.url||(e.url=r.player.currentSrc),Browser.isPC&&!Browser.isSupportMP4||Browser.isSpider)return t.errc=ERROR_CODES[5],t.errt=ERROR_TYPES.notSupport,r.onOneError({errorType:t.errt,code:t.errc,url:e.url,headers:e.headers||{},message:e.message||""},0),void(r._isOnePlayReport=!0);t.errt=e.errorTypeCode||(e.errorType&&ERROR_TYPES[e.errorType]?ERROR_TYPES[e.errorType]:9999),t.message=e.message||"",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),r.sendSwitchOpera(ENDED_TYPE.ERROR),r.onOnePlay(ENDED_TYPE.ERROR),r.onOneTemp(ENDED_TYPE.ERROR),r.sendDegradeLog("playCatch_end",r.playlogs.degrade);var n=!1,o=e.mediaError;o&&r._options.needXhrCheck&&(4===o.code||2===o)&&(n=!0),r.onOneError({endState:ENDED_TYPE.PLAY_ERROR,errorType:t.errt,code:t.errc,url:e.url,headers:e.headers||{},message:e.message||""},0,n),r.sendEventsQueue()}})),_defineProperty$1(this,"onPlayInterfaceInfo",(function(e){log("onPlayInterfaceInfo",e);var t=r.errorLog,i=r.apiLog,n=r.playlogs;if(e&&Object.keys(e).map((function(t){"code"===t?i.vsc=e[t]:"message"===t?i.vsc_message=e.message||"success,视频可正常播放":i[t]=e[t]})),n.at=e.timestamep||(new Date).getTime(),(!e.error||-9988!==e.error.errc)&&(i.vsc=e.code||10,i.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$1()),r.onOneError({errorType:1e3,code:o.errc||-9998,url:"",headers:{}})}})),_defineProperty$1(this,"onProgressEvent",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=r.netLog;if(e.speed){var i=e.speed>1e6?Math.floor(e.speed/1e3):e.speed;t.downloadSpeed=i,t.totalSpeed+=i,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$1(_objectSpread2$1({},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&&r.merror.cdn.push(_objectSpread2$1(_objectSpread2$1({costTime:e.costTime,cur_play_pos:e.pos,cdn_url:u,cdn_host:getHostFromUrl(u)},c),l)),r.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$1(this,"onNext",(function(){if(log("onNext:startStep:",r.startStep),r.startStep>0){if(r._reportInvalidVV(ENDED_TYPE.NEXT))return;r.sendSwitchOpera(ENDED_TYPE.NEXT),r.onOnePlay(ENDED_TYPE.NEXT),r.onOneTemp(ENDED_TYPE.NEXT),r.sendEventsQueue()}r.vtype=null,r.playlogs.lc=0,r.resetLoggerParams()})),_defineProperty$1(this,"onNextEnded",(function(){var e=r.player,t=r.resLogs,i=formatDefinition(e.config.defaultDefinition||"");t.initial_resolution=i,t.final_resolution=i})),_defineProperty$1(this,"onXgLogWaiting",(function(e){var t=r.playlogs,i=r.resLogs,n=r.stall;if(r._options.checkByInnerLog&&0===e.type){log("onXgLogWaiting",e);var o=e.endType,a=e.costTime,s=e.start,l={download_speed:r.realSpeed,avg_speed:r.avgSpeed,mse_op:r.mp4MseOpLength,mp4_load_range:r.mp4LoadSegmentTimeRange,bitrate:r.curBitrate};if("waitingStart"===e.eventType)return r.onOneEvent({costTime:a,end_type:"waitstart"},l,2),void r.appendStallInfo("start",s);if("waitingEnd"===e.eventType){var c=nowTime$1();log("onXgLogWaiting>>".concat(o,"|costTime:").concat(a," vt:").concat(t.vt)),r.appendStallInfo("end",c,o),t.bc++,r.checkInBuffer(r.player.currentTime)?(t.de_bu_acu_t+=a,t.dbc++):(t.nbc++,t.n_bu_acu_t+=a),i.bc++,t.bu_acu_t+=a,i.bu_acu_t+=a,n.end=r.cur_play_pos,n.cost=a,n.acc+=n.cost,1===n.sc&&(n.endf=r.cur_play_pos),r.onOneEvent({costTime:a,end_type:"waitend"},l,2)}}})),_defineProperty$1(this,"onSeeking",(function(){if(!checkVideoSrcIsEmpty(r.player.src)){var e=r.resLogs,t=r.playlogs,i=r.player,n=r.seekLog;log("onSeeking","currentTime:".concat(i.currentTime)),0===r.startStep&&r.setPt(),r.suspendWaitingStatus("seek"),r.isSeeking&&r.suspendSeekStatus("seek",!1),r.isSeeking=!0,t.played.push({begin:i.currentTime,end:-1}),e.played.push({begin:i.currentTime,end:-1}),r._progressInfo.updatePlayed(i.currentTime,0),n.lastSeekStartTime=nowTime$1(),n.seekBefore=r.lastVideoTime.toString(),n.buf_include=r.checkInBuffer(r.player.currentTime)?1:0,n.intervalId=setTimeout((function(){r.isSeeking&&r.suspendSeekStatus("seekTimeout",!0)}),MAX_STALL_TIME)}})),_defineProperty$1(this,"onSeeked",(function(){checkVideoSrcIsEmpty(r.player.src)||r.isSeeking&&r.suspendSeekStatus("seeked",!0)})),_defineProperty$1(this,"onPlaying",(function(){r.suspendWaitingStatus("play"),r.load_state=LOAD_STATES.PLAYABLE;var e=nowTime$1();r.pauseLog.isPausing&&(r.pauseLog.isPausing=!1,r.pauseLog.pause_acu_t+=e-r.pauseLog.pause_start)})),_defineProperty$1(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":r.vtype="DASH_2";break;case"dash2mp4":r.vtype="MP4_2";break;case"dash1mp4":r.vtype="MP4_1";break;default:r.vtype=e}var i=r.errorLog,n=r.playlogs;r.merror.playCatch.push(_objectSpread2$1({errc:t.errorCode,errt:t.errorType},t.headers)),r.setBr("playcatch"),i.accu_errc++,i.try_err_c++,i.fir_errc=t.errorCode,t.errorCode&&i.last_errors.push(t.errorCode),r.suspendWaitingStatus("playcatch"),r.suspendSeekStatus("playcatch"),r.sendDegradeLog("playCatch",n.degrade,{cdn_url:t.url}),n.degrade=e,r.onOneError({errorType:t.errorTypeCode,code:t.errorCode,url:t.url||"",status:t.httpCode||t.status,headers:t.headers||{},vid:t.vid||r.vid,preload_hit:t.preloadHit||0,preload_cached:t.preloadCached||0,endState:ENDED_TYPE.PLAY_CATCH,costTime:t.costTime,message:t.errorMessage||t.message,interval_time:t.timerStep||0},0)}})),_defineProperty$1(this,"onMediaExpied",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{errorType:"",errorTypeCode:0,errorCode:0,url:"",headers:{},status:0},t=r.errorLog,i=r.playlogs;log("onMediaExpied",e),r.suspendWaitingStatus("expied"),r.setBr("expied"),t.accu_errc++,t.try_err_c++,t.last_errors.push(e.errorCode),i.at=(new Date).getTime(),r.merror.expied.push(_objectSpread2$1({errorType:e.errorTypeCode||e.errorType,code:e.errorCode,url:e.url||"",status:e.status},transformHeader(e.headers||{}))),r.onOneError({errorType:e.errorTypeCode||e.errorType,code:e.errorCode,url:e.url||"",status:e.status,headers:e.headers||{}},0)})),_defineProperty$1(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:r._templog||(r._templog={}),r._templog=parseTempData(r._templog,e.data,e.action),r._templog.preload_hit&&(r._cacheFile=CACHE_FILE_TYPE.CACHED);break;case LOGTYPES.ONEERROR:var i=r.errorLog;i.accu_errc++,i.try_err_c++,r.setBr("mp4error"),i.last_errors.push(e.code),r.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])})),r.onOneEvent(n.data,n.ext,2)}})),_defineProperty$1(this,"onPlay",(function(){log("onPlay","this.startStep :".concat(r.startStep," this.isEnded:").concat(r.isEnded)),r.isEnded&&(r.resetLoggerParams(),r.setPt())})),_defineProperty$1(this,"onPause",(function(){log("onPause");var e=r.pauseLog;e.isPausing=!0,e.pause_start=nowTime$1()})),_defineProperty$1(this,"onWaiting",(function(){var e=r._options;r.updateCurBuffer("onWaiting"),e.checkByInnerLog||(log("onWaiting>","isSeeking:".concat(r.isSeeking," startStep:").concat(r.startStep," intervalId:").concat(r.stallIntervalId)),r.wait_buf_include=r.checkInBuffer(r.player.currentTime,-1e3)?1:0,r.isSeeking||0===r.playlogs.vt||r.inWaitingStart>0||(r.stallIntervalId&&(window.clearTimeout(r.stallIntervalId),r.stallIntervalId=null),r.inWaitingStart=nowTime$1(),r.waitStartTime=r.cur_play_pos,r.stallIntervalId=window.setTimeout((function(){var e=r.stall;log("this.stallIntervalId>>".concat(r.stallIntervalId," cost: ").concat(nowTime$1()-r.inWaitingStart)),r._endType="wait",r.load_state=LOAD_STATES.STALLED,r.vtype.indexOf("MP4")>-1&&r.player.currentTime>10&&r.task&&(r.triggerTask("waiting",r.initial_url),r.requestCount++),e.start=r.waitStartTime,e.bc++,1===e.bc&&(e.startf=r.waitStartTime),window.clearTimeout(r.stallIntervalId),r.stallIntervalId=null,r.startWaitingStatus(r.inWaitingStart,nowTime$1()-r.inWaitingStart),r.stallIntervalId=setTimeout((function(){r.inWaitingStart>0&&r.suspendWaitingStatus("timeout")}),MAX_STALL_TIME)}),MIN_WAITIONG)))})),_defineProperty$1(this,"onEnded",(function(){if(r.initial_url){log("onEnded","watchDur:".concat(r.watchDur," vt:").concat(r.vt," pt:").concat(r.pt)),r.isEnded=!0;var e=r.resLogs.df,t=r._progressInfo;t.calculatePlaySize(),t.cachedSize<1?r.changeResolution({from:e,to:e,startTime:nowTime$1(),operaType:"leave_switch",endType:"ended"}):r.sendSwitchOpera(ENDED_TYPE.ENDED),r.onOnePlay(ENDED_TYPE.ENDED),r.sendDegradeLog("playCatch_end",r.playlogs.degrade),r.onOneTemp(ENDED_TYPE.ENDED),r.sendEventsQueue(),r.playlogs.lc++}})),_defineProperty$1(this,"onUnload",(function(){0!==r.startStep&&r.initial_url&&(r.onOneTemp(ENDED_TYPE.UNLOAD),r.sendDegradeLog("playCatch_end",r.playlogs.degrade),r._reportInvalidVV(ENDED_TYPE.UNLOAD)||(r.sendSwitchOpera(ENDED_TYPE.UNLOAD),r.onOnePlay(ENDED_TYPE.UNLOAD,!0)))})),_defineProperty$1(this,"onVisibilitychange",(function(){var e=r.playlogs.vt;"visible"===document.visibilityState&&(e||r.setPt())})),_defineProperty$1(this,"onDestroy",(function(){log("onDestroy:this.startStep:".concat(r.startStep," initial_url:").concat(r.initial_url," ").concat(!!r.initial_url)),r.onOnePlay(ENDED_TYPE.DESTROY),r.startStep>0&&r.initial_url&&(r.onOneTemp(ENDED_TYPE.DESTROY),r.sendDegradeLog("playCatch_end",r.playlogs.degrade));var e=r.resLogs.df;r._progressInfo.cachedSize<1?r.changeResolution({from:e,to:e,startTime:nowTime$1(),operaType:"leave_switch",endType:"destroy"}):r.sendSwitchOpera(ENDED_TYPE.ENDED),r.sendEventsQueue(),Browser.isPC?window.removeEventListener("beforeunload",r.onUnload):(Browser.isMobile||Browser.isPad)&&window.removeEventListener("pagehide",r.onUnload),document.removeEventListener("visibilitychange",r.onVisibilitychange),r.listeners.forEach((function(e){r.player.off(e.evt,e.handler)})),r.clearTimers(),r.player.off("destroy",r.onDestroy),r.task&&r.task.clear()})),_defineProperty$1(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(r._isOnePlayReport," isLeave: ").concat(t," endState:").concat(e)),!r._isOnePlayReport){var i=r.errorLog,n=r.playlogs,o=r.abrInfo,a=r.resLogs,s=r.player,l=r.apiLog,c=r.pauseLog,u=r.stall,d=r.netLog,h=r.watchDur;r._isOnePlayReport=!0;var p=curTimestamp();r.getBufferTime(s);var f=r.getFrameInfo(),g=r.getPerformance(),y=i.errc,_=r._progressInfo,m=_.playedSize,v=_.cachedSize,E=_.pcdnCached,T=_.cachedVideoSize,S=_.pcdnVideoCached,P=r._progressInfo.getFileSize(s.duration),C=r.seekLog,b=C.sc,I=C.sat,A={bc:getPer100(h,r.bc),bu_acu_t:getPer100(h,r.bu_acu_t),sc:getPer100(h,b),sat:getPer100(h,I)};r.setExt();var O=r._getCompatibilityInfo();r.setNovv(null,e);var D=_objectSpread2$1(_objectSpread2$1(_objectSpread2$1(_objectSpread2$1({local_time:(new Date).getTime(),log_type:"video_playq",plugin_exception:0,player_create_exception:"",v:r.vid,initial_url:r.initial_url,initial_host:r.initial_host,initial_ip:r.curHeaders.x_response_sinfo||0,initial_type:r.initial_type},r.curHeaders),{},{initial_resolution:a.initial_resolution,final_resolution:a.final_resolution,pt:r.pt,prepare_start_time:n.nt,prepare_end_time:n.rt||curTimestamp(),vt:r.vt,lt:r.lt,lpt:r.lpt,fvt:r.fvt,nvt:r.nvt,bft:r.bft,sc:b,sat:I,bc:r.bc,dbc:n.dbc||0,nbc:n.nbc||0,video_net_s:r.videoNetworkState,status:r.curStatus,first_buf_startt:u.startf,first_buf_endt:u.endf,lc:n.lc,bu_acu_t:r.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:r.cur_play_pos,load_state:r.load_state,play_speed:r.playbackRate,playback_state:r.playback_state,end_state:e,watch_dur:h,switch_resolution_c:r.switchResolutionCount,is_start_play_automatically:r.isAutoplay,start_time:r.start_time,finish:r.finish,errt:i.errt,errc:y,vsc:l.vsc,vsc_message:i.message||l.vsc_message,api_str:l.api_str,auth:l.auth||l.logid,width:r.videoWidth,height:r.videoHeight,vd:r.vd,video_length:P.video,audio_length:P.audio,df:r.resolution,lf:a.lf,play_c:0,player_created_t:r.player_created_t,fir_errt:i.fir_errt,fir_errc:i.fir_errc,lv_method:0,ldst:a.ldst,ldet:a.ldet,is_disable_short_seek:0,mute:r.mute,volume:r.volume,download_speed:r.realSpeed?r.realSpeed:r.task&&r.task.speed?r.task.speed:d.downloadSpeed,avg_speed:r.avgSpeed?r.avgSpeed:d.rqCount>0?parseInt(d.totalSpeed/d.rqCount,10):0,bitrate:r.curBitrate,preload_state:r.preloadState,preload_hit:r.preLoadData.hit||0,preload_cached:r.preLoadData.duration||r.preLoadData.byteLength||0,mdl_req_num:d.requestCount,watingcost:r.watingCost,br:n.br,fbrt:n.fbrt,try_err_c:i.try_err_c,accu_errc:i.accu_errc,merror:toJsonString(r.merror),ex:toJsonString(r.exInfo),perf:toJsonString(g),bufs:toJsonString(r.buffers.allBuffer),vds:v,pvds:E,vps:m,vvds:T,pvvds:S,pcdn:toJsonString(r.getPCDNStat())},r.buffers.curBuffer),{},{degrade:n.degrade,cache_file:r._cacheFile},f),{},{fullScreen:r._getFullScreenType(),encryptedInfo:toJsonString(r.encryptedInfo),per100_info:toJsonString(A)},O);0!==r.vt&&(D.et=p);var R=r._logstrcache||r._getLogCache();0===D.fvt&&R&&(D.log=R,r._logstrcache=null),null!=s&&s.softDecoder&&(D.soft_decoder=s.softDecoder),s&&s.dashState&&(D.dash_state=s.dashState),null!=s&&s.softDecoder&&(D.soft_decoder=s.softDecoder),o.abr_init_opts=s.config.autoBitrateOpts||{},D.abr_info=toJsonString(r.abrInfo);var $=O.is_support_mp4&&O.is_support_mse_mp4;if(O.is_spider||Browser.isPC&&!$&&0===r.fvt)log("is_spider",O.is_spider,"is_support_mp4",O.is_support_mp4);else if(t){var L=!r._options.disableLocalCache;r.reportLog(REPORT_EVENTS.ONE_PLAY,D,L?1:0)}else r.reportLog(REPORT_EVENTS.ONE_PLAY,D)}})),_defineProperty$1(this,"onOneEvent",(function(e){var t=e.costTime,i=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=r.buffers,d=u.curBuffer,h=u.allBuffer,p=r.getFrameInfo(),f=_objectSpread2$1(_objectSpread2$1({local_time:(new Date).getTime(),v:i||r.vid,cost_time:t,end_type:n||r.end_type,cdn_url:a||r.url,cdn_host:s||"",initial_type:r.initial_type,resolution:r.resolution,play_speed:r.playbackRate,first_frame_interval:nowTime$1()-r.pt,last_switch_interval:r.getLastInterval("lastSwitchStartTime",r.resLogs,!1),last_seek_interval:r.updateSeekPt(!1),last_event_interval:r.getLastInterval("lastEventTime"),cur_play_pos:o||r.cur_play_pos,video_ready_s:r.videoReadyState,video_seeking:r.videoSeeking,video_paused:r.videoPaused,bufs:toJsonString(h),retry_count:r._retryCount,at:r.playlogs.at,bc:r.stall.bc,stay_seconds:parseInt(((new Date).getTime()-r.playlogs.at)/1e3,10),preload_state:r.preloadState,preload_hit:r.preLoadData.hit,preload_cached:r.preLoadData.duration||r.preLoadData.byteLength},d),p);n.indexOf("waitend")>=0&&t>3e3&&(f.log=r._getLogCache());var g=r.player,y=g.currentTime,_=g.duration-y;if(n.indexOf("waitstart")>=0&&_<=1){var m=f.local_time,v=f.v,E=f.cost_time,T=f.cdn_url,S=f.first_frame_interval,P=f.cur_play_pos,C=f.video_ready_s,b=f.video_seeking,I=f.video_paused,A=f.bufs,O=f.bc,D=f.preload_hit;r.reportLog(REPORT_EVENTS.ONE_EVENT,_objectSpread2$1({end_type:"longwait",local_time:m,v:v,cost_time:E,cdn_url:T,first_frame_interval:S,cur_play_pos:P,video_ready_s:C,video_seeking:b,video_paused:I,bufs:A,bc:O,preload_hit:D},d),c)}if("waitstart"===n&&"function"==typeof r._options.getPageFPS){var R=r._options.getPageFPS();f.cur_fps=R.curFPS||0,f.avg_fps=R.avgFPS||0}n.indexOf("wait")>-1&&(f.buf_include=r.wait_buf_include),n.indexOf("timeout")>-1&&f.cost_time>MAX_COST&&(f.cost_time=MAX_COST);var $=r.player;$&&$.dashState&&(f.dash_state=r.player.dashState),Object.keys(l).forEach((function(e){f[e]=l[e]})),f.ex=toJsonString(r.getPlayerExt()),r.addIfExist("drm_type",r._options,f),r.reportLog(REPORT_EVENTS.ONE_EVENT,f,c)})),_defineProperty$1(this,"onOneTemp",(function(){if(log("onOneTemp>>",!r._templog),r._templog){var e=r.player,t=r.playlogs,i=r.pauseLog,n=r.errorLog,o=r.resLogs,a=r.watchDur,s=_objectSpread2$1(_objectSpread2$1(_objectSpread2$1({local_time:(new Date).getTime()},r._templog),{},{v:r.vid,initial_type:r.initial_type,pt:r.pt,vt:r.vt,lt:r.lt,fvt:r.fvt,bc:r.bc,bu_acu_t:r.bu_acu_t>MAX_TIME?0:r.bu_acu_t,pause_acu_t:i.pause_acu_t,cur_play_pos:r.cur_play_pos,watch_dur:a>MAX_TIME?0:a,finish:r.finish,errt:n.errt,errc:n.errc,vd:r.vd,df:r.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(r.buffers.allBuffer),vs:o.vs,vds:o.vds,vps:o.vps},r.buffers.curBuffer),{},{degrade:t.degrade});0!==r.vt&&(s.et=curTimestamp()),["drm_type","dynamic_type"].forEach((function(e){r.addIfExist(e,r._options,s)})),r.reportLog(REPORT_EVENTS.ONE_TEMP,s,0),r._templog=null}})),this.player=t,void 0===this.player||null===this.player)throw new Error("player is ".concat(this.player));if(i&&i.line_app_id){i.isTask&&(this.task=new SpeedCheckTask),this.eventQueue=[],this._instanceCreateTime=(new Date).getTime(),i.codec_type=i.codec_type||"h264",this._envInfo=i.envInfo||{},this._options=i,!this._options.maxQueueCount&&(this._options.maxQueueCount=5),this.line_app_id=parseInt(i.line_app_id,10)||0,this.line_user_id=(i.line_user_id||"").toString(),this.playerCoreVersion=t.version,this.playerVersion=i.playerVersion,this.closeSeekLog=i.closeSeekLog||!1,this.start_time=1e3*(i.start_time||0),this._initial_resolution="",this.__vtype=null,this.__dt="",this._progressInfo=new ProgressInfo,this.resetLoggerParams();try{this.initializeTracker(),this.sendLocalLog(),this.bindEvt(),log("logger constructor:".concat(this.player.video))}catch(e){console.error(e)}}else console.warn("player.config.vodLogOpts.line_app_id is necessary for plugin xgVodLogger")}return _createClass$1(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}],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._progressInfo.reset(),this._novv={log_pt:curTimestamp()},this.initializeLogDatas(),this.initializeUrlLog()}},{key:"setNovv",value:function(e,t){!this._novv||this.fvt>0||(e&&(this._novv.errc=e.code,this._novv.errt=e.errorType,this._novv.errorMessage=e.message),this._novv.end_state=t,this._novv.novv_pt||(this._novv.novv_pt=curTimestamp(),this._novv.novv_lpt=curTimestamp()-this._novv.log_pt),this.player&&(this._novv.vtype=this.player.vtype,this.player.novv=this._novv))}},{key:"initializeLogDatas",value:function(){this.startStep=0,this.inWaitingStart=0,this.waitStartTime=0,this.lastVideoTime=0,this._endType="",this._retryCount=0,this.lastOperaTime=DEFAULT_INTERVAL,this.lastEventTime=DEFAULT_INTERVAL,this.stallIntervalId=null,this.seekLog={intervalId:0,lastSeekStartTime:nowTime$1(),seekBefore:0,sat:0,sc:0,buf_include: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:[],message:""},this.pauseLog={pause_acu_t:0,isPausing:!1,pause_start:0},this.stall={sc:0,startf:0,endf:0,start:0,end:0,cost:0,acc: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 i=t.channel||"cn",r={app_id:"cn"===(i="va"===i||"sg"===i?i:"cn")?TEA_ID:1300===TEA_ID?323254:TEA_ID,channel:i,log:!1,disable_sdk_monitor:!0,disable_heartbeat:!0};t.channelDomain&&(r.channel_domain=t.channelDomain),r.enable_ab_test=!!t.enableAbTest,this.tracker.init(r)}this.initSessionId();var n=navigator?navigator.hardwareConcurrency:0,o=navigator?navigator.deviceMemory:0;this.commonParams={play_type:0,source_type:"vid",sdk_version:"0.12.10",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:getSupport(),webdriver:navigator&&navigator.webdriver?1:0,player_sessionid:this.sessionId,web_url:window.location.href,user_agent:navigator.userAgent};var a=t.trackerConfig||{};log("commonParams ",this.commonParams,a);var s=_objectSpread2$1({evtParams:this.commonParams,disable_auto_pv:!0},a);!Browser.name||Browser.isChrome||Browser.isSafari||(s.browser=Browser.name,Browser.appVersion&&(s.browser_version=Browser.appVersion)),this.line_user_id&&(s.user_unique_id=this.line_user_id,!t.enableTeaWebId&&(s.web_id=this.line_user_id)),t.referrer&&(s.referrer=t.referrer,s.referrer_host=getHostFromUrl(t.referrer)),t.ext&&Object.keys(t.ext).map((function(i){e.exInfo[i]=t.ext[i]})),log("trackConfig",s),this.tracker.config(s),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(i){if(log("sendLocalLog",i,t[i]),e.player){e.player.emit("abLog",i,t[i]);var r=e._options.sendLocalCallback;r&&"function"==typeof r&&r(i,t[i])}e._track(i,t[i])}))}))}},{key:"_track",value:function(e,t){"function"==typeof this.tracker?this.tracker(e,t):this._options.enableBeacon&&e===REPORT_EVENTS.ONE_PLAY?this.tracker.beaconEvent(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:"ended",handler:this.onEnded},{evt:"loadeddata",handler:this.onLoadeddata},{evt:"loadstart",handler:this.onLoadStart},{evt:"canplay",handler:this.onCanplay},{evt:"progress",handler:this.onVideoProgress},{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:"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:"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},{evt:"degrade",handler:this.onDegrade},{evt:"definitionChangeDetail",handler:this.onDefinitionChangeDetail},{evt:"prf_data_size",handler:this.onPrfDataSize}];var t=this.player.config.errorKey;log(">>>errorKey",t);var i={evt:"error",handler:this.onPlayerError};t&&(i.evt=t),this.listeners.push(i),this.listeners.forEach((function(t){e.player.on(t.evt,t.handler)})),this.bindUnload()}},{key:"_getLogCache",value:function(){var e,t;return(null===(e=this.player)||void 0===e?void 0:e.logCache)||(null===(t=this.player)||void 0===t?void 0:t.getLogCache)}},{key:"addIfExist",value:function(e,t,i){if(isObject(t)){var r=t[e];!(null==r)&&(i[e]=r)}}},{key:"sendSwitchOpera",value:function(e){var t=this._progressInfo,i=t.lastBitrate,r=t.curBitrate,n=t.nextBitrate,o={costTime:0,operaType:"detail_switch",stateBefore:"",stateAfter:"",endType:e},a=null;if("changedetail"===e){if(!i)return;a=i,o.stateBefore=i.definition,o.stateAfter=n.definition}else a=r,o.stateBefore=r.definition,o.stateAfter="";var s={vds:a.cdnSize,pvds:a.pcdnSize,fileid:a.fileid};this.onOneOperator(o,s)}},{key:"changeResolution",value:function(e){var t=e.from,i=e.to,r=e.startTime,n=e.operaType,o=e.abrInfo,a=e.endType,s=void 0===a?"":a,l=this.resLogs;t=formatDefinition(t),i=formatDefinition(i),l.ldet=nowTime$1(),l.df=i,l.lf=t,l.final_resolution=i,l.switch_count++;var c=l.ldet-r,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:i},u,0)}},{key:"getLastInterval",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=t[e],n=nowTime$1(),o=r===DEFAULT_INTERVAL?DEFAULT_INTERVAL:n-r;return i&&(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;e.intervalId&&window.clearTimeout(e.intervalId),this.stallIntervalId&&window.clearTimeout(this.stallIntervalId)}},{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",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};log("sendDegradeLog",e,t,i);var r=this.degradeLog;if(!(r.hasSendEnd||"playCatch_end"===e&&"none"===t)){"playCatch_end"===e&&(r.hasSendEnd=!0);var n=this.bu_acu_t-r.bu_acu_t;this.onOneEvent({costTime:this.vd,vid:this.vid,end_type:e,cur_play_pos:this.player.currentTime,cdn_url:i.url},_objectSpread2$1({degrade:t,vt:this.vt,pt:this.pt,fvt:this.fvt,bc:this.bc-r.bc,bu_acu_t:n>MAX_TIME?0:n,watch_dur:this.watchDur-r.watch_dur},i),0)}}},{key:"_getFullScreenType",value:function(){return this.player.isFullscreen?FULLSCREEN_TYPE.FULLSCREEN_TYPE:this.player.isCssfullScreen?FULLSCREEN_TYPE.CSS:FULLSCREEN_TYPE.NO_FULLSCREEN}},{key:"getBufferTime",value:function(e){var t=0,i=0,r=e.video&&e.video.buffered;if(r){for(var n=r.length,o=0,a=0;a<n;a++)o+=r.end(a)-r.start(a);t=i=1e3*o}return{video:t,audio:i}}},{key:"updateAbrInfo",value:function(e,t,i){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:i},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(i){"performance"!==i&&(e.exInfo[i]=t[i])}))}},{key:"onOneOperator",value:function(e){var t=e.costTime,i=e.operaType,r=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:i,state_before:r,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};"seek"===i&&(c.buf_include=this.seekLog.buf_include,this.seekLog.buf_include=0);var 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,interval_time:0},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=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(),d=t.code>0?0-t.code:t.code;this.setExt();var h=this._getCompatibilityInfo();this.setNovv(t,t.endState||ENDED_TYPE.ERROR);var p=_objectSpread2$1(_objectSpread2$1(_objectSpread2$1({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:d,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,interval_time:t.interval_time||0},h);s&&s.dashState&&(p.dash_state=s.dashState);var f=this.player.currentSrc,g=checkIsBlob(f)?checkIsBlob(t.url)?this.initial_url:t.url:f,y={connectTime:0,status:0,statusText:"",isexpired:0,isBlob:checkIsBlob(f)?1:0};if(r&&"String"===typeOf$1(g)){var _={};getXhr(g,{range:"0-8",timeout:2e3}).then((function(e){log("getXhr>>check result ",e);var t=transformHeader(e.headers||{});p.server_ip=t.x_response_sinfo,_=_objectSpread2$1(_objectSpread2$1({},y),{},{statusText:e.statusText||"",status:e.status||0,connectTime:0|e.connectTime,sinfo:t.x_response_sinfo||"",cinfo:t.x_response_cinfo||""})})).catch((function(e){_=_objectSpread2$1(_objectSpread2$1({},y),{},{statusText:-2===e.status?"timeout":"error",status:e.status})})).finally((function(){var t=checkUrlIsExpired(g);_.isexpired=t,p.net=toJsonString(_),e.reportLog(REPORT_EVENTS.ONE_ERROR,p,i)}))}else p.net=toJsonString(y),this.reportLog(REPORT_EVENTS.ONE_ERROR,p,i)}},{key:"_getCompatibilityInfo",value:function(){var e=isAvcSupported();return{is_spider:Browser.isSpider?1:0,is_support_mp4:Browser.isSupportMP4?1:0,is_support_hevc:isHevcSupported2()?1:0,is_support_mse_mp4:e.support?1:0,support_mse_mp4:e.message}}},{key:"reportLog",value:function(t,i,r){var n=this,o=this._options,a=this.player.ABTestTag,s=this.commonParams;i.dynamic_type=this.dynamicType;var l="Array"===typeOf$1(o.absdkVersion)?o.absdkVersion.join(","):o.absdkVersion;i.absdkVersion=l||e.AB_SDK_VERSION,null!=a&&(i.abtest_tag=a);var c=this._options;i.codec_type=this.codecType,isObject(c)&&(COMMON_KEYS.forEach((function(e){n.addIfExist(e,c,i)})),Object.keys(s).forEach((function(e){n.addIfExist(e,s,i)})),i.vtype=this.vtype),i.env_info=toJsonString(this._envInfo||{}),i.support=getSupport(),i.visible=getPageVisibility();var u=function(){if(1===r){var e={};return e[t]=i,void LOCAL_LOG.set(e)}2!==r?(n.player&&n.player.emit("abLog",t,i),n._track(t,i)):n.addEventsQueue(t,i)};if("function"==typeof o.onReportLog){var d=o.onReportLog(t,i);null!=d&&d.then?d.finally((function(){return u()})):u()}else u()}},{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.appendStallInfo("start",e),this.updateCurBuffer("startWaitingStatus"),this.onOneEvent({costTime:t,end_type:"waitstart"},{},2)}},{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),!checkVideoSrcIsEmpty(t=t||this.player.src)&&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,i=arguments.length>2?arguments[2]:void 0;this.exInfo.stall||(this.exInfo.stall=[]);var r=this.exInfo.stall;if("start"===e){r.length>6&&r.splice(0,r.length-6);var n=this.buffers.curBuffer;r.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=r.length-1;if(o<0)return;r[o].end<0&&(r[o].end=t,r[o].endType=i,r[o].cost=t-r[o].start)}log("appendStallInfo",r)}},{key:"suspendWaitingStatus",value:function(e){var t=nowTime$1(),i=this.playlogs,r=this.resLogs,n=this.stall,o=this.inWaitingStart;if(!(o<=0||this.isSeeking||i.vt<=0)){if(log("suspendWaitingStatus>>".concat(e,"|costTime:").concat(t-o," isSeeking:").concat(this.isSeeking)),this.appendStallInfo("end",t,e),t-o>MIN_WAITIONG){var a=t-this.inWaitingStart;if(i.bc++,this.checkInBuffer(this.player.currentTime)?(i.de_bu_acu_t+=a,i.dbc++):(i.nbc++,i.n_bu_acu_t+=a),r.bc++,i.bu_acu_t+=a,r.bu_acu_t+=a,n.end=this.cur_play_pos,n.cost=a,n.acc+=n.cost,1===n.sc&&(n.endf=this.cur_play_pos),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:"waitend_".concat(e)||"waitend"},{},2)}this._endType="",this.load_state=LOAD_STATES.PLAYABLE,this.inWaitingStart=0,this.waitStartTime=0,window.clearTimeout(this.stallIntervalId),this.stallIntervalId=null}}},{key:"suspendSeekStatus",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.isSeeking){var i=this.seekLog,r=this.resLogs,n=this.player,o=nowTime$1()-i.lastSeekStartTime;log("suspendSeekStatus>>","".concat(e," currentTime:").concat(n.currentTime," costTime:").concat(o," sat:").concat(i.sat," resLogs.sat:").concat(r.sat)),i.intervalId&&window.clearTimeout(i.intervalId),i.intervalId=null,this.isSeeking=!1;var a=this._endType="seek",s=i.seekBefore,l=(n.currentTime||0).toString();i.sc++,i.sat+=o>MAX_COST?0:o,r.sc++,r.sat+=o>MAX_COST?0:o,o>MAX_COST&&(o=MAX_COST),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(){var e=this.playlogs.bu_acu_t;return e>MAX_TIME?0:e}},{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,i=e.pt,r=0;return t>0&&i>0&&(r=parseInt(t-i,10)),r>MAX_FVT?MAX_FVT:r}},{key:"nvt",get:function(){var e=this.playlogs,t=e.vt,i=e.nt;return t>0&&i>0?parseInt(t-i,10):0}},{key:"getFrameInfo",value:function(){if(this.player&&this.player.videoFrameInfo){var e=this.player.videoFrameInfo,t=e.dropped,i=e.corrupted,r=e.droppedRate;return{f_total:e.total,drop_count:t,drop_rate:r,corrupted:i}}return{f_total:0,drop_count:0,drop_rate:0,corrupted:0}}},{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(t){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,i=this.netLog;return t.indexOf("MP4")>-1?e?e.status:0:i.status}},{key:"play_type",get:function(){return 0}},{key:"resolution",get:function(){var e=this.player.curDefinition;return e?"".concat(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 i=t.preLoadData.length;return{hit:i>0,length:i}}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,i=e.curDefinition;return i&&i.bitrate?i.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$1(this.player.root,"xgplayer-playing")}},{key:"isStop",get:function(){return hasClass$1(this.player.root,"xgplayer-ended")||hasClass$1(this.player.root,"xgplayer-nostart")}},{key:"isPause",get:function(){return hasClass$1(this.player.root,"xgplayer-pause")}},{key:"isLoading",get:function(){return hasClass$1(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"".concat(this.isAutoplay)}},{key:"watchDur",get:function(){var e=this.player,t=this.playlogs,i=e.cumulateTime?e.cumulateTime:computeWatchDur(t.played);return i>=0?i>MAX_TIME?MAX_TIME:i:0}},{key:"vtype",get:function(){if(this.__vtype)return this.__vtype;var e=this.player?this.player.vtype||this.player.config.vtype:"";return e||(this.player.dash?"DASH":this._options.vtype||"MP4")},set:function(e){this.__vtype=e}},{key:"envInfo",get:function(){return this._envInfo},set:function(e){e&&(this._envInfo=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$1()-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:"updateBuffers",value:function(){var e=this.player.buffered,t=[];if(!e||e.length<1)this.buffers.allBuffer=[];else{for(var i=0;i<e.length;i++){var r=parseInt(1e3*e.start(i),10),n=parseInt(1e3*e.end(i),10);t.push({s:r,e:n})}this.buffers.allBuffer=t}}},{key:"updateCurBuffer",value:function(e){var t=this.player,i=t.buffered,r=t.currentTime,n={buf_s_pos:0,buf_e_pos:0,buf_include:0,buf_diff:0};if(!i||i.length<1)return n;for(var o=-1,a=-1,s=parseInt(1e3*r,10),l=i.length-1;l>-1;l--){var c=parseInt(1e3*i.start(l),10),u=parseInt(1e3*i.end(l),10);if(s>=c&&s<=u){n.buf_include=1,n.buf_s_pos=c,n.buf_e_pos=u,n.buf_diff=u-s;break}s<c&&(o<0||c-s<o)?(o=c-s,a=l):s>u&&(o<0||s-u<o)&&(o=s-u,a=l)}1!==n.buf_include&&(a<0&&(a=i.length-1),n.buf_s_pos=parseInt(1e3*i.start(a),10),n.buf_e_pos=parseInt(1e3*i.end(a),10)),this.buffers.curBuffer=n}},{key:"checkInBuffer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=this.player.buffered;if(!i)return!1;e=parseInt(1e3*e,10);for(var r=0;r<i.length;r++){var n=parseInt(1e3*i.start(r),10),o=parseInt(1e3*i.end(r),10)+t;if(e>n&&e<o)return!0}return!1}},{key:"getPCDNStat",value:function(){if(this.player&&this.player.pcdnVVStat){var e=this.player.pcdnVVStat,t=e.try_req_num,i=e.req_node_succ,r=e.conn_req_num;return _objectSpread2$1({try_req:t,req_succ:i,has_ret:e.has_ret_node,conn_req:r,conn_fail:e.conn_fail_num,conn_jump:e.conn_jump_num},_objectWithoutProperties(e,_excluded))}return{}}},{key:"updateVideoSize",value:function(){var e=this._options,t=this.player,i=this.resLogs,r=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,r=a?a.size:0}else{var s=this.player.curDefinition;s?(n=s.bitrate||t.config.bitrate||0,r=parseInt(s.bitrate*t.duration/8,10)):(r=e.videoSize||t.config.videoSize||0,n=e.bitrate||t.config.bitrate||0)}log("updateVideoSize","bitrate:".concat(n,", vs:").concat(r)),r&&(i.vs=r,i.vis=parseInt(r/t.duration,10),i.bitrate=n||i.vis)}},{key:"updateVds",value:function(){var e=this.resLogs,t=this.playlogs,i=this.player;if(0!==e.vis){for(var r=parseInt(computeWatchDur(t.played)/1e3,10),n=i.buffered,o=0,a=0;a<n.length;a++)o+=parseInt(n.end(a)-n.start(a),10);log("updateVds","pdur:".concat(r," 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.lplayed=r,e.lbuf=o}else log("updateVds","vis:".concat(e.vis))}},{key:"encryptedInfo",get:function(){return this.player.encryptedInfo||{encryptedType:0}}}],[{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$1(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(){},disableLocalCache:!1,closeResolutionLog:!1,closeSeekLog:!1,needXhrCheck:!1,trackerConfig:{},envInfo:{},enableTeaWebId:!1,enableBeacon:!1}}}]),e}();const PRELOADER_STATUS_READY=2,defaultTeaId=null==(_a=getCurUserRegionConfig())?void 0:_a.__LOG_TEA_ID__;function createTtDramaTrackerCallable(e){let t={};const i=(i,r)=>{const n=(e=>Object.assign({},t,null!=e?e:{}))(r);VE_DEBUG.log("veplayer sendLog",i,n),e(i,n)};function r(e,t){i(e,t)}return r.init=e=>{},r.config=e=>{const i=null==e?void 0:e.evtParams;i&&"object"==typeof i&&(t=__spreadValues({},i))},r.start=()=>{},r.event=(e,t)=>{i(e,t)},r.beaconEvent=(e,t)=>{i(e,t)},r}function getTtDramaSendLog(){var e;const t=null==(e=VePlayer$1.ttDramaEnv)?void 0:e.sendLog;return"function"==typeof t?t:void 0}function createCollectorConstructor(){return function(e){const t=getTtDramaSendLog();if(t)return createTtDramaTrackerCallable(t);const i=getCollector();return i?new i(e):void 0}}function isVodLoggerEnabled(){return Boolean(getTtDramaSendLog()||getCollector())}XGPlayerAppLogger.TEA_ID=defaultTeaId,XGPlayerAppLogger.Collector=createCollectorConstructor();const CREATE_PLAYER_GET_VIDEOS_PERF_KEY="beforePlayerCreate.authtoken.getVideoInfo.getVideos",CREATE_PLAYER_GET_DRAMA_INFO_PERF_PREFIX=`${CREATE_PLAYER_GET_VIDEOS_PERF_KEY}.getDramaInfoViaJSB.perfInfo`,CREATE_PLAYER_GET_DRAMA_INFO_PERF_KEYS={prepareCost:`${CREATE_PLAYER_GET_DRAMA_INFO_PERF_PREFIX}.prepareCost`,requestCost:`${CREATE_PLAYER_GET_DRAMA_INFO_PERF_PREFIX}.requestCost`,parseCost:`${CREATE_PLAYER_GET_DRAMA_INFO_PERF_PREFIX}.parseCost`,totalCost:`${CREATE_PLAYER_GET_DRAMA_INFO_PERF_PREFIX}.totalCost`};function getCreatePlayerPerfDuration(e,t){var i,r,n,o,a;const s=null==e?void 0:e.sdk,l=null==(r=null==(i=null==s?void 0:s._createPlayerPerf)?void 0:i.timingMap)?void 0:r[t],c=null==(a=null==(o=null==(n=null==s?void 0:s.getCreatePlayerPerfReport)?void 0:n.call(s))?void 0:o.timingMap)?void 0:a[t],u="number"==typeof l?l:c;return Number.isFinite(u)?u:0}function getServerFetchDuration(e){return getCreatePlayerPerfDuration(e,CREATE_PLAYER_GET_VIDEOS_PERF_KEY)}function getServerFetchClientPerfCosts(e){return{server_fetch_prepare_cost:getCreatePlayerPerfDuration(e,CREATE_PLAYER_GET_DRAMA_INFO_PERF_KEYS.prepareCost),server_fetch_request_cost:getCreatePlayerPerfDuration(e,CREATE_PLAYER_GET_DRAMA_INFO_PERF_KEYS.requestCost),server_fetch_parse_cost:getCreatePlayerPerfDuration(e,CREATE_PLAYER_GET_DRAMA_INFO_PERF_KEYS.parseCost),server_fetch_total_cost:getCreatePlayerPerfDuration(e,CREATE_PLAYER_GET_DRAMA_INFO_PERF_KEYS.totalCost)}}function getCreatePlayerTotalDuration(e){var t,i,r;const n=null==(r=null==(i=null==(t=null==e?void 0:e.sdk)?void 0:t.getCreatePlayerPerfReport)?void 0:i.call(t))?void 0:r.totalDuration;return Number.isFinite(n)?n:0}function isPreloadEnabledByPrepare(){return 2===VePlayer$1.preloaderStatus}const xgVodLogger=function(e){if(e&&e.player){const t=(t,i)=>__async(this,null,(function*(){var r,n,o;const a=e.player;i.player_sum_num=getCurrentPlayerSumNum(a),i.is_mse=isMSE(a),i.drm_encrypt_type=getDrmType(a)||"",i.initial_url=util.isBlob(i.initial_url)&&a.config.url||i.initial_url,i.album_id=a.config.albumId||"",i.episode_id=a.config.episodeId||"",i.client_key=(null==(r=VePlayer$1.ttDramaEnv)?void 0:r.clientKey)||"";const s=getServerFetchDuration(a),l=getCreatePlayerTotalDuration(a);if(i.server_fetch_duration=s,Object.assign(i,getServerFetchClientPerfCosts(a)),i.create_player_total_duration=l,i.prepare_play=l-s,i.is_preload_enabled=isPreloadEnabledByPrepare(),t===REPORT_EVENTS.ONE_PLAY||t===REPORT_EVENTS.ONE_ERROR){const e=null==a?void 0:a.veError;0!==i.errc&&e?(i.ve_error_code=(null==e?void 0:e.veErrorCode)||0,i.ve_error_type=(null==e?void 0:e.veErrorType)||"",i.ve_error_message=(null==e?void 0:e.veErrorMessage)||"",i.ve_error_ext=JSON.stringify((null==e?void 0:e.ext)||"")):(i.ve_error_code=0,i.ve_error_type="",i.ve_error_message="",i.ve_error_ext=""),i.licenseStatus=(null==(n=null==a?void 0:a.licenseLogInfo)?void 0:n.licenseStatus)||"",i.licenseType=(null==(o=null==a?void 0:a.licenseLogInfo)?void 0:o.licenseType)||""}})),i=Object.assign({onReportLog:t},e.player.config.vodLogOpts||{});e.player.vodLogger=new XGPlayerAppLogger(e.player,i),e.player.plugins.xgVodLogger=e.player.vodLogger}else this.vodLogger=new XGPlayerAppLogger(this,this.config.vodLogOpts||{})};function setTeaId(e){XGPlayerAppLogger.TEA_ID=e}xgVodLogger.pluginName="__xgVodLogger",xgVodLogger.playerConfig={},xgVodLogger.Collector=XGPlayerAppLogger.Collector,xgVodLogger.setABSdkVersion=e=>{XGPlayerAppLogger.AB_SDK_VERSION=e};var merge=createAssigner((function(e,t,i){baseMerge(e,t,i)}));const merge$1=merge;class AbstractBaseAdapter{constructor(e){this.isLive=e.configs.isLive,this.playerData=e.playerData,this.streamType=e.streamType}}const liteDependencies={"@byted/streamprobe":"1.0.2","@byted/volcengine-vestrategy":"1.1.0-rc.71","@byted/volcengine-vestrategy-adapt-range":"1.1.0-rc.0","@byted/volcengine-vestrategy-h265":"1.1.0-rc.0","@byted/volcengine-vestrategy-preload":"1.1.0-rc.3","@byted/xgplayer-encrypt":"3.5.29-rc.1","@byted/xgplayer-encrypt-hls":"4.2.0","@byted/xgplayer-encrypt-mp4":"3.0.31-alpha.1","@byted/xgplayer-vod-abralgo":"1.0.5","@byted/xgplayer-vod-preload":"1.0.9-rc.3","@byted/xgplayer-xgvideo":"0.2.5-rc.3","xgplayer-flv":"3.0.23-rc.6","xgplayer-hls":"3.0.24-rc.18"},deps=liteDependencies;var UmdKeys=(e=>(e.HLS="hls",e.HLSJS="hlsjs",e.FLV="flv",e.XGVideo="XGVideo",e.HLSEncrypt="hlsEncrypt",e.DASH="dash",e.MP4Encrypt="mp4Encrypt",e.DanmuJS="danmujs",e.DanmuMask="danmuMask",e.StreamProbe="streamprobe",e.VeStrategy="vestrategy",e.VeStrategyH265="vestrategy_h265",e.VeStrategyPreload="vestrategy_preload",e.VeStrategyAdaptRange="vestrategy_adapt_range",e.DashAbralgo="DashAbralgo",e.Preloader="preloader",e.HLSjsPro="hlsjsPro",e))(UmdKeys||{});const UMDS={[UmdKeys.HLS]:{name:"HlsPlayer",pluginName:"hls",packageName:"xgplayer-hls",devPath:`xgplayer-hls@${deps["xgplayer-hls"]}/dist/index.min.js`},[UmdKeys.FLV]:{name:"FlvPlayer",pluginName:"flv",packageName:"xgplayer-flv",devPath:`xgplayer-flv@${deps["xgplayer-flv"]}/dist/index.min.js`},[UmdKeys.XGVideo]:{name:"XGVideo",packageName:"@byted/xgplayer-xgvideo",devPath:`@byted/xgplayer-xgvideo@${deps["@byted/xgplayer-xgvideo"]}/dist/index.min.js`},[UmdKeys.HLSEncrypt]:{name:"EncryptHlsPlugin",pluginName:"EncryptHlsPlugin",packageName:"@byted/xgplayer-encrypt-hls",devPath:`@byted/xgplayer-encrypt-hls@${deps["@byted/xgplayer-encrypt-hls"]}/dist/index.min.js`},[UmdKeys.DASH]:{name:"DashPlugin",pluginName:"DASHPlugin",packageName:"@byted/xgplayer-encrypt",devPath:`@byted/xgplayer-encrypt@${deps["@byted/xgplayer-encrypt"]}/dist/index.min.js`},[UmdKeys.MP4Encrypt]:{name:"Mp4EncryptPlayer",pluginName:"Mp4EncryptPlayer",packageName:"@byted/xgplayer-encrypt-mp4",devPath:`@byted/xgplayer-encrypt-mp4@${deps["@byted/xgplayer-encrypt-mp4"]}/dist/index.min.js`},[UmdKeys.StreamProbe]:{name:"StreamProbe",pluginName:"streamprobe",packageName:"@byted/streamprobe",devPath:`@byted/streamprobe@${deps["@byted/streamprobe"]}/dist/index.min.js`},[UmdKeys.VeStrategyH265]:{name:"__VESTRATEGY_STRATEGY_H265__",packageName:"@byted/volcengine-vestrategy-h265",devPath:`@byted/volcengine-vestrategy-h265@${deps["@byted/volcengine-vestrategy-h265"]}/umd/vestrategy.strategy.h265.production.js`},[UmdKeys.VeStrategy]:{name:"VeStrategy",packageName:"@byted/volcengine-vestrategy",devPath:`@byted/volcengine-vestrategy@${deps["@byted/volcengine-vestrategy"]}/umd/vestrategy.production.js`},[UmdKeys.VeStrategyPreload]:{name:"__VESTRATEGY_STRATEGY_PRELOAD__",packageName:"@byted/volcengine-vestrategy-preload",devPath:`@byted/volcengine-vestrategy-preload@${deps["@byted/volcengine-vestrategy-preload"]}/umd/vestrategy.strategy.preload.production.js`},[UmdKeys.VeStrategyAdaptRange]:{name:"__VESTRATEGY_STRATEGY_ADAPT_RANGE__",packageName:"@byted/volcengine-vestrategy-adapt-range",devPath:`@byted/volcengine-vestrategy-adapt-range@${deps["@byted/volcengine-vestrategy-adapt-range"]}/umd/vestrategy.strategy.adapt-range.production.js`},[UmdKeys.DashAbralgo]:{name:"DashAbralgo",packageName:"@byted/xgplayer-vod-abralgo",devPath:`@byted/xgplayer-vod-abralgo@${deps["@byted/xgplayer-vod-abralgo"]}/dist/index.min.js`},[UmdKeys.Preloader]:{name:"XGPlayerPreload",packageName:"@byted/xgplayer-vod-preload",devPath:`@byted/xgplayer-vod-preload@${deps["@byted/xgplayer-vod-preload"]}/dist/index.min.js`}},strategyUmdKeys={h265:UmdKeys.VeStrategyH265,preload:UmdKeys.VeStrategyPreload,adaptRange:UmdKeys.VeStrategyAdaptRange},mediaDependencies={setImportedPlugins(e,t){e.importedPlugins=t},prepareStrategyLoad(e){"undefined"!=typeof window&&window.VeStrategy&&(window.__VESTRATEGY_BASE__||(window.__VESTRATEGY_BASE__=window.VeStrategy),window.__VESTRATEGY_STRATEGY_PRELOAD__||e.clearPluginCache(UmdKeys.VeStrategyPreload))},loadVeStrategy(e){return __async(this,null,(function*(){return e.loadPlugins(UmdKeys.VeStrategy)}))},loadStrategy(e,t){return __async(this,null,(function*(){return e.loadPlugins(strategyUmdKeys[t])}))},loadPreloader(e){return __async(this,null,(function*(){return e.loadPlugins(UmdKeys.Preloader)}))},loadMp4Encrypt(e){return __async(this,null,(function*(){return e.loadPlugins(UmdKeys.MP4Encrypt)}))},loadHlsjsPro(e){return __async(this,null,(function*(){return e.loadPlugins(UmdKeys.HLSjsPro)}))}};let canShowABRWarn$2=!1;class Mp4Adapter extends AbstractBaseAdapter{constructor(e){super(e)}applyAbrPluginConfig(e,t){e.Mp4EncryptPlayer=__spreadProps(__spreadValues({},e.Mp4EncryptPlayer),{autoBitrateOpts:t})}prepareAbrModule(e,t){return __async(this,null,(function*(){var i;const r=null==(i=e.configs)?void 0:i.autoBitrateOpts;e.isOpenABR()&&!(null==r?void 0:r.module)&&e.updateConfigs({autoBitrateOpts:__spreadProps(__spreadValues({},r),{module:yield t.loadPlugins(UmdKeys.DashAbralgo)})})}))}needAbrAutoDefinition(){return!1}setAbrDefaultDefiWithAuto(){return!1}generatePlaylistFromServer(e){canShowABRWarn$2=!0;const{playList:t=[]}=e||{};return[...t||[]]}useNativeAbr(){return!1}canOpenAbr(e){var t;if(this.playerData.isVidPlay()&&e){const{playList:t=[]}=e;if(!(t.length>1))return canShowABRWarn$2&&VE_DEBUG.warn("The obtained media information does not meet the ABR requirements. Please check whether the parameters for generating playAuthToken are correct and whether there are more than 1 video."),canShowABRWarn$2=!1,!1}return!((null==(t=sniffer.os)?void 0:t.isIos)&&!isMMSSupported())}canAdaptRangeEnable(){var e;return!((null==(e=sniffer.os)?void 0:e.isIos)&&!isMMSSupported())}adaptRangeDefaultOptions(){return{maxTargetCacheDur:30,minTargetCacheDur:12,rangeMaxDuration:15,rangeMinDuration:5,cacheSafeFactor:2,estPTcontrol:!0,estPlayTime:12,minBandwidth:1e6,minDangerThreshold:3,rangeControl:!0,rangeMinSize:409600,safeFactor:.1,targetCacheControl:!0}}applyAdaptRangePluginConfig(e,t){e.Mp4EncryptPlayer=__spreadProps(__spreadValues({},e.Mp4EncryptPlayer),{adaptRange:t})}applyAdaptRangeStrategy(e,t){var i,r;e.Mp4EncryptPlayer=__spreadProps(__spreadValues({},e.Mp4EncryptPlayer),{adaptRange:__spreadValues(__spreadValues(__spreadValues({},this.adaptRangeDefaultOptions()),null!=(r=null==(i=e.Mp4EncryptPlayer)?void 0:i.adaptRange)?r:{}),t)})}getPlugins(e){return __async(this,null,(function*(){var t;const{configs:i,openSoftDecoding:r,isVidEncrypt:n,drmType:o}=this.playerData,a=[EDRMTYPE.PRIVATE_ENCRYPT_UPGRADE,EDRMTYPE.PRIVATE_ENCRYPT].includes(o);if(i.enableMp4MSE||n||(null==(t=null==i?void 0:i.autoBitrateOpts)?void 0:t.enable)||r||a){return[yield mediaDependencies.loadMp4Encrypt(e)]}return[]}))}setPluginConfigInVid(e,t){var i;const{vid:r,defaultDefinitionData:n}=e,{config:o,privateDrmAuthToken:a,sessionId:s,useUnionInfoDRM:l}=t,c=!!n.kid,{autoBitrateOpts:u,Mp4EncryptPlayer:d,enableMp4MSE:h}=this.playerData.configs,p=this.playerData.drmType===EDRMTYPE.PRIVATE_ENCRYPT_UPGRADE;if(c||(null==u?void 0:u.enable)||d||h){const{kid:e,secretKey:t}=n,u=null==(i=this.playerData.configs)?void 0:i.Mp4EncryptPlayer,d="object"==typeof u?u:{};if(c){if(p)this.playerData.options.Mp4EncryptPlayer=__spreadValues({vid:r,kid:e,isEncrypt:!0,rangeMaxDuration:10,keyTokenExpiredDuration:9999999,retryCount:3,useUnionInfoDRM:!0,sessionId:this.playerData.encryptSessionId,drmType:EDRMTYPE.PRIVATE_ENCRYPT_UPGRADE,preferMMS:!0,secretKey:t},d);else if(a&&s){const t=getQueryParams(a),i=parseInt(""+t["X-Expires"]),n=isNaN(i)?30:i;this.playerData.options.Mp4EncryptPlayer=__spreadValues({vid:r,kid:e,isEncrypt:!0,rangeMaxDuration:10,retryCount:3,drmKeyToken:a,useUnionInfoDRM:l,keyTokenExpiredDuration:n,preferMMS:!0,sessionId:s,playDomain:o.playDomain||this.playerData.playDomain},d)}}else this.playerData.options.Mp4EncryptPlayer=__spreadValues({vid:r,retryCount:3,preferMMS:!0},d)}}}let canShowABRWarn$1=!1;class DashAdapter extends AbstractBaseAdapter{applyAbrPluginConfig(e,t){e.DASHPlugin=__spreadProps(__spreadValues({},e.DASHPlugin),{autoBitrateOpts:t})}prepareAbrModule(e,t){return __async(this,null,(function*(){var i;const r=null==(i=e.configs)?void 0:i.autoBitrateOpts;e.isOpenABR()&&!(null==r?void 0:r.module)&&e.updateConfigs({autoBitrateOpts:__spreadProps(__spreadValues({},r),{module:yield t.loadPlugins(UmdKeys.DashAbralgo)})})}))}needAbrAutoDefinition(){return!1}setAbrDefaultDefiWithAuto(){return!1}useNativeAbr(){return!1}canOpenAbr(e){if(this.playerData.isVidPlay()&&e){const{enableAdaptive:t,adaptiveBitrateStreamingInfo:i,playList:r=[]}=e;if(!(r.length>2&&t&&i))return canShowABRWarn$1&&VE_DEBUG.warn("The obtained media information does not meet the ABR requirements. Please check whether the parameters for generating playAuthToken are correct and whether the video contains ABR transcoding products."),canShowABRWarn$1=!1,!1}return!0}canAdaptRangeEnable(){var e;return!(null==(e=sniffer.os)?void 0:e.isIos)}generatePlaylistFromServer(e){canShowABRWarn$1=!0;const{playList:t=[]}=e||{};return t.filter((e=>e.FileType===VideoFileTypes.VIDEO))}adaptRangeDefaultOptions(){return{maxTargetCacheDur:60,minTargetCacheDur:50,rangeMaxDuration:15,rangeMinDuration:5,cacheSafeFactor:2,estPTcontrol:!0,estPlayTime:12,minBandwidth:1e6,minDangerThreshold:3,rangeControl:!0,rangeMinSize:409600,safeFactor:.1,targetCacheControl:!0}}applyAdaptRangePluginConfig(e,t){var i;e.DASHPlugin=__spreadProps(__spreadValues({},null!=(i=e.DASHPlugin)?i:{}),{adaptRange:t})}applyAdaptRangeStrategy(e,t){var i,r;e.DASHPlugin=__spreadProps(__spreadValues({},e.DASHPlugin),{adaptRange:__spreadValues(__spreadValues(__spreadValues({},this.adaptRangeDefaultOptions()),null!=(r=null==(i=e.DASHPlugin)?void 0:i.adaptRange)?r:{}),t)})}getPlugins(e){return __async(this,null,(function*(){var t,i;const r=yield e.loadPlugins(UmdKeys.DASH);return(null==(i=null==(t=null==r?void 0:r.encryptUtils)?void 0:t.isSupported)?void 0:i.call(t))?[r]:(VE_DEBUG.warn("current browser is not supported DASHPlugin"),[])}))}setPluginConfigInVid(e,t){var i;const{vid:r,playList:n=[],dashOpts:o,defaultDefinitionData:a}=e||{},{config:s,privateDrmAuthToken:l,sessionId:c,useUnionInfoDRM:u}=t,d=__spreadValues({},(null==(i=this.playerData.configs)?void 0:i.DASHPlugin)||{}),{kid:h,secretKey:p}=a,f=this.playerData.drmType===EDRMTYPE.PRIVATE_ENCRYPT_UPGRADE,g=o.Data.PlayInfoList.reduce(((e,t)=>{const i=t.Definition||t.Quality;let r="";const o=n.find((e=>e.Definition===i||e.Quality===i));return o&&(r=o.definition),e[i]=r,e}),{});if(this.playerData.dashOpts=o,f)this.playerData.options.DASHPlugin=__spreadValues({playInfoType:"TOP",useEME:!0,keyTokenExpiredDuration:9999999,useUnionInfoDRM:!0,defaultFormat:"dash",replayReset:!1,disableBufferBreakCheck:!1,waitingTimeOut:5e3,vid:r,definitionText:g,defaultDefinition:a.definition,kid:h,dashOpts:o,drmType:EDRMTYPE.PRIVATE_ENCRYPT_UPGRADE,secretKey:p,sessionId:this.playerData.encryptSessionId,playDomain:s.playDomain||this.playerData.playDomain},d);else if(l&&c&&this.playerData.drmType!==EDRMTYPE.DRM_ENCRYPT){const e=getQueryParams(l),t=parseInt(""+e["X-Expires"]),i=isNaN(t)?30:t;this.playerData.options.DASHPlugin=__spreadValues({playInfoType:"TOP",vid:r,dashOpts:o,defaultFormat:"dash",definitionText:g,defaultDefinition:a.definition,useUnionInfoDRM:u,kid:h,keyTokenExpiredDuration:i,sessionId:c,drmKeyToken:l,playDomain:s.playDomain||this.playerData.playDomain,replayReset:!1,disableBufferBreakCheck:!1,waitingTimeOut:5e3},d)}else this.playerData.options.DASHPlugin=__spreadValues({vid:r,dashOpts:o,playInfoType:"TOP",defaultFormat:"dash",definitionText:g,defaultDefinition:a.definition,replayReset:!1,disableBufferBreakCheck:!1,waitingTimeOut:5e3},d)}}var 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$6(e))return NAN;if(isObject$g(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=isObject$g(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=baseTrim(e);var i=reIsBinary.test(e);return i||reIsOctal.test(e)?freeParseInt(e.slice(2),i?2:8):reIsBadHex.test(e)?NAN:+e}var now$1=function(){return root$1.Date.now()};const now$2=now$1;var FUNC_ERROR_TEXT$1="Expected a function",nativeMax=Math.max,nativeMin=Math.min;function debounce(e,t,i){var r,n,o,a,s,l,c=0,u=!1,d=!1,h=!0;if("function"!=typeof e)throw new TypeError(FUNC_ERROR_TEXT$1);function p(t){var i=r,o=n;return r=n=void 0,c=t,a=e.apply(o,i)}function f(e){var i=e-l;return void 0===l||i>=t||i<0||d&&e-c>=o}function g(){var e=now$2();if(f(e))return y(e);s=setTimeout(g,function(e){var i=t-(e-l);return d?nativeMin(i,o-(e-c)):i}(e))}function y(e){return s=void 0,h&&r?p(e):(r=n=void 0,a)}function _(){var e=now$2(),i=f(e);if(r=arguments,n=this,l=e,i){if(void 0===s)return function(e){return c=e,s=setTimeout(g,t),u?p(e):a}(l);if(d)return clearTimeout(s),s=setTimeout(g,t),p(l)}return void 0===s&&(s=setTimeout(g,t)),a}return t=toNumber(t)||0,isObject$g(i)&&(u=!!i.leading,o=(d="maxWait"in i)?nativeMax(toNumber(i.maxWait)||0,t):o,h="trailing"in i?!!i.trailing:h),_.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=l=n=s=void 0},_.flush=function(){return void 0===s?a:y(now$2())},_}var FUNC_ERROR_TEXT="Expected a function";function throttle(e,t,i){var r=!0,n=!0;if("function"!=typeof e)throw new TypeError(FUNC_ERROR_TEXT);return isObject$g(i)&&(r="leading"in i?!!i.leading:r,n="trailing"in i?!!i.trailing:n),debounce(e,t,{leading:r,maxWait:t,trailing:n})}const _UMDLoader=class{static registerModules(e){for(const[t,i]of Object.entries(e)){if(!Object.values(UmdKeys).includes(t))throw new Error(`Unknown UMD key: ${t}`);if(void 0===i)throw new Error(`Registered UMD module ${t} must not be undefined`)}Object.assign(_UMDLoader.registeredModules,e)}clearPluginCache(e){const t=`${this.pluginPublicPath}_${e}_load`;delete _UMDLoader.jsLoadMap[t],delete _UMDLoader.jsLoadPromiseMap[t]}constructor(){this.umdMap=UMDS,this.backupUmdUrlMap={},this.region={}.__DEFAULT_REGION__,this.customPluginPublicPath=""}get pluginPublicPath(){var e;return this.customPluginPublicPath||(null==(e=getCurUserRegionConfig(this.userRegion,this.region))?void 0:e.__UMD_PRE_PATH__)}updateBackupMap(e){this.backupUmdUrlMap=e}loadExtraCdn(e,t=!0){return new Promise(((i,r)=>{const n=t?document.createElement("script"):document.createElement("link");t?n.src=e:(n.rel="stylesheet",n.type="text/css",n.href=e),n.onerror=()=>{r(`url: ${e}`)},n.onload=n.onreadystatechange=function(){(null==this?void 0:this.readyState)&&"loaded"!==(null==this?void 0:this.readyState)&&"complete"!==(null==this?void 0:this.readyState)||(n.onload=n.onreadystatechange=null,i())},document.body.appendChild(n)}))}loadPlugins(e,t){return new Promise((i=>{var r;const n=`${this.pluginPublicPath}_${e}_load`;if(Object.prototype.hasOwnProperty.call(_UMDLoader.registeredModules,e))return this.triggerSuccessCallback(t),i(_UMDLoader.registeredModules[e]);if(Reflect.get(_UMDLoader.jsLoadMap,n))return i(_UMDLoader.jsLoadMap[n]);const o=this.umdMap[e];if((null==(r=this.importedPlugins)?void 0:r.length)>0&&o.pluginName){const e=this.importedPlugins.find((e=>e.pluginName===o.pluginName));if(e)return i(e)}if(!o)return VE_DEBUG.error(`${e} umd info not exit`),this.handleLoadError(e,void 0,i);const{name:a,devPath:s}=o,l=a?get$1(window,a):null;if(l)return _UMDLoader.jsLoadMap[n]=l,this.triggerSuccessCallback(t),i(l);const c=`${this.pluginPublicPath}/${e+".js"}`;let u=_UMDLoader.jsLoadPromiseMap[n];VE_DEBUG.log(`umdLoader cache hit ${n}=${!!u}`),u||(u=retry((()=>this.loadExtraCdn(c,!0)),2),_UMDLoader.jsLoadPromiseMap[n]=u),u.then((()=>this.handleLoadSuccess(n,a,t,i))).catch((r=>this.handleLoadCatch(r,e,n,a,t,i)))}))}handleLoadSuccess(e,t,i,r){const n=t?get$1(window,t):null;_UMDLoader.jsLoadMap[e]=null==n||n,this.triggerSuccessCallback(i),null==r||r(n)}handleLoadError(e,t,i){this.failCallback&&"function"==typeof this.failCallback&&this.failCallback(e,t),i(null)}handleLoadCatch(e,t,i,r,n,o){const a=this.backupUmdUrlMap[t];a?this.loadBackupUrl(a,t,i,r,n,o):(VE_DEBUG.error(`load ${t} error, ${e}`),this.handleLoadError(t,e,o))}loadBackupUrl(e,t,i,r,n,o){if(!isUrl(e))return VE_DEBUG.error(`umdMap.${t} isn't a valid url`),this.handleLoadError(t,void 0,o);this.loadExtraCdn(e).then((()=>this.handleLoadSuccess(i,r,n,o))).catch((e=>{VE_DEBUG.error(`load ${t} error, ${e}`),this.handleLoadError(t,void 0,o)}))}triggerSuccessCallback(e){e&&e()}};let UMDLoader=_UMDLoader;UMDLoader.jsLoadMap={},UMDLoader.jsLoadPromiseMap={},UMDLoader.registeredModules={};const defaultUmdLoader=new UMDLoader;var StrategyNames=(e=>(e.H265="h265",e.PRELOAD="preload",e.ADAPT_RANGE="adaptRange",e))(StrategyNames||{});function mergeStrategyConfig(e){if(!e||"boolean"==typeof e)return{config:{}};const t=e,{Strategy:i,disabled:r,config:n}=t,o=__objRest(t,["Strategy","disabled","config"]);return __spreadProps(__spreadValues({},e),{config:__spreadValues(__spreadValues({},o),null!=n?n:{})})}var PreloaderStatus=(e=>(e[e.DISABLED=0]="DISABLED",e[e.INITIALIZING=1]="INITIALIZING",e[e.READY=2]="READY",e[e.FAILED=3]="FAILED",e))(PreloaderStatus||{});class VeStrategyPreloadWrapper{constructor(e){this.strategyKey=StrategyNames.PRELOAD,this.preloaderStatus=1,this.preloadCacheConfig={},this.preloadCacheList=[],this._strategyManager=e,this.sdkUmdLoader=new UMDLoader}init(e){return __async(this,null,(function*(){var t,i,r,n,o,a,s,l,c;const u=null==(t=null==e?void 0:e.strategies)?void 0:t[StrategyNames.PRELOAD],d="boolean"==typeof u;if(!u||!d&&(null==u?void 0:u.disabled))return this.preloaderStatus=0,!1;const h=null==(i=mergeStrategyConfig(u))?void 0:i.config,p=null==(a=null==(o=null==(n=null==(r=this._strategyManager.config)?void 0:r.strategies)?void 0:n[StrategyNames.PRELOAD])?void 0:o.Strategy)?void 0:a.preloader;if(!(null==p?void 0:p.register))return this.preloaderStatus=3,!1;p.init((()=>__async(this,null,(function*(){VE_DEBUG.log("preloader init");const[e,t]=yield Promise.all([mediaDependencies.loadPreloader(this.sdkUmdLoader),d||"hls"!==(null==u?void 0:u.format)?mediaDependencies.loadMp4Encrypt(this.sdkUmdLoader):mediaDependencies.loadHlsjsPro(this.sdkUmdLoader)]);if(!(null==e?void 0:e.PreloaderManager)||!t)return this.preloaderStatus=3,void VE_DEBUG.error("preloader init error");const i=(null==t?void 0:t.Mp4Preloader)||(null==t?void 0:t.HlsPreloader);return __spreadProps(__spreadValues({},h),{PreloaderModule:e.PreloaderManager,loaders:[i].filter((e=>!!e)),playPlugins:[t]})}))));const f=yield p.prepare();if(!f)return this.preloaderStatus=3,void VE_DEBUG.warn("preloader prepare fail",f);this.preloaderStatus=2,null==(c=null==(l=null==(s=p.inst)?void 0:s.call(p))?void 0:l.on)||c.call(l,"prf_data_size",(e=>{var t,i;null==(i=null==(t=this._strategyManager.tea)?void 0:t.event)||i.call(t,"veplayer_preload_prf_data_size",__spreadValues({},e))})),this.preloader=p,this.initPreloaderConfig()}))}addPreloadList(e){if(1===this.preloaderStatus)return this.preloadCacheList=this.preloadCacheList.concat(null!=e?e:[]),void VE_DEBUG.log("preloader add preload cache list",e);2!==this.preloaderStatus?this.preloadCacheList=[]:this.preloader.addPreloadList(e)}setPreloadList(e){return __async(this,null,(function*(){if(1===this.preloaderStatus)return this.preloadCacheList=null!=e?e:[],void VE_DEBUG.log("preloader set preload cache list",e);2!==this.preloaderStatus?this.preloadCacheList=[]:this.preloader.setPreloadList(null!=e?e:[])}))}setPreloadScene(e,t){if([1,0].includes(e))return 1===this.preloaderStatus?(this.preloadCacheScene!==e&&(this.preloadCacheList=[],VE_DEBUG.log("preloader reset preload cache list")),this.preloadCacheScene=e,this.preloadCacheConfig=__spreadValues(__spreadValues({},this.preloadCacheConfig),null!=t?t:{}),void VE_DEBUG.log("preloader set preload cache config",this.preloadCacheScene,this.preloadCacheConfig)):void(2!==this.preloaderStatus||this.preloader.setPreloadScene(e,t))}initPreloaderConfig(){var e,t,i,r;"undefined"!==this.preloadCacheScene&&this.preloader.setPreloadScene(this.preloadCacheScene,null!=(e=this.preloadCacheConfig)?e:{}),(null==(t=this.preloadCacheList)?void 0:t.length)&&(this.preloader.setPreloadList(this.preloadCacheList),null==(r=(i=this.preloader).checkPreloadData)||r.call(i),this.preloadCacheList=[])}}class VeStrategyH265Wrapper{constructor(e){this.strategyKey=StrategyNames.H265,this._strategyManager=e}init(){return __async(this,null,(function*(){return!0}))}isHevcRecommended(){var e,t;return!!(null==(t=null==(e=this._strategyManager.getStrategyRecommendations().result)?void 0:e[StrategyNames.H265])?void 0:t.enableH265Hardware)}}class VeStrategyManager{constructor(){var e,t;this.teaId=null==(e=getCurUserRegionConfig())?void 0:e.__LOG_TEA_ID__,this.teaChannel=null==(t=getCurUserRegionConfig())?void 0:t.__LOG_CHANNEL__,this.status=0,this.initUmdLoader()}get preloader(){var e;return null==(e=this.preloadWrapper)?void 0:e.preloader}get preloaderStatus(){var e,t;return null!=(t=null==(e=this.preloadWrapper)?void 0:e.preloaderStatus)?t:PreloaderStatus.INITIALIZING}initUmdLoader(){this.sdkUmdLoader=new UMDLoader}fetchWebId(){return __async(this,null,(function*(){var e,t;return(null==(e=this.config)?void 0:e.deviceId)?Promise.resolve(null==(t=this.config)?void 0:t.deviceId):new Promise((e=>{var t;return(null==(t=this.tea)?void 0:t.getToken)?this.tea.getToken((t=>e(null==t?void 0:t.web_id))):e("default_web_id")})).then((e=>(this.config=__spreadProps(__spreadValues({},this.config),{deviceId:e}),this.webId)))}))}initTea(e){var t,i;const r=this.collector;r&&(e&&(this.teaId=null==(t=getCurUserRegionConfig(e))?void 0:t.__LOG_TEA_ID__,this.teaChannel=null==(i=getCurUserRegionConfig(e))?void 0:i.__LOG_CHANNEL__),this.tea=new r(`${this.teaId}_vestrategy_tracker`),this.tea.init({app_id:this.teaId,channel:this.teaChannel}),this.tea.start())}fetchVeStrategy(){return __async(this,null,(function*(){if(this.config.Module)return;const e=yield mediaDependencies.loadVeStrategy(this.sdkUmdLoader);e&&(this.config=__spreadProps(__spreadValues({},this.config),{Module:e}))}))}fetchStrategies(){return __async(this,null,(function*(){const e={};return mediaDependencies.prepareStrategyLoad(this.sdkUmdLoader),yield Promise.all(Object.keys(this.config.strategies).map((t=>__async(this,null,(function*(){if(!this.config.strategies[t])return;!0===this.config.strategies[t]&&(this.config.strategies[t]={});const{Strategy:i}=this.config.strategies[t];if(i)e[t]=this.config.strategies[t];else{const i=t;if(!["h265","preload","adaptRange"].includes(i))return;const r=yield mediaDependencies.loadStrategy(this.sdkUmdLoader,i);r&&(e[t]=__spreadProps(__spreadValues({},this.config.strategies[t]),{Strategy:r}))}e[t]=mergeStrategyConfig(e[t])}))))),this.config.strategies=e,e}))}initOnce(e){return __async(this,null,(function*(){if(!e||!e.appId)return;this.collector=getCollector(),this.initTea(e.region),this.status=1,this.config=e;try{yield Promise.all([this.fetchWebId(),this.fetchVeStrategy()]),yield this.fetchStrategies()}catch(e){}const{appId:t,deviceId:i,Module:r}=this.config;if(t&&i&&r){this.Module=r;const e=this.collector;yield r.bootstrap(__spreadProps(__spreadValues(__spreadProps(__spreadValues({},this.config),{strategies:this.config.strategies}),e?{tracker:{Collector:e,enableABVersion:!1}}:{}),{log:{logger:VE_DEBUG}})),this.status=2,this.preloadWrapper=new VeStrategyPreloadWrapper(this),this.h265Wrapper=new VeStrategyH265Wrapper(this)}else this.status=3;return this.isReady()}))}init(e){return __async(this,null,(function*(){var t;return this.initPromise||((null==(t=null==e?void 0:e.plugins)?void 0:t.length)&&mediaDependencies.setImportedPlugins(this.sdkUmdLoader,e.plugins),this.initPromise=this.initOnce(e).then((t=>__async(this,null,(function*(){var i,r;return t&&(yield Promise.all([null==(i=this.preloadWrapper)?void 0:i.init(e),null==(r=this.h265Wrapper)?void 0:r.init()])),t}))))),this.initPromise}))}addPreloadList(e){this.preloadWrapper&&this.preloadWrapper.addPreloadList(e)}setPreloadList(e){return __async(this,null,(function*(){if(this.preloadWrapper)return this.preloadWrapper.setPreloadList(e)}))}setPreloadScene(e,t){this.preloadWrapper&&this.preloadWrapper.setPreloadScene(e,t)}prepare(){return this.initPromise||Promise.resolve(this.isReady())}getDeviceId(){var e;return null==(e=this.config)?void 0:e.deviceId}isReady(){return 2===this.status}getStrategyRecommendations(e=void 0,t=void 0){if(!this.isReady())return{plugins:[],pluginConfiguration:{}};const i=this.config.Module.rec(e,t)||{};return VE_DEBUG.log("strategy recommendations:",i),i}getStrategyRecommendationsAsync(e=void 0,t=void 0){return __async(this,null,(function*(){if(!this.isReady())return{plugins:[],pluginConfiguration:{}};const i=yield this.config.Module.recAsync(e,t);return VE_DEBUG.log("strategy recommendations:",i),i}))}isHevcRecommended(){var e,t;return this.h265Wrapper?this.h265Wrapper.isHevcRecommended():!!(null==(t=null==(e=this.getStrategyRecommendations().result)?void 0:e[StrategyNames.H265])?void 0:t.enableH265Hardware)}}const VeStrategy=new VeStrategyManager;let canShowABRWarn=!1;class HlsAdapter extends AbstractBaseAdapter{constructor(e){super(e)}applyAbrPluginConfig(e,t){var i;e.EncryptHlsPlugin=__spreadProps(__spreadValues({},e.EncryptHlsPlugin),{autoBitrateOpts:t,maxBufferLength:(null==(i=e.EncryptHlsPlugin)?void 0:i.maxBufferLength)||40})}prepareAbrModule(e,t){return __async(this,null,(function*(){var i;const r=null==(i=e.configs)?void 0:i.autoBitrateOpts;!e.isOpenABR()||(null==r?void 0:r.module)||this.useNativeAbr()||e.updateConfigs({autoBitrateOpts:__spreadProps(__spreadValues({},r),{module:yield t.loadPlugins(UmdKeys.DashAbralgo)})})}))}needAbrAutoDefinition(){return!0}setAbrDefaultDefiWithAuto(){return!this.useNativeAbr()}generatePlaylistFromServer(e,t){var i,r,n;canShowABRWarn=!0;const{vid:o,playList:a=[],enableAdaptive:s,adaptiveBitrateStreamingInfo:l}=e||{};if(t&&(null==l?void 0:l.MainPlayUrl))return[{vid:o,url:null==l?void 0:l.MainPlayUrl,_mainURL:l.MainPlayUrl,_backupURL:l.BackupPlayUrl,streamType:l.AbrFormat,backupUrl:l.BackupPlayUrl,backUrlList:[l.BackupPlayUrl],isMasterM3u8:!0}];const c=[...a||[]];if(this.useNativeAbr()&&(null==(n=null==(r=null==(i=this.playerData)?void 0:i.configs)?void 0:r.autoBitrateOpts)?void 0:n.enable)&&s&&l&&c.length){const e={url:l.MainPlayUrl,definition:"auto",streamType:"hls",format:"hls",backupUrl:l.BackupPlayUrl,backUrlList:[l.BackupPlayUrl],vid:o};c.push(e)}return c}useNativeAbr(){return sniffer.os.isIos||"safari"===sniffer.browser&&this.playerData.drmType===EDRMTYPE.DRM_ENCRYPT}canOpenAbr(e){if(this.playerData.isVidPlay()&&e){const{enableAdaptive:t,adaptiveBitrateStreamingInfo:i,playList:r=[]}=e;if(!(r.length>1&&t&&i))return canShowABRWarn&&VE_DEBUG.warn("The obtained media information does not meet the ABR requirements. Please check whether the parameters for generating playAuthToken are correct and whether the video contains ABR transcoding products."),canShowABRWarn=!1,!1}return!0}canAdaptRangeEnable(){return!1}adaptRangeDefaultOptions(){}applyAdaptRangePluginConfig(e,t){}applyAdaptRangeStrategy(e,t){}getPlugins(e){return __async(this,null,(function*(){var t,i,r;if(null==(i=null==(t=VeStrategy.config)?void 0:t.strategies)?void 0:i[StrategyNames.PRELOAD]){return[yield e.loadPlugins(UmdKeys.HLSjsPro)]}const{configs:n,options:o,useHlsPluginForSafari:a,enableHlsJs:s,isVidEncrypt:l,isLive:c,openSoftDecoding:u,isMobile:d,drmType:h}=this.playerData,p=h===EDRMTYPE.DRM_ENCRYPT,f=[EDRMTYPE.PRIVATE_ENCRYPT_UPGRADE,EDRMTYPE.PRIVATE_ENCRYPT].includes(h),g=getPluginConfig(n,"EncryptHlsPlugin");if(!!(null==g?void 0:g.keyToken)||l&&!p||f||this.playerData.isOpenABR()&&!(null==(r=null==this?void 0:this.useNativeAbr)?void 0:r.call(this))){return[yield e.loadPlugins(UmdKeys.HLSEncrypt)]}{const t=getPluginConfig(o,"Subtitle"),i=c&&t,r=(isMSESupport2()||window.WebAssembly)&&u,l=n.enableHlsMSE,h=n.enableMobileHlsPlugin&&(sniffer.os.isAndroid&&isMSESupport2()||sniffer.os.isIos&&isMMSSupported()),f=p&&sniffer.os.isAndroid,g=p&&isSafari,y=d&&!canPlayHLSByNative();if(d&&(r||i||l||h||f||y)||!(d||isSafari&&!a||g)){return[yield e.loadPlugins(s?UmdKeys.HLSjsPro:UmdKeys.HLS)]}}}))}setPluginConfigInVid(e,t){var i;const{vid:r,defaultDefinitionData:n}=e,{config:o,privateDrmAuthToken:a,sessionId:s,useUnionInfoDRM:l}=t,{playDomain:c,keyToken:u,getKeyType:d}=o,h=!!n.kid,p=this.playerData.drmType===EDRMTYPE.DRM_ENCRYPT,f=this.playerData.drmType===EDRMTYPE.PRIVATE_ENCRYPT_UPGRADE;if(h&&!p){const e=null==(i=this.playerData.configs)?void 0:i.EncryptHlsPlugin,t="object"==typeof e?e:{},{kid:o,secretKey:h}=n;if(u)this.playerData.options.EncryptHlsPlugin=__spreadValues({keyToken:u,playDomain:c||this.playerData.playDomain,getKeyType:d||"TOP",preferMMS:!0,preferMMSStreaming:!0},t);else if(f)this.playerData.options.EncryptHlsPlugin=__spreadValues({vid:r,kid:o,useUnionInfoDRM:!0,sessionId:this.playerData.encryptSessionId,drmType:EDRMTYPE.PRIVATE_ENCRYPT_UPGRADE,keyTokenExpiredDuration:9999999,secretKey:h,preferMMS:!0,preferMMSStreaming:!0},t);else if(a&&s){const e=getQueryParams(a),i=parseInt(""+e["X-Expires"]),n=isNaN(i)?30:i;this.playerData.options.EncryptHlsPlugin=__spreadValues({vid:r,kid:o,keyTokenExpiredDuration:n,drmKeyToken:a,useUnionInfoDRM:l,sessionId:s,playDomain:c||this.playerData.playDomain,preferMMS:!0,preferMMSStreaming:!0},t)}}}}class DefaultAdapter extends AbstractBaseAdapter{applyAbrPluginConfig(e,t){}needAbrAutoDefinition(){return!1}prepareAbrModule(e,t){}setAbrDefaultDefiWithAuto(){return!1}generatePlaylistFromServer(e,...t){const{playList:i=[]}=e||{};return[...i||[]]}useNativeAbr(){return!1}canOpenAbr(){return!1}canAdaptRangeEnable(){return!1}adaptRangeDefaultOptions(){}applyAdaptRangePluginConfig(e,t){}applyAdaptRangeStrategy(e,t){}getPlugins(){return Promise.resolve([])}setPluginConfigInVid(){}}function createAdapter(e,t){const i=__spreadProps(__spreadValues({},t),{streamType:e});switch(null==e?void 0:e.toLowerCase()){case"mp4":case"m4a":return new Mp4Adapter(i);case"dash":return new DashAdapter(i);case"hls":return new HlsAdapter(i);default:return VE_DEBUG.log(`no adapter match ${e}, use others adapter by default`),new DefaultAdapter(i)}}var LicenseEdition=(e=>(e.EDITION_STANDARD="standard_edition",e.EDITION_PREMIUM="premium_edition",e.EDITION_NONE="none_edition",e))(LicenseEdition||{}),SDKType=(e=>(e.SDK_VOD_PLAY="web_vod_play",e.SDK_LIVE_PULL="web_live_pull",e))(SDKType||{}),LicenseFeature=(e=>(e.H265="h265",e.PRELOAD="preload",e.ADAPT_RANGE="adaptRange",e.ABR="abr",e))(LicenseFeature||{}),LicenseStatus=(e=>(e[e.LICENSE_STATUS_INVALID=0]="LICENSE_STATUS_INVALID",e[e.LICENSE_STATUS_OK=1]="LICENSE_STATUS_OK",e[e.LICENSE_STATUS_EXPIRED=2]="LICENSE_STATUS_EXPIRED",e[e.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH=401]="LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH",e))(LicenseStatus||{});const liteLicenseManager={setLicenseConfig:e=>__async(void 0,null,(function*(){})),checkLicense:()=>__async(void 0,null,(function*(){return"premium_edition"})),checkModuleList:()=>__async(void 0,null,(function*(){return Object.values(LicenseFeature)})),checkLicenseStatus:()=>__async(void 0,null,(function*(){return 1})),checkLicenseModuleAuth:(e,t)=>__async(void 0,null,(function*(){return!0})),renderLogo:e=>{}},LicenseManager=liteLicenseManager;class PlayerData{constructor(e,t){var i,r;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:CodecType.UNKNOWN,kid:"",secretKey:"",drmType:void 0},this.strategiesPlugins=[],this.strategiesPluginConfigs={},this.urlCheckData={enableUrlExpireCheck:!1,urlExpireTimestamp:MAX_TIMESTAMP,urlExpireDiff:60,urlCheckExpireInterval:400},this.isAutoBitrateEnable=!1,this.isVidEncrypt=!1,this.drmType=void 0;const n=e,{options:o,type:a,isLive:s,id:l,root:c,plugins:u=[],defaultConfig:d,languages:h,codec:p,isMobile:f=!1,enableH265Degrade:g=!1,onMediaExpired:y,onTokenExpired:_,unionId:m,isMusic:v=!1,sdkPlugins:E=[],useHlsPluginForSafari:T=!0,enableHlsJs:S=!0,enableMenu:P=!1,region:C={}.__DEFAULT_REGION__,userRegion:b,debug:I=!1,licensSupportModuleList:A=Object.values(LicenseFeature),encryptSessionId:O}=n,D=__objRest(n,["options","type","isLive","id","root","plugins","defaultConfig","languages","codec","isMobile","enableH265Degrade","onMediaExpired","onTokenExpired","unionId","isMusic","sdkPlugins","useHlsPluginForSafari","enableHlsJs","enableMenu","region","userRegion","debug","licensSupportModuleList","encryptSessionId"]);this.configs=e,this.sdk=t,I&&(VE_DEBUG.config.debug=3),this.options=Object.assign({},o,D),this.options.poster="string"==typeof this.options.poster?escapeHtml(this.options.poster):this.options.poster,this.options.icons=handleIcons(this.options.icons),this.id=l,this.root=c,this.type=a,this.isLive=!!(null!=s?s:"live"===a),this.defaultConfig=d,this.languageData=this.initI18nData(h),this.isMobile=f||"mobile"===sniffer.device,this.openSoftDecoding=null==(i=this.configs)?void 0:i.useSoftDecoding,this.enableH265Degrade=g,this.codec=p||CodecType.UNKNOWN,this.onMediaExpired=y,this.onTokenExpired=_,null==(r=this.setVodPlayListConfig)||r.call(this,this.configs),this.current=MyProxy$1.observe(this.current),this.plugins=[...u],this.isMusic=v,this.unionId=m,this.sdkPlugins=E,this.useHlsPluginForSafari=T,this.enableHlsJs=S,this.enableMenu=P,P&&(this.options.enableContextmenu=!0,this.options.closeVideoStopPropagation=!0),this.region=C,this.userRegion=b,this.setVodTeaId(),this.playDomainDegrade=!1,this.dashOpts=null,this.encryptSessionId=O,this.initPlayData(this.configs),MyProxy$1.subscribeProperty(this.current,"definition",this.updateCheckExpireData.bind(this))}initPlayData(e){const t=this.initPlaylistAndGetCurrent(e);this.initCurrent(t)}initPlaylistAndGetCurrent(e){var t,i;const{url:r,playList:n=[],streamType:o="",definitionText:a,definitionTextKey:s,urlExpireTimestamp:l,playAuth:c,playAuthId:u}=e,d=e.defaultDefinition||this.configs.defaultDefinition,h=e.codec||CodecType.UNKNOWN;(null==e?void 0:e.autoBitrateOpts)&&this.updateConfigs({autoBitrateOpts:__spreadValues(__spreadValues({},null!=(t=this.configs.autoBitrateOpts)?t:{}),e.autoBitrateOpts)});let p=null;const f=cloneDeep([...n].filter((e=>e.url)).map(((e,t)=>__spreadProps(__spreadValues({},e),{bitrate:e.bitrate||e.Bitrate||1e3*(t+1),secretKey:e.playAuth,kid:e.playAuthId}))));if(r)if(0===f.length){const e=__spreadValues(__spreadProps(__spreadValues({},this.current),{url:r,streamType:o,definitionTextKey:s,codec:h,secretKey:c,kid:u,urlExpireTimestamp:l}),s||a?{definition:a}:{definition:"HD"});this.playList=[e],this.defaultDefinition=e.definition}else{this.playList=f;const e=this.getUrlList({url:r});e.length>0?p=e[0]:VE_DEBUG.warn("default url is not match Playlist")}else this.playList=f;e.drmType&&this.setDrmType(e.drmType);let g=this.getCurrentByDefaultConfig();g?this.defaultDefinition=g.definition:(g=p||(d&&(null==(i=this.getUrlList({definition:d}))?void 0:i[0])||this.playList[0]),this.defaultDefinition=null==g?void 0:g.definition);const y=this.getTargetStreamType(g);if(this.adapter=createAdapter(y,{configs:this.configs,playerData:this}),this.isAutoBitrateEnable=this.checkAutoBitratePlayList(),this.isOpenABR()){const e=this.getABRStreamInfo(y,g);g=e.defaultStream,this.playList=e.playList,this.defaultDefinition=e.defaultDefinition}return this.playList.forEach((e=>{(null==e?void 0:e.streamType)&&(e.vtype=e.streamType.toUpperCase()),(null==e?void 0:e.codec)&&(e.codecType=e.codec)})),g}checkAutoBitratePlayList(){var e,t;return!(sniffer.os.isIos&&this.adapter.needAbrAutoDefinition()&&!(null==(t=null==(e=this.playList)?void 0:e.find((e=>this.isAutoDefinition(null==e?void 0:e.definition))))?void 0:t.url))}getABRStreamInfo(e,t){var i,r,n,o,a;let s=this.defaultDefinition;const l=(null==(r=null==(i=this.playList)?void 0:i.concat)?void 0:r.call(i))||[];let c=t;const u=l.findIndex((e=>this.isAutoDefinition(null==e?void 0:e.definition))),d=-1!==u?l.splice(u,1)[0]:void 0,h={definition:null!=(n=null==d?void 0:d.definition)?n:"auto",bitrate:void 0,definitionTextKey:(null==d?void 0:d.definitionTextKey)||(null==(a=null==(o=this.configs)?void 0:o.autoBitrateOpts)?void 0:a.definitionTextKey)||"DEFINITION_AUTO",url:(null==d?void 0:d.url)||"__auto__",name:"auto",streamType:e||this.configs.streamType};return this.isAutoDefinition(this.configs.defaultDefinition)||(h.bitrate=null==c?void 0:c.bitrate,s=null==c?void 0:c.definition),this.isPlayAutoDefinition()&&(c=h,this.adapter.setAbrDefaultDefiWithAuto()&&(s=h.definition)),l.push(h),{defaultDefinition:s,defaultStream:c,playList:l}}isCurrentH265(){if(this.codec){return this.codec.replace(".","").toLowerCase()===CodecType.H265}return!1}setDrmType(e){this.drmType=e}getCurrentByDefaultConfig(){if(!this.defaultConfig)return;const{type:e,isLive:t,lineId:i="",definition:r=""}=this.defaultConfig;if((null!=t?t:"live"===e)!==this.isLive)return;if(!i&&!r)return VE_DEBUG.warn("默认配置未设置默认线路或默认清晰度"),void(this.isHitDefault=!1);const n=this.getUrlList({lineId:i,definition:r});return n.length>0?(this.isHitDefault=!0,n[0]):(VE_DEBUG.warn("playlist中没有满足默认配置的流"),void(this.isHitDefault=!1))}initCurrent(e){var t,i,r;Object.keys(this.current).forEach((t=>{this.current[t]=null==e?void 0:e[t]}));const n=null==e?void 0:e.codec;this.codec=n&&Object.values(CodecType).includes(n)?n:CodecType.UNKNOWN,(null==(t=this.current)?void 0:t.drmType)&&this.setDrmType(null==(i=this.current)?void 0:i.drmType),this.isVidEncrypt=!!(null==(r=this.current)?void 0:r.kid),this.initCheckExpireData()}initCheckExpireData(){const{enableUrlExpireCheck:e,urlExpireDiff:t,urlCheckExpireInterval:i}=this.configs;merge$1(this.urlCheckData,{enableUrlExpireCheck:e,urlExpireDiff:t,urlCheckExpireInterval:i}),this.updateCheckExpireData()}updateCheckExpireData(){var e;const t=null==(e=this.getCurrentStreams())?void 0:e[0];if(t){const{url:e,urlExpireTimestamp:i}=t;if(!e)return;const r=getIntNumber$1(""+(i||this.configs.urlExpireTimestamp));r?this.urlCheckData.urlExpireTimestamp=r:this.urlCheckData.enableUrlExpireCheck&&(this.urlCheckData.urlExpireTimestamp=MAX_TIMESTAMP,VE_DEBUG.warn("not provide urlExpireTimestamp, url expire check will not work")),VE_DEBUG.log("update urlCheckData to:",this.urlCheckData)}}initI18nData(e){const t=[jp,zhHk],i=e&&Object.entries(e).reduce(((e,[i,r])=>(PLAYER_LANGS.includes(i)?e.push({LANG:"zh"===i?"zh-cn":i,TEXT:r}):t.push({LANG:i,TEXT:r}),e)),[]);return{extraLangList:t,extendLangList:i}}getCurrentUrl(){var e;return null==(e=this.getCurrentStreams()[0])?void 0:e.url}getTargetStreamType(e){var t;return e?e.streamType||this.configs.streamType||getStreamType(e.url):this.configs.streamType||getFormat(null==(t=this.configs)?void 0:t.getVideoByToken)}getCurrentStreamType(){const e=this.getCurrentStreams();if(e.length){const{url:t,streamType:i}=e[0];return i||this.configs.streamType||getStreamType(t)||"mp4"}return this.configs.streamType||"mp4"}getStreamType(){var e;return this.getCurrentStreamType()||getFormat(null==(e=this.configs)?void 0:e.getVideoByToken)}isOpenABR(){var e,t,i,r,n;if(!this.isAutoBitrateEnable||!(null==(t=null==(e=this.configs)?void 0:e.autoBitrateOpts)?void 0:t.enable)||!(null==(i=this.configs)?void 0:i.isLive)&&!(null==(n=null==(r=this.configs)?void 0:r.licensSupportModuleList)?void 0:n.includes(LicenseFeature.ABR)))return!1;const o=this.sdk.getSdkPlugin("AuthToken");return this.adapter.canOpenAbr(null==o?void 0:o.playInfo)}showRealDefinition(){var e,t;return!!(null==(t=null==(e=this.configs)?void 0:e.autoBitrateOpts)?void 0:t.showRealDefinition)}isAutoDefinition(e){return["auto","自动"].includes(e)}isPlayAutoDefinition(e=""){var t;return this.isAutoDefinition(e||this.defaultDefinition)||(null==(t=this.configs.autoBitrateOpts)?void 0:t.startWithAuto)}isDefinitionMatch(e,t){return!(!this.isAutoDefinition(e)||!this.isAutoDefinition(t))||e===t}getCurrentStreams(){const e=this.current;return this.getUrlList(e)}getLineList(){return cloneDeep(uniqBy(this.playList,"lineId"))}getLineListByLineId(e){return this.playList.filter((t=>{var i;return(null==e?void 0:e.toString())===(null==(i=t.lineId)?void 0:i.toString())}))}getDefinitionListByLineId(e){return cloneDeep(uniqBy(this.getLineListByLineId(e),"definition"))}getUrlList(e){return this.playList.filter((t=>Object.keys(e).every((i=>{var r,n;if("url"===i){const i=null==e?void 0:e.url,r=null==t?void 0:t.url;return"string"==typeof i?i===(null==r?void 0:r.toString()):!(!Array.isArray(i)||!Array.isArray(r))&&i.map((e=>e.src)).join("")===r.map((e=>e.src)).join("")}{const o=(null==(r=e[i])?void 0:r.toString())===(null==(n=t[i])?void 0:n.toString()),a=!e[i];return o||a}}))))}getNextDefinition(e=!0,t){var i,r,n;const o=e?"next":"prev",{definition:a,lineId:s}=this.current;if(!a)return;const l=null==(i=this.getCurrentStreams())?void 0:i[0],c="auto"===a?l.mapDefinition:a,u=formatDemotePriority(t)||DefinitionLinked;if(!Object.keys(u).includes(c))return;let d=null==(r=u[c])?void 0:r[o];const h=this.getDefinitionListByLineId(s);for(;0===h.filter((e=>e.definition===d)).length&&d;)d=null==(n=u[d])?void 0:n[o];if(d)return"auto"===a&&d&&(l.mapDefinition=d),this.getUrlList({lineId:s,definition:d});VE_DEBUG.log("已经降至最低级")}get apiMap(){var e;const t="sg",i=null==(e=VePlayer$1.ttDramaEnv)?void 0:e.channel,r={sg:{__PLAY_DOMAIN__:"https://vod.byteplusapi.com",__BACKUP_PLAY_DOMAIN__:"https://open.byteplusapi.com"}},n={cn:{__PLAY_DOMAIN__:"https://vod.volcengineapi.com",__BACKUP_PLAY_DOMAIN__:"https://open.volcengineapi.com"},mya:{__PLAY_DOMAIN__:"https://vod.ap-southeast-1.volcengineapi.com"}};let o,a=t;"byteplus"===i&&r?(o=r,a="sg"):"volcengine"===i&&n?(o=n,a=o[t]?t:"cn"):o={sg:{__PLAY_DOMAIN__:"https://vod.byteplusapi.com",__BACKUP_PLAY_DOMAIN__:"https://open.byteplusapi.com"}};const s=o[this.region]||o[a];return{playDomain:s.__PLAY_DOMAIN__,backupPlayDomain:null==s?void 0:s.__BACKUP_PLAY_DOMAIN__}}get playDomain(){var e;return this.playDomainDegrade&&null!=(e=this.apiMap.backupPlayDomain)?e:this.apiMap.playDomain}setVodTeaId(){const e=getCurUserRegionConfig(this.userRegion,this.region);setTeaId(this.configs.logTeaAppId||e.__LOG_TEA_ID__||4951)}updateConfigs(e){mergeWith$1(this.configs,cloneDeep(e),((e,t)=>{if(isArray$7(e))return t}))}updatePlayList(){const{url:e,playList:t=[],urlExpireTimestamp:i}=this.configs,r=[...t].filter((e=>e.url));if(e&&!r.length){const t=__spreadProps(__spreadValues({},this.current),{url:e,urlExpireTimestamp:i});this.playList=[t]}else this.playList=r}isVidPlay(){var e,t;return!!(null==(t=null==(e=this.configs)?void 0:e.getVideoByToken)?void 0:t.playAuthToken)}}var OptionList=function(){function e(t){_classCallCheck$2(this,e),this.config=t.config,this.parent=t.root,this.root=util.createDom("ul","",{},"xg-options-list xg-list-slide-scroll ".concat(this.config.className)),t.root.appendChild(this.root);var i=this.config.maxHeight;i&&this.setStyle({maxHeight:i}),this.onItemClick=this.onItemClick.bind(this),this.renderItemList();var r="touch"===this.config.domEventType?"touchend":"click";this._delegates=Plugin.delegate.call(this,this.root,"li",r,this.onItemClick)}return _createClass$2(e,[{key:"renderItemList",value:function(e){var t=this,i=this.config,r=this.root;e?i.data=e:e=i.data,i.style&&Object.keys(i.style).map((function(e){r.style[e]=i[e]})),e.length>0&&(this.attrKeys=Object.keys(e[0])),this.root.innerHTML="",e.map((function(e,i){var r=e.selected?"option-item selected":"option-item";e["data-index"]=i,t.root.appendChild(util.createDom("li","<span>".concat(e.showText,"</span>"),e,r))}))}},{key:"onItemClick",value:function(e){e.delegateTarget||(e.delegateTarget=e.target);var t=e.delegateTarget;if(t&&util.hasClass(t,"selected"))return!1;var i="function"==typeof this.config.onItemClick?this.config.onItemClick:null,r=this.root.querySelector(".selected");util.addClass(t,"selected"),r&&util.removeClass(r,"selected"),i(e,{from:r?this.getAttrObj(r,this.attrKeys):null,to:this.getAttrObj(t,this.attrKeys)})}},{key:"getAttrObj",value:function(e,t){if(!e||!t)return{};var i={};t.map((function(t){i[t]=e.getAttribute(t)}));var r=e.getAttribute("data-index");return r&&(i.index=Number(r)),i}},{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(i){t.root.style[i]=e[i]}))}},{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",DEFAULT:"default"},TOGGLE_MODES={CLICK:"click",HOVER:"hover"};function getListClassName(e,t){return e===LIST_TYPES.SIDE?t===POSITIONS$7.CONTROLS_LEFT?"xg-side-list xg-left-side":"xg-side-list xg-right-side":""}var IS_MOBILE$3="mobile"===sniffer.device,OptionsIcon=function(e){_inherits$1(i,Plugin);var t=_createSuper$1(i);function i(e){var r;return _classCallCheck$2(this,i),_defineProperty$2(_assertThisInitialized$1(r=t.call(this,e)),"onEnter",(function(e){e.stopPropagation(),r.emit("icon_mouseenter",{pluginName:r.pluginName}),r.switchActiveState(e)})),_defineProperty$2(_assertThisInitialized$1(r),"switchActiveState",(function(e){e.stopPropagation(),r.config.toggleMode===TOGGLE_MODES.CLICK?r.toggle(!r.isActive):r.toggle(!0)})),_defineProperty$2(_assertThisInitialized$1(r),"onLeave",(function(e){e.stopPropagation(),r.emit("icon_mouseleave",{pluginName:r.pluginName}),r.config.listType!==LIST_TYPES.SIDE&&r.isActive&&r.toggle(!1)})),_defineProperty$2(_assertThisInitialized$1(r),"onListEnter",(function(e){r.enterType=2})),_defineProperty$2(_assertThisInitialized$1(r),"onListLeave",(function(e){r.enterType=0,r.isActive&&r.toggle(!1)})),r.isIcons=!1,r.isActive=!1,r.curValue=null,r.curIndex=0,r}return _createClass$2(i,[{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$3=IS_MOBILE$3||"touch"===this.domEventType)&&"mobile"===sniffer.device&&t.listType===LIST_TYPES.DEFAULT&&(t.listType=LIST_TYPES.SIDE),t.hidePortrait&&util.addClass(this.root,"portrait"),this.on([VIDEO_RESIZE,FULLSCREEN_CHANGE],(function(){e._resizeList()})),this.once(CANPLAY,(function(){t.list&&t.list.length>0&&(e.renderItemList(t.list),e.show())})),IS_MOBILE$3&&this.on(PLAYER_FOCUS,(function(){e.isActive&&(e.optionsList&&e.optionsList.hide(),e.isActive=!1)})),IS_MOBILE$3?(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,i=Object.keys(t),r=!1;i.length>0&&(i.forEach((function(i){e.appendChild(".xgplayer-icon",t[i]),!r&&(r=t[i])})),this.isIcons=r),r||(this.appendChild(".xgplayer-icon",util.createDom("span","",{},"icon-text")),util.addClass(this.find(".xgplayer-icon"),"btn-text"))}},{key:"show",value:function(e){!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,i){if(void 0===e)return"";var r=this.config.list;!i&&(i=this.player.lang),t=!t||util.isUndefined(e[t])?"text":t,"number"==typeof e&&(e=r[e]);try{return"object"===_typeof$2(e[t])?e[t][i]||e[t].en:e[t]}catch(e){return console.warn(e),""}}},{key:"toggle",value:function(e){if(e!==this.isActive&&!this.config.disable){var t=this.player.controls,i=this.config.listType;e?(i===LIST_TYPES.SIDE?t.blur():t.focus(),this.optionsList&&this.optionsList.show()):(i===LIST_TYPES.SIDE?t.focus():t.focusAwhile(),this.optionsList&&this.optionsList.hide()),this.isActive=e}}},{key:"onItemClick",value:function(e,t){e.stopPropagation();var i=this.config,r=i.listType,n=i.list;this.curIndex=t.to.index,this.curItem=n[this.curIndex],this.changeCurrentText(),(this.config.isItemClickHide||IS_MOBILE$3||r===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 i=this,r=this.config,n=this.optionsList,o=this.player;if("number"==typeof t&&(this.curIndex=t,this.curItem=r.list[t]),n)return n.renderItemList(e),void this.changeCurrentText();var a={config:{data:e||[],className:getListClassName(r.listType,r.position),onItemClick:function(e,t){i.onItemClick(e,t)},domEventType:IS_MOBILE$3?"touch":"mouse"},root:r.listType===LIST_TYPES.SIDE?o.innerContainer||o.root:this.root};if(this.config.isShowIcon){var s=this.player.root.getBoundingClientRect().height,l=r.listType===LIST_TYPES.MIDDLE?s-50:s;l&&r.heightLimit&&(a.config.maxHeight="".concat(l,"px")),this.optionsList=new OptionList(a),this.changeCurrentText(),this.show()}this._resizeList()}},{key:"_resizeList",value:function(){if(this.config.heightLimit){var e=this.player.root.getBoundingClientRect().height,t=this.config.listType===LIST_TYPES.MIDDLE?e-50:e;this.optionsList&&this.optionsList.setStyle({maxHeight:"".concat(t,"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$7.CONTROLS_RIGHT,index:100,list:[],listType:"default",listStyle:{},hidePortrait:!0,isShowIcon:!1,isItemClickHide:!0,toggleMode:TOGGLE_MODES.HOVER,heightLimit:!0}}}]),i}();const MediaEvents={ABORT:"abort",CANPLAY:"canplay",CANPLAY_THROUGH:"canplaythrough",DURATION_CHANGE:"durationchange",EMPITED:"empited",EMPTIED:"emptied",ENDED:"ended",ERROR:"error",LOADED_DATA:"loadeddata",LOADED_META_DATA:"loadedmetadata",LOAD_START:"loadstart",PAUSE:"pause",PLAY:"play",PLAYING:"playing",PROGRESS:"progress",RATE_CHANGE:"ratechange",SEEKED:"seeked",SEEKING:"seeking",STALLED:"stalled",SUSPEND:"suspend",TIME_UPDATE:"timeupdate",VOLUME_CHANGE:"volumechange",WAITING:"waiting"},SDKEvents={READY:"ready",COMPLETE:"complete",URL_CHANGE:"urlchange",PLAYER_FOCUS:"focus",PLAYER_BLUR:"blur",FULLSCREEN_CHANGE:"fullscreen_change",CSS_FULLSCREEN_CHANGE:"cssFullscreen_change",MINI_STATE_CHANGE:"mini_state_change",DESTROY:"destroy",REPLAY:"replay",RETRY:"retry",DEFINITION_CHANGE:"definition_change",Before_DEFINITION_CHANGE:"before_definition_change",AFTER_DEFINITION_CHANGE:"after_definition_change",VIDEO_RESIZE:"video_resize",PIP_CHANGE:"pip_change",ROTATE:"rotate",SHORTCUT:"shortcut",SEI_PARSED:"SEI_PARSED",USER_ACTION:"user_action",AUTOPLAY_STARTED:"autoplay_started",AUTOPLAY_PREVENTED:"autoplay_was_prevented",READY_CREATE_PLAYER:"ready_create_player",PLAYER_CREATED_FINISH:"player_create_finish",CREATE_PLAYER_PERF:"create_player_perf",PLAYER_REBUILD:"player_rebuild",NOT_SUPPORT_HARDWARE_DECODER:"not_support_hardware_decoder",NOT_SUPPORT_SOFT_DECODER:"not_support_soft_decoder",TOKEN_EXPIRED:"playAuthToken_expired",UMD_LOAD_FAIL:"umd_load_fail",PLAYNEXT:"playnext",URL_NULL:"urlNull",LEAVE_PLAYER:"leaveplayer",ENTER_PLAYER:"enterplayer",RESET:"reset",SOURCE_ERROR:"source_error",SOURCE_SUCCESS:"source_success",LICENSE_STATUS_WARNING:"license_status_warning",AUDIO_TRACKS_UPDATED:"audio_tracks_updated",AUDIO_TRACK_CHANGE:"audio_track_change"},PluginEvents=__spreadProps(__spreadValues({DANMU_CHANGE:"danmu_change",TIME_SHIFT_CHANGE:"time_shift_change",AI_SUBTITLE_LANG_CHANGE:"ai_subtitle_lang_change",AI_SUBTITLE_MATCH:"ai_subtitle_match",CANCEL_UNMUTE:"cancel_unmute",REFRESH_CLICK:"refresh_click",PLAY_BACKUP_CHANGE:"play_backup_change",PLAY_BACKUP_CHANGE_FINISH:"play_backup_change_finish",PLAY_ERROR_BUTTON_CLICK:"play_error_button_click",PlAY_URL_CHANGE:"play_url_change",SHOW_PLAY_ERROR:"show_play_error",PLAYER_EXTEND_BUTTON:"player_extend_button",LONG_WAITING:"long_waiting",OFTEN_WAITING:"often_waiting",DEFINITION_DEMOTE:"definition_demote",LARKWINDOW_CHANGE:"larkWindow_change",PANEL_MODE_CHANGE:"panel_mode_change",INNER_DEFINITION_CHANGE:"inner_definition_change",LINE_CHANGE:"line_change",GET_PLAY_URL_ERR:"get_play_url_err",MEDIA_EXPIRED:"MEDIA_EXPIRED",MIRROR_CHANGE:"mirror_change"},{}),{AUTOPLAY_SUCCESS:"autoplay_success",AUTOPLAY_FAILED:"autoplay_failed",MENU_LOG:"MENU_LOG",MENU_REPORT:"MENU_REPORT",PLAY_LIST_CHANGE:"play_list_change",PLAY_LIST_ITEM_CHANGE:"play_list_item_change",PLAY_NEXT_START:"play_next_start",PLAY_NEXT_END:"play_next_end",ABR_AUTO_DESC_CHANGE:"ABR_AUTO_DESC_CHANGE",CORE_EVENT:"core_event",PRELOAD_INFO:"PRELOAD_INFO"}),Events=__spreadValues(__spreadValues(__spreadValues({},MediaEvents),SDKEvents),PluginEvents),Event$1={SDKEvents:SDKEvents,PluginEvents:PluginEvents},Events$1=Events,CONTROL_ICON_INDEX={audioTrackPlugin:70,sdkDefinitionPlugin:30,DanmuPlugin:30,sdkMultilinePlugin:40,mirrorPlugin:50,Subtitle:60},CONTROL_LEFT_ICON_INDEX={playListPlugin:20},OLD_UNMUTE_PLUGIN_LOWERCASE_NAME="sdkunmuteplugin",AUTO_DEF_DETECT_INTERNAL=1e3,MixinDefinitionBase=e=>class extends e{constructor(e){super(e),this._playTimer=null,this.handleABRDescChange=(...e)=>{this._autoRealDefinition=e[1]||void 0,this.refreshDefinitionList()},this.handleResourceReady=(e=[])=>{var t,i;const{list:r}=this.getCurrentDefinitionInfo(this.player),n=r.filter((t=>{var i;const r=t&&e.find((e=>this.playerData.isDefinitionMatch(e.definition,t.definition)));return r&&"dash"===(null==(i=this.playerData.getStreamType())?void 0:i.toLowerCase())&&(t.url=r.url),r})),o=e.find((e=>null==e?void 0:e.selected))||this.playerData.current,a=n.find((e=>this.playerData.isDefinitionMatch(e.definition,null==o?void 0:o.definition)));this.playerData.playList=n,(null==a?void 0:a.definition)&&(null==(t=this.playerData.current)?void 0:t.definition)!==a.definition&&(this.playerData.current.definition=null==a?void 0:a.definition),null==(i=this.refreshDefinitionList)||i.call(this)},this.getAutoDefRealLevel=()=>{var e;if(this.playerData.isAutoDefinition(null==(e=this.playerData.current)?void 0:e.definition)){const{videoWidth:e,videoHeight:t}=this.player.media;if(e&&t){const{list:i=[]}=this.getCurrentDefinitionInfo(this.player),r=i.find((i=>{const r=i.vwidth||i.width,n=i.vheight||i.height;return r&&n&&r===e&&n===t}));(null==r?void 0:r.definition)&&this._autoRealDefinition!==r.definition&&(this._autoRealDefinition=r.definition,this.refreshDefinitionList(),"mobile"===sniffer.device&&(null==this||this.updatePanel()))}}},this.clientType=e.clientType,this.playerData=e.player.config.playerData,this.toastInfo={},this.dataMonitoring()}afterCreate(){var e,t,i,r,n;super.afterCreate(),this._autoRealDefinition=void 0,null==(e=this.refreshDefinitionList)||e.call(this),(this.playerData.isOpenABR()||"dash"===(null==(t=this.playerData.getStreamType())?void 0:t.toLowerCase()))&&this.on("resourceReady",this.handleResourceReady),this.playerData.isOpenABR()&&(this.on("ABR_AUTO_DESC_CHANGE",this.handleABRDescChange),((null==(n=null==(r=null==(i=this.playerData)?void 0:i.adapter)?void 0:r.useNativeAbr)?void 0:n.call(r))||this.player.plugins.dashplugin||this.player.plugins.mp4encryptplayer)&&(this.autoDefDetectTimer=new IntervalTimer$1,this.autoDefDetectTimer.repeat(this.getAutoDefRealLevel,1e3))),this.on(PluginEvents.PLAY_NEXT_START,(()=>{this.definitionSubscribeId&&MyProxy$1.unsubscribeProperty(this.playerData.current,"definition",this.definitionSubscribeId),this.playListSubscribeId&&MyProxy$1.unsubscribeProperty(this.playerData,"playList",this.playListSubscribeId)})),this.on(PluginEvents.PLAY_NEXT_END,(()=>{var e,t;null==(e=this.dataMonitoring)||e.call(this),null==(t=this.refreshDefinitionList)||t.call(this)}))}getShowText(e={},t,i){var r,n;if(t)return this.playerData.isOpenABR()&&this.playerData.isAutoDefinition(t.definition)?(null==(n=null==(r=this.playerData.configs)?void 0:r.autoBitrateOpts)?void 0:n.autoDefinitionText)||e[t.definitionTextKey]||t.definition:e[t.definitionTextKey]||t.definition||t.definitionTextKey||i||"HD"}getCurrentDefinitionInfo(e){const t={list:[],defaultDefinition:""},i=e.config.playerData,{current:{lineId:r,definition:n}}=i,o=i.getDefinitionListByLineId(r);return Array.isArray(o)&&o.length>0&&(t.list=o.map((t=>(t.text||(t.text=this.getShowText(e.i18n,t,t.definition)),t)))),t.defaultDefinition=n,t}showToast(e,t){var i,r;const n=null==(i=this.player)?void 0:i.getPlugin("sdkToastPlugin");if(!n)return;const o=this.getShowText(this.i18n,e,t);this.toastInfo&&(clearTimeout(this.toastInfo.timer),null==(r=null==n?void 0:n.remove)||r.call(n,this.toastInfo.id),this.player.off(AFTER_DEFINITION_CHANGE,this.toastInfo.remove),this.player.off(ERROR$1,this.toastInfo.remove)),this.toastInfo={id:n.add(`${this.langText.switching} ${o}...`,0,!0),showTime:Date.now(),delayClose:!1},this.toastInfo.timer=setTimeout((()=>{n.remove(this.toastInfo.id),clearTimeout(this.toastInfo.timer)}),2e3),this.toastInfo.remove=()=>{if(!this.toastInfo.id)return;Date.now()-this.toastInfo.showTime>2e3?n.remove(this.toastInfo.id):this.toastInfo.delayClose=!0},this.player.once(AFTER_DEFINITION_CHANGE,this.toastInfo.remove),this.player.once(ERROR$1,this.toastInfo.remove)}selectDefinition(e){var t,i,r;const n=null==(r=null==(i=null==(t=this.renderList)?void 0:t.find)?void 0:i.call(t,(t=>this.playerData.isDefinitionMatch(t.definition,e.definition))))?void 0:r.definitionTextKey;this.config.showToastOnManualClick&&this.showToast(__spreadProps(__spreadValues({},e),{definitionTextKey:n}),e.definition),this.playerData.current.definition=e.definition,this.playerData.isAutoDefinition(e.definition)||(this._autoRealDefinition=void 0)}showRealDefinition(e){return e.selected&&this.playerData.isAutoDefinition(e.definition)&&this.playerData.showRealDefinition()&&this._autoRealDefinition&&!this.playerData.isAutoDefinition(this._autoRealDefinition)}dataMonitoring(){this.playerData&&(this.definitionSubscribeId=MyProxy$1.subscribeProperty(this.playerData.current,"definition",((e,t)=>{if(e&&t&&e!==t&&this.player){const{list:i}=this.getCurrentDefinitionInfo(this.player),r=i.find((e=>e.definition===t));r&&r.url&&(this.player.changeDefinition(__spreadProps(__spreadValues({kid:r.playAuthId},r),{secretKey:r.secretKey,definition:t,url:r.url})),"MOBILE"===this.clientType&&this.updatePanel(),this.player.emit(PluginEvents.INNER_DEFINITION_CHANGE,{from:e,to:t,url:r.url}),this.player.emit(PluginEvents.PlAY_URL_CHANGE,{url:r.url,from:PluginEvents.INNER_DEFINITION_CHANGE}),"PC"===this.clientType&&this.renderItemList(t),this.player.config.isLive&&(this._playTimer=setTimeout((()=>{this.player.ended?this.player.replay():this.player.paused&&this.player.play()}),1e3)))}})),this.playListSubscribeId=MyProxy$1.subscribeProperty(this.playerData,"playList",(()=>{this.refreshDefinitionList()})))}onItemClick(...e){super.onItemClick(...e)}destroy(){clearTimeout(this.toastInfo.timer),clearTimeout(this._playTimer),this.autoDefDetectTimer&&(this.autoDefDetectTimer.clear(),this.autoDefDetectTimer=null,this.getAutoDefRealLevel=null),this.off("resourceReady",this.handleResourceReady),this.off("ABR_AUTO_DESC_CHANGE",this.handleABRDescChange)}};class DefinitionPlugin extends(MixinDefinitionBase(OptionsIcon)){constructor(e){const t=e.config.className;super(__spreadProps(__spreadValues({},e),{config:__spreadValues(__spreadValues({},e.config),t?{className:`${t} xgplayer-definition-plugin-pc`}:{}),clientType:"PC"})),this.onItemClick=throttle(this.onItemClick.bind(this),1e3,{trailing:!0})}static get pluginName(){return"sdkDefinitionPlugin"}static get defaultConfig(){return{position:Plugin.POSITIONS.CONTROLS_RIGHT,index:CONTROL_ICON_INDEX.sdkDefinitionPlugin,list:[],defaultDefinition:"",hidePortrait:!1,disable:!1,showToastOnManualClick:!0,className:"xgplayer-definition xgplayer-definition-plugin-pc",isShowIcon:!0,isNeedAuto:!0,allowedSize:null,alwaysShowDefinition:!1}}registerLanguageTexts(){return{switching:{jp:"に切り替える",en:"Switching to",zh:"正在切换至","zh-hk":"正在切換至"}}}afterCreate(){super.afterCreate()}refreshDefinitionList(){var e;(null==(e=this.player.config)?void 0:e.alwaysShowDefinition)&&(this.config.alwaysShowDefinition=!0);const{defaultDefinition:t,list:i}=this.getCurrentDefinitionInfo(this.player);this.config.defaultDefinition=t,this.config.list=i.map(((e,t)=>__spreadProps(__spreadValues({},e),{itemIndex:t}))),this.config.list&&this.config.list.length>0&&(this.config.list.length<2?this.config.alwaysShowDefinition?(this.renderItemList(),this.show()):this.hide():(this.renderItemList(),this.show()))}show(){var e;!this.config.list||(null==(e=this.config.list)?void 0:e.length)<2&&!this.config.alwaysShowDefinition||util.addClass(this.root,"show")}afterPlayerInit(){}renderItemList(e){if(Array.isArray(e))return;const{list:t,defaultDefinition:i}=this.config;let r=0;const n=t.map(((t,n)=>{var o;const a={url:t.url,definition:t.definition||"",definitionTextKey:t.definitionTextKey,showText:this.getShowText(this.i18n,t,t.definition),isCurrent:!1,selected:!1,isDefinitionAuto:!1},s="string"==typeof e?t.definition===e:void 0===e&&t.definition===i;if(!util.isUndefined(t.definition)&&s&&(a.isCurrent=!0,a.selected=!0,r=n),this.showRealDefinition(a)){const e=null==(o=this.renderList)?void 0:o.find((e=>this.playerData.isDefinitionMatch(null==e?void 0:e.definition,this._autoRealDefinition))),t=this.getShowText(this.i18n,e,null==e?void 0:e.definition);a.showText=t?`${a.showText}(${t})`:a.showText}return a.isDefinitionAuto=this.playerData.isAutoDefinition(t.definition),a}));this.renderList=n,super.renderItemList(n,r)}onItemClick(e,t){var i;if(t.to.definition!==this.playerData.current.definition){const r=null==(i=this.playerData.getCurrentStreams())?void 0:i[0];this.emitUserAction(e,"change_definition",{from:r,to:t.to}),this.selectDef(t.to)}}selectDef(e){this.selectDefinition(e),"ontouchstart"in window&&this.optionsList.hide()}changeDefinition(e){const t=this.renderList.find((t=>this.playerData.isDefinitionMatch(t.definition,e)));t&&this.selectDef(t)}destroy(){super.destroy()}}function buildAudioSelectionOption(e){const t={};for(const i of["lang","name"]){const r=e[i];void 0!==r&&(t[i]=r)}return t}function switchNativeAudioTrack(e,t){if(!(t<0||t>=e.length))for(let i=0;i<e.length;i++)e[i].enabled=i===t}function switchHlsAudioTrack(e,t){const i=e;if("function"==typeof i.setAudioOption)i.setAudioOption(buildAudioSelectionOption(t));else{const{id:i,lang:r,name:n}=t,o=e.audioTracks.find((e=>e.id===i&&((void 0===r||e.lang===r)&&(void 0===n||e.name===n))));if(!o||e.audioTrack===o.id)return;e.audioTrack=o.id}}const LANG_MAP={zh:"中文","zh-cn":"普通话","zh-hk":"粤語","zh-tw":"繁體中文","zh-sg":"普通话",en:"English",ja:"日本語",ko:"한국어",th:"ภาษาไทย",vi:"Tiếng Việt",id:"Bahasa Indonesia",ms:"Bahasa Melayu",fil:"Filipino",tl:"Filipino",my:"မြန်မာဘာသာ",km:"ភាសាខ្មែរ",lo:"ພາສາລາວ",hi:"हिन्दी",bn:"বাংলা",ta:"தமிழ்",te:"తెలుగు",mr:"मराठी",ur:"اردو",fr:"Français",de:"Deutsch",es:"Español","es-419":"Español (Latinoamérica)",it:"Italiano",pt:"Português","pt-br":"Português (Brasil)","pt-pt":"Português (Portugal)",nl:"Nederlands",sv:"Svenska",da:"Dansk",no:"Norsk",fi:"Suomi",ca:"Català",ru:"Русский",pl:"Polski",uk:"Українська",cs:"Čeština",sk:"Slovenčina",ro:"Română",hu:"Magyar",bg:"Български",hr:"Hrvatski",sr:"Српски",sl:"Slovenščina",el:"Ελληνικά",ar:"العربية",fa:"فارسی",he:"עברית",tr:"Türkçe",az:"Azərbaycan",kk:"Қазақша",mn:"Монгол",sw:"Kiswahili"};function getLanguageName(e){var t;return null!=(t=LANG_MAP[e.toLowerCase()])?t:e.toUpperCase()}function getAudioTrackLabel(e,t){var i;const r=null!=(i=e.name)?i:"",n=e.lang?getLanguageName(e.lang):"";return[n||r||`Track ${e.id+1}`,!1!==(null==t?void 0:t.showNameSuffix)&&n&&r?`(${r})`:""].filter(Boolean).join(" ")}function getNativeTrackLabel(e,t,i){var r;const n=null!=(r=e.label)?r:"",o=e.language?getLanguageName(e.language):"";return[o||n||`Track ${t+1}`,!1!==(null==i?void 0:i.showNameSuffix)&&o&&n?`(${n})`:""].filter(Boolean).join(" ")}class AudioTrackPlugin extends OptionsIcon{constructor(){super(...arguments),this._nativeMode=!1,this._nativeAddTrackHandler=null,this._nativeChangeHandler=null,this._nativeRemoveTrackHandler=null,this._nativeChangeRaf=null}static get pluginName(){return"AudioTrack"}static get defaultConfig(){return __spreadProps(__spreadValues({},OptionsIcon.defaultConfig),{position:Plugin.POSITIONS.CONTROLS_RIGHT,index:CONTROL_ICON_INDEX.audioTrackPlugin,list:[],className:"xgplayer-audio-track",hidePortrait:!1,isShowIcon:!0,showNameSuffix:!0})}registerIcons(){return{}}afterPlayerInit(){var e;super.afterPlayerInit(),this.on("hlsAudioTracksUpdated",(e=>{this._onAudioTracksUpdated(e.audioTracks)})),this.on("hlsAudioTrackSwitched",(e=>{this._updateSelection(e.id)}));const t=this._getHls();(null==(e=null==t?void 0:t.audioTracks)?void 0:e.length)>1?this._onAudioTracksUpdated(t.audioTracks):t?this.hide():this._initNativeAudioTracks()}onItemClick(e,t){if(super.onItemClick(e,t),this._nativeMode){const e=this._getNativeTrackList();if(!e)return;switchNativeAudioTrack(e,t.to.id)}else{const e=this._getHls();if(!e)return;switchHlsAudioTrack(e,t.to)}}destroy(){var e;null!==this._nativeChangeRaf&&cancelAnimationFrame(this._nativeChangeRaf),this._unbindNativeAudioTracks(),null==(e=super.destroy)||e.call(this)}_getHls(){var e,t;const i=this.player.plugins;return(null==(e=null==i?void 0:i.encrypthlsplugin)?void 0:e.hls)||(null==(t=null==i?void 0:i.hls)?void 0:t.hls)}_getNativeTrackList(){var e,t;return null==(t=null==(e=this.player)?void 0:e.media)?void 0:t.audioTracks}_initNativeAudioTracks(){const e=this._getNativeTrackList();e&&(this._nativeMode=!0,this._nativeAddTrackHandler=()=>this._onNativeTracksChanged(),this._nativeChangeHandler=()=>{null===this._nativeChangeRaf&&(this._nativeChangeRaf=requestAnimationFrame((()=>{this._nativeChangeRaf=null,this._onNativeTrackEnabled()})))},this._nativeRemoveTrackHandler=()=>this._onNativeTracksChanged(),e.addEventListener("addtrack",this._nativeAddTrackHandler),e.addEventListener("change",this._nativeChangeHandler),e.addEventListener("removetrack",this._nativeRemoveTrackHandler),e.length>1?this._onNativeTracksChanged():this.hide())}_unbindNativeAudioTracks(){const e=this._getNativeTrackList();e&&(this._nativeAddTrackHandler&&e.removeEventListener("addtrack",this._nativeAddTrackHandler),this._nativeChangeHandler&&e.removeEventListener("change",this._nativeChangeHandler),this._nativeRemoveTrackHandler&&e.removeEventListener("removetrack",this._nativeRemoveTrackHandler))}_onNativeTracksChanged(){const e=this._getNativeTrackList();!e||e.length<=1?this.hide():(this._renderNativeTracks(e),this.show())}_onNativeTrackEnabled(){const e=this._getNativeTrackList();e&&this._renderNativeTracks(e)}_renderNativeTracks(e){const t={showNameSuffix:!1!==this.config.showNameSuffix},i=[];for(let r=0;r<e.length;r++){const n=e[r],o=getNativeTrackLabel(n,r,t);i.push({id:r,name:o,showText:o,iconText:o,selected:n.enabled,default:n.enabled})}const r=i.findIndex((e=>e.selected));this.config.list=i,super.renderItemList(i,r>-1?r:0)}_onAudioTracksUpdated(e){!e||e.length<=1?this.hide():(this._renderTracks(e),this.show())}_updateSelection(e){const t=this._getHls();t&&this._renderTracks(t.audioTracks,e)}_renderTracks(e,t){var i;const r=this._getHls(),n=null!=(i=null!=t?t:null==r?void 0:r.audioTrack)?i:-1,o={showNameSuffix:!1!==this.config.showNameSuffix},a=e.find((e=>e.default)),s=e.map((e=>__spreadProps(__spreadValues({},e),{showText:getAudioTrackLabel(e,o),iconText:getAudioTrackLabel(e,o),selected:e.id===n})));if(-1===n&&a){const e=s.findIndex((e=>e.id===a.id));e>-1&&(s[e].selected=!0)}const l=s.findIndex((e=>e.selected));this.config.list=s,super.renderItemList(s,l>-1?l:0)}}function MutedImg(){return(new DOMParser).parseFromString('<svg width="19" height="16" viewBox="0 0 19 15" fill="none" xmlns="http://www.w3.org/2000/svg">\n <g clip-path="url(#clip0_18_7532)" filter="url(#filter0_d_18_7532)">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M9.33333 3.19115C9.33333 2.79702 8.91856 2.54067 8.56604 2.71694L4.66668 4.66662C4.66667 4.66662 4.66667 4.66663 4.66667 4.66663C4.66667 4.66664 4.66666 4.66665 4.66665 4.66665H3.19685C2.90404 4.66665 2.66666 4.90402 2.66666 5.19684V9.4698C2.66666 9.76261 2.90404 9.99998 3.19685 9.99998H4.55791C4.62971 9.99998 4.70076 10.0146 4.76676 10.0429L8.5943 11.6832C8.94415 11.8332 9.33333 11.5765 9.33333 11.1959V3.19115Z" fill="white"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M13 6.87773L14.8934 4.7138C14.9485 4.6509 15.0377 4.6509 15.0927 4.7138L15.2921 4.94158C15.3471 5.00448 15.3471 5.10646 15.2921 5.16936L13.3986 7.33329L15.2921 9.49722C15.3471 9.56012 15.3471 9.6621 15.2921 9.725L15.0927 9.95278C15.0377 10.0157 14.9485 10.0157 14.8934 9.95278L13 7.78886L11.1066 9.95278C11.0515 10.0157 10.9623 10.0157 10.9073 9.95278L10.7079 9.725C10.6529 9.6621 10.6529 9.56012 10.7079 9.49722L12.6014 7.33329L10.7079 5.16936C10.6529 5.10646 10.6529 5.00448 10.7079 4.94158L10.9073 4.7138C10.9623 4.6509 11.0515 4.6509 11.1066 4.7138L13 6.87773Z" fill="white" stroke="white" stroke-width="0.530187"/>\n </g>\n <defs>\n <filter id="filter0_d_18_7532" x="-0.666667" y="0" width="19.3333" height="19.3333" 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.66667"/>\n <feGaussianBlur stdDeviation="1.33333"/>\n <feComposite in2="hardAlpha" operator="out"/>\n <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>\n <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_18_7532"/>\n <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_18_7532" result="shape"/>\n </filter>\n <clipPath id="clip0_18_7532">\n <rect width="14" height="14" fill="white" transform="translate(2)"/>\n </clipPath>\n </defs>\n</svg>\n\n',"image/svg+xml").firstChild}const{isWeixin:isWeixin,os:os,device:device}=sniffer,isAndroid=os.isAndroid,isIos=os.isIos,isMobile$1="mobile"===device;let last=0,USER_AUTOPLAY_TRIGGERED=!1;class AutoplayPlugin extends Plugin{constructor(e){super(e),this.state={mode:0,showUnmuteBt:!1},this.wxCanPlayFn=()=>{window.WeixinJSBridge&&window.WeixinJSBridge.invoke("getNetworkType",{},(()=>{this.wxTimer=setTimeout((()=>{this.wxTimer&&clearTimeout(this.wxTimer);const e=this.player.play();e&&e.then?e.then((()=>{VE_DEBUG.log("wechat autoplay success")})).catch((e=>{VE_DEBUG.warn("wechat autoplay fail:",e),this.state.showUnmuteBt=!1,this.renderUnmuteBt()})):VE_DEBUG.warn("wechat browser no play promise")}))}))},this.wxPlay=()=>{this.player.readyState>=2?this.wxCanPlayFn():isAndroid?this.player.once(CANPLAY,this.wxCanPlayFn):isIos&&this.player.once(COMPLETE,this.wxCanPlayFn)},this.userClickPlay=()=>{if(USER_AUTOPLAY_TRIGGERED)return;const e=this.player.play();e&&e.then?e.then((()=>{VE_DEBUG.log("user action autoplay success"),USER_AUTOPLAY_TRIGGERED=!0})).catch((e=>{VE_DEBUG.warn("user action autoplay fail:",e)})):(VE_DEBUG.warn("no play promise"),USER_AUTOPLAY_TRIGGERED=!0)},this.handleAutoplayPrevented=()=>0===this.state.mode?(VE_DEBUG.warn("unmute autoplay fail"),this.player.emit(PluginEvents.AUTOPLAY_FAILED,{mode:"unmute"}),isAndroid&&isWeixin?void(this.state.mode=2):void(this.config.enableDegradeMuteAutoplay&&this.changeMuteMode())):1===this.state.mode?(VE_DEBUG.warn("mute autoplay fail"),this.player.emit(PluginEvents.AUTOPLAY_FAILED,{mode:"mute"}),void(this.state.mode=2)):2===this.state.mode?(this.player.emit(PluginEvents.AUTOPLAY_FAILED,{mode:"noSupport"}),void VE_DEBUG.warn("not support autoplay")):void 0,this.handleAutoplayStart=()=>{if(0!==this.state.mode)return 1===this.state.mode?(this.player.emit(PluginEvents.AUTOPLAY_SUCCESS,{mode:"mute"}),this.state.showUnmuteBt=!0,void this.renderUnmuteBt()):2===this.state.mode?(this.player.emit(PluginEvents.AUTOPLAY_SUCCESS,{mode:"click"}),this.player.muted=!1,this.state.showUnmuteBt=!1,void this.renderUnmuteBt()):void 0;this.player.emit(PluginEvents.AUTOPLAY_SUCCESS,{mode:"unmute"})},this.handleVolumechange=()=>{this.state.showUnmuteBt&&(this.state.showUnmuteBt=!1,this.renderUnmuteBt(),this.player.paused&&this.player.readyState>=1&&this.player.play())},this.cancelUnmute=e=>{const t=Date.now();t-last>200&&(last=t,this.player.muted=!1,this.state.showUnmuteBt=!1,this.renderUnmuteBt(),this.emitUserAction(e,"cancel_mute"))}}static get pluginName(){return"AutoplayPlugin"}static get defaultConfig(){return{position:Plugin.POSITIONS.ROOT,enableDegradeMuteAutoplay:!1,enableWxJsBridgeAutoplay:!1,userActionDom:window.document.body,enableUserActionAutoplay:!1,showUnmuteBtn:!0}}afterCreate(){this.initState(),this.initEvents(),this.setWXAutoPlay()}registerLanguageTexts(){return{unmute:{jp:"ミュートを解除する",en:"Click to unmute",zh:"点击取消静音","zh-hk":"點擊取消靜音"},muted:{jp:"ミュート",en:"muted",zh:"已静音","zh-hk":"已靜音"}}}registerIcons(){return{muted:{icon:MutedImg,class:"xgplayer-muted-svg"}}}updateLang(){this.renderUnmuteBt()}initState(){const{enableDegradeMuteAutoplay:e,enableWxJsBridgeAutoplay:t,enableUserActionAutoplay:i}=this.player.config;e&&(this.config.enableDegradeMuteAutoplay=!0),t&&(this.config.enableWxJsBridgeAutoplay=!0),i&&(this.config.enableUserActionAutoplay=!0),this.state.mode=this.player.muted?1:0}initEvents(){this.player.on(AUTOPLAY_PREVENTED,this.handleAutoplayPrevented),this.player.on(AUTOPLAY_STARTED,this.handleAutoplayStart),this.player.on(VOLUME_CHANGE,this.handleVolumechange),this.setUserActionAutoPlay()}setWXAutoPlay(){isWeixin&&this.player.config.autoplay&&this.config.enableWxJsBridgeAutoplay&&(window.WeixinJSBridge?this.wxPlay():document.addEventListener("WeixinJSBridgeReady",this.wxPlay,!1))}setUserActionAutoPlay(){var e;(null==(e=this.config)?void 0:e.enableUserActionAutoplay)&&this.player.once(PluginEvents.AUTOPLAY_FAILED,(()=>{this.hasSetUserAutoplay=!0;(this.config.userActionDom instanceof window.Node?this.config.userActionDom:window.document.body).addEventListener("click",this.userClickPlay,!1)}))}changeMuteMode(){this.player.muted=!0,this.state.showUnmuteBt=!0,this.state.mode=1,this.renderUnmuteBt(),this.timer=setTimeout((()=>{this.timer&&clearTimeout(this.timer);const e=this.player.play();e&&e.then?e.then((()=>{VE_DEBUG.log("degrade mute autoplay success")})).catch((e=>{VE_DEBUG.warn("degrade mute autoplay fail:",e),this.player.muted=!1,this.state.showUnmuteBt=!1,this.renderUnmuteBt()})):VE_DEBUG.warn("no play promise")}))}renderUnmuteBt(){var e,t,i;const r=this.root;if(r&&(r.innerHTML="",this.state.showUnmuteBt&&this.config.showUnmuteBtn)){const n=this.langText.unmute||(null==(i=null==(t=null==(e=this.registerLanguageTexts)?void 0:e.call(this))?void 0:t.unmute)?void 0:i.en),o=util.createDom("div",n,void 0,"xgplayer-unmute-bt");r.appendChild(o),this.bind(".xgplayer-unmute-bt","click",this.cancelUnmute),this.bind(".xgplayer-unmute-bt","touchend",this.cancelUnmute)}}destroy(){if(this.player.off(AUTOPLAY_PREVENTED,this.handleAutoplayPrevented),this.player.off(AUTOPLAY_STARTED,this.handleAutoplayStart),this.player.off(VOLUME_CHANGE,this.handleVolumechange),this.timer&&window.clearTimeout(this.timer),this.wxTimer&&window.clearTimeout(this.wxTimer),document.removeEventListener("WeixinJSBridgeReady",this.wxPlay,!1),this.hasSetUserAutoplay){const e=isMobile$1?"touch":"click";(this.config.userActionDom instanceof window.Node?this.config.userActionDom:window.document.body).removeEventListener(e,this.userClickPlay,!1)}}render(){return'<div class="xgplayer-unmute"></div>'}}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}class MoreButtonPlugin extends Plugin{constructor(e){super(e),this.panel=null,this.panelContainer=null}static get pluginName(){return"MoreButtonPlugin"}static get defaultConfig(){return{position:Plugin.POSITIONS.ROOT_TOP,iconPlugins:[],maxShowNum:2}}beforePlayerInit(){}afterPlayerInit(){}afterCreate(){this.renderMoreIcon()}updateLang(e){if(!this.panelContainer)return;const t=this.panelContainer.querySelectorAll(".panel-icon-bt-text"),i=this.getAndSplitList().extraList;t.forEach((t=>{var r,n;const o=Number(t.getAttribute("plugin-index"));(null==(n=null==(r=i[o])?void 0:r.textTips)?void 0:n[e])&&(t.innerHTML=i[o].textTips[e])}))}registerIcons(){return{more:{icon:MoreIconSVG,class:"xgplayer-more-svg"}}}getAndSplitList(){var e;let t,i;const r=(null!=(e=this.player.config.ignores)?e:[]).map((e=>e.toLowerCase())),n=this.config.iconPlugins.filter((e=>!r.includes(e.pluginName.toLowerCase())));return n.length>this.config.maxShowNum+1?(t=n.slice(0,this.config.maxShowNum),i=n.slice(-(n.length-this.config.maxShowNum))):t=[...n],{list:null!=t?t:[],extraList:null!=i?i:[]}}children(){const e=this.getAndSplitList().list,t={};return e.forEach((e=>{t[e.pluginName]={plugin:e,options:{root:this.root}}})),t}renderMoreIcon(){const e=this.getAndSplitList().extraList;if(0===e.length)return;const t=this.root,i=util.createDom("div","",{},"xgplayer-icon");i.appendChild(this.icons.more),i.addEventListener("click",(()=>{this.renderPanel(e)}));const r=util.createDom("xg-icon","",{"data-index":0},"xgplayer-more");r.appendChild(i),t.appendChild(r)}renderPanel(e){this.panelContainer||(this.panelContainer=util.createDom("div","",{},"panel-content"),e.forEach(((e,t)=>{var i,r;const n=util.createDom("div","",{},"panel-icon-bt"),o=util.createDom("div","",{},"panel-icon-svg");n.appendChild(o),this.registerExtraPlugin(e,o);const a="zh-cn"===this.player.lang?"zh":this.player.lang,s=null!=(r=null==(i=e.textTips)?void 0:i[a])?r:e.pluginName;n.appendChild(util.createDom("span",s,{"plugin-index":t},"panel-icon-bt-text")),this.panelContainer.appendChild(n)}))),this.player.panel.showPanel(this.panelContainer)}registerExtraPlugin(e,t){this.player.registerPlugin({plugin:e,options:{root:t}})}destroy(){}render(){return'<div class="xgplayer-rightTop-iconList"></div>'}}function ErrorSvg(){return(new DOMParser).parseFromString('<svg width="80" height="80" viewBox="0 0 80 80" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M68 40C68 55.464 55.464 68 40 68C24.536 68 12 55.464 12 40C12 24.536 24.536 12 40 12C55.464 12 68 24.536 68 40ZM34.75 34.05C34.75 35.7897 33.5747 37.2 32.125 37.2C30.6753 37.2 29.5 35.7897 29.5 34.05C29.5 32.3103 30.6753 30.9 32.125 30.9C33.5747 30.9 34.75 32.3103 34.75 34.05ZM40.2276 43.7334C36.2145 43.7334 32.6052 45.4732 30.1709 48.2331C29.5316 48.9579 29.6009 50.0638 30.3258 50.7031C31.0506 51.3424 32.1565 51.2731 32.7958 50.5483C34.5802 48.5252 37.2407 47.2334 40.2276 47.2334C43.2213 47.2334 45.8871 48.531 47.6715 50.562C48.3094 51.288 49.4152 51.3594 50.1412 50.7215C50.8673 50.0836 50.9387 48.9778 50.3008 48.2518C47.8663 45.481 44.2498 43.7334 40.2276 43.7334ZM47.8352 37.2C49.2849 37.2 50.4602 35.7897 50.4602 34.05C50.4602 32.3103 49.2849 30.9 47.8352 30.9C46.3854 30.9 45.2102 32.3103 45.2102 34.05C45.2102 35.7897 46.3854 37.2 47.8352 37.2Z" fill="#ffffff" fill-opacity="0.15"/>\n</svg>\n',"image/svg+xml").firstChild}var LangTextKey=(e=>(e.NETWORK="NETWORK",e.NETWORK_TIMEOUT="NETWORK_TIMEOUT",e.NETWORK_FORBIDDEN="NETWORK_FORBIDDEN",e.NETWORK_NOTFOUND="NETWORK_NOTFOUND",e.NETWORK_RANGE_NOT_SATISFIABLE="NETWORK_RANGE_NOT_SATISFIABLE",e.NETWORK_PROTOCOL="NETWORK_PROTOCOL",e.NETWORK_URL_EXPIRE="NETWORK_URL_EXPIRE",e.NETWORK_URL_SIGN="NETWORK_URL_SIGN",e.NETWORK_ENCRYPT_HLS_ERR="NETWORK_ENCRYPT_HLS_ERR",e.MEDIA_ERR="MEDIA_ERR",e.MEDIA_ERR_ABORTED="MEDIA_ERR_ABORTED",e.MEDIA_ERR_NETWORK="MEDIA_ERR_NETWORK",e.MEDIA_ERR_DECODE="MEDIA_ERR_DECODE",e.MEDIA_ERR_SRC_NOT_SUPPORTED="MEDIA_ERR_SRC_NOT_SUPPORTED",e.MEDIA_ERR_NOT_SUPPORTED="MEDIA_ERR_NOT_SUPPORTED",e.MEDIA_ERR_URL_EMPTY="MEDIA_ERR_URL_EMPTY",e.MEDIA_ERR_FILE_NOT_SUPPORTED="MEDIA_ERR_FILE_NOT_SUPPORTED",e.MEDIA_ERR_PLAY_ERR="MEDIA_ERR_PLAY_ERR",e.MEDIA_SOURCE_CANNOT_PLAY_TYPE="MEDIA_SOURCE_CANNOT_PLAY_TYPE",e.BUSINESS_DRM_NOT_SUPPORT="BUSINESS_DRM_NOT_SUPPORT",e.BUSINESS_DRM_NOT_SUPPORT_UN_RECORD="BUSINESS_DRM_NOT_SUPPORT_UN_RECORD",e.BUSINESS_DRM_LACK_MEDIA_KEY="BUSINESS_DRM_LACK_MEDIA_KEY",e.BUSINESS_DRM_LACK_KEY_SESSION="BUSINESS_DRM_LACK_KEY_SESSION",e.BUSINESS_DRM_GENERATE_REQUEST_FAIL="BUSINESS_DRM_GENERATE_REQUEST_FAIL",e.BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH="BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH",e.BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH="BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH",e.BUSINESS_DRM_LICENSE_FAIL="BUSINESS_DRM_LICENSE_FAIL",e.BUSINESS_DRM_KEY_ERROR="BUSINESS_DRM_KEY_ERROR",e.BUSINESS_DRM_CERT_FAIL="BUSINESS_DRM_CERT_FAIL",e.PRIVATE_DRM_KEY_GET_FAILED="PRIVATE_DRM_KEY_GET_FAILED",e.PRIVATE_DRM_CRYPTO_NOT_SUPPORT="PRIVATE_DRM_CRYPTO_NOT_SUPPORT",e.PRIVATE_DRM_RSA_FAIL="PRIVATE_DRM_RSA_FAIL",e.OTHER="OTHER",e.VOD_LOG_NOT_CONFIGURED="VOD_LOG_NOT_CONFIGURED",e.PLAY_AUTH_TOKEN_EXPIRED="PLAY_AUTH_TOKEN_EXPIRED",e.HLS_KEY_TOKEN_EXPIRED="HLS_KEY_TOKEN_EXPIRED",e.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED="THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED",e.GET_PLAY_INFO_ERR="GET_PLAY_INFO_ERR",e.GET_HLS_DECRYPTION_KEY_ERR="GET_HLS_DECRYPTION_KEY_ERR",e.LICENSE_VALIDATE_FAIL="LICENSE_VALIDATE_FAIL",e.DEFINITION_AUTO="DEFINITION_AUTO",e.LICENSE_STATUS_INVALID="LICENSE_STATUS_INVALID",e.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH="LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH",e.BASE_LICENSE_NOT_SUPPORT_265="BASE_LICENSE_NOT_SUPPORT_265",e.BASE_LICENSE_NOT_SUPPORT_ABR="BASE_LICENSE_NOT_SUPPORT_ABR",e.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER="BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER",e.BASE_LICENSE_NOT_SUPPORT_PRELOAD="BASE_LICENSE_NOT_SUPPORT_PRELOAD",e.EXPIRED_LICENSE_NOT_SUPPORT_265="EXPIRED_LICENSE_NOT_SUPPORT_265",e.EXPIRED_LICENSE_NOT_SUPPORT_ABR="EXPIRED_LICENSE_NOT_SUPPORT_ABR",e.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER="EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER",e.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD="EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD",e.DRAMA_INVALID_PARAM="DRAMA_INVALID_PARAM",e.DRAMA_NO_INFO_FOUND="DRAMA_NO_INFO_FOUND",e.DRAMA_NOT_SUBMITTED="DRAMA_NOT_SUBMITTED",e.DRAMA_UNDER_REVIEW="DRAMA_UNDER_REVIEW",e.DRAMA_FAILED_REVIEW="DRAMA_FAILED_REVIEW",e.DRAMA_WITHDRAWN_REVIEW="DRAMA_WITHDRAWN_REVIEW",e.DRAMA_FAILED_TO_QUERY="DRAMA_FAILED_TO_QUERY",e.DRAMA_INVALID_TTOP_TOKEN="DRAMA_INVALID_TTOP_TOKEN",e.DRAMA_NOT_ON_SHELF="DRAMA_NOT_ON_SHELF",e.DRAMA_FAILED_GET_EPISODE_INFO="DRAMA_FAILED_GET_EPISODE_INFO",e))(LangTextKey||{});const veErrorCodeMap={NETWORK:{code:2100,message:"Network error",textKey:LangTextKey.NETWORK},NETWORK_TIMEOUT:{code:2101,message:"Network timeout",textKey:LangTextKey.NETWORK_TIMEOUT},NETWORK_FORBIDDEN:{code:2103,message:"Block access to this media",textKey:LangTextKey.NETWORK_FORBIDDEN},NETWORK_NOTFOUND:{code:2104,message:"Media not found",textKey:LangTextKey.NETWORK_NOTFOUND},NETWORK_RANGE_NOT_SATISFIABLE:{code:2116,message:"Media fetch range not satisfiable",textKey:LangTextKey.NETWORK_RANGE_NOT_SATISFIABLE},NETWORK_PROTOCOL:{code:2190,message:"The current page protocol is https, but video url protocol is http",textKey:LangTextKey.NETWORK_PROTOCOL},NETWORK_URL_EXPIRE:{code:2191,message:"Media url has expired",textKey:LangTextKey.NETWORK_URL_EXPIRE},NETWORK_URL_SIGN:{code:2192,message:"Media url signature parameter error",textKey:LangTextKey.NETWORK_URL_SIGN},NETWORK_ENCRYPT_HLS_ERR:{code:2193,message:"Get m3u8 file or encrypt key fail",textKey:LangTextKey.NETWORK_ENCRYPT_HLS_ERR},MEDIA_ERR_ABORTED:{code:5101,message:"User or browser abort the media",textKey:LangTextKey.NETWORK_URL_SIGN},MEDIA_ERR_NETWORK:{code:5102,message:"Network error",textKey:LangTextKey.MEDIA_ERR_NETWORK},MEDIA_ERR_DECODE:{code:5103,message:"Media decode error",textKey:LangTextKey.MEDIA_ERR_DECODE},MEDIA_ERR_SRC_NOT_SUPPORTED:{code:5104,message:"Media is not supported or url is not available",textKey:LangTextKey.MEDIA_ERR_SRC_NOT_SUPPORTED},MEDIA_ERR_NOT_SUPPORTED:{code:5105,message:"Media not support play",textKey:LangTextKey.MEDIA_ERR_NOT_SUPPORTED},MEDIA_ERR_URL_EMPTY:{code:5106,message:"Media url empty",textKey:LangTextKey.MEDIA_ERR_URL_EMPTY},MEDIA_ERR_FILE_NOT_SUPPORTED:{code:5901,message:"Media file not supported",textKey:LangTextKey.MEDIA_ERR_FILE_NOT_SUPPORTED},MEDIA_ERR_PLAY_ERR:{code:5902,message:"Media play error",textKey:LangTextKey.MEDIA_ERR_PLAY_ERR},BUSINESS_DRM_NOT_SUPPORT:{code:7101,message:"DRM encrypted playback is not supported",textKey:LangTextKey.BUSINESS_DRM_NOT_SUPPORT},BUSINESS_DRM_NOT_SUPPORT_UN_RECORD:{code:7102,message:"Anti-screen recording is not supported",textKey:LangTextKey.BUSINESS_DRM_NOT_SUPPORT_UN_RECORD},BUSINESS_DRM_LACK_MEDIA_KEY:{code:7103,message:"The video data lacks the corresponding MediaKey",textKey:LangTextKey.BUSINESS_DRM_LACK_MEDIA_KEY},BUSINESS_DRM_LACK_KEY_SESSION:{code:7104,message:"The browser does not support the corresponding DRM KeySession",textKey:LangTextKey.BUSINESS_DRM_LACK_KEY_SESSION},BUSINESS_DRM_GENERATE_REQUEST_FAIL:{code:7105,message:"Decryption playback error",textKey:LangTextKey.BUSINESS_DRM_GENERATE_REQUEST_FAIL},BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH:{code:7106,message:"Missing DRM certificate request link",textKey:LangTextKey.BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH},BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH:{code:7107,message:"Missing DRM License request link",textKey:LangTextKey.BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH},BUSINESS_DRM_LICENSE_FAIL:{code:7108,message:"Failed to request or update a license",textKey:LangTextKey.BUSINESS_DRM_LICENSE_FAIL},BUSINESS_DRM_KEY_ERROR:{code:7109,message:"Decryption Error",textKey:LangTextKey.BUSINESS_DRM_KEY_ERROR},BUSINESS_DRM_CERT_FAIL:{code:7110,message:"Failed to request DRM certificate",textKey:LangTextKey.BUSINESS_DRM_CERT_FAIL},PRIVATE_DRM_GET_KEY_FAILED:{code:7200,message:"Private DRM key get failed",textKey:LangTextKey.PRIVATE_DRM_KEY_GET_FAILED},PRIVATE_DRM_CRYPTO_NOT_SUPPORT:{code:7201,message:"Web cryptography API is not supported",textKey:LangTextKey.PRIVATE_DRM_CRYPTO_NOT_SUPPORT},PRIVATE_DRM_RSA_FAIL:{code:7202,message:"Decryption by RSA-OAEP failed",textKey:LangTextKey.PRIVATE_DRM_RSA_FAIL},OTHER:{code:8e3,message:"Other error",textKey:LangTextKey.OTHER},VOD_LOG_NOT_CONFIGURED:{code:8999,message:"Log options not configured correctly",textKey:LangTextKey.VOD_LOG_NOT_CONFIGURED},PLAY_AUTH_TOKEN_EXPIRED:{code:10001,message:"playAuthToken has expired",textKey:LangTextKey.PLAY_AUTH_TOKEN_EXPIRED},HLS_KEY_TOKEN_EXPIRED:{code:10003,message:"keyToken has expired",textKey:LangTextKey.HLS_KEY_TOKEN_EXPIRED},THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED:{code:10003,message:"thirdPartyDrmAuthToken has expired",textKey:LangTextKey.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED},GET_PLAY_INFO_ERR:{code:11001,message:"Failed to get play info",textKey:LangTextKey.GET_PLAY_INFO_ERR},GET_HLS_DECRYPTION_KEY_ERR:{code:11002,message:"Failed to get the HLS decryption key",textKey:LangTextKey.GET_HLS_DECRYPTION_KEY_ERR},LICENSE_STATUS_INVALID:{code:12001,message:"License validation is invalid",textKey:LangTextKey.LICENSE_STATUS_INVALID},LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH:{code:12002,message:"License domain name does not match",textKey:LangTextKey.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH}},veWarningCodeMap={BASE_LICENSE_NOT_SUPPORT_265:{type:"ERROR_LICENSE_EDITION_NEED_UPLOAD",code:12111,message:"The basic license does not support H265",textKey:LangTextKey.BASE_LICENSE_NOT_SUPPORT_265},BASE_LICENSE_NOT_SUPPORT_ABR:{type:"ERROR_LICENSE_EDITION_NEED_UPLOAD",code:12112,message:"The basic license does not support ABR",textKey:LangTextKey.BASE_LICENSE_NOT_SUPPORT_ABR},BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER:{type:"ERROR_LICENSE_EDITION_NEED_UPLOAD",code:12113,message:"The basic license does not support dynamic buffer",textKey:LangTextKey.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER},BASE_LICENSE_NOT_SUPPORT_PRELOAD:{type:"ERROR_LICENSE_EDITION_NEED_UPLOAD",code:12114,message:"The basic license does not support preload",textKey:LangTextKey.BASE_LICENSE_NOT_SUPPORT_PRELOAD},EXPIRED_LICENSE_NOT_SUPPORT_265:{type:"ERROR_LICENSE_HAS_EXPIRED",code:12211,message:"Expired license does not support H265",textKey:LangTextKey.EXPIRED_LICENSE_NOT_SUPPORT_265},EXPIRED_LICENSE_NOT_SUPPORT_ABR:{type:"ERROR_LICENSE_HAS_EXPIRED",code:12212,message:"Expired license does not support ABR",textKey:LangTextKey.EXPIRED_LICENSE_NOT_SUPPORT_ABR},EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER:{type:"ERROR_LICENSE_HAS_EXPIRED",code:12213,message:"The expired license does not support dynamic buffer",textKey:LangTextKey.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER},EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD:{type:"ERROR_LICENSE_HAS_EXPIRED",code:12214,message:"Expired license does not support preloading",textKey:LangTextKey.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD}},getErrorKeyByCode=e=>{for(const[t,{code:i,textKey:r}]of Object.entries(veErrorCodeMap))if(i===e)return r};var VE_ERROR_TYPE_MAP=(e=>(e[e.manifest=1]="manifest",e[e.network=2]="network",e[e.demux=3]="demux",e[e.remux=4]="remux",e[e.media=5]="media",e[e.decoder=6]="decoder",e[e.drm=7]="drm",e[e.other=8]="other",e[e.runtime=9]="runtime",e[e.token=10]="token",e[e.serve=11]="serve",e[e.license=12]="license",e[e.ad=13]="ad",e))(VE_ERROR_TYPE_MAP||{});const DRAMA_ERROR_CODE={INVALID_PARAM:{code:9301,message:"Invalid parameter in short drama environment",textKey:LangTextKey.DRAMA_INVALID_PARAM},NO_INFO_FOUND:{code:9302,message:"No information found for this Episode",textKey:LangTextKey.DRAMA_NO_INFO_FOUND},NOT_SUBMITTED:{code:9303,message:"Episode not submitted for review",textKey:LangTextKey.DRAMA_NOT_SUBMITTED},UNDER_REVIEW:{code:9304,message:"Episode under for review",textKey:LangTextKey.DRAMA_UNDER_REVIEW},FAILED_REVIEW:{code:9305,message:"Episode failed review",textKey:LangTextKey.DRAMA_FAILED_REVIEW},WITHDRAWN_REVIEW:{code:9306,message:"Episode withdrawn from review",textKey:LangTextKey.DRAMA_WITHDRAWN_REVIEW},FAILED_TO_QUERY:{code:9307,message:"Failed to query video playback information",textKey:LangTextKey.DRAMA_FAILED_TO_QUERY},INVALID_TTOP_TOKEN:{code:9308,message:"Invalid playAuthToken or failed to verify TTOP token",textKey:LangTextKey.DRAMA_INVALID_TTOP_TOKEN},NOT_ON_SHELF:{code:9310,message:"Video is not on shelf",textKey:LangTextKey.DRAMA_NOT_ON_SHELF},FAILED_GET_EPISODE_INFO:{code:9399,message:"Failed get episode info",textKey:LangTextKey.DRAMA_FAILED_GET_EPISODE_INFO}};function getDramaErrorKeyByCode(e){for(const t of Object.values(DRAMA_ERROR_CODE))if(t.code===e)return t.textKey}const REVIEW_STATUS={SUCCESS:0,NOT_SUBMITTED:1,UNDER_REVIEW:2,FAILED_REVIEW:3,WITHDRAWN:4,NOT_ON_SHELF:5},DEFAULT_APP_ID=1002305;function mapPlayerMethod(e,t){return{errorHandler(i,r){var n;VE_DEBUG.log("errorHandler, err: ",r);const o=e;if(o.media&&(o.media.error||r)){let e=o.media.error||r;const a=e.code?ERROR_TYPE_MAP[e.code]:"other";let s=e.message;"xg-video"===(null==(n=null==o?void 0:o.config)?void 0:n.mediaType)||o.media.currentSrc||o.media.srcObject||(s="empty_src",e={code:6,message:s}),o.emit(i,t.createVeError({errorType:a,errorCode:e.code,errorMessage:e.message||"",mediaError:e,veError:r.veError,originError:r}))}}}}class EventMiddleware{constructor(){this.actions={}}addMiddleware(e,t){this.actions[e]?this.actions[e].push(t):this.actions[e]=[t]}removeMiddleware(e,t){const i=this.actions[e]||[],r=i.findIndex((e=>e===t));r>-1&&(i.splice(r,1),this.actions[e]=i)}removeAllMiddlewareByKey(e){this.actions[e]=[]}removeAllMiddleware(){this.actions={}}applyMiddleware(e){const t=this;return function(i,r){return __async(this,null,(function*(){const{eventName:n}=i,o=t.actions[e]||[],a=[];o.forEach((e=>{try{const t=e(i);a.push(retPromise$1(t))}catch(e){throw a.push(retPromise$1(null)),e}})),Promise.all([...a]).then((e=>{e.every((e=>!e))&&r(n,i)})).catch((e=>{VE_DEBUG.error(e),r(n,e)}))}))}}}const ErrorAnalysingClass="xgplayer-error-analysing",ErrorRetryingClass="xgplayer-error-retrying",VE_ERROR_EVENT="ve_error",ERROR_MAP={1:5101,2:5102,3:5103,4:5104,5:5105,6:5106},MEDIA_ERROR_TYPE_MAP={1:"media",2:"media",3:"media",4:"media",5:"media",6:"media"},PROTOCOL={HTTP:"http:",HTTPS:"https:"};let _errorHandler=null;function isProtocolError(e){var t;const i=null==(t=null==window?void 0:window.location)?void 0:t.protocol;if(e.startsWith(PROTOCOL.HTTP)&&i===PROTOCOL.HTTPS){if(new URL(e).protocol===PROTOCOL.HTTP)return VeError.getVeErrorInfo(veErrorCodeMap.NETWORK_PROTOCOL)}}class VeError{constructor(e,t){this.retryTimestamps=[],this.totalRetryCount=0,this.retrying=!1,this.retryTimer=null,this.userInvokedPlay=!1,this._playIntentHook=()=>{this.userInvokedPlay=!0},this._onError=e=>__async(this,null,(function*(){var t;this.player.addClass(ErrorAnalysingClass);const i=yield this.transformToVeError(e);this.player.veError=i,VE_DEBUG.error("error: ",i),this.player.removeClass(ErrorAnalysingClass),(null==(t=this.config.ignoreErrorCodes)?void 0:t.includes(null==i?void 0:i.veErrorCode))?VE_DEBUG.log("ignore errorCode",null==i?void 0:i.veErrorCode):this.player.emit("ve_error",i)})),this.player=e,this.config={},t&&Object.keys(VeError.defaultConfig).forEach((e=>{void 0===t[e]?this.config[e]=VeError.defaultConfig[e]:this.config[e]=t[e]})),this.init()}static get defaultConfig(){return{oriErrRetryCount:3,oriErrRetryCycle:1e4,oriErrRetryBaseDelay:500,oriErrMaxTotalRetry:0,enableOriErrRetry:!0,needSyncAnalyzeError:!0,analyzeTimeout:3e3,ignoreErrorCodes:[]}}createVeError(e={}){var t,i;const{errorType:r,errorCode:n=0,errorMessage:o="",originError:a="",ext:s={},mediaError:l=null}=e,c=(null==(i=null==(t=this.player)?void 0:t.i18n)?void 0:i.ERROR_TYPES)||{},u=this.player.media;if(u){const t=l||u.error||{},{duration:i,currentTime:c,ended:d,src:h,currentSrc:p}=this.player,{readyState:f,networkState:g}=u;let y=n||t.code;ERROR_MAP[y]&&(y=ERROR_MAP[y]);const{code:_,message:m,textKey:v}=e.veError||{},E=o||t.message,T=_||y,S=VeError.getErrorType(e),P=m||E,C=v||getErrorKeyByCode(T)||getDramaErrorKeyByCode(T),b=this.player.i18n[C]||P||this.player.i18n[LangTextKey.MEDIA_ERR]||"unknown error";return{playerVersion:"1.18.0-rc.6",currentTime:c,duration:i,ended:d,readyState:f,networkState:g,src:h||p,errorType:r,errorCode:y,httpCode:e.httpCode,message:E,mediaError:t,originError:a?a.stack:"",host:util.getHostFromUrl(h||p),veErrorCode:T,veErrorType:S,veErrorMessage:P,displayMessage:b,videoInfo:{isMSE:isMSE(this.player),vtype:this.player.url?this.player.vtype:"",drmEncryptType:getDrmType(this.player)||"",vid:this.player.config.vid},ext:s}}if(arguments.length>1){const e={playerVersion:"1.18.0-rc.6",domain:document.domain,ex:null},t=["errorType","currentTime","duration","networkState","readyState","src","currentSrc","ended","errd","errorCode","mediaError"];for(let i=0;i<arguments.length;i++)e[t[i]]=arguments[i];return e.ex=c?(c[arguments[0]]||{}).msg:"",e}}static getErrorType(e){const{veError:t,mediaError:i}=e||{},r=t||(null==i?void 0:i.veError);if(null==r?void 0:r.code){const e=r.code+"";return r.code>=1e4?VE_ERROR_TYPE_MAP[e.slice(0,2)]:VE_ERROR_TYPE_MAP[e.slice(0,1)]}if(null==i?void 0:i.code)return MEDIA_ERROR_TYPE_MAP[i.code]||"other"}static getVeErrorInfo(e,t){const{code:i,message:r,textKey:n}=e;return{code:i,message:t||r,textKey:n}}init(){_errorHandler||(_errorHandler=this.player.errorHandler),defineMethod(this.player,mapPlayerMethod(this.player,this)),this.setErrorEventMiddleWare(),this.player.on(ERROR$1,this._onError),this.player.useHooks("play",this._playIntentHook)}destroy(){this.player.off(ERROR$1,this._onError),this.player.removeHooks("play",this._playIntentHook),this.retryTimer&&(clearTimeout(this.retryTimer),this.retryTimer=null,this.retrying=!1,this.player.removeClass(ErrorRetryingClass))}shouldOriRetryReloadOnly(){var e;if(this.userInvokedPlay)return!1;const t=this.player.config;if(!t||t.autoplay||t.autoplayMuted)return!1;const i=this.player.media;return!!i&&0===(null==(e=i.played)?void 0:e.length)}setErrorEventMiddleWare(){this.eventMiddleware=new EventMiddleware,this.eventMiddleware.addMiddleware(ERROR$1,this.defaultErrorMiddleWare.bind(this)),this.player.setEventsMiddleware({error:this.eventMiddleware.applyMiddleware(ERROR$1)})}defaultErrorMiddleWare(e){return __async(this,null,(function*(){var t,i;if(!util.isMSE(this.player.media)){const{error:r}=e||{};if(!r)return VE_DEBUG.error("invalid media error: ",e),!1;const{code:n}=r||{};if((2===n||3===n||4===n)&&(null==(i=null==(t=this.player)?void 0:t.config)?void 0:i.url)){const t=Date.now();this.retryTimestamps=this.retryTimestamps.filter((e=>t-e<=this.config.oriErrRetryCycle));const{oriErrRetryCount:i,oriErrMaxTotalRetry:r}=this.config,o=r>0&&this.totalRetryCount>=r,a=this.retryTimestamps.length>=i,s=!1!==this.config.enableOriErrRetry;if(s&&!o&&!a)return this.oriVideoRetry(!this.shouldOriRetryReloadOnly());if(s&&(o?VE_DEBUG.warn(`max total retry count ${r} reached, stop retrying`):VE_DEBUG.warn(`retry count in window ${this.config.oriErrRetryCycle}ms reached ${i}, stop retrying`)),3===n)this.config.needSyncAnalyzeError&&(yield this.analyseStream());else{const t=getDetectUrl(getPlayerCurrentUrl(this.player));if(t){const i=isProtocolError(t);if(i)return e.error.veError=i,!1;this.config.needSyncAnalyzeError&&(e.error.veError=yield this.analyseNet(t,e.error,this.config.analyzeTimeout))}}}}return!1}))}oriVideoRetry(e=!0){if(this.retrying)return!0;this.retrying=!0;const t=this.config.oriErrRetryBaseDelay*Math.pow(2,this.retryTimestamps.length);return VE_DEBUG.warn(`origin video play error, retry in ${t}ms (window: ${this.retryTimestamps.length+1}/${this.config.oriErrRetryCount}, total: ${this.totalRetryCount+1})`),this.player.addClass(ErrorRetryingClass),clearTimeout(this.retryTimer),this.retryTimer=setTimeout((()=>{this.retryTimestamps.push(Date.now()),this.totalRetryCount++,e?this.player.retry():this.oriVideoReloadWithoutPlay(),this.player.removeClass(ErrorRetryingClass),this.retrying=!1}),t),!0}oriVideoReloadWithoutPlay(){const e=this.player;e.removeClass("xgplayer-is-error"),e.addClass("xgplayer-isloading"),e.runHooks("retry",(()=>{const t=e.currentTime,i="string"==typeof e.config.url?e.config.url:"",r=util.isMSE(e.media)?{url:i}:e.preProcessUrl(i);e.src=r.url,e.config.isLive||(e.currentTime=t)}))}analyseNet(e,t,i){return __async(this,null,(function*(){const r=t.code||t.errorCode,n=t.message||t.errorMessage||t.msg;try{const t=yield getXhr$1(e,{range:"0-8",timeout:i});VE_DEBUG.log("xhr result",t);const{status:o,response:a}=t;if(403===o){if("string"==typeof a){if(a.includes("expire"))return VeError.getVeErrorInfo(veErrorCodeMap.NETWORK_URL_EXPIRE);if(a.includes("sign"))return VeError.getVeErrorInfo(veErrorCodeMap.NETWORK_URL_SIGN)}return VeError.getVeErrorInfo(veErrorCodeMap.NETWORK_FORBIDDEN)}if(416===o)return VeError.getVeErrorInfo(veErrorCodeMap.NETWORK_RANGE_NOT_SATISFIABLE);if(404===o)return VeError.getVeErrorInfo(veErrorCodeMap.NETWORK_NOTFOUND);if(o===XHRCustomStatus.TIMEOUT)return VeError.getVeErrorInfo(veErrorCodeMap.NETWORK_TIMEOUT);if(o===XHRCustomStatus.ERROR)return VeError.getVeErrorInfo(veErrorCodeMap.NETWORK,n);if(200===o||206===o){if(4===r)return n?VeError.getVeErrorInfo(veErrorCodeMap.MEDIA_ERR_PLAY_ERR,n):VeError.getVeErrorInfo(veErrorCodeMap.MEDIA_ERR_FILE_NOT_SUPPORTED);if(3===r)return VeError.getVeErrorInfo(veErrorCodeMap.MEDIA_ERR_DECODE,n);if(2===r)return VeError.getVeErrorInfo(veErrorCodeMap.MEDIA_ERR_NETWORK,n);if(1===r)return VeError.getVeErrorInfo(veErrorCodeMap.MEDIA_ERR_ABORTED,n);if(-9996===r){return getDrmType(this.player)===EDRMTYPE.PRIVATE_ENCRYPT_UPGRADE?VeError.getVeErrorInfo(veErrorCodeMap.PRIVATE_DRM_GET_KEY_FAILED):VeError.getVeErrorInfo(veErrorCodeMap.GET_HLS_DECRYPTION_KEY_ERR)}}return}catch(e){return VE_DEBUG.warn("Failed to analyze the network. If the domain of the video address has been configured with CORS, it means that the playback error is caused by the failure of the video request. If the domain of the video address is not configured with CORS, the real reason for the playback error cannot be determined because the video request cannot be analyzed."),VeError.getVeErrorInfo(veErrorCodeMap.NETWORK)}}))}analyseStream(){return __async(this,null,(function*(){}))}handle2100Error(e){return __async(this,arguments,(function*({error:e,errorCode:t,httpCode:i,response:r,finalMessage:n}){const o={errorType:VE_ERROR_TYPE_MAP.network,errorCode:t,httpCode:i,errorMessage:n,originError:e};if(i){if(404===i)o.veError=VeError.getVeErrorInfo(veErrorCodeMap.NETWORK_NOTFOUND);else if(416===i)o.veError=VeError.getVeErrorInfo(veErrorCodeMap.NETWORK_RANGE_NOT_SATISFIABLE);else if(403===i){try{const e=yield getResponseText(r);if("string"==typeof e)return e.includes("expire")?o.veError=VeError.getVeErrorInfo(veErrorCodeMap.NETWORK_URL_EXPIRE):e.includes("sign")?o.veError=VeError.getVeErrorInfo(veErrorCodeMap.NETWORK_URL_SIGN):o.veError=VeError.getVeErrorInfo(veErrorCodeMap.NETWORK_FORBIDDEN),this.createVeError(o)}catch(e){VE_DEBUG.warn("get response text error")}return o.veError=VeError.getVeErrorInfo(veErrorCodeMap.NETWORK_FORBIDDEN),this.createVeError(o)}}else{const e=getDetectUrl(getPlayerCurrentUrl(this.player));if(e){const t=isProtocolError(e);t&&(o.veError=t)}}return this.createVeError(o)}))}handle9991Error({error:e,errorCode:t,httpCode:i,finalMessage:r}){return this.createVeError({errorType:VE_ERROR_TYPE_MAP.serve,errorCode:t||veErrorCodeMap.OTHER.code,httpCode:i,errorMessage:r,originError:e,veError:VeError.getVeErrorInfo(veErrorCodeMap.GET_HLS_DECRYPTION_KEY_ERR)})}handleNetError(e){return __async(this,arguments,(function*({error:e,errorCode:t,httpCode:i,finalMessage:r}){try{const n=getDetectUrl(getPlayerCurrentUrl(this.player)),o=yield this.analyseNet(n,e,3e3);return o?this.createVeError({errorType:VE_ERROR_TYPE_MAP.network,errorCode:t||veErrorCodeMap.OTHER.code,httpCode:i,errorMessage:r,originError:e,veError:o}):this.createVeError({errorCode:t||veErrorCodeMap.NETWORK_ENCRYPT_HLS_ERR.code,httpCode:i,errorMessage:r,originError:e,veError:VeError.getVeErrorInfo(veErrorCodeMap.NETWORK_ENCRYPT_HLS_ERR)})}catch(n){return VE_DEBUG.warn("analyse fail of the net error of encrypt hls m3u8 file"),this.createVeError({errorCode:t||veErrorCodeMap.NETWORK_ENCRYPT_HLS_ERR.code,httpCode:i,errorMessage:r,originError:e,veError:VeError.getVeErrorInfo(veErrorCodeMap.NETWORK_ENCRYPT_HLS_ERR)})}}))}handleStuckError({error:e,errorCode:t,httpCode:i,finalMessage:r}){const n={errorType:VE_ERROR_TYPE_MAP.network,errorCode:t,httpCode:i,errorMessage:r,originError:e},{currentTime:o,duration:a,buffered:s}=this.player,l=!s||0===s.length||!a,c=this.player.checkBuffer(o,{startDiff:0,endDiff:.1});if(l||!c)return n.veError=VeError.getVeErrorInfo(veErrorCodeMap.NETWORK),this.createVeError(n);this.createVeError(n)}transformToVeError(e){return __async(this,null,(function*(){if((null==e?void 0:e.veErrorCode)&&!this.player.getPlugin("Mp4EncryptPlayer"))return e;const{httpCode:t,errorMessage:i,message:r,msg:n,response:o}=e||{},a=(null==e?void 0:e.code)||(null==e?void 0:e.errorCode),s=i||r||("string"==typeof n?n:"other error");if(2100===a)return this.handle2100Error({error:e,errorCode:a,httpCode:t,response:o,finalMessage:s});if(-9991===a)this.handle9991Error({error:e,errorCode:a,httpCode:t,finalMessage:s});else{if([2103,5104,5102].includes(a)&&this.player.getPlugin("Mp4EncryptPlayer")||-9996===a&&this.player.getPlugin("EncryptHlsPlugin"))return this.handleNetError({error:e,errorCode:a,httpCode:t,finalMessage:s});if([9002,9003].includes(a))return this.handleStuckError({error:e,errorCode:a,httpCode:t,finalMessage:s})}return this.createVeError(__spreadValues({errorCode:a||veErrorCodeMap.OTHER.code,httpCode:t,errorMessage:s,originError:e},e||{}))}))}}const index$2="";function showToast(e,t=1e3){const i=document.createElement("div");i.className="veplayer-toast",i.textContent=e,document.body.appendChild(i),setTimeout((()=>i.classList.add("show")),10),setTimeout((()=>{i.classList.remove("show"),setTimeout((()=>null==i?void 0:i.remove()),300)}),t)}const DRAMA_ERROR_CODES=new Set(Object.values(DRAMA_ERROR_CODE).map((e=>e.code)));let ErrorPlugin$1=class extends Plugin{constructor(e){super(e),this._errDetailList=[],this._errorDomMode=null,this.state={showError:!1,retryTimes:0,idx:0},this.handleError=e=>__async(this,null,(function*(){this.isVodLogConError=(null==e?void 0:e.errorCode)===veErrorCodeMap.VOD_LOG_NOT_CONFIGURED.code,this.player&&this.player.pause(),this.config.isNeedDemoteBack?(this.state.showError=!1,this.changeMainOrBackup()):this.state.showError=!0,this.renderError(e)})),this.handleEnd=()=>{},this.handleRefreshClick=()=>{var e,t;null==(e=this.player)||e.emit(PluginEvents.PLAY_ERROR_BUTTON_CLICK),this.player.removeClass(STATE_CLASS.PAUSED),this.closeError(),null==(t=this.player)||t.retry()},this.closeError=()=>{this.state.showError&&(this.state.showError=!1,this.renderError())},this.playerData=e.player.config.playerData}static get pluginName(){return"sdkErrorPlugin"}static get defaultConfig(){return{showError:!0,errorImg:!0,errorTips:!0,isNeedRefreshButton:!0,isNeedCopyButton:!0,isNeedDemoteBack:!1,retryLoopNum:1,errorTipsText:null,position:Plugin.POSITIONS.ROOT}}afterCreate(){var e,t,i;this.initEvents();const r=Object.values(veErrorCodeMap).reduce(((e,t)=>{const{code:i,textKey:r}=t;return e[i]=this.i18n[r],e}),{});this.errNoteMap=__spreadValues({other:null!=(i=null==(t=null==(e=this.i18n.ERROR_TYPES)?void 0:e.other)?void 0:t.msg)?i:"error",1:this.i18n.MEDIA_ERR_ABORTED,2:this.i18n.MEDIA_ERR_NETWORK,3:this.i18n.MEDIA_ERR_DECODE},r)}registerLanguageTexts(){return{clickButton:{jp:"リフレッシュ",en:"Refresh",zh:"刷新","zh-hk":"刷新"},errorTips:{jp:"再生中にエラーが発生しました。[更新]をクリックして試してください",en:"An error occurred while playing, click refresh to try",zh:"播放发生错误,点击刷新试试吧","zh-hk":"播放發生錯誤,點擊刷新試試吧"},errorCode:{jp:"コード",en:"code",zh:"错误码","zh-hk":"錯誤碼"},did:{jp:"デバイスID",en:"deviceID",zh:"设备 ID","zh-hk":"設備 ID"},playTime:{jp:"遊び時間",en:"playTime",zh:"播放时间","zh-hk":"播放時間"},copyError:{jp:"コピーエラー",en:"Copy error",zh:"复制错误信息","zh-hk":"複製錯誤訊息"},copySuccess:{jp:"コピー成功",en:"Copy success",zh:"复制成功","zh-hk":"複製成功"}}}registerIcons(){return{errorImg:{icon:ErrorSvg,class:"xgplayer-error-svg"}}}updateLang(){var e,t;if(!this.$errorDom)return;const i=this.$errorDom.querySelector(".xgplayer-error-tips");if(i){const r=null!=(t=null==(e=this.config.errorTipsText)?void 0:e[this.lang])?t:this.langText.errorTips;i.innerHTML=r}const r=this.$errorDom.querySelector(".xgplayer-error-button");r&&(r.innerHTML=this.langText.clickButton)}initEvents(){this.player.on("ve_error",this.handleError),this.on(CANPLAY,this.closeError),this.on(PLAYING,this.closeError)}getRetryList(){var e;const t=this.playerData.getCurrentStreams()[0];return[null==t?void 0:t.url,...null!=(e=null==t?void 0:t.backUrlList)?e:[]]}changeMainOrBackup(){this.player.addClass(STATE_CLASS.ENTER);const e=this.getRetryList(),t=this.config.retryLoopNum*e.length,i=(e.indexOf(this.player.config.url)+1)%e.length;this.state.idx=i;const r=e[i];if(!r||this.state.retryTimes===t)return this.player.removeClass(STATE_CLASS.ENTER),this.state.retryTimes===t&&this.player.emit(PluginEvents.PLAY_BACKUP_CHANGE_FINISH),this.state.showError=!0,this.renderError(),void this.resetTimes();this.player.once("canplay",(()=>{this.state.retryTimes=0})),VE_DEBUG.log(`retry times: ${this.state.retryTimes}`,r),this.player.emit(PluginEvents.PLAY_BACKUP_CHANGE,{currentUrl:this.player.config.url,nextUrl:r,retryTimes:this.state.retryTimes}),this.changeUrl(r),this.state.retryTimes=this.state.retryTimes+1}changeUrl(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})}resetTimes(){this.state.retryTimes=0,this.state.idx=0}renderError(e){if(!this.config.showError)return;const t=this.root;t&&(t.innerHTML="",t.style.display="none",(this.state.showError||this.isVodLogConError)&&(this.player.emit(PluginEvents.SHOW_PLAY_ERROR),t.style.display="block",t.appendChild(this.getErrorDom(e))),this.isVodLogConError&&(this.player.blur(),this.player.pause()))}addErrDetail(e){Array.isArray(e)?this._errDetailList=[...this._errDetailList,...e]:this._errDetailList.push(e)}getErrorInfo(e){var t,i,r,n,o;const a=e.veErrorCode||e.errorCode,s=null==(t=this.player)?void 0:t.vodLogger,l=(null==(o=null==(n=null==(r=null==(i=null==s?void 0:s.tracker)?void 0:i.getConfig)?void 0:r.call(i))?void 0:n.user)?void 0:o.user_unique_id)||(null==s?void 0:s.line_user_id);return{code:a,appId:null==s?void 0:s.line_app_id,did:l||"unknown",playTime:dayjs().format("YYYY-MM-DD HH:mm:ss")}}getErrorInfoDom(e){const{code:t,did:i,playTime:r}=this.getErrorInfo(e),n=util.createDom("div","",void 0,"xgplayer-error-info-wrap"),o=`<p class="xgplayer-error-info-p">\n <span class="xgplayer-error-info-title">${this.langText.errorCode||"code"}</span>\n <span class="xgplayer-error-info-content">${t}</span>\n </p>`;n.appendChild(util.createDomFromHtml(o));const a=`<p class="xgplayer-error-info-p">\n <span class="xgplayer-error-info-title">${this.langText.did||"deviceID"}</span>\n <span class="xgplayer-error-info-content">${i}</span>\n </p>`;n.appendChild(util.createDomFromHtml(a));const s=`<p class="xgplayer-error-info-p">\n <span class="xgplayer-error-info-title">${this.langText.playTime||"playTime"}</span>\n <span class="xgplayer-error-info-content">${r}</span>\n </p>`;return n.appendChild(util.createDomFromHtml(s)),n}handleCopyBtnClick(e){const{did:t,playTime:i,appId:r}=this.getErrorInfo(e);try{const n=JSON.stringify(__spreadProps(__spreadValues({},e),{playTime:i,deviceID:t,appId:r}));navigator.clipboard.writeText(n).then((()=>{showToast(this.langText.copySuccess||"copySuccess")}))}catch(e){VE_DEBUG.error("copy error info err ",e)}}getActionDom(e){const t=e.errorType,i=util.createDomFromHtml('<div class="xgplayer-error-action-wrap"></div>'),r=!(t&&[VE_ERROR_TYPE_MAP[10],VE_ERROR_TYPE_MAP[11],VE_ERROR_TYPE_MAP[12]].includes(t));if(this.config.isNeedRefreshButton&&r){const e=util.createDom("div",this.langText.clickButton||"Refresh",void 0,"xgplayer-error-button refresh-button");this.bind(".refresh-button","click",this.handleRefreshClick),i.appendChild(e)}if(this.config.isNeedCopyButton){const t=util.createDom("div",this.langText.copyError||"CopyError",void 0,"xgplayer-error-button copy-button");this.bind(".copy-button","click",this.handleCopyBtnClick.bind(this,e)),i.appendChild(t)}return i}getErrorDom(e){var t,i,r,n,o,a;const{errorCode:s,message:l,displayMessage:c}=e,u=null!=(t=null==e?void 0:e.veErrorCode)?t:null==e?void 0:e.errorCode,d=!!VePlayer$1.ttDramaEnv,h="number"==typeof u&&DRAMA_ERROR_CODES.has(u);if("drama"===(d&&h?"drama":"normal")){if(!this.$errorDom){this.$errorDom=util.createDom("div","",void 0,"xgplayer-error-cover xgplayer-drama-error-cover");const e=util.createDom("div","Video isn't available",void 0,"xgplayer-drama-error-toast");this.$errorDom.appendChild(e),this.emit("sdkerrorplugin_render",this.$errorDom)}return this.$errorDom}if(!this.$errorDom){if(this.$errorDom=util.createDom("div","",void 0,"xgplayer-error-cover"),this.config.errorImg){const e=util.createDom("div","",void 0,"xgplayer-error-img");e.appendChild(this.icons.errorImg),this.$errorDom.appendChild(e)}if(this.config.errorTips){let t="";t=(null==(r=null==(i=this.config)?void 0:i.errorTipsText)?void 0:r[this.lang])?null==(n=this.config.errorTipsText)?void 0:n[this.lang]:e?c||this.errNoteMap[s]||this.player.errorNote&&this.i18n[this.player.errorNote]||l||this.errNoteMap.other||"error":this.langText.errorTips;const o=util.createDom("div",t,void 0,"xgplayer-error-tips");this.$errorDom.appendChild(o)}this.$errorDom.appendChild(this.getErrorInfoDom(e)),this.$errorDom.appendChild(this.getActionDom(e)),(null==(o=this._errDetailList)?void 0:o.length)&&(null==(a=this._errDetailList)||a.forEach((e=>{const t="function"==typeof e?e():e;if(t){const e=util.createDom("div",`${t.label}: ${t.value}`,void 0,"xgplayer-error-detail-info");this.$errorDom.appendChild(e)}}))),this.emit("sdkerrorplugin_render",this.$errorDom)}return this.$errorDom}destroy(){this.player.off(ERROR$1,this.handleError)}render(){return this.config.showError?'<xgplayer-error class="xgplayer-error"></xgplayer-error>':""}};const emptyPlugin=void 0,empty="";function ownKeys2(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,r)}return i}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ownKeys2(Object(i),!0).forEach((function(t){_defineProperty(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):ownKeys2(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,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 i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_toPropertyKey(r.key),r)}}function _createClass(e,t,i){return t&&_defineProperties(e.prototype,t),i&&_defineProperties(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty(e,t,i){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _construct(e,t,i){return(_construct=_isNativeReflectConstruct()?Reflect.construct.bind():function(e,t,i){var r=[null];r.push.apply(r,t);var n=new(Function.bind.apply(e,r));return i&&_setPrototypeOf(n,i.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,i)}function i(){return _construct(e,arguments,_getPrototypeOf(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(i,e)},_wrapNativeSuper(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _possibleConstructorReturn(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var i,r=_getPrototypeOf(e);if(t){var n=_getPrototypeOf(this).constructor;i=Reflect.construct(r,arguments,n)}else i=r.apply(this,arguments);return _possibleConstructorReturn(this,i)}}function _superPropBase(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf(e)););return e}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,i){var r=_superPropBase(e,t);if(r){var n=Object.getOwnPropertyDescriptor(r,t);return n.get?n.get.call(arguments.length<3?e:i):n.value}},_get.apply(this,arguments)}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,r=new Array(t);i<t;i++)r[i]=e[i];return r}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(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!=typeof r)return r;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 SAFE_INLINE_TAGS=["b","i","u","span","c","ruby","rt","v","lang"],SAFE_VOID_TAGS=["br"];function isSafeInlineTagName(e){return SAFE_INLINE_TAGS.includes(e)||SAFE_VOID_TAGS.includes(e)}function normalizeSafeInlineTagName(e){return String(e||"").trim().split(/[\s.]/)[0].toLowerCase()}var VTT_CHECK=/^WEBVTT/i,SRT_CHECK=/^\d+\r?\n\d{2}:\d{2}:\d{2},\d{3}\s*-->/m,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,3}:[0-9]{2}\.[0-9]{1,3}-->[0-9]{1,3}:[0-9]{2}\.[0-9]{1,3}/,/[0-9]{1,3}\.[0-9]{1,3}-->[0-9]{1,2}\.[0-9]{1,3}/,/[0-9]{1,3}:[0-9]{2}:[0-9]{2},[0-9]{1,3}\s*-->\s*[0-9]{1,3}:[0-9]{2}:[0-9]{2},[0-9]{1,3}/],MAX_COUNT=50,ASS_FORMAT=/^Format:\s/,ASS_STYLE=/^Style:\s/,ASS_DIALOGUE=/^Dialogue:\s/,MillSecondsSplitReg=/^([0-5]?\d)[.,](\d{1,3})$/;function parseSecond(e){var t=MillSecondsSplitReg.exec(e);return t?(1e3*Number(t[1])+Number(t[2]))/1e3:0}function getSecond(e){var t=e.length;return 3===t?60*(60*Number(e[0])+Number(e[1]))+parseSecond(e[2]):2===t?60*Number(e[0])+parseSecond(e[1]):parseSecond(e[0])}function isNumber(e){return/^(\-|\+)?\d+(\.\d+)?$/.test(e)}function htmlEncodeAll(e){return null==e?"":String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function getByIndex(e,t){return e>=0&&e<t.length?t[e]:""}function isSafeInlineTag(e){return isSafeInlineTagName(normalizeSafeInlineTagName(e))}var SubTitleParser=function(){function e(){_classCallCheck(this,e)}return _createClass(e,null,[{key:"parseJson",value:function(e){for(var t=[],i=0,r=0;r<e.length;r++){if(i>=MAX_COUNT&&(i=0),0===i){var n={start:e[r].start,list:[e[r]],end:e[r].end};t.push(n)}else t[t.length-1].list.push(e[r]),t[t.length-1].end=e[r].end;i++}return t}},{key:"parse",value:function(t,i){var r=e.checkFormat(t);try{var n;i({format:r,list:(n="ass"===r?e.parseASS(t):e.parseVTT(t)).list,styles:n.styles})}catch(e){console.error(e),i({format:r},e)}}},{key:"parseASSItem",value:function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(","),i={},r="";try{var n=t.length-e.length;return r=htmlEncodeAll(r=(r=n>0?t.splice(e.length-1,n+1).join(",")+"":t[t.length-1]+"").replace(/\\n+/g,"")),t[e.length-1]=r,e.map((function(e,r){"end"===e||"start"===e?i[e]=getSecond(t[r].split(":")):"text"===e?i[e]=[t[r]]:"layer"===e?(i[e]=[t[r]],i.textTag=[t[r]]):i[e]="style"===e?[t[r]]:Number(t[r])?Number(t[r]):t[r]})),i}catch(e){return console.error(e),{}}}},{key:"parseASS",value:function(t){for(var i=t.split("\n"),r=[],n=0,o=0,a=[],s=[],l=null;n<i.length;){if(ASS_FORMAT.test(i[n]))s=(s=i[n].replace(ASS_FORMAT,"").replace(/\s+/g,"").split(",")).map((function(e){return e.toLocaleLowerCase()}));else if(ASS_STYLE.test(i[n]))a.push(i[n].replace(ASS_STYLE,"").replace(/\s+/g,""));else if(ASS_DIALOGUE.test(i[n])){var c=e.parseASSItem(i[n].replace(ASS_DIALOGUE,""),s);if(l&&c.start===l.start&&c.end===l.end)try{var u=l,d=u.text,h=u.textTag,p=u.style;d.push(c.text[0]),h.push(c.textTag[0]),p.push(c.style[0])}catch(e){console.error(e)}else{l=c;var f=null;o%MAX_COUNT==0?((f={start:l.start,end:l.end,list:[]}).list.push(l),r.push(f)):((f=r[r.length-1]).end=l.end,f.list.push(l)),o++}}n++}return{list:r,styles:[]}}},{key:"parseVTTStyle",value:function(e,t){var i=e.split(":");if(i.length>1){var r=i[0].trim().split("-"),n="";r.length>1?r.map((function(e,t){n+=0===t?e:e.charAt(0).toUpperCase()+e.slice(1)})):n=r[0],t[n]=i[1].trim().replace(/;$/,"")}return t}},{key:"parseVTT",value:function(e){for(var t=(e=e.replace(VTT_CHECK,"")).split("\n"),i=[],r=0,n=0,o=null,a=!1,s=!1,l=null,c=null,u=[];r<t.length;){var d=getByIndex(r,t).trim();if(!d||a&&isNumber(d))a=!d;else if(VTT_CUE.test(d)&&VTT_STYLE.test(getByIndex(r-1,t).trim())){s=!0;var h=/\((.+?)\)/g.exec(d);c=h?h[1]:"",l=""}else if(s)VTT_CUEND.test(d)?(u.push({key:c||"",style:l||""}),l=null,c=null,s=!1):l+=d;else if(d){a=!1;var p=this.checkIsTime(t[r]);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),i.push(g)):((g=i[i.length-1]).end=o.end,g.list.push(o)),n++}}else if(o){var y=o,_=y.text,m=y.textTag,v=this.parseVttText(t[r]);_.push(v.text),m.push(v.tag)}a=!1}r++}return{list:i,styles:u}}},{key:"checkIsTime",value:function(e){e=e.replace(/\s+/g,"");for(var t=0,i=null;t<TIME_REGEX_LIST.length&&!(i=TIME_REGEX_LIST[t].exec(e));)t++;return i?i[0]:null}},{key:"parseVttText",value:function(e){var t=/^(<?.+?>)/g.exec(e),i="",r="default";if(t){if(isSafeInlineTag(r=t[0].replace(/\<|\>|\&/g,"")))return{tag:"default",text:htmlEncodeAll(e.replace(/\\n+/g,"<br/>"))};var n=RegExp("^<".concat(r,">(([\\s\\S])*?)</").concat(r,">$")).exec(e);n?i=n[1]:(i=e,r="")}else i=e;for(var o=/<(\w+)\.(\w+)>/g,a=o.exec(i);a&&a.length>2;)i=i.replace(a[0],"<".concat(a[1],' class="').concat(a[2],'">')),a=o.exec(i);return{tag:r,text:htmlEncodeAll(i.replace(/\\n+/g,"<br/>"))}}},{key:"parseVttTime",value:function(e){var t=e.split("--\x3e"),i=0,r=0;if(2===t.length){var n=t[0].split(":"),o=t[1].split(":");i=getSecond(n),r=getSecond(o)}return{start:i,end:r,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":SRT_CHECK.test(e)?"srt":"":""}}]),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"}],SError=function(e){_inherits(i,_wrapNativeSuper(Error));var t=_createSuper(i);function i(e){var r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:7,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return _classCallCheck(this,i),e||(e=ERROR[n||7].msg),(r=t.call(this,e)).code=n||7,r.message=e,r.type=ERROR[n||7].msg,r.orgError=o||null,r.data=a||null,r}return _createClass(i)}();function _ERROR(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0,r={code:ERROR[e].code,msg:ERROR[e].msg,message:ERROR[e].msg,id:i&&i.id||"",language:i&&i.language||""};return Object.keys(t).map((function(e){r[e]=t[e]})),r}var XHR=_createClass((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.url,r=t.method,n=void 0===r?"GET":r,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,d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return _classCallCheck(this,e),new Promise((function(e,t){var r=new window.XMLHttpRequest,o=n.toUpperCase(),s=[];if(a&&(r.responseType=a),l&&(r.timeout=l),Object.keys(u).forEach((function(e){s.push("k=".concat(u[e]))})),r.onload=function(){200===r.status||206===r.status?e({context:d,res:r}):t(new Error({context:d,res:r,type:"error"}))},r.onerror=function(e){t(new Error({context:d,res:r,type:"error"}))},r.ontimeout=function(e){t(new Error({context:d,res:r,type:"error"}))},r.onabort=function(){t(new Error({context:d,res:r,type:"error"}))},"GET"===o)r.open(o,"".concat(i)),r.send();else{if("post"!==o)throw new Error("xhr ".concat(o," is not supported"));r.open(o,i),r.setRequestHeader("Content-type","application/x-www-form-urlencoded"),r.send(s.join("&"))}}))})),ProxyPromise=function(){function e(){var t,i;_classCallCheck(this,e);var r=new Promise((function(e,r){t=e,i=r}));return r.resolve=function(e){t(e),r.state="fulfilled"},r.reject=function(e){i(e),r.state="rejected",r.isBreak="DESTROYED"===e},r.state="pending",r}return _createClass(e,[{key:"resolve",value:function(e){}},{key:"reject",value:function(e){}}]),e}();function hasClass(e,t){if(!e)return!1;if(e.classList)return Array.prototype.some.call(e.classList,(function(e){return e===t}));var i=e.className&&"object"===_typeof(e.className)?e.getAttribute("class"):e.className;return i&&!!i.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}function addClass(e,t){e&&(e.classList?t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.add(t)})):hasClass(e,t)||(e.className&&"object"===_typeof(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t))}function removeClass(e,t){e&&(e.classList?t.split(/\s+/g).forEach((function(t){e.classList.remove(t)})):hasClass(e,t)&&t.split(/\s+/g).forEach((function(t){var i=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===_typeof(e.className)?e.setAttribute("class",e.getAttribute("class").replace(i," ")):e.className=e.className.replace(i," ")})))}function findIndexByTime(e,t,i){var r=t.length;if(r<1)return-1;if(t[i=i<0?0:i>=r?r-1:i].start<=e&&e<t[i].end)return i;for(var n=t[i].end<=e?i+1:0;n<r;n++){if(t[n].start<=e&&e<t[n].end)return n;if(e>t[n].end&&n+1<r&&e<t[n+1].start)return-1;if(e>t[n].end&&n+1>=r)return-1}return-1}function findCIndexByTime(e,t,i){var r=t.length;if(r<1)return[];var n=[];if((i=i<0?0:i>=r?r-1:i)<r)for(var o=t[i].end<=e?i:0;o<r&&(t[o].start<=e&&e<t[o].end&&n.push(o),!(e<t[o].start));o++);return n}function getItemsByIndex(e,t,i){if(0===e.length||t<0||t>e.length-1)return[];var r=e[t].list;if(0===i.length)return[];var n=r.splice(i[0],i.length);return t>0&&e.splice(0,t),0===r.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]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",n=document.createElement(e);return n.className=r,n.innerHTML=t,Object.keys(i).forEach((function(t){var r=t,o=i[t];"video"===e||"audio"===e||"live-video"===e?o&&n.setAttribute(r,o):n.setAttribute(r,o)})),n}function isMediaElement(e){return e&&e instanceof window.HTMLMediaElement}function isMobile(){var e=navigator.userAgent,t=/(?:Windows Phone)/.test(e),i=/(?:SymbianOS)/.test(e)||t,r=/(?:Android)/.test(e),n=/(?:Firefox)/.test(e),o=/(?:iPad|PlayBook)/.test(e)||r&&!/(?:Mobile)/.test(e)||n&&/(?:Tablet)/.test(e);return/(?:iPhone)/.test(e)&&!o||r||i||o}function addCSS(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i="";e.map((function(e){i+=" ".concat(t," ").concat(e.key," {").concat(e.style,"}")}));var r=document.head||document.getElementsByTagName("head")[0],n="xg-text-track-style",o=document.getElementById(n);if(o||((o=document.createElement("style")).type="text/css",o.id=n,r.appendChild(o)),o.styleSheet){var a=function(){try{o.styleSheet.cssText=(o.styleSheet.cssText||"")+i}catch(e){}};o.styleSheet.disabled?setTimeout(a,10):a()}else{var s=document.createTextNode(i);o.appendChild(s)}}function parse(e,t,i){if(i||(i=new ProxyPromise),"json"===t){var r=SubTitleParser.parseJson(e);i.resolve({list:r,format:"json"})}else"string"===t&&SubTitleParser.parse(e,(function(e,t){if(t){var r=_ERROR(2,t);i.reject(r,{format:e.format})}else if(e.format||e.list&&0!==e.list.length)i.resolve({styles:e.styles,list:e.list,format:e.format});else{var n=_ERROR(3);i.reject(n)}}));return i}function loadSubTitle(e,t){t||(t=new ProxyPromise);var i=[];"String"===typeOf(e.url)?i=[e.url]:"Array"===typeOf(e.url)&&(i=_toConsumableArray(e.url));return function r(){var n=i.shift();if(n)new XHR({url:n,type:"text"}).then((function(i){parse(i.res.response,"string").then((function(i){t.resolve(_objectSpread2(_objectSpread2({},i),e))})).catch((function(e){t.reject(e)}))})).catch((function(o){if(i.length>0)r();else{var a=_ERROR(1,_objectSpread2({statusText:o.statusText,status:o.status,type:o.type,message:"http load error",url:n},e));t.reject(a)}}));else{var o=_ERROR(1,_objectSpread2({message:"http load error",url:e.url},e));t.reject(o)}}(),t}function toInt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if("number"==typeof e)return Number.isFinite(e)?Math.trunc(e):t;if("string"==typeof e){var i=e.trim();if(!i)return t;var r=parseInt(i,10);return Number.isNaN(r)?t:r}return t}function checkSubtitle(e,t){return!(!e||!t)&&!!(e.id&&t.id&&e.id===t.id||e.language&&t.language&&e.language===t.language)}function isEnglish(e){return null!==e&&""!==e.trim()&&/^[a-zA-Z]+$/.test(e)}function patchABCbiaodian(e){return!!/[\x21-\x2f\x3a-\x40\x5b-\x60\x7B-\x7F]/.test(e)}function patchCn(e){return!!/[\u3002|\uff1f|\uff01|\uff0c|\u3001|\uff1b|\uff1a|\u201c|\u201d|\u2018|\u2019|\uff08|\uff09|\u300a|\u300b|\u3008|\u3009|\u3010|\u3011|\u300e|\u300f|\u300c|\u300d|\ufe43|\ufe44|\u3014|\u3015|\u2026|\u2014|\uff5e|\ufe4f|\uffe5]/.test(e)}function splitWords(e){for(var t=e.split(""),i=[],r=!1,n=0;n<t.length;n++){var o=t[n];if(isEnglish(o))if(r){var a=i.length-1;i[a]="".concat(i[a]).concat(o)}else i.push(o),r=!0;else if(o.match(/^[ ]*$/)||patchABCbiaodian(o)||patchCn(o)){r=!1;var s=i.length-1;s>=0?i[s]="".concat(i[s]).concat(o):i.push(o)}else r=!1,i.push(o)}return i}var ResizeObserver=function(){function e(){var t=this;_classCallCheck(this,e),this.__handlers=[],window.ResizeObserver&&(this.observer=new window.ResizeObserver((function(e){t.__trigger(e)})))}return _createClass(e,[{key:"addObserver",value:function(e,t){if(this.observer){this.observer&&this.observer.observe(e);for(var i=this.__handlers,r=-1,n=0;n<i.length;n++)i[n]&&e===i[n].target&&(r=n);r>-1?this.__handlers[r].handler.push(t):this.__handlers.push({target:e,handler:[t]})}}},{key:"unObserver",value:function(e){var t=-1;this.__handlers.map((function(i,r){e===i.target&&(t=r)})),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 i=this.__handlers,r=0;r<i.length;r++)if(i[r]&&e===i[r].target){i[r].handler&&i[r].handler.forEach((function(i){try{i(e,t)}catch(e){console.error(e)}}));break}}},{key:"__trigger",value:function(e){var t=this;e.map((function(e){var i=e.contentRect;t.__runHandler(e.target,i)}))}}]),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$2={RESIZE:"resize",CHANGE:"change",OFF:"off",ON:"on",UPDATE:"update",ERROR:"error"},SAFE_CLASS_NAME=/^[A-Za-z0-9_-]+$/,SAFE_LANG=/^[A-Za-z]{1,8}(?:-[A-Za-z0-9]{1,8})*$/;function decodeSubtitleText(e){return null==e?"":String(e).replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;|&apos;/g,"'").replace(/&amp;/g,"&")}function appendSubtitleTextPart(e,t){t&&String(t).split(/(?:\\[nN]|\r\n|\r|\n)+/).forEach((function(t,i){i>0&&e.appendChild(document.createElement("br")),t&&e.appendChild(document.createTextNode(t))}))}function sanitizeClassName(e){return String(e||"").split(/\s+/).filter((function(e){return SAFE_CLASS_NAME.test(e)})).join(" ")}function sanitizeLang(e){var t=String(e||"").trim();return SAFE_LANG.test(t)?t:""}function parseTagAttributes(e){var t=e.trim(),i={};if(!t||!/(?:^|\s)[^\s=]+\s*=/.test(t))return{attrs:i,annotation:t};for(var r=/([^\s=]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g,n=r.exec(t);n;)i[n[1].toLowerCase()]=n[2]||n[3]||n[4]||"",n=r.exec(t);return{attrs:i,annotation:""}}function parseSafeTagToken(e){var t=e.slice(1,-1).trim();if(!t||"!"===t[0]||"?"===t[0])return null;if("/"===t[0]){var i=/^\/\s*([A-Za-z][\w:-]*)/.exec(t),r=i&&i[1].toLowerCase();return r&&SAFE_INLINE_TAGS.includes(r)?{closing:!0,tagName:r}:null}var n=/\/\s*$/.test(t),o=t.replace(/\/\s*$/,""),a=/^([A-Za-z][\w:-]*(?:\.[^\s/>.]+)*)([\s\S]*)$/.exec(o);if(!a)return null;var s=a[1].split("."),l=s.shift().toLowerCase();if(!SAFE_INLINE_TAGS.includes(l)&&!SAFE_VOID_TAGS.includes(l))return null;var c=parseTagAttributes(a[2]),u=c.attrs;return{attrs:u,annotation:c.annotation,closing:!1,className:sanitizeClassName("".concat(s.join(" ")," ").concat(u.class||"")),selfClosing:n,tagName:l}}function createSafeInlineElement(e){var t="c"===e.tagName||"v"===e.tagName||"lang"===e.tagName?"span":e.tagName,i=document.createElement(t);e.className&&(i.className=e.className);var r=sanitizeLang(e.attrs.lang||("lang"===e.tagName?e.annotation:""));return r&&i.setAttribute("lang",r),"v"===e.tagName&&e.annotation&&i.setAttribute("data-voice",e.annotation),i}function appendSubtitleText(e,t){for(var i=decodeSubtitleText(t),r=[{dom:e,tagName:""}],n=/<[^>]*>/g,o=0,a=n.exec(i);a;){appendSubtitleTextPart(r[r.length-1].dom,i.slice(o,a.index));var s=a[0],l=parseSafeTagToken(s);if(l)if(l.closing){var c=r.map((function(e){return e.tagName})).lastIndexOf(l.tagName);c>0?r.length=c:appendSubtitleTextPart(r[r.length-1].dom,s)}else if("br"===l.tagName)r[r.length-1].dom.appendChild(document.createElement("br"));else{var u=createSafeInlineElement(l);r[r.length-1].dom.appendChild(u),l.selfClosing||r.push({dom:u,tagName:l.tagName})}else appendSubtitleTextPart(r[r.length-1].dom,s);o=n.lastIndex,a=n.exec(i)}appendSubtitleTextPart(r[r.length-1].dom,i.slice(o))}function getSubtitleTextContent(e){var t=document.createElement("span");return appendSubtitleText(t,e),t.textContent||""}function formatUrl(e){var t=[];if(e&&"String"===typeOf(e))t.push({url:[e],index:0,start:-1,end:-1});else if("Array"===typeOf(e)){if(0===e.length)return t;"String"===typeOf(e[0])?t.push({url:_toConsumableArray(e),index:0,start:-1,end:-1}):e.forEach((function(e,i){t.push({url:e.url||e.src||"",index:i,start:e.start||-1,end:e.end||-1})}))}return t}var IS_MOBILE$2=!1,Subtitle$1=function(e){_inherits(i,EventEmitter);var t=_createSuper(i);function i(e){var r;return _classCallCheck(this,i),_defineProperty(_assertThisInitialized(r=t.call(this)),"_onPause",(function(){r.stopRender()})),_defineProperty(_assertThisInitialized(r),"_onPlay",(function(){r._curRenderTask.length>0&&r.startRender(-1)})),_defineProperty(_assertThisInitialized(r),"_onTimeupdate",(function(){if(r._isOpen){if(r.config.domRender){var e=r.player.media?r.player.media:r.player,t=e.videoWidth,i=e.videoHeight;!r._videoMeta.scale&&t&&i&&r._onResize(r.player.root)}var n=r._getPlayerCurrentTime();Math.round(Math.abs(1e3*n-r._ctime))<200||(r._ctime=1e3*n,r.currentText&&r.currentText.list&&("live"===r.config.updateMode?r._liveUpdate(n):r._update(n)))}})),_defineProperty(_assertThisInitialized(r),"_onResize",(function(e){var t=_assertThisInitialized(r),i=t._videoMeta;if(t.config.domRender){if(e&&e instanceof window.Element||(e=r.player.root),r._iId&&(clearTimeout(r._iId),r._iId=null),!i.scale){if(!r.player.video)return;var n=r.player.video,o=n.videoWidth,a=n.videoHeight;if(!o||!a)return;i.videoWidth=o,i.videoHeight=a,i.scale=toInt(a/o*100)}r.__startResize(e)}})),_defineProperty(_assertThisInitialized(r),"_onCoreEvents",(function(e){try{switch(e.eventName){case"core.subtitlesegments":r._onSubtitleSegment(e.list||[]);break;case"core.subtitleplaylist":r._onSubtitlePlaylist(e.list||[]);break;case"core.seipayloadtime":r._onCoreSeiintime(e)}}catch(e){console.error(e)}})),_defineProperty(_assertThisInitialized(r),"startRender",(function(e){if(e>0&&r._renderIntervalId&&(window.cancelAnimationFrame(r._renderIntervalId),r._renderIntervalId=-1),r.textTrack){var t=_assertThisInitialized(r)._curRenderTask;r._lastTimeStamp=(new Date).getTime();var i=[];t.forEach((function(t,n){var o=t.lastTime,a=t.wordList,s=t.interval,l=t.dom,c=t.ids;if(e<0||r._lastTimeStamp<0||r._lastTimeStamp-o>=s){var u=a.shift();u&&l.appendData(u),t.lastTime=r._lastTimeStamp}a.length<1&&i.push({index:n,ids:c})})),r._log(">>>>_renderByWords emptyArr",i.length,t.length),i.forEach((function(e){t.splice(e.index,1),r._log(">>>_renderByWords remove emptyArr",e.index,t.length)})),t.length>0&&(r._renderIntervalId=window.requestAnimationFrame(r.startRender))}})),_defineProperty(_assertThisInitialized(r),"destroy",(function(){r.detachPlayer(),r.removeAllListeners(),r.player=null,r.textTrack=null,r._curRenderTask=[],r.stopRender()})),IS_MOBILE$2=isMobile(),r.currentText=null,r.currentExtText=null,r.textTrack=[],r._cid=-1,r._gid=-1,r._cids=[],r._iId=null,r._iC=0,r.player=null,r.root=null,r.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",renderMode:"",debugger:!1},r._ctime=0,r._loadingTrack={},r.seiTime=0,r.lastSeiTime=0,r._curTexts=[],r._curRenderTask=[],r._renderIntervalId=-1,r._lastTimeStamp=-1,Object.keys(r.config).map((function(t){void 0!==e[t]&&null!==e[t]&&(r.config[t]=e[t])})),r._isOpen=r.config.defaultOpen||!1,r._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&&r.attachPlayer(e.player),r.setSubTitles(e.subTitles,r.config.defaultOpen),r):_possibleConstructorReturn(r)}return _createClass(i,[{key:"version",get:function(){return"3.0.25-rc.11"}},{key:"setSubTitles",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=this._isOpen||i;r&&this.innerRoot&&this.switchOff(),!t||t.length<1?this.switchOff():(this.currentText=null,this.textTrack=[],t.forEach((function(t){var i={};Object.keys(t).map((function(e){i[e]=t[e]})),i.url=formatUrl(i.url),i.isDefault&&(e.currentText=i),e.textTrack.push(i)})),this._log("setSubTitles",n),n&&(this.currentText||(this.currentText=this.textTrack[0]),this.switch().catch((function(t){e.emitError(t),e._log("[switch]",t)}))),this.currentText&&this._loadTrack(this.currentText).then((function(t){e.addStyles(t)})).catch((function(t){e.emitError(t),e._log("[_loadTrack] error",t)})),this.emit("reset",{type:"reset",list:this.textTrack,isOpen:n}))}},{key:"updateSubTitle",value:function(e){for(var t=this,i=-1,r=0;r<this.textTrack.length;r++)if(checkSubtitle(e,this.textTrack[r])){i=r;break}if(this._log("updateSubTitle",i,e),i>-1){var n=checkSubtitle(this.currentText,this.textTrack[i]);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[i].url.push(e)})),this._log("updateSubTitle _loadTrackUrls",this.textTrack[i]),this._loadTrackUrls(this.currentText,2)):this.textTrack[i].url=o}}},{key:"addStyles",value:function(e){var t=e.styles,i=e.format;t&&"vtt"===i&&(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&&e!==this.player){this.player&&this.detachPlayer();var i=this.config,r=i.fontColor,n=i.mode,o=i.fitVideo,a=i.domRender;if(this.player=e,a&&(this.root=document.createElement("xg-text-track"),this.root.className="xg-text-track",!this._isOpen&&addClass(this.root,"text-track-hide"),!o&&addClass(this.root,"text-track-no-fitvideo"),n&&addClass(this.root,"text-track-".concat(n)),this.innerRoot=document.createElement("xg-text-track-inner"),this.root.appendChild(this.innerRoot),r&&(this.root.style.color=r),this.currentText&&["language","id","label"].map((function(e){t.root.setAttribute("data-".concat(e),t.currentText[e]||"")})),this.player.root&&this.player.root.appendChild(this.root),this.player.root&&addObserver(e.root,this._onResize)),isMediaElement(this.player))this.player.addEventListener("timeupdate",this._onTimeupdate),this.player.addEventListener("pause",this._onPause),this.player.addEventListener("play",this._onPlay);else{if("function"!=typeof this.player.on)return;this.player.on("destroy",this.destroy),this.player.on("timeupdate",this._onTimeupdate),this.player.on("pause",this._onPause),this.player.on("play",this._onPlay),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&&(isMediaElement(e)?(e.removeEventListener("timeupdate",this._onTimeupdate),e.removeEventListener("pause",this._onPause),e.removeEventListener("play",this._onPlay)):"function"==typeof e.off&&(e.off("destroy",this.destroy),e.off("timeupdate",this._onTimeupdate),e.off("pause",this._onPause),e.off("play",this._onPlay),e.off("core_event",this._onCoreEvents)),t.domRender&&(e.root&&(unObserver(e.root),this.root&&e.root.contains(this.root)&&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(i,r){if(!t.id&&!t.language){if(e.currentText)return e._loadingTrack={},e._updateCurrent(e.currentText),e.switchOn(),void i({message:"switch default subtitle success",code:0});var n=new SError("no default subtitle",5);return e.emitError(n),void r(n)}if(e.currentText&&checkSubtitle(t,e.currentText))e._loadingTrack={},e._updateCurrent(e.currentText),e.switchOn(),i(_ERROR(0));else{var o=null;e.__removeByTime(e._curTexts,0);for(var a=0;a<e.textTrack.length;a++)if(checkSubtitle(t,e.textTrack[a])){o=e.textTrack[a];break}if(e._log("nextSubtitle",o),o)e._emitPlayerSwitch(e.currentText,o),o.list?(e._loadingTrack={},e._updateCurrent(o),e.switchOn(),i(_ERROR(0))):(e._log("this._loadTrack",o),e._updateCurrent(o),e._loadTrack(o).then((function(n){if(e.addStyles(n),e._loadingTrack.id===o.id||e._loadingTrack.language===n.language)e._loadingTrack={},e._updateCurrent(n),e.switchOn(),i(_ERROR(0));else{var a=new SError("check _loadingTrack fail id: ".concat(e._loadingTrack.id," nextSubtitle:").concat(n.id),6,null,t);e.emitError(a),r(a)}})).catch((function(t){e.emitError(t),r(t)})));else{var s=new SError("The is no subtitle with id:[{".concat(t.id,"}] or language:[").concat(t.language,"]"),4,null,t);e.emitError(s),r(s)}}}))}},{key:"switchExt",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:"",language:""};return new Promise((function(i,r){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,i(_ERROR(0))})).catch((function(t){e.emitError(t)}))}else e.currentExtText=null,i(_ERROR(0))}))}},{key:"emitError",value:function(e){this.emit(EVENTS$2.ERROR,{type:EVENTS$2.ERROR,error:e})}},{key:"switchOn",value:function(){this._log("switchOn"),this._isOpen=!0,this.show();var e=this.currentText||{},t=e.id,i=e.language;this.emit(EVENTS$2.CHANGE,{type:EVENTS$2.CHANGE,isOpen:!0,id:t,language:i,texts:[]})}},{key:"switchOff",value:function(){if(this._isOpen=!1,this.hide(),this.currentText){var e=this.currentText,t=e.id,i=e.language;this.emit(EVENTS$2.OFF,{type:EVENTS$2.OFF,id:t,language:i,texts:[],isOpen:!1})}}},{key:"isOpen",get:function(){return this._isOpen}},{key:"_log",value:function(){if(this.config.debugger){for(var e,t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];(e=console).log.apply(e,["[xgSubtitle]"].concat(i))}}},{key:"_loadTrack",value:function(e){var t=this;this._log("_loadTrack",e.language,e);var i=new ProxyPromise,r="",n="";if(e.json?(r="json",n=e.json):!e.stringContent||e.url&&0!==e.url.length||(r="string",n=e.stringContent),n)return parse(n,r).then((function(t){e.format=t.format,e.styles=t.styles,e.list=t.list,i.resolve(e)})).catch((function(e){t.emitError(e),i.reject(e)})),i;var o=e.url;return 0===o.length?(i.resolve(e),i):(loadSubTitle(o.splice(0,1)[0]).then((function(r){e.format=r.format,e.styles=r.styles,e.list||(e.list=[]),t._pushList(e.list,r.list),o.length>0&&t._loadTrackUrls(e,2),i.resolve(e)})).catch((function(e){t.emitError(e),i.reject(e)})),i)}},{key:"_emitPlayerSwitch",value:function(e,t){e&&"live"===this.config.updateMode&&(e.list=[],e.url=[]);var i=_objectSpread2({lang:t.language},t);this._log("emit subtile_switch ",t,i),this.player&&"function"==typeof this.player.emit&&this.player.emit("switch_subtitle",i)}},{key:"_loadTrackUrls",value:function(e,t,i){var r=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(_objectSpread2({},t),{},{index:n})).then((function(t){e.format=t.format,e.styles=t.styles,e.list||(e.list=[]),r._pushList(e.list,t.list),a--})).catch((function(e){a--})).finally((function(t){0===a&&(i&&i.resolve(e),r._loadTrackUrls(e,2))}))}))}},{key:"_freshUrl",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{url:""},i=-1;e.url.forEach((function(e,r){e.url===t.url&&(i=r)})),i>-1&&e.url.splice(i,1)}},{key:"_pushList",value:function(e,t){if(!t||0===t.length)return e;var i=t[0].start,r=t[t.length-1].end;if(0===e.length||i>=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>r){n=o;break}n>-1&&t.forEach((function(t,i){e.splice(n+i,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 i=this._getPlayerCurrentTime();i&&("live"===this.config.updateMode?this._liveUpdate(i):this._update(i))}},{key:"__loadAll",value:function(){var e=this;this.textTrack.forEach((function(t){e._loadTrack(t)}))}},{key:"getDelCid",value:function(e,t){for(var i=[],r=0;r<e.length;r++)t.includes(e[r])||i.push(e[r]);return i}},{key:"getNewCid",value:function(e,t){for(var i=[],r=0;r<t.length;r++)e.includes(t[r])||i.push(t[r]);return i}},{key:"_liveUpdate",value:function(e){var t=this;if(this.currentText&&this.currentText.list&&this.currentText.list.length){var i=[],r=findIndexByTime(e,this.currentText.list,this._gid);if(r>-1&&(i=findCIndexByTime(e,this.currentText.list[r].list,this._cid)),this.__removeByTime(this._curTexts,e),this._log("_liveUpdate",e,r,i,this.currentText.list[0].list[0].start,this.currentText.list[0].list[0].end),i.length>0){var n=getItemsByIndex(this.currentText.list,r,i),o=this._curTexts.length,a=o>0?this._curTexts[o-1].index:0;n.forEach((function(e,i){e.index=i+a,t._curTexts.push(e)})),this.__render(n)}this.emit(EVENTS$2.UPDATE,this.getUpdateData(this._curTexts,0,this.currentText))}}},{key:"_update",value:function(e){var t=this;if(this.currentText&&this.currentText.list&&this.currentText.list.length){var i=findIndexByTime(e,this.currentText.list,this._gid),r=[];if(i>-1&&(r=findCIndexByTime(e,this.currentText.list[i].list,this._cid)),r.length<1)return this._cids.length>0&&this.config.domRender&&this.__remove(this._cids),this._cids=[],this._curTexts.length>0&&this.emit(EVENTS$2.UPDATE,this.getUpdateData([],e,this.currentText)),void(this._curTexts=[]);if(this._cids.join("")!==r.join("")||i!==this._gid){this._gid=i,this._cid=r[0];var n=this.getDelCid(this._cids,r),o=this.getNewCid(this._cids,r);this._cids=r,this.config.domRender&&this.__remove(n);var a=[];o.map((function(e){var r=t.currentText.list[i].list[e];r.index=e,a.push(r)})),this.currentExtText&&o.map((function(e){var r=t.currentText.list[i].list[e];r.index=e,a.push(r)})),this._log("update",a,e),this._curTexts=a,this.emit(EVENTS$2.UPDATE,this.getUpdateData(a,e,this.currentText)),this.__render(a,e)}}}},{key:"getUpdateData",value:function(e,t,i){var r=i.id,n=i.language;return{type:EVENTS$2.UPDATE,currentTime:0|t,id:r,language:n,texts:e,isOpen:this._isOpen}}},{key:"_getPlayerCurrentTime",value:function(){if(!this.player)return 0;var e=this.player.currentTime;return toInt(1e3*(void 0===e?0:e)+1e3*this.seiTime-1e3*this.lastSeiTime)/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(e){}}},{key:"resize",value:function(e,t){var i,r=this,n=this.config,o=n.baseSizeX,a=n.baseSizeY,s=n.minMobileSize,l=n.minSize,c=n.fitVideo,u=n.offsetBottom,d=this._videoMeta.scale;this._videoMeta.lwidth=e,this._videoMeta.lheight=t;var h=0;t/e*100>=d?(h=toInt(d*e)/100,i=e):(h=t,i=toInt(t/d*100)),this._videoMeta.vWidth=i,this._videoMeta.vHeight=h;var p=0,f=0;f=toInt(d>120?(p=a)*h/1080:(p=o)*i/1920);var g=IS_MOBILE$2?s:l,y={fontSize:f=f<g?g:f>p?p:f},_=toInt((t-h)/2),m=toInt((e-i)/2),v=toInt(h*u)/100;this._videoMeta.vBottom=_,this._videoMeta.vLeft=m,this._videoMeta.marginBottom=v,c&&(y.bottom=_+v,y.left=y.right=m),Object.keys(y).map((function(e){r.root.style[e]="".concat(y[e],"px")})),this.emit(EVENTS$2.RESIZE,{vLeft:m,vBottom:_,marginBottom:v,vWidth:i,vHeight:h,fontSize:f,scale:d})}},{key:"__startResize",value:function(e){var t=this,i=e.getBoundingClientRect(),r=this._videoMeta,n=i.width,o=i.height;if(this._iId&&(clearTimeout(this._iId),this._iId=null),n>0&&o>0&&(n!==r.lwidth||o!==r.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 i=[],r=0;r<e.length;r++)(!t||e[r].end<t)&&i.push(r);0!==i.length&&(e.splice(i[0],i.length),this.config.domRender&&this.__remove(i))}},{key:"__remove",value:function(e){var t=this;if(e&&!(e.length<1)){this._log(">>>>_renderByWords__remove",e);for(var i=this.innerRoot.children,r=[],n=0;n<i.length;n++){var o=Number(i[n].getAttribute("data-index"));e.includes(o)&&r.push(i[n])}r.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);var i=this.config,r=i.renderMode,n=i.domRender;t.length>0&&n&&t.forEach((function(t){var i="text-track-".concat(e.config.line);t.text.forEach((function(n,o){o>0&&(i+=" text-track-deputy");var a={"data-start":t.start,"data-end":t.end,"data-index":t.index},s=createDom("xg-text-track-span","",a,i);if(e.innerRoot.appendChild(s),"step"===r){var l=createDom("xg-text-track-span","",a,"".concat(i," text-track-space"));e.innerRoot.appendChild(l),appendSubtitleText(l,n),setTimeout((function(){e._renderByWords(s,o,t.start,t.end,n)}),600)}else appendSubtitleText(s,n)}))}))}},{key:"_renderByWords",value:function(e,t,i,r,n){var o=document.createTextNode("");e.appendChild(o);var a=splitWords(getSubtitleTextContent(n)),s=this._getPlayerCurrentTime(),l=toInt(1e3*(r-s));if(!(s>=r)){i>=s&&(s=i),l>300&&(l-=50);var c={dom:o,ids:t,wordList:a,interval:l/a.length,start:s,end:r,duration:l,lastTime:0};this._log(">>>>_renderByWords",l,c);for(var u=this._curRenderTask,d=-1,h=0;h<u.length;h++)if(u[h].ids===t){d=h;break}d>-1&&u.slice(d,1),u.push(c),this.startRender(-1)}}},{key:"stopRender",value:function(){this._renderIntervalId&&window.cancelAnimationFrame(this._renderIntervalId)}},{key:"show",value:function(){this.config.domRender&&removeClass(this.root,"text-track-hide")}},{key:"hide",value:function(){this.config.domRender&&(addClass(this.root,"text-track-hide"),this.innerRoot&&(this.innerRoot.innerHTML=""))}},{key:"emit",value:function(e,t){for(var r,n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];(r=_get(_getPrototypeOf(i.prototype),"emit",this)).call.apply(r,[this,e,t].concat(o))}},{key:"on",value:function(e,t){for(var r,n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];(r=_get(_getPrototypeOf(i.prototype),"on",this)).call.apply(r,[this,e,t].concat(o))}},{key:"once",value:function(e,t){for(var r,n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];(r=_get(_getPrototypeOf(i.prototype),"once",this)).call.apply(r,[this,e,t].concat(o))}},{key:"off",value:function(e,t){for(var r,n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];(r=_get(_getPrototypeOf(i.prototype),"off",this)).call.apply(r,[this,e,t].concat(o))}},{key:"offAll",value:function(){_get(_getPrototypeOf(i.prototype),"removeAllListeners",this).call(this)}},{key:"marginBottom",get:function(){var e=this._videoMeta,t=e.vBottom,i=e.marginBottom;return this.config.fitVideo?t+i:i}}]),i}();class NativeSubTitle extends EventEmitter{constructor(e){super(),this._onChange=e=>{const t=this._media.textTracks;if(!t||0===t.length)return;const i=[],r=[];let n=-1;for(let e=0;e<t.length;e++){const o=t[e];"subtitles"===o.kind&&(i.push({id:o.id||o.language,language:o.language,text:o.label,isDefault:"showing"===o.mode}),-1===n&&"showing"===o.mode&&(n=e),r.push(o.language))}r.join("|")!==this._languages?(this._languages=r.join("|"),this.emit("reset",{list:i,isOpen:n>-1})):-1===n?this.emit("off"):this.curIndex!==n&&this.emit("change",i[n]),this.curIndex=n},this._media=e,this._list=[],this._languages="",this.curIndex=-1,this._init()}_init(){const e=this._media.textTracks;e?(e.addEventListener("change",this._onChange),e.addEventListener("addtrack",this._onChange)):VE_DEBUG.warn("current browser not support native subtitle")}switch(e){return new Promise(((t,i)=>{if(!e)return i({code:1,message:"no subtitle data"});const r=this._media.textTracks;for(let t=0;t<r.length;t++){const i=r[t];i.language===e.language?i.mode="showing":"showing"===i.mode&&(i.mode="disabled")}return t({code:0})}))}switchOff(){const e=this._media.textTracks;for(let t=0;t<e.length;t++)e[t].mode="disabled";this.curIndex=-1}destroy(){this._media.textTracks.removeEventListener("change",this._onChange),this._media=null,this._list=[],this._languages="",this.curIndex=-1}}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}const index_min$1="",{POSITIONS:POSITIONS$6}=Plugin,IS_MOBILE$1="mobile"===sniffer.device,DEFAULT_CLOSE_TYPE="text-close";function formatList$1(e=[]){let t=-1;return e.map(((e,i)=>{e.id||e.language||(e.id=""+i),!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=i:e.isDefault=e.default=!1)})),t}class Subtitle extends Plugin{constructor(e){super(e),this.isOpenState=!0,this.optionList=null,this.currentLang="",this._onOff=()=>{this.noShowSubtitle()},this._onChange=e=>{const t=this.getSubTitleIndex(this.config.list,e);t<0||this.updateCurItem(t,e)},this._onListReset=e=>{this.updateList(e)},this.handleButtonChange=e=>{e.preventDefault(),e.stopPropagation(),e.delegateTarget||(IS_MOBILE$1?this.showMobilePanel():this.isOpenState?this.switchOffSubtitle():this.openSubtitle().then((()=>this.showList())))},this.onEnter=e=>{e.stopPropagation(),this.emit("icon_mouseenter",{pluginName:this.pluginName}),this.showList()},this.onLeave=e=>{e.stopPropagation(),this.emit("icon_mouseleave",{pluginName:this.pluginName}),this.hideList()},this.handlerClickSwitch=(e,t)=>{e.stopPropagation(),e.preventDefault(),this.subTitles&&("text-close"===t.type?this.switchOffSubtitle():this.switchSubTitle({language:t.language,id:t.id}))},this.onPlayerFocus=e=>{this.subTitles&&this.config.style.follow&&this.rePosition()},this.onPlayerBlur=e=>{this.subTitles&&this.config.style.follow&&!this.playerConfig.marginControls&&this.subTitles.root&&(this.subTitles.root.style.transform="translate(0, 0)")};const{player:t,config:i}=e;t.config.isLive&&(e.config.updateMode="live",sniffer.os.isIos&&(e.config.mode="native"))}static get pluginName(){return"Subtitle"}static get defaultConfig(){return{position:POSITIONS$6.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"}}afterCreate(){const{list:e=[]}=this.config;this.curIndex=-1,this.curItem=null;const t=formatList$1(e);super.afterCreate(),"native"===this.config.mode?this._initNativeSubtitle(t):this._initExtSubTitle(t),e.length||this.hide()}_initNativeSubtitle(e){const{player:t}=this;t._subTitles||(t._subTitles=new NativeSubTitle(t.video)),this.subTitles=t._subTitles,this.subTitles.on("off",this._onOff),this.subTitles.on("change",this._onChange),this.subTitles.on("reset",this._onListReset),this._renderList(e)}_initExtSubTitle(e){const{list:t=[],style:i,isDefaultOpen:r,updateMode:n,renderMode:o}=this.config,a={subTitles:t,defaultOpen:r,debugger:!1,renderMode:o,updateMode:n};this.isOpenState=r,Object.keys(i).map((e=>{a[e]=i[e]}));!this.playerConfig.marginControls&&this.player.controls.root&&(this.on(PLAYER_FOCUS,this.onPlayerFocus),this.on(PLAYER_BLUR,this.onPlayerBlur));const{player:s}=this;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),this.subTitles.on("change",this._onChange),this.subTitles.on("reset",this._onListReset),i.follow&&this.subTitles.root&&util.addClass(this.subTitles.root,"follow-control"),this._renderList(e)}_renderList(e){const{list:t=[],isDefaultOpen:i}=this.config;t.length&&(e<0?(t[0].isDefault=!0,this.curIndex=0,this.curItem=t[0]):(this.curIndex=e,this.curItem=t[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"),!1===this.config.isShowIcon&&this.hide()}updateCurItem(e,t){this.curIndex=e,this.curItem=this.config.list[e],this.renderItemList(),this.emit("subtitle_change",__spreadValues({off:!1,isListUpdate:!1,list:[]},t))}initEvents(){this.bind(["click"],this.handleButtonChange),this.bind(["mouseenter"],this.onEnter),this.bind(["mouseleave"],this.onLeave),this._delegates=[]}showList(){var e;!IS_MOBILE$1&&this.isOpenState&&(null==(e=this.optionList)||e.show())}hideList(){var e;!IS_MOBILE$1&&this.isOpenState&&(null==(e=this.optionList)||e.hide())}openSubtitle(){return this.curIndex<0&&(this.curIndex=0,this.curItem=this.config.list[0]),this.curIndex>-1&&this.curItem?this.switchSubTitle(this.curItem):Promise.resolve(void 0)}getSubTitleIndex(e,t={id:"",language:""}){let i=-1;return t&&(t.id||t.language)?(e.forEach(((e,r)=>{e.id!==t.id&&e.language!==t.language||(i=r)})),i):i}registerIcons(){return{vttSubOpen:{icon:OpenIcon,class:"xgplayer-vttsub-open-svg"},vttSubClose:{icon:CloseIcon,class:"xgplayer-vttsub-close-svg"}}}registerLanguageTexts(){return{sub:{jp:"字幕",en:"Subtitles",zh:"字幕","zh-hk":"字幕"},subOpen:{jp:"字幕をオンにする",en:"Show subtitles",zh:"开启字幕","zh-hk":"開啟字幕"},subClose:{jp:"クローズドキャプション",en:"Hide subtitles",zh:"关闭字幕","zh-hk":"關閉字幕"}}}creatOptionList(){if(IS_MOBILE$1)return;const e={config:{data:this.getList(),className:"",onItemClick:(e,t)=>{this.handlerClickSwitch(e,null==t?void 0:t.to)}},root:this.root};this.optionList=new OptionList(e)}getList(){return this.config.list.map(((e,t)=>(t===this.curIndex&&this.isOpenState?(e.isCurrent=!0,e.selected=!0):(e.isCurrent=!1,e.selected=!1),e.showText=this.getTextByLang(e),e)))}renderOptionList(){this.optionList.renderItemList(this.getList())}switchSubTitle(e={id:"",language:""}){let t=-1;return e&&(e.id||e.language)?(this.config.list.map(((i,r)=>{i.id+""==e.id+""&&i.language+""==e.language+""&&(t=r)})),t<0||this.isOpenState&&t===this.curIndex?Promise.resolve(void 0):this.subTitles.switch(e).then((i=>{0===i.code&&(e.off=!1,e.isListUpdate=!1,e.list=[],this.curIndex=t,this.curItem=this.config.list[t],this.isOpenState=!0,util.removeClass(this.root,"isClose"),util.addClass(this.root,"isOpen"),this.renderItemList(),this.changeTipText(),this.emit("subtitle_change",e))})).catch((e=>VE_DEBUG.error("switch subtitle err: ",e)))):Promise.resolve(void 0)}switchOffSubtitle(){this.subTitles.switchOff(),this.noShowSubtitle()}noShowSubtitle(){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)||e.hide()}renderItemList(){IS_MOBILE$1?this.updatePanel():this.renderOptionList()}updateSubtitles(e=[],t=!0){if(!e)return;const i=this.curIndex>-1||this.config.isDefaultOpen;this.updateList({list:e,isOpen:i}),this.subTitles&&this.subTitles.setSubTitles(this.config.list,i,t)}updateList(e={}){var t,i,r,n;if(!e.list)return;e.list.length>0&&this.show();const o=[];e.list.map((e=>{o.push(e)}));const a=formatList$1(o);e.isOpen?(this.isOpenState=!0,this.curIndex=a,this.curItem=a>-1?o[a]:null,util.removeClass(this.root,"isClose"),util.addClass(this.root,"isOpen")):(this.isOpenState=!1,this.curIndex=-1,this.curItem=null,util.removeClass(this.root,"isOpen"),util.addClass(this.root,"isClose"),this.changeTipText(),null==(t=this.optionList)||t.hide()),this.config.list=o,o.length>0?IS_MOBILE$1||null==(i=this.optionList)||i.hide():(this.switchOffSubtitle(),IS_MOBILE$1?this.showMobilePanel():null==(r=this.optionList)||r.show(),IS_MOBILE$1||null==(n=this.optionList)||n.hide(),this.hide()),this.renderItemList()}changeTipText(){this.isOpenState?this.find(".xg-tips").innerHTML=this.langText.subClose:this.find(".xg-tips").innerHTML=this.langText.subOpen}showMobilePanel(){var e;const t=this.renderPanel();null==(e=this.player.panel)||e.showPanel(t,this.langText.sub,!0)}updatePanel(){var e;const t=this.renderPanel();null==(e=this.player.panel)||e.updatePanel(t)}renderPanel(){const e=[...this.config.list],t=util.createDom("div","",{},"ai-panel-content");e.map(((e,i)=>{const r=__spreadValues({language:e.language||e.srclang,"data-id":e.id,selected:this.isOpenState&&this.curIndex===i,showText:this.getTextByLang(e)},e),n=this.renderPanelItem(r);t.appendChild(n)}));const i={showText:this.langText.subClose,"data-type":"text-close",selected:!this.isOpenState};return t.appendChild(this.renderPanelItem(i)),t}renderPanelItem(e){const{showText:t,selected:i}=e,r=util.createDom("div","",{language:e.language,"data-id":e["data-id"],"data-type":e["data-type"]},"panel-Item "+(i?"select-in":""));r.innerHTML=t;const n=IS_MOBILE$1?"touchend":"click",o=Plugin.delegate(r,".panel-Item",n,(t=>{"text-close"===e["data-type"]?(t.stopPropagation(),t.preventDefault(),this.switchOffSubtitle()):this.handlerClickSwitch(t,e)}));return this._delegates.push(o),r}getTextByLang(e,t,i){if(void 0===e)return"";const{list:r}=this.config;return!i&&(i=this.player.lang),t=!t||util.isUndefined(e[t])?"text":t,"number"==typeof e&&(e=r[e]),"object"==typeof e[t]?e[t][i]||e[t].zh:e[t]||""}rePosition(){const{fitVideo:e}=this.config.style,t=0-this.player.controls.root.getBoundingClientRect().height;if(!e)return void(this.subTitles.root.style.transform=`translate(0, ${t}px)`);const{video:i,root:r}=this.player,{height:n,width:o}=r.getBoundingClientRect(),{videoHeight:a,videoWidth:s}=i;let l=parseInt(a/s*100,10)*o/100;l>n&&(l=n);const c=(n-l)/2-t;c<0&&(this.subTitles.root.style.transform=`translate(0, ${c}px)`)}destroy(){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)||e.destroy(),this._delegates&&this._delegates.length>0&&(this._delegates.map((e=>{Array.isArray(e)&&e.map((e=>{e.destroy&&e.destroy()})),e.destroy&&e.destroy()})),this._delegates=null),super.destroy()}render(){return`\n <xg-icon class="xgplayer-vttsub">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="vttSubOpen">${this.langText.subOpen}</div>\n </xg-icon>\n `}}class ToastPlugin extends Plugin{constructor(e){super(e),this.toastNumber=0,this.toastMaps={}}static get pluginName(){return"sdkToastPlugin"}static get defaultConfig(){return{index:5}}beforePlayerInit(){}afterPlayerInit(){}afterCreate(){}destroy(){}add(e,t=2e3,i=!1){const r=this.toastNumber+1;this.toastNumber=r;const n=this.renderToast(e,i,r);return this.root.appendChild(n),this.toastMaps[r]=n,t&&setTimeout((()=>{this.remove(r)}),t),r}remove(e){const t=this.toastMaps[e];t&&(this.root.contains(t)&&this.root.removeChild(t),delete this.toastMaps[e])}renderToast(e,t,i){const r=util.createDom("div","",void 0,"toast-container"),n=util.checkIsObject(e)?e:util.createDom("div",e,void 0,"toast-txt");if(r.appendChild(n),t){const e=util.createDom("span","×",void 0,"toast-close-bt");e.addEventListener("click",(()=>{this.remove(i)})),r.appendChild(e)}return r}render(){return'<xg-sdk-toast class="xgplayer-sdk-toast"></xg-sdk-toast>'}}const ToastPlugin$1=ToastPlugin;function now(){return(new Date).getTime()}var LOG_TYPES={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$1(i,Plugin);var t=_createSuper$1(i);function i(){var e;_classCallCheck$2(this,i);for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return _defineProperty$2(_assertThisInitialized$1(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$2(_assertThisInitialized$1(e),"_onAutoplayStart",(function(){XG_DEBUG.logInfo("[xgLogger]".concat(e.player.playerId," _onAutoplayStart")),e._state.autoplayStart=!0,e.vt&&e._sendFF("onAutoplayStart")})),_defineProperty$2(_assertThisInitialized$1(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(),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$1(e),e._waitTimer),e._waittTimer&&util.clearTimeout(_assertThisInitialized$1(e),e._waittTimer),e._waitTimer=null,e._waittTimer=null,e._waitType=0})),_defineProperty$2(_assertThisInitialized$1(e),"_onSeeking",(function(){e.seekingStart||(e.suspendWaitingStatus("seek"),e.seekingStart=now(),e.emitLog(LOG_TYPES.SEEK_START,{start:now()}))})),_defineProperty$2(_assertThisInitialized$1(e),"_onSeeked",(function(){e.suspendSeekingStatus("seeked")})),_defineProperty$2(_assertThisInitialized$1(e),"_onWaitingLoadStart",(function(){e._isWaiting||e.vt||(e._isWaiting=!0,e.waitingStart=now(),e.fixedWaitingStart=now(),e._waitType=1,e.emitLog(LOG_TYPES.WAIT_START,{fixedStart:e.fixedWaitingStart,start:e.waitingStart,type:1,endType:"loadstart"}))})),_defineProperty$2(_assertThisInitialized$1(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(),e._waitTimer=util.setTimeout(_assertThisInitialized$1(e),(function(){e._isWaiting&&(e.waitingStart=now(),util.clearTimeout(_assertThisInitialized$1(e),e._waitTimer),e._waitTimer=null,e._startWaitTimeout(),e.emitLog(LOG_TYPES.WAIT_START,{fixedStart:e.fixedWaitingStart,start:e.waitingStart,type:e._waitType,endType:2===e._waitType?"seek":"playing"}))}),200))})),_defineProperty$2(_assertThisInitialized$1(e),"_onError",(function(){e.suspendSeekingStatus("error"),e.suspendWaitingStatus("error")})),_defineProperty$2(_assertThisInitialized$1(e),"_onPlaying",(function(){e._isWaiting&&e.suspendWaitingStatus("playing")})),e}return _createClass$2(i,[{key:"afterCreate",value:function(){var e=this;this._onReset(),this._waitType="firstFrame",this._initOnceEvents(),this.newPointTime=now(),this.loadedCostTime=0,this.startCostTime=0,this.on(LOAD_START,(function(){var t=e._state,i=t.autoplayStart,r=t.isFFSend;e.startCostTime=now()-e.newPointTime,XG_DEBUG.logInfo("[xgLogger]".concat(e.player.playerId," LOAD_START"),"autoplayStart:".concat(i," isFFSend:").concat(r," startCostTime:").concat(e.startCostTime," newPointTime").concat(e.newPointTime)),r||(!t.isLs&&e.emitLog(LOG_TYPES.LOAD_START,{}),t.isLs=!0,t.isTimeUpdate=!1,t.isFFLoading=!0,e.pt=now(),e.vt=0,e.fvt=0,e._initOnceEvents(),e._onWaitingLoadStart())})),this.on(LOADED_DATA,(function(){e.vt=now(),e.fvt=e.vt-e.pt,e.loadedCostTime=e.vt-e.newPointTime;var t=e._state,i=t.isTimeUpdate,r=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)),(i||n)&&e._sendFF("loadedData"),r||e.emitLog(LOG_TYPES.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();var t=this._state,i=t.isFFLoading,r=t.isFFSend;XG_DEBUG.logInfo("[xgLogger]".concat(this.player.playerId," _sendFF"),"".concat(e," fvt:").concat(this.fvt," isFFLoading:").concat(i," !isFFSend:").concat(!r)),this.vt>0&&i&&!r&&(XG_DEBUG.logInfo("[xgLogger]".concat(this.player.playerId," emitLog_firstFrame"),e),this._state.isFFLoading=!1,this._state.isFFSend=!0,this.emitLog(LOG_TYPES.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(),i=t-this.seekingStart;this.seekingStart=0,this.emitLog(LOG_TYPES.SEEK_END,{end:t,costTime:i,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(),i=t-this.waitingStart,r=t-this.fixedWaitingStart,n=this.config.waitTimeout;this._isWaiting=!1,this.waitingStart=0,this.fixedWaitingStart=0,this.emitLog(LOG_TYPES.WAIT_END,{fixedCostTime:r>n?n:r,costTime:i>n?n:i,type:"loadeddata"===e?1:this._waitType,endType:2===this._waitType?"seek":e})}}},{key:"emitLog",value:function(e,t){var i=this.player;this.emit(XGLOG,_objectSpread2$2({t:now(),host:util.getHostFromUrl(i.currentSrc),vtype:i.vtype,eventType:e,currentTime:this.player.currentTime,readyState:i.video.readyState,networkState:i.video.networkState},t))}}],[{key:"pluginName",get:function(){return"xgLogger"}},{key:"defaultConfig",get:function(){return{waitTimeout:1e4}}}]),i}();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$1(i,Plugin);var t=_createSuper$1(i);function i(){return _classCallCheck$2(this,i),t.apply(this,arguments)}return _createClass$2(i,[{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 i=window.getComputedStyle(t).getPropertyValue("transform");if("string"==typeof i&&i.indexOf("none")>-1)return null;t.setAttribute("transform",i)}}})),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(e){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}}}]),i}();function PlayIcon(){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 PauseIcon(){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 i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{start:null,end:null};return AnimateMap[e]&&window.clearTimeout(AnimateMap[e].id),AnimateMap[e]={},i.start&&i.start(),AnimateMap[e].id=window.setTimeout((function(){i.end&&i.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$1(i,Plugin);var t=_createSuper$1(i);function i(e){var r;return _classCallCheck$2(this,i),_defineProperty$2(_assertThisInitialized$1(r=t.call(this,e)),"onPlayerReset",(function(){r.autoPlayStart=!1;var e="auto"===r.config.mode?"auto-hide":"hide";r.setAttr("data-state","play"),util.removeClass(r.root,e),r.show()})),_defineProperty$2(_assertThisInitialized$1(r),"onAutoplayStart",(function(){if(!r.autoPlayStart){var e="auto"===r.config.mode?"auto-hide":"hide";util.addClass(r.root,e),r.autoPlayStart=!0,r.toggleTo("play")}})),r.autoPlayStart=!1,r}return _createClass$2(i,[{key:"afterCreate",value:function(){var e=this.playerConfig;this.initIcons(),this.listenEvents(),this.bindClickEvents(),e.autoplay||this.show()}},{key:"listenEvents",value:function(){var e=this,t=this.player,i=this.playerConfig;this.once(READY,(function(){i&&(i.lang&&"en"===i.lang?util.addClass(t.root,"lang-is-en"):"jp"===i.lang&&util.addClass(t.root,"lang-is-jp"))})),this.on(AUTOPLAY_STARTED,this.onAutoplayStart),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.toggleTo("play")})),this.on(PAUSE,(function(){e.toggleTo("pause")})),this.on(RESET,(function(){e.onPlayerReset()}))}},{key:"bindClickEvents",value:function(){var e=this;this.clickHandler=this.hook("startClick",this.switchPausePlay,{pre:function(t){t.cancelable&&t.preventDefault(),t.stopPropagation();var i=e.player.paused;e.emitUserAction(t,"switch_play_pause",{props:"paused",from:i,to:!i})}}),this.bind(["click","touchend"],this.clickHandler)}},{key:"registerIcons",value:function(){return{startPlay:{icon:PlayIcon,class:"xg-icon-play"},startPause:{icon:PauseIcon,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(e){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){this.toggleTo(e)}},{key:"toggleTo",value:function(e){var t=this.config,i=this.player;if(i&&!(i.state<STATES.RUNNING)&&this.autoPlayStart){if("show"===t.mode)return this.switchStatus(),void this.show();if("auto"!==t.mode){if(t.isShowPause&&i.paused&&!i.ended||t.isShowEnd&&i.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||i.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"}}}]),i}(),Enter=function(e){_inherits$1(i,Plugin);var t=_createSuper$1(i);function i(){return _classCallCheck$2(this,i),t.apply(this,arguments)}return _createClass$2(i,[{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 i="",r=1;r<=12;r++)i+='<div class="xgplayer-enter-bar'.concat(r,'"></div>');t.innerHTML='<div class="xgplayer-enter-spinner">'.concat(i,"</div>")}return t}}],[{key:"pluginName",get:function(){return"enter"}},{key:"defaultConfig",get:function(){return{innerHtml:"",logo:""}}}]),i}();function xgIconTips(e,t,i){try{return' <div class="xg-tips '.concat(i?"hide":" ",'" lang-key="').concat(e.i18nKeys[t],'">\n ').concat(e.i18n[t],"\n </div>")}catch(e){return'<div class="xg-tips hide"></div>'}}var MiniScreenIcon=function(e){_inherits$1(i,Plugin);var t=_createSuper$1(i);function i(){return _classCallCheck$2(this,i),t.apply(this,arguments)}return _createClass$2(i,[{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$7.CONTROLS_RIGHT,index:10}}}]),i}();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$2(e)&&e.nodeType){var t=getStyle(e);if("none"===t.display)return getZeroSize();var i={};i.width=e.offsetWidth,i.height=e.offsetHeight;for(var r=i.isBorderBox="border-box"===t.boxSizing,n=0;n<measurementsLength;n++){var o=measurements[n],a=t[o],s=parseFloat(a);i[o]=Number.isNaN(s)?0:s}var l=i.paddingLeft+i.paddingRight,c=i.paddingTop+i.paddingBottom,u=i.marginLeft+i.marginRight,d=i.marginTop+i.marginBottom,h=i.borderLeftWidth+i.borderRightWidth,p=i.borderTopWidth+i.borderBottomWidth,f=r,g=getStyleSize(t.width);!1!==g&&(i.width=g+(f?0:l+h));var y=getStyleSize(t.height);return!1!==y&&(i.height=y+(f?0:c+p)),i.innerWidth=i.width-(l+h),i.innerHeight=i.height-(c+p),i.outerWidth=i.width+u,i.outerHeight=i.height+d,i}}function getTouch$1(e,t){for(var i=0;i<e.length;i++){var r=e[i];if(r.identifier===t)return r}}var EVENTS$1={START:"dragStart",MOVE:"dragMove",ENDED:"dragEnded"},POST_START_EVENTS={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]},Draggabilly=function(e){_inherits$1(i,EventEmitter);var t=_createSuper$1(i);function i(e){var r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return _classCallCheck$2(this,i),(r=t.call(this)).isEnabled=!0,r.isDragging=!1,r.isDown=!1,r.position={},r.downPoint={},r.dragPoint={x:0,y:0},r.startPos={x:0,y:0},r._root=e instanceof Element?e:document.querySelector(e),r._handlerDom=n.handle instanceof Element?n.handle:document.querySelector(n.handle),r._root&&r._handlerDom?(r._bindStartEvent(),r):_possibleConstructorReturn$1(r)}return _createClass$2(i,[{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 i=POST_START_EVENTS[this._startKey];i.map((function(e){window.addEventListener(e,t["on".concat(e)])})),this._boundPointerEvents=i}}},{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 i=getSize(this._root);this.startPos.x=this.position.x,this.startPos.y=this.position.y,this.startPos.maxY=window.innerHeight-i.height,this.startPos.maxX=window.innerWidth-i.width,this.setLeftTop(),this.isDown=!0,this._bindPostStartEvents(e)}}},{key:"dragRealStart",value:function(e,t){this.isDragging=!0,this.animate(),this.emit(EVENTS$1.START,this.startPos)}},{key:"dragEnd",value:function(e,t){this._root&&(this._unbindPostStartEvents(),this.isDragging&&(this._root.style.transform="",this.setLeftTop(),this.emit(EVENTS$1.ENDED)),this.presetInfo())}},{key:"_dragPointerMove",value:function(e,t){var i={x:t.pageX-this.downPoint.pageX,y:t.pageY-this.downPoint.pageY};return!this.isDragging&&this.hasDragStarted(i)&&this.dragRealStart(e,t),i}},{key:"dragMove",value:function(e,t){if(e=e||window.event,this.isDown){var i=this.startPos,r=i.x,n=i.y,o=this._dragPointerMove(e,t),a=o.x,s=o.y;a=this.checkContain("x",a,r),s=this.checkContain("y",s,n),this.position.x=r+a,this.position.y=n+s,this.dragPoint.x=a,this.dragPoint.y=s,this.emit(EVENTS$1.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,i){return t+i<0?0-i:"x"===e&&t+i>this.startPos.maxX?this.startPos.maxX-i:"y"===e&&t+i>this.startPos.maxY?this.startPos.maxY-i:t}},{key:"_getPosition",value:function(){var e=window.getComputedStyle(this._root),t=this._getPositionCoord(e.left,"width"),i=this._getPositionCoord(e.top,"height");this.position.x=Number.isNaN(t)?0:t,this.position.y=Number.isNaN(i)?0:i,this._addTransformPosition(e)}},{key:"_addTransformPosition",value:function(e){var t=e.transform;if(0===t.indexOf("matrix")){var i=t.split(","),r=0===t.indexOf("matrix3d")?12:4,n=parseInt(i[r],10),o=parseInt(i[r+1],10);this.position.x+=n,this.position.y+=o}}},{key:"_getPositionCoord",value:function(e,t){if(-1!==e.indexOf("%")){var i=getSize(this._root.parentNode);return i?parseFloat(e)/100*i[t]:0}return parseInt(e,10)}}]),i}(),MiniScreen=function(e){_inherits$1(i,Plugin);var t=_createSuper$1(i);function i(e){var r;_classCallCheck$2(this,i),_defineProperty$2(_assertThisInitialized$1(r=t.call(this,e)),"onCancelClick",(function(e){r.exitMini(),r.isClose=!0})),_defineProperty$2(_assertThisInitialized$1(r),"onCenterClick",(function(e){var t=_assertThisInitialized$1(r).player;t.paused?t.play():t.pause()})),_defineProperty$2(_assertThisInitialized$1(r),"onScroll",(function(e){if(!(!window.scrollY&&0!==window.scrollY||Math.abs(window.scrollY-r.pos.scrollY)<50)){var t=parseInt(util.getCss(r.player.root,"height"));t+=r.config.scrollTop,r.pos.scrollY=window.scrollY,window.scrollY>t+5?!r.isMini&&!r.isClose&&r.getMini():window.scrollY<=t&&(r.isMini&&r.exitMini(),r.isClose=!1)}})),r.isMini=!1,r.isClose=!1;var n=_assertThisInitialized$1(r).config;return r.pos={left:n.left<0?window.innerWidth-n.width-20:n.left,top:n.top<0?window.innerHeight-n.height-20:n.top,height:r.config.height,width:r.config.width,scrollY:window.scrollY||0},r.lastStyle=null,r}return _createClass$2(i,[{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 i={config:{onClick:function(){e.getMini()}}};t.controls.registerPlugin(MiniScreenIcon,i,MiniScreenIcon.pluginName)}var r=util.checkTouchSupport()?"touchend":"click";this.bind(".mini-cancel-btn",r,this.onCancelClick),this.bind(".play-icon",r,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:PlayIcon,class:"xg-icon-play"},pause:{icon:PauseIcon,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,i=this.playerConfig,r=this.config.target||this.player.root;this.lastStyle={},util.addClass(t.root,"xgplayer-mini"),["width","height","top","left"].map((function(t){e.lastStyle[t]=r.style[t],r.style[t]="".concat(e.pos[t],"px")})),i.fluid&&(r.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,i=this.playerConfig,r=this.config.target||this.player.root;util.removeClass(t.root,"xgplayer-mini"),this.lastStyle&&Object.keys(this.lastStyle).map((function(t){r.style[t]=e.lastStyle[t]})),this.lastStyle=null,i.fluid&&(t.root.style.width="100%",t.root.style.height="0",t.root.style["padding-top"]="".concat(100*i.height/i.width,"%")),this.emit(MINI_STATE_CHANGE,!1),this.isMini=t.isMini=!1}},{key:"updatePos",value:function(e){this.pos=Object.assign(this.pos,e),this.isMini&&(this.player.root.style.left="".concat(this.pos.left,"px"),this.player.root.style.top="".concat(this.pos.top,"px"),this.player.root.style.width="".concat(this.pos.width,"px"),this.player.root.style.height="".concat(this.pos.height,"px"))}},{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}}}]),i}(),MOUSE_EVENTS={mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousemove:"onMouseMove"},HOOKS$1=["videoClick","videoDbClick"],PCPlugin=function(e){_inherits$1(i,BasePlugin);var t=_createSuper$1(i);function i(){var e;_classCallCheck$2(this,i);for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return _defineProperty$2(_assertThisInitialized$1(e=t.call.apply(t,[this].concat(n))),"onMouseMove",(function(t){var i=_assertThisInitialized$1(e),r=i.player,n=i.playerConfig;r.isActive||(r.focus({autoHide:!n.closeDelayBlur}),!n.closeFocusVideoFocus&&r.media.focus())})),_defineProperty$2(_assertThisInitialized$1(e),"onMouseEnter",(function(t){var i=_assertThisInitialized$1(e),r=i.playerConfig,n=i.player;!r.closeFocusVideoFocus&&n.media.focus(),r.closeDelayBlur?n.focus({autoHide:!1}):n.focus(),e.emit(ENTER_PLAYER)})),_defineProperty$2(_assertThisInitialized$1(e),"onMouseLeave",(function(t){var i=e.playerConfig,r=i.closePlayerBlur,n=i.leavePlayerTime,o=i.closeDelayBlur;r||o||(n?e.player.focus({autoHide:!0,delay:n}):e.player.blur({ignorePaused:!0})),e.emit(LEAVE_PLAYER)})),_defineProperty$2(_assertThisInitialized$1(e),"onVideoClick",(function(t){var i=_assertThisInitialized$1(e),r=i.player,n=i.playerConfig;t.target&&n.closeVideoClick||t.target!==r.root&&t.target!==r.media&&t.target!==r.innerContainer&&t.target!==r.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$1(e),HOOKS$1[0],(function(t,i){e.switchPlayPause(i.e)}),{e:t,paused:r.paused}),clearTimeout(e.clickTimer),e.clickTimer=null)}),300))})),_defineProperty$2(_assertThisInitialized$1(e),"onVideoDblClick",(function(t){var i=_assertThisInitialized$1(e),r=i.player,n=i.playerConfig;n.closeVideoDblclick||!t.target||t.target!==r.media&&t.target!==r.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$1(e),HOOKS$1[1],(function(t,i){e.emitUserAction(i.e,"switch_fullscreen",{props:"fullscreen",from:r.fullscreen,to:!r.fullscreen}),r.fullscreen?r.exitFullscreen():r.getFullscreen()}),{e:t,fullscreen:r.fullscreen})))})),e}return _createClass$2(i,[{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.device&&!sniffer.os.isIpad||this.initEvents()}},{key:"initEvents",value:function(){var e=this,t=this.player,i=t.media,r=t.root,n=this.playerConfig.enableContextmenu;r&&r.addEventListener("click",this.onVideoClick,!1),r&&r.addEventListener("dblclick",this.onVideoDblClick,!1),Object.keys(MOUSE_EVENTS).map((function(t){r.addEventListener(t,e[MOUSE_EVENTS[t]],!1)})),!n&&i&&i.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,i=t.video,r=t.root;this.clickTimer&&clearTimeout(this.clickTimer),r.removeEventListener("click",this.onVideoClick,!1),r.removeEventListener("dblclick",this.onVideoDblClick,!1),i.removeEventListener("contextmenu",this.onContextmenu,!1),Object.keys(MOUSE_EVENTS).map((function(t){r.removeEventListener(t,e[MOUSE_EVENTS[t]],!1)}))}}],[{key:"pluginName",get:function(){return"pc"}},{key:"defaultConfig",get:function(){return{}}}]),i}(),EVENTS={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 i=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{eventType:"touch"};_classCallCheck$2(this,e),_defineProperty$2(this,"onTouchStart",(function(e){var t=i._pos,r=i.root,n=getTouch(e.touches);t.x=n?parseInt(n.pageX,10):e.pageX,t.y=n?parseInt(n.pageX,10):e.pageX,t.start=!0,i.__setPress(e),r.addEventListener(i.events.end,i.onTouchEnd),r.addEventListener(i.events.cancel,i.onTouchCancel),r.addEventListener(i.events.move,i.onTouchMove),i.trigger(EVENTS.TOUCH_START,e)})),_defineProperty$2(this,"onTouchCancel",(function(e){i.onTouchEnd(e)})),_defineProperty$2(this,"onTouchEnd",(function(e){var t=i._pos,r=i.root;i.__clearPress(),r.removeEventListener(i.events.cancel,i.onTouchCancel),r.removeEventListener(i.events.end,i.onTouchEnd),r.removeEventListener(i.events.move,i.onTouchMove),e.moving=t.moving,e.press=t.press,t.press&&i.trigger(EVENTS.PRESS_END,e),i.trigger(EVENTS.TOUCH_END,e),!t.press&&!t.moving&&i.__setDb(e),t.press=!1,t.start=!1,t.moving=!1})),_defineProperty$2(this,"onTouchMove",(function(e){var t=i._pos,r=i.config,n=getTouch(e.touches),o=n?parseInt(n.pageX,10):e.pageX,a=n?parseInt(n.pageY,10):e.pageX,s=o-t.x,l=a-t.y;Math.abs(l)<r.miniStep&&Math.abs(s)<r.miniStep||(i.__clearPress(),t.press&&i.trigger(EVENTS.PRESS_END,e),t.press=!1,t.moving=!0,i.trigger(EVENTS.TOUCH_MOVE,e))})),this._pos={moving:!1,start:!1,x:0,y:0},this.config=getDefaultConfig(),Object.keys(r).map((function(e){i.config[e]=r[e]})),this.root=t,this.events="mouse"===r.eventType?MOUSES:TOUCHS,this.pressIntrvalId=null,this.dbIntrvalId=null,this.__handlers={},this._initEvent()}return _createClass$2(e,[{key:"_initEvent",value:function(){this.root.addEventListener(this.events.start,this.onTouchStart)}},{key:"__setPress",value:function(e){var t=this,i=this.config;this.pressIntrvalId&&this.__clearPress(),this.pressIntrvalId=setTimeout((function(){t.trigger(EVENTS.PRESS,e),t._pos.press=!0,t.__clearPress()}),i.pressDelay)}},{key:"__clearPress",value:function(){window.clearTimeout(this.pressIntrvalId),this.pressIntrvalId=null}},{key:"__setDb",value:function(e){var t=this,i=this.config;if(this.dbIntrvalId)return this.__clearDb(),void this.trigger(EVENTS.DOUBlE_CLICK,e);this.dbIntrvalId=setTimeout((function(){t.__clearDb(),t._pos.start||t._pos.press||t._pos.moving||t.trigger(EVENTS.CLICK,e)}),i.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 i=this.__handlers[e],r=-1,n=0;n<i.length;n++)if(i[n]===t){r=n;break}r>=0&&this.__handlers[e].splice(r,1)}}},{key:"trigger",value:function(e,t){this.__handlers[e]&&this.__handlers[e].map((function(i){try{i(t)}catch(t){console.error("trigger>>:".concat(e),t)}}))}},{key:"destroy",value:function(){var e=this,t={touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"};Object.keys(t).forEach((function(i){e.root.removeEventListener(i,e[t[i]])}))}}]),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$1(i,Plugin);var t=_createSuper$1(i);function i(e){var r;return _classCallCheck$2(this,i),_defineProperty$2(_assertThisInitialized$1(r=t.call(this,e)),"onTouchStart",(function(e){var t=_assertThisInitialized$1(r),i=t.player,n=t.config,o=t.pos,a=t.playerConfig,s=r.getTouche(e);if(s&&!n.disableGesture&&r.duration>0&&!i.ended){o.isStart=!0,r.timer&&clearTimeout(r.timer),util.checkIsFunction(a.disableSwipeHandler)&&a.disableSwipeHandler(),r.find(".xg-dur").innerHTML=util.format(r.duration);var l=r.root.getBoundingClientRect();90===i.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===i.rotateDeg?u:c,o.y=90===i.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$2(_assertThisInitialized$1(r),"onTouchMove",(function(e){var t=r.getTouche(e),i=_assertThisInitialized$1(r),n=i.pos,o=i.config,a=i.player;if(t&&!o.disableGesture&&r.duration&&n.isStart){var s=o.miniMoveStep,l=o.hideControlsActive,c=parseInt(t.pageX-n.left,10),u=parseInt(t.pageY-n.top,10),d=90===a.rotateDeg?u:c,h=90===a.rotateDeg?c:u;if(Math.abs(d-n.x)>s||Math.abs(h-n.y)>s){var p=d-n.x,f=h-n.y,g=n.scope;if(-1===g&&(0===(g=r.checkScope(d,h,p,f,n))&&(l?a.blur():a.focus({autoHide:!1}),!n.time&&(n.time=parseInt(1e3*a.currentTime,10)+1e3*r.timeOffset)),n.scope=g),-1===g||g>0&&!o.gestureY||0===g&&!o.gestureX)return;r.executeMove(p,f,g,n.width,n.height),n.x=d,n.y=h}}})),_defineProperty$2(_assertThisInitialized$1(r),"onTouchEnd",(function(e){var t=_assertThisInitialized$1(r),i=t.player,n=t.pos,o=t.playerConfig;if(setTimeout((function(){i.getPlugin("progress")&&i.getPlugin("progress").resetSeekState()}),10),n.isStart){n.scope>-1&&e.cancelable&&e.preventDefault();var a=r.config,s=a.disableGesture,l=a.gestureX;!s&&l?r.endLastMove(n.scope):n.time=0,n.scope=-1,r.resetPos(),util.checkIsFunction(o.enableSwipeHandler)&&o.enableSwipeHandler(),r.changeAction(ACTIONS.AUTO)}})),_defineProperty$2(_assertThisInitialized$1(r),"onRootTouchMove",(function(e){!r.config.disableGesture&&r.config.gestureX&&r.checkIsRootTarget(e)&&(e.stopPropagation(),r.pos.isStart?r.onTouchMove(e):r.onTouchStart(e))})),_defineProperty$2(_assertThisInitialized$1(r),"onRootTouchEnd",(function(e){r.pos.scope>-1&&r.onTouchEnd(e)})),r.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},r.timer=null,r}return _createClass$2(i,[{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,i=this.config,r=this.player;!0===t.closeVideoDblclick&&(i.closedbClick=!0),this.resetPos(),util.isUndefined(t.disableGesture)||(i.disableGesture=!!t.disableGesture),this.appendChild(".xg-seek-icon",this.icons.seekTipIcon),this.xgMask=util.createDom("xg-mask","",{},"xgmask"),r.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()})),r.root.addEventListener("touchmove",this.onRootTouchMove,!0),r.root.addEventListener("touchend",this.onRootTouchEnd,!0),r.root.addEventListener("touchcancel",this.onRootTouchEnd,!0);var o=this.player.controls;o&&o.center&&(o.center.addEventListener("touchmove",this.onRootTouchMove,!0),o.center.addEventListener("touchend",this.onRootTouchEnd,!0),o.center.addEventListener("touchcancel",this.onRootTouchEnd,!0)),this.on(DURATION_CHANGE,(function(){var t=e.player,i=e.config;t.duration>0&&1e3*t.duration<i.moveDuration&&(i.moveDuration=1e3*t.duration)})),this.on([CANPLAY,ENDED],(function(){var t=e.pos,i=t.time;!t.isStart&&i>0&&(e.pos.time=0)}));var a={touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",press:"onPress",pressend:"onPressEnd",click:"onClick",doubleclick:"onDbClick"};if(Object.keys(a).map((function(t){e.touch.on(t,(function(i){e[a[t]](i)}))})),!i.disableActive){var s=r.plugins.progress;s&&(s.addCallBack("dragmove",(function(t){e.activeSeekNote(t.currentTime,t.forward)})),["dragend","click"].forEach((function(t){s.addCallBack(t,(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,i=e.progressColor,r=e.timePreviewStyle,n=e.curTimeColor,o=e.durationColor;if(t&&(this.find(".xg-curbar").style.backgroundColor=t),i&&(this.find(".xg-bar").style.backgroundColor=i),r){var a=this.find(".time-preview");Object.keys(r).forEach((function(e){a.style[e]=r[e]}))}var s=n||t,l=o;s&&(this.find(".xg-cur").style.color=s),l&&(this.find(".xg-dur").style.color=l),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 i=t.plugins.start;i&&i.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,i,r,n){var o=n.width,a=-1;if(e<0||e>o)return a;var s=0===r?Math.abs(i):Math.abs(i/r);return Math.abs(i)>0&&s>=1.73&&e>n.scopeM1&&e<n.scopeM2?a=0:(0===Math.abs(i)||s<=.57)&&(a=e<n.scopeL?1:e>n.scopeR?2:3),a}},{key:"executeMove",value:function(e,t,i,r,n){switch(i){case 0:this.updateTime(e/r*this.config.scopeM);break;case 1:this.updateBrightness(t/n);break;case 2:sniffer.os.isIos||this.updateVolume(t/n)}}},{key:"endLastMove",value:function(e){var t=this,i=this.pos,r=this.player,n=this.config,o=(i.time-this.timeOffset)/1e3;if(0===e)r.seek(Number(o).toFixed(1)),n.hideControlsEnd?r.blur():r.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,i=this.config,r=this.playerConfig;t.state<STATES.RUNNING?r.closeVideoClick||(this.sendUseAction(util.createEvent("click")),t.play()):!i.closedbClick||r.closeVideoClick?t.isActive?t.blur():t.focus():r.closeVideoClick||((t.isActive||i.focusVideoClick)&&(this.sendUseAction(util.createEvent("click")),this.switchPlayPause()),t.focus())}},{key:"dbClickHandler",value:function(e){var t=this.config,i=this.player;!t.closedbClick&&i.state>=STATES.RUNNING&&(this.sendUseAction(util.createEvent("dblclick")),this.switchPlayPause())}},{key:"onClick",value:function(e){var t=this,i=this.player;runHooks(this,HOOKS[0],(function(e,i){t.clickHandler(i.e)}),{e:e,paused:i.paused})}},{key:"onDbClick",value:function(e){var t=this,i=this.player;runHooks(this,HOOKS[1],(function(e,i){t.dbClickHandler(i.e)}),{e:e,paused:i.paused})}},{key:"onPress",value:function(e){var t=this.pos,i=this.config,r=this.player;i.disablePress||(t.rate=this.player.playbackRate,this.emitUserAction("press","change_rate",{prop:"playbackRate",from:r.playbackRate,to:i.pressRate}),r.playbackRate=i.pressRate,this.changeAction(ACTIONS.PLAYBACK))}},{key:"onPressEnd",value:function(e){var t=this.pos,i=this.config,r=this.player;i.disablePress||(this.emitUserAction("pressend","change_rate",{prop:"playbackRate",from:r.playbackRate,to:t.rate}),r.playbackRate=t.rate,t.rate=1,this.changeAction(ACTIONS.AUTO))}},{key:"updateTime",value:function(e){var t=this.player,i=this.config,r=this.player.duration;e=Number(e.toFixed(4));var n=parseInt(e*i.moveDuration,10)+this.timeOffset;n=(n+=this.pos.time)<0?0:n>1e3*r?1e3*r-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),i.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,i=this.pos;if(e=parseInt(100*e,10),i.volume+=e,!(Math.abs(i.volume)<10)){var r=parseInt(10*t.volume,10)-parseInt(i.volume/10,10);r=r>10?10:r<1?0:r,t.volume=r/10,i.volume=0}}},{key:"updateBrightness",value:function(e){var t=this.pos,i=this.config,r=this.xgMask;if(i.darkness){this.player.rotateDeg&&(e=-e);var n=t.light+.8*e;n=n>i.maxDarkness?i.maxDarkness:n<0?0:n,r&&(r.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],i=this.player,r=this.config,n=!(this.duration!==1/0&&this.duration>0);if(e&&"number"==typeof e&&!n&&!r.disableActive){e<0?e=0:e>i.duration&&(e=i.duration-.2),this.changeAction(ACTIONS.SEEKING);var o=i.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=!0}},{key:"enableGesture",value:function(){this.config.disableGesture=!1}},{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),e.root.removeEventListener("touchcancel",this.onRootTouchEnd,!0);var t=this.player.controls;t&&t.center&&(t.center.removeEventListener("touchmove",this.onRootTouchMove,!0),t.center.removeEventListener("touchend",this.onRootTouchEnd,!0),t.center.removeEventListener("touchcancel",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 class="xg-separator">/</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}}}]),i}();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$1(i,BasePlugin);var t=_createSuper$1(i);function i(){var e;_classCallCheck$2(this,i);for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return _defineProperty$2(_assertThisInitialized$1(e=t.call.apply(t,[this].concat(n))),"onBodyKeyDown",(function(t){if(e.player){var i=t||window.event,r=i.keyCode,n=_assertThisInitialized$1(e),o=n._keyState,a=n.player,s=e.config,l=s.disable,c=s.disableBodyTrigger,u=s.isIgnoreUserActive;l||c||!a.isUserActive&&!u||isDisableTag(i.target)||!e.checkIsVisible()||i.metaKey||i.altKey||i.ctrlKey?o.isBodyKeyDown=!1:(t.repeat||o.isKeyDown||((i.target===document.body||e.config.isGlobalTrigger&&!isDisableTag(i.target))&&e.checkCode(r,!0)&&(o.isBodyKeyDown=!0),document.addEventListener("keyup",e.onBodyKeyUp)),o.isBodyKeyDown&&e.handleKeyDown(i))}})),_defineProperty$2(_assertThisInitialized$1(e),"onBodyKeyUp",(function(t){e.player&&(document.removeEventListener("keyup",e.onBodyKeyUp),e.handleKeyUp(t))})),_defineProperty$2(_assertThisInitialized$1(e),"onKeydown",(function(t){if(e.player){var i=t||window.event,r=_assertThisInitialized$1(e)._keyState;if(!i.repeat){if(e.config.disable||e.config.disableRootTrigger||i.metaKey||i.altKey||i.ctrlKey)return;!i||37!==i.keyCode&&!e.checkCode(i.keyCode)||i.target!==e.player.root&&i.target!==e.player.video&&i.target!==e.player.controls.el||(r.isKeyDown=!0),e.player.root.addEventListener("keyup",e.onKeyup)}r.isKeyDown&&e.handleKeyDown(i)}})),_defineProperty$2(_assertThisInitialized$1(e),"onKeyup",(function(t){e.player&&(e.player.root.removeEventListener("keyup",e.onKeyup),e.handleKeyUp(t))})),e}return _createClass$2(i,[{key:"mergekeyCodeMap",value:function(){var e=this,t=this.config.keyCodeMap;t&&Object.keys(t).map((function(i){e.keyCodeMap[i]?["keyCode","action","disable","pressAction","disablePress","isBodyTarget"].map((function(r){t[i][r]&&(e.keyCodeMap[i][r]=t[i][r])})):e.keyCodeMap[i]=t[i]}))}},{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,disablePress:!1,noBodyTarget:!1},up:{keyCode:38,action:"upVolume",disable:!1,disablePress:!1,noBodyTarget:!0},down:{keyCode:40,action:"downVolume",disable:!1,disablePress:!1,noBodyTarget:!0},left:{keyCode:37,action:"seekBack",disablePress:!1,disable:!1},right:{keyCode:39,action:"seek",pressAction:"changePlaybackRate",disablePress:!1,disable:!1},esc:{keyCode:27,action:"exitFullscreen",disablePress:!0,disable:!1}},this.mergekeyCodeMap(),this._keyState={isKeyDown:!1,isBodyKeyDown:!1,isPress:!1,tt:0,playbackRate:0},this.player.root.addEventListener("keydown",this.onKeydown),document.addEventListener("keydown",this.onBodyKeyDown)}},{key:"setConfig",value:function(e){var t=this;Object.keys(e).forEach((function(i){t.config[i]=e[i]}))}},{key:"checkIsVisible",value:function(){if(!this.config.checkVisible)return!0;var e=this.player.root.getBoundingClientRect(),t=e.height,i=e.top,r=e.bottom,n=window.innerHeight;return!(i<0&&i<0-.9*t||r>0&&r-n>.9*t)}},{key:"checkCode",value:function(e,t){var i=this,r=!1;return Object.keys(this.keyCodeMap).map((function(n){i.keyCodeMap[n]&&e===i.keyCodeMap[n].keyCode&&!i.keyCodeMap[n].disable&&(r=!t||t&&!i.keyCodeMap[n].noBodyTarget)})),r}},{key:"downVolume",value:function(e){var t=this.player;if(!(t.volume<=0)){var i=parseFloat((t.volume-.1).toFixed(1)),r={volume:{from:t.volume,to:i}};this.emitUserAction(e,"change_volume",{props:r}),t.volume=i>=0?i:0}}},{key:"upVolume",value:function(e){var t=this.player;if(!(t.volume>=1)){var i=parseFloat((t.volume+.1).toFixed(1)),r={volume:{from:t.volume,to:i}};this.emitUserAction(e,"change_volume",{props:r}),t.volume=i<=1?i:1}}},{key:"seek",value:function(e){var t=this.player,i=t.currentTime,r=t.offsetCurrentTime,n=t.duration,o=t.offsetDuration,a=t.timeSegments,s=r>-1?r:i,l=o||n,c=e.repeat&&this.seekStep>=4?parseInt(this.seekStep/2,10):this.seekStep;s+c<=l?s+=c:s=l;var u=util.getCurrentTimeByOffset(s,a),d={currentTime:{from:i,to:u}};this.emitUserAction(e,"seek",{props:d}),this.player.currentTime=u}},{key:"seekBack",value:function(e){var t=this.player,i=t.currentTime,r=t.offsetCurrentTime,n=t.timeSegments,o=(r>-1?r:i)-(e.repeat?parseInt(this.seekStep/2,10):this.seekStep);o<0&&(o=0);var a={currentTime:{from:i,to:o=util.getCurrentTimeByOffset(o,n)}};this.emitUserAction(e,"seek",{props:a}),this.player.currentTime=o}},{key:"changePlaybackRate",value:function(e){var t=this._keyState,i=this.config,r=this.player;0===t.playbackRate&&(t.playbackRate=r.playbackRate,r.playbackRate=i.playbackRate)}},{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,i=t.fullscreen,r=t.cssfullscreen;i&&(this.emitUserAction("keyup","switch_fullscreen",{prop:"fullscreen",from:i,to:!i}),t.exitFullscreen()),r&&(this.emitUserAction("keyup","switch_css_fullscreen",{prop:"cssfullscreen",from:r,to:!r}),t.exitCssFullscreen())}},{key:"handleKeyDown",value:function(e){var t=this._keyState;if(e.repeat){t.isPress=!0;var i=Date.now();if(i-t.tt<200)return;t.tt=i}this.handleKeyCode(e.keyCode,e,t.isPress)}},{key:"handleKeyUp",value:function(e){var t=this._keyState;t.playbackRate>0&&(this.player.playbackRate=t.playbackRate,t.playbackRate=0),t.isKeyDown=!1,t.isPress=!1,t.tt=0}},{key:"handleKeyCode",value:function(e,t,i){for(var r=Object.keys(this.keyCodeMap),n=0;n<r.length;n++){var o=this.keyCodeMap[r[n]],a=o.action,s=o.keyCode,l=o.disable,c=o.pressAction,u=o.disablePress;if(s===e){if(!(l||i&&u)){var d=i&&c||a;"function"==typeof d?a(t,this.player,i):"string"==typeof d&&"function"==typeof this[d]&&this[d](t,this.player,i),this.emit(SHORTCUT,_objectSpread2$2({key:r[n],target:t.target,isPress:i},this.keyCodeMap[r[n]]))}preventDefault(t),t.stopPropagation();break}}}},{key:"destroy",value:function(){this.player.root.removeEventListener("keydown",this.onKeydown),document.removeEventListener("keydown",this.onBodyKeyDown),this.player.root.removeEventListener("keyup",this.onKeyup),document.removeEventListener("keyup",this.onBodyKeyUp)}},{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:!1,disableBodyTrigger:!1,disableRootTrigger:!1,isGlobalTrigger:!0,keyCodeMap:{},disable:!1,playbackRate:2,isIgnoreUserActive:!0}}}]),i}();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$1(i,Plugin);var t=_createSuper$1(i);function i(){return _classCallCheck$2(this,i),t.apply(this,arguments)}return _createClass$2(i,[{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$7.ROOT}}}]),i}(),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$2(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$2(e,[{key:"updateDuration",value:function(e){var t=this;this.duration=e;var i=0,r=this.fragments;this.fragments=r.map((function(e){return e.start=parseInt(i,10),e.end=parseInt(i+e.percent*t.duration,10),e.duration=parseInt(e.percent*t.duration,10),i+=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},i=this.progressList,r=this.fragments;if(!(i.length<1)){var n=t.newIndex,o=t.curIndex,a=t.millisecond;n!==o&&i.map((function(t,i){i<n?t[e].style.width="100%":i>n&&(t[e].style.width=0)}));var s=r[n],l=0===a?0:(a-s.start)/s.duration;i[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 i={index:t,preIndex:this.focusIndex,fragment:this.fragments[this.focusIndex]};this.focusIndex=t,this._callBack&&this._callBack(i)}}else if(this.focusIndex>-1){this.unHightLight(this.focusIndex);var r={index:-1,preIndex:this.focusIndex,fragment:null};this._callBack&&this._callBack(r),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 i=this.playedIndex,r=this.cachedIndex;if("Undefined"!==util.typeOf(e.played)){var n=this.findIndex(1e3*e.played,i);if(n<0)return;this.updateProgress("played",{newIndex:n,curIndex:i,millisecond:parseInt(1e3*e.played,10)}),this.playedIndex=n}if("Undefined"!==util.typeOf(e.cached)){var o=this.findIndex(1e3*e.cached,r);if(o<0)return;this.updateProgress("cached",{newIndex:o,curIndex:r,millisecond:parseInt(1e3*e.cached,10)}),this.cachedIndex=o}}},{key:"findIndex",value:function(e,t){var i=this.fragments;if(!i||0===i.length)return-1;if(1===i.length)return 0;if(t>-1&&t<i.length&&e>i[t].start&&e<i[t].end)return t;if(e>i[i.length-1].start)return i.length-1;for(var r=0;r<i.length;r++)if(e>i[r].start&&e<=i[r].end){t=r;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(i){void 0!==e[i]&&(t.fragConfig[i]=e[i])})),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 i=this.root.children;i.length>0;)this.root.removeChild(i[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 i=this.fragConfig,r=i.fragClass,n=i.fragFocusClass;this.progressList=this.fragments.map((function(i){var o=util.createDom("xg-inner","",{style:t?"background:".concat(t,"; flex: ").concat(i.percent):"flex: ".concat(i.percent)},"".concat(i.isFocus?n:""," xgplayer-progress-inner ").concat(r));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$1(i,Plugin);var t=_createSuper$1(i);function i(e){var r;return _classCallCheck$2(this,i),_defineProperty$2(_assertThisInitialized$1(r=t.call(this,e)),"onMoveOnly",(function(e,t){var i=_assertThisInitialized$1(r),n=i.pos,o=i.config,a=i.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=r.computeTime(e,c)}r.triggerCallbacks("dragmove",s,e),r._updateInnerFocus(s)})),_defineProperty$2(_assertThisInitialized$1(r),"onBodyClick",(function(e){r.pos.isLocked&&(r.pos.isLocked=!1,e.preventDefault(),e.stopPropagation())})),_defineProperty$2(_assertThisInitialized$1(r),"_mouseDownHandler",(function(e,t){r._state.time=t.currentTime,r.updateWidth(t.currentTime,t.seekTime,t.percent,0),r._updateInnerFocus(t)})),_defineProperty$2(_assertThisInitialized$1(r),"_mouseUpHandler",(function(e,t){_assertThisInitialized$1(r).pos.moving&&r.updateWidth(t.currentTime,t.seekTime,t.percent,2)})),_defineProperty$2(_assertThisInitialized$1(r),"_mouseMoveHandler",(function(e,t){var i=_assertThisInitialized$1(r),n=i._state,o=i.pos,a=i.config,s=i.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(),r.triggerCallbacks("dragstart",t,e),r.emitUserAction("drag","dragstart",t)),r.updateWidth(t.currentTime,t.seekTime,t.percent,1),r.triggerCallbacks("dragmove",t,e),r._updateInnerFocus(t)})),_defineProperty$2(_assertThisInitialized$1(r),"onMouseDown",(function(e){var t=_assertThisInitialized$1(r),i=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(),r.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,i.prePlayTime=n.currentTime,n.focus({autoHide:!1}),r.isProgressMoving=!0,util.addClass(r.progressBtn,"active");var u=r.computeTime(e,c);return u.prePlayTime=i.prePlayTime,r._mouseDownHandlerHook(e,u),"touchstart"===e.type?(r.root.addEventListener("touchmove",r.onMouseMove),r.root.addEventListener("touchend",r.onMouseUp),r.root.addEventListener("touchcancel",r.onMouseUp)):(r.unbind("mousemove",r.onMoveOnly),document.addEventListener("mousemove",r.onMouseMove,!1),document.addEventListener("mouseup",r.onMouseUp,!1)),!0}n.play()}})),_defineProperty$2(_assertThisInitialized$1(r),"onMouseUp",(function(e){var t=_assertThisInitialized$1(r),i=t.player,n=t.config,o=t.pos,a=t.playerConfig,s=t._state;if(o){e.stopPropagation(),e.preventDefault(),util.checkIsFunction(a.enableSwipeHandler)&&a.enableSwipeHandler(),util.checkIsFunction(n.onMoveEnd)&&n.onMoveEnd(),util.event(e),util.removeClass(r.progressBtn,"active");var l=r.computeTime(e,o.x);l.prePlayTime=s.prePlayTime,o.moving?(r.triggerCallbacks("dragend",l,e),r.emitUserAction("drag","dragend",l)):(r.triggerCallbacks("click",l,e),r.emitUserAction("click","click",l)),r._mouseUpHandlerHook(e,l),o.moving=!1,o.isDown=!1,o.x=0,o.y=0,o.isLocked=!0,s.prePlayTime=0,s.time=0;var c=e.type;"touchend"===c||"touchcancel"===c?(r.root.removeEventListener("touchmove",r.onMouseMove),r.root.removeEventListener("touchend",r.onMouseUp),r.root.removeEventListener("touchcancel",r.onMouseUp),r.blur()):(document.removeEventListener("mousemove",r.onMouseMove,!1),document.removeEventListener("mouseup",r.onMouseUp,!1),o.isEnter?"mobile"!==a.isMobileSimulateMode&&r.bind("mousemove",r.onMoveOnly):r.onMouseLeave(e)),util.setTimeout(_assertThisInitialized$1(r),(function(){r.resetSeekState()}),1),i.focus()}})),_defineProperty$2(_assertThisInitialized$1(r),"onMouseMove",(function(e){var t=_assertThisInitialized$1(r),i=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=r.computeTime(e,l);u.prePlayTime=i.prePlayTime,r._mouseMoveHandlerHook(e,u)}})),_defineProperty$2(_assertThisInitialized$1(r),"onMouseOut",(function(e){r.triggerCallbacks("mouseout",null,e)})),_defineProperty$2(_assertThisInitialized$1(r),"onMouseOver",(function(e){r.triggerCallbacks("mouseover",null,e)})),_defineProperty$2(_assertThisInitialized$1(r),"onMouseEnter",(function(e){var t=_assertThisInitialized$1(r),i=t.player,n=t.pos;if(!(n.isDown||n.isEnter||i.isMini||!i.config.allowSeekAfterEnded&&i.ended)){n.isEnter=!0,r.bind("mousemove",r.onMoveOnly),r.bind("mouseleave",r.onMouseLeave),util.event(e);var o=util.getEventPos(e,i.zoom),a=90===i.rotateDeg?o.clientY:o.clientX,s=r.computeTime(e,a);r.triggerCallbacks("mouseenter",s,e),r.focus()}})),_defineProperty$2(_assertThisInitialized$1(r),"onMouseLeave",(function(e){r.triggerCallbacks("mouseleave",null,e),r.unlock(),r._updateInnerFocus(null)})),_defineProperty$2(_assertThisInitialized$1(r),"onVideoResize",(function(){var e=r.pos,t=e.x,i=e.isDown;if(e.isEnter&&!i){var n=r.computeTime(null,t);r.onMoveOnly(null,n)}})),r.useable=!1,r.isProgressMoving=!1,r.__dragCallBacks=[],r._state={now:-1,direc:0,time:0,prePlayTime:-1},r._disableBlur=!1,"boolean"==typeof r.config.isDragingSeek&&(console.warn("[XGPLAYER] 'isDragingSeek' is deprecated, please use 'isDraggingSeek' instead"),r.config.isDraggingSeek=r.config.isDragingSeek),r}return _createClass$2(i,[{key:"offsetDuration",get:function(){return this.playerConfig.customDuration||this.player.offsetDuration||this.player.duration}},{key:"duration",get:function(){return this.playerConfig.customDuration||this.player.duration}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"currentTime",get:function(){var e=this.player,t=e.offsetCurrentTime,i=e.currentTime;return t>=0?t:i+this.timeOffset}},{key:"changeState",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.useable=e}},{key:"show",value:function(e){this.root&&(this.root.style.display="flex")}},{key:"_initInner",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t&&0!==t.length||(t=[{percent:1}]);var r=_objectSpread2$2(_objectSpread2$2({fragments:t},i),{},{actionCallback:function(t){e.emitUserAction("fragment_focus","fragment_focus",t)}});this.innerList?this.innerList.reset(r):(this.innerList=new InnerList(r),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(){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 e=this.config,t=e.fragFocusClass,i=e.fragAutoFocus,r=e.fragClass;this._initInner(this.config.fragments,{fragFocusClass:t,fragAutoFocus:i,fragClass:r,style:this.playerConfig.commonStyle||{}}),"mobile"===sniffer.device&&(this.config.isDraggingSeek=!1,this.isMobile=!0),this.progressBtn=this.find(".xgplayer-progress-btn"),this.listenEvents(),this.bindDomEvents(),this.initCustomStyle()}}},{key:"listenEvents",value:function(){var e=this;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()}))}},{key:"setConfig",value:function(e){var t=this,i=null;Object.keys(e).forEach((function(r){t.config[r]=e[r],"fragments"===r&&(i=e[r])})),i&&this._initInner(i,e)}},{key:"initCustomStyle",value:function(){var e=(this.playerConfig||{}).commonStyle.sliderBtnStyle,t=this.progressBtn;e&&("string"==typeof e?t.style.boxShadow=e:"object"===_typeof$2(e)&&Object.keys(e).map((function(i){t.style[i]=e[i]})))}},{key:"triggerCallbacks",value:function(e,t,i){this.__dragCallBacks.length>0&&this.__dragCallBacks.map((function(r){if(r&&r.handler&&r.type===e)try{r.handler(t,i)}catch(e){console.error("[XGPLAYER][triggerCallbacks] ".concat(r," error"),e)}}))}},{key:"addCallBack",value:function(e,t){t&&"function"==typeof t&&this.__dragCallBacks.push({type:e,handler:t})}},{key:"removeCallBack",value:function(e,t){var i=this.__dragCallBacks,r=-1;i.map((function(i,n){i&&i.type===e&&i.handler===t&&(r=n)})),r>-1&&i.splice(r,1)}},{key:"unlock",value:function(){var e=this.player,t=this.pos;t.isEnter=!1,t.isLocked=!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.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),"mouse"!==this.domEventType&&"compatible"!==this.domEventType||(this.bind("mousedown",this.onMouseDown),"mobile"!==e.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,i,r){var n=this.config,o=this.player;if(!n.isCloseClickSeek||0!==r){var a=t=t>=o.duration?o.duration-n.endedDiff:Number(t).toFixed(1);this.updatePercent(i),this.updateTime(e),(1!==r||n.isDraggingSeek&&"audio"!==o.config.mediaType)&&(this._state.now=a,this._state.direc=a>o.currentTime?0:1,o.seek(a))}}},{key:"computeTime",value:function(e,t){var i,r,n=this.player,o=this.root.getBoundingClientRect(),a=o.width,s=o.height,l=o.top,c=o.left,u=t;90===n.rotateDeg?(i=s,r=l):(i=a,r=c);var d=u-r,h=(d=d>i?i:d<0?0:d)/i;h=h<0?0:h>1?1:h,Number.isNaN(h)&&(h=this.player.currentTime/this.offsetDuration);var p=parseInt(h*this.offsetDuration*1e3,10)/1e3;return{percent:h,currentTime:p,seekTime:util.getCurrentTimeByOffset(p,n.timeSegments),offset:d,width:i,left:r,e:e}}},{key:"updateTime",value:function(e){var t=this.player,i=this.duration;e>i?e=i:e<0&&(e=0);var r=t.plugins.time;r&&r.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.offsetDuration},this.offsetDuration);var i=this.player.plugins.miniprogress;i&&i.update({played:e*this.offsetDuration},this.offsetDuration)}}},{key:"onTimeupdate",value:function(e){var t=this.player,i=this._state,r=this.offsetDuration;if(!(t.isSeeking&&t.media.seeking||this.isProgressMoving)&&t.hasStart){if(i.now>-1){var n=parseInt(1e3*i.now,10)-parseInt(1e3*t.currentTime,10);if(0===i.direc&&n>300||1===i.direc&&n>-300)return void(i.now=-1);i.now=-1}var o=this.currentTime;o=util.adjustTimeByDuration(o,r,e),this.innerList.update({played:o},r),this.progressBtn.style.left="".concat(o/r*100,"%")}}},{key:"onCacheUpdate",value:function(e){var t=this.player,i=this.duration;if(t){var r=t.bufferedPoint.end;r=util.adjustTimeByDuration(r,i,e),this.innerList.update({cached:r},i)}}},{key:"onReset",value:function(){this.innerList.update({played:0,cached:0},0),this.progressBtn.style.left="0%"}},{key:"destroy",value:function(){var e=this.player;this.thumbnailPlugin=null,this.innerList.destroy(),this.innerList=null;var t=this.domEventType;"touch"!==t&&"compatible"!==t||(this.root.removeEventListener("touchstart",this.onMouseDown),this.root.removeEventListener("touchmove",this.onMouseMove),this.root.removeEventListener("touchend",this.onMouseUp),this.root.removeEventListener("touchcancel",this.onMouseUp)),"mouse"!==t&&"compatible"!==t||(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$7.CONTROLS_CENTER,index:0,disable:!1,isDraggingSeek:!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}}]),i}(),Icon=function(e){_inherits$1(i,Plugin);var t=_createSuper$1(i);function i(){var e;_classCallCheck$2(this,i);for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return _defineProperty$2(_assertThisInitialized$1(e=t.call.apply(t,[this].concat(n))),"_onMouseenter",(function(t){e.emit("icon_mouseenter",{pluginName:e.pluginName})})),_defineProperty$2(_assertThisInitialized$1(e),"_onMouseLeave",(function(t){e.emit("icon_mouseleave",{pluginName:e.pluginName})})),e}return _createClass$2(i,[{key:"afterCreate",value:function(){this.bind("mouseenter",this._onMouseenter),this.bind("mouseleave",this._onMouseLeave),this.config.disable&&this.disable()}},{key:"destroy",value:function(){this.unbind("mouseenter",this._onMouseenter),this.unbind("mouseleave",this._onMouseLeave)}}]),i}(),Play=function(e){_inherits$1(i,Icon);var t=_createSuper$1(i);function i(){var e;_classCallCheck$2(this,i);for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return _defineProperty$2(_assertThisInitialized$1(e=t.call.apply(t,[this].concat(n))),"btnClick",(function(t){t.preventDefault(),t.stopPropagation();var i=_assertThisInitialized$1(e).player;return e.emitUserAction(t,"switch_play_pause",{prop:"paused",from:i.paused,to:!i.paused}),i.ended?i.replay():i.paused?(i.play(),e.animate(!1)):(i.pause(),e.animate(!0)),!1})),e}return _createClass$2(i,[{key:"afterCreate",value:function(){_get$1(_getPrototypeOf$1(i.prototype),"afterCreate",this).call(this),this.config.disable||(this.initIcons(),this.bind(["touchend","click"],this.btnClick),this.listenEvents(),this.animate(!0))}},{key:"listenEvents",value:function(){var e=this,t=this.player;this.on([PLAY,PAUSE,ERROR$1,EMPTIED],(function(){e.animate(t.paused)}))}},{key:"registerIcons",value:function(){return{play:{icon:PlayIcon,class:"xg-icon-play"},pause:{icon:PauseIcon,class:"xg-icon-pause"}}}},{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,i=this.find(".xg-tips");e?(this.setAttr("data-state","pause"),i&&this.changeLangTextKey(i,t.PLAY_TIPS)):(this.setAttr("data-state","play"),i&&this.changeLangTextKey(i,t.PAUSE_TIPS))}}},{key:"destroy",value:function(){_get$1(_getPrototypeOf$1(i.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$7.CONTROLS_LEFT,index:0,disable:!1}}}]),i}();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$1(i,Plugin);var t=_createSuper$1(i);function i(){return _classCallCheck$2(this,i),t.apply(this,arguments)}return _createClass$2(i,[{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$7.ROOT_TOP,index:0}}}]),i}();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$1(i,Icon);var t=_createSuper$1(i);function i(){var e;_classCallCheck$2(this,i);for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return _defineProperty$2(_assertThisInitialized$1(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$2(i,[{key:"afterCreate",value:function(){var e=this;_get$1(_getPrototypeOf$1(i.prototype),"afterCreate",this).call(this);var t=this.config,r=this.playerConfig;if(!t.disable){t.target&&(this.playerConfig.fullscreenTarget=this.config.target);var n=util.getFullScreenEl();r.fullscreenTarget===n&&this.player.getFullscreen().catch((function(e){})),this.initIcons(),this.handleFullscreen=this.hook("fullscreenChange",this.toggleFullScreen,{pre:function(t){var i=e.player.fullscreen;e.emitUserAction(t,"switch_fullscreen",{prop:"fullscreen",from:i,to:!i})}}),this.bind(".xgplayer-fullscreen",["touchend","click"],this.handleFullscreen),this.on(FULLSCREEN_CHANGE,(function(t){var i=e.find(".xg-tips");i&&e.changeLangTextKey(i,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.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$1(_getPrototypeOf$1(i.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon","mobile"===sniffer.device?"touchend":"click",this.handleFullscreen),"mobile"===sniffer.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 instanceof Event&&(e.preventDefault(),e.stopPropagation());var t=this.player,i=this.config;!0===i.useCssFullscreen||"function"==typeof i.useCssFullscreen&&i.useCssFullscreen()?(t.fullscreen?t.exitCssFullscreen():t.getCssFullscreen(),this.animate(t.fullscreen)):i.rotateFullscreen?(t.fullscreen?t.exitRotateFullscreen():t.getRotateFullscreen(),this.animate(t.fullscreen)):i.switchCallback&&"function"==typeof i.switchCallback?i.switchCallback(t.fullscreen):t.fullscreen?(t.exitFullscreen(),i.useScreenOrientation&&this.unlockScreen()):(t.getFullscreen().catch((function(e){})),i.useScreenOrientation&&t.aspectRatio>1&&this.lockScreen(i.lockOrientationType))}},{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:"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:"lockScreen",value:function(e){try{screen.orientation.lock(e).catch((function(e){}))}catch(e){}}},{key:"unlockScreen",value:function(){try{screen.orientation.unlock().catch((function(e){}))}catch(e){}}}],[{key:"pluginName",get:function(){return"fullscreen"}},{key:"defaultConfig",get:function(){return{position:POSITIONS$7.CONTROLS_RIGHT,index:0,useCssFullscreen:!1,rotateFullscreen:!1,useScreenOrientation:!1,lockOrientationType:"landscape",switchCallback:null,target:null,disable:!1,needBackIcon:!1}}}]),i}(),Time=function(e){_inherits$1(i,Plugin);var t=_createSuper$1(i);function i(e){var r;return _classCallCheck$2(this,i),(r=t.call(this,e)).isActiving=!1,r}return _createClass$2(i,[{key:"duration",get:function(){var e=this.player,t=e.offsetDuration,i=e.duration;return this.playerConfig.customDuration||t||i}},{key:"currentTime",get:function(){var e=this.player,t=e.offsetCurrentTime,i=e.currentTime;return t>=0?t:i}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"afterCreate",value:function(){var e=this.player.controls.config.mode;this.mode="flex"===e?"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.listenEvents())}},{key:"listenEvents",value:function(){var e=this;this.on([DURATION_CHANGE,SEEKED,TIME_UPDATE],(function(t){"durationchange"===t.eventName&&(e.isActiving=!1),e.onTimeUpdate()})),this.on(ENDED,(function(){e.onTimeUpdate(!0)})),this.on(EMPTIED,(function(){e.onReset()}))}},{key:"show",value:function(e){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,i=this.config,r=this.duration;if(!i.disable&&!this.isActiving&&t.hasStart){var n=this.currentTime+this.timeOffset;n=util.adjustTimeByDuration(n,r,e),"flex"===this.mode?(this.centerCurDom.innerHTML=this.minWidthTime(util.format(n)),r!==1/0&&r>0&&(this.centerDurDom.innerHTML=util.format(r))):(this.timeDom.innerHTML=this.minWidthTime(util.format(n)),r!==1/0&&r>0&&(this.durationDom.innerHTML=util.format(r)))}}},{key:"onReset",value:function(){"flex"===this.mode?(this.centerCurDom.innerHTML=this.minWidthTime(util.format(0)),this.centerDurDom.innerHTML=util.format(0)):(this.timeDom.innerHTML=this.minWidthTime(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),this.extraEls=[this.centerCurDom,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=this.minWidthTime(util.format(e)):this.centerCurDom.innerHTML=this.minWidthTime(util.format(e)))}},{key:"minWidthTime",value:function(e){return e.split(":").map((function(e){return'<span class="time-min-width">'.concat(e,"</span>")})).join(":")}},{key:"resetActive",value:function(){var e=this,t=this.player,i=function(){e.isActiving=!1};this.off(SEEKED,i),t.isSeeking&&t.media.seeking?this.once(SEEKED,i):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$7.CONTROLS_LEFT,index:2,disable:!1}}}]),i}(),TimeSegmentsControls=function(e){_inherits$1(i,BasePlugin);var t=_createSuper$1(i);function i(){var e;_classCallCheck$2(this,i);for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return _defineProperty$2(_assertThisInitialized$1(e=t.call.apply(t,[this].concat(n))),"_onDurationChange",(function(){e.updateSegments();var t=e.player,i=t.currentTime,r=t.timeSegments;if(e._checkIfEnabled(r)){var n=util.getIndexByTime(i,r),o=util.getOffsetCurrentTime(i,r,n);e.player.offsetCurrentTime=o,e.changeIndex(n,r)}})),_defineProperty$2(_assertThisInitialized$1(e),"_onLoadedData",(function(){var t=e.player.timeSegments;if(e._checkIfEnabled(t)){var i=util.getOffsetCurrentTime(0,t);e.player.offsetCurrentTime=i,e.changeIndex(0,t),e.curPos.start>0&&(e.player.currentTime=e.curPos.start)}})),_defineProperty$2(_assertThisInitialized$1(e),"_onTimeupdate",(function(){var t=e.player,i=t.currentTime,r=t.timeSegments;if(e._checkIfEnabled(r)){var n=r.length;e.lastCurrentTime=i;var o=util.getIndexByTime(i,r);o!==e.curIndex&&e.changeIndex(o,r);var a=util.getOffsetCurrentTime(i,r,o);if(e.player.offsetCurrentTime=a,e.curPos){var s=e.curPos,l=s.start,c=s.end;i<l?e.player.currentTime=l:i>c&&o>=n-1&&e.player.pause()}}})),_defineProperty$2(_assertThisInitialized$1(e),"_onSeeking",(function(){var t=e.player,i=t.currentTime,r=t.timeSegments;if(e._checkIfEnabled(r))if(i<r[0].start)e.player.currentTime=r[0].start;else if(i>r[r.length-1].end)e.player.currentTime=r[r.length-1].end;else{var n=util.getIndexByTime(i,r);if(n>=0){var o=e.getSeekTime(i,e.lastCurrentTime,n,r);o>=0&&(e.player.currentTime=o)}}})),_defineProperty$2(_assertThisInitialized$1(e),"_onPlay",(function(){var t=e.player,i=t.currentTime,r=t.timeSegments;e._checkIfEnabled(r)&&i>=r[r.length-1].end&&(e.player.currentTime=r[0].start)})),e}return _createClass$2(i,[{key:"afterCreate",value:function(){this.curIndex=-1,this.curPos=null,this.lastCurrentTime=0,this.updateSegments(),this.on(DURATION_CHANGE,this._onDurationChange),this.on(LOADED_DATA,this._onLoadedData),this.on(TIME_UPDATE,this._onTimeupdate),this.on(SEEKING,this._onSeeking),this.on(PLAY,this._onPlay)}},{key:"setConfig",value:function(e){var t=this;if(e){var i=Object.keys(e);i.length<1||(i.forEach((function(i){t.config[i]=e[i]})),this.updateSegments())}}},{key:"updateSegments",value:function(){var e=this.config,t=e.disable,i=e.segments,r=this.player;if(t||!i||0===i.length)r.timeSegments=[],r.offsetDuration=0,r.offsetCurrentTime=-1;else{var n=this.formatTimeSegments(i,r.duration);r.timeSegments=n,r.offsetDuration=n.length>0?n[n.length-1].duration:0}}},{key:"formatTimeSegments",value:function(e,t){var i=[];return e?(e.sort((function(e,t){return e.start-t.start})),e.forEach((function(e,r){var n={};if(n.start=e.start<0?0:e.start,n.end=t>0&&e.end>t?t:e.end,!(t>0&&n.start>t)){i.push(n);var o=n.end-n.start;if(0===r)n.offset=e.start,n.cTime=0,n.segDuration=o,n.duration=o;else{var a=i[r-1];n.offset=a.offset+(n.start-a.end),n.cTime=a.duration+a.cTime,n.segDuration=o,n.duration=a.duration+o}}})),i):[]}},{key:"getSeekTime",value:function(e,t,i,r){var n=-1,o=r[i],a=o.start,s=o.end;if(e>=a&&e<=s)return n;var l=e-t;if(l<0&&e<a){var c=t>a?t-a:0;return n=i-1>=0?r[i-1].end+l+c:0}return-1}},{key:"_checkIfEnabled",value:function(e){return!(!e||e.length<1)}},{key:"changeIndex",value:function(e,t){this.curIndex=e,e>=0&&t.length>0?this.curPos=t[e]:this.curPos=null}}],[{key:"pluginName",get:function(){return"TimeSegmentsControls"}},{key:"defaultConfig",get:function(){return{disable:!0,segments:[]}}}]),i}();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$1(i,Plugin);var t=_createSuper$1(i);function i(){var e;_classCallCheck$2(this,i);for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return _defineProperty$2(_assertThisInitialized$1(e=t.call.apply(t,[this].concat(n))),"onBarMousedown",(function(t){var i=_assertThisInitialized$1(e).player,r=e.find(".xgplayer-bar");util.event(t);var n=r.getBoundingClientRect(),o=util.getEventPos(t,i.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$2(_assertThisInitialized$1(e),"onBarMouseMove",(function(t){var i=_assertThisInitialized$1(e)._d;if(i.isStart){var r=_assertThisInitialized$1(e),n=r.pos,o=r.player;t.preventDefault(),t.stopPropagation(),util.event(t);var a=util.getEventPos(t,o.zoom);i.isMoving=!0;var s=n.h-a.clientY+n.clientY;s>n.barH||e.updateVolumePos(s,t)}})),_defineProperty$2(_assertThisInitialized$1(e),"onBarMouseUp",(function(t){util.event(t),document.removeEventListener("mouseup",e.onBarMouseUp);var i=_assertThisInitialized$1(e)._d;i.isStart=!1,i.isMoving=!1})),_defineProperty$2(_assertThisInitialized$1(e),"onMouseenter",(function(t){e._d.isActive=!0,e.focus(),e.emit("icon_mouseenter",{pluginName:e.pluginName})})),_defineProperty$2(_assertThisInitialized$1(e),"onMouseleave",(function(t){e._d.isActive=!1,e.unFocus(100,!1,t),e.emit("icon_mouseleave",{pluginName:e.pluginName})})),_defineProperty$2(_assertThisInitialized$1(e),"onVolumeChange",(function(t){if(e.player){var i=e.player,r=i.muted,n=i.volume;e._d.isMoving||(e.find(".xgplayer-drag").style.height=r||0===n?"4px":"".concat(100*n,"%"),e.config.showValueLabel&&e.updateVolumeValue()),e.animate(r,n)}})),e}return _createClass$2(i,[{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,i=t.commonStyle,r=t.volume;i.volumeColor&&(this.find(".xgplayer-drag").style.backgroundColor=i.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.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(r)&&(this.player.volume=this.config.default),this.onVolumeChange()}}},{key:"updateVolumePos",value:function(e,t){var i=this.player,r=this.find(".xgplayer-drag"),n=this.find(".xgplayer-bar");if(n&&r){var o=parseInt(e/n.getBoundingClientRect().height*1e3,10);r.style.height="".concat(e,"px");var a=Math.max(Math.min(o/1e3,1),0),s={volume:{from:i.volume,to:a}};i.muted&&(s.muted={from:!0,to:!1}),this.emitUserAction(t,"change_volume",{muted:i.muted,volume:i.volume,props:s}),i.volume=Math.max(Math.min(o/1e3,1),0),i.muted&&(i.muted=!1),this.config.showValueLabel&&this.updateVolumeValue()}}},{key:"updateVolumeValue",value:function(){var e=this.player,t=e.volume,i=e.muted,r=this.find(".xgplayer-value-label"),n=Math.max(Math.min(t,1),0);r.innerText=i?0:Math.round(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,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=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||(i?o.blur():o.focus(),util.removeClass(e.root,"slide-show"),n.isStart&&e.onBarMouseUp(r)),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.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$7.CONTROLS_RIGHT,index:1,disable:!1,showValueLabel:!1,default:.6,miniVolume:.2}}}]),i}();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>\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>\n <rect width="40" height="40" fill="white"/>\n </clipPath>\n </defs>\n</svg>\n',"image/svg+xml").firstChild}var Rotate=function(e){_inherits$1(i,Icon);var t=_createSuper$1(i);function i(e){var r;return _classCallCheck$2(this,i),(r=t.call(this,e)).rotateDeg=r.config.rotateDeg||0,r}return _createClass$2(i,[{key:"afterCreate",value:function(){var e=this;if(!this.config.disable){_get$1(_getPrototypeOf$1(i.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&&e.config.innerRotate&&util.setTimeout(e,(function(){e.updateRotateDeg(e.rotateDeg,e.config.innerRotate)}),100)}));var t=this.player.root;this.rootWidth=t.style.width||t.offsetWidth||t.clientWidth,this.rootHeight=t.style.height||t.offsetHeight||t.clientHeight,this.rotateDeg&&this.updateRotateDeg(this.rotateDeg,this.config.innerRotate)}}},{key:"destroy",value:function(){_get$1(_getPrototypeOf$1(i.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){if(e||(e=0),t)this.player.videoRotateDeg=e;else{var i=this.player,r=this.rootWidth,n=this.rootHeight,o=i.root,a=i.innerContainer,s=i.media,l=o.offsetWidth,c=a&&t?a.offsetHeight:o.offsetHeight,u=r,d=n,h=0,p=0;.75!==e&&.25!==e||(u="".concat(c,"px"),d="".concat(l,"px"),h=-(c-l)/2,p=-(l-c)/2);var f="translate(".concat(h,"px,").concat(p,"px) rotate(").concat(e,"turn)"),g={transformOrigin:"center center",transform:f,webKitTransform:f,height:d,width:u},y=t?s:o,_=t?i.getPlugin("poster"):null;Object.keys(g).map((function(e){y.style[e]=g[e],_&&_.root&&(_.root.style[e]=g[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],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=this.player;this.rotateDeg||(this.rotateDeg=0);var n=e?1:-1;this.rotateDeg=(this.rotateDeg+1+.25*n*i)%1,this.updateRotateDeg(this.rotateDeg,t),r.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$7.CONTROLS_RIGHT,index:6,innerRotate:!0,clockwise:!1,rotateDeg:0,disable:!1}}}]),i}();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$1(i,Icon);var t=_createSuper$1(i);function i(){var e;_classCallCheck$2(this,i);for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return _defineProperty$2(_assertThisInitialized$1(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$2(i,[{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$1(_getPrototypeOf$1(i.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 i=t.paused;util.setTimeout(e,(function(){!i&&t.mediaPlay()}),0),!i&&t.mediaPlay(),e.setAttr("data-state","normal"),e.pipWindow=null,t.emit(PIP_CHANGE,!1)},this.enterPIPCallback=function(i){t.emit(PIP_CHANGE,!0),null!=i&&i.pictureInPictureWindow&&(e.pipWindow=i.pictureInPictureWindow),e.setAttr("data-state","pip")},this.onWebkitpresentationmodechanged=function(i){var r=t.media.webkitPresentationMode;e.pMode===PresentationMode.FULLSCREEN&&r!==PresentationMode.FULLSCREEN&&t.onFullscreenChange(null,!1),e.pMode=r,r===PresentationMode.PIP?e.enterPIPCallback(i):r===PresentationMode.INLINE&&e.leavePIPCallback(i)},t.media&&(t.media.addEventListener("enterpictureinpicture",this.enterPIPCallback),t.media.addEventListener("leavepictureinpicture",this.leavePIPCallback),i.checkWebkitSetPresentationMode(t.media)&&t.media.addEventListener("webkitpresentationmodechanged",this.onWebkitpresentationmodechanged))}},{key:"copyStyleIntoPiPWindow",value:function(e){var t=_toConsumableArray$1(document.styleSheets).map((function(t){try{return _toConsumableArray$1(t.cssRules).map((function(e){return e.cssText})).join("")}catch(r){var i=document.createElement("link");i.rel="stylesheet",i.type=t.type,i.media=t.media,i.href=t.href,e.document.head.appendChild(i)}return""})).filter(Boolean).join("\n"),i=document.createElement("style");i.textContent=t,e.document.head.appendChild(i)}},{key:"requestPIP",value:function(){var e=this,t=this.player,r=this.playerConfig,n=this.config;if(this.isPIPAvailable()&&!this.isPip)try{var o=r.poster;if(o&&(t.media.poster="String"===util.typeOf(o)?o:o.poster),n.preferDocument&&this.isDocPIPAvailable()){var a={};if(n.width&&n.height)a.width=n.width,a.height=n.height;else{var s=t.root.getBoundingClientRect();a.width=s.width,a.height=s.height}documentPictureInPicture.requestWindow(a).then((function(i){var r=n.docPiPNode,o=n.docPiPStyle;e.enterPIPCallback();var a=r||t.root,s=a.parentElement,l=a.previousSibling,c=a.nextSibling;e.copyStyleIntoPiPWindow(i);var u=document.createElement("style");if(u.append("body{padding:0; margin:0;}"),o){var d="";"string"==typeof o?d=o:"function"==typeof o&&(d=o.call(n)),d&&u.append(d)}else a===t.root&&u.append("\n .xgplayer{width: 100%!important; height: 100%!important;}\n ");i.document.head.append(u),i.document.body.append(a),i.addEventListener("pagehide",(function(t){s&&(c?s.insertBefore(a,c):l?s.insertBefore(a,l.nextSibling):s.appendChild(a)),e.leavePIPCallback()}),{once:!0})}))}else i.checkWebkitSetPresentationMode(t.media)?t.media.webkitSetPresentationMode("picture-in-picture"):t.media.requestPictureInPicture();return!0}catch(e){return console.error("requestPiP",e),!1}}},{key:"exitPIP",value:function(){var e=this.player;try{var t;if(this.isPIPAvailable()&&this.isPip)this.isDocPIPAvailable()&&null!==(t=documentPictureInPicture)&&void 0!==t&&t.window?documentPictureInPicture.window.close():i.checkWebkitSetPresentationMode(e.media)?e.media.webkitSetPresentationMode("inline"):document.exitPictureInPicture();return!0}catch(e){return console.error("exitPIP",e),!1}}},{key:"isPip",get:function(){var e,t=this.player;return!(!this.isDocPIPAvailable()||null===(e=documentPictureInPicture)||void 0===e||!e.window)||document.pictureInPictureElement&&document.pictureInPictureElement===t.media||t.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))||this.isDocPIPAvailable()}},{key:"isDocPIPAvailable",value:function(){return"documentPictureInPicture"in window&&/^(https|file)/.test(location.protocol)}},{key:"destroy",value:function(){_get$1(_getPrototypeOf$1(i.prototype),"destroy",this).call(this);var e=this.player;e.media.removeEventListener("enterpictureinpicture",this.enterPIPCallback),e.media.removeEventListener("leavepictureinpicture",this.leavePIPCallback),i.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$7.CONTROLS_RIGHT,index:6,showIcon:!1,preferDocument:!1,width:void 0,height:void 0,docPiPNode:void 0,docPiPStyle:void 0}}},{key:"checkWebkitSetPresentationMode",value:function(e){return"function"==typeof e.webkitSetPresentationMode}}]),i}();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$1(i,Plugin);var t=_createSuper$1(i);function i(e){var r;return _classCallCheck$2(this,i),_defineProperty$2(_assertThisInitialized$1(r=t.call(this,e)),"playNext",(function(e){var t=_assertThisInitialized$1(r).player;e.preventDefault(),e.stopPropagation(),r.idx+1<r.config.urlList.length?(r.idx++,r.nextHandler(r.config.urlList[r.idx],r.idx),t.emit(PLAYNEXT,r.idx+1)):(r.nextHandler(),t.emit(PLAYNEXT))})),r.idx=-1,r}return _createClass$2(i,[{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.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$7.CONTROLS_LEFT,index:1,url:null,urlList:[]}}}]),i}(),download={exports:({},function e(t,i,r){var n,o,a=window,s="application/octet-stream",l=r||s,c=t,u=!i&&!r&&c,d=document.createElement("a"),h=function(e){return String(e)},p=a.Blob||a.MozBlob||a.WebKitBlob||h,f=i||"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],d.href=u,-1!==d.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!==h))return navigator.msSaveBlob?navigator.msSaveBlob(v(c),f):E(c);l=(c=v(c)).type||s}else if(/([\x80-\xff])/.test(c)){for(var y=0,_=new Uint8Array(c.length),m=_.length;y<m;++y)_[y]=c.charCodeAt(y);c=new p([_],{type:l})}function v(e){for(var t=e.split(/[:;,]/),i=t[1],r=("base64"==t[2]?atob:decodeURIComponent)(t.pop()),n=r.length,o=0,a=new Uint8Array(n);o<n;++o)a[o]=r.charCodeAt(o);return new p([a],{type:i})}function E(e,t){if("download"in d)return d.href=e,d.setAttribute("download",f),d.className="download-js-link",d.innerHTML="downloading...",d.style.display="none",document.body.appendChild(d),setTimeout((function(){d.click(),document.body.removeChild(d),!0===t&&setTimeout((function(){a.URL.revokeObjectURL(d.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 i=document.createElement("iframe");document.body.appendChild(i),!t&&/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,s)),i.src=e,setTimeout((function(){document.body.removeChild(i)}),333)}if(n=c instanceof p?c:new p([c],{type:l}),navigator.msSaveBlob)return navigator.msSaveBlob(n,f);if(a.URL)E(a.URL.createObjectURL(n),!0);else{if("string"==typeof n||n.constructor===h)try{return E("data:"+l+";base64,"+a.btoa(n))}catch(e){return E("data:"+l+","+encodeURIComponent(n))}(o=new FileReader).onload=function(e){E(this.result)},o.readAsDataURL(n)}return!0})},downloadExports=download.exports;const downloadUtil=getDefaultExportFromCjs(downloadExports);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$1(i,Icon);var t=_createSuper$1(i);function i(e){var r;return _classCallCheck$2(this,i),_defineProperty$2(_assertThisInitialized$1(r=t.call(this,e)),"download",(function(e){if(!r.isLock){r.emitUserAction(e,"download");var t=r.playerConfig.url,i="";"String"===util.typeOf(t)?i=t:"Array"===util.typeOf(t)&&t.length>0&&(i=t[0].src);var n=r.getAbsoluteURL(i);downloadUtil(n),r.isLock=!0,r.timer=window.setTimeout((function(){r.isLock=!1,window.clearTimeout(r.timer),r.timer=null}),300)}})),r.timer=null,r.isLock=!1,r}return _createClass$2(i,[{key:"afterCreate",value:function(){_get$1(_getPrototypeOf$1(i.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$1(_getPrototypeOf$1(i.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$7.CONTROLS_RIGHT,index:3,disable:!0}}}]),i}(),ScreenShot=function(e){_inherits$1(i,Icon);var t=_createSuper$1(i);function i(){return _classCallCheck$2(this,i),t.apply(this,arguments)}return _createClass$2(i,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.screenShot&&(e.config.disable=!e.player.config.screenShot)}},{key:"afterCreate",value:function(){_get$1(_getPrototypeOf$1(i.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 i,r=document.createElement("a");r.href=e,r.download=t;try{"undefined"!=typeof MouseEvent?i=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window}):(i=document.createEvent("MouseEvents")).initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null)}catch(e){console.error("MouseEvent unsupported",e)}i&&r.dispatchEvent(i)}},{key:"createCanvas",value:function(e,t){var i=document.createElement("canvas"),r=i.getContext("2d");this.canvasCtx=r,this.canvas=i,i.width=e||this.config.width,i.height=t||this.config.height,r.imageSmoothingEnabled=!0,r.imageSmoothingEnabled&&(r.imageSmoothingQuality="high")}},{key:"onClickBtn",value:function(e){var t=this;e.preventDefault(),e.stopPropagation(),this.emitUserAction(e,"shot");var i=this.config;this.shot(i.width,i.height).then((function(e){t.emit(SCREEN_SHOT,e),i.saveImg&&t.saveScreenShot(e,i.name+i.format)}))}},{key:"shot",value:function(e,t){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{quality:.92,type:"image/png"},n=this.config,o=this.player,a=r.quality||n.quality,s=r.type||n.type;return new Promise((function(r,l){var c,u=null;if(o.media.canvas)u=o.media.canvas;else{i.canvas?(i.canvas.width=e||n.width,i.canvas.height=t||n.height):i.createCanvas(e,t),u=i.canvas,c=i.canvasCtx;var d,h,p,f,g=o.media.videoWidth/o.media.videoHeight,y=u.width/u.height,_=o.media.videoWidth,m=o.media.videoHeight;g>y?(p=u.width,f=u.width/g,d=0,h=Math.round((u.height-f)/2)):g===y?(p=u.width,f=u.height,d=0,h=0):g<y&&(p=u.height*g,f=u.height,d=Math.round((u.width-p)/2),h=0),c.drawImage(o.media,0,0,_,m,d,h,p,f)}var v=u.toDataURL(s,a).replace(s,"image/octet-stream");r(v=v.replace(/^data:image\/[^;]+/,"data:application/octet-stream"))}))}},{key:"registerIcons",value:function(){return{screenshotIcon:null}}},{key:"destroy",value:function(){_get$1(_getPrototypeOf$1(i.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$7.CONTROLS_RIGHT,index:5,quality:.92,type:"image/png",format:".png",width:600,height:337,saveImg:!0,fitVideo:!0,disable:!1,name:"screenshot"}}}]),i}(),DefinitionIcon=function(e){_inherits$1(i,OptionsIcon);var t=_createSuper$1(i);function i(e){var r;return _classCallCheck$2(this,i),(r=t.call(this,e)).curTime=0,r.isPaused=!0,r}return _createClass$2(i,[{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$1(_getPrototypeOf$1(i.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(e){!this.config.list||this.config.list.length<2||util.addClass(this.root,"show")}},{key:"initDefinition",value:function(){var e=this.config,t=e.list,i=e.defaultDefinition;if(t.length>0){var r=null;t.map((function(e){e.definition===i&&(r=e)})),r||(r=t[0]),this.changeDefinition(r)}}},{key:"renderItemList",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.list||[],r=arguments.length>1?arguments[1]:void 0,n=r&&r.definition?r.definition:this.config.defaultDefinition;r&&t.forEach((function(e){e.selected=!1}));var o=0,a=t.map((function(t,i){var r=_objectSpread2$2(_objectSpread2$2({},t),{},{showText:e.getTextByLang(t)||t.definition,selected:!1});return(t.selected||t.definition&&t.definition==n)&&(r.selected=!0,o=i),r}));_get$1(_getPrototypeOf$1(i.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 r=this.player.definitionList;_get$1(_getPrototypeOf$1(i.prototype),"onItemClick",this).apply(this,arguments),this.emitUserAction(e,"change_definition",{from:t.from,to:t.to});for(var n=0;n<r.length;n++)t.to&&r[n].definition===t.to.definition&&(t.to.url=r[n].url),t.from&&r[n].definition===t.from.definition&&(t.from.url=r[n].url);this.player.changeDefinition(t.to,t.from)}}],[{key:"pluginName",get:function(){return"definition"}},{key:"defaultConfig",get:function(){return _objectSpread2$2(_objectSpread2$2({},OptionsIcon.defaultConfig),{},{position:POSITIONS$7.CONTROLS_RIGHT,index:3,list:[],defaultDefinition:"",disable:!1,hidePortrait:!1,className:"xgplayer-definition",isShowIcon:!0})}}]),i}(),PlaybackRate=function(e){_inherits$1(i,OptionsIcon);var t=_createSuper$1(i);function i(e){var r;return _classCallCheck$2(this,i),(r=t.call(this,e)).curRate=1,r}return _createClass$2(i,[{key:"beforeCreate",value:function(e){var t=e.player.config.playbackRate,i=t?Array.isArray(t)?t:e.config.list:[];Array.isArray(i)&&(e.config.list=i.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$1(_getPrototypeOf$1(i.prototype),"afterCreate",this).call(this),this.on(RATE_CHANGE,(function(){e.curValue!==e.player.playbackRate&&e.renderItemList()})),this.renderItemList()}},{key:"show",value:function(e){this.config.list&&0!==this.config.list.length&&_get$1(_getPrototypeOf$1(i.prototype),"show",this).call(this)}},{key:"onItemClick",value:function(e,t){_get$1(_getPrototypeOf$1(i.prototype),"onItemClick",this).call(this,e,t);var r=e.delegateTarget,n=Number(r.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 r=-1,n=this.config.list.map((function(i,n){var o={rate:i.rate};return o.rate===t&&(o.selected=!0,r=n),o.showText=e.getTextByLang(i),o}));_get$1(_getPrototypeOf$1(i.prototype),"renderItemList",this).call(this,n,r)}},{key:"changeCurrentText",value:function(){if(!this.isIcons){var e=this.config.list,t=e[this.curIndex<e.length?this.curIndex:0],i="";i=!t||this.curIndex<0?"".concat(this.player.playbackRate,"x"):this.getTextByLang(t,"iconText"),this.find(".icon-text").innerHTML=i}}},{key:"destroy",value:function(){_get$1(_getPrototypeOf$1(i.prototype),"destroy",this).call(this)}}],[{key:"pluginName",get:function(){return"playbackRate"}},{key:"defaultConfig",get:function(){return _objectSpread2$2(_objectSpread2$2({},OptionsIcon.defaultConfig),{},{position:POSITIONS$7.CONTROLS_RIGHT,index:4,list:[2,1.5,1,.75,.5],className:"xgplayer-playbackrate",isShowIcon:!0,hidePortrait:!1})}}]),i}();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$1(i,Icon);var t=_createSuper$1(i);function i(){return _classCallCheck$2(this,i),t.apply(this,arguments)}return _createClass$2(i,[{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$1(_getPrototypeOf$1(i.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,i=this.find(".xg-tips");i&&this.changeLangTextKey(i,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$1(_getPrototypeOf$1(i.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$7.CONTROLS_RIGHT,index:1,disable:!1,target:null}}}]),i}(),ErrorPlugin2=function(e){_inherits$1(i,Plugin);var t=_createSuper$1(i);function i(){return _classCallCheck$2(this,i),t.apply(this,arguments)}return _createClass$2(i,[{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,i=e.errorType,r=t.errorNote?this.i18n[t.errorNote]:"";if(!r)switch(i){case"decoder":r=this.i18n.MEDIA_ERR_DECODE;break;case"network":r=this.i18n.MEDIA_ERR_NETWORK;break;default:r=this.i18n.MEDIA_ERR_SRC_NOT_SUPPORTED}this.find(".xgplayer-error-text").innerHTML=r,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"}}]),i}(),Prompt=function(e){_inherits$1(i,Plugin);var t=_createSuper$1(i);function i(){return _classCallCheck$2(this,i),t.apply(this,arguments)}return _createClass$2(i,[{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.showPrompt.apply(e,arguments)},this.player.hidePrompt=function(){e.hide()}}},{key:"setStyle",value:function(e){var t=this;Object.keys(e).map((function(i){t.root.style[i]=e[i]}))}},{key:"showPrompt",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(e){this.customOnClick=r;var n=this.config.interval;if(this.intervalId&&(clearTimeout(this.intervalId),this.intervalId=null),util.addClass(this.root,"show"),"arrow"===i.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>"):""),i.style&&this.setStyle(i.style),"boolean"==typeof i.autoHide?i.autoHide:this.config.autoHide){var o=i.interval||n;this.intervalId=setTimeout((function(){t.hide()}),o)}}}},{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(){}}}}]),i}(),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 i=this.calcuPosition(e.time,e.duration),r=e.style||{};r.left="".concat(i.left,"%"),r.width="".concat(i.width,"%"),t.setAttribute("data-text",e.text),t.setAttribute("data-time",e.time),i.isMini?util.addClass(t,"mini"):util.removeClass(t,"mini"),Object.keys(r).map((function(e){t.style[e]=r[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],i=this.player.plugins.progress;if(i&&(t&&(mergeISPOT(e),this._ispots.push(e)),this.ispotsInit||!t)){var r=this.calcuPosition(e.time,e.duration),n=e.style||{};n.left="".concat(r.left,"%"),n.width="".concat(r.width,"%");var o="xgspot_".concat(e.id," xgplayer-spot");r.isMini&&(o+=" mini");var a=e.template?'<div class="xgplayer-spot-pop">'.concat(e.template,"</div>"):"",s=util.createDom("xg-spot",a,{"data-text":e.text,"data-time":e.time,"data-id":e.id},o);Object.keys(n).map((function(e){s.style[e]=n[e]})),i.outer&&i.outer.appendChild(s),this.positionDot(s,e.id)}},findDot:function(e){if(this.player.plugins.progress){var t=this._ispots.filter((function(t,i){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],i=this.player.plugins.progress;if(i){var r=this.findDot(e.id);if(r&&Object.keys(e).map((function(t){r[t]=e[t]})),this.ispotsInit){var n=i.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,i=this.player.plugins.progress;if(i){for(var r=[],n=0;n<t.length;n++)t[n].id===e&&r.push(n);for(var o=r.length-1;o>=0;o--)if(t.splice(r[o],1),this.ispotsInit){var a=i.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"),i=t.length-1;i>=0;i--)e.outer.removeChild(t[i]);this._ispots=[]}else this._ispots=[]},updateAllDots:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=this.player.plugins.progress;if(i)if(this.ispotsInit){this._ispots=[];var r=i.root.getElementsByTagName("xg-spot"),n=r.length;if(n>t.length)for(var o=n-1;o>t.length-1;o--)i.outer.removeChild(r[o]);t.forEach((function(t,i){i<n?(r[i].setAttribute("data-id","".concat(t.id)),e._ispots.push(t),e.updateDot(t)):e.createDot(t)}))}else this._ispots=t},positionDots:function(){var e=this,t=this._ispots,i=this.playerSize,r=this.player.sizeInfo,n=this.player.plugins.progress;n&&r.width!==i.width&&(i.width=r.width,i.left=r.left,t.forEach((function(t){var i=n.find('xg-spot[data-id="'.concat(t.id,'"]'));i&&e.positionDot(i,t.id)})))},positionDot:function(e,t){var i=util.findDom(e,".xgplayer-spot-pop");if(i){var r=this.playerSize,n=e.getBoundingClientRect(),o=i.getBoundingClientRect(),a=n.left-r.left,s=r.width-a-n.width/2;if(a<o.width/2||r.width<o.width){var l=o.width/2-a;i.style.left="".concat(l,"px")}else if(s<o.width/2){var c=s-o.width/2+n.width/2;i.style.left="".concat(c,"px")}else i.style.left="50%"}},updateDuration:function(){var e=this,t=this.player.plugins.progress;t&&this._ispots.forEach((function(i){var r=t.find('xg-spot[data-id="'.concat(i.id,'"]'));e._updateDotDom(i,r)}))},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,i=e.player;Object.keys(APIS).map((function(t){e[t]=APIS[t].bind(e)}));var r=i.config.progressDot||t.ispots||[];e._ispots=r.map((function(e){return mergeISPOT(e),e})),e.ispotsInit=!1,e.playerSize={left:i.sizeInfo.left,width:i.sizeInfo.width},e.on(DURATION_CHANGE,(function(){e.ispotsInit?e.updateDuration():e.initDots()})),e.on(VIDEO_RESIZE,(function(){e.positionDots()}))}var CALLBACK_MAP={dragmove:"onProgressMove",dragstart:"onProgressDragStart",dragend:"onProgressDragEnd",click:"onProgressClick",mouseover:"onProgressMouseOver",mouseenter:"onProgressMouseOver"},ProgressPreview=function(e){_inherits$1(i,Plugin);var t=_createSuper$1(i);function i(e){var r;return _classCallCheck$2(this,i),_defineProperty$2(_assertThisInitialized$1(r=t.call(this,e)),"onMousemove",(function(e){r.config.disable||(util.hasClass(e.target,"xg-spot-content")&&r.config.isHideThumbnailHover?r.player.plugins.progress.onMouseLeave(e):(r._state.f||util.hasClass(e.target,"xg-spot-content"))&&(util.event(e),e.stopPropagation()))})),_defineProperty$2(_assertThisInitialized$1(r),"onMousedown",(function(e){r.config.disable||(r._state.f||util.hasClass(e.target,"xg-spot-content"))&&(util.event(e),e.stopPropagation())})),_defineProperty$2(_assertThisInitialized$1(r),"onMouseup",(function(e){if(r.isDrag){var t=r.player.plugins.progress;t&&t.pos&&(t.onMouseUp(e),!t.pos.isEnter&&t.onMouseLeave(e))}})),_defineProperty$2(_assertThisInitialized$1(r),"onDotMouseLeave",(function(e){if(!r.config.disable){r._curDot.removeEventListener("mouseleave",r.onDotMouseLeave),r.blurDot(e.target),r._curDot=null;var t=r.player.plugins.progress;t&&t.enableBlur(),r.show()}})),_defineProperty$2(_assertThisInitialized$1(r),"onProgressMouseOver",(function(e,t){if(!r.config.disable&&util.hasClass(t.target,"xgplayer-spot")&&!r._curDot){r._curDot=t.target,r.focusDot(t.target),r._curDot.children.length>0&&r.hide();var i=r.player.plugins.progress;i&&i.disableBlur(),r._curDot.addEventListener("mouseleave",r.onDotMouseLeave)}})),r._ispots=[],r.videoPreview=null,r.videothumbnail=null,r.thumbnail=null,r.timeStr="",r._state={now:0,f:!1},r}return _createClass$2(i,[{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,i){i.seekTime&&e.player.seek(i.seekTime)})),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(i){t.config[i]=e[i]}))}},{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(i){e[CALLBACK_MAP[i]]=e[CALLBACK_MAP[i]].bind(e),t.addCallBack(i,e[CALLBACK_MAP[i]])})),"mobile"!==sniffer.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 i=this.hook("previewClick",(function(){}));this.handlerPreviewClick=function(r){r.stopPropagation(),i(parseInt(1e3*e._state.now,10)/1e3,r),t&&t.onMouseUp(r)},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(i){e[i]=t.target.getAttribute("data-".concat(i))})),e.time&&(e.time=Number(e.time)),this.handlerSpotClick(t,e))}},{key:"updateLinePos",value:function(e,t){var i=this.root,r=this.previewLine,n=this.player,o=this.config,a="flex"===n.controls.mode,s=i.getBoundingClientRect().width;if(s||!this._hasThumnail){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&&(r.style.transform="translateX(".concat(l.toFixed(2),"px)")),i.style.transform="translateX(".concat(c.toFixed(2),"px) translateZ(0)")}}},{key:"updateTimeText",value:function(e){var t=this.timeText,i=this.timePoint;t.innerHTML=e,!this.thumbnail&&(i.innerHTML=e)}},{key:"updatePosition",value:function(e,t,i,r){var n=this.root,o=this.config,a=this._state;if(n){a.now=i,this.transformTimeHook(i);var s=this.timeStr;r&&r.target&&util.hasClass(r.target,"xgplayer-spot")?(this.showTips(r.target.getAttribute("data-text"),!1,s),this.focusDot(r.target),a.f=!0,o.isFocusDots&&a.f&&(a.now=parseInt(r.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,i=this.videoPreview,r=this.config,n=t.plugins.thumbnail;if(n&&n.usable){this.thumbnail&&n.update(this.thumbnail,e,r.width,r.height);var o=i&&i.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.device){var t=this.player,i=this.config,r=t.getPlugin("thumbnail");if(r&&r.setConfig(e),r&&r.usable&&i.isShowThumbnail){util.removeClass(this.root,"short-line no-thumbnail"),"short"===i.mode&&util.addClass(this.root,"short-line"),this._hasThumnail=!0;var n=this.find(".xg-spot-thumbnail");this.thumbnail=r.createThumbnail(n,"progress-thumbnail"),i.isShowCoverPreview&&(this.videoPreview=util.createDom("xg-video-preview","",{},"xgvideo-preview"),t.root.appendChild(this.videoPreview),this.videothumbnail=r.createThumbnail(this.videoPreview,"xgvideo-thumbnail")),this.updateThumbnails(0)}else util.addClass(this.root,"short-line no-thumbnail")}}},{key:"calcuPosition",value:function(e,t){var i=this.player.plugins.progress,r=this.player,n=i.root.getBoundingClientRect().width,o=r.duration/n*6;return e+t>r.duration&&(t=r.duration-e),r.duration,r.duration,{left:e/r.duration*100,width:t/r.duration*100,isMini:t<o}}},{key:"showDot",value:function(e){var t=this.findDot(e);if(t){var i=this.root.getBoundingClientRect().width,r=t.time/this.player.duration*i;this.updatePosition(r,i,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 i=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(i," ").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(e){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(i){t.removeCallBack(i,e[CALLBACK_MAP[i]])})),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.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}}}]),i}(),Thumbnail=function(e){_inherits$1(i,Plugin);var t=_createSuper$1(i);function i(e){var r;return _classCallCheck$2(this,i),(r=t.call(this,e)).ratio=1,r.interval=null,r._preloadMark={},r}return _createClass$2(i,[{key:"afterCreate",value:function(){var e=this;this.usable&&this.initThumbnail(),this.on([DURATION_CHANGE],(function(){var t=e.config,i=t.pic_num,r=t.interval;e.usable&&(e.interval=r>0?r:Math.round(1e3*e.player.duration/i)/1e3)}))}},{key:"setConfig",value:function(e){var t=this;if(e){var i=Object.keys(e);i.length<1||(i.forEach((function(i){t.config[i]=e[i]})),this.usable&&this.initThumbnail())}}},{key:"usable",get:function(){var e=this.config,t=e.urls,i=e.pic_num;return t&&t.length>0&&i>0}},{key:"initThumbnail",value:function(){var e=this.config,t=e.width,i=e.height,r=e.pic_num,n=e.interval;this.ratio=t/i*100,this.interval=n||Math.round(this.player.duration/r),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 i=this.config.urls,r=i.length,n=[];e>0&&n.push(e-1),n.push(e),e>0&&e<r-1&&n.push(e+1),n.map((function(e){!t._preloadMark[e]&&e>=0&&e<r&&(t._preloadMark[e]=1,util.preloadImg(i[e],(function(){t._preloadMark[e]=2})))}))}}},{key:"getPosition",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.config,n=r.pic_num,o=r.row,a=r.col,s=r.width,l=r.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,d=c-u*(a*o),h=d>0?Math.ceil(d/a)-1:0,p=d>0?d-h*a-1:0,f=0,g=0;t&&i?t/i<s/l?f=(g=i)*(s/l):g=(f=t)/(s/l):i?t||(f=(g=i||l)*(s/l)):g=(f=t||s)/(s/l);var y=this.getUrlByIndex(u);return{urlIndex:u,rowIndex:h,colIndex:p,url:y,height:g,width:f,style:{backgroundImage:"url(".concat(y,")"),backgroundSize:"".concat(f*a,"px auto"),backgroundPosition:"-".concat(p*f,"px -").concat(h*g,"px"),width:"".concat(f,"px"),height:"".concat(g,"px")}}}},{key:"update",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=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,i,r);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 i=util.createDom("xg-thumbnail","",{},"thumbnail ".concat(t));return e&&e.appendChild(i),i}}],[{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}}}]),i}();function getBgColor(e){return e?"background:".concat(e,";"):""}var MiniProgress=function(e){_inherits$1(i,Plugin);var t=_createSuper$1(i);function i(){var e;_classCallCheck$2(this,i);for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return _defineProperty$2(_assertThisInitialized$1(e=t.call.apply(t,[this].concat(n))),"onTimeupdate",(function(){var t=e.player.ended,i=_assertThisInitialized$1(e).offsetDuration,r=e.currentTime;r=util.adjustTimeByDuration(r,i,t),e.update({played:r},i)})),e}return _createClass$2(i,[{key:"offsetDuration",get:function(){return this.playerConfig.customDuration||this.player.offsetDuration||this.player.duration}},{key:"currentTime",get:function(){var e=this.player,t=e.offsetCurrentTime,i=e.currentTime;return t>=0?t:i}},{key:"afterCreate",value:function(){var e=this;this.root&&(this.on(TIME_UPDATE,this.onTimeupdate),this.on(EMPTIED,(function(){e.reset()})))}},{key:"reset",value:function(){this.update({played:0,cached:0},0)}},{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(){var e=this.playerConfig,t=e.commonStyle;if(e.miniprogress){var i=this.config,r=i.mode,n=i.height,o={cached:getBgColor(t.cachedColor),played:getBgColor(t.playedColor),progress:getBgColor(t.progressColor),height:n>0&&2!==n?"height: ".concat(n,"px;"):""};return'<xg-mini-progress class="xg-mini-progress '.concat("show"===r?"xg-mini-progress-show":"",'" style="').concat(o.progress," ").concat(o.height,'">\n <xg-mini-progress-cache class="xg-mini-progress-cache" style="').concat(o.cached,'"></xg-mini-progress-cache>\n <xg-mini-progress-played class="xg-mini-progress-played" style="').concat(o.played,'"></xg-mini-progress-played>\n </xg-mini-progress>')}}}],[{key:"pluginName",get:function(){return"MiniProgress"}},{key:"defaultConfig",get:function(){return{mode:"auto",height:2}}}]),i}(),MODES={REAL_TIME:"realtime",FIRST_FRAME:"firstframe",FRAME_RATE:"framerate",POSTER:"poster"};function nowTime(){try{return parseInt(window.performance.now(),10)}catch(e){return(new Date).getTime()}}function checkIsSupportCanvas(){try{return!!document.createElement("canvas").getContext}catch(e){return!1}}var isSupportCanvas=null,DynamicBg=function(e){_inherits$1(i,Plugin);var t=_createSuper$1(i);function i(){var e;_classCallCheck$2(this,i);for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return _defineProperty$2(_assertThisInitialized$1(e=t.call.apply(t,[this].concat(n))),"onLoadedData",(function(t){e.player&&(e._frameCount=e.config.startFrameCount,e.stop(),e.renderOnTimeupdate(t),e.off(TIME_UPDATE,e.renderOnTimeupdate),e.on(TIME_UPDATE,e.renderOnTimeupdate))})),_defineProperty$2(_assertThisInitialized$1(e),"onVisibilitychange",(function(t){"visible"===document.visibilityState?e._checkIfCanStart()&&e.start():"hidden"===document.visibilityState&&e.stop()})),_defineProperty$2(_assertThisInitialized$1(e),"renderOnTimeupdate",(function(t){if(e._frameCount>0)e.renderOnce(),e._frameCount--;else{e._isLoaded=!0,e.off(TIME_UPDATE,e.renderOnTimeupdate);var i=e.config.startInterval;!e.player.paused&&e._checkIfCanStart()&&e.start(0,i)}})),_defineProperty$2(_assertThisInitialized$1(e),"start",(function(t,i){var r=e.player.video,n=nowTime(),o=e.checkVideoIsSupport(r);o&&e.canvasCtx&&(i||(i=e.interval),e.stop(),r.videoWidth&&r.videoHeight&&(e.videoPI=r.videoHeight>0?parseInt(r.videoWidth/r.videoHeight*100,10):0,(e.config.mode===MODES.REAL_TIME||n-e.preTime>=i)&&(r&&r.videoWidth&&e.update(o,e.videoPI),e.preTime=n)),e.frameId="timer"===e._loopType?util.setTimeout(_assertThisInitialized$1(e),e.start,i):util.requestAnimationFrame(e.start))})),_defineProperty$2(_assertThisInitialized$1(e),"stop",(function(){e.frameId&&("timer"===e._loopType?util.clearTimeout(_assertThisInitialized$1(e),e.frameId):util.cancelAnimationFrame(e.frameId),e.frameId=null)})),e}return _createClass$2(i,[{key:"afterCreate",value:function(){var e=this;!0===this.playerConfig.dynamicBg&&(this.config.disable=!1),i.isSupport||(this.config.disable=!0);var t=this.config,r=t.disable,n=t.mode,o=t.frameRate;r||(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._loopType=this.config.mode!==MODES.REAL_TIME&&this.interval>=1e3?"timer":"animation",this.once(COMPLETE,(function(){e.player&&(e.init(),e.renderByPoster(),e.player.paused||e.start())})),n!==MODES.POSTER&&(n!==MODES.FIRST_FRAME&&(this.on(EMPTIED,(function(){e.stop()})),this.on(PLAY,(function(){var t=e.config.startInterval;e._checkIfCanStart()&&e.start(0,t)})),this.on(PAUSE,(function(){e.stop()}))),this.on(LOADED_DATA,this.onLoadedData),this.on(LOAD_START,(function(){e._isLoaded=!1,e.stop()})),document.addEventListener("visibilitychange",this.onVisibilitychange)))}},{key:"setConfig",value:function(e){var t=this;Object.keys(e).forEach((function(i){"root"===i&&e[i]!==t.config[i]?t.reRender(e[i]):"frameRate"===i?t.interval=parseInt(1e3/e[i],10):"disable"===i&&e[i]&&t.stop(),t.config[i]=e[i]}))}},{key:"init",value:function(e){var t=this.player,r=this.config;this.canvasFilter=i.supportCanvasFilter();try{var n=e||r.root;n||(n=r.isInnerRender&&t.innerContainer||t.root),n.insertAdjacentHTML("afterbegin",'<div class="xgplayer-dynamic-bg" data-index="'.concat(r.index,'"><canvas>\n </canvas><xgmask></xgmask></div>')),this.root=n.children[0],this.canvas=this.find("canvas"),this.canvasFilter||(this.canvas.style.filter=r.filter,this.canvas.style.webkitFilter=r.filter),this.mask=this.find("xgmask"),r.addMask&&(this.mask.style.background=r.maskBg),this.canvasCtx=this.canvas.getContext("2d")}catch(e){XG_DEBUG.logError("plugin:DynamicBg",e)}}},{key:"reRender",value:function(e){if(this.config.disable||this.root){this.stop();var t=this.root?this.root.parentElement:null;if(t!==e&&t.removeChild(this.root),e){this.init(e),this.renderOnce();var i=this.config.startInterval;this._checkIfCanStart()&&this.start(0,i)}else this.root=null}}},{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.browser||!util.isMSE(t)))return t;var i=t?t.tagName.toLowerCase():"";return"canvas"===i||"img"===i?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&&!this.player.paused&&e!==MODES.FIRST_FRAME&&e!==MODES.POSTER}},{key:"renderOnce",value:function(){var e=this.player.video;if(e.videoWidth&&e.videoHeight){this.videoPI=parseInt(e.videoWidth/e.videoHeight*100,10);var t=this.checkVideoIsSupport(e);t&&this.update(t,this.videoPI)}}},{key:"updateImg",value:function(e){var t=this;if(e){var i=this.canvas.getBoundingClientRect(),r=i.width,n=i.height,o=new window.Image;o.onload=function(){if(t.canvas&&!t.frameId&&!t.isStart){t.canvas.height=n,t.canvas.width=r;var e=parseInt(r/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 i=this._pos,r=this.config,n=this.canvas.getBoundingClientRect(),o=n.width,a=n.height;if(o!==i.width||a!==i.height||i.pi!==t){var s=parseInt(o/a*100,10);i.pi=t,i.width!==o&&(i.width=this.canvas.width=o),i.height!==a&&(i.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)),i.rwidth=c*r.multiple,i.rheight=l*r.multiple,i.x=(o-i.rwidth)/2,i.y=(a-i.rheight)/2}this.canvasFilter&&(this.canvasCtx.filter=r.filter),this.canvasCtx.drawImage(e,i.x,i.y,i.rwidth,i.rheight)}catch(e){XG_DEBUG.logError("plugin:DynamicBg",e)}}},{key:"destroy",value:function(){this.stop(),document.removeEventListener("visibilitychange",this.onVisibilitychange),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,startInterval:0,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.browser||"firefox"===sniffer.browser)}}]),i}(),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$1(i,BasePlugin);var t=_createSuper$1(i);function i(){var e;_classCallCheck$2(this,i);for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return _defineProperty$2(_assertThisInitialized$1(e=t.call.apply(t,[this].concat(n))),"_recordUserActions",(function(t){var i=e._getTime(),r=Object.assign({},t,{msg:t.msg||t.action});e._stats[INFO].push(_objectSpread2$2(_objectSpread2$2({type:"userAction"},i),{},{payload:r}))})),_defineProperty$2(_assertThisInitialized$1(e),"_onReset",(function(){e.reset()})),_defineProperty$2(_assertThisInitialized$1(e),"_recordInfo",(function(t){e.info(t)})),_defineProperty$2(_assertThisInitialized$1(e),"_downloadStats",(function(){var t=e.getStats(),i=new Blob([JSON.stringify(t)],{type:"application/json"}),r=window.URL.createObjectURL(i),n=document.createElement("a");n.style.display="none",n.href=r,n.download="player.txt",n.disabled=!1,n.click()})),e}return _createClass$2(i,[{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$2(_objectSpread2$2({},t),{},{payload:e}))}},{key:"_infoProfile",value:function(e){if(e&&e.startMs){var t=_objectSpread2$2({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$2(e={},INFO,[]),_defineProperty$2(e,"media",{}),e)}},{key:"getStats",value:function(){for(var e=this.player.media,t=[],i=0;i<e.buffered.length;i++)t.push({start:e.buffered.start(i),end:e.buffered.end(i)});var r={currentTime:e.currentTime,readyState:e.readyState,buffered:t,paused:e.paused,ended:e.ended};return this._stats.media=r,{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,i="";try{t instanceof Error?i=t.msg:void 0!==t&&(i=JSON.stringify(t))}catch(e){console.log("err",e)}return"[".concat(e.timeFormat,"] : ").concat(e.payload.msg," ").concat(i," ")}))}},{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{}}}]),i}(),GapJump=function(e){_inherits$1(i,Plugin);var t=_createSuper$1(i);function i(){var e;_classCallCheck$2(this,i);for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return _defineProperty$2(_assertThisInitialized$1(e=t.call.apply(t,[this].concat(n))),"onGapJump",(function(){var t=_assertThisInitialized$1(e),r=t.player,n=t.config;if(r.media.readyState!==HTMLMediaElement.HAVE_NOTHING){if(r.media.seeking){if(!e.seekingEventReceived)return}else e.seekingEventReceived=!1;if(!r.media.paused||0===r.media.currentTime||!e.hasPlayed){var o=r.media.buffered,a=n.smallGapLimit||.5,s=n.gapDetectionThreshold||.3,l=r.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>r.media.duration)){var d=u-l,h=d<=a;d<i.BROWSER_GAP_TOLERANCE||h&&(!1!==n.useGapJump&&(r.media.currentTime=e.isSafari?u+.1:u),e.player&&e.player.emit("detectGap"),console.log("gapJump gapIndex",c," isGapSamll:",h," currentTime:",r.media.currentTime," jumpSize:",l-r.media.currentTime),.08!==u&&r&&r.emit("log",{type:"oneevent",end_type:"gap",vid:r.config.vid,ext:{video_postion:Math.floor(1e3*u)}}))}}}}})),e}return _createClass$2(i,[{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,i){if(!e||!e.length)return null;if(1===e.length&&e.end(0)-e.start(0)<1e-6)return null;for(var r=this._getBuffered(e),n=null,o=0;o<r.length;o++){if(r[o].start>t&&(0===o||r[o-1].end-t<=i)){n=o;break}}return n}},{key:"_getBuffered",value:function(e){if(!e)return[];for(var t=[],i=0;i<e.length;i++)t.push({start:e.start(i),end:e.end(i)});return t}}],[{key:"pluginName",get:function(){return"gapJump"}},{key:"defaultConfig",get:function(){return{useGapJump:!1,smallGapLimit:.5,gapDetectionThreshold:.3}}}]),i}();GapJump.BROWSER_GAP_TOLERANCE=.001;var WaitingTimeoutJump=function(e){_inherits$1(i,Plugin);var t=_createSuper$1(i);function i(){var e;_classCallCheck$2(this,i);for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return _defineProperty$2(_assertThisInitialized$1(e=t.call.apply(t,[this].concat(n))),"onWaiting",(function(){var t=_assertThisInitialized$1(e).config;e.jumpCnt>t.jumpCntMax||e.timer||!1===t.useWaitingTimeoutJump||(e.timer=setTimeout(e.onJump,1e3*t.waitingTime))})),_defineProperty$2(_assertThisInitialized$1(e),"onJump",(function(){var t=_assertThisInitialized$1(e),i=t.player,r=t.config;if(clearTimeout(e.timer),e.timer=null,!(e.jumpCnt>r.jumpCntMax||!1===r.useWaitingTimeoutJump||i.media.paused&&0!==i.media.currentTime&&e.hasPlayed)){e.jumpSize=r.jumpSize*(e.jumpCnt+1),e.jumpCnt===r.jumpSize&&e.jumpSize<6&&(e.jumpSize=6);var n=i.currentTime+e.jumpSize;n>i.media.duration||(e.jumpCnt++,i.currentTime=n)}})),e}return _createClass$2(i,[{key:"afterCreate",value:function(){var e=this,t=this.config,i=t.useWaitingTimeoutJump,r=t.jumpSize;!1!==i&&(this.hasPlayed=!1,this.jumpCnt=0,this.timer=null,this.jumpSize=r,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}}}]),i}(),DEFAULT_SPEED_TYPE="cdn",SPEED_TYPE=["cdn"],TestSpeed=function(e){_inherits$1(i,Plugin);var t=_createSuper$1(i);function i(){var e;_classCallCheck$2(this,i);for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return _defineProperty$2(_assertThisInitialized$1(e=t.call.apply(t,[this].concat(n))),"getSpeed",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:DEFAULT_SPEED_TYPE;if(!e.speedListCache||!e.speedListCache[t])return 0;if(e.speedListCache[t].length<=0)return 0;var i=0;return e.speedListCache[t].map((function(e){i+=e})),Math.floor(i/e.speedListCache[t].length)})),_defineProperty$2(_assertThisInitialized$1(e),"startTimer",(function(){util.isMSE(e.player.video)||(e.initSpeedList(),e.cnt=0,e.timer=setTimeout(e.testSpeed,e.config.testTimeStep))})),_defineProperty$2(_assertThisInitialized$1(e),"initSpeedList",(function(){e.speedListCache={},SPEED_TYPE.forEach((function(t){e.speedListCache[t]=[]}))})),_defineProperty$2(_assertThisInitialized$1(e),"_onRealSpeedChange",(function(t){t.speed&&e.appendList(t.speed,t.type||DEFAULT_SPEED_TYPE)})),_defineProperty$2(_assertThisInitialized$1(e),"testSpeed",(function(){if(clearTimeout(e.timer),e.timer=null,e.player&&e.config.openSpeed){var t=e.config,i=t.url,r=t.loadSize,n=t.testCnt,o=t.testTimeStep,a=i+(i.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={},d=Math.floor(10*Math.random());u.Range="bytes="+d+"-"+(r+d),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,i=Math.round(1e3*t/(l-s));e.appendList(i),e.timer=setTimeout(e.testSpeed,o)}},c.send()}catch(e){console.error(e)}}}})),_defineProperty$2(_assertThisInitialized$1(e),"appendList",(function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:DEFAULT_SPEED_TYPE;if(e.speedListCache&&e.speedListCache[i]){var r=e.config.saveSpeedMax;e.speedListCache[i].length>=r&&e.speedListCache[i].shift(),e.speedListCache[i].push(t);var n=_assertThisInitialized$1(e).player;n&&(i===DEFAULT_SPEED_TYPE?n.realTimeSpeed=t:n[e.getSpeedName("realTime",i)]=t),e.updateSpeed(i)}})),_defineProperty$2(_assertThisInitialized$1(e),"updateSpeed",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:DEFAULT_SPEED_TYPE,i=e.getSpeed(t),r=_assertThisInitialized$1(e).player;if(r)if(t===DEFAULT_SPEED_TYPE)r.avgSpeed&&i===r.avgSpeed||(r.avgSpeed=i,r.emit(DOWNLOAD_SPEED_CHANGE,{speed:i,realTimeSpeed:r.realTimeSpeed}));else{var n=e.getSpeedName("avg",t);r[n]&&i===r[n]||(r[n]=i,r.emit(DOWNLOAD_SPEED_CHANGE,{speed:i,realTimeSpeed:r.realTimeSpeed}))}})),e}return _createClass$2(i,[{key:"afterCreate",value:function(){var e=this.config,t=e.openSpeed,i=e.addSpeedTypeList;(null==i?void 0:i.length)>0&&SPEED_TYPE.push.apply(SPEED_TYPE,_toConsumableArray$1(i)),this.initSpeedList(),this.on("real_time_speed",this._onRealSpeedChange),this.timer=null,this.cnt=0,this.xhr=null,t&&this.on([LOADED_DATA,REPLAY],this.startTimer)}},{key:"getSpeedName",value:function(e,t){return e+"Speed"+t.toUpperCase()}},{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(){var e=this;this.off("real_time_speed",this._onRealSpeedChange),this.off([LOADED_DATA,REPLAY],this.startTimer),SPEED_TYPE.forEach((function(t){e.speedListCache&&e.speedListCache[t]&&(e.speedListCache[t]=[])})),this.speedListCache&&(this.speedListCache={}),clearTimeout(this.timer),this.timer=null,this.xhr&&4!==this.xhr.readyState&&(this.xhr.cancel&&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,addSpeedTypeList:[]}}}]),i}(),FpsDetect=function(e){_inherits$1(i,Plugin);var t=_createSuper$1(i);function i(){return _classCallCheck$2(this,i),t.apply(this,arguments)}return _createClass$2(i,[{key:"afterCreate",value:function(){var e=this,t=this.player,i=this.config,r=t.media||t.video;(this.timer=null,this._lastDecodedFrames=0,this._currentStuckCount=0,this._lastCheckPoint=null,this._payload=[],i.disabled)||r.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:"_checkBuffer",value:function(e,t){for(var i=!1,r=[],n=0;n<t.length;n++){var o=t.start(n),a=t.end(n);if(r.push({start:o,end:a}),o<=e&&e<=a-1){i=!0;break}}return{enoughBuffer:i,buffers:r}}},{key:"_checkStuck",value:function(e,t,i,r){var n=this.player.media||this.player.video,o=document.hidden,a=n.paused,s=n.readyState,l=n.currentTime,c=n.buffered;if(!(o||a||s<4)){var u=this._checkBuffer(l,c),d=u.enoughBuffer,h=u.buffers;d&&(e<=this.config.reportFrame?(this._currentStuckCount++,this._payload.push({currentTime:l,buffers:h,curDecodedFrames:e,totalVideoFrames:t,droppedVideoFrames:i,checkInterval:r}),this._currentStuckCount>=this.config.stuckCount&&(this.emit(FPS_STUCK,this._payload),this._reset())):this._reset())}}},{key:"_reset",value:function(){this._payload=[],this._currentStuckCount=0}},{key:"_checkDecodeFPS",value:function(){var e=this.player.media||this.player.video;if(e){var t=e.getVideoPlaybackQuality(),i=t.totalVideoFrames,r=t.droppedVideoFrames,n=performance.now();if(i&&this._lastCheckPoint){var o=i-this._lastDecodedFrames,a=n-this._lastCheckPoint;this._checkStuck(o,i,r,a)}this._lastDecodedFrames=i,this._lastCheckPoint=n}}},{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}}}]),i}();const index$1="";class Poster extends Plugin{static get pluginName(){return"poster"}static get defaultConfig(){return{isEndedShow:!0,hideCanplay:!1,notHidden:!1,poster:"",fillMode:"fixWidth"}}set isEndedShow(e){this.config.isEndedShow=e}get isEndedShow(){return this.config.isEndedShow}hide(){util.addClass(this.root,"hide")}show(){return util.removeClass(this.root,"hide"),""}beforeCreate(e){"string"==typeof e.player.config.poster&&(e.config.poster=e.player.config.poster)}afterCreate(){this.on(ENDED,(()=>{this.isEndedShow&&util.removeClass(this.root,"hide")})),this.config.hideCanplay?(this.once(TIME_UPDATE,(()=>{this.onTimeUpdate()})),this.on(URL_CHANGE,(()=>{util.removeClass(this.root,"hide"),util.addClass(this.root,"xg-showplay"),this.once(TIME_UPDATE,(()=>{this.onTimeUpdate()}))}))):this.on(PLAY,(()=>{util.addClass(this.root,"hide")}))}onTimeUpdate(){this.player.currentTime?util.removeClass(this.root,"xg-showplay"):this.once(TIME_UPDATE,(()=>{this.onTimeUpdate()}))}update(e){e&&(this.config.poster=e,this.root.style.backgroundImage=`url(${e})`)}setConfig(e){"string"==typeof e?this.config.poster=e:"object"==typeof e&&Object.keys(this.config).forEach((t=>{Object.keys(e).includes(t)&&(this.config[t]=e[t])})),this.update(this.config.poster)}getBgSize(e){let t="";switch(e){case"cover":t="cover";break;case"contain":t="contain";break;case"fixHeight":t="auto 100%";break;case"fixWidth":t="100% auto";break;default:t=""}return t?`background-size: ${t};`:""}render(){const{poster:e,hideCanplay:t,fillMode:i,notHidden:r}=this.config,n=this.getBgSize(i);return`<xg-poster class="xgplayer-poster ${r?"xg-not-hidden":t?"xg-showplay":""} ${e?"active":""}" style="${e?`background-image:url(${e});${n}`:n}">\n </xg-poster>`}}const Poster$1=Poster;I18N.use(ZH);class DefaultPreset{constructor(e,t){const i=t&&"mobile"===t.isMobileSimulateMode,{isLive:r}=t,n=[...r?[]:[TimeSegmentsControls,Progress,MiniProgress,ProgressPreview,Time],Play,Fullscreen,Rotate,PlayNextIcon,DefinitionIcon,PlaybackRate,Download,ScreenShot,Volume,PIP],o=[Replay,Poster$1,Start,Loading,Enter,ErrorPlugin2,Prompt,Thumbnail,MiniScreen];this.plugins=[Stats,XGLogger,...n,...o,GapJump,WaitingTimeoutJump];const a=i?"mobile":sniffer.device;switch(a){case"pc":this.plugins.push(Keyboard,PCPlugin,CssFullScreen,TestSpeed,FpsDetect);break;case"mobile":this.plugins.push(MobilePlugin);break;default:this.plugins.push(Keyboard,PCPlugin,CssFullScreen)}(sniffer.os.isIpad||"pc"===a)&&this.plugins.push(DynamicBg),this.ignores=[],this.i18n=[]}}function createSDKPreset(e,t){return __async(this,arguments,(function*({isLive:e=!1,streamType:t,isMobile:i=!1,getSoftOptionTask:r,playerData:n},o){const a=[DefaultPreset,getDefaultPreset()],{openSoftDecoding:s,isMusic:l}=n,c=[],u=[];if(i?a.push(getMobilePreset({isLive:e,playerData:o.playerData})):a.push(getPCPreset({isLive:e,playerData:o.playerData})),"flv"===t)u.push((()=>__async(this,null,(function*(){if(i){if(isMSESupport2()||isMMSSupported()||s){const e=yield o.sdkUmdLoader.loadPlugins(UmdKeys.FLV);c.push(e)}}else{const e=yield o.sdkUmdLoader.loadPlugins(UmdKeys.FLV);c.push(e)}})))());getPluginConfig(o.playerData.options,"Subtitle")&&o.playerData.plugins.every((e=>"subtitle"!==e.pluginName.toLowerCase()))&&c.push(Subtitle);const[d,h]=yield Promise.all([r(),getPluginByConfig({playerData:o.playerData},o),...u]);return{presets:a,softDecodingOption:d,plugins:[...c,...h].filter(Boolean)}}))}function getDefaultPreset(e){const t=[ErrorPlugin$1,ToastPlugin$1,AutoplayPlugin];return class{constructor(){this.plugins=t,this.ignores=["error"]}}}function getMobilePreset({isLive:e,playerData:t}){const i=["error","playbackRate"],r=t.configs,n=getPluginConfig(r,"EncryptHlsPlugin");(null==n?void 0:n.playAuthToken)||i.push("definition");const o=[MoreButtonPlugin];return class{constructor(){this.plugins=o,this.ignores=[...i]}}}function getPCPreset({isLive:e,playerData:t}){const i=["cssfullscreen"],r=[AudioTrackPlugin],n=t.configs,o=getPluginConfig(n,"EncryptHlsPlugin");return(null==o?void 0:o.playAuthToken)||(i.push("definition"),r.push(DefinitionPlugin)),class{constructor(){this.plugins=r,this.ignores=[...i]}}}function getPluginByConfig(e,t){return __async(this,arguments,(function*({playerData:e},t){var i,r,n;const o=[];e.options,e.drmType,EDRMTYPE.DRM_ENCRYPT;const a=(yield null==(n=null==(r=null==(i=t.playerData)?void 0:i.adapter)?void 0:r.getPlugins)?void 0:n.call(r,t.sdkUmdLoader))||[];return o.push(...a),isVodLoggerEnabled()&&o.push(xgVodLogger),e.enableMenu&&o.push(emptyPlugin),o}))}function musicPauseSVG(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="0" height="0"/>\n',"image/svg+xml").firstChild}function fullscreenActiveSVG$1(){return(new DOMParser).parseFromString('<svg width="21" height="20" viewBox="0 0 20 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" viewBox="0 0 20 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" viewBox="0 0 20 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" viewBox="0 0 20 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" viewBox="0 0 20 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 refreshSVG$1(){return(new DOMParser).parseFromString('<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="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}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" viewBox="0 0 20 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" viewBox="0 0 20 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" viewBox="0 0 20 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}const iconsOption$1=__spreadProps(__spreadValues({startPlay:startPlaySVG,play:playSVG$1,pause:pauseSVG$1,fullscreen:fullscreenDefaultSVG$1,exitFullscreen:fullscreenActiveSVG$1,playNext:playNextSVG$1,replay:replaySVG,refresh:refreshSVG$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:__spreadValues({},iconsOption$1),flv:{retryCount:0,preferMMS:!0,preferMMSStreaming:!0},hls:{retryCount:3,allowedStreamTrackChange:!1,preferMMS:!0,preferMMSStreaming:!0},Mp4EncryptPlayer:{retryCount:3},DASHPlugin:{disableBufferBreakCheck:!1},gapJump:{smallGapLimit:1},EncryptHlsPlugin:{preferMMS:!0,preferMMSStreaming:!0}},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(e=!1){const t=__spreadValues({},initOption$1),i=__spreadValues({},e?liveOption$1:vodOption$1);return __spreadValues(__spreadValues({},t),i)}function fullscreenActiveSVG(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" viewBox="0 0 20 20" 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>\n',"image/svg+xml").firstChild}function fullscreenDefaultSVG(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" viewBox="0 0 20 20" 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>\n',"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}const iconsOption=__spreadProps(__spreadValues({startPlay:startPlaySVG,play:playSVG,pause:pauseSVG,fullscreen:fullscreenDefaultSVG,exitFullscreen:fullscreenActiveSVG,playNext:playNextSVG,replay:replaySVG,refresh:refreshSVG},{}),{volumeLarge:volumeLargeSVG,volumeMuted:volumeMutedSVG,volumeSmall:volumeSmallSVG}),initOption=__spreadProps(__spreadValues({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"}},{}),{cusPlaybackRatePlugin:{needCheck:!0,needPanel:!1},icons:__spreadValues({},iconsOption),flv:{innerDegrade:1,retryCount:0,preferMMS:!0,preferMMSStreaming:!0},hls:{innerDegrade:1,retryCount:3,allowedStreamTrackChange:!1,preferMMS:!0,preferMMSStreaming:!0},Mp4EncryptPlayer:{retryCount:3},DASHPlugin:{disableBufferBreakCheck:!1},gapJump:{smallGapLimit:1},EncryptHlsPlugin:{preferMMS:!0,preferMMSStreaming:!0}}),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(e=!1){const t=__spreadValues({},initOption),i=__spreadValues({},e?liveOption:vodOption);return __spreadValues(__spreadValues({},t),i)}const{POSITIONS:POSITIONS$5}=Plugin,extendPlugin=e=>{const t="mobile"===sniffer.device,{pluginName:i=`ExtendPlugin${Math.random().toString().slice(-5)}`,type:r=(t?"inner":"normal"),position:n=POSITIONS$5.CONTROLS_LEFT,icon:o=musicPauseSVG,index:a=1,hideAtFullScreen:s=!0,tips:l={jp:"custom",en:"custom",zh:"自定义","zh-hk":"自定义"}}=e;return class extends Plugin{static get isExtendPlugin(){return!0}static get type(){return r}static get textTips(){return l}static get pluginName(){return i}static get defaultConfig(){return{position:n,index:a}}afterCreate(){var e;this.appendChild(".xgplayer-icon",this.icons[i]),this.initEvents(),s&&(null==(e=this.player)?void 0:e.fullscreen)&&this.handleFullScreenChange()}registerIcons(){return{[i]:{icon:o,class:"xgplayer-extendicon-svg"}}}updateIcons(e){const t=this.find(".xgplayer-icon");t&&(t.innerHTML=e)}registerLanguageTexts(){return{[i]:l}}initEvents(){var e;this.handleCallback=debounce(this.handleCallback.bind(this),200);const t="mobile"===sniffer.device?"touchend":"click";this.bind(t,this.handleCallback),this.show(),s&&(null==(e=this.player)||e.on(FULLSCREEN_CHANGE,this.handleFullScreenChange.bind(this)))}handleFullScreenChange(){var e;const t=this.player;null==(e=this.player)||e.changePluginsIcon(i,!(null==t?void 0:t.fullscreen))}handleCallback(e){const{player:t}=this;t&&(e.preventDefault(),e.stopPropagation(),t.emit(PluginEvents.PLAYER_EXTEND_BUTTON,i))}destroy(){var e;this.unbind(["touchend","click"],this.handleCallback),s&&(null==(e=this.player)||e.off(FULLSCREEN_CHANGE,this.handleFullScreenChange.bind(this)))}render(){return`\n <xg-icon class="xgplayer-extend-icon">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="${i}">${this.langText[i]}</div>\n </xg-icon>\n `}}},extendPlugin$1=extendPlugin;class MobilePlayerPanel{constructor(e){var t,i,r;const{config:n,root:o,player:a}=e;this.config=n,this.parent=o,this.player=a;let s=null!=(t=null==n?void 0:n.mode)?t:PLAYER_MODE.INNER;Object.values(PLAYER_MODE).includes(s)||(s=PLAYER_MODE.INNER),this.mode=s,this.isAutoChange=null!=(i=null==n?void 0:n.isAutoChange)&&i,this.isShow=!1,this.showCancelBtn=null!=(r=null==n?void 0:n.showCancelBtn)&&r,this.initEvents(),this.renderPanel()}initEvents(){var e;this.isAutoChange&&(window.addEventListener("orientationchange",this.handleOrientationChange.bind(this)),null==(e=this.player)||e.on(FULLSCREEN_CHANGE,this.handleOrientationChange.bind(this)))}handleOrientationChange(){var e,t,i;const r=[90,-90,"90","-90"].includes(window.orientation);(null==(e=this.player)?void 0:e.fullscreen)&&r?this.changeMode(PLAYER_MODE.FULLSCREEN):this.changeMode(null!=(i=null==(t=this.config)?void 0:t.mode)?i:PLAYER_MODE.INNER)}changeConfig(e){this.config=e}changeMode(e){this.mode=e,this.player.emit(PluginEvents.PANEL_MODE_CHANGE,{mode:e}),this.destroy(),this.renderPanel()}renderPanel(){const e=`xg-mobile-panel panel-${["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:{const e=util.createDom("div","",{},"xg-mobile-panel-content "+(this.showCancelBtn?"xg-mobile-panel-cancel-mode":""));if(this.root.appendChild(e),this.showCancelBtn){const e="zh-cn"===this.player.lang?"zh":this.player.lang,t=util.createDom("div",cancelTips[e],{},"xg-mobile-panel-cancel");this.root.appendChild(t)}this.container=e,e.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault()}));break}case PLAYER_MODE.INNER:this.container=this.root;break;case PLAYER_MODE.FULLSCREEN:{const e=util.createDom("div","",{},"xg-mobile-panel-content");this.root.appendChild(e),this.container=e,e.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault()}));break}}}showPanel(e,t="",i=!1){return __async(this,null,(function*(){if(i&&util.addClass(e,"item-list-panel-content"),this.setTitle(t),this.children)return yield this.hide(),void setTimeout((()=>{this.children=e,this.container&&(this.title&&this.container.appendChild(this.title),this.container.appendChild(e)),this.show()}));this.children=e,this.container&&(this.title&&this.container.appendChild(this.title),this.container.appendChild(e)),this.show()}))}updatePanel(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))}setTitle(e){e&&this.mode!==PLAYER_MODE.INNER?this.title?this.title.innerHTML=e:this.title=this.renderTitle(e):this.title=void 0}renderTitle(e){return util.createDom("div",e,{},"xg-mobile-panel-title")}show(){this.isShow=!0,util.removeClass(this.root,"hide"),util.addClass(this.root,"active")}hide(){this.isShow=!1,util.removeClass(this.root,"active"),util.addClass(this.root,"hide"),this.container&&(this.container.innerHTML="")}handleHide(e){e.stopPropagation(),e.preventDefault(),this.hide()}bind(e,t,i=!1){this.root&&`on${e}`in this.root&&"function"==typeof t&&this.root.addEventListener(e,t,i)}destroy(){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)||e.off(FULLSCREEN_CHANGE,this.handleOrientationChange.bind(this))}}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}const{POSITIONS:POSITIONS$4}=Plugin;class DefinitionMobilePlugin extends(MixinDefinitionBase(Plugin)){constructor(e){super(__spreadProps(__spreadValues({},e),{clientType:"MOBILE"})),this.handleButtonChange=()=>{const e=this.renderItemList();this.renderPanel(e)}}static get pluginName(){return"DefinitionMobilePlugin"}static get textTips(){return{jp:"明快さ",en:"Definition",zh:"清晰度","zh-hk":"清晰度"}}static get defaultConfig(){return{position:POSITIONS$4.CONTROLS_RIGHT,index:3,showToastOnManualClick:!0,alwaysShowDefinition:!1}}afterCreate(){super.afterCreate()}refreshDefinitionList(){var e;const{current:{lineId:t}}=this.playerData,i=this.playerData.getDefinitionListByLineId(t);(null==(e=this.player.config)?void 0:e.alwaysShowDefinition)&&(this.config.alwaysShowDefinition=!0),i.length>1||this.config.alwaysShowDefinition?(this.appendChild(".xgplayer-icon",this.icons.definition),this.initEvents()):this.hide(),this.renderItemList()}registerIcons(){return{definition:{icon:DefinitionIconSVG,class:"xgplayer-definition-svg"}}}registerLanguageTexts(){return{definition:{jp:"明快さ",en:"Definition",zh:"清晰度","zh-hk":"清晰度"},definitionSelect:{jp:"クラリティセレクション",en:"Definition Choose",zh:"清晰度选择","zh-hk":"清晰度選擇"},switching:{jp:"に切り替える",en:"Switching to",zh:"正在切换至","zh-hk":"正在切換至"}}}afterPlayerInit(){}initEvents(){this.unbind(["click"],this.handleButtonChange),this.bind(["click"],this.handleButtonChange)}renderItemList(){const{defaultDefinition:e,list:t}=this.getCurrentDefinitionInfo(this.player),i=util.createDom("div","",{},"definition-panel-content");return t.forEach((t=>{t.selected=e===t.definition,t.isDefinitionAuto=this.playerData.isAutoDefinition(t.definition);const r=this.renderItem(t);i.appendChild(r)})),this.renderList=t,i}renderItem(e){var t;const{current:{definition:i}}=this.playerData,r=util.createDom("div","",{},"panel-Item "+(i===e.definition?"select-in":""));let n=this.getShowText(this.i18n,e,i);if(this.showRealDefinition(e)){const e=null==(t=this.renderList)?void 0:t.find((e=>this.playerData.isDefinitionMatch(null==e?void 0:e.definition,this._autoRealDefinition))),i=this.getShowText(this.i18n,e,null==e?void 0:e.definition);n=i?`${n}(${i})`:n}return r.innerHTML=n,r.addEventListener("click",(t=>{var r;if(t.stopPropagation(),t.preventDefault(),e.definition!==this.playerData.current.definition){const n=null==(r=this.playerData.getCurrentStreams())?void 0:r[0];this.emitUserAction(t,"change_definition",{from:n,to:e}),this.config.showToastOnManualClick&&this.showToast(e,i),this.playerData.current.definition=e.definition}})),r}selectDef(e){this.selectDefinition(e)}changeDefinition(e){const t=this.renderList.find((t=>this.playerData.isDefinitionMatch(t.definition,e)));t&&this.selectDef(t)}renderPanel(e){var t,i;null==(i=null==(t=this.player)?void 0:t.panel)||i.showPanel(e,this.langText.definitionSelect,!0)}updatePanel(){var e,t,i,r,n,o,a;if((null==(t=null==(e=this.player)?void 0:e.panel)?void 0:t.isShow)&&(null==(n=null==(r=null==(i=this.player)?void 0:i.panel)?void 0:r.title)?void 0:n.innerHTML)!==this.langText.definitionSelect)return;const s=this.renderItemList();null==(a=null==(o=this.player)?void 0:o.panel)||a.updatePanel(s)}destroy(){super.destroy(),this.unbind(["click"],this.handleButtonChange)}render(){return'\n <xg-icon class="xgplayer-mobile-definition">\n <div class="xgplayer-icon">\n </div>\n </xg-icon>\n '}}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}const{POSITIONS:POSITIONS$3}=Plugin;class LineMobilePlugin extends Plugin{constructor(e){super(e),this.playerData=e.player.config.playerData,this.dataMonitoring()}static get pluginName(){return"LineMobilePlugin"}static get textTips(){return{jp:"ライン",en:"Line",zh:"线路","zh-hk":"線路"}}static get defaultConfig(){return{position:POSITIONS$3.CONTROLS_RIGHT,index:4}}dataMonitoring(){this.playerData&&MyProxy$1.subscribeProperty(this.playerData.current,"definition",((e,t)=>{if(e!==t&&this.player){const e=this.playerData.getCurrentUrl();this.player.changeDefinition({definition:t,url:e}),this.updatePanel(),setTimeout((()=>{this.player.paused&&this.player.play()}),1e3)}}))}registerIcons(){return{line:{icon:LineIconSVG,class:"xgplayer-line-svg"}}}registerLanguageTexts(){return{line:{jp:"ライン",en:"Line",zh:"线路","zh-hk":"線路"},lineSelect:{jp:"ライン選ぶ",en:"Line Choose",zh:"线路选择","zh-hk":"線路選擇"}}}afterCreate(){this.appendChild(".xgplayer-icon",this.icons.line),this.initEvents()}afterPlayerInit(){}initEvents(){this.bind(["click"],this.handleButtonChange.bind(this))}handleButtonChange(){const e=this.renderItemList();this.renderPanel(e)}renderItemList(){const e=this.playerData.getLineList(),t=util.createDom("div","",{},"line-panel-content");return e.forEach((e=>{const i=this.renderItem(e);t.appendChild(i)})),t}renderItem(e){const{current:{lineId:t}}=this.playerData,i=util.createDom("div","",{},"panel-Item "+(t===e.lineId?"select-in":""));return i.innerHTML=this.i18n[e.lineTextKey]||e.lineTextKey,i.addEventListener("click",(t=>{t.stopPropagation(),t.preventDefault(),this.player.emit(PluginEvents.LINE_CHANGE,{from:this.playerData.current.lineId,to:e.lineId}),this.playerData.current.lineId=e.lineId,this.player.emit(SDKEvents.PLAYER_REBUILD)})),i}renderPanel(e){var t,i;null==(i=null==(t=this.player)?void 0:t.panel)||i.showPanel(e,this.langText.lineSelect,!0)}updatePanel(){var e;const t=this.renderItemList();null==(e=this.player)||e.panel.updatePanel(t)}destroy(){this.unbind(["click"],this.handleButtonChange.bind(this))}render(){return'\n <xg-icon class="xgplayer-mobile-line">\n <div class="xgplayer-icon">\n </div>\n </xg-icon>\n '}}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}const{POSITIONS:POSITIONS$2}=Plugin;class PlaybackRateMobilePlugin extends Plugin{constructor(e){super(e),this.state={currentRate:1,isSupport:!0},this.playerData=e.player.config.playerData}static get pluginName(){return"PlaybackRateMobilePlugin"}static get textTips(){return{jp:"倍速",en:"PlaybackRate",zh:"倍速","zh-hk":"倍速"}}static get defaultConfig(){return{position:POSITIONS$2.CONTROLS_RIGHT,index:5,list:[2,1.5,1.25,1,.75,.5],default:1}}registerIcons(){return{playbackRate:{icon:RateIconSVG,class:"xgplayer-rate-svg"}}}registerLanguageTexts(){return{rate:{jp:"倍速",en:"PlaybackRate",zh:"倍速","zh-hk":"倍速"},rateSelect:{jp:"倍速選ぶ",en:"PlaybackRate",zh:"倍速选择","zh-hk":"倍速選擇"}}}afterCreate(){this.appendChild(".xgplayer-icon",this.icons.playbackRate),this.initEvents(),this.state.currentRate=this.player.playbackRate||1,this.changeIconText()}afterPlayerInit(){}initEvents(){this.bind(["click"],this.renderList.bind(this)),this.on(RATE_CHANGE,(()=>{var e,t;this.state.currentRate!==this.player.playbackRate&&(this.state.currentRate=this.player.playbackRate,(null==(t=null==(e=this.player)?void 0:e.panel)?void 0:t.isShow)&&this.updatePanel(),this.changeIconText())}))}renderList(){const e=this.renderItemList();this.renderPanel(e)}renderItemList(){const e=util.createDom("div","",{},"playbackRate-panel-content");return this.config.list.forEach((t=>{const i=this.renderItem(t);e.appendChild(i)})),e}renderItem(e){const t=isObject$g(e)?e:{textKey:e+"X",value:e},i=util.createDom("div","",{},"panel-Item "+(this.state.currentRate===t.value?"select-in":""));return i.innerHTML=this.i18n[t.textKey]||t.textKey,i.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault();const i={playbackRate:{from:this.player.playbackRate,to:t.value}};this.emitUserAction(e,"change_rate",{props:i}),this.state.currentRate=t.value,this.player.playbackRate=t.value,this.updatePanel(),this.changeIconText()})),i}renderPanel(e){var t,i;null==(i=null==(t=this.player)?void 0:t.panel)||i.showPanel(e,this.langText.rateSelect,!0)}updatePanel(){var e;const t=this.renderItemList();null==(e=this.player)||e.panel.updatePanel(t)}changeIconText(){let e;const t=this.state.currentRate,i=t%1==0?t.toFixed(1):t+"";switch(i.length){case 1:case 2:case 3:default:e=.7;break;case 4:e=.5}const r=this.find(".icon-text");r.style.transform=`scale(${e})`,r.innerHTML=i}destroy(){this.unbind(["click"],this.renderList.bind(this))}render(){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 '}}function AudioTrackIconSVG(){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.8881 11.8208C16.812 11.6153 16.5213 11.6153 16.4452 11.8208L16.0985 12.7579C15.8115 13.5334 15.2001 14.1448 14.4246 14.4318L13.4875 14.7786C13.2819 14.8546 13.2819 15.1454 13.4875 15.2214L14.4246 15.5682C15.2001 15.8551 15.8115 16.4666 16.0985 17.2421L16.4452 18.1792C16.5213 18.3847 16.812 18.3847 16.8881 18.1792L17.2348 17.2421C17.5218 16.4666 18.1332 15.8551 18.9087 15.5682L19.8458 15.2214C20.0514 15.1454 20.0514 14.8546 19.8458 14.7786L18.9087 14.4318C18.1332 14.1448 17.5218 13.5334 17.2348 12.7579L16.8881 11.8208Z" fill="white"/>\n<rect x="9.5" y="2" width="1.5" height="16" rx="0.75" fill="white"/>\n<rect x="5.75" y="5" width="1.5" height="10" rx="0.75" fill="white"/>\n<rect x="2" y="7" width="1.5" height="6" rx="0.75" fill="white"/>\n<path d="M16.5 7.75C16.5 7.33579 16.8358 7 17.25 7C17.6642 7 18 7.33579 18 7.75V9.18934C18 9.85752 17.1921 10.1921 16.7197 9.71967C16.579 9.57902 16.5 9.38825 16.5 9.18934V7.75Z" fill="white"/>\n<path d="M12.75 5.75C12.75 5.33579 13.0858 5 13.5 5C13.9142 5 14.25 5.33579 14.25 5.75V11.3229C14.25 11.4394 14.2229 11.5542 14.1708 11.6584C13.8169 12.3662 12.75 12.1144 12.75 11.3229V5.75Z" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}const{POSITIONS:POSITIONS$1}=Plugin;class AudioTrackMobilePlugin extends Plugin{constructor(){super(...arguments),this._nativeMode=!1,this._nativeAddTrackHandler=null,this._nativeChangeHandler=null,this._nativeRemoveTrackHandler=null,this._clickHandler=null,this._nativePanelUpdateRaf=null}static get pluginName(){return"AudioTrackMobile"}static get textTips(){return{en:"Audio",zh:"音频","zh-hk":"音頻",jp:"オーディオ"}}static get defaultConfig(){return{position:POSITIONS$1.CONTROLS_RIGHT,index:2.6,isShowIcon:!0,showNameSuffix:!0}}registerIcons(){return{audiotrack:{icon:AudioTrackIconSVG,class:"xgplayer-audiotrack-svg"}}}afterPlayerInit(){var e;this.on("hlsAudioTracksUpdated",(e=>{this._onAudioTracksUpdated(e.audioTracks)})),this.on("hlsAudioTrackSwitched",(e=>{var t,i;(null==(i=null==(t=this.player)?void 0:t.panel)?void 0:i.isShow)&&this._updateHlsPanel(e.id)}));const t=this._getHls();(null==(e=null==t?void 0:t.audioTracks)?void 0:e.length)>1?this._onAudioTracksUpdated(t.audioTracks):t||this._initNativeAudioTracks()}destroy(){this._clickHandler&&this.unbind(["click"],this._clickHandler),null!==this._nativePanelUpdateRaf&&cancelAnimationFrame(this._nativePanelUpdateRaf),this._unbindNativeAudioTracks()}render(){return this.config.isShowIcon?'\n <xg-icon class="xgplayer-mobile-audiotrack">\n <div class="xgplayer-icon"></div>\n </xg-icon>\n ':""}_getHls(){var e,t;const i=this.player.plugins;return(null==(e=null==i?void 0:i.encrypthlsplugin)?void 0:e.hls)||(null==(t=null==i?void 0:i.hls)?void 0:t.hls)}_getNativeTrackList(){var e,t;return null==(t=null==(e=this.player)?void 0:e.media)?void 0:t.audioTracks}_onAudioTracksUpdated(e){!e||e.length<=1||this._bindClickOnce()}_renderList(){this._nativeMode?this._renderNativePanel():this._renderHlsPanel()}_getLabelOpts(){return{showNameSuffix:!1!==this.config.showNameSuffix}}_renderHlsPanel(){var e,t,i;const r=this._getHls();if(!r)return;const n=r.audioTracks;if(!(null==n?void 0:n.length))return;const o=null!=(e=r.audioTrack)?e:-1,a=n.find((e=>e.default)),s=this._getLabelOpts(),l=util.createDom("div","",{},"audiotrack-panel-content");n.forEach((e=>{let t=e.id===o;t||-1!==o||(null==a?void 0:a.id)!==e.id||(t=!0);const i=util.createDom("div","",{},"panel-Item "+(t?"select-in":""));i.innerHTML=getAudioTrackLabel(e,s),i.addEventListener("click",(t=>{t.stopPropagation(),t.preventDefault(),this._switchHlsTrack(r,e)})),l.appendChild(i)})),null==(i=null==(t=this.player)?void 0:t.panel)||i.showPanel(l,this._panelTitle(),!0)}_updateHlsPanel(e){var t,i;const r=this._getHls();if(!r)return;const n=r.audioTracks;if(!(null==n?void 0:n.length))return;const o=this._getLabelOpts(),a=util.createDom("div","",{},"audiotrack-panel-content");n.forEach((t=>{const i=util.createDom("div","",{},"panel-Item "+(t.id===e?"select-in":""));i.innerHTML=getAudioTrackLabel(t,o),i.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault(),this._switchHlsTrack(r,t)})),a.appendChild(i)})),null==(i=null==(t=this.player)?void 0:t.panel)||i.updatePanel(a)}_switchHlsTrack(e,t){switchHlsAudioTrack(e,t)}_initNativeAudioTracks(){const e=this._getNativeTrackList();e&&(this._nativeMode=!0,this._nativeAddTrackHandler=()=>this._onNativeTracksChanged(),this._nativeChangeHandler=()=>{var e,t;(null==(t=null==(e=this.player)?void 0:e.panel)?void 0:t.isShow)&&null===this._nativePanelUpdateRaf&&(this._nativePanelUpdateRaf=requestAnimationFrame((()=>{var e,t;this._nativePanelUpdateRaf=null,(null==(t=null==(e=this.player)?void 0:e.panel)?void 0:t.isShow)&&this._renderNativePanel(!0)})))},this._nativeRemoveTrackHandler=()=>this._onNativeTracksChanged(),e.addEventListener("addtrack",this._nativeAddTrackHandler),e.addEventListener("change",this._nativeChangeHandler),e.addEventListener("removetrack",this._nativeRemoveTrackHandler),e.length>1&&this._onNativeTracksChanged())}_unbindNativeAudioTracks(){const e=this._getNativeTrackList();e&&(this._nativeAddTrackHandler&&e.removeEventListener("addtrack",this._nativeAddTrackHandler),this._nativeChangeHandler&&e.removeEventListener("change",this._nativeChangeHandler),this._nativeRemoveTrackHandler&&e.removeEventListener("removetrack",this._nativeRemoveTrackHandler))}_bindClickOnce(){this._clickHandler||(this.appendChild(".xgplayer-icon",this.icons.audiotrack),this._clickHandler=this._renderList.bind(this),this.bind(["click"],this._clickHandler))}_onNativeTracksChanged(){const e=this._getNativeTrackList();!e||e.length<=1||this._bindClickOnce()}_renderNativePanel(e=!1){var t;const i=this._getNativeTrackList();if(!i)return;const r=this._getLabelOpts(),n=util.createDom("div","",{},"audiotrack-panel-content");for(let e=0;e<i.length;e++){const t=i[e],o=getNativeTrackLabel(t,e,r),a=util.createDom("div","",{},"panel-Item "+(t.enabled?"select-in":""));a.innerHTML=o,a.addEventListener("click",(t=>{t.stopPropagation(),t.preventDefault();const i=this._getNativeTrackList();i&&switchNativeAudioTrack(i,e)})),n.appendChild(a)}const o=null==(t=this.player)?void 0:t.panel;e?null==o||o.updatePanel(n):null==o||o.showPanel(n,this._panelTitle(),!0)}_panelTitle(){var e;return null!=(e=AudioTrackMobilePlugin.textTips[this.player.lang||"en"])?e:AudioTrackMobilePlugin.textTips.en}}class SdkPlugin{constructor(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=e,this.pluginName="",this.__init(e)}static defineGetterOrSetter(e,t){for(const i in t)Object.defineProperty(e,i,t[i])}static get pluginName(){return"pluginName"}beforeCreate(){}afterCreate(){}beforePlayerCreate(){}afterPlayerCreate(){}destroy(){}__init(e){SdkPlugin.defineGetterOrSetter(this,{sdk:{get:()=>e.sdk,configurable:!0},player:{get:()=>e.sdk.getPlayerInstance(),configurable:!0},playerData:{get:()=>e.sdk.playerData,configurable:!0},pluginName:{get:()=>e.pluginName?e.pluginName.toLowerCase():this.constructor.pluginName.toLowerCase(),configurable:!0},_emitter:{get:()=>e.sdk._emitter,configurable:!0}})}__destroy(){const e=this.sdk,t=this.pluginName;this.destroy&&"function"==typeof this.destroy&&this.destroy(),["sdk","player","playerData","pluginName","_emitter"].map((e=>{Object.defineProperty(this,e,{writable:!0})})),Object.keys(this).map((e=>{this[e]=null,delete this[e]})),Object.setPrototypeOf&&Object.setPrototypeOf(this,null),delete e._sdkPlugins[t]}}const DEFAULT_MEDIA_INFO_CACHE_EXPIRE_TIME=18e5,DEFAULT_MEDIA_INFO_CACHE_MAX_ENTRIES=100,MEDIA_INFO_CACHE_URL_EXPIRE_BUFFER=1e3,MEDIA_INFO_CACHE_MODULE="media_info",TT_DRAMA_MEDIA_INFO_CACHE_MODULE="ttdrama_media_info",DEFAULT_MEDIA_INFO_CACHE_CONFIG={enable:!1,expireTime:DEFAULT_MEDIA_INFO_CACHE_EXPIRE_TIME,cacheType:"memory",maxEntries:100},MEDIA_INFO_CACHE_LOG_PREFIX="[mediaInfoCache]";let mediaInfoCacheConfig=__spreadValues({},DEFAULT_MEDIA_INFO_CACHE_CONFIG);const memoryMediaInfoCache=new Map;function logMediaInfoCache(e,t={}){VE_DEBUG.log(`${MEDIA_INFO_CACHE_LOG_PREFIX} ${e}`,t)}function getMediaInfoSummary(e){var t;return{vid:null==e?void 0:e.vid,playListLength:(null==(t=null==e?void 0:e.playList)?void 0:t.length)||0,hasValidPlayUrl:isValidMediaInfo(e)}}function getMediaInfoCacheConfig(){return __spreadValues({},mediaInfoCacheConfig)}function setMediaInfoCacheConfig(e){e?("boolean"==typeof e.enable&&(mediaInfoCacheConfig.enable=e.enable),e.cacheType&&(mediaInfoCacheConfig.cacheType=e.cacheType),"number"==typeof e.expireTime&&Number.isFinite(e.expireTime)&&e.expireTime>0?mediaInfoCacheConfig.expireTime=e.expireTime:void 0!==e.expireTime&&logMediaInfoCache("config ignore invalid expireTime",{expireTime:e.expireTime,currentExpireTime:mediaInfoCacheConfig.expireTime}),"number"==typeof e.maxEntries&&Number.isFinite(e.maxEntries)&&e.maxEntries>0?mediaInfoCacheConfig.maxEntries=Math.floor(e.maxEntries):void 0!==e.maxEntries&&logMediaInfoCache("config ignore invalid maxEntries",{maxEntries:e.maxEntries,currentMaxEntries:mediaInfoCacheConfig.maxEntries}),logMediaInfoCache("config updated",getMediaInfoCacheConfig())):logMediaInfoCache("config skip empty config",{currentConfig:getMediaInfoCacheConfig()})}function clearMediaInfoCache(){const e=memoryMediaInfoCache.size;memoryMediaInfoCache.clear();logMediaInfoCache("clear success",{memoryCacheCount:e,localStorageCacheCount:clearLocalStorageMediaInfoCache()})}function getStringValue(e){return"string"==typeof e?e.trim():""}function isValidMediaInfo(e){var t;return!!(null==(t=null==e?void 0:e.playList)?void 0:t.some((e=>!!(null==e?void 0:e.url))))}function hashCacheKey(e){let t=5381;for(let i=0;i<e.length;i++)t=33*t^e.charCodeAt(i);return(t>>>0).toString(36)}function getMediaInfoCacheKey(e){const t=getMediaInfoCacheKeyInfo(e);return t.playAuthTokenHash?hashCacheKey(JSON.stringify(t)):""}function getMediaInfoCacheKeyInfo(e){const t=getStringValue(e.playAuthToken);return{playAuthTokenHash:t?hashCacheKey(t):"",reqParams:getMediaInfoCacheReqParams(e.reqParams),urlQueryParams:e.urlQueryParams,needThumbs:e.needThumbs,needBarrageMask:e.needBarrageMask}}function getMediaInfoCacheReqParams(e){if(!e)return;const t=__spreadValues({},e);return delete t.Vid,delete t.vid,Object.keys(t).length?t:void 0}const memoryStorage={getItem:e=>memoryMediaInfoCache.get(e)||null,setItem(e,t){memoryMediaInfoCache.delete(e),memoryMediaInfoCache.set(e,t)},removeItem(e){memoryMediaInfoCache.delete(e)}};function getLocalStorage(){try{return"undefined"!=typeof localStorage?localStorage:null==window?void 0:window.localStorage}catch(e){return}}function clearLocalStorageMediaInfoCache(){const e=getLocalStorage();if(!e)return 0;const t=[`${storageKeyPrefix}${MEDIA_INFO_CACHE_MODULE}_`,`${storageKeyPrefix}${TT_DRAMA_MEDIA_INFO_CACHE_MODULE}_`],i=[];for(let r=0;r<e.length;r++){const n=e.key(r);n&&t.some((e=>n.startsWith(e)))&&i.push(n)}return i.forEach((t=>e.removeItem(t))),i.length}function isMediaInfoStorageKey(e){return e.startsWith(`${storageKeyPrefix}${MEDIA_INFO_CACHE_MODULE}_`)||e.startsWith(`${storageKeyPrefix}${TT_DRAMA_MEDIA_INFO_CACHE_MODULE}_`)}function getLocalStorageMediaInfoKeys(e){const t=[];for(let i=0;i<e.length;i++){const r=e.key(i);r&&isMediaInfoStorageKey(r)&&t.push(r)}return t}function getMediaInfoStorageKeys(){if("memory"===mediaInfoCacheConfig.cacheType)return Array.from(memoryMediaInfoCache.keys()).filter(isMediaInfoStorageKey);const e=getLocalStorage();return e?getLocalStorageMediaInfoKeys(e):[]}function getStorage(){return"memory"===mediaInfoCacheConfig.cacheType?memoryStorage:getLocalStorage()}function safeJsonParse(e){try{return JSON.parse(e)}catch(e){return}}function getMediaInfoStorageKey(e){const t=getStringValue(e.moduleName),i=getStringValue(e.cacheKey);return t&&i?`${storageKeyPrefix}${t}_${i}`:""}function toTimestampMs(e){const t=Number(e);if(Number.isFinite(t)&&!(t<=0))return t>__pow(10,12)?t:1e3*t}function getMediaInfoUrlExpireAt(e){const t=(e.playList||[]).map((e=>toTimestampMs(e.urlExpireTimestamp||e.MainUrlExpire||e.mainUrlExpire||e.main_url_expire))).filter((e=>!!e));if(t.length)return Math.min(...t)}function getEffectiveMediaInfoExpireAt(e,t){const i=Date.now()+t,r=getMediaInfoUrlExpireAt(e);return r?Math.min(i,r-MEDIA_INFO_CACHE_URL_EXPIRE_BUFFER):i}function getMediaInfoCacheLogMeta(e){return{moduleName:getStringValue(e.moduleName),cacheKey:getStringValue(e.cacheKey),cacheKeyInfo:e.cacheKeyInfo,cacheType:mediaInfoCacheConfig.cacheType}}function getCachedMediaInfo(e){const t=getStorage(),i=getMediaInfoStorageKey(e),r=getMediaInfoCacheLogMeta(e);if(!t)return void logMediaInfoCache("get skip no storage",r);if(!i)return void logMediaInfoCache("get skip empty storage key",r);const n=t.getItem(i)||"";if(!n)return void logMediaInfoCache("get miss empty cache",r);const o=safeJsonParse(n);if(!o)return void logMediaInfoCache("get miss parse failed",r);const a=null==o?void 0:o.mediaInfo;if(a&&o.expireAt)return Date.now()>=o.expireAt?(t.removeItem(i),void logMediaInfoCache("get miss expired and removed",__spreadProps(__spreadValues({},r),{expireAt:o.expireAt,now:Date.now()}))):(logMediaInfoCache("get hit",__spreadValues(__spreadProps(__spreadValues({},r),{cacheKeyInfo:o.cacheKeyInfo,expireAt:o.expireAt,ttl:o.expireAt-Date.now()}),getMediaInfoSummary(a))),touchCachedMediaInfo(t,i,o,r),a);logMediaInfoCache("get miss invalid cache payload",r)}function getEnabledCachedMediaInfo(e){if(mediaInfoCacheConfig.enable)return getCachedMediaInfo(e);logMediaInfoCache("get skip disabled",__spreadProps(__spreadValues({},getMediaInfoCacheLogMeta(e)),{config:getMediaInfoCacheConfig()}))}function setCachedMediaInfo(e,t,i=DEFAULT_MEDIA_INFO_CACHE_EXPIRE_TIME){const r=getStorage(),n=getMediaInfoStorageKey(e),o=getMediaInfoCacheLogMeta(e);if(!r)return void logMediaInfoCache("set skip no storage",__spreadValues(__spreadValues({},o),getMediaInfoSummary(t)));if(!n)return void logMediaInfoCache("set skip empty storage key",__spreadValues(__spreadValues({},o),getMediaInfoSummary(t)));if(!isValidMediaInfo(t))return void logMediaInfoCache("set skip invalid media info",__spreadValues(__spreadValues({},o),getMediaInfoSummary(t)));const a=getEffectiveMediaInfoExpireAt(t,i);if(a<=Date.now())return void logMediaInfoCache("set skip expired media info",__spreadValues(__spreadProps(__spreadValues({},o),{expireTime:i,expireAt:a}),getMediaInfoSummary(t)));const s={createdAt:Date.now(),expireAt:a,lastAccessedAt:Date.now(),cacheKeyInfo:e.cacheKeyInfo,mediaInfo:t};try{r.setItem(n,JSON.stringify(s)),pruneMediaInfoCache(r),logMediaInfoCache("set success",__spreadValues(__spreadProps(__spreadValues({},o),{cacheKeyInfo:s.cacheKeyInfo,expireTime:i,expireAt:a}),getMediaInfoSummary(t)))}catch(e){logMediaInfoCache("set failed",__spreadValues(__spreadProps(__spreadValues({},o),{error:e}),getMediaInfoSummary(t)))}}function touchCachedMediaInfo(e,t,i,r){try{e.setItem(t,JSON.stringify(__spreadProps(__spreadValues({},i),{lastAccessedAt:Date.now()})))}catch(e){logMediaInfoCache("touch failed",__spreadProps(__spreadValues({},r),{error:e}))}}function pruneMediaInfoCache(e){const t=getMediaInfoStorageKeys(),i=mediaInfoCacheConfig.maxEntries;if(t.length<=i)return;const r=t.map((t=>{const i=safeJsonParse(e.getItem(t)||"");return{key:t,lastAccessedAt:(null==i?void 0:i.lastAccessedAt)||(null==i?void 0:i.createdAt)||0}})).sort(((e,t)=>e.lastAccessedAt-t.lastAccessedAt)),n=t.length-i;r.slice(0,n).forEach((t=>e.removeItem(t.key))),logMediaInfoCache("prune success",{removeCount:n,maxEntries:i,cacheType:mediaInfoCacheConfig.cacheType})}function setEnabledCachedMediaInfo(e,t){mediaInfoCacheConfig.enable?setCachedMediaInfo(e,t,mediaInfoCacheConfig.expireTime):logMediaInfoCache("set skip disabled",__spreadValues(__spreadProps(__spreadValues({},getMediaInfoCacheLogMeta(e)),{config:getMediaInfoCacheConfig()}),getMediaInfoSummary(t)))}function getCachedMediaInfoByConfig(e){return getCachedMediaInfo({moduleName:MEDIA_INFO_CACHE_MODULE,cacheKey:getMediaInfoCacheKey(e),cacheKeyInfo:getMediaInfoCacheKeyInfo(e)})}function getEnabledCachedMediaInfoByConfig(e){if(mediaInfoCacheConfig.enable)return getCachedMediaInfoByConfig(e)}function setCachedMediaInfoByConfig(e,t,i=DEFAULT_MEDIA_INFO_CACHE_EXPIRE_TIME){setCachedMediaInfo({moduleName:MEDIA_INFO_CACHE_MODULE,cacheKey:getMediaInfoCacheKey(e),cacheKeyInfo:getMediaInfoCacheKeyInfo(e)},t,i)}function setEnabledCachedMediaInfoByConfig(e,t){mediaInfoCacheConfig.enable&&setCachedMediaInfoByConfig(e,t,mediaInfoCacheConfig.expireTime)}let appendVideoUrlTimestamp=!1;const URL_KEYS=["url","src","_mainURL","_backupURL","backupUrl","MainPlayUrl","mainPlayUrl","main_play_url","BackupPlayUrl","backupPlayUrl","backup_play_url"];function setAppendVideoUrlTimestamp(e=!0){appendVideoUrlTimestamp=!!e}function getAppendVideoUrlTimestamp(){return appendVideoUrlTimestamp}function appendTimestampToUrl(e,t){if(!e)return e;const i=e.indexOf("#"),r=-1===i?"":e.slice(i),n=-1===i?e:e.slice(0,i),o=n.indexOf("?"),a=-1===o?n:n.slice(0,o),s=-1===o?"":n.slice(o+1),l=s?s.split("&").filter((e=>{const t=e.split("=")[0];try{return"t"!==decodeURIComponent(t||"")}catch(e){return"t"!==t}})):[];return l.push(`t=${encodeURIComponent(t)}`),`${a}?${l.join("&")}${r}`}function appendTimestampToUrlValue(e,t){return"string"==typeof e?appendTimestampToUrl(e,t):Array.isArray(e)?e.map((e=>"string"==typeof e?appendTimestampToUrl(e,t):e&&"object"==typeof e&&"string"==typeof e.src?__spreadProps(__spreadValues({},e),{src:appendTimestampToUrl(e.src,t)}):e)):e}function appendVideoUrlTimestampToStream(e,t=Date.now()){if(!appendVideoUrlTimestamp||!e)return e;const i=__spreadValues({},e);return URL_KEYS.forEach((e=>{i[e]&&(i[e]=appendTimestampToUrlValue(i[e],t))})),Array.isArray(i.backUrlList)&&(i.backUrlList=i.backUrlList.map((e=>appendTimestampToUrlValue(e,t)))),i}function appendVideoUrlTimestampToMediaInfo(e,t=Date.now()){return appendVideoUrlTimestamp&&e?__spreadProps(__spreadValues({},e),{playList:(e.playList||[]).map((e=>appendVideoUrlTimestampToStream(e,t)))}):e}function genQueryString(e){return Object.entries(e).map((([e,t])=>Array.isArray(t)?t.map((t=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`)).join("&"):`${encodeURIComponent(e)}=${encodeURIComponent(t)}`)).join("&")}function addUrlParam(e,t){return e&&t?`${e}${-1===e.indexOf("?")?"?":"&"}${genQueryString(t)}`:e}function getIntNumber(e,t=10,i=0){const r=parseInt(`${e}`,t);return Number.isNaN(r)?i:r}function getDefinitionValue(e){var t;return getStringValue(e.defaultDefinition||(null==(t=e.getVideoByToken)?void 0:t.defaultDefinition))}function getDefaultPlayDomain(e){var t,i;const r="sg",n={sg:{__PLAY_DOMAIN__:"https://vod.byteplusapi.com",__BACKUP_PLAY_DOMAIN__:"https://open.byteplusapi.com"}},o={cn:{__PLAY_DOMAIN__:"https://vod.volcengineapi.com",__BACKUP_PLAY_DOMAIN__:"https://open.volcengineapi.com"},mya:{__PLAY_DOMAIN__:"https://vod.ap-southeast-1.volcengineapi.com"}};let a={sg:{__PLAY_DOMAIN__:"https://vod.byteplusapi.com",__BACKUP_PLAY_DOMAIN__:"https://open.byteplusapi.com"}},s=r;return"byteplus"===e&&n?(a=n,s="sg"):"volcengine"===e&&o&&(a=o,s=a[r]?r:"cn"),(null==(t=null==a?void 0:a[r])?void 0:t.__PLAY_DOMAIN__)||(null==(i=null==a?void 0:a[s])?void 0:i.__PLAY_DOMAIN__)||""}function getTTDramaAlbumId(e){return getStringValue(e.albumId||e.album_id)}function getTTDramaEpisodeId(e){return getStringValue(e.episodeId||e.episode_id||e.episodeID)}function getTTDramaCacheOptions(e){return{episodeId:getTTDramaEpisodeId(e),defaultDefinition:getDefinitionValue(e)}}function getTTDramaMediaInfoCacheKey(e){const t=getStringValue(e.episodeId);if(!t)return"";return`${t}_${getStringValue(e.defaultDefinition)}`}function getTTDramaMediaInfoCacheKeyInfo(e){return{episodeId:getStringValue(e.episodeId),defaultDefinition:getStringValue(e.defaultDefinition)}}function getCachedTTDramaMediaInfo(e){return getEnabledCachedMediaInfo({moduleName:TT_DRAMA_MEDIA_INFO_CACHE_MODULE,cacheKey:getTTDramaMediaInfoCacheKey(e),cacheKeyInfo:getTTDramaMediaInfoCacheKeyInfo(e)})}function setCachedTTDramaMediaInfo(e,t){setEnabledCachedMediaInfo({moduleName:TT_DRAMA_MEDIA_INFO_CACHE_MODULE,cacheKey:getTTDramaMediaInfoCacheKey(e),cacheKeyInfo:getTTDramaMediaInfoCacheKeyInfo(e)},t)}function getCachedPlayAuthMediaInfo(e){return getEnabledCachedMediaInfoByConfig(createPlayAuthCacheConfig(e))}function setCachedPlayAuthMediaInfo(e,t){setEnabledCachedMediaInfoByConfig(createPlayAuthCacheConfig(e),t)}function createPlayAuthCacheConfig(e){const t=e.getVideoByToken||{};return __spreadProps(__spreadValues({},t),{defaultDefinition:getDefinitionValue(e),reqParams:__spreadValues({},t.reqParams||{}),urlQueryParams:t.urlQueryParams||e.urlQueryParams})}function createPlayAuthConfig(e,t){const i=createPlayAuthCacheConfig(e);return __spreadProps(__spreadValues({},i),{playDomain:i.playDomain||getDefaultPlayDomain(null==t?void 0:t.channel)})}function transformDramaVideoInfoToRes(e,t={}){var i,r,n;const o=(e,t,i)=>{for(const i of t)if(e&&void 0!==e[i])return e[i];return i},a=o(e,["PlayInfoList","playInfoList","play_info_list"],[]),s=o(e,["PosterUrl","posterUrl","poster_url"],""),l=o(e,["Vid","vid"],""),c=o(e,["Duration","duration"],0),u=o(e,["BarrageMaskUrl","barrageMaskUrl","barrage_mask_url"],""),d=o(e,["ThumbInfoList","thumbInfoList","thumb_info_list"],[]),h=o(e,["EnableAdaptive","enableAdaptive","enable_adaptive"],void 0),p=o(e,["AdaptiveBitrateStreamingInfo","adaptiveBitrateStreamingInfo","adaptive_bitrate_streaming_info"],void 0),f=null==t?void 0:t.urlQueryParams,{definitionMap:g,autoDemoteDefinition:y,autoDemoteDefinitionTextKey:_}=t||{},m=a.map((e=>{const t=(t,i)=>o(e,t,i),i=t(["MainPlayUrl","mainPlayUrl","main_play_url"],""),r=t(["BackupPlayUrl","backupPlayUrl","backup_play_url"],""),n=addUrlParam(i,f),a=addUrlParam(r,f),s=t(["Format","format"],"");return __spreadValues(__spreadValues({vid:l,url:n,_mainURL:n,_backupURL:a,streamType:s,backupUrl:a,backUrlList:[a],fileType:t(["FileType","fileType","file_type"]),format:s,bitrate:t(["Bitrate","bitrate"]),size:t(["Size","size"]),kid:t(["PlayAuthId","playAuthId","play_auth_id"]),playAuthId:t(["PlayAuthId","playAuthId","play_auth_id"]),playAuth:t(["PlayAuth","playAuth","play_auth"]),secretKey:t(["PlayAuth","playAuth","play_auth"]),vwidth:t(["Width","width"]),vheight:t(["Height","height"]),vtype:null==s?void 0:s.toLocaleUpperCase(),codec:t(["Codec","codec"]),urlExpireTimestamp:getIntNumber(t(["MainUrlExpire","mainUrlExpire","main_url_expire"]),10,MAX_TIMESTAMP),drmType:t(["DrmType","drmType","drm_type"])},e),getDefinitionInfo(e,{definitionMap:g,autoDemoteDefinition:y,autoDemoteDefinitionTextKey:_}))})).sort(playListSort);return{playList:m,type:(null==(i=m[0])?void 0:i.Format)||(null==(r=m[0])?void 0:r.format)||(null==(n=m[0])?void 0:n.streamType),poster:s||"",vid:l,duration:c||0,dashOpts:{Data:__spreadProps(__spreadValues({},e),{VideoID:l})},thumbs:d||[],barrageMaskUrl:u||"",enableAdaptive:h,adaptiveBitrateStreamingInfo:p}}function isDramaPreloadSource(e){return!!(e&&getTTDramaAlbumId(e)&&getTTDramaEpisodeId(e))}function isPlayAuthPreloadSource(e){var t;return!!(null==(t=null==e?void 0:e.getVideoByToken)?void 0:t.playAuthToken)}function toUrlString(e){var t;return"string"==typeof e?e:(null==(t=null==e?void 0:e[0])?void 0:t.src)||""}function findDefaultDramaStream(e,t){const i=e.playList||[];return t&&i.find((e=>{var i;const r=e.mapDefinition||e.definition||e.Definition;return(null==(i=null==r?void 0:r.toLocaleLowerCase)?void 0:i.call(r))===t.toLocaleLowerCase()}))||i[0]}function mapTTDramaVideoInfoToPreloadStream(e,t){var i,r;const n=getDefinitionValue(t),o=findDefaultDramaStream(e,n),a=toUrlString(null==o?void 0:o.url);if(!o||!a)return;const s=o.mapDefinition||o.definition||o.Definition||n,l=o.streamType||o.format||o.Format||e.type||"",c=(o.codec||(null==(r=null==(i=o.Codec)?void 0:i.toLowerCase)?void 0:r.call(i))||CodecType.H264).toLowerCase();return{vid:e.vid||o.vid||t.vid||"",url:a,definition:s,streamType:l,codec:c,bitrate:getIntNumber(o.bitrate||o.Bitrate),duration:getIntNumber(o.duration||o.Duration||e.duration),size:getIntNumber(o.size||o.Size)}}function getCachedTTDramaPreloadStream(e){const t=getCachedTTDramaMediaInfo(getTTDramaCacheOptions(e));return t?mapTTDramaVideoInfoToPreloadStream(t,e):void 0}function getCachedPlayAuthPreloadStream(e){const t=getCachedPlayAuthMediaInfo(e);return t?mapTTDramaVideoInfoToPreloadStream(t,e):void 0}function requestPlayAuthVideoInfo(e,t){const i=createPlayAuthConfig(e,t);return i.playAuthToken?getPlayInfoByAuthToken(i).catch((()=>{})):Promise.resolve(void 0)}function requestTTDramaInfo(e,t){const i=getTTDramaAlbumId(t),r=getTTDramaEpisodeId(t);if(!i||!r)return Promise.resolve(void 0);if(!(null==e?void 0:e.canIUseGetDramaInfo))return requestPlayAuthVideoInfo(t,e);if(!e.getDramaInfo)return Promise.resolve(void 0);const n={clientKey:e.clientKey,albumId:i,episodeId:r,vid:t.vid||""};return new Promise((i=>{try{e.getDramaInfo((r=>{try{if(!(null==r?void 0:r.is_success))return VE_DEBUG.error("[ttdrama] getDramaInfo invalid response",r),void i(void 0);const{data:n}=r;if((null==n?void 0:n.status)!==REVIEW_STATUS.SUCCESS||!(null==n?void 0:n.video_info))return VE_DEBUG.error("[ttdrama] getDramaInfo invalid response",r),void i(void 0);const o=transformDramaVideoInfoToRes(n.video_info,createPlayAuthConfig(t,e));i(o)}catch(e){VE_DEBUG.error("[ttdrama] getDramaInfo invalid response",r),i(void 0)}}),n)}catch(e){VE_DEBUG.error("[ttdrama] getDramaInfo call failed",e),i(void 0)}}))}function resolveTTDramaPreloadItem(e,t){return __async(this,null,(function*(){if(t&&!t.canIUseGetDramaInfo)return resolvePlayAuthPreloadItem(e,t);const i=getCachedTTDramaPreloadStream(e);if(i)return appendVideoUrlTimestampToStream(i);if(!(null==t?void 0:t.canIUseGetDramaInfo))return resolvePlayAuthPreloadItem(e,t);const r=yield requestTTDramaInfo(t,e);return r?(setCachedTTDramaMediaInfo(getTTDramaCacheOptions(e),r),appendVideoUrlTimestampToStream(mapTTDramaVideoInfoToPreloadStream(r,e))):void 0}))}function resolvePlayAuthPreloadItem(e,t){return __async(this,null,(function*(){const i=getCachedPlayAuthPreloadStream(e);if(i)return appendVideoUrlTimestampToStream(i);const r=yield requestPlayAuthVideoInfo(e,t);return r?(setCachedPlayAuthMediaInfo(e,r),appendVideoUrlTimestampToStream(mapTTDramaVideoInfoToPreloadStream(r,e))):void 0}))}function resolveTTDramaPreloadListItem(e,t){return __async(this,null,(function*(){if(toUrlString(e.url))return e;if(isDramaPreloadSource(e)){const i=yield resolveTTDramaPreloadItem(e,t);return i||t||isPlayAuthPreloadSource(e)?i:e}return isPlayAuthPreloadSource(e)?resolvePlayAuthPreloadItem(e,t):e}))}function resolveTTDramaPreloadList(e,t){return __async(this,null,(function*(){if(!(null==e?void 0:e.length))return e||[];let i;if(sniffer.os.isAndroid&&!(null==t?void 0:t.canAndroidBatchGetDramaInfo)){i=[];for(const r of e)i.push(yield resolveTTDramaPreloadListItem(r,t))}else i=yield Promise.all(e.map((e=>resolveTTDramaPreloadListItem(e,t))));return i.filter(Boolean)}))}const SUBTITLE_LANGUAGE_LIST=[{id:1,tag:"cmn-Hans-CN",label:"简体中文"},{id:2,tag:"eng-US",label:"English"},{id:3,tag:"jpn-JP",label:"日本語"},{id:4,tag:"kor-KR",label:"한국어"},{id:5,tag:"cmn-Hans-CN|eng-US",label:"中英双语"},{id:6,tag:"rus-RU",label:"Русский"},{id:7,tag:"fra-FR",label:"Français"},{id:8,tag:"por-PT",label:"Português"},{id:9,tag:"spa-ES",label:"Español"},{id:10,tag:"vie-VN",label:"Tiếng Việt"},{id:11,tag:"afr-ZA",label:"Afrikaans"},{id:12,tag:"ben-BD",label:"বাংলা"},{id:13,tag:"bul-BG",label:"Български"},{id:14,tag:"mya-MM",label:"မြန်မာဘာသာ"},{id:15,tag:"ces-CZ",label:"Čeština"},{id:16,tag:"dan-DK",label:"Dansk"},{id:17,tag:"hrv-HR",label:"Hrvatski"},{id:18,tag:"nld-NL",label:"Nederlands"},{id:19,tag:"fin-FI",label:"Suomi"},{id:20,tag:"deu-DE",label:"Deutsch"},{id:21,tag:"ell-GR",label:"Ελληνικά"},{id:22,tag:"hun-HU",label:"Magyar"},{id:23,tag:"ind-ID",label:"Bahasa Indonesia"},{id:24,tag:"gle-IE",label:"Gaeilge"},{id:25,tag:"isl-IS",label:"Íslenska"},{id:26,tag:"ita-IT",label:"Italiano"},{id:27,tag:"nor-NO",label:"Norsk"},{id:28,tag:"pol-PL",label:"Polski"},{id:29,tag:"swe-SE",label:"Svenska"},{id:30,tag:"tha-TH",label:"ภาษาไทย"},{id:31,tag:"tur-TR",label:"Türkçe"},{id:32,tag:"ukr-UA",label:"Українська"},{id:33,tag:"urd-PK",label:"اردو"},{id:34,tag:"ara-SA",label:"العربية"},{id:35,tag:"fra-CA",label:"Français (Canada)"},{id:36,tag:"cmn-Hant-CN",label:"繁體中文"},{id:37,tag:"msa-MY",label:"Bahasa Melayu"},{id:38,tag:"heb-IL",label:"עברית"},{id:39,tag:"jva-ID",label:"Basa Jawa"},{id:40,tag:"ron-RO",label:"Română"},{id:41,tag:"fil-PH",label:"Filipino"},{id:42,tag:"hin-IN",label:"हिन्दी"},{id:43,tag:"ben-IN",label:"বাংলা (ভারত)"},{id:44,tag:"khm-KH",label:"ភាសាខ្មែរ"},{id:45,tag:"bos-PH",label:"Bosanski"},{id:46,tag:"est-EE",label:"Eesti"},{id:47,tag:"lav-LV",label:"Latviešu"},{id:48,tag:"slk-SK",label:"Slovenčina"},{id:49,tag:"lit-LT",label:"Lietuvių"},{id:50,tag:"uyg-CN",label:"ئۇيغۇرچە"}],_byId=new Map,_byTag=new Map;for(const e of SUBTITLE_LANGUAGE_LIST)_byId.set(e.id,e.label),_byTag.set(e.tag.toLowerCase(),e.label);function getSubtitleLanguageLabel(e,t){const i="string"==typeof e?parseInt(e,10):e;if("number"==typeof i&&!isNaN(i)){const e=_byId.get(i);if(e)return e}if(t){const e=_byTag.get(t.toLowerCase());if(e)return e}}const getVeErrorInfo=VeError.getVeErrorInfo,defaultConfig={playAuthToken:"",needDefinitionList:!0},pickValue=(e,t,i,r=!1)=>{for(const i of t){const t=null==e?void 0:e[i];if(void 0!==t&&(!r||""!==t))return t}return i},getTextValue=(e,t="")=>null==e?t:`${e}`,isSubtitleUrlString=e=>!/\n/.test(e)&&(/^(https?:)?\/\//.test(e)||/^data:/.test(e)||/\.(vtt|srt)([?#].*)?$/i.test(e)),mapDramaReviewStatusToErrorCode=e=>{switch(e){case REVIEW_STATUS.NOT_SUBMITTED:return"NOT_SUBMITTED";case REVIEW_STATUS.UNDER_REVIEW:return"UNDER_REVIEW";case REVIEW_STATUS.FAILED_REVIEW:return"FAILED_REVIEW";case REVIEW_STATUS.WITHDRAWN:return"WITHDRAWN_REVIEW";case REVIEW_STATUS.NOT_ON_SHELF:return"NOT_ON_SHELF";default:return"FAILED_GET_EPISODE_INFO"}},mapDramaResponseErrorCode=(e,t)=>void 0!==t?mapDramaReviewStatusToErrorCode(t):(null==e?void 0:e.includes("not found"))||(null==e?void 0:e.includes("未查询"))?"NO_INFO_FOUND":(null==e?void 0:e.includes("query"))||(null==e?void 0:e.includes("查询"))?"FAILED_TO_QUERY":"FAILED_GET_EPISODE_INFO";class AuthToken extends SdkPlugin{constructor(e){super(e),this.isPlayByToken=!1,this.isEncrypt=!1,this.config=null,this.useUnionInfoDRM=!0,this.retryCount=1,this.init()}static get pluginName(){return"AuthToken"}beforePlayerCreate(){return __async(this,null,(function*(){if(this.isPlayByToken){const e=yield this.getVideoInfo();e&&this.playerData.initPlayData(e)}}))}getVideoInfo(){return __async(this,null,(function*(){var e;const t=null==(e=this.sdk)?void 0:e._createPlayerPerf,i=()=>__async(this,null,(function*(){var e,i,r,n,o,a,s,l,c,u,d,h;try{const p=this.isMinisDramaMode&&(null==(e=null==VePlayer$1?void 0:VePlayer$1.ttDramaEnv)?void 0:e.canIUseGetDramaInfo);if(!p&&((null==t?void 0:t.measure)?t.measure("beforePlayerCreate.authtoken.getVideoInfo.checkPlayAuthTokenValid",(()=>this.checkPlayAuthTokenValid())):this.checkPlayAuthTokenValid()))return;if(!!this.keyTokenInfo&&((null==t?void 0:t.measure)?t.measure("beforePlayerCreate.authtoken.getVideoInfo.checkKeyTokenValid",(()=>this.checkKeyTokenValid())):this.checkKeyTokenValid()))return;if(!!this.thirdPartyDrmAuthTokenInfo&&((null==t?void 0:t.measure)?t.measure("beforePlayerCreate.authtoken.getVideoInfo.checkDrmAuthTokenValid",(()=>this.checkDrmAuthTokenValid())):this.checkDrmAuthTokenValid()))return;const f=((null==t?void 0:t.measureAsync)?yield t.measureAsync("beforePlayerCreate.authtoken.getVideoInfo.getVideos",(()=>__async(this,null,(function*(){return yield this.getVideos()})))):yield this.getVideos())||{};VE_DEBUG.log("getVideo res: ",f);const{type:g,poster:y,vid:_,dashOpts:m,thumbs:v,barrageMaskUrl:E}=f||{},T=f.playList||[];null==(r=null==(i=this.sdk)?void 0:i.assertLiteConfig)||r.call(i,{type:g,playList:T,rtm:f.rtm}),this.playInfo=f,this.setSubtitleConfig(f);const S=g||getFormat(this.config);this.getPrivateDrmInfo&&((null==t?void 0:t.measureAsync)?yield t.measureAsync("beforePlayerCreate.authtoken.getVideoInfo.getPrivateDrmInfo",(()=>__async(this,null,(function*(){return yield this.getPrivateDrmInfo(T,_,S)})))):yield this.getPrivateDrmInfo(T,_,S)),this.playerData.options.vid=_;if(y&&(this.config.needPoster||this.isMinisDramaMode)&&("string"==typeof this.playerData.options.poster?this.playerData.options.poster=y:"object"==typeof this.playerData.options.poster?this.playerData.options.poster.poster=y:this.playerData.options.poster=y),this.config.needThumbs&&v.length>0&&((null==t?void 0:t.measure)?t.measure("beforePlayerCreate.authtoken.getVideoInfo.getThumbnailConfig",(()=>this.getThumbnailConfig(v))):this.getThumbnailConfig(v)),T.length>0){(null==(n=T[0])?void 0:n.drmType)&&this.playerData.setDrmType(T[0].drmType);const e=(null==(a=null==(o=this.playerData)?void 0:o.adapter)?void 0:a.generatePlaylistFromServer(f,this.config.useMasterM3u8))||[...T],i=this.config.defaultDefinition||this.playerData.configs.defaultDefinition;let r=e[0];if(i){const t=e.find((e=>(e.mapDefinition||e.definition||e.Definition).toLocaleLowerCase()===i.toLocaleLowerCase()));t&&(r=t)}const p=this.config.needDefinitionList?e:[r];this.isEncrypt=!!(null==p?void 0:p[0].kid);const g=(null==(s=T[0])?void 0:s.codec)||(null==(c=null==(l=T[0])?void 0:l.Codec)?void 0:c.toLowerCase())||(null==(d=null==(u=this.tokenInfo)?void 0:u.Codec)?void 0:d.toLowerCase())||CodecType.H264,y={vid:_,dashOpts:m,codec:g,playList:p,defaultDefinitionData:r};return(null==t?void 0:t.measure)?(t.measure("beforePlayerCreate.authtoken.getVideoInfo.getDrmConfig",(()=>this.getDrmConfig(y))),t.measure("beforePlayerCreate.authtoken.getVideoInfo.setPluginConfigInVid",(()=>{var e;return null==(e=this.playerData.adapter)?void 0:e.setPluginConfigInVid(y,this)}))):(this.getDrmConfig(y),null==(h=this.playerData.adapter)||h.setPluginConfigInVid(y,this)),{vid:_,playList:p,codec:g,defaultDefinition:r.definition}}VE_DEBUG.error("get no media info")}catch(e){if(VE_DEBUG.error(e),"VEPLAYER_LITE_UNSUPPORTED_FEATURE"===(null==e?void 0:e.code))throw e}}));return(null==t?void 0:t.measureAsync)?yield t.measureAsync("beforePlayerCreate.authtoken.getVideoInfo",i):yield i()}))}getDramaInfoViaJSB(){return __async(this,null,(function*(){var e,t;const i=VePlayer$1.ttDramaEnv,r=(null==(e=this.playerData)?void 0:e.configs)||{},n=r.album_id||r.albumId,o=r.episode_id||r.episodeId,a=r.vid||"";if((null==i?void 0:i.getDramaInfo)&&n&&o)return new Promise((e=>{const t={clientKey:i.clientKey,albumId:n,episodeId:o,vid:a},r=t=>{var i;VE_DEBUG.error("getDramaInfo error:",t);const r={errorType:"drama",errorCode:DRAMA_ERROR_CODE.FAILED_GET_EPISODE_INFO.code,veError:getVeErrorInfo({code:DRAMA_ERROR_CODE.FAILED_GET_EPISODE_INFO.code,message:DRAMA_ERROR_CODE.FAILED_GET_EPISODE_INFO.message,textKey:DRAMA_ERROR_CODE.FAILED_GET_EPISODE_INFO.textKey}),errorMessage:DRAMA_ERROR_CODE.FAILED_GET_EPISODE_INFO.message,ext:{originError:t},originError:t};null==(i=this.sdk)||i.delayError.push(r),e(void 0)};try{i.getDramaInfo((t=>{var i,s,l,c;try{if(VE_DEBUG.log("getDramaInfoViaJSB res:",t),this.reportGetDramaInfoPerf(t,{albumId:n,episodeId:o,vid:a}),!(null==t?void 0:t.is_success)){VE_DEBUG.error("getDramaInfoViaJSB invalid response:",t);const r=mapDramaResponseErrorCode(null==(i=null==t?void 0:t.error)?void 0:i.error_msg,void 0),n=DRAMA_ERROR_CODE[r]||DRAMA_ERROR_CODE.FAILED_GET_EPISODE_INFO,o={errorType:"drama",errorCode:n.code,veError:getVeErrorInfo({code:n.code,message:n.message,textKey:n.textKey}),errorMessage:n.message,ext:{jsbError:null==t?void 0:t.error},originError:t};return null==(s=this.sdk)||s.delayError.push(o),void e(void 0)}const{data:r}=t;if((null==r?void 0:r.status)!==REVIEW_STATUS.SUCCESS){VE_DEBUG.error("getDramaInfoViaJSB invalid response:",t);const i=mapDramaReviewStatusToErrorCode(null==r?void 0:r.status),n=DRAMA_ERROR_CODE[i]||DRAMA_ERROR_CODE.FAILED_GET_EPISODE_INFO,o={errorType:"drama",errorCode:n.code,veError:getVeErrorInfo({code:n.code,message:n.message,textKey:n.textKey}),errorMessage:n.message,ext:{status:null==r?void 0:r.status},originError:t};return null==(l=this.sdk)||l.delayError.push(o),void e(void 0)}if(!(null==r?void 0:r.video_info)){VE_DEBUG.error("getDramaInfoViaJSB invalid response:",t);const i={errorType:"drama",errorCode:DRAMA_ERROR_CODE.FAILED_TO_QUERY.code,veError:getVeErrorInfo({code:DRAMA_ERROR_CODE.FAILED_TO_QUERY.code,message:DRAMA_ERROR_CODE.FAILED_TO_QUERY.message,textKey:DRAMA_ERROR_CODE.FAILED_TO_QUERY.textKey}),errorMessage:DRAMA_ERROR_CODE.FAILED_TO_QUERY.message,ext:{status:null==r?void 0:r.status},originError:t};return null==(c=this.sdk)||c.delayError.push(i),void e(void 0)}VE_DEBUG.log("videoInfoRes before transformDramaVideoInfoToRes",r.video_info);const u=this.transformDramaVideoInfoToRes(r.video_info,this.config);VE_DEBUG.log("videoInfoRes after transformDramaVideoInfoToRes",u),e(u)}catch(e){r(e)}}),t)}catch(e){r(e)}}));{const e=DRAMA_ERROR_CODE.INVALID_PARAM;null==(t=this.sdk)||t.delayError.push({errorType:VE_ERROR_TYPE_MAP.network,errorCode:e.code,veError:getVeErrorInfo({code:e.code,message:e.message,textKey:e.textKey}),errorMessage:e.message,ext:{},originError:void 0})}}))}mapReviewStatusToErrorCode(e){return mapDramaReviewStatusToErrorCode(e)}mapDramaErrorCode(e,t){return mapDramaResponseErrorCode(e,t)}transformDramaVideoInfoToRes(e,t){return transformDramaVideoInfoToRes(e,t)}callOnGetMediaInfo(e,t){var i,r,n;if(e)try{null==(n=null==(r=null==(i=this.playerData)?void 0:i.configs)?void 0:r.onGetMediaInfo)||n.call(r,{data:e,fromCache:t})}catch(e){VE_DEBUG.error("onGetMediaInfo callback error:",e)}}reportGetDramaInfoPerf(e,t){var i,r,n,o;const a=null==(i=null==e?void 0:e.data)?void 0:i.perf_info;a&&(null==(o=null==(r=this.sdk)?void 0:r.recordGetDramaInfoPerf)||o.call(r,{perfInfo:a,albumId:t.albumId,episodeId:t.episodeId,vid:t.vid,isSuccess:!!(null==e?void 0:e.is_success),status:null==(n=null==e?void 0:e.data)?void 0:n.status,fromCache:!1,timestamp:Date.now()}))}getVideos(){return __async(this,null,(function*(){var e,t,i,r,n,o;const a=null==(e=this.sdk)?void 0:e._createPlayerPerf;if(VE_DEBUG.log("tt drama info: ",this.isMinisDramaMode,null==VePlayer$1?void 0:VePlayer$1.ttDramaEnv),this.isMinisDramaMode&&(null==(t=null==VePlayer$1?void 0:VePlayer$1.ttDramaEnv)?void 0:t.canIUseGetDramaInfo)){const e=__spreadProps(__spreadValues({},(null==(i=this.playerData)?void 0:i.configs)||{}),{defaultDefinition:(null==(n=null==(r=this.playerData)?void 0:r.configs)?void 0:n.defaultDefinition)||(null==(o=this.config)?void 0:o.defaultDefinition),getVideoByToken:this.config}),t=getCachedTTDramaMediaInfo(getTTDramaCacheOptions(e));if(t){const e=appendVideoUrlTimestampToMediaInfo(t);return this.callOnGetMediaInfo(e,!0),e}const s=t=>{setCachedTTDramaMediaInfo(getTTDramaCacheOptions(e),t);const i=appendVideoUrlTimestampToMediaInfo(t);return this.callOnGetMediaInfo(i,!1),i};if(null==a?void 0:a.measureAsync){return s(yield a.measureAsync("beforePlayerCreate.authtoken.getVideoInfo.getVideos.getDramaInfoViaJSB",(()=>__async(this,null,(function*(){return yield this.getDramaInfoViaJSB()})))))}return s(yield this.getDramaInfoViaJSB())}const s=e=>{var t,i,r;try{const i=JSON.parse(e.response);if(100006===get$1(i,"ResponseMetadata.Error.CodeN")){VE_DEBUG.error("playAuthToken is invalid or expired, please check or update your playAuthToken");const i={errorType:"token",errorCode:9101,veError:getVeErrorInfo(veErrorCodeMap.PLAY_AUTH_TOKEN_EXPIRED),errorMessage:"playAuthToken has expired",ext:{serveResponse:"string"==typeof(null==e?void 0:e.response)?null==e?void 0:e.response:"",serveStatus:null==e?void 0:e.status,playAuthToken:this.config.playAuthToken,config:this.config},originError:e};return null==(t=this.sdk)?void 0:t.delayError.push(i)}}catch(e){VE_DEBUG.log(e)}null==(i=this._emitter)||i.emit(PluginEvents.GET_PLAY_URL_ERR,e);const n={errorType:"token",errorCode:9100,errorMessage:"get play url error by playAuthToken, please check the playAuthToken",veError:getVeErrorInfo(veErrorCodeMap.GET_PLAY_INFO_ERR),ext:{serveResponse:"string"==typeof(null==e?void 0:e.response)?null==e?void 0:e.response:"",serveStatus:null==e?void 0:e.status,playAuthToken:this.config.playAuthToken},originError:e};null==(r=this.sdk)||r.delayError.push(n)},l=e=>__async(this,null,(function*(){if(!this.config.playDomain&&502===(null==e?void 0:e.status)&&this.playerData.apiMap.backupPlayDomain)return this.playerData.playDomainDegrade=!0,yield retryByError((()=>getPlayInfoByAuthToken(__spreadValues({playDomain:this.playerData.playDomain},this.config))),this.retryCount,(e=>502===e.status),s);s(e)})),c=()=>__async(this,null,(function*(){var e,t;const i=__spreadValues({playDomain:this.config.playDomain||this.playerData.playDomain},this.config),r=getMediaInfoCacheKey(i),n=getEnabledCachedMediaInfoByConfig(i);if(n){VE_DEBUG.log("[mediaInfoCache] authToken use cached media info",{cacheKey:r,vid:n.vid,playListLength:(null==(e=n.playList)?void 0:e.length)||0});const t=appendVideoUrlTimestampToMediaInfo(n);return this.callOnGetMediaInfo(t,!0),t}VE_DEBUG.log("[mediaInfoCache] authToken request media info",{cacheKey:r,retryCount:this.retryCount,playDomain:i.playDomain});const o=yield retryByError((()=>getPlayInfoByAuthToken(i)),this.retryCount,(e=>502===e.status),l);setEnabledCachedMediaInfoByConfig(i,o);const a=appendVideoUrlTimestampToMediaInfo(o);return VE_DEBUG.log("[mediaInfoCache] authToken request finished",{cacheKey:r,vid:null==o?void 0:o.vid,playListLength:(null==(t=null==o?void 0:o.playList)?void 0:t.length)||0,mediaInfo:o}),this.callOnGetMediaInfo(a,!1),a}));return(null==a?void 0:a.measureAsync)?yield a.measureAsync("beforePlayerCreate.authtoken.getVideoInfo.getVideos.getPlayInfoByAuthToken",c):yield c()}))}getPrivateDrmInfo(e,t,i){return __async(this,null,(function*(){var r,n,o,a;const s=null==(r=this.sdk)?void 0:r._createPlayerPerf;if(this.config.getDrmAuthToken&&"function"==typeof this.config.getDrmAuthToken&&this.playerData.unionId){let r;if(this.sessionId=(new Date).getTime().toString(),"hls"===i){const e=(null==s?void 0:s.measureAsync)?yield s.measureAsync("beforePlayerCreate.authtoken.getVideoInfo.getPrivateDrmInfo.loadPlugins.hlsEncrypt",(()=>__async(this,null,(function*(){return yield this.sdk.sdkUmdLoader.loadPlugins(UmdKeys.HLSEncrypt)})))):yield this.sdk.sdkUmdLoader.loadPlugins(UmdKeys.HLSEncrypt);r=null==(n=null==e?void 0:e.updateUnionInfo)?void 0:n.call(e,this.playerData.unionId,this.sessionId)}else if("dash"===i){const e=(null==s?void 0:s.measureAsync)?yield s.measureAsync("beforePlayerCreate.authtoken.getVideoInfo.getPrivateDrmInfo.loadPlugins.dash",(()=>__async(this,null,(function*(){return yield this.sdk.sdkUmdLoader.loadPlugins(UmdKeys.DASH)})))):yield this.sdk.sdkUmdLoader.loadPlugins(UmdKeys.DASH);r=null==(o=null==e?void 0:e.updateUnionInfo)?void 0:o.call(e,this.playerData.unionId,this.sessionId)}else if(["mp4","m4a"].includes(i)){const e=(null==s?void 0:s.measureAsync)?yield s.measureAsync("beforePlayerCreate.authtoken.getVideoInfo.getPrivateDrmInfo.loadPlugins.mp4Encrypt",(()=>__async(this,null,(function*(){return yield mediaDependencies.loadMp4Encrypt(this.sdk.sdkUmdLoader)})))):yield mediaDependencies.loadMp4Encrypt(this.sdk.sdkUmdLoader);r=null==(a=null==e?void 0:e.updateUnionInfo)?void 0:a.call(e,this.playerData.unionId,this.sessionId)}if(!r)return void VE_DEBUG.error("updateUnionInfo fail");const l=[...new Set(e.map((e=>e.kid)))].join(",");try{const i=(null==s?void 0:s.measureAsync)?yield s.measureAsync("beforePlayerCreate.authtoken.getVideoInfo.getPrivateDrmInfo.getDrmAuthToken",(()=>__async(this,null,(function*(){return yield exeFunTimeoutWarn(retPromise$1(this.config.getDrmAuthToken(l,t,r)),200,"The execution time of obtaining privateDrmAuthToken by getDrmAuthToken function of options has exceeded more than 200ms")})))):yield exeFunTimeoutWarn(retPromise$1(this.config.getDrmAuthToken(l,t,r)),200,"The execution time of obtaining privateDrmAuthToken by getDrmAuthToken function of options has exceeded more than 200ms");if(i&&"string"==typeof i){this.privateDrmAuthToken=i;const t=getQueryParams(i);(null==t?void 0:t.DrmType)&&(this.useUnionInfoDRM="webdevice"===(null==t?void 0:t.DrmType)),e.forEach((e=>{e.drmKeyToken=this.privateDrmAuthToken}))}}catch(e){VE_DEBUG.error("get privaterDrmToken fail")}}}))}getThumbnailConfig(e){const t=e[0],i=__spreadValues({},this.playerData.configs.thumbnail||{});this.playerData.options.thumbnail=__spreadValues({pic_num:t.CaptureNum,urls:t.StoreUrls,width:t.CellWidth,height:t.CellHeight,col:t.ImgXLen,row:t.ImgYLen},i)}getBarrageMaskUrl(e){var t,i;const r=null==(t=this.playerData.configs)?void 0:t.DanmuPlugin,n="object"==typeof r?r:{},o=__spreadValues({},(null==n?void 0:n.maskConfig)||{});this.playerData.configs.DanmuPlugin?(this.playerData.options.DanmuPlugin.maskActive=null==(i=n.maskActive)||i,this.playerData.options.DanmuPlugin.maskConfig=__spreadValues({maskUrl:e},o)):this.playerData.options.DanmuPlugin={active:!0,maskActive:!0,maskConfig:__spreadValues({maskUrl:e},o)}}setSubtitleConfig(e){var t,i,r,n,o,a,s,l,c;if(!(null==(i=null==(t=this.playerData)?void 0:t.configs)?void 0:i.autoSubtitle)||!e)return;const u=this.getAutoSubtitleList(e),d=null==(r=this.playerData.options)?void 0:r.Subtitle,h=null==(n=this.playerData.configs)?void 0:n.Subtitle,p="object"==typeof d&&d?d:"object"==typeof h&&h?h:{};this.playerData.options.Subtitle=__spreadProps(__spreadValues({},p),{list:u}),null==(c=null==(l=null==(s=null==(a=null==(o=this.sdk)?void 0:o.player)?void 0:a.plugins)?void 0:s.subtitle)?void 0:l.updateSubtitles)||c.call(l,u)}getAutoSubtitleList(e){const t=this.getSubtitleSourceData(e),i=pickValue(t,["SubtitleInfoList","subtitleInfoList","subtitle_info_list"],[]);if(!Array.isArray(i))return[];const r=i.map(((e,t)=>this.getAutoSubtitleItem(e,t))).filter((e=>Boolean(e)));return r.some((e=>void 0!==e._subtitleOrder))&&r.sort(((e,t)=>{var i,r;return(null!=(i=e._subtitleOrder)?i:1/0)-(null!=(r=t._subtitleOrder)?r:1/0)})),r.forEach((e=>{delete e._subtitleOrder})),r}getSubtitleSourceData(e){const t=null==e?void 0:e.dashOpts;return(null==t?void 0:t.Data)||(null==t?void 0:t.data)||e}getAutoSubtitleItem(e,t){const i="string"==typeof e?this.getStringAutoSubtitleItem(e,t):this.getObjectAutoSubtitleItem(e,t);if(i)return this.formatAutoSubtitleItem(i,e,t)}getStringAutoSubtitleItem(e,t){const i=`${t+1}`;return __spreadValues({id:`${t}`,language:`${t}`,label:i,text:i},!/\n/.test(r=e)&&(/^(https?:)?\/\//.test(r)||/^data:/.test(r)||/\.(vtt|srt)([?#].*)?$/i.test(r))?{url:e}:{stringContent:e});var r}getObjectAutoSubtitleItem(e,t){if(!e||"object"!=typeof e)return;const i=pickValue(e,["SubtitleUrl","subtitleUrl","subtitle_url","url","src"],"",!0),r=pickValue(e,["StringContent","stringContent","string_content"],"",!0),n=pickValue(e,["List","list"]);if(!i&&!r&&!n)return;const o=getSubtitleLanguageLabel(pickValue(e,["LanguageId","languageId","language_id"],void 0,!0),pickValue(e,["Language","language"],"",!0))||getTextValue(pickValue(e,["Title","title","label","text","Language","language","Tag","tag","LanguageId","languageId","language_id"],`${t+1}`,!0),`${t+1}`),a=getTextValue(pickValue(e,["SubtitleId","subtitleId","subtitle_id","FileId","fileId","file_id","id"],`${t}`,!0),`${t}`),s=getTextValue(pickValue(e,["Language","language","LanguageId","languageId","language_id","srclang"],`${t}`,!0),`${t}`);return __spreadValues(__spreadValues(__spreadValues(__spreadProps(__spreadValues({},e),{id:a,language:s,label:o,text:o}),i?{url:i}:{}),r?{stringContent:r}:{}),n?{list:n}:{})}formatAutoSubtitleItem(e,t,i){var r,n;const o=null==(n=null==(r=this.playerData)?void 0:r.configs)?void 0:n.formatAutoSubtitleItem;if("function"!=typeof o)return e;const a=o(t,i);if(!1!==a&&null!==a){if(!0===a||void 0===a)return e;if("string"==typeof a||"number"==typeof a){const t=`${a}`;return __spreadProps(__spreadValues({},e),{label:t,text:t})}if("object"==typeof a){if(!1===a.show||!1===a.visible)return;const t=Object.prototype.hasOwnProperty.call(a,"order"),i=Object.prototype.hasOwnProperty.call(a,"label")||Object.prototype.hasOwnProperty.call(a,"text")?(()=>{var t;const i=getTextValue(null!=(t=a.label)?t:a.text,"");return __spreadProps(__spreadValues({},e),{label:i,text:i})})():e;t&&(i._subtitleOrder=a.order);const r=Object.prototype.hasOwnProperty.call(a,"isDefault"),n=Object.prototype.hasOwnProperty.call(a,"default");return(r||n)&&(i.isDefault=r?Boolean(a.isDefault):Boolean(a.default)),i}return e}}getDrmConfig(e){var t,i,r,n,o,a,s,l;const{thirdPartyDrmAuthToken:c,serverCertificatePath:u}=this.config;if(c)try{const{vid:c,playList:d}=e,{kid:h,codec:p}=null==d?void 0:d[0];if(!h||!c)return void VE_DEBUG.warn("get kid or vid fail");const f=null==(t=this.playerData.configs)?void 0:t.drm,g="object"==typeof f?f:{},{playDomain:y}=this.config,_=y||this.playerData.playDomain,m=getAtobToken(this.config.thirdPartyDrmAuthToken,"GetThirdPartyDrmAuthToken"),v=__spreadValues({ignoreLicenseHeader:!1,unRecord:null!=(i=this.config.unRecord)&&i,contentType:ContentType[p],initDataType:"cenc",[KeySystemType.FAIRPLAY]:{serverProcessSPCPath:getServerProcessSPCPath(KeySystemType.FAIRPLAY,h,_,m),serverCertificatePath:u},[KeySystemType.WIDEVINE]:{serverProcessSPCPath:getServerProcessSPCPath(KeySystemType.WIDEVINE,h,_,m)},[KeySystemType.PLAYREADY]:{serverProcessSPCPath:getServerProcessSPCPath(KeySystemType.PLAYREADY,h,_,m)}},g);(null==(o=null==(n=null==(r=this.sdk)?void 0:r.player)?void 0:n.plugins)?void 0:o.drm)&&(null==(l=null==(s=null==(a=this.sdk)?void 0:a.player)?void 0:s.plugins)||l.drm.updateConfig(v)),this.playerData.options.drm=v}catch(e){VE_DEBUG.error("generate drm config error:",e)}else this.playerData.options.drm={initDataType:"cenc"}}get isMinisDramaMode(){const e=VePlayer$1.ttDramaEnv;return!!(null==e?void 0:e.getDramaInfo)}init(){const e=this.playerData.configs,{getVideoByToken:t={}}=e;this.initConfig(t)}initConfig(e){var t;const i=(null==(t=this.playerData)?void 0:t.configs)||{},r=i.albumId||i.album_id,n=i.episodeId||i.episode_id,o=!(!r||!n),a=!!VePlayer$1.ttDramaEnv;if(this.isPlayByToken=!!e.playAuthToken||a&&o,this.isPlayByToken&&(this.config=Object.assign({},defaultConfig,e),e.playAuthToken)){if(this.tokenInfo=parseToken(e.playAuthToken),e.keyToken){const t=isBase64(e.keyToken)?window.atob(e.keyToken):e.keyToken;this.keyTokenInfo=getQueryParams(t)}e.thirdPartyDrmAuthToken&&(this.thirdPartyDrmAuthTokenInfo=parseToken(e.thirdPartyDrmAuthToken,"GetThirdPartyDrmAuthToken")),e.retryCount&&(this.retryCount=e.retryCount)}}updateDramaEpisode(e){return __async(this,null,(function*(){var t;const i=((null==(t=this.playerData)?void 0:t.configs)||{}).getVideoByToken||{};this.initConfig(i);const r=yield this.getVideoInfo();r&&(e?this.playerData.initPlayData(r):(this.playerData.updateConfigs(__spreadProps(__spreadValues({},r),{defaultDefinition:this.playerData.current.definition})),this.playerData.updatePlayList(),this.playerData.updateCheckExpireData()))}))}updateAuthToken(e,t){return __async(this,null,(function*(){const i=Object.assign({},this.config,e);this.initConfig(i);const r=yield this.getVideoInfo();r&&(t?this.playerData.initPlayData(r):(this.playerData.updateConfigs(__spreadProps(__spreadValues({},r),{defaultDefinition:this.playerData.current.definition})),this.playerData.updatePlayList(),this.playerData.updateCheckExpireData()))}))}checkPlayAuthTokenValid(){var e,t;if(!this.tokenInfo)return!1;if(isTokenExpired(this.tokenInfo)){VE_DEBUG.error("playAuthToken is expired, please check or update your playAuthToken"),null==(e=this.sdk)||e.delayEvents.push({name:SDKEvents.TOKEN_EXPIRED,payload:{type:"playAuthToken",token:this.tokenInfo}});const i={errorType:"token",errorCode:9101,veError:getVeErrorInfo(veErrorCodeMap.PLAY_AUTH_TOKEN_EXPIRED),errorMessage:"playAuthToken has expired",ext:{playAuthToken:this.config.playAuthToken,config:this.config},originError:void 0};return null==(t=this.sdk)||t.delayError.push(i),!0}return!1}checkKeyTokenValid(){var e,t;if(isTokenExpired(this.keyTokenInfo)){VE_DEBUG.error("keyToken is expired, please check or update your keyToken"),null==(e=this.sdk)||e.delayEvents.push({name:SDKEvents.TOKEN_EXPIRED,payload:{type:"keyToken",token:this.keyTokenInfo}});const i={errorType:"token",errorCode:9102,veError:getVeErrorInfo(veErrorCodeMap.HLS_KEY_TOKEN_EXPIRED),errorMessage:"keyToken for hls encrypt play has expired",ext:{keyToken:this.config.keyToken,config:this.config},originError:void 0};return null==(t=this.sdk)||t.delayError.push(i),!0}return!1}checkDrmAuthTokenValid(){var e,t;if(isTokenExpired(this.thirdPartyDrmAuthTokenInfo)){VE_DEBUG.error("thirdPartyDrmAuthToken is expired, please check or update your thirdPartyDrmAuthToken"),null==(e=this.sdk)||e.delayEvents.push({name:SDKEvents.TOKEN_EXPIRED,payload:{type:"thirdPartyDrmAuthToken",token:this.thirdPartyDrmAuthTokenInfo}});const i={errorType:"token",errorCode:9103,errorMessage:"thirdPartyDrmAuthToken for DRM has expired",veError:getVeErrorInfo(veErrorCodeMap.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED),ext:{thirdPartyDrmAuthToken:this.config.thirdPartyDrmAuthToken,config:this.config},originError:void 0};return null==(t=this.sdk)||t.delayError.push(i),!0}return!1}}class Abr extends SdkPlugin{static get pluginName(){return"Abr"}constructor(e){super(e)}static get defaultConfig(){return{autoDefiText:"",isOpenAutoDefi:!1,interval:1e3,hurryThreshold:.25,lowThreshold:.4,highThreshold:.7,noStallCheckTime:5,isOpenHint:!1,method:31}}beforePlayerCreate(){return __async(this,null,(function*(){return yield this.prepareAbrModule()}))}prepareAbrModule(){return __async(this,null,(function*(){var e,t;return null==(t=null==(e=this.sdk.playerData)?void 0:e.adapter)?void 0:t.prepareAbrModule(this.playerData,this.sdk.sdkUmdLoader)}))}adaptAbrOptions(){var e;const t=null==(e=this.playerData.configs)?void 0:e.autoBitrateOpts;if(t){const e=this.playerData.defaultDefinition;return __spreadProps(__spreadValues(__spreadValues({},Abr.defaultConfig),t),{autoDefiText:t.autoDefinitionText||"",isOpenAutoDefi:this.playerData.isOpenABR(),isPlayAutoDefi:this.playerData.isPlayAutoDefinition(e)})}}applyAbrConfig(e){var t,i;const r=this.adaptAbrOptions();r&&(null==(i=null==(t=this.sdk.playerData)?void 0:t.adapter)||i.applyAbrPluginConfig(e,r))}}class AdaptRange extends SdkPlugin{static get pluginName(){return"AdaptRange"}constructor(e){super(e)}adaptRangeOptions(){var e,t,i,r,n,o,a,s;const l=null!=(t=null==(e=this.playerData.configs)?void 0:e.adaptRange)?t:void 0;if(!(null==l?void 0:l.enable)||!(null==(r=null==(i=this.playerData.adapter)?void 0:i.canAdaptRangeEnable)?void 0:r.call(i)))return;const c=this.playerData.adapter.adaptRangeDefaultOptions();return __spreadProps(__spreadValues(__spreadValues({},null!=c?c:{}),l),{minTargetCacheDur:null!=(n=l.minCacheDuration)?n:null==c?void 0:c.minTargetCacheDur,maxTargetCacheDur:null!=(o=l.maxCacheDuration)?o:null==c?void 0:c.maxTargetCacheDur,rangeMinDuration:null!=(a=l.minRangeDuration)?a:null==c?void 0:c.rangeMinDuration,rangeMaxDuration:null!=(s=l.maxRangeDuration)?s:null==c?void 0:c.rangeMaxDuration})}applyRangeConfig(e){const t=this.adaptRangeOptions();t&&e&&this.playerData.adapter.applyAdaptRangePluginConfig(e,t)}}class Strategy extends SdkPlugin{static get pluginName(){return"Strategy"}applyFinalStrategy(e){var t,i,r,n;if(VeStrategy.isReady()){const o=this.playerData.configs.duration||(null==(i=null==(t=this.playerData.playList)?void 0:t[0])?void 0:i.duration)||-1,a=o>0&&o<=180?"svideo":o>180&&o<=1800?"mvideo":"lvideo",s={vtype:null==(r=this.playerData.adapter)?void 0:r.streamType,duration:o,videoLabel:a},l=VeStrategy.getStrategyRecommendations(void 0,s),{result:c}=l;VE_DEBUG.log("VodLogCommon Final StrategyConfig:",c);const u=null==c?void 0:c[StrategyNames.ADAPT_RANGE];(null==u?void 0:u.enable)&&(null==u?void 0:u.options)&&(null==(n=this.playerData.adapter)||n.applyAdaptRangeStrategy(e,u.options))}}}const sdkPluginManager={init(e){var t;if(!e)return;const i=e.playerData.sdkPlugins;(null==(t=e.playerData)?void 0:t.isLive)?e.sdkPlugins=[...i]:e.sdkPlugins=[AuthToken,Abr,AdaptRange,Strategy,...i],e._sdkPlugins={}},registerPlugin(e,t){if(!e||!t)return;let i=null,r=null;e.plugin&&"function"==typeof e.plugin?(i=e.plugin,r=e.options):(i=e,r={}),r.sdk=t;const n=r.pluginName||i.pluginName;if(!n)throw new Error("The property pluginName is necessary");const o=t._sdkPlugins;try{o[n.toLowerCase()]&&this.unRegister(n);const e=new i(r);return o[n.toLowerCase()]=e,o[n.toLowerCase()].func=i,e&&"function"==typeof e.afterCreate&&e.afterCreate(),e}catch(e){VE_DEBUG.error(e)}},unRegister(e,t){if(e&&t){e=e.toLowerCase();try{const i=t._sdkPlugins[e];i&&(i.pluginName&&i.__destroy(),delete t._sdkPlugins[e])}catch(e){VE_DEBUG.error(e)}}},beforePlayerCreate(e){if(!e)return;e._sdkPlugins||this.init(e);const t=e._sdkPlugins,i=null==e?void 0:e._createPlayerPerf,r=[];for(const e of Object.keys(t))if(t[e]&&t[e].beforePlayerCreate)try{const n=()=>retPromise$1(t[e].beforePlayerCreate());(null==i?void 0:i.measureAsync)?r.push(i.measureAsync(`beforePlayerCreate.${e}`,n)):r.push(n())}catch(e){throw r.push(retPromise$1(null)),e}return new Promise(((e,t)=>{Promise.all([...r]).then((()=>{e(null)})).catch((i=>{VE_DEBUG.error(i),"VEPLAYER_LITE_UNSUPPORTED_FEATURE"!==(null==i?void 0:i.code)?e(null):t(i)}))}))},afterPlayerCreate(e){if(!e)return;const t=e._sdkPlugins;for(const e of Object.keys(t))if(t[e]&&t[e].beforePlayerCreate)try{t[e].afterPlayerCreate()}catch(e){throw e}},destroy(e){if(!e)return;const t=e._sdkPlugins;if(t){for(const i of Object.keys(t))this.unRegister(i,e);delete e._sdkPlugins}}},sdkPluginManager$1=sdkPluginManager,EN_TEXT={[LangTextKey.NETWORK]:"Network error",[LangTextKey.NETWORK_TIMEOUT]:"Network timeout",[LangTextKey.NETWORK_FORBIDDEN]:"The video URL is prohibited from access. Please check the domain name access control",[LangTextKey.NETWORK_NOTFOUND]:"The video not found, please check whether the URL is correct",[LangTextKey.NETWORK_RANGE_NOT_SATISFIABLE]:"The request range is incorrect, please try again later",[LangTextKey.NETWORK_PROTOCOL]:"The request protocol is incorrect, please use the https URL to access",[LangTextKey.NETWORK_URL_EXPIRE]:"The video URL has expired",[LangTextKey.NETWORK_URL_SIGN]:"The video URL signature is incorrect, please check whether the URL is correct",[LangTextKey.NETWORK_ENCRYPT_HLS_ERR]:"Get the m3u8 file or encrypt key fail",[LangTextKey.MEDIA_ERR]:"Media error",[LangTextKey.MEDIA_ERR_ABORTED]:"Playback was canceled by the user or browser",[LangTextKey.MEDIA_ERR_NETWORK]:"Network error",[LangTextKey.MEDIA_ERR_DECODE]:"Decoding error",[LangTextKey.MEDIA_ERR_SRC_NOT_SUPPORTED]:"Audio/Video format not supported or URL unavailable",[LangTextKey.MEDIA_ERR_NOT_SUPPORTED]:"Unsupported video format",[LangTextKey.MEDIA_ERR_URL_EMPTY]:"Video URL is empty",[LangTextKey.MEDIA_ERR_FILE_NOT_SUPPORTED]:"Video file is not supported in the current browser environment",[LangTextKey.MEDIA_ERR_PLAY_ERR]:"Video playback error",[LangTextKey.MEDIA_SOURCE_CANNOT_PLAY_TYPE]:"Unsupported video type",[LangTextKey.BUSINESS_DRM_NOT_SUPPORT]:"DRM encrypted playback is not supported",[LangTextKey.BUSINESS_DRM_NOT_SUPPORT_UN_RECORD]:"Screen recording protection is not supported",[LangTextKey.BUSINESS_DRM_LACK_MEDIA_KEY]:"Video data lacks the corresponding MediaKey",[LangTextKey.BUSINESS_DRM_LACK_KEY_SESSION]:"Browser does not support the corresponding DRM KeySession",[LangTextKey.BUSINESS_DRM_GENERATE_REQUEST_FAIL]:"Decryption playback error",[LangTextKey.BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH]:"Missing DRM certificate request link",[LangTextKey.BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH]:"Missing DRM License request link",[LangTextKey.BUSINESS_DRM_LICENSE_FAIL]:"Request or update License failed",[LangTextKey.BUSINESS_DRM_KEY_ERROR]:"Decryption error",[LangTextKey.BUSINESS_DRM_CERT_FAIL]:"Request for DRM certificate failed",[LangTextKey.PRIVATE_DRM_KEY_GET_FAILED]:"Private DRM get key failed",[LangTextKey.PRIVATE_DRM_CRYPTO_NOT_SUPPORT]:"Web cryptography API is not supported, please visit page by https",[LangTextKey.PRIVATE_DRM_RSA_FAIL]:"Decryption by RSA-OAEP failed, please check playAuthId",[LangTextKey.OTHER]:"Other error",[LangTextKey.VOD_LOG_NOT_CONFIGURED]:"Log options not configured correctly",[LangTextKey.PLAY_AUTH_TOKEN_EXPIRED]:"playAuthToken has expired",[LangTextKey.HLS_KEY_TOKEN_EXPIRED]:"keyToken has expired",[LangTextKey.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED]:"thirdPartyDrmAuthToken has expired",[LangTextKey.GET_PLAY_INFO_ERR]:"Failed to get media information",[LangTextKey.GET_HLS_DECRYPTION_KEY_ERR]:"Failed to get HLS key",[LangTextKey.LICENSE_VALIDATE_FAIL]:"License validation failed",[LangTextKey.DEFINITION_AUTO]:"Auto",[LangTextKey.LICENSE_STATUS_INVALID]:"License validation is invalid",[LangTextKey.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH]:"license domain name does not match",[LangTextKey.BASE_LICENSE_NOT_SUPPORT_265]:"The basic license does not support H265",[LangTextKey.BASE_LICENSE_NOT_SUPPORT_ABR]:"The basic license does not support ABR",[LangTextKey.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"The basic license does not support dynamic buffer",[LangTextKey.BASE_LICENSE_NOT_SUPPORT_PRELOAD]:"The basic license does not support preload",[LangTextKey.EXPIRED_LICENSE_NOT_SUPPORT_265]:"Expired license does not support H265",[LangTextKey.EXPIRED_LICENSE_NOT_SUPPORT_ABR]:"Expired license does not support ABR",[LangTextKey.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"The expired license does not support dynamic buffer",[LangTextKey.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD]:"Expired license does not support preloading",[LangTextKey.DRAMA_INVALID_PARAM]:"Invalid parameter",[LangTextKey.DRAMA_NO_INFO_FOUND]:"No information found for this episode",[LangTextKey.DRAMA_NOT_SUBMITTED]:"Episode has not been submitted for review",[LangTextKey.DRAMA_UNDER_REVIEW]:"Episode is under review",[LangTextKey.DRAMA_FAILED_REVIEW]:"Episode failed review",[LangTextKey.DRAMA_WITHDRAWN_REVIEW]:"Episode review was withdrawn",[LangTextKey.DRAMA_FAILED_TO_QUERY]:"Failed to query video playback information",[LangTextKey.DRAMA_INVALID_TTOP_TOKEN]:"Invalid playback credential or TTOP signature verification failed",[LangTextKey.DRAMA_NOT_ON_SHELF]:"Video is not on shelf",[LangTextKey.DRAMA_FAILED_GET_EPISODE_INFO]:"Failed to get episode information"},ZH_TEXT={[LangTextKey.NETWORK]:"网络错误",[LangTextKey.NETWORK_TIMEOUT]:"网络超时",[LangTextKey.NETWORK_FORBIDDEN]:"视频地址禁止访问,请检查域名访问控制",[LangTextKey.NETWORK_NOTFOUND]:"视频不存在,请检查视频地址是否正确",[LangTextKey.NETWORK_RANGE_NOT_SATISFIABLE]:"请求 range 不正确,请稍后再试",[LangTextKey.NETWORK_PROTOCOL]:"请求协议错误,请使用 https 地址访问",[LangTextKey.NETWORK_URL_EXPIRE]:"视频地址已过期",[LangTextKey.NETWORK_URL_SIGN]:"视频地址签名错误,请检查地址是否正确",[LangTextKey.NETWORK_ENCRYPT_HLS_ERR]:"m3u8 文件或密钥获取失败",[LangTextKey.MEDIA_ERR]:"播放错误",[LangTextKey.MEDIA_ERR_ABORTED]:"播放被用户或浏览器取消",[LangTextKey.MEDIA_ERR_NETWORK]:"网络错误",[LangTextKey.MEDIA_ERR_DECODE]:"解码错误",[LangTextKey.MEDIA_ERR_SRC_NOT_SUPPORTED]:"音/视频格式不支持或地址不可用",[LangTextKey.MEDIA_ERR_NOT_SUPPORTED]:"不支持的视频格式",[LangTextKey.MEDIA_ERR_URL_EMPTY]:"视频地址为空",[LangTextKey.MEDIA_ERR_FILE_NOT_SUPPORTED]:"视频文件当前浏览器环境下不支持",[LangTextKey.MEDIA_ERR_PLAY_ERR]:"视频播放错误",[LangTextKey.MEDIA_SOURCE_CANNOT_PLAY_TYPE]:"不支持的视频类型",[LangTextKey.BUSINESS_DRM_NOT_SUPPORT]:"DRM加密播放不支持",[LangTextKey.BUSINESS_DRM_NOT_SUPPORT_UN_RECORD]:"不支持防录屏",[LangTextKey.BUSINESS_DRM_LACK_MEDIA_KEY]:"视频数据缺少相应 MediaKey",[LangTextKey.BUSINESS_DRM_LACK_KEY_SESSION]:"浏览器不支持相应 DRM KeySession",[LangTextKey.BUSINESS_DRM_GENERATE_REQUEST_FAIL]:"解密播放错误",[LangTextKey.BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH]:"缺少 DRM 证书请求链接",[LangTextKey.BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH]:"缺少 DRM License 请求链接",[LangTextKey.BUSINESS_DRM_LICENSE_FAIL]:"请求或更新 License 失败",[LangTextKey.BUSINESS_DRM_KEY_ERROR]:"解密错误",[LangTextKey.BUSINESS_DRM_CERT_FAIL]:"请求DRM证书失败",[LangTextKey.PRIVATE_DRM_KEY_GET_FAILED]:"私有加密密钥解析失败",[LangTextKey.PRIVATE_DRM_CRYPTO_NOT_SUPPORT]:"当前浏览器不支持Crypto API,请使用https环境访问",[LangTextKey.PRIVATE_DRM_RSA_FAIL]:"解密错误,请检查playAuthId是否正确",[LangTextKey.OTHER]:"其他错误",[LangTextKey.VOD_LOG_NOT_CONFIGURED]:"未正确配置质量日志参数",[LangTextKey.PLAY_AUTH_TOKEN_EXPIRED]:"playAuthToken 已过期",[LangTextKey.HLS_KEY_TOKEN_EXPIRED]:"keyToken 已过期",[LangTextKey.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED]:"thirdPartyDrmAuthToken 已过期",[LangTextKey.GET_PLAY_INFO_ERR]:"获取媒体信息失败",[LangTextKey.GET_HLS_DECRYPTION_KEY_ERR]:"获取 HLS 密钥失败",[LangTextKey.LICENSE_VALIDATE_FAIL]:"license 校验失败",[LangTextKey.DEFINITION_AUTO]:"自动",[LangTextKey.LICENSE_STATUS_INVALID]:"license 校验无效",[LangTextKey.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH]:"license 域名不匹配",[LangTextKey.BASE_LICENSE_NOT_SUPPORT_265]:"基础版license 不支持H265",[LangTextKey.BASE_LICENSE_NOT_SUPPORT_ABR]:"基础版license 不支持自适应码率",[LangTextKey.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"基础版license 不支持动态Buffer",[LangTextKey.BASE_LICENSE_NOT_SUPPORT_PRELOAD]:"基础版license 不支持预加载",[LangTextKey.EXPIRED_LICENSE_NOT_SUPPORT_265]:"已过期版license 不支持H265",[LangTextKey.EXPIRED_LICENSE_NOT_SUPPORT_ABR]:"已过期版license 不支持自适应码率",[LangTextKey.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"已过期版license 不支持动态Buffer",[LangTextKey.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD]:"已过期版license 不支持预加载",[LangTextKey.DRAMA_INVALID_PARAM]:"参数错误",[LangTextKey.DRAMA_NO_INFO_FOUND]:"未查询到该剧集信息",[LangTextKey.DRAMA_NOT_SUBMITTED]:"剧集未送审",[LangTextKey.DRAMA_UNDER_REVIEW]:"剧集审核中",[LangTextKey.DRAMA_FAILED_REVIEW]:"剧集审核不通过",[LangTextKey.DRAMA_WITHDRAWN_REVIEW]:"剧集审核撤回",[LangTextKey.DRAMA_FAILED_TO_QUERY]:"查询视频播放信息失败",[LangTextKey.DRAMA_INVALID_TTOP_TOKEN]:"播放凭证无效或TTOP签名验证失败",[LangTextKey.DRAMA_NOT_ON_SHELF]:"视频未上架",[LangTextKey.DRAMA_FAILED_GET_EPISODE_INFO]:"查询剧集信息失败"},JP_TEXT={[LangTextKey.NETWORK]:"ネットワークエラー",[LangTextKey.NETWORK_TIMEOUT]:"ネットワークタイムアウト",[LangTextKey.NETWORK_FORBIDDEN]:"動画のURLへのアクセスが禁止されています。ドメインアクセス制御を確認してください",[LangTextKey.NETWORK_NOTFOUND]:"動画が存在しません。動画アドレスが正しいか確認してください",[LangTextKey.NETWORK_RANGE_NOT_SATISFIABLE]:"リクエスト範囲が正しくありません。後でもう一度お試しください",[LangTextKey.NETWORK_PROTOCOL]:"リクエストプロトコルエラー。httpsアドレスを使用してアクセスしてください",[LangTextKey.NETWORK_URL_EXPIRE]:"動画のURLは期限切れです",[LangTextKey.NETWORK_URL_SIGN]:"動画のURL署名エラー。アドレスが正しいか確認してください",[LangTextKey.NETWORK_ENCRYPT_HLS_ERR]:"m3u8 ファイルまたはキーの取得に失敗しました",[LangTextKey.MEDIA_ERR]:"再生エラー",[LangTextKey.MEDIA_ERR_ABORTED]:"再生がユーザーまたはブラウザによってキャンセルされました",[LangTextKey.MEDIA_ERR_NETWORK]:"ネットワークエラー",[LangTextKey.MEDIA_ERR_DECODE]:"デコードエラー",[LangTextKey.MEDIA_ERR_SRC_NOT_SUPPORTED]:"音声/動画フォーマットがサポートされていないか、アドレスが利用できません",[LangTextKey.MEDIA_ERR_NOT_SUPPORTED]:"サポートされていない動画フォーマット",[LangTextKey.MEDIA_ERR_URL_EMPTY]:"動画のURLが空です",[LangTextKey.MEDIA_ERR_FILE_NOT_SUPPORTED]:"動画ファイルは現在のブラウザ環境でサポートされていません",[LangTextKey.MEDIA_ERR_PLAY_ERR]:"動画再生エラー",[LangTextKey.MEDIA_SOURCE_CANNOT_PLAY_TYPE]:"サポートされていない動画の種類",[LangTextKey.BUSINESS_DRM_NOT_SUPPORT]:"DRM暗号化再生はサポートされていません",[LangTextKey.BUSINESS_DRM_NOT_SUPPORT_UN_RECORD]:"録画防止はサポートされていません",[LangTextKey.BUSINESS_DRM_LACK_MEDIA_KEY]:"動画データに対応するMediaKeyが不足しています",[LangTextKey.BUSINESS_DRM_LACK_KEY_SESSION]:"ブラウザが対応するDRM KeySessionをサポートしていません",[LangTextKey.BUSINESS_DRM_GENERATE_REQUEST_FAIL]:"復号再生エラー",[LangTextKey.BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH]:"DRM証明書リクエストリンクが不足しています",[LangTextKey.BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH]:"DRMライセンスリクエストリンクが不足しています",[LangTextKey.BUSINESS_DRM_LICENSE_FAIL]:"ライセンスのリクエストまたは更新に失敗しました",[LangTextKey.BUSINESS_DRM_KEY_ERROR]:"復号エラー",[LangTextKey.BUSINESS_DRM_CERT_FAIL]:"DRM証明書のリクエストに失敗しました",[LangTextKey.PRIVATE_DRM_KEY_GET_FAILED]:"プライベートDRMキーの取得に失敗しました",[LangTextKey.PRIVATE_DRM_CRYPTO_NOT_SUPPORT]:"現在のブラウザはCrypto APIをサポートしていません。アクセスするにはhttps環境を使用してください",[LangTextKey.PRIVATE_DRM_RSA_FAIL]:"復号化エラー。playAuthIdが正しいかどうかを確認してください",[LangTextKey.OTHER]:"その他のエラー",[LangTextKey.VOD_LOG_NOT_CONFIGURED]:"品質ログパラメータが正しく設定されていません",[LangTextKey.PLAY_AUTH_TOKEN_EXPIRED]:"playAuthTokenが期限切れです",[LangTextKey.HLS_KEY_TOKEN_EXPIRED]:"keyTokenが期限切れです",[LangTextKey.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED]:"thirdPartyDrmAuthTokenが期限切れです",[LangTextKey.GET_PLAY_INFO_ERR]:"動画情報の取得に失敗しました",[LangTextKey.GET_HLS_DECRYPTION_KEY_ERR]:"HLSキーの取得に失敗しました",[LangTextKey.LICENSE_VALIDATE_FAIL]:"ライセンスの検証に失敗しました",[LangTextKey.DEFINITION_AUTO]:"自動",[LangTextKey.LICENSE_STATUS_INVALID]:"ライセンス検証が無効です",[LangTextKey.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH]:"ライセンスドメイン名が一致しません",[LangTextKey.BASE_LICENSE_NOT_SUPPORT_265]:"基本ライセンスはH265をサポートしていません",[LangTextKey.BASE_LICENSE_NOT_SUPPORT_ABR]:"基本ライセンスはアダプティブビットレートをサポートしていません",[LangTextKey.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"基本ライセンスはダイナミックバッファをサポートしていません",[LangTextKey.BASE_LICENSE_NOT_SUPPORT_PRELOAD]:"基本ライセンスはプリロードをサポートしていません",[LangTextKey.EXPIRED_LICENSE_NOT_SUPPORT_265]:"期限切れのライセンスはH265をサポートしていません",[LangTextKey.EXPIRED_LICENSE_NOT_SUPPORT_ABR]:"期限切れのライセンスはアダプティブ ビットレートをサポートしていません",[LangTextKey.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"期限切れのライセンスは動的バッファをサポートしていません",[LangTextKey.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD]:"期限切れのライセンスはプリロードをサポートしていません",[LangTextKey.DRAMA_INVALID_PARAM]:"パラメータが無効です",[LangTextKey.DRAMA_NO_INFO_FOUND]:"このエピソードの情報が見つかりません",[LangTextKey.DRAMA_NOT_SUBMITTED]:"エピソードは審査に提出されていません",[LangTextKey.DRAMA_UNDER_REVIEW]:"エピソードは審査中です",[LangTextKey.DRAMA_FAILED_REVIEW]:"エピソードは審査に不合格でした",[LangTextKey.DRAMA_WITHDRAWN_REVIEW]:"エピソードの審査が取り下げられました",[LangTextKey.DRAMA_FAILED_TO_QUERY]:"動画再生情報の取得に失敗しました",[LangTextKey.DRAMA_INVALID_TTOP_TOKEN]:"再生資格情報が無効か、TTOP署名の検証に失敗しました",[LangTextKey.DRAMA_NOT_ON_SHELF]:"動画は未公開です",[LangTextKey.DRAMA_FAILED_GET_EPISODE_INFO]:"エピソード情報の取得に失敗しました"},Zh_HK_TEXT={[LangTextKey.NETWORK]:"網路錯誤",[LangTextKey.NETWORK_TIMEOUT]:"網路逾時",[LangTextKey.NETWORK_FORBIDDEN]:"視頻地址禁止訪問,請檢查域名訪問控制",[LangTextKey.NETWORK_NOTFOUND]:"視頻不存在,請檢查視訊地址是否正確",[LangTextKey.NETWORK_RANGE_NOT_SATISFIABLE]:"請求範圍不正確,請稍後再試",[LangTextKey.NETWORK_PROTOCOL]:"請求協議錯誤,請使用 https 地址訪問",[LangTextKey.NETWORK_URL_EXPIRE]:"視頻地址已過期",[LangTextKey.NETWORK_URL_SIGN]:"視頻地址簽名錯誤,請檢查地址是否正確",[LangTextKey.NETWORK_ENCRYPT_HLS_ERR]:"m3u8 檔案或金鑰取得失敗",[LangTextKey.MEDIA_ERR]:"播放錯誤",[LangTextKey.MEDIA_ERR_ABORTED]:"播放被用戶或瀏覽器取消",[LangTextKey.MEDIA_ERR_NETWORK]:"網路錯誤",[LangTextKey.MEDIA_ERR_DECODE]:"解碼錯誤",[LangTextKey.MEDIA_ERR_SRC_NOT_SUPPORTED]:"音/視頻格式不支援或地址不可用",[LangTextKey.MEDIA_ERR_NOT_SUPPORTED]:"不支援的視頻格式",[LangTextKey.MEDIA_ERR_URL_EMPTY]:"視頻地址為空",[LangTextKey.MEDIA_ERR_FILE_NOT_SUPPORTED]:"視頻文件在當前瀏覽器環境下不支援",[LangTextKey.MEDIA_ERR_PLAY_ERR]:"視頻播放錯誤",[LangTextKey.MEDIA_SOURCE_CANNOT_PLAY_TYPE]:"不支援的視頻類型",[LangTextKey.BUSINESS_DRM_NOT_SUPPORT]:"不支援 DRM 加密播放",[LangTextKey.BUSINESS_DRM_NOT_SUPPORT_UN_RECORD]:"不支援防錄屏",[LangTextKey.BUSINESS_DRM_LACK_MEDIA_KEY]:"視頻數據缺少相應 MediaKey",[LangTextKey.BUSINESS_DRM_LACK_KEY_SESSION]:"瀏覽器不支援相應 DRM KeySession",[LangTextKey.BUSINESS_DRM_GENERATE_REQUEST_FAIL]:"解密播放錯誤",[LangTextKey.BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH]:"缺少 DRM 證書請求鏈接",[LangTextKey.BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH]:"缺少 DRM License 請求鏈接",[LangTextKey.BUSINESS_DRM_LICENSE_FAIL]:"請求或更新 License 失敗",[LangTextKey.BUSINESS_DRM_KEY_ERROR]:"解密錯誤",[LangTextKey.BUSINESS_DRM_CERT_FAIL]:"請求 DRM 證書失敗",[LangTextKey.PRIVATE_DRM_KEY_GET_FAILED]:"私有加密金鑰解析失敗",[LangTextKey.PRIVATE_DRM_CRYPTO_NOT_SUPPORT]:"目前瀏覽器不支援Crypto API,請使用https環境訪問",[LangTextKey.PRIVATE_DRM_RSA_FAIL]:"解密錯誤,請檢查playAuthId是否正確",[LangTextKey.OTHER]:"其他錯誤",[LangTextKey.VOD_LOG_NOT_CONFIGURED]:"未正確配置質量日誌參數",[LangTextKey.PLAY_AUTH_TOKEN_EXPIRED]:"playAuthToken 已過期",[LangTextKey.HLS_KEY_TOKEN_EXPIRED]:"keyToken 已過期",[LangTextKey.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED]:"thirdPartyDrmAuthToken 已過期",[LangTextKey.GET_PLAY_INFO_ERR]:"獲取視頻信息失敗",[LangTextKey.GET_HLS_DECRYPTION_KEY_ERR]:"獲取 HLS 密鑰失敗",[LangTextKey.LICENSE_VALIDATE_FAIL]:"license 校驗失敗",[LangTextKey.DEFINITION_AUTO]:"自動",[LangTextKey.LICENSE_STATUS_INVALID]:"license 校驗無效",[LangTextKey.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH]:"license 域名不匹配",[LangTextKey.BASE_LICENSE_NOT_SUPPORT_265]:"基礎版license 不支援H265",[LangTextKey.BASE_LICENSE_NOT_SUPPORT_ABR]:"基礎版license 不支援自適應碼率",[LangTextKey.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"基礎版license 不支援動態Buffer",[LangTextKey.BASE_LICENSE_NOT_SUPPORT_PRELOAD]:"基礎版license 不支援預載入",[LangTextKey.EXPIRED_LICENSE_NOT_SUPPORT_265]:"已過期版license 不支援H265",[LangTextKey.EXPIRED_LICENSE_NOT_SUPPORT_ABR]:"已過期版license 不支援自適應碼率",[LangTextKey.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"已過期版license 不支援動態Buffer",[LangTextKey.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD]:"已過期版license 不支援預載入",[LangTextKey.DRAMA_INVALID_PARAM]:"參數錯誤",[LangTextKey.DRAMA_NO_INFO_FOUND]:"未查詢到該劇集資訊",[LangTextKey.DRAMA_NOT_SUBMITTED]:"劇集未送審",[LangTextKey.DRAMA_UNDER_REVIEW]:"劇集審核中",[LangTextKey.DRAMA_FAILED_REVIEW]:"劇集審核不通過",[LangTextKey.DRAMA_WITHDRAWN_REVIEW]:"劇集審核撤回",[LangTextKey.DRAMA_FAILED_TO_QUERY]:"查詢視頻播放資訊失敗",[LangTextKey.DRAMA_INVALID_TTOP_TOKEN]:"播放憑證無效或TTOP簽名驗證失敗",[LangTextKey.DRAMA_NOT_ON_SHELF]:"影片未上架",[LangTextKey.DRAMA_FAILED_GET_EPISODE_INFO]:"查詢劇集資訊失敗"},extendLang=[{LANG:"en",TEXT:EN_TEXT},{LANG:"zh",TEXT:ZH_TEXT},{LANG:"zh-hk",TEXT:Zh_HK_TEXT},{LANG:"jp",TEXT:JP_TEXT}];class LiteRtmPlugin{}LiteRtmPlugin.isSupported=()=>!1,LiteRtmPlugin.isSupportedH264=e=>!1;const PRELOAD_RECOMMENDATION_IGNORE_SERVICE_ENABLE_KEY="ignoreServicePreloadConfigEnable";function enablePreloadRecommendationWithoutServiceConfig(e){var t,i;const r=null==(t=null==e?void 0:e.strategies)?void 0:t.preload,n="boolean"==typeof r;if(!r||!n&&(null==r?void 0:r.disabled))return e;const o=n?{}:r;return __spreadProps(__spreadValues({},e),{strategies:__spreadProps(__spreadValues({},e.strategies),{preload:__spreadProps(__spreadValues({},o),{ignoreServicePreloadConfigEnable:!0,config:__spreadProps(__spreadValues({},null!=(i=null==o?void 0:o.config)?i:{}),{ignoreServicePreloadConfigEnable:!0})})})})}const index_min="",FEATURE_PRIORITY=["live","rtm","music","danmu","ad"],CONFIG_CONTAINER_KEYS=["configs","options","defaultConfig","current"],MEDIA_SOURCE_KEYS=["url","src","playUrl","playURL"],PLUGIN_COLLECTION_KEYS=["plugins","sdkPlugins","strategiesPlugins","presets"];function getLiteFullPackageName(e){const t=(e||"").toUpperCase();return t.includes("BYTEPLUS")?"@byteplus/veplayer":t.includes("VOLCENGINE")?"@volcengine/veplayer":"@byted-vcloud/veplayer"}class VePlayerLiteUnsupportedFeatureError extends Error{constructor(e){super(`[VEPLAYER_LITE_UNSUPPORTED_FEATURE] ${e} 功能不受精简版支持,请改用 ${getLiteFullPackageName("BYTEPLUS")}。`),this.code="VEPLAYER_LITE_UNSUPPORTED_FEATURE",this.name="VePlayerLiteUnsupportedFeatureError",this.feature=e,Object.setPrototypeOf(this,VePlayerLiteUnsupportedFeatureError.prototype)}}class VePlayerLiteUnsupportedEnvironmentError extends Error{constructor(){super("[VEPLAYER_LITE_UNSUPPORTED_ENVIRONMENT] 当前环境不支持 Lite 版本使用"),this.code="VEPLAYER_LITE_UNSUPPORTED_ENVIRONMENT",this.name="VePlayerLiteUnsupportedEnvironmentError",Object.setPrototypeOf(this,VePlayerLiteUnsupportedEnvironmentError.prototype)}}function assertLiteEnvironmentSupported(e){if(!e)throw new VePlayerLiteUnsupportedEnvironmentError}function isObjectLike(e){return"object"==typeof e&&null!==e||"function"==typeof e}function safeRead(e,t){if(isObjectLike(e))try{return e[t]}catch(e){return}}function isArray2(e){try{return Array.isArray(e)}catch(e){return!1}}function getArrayItems(e){if(!isArray2(e))return[];const t=safeRead(e,"length");if("number"!=typeof t||t<0||t>4294967295||Math.floor(t)!==t)return[];const i=[];for(let r=0;r<t;r+=1)i.push(safeRead(e,String(r)));return i}function isEnabled(e){return null!=e&&!1!==e}function getLowerString(e){return"string"==typeof e?e.toLowerCase():""}function collectConfigContainers(e){const t=[],i=[e],r=new WeakSet;for(let e=0;e<i.length;e+=1){const n=i[e];if(isObjectLike(n)&&!r.has(n)){r.add(n),t.push(n);for(const e of CONFIG_CONTAINER_KEYS)i.push(safeRead(n,e));for(const e of getArrayItems(safeRead(n,"playList")))i.push(e)}}return t}function isSdpString(e){return"string"==typeof e&&e.split(/[?#]/,1)[0].toLowerCase().endsWith(".sdp")}function isSdpMediaSource(e){const t=[e],i=new WeakSet;for(let e=0;e<t.length;e+=1){const r=t[e];if(isSdpString(r))return!0;if(isObjectLike(r)&&!i.has(r))if(i.add(r),isArray2(r))for(const e of getArrayItems(r))t.push(e);else for(const e of MEDIA_SOURCE_KEYS)t.push(safeRead(r,e))}return!1}function hasSdpMediaSource(e){return MEDIA_SOURCE_KEYS.some((t=>isSdpMediaSource(safeRead(e,t))))}function normalizePluginName(e){const t=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().replace(/[\s_]+/g,"-").replace(/-+/g,"-");return{compact:t.replace(/-/g,""),parts:t.split("-")}}function collectPluginNames(e){if("string"==typeof e)return[e];if(!isObjectLike(e))return[];const t=[],i=safeRead(e,"pluginName"),r=safeRead(e,"name");return"string"==typeof i&&t.push(i),"string"==typeof r&&t.push(r),t}function getPluginItemNames(e){const t=collectPluginNames(e);return t.push(...collectPluginNames(safeRead(e,"plugin"))),t.push(...collectPluginNames(safeRead(e,"preset"))),t}function pluginNameMatches(e,t){const{compact:i,parts:r}=normalizePluginName(t);switch(e){case"live":return"timeshiftplugin"===i||"liveinfopanel"===i||i.startsWith("livesubtitles");case"rtm":return"rtm"===i||"rtmplugin"===i;case"music":return i.includes("music");case"danmu":return i.includes("danmu");case"ad":return r.some((e=>"ad"===e||"ads"===e))||["ad","ads","adplugin","adsplugin"].includes(i)}}function hasPluginFeature(e,t){return PLUGIN_COLLECTION_KEYS.some((i=>getArrayItems(safeRead(e,i)).some((e=>getPluginItemNames(e).some((e=>pluginNameMatches(t,e)))))))}function hasConfigFeature(e,t){switch(t){case"live":return!0===safeRead(e,"isLive")||"live"===getLowerString(safeRead(e,"type"))||isEnabled(safeRead(e,"TimeShiftPlugin"))||isEnabled(safeRead(e,"LiveInfoPanel"))||isEnabled(safeRead(e,"LiveSubtitlesPlugin"))||isEnabled(safeRead(e,"LiveSubtitlesIconPlugin"));case"rtm":return"rtm"===getLowerString(safeRead(e,"streamType"))||isEnabled(safeRead(e,"rtm"))||hasSdpMediaSource(e);case"music":return!0===safeRead(e,"isMusic")||isEnabled(safeRead(e,"music"));case"danmu":{const t=safeRead(e,"getVideoByToken");return isEnabled(safeRead(e,"DanmuPlugin"))||!0===safeRead(e,"needBarrageMask")||!0===safeRead(t,"needBarrageMask")}case"ad":return isEnabled(safeRead(e,"AdsPlugin"))||isEnabled(safeRead(e,"AdPlugin"))}}function assertLiteConfigSupported(e){const t=collectConfigContainers(e);for(const e of FEATURE_PRIORITY)if(t.some((t=>hasConfigFeature(t,e)||hasPluginFeature(t,e))))throw new VePlayerLiteUnsupportedFeatureError(e)}function assertLitePlayerDataSupported(e){assertLiteConfigSupported(e)}window.Player||(window.Player=Player);const _VePlayer=class{constructor(e){this.player=null,this.mountingDom=null,this.playerContainer=null,this.mobilePanel=null,this._lastSelectedAudioTrack=null,this._suppressAudioTrackMemory=!1,this._suppressAudioTrackMemoryTimer=null,this._playNextPending=!1,this._isCollectingCreatePlayerPerf=!1,this._getDramaInfoPerfRecords=[],this._isFirstCreated=!0,this.sdkPlugins=[],this._sdkPlugins={},this.delayError=[],this._isVolcengine=!1,this._originConfigs={},this.delayEvents=[],this.createPlayer=()=>__async(this,null,(function*(){var e,t,i,r,n,o,a;this._createPlayerPerf=new CreatePlayerPerfCollector,this._isCollectingCreatePlayerPerf=!0;const s=this._createPlayerPerf;yield s.measureAsync("destroyPlayer",(()=>__async(this,null,(function*(){yield this._destroyPlayer()})))),yield this.beforePlayerCreate(),assertLitePlayerDataSupported(this.playerData);const{options:l,plugins:c,isMobile:u,openSoftDecoding:d,configs:h,strategiesPlugins:p,strategiesPluginConfigs:f}=this.playerData,g=!1,y=this.playerData.isOpenABR()?void 0:this.playerData.getCurrentUrl(),_=this.playerData.getCurrentStreamType()||getFormat(null==h?void 0:h.getVideoByToken);getPluginConfig(h,"EncryptHlsPlugin")||y&&_||this.playerData.isOpenABR()||(VE_DEBUG.warn(`url is empty or streamType is empty (url:${y}, streamType: ${_})`),this.renderPoster());const m=()=>__async(this,null,(function*(){const e=getDetectUrl(y);return yield this.getSoftDecodingOption(d,e,_)})),v=yield s.measureAsync("createSDKPreset",(()=>__async(this,null,(function*(){return yield createSDKPreset({isLive:g,isMobile:u,streamType:_,playerData:this.playerData,getSoftOptionTask:m},this)})))),{presets:E,softDecodingOption:T,plugins:S}=v,P=u?createPlayerOption(g):createPlayerOption$1(g),{basicPlugins:C=[],iconPlugins:b=[]}=this._analyzeExtendPlugins(),I=T||{},{plugins:A=[]}=I,O=__objRest(I,["plugins"]),D=this.getDefinitionConfig(),R=util.deepMerge(P,l),$=__spreadProps(__spreadValues(__spreadProps(__spreadValues(__spreadValues(__spreadValues({},{errorKey:"ve_error"}),R),O||{}),{definition:D,icons:__spreadValues(__spreadValues(__spreadValues({},P.icons),{}),null!=(e=null==l?void 0:l.icons)?e:{}),MoreButtonPlugin:{iconPlugins:[...null!=(i=null==(t=l.MoreButtonPlugin)?void 0:t.iconPlugins)?i:[],...b,PlaybackRateMobilePlugin,DefinitionMobilePlugin,AudioTrackMobilePlugin]}}),f),{playerData:this.playerData});this.playerData.getLineList().length>1&&$.MoreButtonPlugin.iconPlugins.push(LineMobilePlugin),this.setDefaultConfigOptions($);const L=uniqPlugins([...C,...c,...S,...A,...p]),k=(null!=(r=null==$?void 0:$.ignores)?r:[]).some((e=>"sdkunmuteplugin"===(e+"").toLowerCase()));$.ignores=[...null!=(n=null==$?void 0:$.ignores)?n:[],...k?["AutoplayPlugin"]:[]],this._isFirstCreated?this._isFirstCreated=!1:($.autoplayMuted=!1,$.ignores=[...null!=(o=null==$?void 0:$.ignores)?o:[],"sdkUnmutePlugin"]),this.setPluginConfig($);const x={},N=null==(a=_VePlayer.ttDramaEnv)?void 0:a.videoSecurityModule;if(null==N?void 0:N.generateSignature){const e=yield s.measureAsync("videoSecuritySignature",(()=>__async(this,null,(function*(){return yield N.generateSignature()}))));e&&(console.log("data-tt-sign: ",e),x["data-tt-sign"]=e)}this._emitter.emit(SDKEvents.READY_CREATE_PLAYER);let w={};if(_VePlayer.shouldCheckLicense()){const e=yield _VePlayer.checkLicenseStatus();e!==LicenseStatus.LICENSE_STATUS_OK&&e!==LicenseStatus.LICENSE_STATUS_EXPIRED&&(w={progress:{closeMoveSeek:!0,isCloseClickSeek:!0},sdkErrorPlugin:{isNeedRefreshButton:!1}})}s.measure("instantiatePlayer",(()=>{var e;this.player=new Player(__spreadProps(__spreadValues(__spreadValues({el:this.playerContainer,presets:E,url:y,isLive:!1},$),w),{videoAttributes:__spreadValues(__spreadValues({},null!=(e=$.videoAttributes)?e:{}),x),plugins:[...L]}))})),this.player.playerData=this.playerData,this.player.sdk=this;const M=s.finish();return this._isCollectingCreatePlayerPerf=!1,this._lastCreatePlayerPerfReport=M,this.emit(SDKEvents.CREATE_PLAYER_PERF,M),VE_DEBUG.log("createPlayer perf: ",M),this._emitter.emit(SDKEvents.PLAYER_CREATED_FINISH),this.afterPlayerCreate(),this.player})),this._onMp4PreloadInfo=e=>{this.emit(PluginEvents.PRELOAD_INFO,e)},this._proxyError=e=>this.emit(Events$1.ERROR,e),this._onError=e=>{var t;const{errorCode:i,httpCode:r,mediaError:n}=e||{};if(util.isMSE(null==(t=this.player)?void 0:t.media))r+""!="403"&&i+""!="9203"||this._emitExpireEvent("error",e);else if(4===(null==n?void 0:n.code)||2===(null==n?void 0:n.code)){const t=getDetectUrl(this.playerData.getCurrentUrl());t&&getXhr$1(t,{range:"0-8",timeout:2e3}).then((t=>{VE_DEBUG.log("xhr result",t);const{status:i,response:r}=t;403===i&&"string"==typeof r&&r.includes("expire")&&this._emitExpireEvent("error",e)})).catch((e=>{VE_DEBUG.log("xhr error",e)}))}},this._onNativeAddTrack=()=>{var e,t;if(this._getHlsInstance())return;this._playNextPending=!1;const i=null==(t=null==(e=this.player)?void 0:e.media)?void 0:t.audioTracks;if(!i)return;const r=[];for(let e=0;e<i.length;e++){const t=i[e];r.push({id:t.id,name:t.label||t.language||t.id,lang:t.language,default:t.enabled,selected:t.enabled})}this._applyAudioPreferenceNative(i),this._emitter.emit(SDKEvents.AUDIO_TRACKS_UPDATED,{audioTracks:r})},this._onNativeTrackChange=()=>{var e,t;if(this._getHlsInstance())return;const i=null==(t=null==(e=this.player)?void 0:e.media)?void 0:t.audioTracks;if(i)for(let e=0;e<i.length;e++){const t=i[e];if(t.enabled){const i={id:e,name:t.label||t.language||String(e),lang:t.language,default:t.enabled,selected:!0};this._playNextPending||(this._lastSelectedAudioTrack=i),this._emitter.emit(SDKEvents.AUDIO_TRACK_CHANGE,{id:e,audioTrack:i});break}}},assertLiteEnvironmentSupported(Boolean(_VePlayer.ttDramaEnv)),this.assertLiteConfig(e),this._init(e)}static registerModules(e){UMDLoader.registerModules(e)}static setAppendVideoUrlTimestamp(e=!0){setAppendVideoUrlTimestamp(e)}static getAppendVideoUrlTimestamp(){return getAppendVideoUrlTimestamp()}static setTTDramaEnv(e){var t;VE_DEBUG.log("TTDramaEnv: ",e);_VePlayer.ttDramaEnv=__spreadProps(__spreadValues({},e),{channel:null!=(t=e.channel)?t:"byteplus"})}static setMediaInfoCacheConfig(e){setMediaInfoCacheConfig(e)}static getMediaInfoCacheConfig(){return getMediaInfoCacheConfig()}static clearMediaInfoCache(){clearMediaInfoCache()}static setDebug(e){setDebug(e)}static setCollector(e){collector=e}static shouldCheckLicense(){return!1}static prepare(e){return __async(this,null,(function*(){!(null==e?void 0:e.appId)&&_VePlayer.ttDramaEnv&&(e=__spreadProps(__spreadValues({},e),{appId:1002305}));const t=enablePreloadRecommendationWithoutServiceConfig(e);if(_VePlayer.shouldCheckLicense())try{_VePlayer.hasInitVeStrategy=!0;const e=yield _VePlayer.checkLicenseStatus(),t=yield _VePlayer.checkLicense();if(e===LicenseStatus.LICENSE_STATUS_INVALID)throw new Error("LICENSE_STATUS_INVALID");if(t===LicenseEdition.EDITION_STANDARD)throw new Error("ERROR_LICENSE_EDITION_NEED_UPLOAD")}catch(e){return void VE_DEBUG.error(e.message)}else _VePlayer.hasInitVeStrategy=!0;yield VeStrategy.init(t)}))}static setPreloadScene(e,t){return VeStrategy.setPreloadScene(e,t)}static get preloader(){return VeStrategy.preloader}static get preloaderStatus(){return VeStrategy.preloaderStatus}static addPreloadList(e){return resolveTTDramaPreloadList(e,_VePlayer.ttDramaEnv).then((e=>((null==e?void 0:e.length)||VE_DEBUG.warn("[addPreloadList] resolved preloadList is empty"),VeStrategy.addPreloadList(e))))}static setPreloadList(e){return resolveTTDramaPreloadList(e,_VePlayer.ttDramaEnv).then((e=>((null==e?void 0:e.length)||VE_DEBUG.warn("[setPreloadList] resolved preloadList is empty"),VE_DEBUG.log("[setPreloadList] resolved preloadList:",JSON.stringify(e)),VeStrategy.setPreloadList(e))))}static setLicenseConfig(e){return LicenseManager.setLicenseConfig(e)}static checkLicense(){return LicenseManager.checkLicense()}static checkModuleList(){return LicenseManager.checkModuleList()}static checkLicenseStatus(){return LicenseManager.checkLicenseStatus()}static checkLicenseModuleAuth(e,t){return LicenseManager.checkLicenseModuleAuth(e,t)}static generateEncryptInfo(e,t){return __async(this,null,(function*(){try{const i={hls:UmdKeys.HLSEncrypt,mp4:UmdKeys.MP4Encrypt,dash:UmdKeys.DASH};if(!t||!i[t])return void VE_DEBUG.warn("param of streamType is invalid");const r=(new Date).getTime().toString(),n="mp4"===t?yield mediaDependencies.loadMp4Encrypt(defaultUmdLoader):yield defaultUmdLoader.loadPlugins(i[t]);return null==n?void 0:n.generateEncryptInfo(e,r)}catch(e){VE_DEBUG.error("generate encrypt info error: ",e)}}))}assertLiteConfig(e){assertLiteConfigSupported(e)}_init(e){return __async(this,null,(function*(){var t;if(_VePlayer.ttDramaEnv){!(!e.url&&!e.playList)&&this.delayError.push(this._buildDramaInvalidParamError())}this._emitter=new EventEmitter,this.renderDom({id:null==e?void 0:e.id,root:null==e?void 0:e.root});const i=_VePlayer.shouldCheckLicense()&&!(null==e?void 0:e.isLive)?yield _VePlayer.checkModuleList():Object.values(LicenseFeature);this.playerData=MyProxy$1.observe(new PlayerData(__spreadProps(__spreadValues({},e),{licensSupportModuleList:i}),this)),this.adapter=this.playerData.adapter,this.initUmdLoader(e),this.on(SDKEvents.TOKEN_EXPIRED,this.onTokenExpiredAction.bind(this)),this.checkVodLogOptions(),this._initSdkPlugins();this.createPlayer().catch((e=>{if("VEPLAYER_LITE_UNSUPPORTED_FEATURE"===(null==e?void 0:e.code))return VE_DEBUG.error("createPlayer error:",e),void this.emit(Events$1.ERROR,e);throw e})),this._initI18N(this.playerData.languageData),this._originConfigs={autoBitrateOpts:{enable:null==(t=null==e?void 0:e.autoBitrateOpts)?void 0:t.enable},useSoftDecoding:null==e?void 0:e.useSoftDecoding}}))}_initSdkPlugins(){sdkPluginManager$1.init(this);[...this.sdkPlugins].map((e=>sdkPluginManager$1.registerPlugin(e,this)))}_initCheckExpire(){this.checkExpireTimer&&(this.checkExpireTimer.clear(),this.checkExpireTimer=null);const{enableUrlExpireCheck:e,urlCheckExpireInterval:t}=this.playerData.urlCheckData;e&&(this.checkExpireTimer=new IntervalTimer$1,this.checkExpireTimer.repeat(this._onRepeat.bind(this),t)),this.on(PluginEvents.MEDIA_EXPIRED,this._onMediaExpiredAction.bind(this))}initUmdLoader(e){this.sdkUmdLoader=new UMDLoader,this.updateUmdLoader(this.sdkUmdLoader,e)}updateUmdLoader(e,t){const{umdUrlMap:i,region:r,userRegion:n,pluginPublicPath:o,plugins:a=[]}=t;e.failCallback=(e,t)=>this.umdLoadErr(e,t),i&&"object"==typeof i&&e.updateBackupMap(t.umdUrlMap),e.region=r,e.userRegion=n,o&&"string"==typeof o&&(e.customPluginPublicPath=o),e.importedPlugins=a}checkVodLogOptions(){var e;const{isLive:t,configs:i}=this.playerData,r=getPluginConfig(i,"vodLogOpts");if(!t&&!i.disableVodLogOptsCheck){if(null==(e=_VePlayer.ttDramaEnv)?void 0:e.clientKey)return;if(!(null==r?void 0:r.line_app_id)){const e={errorType:"log",errorCode:veErrorCodeMap.VOD_LOG_NOT_CONFIGURED.code,errorMessage:"vod log options not configured or configured correctly",ext:{},originError:void 0};this.delayError.push(e)}}}umdLoadErr(e,t){this.emit(SDKEvents.UMD_LOAD_FAIL,{name:e,error:t})}_onRepeat(){const{urlExpireTimestamp:e,urlExpireDiff:t=60}=this.playerData.urlCheckData;Math.round((new Date).getTime()/1e3)>=e-t&&(this.playerData.urlCheckData.urlExpireTimestamp=MAX_TIMESTAMP,this._emitExpireEvent("time"))}_emitExpireEvent(e="error",t){const i=Math.round((new Date).getTime()/1e3),r={errorCode:-499897,errorType:"network",errorMessage:"url expire",url:this.playerData.getCurrentUrl(),httpCode:403,version:"1.18.0-rc.6",ext:this,detectType:e,urlCheckData:this.playerData.urlCheckData,originError:t,from:"veplayer"};this.emitExpireTimestamp?i-this.emitExpireTimestamp>300&&(this.emitExpireTimestamp=i,VE_DEBUG.warn("media is expired, ",r),this.emit(Events$1.MEDIA_EXPIRED,r)):(this.emitExpireTimestamp=i,VE_DEBUG.warn("media is expired, ",r),this.emit(Events$1.MEDIA_EXPIRED,r))}on(e,t){this._emitter.on(e,t)}emit(e,t){this._emitter.emit(e,t)}once(e,t){this._emitter.once(e,t)}off(e,t){this._emitter.off(e,t)}renderDom({id:e,root:t}){const i=document.createElement("div");this.playerContainer=i;const r=t||document.querySelector(`#${e}`);r&&(r.appendChild(i),this.mountingDom=r)}renderPoster(){if(!this.playerContainer)return;const{poster:e="",width:t,height:i}=this.playerData.options;("string"==typeof e?e:null==e?void 0:e.poster)&&(this.playerContainer.style.cssText=`background: url("${e}");\n background-size: cover;\n width:${t?t+"px":"100%"};\n height:${i?i+"px":"100%"};\n `)}getDefinitionConfig(){var e;const{current:{lineId:t},isVidEncrypt:i,configs:r,options:n}=this.playerData,o="hls"===(this.playerData.getCurrentStreamType()||getFormat(null==r?void 0:r.getVideoByToken))&&i&&!!(null==(e=getPluginConfig(n,"EncryptHlsPlugin"))?void 0:e.keyToken);let a=this.playerData.getDefinitionListByLineId(t).map((e=>o?omit(e,["secretKey","playAuth"]):e)),s=this.playerData.current.definition;return this.playerData.isOpenABR()&&(s=this.playerData.defaultDefinition,a=(null==a?void 0:a.length)&&!this.adapter.needAbrAutoDefinition()?a.filter((e=>!this.playerData.isAutoDefinition(e.definition))):a),{defaultDefinition:s,list:a}}checkLicenseCallback(){return __async(this,null,(function*(){var e,t,i,r,n,o,a,s,l,c,u,d,h;const p=yield _VePlayer.checkLicense(),f=yield _VePlayer.checkLicenseStatus();if(this.player.licenseLogInfo={licenseStatus:f,licenseType:p},f===LicenseStatus.LICENSE_STATUS_EXPIRED)LicenseManager.renderLogo(this.playerContainer),!this.playerData.isOpenABR()&&(null==(t=null==(e=null==this?void 0:this._originConfigs)?void 0:e.autoBitrateOpts)?void 0:t.enable)&&this.emit(SDKEvents.LICENSE_STATUS_WARNING,veWarningCodeMap.EXPIRED_LICENSE_NOT_SUPPORT_ABR),(null==(r=null==(i=this.playerData.configs)?void 0:i.adaptRange)?void 0:r.enable)&&this.emit(SDKEvents.LICENSE_STATUS_WARNING,veWarningCodeMap.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER),!0===_VePlayer.hasInitVeStrategy&&this.emit(SDKEvents.LICENSE_STATUS_WARNING,veWarningCodeMap.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD);else if(f!==LicenseStatus.LICENSE_STATUS_OK){null==(n=this.player.plugins.controls)||n.destroy(),null==(o=this.player.plugins.play)||o.destroy(),null==(a=this.player.plugins.sdkdefinitionplugin)||a.hide(),null==(s=this.player.plugins.definitionmobileplugin)||s.destroy(),null==(l=this.player.media)||l.removeAttribute("src");const e=__spreadProps(__spreadValues({errorType:VE_ERROR_TYPE_MAP.license},f===LicenseStatus.LICENSE_STATUS_INVALID?{errorCode:veErrorCodeMap.LICENSE_STATUS_INVALID.code,errorMessage:veErrorCodeMap.LICENSE_STATUS_INVALID.message}:{errorCode:veErrorCodeMap.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH.code,errorMessage:veErrorCodeMap.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH.message}),{ext:{},originError:void 0});this.delayError.push(e)}else p===LicenseEdition.EDITION_STANDARD&&(!this.playerData.isOpenABR()&&(null==(u=null==(c=this._originConfigs)?void 0:c.autoBitrateOpts)?void 0:u.enable)&&this.emit(SDKEvents.LICENSE_STATUS_WARNING,veWarningCodeMap.BASE_LICENSE_NOT_SUPPORT_ABR),(null==(h=null==(d=this.playerData.configs)?void 0:d.adaptRange)?void 0:h.enable)&&this.emit(SDKEvents.LICENSE_STATUS_WARNING,veWarningCodeMap.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER),!0===_VePlayer.hasInitVeStrategy&&this.emit(SDKEvents.LICENSE_STATUS_WARNING,veWarningCodeMap.BASE_LICENSE_NOT_SUPPORT_PRELOAD))}))}setPluginConfig(e){var t,i,r,n,o;const{apiMap:a,configs:s,unionInfo:l,playList:c,useHlsPluginForSafari:u,isMobile:d}=this.playerData,h=this.playerData.getCurrentStreamType()||getFormat(null==s?void 0:s.getVideoByToken),p=getPluginConfig(s,"EncryptHlsPlugin"),f=getPluginConfig(e,"EncryptHlsPlugin"),g=getPluginConfig(s,"Mp4EncryptPlayer"),y=getPluginConfig(e,"Mp4EncryptPlayer"),_=getPluginConfig(s,"DASHPlugin"),m=getPluginConfig(e,"DASHPlugin"),v=getPluginConfig(s,"vodLogOpts"),E=(null==(t=_VePlayer.ttDramaEnv)?void 0:t.clientKey)?{appVersion:_VePlayer.ttDramaEnv.appVersion,clientKey:_VePlayer.ttDramaEnv.clientKey,line_app_id:1002305,line_user_id:getOrCreateDramaVodLineUserId(_VePlayer.ttDramaEnv.clientKey)}:{},T=!!(null==(i=null==c?void 0:c[0])?void 0:i.kid)||!!p;p&&(e.EncryptHlsPlugin=__spreadValues(__spreadValues(__spreadValues({playDomain:a.playDomain,getKeyType:"TOP",preferMMS:!0,preferMMSStreaming:!0},d||!isSafari||u?{}:{useHls:!1}),f||{}),p)),g&&(e.Mp4EncryptPlayer=__spreadValues(__spreadValues({playDomain:a.playDomain,preferMMS:!0,getKeyType:"TOP"},y||{}),g)),_&&(e.DASHPlugin=__spreadValues(__spreadValues({playDomain:a.playDomain,getKeyType:"TOP"},m||{}),_));const{vid:S}=s,{encryptSessionId:P,current:C,drmType:b}=this.playerData,{kid:I,secretKey:A}=C;if(b===EDRMTYPE.PRIVATE_ENCRYPT_UPGRADE&&P&&A&&("hls"===h?e.EncryptHlsPlugin=__spreadValues(__spreadValues({vid:S,kid:I,useUnionInfoDRM:!0,sessionId:P,drmType:EDRMTYPE.PRIVATE_ENCRYPT_UPGRADE,keyTokenExpiredDuration:9999999,secretKey:A,preferMMS:!0,preferMMSStreaming:!0},f||{}),p||{}):"dash"===h?e.DASHPlugin=__spreadValues(__spreadValues({playInfoType:"TOP",useEME:!0,keyTokenExpiredDuration:9999999,useUnionInfoDRM:!0,defaultFormat:"dash",replayReset:!1,disableBufferBreakCheck:!1,waitingTimeOut:5e3,vid:S,kid:I,drmType:EDRMTYPE.PRIVATE_ENCRYPT_UPGRADE,secretKey:A,sessionId:P},m||{}),_||{}):"mp4"===h&&(e.Mp4EncryptPlayer=__spreadValues(__spreadValues({vid:S,kid:I,isEncrypt:!0,rangeMaxDuration:10,keyTokenExpiredDuration:9999999,retryCount:3,useUnionInfoDRM:!0,sessionId:P,drmType:EDRMTYPE.PRIVATE_ENCRYPT_UPGRADE,secretKey:A,preferMMS:!0},y||{}),g||{}))),s.privateDrmAuthToken&&s.kid&&l&&("hls"===h?e.EncryptHlsPlugin=__spreadValues(__spreadValues({kid:s.kid,drmKeyToken:s.privateDrmAuthToken,playDomain:a.playDomain,preferMMS:!0,preferMMSStreaming:!0},f||{}),p||{}):"dash"===h?e.DASHPlugin=__spreadValues(__spreadValues({kid:s.kid,drmKeyToken:s.privateDrmAuthToken,playDomain:a.playDomain},m||{}),_||{}):"mp4"===h&&(e.Mp4EncryptPlayer=__spreadValues(__spreadValues({kid:s.kid,drmKeyToken:s.privateDrmAuthToken,playDomain:a.playDomain,preferMMS:!0},y||{}),g||{}))),v||E.clientKey){VE_DEBUG.log("codec",this.playerData.codec);const t=getCurUserRegionConfig(this.userRegion,this.region),i=null==t?void 0:t.__LOG_CUSTOM_REGION__,r=null==t?void 0:t.__LOG_CHANNEL_DOMAIN__;e.vodLogOpts=__spreadValues(__spreadValues(__spreadProps(__spreadValues(__spreadValues({vtype:(h||"mp4").toUpperCase(),codec_type:this.playerData.codec,drm_type:T?1:0,playerVersion:"1.18.0-rc.6",channel:null==t?void 0:t.__LOG_CHANNEL__,needXhrCheck:!0,enableTeaWebId:!0},i?{trackerConfig:{log_from_region:null==t?void 0:t.__LOG_CUSTOM_REGION__}}:{}),r?{channelDomain:r}:{}),{ext:this.vodLogCommon}),E),v||{})}null==(r=this.getSdkPlugin("Abr"))||r.applyAbrConfig(e),null==(n=this.getSdkPlugin("AdaptRange"))||n.applyRangeConfig(e),null==(o=this.getSdkPlugin("Strategy"))||o.applyFinalStrategy(e)}detectCodec(e){return __async(this,null,(function*(){var t;try{const{LoadProbe:i}=(yield this.sdkUmdLoader.loadPlugins(UmdKeys.StreamProbe))||{};if(i){const r=yield null==(t=new i)?void 0:t.parseUrl(e),{codec:n}=r||{};"bytevc1"===n?this.playerData.codec=CodecType.H265:"avc"===n&&(this.playerData.codec=CodecType.H264)}}catch(e){VE_DEBUG.warn("detect codec error: ",e)}}))}setDefaultConfigOptions(e){if(!this._isFirstCreated)return;const{defaultConfig:t,isHitDefault:i}=this.playerData;if(!t)return;const{volume:r,startTime:n,DanmuPlugin:o,LiveSubtitlesIconPlugin:a}=null!=t?t:{};r&&(e.volume=e.volume?__spreadProps(__spreadValues({},e.volume),{default:r}):r),i&&n&&(e.startTime=n)}getCurrentPlayerConfig(){var e,t;const{isLive:i,current:{lineId:r,definition:n}}=this.playerData,o={type:i?"live":"vod",isLive:i,definition:n,lineId:r,volume:null!=(e=this.player.volume)?e:.6};return i||(o.startTime=null!=(t=this.player.currentTime)?t:0),__spreadValues({},o)}getStreamType(){var e,t;return this.playerData.getCurrentStreamType()||getFormat(null==(t=null==(e=this.playerData)?void 0:e.configs)?void 0:t.getVideoByToken)}_analyzeExtendPlugins(){var e;const{options:t}=this.playerData,i=t.extendPlugin||[],r=null!=(e=null==t?void 0:t.ignore)?e:[],n=[],o=[];return i.forEach((e=>{const t=extendPlugin$1(e);"inner"!==t.type||r[e.pluginName]?n.push(t):o.push(t)})),{basicPlugins:n,iconPlugins:o}}beforePlayerCreate(){return __async(this,null,(function*(){const e=this._createPlayerPerf;e?yield e.measureAsync("beforePlayerCreate",(()=>__async(this,null,(function*(){yield Promise.all([e.measureAsync("beforePlayerCreate.sdkPlugins",(()=>__async(this,null,(function*(){yield sdkPluginManager$1.beforePlayerCreate(this)})))),e.measureAsync("beforePlayerCreate.prepareStrategies",(()=>__async(this,null,(function*(){yield this.prepareStrategies()}))))]),e.measure("beforePlayerCreate.updateConfigByStrategy",(()=>{this.updateConfigByStrategy()}))})))):(yield Promise.all([sdkPluginManager$1.beforePlayerCreate(this),this.prepareStrategies()]),this.updateConfigByStrategy())}))}getCreatePlayerPerfReport(){return this._lastCreatePlayerPerfReport}recordGetDramaInfoPerf(e){var t,i,r;if(null==e?void 0:e.perfInfo){this._getDramaInfoPerfRecords=this._getDramaInfoPerfRecords||[],this._getDramaInfoPerfRecords.push(e),this._markGetDramaInfoClientPerf(e);try{null==(r=null==(i=null==(t=this.playerData)?void 0:t.configs)?void 0:i.onGetDramaInfoPerf)||r.call(i,e)}catch(e){VE_DEBUG.error("onGetDramaInfoPerf callback error:",e)}}}getDramaInfoPerfRecords(){return[...this._getDramaInfoPerfRecords||[]]}getLastDramaInfoPerf(){const e=this._getDramaInfoPerfRecords||[];return e[e.length-1]}_markGetDramaInfoClientPerf(e){if(!this._isCollectingCreatePlayerPerf||!this._createPlayerPerf)return;const t=e.perfInfo,i=(e,t)=>{var i;"number"==typeof t&&(null==(i=this._createPlayerPerf)||i.markDuration(`beforePlayerCreate.authtoken.getVideoInfo.getVideos.getDramaInfoViaJSB.perfInfo.${e}`,t))};i("prepareCost",t.prepare_cost),i("requestCost",t.request_cost),i("parseCost",t.parse_cost),i("totalCost",t.total_cost)}prepareStrategies(){return __async(this,null,(function*(){if(yield VeStrategy.prepare()){const{plugins:e,pluginConfiguration:t}=VeStrategy.getStrategyRecommendations();this.playerData.strategiesPlugins=e,this.playerData.strategiesPluginConfigs=t}else this.playerData.strategiesPlugins=[],this.playerData.strategiesPluginConfigs={}}))}updateConfigByStrategy(){if(VeStrategy.isReady()){const e=VeStrategy.getStrategyRecommendations(),{result:t}=e;if(VE_DEBUG.log("vodLogCommon strategyConfig:",t),this.vodLogCommon={strategyResult:t},null==t?void 0:t[StrategyNames.H265]){const{configs:e}=this.playerData;if(!e)return;const{url:i,codec:r}=e,n=this.playerData.playList||[],o=n.filter((e=>!e.codec||e.codec===CodecType.UNKNOWN)),a=n.filter((e=>e.codec===CodecType.H264)),s=n.filter((e=>e.codec===CodecType.H265)),l=t[StrategyNames.H265].enableH265Hardware,c=uniqBy(l?s.concat(a).concat(o):a.concat(o).concat(s),"definition"),u=!l&&!!i&&r===CodecType.H265&&c.length>0;this.playerData.initPlayData(__spreadProps(__spreadValues({},this.playerData.configs),{url:u?null:i,codec:u?CodecType.UNKNOWN:r,playList:c})),VE_DEBUG.log("hit h265strategy, current playList: ",this.playerData.playList)}}}afterPlayerCreate(){const{isMobile:e,isLive:t}=this.playerData;_VePlayer.shouldCheckLicense()&&!t&&this.checkLicenseCallback(),this._setVeError(),this._mountingPlayerPanel(e),this._mountingExtendMethods(),this._bindSdkEvents(),this._bindPlayerEvents(),this._setPlayerInfo(),this._initCheckExpire(),sdkPluginManager$1.afterPlayerCreate(this)}_setVeError(){const e=this.playerData.configs,t={oriErrRetryCount:e.oriErrRetryCount,oriErrRetryCycle:e.oriErrRetryCycle,oriErrRetryBaseDelay:e.oriErrRetryBaseDelay,oriErrMaxTotalRetry:e.oriErrMaxTotalRetry,enableOriErrRetry:e.enableOriErrRetry,needSyncAnalyzeError:e.needSyncAnalyzeError,analyzeTimeout:e.analyzeTimeout};this.veErrorIns=new VeError(this.player,t)}_emitDelayError(){this.player&&this.delayError.forEach((e=>{this.player.emit(Events$1.ERROR,e)})),this.delayError=[]}_emitDelayEvent(){this.player&&this.delayEvents.forEach((e=>{const{name:t,payload:i}=e||{};t&&this.emit(t,i)})),this.delayEvents=[]}_setPlayerInfo(){this.player&&(this.player.playerVersion="1.18.0-rc.6",this.player.vtype=this.getVtype())}getVtype(){var e,t,i;const r=this.getStreamType()||getFormat(null==(t=null==(e=this.playerData)?void 0:e.configs)?void 0:t.getVideoByToken),n=util.isMSE(this.player.media);return!this.player.playerType&&(this.player.playerType=r,"hls"===(null==r?void 0:r.toLowerCase())&&(null==(i=this.player)?void 0:i.vodLogger))?n?"HLS_MSE":"HLS":r.toUpperCase()}_mountingPlayerPanel(e){var t;const{options:i,isLive:r}=this.playerData;this.player&&e&&(this.mobilePanel=new MobilePlayerPanel({config:null!=(t=i.panel)?t:{mode:r?PLAYER_MODE.INNER:PLAYER_MODE.NORMAL,isAutoChange:!0},root:this.player.root,player:this.player}),this.player.panel=this.mobilePanel)}_bindPlayerEvents(){var e;if(!this.player)return;this.player.on(SDKEvents.PLAYER_REBUILD,this.createPlayer),this.player.once(Events$1.READY,this._emitDelayError.bind(this)),this.player.once(Events$1.READY,this._emitDelayEvent.bind(this)),this.player.on(Events$1.ERROR,this._onError),this.player.on("ve_error",this._proxyError);const t=null==(e=this.player.plugins)?void 0:e.mp4encryptplayer;t&&t.on(PluginEvents.PRELOAD_INFO,this._onMp4PreloadInfo)}_onMediaExpiredAction(){var e,t;if(this.emitExpireTimestamp=Math.round((new Date).getTime()/1e3),(null==(e=this.playerData)?void 0:e.onMediaExpired)&&"function"==typeof(null==(t=this.playerData)?void 0:t.onMediaExpired)){const e=retPromise$1(this.playerData.onMediaExpired());(null==e?void 0:e.then)&&e.then((e=>this.updateMediaSource(e)))}}updateMediaSource(e){try{this.assertLiteConfig(e)}catch(e){return Promise.reject(e)}const{url:t,playList:i,getVideoByToken:r}=e||{};return t||(null==i?void 0:i.length)?new Promise(((t,r)=>{this.playerData.updateConfigs(e),this.playerData.updatePlayList(),this.playerData.updateCheckExpireData();const n=this.playerData.getCurrentUrl();if(this.player.isError||this.player.state<6&&sniffer.isWeixin&&sniffer.os.isIos){if(!(null==i?void 0:i.length))return this.playNext(__spreadValues({},e),!1);{const t=this.playerData.current.definition,r=i.find((e=>e.definition===t));if(r&&r.url)return this.playNext(__spreadProps(__spreadValues({},e),{url:r.url}),!1)}}else{this.player.setConfig(__spreadProps(__spreadValues({},e),{url:n,definition:this.getDefinitionConfig()}));const i=this.player.switchURL(n,{seamless:!0});i&&i.then?(i.then((()=>t(void 0))),i.catch((()=>r()))):t(void 0)}})):(null==r?void 0:r.playAuthToken)?this.updateAuthToken(r):void 0}onTokenExpiredAction(){var e,t;if((null==(e=this.playerData)?void 0:e.onTokenExpired)&&"function"==typeof(null==(t=this.playerData)?void 0:t.onTokenExpired)){const e=retPromise$1(this.playerData.onTokenExpired());(null==e?void 0:e.then)&&e.then((e=>this.updateAuthToken(e)))}}_bindSdkEvents(){const e=Object.values(XGEvents).filter((e=>e!==ERROR$1)),t=[...Object.values(PluginEvents),...Object.values(SDKEvents),...e];[...new Set(t.filter((e=>"string"==typeof e)))].forEach((e=>{"string"==typeof e&&this.player.on(e,((...t)=>{this._emitter.emit(e,...t)}))})),this.player.on("hlsAudioTracksUpdated",(e=>{this._applyAudioPreference(e.audioTracks),this._emitter.emit(SDKEvents.AUDIO_TRACKS_UPDATED,e)})),this.player.on("hlsAudioTrackSwitched",(e=>{var t,i,r,n,o;const a=this._getHlsInstance(),s=null==(t=null==a?void 0:a.audioTracks)?void 0:t.find((t=>t.id===e.id));if(this._suppressAudioTrackMemory)this._clearSuppressAudioTrackMemory();else{s&&(this._lastSelectedAudioTrack=s);const e=null!=(n=null==(r=null==(i=this.playerData)?void 0:i.configs)?void 0:r.audioTrackSwitchSeekOffset)?n:.1,t=null==(o=this.player)?void 0:o.media;e>0&&t&&!t.paused&&isFinite(t.currentTime)&&(t.currentTime+=e)}this._emitter.emit(SDKEvents.AUDIO_TRACK_CHANGE,__spreadProps(__spreadValues({},e),{audioTrack:s}))})),this._bindNativeAudioTrackEvents()}_bindNativeAudioTrackEvents(){var e,t;const i=null==(t=null==(e=this.player)?void 0:e.media)?void 0:t.audioTracks;i&&(i.addEventListener("addtrack",this._onNativeAddTrack),i.addEventListener("change",this._onNativeTrackChange),i.addEventListener("removetrack",this._onNativeAddTrack))}_mountingExtendMethods(){this.player&&(this.player.changePluginsIcon=this.changePluginsIcon.bind(this))}_getHlsInstance(){var e,t,i;const r=null==(e=this.player)?void 0:e.plugins;return(null==(t=null==r?void 0:r.encrypthlsplugin)?void 0:t.hls)||(null==(i=null==r?void 0:r.hls)?void 0:i.hls)}_applyAudioPreference(e){var t,i,r,n;if(!(null==e?void 0:e.length))return;const o=this._getHlsInstance();if(!o)return;const a=null!=(n=null!=(r=this._lastSelectedAudioTrack)?r:null==(i=null==(t=this.playerData)?void 0:t.configs)?void 0:i.audioPreference)?n:{};if(0===Object.keys(a).length)return;this._setSuppressAudioTrackMemory();const s=o;if("function"==typeof s.setAudioOption)s.setAudioOption(buildAudioSelectionOption(a));else{const t=a.lang;if(!t)return void this._clearSuppressAudioTrackMemory();const i=e.findIndex((e=>{var i;return(null==(i=e.lang)?void 0:i.toLowerCase())===t.toLowerCase()}));-1!==i&&o.audioTrack!==i?o.audioTrack=i:this._clearSuppressAudioTrackMemory()}}_setSuppressAudioTrackMemory(){this._suppressAudioTrackMemory=!0,null!==this._suppressAudioTrackMemoryTimer&&clearTimeout(this._suppressAudioTrackMemoryTimer),this._suppressAudioTrackMemoryTimer=setTimeout((()=>{this._suppressAudioTrackMemory=!1,this._suppressAudioTrackMemoryTimer=null}),2e3)}_clearSuppressAudioTrackMemory(){this._suppressAudioTrackMemory=!1,null!==this._suppressAudioTrackMemoryTimer&&(clearTimeout(this._suppressAudioTrackMemoryTimer),this._suppressAudioTrackMemoryTimer=null)}_applyAudioPreferenceNative(e){var t,i,r;if(!(null==e?void 0:e.length))return;const n=[this._lastSelectedAudioTrack,null==(i=null==(t=this.playerData)?void 0:t.configs)?void 0:i.audioPreference];for(const t of n){if(!t)continue;const i=t.id,n=t.lang,o=t.name;if(void 0===i&&!n&&!o)continue;let a=-1;for(let t=0;t<e.length;t++){const s=e[t];if((void 0===i||t===Number(i))&&!(n&&(null==(r=s.language)?void 0:r.toLowerCase())!==n.toLowerCase()||o&&s.label!==o)){a=t;break}}if(-1!==a)return void switchNativeAudioTrack(e,a)}}_offPlayerEvents(){var e;if(!this.player)return;this.player.off(SDKEvents.PLAYER_REBUILD,this.createPlayer),this.player.off(Events$1.ERROR,this._onError),this.player.off("ve_error",this._proxyError);const t=null==(e=this.player.plugins)?void 0:e.mp4encryptplayer;null==t||t.off(PluginEvents.PRELOAD_INFO,this._onMp4PreloadInfo)}changePluginsIcon(e,t){var i;if(!this.player)return;const r=this.player.getPlugin(e);if(!r||!(null==r?void 0:r.root))return;const n=util.hasClass(null==r?void 0:r.parent,"panel-icon-svg")?null==(i=null==r?void 0:r.parent)?void 0:i.parentNode:null==r?void 0:r.root;n&&(t?util.show(n,"block"):util.hide(n))}getSdkPlugin(e){var t;const i=null==(t=this._sdkPlugins)?void 0:t[e.toLowerCase()];return i&&i.pluginName?i:null}switchAuthToken(e,t=!0){try{this.assertLiteConfig({getVideoByToken:e})}catch(e){return Promise.reject(e)}const i=t?0:this.player.currentTime,r=this.getSdkPlugin("AuthToken");return new Promise(((n,o)=>{r&&this.player?r.updateAuthToken(e,t).then((()=>this._playerPlayNext(i))).then((()=>n())).catch((e=>o(e))):(VE_DEBUG.error("current is not playAuthToken play or player not created"),o())}))}updateAuthToken(e){try{this.assertLiteConfig({getVideoByToken:e})}catch(e){return Promise.reject(e)}const t=this.getSdkPlugin("AuthToken");return new Promise(((i,r)=>{t&&this.player?t.updateAuthToken(e,!1).then((()=>{if(this.player.isError)this._playerPlayNext(this.player.currentTime).then((()=>i())).catch((()=>r()));else{const e=this.playerData.getCurrentUrl();this.player.setConfig({url:e,definition:this.getDefinitionConfig()});const t=this.player.switchURL(e,{seamless:!0});t&&t.then?(t.then((()=>i())),t.catch((()=>r()))):i()}})).catch((e=>r(e))):(VE_DEBUG.error("current is not playAuthToken play or player not created"),r())}))}_playerPlayNext(e=0){return new Promise(((t,i)=>{var r,n,o;const a=this.player.paused&&!this.player.isError;this.player.addClass(STATE_CLASS.ENTER);const s=this.playerData.isOpenABR()?void 0:this.playerData.getCurrentUrl(),l=__spreadProps(__spreadValues(__spreadValues({},this.playerData.options),this._getDramaConfigPatchForPlayer()),{definition:this.getDefinitionConfig(),startTime:e,autoplay:!0,url:s});if(l.poster&&this.player.plugins.poster&&this.player.plugins.poster.update(l.poster),this.setPluginConfig(l),this.player.plugins.dashplugin){const e=__spreadValues(__spreadValues({},getPluginConfig(this.player.config,"DASHPlugin")),this.playerData.options.DASHPlugin||{});e.dashOpts=this.playerData.dashOpts,e.vid=null==(n=null==(r=this.playerData.dashOpts)?void 0:r.Data)?void 0:n.Vid,this.player.plugins.drm&&(null==(o=this.player.plugins.drm)||o.restart()),this.player.setConfig(l),this.player.plugins.dashplugin.next(this.player.currentTime,"NEXT",e)}else this.player.playNext(l);const c=e=>{this.player.off(Events$1.TIME_UPDATE,u),this.player.off(Events$1.CANPLAY,u),i(e)},u=()=>{a&&this.player.pause(),this.player.off(Events$1.ERROR,c),t(!0)};this.player.once(Events$1.ERROR,c),this.player.once(Events$1.CANPLAY,u)}))}get src(){var e,t;return(null==(e=this.player)?void 0:e.currentSrc)||(null==(t=this.player)?void 0:t.src)}set src(e){this.player&&(this.player.src=e)}switchURL(e){try{this.assertLiteConfig({url:e})}catch(e){return Promise.reject(e)}const t=this.player.switchURL(e,!1),i=this.player.currentTime;return t&&t.then?t:new Promise((e=>{const t=this.player.paused&&!this.player.isError,r=()=>{this.player.currentTime=i,t&&this.player.once(Events$1.CANPLAY,(()=>{this.player.pause()})),e()};sniffer.os.isAndroid?this.once(Events$1.TIME_UPDATE,(()=>{r()})):this.once(Events$1.CANPLAY,(()=>{r()})),this.player.play()}))}next(e,t=!0){var i;try{this.assertLiteConfig(e)}catch(e){return Promise.reject(e)}const r=t?0:this.player.currentTime,n=this.playerData.configs,o=__spreadValues(__spreadProps(__spreadValues({},n),{startTime:r,autoplay:!0}),e);return(null==(i=null==e?void 0:e.getVideoByToken)?void 0:i.playAuthToken)&&(o.streamType=getFormat(null==e?void 0:e.getVideoByToken)||EVideoFormat.MP4),this.destroy().then((()=>this._init(o))).catch((e=>{if(VE_DEBUG.error("next_error",e),"VEPLAYER_LITE_UNSUPPORTED_FEATURE"===(null==e?void 0:e.code))throw e}))}playNext(e,t=!0){try{this.assertLiteConfig(e)}catch(e){return Promise.reject(e)}this.player.emit(PluginEvents.PLAY_NEXT_START),this._lastSelectedAudioTrack=null,this._clearSuppressAudioTrackMemory(),this._playNextPending=!0;const i=this._playNext(e,t);return i.finally((()=>{this.player.emit(PluginEvents.PLAY_NEXT_END)})),i}updatePlayNextSubtitleConfig(e,t){var i,r,n,o;const a=getPluginConfig(e,"Subtitle"),s=Array.isArray(null==a?void 0:a.list);if(!s&&!t)return;const l=s?a.list:[],c=__spreadProps(__spreadValues(__spreadValues(__spreadValues({},getPluginConfig(this.playerData.options,"Subtitle")||{}),getPluginConfig(this.playerData.configs,"Subtitle")||{}),a||{}),{list:l});e.Subtitle=c,this.playerData.updateConfigs({Subtitle:c}),this.playerData.options.Subtitle=c,null==(o=null==(n=null==(r=null==(i=this.player)?void 0:i.plugins)?void 0:r.subtitle)?void 0:n.updateSubtitles)||o.call(n,l)}_playNext(e,t=!0){var i,r,n;if(!e)return Promise.reject();const{url:o,playList:a,getVideoByToken:s}=e,l=this.player.paused&&!this.player.isError,c=t?0:this.player.currentTime;if(o||(null==a?void 0:a.length)){this.playerData.updateConfigs(e),this.playerData.initPlayData(e);const i=this.adapter.canOpenAbr()&&this.playerData.isOpenABR()?void 0:this.playerData.getCurrentUrl(),r=this.player.state,n=this.getDefinitionConfig(),o=__spreadProps(__spreadValues({startTime:c},e),{url:i,definition:n});return this.updatePlayNextSubtitleConfig(o,t),this.setPluginConfig(o),this.player.playNext(o),new Promise(((e,t)=>{if(this.player.once(Events$1.ERROR,(e=>{t(e)})),6===r)this.player.once(Events$1.EMPTIED,(()=>{this.player.once(Events$1.CANPLAY,(()=>{l&&this.player.pause(),e(void 0)}))}));else{const t=this.player.config.autoplay;this.player.once(Events$1.EMPTIED,(()=>{this.player.once(Events$1.CANPLAY,(()=>{t&&this.player.play(),e(void 0)}))}))}}))}if(_VePlayer.ttDramaEnv){if(null==(i=e.getVideoByToken)?void 0:i.playAuthToken){if((this.playerData.getCurrentStreamType()||getFormat(null==(r=this.playerData.configs)?void 0:r.getVideoByToken))!==(e.streamType||getFormat(null==e?void 0:e.getVideoByToken)||"mp4"))return this.next(e,t)}return this.playerData.updateConfigs(e),this.switchDramaEpisode(t)}if(null==s?void 0:s.playAuthToken){return(this.playerData.getCurrentStreamType()||getFormat(null==(n=this.playerData.configs)?void 0:n.getVideoByToken))!==(e.streamType||getFormat(null==e?void 0:e.getVideoByToken)||"mp4")?this.next(e,t):(this.playerData.updateConfigs(e),this.switchAuthToken(s,t))}return this.next(e,t)}_getDramaConfigPatchForPlayer(){const e=this.playerData.configs,t=["albumId","album_id","episodeId","episode_id","episodeID"],i={};for(const r of t){const t=e[r];null!=t&&""!==t&&(i[r]=t)}return i}_buildDramaInvalidParamError(){const e=DRAMA_ERROR_CODE.INVALID_PARAM;return{errorType:VE_ERROR_TYPE_MAP.network,errorCode:e.code,veError:VeError.getVeErrorInfo({code:e.code,message:e.message,textKey:e.textKey}),errorMessage:e.message,ext:{},originError:void 0}}_getDramaAlbumIdFromConfig(e){var t;const i=e,r=null!=(t=i.album_id)?t:i.albumId;return"string"==typeof r?r.trim():""}_getDramaEpisodeIdFromConfig(e){var t,i;const r=e,n=null!=(i=null!=(t=r.episode_id)?t:r.episodeId)?i:r.episodeID;return"string"==typeof n?n.trim():""}switchDramaEpisode(e=!0){const t=e?0:this.player.currentTime,i=this.getSdkPlugin("AuthToken");return new Promise(((r,n)=>{i&&this.player?i.updateDramaEpisode(e).then((()=>this._playerPlayNext(t))).then((()=>r(void 0))).catch((e=>n(e))):(VE_DEBUG.error("switchDramaEpisode: AuthToken plugin or player not available"),n(new Error("AuthToken plugin or player not available")))}))}_destroyPlayer(){return __async(this,null,(function*(){var e,t,i;this._offPlayerEvents(),null==(e=this.veErrorIns)||e.destroy(),this.veErrorIns=null,yield null==(t=this.mobilePanel)?void 0:t.destroy(),yield null==(i=this.player)?void 0:i.destroy(),this.player=null}))}getPlayerInstance(){return this.player}getSoftDecodingOption(e,t,i){return __async(this,null,(function*(){var r,n;const{enableH265Degrade:o,codec:a,configs:s,isLive:l}=this.playerData,c=isEncryptPlay(null==s?void 0:s.getVideoByToken),u=!!(s.enableMp4MSE||getPluginConfig(this.playerData.options,"Mp4EncryptPlayer")||"mp4"===i&&(a===CodecType.H265||c||(null==(r=null==s?void 0:s.autoBitrateOpts)?void 0:r.enable)));if(_VePlayer.shouldCheckLicense()&&(null==(n=this._originConfigs)?void 0:n.useSoftDecoding)&&!l)try{const e=yield _VePlayer.checkLicenseStatus();if(!(yield _VePlayer.checkLicenseModuleAuth(SDKType.SDK_VOD_PLAY,LicenseFeature.H265)))throw this.emit(SDKEvents.LICENSE_STATUS_WARNING,e===LicenseStatus.LICENSE_STATUS_EXPIRED?veWarningCodeMap.EXPIRED_LICENSE_NOT_SUPPORT_265:veWarningCodeMap.BASE_LICENSE_NOT_SUPPORT_265),new Error("ERROR_LICENSE_EDITION_NEED_UPLOAD")}catch(e){return void VE_DEBUG.error("ERROR_LICENSE_EDITION_NEED_UPLOAD")}if(e){const e=yield this.sdkUmdLoader.loadPlugins(UmdKeys.XGVideo);if(null==e?void 0:e.isSupported()){if(a&&e.setDecodeCapacity({preloadDecoder:this.playerData.codec,wasmFallbackToAsm:!1,reuseWasmDecoder:!1,disabledWhenErrorOccur:!1}),this.setH265SoftPlayList(),u){const e=yield mediaDependencies.loadMp4Encrypt(this.sdkUmdLoader);return{mediaType:this.playerData.isCurrentH265()?"xg-video":"video",innerDegrade:1,codecType:null!=a?a:CodecType.H264,plugins:[e]}}return{mediaType:"xg-video",innerDegrade:1,codecType:null!=a?a:CodecType.H264}}{this.emit(SDKEvents.NOT_SUPPORT_SOFT_DECODER);const e={errorType:"decoder",errorCode:3,errorMessage:"soft decode is not support by current browser",ext:{},originError:void 0};this.delayError.push(e),VE_DEBUG.error("soft decode is not support by current browser")}}else if(o&&!a&&t&&(yield this.detectCodec(t)),this.playerData.isCurrentH265()&&!isHevcSupported$1())if(o){if(_VePlayer.shouldCheckLicense()&&!l)try{const e=yield _VePlayer.checkLicenseStatus();if(!(yield _VePlayer.checkLicenseModuleAuth(SDKType.SDK_VOD_PLAY,LicenseFeature.H265)))throw this.emit(SDKEvents.LICENSE_STATUS_WARNING,e===LicenseStatus.LICENSE_STATUS_EXPIRED?veWarningCodeMap.EXPIRED_LICENSE_NOT_SUPPORT_265:veWarningCodeMap.BASE_LICENSE_NOT_SUPPORT_265),new Error("ERROR_LICENSE_EDITION_NEED_UPLOAD")}catch(e){return void VE_DEBUG.error("ERROR_LICENSE_EDITION_NEED_UPLOAD")}const e=yield this.sdkUmdLoader.loadPlugins(UmdKeys.XGVideo);if(null==e?void 0:e.isSupported()){if(null==e||e.setDecodeCapacity({preloadDecoder:this.playerData.codec,wasmFallbackToAsm:!1,reuseWasmDecoder:!1,disabledWhenErrorOccur:!1}),this.setH265SoftPlayList(),this.playerData.openSoftDecoding=!0,u){const e=yield mediaDependencies.loadMp4Encrypt(this.sdkUmdLoader);return{mediaType:this.playerData.isCurrentH265()?"xg-video":"video",innerDegrade:1,codecType:null!=a?a:CodecType.H264,plugins:[e]}}return{mediaType:"xg-video",innerDegrade:1,codecType:null!=a?a:CodecType.H264}}{this.emit(SDKEvents.NOT_SUPPORT_SOFT_DECODER);const e={errorType:"decoder",errorCode:3,errorMessage:"soft decode is not support by current browser",ext:{},originError:void 0};this.delayError.push(e),VE_DEBUG.error("soft decode is not support by current browser")}}else{this.emit(SDKEvents.NOT_SUPPORT_HARDWARE_DECODER);const e={ext:{},originError:void 0,errorType:"decoder",errorCode:3,errorMessage:"h265 hardware decode is not supported by this browser"};this.delayError.push(e),VE_DEBUG.error("h265 hardware decode is not supported by this browser")}return{}}))}setH265SoftPlayList(){if(this.playerData.isCurrentH265()){const e=this.playerData.playList;e.length>1&&(this.playerData.playList=e.filter((e=>{var t;return(null==(t=null==e?void 0:e.codec)?void 0:t.toLowerCase())===CodecType.H265}))),this.playerData.initCurrent(this.playerData.playList[0])}}changeDefinition(e){var t,i,r,n,o,a;if((null==(t=this.getDefinitionList())?void 0:t.length)<=1)return;const{sdkdefinitionplugin:s,definitionmobileplugin:l}=(null==(i=this.player)?void 0:i.plugins)||{};if(s||l)e!==this.playerData.current.definition&&(s?null==s||s.changeDefinition(e):l&&(null==l||l.changeDefinition(e)));else{let t;const{current:{lineId:i}}=this.playerData;t=this.playerData.getDefinitionListByLineId(i).find((t=>t.definition===e)),t||(t=null==(a=null==(o=null==(n=null==(r=this.player)?void 0:r.config)?void 0:n.definition)?void 0:o.list)?void 0:a.find((t=>(null==t?void 0:t.definition)===e))),t&&(this.player.changeDefinition(t),t.definition!==this.playerData.current.definition&&(this.playerData.current.definition=t.definition))}}getDefinitionList(){var e;const{sdkdefinitionplugin:t,definitionmobileplugin:i}=(null==(e=this.player)?void 0:e.plugins)||{};return t||i?(null==t?void 0:t.renderList)||(null==i?void 0:i.renderList):this.player.definitionList.map((e=>{var t;const i=this.playerData.isDefinitionMatch(e.definition,null==(t=this.player.curDefinition)?void 0:t.definition),r=e.url===this.player.url,n=e.url===this.player.src;return __spreadProps(__spreadValues({},e),{isDefinitionAuto:this.playerData.isAutoDefinition(e.definition),selected:i||(this.playerData.isOpenABR()&&sniffer.os.isIos?n:r)})}))}getAudioTracks(){var e,t,i;const r=this._getHlsInstance();if(null==(e=null==r?void 0:r.audioTracks)?void 0:e.length){const e=r.audioTrack;return r.audioTracks.map((t=>__spreadProps(__spreadValues({},t),{selected:t.id===e})))}const n=null==(i=null==(t=this.player)?void 0:t.media)?void 0:i.audioTracks;if(!(null==n?void 0:n.length))return[];const o=[];for(let e=0;e<n.length;e++){const t=n[e];o.push({id:e,name:t.label||t.language||String(e),lang:t.language,default:t.enabled,selected:t.enabled})}return o}getCurrentAudioTrack(){var e,t,i;const r=this._getHlsInstance();if(null==(e=null==r?void 0:r.audioTracks)?void 0:e.length){const e=r.audioTrack,t=r.audioTracks.find((t=>t.id===e));return t?__spreadProps(__spreadValues({},t),{selected:!0}):null}const n=null==(i=null==(t=this.player)?void 0:t.media)?void 0:i.audioTracks;if(!n)return null;for(let e=0;e<n.length;e++){const t=n[e];if(t.enabled)return{id:e,name:t.label||t.language||String(e),lang:t.language,default:!0,selected:!0}}return null}switchAudioTrack(e){var t,i;const{id:r}=e,n=this._getHlsInstance();if(n)return void switchHlsAudioTrack(n,e);const o=null==(i=null==(t=this.player)?void 0:t.media)?void 0:i.audioTracks;o&&switchNativeAudioTrack(o,r)}get preLoadData(){var e;if(!this.player||!this.player.plugins)return{hit:0};const t=this.player.plugins.mp4encryptplayer;if(t&&t.preLoadData)return{hit:!0===t.hitpreload?1:0,duration:t.preLoadData.duration,length:t.preLoadData.byteLength};const i=(null==(e=this.player)?void 0:e.stat)||{};if(i.preLoadData){const{length:e,duration:t}=i.preLoadData,r={hit:e>0?1:0,length:e,duration:0};return t>=0&&(r.duration=t),r}return{hit:0,duration:0,length:0}}_initI18N(e){const{extraLangList:t,extendLangList:i}=e;null==t||t.forEach((e=>{I18N.use(e)})),I18N.extend(extendLang),i&&I18N.extend(i)}get musicMode(){}set musicMode(e){}get musicTimeScale(){}set musicTimeScale(e){}get musicList(){}set musicList(e){}musicAdd(e){}musicRandom(){}musicNext(){}musicPrev(){}musicSetIndex(e){}musicForward(){}musicBackward(){}musicRemove(e){}musicSetAbCycle(e,t,i,r){}musicRemoveAbCycle(){}getLogUserId(){var e,t,i;const r=null==(e=this.player)?void 0:e.vodLogger;if(r){const e=(null==(t=null==r?void 0:r.tracker)?void 0:t.getConfig())||{};return null==(i=null==e?void 0:e.user)?void 0:i.user_unique_id}}get region(){return this.playerData.region}get userRegion(){return this.playerData.userRegion}getPlugin(e){var t;return null==(t=this.player)?void 0:t.getPlugin(e)}getSubtitleList(){var e,t;const i=this.getPlugin("subtitle");return null!=(t=null==(e=null==i?void 0:i.config)?void 0:e.list)?t:[]}switchSubtitle(e){const t=this.getPlugin("subtitle");return t?t.switchSubTitle(e):Promise.reject(new Error("subtitle plugin is not registered"))}showSubtitle(){var e,t;const i=this.getPlugin("subtitle");if(i)if(i.curIndex>-1&&i.curItem)i.switchSubTitle(i.curItem);else{const r=null!=(t=null==(e=i.config)?void 0:e.list)?t:[];r.length>0&&i.switchSubTitle(r[0])}}hideSubtitle(){var e;const t=this.getPlugin("subtitle");null==(e=null==t?void 0:t.switchOffSubtitle)||e.call(t)}destroy(){return __async(this,null,(function*(){var e;yield this._destroyPlayer(),this.checkExpireTimer&&(this.checkExpireTimer.clear(),this.checkExpireTimer=null,this._onRepeat=null),this.mountingDom&&this.mountingDom.contains(this.playerContainer)&&this.mountingDom.removeChild(this.playerContainer),null==(e=this._emitter)||e.removeAllListeners(),this._emitter=null,sdkPluginManager$1.destroy(this)}))}};let VePlayer=_VePlayer;VePlayer.isMSESupported=isMSESupport2,VePlayer.veStrategy=VeStrategy,VePlayer.sdkVersion="1.18.0-rc.6",VePlayer.ttDramaEnv=null,VePlayer.isMMSSupported=isMMSSupported,VePlayer.isRTMSupported=LiteRtmPlugin.isSupported,VePlayer.hasInitVeStrategy=!1;const VePlayer$1=VePlayer;function getI18N(){return I18N}const version="3.7.7",VERSION="3.7.7",_hasBuffer="function"==typeof Buffer,_TD="function"==typeof TextDecoder?new TextDecoder:void 0,_TE="function"==typeof TextEncoder?new TextEncoder:void 0,b64ch="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",b64chs=Array.prototype.slice.call(b64ch),b64tab=(e=>{let t={};return b64chs.forEach(((e,i)=>t[e]=i)),t})(),b64re=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,_fromCC=String.fromCharCode.bind(String),_U8Afrom="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),_mkUriSafe=e=>e.replace(/=/g,"").replace(/[+\/]/g,(e=>"+"==e?"-":"_")),_tidyB64=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),btoaPolyfill=e=>{let t,i,r,n,o="";const a=e.length%3;for(let a=0;a<e.length;){if((i=e.charCodeAt(a++))>255||(r=e.charCodeAt(a++))>255||(n=e.charCodeAt(a++))>255)throw new TypeError("invalid character found");t=i<<16|r<<8|n,o+=b64chs[t>>18&63]+b64chs[t>>12&63]+b64chs[t>>6&63]+b64chs[63&t]}return a?o.slice(0,a-3)+"===".substring(a):o},_btoa="function"==typeof btoa?e=>btoa(e):_hasBuffer?e=>Buffer.from(e,"binary").toString("base64"):btoaPolyfill,_fromUint8Array=_hasBuffer?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let i=0,r=e.length;i<r;i+=4096)t.push(_fromCC.apply(null,e.subarray(i,i+4096)));return _btoa(t.join(""))},fromUint8Array=(e,t=!1)=>t?_mkUriSafe(_fromUint8Array(e)):_fromUint8Array(e),cb_utob=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?_fromCC(192|t>>>6)+_fromCC(128|63&t):_fromCC(224|t>>>12&15)+_fromCC(128|t>>>6&63)+_fromCC(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return _fromCC(240|t>>>18&7)+_fromCC(128|t>>>12&63)+_fromCC(128|t>>>6&63)+_fromCC(128|63&t)},re_utob=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,utob=e=>e.replace(re_utob,cb_utob),_encode=_hasBuffer?e=>Buffer.from(e,"utf8").toString("base64"):_TE?e=>_fromUint8Array(_TE.encode(e)):e=>_btoa(utob(e)),encode=(e,t=!1)=>t?_mkUriSafe(_encode(e)):_encode(e),encodeURI$1=e=>encode(e,!0),re_btou=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,cb_btou=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return _fromCC(55296+(t>>>10))+_fromCC(56320+(1023&t));case 3:return _fromCC((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return _fromCC((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},btou=e=>e.replace(re_btou,cb_btou),atobPolyfill=e=>{if(e=e.replace(/\s+/g,""),!b64re.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,i,r,n="";for(let o=0;o<e.length;)t=b64tab[e.charAt(o++)]<<18|b64tab[e.charAt(o++)]<<12|(i=b64tab[e.charAt(o++)])<<6|(r=b64tab[e.charAt(o++)]),n+=64===i?_fromCC(t>>16&255):64===r?_fromCC(t>>16&255,t>>8&255):_fromCC(t>>16&255,t>>8&255,255&t);return n},_atob="function"==typeof atob?e=>atob(_tidyB64(e)):_hasBuffer?e=>Buffer.from(e,"base64").toString("binary"):atobPolyfill,_toUint8Array=_hasBuffer?e=>_U8Afrom(Buffer.from(e,"base64")):e=>_U8Afrom(_atob(e).split("").map((e=>e.charCodeAt(0)))),toUint8Array=e=>_toUint8Array(_unURI(e)),_decode=_hasBuffer?e=>Buffer.from(e,"base64").toString("utf8"):_TD?e=>_TD.decode(_toUint8Array(e)):e=>btou(_atob(e)),_unURI=e=>_tidyB64(e.replace(/[-_]/g,(e=>"-"==e?"+":"/"))),decode=e=>_decode(_unURI(e)),isValid=e=>{if("string"!=typeof e)return!1;const t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},_noEnum=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),extendString=function(){const e=(e,t)=>Object.defineProperty(String.prototype,e,_noEnum(t));e("fromBase64",(function(){return decode(this)})),e("toBase64",(function(e){return encode(this,e)})),e("toBase64URI",(function(){return encode(this,!0)})),e("toBase64URL",(function(){return encode(this,!0)})),e("toUint8Array",(function(){return toUint8Array(this)}))},extendUint8Array=function(){const e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,_noEnum(t));e("toBase64",(function(e){return fromUint8Array(this,e)})),e("toBase64URI",(function(){return fromUint8Array(this,!0)})),e("toBase64URL",(function(){return fromUint8Array(this,!0)}))},extendBuiltins=()=>{extendString(),extendUint8Array()},gBase64={version:"3.7.7",VERSION:"3.7.7",atob:_atob,atobPolyfill:atobPolyfill,btoa:_btoa,btoaPolyfill:btoaPolyfill,fromBase64:decode,toBase64:encode,encode:encode,encodeURI:encodeURI$1,encodeURL:encodeURI$1,utob:utob,btou:btou,decode:decode,isValid:isValid,fromUint8Array:fromUint8Array,toUint8Array:toUint8Array,extendString:extendString,extendUint8Array:extendUint8Array,extendBuiltins:extendBuiltins};var xssFilters={};!function(e){e._getPrivFilters=function(){var e,t=/</g,i=/"/g,r=/'/g,n=/&/g,o=/\x00/g,a=/(?:^$|[\x00\x09-\x0D "'`=<>])/g,s=/[&<>"'`]/g,l=/(?:\x00|^-*!?>|--!?>|--?!?$|\]>|\]$)/g,c=/&(?:#([xX][0-9A-Fa-f]+|\d+);?|(Tab|NewLine|colon|semi|lpar|rpar|apos|sol|comma|excl|ast|midast|ensp|emsp|thinsp);|(nbsp|amp|AMP|lt|LT|gt|GT|quot|QUOT);?)/g,u={Tab:"\t",NewLine:"\n",colon:":",semi:";",lpar:"(",rpar:")",apos:"'",sol:"/",comma:",",excl:"!",ast:"*",midast:"*",ensp:" ",emsp:" ",thinsp:" ",nbsp:" ",amp:"&",lt:"<",gt:">",quot:'"',QUOT:'"'},d=/^(?:(?!-*expression)#?[-\w]+|[+-]?(?:\d+|\d*\.\d+)(?:r?em|ex|ch|cm|mm|in|px|pt|pc|%|vh|vw|vmin|vmax)?|!important|)$/i,h=/[\x00-\x1F\x7F\[\]{}\\"]/g,p=/[\x00-\x1F\x7F\[\]{}\\']/g,f=/url[\(\u207D\u208D]+/g,g=/['\(\)]/g,y=/\/\/%5[Bb]([A-Fa-f0-9:]+)%5[Dd]/,_={javascript:1,data:1,vbscript:1,mhtml:1,"x-schema":1},m=/(?::|&#[xX]0*3[aA];?|&#0*58;?|&colon;)/,v=/(?:^[\x00-\x20]+|[\t\n\r\x00]+)/g,E={Tab:"\t",NewLine:"\n"},T=function(e,t,i){return void 0===e?"undefined":null===e?"null":e.toString().replace(t,i)},S=String.fromCodePoint||function(e){return 0===arguments.length?"":e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),e%1024+56320))};function P(e){var t=e.split(m,2);return!t[0]||2!==t.length&&e.length===t[0].length?null:t[0]}function C(t,i,r,n){return i=i||u,r=r||c,void 0===t?"undefined":null===t?"null":t.toString().replace(o,"�").replace(r,(function(t,r,o,a){return r?(r=Number(r[0]<="9"?r:"0"+r),n?S(r):128===r?"€":130===r?"‚":131===r?"ƒ":132===r?"„":133===r?"…":134===r?"†":135===r?"‡":136===r?"ˆ":137===r?"‰":138===r?"Š":139===r?"‹":140===r?"Œ":142===r?"Ž":145===r?"‘":146===r?"’":147===r?"“":148===r?"”":149===r?"•":150===r?"–":151===r?"—":152===r?"˜":153===r?"™":154===r?"š":155===r?"›":156===r?"œ":158===r?"ž":159===r?"Ÿ":r>=55296&&r<=57343||13===r?"�":e.frCoPt(r)):i[o||a]||t}))}function b(e){return"\\"+e.charCodeAt(0).toString(16).toLowerCase()+" "}function I(e){return e.replace(f,(function(e){return"-x-"+e}))}function A(t){var i=P(t=e.yufull(C(t)));return i&&_[i.toLowerCase()]?"##"+t:t}return e={frCoPt:function(e){return null==e?"":!isFinite(e=Number(e))||e<=0||e>1114111||e>=1&&e<=8||e>=14&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||11===e||65535==(65535&e)||65534==(65535&e)?"�":S(e)},d:C,yup:function(e){return(e=P(e.replace(o,"")))?C(e,E,null,!0).replace(v,"").toLowerCase():null},y:function(e){return T(e,s,(function(e){return"&"===e?"&amp;":"<"===e?"&lt;":">"===e?"&gt;":'"'===e?"&quot;":"'"===e?"&#39;":"&#96;"}))},ya:function(e){return T(e,n,"&amp;")},yd:function(e){return T(e,t,"&lt;")},yc:function(e){return T(e,l,(function(e){return"\0"===e?"�":"--!"===e||"--"===e||"-"===e||"]"===e?e+" ":e.slice(0,-1)+" >"}))},yavd:function(e){return T(e,i,"&quot;")},yavs:function(e){return T(e,r,"&#39;")},yavu:function(e){return T(e,a,(function(e){return"\t"===e?"&#9;":"\n"===e?"&#10;":"\v"===e?"&#11;":"\f"===e?"&#12;":"\r"===e?"&#13;":" "===e?"&#32;":"="===e?"&#61;":"<"===e?"&lt;":">"===e?"&gt;":'"'===e?"&quot;":"'"===e?"&#39;":"`"===e?"&#96;":"�"}))},yu:encodeURI,yuc:encodeURIComponent,yubl:function(t){return _[e.yup(t)]?"x-"+t:t},yufull:function(t){return e.yu(t).replace(y,(function(e,t){return"//["+t+"]"}))},yublf:function(t){return e.yubl(e.yufull(t))},yceu:function(e){return e=C(e),d.test(e)?e:";-x:'"+I(e.replace(p,b))+"';-v:"},yced:function(e){return I(C(e).replace(h,b))},yces:function(e){return I(C(e).replace(p,b))},yceuu:function(e){return A(e).replace(g,(function(e){return"'"===e?"\\27 ":"("===e?"%28":"%29"}))},yceud:function(e){return A(e)},yceus:function(e){return A(e).replace(r,"\\27 ")}}};var t=e._privFilters=e._getPrivFilters();function i(e,i,r){return t.yubl(i((r||t.yufull)(e)))}e.inHTMLData=t.yd,e.inHTMLComment=t.yc,e.inSingleQuotedAttr=t.yavs,e.inDoubleQuotedAttr=t.yavd,e.inUnQuotedAttr=t.yavu,e.uriInSingleQuotedAttr=function(e){return i(e,t.yavs)},e.uriInDoubleQuotedAttr=function(e){return i(e,t.yavd)},e.uriInUnQuotedAttr=function(e){return i(e,t.yavu)},e.uriInHTMLData=t.yufull,e.uriInHTMLComment=function(e){return t.yc(t.yufull(e))},e.uriPathInSingleQuotedAttr=function(e){return i(e,t.yavs,t.yu)},e.uriPathInDoubleQuotedAttr=function(e){return i(e,t.yavd,t.yu)},e.uriPathInUnQuotedAttr=function(e){return i(e,t.yavu,t.yu)},e.uriPathInHTMLData=t.yu,e.uriPathInHTMLComment=function(e){return t.yc(t.yu(e))},e.uriQueryInSingleQuotedAttr=e.uriPathInSingleQuotedAttr,e.uriQueryInDoubleQuotedAttr=e.uriPathInDoubleQuotedAttr,e.uriQueryInUnQuotedAttr=e.uriPathInUnQuotedAttr,e.uriQueryInHTMLData=e.uriPathInHTMLData,e.uriQueryInHTMLComment=e.uriPathInHTMLComment,e.uriComponentInSingleQuotedAttr=function(e){return t.yavs(t.yuc(e))},e.uriComponentInDoubleQuotedAttr=function(e){return t.yavd(t.yuc(e))},e.uriComponentInUnQuotedAttr=function(e){return t.yavu(t.yuc(e))},e.uriComponentInHTMLData=t.yuc,e.uriComponentInHTMLComment=function(e){return t.yc(t.yuc(e))},e.uriFragmentInSingleQuotedAttr=function(e){return t.yubl(t.yavs(t.yuc(e)))},e.uriFragmentInDoubleQuotedAttr=function(e){return t.yubl(t.yavd(t.yuc(e)))},e.uriFragmentInUnQuotedAttr=function(e){return t.yubl(t.yavu(t.yuc(e)))},e.uriFragmentInHTMLData=e.uriComponentInHTMLData,e.uriFragmentInHTMLComment=e.uriComponentInHTMLComment}(xssFilters);const dynamicWatermark="",DEFAULT_STYLE_STRING="position: absolute; width: 100%; height: 100%; left: 0px; top: 0px; pointer-events: none; z-index: 9999; font-size: 14px; display: block;",TICKER_STEP_NUM={SLOW:.5,MODERATE:1,FAST:2},TICKER_SPEED_NUM={SLOW:5,MODERATE:3.5,FAST:2},defaultNodeConfig={style:{node:DEFAULT_STYLE_STRING,wrap:"",img:""},class:{node:"",wrap:"xg-dynamic-watermark",img:""}};function createTag(e,t){const i=document.createElementNS("http://www.w3.org/2000/svg",e);return Object.keys(t).forEach((e=>{i.setAttribute(e,t[e])})),i}class DynamicWatermark{constructor(e){this.root=e.root,this.config=e,this.wrap=document.createElement("div"),this.img=document.createElement("img"),this.imgSrc="",this.root&&this.root.appendChild(this.wrap),this.moveTimer=null,this.blinkTimer=null,this.pauseAnimation=!1,this.observer=[]}_getWatermarkDom(){const{content:e="",fontFamily:t}=this.config,i=e,r="string"==typeof this.config.fontSize?`${this.config.fontSize}`:`${this.config.fontSize}px`,n=document.createElement("text");n.style.fontSize=r,n.style.whiteSpace="nowrap",t&&(n.style.fontFamily=t),n.innerHTML=xssFilters.inHTMLData(i),document.body.appendChild(n);const o=createTag("svg",{xmlns:"http://www.w3.org/2000/svg",width:n.offsetWidth+2,height:n.offsetHeight}),a=createTag("text",__spreadValues({x:n.offsetWidth/2,y:n.offsetHeight/2,style:`\n fill:${this.config.fontColor};\n text-anchor: middle;\n alignment-baseline:middle;\n opacity: ${this.config.opacity};\n font-size: ${r};\n `},t?{"font-family":t}:{}));return a.innerHTML=xssFilters.inHTMLData(i),document.body.removeChild(n),o.appendChild(a),"data:image/svg+xml;base64, "+gBase64.toBase64((new XMLSerializer).serializeToString(o))}_startRender(){switch(this.pauseAnimation=!1,this.config.displayType){case 0:this._fixedRender();break;case 1:this._startMove();break;case 2:this._startBlink()}this.observer[0]=this._attrObserver(this.img,["src","class"],"img"),this.observer[1]=this._attrObserver(this.wrap,["class","style","id"],"node"),this.observer[2]=this._attrObserver(this.root,["class","style"],"wrap"),this.observer[3]=this._domObserver(this.wrap),this.observer[4]=this._domObserver(this.root),this.observer[5]=this._domObserver(this.root.parentElement,!0)}_startMove(){var e;if(!this.img||!(null==(e=this.wrap)?void 0:e.clientWidth))return;const{offsetX:t,offsetY:i}=this._getOffset(),r=TICKER_STEP_NUM[this.config.tickerSpeed]||TICKER_STEP_NUM.MODERATE;let n=t,o=r,a=i,s=r;clearInterval(this.moveTimer),this.moveTimer=setInterval((()=>{if(this.pauseAnimation)return;const e=this._getOffsetThreshold();n+=o,a+=s,this.wrap.offsetWidth>this.img.offsetWidth&&n>this.wrap.offsetWidth&&(n=this.wrap.offsetWidth-this.img.offsetWidth),this.wrap.offsetHeight>this.img.offsetHeight&&a>this.wrap.offsetHeight&&(a=this.wrap.offsetHeight-this.img.offsetHeight),this.img.setAttribute("style",`position: relative;left:${n}px; top:${a}px`),n>=e.hRight&&(o=-r),n<=e.hLeft&&(o=r),a>=e.vBottom&&(s=-r),a<=e.vTop&&(s=r)}),30)}_startBlink(){const e=TICKER_SPEED_NUM[this.config.tickerSpeed]||TICKER_SPEED_NUM.MODERATE;clearInterval(this.blinkTimer),this._blinkRender(e,!0),this.blinkTimer=setInterval((()=>{this.pauseAnimation||this._blinkRender(e)}),1e3*e)}_randomBetween(e,t){const i=t-e+1;return Math.floor(Math.random()*i)+e}_fixedRender(){var e;if(!this.img||!(null==(e=this.wrap)?void 0:e.clientWidth))return;this.img.setAttribute("style","");const{offsetX:t,offsetY:i}=this._getOffset(),r=TICKER_SPEED_NUM[this.config.tickerSpeed];return r?this.img.setAttribute("style",`opacity: 0.1;transform: translate(${t}px, ${i}px);animation: _xg_animation_blink ${r}s linear infinite;`):this.img.setAttribute("style",`opacity: 1;transform: translate(${t}px, ${i}px);`)}_getOffset(){const{left:e,top:t,right:i,bottom:r}=this.config,{clientWidth:n,clientHeight:o}=this.wrap,{clientWidth:a,clientHeight:s}=this.img;let l=0,c=0;return void 0!==i&&n&&(l=n-a-i),void 0!==e&&n&&(l=e),void 0!==r&&o&&(c=o-s-r),void 0!==t&&o&&(c=t),{offsetX:l,offsetY:c}}_getOffsetThreshold(){const{clientWidth:e,clientHeight:t}=this.wrap,{clientWidth:i,clientHeight:r}=this.img;return{hLeft:e-i>=0?0:e-i,hRight:e-i>=0?e-i:0,vTop:t-r>=0?0:t-r,vBottom:t-r>=0?t-r:0}}_blinkRender(e,t){var i;if(!this.img||!(null==(i=this.wrap)?void 0:i.clientWidth))return;if(this.img.setAttribute("style","opacity: 0.1;"),t){const{offsetX:t,offsetY:i}=this._getOffset();return this.img.setAttribute("style",`opacity: 0.1;transform: translate(${t}px, ${i}px);animation: _xg_animation_blink ${e}s linear 1;`)}const r=this._getOffsetThreshold(),{clientWidth:n,clientHeight:o}=this.wrap,a=n?this._randomBetween(r.hLeft,r.hRight):0,s=o?this._randomBetween(r.vTop,r.vBottom):0;setTimeout((()=>{this.img.setAttribute("style",`opacity: 0.1;transform: translate(${a}px, ${s}px);animation: _xg_animation_blink ${e}s linear 1;`)}),10)}_attrObserver(e,t,i){if(!e||!this.wrap||!window.MutationObserver)return;const r=new window.MutationObserver((t=>{e&&this.wrap&&t.forEach((t=>{if("class"===t.attributeName&&e.getAttribute("class")!=defaultNodeConfig.class[i]&&e.setAttribute("class",defaultNodeConfig.class[i]),"style"===t.attributeName&&e.getAttribute("style")!=defaultNodeConfig.style[i]&&e.setAttribute("style",defaultNodeConfig.style[i]),"img"===i&&"src"===t.attributeName){if(((null==e?void 0:e.getAttribute("src"))||"")!==this.imgSrc){const t=this._getWatermarkDom();this.wrap&&t&&(this.imgSrc=t,e.setAttribute("src",t))}}}))}));return r.observe(e,{attributes:!0,attributeOldValue:!0,attributeFilter:t}),r}_domObserver(e,t){if(!e||!this.wrap)return;const i=new window.MutationObserver((i=>{e&&this.wrap&&i.forEach((i=>{i.removedNodes.forEach((i=>{if(!t)return e.appendChild(i);!e.getElementsByClassName(this.config.rootClassName).length&&e.appendChild(i)}))}))}));return i.observe(e,{childList:!0}),i}update(){const e=this._getWatermarkDom();this.wrap&&this.img&&e&&(this.imgSrc=e,this.img.setAttribute("src",e))}start(){if(!(this.root&&this.wrap&&this.img))return;clearInterval(this.moveTimer),clearInterval(this.blinkTimer),this.observer.forEach((e=>{var t;null==(t=null==e?void 0:e.disconnect)||t.call(e)})),this.wrap.innerHTML="",this.wrap.setAttribute("style",DEFAULT_STYLE_STRING);const e=this._getWatermarkDom();e&&(this.img.src=e,this.img.style.opacity="0",this.img.alt="",this.imgSrc=e,this.wrap.appendChild(this.img),setTimeout((()=>this._startRender())))}pause(){this.pauseAnimation=!0}resume(){this.pauseAnimation=!1}resize(){}destroy(){clearInterval(this.moveTimer),clearInterval(this.blinkTimer),this.observer.forEach((e=>{var t;null==(t=null==e?void 0:e.disconnect)||t.call(e)})),this.img=null,this.wrap.innerHTML="",this.wrap=null}}const ROOT_CLASS_NAME="xg-dynamic-watermark";class DynamicWatermarkPlugin extends Plugin{constructor(e){super(e),this.wm=null}static get pluginName(){return"DynamicWatermark"}static get defaultConfig(){return{position:Plugin.POSITIONS.ROOT,displayType:1,tickerSpeed:void 0,fontSize:12,fontColor:"#ffffff",opacity:.3,enable:!1,top:void 0,left:void 0,right:void 0,bottom:void 0,content:""}}afterCreate(){this.config.enable&&(this._initWatermark(),this.once(TIME_UPDATE,(()=>{this.start()})),this.on(VIDEO_RESIZE,(()=>{this.resize()})))}start(){var e,t;null==(t=null==(e=this.wm)?void 0:e.start)||t.call(e)}pause(){var e,t;null==(t=null==(e=this.wm)?void 0:e.pause)||t.call(e)}resume(){var e,t;null==(t=null==(e=this.wm)?void 0:e.resume)||t.call(e)}resize(){var e,t;null==(t=null==(e=this.wm)?void 0:e.resize)||t.call(e)}_initWatermark(){this.wm=new DynamicWatermark(__spreadProps(__spreadValues({},this.config),{root:this.root,rootClassName:ROOT_CLASS_NAME}))}destroy(){var e,t;null==(t=null==(e=this.wm)?void 0:e.destroy)||t.call(e),this.offAll()}render(){return`\n <xg-dynamic-watermark class=${ROOT_CLASS_NAME} />\n `}}class DefinitionDemotePlugin extends Plugin{constructor(e){super(e),this.waitings=[],this.longWaitingEmitTime=0,this.waitingStartTime=0,this.playerData=null,this.playerData=this.playerConfig.playerData}static get pluginName(){return"DefinitionDemotePlugin"}static get defaultConfig(){return{isNeedAutoDemote:!0,toastShowTime:3e3,demotePriority:[],isNeedShowTips:!0,oftenWaitingCount:3,oftenWaitingTime:5e3,longWaitingTime:5e3}}registerLanguageTexts(){return{definition_demote_txt:{jp:"現在のネットワークは不安定です。に切り替えることをお勧めします",en:"The current network is unstable, it is recommended to switch to ",zh:"当前网络不稳定,建议切换到","zh-hk":"當前網絡不穩定,建議切換到"}}}afterCreate(){this.bindCtx(),this.bindEvents()}bindCtx(){this._count=this._count.bind(this),this._time=this._time.bind(this),this._waiting=this._waiting.bind(this),this._clearTime=this._clearTime.bind(this),this.demote=this.demote.bind(this)}bindEvents(){this.on(WAITING,this._waiting),this.on(PAUSE,this._clearTime),this.on(PLAY,this._clearTime),this.on(DEFINITION_CHANGE,this._clearTime),this.on(PluginEvents.PlAY_URL_CHANGE,this._clearTime),this.config.isNeedAutoDemote&&this.player.on(PluginEvents.LONG_WAITING,this.demote)}_waiting(){this._count(),this._time()}_count(){const e=Date.now();this.waitings.push(e);const{oftenWaitingCount:t,oftenWaitingTime:i}=this.config;if(this.waitings.length>=t){const r=this.waitings.shift();r&&e-r<=i&&(VE_DEBUG.warn(`stuttering occurred at least ${t} times within ${i}ms`),this.player.emit(PluginEvents.OFTEN_WAITING)),this.clearState()}}_time(){if(this.timer)return void VE_DEBUG.log("The stuttering was triggered continuously, and the interval since the last stuttering was ",Date.now()-this.waitingStartTime+"ms");this.waitingStartTime=Date.now();const e=this.player.currentTime;this.timer=setTimeout((()=>{this.player&&this.player.currentTime<=e+.1&&(VE_DEBUG.warn(`stuttering last more than ${this.config.longWaitingTime}ms`),this.player.emit(PluginEvents.LONG_WAITING),this.timer&&(clearTimeout(this.timer),this.timer=null),this.waitingStartTime&&(this.waitingStartTime=0))}),this.config.longWaitingTime)}_clearTime(){this.waitingStartTime&&VE_DEBUG.log("stuttering last for ",Date.now()-this.waitingStartTime+"ms"),this.clearState()}clearState(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.waitings.length>0&&(this.waitings=[]),this.waitingStartTime&&(this.waitingStartTime=0)}demote(){if(!this.player.checkBuffer(this.player.currentTime,{endDiff:.5,startDiff:.5})&&!this.player.isSeeking&&this.player.state===STATES.RUNNING&&this.player.currentTime>1){if(!this.playerData)return;const e=this.playerData.getNextDefinition(!0,this.config.demotePriority),t=null==e?void 0:e[0];if(!t||!t.url)return;const i=t.definition;if(!i)return;const{current:{definition:r}}=this.playerData;if(this.player.emit(PluginEvents.DEFINITION_DEMOTE,{currentDef:r,willChangeDef:i,next:t}),"auto"===r){const e=t.url;VE_DEBUG.log(`auto demote definition to ${t.definition}`),this.changeUrl(e)}else i!==r&&this.showToast(t)}else VE_DEBUG.log("stuttering but not need demote definition")}changeUrl(e){this.player&&e&&(this.player.config.url=e,this.player.switchURL(e,{seamless:!this.player.config.isLive}).then((()=>{VE_DEBUG.log(`auto demote definition switch url(${e}) success`)})),this.player.emit(PluginEvents.PlAY_URL_CHANGE,{url:e,from:"definition_demote"}))}showToast(e){var t;const i=null==(t=this.player)?void 0:t.getPlugin("sdkToastPlugin");if(!i)return;if(this.toastId&&(i.remove(this.toastId),this.toastId=null),!this.config.isNeedShowTips)return;const r=this.i18n[e.definitionTextKey]||e.definitionTextKey||e.definition,n=util.createDom("div",this.langText.definition_demote_txt,void 0,"toast-txt"),o=util.createDom("span",r,void 0,"toast-txt-bt");n.appendChild(o),this.toastId=i.add(n,this.config.toastShowTime,!0),o.addEventListener("click",(()=>{this.playerData&&(this.playerData.current.definition=e.definition,i.remove(this.toastId),this.toastId=null,VE_DEBUG.log(`user handle demote definition to ${e.definition}`))}))}destroy(){this.clearState()}}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}const{POSITIONS:POSITIONS}=Plugin,MirrorStateKeys={GetMirror:"getMirror",ExitMirror:"exitMirror"};class MirrorPlugin extends Plugin{constructor(e){super(e),this.isEnableMirror=!0,this.isEnableMirror=this.config.defaultEnable}static get pluginName(){return"mirrorPlugin"}static get defaultConfig(){return{position:POSITIONS.CONTROLS_RIGHT,index:CONTROL_ICON_INDEX.mirrorPlugin,disable:!1,defaultEnable:!1}}afterCreate(){this.config.disable||(this.initIcons(),this.btnClick=this.btnClick.bind(this),this.bind(["touchend","click"],this.btnClick),this.updateMirrorState(this.isEnableMirror))}registerIcons(){return{[MirrorStateKeys.GetMirror]:{icon:GetMirrorSvg,class:"xg-get-mirror"},[MirrorStateKeys.ExitMirror]:{icon:ExitMirrorSvg,class:"xg-exit-mirror"}}}initIcons(){const{icons:e}=this,t=this.find(".xgplayer-icon");t.appendChild(e[MirrorStateKeys.GetMirror]),t.appendChild(e[MirrorStateKeys.ExitMirror])}registerLanguageTexts(){return{getMirror:{jp:"ミラーを開く",en:"Turn on mirroring",zh:"开启镜像","zh-hk":"開啟鏡像"},exitMirror:{jp:"ミラーを閉じる",en:"Turn off mirroring",zh:"关闭镜像","zh-hk":"關閉鏡像"}}}btnClick(e){e.preventDefault(),e.stopPropagation(),this.isEnableMirror?this.action(!1):this.action(!0)}action(e){this.isEnableMirror=e,this.updateMirrorState(this.isEnableMirror),this.player.emit(PluginEvents.MIRROR_CHANGE,this.isEnableMirror)}updateMirrorState(e){const t=this.player;e?t.addClass("xgplayer-mirror"):t.removeClass("xgplayer-mirror"),this.animate(e)}animate(e){this.root&&(e?this.setAttr("data-state","enable"):this.setAttr("data-state","normal"),this.switchTips(e))}switchTips(e){this.changeLangTextKey(this.find(".xg-tips"),e?MirrorStateKeys.ExitMirror:MirrorStateKeys.GetMirror)}destroy(){this.unbind(["click","touchend"],this.btnClick)}render(){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">${this.langText[MirrorStateKeys.GetMirror]}</div>\n </xg-icon>`}}function retPromise(e){return e&&e.then?e:new Promise((t=>{t(e)}))}class MemoryPlay extends Plugin{constructor(e){super(e),this.memoryId="",this.shouldShowToast=!1,this.saveTimeFun=util.checkIsFunction(this.config.saveTime)?this.config.saveTime:this.saveTimeByStorage,this.getTimeFun=util.checkIsFunction(this.config.getTime)?this.config.getTime:this.getTimeByStorage,this.startTime=0,this.memoryId=this.config.memoryId,this.showToast=this.showToast.bind(this),this.saveTime=this.saveTime.bind(this),this.visibilitychangeCallback=this.visibilitychangeCallback.bind(this)}static get pluginName(){return"memoryPlay"}static get defaultConfig(){return{getTime:null,saveTime:null,memoryId:"",minStartTime:1,minEndTime:1}}registerLanguageTexts(){return{preText:{jp:"に位置付けられました",en:"Has located for you to ",zh:"已为您定位至","zh-hk":"已為您定位至"}}}children(){return{toast:ToastPlugin$1}}afterCreate(){this.once(SEEKED,this.showToast),this.on(TIME_UPDATE,(()=>{this.curTime=this.player.currentTime}))}beforePlayerInit(){return this.memoryId||(this.playerConfig.vid?this.memoryId=this.playerConfig.vid:this.player.url&&(this.memoryId=this.player.url.replace(/\?.*$/,""))),this.setSave(),this.getTime()}getTime(){return new Promise((e=>{retPromise(this.getTimeFun(this.memoryId)).then((t=>{var i,r,n,o,a,s;const l=getFloatNumber(t);!isNaN(l)&&l>0?(this.startTime=l,this.shouldShowToast=!0,this.playerConfig.startTime=this.startTime,(null==(n=null==(r=null==(i=this.player.plugins)?void 0:i.hls)?void 0:r.hls)?void 0:n.config)&&(this.player.plugins.hls.hls.config.startTime=this.startTime),(null==(s=null==(a=null==(o=this.player.plugins)?void 0:o.encrypthlsplugin)?void 0:a.hls)?void 0:s.config)&&(this.player.plugins.encrypthlsplugin.hls.config.startTime=this.startTime)):VE_DEBUG.warn("the time got is invalid",t),e()})).catch((t=>{VE_DEBUG.error("getTime function occur error",t),e()}))}))}saveTime(){var e;if(!this.player)return;const{minStartTime:t=1,minEndTime:i=1}=this.config,{currentTime:r,duration:n}=this.player,o=null!=(e=null!=r?r:this.curTime)?e:0;n&&(o<t||Math.abs(n-o)<i?this.saveTimeFun(this.memoryId,0):this.saveTimeFun(this.memoryId,o))}visibilitychangeCallback(){"hidden"===document.visibilityState&&this.saveTime()}setSave(){this.on(ENDED,this.saveTime.bind(this)),this.on(ERROR$1,this.saveTime.bind(this)),document.addEventListener("visibilitychange",this.visibilitychangeCallback.bind(this)),document.addEventListener("pagehide",this.saveTime.bind(this)),window.addEventListener("beforeunload",this.saveTime.bind(this))}showToast(){var e;if(this.shouldShowToast){this.shouldShowToast=!1;const t=null==(e=this.player)?void 0:e.getPlugin("sdkToastPlugin");if(!t)return;if(this.startTime>0){const e=util.format(this.startTime);t.add(`${this.langText.preText}${e}`,4e3,!0)}}}saveTimeByStorage(e,t){saveInfoByStorage(e,MemoryPlay.pluginName,t+"")}getTimeByStorage(e){return getInfoByStorage(e,MemoryPlay.pluginName)||0}destroy(){this.saveTime(),document.removeEventListener("visibilitychange",this.visibilitychangeCallback),document.removeEventListener("pagehide",this.saveTime),window.removeEventListener("beforeunload",this.saveTime)}}function NoPosterSvg(){return(new DOMParser).parseFromString('<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g filter="url(#filter0_dii_340_912)">\n<path d="M4.00011 7.66678C4.00005 5.82578 5.49245 4.33333 7.33344 4.33333H23.3742H32.6657C34.5066 4.33333 35.999 5.82572 35.999 7.66667V13.5764L35.9998 32.3332C35.9999 34.1742 34.5075 35.6667 32.6665 35.6667H7.33423C5.49332 35.6667 4.00096 34.1743 4.0009 32.3334L4.00011 7.66678Z" fill="url(#paint0_linear_340_912)"/>\n<path d="M4.10011 7.66677C4.10005 5.88101 5.54768 4.43333 7.33344 4.43333H23.3742H32.6657C34.4514 4.43333 35.899 5.88095 35.899 7.66667V13.5764L35.8998 32.3332C35.8999 34.119 34.4523 35.5667 32.6665 35.5667H7.33423C5.54855 35.5667 4.10095 34.1191 4.1009 32.3334L4.10011 7.66677Z" stroke="url(#paint1_linear_340_912)" stroke-width="0.2"/>\n</g>\n<path d="M6.76669 9.66667C6.76669 8.24914 7.91582 7.1 9.33335 7.1H30.6667C32.0842 7.1 33.2334 8.24914 33.2334 9.66667V30.3333C33.2334 31.7509 32.0842 32.9 30.6667 32.9H9.33335C7.91582 32.9 6.76669 31.7509 6.76669 30.3333V9.66667Z" fill="url(#paint2_linear_340_912)" stroke="url(#paint3_linear_340_912)" stroke-width="0.2"/>\n<g filter="url(#filter1_dii_340_912)">\n<path d="M15.4689 18.4428L10.9398 27.4593C10.6614 28.0134 11.0643 28.6667 11.6845 28.6667H27.8647C28.5118 28.6667 28.912 27.9614 28.5801 27.4059L25.3326 21.9703C25.0217 21.4499 24.2769 21.425 23.932 21.9235L21.1839 25.8946C21.1128 25.9973 20.9581 25.9882 20.8996 25.8778L16.9499 18.4266C16.6329 17.8285 15.7728 17.8379 15.4689 18.4428Z" fill="url(#paint4_linear_340_912)"/>\n<path d="M15.4689 18.4428L10.9398 27.4593C10.6614 28.0134 11.0643 28.6667 11.6845 28.6667H27.8647C28.5118 28.6667 28.912 27.9614 28.5801 27.4059L25.3326 21.9703C25.0217 21.4499 24.2769 21.425 23.932 21.9235L21.1839 25.8946C21.1128 25.9973 20.9581 25.9882 20.8996 25.8778L16.9499 18.4266C16.6329 17.8285 15.7728 17.8379 15.4689 18.4428Z" stroke="url(#paint5_linear_340_912)" stroke-width="0.166667"/>\n</g>\n<g filter="url(#filter2_dii_340_912)">\n<circle cx="23.6667" cy="14.6667" r="2" fill="url(#paint6_linear_340_912)"/>\n<circle cx="23.6667" cy="14.6667" r="2" stroke="url(#paint7_linear_340_912)" stroke-width="0.166667"/>\n</g>\n<defs>\n<filter id="filter0_dii_340_912" x="3.8431" y="4.17631" width="32.6278" height="32.1184" 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 dx="0.157018" dy="0.314036"/>\n<feGaussianBlur stdDeviation="0.157018"/>\n<feComposite in2="hardAlpha" operator="out"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.0684375 0 0 0 0 0.0704062 0 0 0 0 0.075 0 0 0 0.5 0"/>\n<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_340_912"/>\n<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_340_912" result="shape"/>\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 dx="0.471054" dy="0.471054"/>\n<feGaussianBlur stdDeviation="0.157018"/>\n<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.355764 0 0 0 0 0.368819 0 0 0 0 0.391667 0 0 0 1 0"/>\n<feBlend mode="normal" in2="shape" result="effect2_innerShadow_340_912"/>\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 dx="-0.471054" dy="-0.471054"/>\n<feGaussianBlur stdDeviation="0.0785089"/>\n<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.191389 0 0 0 0 0.197708 0 0 0 0 0.216667 0 0 0 1 0"/>\n<feBlend mode="normal" in2="effect2_innerShadow_340_912" result="effect3_innerShadow_340_912"/>\n</filter>\n<filter id="filter1_dii_340_912" x="10.4333" y="17.5669" width="18.6828" height="11.6831" 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="0.166667"/>\n<feGaussianBlur stdDeviation="0.166667"/>\n<feComposite in2="hardAlpha" operator="out"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.0823529 0 0 0 0 0.0901961 0 0 0 0 0.105882 0 0 0 1 0"/>\n<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_340_912"/>\n<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_340_912" result="shape"/>\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 dx="0.166667"/>\n<feGaussianBlur stdDeviation="0.166667"/>\n<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.930313 0 0 0 0 0.935083 0 0 0 0 0.954167 0 0 0 1 0"/>\n<feBlend mode="normal" in2="shape" result="effect2_innerShadow_340_912"/>\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 dx="-0.166667" dy="-0.333333"/>\n<feGaussianBlur stdDeviation="0.166667"/>\n<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.409097 0 0 0 0 0.443509 0 0 0 0 0.570833 0 0 0 1 0"/>\n<feBlend mode="normal" in2="effect2_innerShadow_340_912" result="effect3_innerShadow_340_912"/>\n</filter>\n<filter id="filter2_dii_340_912" x="21.25" y="12.25" width="4.83329" height="5.00001" 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="0.166667"/>\n<feGaussianBlur stdDeviation="0.166667"/>\n<feComposite in2="hardAlpha" operator="out"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.0823529 0 0 0 0 0.0901961 0 0 0 0 0.105882 0 0 0 1 0"/>\n<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_340_912"/>\n<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_340_912" result="shape"/>\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 dx="0.166667"/>\n<feGaussianBlur stdDeviation="0.166667"/>\n<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.930313 0 0 0 0 0.935083 0 0 0 0 0.954167 0 0 0 1 0"/>\n<feBlend mode="normal" in2="shape" result="effect2_innerShadow_340_912"/>\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 dx="-0.166667" dy="-0.333333"/>\n<feGaussianBlur stdDeviation="0.166667"/>\n<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.364583 0 0 0 0 0.397828 0 0 0 0 0.520833 0 0 0 1 0"/>\n<feBlend mode="normal" in2="effect2_innerShadow_340_912" result="effect3_innerShadow_340_912"/>\n</filter>\n<linearGradient id="paint0_linear_340_912" x1="30.2254" y1="8.17498" x2="11.4982" y2="41.5657" gradientUnits="userSpaceOnUse">\n<stop stop-color="#434548"/>\n<stop offset="0.855332" stop-color="#3E3F42"/>\n</linearGradient>\n<linearGradient id="paint1_linear_340_912" x1="7.52649" y1="1.8673" x2="25.0283" y2="33.3887" gradientUnits="userSpaceOnUse">\n<stop stop-color="#383838"/>\n<stop offset="0.192009" stop-color="#45484D"/>\n<stop offset="0.703503" stop-color="#37393D"/>\n<stop offset="0.962692" stop-color="#1B1C1E"/>\n</linearGradient>\n<linearGradient id="paint2_linear_340_912" x1="28.5212" y1="10.1877" x2="13.0162" y2="37.9513" gradientUnits="userSpaceOnUse">\n<stop stop-color="#2E2F32"/>\n<stop offset="0.855332" stop-color="#242528"/>\n</linearGradient>\n<linearGradient id="paint3_linear_340_912" x1="9.60543" y1="4.95372" x2="24.0954" y2="31.1622" gradientUnits="userSpaceOnUse">\n<stop stop-color="#1F2124"/>\n<stop offset="0.192009" stop-color="#282B30"/>\n<stop offset="0.703503" stop-color="#27292F"/>\n<stop offset="0.962692" stop-color="#1D1F23"/>\n</linearGradient>\n<linearGradient id="paint4_linear_340_912" x1="16.969" y1="16.5412" x2="22.5457" y2="28.6249" gradientUnits="userSpaceOnUse">\n<stop stop-color="#C7CCE2"/>\n<stop offset="1" stop-color="#8B95BC"/>\n</linearGradient>\n<linearGradient id="paint5_linear_340_912" x1="17.5125" y1="20.3581" x2="20.121" y2="28.4669" gradientUnits="userSpaceOnUse">\n<stop offset="0.181113" stop-color="#B1B7D3"/>\n<stop offset="1" stop-color="#535C80"/>\n</linearGradient>\n<linearGradient id="paint6_linear_340_912" x1="23.0637" y1="12.5093" x2="25.4773" y2="15.7207" gradientUnits="userSpaceOnUse">\n<stop stop-color="#B8BED6"/>\n<stop offset="1" stop-color="#7E88AD"/>\n</linearGradient>\n<linearGradient id="paint7_linear_340_912" x1="23.1781" y1="13.818" x2="24.4392" y2="16.2252" gradientUnits="userSpaceOnUse">\n<stop offset="0.181113" stop-color="#B1B7D3"/>\n<stop offset="1" stop-color="#495274"/>\n</linearGradient>\n</defs>\n</svg>\n',"image/svg+xml").firstChild}class PlayList{constructor(e){this.config=e.config,this.parent=e.root,this.root=util.createDom("ul","",{},`xg-play-list xg-list-slide-scroll ${this.config.className}`);const t="mobile"===sniffer.device?"touchend":"click";this.modal=util.createDom("div","",{},"xg-play-list-modal"),this.modal.appendChild(this.root),e.root.appendChild(this.modal),this._delegates=Plugin.delegate.call(this,this.modal,".xg-play-list-modal",t,this.modalClick.bind(this));const{maxHeight:i}=this.config;i&&this.setStyle({maxHeight:i}),this.onItemClick=this.onItemClick.bind(this),this.renderItemList(),this._delegates.concat(Plugin.delegate.call(this,this.root,"li",t,this.onItemClick))}renderItemList(e){const{config:t,root:i}=this;e?t.data=e:e=t.data,t.style&&Object.keys(t.style).map((e=>{i.style[e]=t[e]})),e.length>0&&(this.attrKeys=Object.keys(e[0])),this.root.innerHTML="",e.map(((e,t)=>{const i=e.selected?"xg-play-list-item selected":"xg-play-list-item";e["data-index"]=t;const r=e.duration?util.format(e.duration):"",n=`\n <div style="${e.poster?`background-image: url('${e.poster}')`:""}" class="xg-play-list-poster ${e.selected?"is-active":""} ${e.poster?"":"no-poster"}" >\n <div class="bg"></div>\n <div class="icon"></div>\n <div class="duration">${r}</div>\n <duv class="playing">\n <div class="icon-wrap">\n <div class="icon-line"></div>\n <div class="icon-line"></div>\n <div class="icon-line"></div>\n <div class="icon-line"></div>\n </div>\n </duv>\n </div>\n <div class="xg-play-list-title">\n <div class="xg-play-list-title-text">${e.title}</div>\n </div>\n `,o=util.createDom("li",n,e,i),a=util.findDom(o,".bg"),s=null==NoPosterSvg?void 0:NoPosterSvg();!e.poster&&s&&a.appendChild(s),this.root.appendChild(o)}));const r=e.findIndex((e=>e.selected));if(r>=0){const t=util.findDom(this.root,".xg-play-list-item.selected");if(!t)return;const{height:i}=t.getBoundingClientRect(),{height:n}=this.root.getBoundingClientRect(),o=(e.length-r)*i,a=i*e.length;this.root.scrollTop=o<n?a-n:r*i}}onItemClick(e){e.delegateTarget||(e.delegateTarget=e.target);const t=e.delegateTarget;if(t&&util.hasClass(t,"selected"))return!1;const i="function"==typeof this.config.onItemClick?this.config.onItemClick:null,r=this.root.querySelector(".selected");util.addClass(t,"selected"),r&&util.removeClass(r,"selected"),i&&i(e,{from:r?this.getAttrObj(r,this.attrKeys):null,to:this.getAttrObj(t,this.attrKeys)})}getAttrObj(e,t){if(!e||!t)return{};const i={};t.map((t=>{i[t]=e.getAttribute(t)}));const r=e.getAttribute("data-index");return r&&(i.index=Number(r)),i}show(){util.removeClass(this.modal,"hide"),util.addClass(this.modal,"active"),util.removeClass(this.root,"hide"),util.addClass(this.root,"active")}hide(){util.removeClass(this.modal,"active"),util.addClass(this.modal,"hide"),util.removeClass(this.root,"active"),util.addClass(this.root,"hide")}modalClick(e){e.stopPropagation(),this.hide();const t="function"==typeof this.config.onModalClick?this.config.onModalClick:null;t&&t(e)}setStyle(e){Object.keys(e).forEach((t=>{this.root.style[t]=e[t]}))}destroy(){this._delegates&&(this._delegates.map((e=>{e.destroy&&e.destroy()})),this._delegates=null),this.root.parentNode.removeChild(this.root),this.root.innerHTML=null,this.root=null}}function PlayNextBtnSvg(){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 d="M12.8499 8.49494C13.7054 8.98885 14.1331 9.23581 14.2767 9.55822C14.4019 9.83944 14.4019 10.1606 14.2767 10.4418C14.1331 10.7642 13.7054 11.0112 12.8499 11.5051L6.65863 15.0796C5.80315 15.5735 5.37542 15.8205 5.02442 15.7836C4.71827 15.7514 4.44016 15.5909 4.25921 15.3418C4.05177 15.0563 4.05177 14.5624 4.05177 13.5746V6.42547C4.05177 5.43765 4.05177 4.94374 4.25921 4.65822C4.44016 4.40917 4.71827 4.2486 5.02442 4.21642C5.37542 4.17953 5.80315 4.42649 6.65863 4.92039L12.8499 8.49494Z" fill="white"/>\n<rect x="13.8274" y="4.02594" width="2.17238" height="11.9481" rx="0.814644" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}function PlayListBtnSvg(){return(new DOMParser).parseFromString('<svg width="21" height="22" viewBox="0 0 21 22" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g filter="url(#filter0_d_126_721)">\n<path d="M8.18979 6.3414C8.60304 6.57999 8.80967 6.69928 8.87901 6.85503C8.93949 6.99088 8.93949 7.14601 8.87901 7.28186C8.80967 7.4376 8.60304 7.5569 8.18979 7.79549L5.59253 9.29502C5.17928 9.53361 4.97266 9.6529 4.80311 9.63508C4.65522 9.61954 4.52087 9.54197 4.43346 9.42167C4.33325 9.28374 4.33325 9.04515 4.33325 8.56797V5.56891C4.33325 5.09173 4.33325 4.85314 4.43346 4.71522C4.52087 4.59491 4.65522 4.51735 4.80311 4.5018C4.97266 4.48398 5.17928 4.60328 5.59253 4.84187L8.18979 6.3414Z" fill="white"/>\n</g>\n<path d="M11.5264 7.19745H18" stroke="white" stroke-width="1.61843" stroke-linecap="round"/>\n<path d="M5.05273 12.5922L18.0001 12.5922" stroke="white" stroke-width="1.61843" stroke-linecap="round"/>\n<path d="M5.05273 17.9869L18.0001 17.9869" stroke="white" stroke-width="1.61843" stroke-linecap="round"/>\n<defs>\n<filter id="filter0_d_126_721" x="0.736733" y="0.903543" width="11.7841" height="12.3298" 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/>\n<feGaussianBlur stdDeviation="1.79826"/>\n<feComposite in2="hardAlpha" operator="out"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.08 0"/>\n<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_126_721"/>\n<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_126_721" result="shape"/>\n</filter>\n</defs>\n</svg>\n',"image/svg+xml").firstChild}const PlatListBtnKeys={PlayListNext:"playListNext",PlayListToggle:"playListToggle"},IS_MOBILE="mobile"===sniffer.device;function formatList(e=[]){if(!Array.isArray(e))return[];return e.filter((e=>e.url||e.playAuthToken)).map(((e,t)=>{const i=__spreadValues({},e||{});return i.vid||(i.vid=""+t),i}))}function getIndex(e=[],t=0){const i=Number(t),r=Number.isNaN(i)?0:i;let n=0;return n=r<=0?0:r<e.length?r:0,n<0?0:n}function setVodPlayListConfig(e){if(!(e.plugins||[]).find((e=>e.pluginName===PlayListPlugin.pluginName)))return;const t=getPluginConfig(e,"playListPlugin");if(t&&isObject$e(t)){const{list:i=[],defaultIndex:r=0}=t,n=formatList(i),o=getIndex(n,r),a=null==n?void 0:n[o];if(a){const{url:t,poster:i,playAuthToken:r}=a;r?e.getVideoByToken=__spreadProps(__spreadValues({},e.getVideoByToken||{}),{playAuthToken:r}):t&&(e.url=t),i&&(e.poster=i)}}}PlayerData.prototype.setVodPlayListConfig=setVodPlayListConfig;class PlayListPlugin extends Plugin{constructor(){super(...arguments),this.timer=null,this.onEnter=e=>{e.stopPropagation(),this.emit("icon_mouseenter",{pluginName:this.pluginName}),this.switchActiveState(e)},this.switchActiveState=e=>{e.stopPropagation();const{toggleMode:t}=this.config;"click"===t?this.toggle(!this.isActive):this.toggle(!0)},this.handleNext=e=>{e.stopPropagation(),this.next()},this._onTimeUpdate=()=>{const{player:e}=this;!this.halfPass&&e.currentTime>e.duration/2&&this.confirmOrder()},this._onEnded=()=>{if("order"===this.mode&&this.curIndex+1>=this.list.length)return this.player.pause(),void(this.player.currentTime=0);this.next()},this.onLeave=e=>{e.stopPropagation(),this.emit("icon_mouseleave",{pluginName:this.pluginName}),this.isActive&&this.toggle(!1)}}static get pluginName(){return"playListPlugin"}static get defaultConfig(){return{position:Plugin.POSITIONS.CONTROLS_LEFT,index:CONTROL_LEFT_ICON_INDEX.playListPlugin,list:[],mode:"order",defaultIndex:0,isItemClickHide:!0,toggleMode:"click"}}beforeCreate(e){Object.values(Plugin.POSITIONS).includes(e.position)||(e.root=e.player.controls.left,e.config.position=Plugin.POSITIONS.CONTROLS_LEFT,e.position=Plugin.POSITIONS.CONTROLS_LEFT)}afterCreate(){const{config:e}=this,{list:t=[],mode:i,defaultIndex:r}=e||{};this.initIcons(),this.halfPass=!1,this.list=formatList(t),this.timer=setTimeout((()=>{this.emit(PluginEvents.PLAY_LIST_CHANGE,this.list)})),this.disable=!(t.length>0),this.mode=i,this.curIndex=getIndex(this.list,r),this.curIndex>0?(this.nextIndex=this.curIndex+1<this.list.length?this.curIndex+1:0,this.prevIndex=this.curIndex-1):(this.nextIndex=1,this.prevIndex=this.list.length-1),this.on(TIME_UPDATE,this._onTimeUpdate),this.on(ENDED,this._onEnded),this.on([VIDEO_RESIZE,FULLSCREEN_CHANGE],(()=>{this._resizeList()})),this.once(CANPLAY,(()=>{this.list&&this.list.length>0&&(this.renderItemList(),this.show())})),IS_MOBILE&&this.on(PLAYER_FOCUS,(()=>{this.isActive&&(this.optionsList&&this.optionsList.hide(),this.isActive=!1)})),IS_MOBILE?(e.toggleMode="click",this.activeEvent="touchend"):this.activeEvent="click"===e.toggleMode?"click":"mouseenter",this.bind(".xg-play-next-btn","click",this.handleNext),"click"===e.toggleMode?this.bind(".xg-play-list-btn",this.activeEvent,this.switchActiveState):(this.bind(".xg-play-list-btn",this.activeEvent,this.onEnter),this.bind(".xg-play-list-btn","mouseleave",this.onLeave))}registerLanguageTexts(){return{playNext:{jp:"次に遊ぶ",en:"play next",zh:"播放下一个","zh-hk":"播放下一個"},playList:{jp:"プレイリスト",en:"playList",zh:"播放列表","zh-hk":"播放清單"}}}registerIcons(){return{[PlatListBtnKeys.PlayListNext]:{icon:PlayNextBtnSvg,class:"xg-play-next-btn"},[PlatListBtnKeys.PlayListToggle]:{icon:PlayListBtnSvg,class:"xg-play-list-btn"}}}initIcons(){const{icons:e}=this;this.appendChild(".xg-play-next-btn",e[PlatListBtnKeys.PlayListNext]),this.appendChild(".xg-play-list-btn",e[PlatListBtnKeys.PlayListToggle])}show(){!this.list||this.list.length<1||util.addClass(this.root,"show")}hide(){util.removeClass(this.root,"show")}prev(){this.disable||(this.halfPass||(this.halfPass=!0,this._prevCompute()),this.curIndex=this.prevIndex,this.change())}next(){this.disable||(this.halfPass||(this.halfPass=!0,this._nextCompute()),this.curIndex=this.nextIndex,this.change())}changeList(e){this.player.currentTime=0,this.list=formatList(e),this.nextIndex=0,this.curIndex=0,this.change(),this.disable=!(this.list.length>0),this.emit(PluginEvents.PLAY_LIST_CHANGE,this.list)}setIndex(e){e<0||e>=this.list.length||(this.nextIndex=e+1<this.list.length?e+1:0,this.prevIndex=e-1<0?this.list.length-1:e-1,this.curIndex=e,this.change())}change(){if(this.disable)return;const{player:e,list:t,curIndex:i}=this;this.halfPass=!1;const{url:r,playAuthToken:n,title:o="",vid:a="",poster:s=""}=t[i];this.curInfo={url:r,playAuthToken:n,title:o,vid:a,poster:s};const l=e.sdk||e;n?l.playNext({vid:a,poster:s,autoplay:!0,getVideoByToken:{playAuthToken:n}}):l.playNext({vid:a,poster:s,autoplay:!0,url:r}),this.renderItemList(),e.off("timeupdate",this._emitChange.bind(this)),e.once("timeupdate",this._emitChange.bind(this))}confirmOrder(){this.halfPass=!0,this._nextCompute(),this._prevCompute()}_nextCompute(){this.disable||(this.curIndex+1<this.list.length?this.nextIndex=this.curIndex+1:this.nextIndex=0)}_prevCompute(){this.disable||(this.curIndex-1>=0?this.prevIndex=this.curIndex-1:this.prevIndex=this.list.length-1)}_emitChange(){this.emit(PluginEvents.PLAY_LIST_ITEM_CHANGE,this.curInfo)}toggle(e){if(e===this.isActive)return;const{controls:t}=this.player;e?(t.blur(),this.optionsList&&this.optionsList.show()):(t.focus(),this.optionsList&&this.optionsList.hide()),this.isActive=e}onItemClick(e,t){e.stopPropagation(),this.curIndex=t.to.index,this.change(),this.toggle(!1)}renderItemList(e){const{list:t,config:i,optionsList:r,player:n}=this;"number"==typeof e&&(this.curIndex=e,this.curInfo=t[e]);const o=t.map(((t,i)=>{const r=__spreadProps(__spreadValues({},t),{selected:!1});return i===this.curIndex&&(r.selected=!0,e=i),r}));if(r)return void r.renderItemList(o);const a={config:{data:o,className:"xg-side-play-list",onItemClick:(e,t)=>{this.onItemClick(e,t)},onModalClick:()=>{this.toggle(!1)}},root:n.innerContainer||n.root},{height:s}=this.player.root.getBoundingClientRect(),l=s;l&&i.heightLimit&&(a.config.maxHeight=`${l}px`),this.optionsList=new PlayList(a),this.show(),this._resizeList()}_resizeList(){if(!this.config.heightLimit)return;const{height:e}=this.player.root.getBoundingClientRect(),t=e;this.optionsList&&this.optionsList.setStyle({maxHeight:`${t}px`})}destroy(){const{config:e}=this;"click"===e.toggleMode?this.unbind(this.activeEvent,this.switchActiveState):(this.unbind(this.activeEvent,this.onEnter),this.unbind("mouseleave",this.onLeave)),this.optionsList&&(this.optionsList.destroy(),this.optionsList=null),this.timer&&(clearTimeout(this.timer),this.timer=null)}set disable(e){this._disable=e,e?(this.hide(),this.optionsList&&this.optionsList.hide()):this.show()}get disable(){return this._disable}render(){if(!this.disable)return`<xg-icon class="xg-options-icon xg-play-list-btn-container ${this.config.className||""}">\n <div class="xgplayer-icon xg-play-next-btn">\n <div class="xg-tips" lang-key="playNext">${this.langText.playNext}</div>\n </div>\n <div class="xgplayer-icon xg-play-list-btn">\n <div class="xg-tips" lang-key="playList">${this.langText.playList}</div>\n </div>\n </xg-icon>`}}const index="",LiteVePlayer=Object.assign(VePlayer$1,{Events:Events$1,Event:Event$1,DefinitionDemotePlugin:DefinitionDemotePlugin,MirrorPlugin:MirrorPlugin,MemoryPlay:MemoryPlay,Subtitle:Subtitle,DynamicWatermarkPlugin:DynamicWatermarkPlugin,PlayListPlugin:PlayListPlugin,getI18N:getI18N,BasePlugin:BasePlugin,Plugin:Plugin,Sniffer:sniffer,Util:util,STATE_CLASS:STATE_CLASS,I18N:I18N,STATES:STATES});export{BasePlugin,CodecType,ContentType,DefinitionDemotePlugin,DynamicWatermarkPlugin,EAudioFormat,EDRMTYPE,EVideoFormat,Event$1 as Event,Events$1 as Events,I18N,MemoryPlay,MirrorPlugin,POSITIONS$8 as POSITIONS,PlayListPlugin,Plugin,STATES,STATE_CLASS,sniffer as Sniffer,Subtitle,UmdKeys,util as Util,LiteVePlayer as default,getI18N};