@byteplus/veplayer-plugin 2.8.0-rc.6 → 2.8.0-rc.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/index.development.js +8632 -4331
- package/esm/index.production.js +5 -5
- package/esm/veplayer.plugin.ad.development.js +1412 -1398
- package/esm/veplayer.plugin.ad.production.js +2 -2
- package/esm/veplayer.plugin.rtm.development.js +112 -50
- package/esm/veplayer.plugin.rtm.production.js +1 -1
- package/package.json +1 -1
- package/umd/veplayer.plugin.ad.development.js +1412 -1398
- package/umd/veplayer.plugin.ad.production.js +1 -1
- package/umd/veplayer.plugin.rtm.development.js +112 -50
- package/umd/veplayer.plugin.rtm.production.js +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var check=function(e){return e&&e.Math==Math&&e},global$s=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof commonjsGlobal&&commonjsGlobal)||function(){return this}()||commonjsGlobal||Function("return this")(),fails$B=function(e){try{return!!e()}catch(e){return!0}},fails$A=fails$B,functionBindNative=!fails$A((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),NATIVE_BIND$4=functionBindNative,FunctionPrototype$3=Function.prototype,apply$7=FunctionPrototype$3.apply,call$r=FunctionPrototype$3.call,functionApply="object"==typeof Reflect&&Reflect.apply||(NATIVE_BIND$4?call$r.bind(apply$7):function(){return call$r.apply(apply$7,arguments)}),NATIVE_BIND$3=functionBindNative,FunctionPrototype$2=Function.prototype,call$q=FunctionPrototype$2.call,uncurryThisWithBind=NATIVE_BIND$3&&FunctionPrototype$2.bind.bind(call$q,call$q),functionUncurryThis=NATIVE_BIND$3?uncurryThisWithBind:function(e){return function(){return call$q.apply(e,arguments)}},uncurryThis$D=functionUncurryThis,toString$h=uncurryThis$D({}.toString),stringSlice$5=uncurryThis$D("".slice),classofRaw$2=function(e){return stringSlice$5(toString$h(e),8,-1)},classofRaw$1=classofRaw$2,uncurryThis$C=functionUncurryThis,functionUncurryThisClause=function(e){if("Function"===classofRaw$1(e))return uncurryThis$C(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$q=$documentAll$1.IS_HTMLDDA?function(e){return"function"==typeof e||e===documentAll$1}:function(e){return"function"==typeof e},objectGetOwnPropertyDescriptor={},fails$z=fails$B,descriptors$2=!fails$z((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),NATIVE_BIND$2=functionBindNative,call$p=Function.prototype.call,functionCall=NATIVE_BIND$2?call$p.bind(call$p):function(){return call$p.apply(call$p,arguments)},objectPropertyIsEnumerable={},$propertyIsEnumerable$2={}.propertyIsEnumerable,getOwnPropertyDescriptor$b=Object.getOwnPropertyDescriptor,NASHORN_BUG=getOwnPropertyDescriptor$b&&!$propertyIsEnumerable$2.call({1:2},1);objectPropertyIsEnumerable.f=NASHORN_BUG?function(e){var t=getOwnPropertyDescriptor$b(this,e);return!!t&&t.enumerable}:$propertyIsEnumerable$2;var match,version,createPropertyDescriptor$8=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},uncurryThis$B=functionUncurryThis,fails$y=fails$B,classof$e=classofRaw$2,$Object$4=Object,split$3=uncurryThis$B("".split),indexedObject=fails$y((function(){return!$Object$4("z").propertyIsEnumerable(0)}))?function(e){return"String"==classof$e(e)?split$3(e,""):$Object$4(e)}:$Object$4,isNullOrUndefined$6=function(e){return null==e},isNullOrUndefined$5=isNullOrUndefined$6,$TypeError$k=TypeError,requireObjectCoercible$8=function(e){if(isNullOrUndefined$5(e))throw $TypeError$k("Can't call method on "+e);return e},IndexedObject$3=indexedObject,requireObjectCoercible$7=requireObjectCoercible$8,toIndexedObject$c=function(e){return IndexedObject$3(requireObjectCoercible$7(e))},isCallable$p=isCallable$q,$documentAll=documentAll_1,documentAll=$documentAll.all,isObject$l=$documentAll.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:isCallable$p(e)||e===documentAll}:function(e){return"object"==typeof e?null!==e:isCallable$p(e)},path$y={},path$x=path$y,global$r=global$s,isCallable$o=isCallable$q,aFunction=function(e){return isCallable$o(e)?e:void 0},getBuiltIn$h=function(e,t){return arguments.length<2?aFunction(path$x[e])||aFunction(global$r[e]):path$x[e]&&path$x[e][t]||global$r[e]&&global$r[e][t]},uncurryThis$A=functionUncurryThis,objectIsPrototypeOf=uncurryThis$A({}.isPrototypeOf),engineUserAgent="undefined"!=typeof navigator&&String(navigator.userAgent)||"",global$q=global$s,userAgent$6=engineUserAgent,process$4=global$q.process,Deno$1=global$q.Deno,versions=process$4&&process$4.versions||Deno$1&&Deno$1.version,v8=versions&&versions.v8;v8&&(version=(match=v8.split("."))[0]>0&&match[0]<4?1:+(match[0]+match[1])),!version&&userAgent$6&&(!(match=userAgent$6.match(/Edge\/(\d+)/))||match[1]>=74)&&(match=userAgent$6.match(/Chrome\/(\d+)/))&&(version=+match[1]);var engineV8Version=version,V8_VERSION$3=engineV8Version,fails$x=fails$B,global$p=global$s,$String$5=global$p.String,symbolConstructorDetection=!!Object.getOwnPropertySymbols&&!fails$x((function(){var e=Symbol();return!$String$5(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&V8_VERSION$3&&V8_VERSION$3<41})),NATIVE_SYMBOL$5=symbolConstructorDetection,useSymbolAsUid=NATIVE_SYMBOL$5&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,getBuiltIn$g=getBuiltIn$h,isCallable$n=isCallable$q,isPrototypeOf$r=objectIsPrototypeOf,USE_SYMBOL_AS_UID$1=useSymbolAsUid,$Object$3=Object,isSymbol$5=USE_SYMBOL_AS_UID$1?function(e){return"symbol"==typeof e}:function(e){var t=getBuiltIn$g("Symbol");return isCallable$n(t)&&isPrototypeOf$r(t.prototype,$Object$3(e))},$String$4=String,tryToString$7=function(e){try{return $String$4(e)}catch(e){return"Object"}},isCallable$m=isCallable$q,tryToString$6=tryToString$7,$TypeError$j=TypeError,aCallable$j=function(e){if(isCallable$m(e))return e;throw $TypeError$j(tryToString$6(e)+" is not a function")},aCallable$i=aCallable$j,isNullOrUndefined$4=isNullOrUndefined$6,getMethod$3=function(e,t){var r=e[t];return isNullOrUndefined$4(r)?void 0:aCallable$i(r)},call$o=functionCall,isCallable$l=isCallable$q,isObject$k=isObject$l,$TypeError$i=TypeError,ordinaryToPrimitive$1=function(e,t){var r,n;if("string"===t&&isCallable$l(r=e.toString)&&!isObject$k(n=call$o(r,e)))return n;if(isCallable$l(r=e.valueOf)&&!isObject$k(n=call$o(r,e)))return n;if("string"!==t&&isCallable$l(r=e.toString)&&!isObject$k(n=call$o(r,e)))return n;throw $TypeError$i("Can't convert object to primitive value")},shared$7={exports:{}},isPure=!0,global$o=global$s,defineProperty$e=Object.defineProperty,defineGlobalProperty$1=function(e,t){try{defineProperty$e(global$o,e,{value:t,configurable:!0,writable:!0})}catch(r){global$o[e]=t}return t},global$n=global$s,defineGlobalProperty=defineGlobalProperty$1,SHARED="__core-js_shared__",store$3=global$n[SHARED]||defineGlobalProperty(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.30.2",mode:"pure",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.30.2/LICENSE",source:"https://github.com/zloirock/core-js"});var sharedExports=shared$7.exports,requireObjectCoercible$6=requireObjectCoercible$8,$Object$2=Object,toObject$f=function(e){return $Object$2(requireObjectCoercible$6(e))},uncurryThis$z=functionUncurryThis,toObject$e=toObject$f,hasOwnProperty=uncurryThis$z({}.hasOwnProperty),hasOwnProperty_1=Object.hasOwn||function(e,t){return hasOwnProperty(toObject$e(e),t)},uncurryThis$y=functionUncurryThis,id$1=0,postfix=Math.random(),toString$g=uncurryThis$y(1..toString),uid$4=function(e){return"Symbol("+(void 0===e?"":e)+")_"+toString$g(++id$1+postfix,36)},global$m=global$s,shared$6=sharedExports,hasOwn$j=hasOwnProperty_1,uid$3=uid$4,NATIVE_SYMBOL$4=symbolConstructorDetection,USE_SYMBOL_AS_UID=useSymbolAsUid,Symbol$5=global$m.Symbol,WellKnownSymbolsStore$2=shared$6("wks"),createWellKnownSymbol=USE_SYMBOL_AS_UID?Symbol$5.for||Symbol$5:Symbol$5&&Symbol$5.withoutSetter||uid$3,wellKnownSymbol$q=function(e){return hasOwn$j(WellKnownSymbolsStore$2,e)||(WellKnownSymbolsStore$2[e]=NATIVE_SYMBOL$4&&hasOwn$j(Symbol$5,e)?Symbol$5[e]:createWellKnownSymbol("Symbol."+e)),WellKnownSymbolsStore$2[e]},call$n=functionCall,isObject$j=isObject$l,isSymbol$4=isSymbol$5,getMethod$2=getMethod$3,ordinaryToPrimitive=ordinaryToPrimitive$1,wellKnownSymbol$p=wellKnownSymbol$q,$TypeError$h=TypeError,TO_PRIMITIVE=wellKnownSymbol$p("toPrimitive"),toPrimitive$7=function(e,t){if(!isObject$j(e)||isSymbol$4(e))return e;var r,n=getMethod$2(e,TO_PRIMITIVE);if(n){if(void 0===t&&(t="default"),r=call$n(n,e,t),!isObject$j(r)||isSymbol$4(r))return r;throw $TypeError$h("Can't convert object to primitive value")}return void 0===t&&(t="number"),ordinaryToPrimitive(e,t)},toPrimitive$6=toPrimitive$7,isSymbol$3=isSymbol$5,toPropertyKey$4=function(e){var t=toPrimitive$6(e,"string");return isSymbol$3(t)?t:t+""},global$l=global$s,isObject$i=isObject$l,document$3=global$l.document,EXISTS$1=isObject$i(document$3)&&isObject$i(document$3.createElement),documentCreateElement$1=function(e){return EXISTS$1?document$3.createElement(e):{}},DESCRIPTORS$l=descriptors$2,fails$w=fails$B,createElement$1=documentCreateElement$1,ie8DomDefine=!DESCRIPTORS$l&&!fails$w((function(){return 7!=Object.defineProperty(createElement$1("div"),"a",{get:function(){return 7}}).a})),DESCRIPTORS$k=descriptors$2,call$m=functionCall,propertyIsEnumerableModule$2=objectPropertyIsEnumerable,createPropertyDescriptor$7=createPropertyDescriptor$8,toIndexedObject$b=toIndexedObject$c,toPropertyKey$3=toPropertyKey$4,hasOwn$i=hasOwnProperty_1,IE8_DOM_DEFINE$1=ie8DomDefine,$getOwnPropertyDescriptor$2=Object.getOwnPropertyDescriptor;objectGetOwnPropertyDescriptor.f=DESCRIPTORS$k?$getOwnPropertyDescriptor$2:function(e,t){if(e=toIndexedObject$b(e),t=toPropertyKey$3(t),IE8_DOM_DEFINE$1)try{return $getOwnPropertyDescriptor$2(e,t)}catch(e){}if(hasOwn$i(e,t))return createPropertyDescriptor$7(!call$m(propertyIsEnumerableModule$2.f,e,t),e[t])};var fails$v=fails$B,isCallable$k=isCallable$q,replacement=/#|\.prototype\./,isForced$2=function(e,t){var r=data[normalize(e)];return r==POLYFILL||r!=NATIVE&&(isCallable$k(t)?fails$v(t):!!t)},normalize=isForced$2.normalize=function(e){return String(e).replace(replacement,".").toLowerCase()},data=isForced$2.data={},NATIVE=isForced$2.NATIVE="N",POLYFILL=isForced$2.POLYFILL="P",isForced_1=isForced$2,uncurryThis$x=functionUncurryThisClause,aCallable$h=aCallable$j,NATIVE_BIND$1=functionBindNative,bind$r=functionUncurryThisClause(functionUncurryThisClause.bind),functionBindContext=function(e,t){return aCallable$h(e),void 0===t?e:NATIVE_BIND$1?bind$r(e,t):function(){return e.apply(t,arguments)}},objectDefineProperty={},DESCRIPTORS$j=descriptors$2,fails$u=fails$B,v8PrototypeDefineBug=DESCRIPTORS$j&&fails$u((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),isObject$h=isObject$l,$String$3=String,$TypeError$g=TypeError,anObject$g=function(e){if(isObject$h(e))return e;throw $TypeError$g($String$3(e)+" is not an object")},DESCRIPTORS$i=descriptors$2,IE8_DOM_DEFINE=ie8DomDefine,V8_PROTOTYPE_DEFINE_BUG$1=v8PrototypeDefineBug,anObject$f=anObject$g,toPropertyKey$2=toPropertyKey$4,$TypeError$f=TypeError,$defineProperty$1=Object.defineProperty,$getOwnPropertyDescriptor$1=Object.getOwnPropertyDescriptor,ENUMERABLE="enumerable",CONFIGURABLE$1="configurable",WRITABLE="writable";objectDefineProperty.f=DESCRIPTORS$i?V8_PROTOTYPE_DEFINE_BUG$1?function(e,t,r){if(anObject$f(e),t=toPropertyKey$2(t),anObject$f(r),"function"==typeof e&&"prototype"===t&&"value"in r&&WRITABLE in r&&!r[WRITABLE]){var n=$getOwnPropertyDescriptor$1(e,t);n&&n[WRITABLE]&&(e[t]=r.value,r={configurable:CONFIGURABLE$1 in r?r[CONFIGURABLE$1]:n[CONFIGURABLE$1],enumerable:ENUMERABLE in r?r[ENUMERABLE]:n[ENUMERABLE],writable:!1})}return $defineProperty$1(e,t,r)}:$defineProperty$1:function(e,t,r){if(anObject$f(e),t=toPropertyKey$2(t),anObject$f(r),IE8_DOM_DEFINE)try{return $defineProperty$1(e,t,r)}catch(e){}if("get"in r||"set"in r)throw $TypeError$f("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var DESCRIPTORS$h=descriptors$2,definePropertyModule$4=objectDefineProperty,createPropertyDescriptor$6=createPropertyDescriptor$8,createNonEnumerableProperty$9=DESCRIPTORS$h?function(e,t,r){return definePropertyModule$4.f(e,t,createPropertyDescriptor$6(1,r))}:function(e,t,r){return e[t]=r,e},global$k=global$s,apply$6=functionApply,uncurryThis$w=functionUncurryThisClause,isCallable$j=isCallable$q,getOwnPropertyDescriptor$a=objectGetOwnPropertyDescriptor.f,isForced$1=isForced_1,path$w=path$y,bind$q=functionBindContext,createNonEnumerableProperty$8=createNonEnumerableProperty$9,hasOwn$h=hasOwnProperty_1,wrapConstructor=function(e){var t=function(r,n,o){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(r);case 2:return new e(r,n)}return new e(r,n,o)}return apply$6(e,this,arguments)};return t.prototype=e.prototype,t},_export=function(e,t){var r,n,o,i,a,s,l,c,u,p=e.target,f=e.global,d=e.stat,h=e.proto,$=f?global$k:d?global$k[p]:(global$k[p]||{}).prototype,y=f?path$w:path$w[p]||createNonEnumerableProperty$8(path$w,p,{})[p],g=y.prototype;for(i in t)n=!(r=isForced$1(f?i:p+(d?".":"#")+i,e.forced))&&$&&hasOwn$h($,i),s=y[i],n&&(l=e.dontCallGetSet?(u=getOwnPropertyDescriptor$a($,i))&&u.value:$[i]),a=n&&l?l:t[i],n&&typeof s==typeof a||(c=e.bind&&n?bind$q(a,global$k):e.wrap&&n?wrapConstructor(a):h&&isCallable$j(a)?uncurryThis$w(a):a,(e.sham||a&&a.sham||s&&s.sham)&&createNonEnumerableProperty$8(c,"sham",!0),createNonEnumerableProperty$8(y,i,c),h&&(hasOwn$h(path$w,o=p+"Prototype")||createNonEnumerableProperty$8(path$w,o,{}),createNonEnumerableProperty$8(path$w[o],i,a),e.real&&g&&(r||!g[i])&&createNonEnumerableProperty$8(g,i,a)))},classof$d=classofRaw$2,isArray$d=Array.isArray||function(e){return"Array"==classof$d(e)},ceil$1=Math.ceil,floor$4=Math.floor,mathTrunc=Math.trunc||function(e){var t=+e;return(t>0?floor$4:ceil$1)(t)},trunc2=mathTrunc,toIntegerOrInfinity$6=function(e){var t=+e;return t!=t||0===t?0:trunc2(t)},toIntegerOrInfinity$5=toIntegerOrInfinity$6,min$5=Math.min,toLength$3=function(e){return e>0?min$5(toIntegerOrInfinity$5(e),9007199254740991):0},toLength$2=toLength$3,lengthOfArrayLike$e=function(e){return toLength$2(e.length)},$TypeError$e=TypeError,MAX_SAFE_INTEGER=9007199254740991,doesNotExceedSafeInteger$3=function(e){if(e>MAX_SAFE_INTEGER)throw $TypeError$e("Maximum allowed index exceeded");return e},toPropertyKey$1=toPropertyKey$4,definePropertyModule$3=objectDefineProperty,createPropertyDescriptor$5=createPropertyDescriptor$8,createProperty$6=function(e,t,r){var n=toPropertyKey$1(t);n in e?definePropertyModule$3.f(e,n,createPropertyDescriptor$5(0,r)):e[n]=r},wellKnownSymbol$o=wellKnownSymbol$q,TO_STRING_TAG$4=wellKnownSymbol$o("toStringTag"),test$2={};test$2[TO_STRING_TAG$4]="z";var toStringTagSupport="[object z]"===String(test$2),TO_STRING_TAG_SUPPORT$2=toStringTagSupport,isCallable$i=isCallable$q,classofRaw=classofRaw$2,wellKnownSymbol$n=wellKnownSymbol$q,TO_STRING_TAG$3=wellKnownSymbol$n("toStringTag"),$Object$1=Object,CORRECT_ARGUMENTS="Arguments"==classofRaw(function(){return arguments}()),tryGet=function(e,t){try{return e[t]}catch(e){}},classof$c=TO_STRING_TAG_SUPPORT$2?classofRaw:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=tryGet(t=$Object$1(e),TO_STRING_TAG$3))?r:CORRECT_ARGUMENTS?classofRaw(t):"Object"==(n=classofRaw(t))&&isCallable$i(t.callee)?"Arguments":n},uncurryThis$v=functionUncurryThis,isCallable$h=isCallable$q,store$1=sharedStore,functionToString=uncurryThis$v(Function.toString);isCallable$h(store$1.inspectSource)||(store$1.inspectSource=function(e){return functionToString(e)});var inspectSource$2=store$1.inspectSource,uncurryThis$u=functionUncurryThis,fails$t=fails$B,isCallable$g=isCallable$q,classof$b=classof$c,getBuiltIn$f=getBuiltIn$h,inspectSource$1=inspectSource$2,noop=function(){},empty=[],construct$7=getBuiltIn$f("Reflect","construct"),constructorRegExp=/^\s*(?:class|function)\b/,exec$4=uncurryThis$u(constructorRegExp.exec),INCORRECT_TO_STRING=!constructorRegExp.exec(noop),isConstructorModern=function(e){if(!isCallable$g(e))return!1;try{return construct$7(noop,empty,e),!0}catch(e){return!1}},isConstructorLegacy=function(e){if(!isCallable$g(e))return!1;switch(classof$b(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$4=!construct$7||fails$t((function(){var e;return isConstructorModern(isConstructorModern.call)||!isConstructorModern(Object)||!isConstructorModern((function(){e=!0}))||e}))?isConstructorLegacy:isConstructorModern,isArray$c=isArray$d,isConstructor$3=isConstructor$4,isObject$g=isObject$l,wellKnownSymbol$m=wellKnownSymbol$q,SPECIES$5=wellKnownSymbol$m("species"),$Array$3=Array,arraySpeciesConstructor$1=function(e){var t;return isArray$c(e)&&(t=e.constructor,(isConstructor$3(t)&&(t===$Array$3||isArray$c(t.prototype))||isObject$g(t)&&null===(t=t[SPECIES$5]))&&(t=void 0)),void 0===t?$Array$3:t},arraySpeciesConstructor=arraySpeciesConstructor$1,arraySpeciesCreate$3=function(e,t){return new(arraySpeciesConstructor(e))(0===t?0:t)},fails$s=fails$B,wellKnownSymbol$l=wellKnownSymbol$q,V8_VERSION$2=engineV8Version,SPECIES$4=wellKnownSymbol$l("species"),arrayMethodHasSpeciesSupport$5=function(e){return V8_VERSION$2>=51||!fails$s((function(){var t=[];return(t.constructor={})[SPECIES$4]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},$$1q=_export,fails$r=fails$B,isArray$b=isArray$d,isObject$f=isObject$l,toObject$d=toObject$f,lengthOfArrayLike$d=lengthOfArrayLike$e,doesNotExceedSafeInteger$2=doesNotExceedSafeInteger$3,createProperty$5=createProperty$6,arraySpeciesCreate$2=arraySpeciesCreate$3,arrayMethodHasSpeciesSupport$4=arrayMethodHasSpeciesSupport$5,wellKnownSymbol$k=wellKnownSymbol$q,V8_VERSION$1=engineV8Version,IS_CONCAT_SPREADABLE=wellKnownSymbol$k("isConcatSpreadable"),IS_CONCAT_SPREADABLE_SUPPORT=V8_VERSION$1>=51||!fails$r((function(){var e=[];return e[IS_CONCAT_SPREADABLE]=!1,e.concat()[0]!==e})),isConcatSpreadable=function(e){if(!isObject$f(e))return!1;var t=e[IS_CONCAT_SPREADABLE];return void 0!==t?!!t:isArray$b(e)},FORCED$a=!IS_CONCAT_SPREADABLE_SUPPORT||!arrayMethodHasSpeciesSupport$4("concat");$$1q({target:"Array",proto:!0,arity:1,forced:FORCED$a},{concat:function(e){var t,r,n,o,i,a=toObject$d(this),s=arraySpeciesCreate$2(a,0),l=0;for(t=-1,n=arguments.length;t<n;t++)if(isConcatSpreadable(i=-1===t?a:arguments[t]))for(o=lengthOfArrayLike$d(i),doesNotExceedSafeInteger$2(l+o),r=0;r<o;r++,l++)r in i&&createProperty$5(s,l,i[r]);else doesNotExceedSafeInteger$2(l+1),createProperty$5(s,l++,i);return s.length=l,s}});var classof$a=classof$c,$String$2=String,toString$f=function(e){if("Symbol"===classof$a(e))throw TypeError("Cannot convert a Symbol value to a string");return $String$2(e)},objectDefineProperties={},toIntegerOrInfinity$4=toIntegerOrInfinity$6,max$3=Math.max,min$4=Math.min,toAbsoluteIndex$6=function(e,t){var r=toIntegerOrInfinity$4(e);return r<0?max$3(r+t,0):min$4(r,t)},toIndexedObject$a=toIndexedObject$c,toAbsoluteIndex$5=toAbsoluteIndex$6,lengthOfArrayLike$c=lengthOfArrayLike$e,createMethod$6=function(e){return function(t,r,n){var o,i=toIndexedObject$a(t),a=lengthOfArrayLike$c(i),s=toAbsoluteIndex$5(n,a);if(e&&r!=r){for(;a>s;)if((o=i[s++])!=o)return!0}else for(;a>s;s++)if((e||s in i)&&i[s]===r)return e||s||0;return!e&&-1}},arrayIncludes={includes:createMethod$6(!0),indexOf:createMethod$6(!1)},hiddenKeys$6={},uncurryThis$t=functionUncurryThis,hasOwn$g=hasOwnProperty_1,toIndexedObject$9=toIndexedObject$c,indexOf$7=arrayIncludes.indexOf,hiddenKeys$5=hiddenKeys$6,push$i=uncurryThis$t([].push),objectKeysInternal=function(e,t){var r,n=toIndexedObject$9(e),o=0,i=[];for(r in n)!hasOwn$g(hiddenKeys$5,r)&&hasOwn$g(n,r)&&push$i(i,r);for(;t.length>o;)hasOwn$g(n,r=t[o++])&&(~indexOf$7(i,r)||push$i(i,r));return i},enumBugKeys$3=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],internalObjectKeys$1=objectKeysInternal,enumBugKeys$2=enumBugKeys$3,objectKeys$4=Object.keys||function(e){return internalObjectKeys$1(e,enumBugKeys$2)},DESCRIPTORS$g=descriptors$2,V8_PROTOTYPE_DEFINE_BUG=v8PrototypeDefineBug,definePropertyModule$2=objectDefineProperty,anObject$e=anObject$g,toIndexedObject$8=toIndexedObject$c,objectKeys$3=objectKeys$4;objectDefineProperties.f=DESCRIPTORS$g&&!V8_PROTOTYPE_DEFINE_BUG?Object.defineProperties:function(e,t){anObject$e(e);for(var r,n=toIndexedObject$8(t),o=objectKeys$3(t),i=o.length,a=0;i>a;)definePropertyModule$2.f(e,r=o[a++],n[r]);return e};var activeXDocument,getBuiltIn$e=getBuiltIn$h,html$2=getBuiltIn$e("document","documentElement"),shared$5=sharedExports,uid$2=uid$4,keys$6=shared$5("keys"),sharedKey$4=function(e){return keys$6[e]||(keys$6[e]=uid$2(e))},anObject$d=anObject$g,definePropertiesModule$1=objectDefineProperties,enumBugKeys$1=enumBugKeys$3,hiddenKeys$4=hiddenKeys$6,html$1=html$2,documentCreateElement=documentCreateElement$1,sharedKey$3=sharedKey$4,GT=">",LT="<",PROTOTYPE$1="prototype",SCRIPT="script",IE_PROTO$1=sharedKey$3("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(e){return LT+SCRIPT+GT+e+LT+"/"+SCRIPT+GT},NullProtoObjectViaActiveX=function(e){e.write(scriptTag("")),e.close();var t=e.parentWindow.Object;return e=null,t},NullProtoObjectViaIFrame=function(){var e,t=documentCreateElement("iframe"),r="java"+SCRIPT+":";return t.style.display="none",html$1.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(scriptTag("document.F=Object")),e.close(),e.F},NullProtoObject=function(){try{activeXDocument=new ActiveXObject("htmlfile")}catch(e){}NullProtoObject="undefined"!=typeof document?document.domain&&activeXDocument?NullProtoObjectViaActiveX(activeXDocument):NullProtoObjectViaIFrame():NullProtoObjectViaActiveX(activeXDocument);for(var e=enumBugKeys$1.length;e--;)delete NullProtoObject[PROTOTYPE$1][enumBugKeys$1[e]];return NullProtoObject()};hiddenKeys$4[IE_PROTO$1]=!0;var objectCreate=Object.create||function(e,t){var r;return null!==e?(EmptyConstructor[PROTOTYPE$1]=anObject$d(e),r=new EmptyConstructor,EmptyConstructor[PROTOTYPE$1]=null,r[IE_PROTO$1]=e):r=NullProtoObject(),void 0===t?r:definePropertiesModule$1.f(r,t)},objectGetOwnPropertyNames={},internalObjectKeys=objectKeysInternal,enumBugKeys=enumBugKeys$3,hiddenKeys$3=enumBugKeys.concat("length","prototype");objectGetOwnPropertyNames.f=Object.getOwnPropertyNames||function(e){return internalObjectKeys(e,hiddenKeys$3)};var objectGetOwnPropertyNamesExternal={},toAbsoluteIndex$4=toAbsoluteIndex$6,lengthOfArrayLike$b=lengthOfArrayLike$e,createProperty$4=createProperty$6,$Array$2=Array,max$2=Math.max,arraySliceSimple=function(e,t,r){for(var n=lengthOfArrayLike$b(e),o=toAbsoluteIndex$4(t,n),i=toAbsoluteIndex$4(void 0===r?n:r,n),a=$Array$2(max$2(i-o,0)),s=0;o<i;o++,s++)createProperty$4(a,s,e[o]);return a.length=s,a},classof$9=classofRaw$2,toIndexedObject$7=toIndexedObject$c,$getOwnPropertyNames$1=objectGetOwnPropertyNames.f,arraySlice$8=arraySliceSimple,windowNames="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],getWindowNames=function(e){try{return $getOwnPropertyNames$1(e)}catch(e){return arraySlice$8(windowNames)}};objectGetOwnPropertyNamesExternal.f=function(e){return windowNames&&"Window"==classof$9(e)?getWindowNames(e):$getOwnPropertyNames$1(toIndexedObject$7(e))};var objectGetOwnPropertySymbols={};objectGetOwnPropertySymbols.f=Object.getOwnPropertySymbols;var createNonEnumerableProperty$7=createNonEnumerableProperty$9,defineBuiltIn$8=function(e,t,r,n){return n&&n.enumerable?e[t]=r:createNonEnumerableProperty$7(e,t,r),e},defineProperty$d=objectDefineProperty,defineBuiltInAccessor$5=function(e,t,r){return defineProperty$d.f(e,t,r)},wellKnownSymbolWrapped={},wellKnownSymbol$j=wellKnownSymbol$q;wellKnownSymbolWrapped.f=wellKnownSymbol$j;var set$7,get$9,has$2,path$v=path$y,hasOwn$f=hasOwnProperty_1,wrappedWellKnownSymbolModule$1=wellKnownSymbolWrapped,defineProperty$c=objectDefineProperty.f,wellKnownSymbolDefine=function(e){var t=path$v.Symbol||(path$v.Symbol={});hasOwn$f(t,e)||defineProperty$c(t,e,{value:wrappedWellKnownSymbolModule$1.f(e)})},call$l=functionCall,getBuiltIn$d=getBuiltIn$h,wellKnownSymbol$i=wellKnownSymbol$q,defineBuiltIn$7=defineBuiltIn$8,symbolDefineToPrimitive=function(){var e=getBuiltIn$d("Symbol"),t=e&&e.prototype,r=t&&t.valueOf,n=wellKnownSymbol$i("toPrimitive");t&&!t[n]&&defineBuiltIn$7(t,n,(function(e){return call$l(r,this)}),{arity:1})},TO_STRING_TAG_SUPPORT$1=toStringTagSupport,classof$8=classof$c,objectToString=TO_STRING_TAG_SUPPORT$1?{}.toString:function(){return"[object "+classof$8(this)+"]"},TO_STRING_TAG_SUPPORT=toStringTagSupport,defineProperty$b=objectDefineProperty.f,createNonEnumerableProperty$6=createNonEnumerableProperty$9,hasOwn$e=hasOwnProperty_1,toString$e=objectToString,wellKnownSymbol$h=wellKnownSymbol$q,TO_STRING_TAG$2=wellKnownSymbol$h("toStringTag"),setToStringTag$9=function(e,t,r,n){if(e){var o=r?e:e.prototype;hasOwn$e(o,TO_STRING_TAG$2)||defineProperty$b(o,TO_STRING_TAG$2,{configurable:!0,value:t}),n&&!TO_STRING_TAG_SUPPORT&&createNonEnumerableProperty$6(o,"toString",toString$e)}},global$j=global$s,isCallable$f=isCallable$q,WeakMap$1=global$j.WeakMap,weakMapBasicDetection=isCallable$f(WeakMap$1)&&/native code/.test(String(WeakMap$1)),NATIVE_WEAK_MAP=weakMapBasicDetection,global$i=global$s,isObject$e=isObject$l,createNonEnumerableProperty$5=createNonEnumerableProperty$9,hasOwn$d=hasOwnProperty_1,shared$4=sharedStore,sharedKey$2=sharedKey$4,hiddenKeys$2=hiddenKeys$6,OBJECT_ALREADY_INITIALIZED="Object already initialized",TypeError$5=global$i.TypeError,WeakMap=global$i.WeakMap,enforce=function(e){return has$2(e)?get$9(e):set$7(e,{})},getterFor=function(e){return function(t){var r;if(!isObject$e(t)||(r=get$9(t)).type!==e)throw TypeError$5("Incompatible receiver, "+e+" required");return r}};if(NATIVE_WEAK_MAP||shared$4.state){var store=shared$4.state||(shared$4.state=new WeakMap);store.get=store.get,store.has=store.has,store.set=store.set,set$7=function(e,t){if(store.has(e))throw TypeError$5(OBJECT_ALREADY_INITIALIZED);return t.facade=e,store.set(e,t),t},get$9=function(e){return store.get(e)||{}},has$2=function(e){return store.has(e)}}else{var STATE=sharedKey$2("state");hiddenKeys$2[STATE]=!0,set$7=function(e,t){if(hasOwn$d(e,STATE))throw TypeError$5(OBJECT_ALREADY_INITIALIZED);return t.facade=e,createNonEnumerableProperty$5(e,STATE,t),t},get$9=function(e){return hasOwn$d(e,STATE)?e[STATE]:{}},has$2=function(e){return hasOwn$d(e,STATE)}}var internalState={set:set$7,get:get$9,has:has$2,enforce:enforce,getterFor:getterFor},bind$p=functionBindContext,uncurryThis$s=functionUncurryThis,IndexedObject$2=indexedObject,toObject$c=toObject$f,lengthOfArrayLike$a=lengthOfArrayLike$e,arraySpeciesCreate$1=arraySpeciesCreate$3,push$h=uncurryThis$s([].push),createMethod$5=function(e){var t=1==e,r=2==e,n=3==e,o=4==e,i=6==e,a=7==e,s=5==e||i;return function(l,c,u,p){for(var f,d,h=toObject$c(l),$=IndexedObject$2(h),y=bind$p(c,u),g=lengthOfArrayLike$a($),v=0,m=p||arraySpeciesCreate$1,_=t?m(l,g):r||a?m(l,0):void 0;g>v;v++)if((s||v in $)&&(d=y(f=$[v],v,h),e))if(t)_[v]=d;else if(d)switch(e){case 3:return!0;case 5:return f;case 6:return v;case 2:push$h(_,f)}else switch(e){case 4:return!1;case 7:push$h(_,f)}return i?-1:n||o?o:_}},arrayIteration={forEach:createMethod$5(0),map:createMethod$5(1),filter:createMethod$5(2),some:createMethod$5(3),every:createMethod$5(4),find:createMethod$5(5),findIndex:createMethod$5(6),filterReject:createMethod$5(7)},$$1p=_export,global$h=global$s,call$k=functionCall,uncurryThis$r=functionUncurryThis,DESCRIPTORS$f=descriptors$2,NATIVE_SYMBOL$3=symbolConstructorDetection,fails$q=fails$B,hasOwn$c=hasOwnProperty_1,isPrototypeOf$q=objectIsPrototypeOf,anObject$c=anObject$g,toIndexedObject$6=toIndexedObject$c,toPropertyKey=toPropertyKey$4,$toString$2=toString$f,createPropertyDescriptor$4=createPropertyDescriptor$8,nativeObjectCreate=objectCreate,objectKeys$2=objectKeys$4,getOwnPropertyNamesModule$2=objectGetOwnPropertyNames,getOwnPropertyNamesExternal=objectGetOwnPropertyNamesExternal,getOwnPropertySymbolsModule$3=objectGetOwnPropertySymbols,getOwnPropertyDescriptorModule$3=objectGetOwnPropertyDescriptor,definePropertyModule$1=objectDefineProperty,definePropertiesModule=objectDefineProperties,propertyIsEnumerableModule$1=objectPropertyIsEnumerable,defineBuiltIn$6=defineBuiltIn$8,defineBuiltInAccessor$4=defineBuiltInAccessor$5,shared$3=sharedExports,sharedKey$1=sharedKey$4,hiddenKeys$1=hiddenKeys$6,uid$1=uid$4,wellKnownSymbol$g=wellKnownSymbol$q,wrappedWellKnownSymbolModule=wellKnownSymbolWrapped,defineWellKnownSymbol$l=wellKnownSymbolDefine,defineSymbolToPrimitive$1=symbolDefineToPrimitive,setToStringTag$8=setToStringTag$9,InternalStateModule$7=internalState,$forEach$1=arrayIteration.forEach,HIDDEN=sharedKey$1("hidden"),SYMBOL="Symbol",PROTOTYPE="prototype",setInternalState$7=InternalStateModule$7.set,getInternalState$2=InternalStateModule$7.getterFor(SYMBOL),ObjectPrototype$2=Object[PROTOTYPE],$Symbol=global$h.Symbol,SymbolPrototype=$Symbol&&$Symbol[PROTOTYPE],TypeError$4=global$h.TypeError,QObject=global$h.QObject,nativeGetOwnPropertyDescriptor$1=getOwnPropertyDescriptorModule$3.f,nativeDefineProperty=definePropertyModule$1.f,nativeGetOwnPropertyNames=getOwnPropertyNamesExternal.f,nativePropertyIsEnumerable=propertyIsEnumerableModule$1.f,push$g=uncurryThis$r([].push),AllSymbols=shared$3("symbols"),ObjectPrototypeSymbols=shared$3("op-symbols"),WellKnownSymbolsStore$1=shared$3("wks"),USE_SETTER=!QObject||!QObject[PROTOTYPE]||!QObject[PROTOTYPE].findChild,setSymbolDescriptor=DESCRIPTORS$f&&fails$q((function(){return 7!=nativeObjectCreate(nativeDefineProperty({},"a",{get:function(){return nativeDefineProperty(this,"a",{value:7}).a}})).a}))?function(e,t,r){var n=nativeGetOwnPropertyDescriptor$1(ObjectPrototype$2,t);n&&delete ObjectPrototype$2[t],nativeDefineProperty(e,t,r),n&&e!==ObjectPrototype$2&&nativeDefineProperty(ObjectPrototype$2,t,n)}:nativeDefineProperty,wrap=function(e,t){var r=AllSymbols[e]=nativeObjectCreate(SymbolPrototype);return setInternalState$7(r,{type:SYMBOL,tag:e,description:t}),DESCRIPTORS$f||(r.description=t),r},$defineProperty=function(e,t,r){e===ObjectPrototype$2&&$defineProperty(ObjectPrototypeSymbols,t,r),anObject$c(e);var n=toPropertyKey(t);return anObject$c(r),hasOwn$c(AllSymbols,n)?(r.enumerable?(hasOwn$c(e,HIDDEN)&&e[HIDDEN][n]&&(e[HIDDEN][n]=!1),r=nativeObjectCreate(r,{enumerable:createPropertyDescriptor$4(0,!1)})):(hasOwn$c(e,HIDDEN)||nativeDefineProperty(e,HIDDEN,createPropertyDescriptor$4(1,{})),e[HIDDEN][n]=!0),setSymbolDescriptor(e,n,r)):nativeDefineProperty(e,n,r)},$defineProperties=function(e,t){anObject$c(e);var r=toIndexedObject$6(t),n=objectKeys$2(r).concat($getOwnPropertySymbols(r));return $forEach$1(n,(function(t){DESCRIPTORS$f&&!call$k($propertyIsEnumerable$1,r,t)||$defineProperty(e,t,r[t])})),e},$create=function(e,t){return void 0===t?nativeObjectCreate(e):$defineProperties(nativeObjectCreate(e),t)},$propertyIsEnumerable$1=function(e){var t=toPropertyKey(e),r=call$k(nativePropertyIsEnumerable,this,t);return!(this===ObjectPrototype$2&&hasOwn$c(AllSymbols,t)&&!hasOwn$c(ObjectPrototypeSymbols,t))&&(!(r||!hasOwn$c(this,t)||!hasOwn$c(AllSymbols,t)||hasOwn$c(this,HIDDEN)&&this[HIDDEN][t])||r)},$getOwnPropertyDescriptor=function(e,t){var r=toIndexedObject$6(e),n=toPropertyKey(t);if(r!==ObjectPrototype$2||!hasOwn$c(AllSymbols,n)||hasOwn$c(ObjectPrototypeSymbols,n)){var o=nativeGetOwnPropertyDescriptor$1(r,n);return!o||!hasOwn$c(AllSymbols,n)||hasOwn$c(r,HIDDEN)&&r[HIDDEN][n]||(o.enumerable=!0),o}},$getOwnPropertyNames=function(e){var t=nativeGetOwnPropertyNames(toIndexedObject$6(e)),r=[];return $forEach$1(t,(function(e){hasOwn$c(AllSymbols,e)||hasOwn$c(hiddenKeys$1,e)||push$g(r,e)})),r},$getOwnPropertySymbols=function(e){var t=e===ObjectPrototype$2,r=nativeGetOwnPropertyNames(t?ObjectPrototypeSymbols:toIndexedObject$6(e)),n=[];return $forEach$1(r,(function(e){!hasOwn$c(AllSymbols,e)||t&&!hasOwn$c(ObjectPrototype$2,e)||push$g(n,AllSymbols[e])})),n};NATIVE_SYMBOL$3||(defineBuiltIn$6(SymbolPrototype=($Symbol=function(){if(isPrototypeOf$q(SymbolPrototype,this))throw TypeError$4("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?$toString$2(arguments[0]):void 0,t=uid$1(e),r=function(e){this===ObjectPrototype$2&&call$k(r,ObjectPrototypeSymbols,e),hasOwn$c(this,HIDDEN)&&hasOwn$c(this[HIDDEN],t)&&(this[HIDDEN][t]=!1),setSymbolDescriptor(this,t,createPropertyDescriptor$4(1,e))};return DESCRIPTORS$f&&USE_SETTER&&setSymbolDescriptor(ObjectPrototype$2,t,{configurable:!0,set:r}),wrap(t,e)})[PROTOTYPE],"toString",(function(){return getInternalState$2(this).tag})),defineBuiltIn$6($Symbol,"withoutSetter",(function(e){return wrap(uid$1(e),e)})),propertyIsEnumerableModule$1.f=$propertyIsEnumerable$1,definePropertyModule$1.f=$defineProperty,definePropertiesModule.f=$defineProperties,getOwnPropertyDescriptorModule$3.f=$getOwnPropertyDescriptor,getOwnPropertyNamesModule$2.f=getOwnPropertyNamesExternal.f=$getOwnPropertyNames,getOwnPropertySymbolsModule$3.f=$getOwnPropertySymbols,wrappedWellKnownSymbolModule.f=function(e){return wrap(wellKnownSymbol$g(e),e)},DESCRIPTORS$f&&defineBuiltInAccessor$4(SymbolPrototype,"description",{configurable:!0,get:function(){return getInternalState$2(this).description}})),$$1p({global:!0,constructor:!0,wrap:!0,forced:!NATIVE_SYMBOL$3,sham:!NATIVE_SYMBOL$3},{Symbol:$Symbol}),$forEach$1(objectKeys$2(WellKnownSymbolsStore$1),(function(e){defineWellKnownSymbol$l(e)})),$$1p({target:SYMBOL,stat:!0,forced:!NATIVE_SYMBOL$3},{useSetter:function(){USE_SETTER=!0},useSimple:function(){USE_SETTER=!1}}),$$1p({target:"Object",stat:!0,forced:!NATIVE_SYMBOL$3,sham:!DESCRIPTORS$f},{create:$create,defineProperty:$defineProperty,defineProperties:$defineProperties,getOwnPropertyDescriptor:$getOwnPropertyDescriptor}),$$1p({target:"Object",stat:!0,forced:!NATIVE_SYMBOL$3},{getOwnPropertyNames:$getOwnPropertyNames}),defineSymbolToPrimitive$1(),setToStringTag$8($Symbol,SYMBOL),hiddenKeys$1[HIDDEN]=!0;var NATIVE_SYMBOL$2=symbolConstructorDetection,symbolRegistryDetection=NATIVE_SYMBOL$2&&!!Symbol.for&&!!Symbol.keyFor,$$1o=_export,getBuiltIn$c=getBuiltIn$h,hasOwn$b=hasOwnProperty_1,toString$d=toString$f,shared$2=sharedExports,NATIVE_SYMBOL_REGISTRY$1=symbolRegistryDetection,StringToSymbolRegistry=shared$2("string-to-symbol-registry"),SymbolToStringRegistry$1=shared$2("symbol-to-string-registry");$$1o({target:"Symbol",stat:!0,forced:!NATIVE_SYMBOL_REGISTRY$1},{for:function(e){var t=toString$d(e);if(hasOwn$b(StringToSymbolRegistry,t))return StringToSymbolRegistry[t];var r=getBuiltIn$c("Symbol")(t);return StringToSymbolRegistry[t]=r,SymbolToStringRegistry$1[r]=t,r}});var $$1n=_export,hasOwn$a=hasOwnProperty_1,isSymbol$2=isSymbol$5,tryToString$5=tryToString$7,shared$1=sharedExports,NATIVE_SYMBOL_REGISTRY=symbolRegistryDetection,SymbolToStringRegistry=shared$1("symbol-to-string-registry");$$1n({target:"Symbol",stat:!0,forced:!NATIVE_SYMBOL_REGISTRY},{keyFor:function(e){if(!isSymbol$2(e))throw TypeError(tryToString$5(e)+" is not a symbol");if(hasOwn$a(SymbolToStringRegistry,e))return SymbolToStringRegistry[e]}});var uncurryThis$q=functionUncurryThis,arraySlice$7=uncurryThis$q([].slice),uncurryThis$p=functionUncurryThis,isArray$a=isArray$d,isCallable$e=isCallable$q,classof$7=classofRaw$2,toString$c=toString$f,push$f=uncurryThis$p([].push),getJsonReplacerFunction=function(e){if(isCallable$e(e))return e;if(isArray$a(e)){for(var t=e.length,r=[],n=0;n<t;n++){var o=e[n];"string"==typeof o?push$f(r,o):"number"!=typeof o&&"Number"!=classof$7(o)&&"String"!=classof$7(o)||push$f(r,toString$c(o))}var i=r.length,a=!0;return function(e,t){if(a)return a=!1,t;if(isArray$a(this))return t;for(var n=0;n<i;n++)if(r[n]===e)return t}}},$$1m=_export,getBuiltIn$b=getBuiltIn$h,apply$5=functionApply,call$j=functionCall,uncurryThis$o=functionUncurryThis,fails$p=fails$B,isCallable$d=isCallable$q,isSymbol$1=isSymbol$5,arraySlice$6=arraySlice$7,getReplacerFunction=getJsonReplacerFunction,NATIVE_SYMBOL$1=symbolConstructorDetection,$String$1=String,$stringify=getBuiltIn$b("JSON","stringify"),exec$3=uncurryThis$o(/./.exec),charAt$5=uncurryThis$o("".charAt),charCodeAt$2=uncurryThis$o("".charCodeAt),replace$5=uncurryThis$o("".replace),numberToString$1=uncurryThis$o(1..toString),tester=/[\uD800-\uDFFF]/g,low=/^[\uD800-\uDBFF]$/,hi=/^[\uDC00-\uDFFF]$/,WRONG_SYMBOLS_CONVERSION=!NATIVE_SYMBOL$1||fails$p((function(){var e=getBuiltIn$b("Symbol")();return"[null]"!=$stringify([e])||"{}"!=$stringify({a:e})||"{}"!=$stringify(Object(e))})),ILL_FORMED_UNICODE=fails$p((function(){return'"\\udf06\\ud834"'!==$stringify("\udf06\ud834")||'"\\udead"'!==$stringify("\udead")})),stringifyWithSymbolsFix=function(e,t){var r=arraySlice$6(arguments),n=getReplacerFunction(t);if(isCallable$d(n)||void 0!==e&&!isSymbol$1(e))return r[1]=function(e,t){if(isCallable$d(n)&&(t=call$j(n,this,$String$1(e),t)),!isSymbol$1(t))return t},apply$5($stringify,null,r)},fixIllFormed=function(e,t,r){var n=charAt$5(r,t-1),o=charAt$5(r,t+1);return exec$3(low,e)&&!exec$3(hi,o)||exec$3(hi,e)&&!exec$3(low,n)?"\\u"+numberToString$1(charCodeAt$2(e,0),16):e};$stringify&&$$1m({target:"JSON",stat:!0,arity:3,forced:WRONG_SYMBOLS_CONVERSION||ILL_FORMED_UNICODE},{stringify:function(e,t,r){var n=arraySlice$6(arguments),o=apply$5(WRONG_SYMBOLS_CONVERSION?stringifyWithSymbolsFix:$stringify,null,n);return ILL_FORMED_UNICODE&&"string"==typeof o?replace$5(o,tester,fixIllFormed):o}});var $$1l=_export,NATIVE_SYMBOL=symbolConstructorDetection,fails$o=fails$B,getOwnPropertySymbolsModule$2=objectGetOwnPropertySymbols,toObject$b=toObject$f,FORCED$9=!NATIVE_SYMBOL||fails$o((function(){getOwnPropertySymbolsModule$2.f(1)}));$$1l({target:"Object",stat:!0,forced:FORCED$9},{getOwnPropertySymbols:function(e){var t=getOwnPropertySymbolsModule$2.f;return t?t(toObject$b(e)):[]}});var defineWellKnownSymbol$k=wellKnownSymbolDefine;defineWellKnownSymbol$k("asyncIterator");var defineWellKnownSymbol$j=wellKnownSymbolDefine;defineWellKnownSymbol$j("hasInstance");var defineWellKnownSymbol$i=wellKnownSymbolDefine;defineWellKnownSymbol$i("isConcatSpreadable");var defineWellKnownSymbol$h=wellKnownSymbolDefine;defineWellKnownSymbol$h("iterator");var defineWellKnownSymbol$g=wellKnownSymbolDefine;defineWellKnownSymbol$g("match");var defineWellKnownSymbol$f=wellKnownSymbolDefine;defineWellKnownSymbol$f("matchAll");var defineWellKnownSymbol$e=wellKnownSymbolDefine;defineWellKnownSymbol$e("replace");var defineWellKnownSymbol$d=wellKnownSymbolDefine;defineWellKnownSymbol$d("search");var defineWellKnownSymbol$c=wellKnownSymbolDefine;defineWellKnownSymbol$c("species");var defineWellKnownSymbol$b=wellKnownSymbolDefine;defineWellKnownSymbol$b("split");var defineWellKnownSymbol$a=wellKnownSymbolDefine,defineSymbolToPrimitive=symbolDefineToPrimitive;defineWellKnownSymbol$a("toPrimitive"),defineSymbolToPrimitive();var getBuiltIn$a=getBuiltIn$h,defineWellKnownSymbol$9=wellKnownSymbolDefine,setToStringTag$7=setToStringTag$9;defineWellKnownSymbol$9("toStringTag"),setToStringTag$7(getBuiltIn$a("Symbol"),"Symbol");var defineWellKnownSymbol$8=wellKnownSymbolDefine;defineWellKnownSymbol$8("unscopables");var global$g=global$s,setToStringTag$6=setToStringTag$9;setToStringTag$6(global$g.JSON,"JSON",!0);var IteratorPrototype$1,PrototypeOfArrayIteratorPrototype,arrayIterator,path$u=path$y,symbol$5=path$u.Symbol,iterators={},DESCRIPTORS$e=descriptors$2,hasOwn$9=hasOwnProperty_1,FunctionPrototype$1=Function.prototype,getDescriptor=DESCRIPTORS$e&&Object.getOwnPropertyDescriptor,EXISTS=hasOwn$9(FunctionPrototype$1,"name"),PROPER=EXISTS&&"something"===function(){}.name,CONFIGURABLE=EXISTS&&(!DESCRIPTORS$e||DESCRIPTORS$e&&getDescriptor(FunctionPrototype$1,"name").configurable),functionName={EXISTS:EXISTS,PROPER:PROPER,CONFIGURABLE:CONFIGURABLE},fails$n=fails$B,correctPrototypeGetter=!fails$n((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),hasOwn$8=hasOwnProperty_1,isCallable$c=isCallable$q,toObject$a=toObject$f,sharedKey=sharedKey$4,CORRECT_PROTOTYPE_GETTER$1=correctPrototypeGetter,IE_PROTO=sharedKey("IE_PROTO"),$Object=Object,ObjectPrototype$1=$Object.prototype,objectGetPrototypeOf=CORRECT_PROTOTYPE_GETTER$1?$Object.getPrototypeOf:function(e){var t=toObject$a(e);if(hasOwn$8(t,IE_PROTO))return t[IE_PROTO];var r=t.constructor;return isCallable$c(r)&&t instanceof r?r.prototype:t instanceof $Object?ObjectPrototype$1:null},fails$m=fails$B,isCallable$b=isCallable$q,isObject$d=isObject$l,create$c=objectCreate,getPrototypeOf$9=objectGetPrototypeOf,defineBuiltIn$5=defineBuiltIn$8,wellKnownSymbol$f=wellKnownSymbol$q,ITERATOR$8=wellKnownSymbol$f("iterator"),BUGGY_SAFARI_ITERATORS$1=!1;[].keys&&("next"in(arrayIterator=[].keys())?(PrototypeOfArrayIteratorPrototype=getPrototypeOf$9(getPrototypeOf$9(arrayIterator)))!==Object.prototype&&(IteratorPrototype$1=PrototypeOfArrayIteratorPrototype):BUGGY_SAFARI_ITERATORS$1=!0);var NEW_ITERATOR_PROTOTYPE=!isObject$d(IteratorPrototype$1)||fails$m((function(){var e={};return IteratorPrototype$1[ITERATOR$8].call(e)!==e}));isCallable$b((IteratorPrototype$1=NEW_ITERATOR_PROTOTYPE?{}:create$c(IteratorPrototype$1))[ITERATOR$8])||defineBuiltIn$5(IteratorPrototype$1,ITERATOR$8,(function(){return this}));var iteratorsCore={IteratorPrototype:IteratorPrototype$1,BUGGY_SAFARI_ITERATORS:BUGGY_SAFARI_ITERATORS$1},IteratorPrototype=iteratorsCore.IteratorPrototype,create$b=objectCreate,createPropertyDescriptor$3=createPropertyDescriptor$8,setToStringTag$5=setToStringTag$9,Iterators$5=iterators,returnThis$1=function(){return this},iteratorCreateConstructor=function(e,t,r,n){var o=t+" Iterator";return e.prototype=create$b(IteratorPrototype,{next:createPropertyDescriptor$3(+!n,r)}),setToStringTag$5(e,o,!1,!0),Iterators$5[o]=returnThis$1,e},uncurryThis$n=functionUncurryThis,aCallable$g=aCallable$j,functionUncurryThisAccessor=function(e,t,r){try{return uncurryThis$n(aCallable$g(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(e){}},isCallable$a=isCallable$q,$String=String,$TypeError$d=TypeError,aPossiblePrototype$1=function(e){if("object"==typeof e||isCallable$a(e))return e;throw $TypeError$d("Can't set "+$String(e)+" as a prototype")},uncurryThisAccessor=functionUncurryThisAccessor,anObject$b=anObject$g,aPossiblePrototype=aPossiblePrototype$1,objectSetPrototypeOf=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=uncurryThisAccessor(Object.prototype,"__proto__","set"))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return anObject$b(r),aPossiblePrototype(n),t?e(r,n):r.__proto__=n,r}}():void 0),$$1k=_export,call$i=functionCall,FunctionName=functionName,createIteratorConstructor$1=iteratorCreateConstructor,getPrototypeOf$8=objectGetPrototypeOf,setToStringTag$4=setToStringTag$9,defineBuiltIn$4=defineBuiltIn$8,wellKnownSymbol$e=wellKnownSymbol$q,Iterators$4=iterators,IteratorsCore=iteratorsCore,PROPER_FUNCTION_NAME$1=FunctionName.PROPER;FunctionName.CONFIGURABLE,IteratorsCore.IteratorPrototype;var BUGGY_SAFARI_ITERATORS=IteratorsCore.BUGGY_SAFARI_ITERATORS,ITERATOR$7=wellKnownSymbol$e("iterator"),KEYS="keys",VALUES="values",ENTRIES="entries",returnThis=function(){return this},iteratorDefine=function(e,t,r,n,o,i,a){createIteratorConstructor$1(r,t,n);var s,l,c,u=function(e){if(e===o&&$)return $;if(!BUGGY_SAFARI_ITERATORS&&e in d)return d[e];switch(e){case KEYS:case VALUES:case ENTRIES:return function(){return new r(this,e)}}return function(){return new r(this)}},p=t+" Iterator",f=!1,d=e.prototype,h=d[ITERATOR$7]||d["@@iterator"]||o&&d[o],$=!BUGGY_SAFARI_ITERATORS&&h||u(o),y="Array"==t&&d.entries||h;if(y&&(s=getPrototypeOf$8(y.call(new e)))!==Object.prototype&&s.next&&(setToStringTag$4(s,p,!0,!0),Iterators$4[p]=returnThis),PROPER_FUNCTION_NAME$1&&o==VALUES&&h&&h.name!==VALUES&&(f=!0,$=function(){return call$i(h,this)}),o)if(l={values:u(VALUES),keys:i?$:u(KEYS),entries:u(ENTRIES)},a)for(c in l)(BUGGY_SAFARI_ITERATORS||f||!(c in d))&&defineBuiltIn$4(d,c,l[c]);else $$1k({target:t,proto:!0,forced:BUGGY_SAFARI_ITERATORS||f},l);return a&&d[ITERATOR$7]!==$&&defineBuiltIn$4(d,ITERATOR$7,$,{name:o}),Iterators$4[t]=$,l},createIterResultObject$3=function(e,t){return{value:e,done:t}},toIndexedObject$5=toIndexedObject$c,Iterators$3=iterators,InternalStateModule$6=internalState;objectDefineProperty.f;var defineIterator$2=iteratorDefine,createIterResultObject$2=createIterResultObject$3,ARRAY_ITERATOR="Array Iterator",setInternalState$6=InternalStateModule$6.set,getInternalState$1=InternalStateModule$6.getterFor(ARRAY_ITERATOR);defineIterator$2(Array,"Array",(function(e,t){setInternalState$6(this,{type:ARRAY_ITERATOR,target:toIndexedObject$5(e),index:0,kind:t})}),(function(){var e=getInternalState$1(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,createIterResultObject$2(void 0,!0)):createIterResultObject$2("keys"==r?n:"values"==r?t[n]:[n,t[n]],!1)}),"values"),Iterators$3.Arguments=Iterators$3.Array;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},DOMIterables$1=domIterables,global$f=global$s,classof$6=classof$c,createNonEnumerableProperty$4=createNonEnumerableProperty$9,Iterators$2=iterators,wellKnownSymbol$d=wellKnownSymbol$q,TO_STRING_TAG$1=wellKnownSymbol$d("toStringTag");for(var COLLECTION_NAME in DOMIterables$1){var Collection=global$f[COLLECTION_NAME],CollectionPrototype=Collection&&Collection.prototype;CollectionPrototype&&classof$6(CollectionPrototype)!==TO_STRING_TAG$1&&createNonEnumerableProperty$4(CollectionPrototype,TO_STRING_TAG$1,COLLECTION_NAME),Iterators$2[COLLECTION_NAME]=Iterators$2.Array}var parent$2B=symbol$5,symbol$4=parent$2B,defineWellKnownSymbol$7=wellKnownSymbolDefine;defineWellKnownSymbol$7("dispose");var parent$2A=symbol$4,symbol$3=parent$2A,defineWellKnownSymbol$6=wellKnownSymbolDefine;defineWellKnownSymbol$6("asyncDispose");var $$1j=_export,getBuiltIn$9=getBuiltIn$h,uncurryThis$m=functionUncurryThis,Symbol$4=getBuiltIn$9("Symbol"),keyFor2=Symbol$4.keyFor,thisSymbolValue$1=uncurryThis$m(Symbol$4.prototype.valueOf);$$1j({target:"Symbol",stat:!0},{isRegistered:function(e){try{return void 0!==keyFor2(thisSymbolValue$1(e))}catch(e){return!1}}});for(var $$1i=_export,shared=sharedExports,getBuiltIn$8=getBuiltIn$h,uncurryThis$l=functionUncurryThis,isSymbol=isSymbol$5,wellKnownSymbol$c=wellKnownSymbol$q,Symbol$3=getBuiltIn$8("Symbol"),$isWellKnown=Symbol$3.isWellKnown,getOwnPropertyNames$7=getBuiltIn$8("Object","getOwnPropertyNames"),thisSymbolValue=uncurryThis$l(Symbol$3.prototype.valueOf),WellKnownSymbolsStore=shared("wks"),i$2=0,symbolKeys=getOwnPropertyNames$7(Symbol$3),symbolKeysLength=symbolKeys.length;i$2<symbolKeysLength;i$2++)try{var symbolKey=symbolKeys[i$2];isSymbol(Symbol$3[symbolKey])&&wellKnownSymbol$c(symbolKey)}catch(e){}$$1i({target:"Symbol",stat:!0,forced:!0},{isWellKnown:function(e){if($isWellKnown&&$isWellKnown(e))return!0;try{for(var t=thisSymbolValue(e),r=0,n=getOwnPropertyNames$7(WellKnownSymbolsStore),o=n.length;r<o;r++)if(WellKnownSymbolsStore[n[r]]==t)return!0}catch(e){}return!1}});var defineWellKnownSymbol$5=wellKnownSymbolDefine;defineWellKnownSymbol$5("matcher");var defineWellKnownSymbol$4=wellKnownSymbolDefine;defineWellKnownSymbol$4("metadataKey");var defineWellKnownSymbol$3=wellKnownSymbolDefine;defineWellKnownSymbol$3("observable");var defineWellKnownSymbol$2=wellKnownSymbolDefine;defineWellKnownSymbol$2("metadata");var defineWellKnownSymbol$1=wellKnownSymbolDefine;defineWellKnownSymbol$1("patternMatch");var defineWellKnownSymbol=wellKnownSymbolDefine;defineWellKnownSymbol("replaceAll");var parent$2z=symbol$3,symbol$2=parent$2z,symbol$1=symbol$2,_Symbol$1=getDefaultExportFromCjs(symbol$1),uncurryThis$k=functionUncurryThis,toIntegerOrInfinity$3=toIntegerOrInfinity$6,toString$b=toString$f,requireObjectCoercible$5=requireObjectCoercible$8,charAt$4=uncurryThis$k("".charAt),charCodeAt$1=uncurryThis$k("".charCodeAt),stringSlice$4=uncurryThis$k("".slice),createMethod$4=function(e){return function(t,r){var n,o,i=toString$b(requireObjectCoercible$5(t)),a=toIntegerOrInfinity$3(r),s=i.length;return a<0||a>=s?e?"":void 0:(n=charCodeAt$1(i,a))<55296||n>56319||a+1===s||(o=charCodeAt$1(i,a+1))<56320||o>57343?e?charAt$4(i,a):n:e?stringSlice$4(i,a,a+2):o-56320+(n-55296<<10)+65536}},stringMultibyte={codeAt:createMethod$4(!1),charAt:createMethod$4(!0)},charAt$3=stringMultibyte.charAt,toString$a=toString$f,InternalStateModule$5=internalState,defineIterator$1=iteratorDefine,createIterResultObject$1=createIterResultObject$3,STRING_ITERATOR="String Iterator",setInternalState$5=InternalStateModule$5.set,getInternalState=InternalStateModule$5.getterFor(STRING_ITERATOR);defineIterator$1(String,"String",(function(e){setInternalState$5(this,{type:STRING_ITERATOR,string:toString$a(e),index:0})}),(function(){var e,t=getInternalState(this),r=t.string,n=t.index;return n>=r.length?createIterResultObject$1(void 0,!0):(e=charAt$3(r,n),t.index+=e.length,createIterResultObject$1(e,!1))}));var WrappedWellKnownSymbolModule$1=wellKnownSymbolWrapped,iterator$5=WrappedWellKnownSymbolModule$1.f("iterator"),parent$2y=iterator$5,iterator$4=parent$2y,parent$2x=iterator$4,iterator$3=parent$2x,parent$2w=iterator$3,iterator$2=parent$2w,iterator$1=iterator$2,_Symbol$iterator$1=getDefaultExportFromCjs(iterator$1);function _typeof$3(e){return(_typeof$3="function"==typeof _Symbol$1&&"symbol"==typeof _Symbol$iterator$1?function(e){return typeof e}:function(e){return e&&"function"==typeof _Symbol$1&&e.constructor===_Symbol$1&&e!==_Symbol$1.prototype?"symbol":typeof e})(e)}var defineProperty$a={exports:{}},$$1h=_export,DESCRIPTORS$d=descriptors$2,defineProperty$9=objectDefineProperty.f;$$1h({target:"Object",stat:!0,forced:Object.defineProperty!==defineProperty$9,sham:!DESCRIPTORS$d},{defineProperty:defineProperty$9});var path$t=path$y,Object$5=path$t.Object,defineProperty$8=defineProperty$a.exports=function(e,t,r){return Object$5.defineProperty(e,t,r)};Object$5.defineProperty.sham&&(defineProperty$8.sham=!0);var definePropertyExports=defineProperty$a.exports,parent$2v=definePropertyExports,defineProperty$7=parent$2v,parent$2u=defineProperty$7,defineProperty$6=parent$2u,parent$2t=defineProperty$6,defineProperty$5=parent$2t,defineProperty$4=defineProperty$5,_Object$defineProperty$1=getDefaultExportFromCjs(defineProperty$4),$$1g=_export,DESCRIPTORS$c=descriptors$2,create$a=objectCreate;$$1g({target:"Object",stat:!0,sham:!DESCRIPTORS$c},{create:create$a});var path$s=path$y,Object$4=path$s.Object,create$9=function(e,t){return Object$4.create(e,t)},parent$2s=create$9,create$8=parent$2s,parent$2r=create$8,create$7=parent$2r,parent$2q=create$7,create$6=parent$2q,create$5=create$6,_Object$create$1=getDefaultExportFromCjs(create$5),$$1f=_export,fails$l=fails$B,toObject$9=toObject$f,nativeGetPrototypeOf=objectGetPrototypeOf,CORRECT_PROTOTYPE_GETTER=correctPrototypeGetter,FAILS_ON_PRIMITIVES$3=fails$l((function(){nativeGetPrototypeOf(1)}));$$1f({target:"Object",stat:!0,forced:FAILS_ON_PRIMITIVES$3,sham:!CORRECT_PROTOTYPE_GETTER},{getPrototypeOf:function(e){return nativeGetPrototypeOf(toObject$9(e))}});var path$r=path$y,getPrototypeOf$7=path$r.Object.getPrototypeOf,parent$2p=getPrototypeOf$7,getPrototypeOf$6=parent$2p,parent$2o=getPrototypeOf$6,getPrototypeOf$5=parent$2o,parent$2n=getPrototypeOf$5,getPrototypeOf$4=parent$2n,getPrototypeOf$3=getPrototypeOf$4,_Object$getPrototypeOf$1=getDefaultExportFromCjs(getPrototypeOf$3),fails$k=fails$B,arrayMethodIsStrict$7=function(e,t){var r=[][e];return!!r&&fails$k((function(){r.call(null,t||function(){return 1},1)}))},$forEach=arrayIteration.forEach,arrayMethodIsStrict$6=arrayMethodIsStrict$7,STRICT_METHOD$4=arrayMethodIsStrict$6("forEach"),arrayForEach=STRICT_METHOD$4?[].forEach:function(e){return $forEach(this,e,arguments.length>1?arguments[1]:void 0)},$$1e=_export,forEach$8=arrayForEach;$$1e({target:"Array",proto:!0,forced:[].forEach!=arrayForEach},{forEach:arrayForEach});var path$q=path$y,entryVirtual$o=function(e){return path$q[e+"Prototype"]},entryVirtual$n=entryVirtual$o,forEach$7=entryVirtual$n("Array").forEach,parent$2m=forEach$7,forEach$6=parent$2m,classof$5=classof$c,hasOwn$7=hasOwnProperty_1,isPrototypeOf$p=objectIsPrototypeOf,method$l=forEach$6,ArrayPrototype$j=Array.prototype,DOMIterables={DOMTokenList:!0,NodeList:!0},forEach$5=function(e){var t=e.forEach;return e===ArrayPrototype$j||isPrototypeOf$p(ArrayPrototype$j,e)&&t===ArrayPrototype$j.forEach||hasOwn$7(DOMIterables,classof$5(e))?method$l:t},parent$2l=forEach$5,forEach$4=parent$2l,parent$2k=forEach$4,forEach$3=parent$2k,forEach$2=forEach$3,_forEachInstanceProperty$1=getDefaultExportFromCjs(forEach$2),DESCRIPTORS$b=descriptors$2,isArray$9=isArray$d,$TypeError$c=TypeError,getOwnPropertyDescriptor$9=Object.getOwnPropertyDescriptor,SILENT_ON_NON_WRITABLE_LENGTH_SET=DESCRIPTORS$b&&!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$9(e)&&!getOwnPropertyDescriptor$9(e,"length").writable)throw $TypeError$c("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t},$$1d=_export,toObject$8=toObject$f,lengthOfArrayLike$9=lengthOfArrayLike$e,setArrayLength$1=arraySetLength,doesNotExceedSafeInteger$1=doesNotExceedSafeInteger$3,fails$j=fails$B,INCORRECT_TO_LENGTH=fails$j((function(){return 4294967297!==[].push.call({length:4294967296},1)})),properErrorOnNonWritableLength=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}},FORCED$8=INCORRECT_TO_LENGTH||!properErrorOnNonWritableLength();$$1d({target:"Array",proto:!0,arity:1,forced:FORCED$8},{push:function(e){var t=toObject$8(this),r=lengthOfArrayLike$9(t),n=arguments.length;doesNotExceedSafeInteger$1(r+n);for(var o=0;o<n;o++)t[r]=arguments[o],r++;return setArrayLength$1(t,r),r}});var entryVirtual$m=entryVirtual$o,push$e=entryVirtual$m("Array").push,isPrototypeOf$o=objectIsPrototypeOf,method$k=push$e,ArrayPrototype$i=Array.prototype,push$d=function(e){var t=e.push;return e===ArrayPrototype$i||isPrototypeOf$o(ArrayPrototype$i,e)&&t===ArrayPrototype$i.push?method$k:t},parent$2j=push$d,push$c=parent$2j,parent$2i=push$c,push$b=parent$2i,parent$2h=push$b,push$a=parent$2h,push$9=push$a,_pushInstanceProperty=getDefaultExportFromCjs(push$9),$$1c=_export,setPrototypeOf$7=objectSetPrototypeOf;$$1c({target:"Object",stat:!0},{setPrototypeOf:setPrototypeOf$7});var path$p=path$y,setPrototypeOf$6=path$p.Object.setPrototypeOf,parent$2g=setPrototypeOf$6,setPrototypeOf$5=parent$2g,parent$2f=setPrototypeOf$5,setPrototypeOf$4=parent$2f,parent$2e=setPrototypeOf$4,setPrototypeOf$3=parent$2e,setPrototypeOf$2=setPrototypeOf$3,_Object$setPrototypeOf$1=getDefaultExportFromCjs(setPrototypeOf$2),getBuiltIn$7=getBuiltIn$h,uncurryThis$j=functionUncurryThis,getOwnPropertyNamesModule$1=objectGetOwnPropertyNames,getOwnPropertySymbolsModule$1=objectGetOwnPropertySymbols,anObject$a=anObject$g,concat$9=uncurryThis$j([].concat),ownKeys$5=getBuiltIn$7("Reflect","ownKeys")||function(e){var t=getOwnPropertyNamesModule$1.f(anObject$a(e)),r=getOwnPropertySymbolsModule$1.f;return r?concat$9(t,r(e)):t},hasOwn$6=hasOwnProperty_1,ownKeys$4=ownKeys$5,getOwnPropertyDescriptorModule$2=objectGetOwnPropertyDescriptor,definePropertyModule=objectDefineProperty,copyConstructorProperties$1=function(e,t,r){for(var n=ownKeys$4(t),o=definePropertyModule.f,i=getOwnPropertyDescriptorModule$2.f,a=0;a<n.length;a++){var s=n[a];hasOwn$6(e,s)||r&&hasOwn$6(r,s)||o(e,s,i(t,s))}},isObject$c=isObject$l,createNonEnumerableProperty$3=createNonEnumerableProperty$9,installErrorCause$1=function(e,t){isObject$c(t)&&"cause"in t&&createNonEnumerableProperty$3(e,"cause",t.cause)},uncurryThis$i=functionUncurryThis,$Error$1=Error,replace$4=uncurryThis$i("".replace),TEST=String($Error$1("zxcasd").stack),V8_OR_CHAKRA_STACK_ENTRY=/\n\s*at [^:]*:[^\n]*/,IS_V8_OR_CHAKRA_STACK=V8_OR_CHAKRA_STACK_ENTRY.test(TEST),errorStackClear=function(e,t){if(IS_V8_OR_CHAKRA_STACK&&"string"==typeof e&&!$Error$1.prepareStackTrace)for(;t--;)e=replace$4(e,V8_OR_CHAKRA_STACK_ENTRY,"");return e},fails$i=fails$B,createPropertyDescriptor$2=createPropertyDescriptor$8,errorStackInstallable=!fails$i((function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",createPropertyDescriptor$2(1,7)),7!==e.stack)})),createNonEnumerableProperty$2=createNonEnumerableProperty$9,clearErrorStack=errorStackClear,ERROR_STACK_INSTALLABLE=errorStackInstallable,captureStackTrace=Error.captureStackTrace,errorStackInstall=function(e,t,r,n){ERROR_STACK_INSTALLABLE&&(captureStackTrace?captureStackTrace(e,t):createNonEnumerableProperty$2(e,"stack",clearErrorStack(r,n)))},wellKnownSymbol$b=wellKnownSymbol$q,Iterators$1=iterators,ITERATOR$6=wellKnownSymbol$b("iterator"),ArrayPrototype$h=Array.prototype,isArrayIteratorMethod$2=function(e){return void 0!==e&&(Iterators$1.Array===e||ArrayPrototype$h[ITERATOR$6]===e)},classof$4=classof$c,getMethod$1=getMethod$3,isNullOrUndefined$3=isNullOrUndefined$6,Iterators=iterators,wellKnownSymbol$a=wellKnownSymbol$q,ITERATOR$5=wellKnownSymbol$a("iterator"),getIteratorMethod$a=function(e){if(!isNullOrUndefined$3(e))return getMethod$1(e,ITERATOR$5)||getMethod$1(e,"@@iterator")||Iterators[classof$4(e)]},call$h=functionCall,aCallable$f=aCallable$j,anObject$9=anObject$g,tryToString$4=tryToString$7,getIteratorMethod$9=getIteratorMethod$a,$TypeError$b=TypeError,getIterator$3=function(e,t){var r=arguments.length<2?getIteratorMethod$9(e):t;if(aCallable$f(r))return anObject$9(call$h(r,e));throw $TypeError$b(tryToString$4(e)+" is not iterable")},call$g=functionCall,anObject$8=anObject$g,getMethod=getMethod$3,iteratorClose$2=function(e,t,r){var n,o;anObject$8(e);try{if(!(n=getMethod(e,"return"))){if("throw"===t)throw r;return r}n=call$g(n,e)}catch(e){o=!0,n=e}if("throw"===t)throw r;if(o)throw n;return anObject$8(n),r},bind$o=functionBindContext,call$f=functionCall,anObject$7=anObject$g,tryToString$3=tryToString$7,isArrayIteratorMethod$1=isArrayIteratorMethod$2,lengthOfArrayLike$8=lengthOfArrayLike$e,isPrototypeOf$n=objectIsPrototypeOf,getIterator$2=getIterator$3,getIteratorMethod$8=getIteratorMethod$a,iteratorClose$1=iteratorClose$2,$TypeError$a=TypeError,Result=function(e,t){this.stopped=e,this.result=t},ResultPrototype=Result.prototype,iterate$l=function(e,t,r){var n,o,i,a,s,l,c,u=r&&r.that,p=!(!r||!r.AS_ENTRIES),f=!(!r||!r.IS_RECORD),d=!(!r||!r.IS_ITERATOR),h=!(!r||!r.INTERRUPTED),$=bind$o(t,u),y=function(e){return n&&iteratorClose$1(n,"normal",e),new Result(!0,e)},g=function(e){return p?(anObject$7(e),h?$(e[0],e[1],y):$(e[0],e[1])):h?$(e,y):$(e)};if(f)n=e.iterator;else if(d)n=e;else{if(!(o=getIteratorMethod$8(e)))throw $TypeError$a(tryToString$3(e)+" is not iterable");if(isArrayIteratorMethod$1(o)){for(i=0,a=lengthOfArrayLike$8(e);a>i;i++)if((s=g(e[i]))&&isPrototypeOf$n(ResultPrototype,s))return s;return new Result(!1)}n=getIterator$2(e,o)}for(l=f?e.next:n.next;!(c=call$f(l,n)).done;){try{s=g(c.value)}catch(e){iteratorClose$1(n,"throw",e)}if("object"==typeof s&&s&&isPrototypeOf$n(ResultPrototype,s))return s}return new Result(!1)},toString$9=toString$f,normalizeStringArgument$1=function(e,t){return void 0===e?arguments.length<2?"":t:toString$9(e)},$$1b=_export,isPrototypeOf$m=objectIsPrototypeOf,getPrototypeOf$2=objectGetPrototypeOf,setPrototypeOf$1=objectSetPrototypeOf,copyConstructorProperties=copyConstructorProperties$1,create$4=objectCreate,createNonEnumerableProperty$1=createNonEnumerableProperty$9,createPropertyDescriptor$1=createPropertyDescriptor$8,installErrorCause=installErrorCause$1,installErrorStack=errorStackInstall,iterate$k=iterate$l,normalizeStringArgument=normalizeStringArgument$1,wellKnownSymbol$9=wellKnownSymbol$q,TO_STRING_TAG=wellKnownSymbol$9("toStringTag"),$Error=Error,push$8=[].push,$AggregateError=function(e,t){var r,n=isPrototypeOf$m(AggregateErrorPrototype,this);setPrototypeOf$1?r=setPrototypeOf$1($Error(),n?getPrototypeOf$2(this):AggregateErrorPrototype):(r=n?this:create$4(AggregateErrorPrototype),createNonEnumerableProperty$1(r,TO_STRING_TAG,"Error")),void 0!==t&&createNonEnumerableProperty$1(r,"message",normalizeStringArgument(t)),installErrorStack(r,$AggregateError,r.stack,1),arguments.length>2&&installErrorCause(r,arguments[2]);var o=[];return iterate$k(e,push$8,{that:o}),createNonEnumerableProperty$1(r,"errors",o),r};setPrototypeOf$1?setPrototypeOf$1($AggregateError,$Error):copyConstructorProperties($AggregateError,$Error,{name:!0});var AggregateErrorPrototype=$AggregateError.prototype=create$4($Error.prototype,{constructor:createPropertyDescriptor$1(1,$AggregateError),message:createPropertyDescriptor$1(1,""),name:createPropertyDescriptor$1(1,"AggregateError")});$$1b({global:!0,constructor:!0,arity:2},{AggregateError:$AggregateError});var $location,defer,channel,port,classof$3=classofRaw$2,engineIsNode="undefined"!=typeof process&&"process"==classof$3(process),getBuiltIn$6=getBuiltIn$h,defineBuiltInAccessor$3=defineBuiltInAccessor$5,wellKnownSymbol$8=wellKnownSymbol$q,DESCRIPTORS$a=descriptors$2,SPECIES$3=wellKnownSymbol$8("species"),setSpecies$2=function(e){var t=getBuiltIn$6(e);DESCRIPTORS$a&&t&&!t[SPECIES$3]&&defineBuiltInAccessor$3(t,SPECIES$3,{configurable:!0,get:function(){return this}})},isPrototypeOf$l=objectIsPrototypeOf,$TypeError$9=TypeError,anInstance$5=function(e,t){if(isPrototypeOf$l(t,e))return e;throw $TypeError$9("Incorrect invocation")},isConstructor$2=isConstructor$4,tryToString$2=tryToString$7,$TypeError$8=TypeError,aConstructor$3=function(e){if(isConstructor$2(e))return e;throw $TypeError$8(tryToString$2(e)+" is not a constructor")},anObject$6=anObject$g,aConstructor$2=aConstructor$3,isNullOrUndefined$2=isNullOrUndefined$6,wellKnownSymbol$7=wellKnownSymbol$q,SPECIES$2=wellKnownSymbol$7("species"),speciesConstructor$2=function(e,t){var r,n=anObject$6(e).constructor;return void 0===n||isNullOrUndefined$2(r=anObject$6(n)[SPECIES$2])?t:aConstructor$2(r)},$TypeError$7=TypeError,validateArgumentsLength$5=function(e,t){if(e<t)throw $TypeError$7("Not enough arguments");return e},userAgent$5=engineUserAgent,engineIsIos=/(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$5),global$e=global$s,apply$4=functionApply,bind$n=functionBindContext,isCallable$9=isCallable$q,hasOwn$5=hasOwnProperty_1,fails$h=fails$B,html=html$2,arraySlice$5=arraySlice$7,createElement=documentCreateElement$1,validateArgumentsLength$4=validateArgumentsLength$5,IS_IOS$1=engineIsIos,IS_NODE$4=engineIsNode,set$6=global$e.setImmediate,clear=global$e.clearImmediate,process$3=global$e.process,Dispatch=global$e.Dispatch,Function$2=global$e.Function,MessageChannel=global$e.MessageChannel,String$1=global$e.String,counter=0,queue$2={},ONREADYSTATECHANGE="onreadystatechange";fails$h((function(){$location=global$e.location}));var run=function(e){if(hasOwn$5(queue$2,e)){var t=queue$2[e];delete queue$2[e],t()}},runner=function(e){return function(){run(e)}},eventListener=function(e){run(e.data)},globalPostMessageDefer=function(e){global$e.postMessage(String$1(e),$location.protocol+"//"+$location.host)};set$6&&clear||(set$6=function(e){validateArgumentsLength$4(arguments.length,1);var t=isCallable$9(e)?e:Function$2(e),r=arraySlice$5(arguments,1);return queue$2[++counter]=function(){apply$4(t,void 0,r)},defer(counter),counter},clear=function(e){delete queue$2[e]},IS_NODE$4?defer=function(e){process$3.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=eventListener,defer=bind$n(port.postMessage,port)):global$e.addEventListener&&isCallable$9(global$e.postMessage)&&!global$e.importScripts&&$location&&"file:"!==$location.protocol&&!fails$h(globalPostMessageDefer)?(defer=globalPostMessageDefer,global$e.addEventListener("message",eventListener,!1)):defer=ONREADYSTATECHANGE in createElement("script")?function(e){html.appendChild(createElement("script"))[ONREADYSTATECHANGE]=function(){html.removeChild(this),run(e)}}:function(e){setTimeout(runner(e),0)});var task$1={set:set$6,clear:clear},Queue$2=function(){this.head=null,this.tail=null};Queue$2.prototype={add:function(e){var t={item:e,next:null},r=this.tail;r?r.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}};var notify$1,toggle,node,promise$6,then,queue$1=Queue$2,userAgent$4=engineUserAgent,engineIsIosPebble=/ipad|iphone|ipod/i.test(userAgent$4)&&"undefined"!=typeof Pebble,userAgent$3=engineUserAgent,engineIsWebosWebkit=/web0s(?!.*chrome)/i.test(userAgent$3),global$d=global$s,bind$m=functionBindContext,getOwnPropertyDescriptor$8=objectGetOwnPropertyDescriptor.f,macrotask=task$1.set,Queue$1=queue$1,IS_IOS=engineIsIos,IS_IOS_PEBBLE=engineIsIosPebble,IS_WEBOS_WEBKIT=engineIsWebosWebkit,IS_NODE$3=engineIsNode,MutationObserver=global$d.MutationObserver||global$d.WebKitMutationObserver,document$2=global$d.document,process$2=global$d.process,Promise$1=global$d.Promise,queueMicrotaskDescriptor=getOwnPropertyDescriptor$8(global$d,"queueMicrotask"),microtask$1=queueMicrotaskDescriptor&&queueMicrotaskDescriptor.value;if(!microtask$1){var queue=new Queue$1,flush=function(){var e,t;for(IS_NODE$3&&(e=process$2.domain)&&e.exit();t=queue.get();)try{t()}catch(e){throw queue.head&¬ify$1(),e}e&&e.enter()};IS_IOS||IS_NODE$3||IS_WEBOS_WEBKIT||!MutationObserver||!document$2?!IS_IOS_PEBBLE&&Promise$1&&Promise$1.resolve?((promise$6=Promise$1.resolve(void 0)).constructor=Promise$1,then=bind$m(promise$6.then,promise$6),notify$1=function(){then(flush)}):IS_NODE$3?notify$1=function(){process$2.nextTick(flush)}:(macrotask=bind$m(macrotask,global$d),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}),microtask$1=function(e){queue.head||notify$1(),queue.add(e)}}var microtask_1=microtask$1,hostReportErrors$1=function(e,t){try{1==arguments.length?console.error(e):console.error(e,t)}catch(e){}},perform$6=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},global$c=global$s,promiseNativeConstructor=global$c.Promise,engineIsDeno="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,IS_DENO$1=engineIsDeno,IS_NODE$2=engineIsNode,engineIsBrowser=!IS_DENO$1&&!IS_NODE$2&&"object"==typeof window&&"object"==typeof document,global$b=global$s,NativePromiseConstructor$5=promiseNativeConstructor,isCallable$8=isCallable$q,isForced=isForced_1,inspectSource=inspectSource$2,wellKnownSymbol$6=wellKnownSymbol$q,IS_BROWSER=engineIsBrowser,IS_DENO=engineIsDeno,V8_VERSION=engineV8Version,NativePromisePrototype$2=NativePromiseConstructor$5&&NativePromiseConstructor$5.prototype,SPECIES$1=wellKnownSymbol$6("species"),SUBCLASSING=!1,NATIVE_PROMISE_REJECTION_EVENT$1=isCallable$8(global$b.PromiseRejectionEvent),FORCED_PROMISE_CONSTRUCTOR$5=isForced("Promise",(function(){var e=inspectSource(NativePromiseConstructor$5),t=e!==String(NativePromiseConstructor$5);if(!t&&66===V8_VERSION)return!0;if(!NativePromisePrototype$2.catch||!NativePromisePrototype$2.finally)return!0;if(!V8_VERSION||V8_VERSION<51||!/native code/.test(e)){var r=new NativePromiseConstructor$5((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};if((r.constructor={})[SPECIES$1]=n,!(SUBCLASSING=r.then((function(){}))instanceof n))return!0}return!t&&(IS_BROWSER||IS_DENO)&&!NATIVE_PROMISE_REJECTION_EVENT$1})),promiseConstructorDetection={CONSTRUCTOR:FORCED_PROMISE_CONSTRUCTOR$5,REJECTION_EVENT:NATIVE_PROMISE_REJECTION_EVENT$1,SUBCLASSING:SUBCLASSING},newPromiseCapability$2={},aCallable$e=aCallable$j,$TypeError$6=TypeError,PromiseCapability=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw $TypeError$6("Bad Promise constructor");t=e,r=n})),this.resolve=aCallable$e(t),this.reject=aCallable$e(r)};newPromiseCapability$2.f=function(e){return new PromiseCapability(e)};var $$1a=_export,IS_NODE$1=engineIsNode,global$a=global$s,call$e=functionCall,defineBuiltIn$3=defineBuiltIn$8,setToStringTag$3=setToStringTag$9,setSpecies$1=setSpecies$2,aCallable$d=aCallable$j,isCallable$7=isCallable$q,isObject$b=isObject$l,anInstance$4=anInstance$5,speciesConstructor$1=speciesConstructor$2,task=task$1.set,microtask=microtask_1,hostReportErrors=hostReportErrors$1,perform$5=perform$6,Queue=queue$1,InternalStateModule$4=internalState,NativePromiseConstructor$4=promiseNativeConstructor,PromiseConstructorDetection=promiseConstructorDetection,newPromiseCapabilityModule$6=newPromiseCapability$2,PROMISE="Promise",FORCED_PROMISE_CONSTRUCTOR$4=PromiseConstructorDetection.CONSTRUCTOR,NATIVE_PROMISE_REJECTION_EVENT=PromiseConstructorDetection.REJECTION_EVENT;PromiseConstructorDetection.SUBCLASSING;var Internal,OwnPromiseCapability,PromiseWrapper,getInternalPromiseState=InternalStateModule$4.getterFor(PROMISE),setInternalState$4=InternalStateModule$4.set,NativePromisePrototype$1=NativePromiseConstructor$4&&NativePromiseConstructor$4.prototype,PromiseConstructor=NativePromiseConstructor$4,PromisePrototype=NativePromisePrototype$1,TypeError$3=global$a.TypeError,document$1=global$a.document,process$1=global$a.process,newPromiseCapability$1=newPromiseCapabilityModule$6.f,newGenericPromiseCapability=newPromiseCapability$1,DISPATCH_EVENT=!!(document$1&&document$1.createEvent&&global$a.dispatchEvent),UNHANDLED_REJECTION="unhandledrejection",REJECTION_HANDLED="rejectionhandled",PENDING=0,FULFILLED=1,REJECTED=2,HANDLED=1,UNHANDLED=2,isThenable=function(e){var t;return!(!isObject$b(e)||!isCallable$7(t=e.then))&&t},callReaction=function(e,t){var r,n,o,i=t.value,a=t.state==FULFILLED,s=a?e.ok:e.fail,l=e.resolve,c=e.reject,u=e.domain;try{s?(a||(t.rejection===UNHANDLED&&onHandleUnhandled(t),t.rejection=HANDLED),!0===s?r=i:(u&&u.enter(),r=s(i),u&&(u.exit(),o=!0)),r===e.promise?c(TypeError$3("Promise-chain cycle")):(n=isThenable(r))?call$e(n,r,l,c):l(r)):c(i)}catch(e){u&&!o&&u.exit(),c(e)}},notify=function(e,t){e.notified||(e.notified=!0,microtask((function(){for(var r,n=e.reactions;r=n.get();)callReaction(r,e);e.notified=!1,t&&!e.rejection&&onUnhandled(e)})))},dispatchEvent=function(e,t,r){var n,o;DISPATCH_EVENT?((n=document$1.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),global$a.dispatchEvent(n)):n={promise:t,reason:r},!NATIVE_PROMISE_REJECTION_EVENT&&(o=global$a["on"+e])?o(n):e===UNHANDLED_REJECTION&&hostReportErrors("Unhandled promise rejection",r)},onUnhandled=function(e){call$e(task,global$a,(function(){var t,r=e.facade,n=e.value;if(isUnhandled(e)&&(t=perform$5((function(){IS_NODE$1?process$1.emit("unhandledRejection",n,r):dispatchEvent(UNHANDLED_REJECTION,r,n)})),e.rejection=IS_NODE$1||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$a,(function(){var t=e.facade;IS_NODE$1?process$1.emit("rejectionHandled",t):dispatchEvent(REJECTION_HANDLED,t,e.value)}))},bind$l=function(e,t,r){return function(n){e(t,n,r)}},internalReject=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=REJECTED,notify(e,!0))},internalResolve=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw TypeError$3("Promise can't be resolved itself");var n=isThenable(t);n?microtask((function(){var r={done:!1};try{call$e(n,t,bind$l(internalResolve,r,e),bind$l(internalReject,r,e))}catch(t){internalReject(r,t,e)}})):(e.value=t,e.state=FULFILLED,notify(e,!1))}catch(t){internalReject({done:!1},t,e)}}};FORCED_PROMISE_CONSTRUCTOR$4&&(PromisePrototype=(PromiseConstructor=function(e){anInstance$4(this,PromisePrototype),aCallable$d(e),call$e(Internal,this);var t=getInternalPromiseState(this);try{e(bind$l(internalResolve,t),bind$l(internalReject,t))}catch(e){internalReject(t,e)}}).prototype,(Internal=function(e){setInternalState$4(this,{type:PROMISE,done:!1,notified:!1,parent:!1,reactions:new Queue,rejection:!1,state:PENDING,value:void 0})}).prototype=defineBuiltIn$3(PromisePrototype,"then",(function(e,t){var r=getInternalPromiseState(this),n=newPromiseCapability$1(speciesConstructor$1(this,PromiseConstructor));return r.parent=!0,n.ok=!isCallable$7(e)||e,n.fail=isCallable$7(t)&&t,n.domain=IS_NODE$1?process$1.domain:void 0,r.state==PENDING?r.reactions.add(n):microtask((function(){callReaction(n,r)})),n.promise})),OwnPromiseCapability=function(){var e=new Internal,t=getInternalPromiseState(e);this.promise=e,this.resolve=bind$l(internalResolve,t),this.reject=bind$l(internalReject,t)},newPromiseCapabilityModule$6.f=newPromiseCapability$1=function(e){return e===PromiseConstructor||e===PromiseWrapper?new OwnPromiseCapability(e):newGenericPromiseCapability(e)}),$$1a({global:!0,constructor:!0,wrap:!0,forced:FORCED_PROMISE_CONSTRUCTOR$4},{Promise:PromiseConstructor}),setToStringTag$3(PromiseConstructor,PROMISE,!1,!0),setSpecies$1(PROMISE);var wellKnownSymbol$5=wellKnownSymbol$q,ITERATOR$4=wellKnownSymbol$5("iterator"),SAFE_CLOSING=!1;try{var called=0,iteratorWithReturn={next:function(){return{done:!!called++}},return:function(){SAFE_CLOSING=!0}};iteratorWithReturn[ITERATOR$4]=function(){return this},Array.from(iteratorWithReturn,(function(){throw 2}))}catch(e){}var checkCorrectnessOfIteration$2=function(e,t){if(!t&&!SAFE_CLOSING)return!1;var r=!1;try{var n={};n[ITERATOR$4]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(e){}return r},NativePromiseConstructor$3=promiseNativeConstructor,checkCorrectnessOfIteration$1=checkCorrectnessOfIteration$2,FORCED_PROMISE_CONSTRUCTOR$3=promiseConstructorDetection.CONSTRUCTOR,promiseStaticsIncorrectIteration=FORCED_PROMISE_CONSTRUCTOR$3||!checkCorrectnessOfIteration$1((function(e){NativePromiseConstructor$3.all(e).then(void 0,(function(){}))})),$$19=_export,call$d=functionCall,aCallable$c=aCallable$j,newPromiseCapabilityModule$5=newPromiseCapability$2,perform$4=perform$6,iterate$j=iterate$l,PROMISE_STATICS_INCORRECT_ITERATION$3=promiseStaticsIncorrectIteration;$$19({target:"Promise",stat:!0,forced:PROMISE_STATICS_INCORRECT_ITERATION$3},{all:function(e){var t=this,r=newPromiseCapabilityModule$5.f(t),n=r.resolve,o=r.reject,i=perform$4((function(){var r=aCallable$c(t.resolve),i=[],a=0,s=1;iterate$j(e,(function(e){var l=a++,c=!1;s++,call$d(r,t,e).then((function(e){c||(c=!0,i[l]=e,--s||n(i))}),o)})),--s||n(i)}));return i.error&&o(i.value),r.promise}});var $$18=_export,FORCED_PROMISE_CONSTRUCTOR$2=promiseConstructorDetection.CONSTRUCTOR,NativePromiseConstructor$2=promiseNativeConstructor;promiseNativeConstructor&&promiseNativeConstructor.prototype,$$18({target:"Promise",proto:!0,forced:FORCED_PROMISE_CONSTRUCTOR$2,real:!0},{catch:function(e){return this.then(void 0,e)}});var $$17=_export,call$c=functionCall,aCallable$b=aCallable$j,newPromiseCapabilityModule$4=newPromiseCapability$2,perform$3=perform$6,iterate$i=iterate$l,PROMISE_STATICS_INCORRECT_ITERATION$2=promiseStaticsIncorrectIteration;$$17({target:"Promise",stat:!0,forced:PROMISE_STATICS_INCORRECT_ITERATION$2},{race:function(e){var t=this,r=newPromiseCapabilityModule$4.f(t),n=r.reject,o=perform$3((function(){var o=aCallable$b(t.resolve);iterate$i(e,(function(e){call$c(o,t,e).then(r.resolve,n)}))}));return o.error&&n(o.value),r.promise}});var $$16=_export,call$b=functionCall,newPromiseCapabilityModule$3=newPromiseCapability$2,FORCED_PROMISE_CONSTRUCTOR$1=promiseConstructorDetection.CONSTRUCTOR;$$16({target:"Promise",stat:!0,forced:FORCED_PROMISE_CONSTRUCTOR$1},{reject:function(e){var t=newPromiseCapabilityModule$3.f(this);return call$b(t.reject,void 0,e),t.promise}});var anObject$5=anObject$g,isObject$a=isObject$l,newPromiseCapability=newPromiseCapability$2,promiseResolve$2=function(e,t){if(anObject$5(e),isObject$a(t)&&t.constructor===e)return t;var r=newPromiseCapability.f(e);return(0,r.resolve)(t),r.promise},$$15=_export,getBuiltIn$5=getBuiltIn$h,IS_PURE$1=isPure,NativePromiseConstructor$1=promiseNativeConstructor,FORCED_PROMISE_CONSTRUCTOR=promiseConstructorDetection.CONSTRUCTOR,promiseResolve$1=promiseResolve$2,PromiseConstructorWrapper=getBuiltIn$5("Promise"),CHECK_WRAPPER=!FORCED_PROMISE_CONSTRUCTOR;$$15({target:"Promise",stat:!0,forced:IS_PURE$1},{resolve:function(e){return promiseResolve$1(CHECK_WRAPPER&&this===PromiseConstructorWrapper?NativePromiseConstructor$1:this,e)}});var $$14=_export,call$a=functionCall,aCallable$a=aCallable$j,newPromiseCapabilityModule$2=newPromiseCapability$2,perform$2=perform$6,iterate$h=iterate$l,PROMISE_STATICS_INCORRECT_ITERATION$1=promiseStaticsIncorrectIteration;$$14({target:"Promise",stat:!0,forced:PROMISE_STATICS_INCORRECT_ITERATION$1},{allSettled:function(e){var t=this,r=newPromiseCapabilityModule$2.f(t),n=r.resolve,o=r.reject,i=perform$2((function(){var r=aCallable$a(t.resolve),o=[],i=0,a=1;iterate$h(e,(function(e){var s=i++,l=!1;a++,call$a(r,t,e).then((function(e){l||(l=!0,o[s]={status:"fulfilled",value:e},--a||n(o))}),(function(e){l||(l=!0,o[s]={status:"rejected",reason:e},--a||n(o))}))})),--a||n(o)}));return i.error&&o(i.value),r.promise}});var $$13=_export,call$9=functionCall,aCallable$9=aCallable$j,getBuiltIn$4=getBuiltIn$h,newPromiseCapabilityModule$1=newPromiseCapability$2,perform$1=perform$6,iterate$g=iterate$l,PROMISE_STATICS_INCORRECT_ITERATION=promiseStaticsIncorrectIteration,PROMISE_ANY_ERROR="No one promise resolved";$$13({target:"Promise",stat:!0,forced:PROMISE_STATICS_INCORRECT_ITERATION},{any:function(e){var t=this,r=getBuiltIn$4("AggregateError"),n=newPromiseCapabilityModule$1.f(t),o=n.resolve,i=n.reject,a=perform$1((function(){var n=aCallable$9(t.resolve),a=[],s=0,l=1,c=!1;iterate$g(e,(function(e){var u=s++,p=!1;l++,call$9(n,t,e).then((function(e){p||c||(c=!0,o(e))}),(function(e){p||c||(p=!0,a[u]=e,--l||i(new r(a,PROMISE_ANY_ERROR)))}))})),--l||i(new r(a,PROMISE_ANY_ERROR))}));return a.error&&i(a.value),n.promise}});var $$12=_export,NativePromiseConstructor=promiseNativeConstructor,fails$g=fails$B,getBuiltIn$3=getBuiltIn$h,isCallable$6=isCallable$q,speciesConstructor=speciesConstructor$2,promiseResolve=promiseResolve$2,NativePromisePrototype=NativePromiseConstructor&&NativePromiseConstructor.prototype,NON_GENERIC=!!NativePromiseConstructor&&fails$g((function(){NativePromisePrototype.finally.call({then:function(){}},(function(){}))}));$$12({target:"Promise",proto:!0,real:!0,forced:NON_GENERIC},{finally:function(e){var t=speciesConstructor(this,getBuiltIn$3("Promise")),r=isCallable$6(e);return this.then(r?function(r){return promiseResolve(t,e()).then((function(){return r}))}:e,r?function(r){return promiseResolve(t,e()).then((function(){throw r}))}:e)}});var path$o=path$y,promise$5=path$o.Promise,parent$2d=promise$5,promise$4=parent$2d,parent$2c=promise$4,promise$3=parent$2c,$$11=_export,newPromiseCapabilityModule=newPromiseCapability$2,perform=perform$6;$$11({target:"Promise",stat:!0,forced:!0},{try:function(e){var t=newPromiseCapabilityModule.f(this),r=perform(e);return(r.error?t.reject:t.resolve)(r.value),t.promise}});var parent$2b=promise$3,promise$2=parent$2b,promise$1=promise$2,_Promise$1=getDefaultExportFromCjs(promise$1),$$10=_export,uncurryThis$h=functionUncurryThis,isArray$8=isArray$d,nativeReverse=uncurryThis$h([].reverse),test$1=[1,2];$$10({target:"Array",proto:!0,forced:String(test$1)===String(test$1.reverse())},{reverse:function(){return isArray$8(this)&&(this.length=this.length),nativeReverse(this)}});var entryVirtual$l=entryVirtual$o,reverse$6=entryVirtual$l("Array").reverse,isPrototypeOf$k=objectIsPrototypeOf,method$j=reverse$6,ArrayPrototype$g=Array.prototype,reverse$5=function(e){var t=e.reverse;return e===ArrayPrototype$g||isPrototypeOf$k(ArrayPrototype$g,e)&&t===ArrayPrototype$g.reverse?method$j:t},parent$2a=reverse$5,reverse$4=parent$2a,parent$29=reverse$4,reverse$3=parent$29,parent$28=reverse$3,reverse$2=parent$28,reverse$1=reverse$2,_reverseInstanceProperty$1=getDefaultExportFromCjs(reverse$1),$$$=_export,isArray$7=isArray$d,isConstructor$1=isConstructor$4,isObject$9=isObject$l,toAbsoluteIndex$3=toAbsoluteIndex$6,lengthOfArrayLike$7=lengthOfArrayLike$e,toIndexedObject$4=toIndexedObject$c,createProperty$3=createProperty$6,wellKnownSymbol$4=wellKnownSymbol$q,arrayMethodHasSpeciesSupport$3=arrayMethodHasSpeciesSupport$5,nativeSlice=arraySlice$7,HAS_SPECIES_SUPPORT$3=arrayMethodHasSpeciesSupport$3("slice"),SPECIES=wellKnownSymbol$4("species"),$Array$1=Array,max$1=Math.max;$$$({target:"Array",proto:!0,forced:!HAS_SPECIES_SUPPORT$3},{slice:function(e,t){var r,n,o,i=toIndexedObject$4(this),a=lengthOfArrayLike$7(i),s=toAbsoluteIndex$3(e,a),l=toAbsoluteIndex$3(void 0===t?a:t,a);if(isArray$7(i)&&(r=i.constructor,(isConstructor$1(r)&&(r===$Array$1||isArray$7(r.prototype))||isObject$9(r)&&null===(r=r[SPECIES]))&&(r=void 0),r===$Array$1||void 0===r))return nativeSlice(i,s,l);for(n=new(void 0===r?$Array$1:r)(max$1(l-s,0)),o=0;s<l;s++,o++)s in i&&createProperty$3(n,o,i[s]);return n.length=o,n}});var entryVirtual$k=entryVirtual$o,slice$6=entryVirtual$k("Array").slice,isPrototypeOf$j=objectIsPrototypeOf,method$i=slice$6,ArrayPrototype$f=Array.prototype,slice$5=function(e){var t=e.slice;return e===ArrayPrototype$f||isPrototypeOf$j(ArrayPrototype$f,e)&&t===ArrayPrototype$f.slice?method$i:t},parent$27=slice$5,slice$4=parent$27,parent$26=slice$4,slice$3=parent$26,parent$25=slice$3,slice$2=parent$25,slice$1=slice$2,_sliceInstanceProperty$1=getDefaultExportFromCjs(slice$1);function _regeneratorRuntime$1(){_regeneratorRuntime$1=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=_Object$defineProperty$1||function(e,t,r){e[t]=r.value},o="function"==typeof _Symbol$1?_Symbol$1:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function l(e,t,r){return _Object$defineProperty$1(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,o){var i=t&&t.prototype instanceof f?t:f,a=_Object$create$1(i.prototype),s=new T(o||[]);return n(a,"_invoke",{value:_(e,r,s)}),a}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var p={};function f(){}function d(){}function h(){}var $={};l($,i,(function(){return this}));var y=_Object$getPrototypeOf$1&&_Object$getPrototypeOf$1(_Object$getPrototypeOf$1(S([])));y&&y!==t&&r.call(y,i)&&($=y);var g=h.prototype=f.prototype=_Object$create$1($);function v(e){var t;_forEachInstanceProperty$1(t=["next","throw","return"]).call(t,(function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function m(e,t){function o(n,i,a,s){var l=u(e[n],e,i);if("throw"!==l.type){var c=l.arg,p=c.value;return p&&"object"==_typeof$3(p)&&r.call(p,"__await")?t.resolve(p.__await).then((function(e){o("next",e,a,s)}),(function(e){o("throw",e,a,s)})):t.resolve(p).then((function(e){c.value=e,a(c)}),(function(e){return o("throw",e,a,s)}))}s(l.arg)}var i;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){o(e,r,t,n)}))}return i=i?i.then(n,n):n()}})}function _(e,t,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=b(a,r);if(s){if(s===p)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===p)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function b(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,b(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),p;var o=u(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,p;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function I(e){var t,r={tryLoc:e[0]};1 in e&&(r.catchLoc=e[1]),2 in e&&(r.finallyLoc=e[2],r.afterLoc=e[3]),_pushInstanceProperty(t=this.tryEntries).call(t,r)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],_forEachInstanceProperty$1(e).call(e,I,this),this.reset(!0)}function S(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:P}}function P(){return{value:void 0,done:!0}}return d.prototype=h,n(g,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:d,configurable:!0}),d.displayName=l(h,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return _Object$setPrototypeOf$1?_Object$setPrototypeOf$1(e,h):(e.__proto__=h,l(e,s,"GeneratorFunction")),e.prototype=_Object$create$1(g),e},e.awrap=function(e){return{__await:e}},v(m.prototype),l(m.prototype,a,(function(){return this})),e.AsyncIterator=m,e.async=function(t,r,n,o,i){void 0===i&&(i=_Promise$1);var a=new m(c(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},v(g),l(g,s,"Generator"),l(g,i,(function(){return this})),l(g,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)_pushInstanceProperty(r).call(r,n);return _reverseInstanceProperty$1(r).call(r),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,T.prototype={constructor:T,reset:function(e){var t;if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,_forEachInstanceProperty$1(t=this.tryEntries).call(t,E),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+_sliceInstanceProperty$1(n).call(n,1))&&(this[n]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),l=r.call(i,"finallyLoc");if(s&&l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(r),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},e}function asyncGeneratorStep$1(e,t,r,n,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void r(e)}s.done?t(l):_Promise$1.resolve(l).then(n,o)}function _asyncToGenerator$1(e){return function(){var t=this,r=arguments;return new _Promise$1((function(n,o){var i=e.apply(t,r);function a(e){asyncGeneratorStep$1(i,n,o,a,s,"next",e)}function s(e){asyncGeneratorStep$1(i,n,o,a,s,"throw",e)}a(void 0)}))}}function _classCallCheck$3(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var WrappedWellKnownSymbolModule=wellKnownSymbolWrapped,toPrimitive$5=WrappedWellKnownSymbolModule.f("toPrimitive"),parent$24=toPrimitive$5,toPrimitive$4=parent$24,parent$23=toPrimitive$4,toPrimitive$3=parent$23,parent$22=toPrimitive$3,toPrimitive$2=parent$22,toPrimitive$1=toPrimitive$2,_Symbol$toPrimitive$1=getDefaultExportFromCjs(toPrimitive$1);function _toPrimitive$3(e,t){if("object"!==_typeof$3(e)||null===e)return e;var r=e[_Symbol$toPrimitive$1];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==_typeof$3(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _toPropertyKey$3(e){var t=_toPrimitive$3(e,"string");return"symbol"===_typeof$3(t)?t:String(t)}function _defineProperties$3(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),_Object$defineProperty$1(e,_toPropertyKey$3(n.key),n)}}function _createClass$3(e,t,r){return t&&_defineProperties$3(e.prototype,t),r&&_defineProperties$3(e,r),_Object$defineProperty$1(e,"prototype",{writable:!1}),e}function _assertThisInitialized$2(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var hasOwn$4=hasOwnProperty_1,isDataDescriptor$1=function(e){return void 0!==e&&(hasOwn$4(e,"value")||hasOwn$4(e,"writable"))},$$_=_export,call$8=functionCall,isObject$8=isObject$l,anObject$4=anObject$g,isDataDescriptor=isDataDescriptor$1,getOwnPropertyDescriptorModule$1=objectGetOwnPropertyDescriptor,getPrototypeOf$1=objectGetPrototypeOf;function get$8(e,t){var r,n,o=arguments.length<3?e:arguments[2];return anObject$4(e)===o?e[t]:(r=getOwnPropertyDescriptorModule$1.f(e,t))?isDataDescriptor(r)?r.value:void 0===r.get?void 0:call$8(r.get,o):isObject$8(n=getPrototypeOf$1(e))?get$8(n,t,o):void 0}$$_({target:"Reflect",stat:!0},{get:get$8});var path$n=path$y,get$7=path$n.Reflect.get,parent$21=get$7,get$6=parent$21,parent$20=get$6,get$5=parent$20,parent$1$=get$5,get$4=parent$1$,get$3=get$4,_Reflect$get$1=getDefaultExportFromCjs(get$3),uncurryThis$g=functionUncurryThis,aCallable$8=aCallable$j,isObject$7=isObject$l,hasOwn$3=hasOwnProperty_1,arraySlice$4=arraySlice$7,NATIVE_BIND=functionBindNative,$Function=Function,concat$8=uncurryThis$g([].concat),join$3=uncurryThis$g([].join),factories={},construct$6=function(e,t,r){if(!hasOwn$3(factories,t)){for(var n=[],o=0;o<t;o++)n[o]="a["+o+"]";factories[t]=$Function("C,a","return new C("+join$3(n,",")+")")}return factories[t](e,r)},functionBind=NATIVE_BIND?$Function.bind:function(e){var t=aCallable$8(this),r=t.prototype,n=arraySlice$4(arguments,1),o=function(){var r=concat$8(n,arraySlice$4(arguments));return this instanceof o?construct$6(t,r.length,r):t.apply(e,r)};return isObject$7(r)&&(o.prototype=r),o},$$Z=_export,bind$k=functionBind;$$Z({target:"Function",proto:!0,forced:Function.bind!==bind$k},{bind:bind$k});var entryVirtual$j=entryVirtual$o,bind$j=entryVirtual$j("Function").bind,isPrototypeOf$i=objectIsPrototypeOf,method$h=bind$j,FunctionPrototype=Function.prototype,bind$i=function(e){var t=e.bind;return e===FunctionPrototype||isPrototypeOf$i(FunctionPrototype,e)&&t===FunctionPrototype.bind?method$h:t},parent$1_=bind$i,bind$h=parent$1_,parent$1Z=bind$h,bind$g=parent$1Z,parent$1Y=bind$g,bind$f=parent$1Y,bind$e=bind$f,_bindInstanceProperty$1=getDefaultExportFromCjs(bind$e),getOwnPropertyDescriptor$7={exports:{}},$$Y=_export,fails$f=fails$B,toIndexedObject$3=toIndexedObject$c,nativeGetOwnPropertyDescriptor=objectGetOwnPropertyDescriptor.f,DESCRIPTORS$9=descriptors$2,FORCED$7=!DESCRIPTORS$9||fails$f((function(){nativeGetOwnPropertyDescriptor(1)}));$$Y({target:"Object",stat:!0,forced:FORCED$7,sham:!DESCRIPTORS$9},{getOwnPropertyDescriptor:function(e,t){return nativeGetOwnPropertyDescriptor(toIndexedObject$3(e),t)}});var path$m=path$y,Object$3=path$m.Object,getOwnPropertyDescriptor$6=getOwnPropertyDescriptor$7.exports=function(e,t){return Object$3.getOwnPropertyDescriptor(e,t)};Object$3.getOwnPropertyDescriptor.sham&&(getOwnPropertyDescriptor$6.sham=!0);var getOwnPropertyDescriptorExports=getOwnPropertyDescriptor$7.exports,parent$1X=getOwnPropertyDescriptorExports,getOwnPropertyDescriptor$5=parent$1X,parent$1W=getOwnPropertyDescriptor$5,getOwnPropertyDescriptor$4=parent$1W,parent$1V=getOwnPropertyDescriptor$4,getOwnPropertyDescriptor$3=parent$1V,getOwnPropertyDescriptor$2=getOwnPropertyDescriptor$3,_Object$getOwnPropertyDescriptor$1=getDefaultExportFromCjs(getOwnPropertyDescriptor$2);function _getPrototypeOf$2(e){var t;return(_getPrototypeOf$2=_Object$setPrototypeOf$1?_bindInstanceProperty$1(t=_Object$getPrototypeOf$1).call(t):function(e){return e.__proto__||_Object$getPrototypeOf$1(e)})(e)}function _superPropBase$2(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf$2(e)););return e}function _get$2(){var e;"undefined"!=typeof Reflect&&_Reflect$get$1?_get$2=_bindInstanceProperty$1(e=_Reflect$get$1).call(e):_get$2=function(e,t,r){var n=_superPropBase$2(e,t);if(n){var o=_Object$getOwnPropertyDescriptor$1(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}};return _get$2.apply(this,arguments)}function _setPrototypeOf$2(e,t){var r;return(_setPrototypeOf$2=_Object$setPrototypeOf$1?_bindInstanceProperty$1(r=_Object$setPrototypeOf$1).call(r):function(e,t){return e.__proto__=t,e})(e,t)}function _inherits$2(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=_Object$create$1(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),_Object$defineProperty$1(e,"prototype",{writable:!1}),t&&_setPrototypeOf$2(e,t)}var $$X=_export,getBuiltIn$2=getBuiltIn$h,apply$3=functionApply,bind$d=functionBind,aConstructor$1=aConstructor$3,anObject$3=anObject$g,isObject$6=isObject$l,create$3=objectCreate,fails$e=fails$B,nativeConstruct=getBuiltIn$2("Reflect","construct"),ObjectPrototype=Object.prototype,push$7=[].push,NEW_TARGET_BUG=fails$e((function(){function e(){}return!(nativeConstruct((function(){}),[],e)instanceof e)})),ARGS_BUG=!fails$e((function(){nativeConstruct((function(){}))})),FORCED$6=NEW_TARGET_BUG||ARGS_BUG;$$X({target:"Reflect",stat:!0,forced:FORCED$6,sham:FORCED$6},{construct:function(e,t){aConstructor$1(e),anObject$3(t);var r=arguments.length<3?e:aConstructor$1(arguments[2]);if(ARGS_BUG&&!NEW_TARGET_BUG)return nativeConstruct(e,t,r);if(e==r){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var n=[null];return apply$3(push$7,n,t),new(apply$3(bind$d,e,n))}var o=r.prototype,i=create$3(isObject$6(o)?o:ObjectPrototype),a=apply$3(e,i,t);return isObject$6(a)?a:i}});var path$l=path$y,construct$5=path$l.Reflect.construct,parent$1U=construct$5,construct$4=parent$1U,parent$1T=construct$4,construct$3=parent$1T,parent$1S=construct$3,construct$2=parent$1S,construct$1=construct$2,_Reflect$construct$1=getDefaultExportFromCjs(construct$1);function _isNativeReflectConstruct$2(){if("undefined"==typeof Reflect||!_Reflect$construct$1)return!1;if(_Reflect$construct$1.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(_Reflect$construct$1(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _possibleConstructorReturn$2(e,t){if(t&&("object"===_typeof$3(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$2(e)}function _createSuper$2(e){var t=_isNativeReflectConstruct$2();return function(){var r,n=_getPrototypeOf$2(e);if(t){var o=_getPrototypeOf$2(this).constructor;r=_Reflect$construct$1(n,arguments,o)}else r=n.apply(this,arguments);return _possibleConstructorReturn$2(this,r)}}function _defineProperty$3(e,t,r){return(t=_toPropertyKey$3(t))in e?_Object$defineProperty$1(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var entryVirtual$i=entryVirtual$o,concat$7=entryVirtual$i("Array").concat,isPrototypeOf$h=objectIsPrototypeOf,method$g=concat$7,ArrayPrototype$e=Array.prototype,concat$6=function(e){var t=e.concat;return e===ArrayPrototype$e||isPrototypeOf$h(ArrayPrototype$e,e)&&t===ArrayPrototype$e.concat?method$g:t},parent$1R=concat$6,concat$5=parent$1R,parent$1Q=concat$5,concat$4=parent$1Q,parent$1P=concat$4,concat$3=parent$1P,concat$2=concat$3,concat$1=concat$2,_concatInstanceProperty=getDefaultExportFromCjs(concat$1),AD_START="ad_start",AD_PLAY="ad_play",AD_PAUSE="ad_pause",AD_TIME_UPDATE="ad_time_update",AD_SKIPPED="ad_skipped",AD_ERROR="ad_error",AD_COMPLETE="ad_complete",AD_ALL_COMPLETED="ad_all_completed",IMA_SDK_LOAD_START="ima_sdk_load_start",IMA_SDK_LOAD_SUCCESS="ima_sdk_load_success",IMA_SDK_LOAD_ERROR="ima_sdk_load_error",IMA_AD_LOADER_READY="ima_ad_loader_ready",IMA_AD_MANAGER_READY="ima_ad_manager_ready",IMA_AD_ENDED="ima_ad_ended",IMA_AD_SKIPPED="ima_ad_skipped",IMA_AD_COMPLETE="ima_ad_complete",IMA_ALL_ADS_COMPLETED="ima_all_ads_completed",IMA_AD_ERROR="ima_ad_error",IMA_AD_SEEKING="ima_ad_seeking",IMA_AD_SEEKED="ima_ad_seeked",IMA_AD_LOADED="ima_ad_loaded",IMA_AD_BREAK_READY="ima_ad_break_ready",IMA_CONTENT_PAUSE_REQUESTED="ima_content_pause_requested",IMA_CONTENT_RESUME_REQUESTED="ima_content_resume_requested",IMA_READY_TO_PLAY="ima_ready_to_play",XGAdEvents=Object.freeze({__proto__:null,AD_ALL_COMPLETED:AD_ALL_COMPLETED,AD_COMPLETE:AD_COMPLETE,AD_ERROR:AD_ERROR,AD_PAUSE:AD_PAUSE,AD_PLAY:AD_PLAY,AD_SKIPPED:AD_SKIPPED,AD_START:AD_START,AD_TIME_UPDATE:AD_TIME_UPDATE,IMA_AD_BREAK_READY:IMA_AD_BREAK_READY,IMA_AD_COMPLETE:IMA_AD_COMPLETE,IMA_AD_ENDED:IMA_AD_ENDED,IMA_AD_ERROR:IMA_AD_ERROR,IMA_AD_LOADED:IMA_AD_LOADED,IMA_AD_LOADER_READY:IMA_AD_LOADER_READY,IMA_AD_MANAGER_READY:IMA_AD_MANAGER_READY,IMA_AD_SEEKED:IMA_AD_SEEKED,IMA_AD_SEEKING:IMA_AD_SEEKING,IMA_AD_SKIPPED:IMA_AD_SKIPPED,IMA_ALL_ADS_COMPLETED:IMA_ALL_ADS_COMPLETED,IMA_CONTENT_PAUSE_REQUESTED:IMA_CONTENT_PAUSE_REQUESTED,IMA_CONTENT_RESUME_REQUESTED:IMA_CONTENT_RESUME_REQUESTED,IMA_READY_TO_PLAY:IMA_READY_TO_PLAY,IMA_SDK_LOAD_ERROR:IMA_SDK_LOAD_ERROR,IMA_SDK_LOAD_START:IMA_SDK_LOAD_START,IMA_SDK_LOAD_SUCCESS:IMA_SDK_LOAD_SUCCESS}),path$k=path$y,apply$2=functionApply;path$k.JSON||(path$k.JSON={stringify:JSON.stringify});var stringify$5=function(e,t,r){return apply$2(path$k.JSON.stringify,null,arguments)},parent$1O=stringify$5,stringify$4=parent$1O,parent$1N=stringify$4,stringify$3=parent$1N,parent$1M=stringify$3,stringify$2=parent$1M,stringify$1=stringify$2,stringify2=stringify$1,_JSON$stringify=getDefaultExportFromCjs(stringify2),symbol=symbol$1,_Symbol=getDefaultExportFromCjs(symbol),getIteratorMethod$7=getIteratorMethod$a,getIteratorMethod_1=getIteratorMethod$7,parent$1L=getIteratorMethod_1,getIteratorMethod$6=parent$1L,parent$1K=getIteratorMethod$6,getIteratorMethod$5=parent$1K,parent$1J=getIteratorMethod$5,getIteratorMethod$4=parent$1J,getIteratorMethod$3=getIteratorMethod$4,_getIteratorMethod$1=getDefaultExportFromCjs(getIteratorMethod$3),getIteratorMethod$2=getIteratorMethod$3,_getIteratorMethod=getDefaultExportFromCjs(getIteratorMethod$2),$$W=_export,toObject$7=toObject$f,nativeKeys=objectKeys$4,fails$d=fails$B,FAILS_ON_PRIMITIVES$2=fails$d((function(){nativeKeys(1)}));$$W({target:"Object",stat:!0,forced:FAILS_ON_PRIMITIVES$2},{keys:function(e){return nativeKeys(toObject$7(e))}});var path$j=path$y,keys$5=path$j.Object.keys,parent$1I=keys$5,keys$4=parent$1I,parent$1H=keys$4,keys$3=parent$1H,parent$1G=keys$3,keys$2=parent$1G,keys$1=keys$2,_Object$keys$1=getDefaultExportFromCjs(keys$1),keys3=keys$1,_Object$keys=getDefaultExportFromCjs(keys3),path$i=path$y,getOwnPropertySymbols$5=path$i.Object.getOwnPropertySymbols,parent$1F=getOwnPropertySymbols$5,getOwnPropertySymbols$4=parent$1F,parent$1E=getOwnPropertySymbols$4,getOwnPropertySymbols$3=parent$1E,parent$1D=getOwnPropertySymbols$3,getOwnPropertySymbols$2=parent$1D,getOwnPropertySymbols$1=getOwnPropertySymbols$2,_Object$getOwnPropertySymbols$1=getDefaultExportFromCjs(getOwnPropertySymbols$1),getOwnPropertySymbols2=getOwnPropertySymbols$1,_Object$getOwnPropertySymbols=getDefaultExportFromCjs(getOwnPropertySymbols2),$$V=_export,$filter=arrayIteration.filter,arrayMethodHasSpeciesSupport$2=arrayMethodHasSpeciesSupport$5,HAS_SPECIES_SUPPORT$2=arrayMethodHasSpeciesSupport$2("filter");$$V({target:"Array",proto:!0,forced:!HAS_SPECIES_SUPPORT$2},{filter:function(e){return $filter(this,e,arguments.length>1?arguments[1]:void 0)}});var entryVirtual$h=entryVirtual$o,filter$6=entryVirtual$h("Array").filter,isPrototypeOf$g=objectIsPrototypeOf,method$f=filter$6,ArrayPrototype$d=Array.prototype,filter$5=function(e){var t=e.filter;return e===ArrayPrototype$d||isPrototypeOf$g(ArrayPrototype$d,e)&&t===ArrayPrototype$d.filter?method$f:t},parent$1C=filter$5,filter$4=parent$1C,parent$1B=filter$4,filter$3=parent$1B,parent$1A=filter$3,filter$2=parent$1A,filter$1=filter$2,_filterInstanceProperty$1=getDefaultExportFromCjs(filter$1),filter2=filter$1,_filterInstanceProperty=getDefaultExportFromCjs(filter2),getOwnPropertyDescriptor$1=getOwnPropertyDescriptor$2,_Object$getOwnPropertyDescriptor=getDefaultExportFromCjs(getOwnPropertyDescriptor$1),forEach$1=forEach$2,_forEachInstanceProperty=getDefaultExportFromCjs(forEach$1),$$U=_export,DESCRIPTORS$8=descriptors$2,ownKeys$3=ownKeys$5,toIndexedObject$2=toIndexedObject$c,getOwnPropertyDescriptorModule=objectGetOwnPropertyDescriptor,createProperty$2=createProperty$6;$$U({target:"Object",stat:!0,sham:!DESCRIPTORS$8},{getOwnPropertyDescriptors:function(e){for(var t,r,n=toIndexedObject$2(e),o=getOwnPropertyDescriptorModule.f,i=ownKeys$3(n),a={},s=0;i.length>s;)void 0!==(r=o(n,t=i[s++]))&&createProperty$2(a,t,r);return a}});var path$h=path$y,getOwnPropertyDescriptors$5=path$h.Object.getOwnPropertyDescriptors,parent$1z=getOwnPropertyDescriptors$5,getOwnPropertyDescriptors$4=parent$1z,parent$1y=getOwnPropertyDescriptors$4,getOwnPropertyDescriptors$3=parent$1y,parent$1x=getOwnPropertyDescriptors$3,getOwnPropertyDescriptors$2=parent$1x,getOwnPropertyDescriptors$1=getOwnPropertyDescriptors$2,_Object$getOwnPropertyDescriptors$1=getDefaultExportFromCjs(getOwnPropertyDescriptors$1),getOwnPropertyDescriptors2=getOwnPropertyDescriptors$1,_Object$getOwnPropertyDescriptors=getDefaultExportFromCjs(getOwnPropertyDescriptors2),defineProperties$7={exports:{}},$$T=_export,DESCRIPTORS$7=descriptors$2,defineProperties$6=objectDefineProperties.f;$$T({target:"Object",stat:!0,forced:Object.defineProperties!==defineProperties$6,sham:!DESCRIPTORS$7},{defineProperties:defineProperties$6});var path$g=path$y,Object$2=path$g.Object,defineProperties$5=defineProperties$7.exports=function(e,t){return Object$2.defineProperties(e,t)};Object$2.defineProperties.sham&&(defineProperties$5.sham=!0);var definePropertiesExports=defineProperties$7.exports,parent$1w=definePropertiesExports,defineProperties$4=parent$1w,parent$1v=defineProperties$4,defineProperties$3=parent$1v,parent$1u=defineProperties$3,defineProperties$2=parent$1u,defineProperties$1=defineProperties$2,_Object$defineProperties$1=getDefaultExportFromCjs(defineProperties$1),defineProperties4=defineProperties$1,_Object$defineProperties=getDefaultExportFromCjs(defineProperties4),defineProperty$3=defineProperty$4,_Object$defineProperty=getDefaultExportFromCjs(defineProperty$3),create$2=create$5,_Object$create=getDefaultExportFromCjs(create$2),getPrototypeOf2=getPrototypeOf$3,_Object$getPrototypeOf=getDefaultExportFromCjs(getPrototypeOf2),setPrototypeOf=setPrototypeOf$2,_Object$setPrototypeOf=getDefaultExportFromCjs(setPrototypeOf),promise=promise$1,_Promise=getDefaultExportFromCjs(promise),reverse2=reverse$1,_reverseInstanceProperty=getDefaultExportFromCjs(reverse2),slice2=slice$1,_sliceInstanceProperty=getDefaultExportFromCjs(slice2),iterator=iterator$1,_Symbol$iterator=getDefaultExportFromCjs(iterator),bind$c=bind$e,_bindInstanceProperty=getDefaultExportFromCjs(bind$c),construct2=construct$1,_Reflect$construct=getDefaultExportFromCjs(construct2),get$2=get$3,_Reflect$get=getDefaultExportFromCjs(get$2),$$S=_export,isArray$6=isArray$d;$$S({target:"Array",stat:!0},{isArray:isArray$6});var path$f=path$y,isArray$5=path$f.Array.isArray,parent$1t=isArray$5,isArray$4=parent$1t,parent$1s=isArray$4,isArray$3=parent$1s,parent$1r=isArray$3,isArray$2=parent$1r,isArray$1=isArray$2,_Array$isArray$1=getDefaultExportFromCjs(isArray$1),isArray2=isArray$1,_Array$isArray=getDefaultExportFromCjs(isArray2),anObject$2=anObject$g,iteratorClose=iteratorClose$2,callWithSafeIterationClosing$1=function(e,t,r,n){try{return n?t(anObject$2(r)[0],r[1]):t(r)}catch(t){iteratorClose(e,"throw",t)}},bind$b=functionBindContext,call$7=functionCall,toObject$6=toObject$f,callWithSafeIterationClosing=callWithSafeIterationClosing$1,isArrayIteratorMethod=isArrayIteratorMethod$2,isConstructor3=isConstructor$4,lengthOfArrayLike$6=lengthOfArrayLike$e,createProperty$1=createProperty$6,getIterator$1=getIterator$3,getIteratorMethod$1=getIteratorMethod$a,$Array=Array,arrayFrom$1=function(e){var t=toObject$6(e),r=isConstructor3(this),n=arguments.length,o=n>1?arguments[1]:void 0,i=void 0!==o;i&&(o=bind$b(o,n>2?arguments[2]:void 0));var a,s,l,c,u,p,f=getIteratorMethod$1(t),d=0;if(!f||this===$Array&&isArrayIteratorMethod(f))for(a=lengthOfArrayLike$6(t),s=r?new this(a):$Array(a);a>d;d++)p=i?o(t[d],d):t[d],createProperty$1(s,d,p);else for(u=(c=getIterator$1(t,f)).next,s=r?new this:[];!(l=call$7(u,c)).done;d++)p=i?callWithSafeIterationClosing(c,o,[l.value,d],!0):l.value,createProperty$1(s,d,p);return s.length=d,s},$$R=_export,from$7=arrayFrom$1,checkCorrectnessOfIteration=checkCorrectnessOfIteration$2,INCORRECT_ITERATION=!checkCorrectnessOfIteration((function(e){Array.from(e)}));$$R({target:"Array",stat:!0,forced:INCORRECT_ITERATION},{from:from$7});var path$e=path$y,from$6=path$e.Array.from,parent$1q=from$6,from$5=parent$1q,parent$1p=from$5,from$4=parent$1p,parent$1o=from$4,from$3=parent$1o,from$2=from$3,_Array$from$1=getDefaultExportFromCjs(from$2),from$1=from$2,_Array$from=getDefaultExportFromCjs(from$1),toPrimitive=toPrimitive$1,_Symbol$toPrimitive=getDefaultExportFromCjs(toPrimitive);function _iterableToArrayLimit$1(e,t){var r=null==e?null:void 0!==_Symbol&&_getIteratorMethod(e)||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],l=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}function ownKeys$2(e,t){var r=_Object$keys(e);if(_Object$getOwnPropertySymbols){var n=_Object$getOwnPropertySymbols(e);t&&(n=_filterInstanceProperty(n).call(n,(function(t){return _Object$getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread2$2(e){for(var t=1;t<arguments.length;t++){var r,n,o=null!=arguments[t]?arguments[t]:{};t%2?_forEachInstanceProperty(r=ownKeys$2(Object(o),!0)).call(r,(function(t){_defineProperty$2(e,t,o[t])})):_Object$getOwnPropertyDescriptors?_Object$defineProperties(e,_Object$getOwnPropertyDescriptors(o)):_forEachInstanceProperty(n=ownKeys$2(Object(o))).call(n,(function(t){_Object$defineProperty(e,t,_Object$getOwnPropertyDescriptor(o,t))}))}return e}function _regeneratorRuntime(){_regeneratorRuntime=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=_Object$defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof _Symbol?_Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function l(e,t,r){return _Object$defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,o){var i=t&&t.prototype instanceof f?t:f,a=_Object$create(i.prototype),s=new T(o||[]);return n(a,"_invoke",{value:_(e,r,s)}),a}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var p={};function f(){}function d(){}function h(){}var $={};l($,i,(function(){return this}));var y=_Object$getPrototypeOf&&_Object$getPrototypeOf(_Object$getPrototypeOf(S([])));y&&y!==t&&r.call(y,i)&&($=y);var g=h.prototype=f.prototype=_Object$create($);function v(e){var t;_forEachInstanceProperty(t=["next","throw","return"]).call(t,(function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function m(e,t){function o(n,i,a,s){var l=u(e[n],e,i);if("throw"!==l.type){var c=l.arg,p=c.value;return p&&"object"==_typeof$3(p)&&r.call(p,"__await")?t.resolve(p.__await).then((function(e){o("next",e,a,s)}),(function(e){o("throw",e,a,s)})):t.resolve(p).then((function(e){c.value=e,a(c)}),(function(e){return o("throw",e,a,s)}))}s(l.arg)}var i;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){o(e,r,t,n)}))}return i=i?i.then(n,n):n()}})}function _(e,t,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=b(a,r);if(s){if(s===p)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===p)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function b(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,b(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),p;var o=u(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,p;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function I(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],_forEachInstanceProperty(e).call(e,I,this),this.reset(!0)}function S(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:P}}function P(){return{value:void 0,done:!0}}return d.prototype=h,n(g,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:d,configurable:!0}),d.displayName=l(h,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return _Object$setPrototypeOf?_Object$setPrototypeOf(e,h):(e.__proto__=h,l(e,s,"GeneratorFunction")),e.prototype=_Object$create(g),e},e.awrap=function(e){return{__await:e}},v(m.prototype),l(m.prototype,a,(function(){return this})),e.AsyncIterator=m,e.async=function(t,r,n,o,i){void 0===i&&(i=_Promise);var a=new m(c(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},v(g),l(g,s,"Generator"),l(g,i,(function(){return this})),l(g,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return _reverseInstanceProperty(r).call(r),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,T.prototype={constructor:T,reset:function(e){var t;if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,_forEachInstanceProperty(t=this.tryEntries).call(t,E),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+_sliceInstanceProperty(n).call(n,1))&&(this[n]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),l=r.call(i,"finallyLoc");if(s&&l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(r),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},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 asyncGeneratorStep(e,t,r,n,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void r(e)}s.done?t(l):_Promise.resolve(l).then(n,o)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new _Promise((function(n,o){var i=e.apply(t,r);function a(e){asyncGeneratorStep(i,n,o,a,s,"next",e)}function s(e){asyncGeneratorStep(i,n,o,a,s,"throw",e)}a(void 0)}))}}function _classCallCheck$2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties$2(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),_Object$defineProperty(e,_toPropertyKey$2(n.key),n)}}function _createClass$2(e,t,r){return t&&_defineProperties$2(e.prototype,t),r&&_defineProperties$2(e,r),_Object$defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty$2(e,t,r){return(t=_toPropertyKey$2(t))in e?_Object$defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _inherits$1(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=_Object$create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),_Object$defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf$1(e,t)}function _getPrototypeOf$1(e){var t;return(_getPrototypeOf$1=_Object$setPrototypeOf?_bindInstanceProperty(t=_Object$getPrototypeOf).call(t):function(e){return e.__proto__||_Object$getPrototypeOf(e)})(e)}function _setPrototypeOf$1(e,t){var r;return(_setPrototypeOf$1=_Object$setPrototypeOf?_bindInstanceProperty(r=_Object$setPrototypeOf).call(r):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$3(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$1(e)}function _createSuper$1(e){var t=_isNativeReflectConstruct$1();return function(){var r,n=_getPrototypeOf$1(e);if(t){var o=_getPrototypeOf$1(this).constructor;r=_Reflect$construct(n,arguments,o)}else r=n.apply(this,arguments);return _possibleConstructorReturn$1(this,r)}}function _superPropBase$1(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf$1(e)););return e}function _get$1(){var e;"undefined"!=typeof Reflect&&_Reflect$get?_get$1=_bindInstanceProperty(e=_Reflect$get).call(e):_get$1=function(e,t,r){var n=_superPropBase$1(e,t);if(n){var o=_Object$getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}};return _get$1.apply(this,arguments)}function _slicedToArray$1(e,t){return _arrayWithHoles$1(e)||_iterableToArrayLimit$1(e,t)||_unsupportedIterableToArray$2(e,t)||_nonIterableRest$1()}function _arrayWithHoles$1(e){if(_Array$isArray(e))return e}function _unsupportedIterableToArray$2(e,t){var r;if(e){if("string"==typeof e)return _arrayLikeToArray$2(e,t);var n=_sliceInstanceProperty(r=Object.prototype.toString.call(e)).call(r,8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?_Array$from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray$2(e,t):void 0}}function _arrayLikeToArray$2(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _nonIterableRest$1(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _toPrimitive$2(e,t){if("object"!==_typeof$3(e)||null===e)return e;var r=e[_Symbol$toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==_typeof$3(n))return n;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$3(t)?t:String(t)}var $$Q=_export,uncurryThis$f=functionUncurryThisClause,$indexOf=arrayIncludes.indexOf,arrayMethodIsStrict$5=arrayMethodIsStrict$7,nativeIndexOf=uncurryThis$f([].indexOf),NEGATIVE_ZERO$1=!!nativeIndexOf&&1/nativeIndexOf([1],1,-0)<0,FORCED$5=NEGATIVE_ZERO$1||!arrayMethodIsStrict$5("indexOf");$$Q({target:"Array",proto:!0,forced:FORCED$5},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return NEGATIVE_ZERO$1?nativeIndexOf(this,e,t)||0:$indexOf(this,e,t)}});var entryVirtual$g=entryVirtual$o,indexOf$6=entryVirtual$g("Array").indexOf,isPrototypeOf$f=objectIsPrototypeOf,method$e=indexOf$6,ArrayPrototype$c=Array.prototype,indexOf$5=function(e){var t=e.indexOf;return e===ArrayPrototype$c||isPrototypeOf$f(ArrayPrototype$c,e)&&t===ArrayPrototype$c.indexOf?method$e:t},parent$1n=indexOf$5,indexOf$4=parent$1n,parent$1m=indexOf$4,indexOf$3=parent$1m,parent$1l=indexOf$3,indexOf$2=parent$1l,indexOf$1=indexOf$2,indexOf2=indexOf$1,_indexOfInstanceProperty=getDefaultExportFromCjs(indexOf2),$$P=_export,$find=arrayIteration.find,FIND="find",SKIPS_HOLES$1=!0;FIND in[]&&Array(1)[FIND]((function(){SKIPS_HOLES$1=!1})),$$P({target:"Array",proto:!0,forced:SKIPS_HOLES$1},{find:function(e){return $find(this,e,arguments.length>1?arguments[1]:void 0)}});var entryVirtual$f=entryVirtual$o,find$7=entryVirtual$f("Array").find,isPrototypeOf$e=objectIsPrototypeOf,method$d=find$7,ArrayPrototype$b=Array.prototype,find$6=function(e){var t=e.find;return e===ArrayPrototype$b||isPrototypeOf$e(ArrayPrototype$b,e)&&t===ArrayPrototype$b.find?method$d:t},parent$1k=find$6,find$5=parent$1k,parent$1j=find$5,find$4=parent$1j,parent$1i=find$4,find$3=parent$1i,find$2=find$3,find$1=find$2,_findInstanceProperty=getDefaultExportFromCjs(find$1),tryToString$1=tryToString$7,$TypeError$5=TypeError,deletePropertyOrThrow$3=function(e,t){if(!delete e[t])throw $TypeError$5("Cannot delete property "+tryToString$1(t)+" of "+tryToString$1(e))},$$O=_export,toObject$5=toObject$f,toAbsoluteIndex$2=toAbsoluteIndex$6,toIntegerOrInfinity$2=toIntegerOrInfinity$6,lengthOfArrayLike$5=lengthOfArrayLike$e,setArrayLength=arraySetLength,doesNotExceedSafeInteger=doesNotExceedSafeInteger$3,arraySpeciesCreate=arraySpeciesCreate$3,createProperty=createProperty$6,deletePropertyOrThrow$2=deletePropertyOrThrow$3,arrayMethodHasSpeciesSupport$1=arrayMethodHasSpeciesSupport$5,HAS_SPECIES_SUPPORT$1=arrayMethodHasSpeciesSupport$1("splice"),max=Math.max,min$3=Math.min;$$O({target:"Array",proto:!0,forced:!HAS_SPECIES_SUPPORT$1},{splice:function(e,t){var r,n,o,i,a,s,l=toObject$5(this),c=lengthOfArrayLike$5(l),u=toAbsoluteIndex$2(e,c),p=arguments.length;for(0===p?r=n=0:1===p?(r=0,n=c-u):(r=p-2,n=min$3(max(toIntegerOrInfinity$2(t),0),c-u)),doesNotExceedSafeInteger(c+r-n),o=arraySpeciesCreate(l,n),i=0;i<n;i++)(a=u+i)in l&&createProperty(o,i,l[a]);if(o.length=n,r<n){for(i=u;i<c-n;i++)s=i+r,(a=i+n)in l?l[s]=l[a]:deletePropertyOrThrow$2(l,s);for(i=c;i>c-n+r;i--)deletePropertyOrThrow$2(l,i-1)}else if(r>n)for(i=c-n;i>u;i--)s=i+r-1,(a=i+n-1)in l?l[s]=l[a]:deletePropertyOrThrow$2(l,s);for(i=0;i<r;i++)l[i+u]=arguments[i+2];return setArrayLength(l,c-n+r),o}});var entryVirtual$e=entryVirtual$o,splice$7=entryVirtual$e("Array").splice,isPrototypeOf$d=objectIsPrototypeOf,method$c=splice$7,ArrayPrototype$a=Array.prototype,splice$6=function(e){var t=e.splice;return e===ArrayPrototype$a||isPrototypeOf$d(ArrayPrototype$a,e)&&t===ArrayPrototype$a.splice?method$c:t},parent$1h=splice$6,splice$5=parent$1h,parent$1g=splice$5,splice$4=parent$1g,parent$1f=splice$4,splice$3=parent$1f,splice$2=splice$3,splice$1=splice$2,_spliceInstanceProperty=getDefaultExportFromCjs(splice$1),whitespaces$4="\t\n\v\f\r \u2028\u2029\ufeff",uncurryThis$e=functionUncurryThis,requireObjectCoercible$4=requireObjectCoercible$8,toString$8=toString$f,whitespaces$3=whitespaces$4,replace$3=uncurryThis$e("".replace),ltrim=RegExp("^["+whitespaces$3+"]+"),rtrim=RegExp("(^|[^"+whitespaces$3+"])["+whitespaces$3+"]+$"),createMethod$3=function(e){return function(t){var r=toString$8(requireObjectCoercible$4(t));return 1&e&&(r=replace$3(r,ltrim,"")),2&e&&(r=replace$3(r,rtrim,"$1")),r}},stringTrim={start:createMethod$3(1),end:createMethod$3(2),trim:createMethod$3(3)},global$9=global$s,fails$c=fails$B,uncurryThis$d=functionUncurryThis,toString$7=toString$f,trim$8=stringTrim.trim,whitespaces$2=whitespaces$4,$parseInt$1=global$9.parseInt,Symbol$2=global$9.Symbol,ITERATOR$3=Symbol$2&&Symbol$2.iterator,hex=/^[+-]?0x/i,exec$2=uncurryThis$d(hex.exec),FORCED$4=8!==$parseInt$1(whitespaces$2+"08")||22!==$parseInt$1(whitespaces$2+"0x16")||ITERATOR$3&&!fails$c((function(){$parseInt$1(Object(ITERATOR$3))})),numberParseInt=FORCED$4?function(e,t){var r=trim$8(toString$7(e));return $parseInt$1(r,t>>>0||(exec$2(hex,r)?16:10))}:$parseInt$1,$$N=_export,$parseInt=numberParseInt;$$N({global:!0,forced:parseInt!=numberParseInt},{parseInt:numberParseInt});var path$d=path$y,_parseInt$6=path$d.parseInt,parent$1e=_parseInt$6,_parseInt$5=parent$1e,parent$1d=_parseInt$5,_parseInt$4=parent$1d,parent$1c=_parseInt$4,_parseInt$3=parent$1c,_parseInt$2=_parseInt$3,_parseInt=_parseInt$2,_parseInt$1=getDefaultExportFromCjs(_parseInt),$$M=_export,$map=arrayIteration.map,arrayMethodHasSpeciesSupport=arrayMethodHasSpeciesSupport$5,HAS_SPECIES_SUPPORT=arrayMethodHasSpeciesSupport("map");$$M({target:"Array",proto:!0,forced:!HAS_SPECIES_SUPPORT},{map:function(e){return $map(this,e,arguments.length>1?arguments[1]:void 0)}});var entryVirtual$d=entryVirtual$o,map$c=entryVirtual$d("Array").map,isPrototypeOf$c=objectIsPrototypeOf,method$b=map$c,ArrayPrototype$9=Array.prototype,map$b=function(e){var t=e.map;return e===ArrayPrototype$9||isPrototypeOf$c(ArrayPrototype$9,e)&&t===ArrayPrototype$9.map?method$b:t},parent$1b=map$b,map$a=parent$1b,parent$1a=map$a,map$9=parent$1a,parent$19=map$9,map$8=parent$19,map$7=map$8,map$6=map$7,_mapInstanceProperty=getDefaultExportFromCjs(map$6),DESCRIPTORS$6=descriptors$2,uncurryThis$c=functionUncurryThis,call$6=functionCall,fails$b=fails$B,objectKeys$1=objectKeys$4,getOwnPropertySymbolsModule=objectGetOwnPropertySymbols,propertyIsEnumerableModule=objectPropertyIsEnumerable,toObject$4=toObject$f,IndexedObject$1=indexedObject,$assign=Object.assign,defineProperty$2=Object.defineProperty,concat2=uncurryThis$c([].concat),objectAssign=!$assign||fails$b((function(){if(DESCRIPTORS$6&&1!==$assign({b:1},$assign(defineProperty$2({},"a",{enumerable:!0,get:function(){defineProperty$2(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach((function(e){t[e]=e})),7!=$assign({},e)[r]||objectKeys$1($assign({},t)).join("")!=n}))?function(e,t){for(var r=toObject$4(e),n=arguments.length,o=1,i=getOwnPropertySymbolsModule.f,a=propertyIsEnumerableModule.f;n>o;)for(var s,l=IndexedObject$1(arguments[o++]),c=i?concat2(objectKeys$1(l),i(l)):objectKeys$1(l),u=c.length,p=0;u>p;)s=c[p++],DESCRIPTORS$6&&!call$6(a,l,s)||(r[s]=l[s]);return r}:$assign,$$L=_export,assign$7=objectAssign;$$L({target:"Object",stat:!0,arity:2,forced:Object.assign!==assign$7},{assign:assign$7});var path$c=path$y,assign$6=path$c.Object.assign,parent$18=assign$6,assign$5=parent$18,parent$17=assign$5,assign$4=parent$17,parent$16=assign$4,assign$3=parent$16,assign$2=assign$3,assign$1=assign$2,_Object$assign=getDefaultExportFromCjs(assign$1);function ownKeys$1(e,t){var r=_Object$keys(e);if(_Object$getOwnPropertySymbols){var n=_Object$getOwnPropertySymbols(e);t&&(n=_filterInstanceProperty(n).call(n,(function(t){return _Object$getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread2$1(e){for(var t=1;t<arguments.length;t++){var r,n,o=null!=arguments[t]?arguments[t]:{};t%2?_forEachInstanceProperty(r=ownKeys$1(Object(o),!0)).call(r,(function(t){_defineProperty$1(e,t,o[t])})):_Object$getOwnPropertyDescriptors?_Object$defineProperties(e,_Object$getOwnPropertyDescriptors(o)):_forEachInstanceProperty(n=ownKeys$1(Object(o))).call(n,(function(t){_Object$defineProperty(e,t,_Object$getOwnPropertyDescriptor(o,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 r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),_Object$defineProperty(e,_toPropertyKey$1(n.key),n)}}function _createClass$1(e,t,r){return t&&_defineProperties$1(e.prototype,t),r&&_defineProperties$1(e,r),_Object$defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty$1(e,t,r){return(t=_toPropertyKey$1(t))in e?_Object$defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=_Object$create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),_Object$defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _getPrototypeOf(e){var t;return(_getPrototypeOf=_Object$setPrototypeOf?_bindInstanceProperty(t=_Object$getPrototypeOf).call(t):function(e){return e.__proto__||_Object$getPrototypeOf(e)})(e)}function _setPrototypeOf(e,t){var r;return(_setPrototypeOf=_Object$setPrototypeOf?_bindInstanceProperty(r=_Object$setPrototypeOf).call(r):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 _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$3(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var r,n=_getPrototypeOf(e);if(t){var o=_getPrototypeOf(this).constructor;r=_Reflect$construct(n,arguments,o)}else r=n.apply(this,arguments);return _possibleConstructorReturn(this,r)}}function _superPropBase(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf(e)););return e}function _get(){var e;"undefined"!=typeof Reflect&&_Reflect$get?_get=_bindInstanceProperty(e=_Reflect$get).call(e):_get=function(e,t,r){var n=_superPropBase(e,t);if(n){var o=_Object$getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}};return _get.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(void 0!==_Symbol&&null!=_getIteratorMethod(e)||null!=e["@@iterator"])return _Array$from(e)}function _unsupportedIterableToArray$1(e,t){var r;if(e){if("string"==typeof e)return _arrayLikeToArray$1(e,t);var n=_sliceInstanceProperty(r=Object.prototype.toString.call(e)).call(r,8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?_Array$from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray$1(e,t):void 0}}function _arrayLikeToArray$1(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _nonIterableSpread$1(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _toPrimitive$1(e,t){if("object"!==_typeof$3(e)||null===e)return e;var r=e[_Symbol$toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==_typeof$3(n))return n;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$3(t)?t:String(t)}var eventemitter3={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}function o(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function i(e,t,n,i,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new o(n,i||e,a),l=r?r+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function s(){this._events=new n,this._eventsCount=0}_Object$create&&(n.prototype=_Object$create(null),(new n).__proto__||(r=!1)),s.prototype.eventNames=function(){var e,n,o=[];if(0===this._eventsCount)return o;for(n in e=this._events)t.call(e,n)&&o.push(r?_sliceInstanceProperty(n).call(n,1):n);return _Object$getOwnPropertySymbols?_concatInstanceProperty(o).call(o,_Object$getOwnPropertySymbols(e)):o},s.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var o=0,i=n.length,a=new Array(i);o<i;o++)a[o]=n[o].fn;return a},s.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},s.prototype.emit=function(e,t,n,o,i,a){var s=r?r+e:e;if(!this._events[s])return!1;var l,c,u=this._events[s],p=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),p){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,o),!0;case 5:return u.fn.call(u.context,t,n,o,i),!0;case 6:return u.fn.call(u.context,t,n,o,i,a),!0}for(c=1,l=new Array(p-1);c<p;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var f,d=u.length;for(c=0;c<d;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),p){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,n);break;case 4:u[c].fn.call(u[c].context,t,n,o);break;default:if(!l)for(f=1,l=new Array(p-1);f<p;f++)l[f-1]=arguments[f];u[c].fn.apply(u[c].context,l)}}return!0},s.prototype.on=function(e,t,r){return i(this,e,t,r,!1)},s.prototype.once=function(e,t,r){return i(this,e,t,r,!0)},s.prototype.removeListener=function(e,t,n,o){var i=r?r+e:e;if(!this._events[i])return this;if(!t)return a(this,i),this;var s=this._events[i];if(s.fn)s.fn!==t||o&&!s.once||n&&s.context!==n||a(this,i);else{for(var l=0,c=[],u=s.length;l<u;l++)(s[l].fn!==t||o&&!s[l].once||n&&s[l].context!==n)&&c.push(s[l]);c.length?this._events[i]=1===c.length?c[0]:c:a(this,i)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&a(this,t)):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=r,s.EventEmitter=s,e.exports=s}(eventemitter3);var eventemitter3Exports=eventemitter3.exports,$$K=_export,$some=arrayIteration.some,arrayMethodIsStrict$4=arrayMethodIsStrict$7,STRICT_METHOD$3=arrayMethodIsStrict$4("some");$$K({target:"Array",proto:!0,forced:!STRICT_METHOD$3},{some:function(e){return $some(this,e,arguments.length>1?arguments[1]:void 0)}});var entryVirtual$c=entryVirtual$o,some$6=entryVirtual$c("Array").some,isPrototypeOf$b=objectIsPrototypeOf,method$a=some$6,ArrayPrototype$8=Array.prototype,some$5=function(e){var t=e.some;return e===ArrayPrototype$8||isPrototypeOf$b(ArrayPrototype$8,e)&&t===ArrayPrototype$8.some?method$a:t},parent$15=some$5,some$4=parent$15,parent$14=some$4,some$3=parent$14,parent$13=some$3,some$2=parent$13,some$1=some$2,some2=some$1,_someInstanceProperty=getDefaultExportFromCjs(some2),toIntegerOrInfinity$1=toIntegerOrInfinity$6,toString$6=toString$f,requireObjectCoercible$3=requireObjectCoercible$8,$RangeError$1=RangeError,stringRepeat=function(e){var t=toString$6(requireObjectCoercible$3(this)),r="",n=toIntegerOrInfinity$1(e);if(n<0||n==1/0)throw $RangeError$1("Wrong number of repetitions");for(;n>0;(n>>>=1)&&(t+=t))1&n&&(r+=t);return r},uncurryThis$b=functionUncurryThis,toLength$1=toLength$3,toString$5=toString$f,$repeat=stringRepeat,requireObjectCoercible$2=requireObjectCoercible$8,repeat2=uncurryThis$b($repeat),stringSlice$3=uncurryThis$b("".slice),ceil=Math.ceil,createMethod$2=function(e){return function(t,r,n){var o,i,a=toString$5(requireObjectCoercible$2(t)),s=toLength$1(r),l=a.length,c=void 0===n?" ":toString$5(n);return s<=l||""==c?a:((i=repeat2(c,ceil((o=s-l)/c.length))).length>o&&(i=stringSlice$3(i,0,o)),e?a+i:i+a)}},stringPad={start:createMethod$2(!1),end:createMethod$2(!0)},userAgent$2=engineUserAgent,stringPadWebkitBug=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(userAgent$2),$$J=_export,$padStart=stringPad.start,WEBKIT_BUG=stringPadWebkitBug;$$J({target:"String",proto:!0,forced:WEBKIT_BUG},{padStart:function(e){return $padStart(this,e,arguments.length>1?arguments[1]:void 0)}});var entryVirtual$b=entryVirtual$o,padStart$6=entryVirtual$b("String").padStart,isPrototypeOf$a=objectIsPrototypeOf,method$9=padStart$6,StringPrototype$3=String.prototype,padStart$5=function(e){var t=e.padStart;return"string"==typeof e||e===StringPrototype$3||isPrototypeOf$a(StringPrototype$3,e)&&t===StringPrototype$3.padStart?method$9:t},parent$12=padStart$5,padStart$4=parent$12,parent$11=padStart$4,padStart$3=parent$11,parent$10=padStart$3,padStart$2=parent$10,padStart$1=padStart$2,padStart2=padStart$1,_padStartInstanceProperty=getDefaultExportFromCjs(padStart2),engineIsBun="function"==typeof Bun&&Bun&&"string"==typeof Bun.version,global$8=global$s,apply$1=functionApply,isCallable$5=isCallable$q,ENGINE_IS_BUN=engineIsBun,USER_AGENT=engineUserAgent,arraySlice$3=arraySlice$7,validateArgumentsLength$3=validateArgumentsLength$5,Function$1=global$8.Function,WRAP=/MSIE .\./.test(USER_AGENT)||ENGINE_IS_BUN&&function(){var e=global$8.Bun.version.split(".");return e.length<3||0==e[0]&&(e[1]<3||3==e[1]&&0==e[2])}(),schedulersFix$2=function(e,t){var r=t?2:1;return WRAP?function(n,o){var i=validateArgumentsLength$3(arguments.length,1)>r,a=isCallable$5(n)?n:Function$1(n),s=i?arraySlice$3(arguments,r):[],l=i?function(){apply$1(a,this,s)}:a;return t?e(l,o):e(l)}:e},$$I=_export,global$7=global$s,schedulersFix$1=schedulersFix$2,setInterval$5=schedulersFix$1(global$7.setInterval,!0);$$I({global:!0,bind:!0,forced:global$7.setInterval!==setInterval$5},{setInterval:setInterval$5});var $$H=_export,global$6=global$s,schedulersFix=schedulersFix$2,setTimeout$6=schedulersFix(global$6.setTimeout,!0);$$H({global:!0,bind:!0,forced:global$6.setTimeout!==setTimeout$6},{setTimeout:setTimeout$6});var path$b=path$y,setInterval$4=path$b.setInterval,parent$$=setInterval$4,setInterval$3=parent$$,parent$_=setInterval$3,setInterval$2=parent$_,setInterval$1=setInterval$2,setInterval=setInterval$1,_setInterval=getDefaultExportFromCjs(setInterval),path$a=path$y,setTimeout$5=path$a.setTimeout,parent$Z=setTimeout$5,setTimeout$4=parent$Z,parent$Y=setTimeout$4,setTimeout$3=parent$Y,setTimeout$2=setTimeout$3,setTimeout$1=setTimeout$2,_setTimeout=getDefaultExportFromCjs(setTimeout$1),$$G=_export,$every=arrayIteration.every,arrayMethodIsStrict$3=arrayMethodIsStrict$7,STRICT_METHOD$2=arrayMethodIsStrict$3("every");$$G({target:"Array",proto:!0,forced:!STRICT_METHOD$2},{every:function(e){return $every(this,e,arguments.length>1?arguments[1]:void 0)}});var entryVirtual$a=entryVirtual$o,every$6=entryVirtual$a("Array").every,isPrototypeOf$9=objectIsPrototypeOf,method$8=every$6,ArrayPrototype$7=Array.prototype,every$5=function(e){var t=e.every;return e===ArrayPrototype$7||isPrototypeOf$9(ArrayPrototype$7,e)&&t===ArrayPrototype$7.every?method$8:t},parent$X=every$5,every$4=parent$X,parent$W=every$4,every$3=parent$W,parent$V=every$3,every$2=parent$V,every$1=every$2,every2=every$1,_everyInstanceProperty=getDefaultExportFromCjs(every2),global$5=global$s,fails$a=fails$B,uncurryThis$a=functionUncurryThis,toString$4=toString$f,trim$7=stringTrim.trim,whitespaces$1=whitespaces$4,charAt$2=uncurryThis$a("".charAt),$parseFloat$1=global$5.parseFloat,Symbol$1=global$5.Symbol,ITERATOR$2=Symbol$1&&Symbol$1.iterator,FORCED$3=1/$parseFloat$1(whitespaces$1+"-0")!=-1/0||ITERATOR$2&&!fails$a((function(){$parseFloat$1(Object(ITERATOR$2))})),numberParseFloat=FORCED$3?function(e){var t=trim$7(toString$4(e)),r=$parseFloat$1(t);return 0===r&&"-"==charAt$2(t,0)?-0:r}:$parseFloat$1,$$F=_export,$parseFloat=numberParseFloat;$$F({global:!0,forced:parseFloat!=numberParseFloat},{parseFloat:numberParseFloat});var path$9=path$y,_parseFloat$6=path$9.parseFloat,parent$U=_parseFloat$6,_parseFloat$5=parent$U,parent$T=_parseFloat$5,_parseFloat$4=parent$T,parent$S=_parseFloat$4,_parseFloat$3=parent$S,_parseFloat$2=_parseFloat$3,_parseFloat=_parseFloat$2,_parseFloat$1=getDefaultExportFromCjs(_parseFloat),PROPER_FUNCTION_NAME=functionName.PROPER,fails$9=fails$B,whitespaces=whitespaces$4,non="
",stringTrimForced=function(e){return fails$9((function(){return!!whitespaces[e]()||non[e]()!==non||PROPER_FUNCTION_NAME&&whitespaces[e].name!==e}))},$$E=_export,$trim=stringTrim.trim,forcedStringTrimMethod=stringTrimForced;$$E({target:"String",proto:!0,forced:forcedStringTrimMethod("trim")},{trim:function(){return $trim(this)}});var entryVirtual$9=entryVirtual$o,trim$6=entryVirtual$9("String").trim,isPrototypeOf$8=objectIsPrototypeOf,method$7=trim$6,StringPrototype$2=String.prototype,trim$5=function(e){var t=e.trim;return"string"==typeof e||e===StringPrototype$2||isPrototypeOf$8(StringPrototype$2,e)&&t===StringPrototype$2.trim?method$7:t},parent$R=trim$5,trim$4=parent$R,parent$Q=trim$4,trim$3=parent$Q,parent$P=trim$3,trim$2=parent$P,trim$1=trim$2,trim2=trim$1,_trimInstanceProperty=getDefaultExportFromCjs(trim2),arraySlice$2=arraySliceSimple,floor$3=Math.floor,mergeSort=function(e,t){var r=e.length,n=floor$3(r/2);return r<8?insertionSort(e,t):merge(e,mergeSort(arraySlice$2(e,0,n),t),mergeSort(arraySlice$2(e,n),t),t)},insertionSort=function(e,t){for(var r,n,o=e.length,i=1;i<o;){for(n=i,r=e[i];n&&t(e[n-1],r)>0;)e[n]=e[--n];n!==i++&&(e[n]=r)}return e},merge=function(e,t,r,n){for(var o=t.length,i=r.length,a=0,s=0;a<o||s<i;)e[a+s]=a<o&&s<i?n(t[a],r[s])<=0?t[a++]:r[s++]:a<o?t[a++]:r[s++];return e},arraySort$1=mergeSort,userAgent$1=engineUserAgent,firefox=userAgent$1.match(/firefox\/(\d+)/i),engineFfVersion=!!firefox&&+firefox[1],UA=engineUserAgent,engineIsIeOrEdge=/MSIE|Trident/.test(UA),userAgent=engineUserAgent,webkit=userAgent.match(/AppleWebKit\/(\d+)\./),engineWebkitVersion=!!webkit&&+webkit[1],$$D=_export,uncurryThis$9=functionUncurryThis,aCallable$7=aCallable$j,toObject$3=toObject$f,lengthOfArrayLike$4=lengthOfArrayLike$e,deletePropertyOrThrow$1=deletePropertyOrThrow$3,toString$3=toString$f,fails$8=fails$B,internalSort=arraySort$1,arrayMethodIsStrict$2=arrayMethodIsStrict$7,FF=engineFfVersion,IE_OR_EDGE=engineIsIeOrEdge,V8=engineV8Version,WEBKIT=engineWebkitVersion,test=[],nativeSort=uncurryThis$9(test.sort),push$6=uncurryThis$9(test.push),FAILS_ON_UNDEFINED=fails$8((function(){test.sort(void 0)})),FAILS_ON_NULL=fails$8((function(){test.sort(null)})),STRICT_METHOD$1=arrayMethodIsStrict$2("sort"),STABLE_SORT=!fails$8((function(){if(V8)return V8<70;if(!(FF&&FF>3)){if(IE_OR_EDGE)return!0;if(WEBKIT)return WEBKIT<603;var e,t,r,n,o="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(n=0;n<47;n++)test.push({k:t+n,v:r})}for(test.sort((function(e,t){return t.v-e.v})),n=0;n<test.length;n++)t=test[n].k.charAt(0),o.charAt(o.length-1)!==t&&(o+=t);return"DGBEFHACIJK"!==o}})),FORCED$2=FAILS_ON_UNDEFINED||!FAILS_ON_NULL||!STRICT_METHOD$1||!STABLE_SORT,getSortCompare=function(e){return function(t,r){return void 0===r?-1:void 0===t?1:void 0!==e?+e(t,r)||0:toString$3(t)>toString$3(r)?1:-1}};$$D({target:"Array",proto:!0,forced:FORCED$2},{sort:function(e){void 0!==e&&aCallable$7(e);var t=toObject$3(this);if(STABLE_SORT)return void 0===e?nativeSort(t):nativeSort(t,e);var r,n,o=[],i=lengthOfArrayLike$4(t);for(n=0;n<i;n++)n in t&&push$6(o,t[n]);for(internalSort(o,getSortCompare(e)),r=lengthOfArrayLike$4(o),n=0;n<r;)t[n]=o[n++];for(;n<i;)deletePropertyOrThrow$1(t,n++);return t}});var entryVirtual$8=entryVirtual$o,sort$6=entryVirtual$8("Array").sort,isPrototypeOf$7=objectIsPrototypeOf,method$6=sort$6,ArrayPrototype$6=Array.prototype,sort$5=function(e){var t=e.sort;return e===ArrayPrototype$6||isPrototypeOf$7(ArrayPrototype$6,e)&&t===ArrayPrototype$6.sort?method$6:t},parent$O=sort$5,sort$4=parent$O,parent$N=sort$4,sort$3=parent$N,parent$M=sort$3,sort$2=parent$M,sort$1=sort$2,sort2=sort$1,_sortInstanceProperty=getDefaultExportFromCjs(sort2),$$C=_export,uncurryThis$8=functionUncurryThis,$Date=Date,thisTimeValue=uncurryThis$8($Date.prototype.getTime);$$C({target:"Date",stat:!0},{now:function(){return thisTimeValue(new $Date)}});var _context,path$8=path$y,now$5=path$8.Date.now,parent$L=now$5,now$4=parent$L,parent$K=now$4,now$3=parent$K,parent$J=now$3,now$2=parent$J,now$1=now$2,now2=now$1,_Date$now=getDefaultExportFromCjs(now2),XG_DEBUG_OPEN="undefined"!=typeof window&&window.location&&_indexOfInstanceProperty(_context=window.location.href).call(_context,"xgplayerdebugger=1")>-1,STYLE={info:"color: #525252; background-color: #90ee90;",error:"color: #525252; background-color: red;",warn:"color: #525252; background-color: yellow; "},XGTAG="%c[xgplayer]",XG_DEBUG={config:{debug:XG_DEBUG_OPEN?3:0},logInfo:function(e){for(var t,r,n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];this.config.debug>=3&&(r=console).log.apply(r,_concatInstanceProperty(t=[XGTAG,STYLE.info,e]).call(t,o))},logWarn:function(e){for(var t,r,n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];this.config.debug>=1&&(r=console).warn.apply(r,_concatInstanceProperty(t=[XGTAG,STYLE.warn,e]).call(t,o))},logError:function(e){var t,r;if(!(this.config.debug<1)){for(var n=this.config.debug>=2?"trace":"error",o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];(r=console)[n].apply(r,_concatInstanceProperty(t=[XGTAG,STYLE.error,e]).call(t,i))}}},XgplayerTimeRange=function(){function e(t){_classCallCheck$1(this,e),this.bufferedList=t}return _createClass$1(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$3={};function checkIsIn(e,t){for(var r=0,n=t.length;r<n;r++)if(_indexOfInstanceProperty(e).call(e,t[r])>-1)return!0;return!1}util$3.createDom=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",i=document.createElement(t);return i.className=o,i.innerHTML=r,_forEachInstanceProperty(e=_Object$keys(n)).call(e,(function(e){var r=e,o=n[e];"video"===t||"audio"===t||"live-video"===t?o&&i.setAttribute(r,o):i.setAttribute(r,o)})),i},util$3.createDomFromHtml=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";try{var n=document.createElement("div");n.innerHTML=e;var o=n.children;if(n=null,o.length>0){var i;if(o=o[0],r&&util$3.addClass(o,r),t)_forEachInstanceProperty(i=_Object$keys(t)).call(i,(function(e){o.setAttribute(e,t[e])}));return o}return null}catch(e){return XG_DEBUG.logError("util.createDomFromHtml",e),null}},util$3.hasClass=function(e,t){if(!e||!t)return!1;try{return _someInstanceProperty(Array.prototype).call(e.classList,(function(e){return e===t}))}catch(n){var r=e.className&&"object"===_typeof$1(e.className)?e.getAttribute("class"):e.className;return r&&!!r.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}},util$3.addClass=function(e,t){if(e&&t)try{var r;_forEachInstanceProperty(r=t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g)).call(r,(function(t){t&&e.classList.add(t)}))}catch(r){util$3.hasClass(e,t)||(e.className&&"object"===_typeof$1(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t)}},util$3.removeClass=function(e,t){if(e&&t)try{var r;_forEachInstanceProperty(r=t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g)).call(r,(function(t){t&&e.classList.remove(t)}))}catch(r){var n;if(util$3.hasClass(e,t))_forEachInstanceProperty(n=t.split(/\s+/g)).call(n,(function(t){var r=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===_typeof$1(e.className)?e.setAttribute("class",e.getAttribute("class").replace(r," ")):e.className=e.className.replace(r," ")}))}},util$3.toggleClass=function(e,t){var r;e&&_forEachInstanceProperty(r=t.split(/\s+/g)).call(r,(function(t){util$3.hasClass(e,t)?util$3.removeClass(e,t):util$3.addClass(e,t)}))},util$3.classNames=function(){for(var e=arguments,t=[],r=function(r){if("String"===util$3.typeOf(e[r]))t.push(e[r]);else if("Object"===util$3.typeOf(e[r])){var n;_mapInstanceProperty(n=_Object$keys(e[r])).call(n,(function(n){e[r][n]&&t.push(n)}))}},n=0;n<arguments.length;n++)r(n);return t.join(" ")},util$3.findDom=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,r=arguments.length>1?arguments[1]:void 0;try{e=t.querySelector(r)}catch(n){XG_DEBUG.logError("util.findDom",n),0===_indexOfInstanceProperty(r).call(r,"#")&&(e=t.getElementById(_sliceInstanceProperty(r).call(r,1)))}return e},util$3.getCss=function(e,t){return e.currentStyle?e.currentStyle[t]:document.defaultView.getComputedStyle(e,!1)[t]},util$3.padStart=function(e,t,r){for(var n=String(r),o=t>>0,i=Math.ceil(o/n.length),a=[],s=String(e);i--;)a.push(n);return a.join("").substring(0,o-s.length)+s},util$3.format=function(e){if(window.isNaN(e))return"";e=Math.round(e);var t=_padStartInstanceProperty(util$3).call(util$3,Math.floor(e/3600),2,0),r=_padStartInstanceProperty(util$3).call(util$3,Math.floor((e-3600*t)/60),2,0),n=_padStartInstanceProperty(util$3).call(util$3,Math.floor(e-3600*t-60*r),2,0);return("00"===t?[r,n]:[t,r,n]).join(":")},util$3.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$3.typeOf=function(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]},util$3.deepCopy=function(e,t){var r;if("Object"===util$3.typeOf(t)&&"Object"===util$3.typeOf(e))return _forEachInstanceProperty(r=_Object$keys(t)).call(r,(function(r){if("Object"!==util$3.typeOf(t[r])||t[r]instanceof Node)if("Array"===util$3.typeOf(t[r])){var n;e[r]="Array"===util$3.typeOf(e[r])?_concatInstanceProperty(n=e[r]).call(n,t[r]):t[r]}else e[r]=t[r];else void 0===e[r]||void 0===e[r]?e[r]=t[r]:util$3.deepCopy(e[r],t[r])})),e},util$3.deepMerge=function(e,t){var r;return _mapInstanceProperty(r=_Object$keys(t)).call(r,(function(r){var n;"Array"===util$3.typeOf(t[r])&&"Array"===util$3.typeOf(e[r])?"Array"===util$3.typeOf(e[r])&&(n=e[r]).push.apply(n,_toConsumableArray$1(t[r])):util$3.typeOf(e[r])!==util$3.typeOf(t[r])||null===e[r]||"Object"!==util$3.typeOf(e[r])||t[r]instanceof window.Node?null!==t[r]&&(e[r]=t[r]):util$3.deepMerge(e[r],t[r])})),e},util$3.getBgImage=function(e){var t=(e.currentStyle||window.getComputedStyle(e,null)).backgroundImage;if(!t||"none"===t)return"";var r=document.createElement("a");return r.href=t.replace(/url\("|"\)/g,""),r.href},util$3.copyDom=function(e){if(e&&1===e.nodeType){var t=document.createElement(e.tagName);return _forEachInstanceProperty(Array.prototype).call(e.attributes,(function(e){t.setAttribute(e.name,e.value)})),e.innerHTML&&(t.innerHTML=e.innerHTML),t}return""},util$3.setInterval=function(e,t,r,n){e._interval[t]||(e._interval[t]=_setInterval(_bindInstanceProperty(r).call(r,e),n))},util$3.clearInterval=function(e,t){clearInterval(e._interval[t]),e._interval[t]=null},util$3.setTimeout=function(e,t,r){e._timers||(e._timers=[]);var n=_setTimeout((function(){t(),util$3.clearTimeout(e,n)}),r);return e._timers.push(n),n},util$3.clearTimeout=function(e,t){var r=e._timers;if("Array"===util$3.typeOf(r)){for(var n=0;n<r.length;n++)if(r[n]===t){_spliceInstanceProperty(r).call(r,n,1),clearTimeout(t);break}}else clearTimeout(t)},util$3.clearAllTimers=function(e){var t=e._timers;"Array"===util$3.typeOf(t)&&(_mapInstanceProperty(t).call(t,(function(e){clearTimeout(e)})),e._timerIds=[])},util$3.createImgBtn=function(e,t,r,n){var o,i,a,s,l,c,u,p,f,d,h,$,y=util$3.createDom("xg-".concat(e),"",{},"xgplayer-".concat(e,"-img"));(y.style.backgroundImage='url("'.concat(t,'")'),r&&n)&&(_everyInstanceProperty(o=["px","rem","em","pt","dp","vw","vh","vm","%"]).call(o,(function(e){var t,o;return!(_indexOfInstanceProperty(r).call(r,e)>-1&&_indexOfInstanceProperty(n).call(n,e)>-1)||(u=_parseFloat$1(_trimInstanceProperty(t=_sliceInstanceProperty(r).call(r,0,_indexOfInstanceProperty(r).call(r,e))).call(t)),p=_parseFloat$1(_trimInstanceProperty(o=_sliceInstanceProperty(n).call(n,0,_indexOfInstanceProperty(n).call(n,e))).call(o)),f=e,!1)})),y.style.width=_concatInstanceProperty(i="".concat(u)).call(i,f),y.style.height=_concatInstanceProperty(a="".concat(p)).call(a,f),y.style.backgroundSize=_concatInstanceProperty(s=_concatInstanceProperty(l=_concatInstanceProperty(c="".concat(u)).call(c,f," ")).call(l,p)).call(s,f),y.style.margin="start"===e?_concatInstanceProperty(d=_concatInstanceProperty(h=_concatInstanceProperty($="-".concat(p/2)).call($,f," auto auto -")).call(h,u/2)).call(d,f):"auto 5px auto 5px");return y},util$3.Hex2RGBA=function(e,t){var r,n=[];if(/^\#[0-9A-F]{3}$/i.test(e)){var o="#";e.replace(/[0-9A-F]/gi,(function(e){o+=e+e})),e=o}return/^#[0-9A-F]{6}$/i.test(e)?(e.replace(/[0-9A-F]{2}/gi,(function(e){n.push(_parseInt$1(e,16))})),_concatInstanceProperty(r="rgba(".concat(n.join(","),", ")).call(r,t,")")):"rgba(255, 255, 255, 0.1)"},util$3.getFullScreenEl=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},util$3.checkIsFunction=function(e){return e&&"function"==typeof e},util$3.checkIsObject=function(e){return null!==e&&"object"===_typeof$1(e)},util$3.hide=function(e){e.style.display="none"},util$3.show=function(e,t){e.style.display=t||"block"},util$3.isUndefined=function(e){if(null==e)return!0},util$3.isNotNull=function(e){return!(null==e)},util$3.setStyleFromCsstext=function(e,t){if(t)if("String"===util$3.typeOf(t)){var r=t.replace(/\s+/g,"").split(";");_mapInstanceProperty(r).call(r,(function(t){if(t){var r=t.split(":");r.length>1&&(e.style[r[0]]=r[1])}}))}else{var n;_mapInstanceProperty(n=_Object$keys(t)).call(n,(function(r){e.style[r]=t[r]}))}},util$3.filterStyleFromText=function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["width","height","top","left","bottom","right","position","z-index","padding","margin","transform"],n=e.style.cssText;if(!n)return{};var o=n.replace(/\s+/g,"").split(";"),i={},a={};return _mapInstanceProperty(o).call(o,(function(e){if(e){var t=e.split(":");t.length>1&&(checkIsIn(t[0],r)?i[t[0]]=t[1]:a[t[0]]=t[1])}})),e.setAttribute("style",""),_mapInstanceProperty(t=_Object$keys(a)).call(t,(function(t){e.style[t]=a[t]})),i},util$3.getStyleFromCsstext=function(e){var t=e.style.cssText;if(!t)return{};var r=t.replace(/\s+/g,"").split(";"),n={};return _mapInstanceProperty(r).call(r,(function(e){if(e){var t=e.split(":");t.length>1&&(n[t[0]]=t[1])}})),n},util$3.preloadImg=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(e){var n=new window.Image;n.onload=function(e){n=null,t&&t(e)},n.onerror=function(e){n=null,r&&r(e)},n.src=e}},util$3.stopPropagation=function(e){e&&e.stopPropagation()},util$3.scrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},util$3.scrollLeft=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},util$3.checkTouchSupport=function(){return"ontouchstart"in window},util$3.getBuffered2=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,r=[],n=0;n<e.length;n++)r.push({start:e.start(n)<.5?0:e.start(n),end:e.end(n)});_sortInstanceProperty(r).call(r,(function(e,t){var r=e.start-t.start;return r||t.end-e.end}));var o=[];if(t)for(var i=0;i<r.length;i++){var a=o.length;if(a){var s=o[a-1].end;r[i].start-s<t?r[i].end>s&&(o[a-1].end=r[i].end):o.push(r[i])}else o.push(r[i])}else o=r;return new XgplayerTimeRange(o)},util$3.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$3.requestAnimationFrame=function(e){var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(t)return t(e)},util$3.getHostFromUrl=function(e){if("String"!==util$3.typeOf(e))return"";var t=e.split("/"),r="";return t.length>3&&t[2]&&(r=t[2]),r},util$3.cancelAnimationFrame=function(e){var t=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.cancelRequestAnimationFrame;t&&t(e)},util$3.isMSE=function(e){return e.media&&(e=e.media),!!(e&&e instanceof HTMLMediaElement)&&(/^blob/.test(e.currentSrc)||/^blob/.test(e.src))},util$3.isBlob=function(e){return"string"==typeof e&&/^blob/.test(e)},util$3.generateSessionId=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=(new Date).getTime();try{e=_parseInt$1(e)}catch(t){e=0}return t+=e,window.performance&&"function"==typeof window.performance.now&&(t+=_parseInt$1(window.performance.now())),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var r=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?r:3&r|8).toString(16)}))},util$3.createEvent=function(e){var t;return"function"==typeof window.Event?t=new Event(e):(t=document.createEvent("Event")).initEvent(e,!0,!0),t},util$3.adjustTimeByDuration=function(e,t,r){return t&&e&&(e>t||r&&e<t)?t:e},util$3.createPositionBar=function(e,t){var r=util$3.createDom("xg-bar","",{"data-index":-1},e);return t.appendChild(r),r},util$3.getTransformStyle=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{x:0,y:0,scale:1,rotate:0},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n={scale:"".concat(t.scale||1),translate:_concatInstanceProperty(e="".concat(t.x||0,"%, ")).call(e,t.y||0,"%"),rotate:"".concat(t.rotate||0,"deg")},o=_Object$keys(n);return _forEachInstanceProperty(o).call(o,(function(e){var t,o=new RegExp("".concat(e,"\\([^\\(]+\\)"),"g"),i=_concatInstanceProperty(t="".concat(e,"(")).call(t,n[e],")");o.test(r)?(o.lastIndex=-1,r=r.replace(o,i)):r+="".concat(i," ")})),r},util$3.convertDeg=function(e){return Math.abs(e)<=1?360*e:e%360},util$3.getIndexByTime=function(e,t){var r=t.length,n=-1;if(r<1)return n;if(e<=t[0].end||r<2)n=0;else if(e>t[r-1].end)n=r-1;else for(var o=1;o<r;o++)if(e>t[o-1].end&&e<=t[o].end){n=o;break}return n},util$3.getOffsetCurrentTime=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,n=-1;if((n=r>=0&&r<t.length?r:util$3.getIndexByTime(e,t))<0)return-1;var o=t.length,i=t[n],a=i.start,s=i.end,l=i.cTime,c=i.offset;return e<a?l:e>=a&&e<=s?e-c:e>s&&n>=o-1?s:-1},util$3.getCurrentTimeByOffset=function(e,t){var r=-1;if(!t||t.length<0)return e;for(var n=0;n<t.length;n++)if(e<=t[n].duration){r=n;break}if(-1!==r){var o=t[r].start;return r-1<0?o+e:o+(e-t[r-1].duration)}return e};var VERSION_REG={android:/(Android)\s([\d.]+)/,ios:/(Version)\/([\d.]+)/},H264_MIMETYPES=["avc1.42E01E, mp4a.40.2","avc1.58A01E, mp4a.40.2","avc1.4D401E, mp4a.40.2","avc1.64001E, mp4a.40.2","avc1.42E01E","mp4v.20.8","mp4v.20.8, mp4a.40.2","mp4v.20.240, mp4a.40.2"],sniffer={get device(){return sniffer.os.isPc?"pc":"mobile"},get browser(){var e,t;if("undefined"==typeof navigator)return"";var r=navigator.userAgent.toLowerCase(),n={ie:/rv:([\d.]+)\) like gecko/,firefox:/firefox\/([\d.]+)/,chrome:/chrome\/([\d.]+)/,opera:/opera.([\d.]+)/,safari:/version\/([\d.]+).*safari/};return _concatInstanceProperty(e=[]).call(e,_filterInstanceProperty(t=_Object$keys(n)).call(t,(function(e){return n[e].test(r)})))[0]},get os(){if("undefined"==typeof navigator)return{};var e=navigator.userAgent,t=/(?:Windows Phone)/.test(e),r=/(?:SymbianOS)/.test(e)||t,n=/(?:Android)/.test(e),o=/(?:Firefox)/.test(e),i=/(?:iPad|PlayBook)/.test(e)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,a=i||n&&!/(?:Mobile)/.test(e)||o&&/(?:Tablet)/.test(e),s=/(?:iPhone)/.test(e)&&!a;return{isTablet:a,isPhone:s,isIpad:i,isIos:s||i,isAndroid:n,isPc:!(s||n||r||a),isSymbian:r,isWindowsPhone:t,isFireFox:o}},get osVersion(){if("undefined"==typeof navigator)return 0;var e=navigator.userAgent,t="",r=(t=/(?:iPhone)|(?:iPad|PlayBook)/.test(e)?VERSION_REG.ios:VERSION_REG.android)?t.exec(e):[];if(r&&r.length>=3){var n=r[2].split(".");return n.length>0?_parseInt$1(n[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&&_mapInstanceProperty(H264_MIMETYPES).call(H264_MIMETYPES,(function(r){"probably"===t.canPlayType('video/mp4; codecs="'.concat(r,'"'))&&(e.isSupport=!0,e.mime+="||".concat(r))})),this.supportResult=e,t=null,e},isMSESupport:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'video/mp4; codecs="avc1.42E01E,mp4a.40.2"';if("undefined"==typeof MediaSource||!MediaSource)return!1;try{return MediaSource.isTypeSupported(e)}catch(t){return this._logger.error(e,t),!1}},isHevcSupported:function(){return!("undefined"==typeof MediaSource||!MediaSource.isTypeSupported)&&(MediaSource.isTypeSupported('video/mp4;codecs="hev1.1.6.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.2.4.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.3.E.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.4.10.L120.90"'))},probeConfigSupported:function(e){var t={supported:!1,smooth:!1,powerEfficient:!1};if(!e||"undefined"==typeof navigator)return _Promise.resolve(t);if(navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo)return navigator.mediaCapabilities.decodingInfo(e);var r=e.video||{},n=e.audio||{};try{var o=MediaSource.isTypeSupported(r.contentType),i=MediaSource.isTypeSupported(n.contentType);return _Promise.resolve({supported:o&&i,smooth:!1,powerEfficient:!1})}catch(e){return _Promise.resolve(t)}}},PLAY="play",ENDED="ended",PAUSE="pause",ERROR="error",SEEKED="seeked",TIME_UPDATE="timeupdate",DURATION_CHANGE="durationchange",VOLUME_CHANGE="volumechange",LOADED_DATA="loadeddata",PROGRESS="progress",EMPTIED="emptied",AUTOPLAY_STARTED="autoplay_started",COMPLETE="complete",FULLSCREEN_CHANGE="fullscreen_change",CSS_FULLSCREEN_CHANGE="cssFullscreen_change",VIDEO_RESIZE="video_resize";function callHandler(e,t,r){for(var n,o=arguments.length,i=new Array(o>3?o-3:0),a=3;a<o;a++)i[a-3]=arguments[a];var s,l=t.call.apply(t,_concatInstanceProperty(n=[e]).call(n,i));r&&"function"==typeof r&&(l&&l.then?l.then((function(){for(var t,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];r.call.apply(r,_concatInstanceProperty(t=[e]).call(t,o))})):r.call.apply(r,_concatInstanceProperty(s=[e]).call(s,i)))}function hook(e,t){var r,n=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),_bindInstanceProperty(r=function(){var r,o=arguments,i=this;if(n.pre)try{var a,s;(s=n.pre).call.apply(s,_concatInstanceProperty(a=[this]).call(a,_sliceInstanceProperty(Array.prototype).call(arguments)))}catch(t){var l,c;throw t.message=_concatInstanceProperty(l=_concatInstanceProperty(c="[pluginName: ".concat(this.pluginName,":")).call(c,e,":pre error] >> ")).call(l,t.message),t}if(this.__hooks&&this.__hooks[e])try{var u,p=runHooks(this,e,t);if(p)if(p.then)p.then((function(e){var r;!1!==e&&callHandler.apply(void 0,_concatInstanceProperty(r=[i,t,n.next]).call(r,_toConsumableArray$1(o)))})).catch((function(e){throw e}));else callHandler.apply(void 0,_concatInstanceProperty(u=[this,t,n.next]).call(u,_sliceInstanceProperty(Array.prototype).call(arguments)));else if(void 0===p){var f;callHandler.apply(void 0,_concatInstanceProperty(f=[this,t,n.next]).call(f,_sliceInstanceProperty(Array.prototype).call(arguments)))}}catch(t){var d,h;throw t.message=_concatInstanceProperty(d=_concatInstanceProperty(h="[pluginName: ".concat(this.pluginName,":")).call(h,e,"] >> ")).call(d,t.message),t}else callHandler.apply(void 0,_concatInstanceProperty(r=[this,t,n.next]).call(r,_sliceInstanceProperty(Array.prototype).call(arguments)))}).call(r,this)}function findHookIndex(e,t){var r=this.__hooks;if(!r||!_Array$isArray(r[e]))return-1;for(var n=r[e],o=0;o<n.length;o++)if(n[o]===t)return o;return-1}function useHooks(e,t){var r=this.__hooks;if(r)return r.hasOwnProperty(e)?(_Array$isArray(r[e])||(r[e]=[]),-1===findHookIndex.call(this,e,t)&&r[e].push(t),!0):(console.warn("has no supported hook which name [".concat(e,"]")),!1)}function removeHooks(e,t){var r=this.__hooks;if(r)if(_Array$isArray(r[e])){var n=r[e],o=findHookIndex.call(this,e,t);-1!==o&&_spliceInstanceProperty(n).call(n,o,1)}else r[e]&&(r[e]=null)}function hooksDescriptor(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];e.__hooks={},t&&_mapInstanceProperty(t).call(t,(function(t){e.__hooks[t]=null})),_Object$defineProperty(e,"hooks",{get:function(){var t;return e.__hooks&&_mapInstanceProperty(t=_Object$keys(e.__hooks)).call(t,(function(t){if(e.__hooks[t])return t}))}})}function delHooksDescriptor(e){e.__hooks=null}function runHooks(e,t,r){for(var n=arguments.length,o=new Array(n>3?n-3:0),i=3;i<n;i++)o[i-3]=arguments[i];if(e.__hooks&&_Array$isArray(e.__hooks[t])){var a,s=e.__hooks[t],l=-1;return function e(t,r,n){for(var o,i,a=arguments.length,c=new Array(a>3?a-3:0),u=3;u<a;u++)c[u-3]=arguments[u];if(l++,0===s.length||l===s.length)return n.call.apply(n,_concatInstanceProperty(i=[t,t]).call(i,c));var p,f=s[l],d=f.call.apply(f,_concatInstanceProperty(o=[t,t]).call(o,c));return d&&d.then?d.then((function(o){var i;return!1===o?null:e.apply(void 0,_concatInstanceProperty(i=[t,r,n]).call(i,c))})).catch((function(e){console.warn("[runHooks]".concat(r," reject"),e.message)})):!1!==d?e.apply(void 0,_concatInstanceProperty(p=[t,r,n]).call(p,c)):void 0}.apply(void 0,_concatInstanceProperty(a=[e,t,r]).call(a,o))}var c;return r.call.apply(r,_concatInstanceProperty(c=[e,e]).call(c,o))}function showErrorMsg(e,t){var r;XG_DEBUG.logError(_concatInstanceProperty(r="[".concat(e,"] event or callback cant be undefined or null when call ")).call(r,t))}var BasePlugin=function(){function e(t){_classCallCheck$1(this,e),util$3.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$1(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$3.checkTouchSupport()?"touch":"mouse";return!this.playerConfig||"touch"!==this.playerConfig.domEventType&&"mouse"!==this.playerConfig.domEventType||(e=this.playerConfig.domEventType),e}},{key:"on",value:function(e,t){var r=this;e&&t&&this.player?"string"==typeof e?(this.__events[e]=t,this.player.on(e,t)):_Array$isArray(e)&&_forEachInstanceProperty(e).call(e,(function(e){r.__events[e]=t,r.player.on(e,t)})):showErrorMsg(this.pluginName,"plugin.on(event, callback)")}},{key:"once",value:function(e,t){var r=this;e&&t&&this.player?"string"==typeof e?(this.__onceEvents[e]=t,this.player.once(e,t)):_Array$isArray(e)&&_forEachInstanceProperty(e).call(e,(function(n){r.__onceEvents[n]=t,r.player.once(e,t)})):showErrorMsg(this.pluginName,"plugin.once(event, callback)")}},{key:"off",value:function(e,t){var r=this;e&&t&&this.player?"string"==typeof e?(delete this.__events[e],this.player.off(e,t)):_Array$isArray(e)&&_forEachInstanceProperty(e).call(e,(function(n){delete r.__events[e],r.player.off(n,t)})):showErrorMsg(this.pluginName,"plugin.off(event, callback)")}},{key:"offAll",value:function(){var e,t=this;_forEachInstanceProperty(e=["__events","__onceEvents"]).call(e,(function(e){var r;_forEachInstanceProperty(r=_Object$keys(t[e])).call(r,(function(r){t[e][r]&&t.off(r,t[e][r]),r&&delete t[e][r]}))})),this.__events={},this.__onceEvents={}}},{key:"emit",value:function(e){var t,r;if(this.player){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];(r=this.player).emit.apply(r,_concatInstanceProperty(t=[e]).call(t,o))}}},{key:"emitUserAction",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.player){var n=_objectSpread2$1(_objectSpread2$1({},r),{},{pluginName:this.pluginName});this.player.emitUserAction(e,t,n)}}},{key:"hook",value:function(e,t){var r;return hook.call.apply(hook,_concatInstanceProperty(r=[this]).call(r,_sliceInstanceProperty(Array.prototype).call(arguments)))}},{key:"useHooks",value:function(e,t){for(var r,n=arguments.length,o=new Array(n>2?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];return useHooks.call.apply(useHooks,_concatInstanceProperty(r=[this]).call(r,_sliceInstanceProperty(Array.prototype).call(arguments)))}},{key:"removeHooks",value:function(e,t){for(var r,n=arguments.length,o=new Array(n>2?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];return removeHooks.call.apply(removeHooks,_concatInstanceProperty(r=[this]).call(r,_sliceInstanceProperty(Array.prototype).call(arguments)))}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(this.player)return r&&(t.pluginName=r),this.player.registerPlugin({plugin:e,options:t})}},{key:"getPlugin",value:function(e){return this.player?this.player.getPlugin(e):null}},{key:"__destroy",value:function(){var e,t=this,r=this.player,n=this.pluginName;this.offAll(),util$3.clearAllTimers(this),util$3.checkIsFunction(this.destroy)&&this.destroy(),_mapInstanceProperty(e=["player","playerConfig","pluginName","logger","__args","__hooks"]).call(e,(function(e){t[e]=null})),r.unRegisterPlugin(n),delHooksDescriptor(this)}}],[{key:"defineGetterOrSetter",value:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&_Object$defineProperty(e,r,t[r])}},{key:"defineMethod",value:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&"function"==typeof t[r]&&_Object$defineProperty(e,r,{configurable:!0,value:t[r]})}},{key:"defaultConfig",get:function(){return{}}},{key:"pluginName",get:function(){return"pluginName"}}]),e}(),DOCUMENT_NODE_TYPE=9;if("undefined"!=typeof Element&&!Element.prototype.matches){var proto=Element.prototype;proto.matches=proto.matchesSelector||proto.mozMatchesSelector||proto.msMatchesSelector||proto.oMatchesSelector||proto.webkitMatchesSelector}function closest$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,r,n,o){var i=listener.apply(this,arguments);return e.addEventListener(r,i,o),{destroy:function(){e.removeEventListener(r,i,o)}}}function delegate(e,t,r,n,o){return"function"==typeof e.addEventListener?_delegate.apply(null,arguments):"function"==typeof r?_bindInstanceProperty(_delegate).call(_delegate,null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),_mapInstanceProperty(Array.prototype).call(e,(function(e){return _delegate(e,t,r,n,o)})))}function listener(e,t,r,n){return function(r){r.delegateTarget=closest(r.target,t),r.delegateTarget&&n.call(e,r)}}var delegate_1=delegate,_delegate$1=getDefaultExportFromCjs(delegate_1),ROOT_TYPES={CONTROLS:"controls",ROOT:"root"},POSITIONS={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(e){return!!e&&(_indexOfInstanceProperty(e)&&/^(?:http|data:|\/)/.test(e))}function mergeIconClass(e,t){var r;return"object"===_typeof$1(e)&&e.class&&"string"==typeof e.class?_concatInstanceProperty(r="".concat(t," ")).call(r,e.class):t}function mergeIconAttr(e,t){var r;"object"===_typeof$1(e)&&e.attr&&"object"===_typeof$1(e.attr)&&_mapInstanceProperty(r=_Object$keys(e.attr)).call(r,(function(r){t[r]=e.attr[r]}));return t}function createIcon(e,t){var r,n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",s=null;if(e instanceof window.Element)return util$3.addClass(e,o),_mapInstanceProperty(n=_Object$keys(i)).call(n,(function(t){e.setAttribute(t,i[t])})),e;if(isUrl(e)||isUrl(e.url))return i.src=isUrl(e)?e:e.url||"",s=util$3.createDom(e.tag||"img","",i,"xg-img ".concat(o));if("function"==typeof e)try{var l,c;return(s=e())instanceof window.Element?(util$3.addClass(s,o),_mapInstanceProperty(l=_Object$keys(i)).call(l,(function(e){s.setAttribute(e,i[e])})),s):(XG_DEBUG.logWarn(_concatInstanceProperty(c="warn>>icons.".concat(t," in config of plugin named [")).call(c,a,"] is a function mast return an Element Object")),null)}catch(e){return XG_DEBUG.logError("Plugin named [".concat(a,"]:createIcon"),e),null}return"string"==typeof e?util$3.createDomFromHtml(e,i,o):(XG_DEBUG.logWarn(_concatInstanceProperty(r="warn>>icons.".concat(t," in config of plugin named [")).call(r,a,"] is invalid")),null)}function registerIconsObj(e,t){var r,n=t.config.icons||t.playerConfig.icons;_mapInstanceProperty(r=_Object$keys(e)).call(r,(function(r){var o=e[r],i=o&&o.class?o.class:"",a=o&&o.attr?o.attr:{},s=null;n&&n[r]&&(i=mergeIconClass(n[r],i),a=mergeIconAttr(n[r],a),s=createIcon(n[r],r,i,a,t.pluginName)),!s&&o&&(s=createIcon(o.icon?o.icon:o,a,i,{},t.pluginName)),t.icons[r]=s}))}function registerTextObj(e,t){var r;_mapInstanceProperty(r=_Object$keys(e)).call(r,(function(r){_Object$defineProperty(t.langText,r,{get:function(){var n=t.lang,o=t.i18n;return o[r]?o[r]:e[r]&&e[r][n]||""}})}))}var Plugin=function(e){_inherits(r,BasePlugin);var t=_createSuper(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck$1(this,r),(e=t.call(this,n)).__delegates=[],e}return _createClass$1(r,[{key:"__init",value:function(e){if(_get(_getPrototypeOf(r.prototype),"__init",this).call(this,e),e.root){var t=e.root,n=null;this.icons={},this.root=null,this.parent=null,registerIconsObj(this.registerIcons()||{},this),this.langText={},registerTextObj(this.registerLanguageTexts()||{},this);var o="";try{o=this.render()}catch(e){var i;throw XG_DEBUG.logError("Plugin:".concat(this.pluginName,":render"),e),new Error(_concatInstanceProperty(i="Plugin:".concat(this.pluginName,":render:")).call(i,e.message))}if(o)(n=r.insert(o,t,e.index)).setAttribute("data-index",e.index);else{if(!e.tag)return;(n=util$3.createDom(e.tag,"",e.attr,e.name)).setAttribute("data-index",e.index),t.appendChild(n)}this.root=n,this.parent=t;var a=this.config.attr||{},s=this.config.style||{};this.setAttr(a),this.setStyle(s),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,r=this.children();if(r&&"object"===_typeof$1(r))if(_Object$keys(r).length>0)_mapInstanceProperty(t=_Object$keys(r)).call(t,(function(t){var n,o,i=t,a=r[i],s={root:e.root};"function"==typeof a?(n=e.config[i]||{},o=a):"object"===_typeof$1(a)&&"function"==typeof a.plugin&&(n=a.options?util$3.deepCopy(e.config[i]||{},a.options):e.config[i]||{},o=a.plugin),s.config=n,void 0!==n.index&&(s.index=n.index),n.root&&(s.root=n.root),e.registerPlugin(o,s,i)}))}}},{key:"updateLang",value:function(e){e||(e=this.lang);var t=this.root,r=this.i18n,n=this.langText;t&&function e(t,r){for(var n=0;n<t.children.length;n++)t.children[n].children.length>0?e(t.children[n],r):r(t.children[n])}(t,(function(t){var o=t.getAttribute&&t.getAttribute("lang-key");if(o){var i=r[o.toUpperCase()]||n[o];i&&(t.innerHTML="function"==typeof i?i(e):i)}}))}},{key:"lang",get:function(){return this.player.lang}},{key:"changeLangTextKey",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=this.i18n||{},n=this.langText;e.setAttribute&&e.setAttribute("lang-key",t);var o=r[t]||n[t]||"";o&&(e.innerHTML=o)}},{key:"plugins",value:function(){return this._children}},{key:"disable",value:function(){this.config.disable=!0,util$3.addClass(_findInstanceProperty(this).call(this,".xgplayer-icon"),PLUGIN_STATE_CLASS.ICON_DISABLE)}},{key:"enable",value:function(){this.config.disable=!1,util$3.removeClass(_findInstanceProperty(this).call(this,".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]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";t.root=t.root||this.root;var o=_get(_getPrototypeOf(r.prototype),"registerPlugin",this).call(this,e,t,n);return this._children.push(o),o}},{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,n){var o=this;if(arguments.length<3&&"function"==typeof t)_Array$isArray(e)?_forEachInstanceProperty(e).call(e,(function(e){o.bindEL(e,t)})):this.bindEL(e,t);else{var i,a=r.delegate.call(this,this.root,e,t,n);this.__delegates=_concatInstanceProperty(i=this.__delegates).call(i,a)}}},{key:"unbind",value:function(e,t){var r=this;if(arguments.length<3&&"function"==typeof t)_Array$isArray(e)?_forEachInstanceProperty(e).call(e,(function(e){r.unbindEL(e,t)})):this.unbindEL(e,t);else for(var n,o=_concatInstanceProperty(n="".concat(e,"_")).call(n,t),i=0;i<this.__delegates.length;i++)if(this.__delegates[i].key===o){var a;this.__delegates[i].destroy(),_spliceInstanceProperty(a=this.__delegates).call(a,i,1);break}}},{key:"setStyle",value:function(e,t){var r,n=this;if(this.root)return"String"===util$3.typeOf(e)?this.root.style[e]=t:void("Object"===util$3.typeOf(e)&&_mapInstanceProperty(r=_Object$keys(e)).call(r,(function(t){n.root.style[t]=e[t]})))}},{key:"setAttr",value:function(e,t){var r,n=this;if(this.root)return"String"===util$3.typeOf(e)?this.root.setAttribute(e,t):void("Object"===util$3.typeOf(e)&&_mapInstanceProperty(r=_Object$keys(e)).call(r,(function(t){n.root.setAttribute(t,e[t])})))}},{key:"setHtml",value:function(e,t){this.root&&(this.root.innerHTML=e,"function"==typeof t&&t())}},{key:"bindEL",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.root&&"on".concat(e)in this.root&&"function"==typeof t&&this.root.addEventListener(e,t,r)}},{key:"unbindEL",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.root&&"on".concat(e)in this.root&&"function"==typeof t&&this.root.removeEventListener(e,t,r)}},{key:"show",value:function(e){if(this.root)return this.root.style.display=void 0!==e?e:"block","none"===window.getComputedStyle(this.root,null).getPropertyValue("display")?this.root.style.display="block":void 0}},{key:"hide",value:function(){this.root&&(this.root.style.display="none")}},{key:"appendChild",value:function(e,t){if(!this.root)return null;if(arguments.length<2&&arguments[0]instanceof window.Element)return this.root.appendChild(arguments[0]);if(!(t&&t instanceof window.Element))return null;try{return"string"==typeof e?_findInstanceProperty(this).call(this,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,t,n,o=this,i=this.player;(_mapInstanceProperty(e=this.__delegates).call(e,(function(e){e.destroy()})),this.__delegates=[],this._children instanceof Array)&&(_mapInstanceProperty(n=this._children).call(n,(function(e){i.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(_getPrototypeOf(r.prototype),"__destroy",this).call(this),this.icons={},_mapInstanceProperty(t=["root","parent"]).call(t,(function(e){o[e]=null}))}}],[{key:"insert",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=t.children.length,o=Number(r),i=e instanceof window.Node;if(n){for(var a=0,s=null,l="";a<n;a++){s=t.children[a];var c=Number(s.getAttribute("data-index"));if(c>=o){l="beforebegin";break}c<o&&(l="afterend")}return i?"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 i?t.appendChild(e):t.insertAdjacentHTML("beforeend",e),t.children[t.children.length-1]}},{key:"defaultConfig",get:function(){return{}}},{key:"delegate",value:function(e,t,r,n){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=[];if(e instanceof window.Node&&"function"==typeof n)if(_Array$isArray(r))_forEachInstanceProperty(r).call(r,(function(r){var a,s=_delegate$1(e,t,r,n,o);s.key=_concatInstanceProperty(a="".concat(t,"_")).call(a,r),i.push(s)}));else{var a,s=_delegate$1(e,t,r,n,o);s.key=_concatInstanceProperty(a="".concat(t,"_")).call(a,r),i.push(s)}return i}},{key:"ROOT_TYPES",get:function(){return ROOT_TYPES}},{key:"POSITIONS",get:function(){return POSITIONS}}]),r}(),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"},STATES={INITIAL:1,READY:2,ATTACHING:3,ATTACHED:4,NOTALLOW:5,RUNNING:6,ENDED:7,DESTROYED:8};function PlaySvg(){return(new DOMParser).parseFromString('<svg class="play" xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="3 -4 28 40">\n <path fill="#fff" transform="scale(0.0320625 0.0320625)" d="M576,363L810,512L576,661zM342,214L576,363L576,661L342,810z"></path>\n</svg>\n',"image/svg+xml").firstChild}function PauseSvg(){return(new DOMParser).parseFromString('<svg class="pause" xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="3 -4 28 40">\n <path fill="#fff" transform="scale(0.0320625 0.0320625)" d="M598,214h170v596h-170v-596zM256 810v-596h170v596h-170z"></path>\n</svg>\n',"image/svg+xml").firstChild}function xgIconTips(e,t,r){try{var n,o;return _concatInstanceProperty(n=_concatInstanceProperty(o=' <div class="xg-tips '.concat(r?"hide":" ",'" lang-key="')).call(o,e.i18nKeys[t],'">\n ')).call(n,e.i18n[t],"\n </div>")}catch(e){return'<div class="xg-tips hide"></div>'}}var $$B=_export,$findIndex=arrayIteration.findIndex,FIND_INDEX="findIndex",SKIPS_HOLES=!0;FIND_INDEX in[]&&Array(1)[FIND_INDEX]((function(){SKIPS_HOLES=!1})),$$B({target:"Array",proto:!0,forced:SKIPS_HOLES},{findIndex:function(e){return $findIndex(this,e,arguments.length>1?arguments[1]:void 0)}});var entryVirtual$7=entryVirtual$o,findIndex$6=entryVirtual$7("Array").findIndex,isPrototypeOf$6=objectIsPrototypeOf,method$5=findIndex$6,ArrayPrototype$5=Array.prototype,findIndex$5=function(e){var t=e.findIndex;return e===ArrayPrototype$5||isPrototypeOf$6(ArrayPrototype$5,e)&&t===ArrayPrototype$5.findIndex?method$5:t},parent$I=findIndex$5,findIndex$4=parent$I,parent$H=findIndex$4,findIndex$3=parent$H,parent$G=findIndex$3,findIndex$2=parent$G,findIndex$1=findIndex$2,findIndex2=findIndex$1,_findIndexInstanceProperty=getDefaultExportFromCjs(findIndex2),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$1(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$1(e,[{key:"updateDuration",value:function(e){var t=this;this.duration=e;var r=0,n=this.fragments;this.fragments=_mapInstanceProperty(n).call(n,(function(e){return e.start=_parseInt$1(r,10),e.end=_parseInt$1(r+e.percent*t.duration,10),e.duration=_parseInt$1(e.percent*t.duration,10),r+=e.percent*t.duration,e}))}},{key:"updateProgress",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"played",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{newIndex:0,curIndex:0,millisecond:0},r=this.progressList,n=this.fragments;if(!(r.length<1)){var o=t.newIndex,i=t.curIndex,a=t.millisecond;o!==i&&_mapInstanceProperty(r).call(r,(function(t,r){r<o?t[e].style.width="100%":r>o&&(t[e].style.width=0)}));var s=n[o],l=0===a?0:(a-s.start)/s.duration;r[o][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=_findIndexInstanceProperty(this).call(this,1e3*e.currentTime,this.focusIndex);if(t>=0&&t!==this.focusIndex){this.focusIndex>-1&&this.unHightLight(this.focusIndex),this.setHightLight(t);var r={index:t,preIndex:this.focusIndex,fragment:this.fragments[this.focusIndex]};this.focusIndex=t,this._callBack&&this._callBack(r)}}else if(this.focusIndex>-1){this.unHightLight(this.focusIndex);var n={index:-1,preIndex:this.focusIndex,fragment:null};this._callBack&&this._callBack(n),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$1(1e3*t,10)!==this.duration){if(!t&&0!==t)return;this.updateDuration(_parseInt$1(1e3*t,10))}var r=this.playedIndex,n=this.cachedIndex;if("Undefined"!==util$3.typeOf(e.played)){var o=_findIndexInstanceProperty(this).call(this,1e3*e.played,r);if(o<0)return;this.updateProgress("played",{newIndex:o,curIndex:r,millisecond:_parseInt$1(1e3*e.played,10)}),this.playedIndex=o}if("Undefined"!==util$3.typeOf(e.cached)){var i=_findIndexInstanceProperty(this).call(this,1e3*e.cached,n);if(i<0)return;this.updateProgress("cached",{newIndex:i,curIndex:n,millisecond:_parseInt$1(1e3*e.cached,10)}),this.cachedIndex=i}}},{key:"findIndex",value:function(e,t){var r=this.fragments;if(!r||0===r.length)return-1;if(1===r.length)return 0;if(t>-1&&t<r.length&&e>r[t].start&&e<r[t].end)return t;if(e>r[r.length-1].start)return r.length-1;for(var n=0;n<r.length;n++)if(e>r[n].start&&e<=r[n].end){t=n;break}return t}},{key:"findHightLight",value:function(){for(var e=this.root.children,t=0;t<e.length;t++)if(util$3.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$3.removeClass(e[t],this.fragConfig.fragFocusClass)}},{key:"setHightLight",value:function(e){var t=this.root.children;if(e<t.length)return util$3.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,r=this;if(_forEachInstanceProperty(t=_Object$keys(this.fragConfig)).call(t,(function(t){void 0!==e[t]&&(r.fragConfig[t]=e[t])})),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 n=this.root.children;n.length>0;)this.root.removeChild(n[0]);this.render()}}},{key:"render",value:function(){var e=this,t=this.style.progressColor;if(this.root||(this.root=util$3.createDom("xg-inners","",{},"progress-list")),this.fragments){var r,n=this.fragConfig,o=n.fragClass,i=n.fragFocusClass;this.progressList=_mapInstanceProperty(r=this.fragments).call(r,(function(r){var n,a,s=util$3.createDom("xg-inner","",{style:t?_concatInstanceProperty(n="background:".concat(t,"; flex: ")).call(n,r.percent):"flex: ".concat(r.percent)},_concatInstanceProperty(a="".concat(r.isFocus?i:""," xgplayer-progress-inner ")).call(a,o));return e.root.appendChild(s),_forEachInstanceProperty(TPL).call(TPL,(function(t){s.appendChild(util$3.createDom(t.tag,"",{style:t.styleKey?"background: ".concat(e.style[t.styleKey],"; width:0;"):"width:0;"},t.className))})),{cached:s.children[0],played:s.children[1]}}))}return this.root}}]),e}(),FRAGMENT_FOCUS_CLASS={POINT:"inner-focus-point",HIGHLIGHT:"inner-focus-highlight"},Progress=function(e){_inherits(r,Plugin);var t=_createSuper(r);function r(e){var n;return _classCallCheck$1(this,r),_defineProperty$1(_assertThisInitialized(n=t.call(this,e)),"onMoveOnly",(function(e,t){var r=_assertThisInitialized(n),o=r.pos,i=r.config,a=r.player,s=t;if(e){util$3.event(e);var l=util$3.getEventPos(e,a.zoom),c=90===a.rotateDeg?l.clientY:l.clientX;if(o.moving&&Math.abs(o.x-c)<i.miniMoveStep)return;o.moving=!0,o.x=c,s=n.computeTime(e,c)}n.triggerCallbacks("dragmove",s,e),n._updateInnerFocus(s)})),_defineProperty$1(_assertThisInitialized(n),"onBodyClick",(function(e){n.pos.isLocked&&(n.pos.isLocked=!1,e.preventDefault(),e.stopPropagation())})),_defineProperty$1(_assertThisInitialized(n),"_mouseDownHandler",(function(e,t){n._state.time=t.currentTime,n.updateWidth(t.currentTime,t.seekTime,t.percent,0),n._updateInnerFocus(t)})),_defineProperty$1(_assertThisInitialized(n),"_mouseUpHandler",(function(e,t){_assertThisInitialized(n).pos.moving&&n.updateWidth(t.currentTime,t.seekTime,t.percent,2)})),_defineProperty$1(_assertThisInitialized(n),"_mouseMoveHandler",(function(e,t){var r=_assertThisInitialized(n),o=r._state,i=r.pos,a=r.config,s=r.player;o.time<t.currentTime?t.forward=!0:t.forward=!1,o.time=t.currentTime,i.isDown&&!i.moving&&(i.moving=!0,a.isPauseMoving&&s.pause(),n.triggerCallbacks("dragstart",t,e),n.emitUserAction("drag","dragstart",t)),n.updateWidth(t.currentTime,t.seekTime,t.percent,1),n.triggerCallbacks("dragmove",t,e),n._updateInnerFocus(t)})),_defineProperty$1(_assertThisInitialized(n),"onMouseDown",(function(e){var t=_assertThisInitialized(n),r=t._state,o=t.player,i=t.pos,a=t.config,s=t.playerConfig,l=util$3.getEventPos(e,o.zoom),c=90===o.rotateDeg?l.clientY:l.clientX;if(!(o.isMini||a.closeMoveSeek||!s.allowSeekAfterEnded&&o.ended)){if(o.duration||o.isPlaying){e.stopPropagation(),n.focus(),util$3.checkIsFunction(s.disableSwipeHandler)&&s.disableSwipeHandler(),util$3.checkIsFunction(a.onMoveStart)&&a.onMoveStart(),util$3.event(e),i.x=c,i.isDown=!0,i.moving=!1,r.prePlayTime=o.currentTime,o.focus({autoHide:!1}),n.isProgressMoving=!0,util$3.addClass(n.progressBtn,"active");var u=n.computeTime(e,c);return u.prePlayTime=r.prePlayTime,n._mouseDownHandlerHook(e,u),"touchstart"===e.type?(n.root.addEventListener("touchmove",n.onMouseMove),n.root.addEventListener("touchend",n.onMouseUp),n.root.addEventListener("touchcancel",n.onMouseUp)):(n.unbind("mousemove",n.onMoveOnly),document.addEventListener("mousemove",n.onMouseMove,!1),document.addEventListener("mouseup",n.onMouseUp,!1)),!0}o.play()}})),_defineProperty$1(_assertThisInitialized(n),"onMouseUp",(function(e){var t=_assertThisInitialized(n),r=t.player,o=t.config,i=t.pos,a=t.playerConfig,s=t._state;e.stopPropagation(),e.preventDefault(),util$3.checkIsFunction(a.enableSwipeHandler)&&a.enableSwipeHandler(),util$3.checkIsFunction(o.onMoveEnd)&&o.onMoveEnd(),util$3.event(e),util$3.removeClass(n.progressBtn,"active");var l=n.computeTime(e,i.x);l.prePlayTime=s.prePlayTime,i.moving?(n.triggerCallbacks("dragend",l,e),n.emitUserAction("drag","dragend",l)):(n.triggerCallbacks("click",l,e),n.emitUserAction("click","click",l)),n._mouseUpHandlerHook(e,l),i.moving=!1,i.isDown=!1,i.x=0,i.y=0,i.isLocked=!0,s.prePlayTime=0,s.time=0;var c=e.type;"touchend"===c||"touchcancel"===c?(n.root.removeEventListener("touchmove",n.onMouseMove),n.root.removeEventListener("touchend",n.onMouseUp),n.root.removeEventListener("touchcancel",n.onMouseUp),n.blur()):(document.removeEventListener("mousemove",n.onMouseMove,!1),document.removeEventListener("mouseup",n.onMouseUp,!1),i.isEnter?"mobile"!==a.isMobileSimulateMode&&_bindInstanceProperty(n).call(n,"mousemove",n.onMoveOnly):n.onMouseLeave(e)),util$3.setTimeout(_assertThisInitialized(n),(function(){n.resetSeekState()}),1),r.focus()})),_defineProperty$1(_assertThisInitialized(n),"onMouseMove",(function(e){var t=_assertThisInitialized(n),r=t._state,o=t.pos,i=t.player,a=t.config;util$3.checkTouchSupport()&&e.preventDefault(),util$3.event(e);var s=util$3.getEventPos(e,i.zoom),l=90===i.rotateDeg?s.clientY:s.clientX,c=Math.abs(o.x-l);if(!(o.moving&&c<a.miniMoveStep||!o.moving&&c<a.miniStartStep)){o.x=l;var u=n.computeTime(e,l);u.prePlayTime=r.prePlayTime,n._mouseMoveHandlerHook(e,u)}})),_defineProperty$1(_assertThisInitialized(n),"onMouseOut",(function(e){n.triggerCallbacks("mouseout",null,e)})),_defineProperty$1(_assertThisInitialized(n),"onMouseOver",(function(e){n.triggerCallbacks("mouseover",null,e)})),_defineProperty$1(_assertThisInitialized(n),"onMouseEnter",(function(e){var t=_assertThisInitialized(n),r=t.player,o=t.pos;if(!(o.isDown||o.isEnter||r.isMini||!r.config.allowSeekAfterEnded&&r.ended)){o.isEnter=!0,_bindInstanceProperty(n).call(n,"mousemove",n.onMoveOnly),_bindInstanceProperty(n).call(n,"mouseleave",n.onMouseLeave),util$3.event(e);var i=util$3.getEventPos(e,r.zoom),a=90===r.rotateDeg?i.clientY:i.clientX,s=n.computeTime(e,a);n.triggerCallbacks("mouseenter",s,e),n.focus()}})),_defineProperty$1(_assertThisInitialized(n),"onMouseLeave",(function(e){n.triggerCallbacks("mouseleave",null,e),n.unlock(),n._updateInnerFocus(null)})),_defineProperty$1(_assertThisInitialized(n),"onVideoResize",(function(){var e=n.pos,t=e.x,r=e.isDown;if(e.isEnter&&!r){var o=n.computeTime(null,t);n.onMoveOnly(null,o)}})),n.useable=!1,n.isProgressMoving=!1,n.__dragCallBacks=[],n._state={now:-1,direc:0,time:0,prePlayTime:-1},n._disableBlur=!1,"boolean"==typeof n.config.isDragingSeek&&(console.warn("[XGPLAYER] 'isDragingSeek' is deprecated, please use 'isDraggingSeek' instead"),n.config.isDraggingSeek=n.config.isDragingSeek),n}return _createClass$1(r,[{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,r=e.currentTime;return t>=0?t:r+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]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t&&0!==t.length||(t=[{percent:1}]);var n,o=_objectSpread2$1(_objectSpread2$1({fragments:t},r),{},{actionCallback:function(t){e.emitUserAction("fragment_focus","fragment_focus",t)}});this.innerList?this.innerList.reset(o):(this.innerList=new InnerList(o),this.outer.insertBefore(this.innerList.render(),this.outer.children[0]),_mapInstanceProperty(n=["findHightLight","unHightLight","setHightLight","findFragment"]).call(n,(function(t){var r;e[t]=_bindInstanceProperty(r=e.innerList[t]).call(r,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=_findInstanceProperty(this).call(this,"xg-outer");var e=this.config,t=e.fragFocusClass,r=e.fragAutoFocus,n=e.fragClass;this._initInner(this.config.fragments,{fragFocusClass:t,fragAutoFocus:r,fragClass:n,style:this.playerConfig.commonStyle||{}}),"mobile"===sniffer.device&&(this.config.isDraggingSeek=!1,this.isMobile=!0),this.progressBtn=_findInstanceProperty(this).call(this,".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,r=this,n=null;_forEachInstanceProperty(t=_Object$keys(e)).call(t,(function(t){r.config[t]=e[t],"fragments"===t&&(n=e[t])})),n&&this._initInner(n,e)}},{key:"initCustomStyle",value:function(){var e=(this.playerConfig||{}).commonStyle.sliderBtnStyle,t=this.progressBtn;if(e)if("string"==typeof e)t.style.boxShadow=e;else if("object"===_typeof$1(e)){var r;_mapInstanceProperty(r=_Object$keys(e)).call(r,(function(r){t.style[r]=e[r]}))}}},{key:"triggerCallbacks",value:function(e,t,r){var n;this.__dragCallBacks.length>0&&_mapInstanceProperty(n=this.__dragCallBacks).call(n,(function(n){if(n&&n.handler&&n.type===e)try{n.handler(t,r)}catch(e){console.error("[XGPLAYER][triggerCallbacks] ".concat(n," 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 r=this.__dragCallBacks,n=-1;_mapInstanceProperty(r).call(r,(function(r,o){r&&r.type===e&&r.handler===t&&(n=o)})),n>-1&&_spliceInstanceProperty(r).call(r,n,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)&&(_bindInstanceProperty(this).call(this,"mousedown",this.onMouseDown),"mobile"!==e.isMobileSimulateMode&&_bindInstanceProperty(this).call(this,"mouseenter",this.onMouseEnter),_bindInstanceProperty(this).call(this,"mouseover",this.onMouseOver),_bindInstanceProperty(this).call(this,"mouseout",this.onMouseOut),this.player.root.addEventListener("click",this.onBodyClick,!0))}},{key:"focus",value:function(){this.player.controls.pauseAutoHide(),util$3.addClass(this.root,"active")}},{key:"blur",value:function(){this._disableBlur||(this.player.controls.recoverAutoHide(),util$3.removeClass(this.root,"active"))}},{key:"disableBlur",value:function(){this._disableBlur=!0}},{key:"enableBlur",value:function(){this._disableBlur=!1}},{key:"updateWidth",value:function(e,t,r,n){var o=this.config,i=this.player;if(!o.isCloseClickSeek||0!==n){var a=t=t>=i.duration?i.duration-o.endedDiff:Number(t).toFixed(1);this.updatePercent(r),this.updateTime(e),(1!==n||o.isDraggingSeek&&"audio"!==i.config.mediaType)&&(this._state.now=a,this._state.direc=a>i.currentTime?0:1,i.seek(a))}}},{key:"computeTime",value:function(e,t){var r,n,o=this.player,i=this.root.getBoundingClientRect(),a=i.width,s=i.height,l=i.top,c=i.left,u=t;90===o.rotateDeg?(r=s,n=l):(r=a,n=c);var p=u-n,f=(p=p>r?r:p<0?0:p)/r,d=_parseInt$1((f=f<0?0:f>1?1:f)*this.offsetDuration*1e3,10)/1e3;return{percent:f,currentTime:d,seekTime:util$3.getCurrentTimeByOffset(d,o.timeSegments),offset:p,width:r,left:n,e:e}}},{key:"updateTime",value:function(e){var t=this.player,r=this.duration;e>r?e=r:e<0&&(e=0);var n=t.plugins.time;n&&n.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 r=this.player.plugins.miniprogress;r&&r.update({played:e*this.offsetDuration},this.offsetDuration)}}},{key:"onTimeupdate",value:function(e){var t=this.player,r=this._state,n=this.offsetDuration;if(!(t.isSeeking&&t.media.seeking||this.isProgressMoving)&&t.hasStart){if(r.now>-1){var o=_parseInt$1(1e3*r.now,10)-_parseInt$1(1e3*t.currentTime,10);if(0===r.direc&&o>300||1===r.direc&&o>-300)return void(r.now=-1);r.now=-1}var i=this.currentTime;i=util$3.adjustTimeByDuration(i,n,e),this.innerList.update({played:i},n),this.progressBtn.style.left="".concat(i/n*100,"%")}}},{key:"onCacheUpdate",value:function(e){var t=this.player,r=this.duration;if(t){var n=t.bufferedPoint.end;n=util$3.adjustTimeByDuration(n,r,e),this.innerList.update({cached:n},r)}}},{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.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}}]),r}(),Icon=function(e){_inherits(r,Plugin);var t=_createSuper(r);function r(){var e,n;_classCallCheck$1(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return _defineProperty$1(_assertThisInitialized(n=t.call.apply(t,_concatInstanceProperty(e=[this]).call(e,i))),"_onMouseenter",(function(e){n.emit("icon_mouseenter",{pluginName:n.pluginName})})),_defineProperty$1(_assertThisInitialized(n),"_onMouseLeave",(function(e){n.emit("icon_mouseleave",{pluginName:n.pluginName})})),n}return _createClass$1(r,[{key:"afterCreate",value:function(){_bindInstanceProperty(this).call(this,"mouseenter",this._onMouseenter),_bindInstanceProperty(this).call(this,"mouseleave",this._onMouseLeave),this.config.disable&&this.disable()}},{key:"destroy",value:function(){this.unbind("mouseenter",this._onMouseenter),this.unbind("mouseleave",this._onMouseLeave)}}]),r}(),Play=function(e){_inherits(r,Icon);var t=_createSuper(r);function r(){var e,n;_classCallCheck$1(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return _defineProperty$1(_assertThisInitialized(n=t.call.apply(t,_concatInstanceProperty(e=[this]).call(e,i))),"btnClick",(function(e){e.preventDefault(),e.stopPropagation();var t=_assertThisInitialized(n).player;return n.emitUserAction(e,"switch_play_pause",{prop:"paused",from:t.paused,to:!t.paused}),t.ended?t.replay():t.paused?(t.play(),n.animate(!1)):(t.pause(),n.animate(!0)),!1})),n}return _createClass$1(r,[{key:"afterCreate",value:function(){_get(_getPrototypeOf(r.prototype),"afterCreate",this).call(this),this.config.disable||(this.initIcons(),_bindInstanceProperty(this).call(this,["touchend","click"],this.btnClick),this.listenEvents(),this.animate(!0))}},{key:"listenEvents",value:function(){var e=this,t=this.player;this.on([PLAY,PAUSE,ERROR,EMPTIED],(function(){e.animate(t.paused)}))}},{key:"registerIcons",value:function(){return{play:{icon:PlaySvg,class:"xg-icon-play"},pause:{icon:PauseSvg,class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.play),this.appendChild(".xgplayer-icon",e.pause)}},{key:"animate",value:function(e){if(this.player){var t=this.i18nKeys,r=_findInstanceProperty(this).call(this,".xg-tips");e?(this.setAttr("data-state","pause"),r&&this.changeLangTextKey(r,t.PLAY_TIPS)):(this.setAttr("data-state","play"),r&&this.changeLangTextKey(r,t.PAUSE_TIPS))}}},{key:"destroy",value:function(){_get(_getPrototypeOf(r.prototype),"destroy",this).call(this),this.unbind(["touchend","click"],this.btnClick)}},{key:"render",value:function(){if(!this.config.disable)return'<xg-icon class="xgplayer-play">\n <div class="xgplayer-icon">\n </div>\n '.concat(xgIconTips(this,"PLAY_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"play"}},{key:"defaultConfig",get:function(){return{position:POSITIONS.CONTROLS_LEFT,index:0,disable:!1}}}]),r}();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(r,Plugin);var t=_createSuper(r);function r(){return _classCallCheck$1(this,r),t.apply(this,arguments)}return _createClass$1(r,[{key:"afterCreate",value:function(){var e=this;this.initIcons(),this.onClick=function(t){t.preventDefault(),t.stopPropagation(),e.config.onClick(t)},_bindInstanceProperty(this).call(this,["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$3.addClass(this.root,"show")}},{key:"hide",value:function(){util$3.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.ROOT_TOP,index:0}}}]),r}();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(r,Icon);var t=_createSuper(r);function r(){var e,n;_classCallCheck$1(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return _defineProperty$1(_assertThisInitialized(n=t.call.apply(t,_concatInstanceProperty(e=[this]).call(e,i))),"_onOrientationChange",(function(e){n.player.fullscreen&&n.config.rotateFullscreen&&(90===window.orientation||-90===window.orientation?n.player.setRotateDeg(0):n.player.setRotateDeg(90))})),n}return _createClass$1(r,[{key:"afterCreate",value:function(){var e=this;_get(_getPrototypeOf(r.prototype),"afterCreate",this).call(this);var t=this.config,n=this.playerConfig;if(!t.disable){t.target&&(this.playerConfig.fullscreenTarget=this.config.target);var o=util$3.getFullScreenEl();n.fullscreenTarget===o&&this.player.getFullscreen().catch((function(e){})),this.initIcons(),this.handleFullscreen=this.hook("fullscreenChange",this.toggleFullScreen,{pre:function(t){var r=e.player.fullscreen;e.emitUserAction(t,"switch_fullscreen",{prop:"fullscreen",from:r,to:!r})}}),_bindInstanceProperty(this).call(this,".xgplayer-fullscreen",["touchend","click"],this.handleFullscreen),this.on(FULLSCREEN_CHANGE,(function(t){var r=_findInstanceProperty(e).call(e,".xg-tips");r&&e.changeLangTextKey(r,t?e.i18nKeys.EXITFULLSCREEN_TIPS:e.i18nKeys.FULLSCREEN_TIPS),e.animate(t)})),this.config.needBackIcon&&(this.topBackIcon=this.player.registerPlugin({plugin:TopBackIcon,options:{config:{onClick:function(t){e.handleFullscreen(t)}}}})),"mobile"===sniffer.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(_getPrototypeOf(r.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,r=this.config;!0===r.useCssFullscreen||"function"==typeof r.useCssFullscreen&&r.useCssFullscreen()?(t.fullscreen?t.exitCssFullscreen():t.getCssFullscreen(),this.animate(t.fullscreen)):r.rotateFullscreen?(t.fullscreen?t.exitRotateFullscreen():t.getRotateFullscreen(),this.animate(t.fullscreen)):r.switchCallback&&"function"==typeof r.switchCallback?r.switchCallback(t.fullscreen):t.fullscreen?(t.exitFullscreen(),r.useScreenOrientation&&this.unlockScreen()):(t.getFullscreen().catch((function(e){})),r.useScreenOrientation&&t.aspectRatio>1&&this.lockScreen(r.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.CONTROLS_RIGHT,index:0,useCssFullscreen:!1,rotateFullscreen:!1,useScreenOrientation:!1,lockOrientationType:"landscape",switchCallback:null,target:null,disable:!1,needBackIcon:!1}}}]),r}(),Time=function(e){_inherits(r,Plugin);var t=_createSuper(r);function r(e){var n;return _classCallCheck$1(this,r),(n=t.call(this,e)).isActiving=!1,n}return _createClass$1(r,[{key:"duration",get:function(){var e=this.player,t=e.offsetDuration,r=e.duration;return this.playerConfig.customDuration||t||r}},{key:"currentTime",get:function(){var e=this.player,t=e.offsetCurrentTime,r=e.currentTime;return t>=0?t:r}},{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=_findInstanceProperty(this).call(this,".time-duration"),this.timeDom=_findInstanceProperty(this).call(this,".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,r=this.config,n=this.duration;if(!r.disable&&!this.isActiving&&t.hasStart){var o=this.currentTime+this.timeOffset;o=util$3.adjustTimeByDuration(o,n,e),"flex"===this.mode?(this.centerCurDom.innerHTML=this.minWidthTime(util$3.format(o)),n!==1/0&&n>0&&(this.centerDurDom.innerHTML=util$3.format(n))):(this.timeDom.innerHTML=this.minWidthTime(util$3.format(o)),n!==1/0&&n>0&&(this.durationDom.innerHTML=util$3.format(n)))}}},{key:"onReset",value:function(){"flex"===this.mode?(this.centerCurDom.innerHTML=this.minWidthTime(util$3.format(0)),this.centerDurDom.innerHTML=util$3.format(0)):(this.timeDom.innerHTML=this.minWidthTime(util$3.format(0)),this.durationDom.innerHTML=util$3.format(0))}},{key:"createCenterTime",value:function(){var e=this.player;if(e.controls&&e.controls.center){var t=e.controls.center;this.centerCurDom=util$3.createDom("xg-icon","00:00",{},"xgplayer-time xg-time-left"),this.centerDurDom=util$3.createDom("xg-icon","00:00",{},"xgplayer-time xg-time-right"),t.children.length>0?t.insertBefore(this.centerCurDom,t.children[0]):t.appendChild(this.centerCurDom),t.appendChild(this.centerDurDom)}}},{key:"afterPlayerInit",value:function(){var e=this.config;this.duration===1/0||this.playerConfig.isLive?(util$3.hide(this.durationDom),util$3.hide(this.timeDom),util$3.hide(_findInstanceProperty(this).call(this,".time-separator")),util$3.show(_findInstanceProperty(this).call(this,".time-live-tag"))):util$3.hide(_findInstanceProperty(this).call(this,".time-live-tag"));e.hide?this.hide():this.show()}},{key:"changeLiveState",value:function(e){e?(util$3.hide(this.durationDom),util$3.hide(this.timeDom),util$3.hide(_findInstanceProperty(this).call(this,".time-separator")),util$3.show(_findInstanceProperty(this).call(this,".time-live-tag"))):(util$3.hide(_findInstanceProperty(this).call(this,".time-live-tag")),util$3.show(_findInstanceProperty(this).call(this,".time-separator")),util$3.show(this.durationDom),util$3.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$3.format(e)):this.centerCurDom.innerHTML=this.minWidthTime(util$3.format(e)))}},{key:"minWidthTime",value:function(e){var t;return _mapInstanceProperty(t=e.split(":")).call(t,(function(e){return'<span class="time-min-width">'.concat(e,"</span>")})).join(":")}},{key:"resetActive",value:function(){var e=this,t=this.player,r=function(){e.isActiving=!1};this.off(SEEKED,r),t.isSeeking&&t.media.seeking?this.once(SEEKED,r):this.isActiving=!1}},{key:"destroy",value:function(){var e=this.player.controls.center;this.centerCurDom&&e.removeChild(this.centerCurDom),this.centerCurDom=null,this.centerDurDom&&e.removeChild(this.centerDurDom),this.centerDurDom=null}},{key:"render",value:function(){if(!this.config.disable)return'<xg-icon class="xgplayer-time">\n <span class="time-current">00:00</span>\n <span class="time-separator">/</span>\n <span class="time-duration">00:00</span>\n <span class="time-live-tag">'.concat(this.i18n.LIVE_TIP,"</span>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"time"}},{key:"defaultConfig",get:function(){return{position:POSITIONS.CONTROLS_LEFT,index:2,disable:!1}}}]),r}();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(r,Plugin);var t=_createSuper(r);function r(){var e,n;_classCallCheck$1(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return _defineProperty$1(_assertThisInitialized(n=t.call.apply(t,_concatInstanceProperty(e=[this]).call(e,i))),"onBarMousedown",(function(e){var t=_assertThisInitialized(n).player,r=_findInstanceProperty(n).call(n,".xgplayer-bar");util$3.event(e);var o=r.getBoundingClientRect(),i=util$3.getEventPos(e,t.zoom),a=o.height-(i.clientY-o.top);if(i.h=a,i.barH=o.height,n.pos=i,!(a<-2))return n.updateVolumePos(a,e),document.addEventListener("mouseup",n.onBarMouseUp),n._d.isStart=!0,!1})),_defineProperty$1(_assertThisInitialized(n),"onBarMouseMove",(function(e){var t=_assertThisInitialized(n)._d;if(t.isStart){var r=_assertThisInitialized(n),o=r.pos,i=r.player;e.preventDefault(),e.stopPropagation(),util$3.event(e);var a=util$3.getEventPos(e,i.zoom);t.isMoving=!0;var s=o.h-a.clientY+o.clientY;s>o.barH||n.updateVolumePos(s,e)}})),_defineProperty$1(_assertThisInitialized(n),"onBarMouseUp",(function(e){util$3.event(e),document.removeEventListener("mouseup",n.onBarMouseUp);var t=_assertThisInitialized(n)._d;t.isStart=!1,t.isMoving=!1})),_defineProperty$1(_assertThisInitialized(n),"onMouseenter",(function(e){n._d.isActive=!0,n.focus(),n.emit("icon_mouseenter",{pluginName:n.pluginName})})),_defineProperty$1(_assertThisInitialized(n),"onMouseleave",(function(e){n._d.isActive=!1,n.unFocus(100,!1,e),n.emit("icon_mouseleave",{pluginName:n.pluginName})})),_defineProperty$1(_assertThisInitialized(n),"onVolumeChange",(function(e){if(n.player){var t=n.player,r=t.muted,o=t.volume;n._d.isMoving||(_findInstanceProperty(n).call(n,".xgplayer-drag").style.height=r||0===o?"4px":"".concat(100*o,"%"),n.config.showValueLabel&&n.updateVolumeValue()),n.animate(r,o)}})),n}return _createClass$1(r,[{key:"registerIcons",value:function(){return{volumeSmall:{icon:volumeSmallSvg,class:"xg-volume-small"},volumeLarge:{icon:volumeLargeSvg,class:"xg-volume"},volumeMuted:{icon:volumeMutedSvg,class:"xg-volume-mute"}}}},{key:"afterCreate",value:function(){var e=this;if(this._timerId=null,this._d={isStart:!1,isMoving:!1,isActive:!1},!this.config.disable){this.initIcons();var t=this.playerConfig,r=t.commonStyle,n=t.volume;if(r.volumeColor)_findInstanceProperty(this).call(this,".xgplayer-drag").style.backgroundColor=r.volumeColor;if(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)_bindInstanceProperty(this).call(this,"mouseenter",this._onMouseenterHandler),_bindInstanceProperty(this).call(this,["blur","mouseleave"],this._onMouseleaveHandler),_bindInstanceProperty(this).call(this,".xgplayer-slider","mousedown",this.onBarMousedown),_bindInstanceProperty(this).call(this,".xgplayer-slider","mousemove",this.onBarMouseMove),_bindInstanceProperty(this).call(this,".xgplayer-slider","mouseup",this.onBarMouseUp);_bindInstanceProperty(this).call(this,".xgplayer-icon",["touchend","click"],this.changeMutedHandler),this.on(VOLUME_CHANGE,this.onVolumeChange),this.once(LOADED_DATA,this.onVolumeChange),"Number"!==util$3.typeOf(n)&&(this.player.volume=this.config.default),this.onVolumeChange()}}},{key:"updateVolumePos",value:function(e,t){var r=this.player,n=_findInstanceProperty(this).call(this,".xgplayer-drag"),o=_findInstanceProperty(this).call(this,".xgplayer-bar");if(o&&n){var i=_parseInt$1(e/o.getBoundingClientRect().height*1e3,10);n.style.height="".concat(e,"px");var a=Math.max(Math.min(i/1e3,1),0),s={volume:{from:r.volume,to:a}};r.muted&&(s.muted={from:!0,to:!1}),this.emitUserAction(t,"change_volume",{muted:r.muted,volume:r.volume,props:s}),r.volume=Math.max(Math.min(i/1e3,1),0),r.muted&&(r.muted=!1),this.config.showValueLabel&&this.updateVolumeValue()}}},{key:"updateVolumeValue",value:function(){var e=this.player,t=e.volume,r=e.muted,n=_findInstanceProperty(this).call(this,".xgplayer-value-label"),o=Math.max(Math.min(t,1),0);n.innerText=r?0:Math.round(100*o)}},{key:"focus",value:function(){this.player.focus({autoHide:!1}),this._timerId&&(util$3.clearTimeout(this,this._timerId),this._timerId=null),util$3.addClass(this.root,"slide-show")}},{key:"unFocus",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,o=this._d,i=this.player;o.isActive||(this._timerId&&(util$3.clearTimeout(this,this._timerId),this._timerId=null),this._timerId=util$3.setTimeout(this,(function(){o.isActive||(r?i.blur():i.focus(),util$3.removeClass(e.root,"slide-show"),o.isStart&&e.onBarMouseUp(n)),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$3.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(){var e;if(!this.config.disable){var t=this.config.default||this.player.volume,r=this.config.showValueLabel;return _concatInstanceProperty(e='\n <xg-icon class="xgplayer-volume" data-state="normal">\n <div class="xgplayer-icon">\n </div>\n <xg-slider class="xgplayer-slider">\n '.concat(r?'<div class="xgplayer-value-label">'.concat(100*t,"</div>"):"",'\n <div class="xgplayer-bar">\n <xg-drag class="xgplayer-drag" style="height: ')).call(e,100*t,'%"></xg-drag>\n </div>\n </xg-slider>\n </xg-icon>')}}}],[{key:"pluginName",get:function(){return"volume"}},{key:"defaultConfig",get:function(){return{position:POSITIONS.CONTROLS_RIGHT,index:1,disable:!1,showValueLabel:!1,default:.6,miniVolume:.2}}}]),r}(),fails$7=fails$B,wellKnownSymbol$3=wellKnownSymbol$q,DESCRIPTORS$5=descriptors$2,IS_PURE=isPure,ITERATOR$1=wellKnownSymbol$3("iterator"),urlConstructorDetection=!fails$7((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,r="";return e.pathname="c%20d",t.forEach((function(e,n){t.delete("b"),r+=n+e})),IS_PURE&&!e.toJSON||!t.size&&(IS_PURE||!DESCRIPTORS$5)||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[ITERATOR$1]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==r||"x"!==new URL("http://x",void 0).host})),uncurryThis$7=functionUncurryThis,maxInt=2147483647,base=36,tMin=1,tMax=26,skew=38,damp=700,initialBias=72,initialN=128,delimiter="-",regexNonASCII=/[^\0-\u007E]/,regexSeparators=/[.\u3002\uFF0E\uFF61]/g,OVERFLOW_ERROR="Overflow: input needs wider integers to process",baseMinusTMin=base-tMin,$RangeError=RangeError,exec$1=uncurryThis$7(regexSeparators.exec),floor$2=Math.floor,fromCharCode=String.fromCharCode,charCodeAt=uncurryThis$7("".charCodeAt),join$2=uncurryThis$7([].join),push$5=uncurryThis$7([].push),replace$2=uncurryThis$7("".replace),split$2=uncurryThis$7("".split),toLowerCase$1=uncurryThis$7("".toLowerCase),ucs2decode=function(e){for(var t=[],r=0,n=e.length;r<n;){var o=charCodeAt(e,r++);if(o>=55296&&o<=56319&&r<n){var i=charCodeAt(e,r++);56320==(64512&i)?push$5(t,((1023&o)<<10)+(1023&i)+65536):(push$5(t,o),r--)}else push$5(t,o)}return t},digitToBasic=function(e){return e+22+75*(e<26)},adapt=function(e,t,r){var n=0;for(e=r?floor$2(e/damp):e>>1,e+=floor$2(e/t);e>baseMinusTMin*tMax>>1;)e=floor$2(e/baseMinusTMin),n+=base;return floor$2(n+(baseMinusTMin+1)*e/(e+skew))},encode=function(e){var t,r,n=[],o=(e=ucs2decode(e)).length,i=initialN,a=0,s=initialBias;for(t=0;t<e.length;t++)(r=e[t])<128&&push$5(n,fromCharCode(r));var l=n.length,c=l;for(l&&push$5(n,delimiter);c<o;){var u=maxInt;for(t=0;t<e.length;t++)(r=e[t])>=i&&r<u&&(u=r);var p=c+1;if(u-i>floor$2((maxInt-a)/p))throw $RangeError(OVERFLOW_ERROR);for(a+=(u-i)*p,i=u,t=0;t<e.length;t++){if((r=e[t])<i&&++a>maxInt)throw $RangeError(OVERFLOW_ERROR);if(r==i){for(var f=a,d=base;;){var h=d<=s?tMin:d>=s+tMax?tMax:d-s;if(f<h)break;var $=f-h,y=base-h;push$5(n,fromCharCode(digitToBasic(h+$%y))),f=floor$2($/y),d+=base}push$5(n,fromCharCode(digitToBasic(f))),s=adapt(a,p,c==l),a=0,c++}}a++,i++}return join$2(n,"")},stringPunycodeToAscii=function(e){var t,r,n=[],o=split$2(replace$2(toLowerCase$1(e),regexSeparators,"."),".");for(t=0;t<o.length;t++)r=o[t],push$5(n,exec$1(regexNonASCII,r)?"xn--"+encode(r):r);return join$2(n,".")},defineBuiltIn$2=defineBuiltIn$8,defineBuiltIns$2=function(e,t,r){for(var n in t)r&&r.unsafe&&e[n]?e[n]=t[n]:defineBuiltIn$2(e,n,t[n],r);return e},$$A=_export,global$4=global$s,call$5=functionCall,uncurryThis$6=functionUncurryThis,DESCRIPTORS$4=descriptors$2,USE_NATIVE_URL$2=urlConstructorDetection,defineBuiltIn$1=defineBuiltIn$8,defineBuiltInAccessor$2=defineBuiltInAccessor$5,defineBuiltIns$1=defineBuiltIns$2,setToStringTag$2=setToStringTag$9,createIteratorConstructor=iteratorCreateConstructor,InternalStateModule$3=internalState,anInstance$3=anInstance$5,isCallable$4=isCallable$q,hasOwn$2=hasOwnProperty_1,bind$a=functionBindContext,classof$2=classof$c,anObject$1=anObject$g,isObject$5=isObject$l,$toString$1=toString$f,create$1=objectCreate,createPropertyDescriptor=createPropertyDescriptor$8,getIterator=getIterator$3,getIteratorMethod=getIteratorMethod$a,validateArgumentsLength$2=validateArgumentsLength$5,wellKnownSymbol$2=wellKnownSymbol$q,arraySort=arraySort$1,ITERATOR=wellKnownSymbol$2("iterator"),URL_SEARCH_PARAMS="URLSearchParams",URL_SEARCH_PARAMS_ITERATOR=URL_SEARCH_PARAMS+"Iterator",setInternalState$3=InternalStateModule$3.set,getInternalParamsState=InternalStateModule$3.getterFor(URL_SEARCH_PARAMS),getInternalIteratorState=InternalStateModule$3.getterFor(URL_SEARCH_PARAMS_ITERATOR),getOwnPropertyDescriptor5=Object.getOwnPropertyDescriptor,safeGetBuiltIn=function(e){if(!DESCRIPTORS$4)return global$4[e];var t=getOwnPropertyDescriptor5(global$4,e);return t&&t.value},nativeFetch=safeGetBuiltIn("fetch"),NativeRequest=safeGetBuiltIn("Request"),Headers=safeGetBuiltIn("Headers"),RequestPrototype=NativeRequest&&NativeRequest.prototype,HeadersPrototype=Headers&&Headers.prototype,RegExp$1=global$4.RegExp,TypeError$2=global$4.TypeError,decodeURIComponent=global$4.decodeURIComponent,encodeURIComponent$1=global$4.encodeURIComponent,charAt$1=uncurryThis$6("".charAt),join$1=uncurryThis$6([].join),push$4=uncurryThis$6([].push),replace$1=uncurryThis$6("".replace),shift$1=uncurryThis$6([].shift),splice2=uncurryThis$6([].splice),split$1=uncurryThis$6("".split),stringSlice$2=uncurryThis$6("".slice),plus=/\+/g,sequences=Array(4),percentSequence=function(e){return sequences[e-1]||(sequences[e-1]=RegExp$1("((?:%[\\da-f]{2}){"+e+"})","gi"))},percentDecode=function(e){try{return decodeURIComponent(e)}catch(t){return e}},deserialize=function(e){var t=replace$1(e,plus," "),r=4;try{return decodeURIComponent(t)}catch(e){for(;r;)t=replace$1(t,percentSequence(r--),percentDecode);return t}},find2=/[!'()~]|%20/g,replacements={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},replacer=function(e){return replacements[e]},serialize=function(e){return replace$1(encodeURIComponent$1(e),find2,replacer)},URLSearchParamsIterator=createIteratorConstructor((function(e,t){setInternalState$3(this,{type:URL_SEARCH_PARAMS_ITERATOR,iterator:getIterator(getInternalParamsState(e).entries),kind:t})}),"Iterator",(function(){var e=getInternalIteratorState(this),t=e.kind,r=e.iterator.next(),n=r.value;return r.done||(r.value="keys"===t?n.key:"values"===t?n.value:[n.key,n.value]),r}),!0),URLSearchParamsState=function(e){this.entries=[],this.url=null,void 0!==e&&(isObject$5(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===charAt$1(e,0)?stringSlice$2(e,1):e:$toString$1(e)))};URLSearchParamsState.prototype={type:URL_SEARCH_PARAMS,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,r,n,o,i,a,s,l=getIteratorMethod(e);if(l)for(r=(t=getIterator(e,l)).next;!(n=call$5(r,t)).done;){if(i=(o=getIterator(anObject$1(n.value))).next,(a=call$5(i,o)).done||(s=call$5(i,o)).done||!call$5(i,o).done)throw TypeError$2("Expected sequence with length 2");push$4(this.entries,{key:$toString$1(a.value),value:$toString$1(s.value)})}else for(var c in e)hasOwn$2(e,c)&&push$4(this.entries,{key:c,value:$toString$1(e[c])})},parseQuery:function(e){if(e)for(var t,r,n=split$1(e,"&"),o=0;o<n.length;)(t=n[o++]).length&&(r=split$1(t,"="),push$4(this.entries,{key:deserialize(shift$1(r)),value:deserialize(join$1(r,"="))}))},serialize:function(){for(var e,t=this.entries,r=[],n=0;n<t.length;)e=t[n++],push$4(r,serialize(e.key)+"="+serialize(e.value));return join$1(r,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var URLSearchParamsConstructor=function(){anInstance$3(this,URLSearchParamsPrototype);var e=setInternalState$3(this,new URLSearchParamsState(arguments.length>0?arguments[0]:void 0));DESCRIPTORS$4||(this.length=e.entries.length)},URLSearchParamsPrototype=URLSearchParamsConstructor.prototype;if(defineBuiltIns$1(URLSearchParamsPrototype,{append:function(e,t){validateArgumentsLength$2(arguments.length,2);var r=getInternalParamsState(this);push$4(r.entries,{key:$toString$1(e),value:$toString$1(t)}),DESCRIPTORS$4||this.length++,r.updateURL()},delete:function(e){validateArgumentsLength$2(arguments.length,1);for(var t=getInternalParamsState(this),r=t.entries,n=$toString$1(e),o=0;o<r.length;)r[o].key===n?splice2(r,o,1):o++;DESCRIPTORS$4||(this.length=r.length),t.updateURL()},get:function(e){validateArgumentsLength$2(arguments.length,1);for(var t=getInternalParamsState(this).entries,r=$toString$1(e),n=0;n<t.length;n++)if(t[n].key===r)return t[n].value;return null},getAll:function(e){validateArgumentsLength$2(arguments.length,1);for(var t=getInternalParamsState(this).entries,r=$toString$1(e),n=[],o=0;o<t.length;o++)t[o].key===r&&push$4(n,t[o].value);return n},has:function(e){validateArgumentsLength$2(arguments.length,1);for(var t=getInternalParamsState(this).entries,r=$toString$1(e),n=0;n<t.length;)if(t[n++].key===r)return!0;return!1},set:function(e,t){validateArgumentsLength$2(arguments.length,1);for(var r,n=getInternalParamsState(this),o=n.entries,i=!1,a=$toString$1(e),s=$toString$1(t),l=0;l<o.length;l++)(r=o[l]).key===a&&(i?splice2(o,l--,1):(i=!0,r.value=s));i||push$4(o,{key:a,value:s}),DESCRIPTORS$4||(this.length=o.length),n.updateURL()},sort:function(){var e=getInternalParamsState(this);arraySort(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,r=getInternalParamsState(this).entries,n=bind$a(e,arguments.length>1?arguments[1]:void 0),o=0;o<r.length;)n((t=r[o++]).value,t.key,this)},keys:function(){return new URLSearchParamsIterator(this,"keys")},values:function(){return new URLSearchParamsIterator(this,"values")},entries:function(){return new URLSearchParamsIterator(this,"entries")}},{enumerable:!0}),defineBuiltIn$1(URLSearchParamsPrototype,ITERATOR,URLSearchParamsPrototype.entries,{name:"entries"}),defineBuiltIn$1(URLSearchParamsPrototype,"toString",(function(){return getInternalParamsState(this).serialize()}),{enumerable:!0}),DESCRIPTORS$4&&defineBuiltInAccessor$2(URLSearchParamsPrototype,"size",{get:function(){return getInternalParamsState(this).entries.length},configurable:!0,enumerable:!0}),setToStringTag$2(URLSearchParamsConstructor,URL_SEARCH_PARAMS),$$A({global:!0,constructor:!0,forced:!USE_NATIVE_URL$2},{URLSearchParams:URLSearchParamsConstructor}),!USE_NATIVE_URL$2&&isCallable$4(Headers)){var headersHas=uncurryThis$6(HeadersPrototype.has),headersSet=uncurryThis$6(HeadersPrototype.set),wrapRequestOptions=function(e){if(isObject$5(e)){var t,r=e.body;if(classof$2(r)===URL_SEARCH_PARAMS)return t=e.headers?new Headers(e.headers):new Headers,headersHas(t,"content-type")||headersSet(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),create$1(e,{body:createPropertyDescriptor(0,$toString$1(r)),headers:createPropertyDescriptor(0,t)})}return e};if(isCallable$4(nativeFetch)&&$$A({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return nativeFetch(e,arguments.length>1?wrapRequestOptions(arguments[1]):{})}}),isCallable$4(NativeRequest)){var RequestConstructor=function(e){return anInstance$3(this,RequestPrototype),new NativeRequest(e,arguments.length>1?wrapRequestOptions(arguments[1]):{})};RequestPrototype.constructor=RequestConstructor,RequestConstructor.prototype=RequestPrototype,$$A({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:RequestConstructor})}}var EOF,web_urlSearchParams_constructor={URLSearchParams:URLSearchParamsConstructor,getState:getInternalParamsState},$$z=_export,DESCRIPTORS$3=descriptors$2,USE_NATIVE_URL$1=urlConstructorDetection,global$3=global$s,bind$9=functionBindContext,uncurryThis$5=functionUncurryThis,defineBuiltIn=defineBuiltIn$8,defineBuiltInAccessor$1=defineBuiltInAccessor$5,anInstance$2=anInstance$5,hasOwn$1=hasOwnProperty_1,assign2=objectAssign,arrayFrom=arrayFrom$1,arraySlice$1=arraySliceSimple,codeAt=stringMultibyte.codeAt,toASCII=stringPunycodeToAscii,$toString=toString$f,setToStringTag$1=setToStringTag$9,validateArgumentsLength$1=validateArgumentsLength$5,URLSearchParamsModule=web_urlSearchParams_constructor,InternalStateModule$2=internalState,setInternalState$2=InternalStateModule$2.set,getInternalURLState=InternalStateModule$2.getterFor("URL"),URLSearchParams$1=URLSearchParamsModule.URLSearchParams,getInternalSearchParamsState=URLSearchParamsModule.getState,NativeURL=global$3.URL,TypeError$1=global$3.TypeError,parseInt$1=global$3.parseInt,floor$1=Math.floor,pow=Math.pow,charAt=uncurryThis$5("".charAt),exec=uncurryThis$5(/./.exec),join=uncurryThis$5([].join),numberToString=uncurryThis$5(1..toString),pop=uncurryThis$5([].pop),push$3=uncurryThis$5([].push),replace=uncurryThis$5("".replace),shift=uncurryThis$5([].shift),split=uncurryThis$5("".split),stringSlice$1=uncurryThis$5("".slice),toLowerCase=uncurryThis$5("".toLowerCase),unshift=uncurryThis$5([].unshift),INVALID_AUTHORITY="Invalid authority",INVALID_SCHEME="Invalid scheme",INVALID_HOST="Invalid host",INVALID_PORT="Invalid port",ALPHA=/[a-z]/i,ALPHANUMERIC=/[\d+-.a-z]/i,DIGIT=/\d/,HEX_START=/^0x/i,OCT=/^[0-7]+$/,DEC=/^\d+$/,HEX=/^[\da-f]+$/i,FORBIDDEN_HOST_CODE_POINT=/[\0\t\n\r #%/:<>?@[\\\]^|]/,FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT=/[\0\t\n\r #/:<>?@[\\\]^|]/,LEADING_C0_CONTROL_OR_SPACE=/^[\u0000-\u0020]+/,TRAILING_C0_CONTROL_OR_SPACE=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,TAB_AND_NEW_LINE=/[\t\n\r]/g,parseIPv4=function(e){var t,r,n,o,i,a,s,l=split(e,".");if(l.length&&""==l[l.length-1]&&l.length--,(t=l.length)>4)return e;for(r=[],n=0;n<t;n++){if(""==(o=l[n]))return e;if(i=10,o.length>1&&"0"==charAt(o,0)&&(i=exec(HEX_START,o)?16:8,o=stringSlice$1(o,8==i?1:2)),""===o)a=0;else{if(!exec(10==i?DEC:8==i?OCT:HEX,o))return e;a=parseInt$1(o,i)}push$3(r,a)}for(n=0;n<t;n++)if(a=r[n],n==t-1){if(a>=pow(256,5-t))return null}else if(a>255)return null;for(s=pop(r),n=0;n<r.length;n++)s+=r[n]*pow(256,3-n);return s},parseIPv6=function(e){var t,r,n,o,i,a,s,l=[0,0,0,0,0,0,0,0],c=0,u=null,p=0,f=function(){return charAt(e,p)};if(":"==f()){if(":"!=charAt(e,1))return;p+=2,u=++c}for(;f();){if(8==c)return;if(":"!=f()){for(t=r=0;r<4&&exec(HEX,f());)t=16*t+parseInt$1(f(),16),p++,r++;if("."==f()){if(0==r)return;if(p-=r,c>6)return;for(n=0;f();){if(o=null,n>0){if(!("."==f()&&n<4))return;p++}if(!exec(DIGIT,f()))return;for(;exec(DIGIT,f());){if(i=parseInt$1(f(),10),null===o)o=i;else{if(0==o)return;o=10*o+i}if(o>255)return;p++}l[c]=256*l[c]+o,2!=++n&&4!=n||c++}if(4!=n)return;break}if(":"==f()){if(p++,!f())return}else if(f())return;l[c++]=t}else{if(null!==u)return;p++,u=++c}}if(null!==u)for(a=c-u,c=7;0!=c&&a>0;)s=l[c],l[c--]=l[u+a-1],l[u+--a]=s;else if(8!=c)return;return l},findLongestZeroSequence=function(e){for(var t=null,r=1,n=null,o=0,i=0;i<8;i++)0!==e[i]?(o>r&&(t=n,r=o),n=null,o=0):(null===n&&(n=i),++o);return o>r&&(t=n,r=o),t},serializeHost=function(e){var t,r,n,o;if("number"==typeof e){for(t=[],r=0;r<4;r++)unshift(t,e%256),e=floor$1(e/256);return join(t,".")}if("object"==typeof e){for(t="",n=findLongestZeroSequence(e),r=0;r<8;r++)o&&0===e[r]||(o&&(o=!1),n===r?(t+=r?":":"::",o=!0):(t+=numberToString(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},C0ControlPercentEncodeSet={},fragmentPercentEncodeSet=assign2({},C0ControlPercentEncodeSet,{" ":1,'"':1,"<":1,">":1,"`":1}),pathPercentEncodeSet=assign2({},fragmentPercentEncodeSet,{"#":1,"?":1,"{":1,"}":1}),userinfoPercentEncodeSet=assign2({},pathPercentEncodeSet,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),percentEncode=function(e,t){var r=codeAt(e,0);return r>32&&r<127&&!hasOwn$1(t,e)?e:encodeURIComponent(e)},specialSchemes={ftp:21,file:null,http:80,https:443,ws:80,wss:443},isWindowsDriveLetter=function(e,t){var r;return 2==e.length&&exec(ALPHA,charAt(e,0))&&(":"==(r=charAt(e,1))||!t&&"|"==r)},startsWithWindowsDriveLetter=function(e){var t;return e.length>1&&isWindowsDriveLetter(stringSlice$1(e,0,2))&&(2==e.length||"/"===(t=charAt(e,2))||"\\"===t||"?"===t||"#"===t)},isSingleDot=function(e){return"."===e||"%2e"===toLowerCase(e)},isDoubleDot=function(e){return".."===(e=toLowerCase(e))||"%2e."===e||".%2e"===e||"%2e%2e"===e},SCHEME_START={},SCHEME={},NO_SCHEME={},SPECIAL_RELATIVE_OR_AUTHORITY={},PATH_OR_AUTHORITY={},RELATIVE={},RELATIVE_SLASH={},SPECIAL_AUTHORITY_SLASHES={},SPECIAL_AUTHORITY_IGNORE_SLASHES={},AUTHORITY={},HOST={},HOSTNAME={},PORT={},FILE={},FILE_SLASH={},FILE_HOST={},PATH_START={},PATH={},CANNOT_BE_A_BASE_URL_PATH={},QUERY={},FRAGMENT={},URLState=function(e,t,r){var n,o,i,a=$toString(e);if(t){if(o=this.parse(a))throw TypeError$1(o);this.searchParams=null}else{if(void 0!==r&&(n=new URLState(r,!0)),o=this.parse(a,null,n))throw TypeError$1(o);(i=getInternalSearchParamsState(new URLSearchParams$1)).bindURL(this),this.searchParams=i}};URLState.prototype={type:"URL",parse:function(e,t,r){var n,o,i,a,s=this,l=t||SCHEME_START,c=0,u="",p=!1,f=!1,d=!1;for(e=$toString(e),t||(s.scheme="",s.username="",s.password="",s.host=null,s.port=null,s.path=[],s.query=null,s.fragment=null,s.cannotBeABaseURL=!1,e=replace(e,LEADING_C0_CONTROL_OR_SPACE,""),e=replace(e,TRAILING_C0_CONTROL_OR_SPACE,"$1")),e=replace(e,TAB_AND_NEW_LINE,""),n=arrayFrom(e);c<=n.length;){switch(o=n[c],l){case SCHEME_START:if(!o||!exec(ALPHA,o)){if(t)return INVALID_SCHEME;l=NO_SCHEME;continue}u+=toLowerCase(o),l=SCHEME;break;case SCHEME:if(o&&(exec(ALPHANUMERIC,o)||"+"==o||"-"==o||"."==o))u+=toLowerCase(o);else{if(":"!=o){if(t)return INVALID_SCHEME;u="",l=NO_SCHEME,c=0;continue}if(t&&(s.isSpecial()!=hasOwn$1(specialSchemes,u)||"file"==u&&(s.includesCredentials()||null!==s.port)||"file"==s.scheme&&!s.host))return;if(s.scheme=u,t)return void(s.isSpecial()&&specialSchemes[s.scheme]==s.port&&(s.port=null));u="","file"==s.scheme?l=FILE:s.isSpecial()&&r&&r.scheme==s.scheme?l=SPECIAL_RELATIVE_OR_AUTHORITY:s.isSpecial()?l=SPECIAL_AUTHORITY_SLASHES:"/"==n[c+1]?(l=PATH_OR_AUTHORITY,c++):(s.cannotBeABaseURL=!0,push$3(s.path,""),l=CANNOT_BE_A_BASE_URL_PATH)}break;case NO_SCHEME:if(!r||r.cannotBeABaseURL&&"#"!=o)return INVALID_SCHEME;if(r.cannotBeABaseURL&&"#"==o){s.scheme=r.scheme,s.path=arraySlice$1(r.path),s.query=r.query,s.fragment="",s.cannotBeABaseURL=!0,l=FRAGMENT;break}l="file"==r.scheme?FILE:RELATIVE;continue;case SPECIAL_RELATIVE_OR_AUTHORITY:if("/"!=o||"/"!=n[c+1]){l=RELATIVE;continue}l=SPECIAL_AUTHORITY_IGNORE_SLASHES,c++;break;case PATH_OR_AUTHORITY:if("/"==o){l=AUTHORITY;break}l=PATH;continue;case RELATIVE:if(s.scheme=r.scheme,o==EOF)s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,s.path=arraySlice$1(r.path),s.query=r.query;else if("/"==o||"\\"==o&&s.isSpecial())l=RELATIVE_SLASH;else if("?"==o)s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,s.path=arraySlice$1(r.path),s.query="",l=QUERY;else{if("#"!=o){s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,s.path=arraySlice$1(r.path),s.path.length--,l=PATH;continue}s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,s.path=arraySlice$1(r.path),s.query=r.query,s.fragment="",l=FRAGMENT}break;case RELATIVE_SLASH:if(!s.isSpecial()||"/"!=o&&"\\"!=o){if("/"!=o){s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,l=PATH;continue}l=AUTHORITY}else l=SPECIAL_AUTHORITY_IGNORE_SLASHES;break;case SPECIAL_AUTHORITY_SLASHES:if(l=SPECIAL_AUTHORITY_IGNORE_SLASHES,"/"!=o||"/"!=charAt(u,c+1))continue;c++;break;case SPECIAL_AUTHORITY_IGNORE_SLASHES:if("/"!=o&&"\\"!=o){l=AUTHORITY;continue}break;case AUTHORITY:if("@"==o){p&&(u="%40"+u),p=!0,i=arrayFrom(u);for(var h=0;h<i.length;h++){var $=i[h];if(":"!=$||d){var y=percentEncode($,userinfoPercentEncodeSet);d?s.password+=y:s.username+=y}else d=!0}u=""}else if(o==EOF||"/"==o||"?"==o||"#"==o||"\\"==o&&s.isSpecial()){if(p&&""==u)return INVALID_AUTHORITY;c-=arrayFrom(u).length+1,u="",l=HOST}else u+=o;break;case HOST:case HOSTNAME:if(t&&"file"==s.scheme){l=FILE_HOST;continue}if(":"!=o||f){if(o==EOF||"/"==o||"?"==o||"#"==o||"\\"==o&&s.isSpecial()){if(s.isSpecial()&&""==u)return INVALID_HOST;if(t&&""==u&&(s.includesCredentials()||null!==s.port))return;if(a=s.parseHost(u))return a;if(u="",l=PATH_START,t)return;continue}"["==o?f=!0:"]"==o&&(f=!1),u+=o}else{if(""==u)return INVALID_HOST;if(a=s.parseHost(u))return a;if(u="",l=PORT,t==HOSTNAME)return}break;case PORT:if(!exec(DIGIT,o)){if(o==EOF||"/"==o||"?"==o||"#"==o||"\\"==o&&s.isSpecial()||t){if(""!=u){var g=parseInt$1(u,10);if(g>65535)return INVALID_PORT;s.port=s.isSpecial()&&g===specialSchemes[s.scheme]?null:g,u=""}if(t)return;l=PATH_START;continue}return INVALID_PORT}u+=o;break;case FILE:if(s.scheme="file","/"==o||"\\"==o)l=FILE_SLASH;else{if(!r||"file"!=r.scheme){l=PATH;continue}if(o==EOF)s.host=r.host,s.path=arraySlice$1(r.path),s.query=r.query;else if("?"==o)s.host=r.host,s.path=arraySlice$1(r.path),s.query="",l=QUERY;else{if("#"!=o){startsWithWindowsDriveLetter(join(arraySlice$1(n,c),""))||(s.host=r.host,s.path=arraySlice$1(r.path),s.shortenPath()),l=PATH;continue}s.host=r.host,s.path=arraySlice$1(r.path),s.query=r.query,s.fragment="",l=FRAGMENT}}break;case FILE_SLASH:if("/"==o||"\\"==o){l=FILE_HOST;break}r&&"file"==r.scheme&&!startsWithWindowsDriveLetter(join(arraySlice$1(n,c),""))&&(isWindowsDriveLetter(r.path[0],!0)?push$3(s.path,r.path[0]):s.host=r.host),l=PATH;continue;case FILE_HOST:if(o==EOF||"/"==o||"\\"==o||"?"==o||"#"==o){if(!t&&isWindowsDriveLetter(u))l=PATH;else if(""==u){if(s.host="",t)return;l=PATH_START}else{if(a=s.parseHost(u))return a;if("localhost"==s.host&&(s.host=""),t)return;u="",l=PATH_START}continue}u+=o;break;case PATH_START:if(s.isSpecial()){if(l=PATH,"/"!=o&&"\\"!=o)continue}else if(t||"?"!=o)if(t||"#"!=o){if(o!=EOF&&(l=PATH,"/"!=o))continue}else s.fragment="",l=FRAGMENT;else s.query="",l=QUERY;break;case PATH:if(o==EOF||"/"==o||"\\"==o&&s.isSpecial()||!t&&("?"==o||"#"==o)){if(isDoubleDot(u)?(s.shortenPath(),"/"==o||"\\"==o&&s.isSpecial()||push$3(s.path,"")):isSingleDot(u)?"/"==o||"\\"==o&&s.isSpecial()||push$3(s.path,""):("file"==s.scheme&&!s.path.length&&isWindowsDriveLetter(u)&&(s.host&&(s.host=""),u=charAt(u,0)+":"),push$3(s.path,u)),u="","file"==s.scheme&&(o==EOF||"?"==o||"#"==o))for(;s.path.length>1&&""===s.path[0];)shift(s.path);"?"==o?(s.query="",l=QUERY):"#"==o&&(s.fragment="",l=FRAGMENT)}else u+=percentEncode(o,pathPercentEncodeSet);break;case CANNOT_BE_A_BASE_URL_PATH:"?"==o?(s.query="",l=QUERY):"#"==o?(s.fragment="",l=FRAGMENT):o!=EOF&&(s.path[0]+=percentEncode(o,C0ControlPercentEncodeSet));break;case QUERY:t||"#"!=o?o!=EOF&&("'"==o&&s.isSpecial()?s.query+="%27":s.query+="#"==o?"%23":percentEncode(o,C0ControlPercentEncodeSet)):(s.fragment="",l=FRAGMENT);break;case FRAGMENT:o!=EOF&&(s.fragment+=percentEncode(o,fragmentPercentEncodeSet))}c++}},parseHost:function(e){var t,r,n;if("["==charAt(e,0)){if("]"!=charAt(e,e.length-1))return INVALID_HOST;if(!(t=parseIPv6(stringSlice$1(e,1,-1))))return INVALID_HOST;this.host=t}else if(this.isSpecial()){if(e=toASCII(e),exec(FORBIDDEN_HOST_CODE_POINT,e))return INVALID_HOST;if(null===(t=parseIPv4(e)))return INVALID_HOST;this.host=t}else{if(exec(FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT,e))return INVALID_HOST;for(t="",r=arrayFrom(e),n=0;n<r.length;n++)t+=percentEncode(r[n],C0ControlPercentEncodeSet);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return hasOwn$1(specialSchemes,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"==this.scheme&&1==t&&isWindowsDriveLetter(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,r=e.username,n=e.password,o=e.host,i=e.port,a=e.path,s=e.query,l=e.fragment,c=t+":";return null!==o?(c+="//",e.includesCredentials()&&(c+=r+(n?":"+n:"")+"@"),c+=serializeHost(o),null!==i&&(c+=":"+i)):"file"==t&&(c+="//"),c+=e.cannotBeABaseURL?a[0]:a.length?"/"+join(a,"/"):"",null!==s&&(c+="?"+s),null!==l&&(c+="#"+l),c},setHref:function(e){var t=this.parse(e);if(t)throw TypeError$1(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"==e)try{return new URLConstructor(e.path[0]).origin}catch(e){return"null"}return"file"!=e&&this.isSpecial()?e+"://"+serializeHost(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse($toString(e)+":",SCHEME_START)},getUsername:function(){return this.username},setUsername:function(e){var t=arrayFrom($toString(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=percentEncode(t[r],userinfoPercentEncodeSet)}},getPassword:function(){return this.password},setPassword:function(e){var t=arrayFrom($toString(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=percentEncode(t[r],userinfoPercentEncodeSet)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?serializeHost(e):serializeHost(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,HOST)},getHostname:function(){var e=this.host;return null===e?"":serializeHost(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,HOSTNAME)},getPort:function(){var e=this.port;return null===e?"":$toString(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""==(e=$toString(e))?this.port=null:this.parse(e,PORT))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+join(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,PATH_START))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""==(e=$toString(e))?this.query=null:("?"==charAt(e,0)&&(e=stringSlice$1(e,1)),this.query="",this.parse(e,QUERY)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!=(e=$toString(e))?("#"==charAt(e,0)&&(e=stringSlice$1(e,1)),this.fragment="",this.parse(e,FRAGMENT)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var URLConstructor=function(e){var t=anInstance$2(this,URLPrototype),r=validateArgumentsLength$1(arguments.length,1)>1?arguments[1]:void 0,n=setInternalState$2(t,new URLState(e,!1,r));DESCRIPTORS$3||(t.href=n.serialize(),t.origin=n.getOrigin(),t.protocol=n.getProtocol(),t.username=n.getUsername(),t.password=n.getPassword(),t.host=n.getHost(),t.hostname=n.getHostname(),t.port=n.getPort(),t.pathname=n.getPathname(),t.search=n.getSearch(),t.searchParams=n.getSearchParams(),t.hash=n.getHash())},URLPrototype=URLConstructor.prototype,accessorDescriptor=function(e,t){return{get:function(){return getInternalURLState(this)[e]()},set:t&&function(e){return getInternalURLState(this)[t](e)},configurable:!0,enumerable:!0}};if(DESCRIPTORS$3&&(defineBuiltInAccessor$1(URLPrototype,"href",accessorDescriptor("serialize","setHref")),defineBuiltInAccessor$1(URLPrototype,"origin",accessorDescriptor("getOrigin")),defineBuiltInAccessor$1(URLPrototype,"protocol",accessorDescriptor("getProtocol","setProtocol")),defineBuiltInAccessor$1(URLPrototype,"username",accessorDescriptor("getUsername","setUsername")),defineBuiltInAccessor$1(URLPrototype,"password",accessorDescriptor("getPassword","setPassword")),defineBuiltInAccessor$1(URLPrototype,"host",accessorDescriptor("getHost","setHost")),defineBuiltInAccessor$1(URLPrototype,"hostname",accessorDescriptor("getHostname","setHostname")),defineBuiltInAccessor$1(URLPrototype,"port",accessorDescriptor("getPort","setPort")),defineBuiltInAccessor$1(URLPrototype,"pathname",accessorDescriptor("getPathname","setPathname")),defineBuiltInAccessor$1(URLPrototype,"search",accessorDescriptor("getSearch","setSearch")),defineBuiltInAccessor$1(URLPrototype,"searchParams",accessorDescriptor("getSearchParams")),defineBuiltInAccessor$1(URLPrototype,"hash",accessorDescriptor("getHash","setHash"))),defineBuiltIn(URLPrototype,"toJSON",(function(){return getInternalURLState(this).serialize()}),{enumerable:!0}),defineBuiltIn(URLPrototype,"toString",(function(){return getInternalURLState(this).serialize()}),{enumerable:!0}),NativeURL){var nativeCreateObjectURL=NativeURL.createObjectURL,nativeRevokeObjectURL=NativeURL.revokeObjectURL;nativeCreateObjectURL&&defineBuiltIn(URLConstructor,"createObjectURL",bind$9(nativeCreateObjectURL,NativeURL)),nativeRevokeObjectURL&&defineBuiltIn(URLConstructor,"revokeObjectURL",bind$9(nativeRevokeObjectURL,NativeURL))}setToStringTag$1(URLConstructor,"URL"),$$z({global:!0,constructor:!0,forced:!USE_NATIVE_URL$1,sham:!DESCRIPTORS$3},{URL:URLConstructor});var $$y=_export,getBuiltIn$1=getBuiltIn$h,fails$6=fails$B,validateArgumentsLength=validateArgumentsLength$5,toString$2=toString$f,USE_NATIVE_URL=urlConstructorDetection,URL$1=getBuiltIn$1("URL"),THROWS_WITHOUT_ARGUMENTS=USE_NATIVE_URL&&fails$6((function(){URL$1.canParse()}));$$y({target:"URL",stat:!0,forced:!THROWS_WITHOUT_ARGUMENTS},{canParse:function(e){var t=validateArgumentsLength(arguments.length,1),r=toString$2(e),n=t<2||void 0===arguments[1]?void 0:toString$2(arguments[1]);try{return!!new URL$1(r,n)}catch(e){return!1}}});var path$7=path$y,url$5=path$7.URL,parent$F=url$5,url$4=parent$F,parent$E=url$4,url$3=parent$E,parent$D=url$3,url$2=parent$D,url$1=url$2,url=url$1,_URL=getDefaultExportFromCjs(url);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(r,Icon);var t=_createSuper(r);function r(){return _classCallCheck$1(this,r),t.apply(this,arguments)}return _createClass$1(r,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.cssFullscreen&&(e.config.disable=!e.player.config.cssFullscreen)}},{key:"afterCreate",value:function(){var e,t=this;_get(_getPrototypeOf(r.prototype),"afterCreate",this).call(this),this.config.disable||(this.config.target&&(this.playerConfig.fullscreenTarget=this.config.target),this.initIcons(),this.on(CSS_FULLSCREEN_CHANGE,(function(e){t.animate(e)})),this.btnClick=_bindInstanceProperty(e=this.btnClick).call(e,this),this.handleCssFullscreen=this.hook("cssFullscreen_change",this.btnClick,{pre:function(e){e.preventDefault(),e.stopPropagation()}}),_bindInstanceProperty(this).call(this,["click","touchend"],this.handleCssFullscreen))}},{key:"initIcons",value:function(){var e=this.icons,t=_findInstanceProperty(this).call(this,".xgplayer-icon");t.appendChild(e.cssFullscreen),t.appendChild(e.exitCssFullscreen)}},{key:"btnClick",value:function(e){e.preventDefault(),e.stopPropagation();var t=this.player.isCssfullScreen;this.emitUserAction(e,"switch_cssfullscreen",{cssfullscreen:t}),t?this.player.exitCssFullscreen():this.player.getCssFullscreen()}},{key:"animate",value:function(e){this.root&&(e?this.setAttr("data-state","full"):this.setAttr("data-state","normal"),this.switchTips(e))}},{key:"switchTips",value:function(e){var t=this.i18nKeys,r=_findInstanceProperty(this).call(this,".xg-tips");r&&this.changeLangTextKey(r,e?t.EXITCSSFULLSCREEN_TIPS:t.CSSFULLSCREEN_TIPS)}},{key:"registerIcons",value:function(){return{cssFullscreen:{icon:CssFullSceenSvg,class:"xg-get-cssfull"},exitCssFullscreen:{icon:ExitCssFullSceenSvg,class:"xg-exit-cssfull"}}}},{key:"destroy",value:function(){_get(_getPrototypeOf(r.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.btnClick)}},{key:"render",value:function(){if(!this.config.disable)return"<xg-icon class='xgplayer-cssfullscreen'>\n <div class=\"xgplayer-icon\">\n </div>\n ".concat(xgIconTips(this,"CSSFULLSCREEN_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"cssFullscreen"}},{key:"defaultConfig",get:function(){return{position:POSITIONS.CONTROLS_RIGHT,index:1,disable:!1,target:null}}}]),r}(),isObject$4=isObject$l,classof$1=classofRaw$2,wellKnownSymbol$1=wellKnownSymbol$q,MATCH$1=wellKnownSymbol$1("match"),isRegexp=function(e){var t;return isObject$4(e)&&(void 0!==(t=e[MATCH$1])?!!t:"RegExp"==classof$1(e))},isRegExp=isRegexp,$TypeError$4=TypeError,notARegexp=function(e){if(isRegExp(e))throw $TypeError$4("The method doesn't accept regular expressions");return e},wellKnownSymbol=wellKnownSymbol$q,MATCH=wellKnownSymbol("match"),correctIsRegexpLogic=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[MATCH]=!1,"/./"[e](t)}catch(e){}}return!1},$$x=_export,uncurryThis$4=functionUncurryThisClause;objectGetOwnPropertyDescriptor.f;var toLength=toLength$3,toString$1=toString$f,notARegExp$1=notARegexp,requireObjectCoercible$1=requireObjectCoercible$8,correctIsRegExpLogic$1=correctIsRegexpLogic,nativeStartsWith=uncurryThis$4("".startsWith),stringSlice=uncurryThis$4("".slice),min$2=Math.min,CORRECT_IS_REGEXP_LOGIC=correctIsRegExpLogic$1("startsWith");$$x({target:"String",proto:!0,forced:!CORRECT_IS_REGEXP_LOGIC},{startsWith:function(e){var t=toString$1(requireObjectCoercible$1(this));notARegExp$1(e);var r=toLength(min$2(arguments.length>1?arguments[1]:void 0,t.length)),n=toString$1(e);return nativeStartsWith?nativeStartsWith(t,n,r):stringSlice(t,r,r+n.length)===n}});var entryVirtual$6=entryVirtual$o,startsWith$6=entryVirtual$6("String").startsWith,isPrototypeOf$5=objectIsPrototypeOf,method$4=startsWith$6,StringPrototype$1=String.prototype,startsWith$5=function(e){var t=e.startsWith;return"string"==typeof e||e===StringPrototype$1||isPrototypeOf$5(StringPrototype$1,e)&&t===StringPrototype$1.startsWith?method$4:t},parent$C=startsWith$5,startsWith$4=parent$C,parent$B=startsWith$4,startsWith$3=parent$B,parent$A=startsWith$3,startsWith$2=parent$A,startsWith$1=startsWith$2,startsWith2=startsWith$1,_startsWithInstanceProperty=getDefaultExportFromCjs(startsWith2),isObject$3=isObject$l,floor=Math.floor,isIntegralNumber$1=Number.isInteger||function(e){return!isObject$3(e)&&isFinite(e)&&floor(e)===e},$$w=_export,isIntegralNumber=isIntegralNumber$1;$$w({target:"Number",stat:!0},{isInteger:isIntegralNumber});var path$6=path$y,isInteger$5=path$6.Number.isInteger,parent$z=isInteger$5,isInteger$4=parent$z,parent$y=isInteger$4,isInteger$3=parent$y,parent$x=isInteger$3,isInteger$2=parent$x,isInteger$1=isInteger$2,isInteger2=isInteger$1,_Number$isInteger=getDefaultExportFromCjs(isInteger2),$$v=_export,$includes=arrayIncludes.includes,fails$5=fails$B,BROKEN_ON_SPARSE=fails$5((function(){return!Array(1).includes()}));$$v({target:"Array",proto:!0,forced:BROKEN_ON_SPARSE},{includes:function(e){return $includes(this,e,arguments.length>1?arguments[1]:void 0)}});var entryVirtual$5=entryVirtual$o,includes$7=entryVirtual$5("Array").includes,$$u=_export,uncurryThis$3=functionUncurryThis,notARegExp=notARegexp,requireObjectCoercible=requireObjectCoercible$8,toString4=toString$f,correctIsRegExpLogic=correctIsRegexpLogic,stringIndexOf=uncurryThis$3("".indexOf);$$u({target:"String",proto:!0,forced:!correctIsRegExpLogic("includes")},{includes:function(e){return!!~stringIndexOf(toString4(requireObjectCoercible(this)),toString4(notARegExp(e)),arguments.length>1?arguments[1]:void 0)}});var entryVirtual$4=entryVirtual$o,includes$6=entryVirtual$4("String").includes,isPrototypeOf$4=objectIsPrototypeOf,arrayMethod=includes$7,stringMethod=includes$6,ArrayPrototype$4=Array.prototype,StringPrototype=String.prototype,includes$5=function(e){var t=e.includes;return e===ArrayPrototype$4||isPrototypeOf$4(ArrayPrototype$4,e)&&t===ArrayPrototype$4.includes?arrayMethod:"string"==typeof e||e===StringPrototype||isPrototypeOf$4(StringPrototype,e)&&t===StringPrototype.includes?stringMethod:t},parent$w=includes$5,includes$4=parent$w,parent$v=includes$4,includes$3=parent$v,parent$u=includes$3,includes$2=parent$u,includes$1=includes$2,includes3=includes$1,_includesInstanceProperty=getDefaultExportFromCjs(includes3),toObject$2=toObject$f,toAbsoluteIndex$1=toAbsoluteIndex$6,lengthOfArrayLike$3=lengthOfArrayLike$e,arrayFill=function(e){for(var t=toObject$2(this),r=lengthOfArrayLike$3(t),n=arguments.length,o=toAbsoluteIndex$1(n>1?arguments[1]:void 0,r),i=n>2?arguments[2]:void 0,a=void 0===i?r:toAbsoluteIndex$1(i,r);a>o;)t[o++]=e;return t},$$t=_export,fill$7=arrayFill;$$t({target:"Array",proto:!0},{fill:fill$7});var entryVirtual$3=entryVirtual$o,fill$6=entryVirtual$3("Array").fill,isPrototypeOf$3=objectIsPrototypeOf,method$3=fill$6,ArrayPrototype$3=Array.prototype,fill$5=function(e){var t=e.fill;return e===ArrayPrototype$3||isPrototypeOf$3(ArrayPrototype$3,e)&&t===ArrayPrototype$3.fill?method$3:t},parent$t=fill$5,fill$4=parent$t,parent$s=fill$4,fill$3=parent$s,parent$r=fill$3,fill$2=parent$r,fill$1=fill$2,fill2=fill$1,_fillInstanceProperty=getDefaultExportFromCjs(fill2),internalMetadata={exports:{}},fails$4=fails$B,arrayBufferNonExtensible=fails$4((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}})),fails$3=fails$B,isObject$2=isObject$l,classof=classofRaw$2,ARRAY_BUFFER_NON_EXTENSIBLE=arrayBufferNonExtensible,$isExtensible=Object.isExtensible,FAILS_ON_PRIMITIVES$1=fails$3((function(){$isExtensible(1)})),objectIsExtensible=FAILS_ON_PRIMITIVES$1||ARRAY_BUFFER_NON_EXTENSIBLE?function(e){return!!isObject$2(e)&&((!ARRAY_BUFFER_NON_EXTENSIBLE||"ArrayBuffer"!=classof(e))&&(!$isExtensible||$isExtensible(e)))}:$isExtensible,fails$2=fails$B,freezing=!fails$2((function(){return Object.isExtensible(Object.preventExtensions({}))})),$$s=_export,uncurryThis$2=functionUncurryThis,hiddenKeys=hiddenKeys$6,isObject$1=isObject$l,hasOwn2=hasOwnProperty_1,defineProperty$1=objectDefineProperty.f,getOwnPropertyNamesModule=objectGetOwnPropertyNames,getOwnPropertyNamesExternalModule=objectGetOwnPropertyNamesExternal,isExtensible2=objectIsExtensible,uid=uid$4,FREEZING=freezing,REQUIRED=!1,METADATA=uid("meta"),id=0,setMetadata=function(e){defineProperty$1(e,METADATA,{value:{objectID:"O"+id++,weakData:{}}})},fastKey$1=function(e,t){if(!isObject$1(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!hasOwn2(e,METADATA)){if(!isExtensible2(e))return"F";if(!t)return"E";setMetadata(e)}return e[METADATA].objectID},getWeakData=function(e,t){if(!hasOwn2(e,METADATA)){if(!isExtensible2(e))return!0;if(!t)return!1;setMetadata(e)}return e[METADATA].weakData},onFreeze=function(e){return FREEZING&&REQUIRED&&isExtensible2(e)&&!hasOwn2(e,METADATA)&&setMetadata(e),e},enable=function(){meta.enable=function(){},REQUIRED=!0;var e=getOwnPropertyNamesModule.f,t=uncurryThis$2([].splice),r={};r[METADATA]=1,e(r).length&&(getOwnPropertyNamesModule.f=function(r){for(var n=e(r),o=0,i=n.length;o<i;o++)if(n[o]===METADATA){t(n,o,1);break}return n},$$s({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:getOwnPropertyNamesExternalModule.f}))},meta=internalMetadata.exports={enable:enable,fastKey:fastKey$1,getWeakData:getWeakData,onFreeze:onFreeze};hiddenKeys[METADATA]=!0;var internalMetadataExports=internalMetadata.exports,$$r=_export,global$2=global$s,InternalMetadataModule=internalMetadataExports,fails$1=fails$B,createNonEnumerableProperty=createNonEnumerableProperty$9,iterate$f=iterate$l,anInstance$1=anInstance$5,isCallable$3=isCallable$q,isObject=isObject$l,setToStringTag=setToStringTag$9,defineProperty5=objectDefineProperty.f,forEach3=arrayIteration.forEach,DESCRIPTORS$2=descriptors$2,InternalStateModule$1=internalState,setInternalState$1=InternalStateModule$1.set,internalStateGetterFor$1=InternalStateModule$1.getterFor,collection$1=function(e,t,r){var n,o=-1!==e.indexOf("Map"),i=-1!==e.indexOf("Weak"),a=o?"set":"add",s=global$2[e],l=s&&s.prototype,c={};if(DESCRIPTORS$2&&isCallable$3(s)&&(i||l.forEach&&!fails$1((function(){(new s).entries().next()})))){var u=(n=t((function(t,r){setInternalState$1(anInstance$1(t,u),{type:e,collection:new s}),null!=r&&iterate$f(r,t[a],{that:t,AS_ENTRIES:o})}))).prototype,p=internalStateGetterFor$1(e);forEach3(["add","clear","delete","forEach","get","has","set","keys","values","entries"],(function(e){var t="add"==e||"set"==e;!(e in l)||i&&"clear"==e||createNonEnumerableProperty(u,e,(function(r,n){var o=p(this).collection;if(!t&&i&&!isObject(r))return"get"==e&&void 0;var a=o[e](0===r?0:r,n);return t?this:a}))})),i||defineProperty5(u,"size",{configurable:!0,get:function(){return p(this).collection.size}})}else n=r.getConstructor(t,e,o,a),InternalMetadataModule.enable();return setToStringTag(n,e,!1,!0),c[e]=n,$$r({global:!0,forced:!0},c),i||r.setStrong(n,e,o),n},create4=objectCreate,defineBuiltInAccessor=defineBuiltInAccessor$5,defineBuiltIns=defineBuiltIns$2,bind$8=functionBindContext,anInstance=anInstance$5,isNullOrUndefined$1=isNullOrUndefined$6,iterate$e=iterate$l,defineIterator=iteratorDefine,createIterResultObject=createIterResultObject$3,setSpecies=setSpecies$2,DESCRIPTORS$1=descriptors$2,fastKey=internalMetadataExports.fastKey,InternalStateModule=internalState,setInternalState=InternalStateModule.set,internalStateGetterFor=InternalStateModule.getterFor,collectionStrong$1={getConstructor:function(e,t,r,n){var o=e((function(e,o){anInstance(e,i),setInternalState(e,{type:t,index:create4(null),first:void 0,last:void 0,size:0}),DESCRIPTORS$1||(e.size=0),isNullOrUndefined$1(o)||iterate$e(o,e[n],{that:e,AS_ENTRIES:r})})),i=o.prototype,a=internalStateGetterFor(t),s=function(e,t,r){var n,o,i=a(e),s=l(e,t);return s?s.value=r:(i.last=s={index:o=fastKey(t,!0),key:t,value:r,previous:n=i.last,next:void 0,removed:!1},i.first||(i.first=s),n&&(n.next=s),DESCRIPTORS$1?i.size++:e.size++,"F"!==o&&(i.index[o]=s)),e},l=function(e,t){var r,n=a(e),o=fastKey(t);if("F"!==o)return n.index[o];for(r=n.first;r;r=r.next)if(r.key==t)return r};return defineBuiltIns(i,{clear:function(){for(var e=a(this),t=e.index,r=e.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete t[r.index],r=r.next;e.first=e.last=void 0,DESCRIPTORS$1?e.size=0:this.size=0},delete:function(e){var t=this,r=a(t),n=l(t,e);if(n){var o=n.next,i=n.previous;delete r.index[n.index],n.removed=!0,i&&(i.next=o),o&&(o.previous=i),r.first==n&&(r.first=o),r.last==n&&(r.last=i),DESCRIPTORS$1?r.size--:t.size--}return!!n},forEach:function(e){for(var t,r=a(this),n=bind$8(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:r.first;)for(n(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!l(this,e)}}),defineBuiltIns(i,r?{get:function(e){var t=l(this,e);return t&&t.value},set:function(e,t){return s(this,0===e?0:e,t)}}:{add:function(e){return s(this,e=0===e?0:e,e)}}),DESCRIPTORS$1&&defineBuiltInAccessor(i,"size",{configurable:!0,get:function(){return a(this).size}}),o},setStrong:function(e,t,r){var n=t+" Iterator",o=internalStateGetterFor(t),i=internalStateGetterFor(n);defineIterator(e,t,(function(e,t){setInternalState(this,{type:n,target:e,state:o(e),kind:t,last:void 0})}),(function(){for(var e=i(this),t=e.kind,r=e.last;r&&r.removed;)r=r.previous;return e.target&&(e.last=r=r?r.next:e.state.first)?createIterResultObject("keys"==t?r.key:"values"==t?r.value:[r.key,r.value],!1):(e.target=void 0,createIterResultObject(void 0,!0))}),r?"entries":"values",!r,!0),setSpecies(t)}},collection=collection$1,collectionStrong=collectionStrong$1;collection("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),collectionStrong);var path$5=path$y,map$5=path$5.Map,parent$q=map$5,map$4=parent$q,parent$p=map$4,map$3=parent$p,bind$7=functionBindContext,call$4=functionCall,aCallable$6=aCallable$j,aConstructor=aConstructor$3,isNullOrUndefined=isNullOrUndefined$6,iterate$d=iterate$l,push$2=[].push,collectionFrom=function(e){var t,r,n,o,i=arguments.length,a=i>1?arguments[1]:void 0;return aConstructor(this),(t=void 0!==a)&&aCallable$6(a),isNullOrUndefined(e)?new this:(r=[],t?(n=0,o=bind$7(a,i>2?arguments[2]:void 0),iterate$d(e,(function(e){call$4(push$2,r,o(e,n++))}))):iterate$d(e,push$2,{that:r}),new this(r))},$$q=_export,from3=collectionFrom;$$q({target:"Map",stat:!0,forced:!0},{from:from3});var arraySlice=arraySlice$7,collectionOf=function(){return new this(arraySlice(arguments))},$$p=_export,of2=collectionOf;$$p({target:"Map",stat:!0,forced:!0},{of:of2});var tryToString=tryToString$7,aMap$e=function(e){if("object"==typeof e&&"size"in e&&"has"in e&&"get"in e&&"set"in e&&"delete"in e&&"entries"in e)return e;throw TypeError(tryToString(e)+" is not a map")},caller$1=function(e,t){return 1==t?function(t,r){return t[e](r)}:function(t,r,n){return t[e](r,n)}},getBuiltIn=getBuiltIn$h,caller=caller$1,Map$5=getBuiltIn("Map"),mapHelpers={Map:Map$5,set:caller("set",2),get:caller("get",1),has:caller("has",1),remove:caller("delete",1),proto:Map$5.prototype},$$o=_export,aMap$d=aMap$e,remove=mapHelpers.remove;$$o({target:"Map",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var e,t=aMap$d(this),r=!0,n=0,o=arguments.length;n<o;n++)e=remove(t,arguments[n]),r=r&&e;return!!r}});var $$n=_export,aMap$c=aMap$e,MapHelpers$4=mapHelpers,get$1=MapHelpers$4.get,has$1=MapHelpers$4.has,set$5=MapHelpers$4.set;$$n({target:"Map",proto:!0,real:!0,forced:!0},{emplace:function(e,t){var r,n,o=aMap$c(this);return has$1(o,e)?(r=get$1(o,e),"update"in t&&(r=t.update(r,e,o),set$5(o,e,r)),r):(n=t.insert(e,o),set$5(o,e,n),n)}});var call$3=functionCall,iterateSimple$1=function(e,t,r){for(var n,o,i=r||e.next;!(n=call$3(i,e)).done;)if(void 0!==(o=t(n.value)))return o},iterateSimple=iterateSimple$1,mapIterate=function(e,t,r){return r?iterateSimple(e.entries(),(function(e){return t(e[1],e[0])})):e.forEach(t)},$$m=_export,bind$6=functionBindContext,aMap$b=aMap$e,iterate$c=mapIterate;$$m({target:"Map",proto:!0,real:!0,forced:!0},{every:function(e){var t=aMap$b(this),r=bind$6(e,arguments.length>1?arguments[1]:void 0);return!1!==iterate$c(t,(function(e,n){if(!r(e,n,t))return!1}),!0)}});var $$l=_export,bind$5=functionBindContext,aMap$a=aMap$e,MapHelpers$3=mapHelpers,iterate$b=mapIterate,Map$4=MapHelpers$3.Map,set$4=MapHelpers$3.set;$$l({target:"Map",proto:!0,real:!0,forced:!0},{filter:function(e){var t=aMap$a(this),r=bind$5(e,arguments.length>1?arguments[1]:void 0),n=new Map$4;return iterate$b(t,(function(e,o){r(e,o,t)&&set$4(n,o,e)})),n}});var $$k=_export,bind$4=functionBindContext,aMap$9=aMap$e,iterate$a=mapIterate;$$k({target:"Map",proto:!0,real:!0,forced:!0},{find:function(e){var t=aMap$9(this),r=bind$4(e,arguments.length>1?arguments[1]:void 0),n=iterate$a(t,(function(e,n){if(r(e,n,t))return{value:e}}),!0);return n&&n.value}});var $$j=_export,bind$3=functionBindContext,aMap$8=aMap$e,iterate$9=mapIterate;$$j({target:"Map",proto:!0,real:!0,forced:!0},{findKey:function(e){var t=aMap$8(this),r=bind$3(e,arguments.length>1?arguments[1]:void 0),n=iterate$9(t,(function(e,n){if(r(e,n,t))return{key:n}}),!0);return n&&n.key}});var $$i=_export,call$2=functionCall,uncurryThis$1=functionUncurryThis,isCallable$2=isCallable$q,aCallable$5=aCallable$j,iterate$8=iterate$l,Map$3=mapHelpers.Map,push$1=uncurryThis$1([].push);$$i({target:"Map",stat:!0,forced:!0},{groupBy:function(e,t){var r=new(isCallable$2(this)?this:Map$3);aCallable$5(t);var n=aCallable$5(r.has),o=aCallable$5(r.get),i=aCallable$5(r.set);return iterate$8(e,(function(e){var a=t(e);call$2(n,r,a)?push$1(call$2(o,r,a),e):call$2(i,r,a,[e])})),r}});var sameValueZero$1=function(e,t){return e===t||e!=e&&t!=t},$$h=_export,sameValueZero=sameValueZero$1,aMap$7=aMap$e,iterate$7=mapIterate;$$h({target:"Map",proto:!0,real:!0,forced:!0},{includes:function(e){return!0===iterate$7(aMap$7(this),(function(t){if(sameValueZero(t,e))return!0}),!0)}});var $$g=_export,call$1=functionCall,iterate$6=iterate$l,isCallable$1=isCallable$q,aCallable$4=aCallable$j,Map$2=mapHelpers.Map;$$g({target:"Map",stat:!0,forced:!0},{keyBy:function(e,t){var r=new(isCallable$1(this)?this:Map$2);aCallable$4(t);var n=aCallable$4(r.set);return iterate$6(e,(function(e){call$1(n,r,t(e),e)})),r}});var $$f=_export,aMap$6=aMap$e,iterate$5=mapIterate;$$f({target:"Map",proto:!0,real:!0,forced:!0},{keyOf:function(e){var t=iterate$5(aMap$6(this),(function(t,r){if(t===e)return{key:r}}),!0);return t&&t.key}});var $$e=_export,bind$2=functionBindContext,aMap$5=aMap$e,MapHelpers$2=mapHelpers,iterate$4=mapIterate,Map$1=MapHelpers$2.Map,set$3=MapHelpers$2.set;$$e({target:"Map",proto:!0,real:!0,forced:!0},{mapKeys:function(e){var t=aMap$5(this),r=bind$2(e,arguments.length>1?arguments[1]:void 0),n=new Map$1;return iterate$4(t,(function(e,o){set$3(n,r(e,o,t),e)})),n}});var $$d=_export,bind$1=functionBindContext,aMap$4=aMap$e,MapHelpers$1=mapHelpers,iterate$3=mapIterate,Map=MapHelpers$1.Map,set$2=MapHelpers$1.set;$$d({target:"Map",proto:!0,real:!0,forced:!0},{mapValues:function(e){var t=aMap$4(this),r=bind$1(e,arguments.length>1?arguments[1]:void 0),n=new Map;return iterate$3(t,(function(e,o){set$2(n,o,r(e,o,t))})),n}});var $$c=_export,aMap$3=aMap$e,iterate$2=iterate$l,set$1=mapHelpers.set;$$c({target:"Map",proto:!0,real:!0,arity:1,forced:!0},{merge:function(e){for(var t=aMap$3(this),r=arguments.length,n=0;n<r;)iterate$2(arguments[n++],(function(e,r){set$1(t,e,r)}),{AS_ENTRIES:!0});return t}});var $$b=_export,aCallable$3=aCallable$j,aMap$2=aMap$e,iterate$1=mapIterate,$TypeError$3=TypeError;$$b({target:"Map",proto:!0,real:!0,forced:!0},{reduce:function(e){var t=aMap$2(this),r=arguments.length<2,n=r?void 0:arguments[1];if(aCallable$3(e),iterate$1(t,(function(o,i){r?(r=!1,n=o):n=e(n,o,i,t)})),r)throw $TypeError$3("Reduce of empty map with no initial value");return n}});var $$a=_export,bind2=functionBindContext,aMap$1=aMap$e,iterate=mapIterate;$$a({target:"Map",proto:!0,real:!0,forced:!0},{some:function(e){var t=aMap$1(this),r=bind2(e,arguments.length>1?arguments[1]:void 0);return!0===iterate(t,(function(e,n){if(r(e,n,t))return!0}),!0)}});var $$9=_export,aCallable$2=aCallable$j,aMap=aMap$e,MapHelpers=mapHelpers,$TypeError$2=TypeError,get2=MapHelpers.get,has2=MapHelpers.has,set2=MapHelpers.set;$$9({target:"Map",proto:!0,real:!0,forced:!0},{update:function(e,t){var r=aMap(this),n=arguments.length;aCallable$2(t);var o=has2(r,e);if(!o&&n<3)throw $TypeError$2("Updating absent value");var i=o?get2(r,e):aCallable$2(n>2?arguments[2]:void 0)(e,r);return set2(r,e,t(i,e,r)),r}});var call=functionCall,aCallable$1=aCallable$j,isCallable=isCallable$q,anObject=anObject$g,$TypeError$1=TypeError,mapUpsert=function(e,t){var r,n=anObject(this),o=aCallable$1(n.get),i=aCallable$1(n.has),a=aCallable$1(n.set),s=arguments.length>2?arguments[2]:void 0;if(!isCallable(t)&&!isCallable(s))throw $TypeError$1("At least one callback required");return call(i,n,e)?(r=call(o,n,e),isCallable(t)&&(r=t(r),call(a,n,e,r))):isCallable(s)&&(r=s(),call(a,n,e,r)),r},$$8=_export,upsert$1=mapUpsert;$$8({target:"Map",proto:!0,real:!0,forced:!0},{upsert:upsert$1});var $$7=_export,upsert2=mapUpsert;$$7({target:"Map",proto:!0,real:!0,name:"upsert",forced:!0},{updateOrInsert:upsert2});var parent$o=map$3,map$2=parent$o,map$1=map$2,map2=map$1,_Map=getDefaultExportFromCjs(map2);function _typeof(e){return(_typeof="function"==typeof _Symbol&&"symbol"==typeof _Symbol$iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof _Symbol&&e.constructor===_Symbol&&e!==_Symbol.prototype?"symbol":typeof e})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),_Object$defineProperty(e,_toPropertyKey(n.key),n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),_Object$defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?_Object$defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPrimitive(e,t){if("object"!==_typeof$3(e)||null===e)return e;var r=e[_Symbol$toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==_typeof$3(n))return n;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$3(t)?t:String(t)}var aCallable=aCallable$j,toObject$1=toObject$f,IndexedObject=indexedObject,lengthOfArrayLike$2=lengthOfArrayLike$e,$TypeError=TypeError,createMethod$1=function(e){return function(t,r,n,o){aCallable(r);var i=toObject$1(t),a=IndexedObject(i),s=lengthOfArrayLike$2(i),l=e?s-1:0,c=e?-1:1;if(n<2)for(;;){if(l in a){o=a[l],l+=c;break}if(l+=c,e?l<0:s<=l)throw $TypeError("Reduce of empty array with no initial value")}for(;e?l>=0:s>l;l+=c)l in a&&(o=r(o,a[l],l,i));return o}},arrayReduce={left:createMethod$1(!1),right:createMethod$1(!0)},$$6=_export,$reduce=arrayReduce.left,arrayMethodIsStrict$1=arrayMethodIsStrict$7,CHROME_VERSION=engineV8Version,IS_NODE=engineIsNode,CHROME_BUG=!IS_NODE&&engineV8Version>79&&engineV8Version<83,FORCED$1=CHROME_BUG||!arrayMethodIsStrict$1("reduce");$$6({target:"Array",proto:!0,forced:FORCED$1},{reduce:function(e){var t=arguments.length;return $reduce(this,e,t,t>1?arguments[1]:void 0)}});var entryVirtual$2=entryVirtual$o,reduce$6=entryVirtual$2("Array").reduce,isPrototypeOf$2=objectIsPrototypeOf,method$2=reduce$6,ArrayPrototype$2=Array.prototype,reduce$5=function(e){var t=e.reduce;return e===ArrayPrototype$2||isPrototypeOf$2(ArrayPrototype$2,e)&&t===ArrayPrototype$2.reduce?method$2:t},parent$n=reduce$5,reduce$4=parent$n,parent$m=reduce$4,reduce$3=parent$m,parent$l=reduce$3,reduce$2=parent$l,reduce$1=reduce$2,reduce3=reduce$1,_reduceInstanceProperty=getDefaultExportFromCjs(reduce3),LogCacheLevel={DEBUG:1,LOG:2,WARN:3,ERROR:4},LOG_MAX_SIZE=204800,SIMPLE_TYPE=["Boolean","Number","String","Undefined","Null","Date","Object"],Logger=function(){function e(t,r){_classCallCheck(this,e),this.name=t||"",this._prefix="[".concat(this.name,"]"),this.logCacheLevel=(null==r?void 0:r.logCacheLevel)||3,this.logMaxSize=(null==r?void 0:r.logMaxSize)||LOG_MAX_SIZE,this.logSize=0,this.logTextArray=[]}return _createClass(e,[{key:"debug",value:function(){for(var t,r,n,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];this.logCache.apply(this,_concatInstanceProperty(t=[LogCacheLevel.DEBUG]).call(t,i)),e.disabled||(n=console).debug.apply(n,_concatInstanceProperty(r=["[".concat(nowTime(),"]"),this._prefix]).call(r,i))}},{key:"log",value:function(){for(var t,r,n,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];this.logCache.apply(this,_concatInstanceProperty(t=[LogCacheLevel.LOG]).call(t,i)),e.disabled||(n=console).log.apply(n,_concatInstanceProperty(r=["[".concat(nowTime(),"]"),this._prefix]).call(r,i))}},{key:"warn",value:function(){for(var t,r,n,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];this.logCache.apply(this,_concatInstanceProperty(t=[LogCacheLevel.WARN]).call(t,i)),e.disabled||(n=console).warn.apply(n,_concatInstanceProperty(r=["[".concat(nowTime(),"]"),this._prefix]).call(r,i))}},{key:"error",value:function(){for(var t,r,n,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];this.logCache.apply(this,_concatInstanceProperty(t=[LogCacheLevel.ERROR]).call(t,i)),e.disabled||(n=console).error.apply(n,_concatInstanceProperty(r=["[".concat(nowTime(),"]"),this._prefix]).call(r,i))}},{key:"logCache",value:function(e){if(!(e<this.logCacheLevel)){var t="";try{for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];var i=_mapInstanceProperty(n).call(n,(function(e){return logable(e)}));t="[".concat(nowTime(),"]")+this._prefix+_JSON$stringify(i)}catch(e){return}if(e>=this.logCacheLevel&&(this.logSize+=t.length,this.logTextArray.push(t)),this.logSize>this.logMaxSize){var a=this.logTextArray.shift();this.logSize-=a.length}}}},{key:"getLogCache",value:function(){var e=this.logTextArray.join("\n");return this.reset(),e}},{key:"reset",value:function(){this.logTextArray=[],this.logSize=0}},{key:"table",value:function(){var t;e.disabled||(console.group(this._prefix),(t=console).table.apply(t,arguments),console.groupEnd())}},{key:"setLogLevel",value:function(e){this.logCacheLevel=e}}],[{key:"enable",value:function(){e.disabled=!1}},{key:"disable",value:function(){e.disabled=!0}}]),e}();function nowTime(){return(new Date).toLocaleString()}function reduceDepth(e){var t;if("object"!==_typeof(e))return e;var r=_sliceInstanceProperty(t=Object.prototype.toString.call(e)).call(t,8,-1);switch(r){case"Array":case"Uint8Array":case"ArrayBuffer":return r+"["+e.length+"]";case"Object":return"{}";default:return r}}function logable(e,t,r){var n;r||(r=1),t||(t=2);var o={};if(!e||"object"!==_typeof(e))return e;var i=_sliceInstanceProperty(n=Object.prototype.toString.call(e)).call(n,8,-1);if(!_includesInstanceProperty(SIMPLE_TYPE).call(SIMPLE_TYPE,i))return i;if(!(r>t)){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(r===t?o[a]=reduceDepth(e[a]):"object"===_typeof(e[a])?o[a]=logable(e[a],t,r+1):o[a]=e[a]);return o}}function createPublicPromise(){var e,t,r=new _Promise((function(r,n){e=r,t=n}));return r.used=!1,r.resolve=function(){return r.used=!0,e.apply(void 0,arguments)},r.reject=function(){return r.used=!0,t.apply(void 0,arguments)},r}_defineProperty(Logger,"disabled",!0);var AUDIO=new Blob([new Uint8Array([255,227,24,196,0,0,0,3,72,1,64,0,0,4,132,16,31,227,192,225,76,255,67,12,255,221,27,255,228,97,73,63,255,195,131,69,192,232,223,255,255,207,102,239,255,255,255,101,158,206,70,20,59,255,254,95,70,149,66,4,16,128,0,2,2,32,240,138,255,36,106,183,255,227,24,196,59,11,34,62,80,49,135,40,0,253,29,191,209,200,141,71,7,255,252,152,74,15,130,33,185,6,63,255,252,195,70,203,86,53,15,255,255,247,103,76,121,64,32,47,255,34,227,194,209,138,76,65,77,69,51,46,57,55,170,170,170,170,170,170,170,170,170,170,255,227,24,196,73,13,153,210,100,81,135,56,0,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170])],{type:"audio/mpeg"}),VIDEO=new Blob([new Uint8Array([0,0,0,28,102,116,121,112,105,115,111,109,0,0,2,0,105,115,111,109,105,115,111,50,109,112,52,49,0,0,0,8,102,114,101,101,0,0,2,239,109,100,97,116,33,16,5,32,164,27,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,167,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,33,16,5,32,164,27,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,167,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,0,0,2,194,109,111,111,118,0,0,0,108,109,118,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,232,0,0,0,47,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,1,236,116,114,97,107,0,0,0,92,116,107,104,100,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,47,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,101,100,116,115,0,0,0,28,101,108,115,116,0,0,0,0,0,0,0,1,0,0,0,47,0,0,0,0,0,1,0,0,0,0,1,100,109,100,105,97,0,0,0,32,109,100,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,68,0,0,8,0,85,196,0,0,0,0,0,45,104,100,108,114,0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0,0,0,1,15,109,105,110,102,0,0,0,16,115,109,104,100,0,0,0,0,0,0,0,0,0,0,0,36,100,105,110,102,0,0,0,28,100,114,101,102,0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1,0,0,0,211,115,116,98,108,0,0,0,103,115,116,115,100,0,0,0,0,0,0,0,1,0,0,0,87,109,112,52,97,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,16,0,0,0,0,172,68,0,0,0,0,0,51,101,115,100,115,0,0,0,0,3,128,128,128,34,0,2,0,4,128,128,128,20,64,21,0,0,0,0,1,244,0,0,1,243,249,5,128,128,128,2,18,16,6,128,128,128,1,2,0,0,0,24,115,116,116,115,0,0,0,0,0,0,0,1,0,0,0,2,0,0,4,0,0,0,0,28,115,116,115,99,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,28,115,116,115,122,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,115,0,0,1,116,0,0,0,20,115,116,99,111,0,0,0,0,0,0,0,1,0,0,0,44,0,0,0,98,117,100,116,97,0,0,0,90,109,101,116,97,0,0,0,0,0,0,0,33,104,100,108,114,0,0,0,0,0,0,0,0,109,100,105,114,97,112,112,108,0,0,0,0,0,0,0,0,0,0,0,0,45,105,108,115,116,0,0,0,37,169,116,111,111,0,0,0,29,100,97,116,97,0,0,0,1,0,0,0,0,76,97,118,102,53,54,46,52,48,46,49,48,49])],{type:"video/mp4"});function setupDefaultValues(e){return _Object$assign({muted:!1,timeout:250,inline:!1},e)}function startPlayback(e,t){var r=e.muted,n=e.timeout,o=e.inline,i=t(),a=i.element,s=i.source,l=void 0,c=void 0,u=void 0;return a.muted=r,!0===r&&a.setAttribute("muted","muted"),!0===o&&a.setAttribute("playsinline","playsinline"),a.src=s,new _Promise((function(e){l=a.play(),c=_setTimeout((function(){u(!1,new Error("Timeout "+n+" ms has been reached"))}),n),u=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;a.remove(),a.srcObject=null,clearTimeout(c),e({result:t,error:r})},void 0!==l?l.then((function(){return u(!0)})).catch((function(e){return u(!1,e)})):u(!0)}))}function video(e){return startPlayback(e=setupDefaultValues(e),(function(){return{element:document.createElement("video"),source:_URL.createObjectURL(VIDEO)}}))}function audio(e){return startPlayback(e=setupDefaultValues(e),(function(){return{element:document.createElement("audio"),source:_URL.createObjectURL(AUDIO)}}))}var index={audio:audio,video:video},logger$2=new Logger("AdsPluginBaseAdManager"),BaseAdManager=function(e){_inherits$1(r,eventemitter3Exports.EventEmitter);var t=_createSuper$1(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck$2(this,r),(e=t.call(this)).options=n,e.config=n.config||{},e.plugin=n.plugin,e.player=n.plugin.player,e.mediaElement=e.player.media||e.player.video,e.isLinearAdRunning=!1,e._shouldBlockVideoContent=!1,e._isAdPaused=!0,e._isMediaEnded=!1,e.context={currentTime:0,duration:0},e}return _createClass$2(r,[{key:"currentTime",get:function(){return this.context.currentTime}},{key:"duration",get:function(){return this.context.duration}},{key:"paused",get:function(){return this._isAdPaused}},{key:"shouldBlockVideoContent",get:function(){return this.isLinearAdRunning||this._shouldBlockVideoContent},set:function(e){this._shouldBlockVideoContent=e}},{key:"updateConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e?this.config=_objectSpread2$2(_objectSpread2$2({},this.config),e):logger$2.warn("config is empty")}},{key:"isFullScreen",value:function(){return!!this.player.fullscreen}},{key:"destroy",value:function(){this.removeAllListeners()}},{key:"tryContentPlay",value:function(){var e=this.player,t=e.play();void 0!==t&&t&&t.then?t.then((function(){logger$2.log("content play"),e.removeClass(STATE_CLASS.NOT_ALLOW_AUTOPLAY),e.addClass(STATE_CLASS.PLAYING),e.state<STATES.RUNNING&&(e.setState(STATES.RUNNING),e.emit(AUTOPLAY_STARTED))})).catch((function(t){if(logger$2.error("content play error",t),e.media&&e.media.error)return e.onError(),void e.removeClass(STATE_CLASS.ENTER)})):e.state<STATES.RUNNING&&(e.setState(STATES.RUNNING),e.removeClass(STATE_CLASS.NOT_ALLOW_AUTOPLAY),e.removeClass(STATE_CLASS.NO_START),e.removeClass(STATE_CLASS.ENTER),e.addClass(STATE_CLASS.PLAYING),e.emit(AUTOPLAY_STARTED))}}]),r}(),logger$1=new Logger("AdsPluginImaAdManager"),CLASS_NAME="xgplayer-ads-playing",ImaAdManager=function(e){_inherits$1(i,BaseAdManager);var t,r,n,o=_createSuper$1(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck$2(this,i),_defineProperty$2(_assertThisInitialized$1(e=o.call(this,t)),"_onMediaEnded",(function(){var t;e.isLinearAdRunning||(e._isMediaEnded=!0,null===(t=e.adsLoader)||void 0===t||t.contentComplete())})),_defineProperty$2(_assertThisInitialized$1(e),"_onMediaResize",(function(){var t,r=_assertThisInitialized$1(e).player,n=e.isFullScreen()?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL;null===(t=e.adsManager)||void 0===t||t.resize(r.sizeInfo.width,r.sizeInfo.height,n)})),_defineProperty$2(_assertThisInitialized$1(e),"_onMediaPlay",(function(){e._mediaPlayed=!0})),_defineProperty$2(_assertThisInitialized$1(e),"_onMediaPause",(function(){e._mediaPlayed=!1})),_defineProperty$2(_assertThisInitialized$1(e),"_onMediaVolumeChange",(function(){var t;null===(t=e.adsManager)||void 0===t||t.setVolume(e.player.muted?0:e.player.volume)})),_defineProperty$2(_assertThisInitialized$1(e),"_onAdsManagerLoaded",(function(t){var r=new google.ima.AdsRenderingSettings;r.restoreCustomPlaybackStateOnAdBreakComplete=!0,r.enablePreloading=!0;var n=e.adsManager=t.getAdsManager(e.mediaElement,r);logger$1.log("AdManager Loaded",n);var o=n.getCuePoints();o.length&&logger$1.log("cuePoints",o),e._initAdsManagerEventListeners(),e.player.emit(IMA_AD_MANAGER_READY,{adsManager:n})})),_defineProperty$2(_assertThisInitialized$1(e),"_onAdsManagerAdError",(function(t){e._handleAdError(t.getError()),e._resumeContent()})),_defineProperty$2(_assertThisInitialized$1(e),"_onAdsLoaderAdError",(function(t){e._handleAdError(t.getError())})),_defineProperty$2(_assertThisInitialized$1(e),"_handleAdError",(function(t){var r,n,o;logger$1.log("AdError",t),e.shouldBlockVideoContent=!1,e.isLinearAdRunning=!1,null===(r=e.adsManager)||void 0===r||r.destroy(),null===(n=e.plugin)||void 0===n||n.emit(IMA_AD_ERROR,t),null===(o=e.plugin)||void 0===o||o.emit(AD_ERROR,t)})),_defineProperty$2(_assertThisInitialized$1(e),"onAdEvent",(function(t){var r,n=_assertThisInitialized$1(e).player,o=null==t?void 0:t.getAd(),i=(null==t?void 0:t.getAdData())||(null==o?void 0:o.data),a=!1;switch(null==t?void 0:t.type){case google.ima.AdEvent.Type.AD_BREAK_READY:e.player.emit(IMA_AD_BREAK_READY,{ad:o});break;case google.ima.AdEvent.Type.LOADED:var s=(i||{}).adPodInfo,l=0===(null==s?void 0:s.podIndex);a=!0,l&&(o.isLinear()?e.shouldBlockVideoContent=!0:(e.shouldBlockVideoContent=!1,e.tryContentPlay())),e.emit(IMA_AD_LOADED,{ad:o,isPreroll:l}),e.plugin.emit(IMA_AD_LOADED,{ad:o,isPreroll:l});break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:if(e._resumeCallback)if(!e._resumeCallback().canResume)break;e._resumeContent(),e.emit(IMA_CONTENT_RESUME_REQUESTED,{ad:o});break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:e.isLinearAdRunning=!0,e.shouldBlockVideoContent=!0,util$3.addClass(e.player.root,CLASS_NAME),null==n||n.pause(),e.emit(IMA_CONTENT_PAUSE_REQUESTED,{ad:o});break;case google.ima.AdEvent.Type.STARTED:e.plugin.emit(AD_START,{ad:o}),o.isLinear()&&(e._isAdPaused=!1,e.plugin.emit(AD_PLAY,{ad:o}),r=_setInterval((function(){}),300));break;case google.ima.AdEvent.Type.RESUMED:e._isAdPaused=!1,e.plugin.emit(AD_PLAY,{ad:o});break;case google.ima.AdEvent.Type.PAUSED:e._isAdPaused=!0,e.plugin.emit(AD_PAUSE,{ad:o});break;case google.ima.AdEvent.Type.SKIPPED:e.plugin.emit(AD_SKIPPED,{ad:o});break;case google.ima.AdEvent.Type.AD_PROGRESS:var c=t.getAdData(),u=c.currentTime,p=c.duration;_Object$assign(e.context,{currentTime:u,duration:p}),e.plugin.emit(AD_TIME_UPDATE,{ad:o});break;case google.ima.AdEvent.Type.COMPLETE:var f=(i||{}).adPodInfo,d=!1;null!=o&&o.isLinear()&&(f&&(d=f.adPosition<f.totalAds),clearInterval(r)),e.plugin.emit(IMA_AD_COMPLETE,{ad:o,hasNextInPod:d}),e.plugin.emit(AD_COMPLETE,{ad:o,hasNextInPod:d});break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:null!=o&&o.isLinear()&&clearInterval(r),e.plugin.emit(IMA_ALL_ADS_COMPLETED,{ad:o}),e.player.emit(AD_ALL_COMPLETED,{ad:o});break;default:null!=o&&o.isLinear()&&clearInterval(r)}logger$1.log("AdEvent",null==t?void 0:t.type,a?_JSON$stringify((null==t?void 0:t.getAdData())||{}):null==t?void 0:t.getAd())})),e.displayContainer=null,e.adsLoader=null,e.adsManager=null,e._resumeCallback=null,e}return _createClass$2(i,[{key:"init",value:(n=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.shouldBlockVideoContent=!!(this.config.adTagUrl||this.config.adsResponse||this.config.adsRequest),e.prev=1,this.emit(IMA_SDK_LOAD_START),e.next=5,this._loadIMASdk();case 5:this.emit(IMA_SDK_LOAD_SUCCESS),e.next=14;break;case 8:return e.prev=8,e.t0=e.catch(1),logger$1.error("google.ima sdk is not loaded, due to error",(null===e.t0||void 0===e.t0?void 0:e.t0.message)||e.t0),this.emit(IMA_SDK_LOAD_ERROR),this.shouldBlockVideoContent=!1,e.abrupt("return");case 14:this._initConfig(),this._initMediaEvents(),this._initContainer(),this._initLoader(),this._initAdsRequest();case 19:case"end":return e.stop()}}),e,this,[[1,8]])}))),function(){return n.apply(this,arguments)})},{key:"destroy",value:function(){_get$1(_getPrototypeOf$1(i.prototype),"destroy",this).call(this),this.reset(),this.displayContainer.destroy(),this._removeMediaEvents(),this._destroyLoader()}},{key:"resumeCallback",set:function(e){this._resumeCallback=e}},{key:"_initConfig",value:function(){var e=this.config.locale;e&&google.ima.settings.setLocale(e)}},{key:"_loadIMASdk",value:function(){var e=this;return new _Promise((function(t,r){if("undefined"!=typeof google&&google.ima)t();else{var n=document.createElement("script"),o=_setTimeout((function(){r(new Error("google.ima sdk load timeout"))}),e.config.loadSdkTimeout||3e3);n.src="https://imasdk.googleapis.com/js/sdkloader/ima3".concat(e.config.debug?"_debug":"",".js"),n.onload=function(){clearTimeout(o),t()},n.onerror=function(e){clearTimeout(o),r(null==e?void 0:e.message)},document.head.appendChild(n)}}))}},{key:"_initMediaEvents",value:function(){var e=this.player;e.on(VIDEO_RESIZE,this._onMediaResize),e.on(ENDED,this._onMediaEnded),e.on(PLAY,this._onMediaPlay),e.on(PAUSE,this._onMediaPause),e.on(VOLUME_CHANGE,this._onMediaVolumeChange)}},{key:"_removeMediaEvents",value:function(){var e=this.player;e.off(VIDEO_RESIZE,this._onMediaResize),e.off(ENDED,this._onMediaEnded),e.off(PLAY,this._onMediaPlay),e.off(PAUSE,this._onMediaPause),e.off(VOLUME_CHANGE,this._onMediaVolumeChange)}},{key:"_initContainer",value:function(){var e=this.options.displayContainer;this.displayContainer=new google.ima.AdDisplayContainer(e,this.mediaElement)}},{key:"_initLoader",value:function(){var e=this.adsLoader=new google.ima.AdsLoader(this.displayContainer);e.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this._onAdsManagerLoaded,!1),e.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this._onAdsLoaderAdError,!1),this.player.emit(IMA_AD_LOADER_READY,{adsLoader:e})}},{key:"_destroyLoader",value:function(){var e=this.adsLoader;e||(e.removeEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this._onAdsManagerLoaded,!1),e.removeEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this._onAdsLoaderAdError,!1))}},{key:"_initAdsRequest",value:(r=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t,r,n,o,i=this;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.config,r=t.adsRequest,n=t.adsResponse,o=t.adTagUrl,!(r||n||o)){e.next=9;break}return e.next=4,this._checkAutoplaySupport();case 4:this.requestAds(),this.player.once(IMA_AD_MANAGER_READY,(function(){i.autoplayAllowed?i.playAds():i.player.useHooks("play",(function e(){return i.playAds(),i.player.removeHooks("play",e),!1})),i.emit(IMA_READY_TO_PLAY)})),this.player.once(IMA_AD_ERROR,(function(){i.emit(IMA_READY_TO_PLAY)})),e.next=10;break;case 9:this.emit(IMA_READY_TO_PLAY);case 10:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"playAds",value:function(){try{this._onMediaVolumeChange(),this.displayContainerInitialized||(this.displayContainer.initialize(),this.displayContainerInitialized=!0);var e=this.player,t=this.isFullScreen()?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL;this.adsManager.init(e.sizeInfo.width,e.sizeInfo.height,t),this.adsManager.start()}catch(e){this._handleAdError(e),this._resumeContent()}}},{key:"_initAdsManagerEventListeners",value:function(){var e=this,t=this.adsManager;t.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this._onAdsManagerAdError);var r=["LOADED","STARTED","RESUMED","PAUSED","COMPLETE","ALL_ADS_COMPLETED","CONTENT_PAUSE_REQUESTED","CONTENT_RESUME_REQUESTED","VOLUME_CHANGED","VOLUME_MUTED","AD_METADATA","AD_CAN_PLAY","AD_PROGRESS","AD_BUFFERING","CLICK","VIDEO_CLICKED","VIDEO_ICON_CLICKED","FIRST_QUARTILE","MIDPOINT","THIRD_QUARTILE","SKIPPED","USER_CLOSE","AD_BREAK_READY","AD_BREAK_FETCH_ERROR"];_forEachInstanceProperty(r).call(r,(function(r){t.addEventListener(google.ima.AdEvent.Type[r],e.onAdEvent)}))}},{key:"_resumeContent",value:function(){var e;(this.isLinearAdRunning=!1,this.shouldBlockVideoContent=!1,util$3.removeClass(this.player.root,CLASS_NAME),this._isMediaEnded)||(null===(e=this.player)||void 0===e||e.play())}},{key:"reset",value:function(){var e,t;this.isLinearAdRunning=!1,null===(e=this.adsManager)||void 0===e||e.destroy(),this.adsManager=null,null===(t=this.adsLoader)||void 0===t||t.contentComplete(),util$3.removeClass(this.player.root,CLASS_NAME)}},{key:"requestAds",value:function(){var e,t=this.config,r=t.adsRequest,n=t.adsResponse,o=t.adTagUrl,i=this.player,a=new google.ima.AdsRequest;if(a.linearAdSlotWidth=i.sizeInfo.width,a.linearAdSlotHeight=i.sizeInfo.height,a.nonLinearAdSlotWidth=i.sizeInfo.width,a.nonLinearAdSlotHeight=i.sizeInfo.height,a.setAdWillAutoPlay(this.autoplayAllowed),a.setAdWillPlayMuted(this.autoplayRequiresMuted),o)a.adTagUrl=o;else if(n)a.adsResponse=n;else if(r&&"object"===_typeof$2(r)){var s;_forEachInstanceProperty(s=_Object$keys(r)).call(s,(function(e){a[e]=r[e]}))}logger$1.log("requestAds",_JSON$stringify(a)),null===(e=this.adsLoader)||void 0===e||e.requestAds(a)}},{key:"pause",value:function(){var e;return null===(e=this.adsManager)||void 0===e?void 0:e.pause()}},{key:"play",value:function(){var e;return null===(e=this.adsManager)||void 0===e?void 0:e.resume()}},{key:"skip",value:function(){var e;return null===(e=this.adsManager)||void 0===e?void 0:e.skip()}},{key:"updateConfig",value:function(e){_get$1(_getPrototypeOf$1(i.prototype),"updateConfig",this).call(this,e),this._initConfig()}},{key:"_checkAutoplaySupport",value:(t=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t,r,n,o,i;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.player.config.autoplay,e.next=4,_Promise.all([t?index.video({timeout:800}).then((function(e){return e.result})):_Promise.resolve(!1),t&&this.player.config.autoplayMuted?index.video({timeout:800,muted:!0}).then((function(e){return e.result})):_Promise.resolve(!1)]);case 4:r=e.sent,n=_slicedToArray$1(r,2),o=n[0],i=n[1],this.autoplayAllowed=o||i,this.autoplayRequiresMuted=!o&&i,logger$1.log("checkAutoplaySupport",this.autoplayAllowed,this.autoplayRequiresMuted);case 11:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),i}(),AD_STATE_CLASS={START:"xgplayer-ad-start",UI_SHOW:"xgplayer-ad-show-ui"},AdPlayIcon=function(e){_inherits$1(r,Play);var t=_createSuper$1(r);function r(){var e,n;_classCallCheck$2(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return _defineProperty$2(_assertThisInitialized$1(n=t.call.apply(t,_concatInstanceProperty(e=[this]).call(e,i))),"btnClick",(function(e){e.preventDefault(),e.stopPropagation();var t=n.getAdPlugin();return t.paused?(t.play(),n.animate(!1)):(t.pause(),n.animate(!0)),!1})),n}return _createClass$2(r,[{key:"getAdPlugin",value:function(){return this.player.getPlugin("ad")}},{key:"listenEvents",value:function(){var e=this;this.on([AD_PAUSE],(function(){e.animate(!0)})),this.on(AD_PLAY,(function(){e.animate(!1)}))}}],[{key:"pluginName",get:function(){return"adPlay"}}]),r}(),AdProgress=function(e){_inherits$1(r,Progress);var t=_createSuper$1(r);function r(){return _classCallCheck$2(this,r),t.apply(this,arguments)}return _createClass$2(r,[{key:"getAdPlugin",value:function(){return this.player.getPlugin("ad")}},{key:"duration",get:function(){var e=this.getAdPlugin();return(null==e?void 0:e.duration)||0}},{key:"offsetDuration",get:function(){return this.duration}},{key:"timeOffset",get:function(){return 0}},{key:"currentTime",get:function(){var e=this.getAdPlugin();return(null==e?void 0:e.currentTime)||0}},{key:"afterCreate",value:function(){_Object$assign(this.config,{isCloseClickSeek:!0,isDraggingSeek:!0,closeMoveSeek:!0}),_get$1(_getPrototypeOf$1(r.prototype),"afterCreate",this).call(this)}},{key:"listenEvents",value:function(){var e=this;this.on(AD_TIME_UPDATE,(function(){e.onTimeupdate()}))}}],[{key:"pluginName",get:function(){return"adProgress"}}]),r}(),AdTimeIcon=function(e){_inherits$1(r,Time);var t=_createSuper$1(r);function r(){return _classCallCheck$2(this,r),t.apply(this,arguments)}return _createClass$2(r,[{key:"getAdPlugin",value:function(){return this.player.getPlugin("ad")}},{key:"duration",get:function(){var e=this.getAdPlugin();return(null==e?void 0:e.duration)||0}},{key:"currentTime",get:function(){var e=this.getAdPlugin();return(null==e?void 0:e.currentTime)||0}},{key:"listenEvents",value:function(){var e=this;this.on([AD_TIME_UPDATE],(function(t){e.onTimeUpdate()}))}}],[{key:"pluginName",get:function(){return"adTime"}}]),r}(),AdUIManager=function(){function e(t,r){_classCallCheck$2(this,e);var n=r.player,o=r.plugin;this.player=n,this.config=t,this.adPlugin=o,this.adUIPlugins=[],this.fragment=document.createDocumentFragment(),this.controlsPos=null,this.decoratedAdPluginList=[[Play,AdPlayIcon],[Time,AdTimeIcon],[Progress,AdProgress],[Volume,null],[CssFullScreen,null],[Fullscreen,null]],this.init(),this.initEvents()}return _createClass$2(e,[{key:"init",value:function(){var e=this.player,t=this.adUIPlugins,r=this.fragment,n=this.decoratedAdPluginList;_forEachInstanceProperty(n).call(n,(function(n){var o=_slicedToArray$1(n,2),i=o[0],a=o[1],s=e.getPlugin(i.pluginName);if(s){var l=null;a&&!e.getPlugin(a.pluginName)&&(e.registerPlugin(a),l=e.getPlugin(a.pluginName),r.appendChild(l.root)),t.push([s,l])}}))}},{key:"destroy",value:function(){this.fragment=null,this.adUIPlugins=[],this.decoratedAdPluginList=[],this.adPlugin=null,this.player=null}},{key:"initEvents",value:function(){var e=this,t=this.adPlugin,r=this.player;t.on(AD_PLAY,(function(){var e=[STATE_CLASS.NO_START,STATE_CLASS.PAUSED,STATE_CLASS.ENDED,STATE_CLASS.ERROR,STATE_CLASS.REPLAY,STATE_CLASS.LOADING];_forEachInstanceProperty(e).call(e,(function(e){r.removeClass(e)}))})),t.on(AD_START,(function(){e.showAdContainer()})),t.on(AD_COMPLETE,(function(t){t.hasNextInPod||e.hideAdContainer()})),t.on(AD_SKIPPED,(function(){e.hideAdContainer()})),t.on(AD_ERROR,(function(){e.hideAdContainer()}))}},{key:"showAdContainer",value:function(){var e=this.player;util$3.hasClass(e.root,AD_STATE_CLASS.START)||util$3.addClass(e.root,AD_STATE_CLASS.START)}},{key:"hideAdContainer",value:function(){var e=this.player;util$3.hasClass(e.root,AD_STATE_CLASS.START)&&util$3.removeClass(e.root,AD_STATE_CLASS.START)}},{key:"showAdUI",value:function(){var e,t=this.player,r=this.config,n=this.adUIPlugins,o=this.fragment;_forEachInstanceProperty(n).call(n,(function(e){var t=_slicedToArray$1(e,2),r=t[0],n=t[1];if(n){var i=n.root,a=r.root;o.contains(i)&&o.removeChild(i),a.parentNode.insertBefore(i,a),o.appendChild(a)}}));var i=this._getNonAdPlugin();_forEachInstanceProperty(e=_filterInstanceProperty(i).call(i,(function(e){return!!e.root}))).call(e,(function(e){var t=e.root;e.__adStub__||(e.__adStub__=util$3.createDom("xg-ad-stub","",{})),t.parentNode.insertBefore(e.__adStub__,t),o.appendChild(t)}));var a=t.getPlugin("start");a&&a.hide(),!1===r.controls&&t.controls&&this.hideControls(),this.showAdContainer(),t.addClass(AD_STATE_CLASS.UI_SHOW)}},{key:"hideAdUI",value:function(){var e,t,r=this.player,n=this.config,o=this.adUIPlugins,i=this.fragment;_forEachInstanceProperty(o).call(o,(function(e){var t=_slicedToArray$1(e,2),r=t[0],n=t[1];if(n){var o=n.root,a=r.root;i.contains(a)&&i.removeChild(a),i.contains(o)||(o.parentNode.insertBefore(a,o),i.appendChild(o))}}));var a=this._getNonAdPlugin();_forEachInstanceProperty(e=_filterInstanceProperty(a).call(a,(function(e){return!!e.root}))).call(e,(function(e){var t,r,n=e.root;i.contains(n)&&i.removeChild(n),null===(t=e.__adStub__)||void 0===t||null===(r=t.parentNode)||void 0===r||r.insertBefore(n,e.__adStub__)})),!1===n.controls&&i.contains(null===(t=r.controls)||void 0===t?void 0:t.root)&&this.showControls();var s=r.getPlugin("start");if(s){var l=s.config.disableAnimate,c=s.config.isShowPause;l||(s.config.disableAnimate=!0,s.config.isShowPause=!1),r.once("play",(function(){_setTimeout((function(){s.config.disableAnimate=l,s.config.disableAnimate=c}),10)}))}r.removeClass(AD_STATE_CLASS.UI_SHOW)}},{key:"hideControls",value:function(){var e=this.player,t=this.config,r=this.fragment;if(!1===t.controls&&e.controls){var n=e.controls.root,o=n.parentElement,i=n.previousSibling,a=n.nextSibling;this.controlsPos={parentNode:o,previousSibling:i,nextSibling:a},r.appendChild(e.controls.root)}}},{key:"showControls",value:function(){var e=this.player,t=this.config,r=this.fragment;if(!1===t.controls&&e.controls){if(!this.controlsPos)return;var n=e.controls.root;r.contains(n)&&r.removeChild(n);var o=this.controlsPos,i=o.parentNode,a=o.previousSibling,s=o.nextSibling;i&&(s?i.insertBefore(n,s):a?i.insertBefore(n,a.nextSibling):i.appendChild(n)),this.controlsPos=null}}},{key:"_getNonAdPlugin",value:function(){var e,t=this.player,r=this.decoratedAdPluginList,n=[];_forEachInstanceProperty(r).call(r,(function(e){var t=_slicedToArray$1(e,2),r=t[0],o=t[1];n.push(r.pluginName.toLowerCase()),o&&n.push(o.pluginName.toLowerCase())}));var o=(null===(e=t.controls)||void 0===e?void 0:e.plugins())||[];return _filterInstanceProperty(o).call(o,(function(e){return-1===_indexOfInstanceProperty(n).call(n,e.pluginName.toLowerCase())}))}}]),e}(),logger=new Logger("AdsPlugin"),AdsPlugin$1=function(e){_inherits$1(n,Plugin);var t,r=_createSuper$1(n);function n(){return _classCallCheck$2(this,n),r.apply(this,arguments)}return _createClass$2(n,[{key:"version",get:function(){return"3.0.21-rc.4"}},{key:"paused",get:function(){var e,t;return!(null===(e=this.csManager)||void 0===e||!e.isLinearAdRunning||null===(t=this.csManager)||void 0===t||!t.paused)}},{key:"currentTime",get:function(){var e;return(null===(e=this.csManager)||void 0===e?void 0:e.currentTime)||0}},{key:"duration",get:function(){var e;return(null===(e=this.csManager)||void 0===e?void 0:e.duration)||0}},{key:"afterCreate",value:function(){var e=this.config;logger.log("plugin afterCreate, config: ".concat(_JSON$stringify(e||{}))),this.csManager=void 0,this._blockContentPlay()}},{key:"beforePlayerInit",value:function(){switch(logger.log("plugin beforePlayerInit"),this.initPromise=createPublicPromise(),this.uiManager=new AdUIManager(this.config,{plugin:this,player:this.player}),this.config.adType){case"ima":case"google-ima":this._initClientSideAd()}return this.initPromise}},{key:"render",value:function(){return util$3.createDom("xg-ad","",{},"xgplayer-ads")}},{key:"_initClientSideAd",value:function(){switch(this.config.adType){case"ima":case"google-ima":this._initImaAd()}}},{key:"_initImaAd",value:(t=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t=this;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.csManager=new ImaAdManager({plugin:this,config:this.config.ima,displayContainer:this.root}),this.csManager.once(IMA_SDK_LOAD_START,(function(){t.uiManager.showAdContainer()})),this.csManager.on(IMA_SDK_LOAD_ERROR,(function(){t.uiManager.hideAdContainer()})),this.csManager.once(IMA_AD_LOADED,(function(e){e.isPreroll||t.uiManager.hideAdContainer()})),this.csManager.once(IMA_READY_TO_PLAY,(function(){var e;null===(e=t.initPromise)||void 0===e||e.resolve()})),this.csManager.on(IMA_CONTENT_PAUSE_REQUESTED,(function(){t.uiManager.showAdUI()})),this.csManager.on(IMA_CONTENT_RESUME_REQUESTED,(function(){t.uiManager.hideAdUI()})),e.next=9,this.csManager.init();case 9:return e.abrupt("return",this.csManager);case 10:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"requestAds",value:function(){var e;null===(e=this.csManager)||void 0===e||e.requestAds()}},{key:"playAds",value:function(){var e;null===(e=this.csManager)||void 0===e||e.playAds()}},{key:"pause",value:function(){var e;null===(e=this.csManager)||void 0===e||e.pause()}},{key:"play",value:function(){var e;null===(e=this.csManager)||void 0===e||e.play()}},{key:"destroy",value:function(){var e,t;this.offAll(),null===(e=this.csManager)||void 0===e||e.destroy(),null===(t=this.uiManager)||void 0===t||t.destroy()}},{key:"reset",value:function(){var e;null===(e=this.csManager)||void 0===e||e.reset()}},{key:"updateConfig",value:function(e){var t;null===(t=this.csManager)||void 0===t||t.updateConfig(e)}},{key:"_blockContentPlay",value:function(){var e=this,t=this.player;t.on("play",(function(){var r;null!==(r=e.csManager)&&void 0!==r&&r.shouldBlockVideoContent&&(logger.log("block content play"),t.pause())}))}}],[{key:"pluginName",get:function(){return"ad"}}]),n}();function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _unsupportedIterableToArray(e,t){var r;if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=_sliceInstanceProperty$1(r=Object.prototype.toString.call(e)).call(r,8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?_Array$from$1(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _createForOfIteratorHelper(e,t){var r=void 0!==_Symbol$1&&_getIteratorMethod$1(e)||e["@@iterator"];if(!r){if(_Array$isArray$1(e)||(r=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}var scte35={},descriptors$1={},util$2={};!function(e){_Object$defineProperty(e,"__esModule",{value:!0}),e.shiftThirtyTwoBits=e.THIRTY_TWO_BIT_MULTIPLIER=e.bytesToUUID=void 0;e.bytesToUUID=function(e){if(16!==e.length)throw new Error("scte35-js Uint8Array uuid bad size: ".concat(e.length));return _mapInstanceProperty([]).call(e,(function(e,t){var r=(e<=15?"0":"")+e.toString(16);return t>=4&&t<=10&&t%2==0?"-"+r:r})).join("")},e.THIRTY_TWO_BIT_MULTIPLIER=Math.pow(2,32);e.shiftThirtyTwoBits=function(t){return t*e.THIRTY_TWO_BIT_MULTIPLIER}}(util$2),_Object$defineProperty(descriptors$1,"__esModule",{value:!0}),descriptors$1.parseDescriptor=descriptors$1.SegmentationMessage=void 0;var SegmentationMessage,util$1=util$2;!function(e){e[e.RESTRICT_GROUP_0=0]="RESTRICT_GROUP_0",e[e.RESTRICT_GROUP_1=1]="RESTRICT_GROUP_1",e[e.RESTRICT_GROUP_2=2]="RESTRICT_GROUP_2",e[e.NONE=3]="NONE"}(SegmentationMessage||(descriptors$1.SegmentationMessage=SegmentationMessage={}));var spliceDescriptor=function(e){var t={},r=0;for(t.spliceDescriptorTag=e.getUint8(r++),t.descriptorLength=e.getUint8(r++),t.identifier="";t.identifier.length<4;)t.identifier+=String.fromCharCode(e.getUint8(r++));return t},parseDescriptor=function(e){var t,r=spliceDescriptor(e),n=6;if(0===r.spliceDescriptorTag)n=r.descriptorLength+2,console.warn("scte35-js TODO: support spliceDescriptorTag: SpliceDescriptorTag.AVAIL_DESCRIPTOR");else if(1===r.spliceDescriptorTag)n=r.descriptorLength+2,console.warn("scte35-js TODO: support spliceDescriptorTag: SpliceDescriptorTag.DTMF_DESCRIPTOR");else if(2===r.spliceDescriptorTag){var o=r;if(o.segmentationEventId=e.getUint32(n),n+=4,o.segmentationEventCancelIndicator=!!(128&e.getUint8(n++)),!o.segmentationEventCancelIndicator){var i=e.getUint8(n++);o.programSegmentationFlag=!!(128&i),o.segmentationDurationFlag=!!(64&i),o.deliveryNotRestrictedFlag=!!(32&i),o.deliveryNotRestrictedFlag||(o.webDeliveryAllowedFlag=!!(16&i),o.noRegionalBlackoutFlag=!!(8&i),o.archiveAllowedFlag=!!(4&i),o.deviceRestrictions=3&i),o.programSegmentationFlag||(o.componentCount=e.getUint8(n++),console.warn("scte35-js TODO: segmentationDescriptor.componentCount: "+o.componentCount),n+=6*o.componentCount),o.segmentationDurationFlag&&(o.segmentationDuration=util$1.shiftThirtyTwoBits(e.getUint8(n++)),o.segmentationDuration+=e.getUint32(n),n+=4),o.segmentationUpidType=e.getUint8(n++),o.segmentationUpidLength=e.getUint8(n++);var a=o.segmentationUpidLength;for(o.segmentationUpid=new Uint8Array(a);a>=0;)a--,o.segmentationUpid[a]=e.getUint8(n+a);n+=o.segmentationUpidLength,o.segmentationTypeId=e.getUint8(n++),o.segmentNum=e.getUint8(n++),o.segmentsExpected=e.getUint8(n++),n<r.descriptorLength+2&&(52===o.segmentationTypeId||54===o.segmentationTypeId)&&(o.subSegmentNum=e.getUint8(n++),o.subSegmentsExpected=e.getUint8(n++))}}else 3===r.spliceDescriptorTag?(n=r.descriptorLength+2,console.warn("scte35-js TODO: support spliceDescriptorTag: SpliceDescriptorTag.TIME_DESCRIPTOR")):(console.error("scte35-js Unrecognized spliceDescriptorTag ".concat(r.spliceDescriptorTag)),n=r.descriptorLength+2);n!==r.descriptorLength+2&&console.error(_concatInstanceProperty(t="scte35-js Error reading descriptor offset @".concat(n," of ")).call(t,r.descriptorLength+2));return r};descriptors$1.parseDescriptor=parseDescriptor;var path$4=path$y,_for$5=path$4.Symbol.for,parent$k=_for$5,_for$4=parent$k,parent$j=_for$4,_for$3=parent$j,parent$i=_for$3,_for$2=parent$i,_for$1=_for$2,_for=_for$1,_Symbol$for=getDefaultExportFromCjs(_for),apply=functionApply,toIndexedObject$1=toIndexedObject$c,toIntegerOrInfinity=toIntegerOrInfinity$6,lengthOfArrayLike$1=lengthOfArrayLike$e,arrayMethodIsStrict=arrayMethodIsStrict$7,min$1=Math.min,$lastIndexOf=[].lastIndexOf,NEGATIVE_ZERO=!!$lastIndexOf&&1/[1].lastIndexOf(1,-0)<0,STRICT_METHOD=arrayMethodIsStrict("lastIndexOf"),FORCED=NEGATIVE_ZERO||!STRICT_METHOD,arrayLastIndexOf=FORCED?function(e){if(NEGATIVE_ZERO)return apply($lastIndexOf,this,arguments)||0;var t=toIndexedObject$1(this),r=lengthOfArrayLike$1(t),n=r-1;for(arguments.length>1&&(n=min$1(n,toIntegerOrInfinity(arguments[1]))),n<0&&(n=r+n);n>=0;n--)if(n in t&&t[n]===e)return n||0;return-1}:$lastIndexOf,$$5=_export,lastIndexOf$7=arrayLastIndexOf;$$5({target:"Array",proto:!0,forced:arrayLastIndexOf!==[].lastIndexOf},{lastIndexOf:arrayLastIndexOf});var entryVirtual$1=entryVirtual$o,lastIndexOf$6=entryVirtual$1("Array").lastIndexOf,isPrototypeOf$1=objectIsPrototypeOf,method$1=lastIndexOf$6,ArrayPrototype$1=Array.prototype,lastIndexOf$5=function(e){var t=e.lastIndexOf;return e===ArrayPrototype$1||isPrototypeOf$1(ArrayPrototype$1,e)&&t===ArrayPrototype$1.lastIndexOf?method$1:t},parent$h=lastIndexOf$5,lastIndexOf$4=parent$h,parent$g=lastIndexOf$4,lastIndexOf$3=parent$g,parent$f=lastIndexOf$3,lastIndexOf$2=parent$f,lastIndexOf$1=lastIndexOf$2,lastIndexOf2=lastIndexOf$1,_lastIndexOfInstanceProperty=getDefaultExportFromCjs(lastIndexOf2),toObject=toObject$f,toAbsoluteIndex=toAbsoluteIndex$6,lengthOfArrayLike=lengthOfArrayLike$e,deletePropertyOrThrow=deletePropertyOrThrow$3,min=Math.min,arrayCopyWithin=[].copyWithin||function(e,t){var r=toObject(this),n=lengthOfArrayLike(r),o=toAbsoluteIndex(e,n),i=toAbsoluteIndex(t,n),a=arguments.length>2?arguments[2]:void 0,s=min((void 0===a?n:toAbsoluteIndex(a,n))-i,n-o),l=1;for(i<o&&o<i+s&&(l=-1,i+=s-1,o+=s-1);s-- >0;)i in r?r[o]=r[i]:deletePropertyOrThrow(r,o),o+=l,i+=l;return r},$$4=_export,copyWithin$7=arrayCopyWithin;$$4({target:"Array",proto:!0},{copyWithin:copyWithin$7});var entryVirtual=entryVirtual$o,copyWithin$6=entryVirtual("Array").copyWithin,isPrototypeOf=objectIsPrototypeOf,method=copyWithin$6,ArrayPrototype=Array.prototype,copyWithin$5=function(e){var t=e.copyWithin;return e===ArrayPrototype||isPrototypeOf(ArrayPrototype,e)&&t===ArrayPrototype.copyWithin?method:t},parent$e=copyWithin$5,copyWithin$4=parent$e,parent$d=copyWithin$4,copyWithin$3=parent$d,parent$c=copyWithin$3,copyWithin$2=parent$c,copyWithin$1=copyWithin$2,copyWithin2=copyWithin$1,_copyWithinInstanceProperty=getDefaultExportFromCjs(copyWithin2),buffer={},base64Js={};base64Js.byteLength=byteLength,base64Js.toByteArray=toByteArray,base64Js.fromByteArray=fromByteArray;for(var lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i$1=0,len=code.length;i$1<len;++i$1)lookup[i$1]=code[i$1],revLookup[code.charCodeAt(i$1)]=i$1;function getLens(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=_indexOfInstanceProperty(e).call(e,"=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function byteLength(e){var t=getLens(e),r=t[0],n=t[1];return 3*(r+n)/4-n}function _byteLength(e,t,r){return 3*(t+r)/4-r}function toByteArray(e){var t,r,n=getLens(e),o=n[0],i=n[1],a=new Arr(_byteLength(e,o,i)),s=0,l=i>0?o-4:o;for(r=0;r<l;r+=4)t=revLookup[e.charCodeAt(r)]<<18|revLookup[e.charCodeAt(r+1)]<<12|revLookup[e.charCodeAt(r+2)]<<6|revLookup[e.charCodeAt(r+3)],a[s++]=t>>16&255,a[s++]=t>>8&255,a[s++]=255&t;return 2===i&&(t=revLookup[e.charCodeAt(r)]<<2|revLookup[e.charCodeAt(r+1)]>>4,a[s++]=255&t),1===i&&(t=revLookup[e.charCodeAt(r)]<<10|revLookup[e.charCodeAt(r+1)]<<4|revLookup[e.charCodeAt(r+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t),a}function tripletToBase64(e){return lookup[e>>18&63]+lookup[e>>12&63]+lookup[e>>6&63]+lookup[63&e]}function encodeChunk(e,t,r){for(var n,o=[],i=t;i<r;i+=3)n=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),o.push(tripletToBase64(n));return o.join("")}function fromByteArray(e){for(var t,r=e.length,n=r%3,o=[],i=16383,a=0,s=r-n;a<s;a+=i)o.push(encodeChunk(e,a,a+i>s?s:a+i));return 1===n?(t=e[r-1],o.push(lookup[t>>2]+lookup[t<<4&63]+"==")):2===n&&(t=(e[r-2]<<8)+e[r-1],o.push(lookup[t>>10]+lookup[t>>4&63]+lookup[t<<2&63]+"=")),o.join("")}revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63;var ieee754={
|
|
1
|
+
var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var check=function(e){return e&&e.Math==Math&&e},global$s=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof commonjsGlobal&&commonjsGlobal)||function(){return this}()||commonjsGlobal||Function("return this")(),fails$B=function(e){try{return!!e()}catch(e){return!0}},fails$A=fails$B,functionBindNative=!fails$A((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),NATIVE_BIND$4=functionBindNative,FunctionPrototype$3=Function.prototype,apply$7=FunctionPrototype$3.apply,call$r=FunctionPrototype$3.call,functionApply="object"==typeof Reflect&&Reflect.apply||(NATIVE_BIND$4?call$r.bind(apply$7):function(){return call$r.apply(apply$7,arguments)}),NATIVE_BIND$3=functionBindNative,FunctionPrototype$2=Function.prototype,call$q=FunctionPrototype$2.call,uncurryThisWithBind=NATIVE_BIND$3&&FunctionPrototype$2.bind.bind(call$q,call$q),functionUncurryThis=NATIVE_BIND$3?uncurryThisWithBind:function(e){return function(){return call$q.apply(e,arguments)}},uncurryThis$D=functionUncurryThis,toString$h=uncurryThis$D({}.toString),stringSlice$5=uncurryThis$D("".slice),classofRaw$2=function(e){return stringSlice$5(toString$h(e),8,-1)},classofRaw$1=classofRaw$2,uncurryThis$C=functionUncurryThis,functionUncurryThisClause=function(e){if("Function"===classofRaw$1(e))return uncurryThis$C(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$q=$documentAll$1.IS_HTMLDDA?function(e){return"function"==typeof e||e===documentAll$1}:function(e){return"function"==typeof e},objectGetOwnPropertyDescriptor={},fails$z=fails$B,descriptors$2=!fails$z((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),NATIVE_BIND$2=functionBindNative,call$p=Function.prototype.call,functionCall=NATIVE_BIND$2?call$p.bind(call$p):function(){return call$p.apply(call$p,arguments)},objectPropertyIsEnumerable={},$propertyIsEnumerable$2={}.propertyIsEnumerable,getOwnPropertyDescriptor$b=Object.getOwnPropertyDescriptor,NASHORN_BUG=getOwnPropertyDescriptor$b&&!$propertyIsEnumerable$2.call({1:2},1);objectPropertyIsEnumerable.f=NASHORN_BUG?function(e){var t=getOwnPropertyDescriptor$b(this,e);return!!t&&t.enumerable}:$propertyIsEnumerable$2;var match,version,createPropertyDescriptor$8=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},uncurryThis$B=functionUncurryThis,fails$y=fails$B,classof$e=classofRaw$2,$Object$4=Object,split$3=uncurryThis$B("".split),indexedObject=fails$y((function(){return!$Object$4("z").propertyIsEnumerable(0)}))?function(e){return"String"==classof$e(e)?split$3(e,""):$Object$4(e)}:$Object$4,isNullOrUndefined$6=function(e){return null==e},isNullOrUndefined$5=isNullOrUndefined$6,$TypeError$k=TypeError,requireObjectCoercible$8=function(e){if(isNullOrUndefined$5(e))throw $TypeError$k("Can't call method on "+e);return e},IndexedObject$3=indexedObject,requireObjectCoercible$7=requireObjectCoercible$8,toIndexedObject$c=function(e){return IndexedObject$3(requireObjectCoercible$7(e))},isCallable$p=isCallable$q,$documentAll=documentAll_1,documentAll=$documentAll.all,isObject$l=$documentAll.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:isCallable$p(e)||e===documentAll}:function(e){return"object"==typeof e?null!==e:isCallable$p(e)},path$z={},path$y=path$z,global$r=global$s,isCallable$o=isCallable$q,aFunction=function(e){return isCallable$o(e)?e:void 0},getBuiltIn$h=function(e,t){return arguments.length<2?aFunction(path$y[e])||aFunction(global$r[e]):path$y[e]&&path$y[e][t]||global$r[e]&&global$r[e][t]},uncurryThis$A=functionUncurryThis,objectIsPrototypeOf=uncurryThis$A({}.isPrototypeOf),engineUserAgent="undefined"!=typeof navigator&&String(navigator.userAgent)||"",global$q=global$s,userAgent$6=engineUserAgent,process$4=global$q.process,Deno$1=global$q.Deno,versions=process$4&&process$4.versions||Deno$1&&Deno$1.version,v8=versions&&versions.v8;v8&&(version=(match=v8.split("."))[0]>0&&match[0]<4?1:+(match[0]+match[1])),!version&&userAgent$6&&(!(match=userAgent$6.match(/Edge\/(\d+)/))||match[1]>=74)&&(match=userAgent$6.match(/Chrome\/(\d+)/))&&(version=+match[1]);var engineV8Version=version,V8_VERSION$3=engineV8Version,fails$x=fails$B,global$p=global$s,$String$5=global$p.String,symbolConstructorDetection=!!Object.getOwnPropertySymbols&&!fails$x((function(){var e=Symbol();return!$String$5(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&V8_VERSION$3&&V8_VERSION$3<41})),NATIVE_SYMBOL$5=symbolConstructorDetection,useSymbolAsUid=NATIVE_SYMBOL$5&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,getBuiltIn$g=getBuiltIn$h,isCallable$n=isCallable$q,isPrototypeOf$r=objectIsPrototypeOf,USE_SYMBOL_AS_UID$1=useSymbolAsUid,$Object$3=Object,isSymbol$5=USE_SYMBOL_AS_UID$1?function(e){return"symbol"==typeof e}:function(e){var t=getBuiltIn$g("Symbol");return isCallable$n(t)&&isPrototypeOf$r(t.prototype,$Object$3(e))},$String$4=String,tryToString$7=function(e){try{return $String$4(e)}catch(e){return"Object"}},isCallable$m=isCallable$q,tryToString$6=tryToString$7,$TypeError$j=TypeError,aCallable$j=function(e){if(isCallable$m(e))return e;throw $TypeError$j(tryToString$6(e)+" is not a function")},aCallable$i=aCallable$j,isNullOrUndefined$4=isNullOrUndefined$6,getMethod$3=function(e,t){var r=e[t];return isNullOrUndefined$4(r)?void 0:aCallable$i(r)},call$o=functionCall,isCallable$l=isCallable$q,isObject$k=isObject$l,$TypeError$i=TypeError,ordinaryToPrimitive$1=function(e,t){var r,n;if("string"===t&&isCallable$l(r=e.toString)&&!isObject$k(n=call$o(r,e)))return n;if(isCallable$l(r=e.valueOf)&&!isObject$k(n=call$o(r,e)))return n;if("string"!==t&&isCallable$l(r=e.toString)&&!isObject$k(n=call$o(r,e)))return n;throw $TypeError$i("Can't convert object to primitive value")},shared$7={exports:{}},isPure=!0,global$o=global$s,defineProperty$e=Object.defineProperty,defineGlobalProperty$1=function(e,t){try{defineProperty$e(global$o,e,{value:t,configurable:!0,writable:!0})}catch(r){global$o[e]=t}return t},global$n=global$s,defineGlobalProperty=defineGlobalProperty$1,SHARED="__core-js_shared__",store$3=global$n[SHARED]||defineGlobalProperty(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.30.2",mode:"pure",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.30.2/LICENSE",source:"https://github.com/zloirock/core-js"});var sharedExports=shared$7.exports,requireObjectCoercible$6=requireObjectCoercible$8,$Object$2=Object,toObject$f=function(e){return $Object$2(requireObjectCoercible$6(e))},uncurryThis$z=functionUncurryThis,toObject$e=toObject$f,hasOwnProperty=uncurryThis$z({}.hasOwnProperty),hasOwnProperty_1=Object.hasOwn||function(e,t){return hasOwnProperty(toObject$e(e),t)},uncurryThis$y=functionUncurryThis,id$1=0,postfix=Math.random(),toString$g=uncurryThis$y(1..toString),uid$4=function(e){return"Symbol("+(void 0===e?"":e)+")_"+toString$g(++id$1+postfix,36)},global$m=global$s,shared$6=sharedExports,hasOwn$j=hasOwnProperty_1,uid$3=uid$4,NATIVE_SYMBOL$4=symbolConstructorDetection,USE_SYMBOL_AS_UID=useSymbolAsUid,Symbol$5=global$m.Symbol,WellKnownSymbolsStore$2=shared$6("wks"),createWellKnownSymbol=USE_SYMBOL_AS_UID?Symbol$5.for||Symbol$5:Symbol$5&&Symbol$5.withoutSetter||uid$3,wellKnownSymbol$q=function(e){return hasOwn$j(WellKnownSymbolsStore$2,e)||(WellKnownSymbolsStore$2[e]=NATIVE_SYMBOL$4&&hasOwn$j(Symbol$5,e)?Symbol$5[e]:createWellKnownSymbol("Symbol."+e)),WellKnownSymbolsStore$2[e]},call$n=functionCall,isObject$j=isObject$l,isSymbol$4=isSymbol$5,getMethod$2=getMethod$3,ordinaryToPrimitive=ordinaryToPrimitive$1,wellKnownSymbol$p=wellKnownSymbol$q,$TypeError$h=TypeError,TO_PRIMITIVE=wellKnownSymbol$p("toPrimitive"),toPrimitive$7=function(e,t){if(!isObject$j(e)||isSymbol$4(e))return e;var r,n=getMethod$2(e,TO_PRIMITIVE);if(n){if(void 0===t&&(t="default"),r=call$n(n,e,t),!isObject$j(r)||isSymbol$4(r))return r;throw $TypeError$h("Can't convert object to primitive value")}return void 0===t&&(t="number"),ordinaryToPrimitive(e,t)},toPrimitive$6=toPrimitive$7,isSymbol$3=isSymbol$5,toPropertyKey$4=function(e){var t=toPrimitive$6(e,"string");return isSymbol$3(t)?t:t+""},global$l=global$s,isObject$i=isObject$l,document$3=global$l.document,EXISTS$1=isObject$i(document$3)&&isObject$i(document$3.createElement),documentCreateElement$1=function(e){return EXISTS$1?document$3.createElement(e):{}},DESCRIPTORS$l=descriptors$2,fails$w=fails$B,createElement$1=documentCreateElement$1,ie8DomDefine=!DESCRIPTORS$l&&!fails$w((function(){return 7!=Object.defineProperty(createElement$1("div"),"a",{get:function(){return 7}}).a})),DESCRIPTORS$k=descriptors$2,call$m=functionCall,propertyIsEnumerableModule$2=objectPropertyIsEnumerable,createPropertyDescriptor$7=createPropertyDescriptor$8,toIndexedObject$b=toIndexedObject$c,toPropertyKey$3=toPropertyKey$4,hasOwn$i=hasOwnProperty_1,IE8_DOM_DEFINE$1=ie8DomDefine,$getOwnPropertyDescriptor$2=Object.getOwnPropertyDescriptor;objectGetOwnPropertyDescriptor.f=DESCRIPTORS$k?$getOwnPropertyDescriptor$2:function(e,t){if(e=toIndexedObject$b(e),t=toPropertyKey$3(t),IE8_DOM_DEFINE$1)try{return $getOwnPropertyDescriptor$2(e,t)}catch(e){}if(hasOwn$i(e,t))return createPropertyDescriptor$7(!call$m(propertyIsEnumerableModule$2.f,e,t),e[t])};var fails$v=fails$B,isCallable$k=isCallable$q,replacement=/#|\.prototype\./,isForced$2=function(e,t){var r=data[normalize(e)];return r==POLYFILL||r!=NATIVE&&(isCallable$k(t)?fails$v(t):!!t)},normalize=isForced$2.normalize=function(e){return String(e).replace(replacement,".").toLowerCase()},data=isForced$2.data={},NATIVE=isForced$2.NATIVE="N",POLYFILL=isForced$2.POLYFILL="P",isForced_1=isForced$2,uncurryThis$x=functionUncurryThisClause,aCallable$h=aCallable$j,NATIVE_BIND$1=functionBindNative,bind$r=functionUncurryThisClause(functionUncurryThisClause.bind),functionBindContext=function(e,t){return aCallable$h(e),void 0===t?e:NATIVE_BIND$1?bind$r(e,t):function(){return e.apply(t,arguments)}},objectDefineProperty={},DESCRIPTORS$j=descriptors$2,fails$u=fails$B,v8PrototypeDefineBug=DESCRIPTORS$j&&fails$u((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),isObject$h=isObject$l,$String$3=String,$TypeError$g=TypeError,anObject$g=function(e){if(isObject$h(e))return e;throw $TypeError$g($String$3(e)+" is not an object")},DESCRIPTORS$i=descriptors$2,IE8_DOM_DEFINE=ie8DomDefine,V8_PROTOTYPE_DEFINE_BUG$1=v8PrototypeDefineBug,anObject$f=anObject$g,toPropertyKey$2=toPropertyKey$4,$TypeError$f=TypeError,$defineProperty$1=Object.defineProperty,$getOwnPropertyDescriptor$1=Object.getOwnPropertyDescriptor,ENUMERABLE="enumerable",CONFIGURABLE$1="configurable",WRITABLE="writable";objectDefineProperty.f=DESCRIPTORS$i?V8_PROTOTYPE_DEFINE_BUG$1?function(e,t,r){if(anObject$f(e),t=toPropertyKey$2(t),anObject$f(r),"function"==typeof e&&"prototype"===t&&"value"in r&&WRITABLE in r&&!r[WRITABLE]){var n=$getOwnPropertyDescriptor$1(e,t);n&&n[WRITABLE]&&(e[t]=r.value,r={configurable:CONFIGURABLE$1 in r?r[CONFIGURABLE$1]:n[CONFIGURABLE$1],enumerable:ENUMERABLE in r?r[ENUMERABLE]:n[ENUMERABLE],writable:!1})}return $defineProperty$1(e,t,r)}:$defineProperty$1:function(e,t,r){if(anObject$f(e),t=toPropertyKey$2(t),anObject$f(r),IE8_DOM_DEFINE)try{return $defineProperty$1(e,t,r)}catch(e){}if("get"in r||"set"in r)throw $TypeError$f("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var DESCRIPTORS$h=descriptors$2,definePropertyModule$4=objectDefineProperty,createPropertyDescriptor$6=createPropertyDescriptor$8,createNonEnumerableProperty$9=DESCRIPTORS$h?function(e,t,r){return definePropertyModule$4.f(e,t,createPropertyDescriptor$6(1,r))}:function(e,t,r){return e[t]=r,e},global$k=global$s,apply$6=functionApply,uncurryThis$w=functionUncurryThisClause,isCallable$j=isCallable$q,getOwnPropertyDescriptor$a=objectGetOwnPropertyDescriptor.f,isForced$1=isForced_1,path$x=path$z,bind$q=functionBindContext,createNonEnumerableProperty$8=createNonEnumerableProperty$9,hasOwn$h=hasOwnProperty_1,wrapConstructor=function(e){var t=function(r,n,o){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(r);case 2:return new e(r,n)}return new e(r,n,o)}return apply$6(e,this,arguments)};return t.prototype=e.prototype,t},_export=function(e,t){var r,n,o,i,a,s,l,c,u,p=e.target,f=e.global,d=e.stat,h=e.proto,$=f?global$k:d?global$k[p]:(global$k[p]||{}).prototype,y=f?path$x:path$x[p]||createNonEnumerableProperty$8(path$x,p,{})[p],g=y.prototype;for(i in t)n=!(r=isForced$1(f?i:p+(d?".":"#")+i,e.forced))&&$&&hasOwn$h($,i),s=y[i],n&&(l=e.dontCallGetSet?(u=getOwnPropertyDescriptor$a($,i))&&u.value:$[i]),a=n&&l?l:t[i],n&&typeof s==typeof a||(c=e.bind&&n?bind$q(a,global$k):e.wrap&&n?wrapConstructor(a):h&&isCallable$j(a)?uncurryThis$w(a):a,(e.sham||a&&a.sham||s&&s.sham)&&createNonEnumerableProperty$8(c,"sham",!0),createNonEnumerableProperty$8(y,i,c),h&&(hasOwn$h(path$x,o=p+"Prototype")||createNonEnumerableProperty$8(path$x,o,{}),createNonEnumerableProperty$8(path$x[o],i,a),e.real&&g&&(r||!g[i])&&createNonEnumerableProperty$8(g,i,a)))},classof$d=classofRaw$2,isArray$d=Array.isArray||function(e){return"Array"==classof$d(e)},ceil$1=Math.ceil,floor$4=Math.floor,mathTrunc=Math.trunc||function(e){var t=+e;return(t>0?floor$4:ceil$1)(t)},trunc2=mathTrunc,toIntegerOrInfinity$6=function(e){var t=+e;return t!=t||0===t?0:trunc2(t)},toIntegerOrInfinity$5=toIntegerOrInfinity$6,min$5=Math.min,toLength$3=function(e){return e>0?min$5(toIntegerOrInfinity$5(e),9007199254740991):0},toLength$2=toLength$3,lengthOfArrayLike$e=function(e){return toLength$2(e.length)},$TypeError$e=TypeError,MAX_SAFE_INTEGER=9007199254740991,doesNotExceedSafeInteger$3=function(e){if(e>MAX_SAFE_INTEGER)throw $TypeError$e("Maximum allowed index exceeded");return e},toPropertyKey$1=toPropertyKey$4,definePropertyModule$3=objectDefineProperty,createPropertyDescriptor$5=createPropertyDescriptor$8,createProperty$6=function(e,t,r){var n=toPropertyKey$1(t);n in e?definePropertyModule$3.f(e,n,createPropertyDescriptor$5(0,r)):e[n]=r},wellKnownSymbol$o=wellKnownSymbol$q,TO_STRING_TAG$4=wellKnownSymbol$o("toStringTag"),test$2={};test$2[TO_STRING_TAG$4]="z";var toStringTagSupport="[object z]"===String(test$2),TO_STRING_TAG_SUPPORT$2=toStringTagSupport,isCallable$i=isCallable$q,classofRaw=classofRaw$2,wellKnownSymbol$n=wellKnownSymbol$q,TO_STRING_TAG$3=wellKnownSymbol$n("toStringTag"),$Object$1=Object,CORRECT_ARGUMENTS="Arguments"==classofRaw(function(){return arguments}()),tryGet=function(e,t){try{return e[t]}catch(e){}},classof$c=TO_STRING_TAG_SUPPORT$2?classofRaw:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=tryGet(t=$Object$1(e),TO_STRING_TAG$3))?r:CORRECT_ARGUMENTS?classofRaw(t):"Object"==(n=classofRaw(t))&&isCallable$i(t.callee)?"Arguments":n},uncurryThis$v=functionUncurryThis,isCallable$h=isCallable$q,store$1=sharedStore,functionToString=uncurryThis$v(Function.toString);isCallable$h(store$1.inspectSource)||(store$1.inspectSource=function(e){return functionToString(e)});var inspectSource$2=store$1.inspectSource,uncurryThis$u=functionUncurryThis,fails$t=fails$B,isCallable$g=isCallable$q,classof$b=classof$c,getBuiltIn$f=getBuiltIn$h,inspectSource$1=inspectSource$2,noop=function(){},empty=[],construct$7=getBuiltIn$f("Reflect","construct"),constructorRegExp=/^\s*(?:class|function)\b/,exec$4=uncurryThis$u(constructorRegExp.exec),INCORRECT_TO_STRING=!constructorRegExp.exec(noop),isConstructorModern=function(e){if(!isCallable$g(e))return!1;try{return construct$7(noop,empty,e),!0}catch(e){return!1}},isConstructorLegacy=function(e){if(!isCallable$g(e))return!1;switch(classof$b(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$4=!construct$7||fails$t((function(){var e;return isConstructorModern(isConstructorModern.call)||!isConstructorModern(Object)||!isConstructorModern((function(){e=!0}))||e}))?isConstructorLegacy:isConstructorModern,isArray$c=isArray$d,isConstructor$3=isConstructor$4,isObject$g=isObject$l,wellKnownSymbol$m=wellKnownSymbol$q,SPECIES$5=wellKnownSymbol$m("species"),$Array$3=Array,arraySpeciesConstructor$1=function(e){var t;return isArray$c(e)&&(t=e.constructor,(isConstructor$3(t)&&(t===$Array$3||isArray$c(t.prototype))||isObject$g(t)&&null===(t=t[SPECIES$5]))&&(t=void 0)),void 0===t?$Array$3:t},arraySpeciesConstructor=arraySpeciesConstructor$1,arraySpeciesCreate$3=function(e,t){return new(arraySpeciesConstructor(e))(0===t?0:t)},fails$s=fails$B,wellKnownSymbol$l=wellKnownSymbol$q,V8_VERSION$2=engineV8Version,SPECIES$4=wellKnownSymbol$l("species"),arrayMethodHasSpeciesSupport$5=function(e){return V8_VERSION$2>=51||!fails$s((function(){var t=[];return(t.constructor={})[SPECIES$4]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},$$1r=_export,fails$r=fails$B,isArray$b=isArray$d,isObject$f=isObject$l,toObject$d=toObject$f,lengthOfArrayLike$d=lengthOfArrayLike$e,doesNotExceedSafeInteger$2=doesNotExceedSafeInteger$3,createProperty$5=createProperty$6,arraySpeciesCreate$2=arraySpeciesCreate$3,arrayMethodHasSpeciesSupport$4=arrayMethodHasSpeciesSupport$5,wellKnownSymbol$k=wellKnownSymbol$q,V8_VERSION$1=engineV8Version,IS_CONCAT_SPREADABLE=wellKnownSymbol$k("isConcatSpreadable"),IS_CONCAT_SPREADABLE_SUPPORT=V8_VERSION$1>=51||!fails$r((function(){var e=[];return e[IS_CONCAT_SPREADABLE]=!1,e.concat()[0]!==e})),isConcatSpreadable=function(e){if(!isObject$f(e))return!1;var t=e[IS_CONCAT_SPREADABLE];return void 0!==t?!!t:isArray$b(e)},FORCED$a=!IS_CONCAT_SPREADABLE_SUPPORT||!arrayMethodHasSpeciesSupport$4("concat");$$1r({target:"Array",proto:!0,arity:1,forced:FORCED$a},{concat:function(e){var t,r,n,o,i,a=toObject$d(this),s=arraySpeciesCreate$2(a,0),l=0;for(t=-1,n=arguments.length;t<n;t++)if(isConcatSpreadable(i=-1===t?a:arguments[t]))for(o=lengthOfArrayLike$d(i),doesNotExceedSafeInteger$2(l+o),r=0;r<o;r++,l++)r in i&&createProperty$5(s,l,i[r]);else doesNotExceedSafeInteger$2(l+1),createProperty$5(s,l++,i);return s.length=l,s}});var classof$a=classof$c,$String$2=String,toString$f=function(e){if("Symbol"===classof$a(e))throw TypeError("Cannot convert a Symbol value to a string");return $String$2(e)},objectDefineProperties={},toIntegerOrInfinity$4=toIntegerOrInfinity$6,max$3=Math.max,min$4=Math.min,toAbsoluteIndex$6=function(e,t){var r=toIntegerOrInfinity$4(e);return r<0?max$3(r+t,0):min$4(r,t)},toIndexedObject$a=toIndexedObject$c,toAbsoluteIndex$5=toAbsoluteIndex$6,lengthOfArrayLike$c=lengthOfArrayLike$e,createMethod$6=function(e){return function(t,r,n){var o,i=toIndexedObject$a(t),a=lengthOfArrayLike$c(i),s=toAbsoluteIndex$5(n,a);if(e&&r!=r){for(;a>s;)if((o=i[s++])!=o)return!0}else for(;a>s;s++)if((e||s in i)&&i[s]===r)return e||s||0;return!e&&-1}},arrayIncludes={includes:createMethod$6(!0),indexOf:createMethod$6(!1)},hiddenKeys$6={},uncurryThis$t=functionUncurryThis,hasOwn$g=hasOwnProperty_1,toIndexedObject$9=toIndexedObject$c,indexOf$7=arrayIncludes.indexOf,hiddenKeys$5=hiddenKeys$6,push$i=uncurryThis$t([].push),objectKeysInternal=function(e,t){var r,n=toIndexedObject$9(e),o=0,i=[];for(r in n)!hasOwn$g(hiddenKeys$5,r)&&hasOwn$g(n,r)&&push$i(i,r);for(;t.length>o;)hasOwn$g(n,r=t[o++])&&(~indexOf$7(i,r)||push$i(i,r));return i},enumBugKeys$3=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],internalObjectKeys$1=objectKeysInternal,enumBugKeys$2=enumBugKeys$3,objectKeys$4=Object.keys||function(e){return internalObjectKeys$1(e,enumBugKeys$2)},DESCRIPTORS$g=descriptors$2,V8_PROTOTYPE_DEFINE_BUG=v8PrototypeDefineBug,definePropertyModule$2=objectDefineProperty,anObject$e=anObject$g,toIndexedObject$8=toIndexedObject$c,objectKeys$3=objectKeys$4;objectDefineProperties.f=DESCRIPTORS$g&&!V8_PROTOTYPE_DEFINE_BUG?Object.defineProperties:function(e,t){anObject$e(e);for(var r,n=toIndexedObject$8(t),o=objectKeys$3(t),i=o.length,a=0;i>a;)definePropertyModule$2.f(e,r=o[a++],n[r]);return e};var activeXDocument,getBuiltIn$e=getBuiltIn$h,html$2=getBuiltIn$e("document","documentElement"),shared$5=sharedExports,uid$2=uid$4,keys$6=shared$5("keys"),sharedKey$4=function(e){return keys$6[e]||(keys$6[e]=uid$2(e))},anObject$d=anObject$g,definePropertiesModule$1=objectDefineProperties,enumBugKeys$1=enumBugKeys$3,hiddenKeys$4=hiddenKeys$6,html$1=html$2,documentCreateElement=documentCreateElement$1,sharedKey$3=sharedKey$4,GT=">",LT="<",PROTOTYPE$1="prototype",SCRIPT="script",IE_PROTO$1=sharedKey$3("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(e){return LT+SCRIPT+GT+e+LT+"/"+SCRIPT+GT},NullProtoObjectViaActiveX=function(e){e.write(scriptTag("")),e.close();var t=e.parentWindow.Object;return e=null,t},NullProtoObjectViaIFrame=function(){var e,t=documentCreateElement("iframe"),r="java"+SCRIPT+":";return t.style.display="none",html$1.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(scriptTag("document.F=Object")),e.close(),e.F},NullProtoObject=function(){try{activeXDocument=new ActiveXObject("htmlfile")}catch(e){}NullProtoObject="undefined"!=typeof document?document.domain&&activeXDocument?NullProtoObjectViaActiveX(activeXDocument):NullProtoObjectViaIFrame():NullProtoObjectViaActiveX(activeXDocument);for(var e=enumBugKeys$1.length;e--;)delete NullProtoObject[PROTOTYPE$1][enumBugKeys$1[e]];return NullProtoObject()};hiddenKeys$4[IE_PROTO$1]=!0;var objectCreate=Object.create||function(e,t){var r;return null!==e?(EmptyConstructor[PROTOTYPE$1]=anObject$d(e),r=new EmptyConstructor,EmptyConstructor[PROTOTYPE$1]=null,r[IE_PROTO$1]=e):r=NullProtoObject(),void 0===t?r:definePropertiesModule$1.f(r,t)},objectGetOwnPropertyNames={},internalObjectKeys=objectKeysInternal,enumBugKeys=enumBugKeys$3,hiddenKeys$3=enumBugKeys.concat("length","prototype");objectGetOwnPropertyNames.f=Object.getOwnPropertyNames||function(e){return internalObjectKeys(e,hiddenKeys$3)};var objectGetOwnPropertyNamesExternal={},toAbsoluteIndex$4=toAbsoluteIndex$6,lengthOfArrayLike$b=lengthOfArrayLike$e,createProperty$4=createProperty$6,$Array$2=Array,max$2=Math.max,arraySliceSimple=function(e,t,r){for(var n=lengthOfArrayLike$b(e),o=toAbsoluteIndex$4(t,n),i=toAbsoluteIndex$4(void 0===r?n:r,n),a=$Array$2(max$2(i-o,0)),s=0;o<i;o++,s++)createProperty$4(a,s,e[o]);return a.length=s,a},classof$9=classofRaw$2,toIndexedObject$7=toIndexedObject$c,$getOwnPropertyNames$1=objectGetOwnPropertyNames.f,arraySlice$8=arraySliceSimple,windowNames="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],getWindowNames=function(e){try{return $getOwnPropertyNames$1(e)}catch(e){return arraySlice$8(windowNames)}};objectGetOwnPropertyNamesExternal.f=function(e){return windowNames&&"Window"==classof$9(e)?getWindowNames(e):$getOwnPropertyNames$1(toIndexedObject$7(e))};var objectGetOwnPropertySymbols={};objectGetOwnPropertySymbols.f=Object.getOwnPropertySymbols;var createNonEnumerableProperty$7=createNonEnumerableProperty$9,defineBuiltIn$8=function(e,t,r,n){return n&&n.enumerable?e[t]=r:createNonEnumerableProperty$7(e,t,r),e},defineProperty$d=objectDefineProperty,defineBuiltInAccessor$5=function(e,t,r){return defineProperty$d.f(e,t,r)},wellKnownSymbolWrapped={},wellKnownSymbol$j=wellKnownSymbol$q;wellKnownSymbolWrapped.f=wellKnownSymbol$j;var set$7,get$9,has$2,path$w=path$z,hasOwn$f=hasOwnProperty_1,wrappedWellKnownSymbolModule$1=wellKnownSymbolWrapped,defineProperty$c=objectDefineProperty.f,wellKnownSymbolDefine=function(e){var t=path$w.Symbol||(path$w.Symbol={});hasOwn$f(t,e)||defineProperty$c(t,e,{value:wrappedWellKnownSymbolModule$1.f(e)})},call$l=functionCall,getBuiltIn$d=getBuiltIn$h,wellKnownSymbol$i=wellKnownSymbol$q,defineBuiltIn$7=defineBuiltIn$8,symbolDefineToPrimitive=function(){var e=getBuiltIn$d("Symbol"),t=e&&e.prototype,r=t&&t.valueOf,n=wellKnownSymbol$i("toPrimitive");t&&!t[n]&&defineBuiltIn$7(t,n,(function(e){return call$l(r,this)}),{arity:1})},TO_STRING_TAG_SUPPORT$1=toStringTagSupport,classof$8=classof$c,objectToString=TO_STRING_TAG_SUPPORT$1?{}.toString:function(){return"[object "+classof$8(this)+"]"},TO_STRING_TAG_SUPPORT=toStringTagSupport,defineProperty$b=objectDefineProperty.f,createNonEnumerableProperty$6=createNonEnumerableProperty$9,hasOwn$e=hasOwnProperty_1,toString$e=objectToString,wellKnownSymbol$h=wellKnownSymbol$q,TO_STRING_TAG$2=wellKnownSymbol$h("toStringTag"),setToStringTag$9=function(e,t,r,n){if(e){var o=r?e:e.prototype;hasOwn$e(o,TO_STRING_TAG$2)||defineProperty$b(o,TO_STRING_TAG$2,{configurable:!0,value:t}),n&&!TO_STRING_TAG_SUPPORT&&createNonEnumerableProperty$6(o,"toString",toString$e)}},global$j=global$s,isCallable$f=isCallable$q,WeakMap$1=global$j.WeakMap,weakMapBasicDetection=isCallable$f(WeakMap$1)&&/native code/.test(String(WeakMap$1)),NATIVE_WEAK_MAP=weakMapBasicDetection,global$i=global$s,isObject$e=isObject$l,createNonEnumerableProperty$5=createNonEnumerableProperty$9,hasOwn$d=hasOwnProperty_1,shared$4=sharedStore,sharedKey$2=sharedKey$4,hiddenKeys$2=hiddenKeys$6,OBJECT_ALREADY_INITIALIZED="Object already initialized",TypeError$5=global$i.TypeError,WeakMap=global$i.WeakMap,enforce=function(e){return has$2(e)?get$9(e):set$7(e,{})},getterFor=function(e){return function(t){var r;if(!isObject$e(t)||(r=get$9(t)).type!==e)throw TypeError$5("Incompatible receiver, "+e+" required");return r}};if(NATIVE_WEAK_MAP||shared$4.state){var store=shared$4.state||(shared$4.state=new WeakMap);store.get=store.get,store.has=store.has,store.set=store.set,set$7=function(e,t){if(store.has(e))throw TypeError$5(OBJECT_ALREADY_INITIALIZED);return t.facade=e,store.set(e,t),t},get$9=function(e){return store.get(e)||{}},has$2=function(e){return store.has(e)}}else{var STATE=sharedKey$2("state");hiddenKeys$2[STATE]=!0,set$7=function(e,t){if(hasOwn$d(e,STATE))throw TypeError$5(OBJECT_ALREADY_INITIALIZED);return t.facade=e,createNonEnumerableProperty$5(e,STATE,t),t},get$9=function(e){return hasOwn$d(e,STATE)?e[STATE]:{}},has$2=function(e){return hasOwn$d(e,STATE)}}var internalState={set:set$7,get:get$9,has:has$2,enforce:enforce,getterFor:getterFor},bind$p=functionBindContext,uncurryThis$s=functionUncurryThis,IndexedObject$2=indexedObject,toObject$c=toObject$f,lengthOfArrayLike$a=lengthOfArrayLike$e,arraySpeciesCreate$1=arraySpeciesCreate$3,push$h=uncurryThis$s([].push),createMethod$5=function(e){var t=1==e,r=2==e,n=3==e,o=4==e,i=6==e,a=7==e,s=5==e||i;return function(l,c,u,p){for(var f,d,h=toObject$c(l),$=IndexedObject$2(h),y=bind$p(c,u),g=lengthOfArrayLike$a($),v=0,m=p||arraySpeciesCreate$1,_=t?m(l,g):r||a?m(l,0):void 0;g>v;v++)if((s||v in $)&&(d=y(f=$[v],v,h),e))if(t)_[v]=d;else if(d)switch(e){case 3:return!0;case 5:return f;case 6:return v;case 2:push$h(_,f)}else switch(e){case 4:return!1;case 7:push$h(_,f)}return i?-1:n||o?o:_}},arrayIteration={forEach:createMethod$5(0),map:createMethod$5(1),filter:createMethod$5(2),some:createMethod$5(3),every:createMethod$5(4),find:createMethod$5(5),findIndex:createMethod$5(6),filterReject:createMethod$5(7)},$$1q=_export,global$h=global$s,call$k=functionCall,uncurryThis$r=functionUncurryThis,DESCRIPTORS$f=descriptors$2,NATIVE_SYMBOL$3=symbolConstructorDetection,fails$q=fails$B,hasOwn$c=hasOwnProperty_1,isPrototypeOf$q=objectIsPrototypeOf,anObject$c=anObject$g,toIndexedObject$6=toIndexedObject$c,toPropertyKey=toPropertyKey$4,$toString$2=toString$f,createPropertyDescriptor$4=createPropertyDescriptor$8,nativeObjectCreate=objectCreate,objectKeys$2=objectKeys$4,getOwnPropertyNamesModule$2=objectGetOwnPropertyNames,getOwnPropertyNamesExternal=objectGetOwnPropertyNamesExternal,getOwnPropertySymbolsModule$3=objectGetOwnPropertySymbols,getOwnPropertyDescriptorModule$3=objectGetOwnPropertyDescriptor,definePropertyModule$1=objectDefineProperty,definePropertiesModule=objectDefineProperties,propertyIsEnumerableModule$1=objectPropertyIsEnumerable,defineBuiltIn$6=defineBuiltIn$8,defineBuiltInAccessor$4=defineBuiltInAccessor$5,shared$3=sharedExports,sharedKey$1=sharedKey$4,hiddenKeys$1=hiddenKeys$6,uid$1=uid$4,wellKnownSymbol$g=wellKnownSymbol$q,wrappedWellKnownSymbolModule=wellKnownSymbolWrapped,defineWellKnownSymbol$l=wellKnownSymbolDefine,defineSymbolToPrimitive$1=symbolDefineToPrimitive,setToStringTag$8=setToStringTag$9,InternalStateModule$7=internalState,$forEach$1=arrayIteration.forEach,HIDDEN=sharedKey$1("hidden"),SYMBOL="Symbol",PROTOTYPE="prototype",setInternalState$7=InternalStateModule$7.set,getInternalState$2=InternalStateModule$7.getterFor(SYMBOL),ObjectPrototype$2=Object[PROTOTYPE],$Symbol=global$h.Symbol,SymbolPrototype=$Symbol&&$Symbol[PROTOTYPE],TypeError$4=global$h.TypeError,QObject=global$h.QObject,nativeGetOwnPropertyDescriptor$1=getOwnPropertyDescriptorModule$3.f,nativeDefineProperty=definePropertyModule$1.f,nativeGetOwnPropertyNames=getOwnPropertyNamesExternal.f,nativePropertyIsEnumerable=propertyIsEnumerableModule$1.f,push$g=uncurryThis$r([].push),AllSymbols=shared$3("symbols"),ObjectPrototypeSymbols=shared$3("op-symbols"),WellKnownSymbolsStore$1=shared$3("wks"),USE_SETTER=!QObject||!QObject[PROTOTYPE]||!QObject[PROTOTYPE].findChild,setSymbolDescriptor=DESCRIPTORS$f&&fails$q((function(){return 7!=nativeObjectCreate(nativeDefineProperty({},"a",{get:function(){return nativeDefineProperty(this,"a",{value:7}).a}})).a}))?function(e,t,r){var n=nativeGetOwnPropertyDescriptor$1(ObjectPrototype$2,t);n&&delete ObjectPrototype$2[t],nativeDefineProperty(e,t,r),n&&e!==ObjectPrototype$2&&nativeDefineProperty(ObjectPrototype$2,t,n)}:nativeDefineProperty,wrap=function(e,t){var r=AllSymbols[e]=nativeObjectCreate(SymbolPrototype);return setInternalState$7(r,{type:SYMBOL,tag:e,description:t}),DESCRIPTORS$f||(r.description=t),r},$defineProperty=function(e,t,r){e===ObjectPrototype$2&&$defineProperty(ObjectPrototypeSymbols,t,r),anObject$c(e);var n=toPropertyKey(t);return anObject$c(r),hasOwn$c(AllSymbols,n)?(r.enumerable?(hasOwn$c(e,HIDDEN)&&e[HIDDEN][n]&&(e[HIDDEN][n]=!1),r=nativeObjectCreate(r,{enumerable:createPropertyDescriptor$4(0,!1)})):(hasOwn$c(e,HIDDEN)||nativeDefineProperty(e,HIDDEN,createPropertyDescriptor$4(1,{})),e[HIDDEN][n]=!0),setSymbolDescriptor(e,n,r)):nativeDefineProperty(e,n,r)},$defineProperties=function(e,t){anObject$c(e);var r=toIndexedObject$6(t),n=objectKeys$2(r).concat($getOwnPropertySymbols(r));return $forEach$1(n,(function(t){DESCRIPTORS$f&&!call$k($propertyIsEnumerable$1,r,t)||$defineProperty(e,t,r[t])})),e},$create=function(e,t){return void 0===t?nativeObjectCreate(e):$defineProperties(nativeObjectCreate(e),t)},$propertyIsEnumerable$1=function(e){var t=toPropertyKey(e),r=call$k(nativePropertyIsEnumerable,this,t);return!(this===ObjectPrototype$2&&hasOwn$c(AllSymbols,t)&&!hasOwn$c(ObjectPrototypeSymbols,t))&&(!(r||!hasOwn$c(this,t)||!hasOwn$c(AllSymbols,t)||hasOwn$c(this,HIDDEN)&&this[HIDDEN][t])||r)},$getOwnPropertyDescriptor=function(e,t){var r=toIndexedObject$6(e),n=toPropertyKey(t);if(r!==ObjectPrototype$2||!hasOwn$c(AllSymbols,n)||hasOwn$c(ObjectPrototypeSymbols,n)){var o=nativeGetOwnPropertyDescriptor$1(r,n);return!o||!hasOwn$c(AllSymbols,n)||hasOwn$c(r,HIDDEN)&&r[HIDDEN][n]||(o.enumerable=!0),o}},$getOwnPropertyNames=function(e){var t=nativeGetOwnPropertyNames(toIndexedObject$6(e)),r=[];return $forEach$1(t,(function(e){hasOwn$c(AllSymbols,e)||hasOwn$c(hiddenKeys$1,e)||push$g(r,e)})),r},$getOwnPropertySymbols=function(e){var t=e===ObjectPrototype$2,r=nativeGetOwnPropertyNames(t?ObjectPrototypeSymbols:toIndexedObject$6(e)),n=[];return $forEach$1(r,(function(e){!hasOwn$c(AllSymbols,e)||t&&!hasOwn$c(ObjectPrototype$2,e)||push$g(n,AllSymbols[e])})),n};NATIVE_SYMBOL$3||(defineBuiltIn$6(SymbolPrototype=($Symbol=function(){if(isPrototypeOf$q(SymbolPrototype,this))throw TypeError$4("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?$toString$2(arguments[0]):void 0,t=uid$1(e),r=function(e){this===ObjectPrototype$2&&call$k(r,ObjectPrototypeSymbols,e),hasOwn$c(this,HIDDEN)&&hasOwn$c(this[HIDDEN],t)&&(this[HIDDEN][t]=!1),setSymbolDescriptor(this,t,createPropertyDescriptor$4(1,e))};return DESCRIPTORS$f&&USE_SETTER&&setSymbolDescriptor(ObjectPrototype$2,t,{configurable:!0,set:r}),wrap(t,e)})[PROTOTYPE],"toString",(function(){return getInternalState$2(this).tag})),defineBuiltIn$6($Symbol,"withoutSetter",(function(e){return wrap(uid$1(e),e)})),propertyIsEnumerableModule$1.f=$propertyIsEnumerable$1,definePropertyModule$1.f=$defineProperty,definePropertiesModule.f=$defineProperties,getOwnPropertyDescriptorModule$3.f=$getOwnPropertyDescriptor,getOwnPropertyNamesModule$2.f=getOwnPropertyNamesExternal.f=$getOwnPropertyNames,getOwnPropertySymbolsModule$3.f=$getOwnPropertySymbols,wrappedWellKnownSymbolModule.f=function(e){return wrap(wellKnownSymbol$g(e),e)},DESCRIPTORS$f&&defineBuiltInAccessor$4(SymbolPrototype,"description",{configurable:!0,get:function(){return getInternalState$2(this).description}})),$$1q({global:!0,constructor:!0,wrap:!0,forced:!NATIVE_SYMBOL$3,sham:!NATIVE_SYMBOL$3},{Symbol:$Symbol}),$forEach$1(objectKeys$2(WellKnownSymbolsStore$1),(function(e){defineWellKnownSymbol$l(e)})),$$1q({target:SYMBOL,stat:!0,forced:!NATIVE_SYMBOL$3},{useSetter:function(){USE_SETTER=!0},useSimple:function(){USE_SETTER=!1}}),$$1q({target:"Object",stat:!0,forced:!NATIVE_SYMBOL$3,sham:!DESCRIPTORS$f},{create:$create,defineProperty:$defineProperty,defineProperties:$defineProperties,getOwnPropertyDescriptor:$getOwnPropertyDescriptor}),$$1q({target:"Object",stat:!0,forced:!NATIVE_SYMBOL$3},{getOwnPropertyNames:$getOwnPropertyNames}),defineSymbolToPrimitive$1(),setToStringTag$8($Symbol,SYMBOL),hiddenKeys$1[HIDDEN]=!0;var NATIVE_SYMBOL$2=symbolConstructorDetection,symbolRegistryDetection=NATIVE_SYMBOL$2&&!!Symbol.for&&!!Symbol.keyFor,$$1p=_export,getBuiltIn$c=getBuiltIn$h,hasOwn$b=hasOwnProperty_1,toString$d=toString$f,shared$2=sharedExports,NATIVE_SYMBOL_REGISTRY$1=symbolRegistryDetection,StringToSymbolRegistry=shared$2("string-to-symbol-registry"),SymbolToStringRegistry$1=shared$2("symbol-to-string-registry");$$1p({target:"Symbol",stat:!0,forced:!NATIVE_SYMBOL_REGISTRY$1},{for:function(e){var t=toString$d(e);if(hasOwn$b(StringToSymbolRegistry,t))return StringToSymbolRegistry[t];var r=getBuiltIn$c("Symbol")(t);return StringToSymbolRegistry[t]=r,SymbolToStringRegistry$1[r]=t,r}});var $$1o=_export,hasOwn$a=hasOwnProperty_1,isSymbol$2=isSymbol$5,tryToString$5=tryToString$7,shared$1=sharedExports,NATIVE_SYMBOL_REGISTRY=symbolRegistryDetection,SymbolToStringRegistry=shared$1("symbol-to-string-registry");$$1o({target:"Symbol",stat:!0,forced:!NATIVE_SYMBOL_REGISTRY},{keyFor:function(e){if(!isSymbol$2(e))throw TypeError(tryToString$5(e)+" is not a symbol");if(hasOwn$a(SymbolToStringRegistry,e))return SymbolToStringRegistry[e]}});var uncurryThis$q=functionUncurryThis,arraySlice$7=uncurryThis$q([].slice),uncurryThis$p=functionUncurryThis,isArray$a=isArray$d,isCallable$e=isCallable$q,classof$7=classofRaw$2,toString$c=toString$f,push$f=uncurryThis$p([].push),getJsonReplacerFunction=function(e){if(isCallable$e(e))return e;if(isArray$a(e)){for(var t=e.length,r=[],n=0;n<t;n++){var o=e[n];"string"==typeof o?push$f(r,o):"number"!=typeof o&&"Number"!=classof$7(o)&&"String"!=classof$7(o)||push$f(r,toString$c(o))}var i=r.length,a=!0;return function(e,t){if(a)return a=!1,t;if(isArray$a(this))return t;for(var n=0;n<i;n++)if(r[n]===e)return t}}},$$1n=_export,getBuiltIn$b=getBuiltIn$h,apply$5=functionApply,call$j=functionCall,uncurryThis$o=functionUncurryThis,fails$p=fails$B,isCallable$d=isCallable$q,isSymbol$1=isSymbol$5,arraySlice$6=arraySlice$7,getReplacerFunction=getJsonReplacerFunction,NATIVE_SYMBOL$1=symbolConstructorDetection,$String$1=String,$stringify=getBuiltIn$b("JSON","stringify"),exec$3=uncurryThis$o(/./.exec),charAt$5=uncurryThis$o("".charAt),charCodeAt$2=uncurryThis$o("".charCodeAt),replace$5=uncurryThis$o("".replace),numberToString$1=uncurryThis$o(1..toString),tester=/[\uD800-\uDFFF]/g,low=/^[\uD800-\uDBFF]$/,hi=/^[\uDC00-\uDFFF]$/,WRONG_SYMBOLS_CONVERSION=!NATIVE_SYMBOL$1||fails$p((function(){var e=getBuiltIn$b("Symbol")();return"[null]"!=$stringify([e])||"{}"!=$stringify({a:e})||"{}"!=$stringify(Object(e))})),ILL_FORMED_UNICODE=fails$p((function(){return'"\\udf06\\ud834"'!==$stringify("\udf06\ud834")||'"\\udead"'!==$stringify("\udead")})),stringifyWithSymbolsFix=function(e,t){var r=arraySlice$6(arguments),n=getReplacerFunction(t);if(isCallable$d(n)||void 0!==e&&!isSymbol$1(e))return r[1]=function(e,t){if(isCallable$d(n)&&(t=call$j(n,this,$String$1(e),t)),!isSymbol$1(t))return t},apply$5($stringify,null,r)},fixIllFormed=function(e,t,r){var n=charAt$5(r,t-1),o=charAt$5(r,t+1);return exec$3(low,e)&&!exec$3(hi,o)||exec$3(hi,e)&&!exec$3(low,n)?"\\u"+numberToString$1(charCodeAt$2(e,0),16):e};$stringify&&$$1n({target:"JSON",stat:!0,arity:3,forced:WRONG_SYMBOLS_CONVERSION||ILL_FORMED_UNICODE},{stringify:function(e,t,r){var n=arraySlice$6(arguments),o=apply$5(WRONG_SYMBOLS_CONVERSION?stringifyWithSymbolsFix:$stringify,null,n);return ILL_FORMED_UNICODE&&"string"==typeof o?replace$5(o,tester,fixIllFormed):o}});var $$1m=_export,NATIVE_SYMBOL=symbolConstructorDetection,fails$o=fails$B,getOwnPropertySymbolsModule$2=objectGetOwnPropertySymbols,toObject$b=toObject$f,FORCED$9=!NATIVE_SYMBOL||fails$o((function(){getOwnPropertySymbolsModule$2.f(1)}));$$1m({target:"Object",stat:!0,forced:FORCED$9},{getOwnPropertySymbols:function(e){var t=getOwnPropertySymbolsModule$2.f;return t?t(toObject$b(e)):[]}});var defineWellKnownSymbol$k=wellKnownSymbolDefine;defineWellKnownSymbol$k("asyncIterator");var defineWellKnownSymbol$j=wellKnownSymbolDefine;defineWellKnownSymbol$j("hasInstance");var defineWellKnownSymbol$i=wellKnownSymbolDefine;defineWellKnownSymbol$i("isConcatSpreadable");var defineWellKnownSymbol$h=wellKnownSymbolDefine;defineWellKnownSymbol$h("iterator");var defineWellKnownSymbol$g=wellKnownSymbolDefine;defineWellKnownSymbol$g("match");var defineWellKnownSymbol$f=wellKnownSymbolDefine;defineWellKnownSymbol$f("matchAll");var defineWellKnownSymbol$e=wellKnownSymbolDefine;defineWellKnownSymbol$e("replace");var defineWellKnownSymbol$d=wellKnownSymbolDefine;defineWellKnownSymbol$d("search");var defineWellKnownSymbol$c=wellKnownSymbolDefine;defineWellKnownSymbol$c("species");var defineWellKnownSymbol$b=wellKnownSymbolDefine;defineWellKnownSymbol$b("split");var defineWellKnownSymbol$a=wellKnownSymbolDefine,defineSymbolToPrimitive=symbolDefineToPrimitive;defineWellKnownSymbol$a("toPrimitive"),defineSymbolToPrimitive();var getBuiltIn$a=getBuiltIn$h,defineWellKnownSymbol$9=wellKnownSymbolDefine,setToStringTag$7=setToStringTag$9;defineWellKnownSymbol$9("toStringTag"),setToStringTag$7(getBuiltIn$a("Symbol"),"Symbol");var defineWellKnownSymbol$8=wellKnownSymbolDefine;defineWellKnownSymbol$8("unscopables");var global$g=global$s,setToStringTag$6=setToStringTag$9;setToStringTag$6(global$g.JSON,"JSON",!0);var IteratorPrototype$1,PrototypeOfArrayIteratorPrototype,arrayIterator,path$v=path$z,symbol$5=path$v.Symbol,iterators={},DESCRIPTORS$e=descriptors$2,hasOwn$9=hasOwnProperty_1,FunctionPrototype$1=Function.prototype,getDescriptor=DESCRIPTORS$e&&Object.getOwnPropertyDescriptor,EXISTS=hasOwn$9(FunctionPrototype$1,"name"),PROPER=EXISTS&&"something"===function(){}.name,CONFIGURABLE=EXISTS&&(!DESCRIPTORS$e||DESCRIPTORS$e&&getDescriptor(FunctionPrototype$1,"name").configurable),functionName={EXISTS:EXISTS,PROPER:PROPER,CONFIGURABLE:CONFIGURABLE},fails$n=fails$B,correctPrototypeGetter=!fails$n((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),hasOwn$8=hasOwnProperty_1,isCallable$c=isCallable$q,toObject$a=toObject$f,sharedKey=sharedKey$4,CORRECT_PROTOTYPE_GETTER$1=correctPrototypeGetter,IE_PROTO=sharedKey("IE_PROTO"),$Object=Object,ObjectPrototype$1=$Object.prototype,objectGetPrototypeOf=CORRECT_PROTOTYPE_GETTER$1?$Object.getPrototypeOf:function(e){var t=toObject$a(e);if(hasOwn$8(t,IE_PROTO))return t[IE_PROTO];var r=t.constructor;return isCallable$c(r)&&t instanceof r?r.prototype:t instanceof $Object?ObjectPrototype$1:null},fails$m=fails$B,isCallable$b=isCallable$q,isObject$d=isObject$l,create$c=objectCreate,getPrototypeOf$9=objectGetPrototypeOf,defineBuiltIn$5=defineBuiltIn$8,wellKnownSymbol$f=wellKnownSymbol$q,ITERATOR$8=wellKnownSymbol$f("iterator"),BUGGY_SAFARI_ITERATORS$1=!1;[].keys&&("next"in(arrayIterator=[].keys())?(PrototypeOfArrayIteratorPrototype=getPrototypeOf$9(getPrototypeOf$9(arrayIterator)))!==Object.prototype&&(IteratorPrototype$1=PrototypeOfArrayIteratorPrototype):BUGGY_SAFARI_ITERATORS$1=!0);var NEW_ITERATOR_PROTOTYPE=!isObject$d(IteratorPrototype$1)||fails$m((function(){var e={};return IteratorPrototype$1[ITERATOR$8].call(e)!==e}));isCallable$b((IteratorPrototype$1=NEW_ITERATOR_PROTOTYPE?{}:create$c(IteratorPrototype$1))[ITERATOR$8])||defineBuiltIn$5(IteratorPrototype$1,ITERATOR$8,(function(){return this}));var iteratorsCore={IteratorPrototype:IteratorPrototype$1,BUGGY_SAFARI_ITERATORS:BUGGY_SAFARI_ITERATORS$1},IteratorPrototype=iteratorsCore.IteratorPrototype,create$b=objectCreate,createPropertyDescriptor$3=createPropertyDescriptor$8,setToStringTag$5=setToStringTag$9,Iterators$5=iterators,returnThis$1=function(){return this},iteratorCreateConstructor=function(e,t,r,n){var o=t+" Iterator";return e.prototype=create$b(IteratorPrototype,{next:createPropertyDescriptor$3(+!n,r)}),setToStringTag$5(e,o,!1,!0),Iterators$5[o]=returnThis$1,e},uncurryThis$n=functionUncurryThis,aCallable$g=aCallable$j,functionUncurryThisAccessor=function(e,t,r){try{return uncurryThis$n(aCallable$g(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(e){}},isCallable$a=isCallable$q,$String=String,$TypeError$d=TypeError,aPossiblePrototype$1=function(e){if("object"==typeof e||isCallable$a(e))return e;throw $TypeError$d("Can't set "+$String(e)+" as a prototype")},uncurryThisAccessor=functionUncurryThisAccessor,anObject$b=anObject$g,aPossiblePrototype=aPossiblePrototype$1,objectSetPrototypeOf=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=uncurryThisAccessor(Object.prototype,"__proto__","set"))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return anObject$b(r),aPossiblePrototype(n),t?e(r,n):r.__proto__=n,r}}():void 0),$$1l=_export,call$i=functionCall,FunctionName=functionName,createIteratorConstructor$1=iteratorCreateConstructor,getPrototypeOf$8=objectGetPrototypeOf,setToStringTag$4=setToStringTag$9,defineBuiltIn$4=defineBuiltIn$8,wellKnownSymbol$e=wellKnownSymbol$q,Iterators$4=iterators,IteratorsCore=iteratorsCore,PROPER_FUNCTION_NAME$1=FunctionName.PROPER;FunctionName.CONFIGURABLE,IteratorsCore.IteratorPrototype;var BUGGY_SAFARI_ITERATORS=IteratorsCore.BUGGY_SAFARI_ITERATORS,ITERATOR$7=wellKnownSymbol$e("iterator"),KEYS="keys",VALUES="values",ENTRIES="entries",returnThis=function(){return this},iteratorDefine=function(e,t,r,n,o,i,a){createIteratorConstructor$1(r,t,n);var s,l,c,u=function(e){if(e===o&&$)return $;if(!BUGGY_SAFARI_ITERATORS&&e in d)return d[e];switch(e){case KEYS:case VALUES:case ENTRIES:return function(){return new r(this,e)}}return function(){return new r(this)}},p=t+" Iterator",f=!1,d=e.prototype,h=d[ITERATOR$7]||d["@@iterator"]||o&&d[o],$=!BUGGY_SAFARI_ITERATORS&&h||u(o),y="Array"==t&&d.entries||h;if(y&&(s=getPrototypeOf$8(y.call(new e)))!==Object.prototype&&s.next&&(setToStringTag$4(s,p,!0,!0),Iterators$4[p]=returnThis),PROPER_FUNCTION_NAME$1&&o==VALUES&&h&&h.name!==VALUES&&(f=!0,$=function(){return call$i(h,this)}),o)if(l={values:u(VALUES),keys:i?$:u(KEYS),entries:u(ENTRIES)},a)for(c in l)(BUGGY_SAFARI_ITERATORS||f||!(c in d))&&defineBuiltIn$4(d,c,l[c]);else $$1l({target:t,proto:!0,forced:BUGGY_SAFARI_ITERATORS||f},l);return a&&d[ITERATOR$7]!==$&&defineBuiltIn$4(d,ITERATOR$7,$,{name:o}),Iterators$4[t]=$,l},createIterResultObject$3=function(e,t){return{value:e,done:t}},toIndexedObject$5=toIndexedObject$c,Iterators$3=iterators,InternalStateModule$6=internalState;objectDefineProperty.f;var defineIterator$2=iteratorDefine,createIterResultObject$2=createIterResultObject$3,ARRAY_ITERATOR="Array Iterator",setInternalState$6=InternalStateModule$6.set,getInternalState$1=InternalStateModule$6.getterFor(ARRAY_ITERATOR);defineIterator$2(Array,"Array",(function(e,t){setInternalState$6(this,{type:ARRAY_ITERATOR,target:toIndexedObject$5(e),index:0,kind:t})}),(function(){var e=getInternalState$1(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,createIterResultObject$2(void 0,!0)):createIterResultObject$2("keys"==r?n:"values"==r?t[n]:[n,t[n]],!1)}),"values"),Iterators$3.Arguments=Iterators$3.Array;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},DOMIterables$1=domIterables,global$f=global$s,classof$6=classof$c,createNonEnumerableProperty$4=createNonEnumerableProperty$9,Iterators$2=iterators,wellKnownSymbol$d=wellKnownSymbol$q,TO_STRING_TAG$1=wellKnownSymbol$d("toStringTag");for(var COLLECTION_NAME in DOMIterables$1){var Collection=global$f[COLLECTION_NAME],CollectionPrototype=Collection&&Collection.prototype;CollectionPrototype&&classof$6(CollectionPrototype)!==TO_STRING_TAG$1&&createNonEnumerableProperty$4(CollectionPrototype,TO_STRING_TAG$1,COLLECTION_NAME),Iterators$2[COLLECTION_NAME]=Iterators$2.Array}var parent$2E=symbol$5,symbol$4=parent$2E,defineWellKnownSymbol$7=wellKnownSymbolDefine;defineWellKnownSymbol$7("dispose");var parent$2D=symbol$4,symbol$3=parent$2D,defineWellKnownSymbol$6=wellKnownSymbolDefine;defineWellKnownSymbol$6("asyncDispose");var $$1k=_export,getBuiltIn$9=getBuiltIn$h,uncurryThis$m=functionUncurryThis,Symbol$4=getBuiltIn$9("Symbol"),keyFor2=Symbol$4.keyFor,thisSymbolValue$1=uncurryThis$m(Symbol$4.prototype.valueOf);$$1k({target:"Symbol",stat:!0},{isRegistered:function(e){try{return void 0!==keyFor2(thisSymbolValue$1(e))}catch(e){return!1}}});for(var $$1j=_export,shared=sharedExports,getBuiltIn$8=getBuiltIn$h,uncurryThis$l=functionUncurryThis,isSymbol=isSymbol$5,wellKnownSymbol$c=wellKnownSymbol$q,Symbol$3=getBuiltIn$8("Symbol"),$isWellKnown=Symbol$3.isWellKnown,getOwnPropertyNames$7=getBuiltIn$8("Object","getOwnPropertyNames"),thisSymbolValue=uncurryThis$l(Symbol$3.prototype.valueOf),WellKnownSymbolsStore=shared("wks"),i$2=0,symbolKeys=getOwnPropertyNames$7(Symbol$3),symbolKeysLength=symbolKeys.length;i$2<symbolKeysLength;i$2++)try{var symbolKey=symbolKeys[i$2];isSymbol(Symbol$3[symbolKey])&&wellKnownSymbol$c(symbolKey)}catch(e){}$$1j({target:"Symbol",stat:!0,forced:!0},{isWellKnown:function(e){if($isWellKnown&&$isWellKnown(e))return!0;try{for(var t=thisSymbolValue(e),r=0,n=getOwnPropertyNames$7(WellKnownSymbolsStore),o=n.length;r<o;r++)if(WellKnownSymbolsStore[n[r]]==t)return!0}catch(e){}return!1}});var defineWellKnownSymbol$5=wellKnownSymbolDefine;defineWellKnownSymbol$5("matcher");var defineWellKnownSymbol$4=wellKnownSymbolDefine;defineWellKnownSymbol$4("metadataKey");var defineWellKnownSymbol$3=wellKnownSymbolDefine;defineWellKnownSymbol$3("observable");var defineWellKnownSymbol$2=wellKnownSymbolDefine;defineWellKnownSymbol$2("metadata");var defineWellKnownSymbol$1=wellKnownSymbolDefine;defineWellKnownSymbol$1("patternMatch");var defineWellKnownSymbol=wellKnownSymbolDefine;defineWellKnownSymbol("replaceAll");var parent$2C=symbol$3,symbol$2=parent$2C,symbol$1=symbol$2,_Symbol$1=getDefaultExportFromCjs(symbol$1),uncurryThis$k=functionUncurryThis,toIntegerOrInfinity$3=toIntegerOrInfinity$6,toString$b=toString$f,requireObjectCoercible$5=requireObjectCoercible$8,charAt$4=uncurryThis$k("".charAt),charCodeAt$1=uncurryThis$k("".charCodeAt),stringSlice$4=uncurryThis$k("".slice),createMethod$4=function(e){return function(t,r){var n,o,i=toString$b(requireObjectCoercible$5(t)),a=toIntegerOrInfinity$3(r),s=i.length;return a<0||a>=s?e?"":void 0:(n=charCodeAt$1(i,a))<55296||n>56319||a+1===s||(o=charCodeAt$1(i,a+1))<56320||o>57343?e?charAt$4(i,a):n:e?stringSlice$4(i,a,a+2):o-56320+(n-55296<<10)+65536}},stringMultibyte={codeAt:createMethod$4(!1),charAt:createMethod$4(!0)},charAt$3=stringMultibyte.charAt,toString$a=toString$f,InternalStateModule$5=internalState,defineIterator$1=iteratorDefine,createIterResultObject$1=createIterResultObject$3,STRING_ITERATOR="String Iterator",setInternalState$5=InternalStateModule$5.set,getInternalState=InternalStateModule$5.getterFor(STRING_ITERATOR);defineIterator$1(String,"String",(function(e){setInternalState$5(this,{type:STRING_ITERATOR,string:toString$a(e),index:0})}),(function(){var e,t=getInternalState(this),r=t.string,n=t.index;return n>=r.length?createIterResultObject$1(void 0,!0):(e=charAt$3(r,n),t.index+=e.length,createIterResultObject$1(e,!1))}));var WrappedWellKnownSymbolModule$1=wellKnownSymbolWrapped,iterator$5=WrappedWellKnownSymbolModule$1.f("iterator"),parent$2B=iterator$5,iterator$4=parent$2B,parent$2A=iterator$4,iterator$3=parent$2A,parent$2z=iterator$3,iterator$2=parent$2z,iterator$1=iterator$2,_Symbol$iterator$1=getDefaultExportFromCjs(iterator$1);function _typeof$3(e){return(_typeof$3="function"==typeof _Symbol$1&&"symbol"==typeof _Symbol$iterator$1?function(e){return typeof e}:function(e){return e&&"function"==typeof _Symbol$1&&e.constructor===_Symbol$1&&e!==_Symbol$1.prototype?"symbol":typeof e})(e)}var defineProperty$a={exports:{}},$$1i=_export,DESCRIPTORS$d=descriptors$2,defineProperty$9=objectDefineProperty.f;$$1i({target:"Object",stat:!0,forced:Object.defineProperty!==defineProperty$9,sham:!DESCRIPTORS$d},{defineProperty:defineProperty$9});var path$u=path$z,Object$5=path$u.Object,defineProperty$8=defineProperty$a.exports=function(e,t,r){return Object$5.defineProperty(e,t,r)};Object$5.defineProperty.sham&&(defineProperty$8.sham=!0);var definePropertyExports=defineProperty$a.exports,parent$2y=definePropertyExports,defineProperty$7=parent$2y,parent$2x=defineProperty$7,defineProperty$6=parent$2x,parent$2w=defineProperty$6,defineProperty$5=parent$2w,defineProperty$4=defineProperty$5,_Object$defineProperty$1=getDefaultExportFromCjs(defineProperty$4),$$1h=_export,DESCRIPTORS$c=descriptors$2,create$a=objectCreate;$$1h({target:"Object",stat:!0,sham:!DESCRIPTORS$c},{create:create$a});var path$t=path$z,Object$4=path$t.Object,create$9=function(e,t){return Object$4.create(e,t)},parent$2v=create$9,create$8=parent$2v,parent$2u=create$8,create$7=parent$2u,parent$2t=create$7,create$6=parent$2t,create$5=create$6,_Object$create$1=getDefaultExportFromCjs(create$5),$$1g=_export,fails$l=fails$B,toObject$9=toObject$f,nativeGetPrototypeOf=objectGetPrototypeOf,CORRECT_PROTOTYPE_GETTER=correctPrototypeGetter,FAILS_ON_PRIMITIVES$3=fails$l((function(){nativeGetPrototypeOf(1)}));$$1g({target:"Object",stat:!0,forced:FAILS_ON_PRIMITIVES$3,sham:!CORRECT_PROTOTYPE_GETTER},{getPrototypeOf:function(e){return nativeGetPrototypeOf(toObject$9(e))}});var path$s=path$z,getPrototypeOf$7=path$s.Object.getPrototypeOf,parent$2s=getPrototypeOf$7,getPrototypeOf$6=parent$2s,parent$2r=getPrototypeOf$6,getPrototypeOf$5=parent$2r,parent$2q=getPrototypeOf$5,getPrototypeOf$4=parent$2q,getPrototypeOf$3=getPrototypeOf$4,_Object$getPrototypeOf$1=getDefaultExportFromCjs(getPrototypeOf$3),fails$k=fails$B,arrayMethodIsStrict$7=function(e,t){var r=[][e];return!!r&&fails$k((function(){r.call(null,t||function(){return 1},1)}))},$forEach=arrayIteration.forEach,arrayMethodIsStrict$6=arrayMethodIsStrict$7,STRICT_METHOD$4=arrayMethodIsStrict$6("forEach"),arrayForEach=STRICT_METHOD$4?[].forEach:function(e){return $forEach(this,e,arguments.length>1?arguments[1]:void 0)},$$1f=_export,forEach$8=arrayForEach;$$1f({target:"Array",proto:!0,forced:[].forEach!=arrayForEach},{forEach:arrayForEach});var path$r=path$z,entryVirtual$o=function(e){return path$r[e+"Prototype"]},entryVirtual$n=entryVirtual$o,forEach$7=entryVirtual$n("Array").forEach,parent$2p=forEach$7,forEach$6=parent$2p,classof$5=classof$c,hasOwn$7=hasOwnProperty_1,isPrototypeOf$p=objectIsPrototypeOf,method$l=forEach$6,ArrayPrototype$j=Array.prototype,DOMIterables={DOMTokenList:!0,NodeList:!0},forEach$5=function(e){var t=e.forEach;return e===ArrayPrototype$j||isPrototypeOf$p(ArrayPrototype$j,e)&&t===ArrayPrototype$j.forEach||hasOwn$7(DOMIterables,classof$5(e))?method$l:t},parent$2o=forEach$5,forEach$4=parent$2o,parent$2n=forEach$4,forEach$3=parent$2n,forEach$2=forEach$3,_forEachInstanceProperty$1=getDefaultExportFromCjs(forEach$2),DESCRIPTORS$b=descriptors$2,isArray$9=isArray$d,$TypeError$c=TypeError,getOwnPropertyDescriptor$9=Object.getOwnPropertyDescriptor,SILENT_ON_NON_WRITABLE_LENGTH_SET=DESCRIPTORS$b&&!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$9(e)&&!getOwnPropertyDescriptor$9(e,"length").writable)throw $TypeError$c("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t},$$1e=_export,toObject$8=toObject$f,lengthOfArrayLike$9=lengthOfArrayLike$e,setArrayLength$1=arraySetLength,doesNotExceedSafeInteger$1=doesNotExceedSafeInteger$3,fails$j=fails$B,INCORRECT_TO_LENGTH=fails$j((function(){return 4294967297!==[].push.call({length:4294967296},1)})),properErrorOnNonWritableLength=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}},FORCED$8=INCORRECT_TO_LENGTH||!properErrorOnNonWritableLength();$$1e({target:"Array",proto:!0,arity:1,forced:FORCED$8},{push:function(e){var t=toObject$8(this),r=lengthOfArrayLike$9(t),n=arguments.length;doesNotExceedSafeInteger$1(r+n);for(var o=0;o<n;o++)t[r]=arguments[o],r++;return setArrayLength$1(t,r),r}});var entryVirtual$m=entryVirtual$o,push$e=entryVirtual$m("Array").push,isPrototypeOf$o=objectIsPrototypeOf,method$k=push$e,ArrayPrototype$i=Array.prototype,push$d=function(e){var t=e.push;return e===ArrayPrototype$i||isPrototypeOf$o(ArrayPrototype$i,e)&&t===ArrayPrototype$i.push?method$k:t},parent$2m=push$d,push$c=parent$2m,parent$2l=push$c,push$b=parent$2l,parent$2k=push$b,push$a=parent$2k,push$9=push$a,_pushInstanceProperty=getDefaultExportFromCjs(push$9),$$1d=_export,setPrototypeOf$7=objectSetPrototypeOf;$$1d({target:"Object",stat:!0},{setPrototypeOf:setPrototypeOf$7});var path$q=path$z,setPrototypeOf$6=path$q.Object.setPrototypeOf,parent$2j=setPrototypeOf$6,setPrototypeOf$5=parent$2j,parent$2i=setPrototypeOf$5,setPrototypeOf$4=parent$2i,parent$2h=setPrototypeOf$4,setPrototypeOf$3=parent$2h,setPrototypeOf$2=setPrototypeOf$3,_Object$setPrototypeOf$1=getDefaultExportFromCjs(setPrototypeOf$2),getBuiltIn$7=getBuiltIn$h,uncurryThis$j=functionUncurryThis,getOwnPropertyNamesModule$1=objectGetOwnPropertyNames,getOwnPropertySymbolsModule$1=objectGetOwnPropertySymbols,anObject$a=anObject$g,concat$9=uncurryThis$j([].concat),ownKeys$5=getBuiltIn$7("Reflect","ownKeys")||function(e){var t=getOwnPropertyNamesModule$1.f(anObject$a(e)),r=getOwnPropertySymbolsModule$1.f;return r?concat$9(t,r(e)):t},hasOwn$6=hasOwnProperty_1,ownKeys$4=ownKeys$5,getOwnPropertyDescriptorModule$2=objectGetOwnPropertyDescriptor,definePropertyModule=objectDefineProperty,copyConstructorProperties$1=function(e,t,r){for(var n=ownKeys$4(t),o=definePropertyModule.f,i=getOwnPropertyDescriptorModule$2.f,a=0;a<n.length;a++){var s=n[a];hasOwn$6(e,s)||r&&hasOwn$6(r,s)||o(e,s,i(t,s))}},isObject$c=isObject$l,createNonEnumerableProperty$3=createNonEnumerableProperty$9,installErrorCause$1=function(e,t){isObject$c(t)&&"cause"in t&&createNonEnumerableProperty$3(e,"cause",t.cause)},uncurryThis$i=functionUncurryThis,$Error$1=Error,replace$4=uncurryThis$i("".replace),TEST=String($Error$1("zxcasd").stack),V8_OR_CHAKRA_STACK_ENTRY=/\n\s*at [^:]*:[^\n]*/,IS_V8_OR_CHAKRA_STACK=V8_OR_CHAKRA_STACK_ENTRY.test(TEST),errorStackClear=function(e,t){if(IS_V8_OR_CHAKRA_STACK&&"string"==typeof e&&!$Error$1.prepareStackTrace)for(;t--;)e=replace$4(e,V8_OR_CHAKRA_STACK_ENTRY,"");return e},fails$i=fails$B,createPropertyDescriptor$2=createPropertyDescriptor$8,errorStackInstallable=!fails$i((function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",createPropertyDescriptor$2(1,7)),7!==e.stack)})),createNonEnumerableProperty$2=createNonEnumerableProperty$9,clearErrorStack=errorStackClear,ERROR_STACK_INSTALLABLE=errorStackInstallable,captureStackTrace=Error.captureStackTrace,errorStackInstall=function(e,t,r,n){ERROR_STACK_INSTALLABLE&&(captureStackTrace?captureStackTrace(e,t):createNonEnumerableProperty$2(e,"stack",clearErrorStack(r,n)))},wellKnownSymbol$b=wellKnownSymbol$q,Iterators$1=iterators,ITERATOR$6=wellKnownSymbol$b("iterator"),ArrayPrototype$h=Array.prototype,isArrayIteratorMethod$2=function(e){return void 0!==e&&(Iterators$1.Array===e||ArrayPrototype$h[ITERATOR$6]===e)},classof$4=classof$c,getMethod$1=getMethod$3,isNullOrUndefined$3=isNullOrUndefined$6,Iterators=iterators,wellKnownSymbol$a=wellKnownSymbol$q,ITERATOR$5=wellKnownSymbol$a("iterator"),getIteratorMethod$a=function(e){if(!isNullOrUndefined$3(e))return getMethod$1(e,ITERATOR$5)||getMethod$1(e,"@@iterator")||Iterators[classof$4(e)]},call$h=functionCall,aCallable$f=aCallable$j,anObject$9=anObject$g,tryToString$4=tryToString$7,getIteratorMethod$9=getIteratorMethod$a,$TypeError$b=TypeError,getIterator$3=function(e,t){var r=arguments.length<2?getIteratorMethod$9(e):t;if(aCallable$f(r))return anObject$9(call$h(r,e));throw $TypeError$b(tryToString$4(e)+" is not iterable")},call$g=functionCall,anObject$8=anObject$g,getMethod=getMethod$3,iteratorClose$2=function(e,t,r){var n,o;anObject$8(e);try{if(!(n=getMethod(e,"return"))){if("throw"===t)throw r;return r}n=call$g(n,e)}catch(e){o=!0,n=e}if("throw"===t)throw r;if(o)throw n;return anObject$8(n),r},bind$o=functionBindContext,call$f=functionCall,anObject$7=anObject$g,tryToString$3=tryToString$7,isArrayIteratorMethod$1=isArrayIteratorMethod$2,lengthOfArrayLike$8=lengthOfArrayLike$e,isPrototypeOf$n=objectIsPrototypeOf,getIterator$2=getIterator$3,getIteratorMethod$8=getIteratorMethod$a,iteratorClose$1=iteratorClose$2,$TypeError$a=TypeError,Result=function(e,t){this.stopped=e,this.result=t},ResultPrototype=Result.prototype,iterate$l=function(e,t,r){var n,o,i,a,s,l,c,u=r&&r.that,p=!(!r||!r.AS_ENTRIES),f=!(!r||!r.IS_RECORD),d=!(!r||!r.IS_ITERATOR),h=!(!r||!r.INTERRUPTED),$=bind$o(t,u),y=function(e){return n&&iteratorClose$1(n,"normal",e),new Result(!0,e)},g=function(e){return p?(anObject$7(e),h?$(e[0],e[1],y):$(e[0],e[1])):h?$(e,y):$(e)};if(f)n=e.iterator;else if(d)n=e;else{if(!(o=getIteratorMethod$8(e)))throw $TypeError$a(tryToString$3(e)+" is not iterable");if(isArrayIteratorMethod$1(o)){for(i=0,a=lengthOfArrayLike$8(e);a>i;i++)if((s=g(e[i]))&&isPrototypeOf$n(ResultPrototype,s))return s;return new Result(!1)}n=getIterator$2(e,o)}for(l=f?e.next:n.next;!(c=call$f(l,n)).done;){try{s=g(c.value)}catch(e){iteratorClose$1(n,"throw",e)}if("object"==typeof s&&s&&isPrototypeOf$n(ResultPrototype,s))return s}return new Result(!1)},toString$9=toString$f,normalizeStringArgument$1=function(e,t){return void 0===e?arguments.length<2?"":t:toString$9(e)},$$1c=_export,isPrototypeOf$m=objectIsPrototypeOf,getPrototypeOf$2=objectGetPrototypeOf,setPrototypeOf$1=objectSetPrototypeOf,copyConstructorProperties=copyConstructorProperties$1,create$4=objectCreate,createNonEnumerableProperty$1=createNonEnumerableProperty$9,createPropertyDescriptor$1=createPropertyDescriptor$8,installErrorCause=installErrorCause$1,installErrorStack=errorStackInstall,iterate$k=iterate$l,normalizeStringArgument=normalizeStringArgument$1,wellKnownSymbol$9=wellKnownSymbol$q,TO_STRING_TAG=wellKnownSymbol$9("toStringTag"),$Error=Error,push$8=[].push,$AggregateError=function(e,t){var r,n=isPrototypeOf$m(AggregateErrorPrototype,this);setPrototypeOf$1?r=setPrototypeOf$1($Error(),n?getPrototypeOf$2(this):AggregateErrorPrototype):(r=n?this:create$4(AggregateErrorPrototype),createNonEnumerableProperty$1(r,TO_STRING_TAG,"Error")),void 0!==t&&createNonEnumerableProperty$1(r,"message",normalizeStringArgument(t)),installErrorStack(r,$AggregateError,r.stack,1),arguments.length>2&&installErrorCause(r,arguments[2]);var o=[];return iterate$k(e,push$8,{that:o}),createNonEnumerableProperty$1(r,"errors",o),r};setPrototypeOf$1?setPrototypeOf$1($AggregateError,$Error):copyConstructorProperties($AggregateError,$Error,{name:!0});var AggregateErrorPrototype=$AggregateError.prototype=create$4($Error.prototype,{constructor:createPropertyDescriptor$1(1,$AggregateError),message:createPropertyDescriptor$1(1,""),name:createPropertyDescriptor$1(1,"AggregateError")});$$1c({global:!0,constructor:!0,arity:2},{AggregateError:$AggregateError});var $location,defer,channel,port,classof$3=classofRaw$2,engineIsNode="undefined"!=typeof process&&"process"==classof$3(process),getBuiltIn$6=getBuiltIn$h,defineBuiltInAccessor$3=defineBuiltInAccessor$5,wellKnownSymbol$8=wellKnownSymbol$q,DESCRIPTORS$a=descriptors$2,SPECIES$3=wellKnownSymbol$8("species"),setSpecies$2=function(e){var t=getBuiltIn$6(e);DESCRIPTORS$a&&t&&!t[SPECIES$3]&&defineBuiltInAccessor$3(t,SPECIES$3,{configurable:!0,get:function(){return this}})},isPrototypeOf$l=objectIsPrototypeOf,$TypeError$9=TypeError,anInstance$5=function(e,t){if(isPrototypeOf$l(t,e))return e;throw $TypeError$9("Incorrect invocation")},isConstructor$2=isConstructor$4,tryToString$2=tryToString$7,$TypeError$8=TypeError,aConstructor$3=function(e){if(isConstructor$2(e))return e;throw $TypeError$8(tryToString$2(e)+" is not a constructor")},anObject$6=anObject$g,aConstructor$2=aConstructor$3,isNullOrUndefined$2=isNullOrUndefined$6,wellKnownSymbol$7=wellKnownSymbol$q,SPECIES$2=wellKnownSymbol$7("species"),speciesConstructor$2=function(e,t){var r,n=anObject$6(e).constructor;return void 0===n||isNullOrUndefined$2(r=anObject$6(n)[SPECIES$2])?t:aConstructor$2(r)},$TypeError$7=TypeError,validateArgumentsLength$5=function(e,t){if(e<t)throw $TypeError$7("Not enough arguments");return e},userAgent$5=engineUserAgent,engineIsIos=/(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$5),global$e=global$s,apply$4=functionApply,bind$n=functionBindContext,isCallable$9=isCallable$q,hasOwn$5=hasOwnProperty_1,fails$h=fails$B,html=html$2,arraySlice$5=arraySlice$7,createElement=documentCreateElement$1,validateArgumentsLength$4=validateArgumentsLength$5,IS_IOS$1=engineIsIos,IS_NODE$4=engineIsNode,set$6=global$e.setImmediate,clear=global$e.clearImmediate,process$3=global$e.process,Dispatch=global$e.Dispatch,Function$2=global$e.Function,MessageChannel=global$e.MessageChannel,String$1=global$e.String,counter=0,queue$2={},ONREADYSTATECHANGE="onreadystatechange";fails$h((function(){$location=global$e.location}));var run=function(e){if(hasOwn$5(queue$2,e)){var t=queue$2[e];delete queue$2[e],t()}},runner=function(e){return function(){run(e)}},eventListener=function(e){run(e.data)},globalPostMessageDefer=function(e){global$e.postMessage(String$1(e),$location.protocol+"//"+$location.host)};set$6&&clear||(set$6=function(e){validateArgumentsLength$4(arguments.length,1);var t=isCallable$9(e)?e:Function$2(e),r=arraySlice$5(arguments,1);return queue$2[++counter]=function(){apply$4(t,void 0,r)},defer(counter),counter},clear=function(e){delete queue$2[e]},IS_NODE$4?defer=function(e){process$3.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=eventListener,defer=bind$n(port.postMessage,port)):global$e.addEventListener&&isCallable$9(global$e.postMessage)&&!global$e.importScripts&&$location&&"file:"!==$location.protocol&&!fails$h(globalPostMessageDefer)?(defer=globalPostMessageDefer,global$e.addEventListener("message",eventListener,!1)):defer=ONREADYSTATECHANGE in createElement("script")?function(e){html.appendChild(createElement("script"))[ONREADYSTATECHANGE]=function(){html.removeChild(this),run(e)}}:function(e){setTimeout(runner(e),0)});var task$1={set:set$6,clear:clear},Queue$2=function(){this.head=null,this.tail=null};Queue$2.prototype={add:function(e){var t={item:e,next:null},r=this.tail;r?r.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}};var notify$1,toggle,node,promise$6,then,queue$1=Queue$2,userAgent$4=engineUserAgent,engineIsIosPebble=/ipad|iphone|ipod/i.test(userAgent$4)&&"undefined"!=typeof Pebble,userAgent$3=engineUserAgent,engineIsWebosWebkit=/web0s(?!.*chrome)/i.test(userAgent$3),global$d=global$s,bind$m=functionBindContext,getOwnPropertyDescriptor$8=objectGetOwnPropertyDescriptor.f,macrotask=task$1.set,Queue$1=queue$1,IS_IOS=engineIsIos,IS_IOS_PEBBLE=engineIsIosPebble,IS_WEBOS_WEBKIT=engineIsWebosWebkit,IS_NODE$3=engineIsNode,MutationObserver=global$d.MutationObserver||global$d.WebKitMutationObserver,document$2=global$d.document,process$2=global$d.process,Promise$1=global$d.Promise,queueMicrotaskDescriptor=getOwnPropertyDescriptor$8(global$d,"queueMicrotask"),microtask$1=queueMicrotaskDescriptor&&queueMicrotaskDescriptor.value;if(!microtask$1){var queue=new Queue$1,flush=function(){var e,t;for(IS_NODE$3&&(e=process$2.domain)&&e.exit();t=queue.get();)try{t()}catch(e){throw queue.head&¬ify$1(),e}e&&e.enter()};IS_IOS||IS_NODE$3||IS_WEBOS_WEBKIT||!MutationObserver||!document$2?!IS_IOS_PEBBLE&&Promise$1&&Promise$1.resolve?((promise$6=Promise$1.resolve(void 0)).constructor=Promise$1,then=bind$m(promise$6.then,promise$6),notify$1=function(){then(flush)}):IS_NODE$3?notify$1=function(){process$2.nextTick(flush)}:(macrotask=bind$m(macrotask,global$d),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}),microtask$1=function(e){queue.head||notify$1(),queue.add(e)}}var microtask_1=microtask$1,hostReportErrors$1=function(e,t){try{1==arguments.length?console.error(e):console.error(e,t)}catch(e){}},perform$6=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},global$c=global$s,promiseNativeConstructor=global$c.Promise,engineIsDeno="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,IS_DENO$1=engineIsDeno,IS_NODE$2=engineIsNode,engineIsBrowser=!IS_DENO$1&&!IS_NODE$2&&"object"==typeof window&&"object"==typeof document,global$b=global$s,NativePromiseConstructor$5=promiseNativeConstructor,isCallable$8=isCallable$q,isForced=isForced_1,inspectSource=inspectSource$2,wellKnownSymbol$6=wellKnownSymbol$q,IS_BROWSER=engineIsBrowser,IS_DENO=engineIsDeno,V8_VERSION=engineV8Version,NativePromisePrototype$2=NativePromiseConstructor$5&&NativePromiseConstructor$5.prototype,SPECIES$1=wellKnownSymbol$6("species"),SUBCLASSING=!1,NATIVE_PROMISE_REJECTION_EVENT$1=isCallable$8(global$b.PromiseRejectionEvent),FORCED_PROMISE_CONSTRUCTOR$5=isForced("Promise",(function(){var e=inspectSource(NativePromiseConstructor$5),t=e!==String(NativePromiseConstructor$5);if(!t&&66===V8_VERSION)return!0;if(!NativePromisePrototype$2.catch||!NativePromisePrototype$2.finally)return!0;if(!V8_VERSION||V8_VERSION<51||!/native code/.test(e)){var r=new NativePromiseConstructor$5((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};if((r.constructor={})[SPECIES$1]=n,!(SUBCLASSING=r.then((function(){}))instanceof n))return!0}return!t&&(IS_BROWSER||IS_DENO)&&!NATIVE_PROMISE_REJECTION_EVENT$1})),promiseConstructorDetection={CONSTRUCTOR:FORCED_PROMISE_CONSTRUCTOR$5,REJECTION_EVENT:NATIVE_PROMISE_REJECTION_EVENT$1,SUBCLASSING:SUBCLASSING},newPromiseCapability$2={},aCallable$e=aCallable$j,$TypeError$6=TypeError,PromiseCapability=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw $TypeError$6("Bad Promise constructor");t=e,r=n})),this.resolve=aCallable$e(t),this.reject=aCallable$e(r)};newPromiseCapability$2.f=function(e){return new PromiseCapability(e)};var $$1b=_export,IS_NODE$1=engineIsNode,global$a=global$s,call$e=functionCall,defineBuiltIn$3=defineBuiltIn$8,setToStringTag$3=setToStringTag$9,setSpecies$1=setSpecies$2,aCallable$d=aCallable$j,isCallable$7=isCallable$q,isObject$b=isObject$l,anInstance$4=anInstance$5,speciesConstructor$1=speciesConstructor$2,task=task$1.set,microtask=microtask_1,hostReportErrors=hostReportErrors$1,perform$5=perform$6,Queue=queue$1,InternalStateModule$4=internalState,NativePromiseConstructor$4=promiseNativeConstructor,PromiseConstructorDetection=promiseConstructorDetection,newPromiseCapabilityModule$6=newPromiseCapability$2,PROMISE="Promise",FORCED_PROMISE_CONSTRUCTOR$4=PromiseConstructorDetection.CONSTRUCTOR,NATIVE_PROMISE_REJECTION_EVENT=PromiseConstructorDetection.REJECTION_EVENT;PromiseConstructorDetection.SUBCLASSING;var Internal,OwnPromiseCapability,PromiseWrapper,getInternalPromiseState=InternalStateModule$4.getterFor(PROMISE),setInternalState$4=InternalStateModule$4.set,NativePromisePrototype$1=NativePromiseConstructor$4&&NativePromiseConstructor$4.prototype,PromiseConstructor=NativePromiseConstructor$4,PromisePrototype=NativePromisePrototype$1,TypeError$3=global$a.TypeError,document$1=global$a.document,process$1=global$a.process,newPromiseCapability$1=newPromiseCapabilityModule$6.f,newGenericPromiseCapability=newPromiseCapability$1,DISPATCH_EVENT=!!(document$1&&document$1.createEvent&&global$a.dispatchEvent),UNHANDLED_REJECTION="unhandledrejection",REJECTION_HANDLED="rejectionhandled",PENDING=0,FULFILLED=1,REJECTED=2,HANDLED=1,UNHANDLED=2,isThenable=function(e){var t;return!(!isObject$b(e)||!isCallable$7(t=e.then))&&t},callReaction=function(e,t){var r,n,o,i=t.value,a=t.state==FULFILLED,s=a?e.ok:e.fail,l=e.resolve,c=e.reject,u=e.domain;try{s?(a||(t.rejection===UNHANDLED&&onHandleUnhandled(t),t.rejection=HANDLED),!0===s?r=i:(u&&u.enter(),r=s(i),u&&(u.exit(),o=!0)),r===e.promise?c(TypeError$3("Promise-chain cycle")):(n=isThenable(r))?call$e(n,r,l,c):l(r)):c(i)}catch(e){u&&!o&&u.exit(),c(e)}},notify=function(e,t){e.notified||(e.notified=!0,microtask((function(){for(var r,n=e.reactions;r=n.get();)callReaction(r,e);e.notified=!1,t&&!e.rejection&&onUnhandled(e)})))},dispatchEvent=function(e,t,r){var n,o;DISPATCH_EVENT?((n=document$1.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),global$a.dispatchEvent(n)):n={promise:t,reason:r},!NATIVE_PROMISE_REJECTION_EVENT&&(o=global$a["on"+e])?o(n):e===UNHANDLED_REJECTION&&hostReportErrors("Unhandled promise rejection",r)},onUnhandled=function(e){call$e(task,global$a,(function(){var t,r=e.facade,n=e.value;if(isUnhandled(e)&&(t=perform$5((function(){IS_NODE$1?process$1.emit("unhandledRejection",n,r):dispatchEvent(UNHANDLED_REJECTION,r,n)})),e.rejection=IS_NODE$1||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$a,(function(){var t=e.facade;IS_NODE$1?process$1.emit("rejectionHandled",t):dispatchEvent(REJECTION_HANDLED,t,e.value)}))},bind$l=function(e,t,r){return function(n){e(t,n,r)}},internalReject=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=REJECTED,notify(e,!0))},internalResolve=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw TypeError$3("Promise can't be resolved itself");var n=isThenable(t);n?microtask((function(){var r={done:!1};try{call$e(n,t,bind$l(internalResolve,r,e),bind$l(internalReject,r,e))}catch(t){internalReject(r,t,e)}})):(e.value=t,e.state=FULFILLED,notify(e,!1))}catch(t){internalReject({done:!1},t,e)}}};FORCED_PROMISE_CONSTRUCTOR$4&&(PromisePrototype=(PromiseConstructor=function(e){anInstance$4(this,PromisePrototype),aCallable$d(e),call$e(Internal,this);var t=getInternalPromiseState(this);try{e(bind$l(internalResolve,t),bind$l(internalReject,t))}catch(e){internalReject(t,e)}}).prototype,(Internal=function(e){setInternalState$4(this,{type:PROMISE,done:!1,notified:!1,parent:!1,reactions:new Queue,rejection:!1,state:PENDING,value:void 0})}).prototype=defineBuiltIn$3(PromisePrototype,"then",(function(e,t){var r=getInternalPromiseState(this),n=newPromiseCapability$1(speciesConstructor$1(this,PromiseConstructor));return r.parent=!0,n.ok=!isCallable$7(e)||e,n.fail=isCallable$7(t)&&t,n.domain=IS_NODE$1?process$1.domain:void 0,r.state==PENDING?r.reactions.add(n):microtask((function(){callReaction(n,r)})),n.promise})),OwnPromiseCapability=function(){var e=new Internal,t=getInternalPromiseState(e);this.promise=e,this.resolve=bind$l(internalResolve,t),this.reject=bind$l(internalReject,t)},newPromiseCapabilityModule$6.f=newPromiseCapability$1=function(e){return e===PromiseConstructor||e===PromiseWrapper?new OwnPromiseCapability(e):newGenericPromiseCapability(e)}),$$1b({global:!0,constructor:!0,wrap:!0,forced:FORCED_PROMISE_CONSTRUCTOR$4},{Promise:PromiseConstructor}),setToStringTag$3(PromiseConstructor,PROMISE,!1,!0),setSpecies$1(PROMISE);var wellKnownSymbol$5=wellKnownSymbol$q,ITERATOR$4=wellKnownSymbol$5("iterator"),SAFE_CLOSING=!1;try{var called=0,iteratorWithReturn={next:function(){return{done:!!called++}},return:function(){SAFE_CLOSING=!0}};iteratorWithReturn[ITERATOR$4]=function(){return this},Array.from(iteratorWithReturn,(function(){throw 2}))}catch(e){}var checkCorrectnessOfIteration$2=function(e,t){if(!t&&!SAFE_CLOSING)return!1;var r=!1;try{var n={};n[ITERATOR$4]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(e){}return r},NativePromiseConstructor$3=promiseNativeConstructor,checkCorrectnessOfIteration$1=checkCorrectnessOfIteration$2,FORCED_PROMISE_CONSTRUCTOR$3=promiseConstructorDetection.CONSTRUCTOR,promiseStaticsIncorrectIteration=FORCED_PROMISE_CONSTRUCTOR$3||!checkCorrectnessOfIteration$1((function(e){NativePromiseConstructor$3.all(e).then(void 0,(function(){}))})),$$1a=_export,call$d=functionCall,aCallable$c=aCallable$j,newPromiseCapabilityModule$5=newPromiseCapability$2,perform$4=perform$6,iterate$j=iterate$l,PROMISE_STATICS_INCORRECT_ITERATION$3=promiseStaticsIncorrectIteration;$$1a({target:"Promise",stat:!0,forced:PROMISE_STATICS_INCORRECT_ITERATION$3},{all:function(e){var t=this,r=newPromiseCapabilityModule$5.f(t),n=r.resolve,o=r.reject,i=perform$4((function(){var r=aCallable$c(t.resolve),i=[],a=0,s=1;iterate$j(e,(function(e){var l=a++,c=!1;s++,call$d(r,t,e).then((function(e){c||(c=!0,i[l]=e,--s||n(i))}),o)})),--s||n(i)}));return i.error&&o(i.value),r.promise}});var $$19=_export,FORCED_PROMISE_CONSTRUCTOR$2=promiseConstructorDetection.CONSTRUCTOR,NativePromiseConstructor$2=promiseNativeConstructor;promiseNativeConstructor&&promiseNativeConstructor.prototype,$$19({target:"Promise",proto:!0,forced:FORCED_PROMISE_CONSTRUCTOR$2,real:!0},{catch:function(e){return this.then(void 0,e)}});var $$18=_export,call$c=functionCall,aCallable$b=aCallable$j,newPromiseCapabilityModule$4=newPromiseCapability$2,perform$3=perform$6,iterate$i=iterate$l,PROMISE_STATICS_INCORRECT_ITERATION$2=promiseStaticsIncorrectIteration;$$18({target:"Promise",stat:!0,forced:PROMISE_STATICS_INCORRECT_ITERATION$2},{race:function(e){var t=this,r=newPromiseCapabilityModule$4.f(t),n=r.reject,o=perform$3((function(){var o=aCallable$b(t.resolve);iterate$i(e,(function(e){call$c(o,t,e).then(r.resolve,n)}))}));return o.error&&n(o.value),r.promise}});var $$17=_export,call$b=functionCall,newPromiseCapabilityModule$3=newPromiseCapability$2,FORCED_PROMISE_CONSTRUCTOR$1=promiseConstructorDetection.CONSTRUCTOR;$$17({target:"Promise",stat:!0,forced:FORCED_PROMISE_CONSTRUCTOR$1},{reject:function(e){var t=newPromiseCapabilityModule$3.f(this);return call$b(t.reject,void 0,e),t.promise}});var anObject$5=anObject$g,isObject$a=isObject$l,newPromiseCapability=newPromiseCapability$2,promiseResolve$2=function(e,t){if(anObject$5(e),isObject$a(t)&&t.constructor===e)return t;var r=newPromiseCapability.f(e);return(0,r.resolve)(t),r.promise},$$16=_export,getBuiltIn$5=getBuiltIn$h,IS_PURE$1=isPure,NativePromiseConstructor$1=promiseNativeConstructor,FORCED_PROMISE_CONSTRUCTOR=promiseConstructorDetection.CONSTRUCTOR,promiseResolve$1=promiseResolve$2,PromiseConstructorWrapper=getBuiltIn$5("Promise"),CHECK_WRAPPER=!FORCED_PROMISE_CONSTRUCTOR;$$16({target:"Promise",stat:!0,forced:IS_PURE$1},{resolve:function(e){return promiseResolve$1(CHECK_WRAPPER&&this===PromiseConstructorWrapper?NativePromiseConstructor$1:this,e)}});var $$15=_export,call$a=functionCall,aCallable$a=aCallable$j,newPromiseCapabilityModule$2=newPromiseCapability$2,perform$2=perform$6,iterate$h=iterate$l,PROMISE_STATICS_INCORRECT_ITERATION$1=promiseStaticsIncorrectIteration;$$15({target:"Promise",stat:!0,forced:PROMISE_STATICS_INCORRECT_ITERATION$1},{allSettled:function(e){var t=this,r=newPromiseCapabilityModule$2.f(t),n=r.resolve,o=r.reject,i=perform$2((function(){var r=aCallable$a(t.resolve),o=[],i=0,a=1;iterate$h(e,(function(e){var s=i++,l=!1;a++,call$a(r,t,e).then((function(e){l||(l=!0,o[s]={status:"fulfilled",value:e},--a||n(o))}),(function(e){l||(l=!0,o[s]={status:"rejected",reason:e},--a||n(o))}))})),--a||n(o)}));return i.error&&o(i.value),r.promise}});var $$14=_export,call$9=functionCall,aCallable$9=aCallable$j,getBuiltIn$4=getBuiltIn$h,newPromiseCapabilityModule$1=newPromiseCapability$2,perform$1=perform$6,iterate$g=iterate$l,PROMISE_STATICS_INCORRECT_ITERATION=promiseStaticsIncorrectIteration,PROMISE_ANY_ERROR="No one promise resolved";$$14({target:"Promise",stat:!0,forced:PROMISE_STATICS_INCORRECT_ITERATION},{any:function(e){var t=this,r=getBuiltIn$4("AggregateError"),n=newPromiseCapabilityModule$1.f(t),o=n.resolve,i=n.reject,a=perform$1((function(){var n=aCallable$9(t.resolve),a=[],s=0,l=1,c=!1;iterate$g(e,(function(e){var u=s++,p=!1;l++,call$9(n,t,e).then((function(e){p||c||(c=!0,o(e))}),(function(e){p||c||(p=!0,a[u]=e,--l||i(new r(a,PROMISE_ANY_ERROR)))}))})),--l||i(new r(a,PROMISE_ANY_ERROR))}));return a.error&&i(a.value),n.promise}});var $$13=_export,NativePromiseConstructor=promiseNativeConstructor,fails$g=fails$B,getBuiltIn$3=getBuiltIn$h,isCallable$6=isCallable$q,speciesConstructor=speciesConstructor$2,promiseResolve=promiseResolve$2,NativePromisePrototype=NativePromiseConstructor&&NativePromiseConstructor.prototype,NON_GENERIC=!!NativePromiseConstructor&&fails$g((function(){NativePromisePrototype.finally.call({then:function(){}},(function(){}))}));$$13({target:"Promise",proto:!0,real:!0,forced:NON_GENERIC},{finally:function(e){var t=speciesConstructor(this,getBuiltIn$3("Promise")),r=isCallable$6(e);return this.then(r?function(r){return promiseResolve(t,e()).then((function(){return r}))}:e,r?function(r){return promiseResolve(t,e()).then((function(){throw r}))}:e)}});var path$p=path$z,promise$5=path$p.Promise,parent$2g=promise$5,promise$4=parent$2g,parent$2f=promise$4,promise$3=parent$2f,$$12=_export,newPromiseCapabilityModule=newPromiseCapability$2,perform=perform$6;$$12({target:"Promise",stat:!0,forced:!0},{try:function(e){var t=newPromiseCapabilityModule.f(this),r=perform(e);return(r.error?t.reject:t.resolve)(r.value),t.promise}});var parent$2e=promise$3,promise$2=parent$2e,promise$1=promise$2,_Promise$1=getDefaultExportFromCjs(promise$1),$$11=_export,uncurryThis$h=functionUncurryThis,isArray$8=isArray$d,nativeReverse=uncurryThis$h([].reverse),test$1=[1,2];$$11({target:"Array",proto:!0,forced:String(test$1)===String(test$1.reverse())},{reverse:function(){return isArray$8(this)&&(this.length=this.length),nativeReverse(this)}});var entryVirtual$l=entryVirtual$o,reverse$6=entryVirtual$l("Array").reverse,isPrototypeOf$k=objectIsPrototypeOf,method$j=reverse$6,ArrayPrototype$g=Array.prototype,reverse$5=function(e){var t=e.reverse;return e===ArrayPrototype$g||isPrototypeOf$k(ArrayPrototype$g,e)&&t===ArrayPrototype$g.reverse?method$j:t},parent$2d=reverse$5,reverse$4=parent$2d,parent$2c=reverse$4,reverse$3=parent$2c,parent$2b=reverse$3,reverse$2=parent$2b,reverse$1=reverse$2,_reverseInstanceProperty$1=getDefaultExportFromCjs(reverse$1),$$10=_export,isArray$7=isArray$d,isConstructor$1=isConstructor$4,isObject$9=isObject$l,toAbsoluteIndex$3=toAbsoluteIndex$6,lengthOfArrayLike$7=lengthOfArrayLike$e,toIndexedObject$4=toIndexedObject$c,createProperty$3=createProperty$6,wellKnownSymbol$4=wellKnownSymbol$q,arrayMethodHasSpeciesSupport$3=arrayMethodHasSpeciesSupport$5,nativeSlice=arraySlice$7,HAS_SPECIES_SUPPORT$3=arrayMethodHasSpeciesSupport$3("slice"),SPECIES=wellKnownSymbol$4("species"),$Array$1=Array,max$1=Math.max;$$10({target:"Array",proto:!0,forced:!HAS_SPECIES_SUPPORT$3},{slice:function(e,t){var r,n,o,i=toIndexedObject$4(this),a=lengthOfArrayLike$7(i),s=toAbsoluteIndex$3(e,a),l=toAbsoluteIndex$3(void 0===t?a:t,a);if(isArray$7(i)&&(r=i.constructor,(isConstructor$1(r)&&(r===$Array$1||isArray$7(r.prototype))||isObject$9(r)&&null===(r=r[SPECIES]))&&(r=void 0),r===$Array$1||void 0===r))return nativeSlice(i,s,l);for(n=new(void 0===r?$Array$1:r)(max$1(l-s,0)),o=0;s<l;s++,o++)s in i&&createProperty$3(n,o,i[s]);return n.length=o,n}});var entryVirtual$k=entryVirtual$o,slice$6=entryVirtual$k("Array").slice,isPrototypeOf$j=objectIsPrototypeOf,method$i=slice$6,ArrayPrototype$f=Array.prototype,slice$5=function(e){var t=e.slice;return e===ArrayPrototype$f||isPrototypeOf$j(ArrayPrototype$f,e)&&t===ArrayPrototype$f.slice?method$i:t},parent$2a=slice$5,slice$4=parent$2a,parent$29=slice$4,slice$3=parent$29,parent$28=slice$3,slice$2=parent$28,slice$1=slice$2,_sliceInstanceProperty$1=getDefaultExportFromCjs(slice$1);function _regeneratorRuntime$1(){_regeneratorRuntime$1=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=_Object$defineProperty$1||function(e,t,r){e[t]=r.value},o="function"==typeof _Symbol$1?_Symbol$1:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function l(e,t,r){return _Object$defineProperty$1(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,o){var i=t&&t.prototype instanceof f?t:f,a=_Object$create$1(i.prototype),s=new T(o||[]);return n(a,"_invoke",{value:_(e,r,s)}),a}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var p={};function f(){}function d(){}function h(){}var $={};l($,i,(function(){return this}));var y=_Object$getPrototypeOf$1&&_Object$getPrototypeOf$1(_Object$getPrototypeOf$1(S([])));y&&y!==t&&r.call(y,i)&&($=y);var g=h.prototype=f.prototype=_Object$create$1($);function v(e){var t;_forEachInstanceProperty$1(t=["next","throw","return"]).call(t,(function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function m(e,t){function o(n,i,a,s){var l=u(e[n],e,i);if("throw"!==l.type){var c=l.arg,p=c.value;return p&&"object"==_typeof$3(p)&&r.call(p,"__await")?t.resolve(p.__await).then((function(e){o("next",e,a,s)}),(function(e){o("throw",e,a,s)})):t.resolve(p).then((function(e){c.value=e,a(c)}),(function(e){return o("throw",e,a,s)}))}s(l.arg)}var i;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){o(e,r,t,n)}))}return i=i?i.then(n,n):n()}})}function _(e,t,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=b(a,r);if(s){if(s===p)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===p)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function b(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,b(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),p;var o=u(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,p;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function I(e){var t,r={tryLoc:e[0]};1 in e&&(r.catchLoc=e[1]),2 in e&&(r.finallyLoc=e[2],r.afterLoc=e[3]),_pushInstanceProperty(t=this.tryEntries).call(t,r)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],_forEachInstanceProperty$1(e).call(e,I,this),this.reset(!0)}function S(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:P}}function P(){return{value:void 0,done:!0}}return d.prototype=h,n(g,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:d,configurable:!0}),d.displayName=l(h,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return _Object$setPrototypeOf$1?_Object$setPrototypeOf$1(e,h):(e.__proto__=h,l(e,s,"GeneratorFunction")),e.prototype=_Object$create$1(g),e},e.awrap=function(e){return{__await:e}},v(m.prototype),l(m.prototype,a,(function(){return this})),e.AsyncIterator=m,e.async=function(t,r,n,o,i){void 0===i&&(i=_Promise$1);var a=new m(c(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},v(g),l(g,s,"Generator"),l(g,i,(function(){return this})),l(g,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)_pushInstanceProperty(r).call(r,n);return _reverseInstanceProperty$1(r).call(r),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,T.prototype={constructor:T,reset:function(e){var t;if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,_forEachInstanceProperty$1(t=this.tryEntries).call(t,E),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+_sliceInstanceProperty$1(n).call(n,1))&&(this[n]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),l=r.call(i,"finallyLoc");if(s&&l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(r),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},e}function asyncGeneratorStep$1(e,t,r,n,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void r(e)}s.done?t(l):_Promise$1.resolve(l).then(n,o)}function _asyncToGenerator$1(e){return function(){var t=this,r=arguments;return new _Promise$1((function(n,o){var i=e.apply(t,r);function a(e){asyncGeneratorStep$1(i,n,o,a,s,"next",e)}function s(e){asyncGeneratorStep$1(i,n,o,a,s,"throw",e)}a(void 0)}))}}function _classCallCheck$3(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var WrappedWellKnownSymbolModule=wellKnownSymbolWrapped,toPrimitive$5=WrappedWellKnownSymbolModule.f("toPrimitive"),parent$27=toPrimitive$5,toPrimitive$4=parent$27,parent$26=toPrimitive$4,toPrimitive$3=parent$26,parent$25=toPrimitive$3,toPrimitive$2=parent$25,toPrimitive$1=toPrimitive$2,_Symbol$toPrimitive$1=getDefaultExportFromCjs(toPrimitive$1);function _toPrimitive$3(e,t){if("object"!==_typeof$3(e)||null===e)return e;var r=e[_Symbol$toPrimitive$1];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==_typeof$3(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _toPropertyKey$3(e){var t=_toPrimitive$3(e,"string");return"symbol"===_typeof$3(t)?t:String(t)}function _defineProperties$3(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),_Object$defineProperty$1(e,_toPropertyKey$3(n.key),n)}}function _createClass$3(e,t,r){return t&&_defineProperties$3(e.prototype,t),r&&_defineProperties$3(e,r),_Object$defineProperty$1(e,"prototype",{writable:!1}),e}function _assertThisInitialized$2(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var hasOwn$4=hasOwnProperty_1,isDataDescriptor$1=function(e){return void 0!==e&&(hasOwn$4(e,"value")||hasOwn$4(e,"writable"))},$$$=_export,call$8=functionCall,isObject$8=isObject$l,anObject$4=anObject$g,isDataDescriptor=isDataDescriptor$1,getOwnPropertyDescriptorModule$1=objectGetOwnPropertyDescriptor,getPrototypeOf$1=objectGetPrototypeOf;function get$8(e,t){var r,n,o=arguments.length<3?e:arguments[2];return anObject$4(e)===o?e[t]:(r=getOwnPropertyDescriptorModule$1.f(e,t))?isDataDescriptor(r)?r.value:void 0===r.get?void 0:call$8(r.get,o):isObject$8(n=getPrototypeOf$1(e))?get$8(n,t,o):void 0}$$$({target:"Reflect",stat:!0},{get:get$8});var path$o=path$z,get$7=path$o.Reflect.get,parent$24=get$7,get$6=parent$24,parent$23=get$6,get$5=parent$23,parent$22=get$5,get$4=parent$22,get$3=get$4,_Reflect$get$1=getDefaultExportFromCjs(get$3),uncurryThis$g=functionUncurryThis,aCallable$8=aCallable$j,isObject$7=isObject$l,hasOwn$3=hasOwnProperty_1,arraySlice$4=arraySlice$7,NATIVE_BIND=functionBindNative,$Function=Function,concat$8=uncurryThis$g([].concat),join$3=uncurryThis$g([].join),factories={},construct$6=function(e,t,r){if(!hasOwn$3(factories,t)){for(var n=[],o=0;o<t;o++)n[o]="a["+o+"]";factories[t]=$Function("C,a","return new C("+join$3(n,",")+")")}return factories[t](e,r)},functionBind=NATIVE_BIND?$Function.bind:function(e){var t=aCallable$8(this),r=t.prototype,n=arraySlice$4(arguments,1),o=function(){var r=concat$8(n,arraySlice$4(arguments));return this instanceof o?construct$6(t,r.length,r):t.apply(e,r)};return isObject$7(r)&&(o.prototype=r),o},$$_=_export,bind$k=functionBind;$$_({target:"Function",proto:!0,forced:Function.bind!==bind$k},{bind:bind$k});var entryVirtual$j=entryVirtual$o,bind$j=entryVirtual$j("Function").bind,isPrototypeOf$i=objectIsPrototypeOf,method$h=bind$j,FunctionPrototype=Function.prototype,bind$i=function(e){var t=e.bind;return e===FunctionPrototype||isPrototypeOf$i(FunctionPrototype,e)&&t===FunctionPrototype.bind?method$h:t},parent$21=bind$i,bind$h=parent$21,parent$20=bind$h,bind$g=parent$20,parent$1$=bind$g,bind$f=parent$1$,bind$e=bind$f,_bindInstanceProperty$1=getDefaultExportFromCjs(bind$e),getOwnPropertyDescriptor$7={exports:{}},$$Z=_export,fails$f=fails$B,toIndexedObject$3=toIndexedObject$c,nativeGetOwnPropertyDescriptor=objectGetOwnPropertyDescriptor.f,DESCRIPTORS$9=descriptors$2,FORCED$7=!DESCRIPTORS$9||fails$f((function(){nativeGetOwnPropertyDescriptor(1)}));$$Z({target:"Object",stat:!0,forced:FORCED$7,sham:!DESCRIPTORS$9},{getOwnPropertyDescriptor:function(e,t){return nativeGetOwnPropertyDescriptor(toIndexedObject$3(e),t)}});var path$n=path$z,Object$3=path$n.Object,getOwnPropertyDescriptor$6=getOwnPropertyDescriptor$7.exports=function(e,t){return Object$3.getOwnPropertyDescriptor(e,t)};Object$3.getOwnPropertyDescriptor.sham&&(getOwnPropertyDescriptor$6.sham=!0);var getOwnPropertyDescriptorExports=getOwnPropertyDescriptor$7.exports,parent$1_=getOwnPropertyDescriptorExports,getOwnPropertyDescriptor$5=parent$1_,parent$1Z=getOwnPropertyDescriptor$5,getOwnPropertyDescriptor$4=parent$1Z,parent$1Y=getOwnPropertyDescriptor$4,getOwnPropertyDescriptor$3=parent$1Y,getOwnPropertyDescriptor$2=getOwnPropertyDescriptor$3,_Object$getOwnPropertyDescriptor$1=getDefaultExportFromCjs(getOwnPropertyDescriptor$2);function _getPrototypeOf$2(e){var t;return(_getPrototypeOf$2=_Object$setPrototypeOf$1?_bindInstanceProperty$1(t=_Object$getPrototypeOf$1).call(t):function(e){return e.__proto__||_Object$getPrototypeOf$1(e)})(e)}function _superPropBase$2(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf$2(e)););return e}function _get$2(){var e;"undefined"!=typeof Reflect&&_Reflect$get$1?_get$2=_bindInstanceProperty$1(e=_Reflect$get$1).call(e):_get$2=function(e,t,r){var n=_superPropBase$2(e,t);if(n){var o=_Object$getOwnPropertyDescriptor$1(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}};return _get$2.apply(this,arguments)}function _setPrototypeOf$2(e,t){var r;return(_setPrototypeOf$2=_Object$setPrototypeOf$1?_bindInstanceProperty$1(r=_Object$setPrototypeOf$1).call(r):function(e,t){return e.__proto__=t,e})(e,t)}function _inherits$2(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=_Object$create$1(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),_Object$defineProperty$1(e,"prototype",{writable:!1}),t&&_setPrototypeOf$2(e,t)}var $$Y=_export,getBuiltIn$2=getBuiltIn$h,apply$3=functionApply,bind$d=functionBind,aConstructor$1=aConstructor$3,anObject$3=anObject$g,isObject$6=isObject$l,create$3=objectCreate,fails$e=fails$B,nativeConstruct=getBuiltIn$2("Reflect","construct"),ObjectPrototype=Object.prototype,push$7=[].push,NEW_TARGET_BUG=fails$e((function(){function e(){}return!(nativeConstruct((function(){}),[],e)instanceof e)})),ARGS_BUG=!fails$e((function(){nativeConstruct((function(){}))})),FORCED$6=NEW_TARGET_BUG||ARGS_BUG;$$Y({target:"Reflect",stat:!0,forced:FORCED$6,sham:FORCED$6},{construct:function(e,t){aConstructor$1(e),anObject$3(t);var r=arguments.length<3?e:aConstructor$1(arguments[2]);if(ARGS_BUG&&!NEW_TARGET_BUG)return nativeConstruct(e,t,r);if(e==r){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var n=[null];return apply$3(push$7,n,t),new(apply$3(bind$d,e,n))}var o=r.prototype,i=create$3(isObject$6(o)?o:ObjectPrototype),a=apply$3(e,i,t);return isObject$6(a)?a:i}});var path$m=path$z,construct$5=path$m.Reflect.construct,parent$1X=construct$5,construct$4=parent$1X,parent$1W=construct$4,construct$3=parent$1W,parent$1V=construct$3,construct$2=parent$1V,construct$1=construct$2,_Reflect$construct$1=getDefaultExportFromCjs(construct$1);function _isNativeReflectConstruct$2(){if("undefined"==typeof Reflect||!_Reflect$construct$1)return!1;if(_Reflect$construct$1.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(_Reflect$construct$1(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _possibleConstructorReturn$2(e,t){if(t&&("object"===_typeof$3(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$2(e)}function _createSuper$2(e){var t=_isNativeReflectConstruct$2();return function(){var r,n=_getPrototypeOf$2(e);if(t){var o=_getPrototypeOf$2(this).constructor;r=_Reflect$construct$1(n,arguments,o)}else r=n.apply(this,arguments);return _possibleConstructorReturn$2(this,r)}}function _defineProperty$3(e,t,r){return(t=_toPropertyKey$3(t))in e?_Object$defineProperty$1(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var entryVirtual$i=entryVirtual$o,concat$7=entryVirtual$i("Array").concat,isPrototypeOf$h=objectIsPrototypeOf,method$g=concat$7,ArrayPrototype$e=Array.prototype,concat$6=function(e){var t=e.concat;return e===ArrayPrototype$e||isPrototypeOf$h(ArrayPrototype$e,e)&&t===ArrayPrototype$e.concat?method$g:t},parent$1U=concat$6,concat$5=parent$1U,parent$1T=concat$5,concat$4=parent$1T,parent$1S=concat$4,concat$3=parent$1S,concat$2=concat$3,concat$1=concat$2,_concatInstanceProperty=getDefaultExportFromCjs(concat$1),AD_START="ad_start",AD_PLAY="ad_play",AD_PAUSE="ad_pause",AD_TIME_UPDATE="ad_time_update",AD_SKIPPED="ad_skipped",AD_ERROR="ad_error",AD_COMPLETE="ad_complete",AD_ALL_COMPLETED="ad_all_completed",IMA_SDK_LOAD_START="ima_sdk_load_start",IMA_SDK_LOAD_SUCCESS="ima_sdk_load_success",IMA_SDK_LOAD_ERROR="ima_sdk_load_error",IMA_AD_LOADER_READY="ima_ad_loader_ready",IMA_AD_MANAGER_READY="ima_ad_manager_ready",IMA_AD_ENDED="ima_ad_ended",IMA_AD_SKIPPED="ima_ad_skipped",IMA_AD_COMPLETE="ima_ad_complete",IMA_ALL_ADS_COMPLETED="ima_all_ads_completed",IMA_AD_ERROR="ima_ad_error",IMA_AD_SEEKING="ima_ad_seeking",IMA_AD_SEEKED="ima_ad_seeked",IMA_AD_LOADED="ima_ad_loaded",IMA_AD_BREAK_READY="ima_ad_break_ready",IMA_CONTENT_PAUSE_REQUESTED="ima_content_pause_requested",IMA_CONTENT_RESUME_REQUESTED="ima_content_resume_requested",IMA_READY_TO_PLAY="ima_ready_to_play",XGAdEvents=Object.freeze({__proto__:null,AD_ALL_COMPLETED:AD_ALL_COMPLETED,AD_COMPLETE:AD_COMPLETE,AD_ERROR:AD_ERROR,AD_PAUSE:AD_PAUSE,AD_PLAY:AD_PLAY,AD_SKIPPED:AD_SKIPPED,AD_START:AD_START,AD_TIME_UPDATE:AD_TIME_UPDATE,IMA_AD_BREAK_READY:IMA_AD_BREAK_READY,IMA_AD_COMPLETE:IMA_AD_COMPLETE,IMA_AD_ENDED:IMA_AD_ENDED,IMA_AD_ERROR:IMA_AD_ERROR,IMA_AD_LOADED:IMA_AD_LOADED,IMA_AD_LOADER_READY:IMA_AD_LOADER_READY,IMA_AD_MANAGER_READY:IMA_AD_MANAGER_READY,IMA_AD_SEEKED:IMA_AD_SEEKED,IMA_AD_SEEKING:IMA_AD_SEEKING,IMA_AD_SKIPPED:IMA_AD_SKIPPED,IMA_ALL_ADS_COMPLETED:IMA_ALL_ADS_COMPLETED,IMA_CONTENT_PAUSE_REQUESTED:IMA_CONTENT_PAUSE_REQUESTED,IMA_CONTENT_RESUME_REQUESTED:IMA_CONTENT_RESUME_REQUESTED,IMA_READY_TO_PLAY:IMA_READY_TO_PLAY,IMA_SDK_LOAD_ERROR:IMA_SDK_LOAD_ERROR,IMA_SDK_LOAD_START:IMA_SDK_LOAD_START,IMA_SDK_LOAD_SUCCESS:IMA_SDK_LOAD_SUCCESS}),path$l=path$z,apply$2=functionApply;path$l.JSON||(path$l.JSON={stringify:JSON.stringify});var stringify$5=function(e,t,r){return apply$2(path$l.JSON.stringify,null,arguments)},parent$1R=stringify$5,stringify$4=parent$1R,parent$1Q=stringify$4,stringify$3=parent$1Q,parent$1P=stringify$3,stringify$2=parent$1P,stringify$1=stringify$2,stringify2=stringify$1,_JSON$stringify=getDefaultExportFromCjs(stringify2),symbol=symbol$1,_Symbol=getDefaultExportFromCjs(symbol),getIteratorMethod$7=getIteratorMethod$a,getIteratorMethod_1=getIteratorMethod$7,parent$1O=getIteratorMethod_1,getIteratorMethod$6=parent$1O,parent$1N=getIteratorMethod$6,getIteratorMethod$5=parent$1N,parent$1M=getIteratorMethod$5,getIteratorMethod$4=parent$1M,getIteratorMethod$3=getIteratorMethod$4,_getIteratorMethod$1=getDefaultExportFromCjs(getIteratorMethod$3),getIteratorMethod$2=getIteratorMethod$3,_getIteratorMethod=getDefaultExportFromCjs(getIteratorMethod$2),$$X=_export,toObject$7=toObject$f,nativeKeys=objectKeys$4,fails$d=fails$B,FAILS_ON_PRIMITIVES$2=fails$d((function(){nativeKeys(1)}));$$X({target:"Object",stat:!0,forced:FAILS_ON_PRIMITIVES$2},{keys:function(e){return nativeKeys(toObject$7(e))}});var path$k=path$z,keys$5=path$k.Object.keys,parent$1L=keys$5,keys$4=parent$1L,parent$1K=keys$4,keys$3=parent$1K,parent$1J=keys$3,keys$2=parent$1J,keys$1=keys$2,_Object$keys$1=getDefaultExportFromCjs(keys$1),keys3=keys$1,_Object$keys=getDefaultExportFromCjs(keys3),path$j=path$z,getOwnPropertySymbols$5=path$j.Object.getOwnPropertySymbols,parent$1I=getOwnPropertySymbols$5,getOwnPropertySymbols$4=parent$1I,parent$1H=getOwnPropertySymbols$4,getOwnPropertySymbols$3=parent$1H,parent$1G=getOwnPropertySymbols$3,getOwnPropertySymbols$2=parent$1G,getOwnPropertySymbols$1=getOwnPropertySymbols$2,_Object$getOwnPropertySymbols$1=getDefaultExportFromCjs(getOwnPropertySymbols$1),getOwnPropertySymbols2=getOwnPropertySymbols$1,_Object$getOwnPropertySymbols=getDefaultExportFromCjs(getOwnPropertySymbols2),$$W=_export,$filter=arrayIteration.filter,arrayMethodHasSpeciesSupport$2=arrayMethodHasSpeciesSupport$5,HAS_SPECIES_SUPPORT$2=arrayMethodHasSpeciesSupport$2("filter");$$W({target:"Array",proto:!0,forced:!HAS_SPECIES_SUPPORT$2},{filter:function(e){return $filter(this,e,arguments.length>1?arguments[1]:void 0)}});var entryVirtual$h=entryVirtual$o,filter$6=entryVirtual$h("Array").filter,isPrototypeOf$g=objectIsPrototypeOf,method$f=filter$6,ArrayPrototype$d=Array.prototype,filter$5=function(e){var t=e.filter;return e===ArrayPrototype$d||isPrototypeOf$g(ArrayPrototype$d,e)&&t===ArrayPrototype$d.filter?method$f:t},parent$1F=filter$5,filter$4=parent$1F,parent$1E=filter$4,filter$3=parent$1E,parent$1D=filter$3,filter$2=parent$1D,filter$1=filter$2,_filterInstanceProperty$1=getDefaultExportFromCjs(filter$1),filter2=filter$1,_filterInstanceProperty=getDefaultExportFromCjs(filter2),getOwnPropertyDescriptor$1=getOwnPropertyDescriptor$2,_Object$getOwnPropertyDescriptor=getDefaultExportFromCjs(getOwnPropertyDescriptor$1),forEach$1=forEach$2,_forEachInstanceProperty=getDefaultExportFromCjs(forEach$1),$$V=_export,DESCRIPTORS$8=descriptors$2,ownKeys$3=ownKeys$5,toIndexedObject$2=toIndexedObject$c,getOwnPropertyDescriptorModule=objectGetOwnPropertyDescriptor,createProperty$2=createProperty$6;$$V({target:"Object",stat:!0,sham:!DESCRIPTORS$8},{getOwnPropertyDescriptors:function(e){for(var t,r,n=toIndexedObject$2(e),o=getOwnPropertyDescriptorModule.f,i=ownKeys$3(n),a={},s=0;i.length>s;)void 0!==(r=o(n,t=i[s++]))&&createProperty$2(a,t,r);return a}});var path$i=path$z,getOwnPropertyDescriptors$5=path$i.Object.getOwnPropertyDescriptors,parent$1C=getOwnPropertyDescriptors$5,getOwnPropertyDescriptors$4=parent$1C,parent$1B=getOwnPropertyDescriptors$4,getOwnPropertyDescriptors$3=parent$1B,parent$1A=getOwnPropertyDescriptors$3,getOwnPropertyDescriptors$2=parent$1A,getOwnPropertyDescriptors$1=getOwnPropertyDescriptors$2,_Object$getOwnPropertyDescriptors$1=getDefaultExportFromCjs(getOwnPropertyDescriptors$1),getOwnPropertyDescriptors2=getOwnPropertyDescriptors$1,_Object$getOwnPropertyDescriptors=getDefaultExportFromCjs(getOwnPropertyDescriptors2),defineProperties$7={exports:{}},$$U=_export,DESCRIPTORS$7=descriptors$2,defineProperties$6=objectDefineProperties.f;$$U({target:"Object",stat:!0,forced:Object.defineProperties!==defineProperties$6,sham:!DESCRIPTORS$7},{defineProperties:defineProperties$6});var path$h=path$z,Object$2=path$h.Object,defineProperties$5=defineProperties$7.exports=function(e,t){return Object$2.defineProperties(e,t)};Object$2.defineProperties.sham&&(defineProperties$5.sham=!0);var definePropertiesExports=defineProperties$7.exports,parent$1z=definePropertiesExports,defineProperties$4=parent$1z,parent$1y=defineProperties$4,defineProperties$3=parent$1y,parent$1x=defineProperties$3,defineProperties$2=parent$1x,defineProperties$1=defineProperties$2,_Object$defineProperties$1=getDefaultExportFromCjs(defineProperties$1),defineProperties4=defineProperties$1,_Object$defineProperties=getDefaultExportFromCjs(defineProperties4),defineProperty$3=defineProperty$4,_Object$defineProperty=getDefaultExportFromCjs(defineProperty$3),create$2=create$5,_Object$create=getDefaultExportFromCjs(create$2),getPrototypeOf2=getPrototypeOf$3,_Object$getPrototypeOf=getDefaultExportFromCjs(getPrototypeOf2),setPrototypeOf=setPrototypeOf$2,_Object$setPrototypeOf=getDefaultExportFromCjs(setPrototypeOf),promise=promise$1,_Promise=getDefaultExportFromCjs(promise),reverse2=reverse$1,_reverseInstanceProperty=getDefaultExportFromCjs(reverse2),slice2=slice$1,_sliceInstanceProperty=getDefaultExportFromCjs(slice2),iterator=iterator$1,_Symbol$iterator=getDefaultExportFromCjs(iterator),bind$c=bind$e,_bindInstanceProperty=getDefaultExportFromCjs(bind$c),construct2=construct$1,_Reflect$construct=getDefaultExportFromCjs(construct2),get$2=get$3,_Reflect$get=getDefaultExportFromCjs(get$2),$$T=_export,isArray$6=isArray$d;$$T({target:"Array",stat:!0},{isArray:isArray$6});var path$g=path$z,isArray$5=path$g.Array.isArray,parent$1w=isArray$5,isArray$4=parent$1w,parent$1v=isArray$4,isArray$3=parent$1v,parent$1u=isArray$3,isArray$2=parent$1u,isArray$1=isArray$2,_Array$isArray$1=getDefaultExportFromCjs(isArray$1),isArray2=isArray$1,_Array$isArray=getDefaultExportFromCjs(isArray2),anObject$2=anObject$g,iteratorClose=iteratorClose$2,callWithSafeIterationClosing$1=function(e,t,r,n){try{return n?t(anObject$2(r)[0],r[1]):t(r)}catch(t){iteratorClose(e,"throw",t)}},bind$b=functionBindContext,call$7=functionCall,toObject$6=toObject$f,callWithSafeIterationClosing=callWithSafeIterationClosing$1,isArrayIteratorMethod=isArrayIteratorMethod$2,isConstructor3=isConstructor$4,lengthOfArrayLike$6=lengthOfArrayLike$e,createProperty$1=createProperty$6,getIterator$1=getIterator$3,getIteratorMethod$1=getIteratorMethod$a,$Array=Array,arrayFrom$1=function(e){var t=toObject$6(e),r=isConstructor3(this),n=arguments.length,o=n>1?arguments[1]:void 0,i=void 0!==o;i&&(o=bind$b(o,n>2?arguments[2]:void 0));var a,s,l,c,u,p,f=getIteratorMethod$1(t),d=0;if(!f||this===$Array&&isArrayIteratorMethod(f))for(a=lengthOfArrayLike$6(t),s=r?new this(a):$Array(a);a>d;d++)p=i?o(t[d],d):t[d],createProperty$1(s,d,p);else for(u=(c=getIterator$1(t,f)).next,s=r?new this:[];!(l=call$7(u,c)).done;d++)p=i?callWithSafeIterationClosing(c,o,[l.value,d],!0):l.value,createProperty$1(s,d,p);return s.length=d,s},$$S=_export,from$7=arrayFrom$1,checkCorrectnessOfIteration=checkCorrectnessOfIteration$2,INCORRECT_ITERATION=!checkCorrectnessOfIteration((function(e){Array.from(e)}));$$S({target:"Array",stat:!0,forced:INCORRECT_ITERATION},{from:from$7});var path$f=path$z,from$6=path$f.Array.from,parent$1t=from$6,from$5=parent$1t,parent$1s=from$5,from$4=parent$1s,parent$1r=from$4,from$3=parent$1r,from$2=from$3,_Array$from$1=getDefaultExportFromCjs(from$2),from$1=from$2,_Array$from=getDefaultExportFromCjs(from$1),toPrimitive=toPrimitive$1,_Symbol$toPrimitive=getDefaultExportFromCjs(toPrimitive);function _iterableToArrayLimit$1(e,t){var r=null==e?null:void 0!==_Symbol&&_getIteratorMethod(e)||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],l=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}function ownKeys$2(e,t){var r=_Object$keys(e);if(_Object$getOwnPropertySymbols){var n=_Object$getOwnPropertySymbols(e);t&&(n=_filterInstanceProperty(n).call(n,(function(t){return _Object$getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread2$2(e){for(var t=1;t<arguments.length;t++){var r,n,o=null!=arguments[t]?arguments[t]:{};t%2?_forEachInstanceProperty(r=ownKeys$2(Object(o),!0)).call(r,(function(t){_defineProperty$2(e,t,o[t])})):_Object$getOwnPropertyDescriptors?_Object$defineProperties(e,_Object$getOwnPropertyDescriptors(o)):_forEachInstanceProperty(n=ownKeys$2(Object(o))).call(n,(function(t){_Object$defineProperty(e,t,_Object$getOwnPropertyDescriptor(o,t))}))}return e}function _regeneratorRuntime(){_regeneratorRuntime=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=_Object$defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof _Symbol?_Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function l(e,t,r){return _Object$defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,o){var i=t&&t.prototype instanceof f?t:f,a=_Object$create(i.prototype),s=new T(o||[]);return n(a,"_invoke",{value:_(e,r,s)}),a}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var p={};function f(){}function d(){}function h(){}var $={};l($,i,(function(){return this}));var y=_Object$getPrototypeOf&&_Object$getPrototypeOf(_Object$getPrototypeOf(S([])));y&&y!==t&&r.call(y,i)&&($=y);var g=h.prototype=f.prototype=_Object$create($);function v(e){var t;_forEachInstanceProperty(t=["next","throw","return"]).call(t,(function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function m(e,t){function o(n,i,a,s){var l=u(e[n],e,i);if("throw"!==l.type){var c=l.arg,p=c.value;return p&&"object"==_typeof$3(p)&&r.call(p,"__await")?t.resolve(p.__await).then((function(e){o("next",e,a,s)}),(function(e){o("throw",e,a,s)})):t.resolve(p).then((function(e){c.value=e,a(c)}),(function(e){return o("throw",e,a,s)}))}s(l.arg)}var i;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){o(e,r,t,n)}))}return i=i?i.then(n,n):n()}})}function _(e,t,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=b(a,r);if(s){if(s===p)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===p)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function b(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,b(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),p;var o=u(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,p;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function I(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],_forEachInstanceProperty(e).call(e,I,this),this.reset(!0)}function S(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:P}}function P(){return{value:void 0,done:!0}}return d.prototype=h,n(g,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:d,configurable:!0}),d.displayName=l(h,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return _Object$setPrototypeOf?_Object$setPrototypeOf(e,h):(e.__proto__=h,l(e,s,"GeneratorFunction")),e.prototype=_Object$create(g),e},e.awrap=function(e){return{__await:e}},v(m.prototype),l(m.prototype,a,(function(){return this})),e.AsyncIterator=m,e.async=function(t,r,n,o,i){void 0===i&&(i=_Promise);var a=new m(c(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},v(g),l(g,s,"Generator"),l(g,i,(function(){return this})),l(g,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return _reverseInstanceProperty(r).call(r),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,T.prototype={constructor:T,reset:function(e){var t;if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,_forEachInstanceProperty(t=this.tryEntries).call(t,E),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+_sliceInstanceProperty(n).call(n,1))&&(this[n]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),l=r.call(i,"finallyLoc");if(s&&l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(r),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},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 asyncGeneratorStep(e,t,r,n,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void r(e)}s.done?t(l):_Promise.resolve(l).then(n,o)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new _Promise((function(n,o){var i=e.apply(t,r);function a(e){asyncGeneratorStep(i,n,o,a,s,"next",e)}function s(e){asyncGeneratorStep(i,n,o,a,s,"throw",e)}a(void 0)}))}}function _classCallCheck$2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties$2(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),_Object$defineProperty(e,_toPropertyKey$2(n.key),n)}}function _createClass$2(e,t,r){return t&&_defineProperties$2(e.prototype,t),r&&_defineProperties$2(e,r),_Object$defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty$2(e,t,r){return(t=_toPropertyKey$2(t))in e?_Object$defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _inherits$1(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=_Object$create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),_Object$defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf$1(e,t)}function _getPrototypeOf$1(e){var t;return(_getPrototypeOf$1=_Object$setPrototypeOf?_bindInstanceProperty(t=_Object$getPrototypeOf).call(t):function(e){return e.__proto__||_Object$getPrototypeOf(e)})(e)}function _setPrototypeOf$1(e,t){var r;return(_setPrototypeOf$1=_Object$setPrototypeOf?_bindInstanceProperty(r=_Object$setPrototypeOf).call(r):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$3(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$1(e)}function _createSuper$1(e){var t=_isNativeReflectConstruct$1();return function(){var r,n=_getPrototypeOf$1(e);if(t){var o=_getPrototypeOf$1(this).constructor;r=_Reflect$construct(n,arguments,o)}else r=n.apply(this,arguments);return _possibleConstructorReturn$1(this,r)}}function _superPropBase$1(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf$1(e)););return e}function _get$1(){var e;"undefined"!=typeof Reflect&&_Reflect$get?_get$1=_bindInstanceProperty(e=_Reflect$get).call(e):_get$1=function(e,t,r){var n=_superPropBase$1(e,t);if(n){var o=_Object$getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}};return _get$1.apply(this,arguments)}function _slicedToArray$1(e,t){return _arrayWithHoles$1(e)||_iterableToArrayLimit$1(e,t)||_unsupportedIterableToArray$2(e,t)||_nonIterableRest$1()}function _arrayWithHoles$1(e){if(_Array$isArray(e))return e}function _unsupportedIterableToArray$2(e,t){var r;if(e){if("string"==typeof e)return _arrayLikeToArray$2(e,t);var n=_sliceInstanceProperty(r=Object.prototype.toString.call(e)).call(r,8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?_Array$from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray$2(e,t):void 0}}function _arrayLikeToArray$2(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _nonIterableRest$1(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _toPrimitive$2(e,t){if("object"!==_typeof$3(e)||null===e)return e;var r=e[_Symbol$toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==_typeof$3(n))return n;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$3(t)?t:String(t)}var $$R=_export,uncurryThis$f=functionUncurryThisClause,$indexOf=arrayIncludes.indexOf,arrayMethodIsStrict$5=arrayMethodIsStrict$7,nativeIndexOf=uncurryThis$f([].indexOf),NEGATIVE_ZERO$1=!!nativeIndexOf&&1/nativeIndexOf([1],1,-0)<0,FORCED$5=NEGATIVE_ZERO$1||!arrayMethodIsStrict$5("indexOf");$$R({target:"Array",proto:!0,forced:FORCED$5},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return NEGATIVE_ZERO$1?nativeIndexOf(this,e,t)||0:$indexOf(this,e,t)}});var entryVirtual$g=entryVirtual$o,indexOf$6=entryVirtual$g("Array").indexOf,isPrototypeOf$f=objectIsPrototypeOf,method$e=indexOf$6,ArrayPrototype$c=Array.prototype,indexOf$5=function(e){var t=e.indexOf;return e===ArrayPrototype$c||isPrototypeOf$f(ArrayPrototype$c,e)&&t===ArrayPrototype$c.indexOf?method$e:t},parent$1q=indexOf$5,indexOf$4=parent$1q,parent$1p=indexOf$4,indexOf$3=parent$1p,parent$1o=indexOf$3,indexOf$2=parent$1o,indexOf$1=indexOf$2,indexOf2=indexOf$1,_indexOfInstanceProperty=getDefaultExportFromCjs(indexOf2),$$Q=_export,$find=arrayIteration.find,FIND="find",SKIPS_HOLES$1=!0;FIND in[]&&Array(1)[FIND]((function(){SKIPS_HOLES$1=!1})),$$Q({target:"Array",proto:!0,forced:SKIPS_HOLES$1},{find:function(e){return $find(this,e,arguments.length>1?arguments[1]:void 0)}});var entryVirtual$f=entryVirtual$o,find$7=entryVirtual$f("Array").find,isPrototypeOf$e=objectIsPrototypeOf,method$d=find$7,ArrayPrototype$b=Array.prototype,find$6=function(e){var t=e.find;return e===ArrayPrototype$b||isPrototypeOf$e(ArrayPrototype$b,e)&&t===ArrayPrototype$b.find?method$d:t},parent$1n=find$6,find$5=parent$1n,parent$1m=find$5,find$4=parent$1m,parent$1l=find$4,find$3=parent$1l,find$2=find$3,find$1=find$2,_findInstanceProperty=getDefaultExportFromCjs(find$1),tryToString$1=tryToString$7,$TypeError$5=TypeError,deletePropertyOrThrow$3=function(e,t){if(!delete e[t])throw $TypeError$5("Cannot delete property "+tryToString$1(t)+" of "+tryToString$1(e))},$$P=_export,toObject$5=toObject$f,toAbsoluteIndex$2=toAbsoluteIndex$6,toIntegerOrInfinity$2=toIntegerOrInfinity$6,lengthOfArrayLike$5=lengthOfArrayLike$e,setArrayLength=arraySetLength,doesNotExceedSafeInteger=doesNotExceedSafeInteger$3,arraySpeciesCreate=arraySpeciesCreate$3,createProperty=createProperty$6,deletePropertyOrThrow$2=deletePropertyOrThrow$3,arrayMethodHasSpeciesSupport$1=arrayMethodHasSpeciesSupport$5,HAS_SPECIES_SUPPORT$1=arrayMethodHasSpeciesSupport$1("splice"),max=Math.max,min$3=Math.min;$$P({target:"Array",proto:!0,forced:!HAS_SPECIES_SUPPORT$1},{splice:function(e,t){var r,n,o,i,a,s,l=toObject$5(this),c=lengthOfArrayLike$5(l),u=toAbsoluteIndex$2(e,c),p=arguments.length;for(0===p?r=n=0:1===p?(r=0,n=c-u):(r=p-2,n=min$3(max(toIntegerOrInfinity$2(t),0),c-u)),doesNotExceedSafeInteger(c+r-n),o=arraySpeciesCreate(l,n),i=0;i<n;i++)(a=u+i)in l&&createProperty(o,i,l[a]);if(o.length=n,r<n){for(i=u;i<c-n;i++)s=i+r,(a=i+n)in l?l[s]=l[a]:deletePropertyOrThrow$2(l,s);for(i=c;i>c-n+r;i--)deletePropertyOrThrow$2(l,i-1)}else if(r>n)for(i=c-n;i>u;i--)s=i+r-1,(a=i+n-1)in l?l[s]=l[a]:deletePropertyOrThrow$2(l,s);for(i=0;i<r;i++)l[i+u]=arguments[i+2];return setArrayLength(l,c-n+r),o}});var entryVirtual$e=entryVirtual$o,splice$7=entryVirtual$e("Array").splice,isPrototypeOf$d=objectIsPrototypeOf,method$c=splice$7,ArrayPrototype$a=Array.prototype,splice$6=function(e){var t=e.splice;return e===ArrayPrototype$a||isPrototypeOf$d(ArrayPrototype$a,e)&&t===ArrayPrototype$a.splice?method$c:t},parent$1k=splice$6,splice$5=parent$1k,parent$1j=splice$5,splice$4=parent$1j,parent$1i=splice$4,splice$3=parent$1i,splice$2=splice$3,splice$1=splice$2,_spliceInstanceProperty=getDefaultExportFromCjs(splice$1),$$O=_export;$$O({target:"Number",stat:!0},{isNaN:function(e){return e!=e}});var path$e=path$z,isNan$5=path$e.Number.isNaN,parent$1h=isNan$5,isNan$4=parent$1h,parent$1g=isNan$4,isNan$3=parent$1g,parent$1f=isNan$3,isNan$2=parent$1f,isNan$1=isNan$2,isNan=isNan$1,_Number$isNaN=getDefaultExportFromCjs(isNan),whitespaces$4="\t\n\v\f\r \u2028\u2029\ufeff",uncurryThis$e=functionUncurryThis,requireObjectCoercible$4=requireObjectCoercible$8,toString$8=toString$f,whitespaces$3=whitespaces$4,replace$3=uncurryThis$e("".replace),ltrim=RegExp("^["+whitespaces$3+"]+"),rtrim=RegExp("(^|[^"+whitespaces$3+"])["+whitespaces$3+"]+$"),createMethod$3=function(e){return function(t){var r=toString$8(requireObjectCoercible$4(t));return 1&e&&(r=replace$3(r,ltrim,"")),2&e&&(r=replace$3(r,rtrim,"$1")),r}},stringTrim={start:createMethod$3(1),end:createMethod$3(2),trim:createMethod$3(3)},global$9=global$s,fails$c=fails$B,uncurryThis$d=functionUncurryThis,toString$7=toString$f,trim$8=stringTrim.trim,whitespaces$2=whitespaces$4,$parseInt$1=global$9.parseInt,Symbol$2=global$9.Symbol,ITERATOR$3=Symbol$2&&Symbol$2.iterator,hex=/^[+-]?0x/i,exec$2=uncurryThis$d(hex.exec),FORCED$4=8!==$parseInt$1(whitespaces$2+"08")||22!==$parseInt$1(whitespaces$2+"0x16")||ITERATOR$3&&!fails$c((function(){$parseInt$1(Object(ITERATOR$3))})),numberParseInt=FORCED$4?function(e,t){var r=trim$8(toString$7(e));return $parseInt$1(r,t>>>0||(exec$2(hex,r)?16:10))}:$parseInt$1,$$N=_export,$parseInt=numberParseInt;$$N({global:!0,forced:parseInt!=numberParseInt},{parseInt:numberParseInt});var path$d=path$z,_parseInt$6=path$d.parseInt,parent$1e=_parseInt$6,_parseInt$5=parent$1e,parent$1d=_parseInt$5,_parseInt$4=parent$1d,parent$1c=_parseInt$4,_parseInt$3=parent$1c,_parseInt$2=_parseInt$3,_parseInt=_parseInt$2,_parseInt$1=getDefaultExportFromCjs(_parseInt),$$M=_export,$map=arrayIteration.map,arrayMethodHasSpeciesSupport=arrayMethodHasSpeciesSupport$5,HAS_SPECIES_SUPPORT=arrayMethodHasSpeciesSupport("map");$$M({target:"Array",proto:!0,forced:!HAS_SPECIES_SUPPORT},{map:function(e){return $map(this,e,arguments.length>1?arguments[1]:void 0)}});var entryVirtual$d=entryVirtual$o,map$c=entryVirtual$d("Array").map,isPrototypeOf$c=objectIsPrototypeOf,method$b=map$c,ArrayPrototype$9=Array.prototype,map$b=function(e){var t=e.map;return e===ArrayPrototype$9||isPrototypeOf$c(ArrayPrototype$9,e)&&t===ArrayPrototype$9.map?method$b:t},parent$1b=map$b,map$a=parent$1b,parent$1a=map$a,map$9=parent$1a,parent$19=map$9,map$8=parent$19,map$7=map$8,map$6=map$7,_mapInstanceProperty=getDefaultExportFromCjs(map$6),DESCRIPTORS$6=descriptors$2,uncurryThis$c=functionUncurryThis,call$6=functionCall,fails$b=fails$B,objectKeys$1=objectKeys$4,getOwnPropertySymbolsModule=objectGetOwnPropertySymbols,propertyIsEnumerableModule=objectPropertyIsEnumerable,toObject$4=toObject$f,IndexedObject$1=indexedObject,$assign=Object.assign,defineProperty$2=Object.defineProperty,concat2=uncurryThis$c([].concat),objectAssign=!$assign||fails$b((function(){if(DESCRIPTORS$6&&1!==$assign({b:1},$assign(defineProperty$2({},"a",{enumerable:!0,get:function(){defineProperty$2(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach((function(e){t[e]=e})),7!=$assign({},e)[r]||objectKeys$1($assign({},t)).join("")!=n}))?function(e,t){for(var r=toObject$4(e),n=arguments.length,o=1,i=getOwnPropertySymbolsModule.f,a=propertyIsEnumerableModule.f;n>o;)for(var s,l=IndexedObject$1(arguments[o++]),c=i?concat2(objectKeys$1(l),i(l)):objectKeys$1(l),u=c.length,p=0;u>p;)s=c[p++],DESCRIPTORS$6&&!call$6(a,l,s)||(r[s]=l[s]);return r}:$assign,$$L=_export,assign$7=objectAssign;$$L({target:"Object",stat:!0,arity:2,forced:Object.assign!==assign$7},{assign:assign$7});var path$c=path$z,assign$6=path$c.Object.assign,parent$18=assign$6,assign$5=parent$18,parent$17=assign$5,assign$4=parent$17,parent$16=assign$4,assign$3=parent$16,assign$2=assign$3,assign$1=assign$2,_Object$assign=getDefaultExportFromCjs(assign$1);function ownKeys$1(e,t){var r=_Object$keys(e);if(_Object$getOwnPropertySymbols){var n=_Object$getOwnPropertySymbols(e);t&&(n=_filterInstanceProperty(n).call(n,(function(t){return _Object$getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread2$1(e){for(var t=1;t<arguments.length;t++){var r,n,o=null!=arguments[t]?arguments[t]:{};t%2?_forEachInstanceProperty(r=ownKeys$1(Object(o),!0)).call(r,(function(t){_defineProperty$1(e,t,o[t])})):_Object$getOwnPropertyDescriptors?_Object$defineProperties(e,_Object$getOwnPropertyDescriptors(o)):_forEachInstanceProperty(n=ownKeys$1(Object(o))).call(n,(function(t){_Object$defineProperty(e,t,_Object$getOwnPropertyDescriptor(o,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 r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),_Object$defineProperty(e,_toPropertyKey$1(n.key),n)}}function _createClass$1(e,t,r){return t&&_defineProperties$1(e.prototype,t),r&&_defineProperties$1(e,r),_Object$defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty$1(e,t,r){return(t=_toPropertyKey$1(t))in e?_Object$defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=_Object$create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),_Object$defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _getPrototypeOf(e){var t;return(_getPrototypeOf=_Object$setPrototypeOf?_bindInstanceProperty(t=_Object$getPrototypeOf).call(t):function(e){return e.__proto__||_Object$getPrototypeOf(e)})(e)}function _setPrototypeOf(e,t){var r;return(_setPrototypeOf=_Object$setPrototypeOf?_bindInstanceProperty(r=_Object$setPrototypeOf).call(r):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 _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$3(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var r,n=_getPrototypeOf(e);if(t){var o=_getPrototypeOf(this).constructor;r=_Reflect$construct(n,arguments,o)}else r=n.apply(this,arguments);return _possibleConstructorReturn(this,r)}}function _superPropBase(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf(e)););return e}function _get(){var e;"undefined"!=typeof Reflect&&_Reflect$get?_get=_bindInstanceProperty(e=_Reflect$get).call(e):_get=function(e,t,r){var n=_superPropBase(e,t);if(n){var o=_Object$getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}};return _get.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(void 0!==_Symbol&&null!=_getIteratorMethod(e)||null!=e["@@iterator"])return _Array$from(e)}function _unsupportedIterableToArray$1(e,t){var r;if(e){if("string"==typeof e)return _arrayLikeToArray$1(e,t);var n=_sliceInstanceProperty(r=Object.prototype.toString.call(e)).call(r,8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?_Array$from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray$1(e,t):void 0}}function _arrayLikeToArray$1(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _nonIterableSpread$1(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _toPrimitive$1(e,t){if("object"!==_typeof$3(e)||null===e)return e;var r=e[_Symbol$toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==_typeof$3(n))return n;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$3(t)?t:String(t)}var eventemitter3={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}function o(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function i(e,t,n,i,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new o(n,i||e,a),l=r?r+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function s(){this._events=new n,this._eventsCount=0}_Object$create&&(n.prototype=_Object$create(null),(new n).__proto__||(r=!1)),s.prototype.eventNames=function(){var e,n,o=[];if(0===this._eventsCount)return o;for(n in e=this._events)t.call(e,n)&&o.push(r?_sliceInstanceProperty(n).call(n,1):n);return _Object$getOwnPropertySymbols?_concatInstanceProperty(o).call(o,_Object$getOwnPropertySymbols(e)):o},s.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var o=0,i=n.length,a=new Array(i);o<i;o++)a[o]=n[o].fn;return a},s.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},s.prototype.emit=function(e,t,n,o,i,a){var s=r?r+e:e;if(!this._events[s])return!1;var l,c,u=this._events[s],p=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),p){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,o),!0;case 5:return u.fn.call(u.context,t,n,o,i),!0;case 6:return u.fn.call(u.context,t,n,o,i,a),!0}for(c=1,l=new Array(p-1);c<p;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var f,d=u.length;for(c=0;c<d;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),p){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,n);break;case 4:u[c].fn.call(u[c].context,t,n,o);break;default:if(!l)for(f=1,l=new Array(p-1);f<p;f++)l[f-1]=arguments[f];u[c].fn.apply(u[c].context,l)}}return!0},s.prototype.on=function(e,t,r){return i(this,e,t,r,!1)},s.prototype.once=function(e,t,r){return i(this,e,t,r,!0)},s.prototype.removeListener=function(e,t,n,o){var i=r?r+e:e;if(!this._events[i])return this;if(!t)return a(this,i),this;var s=this._events[i];if(s.fn)s.fn!==t||o&&!s.once||n&&s.context!==n||a(this,i);else{for(var l=0,c=[],u=s.length;l<u;l++)(s[l].fn!==t||o&&!s[l].once||n&&s[l].context!==n)&&c.push(s[l]);c.length?this._events[i]=1===c.length?c[0]:c:a(this,i)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&a(this,t)):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=r,s.EventEmitter=s,e.exports=s}(eventemitter3);var eventemitter3Exports=eventemitter3.exports,$$K=_export,$some=arrayIteration.some,arrayMethodIsStrict$4=arrayMethodIsStrict$7,STRICT_METHOD$3=arrayMethodIsStrict$4("some");$$K({target:"Array",proto:!0,forced:!STRICT_METHOD$3},{some:function(e){return $some(this,e,arguments.length>1?arguments[1]:void 0)}});var entryVirtual$c=entryVirtual$o,some$6=entryVirtual$c("Array").some,isPrototypeOf$b=objectIsPrototypeOf,method$a=some$6,ArrayPrototype$8=Array.prototype,some$5=function(e){var t=e.some;return e===ArrayPrototype$8||isPrototypeOf$b(ArrayPrototype$8,e)&&t===ArrayPrototype$8.some?method$a:t},parent$15=some$5,some$4=parent$15,parent$14=some$4,some$3=parent$14,parent$13=some$3,some$2=parent$13,some$1=some$2,some2=some$1,_someInstanceProperty=getDefaultExportFromCjs(some2),toIntegerOrInfinity$1=toIntegerOrInfinity$6,toString$6=toString$f,requireObjectCoercible$3=requireObjectCoercible$8,$RangeError$1=RangeError,stringRepeat=function(e){var t=toString$6(requireObjectCoercible$3(this)),r="",n=toIntegerOrInfinity$1(e);if(n<0||n==1/0)throw $RangeError$1("Wrong number of repetitions");for(;n>0;(n>>>=1)&&(t+=t))1&n&&(r+=t);return r},uncurryThis$b=functionUncurryThis,toLength$1=toLength$3,toString$5=toString$f,$repeat=stringRepeat,requireObjectCoercible$2=requireObjectCoercible$8,repeat2=uncurryThis$b($repeat),stringSlice$3=uncurryThis$b("".slice),ceil=Math.ceil,createMethod$2=function(e){return function(t,r,n){var o,i,a=toString$5(requireObjectCoercible$2(t)),s=toLength$1(r),l=a.length,c=void 0===n?" ":toString$5(n);return s<=l||""==c?a:((i=repeat2(c,ceil((o=s-l)/c.length))).length>o&&(i=stringSlice$3(i,0,o)),e?a+i:i+a)}},stringPad={start:createMethod$2(!1),end:createMethod$2(!0)},userAgent$2=engineUserAgent,stringPadWebkitBug=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(userAgent$2),$$J=_export,$padStart=stringPad.start,WEBKIT_BUG=stringPadWebkitBug;$$J({target:"String",proto:!0,forced:WEBKIT_BUG},{padStart:function(e){return $padStart(this,e,arguments.length>1?arguments[1]:void 0)}});var entryVirtual$b=entryVirtual$o,padStart$6=entryVirtual$b("String").padStart,isPrototypeOf$a=objectIsPrototypeOf,method$9=padStart$6,StringPrototype$3=String.prototype,padStart$5=function(e){var t=e.padStart;return"string"==typeof e||e===StringPrototype$3||isPrototypeOf$a(StringPrototype$3,e)&&t===StringPrototype$3.padStart?method$9:t},parent$12=padStart$5,padStart$4=parent$12,parent$11=padStart$4,padStart$3=parent$11,parent$10=padStart$3,padStart$2=parent$10,padStart$1=padStart$2,padStart2=padStart$1,_padStartInstanceProperty=getDefaultExportFromCjs(padStart2),engineIsBun="function"==typeof Bun&&Bun&&"string"==typeof Bun.version,global$8=global$s,apply$1=functionApply,isCallable$5=isCallable$q,ENGINE_IS_BUN=engineIsBun,USER_AGENT=engineUserAgent,arraySlice$3=arraySlice$7,validateArgumentsLength$3=validateArgumentsLength$5,Function$1=global$8.Function,WRAP=/MSIE .\./.test(USER_AGENT)||ENGINE_IS_BUN&&function(){var e=global$8.Bun.version.split(".");return e.length<3||0==e[0]&&(e[1]<3||3==e[1]&&0==e[2])}(),schedulersFix$2=function(e,t){var r=t?2:1;return WRAP?function(n,o){var i=validateArgumentsLength$3(arguments.length,1)>r,a=isCallable$5(n)?n:Function$1(n),s=i?arraySlice$3(arguments,r):[],l=i?function(){apply$1(a,this,s)}:a;return t?e(l,o):e(l)}:e},$$I=_export,global$7=global$s,schedulersFix$1=schedulersFix$2,setInterval$5=schedulersFix$1(global$7.setInterval,!0);$$I({global:!0,bind:!0,forced:global$7.setInterval!==setInterval$5},{setInterval:setInterval$5});var $$H=_export,global$6=global$s,schedulersFix=schedulersFix$2,setTimeout$6=schedulersFix(global$6.setTimeout,!0);$$H({global:!0,bind:!0,forced:global$6.setTimeout!==setTimeout$6},{setTimeout:setTimeout$6});var path$b=path$z,setInterval$4=path$b.setInterval,parent$$=setInterval$4,setInterval$3=parent$$,parent$_=setInterval$3,setInterval$2=parent$_,setInterval$1=setInterval$2,setInterval=setInterval$1,_setInterval=getDefaultExportFromCjs(setInterval),path$a=path$z,setTimeout$5=path$a.setTimeout,parent$Z=setTimeout$5,setTimeout$4=parent$Z,parent$Y=setTimeout$4,setTimeout$3=parent$Y,setTimeout$2=setTimeout$3,setTimeout$1=setTimeout$2,_setTimeout=getDefaultExportFromCjs(setTimeout$1),$$G=_export,$every=arrayIteration.every,arrayMethodIsStrict$3=arrayMethodIsStrict$7,STRICT_METHOD$2=arrayMethodIsStrict$3("every");$$G({target:"Array",proto:!0,forced:!STRICT_METHOD$2},{every:function(e){return $every(this,e,arguments.length>1?arguments[1]:void 0)}});var entryVirtual$a=entryVirtual$o,every$6=entryVirtual$a("Array").every,isPrototypeOf$9=objectIsPrototypeOf,method$8=every$6,ArrayPrototype$7=Array.prototype,every$5=function(e){var t=e.every;return e===ArrayPrototype$7||isPrototypeOf$9(ArrayPrototype$7,e)&&t===ArrayPrototype$7.every?method$8:t},parent$X=every$5,every$4=parent$X,parent$W=every$4,every$3=parent$W,parent$V=every$3,every$2=parent$V,every$1=every$2,every2=every$1,_everyInstanceProperty=getDefaultExportFromCjs(every2),global$5=global$s,fails$a=fails$B,uncurryThis$a=functionUncurryThis,toString$4=toString$f,trim$7=stringTrim.trim,whitespaces$1=whitespaces$4,charAt$2=uncurryThis$a("".charAt),$parseFloat$1=global$5.parseFloat,Symbol$1=global$5.Symbol,ITERATOR$2=Symbol$1&&Symbol$1.iterator,FORCED$3=1/$parseFloat$1(whitespaces$1+"-0")!=-1/0||ITERATOR$2&&!fails$a((function(){$parseFloat$1(Object(ITERATOR$2))})),numberParseFloat=FORCED$3?function(e){var t=trim$7(toString$4(e)),r=$parseFloat$1(t);return 0===r&&"-"==charAt$2(t,0)?-0:r}:$parseFloat$1,$$F=_export,$parseFloat=numberParseFloat;$$F({global:!0,forced:parseFloat!=numberParseFloat},{parseFloat:numberParseFloat});var path$9=path$z,_parseFloat$6=path$9.parseFloat,parent$U=_parseFloat$6,_parseFloat$5=parent$U,parent$T=_parseFloat$5,_parseFloat$4=parent$T,parent$S=_parseFloat$4,_parseFloat$3=parent$S,_parseFloat$2=_parseFloat$3,_parseFloat=_parseFloat$2,_parseFloat$1=getDefaultExportFromCjs(_parseFloat),PROPER_FUNCTION_NAME=functionName.PROPER,fails$9=fails$B,whitespaces=whitespaces$4,non="
",stringTrimForced=function(e){return fails$9((function(){return!!whitespaces[e]()||non[e]()!==non||PROPER_FUNCTION_NAME&&whitespaces[e].name!==e}))},$$E=_export,$trim=stringTrim.trim,forcedStringTrimMethod=stringTrimForced;$$E({target:"String",proto:!0,forced:forcedStringTrimMethod("trim")},{trim:function(){return $trim(this)}});var entryVirtual$9=entryVirtual$o,trim$6=entryVirtual$9("String").trim,isPrototypeOf$8=objectIsPrototypeOf,method$7=trim$6,StringPrototype$2=String.prototype,trim$5=function(e){var t=e.trim;return"string"==typeof e||e===StringPrototype$2||isPrototypeOf$8(StringPrototype$2,e)&&t===StringPrototype$2.trim?method$7:t},parent$R=trim$5,trim$4=parent$R,parent$Q=trim$4,trim$3=parent$Q,parent$P=trim$3,trim$2=parent$P,trim$1=trim$2,trim2=trim$1,_trimInstanceProperty=getDefaultExportFromCjs(trim2),arraySlice$2=arraySliceSimple,floor$3=Math.floor,mergeSort=function(e,t){var r=e.length,n=floor$3(r/2);return r<8?insertionSort(e,t):merge(e,mergeSort(arraySlice$2(e,0,n),t),mergeSort(arraySlice$2(e,n),t),t)},insertionSort=function(e,t){for(var r,n,o=e.length,i=1;i<o;){for(n=i,r=e[i];n&&t(e[n-1],r)>0;)e[n]=e[--n];n!==i++&&(e[n]=r)}return e},merge=function(e,t,r,n){for(var o=t.length,i=r.length,a=0,s=0;a<o||s<i;)e[a+s]=a<o&&s<i?n(t[a],r[s])<=0?t[a++]:r[s++]:a<o?t[a++]:r[s++];return e},arraySort$1=mergeSort,userAgent$1=engineUserAgent,firefox=userAgent$1.match(/firefox\/(\d+)/i),engineFfVersion=!!firefox&&+firefox[1],UA=engineUserAgent,engineIsIeOrEdge=/MSIE|Trident/.test(UA),userAgent=engineUserAgent,webkit=userAgent.match(/AppleWebKit\/(\d+)\./),engineWebkitVersion=!!webkit&&+webkit[1],$$D=_export,uncurryThis$9=functionUncurryThis,aCallable$7=aCallable$j,toObject$3=toObject$f,lengthOfArrayLike$4=lengthOfArrayLike$e,deletePropertyOrThrow$1=deletePropertyOrThrow$3,toString$3=toString$f,fails$8=fails$B,internalSort=arraySort$1,arrayMethodIsStrict$2=arrayMethodIsStrict$7,FF=engineFfVersion,IE_OR_EDGE=engineIsIeOrEdge,V8=engineV8Version,WEBKIT=engineWebkitVersion,test=[],nativeSort=uncurryThis$9(test.sort),push$6=uncurryThis$9(test.push),FAILS_ON_UNDEFINED=fails$8((function(){test.sort(void 0)})),FAILS_ON_NULL=fails$8((function(){test.sort(null)})),STRICT_METHOD$1=arrayMethodIsStrict$2("sort"),STABLE_SORT=!fails$8((function(){if(V8)return V8<70;if(!(FF&&FF>3)){if(IE_OR_EDGE)return!0;if(WEBKIT)return WEBKIT<603;var e,t,r,n,o="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(n=0;n<47;n++)test.push({k:t+n,v:r})}for(test.sort((function(e,t){return t.v-e.v})),n=0;n<test.length;n++)t=test[n].k.charAt(0),o.charAt(o.length-1)!==t&&(o+=t);return"DGBEFHACIJK"!==o}})),FORCED$2=FAILS_ON_UNDEFINED||!FAILS_ON_NULL||!STRICT_METHOD$1||!STABLE_SORT,getSortCompare=function(e){return function(t,r){return void 0===r?-1:void 0===t?1:void 0!==e?+e(t,r)||0:toString$3(t)>toString$3(r)?1:-1}};$$D({target:"Array",proto:!0,forced:FORCED$2},{sort:function(e){void 0!==e&&aCallable$7(e);var t=toObject$3(this);if(STABLE_SORT)return void 0===e?nativeSort(t):nativeSort(t,e);var r,n,o=[],i=lengthOfArrayLike$4(t);for(n=0;n<i;n++)n in t&&push$6(o,t[n]);for(internalSort(o,getSortCompare(e)),r=lengthOfArrayLike$4(o),n=0;n<r;)t[n]=o[n++];for(;n<i;)deletePropertyOrThrow$1(t,n++);return t}});var entryVirtual$8=entryVirtual$o,sort$6=entryVirtual$8("Array").sort,isPrototypeOf$7=objectIsPrototypeOf,method$6=sort$6,ArrayPrototype$6=Array.prototype,sort$5=function(e){var t=e.sort;return e===ArrayPrototype$6||isPrototypeOf$7(ArrayPrototype$6,e)&&t===ArrayPrototype$6.sort?method$6:t},parent$O=sort$5,sort$4=parent$O,parent$N=sort$4,sort$3=parent$N,parent$M=sort$3,sort$2=parent$M,sort$1=sort$2,sort2=sort$1,_sortInstanceProperty=getDefaultExportFromCjs(sort2),$$C=_export,uncurryThis$8=functionUncurryThis,$Date=Date,thisTimeValue=uncurryThis$8($Date.prototype.getTime);$$C({target:"Date",stat:!0},{now:function(){return thisTimeValue(new $Date)}});var _context,path$8=path$z,now$5=path$8.Date.now,parent$L=now$5,now$4=parent$L,parent$K=now$4,now$3=parent$K,parent$J=now$3,now$2=parent$J,now$1=now$2,now2=now$1,_Date$now=getDefaultExportFromCjs(now2),XG_DEBUG_OPEN="undefined"!=typeof window&&window.location&&_indexOfInstanceProperty(_context=window.location.href).call(_context,"xgplayerdebugger=1")>-1,STYLE={info:"color: #525252; background-color: #90ee90;",error:"color: #525252; background-color: red;",warn:"color: #525252; background-color: yellow; "},XGTAG="%c[xgplayer]",XG_DEBUG={config:{debug:XG_DEBUG_OPEN?3:0},logInfo:function(e){for(var t,r,n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];this.config.debug>=3&&(r=console).log.apply(r,_concatInstanceProperty(t=[XGTAG,STYLE.info,e]).call(t,o))},logWarn:function(e){for(var t,r,n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];this.config.debug>=1&&(r=console).warn.apply(r,_concatInstanceProperty(t=[XGTAG,STYLE.warn,e]).call(t,o))},logError:function(e){var t,r;if(!(this.config.debug<1)){for(var n=this.config.debug>=2?"trace":"error",o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];(r=console)[n].apply(r,_concatInstanceProperty(t=[XGTAG,STYLE.error,e]).call(t,i))}}},XgplayerTimeRange=function(){function e(t){_classCallCheck$1(this,e),this.bufferedList=t}return _createClass$1(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$3={};function checkIsIn(e,t){for(var r=0,n=t.length;r<n;r++)if(_indexOfInstanceProperty(e).call(e,t[r])>-1)return!0;return!1}util$3.createDom=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",i=document.createElement(t);return i.className=o,i.innerHTML=r,_forEachInstanceProperty(e=_Object$keys(n)).call(e,(function(e){var r=e,o=n[e];"video"===t||"audio"===t||"live-video"===t?o&&i.setAttribute(r,o):i.setAttribute(r,o)})),i},util$3.createDomFromHtml=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";try{var n=document.createElement("div");n.innerHTML=e;var o=n.children;if(n=null,o.length>0){var i;if(o=o[0],r&&util$3.addClass(o,r),t)_forEachInstanceProperty(i=_Object$keys(t)).call(i,(function(e){o.setAttribute(e,t[e])}));return o}return null}catch(e){return XG_DEBUG.logError("util.createDomFromHtml",e),null}},util$3.hasClass=function(e,t){if(!e||!t)return!1;try{return _someInstanceProperty(Array.prototype).call(e.classList,(function(e){return e===t}))}catch(n){var r=e.className&&"object"===_typeof$1(e.className)?e.getAttribute("class"):e.className;return r&&!!r.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}},util$3.addClass=function(e,t){if(e&&t)try{var r;_forEachInstanceProperty(r=t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g)).call(r,(function(t){t&&e.classList.add(t)}))}catch(r){util$3.hasClass(e,t)||(e.className&&"object"===_typeof$1(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t)}},util$3.removeClass=function(e,t){if(e&&t)try{var r;_forEachInstanceProperty(r=t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g)).call(r,(function(t){t&&e.classList.remove(t)}))}catch(r){var n;if(util$3.hasClass(e,t))_forEachInstanceProperty(n=t.split(/\s+/g)).call(n,(function(t){var r=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===_typeof$1(e.className)?e.setAttribute("class",e.getAttribute("class").replace(r," ")):e.className=e.className.replace(r," ")}))}},util$3.toggleClass=function(e,t){var r;e&&_forEachInstanceProperty(r=t.split(/\s+/g)).call(r,(function(t){util$3.hasClass(e,t)?util$3.removeClass(e,t):util$3.addClass(e,t)}))},util$3.classNames=function(){for(var e=arguments,t=[],r=function(r){if("String"===util$3.typeOf(e[r]))t.push(e[r]);else if("Object"===util$3.typeOf(e[r])){var n;_mapInstanceProperty(n=_Object$keys(e[r])).call(n,(function(n){e[r][n]&&t.push(n)}))}},n=0;n<arguments.length;n++)r(n);return t.join(" ")},util$3.findDom=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,r=arguments.length>1?arguments[1]:void 0;try{e=t.querySelector(r)}catch(n){XG_DEBUG.logError("util.findDom",n),0===_indexOfInstanceProperty(r).call(r,"#")&&(e=t.getElementById(_sliceInstanceProperty(r).call(r,1)))}return e},util$3.getCss=function(e,t){return e.currentStyle?e.currentStyle[t]:document.defaultView.getComputedStyle(e,!1)[t]},util$3.padStart=function(e,t,r){for(var n=String(r),o=t>>0,i=Math.ceil(o/n.length),a=[],s=String(e);i--;)a.push(n);return a.join("").substring(0,o-s.length)+s},util$3.format=function(e){if(window.isNaN(e))return"";e=Math.round(e);var t=_padStartInstanceProperty(util$3).call(util$3,Math.floor(e/3600),2,0),r=_padStartInstanceProperty(util$3).call(util$3,Math.floor((e-3600*t)/60),2,0),n=_padStartInstanceProperty(util$3).call(util$3,Math.floor(e-3600*t-60*r),2,0);return("00"===t?[r,n]:[t,r,n]).join(":")},util$3.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$3.typeOf=function(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]},util$3.deepCopy=function(e,t){var r;if("Object"===util$3.typeOf(t)&&"Object"===util$3.typeOf(e))return _forEachInstanceProperty(r=_Object$keys(t)).call(r,(function(r){if("Object"!==util$3.typeOf(t[r])||t[r]instanceof Node)if("Array"===util$3.typeOf(t[r])){var n;e[r]="Array"===util$3.typeOf(e[r])?_concatInstanceProperty(n=e[r]).call(n,t[r]):t[r]}else e[r]=t[r];else void 0===e[r]||void 0===e[r]?e[r]=t[r]:util$3.deepCopy(e[r],t[r])})),e},util$3.deepMerge=function(e,t){var r;return _mapInstanceProperty(r=_Object$keys(t)).call(r,(function(r){var n;"Array"===util$3.typeOf(t[r])&&"Array"===util$3.typeOf(e[r])?"Array"===util$3.typeOf(e[r])&&(n=e[r]).push.apply(n,_toConsumableArray$1(t[r])):util$3.typeOf(e[r])!==util$3.typeOf(t[r])||null===e[r]||"Object"!==util$3.typeOf(e[r])||t[r]instanceof window.Node?null!==t[r]&&(e[r]=t[r]):util$3.deepMerge(e[r],t[r])})),e},util$3.getBgImage=function(e){var t=(e.currentStyle||window.getComputedStyle(e,null)).backgroundImage;if(!t||"none"===t)return"";var r=document.createElement("a");return r.href=t.replace(/url\("|"\)/g,""),r.href},util$3.copyDom=function(e){if(e&&1===e.nodeType){var t=document.createElement(e.tagName);return _forEachInstanceProperty(Array.prototype).call(e.attributes,(function(e){t.setAttribute(e.name,e.value)})),e.innerHTML&&(t.innerHTML=e.innerHTML),t}return""},util$3.setInterval=function(e,t,r,n){e._interval[t]||(e._interval[t]=_setInterval(_bindInstanceProperty(r).call(r,e),n))},util$3.clearInterval=function(e,t){clearInterval(e._interval[t]),e._interval[t]=null},util$3.setTimeout=function(e,t,r){e._timers||(e._timers=[]);var n=_setTimeout((function(){t(),util$3.clearTimeout(e,n)}),r);return e._timers.push(n),n},util$3.clearTimeout=function(e,t){var r=e._timers;if("Array"===util$3.typeOf(r)){for(var n=0;n<r.length;n++)if(r[n]===t){_spliceInstanceProperty(r).call(r,n,1),clearTimeout(t);break}}else clearTimeout(t)},util$3.clearAllTimers=function(e){var t=e._timers;"Array"===util$3.typeOf(t)&&(_mapInstanceProperty(t).call(t,(function(e){clearTimeout(e)})),e._timerIds=[])},util$3.createImgBtn=function(e,t,r,n){var o,i,a,s,l,c,u,p,f,d,h,$,y=util$3.createDom("xg-".concat(e),"",{},"xgplayer-".concat(e,"-img"));(y.style.backgroundImage='url("'.concat(t,'")'),r&&n)&&(_everyInstanceProperty(o=["px","rem","em","pt","dp","vw","vh","vm","%"]).call(o,(function(e){var t,o;return!(_indexOfInstanceProperty(r).call(r,e)>-1&&_indexOfInstanceProperty(n).call(n,e)>-1)||(u=_parseFloat$1(_trimInstanceProperty(t=_sliceInstanceProperty(r).call(r,0,_indexOfInstanceProperty(r).call(r,e))).call(t)),p=_parseFloat$1(_trimInstanceProperty(o=_sliceInstanceProperty(n).call(n,0,_indexOfInstanceProperty(n).call(n,e))).call(o)),f=e,!1)})),y.style.width=_concatInstanceProperty(i="".concat(u)).call(i,f),y.style.height=_concatInstanceProperty(a="".concat(p)).call(a,f),y.style.backgroundSize=_concatInstanceProperty(s=_concatInstanceProperty(l=_concatInstanceProperty(c="".concat(u)).call(c,f," ")).call(l,p)).call(s,f),y.style.margin="start"===e?_concatInstanceProperty(d=_concatInstanceProperty(h=_concatInstanceProperty($="-".concat(p/2)).call($,f," auto auto -")).call(h,u/2)).call(d,f):"auto 5px auto 5px");return y},util$3.Hex2RGBA=function(e,t){var r,n=[];if(/^\#[0-9A-F]{3}$/i.test(e)){var o="#";e.replace(/[0-9A-F]/gi,(function(e){o+=e+e})),e=o}return/^#[0-9A-F]{6}$/i.test(e)?(e.replace(/[0-9A-F]{2}/gi,(function(e){n.push(_parseInt$1(e,16))})),_concatInstanceProperty(r="rgba(".concat(n.join(","),", ")).call(r,t,")")):"rgba(255, 255, 255, 0.1)"},util$3.getFullScreenEl=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},util$3.checkIsFunction=function(e){return e&&"function"==typeof e},util$3.checkIsObject=function(e){return null!==e&&"object"===_typeof$1(e)},util$3.hide=function(e){e.style.display="none"},util$3.show=function(e,t){e.style.display=t||"block"},util$3.isUndefined=function(e){if(null==e)return!0},util$3.isNotNull=function(e){return!(null==e)},util$3.setStyleFromCsstext=function(e,t){if(t)if("String"===util$3.typeOf(t)){var r=t.replace(/\s+/g,"").split(";");_mapInstanceProperty(r).call(r,(function(t){if(t){var r=t.split(":");r.length>1&&(e.style[r[0]]=r[1])}}))}else{var n;_mapInstanceProperty(n=_Object$keys(t)).call(n,(function(r){e.style[r]=t[r]}))}},util$3.filterStyleFromText=function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["width","height","top","left","bottom","right","position","z-index","padding","margin","transform"],n=e.style.cssText;if(!n)return{};var o=n.replace(/\s+/g,"").split(";"),i={},a={};return _mapInstanceProperty(o).call(o,(function(e){if(e){var t=e.split(":");t.length>1&&(checkIsIn(t[0],r)?i[t[0]]=t[1]:a[t[0]]=t[1])}})),e.setAttribute("style",""),_mapInstanceProperty(t=_Object$keys(a)).call(t,(function(t){e.style[t]=a[t]})),i},util$3.getStyleFromCsstext=function(e){var t=e.style.cssText;if(!t)return{};var r=t.replace(/\s+/g,"").split(";"),n={};return _mapInstanceProperty(r).call(r,(function(e){if(e){var t=e.split(":");t.length>1&&(n[t[0]]=t[1])}})),n},util$3.preloadImg=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(e){var n=new window.Image;n.onload=function(e){n=null,t&&t(e)},n.onerror=function(e){n=null,r&&r(e)},n.src=e}},util$3.stopPropagation=function(e){e&&e.stopPropagation()},util$3.scrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},util$3.scrollLeft=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},util$3.checkTouchSupport=function(){return"ontouchstart"in window},util$3.getBuffered2=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,r=[],n=0;n<e.length;n++)r.push({start:e.start(n)<.5?0:e.start(n),end:e.end(n)});_sortInstanceProperty(r).call(r,(function(e,t){var r=e.start-t.start;return r||t.end-e.end}));var o=[];if(t)for(var i=0;i<r.length;i++){var a=o.length;if(a){var s=o[a-1].end;r[i].start-s<t?r[i].end>s&&(o[a-1].end=r[i].end):o.push(r[i])}else o.push(r[i])}else o=r;return new XgplayerTimeRange(o)},util$3.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$3.requestAnimationFrame=function(e){var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(t)return t(e)},util$3.getHostFromUrl=function(e){if("String"!==util$3.typeOf(e))return"";var t=e.split("/"),r="";return t.length>3&&t[2]&&(r=t[2]),r},util$3.cancelAnimationFrame=function(e){var t=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.cancelRequestAnimationFrame;t&&t(e)},util$3.isMSE=function(e){return e.media&&(e=e.media),!!(e&&e instanceof HTMLMediaElement)&&(/^blob/.test(e.currentSrc)||/^blob/.test(e.src))},util$3.isBlob=function(e){return"string"==typeof e&&/^blob/.test(e)},util$3.generateSessionId=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=(new Date).getTime();try{e=_parseInt$1(e)}catch(t){e=0}return t+=e,window.performance&&"function"==typeof window.performance.now&&(t+=_parseInt$1(window.performance.now())),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var r=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?r:3&r|8).toString(16)}))},util$3.createEvent=function(e){var t;return"function"==typeof window.Event?t=new Event(e):(t=document.createEvent("Event")).initEvent(e,!0,!0),t},util$3.adjustTimeByDuration=function(e,t,r){return t&&e&&(e>t||r&&e<t)?t:e},util$3.createPositionBar=function(e,t){var r=util$3.createDom("xg-bar","",{"data-index":-1},e);return t.appendChild(r),r},util$3.getTransformStyle=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{x:0,y:0,scale:1,rotate:0},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n={scale:"".concat(t.scale||1),translate:_concatInstanceProperty(e="".concat(t.x||0,"%, ")).call(e,t.y||0,"%"),rotate:"".concat(t.rotate||0,"deg")},o=_Object$keys(n);return _forEachInstanceProperty(o).call(o,(function(e){var t,o=new RegExp("".concat(e,"\\([^\\(]+\\)"),"g"),i=_concatInstanceProperty(t="".concat(e,"(")).call(t,n[e],")");o.test(r)?(o.lastIndex=-1,r=r.replace(o,i)):r+="".concat(i," ")})),r},util$3.convertDeg=function(e){return Math.abs(e)<=1?360*e:e%360},util$3.getIndexByTime=function(e,t){var r=t.length,n=-1;if(r<1)return n;if(e<=t[0].end||r<2)n=0;else if(e>t[r-1].end)n=r-1;else for(var o=1;o<r;o++)if(e>t[o-1].end&&e<=t[o].end){n=o;break}return n},util$3.getOffsetCurrentTime=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,n=-1;if((n=r>=0&&r<t.length?r:util$3.getIndexByTime(e,t))<0)return-1;var o=t.length,i=t[n],a=i.start,s=i.end,l=i.cTime,c=i.offset;return e<a?l:e>=a&&e<=s?e-c:e>s&&n>=o-1?s:-1},util$3.getCurrentTimeByOffset=function(e,t){var r=-1;if(!t||t.length<0)return e;for(var n=0;n<t.length;n++)if(e<=t[n].duration){r=n;break}if(-1!==r){var o=t[r].start;return r-1<0?o+e:o+(e-t[r-1].duration)}return e};var VERSION_REG={android:/(Android)\s([\d.]+)/,ios:/(Version)\/([\d.]+)/},H264_MIMETYPES=["avc1.42E01E, mp4a.40.2","avc1.58A01E, mp4a.40.2","avc1.4D401E, mp4a.40.2","avc1.64001E, mp4a.40.2","avc1.42E01E","mp4v.20.8","mp4v.20.8, mp4a.40.2","mp4v.20.240, mp4a.40.2"],sniffer={get device(){return sniffer.os.isPc?"pc":"mobile"},get browser(){var e,t;if("undefined"==typeof navigator)return"";var r=navigator.userAgent.toLowerCase(),n={ie:/rv:([\d.]+)\) like gecko/,firefox:/firefox\/([\d.]+)/,chrome:/chrome\/([\d.]+)/,opera:/opera.([\d.]+)/,safari:/version\/([\d.]+).*safari/};return _concatInstanceProperty(e=[]).call(e,_filterInstanceProperty(t=_Object$keys(n)).call(t,(function(e){return n[e].test(r)})))[0]},get os(){if("undefined"==typeof navigator)return{};var e=navigator.userAgent,t=/(?:Windows Phone)/.test(e),r=/(?:SymbianOS)/.test(e)||t,n=/(?:Tizen)/gi.test(e),o=/(?:Web0S)/gi.test(e),i=/(?:Android)/.test(e),a=/(?:Firefox)/.test(e),s=/(?:iPad|PlayBook)/.test(e)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,l=s||i&&!/(?:Mobile)/.test(e)||a&&/(?:Tablet)/.test(e),c=/(?:iPhone)/.test(e)&&!l;return{isTablet:l,isPhone:c,isIpad:s,isIos:c||s,isAndroid:i,isPc:!(c||i||r||l),isSymbian:r,isWindowsPhone:t,isFireFox:a,isTizen:n,isWebOS:o}},get osVersion(){if("undefined"==typeof navigator)return 0;var e=navigator.userAgent,t="",r=(t=/(?:iPhone)|(?:iPad|PlayBook)/.test(e)?VERSION_REG.ios:VERSION_REG.android)?t.exec(e):[];if(r&&r.length>=3){var n=r[2].split(".");return n.length>0?_parseInt$1(n[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&&_mapInstanceProperty(H264_MIMETYPES).call(H264_MIMETYPES,(function(r){"probably"===t.canPlayType('video/mp4; codecs="'.concat(r,'"'))&&(e.isSupport=!0,e.mime+="||".concat(r))})),this.supportResult=e,t=null,e},isMSESupport:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'video/mp4; codecs="avc1.42E01E,mp4a.40.2"';if("undefined"==typeof MediaSource||!MediaSource)return!1;try{return MediaSource.isTypeSupported(e)}catch(t){return this._logger.error(e,t),!1}},isHevcSupported:function(){return!("undefined"==typeof MediaSource||!MediaSource.isTypeSupported)&&(MediaSource.isTypeSupported('video/mp4;codecs="hev1.1.6.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.2.4.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.3.E.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.4.10.L120.90"'))},probeConfigSupported:function(e){var t={supported:!1,smooth:!1,powerEfficient:!1};if(!e||"undefined"==typeof navigator)return _Promise.resolve(t);if(navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo)return navigator.mediaCapabilities.decodingInfo(e);var r=e.video||{},n=e.audio||{};try{var o=MediaSource.isTypeSupported(r.contentType),i=MediaSource.isTypeSupported(n.contentType);return _Promise.resolve({supported:o&&i,smooth:!1,powerEfficient:!1})}catch(e){return _Promise.resolve(t)}}},PLAY="play",ENDED="ended",PAUSE="pause",ERROR="error",SEEKED="seeked",TIME_UPDATE="timeupdate",DURATION_CHANGE="durationchange",VOLUME_CHANGE="volumechange",LOADED_DATA="loadeddata",PROGRESS="progress",EMPTIED="emptied",AUTOPLAY_STARTED="autoplay_started",COMPLETE="complete",FULLSCREEN_CHANGE="fullscreen_change",CSS_FULLSCREEN_CHANGE="cssFullscreen_change",VIDEO_RESIZE="video_resize";function callHandler(e,t,r){for(var n,o=arguments.length,i=new Array(o>3?o-3:0),a=3;a<o;a++)i[a-3]=arguments[a];var s,l=t.call.apply(t,_concatInstanceProperty(n=[e]).call(n,i));r&&"function"==typeof r&&(l&&l.then?l.then((function(){for(var t,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];r.call.apply(r,_concatInstanceProperty(t=[e]).call(t,o))})):r.call.apply(r,_concatInstanceProperty(s=[e]).call(s,i)))}function hook(e,t){var r,n=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),_bindInstanceProperty(r=function(){var r,o=arguments,i=this;if(n.pre)try{var a,s;(s=n.pre).call.apply(s,_concatInstanceProperty(a=[this]).call(a,_sliceInstanceProperty(Array.prototype).call(arguments)))}catch(t){var l,c;throw t.message=_concatInstanceProperty(l=_concatInstanceProperty(c="[pluginName: ".concat(this.pluginName,":")).call(c,e,":pre error] >> ")).call(l,t.message),t}if(this.__hooks&&this.__hooks[e])try{var u,p=runHooks(this,e,t);if(p)if(p.then)p.then((function(e){var r;!1!==e&&callHandler.apply(void 0,_concatInstanceProperty(r=[i,t,n.next]).call(r,_toConsumableArray$1(o)))})).catch((function(e){throw e}));else callHandler.apply(void 0,_concatInstanceProperty(u=[this,t,n.next]).call(u,_sliceInstanceProperty(Array.prototype).call(arguments)));else if(void 0===p){var f;callHandler.apply(void 0,_concatInstanceProperty(f=[this,t,n.next]).call(f,_sliceInstanceProperty(Array.prototype).call(arguments)))}}catch(t){var d,h;throw t.message=_concatInstanceProperty(d=_concatInstanceProperty(h="[pluginName: ".concat(this.pluginName,":")).call(h,e,"] >> ")).call(d,t.message),t}else callHandler.apply(void 0,_concatInstanceProperty(r=[this,t,n.next]).call(r,_sliceInstanceProperty(Array.prototype).call(arguments)))}).call(r,this)}function findHookIndex(e,t){var r=this.__hooks;if(!r||!_Array$isArray(r[e]))return-1;for(var n=r[e],o=0;o<n.length;o++)if(n[o]===t)return o;return-1}function useHooks(e,t){var r=this.__hooks;if(r)return r.hasOwnProperty(e)?(_Array$isArray(r[e])||(r[e]=[]),-1===findHookIndex.call(this,e,t)&&r[e].push(t),!0):(console.warn("has no supported hook which name [".concat(e,"]")),!1)}function removeHooks(e,t){var r=this.__hooks;if(r)if(_Array$isArray(r[e])){var n=r[e],o=findHookIndex.call(this,e,t);-1!==o&&_spliceInstanceProperty(n).call(n,o,1)}else r[e]&&(r[e]=null)}function hooksDescriptor(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];e.__hooks={},t&&_mapInstanceProperty(t).call(t,(function(t){e.__hooks[t]=null})),_Object$defineProperty(e,"hooks",{get:function(){var t;return e.__hooks&&_mapInstanceProperty(t=_Object$keys(e.__hooks)).call(t,(function(t){if(e.__hooks[t])return t}))}})}function delHooksDescriptor(e){e.__hooks=null}function runHooks(e,t,r){for(var n=arguments.length,o=new Array(n>3?n-3:0),i=3;i<n;i++)o[i-3]=arguments[i];if(e.__hooks&&_Array$isArray(e.__hooks[t])){var a,s=e.__hooks[t],l=-1;return function e(t,r,n){for(var o,i,a=arguments.length,c=new Array(a>3?a-3:0),u=3;u<a;u++)c[u-3]=arguments[u];if(l++,0===s.length||l===s.length)return n.call.apply(n,_concatInstanceProperty(i=[t,t]).call(i,c));var p,f=s[l],d=f.call.apply(f,_concatInstanceProperty(o=[t,t]).call(o,c));return d&&d.then?d.then((function(o){var i;return!1===o?null:e.apply(void 0,_concatInstanceProperty(i=[t,r,n]).call(i,c))})).catch((function(e){console.warn("[runHooks]".concat(r," reject"),e.message)})):!1!==d?e.apply(void 0,_concatInstanceProperty(p=[t,r,n]).call(p,c)):void 0}.apply(void 0,_concatInstanceProperty(a=[e,t,r]).call(a,o))}var c;return r.call.apply(r,_concatInstanceProperty(c=[e,e]).call(c,o))}function showErrorMsg(e,t){var r;XG_DEBUG.logError(_concatInstanceProperty(r="[".concat(e,"] event or callback cant be undefined or null when call ")).call(r,t))}var BasePlugin=function(){function e(t){_classCallCheck$1(this,e),util$3.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$1(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$3.checkTouchSupport()?"touch":"mouse";return!this.playerConfig||"touch"!==this.playerConfig.domEventType&&"mouse"!==this.playerConfig.domEventType||(e=this.playerConfig.domEventType),e}},{key:"on",value:function(e,t){var r=this;e&&t&&this.player?"string"==typeof e?(this.__events[e]=t,this.player.on(e,t)):_Array$isArray(e)&&_forEachInstanceProperty(e).call(e,(function(e){r.__events[e]=t,r.player.on(e,t)})):showErrorMsg(this.pluginName,"plugin.on(event, callback)")}},{key:"once",value:function(e,t){var r=this;e&&t&&this.player?"string"==typeof e?(this.__onceEvents[e]=t,this.player.once(e,t)):_Array$isArray(e)&&_forEachInstanceProperty(e).call(e,(function(n){r.__onceEvents[n]=t,r.player.once(e,t)})):showErrorMsg(this.pluginName,"plugin.once(event, callback)")}},{key:"off",value:function(e,t){var r=this;e&&t&&this.player?"string"==typeof e?(delete this.__events[e],this.player.off(e,t)):_Array$isArray(e)&&_forEachInstanceProperty(e).call(e,(function(n){delete r.__events[e],r.player.off(n,t)})):showErrorMsg(this.pluginName,"plugin.off(event, callback)")}},{key:"offAll",value:function(){var e,t=this;_forEachInstanceProperty(e=["__events","__onceEvents"]).call(e,(function(e){var r;_forEachInstanceProperty(r=_Object$keys(t[e])).call(r,(function(r){t[e][r]&&t.off(r,t[e][r]),r&&delete t[e][r]}))})),this.__events={},this.__onceEvents={}}},{key:"emit",value:function(e){var t,r;if(this.player){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];(r=this.player).emit.apply(r,_concatInstanceProperty(t=[e]).call(t,o))}}},{key:"emitUserAction",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.player){var n=_objectSpread2$1(_objectSpread2$1({},r),{},{pluginName:this.pluginName});this.player.emitUserAction(e,t,n)}}},{key:"hook",value:function(e,t){var r;return hook.call.apply(hook,_concatInstanceProperty(r=[this]).call(r,_sliceInstanceProperty(Array.prototype).call(arguments)))}},{key:"useHooks",value:function(e,t){for(var r,n=arguments.length,o=new Array(n>2?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];return useHooks.call.apply(useHooks,_concatInstanceProperty(r=[this]).call(r,_sliceInstanceProperty(Array.prototype).call(arguments)))}},{key:"removeHooks",value:function(e,t){for(var r,n=arguments.length,o=new Array(n>2?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];return removeHooks.call.apply(removeHooks,_concatInstanceProperty(r=[this]).call(r,_sliceInstanceProperty(Array.prototype).call(arguments)))}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(this.player)return r&&(t.pluginName=r),this.player.registerPlugin({plugin:e,options:t})}},{key:"getPlugin",value:function(e){return this.player?this.player.getPlugin(e):null}},{key:"__destroy",value:function(){var e,t=this,r=this.player,n=this.pluginName;this.offAll(),util$3.clearAllTimers(this),util$3.checkIsFunction(this.destroy)&&this.destroy(),_mapInstanceProperty(e=["player","playerConfig","pluginName","logger","__args","__hooks"]).call(e,(function(e){t[e]=null})),r.unRegisterPlugin(n),delHooksDescriptor(this)}}],[{key:"defineGetterOrSetter",value:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&_Object$defineProperty(e,r,t[r])}},{key:"defineMethod",value:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&"function"==typeof t[r]&&_Object$defineProperty(e,r,{configurable:!0,value:t[r]})}},{key:"defaultConfig",get:function(){return{}}},{key:"pluginName",get:function(){return"pluginName"}}]),e}(),DOCUMENT_NODE_TYPE=9;if("undefined"!=typeof Element&&!Element.prototype.matches){var proto=Element.prototype;proto.matches=proto.matchesSelector||proto.mozMatchesSelector||proto.msMatchesSelector||proto.oMatchesSelector||proto.webkitMatchesSelector}function closest$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,r,n,o){var i=listener.apply(this,arguments);return e.addEventListener(r,i,o),{destroy:function(){e.removeEventListener(r,i,o)}}}function delegate(e,t,r,n,o){return"function"==typeof e.addEventListener?_delegate.apply(null,arguments):"function"==typeof r?_bindInstanceProperty(_delegate).call(_delegate,null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),_mapInstanceProperty(Array.prototype).call(e,(function(e){return _delegate(e,t,r,n,o)})))}function listener(e,t,r,n){return function(r){r.delegateTarget=closest(r.target,t),r.delegateTarget&&n.call(e,r)}}var delegate_1=delegate,_delegate$1=getDefaultExportFromCjs(delegate_1),ROOT_TYPES={CONTROLS:"controls",ROOT:"root"},POSITIONS={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(e){return!!e&&(_indexOfInstanceProperty(e)&&/^(?:http|data:|\/)/.test(e))}function mergeIconClass(e,t){var r;return"object"===_typeof$1(e)&&e.class&&"string"==typeof e.class?_concatInstanceProperty(r="".concat(t," ")).call(r,e.class):t}function mergeIconAttr(e,t){var r;"object"===_typeof$1(e)&&e.attr&&"object"===_typeof$1(e.attr)&&_mapInstanceProperty(r=_Object$keys(e.attr)).call(r,(function(r){t[r]=e.attr[r]}));return t}function createIcon(e,t){var r,n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",s=null;if(e instanceof window.Element)return util$3.addClass(e,o),_mapInstanceProperty(n=_Object$keys(i)).call(n,(function(t){e.setAttribute(t,i[t])})),e;if(isUrl(e)||isUrl(e.url))return i.src=isUrl(e)?e:e.url||"",s=util$3.createDom(e.tag||"img","",i,"xg-img ".concat(o));if("function"==typeof e)try{var l,c;return(s=e())instanceof window.Element?(util$3.addClass(s,o),_mapInstanceProperty(l=_Object$keys(i)).call(l,(function(e){s.setAttribute(e,i[e])})),s):(XG_DEBUG.logWarn(_concatInstanceProperty(c="warn>>icons.".concat(t," in config of plugin named [")).call(c,a,"] is a function mast return an Element Object")),null)}catch(e){return XG_DEBUG.logError("Plugin named [".concat(a,"]:createIcon"),e),null}return"string"==typeof e?util$3.createDomFromHtml(e,i,o):(XG_DEBUG.logWarn(_concatInstanceProperty(r="warn>>icons.".concat(t," in config of plugin named [")).call(r,a,"] is invalid")),null)}function registerIconsObj(e,t){var r,n=t.config.icons||t.playerConfig.icons;_mapInstanceProperty(r=_Object$keys(e)).call(r,(function(r){var o=e[r],i=o&&o.class?o.class:"",a=o&&o.attr?o.attr:{},s=null;n&&n[r]&&(i=mergeIconClass(n[r],i),a=mergeIconAttr(n[r],a),s=createIcon(n[r],r,i,a,t.pluginName)),!s&&o&&(s=createIcon(o.icon?o.icon:o,a,i,{},t.pluginName)),t.icons[r]=s}))}function registerTextObj(e,t){var r;_mapInstanceProperty(r=_Object$keys(e)).call(r,(function(r){_Object$defineProperty(t.langText,r,{get:function(){var n=t.lang,o=t.i18n;return o[r]?o[r]:e[r]&&e[r][n]||""}})}))}var Plugin=function(e){_inherits(r,BasePlugin);var t=_createSuper(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck$1(this,r),(e=t.call(this,n)).__delegates=[],e}return _createClass$1(r,[{key:"__init",value:function(e){if(_get(_getPrototypeOf(r.prototype),"__init",this).call(this,e),e.root){var t=e.root,n=null;this.icons={},this.root=null,this.parent=null,this.extraEls=[],registerIconsObj(this.registerIcons()||{},this),this.langText={},registerTextObj(this.registerLanguageTexts()||{},this);var o="";try{o=this.render()}catch(e){var i;throw XG_DEBUG.logError("Plugin:".concat(this.pluginName,":render"),e),new Error(_concatInstanceProperty(i="Plugin:".concat(this.pluginName,":render:")).call(i,e.message))}if(o)(n=r.insert(o,t,e.index)).setAttribute("data-index",e.index);else{if(!e.tag)return;(n=util$3.createDom(e.tag,"",e.attr,e.name)).setAttribute("data-index",e.index),t.appendChild(n)}this.root=n,this.parent=t;var a=this.config.attr||{},s=this.config.style||{};this.setAttr(a),this.setStyle(s),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,r=this.children();if(r&&"object"===_typeof$1(r))if(_Object$keys(r).length>0)_mapInstanceProperty(t=_Object$keys(r)).call(t,(function(t){var n,o,i=t,a=r[i],s={root:e.root};"function"==typeof a?(n=e.config[i]||{},o=a):"object"===_typeof$1(a)&&"function"==typeof a.plugin&&(n=a.options?util$3.deepCopy(e.config[i]||{},a.options):e.config[i]||{},o=a.plugin),s.config=n,void 0!==n.index&&(s.index=n.index),n.root&&(s.root=n.root),e.registerPlugin(o,s,i)}))}}},{key:"updateLang",value:function(e){e||(e=this.lang);var t=this.root,r=this.i18n,n=this.langText;t&&function e(t,r){for(var n=0;n<t.children.length;n++)t.children[n].children.length>0?e(t.children[n],r):r(t.children[n])}(t,(function(t){var o=t.getAttribute&&t.getAttribute("lang-key");if(o){var i=r[o.toUpperCase()]||n[o];i&&(t.innerHTML="function"==typeof i?i(e):i)}}))}},{key:"lang",get:function(){return this.player.lang}},{key:"changeLangTextKey",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=this.i18n||{},n=this.langText;e.setAttribute&&e.setAttribute("lang-key",t);var o=r[t]||n[t]||"";o&&(e.innerHTML=o)}},{key:"plugins",value:function(){return this._children}},{key:"disable",value:function(){this.config.disable=!0,util$3.addClass(_findInstanceProperty(this).call(this,".xgplayer-icon"),PLUGIN_STATE_CLASS.ICON_DISABLE)}},{key:"enable",value:function(){this.config.disable=!1,util$3.removeClass(_findInstanceProperty(this).call(this,".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]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";t.root=t.root||this.root;var o=_get(_getPrototypeOf(r.prototype),"registerPlugin",this).call(this,e,t,n);return this._children.push(o),o}},{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,n){var o=this;if(arguments.length<3&&"function"==typeof t)_Array$isArray(e)?_forEachInstanceProperty(e).call(e,(function(e){o.bindEL(e,t)})):this.bindEL(e,t);else{var i,a=r.delegate.call(this,this.root,e,t,n);this.__delegates=_concatInstanceProperty(i=this.__delegates).call(i,a)}}},{key:"unbind",value:function(e,t){var r=this;if(arguments.length<3&&"function"==typeof t)_Array$isArray(e)?_forEachInstanceProperty(e).call(e,(function(e){r.unbindEL(e,t)})):this.unbindEL(e,t);else for(var n,o=_concatInstanceProperty(n="".concat(e,"_")).call(n,t),i=0;i<this.__delegates.length;i++)if(this.__delegates[i].key===o){var a;this.__delegates[i].destroy(),_spliceInstanceProperty(a=this.__delegates).call(a,i,1);break}}},{key:"setStyle",value:function(e,t){var r,n=this;if(this.root)return"String"===util$3.typeOf(e)?this.root.style[e]=t:void("Object"===util$3.typeOf(e)&&_mapInstanceProperty(r=_Object$keys(e)).call(r,(function(t){n.root.style[t]=e[t]})))}},{key:"setAttr",value:function(e,t){var r,n=this;if(this.root)return"String"===util$3.typeOf(e)?this.root.setAttribute(e,t):void("Object"===util$3.typeOf(e)&&_mapInstanceProperty(r=_Object$keys(e)).call(r,(function(t){n.root.setAttribute(t,e[t])})))}},{key:"setHtml",value:function(e,t){this.root&&(this.root.innerHTML=e,"function"==typeof t&&t())}},{key:"bindEL",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.root&&"on".concat(e)in this.root&&"function"==typeof t&&this.root.addEventListener(e,t,r)}},{key:"unbindEL",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.root&&"on".concat(e)in this.root&&"function"==typeof t&&this.root.removeEventListener(e,t,r)}},{key:"show",value:function(e){if(this.root)return this.root.style.display=void 0!==e?e:"block","none"===window.getComputedStyle(this.root,null).getPropertyValue("display")?this.root.style.display="block":void 0}},{key:"hide",value:function(){this.root&&(this.root.style.display="none")}},{key:"appendChild",value:function(e,t){if(!this.root)return null;if(arguments.length<2&&arguments[0]instanceof window.Element)return this.root.appendChild(arguments[0]);if(!(t&&t instanceof window.Element))return null;try{return"string"==typeof e?_findInstanceProperty(this).call(this,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,t,n,o=this,i=this.player;(_mapInstanceProperty(e=this.__delegates).call(e,(function(e){e.destroy()})),this.__delegates=[],this._children instanceof Array)&&(_mapInstanceProperty(n=this._children).call(n,(function(e){i.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(_getPrototypeOf(r.prototype),"__destroy",this).call(this),this.icons={},_mapInstanceProperty(t=["root","parent"]).call(t,(function(e){o[e]=null})),this.extraEls=[]}}],[{key:"insert",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=t.children.length,o=Number(r),i=e instanceof window.Node;if(n){for(var a=0,s=null,l="";a<n;a++){s=t.children[a];var c=Number(s.getAttribute("data-index"));if(c>=o){l="beforebegin";break}c<o&&(l="afterend")}return i?"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 i?t.appendChild(e):t.insertAdjacentHTML("beforeend",e),t.children[t.children.length-1]}},{key:"defaultConfig",get:function(){return{}}},{key:"delegate",value:function(e,t,r,n){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=[];if(e instanceof window.Node&&"function"==typeof n)if(_Array$isArray(r))_forEachInstanceProperty(r).call(r,(function(r){var a,s=_delegate$1(e,t,r,n,o);s.key=_concatInstanceProperty(a="".concat(t,"_")).call(a,r),i.push(s)}));else{var a,s=_delegate$1(e,t,r,n,o);s.key=_concatInstanceProperty(a="".concat(t,"_")).call(a,r),i.push(s)}return i}},{key:"ROOT_TYPES",get:function(){return ROOT_TYPES}},{key:"POSITIONS",get:function(){return POSITIONS}}]),r}(),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"},STATES={INITIAL:1,READY:2,ATTACHING:3,ATTACHED:4,NOTALLOW:5,RUNNING:6,ENDED:7,DESTROYED:8};function xgIconTips(e,t,r){try{var n,o;return _concatInstanceProperty(n=_concatInstanceProperty(o=' <div class="xg-tips '.concat(r?"hide":" ",'" lang-key="')).call(o,e.i18nKeys[t],'">\n ')).call(n,e.i18n[t],"\n </div>")}catch(e){return'<div class="xg-tips hide"></div>'}}var Icon=function(e){_inherits(r,Plugin);var t=_createSuper(r);function r(){var e,n;_classCallCheck$1(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return _defineProperty$1(_assertThisInitialized(n=t.call.apply(t,_concatInstanceProperty(e=[this]).call(e,i))),"_onMouseenter",(function(e){n.emit("icon_mouseenter",{pluginName:n.pluginName})})),_defineProperty$1(_assertThisInitialized(n),"_onMouseLeave",(function(e){n.emit("icon_mouseleave",{pluginName:n.pluginName})})),n}return _createClass$1(r,[{key:"afterCreate",value:function(){_bindInstanceProperty(this).call(this,"mouseenter",this._onMouseenter),_bindInstanceProperty(this).call(this,"mouseleave",this._onMouseLeave),this.config.disable&&this.disable()}},{key:"destroy",value:function(){this.unbind("mouseenter",this._onMouseenter),this.unbind("mouseleave",this._onMouseLeave)}}]),r}();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(r,Icon);var t=_createSuper(r);function r(){return _classCallCheck$1(this,r),t.apply(this,arguments)}return _createClass$1(r,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.cssFullscreen&&(e.config.disable=!e.player.config.cssFullscreen)}},{key:"afterCreate",value:function(){var e,t=this;_get(_getPrototypeOf(r.prototype),"afterCreate",this).call(this),this.config.disable||(this.config.target&&(this.playerConfig.fullscreenTarget=this.config.target),this.initIcons(),this.on(CSS_FULLSCREEN_CHANGE,(function(e){t.animate(e)})),this.btnClick=_bindInstanceProperty(e=this.btnClick).call(e,this),this.handleCssFullscreen=this.hook("cssFullscreen_change",this.btnClick,{pre:function(e){e.preventDefault(),e.stopPropagation()}}),_bindInstanceProperty(this).call(this,["click","touchend"],this.handleCssFullscreen))}},{key:"initIcons",value:function(){var e=this.icons,t=_findInstanceProperty(this).call(this,".xgplayer-icon");t.appendChild(e.cssFullscreen),t.appendChild(e.exitCssFullscreen)}},{key:"btnClick",value:function(e){e.preventDefault(),e.stopPropagation();var t=this.player.isCssfullScreen;this.emitUserAction(e,"switch_cssfullscreen",{cssfullscreen:t}),t?this.player.exitCssFullscreen():this.player.getCssFullscreen()}},{key:"animate",value:function(e){this.root&&(e?this.setAttr("data-state","full"):this.setAttr("data-state","normal"),this.switchTips(e))}},{key:"switchTips",value:function(e){var t=this.i18nKeys,r=_findInstanceProperty(this).call(this,".xg-tips");r&&this.changeLangTextKey(r,e?t.EXITCSSFULLSCREEN_TIPS:t.CSSFULLSCREEN_TIPS)}},{key:"registerIcons",value:function(){return{cssFullscreen:{icon:CssFullSceenSvg,class:"xg-get-cssfull"},exitCssFullscreen:{icon:ExitCssFullSceenSvg,class:"xg-exit-cssfull"}}}},{key:"destroy",value:function(){_get(_getPrototypeOf(r.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.btnClick)}},{key:"render",value:function(){if(!this.config.disable)return"<xg-icon class='xgplayer-cssfullscreen'>\n <div class=\"xgplayer-icon\">\n </div>\n ".concat(xgIconTips(this,"CSSFULLSCREEN_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"cssFullscreen"}},{key:"defaultConfig",get:function(){return{position:POSITIONS.CONTROLS_RIGHT,index:1,disable:!1,target:null}}}]),r}();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(r,Plugin);var t=_createSuper(r);function r(){return _classCallCheck$1(this,r),t.apply(this,arguments)}return _createClass$1(r,[{key:"afterCreate",value:function(){var e=this;this.initIcons(),this.onClick=function(t){t.preventDefault(),t.stopPropagation(),e.config.onClick(t)},_bindInstanceProperty(this).call(this,["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$3.addClass(this.root,"show")}},{key:"hide",value:function(){util$3.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.ROOT_TOP,index:0}}}]),r}();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(r,Icon);var t=_createSuper(r);function r(){var e,n;_classCallCheck$1(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return _defineProperty$1(_assertThisInitialized(n=t.call.apply(t,_concatInstanceProperty(e=[this]).call(e,i))),"_onOrientationChange",(function(e){n.player.fullscreen&&n.config.rotateFullscreen&&(90===window.orientation||-90===window.orientation?n.player.setRotateDeg(0):n.player.setRotateDeg(90))})),n}return _createClass$1(r,[{key:"afterCreate",value:function(){var e=this;_get(_getPrototypeOf(r.prototype),"afterCreate",this).call(this);var t=this.config,n=this.playerConfig;if(!t.disable){t.target&&(this.playerConfig.fullscreenTarget=this.config.target);var o=util$3.getFullScreenEl();n.fullscreenTarget===o&&this.player.getFullscreen().catch((function(e){})),this.initIcons(),this.handleFullscreen=this.hook("fullscreenChange",this.toggleFullScreen,{pre:function(t){var r=e.player.fullscreen;e.emitUserAction(t,"switch_fullscreen",{prop:"fullscreen",from:r,to:!r})}}),_bindInstanceProperty(this).call(this,".xgplayer-fullscreen",["touchend","click"],this.handleFullscreen),this.on(FULLSCREEN_CHANGE,(function(t){var r=_findInstanceProperty(e).call(e,".xg-tips");r&&e.changeLangTextKey(r,t?e.i18nKeys.EXITFULLSCREEN_TIPS:e.i18nKeys.FULLSCREEN_TIPS),e.animate(t)})),this.config.needBackIcon&&(this.topBackIcon=this.player.registerPlugin({plugin:TopBackIcon,options:{config:{onClick:function(t){e.handleFullscreen(t)}}}})),"mobile"===sniffer.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(_getPrototypeOf(r.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,r=this.config;!0===r.useCssFullscreen||"function"==typeof r.useCssFullscreen&&r.useCssFullscreen()?(t.fullscreen?t.exitCssFullscreen():t.getCssFullscreen(),this.animate(t.fullscreen)):r.rotateFullscreen?(t.fullscreen?t.exitRotateFullscreen():t.getRotateFullscreen(),this.animate(t.fullscreen)):r.switchCallback&&"function"==typeof r.switchCallback?r.switchCallback(t.fullscreen):t.fullscreen?(t.exitFullscreen(),r.useScreenOrientation&&this.unlockScreen()):(t.getFullscreen().catch((function(e){})),r.useScreenOrientation&&t.aspectRatio>1&&this.lockScreen(r.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.CONTROLS_RIGHT,index:0,useCssFullscreen:!1,rotateFullscreen:!1,useScreenOrientation:!1,lockOrientationType:"landscape",switchCallback:null,target:null,disable:!1,needBackIcon:!1}}}]),r}();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 Play=function(e){_inherits(r,Icon);var t=_createSuper(r);function r(){var e,n;_classCallCheck$1(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return _defineProperty$1(_assertThisInitialized(n=t.call.apply(t,_concatInstanceProperty(e=[this]).call(e,i))),"btnClick",(function(e){e.preventDefault(),e.stopPropagation();var t=_assertThisInitialized(n).player;return n.emitUserAction(e,"switch_play_pause",{prop:"paused",from:t.paused,to:!t.paused}),t.ended?t.replay():t.paused?(t.play(),n.animate(!1)):(t.pause(),n.animate(!0)),!1})),n}return _createClass$1(r,[{key:"afterCreate",value:function(){_get(_getPrototypeOf(r.prototype),"afterCreate",this).call(this),this.config.disable||(this.initIcons(),_bindInstanceProperty(this).call(this,["touchend","click"],this.btnClick),this.listenEvents(),this.animate(!0))}},{key:"listenEvents",value:function(){var e=this,t=this.player;this.on([PLAY,PAUSE,ERROR,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,r=_findInstanceProperty(this).call(this,".xg-tips");e?(this.setAttr("data-state","pause"),r&&this.changeLangTextKey(r,t.PLAY_TIPS)):(this.setAttr("data-state","play"),r&&this.changeLangTextKey(r,t.PAUSE_TIPS))}}},{key:"destroy",value:function(){_get(_getPrototypeOf(r.prototype),"destroy",this).call(this),this.unbind(["touchend","click"],this.btnClick)}},{key:"render",value:function(){if(!this.config.disable)return'<xg-icon class="xgplayer-play">\n <div class="xgplayer-icon">\n </div>\n '.concat(xgIconTips(this,"PLAY_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"play"}},{key:"defaultConfig",get:function(){return{position:POSITIONS.CONTROLS_LEFT,index:0,disable:!1}}}]),r}(),$$B=_export,$findIndex=arrayIteration.findIndex,FIND_INDEX="findIndex",SKIPS_HOLES=!0;FIND_INDEX in[]&&Array(1)[FIND_INDEX]((function(){SKIPS_HOLES=!1})),$$B({target:"Array",proto:!0,forced:SKIPS_HOLES},{findIndex:function(e){return $findIndex(this,e,arguments.length>1?arguments[1]:void 0)}});var entryVirtual$7=entryVirtual$o,findIndex$6=entryVirtual$7("Array").findIndex,isPrototypeOf$6=objectIsPrototypeOf,method$5=findIndex$6,ArrayPrototype$5=Array.prototype,findIndex$5=function(e){var t=e.findIndex;return e===ArrayPrototype$5||isPrototypeOf$6(ArrayPrototype$5,e)&&t===ArrayPrototype$5.findIndex?method$5:t},parent$I=findIndex$5,findIndex$4=parent$I,parent$H=findIndex$4,findIndex$3=parent$H,parent$G=findIndex$3,findIndex$2=parent$G,findIndex$1=findIndex$2,findIndex2=findIndex$1,_findIndexInstanceProperty=getDefaultExportFromCjs(findIndex2),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$1(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$1(e,[{key:"updateDuration",value:function(e){var t=this;this.duration=e;var r=0,n=this.fragments;this.fragments=_mapInstanceProperty(n).call(n,(function(e){return e.start=_parseInt$1(r,10),e.end=_parseInt$1(r+e.percent*t.duration,10),e.duration=_parseInt$1(e.percent*t.duration,10),r+=e.percent*t.duration,e}))}},{key:"updateProgress",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"played",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{newIndex:0,curIndex:0,millisecond:0},r=this.progressList,n=this.fragments;if(!(r.length<1)){var o=t.newIndex,i=t.curIndex,a=t.millisecond;o!==i&&_mapInstanceProperty(r).call(r,(function(t,r){r<o?t[e].style.width="100%":r>o&&(t[e].style.width=0)}));var s=n[o],l=0===a?0:(a-s.start)/s.duration;r[o][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=_findIndexInstanceProperty(this).call(this,1e3*e.currentTime,this.focusIndex);if(t>=0&&t!==this.focusIndex){this.focusIndex>-1&&this.unHightLight(this.focusIndex),this.setHightLight(t);var r={index:t,preIndex:this.focusIndex,fragment:this.fragments[this.focusIndex]};this.focusIndex=t,this._callBack&&this._callBack(r)}}else if(this.focusIndex>-1){this.unHightLight(this.focusIndex);var n={index:-1,preIndex:this.focusIndex,fragment:null};this._callBack&&this._callBack(n),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$1(1e3*t,10)!==this.duration){if(!t&&0!==t)return;this.updateDuration(_parseInt$1(1e3*t,10))}var r=this.playedIndex,n=this.cachedIndex;if("Undefined"!==util$3.typeOf(e.played)){var o=_findIndexInstanceProperty(this).call(this,1e3*e.played,r);if(o<0)return;this.updateProgress("played",{newIndex:o,curIndex:r,millisecond:_parseInt$1(1e3*e.played,10)}),this.playedIndex=o}if("Undefined"!==util$3.typeOf(e.cached)){var i=_findIndexInstanceProperty(this).call(this,1e3*e.cached,n);if(i<0)return;this.updateProgress("cached",{newIndex:i,curIndex:n,millisecond:_parseInt$1(1e3*e.cached,10)}),this.cachedIndex=i}}},{key:"findIndex",value:function(e,t){var r=this.fragments;if(!r||0===r.length)return-1;if(1===r.length)return 0;if(t>-1&&t<r.length&&e>r[t].start&&e<r[t].end)return t;if(e>r[r.length-1].start)return r.length-1;for(var n=0;n<r.length;n++)if(e>r[n].start&&e<=r[n].end){t=n;break}return t}},{key:"findHightLight",value:function(){for(var e=this.root.children,t=0;t<e.length;t++)if(util$3.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$3.removeClass(e[t],this.fragConfig.fragFocusClass)}},{key:"setHightLight",value:function(e){var t=this.root.children;if(e<t.length)return util$3.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,r=this;if(_forEachInstanceProperty(t=_Object$keys(this.fragConfig)).call(t,(function(t){void 0!==e[t]&&(r.fragConfig[t]=e[t])})),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 n=this.root.children;n.length>0;)this.root.removeChild(n[0]);this.render()}}},{key:"render",value:function(){var e=this,t=this.style.progressColor;if(this.root||(this.root=util$3.createDom("xg-inners","",{},"progress-list")),this.fragments){var r,n=this.fragConfig,o=n.fragClass,i=n.fragFocusClass;this.progressList=_mapInstanceProperty(r=this.fragments).call(r,(function(r){var n,a,s=util$3.createDom("xg-inner","",{style:t?_concatInstanceProperty(n="background:".concat(t,"; flex: ")).call(n,r.percent):"flex: ".concat(r.percent)},_concatInstanceProperty(a="".concat(r.isFocus?i:""," xgplayer-progress-inner ")).call(a,o));return e.root.appendChild(s),_forEachInstanceProperty(TPL).call(TPL,(function(t){s.appendChild(util$3.createDom(t.tag,"",{style:t.styleKey?"background: ".concat(e.style[t.styleKey],"; width:0;"):"width:0;"},t.className))})),{cached:s.children[0],played:s.children[1]}}))}return this.root}}]),e}(),FRAGMENT_FOCUS_CLASS={POINT:"inner-focus-point",HIGHLIGHT:"inner-focus-highlight"},Progress=function(e){_inherits(r,Plugin);var t=_createSuper(r);function r(e){var n;return _classCallCheck$1(this,r),_defineProperty$1(_assertThisInitialized(n=t.call(this,e)),"onMoveOnly",(function(e,t){var r=_assertThisInitialized(n),o=r.pos,i=r.config,a=r.player,s=t;if(e){util$3.event(e);var l=util$3.getEventPos(e,a.zoom),c=90===a.rotateDeg?l.clientY:l.clientX;if(o.moving&&Math.abs(o.x-c)<i.miniMoveStep)return;o.moving=!0,o.x=c,s=n.computeTime(e,c)}n.triggerCallbacks("dragmove",s,e),n._updateInnerFocus(s)})),_defineProperty$1(_assertThisInitialized(n),"onBodyClick",(function(e){n.pos.isLocked&&(n.pos.isLocked=!1,e.preventDefault(),e.stopPropagation())})),_defineProperty$1(_assertThisInitialized(n),"_mouseDownHandler",(function(e,t){n._state.time=t.currentTime,n.updateWidth(t.currentTime,t.seekTime,t.percent,0),n._updateInnerFocus(t)})),_defineProperty$1(_assertThisInitialized(n),"_mouseUpHandler",(function(e,t){_assertThisInitialized(n).pos.moving&&n.updateWidth(t.currentTime,t.seekTime,t.percent,2)})),_defineProperty$1(_assertThisInitialized(n),"_mouseMoveHandler",(function(e,t){var r=_assertThisInitialized(n),o=r._state,i=r.pos,a=r.config,s=r.player;o.time<t.currentTime?t.forward=!0:t.forward=!1,o.time=t.currentTime,i.isDown&&!i.moving&&(i.moving=!0,a.isPauseMoving&&s.pause(),n.triggerCallbacks("dragstart",t,e),n.emitUserAction("drag","dragstart",t)),n.updateWidth(t.currentTime,t.seekTime,t.percent,1),n.triggerCallbacks("dragmove",t,e),n._updateInnerFocus(t)})),_defineProperty$1(_assertThisInitialized(n),"onMouseDown",(function(e){var t=_assertThisInitialized(n),r=t._state,o=t.player,i=t.pos,a=t.config,s=t.playerConfig,l=util$3.getEventPos(e,o.zoom),c=90===o.rotateDeg?l.clientY:l.clientX;if(!(o.isMini||a.closeMoveSeek||!s.allowSeekAfterEnded&&o.ended)){if(o.duration||o.isPlaying){e.stopPropagation(),n.focus(),util$3.checkIsFunction(s.disableSwipeHandler)&&s.disableSwipeHandler(),util$3.checkIsFunction(a.onMoveStart)&&a.onMoveStart(),util$3.event(e),i.x=c,i.isDown=!0,i.moving=!1,r.prePlayTime=o.currentTime,o.focus({autoHide:!1}),n.isProgressMoving=!0,util$3.addClass(n.progressBtn,"active");var u=n.computeTime(e,c);return u.prePlayTime=r.prePlayTime,n._mouseDownHandlerHook(e,u),"touchstart"===e.type?(n.root.addEventListener("touchmove",n.onMouseMove),n.root.addEventListener("touchend",n.onMouseUp),n.root.addEventListener("touchcancel",n.onMouseUp)):(n.unbind("mousemove",n.onMoveOnly),document.addEventListener("mousemove",n.onMouseMove,!1),document.addEventListener("mouseup",n.onMouseUp,!1)),!0}o.play()}})),_defineProperty$1(_assertThisInitialized(n),"onMouseUp",(function(e){var t=_assertThisInitialized(n),r=t.player,o=t.config,i=t.pos,a=t.playerConfig,s=t._state;if(i){e.stopPropagation(),e.preventDefault(),util$3.checkIsFunction(a.enableSwipeHandler)&&a.enableSwipeHandler(),util$3.checkIsFunction(o.onMoveEnd)&&o.onMoveEnd(),util$3.event(e),util$3.removeClass(n.progressBtn,"active");var l=n.computeTime(e,i.x);l.prePlayTime=s.prePlayTime,i.moving?(n.triggerCallbacks("dragend",l,e),n.emitUserAction("drag","dragend",l)):(n.triggerCallbacks("click",l,e),n.emitUserAction("click","click",l)),n._mouseUpHandlerHook(e,l),i.moving=!1,i.isDown=!1,i.x=0,i.y=0,i.isLocked=!0,s.prePlayTime=0,s.time=0;var c=e.type;"touchend"===c||"touchcancel"===c?(n.root.removeEventListener("touchmove",n.onMouseMove),n.root.removeEventListener("touchend",n.onMouseUp),n.root.removeEventListener("touchcancel",n.onMouseUp),n.blur()):(document.removeEventListener("mousemove",n.onMouseMove,!1),document.removeEventListener("mouseup",n.onMouseUp,!1),i.isEnter?"mobile"!==a.isMobileSimulateMode&&_bindInstanceProperty(n).call(n,"mousemove",n.onMoveOnly):n.onMouseLeave(e)),util$3.setTimeout(_assertThisInitialized(n),(function(){n.resetSeekState()}),1),r.focus()}})),_defineProperty$1(_assertThisInitialized(n),"onMouseMove",(function(e){var t=_assertThisInitialized(n),r=t._state,o=t.pos,i=t.player,a=t.config;util$3.checkTouchSupport()&&e.preventDefault(),util$3.event(e);var s=util$3.getEventPos(e,i.zoom),l=90===i.rotateDeg?s.clientY:s.clientX,c=Math.abs(o.x-l);if(!(o.moving&&c<a.miniMoveStep||!o.moving&&c<a.miniStartStep)){o.x=l;var u=n.computeTime(e,l);u.prePlayTime=r.prePlayTime,n._mouseMoveHandlerHook(e,u)}})),_defineProperty$1(_assertThisInitialized(n),"onMouseOut",(function(e){n.triggerCallbacks("mouseout",null,e)})),_defineProperty$1(_assertThisInitialized(n),"onMouseOver",(function(e){n.triggerCallbacks("mouseover",null,e)})),_defineProperty$1(_assertThisInitialized(n),"onMouseEnter",(function(e){var t=_assertThisInitialized(n),r=t.player,o=t.pos;if(!(o.isDown||o.isEnter||r.isMini||!r.config.allowSeekAfterEnded&&r.ended)){o.isEnter=!0,_bindInstanceProperty(n).call(n,"mousemove",n.onMoveOnly),_bindInstanceProperty(n).call(n,"mouseleave",n.onMouseLeave),util$3.event(e);var i=util$3.getEventPos(e,r.zoom),a=90===r.rotateDeg?i.clientY:i.clientX,s=n.computeTime(e,a);n.triggerCallbacks("mouseenter",s,e),n.focus()}})),_defineProperty$1(_assertThisInitialized(n),"onMouseLeave",(function(e){n.triggerCallbacks("mouseleave",null,e),n.unlock(),n._updateInnerFocus(null)})),_defineProperty$1(_assertThisInitialized(n),"onVideoResize",(function(){var e=n.pos,t=e.x,r=e.isDown;if(e.isEnter&&!r){var o=n.computeTime(null,t);n.onMoveOnly(null,o)}})),n.useable=!1,n.isProgressMoving=!1,n.__dragCallBacks=[],n._state={now:-1,direc:0,time:0,prePlayTime:-1},n._disableBlur=!1,"boolean"==typeof n.config.isDragingSeek&&(console.warn("[XGPLAYER] 'isDragingSeek' is deprecated, please use 'isDraggingSeek' instead"),n.config.isDraggingSeek=n.config.isDragingSeek),n}return _createClass$1(r,[{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,r=e.currentTime;return t>=0?t:r+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]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t&&0!==t.length||(t=[{percent:1}]);var n,o=_objectSpread2$1(_objectSpread2$1({fragments:t},r),{},{actionCallback:function(t){e.emitUserAction("fragment_focus","fragment_focus",t)}});this.innerList?this.innerList.reset(o):(this.innerList=new InnerList(o),this.outer.insertBefore(this.innerList.render(),this.outer.children[0]),_mapInstanceProperty(n=["findHightLight","unHightLight","setHightLight","findFragment"]).call(n,(function(t){var r;e[t]=_bindInstanceProperty(r=e.innerList[t]).call(r,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=_findInstanceProperty(this).call(this,"xg-outer");var e=this.config,t=e.fragFocusClass,r=e.fragAutoFocus,n=e.fragClass;this._initInner(this.config.fragments,{fragFocusClass:t,fragAutoFocus:r,fragClass:n,style:this.playerConfig.commonStyle||{}}),"mobile"===sniffer.device&&(this.config.isDraggingSeek=!1,this.isMobile=!0),this.progressBtn=_findInstanceProperty(this).call(this,".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,r=this,n=null;_forEachInstanceProperty(t=_Object$keys(e)).call(t,(function(t){r.config[t]=e[t],"fragments"===t&&(n=e[t])})),n&&this._initInner(n,e)}},{key:"initCustomStyle",value:function(){var e=(this.playerConfig||{}).commonStyle.sliderBtnStyle,t=this.progressBtn;if(e)if("string"==typeof e)t.style.boxShadow=e;else if("object"===_typeof$1(e)){var r;_mapInstanceProperty(r=_Object$keys(e)).call(r,(function(r){t.style[r]=e[r]}))}}},{key:"triggerCallbacks",value:function(e,t,r){var n;this.__dragCallBacks.length>0&&_mapInstanceProperty(n=this.__dragCallBacks).call(n,(function(n){if(n&&n.handler&&n.type===e)try{n.handler(t,r)}catch(e){console.error("[XGPLAYER][triggerCallbacks] ".concat(n," 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 r=this.__dragCallBacks,n=-1;_mapInstanceProperty(r).call(r,(function(r,o){r&&r.type===e&&r.handler===t&&(n=o)})),n>-1&&_spliceInstanceProperty(r).call(r,n,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)&&(_bindInstanceProperty(this).call(this,"mousedown",this.onMouseDown),"mobile"!==e.isMobileSimulateMode&&_bindInstanceProperty(this).call(this,"mouseenter",this.onMouseEnter),_bindInstanceProperty(this).call(this,"mouseover",this.onMouseOver),_bindInstanceProperty(this).call(this,"mouseout",this.onMouseOut),this.player.root.addEventListener("click",this.onBodyClick,!0))}},{key:"focus",value:function(){this.player.controls.pauseAutoHide(),util$3.addClass(this.root,"active")}},{key:"blur",value:function(){this._disableBlur||(this.player.controls.recoverAutoHide(),util$3.removeClass(this.root,"active"))}},{key:"disableBlur",value:function(){this._disableBlur=!0}},{key:"enableBlur",value:function(){this._disableBlur=!1}},{key:"updateWidth",value:function(e,t,r,n){var o=this.config,i=this.player;if(!o.isCloseClickSeek||0!==n){var a=t=t>=i.duration?i.duration-o.endedDiff:Number(t).toFixed(1);this.updatePercent(r),this.updateTime(e),(1!==n||o.isDraggingSeek&&"audio"!==i.config.mediaType)&&(this._state.now=a,this._state.direc=a>i.currentTime?0:1,i.seek(a))}}},{key:"computeTime",value:function(e,t){var r,n,o=this.player,i=this.root.getBoundingClientRect(),a=i.width,s=i.height,l=i.top,c=i.left,u=t;90===o.rotateDeg?(r=s,n=l):(r=a,n=c);var p=u-n,f=(p=p>r?r:p<0?0:p)/r;_Number$isNaN(f=f<0?0:f>1?1:f)&&(f=this.player.currentTime/this.offsetDuration);var d=_parseInt$1(f*this.offsetDuration*1e3,10)/1e3;return{percent:f,currentTime:d,seekTime:util$3.getCurrentTimeByOffset(d,o.timeSegments),offset:p,width:r,left:n,e:e}}},{key:"updateTime",value:function(e){var t=this.player,r=this.duration;e>r?e=r:e<0&&(e=0);var n=t.plugins.time;n&&n.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 r=this.player.plugins.miniprogress;r&&r.update({played:e*this.offsetDuration},this.offsetDuration)}}},{key:"onTimeupdate",value:function(e){var t=this.player,r=this._state,n=this.offsetDuration;if(!(t.isSeeking&&t.media.seeking||this.isProgressMoving)&&t.hasStart){if(r.now>-1){var o=_parseInt$1(1e3*r.now,10)-_parseInt$1(1e3*t.currentTime,10);if(0===r.direc&&o>300||1===r.direc&&o>-300)return void(r.now=-1);r.now=-1}var i=this.currentTime;i=util$3.adjustTimeByDuration(i,n,e),this.innerList.update({played:i},n),this.progressBtn.style.left="".concat(i/n*100,"%")}}},{key:"onCacheUpdate",value:function(e){var t=this.player,r=this.duration;if(t){var n=t.bufferedPoint.end;n=util$3.adjustTimeByDuration(n,r,e),this.innerList.update({cached:n},r)}}},{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.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}}]),r}(),Time=function(e){_inherits(r,Plugin);var t=_createSuper(r);function r(e){var n;return _classCallCheck$1(this,r),(n=t.call(this,e)).isActiving=!1,n}return _createClass$1(r,[{key:"duration",get:function(){var e=this.player,t=e.offsetDuration,r=e.duration;return this.playerConfig.customDuration||t||r}},{key:"currentTime",get:function(){var e=this.player,t=e.offsetCurrentTime,r=e.currentTime;return t>=0?t:r}},{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=_findInstanceProperty(this).call(this,".time-duration"),this.timeDom=_findInstanceProperty(this).call(this,".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,r=this.config,n=this.duration;if(!r.disable&&!this.isActiving&&t.hasStart){var o=this.currentTime+this.timeOffset;o=util$3.adjustTimeByDuration(o,n,e),"flex"===this.mode?(this.centerCurDom.innerHTML=this.minWidthTime(util$3.format(o)),n!==1/0&&n>0&&(this.centerDurDom.innerHTML=util$3.format(n))):(this.timeDom.innerHTML=this.minWidthTime(util$3.format(o)),n!==1/0&&n>0&&(this.durationDom.innerHTML=util$3.format(n)))}}},{key:"onReset",value:function(){"flex"===this.mode?(this.centerCurDom.innerHTML=this.minWidthTime(util$3.format(0)),this.centerDurDom.innerHTML=util$3.format(0)):(this.timeDom.innerHTML=this.minWidthTime(util$3.format(0)),this.durationDom.innerHTML=util$3.format(0))}},{key:"createCenterTime",value:function(){var e=this.player;if(e.controls&&e.controls.center){var t=e.controls.center;this.centerCurDom=util$3.createDom("xg-icon","00:00",{},"xgplayer-time xg-time-left"),this.centerDurDom=util$3.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$3.hide(this.durationDom),util$3.hide(this.timeDom),util$3.hide(_findInstanceProperty(this).call(this,".time-separator")),util$3.show(_findInstanceProperty(this).call(this,".time-live-tag"))):util$3.hide(_findInstanceProperty(this).call(this,".time-live-tag"));e.hide?this.hide():this.show()}},{key:"changeLiveState",value:function(e){e?(util$3.hide(this.durationDom),util$3.hide(this.timeDom),util$3.hide(_findInstanceProperty(this).call(this,".time-separator")),util$3.show(_findInstanceProperty(this).call(this,".time-live-tag"))):(util$3.hide(_findInstanceProperty(this).call(this,".time-live-tag")),util$3.show(_findInstanceProperty(this).call(this,".time-separator")),util$3.show(this.durationDom),util$3.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$3.format(e)):this.centerCurDom.innerHTML=this.minWidthTime(util$3.format(e)))}},{key:"minWidthTime",value:function(e){var t;return _mapInstanceProperty(t=e.split(":")).call(t,(function(e){return'<span class="time-min-width">'.concat(e,"</span>")})).join(":")}},{key:"resetActive",value:function(){var e=this,t=this.player,r=function(){e.isActiving=!1};this.off(SEEKED,r),t.isSeeking&&t.media.seeking?this.once(SEEKED,r):this.isActiving=!1}},{key:"destroy",value:function(){var e=this.player.controls.center;this.centerCurDom&&e.removeChild(this.centerCurDom),this.centerCurDom=null,this.centerDurDom&&e.removeChild(this.centerDurDom),this.centerDurDom=null}},{key:"render",value:function(){if(!this.config.disable)return'<xg-icon class="xgplayer-time">\n <span class="time-current">00:00</span>\n <span class="time-separator">/</span>\n <span class="time-duration">00:00</span>\n <span class="time-live-tag">'.concat(this.i18n.LIVE_TIP,"</span>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"time"}},{key:"defaultConfig",get:function(){return{position:POSITIONS.CONTROLS_LEFT,index:2,disable:!1}}}]),r}();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(r,Plugin);var t=_createSuper(r);function r(){var e,n;_classCallCheck$1(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return _defineProperty$1(_assertThisInitialized(n=t.call.apply(t,_concatInstanceProperty(e=[this]).call(e,i))),"onBarMousedown",(function(e){var t=_assertThisInitialized(n).player,r=_findInstanceProperty(n).call(n,".xgplayer-bar");util$3.event(e);var o=r.getBoundingClientRect(),i=util$3.getEventPos(e,t.zoom),a=o.height-(i.clientY-o.top);if(i.h=a,i.barH=o.height,n.pos=i,!(a<-2))return n.updateVolumePos(a,e),document.addEventListener("mouseup",n.onBarMouseUp),n._d.isStart=!0,!1})),_defineProperty$1(_assertThisInitialized(n),"onBarMouseMove",(function(e){var t=_assertThisInitialized(n)._d;if(t.isStart){var r=_assertThisInitialized(n),o=r.pos,i=r.player;e.preventDefault(),e.stopPropagation(),util$3.event(e);var a=util$3.getEventPos(e,i.zoom);t.isMoving=!0;var s=o.h-a.clientY+o.clientY;s>o.barH||n.updateVolumePos(s,e)}})),_defineProperty$1(_assertThisInitialized(n),"onBarMouseUp",(function(e){util$3.event(e),document.removeEventListener("mouseup",n.onBarMouseUp);var t=_assertThisInitialized(n)._d;t.isStart=!1,t.isMoving=!1})),_defineProperty$1(_assertThisInitialized(n),"onMouseenter",(function(e){n._d.isActive=!0,n.focus(),n.emit("icon_mouseenter",{pluginName:n.pluginName})})),_defineProperty$1(_assertThisInitialized(n),"onMouseleave",(function(e){n._d.isActive=!1,n.unFocus(100,!1,e),n.emit("icon_mouseleave",{pluginName:n.pluginName})})),_defineProperty$1(_assertThisInitialized(n),"onVolumeChange",(function(e){if(n.player){var t=n.player,r=t.muted,o=t.volume;n._d.isMoving||(_findInstanceProperty(n).call(n,".xgplayer-drag").style.height=r||0===o?"4px":"".concat(100*o,"%"),n.config.showValueLabel&&n.updateVolumeValue()),n.animate(r,o)}})),n}return _createClass$1(r,[{key:"registerIcons",value:function(){return{volumeSmall:{icon:volumeSmallSvg,class:"xg-volume-small"},volumeLarge:{icon:volumeLargeSvg,class:"xg-volume"},volumeMuted:{icon:volumeMutedSvg,class:"xg-volume-mute"}}}},{key:"afterCreate",value:function(){var e=this;if(this._timerId=null,this._d={isStart:!1,isMoving:!1,isActive:!1},!this.config.disable){this.initIcons();var t=this.playerConfig,r=t.commonStyle,n=t.volume;if(r.volumeColor)_findInstanceProperty(this).call(this,".xgplayer-drag").style.backgroundColor=r.volumeColor;if(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)_bindInstanceProperty(this).call(this,"mouseenter",this._onMouseenterHandler),_bindInstanceProperty(this).call(this,["blur","mouseleave"],this._onMouseleaveHandler),_bindInstanceProperty(this).call(this,".xgplayer-slider","mousedown",this.onBarMousedown),_bindInstanceProperty(this).call(this,".xgplayer-slider","mousemove",this.onBarMouseMove),_bindInstanceProperty(this).call(this,".xgplayer-slider","mouseup",this.onBarMouseUp);_bindInstanceProperty(this).call(this,".xgplayer-icon",["touchend","click"],this.changeMutedHandler),this.on(VOLUME_CHANGE,this.onVolumeChange),this.once(LOADED_DATA,this.onVolumeChange),"Number"!==util$3.typeOf(n)&&(this.player.volume=this.config.default),this.onVolumeChange()}}},{key:"updateVolumePos",value:function(e,t){var r=this.player,n=_findInstanceProperty(this).call(this,".xgplayer-drag"),o=_findInstanceProperty(this).call(this,".xgplayer-bar");if(o&&n){var i=_parseInt$1(e/o.getBoundingClientRect().height*1e3,10);n.style.height="".concat(e,"px");var a=Math.max(Math.min(i/1e3,1),0),s={volume:{from:r.volume,to:a}};r.muted&&(s.muted={from:!0,to:!1}),this.emitUserAction(t,"change_volume",{muted:r.muted,volume:r.volume,props:s}),r.volume=Math.max(Math.min(i/1e3,1),0),r.muted&&(r.muted=!1),this.config.showValueLabel&&this.updateVolumeValue()}}},{key:"updateVolumeValue",value:function(){var e=this.player,t=e.volume,r=e.muted,n=_findInstanceProperty(this).call(this,".xgplayer-value-label"),o=Math.max(Math.min(t,1),0);n.innerText=r?0:Math.round(100*o)}},{key:"focus",value:function(){this.player.focus({autoHide:!1}),this._timerId&&(util$3.clearTimeout(this,this._timerId),this._timerId=null),util$3.addClass(this.root,"slide-show")}},{key:"unFocus",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,o=this._d,i=this.player;o.isActive||(this._timerId&&(util$3.clearTimeout(this,this._timerId),this._timerId=null),this._timerId=util$3.setTimeout(this,(function(){o.isActive||(r?i.blur():i.focus(),util$3.removeClass(e.root,"slide-show"),o.isStart&&e.onBarMouseUp(n)),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$3.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(){var e;if(!this.config.disable){var t=this.config.default||this.player.volume,r=this.config.showValueLabel;return _concatInstanceProperty(e='\n <xg-icon class="xgplayer-volume" data-state="normal">\n <div class="xgplayer-icon">\n </div>\n <xg-slider class="xgplayer-slider">\n '.concat(r?'<div class="xgplayer-value-label">'.concat(100*t,"</div>"):"",'\n <div class="xgplayer-bar">\n <xg-drag class="xgplayer-drag" style="height: ')).call(e,100*t,'%"></xg-drag>\n </div>\n </xg-slider>\n </xg-icon>')}}}],[{key:"pluginName",get:function(){return"volume"}},{key:"defaultConfig",get:function(){return{position:POSITIONS.CONTROLS_RIGHT,index:1,disable:!1,showValueLabel:!1,default:.6,miniVolume:.2}}}]),r}(),fails$7=fails$B,wellKnownSymbol$3=wellKnownSymbol$q,DESCRIPTORS$5=descriptors$2,IS_PURE=isPure,ITERATOR$1=wellKnownSymbol$3("iterator"),urlConstructorDetection=!fails$7((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,r="";return e.pathname="c%20d",t.forEach((function(e,n){t.delete("b"),r+=n+e})),IS_PURE&&!e.toJSON||!t.size&&(IS_PURE||!DESCRIPTORS$5)||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[ITERATOR$1]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==r||"x"!==new URL("http://x",void 0).host})),uncurryThis$7=functionUncurryThis,maxInt=2147483647,base=36,tMin=1,tMax=26,skew=38,damp=700,initialBias=72,initialN=128,delimiter="-",regexNonASCII=/[^\0-\u007E]/,regexSeparators=/[.\u3002\uFF0E\uFF61]/g,OVERFLOW_ERROR="Overflow: input needs wider integers to process",baseMinusTMin=base-tMin,$RangeError=RangeError,exec$1=uncurryThis$7(regexSeparators.exec),floor$2=Math.floor,fromCharCode=String.fromCharCode,charCodeAt=uncurryThis$7("".charCodeAt),join$2=uncurryThis$7([].join),push$5=uncurryThis$7([].push),replace$2=uncurryThis$7("".replace),split$2=uncurryThis$7("".split),toLowerCase$1=uncurryThis$7("".toLowerCase),ucs2decode=function(e){for(var t=[],r=0,n=e.length;r<n;){var o=charCodeAt(e,r++);if(o>=55296&&o<=56319&&r<n){var i=charCodeAt(e,r++);56320==(64512&i)?push$5(t,((1023&o)<<10)+(1023&i)+65536):(push$5(t,o),r--)}else push$5(t,o)}return t},digitToBasic=function(e){return e+22+75*(e<26)},adapt=function(e,t,r){var n=0;for(e=r?floor$2(e/damp):e>>1,e+=floor$2(e/t);e>baseMinusTMin*tMax>>1;)e=floor$2(e/baseMinusTMin),n+=base;return floor$2(n+(baseMinusTMin+1)*e/(e+skew))},encode=function(e){var t,r,n=[],o=(e=ucs2decode(e)).length,i=initialN,a=0,s=initialBias;for(t=0;t<e.length;t++)(r=e[t])<128&&push$5(n,fromCharCode(r));var l=n.length,c=l;for(l&&push$5(n,delimiter);c<o;){var u=maxInt;for(t=0;t<e.length;t++)(r=e[t])>=i&&r<u&&(u=r);var p=c+1;if(u-i>floor$2((maxInt-a)/p))throw $RangeError(OVERFLOW_ERROR);for(a+=(u-i)*p,i=u,t=0;t<e.length;t++){if((r=e[t])<i&&++a>maxInt)throw $RangeError(OVERFLOW_ERROR);if(r==i){for(var f=a,d=base;;){var h=d<=s?tMin:d>=s+tMax?tMax:d-s;if(f<h)break;var $=f-h,y=base-h;push$5(n,fromCharCode(digitToBasic(h+$%y))),f=floor$2($/y),d+=base}push$5(n,fromCharCode(digitToBasic(f))),s=adapt(a,p,c==l),a=0,c++}}a++,i++}return join$2(n,"")},stringPunycodeToAscii=function(e){var t,r,n=[],o=split$2(replace$2(toLowerCase$1(e),regexSeparators,"."),".");for(t=0;t<o.length;t++)r=o[t],push$5(n,exec$1(regexNonASCII,r)?"xn--"+encode(r):r);return join$2(n,".")},defineBuiltIn$2=defineBuiltIn$8,defineBuiltIns$2=function(e,t,r){for(var n in t)r&&r.unsafe&&e[n]?e[n]=t[n]:defineBuiltIn$2(e,n,t[n],r);return e},$$A=_export,global$4=global$s,call$5=functionCall,uncurryThis$6=functionUncurryThis,DESCRIPTORS$4=descriptors$2,USE_NATIVE_URL$2=urlConstructorDetection,defineBuiltIn$1=defineBuiltIn$8,defineBuiltInAccessor$2=defineBuiltInAccessor$5,defineBuiltIns$1=defineBuiltIns$2,setToStringTag$2=setToStringTag$9,createIteratorConstructor=iteratorCreateConstructor,InternalStateModule$3=internalState,anInstance$3=anInstance$5,isCallable$4=isCallable$q,hasOwn$2=hasOwnProperty_1,bind$a=functionBindContext,classof$2=classof$c,anObject$1=anObject$g,isObject$5=isObject$l,$toString$1=toString$f,create$1=objectCreate,createPropertyDescriptor=createPropertyDescriptor$8,getIterator=getIterator$3,getIteratorMethod=getIteratorMethod$a,validateArgumentsLength$2=validateArgumentsLength$5,wellKnownSymbol$2=wellKnownSymbol$q,arraySort=arraySort$1,ITERATOR=wellKnownSymbol$2("iterator"),URL_SEARCH_PARAMS="URLSearchParams",URL_SEARCH_PARAMS_ITERATOR=URL_SEARCH_PARAMS+"Iterator",setInternalState$3=InternalStateModule$3.set,getInternalParamsState=InternalStateModule$3.getterFor(URL_SEARCH_PARAMS),getInternalIteratorState=InternalStateModule$3.getterFor(URL_SEARCH_PARAMS_ITERATOR),getOwnPropertyDescriptor5=Object.getOwnPropertyDescriptor,safeGetBuiltIn=function(e){if(!DESCRIPTORS$4)return global$4[e];var t=getOwnPropertyDescriptor5(global$4,e);return t&&t.value},nativeFetch=safeGetBuiltIn("fetch"),NativeRequest=safeGetBuiltIn("Request"),Headers=safeGetBuiltIn("Headers"),RequestPrototype=NativeRequest&&NativeRequest.prototype,HeadersPrototype=Headers&&Headers.prototype,RegExp$1=global$4.RegExp,TypeError$2=global$4.TypeError,decodeURIComponent=global$4.decodeURIComponent,encodeURIComponent$1=global$4.encodeURIComponent,charAt$1=uncurryThis$6("".charAt),join$1=uncurryThis$6([].join),push$4=uncurryThis$6([].push),replace$1=uncurryThis$6("".replace),shift$1=uncurryThis$6([].shift),splice2=uncurryThis$6([].splice),split$1=uncurryThis$6("".split),stringSlice$2=uncurryThis$6("".slice),plus=/\+/g,sequences=Array(4),percentSequence=function(e){return sequences[e-1]||(sequences[e-1]=RegExp$1("((?:%[\\da-f]{2}){"+e+"})","gi"))},percentDecode=function(e){try{return decodeURIComponent(e)}catch(t){return e}},deserialize=function(e){var t=replace$1(e,plus," "),r=4;try{return decodeURIComponent(t)}catch(e){for(;r;)t=replace$1(t,percentSequence(r--),percentDecode);return t}},find2=/[!'()~]|%20/g,replacements={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},replacer=function(e){return replacements[e]},serialize=function(e){return replace$1(encodeURIComponent$1(e),find2,replacer)},URLSearchParamsIterator=createIteratorConstructor((function(e,t){setInternalState$3(this,{type:URL_SEARCH_PARAMS_ITERATOR,iterator:getIterator(getInternalParamsState(e).entries),kind:t})}),"Iterator",(function(){var e=getInternalIteratorState(this),t=e.kind,r=e.iterator.next(),n=r.value;return r.done||(r.value="keys"===t?n.key:"values"===t?n.value:[n.key,n.value]),r}),!0),URLSearchParamsState=function(e){this.entries=[],this.url=null,void 0!==e&&(isObject$5(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===charAt$1(e,0)?stringSlice$2(e,1):e:$toString$1(e)))};URLSearchParamsState.prototype={type:URL_SEARCH_PARAMS,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,r,n,o,i,a,s,l=getIteratorMethod(e);if(l)for(r=(t=getIterator(e,l)).next;!(n=call$5(r,t)).done;){if(i=(o=getIterator(anObject$1(n.value))).next,(a=call$5(i,o)).done||(s=call$5(i,o)).done||!call$5(i,o).done)throw TypeError$2("Expected sequence with length 2");push$4(this.entries,{key:$toString$1(a.value),value:$toString$1(s.value)})}else for(var c in e)hasOwn$2(e,c)&&push$4(this.entries,{key:c,value:$toString$1(e[c])})},parseQuery:function(e){if(e)for(var t,r,n=split$1(e,"&"),o=0;o<n.length;)(t=n[o++]).length&&(r=split$1(t,"="),push$4(this.entries,{key:deserialize(shift$1(r)),value:deserialize(join$1(r,"="))}))},serialize:function(){for(var e,t=this.entries,r=[],n=0;n<t.length;)e=t[n++],push$4(r,serialize(e.key)+"="+serialize(e.value));return join$1(r,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var URLSearchParamsConstructor=function(){anInstance$3(this,URLSearchParamsPrototype);var e=setInternalState$3(this,new URLSearchParamsState(arguments.length>0?arguments[0]:void 0));DESCRIPTORS$4||(this.length=e.entries.length)},URLSearchParamsPrototype=URLSearchParamsConstructor.prototype;if(defineBuiltIns$1(URLSearchParamsPrototype,{append:function(e,t){validateArgumentsLength$2(arguments.length,2);var r=getInternalParamsState(this);push$4(r.entries,{key:$toString$1(e),value:$toString$1(t)}),DESCRIPTORS$4||this.length++,r.updateURL()},delete:function(e){validateArgumentsLength$2(arguments.length,1);for(var t=getInternalParamsState(this),r=t.entries,n=$toString$1(e),o=0;o<r.length;)r[o].key===n?splice2(r,o,1):o++;DESCRIPTORS$4||(this.length=r.length),t.updateURL()},get:function(e){validateArgumentsLength$2(arguments.length,1);for(var t=getInternalParamsState(this).entries,r=$toString$1(e),n=0;n<t.length;n++)if(t[n].key===r)return t[n].value;return null},getAll:function(e){validateArgumentsLength$2(arguments.length,1);for(var t=getInternalParamsState(this).entries,r=$toString$1(e),n=[],o=0;o<t.length;o++)t[o].key===r&&push$4(n,t[o].value);return n},has:function(e){validateArgumentsLength$2(arguments.length,1);for(var t=getInternalParamsState(this).entries,r=$toString$1(e),n=0;n<t.length;)if(t[n++].key===r)return!0;return!1},set:function(e,t){validateArgumentsLength$2(arguments.length,1);for(var r,n=getInternalParamsState(this),o=n.entries,i=!1,a=$toString$1(e),s=$toString$1(t),l=0;l<o.length;l++)(r=o[l]).key===a&&(i?splice2(o,l--,1):(i=!0,r.value=s));i||push$4(o,{key:a,value:s}),DESCRIPTORS$4||(this.length=o.length),n.updateURL()},sort:function(){var e=getInternalParamsState(this);arraySort(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,r=getInternalParamsState(this).entries,n=bind$a(e,arguments.length>1?arguments[1]:void 0),o=0;o<r.length;)n((t=r[o++]).value,t.key,this)},keys:function(){return new URLSearchParamsIterator(this,"keys")},values:function(){return new URLSearchParamsIterator(this,"values")},entries:function(){return new URLSearchParamsIterator(this,"entries")}},{enumerable:!0}),defineBuiltIn$1(URLSearchParamsPrototype,ITERATOR,URLSearchParamsPrototype.entries,{name:"entries"}),defineBuiltIn$1(URLSearchParamsPrototype,"toString",(function(){return getInternalParamsState(this).serialize()}),{enumerable:!0}),DESCRIPTORS$4&&defineBuiltInAccessor$2(URLSearchParamsPrototype,"size",{get:function(){return getInternalParamsState(this).entries.length},configurable:!0,enumerable:!0}),setToStringTag$2(URLSearchParamsConstructor,URL_SEARCH_PARAMS),$$A({global:!0,constructor:!0,forced:!USE_NATIVE_URL$2},{URLSearchParams:URLSearchParamsConstructor}),!USE_NATIVE_URL$2&&isCallable$4(Headers)){var headersHas=uncurryThis$6(HeadersPrototype.has),headersSet=uncurryThis$6(HeadersPrototype.set),wrapRequestOptions=function(e){if(isObject$5(e)){var t,r=e.body;if(classof$2(r)===URL_SEARCH_PARAMS)return t=e.headers?new Headers(e.headers):new Headers,headersHas(t,"content-type")||headersSet(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),create$1(e,{body:createPropertyDescriptor(0,$toString$1(r)),headers:createPropertyDescriptor(0,t)})}return e};if(isCallable$4(nativeFetch)&&$$A({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return nativeFetch(e,arguments.length>1?wrapRequestOptions(arguments[1]):{})}}),isCallable$4(NativeRequest)){var RequestConstructor=function(e){return anInstance$3(this,RequestPrototype),new NativeRequest(e,arguments.length>1?wrapRequestOptions(arguments[1]):{})};RequestPrototype.constructor=RequestConstructor,RequestConstructor.prototype=RequestPrototype,$$A({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:RequestConstructor})}}var EOF,web_urlSearchParams_constructor={URLSearchParams:URLSearchParamsConstructor,getState:getInternalParamsState},$$z=_export,DESCRIPTORS$3=descriptors$2,USE_NATIVE_URL$1=urlConstructorDetection,global$3=global$s,bind$9=functionBindContext,uncurryThis$5=functionUncurryThis,defineBuiltIn=defineBuiltIn$8,defineBuiltInAccessor$1=defineBuiltInAccessor$5,anInstance$2=anInstance$5,hasOwn$1=hasOwnProperty_1,assign2=objectAssign,arrayFrom=arrayFrom$1,arraySlice$1=arraySliceSimple,codeAt=stringMultibyte.codeAt,toASCII=stringPunycodeToAscii,$toString=toString$f,setToStringTag$1=setToStringTag$9,validateArgumentsLength$1=validateArgumentsLength$5,URLSearchParamsModule=web_urlSearchParams_constructor,InternalStateModule$2=internalState,setInternalState$2=InternalStateModule$2.set,getInternalURLState=InternalStateModule$2.getterFor("URL"),URLSearchParams$1=URLSearchParamsModule.URLSearchParams,getInternalSearchParamsState=URLSearchParamsModule.getState,NativeURL=global$3.URL,TypeError$1=global$3.TypeError,parseInt$1=global$3.parseInt,floor$1=Math.floor,pow=Math.pow,charAt=uncurryThis$5("".charAt),exec=uncurryThis$5(/./.exec),join=uncurryThis$5([].join),numberToString=uncurryThis$5(1..toString),pop=uncurryThis$5([].pop),push$3=uncurryThis$5([].push),replace=uncurryThis$5("".replace),shift=uncurryThis$5([].shift),split=uncurryThis$5("".split),stringSlice$1=uncurryThis$5("".slice),toLowerCase=uncurryThis$5("".toLowerCase),unshift=uncurryThis$5([].unshift),INVALID_AUTHORITY="Invalid authority",INVALID_SCHEME="Invalid scheme",INVALID_HOST="Invalid host",INVALID_PORT="Invalid port",ALPHA=/[a-z]/i,ALPHANUMERIC=/[\d+-.a-z]/i,DIGIT=/\d/,HEX_START=/^0x/i,OCT=/^[0-7]+$/,DEC=/^\d+$/,HEX=/^[\da-f]+$/i,FORBIDDEN_HOST_CODE_POINT=/[\0\t\n\r #%/:<>?@[\\\]^|]/,FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT=/[\0\t\n\r #/:<>?@[\\\]^|]/,LEADING_C0_CONTROL_OR_SPACE=/^[\u0000-\u0020]+/,TRAILING_C0_CONTROL_OR_SPACE=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,TAB_AND_NEW_LINE=/[\t\n\r]/g,parseIPv4=function(e){var t,r,n,o,i,a,s,l=split(e,".");if(l.length&&""==l[l.length-1]&&l.length--,(t=l.length)>4)return e;for(r=[],n=0;n<t;n++){if(""==(o=l[n]))return e;if(i=10,o.length>1&&"0"==charAt(o,0)&&(i=exec(HEX_START,o)?16:8,o=stringSlice$1(o,8==i?1:2)),""===o)a=0;else{if(!exec(10==i?DEC:8==i?OCT:HEX,o))return e;a=parseInt$1(o,i)}push$3(r,a)}for(n=0;n<t;n++)if(a=r[n],n==t-1){if(a>=pow(256,5-t))return null}else if(a>255)return null;for(s=pop(r),n=0;n<r.length;n++)s+=r[n]*pow(256,3-n);return s},parseIPv6=function(e){var t,r,n,o,i,a,s,l=[0,0,0,0,0,0,0,0],c=0,u=null,p=0,f=function(){return charAt(e,p)};if(":"==f()){if(":"!=charAt(e,1))return;p+=2,u=++c}for(;f();){if(8==c)return;if(":"!=f()){for(t=r=0;r<4&&exec(HEX,f());)t=16*t+parseInt$1(f(),16),p++,r++;if("."==f()){if(0==r)return;if(p-=r,c>6)return;for(n=0;f();){if(o=null,n>0){if(!("."==f()&&n<4))return;p++}if(!exec(DIGIT,f()))return;for(;exec(DIGIT,f());){if(i=parseInt$1(f(),10),null===o)o=i;else{if(0==o)return;o=10*o+i}if(o>255)return;p++}l[c]=256*l[c]+o,2!=++n&&4!=n||c++}if(4!=n)return;break}if(":"==f()){if(p++,!f())return}else if(f())return;l[c++]=t}else{if(null!==u)return;p++,u=++c}}if(null!==u)for(a=c-u,c=7;0!=c&&a>0;)s=l[c],l[c--]=l[u+a-1],l[u+--a]=s;else if(8!=c)return;return l},findLongestZeroSequence=function(e){for(var t=null,r=1,n=null,o=0,i=0;i<8;i++)0!==e[i]?(o>r&&(t=n,r=o),n=null,o=0):(null===n&&(n=i),++o);return o>r&&(t=n,r=o),t},serializeHost=function(e){var t,r,n,o;if("number"==typeof e){for(t=[],r=0;r<4;r++)unshift(t,e%256),e=floor$1(e/256);return join(t,".")}if("object"==typeof e){for(t="",n=findLongestZeroSequence(e),r=0;r<8;r++)o&&0===e[r]||(o&&(o=!1),n===r?(t+=r?":":"::",o=!0):(t+=numberToString(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},C0ControlPercentEncodeSet={},fragmentPercentEncodeSet=assign2({},C0ControlPercentEncodeSet,{" ":1,'"':1,"<":1,">":1,"`":1}),pathPercentEncodeSet=assign2({},fragmentPercentEncodeSet,{"#":1,"?":1,"{":1,"}":1}),userinfoPercentEncodeSet=assign2({},pathPercentEncodeSet,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),percentEncode=function(e,t){var r=codeAt(e,0);return r>32&&r<127&&!hasOwn$1(t,e)?e:encodeURIComponent(e)},specialSchemes={ftp:21,file:null,http:80,https:443,ws:80,wss:443},isWindowsDriveLetter=function(e,t){var r;return 2==e.length&&exec(ALPHA,charAt(e,0))&&(":"==(r=charAt(e,1))||!t&&"|"==r)},startsWithWindowsDriveLetter=function(e){var t;return e.length>1&&isWindowsDriveLetter(stringSlice$1(e,0,2))&&(2==e.length||"/"===(t=charAt(e,2))||"\\"===t||"?"===t||"#"===t)},isSingleDot=function(e){return"."===e||"%2e"===toLowerCase(e)},isDoubleDot=function(e){return".."===(e=toLowerCase(e))||"%2e."===e||".%2e"===e||"%2e%2e"===e},SCHEME_START={},SCHEME={},NO_SCHEME={},SPECIAL_RELATIVE_OR_AUTHORITY={},PATH_OR_AUTHORITY={},RELATIVE={},RELATIVE_SLASH={},SPECIAL_AUTHORITY_SLASHES={},SPECIAL_AUTHORITY_IGNORE_SLASHES={},AUTHORITY={},HOST={},HOSTNAME={},PORT={},FILE={},FILE_SLASH={},FILE_HOST={},PATH_START={},PATH={},CANNOT_BE_A_BASE_URL_PATH={},QUERY={},FRAGMENT={},URLState=function(e,t,r){var n,o,i,a=$toString(e);if(t){if(o=this.parse(a))throw TypeError$1(o);this.searchParams=null}else{if(void 0!==r&&(n=new URLState(r,!0)),o=this.parse(a,null,n))throw TypeError$1(o);(i=getInternalSearchParamsState(new URLSearchParams$1)).bindURL(this),this.searchParams=i}};URLState.prototype={type:"URL",parse:function(e,t,r){var n,o,i,a,s=this,l=t||SCHEME_START,c=0,u="",p=!1,f=!1,d=!1;for(e=$toString(e),t||(s.scheme="",s.username="",s.password="",s.host=null,s.port=null,s.path=[],s.query=null,s.fragment=null,s.cannotBeABaseURL=!1,e=replace(e,LEADING_C0_CONTROL_OR_SPACE,""),e=replace(e,TRAILING_C0_CONTROL_OR_SPACE,"$1")),e=replace(e,TAB_AND_NEW_LINE,""),n=arrayFrom(e);c<=n.length;){switch(o=n[c],l){case SCHEME_START:if(!o||!exec(ALPHA,o)){if(t)return INVALID_SCHEME;l=NO_SCHEME;continue}u+=toLowerCase(o),l=SCHEME;break;case SCHEME:if(o&&(exec(ALPHANUMERIC,o)||"+"==o||"-"==o||"."==o))u+=toLowerCase(o);else{if(":"!=o){if(t)return INVALID_SCHEME;u="",l=NO_SCHEME,c=0;continue}if(t&&(s.isSpecial()!=hasOwn$1(specialSchemes,u)||"file"==u&&(s.includesCredentials()||null!==s.port)||"file"==s.scheme&&!s.host))return;if(s.scheme=u,t)return void(s.isSpecial()&&specialSchemes[s.scheme]==s.port&&(s.port=null));u="","file"==s.scheme?l=FILE:s.isSpecial()&&r&&r.scheme==s.scheme?l=SPECIAL_RELATIVE_OR_AUTHORITY:s.isSpecial()?l=SPECIAL_AUTHORITY_SLASHES:"/"==n[c+1]?(l=PATH_OR_AUTHORITY,c++):(s.cannotBeABaseURL=!0,push$3(s.path,""),l=CANNOT_BE_A_BASE_URL_PATH)}break;case NO_SCHEME:if(!r||r.cannotBeABaseURL&&"#"!=o)return INVALID_SCHEME;if(r.cannotBeABaseURL&&"#"==o){s.scheme=r.scheme,s.path=arraySlice$1(r.path),s.query=r.query,s.fragment="",s.cannotBeABaseURL=!0,l=FRAGMENT;break}l="file"==r.scheme?FILE:RELATIVE;continue;case SPECIAL_RELATIVE_OR_AUTHORITY:if("/"!=o||"/"!=n[c+1]){l=RELATIVE;continue}l=SPECIAL_AUTHORITY_IGNORE_SLASHES,c++;break;case PATH_OR_AUTHORITY:if("/"==o){l=AUTHORITY;break}l=PATH;continue;case RELATIVE:if(s.scheme=r.scheme,o==EOF)s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,s.path=arraySlice$1(r.path),s.query=r.query;else if("/"==o||"\\"==o&&s.isSpecial())l=RELATIVE_SLASH;else if("?"==o)s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,s.path=arraySlice$1(r.path),s.query="",l=QUERY;else{if("#"!=o){s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,s.path=arraySlice$1(r.path),s.path.length--,l=PATH;continue}s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,s.path=arraySlice$1(r.path),s.query=r.query,s.fragment="",l=FRAGMENT}break;case RELATIVE_SLASH:if(!s.isSpecial()||"/"!=o&&"\\"!=o){if("/"!=o){s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,l=PATH;continue}l=AUTHORITY}else l=SPECIAL_AUTHORITY_IGNORE_SLASHES;break;case SPECIAL_AUTHORITY_SLASHES:if(l=SPECIAL_AUTHORITY_IGNORE_SLASHES,"/"!=o||"/"!=charAt(u,c+1))continue;c++;break;case SPECIAL_AUTHORITY_IGNORE_SLASHES:if("/"!=o&&"\\"!=o){l=AUTHORITY;continue}break;case AUTHORITY:if("@"==o){p&&(u="%40"+u),p=!0,i=arrayFrom(u);for(var h=0;h<i.length;h++){var $=i[h];if(":"!=$||d){var y=percentEncode($,userinfoPercentEncodeSet);d?s.password+=y:s.username+=y}else d=!0}u=""}else if(o==EOF||"/"==o||"?"==o||"#"==o||"\\"==o&&s.isSpecial()){if(p&&""==u)return INVALID_AUTHORITY;c-=arrayFrom(u).length+1,u="",l=HOST}else u+=o;break;case HOST:case HOSTNAME:if(t&&"file"==s.scheme){l=FILE_HOST;continue}if(":"!=o||f){if(o==EOF||"/"==o||"?"==o||"#"==o||"\\"==o&&s.isSpecial()){if(s.isSpecial()&&""==u)return INVALID_HOST;if(t&&""==u&&(s.includesCredentials()||null!==s.port))return;if(a=s.parseHost(u))return a;if(u="",l=PATH_START,t)return;continue}"["==o?f=!0:"]"==o&&(f=!1),u+=o}else{if(""==u)return INVALID_HOST;if(a=s.parseHost(u))return a;if(u="",l=PORT,t==HOSTNAME)return}break;case PORT:if(!exec(DIGIT,o)){if(o==EOF||"/"==o||"?"==o||"#"==o||"\\"==o&&s.isSpecial()||t){if(""!=u){var g=parseInt$1(u,10);if(g>65535)return INVALID_PORT;s.port=s.isSpecial()&&g===specialSchemes[s.scheme]?null:g,u=""}if(t)return;l=PATH_START;continue}return INVALID_PORT}u+=o;break;case FILE:if(s.scheme="file","/"==o||"\\"==o)l=FILE_SLASH;else{if(!r||"file"!=r.scheme){l=PATH;continue}if(o==EOF)s.host=r.host,s.path=arraySlice$1(r.path),s.query=r.query;else if("?"==o)s.host=r.host,s.path=arraySlice$1(r.path),s.query="",l=QUERY;else{if("#"!=o){startsWithWindowsDriveLetter(join(arraySlice$1(n,c),""))||(s.host=r.host,s.path=arraySlice$1(r.path),s.shortenPath()),l=PATH;continue}s.host=r.host,s.path=arraySlice$1(r.path),s.query=r.query,s.fragment="",l=FRAGMENT}}break;case FILE_SLASH:if("/"==o||"\\"==o){l=FILE_HOST;break}r&&"file"==r.scheme&&!startsWithWindowsDriveLetter(join(arraySlice$1(n,c),""))&&(isWindowsDriveLetter(r.path[0],!0)?push$3(s.path,r.path[0]):s.host=r.host),l=PATH;continue;case FILE_HOST:if(o==EOF||"/"==o||"\\"==o||"?"==o||"#"==o){if(!t&&isWindowsDriveLetter(u))l=PATH;else if(""==u){if(s.host="",t)return;l=PATH_START}else{if(a=s.parseHost(u))return a;if("localhost"==s.host&&(s.host=""),t)return;u="",l=PATH_START}continue}u+=o;break;case PATH_START:if(s.isSpecial()){if(l=PATH,"/"!=o&&"\\"!=o)continue}else if(t||"?"!=o)if(t||"#"!=o){if(o!=EOF&&(l=PATH,"/"!=o))continue}else s.fragment="",l=FRAGMENT;else s.query="",l=QUERY;break;case PATH:if(o==EOF||"/"==o||"\\"==o&&s.isSpecial()||!t&&("?"==o||"#"==o)){if(isDoubleDot(u)?(s.shortenPath(),"/"==o||"\\"==o&&s.isSpecial()||push$3(s.path,"")):isSingleDot(u)?"/"==o||"\\"==o&&s.isSpecial()||push$3(s.path,""):("file"==s.scheme&&!s.path.length&&isWindowsDriveLetter(u)&&(s.host&&(s.host=""),u=charAt(u,0)+":"),push$3(s.path,u)),u="","file"==s.scheme&&(o==EOF||"?"==o||"#"==o))for(;s.path.length>1&&""===s.path[0];)shift(s.path);"?"==o?(s.query="",l=QUERY):"#"==o&&(s.fragment="",l=FRAGMENT)}else u+=percentEncode(o,pathPercentEncodeSet);break;case CANNOT_BE_A_BASE_URL_PATH:"?"==o?(s.query="",l=QUERY):"#"==o?(s.fragment="",l=FRAGMENT):o!=EOF&&(s.path[0]+=percentEncode(o,C0ControlPercentEncodeSet));break;case QUERY:t||"#"!=o?o!=EOF&&("'"==o&&s.isSpecial()?s.query+="%27":s.query+="#"==o?"%23":percentEncode(o,C0ControlPercentEncodeSet)):(s.fragment="",l=FRAGMENT);break;case FRAGMENT:o!=EOF&&(s.fragment+=percentEncode(o,fragmentPercentEncodeSet))}c++}},parseHost:function(e){var t,r,n;if("["==charAt(e,0)){if("]"!=charAt(e,e.length-1))return INVALID_HOST;if(!(t=parseIPv6(stringSlice$1(e,1,-1))))return INVALID_HOST;this.host=t}else if(this.isSpecial()){if(e=toASCII(e),exec(FORBIDDEN_HOST_CODE_POINT,e))return INVALID_HOST;if(null===(t=parseIPv4(e)))return INVALID_HOST;this.host=t}else{if(exec(FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT,e))return INVALID_HOST;for(t="",r=arrayFrom(e),n=0;n<r.length;n++)t+=percentEncode(r[n],C0ControlPercentEncodeSet);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return hasOwn$1(specialSchemes,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"==this.scheme&&1==t&&isWindowsDriveLetter(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,r=e.username,n=e.password,o=e.host,i=e.port,a=e.path,s=e.query,l=e.fragment,c=t+":";return null!==o?(c+="//",e.includesCredentials()&&(c+=r+(n?":"+n:"")+"@"),c+=serializeHost(o),null!==i&&(c+=":"+i)):"file"==t&&(c+="//"),c+=e.cannotBeABaseURL?a[0]:a.length?"/"+join(a,"/"):"",null!==s&&(c+="?"+s),null!==l&&(c+="#"+l),c},setHref:function(e){var t=this.parse(e);if(t)throw TypeError$1(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"==e)try{return new URLConstructor(e.path[0]).origin}catch(e){return"null"}return"file"!=e&&this.isSpecial()?e+"://"+serializeHost(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse($toString(e)+":",SCHEME_START)},getUsername:function(){return this.username},setUsername:function(e){var t=arrayFrom($toString(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=percentEncode(t[r],userinfoPercentEncodeSet)}},getPassword:function(){return this.password},setPassword:function(e){var t=arrayFrom($toString(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=percentEncode(t[r],userinfoPercentEncodeSet)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?serializeHost(e):serializeHost(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,HOST)},getHostname:function(){var e=this.host;return null===e?"":serializeHost(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,HOSTNAME)},getPort:function(){var e=this.port;return null===e?"":$toString(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""==(e=$toString(e))?this.port=null:this.parse(e,PORT))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+join(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,PATH_START))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""==(e=$toString(e))?this.query=null:("?"==charAt(e,0)&&(e=stringSlice$1(e,1)),this.query="",this.parse(e,QUERY)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!=(e=$toString(e))?("#"==charAt(e,0)&&(e=stringSlice$1(e,1)),this.fragment="",this.parse(e,FRAGMENT)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var URLConstructor=function(e){var t=anInstance$2(this,URLPrototype),r=validateArgumentsLength$1(arguments.length,1)>1?arguments[1]:void 0,n=setInternalState$2(t,new URLState(e,!1,r));DESCRIPTORS$3||(t.href=n.serialize(),t.origin=n.getOrigin(),t.protocol=n.getProtocol(),t.username=n.getUsername(),t.password=n.getPassword(),t.host=n.getHost(),t.hostname=n.getHostname(),t.port=n.getPort(),t.pathname=n.getPathname(),t.search=n.getSearch(),t.searchParams=n.getSearchParams(),t.hash=n.getHash())},URLPrototype=URLConstructor.prototype,accessorDescriptor=function(e,t){return{get:function(){return getInternalURLState(this)[e]()},set:t&&function(e){return getInternalURLState(this)[t](e)},configurable:!0,enumerable:!0}};if(DESCRIPTORS$3&&(defineBuiltInAccessor$1(URLPrototype,"href",accessorDescriptor("serialize","setHref")),defineBuiltInAccessor$1(URLPrototype,"origin",accessorDescriptor("getOrigin")),defineBuiltInAccessor$1(URLPrototype,"protocol",accessorDescriptor("getProtocol","setProtocol")),defineBuiltInAccessor$1(URLPrototype,"username",accessorDescriptor("getUsername","setUsername")),defineBuiltInAccessor$1(URLPrototype,"password",accessorDescriptor("getPassword","setPassword")),defineBuiltInAccessor$1(URLPrototype,"host",accessorDescriptor("getHost","setHost")),defineBuiltInAccessor$1(URLPrototype,"hostname",accessorDescriptor("getHostname","setHostname")),defineBuiltInAccessor$1(URLPrototype,"port",accessorDescriptor("getPort","setPort")),defineBuiltInAccessor$1(URLPrototype,"pathname",accessorDescriptor("getPathname","setPathname")),defineBuiltInAccessor$1(URLPrototype,"search",accessorDescriptor("getSearch","setSearch")),defineBuiltInAccessor$1(URLPrototype,"searchParams",accessorDescriptor("getSearchParams")),defineBuiltInAccessor$1(URLPrototype,"hash",accessorDescriptor("getHash","setHash"))),defineBuiltIn(URLPrototype,"toJSON",(function(){return getInternalURLState(this).serialize()}),{enumerable:!0}),defineBuiltIn(URLPrototype,"toString",(function(){return getInternalURLState(this).serialize()}),{enumerable:!0}),NativeURL){var nativeCreateObjectURL=NativeURL.createObjectURL,nativeRevokeObjectURL=NativeURL.revokeObjectURL;nativeCreateObjectURL&&defineBuiltIn(URLConstructor,"createObjectURL",bind$9(nativeCreateObjectURL,NativeURL)),nativeRevokeObjectURL&&defineBuiltIn(URLConstructor,"revokeObjectURL",bind$9(nativeRevokeObjectURL,NativeURL))}setToStringTag$1(URLConstructor,"URL"),$$z({global:!0,constructor:!0,forced:!USE_NATIVE_URL$1,sham:!DESCRIPTORS$3},{URL:URLConstructor});var $$y=_export,getBuiltIn$1=getBuiltIn$h,fails$6=fails$B,validateArgumentsLength=validateArgumentsLength$5,toString$2=toString$f,USE_NATIVE_URL=urlConstructorDetection,URL$1=getBuiltIn$1("URL"),THROWS_WITHOUT_ARGUMENTS=USE_NATIVE_URL&&fails$6((function(){URL$1.canParse()}));$$y({target:"URL",stat:!0,forced:!THROWS_WITHOUT_ARGUMENTS},{canParse:function(e){var t=validateArgumentsLength(arguments.length,1),r=toString$2(e),n=t<2||void 0===arguments[1]?void 0:toString$2(arguments[1]);try{return!!new URL$1(r,n)}catch(e){return!1}}});var path$7=path$z,url$5=path$7.URL,parent$F=url$5,url$4=parent$F,parent$E=url$4,url$3=parent$E,parent$D=url$3,url$2=parent$D,url$1=url$2,url=url$1,_URL=getDefaultExportFromCjs(url),isObject$4=isObject$l,classof$1=classofRaw$2,wellKnownSymbol$1=wellKnownSymbol$q,MATCH$1=wellKnownSymbol$1("match"),isRegexp=function(e){var t;return isObject$4(e)&&(void 0!==(t=e[MATCH$1])?!!t:"RegExp"==classof$1(e))},isRegExp=isRegexp,$TypeError$4=TypeError,notARegexp=function(e){if(isRegExp(e))throw $TypeError$4("The method doesn't accept regular expressions");return e},wellKnownSymbol=wellKnownSymbol$q,MATCH=wellKnownSymbol("match"),correctIsRegexpLogic=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[MATCH]=!1,"/./"[e](t)}catch(e){}}return!1},$$x=_export,uncurryThis$4=functionUncurryThisClause;objectGetOwnPropertyDescriptor.f;var toLength=toLength$3,toString$1=toString$f,notARegExp$1=notARegexp,requireObjectCoercible$1=requireObjectCoercible$8,correctIsRegExpLogic$1=correctIsRegexpLogic,nativeStartsWith=uncurryThis$4("".startsWith),stringSlice=uncurryThis$4("".slice),min$2=Math.min,CORRECT_IS_REGEXP_LOGIC=correctIsRegExpLogic$1("startsWith");$$x({target:"String",proto:!0,forced:!CORRECT_IS_REGEXP_LOGIC},{startsWith:function(e){var t=toString$1(requireObjectCoercible$1(this));notARegExp$1(e);var r=toLength(min$2(arguments.length>1?arguments[1]:void 0,t.length)),n=toString$1(e);return nativeStartsWith?nativeStartsWith(t,n,r):stringSlice(t,r,r+n.length)===n}});var entryVirtual$6=entryVirtual$o,startsWith$6=entryVirtual$6("String").startsWith,isPrototypeOf$5=objectIsPrototypeOf,method$4=startsWith$6,StringPrototype$1=String.prototype,startsWith$5=function(e){var t=e.startsWith;return"string"==typeof e||e===StringPrototype$1||isPrototypeOf$5(StringPrototype$1,e)&&t===StringPrototype$1.startsWith?method$4:t},parent$C=startsWith$5,startsWith$4=parent$C,parent$B=startsWith$4,startsWith$3=parent$B,parent$A=startsWith$3,startsWith$2=parent$A,startsWith$1=startsWith$2,startsWith2=startsWith$1,_startsWithInstanceProperty=getDefaultExportFromCjs(startsWith2),isObject$3=isObject$l,floor=Math.floor,isIntegralNumber$1=Number.isInteger||function(e){return!isObject$3(e)&&isFinite(e)&&floor(e)===e},$$w=_export,isIntegralNumber=isIntegralNumber$1;$$w({target:"Number",stat:!0},{isInteger:isIntegralNumber});var path$6=path$z,isInteger$5=path$6.Number.isInteger,parent$z=isInteger$5,isInteger$4=parent$z,parent$y=isInteger$4,isInteger$3=parent$y,parent$x=isInteger$3,isInteger$2=parent$x,isInteger$1=isInteger$2,isInteger2=isInteger$1,_Number$isInteger=getDefaultExportFromCjs(isInteger2),$$v=_export,$includes=arrayIncludes.includes,fails$5=fails$B,BROKEN_ON_SPARSE=fails$5((function(){return!Array(1).includes()}));$$v({target:"Array",proto:!0,forced:BROKEN_ON_SPARSE},{includes:function(e){return $includes(this,e,arguments.length>1?arguments[1]:void 0)}});var entryVirtual$5=entryVirtual$o,includes$7=entryVirtual$5("Array").includes,$$u=_export,uncurryThis$3=functionUncurryThis,notARegExp=notARegexp,requireObjectCoercible=requireObjectCoercible$8,toString4=toString$f,correctIsRegExpLogic=correctIsRegexpLogic,stringIndexOf=uncurryThis$3("".indexOf);$$u({target:"String",proto:!0,forced:!correctIsRegExpLogic("includes")},{includes:function(e){return!!~stringIndexOf(toString4(requireObjectCoercible(this)),toString4(notARegExp(e)),arguments.length>1?arguments[1]:void 0)}});var entryVirtual$4=entryVirtual$o,includes$6=entryVirtual$4("String").includes,isPrototypeOf$4=objectIsPrototypeOf,arrayMethod=includes$7,stringMethod=includes$6,ArrayPrototype$4=Array.prototype,StringPrototype=String.prototype,includes$5=function(e){var t=e.includes;return e===ArrayPrototype$4||isPrototypeOf$4(ArrayPrototype$4,e)&&t===ArrayPrototype$4.includes?arrayMethod:"string"==typeof e||e===StringPrototype||isPrototypeOf$4(StringPrototype,e)&&t===StringPrototype.includes?stringMethod:t},parent$w=includes$5,includes$4=parent$w,parent$v=includes$4,includes$3=parent$v,parent$u=includes$3,includes$2=parent$u,includes$1=includes$2,includes3=includes$1,_includesInstanceProperty=getDefaultExportFromCjs(includes3),toObject$2=toObject$f,toAbsoluteIndex$1=toAbsoluteIndex$6,lengthOfArrayLike$3=lengthOfArrayLike$e,arrayFill=function(e){for(var t=toObject$2(this),r=lengthOfArrayLike$3(t),n=arguments.length,o=toAbsoluteIndex$1(n>1?arguments[1]:void 0,r),i=n>2?arguments[2]:void 0,a=void 0===i?r:toAbsoluteIndex$1(i,r);a>o;)t[o++]=e;return t},$$t=_export,fill$7=arrayFill;$$t({target:"Array",proto:!0},{fill:fill$7});var entryVirtual$3=entryVirtual$o,fill$6=entryVirtual$3("Array").fill,isPrototypeOf$3=objectIsPrototypeOf,method$3=fill$6,ArrayPrototype$3=Array.prototype,fill$5=function(e){var t=e.fill;return e===ArrayPrototype$3||isPrototypeOf$3(ArrayPrototype$3,e)&&t===ArrayPrototype$3.fill?method$3:t},parent$t=fill$5,fill$4=parent$t,parent$s=fill$4,fill$3=parent$s,parent$r=fill$3,fill$2=parent$r,fill$1=fill$2,fill2=fill$1,_fillInstanceProperty=getDefaultExportFromCjs(fill2),internalMetadata={exports:{}},fails$4=fails$B,arrayBufferNonExtensible=fails$4((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}})),fails$3=fails$B,isObject$2=isObject$l,classof=classofRaw$2,ARRAY_BUFFER_NON_EXTENSIBLE=arrayBufferNonExtensible,$isExtensible=Object.isExtensible,FAILS_ON_PRIMITIVES$1=fails$3((function(){$isExtensible(1)})),objectIsExtensible=FAILS_ON_PRIMITIVES$1||ARRAY_BUFFER_NON_EXTENSIBLE?function(e){return!!isObject$2(e)&&((!ARRAY_BUFFER_NON_EXTENSIBLE||"ArrayBuffer"!=classof(e))&&(!$isExtensible||$isExtensible(e)))}:$isExtensible,fails$2=fails$B,freezing=!fails$2((function(){return Object.isExtensible(Object.preventExtensions({}))})),$$s=_export,uncurryThis$2=functionUncurryThis,hiddenKeys=hiddenKeys$6,isObject$1=isObject$l,hasOwn2=hasOwnProperty_1,defineProperty$1=objectDefineProperty.f,getOwnPropertyNamesModule=objectGetOwnPropertyNames,getOwnPropertyNamesExternalModule=objectGetOwnPropertyNamesExternal,isExtensible2=objectIsExtensible,uid=uid$4,FREEZING=freezing,REQUIRED=!1,METADATA=uid("meta"),id=0,setMetadata=function(e){defineProperty$1(e,METADATA,{value:{objectID:"O"+id++,weakData:{}}})},fastKey$1=function(e,t){if(!isObject$1(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!hasOwn2(e,METADATA)){if(!isExtensible2(e))return"F";if(!t)return"E";setMetadata(e)}return e[METADATA].objectID},getWeakData=function(e,t){if(!hasOwn2(e,METADATA)){if(!isExtensible2(e))return!0;if(!t)return!1;setMetadata(e)}return e[METADATA].weakData},onFreeze=function(e){return FREEZING&&REQUIRED&&isExtensible2(e)&&!hasOwn2(e,METADATA)&&setMetadata(e),e},enable=function(){meta.enable=function(){},REQUIRED=!0;var e=getOwnPropertyNamesModule.f,t=uncurryThis$2([].splice),r={};r[METADATA]=1,e(r).length&&(getOwnPropertyNamesModule.f=function(r){for(var n=e(r),o=0,i=n.length;o<i;o++)if(n[o]===METADATA){t(n,o,1);break}return n},$$s({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:getOwnPropertyNamesExternalModule.f}))},meta=internalMetadata.exports={enable:enable,fastKey:fastKey$1,getWeakData:getWeakData,onFreeze:onFreeze};hiddenKeys[METADATA]=!0;var internalMetadataExports=internalMetadata.exports,$$r=_export,global$2=global$s,InternalMetadataModule=internalMetadataExports,fails$1=fails$B,createNonEnumerableProperty=createNonEnumerableProperty$9,iterate$f=iterate$l,anInstance$1=anInstance$5,isCallable$3=isCallable$q,isObject=isObject$l,setToStringTag=setToStringTag$9,defineProperty5=objectDefineProperty.f,forEach3=arrayIteration.forEach,DESCRIPTORS$2=descriptors$2,InternalStateModule$1=internalState,setInternalState$1=InternalStateModule$1.set,internalStateGetterFor$1=InternalStateModule$1.getterFor,collection$1=function(e,t,r){var n,o=-1!==e.indexOf("Map"),i=-1!==e.indexOf("Weak"),a=o?"set":"add",s=global$2[e],l=s&&s.prototype,c={};if(DESCRIPTORS$2&&isCallable$3(s)&&(i||l.forEach&&!fails$1((function(){(new s).entries().next()})))){var u=(n=t((function(t,r){setInternalState$1(anInstance$1(t,u),{type:e,collection:new s}),null!=r&&iterate$f(r,t[a],{that:t,AS_ENTRIES:o})}))).prototype,p=internalStateGetterFor$1(e);forEach3(["add","clear","delete","forEach","get","has","set","keys","values","entries"],(function(e){var t="add"==e||"set"==e;!(e in l)||i&&"clear"==e||createNonEnumerableProperty(u,e,(function(r,n){var o=p(this).collection;if(!t&&i&&!isObject(r))return"get"==e&&void 0;var a=o[e](0===r?0:r,n);return t?this:a}))})),i||defineProperty5(u,"size",{configurable:!0,get:function(){return p(this).collection.size}})}else n=r.getConstructor(t,e,o,a),InternalMetadataModule.enable();return setToStringTag(n,e,!1,!0),c[e]=n,$$r({global:!0,forced:!0},c),i||r.setStrong(n,e,o),n},create4=objectCreate,defineBuiltInAccessor=defineBuiltInAccessor$5,defineBuiltIns=defineBuiltIns$2,bind$8=functionBindContext,anInstance=anInstance$5,isNullOrUndefined$1=isNullOrUndefined$6,iterate$e=iterate$l,defineIterator=iteratorDefine,createIterResultObject=createIterResultObject$3,setSpecies=setSpecies$2,DESCRIPTORS$1=descriptors$2,fastKey=internalMetadataExports.fastKey,InternalStateModule=internalState,setInternalState=InternalStateModule.set,internalStateGetterFor=InternalStateModule.getterFor,collectionStrong$1={getConstructor:function(e,t,r,n){var o=e((function(e,o){anInstance(e,i),setInternalState(e,{type:t,index:create4(null),first:void 0,last:void 0,size:0}),DESCRIPTORS$1||(e.size=0),isNullOrUndefined$1(o)||iterate$e(o,e[n],{that:e,AS_ENTRIES:r})})),i=o.prototype,a=internalStateGetterFor(t),s=function(e,t,r){var n,o,i=a(e),s=l(e,t);return s?s.value=r:(i.last=s={index:o=fastKey(t,!0),key:t,value:r,previous:n=i.last,next:void 0,removed:!1},i.first||(i.first=s),n&&(n.next=s),DESCRIPTORS$1?i.size++:e.size++,"F"!==o&&(i.index[o]=s)),e},l=function(e,t){var r,n=a(e),o=fastKey(t);if("F"!==o)return n.index[o];for(r=n.first;r;r=r.next)if(r.key==t)return r};return defineBuiltIns(i,{clear:function(){for(var e=a(this),t=e.index,r=e.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete t[r.index],r=r.next;e.first=e.last=void 0,DESCRIPTORS$1?e.size=0:this.size=0},delete:function(e){var t=this,r=a(t),n=l(t,e);if(n){var o=n.next,i=n.previous;delete r.index[n.index],n.removed=!0,i&&(i.next=o),o&&(o.previous=i),r.first==n&&(r.first=o),r.last==n&&(r.last=i),DESCRIPTORS$1?r.size--:t.size--}return!!n},forEach:function(e){for(var t,r=a(this),n=bind$8(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:r.first;)for(n(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!l(this,e)}}),defineBuiltIns(i,r?{get:function(e){var t=l(this,e);return t&&t.value},set:function(e,t){return s(this,0===e?0:e,t)}}:{add:function(e){return s(this,e=0===e?0:e,e)}}),DESCRIPTORS$1&&defineBuiltInAccessor(i,"size",{configurable:!0,get:function(){return a(this).size}}),o},setStrong:function(e,t,r){var n=t+" Iterator",o=internalStateGetterFor(t),i=internalStateGetterFor(n);defineIterator(e,t,(function(e,t){setInternalState(this,{type:n,target:e,state:o(e),kind:t,last:void 0})}),(function(){for(var e=i(this),t=e.kind,r=e.last;r&&r.removed;)r=r.previous;return e.target&&(e.last=r=r?r.next:e.state.first)?createIterResultObject("keys"==t?r.key:"values"==t?r.value:[r.key,r.value],!1):(e.target=void 0,createIterResultObject(void 0,!0))}),r?"entries":"values",!r,!0),setSpecies(t)}},collection=collection$1,collectionStrong=collectionStrong$1;collection("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),collectionStrong);var path$5=path$z,map$5=path$5.Map,parent$q=map$5,map$4=parent$q,parent$p=map$4,map$3=parent$p,bind$7=functionBindContext,call$4=functionCall,aCallable$6=aCallable$j,aConstructor=aConstructor$3,isNullOrUndefined=isNullOrUndefined$6,iterate$d=iterate$l,push$2=[].push,collectionFrom=function(e){var t,r,n,o,i=arguments.length,a=i>1?arguments[1]:void 0;return aConstructor(this),(t=void 0!==a)&&aCallable$6(a),isNullOrUndefined(e)?new this:(r=[],t?(n=0,o=bind$7(a,i>2?arguments[2]:void 0),iterate$d(e,(function(e){call$4(push$2,r,o(e,n++))}))):iterate$d(e,push$2,{that:r}),new this(r))},$$q=_export,from3=collectionFrom;$$q({target:"Map",stat:!0,forced:!0},{from:from3});var arraySlice=arraySlice$7,collectionOf=function(){return new this(arraySlice(arguments))},$$p=_export,of2=collectionOf;$$p({target:"Map",stat:!0,forced:!0},{of:of2});var tryToString=tryToString$7,aMap$e=function(e){if("object"==typeof e&&"size"in e&&"has"in e&&"get"in e&&"set"in e&&"delete"in e&&"entries"in e)return e;throw TypeError(tryToString(e)+" is not a map")},caller$1=function(e,t){return 1==t?function(t,r){return t[e](r)}:function(t,r,n){return t[e](r,n)}},getBuiltIn=getBuiltIn$h,caller=caller$1,Map$5=getBuiltIn("Map"),mapHelpers={Map:Map$5,set:caller("set",2),get:caller("get",1),has:caller("has",1),remove:caller("delete",1),proto:Map$5.prototype},$$o=_export,aMap$d=aMap$e,remove=mapHelpers.remove;$$o({target:"Map",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var e,t=aMap$d(this),r=!0,n=0,o=arguments.length;n<o;n++)e=remove(t,arguments[n]),r=r&&e;return!!r}});var $$n=_export,aMap$c=aMap$e,MapHelpers$4=mapHelpers,get$1=MapHelpers$4.get,has$1=MapHelpers$4.has,set$5=MapHelpers$4.set;$$n({target:"Map",proto:!0,real:!0,forced:!0},{emplace:function(e,t){var r,n,o=aMap$c(this);return has$1(o,e)?(r=get$1(o,e),"update"in t&&(r=t.update(r,e,o),set$5(o,e,r)),r):(n=t.insert(e,o),set$5(o,e,n),n)}});var call$3=functionCall,iterateSimple$1=function(e,t,r){for(var n,o,i=r||e.next;!(n=call$3(i,e)).done;)if(void 0!==(o=t(n.value)))return o},iterateSimple=iterateSimple$1,mapIterate=function(e,t,r){return r?iterateSimple(e.entries(),(function(e){return t(e[1],e[0])})):e.forEach(t)},$$m=_export,bind$6=functionBindContext,aMap$b=aMap$e,iterate$c=mapIterate;$$m({target:"Map",proto:!0,real:!0,forced:!0},{every:function(e){var t=aMap$b(this),r=bind$6(e,arguments.length>1?arguments[1]:void 0);return!1!==iterate$c(t,(function(e,n){if(!r(e,n,t))return!1}),!0)}});var $$l=_export,bind$5=functionBindContext,aMap$a=aMap$e,MapHelpers$3=mapHelpers,iterate$b=mapIterate,Map$4=MapHelpers$3.Map,set$4=MapHelpers$3.set;$$l({target:"Map",proto:!0,real:!0,forced:!0},{filter:function(e){var t=aMap$a(this),r=bind$5(e,arguments.length>1?arguments[1]:void 0),n=new Map$4;return iterate$b(t,(function(e,o){r(e,o,t)&&set$4(n,o,e)})),n}});var $$k=_export,bind$4=functionBindContext,aMap$9=aMap$e,iterate$a=mapIterate;$$k({target:"Map",proto:!0,real:!0,forced:!0},{find:function(e){var t=aMap$9(this),r=bind$4(e,arguments.length>1?arguments[1]:void 0),n=iterate$a(t,(function(e,n){if(r(e,n,t))return{value:e}}),!0);return n&&n.value}});var $$j=_export,bind$3=functionBindContext,aMap$8=aMap$e,iterate$9=mapIterate;$$j({target:"Map",proto:!0,real:!0,forced:!0},{findKey:function(e){var t=aMap$8(this),r=bind$3(e,arguments.length>1?arguments[1]:void 0),n=iterate$9(t,(function(e,n){if(r(e,n,t))return{key:n}}),!0);return n&&n.key}});var $$i=_export,call$2=functionCall,uncurryThis$1=functionUncurryThis,isCallable$2=isCallable$q,aCallable$5=aCallable$j,iterate$8=iterate$l,Map$3=mapHelpers.Map,push$1=uncurryThis$1([].push);$$i({target:"Map",stat:!0,forced:!0},{groupBy:function(e,t){var r=new(isCallable$2(this)?this:Map$3);aCallable$5(t);var n=aCallable$5(r.has),o=aCallable$5(r.get),i=aCallable$5(r.set);return iterate$8(e,(function(e){var a=t(e);call$2(n,r,a)?push$1(call$2(o,r,a),e):call$2(i,r,a,[e])})),r}});var sameValueZero$1=function(e,t){return e===t||e!=e&&t!=t},$$h=_export,sameValueZero=sameValueZero$1,aMap$7=aMap$e,iterate$7=mapIterate;$$h({target:"Map",proto:!0,real:!0,forced:!0},{includes:function(e){return!0===iterate$7(aMap$7(this),(function(t){if(sameValueZero(t,e))return!0}),!0)}});var $$g=_export,call$1=functionCall,iterate$6=iterate$l,isCallable$1=isCallable$q,aCallable$4=aCallable$j,Map$2=mapHelpers.Map;$$g({target:"Map",stat:!0,forced:!0},{keyBy:function(e,t){var r=new(isCallable$1(this)?this:Map$2);aCallable$4(t);var n=aCallable$4(r.set);return iterate$6(e,(function(e){call$1(n,r,t(e),e)})),r}});var $$f=_export,aMap$6=aMap$e,iterate$5=mapIterate;$$f({target:"Map",proto:!0,real:!0,forced:!0},{keyOf:function(e){var t=iterate$5(aMap$6(this),(function(t,r){if(t===e)return{key:r}}),!0);return t&&t.key}});var $$e=_export,bind$2=functionBindContext,aMap$5=aMap$e,MapHelpers$2=mapHelpers,iterate$4=mapIterate,Map$1=MapHelpers$2.Map,set$3=MapHelpers$2.set;$$e({target:"Map",proto:!0,real:!0,forced:!0},{mapKeys:function(e){var t=aMap$5(this),r=bind$2(e,arguments.length>1?arguments[1]:void 0),n=new Map$1;return iterate$4(t,(function(e,o){set$3(n,r(e,o,t),e)})),n}});var $$d=_export,bind$1=functionBindContext,aMap$4=aMap$e,MapHelpers$1=mapHelpers,iterate$3=mapIterate,Map=MapHelpers$1.Map,set$2=MapHelpers$1.set;$$d({target:"Map",proto:!0,real:!0,forced:!0},{mapValues:function(e){var t=aMap$4(this),r=bind$1(e,arguments.length>1?arguments[1]:void 0),n=new Map;return iterate$3(t,(function(e,o){set$2(n,o,r(e,o,t))})),n}});var $$c=_export,aMap$3=aMap$e,iterate$2=iterate$l,set$1=mapHelpers.set;$$c({target:"Map",proto:!0,real:!0,arity:1,forced:!0},{merge:function(e){for(var t=aMap$3(this),r=arguments.length,n=0;n<r;)iterate$2(arguments[n++],(function(e,r){set$1(t,e,r)}),{AS_ENTRIES:!0});return t}});var $$b=_export,aCallable$3=aCallable$j,aMap$2=aMap$e,iterate$1=mapIterate,$TypeError$3=TypeError;$$b({target:"Map",proto:!0,real:!0,forced:!0},{reduce:function(e){var t=aMap$2(this),r=arguments.length<2,n=r?void 0:arguments[1];if(aCallable$3(e),iterate$1(t,(function(o,i){r?(r=!1,n=o):n=e(n,o,i,t)})),r)throw $TypeError$3("Reduce of empty map with no initial value");return n}});var $$a=_export,bind2=functionBindContext,aMap$1=aMap$e,iterate=mapIterate;$$a({target:"Map",proto:!0,real:!0,forced:!0},{some:function(e){var t=aMap$1(this),r=bind2(e,arguments.length>1?arguments[1]:void 0);return!0===iterate(t,(function(e,n){if(r(e,n,t))return!0}),!0)}});var $$9=_export,aCallable$2=aCallable$j,aMap=aMap$e,MapHelpers=mapHelpers,$TypeError$2=TypeError,get2=MapHelpers.get,has2=MapHelpers.has,set2=MapHelpers.set;$$9({target:"Map",proto:!0,real:!0,forced:!0},{update:function(e,t){var r=aMap(this),n=arguments.length;aCallable$2(t);var o=has2(r,e);if(!o&&n<3)throw $TypeError$2("Updating absent value");var i=o?get2(r,e):aCallable$2(n>2?arguments[2]:void 0)(e,r);return set2(r,e,t(i,e,r)),r}});var call=functionCall,aCallable$1=aCallable$j,isCallable=isCallable$q,anObject=anObject$g,$TypeError$1=TypeError,mapUpsert=function(e,t){var r,n=anObject(this),o=aCallable$1(n.get),i=aCallable$1(n.has),a=aCallable$1(n.set),s=arguments.length>2?arguments[2]:void 0;if(!isCallable(t)&&!isCallable(s))throw $TypeError$1("At least one callback required");return call(i,n,e)?(r=call(o,n,e),isCallable(t)&&(r=t(r),call(a,n,e,r))):isCallable(s)&&(r=s(),call(a,n,e,r)),r},$$8=_export,upsert$1=mapUpsert;$$8({target:"Map",proto:!0,real:!0,forced:!0},{upsert:upsert$1});var $$7=_export,upsert2=mapUpsert;$$7({target:"Map",proto:!0,real:!0,name:"upsert",forced:!0},{updateOrInsert:upsert2});var parent$o=map$3,map$2=parent$o,map$1=map$2,map2=map$1,_Map=getDefaultExportFromCjs(map2);function _typeof(e){return(_typeof="function"==typeof _Symbol&&"symbol"==typeof _Symbol$iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof _Symbol&&e.constructor===_Symbol&&e!==_Symbol.prototype?"symbol":typeof e})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),_Object$defineProperty(e,_toPropertyKey(n.key),n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),_Object$defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?_Object$defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPrimitive(e,t){if("object"!==_typeof$3(e)||null===e)return e;var r=e[_Symbol$toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==_typeof$3(n))return n;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$3(t)?t:String(t)}var aCallable=aCallable$j,toObject$1=toObject$f,IndexedObject=indexedObject,lengthOfArrayLike$2=lengthOfArrayLike$e,$TypeError=TypeError,createMethod$1=function(e){return function(t,r,n,o){aCallable(r);var i=toObject$1(t),a=IndexedObject(i),s=lengthOfArrayLike$2(i),l=e?s-1:0,c=e?-1:1;if(n<2)for(;;){if(l in a){o=a[l],l+=c;break}if(l+=c,e?l<0:s<=l)throw $TypeError("Reduce of empty array with no initial value")}for(;e?l>=0:s>l;l+=c)l in a&&(o=r(o,a[l],l,i));return o}},arrayReduce={left:createMethod$1(!1),right:createMethod$1(!0)},$$6=_export,$reduce=arrayReduce.left,arrayMethodIsStrict$1=arrayMethodIsStrict$7,CHROME_VERSION=engineV8Version,IS_NODE=engineIsNode,CHROME_BUG=!IS_NODE&&engineV8Version>79&&engineV8Version<83,FORCED$1=CHROME_BUG||!arrayMethodIsStrict$1("reduce");$$6({target:"Array",proto:!0,forced:FORCED$1},{reduce:function(e){var t=arguments.length;return $reduce(this,e,t,t>1?arguments[1]:void 0)}});var entryVirtual$2=entryVirtual$o,reduce$6=entryVirtual$2("Array").reduce,isPrototypeOf$2=objectIsPrototypeOf,method$2=reduce$6,ArrayPrototype$2=Array.prototype,reduce$5=function(e){var t=e.reduce;return e===ArrayPrototype$2||isPrototypeOf$2(ArrayPrototype$2,e)&&t===ArrayPrototype$2.reduce?method$2:t},parent$n=reduce$5,reduce$4=parent$n,parent$m=reduce$4,reduce$3=parent$m,parent$l=reduce$3,reduce$2=parent$l,reduce$1=reduce$2,reduce3=reduce$1,_reduceInstanceProperty=getDefaultExportFromCjs(reduce3),LogCacheLevel={DEBUG:1,LOG:2,WARN:3,ERROR:4},LOG_MAX_SIZE=204800,SIMPLE_TYPE=["Boolean","Number","String","Undefined","Null","Date","Object"],Logger=function(){function e(t,r){_classCallCheck(this,e),this.name=t||"",this._prefix="[".concat(this.name,"]"),this.logCacheLevel=(null==r?void 0:r.logCacheLevel)||3,this.logMaxSize=(null==r?void 0:r.logMaxSize)||LOG_MAX_SIZE,this.logSize=0,this.logTextArray=[]}return _createClass(e,[{key:"debug",value:function(){for(var t,r,n,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];this.logCache.apply(this,_concatInstanceProperty(t=[LogCacheLevel.DEBUG]).call(t,i)),e.disabled||(n=console).debug.apply(n,_concatInstanceProperty(r=["[".concat(nowTime(),"]"),this._prefix]).call(r,i))}},{key:"log",value:function(){for(var t,r,n,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];this.logCache.apply(this,_concatInstanceProperty(t=[LogCacheLevel.LOG]).call(t,i)),e.disabled||(n=console).log.apply(n,_concatInstanceProperty(r=["[".concat(nowTime(),"]"),this._prefix]).call(r,i))}},{key:"warn",value:function(){for(var t,r,n,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];this.logCache.apply(this,_concatInstanceProperty(t=[LogCacheLevel.WARN]).call(t,i)),e.disabled||(n=console).warn.apply(n,_concatInstanceProperty(r=["[".concat(nowTime(),"]"),this._prefix]).call(r,i))}},{key:"error",value:function(){for(var t,r,n,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];this.logCache.apply(this,_concatInstanceProperty(t=[LogCacheLevel.ERROR]).call(t,i)),e.disabled||(n=console).error.apply(n,_concatInstanceProperty(r=["[".concat(nowTime(),"]"),this._prefix]).call(r,i))}},{key:"logCache",value:function(e){if(!(e<this.logCacheLevel)){var t="";try{for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];var i=_mapInstanceProperty(n).call(n,(function(e){return logable(e)}));t="[".concat(nowTime(),"]")+this._prefix+_JSON$stringify(i)}catch(e){return}if(e>=this.logCacheLevel&&(this.logSize+=t.length,this.logTextArray.push(t)),this.logSize>this.logMaxSize){var a=this.logTextArray.shift();this.logSize-=a.length}}}},{key:"getLogCache",value:function(){var e=this.logTextArray.join("\n");return this.reset(),e}},{key:"reset",value:function(){this.logTextArray=[],this.logSize=0}},{key:"table",value:function(){var t;e.disabled||(console.group(this._prefix),(t=console).table.apply(t,arguments),console.groupEnd())}},{key:"setLogLevel",value:function(e){this.logCacheLevel=e}}],[{key:"enable",value:function(){e.disabled=!1}},{key:"disable",value:function(){e.disabled=!0}}]),e}();function nowTime(){return(new Date).toLocaleString()}function reduceDepth(e){var t;if("object"!==_typeof(e))return e;var r=_sliceInstanceProperty(t=Object.prototype.toString.call(e)).call(t,8,-1);switch(r){case"Array":case"Uint8Array":case"ArrayBuffer":return r+"["+e.length+"]";case"Object":return"{}";default:return r}}function logable(e,t,r){var n;r||(r=1),t||(t=2);var o={};if(!e||"object"!==_typeof(e))return e;var i=_sliceInstanceProperty(n=Object.prototype.toString.call(e)).call(n,8,-1);if(!_includesInstanceProperty(SIMPLE_TYPE).call(SIMPLE_TYPE,i))return i;if(!(r>t)){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(r===t?o[a]=reduceDepth(e[a]):"object"===_typeof(e[a])?o[a]=logable(e[a],t,r+1):o[a]=e[a]);return o}}function createPublicPromise(){var e,t,r=new _Promise((function(r,n){e=r,t=n}));return r.used=!1,r.resolve=function(){return r.used=!0,e.apply(void 0,arguments)},r.reject=function(){return r.used=!0,t.apply(void 0,arguments)},r}_defineProperty(Logger,"disabled",!0);var AUDIO=new Blob([new Uint8Array([255,227,24,196,0,0,0,3,72,1,64,0,0,4,132,16,31,227,192,225,76,255,67,12,255,221,27,255,228,97,73,63,255,195,131,69,192,232,223,255,255,207,102,239,255,255,255,101,158,206,70,20,59,255,254,95,70,149,66,4,16,128,0,2,2,32,240,138,255,36,106,183,255,227,24,196,59,11,34,62,80,49,135,40,0,253,29,191,209,200,141,71,7,255,252,152,74,15,130,33,185,6,63,255,252,195,70,203,86,53,15,255,255,247,103,76,121,64,32,47,255,34,227,194,209,138,76,65,77,69,51,46,57,55,170,170,170,170,170,170,170,170,170,170,255,227,24,196,73,13,153,210,100,81,135,56,0,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170])],{type:"audio/mpeg"}),VIDEO=new Blob([new Uint8Array([0,0,0,28,102,116,121,112,105,115,111,109,0,0,2,0,105,115,111,109,105,115,111,50,109,112,52,49,0,0,0,8,102,114,101,101,0,0,2,239,109,100,97,116,33,16,5,32,164,27,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,167,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,33,16,5,32,164,27,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,167,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,0,0,2,194,109,111,111,118,0,0,0,108,109,118,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,232,0,0,0,47,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,1,236,116,114,97,107,0,0,0,92,116,107,104,100,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,47,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,101,100,116,115,0,0,0,28,101,108,115,116,0,0,0,0,0,0,0,1,0,0,0,47,0,0,0,0,0,1,0,0,0,0,1,100,109,100,105,97,0,0,0,32,109,100,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,68,0,0,8,0,85,196,0,0,0,0,0,45,104,100,108,114,0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0,0,0,1,15,109,105,110,102,0,0,0,16,115,109,104,100,0,0,0,0,0,0,0,0,0,0,0,36,100,105,110,102,0,0,0,28,100,114,101,102,0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1,0,0,0,211,115,116,98,108,0,0,0,103,115,116,115,100,0,0,0,0,0,0,0,1,0,0,0,87,109,112,52,97,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,16,0,0,0,0,172,68,0,0,0,0,0,51,101,115,100,115,0,0,0,0,3,128,128,128,34,0,2,0,4,128,128,128,20,64,21,0,0,0,0,1,244,0,0,1,243,249,5,128,128,128,2,18,16,6,128,128,128,1,2,0,0,0,24,115,116,116,115,0,0,0,0,0,0,0,1,0,0,0,2,0,0,4,0,0,0,0,28,115,116,115,99,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,28,115,116,115,122,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,115,0,0,1,116,0,0,0,20,115,116,99,111,0,0,0,0,0,0,0,1,0,0,0,44,0,0,0,98,117,100,116,97,0,0,0,90,109,101,116,97,0,0,0,0,0,0,0,33,104,100,108,114,0,0,0,0,0,0,0,0,109,100,105,114,97,112,112,108,0,0,0,0,0,0,0,0,0,0,0,0,45,105,108,115,116,0,0,0,37,169,116,111,111,0,0,0,29,100,97,116,97,0,0,0,1,0,0,0,0,76,97,118,102,53,54,46,52,48,46,49,48,49])],{type:"video/mp4"});function setupDefaultValues(e){return _Object$assign({muted:!1,timeout:250,inline:!1},e)}function startPlayback(e,t){var r=e.muted,n=e.timeout,o=e.inline,i=t(),a=i.element,s=i.source,l=void 0,c=void 0,u=void 0;return a.muted=r,!0===r&&a.setAttribute("muted","muted"),!0===o&&a.setAttribute("playsinline","playsinline"),a.src=s,new _Promise((function(e){l=a.play(),c=_setTimeout((function(){u(!1,new Error("Timeout "+n+" ms has been reached"))}),n),u=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;a.remove(),a.srcObject=null,clearTimeout(c),e({result:t,error:r})},void 0!==l?l.then((function(){return u(!0)})).catch((function(e){return u(!1,e)})):u(!0)}))}function video(e){return startPlayback(e=setupDefaultValues(e),(function(){return{element:document.createElement("video"),source:_URL.createObjectURL(VIDEO)}}))}function audio(e){return startPlayback(e=setupDefaultValues(e),(function(){return{element:document.createElement("audio"),source:_URL.createObjectURL(AUDIO)}}))}var index={audio:audio,video:video},logger$2=new Logger("AdsPluginBaseAdManager"),BaseAdManager=function(e){_inherits$1(r,eventemitter3Exports.EventEmitter);var t=_createSuper$1(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck$2(this,r),(e=t.call(this)).options=n,e.config=n.config||{},e.plugin=n.plugin,e.player=n.plugin.player,e.mediaElement=e.player.media||e.player.video,e.isLinearAdRunning=!1,e._shouldBlockVideoContent=!1,e._isAdPaused=!0,e._isMediaEnded=!1,e.context={currentTime:0,duration:0},e}return _createClass$2(r,[{key:"currentTime",get:function(){return this.context.currentTime}},{key:"duration",get:function(){return this.context.duration}},{key:"paused",get:function(){return this._isAdPaused}},{key:"shouldBlockVideoContent",get:function(){return!sniffer.os.isTizen&&!sniffer.os.isWebOS&&(this.isLinearAdRunning||this._shouldBlockVideoContent)},set:function(e){this._shouldBlockVideoContent=e}},{key:"updateConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e?this.config=_objectSpread2$2(_objectSpread2$2({},this.config),e):logger$2.warn("config is empty")}},{key:"isFullScreen",value:function(){return!!this.player.fullscreen}},{key:"destroy",value:function(){this.removeAllListeners()}},{key:"tryContentPlay",value:function(){var e=this.player,t=e.play();void 0!==t&&t&&t.then?t.then((function(){logger$2.log("content play"),e.removeClass(STATE_CLASS.NOT_ALLOW_AUTOPLAY),e.addClass(STATE_CLASS.PLAYING),e.state<STATES.RUNNING&&(e.setState(STATES.RUNNING),e.emit(AUTOPLAY_STARTED))})).catch((function(t){if(logger$2.error("content play error",t),e.media&&e.media.error)return e.onError(),void e.removeClass(STATE_CLASS.ENTER)})):e.state<STATES.RUNNING&&(e.setState(STATES.RUNNING),e.removeClass(STATE_CLASS.NOT_ALLOW_AUTOPLAY),e.removeClass(STATE_CLASS.NO_START),e.removeClass(STATE_CLASS.ENTER),e.addClass(STATE_CLASS.PLAYING),e.emit(AUTOPLAY_STARTED))}}]),r}(),logger$1=new Logger("AdsPluginImaAdManager"),CLASS_NAME="xgplayer-ads-playing",ImaAdManager=function(e){_inherits$1(i,BaseAdManager);var t,r,n,o=_createSuper$1(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck$2(this,i),_defineProperty$2(_assertThisInitialized$1(e=o.call(this,t)),"_onMediaEnded",(function(){var t;e.isLinearAdRunning||(e._isMediaEnded=!0,null===(t=e.adsLoader)||void 0===t||t.contentComplete())})),_defineProperty$2(_assertThisInitialized$1(e),"_onMediaResize",(function(){var t,r=_assertThisInitialized$1(e).player,n=e.isFullScreen()?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL;null===(t=e.adsManager)||void 0===t||t.resize(r.sizeInfo.width,r.sizeInfo.height,n)})),_defineProperty$2(_assertThisInitialized$1(e),"_onMediaPlay",(function(){e._mediaPlayed=!0})),_defineProperty$2(_assertThisInitialized$1(e),"_onMediaPause",(function(){e._mediaPlayed=!1})),_defineProperty$2(_assertThisInitialized$1(e),"_onMediaVolumeChange",(function(){var t;null===(t=e.adsManager)||void 0===t||t.setVolume(e.player.muted?0:e.player.volume)})),_defineProperty$2(_assertThisInitialized$1(e),"_onAdsManagerLoaded",(function(t){var r=new google.ima.AdsRenderingSettings;r.restoreCustomPlaybackStateOnAdBreakComplete=!0,r.enablePreloading=!0;var n=e.adsManager=t.getAdsManager(e.mediaElement,r);logger$1.log("AdManager Loaded",n);var o=n.getCuePoints();o.length&&logger$1.log("cuePoints",o),e._initAdsManagerEventListeners(),e.player.emit(IMA_AD_MANAGER_READY,{adsManager:n})})),_defineProperty$2(_assertThisInitialized$1(e),"_onAdsManagerAdError",(function(t){e._handleAdError(t.getError()),e._resumeContent()})),_defineProperty$2(_assertThisInitialized$1(e),"_onAdsLoaderAdError",(function(t){e._handleAdError(t.getError())})),_defineProperty$2(_assertThisInitialized$1(e),"_handleAdError",(function(t){var r,n,o;logger$1.log("AdError",t),e.shouldBlockVideoContent=!1,e.isLinearAdRunning=!1,null===(r=e.adsManager)||void 0===r||r.destroy(),null===(n=e.plugin)||void 0===n||n.emit(IMA_AD_ERROR,t),null===(o=e.plugin)||void 0===o||o.emit(AD_ERROR,t)})),_defineProperty$2(_assertThisInitialized$1(e),"onAdEvent",(function(t){var r,n=_assertThisInitialized$1(e).player,o=null==t?void 0:t.getAd(),i=(null==t?void 0:t.getAdData())||(null==o?void 0:o.data),a=!1;switch(null==t?void 0:t.type){case google.ima.AdEvent.Type.AD_BREAK_READY:e.player.emit(IMA_AD_BREAK_READY,{ad:o});break;case google.ima.AdEvent.Type.LOADED:var s=(i||{}).adPodInfo,l=0===(null==s?void 0:s.podIndex);a=!0,l&&(o.isLinear()?e.shouldBlockVideoContent=!0:(e.shouldBlockVideoContent=!1,e.tryContentPlay())),e.emit(IMA_AD_LOADED,{ad:o,isPreroll:l}),e.plugin.emit(IMA_AD_LOADED,{ad:o,isPreroll:l});break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:e._resumeContent(),e.emit(IMA_CONTENT_RESUME_REQUESTED,{ad:o});break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:e.isLinearAdRunning=!0,e.shouldBlockVideoContent=!0,util$3.addClass(e.player.root,CLASS_NAME),null==n||n.pause(),e.emit(IMA_CONTENT_PAUSE_REQUESTED,{ad:o});break;case google.ima.AdEvent.Type.STARTED:e.plugin.emit(AD_START,{ad:o}),o.isLinear()&&(e._isAdPaused=!1,e.plugin.emit(AD_PLAY,{ad:o}));break;case google.ima.AdEvent.Type.RESUMED:e._isAdPaused=!1,e.plugin.emit(AD_PLAY,{ad:o});break;case google.ima.AdEvent.Type.PAUSED:e._isAdPaused=!0,e.plugin.emit(AD_PAUSE,{ad:o});break;case google.ima.AdEvent.Type.SKIPPED:e.plugin.emit(AD_SKIPPED,{ad:o});break;case google.ima.AdEvent.Type.AD_PROGRESS:var c=t.getAdData(),u=c.currentTime,p=c.duration;_Object$assign(e.context,{currentTime:u,duration:p}),e.plugin.emit(AD_TIME_UPDATE,{ad:o});break;case google.ima.AdEvent.Type.COMPLETE:var f=(i||{}).adPodInfo,d=!1;null!=o&&o.isLinear()&&(f&&(d=f.adPosition<f.totalAds),clearInterval(r)),e.plugin.emit(IMA_AD_COMPLETE,{ad:o,hasNextInPod:d}),e.plugin.emit(AD_COMPLETE,{ad:o,hasNextInPod:d});break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:null!=o&&o.isLinear()&&clearInterval(r),e.plugin.emit(IMA_ALL_ADS_COMPLETED,{ad:o}),e.player.emit(AD_ALL_COMPLETED,{ad:o});break;default:null!=o&&o.isLinear()&&clearInterval(r)}logger$1.log("AdEvent",null==t?void 0:t.type,a?_JSON$stringify((null==t?void 0:t.getAdData())||{}):null==t?void 0:t.getAd())})),e.displayContainer=null,e.adsLoader=null,e.adsManager=null,e}return _createClass$2(i,[{key:"init",value:(n=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.shouldBlockVideoContent=!!(this.config.adTagUrl||this.config.adsResponse||this.config.adsRequest),e.prev=1,this.emit(IMA_SDK_LOAD_START),e.next=5,this._loadIMASdk();case 5:this.emit(IMA_SDK_LOAD_SUCCESS),e.next=14;break;case 8:return e.prev=8,e.t0=e.catch(1),logger$1.error("google.ima sdk is not loaded, due to error",(null===e.t0||void 0===e.t0?void 0:e.t0.message)||e.t0),this.emit(IMA_SDK_LOAD_ERROR),this.shouldBlockVideoContent=!1,e.abrupt("return");case 14:this._initConfig(),this._initMediaEvents(),this._initContainer(),this._initLoader(),this._initAdsRequest();case 19:case"end":return e.stop()}}),e,this,[[1,8]])}))),function(){return n.apply(this,arguments)})},{key:"destroy",value:function(){_get$1(_getPrototypeOf$1(i.prototype),"destroy",this).call(this),this.reset(),this._removeMediaEvents(),this._destroyLoader()}},{key:"_initConfig",value:function(){var e=this.config.locale;e&&google.ima.settings.setLocale(e)}},{key:"_loadIMASdk",value:function(){var e=this;return new _Promise((function(t,r){if("undefined"!=typeof google&&google.ima)t();else{var n=document.createElement("script"),o=_setTimeout((function(){r(new Error("google.ima sdk load timeout"))}),e.config.loadSdkTimeout||3e3);n.src="https://imasdk.googleapis.com/js/sdkloader/ima3".concat(e.config.debug?"_debug":"",".js"),n.onload=function(){clearTimeout(o),t()},n.onerror=function(e){clearTimeout(o),r(null==e?void 0:e.message)},document.head.appendChild(n)}}))}},{key:"_initMediaEvents",value:function(){var e=this.player;e.on(VIDEO_RESIZE,this._onMediaResize),e.on(ENDED,this._onMediaEnded),e.on(PLAY,this._onMediaPlay),e.on(PAUSE,this._onMediaPause),e.on(VOLUME_CHANGE,this._onMediaVolumeChange)}},{key:"_removeMediaEvents",value:function(){var e=this.player;e.off(VIDEO_RESIZE,this._onMediaResize),e.off(ENDED,this._onMediaEnded),e.off(PLAY,this._onMediaPlay),e.off(PAUSE,this._onMediaPause),e.off(VOLUME_CHANGE,this._onMediaVolumeChange)}},{key:"_initContainer",value:function(){var e=this.options.displayContainer;this.displayContainer=new google.ima.AdDisplayContainer(e,this.mediaElement)}},{key:"_initLoader",value:function(){var e=this.adsLoader=new google.ima.AdsLoader(this.displayContainer);e.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this._onAdsManagerLoaded,!1),e.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this._onAdsLoaderAdError,!1),this.player.emit(IMA_AD_LOADER_READY,{adsLoader:e})}},{key:"_destroyLoader",value:function(){var e=this.adsLoader;e||(e.removeEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this._onAdsManagerLoaded,!1),e.removeEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this._onAdsLoaderAdError,!1))}},{key:"_initAdsRequest",value:(r=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t,r,n,o,i=this;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.config,r=t.adsRequest,n=t.adsResponse,o=t.adTagUrl,!(r||n||o)){e.next=9;break}return e.next=4,this._checkAutoplaySupport();case 4:this.requestAds(),this.player.once(IMA_AD_MANAGER_READY,(function(){i.autoplayAllowed?i.playAds():i.player.useHooks("play",(function e(){return i.playAds(),i.player.removeHooks("play",e),!1})),i.emit(IMA_READY_TO_PLAY)})),this.player.once(IMA_AD_ERROR,(function(){i.emit(IMA_READY_TO_PLAY)})),e.next=10;break;case 9:this.emit(IMA_READY_TO_PLAY);case 10:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"playAds",value:function(){try{this._onMediaVolumeChange(),this.displayContainerInitialized||(this.displayContainer.initialize(),this.displayContainerInitialized=!0);var e=this.player,t=this.isFullScreen()?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL;this.adsManager.init(e.sizeInfo.width,e.sizeInfo.height,t),this.adsManager.start()}catch(e){this._handleAdError(e),this._resumeContent()}}},{key:"_initAdsManagerEventListeners",value:function(){var e=this,t=this.adsManager;t.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this._onAdsManagerAdError);var r=["LOADED","STARTED","RESUMED","PAUSED","COMPLETE","ALL_ADS_COMPLETED","CONTENT_PAUSE_REQUESTED","CONTENT_RESUME_REQUESTED","VOLUME_CHANGED","VOLUME_MUTED","AD_METADATA","AD_CAN_PLAY","AD_PROGRESS","AD_BUFFERING","CLICK","VIDEO_CLICKED","VIDEO_ICON_CLICKED","FIRST_QUARTILE","MIDPOINT","THIRD_QUARTILE","SKIPPED","USER_CLOSE","AD_BREAK_READY","AD_BREAK_FETCH_ERROR"];_forEachInstanceProperty(r).call(r,(function(r){t.addEventListener(google.ima.AdEvent.Type[r],e.onAdEvent)}))}},{key:"_resumeContent",value:function(){var e;(this.isLinearAdRunning=!1,this.shouldBlockVideoContent=!1,util$3.removeClass(this.player.root,CLASS_NAME),this._isMediaEnded)||(null===(e=this.player)||void 0===e||e.play())}},{key:"reset",value:function(){var e,t;this.isLinearAdRunning=!1,null===(e=this.adsManager)||void 0===e||e.destroy(),this.adsManager=null,null===(t=this.adsLoader)||void 0===t||t.contentComplete(),util$3.removeClass(this.player.root,CLASS_NAME)}},{key:"requestAds",value:function(){var e,t=this.config,r=t.adsRequest,n=t.adsResponse,o=t.adTagUrl,i=this.player,a=new google.ima.AdsRequest;if(a.linearAdSlotWidth=i.sizeInfo.width,a.linearAdSlotHeight=i.sizeInfo.height,a.nonLinearAdSlotWidth=i.sizeInfo.width,a.nonLinearAdSlotHeight=i.sizeInfo.height,a.setAdWillAutoPlay(this.autoplayAllowed),a.setAdWillPlayMuted(this.autoplayRequiresMuted),o)a.adTagUrl=o;else if(n)a.adsResponse=n;else if(r&&"object"===_typeof$2(r)){var s;_forEachInstanceProperty(s=_Object$keys(r)).call(s,(function(e){a[e]=r[e]}))}logger$1.log("requestAds",_JSON$stringify(a)),null===(e=this.adsLoader)||void 0===e||e.requestAds(a)}},{key:"pause",value:function(){var e;return null===(e=this.adsManager)||void 0===e?void 0:e.pause()}},{key:"play",value:function(){var e;return null===(e=this.adsManager)||void 0===e?void 0:e.resume()}},{key:"skip",value:function(){var e;return null===(e=this.adsManager)||void 0===e?void 0:e.skip()}},{key:"updateConfig",value:function(e){_get$1(_getPrototypeOf$1(i.prototype),"updateConfig",this).call(this,e),this._initConfig()}},{key:"_checkAutoplaySupport",value:(t=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t,r,n,o,i,a;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.player.config.autoplay,r=sniffer.os.isTizen||sniffer.os.isWebOS,e.next=5,_Promise.all([t?r||index.video({timeout:800}).then((function(e){return e.result})):_Promise.resolve(!1),t&&this.player.config.autoplayMuted?r||index.video({timeout:800,muted:!0}).then((function(e){return e.result})):_Promise.resolve(!1)]);case 5:n=e.sent,o=_slicedToArray$1(n,2),i=o[0],a=o[1],this.autoplayAllowed=i||a,this.autoplayRequiresMuted=!i&&a,logger$1.log("checkAutoplaySupport",this.autoplayAllowed,this.autoplayRequiresMuted);case 12:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),i}(),AD_STATE_CLASS={START:"xgplayer-ad-start",UI_SHOW:"xgplayer-ad-show-ui"},AdPlayIcon=function(e){_inherits$1(r,Play);var t=_createSuper$1(r);function r(){var e,n;_classCallCheck$2(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return _defineProperty$2(_assertThisInitialized$1(n=t.call.apply(t,_concatInstanceProperty(e=[this]).call(e,i))),"btnClick",(function(e){e.preventDefault(),e.stopPropagation();var t=n.getAdPlugin();return t.paused?(t.play(),n.animate(!1)):(t.pause(),n.animate(!0)),!1})),n}return _createClass$2(r,[{key:"getAdPlugin",value:function(){return this.player.getPlugin("ad")}},{key:"listenEvents",value:function(){var e=this;this.on([AD_PAUSE],(function(){e.animate(!0)})),this.on(AD_PLAY,(function(){e.animate(!1)}))}}],[{key:"pluginName",get:function(){return"adPlay"}}]),r}(),AdProgress=function(e){_inherits$1(r,Progress);var t=_createSuper$1(r);function r(){return _classCallCheck$2(this,r),t.apply(this,arguments)}return _createClass$2(r,[{key:"getAdPlugin",value:function(){return this.player.getPlugin("ad")}},{key:"duration",get:function(){var e=this.getAdPlugin();return(null==e?void 0:e.duration)||0}},{key:"offsetDuration",get:function(){return this.duration}},{key:"timeOffset",get:function(){return 0}},{key:"currentTime",get:function(){var e=this.getAdPlugin();return(null==e?void 0:e.currentTime)||0}},{key:"afterCreate",value:function(){_Object$assign(this.config,{isCloseClickSeek:!0,isDraggingSeek:!0,closeMoveSeek:!0}),_get$1(_getPrototypeOf$1(r.prototype),"afterCreate",this).call(this)}},{key:"listenEvents",value:function(){var e=this;this.on(AD_TIME_UPDATE,(function(){e.onTimeupdate()}))}}],[{key:"pluginName",get:function(){return"adProgress"}}]),r}(),AdTimeIcon=function(e){_inherits$1(r,Time);var t=_createSuper$1(r);function r(){return _classCallCheck$2(this,r),t.apply(this,arguments)}return _createClass$2(r,[{key:"getAdPlugin",value:function(){return this.player.getPlugin("ad")}},{key:"duration",get:function(){var e=this.getAdPlugin();return(null==e?void 0:e.duration)||0}},{key:"currentTime",get:function(){var e=this.getAdPlugin();return(null==e?void 0:e.currentTime)||0}},{key:"listenEvents",value:function(){var e=this;this.on([AD_TIME_UPDATE],(function(t){e.onTimeUpdate()}))}}],[{key:"pluginName",get:function(){return"adTime"}}]),r}(),AdUIManager=function(){function e(t,r){_classCallCheck$2(this,e);var n=r.player,o=r.plugin;this.player=n,this.config=t,this.adPlugin=o,this.adUIPlugins=[],this.fragment=document.createDocumentFragment(),this.controlsPos=null,this.decoratedAdPluginList=[[Play,AdPlayIcon],[Time,AdTimeIcon],[Progress,AdProgress],[Volume,null],[CssFullScreen,null],[Fullscreen,null]],this.init(),this.initEvents()}return _createClass$2(e,[{key:"init",value:function(){var e=this.player,t=this.adUIPlugins,r=this.fragment,n=this.decoratedAdPluginList;_forEachInstanceProperty(n).call(n,(function(n){var o=_slicedToArray$1(n,2),i=o[0],a=o[1],s=e.getPlugin(i.pluginName);if(s){var l,c,u=null;if(a&&!e.getPlugin(a.pluginName))if(e.registerPlugin(a),u=e.getPlugin(a.pluginName),r.appendChild(u.root),null!==(l=u.extraEls)&&void 0!==l&&l.length)_forEachInstanceProperty(c=u.extraEls).call(c,(function(e){r.appendChild(e)}));t.push([s,u])}}))}},{key:"destroy",value:function(){this.fragment=null,this.adUIPlugins=[],this.decoratedAdPluginList=[],this.adPlugin=null,this.player=null}},{key:"initEvents",value:function(){var e=this,t=this.adPlugin,r=this.player;t.on(AD_PLAY,(function(){var e=[STATE_CLASS.NO_START,STATE_CLASS.PAUSED,STATE_CLASS.ENDED,STATE_CLASS.ERROR,STATE_CLASS.REPLAY,STATE_CLASS.LOADING];_forEachInstanceProperty(e).call(e,(function(e){r.removeClass(e)}))})),t.on(AD_START,(function(){e.showAdContainer()})),t.on(AD_COMPLETE,(function(t){t.hasNextInPod||e.hideAdContainer()})),t.on(AD_SKIPPED,(function(){e.hideAdContainer()})),t.on(AD_ERROR,(function(){e.hideAdContainer()}))}},{key:"showAdContainer",value:function(){var e=this.player;util$3.hasClass(e.root,AD_STATE_CLASS.START)||util$3.addClass(e.root,AD_STATE_CLASS.START)}},{key:"hideAdContainer",value:function(){var e=this.player;util$3.hasClass(e.root,AD_STATE_CLASS.START)&&util$3.removeClass(e.root,AD_STATE_CLASS.START)}},{key:"showAdUI",value:function(){var e,t=this.player,r=this.config,n=this.adUIPlugins,o=this.fragment;_forEachInstanceProperty(n).call(n,(function(e){var t=_slicedToArray$1(e,2),r=t[0],n=t[1];if(n){var i=n.root,a=n.extraEls,s=r.root,l=r.extraEls;o.contains(i)&&o.removeChild(i),_Array$isArray(a)&&a.length&&_forEachInstanceProperty(a).call(a,(function(e,t){o.contains(e)&&o.removeChild(e);var r=null==l?void 0:l[t];null!=r&&r.parentNode&&(r.parentNode.insertBefore(e,r),o.appendChild(r))})),s.parentNode.insertBefore(i,s),o.appendChild(s)}}));var i=this._getNonAdPlugin();_forEachInstanceProperty(e=_filterInstanceProperty(i).call(i,(function(e){return!!e.root}))).call(e,(function(e){var t=e.root;e.__adStub__||(e.__adStub__=util$3.createDom("xg-ad-stub","",{})),t.parentNode.insertBefore(e.__adStub__,t),o.appendChild(t)}));var a=t.getPlugin("start");a&&a.hide(),!1===r.controls&&t.controls&&this.hideControls(),this.showAdContainer(),t.addClass(AD_STATE_CLASS.UI_SHOW)}},{key:"hideAdUI",value:function(){var e,t,r=this.player,n=this.config,o=this.adUIPlugins,i=this.fragment;_forEachInstanceProperty(o).call(o,(function(e){var t=_slicedToArray$1(e,2),r=t[0],n=t[1];if(n){var o=n.root,a=n.extraEls,s=r.root,l=r.extraEls;i.contains(s)&&i.removeChild(s),i.contains(o)||(o.parentNode.insertBefore(s,o),i.appendChild(o)),_Array$isArray(l)&&null!=l&&l.length&&_forEachInstanceProperty(l).call(l,(function(e,t){i.contains(e)&&i.removeChild(e);var r=null==a?void 0:a[t];r&&r.parentNode&&(r.parentNode.insertBefore(e,r),i.appendChild(r))}))}}));var a=this._getNonAdPlugin();_forEachInstanceProperty(e=_filterInstanceProperty(a).call(a,(function(e){return!!e.root}))).call(e,(function(e){var t,r,n=e.root;i.contains(n)&&i.removeChild(n),null===(t=e.__adStub__)||void 0===t||null===(r=t.parentNode)||void 0===r||r.insertBefore(n,e.__adStub__)})),!1===n.controls&&i.contains(null===(t=r.controls)||void 0===t?void 0:t.root)&&this.showControls();var s=r.getPlugin("start");if(s){var l=s.config.disableAnimate,c=s.config.isShowPause;l||(s.config.disableAnimate=!0,s.config.isShowPause=!1),r.once("play",(function(){_setTimeout((function(){s.config.disableAnimate=l,s.config.disableAnimate=c}),10)}))}r.removeClass(AD_STATE_CLASS.UI_SHOW)}},{key:"hideControls",value:function(){var e=this.player,t=this.config,r=this.fragment;if(!1===t.controls&&e.controls){var n=e.controls.root,o=n.parentElement,i=n.previousSibling,a=n.nextSibling;this.controlsPos={parentNode:o,previousSibling:i,nextSibling:a},r.appendChild(e.controls.root)}}},{key:"showControls",value:function(){var e=this.player,t=this.config,r=this.fragment;if(!1===t.controls&&e.controls){if(!this.controlsPos)return;var n=e.controls.root;r.contains(n)&&r.removeChild(n);var o=this.controlsPos,i=o.parentNode,a=o.previousSibling,s=o.nextSibling;i&&(s?i.insertBefore(n,s):a?i.insertBefore(n,a.nextSibling):i.appendChild(n)),this.controlsPos=null}}},{key:"_getNonAdPlugin",value:function(){var e,t=this.player,r=this.decoratedAdPluginList,n=[];_forEachInstanceProperty(r).call(r,(function(e){var t=_slicedToArray$1(e,2),r=t[0],o=t[1];n.push(r.pluginName.toLowerCase()),o&&n.push(o.pluginName.toLowerCase())}));var o=(null===(e=t.controls)||void 0===e?void 0:e.plugins())||[];return _filterInstanceProperty(o).call(o,(function(e){return-1===_indexOfInstanceProperty(n).call(n,e.pluginName.toLowerCase())}))}}]),e}(),logger=new Logger("AdsPlugin"),AdsPlugin$1=function(e){_inherits$1(r,Plugin);var t=_createSuper$1(r);function r(){return _classCallCheck$2(this,r),t.apply(this,arguments)}return _createClass$2(r,[{key:"version",get:function(){return"3.0.23-rc.1"}},{key:"paused",get:function(){var e,t;return!(null===(e=this.csManager)||void 0===e||!e.isLinearAdRunning||null===(t=this.csManager)||void 0===t||!t.paused)}},{key:"currentTime",get:function(){var e;return(null===(e=this.csManager)||void 0===e?void 0:e.currentTime)||0}},{key:"duration",get:function(){var e;return(null===(e=this.csManager)||void 0===e?void 0:e.duration)||0}},{key:"afterCreate",value:function(){var e=this.config;logger.log("plugin afterCreate, config: ".concat(_JSON$stringify(e||{}))),this.csManager=void 0,this._blockContentPlay()}},{key:"beforePlayerInit",value:function(){switch(logger.log("plugin beforePlayerInit"),this.initPromise=createPublicPromise(),this.uiManager=new AdUIManager(this.config,{plugin:this,player:this.player}),this.config.adType){case"ima":case"google-ima":this._initClientSideAd()}return this.initPromise}},{key:"render",value:function(){return util$3.createDom("xg-ad","",{},"xgplayer-ads")}},{key:"_initClientSideAd",value:function(){switch(this.config.adType){case"ima":case"google-ima":this._initImaAd()}}},{key:"_initImaAd",value:function(){var e=this;this.csManager=new ImaAdManager({plugin:this,config:this.config.ima,displayContainer:this.root}),this.csManager.once(IMA_SDK_LOAD_START,(function(){e.uiManager.showAdContainer()})),this.csManager.on(IMA_SDK_LOAD_ERROR,(function(){e.uiManager.hideAdContainer()})),this.csManager.once(IMA_AD_LOADED,(function(t){t.isPreroll||e.uiManager.hideAdContainer()})),this.csManager.once(IMA_READY_TO_PLAY,(function(){var t;null===(t=e.initPromise)||void 0===t||t.resolve()})),this.csManager.on(IMA_CONTENT_PAUSE_REQUESTED,(function(){e.uiManager.showAdUI()})),this.csManager.on(IMA_CONTENT_RESUME_REQUESTED,(function(){e.uiManager.hideAdUI()})),this.csManager.init()}},{key:"requestAds",value:function(){var e;null===(e=this.csManager)||void 0===e||e.requestAds()}},{key:"playAds",value:function(){var e;null===(e=this.csManager)||void 0===e||e.playAds()}},{key:"pause",value:function(){var e;null===(e=this.csManager)||void 0===e||e.pause()}},{key:"play",value:function(){var e;null===(e=this.csManager)||void 0===e||e.play()}},{key:"destroy",value:function(){var e,t;this.offAll(),null===(e=this.csManager)||void 0===e||e.destroy(),null===(t=this.uiManager)||void 0===t||t.destroy()}},{key:"reset",value:function(){var e;null===(e=this.csManager)||void 0===e||e.reset()}},{key:"updateConfig",value:function(e){var t;null===(t=this.csManager)||void 0===t||t.updateConfig(e)}},{key:"_blockContentPlay",value:function(){var e=this,t=this.player;t.on("play",(function(){var r;null!==(r=e.csManager)&&void 0!==r&&r.shouldBlockVideoContent&&(logger.log("block content play"),t.pause())}))}}],[{key:"pluginName",get:function(){return"ad"}}]),r}();function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _unsupportedIterableToArray(e,t){var r;if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=_sliceInstanceProperty$1(r=Object.prototype.toString.call(e)).call(r,8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?_Array$from$1(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _createForOfIteratorHelper(e,t){var r=void 0!==_Symbol$1&&_getIteratorMethod$1(e)||e["@@iterator"];if(!r){if(_Array$isArray$1(e)||(r=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}var scte35={},descriptors$1={},util$2={};!function(e){_Object$defineProperty(e,"__esModule",{value:!0}),e.shiftThirtyTwoBits=e.THIRTY_TWO_BIT_MULTIPLIER=e.bytesToUUID=void 0;e.bytesToUUID=function(e){if(16!==e.length)throw new Error("scte35-js Uint8Array uuid bad size: ".concat(e.length));return _mapInstanceProperty([]).call(e,(function(e,t){var r=(e<=15?"0":"")+e.toString(16);return t>=4&&t<=10&&t%2==0?"-"+r:r})).join("")},e.THIRTY_TWO_BIT_MULTIPLIER=Math.pow(2,32);e.shiftThirtyTwoBits=function(t){return t*e.THIRTY_TWO_BIT_MULTIPLIER}}(util$2),_Object$defineProperty(descriptors$1,"__esModule",{value:!0}),descriptors$1.parseDescriptor=descriptors$1.SegmentationMessage=void 0;var SegmentationMessage,util$1=util$2;!function(e){e[e.RESTRICT_GROUP_0=0]="RESTRICT_GROUP_0",e[e.RESTRICT_GROUP_1=1]="RESTRICT_GROUP_1",e[e.RESTRICT_GROUP_2=2]="RESTRICT_GROUP_2",e[e.NONE=3]="NONE"}(SegmentationMessage||(descriptors$1.SegmentationMessage=SegmentationMessage={}));var spliceDescriptor=function(e){var t={},r=0;for(t.spliceDescriptorTag=e.getUint8(r++),t.descriptorLength=e.getUint8(r++),t.identifier="";t.identifier.length<4;)t.identifier+=String.fromCharCode(e.getUint8(r++));return t},parseDescriptor=function(e){var t,r=spliceDescriptor(e),n=6;if(0===r.spliceDescriptorTag)n=r.descriptorLength+2,console.warn("scte35-js TODO: support spliceDescriptorTag: SpliceDescriptorTag.AVAIL_DESCRIPTOR");else if(1===r.spliceDescriptorTag)n=r.descriptorLength+2,console.warn("scte35-js TODO: support spliceDescriptorTag: SpliceDescriptorTag.DTMF_DESCRIPTOR");else if(2===r.spliceDescriptorTag){var o=r;if(o.segmentationEventId=e.getUint32(n),n+=4,o.segmentationEventCancelIndicator=!!(128&e.getUint8(n++)),!o.segmentationEventCancelIndicator){var i=e.getUint8(n++);o.programSegmentationFlag=!!(128&i),o.segmentationDurationFlag=!!(64&i),o.deliveryNotRestrictedFlag=!!(32&i),o.deliveryNotRestrictedFlag||(o.webDeliveryAllowedFlag=!!(16&i),o.noRegionalBlackoutFlag=!!(8&i),o.archiveAllowedFlag=!!(4&i),o.deviceRestrictions=3&i),o.programSegmentationFlag||(o.componentCount=e.getUint8(n++),console.warn("scte35-js TODO: segmentationDescriptor.componentCount: "+o.componentCount),n+=6*o.componentCount),o.segmentationDurationFlag&&(o.segmentationDuration=util$1.shiftThirtyTwoBits(e.getUint8(n++)),o.segmentationDuration+=e.getUint32(n),n+=4),o.segmentationUpidType=e.getUint8(n++),o.segmentationUpidLength=e.getUint8(n++);var a=o.segmentationUpidLength;for(o.segmentationUpid=new Uint8Array(a);a>=0;)a--,o.segmentationUpid[a]=e.getUint8(n+a);n+=o.segmentationUpidLength,o.segmentationTypeId=e.getUint8(n++),o.segmentNum=e.getUint8(n++),o.segmentsExpected=e.getUint8(n++),n<r.descriptorLength+2&&(52===o.segmentationTypeId||54===o.segmentationTypeId)&&(o.subSegmentNum=e.getUint8(n++),o.subSegmentsExpected=e.getUint8(n++))}}else 3===r.spliceDescriptorTag?(n=r.descriptorLength+2,console.warn("scte35-js TODO: support spliceDescriptorTag: SpliceDescriptorTag.TIME_DESCRIPTOR")):(console.error("scte35-js Unrecognized spliceDescriptorTag ".concat(r.spliceDescriptorTag)),n=r.descriptorLength+2);n!==r.descriptorLength+2&&console.error(_concatInstanceProperty(t="scte35-js Error reading descriptor offset @".concat(n," of ")).call(t,r.descriptorLength+2));return r};descriptors$1.parseDescriptor=parseDescriptor;var path$4=path$z,_for$5=path$4.Symbol.for,parent$k=_for$5,_for$4=parent$k,parent$j=_for$4,_for$3=parent$j,parent$i=_for$3,_for$2=parent$i,_for$1=_for$2,_for=_for$1,_Symbol$for=getDefaultExportFromCjs(_for),apply=functionApply,toIndexedObject$1=toIndexedObject$c,toIntegerOrInfinity=toIntegerOrInfinity$6,lengthOfArrayLike$1=lengthOfArrayLike$e,arrayMethodIsStrict=arrayMethodIsStrict$7,min$1=Math.min,$lastIndexOf=[].lastIndexOf,NEGATIVE_ZERO=!!$lastIndexOf&&1/[1].lastIndexOf(1,-0)<0,STRICT_METHOD=arrayMethodIsStrict("lastIndexOf"),FORCED=NEGATIVE_ZERO||!STRICT_METHOD,arrayLastIndexOf=FORCED?function(e){if(NEGATIVE_ZERO)return apply($lastIndexOf,this,arguments)||0;var t=toIndexedObject$1(this),r=lengthOfArrayLike$1(t),n=r-1;for(arguments.length>1&&(n=min$1(n,toIntegerOrInfinity(arguments[1]))),n<0&&(n=r+n);n>=0;n--)if(n in t&&t[n]===e)return n||0;return-1}:$lastIndexOf,$$5=_export,lastIndexOf$7=arrayLastIndexOf;$$5({target:"Array",proto:!0,forced:arrayLastIndexOf!==[].lastIndexOf},{lastIndexOf:arrayLastIndexOf});var entryVirtual$1=entryVirtual$o,lastIndexOf$6=entryVirtual$1("Array").lastIndexOf,isPrototypeOf$1=objectIsPrototypeOf,method$1=lastIndexOf$6,ArrayPrototype$1=Array.prototype,lastIndexOf$5=function(e){var t=e.lastIndexOf;return e===ArrayPrototype$1||isPrototypeOf$1(ArrayPrototype$1,e)&&t===ArrayPrototype$1.lastIndexOf?method$1:t},parent$h=lastIndexOf$5,lastIndexOf$4=parent$h,parent$g=lastIndexOf$4,lastIndexOf$3=parent$g,parent$f=lastIndexOf$3,lastIndexOf$2=parent$f,lastIndexOf$1=lastIndexOf$2,lastIndexOf2=lastIndexOf$1,_lastIndexOfInstanceProperty=getDefaultExportFromCjs(lastIndexOf2),toObject=toObject$f,toAbsoluteIndex=toAbsoluteIndex$6,lengthOfArrayLike=lengthOfArrayLike$e,deletePropertyOrThrow=deletePropertyOrThrow$3,min=Math.min,arrayCopyWithin=[].copyWithin||function(e,t){var r=toObject(this),n=lengthOfArrayLike(r),o=toAbsoluteIndex(e,n),i=toAbsoluteIndex(t,n),a=arguments.length>2?arguments[2]:void 0,s=min((void 0===a?n:toAbsoluteIndex(a,n))-i,n-o),l=1;for(i<o&&o<i+s&&(l=-1,i+=s-1,o+=s-1);s-- >0;)i in r?r[o]=r[i]:deletePropertyOrThrow(r,o),o+=l,i+=l;return r},$$4=_export,copyWithin$7=arrayCopyWithin;$$4({target:"Array",proto:!0},{copyWithin:copyWithin$7});var entryVirtual=entryVirtual$o,copyWithin$6=entryVirtual("Array").copyWithin,isPrototypeOf=objectIsPrototypeOf,method=copyWithin$6,ArrayPrototype=Array.prototype,copyWithin$5=function(e){var t=e.copyWithin;return e===ArrayPrototype||isPrototypeOf(ArrayPrototype,e)&&t===ArrayPrototype.copyWithin?method:t},parent$e=copyWithin$5,copyWithin$4=parent$e,parent$d=copyWithin$4,copyWithin$3=parent$d,parent$c=copyWithin$3,copyWithin$2=parent$c,copyWithin$1=copyWithin$2,copyWithin2=copyWithin$1,_copyWithinInstanceProperty=getDefaultExportFromCjs(copyWithin2),buffer={},base64Js={};base64Js.byteLength=byteLength,base64Js.toByteArray=toByteArray,base64Js.fromByteArray=fromByteArray;for(var lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i$1=0,len=code.length;i$1<len;++i$1)lookup[i$1]=code[i$1],revLookup[code.charCodeAt(i$1)]=i$1;function getLens(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=_indexOfInstanceProperty(e).call(e,"=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function byteLength(e){var t=getLens(e),r=t[0],n=t[1];return 3*(r+n)/4-n}function _byteLength(e,t,r){return 3*(t+r)/4-r}function toByteArray(e){var t,r,n=getLens(e),o=n[0],i=n[1],a=new Arr(_byteLength(e,o,i)),s=0,l=i>0?o-4:o;for(r=0;r<l;r+=4)t=revLookup[e.charCodeAt(r)]<<18|revLookup[e.charCodeAt(r+1)]<<12|revLookup[e.charCodeAt(r+2)]<<6|revLookup[e.charCodeAt(r+3)],a[s++]=t>>16&255,a[s++]=t>>8&255,a[s++]=255&t;return 2===i&&(t=revLookup[e.charCodeAt(r)]<<2|revLookup[e.charCodeAt(r+1)]>>4,a[s++]=255&t),1===i&&(t=revLookup[e.charCodeAt(r)]<<10|revLookup[e.charCodeAt(r+1)]<<4|revLookup[e.charCodeAt(r+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t),a}function tripletToBase64(e){return lookup[e>>18&63]+lookup[e>>12&63]+lookup[e>>6&63]+lookup[63&e]}function encodeChunk(e,t,r){for(var n,o=[],i=t;i<r;i+=3)n=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),o.push(tripletToBase64(n));return o.join("")}function fromByteArray(e){for(var t,r=e.length,n=r%3,o=[],i=16383,a=0,s=r-n;a<s;a+=i)o.push(encodeChunk(e,a,a+i>s?s:a+i));return 1===n?(t=e[r-1],o.push(lookup[t>>2]+lookup[t<<4&63]+"==")):2===n&&(t=(e[r-2]<<8)+e[r-1],o.push(lookup[t>>10]+lookup[t>>4&63]+lookup[t<<2&63]+"=")),o.join("")}revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63;var ieee754={
|
|
2
2
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
3
|
-
read:function(e,t,r,n,o){var i,a,s=8*o-n-1,l=(1<<s)-1,c=l>>1,u=-7,p=r?o-1:0,f=r?-1:1,d=e[t+p];for(p+=f,i=d&(1<<-u)-1,d>>=-u,u+=s;u>0;i=256*i+e[t+p],p+=f,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=n;u>0;a=256*a+e[t+p],p+=f,u-=8);if(0===i)i=1-c;else{if(i===l)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),i-=c}return(d?-1:1)*a*Math.pow(2,i-n)},write:function(e,t,r,n,o,i){var a,s,l,c=8*i-o-1,u=(1<<c)-1,p=u>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,h=n?1:-1,$=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+p>=1?f/l:f*Math.pow(2,1-p))*l>=2&&(a++,l/=2),a+p>=u?(s=0,a=u):a+p>=1?(s=(t*l-1)*Math.pow(2,o),a+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,o),a=0));o>=8;e[r+d]=255&s,d+=h,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;e[r+d]=255&a,d+=h,a/=256,c-=8);e[r+d-h]|=128*$}};(function(e){var t=base64Js,r=ieee754,n="function"==typeof _Symbol&&"function"==typeof _Symbol$for?_Symbol$for("nodejs.util.inspect.custom"):null;e.Buffer=a,e.SlowBuffer=function(e){+e!=e&&(e=0);return a.alloc(+e)},e.INSPECT_MAX_BYTES=50;var o=2147483647;function i(e){if(e>o)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return _Object$setPrototypeOf(t,a.prototype),t}function a(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return c(e)}return s(e,t,r)}function s(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!a.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|d(e,t),n=i(r),o=n.write(e,t);o!==r&&(n=_sliceInstanceProperty(n).call(n,0,o));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(q(e,Uint8Array)){var t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return u(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+_typeof$3(e));if(q(e,ArrayBuffer)||e&&q(e.buffer,ArrayBuffer))return p(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(q(e,SharedArrayBuffer)||e&&q(e.buffer,SharedArrayBuffer)))return p(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return a.from(n,t,r);var o=function(e){if(a.isBuffer(e)){var t=0|f(e.length),r=i(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||Y(e.length)?i(0):u(e);if("Buffer"===e.type&&_Array$isArray(e.data))return u(e.data)}(e);if(o)return o;if(void 0!==_Symbol&&null!=_Symbol$toPrimitive&&"function"==typeof e[_Symbol$toPrimitive])return a.from(e[_Symbol$toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+_typeof$3(e))}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return l(e),i(e<0?0:0|f(e))}function u(e){for(var t=e.length<0?0:0|f(e.length),r=i(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function p(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),_Object$setPrototypeOf(n,a.prototype),n}function f(e){if(e>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function d(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||q(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+_typeof$3(e));var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var o=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return K(e).length;default:if(o)return n?-1:G(e).length;t=(""+t).toLowerCase(),o=!0}}function h(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,r);case"utf8":case"utf-8":return T(this,t,r);case"ascii":return P(this,t,r);case"latin1":case"binary":return A(this,t,r);case"base64":return E(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function $(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=a.from(t,n)),a.isBuffer(t))return 0===t.length?-1:g(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof _indexOfInstanceProperty(Uint8Array.prototype)?o?_indexOfInstanceProperty(Uint8Array.prototype).call(e,t,r):_lastIndexOfInstanceProperty(Uint8Array.prototype).call(e,t,r):g(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,n,o){var i,a=1,s=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,l/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var u=-1;for(i=r;i<s;i++)if(c(e,i)===c(t,-1===u?0:i-u)){if(-1===u&&(u=i),i-u+1===l)return u*a}else-1!==u&&(i-=i-u),u=-1}else for(r+l>s&&(r=s-l),i=r;i>=0;i--){for(var p=!0,f=0;f<l;f++)if(c(e,i+f)!==c(t,f)){p=!1;break}if(p)return i}return-1}function v(e,t,r,n){r=Number(r)||0;var o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i,a=t.length;for(n>a/2&&(n=a/2),i=0;i<n;++i){var s=_parseInt$1(t.substr(2*i,2),16);if(Y(s))return i;e[r+i]=s}return i}function m(e,t,r,n){return W(G(t,e.length-r),e,r,n)}function _(e,t,r,n){return W(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function b(e,t,r,n){return W(K(t),e,r,n)}function I(e,t,r,n){return W(function(e,t){for(var r,n,o,i=[],a=0;a<e.length&&!((t-=2)<0);++a)n=(r=e.charCodeAt(a))>>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function E(e,r,n){return 0===r&&n===e.length?t.fromByteArray(e):t.fromByteArray(_sliceInstanceProperty(e).call(e,r,n))}function T(e,t,r){r=Math.min(e.length,r);for(var n=[],o=t;o<r;){var i=e[o],a=null,s=i>239?4:i>223?3:i>191?2:1;if(o+s<=r){var l=void 0,c=void 0,u=void 0,p=void 0;switch(s){case 1:i<128&&(a=i);break;case 2:128==(192&(l=e[o+1]))&&(p=(31&i)<<6|63&l)>127&&(a=p);break;case 3:l=e[o+1],c=e[o+2],128==(192&l)&&128==(192&c)&&(p=(15&i)<<12|(63&l)<<6|63&c)>2047&&(p<55296||p>57343)&&(a=p);break;case 4:l=e[o+1],c=e[o+2],u=e[o+3],128==(192&l)&&128==(192&c)&&128==(192&u)&&(p=(15&i)<<18|(63&l)<<12|(63&c)<<6|63&u)>65535&&p<1114112&&(a=p)}}null===a?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),o+=s}return function(e){var t=e.length;if(t<=S)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,_sliceInstanceProperty(e).call(e,n,n+=S));return r}(n)}e.kMaxLength=o,a.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return _Object$setPrototypeOf(t,Uint8Array.prototype),_Object$setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),a.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),_Object$defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),_Object$defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(e,t,r){return s(e,t,r)},_Object$setPrototypeOf(a.prototype,Uint8Array.prototype),_Object$setPrototypeOf(a,Uint8Array),a.alloc=function(e,t,r){return function(e,t,r){return l(e),e<=0?i(e):void 0!==t?"string"==typeof r?_fillInstanceProperty(n=i(e)).call(n,t,r):_fillInstanceProperty(o=i(e)).call(o,t):i(e);var n,o}(e,t,r)},a.allocUnsafe=function(e){return c(e)},a.allocUnsafeSlow=function(e){return c(e)},a.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==a.prototype},a.compare=function(e,t){if(q(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),q(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(e)||!a.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(e,t){if(!_Array$isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return a.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=a.allocUnsafe(t),o=0;for(r=0;r<e.length;++r){var i=e[r];if(q(i,Uint8Array))o+i.length>n.length?(a.isBuffer(i)||(i=a.from(i)),i.copy(n,o)):Uint8Array.prototype.set.call(n,i,o);else{if(!a.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o)}o+=i.length}return n},a.byteLength=d,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)$(this,t,t+1);return this},a.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)$(this,t,t+3),$(this,t+1,t+2);return this},a.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)$(this,t,t+7),$(this,t+1,t+6),$(this,t+2,t+5),$(this,t+3,t+4);return this},a.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?T(this,0,e):h.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(e){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===a.compare(this,e)},a.prototype.inspect=function(){var t,r="",n=e.INSPECT_MAX_BYTES;return r=_trimInstanceProperty(t=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ")).call(t),this.length>n&&(r+=" ... "),"<Buffer "+r+">"},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function(e,t,r,n,o){if(q(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+_typeof$3(e));if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),l=Math.min(i,s),c=_sliceInstanceProperty(this).call(this,n,o),u=_sliceInstanceProperty(e).call(e,t,r),p=0;p<l;++p)if(c[p]!==u[p]){i=c[p],s=u[p];break}return i<s?-1:s<i?1:0},a.prototype.includes=function(e,t,r){return-1!==_indexOfInstanceProperty(this).call(this,e,t,r)},a.prototype.indexOf=function(e,t,r){return y(this,e,t,r,!0)},a.prototype.lastIndexOf=function(e,t,r){return y(this,e,t,r,!1)},a.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return m(this,e,t,r);case"ascii":case"latin1":case"binary":return _(this,e,t,r);case"base64":return b(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:_sliceInstanceProperty(Array.prototype).call(this._arr||this,0)}};var S=4096;function P(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function A(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function O(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=t;i<r;++i)o+=z[e[i]];return o}function R(e,t,r){for(var n=_sliceInstanceProperty(e).call(e,t,r),o="",i=0;i<n.length-1;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function C(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function w(e,t,r,n,o,i){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function k(e,t,r,n,o){B(t,n,o,e,r,7);var i=Number(t&BigInt(4294967295));e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i;var a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function D(e,t,r,n,o){B(t,n,o,e,r,7);var i=Number(t&BigInt(4294967295));e[r+7]=i,i>>=8,e[r+6]=i,i>>=8,e[r+5]=i,i>>=8,e[r+4]=i;var a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function L(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(e,t,n,o,i){return t=+t,n>>>=0,i||L(e,0,n,4),r.write(e,t,n,o,23,4),n+4}function M(e,t,n,o,i){return t=+t,n>>>=0,i||L(e,0,n,8),r.write(e,t,n,o,52,8),n+8}a.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return _Object$setPrototypeOf(n,a.prototype),n},a.prototype.readUintLE=a.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);for(var n=this[e],o=1,i=0;++i<t&&(o*=256);)n+=this[e+i]*o;return n},a.prototype.readUintBE=a.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);for(var n=this[e+--t],o=1;t>0&&(o*=256);)n+=this[e+--t]*o;return n},a.prototype.readUint8=a.prototype.readUInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),this[e]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readBigUInt64LE=X((function(e){F(e>>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);var n=t+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,24),o=this[++e]+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+r*Math.pow(2,24);return BigInt(n)+(BigInt(o)<<BigInt(32))})),a.prototype.readBigUInt64BE=X((function(e){F(e>>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);var n=t*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+this[++e],o=this[++e]*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+r;return(BigInt(n)<<BigInt(32))+BigInt(o)})),a.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);for(var n=this[e],o=1,i=0;++i<t&&(o*=256);)n+=this[e+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*t)),n},a.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);for(var n=t,o=1,i=this[e+--n];n>0&&(o*=256);)i+=this[e+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},a.prototype.readInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||C(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(e,t){e>>>=0,t||C(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readBigInt64LE=X((function(e){F(e>>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);var n=this[e+4]+this[e+5]*Math.pow(2,8)+this[e+6]*Math.pow(2,16)+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,24))})),a.prototype.readBigInt64BE=X((function(e){F(e>>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);var n=(t<<24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+r)})),a.prototype.readFloatLE=function(e,t){return e>>>=0,t||C(e,4,this.length),r.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||C(e,4,this.length),r.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||C(e,8,this.length),r.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||C(e,8,this.length),r.read(this,e,!1,52,8)},a.prototype.writeUintLE=a.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||w(this,e,t,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||w(this,e,t,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},a.prototype.writeUint8=a.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||w(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||w(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||w(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||w(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||w(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeBigUInt64LE=X((function(e){return k(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),a.prototype.writeBigUInt64BE=X((function(e){return D(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),a.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var o=Math.pow(2,8*r-1);w(this,e,t,r,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i<r&&(a*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+r},a.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var o=Math.pow(2,8*r-1);w(this,e,t,r,o-1,-o)}var i=r-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+r},a.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||w(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||w(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||w(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||w(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||w(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeBigInt64LE=X((function(e){return k(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),a.prototype.writeBigInt64BE=X((function(e){return D(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),a.prototype.writeFloatLE=function(e,t,r){return N(this,e,t,!0,r)},a.prototype.writeFloatBE=function(e,t,r){return N(this,e,t,!1,r)},a.prototype.writeDoubleLE=function(e,t,r){return M(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){return M(this,e,t,!1,r)},a.prototype.copy=function(e,t,r,n){if(!a.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var o=n-r;this===e&&"function"==typeof _copyWithinInstanceProperty(Uint8Array.prototype)?_copyWithinInstanceProperty(this).call(this,t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return o},a.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var o=e.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(e=o)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{var s=a.isBuffer(e)?e:a.from(e,n),l=s.length;if(0===l)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=s[i%l]}return this};var x={};function j(e,t,r){x[e]=function(r){_inherits$2(o,r);var n=_createSuper$2(o);function o(){var r,i;return _classCallCheck$3(this,o),i=n.call(this),_Object$defineProperty(_assertThisInitialized$2(i),"message",{value:t.apply(_assertThisInitialized$2(i),arguments),writable:!0,configurable:!0}),i.name=_concatInstanceProperty(r="".concat(i.name," [")).call(r,e,"]"),i.stack,delete i.name,i}return _createClass$3(o,[{key:"code",get:function(){return e},set:function(e){_Object$defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}},{key:"toString",value:function(){var t,r;return _concatInstanceProperty(t=_concatInstanceProperty(r="".concat(this.name," [")).call(r,e,"]: ")).call(t,this.message)}}]),o}(r)}function U(e){for(var t,r="",n=e.length,o="-"===e[0]?1:0;n>=o+4;n-=3){var i;r=_concatInstanceProperty(i="_".concat(_sliceInstanceProperty(e).call(e,n-3,n))).call(i,r)}return _concatInstanceProperty(t="".concat(_sliceInstanceProperty(e).call(e,0,n))).call(t,r)}function B(e,t,r,n,o,i){if(e>r||e<t){var a,s,l,c,u,p,f,d,h,$,y="bigint"==typeof t?"n":"";if(i>3)if(0===t||t===BigInt(0))a=_concatInstanceProperty(s=_concatInstanceProperty(l=_concatInstanceProperty(c=">= 0".concat(y," and < 2")).call(c,y," ** ")).call(l,8*(i+1))).call(s,y);else a=_concatInstanceProperty(u=_concatInstanceProperty(p=">= -(2".concat(y," ** ")).call(p,8*(i+1)-1)).call(u,y,") and < 2 ** ")+_concatInstanceProperty(f="".concat(8*(i+1)-1)).call(f,y);else a=_concatInstanceProperty(d=_concatInstanceProperty(h=_concatInstanceProperty($=">= ".concat(t)).call($,y," and <= ")).call(h,r)).call(d,y);throw new x.ERR_OUT_OF_RANGE("value",a,e)}!function(e,t,r){F(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||H(t,e.length-(r+1))}(n,o,i)}function F(e,t){if("number"!=typeof e)throw new x.ERR_INVALID_ARG_TYPE(t,"number",e)}function H(e,t,r){var n;if(Math.floor(e)!==e)throw F(e,r),new x.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new x.ERR_BUFFER_OUT_OF_BOUNDS;throw new x.ERR_OUT_OF_RANGE(r||"offset",_concatInstanceProperty(n=">= ".concat(r?1:0," and <= ")).call(n,t),e)}j("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?"".concat(e," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"}),RangeError),j("ERR_INVALID_ARG_TYPE",(function(e,t){var r;return _concatInstanceProperty(r='The "'.concat(e,'" argument must be of type number. Received type ')).call(r,_typeof$3(t))}),TypeError),j("ERR_OUT_OF_RANGE",(function(e,t,r){var n,o='The value of "'.concat(e,'" is out of range.'),i=r;return _Number$isInteger(r)&&Math.abs(r)>Math.pow(2,32)?i=U(String(r)):"bigint"==typeof r&&(i=String(r),(r>Math.pow(BigInt(2),BigInt(32))||r<-Math.pow(BigInt(2),BigInt(32)))&&(i=U(i)),i+="n"),o+=_concatInstanceProperty(n=" It must be ".concat(t,". Received ")).call(n,i)}),RangeError);var V=/[^+/0-9A-Za-z-_]/g;function G(e,t){var r;t=t||1/0;for(var n=e.length,o=null,i=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function K(e){return t.toByteArray(function(e){if(e=e.split("=")[0],(e=_trimInstanceProperty(e).call(e).replace(V,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function W(e,t,r,n){var o;for(o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function q(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Y(e){return e!=e}var z=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,o=0;o<16;++o)t[n+o]=e[r]+e[o];return t}();function X(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}})(buffer),_Object$defineProperty(scte35,"__esModule",{value:!0});var SCTE35_1=scte35.SCTE35=void 0,descriptors=descriptors$1,util=util$2,buffer_1=buffer,SCTE35=function(){function e(){_classCallCheck$3(this,e),this.buffer=buffer_1.Buffer}return _createClass$3(e,[{key:"parseFromB64",value:function(e){var t,r=Uint8Array.from(_mapInstanceProperty(t=this.parseBase64(e).split("")).call(t,(function(e){return e.charCodeAt(0)})));return this.parseSCTE35Data(r)}},{key:"parseFromHex",value:function(e){var t=e.match(/[a-f\d]{2}/gi)||[],r=Uint8Array.from(_mapInstanceProperty(t).call(t,(function(e){return _parseInt$1(e,16)})));return this.parseSCTE35Data(r)}},{key:"parseBase64",value:function(e){return this.buffer.from(e,"base64").toString("binary")}},{key:"spliceEvent",value:function(e,t,r){var n=0;if(e.spliceEventId=t.getUint32(n),n+=4,e.spliceEventCancelIndicator=!!(128&t.getUint8(n++)),e.spliceEventCancelIndicator)return n;var o=t.getUint8(n++);if(e.outOfNetworkIndicator=!!(128&o),e.programSpliceFlag=!!(64&o),e.durationFlag=!!(32&o),5===r&&(e.spliceImmediateFlag=!!(16&o)),e.programSpliceFlag)if(5!==r||e.spliceImmediateFlag)4===r&&(e.utcSpliceTime=t.getUint32(n),n+=4);else{var i=this.timeSignal(new DataView(t.buffer,t.byteOffset+n,5));e.spliceTime=i,n++,i.specified&&(n+=4)}else if(e.componentCount=t.getUint8(n++),4===r){for(var a=[];a.length!==e.componentCount;)a.push({componentTag:t.getUint8(n++),utcSpliceTime:t.getUint32(n)}),n+=4;e.utcSpliceComponents=a}else console.warn("scte35-js TODO: support splice_insert");return e.durationFlag&&(o=t.getUint8(n++),e.breakDuration={autoReturn:!!(128&o),duration:(1&o?util.THIRTY_TWO_BIT_MULTIPLIER:0)+t.getUint32(n)},n+=4),e.uniqueProgramId=t.getUint16(n),n+=2,e.available=t.getUint8(n++),e.expected=t.getUint8(n++),n}},{key:"spliceSchedule",value:function(e){var t={};t.spliceCount=e.getUint8(0),t.spliceEvents=[];for(var r,n=1;t.spliceEvents.length!==t.spliceCount;){var o={};n+=this.spliceEvent(o,new DataView(e.buffer,e.byteOffset+n),4),t.spliceEvents.push(o)}n!==e.byteLength&&console.error(_concatInstanceProperty(r="scte35-js Bad read splice_schedule actual: ".concat(n," expected: ")).call(r,e.byteLength));return t}},{key:"spliceInsert",value:function(e){var t,r={},n=this.spliceEvent(r,e,5);n!==e.byteLength&&console.error(_concatInstanceProperty(t="scte35-js Bad read splice_insert actual: ".concat(n," expected: ")).call(t,e.byteLength));return r}},{key:"timeSignal",value:function(e){var t={},r=e.getUint8(0);return t.specified=!!(128&r),t.specified&&(t.pts=1&r?util.THIRTY_TWO_BIT_MULTIPLIER:0,t.pts+=e.getUint32(1)),t}},{key:"privateCommand",value:function(e){var t={},r=e.getUint32(0),n=new Uint8Array(e.buffer,e.byteOffset+4,e.byteLength-4);return t.identifier=r,t.identifier&&(t.rawData=n),t}},{key:"parseSCTE35Data",value:function(e){var t={},r=new DataView(e.buffer),n=0;t.tableId=r.getUint8(n++);var o,i=r.getUint8(n++);if(t.selectionSyntaxIndicator=!!(128&i),t.privateIndicator=!!(64&i),t.sectionLength=((15&i)<<8)+r.getUint8(n++),t.sectionLength+3!==e.byteLength)throw new Error(_concatInstanceProperty(o="Binary read error sectionLength: ".concat(t.sectionLength," + 3 !== data.length: ")).call(o,e.byteLength));if(t.protocolVersion=r.getUint8(n++),i=r.getUint8(n++),t.encryptedPacket=!!(128&i),t.encryptedAlgorithm=(126&i)>>1,t.encryptedPacket&&console.error("scte35-js splice_info_section encrypted_packet ".concat(t.encryptedAlgorithm," not supported")),t.ptsAdjustment=1&i?util.THIRTY_TWO_BIT_MULTIPLIER:0,t.ptsAdjustment+=r.getUint32(n),n+=4,t.cwIndex=r.getUint8(n++),t.tier=r.getUint8(n++)<<4,i=r.getUint8(n++),t.tier+=(240&i)>>4,t.spliceCommandLength=((15&i)<<8)+r.getUint8(n++),t.spliceCommandType=r.getUint8(n++),4095===t.spliceCommandLength)if(6===t.spliceCommandType){var a=128&r.getUint8(n);t.spliceCommandLength=a?5:1}else if(0===t.spliceCommandType)t.spliceCommandLength=0;else if(5===t.spliceCommandType){var s=n;if(s+=4,!(128&r.getUint8(s++))){var l=r.getUint8(s++),c=16&l,u=32&l,p=64&l;if(p&&!c&&(s+=5),!p){var f=r.getUint8(s++);s+=f,s+=c?0:5*f}u&&(s+=5),s+=4,t.spliceCommandLength=s-n}}else console.error("scte35-js Unspecified length not supported in this context");if(0!==t.spliceCommandType){var d=new DataView(e.buffer,n,t.spliceCommandLength);4===t.spliceCommandType?t.spliceCommand=this.spliceSchedule(d):5===t.spliceCommandType?t.spliceCommand=this.spliceInsert(d):6===t.spliceCommandType?t.spliceCommand=this.timeSignal(d):255===t.spliceCommandType&&(t.spliceCommand=this.privateCommand(d))}if(n+=t.spliceCommandLength,t.descriptorLoopLength=r.getUint16(n),n+=2,t.descriptorLoopLength){var h=t.descriptorLoopLength;t.descriptors=[];try{for(;h;){var $=new DataView(e.buffer,n,h),y=descriptors.parseDescriptor($);h-=y.descriptorLength+2,n+=y.descriptorLength+2,t.descriptors.push(y)}}catch(e){var g;console.error(_concatInstanceProperty(g="scte35-js Error reading descriptor @ ".concat(n,", ignoring remaining bytes: ")).call(g,h," in loop.")),console.error(e),n+=h,h=0}}return t.crc=r.getUint32(n),(n+=4)!==r.byteLength&&console.error("scte35-js Bad SCTE35 read - remaining data: ".concat(_sliceInstanceProperty(e).call(e,n).join(", "))),t}}]),e}();SCTE35_1=scte35.SCTE35=SCTE35;var SCTE35_OUT_TAG$1="SCTE35-OUT",START_DATE_TAG="START-DATE",PLANNED_DURATION_TAG$1="PLANNED-DURATION",SPLICE_INSERT=5,MIN_DURATION_OFFSET=5;function isValidScte35DateRange(e){return!(!e[PLANNED_DURATION_TAG$1]||!e.message&&!e[SCTE35_OUT_TAG$1]||void 0===e.startTime&&!e[START_DATE_TAG])}var Scte35Manager=function(){function e(t){var r=this;_classCallCheck$3(this,e),_defineProperty$3(this,"_options",void 0),_defineProperty$3(this,"_track",void 0),_defineProperty$3(this,"_startTime",void 0),_defineProperty$3(this,"_adBreakCues",void 0),_defineProperty$3(this,"_activeAdBreak",null),_defineProperty$3(this,"_activeAdBreakStatus","WAITING_PREROLL"),_defineProperty$3(this,"_scte35",new SCTE35_1),_defineProperty$3(this,"_scte35ResultMap",new _Map),_defineProperty$3(this,"_adManager",void 0),_defineProperty$3(this,"_timer",void 0),_defineProperty$3(this,"_handleTimeUpdate",(function(){var e,t,n,o,i;if(null!==(e=r._adBreakCues)&&void 0!==e&&e.length)for(var a=0;a<r._adBreakCues.length;a++){var s=r._adBreakCues[a];if(s.startTime>=r._player.currentTime){n=s;break}}if(n&&(null===(t=r._activeAdBreak)||void 0===t?void 0:t.id)===n.id)if((null===(o=r._activeAdBreak)||void 0===o?void 0:o.startDate)!==n.startDate)switch(r._activeAdBreakStatus){case"REQUESTED":r._changeActiveAdBreakStatus("REQUESTED",n);break;case"ERROR":case"COMPLETE":r._changeActiveAdBreakStatus("READY",null)}else(null===(i=r._activeAdBreak)||void 0===i?void 0:i.startTime)!==n.startTime&&r._changeActiveAdBreakStatus(r._activeAdBreakStatus,n);r._tryToPlayAd(),r._tryToRequestAd(n)})),_defineProperty$3(this,"_onReady",(function(){r._changeActiveAdBreakStatus("READY",null),r._player.off(AD_ERROR,r._onReady),r._player.off(AD_ALL_COMPLETED,r._onReady),r._player.on(TIME_UPDATE,r._handleTimeUpdate),r._player.on(AD_ALL_COMPLETED,r._onAdComplete),r._player.on(AD_ERROR,r._onAdError),r._handleTimeUpdate()})),_defineProperty$3(this,"_onAdComplete",(function(){r._changeActiveAdBreakStatus("COMPLETE",r._activeAdBreak)})),_defineProperty$3(this,"_onAdError",(function(){var e,t;null===(e=r._player)||void 0===e||null===(e=e.media)||void 0===e||null===(e=e.style)||void 0===e||e.setProperty("visibility",""),null===(t=r._adManager)||void 0===t||t.destroy(),r._adManager=null,r._changeActiveAdBreakStatus("ERROR",r._activeAdBreak)})),_defineProperty$3(this,"_handleHlsCoreEvent",(function(e){var t=e.eventName,n=e.playlist;if("core.hlslevelloaded"===t){var o;if(null!=n&&null!==(o=n.segments)&&void 0!==o&&o.length&&0===r._player.currentTime){var i,a=_createForOfIteratorHelper(n.segments);try{for(a.s();!(i=a.n()).done;){var s=i.value;if(0===s.start){r._startTime=new Date(s.dataTime).getTime();break}}}catch(e){a.e(e)}finally{a.f()}}null!=n&&n.dateRanges&&r._startTime&&r._updateAdBreakCues(n.dateRanges)}})),_defineProperty$3(this,"_onAddTrack",(function(e){var t=e.track;"metadata"===(null==t?void 0:t.kind)&&(t.mode="hidden",r._track=t,sniffer.os.isIos?r.loopCues():(r._onCuechange(),r._track.addEventListener("cuechange",r._onCuechange)))})),_defineProperty$3(this,"loopCues",(function(){r._onCuechange(),r._timer=_setTimeout(r.loopCues,2e3)})),_defineProperty$3(this,"_onCuechange",(function(){for(var e,t={},n=(null===(e=r._track)||void 0===e?void 0:e.cues)||[],o=0;o<n.length;){var i,a=n[o];if((null===(i=a.value)||void 0===i?void 0:i.key)===PLANNED_DURATION_TAG$1){var s,l=o+1<n.length?n[o+1]:null;if((null==l||null===(s=l.value)||void 0===s?void 0:s.key)===SCTE35_OUT_TAG$1&&(null==l?void 0:l.startTime)===a.startTime){var c,u,p=r._getScte35Result(null===(c=l.value)||void 0===c?void 0:c.data),f=String((null==p?void 0:p.spliceCommand).spliceEventId);t[f]=_defineProperty$3({ID:f,startTime:l.startTime,message:p},PLANNED_DURATION_TAG$1,null===(u=a.value)||void 0===u?void 0:u.data),o+=2}else o++}else o++}r._updateAdBreakCues(t)})),this._options=t,this._adManager=this._options.adManager,this._init()}var t,r,n;return _createClass$3(e,[{key:"_player",get:function(){return this._options.player}},{key:"_adTagUrl",get:function(){return this._options.adTagUrl}},{key:"_mediaElement",get:function(){return this._player.media}},{key:"destroy",value:function(){var e,t;null===(e=this._track)||void 0===e||e.removeEventListener("cuechange",this._onCuechange),this._track=void 0,clearTimeout(this._timer),this._timer=null,null===(t=this._mediaElement)||void 0===t||null===(t=t.textTracks)||void 0===t||t.removeEventListener("addtrack",this._onAddTrack),this._player.off("core_event",this._handleHlsCoreEvent),this._player.off(TIME_UPDATE,this._handleTimeUpdate),this._player.off(IMA_AD_COMPLETE,this._onAdComplete),this._player.off(IMA_AD_ERROR,this._onAdError)}},{key:"_init",value:function(){var e;null===(e=this._mediaElement)||void 0===e||null===(e=e.textTracks)||void 0===e||e.addEventListener("addtrack",this._onAddTrack),this._player.on("core_event",this._handleHlsCoreEvent);var t=this._adManager.config,r=t.adsRequest,n=t.adsResponse,o=t.adTagUrl;r||n||o?(this._player.once(AD_ERROR,this._onReady),this._player.once(AD_ALL_COMPLETED,this._onReady)):this._onReady()}},{key:"_changeActiveAdBreakStatus",value:function(e,t){this._activeAdBreakStatus=e,this._activeAdBreak=t}},{key:"_tryToRequestAd",value:(n=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(t){var r;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return");case 2:if("WAITING_PREROLL"!==this._activeAdBreakStatus){e.next=4;break}return e.abrupt("return");case 4:if("STARTED"!==this._activeAdBreakStatus){e.next=6;break}return e.abrupt("return");case 6:if(t.id!==(null===(r=this._activeAdBreak)||void 0===r?void 0:r.id)){e.next=8;break}return e.abrupt("return");case 8:return this._changeActiveAdBreakStatus("REQUESTED",t),e.next=11,this._generateOrUpdateManager(this._adManager);case 11:this._adManager=e.sent;case 12:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"_tryToPlayAd",value:function(){!this._activeAdBreak||this._activeAdBreak.startTime>this._player.currentTime||("ERROR"!==this._activeAdBreakStatus?"REQUESTED"===this._activeAdBreakStatus&&(this._changeActiveAdBreakStatus("STARTED",this._activeAdBreak),this._playLoopAds(this._adManager,this._activeAdBreak.duration)):this._changeActiveAdBreakStatus("READY",null))}},{key:"_generateOrUpdateManager",value:(r=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(t){var r;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=6;break}return e.next=3,this._player.plugins.ad._initImaAd();case 3:r=e.sent,e.next=8;break;case 6:(r=t).reset();case 8:return r.updateConfig({adTagUrl:this._adTagUrl}),r.requestAds(),e.abrupt("return",r);case 11:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"_playLoopAds",value:(t=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(t,r){var n,o=this,i=arguments;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=i.length>2&&void 0!==i[2]&&i[2],t.playAds(),t.once(IMA_CONTENT_RESUME_REQUESTED,(function(){o._player.media.style.setProperty("visibility","")})),t.adsManager.addEventListener(google.ima.AdEvent.Type.STARTED,(function(e){var o,i=null==e||null===(o=e.getAd().data)||void 0===o?void 0:o.duration;n&&r&&r<i&&_setTimeout((function(){var e;null===(e=t)||void 0===e||null===(e=e.adsManager)||void 0===e||e.stop()}),1e3*r)})),t.adsManager.addEventListener(google.ima.AdEvent.Type.MIDPOINT,function(){var e=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(n){var i,a,s,l,c,u,p;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c=null==n||null===(i=n.getAd().data)||void 0===i?void 0:i.duration,u=r-c,!(c&&null!==(a=o._options.replayForSCTE35)&&void 0!==a&&a.enable&&u>0&&u>(null!==(s=null===(l=o._options.replayForSCTE35)||void 0===l?void 0:l.minDurationOffset)&&void 0!==s?s:MIN_DURATION_OFFSET))){e.next=8;break}return e.next=5,o._generateOrUpdateManager();case 5:return(p=e.sent)&&(t.resumeCallback=function(){var e;return o._player.plugins.ad.uiManager.hideAdUI(),o._player.media.style.setProperty("visibility","hidden"),null===(e=t)||void 0===e||e.destroy(),t=null,o._playLoopAds(p,u,!0),{canResume:!1}}),e.abrupt("return");case 8:o._adManager=t;case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 5:case"end":return e.stop()}}),e)}))),function(e,r){return t.apply(this,arguments)})},{key:"_getScte35Result",value:function(e){if(!this._scte35ResultMap.has(e))try{this._scte35ResultMap.set(e,this._scte35.parseFromHex(e))}catch(e){}if(!this._scte35ResultMap.has(e))try{this._scte35ResultMap.set(e,this._scte35.parseFromB64(e))}catch(e){}return this._scte35ResultMap.get(e)}},{key:"_updateAdBreakCues",value:function(e){var t,r,n=this;this._adBreakCues=_sortInstanceProperty(t=_reduceInstanceProperty(r=_Object$keys(e)).call(r,(function(t,r){var o=e[r];if(isValidScte35DateRange(o)){var i=o.message||n._getScte35Result(o[SCTE35_OUT_TAG$1]);(null==i?void 0:i.spliceCommandType)===SPLICE_INSERT&&t.push({data:i,id:o.ID,startTime:o.startTime||(new Date(o[START_DATE_TAG]).getTime()-n._startTime)/1e3,duration:_parseFloat$1(o[PLANNED_DURATION_TAG$1]||"0"),startDate:o[START_DATE_TAG]})}return t}),[])).call(t,(function(e,t){return e.startTime-t.startTime}))}}]),e}();function scheduleToVmap(e){var t,r;if(e&&e.length){var n=document.implementation.createDocument("http://www.iab.net/videosuite/vmap","vmap:VMAP"),o=n.getElementsByTagName("vmap:VMAP");o[0].setAttribute("version","1.0");var i,a=0,s=0;return _forEachInstanceProperty(t=_sortInstanceProperty(r=_filterInstanceProperty(e).call(e,(function(e){var t=e.offset;return"pre"===t||"post"===t||/^(\d\d):([0-5]\d):([0-5]\d)(.\d\d\d)?$/.test(t)}))).call(r,(function(e,t){return"pre"===e.offset||"post"===t.offset?-1:"post"===e.offset||"pre"===t.offset?1:Date.parse("2024-01-01T".concat(e.offset))<Date.parse("2024-01-01T".concat(t.offset))?-1:1}))).call(t,(function(e){var t,r,l,c=e.offset,u=e.type,p=e.tag;switch(c){case"pre":r="start",l="preroll";break;case"post":r="end",l="postroll";break;default:r=c,i!==c?(i=c,s=1,l="midroll-".concat(++a)):(s++,l="midroll-".concat(a))}var f=n.createElement("vmap:AdBreak");f.setAttribute("timeOffset",r),f.setAttribute("breakId",l),f.setAttribute("breakType",u||"linear"),o[0].appendChild(f);var d=n.createElement("vmap:AdSource");d.setAttribute("id",_concatInstanceProperty(t="".concat(l,"-ad-")).call(t,s)),d.setAttribute("allowMultipleAds","true"),d.setAttribute("followRedirects","true"),f.appendChild(d);var h=n.createElement("vmap:AdTagURI");h.setAttribute("templateType","vast3"),d.appendChild(h),h.innerHTML="<![CDATA[ ".concat(p," ]]>")})),(new XMLSerializer).serializeToString(n)}}var DESCRIPTORS=descriptors$2,uncurryThis=functionUncurryThis,objectKeys=objectKeys$4,toIndexedObject=toIndexedObject$c,$propertyIsEnumerable=objectPropertyIsEnumerable.f,propertyIsEnumerable3=uncurryThis($propertyIsEnumerable),push2=uncurryThis([].push),createMethod=function(e){return function(t){for(var r,n=toIndexedObject(t),o=objectKeys(n),i=o.length,a=0,s=[];i>a;)r=o[a++],DESCRIPTORS&&!propertyIsEnumerable3(n,r)||push2(s,e?[r,n[r]]:n[r]);return s}},objectToArray={entries:createMethod(!0),values:createMethod(!1)},$$3=_export,$values=objectToArray.values;$$3({target:"Object",stat:!0},{values:function(e){return $values(e)}});var path$3=path$y,values$5=path$3.Object.values,parent$b=values$5,values$4=parent$b,parent$a=values$4,values$3=parent$a,parent$9=values$3,values$2=parent$9,values$1=values$2,values3=values$1,_Object$values=getDefaultExportFromCjs(values3),SCTE35_OUT_TAG="SCTE35-OUT",BREAK_ID="X-BREAK-ID",AD_ID="X-AD-ID",PLANNED_DURATION_TAG="PLANNED-DURATION";function isPrerollAd(e){var t;return 0===(null==e||null===(t=e.getAdPodInfo())||void 0===t?void 0:t.getTimeOffset())}function getType(e){switch(e){case SCTE35_OUT_TAG:return"SCTE35";case AD_ID:case BREAK_ID:return"SSAI";default:return}}function splitCuesByStartTime(e){var t,r=[],n={},o=void 0;function i(){var e,o,i=_Object$values(n);i.length&&(r.push({startTime:null==i||null===(e=i[0])||void 0===e?void 0:e.startTime,ad:n,type:t,idWithSlate:null==i||null===(o=i[0])||void 0===o?void 0:o.id}),t="")}for(var a=0;a<e.length;a++){var s=e[a];if(s.startTime===o){var l,c,u;if(getType(null==s||null===(l=s.value)||void 0===l?void 0:l.key))t=getType(null==s||null===(u=s.value)||void 0===u?void 0:u.key);null!=s&&null!==(c=s.value)&&void 0!==c&&c.key&&(n[s.value.key]=s)}else{var p;i(),null!=s&&null!==(p=s.value)&&void 0!==p&&p.key&&(n=_defineProperty$3({},s.value.key,s)),o=s.startTime}}return i(),r}var index_min="",plugin="";function _arrayWithHoles(e){if(_Array$isArray$1(e))return e}function _iterableToArrayLimit(e,t){var r=null==e?null:void 0!==_Symbol$1&&_getIteratorMethod$1(e)||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],l=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(_pushInstanceProperty(s).call(s,n.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}var $$2=_export,$entries=objectToArray.entries;$$2({target:"Object",stat:!0},{entries:function(e){return $entries(e)}});var path$2=path$y,entries$5=path$2.Object.entries,parent$8=entries$5,entries$4=parent$8,parent$7=entries$4,entries$3=parent$7,parent$6=entries$3,entries$2=parent$6,entries$1=entries$2,entries3=entries$1,_Object$entries2=getDefaultExportFromCjs(entries3);function ownKeys2(e,t){var r=_Object$keys$1(e);if(_Object$getOwnPropertySymbols$1){var n=_Object$getOwnPropertySymbols$1(e);t&&(n=_filterInstanceProperty$1(n).call(n,(function(t){return _Object$getOwnPropertyDescriptor$1(e,t).enumerable}))),_pushInstanceProperty(r).apply(r,n)}return r}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var r,n,o=null!=arguments[t]?arguments[t]:{};t%2?_forEachInstanceProperty$1(r=ownKeys2(Object(o),!0)).call(r,(function(t){_defineProperty$3(e,t,o[t])})):_Object$getOwnPropertyDescriptors$1?_Object$defineProperties$1(e,_Object$getOwnPropertyDescriptors$1(o)):_forEachInstanceProperty$1(n=ownKeys2(Object(o))).call(n,(function(t){_Object$defineProperty$1(e,t,_Object$getOwnPropertyDescriptor$1(o,t))}))}return e}var _AdEvents,BaseServerSideAdManager=_createClass$3((function e(t){_classCallCheck$3(this,e),_defineProperty$3(this,"_player",void 0),_defineProperty$3(this,"_emitAdEvent",void 0),this._player=t.player,this._emitAdEvent=t.emitAdEvent})),BaseServerSideAd=_createClass$3((function e(){_classCallCheck$3(this,e)})),TrackEvents=function(e){return e.START="start",e.FIRST_QUARTILE="firstQuartile",e.MIDPOINT="midpoint",e.THIRD_QUARTILE="thirdQuartile",e.COMPLETE="complete",e.CLICK="click",e.IMPRESSION="impression",e.RESUME="resume",e.PAUSE="pause",e.ERROR="error",e}(TrackEvents||{}),XGEvents=_objectSpread2(_objectSpread2({},XGAdEvents),{},{AD_FIRST_QUARTILE:"ad_first_quartile",AD_MIDPOINT:"ad_midpoint",AD_THIRD_QUARTILE:"ad_third_quartile",AD_CLICK:"ad_click",AD_IMPRESSION:"ad_impression",AD_RESUME:"ad_resume"}),AdEvents=(_defineProperty$3(_AdEvents={},"start",XGEvents.AD_START),_defineProperty$3(_AdEvents,"firstQuartile",XGEvents.AD_FIRST_QUARTILE),_defineProperty$3(_AdEvents,"midpoint",XGEvents.AD_MIDPOINT),_defineProperty$3(_AdEvents,"thirdQuartile",XGEvents.AD_THIRD_QUARTILE),_defineProperty$3(_AdEvents,"complete",XGEvents.AD_COMPLETE),_defineProperty$3(_AdEvents,"click",XGEvents.AD_CLICK),_defineProperty$3(_AdEvents,"impression",XGEvents.AD_IMPRESSION),_defineProperty$3(_AdEvents,"resume",XGEvents.AD_RESUME),_defineProperty$3(_AdEvents,"pause",XGEvents.AD_PAUSE),_defineProperty$3(_AdEvents,"error",XGEvents.AD_ERROR),_AdEvents),AdState=function(e){return e.START="start",e.FIRST_QUARTILE="firstQuartile",e.MIDPOINT="midpoint",e.THIRD_QUARTILE="thirdQuartile",e.COMPLETE="complete",e}(AdState||{}),ServerSideAd=function(e){_inherits$2(r,BaseServerSideAd);var t=_createSuper$2(r);function r(e,n,o,i){var a,s,l,c,u,p;_classCallCheck$3(this,r),_defineProperty$3(_assertThisInitialized$2(p=t.call(this)),"_ad",void 0),_defineProperty$3(_assertThisInitialized$2(p),"_parsedVast",void 0),_defineProperty$3(_assertThisInitialized$2(p),"_skipOffset",void 0),_defineProperty$3(_assertThisInitialized$2(p),"_trackingEvents",void 0),_defineProperty$3(_assertThisInitialized$2(p),"_videoClickThrough",void 0),_defineProperty$3(_assertThisInitialized$2(p),"_videoClickTracking",void 0),_defineProperty$3(_assertThisInitialized$2(p),"_impressionTracking",void 0),_defineProperty$3(_assertThisInitialized$2(p),"_errorTracking",void 0),_defineProperty$3(_assertThisInitialized$2(p),"_state",void 0),_defineProperty$3(_assertThisInitialized$2(p),"_player",void 0),_defineProperty$3(_assertThisInitialized$2(p),"_type",void 0),_defineProperty$3(_assertThisInitialized$2(p),"_breakId",void 0),p._ad=e,p._breakId=n,p._player=i,p._parsedVast=o;var f=null===(a=p._parsedVast)||void 0===a?void 0:_findInstanceProperty(s=a.ads).call(s,(function(e){return e.creatives.length>0})),d=null==f||null===(l=f.creatives)||void 0===l?void 0:_findInstanceProperty(l).call(l,(function(e){return null==e?void 0:e.mediaFiles}));return p._skipOffset=null==d?void 0:d.skipDelay,p._trackingEvents=null==d?void 0:d.trackingEvents,p._type=null==d?void 0:d.type,p._videoClickTracking=null==d||null===(c=d.videoClickTrackingURLTemplates)||void 0===c?void 0:_mapInstanceProperty(c).call(c,(function(e){return e.url})),p._videoClickThrough=null==d?void 0:d.videoClickThroughURLTemplate,p._impressionTracking=null==f||null===(u=f.impressionURLTemplates)||void 0===u?void 0:_mapInstanceProperty(u).call(u,(function(e){return e.url})),p._errorTracking=null==f?void 0:f.errorURLTemplates,p}return _createClass$3(r,[{key:"trackingEvents",get:function(){var e;return _objectSpread2(_objectSpread2({},this._trackingEvents),{},(_defineProperty$3(e={},TrackEvents.CLICK,this._videoClickTracking),_defineProperty$3(e,TrackEvents.IMPRESSION,this._impressionTracking),_defineProperty$3(e,TrackEvents.ERROR,this._errorTracking),e))}},{key:"errorTracking",get:function(){return this._errorTracking}},{key:"isLinear",value:function(){return"linear"===this._type}},{key:"getVideoClickThrough",value:function(){var e;return null===(e=this._videoClickThrough)||void 0===e?void 0:e.url}},{key:"getStartTime",value:function(){return this._ad.startTime}},{key:"getSkipOffset",value:function(){return this._skipOffset}},{key:"getDuration",value:function(){return this._ad.duration}},{key:"getAdId",value:function(){return this._ad.id}},{key:"isSlate",value:function(){var e;return!!this._ad.idWithSlate&&"slate"===(null===(e=this._ad.idWithSlate)||void 0===e?void 0:e.split("-"))[0]}},{key:"getBreakId",value:function(){return this._breakId}},{key:"getState",value:function(){return this._state}},{key:"setState",value:function(e){this._state=e}},{key:"isSkippable",value:function(){return"number"==typeof this.getSkipOffset()}},{key:"getSkipTimeOffset",value:function(){if(this.isSkippable()){var e=this.getSkipOffset();if("number"==typeof e){var t=this.getRemainingTime()+e-this.getDuration();return Math.max(t,0)}}}},{key:"canSkip",value:function(){return 0==this.getSkipTimeOffset()}},{key:"skip",value:function(){this._player&&(this._player.currentTime=this._player.currentTime+this.getRemainingTime())}},{key:"click",value:function(){var e,t;null!==(e=this._videoClickThrough)&&void 0!==e&&e.url&&window.open(null===(t=this._videoClickThrough)||void 0===t?void 0:t.url,"_blank")}},{key:"canClick",value:function(){var e;return!(null===(e=this._videoClickThrough)||void 0===e||!e.url)}},{key:"getRemainingTime",value:function(){var e;return this._ad.startTime+this._ad.duration-(null===(e=this._player)||void 0===e||null===(e=e.media)||void 0===e?void 0:e.currentTime)}}]),r}();function _arrayWithoutHoles(e){if(_Array$isArray$1(e))return _arrayLikeToArray(e)}function _iterableToArray(e){if(void 0!==_Symbol$1&&null!=_getIteratorMethod$1(e)||null!=e["@@iterator"])return _Array$from$1(e)}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 _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}var $$1=_export,fails=fails$B,getOwnPropertyNames$6=objectGetOwnPropertyNamesExternal.f,FAILS_ON_PRIMITIVES=fails((function(){return!Object.getOwnPropertyNames(1)}));$$1({target:"Object",stat:!0,forced:FAILS_ON_PRIMITIVES},{getOwnPropertyNames:getOwnPropertyNames$6});var path$1=path$y,Object$1=path$1.Object,getOwnPropertyNames$5=function(e){return Object$1.getOwnPropertyNames(e)},parent$5=getOwnPropertyNames$5,getOwnPropertyNames$4=parent$5,parent$4=getOwnPropertyNames$4,getOwnPropertyNames$3=parent$4,parent$3=getOwnPropertyNames$3,getOwnPropertyNames$2=parent$3,getOwnPropertyNames$1=getOwnPropertyNames$2,getOwnPropertyNames5=getOwnPropertyNames$1,_Object$getOwnPropertyNames=getDefaultExportFromCjs(getOwnPropertyNames5),global$1=global$s,globalIsFinite=global$1.isFinite,numberIsFinite$1=Number.isFinite||function(e){return"number"==typeof e&&globalIsFinite(e)},$=_export,numberIsFinite=numberIsFinite$1;$({target:"Number",stat:!0},{isFinite:numberIsFinite});var path=path$y,_isFinite$5=path.Number.isFinite,parent$2=_isFinite$5,_isFinite$4=parent$2,parent$1=_isFinite$4,_isFinite$3=parent$1,parent=_isFinite$3,_isFinite$2=parent,_isFinite$1=_isFinite$2,_isFinite=_isFinite$1,_Number$isFinite=getDefaultExportFromCjs(_isFinite);function e(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{id:e.id||null,adId:e.adId||null,sequence:e.sequence||null,apiFramework:e.apiFramework||null,universalAdIds:[],creativeExtensions:[]}}var t=["ADCATEGORIES","ADCOUNT","ADPLAYHEAD","ADSERVINGID","ADTYPE","APIFRAMEWORKS","APPBUNDLE","ASSETURI","BLOCKEDADCATEGORIES","BREAKMAXADLENGTH","BREAKMAXADS","BREAKMAXDURATION","BREAKMINADLENGTH","BREAKMINDURATION","BREAKPOSITION","CLICKPOS","CLICKTYPE","CLIENTUA","CONTENTID","CONTENTPLAYHEAD","CONTENTURI","DEVICEIP","DEVICEUA","DOMAIN","EXTENSIONS","GDPRCONSENT","IFA","IFATYPE","INVENTORYSTATE","LATLONG","LIMITADTRACKING","MEDIAMIME","MEDIAPLAYHEAD","OMIDPARTNER","PAGEURL","PLACEMENTTYPE","PLAYERCAPABILITIES","PLAYERSIZE","PLAYERSTATE","PODSEQUENCE","REGULATIONS","SERVERSIDE","SERVERUA","TRANSACTIONID","UNIVERSALADID","VASTVERSIONS","VERIFICATIONVENDORS"];function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=[],o=s(e);for(var a in!t.ERRORCODE||r.isCustomCode||/^[0-9]{3}$/.test(t.ERRORCODE)||(t.ERRORCODE=900),t.CACHEBUSTING=d(Math.round(1e8*Math.random())),t.TIMESTAMP=(new Date).toISOString(),t.RANDOM=t.random=t.CACHEBUSTING,t)t[a]=c(t[a]);for(var l in o){var u=o[l];"string"==typeof u&&n.push(i(u,t))}return n}function i(e,r){var n=(e=a(e,r)).match(/[^[\]]+(?=])/g);if(!n)return e;var o=_filterInstanceProperty(n).call(n,(function(e){return _indexOfInstanceProperty(t).call(t,e)>-1}));return 0===o.length?e:a(e,o=_reduceInstanceProperty(o).call(o,(function(e,t){return e[t]=-1,e}),{}))}function a(e,t){var r=e;for(var n in t){var o=t[n];r=r.replace(new RegExp("(?:\\[|%%)(".concat(n,")(?:\\]|%%)"),"g"),o)}return r}function s(e){return _Array$isArray(e)?_mapInstanceProperty(e).call(e,(function(e){return e&&e.hasOwnProperty("url")?e.url:e})):e}function n(e){return/^(https?:\/\/|\/\/)/.test(e)}function o(e,t){for(var r=0;r<t.length;r++)if(l(t[r],e))return!0;return!1}function l(e,t){if(e&&t){var r=_Object$getOwnPropertyNames(e),n=_Object$getOwnPropertyNames(t);return r.length===n.length&&e.id===t.id&&e.url===t.url}return!1}function c(e){return encodeURIComponent(e).replace(/[!'()*]/g,(function(e){return"%".concat(e.charCodeAt(0).toString(16))}))}function d(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return _padStartInstanceProperty(t=e.toString()).call(t,r,"0")}var u={track:function(e,t,n){var o;_forEachInstanceProperty(o=r(e,t,n)).call(o,(function(e){"undefined"!=typeof window&&null!==window&&((new Image).src=e)}))},resolveURLTemplates:r,extractURLsFromTemplates:s,filterUrlTemplates:function(e){return _reduceInstanceProperty(e).call(e,(function(e,t){var r=t.url||t;return n(r)?e.validUrls.push(r):e.invalidUrls.push(r),e}),{validUrls:[],invalidUrls:[]})},containsTemplateObject:o,isTemplateObjectEqual:l,encodeURIComponentRFC3986:c,replaceUrlMacros:i,isNumeric:function(e){return!isNaN(_parseFloat$1(e))&&isFinite(e)},flatten:function e(t){return _reduceInstanceProperty(t).call(t,(function(t,r){return _concatInstanceProperty(t).call(t,_Array$isArray(r)?e(r):r)}),[])},joinArrayOfUniqueTemplateObjs:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=_Array$isArray(t)?t:[],i=_Array$isArray(r)?r:[];return _reduceInstanceProperty(e=_concatInstanceProperty(n).call(n,i)).call(e,(function(e,t){return o(t,e)||e.push(t),e}),[])},isValidTimeValue:function(e){return _Number$isFinite(e)&&e>=-2},addLeadingZeros:d,isValidUrl:n,isBrowserEnvironment:function(){return"undefined"!=typeof window},formatMacrosValues:function(e){return"object"!=_typeof$3(e)?e:_JSON$stringify(e)}};function h(e){var t;return _includesInstanceProperty(t=["true","TRUE","True","1"]).call(t,e)}function p(e){if(null==e)return-1;if(u.isNumeric(e))return _parseInt$1(e);var t=e.split(":");if(3!==t.length)return-1;var r=t[2].split("."),n=_parseInt$1(r[0]);2===r.length&&(n+=_parseFloat$1("0.".concat(r[1])));var o=_parseInt$1(60*t[1]),i=_parseInt$1(60*t[0]*60);return isNaN(i)||isNaN(o)||isNaN(n)||o>3600||n>60?-1:i+o+n}var m={childByName:function(e,t){var r;return _findInstanceProperty(r=_Array$from(e.childNodes)).call(r,(function(e){return e.nodeName===t}))},childrenByName:function(e,t){var r;return _filterInstanceProperty(r=_Array$from(e.childNodes)).call(r,(function(e){return e.nodeName===t}))},resolveVastAdTagURI:function(e,t){if(!t)return e;if(_startsWithInstanceProperty(e).call(e,"//")){var r,n=location.protocol;return _concatInstanceProperty(r="".concat(n)).call(r,e)}if(!_includesInstanceProperty(e).call(e,"://")){var o,i=_sliceInstanceProperty(t).call(t,0,_lastIndexOfInstanceProperty(t).call(t,"/"));return _concatInstanceProperty(o="".concat(i,"/")).call(o,e)}return e},parseBoolean:h,parseNodeText:function(e){var t;return e&&_trimInstanceProperty(t=e.textContent||e.text||"").call(t)},copyNodeAttribute:function(e,t,r){var n=t.getAttribute(e);n&&r.setAttribute(e,n)},parseAttributes:function(e){var t;return _reduceInstanceProperty(t=_Array$from(e.attributes)).call(t,(function(e,t){return e[t.nodeName]=t.nodeValue,e}),{})},parseDuration:p,splitVAST:function(e){var t=[],r=null;return _forEachInstanceProperty(e).call(e,(function(n,o){if(n.sequence&&(n.sequence=_parseInt$1(n.sequence,10)),n.sequence>1){var i=e[o-1];if(i&&i.sequence===n.sequence-1)return void(r&&r.push(n));delete n.sequence}r=[n],t.push(r)})),t},assignAttributes:function(e,t){var r;e&&_forEachInstanceProperty(r=_Array$from(e)).call(r,(function(e){var r=e.nodeName,n=e.nodeValue;if(r&&n&&t.hasOwnProperty(r)){var o=n;"boolean"==typeof t[r]&&(o=h(o)),t[r]=o}}))},mergeWrapperAdData:function(e,t){var r,n,o,i,a,s,l,c,p;e.errorURLTemplates=_concatInstanceProperty(r=t.errorURLTemplates).call(r,e.errorURLTemplates),e.impressionURLTemplates=_concatInstanceProperty(n=t.impressionURLTemplates).call(n,e.impressionURLTemplates),e.extensions=_concatInstanceProperty(o=t.extensions).call(o,e.extensions),t.viewableImpression.length>0&&(e.viewableImpression=_concatInstanceProperty(i=[]).call(i,_toConsumableArray(e.viewableImpression),_toConsumableArray(t.viewableImpression))),e.followAdditionalWrappers=t.followAdditionalWrappers,e.allowMultipleAds=t.allowMultipleAds,e.fallbackOnNoAd=t.fallbackOnNoAd;var f=_filterInstanceProperty(a=t.creatives||[]).call(a,(function(e){return e&&"companion"===e.type})),d=_reduceInstanceProperty(f).call(f,(function(e,t){var r;return _forEachInstanceProperty(r=t.variations||[]).call(r,(function(t){var r;_forEachInstanceProperty(r=t.companionClickTrackingURLTemplates||[]).call(r,(function(t){u.containsTemplateObject(t,e)||e.push(t)}))})),e}),[]);e.creatives=_concatInstanceProperty(f).call(f,e.creatives);var h=t.videoClickTrackingURLTemplates&&t.videoClickTrackingURLTemplates.length,$=t.videoCustomClickURLTemplates&&t.videoCustomClickURLTemplates.length;if(_forEachInstanceProperty(s=e.creatives).call(s,(function(e){var r,n,o;if(t.trackingEvents&&t.trackingEvents[e.type])for(var i in t.trackingEvents[e.type]){var a,s=t.trackingEvents[e.type][i];_Array$isArray(e.trackingEvents[i])||(e.trackingEvents[i]=[]),e.trackingEvents[i]=_concatInstanceProperty(a=e.trackingEvents[i]).call(a,s)}"linear"===e.type&&(h&&(e.videoClickTrackingURLTemplates=_concatInstanceProperty(r=e.videoClickTrackingURLTemplates).call(r,t.videoClickTrackingURLTemplates)),$&&(e.videoCustomClickURLTemplates=_concatInstanceProperty(n=e.videoCustomClickURLTemplates).call(n,t.videoCustomClickURLTemplates)),!t.videoClickThroughURLTemplate||null!==e.videoClickThroughURLTemplate&&void 0!==e.videoClickThroughURLTemplate||(e.videoClickThroughURLTemplate=t.videoClickThroughURLTemplate)),"companion"===e.type&&d.length&&_forEachInstanceProperty(o=e.variations||[]).call(o,(function(e){e.companionClickTrackingURLTemplates=u.joinArrayOfUniqueTemplateObjs(e.companionClickTrackingURLTemplates,d)}))})),t.adVerifications&&(e.adVerifications=_concatInstanceProperty(l=e.adVerifications).call(l,t.adVerifications)),t.blockedAdCategories&&(e.blockedAdCategories=_concatInstanceProperty(c=e.blockedAdCategories).call(c,t.blockedAdCategories)),null!==(p=t.creatives)&&void 0!==p&&p.length){var y,g,v=_filterInstanceProperty(y=t.creatives).call(y,(function(e){var t;return(null===(t=e.icons)||void 0===t?void 0:t.length)&&!e.mediaFiles.length}));v.length&&(e.creatives=_concatInstanceProperty(g=e.creatives).call(g,v))}}};function g(t,r){var n,o=function(){var t=e(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{});return{id:t.id,adId:t.adId,sequence:t.sequence,apiFramework:t.apiFramework,type:"companion",required:null,variations:[]}}(r);return o.required=t.getAttribute("required")||null,o.variations=_mapInstanceProperty(n=m.childrenByName(t,"Companion")).call(n,(function(e){var t,r,n,o,i,a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{id:e.id||null,adType:"companionAd",width:e.width||0,height:e.height||0,assetWidth:e.assetWidth||null,assetHeight:e.assetHeight||null,expandedWidth:e.expandedWidth||null,expandedHeight:e.expandedHeight||null,apiFramework:e.apiFramework||null,adSlotId:e.adSlotId||null,pxratio:e.pxratio||"1",renderingMode:e.renderingMode||"default",staticResources:[],htmlResources:[],iframeResources:[],adParameters:null,altText:null,companionClickThroughURLTemplate:null,companionClickTrackingURLTemplates:[],trackingEvents:{}}}(m.parseAttributes(e));a.htmlResources=_reduceInstanceProperty(t=m.childrenByName(e,"HTMLResource")).call(t,(function(e,t){var r=m.parseNodeText(t);return r?_concatInstanceProperty(e).call(e,r):e}),[]),a.iframeResources=_reduceInstanceProperty(r=m.childrenByName(e,"IFrameResource")).call(r,(function(e,t){var r=m.parseNodeText(t);return r?_concatInstanceProperty(e).call(e,r):e}),[]),a.staticResources=_reduceInstanceProperty(n=m.childrenByName(e,"StaticResource")).call(n,(function(e,t){var r=m.parseNodeText(t);return r?_concatInstanceProperty(e).call(e,{url:r,creativeType:t.getAttribute("creativeType")||null}):e}),[]),a.altText=m.parseNodeText(m.childByName(e,"AltText"))||null;var s=m.childByName(e,"TrackingEvents");s&&_forEachInstanceProperty(o=m.childrenByName(s,"Tracking")).call(o,(function(e){var t=e.getAttribute("event"),r=m.parseNodeText(e);t&&r&&(_Array$isArray(a.trackingEvents[t])||(a.trackingEvents[t]=[]),a.trackingEvents[t].push(r))})),a.companionClickTrackingURLTemplates=_mapInstanceProperty(i=m.childrenByName(e,"CompanionClickTracking")).call(i,(function(e){return{id:e.getAttribute("id")||null,url:m.parseNodeText(e)}})),a.companionClickThroughURLTemplate=m.parseNodeText(m.childByName(e,"CompanionClickThrough"))||null;var l=m.childByName(e,"AdParameters");return l&&(a.adParameters={value:m.parseNodeText(l),xmlEncoded:l.getAttribute("xmlEncoded")||null}),a})),o}function v(t,r){var n,o,i,a,s=function(){var t=e(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{});return{id:t.id,adId:t.adId,sequence:t.sequence,apiFramework:t.apiFramework,type:"linear",duration:0,skipDelay:null,mediaFiles:[],mezzanine:null,interactiveCreativeFile:null,closedCaptionFiles:[],videoClickThroughURLTemplate:null,videoClickTrackingURLTemplates:[],videoCustomClickURLTemplates:[],adParameters:null,icons:[],trackingEvents:{}}}(r);s.duration=m.parseDuration(m.parseNodeText(m.childByName(t,"Duration")));var l=t.getAttribute("skipoffset");if(null==l)s.skipDelay=null;else if("%"===l.charAt(l.length-1)&&-1!==s.duration){var c=_parseInt$1(l,10);s.skipDelay=s.duration*(c/100)}else s.skipDelay=m.parseDuration(l);var u=m.childByName(t,"VideoClicks");if(u){var p,f,d=m.childByName(u,"ClickThrough");s.videoClickThroughURLTemplate=d?{id:d.getAttribute("id")||null,url:m.parseNodeText(d)}:null,_forEachInstanceProperty(p=m.childrenByName(u,"ClickTracking")).call(p,(function(e){s.videoClickTrackingURLTemplates.push({id:e.getAttribute("id")||null,url:m.parseNodeText(e)})})),_forEachInstanceProperty(f=m.childrenByName(u,"CustomClick")).call(f,(function(e){s.videoCustomClickURLTemplates.push({id:e.getAttribute("id")||null,url:m.parseNodeText(e)})}))}var h=m.childByName(t,"AdParameters");h&&(s.adParameters={value:m.parseNodeText(h),xmlEncoded:h.getAttribute("xmlEncoded")||null}),_forEachInstanceProperty(n=m.childrenByName(t,"TrackingEvents")).call(n,(function(e){var t;_forEachInstanceProperty(t=m.childrenByName(e,"Tracking")).call(t,(function(e){var t=e.getAttribute("event"),r=m.parseNodeText(e);if(t&&r){if("progress"===t){if(!(a=e.getAttribute("offset")))return;t="%"===a.charAt(a.length-1)?"progress-".concat(a):"progress-".concat(Math.round(m.parseDuration(a)))}_Array$isArray(s.trackingEvents[t])||(s.trackingEvents[t]=[]),s.trackingEvents[t].push(r)}}))})),_forEachInstanceProperty(o=m.childrenByName(t,"MediaFiles")).call(o,(function(e){var t,r;_forEachInstanceProperty(t=m.childrenByName(e,"MediaFile")).call(t,(function(e){s.mediaFiles.push(function(e){var t={id:null,fileURL:null,fileSize:0,deliveryType:"progressive",mimeType:null,mediaType:null,codec:null,bitrate:0,minBitrate:0,maxBitrate:0,width:0,height:0,apiFramework:null,scalable:null,maintainAspectRatio:null};t.id=e.getAttribute("id"),t.fileURL=m.parseNodeText(e),t.deliveryType=e.getAttribute("delivery"),t.codec=e.getAttribute("codec"),t.mimeType=e.getAttribute("type"),t.mediaType=e.getAttribute("mediaType")||"2D",t.apiFramework=e.getAttribute("apiFramework"),t.fileSize=_parseInt$1(e.getAttribute("fileSize")||0),t.bitrate=_parseInt$1(e.getAttribute("bitrate")||0),t.minBitrate=_parseInt$1(e.getAttribute("minBitrate")||0),t.maxBitrate=_parseInt$1(e.getAttribute("maxBitrate")||0),t.width=_parseInt$1(e.getAttribute("width")||0),t.height=_parseInt$1(e.getAttribute("height")||0);var r=e.getAttribute("scalable");r&&"string"==typeof r&&(t.scalable=m.parseBoolean(r));var n=e.getAttribute("maintainAspectRatio");return n&&"string"==typeof n&&(t.maintainAspectRatio=m.parseBoolean(n)),t}(e))}));var n,o,i=m.childByName(e,"InteractiveCreativeFile");i&&(s.interactiveCreativeFile=(n=i,o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:e.type||null,apiFramework:e.apiFramework||null,variableDuration:m.parseBoolean(e.variableDuration),fileURL:null}}(m.parseAttributes(n)),o.fileURL=m.parseNodeText(n),o));var a=m.childByName(e,"ClosedCaptionFiles");a&&_forEachInstanceProperty(r=m.childrenByName(a,"ClosedCaptionFile")).call(r,(function(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:e.type||null,language:e.language||null,fileURL:null}}(m.parseAttributes(e));t.fileURL=m.parseNodeText(e),s.closedCaptionFiles.push(t)}));var l=m.childByName(e,"Mezzanine"),c=function(e,t){var r={},n=!1;return _forEachInstanceProperty(t).call(t,(function(t){e&&e.getAttribute(t)?r[t]=e.getAttribute(t):n=!0})),n?null:r}(l,["delivery","type","width","height"]);if(c){var u={id:null,fileURL:null,delivery:null,codec:null,type:null,width:0,height:0,fileSize:0,mediaType:"2D"};u.id=l.getAttribute("id"),u.fileURL=m.parseNodeText(l),u.delivery=c.delivery,u.codec=l.getAttribute("codec"),u.type=c.type,u.width=_parseInt$1(c.width,10),u.height=_parseInt$1(c.height,10),u.fileSize=_parseInt$1(l.getAttribute("fileSize"),10),u.mediaType=l.getAttribute("mediaType")||"2D",s.mezzanine=u}}));var $=m.childByName(t,"Icons");return $&&_forEachInstanceProperty(i=m.childrenByName($,"Icon")).call(i,(function(e){s.icons.push(function(e,t,r,n){var o,i,a={program:null,height:0,width:0,xPosition:0,yPosition:0,apiFramework:null,offset:null,duration:0,type:null,staticResource:null,htmlResource:null,iframeResource:null,pxratio:"1",iconClickThroughURLTemplate:null,iconClickTrackingURLTemplates:[],iconViewTrackingURLTemplate:null,iconClickFallbackImages:[]};a.program=e.getAttribute("program"),a.height=_parseInt$1(e.getAttribute("height")||0),a.width=_parseInt$1(e.getAttribute("width")||0),a.xPosition=(o=e.getAttribute("xPosition"),-1!==_indexOfInstanceProperty(i=["left","right"]).call(i,o)?o:_parseInt$1(o||0)),a.yPosition=function(e,t){return-1!==_indexOfInstanceProperty(t=["top","bottom"]).call(t,e)?e:_parseInt$1(e||0)}(e.getAttribute("yPosition")),a.apiFramework=e.getAttribute("apiFramework"),a.pxratio=e.getAttribute("pxratio")||"1",a.offset=m.parseDuration(e.getAttribute("offset")),a.duration=m.parseDuration(e.getAttribute("duration")),_forEachInstanceProperty(t=m.childrenByName(e,"HTMLResource")).call(t,(function(e){a.type=e.getAttribute("creativeType")||"text/html",a.htmlResource=m.parseNodeText(e)})),_forEachInstanceProperty(r=m.childrenByName(e,"IFrameResource")).call(r,(function(e){a.type=e.getAttribute("creativeType")||0,a.iframeResource=m.parseNodeText(e)})),_forEachInstanceProperty(n=m.childrenByName(e,"StaticResource")).call(n,(function(e){a.type=e.getAttribute("creativeType")||0,a.staticResource=m.parseNodeText(e)}));var s=m.childByName(e,"IconClicks");if(s){var l,c;a.iconClickThroughURLTemplate=m.parseNodeText(m.childByName(s,"IconClickThrough")),_forEachInstanceProperty(l=m.childrenByName(s,"IconClickTracking")).call(l,(function(e){a.iconClickTrackingURLTemplates.push({id:e.getAttribute("id")||null,url:m.parseNodeText(e)})}));var u=m.childByName(s,"IconClickFallbackImages");u&&_forEachInstanceProperty(c=m.childrenByName(u,"IconClickFallbackImage")).call(c,(function(e){a.iconClickFallbackImages.push({url:m.parseNodeText(e)||null,width:e.getAttribute("width")||null,height:e.getAttribute("height")||null})}))}return a.iconViewTrackingURLTemplate=m.parseNodeText(m.childByName(e,"IconViewTracking")),a}(e))})),s}function f(t,r){var n,o,i=function(){var t=e(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{});return{id:t.id,adId:t.adId,sequence:t.sequence,apiFramework:t.apiFramework,type:"nonlinear",variations:[],trackingEvents:{}}}(r);return _forEachInstanceProperty(n=m.childrenByName(t,"TrackingEvents")).call(n,(function(e){var t,r,n;_forEachInstanceProperty(t=m.childrenByName(e,"Tracking")).call(t,(function(e){r=e.getAttribute("event"),n=m.parseNodeText(e),r&&n&&(_Array$isArray(i.trackingEvents[r])||(i.trackingEvents[r]=[]),i.trackingEvents[r].push(n))}))})),_forEachInstanceProperty(o=m.childrenByName(t,"NonLinear")).call(o,(function(e){var t,r,n,o,a={id:null,width:0,height:0,expandedWidth:0,expandedHeight:0,scalable:!0,maintainAspectRatio:!0,minSuggestedDuration:0,apiFramework:"static",adType:"nonLinearAd",type:null,staticResource:null,htmlResource:null,iframeResource:null,nonlinearClickThroughURLTemplate:null,nonlinearClickTrackingURLTemplates:[],adParameters:null};a.id=e.getAttribute("id")||null,a.width=e.getAttribute("width"),a.height=e.getAttribute("height"),a.expandedWidth=e.getAttribute("expandedWidth"),a.expandedHeight=e.getAttribute("expandedHeight"),a.scalable=m.parseBoolean(e.getAttribute("scalable")),a.maintainAspectRatio=m.parseBoolean(e.getAttribute("maintainAspectRatio")),a.minSuggestedDuration=m.parseDuration(e.getAttribute("minSuggestedDuration")),a.apiFramework=e.getAttribute("apiFramework"),_forEachInstanceProperty(t=m.childrenByName(e,"HTMLResource")).call(t,(function(e){a.type=e.getAttribute("creativeType")||"text/html",a.htmlResource=m.parseNodeText(e)})),_forEachInstanceProperty(r=m.childrenByName(e,"IFrameResource")).call(r,(function(e){a.type=e.getAttribute("creativeType")||0,a.iframeResource=m.parseNodeText(e)})),_forEachInstanceProperty(n=m.childrenByName(e,"StaticResource")).call(n,(function(e){a.type=e.getAttribute("creativeType")||0,a.staticResource=m.parseNodeText(e)}));var s=m.childByName(e,"AdParameters");s&&(a.adParameters={value:m.parseNodeText(s),xmlEncoded:s.getAttribute("xmlEncoded")||null}),a.nonlinearClickThroughURLTemplate=m.parseNodeText(m.childByName(e,"NonLinearClickThrough")),_forEachInstanceProperty(o=m.childrenByName(e,"NonLinearClickTracking")).call(o,(function(e){a.nonlinearClickTrackingURLTemplates.push({id:e.getAttribute("id")||null,url:m.parseNodeText(e)})})),i.variations.push(a)})),i}function T(e){var t=[];return _forEachInstanceProperty(e).call(e,(function(e){var r=A(e);r&&t.push(r)})),t}function A(e){var t;if("#comment"===e.nodeName)return null;var r,n={name:null,value:null,attributes:{},children:[]},o=e.attributes,i=e.childNodes;if(n.name=e.nodeName,e.attributes)for(var a in o)if(o.hasOwnProperty(a)){var s=o[a];s.nodeName&&s.nodeValue&&(n.attributes[s.nodeName]=s.nodeValue)}for(var l in i)if(i.hasOwnProperty(l)){var c=A(i[l]);c&&n.children.push(c)}if(0===n.children.length||1===n.children.length&&_indexOfInstanceProperty(t=["#cdata-section","#text"]).call(t,n.children[0].name)>=0){var u=m.parseNodeText(e);""!==u&&(n.value=u),n.children=[]}return null===(r=n).value&&0===_Object$keys(r.attributes).length&&0===r.children.length?null:n}function R(e){return e.getAttribute("AdID")||e.getAttribute("adID")||e.getAttribute("adId")||null}var y={Wrapper:{subElements:["VASTAdTagURI","Impression"]},BlockedAdCategories:{attributes:["authority"]},InLine:{subElements:["AdSystem","AdTitle","Impression","AdServingId","Creatives"]},Category:{attributes:["authority"]},Pricing:{attributes:["model","currency"]},Verification:{oneOfinLineResources:["JavaScriptResource","ExecutableResource"],attributes:["vendor"]},UniversalAdId:{attributes:["idRegistry"]},JavaScriptResource:{attributes:["apiFramework","browserOptional"]},ExecutableResource:{attributes:["apiFramework","type"]},Tracking:{attributes:["event"]},Creatives:{subElements:["Creative"]},Creative:{subElements:["UniversalAdId"]},Linear:{subElements:["MediaFiles","Duration"]},MediaFiles:{subElements:["MediaFile"]},MediaFile:{attributes:["delivery","type","width","height"]},Mezzanine:{attributes:["delivery","type","width","height"]},NonLinear:{oneOfinLineResources:["StaticResource","IFrameResource","HTMLResource"],attributes:["width","height"]},Companion:{oneOfinLineResources:["StaticResource","IFrameResource","HTMLResource"],attributes:["width","height"]},StaticResource:{attributes:["creativeType"]},Icons:{subElements:["Icon"]},Icon:{oneOfinLineResources:["StaticResource","IFrameResource","HTMLResource"]}};function k(e,t){var r;if(y[e.nodeName]&&y[e.nodeName].attributes){var n=_filterInstanceProperty(r=y[e.nodeName].attributes).call(r,(function(t){return!e.getAttribute(t)}));n.length>0&&N({name:e.nodeName,parentName:e.parentNode.nodeName,attributes:n},t)}}function E(e,t,r){var n,o=y[e.nodeName],i=!r&&"Wrapper"!==e.nodeName;if(o&&!i){if(o.subElements){var a,s=_filterInstanceProperty(a=o.subElements).call(a,(function(t){return!m.childByName(e,t)}));s.length>0&&N({name:e.nodeName,parentName:e.parentNode.nodeName,subElements:s},t)}r&&o.oneOfinLineResources&&(_someInstanceProperty(n=o.oneOfinLineResources).call(n,(function(t){return m.childByName(e,t)}))||N({name:e.nodeName,parentName:e.parentNode.nodeName,oneOfResources:o.oneOfinLineResources},t))}}function b(e){return e.children&&0!==e.children.length}function N(e,t){var r=e.name,n=e.parentName,o=e.attributes,i=e.subElements,a=e.oneOfResources,s="Element '".concat(r,"'");t("VAST-warning",{message:s+=o?" missing required attribute(s) '".concat(o.join(", "),"' "):i?" missing required sub element(s) '".concat(i.join(", "),"' "):a?" must provide one of the following '".concat(a.join(", "),"' "):" is empty",parentElement:n,specVersion:4.1})}var w={verifyRequiredValues:function e(t,r,n){if(t&&t.nodeName)if("InLine"===t.nodeName&&(n=!0),k(t,r),b(t)){E(t,r,n);for(var o=0;o<t.children.length;o++)e(t.children[o],r,n)}else 0===m.parseNodeText(t).length&&N({name:t.nodeName,parentName:t.parentNode.nodeName},r)},hasSubElements:b,emitMissingValueWarning:N,verifyRequiredAttributes:k,verifyRequiredSubElements:E};function L(e,t){var r,n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=o.allowMultipleAds,a=o.followAdditionalWrappers,s=_createForOfIteratorHelper(_filterInstanceProperty(r=_Array$from(e.childNodes)).call(r,(function(e){var t=e.nodeName.toLowerCase();return"inline"===t||!1!==a&&"wrapper"===t})));try{for(s.s();!(n=s.n()).done;){var l=n.value;if(m.copyNodeAttribute("id",e,l),m.copyNodeAttribute("sequence",e,l),m.copyNodeAttribute("adType",e,l),"Wrapper"===l.nodeName)return{ad:I(l,t),type:"WRAPPER"};if("InLine"===l.nodeName)return{ad:C(l,t,{allowMultipleAds:i}),type:"INLINE"};var c=l.nodeName.toLowerCase();t("VAST-warning",{message:"<".concat(l.nodeName,"inline"===c?"> must be written <InLine>":"> must be written <Wrapper>"),wrongNode:l})}}catch(e){s.e(e)}finally{s.f()}}function C(e,t){return!1===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).allowMultipleAds&&e.getAttribute("sequence")?null:U(e,t)}function U(e,t){var r,n=[];t&&w.verifyRequiredValues(e,t);var o=_Array$from(e.childNodes),i=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{id:e.id||null,sequence:e.sequence||null,adType:e.adType||null,adServingId:null,categories:[],expires:null,viewableImpression:[],system:null,title:null,description:null,advertiser:null,pricing:null,survey:null,errorURLTemplates:[],impressionURLTemplates:[],creatives:[],extensions:[],adVerifications:[],blockedAdCategories:[],followAdditionalWrappers:!0,allowMultipleAds:!1,fallbackOnNoAd:null}}(m.parseAttributes(e));return _forEachInstanceProperty(o).call(o,(function(e){switch(e.nodeName){case"Error":i.errorURLTemplates.push(m.parseNodeText(e));break;case"Impression":i.impressionURLTemplates.push({id:e.getAttribute("id")||null,url:m.parseNodeText(e)});break;case"Creatives":i.creatives=(r=m.childrenByName(e,"Creative"),o=[],_forEachInstanceProperty(r).call(r,(function(e){var t,r,n={id:e.getAttribute("id")||null,adId:R(e),sequence:e.getAttribute("sequence")||null,apiFramework:e.getAttribute("apiFramework")||null},i=[];_forEachInstanceProperty(t=m.childrenByName(e,"UniversalAdId")).call(t,(function(e){var t={idRegistry:e.getAttribute("idRegistry")||"unknown",value:m.parseNodeText(e)};i.push(t)}));var a=m.childByName(e,"CreativeExtensions");for(var s in a&&(r=T(m.childrenByName(a,"CreativeExtension"))),e.childNodes){var l=e.childNodes[s],c=void 0;switch(l.nodeName){case"Linear":c=v(l,n);break;case"NonLinearAds":c=f(l,n);break;case"CompanionAds":c=g(l,n)}c&&(i&&(c.universalAdIds=i),r&&(c.creativeExtensions=r),o.push(c))}})),o);break;case"Extensions":var t=m.childrenByName(e,"Extension");i.extensions=T(t),i.adVerifications.length||(n=function(e){var t=null,r=[];return _someInstanceProperty(e).call(e,(function(e){return t=m.childByName(e,"AdVerifications")})),t&&(r=x(m.childrenByName(t,"Verification"))),r}(t));break;case"AdVerifications":i.adVerifications=x(m.childrenByName(e,"Verification"));break;case"AdSystem":i.system={value:m.parseNodeText(e),version:e.getAttribute("version")||null};break;case"AdTitle":i.title=m.parseNodeText(e);break;case"AdServingId":i.adServingId=m.parseNodeText(e);break;case"Category":i.categories.push({authority:e.getAttribute("authority")||null,value:m.parseNodeText(e)});break;case"Expires":i.expires=_parseInt$1(m.parseNodeText(e),10);break;case"ViewableImpression":i.viewableImpression.push(function(e,t,r,n){var o=function(e,t){var r=m.parseNodeText(t);return r&&e.push(r),e};return{id:e.getAttribute("id")||null,viewable:_reduceInstanceProperty(t=m.childrenByName(e,"Viewable")).call(t,o,[]),notViewable:_reduceInstanceProperty(r=m.childrenByName(e,"NotViewable")).call(r,o,[]),viewUndetermined:_reduceInstanceProperty(n=m.childrenByName(e,"ViewUndetermined")).call(n,o,[])}}(e));break;case"Description":i.description=m.parseNodeText(e);break;case"Advertiser":i.advertiser={id:e.getAttribute("id")||null,value:m.parseNodeText(e)};break;case"Pricing":i.pricing={value:m.parseNodeText(e),model:e.getAttribute("model")||null,currency:e.getAttribute("currency")||null};break;case"Survey":i.survey={value:m.parseNodeText(e),type:e.getAttribute("type")||null};break;case"BlockedAdCategories":i.blockedAdCategories.push({authority:e.getAttribute("authority")||null,value:m.parseNodeText(e)})}var r,o})),n.length&&(i.adVerifications=_concatInstanceProperty(r=i.adVerifications).call(r,n)),i}function I(e,t){var r,n=U(e,t),o=e.getAttribute("followAdditionalWrappers"),i=e.getAttribute("allowMultipleAds"),a=e.getAttribute("fallbackOnNoAd");n.followAdditionalWrappers=!o||m.parseBoolean(o),n.allowMultipleAds=!!i&&m.parseBoolean(i),n.fallbackOnNoAd=a?m.parseBoolean(a):null;var s=m.childByName(e,"VASTAdTagURI");if(s?n.nextWrapperURL=m.parseNodeText(s):(s=m.childByName(e,"VASTAdTagURL"))&&(n.nextWrapperURL=m.parseNodeText(m.childByName(s,"URL"))),_forEachInstanceProperty(r=n.creatives).call(r,(function(e){var t;if(_includesInstanceProperty(t=["linear","nonlinear"]).call(t,e.type)){var r,o;if(e.trackingEvents){n.trackingEvents||(n.trackingEvents={}),n.trackingEvents[e.type]||(n.trackingEvents[e.type]={});var i=function(t){var r=e.trackingEvents[t];_Array$isArray(n.trackingEvents[e.type][t])||(n.trackingEvents[e.type][t]=[]),_forEachInstanceProperty(r).call(r,(function(r){n.trackingEvents[e.type][t].push(r)}))};for(var a in e.trackingEvents)i(a)}e.videoClickTrackingURLTemplates&&(_Array$isArray(n.videoClickTrackingURLTemplates)||(n.videoClickTrackingURLTemplates=[]),_forEachInstanceProperty(r=e.videoClickTrackingURLTemplates).call(r,(function(e){n.videoClickTrackingURLTemplates.push(e)}))),e.videoClickThroughURLTemplate&&(n.videoClickThroughURLTemplate=e.videoClickThroughURLTemplate),e.videoCustomClickURLTemplates&&(_Array$isArray(n.videoCustomClickURLTemplates)||(n.videoCustomClickURLTemplates=[]),_forEachInstanceProperty(o=e.videoCustomClickURLTemplates).call(o,(function(e){n.videoCustomClickURLTemplates.push(e)})))}})),n.nextWrapperURL)return n}function x(e){var t=[];return _forEachInstanceProperty(e).call(e,(function(e){var r,n={resource:null,vendor:null,browserOptional:!1,apiFramework:null,type:null,parameters:null,trackingEvents:{}},o=_Array$from(e.childNodes);m.assignAttributes(e.attributes,n),_forEachInstanceProperty(o).call(o,(function(e){var t=e.nodeName,r=e.textContent,o=e.attributes;switch(t){case"JavaScriptResource":case"ExecutableResource":n.resource=_trimInstanceProperty(r).call(r),m.assignAttributes(o,n);break;case"VerificationParameters":n.parameters=_trimInstanceProperty(r).call(r)}}));var i=m.childByName(e,"TrackingEvents");i&&_forEachInstanceProperty(r=m.childrenByName(i,"Tracking")).call(r,(function(e){var t=e.getAttribute("event"),r=m.parseNodeText(e);t&&r&&(_Array$isArray(n.trackingEvents[t])||(n.trackingEvents[t]=[]),n.trackingEvents[t].push(r))})),t.push(n)})),t}var S=function(){function e(){_classCallCheck$3(this,e),this._handlers=[]}return _createClass$3(e,[{key:"on",value:function(e,t){if("function"!=typeof t)throw new TypeError("The handler argument must be of type Function. Received type ".concat(_typeof$3(t)));if(!e)throw new TypeError("The event argument must be of type String. Received type ".concat(_typeof$3(e)));return this._handlers.push({event:e,handler:t}),this}},{key:"once",value:function(e,t){return this.on(e,function(e,t,r){var n={fired:!1,wrapFn:void 0};function o(){n.fired||(e.off(t,n.wrapFn),n.fired=!0,_bindInstanceProperty(r).call(r,e).apply(void 0,arguments))}return n.wrapFn=o,o}(this,e,t))}},{key:"off",value:function(e,t){var r;return this._handlers=_filterInstanceProperty(r=this._handlers).call(r,(function(r){return r.event!==e||r.handler!==t})),this}},{key:"emit",value:function(e){for(var t,r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];var i=!1;return _forEachInstanceProperty(t=this._handlers).call(t,(function(t){var r;"*"===t.event&&(i=!0,t.handler.apply(t,_concatInstanceProperty(r=[e]).call(r,n))),t.event===e&&(i=!0,t.handler.apply(t,n))})),i}},{key:"removeAllListeners",value:function(e){var t;return e?(this._handlers=_filterInstanceProperty(t=this._handlers).call(t,(function(t){return t.event!==e})),this):(this._handlers=[],this)}},{key:"listenerCount",value:function(e){var t;return _filterInstanceProperty(t=this._handlers).call(t,(function(t){return t.event===e})).length}},{key:"listeners",value:function(e){var t;return _reduceInstanceProperty(t=this._handlers).call(t,(function(t,r){return r.event===e&&t.push(r.handler),t}),[])}},{key:"eventNames",value:function(){var e;return _mapInstanceProperty(e=this._handlers).call(e,(function(e){return e.event}))}}]),e}(),D=0,V=0,O=function(e,t){!e||!t||e<=0||t<=0||(V=(V*D+8*e/t)/++D)},F={ERRORCODE:900,extensions:[]},B="VAST response version not supported",P=function(e){_inherits$2(r,S);var t=_createSuper$2(r);function r(){var e;_classCallCheck$3(this,r);var n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).fetcher;return(e=t.call(this)).maxWrapperDepth=null,e.rootErrorURLTemplates=[],e.errorURLTemplates=[],e.remainingAds=[],e.parsingOptions={},e.fetcher=n||null,e}return _createClass$3(r,[{key:"trackVastError",value:function(e,t){for(var r,n=arguments.length,o=new Array(n>2?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];this.emit("VAST-error",_Object$assign.apply(Object,_concatInstanceProperty(r=[{},F,t]).call(r,o))),u.track(e,t)}},{key:"getErrorURLTemplates",value:function(){var e;return _concatInstanceProperty(e=this.rootErrorURLTemplates).call(e,this.errorURLTemplates)}},{key:"getEstimatedBitrate",value:function(){return V}},{key:"initParsingStatus",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.maxWrapperDepth=e.wrapperLimit||10,this.parsingOptions={allowMultipleAds:e.allowMultipleAds},this.rootURL="",this.resetParsingStatus(),O(e.byteLength,e.requestDuration)}},{key:"resetParsingStatus",value:function(){this.errorURLTemplates=[],this.rootErrorURLTemplates=[],this.vastVersion=null}},{key:"getRemainingAds",value:function(e){var t=this;if(0===this.remainingAds.length)return _Promise.reject(new Error("No more ads are available for the given VAST"));var r=e?u.flatten(this.remainingAds):this.remainingAds.shift();return this.errorURLTemplates=[],this.resolveAds(r,{wrapperDepth:0,url:this.rootURL}).then((function(e){return t.buildVASTResponse(e)}))}},{key:"parseVAST",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.initParsingStatus(r),r.isRootVAST=!0,this.parse(e,r).then((function(e){return t.buildVASTResponse(e)}))}},{key:"buildVASTResponse",value:function(e){var t,r={ads:(t={ads:e,errorURLTemplates:this.getErrorURLTemplates(),version:this.vastVersion}).ads||[],errorURLTemplates:t.errorURLTemplates||[],version:t.version||null};return this.completeWrapperResolving(r),r}},{key:"parseVastXml",value:function(e,t){var r=t.isRootVAST,n=void 0!==r&&r,o=t.url,i=void 0===o?null:o,a=t.wrapperDepth,s=void 0===a?0:a,l=t.allowMultipleAds,c=t.followAdditionalWrappers;if(!e||!e.documentElement||"VAST"!==e.documentElement.nodeName){var u;this.emit("VAST-ad-parsed",{type:"ERROR",url:i,wrapperDepth:s});var p="VideoAdServingTemplate"===(null==e||null===(u=e.documentElement)||void 0===u?void 0:u.nodeName);throw new Error(p?B:"Invalid VAST XMLDocument")}var f=[],d=e.documentElement.childNodes,h=e.documentElement.getAttribute("version");for(var $ in n&&h&&(this.vastVersion=h),d){var y=d[$];if("Error"===y.nodeName){var g=m.parseNodeText(y);n?this.rootErrorURLTemplates.push(g):this.errorURLTemplates.push(g)}else if("Ad"===y.nodeName){var v;if(this.vastVersion&&_parseFloat$1(this.vastVersion)<3)l=!0;else if(!1===l&&f.length>1)break;var _=L(y,_bindInstanceProperty(v=this.emit).call(v,this),{allowMultipleAds:l,followAdditionalWrappers:c});_.ad?(f.push(_.ad),this.emit("VAST-ad-parsed",{type:_.type,url:i,wrapperDepth:s,adIndex:f.length-1,vastVersion:h})):this.trackVastError(this.getErrorURLTemplates(),{ERRORCODE:101})}}return f}},{key:"parse",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.url,n=void 0===r?null:r,o=t.resolveAll,i=void 0===o||o,a=t.wrapperSequence,s=void 0===a?null:a,l=t.previousUrl,c=void 0===l?null:l,u=t.wrapperDepth,p=void 0===u?0:u,f=t.isRootVAST,d=void 0!==f&&f,h=t.followAdditionalWrappers,$=t.allowMultipleAds,y=[];this.vastVersion&&_parseFloat$1(this.vastVersion)<3&&d&&($=!0);try{y=this.parseVastXml(e,{isRootVAST:d,url:n,wrapperDepth:p,allowMultipleAds:$,followAdditionalWrappers:h})}catch(e){return _Promise.reject(e)}return 1===y.length&&null!=s&&(y[0].sequence=s),!1===i&&(this.remainingAds=m.splitVAST(y),y=this.remainingAds.shift()),this.resolveAds(y,{wrapperDepth:p,previousUrl:c,url:n})}},{key:"resolveAds",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1?arguments[1]:void 0,n=r.wrapperDepth,o=r.previousUrl,i=r.url,a=[];return o=i,_forEachInstanceProperty(t).call(t,(function(t){var r=e.resolveWrappers(t,n,o);a.push(r)})),_Promise.all(a).then((function(e){return u.flatten(e)}))}},{key:"resolveWrappers",value:function(e,t,r){var n=this,o=_objectSpread2({},e);return new _Promise((function(e){var i,a;if(t++,!o.nextWrapperURL)return delete o.nextWrapperURL,e(o);if(!n.fetcher)return o.VASTAdTagURI=o.nextWrapperURL,delete o.nextWrapperURL,e(o);if(t>=n.maxWrapperDepth)return o.errorCode=302,delete o.nextWrapperURL,e(o);o.nextWrapperURL=m.resolveVastAdTagURI(o.nextWrapperURL,r);var s=null!==(a=n.parsingOptions.allowMultipleAds)&&void 0!==a?a:o.allowMultipleAds,l=o.sequence;n.fetcher.fetchVAST({url:o.nextWrapperURL,emitter:_bindInstanceProperty(i=n.emit).call(i,n),maxWrapperDepth:n.maxWrapperDepth}).then((function(i){return n.parse(i,{url:o.nextWrapperURL,previousUrl:r,wrapperSequence:l,wrapperDepth:t,followAdditionalWrappers:o.followAdditionalWrappers,allowMultipleAds:s}).then((function(t){if(delete o.nextWrapperURL,0===t.length)return o.creatives=[],e(o);_forEachInstanceProperty(t).call(t,(function(e){e&&m.mergeWrapperAdData(e,o)})),e(t)}))})).catch((function(t){o.errorCode=t.message===B?102:301,o.errorMessage=t.message,e(o)}))}))}},{key:"completeWrapperResolving",value:function(e){if(0===e.ads.length)this.trackVastError(e.errorURLTemplates,{ERRORCODE:303});else for(var t=e.ads.length-1;t>=0;t--){var r,n,o,i=e.ads[t],a=!_someInstanceProperty(r=i.creatives).call(r,(function(e){var t;return(null===(t=e.mediaFiles)||void 0===t?void 0:t.length)>0}));!i.errorCode&&!a||i.VASTAdTagURI||(this.trackVastError(_concatInstanceProperty(n=i.errorURLTemplates).call(n,e.errorURLTemplates),{ERRORCODE:i.errorCode||303},{ERRORMESSAGE:i.errorMessage||""},{extensions:i.extensions},{system:i.system}),_spliceInstanceProperty(o=e.ads).call(o,t,1))}}}]),r}(),z=function(e){_inherits$2(r,S);var t=_createSuper$2(r);function r(e,n,o){var i;_classCallCheck$3(this,r);var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];for(var l in(i=t.call(this)).ad=n,i.creative=o,i.variation=a,i.muted=s,i.impressed=!1,i.skippable=!1,i.trackingEvents={},i.lastPercentage=0,i._alreadyTriggeredQuartiles={},i.emitAlwaysEvents=["creativeView","start","firstQuartile","midpoint","thirdQuartile","complete","resume","pause","rewind","skip","closeLinear","close"],i.creative.trackingEvents){var c=i.creative.trackingEvents[l];i.trackingEvents[l]=_sliceInstanceProperty(c).call(c,0)}return"linear"!==i.creative.type?i._initVariationTracking():i._initLinearTracking(),e&&i.on("start",(function(){e.lastSuccessfulAd=_Date$now()})),i}return _createClass$3(r,[{key:"_initLinearTracking",value:function(){this.linear=!0,this.skipDelay=this.creative.skipDelay,this.setDuration(this.creative.duration),this.clickThroughURLTemplate=this.creative.videoClickThroughURLTemplate,this.clickTrackingURLTemplates=this.creative.videoClickTrackingURLTemplates}},{key:"_initVariationTracking",value:function(){if(this.linear=!1,this.skipDelay=-1,this.variation){for(var e in this.variation.trackingEvents){var t,r=this.variation.trackingEvents[e];this.trackingEvents[e]?this.trackingEvents[e]=_concatInstanceProperty(t=this.trackingEvents[e]).call(t,_sliceInstanceProperty(r).call(r,0)):this.trackingEvents[e]=_sliceInstanceProperty(r).call(r,0)}"nonLinearAd"===this.variation.adType?(this.clickThroughURLTemplate=this.variation.nonlinearClickThroughURLTemplate,this.clickTrackingURLTemplates=this.variation.nonlinearClickTrackingURLTemplates,this.setDuration(this.variation.minSuggestedDuration)):"companionAd"===this.variation.adType&&(this.clickThroughURLTemplate=this.variation.companionClickThroughURLTemplate,this.clickTrackingURLTemplates=this.variation.companionClickTrackingURLTemplates)}}},{key:"setDuration",value:function(e){u.isValidTimeValue(e)?(this.assetDuration=e,this.quartiles={firstQuartile:Math.round(25*this.assetDuration)/100,midpoint:Math.round(50*this.assetDuration)/100,thirdQuartile:Math.round(75*this.assetDuration)/100}):this.emit("TRACKER-error",{message:"the duration provided is not valid. duration: ".concat(e)})}},{key:"setProgress",value:function(e){var t,r=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(u.isValidTimeValue(e)&&"object"==_typeof$3(n)){var i=this.skipDelay||-1;if(-1===i||this.skippable||(i>e?this.emit("skip-countdown",i-e):(this.skippable=!0,this.emit("skip-countdown",0))),this.assetDuration>0){var a=Math.round(e/this.assetDuration*100),s=[];if(e>0){s.push("start");for(var l=this.lastPercentage;l<a;l++)s.push("progress-".concat(l+1,"%"));for(var c in s.push("progress-".concat(Math.round(e))),this.quartiles)this.isQuartileReached(c,this.quartiles[c],e)&&(s.push(c),this._alreadyTriggeredQuartiles[c]=!0);this.lastPercentage=a}_forEachInstanceProperty(s).call(s,(function(e){r.track(e,{macros:n,once:o})})),e<this.progress&&this.track("rewind",{macros:n})}this.progress=e}else this.emit("TRACKER-error",{message:_concatInstanceProperty(t="One given setProgress parameter has the wrong type. progress: ".concat(e,", macros: ")).call(t,u.formatMacrosValues(n))})}},{key:"isQuartileReached",value:function(e,t,r){var n=!1;return t<=r&&!this._alreadyTriggeredQuartiles[e]&&(n=!0),n}},{key:"setMuted",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"boolean"==typeof e&&"object"==_typeof$3(r)?(this.muted!==e&&this.track(e?"mute":"unmute",{macros:r}),this.muted=e):this.emit("TRACKER-error",{message:_concatInstanceProperty(t="One given setMuted parameter has the wrong type. muted: ".concat(e,", macros: ")).call(t,u.formatMacrosValues(r))})}},{key:"setPaused",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"boolean"==typeof e&&"object"==_typeof$3(r)?(this.paused!==e&&this.track(e?"pause":"resume",{macros:r}),this.paused=e):this.emit("TRACKER-error",{message:_concatInstanceProperty(t="One given setPaused parameter has the wrong type. paused: ".concat(e,", macros: ")).call(t,u.formatMacrosValues(r))})}},{key:"setFullscreen",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"boolean"==typeof e&&"object"==_typeof$3(r)?(this.fullscreen!==e&&this.track(e?"fullscreen":"exitFullscreen",{macros:r}),this.fullscreen=e):this.emit("TRACKER-error",{message:_concatInstanceProperty(t="One given setFullScreen parameter has the wrong type. fullscreen: ".concat(e,", macros: ")).call(t,u.formatMacrosValues(r))})}},{key:"setExpand",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"boolean"==typeof e&&"object"==_typeof$3(r)?(this.expanded!==e&&(this.track(e?"expand":"collapse",{macros:r}),this.track(e?"playerExpand":"playerCollapse",{macros:r})),this.expanded=e):this.emit("TRACKER-error",{message:_concatInstanceProperty(t="One given setExpand parameter has the wrong type. expanded: ".concat(e,", macros: ")).call(t,u.formatMacrosValues(r))})}},{key:"setSkipDelay",value:function(e){u.isValidTimeValue(e)?this.skipDelay=e:this.emit("TRACKER-error",{message:"setSkipDelay parameter does not have a valid value. duration: ".concat(e)})}},{key:"trackImpression",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"==_typeof$3(e)?this.impressed||(this.impressed=!0,this.trackURLs(this.ad.impressionURLTemplates,e),this.track("creativeView",{macros:e})):this.emit("TRACKER-error",{message:"trackImpression parameter has the wrong type. macros: ".concat(e)})}},{key:"trackViewableImpression",value:function(){var e,t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"==_typeof$3(r)?_forEachInstanceProperty(e=this.ad.viewableImpression).call(e,(function(e){t.trackURLs(e.viewable,r)})):this.emit("TRACKER-error",{message:"trackViewableImpression given macros has the wrong type. macros: ".concat(r)})}},{key:"trackNotViewableImpression",value:function(){var e,t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"==_typeof$3(r)?_forEachInstanceProperty(e=this.ad.viewableImpression).call(e,(function(e){t.trackURLs(e.notViewable,r)})):this.emit("TRACKER-error",{message:"trackNotViewableImpression given macros has the wrong type. macros: ".concat(r)})}},{key:"trackUndeterminedImpression",value:function(){var e,t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"==_typeof$3(r)?_forEachInstanceProperty(e=this.ad.viewableImpression).call(e,(function(e){t.trackURLs(e.viewUndetermined,r)})):this.emit("TRACKER-error",{message:"trackUndeterminedImpression given macros has the wrong type. macros: ".concat(r)})}},{key:"error",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];"object"==_typeof$3(t)&&"boolean"==typeof r?this.trackURLs(this.ad.errorURLTemplates,t,{isCustomCode:r}):this.emit("TRACKER-error",{message:_concatInstanceProperty(e="One given error parameter has the wrong type. macros: ".concat(u.formatMacrosValues(t),", isCustomCode: ")).call(e,r)})}},{key:"errorWithCode",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];"string"==typeof e&&"boolean"==typeof r?(this.error({ERRORCODE:e},r),console.log("The method errorWithCode is deprecated, please use vast tracker error method instead")):this.emit("TRACKER-error",{message:_concatInstanceProperty(t="One given errorWithCode parameter has the wrong type. errorCode: ".concat(e,", isCustomCode: ")).call(t,r)})}},{key:"complete",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"==_typeof$3(e)?this.track("complete",{macros:e}):this.emit("TRACKER-error",{message:"complete given macros has the wrong type. macros: ".concat(e)})}},{key:"notUsed",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"==_typeof$3(e)?(this.track("notUsed",{macros:e}),this.trackingEvents=[]):this.emit("TRACKER-error",{message:"notUsed given macros has the wrong type. macros: ".concat(e)})}},{key:"otherAdInteraction",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"==_typeof$3(e)?this.track("otherAdInteraction",{macros:e}):this.emit("TRACKER-error",{message:"otherAdInteraction given macros has the wrong type. macros: ".concat(e)})}},{key:"acceptInvitation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"==_typeof$3(e)?this.track("acceptInvitation",{macros:e}):this.emit("TRACKER-error",{message:"acceptInvitation given macros has the wrong type. macros: ".concat(e)})}},{key:"adExpand",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"==_typeof$3(e)?this.track("adExpand",{macros:e}):this.emit("TRACKER-error",{message:"adExpand given macros has the wrong type. macros: ".concat(e)})}},{key:"adCollapse",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"==_typeof$3(e)?this.track("adCollapse",{macros:e}):this.emit("TRACKER-error",{message:"adCollapse given macros has the wrong type. macros: ".concat(e)})}},{key:"minimize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"==_typeof$3(e)?this.track("minimize",{macros:e}):this.emit("TRACKER-error",{message:"minimize given macros has the wrong type. macros: ".concat(e)})}},{key:"verificationNotExecuted",value:function(e){var t,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"==typeof e&&"object"==_typeof$3(n)){if(!this.ad||!this.ad.adVerifications||!this.ad.adVerifications.length)throw new Error("No adVerifications provided");if(!e)throw new Error("No vendor provided, unable to find associated verificationNotExecuted");var o=_findInstanceProperty(r=this.ad.adVerifications).call(r,(function(t){return t.vendor===e}));if(!o)throw new Error("No associated verification element found for vendor: ".concat(e));var i=o.trackingEvents;if(i&&i.verificationNotExecuted){var a=i.verificationNotExecuted;this.trackURLs(a,n),this.emit("verificationNotExecuted",{trackingURLTemplates:a})}}else this.emit("TRACKER-error",{message:_concatInstanceProperty(t="One given verificationNotExecuted parameter has to wrong type. vendor: ".concat(e,", macros: ")).call(t,u.formatMacrosValues(n))})}},{key:"overlayViewDuration",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"string"==typeof e&&"object"==_typeof$3(r)?(r.ADPLAYHEAD=e,this.track("overlayViewDuration",{macros:r})):this.emit("TRACKER-error",{message:_concatInstanceProperty(t="One given overlayViewDuration parameters has the wrong type. formattedDuration: ".concat(e,", macros: ")).call(t,u.formatMacrosValues(r))})}},{key:"close",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"==_typeof$3(e)?this.track(this.linear?"closeLinear":"close",{macros:e}):this.emit("TRACKER-error",{message:"close given macros has the wrong type. macros: ".concat(e)})}},{key:"skip",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"==_typeof$3(e)?this.track("skip",{macros:e}):this.emit("TRACKER-error",{message:"skip given macros has the wrong type. macros: ".concat(e)})}},{key:"load",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"==_typeof$3(e)?this.track("loaded",{macros:e}):this.emit("TRACKER-error",{message:"load given macros has the wrong type. macros: ".concat(e)})}},{key:"click",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null!==t&&"string"!=typeof t||"object"!=_typeof$3(r))this.emit("TRACKER-error",{message:_concatInstanceProperty(e="One given click parameter has the wrong type. fallbackClickThroughURL: ".concat(t,", macros: ")).call(e,u.formatMacrosValues(r))});else{this.clickTrackingURLTemplates&&this.clickTrackingURLTemplates.length&&this.trackURLs(this.clickTrackingURLTemplates,r);var n=this.clickThroughURLTemplate||t,o=_objectSpread2({},r);if(n){this.progress&&(o.ADPLAYHEAD=this.progressFormatted());var i=u.resolveURLTemplates([n],o)[0];this.emit("clickthrough",i)}}}},{key:"track",value:function(e){var t,r,n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=o.macros,a=void 0===i?{}:i,s=o.once,l=void 0!==s&&s;if("object"==_typeof$3(a)){"closeLinear"===e&&!this.trackingEvents[e]&&this.trackingEvents.close&&(e="close");var c=this.trackingEvents[e],u=_indexOfInstanceProperty(t=this.emitAlwaysEvents).call(t,e)>-1;c?(this.emit(e,{trackingURLTemplates:c}),this.trackURLs(c,a)):u&&this.emit(e,null),l&&(delete this.trackingEvents[e],u&&_spliceInstanceProperty(r=this.emitAlwaysEvents).call(r,_indexOfInstanceProperty(n=this.emitAlwaysEvents).call(n,e),1))}else this.emit("TRACKER-error",{message:"track given macros has the wrong type. macros: ".concat(a)})}},{key:"trackURLs",value:function(e){var t,r,n,o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=u.filterUrlTemplates(e),l=s.validUrls,c=s.invalidUrls;c.length&&this.emit("TRACKER-error",{message:"Provided urls are malformed. url: ".concat(c)});var p=_objectSpread2({},i);this.linear&&(this.creative&&this.creative.mediaFiles&&this.creative.mediaFiles[0]&&this.creative.mediaFiles[0].fileURL&&(p.ASSETURI=this.creative.mediaFiles[0].fileURL),this.progress&&(p.ADPLAYHEAD=this.progressFormatted())),null!==(o=this.creative)&&void 0!==o&&null!==(o=o.universalAdIds)&&void 0!==o&&o.length&&(p.UNIVERSALADID=_mapInstanceProperty(t=this.creative.universalAdIds).call(t,(function(e){var t;return _concatInstanceProperty(t=e.idRegistry).call(t," ",e.value)})).join(",")),this.ad&&(this.ad.sequence&&(p.PODSEQUENCE=this.ad.sequence),this.ad.adType&&(p.ADTYPE=this.ad.adType),this.ad.adServingId&&(p.ADSERVINGID=this.ad.adServingId),this.ad.categories&&this.ad.categories.length&&(p.ADCATEGORIES=_mapInstanceProperty(r=this.ad.categories).call(r,(function(e){return e.value})).join(",")),this.ad.blockedAdCategories&&this.ad.blockedAdCategories.length&&(p.BLOCKEDADCATEGORIES=_mapInstanceProperty(n=this.ad.blockedAdCategories).call(n,(function(e){return e.value})).join(","))),u.track(l,p,a)}},{key:"convertToTimecode",value:function(e){var t,r,n;if(!u.isValidTimeValue(e))return"";var o=1e3*e,i=Math.floor(o/36e5),a=Math.floor(o/6e4%60),s=Math.floor(o/1e3%60),l=Math.floor(o%1e3);return _concatInstanceProperty(t=_concatInstanceProperty(r=_concatInstanceProperty(n="".concat(u.addLeadingZeros(i,2),":")).call(n,u.addLeadingZeros(a,2),":")).call(r,u.addLeadingZeros(s,2),".")).call(t,u.addLeadingZeros(l,3))}},{key:"progressFormatted",value:function(){return this.convertToTimecode(this.progress)}}]),r}(),vastParser=new P;function parseAd(e){return _parseAd.apply(this,arguments)}function _parseAd(){return(_parseAd=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(t){var r;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new DOMParser,e.abrupt("return",vastParser.parseVAST(r.parseFromString(t,"application/xml")));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function request(e){var t=e.url,r=void 0===t?"":t,n=e.method,o=void 0===n?"GET":n,i=e.type,a=void 0===i?"json":i,s=e.timeout,l=void 0===s?1e4:s,c=e.data,u=void 0===c?{}:c;return new _Promise((function(e,t){var n=new window.XMLHttpRequest,i=o.toUpperCase();if(a&&(n.responseType=a),l&&(n.timeout=l),n.onload=function(){200===n.status?e(n.response):t({res:n,type:"error"})},n.onerror=function(){t({res:n,type:"error"})},n.ontimeout=function(){t({res:n,type:"error"})},n.onabort=function(){t({res:n,type:"error"})},"GET"===i)n.open(i,r),n.send();else{if("post"!==i)throw new Error("xhr ".concat(i," is not supported"));n.open(i,r),n.setRequestHeader("Content-type","application/json"),n.send(_JSON$stringify(u))}}))}var appendSearchParams=function(e,t){var r,n=getUrlObject(e);if(!e||!n)return null!==(r=e)&&void 0!==r?r:"";var o,i=_startsWithInstanceProperty(e).call(e,"//");for(var a in t){var s,l,c=t[a];if(null!=n&&n.searchParams.has(a))null==n||null===(s=n.searchParams)||void 0===s||s.set(a,c);else null==n||null===(l=n.searchParams)||void 0===l||l.append(a,c)}return e=n.toString(),i?null===(o=e)||void 0===o?void 0:o.replace(location.protocol,""):e},getUrlObject=function(e){if(e){_startsWithInstanceProperty(e).call(e,"//")&&(e=location.protocol+e);try{return new _URL(e)}catch(e){return}}},ServerSideAdManager=function(e){_inherits$2(i,BaseServerSideAdManager);var t,r,n,o=_createSuper$2(i);function i(e){var t;return _classCallCheck$3(this,i),_defineProperty$3(_assertThisInitialized$2(t=o.call(this,e)),"ad",void 0),_defineProperty$3(_assertThisInitialized$2(t),"_eventsSent",[]),_defineProperty$3(_assertThisInitialized$2(t),"_track",void 0),_defineProperty$3(_assertThisInitialized$2(t),"_breakCues",void 0),_defineProperty$3(_assertThisInitialized$2(t),"_cues",void 0),_defineProperty$3(_assertThisInitialized$2(t),"_breakInfoMap",{}),_defineProperty$3(_assertThisInitialized$2(t),"_liveSyncDuration",void 0),_defineProperty$3(_assertThisInitialized$2(t),"_liveMaxLatencyDuration",void 0),_defineProperty$3(_assertThisInitialized$2(t),"_timer",void 0),_defineProperty$3(_assertThisInitialized$2(t),"_vastTracker",void 0),_defineProperty$3(_assertThisInitialized$2(t),"_onAddTrack",(function(e){var r=e.track;"metadata"===(null==r?void 0:r.kind)&&(r.mode="hidden",t._track=r,sniffer.os.isIos?t._loopCues():(t._onCuechange(),t._track.addEventListener("cuechange",t._onCuechange)))})),_defineProperty$3(_assertThisInitialized$2(t),"_loopCues",(function(){t._onCuechange(),t._timer=_setTimeout(t._loopCues,2e3)})),_defineProperty$3(_assertThisInitialized$2(t),"_onCuechange",_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(){var r,n,o,i;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(null===(r=t._track)||void 0===r?void 0:r.cues)||[],o=splitCuesByStartTime(n),i=t._transformSSAIAdBreak(null==o?void 0:_filterInstanceProperty(o).call(o,(function(e){return"SSAI"===e.type}))),t._cues=i,e.next=6,_Promise.all(_mapInstanceProperty(i).call(i,function(){var e=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(r){var n,o,i,a;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("Success"!==(null===(n=t._breakInfoMap[r.id])||void 0===n?void 0:n.status)){e.next=2;break}return e.abrupt("return",null===(i=t._breakInfoMap[r.id])||void 0===i?void 0:i.ads);case 2:if("Pending"!==(null===(o=t._breakInfoMap[r.id])||void 0===o?void 0:o.status)){e.next=4;break}return e.abrupt("return");case 4:return e.next=6,t._fetchBreakInfo(r.id);case 6:a=e.sent,t._breakInfoMap[r.id]=a;case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 6:t._breakCues=i;case 7:case"end":return e.stop()}}),e)})))),t._init(),t}return _createClass$3(i,[{key:"skip",value:function(){var e,t,r,n,o,i;null!==(e=this._player)&&void 0!==e&&e.plugins.hls?null==this||null===(r=this.ad)||void 0===r||r.skip():null!==(n=this.ad)&&void 0!==n&&n.getBreakId()&&(null===(o=this._player)||void 0===o||o.switchURL(appendSearchParams(this._player.config.url,{ssai_skip_ad:null===(i=this.ad)||void 0===i?void 0:i.getBreakId()})),this._breakCues=[]);null===(t=this._emitAdEvent)||void 0===t||t.call(this,XGEvents.AD_SKIPPED),this._endAd(!0)}},{key:"onClick",value:function(){var e;return!this.ad||(this._player.pause(),null===(e=this.ad)||void 0===e||e.click(),this._handleTrackingEvent(TrackEvents.CLICK),!1)}},{key:"onError",value:function(e){var t;null!==(t=this._player)&&void 0!==t&&t.plugins.hls?e.originError.fatal&&this._handleTrackingEvent(TrackEvents.ERROR,{ERRORCODE:900}):this._handleTrackingEvent(TrackEvents.ERROR,{ERRORCODE:900})}},{key:"onPause",value:function(){this.ad&&this._handleTrackingEvent(TrackEvents.PAUSE)}},{key:"onPlay",value:function(){var e,t;this.ad&&(null!==(e=this.ad)&&void 0!==e&&e.getState()?this._handleTrackingEvent(TrackEvents.RESUME):(null===(t=this.ad)||void 0===t||t.setState(AdState.START),this._handleTrackingEvent(TrackEvents.START),this._handleTrackingEvent(TrackEvents.IMPRESSION)))}},{key:"onTimeUpdate",value:function(e){var t,r;if(this.ad||null!==(t=this._breakCues)&&void 0!==t&&t.length){if(this.ad){var n;this._sendInProgressEvents(e,this.ad);var o=null===(n=this.ad)||void 0===n?void 0:n.getRemainingTime(),i=this.ad.getDuration();i>0&&(o<=0||o>i)&&this._endAd()}!this.ad&&null!==(r=this._breakCues)&&void 0!==r&&r.length&&this._checkLinearAds(e)}}},{key:"destroy",value:function(){this.ad=void 0,clearTimeout(this._timer),this._timer=void 0}},{key:"_init",value:function(){var e,t,r=this;null===(e=this._player)||void 0===e||null===(e=e.media)||void 0===e||null===(e=e.textTracks)||void 0===e||e.addEventListener("addtrack",this._onAddTrack),null===(t=this._player)||void 0===t||t.on(COMPLETE,(function(){var e,t;r._liveSyncDuration=null===(e=r._player)||void 0===e||null===(e=e.plugins)||void 0===e||null===(e=e.hls)||void 0===e||null===(e=e.hls)||void 0===e||null===(e=e.config)||void 0===e?void 0:e.liveSyncDuration,r._liveMaxLatencyDuration=null===(t=r._player)||void 0===t||null===(t=t.plugins)||void 0===t||null===(t=t.hls)||void 0===t||null===(t=t.hls)||void 0===t||null===(t=t.config)||void 0===t?void 0:t.liveMaxLatencyDuration}))}},{key:"_transformSSAIAdBreak",value:function(e){var t,r=[];return _forEachInstanceProperty(e).call(e,function(){var e=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(n){var o,i,a,s,l,c,u;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=null===(o=n.ad)||void 0===o||null===(o=o[AD_ID])||void 0===o||null===(o=o.value)||void 0===o?void 0:o.data,s=null===(i=n.ad[BREAK_ID])||void 0===i||null===(i=i.value)||void 0===i?void 0:i.data,a&&(c={id:a,idWithSlate:n.idWithSlate,startTime:n.startTime,duration:Number(null==n||null===(l=n.ad)||void 0===l||null===(l=l[PLANNED_DURATION_TAG])||void 0===l||null===(l=l.value)||void 0===l?void 0:l.data)},s?(t&&r.push(t),t={id:s,startTime:n.startTime,duration:c.duration,ads:[c]}):n.ad[AD_ID]&&t&&(null===(u=t)||void 0===u||null===(u=u.ads)||void 0===u||u.push(c),t.duration=t.duration+c.duration));case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),t&&r.push(t),r}},{key:"_fetchBreakInfo",value:(n=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(t){var r,n,o;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o={status:"Pending",ads:{}},this._breakInfoMap[t]=o,e.abrupt("return",request({url:_concatInstanceProperty(r=_concatInstanceProperty(n="".concat(location.protocol,"//")).call(n,__LIVE_AD_REQUEST_DOMAIN__,"/media_plus/ssai_proxy/v2/openapi/GetAdInfo?break_id=")).call(r,t)}).then(function(){var e=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(t){var r;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.ad_info){e.next=5;break}return e.next=3,_Promise.all(null===(r=_Object$entries2(t.ad_info))||void 0===r?void 0:_mapInstanceProperty(r).call(r,function(){var e=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(t){var r,n,i,a;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=_slicedToArray(t,2),n=r[0],i=r[1],e.next=3,parseAd(i);case 3:return a=e.sent,o.ads[n]=a,e.abrupt("return",a);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 3:return o.status="Success",e.abrupt("return",o);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(){o.status="Error"})));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"_checkFrameChasing",value:function(e){var t,r,n;if(null!==(t=this._cues)&&void 0!==t&&t.length){var o=null===(r=this._cues)||void 0===r?void 0:r[(null===(n=this._cues)||void 0===n?void 0:n.length)-1],i=void 0!==(null==o?void 0:o.startTime)?o.startTime+o.duration:void 0;i&&this._setFrameChasing(i<=e)}else this._setFrameChasing(!0)}},{key:"_setFrameChasing",value:function(e){var t;null!==(t=this._player)&&void 0!==t&&null!==(t=t.plugins)&&void 0!==t&&null!==(t=t.hls)&&void 0!==t&&t.hls&&(this._player.plugins.hls.hls.config.liveSyncDuration=e?this._liveSyncDuration:void 0,this._player.plugins.hls.hls.config.targetLatency=null,this._player.plugins.hls.hls.config.liveMaxLatencyDuration=e?this._liveMaxLatencyDuration:void 0)}},{key:"_checkLinearAds",value:function(e){var t;if(null!==(t=this._breakCues)&&void 0!==t&&t.length)for(var r=0;r<this._breakCues.length;r++){var n,o;if(this.ad)break;var i=null===(n=this._breakCues)||void 0===n?void 0:n[r];if(null==i||null===(o=i.ads)||void 0===o||!o.length)return;for(var a=0;a<i.ads.length;a++){var s,l=i.ads[a],c=l.startTime,u=l.startTime+l.duration,p=null===(s=this._breakInfoMap[i.id])||void 0===s||null===(s=s.ads)||void 0===s?void 0:s[l.id];if(c<=e&&u>e&&(l.idWithSlate||p)){var f,d;this.ad=new ServerSideAd(l,i.id,p,this._player);var h=null==p?void 0:_findInstanceProperty(f=p.ads).call(f,(function(e){return e.creatives.length>0})),$=null==h||null===(d=h.creatives)||void 0===d?void 0:_findInstanceProperty(d).call(d,(function(e){return null==e?void 0:e.mediaFiles}));h&&$&&(this._vastTracker=new z(null,h,$)),this._adStart();break}}}}},{key:"_sendInProgressEvents",value:function(e,t){var r,n,o,i,a,s,l=t.getStartTime()+.25*t.getDuration(),c=t.getStartTime()+.5*t.getDuration(),u=t.getStartTime()+.75*t.getDuration();if(e>=l&&!_includesInstanceProperty(r=this._eventsSent).call(r,TrackEvents.FIRST_QUARTILE))return this._eventsSent.push(TrackEvents.FIRST_QUARTILE),null===(i=this.ad)||void 0===i||i.setState(AdState.FIRST_QUARTILE),void this._handleTrackingEvent(TrackEvents.FIRST_QUARTILE);if(e>=c&&!_includesInstanceProperty(n=this._eventsSent).call(n,TrackEvents.MIDPOINT))return this._eventsSent.push(TrackEvents.MIDPOINT),null===(a=this.ad)||void 0===a||a.setState(AdState.MIDPOINT),void this._handleTrackingEvent(TrackEvents.MIDPOINT);e>=u&&!_includesInstanceProperty(o=this._eventsSent).call(o,TrackEvents.THIRD_QUARTILE)&&(this._eventsSent.push(TrackEvents.THIRD_QUARTILE),null===(s=this.ad)||void 0===s||s.setState(AdState.THIRD_QUARTILE),this._handleTrackingEvent(TrackEvents.THIRD_QUARTILE))}},{key:"_handleTrackingEvent",value:(r=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(t,r){var n;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this._sendTrackingEvent(t,r),null===(n=this._emitAdEvent)||void 0===n||n.call(this,AdEvents[t]);case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"_sendTrackingEvent",value:(t=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(t,r){var n,o,i,a;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t!==TrackEvents.ERROR){e.next=3;break}return null===(o=this._vastTracker)||void 0===o||o.error(r),e.abrupt("return");case 3:if(t!==TrackEvents.CLICK){e.next=6;break}return null===(i=this._vastTracker)||void 0===i||i.click(null,r),e.abrupt("return");case 6:if(t!==TrackEvents.IMPRESSION){e.next=9;break}return null===(a=this._vastTracker)||void 0===a||a.trackImpression(),e.abrupt("return");case 9:null===(n=this._vastTracker)||void 0===n||n.track(t,{macros:r});case 10:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})},{key:"_adStart",value:function(){var e,t;null!=this&&null!==(e=this._player)&&void 0!==e&&e.paused||(null===(t=this.ad)||void 0===t||t.setState(AdState.START),this._handleTrackingEvent(TrackEvents.START),this._handleTrackingEvent(TrackEvents.IMPRESSION))}},{key:"_endAd",value:function(e){e||this._handleTrackingEvent(TrackEvents.COMPLETE),this.ad=void 0,this._eventsSent=[]}}]),i}(),AdsPlugin=function(e){_inherits$2(n,AdsPlugin$1);var t,r=_createSuper$2(n);function n(){var e,t;_classCallCheck$3(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return _defineProperty$3(_assertThisInitialized$2(t=r.call.apply(r,_concatInstanceProperty(e=[this]).call(e,i))),"_scte35Manager",void 0),_defineProperty$3(_assertThisInitialized$2(t),"_ssManager",void 0),_defineProperty$3(_assertThisInitialized$2(t),"_onPlay",void 0),_defineProperty$3(_assertThisInitialized$2(t),"_onTimeUpdate",void 0),_defineProperty$3(_assertThisInitialized$2(t),"_onPause",void 0),_defineProperty$3(_assertThisInitialized$2(t),"_onError",void 0),_defineProperty$3(_assertThisInitialized$2(t),"_onClick",void 0),_defineProperty$3(_assertThisInitialized$2(t),"_handlePrerollMuted",(function(e){var r,n;isPrerollAd(e.ad)&&(null===(r=t.player.plugins.autoplayplugin)||void 0===r||null===(n=r.handleAutoplayStart)||void 0===n||n.call(r),t.player.once(VOLUME_CHANGE,(function(){var e,r;null===(e=t.player.plugins.autoplayplugin)||void 0===e||null===(r=e.initState)||void 0===r||r.call(e)})))})),t}return _createClass$3(n,[{key:"adManager",get:function(){return this._ssManager||this.csManager}},{key:"afterCreate",value:function(){var e;(_get$2(_getPrototypeOf$2(n.prototype),"afterCreate",this).call(this),this._init(),"ssai"===this.config.adType)&&(this.player.config.url=appendSearchParams(this.player.config.url,{ssai_uid:null===(e=this.player)||void 0===e||null===(e=e.plugins)||void 0===e||null===(e=e.logger)||void 0===e||null===(e=e.config)||void 0===e?void 0:e.userId,ssai_platform:"web"}))}},{key:"afterPlayerInit",value:function(){var e;null!==(e=this.player.plugins)&&void 0!==e&&null!==(e=e.hls)&&void 0!==e&&e.hls&&"ssai"===this.config.adType&&(this.player.plugins.hls.hls.config.liveSyncDuration=null,this.player.plugins.hls.hls.config.liveMaxLatencyDuration=1/0)}},{key:"beforePlayerInit",value:(t=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(){var t,r,o,i=this;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=_get$2(_getPrototypeOf$2(n.prototype),"beforePlayerInit",this).call(this),null===(t=this.csManager)||void 0===t||t.once(IMA_SDK_LOAD_SUCCESS,(function(){google.ima.settings.setDisableCustomPlaybackForIOS10Plus(!0)})),this.config.enableSCTE35&&null!==(r=this.config.ima)&&void 0!==r&&r.adTagUrlForSCTE35&&(this._scte35Manager=new Scte35Manager({player:this.player,adTagUrl:this.config.ima.adTagUrlForSCTE35,adManager:this.csManager,replayForSCTE35:this.config.replayForSCTE35})),"ssai"===this.config.adType&&(this._ssManager=new ServerSideAdManager({player:this.player,emitAdEvent:function(e){return i._dispatchEvent(e)}}),this._setupSSAIListener(),this.uiManager.adPlugin.offAll(),this.uiManager.destroy()),o.resolve(),e.abrupt("return",o);case 6:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"destroy",value:function(){var e,t;_get$2(_getPrototypeOf$2(n.prototype),"destroy",this).call(this),null===(e=this._scte35Manager)||void 0===e||e.destroy(),this._scte35Manager=void 0,this._clearSSAIListener(),null===(t=this._ssManager)||void 0===t||t.destroy(),this._ssManager=void 0}},{key:"_clearSSAIListener",value:function(){var e,t,r,n,o,i,a;((null===(e=this._ssManager)||void 0===e?void 0:e.onPlay)&&this.player.off(PLAY,this._onPlay),(null===(t=this._ssManager)||void 0===t?void 0:t.onPause)&&this.player.off(PAUSE,this._onPause),(null===(r=this._ssManager)||void 0===r?void 0:r.onError)&&this.player.off(ERROR,this._onError),(null===(n=this._ssManager)||void 0===n?void 0:n.onTimeUpdate)&&this.player.off(TIME_UPDATE,this._onTimeUpdate),null!==(o=this._ssManager)&&void 0!==o&&o.onClick)&&(null===(i=this.player)||void 0===i||i.removePluginHooks("pc","videoClick",this._onClick),null===(a=this.player)||void 0===a||a.removePluginHooks("mobile","videoClick",this._onClick))}},{key:"_setupSSAIListener",value:function(){var e,t,r,n,o,i,a,s=this;(this._onPlay=function(){var e;return null===(e=s._ssManager)||void 0===e?void 0:e.onPlay()},this._onTimeUpdate=function(){var e;return null===(e=s._ssManager)||void 0===e?void 0:e.onTimeUpdate(s.player.currentTime)},this._onPause=function(){var e;return null===(e=s._ssManager)||void 0===e?void 0:e.onPause()},this._onError=function(e){var t;return null===(t=s._ssManager)||void 0===t?void 0:t.onError(e)},this._onClick=function(){var e;null===(e=s._ssManager)||void 0===e||e.onClick()},(null===(e=this._ssManager)||void 0===e?void 0:e.onPlay)&&this.player.on(PLAY,this._onPlay),(null===(t=this._ssManager)||void 0===t?void 0:t.onPause)&&this.player.on(PAUSE,this._onPause),(null===(r=this._ssManager)||void 0===r?void 0:r.onError)&&this.player.on(ERROR,this._onError),(null===(n=this._ssManager)||void 0===n?void 0:n.onTimeUpdate)&&this.player.on(TIME_UPDATE,this._onTimeUpdate),null!==(o=this._ssManager)&&void 0!==o&&o.onClick)&&(null===(i=this.player)||void 0===i||i.usePluginHooks("pc","videoClick",this._onClick),null===(a=this.player)||void 0===a||a.usePluginHooks("mobile","videoClick",this._onClick))}},{key:"_dispatchEvent",value:function(e){var t;this.player.emit(e,{ad:null===(t=this._ssManager)||void 0===t?void 0:t.ad})}},{key:"_init",value:function(){var e,t;null!==(e=this.config.ima)&&void 0!==e&&e.adTagUrl||null===(t=this.config.ima)||void 0===t||null===(t=t.schedule)||void 0===t||!t.length||(this.config.ima.adsResponse=scheduleToVmap(this.config.ima.schedule)),this.player.once(AD_PLAY,this._handlePrerollMuted)}}],[{key:"pluginName",get:function(){return"ad"}}]),n}();export{AdsPlugin as default};
|
|
3
|
+
read:function(e,t,r,n,o){var i,a,s=8*o-n-1,l=(1<<s)-1,c=l>>1,u=-7,p=r?o-1:0,f=r?-1:1,d=e[t+p];for(p+=f,i=d&(1<<-u)-1,d>>=-u,u+=s;u>0;i=256*i+e[t+p],p+=f,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=n;u>0;a=256*a+e[t+p],p+=f,u-=8);if(0===i)i=1-c;else{if(i===l)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),i-=c}return(d?-1:1)*a*Math.pow(2,i-n)},write:function(e,t,r,n,o,i){var a,s,l,c=8*i-o-1,u=(1<<c)-1,p=u>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,h=n?1:-1,$=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+p>=1?f/l:f*Math.pow(2,1-p))*l>=2&&(a++,l/=2),a+p>=u?(s=0,a=u):a+p>=1?(s=(t*l-1)*Math.pow(2,o),a+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,o),a=0));o>=8;e[r+d]=255&s,d+=h,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;e[r+d]=255&a,d+=h,a/=256,c-=8);e[r+d-h]|=128*$}};(function(e){var t=base64Js,r=ieee754,n="function"==typeof _Symbol&&"function"==typeof _Symbol$for?_Symbol$for("nodejs.util.inspect.custom"):null;e.Buffer=a,e.SlowBuffer=function(e){+e!=e&&(e=0);return a.alloc(+e)},e.INSPECT_MAX_BYTES=50;var o=2147483647;function i(e){if(e>o)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return _Object$setPrototypeOf(t,a.prototype),t}function a(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return c(e)}return s(e,t,r)}function s(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!a.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|d(e,t),n=i(r),o=n.write(e,t);o!==r&&(n=_sliceInstanceProperty(n).call(n,0,o));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(z(e,Uint8Array)){var t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return u(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+_typeof$3(e));if(z(e,ArrayBuffer)||e&&z(e.buffer,ArrayBuffer))return p(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(z(e,SharedArrayBuffer)||e&&z(e.buffer,SharedArrayBuffer)))return p(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return a.from(n,t,r);var o=function(e){if(a.isBuffer(e)){var t=0|f(e.length),r=i(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||q(e.length)?i(0):u(e);if("Buffer"===e.type&&_Array$isArray(e.data))return u(e.data)}(e);if(o)return o;if(void 0!==_Symbol&&null!=_Symbol$toPrimitive&&"function"==typeof e[_Symbol$toPrimitive])return a.from(e[_Symbol$toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+_typeof$3(e))}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return l(e),i(e<0?0:0|f(e))}function u(e){for(var t=e.length<0?0:0|f(e.length),r=i(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function p(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),_Object$setPrototypeOf(n,a.prototype),n}function f(e){if(e>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function d(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||z(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+_typeof$3(e));var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var o=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return K(e).length;default:if(o)return n?-1:G(e).length;t=(""+t).toLowerCase(),o=!0}}function h(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,r);case"utf8":case"utf-8":return T(this,t,r);case"ascii":return P(this,t,r);case"latin1":case"binary":return A(this,t,r);case"base64":return E(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function $(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),q(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=a.from(t,n)),a.isBuffer(t))return 0===t.length?-1:g(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof _indexOfInstanceProperty(Uint8Array.prototype)?o?_indexOfInstanceProperty(Uint8Array.prototype).call(e,t,r):_lastIndexOfInstanceProperty(Uint8Array.prototype).call(e,t,r):g(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,n,o){var i,a=1,s=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,l/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var u=-1;for(i=r;i<s;i++)if(c(e,i)===c(t,-1===u?0:i-u)){if(-1===u&&(u=i),i-u+1===l)return u*a}else-1!==u&&(i-=i-u),u=-1}else for(r+l>s&&(r=s-l),i=r;i>=0;i--){for(var p=!0,f=0;f<l;f++)if(c(e,i+f)!==c(t,f)){p=!1;break}if(p)return i}return-1}function v(e,t,r,n){r=Number(r)||0;var o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i,a=t.length;for(n>a/2&&(n=a/2),i=0;i<n;++i){var s=_parseInt$1(t.substr(2*i,2),16);if(q(s))return i;e[r+i]=s}return i}function m(e,t,r,n){return W(G(t,e.length-r),e,r,n)}function _(e,t,r,n){return W(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function b(e,t,r,n){return W(K(t),e,r,n)}function I(e,t,r,n){return W(function(e,t){for(var r,n,o,i=[],a=0;a<e.length&&!((t-=2)<0);++a)n=(r=e.charCodeAt(a))>>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function E(e,r,n){return 0===r&&n===e.length?t.fromByteArray(e):t.fromByteArray(_sliceInstanceProperty(e).call(e,r,n))}function T(e,t,r){r=Math.min(e.length,r);for(var n=[],o=t;o<r;){var i=e[o],a=null,s=i>239?4:i>223?3:i>191?2:1;if(o+s<=r){var l=void 0,c=void 0,u=void 0,p=void 0;switch(s){case 1:i<128&&(a=i);break;case 2:128==(192&(l=e[o+1]))&&(p=(31&i)<<6|63&l)>127&&(a=p);break;case 3:l=e[o+1],c=e[o+2],128==(192&l)&&128==(192&c)&&(p=(15&i)<<12|(63&l)<<6|63&c)>2047&&(p<55296||p>57343)&&(a=p);break;case 4:l=e[o+1],c=e[o+2],u=e[o+3],128==(192&l)&&128==(192&c)&&128==(192&u)&&(p=(15&i)<<18|(63&l)<<12|(63&c)<<6|63&u)>65535&&p<1114112&&(a=p)}}null===a?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),o+=s}return function(e){var t=e.length;if(t<=S)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,_sliceInstanceProperty(e).call(e,n,n+=S));return r}(n)}e.kMaxLength=o,a.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return _Object$setPrototypeOf(t,Uint8Array.prototype),_Object$setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),a.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),_Object$defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),_Object$defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(e,t,r){return s(e,t,r)},_Object$setPrototypeOf(a.prototype,Uint8Array.prototype),_Object$setPrototypeOf(a,Uint8Array),a.alloc=function(e,t,r){return function(e,t,r){return l(e),e<=0?i(e):void 0!==t?"string"==typeof r?_fillInstanceProperty(n=i(e)).call(n,t,r):_fillInstanceProperty(o=i(e)).call(o,t):i(e);var n,o}(e,t,r)},a.allocUnsafe=function(e){return c(e)},a.allocUnsafeSlow=function(e){return c(e)},a.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==a.prototype},a.compare=function(e,t){if(z(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),z(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(e)||!a.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(e,t){if(!_Array$isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return a.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=a.allocUnsafe(t),o=0;for(r=0;r<e.length;++r){var i=e[r];if(z(i,Uint8Array))o+i.length>n.length?(a.isBuffer(i)||(i=a.from(i)),i.copy(n,o)):Uint8Array.prototype.set.call(n,i,o);else{if(!a.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o)}o+=i.length}return n},a.byteLength=d,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)$(this,t,t+1);return this},a.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)$(this,t,t+3),$(this,t+1,t+2);return this},a.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)$(this,t,t+7),$(this,t+1,t+6),$(this,t+2,t+5),$(this,t+3,t+4);return this},a.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?T(this,0,e):h.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(e){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===a.compare(this,e)},a.prototype.inspect=function(){var t,r="",n=e.INSPECT_MAX_BYTES;return r=_trimInstanceProperty(t=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ")).call(t),this.length>n&&(r+=" ... "),"<Buffer "+r+">"},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function(e,t,r,n,o){if(z(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+_typeof$3(e));if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),l=Math.min(i,s),c=_sliceInstanceProperty(this).call(this,n,o),u=_sliceInstanceProperty(e).call(e,t,r),p=0;p<l;++p)if(c[p]!==u[p]){i=c[p],s=u[p];break}return i<s?-1:s<i?1:0},a.prototype.includes=function(e,t,r){return-1!==_indexOfInstanceProperty(this).call(this,e,t,r)},a.prototype.indexOf=function(e,t,r){return y(this,e,t,r,!0)},a.prototype.lastIndexOf=function(e,t,r){return y(this,e,t,r,!1)},a.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return m(this,e,t,r);case"ascii":case"latin1":case"binary":return _(this,e,t,r);case"base64":return b(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:_sliceInstanceProperty(Array.prototype).call(this._arr||this,0)}};var S=4096;function P(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function A(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function O(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=t;i<r;++i)o+=Y[e[i]];return o}function R(e,t,r){for(var n=_sliceInstanceProperty(e).call(e,t,r),o="",i=0;i<n.length-1;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function C(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function w(e,t,r,n,o,i){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function k(e,t,r,n,o){B(t,n,o,e,r,7);var i=Number(t&BigInt(4294967295));e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i;var a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function D(e,t,r,n,o){B(t,n,o,e,r,7);var i=Number(t&BigInt(4294967295));e[r+7]=i,i>>=8,e[r+6]=i,i>>=8,e[r+5]=i,i>>=8,e[r+4]=i;var a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function L(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(e,t,n,o,i){return t=+t,n>>>=0,i||L(e,0,n,4),r.write(e,t,n,o,23,4),n+4}function M(e,t,n,o,i){return t=+t,n>>>=0,i||L(e,0,n,8),r.write(e,t,n,o,52,8),n+8}a.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return _Object$setPrototypeOf(n,a.prototype),n},a.prototype.readUintLE=a.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);for(var n=this[e],o=1,i=0;++i<t&&(o*=256);)n+=this[e+i]*o;return n},a.prototype.readUintBE=a.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);for(var n=this[e+--t],o=1;t>0&&(o*=256);)n+=this[e+--t]*o;return n},a.prototype.readUint8=a.prototype.readUInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),this[e]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readBigUInt64LE=X((function(e){F(e>>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);var n=t+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,24),o=this[++e]+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+r*Math.pow(2,24);return BigInt(n)+(BigInt(o)<<BigInt(32))})),a.prototype.readBigUInt64BE=X((function(e){F(e>>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);var n=t*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+this[++e],o=this[++e]*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+r;return(BigInt(n)<<BigInt(32))+BigInt(o)})),a.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);for(var n=this[e],o=1,i=0;++i<t&&(o*=256);)n+=this[e+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*t)),n},a.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);for(var n=t,o=1,i=this[e+--n];n>0&&(o*=256);)i+=this[e+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},a.prototype.readInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||C(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(e,t){e>>>=0,t||C(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readBigInt64LE=X((function(e){F(e>>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);var n=this[e+4]+this[e+5]*Math.pow(2,8)+this[e+6]*Math.pow(2,16)+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,24))})),a.prototype.readBigInt64BE=X((function(e){F(e>>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);var n=(t<<24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+r)})),a.prototype.readFloatLE=function(e,t){return e>>>=0,t||C(e,4,this.length),r.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||C(e,4,this.length),r.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||C(e,8,this.length),r.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||C(e,8,this.length),r.read(this,e,!1,52,8)},a.prototype.writeUintLE=a.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||w(this,e,t,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||w(this,e,t,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},a.prototype.writeUint8=a.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||w(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||w(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||w(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||w(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||w(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeBigUInt64LE=X((function(e){return k(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),a.prototype.writeBigUInt64BE=X((function(e){return D(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),a.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var o=Math.pow(2,8*r-1);w(this,e,t,r,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i<r&&(a*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+r},a.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var o=Math.pow(2,8*r-1);w(this,e,t,r,o-1,-o)}var i=r-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+r},a.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||w(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||w(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||w(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||w(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||w(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeBigInt64LE=X((function(e){return k(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),a.prototype.writeBigInt64BE=X((function(e){return D(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),a.prototype.writeFloatLE=function(e,t,r){return N(this,e,t,!0,r)},a.prototype.writeFloatBE=function(e,t,r){return N(this,e,t,!1,r)},a.prototype.writeDoubleLE=function(e,t,r){return M(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){return M(this,e,t,!1,r)},a.prototype.copy=function(e,t,r,n){if(!a.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var o=n-r;this===e&&"function"==typeof _copyWithinInstanceProperty(Uint8Array.prototype)?_copyWithinInstanceProperty(this).call(this,t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return o},a.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var o=e.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(e=o)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{var s=a.isBuffer(e)?e:a.from(e,n),l=s.length;if(0===l)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=s[i%l]}return this};var x={};function j(e,t,r){x[e]=function(r){_inherits$2(o,r);var n=_createSuper$2(o);function o(){var r,i;return _classCallCheck$3(this,o),i=n.call(this),_Object$defineProperty(_assertThisInitialized$2(i),"message",{value:t.apply(_assertThisInitialized$2(i),arguments),writable:!0,configurable:!0}),i.name=_concatInstanceProperty(r="".concat(i.name," [")).call(r,e,"]"),i.stack,delete i.name,i}return _createClass$3(o,[{key:"code",get:function(){return e},set:function(e){_Object$defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}},{key:"toString",value:function(){var t,r;return _concatInstanceProperty(t=_concatInstanceProperty(r="".concat(this.name," [")).call(r,e,"]: ")).call(t,this.message)}}]),o}(r)}function U(e){for(var t,r="",n=e.length,o="-"===e[0]?1:0;n>=o+4;n-=3){var i;r=_concatInstanceProperty(i="_".concat(_sliceInstanceProperty(e).call(e,n-3,n))).call(i,r)}return _concatInstanceProperty(t="".concat(_sliceInstanceProperty(e).call(e,0,n))).call(t,r)}function B(e,t,r,n,o,i){if(e>r||e<t){var a,s,l,c,u,p,f,d,h,$,y="bigint"==typeof t?"n":"";if(i>3)if(0===t||t===BigInt(0))a=_concatInstanceProperty(s=_concatInstanceProperty(l=_concatInstanceProperty(c=">= 0".concat(y," and < 2")).call(c,y," ** ")).call(l,8*(i+1))).call(s,y);else a=_concatInstanceProperty(u=_concatInstanceProperty(p=">= -(2".concat(y," ** ")).call(p,8*(i+1)-1)).call(u,y,") and < 2 ** ")+_concatInstanceProperty(f="".concat(8*(i+1)-1)).call(f,y);else a=_concatInstanceProperty(d=_concatInstanceProperty(h=_concatInstanceProperty($=">= ".concat(t)).call($,y," and <= ")).call(h,r)).call(d,y);throw new x.ERR_OUT_OF_RANGE("value",a,e)}!function(e,t,r){F(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||H(t,e.length-(r+1))}(n,o,i)}function F(e,t){if("number"!=typeof e)throw new x.ERR_INVALID_ARG_TYPE(t,"number",e)}function H(e,t,r){var n;if(Math.floor(e)!==e)throw F(e,r),new x.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new x.ERR_BUFFER_OUT_OF_BOUNDS;throw new x.ERR_OUT_OF_RANGE(r||"offset",_concatInstanceProperty(n=">= ".concat(r?1:0," and <= ")).call(n,t),e)}j("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?"".concat(e," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"}),RangeError),j("ERR_INVALID_ARG_TYPE",(function(e,t){var r;return _concatInstanceProperty(r='The "'.concat(e,'" argument must be of type number. Received type ')).call(r,_typeof$3(t))}),TypeError),j("ERR_OUT_OF_RANGE",(function(e,t,r){var n,o='The value of "'.concat(e,'" is out of range.'),i=r;return _Number$isInteger(r)&&Math.abs(r)>Math.pow(2,32)?i=U(String(r)):"bigint"==typeof r&&(i=String(r),(r>Math.pow(BigInt(2),BigInt(32))||r<-Math.pow(BigInt(2),BigInt(32)))&&(i=U(i)),i+="n"),o+=_concatInstanceProperty(n=" It must be ".concat(t,". Received ")).call(n,i)}),RangeError);var V=/[^+/0-9A-Za-z-_]/g;function G(e,t){var r;t=t||1/0;for(var n=e.length,o=null,i=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function K(e){return t.toByteArray(function(e){if(e=e.split("=")[0],(e=_trimInstanceProperty(e).call(e).replace(V,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function W(e,t,r,n){var o;for(o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function q(e){return e!=e}var Y=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,o=0;o<16;++o)t[n+o]=e[r]+e[o];return t}();function X(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}})(buffer),_Object$defineProperty(scte35,"__esModule",{value:!0});var SCTE35_1=scte35.SCTE35=void 0,descriptors=descriptors$1,util=util$2,buffer_1=buffer,SCTE35=function(){function e(){_classCallCheck$3(this,e),this.buffer=buffer_1.Buffer}return _createClass$3(e,[{key:"parseFromB64",value:function(e){var t,r=Uint8Array.from(_mapInstanceProperty(t=this.parseBase64(e).split("")).call(t,(function(e){return e.charCodeAt(0)})));return this.parseSCTE35Data(r)}},{key:"parseFromHex",value:function(e){var t=e.match(/[a-f\d]{2}/gi)||[],r=Uint8Array.from(_mapInstanceProperty(t).call(t,(function(e){return _parseInt$1(e,16)})));return this.parseSCTE35Data(r)}},{key:"parseBase64",value:function(e){return this.buffer.from(e,"base64").toString("binary")}},{key:"spliceEvent",value:function(e,t,r){var n=0;if(e.spliceEventId=t.getUint32(n),n+=4,e.spliceEventCancelIndicator=!!(128&t.getUint8(n++)),e.spliceEventCancelIndicator)return n;var o=t.getUint8(n++);if(e.outOfNetworkIndicator=!!(128&o),e.programSpliceFlag=!!(64&o),e.durationFlag=!!(32&o),5===r&&(e.spliceImmediateFlag=!!(16&o)),e.programSpliceFlag)if(5!==r||e.spliceImmediateFlag)4===r&&(e.utcSpliceTime=t.getUint32(n),n+=4);else{var i=this.timeSignal(new DataView(t.buffer,t.byteOffset+n,5));e.spliceTime=i,n++,i.specified&&(n+=4)}else if(e.componentCount=t.getUint8(n++),4===r){for(var a=[];a.length!==e.componentCount;)a.push({componentTag:t.getUint8(n++),utcSpliceTime:t.getUint32(n)}),n+=4;e.utcSpliceComponents=a}else console.warn("scte35-js TODO: support splice_insert");return e.durationFlag&&(o=t.getUint8(n++),e.breakDuration={autoReturn:!!(128&o),duration:(1&o?util.THIRTY_TWO_BIT_MULTIPLIER:0)+t.getUint32(n)},n+=4),e.uniqueProgramId=t.getUint16(n),n+=2,e.available=t.getUint8(n++),e.expected=t.getUint8(n++),n}},{key:"spliceSchedule",value:function(e){var t={};t.spliceCount=e.getUint8(0),t.spliceEvents=[];for(var r,n=1;t.spliceEvents.length!==t.spliceCount;){var o={};n+=this.spliceEvent(o,new DataView(e.buffer,e.byteOffset+n),4),t.spliceEvents.push(o)}n!==e.byteLength&&console.error(_concatInstanceProperty(r="scte35-js Bad read splice_schedule actual: ".concat(n," expected: ")).call(r,e.byteLength));return t}},{key:"spliceInsert",value:function(e){var t,r={},n=this.spliceEvent(r,e,5);n!==e.byteLength&&console.error(_concatInstanceProperty(t="scte35-js Bad read splice_insert actual: ".concat(n," expected: ")).call(t,e.byteLength));return r}},{key:"timeSignal",value:function(e){var t={},r=e.getUint8(0);return t.specified=!!(128&r),t.specified&&(t.pts=1&r?util.THIRTY_TWO_BIT_MULTIPLIER:0,t.pts+=e.getUint32(1)),t}},{key:"privateCommand",value:function(e){var t={},r=e.getUint32(0),n=new Uint8Array(e.buffer,e.byteOffset+4,e.byteLength-4);return t.identifier=r,t.identifier&&(t.rawData=n),t}},{key:"parseSCTE35Data",value:function(e){var t={},r=new DataView(e.buffer),n=0;t.tableId=r.getUint8(n++);var o,i=r.getUint8(n++);if(t.selectionSyntaxIndicator=!!(128&i),t.privateIndicator=!!(64&i),t.sectionLength=((15&i)<<8)+r.getUint8(n++),t.sectionLength+3!==e.byteLength)throw new Error(_concatInstanceProperty(o="Binary read error sectionLength: ".concat(t.sectionLength," + 3 !== data.length: ")).call(o,e.byteLength));if(t.protocolVersion=r.getUint8(n++),i=r.getUint8(n++),t.encryptedPacket=!!(128&i),t.encryptedAlgorithm=(126&i)>>1,t.encryptedPacket&&console.error("scte35-js splice_info_section encrypted_packet ".concat(t.encryptedAlgorithm," not supported")),t.ptsAdjustment=1&i?util.THIRTY_TWO_BIT_MULTIPLIER:0,t.ptsAdjustment+=r.getUint32(n),n+=4,t.cwIndex=r.getUint8(n++),t.tier=r.getUint8(n++)<<4,i=r.getUint8(n++),t.tier+=(240&i)>>4,t.spliceCommandLength=((15&i)<<8)+r.getUint8(n++),t.spliceCommandType=r.getUint8(n++),4095===t.spliceCommandLength)if(6===t.spliceCommandType){var a=128&r.getUint8(n);t.spliceCommandLength=a?5:1}else if(0===t.spliceCommandType)t.spliceCommandLength=0;else if(5===t.spliceCommandType){var s=n;if(s+=4,!(128&r.getUint8(s++))){var l=r.getUint8(s++),c=16&l,u=32&l,p=64&l;if(p&&!c&&(s+=5),!p){var f=r.getUint8(s++);s+=f,s+=c?0:5*f}u&&(s+=5),s+=4,t.spliceCommandLength=s-n}}else console.error("scte35-js Unspecified length not supported in this context");if(0!==t.spliceCommandType){var d=new DataView(e.buffer,n,t.spliceCommandLength);4===t.spliceCommandType?t.spliceCommand=this.spliceSchedule(d):5===t.spliceCommandType?t.spliceCommand=this.spliceInsert(d):6===t.spliceCommandType?t.spliceCommand=this.timeSignal(d):255===t.spliceCommandType&&(t.spliceCommand=this.privateCommand(d))}if(n+=t.spliceCommandLength,t.descriptorLoopLength=r.getUint16(n),n+=2,t.descriptorLoopLength){var h=t.descriptorLoopLength;t.descriptors=[];try{for(;h;){var $=new DataView(e.buffer,n,h),y=descriptors.parseDescriptor($);h-=y.descriptorLength+2,n+=y.descriptorLength+2,t.descriptors.push(y)}}catch(e){var g;console.error(_concatInstanceProperty(g="scte35-js Error reading descriptor @ ".concat(n,", ignoring remaining bytes: ")).call(g,h," in loop.")),console.error(e),n+=h,h=0}}return t.crc=r.getUint32(n),(n+=4)!==r.byteLength&&console.error("scte35-js Bad SCTE35 read - remaining data: ".concat(_sliceInstanceProperty(e).call(e,n).join(", "))),t}}]),e}();SCTE35_1=scte35.SCTE35=SCTE35;var SCTE35_OUT_TAG$1="SCTE35-OUT",START_DATE_TAG="START-DATE",PLANNED_DURATION_TAG$1="PLANNED-DURATION",SPLICE_INSERT=5,MIN_DURATION_OFFSET=5;function isValidScte35DateRange(e){return!(!e[PLANNED_DURATION_TAG$1]||!e.message&&!e[SCTE35_OUT_TAG$1]||void 0===e.startTime&&!e[START_DATE_TAG])}var Scte35Manager=function(){function e(t){var r=this;_classCallCheck$3(this,e),_defineProperty$3(this,"_options",void 0),_defineProperty$3(this,"_track",void 0),_defineProperty$3(this,"_startTime",void 0),_defineProperty$3(this,"_adBreakCues",void 0),_defineProperty$3(this,"_activeAdBreak",null),_defineProperty$3(this,"_activeAdBreakStatus","WAITING_PREROLL"),_defineProperty$3(this,"_scte35",new SCTE35_1),_defineProperty$3(this,"_scte35ResultMap",new _Map),_defineProperty$3(this,"_adManager",void 0),_defineProperty$3(this,"_timer",void 0),_defineProperty$3(this,"_handleTimeUpdate",(function(){var e,t,n,o,i;if(null!==(e=r._adBreakCues)&&void 0!==e&&e.length)for(var a=0;a<r._adBreakCues.length;a++){var s=r._adBreakCues[a];if(s.startTime>=r._player.currentTime){n=s;break}}if(n&&(null===(t=r._activeAdBreak)||void 0===t?void 0:t.id)===n.id)if((null===(o=r._activeAdBreak)||void 0===o?void 0:o.startDate)!==n.startDate)switch(r._activeAdBreakStatus){case"REQUESTED":r._changeActiveAdBreakStatus("REQUESTED",n);break;case"ERROR":case"COMPLETE":r._changeActiveAdBreakStatus("READY",null)}else(null===(i=r._activeAdBreak)||void 0===i?void 0:i.startTime)!==n.startTime&&r._changeActiveAdBreakStatus(r._activeAdBreakStatus,n);r._tryToPlayAd(),r._tryToRequestAd(n)})),_defineProperty$3(this,"_onReady",(function(){r._changeActiveAdBreakStatus("READY",null),r._player.off(AD_ERROR,r._onReady),r._player.off(AD_ALL_COMPLETED,r._onReady),r._player.on(TIME_UPDATE,r._handleTimeUpdate),r._player.on(AD_ALL_COMPLETED,r._onAdComplete),r._player.on(AD_ERROR,r._onAdError),r._handleTimeUpdate()})),_defineProperty$3(this,"_onAdComplete",(function(){r._changeActiveAdBreakStatus("COMPLETE",r._activeAdBreak)})),_defineProperty$3(this,"_onAdError",(function(){var e,t;null===(e=r._player)||void 0===e||null===(e=e.media)||void 0===e||null===(e=e.style)||void 0===e||e.setProperty("visibility",""),null===(t=r._adManager)||void 0===t||t.destroy(),r._adManager=null,r._changeActiveAdBreakStatus("ERROR",r._activeAdBreak)})),_defineProperty$3(this,"_handleHlsCoreEvent",(function(e){var t=e.eventName,n=e.playlist;if("core.hlslevelloaded"===t){var o;if(null!=n&&null!==(o=n.segments)&&void 0!==o&&o.length&&0===r._player.currentTime){var i,a=_createForOfIteratorHelper(n.segments);try{for(a.s();!(i=a.n()).done;){var s=i.value;if(0===s.start){r._startTime=new Date(s.dataTime).getTime();break}}}catch(e){a.e(e)}finally{a.f()}}null!=n&&n.dateRanges&&r._startTime&&r._updateAdBreakCues(n.dateRanges)}})),_defineProperty$3(this,"_onAddTrack",(function(e){var t=e.track;"metadata"===(null==t?void 0:t.kind)&&(t.mode="hidden",r._track=t,sniffer.os.isIos?r.loopCues():(r._onCuechange(),r._track.addEventListener("cuechange",r._onCuechange)))})),_defineProperty$3(this,"loopCues",(function(){r._onCuechange(),r._timer=_setTimeout(r.loopCues,2e3)})),_defineProperty$3(this,"_onCuechange",(function(){for(var e,t={},n=(null===(e=r._track)||void 0===e?void 0:e.cues)||[],o=0;o<n.length;){var i,a=n[o];if((null===(i=a.value)||void 0===i?void 0:i.key)===PLANNED_DURATION_TAG$1){var s,l=o+1<n.length?n[o+1]:null;if((null==l||null===(s=l.value)||void 0===s?void 0:s.key)===SCTE35_OUT_TAG$1&&(null==l?void 0:l.startTime)===a.startTime){var c,u,p=r._getScte35Result(null===(c=l.value)||void 0===c?void 0:c.data),f=String((null==p?void 0:p.spliceCommand).spliceEventId);t[f]=_defineProperty$3({ID:f,startTime:l.startTime,message:p},PLANNED_DURATION_TAG$1,null===(u=a.value)||void 0===u?void 0:u.data),o+=2}else o++}else o++}r._updateAdBreakCues(t)})),this._options=t,this._adManager=this._options.adManager,this._init()}var t,r,n;return _createClass$3(e,[{key:"_player",get:function(){return this._options.player}},{key:"_adTagUrl",get:function(){return this._options.adTagUrl}},{key:"_mediaElement",get:function(){return this._player.media}},{key:"destroy",value:function(){var e,t;null===(e=this._track)||void 0===e||e.removeEventListener("cuechange",this._onCuechange),this._track=void 0,clearTimeout(this._timer),this._timer=null,null===(t=this._mediaElement)||void 0===t||null===(t=t.textTracks)||void 0===t||t.removeEventListener("addtrack",this._onAddTrack),this._player.off("core_event",this._handleHlsCoreEvent),this._player.off(TIME_UPDATE,this._handleTimeUpdate),this._player.off(IMA_AD_COMPLETE,this._onAdComplete),this._player.off(IMA_AD_ERROR,this._onAdError)}},{key:"_init",value:function(){var e;null===(e=this._mediaElement)||void 0===e||null===(e=e.textTracks)||void 0===e||e.addEventListener("addtrack",this._onAddTrack),this._player.on("core_event",this._handleHlsCoreEvent);var t=this._adManager.config,r=t.adsRequest,n=t.adsResponse,o=t.adTagUrl;r||n||o?(this._player.once(AD_ERROR,this._onReady),this._player.once(AD_ALL_COMPLETED,this._onReady)):this._onReady()}},{key:"_changeActiveAdBreakStatus",value:function(e,t){this._activeAdBreakStatus=e,this._activeAdBreak=t}},{key:"_tryToRequestAd",value:(n=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(t){var r;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return");case 2:if("WAITING_PREROLL"!==this._activeAdBreakStatus){e.next=4;break}return e.abrupt("return");case 4:if("STARTED"!==this._activeAdBreakStatus){e.next=6;break}return e.abrupt("return");case 6:if(t.id!==(null===(r=this._activeAdBreak)||void 0===r?void 0:r.id)){e.next=8;break}return e.abrupt("return");case 8:return this._changeActiveAdBreakStatus("REQUESTED",t),e.next=11,this._generateOrUpdateManager(this._adManager);case 11:this._adManager=e.sent;case 12:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"_tryToPlayAd",value:function(){!this._activeAdBreak||this._activeAdBreak.startTime>this._player.currentTime||("ERROR"!==this._activeAdBreakStatus?"REQUESTED"===this._activeAdBreakStatus&&(this._changeActiveAdBreakStatus("STARTED",this._activeAdBreak),this._playLoopAds(this._adManager,this._activeAdBreak.duration)):this._changeActiveAdBreakStatus("READY",null))}},{key:"_generateOrUpdateManager",value:(r=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(t){var r;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=6;break}return e.next=3,this._player.plugins.ad._initImaAd();case 3:r=e.sent,e.next=8;break;case 6:(r=t).reset();case 8:return r.updateConfig({adTagUrl:this._adTagUrl}),r.requestAds(),e.abrupt("return",r);case 11:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"_playLoopAds",value:(t=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(t,r){var n,o=this,i=arguments;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=i.length>2&&void 0!==i[2]&&i[2],t.playAds(),t.once(IMA_CONTENT_RESUME_REQUESTED,(function(){o._player.media.style.setProperty("visibility","")})),t.adsManager.addEventListener(google.ima.AdEvent.Type.STARTED,(function(e){var o,i=null==e||null===(o=e.getAd().data)||void 0===o?void 0:o.duration;n&&r&&r<i&&_setTimeout((function(){var e;null===(e=t)||void 0===e||null===(e=e.adsManager)||void 0===e||e.stop()}),1e3*r)})),t.adsManager.addEventListener(google.ima.AdEvent.Type.MIDPOINT,function(){var e=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(n){var i,a,s,l,c,u,p;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c=null==n||null===(i=n.getAd().data)||void 0===i?void 0:i.duration,u=r-c,!(c&&null!==(a=o._options.replayForSCTE35)&&void 0!==a&&a.enable&&u>0&&u>(null!==(s=null===(l=o._options.replayForSCTE35)||void 0===l?void 0:l.minDurationOffset)&&void 0!==s?s:MIN_DURATION_OFFSET))){e.next=8;break}return e.next=5,o._generateOrUpdateManager();case 5:return(p=e.sent)&&(t.resumeCallback=function(){var e;return o._player.plugins.ad.uiManager.hideAdUI(),o._player.media.style.setProperty("visibility","hidden"),null===(e=t)||void 0===e||e.destroy(),t=null,o._playLoopAds(p,u,!0),{canResume:!1}}),e.abrupt("return");case 8:o._adManager=t;case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 5:case"end":return e.stop()}}),e)}))),function(e,r){return t.apply(this,arguments)})},{key:"_getScte35Result",value:function(e){if(!this._scte35ResultMap.has(e))try{this._scte35ResultMap.set(e,this._scte35.parseFromHex(e))}catch(e){}if(!this._scte35ResultMap.has(e))try{this._scte35ResultMap.set(e,this._scte35.parseFromB64(e))}catch(e){}return this._scte35ResultMap.get(e)}},{key:"_updateAdBreakCues",value:function(e){var t,r,n=this;this._adBreakCues=_sortInstanceProperty(t=_reduceInstanceProperty(r=_Object$keys(e)).call(r,(function(t,r){var o=e[r];if(isValidScte35DateRange(o)){var i=o.message||n._getScte35Result(o[SCTE35_OUT_TAG$1]);(null==i?void 0:i.spliceCommandType)===SPLICE_INSERT&&t.push({data:i,id:o.ID,startTime:o.startTime||(new Date(o[START_DATE_TAG]).getTime()-n._startTime)/1e3,duration:_parseFloat$1(o[PLANNED_DURATION_TAG$1]||"0"),startDate:o[START_DATE_TAG]})}return t}),[])).call(t,(function(e,t){return e.startTime-t.startTime}))}}]),e}();function scheduleToVmap(e){var t,r;if(e&&e.length){var n=document.implementation.createDocument("http://www.iab.net/videosuite/vmap","vmap:VMAP"),o=n.getElementsByTagName("vmap:VMAP");o[0].setAttribute("version","1.0");var i,a=0,s=0;return _forEachInstanceProperty(t=_sortInstanceProperty(r=_filterInstanceProperty(e).call(e,(function(e){var t=e.offset;return"pre"===t||"post"===t||/^(\d\d):([0-5]\d):([0-5]\d)(.\d\d\d)?$/.test(t)}))).call(r,(function(e,t){return"pre"===e.offset||"post"===t.offset?-1:"post"===e.offset||"pre"===t.offset?1:Date.parse("2024-01-01T".concat(e.offset))<Date.parse("2024-01-01T".concat(t.offset))?-1:1}))).call(t,(function(e){var t,r,l,c=e.offset,u=e.type,p=e.tag;switch(c){case"pre":r="start",l="preroll";break;case"post":r="end",l="postroll";break;default:r=c,i!==c?(i=c,s=1,l="midroll-".concat(++a)):(s++,l="midroll-".concat(a))}var f=n.createElement("vmap:AdBreak");f.setAttribute("timeOffset",r),f.setAttribute("breakId",l),f.setAttribute("breakType",u||"linear"),o[0].appendChild(f);var d=n.createElement("vmap:AdSource");d.setAttribute("id",_concatInstanceProperty(t="".concat(l,"-ad-")).call(t,s)),d.setAttribute("allowMultipleAds","true"),d.setAttribute("followRedirects","true"),f.appendChild(d);var h=n.createElement("vmap:AdTagURI");h.setAttribute("templateType","vast3"),d.appendChild(h),h.innerHTML="<![CDATA[ ".concat(p," ]]>")})),(new XMLSerializer).serializeToString(n)}}var DESCRIPTORS=descriptors$2,uncurryThis=functionUncurryThis,objectKeys=objectKeys$4,toIndexedObject=toIndexedObject$c,$propertyIsEnumerable=objectPropertyIsEnumerable.f,propertyIsEnumerable3=uncurryThis($propertyIsEnumerable),push2=uncurryThis([].push),createMethod=function(e){return function(t){for(var r,n=toIndexedObject(t),o=objectKeys(n),i=o.length,a=0,s=[];i>a;)r=o[a++],DESCRIPTORS&&!propertyIsEnumerable3(n,r)||push2(s,e?[r,n[r]]:n[r]);return s}},objectToArray={entries:createMethod(!0),values:createMethod(!1)},$$3=_export,$values=objectToArray.values;$$3({target:"Object",stat:!0},{values:function(e){return $values(e)}});var path$3=path$z,values$5=path$3.Object.values,parent$b=values$5,values$4=parent$b,parent$a=values$4,values$3=parent$a,parent$9=values$3,values$2=parent$9,values$1=values$2,values3=values$1,_Object$values=getDefaultExportFromCjs(values3),SCTE35_OUT_TAG="SCTE35-OUT",BREAK_ID="X-BREAK-ID",AD_ID="X-AD-ID",PLANNED_DURATION_TAG="PLANNED-DURATION";function isPrerollAd(e){var t;return 0===(null==e||null===(t=e.getAdPodInfo())||void 0===t?void 0:t.getTimeOffset())}function getType(e){switch(e){case SCTE35_OUT_TAG:return"SCTE35";case AD_ID:case BREAK_ID:return"SSAI";default:return}}function splitCuesByStartTime(e){var t,r=[],n={},o=void 0;function i(){var e,o,i=_Object$values(n);i.length&&(r.push({startTime:null==i||null===(e=i[0])||void 0===e?void 0:e.startTime,ad:n,type:t,idWithSlate:null==i||null===(o=i[0])||void 0===o?void 0:o.id}),t="")}for(var a=0;a<e.length;a++){var s=e[a];if(s.startTime===o){var l,c,u;if(getType(null==s||null===(l=s.value)||void 0===l?void 0:l.key))t=getType(null==s||null===(u=s.value)||void 0===u?void 0:u.key);null!=s&&null!==(c=s.value)&&void 0!==c&&c.key&&(n[s.value.key]=s)}else{var p;i(),null!=s&&null!==(p=s.value)&&void 0!==p&&p.key&&(n=_defineProperty$3({},s.value.key,s)),o=s.startTime}}return i(),r}var index_min="",plugin="";function _arrayWithHoles(e){if(_Array$isArray$1(e))return e}function _iterableToArrayLimit(e,t){var r=null==e?null:void 0!==_Symbol$1&&_getIteratorMethod$1(e)||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],l=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(_pushInstanceProperty(s).call(s,n.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}var $$2=_export,$entries=objectToArray.entries;$$2({target:"Object",stat:!0},{entries:function(e){return $entries(e)}});var path$2=path$z,entries$5=path$2.Object.entries,parent$8=entries$5,entries$4=parent$8,parent$7=entries$4,entries$3=parent$7,parent$6=entries$3,entries$2=parent$6,entries$1=entries$2,entries3=entries$1,_Object$entries2=getDefaultExportFromCjs(entries3);function ownKeys2(e,t){var r=_Object$keys$1(e);if(_Object$getOwnPropertySymbols$1){var n=_Object$getOwnPropertySymbols$1(e);t&&(n=_filterInstanceProperty$1(n).call(n,(function(t){return _Object$getOwnPropertyDescriptor$1(e,t).enumerable}))),_pushInstanceProperty(r).apply(r,n)}return r}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var r,n,o=null!=arguments[t]?arguments[t]:{};t%2?_forEachInstanceProperty$1(r=ownKeys2(Object(o),!0)).call(r,(function(t){_defineProperty$3(e,t,o[t])})):_Object$getOwnPropertyDescriptors$1?_Object$defineProperties$1(e,_Object$getOwnPropertyDescriptors$1(o)):_forEachInstanceProperty$1(n=ownKeys2(Object(o))).call(n,(function(t){_Object$defineProperty$1(e,t,_Object$getOwnPropertyDescriptor$1(o,t))}))}return e}var _AdEvents,BaseServerSideAdManager=_createClass$3((function e(t){_classCallCheck$3(this,e),_defineProperty$3(this,"_player",void 0),_defineProperty$3(this,"_emitAdEvent",void 0),this._player=t.player,this._emitAdEvent=t.emitAdEvent})),BaseServerSideAd=_createClass$3((function e(){_classCallCheck$3(this,e)})),TrackEvents=function(e){return e.START="start",e.FIRST_QUARTILE="firstQuartile",e.MIDPOINT="midpoint",e.THIRD_QUARTILE="thirdQuartile",e.COMPLETE="complete",e.CLICK="click",e.IMPRESSION="impression",e.RESUME="resume",e.PAUSE="pause",e.ERROR="error",e}(TrackEvents||{}),XGEvents=_objectSpread2(_objectSpread2({},XGAdEvents),{},{AD_FIRST_QUARTILE:"ad_first_quartile",AD_MIDPOINT:"ad_midpoint",AD_THIRD_QUARTILE:"ad_third_quartile",AD_CLICK:"ad_click",AD_IMPRESSION:"ad_impression",AD_RESUME:"ad_resume"}),AdEvents=(_defineProperty$3(_AdEvents={},"start",XGEvents.AD_START),_defineProperty$3(_AdEvents,"firstQuartile",XGEvents.AD_FIRST_QUARTILE),_defineProperty$3(_AdEvents,"midpoint",XGEvents.AD_MIDPOINT),_defineProperty$3(_AdEvents,"thirdQuartile",XGEvents.AD_THIRD_QUARTILE),_defineProperty$3(_AdEvents,"complete",XGEvents.AD_COMPLETE),_defineProperty$3(_AdEvents,"click",XGEvents.AD_CLICK),_defineProperty$3(_AdEvents,"impression",XGEvents.AD_IMPRESSION),_defineProperty$3(_AdEvents,"resume",XGEvents.AD_RESUME),_defineProperty$3(_AdEvents,"pause",XGEvents.AD_PAUSE),_defineProperty$3(_AdEvents,"error",XGEvents.AD_ERROR),_AdEvents),AdState=function(e){return e.START="start",e.FIRST_QUARTILE="firstQuartile",e.MIDPOINT="midpoint",e.THIRD_QUARTILE="thirdQuartile",e.COMPLETE="complete",e}(AdState||{}),ServerSideAd=function(e){_inherits$2(r,BaseServerSideAd);var t=_createSuper$2(r);function r(e,n,o,i){var a,s,l,c,u,p;_classCallCheck$3(this,r),_defineProperty$3(_assertThisInitialized$2(p=t.call(this)),"_ad",void 0),_defineProperty$3(_assertThisInitialized$2(p),"_parsedVast",void 0),_defineProperty$3(_assertThisInitialized$2(p),"_skipOffset",void 0),_defineProperty$3(_assertThisInitialized$2(p),"_trackingEvents",void 0),_defineProperty$3(_assertThisInitialized$2(p),"_videoClickThrough",void 0),_defineProperty$3(_assertThisInitialized$2(p),"_videoClickTracking",void 0),_defineProperty$3(_assertThisInitialized$2(p),"_impressionTracking",void 0),_defineProperty$3(_assertThisInitialized$2(p),"_errorTracking",void 0),_defineProperty$3(_assertThisInitialized$2(p),"_state",void 0),_defineProperty$3(_assertThisInitialized$2(p),"_player",void 0),_defineProperty$3(_assertThisInitialized$2(p),"_type",void 0),_defineProperty$3(_assertThisInitialized$2(p),"_breakId",void 0),p._ad=e,p._breakId=n,p._player=i,p._parsedVast=o;var f=null===(a=p._parsedVast)||void 0===a?void 0:_findInstanceProperty(s=a.ads).call(s,(function(e){return e.creatives.length>0})),d=null==f||null===(l=f.creatives)||void 0===l?void 0:_findInstanceProperty(l).call(l,(function(e){return null==e?void 0:e.mediaFiles}));return p._skipOffset=null==d?void 0:d.skipDelay,p._trackingEvents=null==d?void 0:d.trackingEvents,p._type=null==d?void 0:d.type,p._videoClickTracking=null==d||null===(c=d.videoClickTrackingURLTemplates)||void 0===c?void 0:_mapInstanceProperty(c).call(c,(function(e){return e.url})),p._videoClickThrough=null==d?void 0:d.videoClickThroughURLTemplate,p._impressionTracking=null==f||null===(u=f.impressionURLTemplates)||void 0===u?void 0:_mapInstanceProperty(u).call(u,(function(e){return e.url})),p._errorTracking=null==f?void 0:f.errorURLTemplates,p}return _createClass$3(r,[{key:"trackingEvents",get:function(){var e;return _objectSpread2(_objectSpread2({},this._trackingEvents),{},(_defineProperty$3(e={},TrackEvents.CLICK,this._videoClickTracking),_defineProperty$3(e,TrackEvents.IMPRESSION,this._impressionTracking),_defineProperty$3(e,TrackEvents.ERROR,this._errorTracking),e))}},{key:"errorTracking",get:function(){return this._errorTracking}},{key:"isLinear",value:function(){return"linear"===this._type}},{key:"getVideoClickThrough",value:function(){var e;return null===(e=this._videoClickThrough)||void 0===e?void 0:e.url}},{key:"getStartTime",value:function(){return this._ad.startTime}},{key:"getSkipOffset",value:function(){return this._skipOffset}},{key:"getDuration",value:function(){return this._ad.duration}},{key:"getAdId",value:function(){return this._ad.id}},{key:"isSlate",value:function(){var e;return!!this._ad.idWithSlate&&"slate"===(null===(e=this._ad.idWithSlate)||void 0===e?void 0:e.split("-"))[0]}},{key:"getBreakId",value:function(){return this._breakId}},{key:"getState",value:function(){return this._state}},{key:"setState",value:function(e){this._state=e}},{key:"isSkippable",value:function(){return"number"==typeof this.getSkipOffset()}},{key:"getSkipTimeOffset",value:function(){if(this.isSkippable()){var e=this.getSkipOffset();if("number"==typeof e){var t=this.getRemainingTime()+e-this.getDuration();return Math.max(t,0)}}}},{key:"canSkip",value:function(){return 0==this.getSkipTimeOffset()}},{key:"skip",value:function(){this._player&&(this._player.currentTime=this._player.currentTime+this.getRemainingTime())}},{key:"click",value:function(){var e,t;null!==(e=this._videoClickThrough)&&void 0!==e&&e.url&&window.open(null===(t=this._videoClickThrough)||void 0===t?void 0:t.url,"_blank")}},{key:"canClick",value:function(){var e;return!(null===(e=this._videoClickThrough)||void 0===e||!e.url)}},{key:"getRemainingTime",value:function(){var e;return this._ad.startTime+this._ad.duration-(null===(e=this._player)||void 0===e||null===(e=e.media)||void 0===e?void 0:e.currentTime)}}]),r}();function _arrayWithoutHoles(e){if(_Array$isArray$1(e))return _arrayLikeToArray(e)}function _iterableToArray(e){if(void 0!==_Symbol$1&&null!=_getIteratorMethod$1(e)||null!=e["@@iterator"])return _Array$from$1(e)}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 _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}var $$1=_export,fails=fails$B,getOwnPropertyNames$6=objectGetOwnPropertyNamesExternal.f,FAILS_ON_PRIMITIVES=fails((function(){return!Object.getOwnPropertyNames(1)}));$$1({target:"Object",stat:!0,forced:FAILS_ON_PRIMITIVES},{getOwnPropertyNames:getOwnPropertyNames$6});var path$1=path$z,Object$1=path$1.Object,getOwnPropertyNames$5=function(e){return Object$1.getOwnPropertyNames(e)},parent$5=getOwnPropertyNames$5,getOwnPropertyNames$4=parent$5,parent$4=getOwnPropertyNames$4,getOwnPropertyNames$3=parent$4,parent$3=getOwnPropertyNames$3,getOwnPropertyNames$2=parent$3,getOwnPropertyNames$1=getOwnPropertyNames$2,getOwnPropertyNames5=getOwnPropertyNames$1,_Object$getOwnPropertyNames=getDefaultExportFromCjs(getOwnPropertyNames5),global$1=global$s,globalIsFinite=global$1.isFinite,numberIsFinite$1=Number.isFinite||function(e){return"number"==typeof e&&globalIsFinite(e)},$=_export,numberIsFinite=numberIsFinite$1;$({target:"Number",stat:!0},{isFinite:numberIsFinite});var path=path$z,_isFinite$5=path.Number.isFinite,parent$2=_isFinite$5,_isFinite$4=parent$2,parent$1=_isFinite$4,_isFinite$3=parent$1,parent=_isFinite$3,_isFinite$2=parent,_isFinite$1=_isFinite$2,_isFinite=_isFinite$1,_Number$isFinite=getDefaultExportFromCjs(_isFinite);function e(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{id:e.id||null,adId:e.adId||null,sequence:e.sequence||null,apiFramework:e.apiFramework||null,universalAdIds:[],creativeExtensions:[]}}var t=["ADCATEGORIES","ADCOUNT","ADPLAYHEAD","ADSERVINGID","ADTYPE","APIFRAMEWORKS","APPBUNDLE","ASSETURI","BLOCKEDADCATEGORIES","BREAKMAXADLENGTH","BREAKMAXADS","BREAKMAXDURATION","BREAKMINADLENGTH","BREAKMINDURATION","BREAKPOSITION","CLICKPOS","CLICKTYPE","CLIENTUA","CONTENTID","CONTENTPLAYHEAD","CONTENTURI","DEVICEIP","DEVICEUA","DOMAIN","EXTENSIONS","GDPRCONSENT","IFA","IFATYPE","INVENTORYSTATE","LATLONG","LIMITADTRACKING","MEDIAMIME","MEDIAPLAYHEAD","OMIDPARTNER","PAGEURL","PLACEMENTTYPE","PLAYERCAPABILITIES","PLAYERSIZE","PLAYERSTATE","PODSEQUENCE","REGULATIONS","SERVERSIDE","SERVERUA","TRANSACTIONID","UNIVERSALADID","VASTVERSIONS","VERIFICATIONVENDORS"];function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=[],o=s(e);for(var a in!t.ERRORCODE||r.isCustomCode||/^[0-9]{3}$/.test(t.ERRORCODE)||(t.ERRORCODE=900),t.CACHEBUSTING=d(Math.round(1e8*Math.random())),t.TIMESTAMP=(new Date).toISOString(),t.RANDOM=t.random=t.CACHEBUSTING,t)t[a]=c(t[a]);for(var l in o){var u=o[l];"string"==typeof u&&n.push(i(u,t))}return n}function i(e,r){var n=(e=a(e,r)).match(/[^[\]]+(?=])/g);if(!n)return e;var o=_filterInstanceProperty(n).call(n,(function(e){return _indexOfInstanceProperty(t).call(t,e)>-1}));return 0===o.length?e:a(e,o=_reduceInstanceProperty(o).call(o,(function(e,t){return e[t]=-1,e}),{}))}function a(e,t){var r=e;for(var n in t){var o=t[n];r=r.replace(new RegExp("(?:\\[|%%)(".concat(n,")(?:\\]|%%)"),"g"),o)}return r}function s(e){return _Array$isArray(e)?_mapInstanceProperty(e).call(e,(function(e){return e&&e.hasOwnProperty("url")?e.url:e})):e}function n(e){return/^(https?:\/\/|\/\/)/.test(e)}function o(e,t){for(var r=0;r<t.length;r++)if(l(t[r],e))return!0;return!1}function l(e,t){if(e&&t){var r=_Object$getOwnPropertyNames(e),n=_Object$getOwnPropertyNames(t);return r.length===n.length&&e.id===t.id&&e.url===t.url}return!1}function c(e){return encodeURIComponent(e).replace(/[!'()*]/g,(function(e){return"%".concat(e.charCodeAt(0).toString(16))}))}function d(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return _padStartInstanceProperty(t=e.toString()).call(t,r,"0")}var u={track:function(e,t,n){var o;_forEachInstanceProperty(o=r(e,t,n)).call(o,(function(e){"undefined"!=typeof window&&null!==window&&((new Image).src=e)}))},resolveURLTemplates:r,extractURLsFromTemplates:s,filterUrlTemplates:function(e){return _reduceInstanceProperty(e).call(e,(function(e,t){var r=t.url||t;return n(r)?e.validUrls.push(r):e.invalidUrls.push(r),e}),{validUrls:[],invalidUrls:[]})},containsTemplateObject:o,isTemplateObjectEqual:l,encodeURIComponentRFC3986:c,replaceUrlMacros:i,isNumeric:function(e){return!isNaN(_parseFloat$1(e))&&isFinite(e)},flatten:function e(t){return _reduceInstanceProperty(t).call(t,(function(t,r){return _concatInstanceProperty(t).call(t,_Array$isArray(r)?e(r):r)}),[])},joinArrayOfUniqueTemplateObjs:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=_Array$isArray(t)?t:[],i=_Array$isArray(r)?r:[];return _reduceInstanceProperty(e=_concatInstanceProperty(n).call(n,i)).call(e,(function(e,t){return o(t,e)||e.push(t),e}),[])},isValidTimeValue:function(e){return _Number$isFinite(e)&&e>=-2},addLeadingZeros:d,isValidUrl:n,isBrowserEnvironment:function(){return"undefined"!=typeof window},formatMacrosValues:function(e){return"object"!=_typeof$3(e)?e:_JSON$stringify(e)}};function h(e){var t;return _includesInstanceProperty(t=["true","TRUE","True","1"]).call(t,e)}function p(e){if(null==e)return-1;if(u.isNumeric(e))return _parseInt$1(e);var t=e.split(":");if(3!==t.length)return-1;var r=t[2].split("."),n=_parseInt$1(r[0]);2===r.length&&(n+=_parseFloat$1("0.".concat(r[1])));var o=_parseInt$1(60*t[1]),i=_parseInt$1(60*t[0]*60);return isNaN(i)||isNaN(o)||isNaN(n)||o>3600||n>60?-1:i+o+n}var m={childByName:function(e,t){var r;return _findInstanceProperty(r=_Array$from(e.childNodes)).call(r,(function(e){return e.nodeName===t}))},childrenByName:function(e,t){var r;return _filterInstanceProperty(r=_Array$from(e.childNodes)).call(r,(function(e){return e.nodeName===t}))},resolveVastAdTagURI:function(e,t){if(!t)return e;if(_startsWithInstanceProperty(e).call(e,"//")){var r,n=location.protocol;return _concatInstanceProperty(r="".concat(n)).call(r,e)}if(!_includesInstanceProperty(e).call(e,"://")){var o,i=_sliceInstanceProperty(t).call(t,0,_lastIndexOfInstanceProperty(t).call(t,"/"));return _concatInstanceProperty(o="".concat(i,"/")).call(o,e)}return e},parseBoolean:h,parseNodeText:function(e){var t;return e&&_trimInstanceProperty(t=e.textContent||e.text||"").call(t)},copyNodeAttribute:function(e,t,r){var n=t.getAttribute(e);n&&r.setAttribute(e,n)},parseAttributes:function(e){var t;return _reduceInstanceProperty(t=_Array$from(e.attributes)).call(t,(function(e,t){return e[t.nodeName]=t.nodeValue,e}),{})},parseDuration:p,splitVAST:function(e){var t=[],r=null;return _forEachInstanceProperty(e).call(e,(function(n,o){if(n.sequence&&(n.sequence=_parseInt$1(n.sequence,10)),n.sequence>1){var i=e[o-1];if(i&&i.sequence===n.sequence-1)return void(r&&r.push(n));delete n.sequence}r=[n],t.push(r)})),t},assignAttributes:function(e,t){var r;e&&_forEachInstanceProperty(r=_Array$from(e)).call(r,(function(e){var r=e.nodeName,n=e.nodeValue;if(r&&n&&t.hasOwnProperty(r)){var o=n;"boolean"==typeof t[r]&&(o=h(o)),t[r]=o}}))},mergeWrapperAdData:function(e,t){var r,n,o,i,a,s,l,c,p;e.errorURLTemplates=_concatInstanceProperty(r=t.errorURLTemplates).call(r,e.errorURLTemplates),e.impressionURLTemplates=_concatInstanceProperty(n=t.impressionURLTemplates).call(n,e.impressionURLTemplates),e.extensions=_concatInstanceProperty(o=t.extensions).call(o,e.extensions),t.viewableImpression.length>0&&(e.viewableImpression=_concatInstanceProperty(i=[]).call(i,_toConsumableArray(e.viewableImpression),_toConsumableArray(t.viewableImpression))),e.followAdditionalWrappers=t.followAdditionalWrappers,e.allowMultipleAds=t.allowMultipleAds,e.fallbackOnNoAd=t.fallbackOnNoAd;var f=_filterInstanceProperty(a=t.creatives||[]).call(a,(function(e){return e&&"companion"===e.type})),d=_reduceInstanceProperty(f).call(f,(function(e,t){var r;return _forEachInstanceProperty(r=t.variations||[]).call(r,(function(t){var r;_forEachInstanceProperty(r=t.companionClickTrackingURLTemplates||[]).call(r,(function(t){u.containsTemplateObject(t,e)||e.push(t)}))})),e}),[]);e.creatives=_concatInstanceProperty(f).call(f,e.creatives);var h=t.videoClickTrackingURLTemplates&&t.videoClickTrackingURLTemplates.length,$=t.videoCustomClickURLTemplates&&t.videoCustomClickURLTemplates.length;if(_forEachInstanceProperty(s=e.creatives).call(s,(function(e){var r,n,o;if(t.trackingEvents&&t.trackingEvents[e.type])for(var i in t.trackingEvents[e.type]){var a,s=t.trackingEvents[e.type][i];_Array$isArray(e.trackingEvents[i])||(e.trackingEvents[i]=[]),e.trackingEvents[i]=_concatInstanceProperty(a=e.trackingEvents[i]).call(a,s)}"linear"===e.type&&(h&&(e.videoClickTrackingURLTemplates=_concatInstanceProperty(r=e.videoClickTrackingURLTemplates).call(r,t.videoClickTrackingURLTemplates)),$&&(e.videoCustomClickURLTemplates=_concatInstanceProperty(n=e.videoCustomClickURLTemplates).call(n,t.videoCustomClickURLTemplates)),!t.videoClickThroughURLTemplate||null!==e.videoClickThroughURLTemplate&&void 0!==e.videoClickThroughURLTemplate||(e.videoClickThroughURLTemplate=t.videoClickThroughURLTemplate)),"companion"===e.type&&d.length&&_forEachInstanceProperty(o=e.variations||[]).call(o,(function(e){e.companionClickTrackingURLTemplates=u.joinArrayOfUniqueTemplateObjs(e.companionClickTrackingURLTemplates,d)}))})),t.adVerifications&&(e.adVerifications=_concatInstanceProperty(l=e.adVerifications).call(l,t.adVerifications)),t.blockedAdCategories&&(e.blockedAdCategories=_concatInstanceProperty(c=e.blockedAdCategories).call(c,t.blockedAdCategories)),null!==(p=t.creatives)&&void 0!==p&&p.length){var y,g,v=_filterInstanceProperty(y=t.creatives).call(y,(function(e){var t;return(null===(t=e.icons)||void 0===t?void 0:t.length)&&!e.mediaFiles.length}));v.length&&(e.creatives=_concatInstanceProperty(g=e.creatives).call(g,v))}}};function g(t,r){var n,o=function(){var t=e(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{});return{id:t.id,adId:t.adId,sequence:t.sequence,apiFramework:t.apiFramework,type:"companion",required:null,variations:[]}}(r);return o.required=t.getAttribute("required")||null,o.variations=_mapInstanceProperty(n=m.childrenByName(t,"Companion")).call(n,(function(e){var t,r,n,o,i,a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{id:e.id||null,adType:"companionAd",width:e.width||0,height:e.height||0,assetWidth:e.assetWidth||null,assetHeight:e.assetHeight||null,expandedWidth:e.expandedWidth||null,expandedHeight:e.expandedHeight||null,apiFramework:e.apiFramework||null,adSlotId:e.adSlotId||null,pxratio:e.pxratio||"1",renderingMode:e.renderingMode||"default",staticResources:[],htmlResources:[],iframeResources:[],adParameters:null,altText:null,companionClickThroughURLTemplate:null,companionClickTrackingURLTemplates:[],trackingEvents:{}}}(m.parseAttributes(e));a.htmlResources=_reduceInstanceProperty(t=m.childrenByName(e,"HTMLResource")).call(t,(function(e,t){var r=m.parseNodeText(t);return r?_concatInstanceProperty(e).call(e,r):e}),[]),a.iframeResources=_reduceInstanceProperty(r=m.childrenByName(e,"IFrameResource")).call(r,(function(e,t){var r=m.parseNodeText(t);return r?_concatInstanceProperty(e).call(e,r):e}),[]),a.staticResources=_reduceInstanceProperty(n=m.childrenByName(e,"StaticResource")).call(n,(function(e,t){var r=m.parseNodeText(t);return r?_concatInstanceProperty(e).call(e,{url:r,creativeType:t.getAttribute("creativeType")||null}):e}),[]),a.altText=m.parseNodeText(m.childByName(e,"AltText"))||null;var s=m.childByName(e,"TrackingEvents");s&&_forEachInstanceProperty(o=m.childrenByName(s,"Tracking")).call(o,(function(e){var t=e.getAttribute("event"),r=m.parseNodeText(e);t&&r&&(_Array$isArray(a.trackingEvents[t])||(a.trackingEvents[t]=[]),a.trackingEvents[t].push(r))})),a.companionClickTrackingURLTemplates=_mapInstanceProperty(i=m.childrenByName(e,"CompanionClickTracking")).call(i,(function(e){return{id:e.getAttribute("id")||null,url:m.parseNodeText(e)}})),a.companionClickThroughURLTemplate=m.parseNodeText(m.childByName(e,"CompanionClickThrough"))||null;var l=m.childByName(e,"AdParameters");return l&&(a.adParameters={value:m.parseNodeText(l),xmlEncoded:l.getAttribute("xmlEncoded")||null}),a})),o}function v(t,r){var n,o,i,a,s=function(){var t=e(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{});return{id:t.id,adId:t.adId,sequence:t.sequence,apiFramework:t.apiFramework,type:"linear",duration:0,skipDelay:null,mediaFiles:[],mezzanine:null,interactiveCreativeFile:null,closedCaptionFiles:[],videoClickThroughURLTemplate:null,videoClickTrackingURLTemplates:[],videoCustomClickURLTemplates:[],adParameters:null,icons:[],trackingEvents:{}}}(r);s.duration=m.parseDuration(m.parseNodeText(m.childByName(t,"Duration")));var l=t.getAttribute("skipoffset");if(null==l)s.skipDelay=null;else if("%"===l.charAt(l.length-1)&&-1!==s.duration){var c=_parseInt$1(l,10);s.skipDelay=s.duration*(c/100)}else s.skipDelay=m.parseDuration(l);var u=m.childByName(t,"VideoClicks");if(u){var p,f,d=m.childByName(u,"ClickThrough");s.videoClickThroughURLTemplate=d?{id:d.getAttribute("id")||null,url:m.parseNodeText(d)}:null,_forEachInstanceProperty(p=m.childrenByName(u,"ClickTracking")).call(p,(function(e){s.videoClickTrackingURLTemplates.push({id:e.getAttribute("id")||null,url:m.parseNodeText(e)})})),_forEachInstanceProperty(f=m.childrenByName(u,"CustomClick")).call(f,(function(e){s.videoCustomClickURLTemplates.push({id:e.getAttribute("id")||null,url:m.parseNodeText(e)})}))}var h=m.childByName(t,"AdParameters");h&&(s.adParameters={value:m.parseNodeText(h),xmlEncoded:h.getAttribute("xmlEncoded")||null}),_forEachInstanceProperty(n=m.childrenByName(t,"TrackingEvents")).call(n,(function(e){var t;_forEachInstanceProperty(t=m.childrenByName(e,"Tracking")).call(t,(function(e){var t=e.getAttribute("event"),r=m.parseNodeText(e);if(t&&r){if("progress"===t){if(!(a=e.getAttribute("offset")))return;t="%"===a.charAt(a.length-1)?"progress-".concat(a):"progress-".concat(Math.round(m.parseDuration(a)))}_Array$isArray(s.trackingEvents[t])||(s.trackingEvents[t]=[]),s.trackingEvents[t].push(r)}}))})),_forEachInstanceProperty(o=m.childrenByName(t,"MediaFiles")).call(o,(function(e){var t,r;_forEachInstanceProperty(t=m.childrenByName(e,"MediaFile")).call(t,(function(e){s.mediaFiles.push(function(e){var t={id:null,fileURL:null,fileSize:0,deliveryType:"progressive",mimeType:null,mediaType:null,codec:null,bitrate:0,minBitrate:0,maxBitrate:0,width:0,height:0,apiFramework:null,scalable:null,maintainAspectRatio:null};t.id=e.getAttribute("id"),t.fileURL=m.parseNodeText(e),t.deliveryType=e.getAttribute("delivery"),t.codec=e.getAttribute("codec"),t.mimeType=e.getAttribute("type"),t.mediaType=e.getAttribute("mediaType")||"2D",t.apiFramework=e.getAttribute("apiFramework"),t.fileSize=_parseInt$1(e.getAttribute("fileSize")||0),t.bitrate=_parseInt$1(e.getAttribute("bitrate")||0),t.minBitrate=_parseInt$1(e.getAttribute("minBitrate")||0),t.maxBitrate=_parseInt$1(e.getAttribute("maxBitrate")||0),t.width=_parseInt$1(e.getAttribute("width")||0),t.height=_parseInt$1(e.getAttribute("height")||0);var r=e.getAttribute("scalable");r&&"string"==typeof r&&(t.scalable=m.parseBoolean(r));var n=e.getAttribute("maintainAspectRatio");return n&&"string"==typeof n&&(t.maintainAspectRatio=m.parseBoolean(n)),t}(e))}));var n,o,i=m.childByName(e,"InteractiveCreativeFile");i&&(s.interactiveCreativeFile=(n=i,o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:e.type||null,apiFramework:e.apiFramework||null,variableDuration:m.parseBoolean(e.variableDuration),fileURL:null}}(m.parseAttributes(n)),o.fileURL=m.parseNodeText(n),o));var a=m.childByName(e,"ClosedCaptionFiles");a&&_forEachInstanceProperty(r=m.childrenByName(a,"ClosedCaptionFile")).call(r,(function(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:e.type||null,language:e.language||null,fileURL:null}}(m.parseAttributes(e));t.fileURL=m.parseNodeText(e),s.closedCaptionFiles.push(t)}));var l=m.childByName(e,"Mezzanine"),c=function(e,t){var r={},n=!1;return _forEachInstanceProperty(t).call(t,(function(t){e&&e.getAttribute(t)?r[t]=e.getAttribute(t):n=!0})),n?null:r}(l,["delivery","type","width","height"]);if(c){var u={id:null,fileURL:null,delivery:null,codec:null,type:null,width:0,height:0,fileSize:0,mediaType:"2D"};u.id=l.getAttribute("id"),u.fileURL=m.parseNodeText(l),u.delivery=c.delivery,u.codec=l.getAttribute("codec"),u.type=c.type,u.width=_parseInt$1(c.width,10),u.height=_parseInt$1(c.height,10),u.fileSize=_parseInt$1(l.getAttribute("fileSize"),10),u.mediaType=l.getAttribute("mediaType")||"2D",s.mezzanine=u}}));var $=m.childByName(t,"Icons");return $&&_forEachInstanceProperty(i=m.childrenByName($,"Icon")).call(i,(function(e){s.icons.push(function(e,t,r,n){var o,i,a={program:null,height:0,width:0,xPosition:0,yPosition:0,apiFramework:null,offset:null,duration:0,type:null,staticResource:null,htmlResource:null,iframeResource:null,pxratio:"1",iconClickThroughURLTemplate:null,iconClickTrackingURLTemplates:[],iconViewTrackingURLTemplate:null,iconClickFallbackImages:[]};a.program=e.getAttribute("program"),a.height=_parseInt$1(e.getAttribute("height")||0),a.width=_parseInt$1(e.getAttribute("width")||0),a.xPosition=(o=e.getAttribute("xPosition"),-1!==_indexOfInstanceProperty(i=["left","right"]).call(i,o)?o:_parseInt$1(o||0)),a.yPosition=function(e,t){return-1!==_indexOfInstanceProperty(t=["top","bottom"]).call(t,e)?e:_parseInt$1(e||0)}(e.getAttribute("yPosition")),a.apiFramework=e.getAttribute("apiFramework"),a.pxratio=e.getAttribute("pxratio")||"1",a.offset=m.parseDuration(e.getAttribute("offset")),a.duration=m.parseDuration(e.getAttribute("duration")),_forEachInstanceProperty(t=m.childrenByName(e,"HTMLResource")).call(t,(function(e){a.type=e.getAttribute("creativeType")||"text/html",a.htmlResource=m.parseNodeText(e)})),_forEachInstanceProperty(r=m.childrenByName(e,"IFrameResource")).call(r,(function(e){a.type=e.getAttribute("creativeType")||0,a.iframeResource=m.parseNodeText(e)})),_forEachInstanceProperty(n=m.childrenByName(e,"StaticResource")).call(n,(function(e){a.type=e.getAttribute("creativeType")||0,a.staticResource=m.parseNodeText(e)}));var s=m.childByName(e,"IconClicks");if(s){var l,c;a.iconClickThroughURLTemplate=m.parseNodeText(m.childByName(s,"IconClickThrough")),_forEachInstanceProperty(l=m.childrenByName(s,"IconClickTracking")).call(l,(function(e){a.iconClickTrackingURLTemplates.push({id:e.getAttribute("id")||null,url:m.parseNodeText(e)})}));var u=m.childByName(s,"IconClickFallbackImages");u&&_forEachInstanceProperty(c=m.childrenByName(u,"IconClickFallbackImage")).call(c,(function(e){a.iconClickFallbackImages.push({url:m.parseNodeText(e)||null,width:e.getAttribute("width")||null,height:e.getAttribute("height")||null})}))}return a.iconViewTrackingURLTemplate=m.parseNodeText(m.childByName(e,"IconViewTracking")),a}(e))})),s}function f(t,r){var n,o,i=function(){var t=e(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{});return{id:t.id,adId:t.adId,sequence:t.sequence,apiFramework:t.apiFramework,type:"nonlinear",variations:[],trackingEvents:{}}}(r);return _forEachInstanceProperty(n=m.childrenByName(t,"TrackingEvents")).call(n,(function(e){var t,r,n;_forEachInstanceProperty(t=m.childrenByName(e,"Tracking")).call(t,(function(e){r=e.getAttribute("event"),n=m.parseNodeText(e),r&&n&&(_Array$isArray(i.trackingEvents[r])||(i.trackingEvents[r]=[]),i.trackingEvents[r].push(n))}))})),_forEachInstanceProperty(o=m.childrenByName(t,"NonLinear")).call(o,(function(e){var t,r,n,o,a={id:null,width:0,height:0,expandedWidth:0,expandedHeight:0,scalable:!0,maintainAspectRatio:!0,minSuggestedDuration:0,apiFramework:"static",adType:"nonLinearAd",type:null,staticResource:null,htmlResource:null,iframeResource:null,nonlinearClickThroughURLTemplate:null,nonlinearClickTrackingURLTemplates:[],adParameters:null};a.id=e.getAttribute("id")||null,a.width=e.getAttribute("width"),a.height=e.getAttribute("height"),a.expandedWidth=e.getAttribute("expandedWidth"),a.expandedHeight=e.getAttribute("expandedHeight"),a.scalable=m.parseBoolean(e.getAttribute("scalable")),a.maintainAspectRatio=m.parseBoolean(e.getAttribute("maintainAspectRatio")),a.minSuggestedDuration=m.parseDuration(e.getAttribute("minSuggestedDuration")),a.apiFramework=e.getAttribute("apiFramework"),_forEachInstanceProperty(t=m.childrenByName(e,"HTMLResource")).call(t,(function(e){a.type=e.getAttribute("creativeType")||"text/html",a.htmlResource=m.parseNodeText(e)})),_forEachInstanceProperty(r=m.childrenByName(e,"IFrameResource")).call(r,(function(e){a.type=e.getAttribute("creativeType")||0,a.iframeResource=m.parseNodeText(e)})),_forEachInstanceProperty(n=m.childrenByName(e,"StaticResource")).call(n,(function(e){a.type=e.getAttribute("creativeType")||0,a.staticResource=m.parseNodeText(e)}));var s=m.childByName(e,"AdParameters");s&&(a.adParameters={value:m.parseNodeText(s),xmlEncoded:s.getAttribute("xmlEncoded")||null}),a.nonlinearClickThroughURLTemplate=m.parseNodeText(m.childByName(e,"NonLinearClickThrough")),_forEachInstanceProperty(o=m.childrenByName(e,"NonLinearClickTracking")).call(o,(function(e){a.nonlinearClickTrackingURLTemplates.push({id:e.getAttribute("id")||null,url:m.parseNodeText(e)})})),i.variations.push(a)})),i}function T(e){var t=[];return _forEachInstanceProperty(e).call(e,(function(e){var r=A(e);r&&t.push(r)})),t}function A(e){var t;if("#comment"===e.nodeName)return null;var r,n={name:null,value:null,attributes:{},children:[]},o=e.attributes,i=e.childNodes;if(n.name=e.nodeName,e.attributes)for(var a in o)if(o.hasOwnProperty(a)){var s=o[a];s.nodeName&&s.nodeValue&&(n.attributes[s.nodeName]=s.nodeValue)}for(var l in i)if(i.hasOwnProperty(l)){var c=A(i[l]);c&&n.children.push(c)}if(0===n.children.length||1===n.children.length&&_indexOfInstanceProperty(t=["#cdata-section","#text"]).call(t,n.children[0].name)>=0){var u=m.parseNodeText(e);""!==u&&(n.value=u),n.children=[]}return null===(r=n).value&&0===_Object$keys(r.attributes).length&&0===r.children.length?null:n}function R(e){return e.getAttribute("AdID")||e.getAttribute("adID")||e.getAttribute("adId")||null}var y={Wrapper:{subElements:["VASTAdTagURI","Impression"]},BlockedAdCategories:{attributes:["authority"]},InLine:{subElements:["AdSystem","AdTitle","Impression","AdServingId","Creatives"]},Category:{attributes:["authority"]},Pricing:{attributes:["model","currency"]},Verification:{oneOfinLineResources:["JavaScriptResource","ExecutableResource"],attributes:["vendor"]},UniversalAdId:{attributes:["idRegistry"]},JavaScriptResource:{attributes:["apiFramework","browserOptional"]},ExecutableResource:{attributes:["apiFramework","type"]},Tracking:{attributes:["event"]},Creatives:{subElements:["Creative"]},Creative:{subElements:["UniversalAdId"]},Linear:{subElements:["MediaFiles","Duration"]},MediaFiles:{subElements:["MediaFile"]},MediaFile:{attributes:["delivery","type","width","height"]},Mezzanine:{attributes:["delivery","type","width","height"]},NonLinear:{oneOfinLineResources:["StaticResource","IFrameResource","HTMLResource"],attributes:["width","height"]},Companion:{oneOfinLineResources:["StaticResource","IFrameResource","HTMLResource"],attributes:["width","height"]},StaticResource:{attributes:["creativeType"]},Icons:{subElements:["Icon"]},Icon:{oneOfinLineResources:["StaticResource","IFrameResource","HTMLResource"]}};function k(e,t){var r;if(y[e.nodeName]&&y[e.nodeName].attributes){var n=_filterInstanceProperty(r=y[e.nodeName].attributes).call(r,(function(t){return!e.getAttribute(t)}));n.length>0&&N({name:e.nodeName,parentName:e.parentNode.nodeName,attributes:n},t)}}function E(e,t,r){var n,o=y[e.nodeName],i=!r&&"Wrapper"!==e.nodeName;if(o&&!i){if(o.subElements){var a,s=_filterInstanceProperty(a=o.subElements).call(a,(function(t){return!m.childByName(e,t)}));s.length>0&&N({name:e.nodeName,parentName:e.parentNode.nodeName,subElements:s},t)}r&&o.oneOfinLineResources&&(_someInstanceProperty(n=o.oneOfinLineResources).call(n,(function(t){return m.childByName(e,t)}))||N({name:e.nodeName,parentName:e.parentNode.nodeName,oneOfResources:o.oneOfinLineResources},t))}}function b(e){return e.children&&0!==e.children.length}function N(e,t){var r=e.name,n=e.parentName,o=e.attributes,i=e.subElements,a=e.oneOfResources,s="Element '".concat(r,"'");t("VAST-warning",{message:s+=o?" missing required attribute(s) '".concat(o.join(", "),"' "):i?" missing required sub element(s) '".concat(i.join(", "),"' "):a?" must provide one of the following '".concat(a.join(", "),"' "):" is empty",parentElement:n,specVersion:4.1})}var w={verifyRequiredValues:function e(t,r,n){if(t&&t.nodeName)if("InLine"===t.nodeName&&(n=!0),k(t,r),b(t)){E(t,r,n);for(var o=0;o<t.children.length;o++)e(t.children[o],r,n)}else 0===m.parseNodeText(t).length&&N({name:t.nodeName,parentName:t.parentNode.nodeName},r)},hasSubElements:b,emitMissingValueWarning:N,verifyRequiredAttributes:k,verifyRequiredSubElements:E};function L(e,t){var r,n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=o.allowMultipleAds,a=o.followAdditionalWrappers,s=_createForOfIteratorHelper(_filterInstanceProperty(r=_Array$from(e.childNodes)).call(r,(function(e){var t=e.nodeName.toLowerCase();return"inline"===t||!1!==a&&"wrapper"===t})));try{for(s.s();!(n=s.n()).done;){var l=n.value;if(m.copyNodeAttribute("id",e,l),m.copyNodeAttribute("sequence",e,l),m.copyNodeAttribute("adType",e,l),"Wrapper"===l.nodeName)return{ad:I(l,t),type:"WRAPPER"};if("InLine"===l.nodeName)return{ad:C(l,t,{allowMultipleAds:i}),type:"INLINE"};var c=l.nodeName.toLowerCase();t("VAST-warning",{message:"<".concat(l.nodeName,"inline"===c?"> must be written <InLine>":"> must be written <Wrapper>"),wrongNode:l})}}catch(e){s.e(e)}finally{s.f()}}function C(e,t){return!1===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).allowMultipleAds&&e.getAttribute("sequence")?null:U(e,t)}function U(e,t){var r,n=[];t&&w.verifyRequiredValues(e,t);var o=_Array$from(e.childNodes),i=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{id:e.id||null,sequence:e.sequence||null,adType:e.adType||null,adServingId:null,categories:[],expires:null,viewableImpression:[],system:null,title:null,description:null,advertiser:null,pricing:null,survey:null,errorURLTemplates:[],impressionURLTemplates:[],creatives:[],extensions:[],adVerifications:[],blockedAdCategories:[],followAdditionalWrappers:!0,allowMultipleAds:!1,fallbackOnNoAd:null}}(m.parseAttributes(e));return _forEachInstanceProperty(o).call(o,(function(e){switch(e.nodeName){case"Error":i.errorURLTemplates.push(m.parseNodeText(e));break;case"Impression":i.impressionURLTemplates.push({id:e.getAttribute("id")||null,url:m.parseNodeText(e)});break;case"Creatives":i.creatives=(r=m.childrenByName(e,"Creative"),o=[],_forEachInstanceProperty(r).call(r,(function(e){var t,r,n={id:e.getAttribute("id")||null,adId:R(e),sequence:e.getAttribute("sequence")||null,apiFramework:e.getAttribute("apiFramework")||null},i=[];_forEachInstanceProperty(t=m.childrenByName(e,"UniversalAdId")).call(t,(function(e){var t={idRegistry:e.getAttribute("idRegistry")||"unknown",value:m.parseNodeText(e)};i.push(t)}));var a=m.childByName(e,"CreativeExtensions");for(var s in a&&(r=T(m.childrenByName(a,"CreativeExtension"))),e.childNodes){var l=e.childNodes[s],c=void 0;switch(l.nodeName){case"Linear":c=v(l,n);break;case"NonLinearAds":c=f(l,n);break;case"CompanionAds":c=g(l,n)}c&&(i&&(c.universalAdIds=i),r&&(c.creativeExtensions=r),o.push(c))}})),o);break;case"Extensions":var t=m.childrenByName(e,"Extension");i.extensions=T(t),i.adVerifications.length||(n=function(e){var t=null,r=[];return _someInstanceProperty(e).call(e,(function(e){return t=m.childByName(e,"AdVerifications")})),t&&(r=x(m.childrenByName(t,"Verification"))),r}(t));break;case"AdVerifications":i.adVerifications=x(m.childrenByName(e,"Verification"));break;case"AdSystem":i.system={value:m.parseNodeText(e),version:e.getAttribute("version")||null};break;case"AdTitle":i.title=m.parseNodeText(e);break;case"AdServingId":i.adServingId=m.parseNodeText(e);break;case"Category":i.categories.push({authority:e.getAttribute("authority")||null,value:m.parseNodeText(e)});break;case"Expires":i.expires=_parseInt$1(m.parseNodeText(e),10);break;case"ViewableImpression":i.viewableImpression.push(function(e,t,r,n){var o=function(e,t){var r=m.parseNodeText(t);return r&&e.push(r),e};return{id:e.getAttribute("id")||null,viewable:_reduceInstanceProperty(t=m.childrenByName(e,"Viewable")).call(t,o,[]),notViewable:_reduceInstanceProperty(r=m.childrenByName(e,"NotViewable")).call(r,o,[]),viewUndetermined:_reduceInstanceProperty(n=m.childrenByName(e,"ViewUndetermined")).call(n,o,[])}}(e));break;case"Description":i.description=m.parseNodeText(e);break;case"Advertiser":i.advertiser={id:e.getAttribute("id")||null,value:m.parseNodeText(e)};break;case"Pricing":i.pricing={value:m.parseNodeText(e),model:e.getAttribute("model")||null,currency:e.getAttribute("currency")||null};break;case"Survey":i.survey={value:m.parseNodeText(e),type:e.getAttribute("type")||null};break;case"BlockedAdCategories":i.blockedAdCategories.push({authority:e.getAttribute("authority")||null,value:m.parseNodeText(e)})}var r,o})),n.length&&(i.adVerifications=_concatInstanceProperty(r=i.adVerifications).call(r,n)),i}function I(e,t){var r,n=U(e,t),o=e.getAttribute("followAdditionalWrappers"),i=e.getAttribute("allowMultipleAds"),a=e.getAttribute("fallbackOnNoAd");n.followAdditionalWrappers=!o||m.parseBoolean(o),n.allowMultipleAds=!!i&&m.parseBoolean(i),n.fallbackOnNoAd=a?m.parseBoolean(a):null;var s=m.childByName(e,"VASTAdTagURI");if(s?n.nextWrapperURL=m.parseNodeText(s):(s=m.childByName(e,"VASTAdTagURL"))&&(n.nextWrapperURL=m.parseNodeText(m.childByName(s,"URL"))),_forEachInstanceProperty(r=n.creatives).call(r,(function(e){var t;if(_includesInstanceProperty(t=["linear","nonlinear"]).call(t,e.type)){var r,o;if(e.trackingEvents){n.trackingEvents||(n.trackingEvents={}),n.trackingEvents[e.type]||(n.trackingEvents[e.type]={});var i=function(t){var r=e.trackingEvents[t];_Array$isArray(n.trackingEvents[e.type][t])||(n.trackingEvents[e.type][t]=[]),_forEachInstanceProperty(r).call(r,(function(r){n.trackingEvents[e.type][t].push(r)}))};for(var a in e.trackingEvents)i(a)}e.videoClickTrackingURLTemplates&&(_Array$isArray(n.videoClickTrackingURLTemplates)||(n.videoClickTrackingURLTemplates=[]),_forEachInstanceProperty(r=e.videoClickTrackingURLTemplates).call(r,(function(e){n.videoClickTrackingURLTemplates.push(e)}))),e.videoClickThroughURLTemplate&&(n.videoClickThroughURLTemplate=e.videoClickThroughURLTemplate),e.videoCustomClickURLTemplates&&(_Array$isArray(n.videoCustomClickURLTemplates)||(n.videoCustomClickURLTemplates=[]),_forEachInstanceProperty(o=e.videoCustomClickURLTemplates).call(o,(function(e){n.videoCustomClickURLTemplates.push(e)})))}})),n.nextWrapperURL)return n}function x(e){var t=[];return _forEachInstanceProperty(e).call(e,(function(e){var r,n={resource:null,vendor:null,browserOptional:!1,apiFramework:null,type:null,parameters:null,trackingEvents:{}},o=_Array$from(e.childNodes);m.assignAttributes(e.attributes,n),_forEachInstanceProperty(o).call(o,(function(e){var t=e.nodeName,r=e.textContent,o=e.attributes;switch(t){case"JavaScriptResource":case"ExecutableResource":n.resource=_trimInstanceProperty(r).call(r),m.assignAttributes(o,n);break;case"VerificationParameters":n.parameters=_trimInstanceProperty(r).call(r)}}));var i=m.childByName(e,"TrackingEvents");i&&_forEachInstanceProperty(r=m.childrenByName(i,"Tracking")).call(r,(function(e){var t=e.getAttribute("event"),r=m.parseNodeText(e);t&&r&&(_Array$isArray(n.trackingEvents[t])||(n.trackingEvents[t]=[]),n.trackingEvents[t].push(r))})),t.push(n)})),t}var S=function(){function e(){_classCallCheck$3(this,e),this._handlers=[]}return _createClass$3(e,[{key:"on",value:function(e,t){if("function"!=typeof t)throw new TypeError("The handler argument must be of type Function. Received type ".concat(_typeof$3(t)));if(!e)throw new TypeError("The event argument must be of type String. Received type ".concat(_typeof$3(e)));return this._handlers.push({event:e,handler:t}),this}},{key:"once",value:function(e,t){return this.on(e,function(e,t,r){var n={fired:!1,wrapFn:void 0};function o(){n.fired||(e.off(t,n.wrapFn),n.fired=!0,_bindInstanceProperty(r).call(r,e).apply(void 0,arguments))}return n.wrapFn=o,o}(this,e,t))}},{key:"off",value:function(e,t){var r;return this._handlers=_filterInstanceProperty(r=this._handlers).call(r,(function(r){return r.event!==e||r.handler!==t})),this}},{key:"emit",value:function(e){for(var t,r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];var i=!1;return _forEachInstanceProperty(t=this._handlers).call(t,(function(t){var r;"*"===t.event&&(i=!0,t.handler.apply(t,_concatInstanceProperty(r=[e]).call(r,n))),t.event===e&&(i=!0,t.handler.apply(t,n))})),i}},{key:"removeAllListeners",value:function(e){var t;return e?(this._handlers=_filterInstanceProperty(t=this._handlers).call(t,(function(t){return t.event!==e})),this):(this._handlers=[],this)}},{key:"listenerCount",value:function(e){var t;return _filterInstanceProperty(t=this._handlers).call(t,(function(t){return t.event===e})).length}},{key:"listeners",value:function(e){var t;return _reduceInstanceProperty(t=this._handlers).call(t,(function(t,r){return r.event===e&&t.push(r.handler),t}),[])}},{key:"eventNames",value:function(){var e;return _mapInstanceProperty(e=this._handlers).call(e,(function(e){return e.event}))}}]),e}(),D=0,V=0,O=function(e,t){!e||!t||e<=0||t<=0||(V=(V*D+8*e/t)/++D)},F={ERRORCODE:900,extensions:[]},B="VAST response version not supported",P=function(e){_inherits$2(r,S);var t=_createSuper$2(r);function r(){var e;_classCallCheck$3(this,r);var n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).fetcher;return(e=t.call(this)).maxWrapperDepth=null,e.rootErrorURLTemplates=[],e.errorURLTemplates=[],e.remainingAds=[],e.parsingOptions={},e.fetcher=n||null,e}return _createClass$3(r,[{key:"trackVastError",value:function(e,t){for(var r,n=arguments.length,o=new Array(n>2?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];this.emit("VAST-error",_Object$assign.apply(Object,_concatInstanceProperty(r=[{},F,t]).call(r,o))),u.track(e,t)}},{key:"getErrorURLTemplates",value:function(){var e;return _concatInstanceProperty(e=this.rootErrorURLTemplates).call(e,this.errorURLTemplates)}},{key:"getEstimatedBitrate",value:function(){return V}},{key:"initParsingStatus",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.maxWrapperDepth=e.wrapperLimit||10,this.parsingOptions={allowMultipleAds:e.allowMultipleAds},this.rootURL="",this.resetParsingStatus(),O(e.byteLength,e.requestDuration)}},{key:"resetParsingStatus",value:function(){this.errorURLTemplates=[],this.rootErrorURLTemplates=[],this.vastVersion=null}},{key:"getRemainingAds",value:function(e){var t=this;if(0===this.remainingAds.length)return _Promise.reject(new Error("No more ads are available for the given VAST"));var r=e?u.flatten(this.remainingAds):this.remainingAds.shift();return this.errorURLTemplates=[],this.resolveAds(r,{wrapperDepth:0,url:this.rootURL}).then((function(e){return t.buildVASTResponse(e)}))}},{key:"parseVAST",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.initParsingStatus(r),r.isRootVAST=!0,this.parse(e,r).then((function(e){return t.buildVASTResponse(e)}))}},{key:"buildVASTResponse",value:function(e){var t,r={ads:(t={ads:e,errorURLTemplates:this.getErrorURLTemplates(),version:this.vastVersion}).ads||[],errorURLTemplates:t.errorURLTemplates||[],version:t.version||null};return this.completeWrapperResolving(r),r}},{key:"parseVastXml",value:function(e,t){var r=t.isRootVAST,n=void 0!==r&&r,o=t.url,i=void 0===o?null:o,a=t.wrapperDepth,s=void 0===a?0:a,l=t.allowMultipleAds,c=t.followAdditionalWrappers;if(!e||!e.documentElement||"VAST"!==e.documentElement.nodeName){var u;this.emit("VAST-ad-parsed",{type:"ERROR",url:i,wrapperDepth:s});var p="VideoAdServingTemplate"===(null==e||null===(u=e.documentElement)||void 0===u?void 0:u.nodeName);throw new Error(p?B:"Invalid VAST XMLDocument")}var f=[],d=e.documentElement.childNodes,h=e.documentElement.getAttribute("version");for(var $ in n&&h&&(this.vastVersion=h),d){var y=d[$];if("Error"===y.nodeName){var g=m.parseNodeText(y);n?this.rootErrorURLTemplates.push(g):this.errorURLTemplates.push(g)}else if("Ad"===y.nodeName){var v;if(this.vastVersion&&_parseFloat$1(this.vastVersion)<3)l=!0;else if(!1===l&&f.length>1)break;var _=L(y,_bindInstanceProperty(v=this.emit).call(v,this),{allowMultipleAds:l,followAdditionalWrappers:c});_.ad?(f.push(_.ad),this.emit("VAST-ad-parsed",{type:_.type,url:i,wrapperDepth:s,adIndex:f.length-1,vastVersion:h})):this.trackVastError(this.getErrorURLTemplates(),{ERRORCODE:101})}}return f}},{key:"parse",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.url,n=void 0===r?null:r,o=t.resolveAll,i=void 0===o||o,a=t.wrapperSequence,s=void 0===a?null:a,l=t.previousUrl,c=void 0===l?null:l,u=t.wrapperDepth,p=void 0===u?0:u,f=t.isRootVAST,d=void 0!==f&&f,h=t.followAdditionalWrappers,$=t.allowMultipleAds,y=[];this.vastVersion&&_parseFloat$1(this.vastVersion)<3&&d&&($=!0);try{y=this.parseVastXml(e,{isRootVAST:d,url:n,wrapperDepth:p,allowMultipleAds:$,followAdditionalWrappers:h})}catch(e){return _Promise.reject(e)}return 1===y.length&&null!=s&&(y[0].sequence=s),!1===i&&(this.remainingAds=m.splitVAST(y),y=this.remainingAds.shift()),this.resolveAds(y,{wrapperDepth:p,previousUrl:c,url:n})}},{key:"resolveAds",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1?arguments[1]:void 0,n=r.wrapperDepth,o=r.previousUrl,i=r.url,a=[];return o=i,_forEachInstanceProperty(t).call(t,(function(t){var r=e.resolveWrappers(t,n,o);a.push(r)})),_Promise.all(a).then((function(e){return u.flatten(e)}))}},{key:"resolveWrappers",value:function(e,t,r){var n=this,o=_objectSpread2({},e);return new _Promise((function(e){var i,a;if(t++,!o.nextWrapperURL)return delete o.nextWrapperURL,e(o);if(!n.fetcher)return o.VASTAdTagURI=o.nextWrapperURL,delete o.nextWrapperURL,e(o);if(t>=n.maxWrapperDepth)return o.errorCode=302,delete o.nextWrapperURL,e(o);o.nextWrapperURL=m.resolveVastAdTagURI(o.nextWrapperURL,r);var s=null!==(a=n.parsingOptions.allowMultipleAds)&&void 0!==a?a:o.allowMultipleAds,l=o.sequence;n.fetcher.fetchVAST({url:o.nextWrapperURL,emitter:_bindInstanceProperty(i=n.emit).call(i,n),maxWrapperDepth:n.maxWrapperDepth}).then((function(i){return n.parse(i,{url:o.nextWrapperURL,previousUrl:r,wrapperSequence:l,wrapperDepth:t,followAdditionalWrappers:o.followAdditionalWrappers,allowMultipleAds:s}).then((function(t){if(delete o.nextWrapperURL,0===t.length)return o.creatives=[],e(o);_forEachInstanceProperty(t).call(t,(function(e){e&&m.mergeWrapperAdData(e,o)})),e(t)}))})).catch((function(t){o.errorCode=t.message===B?102:301,o.errorMessage=t.message,e(o)}))}))}},{key:"completeWrapperResolving",value:function(e){if(0===e.ads.length)this.trackVastError(e.errorURLTemplates,{ERRORCODE:303});else for(var t=e.ads.length-1;t>=0;t--){var r,n,o,i=e.ads[t],a=!_someInstanceProperty(r=i.creatives).call(r,(function(e){var t;return(null===(t=e.mediaFiles)||void 0===t?void 0:t.length)>0}));!i.errorCode&&!a||i.VASTAdTagURI||(this.trackVastError(_concatInstanceProperty(n=i.errorURLTemplates).call(n,e.errorURLTemplates),{ERRORCODE:i.errorCode||303},{ERRORMESSAGE:i.errorMessage||""},{extensions:i.extensions},{system:i.system}),_spliceInstanceProperty(o=e.ads).call(o,t,1))}}}]),r}(),z=function(e){_inherits$2(r,S);var t=_createSuper$2(r);function r(e,n,o){var i;_classCallCheck$3(this,r);var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];for(var l in(i=t.call(this)).ad=n,i.creative=o,i.variation=a,i.muted=s,i.impressed=!1,i.skippable=!1,i.trackingEvents={},i.lastPercentage=0,i._alreadyTriggeredQuartiles={},i.emitAlwaysEvents=["creativeView","start","firstQuartile","midpoint","thirdQuartile","complete","resume","pause","rewind","skip","closeLinear","close"],i.creative.trackingEvents){var c=i.creative.trackingEvents[l];i.trackingEvents[l]=_sliceInstanceProperty(c).call(c,0)}return"linear"!==i.creative.type?i._initVariationTracking():i._initLinearTracking(),e&&i.on("start",(function(){e.lastSuccessfulAd=_Date$now()})),i}return _createClass$3(r,[{key:"_initLinearTracking",value:function(){this.linear=!0,this.skipDelay=this.creative.skipDelay,this.setDuration(this.creative.duration),this.clickThroughURLTemplate=this.creative.videoClickThroughURLTemplate,this.clickTrackingURLTemplates=this.creative.videoClickTrackingURLTemplates}},{key:"_initVariationTracking",value:function(){if(this.linear=!1,this.skipDelay=-1,this.variation){for(var e in this.variation.trackingEvents){var t,r=this.variation.trackingEvents[e];this.trackingEvents[e]?this.trackingEvents[e]=_concatInstanceProperty(t=this.trackingEvents[e]).call(t,_sliceInstanceProperty(r).call(r,0)):this.trackingEvents[e]=_sliceInstanceProperty(r).call(r,0)}"nonLinearAd"===this.variation.adType?(this.clickThroughURLTemplate=this.variation.nonlinearClickThroughURLTemplate,this.clickTrackingURLTemplates=this.variation.nonlinearClickTrackingURLTemplates,this.setDuration(this.variation.minSuggestedDuration)):"companionAd"===this.variation.adType&&(this.clickThroughURLTemplate=this.variation.companionClickThroughURLTemplate,this.clickTrackingURLTemplates=this.variation.companionClickTrackingURLTemplates)}}},{key:"setDuration",value:function(e){u.isValidTimeValue(e)?(this.assetDuration=e,this.quartiles={firstQuartile:Math.round(25*this.assetDuration)/100,midpoint:Math.round(50*this.assetDuration)/100,thirdQuartile:Math.round(75*this.assetDuration)/100}):this.emit("TRACKER-error",{message:"the duration provided is not valid. duration: ".concat(e)})}},{key:"setProgress",value:function(e){var t,r=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(u.isValidTimeValue(e)&&"object"==_typeof$3(n)){var i=this.skipDelay||-1;if(-1===i||this.skippable||(i>e?this.emit("skip-countdown",i-e):(this.skippable=!0,this.emit("skip-countdown",0))),this.assetDuration>0){var a=Math.round(e/this.assetDuration*100),s=[];if(e>0){s.push("start");for(var l=this.lastPercentage;l<a;l++)s.push("progress-".concat(l+1,"%"));for(var c in s.push("progress-".concat(Math.round(e))),this.quartiles)this.isQuartileReached(c,this.quartiles[c],e)&&(s.push(c),this._alreadyTriggeredQuartiles[c]=!0);this.lastPercentage=a}_forEachInstanceProperty(s).call(s,(function(e){r.track(e,{macros:n,once:o})})),e<this.progress&&this.track("rewind",{macros:n})}this.progress=e}else this.emit("TRACKER-error",{message:_concatInstanceProperty(t="One given setProgress parameter has the wrong type. progress: ".concat(e,", macros: ")).call(t,u.formatMacrosValues(n))})}},{key:"isQuartileReached",value:function(e,t,r){var n=!1;return t<=r&&!this._alreadyTriggeredQuartiles[e]&&(n=!0),n}},{key:"setMuted",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"boolean"==typeof e&&"object"==_typeof$3(r)?(this.muted!==e&&this.track(e?"mute":"unmute",{macros:r}),this.muted=e):this.emit("TRACKER-error",{message:_concatInstanceProperty(t="One given setMuted parameter has the wrong type. muted: ".concat(e,", macros: ")).call(t,u.formatMacrosValues(r))})}},{key:"setPaused",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"boolean"==typeof e&&"object"==_typeof$3(r)?(this.paused!==e&&this.track(e?"pause":"resume",{macros:r}),this.paused=e):this.emit("TRACKER-error",{message:_concatInstanceProperty(t="One given setPaused parameter has the wrong type. paused: ".concat(e,", macros: ")).call(t,u.formatMacrosValues(r))})}},{key:"setFullscreen",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"boolean"==typeof e&&"object"==_typeof$3(r)?(this.fullscreen!==e&&this.track(e?"fullscreen":"exitFullscreen",{macros:r}),this.fullscreen=e):this.emit("TRACKER-error",{message:_concatInstanceProperty(t="One given setFullScreen parameter has the wrong type. fullscreen: ".concat(e,", macros: ")).call(t,u.formatMacrosValues(r))})}},{key:"setExpand",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"boolean"==typeof e&&"object"==_typeof$3(r)?(this.expanded!==e&&(this.track(e?"expand":"collapse",{macros:r}),this.track(e?"playerExpand":"playerCollapse",{macros:r})),this.expanded=e):this.emit("TRACKER-error",{message:_concatInstanceProperty(t="One given setExpand parameter has the wrong type. expanded: ".concat(e,", macros: ")).call(t,u.formatMacrosValues(r))})}},{key:"setSkipDelay",value:function(e){u.isValidTimeValue(e)?this.skipDelay=e:this.emit("TRACKER-error",{message:"setSkipDelay parameter does not have a valid value. duration: ".concat(e)})}},{key:"trackImpression",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"==_typeof$3(e)?this.impressed||(this.impressed=!0,this.trackURLs(this.ad.impressionURLTemplates,e),this.track("creativeView",{macros:e})):this.emit("TRACKER-error",{message:"trackImpression parameter has the wrong type. macros: ".concat(e)})}},{key:"trackViewableImpression",value:function(){var e,t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"==_typeof$3(r)?_forEachInstanceProperty(e=this.ad.viewableImpression).call(e,(function(e){t.trackURLs(e.viewable,r)})):this.emit("TRACKER-error",{message:"trackViewableImpression given macros has the wrong type. macros: ".concat(r)})}},{key:"trackNotViewableImpression",value:function(){var e,t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"==_typeof$3(r)?_forEachInstanceProperty(e=this.ad.viewableImpression).call(e,(function(e){t.trackURLs(e.notViewable,r)})):this.emit("TRACKER-error",{message:"trackNotViewableImpression given macros has the wrong type. macros: ".concat(r)})}},{key:"trackUndeterminedImpression",value:function(){var e,t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"==_typeof$3(r)?_forEachInstanceProperty(e=this.ad.viewableImpression).call(e,(function(e){t.trackURLs(e.viewUndetermined,r)})):this.emit("TRACKER-error",{message:"trackUndeterminedImpression given macros has the wrong type. macros: ".concat(r)})}},{key:"error",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];"object"==_typeof$3(t)&&"boolean"==typeof r?this.trackURLs(this.ad.errorURLTemplates,t,{isCustomCode:r}):this.emit("TRACKER-error",{message:_concatInstanceProperty(e="One given error parameter has the wrong type. macros: ".concat(u.formatMacrosValues(t),", isCustomCode: ")).call(e,r)})}},{key:"errorWithCode",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];"string"==typeof e&&"boolean"==typeof r?(this.error({ERRORCODE:e},r),console.log("The method errorWithCode is deprecated, please use vast tracker error method instead")):this.emit("TRACKER-error",{message:_concatInstanceProperty(t="One given errorWithCode parameter has the wrong type. errorCode: ".concat(e,", isCustomCode: ")).call(t,r)})}},{key:"complete",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"==_typeof$3(e)?this.track("complete",{macros:e}):this.emit("TRACKER-error",{message:"complete given macros has the wrong type. macros: ".concat(e)})}},{key:"notUsed",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"==_typeof$3(e)?(this.track("notUsed",{macros:e}),this.trackingEvents=[]):this.emit("TRACKER-error",{message:"notUsed given macros has the wrong type. macros: ".concat(e)})}},{key:"otherAdInteraction",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"==_typeof$3(e)?this.track("otherAdInteraction",{macros:e}):this.emit("TRACKER-error",{message:"otherAdInteraction given macros has the wrong type. macros: ".concat(e)})}},{key:"acceptInvitation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"==_typeof$3(e)?this.track("acceptInvitation",{macros:e}):this.emit("TRACKER-error",{message:"acceptInvitation given macros has the wrong type. macros: ".concat(e)})}},{key:"adExpand",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"==_typeof$3(e)?this.track("adExpand",{macros:e}):this.emit("TRACKER-error",{message:"adExpand given macros has the wrong type. macros: ".concat(e)})}},{key:"adCollapse",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"==_typeof$3(e)?this.track("adCollapse",{macros:e}):this.emit("TRACKER-error",{message:"adCollapse given macros has the wrong type. macros: ".concat(e)})}},{key:"minimize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"==_typeof$3(e)?this.track("minimize",{macros:e}):this.emit("TRACKER-error",{message:"minimize given macros has the wrong type. macros: ".concat(e)})}},{key:"verificationNotExecuted",value:function(e){var t,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"==typeof e&&"object"==_typeof$3(n)){if(!this.ad||!this.ad.adVerifications||!this.ad.adVerifications.length)throw new Error("No adVerifications provided");if(!e)throw new Error("No vendor provided, unable to find associated verificationNotExecuted");var o=_findInstanceProperty(r=this.ad.adVerifications).call(r,(function(t){return t.vendor===e}));if(!o)throw new Error("No associated verification element found for vendor: ".concat(e));var i=o.trackingEvents;if(i&&i.verificationNotExecuted){var a=i.verificationNotExecuted;this.trackURLs(a,n),this.emit("verificationNotExecuted",{trackingURLTemplates:a})}}else this.emit("TRACKER-error",{message:_concatInstanceProperty(t="One given verificationNotExecuted parameter has to wrong type. vendor: ".concat(e,", macros: ")).call(t,u.formatMacrosValues(n))})}},{key:"overlayViewDuration",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"string"==typeof e&&"object"==_typeof$3(r)?(r.ADPLAYHEAD=e,this.track("overlayViewDuration",{macros:r})):this.emit("TRACKER-error",{message:_concatInstanceProperty(t="One given overlayViewDuration parameters has the wrong type. formattedDuration: ".concat(e,", macros: ")).call(t,u.formatMacrosValues(r))})}},{key:"close",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"==_typeof$3(e)?this.track(this.linear?"closeLinear":"close",{macros:e}):this.emit("TRACKER-error",{message:"close given macros has the wrong type. macros: ".concat(e)})}},{key:"skip",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"==_typeof$3(e)?this.track("skip",{macros:e}):this.emit("TRACKER-error",{message:"skip given macros has the wrong type. macros: ".concat(e)})}},{key:"load",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"==_typeof$3(e)?this.track("loaded",{macros:e}):this.emit("TRACKER-error",{message:"load given macros has the wrong type. macros: ".concat(e)})}},{key:"click",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null!==t&&"string"!=typeof t||"object"!=_typeof$3(r))this.emit("TRACKER-error",{message:_concatInstanceProperty(e="One given click parameter has the wrong type. fallbackClickThroughURL: ".concat(t,", macros: ")).call(e,u.formatMacrosValues(r))});else{this.clickTrackingURLTemplates&&this.clickTrackingURLTemplates.length&&this.trackURLs(this.clickTrackingURLTemplates,r);var n=this.clickThroughURLTemplate||t,o=_objectSpread2({},r);if(n){this.progress&&(o.ADPLAYHEAD=this.progressFormatted());var i=u.resolveURLTemplates([n],o)[0];this.emit("clickthrough",i)}}}},{key:"track",value:function(e){var t,r,n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=o.macros,a=void 0===i?{}:i,s=o.once,l=void 0!==s&&s;if("object"==_typeof$3(a)){"closeLinear"===e&&!this.trackingEvents[e]&&this.trackingEvents.close&&(e="close");var c=this.trackingEvents[e],u=_indexOfInstanceProperty(t=this.emitAlwaysEvents).call(t,e)>-1;c?(this.emit(e,{trackingURLTemplates:c}),this.trackURLs(c,a)):u&&this.emit(e,null),l&&(delete this.trackingEvents[e],u&&_spliceInstanceProperty(r=this.emitAlwaysEvents).call(r,_indexOfInstanceProperty(n=this.emitAlwaysEvents).call(n,e),1))}else this.emit("TRACKER-error",{message:"track given macros has the wrong type. macros: ".concat(a)})}},{key:"trackURLs",value:function(e){var t,r,n,o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=u.filterUrlTemplates(e),l=s.validUrls,c=s.invalidUrls;c.length&&this.emit("TRACKER-error",{message:"Provided urls are malformed. url: ".concat(c)});var p=_objectSpread2({},i);this.linear&&(this.creative&&this.creative.mediaFiles&&this.creative.mediaFiles[0]&&this.creative.mediaFiles[0].fileURL&&(p.ASSETURI=this.creative.mediaFiles[0].fileURL),this.progress&&(p.ADPLAYHEAD=this.progressFormatted())),null!==(o=this.creative)&&void 0!==o&&null!==(o=o.universalAdIds)&&void 0!==o&&o.length&&(p.UNIVERSALADID=_mapInstanceProperty(t=this.creative.universalAdIds).call(t,(function(e){var t;return _concatInstanceProperty(t=e.idRegistry).call(t," ",e.value)})).join(",")),this.ad&&(this.ad.sequence&&(p.PODSEQUENCE=this.ad.sequence),this.ad.adType&&(p.ADTYPE=this.ad.adType),this.ad.adServingId&&(p.ADSERVINGID=this.ad.adServingId),this.ad.categories&&this.ad.categories.length&&(p.ADCATEGORIES=_mapInstanceProperty(r=this.ad.categories).call(r,(function(e){return e.value})).join(",")),this.ad.blockedAdCategories&&this.ad.blockedAdCategories.length&&(p.BLOCKEDADCATEGORIES=_mapInstanceProperty(n=this.ad.blockedAdCategories).call(n,(function(e){return e.value})).join(","))),u.track(l,p,a)}},{key:"convertToTimecode",value:function(e){var t,r,n;if(!u.isValidTimeValue(e))return"";var o=1e3*e,i=Math.floor(o/36e5),a=Math.floor(o/6e4%60),s=Math.floor(o/1e3%60),l=Math.floor(o%1e3);return _concatInstanceProperty(t=_concatInstanceProperty(r=_concatInstanceProperty(n="".concat(u.addLeadingZeros(i,2),":")).call(n,u.addLeadingZeros(a,2),":")).call(r,u.addLeadingZeros(s,2),".")).call(t,u.addLeadingZeros(l,3))}},{key:"progressFormatted",value:function(){return this.convertToTimecode(this.progress)}}]),r}(),vastParser=new P;function parseAd(e){return _parseAd.apply(this,arguments)}function _parseAd(){return(_parseAd=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(t){var r;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new DOMParser,e.abrupt("return",vastParser.parseVAST(r.parseFromString(t,"application/xml")));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function request(e){var t=e.url,r=void 0===t?"":t,n=e.method,o=void 0===n?"GET":n,i=e.type,a=void 0===i?"json":i,s=e.timeout,l=void 0===s?1e4:s,c=e.data,u=void 0===c?{}:c;return new _Promise((function(e,t){var n=new window.XMLHttpRequest,i=o.toUpperCase();if(a&&(n.responseType=a),l&&(n.timeout=l),n.onload=function(){200===n.status?e(n.response):t({res:n,type:"error"})},n.onerror=function(){t({res:n,type:"error"})},n.ontimeout=function(){t({res:n,type:"error"})},n.onabort=function(){t({res:n,type:"error"})},"GET"===i)n.open(i,r),n.send();else{if("post"!==i)throw new Error("xhr ".concat(i," is not supported"));n.open(i,r),n.setRequestHeader("Content-type","application/json"),n.send(_JSON$stringify(u))}}))}var appendSearchParams=function(e,t){var r,n=getUrlObject(e);if(!e||!n)return null!==(r=e)&&void 0!==r?r:"";var o,i=_startsWithInstanceProperty(e).call(e,"//");for(var a in t){var s,l,c=t[a];if(null!=n&&n.searchParams.has(a))null==n||null===(s=n.searchParams)||void 0===s||s.set(a,c);else null==n||null===(l=n.searchParams)||void 0===l||l.append(a,c)}return e=n.toString(),i?null===(o=e)||void 0===o?void 0:o.replace(location.protocol,""):e},getUrlObject=function(e){if(e){_startsWithInstanceProperty(e).call(e,"//")&&(e=location.protocol+e);try{return new _URL(e)}catch(e){return}}},ServerSideAdManager=function(e){_inherits$2(i,BaseServerSideAdManager);var t,r,n,o=_createSuper$2(i);function i(e){var t;return _classCallCheck$3(this,i),_defineProperty$3(_assertThisInitialized$2(t=o.call(this,e)),"ad",void 0),_defineProperty$3(_assertThisInitialized$2(t),"_eventsSent",[]),_defineProperty$3(_assertThisInitialized$2(t),"_track",void 0),_defineProperty$3(_assertThisInitialized$2(t),"_breakCues",void 0),_defineProperty$3(_assertThisInitialized$2(t),"_cues",void 0),_defineProperty$3(_assertThisInitialized$2(t),"_breakInfoMap",{}),_defineProperty$3(_assertThisInitialized$2(t),"_liveSyncDuration",void 0),_defineProperty$3(_assertThisInitialized$2(t),"_liveMaxLatencyDuration",void 0),_defineProperty$3(_assertThisInitialized$2(t),"_timer",void 0),_defineProperty$3(_assertThisInitialized$2(t),"_vastTracker",void 0),_defineProperty$3(_assertThisInitialized$2(t),"_onAddTrack",(function(e){var r=e.track;"metadata"===(null==r?void 0:r.kind)&&(r.mode="hidden",t._track=r,sniffer.os.isIos?t._loopCues():(t._onCuechange(),t._track.addEventListener("cuechange",t._onCuechange)))})),_defineProperty$3(_assertThisInitialized$2(t),"_loopCues",(function(){t._onCuechange(),t._timer=_setTimeout(t._loopCues,2e3)})),_defineProperty$3(_assertThisInitialized$2(t),"_onCuechange",_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(){var r,n,o,i;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(null===(r=t._track)||void 0===r?void 0:r.cues)||[],o=splitCuesByStartTime(n),i=t._transformSSAIAdBreak(null==o?void 0:_filterInstanceProperty(o).call(o,(function(e){return"SSAI"===e.type}))),t._cues=i,e.next=6,_Promise.all(_mapInstanceProperty(i).call(i,function(){var e=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(r){var n,o,i,a;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("Success"!==(null===(n=t._breakInfoMap[r.id])||void 0===n?void 0:n.status)){e.next=2;break}return e.abrupt("return",null===(i=t._breakInfoMap[r.id])||void 0===i?void 0:i.ads);case 2:if("Pending"!==(null===(o=t._breakInfoMap[r.id])||void 0===o?void 0:o.status)){e.next=4;break}return e.abrupt("return");case 4:return e.next=6,t._fetchBreakInfo(r.id);case 6:a=e.sent,t._breakInfoMap[r.id]=a;case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 6:t._breakCues=i;case 7:case"end":return e.stop()}}),e)})))),t._init(),t}return _createClass$3(i,[{key:"skip",value:function(){var e,t,r,n,o,i;null!==(e=this._player)&&void 0!==e&&e.plugins.hls?null==this||null===(r=this.ad)||void 0===r||r.skip():null!==(n=this.ad)&&void 0!==n&&n.getBreakId()&&(null===(o=this._player)||void 0===o||o.switchURL(appendSearchParams(this._player.config.url,{ssai_skip_ad:null===(i=this.ad)||void 0===i?void 0:i.getBreakId()})),this._breakCues=[]);null===(t=this._emitAdEvent)||void 0===t||t.call(this,XGEvents.AD_SKIPPED),this._endAd(!0)}},{key:"onClick",value:function(){var e;return!this.ad||(this._player.pause(),null===(e=this.ad)||void 0===e||e.click(),this._handleTrackingEvent(TrackEvents.CLICK),!1)}},{key:"onError",value:function(e){var t;null!==(t=this._player)&&void 0!==t&&t.plugins.hls?e.originError.fatal&&this._handleTrackingEvent(TrackEvents.ERROR,{ERRORCODE:900}):this._handleTrackingEvent(TrackEvents.ERROR,{ERRORCODE:900})}},{key:"onPause",value:function(){this.ad&&this._handleTrackingEvent(TrackEvents.PAUSE)}},{key:"onPlay",value:function(){var e,t;this.ad&&(null!==(e=this.ad)&&void 0!==e&&e.getState()?this._handleTrackingEvent(TrackEvents.RESUME):(null===(t=this.ad)||void 0===t||t.setState(AdState.START),this._handleTrackingEvent(TrackEvents.START),this._handleTrackingEvent(TrackEvents.IMPRESSION)))}},{key:"onTimeUpdate",value:function(e){var t,r;if(this.ad||null!==(t=this._breakCues)&&void 0!==t&&t.length){if(this.ad){var n;this._sendInProgressEvents(e,this.ad);var o=null===(n=this.ad)||void 0===n?void 0:n.getRemainingTime(),i=this.ad.getDuration();i>0&&(o<=0||o>i)&&this._endAd()}!this.ad&&null!==(r=this._breakCues)&&void 0!==r&&r.length&&this._checkLinearAds(e)}}},{key:"destroy",value:function(){this.ad=void 0,clearTimeout(this._timer),this._timer=void 0}},{key:"_init",value:function(){var e,t,r=this;null===(e=this._player)||void 0===e||null===(e=e.media)||void 0===e||null===(e=e.textTracks)||void 0===e||e.addEventListener("addtrack",this._onAddTrack),null===(t=this._player)||void 0===t||t.on(COMPLETE,(function(){var e,t;r._liveSyncDuration=null===(e=r._player)||void 0===e||null===(e=e.plugins)||void 0===e||null===(e=e.hls)||void 0===e||null===(e=e.hls)||void 0===e||null===(e=e.config)||void 0===e?void 0:e.liveSyncDuration,r._liveMaxLatencyDuration=null===(t=r._player)||void 0===t||null===(t=t.plugins)||void 0===t||null===(t=t.hls)||void 0===t||null===(t=t.hls)||void 0===t||null===(t=t.config)||void 0===t?void 0:t.liveMaxLatencyDuration}))}},{key:"_transformSSAIAdBreak",value:function(e){var t,r=[];return _forEachInstanceProperty(e).call(e,function(){var e=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(n){var o,i,a,s,l,c,u;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=null===(o=n.ad)||void 0===o||null===(o=o[AD_ID])||void 0===o||null===(o=o.value)||void 0===o?void 0:o.data,s=null===(i=n.ad[BREAK_ID])||void 0===i||null===(i=i.value)||void 0===i?void 0:i.data,a&&(c={id:a,idWithSlate:n.idWithSlate,startTime:n.startTime,duration:Number(null==n||null===(l=n.ad)||void 0===l||null===(l=l[PLANNED_DURATION_TAG])||void 0===l||null===(l=l.value)||void 0===l?void 0:l.data)},s?(t&&r.push(t),t={id:s,startTime:n.startTime,duration:c.duration,ads:[c]}):n.ad[AD_ID]&&t&&(null===(u=t)||void 0===u||null===(u=u.ads)||void 0===u||u.push(c),t.duration=t.duration+c.duration));case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),t&&r.push(t),r}},{key:"_fetchBreakInfo",value:(n=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(t){var r,n,o;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o={status:"Pending",ads:{}},this._breakInfoMap[t]=o,e.abrupt("return",request({url:_concatInstanceProperty(r=_concatInstanceProperty(n="".concat(location.protocol,"//")).call(n,__LIVE_AD_REQUEST_DOMAIN__,"/media_plus/ssai_proxy/v2/openapi/GetAdInfo?break_id=")).call(r,t)}).then(function(){var e=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(t){var r;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.ad_info){e.next=5;break}return e.next=3,_Promise.all(null===(r=_Object$entries2(t.ad_info))||void 0===r?void 0:_mapInstanceProperty(r).call(r,function(){var e=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(t){var r,n,i,a;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=_slicedToArray(t,2),n=r[0],i=r[1],e.next=3,parseAd(i);case 3:return a=e.sent,o.ads[n]=a,e.abrupt("return",a);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 3:return o.status="Success",e.abrupt("return",o);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(){o.status="Error"})));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"_checkFrameChasing",value:function(e){var t,r,n;if(null!==(t=this._cues)&&void 0!==t&&t.length){var o=null===(r=this._cues)||void 0===r?void 0:r[(null===(n=this._cues)||void 0===n?void 0:n.length)-1],i=void 0!==(null==o?void 0:o.startTime)?o.startTime+o.duration:void 0;i&&this._setFrameChasing(i<=e)}else this._setFrameChasing(!0)}},{key:"_setFrameChasing",value:function(e){var t;null!==(t=this._player)&&void 0!==t&&null!==(t=t.plugins)&&void 0!==t&&null!==(t=t.hls)&&void 0!==t&&t.hls&&(this._player.plugins.hls.hls.config.liveSyncDuration=e?this._liveSyncDuration:void 0,this._player.plugins.hls.hls.config.targetLatency=null,this._player.plugins.hls.hls.config.liveMaxLatencyDuration=e?this._liveMaxLatencyDuration:void 0)}},{key:"_checkLinearAds",value:function(e){var t;if(null!==(t=this._breakCues)&&void 0!==t&&t.length)for(var r=0;r<this._breakCues.length;r++){var n,o;if(this.ad)break;var i=null===(n=this._breakCues)||void 0===n?void 0:n[r];if(null==i||null===(o=i.ads)||void 0===o||!o.length)return;for(var a=0;a<i.ads.length;a++){var s,l=i.ads[a],c=l.startTime,u=l.startTime+l.duration,p=null===(s=this._breakInfoMap[i.id])||void 0===s||null===(s=s.ads)||void 0===s?void 0:s[l.id];if(c<=e&&u>e&&(l.idWithSlate||p)){var f,d;this.ad=new ServerSideAd(l,i.id,p,this._player);var h=null==p?void 0:_findInstanceProperty(f=p.ads).call(f,(function(e){return e.creatives.length>0})),$=null==h||null===(d=h.creatives)||void 0===d?void 0:_findInstanceProperty(d).call(d,(function(e){return null==e?void 0:e.mediaFiles}));h&&$&&(this._vastTracker=new z(null,h,$)),this._adStart();break}}}}},{key:"_sendInProgressEvents",value:function(e,t){var r,n,o,i,a,s,l=t.getStartTime()+.25*t.getDuration(),c=t.getStartTime()+.5*t.getDuration(),u=t.getStartTime()+.75*t.getDuration();if(e>=l&&!_includesInstanceProperty(r=this._eventsSent).call(r,TrackEvents.FIRST_QUARTILE))return this._eventsSent.push(TrackEvents.FIRST_QUARTILE),null===(i=this.ad)||void 0===i||i.setState(AdState.FIRST_QUARTILE),void this._handleTrackingEvent(TrackEvents.FIRST_QUARTILE);if(e>=c&&!_includesInstanceProperty(n=this._eventsSent).call(n,TrackEvents.MIDPOINT))return this._eventsSent.push(TrackEvents.MIDPOINT),null===(a=this.ad)||void 0===a||a.setState(AdState.MIDPOINT),void this._handleTrackingEvent(TrackEvents.MIDPOINT);e>=u&&!_includesInstanceProperty(o=this._eventsSent).call(o,TrackEvents.THIRD_QUARTILE)&&(this._eventsSent.push(TrackEvents.THIRD_QUARTILE),null===(s=this.ad)||void 0===s||s.setState(AdState.THIRD_QUARTILE),this._handleTrackingEvent(TrackEvents.THIRD_QUARTILE))}},{key:"_handleTrackingEvent",value:(r=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(t,r){var n;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this._sendTrackingEvent(t,r),null===(n=this._emitAdEvent)||void 0===n||n.call(this,AdEvents[t]);case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"_sendTrackingEvent",value:(t=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(t,r){var n,o,i,a;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t!==TrackEvents.ERROR){e.next=3;break}return null===(o=this._vastTracker)||void 0===o||o.error(r),e.abrupt("return");case 3:if(t!==TrackEvents.CLICK){e.next=6;break}return null===(i=this._vastTracker)||void 0===i||i.click(null,r),e.abrupt("return");case 6:if(t!==TrackEvents.IMPRESSION){e.next=9;break}return null===(a=this._vastTracker)||void 0===a||a.trackImpression(),e.abrupt("return");case 9:null===(n=this._vastTracker)||void 0===n||n.track(t,{macros:r});case 10:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})},{key:"_adStart",value:function(){var e,t;null!=this&&null!==(e=this._player)&&void 0!==e&&e.paused||(null===(t=this.ad)||void 0===t||t.setState(AdState.START),this._handleTrackingEvent(TrackEvents.START),this._handleTrackingEvent(TrackEvents.IMPRESSION))}},{key:"_endAd",value:function(e){e||this._handleTrackingEvent(TrackEvents.COMPLETE),this.ad=void 0,this._eventsSent=[]}}]),i}(),AdsPlugin=function(e){_inherits$2(n,AdsPlugin$1);var t,r=_createSuper$2(n);function n(){var e,t;_classCallCheck$3(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return _defineProperty$3(_assertThisInitialized$2(t=r.call.apply(r,_concatInstanceProperty(e=[this]).call(e,i))),"_scte35Manager",void 0),_defineProperty$3(_assertThisInitialized$2(t),"_ssManager",void 0),_defineProperty$3(_assertThisInitialized$2(t),"_onPlay",void 0),_defineProperty$3(_assertThisInitialized$2(t),"_onTimeUpdate",void 0),_defineProperty$3(_assertThisInitialized$2(t),"_onPause",void 0),_defineProperty$3(_assertThisInitialized$2(t),"_onError",void 0),_defineProperty$3(_assertThisInitialized$2(t),"_onClick",void 0),_defineProperty$3(_assertThisInitialized$2(t),"_handlePrerollMuted",(function(e){var r,n;isPrerollAd(e.ad)&&(null===(r=t.player.plugins.autoplayplugin)||void 0===r||null===(n=r.handleAutoplayStart)||void 0===n||n.call(r),t.player.once(VOLUME_CHANGE,(function(){var e,r;null===(e=t.player.plugins.autoplayplugin)||void 0===e||null===(r=e.initState)||void 0===r||r.call(e)})))})),t}return _createClass$3(n,[{key:"adManager",get:function(){return this._ssManager||this.csManager}},{key:"afterCreate",value:function(){var e;(_get$2(_getPrototypeOf$2(n.prototype),"afterCreate",this).call(this),this._init(),"ssai"===this.config.adType)&&(this.player.config.url=appendSearchParams(this.player.config.url,{ssai_uid:null===(e=this.player)||void 0===e||null===(e=e.plugins)||void 0===e||null===(e=e.logger)||void 0===e||null===(e=e.config)||void 0===e?void 0:e.userId,ssai_platform:"web"}))}},{key:"afterPlayerInit",value:function(){var e;null!==(e=this.player.plugins)&&void 0!==e&&null!==(e=e.hls)&&void 0!==e&&e.hls&&"ssai"===this.config.adType&&(this.player.plugins.hls.hls.config.liveSyncDuration=null,this.player.plugins.hls.hls.config.liveMaxLatencyDuration=1/0)}},{key:"beforePlayerInit",value:(t=_asyncToGenerator$1(_regeneratorRuntime$1().mark((function e(){var t,r,o,i=this;return _regeneratorRuntime$1().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=_get$2(_getPrototypeOf$2(n.prototype),"beforePlayerInit",this).call(this),null===(t=this.csManager)||void 0===t||t.once(IMA_SDK_LOAD_SUCCESS,(function(){google.ima.settings.setDisableCustomPlaybackForIOS10Plus(!0)})),this.config.enableSCTE35&&null!==(r=this.config.ima)&&void 0!==r&&r.adTagUrlForSCTE35&&(this._scte35Manager=new Scte35Manager({player:this.player,adTagUrl:this.config.ima.adTagUrlForSCTE35,adManager:this.csManager,replayForSCTE35:this.config.replayForSCTE35})),"ssai"===this.config.adType&&(this._ssManager=new ServerSideAdManager({player:this.player,emitAdEvent:function(e){return i._dispatchEvent(e)}}),this._setupSSAIListener(),this.uiManager.adPlugin.offAll(),this.uiManager.destroy()),o.resolve(),e.abrupt("return",o);case 6:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"destroy",value:function(){var e,t;_get$2(_getPrototypeOf$2(n.prototype),"destroy",this).call(this),null===(e=this._scte35Manager)||void 0===e||e.destroy(),this._scte35Manager=void 0,this._clearSSAIListener(),null===(t=this._ssManager)||void 0===t||t.destroy(),this._ssManager=void 0}},{key:"_clearSSAIListener",value:function(){var e,t,r,n,o,i,a;((null===(e=this._ssManager)||void 0===e?void 0:e.onPlay)&&this.player.off(PLAY,this._onPlay),(null===(t=this._ssManager)||void 0===t?void 0:t.onPause)&&this.player.off(PAUSE,this._onPause),(null===(r=this._ssManager)||void 0===r?void 0:r.onError)&&this.player.off(ERROR,this._onError),(null===(n=this._ssManager)||void 0===n?void 0:n.onTimeUpdate)&&this.player.off(TIME_UPDATE,this._onTimeUpdate),null!==(o=this._ssManager)&&void 0!==o&&o.onClick)&&(null===(i=this.player)||void 0===i||i.removePluginHooks("pc","videoClick",this._onClick),null===(a=this.player)||void 0===a||a.removePluginHooks("mobile","videoClick",this._onClick))}},{key:"_setupSSAIListener",value:function(){var e,t,r,n,o,i,a,s=this;(this._onPlay=function(){var e;return null===(e=s._ssManager)||void 0===e?void 0:e.onPlay()},this._onTimeUpdate=function(){var e;return null===(e=s._ssManager)||void 0===e?void 0:e.onTimeUpdate(s.player.currentTime)},this._onPause=function(){var e;return null===(e=s._ssManager)||void 0===e?void 0:e.onPause()},this._onError=function(e){var t;return null===(t=s._ssManager)||void 0===t?void 0:t.onError(e)},this._onClick=function(){var e;null===(e=s._ssManager)||void 0===e||e.onClick()},(null===(e=this._ssManager)||void 0===e?void 0:e.onPlay)&&this.player.on(PLAY,this._onPlay),(null===(t=this._ssManager)||void 0===t?void 0:t.onPause)&&this.player.on(PAUSE,this._onPause),(null===(r=this._ssManager)||void 0===r?void 0:r.onError)&&this.player.on(ERROR,this._onError),(null===(n=this._ssManager)||void 0===n?void 0:n.onTimeUpdate)&&this.player.on(TIME_UPDATE,this._onTimeUpdate),null!==(o=this._ssManager)&&void 0!==o&&o.onClick)&&(null===(i=this.player)||void 0===i||i.usePluginHooks("pc","videoClick",this._onClick),null===(a=this.player)||void 0===a||a.usePluginHooks("mobile","videoClick",this._onClick))}},{key:"_dispatchEvent",value:function(e){var t;this.player.emit(e,{ad:null===(t=this._ssManager)||void 0===t?void 0:t.ad})}},{key:"_init",value:function(){var e,t;null!==(e=this.config.ima)&&void 0!==e&&e.adTagUrl||null===(t=this.config.ima)||void 0===t||null===(t=t.schedule)||void 0===t||!t.length||(this.config.ima.adsResponse=scheduleToVmap(this.config.ima.schedule)),this.player.once(AD_PLAY,this._handlePrerollMuted)}}],[{key:"pluginName",get:function(){return"ad"}}]),n}();export{AdsPlugin as default};
|
|
4
4
|
//# sourceMappingURL=esm/veplayer.plugin.ad.production.js.map
|