xgplayer 3.0.0-alpha.173 → 3.0.0-alpha.174-1

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.
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Player=t()}(this,(function(){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=function(e){return e&&e.Math==Math&&e},n=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof e&&e)||function(){return this}()||e||Function("return this")(),i={exports:{}},r=n,o=Object.defineProperty,a=function(e,t){try{o(r,e,{value:t,configurable:!0,writable:!0})}catch(n){r[e]=t}return t},s=a,c="__core-js_shared__",u=n[c]||s(c,{}),l=u;(i.exports=function(e,t){return l[e]||(l[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.30.2",mode:"global",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 f,h,d=function(e){try{return!!e()}catch(e){return!0}},p=!d((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),v=p,g=Function.prototype,y=g.call,m=v&&g.bind.bind(y,y),k=v?m:function(e){return function(){return y.apply(e,arguments)}},b=function(e){return null==e},w=b,_=TypeError,C=function(e){if(w(e))throw _("Can't call method on "+e);return e},x=C,S=Object,T=function(e){return S(x(e))},E=T,P=k({}.hasOwnProperty),R=Object.hasOwn||function(e,t){return P(E(e),t)},O=k,I=0,L=Math.random(),A=O(1..toString),D=function(e){return"Symbol("+(void 0===e?"":e)+")_"+A(++I+L,36)},M="undefined"!=typeof navigator&&String(navigator.userAgent)||"",N=n,F=M,B=N.process,j=N.Deno,H=B&&B.versions||j&&j.version,U=H&&H.v8;U&&(h=(f=U.split("."))[0]>0&&f[0]<4?1:+(f[0]+f[1])),!h&&F&&(!(f=F.match(/Edge\/(\d+)/))||f[1]>=74)&&(f=F.match(/Chrome\/(\d+)/))&&(h=+f[1]);var W=h,V=W,G=d,K=n.String,z=!!Object.getOwnPropertySymbols&&!G((function(){var e=Symbol();return!K(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&V&&V<41})),Y=z&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,q=n,X=i.exports,$=R,J=D,Z=z,Q=Y,ee=q.Symbol,te=X("wks"),ne=Q?ee.for||ee:ee&&ee.withoutSetter||J,ie=function(e){return $(te,e)||(te[e]=Z&&$(ee,e)?ee[e]:ne("Symbol."+e)),te[e]},re={};re[ie("toStringTag")]="z";var oe="[object z]"===String(re),ae="object"==typeof document&&document.all,se={all:ae,IS_HTMLDDA:void 0===ae&&void 0!==ae},ce=se.all,ue=se.IS_HTMLDDA?function(e){return"function"==typeof e||e===ce}:function(e){return"function"==typeof e},le={},fe=!d((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),he=ue,de=se.all,pe=se.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:he(e)||e===de}:function(e){return"object"==typeof e?null!==e:he(e)},ve=pe,ge=n.document,ye=ve(ge)&&ve(ge.createElement),me=function(e){return ye?ge.createElement(e):{}},ke=me,be=!fe&&!d((function(){return 7!=Object.defineProperty(ke("div"),"a",{get:function(){return 7}}).a})),we=fe&&d((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),_e=pe,Ce=String,xe=TypeError,Se=function(e){if(_e(e))return e;throw xe(Ce(e)+" is not an object")},Te=p,Ee=Function.prototype.call,Pe=Te?Ee.bind(Ee):function(){return Ee.apply(Ee,arguments)},Re=n,Oe=ue,Ie=function(e,t){return arguments.length<2?(n=Re[e],Oe(n)?n:void 0):Re[e]&&Re[e][t];var n},Le=k({}.isPrototypeOf),Ae=Ie,De=ue,Me=Le,Ne=Object,Fe=Y?function(e){return"symbol"==typeof e}:function(e){var t=Ae("Symbol");return De(t)&&Me(t.prototype,Ne(e))},Be=String,je=function(e){try{return Be(e)}catch(e){return"Object"}},He=ue,Ue=je,We=TypeError,Ve=function(e){if(He(e))return e;throw We(Ue(e)+" is not a function")},Ge=Ve,Ke=b,ze=function(e,t){var n=e[t];return Ke(n)?void 0:Ge(n)},Ye=Pe,qe=ue,Xe=pe,$e=TypeError,Je=Pe,Ze=pe,Qe=Fe,et=ze,tt=function(e,t){var n,i;if("string"===t&&qe(n=e.toString)&&!Xe(i=Ye(n,e)))return i;if(qe(n=e.valueOf)&&!Xe(i=Ye(n,e)))return i;if("string"!==t&&qe(n=e.toString)&&!Xe(i=Ye(n,e)))return i;throw $e("Can't convert object to primitive value")},nt=TypeError,it=ie("toPrimitive"),rt=function(e,t){if(!Ze(e)||Qe(e))return e;var n,i=et(e,it);if(i){if(void 0===t&&(t="default"),n=Je(i,e,t),!Ze(n)||Qe(n))return n;throw nt("Can't convert object to primitive value")}return void 0===t&&(t="number"),tt(e,t)},ot=rt,at=Fe,st=function(e){var t=ot(e,"string");return at(t)?t:t+""},ct=fe,ut=be,lt=we,ft=Se,ht=st,dt=TypeError,pt=Object.defineProperty,vt=Object.getOwnPropertyDescriptor,gt="enumerable",yt="configurable",mt="writable";le.f=ct?lt?function(e,t,n){if(ft(e),t=ht(t),ft(n),"function"==typeof e&&"prototype"===t&&"value"in n&&mt in n&&!n[mt]){var i=vt(e,t);i&&i[mt]&&(e[t]=n.value,n={configurable:yt in n?n[yt]:i[yt],enumerable:gt in n?n[gt]:i[gt],writable:!1})}return pt(e,t,n)}:pt:function(e,t,n){if(ft(e),t=ht(t),ft(n),ut)try{return pt(e,t,n)}catch(e){}if("get"in n||"set"in n)throw dt("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var kt={exports:{}},bt=fe,wt=R,_t=Function.prototype,Ct=bt&&Object.getOwnPropertyDescriptor,xt=wt(_t,"name"),St={EXISTS:xt,PROPER:xt&&"something"===function(){}.name,CONFIGURABLE:xt&&(!bt||bt&&Ct(_t,"name").configurable)},Tt=ue,Et=u,Pt=k(Function.toString);Tt(Et.inspectSource)||(Et.inspectSource=function(e){return Pt(e)});var Rt,Ot,It,Lt=Et.inspectSource,At=ue,Dt=n.WeakMap,Mt=At(Dt)&&/native code/.test(String(Dt)),Nt=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Ft=le,Bt=Nt,jt=fe?function(e,t,n){return Ft.f(e,t,Bt(1,n))}:function(e,t,n){return e[t]=n,e},Ht=i.exports,Ut=D,Wt=Ht("keys"),Vt=function(e){return Wt[e]||(Wt[e]=Ut(e))},Gt={},Kt=Mt,zt=n,Yt=pe,qt=jt,Xt=R,$t=u,Jt=Vt,Zt=Gt,Qt="Object already initialized",en=zt.TypeError,tn=zt.WeakMap;if(Kt||$t.state){var nn=$t.state||($t.state=new tn);nn.get=nn.get,nn.has=nn.has,nn.set=nn.set,Rt=function(e,t){if(nn.has(e))throw en(Qt);return t.facade=e,nn.set(e,t),t},Ot=function(e){return nn.get(e)||{}},It=function(e){return nn.has(e)}}else{var rn=Jt("state");Zt[rn]=!0,Rt=function(e,t){if(Xt(e,rn))throw en(Qt);return t.facade=e,qt(e,rn,t),t},Ot=function(e){return Xt(e,rn)?e[rn]:{}},It=function(e){return Xt(e,rn)}}var on={set:Rt,get:Ot,has:It,enforce:function(e){return It(e)?Ot(e):Rt(e,{})},getterFor:function(e){return function(t){var n;if(!Yt(t)||(n=Ot(t)).type!==e)throw en("Incompatible receiver, "+e+" required");return n}}},an=k,sn=d,cn=ue,un=R,ln=fe,fn=St.CONFIGURABLE,hn=Lt,dn=on.enforce,pn=on.get,vn=String,gn=Object.defineProperty,yn=an("".slice),mn=an("".replace),kn=an([].join),bn=ln&&!sn((function(){return 8!==gn((function(){}),"length",{value:8}).length})),wn=String(String).split("String"),_n=kt.exports=function(e,t,n){"Symbol("===yn(vn(t),0,7)&&(t="["+mn(vn(t),/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!un(e,"name")||fn&&e.name!==t)&&(ln?gn(e,"name",{value:t,configurable:!0}):e.name=t),bn&&n&&un(n,"arity")&&e.length!==n.arity&&gn(e,"length",{value:n.arity});try{n&&un(n,"constructor")&&n.constructor?ln&&gn(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var i=dn(e);return un(i,"source")||(i.source=kn(wn,"string"==typeof t?t:"")),e};Function.prototype.toString=_n((function(){return cn(this)&&pn(this).source||hn(this)}),"toString");var Cn=ue,xn=le,Sn=kt.exports,Tn=a,En=function(e,t,n,i){i||(i={});var r=i.enumerable,o=void 0!==i.name?i.name:t;if(Cn(n)&&Sn(n,o,i),i.global)r?e[t]=n:Tn(t,n);else{try{i.unsafe?e[t]&&(r=!0):delete e[t]}catch(e){}r?e[t]=n:xn.f(e,t,{value:n,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return e},Pn=k,Rn=Pn({}.toString),On=Pn("".slice),In=function(e){return On(Rn(e),8,-1)},Ln=oe,An=ue,Dn=In,Mn=ie("toStringTag"),Nn=Object,Fn="Arguments"==Dn(function(){return arguments}()),Bn=Ln?Dn:function(e){var t,n,i;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Nn(e),Mn))?n:Fn?Dn(t):"Object"==(i=Dn(t))&&An(t.callee)?"Arguments":i},jn=Bn,Hn=oe?{}.toString:function(){return"[object "+jn(this)+"]"};oe||En(Object.prototype,"toString",Hn,{unsafe:!0});var Un={},Wn={},Vn={}.propertyIsEnumerable,Gn=Object.getOwnPropertyDescriptor,Kn=Gn&&!Vn.call({1:2},1);Wn.f=Kn?function(e){var t=Gn(this,e);return!!t&&t.enumerable}:Vn;var zn=d,Yn=In,qn=Object,Xn=k("".split),$n=zn((function(){return!qn("z").propertyIsEnumerable(0)}))?function(e){return"String"==Yn(e)?Xn(e,""):qn(e)}:qn,Jn=$n,Zn=C,Qn=function(e){return Jn(Zn(e))},ei=fe,ti=Pe,ni=Wn,ii=Nt,ri=Qn,oi=st,ai=R,si=be,ci=Object.getOwnPropertyDescriptor;Un.f=ei?ci:function(e,t){if(e=ri(e),t=oi(t),si)try{return ci(e,t)}catch(e){}if(ai(e,t))return ii(!ti(ni.f,e,t),e[t])};var ui={},li=Math.ceil,fi=Math.floor,hi=Math.trunc||function(e){var t=+e;return(t>0?fi:li)(t)},di=function(e){var t=+e;return t!=t||0===t?0:hi(t)},pi=di,vi=Math.max,gi=Math.min,yi=function(e,t){var n=pi(e);return n<0?vi(n+t,0):gi(n,t)},mi=di,ki=Math.min,bi=function(e){return e>0?ki(mi(e),9007199254740991):0},wi=bi,_i=function(e){return wi(e.length)},Ci=Qn,xi=yi,Si=_i,Ti=function(e){return function(t,n,i){var r,o=Ci(t),a=Si(o),s=xi(i,a);if(e&&n!=n){for(;a>s;)if((r=o[s++])!=r)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===n)return e||s||0;return!e&&-1}},Ei={includes:Ti(!0),indexOf:Ti(!1)},Pi=R,Ri=Qn,Oi=Ei.indexOf,Ii=Gt,Li=k([].push),Ai=function(e,t){var n,i=Ri(e),r=0,o=[];for(n in i)!Pi(Ii,n)&&Pi(i,n)&&Li(o,n);for(;t.length>r;)Pi(i,n=t[r++])&&(~Oi(o,n)||Li(o,n));return o},Di=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Mi=Ai,Ni=Di.concat("length","prototype");ui.f=Object.getOwnPropertyNames||function(e){return Mi(e,Ni)};var Fi={};Fi.f=Object.getOwnPropertySymbols;var Bi=Ie,ji=ui,Hi=Fi,Ui=Se,Wi=k([].concat),Vi=Bi("Reflect","ownKeys")||function(e){var t=ji.f(Ui(e)),n=Hi.f;return n?Wi(t,n(e)):t},Gi=R,Ki=Vi,zi=Un,Yi=le,qi=function(e,t,n){for(var i=Ki(t),r=Yi.f,o=zi.f,a=0;a<i.length;a++){var s=i[a];Gi(e,s)||n&&Gi(n,s)||r(e,s,o(t,s))}},Xi=d,$i=ue,Ji=/#|\.prototype\./,Zi=function(e,t){var n=er[Qi(e)];return n==nr||n!=tr&&($i(t)?Xi(t):!!t)},Qi=Zi.normalize=function(e){return String(e).replace(Ji,".").toLowerCase()},er=Zi.data={},tr=Zi.NATIVE="N",nr=Zi.POLYFILL="P",ir=Zi,rr=n,or=Un.f,ar=jt,sr=En,cr=a,ur=qi,lr=ir,fr=function(e,t){var n,i,r,o,a,s=e.target,c=e.global,u=e.stat;if(n=c?rr:u?rr[s]||cr(s,{}):(rr[s]||{}).prototype)for(i in t){if(o=t[i],r=e.dontCallGetSet?(a=or(n,i))&&a.value:n[i],!lr(c?i:s+(u?".":"#")+i,e.forced)&&void 0!==r){if(typeof o==typeof r)continue;ur(o,r)}(e.sham||r&&r.sham)&&ar(o,"sham",!0),sr(n,i,o,e)}},hr=p,dr=Function.prototype,pr=dr.apply,vr=dr.call,gr="object"==typeof Reflect&&Reflect.apply||(hr?vr.bind(pr):function(){return vr.apply(pr,arguments)}),yr=k([].slice),mr=k,kr=Ve,br=pe,wr=R,_r=yr,Cr=p,xr=Function,Sr=mr([].concat),Tr=mr([].join),Er={},Pr=Cr?xr.bind:function(e){var t=kr(this),n=t.prototype,i=_r(arguments,1),r=function(){var n=Sr(i,_r(arguments));return this instanceof r?function(e,t,n){if(!wr(Er,t)){for(var i=[],r=0;r<t;r++)i[r]="a["+r+"]";Er[t]=xr("C,a","return new C("+Tr(i,",")+")")}return Er[t](e,n)}(t,n.length,n):t.apply(e,n)};return br(n)&&(r.prototype=n),r},Rr=k,Or=d,Ir=ue,Lr=Bn,Ar=Lt,Dr=function(){},Mr=[],Nr=Ie("Reflect","construct"),Fr=/^\s*(?:class|function)\b/,Br=Rr(Fr.exec),jr=!Fr.exec(Dr),Hr=function(e){if(!Ir(e))return!1;try{return Nr(Dr,Mr,e),!0}catch(e){return!1}},Ur=function(e){if(!Ir(e))return!1;switch(Lr(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return jr||!!Br(Fr,Ar(e))}catch(e){return!0}};Ur.sham=!0;var Wr=!Nr||Or((function(){var e;return Hr(Hr.call)||!Hr(Object)||!Hr((function(){e=!0}))||e}))?Ur:Hr,Vr=Wr,Gr=je,Kr=TypeError,zr=function(e){if(Vr(e))return e;throw Kr(Gr(e)+" is not a constructor")},Yr={},qr=Ai,Xr=Di,$r=Object.keys||function(e){return qr(e,Xr)},Jr=fe,Zr=we,Qr=le,eo=Se,to=Qn,no=$r;Yr.f=Jr&&!Zr?Object.defineProperties:function(e,t){eo(e);for(var n,i=to(t),r=no(t),o=r.length,a=0;o>a;)Qr.f(e,n=r[a++],i[n]);return e};var io,ro=Ie("document","documentElement"),oo=Se,ao=Yr,so=Di,co=Gt,uo=ro,lo=me,fo="prototype",ho="script",po=Vt("IE_PROTO"),vo=function(){},go=function(e){return"<"+ho+">"+e+"</"+ho+">"},yo=function(e){e.write(go("")),e.close();var t=e.parentWindow.Object;return e=null,t},mo=function(){try{io=new ActiveXObject("htmlfile")}catch(e){}var e,t,n;mo="undefined"!=typeof document?document.domain&&io?yo(io):(t=lo("iframe"),n="java"+ho+":",t.style.display="none",uo.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(go("document.F=Object")),e.close(),e.F):yo(io);for(var i=so.length;i--;)delete mo[fo][so[i]];return mo()};co[po]=!0;var ko=Object.create||function(e,t){var n;return null!==e?(vo[fo]=oo(e),n=new vo,vo[fo]=null,n[po]=e):n=mo(),void 0===t?n:ao.f(n,t)},bo=fr,wo=gr,_o=Pr,Co=zr,xo=Se,So=pe,To=ko,Eo=d,Po=Ie("Reflect","construct"),Ro=Object.prototype,Oo=[].push,Io=Eo((function(){function e(){}return!(Po((function(){}),[],e)instanceof e)})),Lo=!Eo((function(){Po((function(){}))})),Ao=Io||Lo;function Do(e){return Do="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},Do(e)}function Mo(e){var t=function(e,t){if("object"!==Do(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==Do(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Do(t)?t:String(t)}function No(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,Mo(i.key),i)}}function Fo(e,t,n){return t&&No(e.prototype,t),n&&No(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Bo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jo(e,t){return jo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},jo(e,t)}function Ho(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&&jo(e,t)}function Uo(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Wo(e,t){if(t&&("object"===Do(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Uo(e)}function Vo(e){return Vo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Vo(e)}function Go(e,t,n){return(t=Mo(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}bo({target:"Reflect",stat:!0,forced:Ao,sham:Ao},{construct:function(e,t){Co(e),xo(t);var n=arguments.length<3?e:Co(arguments[2]);if(Lo&&!Io)return Po(e,t,n);if(e==n){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var i=[null];return wo(Oo,i,t),new(wo(_o,e,i))}var r=n.prototype,o=To(So(r)?r:Ro),a=wo(e,o,t);return So(a)?a:o}});var Ko=Bn,zo=String,Yo=function(e){if("Symbol"===Ko(e))throw TypeError("Cannot convert a Symbol value to a string");return zo(e)},qo={},Xo=st,$o=le,Jo=Nt,Zo=function(e,t,n){var i=Xo(t);i in e?$o.f(e,i,Jo(0,n)):e[i]=n},Qo=yi,ea=_i,ta=Zo,na=Array,ia=Math.max,ra=function(e,t,n){for(var i=ea(e),r=Qo(t,i),o=Qo(void 0===n?i:n,i),a=na(ia(o-r,0)),s=0;r<o;r++,s++)ta(a,s,e[r]);return a.length=s,a},oa=In,aa=Qn,sa=ui.f,ca=ra,ua="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];qo.f=function(e){return ua&&"Window"==oa(e)?function(e){try{return sa(e)}catch(e){return ca(ua)}}(e):sa(aa(e))};var la=kt.exports,fa=le,ha=function(e,t,n){return n.get&&la(n.get,t,{getter:!0}),n.set&&la(n.set,t,{setter:!0}),fa.f(e,t,n)},da={},pa=ie;da.f=pa;var va=n,ga=va,ya=R,ma=da,ka=le.f,ba=function(e){var t=ga.Symbol||(ga.Symbol={});ya(t,e)||ka(t,e,{value:ma.f(e)})},wa=Pe,_a=Ie,Ca=ie,xa=En,Sa=le.f,Ta=R,Ea=ie("toStringTag"),Pa=function(e,t,n){e&&!n&&(e=e.prototype),e&&!Ta(e,Ea)&&Sa(e,Ea,{configurable:!0,value:t})},Ra=In,Oa=k,Ia=function(e){if("Function"===Ra(e))return Oa(e)},La=Ve,Aa=p,Da=Ia(Ia.bind),Ma=function(e,t){return La(e),void 0===t?e:Aa?Da(e,t):function(){return e.apply(t,arguments)}},Na=In,Fa=Array.isArray||function(e){return"Array"==Na(e)},Ba=Fa,ja=Wr,Ha=pe,Ua=ie("species"),Wa=Array,Va=function(e){var t;return Ba(e)&&(t=e.constructor,(ja(t)&&(t===Wa||Ba(t.prototype))||Ha(t)&&null===(t=t[Ua]))&&(t=void 0)),void 0===t?Wa:t},Ga=function(e,t){return new(Va(e))(0===t?0:t)},Ka=Ma,za=$n,Ya=T,qa=_i,Xa=Ga,$a=k([].push),Ja=function(e){var t=1==e,n=2==e,i=3==e,r=4==e,o=6==e,a=7==e,s=5==e||o;return function(c,u,l,f){for(var h,d,p=Ya(c),v=za(p),g=Ka(u,l),y=qa(v),m=0,k=f||Xa,b=t?k(c,y):n||a?k(c,0):void 0;y>m;m++)if((s||m in v)&&(d=g(h=v[m],m,p),e))if(t)b[m]=d;else if(d)switch(e){case 3:return!0;case 5:return h;case 6:return m;case 2:$a(b,h)}else switch(e){case 4:return!1;case 7:$a(b,h)}return o?-1:i||r?r:b}},Za={forEach:Ja(0),map:Ja(1),filter:Ja(2),some:Ja(3),every:Ja(4),find:Ja(5),findIndex:Ja(6),filterReject:Ja(7)},Qa=fr,es=n,ts=Pe,ns=k,is=fe,rs=z,os=d,as=R,ss=Le,cs=Se,us=Qn,ls=st,fs=Yo,hs=Nt,ds=ko,ps=$r,vs=ui,gs=qo,ys=Fi,ms=Un,ks=le,bs=Yr,ws=Wn,_s=En,Cs=ha,xs=i.exports,Ss=Gt,Ts=D,Es=ie,Ps=da,Rs=ba,Os=function(){var e=_a("Symbol"),t=e&&e.prototype,n=t&&t.valueOf,i=Ca("toPrimitive");t&&!t[i]&&xa(t,i,(function(e){return wa(n,this)}),{arity:1})},Is=Pa,Ls=on,As=Za.forEach,Ds=Vt("hidden"),Ms="Symbol",Ns="prototype",Fs=Ls.set,Bs=Ls.getterFor(Ms),js=Object[Ns],Hs=es.Symbol,Us=Hs&&Hs[Ns],Ws=es.TypeError,Vs=es.QObject,Gs=ms.f,Ks=ks.f,zs=gs.f,Ys=ws.f,qs=ns([].push),Xs=xs("symbols"),$s=xs("op-symbols"),Js=xs("wks"),Zs=!Vs||!Vs[Ns]||!Vs[Ns].findChild,Qs=is&&os((function(){return 7!=ds(Ks({},"a",{get:function(){return Ks(this,"a",{value:7}).a}})).a}))?function(e,t,n){var i=Gs(js,t);i&&delete js[t],Ks(e,t,n),i&&e!==js&&Ks(js,t,i)}:Ks,ec=function(e,t){var n=Xs[e]=ds(Us);return Fs(n,{type:Ms,tag:e,description:t}),is||(n.description=t),n},tc=function(e,t,n){e===js&&tc($s,t,n),cs(e);var i=ls(t);return cs(n),as(Xs,i)?(n.enumerable?(as(e,Ds)&&e[Ds][i]&&(e[Ds][i]=!1),n=ds(n,{enumerable:hs(0,!1)})):(as(e,Ds)||Ks(e,Ds,hs(1,{})),e[Ds][i]=!0),Qs(e,i,n)):Ks(e,i,n)},nc=function(e,t){cs(e);var n=us(t),i=ps(n).concat(ac(n));return As(i,(function(t){is&&!ts(ic,n,t)||tc(e,t,n[t])})),e},ic=function(e){var t=ls(e),n=ts(Ys,this,t);return!(this===js&&as(Xs,t)&&!as($s,t))&&(!(n||!as(this,t)||!as(Xs,t)||as(this,Ds)&&this[Ds][t])||n)},rc=function(e,t){var n=us(e),i=ls(t);if(n!==js||!as(Xs,i)||as($s,i)){var r=Gs(n,i);return!r||!as(Xs,i)||as(n,Ds)&&n[Ds][i]||(r.enumerable=!0),r}},oc=function(e){var t=zs(us(e)),n=[];return As(t,(function(e){as(Xs,e)||as(Ss,e)||qs(n,e)})),n},ac=function(e){var t=e===js,n=zs(t?$s:us(e)),i=[];return As(n,(function(e){!as(Xs,e)||t&&!as(js,e)||qs(i,Xs[e])})),i};rs||(Hs=function(){if(ss(Us,this))throw Ws("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?fs(arguments[0]):void 0,t=Ts(e),n=function(e){this===js&&ts(n,$s,e),as(this,Ds)&&as(this[Ds],t)&&(this[Ds][t]=!1),Qs(this,t,hs(1,e))};return is&&Zs&&Qs(js,t,{configurable:!0,set:n}),ec(t,e)},_s(Us=Hs[Ns],"toString",(function(){return Bs(this).tag})),_s(Hs,"withoutSetter",(function(e){return ec(Ts(e),e)})),ws.f=ic,ks.f=tc,bs.f=nc,ms.f=rc,vs.f=gs.f=oc,ys.f=ac,Ps.f=function(e){return ec(Es(e),e)},is&&(Cs(Us,"description",{configurable:!0,get:function(){return Bs(this).description}}),_s(js,"propertyIsEnumerable",ic,{unsafe:!0}))),Qa({global:!0,constructor:!0,wrap:!0,forced:!rs,sham:!rs},{Symbol:Hs}),As(ps(Js),(function(e){Rs(e)})),Qa({target:Ms,stat:!0,forced:!rs},{useSetter:function(){Zs=!0},useSimple:function(){Zs=!1}}),Qa({target:"Object",stat:!0,forced:!rs,sham:!is},{create:function(e,t){return void 0===t?ds(e):nc(ds(e),t)},defineProperty:tc,defineProperties:nc,getOwnPropertyDescriptor:rc}),Qa({target:"Object",stat:!0,forced:!rs},{getOwnPropertyNames:oc}),Os(),Is(Hs,Ms),Ss[Ds]=!0;var sc=z&&!!Symbol.for&&!!Symbol.keyFor,cc=fr,uc=Ie,lc=R,fc=Yo,hc=i.exports,dc=sc,pc=hc("string-to-symbol-registry"),vc=hc("symbol-to-string-registry");cc({target:"Symbol",stat:!0,forced:!dc},{for:function(e){var t=fc(e);if(lc(pc,t))return pc[t];var n=uc("Symbol")(t);return pc[t]=n,vc[n]=t,n}});var gc=fr,yc=R,mc=Fe,kc=je,bc=sc,wc=(0,i.exports)("symbol-to-string-registry");gc({target:"Symbol",stat:!0,forced:!bc},{keyFor:function(e){if(!mc(e))throw TypeError(kc(e)+" is not a symbol");if(yc(wc,e))return wc[e]}});var _c=Fa,Cc=ue,xc=In,Sc=Yo,Tc=k([].push),Ec=fr,Pc=Ie,Rc=gr,Oc=Pe,Ic=k,Lc=d,Ac=ue,Dc=Fe,Mc=yr,Nc=function(e){if(Cc(e))return e;if(_c(e)){for(var t=e.length,n=[],i=0;i<t;i++){var r=e[i];"string"==typeof r?Tc(n,r):"number"!=typeof r&&"Number"!=xc(r)&&"String"!=xc(r)||Tc(n,Sc(r))}var o=n.length,a=!0;return function(e,t){if(a)return a=!1,t;if(_c(this))return t;for(var i=0;i<o;i++)if(n[i]===e)return t}}},Fc=z,Bc=String,jc=Pc("JSON","stringify"),Hc=Ic(/./.exec),Uc=Ic("".charAt),Wc=Ic("".charCodeAt),Vc=Ic("".replace),Gc=Ic(1..toString),Kc=/[\uD800-\uDFFF]/g,zc=/^[\uD800-\uDBFF]$/,Yc=/^[\uDC00-\uDFFF]$/,qc=!Fc||Lc((function(){var e=Pc("Symbol")();return"[null]"!=jc([e])||"{}"!=jc({a:e})||"{}"!=jc(Object(e))})),Xc=Lc((function(){return'"\\udf06\\ud834"'!==jc("\udf06\ud834")||'"\\udead"'!==jc("\udead")})),$c=function(e,t){var n=Mc(arguments),i=Nc(t);if(Ac(i)||void 0!==e&&!Dc(e))return n[1]=function(e,t){if(Ac(i)&&(t=Oc(i,this,Bc(e),t)),!Dc(t))return t},Rc(jc,null,n)},Jc=function(e,t,n){var i=Uc(n,t-1),r=Uc(n,t+1);return Hc(zc,e)&&!Hc(Yc,r)||Hc(Yc,e)&&!Hc(zc,i)?"\\u"+Gc(Wc(e,0),16):e};jc&&Ec({target:"JSON",stat:!0,arity:3,forced:qc||Xc},{stringify:function(e,t,n){var i=Mc(arguments),r=Rc(qc?$c:jc,null,i);return Xc&&"string"==typeof r?Vc(r,Kc,Jc):r}});var Zc=Fi,Qc=T;fr({target:"Object",stat:!0,forced:!z||d((function(){Zc.f(1)}))},{getOwnPropertySymbols:function(e){var t=Zc.f;return t?t(Qc(e)):[]}});var eu=fr,tu=d,nu=Qn,iu=Un.f,ru=fe;eu({target:"Object",stat:!0,forced:!ru||tu((function(){iu(1)})),sham:!ru},{getOwnPropertyDescriptor:function(e,t){return iu(nu(e),t)}});var ou=Vi,au=Qn,su=Un,cu=Zo;function uu(){return uu="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Vo(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},uu.apply(this,arguments)}fr({target:"Object",stat:!0,sham:!fe},{getOwnPropertyDescriptors:function(e){for(var t,n,i=au(e),r=su.f,o=ou(i),a={},s=0;o.length>s;)void 0!==(n=r(i,t=o[s++]))&&cu(a,t,n);return a}});var lu=TypeError,fu=function(e){if(e>9007199254740991)throw lu("Maximum allowed index exceeded");return e},hu=d,du=W,pu=ie("species"),vu=function(e){return du>=51||!hu((function(){var t=[];return(t.constructor={})[pu]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},gu=fr,yu=d,mu=Fa,ku=pe,bu=T,wu=_i,_u=fu,Cu=Zo,xu=Ga,Su=vu,Tu=W,Eu=ie("isConcatSpreadable"),Pu=Tu>=51||!yu((function(){var e=[];return e[Eu]=!1,e.concat()[0]!==e})),Ru=function(e){if(!ku(e))return!1;var t=e[Eu];return void 0!==t?!!t:mu(e)};gu({target:"Array",proto:!0,arity:1,forced:!Pu||!Su("concat")},{concat:function(e){var t,n,i,r,o,a=bu(this),s=xu(a,0),c=0;for(t=-1,i=arguments.length;t<i;t++)if(Ru(o=-1===t?a:arguments[t]))for(r=wu(o),_u(c+r),n=0;n<r;n++,c++)n in o&&Cu(s,c,o[n]);else _u(c+1),Cu(s,c++,o);return s.length=c,s}});var Ou=Za.map;fr({target:"Array",proto:!0,forced:!vu("map")},{map:function(e){return Ou(this,e,arguments.length>1?arguments[1]:void 0)}});var Iu=T,Lu=$r;fr({target:"Object",stat:!0,forced:d((function(){Lu(1)}))},{keys:function(e){return Lu(Iu(e))}});var Au=fr,Du=Fa,Mu=Wr,Nu=pe,Fu=yi,Bu=_i,ju=Qn,Hu=Zo,Uu=ie,Wu=yr,Vu=vu("slice"),Gu=Uu("species"),Ku=Array,zu=Math.max;Au({target:"Array",proto:!0,forced:!Vu},{slice:function(e,t){var n,i,r,o=ju(this),a=Bu(o),s=Fu(e,a),c=Fu(void 0===t?a:t,a);if(Du(o)&&(n=o.constructor,(Mu(n)&&(n===Ku||Du(n.prototype))||Nu(n)&&null===(n=n[Gu]))&&(n=void 0),n===Ku||void 0===n))return Wu(o,s,c);for(i=new(void 0===n?Ku:n)(zu(c-s,0)),r=0;s<c;s++,r++)s in o&&Hu(i,r,o[s]);return i.length=r,i}});var Yu={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},qu=me("span").classList,Xu=qu&&qu.constructor&&qu.constructor.prototype,$u=Xu===Object.prototype?void 0:Xu,Ju=d,Zu=function(e,t){var n=[][e];return!!n&&Ju((function(){n.call(null,t||function(){return 1},1)}))},Qu=Za.forEach,el=Zu("forEach")?[].forEach:function(e){return Qu(this,e,arguments.length>1?arguments[1]:void 0)},tl=n,nl=Yu,il=$u,rl=el,ol=jt,al=function(e){if(e&&e.forEach!==rl)try{ol(e,"forEach",rl)}catch(t){e.forEach=rl}};for(var sl in nl)nl[sl]&&al(tl[sl]&&tl[sl].prototype);al(il);var cl=fr,ul=$n,ll=Qn,fl=Zu,hl=k([].join);cl({target:"Array",proto:!0,forced:ul!=Object||!fl("join",",")},{join:function(e){return hl(ll(this),void 0===e?",":e)}});var dl=fe,pl=Fa,vl=TypeError,gl=Object.getOwnPropertyDescriptor,yl=dl&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}(),ml=je,kl=TypeError,bl=function(e,t){if(!delete e[t])throw kl("Cannot delete property "+ml(t)+" of "+ml(e))},wl=fr,_l=T,Cl=yi,xl=di,Sl=_i,Tl=yl?function(e,t){if(pl(e)&&!gl(e,"length").writable)throw vl("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t},El=fu,Pl=Ga,Rl=Zo,Ol=bl,Il=vu("splice"),Ll=Math.max,Al=Math.min;wl({target:"Array",proto:!0,forced:!Il},{splice:function(e,t){var n,i,r,o,a,s,c=_l(this),u=Sl(c),l=Cl(e,u),f=arguments.length;for(0===f?n=i=0:1===f?(n=0,i=u-l):(n=f-2,i=Al(Ll(xl(t),0),u-l)),El(u+n-i),r=Pl(c,i),o=0;o<i;o++)(a=l+o)in c&&Rl(r,o,c[a]);if(r.length=i,n<i){for(o=l;o<u-i;o++)s=o+n,(a=o+i)in c?c[s]=c[a]:Ol(c,s);for(o=u;o>u-i+n;o--)Ol(c,o-1)}else if(n>i)for(o=u-i;o>l;o--)s=o+n-1,(a=o+i-1)in c?c[s]=c[a]:Ol(c,s);for(o=0;o<n;o++)c[o+l]=arguments[o+2];return Tl(c,u-i+n),r}});var Dl,Ml,Nl,Fl,Bl="undefined"!=typeof process&&"process"==In(process),jl=k,Hl=Ve,Ul=ue,Wl=String,Vl=TypeError,Gl=function(e,t,n){try{return jl(Hl(Object.getOwnPropertyDescriptor(e,t)[n]))}catch(e){}},Kl=Se,zl=function(e){if("object"==typeof e||Ul(e))return e;throw Vl("Can't set "+Wl(e)+" as a prototype")},Yl=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Gl(Object.prototype,"__proto__","set"))(n,[]),t=n instanceof Array}catch(e){}return function(n,i){return Kl(n),zl(i),t?e(n,i):n.__proto__=i,n}}():void 0),ql=Ie,Xl=ha,$l=fe,Jl=ie("species"),Zl=function(e){var t=ql(e);$l&&t&&!t[Jl]&&Xl(t,Jl,{configurable:!0,get:function(){return this}})},Ql=Le,ef=TypeError,tf=function(e,t){if(Ql(t,e))return e;throw ef("Incorrect invocation")},nf=Se,rf=zr,of=b,af=ie("species"),sf=function(e,t){var n,i=nf(e).constructor;return void 0===i||of(n=nf(i)[af])?t:rf(n)},cf=TypeError,uf=function(e,t){if(e<t)throw cf("Not enough arguments");return e},lf=/(?:ipad|iphone|ipod).*applewebkit/i.test(M),ff=n,hf=gr,df=Ma,pf=ue,vf=R,gf=d,yf=ro,mf=yr,kf=me,bf=uf,wf=lf,_f=Bl,Cf=ff.setImmediate,xf=ff.clearImmediate,Sf=ff.process,Tf=ff.Dispatch,Ef=ff.Function,Pf=ff.MessageChannel,Rf=ff.String,Of=0,If={},Lf="onreadystatechange";gf((function(){Dl=ff.location}));var Af=function(e){if(vf(If,e)){var t=If[e];delete If[e],t()}},Df=function(e){return function(){Af(e)}},Mf=function(e){Af(e.data)},Nf=function(e){ff.postMessage(Rf(e),Dl.protocol+"//"+Dl.host)};Cf&&xf||(Cf=function(e){bf(arguments.length,1);var t=pf(e)?e:Ef(e),n=mf(arguments,1);return If[++Of]=function(){hf(t,void 0,n)},Ml(Of),Of},xf=function(e){delete If[e]},_f?Ml=function(e){Sf.nextTick(Df(e))}:Tf&&Tf.now?Ml=function(e){Tf.now(Df(e))}:Pf&&!wf?(Fl=(Nl=new Pf).port2,Nl.port1.onmessage=Mf,Ml=df(Fl.postMessage,Fl)):ff.addEventListener&&pf(ff.postMessage)&&!ff.importScripts&&Dl&&"file:"!==Dl.protocol&&!gf(Nf)?(Ml=Nf,ff.addEventListener("message",Mf,!1)):Ml=Lf in kf("script")?function(e){yf.appendChild(kf("script"))[Lf]=function(){yf.removeChild(this),Af(e)}}:function(e){setTimeout(Df(e),0)});var Ff={set:Cf,clear:xf},Bf=function(){this.head=null,this.tail=null};Bf.prototype={add:function(e){var t={item:e,next:null},n=this.tail;n?n.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 jf,Hf,Uf,Wf,Vf,Gf=Bf,Kf=/ipad|iphone|ipod/i.test(M)&&"undefined"!=typeof Pebble,zf=/web0s(?!.*chrome)/i.test(M),Yf=n,qf=Ma,Xf=Un.f,$f=Ff.set,Jf=Gf,Zf=lf,Qf=Kf,eh=zf,th=Bl,nh=Yf.MutationObserver||Yf.WebKitMutationObserver,ih=Yf.document,rh=Yf.process,oh=Yf.Promise,ah=Xf(Yf,"queueMicrotask"),sh=ah&&ah.value;if(!sh){var ch=new Jf,uh=function(){var e,t;for(th&&(e=rh.domain)&&e.exit();t=ch.get();)try{t()}catch(e){throw ch.head&&jf(),e}e&&e.enter()};Zf||th||eh||!nh||!ih?!Qf&&oh&&oh.resolve?((Wf=oh.resolve(void 0)).constructor=oh,Vf=qf(Wf.then,Wf),jf=function(){Vf(uh)}):th?jf=function(){rh.nextTick(uh)}:($f=qf($f,Yf),jf=function(){$f(uh)}):(Hf=!0,Uf=ih.createTextNode(""),new nh(uh).observe(Uf,{characterData:!0}),jf=function(){Uf.data=Hf=!Hf}),sh=function(e){ch.head||jf(),ch.add(e)}}var lh=sh,fh=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},hh=n.Promise,dh="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,ph=!dh&&!Bl&&"object"==typeof window&&"object"==typeof document,vh=n,gh=hh,yh=ue,mh=ir,kh=Lt,bh=ie,wh=ph,_h=dh,Ch=W;gh&&gh.prototype;var xh=bh("species"),Sh=!1,Th=yh(vh.PromiseRejectionEvent),Eh=mh("Promise",(function(){var e=kh(gh),t=e!==String(gh);if(!t&&66===Ch)return!0;if(!Ch||Ch<51||!/native code/.test(e)){var n=new gh((function(e){e(1)})),i=function(e){e((function(){}),(function(){}))};if((n.constructor={})[xh]=i,!(Sh=n.then((function(){}))instanceof i))return!0}return!t&&(wh||_h)&&!Th})),Ph={CONSTRUCTOR:Eh,REJECTION_EVENT:Th,SUBCLASSING:Sh},Rh={},Oh=Ve,Ih=TypeError,Lh=function(e){var t,n;this.promise=new e((function(e,i){if(void 0!==t||void 0!==n)throw Ih("Bad Promise constructor");t=e,n=i})),this.resolve=Oh(t),this.reject=Oh(n)};Rh.f=function(e){return new Lh(e)};var Ah,Dh,Mh,Nh=fr,Fh=Bl,Bh=n,jh=Pe,Hh=En,Uh=Yl,Wh=Pa,Vh=Zl,Gh=Ve,Kh=ue,zh=pe,Yh=tf,qh=sf,Xh=Ff.set,$h=lh,Jh=function(e,t){try{1==arguments.length?console.error(e):console.error(e,t)}catch(e){}},Zh=fh,Qh=Gf,ed=on,td=hh,nd=Rh,id="Promise",rd=Ph.CONSTRUCTOR,od=Ph.REJECTION_EVENT,ad=Ph.SUBCLASSING,sd=ed.getterFor(id),cd=ed.set,ud=td&&td.prototype,ld=td,fd=ud,hd=Bh.TypeError,dd=Bh.document,pd=Bh.process,vd=nd.f,gd=vd,yd=!!(dd&&dd.createEvent&&Bh.dispatchEvent),md="unhandledrejection",kd=function(e){var t;return!(!zh(e)||!Kh(t=e.then))&&t},bd=function(e,t){var n,i,r,o=t.value,a=1==t.state,s=a?e.ok:e.fail,c=e.resolve,u=e.reject,l=e.domain;try{s?(a||(2===t.rejection&&Sd(t),t.rejection=1),!0===s?n=o:(l&&l.enter(),n=s(o),l&&(l.exit(),r=!0)),n===e.promise?u(hd("Promise-chain cycle")):(i=kd(n))?jh(i,n,c,u):c(n)):u(o)}catch(e){l&&!r&&l.exit(),u(e)}},wd=function(e,t){e.notified||(e.notified=!0,$h((function(){for(var n,i=e.reactions;n=i.get();)bd(n,e);e.notified=!1,t&&!e.rejection&&Cd(e)})))},_d=function(e,t,n){var i,r;yd?((i=dd.createEvent("Event")).promise=t,i.reason=n,i.initEvent(e,!1,!0),Bh.dispatchEvent(i)):i={promise:t,reason:n},!od&&(r=Bh["on"+e])?r(i):e===md&&Jh("Unhandled promise rejection",n)},Cd=function(e){jh(Xh,Bh,(function(){var t,n=e.facade,i=e.value;if(xd(e)&&(t=Zh((function(){Fh?pd.emit("unhandledRejection",i,n):_d(md,n,i)})),e.rejection=Fh||xd(e)?2:1,t.error))throw t.value}))},xd=function(e){return 1!==e.rejection&&!e.parent},Sd=function(e){jh(Xh,Bh,(function(){var t=e.facade;Fh?pd.emit("rejectionHandled",t):_d("rejectionhandled",t,e.value)}))},Td=function(e,t,n){return function(i){e(t,i,n)}},Ed=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,wd(e,!0))},Pd=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw hd("Promise can't be resolved itself");var i=kd(t);i?$h((function(){var n={done:!1};try{jh(i,t,Td(Pd,n,e),Td(Ed,n,e))}catch(t){Ed(n,t,e)}})):(e.value=t,e.state=1,wd(e,!1))}catch(t){Ed({done:!1},t,e)}}};if(rd&&(fd=(ld=function(e){Yh(this,fd),Gh(e),jh(Ah,this);var t=sd(this);try{e(Td(Pd,t),Td(Ed,t))}catch(e){Ed(t,e)}}).prototype,(Ah=function(e){cd(this,{type:id,done:!1,notified:!1,parent:!1,reactions:new Qh,rejection:!1,state:0,value:void 0})}).prototype=Hh(fd,"then",(function(e,t){var n=sd(this),i=vd(qh(this,ld));return n.parent=!0,i.ok=!Kh(e)||e,i.fail=Kh(t)&&t,i.domain=Fh?pd.domain:void 0,0==n.state?n.reactions.add(i):$h((function(){bd(i,n)})),i.promise})),Dh=function(){var e=new Ah,t=sd(e);this.promise=e,this.resolve=Td(Pd,t),this.reject=Td(Ed,t)},nd.f=vd=function(e){return e===ld||undefined===e?new Dh(e):gd(e)},Kh(td)&&ud!==Object.prototype)){Mh=ud.then,ad||Hh(ud,"then",(function(e,t){var n=this;return new ld((function(e,t){jh(Mh,n,e,t)})).then(e,t)}),{unsafe:!0});try{delete ud.constructor}catch(e){}Uh&&Uh(ud,fd)}Nh({global:!0,constructor:!0,wrap:!0,forced:rd},{Promise:ld}),Wh(ld,id,!1),Vh(id);var Rd={},Od=Rd,Id=ie("iterator"),Ld=Array.prototype,Ad=function(e){return void 0!==e&&(Od.Array===e||Ld[Id]===e)},Dd=Bn,Md=ze,Nd=b,Fd=Rd,Bd=ie("iterator"),jd=function(e){if(!Nd(e))return Md(e,Bd)||Md(e,"@@iterator")||Fd[Dd(e)]},Hd=Pe,Ud=Ve,Wd=Se,Vd=je,Gd=jd,Kd=TypeError,zd=function(e,t){var n=arguments.length<2?Gd(e):t;if(Ud(n))return Wd(Hd(n,e));throw Kd(Vd(e)+" is not iterable")},Yd=Pe,qd=Se,Xd=ze,$d=function(e,t,n){var i,r;qd(e);try{if(!(i=Xd(e,"return"))){if("throw"===t)throw n;return n}i=Yd(i,e)}catch(e){r=!0,i=e}if("throw"===t)throw n;if(r)throw i;return qd(i),n},Jd=Ma,Zd=Pe,Qd=Se,ep=je,tp=Ad,np=_i,ip=Le,rp=zd,op=jd,ap=$d,sp=TypeError,cp=function(e,t){this.stopped=e,this.result=t},up=cp.prototype,lp=function(e,t,n){var i,r,o,a,s,c,u,l=n&&n.that,f=!(!n||!n.AS_ENTRIES),h=!(!n||!n.IS_RECORD),d=!(!n||!n.IS_ITERATOR),p=!(!n||!n.INTERRUPTED),v=Jd(t,l),g=function(e){return i&&ap(i,"normal",e),new cp(!0,e)},y=function(e){return f?(Qd(e),p?v(e[0],e[1],g):v(e[0],e[1])):p?v(e,g):v(e)};if(h)i=e.iterator;else if(d)i=e;else{if(!(r=op(e)))throw sp(ep(e)+" is not iterable");if(tp(r)){for(o=0,a=np(e);a>o;o++)if((s=y(e[o]))&&ip(up,s))return s;return new cp(!1)}i=rp(e,r)}for(c=h?e.next:i.next;!(u=Zd(c,i)).done;){try{s=y(u.value)}catch(e){ap(i,"throw",e)}if("object"==typeof s&&s&&ip(up,s))return s}return new cp(!1)},fp=ie("iterator"),hp=!1;try{var dp=0,pp={next:function(){return{done:!!dp++}},return:function(){hp=!0}};pp[fp]=function(){return this},Array.from(pp,(function(){throw 2}))}catch(e){}var vp=function(e,t){if(!t&&!hp)return!1;var n=!1;try{var i={};i[fp]=function(){return{next:function(){return{done:n=!0}}}},e(i)}catch(e){}return n},gp=hh,yp=Ph.CONSTRUCTOR||!vp((function(e){gp.all(e).then(void 0,(function(){}))})),mp=Pe,kp=Ve,bp=Rh,wp=fh,_p=lp;fr({target:"Promise",stat:!0,forced:yp},{all:function(e){var t=this,n=bp.f(t),i=n.resolve,r=n.reject,o=wp((function(){var n=kp(t.resolve),o=[],a=0,s=1;_p(e,(function(e){var c=a++,u=!1;s++,mp(n,t,e).then((function(e){u||(u=!0,o[c]=e,--s||i(o))}),r)})),--s||i(o)}));return o.error&&r(o.value),n.promise}});var Cp=fr,xp=Ph.CONSTRUCTOR,Sp=hh,Tp=Ie,Ep=ue,Pp=En,Rp=Sp&&Sp.prototype;if(Cp({target:"Promise",proto:!0,forced:xp,real:!0},{catch:function(e){return this.then(void 0,e)}}),Ep(Sp)){var Op=Tp("Promise").prototype.catch;Rp.catch!==Op&&Pp(Rp,"catch",Op,{unsafe:!0})}var Ip=Pe,Lp=Ve,Ap=Rh,Dp=fh,Mp=lp;fr({target:"Promise",stat:!0,forced:yp},{race:function(e){var t=this,n=Ap.f(t),i=n.reject,r=Dp((function(){var r=Lp(t.resolve);Mp(e,(function(e){Ip(r,t,e).then(n.resolve,i)}))}));return r.error&&i(r.value),n.promise}});var Np=Pe,Fp=Rh;fr({target:"Promise",stat:!0,forced:Ph.CONSTRUCTOR},{reject:function(e){var t=Fp.f(this);return Np(t.reject,void 0,e),t.promise}});var Bp=Se,jp=pe,Hp=Rh,Up=fr,Wp=Ph.CONSTRUCTOR,Vp=function(e,t){if(Bp(e),jp(t)&&t.constructor===e)return t;var n=Hp.f(e);return(0,n.resolve)(t),n.promise};Ie("Promise"),Up({target:"Promise",stat:!0,forced:Wp},{resolve:function(e){return Vp(this,e)}});var Gp=fe,Kp=St.EXISTS,zp=k,Yp=ha,qp=Function.prototype,Xp=zp(qp.toString),$p=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,Jp=zp($p.exec);Gp&&!Kp&&Yp(qp,"name",{configurable:!0,get:function(){try{return Jp($p,Xp(this))[1]}catch(e){return""}}}),fr({target:"Number",stat:!0},{isNaN:function(e){return e!=e}});var Zp=ue,Qp=pe,ev=Yl,tv=function(e,t,n){var i,r;return ev&&Zp(i=t.constructor)&&i!==n&&Qp(r=i.prototype)&&r!==n.prototype&&ev(e,r),e},nv=k(1..valueOf),iv="\t\n\v\f\r                 \u2028\u2029\ufeff",rv=C,ov=Yo,av=iv,sv=k("".replace),cv=RegExp("^["+av+"]+"),uv=RegExp("(^|[^"+av+"])["+av+"]+$"),lv=function(e){return function(t){var n=ov(rv(t));return 1&e&&(n=sv(n,cv,"")),2&e&&(n=sv(n,uv,"$1")),n}},fv={start:lv(1),end:lv(2),trim:lv(3)},hv=fr,dv=fe,pv=n,vv=va,gv=k,yv=ir,mv=R,kv=tv,bv=Le,wv=Fe,_v=rt,Cv=d,xv=ui.f,Sv=Un.f,Tv=le.f,Ev=nv,Pv=fv.trim,Rv="Number",Ov=pv[Rv];vv[Rv];var Iv=Ov.prototype,Lv=pv.TypeError,Av=gv("".slice),Dv=gv("".charCodeAt),Mv=function(e){var t,n,i,r,o,a,s,c,u=_v(e,"number");if(wv(u))throw Lv("Cannot convert a Symbol value to a number");if("string"==typeof u&&u.length>2)if(u=Pv(u),43===(t=Dv(u,0))||45===t){if(88===(n=Dv(u,2))||120===n)return NaN}else if(48===t){switch(Dv(u,1)){case 66:case 98:i=2,r=49;break;case 79:case 111:i=8,r=55;break;default:return+u}for(a=(o=Av(u,2)).length,s=0;s<a;s++)if((c=Dv(o,s))<48||c>r)return NaN;return parseInt(o,i)}return+u},Nv=yv(Rv,!Ov(" 0o1")||!Ov("0b1")||Ov("+0x1")),Fv=function(e){var t,n=arguments.length<1?0:Ov(function(e){var t=_v(e,"number");return"bigint"==typeof t?t:Mv(t)}(e));return bv(Iv,t=this)&&Cv((function(){Ev(t)}))?kv(Object(n),this,Fv):n};Fv.prototype=Iv,Nv&&(Iv.constructor=Fv),hv({global:!0,constructor:!0,wrap:!0,forced:Nv},{Number:Fv});Nv&&function(e,t){for(var n,i=dv?xv(t):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),r=0;i.length>r;r++)mv(t,n=i[r])&&!mv(e,n)&&Tv(e,n,Sv(t,n))}(vv[Rv],Ov);var Bv=ie,jv=ko,Hv=le.f,Uv=Bv("unscopables"),Wv=Array.prototype;null==Wv[Uv]&&Hv(Wv,Uv,{configurable:!0,value:jv(null)});var Vv,Gv,Kv,zv=function(e){Wv[Uv][e]=!0},Yv=!d((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),qv=R,Xv=ue,$v=T,Jv=Yv,Zv=Vt("IE_PROTO"),Qv=Object,eg=Qv.prototype,tg=Jv?Qv.getPrototypeOf:function(e){var t=$v(e);if(qv(t,Zv))return t[Zv];var n=t.constructor;return Xv(n)&&t instanceof n?n.prototype:t instanceof Qv?eg:null},ng=d,ig=ue,rg=pe,og=tg,ag=En,sg=ie("iterator"),cg=!1;[].keys&&("next"in(Kv=[].keys())?(Gv=og(og(Kv)))!==Object.prototype&&(Vv=Gv):cg=!0);var ug=!rg(Vv)||ng((function(){var e={};return Vv[sg].call(e)!==e}));ug&&(Vv={}),ig(Vv[sg])||ag(Vv,sg,(function(){return this}));var lg={IteratorPrototype:Vv,BUGGY_SAFARI_ITERATORS:cg},fg=lg.IteratorPrototype,hg=ko,dg=Nt,pg=Pa,vg=Rd,gg=function(){return this},yg=function(e,t,n,i){var r=t+" Iterator";return e.prototype=hg(fg,{next:dg(+!i,n)}),pg(e,r,!1),vg[r]=gg,e},mg=fr,kg=Pe,bg=ue,wg=yg,_g=tg,Cg=Yl,xg=Pa,Sg=jt,Tg=En,Eg=Rd,Pg=St.PROPER,Rg=St.CONFIGURABLE,Og=lg.IteratorPrototype,Ig=lg.BUGGY_SAFARI_ITERATORS,Lg=ie("iterator"),Ag="keys",Dg="values",Mg="entries",Ng=function(){return this},Fg=function(e,t,n,i,r,o,a){wg(n,t,i);var s,c,u,l=function(e){if(e===r&&v)return v;if(!Ig&&e in d)return d[e];switch(e){case Ag:case Dg:case Mg:return function(){return new n(this,e)}}return function(){return new n(this)}},f=t+" Iterator",h=!1,d=e.prototype,p=d[Lg]||d["@@iterator"]||r&&d[r],v=!Ig&&p||l(r),g="Array"==t&&d.entries||p;if(g&&(s=_g(g.call(new e)))!==Object.prototype&&s.next&&(_g(s)!==Og&&(Cg?Cg(s,Og):bg(s[Lg])||Tg(s,Lg,Ng)),xg(s,f,!0)),Pg&&r==Dg&&p&&p.name!==Dg&&(Rg?Sg(d,"name",Dg):(h=!0,v=function(){return kg(p,this)})),r)if(c={values:l(Dg),keys:o?v:l(Ag),entries:l(Mg)},a)for(u in c)(Ig||h||!(u in d))&&Tg(d,u,c[u]);else mg({target:t,proto:!0,forced:Ig||h},c);return d[Lg]!==v&&Tg(d,Lg,v,{name:r}),Eg[t]=v,c},Bg=function(e,t){return{value:e,done:t}},jg=Qn,Hg=zv,Ug=Rd,Wg=on,Vg=le.f,Gg=Fg,Kg=Bg,zg=fe,Yg="Array Iterator",qg=Wg.set,Xg=Wg.getterFor(Yg),$g=Gg(Array,"Array",(function(e,t){qg(this,{type:Yg,target:jg(e),index:0,kind:t})}),(function(){var e=Xg(this),t=e.target,n=e.kind,i=e.index++;return!t||i>=t.length?(e.target=void 0,Kg(void 0,!0)):Kg("keys"==n?i:"values"==n?t[i]:[i,t[i]],!1)}),"values"),Jg=Ug.Arguments=Ug.Array;if(Hg("keys"),Hg("values"),Hg("entries"),zg&&"values"!==Jg.name)try{Vg(Jg,"name",{value:"values"})}catch(e){}var Zg=n,Qg=Yu,ey=$u,ty=$g,ny=jt,iy=ie,ry=iy("iterator"),oy=iy("toStringTag"),ay=ty.values,sy=function(e,t){if(e){if(e[ry]!==ay)try{ny(e,ry,ay)}catch(t){e[ry]=ay}if(e[oy]||ny(e,oy,t),Qg[t])for(var n in ty)if(e[n]!==ty[n])try{ny(e,n,ty[n])}catch(t){e[n]=ty[n]}}};for(var cy in Qg)sy(Zg[cy]&&Zg[cy].prototype,cy);sy(ey,"DOMTokenList");var uy=Za.filter;fr({target:"Array",proto:!0,forced:!vu("filter")},{filter:function(e){return uy(this,e,arguments.length>1?arguments[1]:void 0)}});var ly=fe,fy=k,hy=Pe,dy=d,py=$r,vy=Fi,gy=Wn,yy=T,my=$n,ky=Object.assign,by=Object.defineProperty,wy=fy([].concat),_y=!ky||dy((function(){if(ly&&1!==ky({b:1},ky(by({},"a",{enumerable:!0,get:function(){by(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),i="abcdefghijklmnopqrst";return e[n]=7,i.split("").forEach((function(e){t[e]=e})),7!=ky({},e)[n]||py(ky({},t)).join("")!=i}))?function(e,t){for(var n=yy(e),i=arguments.length,r=1,o=vy.f,a=gy.f;i>r;)for(var s,c=my(arguments[r++]),u=o?wy(py(c),o(c)):py(c),l=u.length,f=0;l>f;)s=u[f++],ly&&!hy(a,c,s)||(n[s]=c[s]);return n}:ky,Cy=_y;fr({target:"Object",stat:!0,arity:2,forced:Object.assign!==Cy},{assign:Cy});var xy={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,n="~";function i(){}function r(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,i,o,a){if("function"!=typeof i)throw new TypeError("The listener must be a function");var s=new r(i,o||e,a),c=n?n+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new i:delete e._events[t]}function s(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,i,r=[];if(0===this._eventsCount)return r;for(i in e=this._events)t.call(e,i)&&r.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},s.prototype.listeners=function(e){var t=n?n+e:e,i=this._events[t];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,o=i.length,a=new Array(o);r<o;r++)a[r]=i[r].fn;return a},s.prototype.listenerCount=function(e){var t=n?n+e:e,i=this._events[t];return i?i.fn?1:i.length:0},s.prototype.emit=function(e,t,i,r,o,a){var s=n?n+e:e;if(!this._events[s])return!1;var c,u,l=this._events[s],f=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),f){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,i),!0;case 4:return l.fn.call(l.context,t,i,r),!0;case 5:return l.fn.call(l.context,t,i,r,o),!0;case 6:return l.fn.call(l.context,t,i,r,o,a),!0}for(u=1,c=new Array(f-1);u<f;u++)c[u-1]=arguments[u];l.fn.apply(l.context,c)}else{var h,d=l.length;for(u=0;u<d;u++)switch(l[u].once&&this.removeListener(e,l[u].fn,void 0,!0),f){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,t);break;case 3:l[u].fn.call(l[u].context,t,i);break;case 4:l[u].fn.call(l[u].context,t,i,r);break;default:if(!c)for(h=1,c=new Array(f-1);h<f;h++)c[h-1]=arguments[h];l[u].fn.apply(l[u].context,c)}}return!0},s.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},s.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},s.prototype.removeListener=function(e,t,i,r){var o=n?n+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||r&&!s.once||i&&s.context!==i||a(this,o);else{for(var c=0,u=[],l=s.length;c<l;c++)(s[c].fn!==t||r&&!s[c].once||i&&s[c].context!==i)&&u.push(s[c]);u.length?this._events[o]=1===u.length?u[0]:u:a(this,o)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&a(this,t)):(this._events=new i,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s}(xy);var Sy=xy.exports,Ty=JSON.parse('"3.0.0-alpha.173"');function Ey(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function Py(e){return function(e){if(Array.isArray(e))return Ey(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Ey(e,t);var n=Object.prototype.toString.call(e).slice(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)?Ey(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Ry=Se,Oy=function(){var e=Ry(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},Iy=d,Ly=n.RegExp,Ay=Iy((function(){var e=Ly("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),Dy=Ay||Iy((function(){return!Ly("a","y").sticky})),My={BROKEN_CARET:Ay||Iy((function(){var e=Ly("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),MISSED_STICKY:Dy,UNSUPPORTED_Y:Ay},Ny=d,Fy=n.RegExp,By=Ny((function(){var e=Fy(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),jy=d,Hy=n.RegExp,Uy=jy((function(){var e=Hy("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),Wy=Pe,Vy=k,Gy=Yo,Ky=Oy,zy=My,Yy=i.exports,qy=ko,Xy=on.get,$y=By,Jy=Uy,Zy=Yy("native-string-replace",String.prototype.replace),Qy=RegExp.prototype.exec,em=Qy,tm=Vy("".charAt),nm=Vy("".indexOf),im=Vy("".replace),rm=Vy("".slice),om=function(){var e=/a/,t=/b*/g;return Wy(Qy,e,"a"),Wy(Qy,t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),am=zy.BROKEN_CARET,sm=void 0!==/()??/.exec("")[1];(om||sm||am||$y||Jy)&&(em=function(e){var t,n,i,r,o,a,s,c=this,u=Xy(c),l=Gy(e),f=u.raw;if(f)return f.lastIndex=c.lastIndex,t=Wy(em,f,l),c.lastIndex=f.lastIndex,t;var h=u.groups,d=am&&c.sticky,p=Wy(Ky,c),v=c.source,g=0,y=l;if(d&&(p=im(p,"y",""),-1===nm(p,"g")&&(p+="g"),y=rm(l,c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&"\n"!==tm(l,c.lastIndex-1))&&(v="(?: "+v+")",y=" "+y,g++),n=new RegExp("^(?:"+v+")",p)),sm&&(n=new RegExp("^"+v+"$(?!\\s)",p)),om&&(i=c.lastIndex),r=Wy(Qy,d?n:c,y),d?r?(r.input=rm(r.input,g),r[0]=rm(r[0],g),r.index=c.lastIndex,c.lastIndex+=r[0].length):c.lastIndex=0:om&&r&&(c.lastIndex=c.global?r.index+r[0].length:i),sm&&r&&r.length>1&&Wy(Zy,r[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(r[o]=void 0)})),r&&h)for(r.groups=a=qy(null),o=0;o<h.length;o++)a[(s=h[o])[0]]=r[s[1]];return r});var cm=em;fr({target:"RegExp",proto:!0,forced:/./.exec!==cm},{exec:cm});var um=Ia,lm=En,fm=cm,hm=d,dm=ie,pm=jt,vm=dm("species"),gm=RegExp.prototype,ym=function(e,t,n,i){var r=dm(e),o=!hm((function(){var t={};return t[r]=function(){return 7},7!=""[e](t)})),a=o&&!hm((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[vm]=function(){return n},n.flags="",n[r]=/./[r]),n.exec=function(){return t=!0,null},n[r](""),!t}));if(!o||!a||n){var s=um(/./[r]),c=t(r,""[e],(function(e,t,n,i,r){var a=um(e),c=t.exec;return c===fm||c===gm.exec?o&&!r?{done:!0,value:s(t,n,i)}:{done:!0,value:a(n,t,i)}:{done:!1}}));lm(String.prototype,e,c[0]),lm(gm,r,c[1])}i&&pm(gm[r],"sham",!0)},mm=k,km=di,bm=Yo,wm=C,_m=mm("".charAt),Cm=mm("".charCodeAt),xm=mm("".slice),Sm=function(e){return function(t,n){var i,r,o=bm(wm(t)),a=km(n),s=o.length;return a<0||a>=s?e?"":void 0:(i=Cm(o,a))<55296||i>56319||a+1===s||(r=Cm(o,a+1))<56320||r>57343?e?_m(o,a):i:e?xm(o,a,a+2):r-56320+(i-55296<<10)+65536}},Tm={codeAt:Sm(!1),charAt:Sm(!0)},Em=Tm.charAt,Pm=function(e,t,n){return t+(n?Em(e,t).length:1)},Rm=Pe,Om=Se,Im=ue,Lm=In,Am=cm,Dm=TypeError,Mm=function(e,t){var n=e.exec;if(Im(n)){var i=Rm(n,e,t);return null!==i&&Om(i),i}if("RegExp"===Lm(e))return Rm(Am,e,t);throw Dm("RegExp#exec called on incompatible receiver")},Nm=Pe,Fm=Se,Bm=b,jm=bi,Hm=Yo,Um=C,Wm=ze,Vm=Pm,Gm=Mm;ym("match",(function(e,t,n){return[function(t){var n=Um(this),i=Bm(t)?void 0:Wm(t,e);return i?Nm(i,t,n):new RegExp(t)[e](Hm(n))},function(e){var i=Fm(this),r=Hm(e),o=n(t,i,r);if(o.done)return o.value;if(!i.global)return Gm(i,r);var a=i.unicode;i.lastIndex=0;for(var s,c=[],u=0;null!==(s=Gm(i,r));){var l=Hm(s[0]);c[u]=l,""===l&&(i.lastIndex=Vm(r,jm(i.lastIndex),a)),u++}return 0===u?null:c}]}));var Km=pe,zm=In,Ym=ie("match"),qm=function(e){var t;return Km(e)&&(void 0!==(t=e[Ym])?!!t:"RegExp"==zm(e))},Xm=Pe,$m=R,Jm=Le,Zm=Oy,Qm=RegExp.prototype,ek=function(e){var t=e.flags;return void 0!==t||"flags"in Qm||$m(e,"flags")||!Jm(Qm,e)?t:Xm(Zm,e)},tk=le.f,nk=fe,ik=n,rk=k,ok=ir,ak=tv,sk=jt,ck=ui.f,uk=Le,lk=qm,fk=Yo,hk=ek,dk=My,pk=function(e,t,n){n in e||tk(e,n,{configurable:!0,get:function(){return t[n]},set:function(e){t[n]=e}})},vk=En,gk=d,yk=R,mk=on.enforce,kk=Zl,bk=By,wk=Uy,_k=ie("match"),Ck=ik.RegExp,xk=Ck.prototype,Sk=ik.SyntaxError,Tk=rk(xk.exec),Ek=rk("".charAt),Pk=rk("".replace),Rk=rk("".indexOf),Ok=rk("".slice),Ik=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,Lk=/a/g,Ak=/a/g,Dk=new Ck(Lk)!==Lk,Mk=dk.MISSED_STICKY,Nk=dk.UNSUPPORTED_Y,Fk=nk&&(!Dk||Mk||bk||wk||gk((function(){return Ak[_k]=!1,Ck(Lk)!=Lk||Ck(Ak)==Ak||"/a/i"!=Ck(Lk,"i")})));if(ok("RegExp",Fk)){for(var Bk=function(e,t){var n,i,r,o,a,s,c=uk(xk,this),u=lk(e),l=void 0===t,f=[],h=e;if(!c&&u&&l&&e.constructor===Bk)return e;if((u||uk(xk,e))&&(e=e.source,l&&(t=hk(h))),e=void 0===e?"":fk(e),t=void 0===t?"":fk(t),h=e,bk&&"dotAll"in Lk&&(i=!!t&&Rk(t,"s")>-1)&&(t=Pk(t,/s/g,"")),n=t,Mk&&"sticky"in Lk&&(r=!!t&&Rk(t,"y")>-1)&&Nk&&(t=Pk(t,/y/g,"")),wk&&(o=function(e){for(var t,n=e.length,i=0,r="",o=[],a={},s=!1,c=!1,u=0,l="";i<=n;i++){if("\\"===(t=Ek(e,i)))t+=Ek(e,++i);else if("]"===t)s=!1;else if(!s)switch(!0){case"["===t:s=!0;break;case"("===t:Tk(Ik,Ok(e,i+1))&&(i+=2,c=!0),r+=t,u++;continue;case">"===t&&c:if(""===l||yk(a,l))throw new Sk("Invalid capture group name");a[l]=!0,o[o.length]=[l,u],c=!1,l="";continue}c?l+=t:r+=t}return[r,o]}(e),e=o[0],f=o[1]),a=ak(Ck(e,t),c?this:xk,Bk),(i||r||f.length)&&(s=mk(a),i&&(s.dotAll=!0,s.raw=Bk(function(e){for(var t,n=e.length,i=0,r="",o=!1;i<=n;i++)"\\"!==(t=Ek(e,i))?o||"."!==t?("["===t?o=!0:"]"===t&&(o=!1),r+=t):r+="[\\s\\S]":r+=t+Ek(e,++i);return r}(e),n)),r&&(s.sticky=!0),f.length&&(s.groups=f)),e!==h)try{sk(a,"source",""===h?"(?:)":h)}catch(e){}return a},jk=ck(Ck),Hk=0;jk.length>Hk;)pk(Bk,Ck,jk[Hk++]);xk.constructor=Bk,Bk.prototype=xk,vk(ik,"RegExp",Bk,{constructor:!0})}kk("RegExp");var Uk=St.PROPER,Wk=En,Vk=Se,Gk=Yo,Kk=d,zk=ek,Yk="toString",qk=RegExp.prototype[Yk],Xk=Kk((function(){return"/a/b"!=qk.call({source:"a",flags:"b"})})),$k=Uk&&qk.name!=Yk;(Xk||$k)&&Wk(RegExp.prototype,Yk,(function(){var e=Vk(this);return"/"+Gk(e.source)+"/"+Gk(zk(e))}),{unsafe:!0});var Jk=gr,Zk=Pe,Qk=k,eb=ym,tb=Se,nb=b,ib=qm,rb=C,ob=sf,ab=Pm,sb=bi,cb=Yo,ub=ze,lb=ra,fb=Mm,hb=cm,db=d,pb=My.UNSUPPORTED_Y,vb=4294967295,gb=Math.min,yb=[].push,mb=Qk(/./.exec),kb=Qk(yb),bb=Qk("".slice),wb=!db((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]}));eb("split",(function(e,t,n){var i;return i="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var i=cb(rb(this)),r=void 0===n?vb:n>>>0;if(0===r)return[];if(void 0===e)return[i];if(!ib(e))return Zk(t,i,e,r);for(var o,a,s,c=[],u=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),l=0,f=new RegExp(e.source,u+"g");(o=Zk(hb,f,i))&&!((a=f.lastIndex)>l&&(kb(c,bb(i,l,o.index)),o.length>1&&o.index<i.length&&Jk(yb,c,lb(o,1)),s=o[0].length,l=a,c.length>=r));)f.lastIndex===o.index&&f.lastIndex++;return l===i.length?!s&&mb(f,"")||kb(c,""):kb(c,bb(i,l)),c.length>r?lb(c,0,r):c}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:Zk(t,this,e,n)}:t,[function(t,n){var r=rb(this),o=nb(t)?void 0:ub(t,e);return o?Zk(o,t,r,n):Zk(i,cb(r),t,n)},function(e,r){var o=tb(this),a=cb(e),s=n(i,o,a,r,i!==t);if(s.done)return s.value;var c=ob(o,RegExp),u=o.unicode,l=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(pb?"g":"y"),f=new c(pb?"^(?:"+o.source+")":o,l),h=void 0===r?vb:r>>>0;if(0===h)return[];if(0===a.length)return null===fb(f,a)?[a]:[];for(var d=0,p=0,v=[];p<a.length;){f.lastIndex=pb?0:p;var g,y=fb(f,pb?bb(a,p):a);if(null===y||(g=gb(sb(f.lastIndex+(pb?p:0)),a.length))===d)p=ab(a,p,u);else{if(kb(v,bb(a,d,p)),v.length===h)return v;for(var m=1;m<=y.length-1;m++)if(kb(v,y[m]),v.length===h)return v;p=d=g}}return kb(v,bb(a,d)),v}]}),!wb,pb);var _b=k,Cb=T,xb=Math.floor,Sb=_b("".charAt),Tb=_b("".replace),Eb=_b("".slice),Pb=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,Rb=/\$([$&'`]|\d{1,2})/g,Ob=gr,Ib=Pe,Lb=k,Ab=ym,Db=d,Mb=Se,Nb=ue,Fb=b,Bb=di,jb=bi,Hb=Yo,Ub=C,Wb=Pm,Vb=ze,Gb=function(e,t,n,i,r,o){var a=n+e.length,s=i.length,c=Rb;return void 0!==r&&(r=Cb(r),c=Pb),Tb(o,c,(function(o,c){var u;switch(Sb(c,0)){case"$":return"$";case"&":return e;case"`":return Eb(t,0,n);case"'":return Eb(t,a);case"<":u=r[Eb(c,1,-1)];break;default:var l=+c;if(0===l)return o;if(l>s){var f=xb(l/10);return 0===f?o:f<=s?void 0===i[f-1]?Sb(c,1):i[f-1]+Sb(c,1):o}u=i[l-1]}return void 0===u?"":u}))},Kb=Mm,zb=ie("replace"),Yb=Math.max,qb=Math.min,Xb=Lb([].concat),$b=Lb([].push),Jb=Lb("".indexOf),Zb=Lb("".slice),Qb="$0"==="a".replace(/./,"$0"),ew=!!/./[zb]&&""===/./[zb]("a","$0");Ab("replace",(function(e,t,n){var i=ew?"$":"$0";return[function(e,n){var i=Ub(this),r=Fb(e)?void 0:Vb(e,zb);return r?Ib(r,e,i,n):Ib(t,Hb(i),e,n)},function(e,r){var o=Mb(this),a=Hb(e);if("string"==typeof r&&-1===Jb(r,i)&&-1===Jb(r,"$<")){var s=n(t,o,a,r);if(s.done)return s.value}var c=Nb(r);c||(r=Hb(r));var u=o.global;if(u){var l=o.unicode;o.lastIndex=0}for(var f=[];;){var h=Kb(o,a);if(null===h)break;if($b(f,h),!u)break;""===Hb(h[0])&&(o.lastIndex=Wb(a,jb(o.lastIndex),l))}for(var d,p="",v=0,g=0;g<f.length;g++){for(var y=Hb((h=f[g])[0]),m=Yb(qb(Bb(h.index),a.length),0),k=[],b=1;b<h.length;b++)$b(k,void 0===(d=h[b])?d:String(d));var w=h.groups;if(c){var _=Xb([y],k,m,a);void 0!==w&&$b(_,w);var C=Hb(Ob(r,void 0,_))}else C=Gb(y,a,m,k,w,r);m>=v&&(p+=Zb(a,v,m)+C,v=m+y.length)}return p+Zb(a,v)}]}),!!Db((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!Qb||ew);var tw=St.PROPER,nw=d,iw=iv,rw=fv.trim;fr({target:"String",proto:!0,forced:function(e){return nw((function(){return!!iw[e]()||"​…᠎"!=="​…᠎"[e]()||tw&&iw[e].name!==e}))}("trim")},{trim:function(){return rw(this)}});var ow=ra,aw=Math.floor,sw=function(e,t){var n=e.length,i=aw(n/2);return n<8?cw(e,t):uw(e,sw(ow(e,0,i),t),sw(ow(e,i),t),t)},cw=function(e,t){for(var n,i,r=e.length,o=1;o<r;){for(i=o,n=e[o];i&&t(e[i-1],n)>0;)e[i]=e[--i];i!==o++&&(e[i]=n)}return e},uw=function(e,t,n,i){for(var r=t.length,o=n.length,a=0,s=0;a<r||s<o;)e[a+s]=a<r&&s<o?i(t[a],n[s])<=0?t[a++]:n[s++]:a<r?t[a++]:n[s++];return e},lw=sw,fw=M.match(/firefox\/(\d+)/i),hw=!!fw&&+fw[1],dw=/MSIE|Trident/.test(M),pw=M.match(/AppleWebKit\/(\d+)\./),vw=!!pw&&+pw[1],gw=fr,yw=k,mw=Ve,kw=T,bw=_i,ww=bl,_w=Yo,Cw=d,xw=lw,Sw=Zu,Tw=hw,Ew=dw,Pw=W,Rw=vw,Ow=[],Iw=yw(Ow.sort),Lw=yw(Ow.push),Aw=Cw((function(){Ow.sort(void 0)})),Dw=Cw((function(){Ow.sort(null)})),Mw=Sw("sort"),Nw=!Cw((function(){if(Pw)return Pw<70;if(!(Tw&&Tw>3)){if(Ew)return!0;if(Rw)return Rw<603;var e,t,n,i,r="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:n=3;break;case 68:case 71:n=4;break;default:n=2}for(i=0;i<47;i++)Ow.push({k:t+i,v:n})}for(Ow.sort((function(e,t){return t.v-e.v})),i=0;i<Ow.length;i++)t=Ow[i].k.charAt(0),r.charAt(r.length-1)!==t&&(r+=t);return"DGBEFHACIJK"!==r}}));gw({target:"Array",proto:!0,forced:Aw||!Dw||!Mw||!Nw},{sort:function(e){void 0!==e&&mw(e);var t=kw(this);if(Nw)return void 0===e?Iw(t):Iw(t,e);var n,i,r=[],o=bw(t);for(i=0;i<o;i++)i in t&&Lw(r,t[i]);for(xw(r,function(e){return function(t,n){return void 0===n?-1:void 0===t?1:void 0!==e?+e(t,n)||0:_w(t)>_w(n)?1:-1}}(e)),n=bw(r),i=0;i<n;)t[i]=r[i++];for(;i<o;)ww(t,i++);return t}});var Fw="undefined"!=typeof window&&window.location&&window.location.href.indexOf("xgplayerdebugger=1")>-1,Bw={info:"color: #525252; background-color: #90ee90;",error:"color: #525252; background-color: red;",warn:"color: #525252; background-color: yellow; "},jw="%c[xgplayer]",Hw={config:{debug:Fw?3:1},logInfo:function(e){for(var t,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];this.config.debug>=3&&(t=console).log.apply(t,[jw,Bw.info,e].concat(i))},logWarn:function(e){for(var t,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];this.config.debug>=1&&(t=console).warn.apply(t,[jw,Bw.warn,e].concat(i))},logError:function(e){var t;if(!(this.config.debug<1)){for(var n=this.config.debug>=2?"trace":"error",i=arguments.length,r=new Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];(t=console)[n].apply(t,[jw,Bw.error,e].concat(r))}}};var Uw=function(){function e(t){Bo(this,e),this.bufferedList=t}return Fo(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}(),Ww={};function Vw(e){var t=Do(e);return null!==e&&("object"===t||"function"===t)}function Gw(e,t,n){var i,r,o,a,s,c,u=0,l=!1,f=!1,h=!0,d=!t&&0!==t&&"function"==typeof window.requestAnimationFrame;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var n=i,o=r;return i=r=void 0,u=t,a=e.apply(o,n)}function v(e,t){return d?(window.cancelAnimationFrame(s),window.requestAnimationFrame(e)):setTimeout(e,t)}function g(e){var n=e-c;return void 0===c||n>=t||n<0||f&&e-u>=o}function y(){var e=Date.now();if(g(e))return m(e);s=v(y,function(e){var n=e-u,i=t-(e-c);return f?Math.min(i,o-n):i}(e))}function m(e){return s=void 0,h&&i?p(e):(i=r=void 0,a)}function k(){for(var e=Date.now(),n=g(e),o=arguments.length,h=new Array(o),d=0;d<o;d++)h[d]=arguments[d];if(i=h,r=this,c=e,n){if(void 0===s)return function(e){return u=e,s=v(y,t),l?p(e):a}(c);if(f)return s=v(y,t),p(c)}return void 0===s&&(s=v(y,t)),a}return t=+t||0,Vw(n)&&(l=!!n.leading,o=(f="maxWait"in n)?Math.max(+n.maxWait||0,t):o,h="trailing"in n?!!n.trailing:h),k.cancel=function(){void 0!==s&&function(e){if(d)return window.cancelAnimationFrame(e);clearTimeout(e)}(s),u=0,i=c=r=s=void 0},k.flush=function(){return void 0===s?a:m(Date.now())},k.pending=function(){return void 0!==s},k}Ww.createDom=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=document.createElement(e);return r.className=i,r.innerHTML=t,Object.keys(n).forEach((function(t){var i=t,o=n[t];"video"===e||"audio"===e||"live-video"===e?o&&r.setAttribute(i,o):r.setAttribute(i,o)})),r},Ww.createDomFromHtml=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";try{var i=document.createElement("div");i.innerHTML=e;var r=i.children;return i=null,r.length>0?(r=r[0],n&&Ww.addClass(r,n),t&&Object.keys(t).forEach((function(e){r.setAttribute(e,t[e])})),r):null}catch(e){return Hw.logError("util.createDomFromHtml",e),null}},Ww.hasClass=function(e,t){if(!e||!t)return!1;try{return Array.prototype.some.call(e.classList,(function(e){return e===t}))}catch(i){var n=e.className&&"object"===Do(e.className)?e.getAttribute("class"):e.className;return n&&!!n.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}},Ww.addClass=function(e,t){if(e&&t)try{t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.add(t)}))}catch(n){Ww.hasClass(e,t)||(e.className&&"object"===Do(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t)}},Ww.removeClass=function(e,t){if(e&&t)try{t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.remove(t)}))}catch(n){Ww.hasClass(e,t)&&t.split(/\s+/g).forEach((function(t){var n=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===Do(e.className)?e.setAttribute("class",e.getAttribute("class").replace(n," ")):e.className=e.className.replace(n," ")}))}},Ww.toggleClass=function(e,t){e&&t.split(/\s+/g).forEach((function(t){Ww.hasClass(e,t)?Ww.removeClass(e,t):Ww.addClass(e,t)}))},Ww.classNames=function(){for(var e=arguments,t=[],n=function(n){"String"===Ww.typeOf(e[n])?t.push(e[n]):"Object"===Ww.typeOf(e[n])&&Object.keys(e[n]).map((function(i){e[n][i]&&t.push(i)}))},i=0;i<arguments.length;i++)n(i);return t.join(" ")},Ww.findDom=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,n=arguments.length>1?arguments[1]:void 0;try{e=t.querySelector(n)}catch(i){Hw.logError("util.findDom",i),0===n.indexOf("#")&&(e=t.getElementById(n.slice(1)))}return e},Ww.getCss=function(e,t){return e.currentStyle?e.currentStyle[t]:document.defaultView.getComputedStyle(e,!1)[t]},Ww.padStart=function(e,t,n){for(var i=String(n),r=t>>0,o=Math.ceil(r/i.length),a=[],s=String(e);o--;)a.push(i);return a.join("").substring(0,r-s.length)+s},Ww.format=function(e){if(window.isNaN(e))return"";e=Math.round(e);var t=Ww.padStart(Math.floor(e/3600),2,0),n=Ww.padStart(Math.floor((e-3600*t)/60),2,0),i=Ww.padStart(Math.floor(e-3600*t-60*n),2,0);return("00"===t?[n,i]:[t,n,i]).join(":")},Ww.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},Ww.typeOf=function(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]},Ww.deepCopy=function(e,t){if("Object"===Ww.typeOf(t)&&"Object"===Ww.typeOf(e))return Object.keys(t).forEach((function(n){"Object"!==Ww.typeOf(t[n])||t[n]instanceof Node?"Array"===Ww.typeOf(t[n])?e[n]="Array"===Ww.typeOf(e[n])?e[n].concat(t[n]):t[n]:e[n]=t[n]:void 0===e[n]||void 0===e[n]?e[n]=t[n]:Ww.deepCopy(e[n],t[n])})),e},Ww.deepMerge=function(e,t){return Object.keys(t).map((function(n){var i;"Array"===Ww.typeOf(t[n])&&"Array"===Ww.typeOf(e[n])?"Array"===Ww.typeOf(e[n])&&(i=e[n]).push.apply(i,Py(t[n])):Ww.typeOf(e[n])!==Ww.typeOf(t[n])||null===e[n]||"Object"!==Ww.typeOf(e[n])||t[n]instanceof window.Node?null!==t[n]&&(e[n]=t[n]):Ww.deepMerge(e[n],t[n])})),e},Ww.getBgImage=function(e){var t=(e.currentStyle||window.getComputedStyle(e,null)).backgroundImage;if(!t||"none"===t)return"";var n=document.createElement("a");return n.href=t.replace(/url\("|"\)/g,""),n.href},Ww.copyDom=function(e){if(e&&1===e.nodeType){var t=document.createElement(e.tagName);return Array.prototype.forEach.call(e.attributes,(function(e){t.setAttribute(e.name,e.value)})),e.innerHTML&&(t.innerHTML=e.innerHTML),t}return""},Ww.setInterval=function(e,t,n,i){e._interval[t]||(e._interval[t]=window.setInterval(n.bind(e),i))},Ww.clearInterval=function(e,t){clearInterval(e._interval[t]),e._interval[t]=null},Ww.setTimeout=function(e,t,n){e._timers||(e._timers=[]);var i=setTimeout((function(){t(),Ww.clearTimeout(e,i)}),n);return e._timers.push(i),i},Ww.clearTimeout=function(e,t){var n=e._timers;if("Array"===Ww.typeOf(n)){for(var i=0;i<n.length;i++)if(n[i]===t){n.splice(i,1),clearTimeout(t);break}}else clearTimeout(t)},Ww.clearAllTimers=function(e){var t=e._timers;"Array"===Ww.typeOf(t)&&(t.map((function(e){clearTimeout(e)})),e._timerIds=[])},Ww.createImgBtn=function(e,t,n,i){var r,o,a,s=Ww.createDom("xg-".concat(e),"",{},"xgplayer-".concat(e,"-img"));(s.style.backgroundImage='url("'.concat(t,'")'),n&&i)&&(["px","rem","em","pt","dp","vw","vh","vm","%"].every((function(e){return!(n.indexOf(e)>-1&&i.indexOf(e)>-1)||(r=parseFloat(n.slice(0,n.indexOf(e)).trim()),o=parseFloat(i.slice(0,i.indexOf(e)).trim()),a=e,!1)})),s.style.width="".concat(r).concat(a),s.style.height="".concat(o).concat(a),s.style.backgroundSize="".concat(r).concat(a," ").concat(o).concat(a),s.style.margin="start"===e?"-".concat(o/2).concat(a," auto auto -").concat(r/2).concat(a):"auto 5px auto 5px");return s},Ww.Hex2RGBA=function(e,t){var n=[];if(/^\#[0-9A-F]{3}$/i.test(e)){var i="#";e.replace(/[0-9A-F]/gi,(function(e){i+=e+e})),e=i}return/^#[0-9A-F]{6}$/i.test(e)?(e.replace(/[0-9A-F]{2}/gi,(function(e){n.push(parseInt(e,16))})),"rgba(".concat(n.join(","),", ").concat(t,")")):"rgba(255, 255, 255, 0.1)"},Ww.getFullScreenEl=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},Ww.checkIsFunction=function(e){return e&&"function"==typeof e},Ww.checkIsObject=function(e){return null!==e&&"object"===Do(e)},Ww.hide=function(e){e.style.display="none"},Ww.show=function(e,t){e.style.display=t||"block"},Ww.isUndefined=function(e){if(null==e)return!0},Ww.setStyleFromCsstext=function(e,t){t&&("String"===Ww.typeOf(t)?t.replace(/\s+/g,"").split(";").map((function(t){if(t){var n=t.split(":");n.length>1&&(e.style[n[0]]=n[1])}})):Object.keys(t).map((function(n){e.style[n]=t[n]})))},Ww.filterStyleFromText=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["width","height","top","left","bottom","right","position","z-index","padding","margin","transform"],n=e.style.cssText;if(!n)return{};var i=n.replace(/\s+/g,"").split(";"),r={},o={};return i.map((function(e){if(e){var n=e.split(":");n.length>1&&(!function(e,t){for(var n=0,i=t.length;n<i;n++)if(e.indexOf(t[n])>-1)return!0;return!1}(n[0],t)?o[n[0]]=n[1]:r[n[0]]=n[1])}})),e.setAttribute("style",""),Object.keys(o).map((function(t){e.style[t]=o[t]})),r},Ww.getStyleFromCsstext=function(e){var t=e.style.cssText;if(!t)return{};var n=t.replace(/\s+/g,"").split(";"),i={};return n.map((function(e){if(e){var t=e.split(":");t.length>1&&(i[t[0]]=t[1])}})),i},Ww.preloadImg=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(e){var i=new window.Image;i.onload=function(e){i=null,t&&t(e)},i.onerror=function(e){i=null,n&&n(e)},i.src=e}},Ww.stopPropagation=function(e){e&&(e.stopPropagation(),e.cancelable&&e.preventDefault())},Ww.scrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},Ww.scrollLeft=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},Ww.checkTouchSupport=function(){return"ontouchstart"in window},Ww.getBuffered2=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,n=[],i=0;i<e.length;i++)n.push({start:e.start(i)<.5?0:e.start(i),end:e.end(i)});n.sort((function(e,t){var n=e.start-t.start;return n||t.end-e.end}));var r=[];if(t)for(var o=0;o<n.length;o++){var a=r.length;if(a){var s=r[a-1].end;n[o].start-s<t?n[o].end>s&&(r[a-1].end=n[o].end):r.push(n[o])}else r.push(n[o])}else r=n;return new Uw(r)},Ww.getBufferByCurrentTime=function(e,t){var n={start:0,end:0,include:0,diff:0,cur:t};if(!e||e.length<1)return n;for(var i=-1,r=-1,o=parseInt(1e3*t,10),a=e.length-1;a>-1;a--){var s=parseInt(1e3*e.start(a),10),c=parseInt(1e3*e.end(a),10);if(o>=s&&o<=c){n.include=1,n.start=s/1e3,n.end=c/1e3,n.diff=(c-o)/1e3;break}o<s&&(i<0||s-o<i)?(i=(s-o)/1e3,r=a):o>c&&(i<0||o-c<i)&&(i=(o-c)/1e3,r=a)}return 1!==n.include&&(r<0&&(r=e.length-1),n.start=parseInt(1e3*e.start(r),10)/1e3,n.end=parseInt(1e3*e.end(r),10)/1e3,n.diff=(parseInt(1e3*n.end,10)-o)/1e3),n},Ww.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}},Ww.requestAnimationFrame=function(e){var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(t)return t(e)},Ww.getHostFromUrl=function(e){if("String"!==Ww.typeOf(e))return"";var t=e.split("/"),n="";return t.length>3&&t[2]&&(n=t[2]),n},Ww.cancelAnimationFrame=function(e){var t=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.cancelRequestAnimationFrame;t&&t(e)},Ww.isMSE=function(e){return e.media&&(e=e.media),!!(e&&e instanceof HTMLMediaElement)&&(/^blob/.test(e.currentSrc)||/^blob/.test(e.src))},Ww.isBlob=function(e){return"string"==typeof e&&/^blob/.test(e)},Ww.generateSessionId=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=(new Date).getTime();try{e=parseInt(e)}catch(t){e=0}return t+=e,window.performance&&"function"==typeof window.performance.now&&(t+=parseInt(window.performance.now())),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?n:3&n|8).toString(16)}))},Ww.adjustTimeByDuration=function(e,t,n){return t&&e&&(e>t||n&&e<t)?t:e},Ww.getTransformStyle=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{x:0,y:0,scale:1,rotate:0},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n={scale:"".concat(e.scale||1),translate:"".concat(e.x||0,"%, ").concat(e.y||0,"%"),rotate:"".concat(e.rotate||0,"deg")};return Object.keys(n).forEach((function(e){var i=new RegExp("".concat(e,"\\([^\\(]+\\)"),"g"),r="".concat(e,"(").concat(n[e],")");i.test(t)?(i.lastIndex=-1,t=t.replace(i,r)):t+="".concat(r," ")})),t},Ww.convertDeg=function(e){return Math.abs(e)<=1?360*e:e%360};var Kw,zw={1:"network",2:"network",3:"decoder",4:"format"},Yw=Fo((function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{errorType:"",errorCode:0,errorMessage:"",originError:"",ext:{},mediaError:null,src:null};Bo(this,e);var i=t&&t.i18n?t.i18n.ERROR_TYPES:null;if(null!=t&&t.video){var r=n.mediaError?n.mediaError:t.video.error||{},o=t.duration,a=t.currentTime,s=t.ended,c=t.src,u=t.currentSrc,l=t.video,f=l.readyState,h=l.networkState,d={playerVersion:Ty,domain:document.domain,currentTime:a,duration:o,ended:s,readyState:f,networkState:h,src:n.src||c||u,errorType:n.errorType,errorCode:n.errorCode||r.code,message:n.errorMessage||r.message,mediaError:r,originError:n.originError?n.originError.stack:"",host:Ww.getHostFromUrl(c||u)};return n.ext&&Object.keys(n.ext).map((function(e){d[e]=n.ext[e]})),d}if(arguments.length>1){for(var p={playerVersion:Ty,domain:document.domain},v=["errorType","currentTime","duration","networkState","readyState","src","currentSrc","ended","errd","errorCode","mediaError"],g=0;g<arguments.length;g++)p[v[g]]=arguments[g];return p.ex=i?(i[arguments[0]]||{}).msg:"",p}})),qw="play",Xw="playing",$w="ended",Jw="pause",Zw="error",Qw="seeking",e_="seeked",t_="timeupdate",n_="waiting",i_="canplay",r_="durationchange",o_="volumechange",a_="loadeddata",s_="loadedmetadata",c_="ratechange",u_="progress",l_="loadstart",f_="emptied",h_="focus",d_="blur",p_="ready",v_="urlNull",g_="autoplay_started",y_="autoplay_was_prevented",m_="complete",k_="replay",b_="destroy",w_="urlchange",__="download_speed_change",C_="buffer_control",x_="AbortError",S_="fullscreen_request",T_="fullscreen_change",E_="cssFullscreen_change",P_="mini_state_change",R_="definition_change",O_="after_definition_change",I_="video_resize",L_="pip_change",A_="rotate",D_="screenShot",M_="playnext",N_="shortcut",F_="xglog",B_="user_action",j_="reset",H_="source_error",U_="source_success",W_=["play","playing","ended","pause","error","seeking","seeked","timeupdate","waiting","canplay","canplaythrough","durationchange","volumechange","loadeddata","loadedmetadata","ratechange","progress","loadstart","emptied","stalled","suspend","abort","lowdecode","mseAttaching","mseAttached","mseDetaching","mseDetached"],V_={STATS_INFO:"stats_info",STATS_DOWNLOAD:"stats_download",STATS_RESET:"stats_reset"},G_="fps_stuck",K_=Object.freeze({__proto__:null,PLAY:qw,PLAYING:Xw,ENDED:$w,PAUSE:Jw,ERROR:Zw,SEEKING:Qw,SEEKED:e_,TIME_UPDATE:t_,WAITING:n_,CANPLAY:i_,CANPLAY_THROUGH:"canplaythrough",DURATION_CHANGE:r_,VOLUME_CHANGE:o_,LOADED_DATA:a_,LOADED_METADATA:s_,RATE_CHANGE:c_,PROGRESS:u_,LOAD_START:l_,EMPTIED:f_,STALLED:"stalled",SUSPEND:"suspend",ABORT:"abort",BUFFER_CHANGE:"bufferedChange",PLAYER_FOCUS:h_,PLAYER_BLUR:d_,READY:p_,URL_NULL:v_,AUTOPLAY_STARTED:g_,AUTOPLAY_PREVENTED:y_,COMPLETE:m_,REPLAY:k_,DESTROY:b_,URL_CHANGE:w_,DOWNLOAD_SPEED_CHANGE:__,BUFFER_CONTROLS:C_,PLAY_ABORTED:x_,FULLSCREEN_REQUEST:S_,FULLSCREEN_CHANGE:T_,CSS_FULLSCREEN_CHANGE:E_,MINI_STATE_CHANGE:P_,DEFINITION_CHANGE:R_,BEFORE_DEFINITION_CHANGE:"before_definition_change",AFTER_DEFINITION_CHANGE:O_,SEI_PARSED:"SEI_PARSED",RETRY:"retry",VIDEO_RESIZE:I_,PIP_CHANGE:L_,ROTATE:A_,SCREEN_SHOT:D_,PLAYNEXT:M_,SHORTCUT:N_,XGLOG:F_,USER_ACTION:B_,RESET:j_,SOURCE_ERROR:H_,SOURCE_SUCCESS:U_,SWITCH_SUBTITLE:"switch_subtitle",VIDEO_EVENTS:W_,STATS_EVENTS:V_,FPS_STUCK:G_,DEGRADE:"degrade"}),z_=/(Android)\s([\d.]+)/,Y_=/(Version)\/([\d.]+)/,q_=["avc1.42E01E, mp4a.40.2","avc1.58A01E, mp4a.40.2","avc1.4D401E, mp4a.40.2","avc1.64001E, mp4a.40.2","avc1.42E01E","mp4v.20.8","avc1.42E01E, mp4a.40.2","avc1.58A01E, mp4a.40.2","avc1.4D401E, mp4a.40.2","avc1.64001E, mp4a.40.2","mp4v.20.8, mp4a.40.2","mp4v.20.240, mp4a.40.2"],X_={get device(){return X_.os.isPc?"pc":"mobile"},get browser(){if("undefined"==typeof navigator)return"";var e=navigator.userAgent.toLowerCase(),t={ie:/rv:([\d.]+)\) like gecko/,firefox:/firefox\/([\d.]+)/,chrome:/chrome\/([\d.]+)/,opera:/opera.([\d.]+)/,safari:/version\/([\d.]+).*safari/};return[].concat(Object.keys(t).filter((function(n){return t[n].test(e)})))[0]},get os(){if("undefined"==typeof navigator)return{};var e=navigator.userAgent,t=/(?:Windows Phone)/.test(e),n=/(?:SymbianOS)/.test(e)||t,i=/(?:Android)/.test(e),r=/(?:Firefox)/.test(e),o=/(?:iPad|PlayBook)/.test(e)||i&&!/(?:Mobile)/.test(e)||r&&/(?:Tablet)/.test(e),a=/(?:iPhone)/.test(e)&&!o,s=!(a||i||n||o),c=/(?:iPad|PlayBook)/.test(e);return{isTablet:o,isPhone:a,isIpad:c,isIos:a||c,isAndroid:i,isPc:s,isSymbian:n,isWindowsPhone:t,isFireFox:r}},get osVersion(){if("undefined"==typeof navigator)return 0;var e=navigator.userAgent,t="",n=(t=/(?:iPhone)|(?:iPad|PlayBook)/.test(e)?Y_:z_)?t.exec(e):[];if(n&&n.length>=3){var i=n[2].split(".");return i.length>0?parseInt(i[0]):0}return 0},get isWeixin(){if("undefined"==typeof navigator)return!1;return!!/(micromessenger)\/([\d.]+)/.exec(navigator.userAgent.toLocaleLowerCase())},isSupportMP4:function(){var e={isSupport:!1,mime:""};if("undefined"==typeof document)return e;if(this.supportResult)return this.supportResult;var t=document.createElement("video");return"function"==typeof t.canPlayType&&q_.map((function(n){"probably"===t.canPlayType('video/mp4; codecs="'.concat(n,'"'))&&(e.isSupport=!0,e.mime+="||".concat(n))})),this.supportResult=e,t=null,e},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 n=e.video||{},i=e.audio||{};try{var r=MediaSource.isTypeSupported(n.contentType),o=MediaSource.isTypeSupported(i.contentType);return Promise.resolve({supported:r&&o,smooth:!1,powerEfficient:!1})}catch(e){return Promise.resolve(t)}},isHdrSupported:function(){if("function"==typeof matchMedia){var e=matchMedia("(dynamic-range: high)"),t=matchMedia("not supported query");return e.media!==t.media&&!0===e.matches}return!1},isDolbyHdrSupported:function(){if("undefined"==typeof MediaSource||!MediaSource.isTypeSupported)return!1;return X_.isHdrSupported()&&(MediaSource.isTypeSupported('video/mp4;codecs="dvh1.08.07"')||MediaSource.isTypeSupported('video/mp4;codecs="hvc1.2.4.L150.90"')&&function(){if("undefined"!=typeof navigator){var e=null;if(void 0===Kw){var t=navigator.userAgent.toLowerCase();Kw=/chrome\/([\d.]+)/.exec(t)}if((e=Kw)&&e[1]&&parseInt(e[1].split(".")[0])>=122)return!0}return!1}())}},$_=X_;function J_(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}function Z_(e,t){this&&this.emit&&("error"===e?this.errorHandler(e,t.error):this.emit(e,t))}var Q_=function(e){Ho(n,e);var t=J_(n);function n(e){var i;Bo(this,n),(i=t.call(this,e))._hasStart=!1,i._currentTime=0,i._duration=0,i._internalOp={},i._lastMuted=!1,i.vtype=e.vtype||"MP4",i.bizType="number"==typeof e.bizType&&e.bizType>=0?e.bizType:0,i._rate=-1,i.videoConfig=Object.assign({},{controls:!1,autoplay:e.autoplay,playsinline:e.playsinline,"x5-playsinline":e.playsinline,"webkit-playsinline":e.playsinline,"x5-video-player-fullscreen":e["x5-video-player-fullscreen"]||e.x5VideoPlayerFullscreen,"x5-video-orientation":e["x5-video-orientation"]||e.x5VideoOrientation,airplay:e.airplay,"webkit-airplay":e.airplay,tabindex:0|e.tabindex,mediaType:e.mediaType||"video","data-index":-1},e.videoConfig,e.videoAttributes);var r=e["x5-video-player-type"]||e.x5VideoPlayerType;return $_.isWeixin&&$_.os.isAndroid&&r&&(i.videoConfig["x5-video-player-type"]=r,delete i.videoConfig.playsinline,delete i.videoConfig["webkit-playsinline"],delete i.videoConfig["x5-playsinline"]),e.loop&&(i.videoConfig.loop="loop"),i.video=Ww.createDom(i.videoConfig.mediaType,"",i.videoConfig,""),e.defaultPlaybackRate&&(i.video.defaultPlaybackRate=i.video.playbackRate=e.defaultPlaybackRate),"Number"===Ww.typeOf(e.volume)&&(i.volume=e.volume),e.autoplayMuted&&(i.video.muted=!0,i._lastMuted=!0),e.autoplay&&(i.video.autoplay=!0),i._interval={},i.videoEventMiddleware={},i.attachVideoEvents(),i}return Fo(n,[{key:"setEventsMiddleware",value:function(e){var t=this;Object.keys(e).map((function(n){t.videoEventMiddleware[n]=e[n]}))}},{key:"removeEventsMiddleware",value:function(e){var t=this;Object.keys(e).map((function(e){delete t.videoEventMiddleware[e]}))}},{key:"attachVideoEvents",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.evHandlers||(this._evHandlers=W_.map((function(e){return Go({},e,(i=t,r="on".concat((n=e).charAt(0).toUpperCase()).concat(n.slice(1)),i[r]&&"function"==typeof i[r]&&i.on(n,i[r]),function(e,t){var r=n,o={player:i,eventName:r,originalEvent:e,detail:e.detail||{},timeStamp:e.timeStamp,currentTime:i.currentTime,duration:i.duration,paused:i.paused,ended:i.ended,isInternalOp:!!i._internalOp[e.type],muted:i.muted,volume:i.volume,host:Ww.getHostFromUrl(i.currentSrc),vtype:i.vtype};if(i.removeInnerOP(e.type),"timeupdate"===r&&(i._currentTime=i.video&&i.video.currentTime),"ratechange"===r){var a=i.video?i.video.playbackRate:0;if(a&&i._rate===a)return;i._rate=i.video&&i.video.playbackRate}if("durationchange"===r&&(i._duration=i.video.duration),"volumechange"===r&&(o.isMutedChange=i._lastMuted!==i.muted,i._lastMuted=i.muted),"error"===r&&(o.error=t||i.video.error),i.videoEventMiddleware[n]){var s=Z_.bind(i,n,o);try{i.videoEventMiddleware[n].call(i,o,s)}catch(e){throw Z_.call(i,r,o),e}}else Z_.call(i,r,o)}));var n,i,r}))),e||(e=this.video),this._evHandlers.forEach((function(t){var i=Object.keys(t)[0];(0===n.length||n.indexOf(i)>-1)&&e.addEventListener(i,t[i],!1)}))}},{key:"detachVideoEvents",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];e||(e=this.video),this._evHandlers.forEach((function(n){var i=Object.keys(n)[0];(0===t.length||t.indexOf(i)>-1)&&e.removeEventListener(i,n[i],!1)}))}},{key:"_attachSourceEvents",value:function(e,t){var n=this;e.removeAttribute("src"),e.load(),e.removeEventListener("loadeddata",this._vLoadeddata),t.forEach((function(e){n.video.appendChild(Ww.createDom("source","",{src:"".concat(e.src),type:"".concat(e.type||"")}))}));var i=e.children;if(i){this._videoSourceCount=i.length,this._vLoadeddata=function(e){n.emit(U_,{src:e.target.currentSrc,host:Ww.getHostFromUrl(e.target.currentSrc)})};for(var r=null,o=0;o<this._evHandlers.length;o++)if("error"===Object.keys(this._evHandlers[o])[0]){r=this._evHandlers[o];break}!this._sourceError&&(this._sourceError=function(e){if(n._videoSourceCount--,0===n._videoSourceCount){var t={code:4,message:"sources_load_error"};r?r.error(e,t):n.errorHandler("error",t)}var i=zw[4];n.emit(H_,new Yw(n,{errorType:i,errorCode:4,errorMessage:"sources_load_error",mediaError:{code:4,message:"sources_load_error"},src:e.target.src}))});for(var a=0;a<i.length;a++)i[a].addEventListener("error",this._sourceError);e.addEventListener("loadeddata",this._vLoadeddata)}}},{key:"_detachSourceEvents",value:function(e){var t=e.children;if(t&&0!==t.length&&this._sourceError){for(var n=0;n<t.length;n++)t[n].removeEventListener("error",this._sourceError);for(;t.length>0;)e.removeChild(t[0]);this._vLoadeddata&&e.removeEventListener("loadeddata",this._vLoadeddata)}}},{key:"errorHandler",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.video&&(this.video.error||t)){var n=this.video.error||t,i=n.code?zw[n.code]:"other";n.message;this.video.currentSrc||(n={code:6,message:"empty_src_".concat(n.message)}),this.emit(e,new Yw(this,{errorType:i,errorCode:n.code,errorMessage:n.message||"",mediaError:n}))}}},{key:"hasStart",get:function(){return this._hasStart},set:function(e){"boolean"==typeof e&&(this._hasStart=e,this.emit("hasstart"))}},{key:"destroy",value:function(){var e=this;for(var t in this.video&&(this.video.pause&&(this.video.pause(),this.video.muted=!0),this.video.removeAttribute("src"),this.video.load()),this._currentTime=0,this._duration=0,this._hasStart=!1,this.videoConfig=null,this._interval)Object.prototype.hasOwnProperty.call(this._interval,t)&&(clearInterval(this._interval[t]),this._interval[t]=null);this.detachVideoEvents(),this._evHandlers.map((function(t){var n=Object.keys(t)[0],i="on".concat(n.charAt(0).toUpperCase()).concat(n.slice(1));"function"==typeof e[i]&&e.off(n,e[i])})),this._evHandlers=null,this.video=null,this.videoEventMiddleware={},this.removeAllListeners()}},{key:"play",value:function(){return this.video?this.video.play():null}},{key:"pause",value:function(){this.video&&this.video.pause()}},{key:"load",value:function(){this.video&&this.video.load()}},{key:"canPlayType",value:function(e){return!!this.video&&this.video.canPlayType(e)}},{key:"getBufferedRange",value:function(e){var t=[0,0];if(!this.video)return t;e||(e=this.video.buffered);var n=this.video.currentTime;if(e)for(var i=0,r=e.length;i<r&&(t[0]=e.start(i),t[1]=e.end(i),!(t[0]<=n&&n<=t[1]));i++);return t[0]-n<=0&&n-t[1]<=0?t:[0,0]}},{key:"autoplay",get:function(){return!!this.video&&this.video.autoplay},set:function(e){this.video&&(this.video.autoplay=e)}},{key:"buffered",get:function(){return this.video?this.video.buffered:null}},{key:"buffered2",get:function(){return this.video?Ww.getBuffered2(this.video.buffered):null}},{key:"bufferedPoint",get:function(){var e={start:0,end:0};if(!this.video)return e;var t=this.video.buffered;if(!t||0===t.length)return e;for(var n=0;n<t.length;n++)if((t.start(n)<=this.currentTime||t.start(n)<.1)&&t.end(n)>=this.currentTime)return{start:t.start(n),end:t.end(n)};return e}},{key:"crossOrigin",get:function(){return this.video?this.video.crossOrigin:""},set:function(e){this.video&&(this.video.crossOrigin=e)}},{key:"currentSrc",get:function(){return this.video?this.video.currentSrc:""},set:function(e){this.video&&(this.video.currentSrc=e)}},{key:"currentTime",get:function(){return this.video?void 0!==this.video.currentTime?this.video.currentTime:this._currentTime:0},set:function(e){this.video&&(this.video.currentTime=e)}},{key:"defaultMuted",get:function(){return!!this.video&&this.video.defaultMuted},set:function(e){this.video&&(this.video.defaultMuted=e)}},{key:"duration",get:function(){return this._duration}},{key:"ended",get:function(){return!!this.video&&this.video.ended}},{key:"error",get:function(){if(!this.video||!this.video.error)return null;return["MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED"][this.video.error.code-1]}},{key:"loop",get:function(){return!!this.video&&this.video.loop},set:function(e){this.video&&(this.video.loop=e)}},{key:"muted",get:function(){return!!this.video&&this.video.muted},set:function(e){this.video&&this.video.muted!==e&&(this._lastMuted=this.video.muted,this.video.muted=e)}},{key:"networkState",get:function(){return this.video?this.video.networkState:0}},{key:"paused",get:function(){return!this.video||this.video.paused}},{key:"playbackRate",get:function(){return this.video?this.video.playbackRate:0},set:function(e){this.video&&e!==1/0&&(this.video.defaultPlaybackRate=e,this.video.playbackRate=e)}},{key:"played",get:function(){return this.video?this.video.played:null}},{key:"preload",get:function(){return!!this.video&&this.video.preload},set:function(e){this.video&&(this.video.preload=e)}},{key:"readyState",get:function(){return this.video?this.video.readyState:0}},{key:"seekable",get:function(){return!!this.video&&this.video.seekable}},{key:"seeking",get:function(){return!!this.video&&this.video.seeking}},{key:"src",get:function(){return this.video?this.video.src:""},set:function(e){this.video.src=e}},{key:"volume",get:function(){return this.video?this.video.volume:0},set:function(e){"number"!=typeof e||e<0||e>1||!this.video||(this.video.volume=e)}},{key:"addInnerOP",value:function(e){this._internalOp[e]=!0}},{key:"removeInnerOP",value:function(e){delete this._internalOp[e]}},{key:"emit",value:function(e,t){for(var i,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(i=uu(Vo(n.prototype),"emit",this)).call.apply(i,[this,e,t].concat(o))}},{key:"on",value:function(e,t){for(var i,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(i=uu(Vo(n.prototype),"on",this)).call.apply(i,[this,e,t].concat(o))}},{key:"once",value:function(e,t){for(var i,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(i=uu(Vo(n.prototype),"once",this)).call.apply(i,[this,e,t].concat(o))}},{key:"off",value:function(e,t){for(var i,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(i=uu(Vo(n.prototype),"off",this)).call.apply(i,[this,e,t].concat(o))}},{key:"offAll",value:function(){uu(Vo(n.prototype),"removeAllListeners",this).call(this)}}]),n}(Sy),eC=Q_,tC=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{name:"xgplayer",version:1,db:null,ojstore:{name:"xg-m4a",keypath:"vid"}};Bo(this,e),this.indexedDB=window.indexedDB||window.webkitindexedDB,this.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange,this.myDB=t}return Fo(e,[{key:"openDB",value:function(e){var t=this,n=this,i=this.myDB.version||1,r=n.indexedDB.open(n.myDB.name,i);r.onerror=function(e){},r.onsuccess=function(i){t.myDB.db=i.target.result,e.call(n)},r.onupgradeneeded=function(e){var t=e.target.result;e.target.transaction,t.objectStoreNames.contains(n.myDB.ojstore.name)||t.createObjectStore(n.myDB.ojstore.name,{keyPath:n.myDB.ojstore.keypath})}}},{key:"deletedb",value:function(){this.indexedDB.deleteDatabase(this.myDB.name)}},{key:"closeDB",value:function(){this.myDB.db.close()}},{key:"addData",value:function(e,t){for(var n,i=this.myDB.db.transaction(e,"readwrite").objectStore(e),r=0;r<t.length;r++)(n=i.add(t[r])).onerror=function(){},n.onsuccess=function(){}}},{key:"putData",value:function(e,t){for(var n,i=this.myDB.db.transaction(e,"readwrite").objectStore(e),r=0;r<t.length;r++)(n=i.put(t[r])).onerror=function(){},n.onsuccess=function(){}}},{key:"getDataByKey",value:function(e,t,n){var i=this,r=this.myDB.db.transaction(e,"readwrite").objectStore(e).get(t);r.onerror=function(){n.call(i,null)},r.onsuccess=function(e){var t=e.target.result;n.call(i,t)}}},{key:"deleteData",value:function(e,t){this.myDB.db.transaction(e,"readwrite").objectStore(e).delete(t)}},{key:"clearData",value:function(e){this.myDB.db.transaction(e,"readwrite").objectStore(e).clear()}}]),e}(),nC=tC,iC=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],rC=["requestFullscreen","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen"],oC=["exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen"],aC="data-xgplayerid",sC={BUFFER_CONTROLS:"buffer_control"},cC={PLAYING:"playing",WAITING:"waiting"},uC=fr,lC=Za.find,fC=zv,hC="find",dC=!0;function pC(e,t,n){for(var i=arguments.length,r=new Array(i>3?i-3:0),o=3;o<i;o++)r[o-3]=arguments[o];var a=t.call.apply(t,[e].concat(r));n&&"function"==typeof n&&(a&&a.then?a.then((function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];n.call.apply(n,[e].concat(i))})):n.call.apply(n,[e].concat(r)))}function vC(e,t){var 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),function(){var i=arguments,r=this;if(n.pre)try{var o;(o=n.pre).call.apply(o,[this].concat(Array.prototype.slice.call(arguments)))}catch(t){throw t.message="[pluginName: ".concat(this.pluginName,":").concat(e,":pre error] >> ").concat(t.message),t}if(this.__hooks&&this.__hooks[e])try{var a,s=(a=this.__hooks[e]).call.apply(a,[this,this].concat(Array.prototype.slice.call(arguments)));s?s.then?s.then((function(e){!1!==e&&pC.apply(void 0,[r,t,n.next].concat(Py(i)))})).catch((function(e){throw e})):pC.apply(void 0,[this,t,n.next].concat(Array.prototype.slice.call(arguments))):void 0===s&&pC.apply(void 0,[this,t,n.next].concat(Array.prototype.slice.call(arguments)))}catch(t){throw t.message="[pluginName: ".concat(this.pluginName,":").concat(e,"] >> ").concat(t.message),t}else pC.apply(void 0,[this,t,n.next].concat(Array.prototype.slice.call(arguments)))}.bind(this)}function gC(e,t){var n=this.__hooks;if(n)return n.hasOwnProperty(e)?(n&&(n[e]=t),!0):(console.warn("has no supported hook which name [".concat(e,"]")),!1)}function yC(e,t){var n=this.__hooks;if(!n||!Array.isArray(n[e]))return-1;for(var i=n[e],r=0;r<i.length;r++)if(i[r]===t)return r;return-1}function mC(e,t){var n=this.__hooks;if(n)if(Array.isArray(n[e])){var i=n[e],r=yC.call(this,e,t);-1!==r&&i.splice(r,1)}else n[e]&&(n[e]=null)}function kC(e){if(this.plugins&&this.plugins[e.toLowerCase()]){for(var t=this.plugins[e.toLowerCase()],n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return t.useHooks&&t.useHooks.apply(t,i)}}function bC(e){if(this.plugins&&this.plugins[e.toLowerCase()]){var t=this.plugins[e.toLowerCase()];if(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return t.removeHooks&&t.removeHooks.apply(t,i)}}}function wC(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];e.__hooks={},t&&t.map((function(t){e.__hooks[t]=null})),Object.defineProperty(e,"hooks",{get:function(){return e.__hooks&&Object.keys(e.__hooks).map((function(t){if(e.__hooks[t])return t}))}})}function _C(e){e.__hooks=null}function CC(e,t,n){for(var i=arguments.length,r=new Array(i>3?i-3:0),o=3;o<i;o++)r[o-3]=arguments[o];if(!e.__hooks||!e.__hooks[t])return n.call.apply(n,[e,e].concat(r));var a,s=(a=e.__hooks[t]).call.apply(a,[e,e].concat(r));if(s&&s.then)s.then((function(t){return!1===t?null:n.call.apply(n,[e,e].concat(r))})).catch((function(e){console.warn("[runHooks]".concat(t," reject"),e.message)}));else if(!1!==s)return n.call.apply(n,[e,e].concat(r))}function xC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function SC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xC(Object(n),!0).forEach((function(t){Go(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xC(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function TC(e,t){Hw.logError("[".concat(e,"] event or callback cant be undefined or null when call ").concat(t))}hC in[]&&Array(1)[hC]((function(){dC=!1})),uC({target:"Array",proto:!0,forced:dC},{find:function(e){return lC(this,e,arguments.length>1?arguments[1]:void 0)}}),fC(hC);var EC=function(){function e(t){Bo(this,e),Ww.checkIsFunction(this.beforeCreate)&&this.beforeCreate(t),wC(this),this.__args=t,this.__events={},this.__onceEvents={},this.config=t.config||{},this.player=null,this.playerConfig={},this.pluginName="",this.__init(t)}return Fo(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:"reInitialize",value:function(){this.__init(this.__args)}},{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,t=Ww.checkTouchSupport()?"touch":"mouse";return["compatible","touch","mouse"].indexOf(null===(e=this.playerConfig)||void 0===e?void 0:e.domEventType)>-1&&(t=this.playerConfig.domEventType),t}},{key:"on",value:function(e,t){var n=this;e&&t&&this.player?"string"==typeof e?(this.__events[e]=t,this.player.on(e,t)):Array.isArray(e)&&e.forEach((function(e){n.__events[e]=t,n.player.on(e,t)})):TC(this.pluginName,"plugin.on(event, callback)")}},{key:"once",value:function(e,t){var n=this;e&&t&&this.player?"string"==typeof e?(this.__onceEvents[e]=t,this.player.once(e,t)):Array.isArray(e)&&e.forEach((function(i){n.__onceEvents[i]=t,n.player.once(e,t)})):TC(this.pluginName,"plugin.once(event, callback)")}},{key:"off",value:function(e,t){var n=this;e&&t&&this.player?"string"==typeof e?(delete this.__events[e],this.player.off(e,t)):Array.isArray(e)&&e.forEach((function(i){delete n.__events[e],n.player.off(i,t)})):TC(this.pluginName,"plugin.off(event, callback)")}},{key:"offAll",value:function(){var e=this;["__events","__onceEvents"].forEach((function(t){Object.keys(e[t]).forEach((function(n){e[t][n]&&e.off(n,e[t][n]),n&&delete e[t][n]}))})),this.__events={},this.__onceEvents={}}},{key:"emit",value:function(e){var t;if(this.player){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];(t=this.player).emit.apply(t,[e].concat(i))}}},{key:"emitUserAction",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.player){var i=SC(SC({},n),{},{pluginName:this.pluginName});this.player.emitUserAction(e,t,i)}}},{key:"hook",value:function(e,t){return vC.call.apply(vC,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];return gC.call.apply(gC,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];return mC.call.apply(mC,[this].concat(Array.prototype.slice.call(arguments)))}},{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]:"";if(this.player)return n&&(t.pluginName=n),this.player.registerPlugin({plugin:e,options:t})}},{key:"getPlugin",value:function(e){return this.player?this.player.getPlugin(e):null}},{key:"__destroy",value:function(){var e=this,t=this.player,n=this.pluginName;this.offAll(),Ww.clearAllTimers(this),Ww.checkIsFunction(this.destroy)&&this.destroy(),["player","playerConfig","pluginName","logger","__args","__hooks"].map((function(t){e[t]=null})),t.unRegisterPlugin(n),_C(this)}}],[{key:"defineGetterOrSetter",value:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&Object.defineProperty(e,n,t[n])}},{key:"defaultConfig",get:function(){return{}}},{key:"pluginName",get:function(){return"pluginName"}}]),e}();if("undefined"!=typeof Element&&!Element.prototype.matches){var PC=Element.prototype;PC.matches=PC.matchesSelector||PC.mozMatchesSelector||PC.msMatchesSelector||PC.oMatchesSelector||PC.webkitMatchesSelector}var RC=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}};function OC(e,t,n,i,r){var o=IC.apply(this,arguments);return e.addEventListener(n,o,r),{destroy:function(){e.removeEventListener(n,o,r)}}}function IC(e,t,n,i){return function(n){n.delegateTarget=RC(n.target,t),n.delegateTarget&&i.call(e,n)}}var LC=function(e,t,n,i,r){return"function"==typeof e.addEventListener?OC.apply(null,arguments):"function"==typeof n?OC.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return OC(e,t,n,i,r)})))};function AC(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var DC={CONTROLS:"controls",ROOT:"root"},MC={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"},NC="xg-icon-disable";function FC(e){return!!e&&(e.indexOf&&/^(?:http|data:|\/)/.test(e))}function BC(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",o=null;if(e instanceof window.Element)return Ww.addClass(e,n),Object.keys(i).map((function(t){e.setAttribute(t,i[t])})),e;if(FC(e)||FC(e.url))return i.src=FC(e)?e:e.url||"",o=Ww.createDom(e.tag||"img","",i,"xg-img ".concat(n));if("function"==typeof e)try{return(o=e())instanceof window.Element?(Ww.addClass(o,n),Object.keys(i).map((function(e){o.setAttribute(e,i[e])})),o):(Hw.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(r,"] is a function mast return an Element Object")),null)}catch(e){return Hw.logError("Plugin named [".concat(r,"]:createIcon"),e),null}return"string"==typeof e?Ww.createDomFromHtml(e,i,n):(Hw.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(r,"] is invalid")),null)}function jC(e,t){var n=t.config.icons||t.playerConfig.icons;Object.keys(e).map((function(i){var r=e[i],o=r&&r.class?r.class:"",a=r&&r.attr?r.attr:{},s=null;n&&n[i]&&(o=function(e,t){return"object"===Do(e)&&e.class&&"string"==typeof e.class?"".concat(t," ").concat(e.class):t}(n[i],o),a=function(e,t){return"object"===Do(e)&&e.attr&&"object"===Do(e.attr)&&Object.keys(e.attr).map((function(n){t[n]=e.attr[n]})),t}(n[i],a),s=BC(n[i],i,o,a,t.pluginName)),!s&&r&&(s=BC(r.icon?r.icon:r,a,o,{},t.pluginName)),t.icons[i]=s}))}var HC=function(e){Ho(n,e);var t=AC(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Bo(this,n),(e=t.call(this,i)).__delegates=[],e}return Fo(n,[{key:"__init",value:function(e){if(uu(Vo(n.prototype),"__init",this).call(this,e),e.root){var t=e.root,i=null;this.icons={},this.root=null,this.parent=null,jC(this.registerIcons()||{},this),this.langText={};var r,o,a=this.registerLanguageTexts()||{};r=a,o=this,Object.keys(r).map((function(e){Object.defineProperty(o.langText,e,{get:function(){var t=o.lang,n=o.i18n;return n[e]?n[e]:r[e]&&r[e][t]||""}})}));var s="";try{s=this.render()}catch(e){throw Hw.logError("Plugin:".concat(this.pluginName,":render"),e),new Error("Plugin:".concat(this.pluginName,":render:").concat(e.message))}if(s)(i=n.insert(s,t,e.index)).setAttribute("data-index",e.index);else{if(!e.tag)return;(i=Ww.createDom(e.tag,"",e.attr,e.name)).setAttribute("data-index",e.index),t.appendChild(i)}this.root=i,this.parent=t;var c=this.config.attr||{},u=this.config.style||{};this.setAttr(c),this.setStyle(u),this.config.index&&this.root.setAttribute("data-index",this.config.index),this.__registerChildren()}}},{key:"__registerChildren",value:function(){var e=this;if(this.root){this._children=[];var t=this.children();t&&"object"===Do(t)&&Object.keys(t).length>0&&Object.keys(t).map((function(n){var i,r,o=n,a=t[o],s={root:e.root};"function"==typeof a?(i=e.config[o]||{},r=a):"object"===Do(a)&&"function"==typeof a.plugin&&(i=a.options?Ww.deepCopy(e.config[o]||{},a.options):e.config[o]||{},r=a.plugin),s.config=i,void 0!==i.index&&(s.index=i.index),i.root&&(s.root=i.root),e.registerPlugin(r,s,o)}))}}},{key:"updateLang",value:function(e){e||(e=this.lang);var t=this.root,n=this.i18n,i=this.langText;t&&function e(t,n){for(var i=0;i<t.children.length;i++)t.children[i].children.length>0?e(t.children[i],n):n(t.children[i])}(t,(function(t){var r=t.getAttribute&&t.getAttribute("lang-key");if(r){var o=n[r.toUpperCase()]||i[r];o&&(t.innerHTML="function"==typeof o?o(e):o)}}))}},{key:"lang",get:function(){return this.player.lang}},{key:"changeLangTextKey",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=this.i18n||{},i=this.langText;e.setAttribute&&e.setAttribute("lang-key",t);var r=n[t]||i[t]||"";r&&(e.innerHTML=r)}},{key:"plugins",value:function(){return this._children}},{key:"disable",value:function(){this.config.disable=!0,Ww.addClass(this.find(".xgplayer-icon"),NC)}},{key:"enable",value:function(){this.config.disable=!1,Ww.removeClass(this.find(".xgplayer-icon"),NC)}},{key:"children",value:function(){return{}}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";t.root=t.root||this.root;var r=uu(Vo(n.prototype),"registerPlugin",this).call(this,e,t,i);return this._children.push(r),r}},{key:"unregisterPlugin",value:function(e){if(this._children instanceof Array){var t=function(e,t){if(e instanceof Array)for(var n=0;n<e.length;n++)if(t.call(null,e[n],n,e))return n;return-1}(this._children,(function(t){return t===e||t.pluginName&&t.pluginName===e.pluginName}));t>-1&&this._children.splice(t,1)}}},{key:"registerIcons",value:function(){return{}}},{key:"registerLanguageTexts",value:function(){return{}}},{key:"find",value:function(e){if(this.root)return this.root.querySelector(e)}},{key:"bind",value:function(e,t,i){var r=this;if(arguments.length<3&&"function"==typeof t)Array.isArray(e)?e.forEach((function(e){r.bindEL(e,t)})):this.bindEL(e,t);else{var o=n.delegate.call(this,this.root,e,t,i);this.__delegates=this.__delegates.concat(o)}}},{key:"unbind",value:function(e,t){var n=this;if(arguments.length<3&&"function"==typeof t)Array.isArray(e)?e.forEach((function(e){n.unbindEL(e,t)})):this.unbindEL(e,t);else for(var i="".concat(e,"_").concat(t),r=0;r<this.__delegates.length;r++)if(this.__delegates[r].key===i){this.__delegates[r].destroy(),this.__delegates.splice(r,1);break}}},{key:"setStyle",value:function(e,t){var n=this;if(this.root)return"String"===Ww.typeOf(e)?this.root.style[e]=t:void("Object"===Ww.typeOf(e)&&Object.keys(e).map((function(t){n.root.style[t]=e[t]})))}},{key:"setAttr",value:function(e,t){var n=this;if(this.root)return"String"===Ww.typeOf(e)?this.root.setAttribute(e,t):void("Object"===Ww.typeOf(e)&&Object.keys(e).map((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 n=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,n)}},{key:"unbindEL",value:function(e,t){var n=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,n)}},{key:"show",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.root&&(this.root.style.display=void 0!==e?e:"block",t&&"none"===window.getComputedStyle(this.root,null).getPropertyValue("display")))return this.root.style.display="block"}},{key:"hide",value:function(){this.root&&(this.root.style.display="none")}},{key:"appendChild",value:function(e,t){if(!this.root)return null;if(arguments.length<2&&arguments[0]instanceof window.Element)return this.root.appendChild(arguments[0]);if(!(t&&t instanceof window.Element))return null;try{return"string"==typeof e?this.find(e).appendChild(t):e.appendChild(t)}catch(e){return Hw.logError("Plugin:appendChild",e),null}}},{key:"render",value:function(){return""}},{key:"destroy",value:function(){}},{key:"__destroy",value:function(){var e=this,t=this.player;this.__delegates.map((function(e){e.destroy()})),this.__delegates=[],this._children instanceof Array&&(this._children.forEach((function(e){t.unRegisterPlugin(e.pluginName)})),this._children=null),this.root&&(this.root.hasOwnProperty("remove")?this.root.remove():this.root.parentNode&&this.root.parentNode.removeChild(this.root)),uu(Vo(n.prototype),"__destroy",this).call(this),this.icons={},["root","parent"].map((function(t){e[t]=null}))}}],[{key:"insert",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=t.children.length,r=Number(n),o=e instanceof window.Node;if(i){for(var a=0,s=null,c="";a<i;a++){s=t.children[a];var u=Number(s.getAttribute("data-index"));if(u>=r){c="beforebegin";break}u<r&&(c="afterend")}return o?"afterend"===c?t.appendChild(e):t.insertBefore(e,s):s.insertAdjacentHTML(c,e),"afterend"===c?t.children[t.children.length-1]:t.children[a]}return o?t.appendChild(e):t.insertAdjacentHTML("beforeend",e),t.children[t.children.length-1]}},{key:"defaultConfig",get:function(){return{}}},{key:"delegate",value:function(e,t,n,i){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=[];if(e instanceof window.Node&&"function"==typeof i)if(Array.isArray(n))n.forEach((function(n){var a=LC(e,t,n,i,r);a.key="".concat(t,"_").concat(n),o.push(a)}));else{var a=LC(e,t,n,i,r);a.key="".concat(t,"_").concat(n),o.push(a)}return o}},{key:"ROOT_TYPES",get:function(){return DC}},{key:"POSITIONS",get:function(){return MC}}]),n}(EC),UC=Tm.charAt,WC=Yo,VC=on,GC=Fg,KC=Bg,zC="String Iterator",YC=VC.set,qC=VC.getterFor(zC);GC(String,"String",(function(e){YC(this,{type:zC,string:WC(e),index:0})}),(function(){var e,t=qC(this),n=t.string,i=t.index;return i>=n.length?KC(void 0,!0):(e=UC(n,i),t.index+=e.length,KC(e,!1))}));var XC=function(){function e(){var t=this;if(Bo(this,e),Go(this,"__trigger",(function(e){var n=(new Date).getTime();t.timeStamp=n;for(var i=0;i<e.length;i++)t.__runHandler(e[i].target)})),this.__handlers=[],this.timeStamp=0,this.observer=null,window.ResizeObserver)try{this.observer=new window.ResizeObserver(function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return Vw(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),Gw(e,t,{leading:i,trailing:r,maxWait:t})}(this.__trigger,100,{trailing:!0})),this.timeStamp=(new Date).getTime()}catch(e){console.error(e)}}return Fo(e,[{key:"addObserver",value:function(e,t){if(this.observer){this.observer&&this.observer.observe(e);for(var n=e.getAttribute(aC),i=this.__handlers,r=-1,o=0;o<i.length;o++)i[o]&&e===i[o].target&&(r=o);r>-1?this.__handlers[r].handler=t:this.__handlers.push({target:e,handler:t,playerId:n})}}},{key:"unObserver",value:function(e){var t=-1;this.__handlers.map((function(n,i){e===n.target&&(t=i)}));try{this.observer&&this.observer.unobserve(e)}catch(e){}this.observer&&this.observer.unobserve(e),t>-1&&this.__handlers.splice(t,1)}},{key:"destroyObserver",value:function(){this.observer&&this.observer.disconnect(),this.observer=null,this.__handlers=null}},{key:"__runHandler",value:function(e){for(var t=this.__handlers,n=0;n<t.length;n++)if(t[n]&&e===t[n].target){try{t[n].handler(e)}catch(e){console.error(e)}return!0}return!1}}]),e}(),$C=null;var JC={pluginGroup:{},init:function(e){var t,n,i=e._pluginInfoId;i||(i=(new Date).getTime(),e._pluginInfoId=i),!e.config.closeResizeObserver&&(t=e.root,n=function(){e.getVideoSize()},$C||($C=new XC),$C.addObserver(t,n)),this.pluginGroup[i]={_originalOptions:e.config||{},_plugins:{}}},formatPluginInfo:function(e,t){var n=null,i=null;return e.plugin&&"function"==typeof e.plugin?(n=e.plugin,i=e.options):(n=e,i={}),t&&(i.config=t||{}),{PLUFGIN:n,options:i}},checkPluginIfExits:function(e,t){for(var n=0;n<t.length;n++)if(e.toLowerCase()===t[n].pluginName.toLowerCase())return!0;return!1},getRootByConfig:function(e,t){for(var n=Object.keys(t),i=null,r=0;r<n.length;r++)if(e.toLowerCase()===n[r].toLowerCase()){i=t[n[r]];break}return"Object"===Ww.typeOf(i)?{root:i.root,position:i.position}:{}},lazyRegister:function(e,t){var n=this,i=t.timeout||1500;return Promise.race([t.loader().then((function(t){var i;i=t&&t.__esModule?t.default:t,n.register(e,i,t.options)})),new Promise((function(e,t){setTimeout((function(){t(new Error("timeout"))}),i)}))])},register:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e&&t&&"function"==typeof t&&void 0!==t.prototype){var i=e._pluginInfoId;if(i&&this.pluginGroup[i]){this.pluginGroup[i]._plugins||(this.pluginGroup[i]._plugins={});var r=this.pluginGroup[i]._plugins,o=this.pluginGroup[i]._originalOptions;n.player=e;var a=n.pluginName||t.pluginName;if(!a)throw new Error("The property pluginName is necessary");if(!t.isSupported||t.isSupported()){n.config||(n.config={});for(var s=Object.keys(o),c=0;c<s.length;c++)if(a.toLowerCase()===s[c].toLowerCase()){var u=o[s[c]];"Object"===Ww.typeOf(u)&&(n.config=Object.assign({},n.config,o[s[c]]));break}t.defaultConfig&&Object.keys(t.defaultConfig).forEach((function(e){void 0===n.config[e]&&(n.config[e]=t.defaultConfig[e])})),n.root?"string"==typeof n.root&&(n.root=e[n.root]):n.root=e.root,n.index=n.config.index||0;try{r[a.toLowerCase()]&&(this.unRegister(i,a.toLowerCase()),console.warn("the is one plugin with same pluginName [".concat(a,"] exist, destroy the old instance")));var l=new t(n);return r[a.toLowerCase()]=l,r[a.toLowerCase()].func=t,l&&"function"==typeof l.afterCreate&&l.afterCreate(),l}catch(e){throw console.error(e),e}}else console.warn("not supported plugin [".concat(a,"]"))}}},unRegister:function(e,t){e._pluginInfoId&&(e=e._pluginInfoId),t=t.toLowerCase();var n=null;try{(n=this.pluginGroup[e]._plugins[t])&&(n.pluginName&&n.__destroy(),delete this.pluginGroup[e]._plugins[t])}catch(n){console.error("[unRegister:".concat(t,"] cgid:[").concat(e,"] error"),n)}return n},deletePlugin:function(e,t){var n=e._pluginInfoId;n&&this.pluginGroup[n]&&this.pluginGroup[n]._plugins&&delete this.pluginGroup[n]._plugins[t]},getPlugins:function(e){var t=e._pluginInfoId;return t&&this.pluginGroup[t]?this.pluginGroup[t]._plugins:{}},findPlugin:function(e,t){var n=e._pluginInfoId;if(!n||!this.pluginGroup[n])return null;var i=t.toLowerCase();return this.pluginGroup[n]._plugins[i]},beforeInit:function(e){var t=this;function n(e){return e&&e.then?e:new Promise((function(e){e()}))}return new Promise((function(i){if(t.pluginGroup)return(e._loadingPlugins&&e._loadingPlugins.length?Promise.all(e._loadingPlugins):Promise.resolve()).then((function(){var r=e._pluginInfoId;if(t.pluginGroup[r]){var o=t.pluginGroup[r]._plugins,a=[];Object.keys(o).forEach((function(e){if(o[e]&&o[e].beforePlayerInit)try{var t=o[e].beforePlayerInit();a.push(n(t))}catch(e){throw a.push(n(null)),e}})),Promise.all([].concat(a)).then((function(){i()})).catch((function(e){console.error(e),i()}))}else i()}))}))},afterInit:function(e){var t=e._pluginInfoId;if(t&&this.pluginGroup[t]){var n=this.pluginGroup[t]._plugins;Object.keys(n).forEach((function(e){n[e]&&n[e].afterPlayerInit&&n[e].afterPlayerInit()}))}},setLang:function(e,t){var n=t._pluginInfoId;if(n&&this.pluginGroup[n]){var i=this.pluginGroup[n]._plugins;Object.keys(i).forEach((function(t){if(i[t].updateLang)i[t].updateLang(e);else try{i[t].lang=e}catch(e){console.warn("".concat(t," setLang"))}}))}},reRender:function(e){var t=this,n=e._pluginInfoId;if(n&&this.pluginGroup[n]){var i=[],r=this.pluginGroup[n]._plugins;Object.keys(r).forEach((function(e){"controls"!==e&&r[e]&&(i.push({plugin:r[e].func,options:r[e].__args}),t.unRegister(n,e))})),i.forEach((function(n){t.register(e,n.plugin,n.options)}))}},onPluginsReady:function(e){var t=e._pluginInfoId;if(t&&this.pluginGroup[t]){var n=this.pluginGroup[t]._plugins||{};Object.keys(n).forEach((function(e){n[e].onPluginsReady&&"function"==typeof n[e].onPluginsReady&&n[e].onPluginsReady()}))}},destroy:function(e){var t=e._pluginInfoId;if(this.pluginGroup[t]){var n,i;n=e.root,$C.unObserver(n,i);for(var r=this.pluginGroup[t]._plugins,o=0,a=Object.keys(r);o<a.length;o++){var s=a[o];this.unRegister(t,s)}delete this.pluginGroup[t],delete e._pluginInfoId}}},ZC=JC,QC={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-inactive",FULLSCREEN:"xgplayer-is-fullscreen",CSS_FULLSCREEN:"xgplayer-is-cssfullscreen",PARENT_FULLSCREEN:"xgplayer-fullscreen-parent",ROTATE_FULLSCREEN:"xgplayer-rotate-fullscreen",PARENT_ROTATE_FULLSCREEN:"xgplayer-rotate-parent",INNER_FULLSCREEN:"xgplayer-inner-fullscreen",NO_CONTROLS:"no-controls",FLEX_CONTROLS:"flex-controls",CONTROLS_FOLLOW:"controls-follow",AUTOHIDE:"xgplayer_autohide",NOT_ALLOW_AUTOPLAY:"not-allow-autoplay",SEEKING:"seeking",PC:"xgplayer-pc",MOBILE:"xgplayer-mobile",MINI:"xgplayer-mini"};function ex(){return{id:"",el:null,url:"",domEventType:"default",nullUrlStart:!1,width:600,height:337.5,fluid:!1,fitVideoSize:"fixed",videoFillMode:"auto",volume:.6,autoplay:!1,autoplayMuted:!1,loop:!1,isLive:!1,zoom:1,videoInit:!0,poster:"",isMobileSimulateMode:!1,defaultPlaybackRate:1,execBeforePluginsCall:null,allowSeekAfterEnded:!0,enableContextmenu:!0,closeVideoClick:!1,closeVideoDblclick:!1,closePlayerBlur:!1,closeDelayBlur:!1,leavePlayerTime:3e3,closePlayVideoFocus:!1,closePauseVideoFocus:!1,closeFocusVideoFocus:!0,closeControlsBlur:!0,topBarAutoHide:!0,videoAttributes:{},startTime:0,seekedStatus:"play",miniprogress:!1,disableSwipeHandler:function(){},enableSwipeHandler:function(){},preProcessUrl:null,ignores:[],whitelist:[],inactive:3e3,lang:(e=(document.documentElement.getAttribute("lang")||navigator.language||"zh-cn").toLocaleLowerCase(),"zh-cn"===e&&(e="zh"),e),controls:!0,marginControls:!1,fullscreenTarget:null,screenShot:!1,rotate:!1,pip:!1,download:!1,mini:!1,cssFullscreen:!0,keyShortcut:!0,presets:[],plugins:[],playbackRate:1,definition:{list:[]},playsinline:!0,customDuration:0,timeOffset:0,icons:{},i18n:[],tabindex:0,thumbnail:null,videoConfig:{},isHideTips:!1,minWaitDelay:200,commonStyle:{progressColor:"",playedColor:"",cachedColor:"",sliderBtnStyle:{},volumeColor:""}};var e}function tx(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var nx=function(e){Ho(n,e);var t=tx(n);function n(){var e;Bo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Uo(e=t.call.apply(t,[this].concat(r))),"onMouseEnter",(function(t){var n=Uo(e),i=n.player;n.playerConfig.closeControlsBlur&&i.focus({autoHide:!1})})),Go(Uo(e),"onMouseLeave",(function(){Uo(e).player.focus()})),e}return Fo(n,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.controls&&(e.config.disable=!e.player.config.controls),e.config.mode||"mobile"!==$_.device||(e.config.mode="flex"),e.player.config.marginControls&&(e.config.autoHide=!1)}},{key:"afterCreate",value:function(){var e=this,t=this.config,n=t.disable,i=t.height,r=t.mode,o=t.autoHide;if(!n){"flex"===r&&this.player.addClass(QC.FLEX_CONTROLS),o&&this.player.addClass(QC.AUTOHIDE);var a={height:"".concat(i,"px")};Object.keys(a).map((function(t){e.root.style[t]=a[t]})),this.left=this.find("xg-left-grid"),this.center=this.find("xg-center-grid"),this.right=this.find("xg-right-grid"),this.innerRoot=this.find("xg-inner-controls"),this.on(P_,(function(t){t?Ww.addClass(e.root,"mini-controls"):Ww.removeClass(e.root,"mini-controls")}));var s=this.playerConfig.isMobileSimulateMode;"mobile"!==$_.device&&"mobile"!==s&&(this.bind("mouseenter",this.onMouseEnter),this.bind("mouseleave",this.onMouseLeave))}}},{key:"focus",value:function(){this.player.focus({autoHide:!1})}},{key:"unFocus",value:function(){this.player.focus({autoHide:!0})}},{key:"blur",value:function(){this.player.blur({ignorePaused:!0})}},{key:"recoverAutoHide",value:function(){this.config.autoHide&&Ww.addClass(this.root,"control_autohide")}},{key:"pauseAutoHide",value:function(){Ww.removeClass(this.root,"control_autohide")}},{key:"show",value:function(){this.root.style.display="",this.player.focus()}},{key:"hide",value:function(){this.root.style.display="none"}},{key:"mode",get:function(){return this.config.mode}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;if(this.root){var r=e.defaultConfig||{};if(!t.root){switch(t.position?t.position:t.config&&t.config.position?t.config.position:r.position){case MC.CONTROLS_LEFT:t.root=this.left;break;case MC.CONTROLS_RIGHT:t.root=this.right;break;case MC.CONTROLS_CENTER:t.root=this.center;break;case MC.CONTROLS:t.root=this.root;break;default:t.root=this.left}return uu(Vo(n.prototype),"registerPlugin",this).call(this,e,t,i)}}}},{key:"destroy",value:function(){"mobile"!==$_.device&&(this.unbind("mouseenter",this.onMouseEnter),this.unbind("mouseleave",this.onMouseLeave))}},{key:"render",value:function(){var e=this.config,t=e.mode,n=e.autoHide,i=e.initShow;if(!e.disable){var r=Ww.classNames({"xgplayer-controls":!0},{"flex-controls":"flex"===t},{"bottom-controls":"bottom"===t},{control_autohide:n},{controls_permanent:!n},{"xgplayer-controls-initshow":i||!n});return'<xg-controls class="'.concat(r,'" unselectable="on">\n <xg-inner-controls class="xg-inner-controls xg-pos">\n <xg-left-grid class="xg-left-grid">\n </xg-left-grid>\n <xg-center-grid class="xg-center-grid"></xg-center-grid>\n <xg-right-grid class="xg-right-grid">\n </xg-right-grid>\n </xg-inner-controls>\n </xg-controls>')}}}],[{key:"pluginName",get:function(){return"controls"}},{key:"defaultConfig",get:function(){return{disable:!1,autoHide:!0,mode:"",initShow:!1}}}]),n}(HC),ix=nx,rx={lang:{},langKeys:[],textKeys:[]};function ox(e,t){return Object.keys(t).forEach((function(n){var i,r=Ww.typeOf(t[n]),o=Ww.typeOf(e[n]);"Array"===r?("Array"!==o&&(e[n]=[]),(i=e[n]).push.apply(i,Py(t[n]))):"Object"===r?("Object"!==o&&(e[n]={}),ox(e[n],t[n])):e[n]=t[n]})),e}function ax(){Object.keys(rx.lang.en).map((function(e){rx.textKeys[e]=e}))}function sx(e,t){var n=e.LANG;if(t||(t=rx),t.lang){var i=e.TEXT||{};"zh"===n&&(n="zh-cn"),t.lang[n]?ox(t.lang[n],i):(t.langKeys.push(n),t.lang[n]=i),ax()}}sx({LANG:"en",TEXT:{ERROR_TYPES:{network:{code:1,msg:"video download error"},mse:{code:2,msg:"stream append error"},parse:{code:3,msg:"parsing error"},format:{code:4,msg:"wrong format"},decoder:{code:5,msg:"decoding error"},runtime:{code:6,msg:"grammatical errors"},timeout:{code:7,msg:"play timeout"},other:{code:8,msg:"other errors"}},HAVE_NOTHING:"There is no information on whether audio/video is ready",HAVE_METADATA:"Audio/video metadata is ready ",HAVE_CURRENT_DATA:"Data about the current play location is available, but there is not enough data to play the next frame/millisecond",HAVE_FUTURE_DATA:"Current and at least one frame of data is available",HAVE_ENOUGH_DATA:"The available data is sufficient to start playing",NETWORK_EMPTY:"Audio/video has not been initialized",NETWORK_IDLE:"Audio/video is active and has been selected for resources, but no network is used",NETWORK_LOADING:"The browser is downloading the data",NETWORK_NO_SOURCE:"No audio/video source was found",MEDIA_ERR_ABORTED:"The fetch process is aborted by the user",MEDIA_ERR_NETWORK:"An error occurred while downloading",MEDIA_ERR_DECODE:"An error occurred while decoding",MEDIA_ERR_SRC_NOT_SUPPORTED:"Audio/video is not supported",REPLAY:"Replay",ERROR:"Network is offline",PLAY_TIPS:"Play",PAUSE_TIPS:"Pause",PLAYNEXT_TIPS:"Play next",DOWNLOAD_TIPS:"Download",ROTATE_TIPS:"Rotate",RELOAD_TIPS:"Reload",FULLSCREEN_TIPS:"Fullscreen",EXITFULLSCREEN_TIPS:"Exit fullscreen",CSSFULLSCREEN_TIPS:"Cssfullscreen",EXITCSSFULLSCREEN_TIPS:"Exit cssfullscreen",TEXTTRACK:"Caption",PIP:"PIP",SCREENSHOT:"Screenshot",LIVE:"LIVE",OFF:"Off",OPEN:"Open",MINI_DRAG:"Click and hold to drag",MINISCREEN:"Miniscreen",REFRESH_TIPS:"Please Try",REFRESH:"Refresh",FORWARD:"forward",LIVE_TIP:"Live"}});var cx={get textKeys(){return rx.textKeys},get langKeys(){return rx.langKeys},get lang(){var e={};return rx.langKeys.map((function(t){e[t]=rx.lang[t]})),rx.lang["zh-cn"]&&(e.zh=rx.lang["zh-cn"]||{}),e},extend:function(e,t){var n=[];if(t||(t=rx),t.lang){n="Array"!==Ww.typeOf(e)?Object.keys(e).map((function(t){return{LANG:"zh"===t?"zh-cn":t,TEXT:e[t]}})):e;var i=t.lang;n.map((function(e){"zh"===e.LANG&&(e.LANG="zh-cn"),i[e.LANG]?ox(i[e.LANG]||{},e.TEXT||{}):sx(e,t)})),ax()}},use:sx,init:function(e){var t,n={lang:{},langKeys:[],textKeys:{},pId:e};return ox(n.lang,rx.lang),(t=n.langKeys).push.apply(t,Py(rx.langKeys)),ox(n.textKeys,rx.textKeys),n}},ux=cx;function lx(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var fx={},hx=null,dx=function(e){Ho(n,e);var t=lx(n);function n(){return Bo(this,n),t.apply(this,arguments)}return Fo(n,[{key:"add",value:function(e){e&&(fx[e.playerId]=e,1===Object.keys(fx).length&&this.setActive(e.playerId,!0))}},{key:"remove",value:function(e){e&&(e.isUserActive,delete fx[e.playerId])}},{key:"_iterate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(var n in fx)if(Object.prototype.hasOwnProperty.call(fx,n)){var i=fx[n];if(t){if(e(i))break}else e(i)}}},{key:"forEach",value:function(e){this._iterate(e)}},{key:"find",value:function(e){var t=null;return this._iterate((function(n){var i=e(n);return i&&(t=n),i}),!0),t}},{key:"findAll",value:function(e){var t=[];return this._iterate((function(n){e(n)&&t.push(n)})),t}},{key:"setActive",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(fx[e]){if(t){var n=!1;this.forEach((function(t){e===t.playerId?(t.isUserActive||(n=!0),t.isUserActive=!0,t.isInstNext=!1):t.isUserActive=!1})),n&&this.emit("activeChanged")}else fx[e].isUserActive=t;return e}}},{key:"getActiveId",value:function(){for(var e=Object.keys(fx),t=0;t<e.length;t++){var n=fx[e[t]];if(n&&n.isUserActive)return e[t]}return null}},{key:"setNext",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(fx[e])return t?this.forEach((function(t){e===t.playerId?(t.isUserActive=!1,t.isInstNext=!0):t.isInstNext=!1})):fx[e].isInstNext=t,e}}],[{key:"getInstance",value:function(){return hx||(hx=new n),hx}}]),n}(xy.exports.EventEmitter);function px(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function vx(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?px(Object(n),!0).forEach((function(t){Go(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):px(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function gx(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var yx=["play","pause","replay","retry","playnext"],mx=0,kx=0,bx=null,wx=function(e){Ho(n,e);var t=gx(n);function n(e){var i;Bo(this,n);var r,o=Ww.deepMerge(ex(),e);Go(Uo(i=t.call(this,o)),"canPlayFunc",(function(){if(i.config){var e=i.config,t=e.autoplay,n=e.startTime,r=e.defaultPlaybackRate;Hw.logInfo("player","canPlayFunc, startTime",n),n&&(i.currentTime=n>i.duration?i.duration:n,i.config.startTime=0),i.playbackRate=r,t&&i.videoPlay(),i.off(i_,i.canPlayFunc),i.removeClass(QC.ENTER)}})),Go(Uo(i),"onFullscreenChange",(function(e,t){var n=function(){Ww.setTimeout(Uo(i),(function(){i.getVideoSize()}),100)},r=Ww.getFullScreenEl();i._fullActionFrom?i._fullActionFrom="":i.emit(B_,{eventType:"system",action:"switch_fullscreen",pluginName:"player",currentTime:i.currentTime,duration:i.duration,props:[{prop:"fullscreen",from:!0,to:!1}]});var o=function(e,t,n){if(e){var i=e.getAttribute(n);return!(!i||i!==t||"VIDEO"!==e.tagName&&"AUDIO"!==e.tagName)}}(r,i.playerId,aC);if(t||r&&(r===i._fullscreenEl||o))n(),!i.config.closeFocusVideoFocus&&i.video.focus(),i.fullscreen=!0,i.emit(T_,!0,i._fullScreenOffset),i.cssfullscreen&&i.exitCssFullscreen();else if(i.fullscreen){n();var a=Uo(i),s=a._fullScreenOffset;a.config.needFullscreenScroll?(window.scrollTo(s.left,s.top),Ww.setTimeout(Uo(i),(function(){i.fullscreen=!1,i._fullScreenOffset=null}),100)):(!i.config.closeFocusVideoFocus&&i.video.focus(),i.fullscreen=!1,i._fullScreenOffset=null),i.cssfullscreen?i.removeClass(QC.FULLSCREEN):i.recoverFullStyle(i.root,i._fullscreenEl,QC.FULLSCREEN),i._fullscreenEl=null,i.emit(T_,!1)}})),Go(Uo(i),"_onWebkitbeginfullscreen",(function(e){i._fullscreenEl=i.video,i.onFullscreenChange(e,!0)})),Go(Uo(i),"_onWebkitendfullscreen",(function(e){i.onFullscreenChange(e,!1)})),wC(Uo(i),yx),i.config=o,i._pluginInfoId=Ww.generateSessionId(),(r=Uo(i)).logInfo=Hw.logInfo.bind(r),r.logWarn=Hw.logWarn.bind(r),r.logError=Hw.logError.bind(r);var a=i.constructor.defaultPreset;if(i.config.presets.length){var s=i.config.presets.indexOf("default");s>=0&&a&&(i.config.presets[s]=a)}else a&&i.config.presets.push(a);return i.userTimer=null,i.waitTimer=null,i.isReady=!1,i.isPlaying=!1,i.isError=!1,i.isSeeking=!1,i.isCanplay=!1,i._runPending=!1,i.rotateDeg=0,i.isActive=!1,i.isBufferControlPaused=!1,i.isCssfullScreen=!1,i.fullscreen=!1,i._fullscreenEl=null,i._cssfullscreenEl=null,i.curDefinition=null,i._orgCss="",i._fullScreenOffset=null,i._videoHeight=0,i._videoWidth=0,i.videoPos={pi:1,scale:0,rotate:-1,x:0,y:0,h:-1,w:-1,vy:0,vx:0},i.sizeInfo={width:0,height:0,left:0,top:0},i._accPlayed={t:0,acc:0,loopAcc:0},i.innerContainer=null,i.controls=null,i.topBar=null,i.topBar=null,i.root=null,i.__i18n=ux.init(),$_.os.isAndroid&&$_.osVersion>0&&$_.osVersion<6&&(i.config.autoplay=!1),i.database=new nC,i.isUserActive=!1,i._onceSeekCanplay=null,i._isPauseBeforeSeek=0,i.innerStates={isActiveLocked:!1},i.instManager=bx,i._initDOM()?(i._bindEvents(),i._registerPresets(),i._registerPlugins(),ZC.onPluginsReady(Uo(i)),Ww.setTimeout(Uo(i),(function(){i.emit(p_),i.onReady&&i.onReady(),i.isReady=!0}),0),i.getInitDefinition(),i.syncFullstate(),(i.config.videoInit||i.config.autoplay)&&(i.hasStart||i.start()),i):(console.error(new Error("can't find the dom which id is ".concat(i.config.id," or this.config.el does not exist"))),Wo(i))}return Fo(n,[{key:"_initDOM",value:function(){var e,t=this;if(this.root=this.config.id?document.getElementById(this.config.id):null,!this.root){var n=this.config.el;if(!n||1!==n.nodeType)return this.emit(Zw,new Yw("use",this.config.vid,{line:32,handle:"Constructor",msg:"container id can't be empty"})),console.error("this.confg.id or this.config.el can't be empty"),!1;this.root=n}var i=function(e){for(var t=Object.keys(fx),n=0;n<t.length;n++){var i=fx[t[n]];if(i.root===e)return i}return null}(this.root);i&&(Hw.logWarn("The is an Player instance already exists in this.root, destroy it and reinitialize"),i.destroy()),this.root.setAttribute(aC,this.playerId),null===(e=bx)||void 0===e||e.add(this),ZC.init(this),this._initBaseDoms();var r=this.constructor.XgVideoProxy;if(r&&this.videoConfig.mediaType===r.mediaType){var o=this.innerContainer||this.root;this.detachVideoEvents(this.video);var a=new r(o,this.config,this.videoConfig);this.attachVideoEvents(a),this.video=a}if(this.video.setAttribute(aC,this.playerId),this.config.controls){var s=ZC.register(this,ix);this.controls=s}var c="mobile"===this.config.isMobileSimulateMode?"mobile":$_.device;if(this.addClass("".concat(QC.DEFAULT," ").concat(QC.ACTIVE," xgplayer-").concat(c," ").concat(this.config.controls?"":QC.NO_CONTROLS)),this.config.autoplay?this.addClass(QC.ENTER):this.addClass(QC.NO_START),this.config.fluid){var u={"max-width":"100%",width:"100%",height:"0","padding-top":"".concat(100*this.config.height/this.config.width,"%"),position:"position",top:"0",left:"0"};Object.keys(u).map((function(e){t.root.style[e]=u[e]}))}else["width","height"].map((function(e){t.config[e]&&("number"!=typeof t.config[e]?t.root.style[e]=t.config[e]:t.root.style[e]="".concat(t.config[e],"px"))}));var l=this.root.getBoundingClientRect(),f=l.width,h=l.height,d=l.left,p=l.top;return this.sizeInfo.width=f,this.sizeInfo.height=h,this.sizeInfo.left=d,this.sizeInfo.top=p,!0}},{key:"_initBaseDoms",value:function(){this.topBar=Ww.createDom("xg-bar","",{"data-index":-1},"xg-top-bar"),this.leftBar=Ww.createDom("xg-bar","",{"data-index":-1},"xg-left-bar"),this.rightBar=Ww.createDom("xg-bar","",{"data-index":-1},"xg-right-bar"),this.config.marginControls&&(this.innerContainer=Ww.createDom("xg-video-container","",{"data-index":-1},"xg-video-container"),this.root.appendChild(this.innerContainer)),this.root.appendChild(this.topBar),this.root.appendChild(this.leftBar),this.root.appendChild(this.rightBar)}},{key:"_bindEvents",value:function(){var e=this;["focus","blur"].forEach((function(t){e.on(t,e["on"+t.charAt(0).toUpperCase()+t.slice(1)])})),iC.forEach((function(t){document&&document.addEventListener(t,e.onFullscreenChange)})),$_.os.isIos&&(this.video.addEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.video.addEventListener("webkitendfullscreen",this._onWebkitendfullscreen)),this.once("loadeddata",this.getVideoSize),this.playFunc=function(){e.config.closeFocusVideoFocus||e.video.focus()},this.once("play",this.playFunc),this.on(C_,this.onBufferControl)}},{key:"_unbindEvents",value:function(){var e=this;this.root.removeEventListener("mousemove",this.mousemoveFunc),iC.forEach((function(t){document.removeEventListener(t,e.onFullscreenChange)})),this.playFunc&&this.off("play",this.playFunc),this.off("canplay",this.canPlayFunc),this.video.removeEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.video.removeEventListener("webkitendfullscreen",this._onWebkitendfullscreen)}},{key:"_startInit",value:function(e){var t=this;if(this.video&&(e&&""!==e&&("Array"!==Ww.typeOf(e)||0!==e.length)||(e="",this.emit(v_),Hw.logWarn("config.url is null, please get url and run player._startInit(url)"),!this.config.nullUrlStart))){this._detachSourceEvents(this.video),"Array"===Ww.typeOf(e)&&e.length>0?this._attachSourceEvents(this.video,e):this.video.src&&this.video.src===e?e||this.video.removeAttribute("src"):this.video.src=e,"Number"===Ww.typeOf(this.config.volume)&&(this.volume=this.config.volume);var n=this.innerContainer?this.innerContainer:this.root;this.video instanceof window.Element&&!n.contains(this.video)&&n.insertBefore(this.video,n.firstChild);var i=this.video.readyState;Hw.logInfo("_startInit readyState",i),this.config.autoplay&&(!Ww.isMSE(this.video)&&this.load(),($_.os.isIpad||$_.os.isPhone)&&this.videoPlay()),i>=2?this.canPlayFunc():this.once(i_,this.canPlayFunc),Ww.setTimeout(this,(function(){t.isComplete=!0,t.emit(m_)}),1),this.hasStart||ZC.afterInit(this),this.hasStart=!0}}},{key:"_registerPlugins",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._loadingPlugins=[];var n=this.config.ignores||[],i=this.config.plugins||[],r=this.config.i18n||[];t&&ux.extend(r,this.__i18n);var o=n.join("||").toLowerCase().split("||"),a=this.plugins;i.forEach((function(n){try{var i=n.plugin?n.plugin.pluginName:n.pluginName;if(!i)return;var r=i.toLowerCase(),s=e.config[r]||e.config[i];if("Boolean"===Ww.typeOf(s)&&!s||o.indexOf(r)>-1)return;if(!t&&a[r])return;if(n.lazy&&n.loader){var c=ZC.lazyRegister(e,n);return void(n.forceBeforeInit&&(c.then((function(){e._loadingPlugins.splice(e._loadingPlugins.indexOf(c),1)})).catch((function(t){Hw.logError("_registerPlugins:loadingPlugin",t),e._loadingPlugins.splice(e._loadingPlugins.indexOf(c),1)})),e._loadingPlugins.push(c)))}return e.registerPlugin(n)}catch(e){Hw.logError("_registerPlugins:",e)}}))}},{key:"_registerPresets",value:function(){var e=this;this.config.presets.forEach((function(t){!function(e,t){var n,i,r=t.preset&&t.options?new t.preset(t.options,e.config):new t({},e.config),o=r.plugins,a=void 0===o?[]:o,s=r.ignores,c=void 0===s?[]:s,u=r.icons,l=void 0===u?{}:u,f=r.i18n,h=void 0===f?[]:f;e.config.plugins||(e.config.plugins=[]),e.config.ignores||(e.config.ignores=[]),(n=e.config.plugins).push.apply(n,Py(a)),(i=e.config.ignores).push.apply(i,Py(c)),Object.keys(l).map((function(t){e.config.icons[t]||(e.config.icons[t]=l[t])}));var d=e.config.i18n||[];h.push.apply(h,Py(d)),e.config.i18n=h}(e,t)}))}},{key:"_getRootByPosition",value:function(e){var t=null;switch(e){case MC.ROOT_RIGHT:t=this.rightBar;break;case MC.ROOT_LEFT:t=this.leftBar;break;case MC.ROOT_TOP:t=this.topBar;break;default:t=this.innerContainer||this.root}return t}},{key:"registerPlugin",value:function(e,t){var n=ZC.formatPluginInfo(e,t),i=n.PLUFGIN,r=n.options,o=this.config.plugins;!ZC.checkPluginIfExits(i.pluginName,o)&&o.push(i);var a=ZC.getRootByConfig(i.pluginName,this.config);a.root&&(r.root=a.root),a.position&&(r.position=a.position);var s=r.position?r.position:r.config&&r.config.position||i.defaultConfig&&i.defaultConfig.position;return!r.root&&"string"==typeof s&&s.indexOf("controls")>-1?this.controls&&this.controls.registerPlugin(i,r,i.pluginName):(r.root||(r.root=this._getRootByPosition(s)),ZC.register(this,i,r))}},{key:"deregister",value:function(e){var t,n,i=ZC.unRegister(this,"string"==typeof e?e:e.pluginName);i&&null!==(t=this.config)&&void 0!==t&&t.unregisterPluginFromControls&&(null===(n=this.controls)||void 0===n||n.unregisterPlugin(i))}},{key:"unRegisterPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e&&(this.deregister(e),t&&this.removePluginFromConfig(e))}},{key:"removePluginFromConfig",value:function(e){var t;if("string"==typeof e?t=e:e instanceof EC&&(t=e.pluginName),t)for(var n=this.config.plugins.length-1;n>-1;n--){if(this.config.plugins[n].pluginName.toLowerCase()===t.toLowerCase()){this.config.plugins.splice(n,1);break}}}},{key:"plugins",get:function(){return ZC.getPlugins(this)}},{key:"getPlugin",value:function(e){var t=ZC.findPlugin(this,e);return t&&t.pluginName?t:null}},{key:"addClass",value:function(e){this.root&&(Ww.hasClass(this.root,e)||Ww.addClass(this.root,e))}},{key:"removeClass",value:function(e){this.root&&Ww.removeClass(this.root,e)}},{key:"hasClass",value:function(e){if(this.root)return Ww.hasClass(this.root,e)}},{key:"setAttribute",value:function(e,t){this.root&&this.root.setAttribute(e,t)}},{key:"removeAttribute",value:function(e,t){this.root&&this.root.removeAttribute(e,t)}},{key:"start",value:function(e){var t=this;if(!this.hasStart)return e||this.config.url||this.getInitDefinition(),this.hasStart=!0,this._registerPlugins(!1),ZC.beforeInit(this).then((function(){if(t.config){e||(e=t.url||t.config.url);var n=t.preProcessUrl(e);return t._startInit(n.url)}})).catch((function(e){throw e.fileName="player",e.lineNumber="236",Hw.logError("start:beforeInit:",e),e}))}},{key:"switchURL",value:function(e){var t=this,n=e;"Object"===Ww.typeOf(e)&&(n=e.url);var i=this.currentTime,r=this.paused&&!this.isError;return this.src=n,new Promise((function(e){var n=function(){t.currentTime=i,r&&t.once("canplay",(function(){t.pause()})),e()};$_.os.isAndroid?t.once("timeupdate",(function(){n()})):t.once("canplay",(function(){n()})),t.play()}))}},{key:"videoPlay",value:function(){var e=this;if(this.hasStart){this.isPlaying||(this.removeClass(QC.NO_START),!this.isCanplay&&this.addClass(QC.ENTER));var t=uu(Vo(n.prototype),"play",this).call(this);return void 0!==t&&t&&t.then?t.then((function(){e.removeClass(QC.NOT_ALLOW_AUTOPLAY),e.addClass(QC.PLAYING),e.isPlaying||(Hw.logInfo(">>>>playPromise.then"),e.isPlaying=!0,e.emit(g_))})).catch((function(t){if(Hw.logWarn(">>>>playPromise.catch",t.name),e.video&&e.video.error)return e.onError(),void e.removeClass(QC.ENTER);"NotAllowedError"===t.name&&(e._errorTimer=Ww.setTimeout(e,(function(){e._errorTimer=null,e.emit(y_),e.addClass(QC.NOT_ALLOW_AUTOPLAY),e.removeClass(QC.ENTER),e.pause()}),0)),"AbortError"===t.name&&(e._errorTimer=Ww.setTimeout(e,(function(){e._errorTimer=null,e.emit(x_)}),0))})):(Hw.logWarn("video.play not return promise"),this.isPlaying||(this.isPlaying=!0,this.removeClass(QC.NOT_ALLOW_AUTOPLAY),this.removeClass(QC.NO_START),this.removeClass(QC.ENTER),this.addClass(QC.PLAYING),this.emit(g_))),t}this.removeClass(QC.NO_START),this.addClass(QC.ENTER);var i=this.start();i&&i.then((function(t){!e.config.autoplay&&e.videoPlay()}))}},{key:"videoPause",value:function(){uu(Vo(n.prototype),"pause",this).call(this)}},{key:"play",value:function(){var e=this;this.removeClass(QC.PAUSED),CC(this,"play",(function(){e.videoPlay()}))}},{key:"pause",value:function(e){var t=this;CC(this,"pause",(function(){e===sC.BUFFER_CONTROLS?t.isBufferControlPaused||(t.isBufferControlPaused=!0,t.emit(C_,{type:cC.WAITING})):t.isBufferControlPaused&&(t.isBufferControlPaused=!1,t.emit(C_,{type:cC.PLAYING})),uu(Vo(n.prototype),"pause",t).call(t)}),e)}},{key:"seek",value:function(e,t){var n=this;if(this.video&&!Number.isNaN(Number(e))&&this.hasStart){var i=this.config,r=i.isSeekedPlay,o=i.seekedStatus,a=t||(r?"play":o);e=e<0?0:e>this.duration?parseInt(this.duration,10):e,!this._isPauseBeforeSeek&&(this._isPauseBeforeSeek=this.paused?2:1),this._onceSeekCanplay&&this.off(e_,this._onceSeekCanplay),this._onceSeekCanplay=function(){switch(n.removeClass(QC.ENTER),n.isSeeking=!1,a){case"play":n.play();break;case"pause":n.pause();break;default:n._isPauseBeforeSeek>1||n.paused?n.pause():n.play()}n._isPauseBeforeSeek=0,n._onceSeekCanplay=null},this.once(e_,this._onceSeekCanplay),this.isPlaying?this.currentTime=e:(this.removeClass(QC.NO_START),this.currentTime=e,this.play())}}},{key:"getInitDefinition",value:function(){var e=this,t=this.config,n=t.definition;!t.url&&n&&n.list&&n.list.length>0&&n.defaultDefinition&&n.list.map((function(t){t.definition===n.defaultDefinition&&(e.config.url=t.url,e.curDefinition=t.definition)}))}},{key:"changeDefinition",value:function(e,t){var n=this,i=this.config.definition;if(Array.isArray(null==i?void 0:i.list)&&i.list.forEach((function(t){(null==e?void 0:e.definition)===t.definition&&(n.curDefinition=t)})),null!=e&&e.bitrate&&"number"!=typeof e.bitrate&&(e.bitrate=parseInt(e.bitrate,10)||0),this.emit(R_,{from:t,to:e}),this.hasStart){var r=this.switchURL(e.url);r&&r.then?r.then((function(){n.emit(O_,{from:t,to:e})})):this.emit(O_,{from:t,to:e})}else this.config.url=e.url}},{key:"reload",value:function(){this.load(),this.reloadFunc=function(){this.play()},this.once("loadeddata",this.reloadFunc)}},{key:"resetState",value:function(){var e=this,t=[QC.NOT_ALLOW_AUTOPLAY,QC.PLAYING,QC.NO_START,QC.PAUSED,QC.REPLAY,QC.ENTER,QC.ENDED,QC.ERROR,QC.LOADING];this.hasStart=!1,this.isError=!1,this.isPlaying=!1,this.videoPause(),this._accPlayed.acc=0,this._accPlayed.t=0,this._accPlayed.loopAcc=0,t.forEach((function(t){e.removeClass(t)})),this.addClass(QC.ENTER),this.emit(j_)}},{key:"reset",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;if(this.resetState(),this.plugins&&(t.map((function(t){e.deregister(t)})),n)){var i=ex();Object.keys(this.config).keys((function(t){"undefined"===e.config[t]||"plugins"!==t&&"presets"!==t&&"el"!==t&&"id"!==t||(e.config[t]=i[t])}))}}},{key:"destroy",value:function(){var e,t=this,i=this.innerContainer,r=this.root,o=this.video;if(r&&o){if(r.removeAttribute(aC),this.updateAcc("destroy"),this._unbindEvents(),this._detachSourceEvents(this.video),Ww.clearAllTimers(this),this.emit(b_),null===(e=bx)||void 0===e||e.remove(this),ZC.destroy(this),_C(this),uu(Vo(n.prototype),"destroy",this).call(this),this.fullscreen&&this._fullscreenEl===this.root)try{this.exitFullscreen()}catch(e){}if(i)for(var a=i.children,s=0;s<a.length;s++)i.removeChild(a[s]);!i&&o instanceof window.Node&&r.contains(o)&&o.parentNode.removeChild(o),["topBar","leftBar","rightBar","innerContainer"].map((function(e){t[e]&&r.removeChild(t[e]),t[e]=null}));var c=r.className.split(" ");c.length>0?r.className=c.filter((function(e){return e.indexOf("xgplayer")<0})).join(" "):r.className="",this.removeAttribute("data-xgfill"),["isReady","isPlaying","isSeeking","isCanplay","isActive","isCssfullScreen","fullscreen"].map((function(e){t[e]=!1}))}}},{key:"replay",value:function(){var e=this;this.removeClass(QC.ENDED),this.currentTime=0,this.isSeeking=!1,CC(this,"replay",(function(){e.once(e_,(function(){var t=e.videoPlay();t&&t.catch&&t.catch((function(e){console.log(e)}))})),e.play(),e.emit(k_),e.onPlay()}))}},{key:"retry",value:function(){var e=this;this.removeClass(QC.ERROR),this.addClass(QC.LOADING),CC(this,"retry",(function(){var t=e.currentTime;e.src=e.config.url,!e.config.isLive&&(e.currentTime=t),e.once(i_,(function(){e.videoPlay()}))}))}},{key:"syncFullstate",value:function(){var e=Ww.getFullScreenEl();e&&e===this.config.fullscreenTarget&&(this.fullscreen=!0,this._fullscreenEl=e,this._orgPCss||(this._orgPCss=Ww.filterStyleFromText(e)))}},{key:"changeFullStyle",value:function(e,t,n,i){e&&(i||(i=QC.PARENT_FULLSCREEN),this._orgCss||(this._orgCss=Ww.filterStyleFromText(e)),Ww.addClass(e,n),t&&t!==e&&!this._orgPCss&&(this._orgPCss=Ww.filterStyleFromText(t),Ww.addClass(t,i),t.setAttribute(aC,this.playerId)))}},{key:"recoverFullStyle",value:function(e,t,n,i){i||(i=QC.PARENT_FULLSCREEN),this._orgCss&&(Ww.setStyleFromCsstext(e,this._orgCss),this._orgCss=""),Ww.removeClass(e,n),t&&t!==e&&this._orgPCss&&(Ww.setStyleFromCsstext(t,this._orgPCss),this._orgPCss="",Ww.removeClass(t,i),t.removeAttribute(aC))}},{key:"getFullscreen",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget,n=this.root,i=this.video;if(t||(t=n),this._fullScreenOffset={top:Ww.scrollTop(),left:Ww.scrollLeft()},this._fullscreenEl=t,this._fullActionFrom="get",this.emit(S_),Ww.getFullScreenEl()===this._fullscreenEl)return this.onFullscreenChange(),Promise.resolve();try{for(var r=function(){var n=rC[o];if(t[n]){var i="webkitRequestFullscreen"===n?t.webkitRequestFullscreen(window.Element.ALLOW_KEYBOARD_INPUT):t[n]();return i&&i.then?(i.then((function(){"get"===e._fullActionFrom&&e.changeFullStyle(e.root,t,QC.FULLSCREEN)})).catch((function(e){Hw.logWarn("".concat(n,": ").concat((null==e?void 0:e.message)||"getFullscreen fail"))})),{v:i}):(e.changeFullStyle(e.root,t,QC.FULLSCREEN),{v:Promise.resolve()})}},o=0;o<rC.length;o++){var a=r();if("object"===Do(a))return a.v}return i.fullscreenEnabled||i.webkitSupportsFullscreen?(i.webkitEnterFullscreen(),Promise.resolve()):Promise.reject(new Error("call getFullscreen fail"))}catch(e){return Promise.reject(e)}}},{key:"exitFullscreen",value:function(e){if(this._fullscreenEl||Ww.getFullScreenEl()){this.root;var t=this.video;this._fullActionFrom="exit";for(var n=0;n<oC.length;n++){var i=oC[n];if(document[i]){var r=document[i]();return r&&r.then?r:Promise.resolve()}}return t&&t.webkitSupportsFullscreen?(t.webkitExitFullScreen(),Promise.resolve()):Promise.reject(new Error("call exitFullscreen fail"))}}},{key:"getCssFullscreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget;this.fullscreen&&this.exitFullscreen(),this._cssfullscreenEl=e,this.changeFullStyle(this.root,e,e?QC.INNER_FULLSCREEN:QC.CSS_FULLSCREEN),this.isCssfullScreen=!0,this.emit(E_,!0)}},{key:"exitCssFullscreen",value:function(){var e=this._cssfullscreenEl?QC.INNER_FULLSCREEN:QC.CSS_FULLSCREEN;this.fullscreen?this.removeClass(e):this.recoverFullStyle(this.root,this._cssfullscreenEl,e),this._cssfullscreenEl=null,this.isCssfullScreen=!1,this.emit(E_,!1)}},{key:"focus",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{autoHide:!this.config.closeDelayBlur,delay:this.config.inactive};this.isActive?this.onFocus(e):this.emit(h_,vx({paused:this.paused,ended:this.ended},e))}},{key:"blur",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{ignorePaused:!1};this.isActive?this.emit(d_,vx({paused:this.paused,ended:this.ended},e)):this.onBlur(e)}},{key:"onFocus",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{autoHide:!0,delay:3e3},n=this.innerStates;if(this.isActive=!0,this.removeClass(QC.ACTIVE),this.userTimer&&(Ww.clearTimeout(this,this.userTimer),this.userTimer=null),void 0!==t.isLock&&(n.isActiveLocked=t.isLock),!1===t.autoHide||!0===t.isLock||n.isActiveLocked)this.userTimer&&(Ww.clearTimeout(this,this.userTimer),this.userTimer=null);else{var i=t&&t.delay?t.delay:this.config.inactive;this.userTimer=Ww.setTimeout(this,(function(){e.userTimer=null,e.blur()}),i)}}},{key:"onBlur",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{ignorePaused:!1};if(this.isActive&&!this.innerStates.isActiveLocked){var t=this.config.closePauseVideoFocus;this.isActive=!1,(e.ignorePaused||t||!this.paused&&!this.ended)&&this.addClass(QC.ACTIVE)}}},{key:"onEmptied",value:function(){this.updateAcc("emptied")}},{key:"onCanplay",value:function(){this.hasStart&&this.removeClass(QC.ENTER),!this.isBufferControlPaused&&this.removeClass(QC.LOADING),this.isCanplay=!0,this.waitTimer&&Ww.clearTimeout(this,this.waitTimer)}},{key:"onLoadeddata",value:function(){this.isError=!1}},{key:"onPlay",value:function(){this.removeClass(QC.PAUSED),this.ended&&this.removeClass(QC.ENDED),!this.config.closePlayVideoFocus&&this.focus()}},{key:"onPause",value:function(){!this.isBufferControlPaused&&this.addClass(QC.PAUSED),this.updateAcc("pause"),this.config.closePauseVideoFocus||(this.userTimer&&(Ww.clearTimeout(this,this.userTimer),this.userTimer=null),this.focus())}},{key:"onEnded",value:function(){this.isBufferControlPaused=!1,this.updateAcc("ended"),this.addClass(QC.ENDED)}},{key:"onError",value:function(){this.isBufferControlPaused=!1,this.isError=!0,this.updateAcc("error"),this.removeClass(QC.NOT_ALLOW_AUTOPLAY),this.removeClass(QC.NO_START),this.removeClass(QC.ENTER),this.removeClass(QC.LOADING),this.addClass(QC.ERROR)}},{key:"onSeeking",value:function(){this.isSeeking||this.updateAcc("seeking"),this.isSeeking=!0,this.addClass(QC.SEEKING)}},{key:"onSeeked",value:function(){this.isSeeking=!1,this.waitTimer&&Ww.clearTimeout(this,this.waitTimer),this.removeClass(QC.LOADING),this.removeClass(QC.SEEKING)}},{key:"onWaiting",value:function(){var e=this;this.waitTimer&&Ww.clearTimeout(this,this.waitTimer),this.updateAcc("waiting"),this.waitTimer=Ww.setTimeout(this,(function(){e.addClass(QC.LOADING),Ww.clearTimeout(e,e.waitTimer),e.waitTimer=null}),200)}},{key:"onPlaying",value:function(){var e=this;this.isError=!1,[QC.NO_START,QC.PAUSED,QC.ENDED,QC.ERROR,QC.REPLAY,QC.LOADING].forEach((function(t){e.removeClass(t)}))}},{key:"onTimeupdate",value:function(){!this._videoHeight&&this.getVideoSize(),(this.waitTimer||this.hasClass(QC.LOADING))&&this.video.readyState>2&&(!this.isBufferControlPaused&&this.removeClass(QC.LOADING),Ww.clearTimeout(this,this.waitTimer),this.waitTimer=null),this.paused||this.isPlaying||!this.duration||(this.isPlaying=!0,this.emit(g_)),this._accPlayed.t||this.paused||this.ended||(this._accPlayed.t=(new Date).getTime())}},{key:"onVolumechange",value:function(){"Number"===Ww.typeOf(this.config.volume)&&(this.config.volume=this.volume)}},{key:"onRatechange",value:function(){this.config.defaultPlaybackRate=this.playbackRate}},{key:"onBufferControl",value:function(e){this.isPlaying&&("waiting"===e.type?(this.isBufferControlPaused=!0,this.addClass(QC.LOADING),this.removeClass(QC.PAUSED)):"playing"===e.type&&(this.isBufferControlPaused=!1,this.removeClass(QC.LOADING),this.paused&&this.addClass(QC.PAUSED)))}},{key:"emitUserAction",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.video&&t&&e){var i="String"===Ww.typeOf(e)?e:e.type||"";"switch_play_pause"===t&&("Undefined"===Ww.typeOf(n.paused)&&(n.paused=this.paused),n.isFirstStart=!this.playing),this.emit(B_,vx({eventType:i,action:t,currentTime:this.currentTime,duration:this.duration,ended:this.ended,event:e},n))}}},{key:"updateAcc",value:function(e){if(this._accPlayed.t){var t=(new Date).getTime(),n=t-this._accPlayed.t;if(n<0)return;this._accPlayed.acc+=n,this._accPlayed.t="get"===e?t:0,("ended"===e||this.ended)&&(this._accPlayed.loopAcc=this._accPlayed.acc)}}},{key:"checkBuffer",value:function(e){var t=this.video.buffered;if(!t||0===t.length||!this.duration)return!0;for(var n=parseInt(1e3*(e||this.video.currentTime||0),10),i=t.length,r=0;r<i;r++)if(parseInt(1e3*t.start(r),10)+200<=n&&parseInt(1e3*t.end(r),10)-200>n)return!0;return!1}},{key:"resizePosition",value:function(){var e=this.videoPos,t=e.rotate,n=e.vy,i=e.vx,r=e.h,o=e.w;if(!(t<0&&r<0&&o<0)){var a=this.videoPos._pi;if(!a&&this.video.videoHeight&&(a=this.video.videoWidth/this.video.videoHeight*100),a){this.videoPos.pi=a;var s={},c=0,u=0,l=1,f=t<0?0:Math.abs(t/90),h=this.root,d=this.innerContainer,p=h.offsetWidth,v=d?d.offsetHeight:h.offsetHeight,g=v,y=p,m={width:p,height:v};if(f%2==0)l=r>0?100/r:o>0?100/o:1,s.scale=l,c=n>0?(100-r)/2-n:0,s.y=2===f?0-c:c,u=i>0?(100-o)/2-i:0,s.x=2===f?0-u:u,m.width=y,m.height=g;else if(f%2==1){g=p;var k=v-p;u=-k/2/(y=v)*100,s.x=3===f?u+n/2:u-n/2,c=k/2/g*100,s.y=3===f?c+i/2:c-i/2,s.scale=l,m.width=y,m.height=g}var b=this.video;t>=0&&["width","height"].forEach((function(e){b.style[e]="".concat(m[e],"px")})),s.rotate=t<0?0:t;var w=Ww.getTransformStyle(s,this.video.style.transform||this.video.style.webkitTransform);b.style.transform=w,b.style.webkitTransform=w}}}},{key:"position",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{h:0,y:0,x:0,w:0};if(this.video&&e&&e.h){var t=this.videoPos;t.h=100*e.h||0,t.w=100*e.w||0,t.vx=100*e.x||0,t.vy=100*e.y||0,this.resizePosition()}}},{key:"setConfig",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{deepMerge:!1};e&&Object.keys(e).map((function(i){if("plugins"!==i){n.deepMerge&&"Object"===Ww.typeOf(t.config[i])?Ww.deepMerge(t.config[i],e[i]):t.config[i]=e[i];var r=t.plugins[i.toLowerCase()];r&&"Function"===Ww.typeOf(r.setConfig)&&r.setConfig(e[i],n)}}))}},{key:"playNext",value:function(e){var t=this;this.resetState(),this._currentTime=0,this._duration=0,this.isPlaying=!1,this.setConfig(e),this.vtype="MP4",CC(this,"playnext",(function(){t.start(),t.emit(M_,e)}))}},{key:"getVideoSize",value:function(){var e=this;if(this.video){var t=this.root.getBoundingClientRect();this.sizeInfo.width=t.width,this.sizeInfo.height=t.height,this.sizeInfo.left=t.left,this.sizeInfo.top=t.top;var n=this.video,i=n.videoWidth,r=n.videoHeight,o=this.config,a=o.fitVideoSize,s=o.videoFillMode;if("fill"!==s&&"cover"!==s&&"contain"!==s||this.setAttribute("data-xgfill",s),r&&i){this._videoHeight=r,this._videoWidth=i;var c=this.controls&&this.innerContainer?this.controls.root.getBoundingClientRect().height:0,u=t.width,l=t.height-c,f=parseInt(i/r*1e3,10),h=parseInt(u/l*1e3,10),d=u,p=l,v={};"auto"===a&&h>f||"fixWidth"===a?(p=u/f*1e3,this.config.fluid?v.paddingTop="".concat(100*p/d,"%"):v.height="".concat(p+c,"px")):("auto"===a&&h<f||"fixHeight"===a)&&(d=f*l/1e3,v.width="".concat(d,"px")),this.fullscreen||this.cssfullscreen||Object.keys(v).forEach((function(t){e.root.style[t]=v[t]})),("fillHeight"===s&&h<f||"fillWidth"===s&&h>f)&&this.setAttribute("data-xgfill","cover");var g={videoScale:f,vWidth:d,vHeight:p,cWidth:d,cHeight:p+c};this.resizePosition(),this.emit(I_,g)}}}},{key:"updateObjectPosition",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.video.updateObjectPosition?this.video.updateObjectPosition(e,t):this.video.style.objectPosition="".concat(100*e,"% ").concat(100*t,"%")}},{key:"preProcessUrl",value:function(e,t){var n=this.config,i=n.preProcessUrl,r=n.preProcessUrlOptions,o=Object.assign({},r,t);return Ww.isBlob(e)||"function"!=typeof i?{url:e}:i(e,o)}},{key:"src",get:function(){return this.video?this.video.src:""},set:function(e){this.video&&(this.emit(w_,e),this.emit(n_),this._currentTime=0,this._duration=0,Ww.isMSE(this.video)?this.onWaiting():(e=this.preProcessUrl(e).url,this._detachSourceEvents(this.video),"Array"===Ww.typeOf(e)?this._attachSourceEvents(this.video,e):e?this.video.src=e:this.video.removeAttribute("src"),this.load()))}},{key:"definitionList",get:function(){return this.config&&this.config.definition&&this.config.definition.list||[]},set:function(e){var t=this,n=this.config.definition;n.list=e,this.emit("resourceReady",e);var i=null,r=null;e.map((function(e){t.curDefinition===e.definition&&(i=e),n.defaultDefinition===e.definition&&(r=e)})),!r&&e.length>0&&(r=e[0]),i?this.changeDefinition(i):r&&this.changeDefinition(r)}},{key:"videoFrameInfo",get:function(){var e={total:0,dropped:0,corrupted:0,droppedRate:0,droppedDuration:0};if(!this.video||!this.video.getVideoPlaybackQuality)return e;var t=this.video.getVideoPlaybackQuality();return e.dropped=t.droppedVideoFrames||0,e.total=t.totalVideoFrames||0,e.corrupted=t.corruptedVideoFrames||0,e.total>0&&(e.droppedRate=e.dropped/e.total*100,e.droppedDuration=parseInt(this.cumulateTime/e.total*e.dropped,0)),e}},{key:"lang",get:function(){return this.config.lang},set:function(e){0!==ux.langKeys.filter((function(t){return t===e})).length||"zh"===e?(this.config.lang=e,ZC.setLang(e,this)):console.error("Sorry, set lang fail, because the language [".concat(e,"] is not supported now, list of all supported languages is [").concat(ux.langKeys.join(),"] "))}},{key:"i18n",get:function(){var e=this.config.lang;return"zh"===e&&(e="zh-cn"),this.__i18n.lang[e]||this.__i18n.lang.en}},{key:"i18nKeys",get:function(){return this.__i18n.textKeys||{}}},{key:"version",get:function(){return Ty}},{key:"playerId",get:function(){return this._pluginInfoId}},{key:"url",get:function(){return this.__url||this.config.url},set:function(e){this.__url=e}},{key:"poster",get:function(){return this.plugins.poster?this.plugins.poster.config.poster:this.config.poster},set:function(e){this.plugins.poster&&this.plugins.poster.update(e)}},{key:"readyState",get:function(){var e=uu(Vo(n.prototype),"readyState",this);return this.i18n[e]||e}},{key:"error",get:function(){var e=uu(Vo(n.prototype),"error",this);return this.i18n[e]||e}},{key:"networkState",get:function(){var e=uu(Vo(n.prototype),"networkState",this);return this.i18n[e]||e}},{key:"fullscreenChanging",get:function(){return!(null===this._fullScreenOffset)}},{key:"cumulateTime",get:function(){var e=this._accPlayed;return this.updateAcc("get"),e.acc}},{key:"zoom",get:function(){return this.config.zoom},set:function(e){this.config.zoom=e}},{key:"videoRotateDeg",get:function(){return this.videoPos.rotate},set:function(e){(e=Ww.convertDeg(e))%90==0&&e!==this.videoPos.rotate&&(this.videoPos.rotate=e,this.resizePosition())}},{key:"avgSpeed",get:function(){return kx},set:function(e){kx=e}},{key:"realTimeSpeed",get:function(){return mx},set:function(e){mx=e}},{key:"hook",value:function(e,t){return vC.call.apply(vC,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(e,t){return gC.call.apply(gC,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(e,t){return mC.call.apply(mC,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"usePluginHooks",value:function(e,t,n){for(var i=arguments.length,r=new Array(i>3?i-3:0),o=3;o<i;o++)r[o-3]=arguments[o];return kC.call.apply(kC,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removePluginHooks",value:function(e,t,n){for(var i=arguments.length,r=new Array(i>3?i-3:0),o=3;o<i;o++)r[o-3]=arguments[o];return bC.call.apply(bC,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"setUserActive",value:function(e,t){var n;"boolean"==typeof t&&t!==this.muted&&(this.addInnerOP("volumechange"),this.muted=t),null===(n=bx)||void 0===n||n.setActive(this.playerId,e)}}],[{key:"debugger",get:function(){return Hw.config.debug},set:function(e){Hw.config.debug=e}},{key:"instManager",get:function(){return bx},set:function(e){bx=e}},{key:"pluginsManager",get:function(){return ZC}},{key:"getCurrentUserActivePlayerId",value:function(){var e;return null===(e=bx)||void 0===e?void 0:e.getActiveId()}},{key:"setCurrentUserActive",value:function(e,t){var n;null===(n=bx)||void 0===n||n.setActive(e,t)}},{key:"isHevcSupported",value:function(){return $_.isHevcSupported()}},{key:"probeConfigSupported",value:function(e){return $_.probeConfigSupported(e)}},{key:"install",value:function(e,t){n.plugins||(n.plugins={}),n.plugins[e]||(n.plugins[e]=t)}},{key:"use",value:function(e,t){n.plugins||(n.plugins={}),n.plugins[e]=t}}]),n}(eC);function _x(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Cx(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_x(Object(n),!0).forEach((function(t){Go(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_x(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function xx(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}function Sx(){return(new Date).getTime()}Go(wx,"defaultPreset",null),Go(wx,"XgVideoProxy",null),wx.instManager=dx.getInstance();var Tx="loadstart",Ex="loadeddata",Px="firstFrame",Rx="waitingStart",Ox="waitingEnd",Ix="seekStart",Lx="seekEnd",Ax="waitingEndExt",Dx="seekEndEndExt",Mx="[xgLogger]",Nx=function(e){Ho(n,e);var t=xx(n);function n(){var e;Bo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Uo(e=t.call.apply(t,[this].concat(r))),"_onLoadedMetaData",(function(){var t=e._state,n=t.isLs,i=t.autoplayStart,r=t.isFFSend,o=t.isLoadStartDelay;Hw.logInfo(Mx,"LOAD_START Delay","autoplayStart:".concat(i," isFFSend:").concat(r," startCostTime:").concat(e.startCostTime," newPointTime:").concat(e.newPointTime,", vtype:").concat(e.player.vtype)),e.playerConfig.loadStartDelay&&n&&!o&&"MP4_MSE"===e.player.vtype&&(e._state.isLoadStartDelay=!0,e.emitLog(Tx,{}))})),Go(Uo(e),"_onLoadStart",(function(){var t=Uo(e)._state,n=t.autoplayStart,i=t.isFFSend;e.startCostTime=Sx()-e.newPointTime,Hw.logInfo(Mx,"LOAD_START","autoplayStart:".concat(n," isFFSend:").concat(i," startCostTime:").concat(e.startCostTime," newPointTime:").concat(e.newPointTime,", vtype:").concat(e.player.vtype)),i||(t.isLs||e.playerConfig.loadStartDelay&&"MP4_MSE"===e.player.vtype||(t.isLoadStartDelay=!0,e.emitLog(Tx,{})),t.isLs=!0,t.isTimeUpdate=!1,t.isFFLoading=!0,e.pt=Sx(),e.vt=0,e.fvt=0,e._initOnceEvents())})),Go(Uo(e),"_onLoadedData",(function(){e.vt=Sx(),e.fvt=e.vt-e.pt,e.loadedCostTime=e.vt-e.newPointTime,e._updateBuffer();var t=e._state,n=t.isTimeUpdate,i=t.isFFSend,r=t.autoplayStart;Hw.logInfo(Mx,"LOADED_DATA","fvt:".concat(e.fvt," isTimeUpdate:").concat(e._state.isTimeUpdate," loadedCostTime:").concat(e.loadedCostTime)),(n||r)&&e._sendFF("loadedData"),i||e.emitLog(Ex,{})})),Go(Uo(e),"_onTimeupdate",(function(){var t=Uo(e)._state;t.isTimeUpdate=!0,t.time=e.player.currentTime,e._state.autoplayStart&&!t.isFFSend&&e._sendFF("onTimeupdate")})),Go(Uo(e),"_onPlay",(function(){var t=e.player.buffered,n=Uo(e).levelInfo;Hw.logInfo(Mx,"_onPlay playPos:".concat(n.startBuffer)),n.startBuffer<0&&(n.startBuffer=t.length>0?parseInt(1e3*t.end(0),10):0,n.startType="onplay")})),Go(Uo(e),"_onAutoplayStart",(function(){Hw.logInfo(Mx,"_onAutoplayStart"),e._state.autoplayStart=!0,e.vt&&e._sendFF("onAutoplayStart")})),Go(Uo(e),"_onReset",(function(){e._state={time:0,autoplayStart:!1,isFFLoading:!1,isTimeUpdate:!1,isFFSend:!1,isLs:!1,isLoadStartDelay:!1},e.vt=0,e.pt=0,e.fvt=0,e.newPointTime=Sx(),e.loadedCostTime=0,e.startCostTime=0,e.seekingStart=0,e.seekData={startTime:0,lastTime:0,timeBefore:0,timeAfter:0,inBuffer:0,diffStart:0,interval:-1},e.waitData={startTime:0,lastTime:0,interval:-1,diffStart:0},e.waitingStart=0,e.fixedWaitingStart=0,e.ffsendTime=0,e.levelInfo={diff:0,buffer:-1,startBuffer:-1,startType:""},e._isWaiting=!1,e._waitTimer&&Ww.clearTimeout(Uo(e),e._waitTimer),e._waittTimer&&Ww.clearTimeout(Uo(e),e._waittTimer),e._waitTimer=null,e._waittTimer=null,e._waitType=0})),Go(Uo(e),"_onSeeking",(function(){var t=Uo(e),n=t.seekData,i=t._state;if(!n.startTime){var r=e.player,o=r.buffered,a=r.currentTime;n.startTime=Sx(),n.timeBefore=i.time,n.timeAfter=a;var s=Ww.getBufferByCurrentTime(o,a);Hw.logInfo(Mx,"onSeeking",a,s),n.inBuffer=s.include,n.diffStart=1e3*s.diff,n.lastTime>0?n.interval=n.startTime-n.lastTime:n.interval=-1,Hw.logInfo(Mx,"onSeeking",n),e.suspendWaitingStatus("seek");var c=e._getSeekInfo();e.emitLog(Ix,Cx({start:Sx()},c))}})),Go(Uo(e),"_onSeeked",(function(){Hw.logInfo(Mx,"onSeeked"),e.suspendSeekingStatus("seeked")})),Go(Uo(e),"_onWaitingLoadStart",(function(){e._isWaiting||e.vt||(e._isWaiting=!0,e.waitingStart=Sx(),e.fixedWaitingStart=Sx(),e._waitType=1,e.emitLog(Rx,{fixedStart:e.fixedWaitingStart,start:e.waitingStart,type:1,endType:"loadstart"}))})),Go(Uo(e),"_onWaiting",(function(){if(!e._isWaiting&&e.vt){e._isWaiting=!0;var t=Uo(e),n=t.waitData,i=t.seekData;t._state.isTimeUpdate||0!==i.startTime?i.startTime?e._waitType=2:e._waitType=0:e._waitType=1,e.fixedWaitingStart=Sx(),Hw.logInfo(Mx,"_onWaiting"),n.lastTime>0?n.interval=e.fixedWaitingStart-n.lastTime:n.interval=-1;var r=e.player,o=r.buffered,a=r.currentTime,s=Ww.getBufferByCurrentTime(o,a);n.diffStart=1e3*s.diff,e._waitTimer=Ww.setTimeout(Uo(e),(function(){Hw.logInfo(Mx,"_onWaiting real");var t=Uo(e).waitData;e._isWaiting?(e.waitingStart=Sx(),Ww.clearTimeout(Uo(e),e._waitTimer),t.lastTime=e.fixedWaitingStart,e._waitTimer=null,e._startWaitTimeout(),e.emitLog(Rx,{fixedStart:e.fixedWaitingStart,start:e.waitingStart,type:e._waitType,endType:2===e._waitType?"seek":"playing",diffStart:t.diffStart,interval:t.interval})):(t.interval=-1,t.diffStart=0)}),200)}})),Go(Uo(e),"_onError",(function(){e.suspendSeekingStatus("error"),e.suspendWaitingStatus("error")})),Go(Uo(e),"_onWaitingTimeout",(function(t){e.suspendWaitingStatus(t||"timeout"),Ww.clearTimeout(Uo(e),e._waittTimer),e._waittTimer=null})),Go(Uo(e),"_onProgress",(function(){Hw.logInfo(Mx,"_onProgress")})),Go(Uo(e),"_onPlaying",(function(){Hw.logInfo(Mx,"_onPlaying"),e._isWaiting&&e.suspendWaitingStatus("playing")})),e}return Fo(n,[{key:"afterCreate",value:function(){var e=this;this._onReset(),this._waitType=-1,this._initOnceEvents(),this.newPointTime=Sx(),this.loadedCostTime=0,this.startCostTime=0,this.ffsendTime=0,this.on(s_,this._onLoadedMetaData),this.on(l_,this._onLoadStart),this.on(a_,this._onLoadedData),this.on(Qw,this._onSeeking),this.on(e_,this._onSeeked),this.on(b_,(function(){e.endState("destroy")})),this.on($w,(function(){e.endState("ended")})),this.on(Jw,(function(){e.endState("pause")})),this.on(qw,this._onPlay),this.on(w_,(function(){e.endState("urlChange"),Hw.logInfo(Mx,"URL_CHANGE"),e._state.isFFSend&&e._onReset()})),this.on([Xw,i_],this._onPlaying),this.on(n_,this._onWaiting),this.on(Zw,this._onError),this.on(j_,(function(){Hw.logInfo(Mx,"RESET"),e.endState("reset"),e._initOnceEvents(),e._onReset();var t=e.levelInfo;e.playerConfig.autoplay&&(t.startType="onreset",t.startBuffer=0)}))}},{key:"_initOnceEvents",value:function(){this.off(g_,this._onAutoplayStart),this.off(t_,this._onTimeupdate),this.once(g_,this._onAutoplayStart),this.on(t_,this._onTimeupdate)}},{key:"_sendFF",value:function(e){var t=this._state,n=t.isFFLoading,i=t.isFFSend;if(Hw.logInfo(Mx,"_sendFF","".concat(e," fvt:").concat(this.fvt," isFFLoading:").concat(n," !isFFSend:").concat(!i)),this.vt>0&&n&&!i){var r;this.ffsendTime=Sx();var o=this.levelInfo,a=o.buffer,s=o.startBuffer,c=o.startType;Hw.logInfo(Mx,"emitLog_firstFrame",e,"startBuffer:".concat(s," startType:").concat(c," buffer:").concat(a," ")),this._state.isFFLoading=!1,this._state.isFFSend=!0;var u=this.fvt+((null===(r=this.player)||void 0===r?void 0:r.beforeLoadStartCostTime)||0);this.emitLog(Px,{fvt:this.fvt,costTime:u,vt:this.vt,startCostTime:this.startCostTime,loadedCostTime:this.loadedCostTime,buffer:a,startBuffer:s,endType:e})}}},{key:"_updateBuffer",value:function(){var e=this.player,t=e.buffered,n=e.currentTime,i=Ww.getBufferByCurrentTime(t,n);Hw.logInfo(Mx,"_updateBuffer",i);var r=this.levelInfo;r.buffer=1e3*i.end,r.diff=1e3*i.diff}},{key:"_getSeekInfo",value:function(){var e=this.seekData;return{interval:e.interval,timeBefore:e.timeBefore,timeAfter:e.timeAfter,inBuffer:e.inBuffer,diffStart:e.diffStart}}},{key:"_startWaitTimeout",value:function(){this._waittTimer&&Ww.clearTimeout(this,this._waittTimer),this._waittTimer=Ww.setTimeout(this,this._onWaitingTimeout,this.config.waitTimeout)}},{key:"endState",value:function(e){var t=this.player,n=t.currentTime,i=t.duration,r=i-n,o=!(i>0&&n>0&&r<1);Hw.logInfo(Mx,"endState:".concat(e," duration - currentTime:").concat(r," _emit:").concat(o)),this.suspendWaitingStatus(e,o),this.suspendSeekingStatus(e,o)}},{key:"suspendSeekingStatus",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.seekData;if(n.startTime){var i=Sx(),r=i-n.startTime,o=this.player,a=o.buffered,s=o.currentTime,c=Ww.getBufferByCurrentTime(a,s);Hw.logInfo(Mx,"suspendSeekingStatus",s,r),n.lastTime=n.startTime,n.startTime=0;var u=t?Lx:Dx,l=this._getSeekInfo();this.emitLog(u,Cx(Cx({end:i,costTime:r,endType:e},l),{},{diffEnd:1e3*c.diff}))}}},{key:"suspendWaitingStatus",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this._waitTimer&&(Ww.clearTimeout(this,this._waitTimer),this._waitTimer=null),this._waittTimer&&(Ww.clearTimeout(this,this._waittTimer),this._waittTimer=null),this._isWaiting=!1,this.waitingStart){var n=this.waitData,i=Sx(),r=i-this.waitingStart,o=i-this.fixedWaitingStart,a=this.config.waitTimeout;this._isWaiting=!1,this.waitingStart=0,this.fixedWaitingStart=0;var s=this.player,c=s.buffered,u=s.currentTime,l=Ww.getBufferByCurrentTime(c,u),f=t?Ox:Ax;this.emitLog(f,{fixedCostTime:o>a?a:o,costTime:r>a?a:r,type:"loadeddata"===e?1:this._waitType,endType:2===this._waitType?"seek":e,diffStart:n.diffStart,diffEnd:1e3*l.diff,interval:n.interval})}}},{key:"emitLog",value:function(e,t){var n=this.player,i=n.video,r=i.readyState,o=i.networkState;this.emit(F_,Cx({t:Sx(),host:Ww.getHostFromUrl(n.currentSrc),vtype:n.vtype,eventType:e,currentTime:n.currentTime,readyState:r,networkState:o},t))}}],[{key:"pluginName",get:function(){return"xgLogger"}},{key:"defaultConfig",get:function(){return{waitTimeout:1e4}}}]),n}(HC);function Fx(){return(new DOMParser).parseFromString('<svg class="xgplayer-replay-svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 78 78" width="78" height="78">\n <path fill="#fff" transform="translate(20, 20)" d="M8.22708362,13.8757234 L11.2677371,12.6472196 C11.7798067,12.4403301 12.3626381,12.6877273 12.5695276,13.1997969 L12.9441342,14.1269807 C13.1510237,14.6390502 12.9036264,15.2218816 12.3915569,15.4287712 L6.8284538,17.6764107 L5.90126995,18.0510173 C5.38920044,18.2579068 4.80636901,18.0105096 4.5994795,17.49844 L1.97723335,11.0081531 C1.77034384,10.4960836 2.0177411,9.91325213 2.52981061,9.70636262 L3.45699446,9.33175602 C3.96906396,9.12486652 4.5518954,9.37226378 4.75878491,9.88433329 L5.67885163,12.1615783 C7.99551726,6.6766934 13.3983951,3 19.5,3 C27.7842712,3 34.5,9.71572875 34.5,18 C34.5,26.2842712 27.7842712,33 19.5,33 C15.4573596,33 11.6658607,31.3912946 8.87004692,28.5831991 C8.28554571,27.9961303 8.28762719,27.0463851 8.87469603,26.4618839 C9.46176488,25.8773827 10.4115101,25.8794641 10.9960113,26.466533 C13.2344327,28.7147875 16.263503,30 19.5,30 C26.127417,30 31.5,24.627417 31.5,18 C31.5,11.372583 26.127417,6 19.5,6 C14.4183772,6 9.94214483,9.18783811 8.22708362,13.8757234 Z"></path>\n</svg>\n',"image/svg+xml").firstChild}function Bx(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var jx=function(e){Ho(n,e);var t=Bx(n);function n(){return Bo(this,n),t.apply(this,arguments)}return Fo(n,[{key:"registerIcons",value:function(){return{replay:Fx}}},{key:"afterCreate",value:function(){var e=this;HC.insert(this.icons.replay,this.root,0),this.__handleReplay=this.hook("replayHandler",(function(){e.player.replay()}),{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.bind(".xgplayer-replay",["click","touchend"],this.__handleReplay),this.on($w,(function(){if(e.playerConfig.loop||Ww.addClass(e.player.root,"replay"),!e.config.disable){e.show();var t=e.root.querySelector("path");if(t){var n=window.getComputedStyle(t).getPropertyValue("transform");if("string"==typeof n&&n.indexOf("none")>-1)return null;t.setAttribute("transform",n)}}})),this.on(qw,(function(){e.hide()}))}},{key:"handleReplay",value:function(e){e.preventDefault(),e.stopPropagation(),this.player.replay(),Ww.removeClass(this.player.root,"replay")}},{key:"show",value:function(){this.config.disable||(this.root.style.display="flex")}},{key:"enable",value:function(){this.config.disable=!1}},{key:"disable",value:function(){this.config.disable=!0,this.hide()}},{key:"destroy",value:function(){this.unbind(".xgplayer-replay",["click","touchend"],this.__handleReplay)}},{key:"render",value:function(){return'<xg-replay class="xgplayer-replay">\n <xg-replay-txt class="xgplayer-replay-txt" lang-key="'.concat(this.i18nKeys.REPLAY,'">').concat(this.i18n.REPLAY,"</xg-replay-txt>\n </xg-replay>")}}],[{key:"pluginName",get:function(){return"replay"}},{key:"defaultConfig",get:function(){return{disable:!1}}}]),n}(HC),Hx=jx;function Ux(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var Wx=function(e){Ho(n,e);var t=Ux(n);function n(){return Bo(this,n),t.apply(this,arguments)}return Fo(n,[{key:"isEndedShow",get:function(){return this.config.isEndedShow},set:function(e){this.config.isEndedShow=e}},{key:"hide",value:function(){Ww.addClass(this.root,"hide")}},{key:"show",value:function(){Ww.removeClass(this.root,"hide")}},{key:"beforeCreate",value:function(e){"string"==typeof e.player.config.poster&&(e.config.poster=e.player.config.poster)}},{key:"afterCreate",value:function(){var e=this;this.on($w,(function(){e.isEndedShow&&Ww.removeClass(e.root,"hide")})),this.config.hideCanplay?(this.once(t_,(function(){e.onTimeUpdate()})),this.on(w_,(function(){Ww.removeClass(e.root,"hide"),Ww.addClass(e.root,"xg-showplay"),e.once(t_,(function(){e.onTimeUpdate()}))}))):this.on(qw,(function(){Ww.addClass(e.root,"hide")}))}},{key:"onTimeUpdate",value:function(){var e=this;this.player.currentTime?Ww.removeClass(this.root,"xg-showplay"):this.once(t_,(function(){e.onTimeUpdate()}))}},{key:"update",value:function(e){e&&(this.config.poster=e,this.root.style.backgroundImage="url(".concat(e,")"))}},{key:"render",value:function(){var e=this.config,t=e.poster,n=e.hideCanplay,i=t?"background-image:url(".concat(t,");"):"";return'<xg-poster class="xgplayer-poster '.concat(n?"xg-showplay":"",'" style="').concat(i,'">\n </xg-poster>')}}],[{key:"pluginName",get:function(){return"poster"}},{key:"defaultConfig",get:function(){return{isEndedShow:!0,hideCanplay:!1,poster:""}}}]),n}(HC),Vx=Wx;function Gx(){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 Kx(){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 zx(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var Yx={};var qx=function(e){Ho(n,e);var t=zx(n);function n(e){var i;return Bo(this,n),Go(Uo(i=t.call(this,e)),"onPlayerReset",(function(){i.autoPlayStart=!1;var e="auto"===i.config.mode?"auto-hide":"hide";i.setAttr("data-state","play"),Ww.removeClass(i.root,e),i.show()})),Go(Uo(i),"onAutoplayStart",(function(){if(!i.autoPlayStart){var e="auto"===i.config.mode?"auto-hide":"hide";Ww.addClass(i.root,e),i.autoPlayStart=!0,i.onPlayPause("play")}})),i.autoPlayStart=!1,i._lastState="",i}return Fo(n,[{key:"afterCreate",value:function(){var e=this,t=this.player,n=this.playerConfig;this.initIcons(),this.once(p_,(function(){n&&(n.lang&&"en"===n.lang?Ww.addClass(t.root,"lang-is-en"):"jp"===n.lang&&Ww.addClass(t.root,"lang-is-jp"))})),this.on(g_,this.onAutoplayStart),n.autoplay||this.show(),this.on(y_,(function(){var t="auto"===e.config.mode?"auto-hide":"hide";e.setAttr("data-state","play"),Ww.removeClass(e.root,t),e.show()})),this.on(qw,(function(){e.onPlayPause("play")})),this.on(Jw,(function(){e.onPlayPause("pause")})),this.on(C_,(function(){e.onPlayPause(t.paused?"pause":"play")})),this.on(j_,(function(){e.onPlayerReset()})),this.clickHandler=this.hook("click",this.switchPausePlay,{pre:function(t){t.cancelable&&t.preventDefault(),t.stopPropagation(),e.emitUserAction(t,"switch_play_pause")}}),this.bind(["click","touchend"],this.clickHandler)}},{key:"registerIcons",value:function(){return{startPlay:{icon:Gx,class:"xg-icon-play"},startPause:{icon:Kx,class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild("xg-start-inner",e.startPlay),this.appendChild("xg-start-inner",e.startPause)}},{key:"hide",value:function(){Ww.addClass(this.root,"hide")}},{key:"show",value:function(){Ww.removeClass(this.root,"hide")}},{key:"focusHide",value:function(){Ww.addClass(this.root,"focus-hide")}},{key:"recover",value:function(){Ww.removeClass(this.root,"focus-hide")}},{key:"switchStatus",value:function(e){e?this.setAttr("data-state",this.player.paused?"pause":"play"):this.setAttr("data-state",this.player.paused?"play":"pause")}},{key:"animate",value:function(e){var t=this;!function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{start:null,end:null};Yx[e]&&window.clearTimeout(Yx[e].id),Yx[e]={},n.start&&n.start(),Yx[e].id=window.setTimeout((function(){n.end&&n.end(),window.clearTimeout(Yx[e].id),delete Yx[e]}),t)}("pauseplay",400,{start:function(){Ww.addClass(t.root,"interact"),t.show(),t.switchStatus(!0)},end:function(){Ww.removeClass(t.root,"interact"),!e&&t.hide()}})}},{key:"switchPausePlay",value:function(e){var t=this.player;(e.cancelable&&e.preventDefault(),e.stopPropagation(),t.isReady)&&(!this.player.paused&&t.isPlaying?t.pause():t.play())}},{key:"onPlayPause",value:function(e){var t=this.config,n=this.player;if(n.isPlaying&&this.autoPlayStart&&("pause"!==e||this._lastState!==e&&!n.isBufferControlPaused)){if(this._lastState=e,"show"===t.mode)return this.switchStatus(),void this.show();if("auto"!==t.mode){if(t.isShowPause&&n.paused&&!n.ended||t.isShowEnd&&n.ended)return this.switchStatus(),void this.show();if(t.disableAnimate)return this.switchStatus(),void this.hide();if("play"===e)this.autoPlayStart?this.animate():this.hide();else{if(!this.autoPlayStart||n.ended)return;this.animate()}}else this.switchStatus()}}},{key:"destroy",value:function(){this.unbind(["click","touchend"],this.clickHandler),Object.keys(Yx).map((function(e){window.clearTimeout(Yx[e].id),delete Yx[e]}))}},{key:"render",value:function(){var e=this.playerConfig.autoplay?"auto"===this.config.mode?"auto-hide":"hide":"";return'\n <xg-start class="xgplayer-start '.concat(e,'">\n <xg-start-inner></xg-start-inner>\n </xg-start>')}}],[{key:"pluginName",get:function(){return"start"}},{key:"defaultConfig",get:function(){return{isShowPause:!1,isShowEnd:!1,disableAnimate:!1,mode:"hide"}}}]),n}(HC),Xx=qx;function $x(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var Jx=function(e){Ho(n,e);var t=$x(n);function n(){return Bo(this,n),t.apply(this,arguments)}return Fo(n,[{key:"render",value:function(){var e=this.config.innerHtml,t=Ww.createDom("xg-enter","",{},"xgplayer-enter");if(e&&e instanceof window.HTMLElement)t.appendChild(e);else if(e&&"string"==typeof e)t.innerHTML=e;else{for(var n="",i=1;i<=12;i++)n+='<div class="xgplayer-enter-bar'.concat(i,'"></div>');t.innerHTML='<div class="xgplayer-enter-spinner">'.concat(n,"</div>")}return t}}],[{key:"pluginName",get:function(){return"enter"}},{key:"defaultConfig",get:function(){return{innerHtml:"",logo:""}}}]),n}(HC),Zx=Jx;function Qx(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var eS=function(e){Ho(n,e);var t=Qx(n);function n(){return Bo(this,n),t.apply(this,arguments)}return Fo(n,[{key:"afterCreate",value:function(){this.getMini=this.getMini.bind(this),this.exitMini=this.exitMini.bind(this),this.bind("click",this.getMini)}},{key:"getMini",value:function(){this.config.onClick&&this.config.onClick()}},{key:"exitMini",value:function(){this.config.onClick&&this.config.onClick()}},{key:"destroy",value:function(){this.unbind(["click","touchend"],this.getMini)}},{key:"render",value:function(){var e="MINISCREEN";return'\n <xg-icon class="xgplayer-miniicon">\n <div class="xgplayer-icon btn-text"><span class="icon-text" lang-key="'.concat(this.i18nKeys[e],'">').concat(this.i18n[e],"</span></div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"miniscreenIcon"}},{key:"defaultConfig",get:function(){return{position:MC.CONTROLS_RIGHT,index:10}}}]),n}(HC),tS=eS;function nS(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}function iS(e){var t=parseFloat(e);return-1===e.indexOf("%")&&!Number.isNaN(t)&&t}var rS=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],oS=rS.length;function aS(e){if("string"==typeof e&&(e=document.querySelector(e)),e&&"object"===Do(e)&&e.nodeType){var t=function(e){return window.getComputedStyle(e)}(e);if("none"===t.display)return function(){for(var e={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},t=0;t<oS;t++)e[rS[t]]=0;return e}();var n={};n.width=e.offsetWidth,n.height=e.offsetHeight;for(var i=n.isBorderBox="border-box"===t.boxSizing,r=0;r<oS;r++){var o=rS[r],a=t[o],s=parseFloat(a);n[o]=Number.isNaN(s)?0:s}var c=n.paddingLeft+n.paddingRight,u=n.paddingTop+n.paddingBottom,l=n.marginLeft+n.marginRight,f=n.marginTop+n.marginBottom,h=n.borderLeftWidth+n.borderRightWidth,d=n.borderTopWidth+n.borderBottomWidth,p=i,v=iS(t.width);!1!==v&&(n.width=v+(p?0:c+h));var g=iS(t.height);return!1!==g&&(n.height=g+(p?0:u+d)),n.innerWidth=n.width-(c+h),n.innerHeight=n.height-(u+d),n.outerWidth=n.width+l,n.outerHeight=n.height+f,n}}function sS(e,t){for(var n=0;n<e.length;n++){var i=e[n];if(i.identifier===t)return i}}var cS="dragStart",uS="dragMove",lS="dragEnded",fS={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]},hS=function(e){Ho(n,e);var t=nS(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Bo(this,n),(i=t.call(this)).isEnabled=!0,i.isDragging=!1,i.isDown=!1,i.position={},i.downPoint={},i.dragPoint={x:0,y:0},i.startPos={x:0,y:0},i._root=e instanceof Element?e:document.querySelector(e),i._handlerDom=r.handle instanceof Element?r.handle:document.querySelector(r.handle),i._root&&i._handlerDom?(i._bindStartEvent(),i):Wo(i)}return Fo(n,[{key:"_bindStartEvent",value:function(){var e=this;"ontouchstart"in window?this._startKey="touchstart":this._startKey="mousedown",this["on".concat(this._startKey)]=this["on".concat(this._startKey)].bind(this),this._handlerDom.addEventListener(this._startKey,this["on".concat(this._startKey)]),fS[this._startKey].map((function(t){e["on".concat(t)]=e["on".concat(t)].bind(e)}))}},{key:"_unbindStartEvent",value:function(){this._handlerDom.removeEventListener(this._startKey,this["on".concat(this._startKey)])}},{key:"_bindPostStartEvents",value:function(e){var t=this;if(e){var n=fS[this._startKey];n.map((function(e){window.addEventListener(e,t["on".concat(e)])})),this._boundPointerEvents=n}}},{key:"_unbindPostStartEvents",value:function(){var e=this;this._boundPointerEvents&&(this._boundPointerEvents.map((function(t){window.removeEventListener(t,e["on".concat(t)])})),delete this._boundPointerEvents)}},{key:"enable",value:function(){this.isEnabled=!0}},{key:"disable",value:function(){this.isEnabled=!1,this.isDragging&&this.onUp()}},{key:"onDocUp",value:function(e){this.onUp()}},{key:"animate",value:function(){var e=this;this.isDragging&&(this.positionDrag(),window.requestAnimationFrame((function(){e.animate()})))}},{key:"positionDrag",value:function(){var e="translate3d(".concat(this.dragPoint.x,"px, ").concat(this.dragPoint.y,"px, 0)");this._root.style.transform=e,this._root.style.webKitTransform=e}},{key:"setLeftTop",value:function(){this._root.style.left=this.position.x+"px",this._root.style.top=this.position.y+"px"}},{key:"onmousedown",value:function(e){this.dragStart(e,e)}},{key:"onmousemove",value:function(e){this.dragMove(e,e)}},{key:"onmouseup",value:function(e){this.dragEnd(e,e)}},{key:"ontouchstart",value:function(e){var t=e.changedTouches[0];this.dragStart(e,t),this.touchIdentifier=void 0!==t.pointerId?t.pointerId:t.identifier,e.preventDefault()}},{key:"ontouchmove",value:function(e){var t=sS(e.changedTouches,this.touchIdentifier);t&&this.dragMove(e,t)}},{key:"ontouchend",value:function(e){var t=sS(e.changedTouches,this.touchIdentifier);t&&this.dragEnd(e,t),e.preventDefault()}},{key:"ontouchcancel",value:function(e){var t=sS(e.changedTouches,this.touchIdentifier);t&&this.dragCancel(e,t)}},{key:"dragStart",value:function(e,t){if(this._root&&!this.isDown&&this.isEnabled){this.downPoint=t,this.dragPoint.x=0,this.dragPoint.y=0,this._getPosition();var n=aS(this._root);this.startPos.x=this.position.x,this.startPos.y=this.position.y,this.startPos.maxY=window.innerHeight-n.height,this.startPos.maxX=window.innerWidth-n.width,this.setLeftTop(),this.isDown=!0,this._bindPostStartEvents(e)}}},{key:"dragRealStart",value:function(e,t){this.isDragging=!0,this.animate(),this.emit(cS,this.startPos)}},{key:"dragEnd",value:function(e,t){this._root&&(this._unbindPostStartEvents(),this.isDragging&&(this._root.style.transform="",this.setLeftTop(),this.emit(lS)),this.presetInfo())}},{key:"_dragPointerMove",value:function(e,t){var n={x:t.pageX-this.downPoint.pageX,y:t.pageY-this.downPoint.pageY};return!this.isDragging&&this.hasDragStarted(n)&&this.dragRealStart(e,t),n}},{key:"dragMove",value:function(e,t){if(e=e||window.event,this.isDown){var n=this.startPos,i=n.x,r=n.y,o=this._dragPointerMove(e,t),a=o.x,s=o.y;a=this.checkContain("x",a,i),s=this.checkContain("y",s,r),this.position.x=i+a,this.position.y=r+s,this.dragPoint.x=a,this.dragPoint.y=s,this.emit(uS,this.position)}}},{key:"dragCancel",value:function(e,t){this.dragEnd(e,t)}},{key:"presetInfo",value:function(){this.isDragging=!1,this.startPos={x:0,y:0},this.dragPoint={x:0,y:0},this.isDown=!1}},{key:"destroy",value:function(){this._unbindStartEvent(),this._unbindPostStartEvents(),this.isDragging&&this.dragEnd(),this.removeAllListeners(),this._handlerDom=null}},{key:"hasDragStarted",value:function(e){return Math.abs(e.x)>3||Math.abs(e.y)>3}},{key:"checkContain",value:function(e,t,n){return t+n<0?0-n:"x"===e&&t+n>this.startPos.maxX?this.startPos.maxX-n:"y"===e&&t+n>this.startPos.maxY?this.startPos.maxY-n:t}},{key:"_getPosition",value:function(){var e=window.getComputedStyle(this._root),t=this._getPositionCoord(e.left,"width"),n=this._getPositionCoord(e.top,"height");this.position.x=Number.isNaN(t)?0:t,this.position.y=Number.isNaN(n)?0:n,this._addTransformPosition(e)}},{key:"_addTransformPosition",value:function(e){var t=e.transform;if(0===t.indexOf("matrix")){var n=t.split(","),i=0===t.indexOf("matrix3d")?12:4,r=parseInt(n[i],10),o=parseInt(n[i+1],10);this.position.x+=r,this.position.y+=o}}},{key:"_getPositionCoord",value:function(e,t){if(-1!==e.indexOf("%")){var n=aS(this._root.parentNode);return n?parseFloat(e)/100*n[t]:0}return parseInt(e,10)}}]),n}(Sy);function dS(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var pS=function(e){Ho(n,e);var t=dS(n);function n(e){var i;Bo(this,n),Go(Uo(i=t.call(this,e)),"onCancelClick",(function(e){i.exitMini(),i.isClose=!0})),Go(Uo(i),"onCenterClick",(function(e){var t=Uo(i).player;t.paused?t.play():t.pause()})),Go(Uo(i),"onScroll",(function(e){if(!(!window.scrollY&&0!==window.scrollY||Math.abs(window.scrollY-i.pos.scrollY)<50)){var t=parseInt(Ww.getCss(i.player.root,"height"));t+=i.config.scrollTop,i.pos.scrollY=window.scrollY,window.scrollY>t+5?!i.isMini&&!i.isClose&&i.getMini():window.scrollY<=t&&(i.isMini&&i.exitMini(),i.isClose=!1)}})),i.isMini=!1,i.isClose=!1;var r=Uo(i).config;return i.pos={left:r.left<0?window.innerWidth-r.width-20:r.left,top:r.top<0?window.innerHeight-r.height-20:r.top,height:i.config.height,width:i.config.width,scrollY:window.scrollY||0},i.lastStyle=null,i}return Fo(n,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.mini&&(e.config.isShowIcon=e.player.config.mini)}},{key:"afterCreate",value:function(){var e=this;this.initIcons(),this.on(Jw,(function(){e.setAttr("data-state","pause")})),this.on(qw,(function(){e.setAttr("data-state","play")}))}},{key:"onPluginsReady",value:function(){var e=this,t=this.player;if(!this.config.disable){if(this.config.isShowIcon){var n={config:{onClick:function(){e.getMini()}}};t.controls.registerPlugin(tS,n,tS.pluginName)}var i=Ww.checkTouchSupport()?"touchend":"click";this.bind(".mini-cancel-btn",i,this.onCancelClick),this.bind(".play-icon",i,this.onCenterClick),this.config.disableDrag||(this._draggabilly=new hS(this.player.root,{handle:this.root})),this.config.isScrollSwitch&&window.addEventListener("scroll",this.onScroll)}}},{key:"registerIcons",value:function(){return{play:{icon:Gx,class:"xg-icon-play"},pause:{icon:Kx,class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".play-icon",e.play),this.appendChild(".play-icon",e.pause)}},{key:"getMini",value:function(){var e=this;if(!this.isMini){var t=this.player,n=this.playerConfig,i=this.config.target||this.player.root;this.lastStyle={},Ww.addClass(t.root,"xgplayer-mini"),["width","height","top","left"].map((function(t){e.lastStyle[t]=i.style[t],i.style[t]="".concat(e.pos[t],"px")})),n.fluid&&(i.style["padding-top"]=""),this.emit(P_,!0),t.isMini=this.isMini=!0}}},{key:"exitMini",value:function(){var e=this;if(!this.isMini)return!1;var t=this.player,n=this.playerConfig,i=this.config.target||this.player.root;Ww.removeClass(t.root,"xgplayer-mini"),this.lastStyle&&Object.keys(this.lastStyle).map((function(t){i.style[t]=e.lastStyle[t]})),this.lastStyle=null,n.fluid&&(t.root.style.width="100%",t.root.style.height="0",t.root.style["padding-top"]="".concat(100*n.height/n.width,"%")),this.emit(P_,!1),this.isMini=t.isMini=!1}},{key:"destroy",value:function(){window.removeEventListener("scroll",this.onScroll);var e=Ww.checkTouchSupport()?"touchend":"click";this.unbind(".mini-cancel-btn",e,this.onCancelClick),this.unbind(".play-icon",e,this.onCenterClick),this._draggabilly&&this._draggabilly.destroy(),this._draggabilly=null,this.exitMini()}},{key:"render",value:function(){if(!this.config.disable)return'\n <xg-mini-layer class="xg-mini-layer">\n <xg-mini-header class="xgplayer-mini-header">\n <div lang-key="'.concat(this.i18nKeys.MINI_DRAG,'">').concat(this.i18n.MINI_DRAG,'</div>\n </xg-mini-header>\n <div class="mini-cancel-btn">\n <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">\n <path fill="#fff" fill-rule="evenodd" d="M3.99 3.49a1 1 0 0 1 1.414 0L10 8.085l4.596-4.595a1 1 0 1 1 1.414 1.414L11.414 9.5l4.596 4.596a1 1 0 0 1 .084 1.32l-.084.094a1 1 0 0 1-1.414 0L10 10.914 5.404 15.51a1 1 0 0 1-1.414-1.414L8.585 9.5 3.99 4.904a1 1 0 0 1-.084-1.32z"></path>\n </svg>\n </div>\n <div class="play-icon">\n </div>\n </xg-mini-layer>')}}],[{key:"pluginName",get:function(){return"miniscreen"}},{key:"defaultConfig",get:function(){return{index:10,disable:!1,width:320,height:180,left:-1,top:-1,isShowIcon:!1,isScrollSwitch:!1,scrollTop:0,disableDrag:!1}}}]),n}(HC);function vS(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var gS={mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousemove:"onMouseMove"},yS=["videoClick","videoDbClick"],mS=function(e){Ho(n,e);var t=vS(n);function n(){var e;Bo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Uo(e=t.call.apply(t,[this].concat(r))),"onMouseMove",(function(t){var n=Uo(e),i=n.player,r=n.playerConfig;i.isActive||(i.focus({autoHide:!r.closeDelayBlur}),!r.closeFocusVideoFocus&&i.video.focus())})),Go(Uo(e),"onMouseEnter",(function(t){var n=Uo(e),i=n.playerConfig,r=n.player;!i.closeFocusVideoFocus&&r.video.focus(),i.closeDelayBlur?r.focus({autoHide:!1}):r.focus()})),Go(Uo(e),"onMouseLeave",(function(t){var n=e.playerConfig,i=n.closePlayerBlur,r=n.leavePlayerTime,o=n.closeDelayBlur;i||o||(r?e.player.focus({autoHide:!0,delay:r}):e.player.blur())})),Go(Uo(e),"onVideoClick",(function(t){var n=Uo(e),i=n.player,r=n.playerConfig;t.target&&r.closeVideoClick||t.target!==i.video&&t.target!==i.innerContainer&&t.target!==i.video.__canvas||(t.preventDefault(),r.closeVideoStopPropagation||t.stopPropagation(),e._clickCount++,e.clickTimer&&(clearTimeout(e.clickTimer),e.clickTimer=null),e.clickTimer=setTimeout((function(){e._clickCount&&(e._clickCount--,CC(Uo(e),yS[0],(function(t,n){e.switchPlayPause(n.e)}),{e:t,paused:i.paused}),clearTimeout(e.clickTimer),e.clickTimer=null)}),300))})),Go(Uo(e),"onVideoDblClick",(function(t){var n=Uo(e),i=n.player;n.playerConfig.closeVideoDblclick||!t.target||t.target!==i.video&&t.target!==i.video.__canvas||(e._clickCount<2?e._clickCount=0:(e._clickCount=0,e.clickTimer&&(clearTimeout(e.clickTimer),e.clickTimer=null),t.preventDefault(),t.stopPropagation(),CC(Uo(e),yS[1],(function(t,n){e.emitUserAction(n.e,"switch_fullscreen",{fullscreen:i.fullscreen}),i.fullscreen?i.exitFullscreen():i.getFullscreen()}),{e:t,fullscreen:i.fullscreen})))})),e}return Fo(n,[{key:"afterCreate",value:function(){var e=this;this._clickCount=0,yS.map((function(t){e.__hooks[t]=null})),"mobile"===this.playerConfig.isMobileSimulateMode||"mobile"===$_.device&&!$_.os.isIpad||this.initEvents()}},{key:"initEvents",value:function(){var e=this,t=this.player,n=t.video,i=t.root,r=this.playerConfig.enableContextmenu;n&&n.addEventListener("click",this.onVideoClick,!1),n&&n.addEventListener("dblclick",this.onVideoDblClick,!1),Object.keys(gS).map((function(t){i.addEventListener(t,e[gS[t]],!1)})),r&&n&&n.addEventListener("contextmenu",this.onContextmenu,!1)}},{key:"switchPlayPause",value:function(e){var t=this.player;this.emitUserAction(e,"switch_play_pause"),t.ended?t.duration!==1/0&&t.duration>0&&t.replay():t.paused?t.play():t.pause()}},{key:"onContextmenu",value:function(e){(e=e||window.event).preventDefault&&e.preventDefault(),e.stopPropagation?e.stopPropagation():(e.returnValue=!1,e.cancelBubble=!0)}},{key:"destroy",value:function(){var e=this,t=this.player,n=t.video,i=t.root;this.clickTimer&&clearTimeout(this.clickTimer),n.removeEventListener("click",this.onVideoClick,!1),n.removeEventListener("dblclick",this.onVideoDblClick,!1),n.removeEventListener("contextmenu",this.onContextmenu,!1),Object.keys(gS).map((function(t){i.removeEventListener(t,e[gS[t]],!1)}))}}],[{key:"pluginName",get:function(){return"pc"}},{key:"defaultConfig",get:function(){return{}}}]),n}(EC),kS=di,bS=Yo,wS=C,_S=RangeError,CS=function(e){var t=bS(wS(this)),n="",i=kS(e);if(i<0||i==1/0)throw _S("Wrong number of repetitions");for(;i>0;(i>>>=1)&&(t+=t))1&i&&(n+=t);return n},xS=fr,SS=k,TS=di,ES=nv,PS=CS,RS=d,OS=RangeError,IS=String,LS=Math.floor,AS=SS(PS),DS=SS("".slice),MS=SS(1..toFixed),NS=function(e,t,n){return 0===t?n:t%2==1?NS(e,t-1,n*e):NS(e*e,t/2,n)},FS=function(e,t,n){for(var i=-1,r=n;++i<6;)r+=t*e[i],e[i]=r%1e7,r=LS(r/1e7)},BS=function(e,t){for(var n=6,i=0;--n>=0;)i+=e[n],e[n]=LS(i/t),i=i%t*1e7},jS=function(e){for(var t=6,n="";--t>=0;)if(""!==n||0===t||0!==e[t]){var i=IS(e[t]);n=""===n?i:n+AS("0",7-i.length)+i}return n};xS({target:"Number",proto:!0,forced:RS((function(){return"0.000"!==MS(8e-5,3)||"1"!==MS(.9,0)||"1.25"!==MS(1.255,2)||"1000000000000000128"!==MS(0xde0b6b3a7640080,0)}))||!RS((function(){MS({})}))},{toFixed:function(e){var t,n,i,r,o=ES(this),a=TS(e),s=[0,0,0,0,0,0],c="",u="0";if(a<0||a>20)throw OS("Incorrect fraction digits");if(o!=o)return"NaN";if(o<=-1e21||o>=1e21)return IS(o);if(o<0&&(c="-",o=-o),o>1e-21)if(n=(t=function(e){for(var t=0,n=e;n>=4096;)t+=12,n/=4096;for(;n>=2;)t+=1,n/=2;return t}(o*NS(2,69,1))-69)<0?o*NS(2,-t,1):o/NS(2,t,1),n*=4503599627370496,(t=52-t)>0){for(FS(s,0,n),i=a;i>=7;)FS(s,1e7,0),i-=7;for(FS(s,NS(10,i,1),0),i=t-1;i>=23;)BS(s,1<<23),i-=23;BS(s,1<<i),FS(s,1,1),BS(s,2),u=jS(s)}else FS(s,0,n),FS(s,1<<-t,0),u=jS(s)+AS("0",a);return u=a>0?c+((r=u.length)<=a?"0."+AS("0",a-r)+u:DS(u,0,r-a)+"."+DS(u,r-a)):c+u}});var HS="press",US="pressend",WS="doubleclick",VS="click",GS="touchmove",KS="touchstart",zS="touchend",YS={start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},qS={start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseleave"};function XS(e){return e&&e.length>0?e[e.length-1]:null}function $S(e){var t=navigator.userAgent;/(?:iPhone|iPad)/.test(t)&&e.cancelable&&e.preventDefault()}var JS=function(){function e(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{eventType:"touch"};Bo(this,e),Go(this,"onTouchStart",(function(e){var t=n._pos,i=n.root;n.config.needPreventDefault&&$S(e);var r=XS(e.touches);t.x=r?parseInt(r.pageX,10):e.pageX,t.y=r?parseInt(r.pageX,10):e.pageX,t.start=!0,n.__setPress(e),i.addEventListener(n.events.end,n.onTouchEnd),i.addEventListener(n.events.cancel,n.onTouchCancel),i.addEventListener(n.events.move,n.onTouchMove),n.trigger(KS,e)})),Go(this,"onTouchCancel",(function(e){n.onTouchEnd(e)})),Go(this,"onTouchEnd",(function(e){var t=n._pos,i=n.root;n.config.needPreventDefault&&$S(e),n.__clearPress(),i.removeEventListener(n.events.cancel,n.onTouchCancel),i.removeEventListener(n.events.end,n.onTouchEnd),i.removeEventListener(n.events.move,n.onTouchMove),e.moving=t.moving,e.press=t.press,t.press&&n.trigger(US,e),n.trigger(zS,e),!t.press&&!t.moving&&n.__setDb(e),t.press=!1,t.start=!1,t.moving=!1})),Go(this,"onTouchMove",(function(e){var t=n._pos,i=n.config,r=XS(e.touches),o=r?parseInt(r.pageX,10):e.pageX,a=r?parseInt(r.pageY,10):e.pageX,s=o-t.x,c=a-t.y;Math.abs(c)<i.miniStep&&Math.abs(s)<i.miniStep||(n.__clearPress(),t.press&&n.trigger(US,e),t.press=!1,t.moving=!0,n.trigger(GS,e))})),this._pos={moving:!1,start:!1,x:0,y:0},this.config={pressDelay:600,dbClickDelay:200,disablePress:!1,disableDbClick:!1,miniStep:2,needPreventDefault:!0},Object.keys(i).map((function(e){n.config[e]=i[e]})),this.root=t,this.events="mouse"===i.eventType?qS:YS,this.pressIntrvalId=null,this.dbIntrvalId=null,this.__handlers={},this._initEvent()}return Fo(e,[{key:"_initEvent",value:function(){this.root.addEventListener(this.events.start,this.onTouchStart)}},{key:"__setPress",value:function(e){var t=this,n=this.config;this.pressIntrvalId&&this.__clearPress(),this.pressIntrvalId=setTimeout((function(){t.trigger(HS,e),t._pos.press=!0,t.__clearPress()}),n.pressDelay)}},{key:"__clearPress",value:function(){window.clearTimeout(this.pressIntrvalId),this.pressIntrvalId=null}},{key:"__setDb",value:function(e){var t=this,n=this.config;if(this.dbIntrvalId)return this.__clearDb(),void this.trigger(WS,e);this.dbIntrvalId=setTimeout((function(){t.__clearDb(),t._pos.start||t._pos.press||t._pos.moving||t.trigger(VS,e)}),n.dbClickDelay)}},{key:"__clearDb",value:function(){clearTimeout(this.dbIntrvalId),this.dbIntrvalId=null}},{key:"on",value:function(e,t){this.__handlers[e]||(this.__handlers[e]=[]),this.__handlers[e].push(t)}},{key:"off",value:function(e,t){if(this.__handlers[e]){for(var n=this.__handlers[e],i=-1,r=0;r<n.length;r++)if(n[r]===t){i=r;break}i>=0&&this.__handlers[e].splice(i,1)}}},{key:"trigger",value:function(e,t){this.__handlers[e]&&this.__handlers[e].map((function(n){try{n(t)}catch(t){console.error("trigger>>:".concat(e),t)}}))}},{key:"destroy",value:function(){var e=this,t={touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"};Object.keys(t).forEach((function(n){e.root.removeEventListener(n,e[t[n]])}))}}]),e}(),ZS=JS;function QS(){return(new DOMParser).parseFromString('<svg width="20" height="9" viewBox="0 0 8 9" fill="none" xmlns="http://www.w3.org/2000/svg"\n xmlns:xlink="http://www.w3.org/1999/xlink">\n <path opacity="0.54"\n d="M7.5 3.63397C8.16667 4.01887 8.16667 4.98113 7.5 5.36603L1.5 8.83013C0.833334 9.21503 0 8.7339 0 7.9641L0 1.0359C0 0.266098 0.833333 -0.215027 1.5 0.169873L7.5 3.63397Z"\n fill="white" />\n <path transform="translate(5 0)" d="M7.5 3.63397C8.16667 4.01887 8.16667 4.98113 7.5 5.36603L1.5 8.83013C0.833334 9.21503 0 8.7339 0 7.9641L0 1.0359C0 0.266098 0.833333 -0.215027 1.5 0.169873L7.5 3.63397Z" fill="white"/>\n</svg>',"image/svg+xml").firstChild}function eT(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var tT="auto",nT="seeking",iT="playbackrate",rT=["videoClick","videoDbClick"],oT=function(e){Ho(n,e);var t=eT(n);function n(e){var i;return Bo(this,n),Go(Uo(i=t.call(this,e)),"onTouchStart",(function(e){var t=Uo(i),n=t.player,r=t.config,o=t.pos,a=t.playerConfig,s=i.getTouche(e);if(s&&!r.disableGesture&&i.duration>0&&!n.ended){o.isStart=!0,Ww.checkIsFunction(a.disableSwipeHandler)&&a.disableSwipeHandler(),i.find(".xg-dur").innerHTML=Ww.format(i.duration);var c=i.root.getBoundingClientRect();90===n.rotateDeg?(o.top=c.left,o.left=c.top,o.width=c.height,o.height=c.width):(o.top=c.top,o.left=c.left,o.width=c.width,o.height=c.height);var u=parseInt(s.pageX-o.left,10),l=parseInt(s.pageY-o.top,10);o.x=90===n.rotateDeg?l:u,o.y=90===n.rotateDeg?u:l,o.scopeL=r.scopeL*o.width,o.scopeR=(1-r.scopeR)*o.width,o.scopeM1=o.width*(1-r.scopeM)/2,o.scopeM2=o.width-o.scopeM1}})),Go(Uo(i),"onTouchMove",(function(e){var t=i.getTouche(e),n=Uo(i),r=n.pos,o=n.config,a=n.player;if(t&&!o.disableGesture&&i.duration&&r.isStart){var s=o.miniMoveStep,c=o.hideControlsActive,u=parseInt(t.pageX-r.left,10),l=parseInt(t.pageY-r.top,10),f=90===a.rotateDeg?l:u,h=90===a.rotateDeg?u:l;if(Math.abs(f-r.x)>s||Math.abs(h-r.y)>s){var d=f-r.x,p=h-r.y,v=r.scope;if(-1===v&&(0===(v=i.checkScope(f,h,d,p,r))&&(c?a.blur():a.focus({autoHide:!1}),!r.time&&(r.time=parseInt(1e3*a.currentTime,10)+1e3*i.timeOffset)),r.scope=v),-1===v||v>0&&!o.gestureY||0===v&&!o.gestureX)return;e.cancelable&&e.preventDefault(),i.executeMove(d,p,v,r.width,r.height),r.x=f,r.y=h}}})),Go(Uo(i),"onTouchEnd",(function(e){var t=Uo(i),n=t.player,r=t.pos,o=t.playerConfig;r.isStart&&(r.scope>-1&&e.cancelable&&e.preventDefault(),i.endLastMove(r.scope),setTimeout((function(){n.getPlugin("progress")&&n.getPlugin("progress").resetSeekState()}),10),r.scope=-1,i.resetPos(),Ww.checkIsFunction(o.enableSwipeHandler)&&o.enableSwipeHandler(),i.changeAction(tT))})),Go(Uo(i),"onRootTouchMove",(function(e){!i.config.disableGesture&&i.config.gestureX&&i.checkIsRootTarget(e)&&(e.stopPropagation(),i.pos.isStart?i.onTouchMove(e):i.onTouchStart(e))})),Go(Uo(i),"onRootTouchEnd",(function(e){if(i.pos.isStart&&i.checkIsRootTarget(e)){e.stopPropagation(),i.onTouchEnd(e);var t=i.player.controls;t&&t.recoverAutoHide()}})),i.pos={isStart:!1,x:0,y:0,time:0,volume:0,rate:1,light:0,width:0,height:0,scopeL:0,scopeR:0,scopeM1:0,scopeM2:0,scope:-1},i.timer=null,i}return Fo(n,[{key:"duration",get:function(){return this.playerConfig.customDuration||this.player.duration}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"registerIcons",value:function(){return{seekTipIcon:{icon:QS,class:"xg-seek-pre"}}}},{key:"afterCreate",value:function(){var e=this;rT.map((function(t){e.__hooks[t]=null}));var t=this.playerConfig,n=this.config,i=this.player;!0===t.closeVideoDblclick&&(n.closedbClick=!0),this.resetPos(),Ww.isUndefined(t.disableGesture)||(n.disableGesture=!!t.disableGesture),this.appendChild(".xg-seek-icon",this.icons.seekTipIcon),this.xgMask=Ww.createDom("xg-mask","",{},"xgmask"),i.root.appendChild(this.xgMask),this.initCustomStyle(),this.registerThumbnail();var r="mouse"===this.domEventType?"mouse":"touch";this.touch=new ZS(this.root,{eventType:r,needPreventDefault:!this.config.disableGesture}),this.root.addEventListener("contextmenu",(function(e){e.preventDefault()})),i.root.addEventListener("touchmove",this.onRootTouchMove,!0),i.root.addEventListener("touchend",this.onRootTouchEnd,!0),this.on(r_,(function(){var t=e.player,n=e.config;1e3*t.duration<n.moveDuration&&(n.moveDuration=1e3*t.duration)})),this.on([i_,$w],(function(){var t=e.pos,n=t.time;!t.isStart&&n>0&&(e.pos.time=0)}));var o={touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",press:"onPress",pressend:"onPressEnd",click:"onClick",doubleclick:"onDbClick"};if(Object.keys(o).forEach((function(t){e.touch.on(t,(function(n){e[o[t]](n)}))})),!n.disableActive){var a=i.plugins.progress;a&&(a.addCallBack("dragmove",(function(t){e.activeSeekNote(t.currentTime,t.forward)})),a.addCallBack("dragend",(function(){e.changeAction(tT)})),a.addCallBack("click",(function(){e.changeAction(tT)})))}}},{key:"registerThumbnail",value:function(){var e=this.player.plugins.thumbnail;if(e&&e.usable){this.thumbnail=e.createThumbnail(null,"mobile-thumbnail");var t=this.find(".time-preview");t.insertBefore(this.thumbnail,t.children[0])}}},{key:"initCustomStyle",value:function(){var e=(this.playerConfig||{}).commonStyle,t=e.playedColor,n=e.progressColor;t&&(this.find(".xg-curbar").style.backgroundColor=t,this.find(".xg-cur").style.color=t),n&&(this.find(".xg-bar").style.backgroundColor=n,this.find(".time-preview").style.color=n),this.config.disableTimeProgress&&Ww.addClass(this.find(".xg-timebar"),"hide")}},{key:"resetPos",value:function(){var e=this;this.pos?(this.pos.isStart=!1,this.pos.scope=-1,["x","y","width","height","scopeL","scopeR","scopeM1","scopeM2"].map((function(t){e.pos[t]=0}))):this.pos={isStart:!1,x:0,y:0,volume:0,rate:1,light:0,width:0,height:0,scopeL:0,scopeR:0,scopeM1:0,scopeM2:0,scope:-1,time:0}}},{key:"changeAction",value:function(e){var t=this.player;this.root.setAttribute("data-xg-action",e);var n=t.plugins.start;n&&n.recover()}},{key:"getTouche",value:function(e){this.player.rotateDeg;var t=e.touches&&e.touches.length>0?e.touches[e.touches.length-1]:e;return{pageX:t.pageX,pageY:t.pageY}}},{key:"checkScope",value:function(e,t,n,i,r){var o=r.width,a=-1;if(e<0||e>o)return a;var s=0===i?Math.abs(n):Math.abs(n/i);return Math.abs(n)>0&&s>=1.73&&e>r.scopeM1&&e<r.scopeM2?a=0:(0===Math.abs(n)||s<=.57)&&(a=e<r.scopeL?1:e>r.scopeR?2:3),a}},{key:"executeMove",value:function(e,t,n,i,r){switch(n){case 0:this.updateTime(e/i*this.config.scopeM);break;case 1:this.updateBrightness(t/r);break;case 2:$_.os.isIos||this.updateVolume(t/r)}}},{key:"endLastMove",value:function(e){var t=this,n=this.pos,i=this.player,r=this.config,o=(n.time-this.timeOffset)/1e3;if(0===e)i.seek(Number(o).toFixed(1)),r.hideControlsEnd?i.blur():i.focus(),this.timer=setTimeout((function(){t.pos.time=0}),500);this.changeAction(tT)}},{key:"checkIsRootTarget",value:function(e){var t=this.player.plugins||{};return(!t.progress||!t.progress.root.contains(e.target))&&(t.start&&t.start.root.contains(e.target)||t.controls&&t.controls.root.contains(e.target))}},{key:"clickHandler",value:function(e){var t=this.player,n=this.config,i=this.playerConfig;t.isPlaying?!n.closedbClick||i.closeVideoClick?t.isActive?t.blur():t.focus():i.closeVideoClick||((t.isActive||n.focusVideoClick)&&(this.emitUserAction("click","switch_play_pause"),this.switchPlayPause()),t.focus()):i.closeVideoClick||(this.emitUserAction("click","switch_play_pause"),t.play())}},{key:"dbClickHandler",value:function(e){var t=this.config,n=this.player;!t.closedbClick&&n.isPlaying&&(this.emitUserAction("dblclick","switch_play_pause"),this.switchPlayPause())}},{key:"onClick",value:function(e){var t=this,n=this.player;CC(this,rT[0],(function(e,n){t.clickHandler(n.e)}),{e:e,paused:n.paused})}},{key:"onDbClick",value:function(e){var t=this,n=this.player;CC(this,rT[1],(function(e,n){t.dbClickHandler(n.e)}),{e:e,paused:n.paused})}},{key:"onPress",value:function(e){var t=this.pos,n=this.config,i=this.player;n.disablePress||(t.rate=this.player.playbackRate,this.emitUserAction("press","change_rate",{from:i.playbackRate,to:n.pressRate}),i.playbackRate=n.pressRate,this.changeAction(iT))}},{key:"onPressEnd",value:function(e){var t=this.pos,n=this.config,i=this.player;n.disablePress||(this.emitUserAction("pressend","change_rate",{from:i.playbackRate,to:t.rate}),i.playbackRate=t.rate,t.rate=1,this.changeAction(tT))}},{key:"updateTime",value:function(e){var t=this.player,n=this.config,i=this.player.duration;e=Number(e.toFixed(4));var r=parseInt(e*n.moveDuration,10)+this.timeOffset;r=(r+=this.pos.time)<0?0:r>1e3*i?1e3*i-200:r,t.getPlugin("time")&&t.getPlugin("time").updateTime(r/1e3),t.getPlugin("progress")&&t.getPlugin("progress").updatePercent(r/1e3/this.duration,!0),this.activeSeekNote(r/1e3,e>0),n.isTouchingSeek&&t.seek(Number((r-this.timeOffset)/1e3).toFixed(1)),this.pos.time=r}},{key:"updateVolume",value:function(e){this.player.rotateDeg&&(e=-e);var t=this.player,n=this.pos;if(e=parseInt(100*e,10),n.volume+=e,!(Math.abs(n.volume)<10)){var i=parseInt(10*t.volume,10)-parseInt(n.volume/10,10);i=i>10?10:i<1?0:i,t.volume=i/10,n.volume=0}}},{key:"updateBrightness",value:function(e){this.player.rotateDeg&&(e=-e);var t=this.pos,n=this.config,i=this.xgMask,r=t.light+.8*e;r=r>n.maxDarkness?n.maxDarkness:r<0?0:r,i&&(i.style.backgroundColor="rgba(0,0,0,".concat(r,")")),t.light=r}},{key:"activeSeekNote",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.player,i=this.config,r=!(this.duration!==1/0&&this.duration>0);if(e&&"number"==typeof e&&!r&&!i.disableActive){e<0?e=0:e>n.duration&&(e=n.duration-.2),this.changeAction(nT);var o=n.plugins.start;o&&o.focusHide(),this.find(".xg-dur").innerHTML=Ww.format(this.duration),this.find(".xg-cur").innerHTML=Ww.format(e),this.find(".xg-curbar").style.width="".concat(e/this.duration*100,"%"),t?Ww.removeClass(this.find(".xg-seek-show"),"xg-back"):Ww.addClass(this.find(".xg-seek-show"),"xg-back"),this.updateThumbnails(e)}}},{key:"updateThumbnails",value:function(e){var t=this.player.plugins.thumbnail;t&&t.usable&&this.thumbnail&&t.update(this.thumbnail,e,160,90)}},{key:"switchPlayPause",value:function(){var e=this.player;if(!e.hasStart)return!1;e.ended||(e.paused?e.play():e.pause())}},{key:"disableGesture",value:function(){this.config.disableGesture=!1}},{key:"enableGesture",value:function(){this.config.disableGesture=!0}},{key:"destroy",value:function(){var e=this.player;this.timer&&clearTimeout(this.timer),this.thumbnail=null,e.root.removeChild(this.xgMask),this.xgMask=null,this.touch&&this.touch.destroy(),this.touch=null,e.root.removeEventListener("touchmove",this.onRootTouchMove,!0),e.root.removeEventListener("touchend",this.onRootTouchEnd,!0)}},{key:"render",value:function(){var e="normal"!==this.config.gradient?"gradient ".concat(this.config.gradient):"gradient";return'\n <xg-trigger class="trigger">\n <div class="'.concat(e,'"></div>\n <div class="time-preview">\n <div class="xg-seek-show ').concat(this.config.disableSeekIcon?" hide-seek-icon":"",'">\n <i class="xg-seek-icon"></i>\n <span class="xg-cur">00:00</span>\n <span>/</span>\n <span class="xg-dur">00:00</span>\n </div>\n <div class="xg-bar xg-timebar">\n <div class="xg-curbar"></div>\n </div>\n </div>\n <div class="xg-playbackrate xg-top-note">\n <span><i>').concat(this.config.pressRate,"X</i>").concat(this.i18n.FORWARD,"</span>\n </div>\n </xg-trigger>\n ")}}],[{key:"pluginName",get:function(){return"mobile"}},{key:"defaultConfig",get:function(){return{stopPropagation:!0,index:0,disableGesture:!1,gestureX:!0,gestureY:!0,updateGesture:function(){},onTouchStart:function(){},onTouchEnd:function(){},gradient:"normal",isTouchingSeek:!1,miniMoveStep:5,miniYPer:5,scopeL:.25,scopeR:.25,scopeM:.9,pressRate:2,darkness:!0,maxDarkness:.8,disableActive:!1,disableTimeProgress:!1,hideControlsActive:!1,hideControlsEnd:!1,moveDuration:36e4,closedbClick:!1,disablePress:!0,disableSeekIcon:!1,focusVideoClick:!1}}}]),n}(HC),aT=oT;function sT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function cT(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?sT(Object(n),!0).forEach((function(t){Go(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sT(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function uT(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}function lT(e){var t=e.tagName;return!("INPUT"!==t&&"TEXTAREA"!==t&&!e.isContentEditable)}fr({target:"String",proto:!0},{repeat:CS});var fT=function(e){Ho(n,e);var t=uT(n);function n(){var e;Bo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Uo(e=t.call.apply(t,[this].concat(r))),"onBodyKeyDown",(function(t){if(e.player){var n=t||window.event,i=n.target,r=n.keyCode,o=Uo(e),a=o._keyState,s=o.player,c=e.config,u=c.disable,l=c.disableBodyTrigger,f=c.isIgnoreUserActive,h=i.ownerDocument;u||l||!s.isUserActive&&!f||lT(i)||!e.checkIsVisible()||n.metaKey||n.altKey||n.ctrlKey?a.isBodyKeyDown=!1:(t.repeat||a.isKeyDown||((i===h.body||e.config.isGlobalTrigger&&!lT(i))&&e.checkCode(r,!0)&&(a.isBodyKeyDown=!0),h.addEventListener("keyup",e.onBodyKeyUp)),a.isBodyKeyDown&&e.handleKeyDown(n))}})),Go(Uo(e),"onBodyKeyUp",(function(t){e.player&&((t||window.event).target.ownerDocument.removeEventListener("keyup",e.onBodyKeyUp),e.handleKeyUp(t))})),Go(Uo(e),"onKeydown",(function(t){if(e.player){var n=t||window.event,i=Uo(e)._keyState;if(!n.repeat){if(e.config.disable||e.config.disableRootTrigger||n.metaKey||n.altKey||n.ctrlKey)return;if(!e.player.isUserActive&&!e.config.isIgnoreUserActive)return;!n||37!==n.keyCode&&!e.checkCode(n.keyCode)||n.target!==e.player.root&&n.target!==e.player.video&&n.target!==e.player.controls.el||(i.isKeyDown=!0),e.player.root.addEventListener("keyup",e.onKeyup)}i.isKeyDown&&e.handleKeyDown(n)}})),Go(Uo(e),"onKeyup",(function(t){e.player&&(e.player.root.removeEventListener("keyup",e.onKeyup),e.handleKeyUp(t))})),e}return Fo(n,[{key:"setConfig",value:function(e,t){var n=this;if(e){var i=Object.keys(e);i.length<1||(i.forEach((function(i){t.deepMerge&&"Object"===Ww.typeOf(n.config[i])?Ww.deepMerge(n.config[i],e[i]):n.config[i]=e[i]})),this.mergekeyCodeMap())}}},{key:"mergekeyCodeMap",value:function(){var e=this,t=this.config.keyCodeMap;t&&Object.keys(t).map((function(n){e.keyCodeMap[n]?["keyCode","action","disable","pressAction","disablePress","isBodyTarget"].map((function(i){t[n][i]&&(e.keyCodeMap[n][i]=t[n][i])})):e.keyCodeMap[n]=t[n]}))}},{key:"afterCreate",value:function(){this.config.disable=!this.playerConfig.keyShortcut;var e="function"==typeof this.config.seekStep?this.config.seekStep(this.player):this.config.seekStep;e&&"number"==typeof e&&(this.seekStep=e),this.keyCodeMap={space:{keyCode:32,action:"playPause",disable:!1,disablePress:!1,noBodyTarget:!1},up:{keyCode:38,action:"upVolume",disable:!1,disablePress:!1,noBodyTarget:!0},down:{keyCode:40,action:"downVolume",disable:!1,disablePress:!1,noBodyTarget:!0},left:{keyCode:37,action:"seekBack",disablePress:!1,disable:!1},right:{keyCode:39,action:"seek",pressAction:"changePlaybackRate",disablePress:!1,disable:!1},esc:{keyCode:27,action:"exitFullscreen",disablePress:!0,disable:!1}},this.mergekeyCodeMap(),this._keyState={isKeyDown:!1,isBodyKeyDown:!1,isPress:!1,tt:0,playbackRate:0},this.player.root.addEventListener("keydown",this.onKeydown),document.addEventListener("keydown",this.onBodyKeyDown)}},{key:"checkIsVisible",value:function(){if(!this.config.checkVisible)return!0;var e=this.player.root.getBoundingClientRect(),t=e.height,n=e.top,i=e.bottom,r=window.innerHeight;return!(n<0&&n<0-.9*t||i>0&&i-r>.9*t)}},{key:"checkCode",value:function(e,t){var n=this,i=!1;return Object.keys(this.keyCodeMap).map((function(r){n.keyCodeMap[r]&&e===n.keyCodeMap[r].keyCode&&!n.keyCodeMap[r].disable&&(i=!t||t&&!n.keyCodeMap[r].noBodyTarget)})),i}},{key:"downVolume",value:function(e){var t=this.player;if(!(t.volume<=0)){var n=parseFloat((t.volume-.1).toFixed(1)),i={volume:{from:t.volume,to:n}};this.emitUserAction(e,"change_volume",{props:i}),t.volume=n>=0?n:0}}},{key:"upVolume",value:function(e){var t=this.player;if(!(t.volume>=1)){var n=parseFloat((t.volume+.1).toFixed(1)),i={volume:{from:t.volume,to:n}};this.emitUserAction(e,"change_volume",{props:i}),t.volume=n<=1?n:1}}},{key:"seek",value:function(e){var t=this.player,n=t.currentTime,i=t.duration,r=n,o=e.repeat&&this.seekStep>=4?parseInt(this.seekStep/2,10):this.seekStep,a={currentTime:{from:n,to:r=n+o<=i?n+o:i}};this.emitUserAction(e,"seek",{props:a}),this.player.currentTime=r}},{key:"seekBack",value:function(e){var t=this.player.currentTime,n=e.repeat?parseInt(this.seekStep/2,10):this.seekStep,i=0;t-n>=0&&(i=t-n);var r={currentTime:{from:t,to:i}};this.emitUserAction(e,"seek",{props:r}),this.player.currentTime=i}},{key:"changePlaybackRate",value:function(e){var t=this._keyState,n=this.config,i=this.player;0===t.playbackRate&&(t.playbackRate=i.playbackRate,i.playbackRate=n.playbackRate)}},{key:"playPause",value:function(e){var t=this.player;t&&(this.emitUserAction(e,"switch_play_pause"),t.paused?t.play():t.pause())}},{key:"exitFullscreen",value:function(e){var t=this.player,n=t.fullscreen,i=t.cssfullscreen;n&&(this.emitUserAction("keyup","switch_fullscreen",{prop:"fullscreen",from:n,to:!n}),t.exitFullscreen()),i&&(this.emitUserAction("keyup","switch_css_fullscreen",{prop:"cssfullscreen",from:i,to:!i}),t.exitCssFullscreen())}},{key:"handleKeyDown",value:function(e){var t=this._keyState;if(e.repeat){t.isPress=!0;var n=Date.now();if(n-t.tt<200)return;t.tt=n}!function(e){e.preventDefault(),e.returnValue=!1}(e),this.handleKeyCode(e.keyCode,e,t.isPress)}},{key:"handleKeyUp",value:function(e){var t=this._keyState;t.playbackRate>0&&(this.player.playbackRate=t.playbackRate,t.playbackRate=0),t.isKeyDown=!1,t.isPress=!1,t.tt=0}},{key:"handleKeyCode",value:function(e,t,n){for(var i=Object.keys(this.keyCodeMap),r=0;r<i.length;r++){var o=this.keyCodeMap[i[r]];if(o){var a=o.action,s=o.keyCode,c=o.disable,u=o.pressAction,l=o.disablePress;if(s===e){if(!(c||n&&l)){var f=n&&u||a;"function"==typeof f?a(t,this.player,n):"string"==typeof f&&"function"==typeof this[f]&&this[f](t,this.player,n),this.emit(N_,cT({key:i[r],target:t.target,isPress:n},this.keyCodeMap[i[r]]))}break}}}}},{key:"destroy",value:function(){this.player.root.removeEventListener("keydown",this.onKeydown),document.removeEventListener("keydown",this.onBodyKeyDown),this.player.root.removeEventListener("keyup",this.onKeyup),document.removeEventListener("keyup",this.onBodyKeyUp)}},{key:"disable",value:function(){this.config.disable=!0}},{key:"enable",value:function(){this.config.disable=!1}}],[{key:"pluginName",get:function(){return"keyboard"}},{key:"defaultConfig",get:function(){return{seekStep:10,checkVisible:!1,disableBodyTrigger:!1,disableRootTrigger:!1,isGlobalTrigger:!1,keyCodeMap:{},disable:!1,playbackRate:2,isIgnoreUserActive:!1}}}]),n}(EC),hT=fT;function dT(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="-5 -5 110 110">\n <path d="M100,50A50,50,0,1,1,50,0" stroke-width="5" stroke="#ddd" stroke-dasharray="236" fill="none"></path>\n</svg>\n',"image/svg+xml").firstChild}function pT(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var vT=function(e){Ho(n,e);var t=pT(n);function n(){return Bo(this,n),t.apply(this,arguments)}return Fo(n,[{key:"registerIcons",value:function(){return{loadingIcon:dT}}},{key:"afterCreate",value:function(){this.appendChild("xg-loading-inner",this.icons.loadingIcon)}},{key:"render",value:function(){return'\n <xg-loading class="xgplayer-loading">\n <xg-loading-inner></xg-loading-inner>\n </xg-loading>'}}],[{key:"pluginName",get:function(){return"loading"}},{key:"defaultConfig",get:function(){return{position:MC.ROOT}}}]),n}(HC),gT=vT,yT=fr,mT=Za.findIndex,kT=zv,bT="findIndex",wT=!0;bT in[]&&Array(1)[bT]((function(){wT=!1})),yT({target:"Array",proto:!0,forced:wT},{findIndex:function(e){return mT(this,e,arguments.length>1?arguments[1]:void 0)}}),kT(bT);var _T=[{tag:"xg-cache",className:"xgplayer-progress-cache",styleKey:"cachedColor"},{tag:"xg-played",className:"xgplayer-progress-played",styleKey:"playedColor"}],CT=function(){function e(t){Bo(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 Fo(e,[{key:"updateDuration",value:function(e){var t=this;this.duration=e;var n=0,i=this.fragments;this.fragments=i.map((function(e){return e.start=parseInt(n,10),e.end=parseInt(n+e.percent*t.duration,10),e.duration=parseInt(e.percent*t.duration,10),n+=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},n=this.progressList,i=this.fragments;if(!(n.length<1)){var r=t.newIndex,o=t.curIndex,a=t.millisecond;r!==o&&n.map((function(t,n){n<r?t[e].style.width="100%":n>r&&(t[e].style.width=0)}));var s=i[r],c=0===a?0:(a-s.start)/s.duration;n[r][e].style.width=c<0?0:"".concat(100*c,"%")}}},{key:"updateFocus",value:function(e){if(this.fragConfig.fragAutoFocus&&!(this.fragments.length<2))if(e){var t=this.findIndex(1e3*e.currentTime,this.focusIndex);if(t>=0&&t!==this.focusIndex){this.focusIndex>-1&&this.unHightLight(this.focusIndex),this.setHightLight(t);var n={index:t,preIndex:this.focusIndex,fragment:this.fragments[this.focusIndex]};this.focusIndex=t,this._callBack&&this._callBack(n)}}else if(this.focusIndex>-1){this.unHightLight(this.focusIndex);var i={index:-1,preIndex:this.focusIndex,fragment:null};this._callBack&&this._callBack(i),this.focusIndex=-1}}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{cached:0,played:0},t=arguments.length>1?arguments[1]:void 0;if(!this.duration||parseInt(1e3*t,10)!==this.duration){if(!t&&0!==t)return;this.updateDuration(parseInt(1e3*t,10))}var n=this.playedIndex,i=this.cachedIndex;if("Undefined"!==Ww.typeOf(e.played)){var r=this.findIndex(1e3*e.played,n);if(r<0)return;this.updateProgress("played",{newIndex:r,curIndex:n,millisecond:parseInt(1e3*e.played,10)}),this.playedIndex=r}if("Undefined"!==Ww.typeOf(e.cached)){var o=this.findIndex(1e3*e.cached,i);if(o<0)return;this.updateProgress("cached",{newIndex:o,curIndex:i,millisecond:parseInt(1e3*e.cached,10)}),this.cachedIndex=o}}},{key:"findIndex",value:function(e,t){var n=this.fragments;if(!n||0===n.length)return-1;if(1===n.length)return 0;if(t>-1&&t<n.length&&e>n[t].start&&e<n[t].end)return t;if(e>n[n.length-1].start)return n.length-1;for(var i=0;i<n.length;i++)if(e>n[i].start&&e<=n[i].end){t=i;break}return t}},{key:"findHightLight",value:function(){for(var e=this.root.children,t=0;t<e.length;t++)if(Ww.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++)Ww.removeClass(e[t],this.fragConfig.fragFocusClass)}},{key:"setHightLight",value:function(e){var t=this.root.children;if(e<t.length)return Ww.addClass(t[e],this.fragConfig.fragFocusClass),{dom:t[e],pos:t[e].getBoundingClientRect()}}},{key:"destroy",value:function(){this.progressList=null,this.fragments=null,this.root.innerHTML=""}},{key:"reset",value:function(e){var t=this;if(Object.keys(this.fragConfig).forEach((function(n){void 0!==e[n]&&(t.fragConfig[n]=e[n])})),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=Ww.createDom("xg-inners","",{},"progress-list")),this.fragments){var n=this.fragConfig,i=n.fragClass,r=n.fragFocusClass;this.progressList=this.fragments.map((function(n){var o=Ww.createDom("xg-inner","",{style:t?"background:".concat(t,"; flex: ").concat(n.percent):"flex: ".concat(n.percent)},"".concat(n.isFocus?r:""," xgplayer-progress-inner ").concat(i));return e.root.appendChild(o),_T.forEach((function(t){o.appendChild(Ww.createDom(t.tag,"",{style:t.styleKey?"background: ".concat(e.style[t.styleKey],"; width:0;"):"width:0;"},t.className))})),{cached:o.children[0],played:o.children[1]}}))}return this.root}}]),e}();function xT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function ST(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xT(Object(n),!0).forEach((function(t){Go(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xT(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function TT(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var ET={POINT:"inner-focus-point",HIGHLIGHT:"inner-focus-highlight"},PT=function(e){Ho(n,e);var t=TT(n);function n(e){var i;return Bo(this,n),Go(Uo(i=t.call(this,e)),"onMoveOnly",(function(e,t){var n=Uo(i),r=n.pos,o=n.config,a=n.player,s=t;if(e){Ww.event(e);var c=Ww.getEventPos(e,a.zoom),u=90===a.rotateDeg?c.clientY:c.clientX;if(r.moving&&Math.abs(r.x-u)<o.miniMoveStep)return;r.moving=!0,r.x=u,s=i.computeTime(e,u)}i.triggerCallbacks("dragmove",s,e),i._updateInnerFocus(s)})),Go(Uo(i),"onBodyClick",(function(e){e.preventDefault(),e.stopPropagation()})),Go(Uo(i),"_mouseDownHandler",(function(e,t){i._state.time=t.currentTime,i.updateWidth(t.currentTime,t.percent,0),i._updateInnerFocus(t)})),Go(Uo(i),"_mouseUpHandler",(function(e,t){Uo(i).pos.moving&&i.updateWidth(t.currentTime,t.percent,2)})),Go(Uo(i),"_mouseMoveHandler",(function(e,t){var n=Uo(i),r=n._state,o=n.pos,a=n.config,s=n.player;r.time<t.currentTime?t.forward=!0:t.forward=!1,r.time=t.currentTime,o.isDown&&!o.moving&&(o.moving=!0,a.isPauseMoving&&s.pause(),i.triggerCallbacks("dragstart",t,e),i.emitUserAction("drag","dragstart",t)),i.updateWidth(t.currentTime,t.percent,1),i.triggerCallbacks("dragmove",t,e),i._updateInnerFocus(t)})),Go(Uo(i),"onMouseDown",(function(e){var t=Uo(i),n=t._state,r=t.player,o=t.pos,a=t.config,s=t.playerConfig,c=t.root,u=Ww.getEventPos(e,r.zoom),l=90===r.rotateDeg?u.clientY:u.clientX;if(!(r.isMini||a.closeMoveSeek||!s.allowSeekAfterEnded&&r.ended)){e.stopPropagation(),i.focus(),Ww.checkIsFunction(s.disableSwipeHandler)&&s.disableSwipeHandler(),Ww.checkIsFunction(a.onMoveStart)&&a.onMoveStart(),Ww.event(e),o.x=l,o.isDown=!0,o.moving=!1,n.prePlayTime=r.currentTime,r.focus({autoHide:!1}),i.isProgressMoving=!0,Ww.addClass(i.progressBtn,"active");var f=i.computeTime(e,l);return f.prePlayTime=n.prePlayTime,i._mouseDownHandlerHook(e,f),"touchstart"===e.type?(c.addEventListener("touchmove",i.onMouseMove),c.addEventListener("touchend",i.onMouseUp),c.addEventListener("touchcancel",i.onMouseUp)):(i.unbind("mousemove",i.onMoveOnly),c.ownerDocument.addEventListener("mousemove",i.onMouseMove,!1),c.ownerDocument.addEventListener("mouseup",i.onMouseUp,!1),r.root.addEventListener("click",i.onBodyClick,!1)),!0}})),Go(Uo(i),"onMouseUp",(function(e){var t=Uo(i),n=t.player,r=t.config,o=t.pos,a=t.playerConfig,s=t._state,c=t.root;e.stopPropagation(),e.preventDefault(),Ww.checkIsFunction(a.enableSwipeHandler)&&a.enableSwipeHandler(),Ww.checkIsFunction(r.onMoveEnd)&&r.onMoveEnd(),Ww.event(e),Ww.removeClass(i.progressBtn,"active");var u=i.computeTime(e,o.x);u.prePlayTime=s.prePlayTime,o.moving?(i.triggerCallbacks("dragend",u,e),i.emitUserAction("drag","dragend",u)):(i.triggerCallbacks("click",u,e),i.emitUserAction("click","click",u)),i._mouseUpHandlerHook(e,u),o.moving=!1,o.isDown=!1,o.x=0,o.y=0,s.prePlayTime=0,s.time=0;var l=e.type;"touchend"===l||"touchcancel"===l?(c.removeEventListener("touchmove",i.onMouseMove),c.removeEventListener("touchend",i.onMouseUp),c.removeEventListener("touchcancel",i.onMouseUp),i.blur()):(c.ownerDocument.removeEventListener("mousemove",i.onMouseMove,!1),c.ownerDocument.removeEventListener("mouseup",i.onMouseUp,!1),n.root.removeEventListener("click",i.onBodyClick,!1),o.isEnter?"mobile"!==a.isMobileSimulateMode&&i.bind("mousemove",i.onMoveOnly):i.onMouseLeave(e)),Ww.setTimeout(Uo(i),(function(){i.resetSeekState()}),10),n.focus()})),Go(Uo(i),"onMouseMove",(function(e){var t=Uo(i),n=t._state,r=t.pos,o=t.player,a=t.config;Ww.checkTouchSupport()&&e.preventDefault(),Ww.event(e);var s=Ww.getEventPos(e,o.zoom),c=90===o.rotateDeg?s.clientY:s.clientX,u=Math.abs(r.x-c);if(!(r.moving&&u<a.miniMoveStep||!r.moving&&u<a.miniStartStep)){r.x=c;var l=i.computeTime(e,c);l.prePlayTime=n.prePlayTime,i._mouseMoveHandlerHook(e,l)}})),Go(Uo(i),"onMouseOut",(function(e){i.triggerCallbacks("mouseout",null,e)})),Go(Uo(i),"onMouseOver",(function(e){i.triggerCallbacks("mouseover",null,e)})),Go(Uo(i),"onMouseEnter",(function(e){var t=Uo(i),n=t.player,r=t.pos;if(!(r.isDown||r.isEnter||n.isMini||!n.config.allowSeekAfterEnded&&n.ended)){r.isEnter=!0,i.bind("mousemove",i.onMoveOnly),i.bind("mouseleave",i.onMouseLeave),Ww.event(e);var o=Ww.getEventPos(e,n.zoom),a=90===n.rotateDeg?o.clientY:o.clientX,s=i.computeTime(e,a);i.triggerCallbacks("mouseenter",s,e),i.focus()}})),Go(Uo(i),"onMouseLeave",(function(e){i.triggerCallbacks("mouseleave",null,e),i.unlock(),i._updateInnerFocus(null),i.triggerCallbacks("mouseleaveFinished",null,e)})),Go(Uo(i),"onVideoResize",(function(){var e=i.pos,t=e.x,n=e.isDown;if(e.isEnter&&!n){var r=i.computeTime(null,t);i.onMoveOnly(null,r)}})),i.useable=!1,i.isProgressMoving=!1,i.__dragCallBacks=[],i._state={now:-1,direc:0,time:0,prePlayTime:-1},i._disableBlur=!1,i}return Fo(n,[{key:"duration",get:function(){return this.playerConfig.customDuration||this.player.duration}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"statistic",get:function(){return ST({hasActive:Ww.hasClass(this.root,"active"),disableBlur:this._disableBlur},this.pos||{})}},{key:"changeState",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.useable=e}},{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.progress&&(e.config.disable=!e.player.config.progress)}},{key:"_initInner",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t&&0!==t.length||(t=[{percent:1}]);var i=ST(ST({fragments:t},n),{},{actionCallback:function(t){e.emitUserAction("fragment_focus","fragment_focus",t)}});this.innerList?this.innerList.reset(i):(this.innerList=new CT(i),this.outer.insertBefore(this.innerList.render(),this.outer.children[0]),["findHightLight","unHightLight","setHightLight","findFragment"].map((function(t){e[t]=e.innerList[t].bind(e.innerList)})))}},{key:"_updateInnerFocus",value:function(e){this.innerList&&this.innerList.updateFocus(e)}},{key:"afterCreate",value:function(){var e=this;if(!this.config.disable&&!this.playerConfig.isLive){this.pos={x:0,y:0,moving:!1,isDown:!1,isEnter:!1},this.outer=this.find("xg-outer");var t=this.config,n=t.fragFocusClass,i=t.fragAutoFocus,r=t.fragClass;this._initInner(this.config.fragments,{fragFocusClass:n,fragAutoFocus:i,fragClass:r,style:this.playerConfig.commonStyle||{}}),"mobile"===$_.device&&(this.config.isDragingSeek=!1,this.isMobile=!0),this.progressBtn=this.find(".xgplayer-progress-btn"),this.on(r_,(function(){e.onMouseLeave()})),this.on(t_,(function(){e.onTimeupdate()})),this.on(e_,(function(){e.onTimeupdate(),e.onCacheUpdate()})),this.on(u_,(function(){e.onCacheUpdate()})),this.on($w,(function(){e.onCacheUpdate(!0),e.onTimeupdate(!0),e._state.now=0})),this.on(f_,(function(){e.onReset()})),this.on(I_,(function(){e.onVideoResize()})),this.on(j_,(function(){e.config.resetBlur&&e._disableBlur&&(e.enableBlur(),e.blur())})),this.bindDomEvents(),this.initCustomStyle()}}},{key:"setConfig",value:function(e){var t=this,n=null;Object.keys(e).forEach((function(i){t.config[i]=e[i],"fragments"===i&&(n=e[i])})),n&&this._initInner(n,e)}},{key:"initCustomStyle",value:function(){var e=(this.playerConfig||{}).commonStyle.sliderBtnStyle,t=this.progressBtn;e&&("string"==typeof e?t.style.boxShadow=e:"object"===Do(e)&&Object.keys(e).map((function(n){t.style[n]=e[n]})))}},{key:"triggerCallbacks",value:function(e,t,n){this.__dragCallBacks.length>0&&this.__dragCallBacks.map((function(i){if(i&&i.handler&&i.type===e)try{i.handler(t,n)}catch(e){console.error("[XGPLAYER][triggerCallbacks] ".concat(i," 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 n=this.__dragCallBacks,i=-1;n.map((function(n,r){n&&n.type===e&&n.handler===t&&(i=r)})),i>-1&&n.splice(i,1)}},{key:"unlock",value:function(){var e=this.player,t=this.pos;t.isEnter=!1,e.isMini||(this.unbind("mousemove",this.onMoveOnly),t.isDown?this.unbind("mouseleave",this.onMouseLeave):this.blur())}},{key:"bindDomEvents",value:function(){var e=this.player,t=e.controls,n=e.config;this._mouseDownHandlerHook=this.hook("dragstart",this._mouseDownHandler),this._mouseUpHandlerHook=this.hook("dragend",this._mouseUpHandler),this._mouseMoveHandlerHook=this.hook("drag",this._mouseMoveHandler),"touch"!==this.domEventType&&"compatible"!==this.domEventType||(this.root.addEventListener("touchstart",this.onMouseDown),t&&(t.root&&t.root.addEventListener("touchmove",Ww.stopPropagation),t.center&&t.center.addEventListener("touchend",Ww.stopPropagation))),"mouse"!==this.domEventType&&"compatible"!==this.domEventType||(this.bind("mousedown",this.onMouseDown),"mobile"!==n.isMobileSimulateMode&&this.bind("mouseenter",this.onMouseEnter),this.bind("mouseover",this.onMouseOver),this.bind("mouseout",this.onMouseOut))}},{key:"focus",value:function(){this.player.controls.pauseAutoHide(),Ww.addClass(this.root,"active")}},{key:"blur",value:function(){this._disableBlur||(this.player.controls.recoverAutoHide(),Ww.removeClass(this.root,"active"))}},{key:"disableBlur",value:function(){this._disableBlur=!0}},{key:"enableBlur",value:function(){this._disableBlur=!1}},{key:"updateWidth",value:function(e,t,n){var i=this.config,r=this.player;if(!i.isCloseClickSeek||0!==n){var o=e>=r.duration?r.duration-i.endedDiff:Number(e).toFixed(1);this.updatePercent(t),this.updateTime(e),(1!==n||i.isDragingSeek&&"audio"!==r.videoConfig.mediaType)&&(this._state.now=o,this._state.direc=o>r.currentTime?0:1,r.seek(o))}}},{key:"computeTime",value:function(e,t){var n,i,r=this.player,o=this.root.getBoundingClientRect(),a=o.width,s=o.height,c=o.top,u=o.left,l=t;90===r.rotateDeg?(n=s,i=c):(n=a,i=u);var f=l-i,h=(f=f>n?n:f<0?0:f)/n;return{percent:h=h<0?0:h>1?1:h,currentTime:parseInt(h*this.duration*1e3,10)/1e3,offset:f,width:n,left:i,e:e}}},{key:"updateTime",value:function(e){var t=this.player,n=this.duration;e>n?e=n:e<0&&(e=0);var i=t.plugins.time;i&&i.updateTime(e)}},{key:"resetSeekState",value:function(){this.isProgressMoving=!1;var e=this.player.plugins.time;e&&e.resetActive()}},{key:"updatePercent",value:function(e,t){if(this.isProgressMoving=!0,!this.config.disable){e=e>1?1:e<0?0:e,this.progressBtn.style.left="".concat(100*e,"%"),this.innerList.update({played:e*this.duration},this.duration);var n=this.player.plugins.miniprogress;n&&n.update({played:e*this.duration},this.duration)}}},{key:"onTimeupdate",value:function(e){var t=this.player,n=this._state,i=this.duration;if(!(t.isSeeking&&t.video.seeking||this.isProgressMoving)&&t.hasStart){if(n.now>-1){var r=parseInt(1e3*n.now,10)-parseInt(1e3*t.currentTime,10);if(0===n.direc&&r>300||1===n.direc&&r>-300)return void(n.now=-1);n.now=-1}var o=this.timeOffset+t.currentTime;o=Ww.adjustTimeByDuration(o,i,e),this.innerList.update({played:o},i),this.progressBtn.style.left="".concat(o/i*100,"%");var a=this.player.plugins.miniprogress;a&&a.update({played:o},i)}}},{key:"onCacheUpdate",value:function(e){var t=this.player,n=this.duration;if(t){var i=t.bufferedPoint.end;i=Ww.adjustTimeByDuration(i,n,e),this.innerList.update({cached:i},n);var r=this.player.plugins.miniprogress;r&&r.update({cached:i},n)}}},{key:"onReset",value:function(){this.innerList.update({played:0,cached:0},0);var e=this.player.plugins.miniprogress;e&&e.update({cached:0,played:0},0)}},{key:"destroy",value:function(){var e=this.player,t=e.controls;this.thumbnailPlugin=null,this.innerList.destroy(),this.innerList=null;var n=this.domEventType;"touch"!==n&&"compatible"!==n||(this.root.removeEventListener("touchstart",this.onMouseDown),this.root.removeEventListener("touchmove",this.onMouseMove),this.root.removeEventListener("touchend",this.onMouseUp),t&&(t.root&&t.root.removeEventListener("touchmove",Ww.stopPropagation),t.center&&t.center.removeEventListener("touchend",Ww.stopPropagation))),"mouse"!==n&&"compatible"!==n||(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,!1))}},{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:MC.CONTROLS_CENTER,index:0,disable:!1,isDragingSeek:!0,closeMoveSeek:!1,isPauseMoving:!1,isCloseClickSeek:!1,fragments:[{percent:1}],fragFocusClass:ET.POINT,fragClass:"",fragAutoFocus:!1,miniMoveStep:5,miniStartStep:2,onMoveStart:function(){},onMoveEnd:function(){},endedDiff:.2,resetBlur:!1}}},{key:"FRAGMENT_FOCUS_CLASS",get:function(){return ET}}]),n}(HC),RT=PT;function OT(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var IT=function(e){Ho(n,e);var t=OT(n);function n(){var e;Bo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Uo(e=t.call.apply(t,[this].concat(r))),"_onMouseenter",(function(t){e.emit("icon_mouseenter",{pluginName:e.pluginName})})),Go(Uo(e),"_onMouseLeave",(function(t){e.emit("icon_mouseleave",{pluginName:e.pluginName})})),e}return Fo(n,[{key:"afterCreate",value:function(){this.bind("mouseenter",this._onMouseenter),this.bind("mouseleave",this._onMouseLeave),this.config.disable&&this.disable()}},{key:"destroy",value:function(){this.unbind("mouseenter",this._onMouseenter),this.unbind("mouseleave",this._onMouseLeave)}}]),n}(HC);function LT(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var AT=function(e){Ho(n,e);var t=LT(n);function n(){var e;Bo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Uo(e=t.call.apply(t,[this].concat(r))),"btnClick",(function(t){var n=Uo(e),i=n.player;if(!n.config.disable)return t.preventDefault(),t.stopPropagation(),e.emitUserAction(t,"switch_play_pause"),i.ended?i.replay():i.paused&&!i.isBufferControlPaused?(i.play(),e.animate(!1)):(i.pause(),e.animate(!0)),!1})),e}return Fo(n,[{key:"afterCreate",value:function(){var e=this;uu(Vo(n.prototype),"afterCreate",this).call(this);var t=this.player;this.initIcons(),this.bind(["touchend","click"],this.btnClick),this.on([Jw,f_,qw],(function(){e.animate(t.paused)})),this.on(C_,(function(){e.animate(t.paused)})),this.animate(this.player.paused)}},{key:"registerIcons",value:function(){return{play:{icon:Gx,class:"xg-icon-play"},pause:{icon:Kx,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){var t=this.i18nKeys,n=this.player;e&&n.isBufferControlPaused||(e?(this.setAttr("data-state","pause"),this.changeLangTextKey(this.find(".xg-tips"),t.PLAY_TIPS)):(this.setAttr("data-state","play"),this.changeLangTextKey(this.find(".xg-tips"),t.PAUSE_TIPS)))}},{key:"destroy",value:function(){uu(Vo(n.prototype),"destroy",this).call(this),this.unbind(["touchend","click"],this.btnClick)}},{key:"render",value:function(){return'<xg-icon class="xgplayer-play">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys.PLAY_TIPS,'">').concat(this.i18n.PLAY_TIPS,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"play"}},{key:"defaultConfig",get:function(){return{position:MC.CONTROLS_LEFT,index:0,disable:!1}}}]),n}(IT),DT=AT;function MT(){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}function NT(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var FT=function(e){Ho(n,e);var t=NT(n);function n(){return Bo(this,n),t.apply(this,arguments)}return Fo(n,[{key:"afterCreate",value:function(){var e=this;this.initIcons(),this.onClick=function(t){t.preventDefault(),t.stopPropagation(),e.config.onClick(t)},this.bind(["click","touchend"],this.onClick)}},{key:"registerIcons",value:function(){return{screenBack:{icon:MT,class:"xg-fullscreen-back"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(this.root,e.screenBack)}},{key:"show",value:function(){Ww.addClass(this.root,"show")}},{key:"hide",value:function(){Ww.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:MC.ROOT_TOP,index:0}}}]),n}(HC);function BT(){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 jT(){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}function HT(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var UT=function(e){Ho(n,e);var t=HT(n);function n(){var e;Bo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Uo(e=t.call.apply(t,[this].concat(r))),"_onOrientationChange",(function(t){e.player.fullscreen&&e.config.rotateFullscreen&&(90===window.orientation||-90===window.orientation?e.setRotateDeg(0):e.setRotateDeg(90))})),e}return Fo(n,[{key:"afterCreate",value:function(){var e=this;uu(Vo(n.prototype),"afterCreate",this).call(this);var t=this.config,i=this.playerConfig;t.target&&(this.playerConfig.fullscreenTarget=this.config.target);var r=Ww.getFullScreenEl();i.fullscreenTarget===r&&this.player.getFullscreen().catch((function(){})),this.initIcons(),this.handleFullscreen=this.hook("fullscreen_change",this.changeFullScreen,{pre:function(t){e.config.disable||e.emitUserAction(t,"switch_fullscreen",{fullscreen:e.player.fullscreen})}}),this.bind(".xgplayer-fullscreen",["touchend","click"],this.handleFullscreen),this.on(T_,(function(t){e.changeLangTextKey(e.find(".xg-tips"),t?e.i18nKeys.EXITFULLSCREEN_TIPS:e.i18nKeys.FULLSCREEN_TIPS),e.animate(t),e.config.needBackIcon&&e.show()})),this.config.needBackIcon&&(this.topBackIcon=this.player.registerPlugin({plugin:FT,options:{config:{onClick:function(t){e.handleFullscreen(t)}}}})),"mobile"===$_.device&&window.addEventListener("orientationchange",this._onOrientationChange)}},{key:"registerIcons",value:function(){return{fullscreen:{icon:BT,class:"xg-get-fullscreen"},exitFullscreen:{icon:jT,class:"xg-exit-fullscreen"}}}},{key:"destroy",value:function(){uu(Vo(n.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon","mobile"===$_.device?"touchend":"click",this.handleFullscreen),"mobile"===$_.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:"setRotateDeg",value:function(e){var t=this.player;90===window.orientation||-90===window.orientation?t.rotateDeg=0:t.rotateDeg=e}},{key:"getRotateFullscreen",value:function(e){var t=this.player;t.isCssfullScreen&&t.exitCssFullscreen(e);var n=e?QC.INNER_FULLSCREEN:QC.ROTATE_FULLSCREEN;t._fullscreenEl=e||t.root,t.changeFullStyle(t.root,e,n,QC.PARENT_ROTATE_FULLSCREEN),t.fullscreen=!0,this.setRotateDeg(90),this.emit(T_,!0)}},{key:"exitRotateFullscreen",value:function(e){var t=this.player;t.fullscreen=!1;var n=t._fullscreenEl!==t.root?QC.INNER_FULLSCREEN:QC.ROTATE_FULLSCREEN;t.recoverFullStyle(t.root,t._fullscreenEl,n,QC.PARENT_ROTATE_FULLSCREEN),this.setRotateDeg(0),this.emit(T_,!1)}},{key:"changeFullScreen",value:function(e){var t=this.player,n=this.config;if(!n.disable){e&&(e.preventDefault(),e.stopPropagation());var i=!1;if((!0===n.useCssFullscreen||"function"==typeof n.useCssFullscreen&&n.useCssFullscreen())&&(i=!0),i)t.fullscreen?(t.fullscreen=!1,t.exitCssFullscreen(),this.emit(T_,!1)):(t.fullscreen=!0,t.getCssFullscreen(),this.emit(T_,!0)),this.animate(t.fullscreen);else if(n.rotateFullscreen)t.fullscreen?this.exitRotateFullscreen():this.getRotateFullscreen(),this.animate(t.fullscreen);else{if(n.switchCallback&&"function"==typeof n.switchCallback)return void n.switchCallback(t.fullscreen);t.fullscreen?t.exitFullscreen():t.getFullscreen().catch((function(){}))}}}},{key:"animate",value:function(e){e?this.setAttr("data-state","full"):this.setAttr("data-state","normal"),this.topBackIcon&&(e?(this.topBackIcon.show(),this.hide()):(this.topBackIcon.hide(),this.show()))}},{key:"show",value:function(){uu(Vo(n.prototype),"show",this).call(this)}},{key:"hide",value:function(){uu(Vo(n.prototype),"hide",this).call(this)}},{key:"render",value:function(){var e="FULLSCREEN_TIPS";return'<xg-icon class="xgplayer-fullscreen">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys[e],'">').concat(this.i18n[e],"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"fullscreen"}},{key:"defaultConfig",get:function(){return{position:MC.CONTROLS_RIGHT,index:0,useCssFullscreen:!1,rotateFullscreen:!1,switchCallback:null,target:null,disable:!1,needBackIcon:!1}}}]),n}(IT);function WT(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var VT=function(e){Ho(n,e);var t=WT(n);function n(e){var i;return Bo(this,n),(i=t.call(this,e)).isActiving=!1,i.state={currentTime:0,duration:0},i}return Fo(n,[{key:"duration",get:function(){var e,t;return(null===(e=this.playerConfig)||void 0===e?void 0:e.customDuration)||(null===(t=this.player)||void 0===t?void 0:t.duration)||0}},{key:"timeOffset",get:function(){var e;return(null===(e=this.playerConfig)||void 0===e?void 0:e.timeOffset)||0}},{key:"afterCreate",value:function(){var e=this,t=this.player.controls.config.mode;this.mode="flex"===t?"flex":"normal",this.config.disable||("flex"===this.mode&&(this.createCenterTime(),this.hide()),this.durationDom=this.find(".time-duration"),this.timeDom=this.find(".time-current"),this.on([r_,e_,t_],(function(t){"durationchange"===t.eventName&&(e.isActiving=!1),e.onTimeUpdate()})),this.on($w,(function(){e.onTimeUpdate(!0)})),this.on(f_,(function(){e.onReset()})))}},{key:"afterPlayerInit",value:function(){var e,t=this.config;this.state={currentTime:0,duration:0},this.duration===1/0||null!==(e=this.playerConfig)&&void 0!==e&&e.isLive?(Ww.hide(this.durationDom),Ww.hide(this.timeDom),Ww.hide(this.find(".time-separator")),Ww.show(this.find(".time-live-tag"))):Ww.hide(this.find(".time-live-tag")),t.hide?this.hide():this.show()}},{key:"show",value:function(){"flex"!==this.mode&&uu(Vo(n.prototype),"show",this).call(this)}},{key:"onTimeUpdate",value:function(e){var t=this.player,n=this.config,i=this.duration;if(t&&t.hasStart&&!n.disable&&!this.isActiving){var r="flex"===this.mode?this.centerCurDom:this.timeDom,o="flex"===this.mode?this.centerDurDom:this.durationDom,a=!1,s=!1,c=t.currentTime+this.timeOffset;c=Ww.adjustTimeByDuration(c,i,e);var u=Ww.format(c);this.state.currentTime!==u&&(this.state.currentTime=u,a=!0),this.state.duration!==i&&(this.state.duration=i,s=!0),n.smartRender?(a&&(r.textContent=u),s&&i!==1/0&&i>0&&(o.textContent=Ww.format(i))):(r.innerHTML=u,i!==1/0&&i>0&&(o.innerHTML=Ww.format(i)))}}},{key:"onReset",value:function(){var e="flex"===this.mode?this.centerCurDom:this.timeDom,t="flex"===this.mode?this.centerDurDom:this.durationDom;this.config.smartRender?(this.state.currentTime=0,this.state.duration=0,e.textContent=Ww.format(0),t.textContent=Ww.format(0)):(e.innerHTML=Ww.format(0),t.innerHTML=Ww.format(0))}},{key:"createCenterTime",value:function(){var e=this.player;if(e.controls&&e.controls.center){var t=e.controls.center;this.centerCurDom=Ww.createDom("xg-icon","00:00",{},"xgplayer-time left"),this.centerDurDom=Ww.createDom("xg-icon","00:00",{},"xgplayer-time right"),t.children.length>0?t.insertBefore(this.centerCurDom,t.children[0]):t.appendChild(this.centerCurDom),t.appendChild(this.centerDurDom)}}},{key:"changeLiveState",value:function(e){e?(Ww.hide(this.durationDom),Ww.hide(this.timeDom),Ww.hide(this.find(".time-separator")),Ww.show(this.find(".time-live-tag"))):(Ww.hide(this.find(".time-live-tag")),Ww.show(this.find(".time-separator")),Ww.show(this.durationDom),Ww.show(this.timeDom))}},{key:"updateTime",value:function(e){if(this.isActiving=!0,!(!e&&0!==e||e>this.duration)){var t="flex"===this.mode?this.centerCurDom:this.timeDom;this.config.smartRender?(this.state.currentTime=e,t.textContent=Ww.format(e)):t.innerHTML=Ww.format(e)}}},{key:"resetActive",value:function(){var e=this,t=this.player,n=function(){e.isActiving=!1};this.off(e_,n),t.isSeeking&&t.video.seeking?this.once(e_,n):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:MC.CONTROLS_LEFT,index:2,disable:!1,smartRender:!1}}}]),n}(HC);function GT(){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 KT(){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 zT(){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}function YT(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var qT=function(e){Ho(n,e);var t=YT(n);function n(){var e;Bo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Uo(e=t.call.apply(t,[this].concat(r))),"onBarMousedown",(function(t){var n=Uo(e).player,i=e.find(".xgplayer-bar");Ww.event(t);var r=i.getBoundingClientRect(),o=Ww.getEventPos(t,n.zoom),a=r.height-(o.clientY-r.top);if(o.h=a,o.barH=r.height,e.pos=o,!(a<-2))return e.updateVolumePos(a,t),document.addEventListener("mouseup",e.onBarMouseUp),e._d.isStart=!0,!1})),Go(Uo(e),"onBarMouseMove",(function(t){var n=Uo(e)._d;if(n.isStart){var i=Uo(e),r=i.pos,o=i.player;t.preventDefault(),t.stopPropagation(),Ww.event(t);var a=Ww.getEventPos(t,o.zoom);n.isMoving=!0;var s=r.h-a.clientY+r.clientY;s>r.barH||e.updateVolumePos(s,t)}})),Go(Uo(e),"onBarMouseUp",(function(t){Ww.event(t),document.removeEventListener("mouseup",e.onBarMouseUp);var n=Uo(e)._d;n.isStart=!1,n.isMoving=!1})),Go(Uo(e),"onMouseenter",(function(t){e._d.isActive=!0,e.focus(),e.emit("icon_mouseenter",{pluginName:e.pluginName})})),Go(Uo(e),"onMouseleave",(function(t){e._d.isActive=!1,e.unFocus(100,!1,t),e.emit("icon_mouseleave",{pluginName:e.pluginName})})),Go(Uo(e),"onVolumeChange",(function(t){if(e.player){var n=e.player,i=n.muted,r=n.volume;e._d.isMoving||(e.find(".xgplayer-drag").style.height=i||0===r?"4px":"".concat(100*r,"%"),e.config.showValueLabel&&e.updateVolumeValue()),e.animate(i,r)}})),Go(Uo(e),"onIconHandle",(function(t){e.changeMutedHandler(t)})),e}return Fo(n,[{key:"registerIcons",value:function(){return{volumeSmall:{icon:KT,class:"xg-volume-small"},volumeLarge:{icon:GT,class:"xg-volume"},volumeMuted:{icon:zT,class:"xg-volume-mute"}}}},{key:"afterCreate",value:function(){var e=this;this._timerId=null,this._d={isStart:!1,isMoving:!1,isActive:!1},this.initIcons();var t=this.playerConfig,n=t.commonStyle,i=t.volume;n.volumeColor&&(this.find(".xgplayer-drag").style.backgroundColor=n.volumeColor),this.changeMutedHandler=this.hook("mutedChange",(function(t){e.changeMuted(t)}),{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this._onMouseenterHandler=this.hook("mouseenter",this.onMouseenter),this._onMouseleaveHandler=this.hook("mouseleave",this.onMouseleave),("mobile"!==$_.device&&"mobile"!==this.playerConfig.isMobileSimulateMode||"compatible"===this.domEventType)&&(this.bind("mouseenter",this._onMouseenterHandler),this.bind(["blur","mouseleave"],this._onMouseleaveHandler),this.bind(".xgplayer-slider",["mousedown","touchstart"],this.onBarMousedown),this.bind(".xgplayer-slider",["mousemove","touchmove"],this.onBarMouseMove),this.bind(".xgplayer-slider",["mouseup","touchend"],this.onBarMouseUp)),this.bind(".xgplayer-icon",["touchend","click"],this.onIconHandle),this.on(o_,this.onVolumeChange),this.once(a_,this.onVolumeChange),("Number"!==Ww.typeOf(i)||i<0||i>1)&&(this.player.volume=this.config.default),this.onVolumeChange(),this.config.disable&&this.disable()}},{key:"updateVolumePos",value:function(e,t){var n=this.player,i=this.find(".xgplayer-drag"),r=this.find(".xgplayer-bar");if(r&&i){var o=Math.max(Math.min(e/r.getBoundingClientRect().height,1),0),a=parseInt(1e3*o,10),s=a/1e3,c={volume:{from:n.volume,to:s}};i.style.height="".concat(100*o,"%"),n.muted&&(c.muted={from:!0,to:!1}),this.emitUserAction(t,"change_volume",{muted:n.muted,volume:n.volume,props:c}),n.volume=Math.max(Math.min(a/1e3,1),0),n.muted&&(n.muted=!1),this.config.showValueLabel&&this.updateVolumeValue()}}},{key:"updateVolumeValue",value:function(){var e=this.player,t=e.volume,n=e.muted,i=this.find(".xgplayer-value-label"),r=Math.max(Math.min(t,1),0);i.innerText=n?0:Math.round(100*r)}},{key:"focus",value:function(){var e=this.player;this.config.disable||(e.focus({autoHide:!1}),this._timerId&&(Ww.clearTimeout(this,this._timerId),this._timerId=null),Ww.addClass(this.root,"slide-show"))}},{key:"unFocus",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2?arguments[2]:void 0,r=this._d,o=this.player;r.isActive||(this._timerId&&(Ww.clearTimeout(this,this._timerId),this._timerId=null),this._timerId=Ww.setTimeout(this,(function(){r.isActive||(n?o.blur():o.focus(),Ww.removeClass(e.root,"slide-show"),r.isStart&&e.onBarMouseUp(i)),e._timerId=null}),t))}},{key:"changeMuted",value:function(e){if(!this.config.disable){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&&(Ww.clearTimeout(this,this._timerId),this._timerId=null),this.unbind("mouseenter",this.onMouseenter),this.unbind(["blur","mouseleave"],this.onMouseleave),this.unbind(".xgplayer-slider",["mousedown","touchstart"],this.onBarMousedown),this.unbind(".xgplayer-slider",["mousemove","touchmove"],this.onBarMouseMove),this.unbind(".xgplayer-slider",["mouseup","touchend"],this.onBarMouseUp),document.removeEventListener("mouseup",this.onBarMouseUp),this.unbind(".xgplayer-icon","mobile"===$_.device?"touchend":"click",this.onIconHandle)}},{key:"render",value:function(){var e=this.config.default||this.player.volume,t=this.config.showValueLabel;return'\n <xg-icon class="xgplayer-volume" data-state="normal">\n <div class="xgplayer-icon">\n </div>\n <xg-slider class="xgplayer-slider">\n '.concat(t?'<div class="xgplayer-value-label">'.concat(100*e,"</div>"):"",'\n <div class="xgplayer-bar">\n <xg-drag class="xgplayer-drag" style="height: ').concat(100*e,'%"></xg-drag>\n </div>\n </xg-slider>\n </xg-icon>')}}],[{key:"pluginName",get:function(){return"volume"}},{key:"defaultConfig",get:function(){return{position:MC.CONTROLS_RIGHT,index:1,disable:!1,showValueLabel:!1,default:.6,miniVolume:.2}}}]),n}(HC),XT=qT;function $T(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="-4 -6 40 40" fill="none">\n <g clip-path="url(#clip0)">\n <path transform="scale(1.5 1.5)" d="M11.6665 9.16663H4.1665C2.78579 9.16663 1.6665 10.2859 1.6665 11.6666V15.8333C1.6665 17.214 2.78579 18.3333 4.1665 18.3333H11.6665C13.0472 18.3333 14.1665 17.214 14.1665 15.8333V11.6666C14.1665 10.2859 13.0472 9.16663 11.6665 9.16663Z" fill="white"/>\n <path transform="scale(1.5 1.5)" fill-rule="evenodd" clip-rule="evenodd" d="M3.88148 4.06298C3.75371 4.21005 3.67667 4.40231 3.67749 4.61242C3.67847 4.87253 3.79852 5.10435 3.98581 5.25646L6.99111 8.05895C7.32771 8.37283 7.85502 8.35443 8.16891 8.01782C8.48279 7.68122 8.46437 7.15391 8.12778 6.84003L6.62061 5.43457L9.8198 5.4224C9.82848 5.42239 9.8372 5.42221 9.84591 5.4219C10.9714 5.38233 12.0885 5.6285 13.0931 6.13744C14.0976 6.64635 14.957 7.40148 15.5908 8.33234C16.2246 9.2632 16.6122 10.3394 16.7177 11.4606C16.823 12.5819 16.6427 13.7115 16.1934 14.7442C16.0098 15.1661 16.203 15.6571 16.6251 15.8408C17.0471 16.0243 17.5381 15.8311 17.7216 15.4091C18.2833 14.1183 18.5087 12.7063 18.3771 11.3047C18.2453 9.90318 17.7607 8.55792 16.9684 7.39433C16.1761 6.23073 15.1021 5.28683 13.8463 4.65065C12.5946 4.01651 11.203 3.70872 9.80072 3.75583L6.43415 3.76862L7.96326 2.12885C8.27715 1.79225 8.25872 1.26494 7.92213 0.951061C7.58553 0.63718 7.05822 0.655585 6.74433 0.99219L3.90268 4.0395C3.89545 4.04724 3.88841 4.05509 3.88154 4.06303L3.88148 4.06298Z" fill="white"/>\n </g>\n <defs>\n <clipPath id="clip0">\n <rect width="40" height="40" fill="white"/>\n </clipPath>\n </defs>\n</svg>\n',"image/svg+xml").firstChild}function JT(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var ZT=function(e){Ho(n,e);var t=JT(n);function n(e){var i;return Bo(this,n),Go(Uo(i=t.call(this,e)),"onBtnClick",(function(e){i.config.disable||(e.preventDefault(),e.stopPropagation(),i.emitUserAction(e,"rotate"),i.rotate(i.config.clockwise,i.config.innerRotate,1))})),i.rotateDeg=i.config.rotateDeg||0,i}return Fo(n,[{key:"afterCreate",value:function(){var e=this;if(!this.config.disable){uu(Vo(n.prototype),"afterCreate",this).call(this),this.appendChild(".xgplayer-icon",this.icons.rotate),this.bind(".xgplayer-icon",["click","touchend"],this.onBtnClick),this.on(I_,(function(){e.rotateDeg&&e.config.innerRotate&&Ww.setTimeout(e,(function(){e.updateRotateDeg(e.rotateDeg,e.config.innerRotate)}),100)}));var t=this.player.root;this.rootWidth=t.style.width||t.offsetWidth||t.clientWidth,this.rootHeight=t.style.height||t.offsetHeight||t.clientHeight,this.rotateDeg&&this.updateRotateDeg(this.rotateDeg,this.config.innerRotate)}}},{key:"destroy",value:function(){uu(Vo(n.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon",["click","touchend"],this.onBtnClick)}},{key:"updateRotateDeg",value:function(e,t){e||(e=0);var n=this.player,i=this.rootWidth,r=this.rootHeight;if(t)n.videoRotateDeg=e;else{var o=this.player,a=o.root,s=o.innerContainer,c=o.video,u=a.offsetWidth,l=s&&t?s.offsetHeight:a.offsetHeight,f=i,h=r,d=0,p=0;.75!==e&&.25!==e||(f="".concat(l,"px"),h="".concat(u,"px"),d=-(l-u)/2,p=-(u-l)/2);var v="translate(".concat(d,"px,").concat(p,"px) rotate(").concat(e,"turn)"),g={transformOrigin:"center center",transform:v,webKitTransform:v,height:h,width:f},y=t?c:a,m=t?n.getPlugin("poster"):null;Object.keys(g).map((function(e){y.style[e]=g[e],m&&m.root&&(m.root.style[e]=g[e])}))}}},{key:"rotate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=this.player;this.rotateDeg||(this.rotateDeg=0);var r=e?1:-1;this.rotateDeg=(this.rotateDeg+1+.25*r*n)%1,this.updateRotateDeg(this.rotateDeg,t),i.emit(A_,360*this.rotateDeg)}},{key:"registerIcons",value:function(){return{rotate:$T}}},{key:"render",value:function(){return'\n <xg-icon class="xgplayer-rotate">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys.ROTATE_TIPS,'">\n ').concat(this.i18n.ROTATE_TIPS,"\n </div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"rotate"}},{key:"defaultConfig",get:function(){return{position:MC.CONTROLS_RIGHT,index:6,innerRotate:!0,clockwise:!1,rotateDeg:0,disable:!1}}}]),n}(IT);function QT(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M16.5 4.3H3.5C3.38954 4.3 3.3 4.38954 3.3 4.5V15.5C3.3 15.6105 3.38954 15.7 3.5 15.7H8.50005L8.50006 17.5H3.5C2.39543 17.5 1.5 16.6046 1.5 15.5V4.5C1.5 3.39543 2.39543 2.5 3.5 2.5H16.5C17.6046 2.5 18.5 3.39543 18.5 4.5V8.5H16.7V4.5C16.7 4.38954 16.6105 4.3 16.5 4.3ZM12 11.5C11.4477 11.5 11 11.9477 11 12.5L11 16.5C11 17.0523 11.4478 17.5 12 17.5H17.5C18.0523 17.5 18.5 17.0523 18.5 16.5L18.5 12.5C18.5 11.9477 18.0523 11.5 17.5 11.5H12Z"\n fill="white" />\n</svg>',"image/svg+xml").firstChild}function eE(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M16.5 4.3H3.5C3.38954 4.3 3.3 4.38954 3.3 4.5V15.5C3.3 15.6105 3.38954 15.7 3.5 15.7H8.50005L8.50006 17.5H3.5C2.39543 17.5 1.5 16.6046 1.5 15.5V4.5C1.5 3.39543 2.39543 2.5 3.5 2.5H16.5C17.6046 2.5 18.5 3.39543 18.5 4.5V8.5H16.7V4.5C16.7 4.38954 16.6105 4.3 16.5 4.3ZM12 11.5C11.4477 11.5 11 11.9477 11 12.5L11 16.5C11 17.0523 11.4478 17.5 12 17.5H17.5C18.0523 17.5 18.5 17.0523 18.5 16.5L18.5 12.5C18.5 11.9477 18.0523 11.5 17.5 11.5H12Z"\n fill="white" />\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M9.4998 7.7C9.77595 7.7 9.9998 7.47614 9.9998 7.2V6.5C9.9998 6.22386 9.77595 6 9.4998 6H5.5402L5.52754 6.00016H5.5C5.22386 6.00016 5 6.22401 5 6.50016V10.4598C5 10.7359 5.22386 10.9598 5.5 10.9598H6.2C6.47614 10.9598 6.7 10.7359 6.7 10.4598V8.83005L8.76983 10.9386C8.96327 11.1357 9.27984 11.1386 9.47691 10.9451L9.97645 10.4548C10.1735 10.2613 10.1764 9.94476 9.983 9.7477L7.97289 7.7H9.4998Z"\n fill="white" />\n</svg>',"image/svg+xml").firstChild}var tE=fr,nE=fe,iE=k,rE=R,oE=ue,aE=Le,sE=Yo,cE=ha,uE=qi,lE=n.Symbol,fE=lE&&lE.prototype;if(nE&&oE(lE)&&(!("description"in fE)||void 0!==lE().description)){var hE={},dE=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:sE(arguments[0]),t=aE(fE,this)?new lE(e):void 0===e?lE():lE(e);return""===e&&(hE[t]=!0),t};uE(dE,lE),dE.prototype=fE,fE.constructor=dE;var pE="Symbol(test)"==String(lE("test")),vE=iE(fE.valueOf),gE=iE(fE.toString),yE=/^Symbol\((.*)\)[^)]+$/,mE=iE("".replace),kE=iE("".slice);cE(fE,"description",{configurable:!0,get:function(){var e=vE(this);if(rE(hE,e))return"";var t=gE(e),n=pE?kE(t,7,-1):mE(t,yE,"$1");return""===n?void 0:n}}),tE({global:!0,constructor:!0,forced:!0},{Symbol:dE})}function bE(e,t,n,i,r,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(i,r)}ba("iterator");var wE={exports:{}},_E={exports:{}};!function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(_E),function(e){var t=_E.exports.default;function n(){e.exports=n=function(){return i},e.exports.__esModule=!0,e.exports.default=e.exports;var i={},r=Object.prototype,o=r.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},c=s.iterator||"@@iterator",u=s.asyncIterator||"@@asyncIterator",l=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,i){var r=t&&t.prototype instanceof v?t:v,o=Object.create(r.prototype),s=new P(i||[]);return a(o,"_invoke",{value:x(e,n,s)}),o}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}i.wrap=h;var p={};function v(){}function g(){}function y(){}var m={};f(m,c,(function(){return this}));var k=Object.getPrototypeOf,b=k&&k(k(R([])));b&&b!==r&&o.call(b,c)&&(m=b);var w=y.prototype=v.prototype=Object.create(m);function _(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,n){function i(r,a,s,c){var u=d(e[r],e,a);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==t(f)&&o.call(f,"__await")?n.resolve(f.__await).then((function(e){i("next",e,s,c)}),(function(e){i("throw",e,s,c)})):n.resolve(f).then((function(e){l.value=e,s(l)}),(function(e){return i("throw",e,s,c)}))}c(u.arg)}var r;a(this,"_invoke",{value:function(e,t){function o(){return new n((function(n,r){i(e,t,n,r)}))}return r=r?r.then(o,o):o()}})}function x(e,t,n){var i="suspendedStart";return function(r,o){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===r)throw o;return O()}for(n.method=r,n.arg=o;;){var a=n.delegate;if(a){var s=S(a,n);if(s){if(s===p)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===i)throw i="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i="executing";var c=d(e,t,n);if("normal"===c.type){if(i=n.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i="completed",n.method="throw",n.arg=c.arg)}}}function S(e,t){var n=t.method,i=e.iterator[n];if(void 0===i)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var r=d(i,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,p;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function R(e){if(e){var t=e[c];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n<e.length;)if(o.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:O}}function O(){return{value:void 0,done:!0}}return g.prototype=y,a(w,"constructor",{value:y,configurable:!0}),a(y,"constructor",{value:g,configurable:!0}),g.displayName=f(y,l,"GeneratorFunction"),i.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},i.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,f(e,l,"GeneratorFunction")),e.prototype=Object.create(w),e},i.awrap=function(e){return{__await:e}},_(C.prototype),f(C.prototype,u,(function(){return this})),i.AsyncIterator=C,i.async=function(e,t,n,r,o){void 0===o&&(o=Promise);var a=new C(h(e,t,n,r),o);return i.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},_(w),f(w,l,"Generator"),f(w,c,(function(){return this})),f(w,"toString",(function(){return"[object Generator]"})),i.keys=function(e){var t=Object(e),n=[];for(var i in t)n.push(i);return n.reverse(),function e(){for(;n.length;){var i=n.pop();if(i in t)return e.value=i,e.done=!1,e}return e.done=!0,e}},i.values=R,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,i){return a.type="throw",a.arg=e,t.next=n,i&&(t.method="next",t.arg=void 0),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i],a=r.completion;if("root"===r.tryLoc)return n("end");if(r.tryLoc<=this.prev){var s=o.call(r,"catchLoc"),c=o.call(r,"finallyLoc");if(s&&c){if(this.prev<r.catchLoc)return n(r.catchLoc,!0);if(this.prev<r.finallyLoc)return n(r.finallyLoc)}else if(s){if(this.prev<r.catchLoc)return n(r.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return n(r.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&o.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var r=i;break}}r&&("break"===e||"continue"===e)&&r.tryLoc<=t&&t<=r.finallyLoc&&(r=null);var a=r?r.completion:{};return a.type=e,a.arg=t,r?(this.method="next",this.next=r.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 n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;E(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:R(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},i}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(wE);var CE=wE.exports(),xE=CE;try{regeneratorRuntime=CE}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=CE:Function("r","regeneratorRuntime = r")(CE)}var SE=Se,TE=$d,EE=Ma,PE=Pe,RE=T,OE=function(e,t,n,i){try{return i?t(SE(n)[0],n[1]):t(n)}catch(t){TE(e,"throw",t)}},IE=Ad,LE=Wr,AE=_i,DE=Zo,ME=zd,NE=jd,FE=Array,BE=function(e){var t=RE(e),n=LE(this),i=arguments.length,r=i>1?arguments[1]:void 0,o=void 0!==r;o&&(r=EE(r,i>2?arguments[2]:void 0));var a,s,c,u,l,f,h=NE(t),d=0;if(!h||this===FE&&IE(h))for(a=AE(t),s=n?new this(a):FE(a);a>d;d++)f=o?r(t[d],d):t[d],DE(s,d,f);else for(l=(u=ME(t,h)).next,s=n?new this:[];!(c=PE(l,u)).done;d++)f=o?OE(u,r,[c.value,d],!0):c.value,DE(s,d,f);return s.length=d,s},jE=BE;function HE(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return UE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return UE(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function UE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function WE(e){return new Promise((function(t){var n,i=document.createDocumentFragment(),r=[],o=[],a=0,s=HE(document.styleSheets);try{var c=function(){var e=n.value;try{var i=Array.from(e.cssRules);i.length>0&&r.push(i.map((function(e){return e.cssText})).join(""))}catch(n){if(e.href){var s=document.createElement("link");s.rel="stylesheet",s.type=e.type||"text/css",s.media=e.media.mediaText||"all",s.href=e.href,s.onload=function(){0===--a&&t()},s.onerror=function(){console.warn("Failed to load stylesheet: ".concat(s.href)),0===--a&&t()},o.push(s),a++}}};for(s.s();!(n=s.n()).done;)c()}catch(e){s.e(e)}finally{s.f()}if(o.forEach((function(e){return i.appendChild(e)})),r.length>0){var u=document.createElement("style");u.textContent=r.join("\n"),i.appendChild(u)}e.document.head.appendChild(i),0===a&&t()}))}fr({target:"Array",stat:!0,forced:!vp((function(e){Array.from(e)}))},{from:jE});var VE=function(){function e(){var t=this;Bo(this,e),Go(this,"_onLeave",(function(){var e,n;t.detachEl(),t.detachPlayer(),null===(e=t.currentOptions_)||void 0===e||null===(n=e.onLeave)||void 0===n||n.call(e),t.currentOptions_=null,t.window=null,t._isStandaloneWindow=!1})),Go(this,"_onBodyKeyDown",(function(e){var n,i,r,o,a=null===(n=t.currentOptions_)||void 0===n?void 0:n.player;null==a||null===(i=a.plugins)||void 0===i||null===(r=i.keyboard)||void 0===r||null===(o=r.onBodyKeyDown)||void 0===o||o.call(r,e)})),this.currentOptions_=null,this.currentElement_=null,this._window=null,this._isStandaloneWindow=!1}return Fo(e,[{key:"window",get:function(){return this._window},set:function(e){var t=this._window;t&&t===e||(t&&(t.removeEventListener("pagehide",this._onLeave),t.document.removeEventListener("keydown",this._onBodyKeyDown)),e&&(e.addEventListener("pagehide",this._onLeave),e.document.addEventListener("keydown",this._onBodyKeyDown)),this._window=e||null)}},{key:"isStandaloneWindow",get:function(){return this._isStandaloneWindow}},{key:"isSupported",value:function(){var e=/(metasr)/i.test(navigator.userAgent);return"documentPictureInPicture"in window&&/^(https|file)/.test(location.protocol)&&!e}},{key:"contains",value:function(e){var t;return!(null===(t=this.window)||void 0===t||!t.document.body.contains(e))}},{key:"requestWindow",value:function(e){var t=this,n=e.config,i=e.window,r=e.onEnter,o=e.onLeave,a=e.player;this.currentOptions_=e,this._isStandaloneWindow=!!n.alwaysKeepDocumentWindow;var s=new Promise((function(e){if(i)e(i);else{var t={};if(n.width&&n.height)t.width=n.width,t.height=n.height;else if(a){var r=a.root.getBoundingClientRect();t.width=r.width,t.height=r.height}"boolean"==typeof n.disallowReturnToOpener&&(t.disallowReturnToOpener=n.disallowReturnToOpener),"boolean"==typeof n.preferInitialWindowPlacement&&(t.preferInitialWindowPlacement=n.preferInitialWindowPlacement),n.docPiPTargetWindow?e(n.docPiPTargetWindow):documentPictureInPicture.requestWindow(t).then((function(t){e(t)}))}}));return s.then(function(){var e,i=(e=xE.mark((function e(i){var s,c,u,l,f,h;return xE.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=n.docPiPNode,c=n.docPiPStyle,u=s||(null==a?void 0:a.root)){e.next=4;break}return e.abrupt("return");case 4:return t.window=i,e.next=7,WE(i);case 7:l=document.createElement("style"),f=["body{padding:0; margin:0;}"],c?(h="","string"==typeof c?h=c:"function"==typeof c&&(h=c.call(n)),h&&f.push(h)):u===(null==a?void 0:a.root)&&f.push(".xgplayer{width: 100%!important; height: 100%!important;}"),l.textContent=f.join("\n"),i.document.head.append(l),t.attachPlayer(a,{element:u,window:i,onEnter:r,onLeave:o}),null==r||r({documentPictureInPictureWindow:i});case 14:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function a(e){bE(o,i,r,a,s,"next",e)}function s(e){bE(o,i,r,a,s,"throw",e)}a(void 0)}))});return function(e){return i.apply(this,arguments)}}()),s}},{key:"exit",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(e=this.window)||void 0===e||e.close(),t&&this._onLeave()}},{key:"attachEl",value:function(e){if(e&&this.window){var t=e.parentElement,n=e.nextSibling;this.window.document.body.append(e),this.currentElement_={element:e,parentNode:t,nextSibling:n}}}},{key:"detachEl",value:function(e){var t,n=this;if(this.currentElement_&&(!e||e===(null===(t=this.currentElement_)||void 0===t?void 0:t.element))){var i=this.currentElement_,r=i.element,o=i.parentNode,a=i.nextSibling;return o&&(o.isConnected?o.insertBefore(r,a):r.remove?r.remove():r.parentNode.removeChild(r)),Object.keys(this.currentElement_).forEach((function(e){n.currentElement_[e]=null})),this.currentElement_=null,r}}},{key:"attachPlayer",value:function(e,t){var n,i=t.element,r=t.window,o=t.onEnter,a=t.onLeave;this.window&&r!==this.window||(r&&(this.window=r),this.currentOptions_&&(o&&(this.currentOptions_.onEnter=o),a&&(this.currentOptions_.onLeave=a),e&&(this.currentOptions_.player=e)),i&&i!==(null===(n=this.currentElement_)||void 0===n?void 0:n.element)&&(this.detachEl(),this.attachEl(i)))}},{key:"detachPlayer",value:function(e){var t,n;e&&((null===(t=this.currentOptions_)||void 0===t?void 0:t.player)===e&&(this.currentOptions_.player=null),(null===(n=this.currentElement_)||void 0===n?void 0:n.element)===e.root&&this.detachEl())}}]),e}(),GE=new VE;function KE(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var zE="picture-in-picture",YE="inline",qE="fullscreen",XE=function(e){Ho(n,e);var t=KE(n);function n(){var e;Bo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Uo(e=t.call.apply(t,[this].concat(r))),"switchPIP",(function(t){if(!e.isPIPAvailable()||e.config.disable)return!1;t&&t instanceof Event&&t.stopPropagation(),e.isPip?(e.exitPIP(),e.emitUserAction(t,"change_pip",{from:"pip",to:"normal"}),e.setAttr("data-state","normal")):4===e.player.video.readyState&&(e.requestPIP(),e.emitUserAction(t,"change_pip",{from:"normal",to:"pip"}),e.setAttr("data-state","pip"))})),e}return Fo(n,[{key:"setConfig",value:function(e){var t=this;e&&(Object.keys(e).map((function(n){t.config[n]=e[n]})),this.canShow()&&!this.root&&this.reInitialize(),this._initState())}},{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.pip&&(e.config.showIcon=e.player.config.pip)}},{key:"afterCreate",value:function(){this.isPIPAvailable()&&(uu(Vo(n.prototype),"afterCreate",this).call(this),this.pMode=YE,this.pipWindow=null,this._initPipEvents(),this._initState({checkStyle:!0}))}},{key:"canShow",value:function(){return this.config.showIcon&&this.isPIPAvailable()}},{key:"_initState",value:function(){var e,t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.config.showIcon?(this.initIcons(),n.checkStyle&&this.show("",!1),null!==(e=this.player)&&void 0!==e&&e.isComplete?this._checkIcon():this.once(m_,(function(){return t._checkIcon()})),this.config.docPiPTargetWindow&&this.isDocPIPAvailable()&&this.requestPIP(),this.isPip&&this.setAttr("data-state","pip")):n.checkStyle&&this.hide()}},{key:"_checkIcon",value:function(){this.config.showIcon&&(Ww.removeClass(this.find(".xgplayer-icon"),"xg-icon-disable"),this.bind("click",this.switchPIP))}},{key:"registerIcons",value:function(){return{pipIcon:{icon:QT,class:"xg-get-pip"},pipIconExit:{icon:eE,class:"xg-exit-pip"}}}},{key:"initIcons",value:function(){var e=this.icons;this._isInitIcons||(this.appendChild(".xgplayer-icon",e.pipIcon),this.appendChild(".xgplayer-icon",e.pipIconExit),this._isInitIcons=!0)}},{key:"_initPipEvents",value:function(){var e=this,t=this.player;this.onBeforeFullscreenRequest=function(n){GE.contains(t.root)&&GE.detachEl(),e.exitPIP()},this.leavePIPCallback=function(){var n=t.paused;Ww.setTimeout(e,(function(){!n&&t.videoPlay()}),0),!n&&t.videoPlay(),e.setAttr("data-state","normal"),e.pipWindow=null,t.emit(L_,!1)},this.enterPIPCallback=function(n){e.setAttr("data-state","pip"),null!=n&&n.pictureInPictureWindow&&(e.pipWindow=n.pictureInPictureWindow),t.emit(L_,!0)},this.onWebkitpresentationmodechanged=function(n){var i=t.video.webkitPresentationMode;e.pMode===qE&&i!==qE&&t.onFullscreenChange(null,!1),e.pMode=i,i===zE?e.enterPIPCallback(n):i===YE&&e.leavePIPCallback(n)},t.on(S_,this.onBeforeFullscreenRequest),t.video&&(t.video.addEventListener("enterpictureinpicture",this.enterPIPCallback),t.video.addEventListener("leavepictureinpicture",this.leavePIPCallback),n.checkWebkitSetPresentationMode(t.video)&&t.video.addEventListener("webkitpresentationmodechanged",this.onWebkitpresentationmodechanged))}},{key:"requestPIP",value:function(e){var t=this.player,i=this.playerConfig,r=this.config;if(this.isPIPAvailable()&&!this.isPip)try{var o=i.poster;return o&&(t.video.poster="String"===Ww.typeOf(o)?o:o.poster),r.preferDocument&&this.isDocPIPAvailable()?GE.requestWindow({config:r,window:e,player:t,onEnter:this.enterPIPCallback,onLeave:this.leavePIPCallback}):n.checkWebkitSetPresentationMode(t.video)?t.video.webkitSetPresentationMode("picture-in-picture"):t.video.requestPictureInPicture(),!0}catch(e){return console.error("requestPiP",e),!1}}},{key:"exitPIP",value:function(){var e=this.player;try{return this.isPIPAvailable()&&this.isPip&&(this.isDocPIPAvailable()&&this.getDocumentWindow()?GE.exit():n.checkWebkitSetPresentationMode(e.video)?e.video.webkitSetPresentationMode("inline"):document.exitPictureInPicture()),!0}catch(e){return console.error("exitPIP",e),!1}}},{key:"isPip",get:function(){var e=this.player;return!(!this.isDocPIPAvailable()||!this.getDocumentWindow())||document.pictureInPictureElement&&document.pictureInPictureElement===e.video||e.video.webkitPresentationMode===zE}},{key:"isPIPAvailable",value:function(){var e=this.player.video;return("Boolean"!==Ww.typeOf(document.pictureInPictureEnabled)||document.pictureInPictureEnabled)&&("Boolean"===Ww.typeOf(e.disablePictureInPicture)&&!e.disablePictureInPicture||e.webkitSupportsPresentationMode&&"Function"===Ww.typeOf(e.webkitSetPresentationMode))||this.isDocPIPAvailable()}},{key:"isDocPIPAvailable",value:function(){return GE.isSupported()}},{key:"getWindow",value:function(){return this.pipWindow}},{key:"getDocumentWindow",value:function(){return GE.window}},{key:"attachDocumentWindow",value:function(e){var t,n=this.config.docPiPNode||(null===(t=this.player)||void 0===t?void 0:t.root);GE.attachPlayer(this.player,{element:n,window:e,onEnter:this.enterPIPCallback,onLeave:this.leavePIPCallback})}},{key:"destroy",value:function(){uu(Vo(n.prototype),"destroy",this).call(this);var e=this.player,t=!(this.isPip&&this.getDocumentWindow()&&GE.isStandaloneWindow);this.unbind("click",this.btnClick),e.off(S_,this.onBeforeFullscreenRequest),e.video.removeEventListener("enterpictureinpicture",this.enterPIPCallback),e.video.removeEventListener("leavepictureinpicture",this.leavePIPCallback),n.checkWebkitSetPresentationMode(e.video)&&e.video.removeEventListener("webkitpresentationmodechanged",this.onWebkitpresentationmodechanged),this.isPip&&this.getDocumentWindow()&&GE.detachPlayer(e),t&&this.exitPIP(),this.pipWindow=null,GE.isStandaloneWindow||(GE.window=null)}},{key:"render",value:function(){if(this.canShow())return'<xg-icon class="xgplayer-pip">\n <div class="xgplayer-icon xg-icon-disable">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys.PIP,'">').concat(this.i18n.PIP,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"pip"}},{key:"defaultConfig",get:function(){return{position:MC.CONTROLS_RIGHT,index:6,showIcon:!1,preferDocument:!1,width:void 0,height:void 0,docPiPTargetWindow:void 0,docPiPNode:void 0,docPiPStyle:void 0,alwaysKeepDocumentWindow:!1}}},{key:"checkWebkitSetPresentationMode",value:function(e){return"function"==typeof e.webkitSetPresentationMode}}]),n}(IT),$E=XE;function JE(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="40" viewBox="10 0 24 40">\n <path transform="scale(0.038 0.028)" d="M800 380v768h-128v-352l-320 320v-704l320 320v-352z"></path>\n</svg>\n',"image/svg+xml").firstChild}function ZE(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var QE=function(e){Ho(n,e);var t=ZE(n);function n(e){var i;return Bo(this,n),Go(Uo(i=t.call(this,e)),"playNext",(function(e){var t=Uo(i).player;e.preventDefault(),e.stopPropagation(),i.idx+1<i.config.urlList.length?(i.idx++,t.emit(M_,i.idx+1),i.nextHandler(i.config.urlList[i.idx],i.idx)):(i.nextHandler(),t.emit(M_))})),i.idx=-1,i}return Fo(n,[{key:"afterCreate",value:function(){this.config.urlList&&0!==this.config.urlList.length&&(this.appendChild(".xgplayer-icon",this.icons.playNext),this.initEvents())}},{key:"registerIcons",value:function(){return{playNext:JE}}},{key:"initEvents",value:function(){this.nextHandler=this.hook("playNext",this.changeSrc);var e="mobile"===$_.device?"touchend":"click";this.bind(e,this.playNext),this.show()}},{key:"changeSrc",value:function(e){var t=this.player;e&&(t.pause(),t.currentTime=0,t.autoplay=!0,t.src=e)}},{key:"destroy",value:function(){this.unbind(["touchend","click"],this.playNext)}},{key:"render",value:function(){if(this.config.urlList&&0!==this.config.urlList.length)return'\n <xg-icon class="xgplayer-playnext">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="PLAYNEXT_TIPS">'.concat(this.i18n.PLAYNEXT_TIPS,"</div>\n </xg-icon>\n ")}}],[{key:"pluginName",get:function(){return"playNext"}},{key:"defaultConfig",get:function(){return{position:MC.CONTROLS_LEFT,index:1,url:null,urlList:[]}}}]),n}(HC),eP={exports:{}};!function(e,t){e.exports=function e(t,n,i){var r,o,a=window,s="application/octet-stream",c=i||s,u=t,l=!n&&!i&&u,f=document.createElement("a"),h=function(e){return String(e)},d=a.Blob||a.MozBlob||a.WebKitBlob||h,p=n||"download";if(d=d.call?d.bind(a):Blob,"true"===String(this)&&(c=(u=[u,c])[0],u=u[1]),l&&l.length<2048&&(p=l.split("/").pop().split("?")[0],f.href=l,-1!==f.href.indexOf(l))){var v=new XMLHttpRequest;return v.open("GET",l,!0),v.responseType="blob",v.onload=function(t){e(t.target.response,p,s)},setTimeout((function(){v.send()}),0),v}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(u)){if(!(u.length>2096103.424&&d!==h))return navigator.msSaveBlob?navigator.msSaveBlob(k(u),p):b(u);c=(u=k(u)).type||s}else if(/([\x80-\xff])/.test(u)){for(var g=0,y=new Uint8Array(u.length),m=y.length;g<m;++g)y[g]=u.charCodeAt(g);u=new d([y],{type:c})}function k(e){for(var t=e.split(/[:;,]/),n=t[1],i=("base64"==t[2]?atob:decodeURIComponent)(t.pop()),r=i.length,o=0,a=new Uint8Array(r);o<r;++o)a[o]=i.charCodeAt(o);return new d([a],{type:n})}function b(e,t){if("download"in f)return f.href=e,f.setAttribute("download",p),f.className="download-js-link",f.innerHTML="downloading...",f.style.display="none",document.body.appendChild(f),setTimeout((function(){f.click(),document.body.removeChild(f),!0===t&&setTimeout((function(){a.URL.revokeObjectURL(f.href)}),250)}),66),!0;if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent))return/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,s)),window.open(e)||confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")&&(location.href=e),!0;var n=document.createElement("iframe");document.body.appendChild(n),!t&&/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,s)),n.src=e,setTimeout((function(){document.body.removeChild(n)}),333)}if(r=u instanceof d?u:new d([u],{type:c}),navigator.msSaveBlob)return navigator.msSaveBlob(r,p);if(a.URL)b(a.URL.createObjectURL(r),!0);else{if("string"==typeof r||r.constructor===h)try{return b("data:"+c+";base64,"+a.btoa(r))}catch(e){return b("data:"+c+","+encodeURIComponent(r))}(o=new FileReader).onload=function(e){b(this.result)},o.readAsDataURL(r)}return!0}}(eP);var tP=eP.exports;function nP(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24">\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g transform="translate(-488.000000, -340.000000)" fill="#FFFFFF">\n <g id="Group-2">\n <g id="volme_big-copy" transform="translate(488.000000, 340.000000)">\n <rect id="Rectangle-18" x="11" y="4" width="2" height="12" rx="1"></rect>\n <rect id="Rectangle-2" x="3" y="18" width="18" height="2" rx="1"></rect>\n <rect id="Rectangle-2" transform="translate(4.000000, 17.500000) rotate(90.000000) translate(-4.000000, -17.500000) " x="1.5" y="16.5" width="5" height="2" rx="1"></rect><rect id="Rectangle-2-Copy-3" transform="translate(20.000000, 17.500000) rotate(90.000000) translate(-20.000000, -17.500000) " x="17.5" y="16.5" width="5" height="2" rx="1"></rect>\n <path d="M9.48791171,8.26502656 L9.48791171,14.2650266 C9.48791171,14.8173113 9.04019646,15.2650266 8.48791171,15.2650266 C7.93562696,15.2650266 7.48791171,14.8173113 7.48791171,14.2650266 L7.48791171,7.26502656 C7.48791171,6.71274181 7.93562696,6.26502656 8.48791171,6.26502656 L15.4879117,6.26502656 C16.0401965,6.26502656 16.4879117,6.71274181 16.4879117,7.26502656 C16.4879117,7.81731131 16.0401965,8.26502656 15.4879117,8.26502656 L9.48791171,8.26502656 Z" id="Combined-Shape" transform="translate(11.987912, 10.765027) scale(1, -1) rotate(45.000000) translate(-11.987912, -10.765027) "></path>\n </g>\n </g>\n </g>\n </g>\n</svg>\n',"image/svg+xml").firstChild}function iP(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var rP=function(e){Ho(n,e);var t=iP(n);function n(e){var i;return Bo(this,n),Go(Uo(i=t.call(this,e)),"download",(function(e){if(!i.isLock&&!i.config.disable){i.emitUserAction(e,"download");var t=i.getAbsoluteURL(i.player.src);tP(t),i.isLock=!0,i.timer=window.setTimeout((function(){i.isLock=!1,window.clearTimeout(i.timer),i.timer=null}),300)}})),i.timer=null,i.isLock=!1,i}return Fo(n,[{key:"afterCreate",value:function(){uu(Vo(n.prototype),"afterCreate",this).call(this),this.config.disable||(this.appendChild(".xgplayer-icon",this.icons.download),this.bind(["click","touchend"],this.download))}},{key:"registerIcons",value:function(){return{download:nP}}},{key:"getAbsoluteURL",value:function(e){if(!e.match(/^https?:\/\//)){var t=document.createElement("div");t.innerHTML='<a href="'.concat(e,'">x</a>'),e=t.firstChild.href}return e}},{key:"destroy",value:function(){uu(Vo(n.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.download),window.clearTimeout(this.timer),this.timer=null}},{key:"render",value:function(){return'<xg-icon class="xgplayer-download">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys.DOWNLOAD_TIPS,'">').concat(this.i18n.DOWNLOAD_TIPS,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"download"}},{key:"defaultConfig",get:function(){return{position:MC.CONTROLS_RIGHT,index:3,disable:!0}}}]),n}(IT);function oP(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var aP=function(e){Ho(n,e);var t=oP(n);function n(){return Bo(this,n),t.apply(this,arguments)}return Fo(n,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.screenShot&&(e.config.disable=!e.player.config.screenShot)}},{key:"afterCreate",value:function(){uu(Vo(n.prototype),"afterCreate",this).call(this),this.createCanvas(),this.appendChild(".xgplayer-icon",this.icons.screenshotIcon);var e=this.config;this.initSize=function(t){e.fitVideo&&(e.width=t.vWidth,e.height=t.vHeight)},this.once(I_,this.initSize)}},{key:"onPluginsReady",value:function(){this.show(),this.onClickBtn=this.onClickBtn.bind(this),this.bind(["click","touchend"],this.onClickBtn)}},{key:"saveScreenShot",value:function(e,t){var n=document.createElement("a");n.href=e,n.download=t;var i=document.createEvent("MouseEvents");i.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),n.dispatchEvent(i)}},{key:"createCanvas",value:function(e,t){var n=document.createElement("canvas");this.canvasCtx=n.getContext("2d"),this.canvas=n,n.width=e||this.config.width,n.height=t||this.config.height,this.config.canvasAdded&&this.player.root.appendChild(n)}},{key:"onClickBtn",value:function(e){var t=this;e.preventDefault(),e.stopPropagation(),this.emitUserAction(e,"shot"),this.shot().then((function(e){t.emit(D_,e),t.saveScreenShot(e,t.config.name+t.config.format)}))}},{key:"shotArea",value:function(e,t,n,i){var r=this,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{quality:.92,type:"image/png"},a=this.config,s=this.player,c=o.quality||a.quality,u=o.type||a.type,l=s.video||s.media,f=this.canvas;return new Promise((function(o){var a=r.canvasCtx;f.width=n,f.height=i;var s,h={isContain:"contain"===(s=getComputedStyle(l)["object-fit"]),isCover:"cover"===s},d=h.isCover;if(h.isContain){var p=l.videoHeight/l.videoWidth,v=p;v=l.clientHeight/l.clientWidth>p?l.videoWidth/l.clientWidth:l.videoHeight/l.clientHeight,f.width=n,f.height=i,a.drawImage(l,e*v,t*v,n*v,i*v,0,0,n,i),o(f.toDataURL(u,c))}else if(d){var g=function(e,t,n,i){var r,o,a,s,c=e/t;return n/i>c?(s=i,r=(n-(a=i*c))*(arguments.length>4&&void 0!==arguments[4]?arguments[4]:.5),o=0):(a=n,r=0,o=(i-(s=n/c))*(arguments.length>5&&void 0!==arguments[5]?arguments[5]:.5)),{source:{x:r,y:o,width:a,height:s},destination:{x:0,y:0,width:e,height:t}}}(l.clientWidth,l.clientHeight,l.videoWidth,l.videoHeight),y=g.source,m=g.destination;f.width=m.width,f.height=m.height,a.drawImage(l,y.x,y.y,y.width,y.height,m.x,m.y,m.width,m.height);var k=f.toDataURL("image/png"),b=new Image(m.width,m.height);b.src=k,b.onload=function(){a.clearRect(0,0,f.width,f.height),f.width=n,f.height=i,a.drawImage(b,e,t,n,i,0,0,n,i),b.onload=null},a.drawImage(l,e,t,n,i,0,0,n,i),o(f.toDataURL(u,c))}}))}},{key:"shot",value:function(e,t){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{quality:.92,type:"image/png"},r=this.config,o=this.player,a=i.quality||r.quality,s=i.type||r.type;return new Promise((function(i,c){n.canvas?(n.canvas.width=e||r.width,n.canvas.height=t||r.height):n.createCanvas(e,t),n.canvasCtx.drawImage(o.video,0,0,e||r.width,t||r.height);var u=n.canvas.toDataURL(s,a).replace(s,"image/octet-stream");i(u=u.replace(/^data:image\/[^;]+/,"data:application/octet-stream"))}))}},{key:"registerIcons",value:function(){return{screenshotIcon:null}}},{key:"destroy",value:function(){uu(Vo(n.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.onClickBtn),this.off(I_,this.initSize)}},{key:"render",value:function(){if(!this.config.disable&&this.config.showIcon){var e=this.icons.screenshotIcon?"xgplayer-icon":"xgplayer-icon btn-text",t="SCREENSHOT";return'\n <xg-icon class="xgplayer-shot">\n <div class="'.concat(e,'">\n ').concat(this.icons.screenshotIcon?"":'<span lang-key="'.concat(this.i18nKeys[t],'">').concat(this.i18n[t],"</span>")," \n </div>\n </xg-icon>")}}}],[{key:"pluginName",get:function(){return"screenShot"}},{key:"defaultConfig",get:function(){return{position:MC.CONTROLS_RIGHT,index:5,quality:.92,type:"image/png",format:".png",width:600,height:337,fitVideo:!0,disable:!1,name:"screenshot",showIcon:!0,canvasCreated:!1,canvasAdded:!1}}}]),n}(IT),sP=function(){function e(t){Bo(this,e),this.config=t.config,this.parent=t.root,this.root=Ww.createDom("ul","",{},"xg-options-list ".concat(this.config.className)),t.root.appendChild(this.root),this.onItemClick=this.onItemClick.bind(this),this.renderItemList();var n="touche"===this.config.domEventType?"touchend":"click";this._delegates=HC.delegate.call(this,this.root,"li",n,this.onItemClick)}return Fo(e,[{key:"renderItemList",value:function(e){var t=this,n=this.config,i=this.root;e?n.data=e:e=n.data,n.style&&Object.keys(n.style).map((function(e){i.style[e]=n[e]})),e.length>0&&(this.attrKeys=Object.keys(e[0])),this.root.innerHTML="",e.map((function(e,n){var i=e.selected?"option-item selected":"option-item";e["data-index"]=n,t.root.appendChild(Ww.createDom("li","<span>".concat(e.showText,"</span>"),e,i))}))}},{key:"onItemClick",value:function(e){e.delegateTarget||(e.delegateTarget=e.target);var t=e.delegateTarget;if(t&&Ww.hasClass(t,"selected"))return!1;var n="function"==typeof this.config.onItemClick?this.config.onItemClick:null,i=this.root.querySelector(".selected");Ww.addClass(t,"selected"),i&&Ww.removeClass(i,"selected"),n(e,{from:i?this.getAttrObj(i,this.attrKeys):null,to:this.getAttrObj(t,this.attrKeys)})}},{key:"getAttrObj",value:function(e,t){if(!e||!t)return{};var n={};t.map((function(t){n[t]=e.getAttribute(t)}));var i=e.getAttribute("data-index");return i&&(n.index=Number(i)),n}},{key:"show",value:function(){Ww.removeClass(this.root,"hide"),Ww.addClass(this.root,"active")}},{key:"hide",value:function(){Ww.removeClass(this.root,"active"),Ww.addClass(this.root,"hide")}},{key:"setStyle",value:function(e){var t=this;Object.keys(e).forEach((function(n){t.root.style[n]=e[n]}))}},{key:"destroy",value:function(){this._delegates&&(this._delegates.map((function(e){e.destroy&&e.destroy()})),this._delegates=null),this.root.innerHTML=null,this.parent.removeChild(this.root),this.root=null}}]),e}();function cP(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var uP="mobile"===$_.device,lP=function(e){Ho(n,e);var t=cP(n);function n(e){var i;return Bo(this,n),Go(Uo(i=t.call(this,e)),"onEnter",(function(e){e.preventDefault(),e.stopPropagation(),i.emit("icon_mouseenter",{pluginName:i.pluginName}),i.onToggle(!0)})),Go(Uo(i),"onLeave",(function(e){e.preventDefault(),e.stopPropagation(),i.emit("icon_mouseleave",{pluginName:i.pluginName}),i.isActive&&i.onToggle(!1)})),i.isIcons=!1,i.isActive=!1,i.curValue=null,i.curIndex=0,i}return Fo(n,[{key:"updateLang",value:function(e){this.renderItemList(this.config.list,this.curIndex)}},{key:"afterCreate",value:function(){var e=this,t=this.config;this.initIcons(),uP=uP||"touch"===this.domEventType,"mobile"===$_.device&&"middle"!==t.listType&&(t.listType="rightSide"),t.hidePortrait&&Ww.addClass(this.root,"portrait"),this.once(i_,(function(){t.list&&t.list.length>0&&(e.renderItemList(t.list),e.show())})),uP&&this.on(h_,(function(){e.isActive&&(e.optionsList&&e.optionsList.hide(),e.isActive=!1)})),this.activeEvent=uP?"touchend":"mouseenter",this.bind(this.activeEvent,this.onEnter),this.bind("mouseleave",this.onLeave),this.isIcons&&this.bind("click",this.onIconClick),this.config.disable&&this.disable()}},{key:"initIcons",value:function(){var e=this,t=this.icons,n=Object.keys(t),i=!1;n.length>0&&(n.forEach((function(n){e.appendChild(".xgplayer-icon",t[n]),!i&&(i=t[n])})),this.isIcons=i),i||(this.appendChild(".xgplayer-icon",Ww.createDom("span","",{},"icon-text")),Ww.addClass(this.find(".xgplayer-icon"),"btn-text"))}},{key:"show",value:function(){!this.config.list||this.config.list.length<1||Ww.addClass(this.root,"show")}},{key:"hide",value:function(){Ww.removeClass(this.root,"show")}},{key:"getTextByLang",value:function(e,t,n){if(void 0===e)return"";var i=this.config.list;!n&&(n=this.player.lang),t=!t||Ww.isUndefined(e[t])?"text":t,"number"==typeof e&&(e=i[e]);try{return"object"===Do(e[t])?e[t][n]||e[t].zh:e[t]}catch(e){return console.warn(e),""}}},{key:"onToggle",value:function(e){if(e!==this.isActive&&!this.config.disable){var t=this.player.controls,n=this.config.listType;e?("rightSide"===n?t.blur():t.focus(),this.optionsList&&this.optionsList.show()):("rightSide"===n?t.focus():t.unFocus(),this.optionsList&&this.optionsList.hide()),this.isActive=e}}},{key:"onItemClick",value:function(e,t){e.preventDefault(),e.stopPropagation();var n=this.config,i=n.listType,r=n.list;(uP||"rightSide"===i)&&this.onToggle(!1),this.curIndex=t.to.index,this.curItem=r[this.curIndex],this.changeCurrentText(),this.onToggle(!1)}},{key:"onIconClick",value:function(e){}},{key:"changeCurrentText",value:function(){if(!this.isIcons){var e=this.config.list,t=e[this.curIndex<e.length?this.curIndex:0];t&&(this.find(".icon-text").innerHTML=this.getTextByLang(t,"iconText"))}}},{key:"renderItemList",value:function(e,t){var n=this,i=this.config,r=this.optionsList,o=this.player;if("number"==typeof t&&(this.curIndex=t,this.curItem=i.list[t]),r)return r.renderItemList(e),void this.changeCurrentText();var a={config:{data:e||[],className:"rightSide"===i.listType?"right-side":"",onItemClick:function(e,t){n.onItemClick(e,t)},domEventType:uP?"touche":"mouse"},root:"rightSide"===i.listType?o.root:this.root};this.config.isShowIcon&&(this.optionsList=new sP(a),this.changeCurrentText(),this.show())}},{key:"destroy",value:function(){this.unbind(this.activeEvent,this.onToggle),this.unbind("mouseleave",this.onToggle),this.optionsList&&(this.optionsList.destroy(),this.optionsList=null)}},{key:"render",value:function(){if(this.config.isShowIcon)return'<xg-icon class="xg-options-icon '.concat(this.config.className||"",'">\n <div class="xgplayer-icon">\n </div>\n </xg-icon>')}}],[{key:"pluginName",get:function(){return"optionsIcon"}},{key:"defaultConfig",get:function(){return{position:MC.CONTROLS_RIGHT,index:100,list:[],listType:"middle",listStyle:{},hidePortrait:!0,isShowIcon:!1}}}]),n}(HC);function fP(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var hP=function(e){Ho(n,e);var t=fP(n);function n(e){var i;return Bo(this,n),(i=t.call(this,e)).curTime=0,i.isPaused=!0,i}return Fo(n,[{key:"beforeCreate",value:function(e){var t=e.config.list;Array.isArray(t)&&t.length>0&&(e.config.list=t.map((function(e){return!e.text&&e.name&&(e.text=e.name),e.text||(e.text=e.definition),e})))}},{key:"afterCreate",value:function(){var e=this;uu(Vo(n.prototype),"afterCreate",this).call(this);var t=this.config,i=t.list,r=t.defaultDefinition,o=this.playerConfig.defaultConfig;i.forEach((function(e){e.definition!==r&&e.definition!==o||(e.selected=!0)})),this.on("resourceReady",(function(t){e.changeDefinitionList(t)})),this.on(R_,(function(t){e.renderItemList(e.config.list,t.to)})),this.player.definitionList.length<2&&this.hide()}},{key:"initDefinition",value:function(){var e=this.config,t=e.list,n=e.defaultDefinition,i=this.playerConfig.defaultConfig;if(t.length>0){var r=null;t.map((function(e){e.definition!==n&&e.definition!==i||(r=e,e.selected=!0)})),r||(r=t[0]),this.changeDefinition(r)}}},{key:"renderItemList",value:function(e,t){var i=this,r=t&&t.definition?t.definition:"";t&&!Array.isArray(t)&&e.forEach((function(e){e.selected=!1}));var o=0,a=e.map((function(e,t){var n={url:e.url,definition:e.definition||"",showText:i.getTextByLang(e)||e.definition,selected:!1};return(e.selected||!Ww.isUndefined(e.definition)&&e.definition===r)&&(n.selected=!0,o=t),n}));uu(Vo(n.prototype),"renderItemList",this).call(this,a,o)}},{key:"changeDefinitionList",value:function(e){if(Array.isArray(e)){var t=this.playerConfig,n=t.definition,i=t.defaultDefinition,r=n||this.config.defaultDefinition||"";this.config.list=e.map((function(e){return!e.text&&e.name&&(e.text=e.name),e.text||(e.text=e.definition),e.definition!==r&&e.definition!==i||(e.selected=!0),e})),n.list=e,this.renderItemList(e),this.config.list.length<2?this.hide():this.show()}}},{key:"changeDefinition",value:function(e,t){var n=this.player;n.switchURL?n.switchUrl(e.url):n.changeDefinition(e,t)}},{key:"onItemClick",value:function(e,t){var i=this.player.definitionList;uu(Vo(n.prototype),"onItemClick",this).apply(this,arguments),this.emitUserAction(e,"change_definition",{from:t.from,to:t.to});for(var r=0;r<i.length;r++)t.to&&i[r].definition===t.to.definition&&(t.to.url=i[r].url),t.from&&i[r].definition===t.from.definition&&(t.from.url=i[r].url);this.player.changeDefinition(t.to,t.from)}}],[{key:"pluginName",get:function(){return"definition"}},{key:"defaultConfig",get:function(){return{position:MC.CONTROLS_RIGHT,index:3,list:[],defaultDefinition:"",disable:!1,hidePortrait:!1,className:"xgplayer-definition",isShowIcon:!0}}}]),n}(lP);function dP(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var pP=function(e){Ho(n,e);var t=dP(n);function n(e){var i;return Bo(this,n),(i=t.call(this,e)).curRate=1,i}return Fo(n,[{key:"beforeCreate",value:function(e){var t=e.player.config.playbackRate,n=t?Array.isArray(t)?t:e.config.list:[];Array.isArray(n)&&(e.config.list=n.map((function(e){return"number"==typeof e?e={rate:e,text:"".concat(e,"x")}:!e.text&&e.rate&&(e.text="".concat(e.rate,"x")),e})))}},{key:"afterCreate",value:function(){var e=this;uu(Vo(n.prototype),"afterCreate",this).call(this),this.on(c_,(function(){e.curValue!==e.player.playbackRate&&e.renderItemList()})),this.renderItemList()}},{key:"show",value:function(){this.config.list&&0!==this.config.list.length&&uu(Vo(n.prototype),"show",this).call(this)}},{key:"onItemClick",value:function(e,t){uu(Vo(n.prototype),"onItemClick",this).apply(this,arguments);var i=e.delegateTarget,r=Number(i.getAttribute("rate"));if(!r||r===this.curValue)return!1;var o={playbackRate:{from:this.player.playbackRate,to:r}};this.emitUserAction(e,"change_rate",{props:o}),this.curValue=r,this.player.playbackRate=r}},{key:"renderItemList",value:function(){var e=this,t=this.player.playbackRate||1;this.curValue=t;var i=0,r=this.config.list.map((function(n,r){var o={rate:n.rate};return o.rate===t&&(o.selected=!0,i=r),o.showText=e.getTextByLang(n),o}));uu(Vo(n.prototype),"renderItemList",this).call(this,r,i)}},{key:"destroy",value:function(){uu(Vo(n.prototype),"destroy",this).call(this)}}],[{key:"pluginName",get:function(){return"playbackRate"}},{key:"defaultConfig",get:function(){return{position:MC.CONTROLS_RIGHT,index:4,list:[2,1.5,1,.75,.5],className:"xgplayer-playbackrate",isShowIcon:!0,hidePortrait:!1}}}]),n}(lP);function vP(){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 gP(){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}function yP(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var mP=function(e){Ho(n,e);var t=yP(n);function n(){return Bo(this,n),t.apply(this,arguments)}return Fo(n,[{key:"afterCreate",value:function(){var e=this;uu(Vo(n.prototype),"afterCreate",this).call(this),this.config.target&&(this.playerConfig.fullscreenTarget=this.config.target),this.initIcons(),this.on(E_,(function(t){e.animate(t)})),this.btnClick=this.btnClick.bind(this),this.handleCssFullscreen=this.hook("cssFullscreen_change",this.btnClick,{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.bind(["click","touchend"],this.handleCssFullscreen)}},{key:"initIcons",value:function(){var e=this.icons,t=this.find(".xgplayer-icon");t.appendChild(e.cssFullscreen),t.appendChild(e.exitCssFullscreen)}},{key:"btnClick",value:function(e){if(!this.config.disable){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;this.changeLangTextKey(this.find(".xg-tips"),e?t.EXITCSSFULLSCREEN_TIPS:t.CSSFULLSCREEN_TIPS)}},{key:"registerIcons",value:function(){return{cssFullscreen:{icon:vP,class:"xg-get-cssfull"},exitCssFullscreen:{icon:gP,class:"xg-exit-cssfull"}}}},{key:"destroy",value:function(){uu(Vo(n.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.btnClick)}},{key:"render",value:function(){return'<xg-icon class=\'xgplayer-cssfullscreen\'>\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys.CSSFULLSCREEN_TIPS,'">').concat(this.i18n.CSSFULLSCREEN_TIPS,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"cssFullscreen"}},{key:"defaultConfig",get:function(){return{position:MC.CONTROLS_RIGHT,index:1,disable:!1,target:null}}}]),n}(IT);function kP(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var bP=function(e){Ho(n,e);var t=kP(n);function n(){return Bo(this,n),t.apply(this,arguments)}return Fo(n,[{key:"afterCreate",value:function(){var e=this;this.clickHandler=this.hook("errorRetry",this.errorRetry,{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.onError=this.hook("errorHandler",this.handleError),this.bind(".xgplayer-error-refresh","click",this.clickHandler),this.on(i_,(function(){e.handleCanPlay()})),this.on(Zw,(function(t){e.onError(t)}))}},{key:"errorRetry",value:function(e){this.emitUserAction(e,"error_retry",{}),this.player.retry()}},{key:"handleCanPlay",value:function(){Ww.removeClass(this.player.root,"xgplayer-is-error")}},{key:"handleError",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.player,n=e.errorType,i=t.error;if(!i)switch(n){case"decoder":i=this.i18n.MEDIA_ERR_DECODE;break;case"network":i=this.i18n.MEDIA_ERR_NETWORK;break;default:i=this.i18n.MEDIA_ERR_SRC_NOT_SUPPORTED}this.find(".xgplayer-error-text").innerHTML=i,this.find(".xgplayer-error-tips").innerHTML="".concat(this.i18n.REFRESH_TIPS,'<span class="xgplayer-error-refresh">').concat(this.i18n.REFRESH,"</span>")}},{key:"destroy",value:function(){this.unbind(".xgplayer-error-refresh","click",this.clickHandler)}},{key:"render",value:function(){return'<xg-error class="xgplayer-error">\n <div class="xgplayer-errornote">\n <span class="xgplayer-error-text"></span>\n <span class="xgplayer-error-tips"><em class="xgplayer-error-refresh"></em></span>\n </div>\n </xg-error>'}}],[{key:"pluginName",get:function(){return"error"}}]),n}(HC);function wP(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var _P=function(e){Ho(n,e);var t=wP(n);function n(){return Bo(this,n),t.apply(this,arguments)}return Fo(n,[{key:"afterCreate",value:function(){var e=this;this.intervalId=0,this.customConfig=null,this.bind(".highlight",["click","touchend"],(function(t){(e.config.onClick||e.customOnClick)&&(t.preventDefault(),t.stopPropagation(),e.customOnClick?e.customOnClick(t):e.config.onClick(t))})),this.player.showPrompt=function(){e.show.apply(e,arguments)},this.player.hidePrompt=function(){e.hide()}}},{key:"setStyle",value:function(e){var t=this;Object.keys(e).map((function(n){t.root.style[n]=e[n]}))}},{key:"show",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(e){this.customOnClick=i;var r=this.config.interval;if(this.intervalId&&(clearTimeout(this.intervalId),this.intervalId=null),n.style&&this.setStyle(n.style),this.find(".xgplayer-prompt-detail").innerHTML="string"==typeof e?e:"".concat(e.text||"")+"".concat(e.highlight?'<i class="highlight">'.concat(e.highlight,"</i>"):""),"arrow"===n.mode&&Ww.addClass(this.root,"arrow"),n.preventScreenOverflow){var o=this.root.getBoundingClientRect(),a=o.left,s=o.right,c=document.documentElement.clientWidth||document.body.clientWidth;if(a<0){var u=Number((Math.abs(a)/c*100).toFixed(2));if(n.style.left){var l=parseInt(n.style.left);this.setStyle({left:"".concat(l+u+.5,"%")})}}if(s>=c){var f=Number(((Math.abs(s)-c)/c*100).toFixed(2));if(n.style.left){var h=parseInt(n.style.left);this.setStyle({left:"".concat(h-f-.5,"%")})}}}if(Ww.addClass(this.root,"show"),"boolean"==typeof n.autoHide?n.autoHide:this.config.autoHide){var d=n.interval||r;this.intervalId=setTimeout((function(){t.hide()}),d)}}}},{key:"hide",value:function(){this.root&&(Ww.removeClass(this.root,"show"),Ww.removeClass(this.root,"arrow"),this.root.removeAttribute("style")),this.customOnClick=null}},{key:"render",value:function(){return'<xg-prompt class="xgplayer-prompt '.concat(QC.CONTROLS_FOLLOW,'">\n <span class="xgplayer-prompt-detail"></span>\n </xg-prompt>')}}],[{key:"pluginName",get:function(){return"prompt"}},{key:"defaultConfig",get:function(){return{interval:3e3,style:{},mode:"arrow",autoHide:!0,preventScreenOverflow:!1,detail:{text:"",highlight:""},onClick:function(){}}}}]),n}(HC),CP=_P,xP={time:0,text:"",id:1,duration:1,color:"#fff",style:{},width:6,height:6};function SP(e){Object.keys(xP).map((function(t){void 0===e[t]&&(e[t]=xP[t])}))}var TP={initDots:function(){this.createDots(this._ispots,!1),this._ispotsInit=!0},createDots:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Array.isArray(t)&&t.length){var i=this.player.plugins.progress;if(i&&i.outer){var r=document.createDocumentFragment();t.forEach((function(t){var i=e._createDotElement(t,n);i&&r.appendChild(i)})),i.outer.appendChild(r)}}},createDot:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this._createDotElement(e,t);if(n){var i=this.player.plugins.progress;i.outer&&i.outer.appendChild(n)}},_createDotElement:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!this.player.plugins.progress)return null;if(t&&(SP(e),this._ispots.push(e)),!this._ispotsInit&&t)return null;var n=this.calcuPosition(e.time,e.duration),i=e.style||{},r=e.stylePreferred;i.left=r&&void 0!==i.left?i.left:"".concat(n.left,"%"),i.width=r&&void 0!==i.width?i.width:"".concat(n.width,"%");var o="xgspot_".concat(e.id," xgplayer-spot");n.isMini&&(o+=" mini");var a=Ww.createDom("xg-spot",e.template||"",{"data-text":e.text,"data-time":e.time,"data-id":e.id},o);return Object.keys(i).forEach((function(e){a.style[e]=i[e]})),a},findDot:function(e){if(this.player.plugins.progress){var t=this._ispots.filter((function(t,n){return t.id===e}));return t.length>0?t[0]:null}},updateDot:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.player.plugins.progress;if(n){var i=this.findDot(e.id);if(i&&Object.keys(e).map((function(t){i[t]=e[t]})),this._ispotsInit){var r=n.find('xg-spot[data-id="'.concat(e.id,'"]'));if(r){var o=this.calcuPosition(e.time,e.duration),a=e.style||{};a.left="".concat(o.left,"%"),a.width="".concat(o.width,"%"),r.setAttribute("data-text",e.text),r.setAttribute("data-time",e.time),o.isMini?Ww.addClass(r,"mini"):Ww.removeClass(r,"mini"),Object.keys(a).map((function(e){r.style[e]=a[e]})),t&&this.showDot(e.id)}}}},deleteDot:function(e){var t=this._ispots,n=this.player.plugins.progress;if(n){for(var i=[],r=0;r<t.length;r++)t[r].id===e&&i.push(r);for(var o=i.length-1;o>=0;o--)if(t.splice(i[o],1),this._ispotsInit){var a=n.find('xg-spot[data-id="'.concat(e,'"]'));a&&a.parentElement.removeChild(a)}}},deleteAllDots:function(){var e=this.player.plugins.progress;if(e)if(this._ispotsInit){for(var t=e.root.getElementsByTagName("xg-spot"),n=t.length-1;n>=0;n--)e.outer.removeChild(t[n]);this._ispots=[]}else this._ispots=[]},updateAllDots:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=this.player.plugins.progress;if(n)if(this._ispotsInit){this._ispots=[];var i=n.root.getElementsByTagName("xg-spot"),r=i.length;if(r>t.length)for(var o=r-1;o>t.length-1;o--)n.outer.removeChild(i[o]);t.map((function(t,n){n<r?(i[n].setAttribute("data-id","".concat(t.id)),e._ispots.push(t),e.updateDot(t)):e.createDot(t)}))}else this._ispots=t},updateAllDotsStyles:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=this.player.plugins.progress;if(null!=n&&n.root)for(var i,r=n.root.getElementsByTagName("xg-spot"),o=function(n){var o=(n=r[a]).getAttribute("data-id"),s=e.findDot(o);if(s&&s.activeStyle&&s.style&&s.stylePreferred){var c=t?null==s?void 0:s.activeStyle:null==s?void 0:s.style;c&&Object.keys(c).map((function(e){n.style[e]=c[e]}))}i=n},a=0;a<r.length;a++)o(i)},getAllDotsDom:function(){var e=this.player.plugins.progress;return e?e.root.getElementsByTagName("xg-spot"):[]},getDotDom:function(e){var t=this.player.plugins.progress;if(t)return t.find('xg-spot[data-id="'.concat(e,'"]'))}};function EP(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var PP={dragmove:"onProgressDragMove",dragstart:"onProgressDragStart",dragend:"onProgressDragEnd",click:"onProgressClick",mouseover:"onProgressMouseOver",mouseenter:"onProgressMouseEnter",mouseleave:"onProgressMouseLeave"},RP=function(e){Ho(n,e);var t=EP(n);function n(e){var i;return Bo(this,n),Go(Uo(i=t.call(this,e)),"onMousemove",(function(e){i.config.disable||(Ww.hasClass(e.target,"xg-spot-content")&&i.config.isHideThumbnailHover?i.player.plugins.progress.onMouseLeave(e):(i._state.f||Ww.hasClass(e.target,"xg-spot-content"))&&(Ww.event(e),e.stopPropagation()))})),Go(Uo(i),"onMousedown",(function(e){i.config.disable||(i._state.f||Ww.hasClass(e.target,"xg-spot-content"))&&(Ww.event(e),e.stopPropagation())})),Go(Uo(i),"onMouseup",(function(e){if(i.isDrag){var t=i.player.plugins.progress;t&&t.pos&&(t.onMouseUp(e),!t.pos.isEnter&&t.onMouseLeave(e))}})),Go(Uo(i),"onDotMouseLeave",(function(e){if(!i.config.disable){i._curDot.removeEventListener("mouseleave",i.onDotMouseLeave),i.blurDot(e.target),i._curDot=null;var t=i.player.plugins.progress;t&&t.enableBlur(),i.show()}})),Go(Uo(i),"onProgressMouseLeave",(function(e,t){i.updateAllDotsStyles(!1)})),Go(Uo(i),"onProgressMouseOver",(function(e,t){var n;if(!i.config.disable&&i.player){var r=t.target,o=i.player.plugins.progress,a=!(null==o||null===(n=o.config)||void 0===n||!n.resetBlur);if(Ww.hasClass(r,"xgplayer-spot")&&(!i._curDot||a&&!i._curDot.contains(r)&&i._curDot!==r)){var s=i._curDot;i._curDot=r,null==s||s.removeEventListener("mouseleave",i.onDotMouseLeave),i._curDot.addEventListener("mouseleave",i.onDotMouseLeave),i.focusDot(r),i._curDot.children.length>0&&i.hide(),null==o||o.disableBlur()}else a&&(null==o||o.enableBlur())}})),i._ispots=[],i.videoPreview=null,i.videothumbnail=null,i.thumbnail=null,i._state={now:0,f:!1},i}return Fo(n,[{key:"beforeCreate",value:function(e){var t=e.player.plugins.progress;t&&(e.root=t.root)}},{key:"afterCreate",value:function(){var e=this;this._curDot=null,this.handlerSpotClick=this.hook("spotClick",(function(t,n){n.time&&e.player.seek(n.time)})),function(e){var t=e.config,n=e.player;Object.keys(TP).map((function(t){e[t]=TP[t].bind(e)}));var i=n.config.progressDot||t.ispots||[];e._ispots=i.map((function(e){return SP(e),e})),e._ispotsInit=!1,n.once(r_,(function(){e.initDots()}))}(this),this.config.disable&&this.disable(),this.extTextRoot=this.find(".xg-spot-ext-text")}},{key:"setConfig",value:function(e){var t=this;e&&Object.keys(e).map((function(n){t.config[n]=e[n]}))}},{key:"onPluginsReady",value:function(){this.player.plugins.progress&&(this.previewLine=this.find(".xg-spot-line"),this.timePoint=this.find(".xgplayer-progress-point"),this.timeText=this.find(".xg-spot-time"),this.tipText=this.find(".spot-inner-text"),this._hasThumnail=!1,this.registerThumbnail(),this.bindEvents())}},{key:"bindEvents",value:function(){var e=this,t=this.player.plugins.progress;if(t&&(Object.keys(PP).map((function(n){e[PP[n]]=e[PP[n]].bind(e),t.addCallBack(n,e[PP[n]])})),"mobile"!==$_.device)){this.bind(".xg-spot-info","mousemove",this.onMousemove),this.bind(".xg-spot-info","mousedown",this.onMousedown),this.bind(".xg-spot-info","mouseup",this.onMouseup);var n=this.hook("previewClick",(function(){}));this.handlerPreviewClick=function(t){t.stopPropagation(),n(parseInt(1e3*e._state.now,10)/1e3,t)},this.bind(".xg-spot-content","mouseup",this.handlerPreviewClick)}}},{key:"onProgressMouseEnter",value:function(e,t){this.onProgressMove(e,t),this.updateAllDotsStyles(!0)}},{key:"onProgressMove",value:function(e,t){!this.config.disable&&this.player.duration&&this.updatePosition(e.offset,e.width,e.currentTime,e.e)}},{key:"onProgressDragMove",value:function(e,t){!this.config.disable&&this.player.duration&&this.onProgressMove(e,t)}},{key:"onProgressDragStart",value:function(e){!this.config.disable&&this.player.duration&&(this.isDrag=!0,this.videoPreview&&Ww.addClass(this.videoPreview,"show"))}},{key:"onProgressDragEnd",value:function(e){!this.config.disable&&this.player.duration&&(this.isDrag=!1,this.videoPreview&&Ww.removeClass(this.videoPreview,"show"))}},{key:"onProgressClick",value:function(e,t){if(!this.config.disable&&Ww.hasClass(t.target,"xgplayer-spot")){t.stopPropagation(),t.preventDefault();var n={};["time","id","text"].map((function(e){n[e]=t.target.getAttribute("data-".concat(e))})),n.time&&(n.time=Number(n.time)),this.handlerSpotClick(t,n)}}},{key:"updateLinePos",value:function(e,t){var n=this.root,i=this.previewLine,r=this.timePoint,o=this.player,a=this.config,s="flex"===o.controls.mode,c=n.getBoundingClientRect().width;if(c||!this._hasThumnail){var u,l,f=r.getBoundingClientRect().width,h=e-(c=this._hasThumnail&&c<a.width?a.width:c)/2;h<0&&!s?(h=0,u=e-c/2,!this.thumbnail&&(l=e-c/2-f/2)):h>t-c&&!s?(u=h-(t-c),!this.thumbnail&&(l=h-(t-c)-f/2),h=t-c):(u=0,!this.thumbnail&&(l=-f/2)),void 0!==u&&(i.style.transform="translateX(".concat(u.toFixed(2),"px)")),void 0!==l&&(r.style.transform="translateX(".concat(l.toFixed(2),"px)")),n.style.transform="translateX(".concat(h.toFixed(2),"px) translateZ(0)")}}},{key:"updateTimeText",value:function(e){var t=this.timeText,n=this.timePoint;t.textContent=e,!this.thumbnail&&(n.textContent=e)}},{key:"updatePosition",value:function(e,t,n,i){var r=this.root,o=this.config,a=this._state;if(r){this.updateLinePos(e,t),a.now=n;var s=Ww.format(n);i&&i.target&&Ww.hasClass(i.target,"xgplayer-spot")?(this.showTips(i.target.getAttribute("data-text"),!1,s),this.focusDot(i.target),a.f=!0,o.isFocusDots&&a.f&&(a.now=parseInt(i.target.getAttribute("data-time"),10))):o.defaultText?(a.f=!1,this.showTips(o.defaultText,!0,s)):(a.f=!1,this.hideTips("")),this.updateTimeText(s),this.updateThumbnails(a.now)}}},{key:"updateThumbnails",value:function(e){var t=this.player,n=this.videoPreview,i=this.config,r=t.plugins.thumbnail;if(r&&r.usable){this.thumbnail&&r.update(this.thumbnail,e,i.width,i.height);var o=n&&n.getBoundingClientRect();this.videothumbnail&&r.update(this.videothumbnail,e,o.width,o.height)}}},{key:"registerThumbnail",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("mobile"!==$_.device){var t=this.player,n=this.config,i=t.getPlugin("thumbnail");if(i&&i.setConfig(e),i&&i.usable&&n.isShowThumbnail){Ww.removeClass(this.root,"short-line no-thumbnail"),"short"===n.mode&&Ww.addClass(this.root,"short-line"),this._hasThumnail=!0;var r=this.find(".xg-spot-thumbnail");this.thumbnail=i.createThumbnail(r,"progress-thumbnail"),n.isShowCoverPreview&&(this.videoPreview=Ww.createDom("xg-video-preview","",{},"xgvideo-preview"),t.root.appendChild(this.videoPreview),this.videothumbnail=i.createThumbnail(this.videoPreview,"xgvideo-thumbnail")),this.updateThumbnails(0)}else Ww.addClass(this.root,"short-line no-thumbnail")}}},{key:"calcuPosition",value:function(e,t){var n=this.player.plugins.progress,i=this.player;e+t>i.duration&&(t=i.duration-e);var r={left:e/i.duration*100,width:t/i.duration*100,isMini:!1};if(this.config.isDotAdaptWidth){var o=0;if(i.duration>0){var a=n.root.getBoundingClientRect().width;o=i.duration/a*6}r.isMini=o>t}else r.isMini=!0;return r}},{key:"showDot",value:function(e){var t=this.findDot(e);if(t){var n=this.root.getBoundingClientRect().width,i=t.time/this.player.duration*n;this.updatePosition(i,n,t.time)}}},{key:"focusDot",value:function(e,t){e&&(t||(t=e.getAttribute("data-id")),Ww.addClass(e,"active"),this._activeDotId=t)}},{key:"blurDot",value:function(e){if(!e){var t=this._activeDotId;e=this.getDotDom(t)}e&&(Ww.removeClass(e,"active"),this._activeDotId=null)}},{key:"showTips",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";Ww.addClass(this.root,"no-timepoint"),e&&(Ww.addClass(this.find(".xg-spot-content"),"show-text"),t&&"production"===this.config.mode?(Ww.addClass(this.root,"product"),this.tipText.textContent=e):(Ww.removeClass(this.root,"product"),this.tipText.textContent=this._hasThumnail?e:"".concat(n," ").concat(e)))}},{key:"hideTips",value:function(){Ww.removeClass(this.root,"no-timepoint"),this.tipText.textContent="",Ww.removeClass(this.find(".xg-spot-content"),"show-text"),Ww.removeClass(this.root,"product")}},{key:"hide",value:function(){Ww.addClass(this.root,"hide")}},{key:"show",value:function(){Ww.removeClass(this.root,"hide")}},{key:"enable",value:function(){var e=this.config,t=this.playerConfig;this.config.disable=!1,this.show(),!this.thumbnail&&e.isShowThumbnail&&this.registerThumbnail(t.thumbnail||{})}},{key:"disable",value:function(){this.config.disable=!0,this.hide()}},{key:"destroy",value:function(){var e=this,t=this.player.plugins.progress;t&&Object.keys(PP).map((function(n){t.removeCallBack(n,e[PP[n]])})),this.videothumbnail=null,this.thumbnail=null,this.videoPreview&&this.player.root.removeChild(this.videoPreview),this.unbind(".xg-spot-info","mousemove",this.onMousemove),this.unbind(".xg-spot-info","mousedown",this.onMousedown),this.unbind(".xg-spot-info","mouseup",this.onMouseup),this.unbind(".xg-spot-content","mouseup",this.handlerPreviewClick)}},{key:"render",value:function(){return"mobile"===$_.device||"mobile"===this.playerConfig.isMobileSimulateMode?"":'<div class="xg-spot-info '.concat("short"===this.config.mode?"short-line":"",'">\n <div class="xg-spot-content">\n <div class="xg-spot-thumbnail">\n <span class="xg-spot-time"></span>\n </div>\n <div class="xg-spot-text"><span class="spot-inner-text"></span></div>\n </div>\n <div class="xgplayer-progress-point">00:00</div>\n <div class="xg-spot-ext-text"></div>\n <div class="xg-spot-line"></div>\n </div>')}}],[{key:"pluginName",get:function(){return"progresspreview"}},{key:"defaultConfig",get:function(){return{index:1,miniWidth:6,ispots:[],defaultText:"",isFocusDots:!0,isHideThumbnailHover:!0,isShowThumbnail:!0,isShowCoverPreview:!1,mode:"",disable:!1,width:160,height:90,isDotAdaptWidth:!0}}}]),n}(HC);function OP(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var IP=function(e){Ho(n,e);var t=OP(n);function n(e){var i;return Bo(this,n),(i=t.call(this,e)).ratio=1,i.interval=null,i._preloadMark={},i}return Fo(n,[{key:"afterCreate",value:function(){var e=this;this.usable&&this.initThumbnail(),this.on([r_],(function(){var t=e.config,n=t.pic_num,i=t.interval;e.usable&&(e.interval=i>0?i:Math.round(1e3*e.player.duration/n)/1e3)}))}},{key:"setConfig",value:function(e){var t=this;if(e){var n=Object.keys(e);n.length<1||(n.forEach((function(n){t.config[n]=e[n]})),this.usable&&this.initThumbnail())}}},{key:"usable",get:function(){var e=this.config,t=e.urls,n=e.pic_num;return t&&t.length>0&&n>0}},{key:"initThumbnail",value:function(){var e=this.config,t=e.width,n=e.height,i=e.pic_num,r=e.interval;this.ratio=t/n*100,this.interval=r||Math.round(this.player.duration/i),this._preloadMark={}}},{key:"getUrlByIndex",value:function(e){return e>=0&&e<this.config.urls.length?this.config.urls[e]:""}},{key:"preload",value:function(e){var t=this;if(!this._preloadMark[e]){var n=this.config.urls,i=n.length,r=[];e>0&&r.push(e-1),r.push(e),e>0&&e<i-1&&r.push(e+1),r.map((function(e){!t._preloadMark[e]&&e>=0&&e<i&&(t._preloadMark[e]=1,Ww.preloadImg(n[e],(function(){t._preloadMark[e]=2})))}))}}},{key:"getPosition",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.config,r=i.pic_num,o=i.row,a=i.col,s=i.width,c=i.height;this.interval=Math.round(this.player.duration/r);var u=Math.ceil(e/this.interval),l=(u=u>r?r:u)<o*a?0:Math.ceil(u/(o*a))-1,f=u-l*(a*o),h=f>0?Math.ceil(f/a)-1:0,d=f>0?f-h*a-1:0,p=0,v=0;t&&n?t/n<s/c?p=(v=n)*(s/c):v=(p=t)/(s/c):n?t||(p=(v=n||c)*(s/c)):v=(p=t||s)/(s/c);var g=this.getUrlByIndex(l);return{urlIndex:l,rowIndex:h,colIndex:d,url:g,height:v,width:p,style:{backgroundImage:"url(".concat(g,")"),backgroundSize:"".concat(p*a,"px auto"),backgroundPosition:"-".concat(d*p,"px -").concat(h*v,"px"),width:"".concat(p,"px"),height:"".concat(v,"px")}}}},{key:"update",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",o=this.config,a=o.pic_num,s=o.urls;if(!(a<=0)&&s&&0!==s.length){var c=this.getPosition(t,n,i);this.preload(c.urlIndex),Object.keys(c.style).map((function(t){e.style[t]=c.style[t]})),Object.keys(r).map((function(t){e.style[t]=r[t]}))}}},{key:"changeConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.setConfig(e)}},{key:"createThumbnail",value:function(e,t){var n=Ww.createDom("xg-thumbnail","",{},"thumbnail ".concat(t));return e&&e.appendChild(n),n}}],[{key:"pluginName",get:function(){return"thumbnail"}},{key:"defaultConfig",get:function(){return{isShow:!1,urls:[],pic_num:0,col:0,row:0,height:90,width:160,scale:1,className:"",hidePortrait:!1}}}]),n}(HC);function LP(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var AP=function(e){Ho(n,e);var t=LP(n);function n(){return Bo(this,n),t.apply(this,arguments)}return Fo(n,[{key:"afterCreate",value:function(){}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{cached:0,played:0},t=arguments.length>1?arguments[1]:void 0;t&&this.root&&(e.cached&&(this.find("xg-mini-progress-cache").style.width="".concat(e.cached/t*100,"%")),e.played&&(this.find("xg-mini-progress-played").style.width="".concat(e.played/t*100,"%")))}},{key:"render",value:function(){if(this.playerConfig.progress&&this.playerConfig.miniprogress)return'<xg-mini-progress class="xg-mini-progress">\n <xg-mini-progress-cache class="xg-mini-progress-cache"></xg-mini-progress-cache>\n <xg-mini-progress-played class="xg-mini-progress-played"></xg-mini-progress-played>\n </xg-mini-progress>'}}],[{key:"pluginName",get:function(){return"MiniProgress"}},{key:"defaultConfig",get:function(){return{}}}]),n}(HC),DP=AP;function MP(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var NP="realtime",FP="firstframe",BP="poster";var jP=null,HP=function(e){Ho(n,e);var t=MP(n);function n(){var e;Bo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Uo(e=t.call.apply(t,[this].concat(r))),"onLoadedData",(function(t){e.player&&(e._frameCount=e.config.startFrameCount,e.stop(),e.renderOnTimeupdate(t),e.off(t_,e.renderOnTimeupdate),e.on(t_,e.renderOnTimeupdate))})),Go(Uo(e),"onVisibilitychange",(function(t){"visible"===document.visibilityState?e._checkIfCanStart()&&e.start():"hidden"===document.visibilityState&&e.stop()})),Go(Uo(e),"renderOnTimeupdate",(function(t){if(e._frameCount>0)e.renderOnce(),e._frameCount--;else{e._isLoaded=!0,e.off(t_,e.renderOnTimeupdate);var n=e.config.startInterval;!e.player.paused&&e._checkIfCanStart()&&e.start(0,n)}})),Go(Uo(e),"start",(function(t,n){var i=e.player.video,r=function(){try{return parseInt(window.performance.now(),10)}catch(e){return(new Date).getTime()}}(),o=e.checkVideoIsSupport(i);o&&e.canvasCtx&&(n||(n=e.interval),e.stop(),i.videoWidth&&i.videoHeight&&(e.videoPI=i.videoHeight>0?parseInt(i.videoWidth/i.videoHeight*100,10):0,(e.config.mode===NP||r-e.preTime>=n)&&(i&&i.videoWidth&&e.update(o,e.videoPI),e.preTime=r)),e.frameId="timer"===e._loopType?Ww.setTimeout(Uo(e),e.start,n):Ww.requestAnimationFrame(e.start))})),Go(Uo(e),"stop",(function(){e.frameId&&("timer"===e._loopType?Ww.clearTimeout(Uo(e),e.frameId):Ww.cancelAnimationFrame(e.frameId),e.frameId=null)})),e}return Fo(n,[{key:"afterCreate",value:function(){var e=this;!0===this.playerConfig.dynamicBg&&(this.config.disable=!1),n.isSupport||(this.config.disable=!0);var t=this.config,i=t.disable,r=t.mode,o=t.frameRate;if(!i){this._pos={width:0,height:0,rwidth:0,rheight:0,x:0,y:0,pi:0},this.isStart=!1,this._isLoaded=!1,this.videoPI=0,this.preTime=0,this.interval=parseInt(1e3/o,10),this.canvas=null,this.canvasCtx=null,this._frameCount=0,this._loopType=this.config.mode!==NP&&this.interval>=1e3?"timer":"animation";var a=function(){e.player&&(e.init(),e.renderByPoster(),e.player.paused||e.start())};this.player.hasStart?a():this.once(m_,a),r!==BP&&(r!==FP&&(this.on(f_,(function(){e.stop()})),this.on(qw,(function(){var t=e.config.startInterval;e._checkIfCanStart()&&e.start(0,t)})),this.on(Jw,(function(){e.stop()}))),this.on(a_,this.onLoadedData),this.on(l_,(function(){e._isLoaded=!1,e.stop()})),document.addEventListener("visibilitychange",this.onVisibilitychange))}}},{key:"setConfig",value:function(e){var t=this;Object.keys(e).forEach((function(n){"root"===n&&e[n]!==t.config[n]?t.reRender(e[n]):"frameRate"===n?t.interval=parseInt(1e3/e[n],10):"disable"===n&&e[n]&&t.stop(),t.config[n]=e[n]}))}},{key:"init",value:function(e){var t=this.player,i=this.config;this.canvasFilter=n.supportCanvasFilter();try{var r=e||i.root;r||(r=i.isInnerRender&&t.innerContainer||t.root),r.insertAdjacentHTML("afterbegin",'<div class="xgplayer-dynamic-bg" data-index="'.concat(i.index,'"><canvas>\n </canvas><xgmask></xgmask></div>')),this.root=r.children[0],this.canvas=this.find("canvas"),this.canvasFilter||(this.canvas.style.filter=i.filter,this.canvas.style.webkitFilter=i.filter),this.mask=this.find("xgmask"),i.addMask&&(this.mask.style.background=i.maskBg),this.canvasCtx=this.canvas.getContext("2d")}catch(e){Hw.logError("plugin:DynamicBg",e)}}},{key:"reRender",value:function(e){if(this.config.disable||this.root){this.stop();var t=this.root?this.root.parentElement:null;if(t!==e&&t.removeChild(this.root),e){this.init(e),this.renderOnce();var n=this.config.startInterval;this._checkIfCanStart()&&this.start(0,n)}else this.root=null}}},{key:"checkVideoIsSupport",value:function(e){if(!e)return null;var t=e&&e instanceof window.HTMLVideoElement?e:e.canvas?e.canvas:e.flyVideo?e.flyVideo:null;if(t&&("safari"!==$_.browser||!Ww.isMSE(t)))return t;var n=t?t.tagName.toLowerCase():"";return"canvas"===n||"img"===n?t:null}},{key:"renderByPoster",value:function(){var e=this.playerConfig.poster;if(e){var t="String"===Ww.typeOf(e)?e:"String"===Ww.typeOf(e.poster)?e.poster:null;this.updateImg(t)}}},{key:"_checkIfCanStart",value:function(){var e=this.config.mode;return this._isLoaded&&!this.player.paused&&e!==FP&&e!==BP}},{key:"renderOnce",value:function(){var e=this.player.video;if(e.videoWidth&&e.videoHeight){this.videoPI=parseInt(e.videoWidth/e.videoHeight*100,10);var t=this.checkVideoIsSupport(e);t&&this.update(t,this.videoPI)}}},{key:"updateImg",value:function(e){var t=this;if(e){var n=this.canvas.getBoundingClientRect(),i=n.width,r=n.height,o=new window.Image;o.onload=function(){if(t.canvas&&!t.frameId&&!t.isStart){t.canvas.height=r,t.canvas.width=i;var e=parseInt(i/r*100,10);t.update(o,e),o=null}},o.src=e}}},{key:"update",value:function(e,t){if(this.canvas&&this.canvasCtx&&t)try{var n=this._pos,i=this.config,r=this.canvas.getBoundingClientRect(),o=r.width,a=r.height;if(o!==n.width||a!==n.height||n.pi!==t){var s=parseInt(o/a*100,10);n.pi=t,n.width!==o&&(n.width=this.canvas.width=o),n.height!==a&&(n.height=this.canvas.height=a);var c=a,u=o;s<t?u=parseInt(a*t/100,10):s>t&&(c=parseInt(100*o/t,10)),n.rwidth=u*i.multiple,n.rheight=c*i.multiple,n.x=(o-n.rwidth)/2,n.y=(a-n.rheight)/2}this.canvasFilter&&(this.canvasCtx.filter=i.filter),this.canvasCtx.drawImage(e,n.x,n.y,n.rwidth,n.rheight)}catch(e){Hw.logError("plugin:DynamicBg",e)}}},{key:"destroy",value:function(){this.stop(),document.removeEventListener("visibilitychange",this.onVisibilitychange),this.canvasCtx=null,this.canvas=null}},{key:"render",value:function(){return""}}],[{key:"pluginName",get:function(){return"dynamicBg"}},{key:"defaultConfig",get:function(){return{isInnerRender:!1,disable:!0,index:-1,mode:"framerate",frameRate:10,filter:"blur(50px)",startFrameCount:2,startInterval:0,addMask:!0,multiple:1.2,maskBg:"rgba(0,0,0,0.7)"}}},{key:"isSupport",get:function(){return"boolean"==typeof jP?jP:jP=function(){try{return!!document.createElement("canvas").getContext}catch(e){return!1}}()}},{key:"supportCanvasFilter",value:function(){return!("safari"===$_.browser||"firefox"===$_.browser)}}]),n}(HC),UP=HP,WP=d,VP=fe,GP=ie("iterator"),KP=!WP((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,n="";return e.pathname="c%20d",t.forEach((function(e,i){t.delete("b"),n+=i+e})),!t.size&&!VP||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[GP]||"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"!==n||"x"!==new URL("http://x",void 0).host})),zP=k,YP=2147483647,qP=/[^\0-\u007E]/,XP=/[.\u3002\uFF0E\uFF61]/g,$P="Overflow: input needs wider integers to process",JP=RangeError,ZP=zP(XP.exec),QP=Math.floor,eR=String.fromCharCode,tR=zP("".charCodeAt),nR=zP([].join),iR=zP([].push),rR=zP("".replace),oR=zP("".split),aR=zP("".toLowerCase),sR=function(e){return e+22+75*(e<26)},cR=function(e,t,n){var i=0;for(e=n?QP(e/700):e>>1,e+=QP(e/t);e>455;)e=QP(e/35),i+=36;return QP(i+36*e/(e+38))},uR=function(e){var t=[];e=function(e){for(var t=[],n=0,i=e.length;n<i;){var r=tR(e,n++);if(r>=55296&&r<=56319&&n<i){var o=tR(e,n++);56320==(64512&o)?iR(t,((1023&r)<<10)+(1023&o)+65536):(iR(t,r),n--)}else iR(t,r)}return t}(e);var n,i,r=e.length,o=128,a=0,s=72;for(n=0;n<e.length;n++)(i=e[n])<128&&iR(t,eR(i));var c=t.length,u=c;for(c&&iR(t,"-");u<r;){var l=YP;for(n=0;n<e.length;n++)(i=e[n])>=o&&i<l&&(l=i);var f=u+1;if(l-o>QP((YP-a)/f))throw JP($P);for(a+=(l-o)*f,o=l,n=0;n<e.length;n++){if((i=e[n])<o&&++a>YP)throw JP($P);if(i==o){for(var h=a,d=36;;){var p=d<=s?1:d>=s+26?26:d-s;if(h<p)break;var v=h-p,g=36-p;iR(t,eR(sR(p+v%g))),h=QP(v/g),d+=36}iR(t,eR(sR(h))),s=cR(a,f,u==c),a=0,u++}}a++,o++}return nR(t,"")},lR=En,fR=fr,hR=n,dR=Pe,pR=k,vR=fe,gR=KP,yR=En,mR=ha,kR=function(e,t,n){for(var i in t)lR(e,i,t[i],n);return e},bR=Pa,wR=yg,_R=on,CR=tf,xR=ue,SR=R,TR=Ma,ER=Bn,PR=Se,RR=pe,OR=Yo,IR=ko,LR=Nt,AR=zd,DR=jd,MR=uf,NR=lw,FR=ie("iterator"),BR="URLSearchParams",jR=BR+"Iterator",HR=_R.set,UR=_R.getterFor(BR),WR=_R.getterFor(jR),VR=Object.getOwnPropertyDescriptor,GR=function(e){if(!vR)return hR[e];var t=VR(hR,e);return t&&t.value},KR=GR("fetch"),zR=GR("Request"),YR=GR("Headers"),qR=zR&&zR.prototype,XR=YR&&YR.prototype,$R=hR.RegExp,JR=hR.TypeError,ZR=hR.decodeURIComponent,QR=hR.encodeURIComponent,eO=pR("".charAt),tO=pR([].join),nO=pR([].push),iO=pR("".replace),rO=pR([].shift),oO=pR([].splice),aO=pR("".split),sO=pR("".slice),cO=/\+/g,uO=Array(4),lO=function(e){return uO[e-1]||(uO[e-1]=$R("((?:%[\\da-f]{2}){"+e+"})","gi"))},fO=function(e){try{return ZR(e)}catch(t){return e}},hO=function(e){var t=iO(e,cO," "),n=4;try{return ZR(t)}catch(e){for(;n;)t=iO(t,lO(n--),fO);return t}},dO=/[!'()~]|%20/g,pO={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},vO=function(e){return pO[e]},gO=function(e){return iO(QR(e),dO,vO)},yO=wR((function(e,t){HR(this,{type:jR,iterator:AR(UR(e).entries),kind:t})}),"Iterator",(function(){var e=WR(this),t=e.kind,n=e.iterator.next(),i=n.value;return n.done||(n.value="keys"===t?i.key:"values"===t?i.value:[i.key,i.value]),n}),!0),mO=function(e){this.entries=[],this.url=null,void 0!==e&&(RR(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===eO(e,0)?sO(e,1):e:OR(e)))};mO.prototype={type:BR,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,n,i,r,o,a,s,c=DR(e);if(c)for(n=(t=AR(e,c)).next;!(i=dR(n,t)).done;){if(o=(r=AR(PR(i.value))).next,(a=dR(o,r)).done||(s=dR(o,r)).done||!dR(o,r).done)throw JR("Expected sequence with length 2");nO(this.entries,{key:OR(a.value),value:OR(s.value)})}else for(var u in e)SR(e,u)&&nO(this.entries,{key:u,value:OR(e[u])})},parseQuery:function(e){if(e)for(var t,n,i=aO(e,"&"),r=0;r<i.length;)(t=i[r++]).length&&(n=aO(t,"="),nO(this.entries,{key:hO(rO(n)),value:hO(tO(n,"="))}))},serialize:function(){for(var e,t=this.entries,n=[],i=0;i<t.length;)e=t[i++],nO(n,gO(e.key)+"="+gO(e.value));return tO(n,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var kO=function(){CR(this,bO);var e=HR(this,new mO(arguments.length>0?arguments[0]:void 0));vR||(this.length=e.entries.length)},bO=kO.prototype;if(kR(bO,{append:function(e,t){MR(arguments.length,2);var n=UR(this);nO(n.entries,{key:OR(e),value:OR(t)}),vR||this.length++,n.updateURL()},delete:function(e){MR(arguments.length,1);for(var t=UR(this),n=t.entries,i=OR(e),r=0;r<n.length;)n[r].key===i?oO(n,r,1):r++;vR||(this.length=n.length),t.updateURL()},get:function(e){MR(arguments.length,1);for(var t=UR(this).entries,n=OR(e),i=0;i<t.length;i++)if(t[i].key===n)return t[i].value;return null},getAll:function(e){MR(arguments.length,1);for(var t=UR(this).entries,n=OR(e),i=[],r=0;r<t.length;r++)t[r].key===n&&nO(i,t[r].value);return i},has:function(e){MR(arguments.length,1);for(var t=UR(this).entries,n=OR(e),i=0;i<t.length;)if(t[i++].key===n)return!0;return!1},set:function(e,t){MR(arguments.length,1);for(var n,i=UR(this),r=i.entries,o=!1,a=OR(e),s=OR(t),c=0;c<r.length;c++)(n=r[c]).key===a&&(o?oO(r,c--,1):(o=!0,n.value=s));o||nO(r,{key:a,value:s}),vR||(this.length=r.length),i.updateURL()},sort:function(){var e=UR(this);NR(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,n=UR(this).entries,i=TR(e,arguments.length>1?arguments[1]:void 0),r=0;r<n.length;)i((t=n[r++]).value,t.key,this)},keys:function(){return new yO(this,"keys")},values:function(){return new yO(this,"values")},entries:function(){return new yO(this,"entries")}},{enumerable:!0}),yR(bO,FR,bO.entries,{name:"entries"}),yR(bO,"toString",(function(){return UR(this).serialize()}),{enumerable:!0}),vR&&mR(bO,"size",{get:function(){return UR(this).entries.length},configurable:!0,enumerable:!0}),bR(kO,BR),fR({global:!0,constructor:!0,forced:!gR},{URLSearchParams:kO}),!gR&&xR(YR)){var wO=pR(XR.has),_O=pR(XR.set),CO=function(e){if(RR(e)){var t,n=e.body;if(ER(n)===BR)return t=e.headers?new YR(e.headers):new YR,wO(t,"content-type")||_O(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),IR(e,{body:LR(0,OR(n)),headers:LR(0,t)})}return e};if(xR(KR)&&fR({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return KR(e,arguments.length>1?CO(arguments[1]):{})}}),xR(zR)){var xO=function(e){return CR(this,qR),new zR(e,arguments.length>1?CO(arguments[1]):{})};qR.constructor=xO,xO.prototype=qR,fR({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:xO})}}var SO,TO=fr,EO=fe,PO=KP,RO=n,OO=Ma,IO=k,LO=En,AO=ha,DO=tf,MO=R,NO=_y,FO=BE,BO=ra,jO=Tm.codeAt,HO=function(e){var t,n,i=[],r=oR(rR(aR(e),XP,"."),".");for(t=0;t<r.length;t++)n=r[t],iR(i,ZP(qP,n)?"xn--"+uR(n):n);return nR(i,".")},UO=Yo,WO=Pa,VO=uf,GO={URLSearchParams:kO,getState:UR},KO=on,zO=KO.set,YO=KO.getterFor("URL"),qO=GO.URLSearchParams,XO=GO.getState,$O=RO.URL,JO=RO.TypeError,ZO=RO.parseInt,QO=Math.floor,eI=Math.pow,tI=IO("".charAt),nI=IO(/./.exec),iI=IO([].join),rI=IO(1..toString),oI=IO([].pop),aI=IO([].push),sI=IO("".replace),cI=IO([].shift),uI=IO("".split),lI=IO("".slice),fI=IO("".toLowerCase),hI=IO([].unshift),dI="Invalid scheme",pI="Invalid host",vI="Invalid port",gI=/[a-z]/i,yI=/[\d+-.a-z]/i,mI=/\d/,kI=/^0x/i,bI=/^[0-7]+$/,wI=/^\d+$/,_I=/^[\da-f]+$/i,CI=/[\0\t\n\r #%/:<>?@[\\\]^|]/,xI=/[\0\t\n\r #/:<>?@[\\\]^|]/,SI=/^[\u0000-\u0020]+/,TI=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,EI=/[\t\n\r]/g,PI=function(e){var t,n,i,r;if("number"==typeof e){for(t=[],n=0;n<4;n++)hI(t,e%256),e=QO(e/256);return iI(t,".")}if("object"==typeof e){for(t="",i=function(e){for(var t=null,n=1,i=null,r=0,o=0;o<8;o++)0!==e[o]?(r>n&&(t=i,n=r),i=null,r=0):(null===i&&(i=o),++r);return r>n&&(t=i,n=r),t}(e),n=0;n<8;n++)r&&0===e[n]||(r&&(r=!1),i===n?(t+=n?":":"::",r=!0):(t+=rI(e[n],16),n<7&&(t+=":")));return"["+t+"]"}return e},RI={},OI=NO({},RI,{" ":1,'"':1,"<":1,">":1,"`":1}),II=NO({},OI,{"#":1,"?":1,"{":1,"}":1}),LI=NO({},II,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),AI=function(e,t){var n=jO(e,0);return n>32&&n<127&&!MO(t,e)?e:encodeURIComponent(e)},DI={ftp:21,file:null,http:80,https:443,ws:80,wss:443},MI=function(e,t){var n;return 2==e.length&&nI(gI,tI(e,0))&&(":"==(n=tI(e,1))||!t&&"|"==n)},NI=function(e){var t;return e.length>1&&MI(lI(e,0,2))&&(2==e.length||"/"===(t=tI(e,2))||"\\"===t||"?"===t||"#"===t)},FI=function(e){return"."===e||"%2e"===fI(e)},BI={},jI={},HI={},UI={},WI={},VI={},GI={},KI={},zI={},YI={},qI={},XI={},$I={},JI={},ZI={},QI={},eL={},tL={},nL={},iL={},rL={},oL=function(e,t,n){var i,r,o,a=UO(e);if(t){if(r=this.parse(a))throw JO(r);this.searchParams=null}else{if(void 0!==n&&(i=new oL(n,!0)),r=this.parse(a,null,i))throw JO(r);(o=XO(new qO)).bindURL(this),this.searchParams=o}};oL.prototype={type:"URL",parse:function(e,t,n){var i,r,o,a,s,c=this,u=t||BI,l=0,f="",h=!1,d=!1,p=!1;for(e=UO(e),t||(c.scheme="",c.username="",c.password="",c.host=null,c.port=null,c.path=[],c.query=null,c.fragment=null,c.cannotBeABaseURL=!1,e=sI(e,SI,""),e=sI(e,TI,"$1")),e=sI(e,EI,""),i=FO(e);l<=i.length;){switch(r=i[l],u){case BI:if(!r||!nI(gI,r)){if(t)return dI;u=HI;continue}f+=fI(r),u=jI;break;case jI:if(r&&(nI(yI,r)||"+"==r||"-"==r||"."==r))f+=fI(r);else{if(":"!=r){if(t)return dI;f="",u=HI,l=0;continue}if(t&&(c.isSpecial()!=MO(DI,f)||"file"==f&&(c.includesCredentials()||null!==c.port)||"file"==c.scheme&&!c.host))return;if(c.scheme=f,t)return void(c.isSpecial()&&DI[c.scheme]==c.port&&(c.port=null));f="","file"==c.scheme?u=JI:c.isSpecial()&&n&&n.scheme==c.scheme?u=UI:c.isSpecial()?u=KI:"/"==i[l+1]?(u=WI,l++):(c.cannotBeABaseURL=!0,aI(c.path,""),u=nL)}break;case HI:if(!n||n.cannotBeABaseURL&&"#"!=r)return dI;if(n.cannotBeABaseURL&&"#"==r){c.scheme=n.scheme,c.path=BO(n.path),c.query=n.query,c.fragment="",c.cannotBeABaseURL=!0,u=rL;break}u="file"==n.scheme?JI:VI;continue;case UI:if("/"!=r||"/"!=i[l+1]){u=VI;continue}u=zI,l++;break;case WI:if("/"==r){u=YI;break}u=tL;continue;case VI:if(c.scheme=n.scheme,r==SO)c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=BO(n.path),c.query=n.query;else if("/"==r||"\\"==r&&c.isSpecial())u=GI;else if("?"==r)c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=BO(n.path),c.query="",u=iL;else{if("#"!=r){c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=BO(n.path),c.path.length--,u=tL;continue}c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=BO(n.path),c.query=n.query,c.fragment="",u=rL}break;case GI:if(!c.isSpecial()||"/"!=r&&"\\"!=r){if("/"!=r){c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,u=tL;continue}u=YI}else u=zI;break;case KI:if(u=zI,"/"!=r||"/"!=tI(f,l+1))continue;l++;break;case zI:if("/"!=r&&"\\"!=r){u=YI;continue}break;case YI:if("@"==r){h&&(f="%40"+f),h=!0,o=FO(f);for(var v=0;v<o.length;v++){var g=o[v];if(":"!=g||p){var y=AI(g,LI);p?c.password+=y:c.username+=y}else p=!0}f=""}else if(r==SO||"/"==r||"?"==r||"#"==r||"\\"==r&&c.isSpecial()){if(h&&""==f)return"Invalid authority";l-=FO(f).length+1,f="",u=qI}else f+=r;break;case qI:case XI:if(t&&"file"==c.scheme){u=QI;continue}if(":"!=r||d){if(r==SO||"/"==r||"?"==r||"#"==r||"\\"==r&&c.isSpecial()){if(c.isSpecial()&&""==f)return pI;if(t&&""==f&&(c.includesCredentials()||null!==c.port))return;if(a=c.parseHost(f))return a;if(f="",u=eL,t)return;continue}"["==r?d=!0:"]"==r&&(d=!1),f+=r}else{if(""==f)return pI;if(a=c.parseHost(f))return a;if(f="",u=$I,t==XI)return}break;case $I:if(!nI(mI,r)){if(r==SO||"/"==r||"?"==r||"#"==r||"\\"==r&&c.isSpecial()||t){if(""!=f){var m=ZO(f,10);if(m>65535)return vI;c.port=c.isSpecial()&&m===DI[c.scheme]?null:m,f=""}if(t)return;u=eL;continue}return vI}f+=r;break;case JI:if(c.scheme="file","/"==r||"\\"==r)u=ZI;else{if(!n||"file"!=n.scheme){u=tL;continue}if(r==SO)c.host=n.host,c.path=BO(n.path),c.query=n.query;else if("?"==r)c.host=n.host,c.path=BO(n.path),c.query="",u=iL;else{if("#"!=r){NI(iI(BO(i,l),""))||(c.host=n.host,c.path=BO(n.path),c.shortenPath()),u=tL;continue}c.host=n.host,c.path=BO(n.path),c.query=n.query,c.fragment="",u=rL}}break;case ZI:if("/"==r||"\\"==r){u=QI;break}n&&"file"==n.scheme&&!NI(iI(BO(i,l),""))&&(MI(n.path[0],!0)?aI(c.path,n.path[0]):c.host=n.host),u=tL;continue;case QI:if(r==SO||"/"==r||"\\"==r||"?"==r||"#"==r){if(!t&&MI(f))u=tL;else if(""==f){if(c.host="",t)return;u=eL}else{if(a=c.parseHost(f))return a;if("localhost"==c.host&&(c.host=""),t)return;f="",u=eL}continue}f+=r;break;case eL:if(c.isSpecial()){if(u=tL,"/"!=r&&"\\"!=r)continue}else if(t||"?"!=r)if(t||"#"!=r){if(r!=SO&&(u=tL,"/"!=r))continue}else c.fragment="",u=rL;else c.query="",u=iL;break;case tL:if(r==SO||"/"==r||"\\"==r&&c.isSpecial()||!t&&("?"==r||"#"==r)){if(".."===(s=fI(s=f))||"%2e."===s||".%2e"===s||"%2e%2e"===s?(c.shortenPath(),"/"==r||"\\"==r&&c.isSpecial()||aI(c.path,"")):FI(f)?"/"==r||"\\"==r&&c.isSpecial()||aI(c.path,""):("file"==c.scheme&&!c.path.length&&MI(f)&&(c.host&&(c.host=""),f=tI(f,0)+":"),aI(c.path,f)),f="","file"==c.scheme&&(r==SO||"?"==r||"#"==r))for(;c.path.length>1&&""===c.path[0];)cI(c.path);"?"==r?(c.query="",u=iL):"#"==r&&(c.fragment="",u=rL)}else f+=AI(r,II);break;case nL:"?"==r?(c.query="",u=iL):"#"==r?(c.fragment="",u=rL):r!=SO&&(c.path[0]+=AI(r,RI));break;case iL:t||"#"!=r?r!=SO&&("'"==r&&c.isSpecial()?c.query+="%27":c.query+="#"==r?"%23":AI(r,RI)):(c.fragment="",u=rL);break;case rL:r!=SO&&(c.fragment+=AI(r,OI))}l++}},parseHost:function(e){var t,n,i;if("["==tI(e,0)){if("]"!=tI(e,e.length-1))return pI;if(t=function(e){var t,n,i,r,o,a,s,c=[0,0,0,0,0,0,0,0],u=0,l=null,f=0,h=function(){return tI(e,f)};if(":"==h()){if(":"!=tI(e,1))return;f+=2,l=++u}for(;h();){if(8==u)return;if(":"!=h()){for(t=n=0;n<4&&nI(_I,h());)t=16*t+ZO(h(),16),f++,n++;if("."==h()){if(0==n)return;if(f-=n,u>6)return;for(i=0;h();){if(r=null,i>0){if(!("."==h()&&i<4))return;f++}if(!nI(mI,h()))return;for(;nI(mI,h());){if(o=ZO(h(),10),null===r)r=o;else{if(0==r)return;r=10*r+o}if(r>255)return;f++}c[u]=256*c[u]+r,2!=++i&&4!=i||u++}if(4!=i)return;break}if(":"==h()){if(f++,!h())return}else if(h())return;c[u++]=t}else{if(null!==l)return;f++,l=++u}}if(null!==l)for(a=u-l,u=7;0!=u&&a>0;)s=c[u],c[u--]=c[l+a-1],c[l+--a]=s;else if(8!=u)return;return c}(lI(e,1,-1)),!t)return pI;this.host=t}else if(this.isSpecial()){if(e=HO(e),nI(CI,e))return pI;if(t=function(e){var t,n,i,r,o,a,s,c=uI(e,".");if(c.length&&""==c[c.length-1]&&c.length--,(t=c.length)>4)return e;for(n=[],i=0;i<t;i++){if(""==(r=c[i]))return e;if(o=10,r.length>1&&"0"==tI(r,0)&&(o=nI(kI,r)?16:8,r=lI(r,8==o?1:2)),""===r)a=0;else{if(!nI(10==o?wI:8==o?bI:_I,r))return e;a=ZO(r,o)}aI(n,a)}for(i=0;i<t;i++)if(a=n[i],i==t-1){if(a>=eI(256,5-t))return null}else if(a>255)return null;for(s=oI(n),i=0;i<n.length;i++)s+=n[i]*eI(256,3-i);return s}(e),null===t)return pI;this.host=t}else{if(nI(xI,e))return pI;for(t="",n=FO(e),i=0;i<n.length;i++)t+=AI(n[i],RI);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return MO(DI,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"==this.scheme&&1==t&&MI(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,n=e.username,i=e.password,r=e.host,o=e.port,a=e.path,s=e.query,c=e.fragment,u=t+":";return null!==r?(u+="//",e.includesCredentials()&&(u+=n+(i?":"+i:"")+"@"),u+=PI(r),null!==o&&(u+=":"+o)):"file"==t&&(u+="//"),u+=e.cannotBeABaseURL?a[0]:a.length?"/"+iI(a,"/"):"",null!==s&&(u+="?"+s),null!==c&&(u+="#"+c),u},setHref:function(e){var t=this.parse(e);if(t)throw JO(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"==e)try{return new aL(e.path[0]).origin}catch(e){return"null"}return"file"!=e&&this.isSpecial()?e+"://"+PI(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(UO(e)+":",BI)},getUsername:function(){return this.username},setUsername:function(e){var t=FO(UO(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var n=0;n<t.length;n++)this.username+=AI(t[n],LI)}},getPassword:function(){return this.password},setPassword:function(e){var t=FO(UO(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var n=0;n<t.length;n++)this.password+=AI(t[n],LI)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?PI(e):PI(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,qI)},getHostname:function(){var e=this.host;return null===e?"":PI(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,XI)},getPort:function(){var e=this.port;return null===e?"":UO(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""==(e=UO(e))?this.port=null:this.parse(e,$I))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+iI(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,eL))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""==(e=UO(e))?this.query=null:("?"==tI(e,0)&&(e=lI(e,1)),this.query="",this.parse(e,iL)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!=(e=UO(e))?("#"==tI(e,0)&&(e=lI(e,1)),this.fragment="",this.parse(e,rL)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var aL=function(e){var t=DO(this,sL),n=VO(arguments.length,1)>1?arguments[1]:void 0,i=zO(t,new oL(e,!1,n));EO||(t.href=i.serialize(),t.origin=i.getOrigin(),t.protocol=i.getProtocol(),t.username=i.getUsername(),t.password=i.getPassword(),t.host=i.getHost(),t.hostname=i.getHostname(),t.port=i.getPort(),t.pathname=i.getPathname(),t.search=i.getSearch(),t.searchParams=i.getSearchParams(),t.hash=i.getHash())},sL=aL.prototype,cL=function(e,t){return{get:function(){return YO(this)[e]()},set:t&&function(e){return YO(this)[t](e)},configurable:!0,enumerable:!0}};if(EO&&(AO(sL,"href",cL("serialize","setHref")),AO(sL,"origin",cL("getOrigin")),AO(sL,"protocol",cL("getProtocol","setProtocol")),AO(sL,"username",cL("getUsername","setUsername")),AO(sL,"password",cL("getPassword","setPassword")),AO(sL,"host",cL("getHost","setHost")),AO(sL,"hostname",cL("getHostname","setHostname")),AO(sL,"port",cL("getPort","setPort")),AO(sL,"pathname",cL("getPathname","setPathname")),AO(sL,"search",cL("getSearch","setSearch")),AO(sL,"searchParams",cL("getSearchParams")),AO(sL,"hash",cL("getHash","setHash"))),LO(sL,"toJSON",(function(){return YO(this).serialize()}),{enumerable:!0}),LO(sL,"toString",(function(){return YO(this).serialize()}),{enumerable:!0}),$O){var uL=$O.createObjectURL,lL=$O.revokeObjectURL;uL&&LO(aL,"createObjectURL",OO(uL,$O)),lL&&LO(aL,"revokeObjectURL",OO(lL,$O))}function fL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function hL(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fL(Object(n),!0).forEach((function(t){Go(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fL(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function dL(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}WO(aL,"URL"),TO({global:!0,constructor:!0,forced:!PO,sham:!EO},{URL:aL});var pL="info",vL=V_,gL=function(e){Ho(n,e);var t=dL(n);function n(){var e;Bo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Uo(e=t.call.apply(t,[this].concat(r))),"_recordUserActions",(function(t){var n=e._getTime(),i=Object.assign({},t,{msg:t.msg||t.action});e._stats[pL].push(hL(hL({type:"userAction"},n),{},{payload:i}))})),Go(Uo(e),"_onReset",(function(){e.reset()})),Go(Uo(e),"_recordInfo",(function(t){e.info(t)})),Go(Uo(e),"_downloadStats",(function(){var t=e.getStats(),n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=window.URL.createObjectURL(n),r=document.createElement("a");r.style.display="none",r.href=i,r.download="player.txt",r.disabled=!1,r.click()})),e}return Fo(n,[{key:"_getTime",value:function(){return{timestamp:Date.now(),timeFormat:(new Date).toISOString()}}},{key:"afterCreate",value:function(){this.reset(),this.on(B_,this._recordUserActions),this.on(vL.STATS_INFO,this._recordInfo),this.on(vL.STATS_DOWNLOAD,this._downloadStats),this.on(vL.STATS_RESET,this._onReset)}},{key:"destroy",value:function(){this.offAll()}},{key:"downloadStats",value:function(){this._downloadStats()}},{key:"info",value:function(e){e.profile?this._infoProfile(e):this._info(e)}},{key:"_info",value:function(e){var t=this._getTime();this._stats[pL].push(hL(hL({},t),{},{payload:e}))}},{key:"_infoProfile",value:function(e){if(e&&e.startMs){var t=hL({cat:"function",dur:Date.now()-e.startMs,name:e.name||e.msg,ph:"X",pid:0,tid:0,ts:e.startMs,profile:!0},e);this._info(t)}else console.warn("infoProfile need object data, include startMs")}},{key:"reset",value:function(){var e;this._stats=(Go(e={},pL,[]),Go(e,"media",{}),e)}},{key:"getStats",value:function(){for(var e=this.player.video,t=[],n=0;n<e.buffered.length;n++)t.push({start:e.buffered.start(n),end:e.buffered.end(n)});var i={currentTime:e.currentTime,readyState:e.readyState,buffered:t,paused:e.paused,ended:e.ended};return this._stats.media=i,{raw:this._stats,timestat:this._getTimeStats(),profile:this._getProfile()}}},{key:"_getTimeStats",value:function(){var e=this._stats[pL].map((function(e){var t=e.payload.data,n="";try{t instanceof Error?n=t.msg:void 0!==t&&(n=JSON.stringify(t))}catch(e){console.log("err",e)}return"[".concat(e.timeFormat,"] : ").concat(e.payload.msg," ").concat(n," ")}));return e}},{key:"_getProfile",value:function(){var e={traceEvents:[]};return this._stats[pL].forEach((function(t){t.payload.profile&&e.traceEvents.push(t.payload)})),e}}],[{key:"pluginName",get:function(){return"stats"}},{key:"defaultConfig",get:function(){return{}}}]),n}(EC);function yL(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var mL=function(e){Ho(n,e);var t=yL(n);function n(){var e;Bo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Uo(e=t.call.apply(t,[this].concat(r))),"onGapJump",(function(){var t=Uo(e),i=t.player,r=t.config;if(i.video.readyState!==HTMLMediaElement.HAVE_NOTHING){if(i.video.seeking){if(!e.seekingEventReceived)return}else e.seekingEventReceived=!1;if(!i.video.paused||0===i.video.currentTime||!e.hasPlayed){var o=i.video.buffered,a=r.smallGapLimit||.5,s=r.gapDetectionThreshold||.3,c=i.video.currentTime,u=e._getIndex(o,c,s);if(null!==u&&0!==u){console.log("GapJump bufferRange ",o.start(u),o.end(u));var l=o.start(u)+.1;if(!(l>i.video.duration)){var f=l-c,h=f<=a;f<n.BROWSER_GAP_TOLERANCE||h&&(!1!==r.useGapJump&&(i.video.currentTime=e.isSafari?l+.1:l),e.player&&e.player.emit("detectGap"),console.log("gapJump gapIndex",u," isGapSamll:",h," currentTime:",i.video.currentTime," jumpSize:",c-i.video.currentTime),.08!==l&&i&&i.emit("log",{type:"oneevent",end_type:"gap",vid:i.config.vid,ext:{video_postion:Math.floor(1e3*l)}}))}}}}})),e}return Fo(n,[{key:"afterCreate",value:function(){var e=this;!1!==this.config.useGapJump&&(this.hasPlayed=!1,this.seekingEventReceived=!1,this.isSafari=/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),this.on(n_,this.onGapJump),this.on(qw,(function(){e.hasPlayed=!0})),this.on(Qw,(function(){e.seekingEventReceived=!0})))}},{key:"_getIndex",value:function(e,t,n){if(!e||!e.length)return null;if(1===e.length&&e.end(0)-e.start(0)<1e-6)return null;for(var i=this._getBuffered(e),r=null,o=0;o<i.length;o++){if(i[o].start>t&&(0===o||i[o-1].end-t<=n)){r=o;break}}return r}},{key:"_getBuffered",value:function(e){if(!e)return[];for(var t=[],n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t}}],[{key:"pluginName",get:function(){return"gapJump"}},{key:"defaultConfig",get:function(){return{useGapJump:!1,smallGapLimit:.5,gapDetectionThreshold:.3}}}]),n}(HC);function kL(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}mL.BROWSER_GAP_TOLERANCE=.001;var bL=function(e){Ho(n,e);var t=kL(n);function n(){var e;Bo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Uo(e=t.call.apply(t,[this].concat(r))),"onWaiting",(function(){var t=Uo(e).config;e.jumpCnt>t.jumpCntMax||e.timer||!1===t.useWaitingTimeoutJump||(e.timer=setTimeout(e.onJump,1e3*t.waitingTime))})),Go(Uo(e),"onJump",(function(){var t=Uo(e),n=t.player,i=t.config;if(clearTimeout(e.timer),e.timer=null,!(e.jumpCnt>i.jumpCntMax||!1===i.useWaitingTimeoutJump||n.video.paused&&0!==n.video.currentTime&&e.hasPlayed)){e.jumpSize=i.jumpSize*(e.jumpCnt+1),e.jumpCnt===i.jumpSize&&e.jumpSize<6&&(e.jumpSize=6);var r=n.currentTime+e.jumpSize;r>n.video.duration||(e.jumpCnt++,n.currentTime=r)}})),e}return Fo(n,[{key:"afterCreate",value:function(){var e=this,t=this.config,n=t.useWaitingTimeoutJump,i=t.jumpSize;!1!==n&&(this.hasPlayed=!1,this.jumpCnt=0,this.timer=null,this.jumpSize=i,this.on(n_,this.onWaiting),this.on([Xw,i_],(function(){clearTimeout(e.timer),e.timer=null,e.jumpSize=e.config.jumpSize})),this.on(qw,(function(){e.hasPlayed=!0})))}}],[{key:"pluginName",get:function(){return"waitingTimeoutJump"}},{key:"defaultConfig",get:function(){return{useWaitingTimeoutJump:!1,waitingTime:15,jumpSize:2,jumpCntMax:4}}}]),n}(HC);function wL(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var _L="cdn",CL=["cdn"],xL=function(e){Ho(n,e);var t=wL(n);function n(){var e;Bo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Uo(e=t.call.apply(t,[this].concat(r))),"startTimer",(function(){Ww.isMSE(e.player.video)||(e.cnt=0,e.timer=setTimeout(e.testSpeed,e.config.testTimeStep))})),Go(Uo(e),"initSpeedList",(function(){CL.forEach((function(e){!n.speedListCache[e]&&(n.speedListCache[e]=[])}))})),Go(Uo(e),"_onRealSpeedChange",(function(t){t.speed&&e.appendList(t.speed,t.len,t.time,t.type||_L)})),Go(Uo(e),"testSpeed",(function(){if(clearTimeout(e.timer),e.timer=null,e.player&&e.config.openSpeed){var t=e.config,n=t.url,i=t.loadSize,r=t.testCnt,o=t.testTimeStep,a=n+(n.indexOf("?")<0?"?testst=":"&testst=")+Date.now();if(!(e.cnt>=r)){e.cnt++;try{var s=(new Date).getTime(),c=null,u=new XMLHttpRequest;e.xhr=u,u.open("GET",a);var l={},f=Math.floor(10*Math.random());l.Range="bytes="+f+"-"+(i+f),l&&Object.keys(l).forEach((function(e){u.setRequestHeader(e,l[e])})),u.onreadystatechange=function(){if(4===u.readyState){e.xhr=null,c=(new Date).getTime();var t=u.getResponseHeader("Content-Length")/1024*8,n=c-s,i=Math.round(1e3*t/n);e.appendList(i,t,n),e.timer=setTimeout(e.testSpeed,o)}},u.send()}catch(e){console.error(e)}}}})),Go(Uo(e),"appendList",(function(t,i,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:_L;if(n.speedListCache&&n.speedListCache[o]){var a=e.config.saveSpeedMax;n.speedListCache[o].length>=a&&n.speedListCache[o].shift(),n.speedListCache[o].push({speed:t,bytes:i,time:r});var s=Uo(e).player;s&&(o===_L?s.realTimeSpeed=t:s[e.getSpeedName("realTime",o)]=t),e.updateSpeed(o)}})),Go(Uo(e),"updateSpeed",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_L,i=n.getAvgSpeedKbs(t),r=Uo(e).player;if(r)if(t===_L)r.avgSpeed&&i===r.avgSpeed||(r.avgSpeed=i,r.emit(__,{speed:i,realTimeSpeed:r.realTimeSpeed}));else{var o=e.getSpeedName("avg",t);r[o]&&i===r[o]||(r[o]=i,r.emit(__,{speed:i,realTimeSpeed:r.realTimeSpeed}))}})),e}return Fo(n,[{key:"afterCreate",value:function(){var e=this.config,t=e.openSpeed,n=e.addSpeedTypeList,i=e.testCnt;(null==n?void 0:n.length)>0&&CL.push.apply(CL,Py(n)),this.initSpeedList(),t&&(this.on("real_time_speed",this._onRealSpeedChange),this.timer=null,this.cnt=0,this.xhr=null,i>0&&this.on([a_,k_],this.startTimer))}},{key:"getSpeedName",value:function(e,t){return e+"Speed"+t.toUpperCase()}},{key:"openSpeed",get:function(){return this.config.openSpeed},set:function(e){if(this.config.openSpeed=e,!e&&this.timer)return clearTimeout(this.timer),void(this.timer=null);if(this.config.openSpeed){if(this.timer)return;this.timer=setTimeout(this.testSpeed,this.config.testTimeStep)}}},{key:"destroy",value:function(){this.off("real_time_speed",this._onRealSpeedChange),this.off([a_,k_],this.startTimer),clearTimeout(this.timer),this.timer=null,this.xhr&&4!==this.xhr.readyState&&(this.xhr.cancel&&this.xhr.cancel(),this.xhr=null)}}],[{key:"pluginName",get:function(){return"testspeed"}},{key:"speedSampleList",get:function(){return n.speedListCache}},{key:"defaultConfig",get:function(){return{openSpeed:!1,testCnt:3,loadSize:204800,testTimeStep:3e3,url:"",saveSpeedMax:20,addSpeedTypeList:[]}}},{key:"getAvgSpeedKbs",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_L;if(!n.speedListCache||!n.speedListCache[e])return-1;if(n.speedListCache[e].length<=0)return-1;var t=0;return n.speedListCache[e].map((function(e){t+=e.speed})),Math.floor(t/n.speedListCache[e].length)}},{key:"getWeightedSpeedKbs",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_L,t=-1;if(!n.speedListCache||!n.speedListCache[e])return t;if(n.speedListCache[e].length<=0)return t;var i=[];n.speedListCache[e].forEach((function(e){i.push(e)})),i.sort((function(e,t){return e.speed-t.speed}));for(var r=i.length,o=0,a=0;a<r;a++)o+=i[a].bytes;o/=2;for(var s=0;s<r;s++)(o-=i[s].bytes)<=0&&(t=i[s].speed);return t<0?-1:t}}]),n}(HC);function SL(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}Go(xL,"speedListCache",{});var TL=function(e){Ho(n,e);var t=SL(n);function n(){return Bo(this,n),t.apply(this,arguments)}return Fo(n,[{key:"afterCreate",value:function(){var e=this,t=this.player,n=this.config,i=t.media||t.video;!n.disabled&&i.getVideoPlaybackQuality&&(this.timer=null,this._resetData(),this.on(l_,(function(){e._resetData(),e._stopTick()})),this.on(qw,(function(){e._startTick()})),this.on(Jw,(function(){e._stopTick()})),this.on($w,(function(){e._stopTick()})),this.on(f_,(function(){e._stopTick()})))}},{key:"_startTick",value:function(){var e=this;this._stopTick(),this._timer=setTimeout((function(){e._checkDecodeFPS(),e._startTick()}),this.config.tick)}},{key:"_stopTick",value:function(){clearTimeout(this._timer),this._timer=null}},{key:"_checkBuffer",value:function(e,t){for(var n=!1,i=[],r=0;r<t.length;r++){var o=t.start(r),a=t.end(r);if(i.push({start:o,end:a}),o<=e&&e<=a-1){n=!0;break}}return{enoughBuffer:n,buffers:i}}},{key:"_checkStuck",value:function(e,t,n,i){var r=this.player.media||this.player.video,o=document.hidden,a=r.paused,s=r.readyState,c=r.currentTime,u=r.buffered;if(!(o||a||s<4)){var l=this._checkBuffer(c,u),f=l.enoughBuffer,h=l.buffers;f&&(e<=this.config.reportFrame?(this._currentStuckCount++,this._payload.push({currentTime:c,buffers:h,curDecodedFrames:e,totalVideoFrames:t,droppedVideoFrames:n,checkInterval:i}),this._currentStuckCount>=this.config.stuckCount&&(this.emit(G_,this._payload),this._resetCheck())):this._resetCheck())}}},{key:"_resetCheck",value:function(){this._payload=[],this._currentStuckCount=0}},{key:"_resetData",value:function(){this._lastDecodedFrames=0,this._currentStuckCount=0,this._lastCheckPoint=null,this._payload=[]}},{key:"_checkDecodeFPS",value:function(){var e,t,n=(null===(e=this.player)||void 0===e?void 0:e.media)||(null===(t=this.player)||void 0===t?void 0:t.video);if(n){var i=n.getVideoPlaybackQuality(),r=i.totalVideoFrames,o=i.droppedVideoFrames,a=performance.now();if(r&&this._lastCheckPoint){var s=r-this._lastDecodedFrames,c=a-this._lastCheckPoint;this._checkStuck(s,r,o,c)}this._lastDecodedFrames=r,this._lastCheckPoint=a}else this._stopTick()}},{key:"destroy",value:function(){this._stopTick(),this._resetData()}}],[{key:"pluginName",get:function(){return"FpsDetect"}},{key:"defaultConfig",get:function(){return{disabled:!1,tick:1e3,stuckCount:3,reportFrame:0}}}]),n}(HC);ux.use({LANG:"zh-cn",TEXT:{ERROR_TYPES:{network:{code:1,msg:"视频下载错误"},mse:{code:2,msg:"流追加错误"},parse:{code:3,msg:"解析错误"},format:{code:4,msg:"格式错误"},decoder:{code:5,msg:"解码错误"},runtime:{code:6,msg:"语法错误"},timeout:{code:7,msg:"播放超时"},other:{code:8,msg:"其他错误"}},HAVE_NOTHING:"没有关于音频/视频是否就绪的信息",HAVE_METADATA:"音频/视频的元数据已就绪",HAVE_CURRENT_DATA:"关于当前播放位置的数据是可用的,但没有足够的数据来播放下一帧/毫秒",HAVE_FUTURE_DATA:"当前及至少下一帧的数据是可用的",HAVE_ENOUGH_DATA:"可用数据足以开始播放",NETWORK_EMPTY:"音频/视频尚未初始化",NETWORK_IDLE:"音频/视频是活动的且已选取资源,但并未使用网络",NETWORK_LOADING:"浏览器正在下载数据",NETWORK_NO_SOURCE:"未找到音频/视频来源",MEDIA_ERR_ABORTED:"取回过程被用户中止",MEDIA_ERR_NETWORK:"网络错误",MEDIA_ERR_DECODE:"解码错误",MEDIA_ERR_SRC_NOT_SUPPORTED:"不支持的音频/视频格式",REPLAY:"重播",ERROR:"网络连接似乎出现了问题",PLAY_TIPS:"播放",PAUSE_TIPS:"暂停",PLAYNEXT_TIPS:"下一集",DOWNLOAD_TIPS:"下载",ROTATE_TIPS:"旋转",RELOAD_TIPS:"重新载入",FULLSCREEN_TIPS:"进入全屏",EXITFULLSCREEN_TIPS:"退出全屏",CSSFULLSCREEN_TIPS:"进入样式全屏",EXITCSSFULLSCREEN_TIPS:"退出样式全屏",TEXTTRACK:"字幕",PIP:"画中画",SCREENSHOT:"截图",LIVE:"正在直播",OFF:"关闭",OPEN:"开启",MINI_DRAG:"点击按住可拖动视频",MINISCREEN:"小屏幕",REFRESH_TIPS:"请试试",REFRESH:"刷新",FORWARD:"快进中",LIVE_TIP:"直播"}});var EL=Fo((function e(t,n){var i,r,o;Bo(this,e);var a=n&&"mobile"===n.isMobileSimulateMode,s=n.isLive,c=[].concat(s?[]:[RT,DP,RP,VT],[DT,UT,ZT,QE,hP,pP,rP,aP,XT,$E]),u=[Hx,Vx,Xx,gT,Zx,bP,CP,IP,pS];this.plugins=[Nx,gL,bL,mL].concat(Py(c),u);var l=a?"mobile":$_.device;switch(l){case"pc":(i=this.plugins).push.apply(i,[hT,mS,mP,xL,TL]);break;case"mobile":(r=this.plugins).push.apply(r,[aT]);break;default:(o=this.plugins).push.apply(o,[hT,mS,mP])}($_.os.isIpad||"pc"===l)&&this.plugins.push(UP),$_.os.isIpad&&this.plugins.push(mS),this.ignores=[],this.i18n=[]}));function PL(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var RL=function(e){Ho(n,e);var t=PL(n);function n(){return Bo(this,n),t.apply(this,arguments)}return Fo(n)}(wx);return Go(RL,"defaultPreset",EL),Go(RL,"Util",Ww),Go(RL,"Sniffer",$_),Go(RL,"Errors",Yw),Go(RL,"Events",K_),Go(RL,"Plugin",HC),Go(RL,"BasePlugin",EC),Go(RL,"I18N",ux),Go(RL,"STATE_CLASS",QC),Go(RL,"PAUSE_TYPES",sC),Go(RL,"BUFFER_CONTROL_TYPES",cC),Go(RL,"InstManager",dx),Go(RL,"TestSpeed",xL),RL}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Player=t()}(this,(function(){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=function(e){return e&&e.Math==Math&&e},n=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof e&&e)||function(){return this}()||e||Function("return this")(),i={exports:{}},r=n,o=Object.defineProperty,a=function(e,t){try{o(r,e,{value:t,configurable:!0,writable:!0})}catch(n){r[e]=t}return t},s=a,c="__core-js_shared__",u=n[c]||s(c,{}),l=u;(i.exports=function(e,t){return l[e]||(l[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.30.2",mode:"global",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 f,h,d=function(e){try{return!!e()}catch(e){return!0}},p=!d((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),v=p,g=Function.prototype,y=g.call,m=v&&g.bind.bind(y,y),k=v?m:function(e){return function(){return y.apply(e,arguments)}},b=function(e){return null==e},w=b,_=TypeError,C=function(e){if(w(e))throw _("Can't call method on "+e);return e},x=C,S=Object,T=function(e){return S(x(e))},E=T,P=k({}.hasOwnProperty),R=Object.hasOwn||function(e,t){return P(E(e),t)},O=k,I=0,L=Math.random(),A=O(1..toString),D=function(e){return"Symbol("+(void 0===e?"":e)+")_"+A(++I+L,36)},M="undefined"!=typeof navigator&&String(navigator.userAgent)||"",N=n,F=M,B=N.process,j=N.Deno,H=B&&B.versions||j&&j.version,U=H&&H.v8;U&&(h=(f=U.split("."))[0]>0&&f[0]<4?1:+(f[0]+f[1])),!h&&F&&(!(f=F.match(/Edge\/(\d+)/))||f[1]>=74)&&(f=F.match(/Chrome\/(\d+)/))&&(h=+f[1]);var W=h,V=W,G=d,K=n.String,z=!!Object.getOwnPropertySymbols&&!G((function(){var e=Symbol();return!K(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&V&&V<41})),Y=z&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,q=n,X=i.exports,$=R,J=D,Z=z,Q=Y,ee=q.Symbol,te=X("wks"),ne=Q?ee.for||ee:ee&&ee.withoutSetter||J,ie=function(e){return $(te,e)||(te[e]=Z&&$(ee,e)?ee[e]:ne("Symbol."+e)),te[e]},re={};re[ie("toStringTag")]="z";var oe="[object z]"===String(re),ae="object"==typeof document&&document.all,se={all:ae,IS_HTMLDDA:void 0===ae&&void 0!==ae},ce=se.all,ue=se.IS_HTMLDDA?function(e){return"function"==typeof e||e===ce}:function(e){return"function"==typeof e},le={},fe=!d((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),he=ue,de=se.all,pe=se.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:he(e)||e===de}:function(e){return"object"==typeof e?null!==e:he(e)},ve=pe,ge=n.document,ye=ve(ge)&&ve(ge.createElement),me=function(e){return ye?ge.createElement(e):{}},ke=me,be=!fe&&!d((function(){return 7!=Object.defineProperty(ke("div"),"a",{get:function(){return 7}}).a})),we=fe&&d((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),_e=pe,Ce=String,xe=TypeError,Se=function(e){if(_e(e))return e;throw xe(Ce(e)+" is not an object")},Te=p,Ee=Function.prototype.call,Pe=Te?Ee.bind(Ee):function(){return Ee.apply(Ee,arguments)},Re=n,Oe=ue,Ie=function(e,t){return arguments.length<2?(n=Re[e],Oe(n)?n:void 0):Re[e]&&Re[e][t];var n},Le=k({}.isPrototypeOf),Ae=Ie,De=ue,Me=Le,Ne=Object,Fe=Y?function(e){return"symbol"==typeof e}:function(e){var t=Ae("Symbol");return De(t)&&Me(t.prototype,Ne(e))},Be=String,je=function(e){try{return Be(e)}catch(e){return"Object"}},He=ue,Ue=je,We=TypeError,Ve=function(e){if(He(e))return e;throw We(Ue(e)+" is not a function")},Ge=Ve,Ke=b,ze=function(e,t){var n=e[t];return Ke(n)?void 0:Ge(n)},Ye=Pe,qe=ue,Xe=pe,$e=TypeError,Je=Pe,Ze=pe,Qe=Fe,et=ze,tt=function(e,t){var n,i;if("string"===t&&qe(n=e.toString)&&!Xe(i=Ye(n,e)))return i;if(qe(n=e.valueOf)&&!Xe(i=Ye(n,e)))return i;if("string"!==t&&qe(n=e.toString)&&!Xe(i=Ye(n,e)))return i;throw $e("Can't convert object to primitive value")},nt=TypeError,it=ie("toPrimitive"),rt=function(e,t){if(!Ze(e)||Qe(e))return e;var n,i=et(e,it);if(i){if(void 0===t&&(t="default"),n=Je(i,e,t),!Ze(n)||Qe(n))return n;throw nt("Can't convert object to primitive value")}return void 0===t&&(t="number"),tt(e,t)},ot=rt,at=Fe,st=function(e){var t=ot(e,"string");return at(t)?t:t+""},ct=fe,ut=be,lt=we,ft=Se,ht=st,dt=TypeError,pt=Object.defineProperty,vt=Object.getOwnPropertyDescriptor,gt="enumerable",yt="configurable",mt="writable";le.f=ct?lt?function(e,t,n){if(ft(e),t=ht(t),ft(n),"function"==typeof e&&"prototype"===t&&"value"in n&&mt in n&&!n[mt]){var i=vt(e,t);i&&i[mt]&&(e[t]=n.value,n={configurable:yt in n?n[yt]:i[yt],enumerable:gt in n?n[gt]:i[gt],writable:!1})}return pt(e,t,n)}:pt:function(e,t,n){if(ft(e),t=ht(t),ft(n),ut)try{return pt(e,t,n)}catch(e){}if("get"in n||"set"in n)throw dt("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var kt={exports:{}},bt=fe,wt=R,_t=Function.prototype,Ct=bt&&Object.getOwnPropertyDescriptor,xt=wt(_t,"name"),St={EXISTS:xt,PROPER:xt&&"something"===function(){}.name,CONFIGURABLE:xt&&(!bt||bt&&Ct(_t,"name").configurable)},Tt=ue,Et=u,Pt=k(Function.toString);Tt(Et.inspectSource)||(Et.inspectSource=function(e){return Pt(e)});var Rt,Ot,It,Lt=Et.inspectSource,At=ue,Dt=n.WeakMap,Mt=At(Dt)&&/native code/.test(String(Dt)),Nt=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Ft=le,Bt=Nt,jt=fe?function(e,t,n){return Ft.f(e,t,Bt(1,n))}:function(e,t,n){return e[t]=n,e},Ht=i.exports,Ut=D,Wt=Ht("keys"),Vt=function(e){return Wt[e]||(Wt[e]=Ut(e))},Gt={},Kt=Mt,zt=n,Yt=pe,qt=jt,Xt=R,$t=u,Jt=Vt,Zt=Gt,Qt="Object already initialized",en=zt.TypeError,tn=zt.WeakMap;if(Kt||$t.state){var nn=$t.state||($t.state=new tn);nn.get=nn.get,nn.has=nn.has,nn.set=nn.set,Rt=function(e,t){if(nn.has(e))throw en(Qt);return t.facade=e,nn.set(e,t),t},Ot=function(e){return nn.get(e)||{}},It=function(e){return nn.has(e)}}else{var rn=Jt("state");Zt[rn]=!0,Rt=function(e,t){if(Xt(e,rn))throw en(Qt);return t.facade=e,qt(e,rn,t),t},Ot=function(e){return Xt(e,rn)?e[rn]:{}},It=function(e){return Xt(e,rn)}}var on={set:Rt,get:Ot,has:It,enforce:function(e){return It(e)?Ot(e):Rt(e,{})},getterFor:function(e){return function(t){var n;if(!Yt(t)||(n=Ot(t)).type!==e)throw en("Incompatible receiver, "+e+" required");return n}}},an=k,sn=d,cn=ue,un=R,ln=fe,fn=St.CONFIGURABLE,hn=Lt,dn=on.enforce,pn=on.get,vn=String,gn=Object.defineProperty,yn=an("".slice),mn=an("".replace),kn=an([].join),bn=ln&&!sn((function(){return 8!==gn((function(){}),"length",{value:8}).length})),wn=String(String).split("String"),_n=kt.exports=function(e,t,n){"Symbol("===yn(vn(t),0,7)&&(t="["+mn(vn(t),/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!un(e,"name")||fn&&e.name!==t)&&(ln?gn(e,"name",{value:t,configurable:!0}):e.name=t),bn&&n&&un(n,"arity")&&e.length!==n.arity&&gn(e,"length",{value:n.arity});try{n&&un(n,"constructor")&&n.constructor?ln&&gn(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var i=dn(e);return un(i,"source")||(i.source=kn(wn,"string"==typeof t?t:"")),e};Function.prototype.toString=_n((function(){return cn(this)&&pn(this).source||hn(this)}),"toString");var Cn=ue,xn=le,Sn=kt.exports,Tn=a,En=function(e,t,n,i){i||(i={});var r=i.enumerable,o=void 0!==i.name?i.name:t;if(Cn(n)&&Sn(n,o,i),i.global)r?e[t]=n:Tn(t,n);else{try{i.unsafe?e[t]&&(r=!0):delete e[t]}catch(e){}r?e[t]=n:xn.f(e,t,{value:n,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return e},Pn=k,Rn=Pn({}.toString),On=Pn("".slice),In=function(e){return On(Rn(e),8,-1)},Ln=oe,An=ue,Dn=In,Mn=ie("toStringTag"),Nn=Object,Fn="Arguments"==Dn(function(){return arguments}()),Bn=Ln?Dn:function(e){var t,n,i;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Nn(e),Mn))?n:Fn?Dn(t):"Object"==(i=Dn(t))&&An(t.callee)?"Arguments":i},jn=Bn,Hn=oe?{}.toString:function(){return"[object "+jn(this)+"]"};oe||En(Object.prototype,"toString",Hn,{unsafe:!0});var Un={},Wn={},Vn={}.propertyIsEnumerable,Gn=Object.getOwnPropertyDescriptor,Kn=Gn&&!Vn.call({1:2},1);Wn.f=Kn?function(e){var t=Gn(this,e);return!!t&&t.enumerable}:Vn;var zn=d,Yn=In,qn=Object,Xn=k("".split),$n=zn((function(){return!qn("z").propertyIsEnumerable(0)}))?function(e){return"String"==Yn(e)?Xn(e,""):qn(e)}:qn,Jn=$n,Zn=C,Qn=function(e){return Jn(Zn(e))},ei=fe,ti=Pe,ni=Wn,ii=Nt,ri=Qn,oi=st,ai=R,si=be,ci=Object.getOwnPropertyDescriptor;Un.f=ei?ci:function(e,t){if(e=ri(e),t=oi(t),si)try{return ci(e,t)}catch(e){}if(ai(e,t))return ii(!ti(ni.f,e,t),e[t])};var ui={},li=Math.ceil,fi=Math.floor,hi=Math.trunc||function(e){var t=+e;return(t>0?fi:li)(t)},di=function(e){var t=+e;return t!=t||0===t?0:hi(t)},pi=di,vi=Math.max,gi=Math.min,yi=function(e,t){var n=pi(e);return n<0?vi(n+t,0):gi(n,t)},mi=di,ki=Math.min,bi=function(e){return e>0?ki(mi(e),9007199254740991):0},wi=bi,_i=function(e){return wi(e.length)},Ci=Qn,xi=yi,Si=_i,Ti=function(e){return function(t,n,i){var r,o=Ci(t),a=Si(o),s=xi(i,a);if(e&&n!=n){for(;a>s;)if((r=o[s++])!=r)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===n)return e||s||0;return!e&&-1}},Ei={includes:Ti(!0),indexOf:Ti(!1)},Pi=R,Ri=Qn,Oi=Ei.indexOf,Ii=Gt,Li=k([].push),Ai=function(e,t){var n,i=Ri(e),r=0,o=[];for(n in i)!Pi(Ii,n)&&Pi(i,n)&&Li(o,n);for(;t.length>r;)Pi(i,n=t[r++])&&(~Oi(o,n)||Li(o,n));return o},Di=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Mi=Ai,Ni=Di.concat("length","prototype");ui.f=Object.getOwnPropertyNames||function(e){return Mi(e,Ni)};var Fi={};Fi.f=Object.getOwnPropertySymbols;var Bi=Ie,ji=ui,Hi=Fi,Ui=Se,Wi=k([].concat),Vi=Bi("Reflect","ownKeys")||function(e){var t=ji.f(Ui(e)),n=Hi.f;return n?Wi(t,n(e)):t},Gi=R,Ki=Vi,zi=Un,Yi=le,qi=function(e,t,n){for(var i=Ki(t),r=Yi.f,o=zi.f,a=0;a<i.length;a++){var s=i[a];Gi(e,s)||n&&Gi(n,s)||r(e,s,o(t,s))}},Xi=d,$i=ue,Ji=/#|\.prototype\./,Zi=function(e,t){var n=er[Qi(e)];return n==nr||n!=tr&&($i(t)?Xi(t):!!t)},Qi=Zi.normalize=function(e){return String(e).replace(Ji,".").toLowerCase()},er=Zi.data={},tr=Zi.NATIVE="N",nr=Zi.POLYFILL="P",ir=Zi,rr=n,or=Un.f,ar=jt,sr=En,cr=a,ur=qi,lr=ir,fr=function(e,t){var n,i,r,o,a,s=e.target,c=e.global,u=e.stat;if(n=c?rr:u?rr[s]||cr(s,{}):(rr[s]||{}).prototype)for(i in t){if(o=t[i],r=e.dontCallGetSet?(a=or(n,i))&&a.value:n[i],!lr(c?i:s+(u?".":"#")+i,e.forced)&&void 0!==r){if(typeof o==typeof r)continue;ur(o,r)}(e.sham||r&&r.sham)&&ar(o,"sham",!0),sr(n,i,o,e)}},hr=p,dr=Function.prototype,pr=dr.apply,vr=dr.call,gr="object"==typeof Reflect&&Reflect.apply||(hr?vr.bind(pr):function(){return vr.apply(pr,arguments)}),yr=k([].slice),mr=k,kr=Ve,br=pe,wr=R,_r=yr,Cr=p,xr=Function,Sr=mr([].concat),Tr=mr([].join),Er={},Pr=Cr?xr.bind:function(e){var t=kr(this),n=t.prototype,i=_r(arguments,1),r=function(){var n=Sr(i,_r(arguments));return this instanceof r?function(e,t,n){if(!wr(Er,t)){for(var i=[],r=0;r<t;r++)i[r]="a["+r+"]";Er[t]=xr("C,a","return new C("+Tr(i,",")+")")}return Er[t](e,n)}(t,n.length,n):t.apply(e,n)};return br(n)&&(r.prototype=n),r},Rr=k,Or=d,Ir=ue,Lr=Bn,Ar=Lt,Dr=function(){},Mr=[],Nr=Ie("Reflect","construct"),Fr=/^\s*(?:class|function)\b/,Br=Rr(Fr.exec),jr=!Fr.exec(Dr),Hr=function(e){if(!Ir(e))return!1;try{return Nr(Dr,Mr,e),!0}catch(e){return!1}},Ur=function(e){if(!Ir(e))return!1;switch(Lr(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return jr||!!Br(Fr,Ar(e))}catch(e){return!0}};Ur.sham=!0;var Wr=!Nr||Or((function(){var e;return Hr(Hr.call)||!Hr(Object)||!Hr((function(){e=!0}))||e}))?Ur:Hr,Vr=Wr,Gr=je,Kr=TypeError,zr=function(e){if(Vr(e))return e;throw Kr(Gr(e)+" is not a constructor")},Yr={},qr=Ai,Xr=Di,$r=Object.keys||function(e){return qr(e,Xr)},Jr=fe,Zr=we,Qr=le,eo=Se,to=Qn,no=$r;Yr.f=Jr&&!Zr?Object.defineProperties:function(e,t){eo(e);for(var n,i=to(t),r=no(t),o=r.length,a=0;o>a;)Qr.f(e,n=r[a++],i[n]);return e};var io,ro=Ie("document","documentElement"),oo=Se,ao=Yr,so=Di,co=Gt,uo=ro,lo=me,fo="prototype",ho="script",po=Vt("IE_PROTO"),vo=function(){},go=function(e){return"<"+ho+">"+e+"</"+ho+">"},yo=function(e){e.write(go("")),e.close();var t=e.parentWindow.Object;return e=null,t},mo=function(){try{io=new ActiveXObject("htmlfile")}catch(e){}var e,t,n;mo="undefined"!=typeof document?document.domain&&io?yo(io):(t=lo("iframe"),n="java"+ho+":",t.style.display="none",uo.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(go("document.F=Object")),e.close(),e.F):yo(io);for(var i=so.length;i--;)delete mo[fo][so[i]];return mo()};co[po]=!0;var ko=Object.create||function(e,t){var n;return null!==e?(vo[fo]=oo(e),n=new vo,vo[fo]=null,n[po]=e):n=mo(),void 0===t?n:ao.f(n,t)},bo=fr,wo=gr,_o=Pr,Co=zr,xo=Se,So=pe,To=ko,Eo=d,Po=Ie("Reflect","construct"),Ro=Object.prototype,Oo=[].push,Io=Eo((function(){function e(){}return!(Po((function(){}),[],e)instanceof e)})),Lo=!Eo((function(){Po((function(){}))})),Ao=Io||Lo;function Do(e){return Do="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},Do(e)}function Mo(e){var t=function(e,t){if("object"!==Do(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==Do(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Do(t)?t:String(t)}function No(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,Mo(i.key),i)}}function Fo(e,t,n){return t&&No(e.prototype,t),n&&No(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Bo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jo(e,t){return jo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},jo(e,t)}function Ho(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&&jo(e,t)}function Uo(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Wo(e,t){if(t&&("object"===Do(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Uo(e)}function Vo(e){return Vo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Vo(e)}function Go(e,t,n){return(t=Mo(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}bo({target:"Reflect",stat:!0,forced:Ao,sham:Ao},{construct:function(e,t){Co(e),xo(t);var n=arguments.length<3?e:Co(arguments[2]);if(Lo&&!Io)return Po(e,t,n);if(e==n){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var i=[null];return wo(Oo,i,t),new(wo(_o,e,i))}var r=n.prototype,o=To(So(r)?r:Ro),a=wo(e,o,t);return So(a)?a:o}});var Ko=Bn,zo=String,Yo=function(e){if("Symbol"===Ko(e))throw TypeError("Cannot convert a Symbol value to a string");return zo(e)},qo={},Xo=st,$o=le,Jo=Nt,Zo=function(e,t,n){var i=Xo(t);i in e?$o.f(e,i,Jo(0,n)):e[i]=n},Qo=yi,ea=_i,ta=Zo,na=Array,ia=Math.max,ra=function(e,t,n){for(var i=ea(e),r=Qo(t,i),o=Qo(void 0===n?i:n,i),a=na(ia(o-r,0)),s=0;r<o;r++,s++)ta(a,s,e[r]);return a.length=s,a},oa=In,aa=Qn,sa=ui.f,ca=ra,ua="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];qo.f=function(e){return ua&&"Window"==oa(e)?function(e){try{return sa(e)}catch(e){return ca(ua)}}(e):sa(aa(e))};var la=kt.exports,fa=le,ha=function(e,t,n){return n.get&&la(n.get,t,{getter:!0}),n.set&&la(n.set,t,{setter:!0}),fa.f(e,t,n)},da={},pa=ie;da.f=pa;var va=n,ga=va,ya=R,ma=da,ka=le.f,ba=function(e){var t=ga.Symbol||(ga.Symbol={});ya(t,e)||ka(t,e,{value:ma.f(e)})},wa=Pe,_a=Ie,Ca=ie,xa=En,Sa=le.f,Ta=R,Ea=ie("toStringTag"),Pa=function(e,t,n){e&&!n&&(e=e.prototype),e&&!Ta(e,Ea)&&Sa(e,Ea,{configurable:!0,value:t})},Ra=In,Oa=k,Ia=function(e){if("Function"===Ra(e))return Oa(e)},La=Ve,Aa=p,Da=Ia(Ia.bind),Ma=function(e,t){return La(e),void 0===t?e:Aa?Da(e,t):function(){return e.apply(t,arguments)}},Na=In,Fa=Array.isArray||function(e){return"Array"==Na(e)},Ba=Fa,ja=Wr,Ha=pe,Ua=ie("species"),Wa=Array,Va=function(e){var t;return Ba(e)&&(t=e.constructor,(ja(t)&&(t===Wa||Ba(t.prototype))||Ha(t)&&null===(t=t[Ua]))&&(t=void 0)),void 0===t?Wa:t},Ga=function(e,t){return new(Va(e))(0===t?0:t)},Ka=Ma,za=$n,Ya=T,qa=_i,Xa=Ga,$a=k([].push),Ja=function(e){var t=1==e,n=2==e,i=3==e,r=4==e,o=6==e,a=7==e,s=5==e||o;return function(c,u,l,f){for(var h,d,p=Ya(c),v=za(p),g=Ka(u,l),y=qa(v),m=0,k=f||Xa,b=t?k(c,y):n||a?k(c,0):void 0;y>m;m++)if((s||m in v)&&(d=g(h=v[m],m,p),e))if(t)b[m]=d;else if(d)switch(e){case 3:return!0;case 5:return h;case 6:return m;case 2:$a(b,h)}else switch(e){case 4:return!1;case 7:$a(b,h)}return o?-1:i||r?r:b}},Za={forEach:Ja(0),map:Ja(1),filter:Ja(2),some:Ja(3),every:Ja(4),find:Ja(5),findIndex:Ja(6),filterReject:Ja(7)},Qa=fr,es=n,ts=Pe,ns=k,is=fe,rs=z,os=d,as=R,ss=Le,cs=Se,us=Qn,ls=st,fs=Yo,hs=Nt,ds=ko,ps=$r,vs=ui,gs=qo,ys=Fi,ms=Un,ks=le,bs=Yr,ws=Wn,_s=En,Cs=ha,xs=i.exports,Ss=Gt,Ts=D,Es=ie,Ps=da,Rs=ba,Os=function(){var e=_a("Symbol"),t=e&&e.prototype,n=t&&t.valueOf,i=Ca("toPrimitive");t&&!t[i]&&xa(t,i,(function(e){return wa(n,this)}),{arity:1})},Is=Pa,Ls=on,As=Za.forEach,Ds=Vt("hidden"),Ms="Symbol",Ns="prototype",Fs=Ls.set,Bs=Ls.getterFor(Ms),js=Object[Ns],Hs=es.Symbol,Us=Hs&&Hs[Ns],Ws=es.TypeError,Vs=es.QObject,Gs=ms.f,Ks=ks.f,zs=gs.f,Ys=ws.f,qs=ns([].push),Xs=xs("symbols"),$s=xs("op-symbols"),Js=xs("wks"),Zs=!Vs||!Vs[Ns]||!Vs[Ns].findChild,Qs=is&&os((function(){return 7!=ds(Ks({},"a",{get:function(){return Ks(this,"a",{value:7}).a}})).a}))?function(e,t,n){var i=Gs(js,t);i&&delete js[t],Ks(e,t,n),i&&e!==js&&Ks(js,t,i)}:Ks,ec=function(e,t){var n=Xs[e]=ds(Us);return Fs(n,{type:Ms,tag:e,description:t}),is||(n.description=t),n},tc=function(e,t,n){e===js&&tc($s,t,n),cs(e);var i=ls(t);return cs(n),as(Xs,i)?(n.enumerable?(as(e,Ds)&&e[Ds][i]&&(e[Ds][i]=!1),n=ds(n,{enumerable:hs(0,!1)})):(as(e,Ds)||Ks(e,Ds,hs(1,{})),e[Ds][i]=!0),Qs(e,i,n)):Ks(e,i,n)},nc=function(e,t){cs(e);var n=us(t),i=ps(n).concat(ac(n));return As(i,(function(t){is&&!ts(ic,n,t)||tc(e,t,n[t])})),e},ic=function(e){var t=ls(e),n=ts(Ys,this,t);return!(this===js&&as(Xs,t)&&!as($s,t))&&(!(n||!as(this,t)||!as(Xs,t)||as(this,Ds)&&this[Ds][t])||n)},rc=function(e,t){var n=us(e),i=ls(t);if(n!==js||!as(Xs,i)||as($s,i)){var r=Gs(n,i);return!r||!as(Xs,i)||as(n,Ds)&&n[Ds][i]||(r.enumerable=!0),r}},oc=function(e){var t=zs(us(e)),n=[];return As(t,(function(e){as(Xs,e)||as(Ss,e)||qs(n,e)})),n},ac=function(e){var t=e===js,n=zs(t?$s:us(e)),i=[];return As(n,(function(e){!as(Xs,e)||t&&!as(js,e)||qs(i,Xs[e])})),i};rs||(Hs=function(){if(ss(Us,this))throw Ws("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?fs(arguments[0]):void 0,t=Ts(e),n=function(e){this===js&&ts(n,$s,e),as(this,Ds)&&as(this[Ds],t)&&(this[Ds][t]=!1),Qs(this,t,hs(1,e))};return is&&Zs&&Qs(js,t,{configurable:!0,set:n}),ec(t,e)},_s(Us=Hs[Ns],"toString",(function(){return Bs(this).tag})),_s(Hs,"withoutSetter",(function(e){return ec(Ts(e),e)})),ws.f=ic,ks.f=tc,bs.f=nc,ms.f=rc,vs.f=gs.f=oc,ys.f=ac,Ps.f=function(e){return ec(Es(e),e)},is&&(Cs(Us,"description",{configurable:!0,get:function(){return Bs(this).description}}),_s(js,"propertyIsEnumerable",ic,{unsafe:!0}))),Qa({global:!0,constructor:!0,wrap:!0,forced:!rs,sham:!rs},{Symbol:Hs}),As(ps(Js),(function(e){Rs(e)})),Qa({target:Ms,stat:!0,forced:!rs},{useSetter:function(){Zs=!0},useSimple:function(){Zs=!1}}),Qa({target:"Object",stat:!0,forced:!rs,sham:!is},{create:function(e,t){return void 0===t?ds(e):nc(ds(e),t)},defineProperty:tc,defineProperties:nc,getOwnPropertyDescriptor:rc}),Qa({target:"Object",stat:!0,forced:!rs},{getOwnPropertyNames:oc}),Os(),Is(Hs,Ms),Ss[Ds]=!0;var sc=z&&!!Symbol.for&&!!Symbol.keyFor,cc=fr,uc=Ie,lc=R,fc=Yo,hc=i.exports,dc=sc,pc=hc("string-to-symbol-registry"),vc=hc("symbol-to-string-registry");cc({target:"Symbol",stat:!0,forced:!dc},{for:function(e){var t=fc(e);if(lc(pc,t))return pc[t];var n=uc("Symbol")(t);return pc[t]=n,vc[n]=t,n}});var gc=fr,yc=R,mc=Fe,kc=je,bc=sc,wc=(0,i.exports)("symbol-to-string-registry");gc({target:"Symbol",stat:!0,forced:!bc},{keyFor:function(e){if(!mc(e))throw TypeError(kc(e)+" is not a symbol");if(yc(wc,e))return wc[e]}});var _c=Fa,Cc=ue,xc=In,Sc=Yo,Tc=k([].push),Ec=fr,Pc=Ie,Rc=gr,Oc=Pe,Ic=k,Lc=d,Ac=ue,Dc=Fe,Mc=yr,Nc=function(e){if(Cc(e))return e;if(_c(e)){for(var t=e.length,n=[],i=0;i<t;i++){var r=e[i];"string"==typeof r?Tc(n,r):"number"!=typeof r&&"Number"!=xc(r)&&"String"!=xc(r)||Tc(n,Sc(r))}var o=n.length,a=!0;return function(e,t){if(a)return a=!1,t;if(_c(this))return t;for(var i=0;i<o;i++)if(n[i]===e)return t}}},Fc=z,Bc=String,jc=Pc("JSON","stringify"),Hc=Ic(/./.exec),Uc=Ic("".charAt),Wc=Ic("".charCodeAt),Vc=Ic("".replace),Gc=Ic(1..toString),Kc=/[\uD800-\uDFFF]/g,zc=/^[\uD800-\uDBFF]$/,Yc=/^[\uDC00-\uDFFF]$/,qc=!Fc||Lc((function(){var e=Pc("Symbol")();return"[null]"!=jc([e])||"{}"!=jc({a:e})||"{}"!=jc(Object(e))})),Xc=Lc((function(){return'"\\udf06\\ud834"'!==jc("\udf06\ud834")||'"\\udead"'!==jc("\udead")})),$c=function(e,t){var n=Mc(arguments),i=Nc(t);if(Ac(i)||void 0!==e&&!Dc(e))return n[1]=function(e,t){if(Ac(i)&&(t=Oc(i,this,Bc(e),t)),!Dc(t))return t},Rc(jc,null,n)},Jc=function(e,t,n){var i=Uc(n,t-1),r=Uc(n,t+1);return Hc(zc,e)&&!Hc(Yc,r)||Hc(Yc,e)&&!Hc(zc,i)?"\\u"+Gc(Wc(e,0),16):e};jc&&Ec({target:"JSON",stat:!0,arity:3,forced:qc||Xc},{stringify:function(e,t,n){var i=Mc(arguments),r=Rc(qc?$c:jc,null,i);return Xc&&"string"==typeof r?Vc(r,Kc,Jc):r}});var Zc=Fi,Qc=T;fr({target:"Object",stat:!0,forced:!z||d((function(){Zc.f(1)}))},{getOwnPropertySymbols:function(e){var t=Zc.f;return t?t(Qc(e)):[]}});var eu=fr,tu=d,nu=Qn,iu=Un.f,ru=fe;eu({target:"Object",stat:!0,forced:!ru||tu((function(){iu(1)})),sham:!ru},{getOwnPropertyDescriptor:function(e,t){return iu(nu(e),t)}});var ou=Vi,au=Qn,su=Un,cu=Zo;function uu(){return uu="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Vo(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},uu.apply(this,arguments)}fr({target:"Object",stat:!0,sham:!fe},{getOwnPropertyDescriptors:function(e){for(var t,n,i=au(e),r=su.f,o=ou(i),a={},s=0;o.length>s;)void 0!==(n=r(i,t=o[s++]))&&cu(a,t,n);return a}});var lu=TypeError,fu=function(e){if(e>9007199254740991)throw lu("Maximum allowed index exceeded");return e},hu=d,du=W,pu=ie("species"),vu=function(e){return du>=51||!hu((function(){var t=[];return(t.constructor={})[pu]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},gu=fr,yu=d,mu=Fa,ku=pe,bu=T,wu=_i,_u=fu,Cu=Zo,xu=Ga,Su=vu,Tu=W,Eu=ie("isConcatSpreadable"),Pu=Tu>=51||!yu((function(){var e=[];return e[Eu]=!1,e.concat()[0]!==e})),Ru=function(e){if(!ku(e))return!1;var t=e[Eu];return void 0!==t?!!t:mu(e)};gu({target:"Array",proto:!0,arity:1,forced:!Pu||!Su("concat")},{concat:function(e){var t,n,i,r,o,a=bu(this),s=xu(a,0),c=0;for(t=-1,i=arguments.length;t<i;t++)if(Ru(o=-1===t?a:arguments[t]))for(r=wu(o),_u(c+r),n=0;n<r;n++,c++)n in o&&Cu(s,c,o[n]);else _u(c+1),Cu(s,c++,o);return s.length=c,s}});var Ou=Za.map;fr({target:"Array",proto:!0,forced:!vu("map")},{map:function(e){return Ou(this,e,arguments.length>1?arguments[1]:void 0)}});var Iu=T,Lu=$r;fr({target:"Object",stat:!0,forced:d((function(){Lu(1)}))},{keys:function(e){return Lu(Iu(e))}});var Au=fr,Du=Fa,Mu=Wr,Nu=pe,Fu=yi,Bu=_i,ju=Qn,Hu=Zo,Uu=ie,Wu=yr,Vu=vu("slice"),Gu=Uu("species"),Ku=Array,zu=Math.max;Au({target:"Array",proto:!0,forced:!Vu},{slice:function(e,t){var n,i,r,o=ju(this),a=Bu(o),s=Fu(e,a),c=Fu(void 0===t?a:t,a);if(Du(o)&&(n=o.constructor,(Mu(n)&&(n===Ku||Du(n.prototype))||Nu(n)&&null===(n=n[Gu]))&&(n=void 0),n===Ku||void 0===n))return Wu(o,s,c);for(i=new(void 0===n?Ku:n)(zu(c-s,0)),r=0;s<c;s++,r++)s in o&&Hu(i,r,o[s]);return i.length=r,i}});var Yu={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},qu=me("span").classList,Xu=qu&&qu.constructor&&qu.constructor.prototype,$u=Xu===Object.prototype?void 0:Xu,Ju=d,Zu=function(e,t){var n=[][e];return!!n&&Ju((function(){n.call(null,t||function(){return 1},1)}))},Qu=Za.forEach,el=Zu("forEach")?[].forEach:function(e){return Qu(this,e,arguments.length>1?arguments[1]:void 0)},tl=n,nl=Yu,il=$u,rl=el,ol=jt,al=function(e){if(e&&e.forEach!==rl)try{ol(e,"forEach",rl)}catch(t){e.forEach=rl}};for(var sl in nl)nl[sl]&&al(tl[sl]&&tl[sl].prototype);al(il);var cl=fr,ul=$n,ll=Qn,fl=Zu,hl=k([].join);cl({target:"Array",proto:!0,forced:ul!=Object||!fl("join",",")},{join:function(e){return hl(ll(this),void 0===e?",":e)}});var dl=fe,pl=Fa,vl=TypeError,gl=Object.getOwnPropertyDescriptor,yl=dl&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}(),ml=je,kl=TypeError,bl=function(e,t){if(!delete e[t])throw kl("Cannot delete property "+ml(t)+" of "+ml(e))},wl=fr,_l=T,Cl=yi,xl=di,Sl=_i,Tl=yl?function(e,t){if(pl(e)&&!gl(e,"length").writable)throw vl("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t},El=fu,Pl=Ga,Rl=Zo,Ol=bl,Il=vu("splice"),Ll=Math.max,Al=Math.min;wl({target:"Array",proto:!0,forced:!Il},{splice:function(e,t){var n,i,r,o,a,s,c=_l(this),u=Sl(c),l=Cl(e,u),f=arguments.length;for(0===f?n=i=0:1===f?(n=0,i=u-l):(n=f-2,i=Al(Ll(xl(t),0),u-l)),El(u+n-i),r=Pl(c,i),o=0;o<i;o++)(a=l+o)in c&&Rl(r,o,c[a]);if(r.length=i,n<i){for(o=l;o<u-i;o++)s=o+n,(a=o+i)in c?c[s]=c[a]:Ol(c,s);for(o=u;o>u-i+n;o--)Ol(c,o-1)}else if(n>i)for(o=u-i;o>l;o--)s=o+n-1,(a=o+i-1)in c?c[s]=c[a]:Ol(c,s);for(o=0;o<n;o++)c[o+l]=arguments[o+2];return Tl(c,u-i+n),r}});var Dl,Ml,Nl,Fl,Bl="undefined"!=typeof process&&"process"==In(process),jl=k,Hl=Ve,Ul=ue,Wl=String,Vl=TypeError,Gl=function(e,t,n){try{return jl(Hl(Object.getOwnPropertyDescriptor(e,t)[n]))}catch(e){}},Kl=Se,zl=function(e){if("object"==typeof e||Ul(e))return e;throw Vl("Can't set "+Wl(e)+" as a prototype")},Yl=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Gl(Object.prototype,"__proto__","set"))(n,[]),t=n instanceof Array}catch(e){}return function(n,i){return Kl(n),zl(i),t?e(n,i):n.__proto__=i,n}}():void 0),ql=Ie,Xl=ha,$l=fe,Jl=ie("species"),Zl=function(e){var t=ql(e);$l&&t&&!t[Jl]&&Xl(t,Jl,{configurable:!0,get:function(){return this}})},Ql=Le,ef=TypeError,tf=function(e,t){if(Ql(t,e))return e;throw ef("Incorrect invocation")},nf=Se,rf=zr,of=b,af=ie("species"),sf=function(e,t){var n,i=nf(e).constructor;return void 0===i||of(n=nf(i)[af])?t:rf(n)},cf=TypeError,uf=function(e,t){if(e<t)throw cf("Not enough arguments");return e},lf=/(?:ipad|iphone|ipod).*applewebkit/i.test(M),ff=n,hf=gr,df=Ma,pf=ue,vf=R,gf=d,yf=ro,mf=yr,kf=me,bf=uf,wf=lf,_f=Bl,Cf=ff.setImmediate,xf=ff.clearImmediate,Sf=ff.process,Tf=ff.Dispatch,Ef=ff.Function,Pf=ff.MessageChannel,Rf=ff.String,Of=0,If={},Lf="onreadystatechange";gf((function(){Dl=ff.location}));var Af=function(e){if(vf(If,e)){var t=If[e];delete If[e],t()}},Df=function(e){return function(){Af(e)}},Mf=function(e){Af(e.data)},Nf=function(e){ff.postMessage(Rf(e),Dl.protocol+"//"+Dl.host)};Cf&&xf||(Cf=function(e){bf(arguments.length,1);var t=pf(e)?e:Ef(e),n=mf(arguments,1);return If[++Of]=function(){hf(t,void 0,n)},Ml(Of),Of},xf=function(e){delete If[e]},_f?Ml=function(e){Sf.nextTick(Df(e))}:Tf&&Tf.now?Ml=function(e){Tf.now(Df(e))}:Pf&&!wf?(Fl=(Nl=new Pf).port2,Nl.port1.onmessage=Mf,Ml=df(Fl.postMessage,Fl)):ff.addEventListener&&pf(ff.postMessage)&&!ff.importScripts&&Dl&&"file:"!==Dl.protocol&&!gf(Nf)?(Ml=Nf,ff.addEventListener("message",Mf,!1)):Ml=Lf in kf("script")?function(e){yf.appendChild(kf("script"))[Lf]=function(){yf.removeChild(this),Af(e)}}:function(e){setTimeout(Df(e),0)});var Ff={set:Cf,clear:xf},Bf=function(){this.head=null,this.tail=null};Bf.prototype={add:function(e){var t={item:e,next:null},n=this.tail;n?n.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 jf,Hf,Uf,Wf,Vf,Gf=Bf,Kf=/ipad|iphone|ipod/i.test(M)&&"undefined"!=typeof Pebble,zf=/web0s(?!.*chrome)/i.test(M),Yf=n,qf=Ma,Xf=Un.f,$f=Ff.set,Jf=Gf,Zf=lf,Qf=Kf,eh=zf,th=Bl,nh=Yf.MutationObserver||Yf.WebKitMutationObserver,ih=Yf.document,rh=Yf.process,oh=Yf.Promise,ah=Xf(Yf,"queueMicrotask"),sh=ah&&ah.value;if(!sh){var ch=new Jf,uh=function(){var e,t;for(th&&(e=rh.domain)&&e.exit();t=ch.get();)try{t()}catch(e){throw ch.head&&jf(),e}e&&e.enter()};Zf||th||eh||!nh||!ih?!Qf&&oh&&oh.resolve?((Wf=oh.resolve(void 0)).constructor=oh,Vf=qf(Wf.then,Wf),jf=function(){Vf(uh)}):th?jf=function(){rh.nextTick(uh)}:($f=qf($f,Yf),jf=function(){$f(uh)}):(Hf=!0,Uf=ih.createTextNode(""),new nh(uh).observe(Uf,{characterData:!0}),jf=function(){Uf.data=Hf=!Hf}),sh=function(e){ch.head||jf(),ch.add(e)}}var lh=sh,fh=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},hh=n.Promise,dh="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,ph=!dh&&!Bl&&"object"==typeof window&&"object"==typeof document,vh=n,gh=hh,yh=ue,mh=ir,kh=Lt,bh=ie,wh=ph,_h=dh,Ch=W;gh&&gh.prototype;var xh=bh("species"),Sh=!1,Th=yh(vh.PromiseRejectionEvent),Eh=mh("Promise",(function(){var e=kh(gh),t=e!==String(gh);if(!t&&66===Ch)return!0;if(!Ch||Ch<51||!/native code/.test(e)){var n=new gh((function(e){e(1)})),i=function(e){e((function(){}),(function(){}))};if((n.constructor={})[xh]=i,!(Sh=n.then((function(){}))instanceof i))return!0}return!t&&(wh||_h)&&!Th})),Ph={CONSTRUCTOR:Eh,REJECTION_EVENT:Th,SUBCLASSING:Sh},Rh={},Oh=Ve,Ih=TypeError,Lh=function(e){var t,n;this.promise=new e((function(e,i){if(void 0!==t||void 0!==n)throw Ih("Bad Promise constructor");t=e,n=i})),this.resolve=Oh(t),this.reject=Oh(n)};Rh.f=function(e){return new Lh(e)};var Ah,Dh,Mh,Nh=fr,Fh=Bl,Bh=n,jh=Pe,Hh=En,Uh=Yl,Wh=Pa,Vh=Zl,Gh=Ve,Kh=ue,zh=pe,Yh=tf,qh=sf,Xh=Ff.set,$h=lh,Jh=function(e,t){try{1==arguments.length?console.error(e):console.error(e,t)}catch(e){}},Zh=fh,Qh=Gf,ed=on,td=hh,nd=Rh,id="Promise",rd=Ph.CONSTRUCTOR,od=Ph.REJECTION_EVENT,ad=Ph.SUBCLASSING,sd=ed.getterFor(id),cd=ed.set,ud=td&&td.prototype,ld=td,fd=ud,hd=Bh.TypeError,dd=Bh.document,pd=Bh.process,vd=nd.f,gd=vd,yd=!!(dd&&dd.createEvent&&Bh.dispatchEvent),md="unhandledrejection",kd=function(e){var t;return!(!zh(e)||!Kh(t=e.then))&&t},bd=function(e,t){var n,i,r,o=t.value,a=1==t.state,s=a?e.ok:e.fail,c=e.resolve,u=e.reject,l=e.domain;try{s?(a||(2===t.rejection&&Sd(t),t.rejection=1),!0===s?n=o:(l&&l.enter(),n=s(o),l&&(l.exit(),r=!0)),n===e.promise?u(hd("Promise-chain cycle")):(i=kd(n))?jh(i,n,c,u):c(n)):u(o)}catch(e){l&&!r&&l.exit(),u(e)}},wd=function(e,t){e.notified||(e.notified=!0,$h((function(){for(var n,i=e.reactions;n=i.get();)bd(n,e);e.notified=!1,t&&!e.rejection&&Cd(e)})))},_d=function(e,t,n){var i,r;yd?((i=dd.createEvent("Event")).promise=t,i.reason=n,i.initEvent(e,!1,!0),Bh.dispatchEvent(i)):i={promise:t,reason:n},!od&&(r=Bh["on"+e])?r(i):e===md&&Jh("Unhandled promise rejection",n)},Cd=function(e){jh(Xh,Bh,(function(){var t,n=e.facade,i=e.value;if(xd(e)&&(t=Zh((function(){Fh?pd.emit("unhandledRejection",i,n):_d(md,n,i)})),e.rejection=Fh||xd(e)?2:1,t.error))throw t.value}))},xd=function(e){return 1!==e.rejection&&!e.parent},Sd=function(e){jh(Xh,Bh,(function(){var t=e.facade;Fh?pd.emit("rejectionHandled",t):_d("rejectionhandled",t,e.value)}))},Td=function(e,t,n){return function(i){e(t,i,n)}},Ed=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,wd(e,!0))},Pd=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw hd("Promise can't be resolved itself");var i=kd(t);i?$h((function(){var n={done:!1};try{jh(i,t,Td(Pd,n,e),Td(Ed,n,e))}catch(t){Ed(n,t,e)}})):(e.value=t,e.state=1,wd(e,!1))}catch(t){Ed({done:!1},t,e)}}};if(rd&&(fd=(ld=function(e){Yh(this,fd),Gh(e),jh(Ah,this);var t=sd(this);try{e(Td(Pd,t),Td(Ed,t))}catch(e){Ed(t,e)}}).prototype,(Ah=function(e){cd(this,{type:id,done:!1,notified:!1,parent:!1,reactions:new Qh,rejection:!1,state:0,value:void 0})}).prototype=Hh(fd,"then",(function(e,t){var n=sd(this),i=vd(qh(this,ld));return n.parent=!0,i.ok=!Kh(e)||e,i.fail=Kh(t)&&t,i.domain=Fh?pd.domain:void 0,0==n.state?n.reactions.add(i):$h((function(){bd(i,n)})),i.promise})),Dh=function(){var e=new Ah,t=sd(e);this.promise=e,this.resolve=Td(Pd,t),this.reject=Td(Ed,t)},nd.f=vd=function(e){return e===ld||undefined===e?new Dh(e):gd(e)},Kh(td)&&ud!==Object.prototype)){Mh=ud.then,ad||Hh(ud,"then",(function(e,t){var n=this;return new ld((function(e,t){jh(Mh,n,e,t)})).then(e,t)}),{unsafe:!0});try{delete ud.constructor}catch(e){}Uh&&Uh(ud,fd)}Nh({global:!0,constructor:!0,wrap:!0,forced:rd},{Promise:ld}),Wh(ld,id,!1),Vh(id);var Rd={},Od=Rd,Id=ie("iterator"),Ld=Array.prototype,Ad=function(e){return void 0!==e&&(Od.Array===e||Ld[Id]===e)},Dd=Bn,Md=ze,Nd=b,Fd=Rd,Bd=ie("iterator"),jd=function(e){if(!Nd(e))return Md(e,Bd)||Md(e,"@@iterator")||Fd[Dd(e)]},Hd=Pe,Ud=Ve,Wd=Se,Vd=je,Gd=jd,Kd=TypeError,zd=function(e,t){var n=arguments.length<2?Gd(e):t;if(Ud(n))return Wd(Hd(n,e));throw Kd(Vd(e)+" is not iterable")},Yd=Pe,qd=Se,Xd=ze,$d=function(e,t,n){var i,r;qd(e);try{if(!(i=Xd(e,"return"))){if("throw"===t)throw n;return n}i=Yd(i,e)}catch(e){r=!0,i=e}if("throw"===t)throw n;if(r)throw i;return qd(i),n},Jd=Ma,Zd=Pe,Qd=Se,ep=je,tp=Ad,np=_i,ip=Le,rp=zd,op=jd,ap=$d,sp=TypeError,cp=function(e,t){this.stopped=e,this.result=t},up=cp.prototype,lp=function(e,t,n){var i,r,o,a,s,c,u,l=n&&n.that,f=!(!n||!n.AS_ENTRIES),h=!(!n||!n.IS_RECORD),d=!(!n||!n.IS_ITERATOR),p=!(!n||!n.INTERRUPTED),v=Jd(t,l),g=function(e){return i&&ap(i,"normal",e),new cp(!0,e)},y=function(e){return f?(Qd(e),p?v(e[0],e[1],g):v(e[0],e[1])):p?v(e,g):v(e)};if(h)i=e.iterator;else if(d)i=e;else{if(!(r=op(e)))throw sp(ep(e)+" is not iterable");if(tp(r)){for(o=0,a=np(e);a>o;o++)if((s=y(e[o]))&&ip(up,s))return s;return new cp(!1)}i=rp(e,r)}for(c=h?e.next:i.next;!(u=Zd(c,i)).done;){try{s=y(u.value)}catch(e){ap(i,"throw",e)}if("object"==typeof s&&s&&ip(up,s))return s}return new cp(!1)},fp=ie("iterator"),hp=!1;try{var dp=0,pp={next:function(){return{done:!!dp++}},return:function(){hp=!0}};pp[fp]=function(){return this},Array.from(pp,(function(){throw 2}))}catch(e){}var vp=function(e,t){if(!t&&!hp)return!1;var n=!1;try{var i={};i[fp]=function(){return{next:function(){return{done:n=!0}}}},e(i)}catch(e){}return n},gp=hh,yp=Ph.CONSTRUCTOR||!vp((function(e){gp.all(e).then(void 0,(function(){}))})),mp=Pe,kp=Ve,bp=Rh,wp=fh,_p=lp;fr({target:"Promise",stat:!0,forced:yp},{all:function(e){var t=this,n=bp.f(t),i=n.resolve,r=n.reject,o=wp((function(){var n=kp(t.resolve),o=[],a=0,s=1;_p(e,(function(e){var c=a++,u=!1;s++,mp(n,t,e).then((function(e){u||(u=!0,o[c]=e,--s||i(o))}),r)})),--s||i(o)}));return o.error&&r(o.value),n.promise}});var Cp=fr,xp=Ph.CONSTRUCTOR,Sp=hh,Tp=Ie,Ep=ue,Pp=En,Rp=Sp&&Sp.prototype;if(Cp({target:"Promise",proto:!0,forced:xp,real:!0},{catch:function(e){return this.then(void 0,e)}}),Ep(Sp)){var Op=Tp("Promise").prototype.catch;Rp.catch!==Op&&Pp(Rp,"catch",Op,{unsafe:!0})}var Ip=Pe,Lp=Ve,Ap=Rh,Dp=fh,Mp=lp;fr({target:"Promise",stat:!0,forced:yp},{race:function(e){var t=this,n=Ap.f(t),i=n.reject,r=Dp((function(){var r=Lp(t.resolve);Mp(e,(function(e){Ip(r,t,e).then(n.resolve,i)}))}));return r.error&&i(r.value),n.promise}});var Np=Pe,Fp=Rh;fr({target:"Promise",stat:!0,forced:Ph.CONSTRUCTOR},{reject:function(e){var t=Fp.f(this);return Np(t.reject,void 0,e),t.promise}});var Bp=Se,jp=pe,Hp=Rh,Up=fr,Wp=Ph.CONSTRUCTOR,Vp=function(e,t){if(Bp(e),jp(t)&&t.constructor===e)return t;var n=Hp.f(e);return(0,n.resolve)(t),n.promise};Ie("Promise"),Up({target:"Promise",stat:!0,forced:Wp},{resolve:function(e){return Vp(this,e)}});var Gp=fe,Kp=St.EXISTS,zp=k,Yp=ha,qp=Function.prototype,Xp=zp(qp.toString),$p=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,Jp=zp($p.exec);Gp&&!Kp&&Yp(qp,"name",{configurable:!0,get:function(){try{return Jp($p,Xp(this))[1]}catch(e){return""}}}),fr({target:"Number",stat:!0},{isNaN:function(e){return e!=e}});var Zp=ue,Qp=pe,ev=Yl,tv=function(e,t,n){var i,r;return ev&&Zp(i=t.constructor)&&i!==n&&Qp(r=i.prototype)&&r!==n.prototype&&ev(e,r),e},nv=k(1..valueOf),iv="\t\n\v\f\r                 \u2028\u2029\ufeff",rv=C,ov=Yo,av=iv,sv=k("".replace),cv=RegExp("^["+av+"]+"),uv=RegExp("(^|[^"+av+"])["+av+"]+$"),lv=function(e){return function(t){var n=ov(rv(t));return 1&e&&(n=sv(n,cv,"")),2&e&&(n=sv(n,uv,"$1")),n}},fv={start:lv(1),end:lv(2),trim:lv(3)},hv=fr,dv=fe,pv=n,vv=va,gv=k,yv=ir,mv=R,kv=tv,bv=Le,wv=Fe,_v=rt,Cv=d,xv=ui.f,Sv=Un.f,Tv=le.f,Ev=nv,Pv=fv.trim,Rv="Number",Ov=pv[Rv];vv[Rv];var Iv=Ov.prototype,Lv=pv.TypeError,Av=gv("".slice),Dv=gv("".charCodeAt),Mv=function(e){var t,n,i,r,o,a,s,c,u=_v(e,"number");if(wv(u))throw Lv("Cannot convert a Symbol value to a number");if("string"==typeof u&&u.length>2)if(u=Pv(u),43===(t=Dv(u,0))||45===t){if(88===(n=Dv(u,2))||120===n)return NaN}else if(48===t){switch(Dv(u,1)){case 66:case 98:i=2,r=49;break;case 79:case 111:i=8,r=55;break;default:return+u}for(a=(o=Av(u,2)).length,s=0;s<a;s++)if((c=Dv(o,s))<48||c>r)return NaN;return parseInt(o,i)}return+u},Nv=yv(Rv,!Ov(" 0o1")||!Ov("0b1")||Ov("+0x1")),Fv=function(e){var t,n=arguments.length<1?0:Ov(function(e){var t=_v(e,"number");return"bigint"==typeof t?t:Mv(t)}(e));return bv(Iv,t=this)&&Cv((function(){Ev(t)}))?kv(Object(n),this,Fv):n};Fv.prototype=Iv,Nv&&(Iv.constructor=Fv),hv({global:!0,constructor:!0,wrap:!0,forced:Nv},{Number:Fv});Nv&&function(e,t){for(var n,i=dv?xv(t):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),r=0;i.length>r;r++)mv(t,n=i[r])&&!mv(e,n)&&Tv(e,n,Sv(t,n))}(vv[Rv],Ov);var Bv=ie,jv=ko,Hv=le.f,Uv=Bv("unscopables"),Wv=Array.prototype;null==Wv[Uv]&&Hv(Wv,Uv,{configurable:!0,value:jv(null)});var Vv,Gv,Kv,zv=function(e){Wv[Uv][e]=!0},Yv=!d((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),qv=R,Xv=ue,$v=T,Jv=Yv,Zv=Vt("IE_PROTO"),Qv=Object,eg=Qv.prototype,tg=Jv?Qv.getPrototypeOf:function(e){var t=$v(e);if(qv(t,Zv))return t[Zv];var n=t.constructor;return Xv(n)&&t instanceof n?n.prototype:t instanceof Qv?eg:null},ng=d,ig=ue,rg=pe,og=tg,ag=En,sg=ie("iterator"),cg=!1;[].keys&&("next"in(Kv=[].keys())?(Gv=og(og(Kv)))!==Object.prototype&&(Vv=Gv):cg=!0);var ug=!rg(Vv)||ng((function(){var e={};return Vv[sg].call(e)!==e}));ug&&(Vv={}),ig(Vv[sg])||ag(Vv,sg,(function(){return this}));var lg={IteratorPrototype:Vv,BUGGY_SAFARI_ITERATORS:cg},fg=lg.IteratorPrototype,hg=ko,dg=Nt,pg=Pa,vg=Rd,gg=function(){return this},yg=function(e,t,n,i){var r=t+" Iterator";return e.prototype=hg(fg,{next:dg(+!i,n)}),pg(e,r,!1),vg[r]=gg,e},mg=fr,kg=Pe,bg=ue,wg=yg,_g=tg,Cg=Yl,xg=Pa,Sg=jt,Tg=En,Eg=Rd,Pg=St.PROPER,Rg=St.CONFIGURABLE,Og=lg.IteratorPrototype,Ig=lg.BUGGY_SAFARI_ITERATORS,Lg=ie("iterator"),Ag="keys",Dg="values",Mg="entries",Ng=function(){return this},Fg=function(e,t,n,i,r,o,a){wg(n,t,i);var s,c,u,l=function(e){if(e===r&&v)return v;if(!Ig&&e in d)return d[e];switch(e){case Ag:case Dg:case Mg:return function(){return new n(this,e)}}return function(){return new n(this)}},f=t+" Iterator",h=!1,d=e.prototype,p=d[Lg]||d["@@iterator"]||r&&d[r],v=!Ig&&p||l(r),g="Array"==t&&d.entries||p;if(g&&(s=_g(g.call(new e)))!==Object.prototype&&s.next&&(_g(s)!==Og&&(Cg?Cg(s,Og):bg(s[Lg])||Tg(s,Lg,Ng)),xg(s,f,!0)),Pg&&r==Dg&&p&&p.name!==Dg&&(Rg?Sg(d,"name",Dg):(h=!0,v=function(){return kg(p,this)})),r)if(c={values:l(Dg),keys:o?v:l(Ag),entries:l(Mg)},a)for(u in c)(Ig||h||!(u in d))&&Tg(d,u,c[u]);else mg({target:t,proto:!0,forced:Ig||h},c);return d[Lg]!==v&&Tg(d,Lg,v,{name:r}),Eg[t]=v,c},Bg=function(e,t){return{value:e,done:t}},jg=Qn,Hg=zv,Ug=Rd,Wg=on,Vg=le.f,Gg=Fg,Kg=Bg,zg=fe,Yg="Array Iterator",qg=Wg.set,Xg=Wg.getterFor(Yg),$g=Gg(Array,"Array",(function(e,t){qg(this,{type:Yg,target:jg(e),index:0,kind:t})}),(function(){var e=Xg(this),t=e.target,n=e.kind,i=e.index++;return!t||i>=t.length?(e.target=void 0,Kg(void 0,!0)):Kg("keys"==n?i:"values"==n?t[i]:[i,t[i]],!1)}),"values"),Jg=Ug.Arguments=Ug.Array;if(Hg("keys"),Hg("values"),Hg("entries"),zg&&"values"!==Jg.name)try{Vg(Jg,"name",{value:"values"})}catch(e){}var Zg=n,Qg=Yu,ey=$u,ty=$g,ny=jt,iy=ie,ry=iy("iterator"),oy=iy("toStringTag"),ay=ty.values,sy=function(e,t){if(e){if(e[ry]!==ay)try{ny(e,ry,ay)}catch(t){e[ry]=ay}if(e[oy]||ny(e,oy,t),Qg[t])for(var n in ty)if(e[n]!==ty[n])try{ny(e,n,ty[n])}catch(t){e[n]=ty[n]}}};for(var cy in Qg)sy(Zg[cy]&&Zg[cy].prototype,cy);sy(ey,"DOMTokenList");var uy=Za.filter;fr({target:"Array",proto:!0,forced:!vu("filter")},{filter:function(e){return uy(this,e,arguments.length>1?arguments[1]:void 0)}});var ly=fe,fy=k,hy=Pe,dy=d,py=$r,vy=Fi,gy=Wn,yy=T,my=$n,ky=Object.assign,by=Object.defineProperty,wy=fy([].concat),_y=!ky||dy((function(){if(ly&&1!==ky({b:1},ky(by({},"a",{enumerable:!0,get:function(){by(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),i="abcdefghijklmnopqrst";return e[n]=7,i.split("").forEach((function(e){t[e]=e})),7!=ky({},e)[n]||py(ky({},t)).join("")!=i}))?function(e,t){for(var n=yy(e),i=arguments.length,r=1,o=vy.f,a=gy.f;i>r;)for(var s,c=my(arguments[r++]),u=o?wy(py(c),o(c)):py(c),l=u.length,f=0;l>f;)s=u[f++],ly&&!hy(a,c,s)||(n[s]=c[s]);return n}:ky,Cy=_y;fr({target:"Object",stat:!0,arity:2,forced:Object.assign!==Cy},{assign:Cy});var xy={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,n="~";function i(){}function r(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,i,o,a){if("function"!=typeof i)throw new TypeError("The listener must be a function");var s=new r(i,o||e,a),c=n?n+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new i:delete e._events[t]}function s(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,i,r=[];if(0===this._eventsCount)return r;for(i in e=this._events)t.call(e,i)&&r.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},s.prototype.listeners=function(e){var t=n?n+e:e,i=this._events[t];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,o=i.length,a=new Array(o);r<o;r++)a[r]=i[r].fn;return a},s.prototype.listenerCount=function(e){var t=n?n+e:e,i=this._events[t];return i?i.fn?1:i.length:0},s.prototype.emit=function(e,t,i,r,o,a){var s=n?n+e:e;if(!this._events[s])return!1;var c,u,l=this._events[s],f=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),f){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,i),!0;case 4:return l.fn.call(l.context,t,i,r),!0;case 5:return l.fn.call(l.context,t,i,r,o),!0;case 6:return l.fn.call(l.context,t,i,r,o,a),!0}for(u=1,c=new Array(f-1);u<f;u++)c[u-1]=arguments[u];l.fn.apply(l.context,c)}else{var h,d=l.length;for(u=0;u<d;u++)switch(l[u].once&&this.removeListener(e,l[u].fn,void 0,!0),f){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,t);break;case 3:l[u].fn.call(l[u].context,t,i);break;case 4:l[u].fn.call(l[u].context,t,i,r);break;default:if(!c)for(h=1,c=new Array(f-1);h<f;h++)c[h-1]=arguments[h];l[u].fn.apply(l[u].context,c)}}return!0},s.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},s.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},s.prototype.removeListener=function(e,t,i,r){var o=n?n+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||r&&!s.once||i&&s.context!==i||a(this,o);else{for(var c=0,u=[],l=s.length;c<l;c++)(s[c].fn!==t||r&&!s[c].once||i&&s[c].context!==i)&&u.push(s[c]);u.length?this._events[o]=1===u.length?u[0]:u:a(this,o)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&a(this,t)):(this._events=new i,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s}(xy);var Sy=xy.exports,Ty=JSON.parse('"3.0.0-alpha.174-1"');function Ey(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function Py(e){return function(e){if(Array.isArray(e))return Ey(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Ey(e,t);var n=Object.prototype.toString.call(e).slice(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)?Ey(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Ry=Se,Oy=function(){var e=Ry(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},Iy=d,Ly=n.RegExp,Ay=Iy((function(){var e=Ly("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),Dy=Ay||Iy((function(){return!Ly("a","y").sticky})),My={BROKEN_CARET:Ay||Iy((function(){var e=Ly("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),MISSED_STICKY:Dy,UNSUPPORTED_Y:Ay},Ny=d,Fy=n.RegExp,By=Ny((function(){var e=Fy(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),jy=d,Hy=n.RegExp,Uy=jy((function(){var e=Hy("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),Wy=Pe,Vy=k,Gy=Yo,Ky=Oy,zy=My,Yy=i.exports,qy=ko,Xy=on.get,$y=By,Jy=Uy,Zy=Yy("native-string-replace",String.prototype.replace),Qy=RegExp.prototype.exec,em=Qy,tm=Vy("".charAt),nm=Vy("".indexOf),im=Vy("".replace),rm=Vy("".slice),om=function(){var e=/a/,t=/b*/g;return Wy(Qy,e,"a"),Wy(Qy,t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),am=zy.BROKEN_CARET,sm=void 0!==/()??/.exec("")[1];(om||sm||am||$y||Jy)&&(em=function(e){var t,n,i,r,o,a,s,c=this,u=Xy(c),l=Gy(e),f=u.raw;if(f)return f.lastIndex=c.lastIndex,t=Wy(em,f,l),c.lastIndex=f.lastIndex,t;var h=u.groups,d=am&&c.sticky,p=Wy(Ky,c),v=c.source,g=0,y=l;if(d&&(p=im(p,"y",""),-1===nm(p,"g")&&(p+="g"),y=rm(l,c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&"\n"!==tm(l,c.lastIndex-1))&&(v="(?: "+v+")",y=" "+y,g++),n=new RegExp("^(?:"+v+")",p)),sm&&(n=new RegExp("^"+v+"$(?!\\s)",p)),om&&(i=c.lastIndex),r=Wy(Qy,d?n:c,y),d?r?(r.input=rm(r.input,g),r[0]=rm(r[0],g),r.index=c.lastIndex,c.lastIndex+=r[0].length):c.lastIndex=0:om&&r&&(c.lastIndex=c.global?r.index+r[0].length:i),sm&&r&&r.length>1&&Wy(Zy,r[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(r[o]=void 0)})),r&&h)for(r.groups=a=qy(null),o=0;o<h.length;o++)a[(s=h[o])[0]]=r[s[1]];return r});var cm=em;fr({target:"RegExp",proto:!0,forced:/./.exec!==cm},{exec:cm});var um=Ia,lm=En,fm=cm,hm=d,dm=ie,pm=jt,vm=dm("species"),gm=RegExp.prototype,ym=function(e,t,n,i){var r=dm(e),o=!hm((function(){var t={};return t[r]=function(){return 7},7!=""[e](t)})),a=o&&!hm((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[vm]=function(){return n},n.flags="",n[r]=/./[r]),n.exec=function(){return t=!0,null},n[r](""),!t}));if(!o||!a||n){var s=um(/./[r]),c=t(r,""[e],(function(e,t,n,i,r){var a=um(e),c=t.exec;return c===fm||c===gm.exec?o&&!r?{done:!0,value:s(t,n,i)}:{done:!0,value:a(n,t,i)}:{done:!1}}));lm(String.prototype,e,c[0]),lm(gm,r,c[1])}i&&pm(gm[r],"sham",!0)},mm=k,km=di,bm=Yo,wm=C,_m=mm("".charAt),Cm=mm("".charCodeAt),xm=mm("".slice),Sm=function(e){return function(t,n){var i,r,o=bm(wm(t)),a=km(n),s=o.length;return a<0||a>=s?e?"":void 0:(i=Cm(o,a))<55296||i>56319||a+1===s||(r=Cm(o,a+1))<56320||r>57343?e?_m(o,a):i:e?xm(o,a,a+2):r-56320+(i-55296<<10)+65536}},Tm={codeAt:Sm(!1),charAt:Sm(!0)},Em=Tm.charAt,Pm=function(e,t,n){return t+(n?Em(e,t).length:1)},Rm=Pe,Om=Se,Im=ue,Lm=In,Am=cm,Dm=TypeError,Mm=function(e,t){var n=e.exec;if(Im(n)){var i=Rm(n,e,t);return null!==i&&Om(i),i}if("RegExp"===Lm(e))return Rm(Am,e,t);throw Dm("RegExp#exec called on incompatible receiver")},Nm=Pe,Fm=Se,Bm=b,jm=bi,Hm=Yo,Um=C,Wm=ze,Vm=Pm,Gm=Mm;ym("match",(function(e,t,n){return[function(t){var n=Um(this),i=Bm(t)?void 0:Wm(t,e);return i?Nm(i,t,n):new RegExp(t)[e](Hm(n))},function(e){var i=Fm(this),r=Hm(e),o=n(t,i,r);if(o.done)return o.value;if(!i.global)return Gm(i,r);var a=i.unicode;i.lastIndex=0;for(var s,c=[],u=0;null!==(s=Gm(i,r));){var l=Hm(s[0]);c[u]=l,""===l&&(i.lastIndex=Vm(r,jm(i.lastIndex),a)),u++}return 0===u?null:c}]}));var Km=pe,zm=In,Ym=ie("match"),qm=function(e){var t;return Km(e)&&(void 0!==(t=e[Ym])?!!t:"RegExp"==zm(e))},Xm=Pe,$m=R,Jm=Le,Zm=Oy,Qm=RegExp.prototype,ek=function(e){var t=e.flags;return void 0!==t||"flags"in Qm||$m(e,"flags")||!Jm(Qm,e)?t:Xm(Zm,e)},tk=le.f,nk=fe,ik=n,rk=k,ok=ir,ak=tv,sk=jt,ck=ui.f,uk=Le,lk=qm,fk=Yo,hk=ek,dk=My,pk=function(e,t,n){n in e||tk(e,n,{configurable:!0,get:function(){return t[n]},set:function(e){t[n]=e}})},vk=En,gk=d,yk=R,mk=on.enforce,kk=Zl,bk=By,wk=Uy,_k=ie("match"),Ck=ik.RegExp,xk=Ck.prototype,Sk=ik.SyntaxError,Tk=rk(xk.exec),Ek=rk("".charAt),Pk=rk("".replace),Rk=rk("".indexOf),Ok=rk("".slice),Ik=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,Lk=/a/g,Ak=/a/g,Dk=new Ck(Lk)!==Lk,Mk=dk.MISSED_STICKY,Nk=dk.UNSUPPORTED_Y,Fk=nk&&(!Dk||Mk||bk||wk||gk((function(){return Ak[_k]=!1,Ck(Lk)!=Lk||Ck(Ak)==Ak||"/a/i"!=Ck(Lk,"i")})));if(ok("RegExp",Fk)){for(var Bk=function(e,t){var n,i,r,o,a,s,c=uk(xk,this),u=lk(e),l=void 0===t,f=[],h=e;if(!c&&u&&l&&e.constructor===Bk)return e;if((u||uk(xk,e))&&(e=e.source,l&&(t=hk(h))),e=void 0===e?"":fk(e),t=void 0===t?"":fk(t),h=e,bk&&"dotAll"in Lk&&(i=!!t&&Rk(t,"s")>-1)&&(t=Pk(t,/s/g,"")),n=t,Mk&&"sticky"in Lk&&(r=!!t&&Rk(t,"y")>-1)&&Nk&&(t=Pk(t,/y/g,"")),wk&&(o=function(e){for(var t,n=e.length,i=0,r="",o=[],a={},s=!1,c=!1,u=0,l="";i<=n;i++){if("\\"===(t=Ek(e,i)))t+=Ek(e,++i);else if("]"===t)s=!1;else if(!s)switch(!0){case"["===t:s=!0;break;case"("===t:Tk(Ik,Ok(e,i+1))&&(i+=2,c=!0),r+=t,u++;continue;case">"===t&&c:if(""===l||yk(a,l))throw new Sk("Invalid capture group name");a[l]=!0,o[o.length]=[l,u],c=!1,l="";continue}c?l+=t:r+=t}return[r,o]}(e),e=o[0],f=o[1]),a=ak(Ck(e,t),c?this:xk,Bk),(i||r||f.length)&&(s=mk(a),i&&(s.dotAll=!0,s.raw=Bk(function(e){for(var t,n=e.length,i=0,r="",o=!1;i<=n;i++)"\\"!==(t=Ek(e,i))?o||"."!==t?("["===t?o=!0:"]"===t&&(o=!1),r+=t):r+="[\\s\\S]":r+=t+Ek(e,++i);return r}(e),n)),r&&(s.sticky=!0),f.length&&(s.groups=f)),e!==h)try{sk(a,"source",""===h?"(?:)":h)}catch(e){}return a},jk=ck(Ck),Hk=0;jk.length>Hk;)pk(Bk,Ck,jk[Hk++]);xk.constructor=Bk,Bk.prototype=xk,vk(ik,"RegExp",Bk,{constructor:!0})}kk("RegExp");var Uk=St.PROPER,Wk=En,Vk=Se,Gk=Yo,Kk=d,zk=ek,Yk="toString",qk=RegExp.prototype[Yk],Xk=Kk((function(){return"/a/b"!=qk.call({source:"a",flags:"b"})})),$k=Uk&&qk.name!=Yk;(Xk||$k)&&Wk(RegExp.prototype,Yk,(function(){var e=Vk(this);return"/"+Gk(e.source)+"/"+Gk(zk(e))}),{unsafe:!0});var Jk=gr,Zk=Pe,Qk=k,eb=ym,tb=Se,nb=b,ib=qm,rb=C,ob=sf,ab=Pm,sb=bi,cb=Yo,ub=ze,lb=ra,fb=Mm,hb=cm,db=d,pb=My.UNSUPPORTED_Y,vb=4294967295,gb=Math.min,yb=[].push,mb=Qk(/./.exec),kb=Qk(yb),bb=Qk("".slice),wb=!db((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]}));eb("split",(function(e,t,n){var i;return i="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var i=cb(rb(this)),r=void 0===n?vb:n>>>0;if(0===r)return[];if(void 0===e)return[i];if(!ib(e))return Zk(t,i,e,r);for(var o,a,s,c=[],u=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),l=0,f=new RegExp(e.source,u+"g");(o=Zk(hb,f,i))&&!((a=f.lastIndex)>l&&(kb(c,bb(i,l,o.index)),o.length>1&&o.index<i.length&&Jk(yb,c,lb(o,1)),s=o[0].length,l=a,c.length>=r));)f.lastIndex===o.index&&f.lastIndex++;return l===i.length?!s&&mb(f,"")||kb(c,""):kb(c,bb(i,l)),c.length>r?lb(c,0,r):c}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:Zk(t,this,e,n)}:t,[function(t,n){var r=rb(this),o=nb(t)?void 0:ub(t,e);return o?Zk(o,t,r,n):Zk(i,cb(r),t,n)},function(e,r){var o=tb(this),a=cb(e),s=n(i,o,a,r,i!==t);if(s.done)return s.value;var c=ob(o,RegExp),u=o.unicode,l=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(pb?"g":"y"),f=new c(pb?"^(?:"+o.source+")":o,l),h=void 0===r?vb:r>>>0;if(0===h)return[];if(0===a.length)return null===fb(f,a)?[a]:[];for(var d=0,p=0,v=[];p<a.length;){f.lastIndex=pb?0:p;var g,y=fb(f,pb?bb(a,p):a);if(null===y||(g=gb(sb(f.lastIndex+(pb?p:0)),a.length))===d)p=ab(a,p,u);else{if(kb(v,bb(a,d,p)),v.length===h)return v;for(var m=1;m<=y.length-1;m++)if(kb(v,y[m]),v.length===h)return v;p=d=g}}return kb(v,bb(a,d)),v}]}),!wb,pb);var _b=k,Cb=T,xb=Math.floor,Sb=_b("".charAt),Tb=_b("".replace),Eb=_b("".slice),Pb=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,Rb=/\$([$&'`]|\d{1,2})/g,Ob=gr,Ib=Pe,Lb=k,Ab=ym,Db=d,Mb=Se,Nb=ue,Fb=b,Bb=di,jb=bi,Hb=Yo,Ub=C,Wb=Pm,Vb=ze,Gb=function(e,t,n,i,r,o){var a=n+e.length,s=i.length,c=Rb;return void 0!==r&&(r=Cb(r),c=Pb),Tb(o,c,(function(o,c){var u;switch(Sb(c,0)){case"$":return"$";case"&":return e;case"`":return Eb(t,0,n);case"'":return Eb(t,a);case"<":u=r[Eb(c,1,-1)];break;default:var l=+c;if(0===l)return o;if(l>s){var f=xb(l/10);return 0===f?o:f<=s?void 0===i[f-1]?Sb(c,1):i[f-1]+Sb(c,1):o}u=i[l-1]}return void 0===u?"":u}))},Kb=Mm,zb=ie("replace"),Yb=Math.max,qb=Math.min,Xb=Lb([].concat),$b=Lb([].push),Jb=Lb("".indexOf),Zb=Lb("".slice),Qb="$0"==="a".replace(/./,"$0"),ew=!!/./[zb]&&""===/./[zb]("a","$0");Ab("replace",(function(e,t,n){var i=ew?"$":"$0";return[function(e,n){var i=Ub(this),r=Fb(e)?void 0:Vb(e,zb);return r?Ib(r,e,i,n):Ib(t,Hb(i),e,n)},function(e,r){var o=Mb(this),a=Hb(e);if("string"==typeof r&&-1===Jb(r,i)&&-1===Jb(r,"$<")){var s=n(t,o,a,r);if(s.done)return s.value}var c=Nb(r);c||(r=Hb(r));var u=o.global;if(u){var l=o.unicode;o.lastIndex=0}for(var f=[];;){var h=Kb(o,a);if(null===h)break;if($b(f,h),!u)break;""===Hb(h[0])&&(o.lastIndex=Wb(a,jb(o.lastIndex),l))}for(var d,p="",v=0,g=0;g<f.length;g++){for(var y=Hb((h=f[g])[0]),m=Yb(qb(Bb(h.index),a.length),0),k=[],b=1;b<h.length;b++)$b(k,void 0===(d=h[b])?d:String(d));var w=h.groups;if(c){var _=Xb([y],k,m,a);void 0!==w&&$b(_,w);var C=Hb(Ob(r,void 0,_))}else C=Gb(y,a,m,k,w,r);m>=v&&(p+=Zb(a,v,m)+C,v=m+y.length)}return p+Zb(a,v)}]}),!!Db((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!Qb||ew);var tw=St.PROPER,nw=d,iw=iv,rw=fv.trim;fr({target:"String",proto:!0,forced:function(e){return nw((function(){return!!iw[e]()||"​…᠎"!=="​…᠎"[e]()||tw&&iw[e].name!==e}))}("trim")},{trim:function(){return rw(this)}});var ow=ra,aw=Math.floor,sw=function(e,t){var n=e.length,i=aw(n/2);return n<8?cw(e,t):uw(e,sw(ow(e,0,i),t),sw(ow(e,i),t),t)},cw=function(e,t){for(var n,i,r=e.length,o=1;o<r;){for(i=o,n=e[o];i&&t(e[i-1],n)>0;)e[i]=e[--i];i!==o++&&(e[i]=n)}return e},uw=function(e,t,n,i){for(var r=t.length,o=n.length,a=0,s=0;a<r||s<o;)e[a+s]=a<r&&s<o?i(t[a],n[s])<=0?t[a++]:n[s++]:a<r?t[a++]:n[s++];return e},lw=sw,fw=M.match(/firefox\/(\d+)/i),hw=!!fw&&+fw[1],dw=/MSIE|Trident/.test(M),pw=M.match(/AppleWebKit\/(\d+)\./),vw=!!pw&&+pw[1],gw=fr,yw=k,mw=Ve,kw=T,bw=_i,ww=bl,_w=Yo,Cw=d,xw=lw,Sw=Zu,Tw=hw,Ew=dw,Pw=W,Rw=vw,Ow=[],Iw=yw(Ow.sort),Lw=yw(Ow.push),Aw=Cw((function(){Ow.sort(void 0)})),Dw=Cw((function(){Ow.sort(null)})),Mw=Sw("sort"),Nw=!Cw((function(){if(Pw)return Pw<70;if(!(Tw&&Tw>3)){if(Ew)return!0;if(Rw)return Rw<603;var e,t,n,i,r="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:n=3;break;case 68:case 71:n=4;break;default:n=2}for(i=0;i<47;i++)Ow.push({k:t+i,v:n})}for(Ow.sort((function(e,t){return t.v-e.v})),i=0;i<Ow.length;i++)t=Ow[i].k.charAt(0),r.charAt(r.length-1)!==t&&(r+=t);return"DGBEFHACIJK"!==r}}));gw({target:"Array",proto:!0,forced:Aw||!Dw||!Mw||!Nw},{sort:function(e){void 0!==e&&mw(e);var t=kw(this);if(Nw)return void 0===e?Iw(t):Iw(t,e);var n,i,r=[],o=bw(t);for(i=0;i<o;i++)i in t&&Lw(r,t[i]);for(xw(r,function(e){return function(t,n){return void 0===n?-1:void 0===t?1:void 0!==e?+e(t,n)||0:_w(t)>_w(n)?1:-1}}(e)),n=bw(r),i=0;i<n;)t[i]=r[i++];for(;i<o;)ww(t,i++);return t}});var Fw="undefined"!=typeof window&&window.location&&window.location.href.indexOf("xgplayerdebugger=1")>-1,Bw={info:"color: #525252; background-color: #90ee90;",error:"color: #525252; background-color: red;",warn:"color: #525252; background-color: yellow; "},jw="%c[xgplayer]",Hw={config:{debug:Fw?3:1},logInfo:function(e){for(var t,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];this.config.debug>=3&&(t=console).log.apply(t,[jw,Bw.info,e].concat(i))},logWarn:function(e){for(var t,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];this.config.debug>=1&&(t=console).warn.apply(t,[jw,Bw.warn,e].concat(i))},logError:function(e){var t;if(!(this.config.debug<1)){for(var n=this.config.debug>=2?"trace":"error",i=arguments.length,r=new Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];(t=console)[n].apply(t,[jw,Bw.error,e].concat(r))}}};var Uw=function(){function e(t){Bo(this,e),this.bufferedList=t}return Fo(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}(),Ww={};function Vw(e){var t=Do(e);return null!==e&&("object"===t||"function"===t)}function Gw(e,t,n){var i,r,o,a,s,c,u=0,l=!1,f=!1,h=!0,d=!t&&0!==t&&"function"==typeof window.requestAnimationFrame;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var n=i,o=r;return i=r=void 0,u=t,a=e.apply(o,n)}function v(e,t){return d?(window.cancelAnimationFrame(s),window.requestAnimationFrame(e)):setTimeout(e,t)}function g(e){var n=e-c;return void 0===c||n>=t||n<0||f&&e-u>=o}function y(){var e=Date.now();if(g(e))return m(e);s=v(y,function(e){var n=e-u,i=t-(e-c);return f?Math.min(i,o-n):i}(e))}function m(e){return s=void 0,h&&i?p(e):(i=r=void 0,a)}function k(){for(var e=Date.now(),n=g(e),o=arguments.length,h=new Array(o),d=0;d<o;d++)h[d]=arguments[d];if(i=h,r=this,c=e,n){if(void 0===s)return function(e){return u=e,s=v(y,t),l?p(e):a}(c);if(f)return s=v(y,t),p(c)}return void 0===s&&(s=v(y,t)),a}return t=+t||0,Vw(n)&&(l=!!n.leading,o=(f="maxWait"in n)?Math.max(+n.maxWait||0,t):o,h="trailing"in n?!!n.trailing:h),k.cancel=function(){void 0!==s&&function(e){if(d)return window.cancelAnimationFrame(e);clearTimeout(e)}(s),u=0,i=c=r=s=void 0},k.flush=function(){return void 0===s?a:m(Date.now())},k.pending=function(){return void 0!==s},k}Ww.createDom=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=document.createElement(e);return r.className=i,r.innerHTML=t,Object.keys(n).forEach((function(t){var i=t,o=n[t];"video"===e||"audio"===e||"live-video"===e?o&&r.setAttribute(i,o):r.setAttribute(i,o)})),r},Ww.createDomFromHtml=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";try{var i=document.createElement("div");i.innerHTML=e;var r=i.children;return i=null,r.length>0?(r=r[0],n&&Ww.addClass(r,n),t&&Object.keys(t).forEach((function(e){r.setAttribute(e,t[e])})),r):null}catch(e){return Hw.logError("util.createDomFromHtml",e),null}},Ww.hasClass=function(e,t){if(!e||!t)return!1;try{return Array.prototype.some.call(e.classList,(function(e){return e===t}))}catch(i){var n=e.className&&"object"===Do(e.className)?e.getAttribute("class"):e.className;return n&&!!n.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}},Ww.addClass=function(e,t){if(e&&t)try{t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.add(t)}))}catch(n){Ww.hasClass(e,t)||(e.className&&"object"===Do(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t)}},Ww.removeClass=function(e,t){if(e&&t)try{t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.remove(t)}))}catch(n){Ww.hasClass(e,t)&&t.split(/\s+/g).forEach((function(t){var n=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===Do(e.className)?e.setAttribute("class",e.getAttribute("class").replace(n," ")):e.className=e.className.replace(n," ")}))}},Ww.toggleClass=function(e,t){e&&t.split(/\s+/g).forEach((function(t){Ww.hasClass(e,t)?Ww.removeClass(e,t):Ww.addClass(e,t)}))},Ww.classNames=function(){for(var e=arguments,t=[],n=function(n){"String"===Ww.typeOf(e[n])?t.push(e[n]):"Object"===Ww.typeOf(e[n])&&Object.keys(e[n]).map((function(i){e[n][i]&&t.push(i)}))},i=0;i<arguments.length;i++)n(i);return t.join(" ")},Ww.findDom=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,n=arguments.length>1?arguments[1]:void 0;try{e=t.querySelector(n)}catch(i){Hw.logError("util.findDom",i),0===n.indexOf("#")&&(e=t.getElementById(n.slice(1)))}return e},Ww.getCss=function(e,t){return e.currentStyle?e.currentStyle[t]:document.defaultView.getComputedStyle(e,!1)[t]},Ww.padStart=function(e,t,n){for(var i=String(n),r=t>>0,o=Math.ceil(r/i.length),a=[],s=String(e);o--;)a.push(i);return a.join("").substring(0,r-s.length)+s},Ww.format=function(e){if(window.isNaN(e))return"";e=Math.round(e);var t=Ww.padStart(Math.floor(e/3600),2,0),n=Ww.padStart(Math.floor((e-3600*t)/60),2,0),i=Ww.padStart(Math.floor(e-3600*t-60*n),2,0);return("00"===t?[n,i]:[t,n,i]).join(":")},Ww.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},Ww.typeOf=function(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]},Ww.deepCopy=function(e,t){if("Object"===Ww.typeOf(t)&&"Object"===Ww.typeOf(e))return Object.keys(t).forEach((function(n){"Object"!==Ww.typeOf(t[n])||t[n]instanceof Node?"Array"===Ww.typeOf(t[n])?e[n]="Array"===Ww.typeOf(e[n])?e[n].concat(t[n]):t[n]:e[n]=t[n]:void 0===e[n]||void 0===e[n]?e[n]=t[n]:Ww.deepCopy(e[n],t[n])})),e},Ww.deepMerge=function(e,t){return Object.keys(t).map((function(n){var i;"Array"===Ww.typeOf(t[n])&&"Array"===Ww.typeOf(e[n])?"Array"===Ww.typeOf(e[n])&&(i=e[n]).push.apply(i,Py(t[n])):Ww.typeOf(e[n])!==Ww.typeOf(t[n])||null===e[n]||"Object"!==Ww.typeOf(e[n])||t[n]instanceof window.Node?null!==t[n]&&(e[n]=t[n]):Ww.deepMerge(e[n],t[n])})),e},Ww.getBgImage=function(e){var t=(e.currentStyle||window.getComputedStyle(e,null)).backgroundImage;if(!t||"none"===t)return"";var n=document.createElement("a");return n.href=t.replace(/url\("|"\)/g,""),n.href},Ww.copyDom=function(e){if(e&&1===e.nodeType){var t=document.createElement(e.tagName);return Array.prototype.forEach.call(e.attributes,(function(e){t.setAttribute(e.name,e.value)})),e.innerHTML&&(t.innerHTML=e.innerHTML),t}return""},Ww.setInterval=function(e,t,n,i){e._interval[t]||(e._interval[t]=window.setInterval(n.bind(e),i))},Ww.clearInterval=function(e,t){clearInterval(e._interval[t]),e._interval[t]=null},Ww.setTimeout=function(e,t,n){e._timers||(e._timers=[]);var i=setTimeout((function(){t(),Ww.clearTimeout(e,i)}),n);return e._timers.push(i),i},Ww.clearTimeout=function(e,t){var n=e._timers;if("Array"===Ww.typeOf(n)){for(var i=0;i<n.length;i++)if(n[i]===t){n.splice(i,1),clearTimeout(t);break}}else clearTimeout(t)},Ww.clearAllTimers=function(e){var t=e._timers;"Array"===Ww.typeOf(t)&&(t.map((function(e){clearTimeout(e)})),e._timerIds=[])},Ww.createImgBtn=function(e,t,n,i){var r,o,a,s=Ww.createDom("xg-".concat(e),"",{},"xgplayer-".concat(e,"-img"));(s.style.backgroundImage='url("'.concat(t,'")'),n&&i)&&(["px","rem","em","pt","dp","vw","vh","vm","%"].every((function(e){return!(n.indexOf(e)>-1&&i.indexOf(e)>-1)||(r=parseFloat(n.slice(0,n.indexOf(e)).trim()),o=parseFloat(i.slice(0,i.indexOf(e)).trim()),a=e,!1)})),s.style.width="".concat(r).concat(a),s.style.height="".concat(o).concat(a),s.style.backgroundSize="".concat(r).concat(a," ").concat(o).concat(a),s.style.margin="start"===e?"-".concat(o/2).concat(a," auto auto -").concat(r/2).concat(a):"auto 5px auto 5px");return s},Ww.Hex2RGBA=function(e,t){var n=[];if(/^\#[0-9A-F]{3}$/i.test(e)){var i="#";e.replace(/[0-9A-F]/gi,(function(e){i+=e+e})),e=i}return/^#[0-9A-F]{6}$/i.test(e)?(e.replace(/[0-9A-F]{2}/gi,(function(e){n.push(parseInt(e,16))})),"rgba(".concat(n.join(","),", ").concat(t,")")):"rgba(255, 255, 255, 0.1)"},Ww.getFullScreenEl=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},Ww.checkIsFunction=function(e){return e&&"function"==typeof e},Ww.checkIsObject=function(e){return null!==e&&"object"===Do(e)},Ww.hide=function(e){e.style.display="none"},Ww.show=function(e,t){e.style.display=t||"block"},Ww.isUndefined=function(e){if(null==e)return!0},Ww.setStyleFromCsstext=function(e,t){t&&("String"===Ww.typeOf(t)?t.replace(/\s+/g,"").split(";").map((function(t){if(t){var n=t.split(":");n.length>1&&(e.style[n[0]]=n[1])}})):Object.keys(t).map((function(n){e.style[n]=t[n]})))},Ww.filterStyleFromText=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["width","height","top","left","bottom","right","position","z-index","padding","margin","transform"],n=e.style.cssText;if(!n)return{};var i=n.replace(/\s+/g,"").split(";"),r={},o={};return i.map((function(e){if(e){var n=e.split(":");n.length>1&&(!function(e,t){for(var n=0,i=t.length;n<i;n++)if(e.indexOf(t[n])>-1)return!0;return!1}(n[0],t)?o[n[0]]=n[1]:r[n[0]]=n[1])}})),e.setAttribute("style",""),Object.keys(o).map((function(t){e.style[t]=o[t]})),r},Ww.getStyleFromCsstext=function(e){var t=e.style.cssText;if(!t)return{};var n=t.replace(/\s+/g,"").split(";"),i={};return n.map((function(e){if(e){var t=e.split(":");t.length>1&&(i[t[0]]=t[1])}})),i},Ww.preloadImg=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(e){var i=new window.Image;i.onload=function(e){i=null,t&&t(e)},i.onerror=function(e){i=null,n&&n(e)},i.src=e}},Ww.stopPropagation=function(e){e&&(e.stopPropagation(),e.cancelable&&e.preventDefault())},Ww.scrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},Ww.scrollLeft=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},Ww.checkTouchSupport=function(){return"ontouchstart"in window},Ww.getBuffered2=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,n=[],i=0;i<e.length;i++)n.push({start:e.start(i)<.5?0:e.start(i),end:e.end(i)});n.sort((function(e,t){var n=e.start-t.start;return n||t.end-e.end}));var r=[];if(t)for(var o=0;o<n.length;o++){var a=r.length;if(a){var s=r[a-1].end;n[o].start-s<t?n[o].end>s&&(r[a-1].end=n[o].end):r.push(n[o])}else r.push(n[o])}else r=n;return new Uw(r)},Ww.getBufferByCurrentTime=function(e,t){var n={start:0,end:0,include:0,diff:0,cur:t};if(!e||e.length<1)return n;for(var i=-1,r=-1,o=parseInt(1e3*t,10),a=e.length-1;a>-1;a--){var s=parseInt(1e3*e.start(a),10),c=parseInt(1e3*e.end(a),10);if(o>=s&&o<=c){n.include=1,n.start=s/1e3,n.end=c/1e3,n.diff=(c-o)/1e3;break}o<s&&(i<0||s-o<i)?(i=(s-o)/1e3,r=a):o>c&&(i<0||o-c<i)&&(i=(o-c)/1e3,r=a)}return 1!==n.include&&(r<0&&(r=e.length-1),n.start=parseInt(1e3*e.start(r),10)/1e3,n.end=parseInt(1e3*e.end(r),10)/1e3,n.diff=(parseInt(1e3*n.end,10)-o)/1e3),n},Ww.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}},Ww.requestAnimationFrame=function(e){var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(t)return t(e)},Ww.getHostFromUrl=function(e){if("String"!==Ww.typeOf(e))return"";var t=e.split("/"),n="";return t.length>3&&t[2]&&(n=t[2]),n},Ww.cancelAnimationFrame=function(e){var t=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.cancelRequestAnimationFrame;t&&t(e)},Ww.isMSE=function(e){return e.media&&(e=e.media),!!(e&&e instanceof HTMLMediaElement)&&(/^blob/.test(e.currentSrc)||/^blob/.test(e.src))},Ww.isBlob=function(e){return"string"==typeof e&&/^blob/.test(e)},Ww.generateSessionId=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=(new Date).getTime();try{e=parseInt(e)}catch(t){e=0}return t+=e,window.performance&&"function"==typeof window.performance.now&&(t+=parseInt(window.performance.now())),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?n:3&n|8).toString(16)}))},Ww.adjustTimeByDuration=function(e,t,n){return t&&e&&(e>t||n&&e<t)?t:e},Ww.getTransformStyle=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{x:0,y:0,scale:1,rotate:0},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n={scale:"".concat(e.scale||1),translate:"".concat(e.x||0,"%, ").concat(e.y||0,"%"),rotate:"".concat(e.rotate||0,"deg")};return Object.keys(n).forEach((function(e){var i=new RegExp("".concat(e,"\\([^\\(]+\\)"),"g"),r="".concat(e,"(").concat(n[e],")");i.test(t)?(i.lastIndex=-1,t=t.replace(i,r)):t+="".concat(r," ")})),t},Ww.convertDeg=function(e){return Math.abs(e)<=1?360*e:e%360};var Kw,zw={1:"network",2:"network",3:"decoder",4:"format"},Yw=Fo((function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{errorType:"",errorCode:0,errorMessage:"",originError:"",ext:{},mediaError:null,src:null};Bo(this,e);var i=t&&t.i18n?t.i18n.ERROR_TYPES:null;if(null!=t&&t.video){var r=n.mediaError?n.mediaError:t.video.error||{},o=t.duration,a=t.currentTime,s=t.ended,c=t.src,u=t.currentSrc,l=t.video,f=l.readyState,h=l.networkState,d={playerVersion:Ty,domain:document.domain,currentTime:a,duration:o,ended:s,readyState:f,networkState:h,src:n.src||c||u,errorType:n.errorType,errorCode:n.errorCode||r.code,message:n.errorMessage||r.message,mediaError:r,originError:n.originError?n.originError.stack:"",host:Ww.getHostFromUrl(c||u)};return n.ext&&Object.keys(n.ext).map((function(e){d[e]=n.ext[e]})),d}if(arguments.length>1){for(var p={playerVersion:Ty,domain:document.domain},v=["errorType","currentTime","duration","networkState","readyState","src","currentSrc","ended","errd","errorCode","mediaError"],g=0;g<arguments.length;g++)p[v[g]]=arguments[g];return p.ex=i?(i[arguments[0]]||{}).msg:"",p}})),qw="play",Xw="playing",$w="ended",Jw="pause",Zw="error",Qw="seeking",e_="seeked",t_="timeupdate",n_="waiting",i_="canplay",r_="durationchange",o_="volumechange",a_="loadeddata",s_="loadedmetadata",c_="ratechange",u_="progress",l_="loadstart",f_="emptied",h_="focus",d_="blur",p_="ready",v_="urlNull",g_="autoplay_started",y_="autoplay_was_prevented",m_="complete",k_="replay",b_="destroy",w_="urlchange",__="download_speed_change",C_="buffer_control",x_="AbortError",S_="fullscreen_request",T_="fullscreen_change",E_="cssFullscreen_change",P_="mini_state_change",R_="definition_change",O_="after_definition_change",I_="video_resize",L_="pip_change",A_="rotate",D_="screenShot",M_="playnext",N_="shortcut",F_="xglog",B_="user_action",j_="reset",H_="source_error",U_="source_success",W_=["play","playing","ended","pause","error","seeking","seeked","timeupdate","waiting","canplay","canplaythrough","durationchange","volumechange","loadeddata","loadedmetadata","ratechange","progress","loadstart","emptied","stalled","suspend","abort","lowdecode","mseAttaching","mseAttached","mseDetaching","mseDetached"],V_={STATS_INFO:"stats_info",STATS_DOWNLOAD:"stats_download",STATS_RESET:"stats_reset"},G_="fps_stuck",K_=Object.freeze({__proto__:null,PLAY:qw,PLAYING:Xw,ENDED:$w,PAUSE:Jw,ERROR:Zw,SEEKING:Qw,SEEKED:e_,TIME_UPDATE:t_,WAITING:n_,CANPLAY:i_,CANPLAY_THROUGH:"canplaythrough",DURATION_CHANGE:r_,VOLUME_CHANGE:o_,LOADED_DATA:a_,LOADED_METADATA:s_,RATE_CHANGE:c_,PROGRESS:u_,LOAD_START:l_,EMPTIED:f_,STALLED:"stalled",SUSPEND:"suspend",ABORT:"abort",BUFFER_CHANGE:"bufferedChange",PLAYER_FOCUS:h_,PLAYER_BLUR:d_,READY:p_,URL_NULL:v_,AUTOPLAY_STARTED:g_,AUTOPLAY_PREVENTED:y_,COMPLETE:m_,REPLAY:k_,DESTROY:b_,URL_CHANGE:w_,DOWNLOAD_SPEED_CHANGE:__,BUFFER_CONTROLS:C_,PLAY_ABORTED:x_,FULLSCREEN_REQUEST:S_,FULLSCREEN_CHANGE:T_,CSS_FULLSCREEN_CHANGE:E_,MINI_STATE_CHANGE:P_,DEFINITION_CHANGE:R_,BEFORE_DEFINITION_CHANGE:"before_definition_change",AFTER_DEFINITION_CHANGE:O_,SEI_PARSED:"SEI_PARSED",RETRY:"retry",VIDEO_RESIZE:I_,PIP_CHANGE:L_,ROTATE:A_,SCREEN_SHOT:D_,PLAYNEXT:M_,SHORTCUT:N_,XGLOG:F_,USER_ACTION:B_,RESET:j_,SOURCE_ERROR:H_,SOURCE_SUCCESS:U_,SWITCH_SUBTITLE:"switch_subtitle",VIDEO_EVENTS:W_,STATS_EVENTS:V_,FPS_STUCK:G_,DEGRADE:"degrade"}),z_=/(Android)\s([\d.]+)/,Y_=/(Version)\/([\d.]+)/,q_=["avc1.42E01E, mp4a.40.2","avc1.58A01E, mp4a.40.2","avc1.4D401E, mp4a.40.2","avc1.64001E, mp4a.40.2","avc1.42E01E","mp4v.20.8","avc1.42E01E, mp4a.40.2","avc1.58A01E, mp4a.40.2","avc1.4D401E, mp4a.40.2","avc1.64001E, mp4a.40.2","mp4v.20.8, mp4a.40.2","mp4v.20.240, mp4a.40.2"],X_={get device(){return X_.os.isPc?"pc":"mobile"},get browser(){if("undefined"==typeof navigator)return"";var e=navigator.userAgent.toLowerCase(),t={ie:/rv:([\d.]+)\) like gecko/,firefox:/firefox\/([\d.]+)/,chrome:/chrome\/([\d.]+)/,opera:/opera.([\d.]+)/,safari:/version\/([\d.]+).*safari/};return[].concat(Object.keys(t).filter((function(n){return t[n].test(e)})))[0]},get os(){if("undefined"==typeof navigator)return{};var e=navigator.userAgent,t=/(?:Windows Phone)/.test(e),n=/(?:SymbianOS)/.test(e)||t,i=/(?:Android)/.test(e),r=/(?:Firefox)/.test(e),o=/(?:iPad|PlayBook)/.test(e)||i&&!/(?:Mobile)/.test(e)||r&&/(?:Tablet)/.test(e),a=/(?:iPhone)/.test(e)&&!o,s=!(a||i||n||o),c=/(?:iPad|PlayBook)/.test(e);return{isTablet:o,isPhone:a,isIpad:c,isIos:a||c,isAndroid:i,isPc:s,isSymbian:n,isWindowsPhone:t,isFireFox:r}},get osVersion(){if("undefined"==typeof navigator)return 0;var e=navigator.userAgent,t="",n=(t=/(?:iPhone)|(?:iPad|PlayBook)/.test(e)?Y_:z_)?t.exec(e):[];if(n&&n.length>=3){var i=n[2].split(".");return i.length>0?parseInt(i[0]):0}return 0},get isWeixin(){if("undefined"==typeof navigator)return!1;return!!/(micromessenger)\/([\d.]+)/.exec(navigator.userAgent.toLocaleLowerCase())},isSupportMP4:function(){var e={isSupport:!1,mime:""};if("undefined"==typeof document)return e;if(this.supportResult)return this.supportResult;var t=document.createElement("video");return"function"==typeof t.canPlayType&&q_.map((function(n){"probably"===t.canPlayType('video/mp4; codecs="'.concat(n,'"'))&&(e.isSupport=!0,e.mime+="||".concat(n))})),this.supportResult=e,t=null,e},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 n=e.video||{},i=e.audio||{};try{var r=MediaSource.isTypeSupported(n.contentType),o=MediaSource.isTypeSupported(i.contentType);return Promise.resolve({supported:r&&o,smooth:!1,powerEfficient:!1})}catch(e){return Promise.resolve(t)}},isHdrSupported:function(){if("function"==typeof matchMedia){var e=matchMedia("(dynamic-range: high)"),t=matchMedia("not supported query");return e.media!==t.media&&!0===e.matches}return!1},isDolbyHdrSupported:function(){if("undefined"==typeof MediaSource||!MediaSource.isTypeSupported)return!1;return X_.isHdrSupported()&&(MediaSource.isTypeSupported('video/mp4;codecs="dvh1.08.07"')||MediaSource.isTypeSupported('video/mp4;codecs="hvc1.2.4.L150.90"')&&function(){if("undefined"!=typeof navigator){var e=null;if(void 0===Kw){var t=navigator.userAgent.toLowerCase();Kw=/chrome\/([\d.]+)/.exec(t)}if((e=Kw)&&e[1]&&parseInt(e[1].split(".")[0])>=122)return!0}return!1}())}},$_=X_;function J_(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}function Z_(e,t){this&&this.emit&&("error"===e?this.errorHandler(e,t.error):this.emit(e,t))}var Q_=function(e){Ho(n,e);var t=J_(n);function n(e){var i;Bo(this,n),(i=t.call(this,e))._hasStart=!1,i._currentTime=0,i._duration=0,i._internalOp={},i._lastMuted=!1,i.vtype=e.vtype||"MP4",i.bizType="number"==typeof e.bizType&&e.bizType>=0?e.bizType:0,i._rate=-1,i.videoConfig=Object.assign({},{controls:!1,autoplay:e.autoplay,playsinline:e.playsinline,"x5-playsinline":e.playsinline,"webkit-playsinline":e.playsinline,"x5-video-player-fullscreen":e["x5-video-player-fullscreen"]||e.x5VideoPlayerFullscreen,"x5-video-orientation":e["x5-video-orientation"]||e.x5VideoOrientation,airplay:e.airplay,"webkit-airplay":e.airplay,tabindex:0|e.tabindex,mediaType:e.mediaType||"video","data-index":-1},e.videoConfig,e.videoAttributes);var r=e["x5-video-player-type"]||e.x5VideoPlayerType;return $_.isWeixin&&$_.os.isAndroid&&r&&(i.videoConfig["x5-video-player-type"]=r,delete i.videoConfig.playsinline,delete i.videoConfig["webkit-playsinline"],delete i.videoConfig["x5-playsinline"]),e.loop&&(i.videoConfig.loop="loop"),i.video=Ww.createDom(i.videoConfig.mediaType,"",i.videoConfig,""),e.defaultPlaybackRate&&(i.video.defaultPlaybackRate=i.video.playbackRate=e.defaultPlaybackRate),"Number"===Ww.typeOf(e.volume)&&(i.volume=e.volume),e.autoplayMuted&&(i.video.muted=!0,i._lastMuted=!0),e.autoplay&&(i.video.autoplay=!0),i._interval={},i.videoEventMiddleware={},i.attachVideoEvents(),i}return Fo(n,[{key:"setEventsMiddleware",value:function(e){var t=this;Object.keys(e).map((function(n){t.videoEventMiddleware[n]=e[n]}))}},{key:"removeEventsMiddleware",value:function(e){var t=this;Object.keys(e).map((function(e){delete t.videoEventMiddleware[e]}))}},{key:"attachVideoEvents",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.evHandlers||(this._evHandlers=W_.map((function(e){return Go({},e,(i=t,r="on".concat((n=e).charAt(0).toUpperCase()).concat(n.slice(1)),i[r]&&"function"==typeof i[r]&&i.on(n,i[r]),function(e,t){var r=n,o={player:i,eventName:r,originalEvent:e,detail:e.detail||{},timeStamp:e.timeStamp,currentTime:i.currentTime,duration:i.duration,paused:i.paused,ended:i.ended,isInternalOp:!!i._internalOp[e.type],muted:i.muted,volume:i.volume,host:Ww.getHostFromUrl(i.currentSrc),vtype:i.vtype};if(i.removeInnerOP(e.type),"timeupdate"===r&&(i._currentTime=i.video&&i.video.currentTime),"ratechange"===r){var a=i.video?i.video.playbackRate:0;if(a&&i._rate===a)return;i._rate=i.video&&i.video.playbackRate}if("durationchange"===r&&(i._duration=i.video.duration),"volumechange"===r&&(o.isMutedChange=i._lastMuted!==i.muted,i._lastMuted=i.muted),"error"===r&&(o.error=t||i.video.error),i.videoEventMiddleware[n]){var s=Z_.bind(i,n,o);try{i.videoEventMiddleware[n].call(i,o,s)}catch(e){throw Z_.call(i,r,o),e}}else Z_.call(i,r,o)}));var n,i,r}))),e||(e=this.video),this._evHandlers.forEach((function(t){var i=Object.keys(t)[0];(0===n.length||n.indexOf(i)>-1)&&e.addEventListener(i,t[i],!1)}))}},{key:"detachVideoEvents",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];e||(e=this.video),this._evHandlers.forEach((function(n){var i=Object.keys(n)[0];(0===t.length||t.indexOf(i)>-1)&&e.removeEventListener(i,n[i],!1)}))}},{key:"_attachSourceEvents",value:function(e,t){var n=this;e.removeAttribute("src"),e.load(),e.removeEventListener("loadeddata",this._vLoadeddata),t.forEach((function(e){n.video.appendChild(Ww.createDom("source","",{src:"".concat(e.src),type:"".concat(e.type||"")}))}));var i=e.children;if(i){this._videoSourceCount=i.length,this._vLoadeddata=function(e){n.emit(U_,{src:e.target.currentSrc,host:Ww.getHostFromUrl(e.target.currentSrc)})};for(var r=null,o=0;o<this._evHandlers.length;o++)if("error"===Object.keys(this._evHandlers[o])[0]){r=this._evHandlers[o];break}!this._sourceError&&(this._sourceError=function(e){if(n._videoSourceCount--,0===n._videoSourceCount){var t={code:4,message:"sources_load_error"};r?r.error(e,t):n.errorHandler("error",t)}var i=zw[4];n.emit(H_,new Yw(n,{errorType:i,errorCode:4,errorMessage:"sources_load_error",mediaError:{code:4,message:"sources_load_error"},src:e.target.src}))});for(var a=0;a<i.length;a++)i[a].addEventListener("error",this._sourceError);e.addEventListener("loadeddata",this._vLoadeddata)}}},{key:"_detachSourceEvents",value:function(e){var t=e.children;if(t&&0!==t.length&&this._sourceError){for(var n=0;n<t.length;n++)t[n].removeEventListener("error",this._sourceError);for(;t.length>0;)e.removeChild(t[0]);this._vLoadeddata&&e.removeEventListener("loadeddata",this._vLoadeddata)}}},{key:"errorHandler",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.video&&(this.video.error||t)){var n=this.video.error||t,i=n.code?zw[n.code]:"other";n.message;this.video.currentSrc||(n={code:6,message:"empty_src_".concat(n.message)}),this.emit(e,new Yw(this,{errorType:i,errorCode:n.code,errorMessage:n.message||"",mediaError:n}))}}},{key:"hasStart",get:function(){return this._hasStart},set:function(e){"boolean"==typeof e&&(this._hasStart=e,this.emit("hasstart"))}},{key:"destroy",value:function(){var e=this;for(var t in this.video&&(this.video.pause&&(this.video.pause(),this.video.muted=!0),this.video.removeAttribute("src"),this.video.load()),this._currentTime=0,this._duration=0,this._hasStart=!1,this.videoConfig=null,this._interval)Object.prototype.hasOwnProperty.call(this._interval,t)&&(clearInterval(this._interval[t]),this._interval[t]=null);this.detachVideoEvents(),this._evHandlers.map((function(t){var n=Object.keys(t)[0],i="on".concat(n.charAt(0).toUpperCase()).concat(n.slice(1));"function"==typeof e[i]&&e.off(n,e[i])})),this._evHandlers=null,this.video=null,this.videoEventMiddleware={},this.removeAllListeners()}},{key:"play",value:function(){return this.video?this.video.play():null}},{key:"pause",value:function(){this.video&&this.video.pause()}},{key:"load",value:function(){this.video&&this.video.load()}},{key:"canPlayType",value:function(e){return!!this.video&&this.video.canPlayType(e)}},{key:"getBufferedRange",value:function(e){var t=[0,0];if(!this.video)return t;e||(e=this.video.buffered);var n=this.video.currentTime;if(e)for(var i=0,r=e.length;i<r&&(t[0]=e.start(i),t[1]=e.end(i),!(t[0]<=n&&n<=t[1]));i++);return t[0]-n<=0&&n-t[1]<=0?t:[0,0]}},{key:"autoplay",get:function(){return!!this.video&&this.video.autoplay},set:function(e){this.video&&(this.video.autoplay=e)}},{key:"buffered",get:function(){return this.video?this.video.buffered:null}},{key:"buffered2",get:function(){return this.video?Ww.getBuffered2(this.video.buffered):null}},{key:"bufferedPoint",get:function(){var e={start:0,end:0};if(!this.video)return e;var t=this.video.buffered;if(!t||0===t.length)return e;for(var n=0;n<t.length;n++)if((t.start(n)<=this.currentTime||t.start(n)<.1)&&t.end(n)>=this.currentTime)return{start:t.start(n),end:t.end(n)};return e}},{key:"crossOrigin",get:function(){return this.video?this.video.crossOrigin:""},set:function(e){this.video&&(this.video.crossOrigin=e)}},{key:"currentSrc",get:function(){return this.video?this.video.currentSrc:""},set:function(e){this.video&&(this.video.currentSrc=e)}},{key:"currentTime",get:function(){return this.video?void 0!==this.video.currentTime?this.video.currentTime:this._currentTime:0},set:function(e){this.video&&(this.video.currentTime=e)}},{key:"defaultMuted",get:function(){return!!this.video&&this.video.defaultMuted},set:function(e){this.video&&(this.video.defaultMuted=e)}},{key:"duration",get:function(){return this._duration}},{key:"ended",get:function(){return!!this.video&&this.video.ended}},{key:"error",get:function(){if(!this.video||!this.video.error)return null;return["MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED"][this.video.error.code-1]}},{key:"loop",get:function(){return!!this.video&&this.video.loop},set:function(e){this.video&&(this.video.loop=e)}},{key:"muted",get:function(){return!!this.video&&this.video.muted},set:function(e){this.video&&this.video.muted!==e&&(this._lastMuted=this.video.muted,this.video.muted=e)}},{key:"networkState",get:function(){return this.video?this.video.networkState:0}},{key:"paused",get:function(){return!this.video||this.video.paused}},{key:"playbackRate",get:function(){return this.video?this.video.playbackRate:0},set:function(e){this.video&&e!==1/0&&(this.video.defaultPlaybackRate=e,this.video.playbackRate=e)}},{key:"played",get:function(){return this.video?this.video.played:null}},{key:"preload",get:function(){return!!this.video&&this.video.preload},set:function(e){this.video&&(this.video.preload=e)}},{key:"readyState",get:function(){return this.video?this.video.readyState:0}},{key:"seekable",get:function(){return!!this.video&&this.video.seekable}},{key:"seeking",get:function(){return!!this.video&&this.video.seeking}},{key:"src",get:function(){return this.video?this.video.src:""},set:function(e){this.video.src=e}},{key:"volume",get:function(){return this.video?this.video.volume:0},set:function(e){"number"!=typeof e||e<0||e>1||!this.video||(this.video.volume=e)}},{key:"addInnerOP",value:function(e){this._internalOp[e]=!0}},{key:"removeInnerOP",value:function(e){delete this._internalOp[e]}},{key:"emit",value:function(e,t){for(var i,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(i=uu(Vo(n.prototype),"emit",this)).call.apply(i,[this,e,t].concat(o))}},{key:"on",value:function(e,t){for(var i,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(i=uu(Vo(n.prototype),"on",this)).call.apply(i,[this,e,t].concat(o))}},{key:"once",value:function(e,t){for(var i,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(i=uu(Vo(n.prototype),"once",this)).call.apply(i,[this,e,t].concat(o))}},{key:"off",value:function(e,t){for(var i,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(i=uu(Vo(n.prototype),"off",this)).call.apply(i,[this,e,t].concat(o))}},{key:"offAll",value:function(){uu(Vo(n.prototype),"removeAllListeners",this).call(this)}}]),n}(Sy),eC=Q_,tC=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{name:"xgplayer",version:1,db:null,ojstore:{name:"xg-m4a",keypath:"vid"}};Bo(this,e),this.indexedDB=window.indexedDB||window.webkitindexedDB,this.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange,this.myDB=t}return Fo(e,[{key:"openDB",value:function(e){var t=this,n=this,i=this.myDB.version||1,r=n.indexedDB.open(n.myDB.name,i);r.onerror=function(e){},r.onsuccess=function(i){t.myDB.db=i.target.result,e.call(n)},r.onupgradeneeded=function(e){var t=e.target.result;e.target.transaction,t.objectStoreNames.contains(n.myDB.ojstore.name)||t.createObjectStore(n.myDB.ojstore.name,{keyPath:n.myDB.ojstore.keypath})}}},{key:"deletedb",value:function(){this.indexedDB.deleteDatabase(this.myDB.name)}},{key:"closeDB",value:function(){this.myDB.db.close()}},{key:"addData",value:function(e,t){for(var n,i=this.myDB.db.transaction(e,"readwrite").objectStore(e),r=0;r<t.length;r++)(n=i.add(t[r])).onerror=function(){},n.onsuccess=function(){}}},{key:"putData",value:function(e,t){for(var n,i=this.myDB.db.transaction(e,"readwrite").objectStore(e),r=0;r<t.length;r++)(n=i.put(t[r])).onerror=function(){},n.onsuccess=function(){}}},{key:"getDataByKey",value:function(e,t,n){var i=this,r=this.myDB.db.transaction(e,"readwrite").objectStore(e).get(t);r.onerror=function(){n.call(i,null)},r.onsuccess=function(e){var t=e.target.result;n.call(i,t)}}},{key:"deleteData",value:function(e,t){this.myDB.db.transaction(e,"readwrite").objectStore(e).delete(t)}},{key:"clearData",value:function(e){this.myDB.db.transaction(e,"readwrite").objectStore(e).clear()}}]),e}(),nC=tC,iC=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],rC=["requestFullscreen","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen"],oC=["exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen"],aC="data-xgplayerid",sC={BUFFER_CONTROLS:"buffer_control"},cC={PLAYING:"playing",WAITING:"waiting"},uC=fr,lC=Za.find,fC=zv,hC="find",dC=!0;function pC(e,t,n){for(var i=arguments.length,r=new Array(i>3?i-3:0),o=3;o<i;o++)r[o-3]=arguments[o];var a=t.call.apply(t,[e].concat(r));n&&"function"==typeof n&&(a&&a.then?a.then((function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];n.call.apply(n,[e].concat(i))})):n.call.apply(n,[e].concat(r)))}function vC(e,t){var 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),function(){var i=arguments,r=this;if(n.pre)try{var o;(o=n.pre).call.apply(o,[this].concat(Array.prototype.slice.call(arguments)))}catch(t){throw t.message="[pluginName: ".concat(this.pluginName,":").concat(e,":pre error] >> ").concat(t.message),t}if(this.__hooks&&this.__hooks[e])try{var a,s=(a=this.__hooks[e]).call.apply(a,[this,this].concat(Array.prototype.slice.call(arguments)));s?s.then?s.then((function(e){!1!==e&&pC.apply(void 0,[r,t,n.next].concat(Py(i)))})).catch((function(e){throw e})):pC.apply(void 0,[this,t,n.next].concat(Array.prototype.slice.call(arguments))):void 0===s&&pC.apply(void 0,[this,t,n.next].concat(Array.prototype.slice.call(arguments)))}catch(t){throw t.message="[pluginName: ".concat(this.pluginName,":").concat(e,"] >> ").concat(t.message),t}else pC.apply(void 0,[this,t,n.next].concat(Array.prototype.slice.call(arguments)))}.bind(this)}function gC(e,t){var n=this.__hooks;if(n)return n.hasOwnProperty(e)?(n&&(n[e]=t),!0):(console.warn("has no supported hook which name [".concat(e,"]")),!1)}function yC(e,t){var n=this.__hooks;if(!n||!Array.isArray(n[e]))return-1;for(var i=n[e],r=0;r<i.length;r++)if(i[r]===t)return r;return-1}function mC(e,t){var n=this.__hooks;if(n)if(Array.isArray(n[e])){var i=n[e],r=yC.call(this,e,t);-1!==r&&i.splice(r,1)}else n[e]&&(n[e]=null)}function kC(e){if(this.plugins&&this.plugins[e.toLowerCase()]){for(var t=this.plugins[e.toLowerCase()],n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return t.useHooks&&t.useHooks.apply(t,i)}}function bC(e){if(this.plugins&&this.plugins[e.toLowerCase()]){var t=this.plugins[e.toLowerCase()];if(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return t.removeHooks&&t.removeHooks.apply(t,i)}}}function wC(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];e.__hooks={},t&&t.map((function(t){e.__hooks[t]=null})),Object.defineProperty(e,"hooks",{get:function(){return e.__hooks&&Object.keys(e.__hooks).map((function(t){if(e.__hooks[t])return t}))}})}function _C(e){e.__hooks=null}function CC(e,t,n){for(var i=arguments.length,r=new Array(i>3?i-3:0),o=3;o<i;o++)r[o-3]=arguments[o];if(!e.__hooks||!e.__hooks[t])return n.call.apply(n,[e,e].concat(r));var a,s=(a=e.__hooks[t]).call.apply(a,[e,e].concat(r));if(s&&s.then)s.then((function(t){return!1===t?null:n.call.apply(n,[e,e].concat(r))})).catch((function(e){console.warn("[runHooks]".concat(t," reject"),e.message)}));else if(!1!==s)return n.call.apply(n,[e,e].concat(r))}function xC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function SC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xC(Object(n),!0).forEach((function(t){Go(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xC(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function TC(e,t){Hw.logError("[".concat(e,"] event or callback cant be undefined or null when call ").concat(t))}hC in[]&&Array(1)[hC]((function(){dC=!1})),uC({target:"Array",proto:!0,forced:dC},{find:function(e){return lC(this,e,arguments.length>1?arguments[1]:void 0)}}),fC(hC);var EC=function(){function e(t){Bo(this,e),Ww.checkIsFunction(this.beforeCreate)&&this.beforeCreate(t),wC(this),this.__args=t,this.__events={},this.__onceEvents={},this.config=t.config||{},this.player=null,this.playerConfig={},this.pluginName="",this.__init(t)}return Fo(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:"reInitialize",value:function(){this.__init(this.__args)}},{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,t=Ww.checkTouchSupport()?"touch":"mouse";return["compatible","touch","mouse"].indexOf(null===(e=this.playerConfig)||void 0===e?void 0:e.domEventType)>-1&&(t=this.playerConfig.domEventType),t}},{key:"on",value:function(e,t){var n=this;e&&t&&this.player?"string"==typeof e?(this.__events[e]=t,this.player.on(e,t)):Array.isArray(e)&&e.forEach((function(e){n.__events[e]=t,n.player.on(e,t)})):TC(this.pluginName,"plugin.on(event, callback)")}},{key:"once",value:function(e,t){var n=this;e&&t&&this.player?"string"==typeof e?(this.__onceEvents[e]=t,this.player.once(e,t)):Array.isArray(e)&&e.forEach((function(i){n.__onceEvents[i]=t,n.player.once(e,t)})):TC(this.pluginName,"plugin.once(event, callback)")}},{key:"off",value:function(e,t){var n=this;e&&t&&this.player?"string"==typeof e?(delete this.__events[e],this.player.off(e,t)):Array.isArray(e)&&e.forEach((function(i){delete n.__events[e],n.player.off(i,t)})):TC(this.pluginName,"plugin.off(event, callback)")}},{key:"offAll",value:function(){var e=this;["__events","__onceEvents"].forEach((function(t){Object.keys(e[t]).forEach((function(n){e[t][n]&&e.off(n,e[t][n]),n&&delete e[t][n]}))})),this.__events={},this.__onceEvents={}}},{key:"emit",value:function(e){var t;if(this.player){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];(t=this.player).emit.apply(t,[e].concat(i))}}},{key:"emitUserAction",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.player){var i=SC(SC({},n),{},{pluginName:this.pluginName});this.player.emitUserAction(e,t,i)}}},{key:"hook",value:function(e,t){return vC.call.apply(vC,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];return gC.call.apply(gC,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];return mC.call.apply(mC,[this].concat(Array.prototype.slice.call(arguments)))}},{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]:"";if(this.player)return n&&(t.pluginName=n),this.player.registerPlugin({plugin:e,options:t})}},{key:"getPlugin",value:function(e){return this.player?this.player.getPlugin(e):null}},{key:"__destroy",value:function(){var e=this,t=this.player,n=this.pluginName;this.offAll(),Ww.clearAllTimers(this),Ww.checkIsFunction(this.destroy)&&this.destroy(),["player","playerConfig","pluginName","logger","__args","__hooks"].map((function(t){e[t]=null})),t.unRegisterPlugin(n),_C(this)}}],[{key:"defineGetterOrSetter",value:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&Object.defineProperty(e,n,t[n])}},{key:"defaultConfig",get:function(){return{}}},{key:"pluginName",get:function(){return"pluginName"}}]),e}();if("undefined"!=typeof Element&&!Element.prototype.matches){var PC=Element.prototype;PC.matches=PC.matchesSelector||PC.mozMatchesSelector||PC.msMatchesSelector||PC.oMatchesSelector||PC.webkitMatchesSelector}var RC=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}};function OC(e,t,n,i,r){var o=IC.apply(this,arguments);return e.addEventListener(n,o,r),{destroy:function(){e.removeEventListener(n,o,r)}}}function IC(e,t,n,i){return function(n){n.delegateTarget=RC(n.target,t),n.delegateTarget&&i.call(e,n)}}var LC=function(e,t,n,i,r){return"function"==typeof e.addEventListener?OC.apply(null,arguments):"function"==typeof n?OC.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return OC(e,t,n,i,r)})))};function AC(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var DC={CONTROLS:"controls",ROOT:"root"},MC={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"},NC="xg-icon-disable";function FC(e){return!!e&&(e.indexOf&&/^(?:http|data:|\/)/.test(e))}function BC(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",o=null;if(e instanceof window.Element)return Ww.addClass(e,n),Object.keys(i).map((function(t){e.setAttribute(t,i[t])})),e;if(FC(e)||FC(e.url))return i.src=FC(e)?e:e.url||"",o=Ww.createDom(e.tag||"img","",i,"xg-img ".concat(n));if("function"==typeof e)try{return(o=e())instanceof window.Element?(Ww.addClass(o,n),Object.keys(i).map((function(e){o.setAttribute(e,i[e])})),o):(Hw.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(r,"] is a function mast return an Element Object")),null)}catch(e){return Hw.logError("Plugin named [".concat(r,"]:createIcon"),e),null}return"string"==typeof e?Ww.createDomFromHtml(e,i,n):(Hw.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(r,"] is invalid")),null)}function jC(e,t){var n=t.config.icons||t.playerConfig.icons;Object.keys(e).map((function(i){var r=e[i],o=r&&r.class?r.class:"",a=r&&r.attr?r.attr:{},s=null;n&&n[i]&&(o=function(e,t){return"object"===Do(e)&&e.class&&"string"==typeof e.class?"".concat(t," ").concat(e.class):t}(n[i],o),a=function(e,t){return"object"===Do(e)&&e.attr&&"object"===Do(e.attr)&&Object.keys(e.attr).map((function(n){t[n]=e.attr[n]})),t}(n[i],a),s=BC(n[i],i,o,a,t.pluginName)),!s&&r&&(s=BC(r.icon?r.icon:r,a,o,{},t.pluginName)),t.icons[i]=s}))}var HC=function(e){Ho(n,e);var t=AC(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Bo(this,n),(e=t.call(this,i)).__delegates=[],e}return Fo(n,[{key:"__init",value:function(e){if(uu(Vo(n.prototype),"__init",this).call(this,e),e.root){var t=e.root,i=null;this.icons={},this.root=null,this.parent=null,jC(this.registerIcons()||{},this),this.langText={};var r,o,a=this.registerLanguageTexts()||{};r=a,o=this,Object.keys(r).map((function(e){Object.defineProperty(o.langText,e,{get:function(){var t=o.lang,n=o.i18n;return n[e]?n[e]:r[e]&&r[e][t]||""}})}));var s="";try{s=this.render()}catch(e){throw Hw.logError("Plugin:".concat(this.pluginName,":render"),e),new Error("Plugin:".concat(this.pluginName,":render:").concat(e.message))}if(s)(i=n.insert(s,t,e.index)).setAttribute("data-index",e.index);else{if(!e.tag)return;(i=Ww.createDom(e.tag,"",e.attr,e.name)).setAttribute("data-index",e.index),t.appendChild(i)}this.root=i,this.parent=t;var c=this.config.attr||{},u=this.config.style||{};this.setAttr(c),this.setStyle(u),this.config.index&&this.root.setAttribute("data-index",this.config.index),this.__registerChildren()}}},{key:"__registerChildren",value:function(){var e=this;if(this.root){this._children=[];var t=this.children();t&&"object"===Do(t)&&Object.keys(t).length>0&&Object.keys(t).map((function(n){var i,r,o=n,a=t[o],s={root:e.root};"function"==typeof a?(i=e.config[o]||{},r=a):"object"===Do(a)&&"function"==typeof a.plugin&&(i=a.options?Ww.deepCopy(e.config[o]||{},a.options):e.config[o]||{},r=a.plugin),s.config=i,void 0!==i.index&&(s.index=i.index),i.root&&(s.root=i.root),e.registerPlugin(r,s,o)}))}}},{key:"updateLang",value:function(e){e||(e=this.lang);var t=this.root,n=this.i18n,i=this.langText;t&&function e(t,n){for(var i=0;i<t.children.length;i++)t.children[i].children.length>0?e(t.children[i],n):n(t.children[i])}(t,(function(t){var r=t.getAttribute&&t.getAttribute("lang-key");if(r){var o=n[r.toUpperCase()]||i[r];o&&(t.innerHTML="function"==typeof o?o(e):o)}}))}},{key:"lang",get:function(){return this.player.lang}},{key:"changeLangTextKey",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=this.i18n||{},i=this.langText;e.setAttribute&&e.setAttribute("lang-key",t);var r=n[t]||i[t]||"";r&&(e.innerHTML=r)}},{key:"plugins",value:function(){return this._children}},{key:"disable",value:function(){this.config.disable=!0,Ww.addClass(this.find(".xgplayer-icon"),NC)}},{key:"enable",value:function(){this.config.disable=!1,Ww.removeClass(this.find(".xgplayer-icon"),NC)}},{key:"children",value:function(){return{}}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";t.root=t.root||this.root;var r=uu(Vo(n.prototype),"registerPlugin",this).call(this,e,t,i);return this._children.push(r),r}},{key:"unregisterPlugin",value:function(e){if(this._children instanceof Array){var t=function(e,t){if(e instanceof Array)for(var n=0;n<e.length;n++)if(t.call(null,e[n],n,e))return n;return-1}(this._children,(function(t){return t===e||t.pluginName&&t.pluginName===e.pluginName}));t>-1&&this._children.splice(t,1)}}},{key:"registerIcons",value:function(){return{}}},{key:"registerLanguageTexts",value:function(){return{}}},{key:"find",value:function(e){if(this.root)return this.root.querySelector(e)}},{key:"bind",value:function(e,t,i){var r=this;if(arguments.length<3&&"function"==typeof t)Array.isArray(e)?e.forEach((function(e){r.bindEL(e,t)})):this.bindEL(e,t);else{var o=n.delegate.call(this,this.root,e,t,i);this.__delegates=this.__delegates.concat(o)}}},{key:"unbind",value:function(e,t){var n=this;if(arguments.length<3&&"function"==typeof t)Array.isArray(e)?e.forEach((function(e){n.unbindEL(e,t)})):this.unbindEL(e,t);else for(var i="".concat(e,"_").concat(t),r=0;r<this.__delegates.length;r++)if(this.__delegates[r].key===i){this.__delegates[r].destroy(),this.__delegates.splice(r,1);break}}},{key:"setStyle",value:function(e,t){var n=this;if(this.root)return"String"===Ww.typeOf(e)?this.root.style[e]=t:void("Object"===Ww.typeOf(e)&&Object.keys(e).map((function(t){n.root.style[t]=e[t]})))}},{key:"setAttr",value:function(e,t){var n=this;if(this.root)return"String"===Ww.typeOf(e)?this.root.setAttribute(e,t):void("Object"===Ww.typeOf(e)&&Object.keys(e).map((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 n=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,n)}},{key:"unbindEL",value:function(e,t){var n=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,n)}},{key:"show",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.root&&(this.root.style.display=void 0!==e?e:"block",t&&"none"===window.getComputedStyle(this.root,null).getPropertyValue("display")))return this.root.style.display="block"}},{key:"hide",value:function(){this.root&&(this.root.style.display="none")}},{key:"appendChild",value:function(e,t){if(!this.root)return null;if(arguments.length<2&&arguments[0]instanceof window.Element)return this.root.appendChild(arguments[0]);if(!(t&&t instanceof window.Element))return null;try{return"string"==typeof e?this.find(e).appendChild(t):e.appendChild(t)}catch(e){return Hw.logError("Plugin:appendChild",e),null}}},{key:"render",value:function(){return""}},{key:"destroy",value:function(){}},{key:"__destroy",value:function(){var e=this,t=this.player;this.__delegates.map((function(e){e.destroy()})),this.__delegates=[],this._children instanceof Array&&(this._children.forEach((function(e){t.unRegisterPlugin(e.pluginName)})),this._children=null),this.root&&(this.root.hasOwnProperty("remove")?this.root.remove():this.root.parentNode&&this.root.parentNode.removeChild(this.root)),uu(Vo(n.prototype),"__destroy",this).call(this),this.icons={},["root","parent"].map((function(t){e[t]=null}))}}],[{key:"insert",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=t.children.length,r=Number(n),o=e instanceof window.Node;if(i){for(var a=0,s=null,c="";a<i;a++){s=t.children[a];var u=Number(s.getAttribute("data-index"));if(u>=r){c="beforebegin";break}u<r&&(c="afterend")}return o?"afterend"===c?t.appendChild(e):t.insertBefore(e,s):s.insertAdjacentHTML(c,e),"afterend"===c?t.children[t.children.length-1]:t.children[a]}return o?t.appendChild(e):t.insertAdjacentHTML("beforeend",e),t.children[t.children.length-1]}},{key:"defaultConfig",get:function(){return{}}},{key:"delegate",value:function(e,t,n,i){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=[];if(e instanceof window.Node&&"function"==typeof i)if(Array.isArray(n))n.forEach((function(n){var a=LC(e,t,n,i,r);a.key="".concat(t,"_").concat(n),o.push(a)}));else{var a=LC(e,t,n,i,r);a.key="".concat(t,"_").concat(n),o.push(a)}return o}},{key:"ROOT_TYPES",get:function(){return DC}},{key:"POSITIONS",get:function(){return MC}}]),n}(EC),UC=Tm.charAt,WC=Yo,VC=on,GC=Fg,KC=Bg,zC="String Iterator",YC=VC.set,qC=VC.getterFor(zC);GC(String,"String",(function(e){YC(this,{type:zC,string:WC(e),index:0})}),(function(){var e,t=qC(this),n=t.string,i=t.index;return i>=n.length?KC(void 0,!0):(e=UC(n,i),t.index+=e.length,KC(e,!1))}));var XC=function(){function e(){var t=this;if(Bo(this,e),Go(this,"__trigger",(function(e){var n=(new Date).getTime();t.timeStamp=n;for(var i=0;i<e.length;i++)t.__runHandler(e[i].target)})),this.__handlers=[],this.timeStamp=0,this.observer=null,window.ResizeObserver)try{this.observer=new window.ResizeObserver(function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return Vw(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),Gw(e,t,{leading:i,trailing:r,maxWait:t})}(this.__trigger,100,{trailing:!0})),this.timeStamp=(new Date).getTime()}catch(e){console.error(e)}}return Fo(e,[{key:"addObserver",value:function(e,t){if(this.observer){this.observer&&this.observer.observe(e);for(var n=e.getAttribute(aC),i=this.__handlers,r=-1,o=0;o<i.length;o++)i[o]&&e===i[o].target&&(r=o);r>-1?this.__handlers[r].handler=t:this.__handlers.push({target:e,handler:t,playerId:n})}}},{key:"unObserver",value:function(e){var t=-1;this.__handlers.map((function(n,i){e===n.target&&(t=i)}));try{this.observer&&this.observer.unobserve(e)}catch(e){}this.observer&&this.observer.unobserve(e),t>-1&&this.__handlers.splice(t,1)}},{key:"destroyObserver",value:function(){this.observer&&this.observer.disconnect(),this.observer=null,this.__handlers=null}},{key:"__runHandler",value:function(e){for(var t=this.__handlers,n=0;n<t.length;n++)if(t[n]&&e===t[n].target){try{t[n].handler(e)}catch(e){console.error(e)}return!0}return!1}}]),e}(),$C=null;var JC={pluginGroup:{},init:function(e){var t,n,i=e._pluginInfoId;i||(i=(new Date).getTime(),e._pluginInfoId=i),!e.config.closeResizeObserver&&(t=e.root,n=function(){e.getVideoSize()},$C||($C=new XC),$C.addObserver(t,n)),this.pluginGroup[i]={_originalOptions:e.config||{},_plugins:{}}},formatPluginInfo:function(e,t){var n=null,i=null;return e.plugin&&"function"==typeof e.plugin?(n=e.plugin,i=e.options):(n=e,i={}),t&&(i.config=t||{}),{PLUFGIN:n,options:i}},checkPluginIfExits:function(e,t){for(var n=0;n<t.length;n++)if(e.toLowerCase()===t[n].pluginName.toLowerCase())return!0;return!1},getRootByConfig:function(e,t){for(var n=Object.keys(t),i=null,r=0;r<n.length;r++)if(e.toLowerCase()===n[r].toLowerCase()){i=t[n[r]];break}return"Object"===Ww.typeOf(i)?{root:i.root,position:i.position}:{}},lazyRegister:function(e,t){var n=this,i=t.timeout||1500;return Promise.race([t.loader().then((function(t){var i;i=t&&t.__esModule?t.default:t,n.register(e,i,t.options)})),new Promise((function(e,t){setTimeout((function(){t(new Error("timeout"))}),i)}))])},register:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e&&t&&"function"==typeof t&&void 0!==t.prototype){var i=e._pluginInfoId;if(i&&this.pluginGroup[i]){this.pluginGroup[i]._plugins||(this.pluginGroup[i]._plugins={});var r=this.pluginGroup[i]._plugins,o=this.pluginGroup[i]._originalOptions;n.player=e;var a=n.pluginName||t.pluginName;if(!a)throw new Error("The property pluginName is necessary");if(!t.isSupported||t.isSupported()){n.config||(n.config={});for(var s=Object.keys(o),c=0;c<s.length;c++)if(a.toLowerCase()===s[c].toLowerCase()){var u=o[s[c]];"Object"===Ww.typeOf(u)&&(n.config=Object.assign({},n.config,o[s[c]]));break}t.defaultConfig&&Object.keys(t.defaultConfig).forEach((function(e){void 0===n.config[e]&&(n.config[e]=t.defaultConfig[e])})),n.root?"string"==typeof n.root&&(n.root=e[n.root]):n.root=e.root,n.index=n.config.index||0;try{r[a.toLowerCase()]&&(this.unRegister(i,a.toLowerCase()),console.warn("the is one plugin with same pluginName [".concat(a,"] exist, destroy the old instance")));var l=new t(n);return r[a.toLowerCase()]=l,r[a.toLowerCase()].func=t,l&&"function"==typeof l.afterCreate&&l.afterCreate(),l}catch(e){throw console.error(e),e}}else console.warn("not supported plugin [".concat(a,"]"))}}},unRegister:function(e,t){e._pluginInfoId&&(e=e._pluginInfoId),t=t.toLowerCase();var n=null;try{(n=this.pluginGroup[e]._plugins[t])&&(n.pluginName&&n.__destroy(),delete this.pluginGroup[e]._plugins[t])}catch(n){console.error("[unRegister:".concat(t,"] cgid:[").concat(e,"] error"),n)}return n},deletePlugin:function(e,t){var n=e._pluginInfoId;n&&this.pluginGroup[n]&&this.pluginGroup[n]._plugins&&delete this.pluginGroup[n]._plugins[t]},getPlugins:function(e){var t=e._pluginInfoId;return t&&this.pluginGroup[t]?this.pluginGroup[t]._plugins:{}},findPlugin:function(e,t){var n=e._pluginInfoId;if(!n||!this.pluginGroup[n])return null;var i=t.toLowerCase();return this.pluginGroup[n]._plugins[i]},beforeInit:function(e){var t=this;function n(e){return e&&e.then?e:new Promise((function(e){e()}))}return new Promise((function(i){if(t.pluginGroup)return(e._loadingPlugins&&e._loadingPlugins.length?Promise.all(e._loadingPlugins):Promise.resolve()).then((function(){var r=e._pluginInfoId;if(t.pluginGroup[r]){var o=t.pluginGroup[r]._plugins,a=[];Object.keys(o).forEach((function(e){if(o[e]&&o[e].beforePlayerInit)try{var t=o[e].beforePlayerInit();a.push(n(t))}catch(e){throw a.push(n(null)),e}})),Promise.all([].concat(a)).then((function(){i()})).catch((function(e){console.error(e),i()}))}else i()}))}))},afterInit:function(e){var t=e._pluginInfoId;if(t&&this.pluginGroup[t]){var n=this.pluginGroup[t]._plugins;Object.keys(n).forEach((function(e){n[e]&&n[e].afterPlayerInit&&n[e].afterPlayerInit()}))}},setLang:function(e,t){var n=t._pluginInfoId;if(n&&this.pluginGroup[n]){var i=this.pluginGroup[n]._plugins;Object.keys(i).forEach((function(t){if(i[t].updateLang)i[t].updateLang(e);else try{i[t].lang=e}catch(e){console.warn("".concat(t," setLang"))}}))}},reRender:function(e){var t=this,n=e._pluginInfoId;if(n&&this.pluginGroup[n]){var i=[],r=this.pluginGroup[n]._plugins;Object.keys(r).forEach((function(e){"controls"!==e&&r[e]&&(i.push({plugin:r[e].func,options:r[e].__args}),t.unRegister(n,e))})),i.forEach((function(n){t.register(e,n.plugin,n.options)}))}},onPluginsReady:function(e){var t=e._pluginInfoId;if(t&&this.pluginGroup[t]){var n=this.pluginGroup[t]._plugins||{};Object.keys(n).forEach((function(e){n[e].onPluginsReady&&"function"==typeof n[e].onPluginsReady&&n[e].onPluginsReady()}))}},destroy:function(e){var t=e._pluginInfoId;if(this.pluginGroup[t]){var n,i;n=e.root,$C.unObserver(n,i);for(var r=this.pluginGroup[t]._plugins,o=0,a=Object.keys(r);o<a.length;o++){var s=a[o];this.unRegister(t,s)}delete this.pluginGroup[t],delete e._pluginInfoId}}},ZC=JC,QC={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-inactive",FULLSCREEN:"xgplayer-is-fullscreen",CSS_FULLSCREEN:"xgplayer-is-cssfullscreen",PARENT_FULLSCREEN:"xgplayer-fullscreen-parent",ROTATE_FULLSCREEN:"xgplayer-rotate-fullscreen",PARENT_ROTATE_FULLSCREEN:"xgplayer-rotate-parent",INNER_FULLSCREEN:"xgplayer-inner-fullscreen",NO_CONTROLS:"no-controls",FLEX_CONTROLS:"flex-controls",CONTROLS_FOLLOW:"controls-follow",AUTOHIDE:"xgplayer_autohide",NOT_ALLOW_AUTOPLAY:"not-allow-autoplay",SEEKING:"seeking",PC:"xgplayer-pc",MOBILE:"xgplayer-mobile",MINI:"xgplayer-mini"};function ex(){return{id:"",el:null,url:"",domEventType:"default",nullUrlStart:!1,width:600,height:337.5,fluid:!1,fitVideoSize:"fixed",videoFillMode:"auto",volume:.6,autoplay:!1,autoplayMuted:!1,loop:!1,isLive:!1,zoom:1,videoInit:!0,poster:"",isMobileSimulateMode:!1,defaultPlaybackRate:1,execBeforePluginsCall:null,allowSeekAfterEnded:!0,enableContextmenu:!0,closeVideoClick:!1,closeVideoDblclick:!1,closePlayerBlur:!1,closeDelayBlur:!1,leavePlayerTime:3e3,closePlayVideoFocus:!1,closePauseVideoFocus:!1,closeFocusVideoFocus:!0,closeControlsBlur:!0,topBarAutoHide:!0,videoAttributes:{},startTime:0,seekedStatus:"play",miniprogress:!1,disableSwipeHandler:function(){},enableSwipeHandler:function(){},preProcessUrl:null,ignores:[],whitelist:[],inactive:3e3,lang:(e=(document.documentElement.getAttribute("lang")||navigator.language||"zh-cn").toLocaleLowerCase(),"zh-cn"===e&&(e="zh"),e),controls:!0,marginControls:!1,fullscreenTarget:null,screenShot:!1,rotate:!1,pip:!1,download:!1,mini:!1,cssFullscreen:!0,keyShortcut:!0,presets:[],plugins:[],playbackRate:1,definition:{list:[]},playsinline:!0,customDuration:0,timeOffset:0,icons:{},i18n:[],tabindex:0,thumbnail:null,videoConfig:{},isHideTips:!1,minWaitDelay:200,commonStyle:{progressColor:"",playedColor:"",cachedColor:"",sliderBtnStyle:{},volumeColor:""},enableMemLeakFix:!1};var e}function tx(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var nx=function(e){Ho(n,e);var t=tx(n);function n(){var e;Bo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Uo(e=t.call.apply(t,[this].concat(r))),"onMouseEnter",(function(t){var n=Uo(e),i=n.player;n.playerConfig.closeControlsBlur&&i.focus({autoHide:!1})})),Go(Uo(e),"onMouseLeave",(function(){Uo(e).player.focus()})),e}return Fo(n,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.controls&&(e.config.disable=!e.player.config.controls),e.config.mode||"mobile"!==$_.device||(e.config.mode="flex"),e.player.config.marginControls&&(e.config.autoHide=!1)}},{key:"afterCreate",value:function(){var e=this,t=this.config,n=t.disable,i=t.height,r=t.mode,o=t.autoHide;if(!n){"flex"===r&&this.player.addClass(QC.FLEX_CONTROLS),o&&this.player.addClass(QC.AUTOHIDE);var a={height:"".concat(i,"px")};Object.keys(a).map((function(t){e.root.style[t]=a[t]})),this.left=this.find("xg-left-grid"),this.center=this.find("xg-center-grid"),this.right=this.find("xg-right-grid"),this.innerRoot=this.find("xg-inner-controls"),this.on(P_,(function(t){t?Ww.addClass(e.root,"mini-controls"):Ww.removeClass(e.root,"mini-controls")}));var s=this.playerConfig.isMobileSimulateMode;"mobile"!==$_.device&&"mobile"!==s&&(this.bind("mouseenter",this.onMouseEnter),this.bind("mouseleave",this.onMouseLeave))}}},{key:"focus",value:function(){this.player.focus({autoHide:!1})}},{key:"unFocus",value:function(){this.player.focus({autoHide:!0})}},{key:"blur",value:function(){this.player.blur({ignorePaused:!0})}},{key:"recoverAutoHide",value:function(){this.config.autoHide&&Ww.addClass(this.root,"control_autohide")}},{key:"pauseAutoHide",value:function(){Ww.removeClass(this.root,"control_autohide")}},{key:"show",value:function(){this.root.style.display="",this.player.focus()}},{key:"hide",value:function(){this.root.style.display="none"}},{key:"mode",get:function(){return this.config.mode}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;if(this.root){var r=e.defaultConfig||{};if(!t.root){switch(t.position?t.position:t.config&&t.config.position?t.config.position:r.position){case MC.CONTROLS_LEFT:t.root=this.left;break;case MC.CONTROLS_RIGHT:t.root=this.right;break;case MC.CONTROLS_CENTER:t.root=this.center;break;case MC.CONTROLS:t.root=this.root;break;default:t.root=this.left}return uu(Vo(n.prototype),"registerPlugin",this).call(this,e,t,i)}}}},{key:"destroy",value:function(){"mobile"!==$_.device&&(this.unbind("mouseenter",this.onMouseEnter),this.unbind("mouseleave",this.onMouseLeave)),!!(this.player&&this.player.config&&this.player.config.enableMemLeakFix)&&(this.left=null,this.center=null,this.right=null,this.innerRoot=null)}},{key:"render",value:function(){var e=this.config,t=e.mode,n=e.autoHide,i=e.initShow;if(!e.disable){var r=Ww.classNames({"xgplayer-controls":!0},{"flex-controls":"flex"===t},{"bottom-controls":"bottom"===t},{control_autohide:n},{controls_permanent:!n},{"xgplayer-controls-initshow":i||!n});return'<xg-controls class="'.concat(r,'" unselectable="on">\n <xg-inner-controls class="xg-inner-controls xg-pos">\n <xg-left-grid class="xg-left-grid">\n </xg-left-grid>\n <xg-center-grid class="xg-center-grid"></xg-center-grid>\n <xg-right-grid class="xg-right-grid">\n </xg-right-grid>\n </xg-inner-controls>\n </xg-controls>')}}}],[{key:"pluginName",get:function(){return"controls"}},{key:"defaultConfig",get:function(){return{disable:!1,autoHide:!0,mode:"",initShow:!1}}}]),n}(HC),ix=nx,rx={lang:{},langKeys:[],textKeys:[]};function ox(e,t){return Object.keys(t).forEach((function(n){var i,r=Ww.typeOf(t[n]),o=Ww.typeOf(e[n]);"Array"===r?("Array"!==o&&(e[n]=[]),(i=e[n]).push.apply(i,Py(t[n]))):"Object"===r?("Object"!==o&&(e[n]={}),ox(e[n],t[n])):e[n]=t[n]})),e}function ax(){Object.keys(rx.lang.en).map((function(e){rx.textKeys[e]=e}))}function sx(e,t){var n=e.LANG;if(t||(t=rx),t.lang){var i=e.TEXT||{};"zh"===n&&(n="zh-cn"),t.lang[n]?ox(t.lang[n],i):(t.langKeys.push(n),t.lang[n]=i),ax()}}sx({LANG:"en",TEXT:{ERROR_TYPES:{network:{code:1,msg:"video download error"},mse:{code:2,msg:"stream append error"},parse:{code:3,msg:"parsing error"},format:{code:4,msg:"wrong format"},decoder:{code:5,msg:"decoding error"},runtime:{code:6,msg:"grammatical errors"},timeout:{code:7,msg:"play timeout"},other:{code:8,msg:"other errors"}},HAVE_NOTHING:"There is no information on whether audio/video is ready",HAVE_METADATA:"Audio/video metadata is ready ",HAVE_CURRENT_DATA:"Data about the current play location is available, but there is not enough data to play the next frame/millisecond",HAVE_FUTURE_DATA:"Current and at least one frame of data is available",HAVE_ENOUGH_DATA:"The available data is sufficient to start playing",NETWORK_EMPTY:"Audio/video has not been initialized",NETWORK_IDLE:"Audio/video is active and has been selected for resources, but no network is used",NETWORK_LOADING:"The browser is downloading the data",NETWORK_NO_SOURCE:"No audio/video source was found",MEDIA_ERR_ABORTED:"The fetch process is aborted by the user",MEDIA_ERR_NETWORK:"An error occurred while downloading",MEDIA_ERR_DECODE:"An error occurred while decoding",MEDIA_ERR_SRC_NOT_SUPPORTED:"Audio/video is not supported",REPLAY:"Replay",ERROR:"Network is offline",PLAY_TIPS:"Play",PAUSE_TIPS:"Pause",PLAYNEXT_TIPS:"Play next",DOWNLOAD_TIPS:"Download",ROTATE_TIPS:"Rotate",RELOAD_TIPS:"Reload",FULLSCREEN_TIPS:"Fullscreen",EXITFULLSCREEN_TIPS:"Exit fullscreen",CSSFULLSCREEN_TIPS:"Cssfullscreen",EXITCSSFULLSCREEN_TIPS:"Exit cssfullscreen",TEXTTRACK:"Caption",PIP:"PIP",SCREENSHOT:"Screenshot",LIVE:"LIVE",OFF:"Off",OPEN:"Open",MINI_DRAG:"Click and hold to drag",MINISCREEN:"Miniscreen",REFRESH_TIPS:"Please Try",REFRESH:"Refresh",FORWARD:"forward",LIVE_TIP:"Live"}});var cx={get textKeys(){return rx.textKeys},get langKeys(){return rx.langKeys},get lang(){var e={};return rx.langKeys.map((function(t){e[t]=rx.lang[t]})),rx.lang["zh-cn"]&&(e.zh=rx.lang["zh-cn"]||{}),e},extend:function(e,t){var n=[];if(t||(t=rx),t.lang){n="Array"!==Ww.typeOf(e)?Object.keys(e).map((function(t){return{LANG:"zh"===t?"zh-cn":t,TEXT:e[t]}})):e;var i=t.lang;n.map((function(e){"zh"===e.LANG&&(e.LANG="zh-cn"),i[e.LANG]?ox(i[e.LANG]||{},e.TEXT||{}):sx(e,t)})),ax()}},use:sx,init:function(e){var t,n={lang:{},langKeys:[],textKeys:{},pId:e};return ox(n.lang,rx.lang),(t=n.langKeys).push.apply(t,Py(rx.langKeys)),ox(n.textKeys,rx.textKeys),n}},ux=cx;function lx(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var fx={},hx=null,dx=function(e){Ho(n,e);var t=lx(n);function n(){return Bo(this,n),t.apply(this,arguments)}return Fo(n,[{key:"add",value:function(e){e&&(fx[e.playerId]=e,1===Object.keys(fx).length&&this.setActive(e.playerId,!0))}},{key:"remove",value:function(e){e&&(e.isUserActive,delete fx[e.playerId])}},{key:"_iterate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(var n in fx)if(Object.prototype.hasOwnProperty.call(fx,n)){var i=fx[n];if(t){if(e(i))break}else e(i)}}},{key:"forEach",value:function(e){this._iterate(e)}},{key:"find",value:function(e){var t=null;return this._iterate((function(n){var i=e(n);return i&&(t=n),i}),!0),t}},{key:"findAll",value:function(e){var t=[];return this._iterate((function(n){e(n)&&t.push(n)})),t}},{key:"setActive",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(fx[e]){if(t){var n=!1;this.forEach((function(t){e===t.playerId?(t.isUserActive||(n=!0),t.isUserActive=!0,t.isInstNext=!1):t.isUserActive=!1})),n&&this.emit("activeChanged")}else fx[e].isUserActive=t;return e}}},{key:"getActiveId",value:function(){for(var e=Object.keys(fx),t=0;t<e.length;t++){var n=fx[e[t]];if(n&&n.isUserActive)return e[t]}return null}},{key:"setNext",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(fx[e])return t?this.forEach((function(t){e===t.playerId?(t.isUserActive=!1,t.isInstNext=!0):t.isInstNext=!1})):fx[e].isInstNext=t,e}}],[{key:"getInstance",value:function(){return hx||(hx=new n),hx}}]),n}(xy.exports.EventEmitter);function px(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function vx(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?px(Object(n),!0).forEach((function(t){Go(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):px(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function gx(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var yx=["play","pause","replay","retry","playnext"],mx=0,kx=0,bx=null,wx=function(e){Ho(n,e);var t=gx(n);function n(e){var i;Bo(this,n);var r,o=Ww.deepMerge(ex(),e);Go(Uo(i=t.call(this,o)),"canPlayFunc",(function(){if(i.config){var e=i.config,t=e.autoplay,n=e.startTime,r=e.defaultPlaybackRate;Hw.logInfo("player","canPlayFunc, startTime",n),n&&(i.currentTime=n>i.duration?i.duration:n,i.config.startTime=0),i.playbackRate=r,t&&i.videoPlay(),i.off(i_,i.canPlayFunc),i.removeClass(QC.ENTER)}})),Go(Uo(i),"onFullscreenChange",(function(e,t){var n=function(){Ww.setTimeout(Uo(i),(function(){i.getVideoSize()}),100)},r=Ww.getFullScreenEl();i._fullActionFrom?i._fullActionFrom="":i.emit(B_,{eventType:"system",action:"switch_fullscreen",pluginName:"player",currentTime:i.currentTime,duration:i.duration,props:[{prop:"fullscreen",from:!0,to:!1}]});var o=function(e,t,n){if(e){var i=e.getAttribute(n);return!(!i||i!==t||"VIDEO"!==e.tagName&&"AUDIO"!==e.tagName)}}(r,i.playerId,aC);if(t||r&&(r===i._fullscreenEl||o))n(),!i.config.closeFocusVideoFocus&&i.video.focus(),i.fullscreen=!0,i.emit(T_,!0,i._fullScreenOffset),i.cssfullscreen&&i.exitCssFullscreen();else if(i.fullscreen){n();var a=Uo(i),s=a._fullScreenOffset;a.config.needFullscreenScroll?(window.scrollTo(s.left,s.top),Ww.setTimeout(Uo(i),(function(){i.fullscreen=!1,i._fullScreenOffset=null}),100)):(!i.config.closeFocusVideoFocus&&i.video.focus(),i.fullscreen=!1,i._fullScreenOffset=null),i.cssfullscreen?i.removeClass(QC.FULLSCREEN):i.recoverFullStyle(i.root,i._fullscreenEl,QC.FULLSCREEN),i._fullscreenEl=null,i.emit(T_,!1)}})),Go(Uo(i),"_onWebkitbeginfullscreen",(function(e){i._fullscreenEl=i.video,i.onFullscreenChange(e,!0)})),Go(Uo(i),"_onWebkitendfullscreen",(function(e){i.onFullscreenChange(e,!1)})),wC(Uo(i),yx),i.config=o,i._pluginInfoId=Ww.generateSessionId(),(r=Uo(i)).logInfo=Hw.logInfo.bind(r),r.logWarn=Hw.logWarn.bind(r),r.logError=Hw.logError.bind(r);var a=i.constructor.defaultPreset;if(i.config.presets.length){var s=i.config.presets.indexOf("default");s>=0&&a&&(i.config.presets[s]=a)}else a&&i.config.presets.push(a);return i.userTimer=null,i.waitTimer=null,i.isReady=!1,i.isPlaying=!1,i.isError=!1,i.isSeeking=!1,i.isCanplay=!1,i._runPending=!1,i.rotateDeg=0,i.isActive=!1,i.isBufferControlPaused=!1,i.isCssfullScreen=!1,i.fullscreen=!1,i._fullscreenEl=null,i._cssfullscreenEl=null,i.curDefinition=null,i._orgCss="",i._fullScreenOffset=null,i._videoHeight=0,i._videoWidth=0,i.videoPos={pi:1,scale:0,rotate:-1,x:0,y:0,h:-1,w:-1,vy:0,vx:0},i.sizeInfo={width:0,height:0,left:0,top:0},i._accPlayed={t:0,acc:0,loopAcc:0},i.innerContainer=null,i.controls=null,i.topBar=null,i.topBar=null,i.root=null,i.__i18n=ux.init(),$_.os.isAndroid&&$_.osVersion>0&&$_.osVersion<6&&(i.config.autoplay=!1),i.database=new nC,i.isUserActive=!1,i._onceSeekCanplay=null,i._isPauseBeforeSeek=0,i.innerStates={isActiveLocked:!1},i.instManager=bx,i._initDOM()?(i._bindEvents(),i._registerPresets(),i._registerPlugins(),ZC.onPluginsReady(Uo(i)),Ww.setTimeout(Uo(i),(function(){i.emit(p_),i.onReady&&i.onReady(),i.isReady=!0}),0),i.getInitDefinition(),i.syncFullstate(),(i.config.videoInit||i.config.autoplay)&&(i.hasStart||i.start()),i):(console.error(new Error("can't find the dom which id is ".concat(i.config.id," or this.config.el does not exist"))),Wo(i))}return Fo(n,[{key:"_initDOM",value:function(){var e,t=this;if(this.root=this.config.id?document.getElementById(this.config.id):null,!this.root){var n=this.config.el;if(!n||1!==n.nodeType)return this.emit(Zw,new Yw("use",this.config.vid,{line:32,handle:"Constructor",msg:"container id can't be empty"})),console.error("this.confg.id or this.config.el can't be empty"),!1;this.root=n}var i=function(e){for(var t=Object.keys(fx),n=0;n<t.length;n++){var i=fx[t[n]];if(i.root===e)return i}return null}(this.root);i&&(Hw.logWarn("The is an Player instance already exists in this.root, destroy it and reinitialize"),i.destroy()),this.root.setAttribute(aC,this.playerId),null===(e=bx)||void 0===e||e.add(this),ZC.init(this),this._initBaseDoms();var r=this.constructor.XgVideoProxy;if(r&&this.videoConfig.mediaType===r.mediaType){var o=this.innerContainer||this.root;this.detachVideoEvents(this.video);var a=new r(o,this.config,this.videoConfig);this.attachVideoEvents(a),this.video=a}if(this.video.setAttribute(aC,this.playerId),this.config.controls){var s=ZC.register(this,ix);this.controls=s}var c="mobile"===this.config.isMobileSimulateMode?"mobile":$_.device;if(this.addClass("".concat(QC.DEFAULT," ").concat(QC.ACTIVE," xgplayer-").concat(c," ").concat(this.config.controls?"":QC.NO_CONTROLS)),this.config.autoplay?this.addClass(QC.ENTER):this.addClass(QC.NO_START),this.config.fluid){var u={"max-width":"100%",width:"100%",height:"0","padding-top":"".concat(100*this.config.height/this.config.width,"%"),position:"position",top:"0",left:"0"};Object.keys(u).map((function(e){t.root.style[e]=u[e]}))}else["width","height"].map((function(e){t.config[e]&&("number"!=typeof t.config[e]?t.root.style[e]=t.config[e]:t.root.style[e]="".concat(t.config[e],"px"))}));var l=this.root.getBoundingClientRect(),f=l.width,h=l.height,d=l.left,p=l.top;return this.sizeInfo.width=f,this.sizeInfo.height=h,this.sizeInfo.left=d,this.sizeInfo.top=p,!0}},{key:"_initBaseDoms",value:function(){this.topBar=Ww.createDom("xg-bar","",{"data-index":-1},"xg-top-bar"),this.leftBar=Ww.createDom("xg-bar","",{"data-index":-1},"xg-left-bar"),this.rightBar=Ww.createDom("xg-bar","",{"data-index":-1},"xg-right-bar"),this.config.marginControls&&(this.innerContainer=Ww.createDom("xg-video-container","",{"data-index":-1},"xg-video-container"),this.root.appendChild(this.innerContainer)),this.root.appendChild(this.topBar),this.root.appendChild(this.leftBar),this.root.appendChild(this.rightBar)}},{key:"_bindEvents",value:function(){var e=this;["focus","blur"].forEach((function(t){e.on(t,e["on"+t.charAt(0).toUpperCase()+t.slice(1)])})),iC.forEach((function(t){document&&document.addEventListener(t,e.onFullscreenChange)})),$_.os.isIos&&(this.video.addEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.video.addEventListener("webkitendfullscreen",this._onWebkitendfullscreen)),this.once("loadeddata",this.getVideoSize),this.playFunc=function(){e.config.closeFocusVideoFocus||e.video.focus()},this.once("play",this.playFunc),this.on(C_,this.onBufferControl)}},{key:"_unbindEvents",value:function(){var e=this;this.root.removeEventListener("mousemove",this.mousemoveFunc),iC.forEach((function(t){document.removeEventListener(t,e.onFullscreenChange)})),this.playFunc&&this.off("play",this.playFunc),this.off("canplay",this.canPlayFunc),this.video.removeEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.video.removeEventListener("webkitendfullscreen",this._onWebkitendfullscreen)}},{key:"_startInit",value:function(e){var t=this;if(this.video&&(e&&""!==e&&("Array"!==Ww.typeOf(e)||0!==e.length)||(e="",this.emit(v_),Hw.logWarn("config.url is null, please get url and run player._startInit(url)"),!this.config.nullUrlStart))){this._detachSourceEvents(this.video),"Array"===Ww.typeOf(e)&&e.length>0?this._attachSourceEvents(this.video,e):this.video.src&&this.video.src===e?e||this.video.removeAttribute("src"):this.video.src=e,"Number"===Ww.typeOf(this.config.volume)&&(this.volume=this.config.volume);var n=this.innerContainer?this.innerContainer:this.root;this.video instanceof window.Element&&!n.contains(this.video)&&n.insertBefore(this.video,n.firstChild);var i=this.video.readyState;Hw.logInfo("_startInit readyState",i),this.config.autoplay&&(!Ww.isMSE(this.video)&&this.load(),($_.os.isIpad||$_.os.isPhone)&&this.videoPlay()),i>=2?this.canPlayFunc():this.once(i_,this.canPlayFunc),Ww.setTimeout(this,(function(){t.isComplete=!0,t.emit(m_)}),1),this.hasStart||ZC.afterInit(this),this.hasStart=!0}}},{key:"_registerPlugins",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._loadingPlugins=[];var n=this.config.ignores||[],i=this.config.plugins||[],r=this.config.i18n||[];t&&ux.extend(r,this.__i18n);var o=n.join("||").toLowerCase().split("||"),a=this.plugins;i.forEach((function(n){try{var i=n.plugin?n.plugin.pluginName:n.pluginName;if(!i)return;var r=i.toLowerCase(),s=e.config[r]||e.config[i];if("Boolean"===Ww.typeOf(s)&&!s||o.indexOf(r)>-1)return;if(!t&&a[r])return;if(n.lazy&&n.loader){var c=ZC.lazyRegister(e,n);return void(n.forceBeforeInit&&(c.then((function(){e._loadingPlugins.splice(e._loadingPlugins.indexOf(c),1)})).catch((function(t){Hw.logError("_registerPlugins:loadingPlugin",t),e._loadingPlugins.splice(e._loadingPlugins.indexOf(c),1)})),e._loadingPlugins.push(c)))}return e.registerPlugin(n)}catch(e){Hw.logError("_registerPlugins:",e)}}))}},{key:"_registerPresets",value:function(){var e=this;this.config.presets.forEach((function(t){!function(e,t){var n,i,r=t.preset&&t.options?new t.preset(t.options,e.config):new t({},e.config),o=r.plugins,a=void 0===o?[]:o,s=r.ignores,c=void 0===s?[]:s,u=r.icons,l=void 0===u?{}:u,f=r.i18n,h=void 0===f?[]:f;e.config.plugins||(e.config.plugins=[]),e.config.ignores||(e.config.ignores=[]),(n=e.config.plugins).push.apply(n,Py(a)),(i=e.config.ignores).push.apply(i,Py(c)),Object.keys(l).map((function(t){e.config.icons[t]||(e.config.icons[t]=l[t])}));var d=e.config.i18n||[];h.push.apply(h,Py(d)),e.config.i18n=h}(e,t)}))}},{key:"_getRootByPosition",value:function(e){var t=null;switch(e){case MC.ROOT_RIGHT:t=this.rightBar;break;case MC.ROOT_LEFT:t=this.leftBar;break;case MC.ROOT_TOP:t=this.topBar;break;default:t=this.innerContainer||this.root}return t}},{key:"registerPlugin",value:function(e,t){var n=ZC.formatPluginInfo(e,t),i=n.PLUFGIN,r=n.options,o=this.config.plugins;!ZC.checkPluginIfExits(i.pluginName,o)&&o.push(i);var a=ZC.getRootByConfig(i.pluginName,this.config);a.root&&(r.root=a.root),a.position&&(r.position=a.position);var s=r.position?r.position:r.config&&r.config.position||i.defaultConfig&&i.defaultConfig.position;return!r.root&&"string"==typeof s&&s.indexOf("controls")>-1?this.controls&&this.controls.registerPlugin(i,r,i.pluginName):(r.root||(r.root=this._getRootByPosition(s)),ZC.register(this,i,r))}},{key:"deregister",value:function(e){var t,n,i=ZC.unRegister(this,"string"==typeof e?e:e.pluginName);i&&null!==(t=this.config)&&void 0!==t&&t.unregisterPluginFromControls&&(null===(n=this.controls)||void 0===n||n.unregisterPlugin(i))}},{key:"unRegisterPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e&&(this.deregister(e),t&&this.removePluginFromConfig(e))}},{key:"removePluginFromConfig",value:function(e){var t;if("string"==typeof e?t=e:e instanceof EC&&(t=e.pluginName),t)for(var n=this.config.plugins.length-1;n>-1;n--){if(this.config.plugins[n].pluginName.toLowerCase()===t.toLowerCase()){this.config.plugins.splice(n,1);break}}}},{key:"plugins",get:function(){return ZC.getPlugins(this)}},{key:"getPlugin",value:function(e){var t=ZC.findPlugin(this,e);return t&&t.pluginName?t:null}},{key:"addClass",value:function(e){this.root&&(Ww.hasClass(this.root,e)||Ww.addClass(this.root,e))}},{key:"removeClass",value:function(e){this.root&&Ww.removeClass(this.root,e)}},{key:"hasClass",value:function(e){if(this.root)return Ww.hasClass(this.root,e)}},{key:"setAttribute",value:function(e,t){this.root&&this.root.setAttribute(e,t)}},{key:"removeAttribute",value:function(e,t){this.root&&this.root.removeAttribute(e,t)}},{key:"start",value:function(e){var t=this;if(!this.hasStart)return e||this.config.url||this.getInitDefinition(),this.hasStart=!0,this._registerPlugins(!1),ZC.beforeInit(this).then((function(){if(t.config){e||(e=t.url||t.config.url);var n=t.preProcessUrl(e);return t._startInit(n.url)}})).catch((function(e){throw e.fileName="player",e.lineNumber="236",Hw.logError("start:beforeInit:",e),e}))}},{key:"switchURL",value:function(e){var t=this,n=e;"Object"===Ww.typeOf(e)&&(n=e.url);var i=this.currentTime,r=this.paused&&!this.isError;return this.src=n,new Promise((function(e){var n=function(){t.currentTime=i,r&&t.once("canplay",(function(){t.pause()})),e()};$_.os.isAndroid?t.once("timeupdate",(function(){n()})):t.once("canplay",(function(){n()})),t.play()}))}},{key:"videoPlay",value:function(){var e=this;if(this.hasStart){this.isPlaying||(this.removeClass(QC.NO_START),!this.isCanplay&&this.addClass(QC.ENTER));var t=uu(Vo(n.prototype),"play",this).call(this);return void 0!==t&&t&&t.then?t.then((function(){e.removeClass(QC.NOT_ALLOW_AUTOPLAY),e.addClass(QC.PLAYING),e.isPlaying||(Hw.logInfo(">>>>playPromise.then"),e.isPlaying=!0,e.emit(g_))})).catch((function(t){if(Hw.logWarn(">>>>playPromise.catch",t.name),e.video&&e.video.error)return e.onError(),void e.removeClass(QC.ENTER);"NotAllowedError"===t.name&&(e._errorTimer=Ww.setTimeout(e,(function(){e._errorTimer=null,e.emit(y_),e.addClass(QC.NOT_ALLOW_AUTOPLAY),e.removeClass(QC.ENTER),e.pause()}),0)),"AbortError"===t.name&&(e._errorTimer=Ww.setTimeout(e,(function(){e._errorTimer=null,e.emit(x_)}),0))})):(Hw.logWarn("video.play not return promise"),this.isPlaying||(this.isPlaying=!0,this.removeClass(QC.NOT_ALLOW_AUTOPLAY),this.removeClass(QC.NO_START),this.removeClass(QC.ENTER),this.addClass(QC.PLAYING),this.emit(g_))),t}this.removeClass(QC.NO_START),this.addClass(QC.ENTER);var i=this.start();i&&i.then((function(t){!e.config.autoplay&&e.videoPlay()}))}},{key:"videoPause",value:function(){uu(Vo(n.prototype),"pause",this).call(this)}},{key:"play",value:function(){var e=this;this.removeClass(QC.PAUSED),CC(this,"play",(function(){e.videoPlay()}))}},{key:"pause",value:function(e){var t=this;CC(this,"pause",(function(){e===sC.BUFFER_CONTROLS?t.isBufferControlPaused||(t.isBufferControlPaused=!0,t.emit(C_,{type:cC.WAITING})):t.isBufferControlPaused&&(t.isBufferControlPaused=!1,t.emit(C_,{type:cC.PLAYING})),uu(Vo(n.prototype),"pause",t).call(t)}),e)}},{key:"seek",value:function(e,t){var n=this;if(this.video&&!Number.isNaN(Number(e))&&this.hasStart){var i=this.config,r=i.isSeekedPlay,o=i.seekedStatus,a=t||(r?"play":o);e=e<0?0:e>this.duration?parseInt(this.duration,10):e,!this._isPauseBeforeSeek&&(this._isPauseBeforeSeek=this.paused?2:1),this._onceSeekCanplay&&this.off(e_,this._onceSeekCanplay),this._onceSeekCanplay=function(){switch(n.removeClass(QC.ENTER),n.isSeeking=!1,a){case"play":n.play();break;case"pause":n.pause();break;default:n._isPauseBeforeSeek>1||n.paused?n.pause():n.play()}n._isPauseBeforeSeek=0,n._onceSeekCanplay=null},this.once(e_,this._onceSeekCanplay),this.isPlaying?this.currentTime=e:(this.removeClass(QC.NO_START),this.currentTime=e,this.play())}}},{key:"getInitDefinition",value:function(){var e=this,t=this.config,n=t.definition;!t.url&&n&&n.list&&n.list.length>0&&n.defaultDefinition&&n.list.map((function(t){t.definition===n.defaultDefinition&&(e.config.url=t.url,e.curDefinition=t.definition)}))}},{key:"changeDefinition",value:function(e,t){var n=this,i=this.config.definition;if(Array.isArray(null==i?void 0:i.list)&&i.list.forEach((function(t){(null==e?void 0:e.definition)===t.definition&&(n.curDefinition=t)})),null!=e&&e.bitrate&&"number"!=typeof e.bitrate&&(e.bitrate=parseInt(e.bitrate,10)||0),this.emit(R_,{from:t,to:e}),this.hasStart){var r=this.switchURL(e.url);r&&r.then?r.then((function(){n.emit(O_,{from:t,to:e})})):this.emit(O_,{from:t,to:e})}else this.config.url=e.url}},{key:"reload",value:function(){this.load(),this.reloadFunc=function(){this.play()},this.once("loadeddata",this.reloadFunc)}},{key:"resetState",value:function(){var e=this,t=[QC.NOT_ALLOW_AUTOPLAY,QC.PLAYING,QC.NO_START,QC.PAUSED,QC.REPLAY,QC.ENTER,QC.ENDED,QC.ERROR,QC.LOADING];this.hasStart=!1,this.isError=!1,this.isPlaying=!1,this.videoPause(),this._accPlayed.acc=0,this._accPlayed.t=0,this._accPlayed.loopAcc=0,t.forEach((function(t){e.removeClass(t)})),this.addClass(QC.ENTER),this.emit(j_)}},{key:"reset",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;if(this.resetState(),this.plugins&&(t.map((function(t){e.deregister(t)})),n)){var i=ex();Object.keys(this.config).keys((function(t){"undefined"===e.config[t]||"plugins"!==t&&"presets"!==t&&"el"!==t&&"id"!==t||(e.config[t]=i[t])}))}}},{key:"destroy",value:function(){var e=this,t=this.innerContainer,i=this.root,r=this.video;if(!(!this.config||!this.config.enableMemLeakFix)){if(this._destroyed)return;this._destroyed=!0;try{this._unbindEvents&&this._unbindEvents()}catch(e){}try{r&&this._detachSourceEvents(this.video)}catch(e){}try{Ww.clearAllTimers(this)}catch(e){}this.emit(b_);try{var o;null===(o=bx)||void 0===o||o.remove(this)}catch(e){}try{ZC.destroy(this)}catch(e){}try{_C(this)}catch(e){}try{uu(Vo(n.prototype),"destroy",this).call(this)}catch(e){}if(!i||!r)return;i.removeAttribute(aC),this.updateAcc("destroy")}else{var a;if(!i||!r)return;i.removeAttribute(aC),this.updateAcc("destroy"),this._unbindEvents(),this._detachSourceEvents(this.video),Ww.clearAllTimers(this),this.emit(b_),null===(a=bx)||void 0===a||a.remove(this),ZC.destroy(this),_C(this),uu(Vo(n.prototype),"destroy",this).call(this)}if(this.fullscreen&&this._fullscreenEl===this.root)try{this.exitFullscreen()}catch(e){}if(t)for(var s=t.children,c=0;c<s.length;c++)t.removeChild(s[c]);!t&&r instanceof window.Node&&i.contains(r)&&r.parentNode.removeChild(r),["topBar","leftBar","rightBar","innerContainer"].map((function(t){e[t]&&i.removeChild(e[t]),e[t]=null}));var u=i.className.split(" ");u.length>0?i.className=u.filter((function(e){return e.indexOf("xgplayer")<0})).join(" "):i.className="",this.removeAttribute("data-xgfill"),["isReady","isPlaying","isSeeking","isCanplay","isActive","isCssfullScreen","fullscreen"].map((function(t){e[t]=!1}))}},{key:"replay",value:function(){var e=this;this.removeClass(QC.ENDED),this.currentTime=0,this.isSeeking=!1,CC(this,"replay",(function(){e.once(e_,(function(){var t=e.videoPlay();t&&t.catch&&t.catch((function(e){console.log(e)}))})),e.play(),e.emit(k_),e.onPlay()}))}},{key:"retry",value:function(){var e=this;this.removeClass(QC.ERROR),this.addClass(QC.LOADING),CC(this,"retry",(function(){var t=e.currentTime;e.src=e.config.url,!e.config.isLive&&(e.currentTime=t),e.once(i_,(function(){e.videoPlay()}))}))}},{key:"syncFullstate",value:function(){var e=Ww.getFullScreenEl();e&&e===this.config.fullscreenTarget&&(this.fullscreen=!0,this._fullscreenEl=e,this._orgPCss||(this._orgPCss=Ww.filterStyleFromText(e)))}},{key:"changeFullStyle",value:function(e,t,n,i){e&&(i||(i=QC.PARENT_FULLSCREEN),this._orgCss||(this._orgCss=Ww.filterStyleFromText(e)),Ww.addClass(e,n),t&&t!==e&&!this._orgPCss&&(this._orgPCss=Ww.filterStyleFromText(t),Ww.addClass(t,i),t.setAttribute(aC,this.playerId)))}},{key:"recoverFullStyle",value:function(e,t,n,i){i||(i=QC.PARENT_FULLSCREEN),this._orgCss&&(Ww.setStyleFromCsstext(e,this._orgCss),this._orgCss=""),Ww.removeClass(e,n),t&&t!==e&&this._orgPCss&&(Ww.setStyleFromCsstext(t,this._orgPCss),this._orgPCss="",Ww.removeClass(t,i),t.removeAttribute(aC))}},{key:"getFullscreen",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget,n=this.root,i=this.video;if(t||(t=n),this._fullScreenOffset={top:Ww.scrollTop(),left:Ww.scrollLeft()},this._fullscreenEl=t,this._fullActionFrom="get",this.emit(S_),Ww.getFullScreenEl()===this._fullscreenEl)return this.onFullscreenChange(),Promise.resolve();try{for(var r=function(){var n=rC[o];if(t[n]){var i="webkitRequestFullscreen"===n?t.webkitRequestFullscreen(window.Element.ALLOW_KEYBOARD_INPUT):t[n]();return i&&i.then?(i.then((function(){"get"===e._fullActionFrom&&e.changeFullStyle(e.root,t,QC.FULLSCREEN)})).catch((function(e){Hw.logWarn("".concat(n,": ").concat((null==e?void 0:e.message)||"getFullscreen fail"))})),{v:i}):(e.changeFullStyle(e.root,t,QC.FULLSCREEN),{v:Promise.resolve()})}},o=0;o<rC.length;o++){var a=r();if("object"===Do(a))return a.v}return i.fullscreenEnabled||i.webkitSupportsFullscreen?(i.webkitEnterFullscreen(),Promise.resolve()):Promise.reject(new Error("call getFullscreen fail"))}catch(e){return Promise.reject(e)}}},{key:"exitFullscreen",value:function(e){if(this._fullscreenEl||Ww.getFullScreenEl()){this.root;var t=this.video;this._fullActionFrom="exit";for(var n=0;n<oC.length;n++){var i=oC[n];if(document[i]){var r=document[i]();return r&&r.then?r:Promise.resolve()}}return t&&t.webkitSupportsFullscreen?(t.webkitExitFullScreen(),Promise.resolve()):Promise.reject(new Error("call exitFullscreen fail"))}}},{key:"getCssFullscreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget;this.fullscreen&&this.exitFullscreen(),this._cssfullscreenEl=e,this.changeFullStyle(this.root,e,e?QC.INNER_FULLSCREEN:QC.CSS_FULLSCREEN),this.isCssfullScreen=!0,this.emit(E_,!0)}},{key:"exitCssFullscreen",value:function(){var e=this._cssfullscreenEl?QC.INNER_FULLSCREEN:QC.CSS_FULLSCREEN;this.fullscreen?this.removeClass(e):this.recoverFullStyle(this.root,this._cssfullscreenEl,e),this._cssfullscreenEl=null,this.isCssfullScreen=!1,this.emit(E_,!1)}},{key:"focus",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{autoHide:!this.config.closeDelayBlur,delay:this.config.inactive};this.isActive?this.onFocus(e):this.emit(h_,vx({paused:this.paused,ended:this.ended},e))}},{key:"blur",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{ignorePaused:!1};this.isActive?this.emit(d_,vx({paused:this.paused,ended:this.ended},e)):this.onBlur(e)}},{key:"onFocus",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{autoHide:!0,delay:3e3},n=this.innerStates;if(this.isActive=!0,this.removeClass(QC.ACTIVE),this.userTimer&&(Ww.clearTimeout(this,this.userTimer),this.userTimer=null),void 0!==t.isLock&&(n.isActiveLocked=t.isLock),!1===t.autoHide||!0===t.isLock||n.isActiveLocked)this.userTimer&&(Ww.clearTimeout(this,this.userTimer),this.userTimer=null);else{var i=t&&t.delay?t.delay:this.config.inactive;this.userTimer=Ww.setTimeout(this,(function(){e.userTimer=null,e.blur()}),i)}}},{key:"onBlur",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{ignorePaused:!1};if(this.isActive&&!this.innerStates.isActiveLocked){var t=this.config.closePauseVideoFocus;this.isActive=!1,(e.ignorePaused||t||!this.paused&&!this.ended)&&this.addClass(QC.ACTIVE)}}},{key:"onEmptied",value:function(){this.updateAcc("emptied")}},{key:"onCanplay",value:function(){this.hasStart&&this.removeClass(QC.ENTER),!this.isBufferControlPaused&&this.removeClass(QC.LOADING),this.isCanplay=!0,this.waitTimer&&Ww.clearTimeout(this,this.waitTimer)}},{key:"onLoadeddata",value:function(){this.isError=!1}},{key:"onPlay",value:function(){this.removeClass(QC.PAUSED),this.ended&&this.removeClass(QC.ENDED),!this.config.closePlayVideoFocus&&this.focus()}},{key:"onPause",value:function(){!this.isBufferControlPaused&&this.addClass(QC.PAUSED),this.updateAcc("pause"),this.config.closePauseVideoFocus||(this.userTimer&&(Ww.clearTimeout(this,this.userTimer),this.userTimer=null),this.focus())}},{key:"onEnded",value:function(){this.isBufferControlPaused=!1,this.updateAcc("ended"),this.addClass(QC.ENDED)}},{key:"onError",value:function(){this.isBufferControlPaused=!1,this.isError=!0,this.updateAcc("error"),this.removeClass(QC.NOT_ALLOW_AUTOPLAY),this.removeClass(QC.NO_START),this.removeClass(QC.ENTER),this.removeClass(QC.LOADING),this.addClass(QC.ERROR)}},{key:"onSeeking",value:function(){this.isSeeking||this.updateAcc("seeking"),this.isSeeking=!0,this.addClass(QC.SEEKING)}},{key:"onSeeked",value:function(){this.isSeeking=!1,this.waitTimer&&Ww.clearTimeout(this,this.waitTimer),this.removeClass(QC.LOADING),this.removeClass(QC.SEEKING)}},{key:"onWaiting",value:function(){var e=this;this.waitTimer&&Ww.clearTimeout(this,this.waitTimer),this.updateAcc("waiting"),this.waitTimer=Ww.setTimeout(this,(function(){e.addClass(QC.LOADING),Ww.clearTimeout(e,e.waitTimer),e.waitTimer=null}),200)}},{key:"onPlaying",value:function(){var e=this;this.isError=!1,[QC.NO_START,QC.PAUSED,QC.ENDED,QC.ERROR,QC.REPLAY,QC.LOADING].forEach((function(t){e.removeClass(t)}))}},{key:"onTimeupdate",value:function(){!this._videoHeight&&this.getVideoSize(),(this.waitTimer||this.hasClass(QC.LOADING))&&this.video.readyState>2&&(!this.isBufferControlPaused&&this.removeClass(QC.LOADING),Ww.clearTimeout(this,this.waitTimer),this.waitTimer=null),this.paused||this.isPlaying||!this.duration||(this.isPlaying=!0,this.emit(g_)),this._accPlayed.t||this.paused||this.ended||(this._accPlayed.t=(new Date).getTime())}},{key:"onVolumechange",value:function(){"Number"===Ww.typeOf(this.config.volume)&&(this.config.volume=this.volume)}},{key:"onRatechange",value:function(){this.config.defaultPlaybackRate=this.playbackRate}},{key:"onBufferControl",value:function(e){this.isPlaying&&("waiting"===e.type?(this.isBufferControlPaused=!0,this.addClass(QC.LOADING),this.removeClass(QC.PAUSED)):"playing"===e.type&&(this.isBufferControlPaused=!1,this.removeClass(QC.LOADING),this.paused&&this.addClass(QC.PAUSED)))}},{key:"emitUserAction",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.video&&t&&e){var i="String"===Ww.typeOf(e)?e:e.type||"";"switch_play_pause"===t&&("Undefined"===Ww.typeOf(n.paused)&&(n.paused=this.paused),n.isFirstStart=!this.playing),this.emit(B_,vx({eventType:i,action:t,currentTime:this.currentTime,duration:this.duration,ended:this.ended,event:e},n))}}},{key:"updateAcc",value:function(e){if(this._accPlayed.t){var t=(new Date).getTime(),n=t-this._accPlayed.t;if(n<0)return;this._accPlayed.acc+=n,this._accPlayed.t="get"===e?t:0,("ended"===e||this.ended)&&(this._accPlayed.loopAcc=this._accPlayed.acc)}}},{key:"checkBuffer",value:function(e){var t=this.video.buffered;if(!t||0===t.length||!this.duration)return!0;for(var n=parseInt(1e3*(e||this.video.currentTime||0),10),i=t.length,r=0;r<i;r++)if(parseInt(1e3*t.start(r),10)+200<=n&&parseInt(1e3*t.end(r),10)-200>n)return!0;return!1}},{key:"resizePosition",value:function(){var e=this.videoPos,t=e.rotate,n=e.vy,i=e.vx,r=e.h,o=e.w;if(!(t<0&&r<0&&o<0)){var a=this.videoPos._pi;if(!a&&this.video.videoHeight&&(a=this.video.videoWidth/this.video.videoHeight*100),a){this.videoPos.pi=a;var s={},c=0,u=0,l=1,f=t<0?0:Math.abs(t/90),h=this.root,d=this.innerContainer,p=h.offsetWidth,v=d?d.offsetHeight:h.offsetHeight,g=v,y=p,m={width:p,height:v};if(f%2==0)l=r>0?100/r:o>0?100/o:1,s.scale=l,c=n>0?(100-r)/2-n:0,s.y=2===f?0-c:c,u=i>0?(100-o)/2-i:0,s.x=2===f?0-u:u,m.width=y,m.height=g;else if(f%2==1){g=p;var k=v-p;u=-k/2/(y=v)*100,s.x=3===f?u+n/2:u-n/2,c=k/2/g*100,s.y=3===f?c+i/2:c-i/2,s.scale=l,m.width=y,m.height=g}var b=this.video;t>=0&&["width","height"].forEach((function(e){b.style[e]="".concat(m[e],"px")})),s.rotate=t<0?0:t;var w=Ww.getTransformStyle(s,this.video.style.transform||this.video.style.webkitTransform);b.style.transform=w,b.style.webkitTransform=w}}}},{key:"position",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{h:0,y:0,x:0,w:0};if(this.video&&e&&e.h){var t=this.videoPos;t.h=100*e.h||0,t.w=100*e.w||0,t.vx=100*e.x||0,t.vy=100*e.y||0,this.resizePosition()}}},{key:"setConfig",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{deepMerge:!1};e&&Object.keys(e).map((function(i){if("plugins"!==i){n.deepMerge&&"Object"===Ww.typeOf(t.config[i])?Ww.deepMerge(t.config[i],e[i]):t.config[i]=e[i];var r=t.plugins[i.toLowerCase()];r&&"Function"===Ww.typeOf(r.setConfig)&&r.setConfig(e[i],n)}}))}},{key:"playNext",value:function(e){var t=this;this.resetState(),this._currentTime=0,this._duration=0,this.isPlaying=!1,this.setConfig(e),this.vtype="MP4",CC(this,"playnext",(function(){t.start(),t.emit(M_,e)}))}},{key:"getVideoSize",value:function(){var e=this;if(this.video){var t=this.root.getBoundingClientRect();this.sizeInfo.width=t.width,this.sizeInfo.height=t.height,this.sizeInfo.left=t.left,this.sizeInfo.top=t.top;var n=this.video,i=n.videoWidth,r=n.videoHeight,o=this.config,a=o.fitVideoSize,s=o.videoFillMode;if("fill"!==s&&"cover"!==s&&"contain"!==s||this.setAttribute("data-xgfill",s),r&&i){this._videoHeight=r,this._videoWidth=i;var c=this.controls&&this.innerContainer?this.controls.root.getBoundingClientRect().height:0,u=t.width,l=t.height-c,f=parseInt(i/r*1e3,10),h=parseInt(u/l*1e3,10),d=u,p=l,v={};"auto"===a&&h>f||"fixWidth"===a?(p=u/f*1e3,this.config.fluid?v.paddingTop="".concat(100*p/d,"%"):v.height="".concat(p+c,"px")):("auto"===a&&h<f||"fixHeight"===a)&&(d=f*l/1e3,v.width="".concat(d,"px")),this.fullscreen||this.cssfullscreen||Object.keys(v).forEach((function(t){e.root.style[t]=v[t]})),("fillHeight"===s&&h<f||"fillWidth"===s&&h>f)&&this.setAttribute("data-xgfill","cover");var g={videoScale:f,vWidth:d,vHeight:p,cWidth:d,cHeight:p+c};this.resizePosition(),this.emit(I_,g)}}}},{key:"updateObjectPosition",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.video.updateObjectPosition?this.video.updateObjectPosition(e,t):this.video.style.objectPosition="".concat(100*e,"% ").concat(100*t,"%")}},{key:"preProcessUrl",value:function(e,t){var n=this.config,i=n.preProcessUrl,r=n.preProcessUrlOptions,o=Object.assign({},r,t);return Ww.isBlob(e)||"function"!=typeof i?{url:e}:i(e,o)}},{key:"src",get:function(){return this.video?this.video.src:""},set:function(e){this.video&&(this.emit(w_,e),this.emit(n_),this._currentTime=0,this._duration=0,Ww.isMSE(this.video)?this.onWaiting():(e=this.preProcessUrl(e).url,this._detachSourceEvents(this.video),"Array"===Ww.typeOf(e)?this._attachSourceEvents(this.video,e):e?this.video.src=e:this.video.removeAttribute("src"),this.load()))}},{key:"definitionList",get:function(){return this.config&&this.config.definition&&this.config.definition.list||[]},set:function(e){var t=this,n=this.config.definition;n.list=e,this.emit("resourceReady",e);var i=null,r=null;e.map((function(e){t.curDefinition===e.definition&&(i=e),n.defaultDefinition===e.definition&&(r=e)})),!r&&e.length>0&&(r=e[0]),i?this.changeDefinition(i):r&&this.changeDefinition(r)}},{key:"videoFrameInfo",get:function(){var e={total:0,dropped:0,corrupted:0,droppedRate:0,droppedDuration:0};if(!this.video||!this.video.getVideoPlaybackQuality)return e;var t=this.video.getVideoPlaybackQuality();return e.dropped=t.droppedVideoFrames||0,e.total=t.totalVideoFrames||0,e.corrupted=t.corruptedVideoFrames||0,e.total>0&&(e.droppedRate=e.dropped/e.total*100,e.droppedDuration=parseInt(this.cumulateTime/e.total*e.dropped,0)),e}},{key:"lang",get:function(){return this.config.lang},set:function(e){0!==ux.langKeys.filter((function(t){return t===e})).length||"zh"===e?(this.config.lang=e,ZC.setLang(e,this)):console.error("Sorry, set lang fail, because the language [".concat(e,"] is not supported now, list of all supported languages is [").concat(ux.langKeys.join(),"] "))}},{key:"i18n",get:function(){var e=this.config.lang;return"zh"===e&&(e="zh-cn"),this.__i18n.lang[e]||this.__i18n.lang.en}},{key:"i18nKeys",get:function(){return this.__i18n.textKeys||{}}},{key:"version",get:function(){return Ty}},{key:"playerId",get:function(){return this._pluginInfoId}},{key:"url",get:function(){return this.__url||this.config.url},set:function(e){this.__url=e}},{key:"poster",get:function(){return this.plugins.poster?this.plugins.poster.config.poster:this.config.poster},set:function(e){this.plugins.poster&&this.plugins.poster.update(e)}},{key:"readyState",get:function(){var e=uu(Vo(n.prototype),"readyState",this);return this.i18n[e]||e}},{key:"error",get:function(){var e=uu(Vo(n.prototype),"error",this);return this.i18n[e]||e}},{key:"networkState",get:function(){var e=uu(Vo(n.prototype),"networkState",this);return this.i18n[e]||e}},{key:"fullscreenChanging",get:function(){return!(null===this._fullScreenOffset)}},{key:"cumulateTime",get:function(){var e=this._accPlayed;return this.updateAcc("get"),e.acc}},{key:"zoom",get:function(){return this.config.zoom},set:function(e){this.config.zoom=e}},{key:"videoRotateDeg",get:function(){return this.videoPos.rotate},set:function(e){(e=Ww.convertDeg(e))%90==0&&e!==this.videoPos.rotate&&(this.videoPos.rotate=e,this.resizePosition())}},{key:"avgSpeed",get:function(){return kx},set:function(e){kx=e}},{key:"realTimeSpeed",get:function(){return mx},set:function(e){mx=e}},{key:"hook",value:function(e,t){return vC.call.apply(vC,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(e,t){return gC.call.apply(gC,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(e,t){return mC.call.apply(mC,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"usePluginHooks",value:function(e,t,n){for(var i=arguments.length,r=new Array(i>3?i-3:0),o=3;o<i;o++)r[o-3]=arguments[o];return kC.call.apply(kC,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removePluginHooks",value:function(e,t,n){for(var i=arguments.length,r=new Array(i>3?i-3:0),o=3;o<i;o++)r[o-3]=arguments[o];return bC.call.apply(bC,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"setUserActive",value:function(e,t){var n;"boolean"==typeof t&&t!==this.muted&&(this.addInnerOP("volumechange"),this.muted=t),null===(n=bx)||void 0===n||n.setActive(this.playerId,e)}}],[{key:"debugger",get:function(){return Hw.config.debug},set:function(e){Hw.config.debug=e}},{key:"instManager",get:function(){return bx},set:function(e){bx=e}},{key:"pluginsManager",get:function(){return ZC}},{key:"getCurrentUserActivePlayerId",value:function(){var e;return null===(e=bx)||void 0===e?void 0:e.getActiveId()}},{key:"setCurrentUserActive",value:function(e,t){var n;null===(n=bx)||void 0===n||n.setActive(e,t)}},{key:"isHevcSupported",value:function(){return $_.isHevcSupported()}},{key:"probeConfigSupported",value:function(e){return $_.probeConfigSupported(e)}},{key:"install",value:function(e,t){n.plugins||(n.plugins={}),n.plugins[e]||(n.plugins[e]=t)}},{key:"use",value:function(e,t){n.plugins||(n.plugins={}),n.plugins[e]=t}}]),n}(eC);function _x(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Cx(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_x(Object(n),!0).forEach((function(t){Go(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_x(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function xx(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}function Sx(){return(new Date).getTime()}Go(wx,"defaultPreset",null),Go(wx,"XgVideoProxy",null),wx.instManager=dx.getInstance();var Tx="loadstart",Ex="loadeddata",Px="firstFrame",Rx="waitingStart",Ox="waitingEnd",Ix="seekStart",Lx="seekEnd",Ax="waitingEndExt",Dx="seekEndEndExt",Mx="[xgLogger]",Nx=function(e){Ho(n,e);var t=xx(n);function n(){var e;Bo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Uo(e=t.call.apply(t,[this].concat(r))),"_onLoadedMetaData",(function(){var t=e._state,n=t.isLs,i=t.autoplayStart,r=t.isFFSend,o=t.isLoadStartDelay;Hw.logInfo(Mx,"LOAD_START Delay","autoplayStart:".concat(i," isFFSend:").concat(r," startCostTime:").concat(e.startCostTime," newPointTime:").concat(e.newPointTime,", vtype:").concat(e.player.vtype)),e.playerConfig.loadStartDelay&&n&&!o&&"MP4_MSE"===e.player.vtype&&(e._state.isLoadStartDelay=!0,e.emitLog(Tx,{}))})),Go(Uo(e),"_onLoadStart",(function(){var t=Uo(e)._state,n=t.autoplayStart,i=t.isFFSend;e.startCostTime=Sx()-e.newPointTime,Hw.logInfo(Mx,"LOAD_START","autoplayStart:".concat(n," isFFSend:").concat(i," startCostTime:").concat(e.startCostTime," newPointTime:").concat(e.newPointTime,", vtype:").concat(e.player.vtype)),i||(t.isLs||e.playerConfig.loadStartDelay&&"MP4_MSE"===e.player.vtype||(t.isLoadStartDelay=!0,e.emitLog(Tx,{})),t.isLs=!0,t.isTimeUpdate=!1,t.isFFLoading=!0,e.pt=Sx(),e.vt=0,e.fvt=0,e._initOnceEvents())})),Go(Uo(e),"_onLoadedData",(function(){e.vt=Sx(),e.fvt=e.vt-e.pt,e.loadedCostTime=e.vt-e.newPointTime,e._updateBuffer();var t=e._state,n=t.isTimeUpdate,i=t.isFFSend,r=t.autoplayStart;Hw.logInfo(Mx,"LOADED_DATA","fvt:".concat(e.fvt," isTimeUpdate:").concat(e._state.isTimeUpdate," loadedCostTime:").concat(e.loadedCostTime)),(n||r)&&e._sendFF("loadedData"),i||e.emitLog(Ex,{})})),Go(Uo(e),"_onTimeupdate",(function(){var t=Uo(e)._state;t.isTimeUpdate=!0,t.time=e.player.currentTime,e._state.autoplayStart&&!t.isFFSend&&e._sendFF("onTimeupdate")})),Go(Uo(e),"_onPlay",(function(){var t=e.player.buffered,n=Uo(e).levelInfo;Hw.logInfo(Mx,"_onPlay playPos:".concat(n.startBuffer)),n.startBuffer<0&&(n.startBuffer=t.length>0?parseInt(1e3*t.end(0),10):0,n.startType="onplay")})),Go(Uo(e),"_onAutoplayStart",(function(){Hw.logInfo(Mx,"_onAutoplayStart"),e._state.autoplayStart=!0,e.vt&&e._sendFF("onAutoplayStart")})),Go(Uo(e),"_onReset",(function(){e._state={time:0,autoplayStart:!1,isFFLoading:!1,isTimeUpdate:!1,isFFSend:!1,isLs:!1,isLoadStartDelay:!1},e.vt=0,e.pt=0,e.fvt=0,e.newPointTime=Sx(),e.loadedCostTime=0,e.startCostTime=0,e.seekingStart=0,e.seekData={startTime:0,lastTime:0,timeBefore:0,timeAfter:0,inBuffer:0,diffStart:0,interval:-1},e.waitData={startTime:0,lastTime:0,interval:-1,diffStart:0},e.waitingStart=0,e.fixedWaitingStart=0,e.ffsendTime=0,e.levelInfo={diff:0,buffer:-1,startBuffer:-1,startType:""},e._isWaiting=!1,e._waitTimer&&Ww.clearTimeout(Uo(e),e._waitTimer),e._waittTimer&&Ww.clearTimeout(Uo(e),e._waittTimer),e._waitTimer=null,e._waittTimer=null,e._waitType=0})),Go(Uo(e),"_onSeeking",(function(){var t=Uo(e),n=t.seekData,i=t._state;if(!n.startTime){var r=e.player,o=r.buffered,a=r.currentTime;n.startTime=Sx(),n.timeBefore=i.time,n.timeAfter=a;var s=Ww.getBufferByCurrentTime(o,a);Hw.logInfo(Mx,"onSeeking",a,s),n.inBuffer=s.include,n.diffStart=1e3*s.diff,n.lastTime>0?n.interval=n.startTime-n.lastTime:n.interval=-1,Hw.logInfo(Mx,"onSeeking",n),e.suspendWaitingStatus("seek");var c=e._getSeekInfo();e.emitLog(Ix,Cx({start:Sx()},c))}})),Go(Uo(e),"_onSeeked",(function(){Hw.logInfo(Mx,"onSeeked"),e.suspendSeekingStatus("seeked")})),Go(Uo(e),"_onWaiting",(function(){if(!e._isWaiting&&e.vt){e._isWaiting=!0;var t=Uo(e),n=t.waitData,i=t.seekData;t._state.isTimeUpdate||0!==i.startTime?i.startTime?e._waitType=2:e._waitType=0:e._waitType=1,e.fixedWaitingStart=Sx(),Hw.logInfo(Mx,"_onWaiting"),n.lastTime>0?n.interval=e.fixedWaitingStart-n.lastTime:n.interval=-1;var r=e.player,o=r.buffered,a=r.currentTime,s=Ww.getBufferByCurrentTime(o,a);n.diffStart=1e3*s.diff,e._waitTimer=Ww.setTimeout(Uo(e),(function(){Hw.logInfo(Mx,"_onWaiting real");var t=Uo(e).waitData;e._isWaiting?(e.waitingStart=Sx(),Ww.clearTimeout(Uo(e),e._waitTimer),t.lastTime=e.fixedWaitingStart,e._waitTimer=null,e._startWaitTimeout(),e.emitLog(Rx,{fixedStart:e.fixedWaitingStart,start:e.waitingStart,type:e._waitType,endType:2===e._waitType?"seek":"playing",diffStart:t.diffStart,interval:t.interval})):(t.interval=-1,t.diffStart=0)}),200)}})),Go(Uo(e),"_onError",(function(){e.suspendSeekingStatus("error"),e.suspendWaitingStatus("error")})),Go(Uo(e),"_onWaitingTimeout",(function(t){e.suspendWaitingStatus(t||"timeout"),Ww.clearTimeout(Uo(e),e._waittTimer),e._waittTimer=null})),Go(Uo(e),"_onProgress",(function(){Hw.logInfo(Mx,"_onProgress")})),Go(Uo(e),"_onPlaying",(function(){Hw.logInfo(Mx,"_onPlaying"),e._isWaiting&&e.suspendWaitingStatus("playing")})),e}return Fo(n,[{key:"afterCreate",value:function(){var e=this;this._onReset(),this._waitType=-1,this._initOnceEvents(),this.newPointTime=Sx(),this.loadedCostTime=0,this.startCostTime=0,this.ffsendTime=0,this.on(s_,this._onLoadedMetaData),this.on(l_,this._onLoadStart),this.on(a_,this._onLoadedData),this.on(Qw,this._onSeeking),this.on(e_,this._onSeeked),this.on(b_,(function(){e.endState("destroy")})),this.on($w,(function(){e.endState("ended")})),this.on(Jw,(function(){e.endState("pause")})),this.on(qw,this._onPlay),this.on(w_,(function(){e.endState("urlChange"),Hw.logInfo(Mx,"URL_CHANGE"),e._state.isFFSend&&e._onReset()})),this.on([Xw,i_],this._onPlaying),this.on(n_,this._onWaiting),this.on(Zw,this._onError),this.on(j_,(function(){Hw.logInfo(Mx,"RESET"),e.endState("reset"),e._initOnceEvents(),e._onReset();var t=e.levelInfo;e.playerConfig.autoplay&&(t.startType="onreset",t.startBuffer=0)}))}},{key:"_initOnceEvents",value:function(){this.off(g_,this._onAutoplayStart),this.off(t_,this._onTimeupdate),this.once(g_,this._onAutoplayStart),this.on(t_,this._onTimeupdate)}},{key:"_sendFF",value:function(e){var t=this._state,n=t.isFFLoading,i=t.isFFSend;if(Hw.logInfo(Mx,"_sendFF","".concat(e," fvt:").concat(this.fvt," isFFLoading:").concat(n," !isFFSend:").concat(!i)),this.vt>0&&n&&!i){var r;this.ffsendTime=Sx();var o=this.levelInfo,a=o.buffer,s=o.startBuffer,c=o.startType;Hw.logInfo(Mx,"emitLog_firstFrame",e,"startBuffer:".concat(s," startType:").concat(c," buffer:").concat(a," ")),this._state.isFFLoading=!1,this._state.isFFSend=!0;var u=this.fvt+((null===(r=this.player)||void 0===r?void 0:r.beforeLoadStartCostTime)||0);this.emitLog(Px,{fvt:this.fvt,costTime:u,vt:this.vt,startCostTime:this.startCostTime,loadedCostTime:this.loadedCostTime,buffer:a,startBuffer:s,endType:e})}}},{key:"_updateBuffer",value:function(){var e=this.player,t=e.buffered,n=e.currentTime,i=Ww.getBufferByCurrentTime(t,n);Hw.logInfo(Mx,"_updateBuffer",i);var r=this.levelInfo;r.buffer=1e3*i.end,r.diff=1e3*i.diff}},{key:"_getSeekInfo",value:function(){var e=this.seekData;return{interval:e.interval,timeBefore:e.timeBefore,timeAfter:e.timeAfter,inBuffer:e.inBuffer,diffStart:e.diffStart}}},{key:"_startWaitTimeout",value:function(){this._waittTimer&&Ww.clearTimeout(this,this._waittTimer),this._waittTimer=Ww.setTimeout(this,this._onWaitingTimeout,this.config.waitTimeout)}},{key:"endState",value:function(e){var t=this.player,n=t.currentTime,i=t.duration,r=i-n,o=!(i>0&&n>0&&r<1);Hw.logInfo(Mx,"endState:".concat(e," duration - currentTime:").concat(r," _emit:").concat(o)),this.suspendWaitingStatus(e,o),this.suspendSeekingStatus(e,o)}},{key:"suspendSeekingStatus",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.seekData;if(n.startTime){var i=Sx(),r=i-n.startTime,o=this.player,a=o.buffered,s=o.currentTime,c=Ww.getBufferByCurrentTime(a,s);Hw.logInfo(Mx,"suspendSeekingStatus",s,r),n.lastTime=n.startTime,n.startTime=0;var u=t?Lx:Dx,l=this._getSeekInfo();this.emitLog(u,Cx(Cx({end:i,costTime:r,endType:e},l),{},{diffEnd:1e3*c.diff}))}}},{key:"suspendWaitingStatus",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this._waitTimer&&(Ww.clearTimeout(this,this._waitTimer),this._waitTimer=null),this._waittTimer&&(Ww.clearTimeout(this,this._waittTimer),this._waittTimer=null),this._isWaiting=!1,this.waitingStart){var n=this.waitData,i=Sx(),r=i-this.waitingStart,o=i-this.fixedWaitingStart,a=this.config.waitTimeout;this._isWaiting=!1,this.waitingStart=0,this.fixedWaitingStart=0;var s=this.player,c=s.buffered,u=s.currentTime,l=Ww.getBufferByCurrentTime(c,u),f=t?Ox:Ax;this.emitLog(f,{fixedCostTime:o>a?a:o,costTime:r>a?a:r,type:"loadeddata"===e?1:this._waitType,endType:2===this._waitType?"seek":e,diffStart:n.diffStart,diffEnd:1e3*l.diff,interval:n.interval})}}},{key:"emitLog",value:function(e,t){var n=this.player,i=n.video,r=i.readyState,o=i.networkState;this.emit(F_,Cx({t:Sx(),host:Ww.getHostFromUrl(n.currentSrc),vtype:n.vtype,eventType:e,currentTime:n.currentTime,readyState:r,networkState:o},t))}}],[{key:"pluginName",get:function(){return"xgLogger"}},{key:"defaultConfig",get:function(){return{waitTimeout:1e4}}}]),n}(HC);function Fx(){return(new DOMParser).parseFromString('<svg class="xgplayer-replay-svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 78 78" width="78" height="78">\n <path fill="#fff" transform="translate(20, 20)" d="M8.22708362,13.8757234 L11.2677371,12.6472196 C11.7798067,12.4403301 12.3626381,12.6877273 12.5695276,13.1997969 L12.9441342,14.1269807 C13.1510237,14.6390502 12.9036264,15.2218816 12.3915569,15.4287712 L6.8284538,17.6764107 L5.90126995,18.0510173 C5.38920044,18.2579068 4.80636901,18.0105096 4.5994795,17.49844 L1.97723335,11.0081531 C1.77034384,10.4960836 2.0177411,9.91325213 2.52981061,9.70636262 L3.45699446,9.33175602 C3.96906396,9.12486652 4.5518954,9.37226378 4.75878491,9.88433329 L5.67885163,12.1615783 C7.99551726,6.6766934 13.3983951,3 19.5,3 C27.7842712,3 34.5,9.71572875 34.5,18 C34.5,26.2842712 27.7842712,33 19.5,33 C15.4573596,33 11.6658607,31.3912946 8.87004692,28.5831991 C8.28554571,27.9961303 8.28762719,27.0463851 8.87469603,26.4618839 C9.46176488,25.8773827 10.4115101,25.8794641 10.9960113,26.466533 C13.2344327,28.7147875 16.263503,30 19.5,30 C26.127417,30 31.5,24.627417 31.5,18 C31.5,11.372583 26.127417,6 19.5,6 C14.4183772,6 9.94214483,9.18783811 8.22708362,13.8757234 Z"></path>\n</svg>\n',"image/svg+xml").firstChild}function Bx(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var jx=function(e){Ho(n,e);var t=Bx(n);function n(){return Bo(this,n),t.apply(this,arguments)}return Fo(n,[{key:"registerIcons",value:function(){return{replay:Fx}}},{key:"afterCreate",value:function(){var e=this;HC.insert(this.icons.replay,this.root,0),this.__handleReplay=this.hook("replayHandler",(function(){e.player.replay()}),{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.bind(".xgplayer-replay",["click","touchend"],this.__handleReplay),this.on($w,(function(){if(e.playerConfig.loop||Ww.addClass(e.player.root,"replay"),!e.config.disable){e.show();var t=e.root.querySelector("path");if(t){var n=window.getComputedStyle(t).getPropertyValue("transform");if("string"==typeof n&&n.indexOf("none")>-1)return null;t.setAttribute("transform",n)}}})),this.on(qw,(function(){e.hide()}))}},{key:"handleReplay",value:function(e){e.preventDefault(),e.stopPropagation(),this.player.replay(),Ww.removeClass(this.player.root,"replay")}},{key:"show",value:function(){this.config.disable||(this.root.style.display="flex")}},{key:"enable",value:function(){this.config.disable=!1}},{key:"disable",value:function(){this.config.disable=!0,this.hide()}},{key:"destroy",value:function(){this.unbind(".xgplayer-replay",["click","touchend"],this.__handleReplay)}},{key:"render",value:function(){return'<xg-replay class="xgplayer-replay">\n <xg-replay-txt class="xgplayer-replay-txt" lang-key="'.concat(this.i18nKeys.REPLAY,'">').concat(this.i18n.REPLAY,"</xg-replay-txt>\n </xg-replay>")}}],[{key:"pluginName",get:function(){return"replay"}},{key:"defaultConfig",get:function(){return{disable:!1}}}]),n}(HC),Hx=jx;function Ux(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var Wx=function(e){Ho(n,e);var t=Ux(n);function n(){return Bo(this,n),t.apply(this,arguments)}return Fo(n,[{key:"isEndedShow",get:function(){return this.config.isEndedShow},set:function(e){this.config.isEndedShow=e}},{key:"hide",value:function(){Ww.addClass(this.root,"hide")}},{key:"show",value:function(){Ww.removeClass(this.root,"hide")}},{key:"beforeCreate",value:function(e){"string"==typeof e.player.config.poster&&(e.config.poster=e.player.config.poster)}},{key:"afterCreate",value:function(){var e=this;this.on($w,(function(){e.isEndedShow&&Ww.removeClass(e.root,"hide")})),this.config.hideCanplay?(this.once(t_,(function(){e.onTimeUpdate()})),this.on(w_,(function(){Ww.removeClass(e.root,"hide"),Ww.addClass(e.root,"xg-showplay"),e.once(t_,(function(){e.onTimeUpdate()}))}))):this.on(qw,(function(){Ww.addClass(e.root,"hide")}))}},{key:"onTimeUpdate",value:function(){var e=this;this.player.currentTime?Ww.removeClass(this.root,"xg-showplay"):this.once(t_,(function(){e.onTimeUpdate()}))}},{key:"update",value:function(e){e&&(this.config.poster=e,this.root.style.backgroundImage="url(".concat(e,")"))}},{key:"render",value:function(){var e=this.config,t=e.poster,n=e.hideCanplay,i=t?"background-image:url(".concat(t,");"):"";return'<xg-poster class="xgplayer-poster '.concat(n?"xg-showplay":"",'" style="').concat(i,'">\n </xg-poster>')}}],[{key:"pluginName",get:function(){return"poster"}},{key:"defaultConfig",get:function(){return{isEndedShow:!0,hideCanplay:!1,poster:""}}}]),n}(HC),Vx=Wx;function Gx(){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 Kx(){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 zx(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var Yx={};var qx=function(e){Ho(n,e);var t=zx(n);function n(e){var i;return Bo(this,n),Go(Uo(i=t.call(this,e)),"onPlayerReset",(function(){i.autoPlayStart=!1;var e="auto"===i.config.mode?"auto-hide":"hide";i.setAttr("data-state","play"),Ww.removeClass(i.root,e),i.show()})),Go(Uo(i),"onAutoplayStart",(function(){if(!i.autoPlayStart){var e="auto"===i.config.mode?"auto-hide":"hide";Ww.addClass(i.root,e),i.autoPlayStart=!0,i.onPlayPause("play")}})),i.autoPlayStart=!1,i._lastState="",i}return Fo(n,[{key:"afterCreate",value:function(){var e=this,t=this.player,n=this.playerConfig;this.initIcons(),this.once(p_,(function(){n&&(n.lang&&"en"===n.lang?Ww.addClass(t.root,"lang-is-en"):"jp"===n.lang&&Ww.addClass(t.root,"lang-is-jp"))})),this.on(g_,this.onAutoplayStart),n.autoplay||this.show(),this.on(y_,(function(){var t="auto"===e.config.mode?"auto-hide":"hide";e.setAttr("data-state","play"),Ww.removeClass(e.root,t),e.show()})),this.on(qw,(function(){e.onPlayPause("play")})),this.on(Jw,(function(){e.onPlayPause("pause")})),this.on(C_,(function(){e.onPlayPause(t.paused?"pause":"play")})),this.on(j_,(function(){e.onPlayerReset()})),this.clickHandler=this.hook("click",this.switchPausePlay,{pre:function(t){t.cancelable&&t.preventDefault(),t.stopPropagation(),e.emitUserAction(t,"switch_play_pause")}}),this.bind(["click","touchend"],this.clickHandler)}},{key:"registerIcons",value:function(){return{startPlay:{icon:Gx,class:"xg-icon-play"},startPause:{icon:Kx,class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild("xg-start-inner",e.startPlay),this.appendChild("xg-start-inner",e.startPause)}},{key:"hide",value:function(){Ww.addClass(this.root,"hide")}},{key:"show",value:function(){Ww.removeClass(this.root,"hide")}},{key:"focusHide",value:function(){Ww.addClass(this.root,"focus-hide")}},{key:"recover",value:function(){Ww.removeClass(this.root,"focus-hide")}},{key:"switchStatus",value:function(e){e?this.setAttr("data-state",this.player.paused?"pause":"play"):this.setAttr("data-state",this.player.paused?"play":"pause")}},{key:"animate",value:function(e){var t=this;!function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{start:null,end:null};Yx[e]&&window.clearTimeout(Yx[e].id),Yx[e]={},n.start&&n.start(),Yx[e].id=window.setTimeout((function(){n.end&&n.end(),window.clearTimeout(Yx[e].id),delete Yx[e]}),t)}("pauseplay",400,{start:function(){Ww.addClass(t.root,"interact"),t.show(),t.switchStatus(!0)},end:function(){Ww.removeClass(t.root,"interact"),!e&&t.hide()}})}},{key:"switchPausePlay",value:function(e){var t=this.player;(e.cancelable&&e.preventDefault(),e.stopPropagation(),t.isReady)&&(!this.player.paused&&t.isPlaying?t.pause():t.play())}},{key:"onPlayPause",value:function(e){var t=this.config,n=this.player;if(n.isPlaying&&this.autoPlayStart&&("pause"!==e||this._lastState!==e&&!n.isBufferControlPaused)){if(this._lastState=e,"show"===t.mode)return this.switchStatus(),void this.show();if("auto"!==t.mode){if(t.isShowPause&&n.paused&&!n.ended||t.isShowEnd&&n.ended)return this.switchStatus(),void this.show();if(t.disableAnimate)return this.switchStatus(),void this.hide();if("play"===e)this.autoPlayStart?this.animate():this.hide();else{if(!this.autoPlayStart||n.ended)return;this.animate()}}else this.switchStatus()}}},{key:"destroy",value:function(){this.unbind(["click","touchend"],this.clickHandler),Object.keys(Yx).map((function(e){window.clearTimeout(Yx[e].id),delete Yx[e]}))}},{key:"render",value:function(){var e=this.playerConfig.autoplay?"auto"===this.config.mode?"auto-hide":"hide":"";return'\n <xg-start class="xgplayer-start '.concat(e,'">\n <xg-start-inner></xg-start-inner>\n </xg-start>')}}],[{key:"pluginName",get:function(){return"start"}},{key:"defaultConfig",get:function(){return{isShowPause:!1,isShowEnd:!1,disableAnimate:!1,mode:"hide"}}}]),n}(HC),Xx=qx;function $x(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var Jx=function(e){Ho(n,e);var t=$x(n);function n(){return Bo(this,n),t.apply(this,arguments)}return Fo(n,[{key:"render",value:function(){var e=this.config.innerHtml,t=Ww.createDom("xg-enter","",{},"xgplayer-enter");if(e&&e instanceof window.HTMLElement)t.appendChild(e);else if(e&&"string"==typeof e)t.innerHTML=e;else{for(var n="",i=1;i<=12;i++)n+='<div class="xgplayer-enter-bar'.concat(i,'"></div>');t.innerHTML='<div class="xgplayer-enter-spinner">'.concat(n,"</div>")}return t}}],[{key:"pluginName",get:function(){return"enter"}},{key:"defaultConfig",get:function(){return{innerHtml:"",logo:""}}}]),n}(HC),Zx=Jx;function Qx(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var eS=function(e){Ho(n,e);var t=Qx(n);function n(){return Bo(this,n),t.apply(this,arguments)}return Fo(n,[{key:"afterCreate",value:function(){this.getMini=this.getMini.bind(this),this.exitMini=this.exitMini.bind(this),this.bind("click",this.getMini)}},{key:"getMini",value:function(){this.config.onClick&&this.config.onClick()}},{key:"exitMini",value:function(){this.config.onClick&&this.config.onClick()}},{key:"destroy",value:function(){this.unbind(["click","touchend"],this.getMini)}},{key:"render",value:function(){var e="MINISCREEN";return'\n <xg-icon class="xgplayer-miniicon">\n <div class="xgplayer-icon btn-text"><span class="icon-text" lang-key="'.concat(this.i18nKeys[e],'">').concat(this.i18n[e],"</span></div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"miniscreenIcon"}},{key:"defaultConfig",get:function(){return{position:MC.CONTROLS_RIGHT,index:10}}}]),n}(HC),tS=eS;function nS(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}function iS(e){var t=parseFloat(e);return-1===e.indexOf("%")&&!Number.isNaN(t)&&t}var rS=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],oS=rS.length;function aS(e){if("string"==typeof e&&(e=document.querySelector(e)),e&&"object"===Do(e)&&e.nodeType){var t=function(e){return window.getComputedStyle(e)}(e);if("none"===t.display)return function(){for(var e={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},t=0;t<oS;t++)e[rS[t]]=0;return e}();var n={};n.width=e.offsetWidth,n.height=e.offsetHeight;for(var i=n.isBorderBox="border-box"===t.boxSizing,r=0;r<oS;r++){var o=rS[r],a=t[o],s=parseFloat(a);n[o]=Number.isNaN(s)?0:s}var c=n.paddingLeft+n.paddingRight,u=n.paddingTop+n.paddingBottom,l=n.marginLeft+n.marginRight,f=n.marginTop+n.marginBottom,h=n.borderLeftWidth+n.borderRightWidth,d=n.borderTopWidth+n.borderBottomWidth,p=i,v=iS(t.width);!1!==v&&(n.width=v+(p?0:c+h));var g=iS(t.height);return!1!==g&&(n.height=g+(p?0:u+d)),n.innerWidth=n.width-(c+h),n.innerHeight=n.height-(u+d),n.outerWidth=n.width+l,n.outerHeight=n.height+f,n}}function sS(e,t){for(var n=0;n<e.length;n++){var i=e[n];if(i.identifier===t)return i}}var cS="dragStart",uS="dragMove",lS="dragEnded",fS={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]},hS=function(e){Ho(n,e);var t=nS(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Bo(this,n),(i=t.call(this)).isEnabled=!0,i.isDragging=!1,i.isDown=!1,i.position={},i.downPoint={},i.dragPoint={x:0,y:0},i.startPos={x:0,y:0},i._root=e instanceof Element?e:document.querySelector(e),i._handlerDom=r.handle instanceof Element?r.handle:document.querySelector(r.handle),i._root&&i._handlerDom?(i._bindStartEvent(),i):Wo(i)}return Fo(n,[{key:"_bindStartEvent",value:function(){var e=this;"ontouchstart"in window?this._startKey="touchstart":this._startKey="mousedown",this["on".concat(this._startKey)]=this["on".concat(this._startKey)].bind(this),this._handlerDom.addEventListener(this._startKey,this["on".concat(this._startKey)]),fS[this._startKey].map((function(t){e["on".concat(t)]=e["on".concat(t)].bind(e)}))}},{key:"_unbindStartEvent",value:function(){this._handlerDom.removeEventListener(this._startKey,this["on".concat(this._startKey)])}},{key:"_bindPostStartEvents",value:function(e){var t=this;if(e){var n=fS[this._startKey];n.map((function(e){window.addEventListener(e,t["on".concat(e)])})),this._boundPointerEvents=n}}},{key:"_unbindPostStartEvents",value:function(){var e=this;this._boundPointerEvents&&(this._boundPointerEvents.map((function(t){window.removeEventListener(t,e["on".concat(t)])})),delete this._boundPointerEvents)}},{key:"enable",value:function(){this.isEnabled=!0}},{key:"disable",value:function(){this.isEnabled=!1,this.isDragging&&this.onUp()}},{key:"onDocUp",value:function(e){this.onUp()}},{key:"animate",value:function(){var e=this;this.isDragging&&(this.positionDrag(),window.requestAnimationFrame((function(){e.animate()})))}},{key:"positionDrag",value:function(){var e="translate3d(".concat(this.dragPoint.x,"px, ").concat(this.dragPoint.y,"px, 0)");this._root.style.transform=e,this._root.style.webKitTransform=e}},{key:"setLeftTop",value:function(){this._root.style.left=this.position.x+"px",this._root.style.top=this.position.y+"px"}},{key:"onmousedown",value:function(e){this.dragStart(e,e)}},{key:"onmousemove",value:function(e){this.dragMove(e,e)}},{key:"onmouseup",value:function(e){this.dragEnd(e,e)}},{key:"ontouchstart",value:function(e){var t=e.changedTouches[0];this.dragStart(e,t),this.touchIdentifier=void 0!==t.pointerId?t.pointerId:t.identifier,e.preventDefault()}},{key:"ontouchmove",value:function(e){var t=sS(e.changedTouches,this.touchIdentifier);t&&this.dragMove(e,t)}},{key:"ontouchend",value:function(e){var t=sS(e.changedTouches,this.touchIdentifier);t&&this.dragEnd(e,t),e.preventDefault()}},{key:"ontouchcancel",value:function(e){var t=sS(e.changedTouches,this.touchIdentifier);t&&this.dragCancel(e,t)}},{key:"dragStart",value:function(e,t){if(this._root&&!this.isDown&&this.isEnabled){this.downPoint=t,this.dragPoint.x=0,this.dragPoint.y=0,this._getPosition();var n=aS(this._root);this.startPos.x=this.position.x,this.startPos.y=this.position.y,this.startPos.maxY=window.innerHeight-n.height,this.startPos.maxX=window.innerWidth-n.width,this.setLeftTop(),this.isDown=!0,this._bindPostStartEvents(e)}}},{key:"dragRealStart",value:function(e,t){this.isDragging=!0,this.animate(),this.emit(cS,this.startPos)}},{key:"dragEnd",value:function(e,t){this._root&&(this._unbindPostStartEvents(),this.isDragging&&(this._root.style.transform="",this.setLeftTop(),this.emit(lS)),this.presetInfo())}},{key:"_dragPointerMove",value:function(e,t){var n={x:t.pageX-this.downPoint.pageX,y:t.pageY-this.downPoint.pageY};return!this.isDragging&&this.hasDragStarted(n)&&this.dragRealStart(e,t),n}},{key:"dragMove",value:function(e,t){if(e=e||window.event,this.isDown){var n=this.startPos,i=n.x,r=n.y,o=this._dragPointerMove(e,t),a=o.x,s=o.y;a=this.checkContain("x",a,i),s=this.checkContain("y",s,r),this.position.x=i+a,this.position.y=r+s,this.dragPoint.x=a,this.dragPoint.y=s,this.emit(uS,this.position)}}},{key:"dragCancel",value:function(e,t){this.dragEnd(e,t)}},{key:"presetInfo",value:function(){this.isDragging=!1,this.startPos={x:0,y:0},this.dragPoint={x:0,y:0},this.isDown=!1}},{key:"destroy",value:function(){this._unbindStartEvent(),this._unbindPostStartEvents(),this.isDragging&&this.dragEnd(),this.removeAllListeners(),this._handlerDom=null}},{key:"hasDragStarted",value:function(e){return Math.abs(e.x)>3||Math.abs(e.y)>3}},{key:"checkContain",value:function(e,t,n){return t+n<0?0-n:"x"===e&&t+n>this.startPos.maxX?this.startPos.maxX-n:"y"===e&&t+n>this.startPos.maxY?this.startPos.maxY-n:t}},{key:"_getPosition",value:function(){var e=window.getComputedStyle(this._root),t=this._getPositionCoord(e.left,"width"),n=this._getPositionCoord(e.top,"height");this.position.x=Number.isNaN(t)?0:t,this.position.y=Number.isNaN(n)?0:n,this._addTransformPosition(e)}},{key:"_addTransformPosition",value:function(e){var t=e.transform;if(0===t.indexOf("matrix")){var n=t.split(","),i=0===t.indexOf("matrix3d")?12:4,r=parseInt(n[i],10),o=parseInt(n[i+1],10);this.position.x+=r,this.position.y+=o}}},{key:"_getPositionCoord",value:function(e,t){if(-1!==e.indexOf("%")){var n=aS(this._root.parentNode);return n?parseFloat(e)/100*n[t]:0}return parseInt(e,10)}}]),n}(Sy);function dS(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var pS=function(e){Ho(n,e);var t=dS(n);function n(e){var i;Bo(this,n),Go(Uo(i=t.call(this,e)),"onCancelClick",(function(e){i.exitMini(),i.isClose=!0})),Go(Uo(i),"onCenterClick",(function(e){var t=Uo(i).player;t.paused?t.play():t.pause()})),Go(Uo(i),"onScroll",(function(e){if(!(!window.scrollY&&0!==window.scrollY||Math.abs(window.scrollY-i.pos.scrollY)<50)){var t=parseInt(Ww.getCss(i.player.root,"height"));t+=i.config.scrollTop,i.pos.scrollY=window.scrollY,window.scrollY>t+5?!i.isMini&&!i.isClose&&i.getMini():window.scrollY<=t&&(i.isMini&&i.exitMini(),i.isClose=!1)}})),i.isMini=!1,i.isClose=!1;var r=Uo(i).config;return i.pos={left:r.left<0?window.innerWidth-r.width-20:r.left,top:r.top<0?window.innerHeight-r.height-20:r.top,height:i.config.height,width:i.config.width,scrollY:window.scrollY||0},i.lastStyle=null,i}return Fo(n,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.mini&&(e.config.isShowIcon=e.player.config.mini)}},{key:"afterCreate",value:function(){var e=this;this.initIcons(),this.on(Jw,(function(){e.setAttr("data-state","pause")})),this.on(qw,(function(){e.setAttr("data-state","play")}))}},{key:"onPluginsReady",value:function(){var e=this,t=this.player;if(!this.config.disable){if(this.config.isShowIcon){var n={config:{onClick:function(){e.getMini()}}};t.controls.registerPlugin(tS,n,tS.pluginName)}var i=Ww.checkTouchSupport()?"touchend":"click";this.bind(".mini-cancel-btn",i,this.onCancelClick),this.bind(".play-icon",i,this.onCenterClick),this.config.disableDrag||(this._draggabilly=new hS(this.player.root,{handle:this.root})),this.config.isScrollSwitch&&window.addEventListener("scroll",this.onScroll)}}},{key:"registerIcons",value:function(){return{play:{icon:Gx,class:"xg-icon-play"},pause:{icon:Kx,class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".play-icon",e.play),this.appendChild(".play-icon",e.pause)}},{key:"getMini",value:function(){var e=this;if(!this.isMini){var t=this.player,n=this.playerConfig,i=this.config.target||this.player.root;this.lastStyle={},Ww.addClass(t.root,"xgplayer-mini"),["width","height","top","left"].map((function(t){e.lastStyle[t]=i.style[t],i.style[t]="".concat(e.pos[t],"px")})),n.fluid&&(i.style["padding-top"]=""),this.emit(P_,!0),t.isMini=this.isMini=!0}}},{key:"exitMini",value:function(){var e=this;if(!this.isMini)return!1;var t=this.player,n=this.playerConfig,i=this.config.target||this.player.root;Ww.removeClass(t.root,"xgplayer-mini"),this.lastStyle&&Object.keys(this.lastStyle).map((function(t){i.style[t]=e.lastStyle[t]})),this.lastStyle=null,n.fluid&&(t.root.style.width="100%",t.root.style.height="0",t.root.style["padding-top"]="".concat(100*n.height/n.width,"%")),this.emit(P_,!1),this.isMini=t.isMini=!1}},{key:"destroy",value:function(){window.removeEventListener("scroll",this.onScroll);var e=Ww.checkTouchSupport()?"touchend":"click";this.unbind(".mini-cancel-btn",e,this.onCancelClick),this.unbind(".play-icon",e,this.onCenterClick),this._draggabilly&&this._draggabilly.destroy(),this._draggabilly=null,this.exitMini()}},{key:"render",value:function(){if(!this.config.disable)return'\n <xg-mini-layer class="xg-mini-layer">\n <xg-mini-header class="xgplayer-mini-header">\n <div lang-key="'.concat(this.i18nKeys.MINI_DRAG,'">').concat(this.i18n.MINI_DRAG,'</div>\n </xg-mini-header>\n <div class="mini-cancel-btn">\n <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">\n <path fill="#fff" fill-rule="evenodd" d="M3.99 3.49a1 1 0 0 1 1.414 0L10 8.085l4.596-4.595a1 1 0 1 1 1.414 1.414L11.414 9.5l4.596 4.596a1 1 0 0 1 .084 1.32l-.084.094a1 1 0 0 1-1.414 0L10 10.914 5.404 15.51a1 1 0 0 1-1.414-1.414L8.585 9.5 3.99 4.904a1 1 0 0 1-.084-1.32z"></path>\n </svg>\n </div>\n <div class="play-icon">\n </div>\n </xg-mini-layer>')}}],[{key:"pluginName",get:function(){return"miniscreen"}},{key:"defaultConfig",get:function(){return{index:10,disable:!1,width:320,height:180,left:-1,top:-1,isShowIcon:!1,isScrollSwitch:!1,scrollTop:0,disableDrag:!1}}}]),n}(HC);function vS(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var gS={mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousemove:"onMouseMove"},yS=["videoClick","videoDbClick"],mS=function(e){Ho(n,e);var t=vS(n);function n(){var e;Bo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Uo(e=t.call.apply(t,[this].concat(r))),"onMouseMove",(function(t){var n=Uo(e),i=n.player,r=n.playerConfig;i.isActive||(i.focus({autoHide:!r.closeDelayBlur}),!r.closeFocusVideoFocus&&i.video.focus())})),Go(Uo(e),"onMouseEnter",(function(t){var n=Uo(e),i=n.playerConfig,r=n.player;!i.closeFocusVideoFocus&&r.video.focus(),i.closeDelayBlur?r.focus({autoHide:!1}):r.focus()})),Go(Uo(e),"onMouseLeave",(function(t){var n=e.playerConfig,i=n.closePlayerBlur,r=n.leavePlayerTime,o=n.closeDelayBlur;i||o||(r?e.player.focus({autoHide:!0,delay:r}):e.player.blur())})),Go(Uo(e),"onVideoClick",(function(t){var n=Uo(e),i=n.player,r=n.playerConfig;t.target&&r.closeVideoClick||t.target!==i.video&&t.target!==i.innerContainer&&t.target!==i.video.__canvas||(t.preventDefault(),r.closeVideoStopPropagation||t.stopPropagation(),e._clickCount++,e.clickTimer&&(clearTimeout(e.clickTimer),e.clickTimer=null),e.clickTimer=setTimeout((function(){e._clickCount&&(e._clickCount--,CC(Uo(e),yS[0],(function(t,n){e.switchPlayPause(n.e)}),{e:t,paused:i.paused}),clearTimeout(e.clickTimer),e.clickTimer=null)}),300))})),Go(Uo(e),"onVideoDblClick",(function(t){var n=Uo(e),i=n.player;n.playerConfig.closeVideoDblclick||!t.target||t.target!==i.video&&t.target!==i.video.__canvas||(e._clickCount<2?e._clickCount=0:(e._clickCount=0,e.clickTimer&&(clearTimeout(e.clickTimer),e.clickTimer=null),t.preventDefault(),t.stopPropagation(),CC(Uo(e),yS[1],(function(t,n){e.emitUserAction(n.e,"switch_fullscreen",{fullscreen:i.fullscreen}),i.fullscreen?i.exitFullscreen():i.getFullscreen()}),{e:t,fullscreen:i.fullscreen})))})),e}return Fo(n,[{key:"afterCreate",value:function(){var e=this;this._clickCount=0,yS.map((function(t){e.__hooks[t]=null})),"mobile"===this.playerConfig.isMobileSimulateMode||"mobile"===$_.device&&!$_.os.isIpad||this.initEvents()}},{key:"initEvents",value:function(){var e=this,t=this.player,n=t.video,i=t.root,r=this.playerConfig.enableContextmenu;n&&n.addEventListener("click",this.onVideoClick,!1),n&&n.addEventListener("dblclick",this.onVideoDblClick,!1),Object.keys(gS).map((function(t){i.addEventListener(t,e[gS[t]],!1)})),r&&n&&n.addEventListener("contextmenu",this.onContextmenu,!1)}},{key:"switchPlayPause",value:function(e){var t=this.player;this.emitUserAction(e,"switch_play_pause"),t.ended?t.duration!==1/0&&t.duration>0&&t.replay():t.paused?t.play():t.pause()}},{key:"onContextmenu",value:function(e){(e=e||window.event).preventDefault&&e.preventDefault(),e.stopPropagation?e.stopPropagation():(e.returnValue=!1,e.cancelBubble=!0)}},{key:"destroy",value:function(){var e=this,t=this.player,n=t.video,i=t.root;this.clickTimer&&clearTimeout(this.clickTimer),n.removeEventListener("click",this.onVideoClick,!1),n.removeEventListener("dblclick",this.onVideoDblClick,!1),n.removeEventListener("contextmenu",this.onContextmenu,!1),Object.keys(gS).map((function(t){i.removeEventListener(t,e[gS[t]],!1)}))}}],[{key:"pluginName",get:function(){return"pc"}},{key:"defaultConfig",get:function(){return{}}}]),n}(EC),kS=di,bS=Yo,wS=C,_S=RangeError,CS=function(e){var t=bS(wS(this)),n="",i=kS(e);if(i<0||i==1/0)throw _S("Wrong number of repetitions");for(;i>0;(i>>>=1)&&(t+=t))1&i&&(n+=t);return n},xS=fr,SS=k,TS=di,ES=nv,PS=CS,RS=d,OS=RangeError,IS=String,LS=Math.floor,AS=SS(PS),DS=SS("".slice),MS=SS(1..toFixed),NS=function(e,t,n){return 0===t?n:t%2==1?NS(e,t-1,n*e):NS(e*e,t/2,n)},FS=function(e,t,n){for(var i=-1,r=n;++i<6;)r+=t*e[i],e[i]=r%1e7,r=LS(r/1e7)},BS=function(e,t){for(var n=6,i=0;--n>=0;)i+=e[n],e[n]=LS(i/t),i=i%t*1e7},jS=function(e){for(var t=6,n="";--t>=0;)if(""!==n||0===t||0!==e[t]){var i=IS(e[t]);n=""===n?i:n+AS("0",7-i.length)+i}return n};xS({target:"Number",proto:!0,forced:RS((function(){return"0.000"!==MS(8e-5,3)||"1"!==MS(.9,0)||"1.25"!==MS(1.255,2)||"1000000000000000128"!==MS(0xde0b6b3a7640080,0)}))||!RS((function(){MS({})}))},{toFixed:function(e){var t,n,i,r,o=ES(this),a=TS(e),s=[0,0,0,0,0,0],c="",u="0";if(a<0||a>20)throw OS("Incorrect fraction digits");if(o!=o)return"NaN";if(o<=-1e21||o>=1e21)return IS(o);if(o<0&&(c="-",o=-o),o>1e-21)if(n=(t=function(e){for(var t=0,n=e;n>=4096;)t+=12,n/=4096;for(;n>=2;)t+=1,n/=2;return t}(o*NS(2,69,1))-69)<0?o*NS(2,-t,1):o/NS(2,t,1),n*=4503599627370496,(t=52-t)>0){for(FS(s,0,n),i=a;i>=7;)FS(s,1e7,0),i-=7;for(FS(s,NS(10,i,1),0),i=t-1;i>=23;)BS(s,1<<23),i-=23;BS(s,1<<i),FS(s,1,1),BS(s,2),u=jS(s)}else FS(s,0,n),FS(s,1<<-t,0),u=jS(s)+AS("0",a);return u=a>0?c+((r=u.length)<=a?"0."+AS("0",a-r)+u:DS(u,0,r-a)+"."+DS(u,r-a)):c+u}});var HS="press",US="pressend",WS="doubleclick",VS="click",GS="touchmove",KS="touchstart",zS="touchend",YS={start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},qS={start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseleave"};function XS(e){return e&&e.length>0?e[e.length-1]:null}function $S(e){var t=navigator.userAgent;/(?:iPhone|iPad)/.test(t)&&e.cancelable&&e.preventDefault()}var JS=function(){function e(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{eventType:"touch"};Bo(this,e),Go(this,"onTouchStart",(function(e){var t=n._pos,i=n.root;n.config.needPreventDefault&&$S(e);var r=XS(e.touches);t.x=r?parseInt(r.pageX,10):e.pageX,t.y=r?parseInt(r.pageX,10):e.pageX,t.start=!0,n.__setPress(e),i.addEventListener(n.events.end,n.onTouchEnd),i.addEventListener(n.events.cancel,n.onTouchCancel),i.addEventListener(n.events.move,n.onTouchMove),n.trigger(KS,e)})),Go(this,"onTouchCancel",(function(e){n.onTouchEnd(e)})),Go(this,"onTouchEnd",(function(e){var t=n._pos,i=n.root;n.config.needPreventDefault&&$S(e),n.__clearPress(),i.removeEventListener(n.events.cancel,n.onTouchCancel),i.removeEventListener(n.events.end,n.onTouchEnd),i.removeEventListener(n.events.move,n.onTouchMove),e.moving=t.moving,e.press=t.press,t.press&&n.trigger(US,e),n.trigger(zS,e),!t.press&&!t.moving&&n.__setDb(e),t.press=!1,t.start=!1,t.moving=!1})),Go(this,"onTouchMove",(function(e){var t=n._pos,i=n.config,r=XS(e.touches),o=r?parseInt(r.pageX,10):e.pageX,a=r?parseInt(r.pageY,10):e.pageX,s=o-t.x,c=a-t.y;Math.abs(c)<i.miniStep&&Math.abs(s)<i.miniStep||(n.__clearPress(),t.press&&n.trigger(US,e),t.press=!1,t.moving=!0,n.trigger(GS,e))})),this._pos={moving:!1,start:!1,x:0,y:0},this.config={pressDelay:600,dbClickDelay:200,disablePress:!1,disableDbClick:!1,miniStep:2,needPreventDefault:!0},Object.keys(i).map((function(e){n.config[e]=i[e]})),this.root=t,this.events="mouse"===i.eventType?qS:YS,this.pressIntrvalId=null,this.dbIntrvalId=null,this.__handlers={},this._initEvent()}return Fo(e,[{key:"_initEvent",value:function(){this.root.addEventListener(this.events.start,this.onTouchStart)}},{key:"__setPress",value:function(e){var t=this,n=this.config;this.pressIntrvalId&&this.__clearPress(),this.pressIntrvalId=setTimeout((function(){t.trigger(HS,e),t._pos.press=!0,t.__clearPress()}),n.pressDelay)}},{key:"__clearPress",value:function(){window.clearTimeout(this.pressIntrvalId),this.pressIntrvalId=null}},{key:"__setDb",value:function(e){var t=this,n=this.config;if(this.dbIntrvalId)return this.__clearDb(),void this.trigger(WS,e);this.dbIntrvalId=setTimeout((function(){t.__clearDb(),t._pos.start||t._pos.press||t._pos.moving||t.trigger(VS,e)}),n.dbClickDelay)}},{key:"__clearDb",value:function(){clearTimeout(this.dbIntrvalId),this.dbIntrvalId=null}},{key:"on",value:function(e,t){this.__handlers[e]||(this.__handlers[e]=[]),this.__handlers[e].push(t)}},{key:"off",value:function(e,t){if(this.__handlers[e]){for(var n=this.__handlers[e],i=-1,r=0;r<n.length;r++)if(n[r]===t){i=r;break}i>=0&&this.__handlers[e].splice(i,1)}}},{key:"trigger",value:function(e,t){this.__handlers[e]&&this.__handlers[e].map((function(n){try{n(t)}catch(t){console.error("trigger>>:".concat(e),t)}}))}},{key:"destroy",value:function(){var e=this,t={touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"};Object.keys(t).forEach((function(n){e.root.removeEventListener(n,e[t[n]])}))}}]),e}(),ZS=JS;function QS(){return(new DOMParser).parseFromString('<svg width="20" height="9" viewBox="0 0 8 9" fill="none" xmlns="http://www.w3.org/2000/svg"\n xmlns:xlink="http://www.w3.org/1999/xlink">\n <path opacity="0.54"\n d="M7.5 3.63397C8.16667 4.01887 8.16667 4.98113 7.5 5.36603L1.5 8.83013C0.833334 9.21503 0 8.7339 0 7.9641L0 1.0359C0 0.266098 0.833333 -0.215027 1.5 0.169873L7.5 3.63397Z"\n fill="white" />\n <path transform="translate(5 0)" d="M7.5 3.63397C8.16667 4.01887 8.16667 4.98113 7.5 5.36603L1.5 8.83013C0.833334 9.21503 0 8.7339 0 7.9641L0 1.0359C0 0.266098 0.833333 -0.215027 1.5 0.169873L7.5 3.63397Z" fill="white"/>\n</svg>',"image/svg+xml").firstChild}function eT(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var tT="auto",nT="seeking",iT="playbackrate",rT=["videoClick","videoDbClick"],oT=function(e){Ho(n,e);var t=eT(n);function n(e){var i;return Bo(this,n),Go(Uo(i=t.call(this,e)),"onTouchStart",(function(e){var t=Uo(i),n=t.player,r=t.config,o=t.pos,a=t.playerConfig,s=i.getTouche(e);if(s&&!r.disableGesture&&i.duration>0&&!n.ended){o.isStart=!0,Ww.checkIsFunction(a.disableSwipeHandler)&&a.disableSwipeHandler(),i.find(".xg-dur").innerHTML=Ww.format(i.duration);var c=i.root.getBoundingClientRect();90===n.rotateDeg?(o.top=c.left,o.left=c.top,o.width=c.height,o.height=c.width):(o.top=c.top,o.left=c.left,o.width=c.width,o.height=c.height);var u=parseInt(s.pageX-o.left,10),l=parseInt(s.pageY-o.top,10);o.x=90===n.rotateDeg?l:u,o.y=90===n.rotateDeg?u:l,o.scopeL=r.scopeL*o.width,o.scopeR=(1-r.scopeR)*o.width,o.scopeM1=o.width*(1-r.scopeM)/2,o.scopeM2=o.width-o.scopeM1}})),Go(Uo(i),"onTouchMove",(function(e){var t=i.getTouche(e),n=Uo(i),r=n.pos,o=n.config,a=n.player;if(t&&!o.disableGesture&&i.duration&&r.isStart){var s=o.miniMoveStep,c=o.hideControlsActive,u=parseInt(t.pageX-r.left,10),l=parseInt(t.pageY-r.top,10),f=90===a.rotateDeg?l:u,h=90===a.rotateDeg?u:l;if(Math.abs(f-r.x)>s||Math.abs(h-r.y)>s){var d=f-r.x,p=h-r.y,v=r.scope;if(-1===v&&(0===(v=i.checkScope(f,h,d,p,r))&&(c?a.blur():a.focus({autoHide:!1}),!r.time&&(r.time=parseInt(1e3*a.currentTime,10)+1e3*i.timeOffset)),r.scope=v),-1===v||v>0&&!o.gestureY||0===v&&!o.gestureX)return;e.cancelable&&e.preventDefault(),i.executeMove(d,p,v,r.width,r.height),r.x=f,r.y=h}}})),Go(Uo(i),"onTouchEnd",(function(e){var t=Uo(i),n=t.player,r=t.pos,o=t.playerConfig;r.isStart&&(r.scope>-1&&e.cancelable&&e.preventDefault(),i.endLastMove(r.scope),setTimeout((function(){n.getPlugin("progress")&&n.getPlugin("progress").resetSeekState()}),10),r.scope=-1,i.resetPos(),Ww.checkIsFunction(o.enableSwipeHandler)&&o.enableSwipeHandler(),i.changeAction(tT))})),Go(Uo(i),"onRootTouchMove",(function(e){!i.config.disableGesture&&i.config.gestureX&&i.checkIsRootTarget(e)&&(e.stopPropagation(),i.pos.isStart?i.onTouchMove(e):i.onTouchStart(e))})),Go(Uo(i),"onRootTouchEnd",(function(e){if(i.pos.isStart&&i.checkIsRootTarget(e)){e.stopPropagation(),i.onTouchEnd(e);var t=i.player.controls;t&&t.recoverAutoHide()}})),i.pos={isStart:!1,x:0,y:0,time:0,volume:0,rate:1,light:0,width:0,height:0,scopeL:0,scopeR:0,scopeM1:0,scopeM2:0,scope:-1},i.timer=null,i}return Fo(n,[{key:"duration",get:function(){return this.playerConfig.customDuration||this.player.duration}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"registerIcons",value:function(){return{seekTipIcon:{icon:QS,class:"xg-seek-pre"}}}},{key:"afterCreate",value:function(){var e=this;rT.map((function(t){e.__hooks[t]=null}));var t=this.playerConfig,n=this.config,i=this.player;!0===t.closeVideoDblclick&&(n.closedbClick=!0),this.resetPos(),Ww.isUndefined(t.disableGesture)||(n.disableGesture=!!t.disableGesture),this.appendChild(".xg-seek-icon",this.icons.seekTipIcon),this.xgMask=Ww.createDom("xg-mask","",{},"xgmask"),i.root.appendChild(this.xgMask),this.initCustomStyle(),this.registerThumbnail();var r="mouse"===this.domEventType?"mouse":"touch";this.touch=new ZS(this.root,{eventType:r,needPreventDefault:!this.config.disableGesture}),this.root.addEventListener("contextmenu",(function(e){e.preventDefault()})),i.root.addEventListener("touchmove",this.onRootTouchMove,!0),i.root.addEventListener("touchend",this.onRootTouchEnd,!0),this.on(r_,(function(){var t=e.player,n=e.config;1e3*t.duration<n.moveDuration&&(n.moveDuration=1e3*t.duration)})),this.on([i_,$w],(function(){var t=e.pos,n=t.time;!t.isStart&&n>0&&(e.pos.time=0)}));var o={touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",press:"onPress",pressend:"onPressEnd",click:"onClick",doubleclick:"onDbClick"};if(Object.keys(o).forEach((function(t){e.touch.on(t,(function(n){e[o[t]](n)}))})),!n.disableActive){var a=i.plugins.progress;a&&(a.addCallBack("dragmove",(function(t){e.activeSeekNote(t.currentTime,t.forward)})),a.addCallBack("dragend",(function(){e.changeAction(tT)})),a.addCallBack("click",(function(){e.changeAction(tT)})))}}},{key:"registerThumbnail",value:function(){var e=this.player.plugins.thumbnail;if(e&&e.usable){this.thumbnail=e.createThumbnail(null,"mobile-thumbnail");var t=this.find(".time-preview");t.insertBefore(this.thumbnail,t.children[0])}}},{key:"initCustomStyle",value:function(){var e=(this.playerConfig||{}).commonStyle,t=e.playedColor,n=e.progressColor;t&&(this.find(".xg-curbar").style.backgroundColor=t,this.find(".xg-cur").style.color=t),n&&(this.find(".xg-bar").style.backgroundColor=n,this.find(".time-preview").style.color=n),this.config.disableTimeProgress&&Ww.addClass(this.find(".xg-timebar"),"hide")}},{key:"resetPos",value:function(){var e=this;this.pos?(this.pos.isStart=!1,this.pos.scope=-1,["x","y","width","height","scopeL","scopeR","scopeM1","scopeM2"].map((function(t){e.pos[t]=0}))):this.pos={isStart:!1,x:0,y:0,volume:0,rate:1,light:0,width:0,height:0,scopeL:0,scopeR:0,scopeM1:0,scopeM2:0,scope:-1,time:0}}},{key:"changeAction",value:function(e){var t=this.player;this.root.setAttribute("data-xg-action",e);var n=t.plugins.start;n&&n.recover()}},{key:"getTouche",value:function(e){this.player.rotateDeg;var t=e.touches&&e.touches.length>0?e.touches[e.touches.length-1]:e;return{pageX:t.pageX,pageY:t.pageY}}},{key:"checkScope",value:function(e,t,n,i,r){var o=r.width,a=-1;if(e<0||e>o)return a;var s=0===i?Math.abs(n):Math.abs(n/i);return Math.abs(n)>0&&s>=1.73&&e>r.scopeM1&&e<r.scopeM2?a=0:(0===Math.abs(n)||s<=.57)&&(a=e<r.scopeL?1:e>r.scopeR?2:3),a}},{key:"executeMove",value:function(e,t,n,i,r){switch(n){case 0:this.updateTime(e/i*this.config.scopeM);break;case 1:this.updateBrightness(t/r);break;case 2:$_.os.isIos||this.updateVolume(t/r)}}},{key:"endLastMove",value:function(e){var t=this,n=this.pos,i=this.player,r=this.config,o=(n.time-this.timeOffset)/1e3;if(0===e)i.seek(Number(o).toFixed(1)),r.hideControlsEnd?i.blur():i.focus(),this.timer=setTimeout((function(){t.pos.time=0}),500);this.changeAction(tT)}},{key:"checkIsRootTarget",value:function(e){var t=this.player.plugins||{};return(!t.progress||!t.progress.root.contains(e.target))&&(t.start&&t.start.root.contains(e.target)||t.controls&&t.controls.root.contains(e.target))}},{key:"clickHandler",value:function(e){var t=this.player,n=this.config,i=this.playerConfig;t.isPlaying?!n.closedbClick||i.closeVideoClick?t.isActive?t.blur():t.focus():i.closeVideoClick||((t.isActive||n.focusVideoClick)&&(this.emitUserAction("click","switch_play_pause"),this.switchPlayPause()),t.focus()):i.closeVideoClick||(this.emitUserAction("click","switch_play_pause"),t.play())}},{key:"dbClickHandler",value:function(e){var t=this.config,n=this.player;!t.closedbClick&&n.isPlaying&&(this.emitUserAction("dblclick","switch_play_pause"),this.switchPlayPause())}},{key:"onClick",value:function(e){var t=this,n=this.player;CC(this,rT[0],(function(e,n){t.clickHandler(n.e)}),{e:e,paused:n.paused})}},{key:"onDbClick",value:function(e){var t=this,n=this.player;CC(this,rT[1],(function(e,n){t.dbClickHandler(n.e)}),{e:e,paused:n.paused})}},{key:"onPress",value:function(e){var t=this.pos,n=this.config,i=this.player;n.disablePress||(t.rate=this.player.playbackRate,this.emitUserAction("press","change_rate",{from:i.playbackRate,to:n.pressRate}),i.playbackRate=n.pressRate,this.changeAction(iT))}},{key:"onPressEnd",value:function(e){var t=this.pos,n=this.config,i=this.player;n.disablePress||(this.emitUserAction("pressend","change_rate",{from:i.playbackRate,to:t.rate}),i.playbackRate=t.rate,t.rate=1,this.changeAction(tT))}},{key:"updateTime",value:function(e){var t=this.player,n=this.config,i=this.player.duration;e=Number(e.toFixed(4));var r=parseInt(e*n.moveDuration,10)+this.timeOffset;r=(r+=this.pos.time)<0?0:r>1e3*i?1e3*i-200:r,t.getPlugin("time")&&t.getPlugin("time").updateTime(r/1e3),t.getPlugin("progress")&&t.getPlugin("progress").updatePercent(r/1e3/this.duration,!0),this.activeSeekNote(r/1e3,e>0),n.isTouchingSeek&&t.seek(Number((r-this.timeOffset)/1e3).toFixed(1)),this.pos.time=r}},{key:"updateVolume",value:function(e){this.player.rotateDeg&&(e=-e);var t=this.player,n=this.pos;if(e=parseInt(100*e,10),n.volume+=e,!(Math.abs(n.volume)<10)){var i=parseInt(10*t.volume,10)-parseInt(n.volume/10,10);i=i>10?10:i<1?0:i,t.volume=i/10,n.volume=0}}},{key:"updateBrightness",value:function(e){this.player.rotateDeg&&(e=-e);var t=this.pos,n=this.config,i=this.xgMask,r=t.light+.8*e;r=r>n.maxDarkness?n.maxDarkness:r<0?0:r,i&&(i.style.backgroundColor="rgba(0,0,0,".concat(r,")")),t.light=r}},{key:"activeSeekNote",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.player,i=this.config,r=!(this.duration!==1/0&&this.duration>0);if(e&&"number"==typeof e&&!r&&!i.disableActive){e<0?e=0:e>n.duration&&(e=n.duration-.2),this.changeAction(nT);var o=n.plugins.start;o&&o.focusHide(),this.find(".xg-dur").innerHTML=Ww.format(this.duration),this.find(".xg-cur").innerHTML=Ww.format(e),this.find(".xg-curbar").style.width="".concat(e/this.duration*100,"%"),t?Ww.removeClass(this.find(".xg-seek-show"),"xg-back"):Ww.addClass(this.find(".xg-seek-show"),"xg-back"),this.updateThumbnails(e)}}},{key:"updateThumbnails",value:function(e){var t=this.player.plugins.thumbnail;t&&t.usable&&this.thumbnail&&t.update(this.thumbnail,e,160,90)}},{key:"switchPlayPause",value:function(){var e=this.player;if(!e.hasStart)return!1;e.ended||(e.paused?e.play():e.pause())}},{key:"disableGesture",value:function(){this.config.disableGesture=!1}},{key:"enableGesture",value:function(){this.config.disableGesture=!0}},{key:"destroy",value:function(){var e=this.player;this.timer&&clearTimeout(this.timer),this.thumbnail=null,e.root.removeChild(this.xgMask),this.xgMask=null,this.touch&&this.touch.destroy(),this.touch=null,e.root.removeEventListener("touchmove",this.onRootTouchMove,!0),e.root.removeEventListener("touchend",this.onRootTouchEnd,!0)}},{key:"render",value:function(){var e="normal"!==this.config.gradient?"gradient ".concat(this.config.gradient):"gradient";return'\n <xg-trigger class="trigger">\n <div class="'.concat(e,'"></div>\n <div class="time-preview">\n <div class="xg-seek-show ').concat(this.config.disableSeekIcon?" hide-seek-icon":"",'">\n <i class="xg-seek-icon"></i>\n <span class="xg-cur">00:00</span>\n <span>/</span>\n <span class="xg-dur">00:00</span>\n </div>\n <div class="xg-bar xg-timebar">\n <div class="xg-curbar"></div>\n </div>\n </div>\n <div class="xg-playbackrate xg-top-note">\n <span><i>').concat(this.config.pressRate,"X</i>").concat(this.i18n.FORWARD,"</span>\n </div>\n </xg-trigger>\n ")}}],[{key:"pluginName",get:function(){return"mobile"}},{key:"defaultConfig",get:function(){return{stopPropagation:!0,index:0,disableGesture:!1,gestureX:!0,gestureY:!0,updateGesture:function(){},onTouchStart:function(){},onTouchEnd:function(){},gradient:"normal",isTouchingSeek:!1,miniMoveStep:5,miniYPer:5,scopeL:.25,scopeR:.25,scopeM:.9,pressRate:2,darkness:!0,maxDarkness:.8,disableActive:!1,disableTimeProgress:!1,hideControlsActive:!1,hideControlsEnd:!1,moveDuration:36e4,closedbClick:!1,disablePress:!0,disableSeekIcon:!1,focusVideoClick:!1}}}]),n}(HC),aT=oT;function sT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function cT(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?sT(Object(n),!0).forEach((function(t){Go(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sT(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function uT(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}function lT(e){var t=e.tagName;return!("INPUT"!==t&&"TEXTAREA"!==t&&!e.isContentEditable)}fr({target:"String",proto:!0},{repeat:CS});var fT=function(e){Ho(n,e);var t=uT(n);function n(){var e;Bo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Uo(e=t.call.apply(t,[this].concat(r))),"onBodyKeyDown",(function(t){if(e.player){var n=t||window.event,i=n.target,r=n.keyCode,o=Uo(e),a=o._keyState,s=o.player,c=e.config,u=c.disable,l=c.disableBodyTrigger,f=c.isIgnoreUserActive,h=i.ownerDocument;!h||u||l||!s.isUserActive&&!f||lT(i)||!e.checkIsVisible()||n.metaKey||n.altKey||n.ctrlKey?a.isBodyKeyDown=!1:(t.repeat||a.isKeyDown||((i===h.body||e.config.isGlobalTrigger&&!lT(i))&&e.checkCode(r,!0)&&(a.isBodyKeyDown=!0),h.addEventListener("keyup",e.onBodyKeyUp)),a.isBodyKeyDown&&e.handleKeyDown(n))}})),Go(Uo(e),"onBodyKeyUp",(function(t){if(e.player){var n=(t||window.event).target.ownerDocument;n&&(n.removeEventListener("keyup",e.onBodyKeyUp),e.handleKeyUp(t))}})),Go(Uo(e),"onKeydown",(function(t){if(e.player){var n=t||window.event,i=Uo(e)._keyState;if(!n.repeat){if(e.config.disable||e.config.disableRootTrigger||n.metaKey||n.altKey||n.ctrlKey)return;if(!e.player.isUserActive&&!e.config.isIgnoreUserActive)return;!n||37!==n.keyCode&&!e.checkCode(n.keyCode)||n.target!==e.player.root&&n.target!==e.player.video&&n.target!==e.player.controls.el||(i.isKeyDown=!0),e.player.root.addEventListener("keyup",e.onKeyup)}i.isKeyDown&&e.handleKeyDown(n)}})),Go(Uo(e),"onKeyup",(function(t){e.player&&(e.player.root.removeEventListener("keyup",e.onKeyup),e.handleKeyUp(t))})),e}return Fo(n,[{key:"setConfig",value:function(e,t){var n=this;if(e){var i=Object.keys(e);i.length<1||(i.forEach((function(i){t.deepMerge&&"Object"===Ww.typeOf(n.config[i])?Ww.deepMerge(n.config[i],e[i]):n.config[i]=e[i]})),this.mergekeyCodeMap())}}},{key:"mergekeyCodeMap",value:function(){var e=this,t=this.config.keyCodeMap;t&&Object.keys(t).map((function(n){e.keyCodeMap[n]?["keyCode","action","disable","pressAction","disablePress","isBodyTarget"].map((function(i){t[n][i]&&(e.keyCodeMap[n][i]=t[n][i])})):e.keyCodeMap[n]=t[n]}))}},{key:"afterCreate",value:function(){this.config.disable=!this.playerConfig.keyShortcut;var e="function"==typeof this.config.seekStep?this.config.seekStep(this.player):this.config.seekStep;e&&"number"==typeof e&&(this.seekStep=e),this.keyCodeMap={space:{keyCode:32,action:"playPause",disable:!1,disablePress:!1,noBodyTarget:!1},up:{keyCode:38,action:"upVolume",disable:!1,disablePress:!1,noBodyTarget:!0},down:{keyCode:40,action:"downVolume",disable:!1,disablePress:!1,noBodyTarget:!0},left:{keyCode:37,action:"seekBack",disablePress:!1,disable:!1},right:{keyCode:39,action:"seek",pressAction:"changePlaybackRate",disablePress:!1,disable:!1},esc:{keyCode:27,action:"exitFullscreen",disablePress:!0,disable:!1}},this.mergekeyCodeMap(),this._keyState={isKeyDown:!1,isBodyKeyDown:!1,isPress:!1,tt:0,playbackRate:0},this.player.root.addEventListener("keydown",this.onKeydown),document.addEventListener("keydown",this.onBodyKeyDown)}},{key:"checkIsVisible",value:function(){if(!this.config.checkVisible)return!0;var e=this.player.root.getBoundingClientRect(),t=e.height,n=e.top,i=e.bottom,r=window.innerHeight;return!(n<0&&n<0-.9*t||i>0&&i-r>.9*t)}},{key:"checkCode",value:function(e,t){var n=this,i=!1;return Object.keys(this.keyCodeMap).map((function(r){n.keyCodeMap[r]&&e===n.keyCodeMap[r].keyCode&&!n.keyCodeMap[r].disable&&(i=!t||t&&!n.keyCodeMap[r].noBodyTarget)})),i}},{key:"downVolume",value:function(e){var t=this.player;if(!(t.volume<=0)){var n=parseFloat((t.volume-.1).toFixed(1)),i={volume:{from:t.volume,to:n}};this.emitUserAction(e,"change_volume",{props:i}),t.volume=n>=0?n:0}}},{key:"upVolume",value:function(e){var t=this.player;if(!(t.volume>=1)){var n=parseFloat((t.volume+.1).toFixed(1)),i={volume:{from:t.volume,to:n}};this.emitUserAction(e,"change_volume",{props:i}),t.volume=n<=1?n:1}}},{key:"seek",value:function(e){var t=this.player,n=t.currentTime,i=t.duration,r=n,o=e.repeat&&this.seekStep>=4?parseInt(this.seekStep/2,10):this.seekStep,a={currentTime:{from:n,to:r=n+o<=i?n+o:i}};this.emitUserAction(e,"seek",{props:a}),this.player.currentTime=r}},{key:"seekBack",value:function(e){var t=this.player.currentTime,n=e.repeat?parseInt(this.seekStep/2,10):this.seekStep,i=0;t-n>=0&&(i=t-n);var r={currentTime:{from:t,to:i}};this.emitUserAction(e,"seek",{props:r}),this.player.currentTime=i}},{key:"changePlaybackRate",value:function(e){var t=this._keyState,n=this.config,i=this.player;0===t.playbackRate&&(t.playbackRate=i.playbackRate,i.playbackRate=n.playbackRate)}},{key:"playPause",value:function(e){var t=this.player;t&&(this.emitUserAction(e,"switch_play_pause"),t.paused?t.play():t.pause())}},{key:"exitFullscreen",value:function(e){var t=this.player,n=t.fullscreen,i=t.cssfullscreen;n&&(this.emitUserAction("keyup","switch_fullscreen",{prop:"fullscreen",from:n,to:!n}),t.exitFullscreen()),i&&(this.emitUserAction("keyup","switch_css_fullscreen",{prop:"cssfullscreen",from:i,to:!i}),t.exitCssFullscreen())}},{key:"handleKeyDown",value:function(e){var t=this._keyState;if(e.repeat){t.isPress=!0;var n=Date.now();if(n-t.tt<200)return;t.tt=n}!function(e){e.preventDefault(),e.returnValue=!1}(e),this.handleKeyCode(e.keyCode,e,t.isPress)}},{key:"handleKeyUp",value:function(e){var t=this._keyState;t.playbackRate>0&&(this.player.playbackRate=t.playbackRate,t.playbackRate=0),t.isKeyDown=!1,t.isPress=!1,t.tt=0}},{key:"handleKeyCode",value:function(e,t,n){for(var i=Object.keys(this.keyCodeMap),r=0;r<i.length;r++){var o=this.keyCodeMap[i[r]];if(o){var a=o.action,s=o.keyCode,c=o.disable,u=o.pressAction,l=o.disablePress;if(s===e){if(!(c||n&&l)){var f=n&&u||a;"function"==typeof f?a(t,this.player,n):"string"==typeof f&&"function"==typeof this[f]&&this[f](t,this.player,n),this.emit(N_,cT({key:i[r],target:t.target,isPress:n},this.keyCodeMap[i[r]]))}break}}}}},{key:"destroy",value:function(){this.player.root.removeEventListener("keydown",this.onKeydown),document.removeEventListener("keydown",this.onBodyKeyDown),this.player.root.removeEventListener("keyup",this.onKeyup),document.removeEventListener("keyup",this.onBodyKeyUp)}},{key:"disable",value:function(){this.config.disable=!0}},{key:"enable",value:function(){this.config.disable=!1}}],[{key:"pluginName",get:function(){return"keyboard"}},{key:"defaultConfig",get:function(){return{seekStep:10,checkVisible:!1,disableBodyTrigger:!1,disableRootTrigger:!1,isGlobalTrigger:!1,keyCodeMap:{},disable:!1,playbackRate:2,isIgnoreUserActive:!1}}}]),n}(EC),hT=fT;function dT(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="-5 -5 110 110">\n <path d="M100,50A50,50,0,1,1,50,0" stroke-width="5" stroke="#ddd" stroke-dasharray="236" fill="none"></path>\n</svg>\n',"image/svg+xml").firstChild}function pT(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var vT=function(e){Ho(n,e);var t=pT(n);function n(){return Bo(this,n),t.apply(this,arguments)}return Fo(n,[{key:"registerIcons",value:function(){return{loadingIcon:dT}}},{key:"afterCreate",value:function(){this.appendChild("xg-loading-inner",this.icons.loadingIcon)}},{key:"render",value:function(){return'\n <xg-loading class="xgplayer-loading">\n <xg-loading-inner></xg-loading-inner>\n </xg-loading>'}}],[{key:"pluginName",get:function(){return"loading"}},{key:"defaultConfig",get:function(){return{position:MC.ROOT}}}]),n}(HC),gT=vT,yT=fr,mT=Za.findIndex,kT=zv,bT="findIndex",wT=!0;bT in[]&&Array(1)[bT]((function(){wT=!1})),yT({target:"Array",proto:!0,forced:wT},{findIndex:function(e){return mT(this,e,arguments.length>1?arguments[1]:void 0)}}),kT(bT);var _T=[{tag:"xg-cache",className:"xgplayer-progress-cache",styleKey:"cachedColor"},{tag:"xg-played",className:"xgplayer-progress-played",styleKey:"playedColor"}],CT=function(){function e(t){Bo(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 Fo(e,[{key:"updateDuration",value:function(e){var t=this;this.duration=e;var n=0,i=this.fragments;this.fragments=i.map((function(e){return e.start=parseInt(n,10),e.end=parseInt(n+e.percent*t.duration,10),e.duration=parseInt(e.percent*t.duration,10),n+=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},n=this.progressList,i=this.fragments;if(!(n.length<1)){var r=t.newIndex,o=t.curIndex,a=t.millisecond;r!==o&&n.map((function(t,n){n<r?t[e].style.width="100%":n>r&&(t[e].style.width=0)}));var s=i[r],c=0===a?0:(a-s.start)/s.duration;n[r][e].style.width=c<0?0:"".concat(100*c,"%")}}},{key:"updateFocus",value:function(e){if(this.fragConfig.fragAutoFocus&&!(this.fragments.length<2))if(e){var t=this.findIndex(1e3*e.currentTime,this.focusIndex);if(t>=0&&t!==this.focusIndex){this.focusIndex>-1&&this.unHightLight(this.focusIndex),this.setHightLight(t);var n={index:t,preIndex:this.focusIndex,fragment:this.fragments[this.focusIndex]};this.focusIndex=t,this._callBack&&this._callBack(n)}}else if(this.focusIndex>-1){this.unHightLight(this.focusIndex);var i={index:-1,preIndex:this.focusIndex,fragment:null};this._callBack&&this._callBack(i),this.focusIndex=-1}}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{cached:0,played:0},t=arguments.length>1?arguments[1]:void 0;if(!this.duration||parseInt(1e3*t,10)!==this.duration){if(!t&&0!==t)return;this.updateDuration(parseInt(1e3*t,10))}var n=this.playedIndex,i=this.cachedIndex;if("Undefined"!==Ww.typeOf(e.played)){var r=this.findIndex(1e3*e.played,n);if(r<0)return;this.updateProgress("played",{newIndex:r,curIndex:n,millisecond:parseInt(1e3*e.played,10)}),this.playedIndex=r}if("Undefined"!==Ww.typeOf(e.cached)){var o=this.findIndex(1e3*e.cached,i);if(o<0)return;this.updateProgress("cached",{newIndex:o,curIndex:i,millisecond:parseInt(1e3*e.cached,10)}),this.cachedIndex=o}}},{key:"findIndex",value:function(e,t){var n=this.fragments;if(!n||0===n.length)return-1;if(1===n.length)return 0;if(t>-1&&t<n.length&&e>n[t].start&&e<n[t].end)return t;if(e>n[n.length-1].start)return n.length-1;for(var i=0;i<n.length;i++)if(e>n[i].start&&e<=n[i].end){t=i;break}return t}},{key:"findHightLight",value:function(){for(var e=this.root.children,t=0;t<e.length;t++)if(Ww.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++)Ww.removeClass(e[t],this.fragConfig.fragFocusClass)}},{key:"setHightLight",value:function(e){var t=this.root.children;if(e<t.length)return Ww.addClass(t[e],this.fragConfig.fragFocusClass),{dom:t[e],pos:t[e].getBoundingClientRect()}}},{key:"destroy",value:function(){this.progressList=null,this.fragments=null,this.root.innerHTML=""}},{key:"reset",value:function(e){var t=this;if(Object.keys(this.fragConfig).forEach((function(n){void 0!==e[n]&&(t.fragConfig[n]=e[n])})),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=Ww.createDom("xg-inners","",{},"progress-list")),this.fragments){var n=this.fragConfig,i=n.fragClass,r=n.fragFocusClass;this.progressList=this.fragments.map((function(n){var o=Ww.createDom("xg-inner","",{style:t?"background:".concat(t,"; flex: ").concat(n.percent):"flex: ".concat(n.percent)},"".concat(n.isFocus?r:""," xgplayer-progress-inner ").concat(i));return e.root.appendChild(o),_T.forEach((function(t){o.appendChild(Ww.createDom(t.tag,"",{style:t.styleKey?"background: ".concat(e.style[t.styleKey],"; width:0;"):"width:0;"},t.className))})),{cached:o.children[0],played:o.children[1]}}))}return this.root}}]),e}();function xT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function ST(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xT(Object(n),!0).forEach((function(t){Go(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xT(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function TT(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var ET={POINT:"inner-focus-point",HIGHLIGHT:"inner-focus-highlight"},PT=function(e){Ho(n,e);var t=TT(n);function n(e){var i;return Bo(this,n),Go(Uo(i=t.call(this,e)),"onMoveOnly",(function(e,t){var n=Uo(i),r=n.pos,o=n.config,a=n.player,s=t;if(e){Ww.event(e);var c=Ww.getEventPos(e,a.zoom),u=90===a.rotateDeg?c.clientY:c.clientX;if(r.moving&&Math.abs(r.x-u)<o.miniMoveStep)return;r.moving=!0,r.x=u,s=i.computeTime(e,u)}i.triggerCallbacks("dragmove",s,e),i._updateInnerFocus(s)})),Go(Uo(i),"onBodyClick",(function(e){e.preventDefault(),e.stopPropagation()})),Go(Uo(i),"_mouseDownHandler",(function(e,t){i._state.time=t.currentTime,i.updateWidth(t.currentTime,t.percent,0),i._updateInnerFocus(t)})),Go(Uo(i),"_mouseUpHandler",(function(e,t){Uo(i).pos.moving&&i.updateWidth(t.currentTime,t.percent,2)})),Go(Uo(i),"_mouseMoveHandler",(function(e,t){var n=Uo(i),r=n._state,o=n.pos,a=n.config,s=n.player;r.time<t.currentTime?t.forward=!0:t.forward=!1,r.time=t.currentTime,o.isDown&&!o.moving&&(o.moving=!0,a.isPauseMoving&&s.pause(),i.triggerCallbacks("dragstart",t,e),i.emitUserAction("drag","dragstart",t)),i.updateWidth(t.currentTime,t.percent,1),i.triggerCallbacks("dragmove",t,e),i._updateInnerFocus(t)})),Go(Uo(i),"onMouseDown",(function(e){var t=Uo(i),n=t._state,r=t.player,o=t.pos,a=t.config,s=t.playerConfig,c=t.root,u=Ww.getEventPos(e,r.zoom),l=90===r.rotateDeg?u.clientY:u.clientX;if(!(r.isMini||a.closeMoveSeek||!s.allowSeekAfterEnded&&r.ended)){e.stopPropagation(),i.focus(),Ww.checkIsFunction(s.disableSwipeHandler)&&s.disableSwipeHandler(),Ww.checkIsFunction(a.onMoveStart)&&a.onMoveStart(),Ww.event(e),o.x=l,o.isDown=!0,o.moving=!1,n.prePlayTime=r.currentTime,r.focus({autoHide:!1}),i.isProgressMoving=!0,Ww.addClass(i.progressBtn,"active");var f=i.computeTime(e,l);return f.prePlayTime=n.prePlayTime,i._mouseDownHandlerHook(e,f),"touchstart"===e.type?(c.addEventListener("touchmove",i.onMouseMove),c.addEventListener("touchend",i.onMouseUp),c.addEventListener("touchcancel",i.onMouseUp)):(i.unbind("mousemove",i.onMoveOnly),c.ownerDocument.addEventListener("mousemove",i.onMouseMove,!1),c.ownerDocument.addEventListener("mouseup",i.onMouseUp,!1),r.root.addEventListener("click",i.onBodyClick,!1)),!0}})),Go(Uo(i),"onMouseUp",(function(e){var t=Uo(i),n=t.player,r=t.config,o=t.pos,a=t.playerConfig,s=t._state,c=t.root;e.stopPropagation(),e.preventDefault(),Ww.checkIsFunction(a.enableSwipeHandler)&&a.enableSwipeHandler(),Ww.checkIsFunction(r.onMoveEnd)&&r.onMoveEnd(),Ww.event(e),Ww.removeClass(i.progressBtn,"active");var u=i.computeTime(e,o.x);u.prePlayTime=s.prePlayTime,o.moving?(i.triggerCallbacks("dragend",u,e),i.emitUserAction("drag","dragend",u)):(i.triggerCallbacks("click",u,e),i.emitUserAction("click","click",u)),i._mouseUpHandlerHook(e,u),o.moving=!1,o.isDown=!1,o.x=0,o.y=0,s.prePlayTime=0,s.time=0;var l=e.type;"touchend"===l||"touchcancel"===l?(c.removeEventListener("touchmove",i.onMouseMove),c.removeEventListener("touchend",i.onMouseUp),c.removeEventListener("touchcancel",i.onMouseUp),i.blur()):(c.ownerDocument.removeEventListener("mousemove",i.onMouseMove,!1),c.ownerDocument.removeEventListener("mouseup",i.onMouseUp,!1),n.root.removeEventListener("click",i.onBodyClick,!1),o.isEnter?"mobile"!==a.isMobileSimulateMode&&i.bind("mousemove",i.onMoveOnly):i.onMouseLeave(e)),Ww.setTimeout(Uo(i),(function(){i.resetSeekState()}),10),n.focus()})),Go(Uo(i),"onMouseMove",(function(e){var t=Uo(i),n=t._state,r=t.pos,o=t.player,a=t.config;Ww.checkTouchSupport()&&e.preventDefault(),Ww.event(e);var s=Ww.getEventPos(e,o.zoom),c=90===o.rotateDeg?s.clientY:s.clientX,u=Math.abs(r.x-c);if(!(r.moving&&u<a.miniMoveStep||!r.moving&&u<a.miniStartStep)){r.x=c;var l=i.computeTime(e,c);l.prePlayTime=n.prePlayTime,i._mouseMoveHandlerHook(e,l)}})),Go(Uo(i),"onMouseOut",(function(e){i.triggerCallbacks("mouseout",null,e)})),Go(Uo(i),"onMouseOver",(function(e){i.triggerCallbacks("mouseover",null,e)})),Go(Uo(i),"onMouseEnter",(function(e){var t=Uo(i),n=t.player,r=t.pos;if(!(r.isDown||r.isEnter||n.isMini||!n.config.allowSeekAfterEnded&&n.ended)){r.isEnter=!0,i.bind("mousemove",i.onMoveOnly),i.bind("mouseleave",i.onMouseLeave),Ww.event(e);var o=Ww.getEventPos(e,n.zoom),a=90===n.rotateDeg?o.clientY:o.clientX,s=i.computeTime(e,a);i.triggerCallbacks("mouseenter",s,e),i.focus()}})),Go(Uo(i),"onMouseLeave",(function(e){i.triggerCallbacks("mouseleave",null,e),i.unlock(),i._updateInnerFocus(null),i.triggerCallbacks("mouseleaveFinished",null,e)})),Go(Uo(i),"onVideoResize",(function(){var e=i.pos,t=e.x,n=e.isDown;if(e.isEnter&&!n){var r=i.computeTime(null,t);i.onMoveOnly(null,r)}})),i.useable=!1,i.isProgressMoving=!1,i.__dragCallBacks=[],i._state={now:-1,direc:0,time:0,prePlayTime:-1},i._disableBlur=!1,i}return Fo(n,[{key:"duration",get:function(){return this.playerConfig.customDuration||this.player.duration}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"statistic",get:function(){return ST({hasActive:Ww.hasClass(this.root,"active"),disableBlur:this._disableBlur},this.pos||{})}},{key:"changeState",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.useable=e}},{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.progress&&(e.config.disable=!e.player.config.progress)}},{key:"_initInner",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t&&0!==t.length||(t=[{percent:1}]);var i=ST(ST({fragments:t},n),{},{actionCallback:function(t){e.emitUserAction("fragment_focus","fragment_focus",t)}});this.innerList?this.innerList.reset(i):(this.innerList=new CT(i),this.outer.insertBefore(this.innerList.render(),this.outer.children[0]),["findHightLight","unHightLight","setHightLight","findFragment"].map((function(t){e[t]=e.innerList[t].bind(e.innerList)})))}},{key:"_updateInnerFocus",value:function(e){this.innerList&&this.innerList.updateFocus(e)}},{key:"afterCreate",value:function(){var e=this;if(!this.config.disable&&!this.playerConfig.isLive){this.pos={x:0,y:0,moving:!1,isDown:!1,isEnter:!1},this.outer=this.find("xg-outer");var t=this.config,n=t.fragFocusClass,i=t.fragAutoFocus,r=t.fragClass;this._initInner(this.config.fragments,{fragFocusClass:n,fragAutoFocus:i,fragClass:r,style:this.playerConfig.commonStyle||{}}),"mobile"===$_.device&&(this.config.isDragingSeek=!1,this.isMobile=!0),this.progressBtn=this.find(".xgplayer-progress-btn"),this.on(r_,(function(){e.onMouseLeave()})),this.on(t_,(function(){e.onTimeupdate()})),this.on(e_,(function(){e.onTimeupdate(),e.onCacheUpdate()})),this.on(u_,(function(){e.onCacheUpdate()})),this.on($w,(function(){e.onCacheUpdate(!0),e.onTimeupdate(!0),e._state.now=0})),this.on(f_,(function(){e.onReset()})),this.on(I_,(function(){e.onVideoResize()})),this.on(j_,(function(){e.config.resetBlur&&e._disableBlur&&(e.enableBlur(),e.blur())})),this.bindDomEvents(),this.initCustomStyle()}}},{key:"setConfig",value:function(e){var t=this,n=null;Object.keys(e).forEach((function(i){t.config[i]=e[i],"fragments"===i&&(n=e[i])})),n&&this._initInner(n,e)}},{key:"initCustomStyle",value:function(){var e=(this.playerConfig||{}).commonStyle.sliderBtnStyle,t=this.progressBtn;e&&("string"==typeof e?t.style.boxShadow=e:"object"===Do(e)&&Object.keys(e).map((function(n){t.style[n]=e[n]})))}},{key:"triggerCallbacks",value:function(e,t,n){this.__dragCallBacks.length>0&&this.__dragCallBacks.map((function(i){if(i&&i.handler&&i.type===e)try{i.handler(t,n)}catch(e){console.error("[XGPLAYER][triggerCallbacks] ".concat(i," 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 n=this.__dragCallBacks,i=-1;n.map((function(n,r){n&&n.type===e&&n.handler===t&&(i=r)})),i>-1&&n.splice(i,1)}},{key:"unlock",value:function(){var e=this.player,t=this.pos;t.isEnter=!1,e.isMini||(this.unbind("mousemove",this.onMoveOnly),t.isDown?this.unbind("mouseleave",this.onMouseLeave):this.blur())}},{key:"bindDomEvents",value:function(){var e=this.player,t=e.controls,n=e.config;this._mouseDownHandlerHook=this.hook("dragstart",this._mouseDownHandler),this._mouseUpHandlerHook=this.hook("dragend",this._mouseUpHandler),this._mouseMoveHandlerHook=this.hook("drag",this._mouseMoveHandler),"touch"!==this.domEventType&&"compatible"!==this.domEventType||(this.root.addEventListener("touchstart",this.onMouseDown),t&&(t.root&&t.root.addEventListener("touchmove",Ww.stopPropagation),t.center&&t.center.addEventListener("touchend",Ww.stopPropagation))),"mouse"!==this.domEventType&&"compatible"!==this.domEventType||(this.bind("mousedown",this.onMouseDown),"mobile"!==n.isMobileSimulateMode&&this.bind("mouseenter",this.onMouseEnter),this.bind("mouseover",this.onMouseOver),this.bind("mouseout",this.onMouseOut))}},{key:"focus",value:function(){this.player.controls.pauseAutoHide(),Ww.addClass(this.root,"active")}},{key:"blur",value:function(){this._disableBlur||(this.player.controls.recoverAutoHide(),Ww.removeClass(this.root,"active"))}},{key:"disableBlur",value:function(){this._disableBlur=!0}},{key:"enableBlur",value:function(){this._disableBlur=!1}},{key:"updateWidth",value:function(e,t,n){var i=this.config,r=this.player;if(!i.isCloseClickSeek||0!==n){var o=e>=r.duration?r.duration-i.endedDiff:Number(e).toFixed(1);this.updatePercent(t),this.updateTime(e),(1!==n||i.isDragingSeek&&"audio"!==r.videoConfig.mediaType)&&(this._state.now=o,this._state.direc=o>r.currentTime?0:1,r.seek(o))}}},{key:"computeTime",value:function(e,t){var n,i,r=this.player,o=this.root.getBoundingClientRect(),a=o.width,s=o.height,c=o.top,u=o.left,l=t;90===r.rotateDeg?(n=s,i=c):(n=a,i=u);var f=l-i,h=(f=f>n?n:f<0?0:f)/n;return{percent:h=h<0?0:h>1?1:h,currentTime:parseInt(h*this.duration*1e3,10)/1e3,offset:f,width:n,left:i,e:e}}},{key:"updateTime",value:function(e){var t=this.player,n=this.duration;e>n?e=n:e<0&&(e=0);var i=t.plugins.time;i&&i.updateTime(e)}},{key:"resetSeekState",value:function(){this.isProgressMoving=!1;var e=this.player.plugins.time;e&&e.resetActive()}},{key:"updatePercent",value:function(e,t){if(this.isProgressMoving=!0,!this.config.disable){e=e>1?1:e<0?0:e,this.progressBtn.style.left="".concat(100*e,"%"),this.innerList.update({played:e*this.duration},this.duration);var n=this.player.plugins.miniprogress;n&&n.update({played:e*this.duration},this.duration)}}},{key:"onTimeupdate",value:function(e){var t=this.player,n=this._state,i=this.duration;if(!(t.isSeeking&&t.video.seeking||this.isProgressMoving)&&t.hasStart){if(n.now>-1){var r=parseInt(1e3*n.now,10)-parseInt(1e3*t.currentTime,10);if(0===n.direc&&r>300||1===n.direc&&r>-300)return void(n.now=-1);n.now=-1}var o=this.timeOffset+t.currentTime;o=Ww.adjustTimeByDuration(o,i,e),this.innerList.update({played:o},i),this.progressBtn.style.left="".concat(o/i*100,"%");var a=this.player.plugins.miniprogress;a&&a.update({played:o},i)}}},{key:"onCacheUpdate",value:function(e){var t=this.player,n=this.duration;if(t){var i=t.bufferedPoint.end;i=Ww.adjustTimeByDuration(i,n,e),this.innerList.update({cached:i},n);var r=this.player.plugins.miniprogress;r&&r.update({cached:i},n)}}},{key:"onReset",value:function(){this.innerList.update({played:0,cached:0},0);var e=this.player.plugins.miniprogress;e&&e.update({cached:0,played:0},0)}},{key:"destroy",value:function(){var e=this.player,t=e.controls;this.thumbnailPlugin=null,this.innerList.destroy(),this.innerList=null;var n=this.domEventType;"touch"!==n&&"compatible"!==n||(this.root.removeEventListener("touchstart",this.onMouseDown),this.root.removeEventListener("touchmove",this.onMouseMove),this.root.removeEventListener("touchend",this.onMouseUp),t&&(t.root&&t.root.removeEventListener("touchmove",Ww.stopPropagation),t.center&&t.center.removeEventListener("touchend",Ww.stopPropagation))),"mouse"!==n&&"compatible"!==n||(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,!1))}},{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:MC.CONTROLS_CENTER,index:0,disable:!1,isDragingSeek:!0,closeMoveSeek:!1,isPauseMoving:!1,isCloseClickSeek:!1,fragments:[{percent:1}],fragFocusClass:ET.POINT,fragClass:"",fragAutoFocus:!1,miniMoveStep:5,miniStartStep:2,onMoveStart:function(){},onMoveEnd:function(){},endedDiff:.2,resetBlur:!1}}},{key:"FRAGMENT_FOCUS_CLASS",get:function(){return ET}}]),n}(HC),RT=PT;function OT(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var IT=function(e){Ho(n,e);var t=OT(n);function n(){var e;Bo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Uo(e=t.call.apply(t,[this].concat(r))),"_onMouseenter",(function(t){e.emit("icon_mouseenter",{pluginName:e.pluginName})})),Go(Uo(e),"_onMouseLeave",(function(t){e.emit("icon_mouseleave",{pluginName:e.pluginName})})),e}return Fo(n,[{key:"afterCreate",value:function(){this.bind("mouseenter",this._onMouseenter),this.bind("mouseleave",this._onMouseLeave),this.config.disable&&this.disable()}},{key:"destroy",value:function(){this.unbind("mouseenter",this._onMouseenter),this.unbind("mouseleave",this._onMouseLeave)}}]),n}(HC);function LT(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var AT=function(e){Ho(n,e);var t=LT(n);function n(){var e;Bo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Uo(e=t.call.apply(t,[this].concat(r))),"btnClick",(function(t){var n=Uo(e),i=n.player;if(!n.config.disable)return t.preventDefault(),t.stopPropagation(),e.emitUserAction(t,"switch_play_pause"),i.ended?i.replay():i.paused&&!i.isBufferControlPaused?(i.play(),e.animate(!1)):(i.pause(),e.animate(!0)),!1})),e}return Fo(n,[{key:"afterCreate",value:function(){var e=this;uu(Vo(n.prototype),"afterCreate",this).call(this);var t=this.player;this.initIcons(),this.bind(["touchend","click"],this.btnClick),this.on([Jw,f_,qw],(function(){e.animate(t.paused)})),this.on(C_,(function(){e.animate(t.paused)})),this.animate(this.player.paused)}},{key:"registerIcons",value:function(){return{play:{icon:Gx,class:"xg-icon-play"},pause:{icon:Kx,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){var t=this.i18nKeys,n=this.player;e&&n.isBufferControlPaused||(e?(this.setAttr("data-state","pause"),this.changeLangTextKey(this.find(".xg-tips"),t.PLAY_TIPS)):(this.setAttr("data-state","play"),this.changeLangTextKey(this.find(".xg-tips"),t.PAUSE_TIPS)))}},{key:"destroy",value:function(){uu(Vo(n.prototype),"destroy",this).call(this),this.unbind(["touchend","click"],this.btnClick)}},{key:"render",value:function(){return'<xg-icon class="xgplayer-play">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys.PLAY_TIPS,'">').concat(this.i18n.PLAY_TIPS,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"play"}},{key:"defaultConfig",get:function(){return{position:MC.CONTROLS_LEFT,index:0,disable:!1}}}]),n}(IT),DT=AT;function MT(){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}function NT(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var FT=function(e){Ho(n,e);var t=NT(n);function n(){return Bo(this,n),t.apply(this,arguments)}return Fo(n,[{key:"afterCreate",value:function(){var e=this;this.initIcons(),this.onClick=function(t){t.preventDefault(),t.stopPropagation(),e.config.onClick(t)},this.bind(["click","touchend"],this.onClick)}},{key:"registerIcons",value:function(){return{screenBack:{icon:MT,class:"xg-fullscreen-back"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(this.root,e.screenBack)}},{key:"show",value:function(){Ww.addClass(this.root,"show")}},{key:"hide",value:function(){Ww.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:MC.ROOT_TOP,index:0}}}]),n}(HC);function BT(){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 jT(){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}function HT(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var UT=function(e){Ho(n,e);var t=HT(n);function n(){var e;Bo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Uo(e=t.call.apply(t,[this].concat(r))),"_onOrientationChange",(function(t){e.player.fullscreen&&e.config.rotateFullscreen&&(90===window.orientation||-90===window.orientation?e.setRotateDeg(0):e.setRotateDeg(90))})),e}return Fo(n,[{key:"afterCreate",value:function(){var e=this;uu(Vo(n.prototype),"afterCreate",this).call(this);var t=this.config,i=this.playerConfig;t.target&&(this.playerConfig.fullscreenTarget=this.config.target);var r=Ww.getFullScreenEl();i.fullscreenTarget===r&&this.player.getFullscreen().catch((function(){})),this.initIcons(),this.handleFullscreen=this.hook("fullscreen_change",this.changeFullScreen,{pre:function(t){e.config.disable||e.emitUserAction(t,"switch_fullscreen",{fullscreen:e.player.fullscreen})}}),this.bind(".xgplayer-fullscreen",["touchend","click"],this.handleFullscreen),this.on(T_,(function(t){e.changeLangTextKey(e.find(".xg-tips"),t?e.i18nKeys.EXITFULLSCREEN_TIPS:e.i18nKeys.FULLSCREEN_TIPS),e.animate(t),e.config.needBackIcon&&e.show()})),this.config.needBackIcon&&(this.topBackIcon=this.player.registerPlugin({plugin:FT,options:{config:{onClick:function(t){e.handleFullscreen(t)}}}})),"mobile"===$_.device&&window.addEventListener("orientationchange",this._onOrientationChange)}},{key:"registerIcons",value:function(){return{fullscreen:{icon:BT,class:"xg-get-fullscreen"},exitFullscreen:{icon:jT,class:"xg-exit-fullscreen"}}}},{key:"destroy",value:function(){uu(Vo(n.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon","mobile"===$_.device?"touchend":"click",this.handleFullscreen),"mobile"===$_.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:"setRotateDeg",value:function(e){var t=this.player;90===window.orientation||-90===window.orientation?t.rotateDeg=0:t.rotateDeg=e}},{key:"getRotateFullscreen",value:function(e){var t=this.player;t.isCssfullScreen&&t.exitCssFullscreen(e);var n=e?QC.INNER_FULLSCREEN:QC.ROTATE_FULLSCREEN;t._fullscreenEl=e||t.root,t.changeFullStyle(t.root,e,n,QC.PARENT_ROTATE_FULLSCREEN),t.fullscreen=!0,this.setRotateDeg(90),this.emit(T_,!0)}},{key:"exitRotateFullscreen",value:function(e){var t=this.player;t.fullscreen=!1;var n=t._fullscreenEl!==t.root?QC.INNER_FULLSCREEN:QC.ROTATE_FULLSCREEN;t.recoverFullStyle(t.root,t._fullscreenEl,n,QC.PARENT_ROTATE_FULLSCREEN),this.setRotateDeg(0),this.emit(T_,!1)}},{key:"changeFullScreen",value:function(e){var t=this.player,n=this.config;if(!n.disable){e&&(e.preventDefault(),e.stopPropagation());var i=!1;if((!0===n.useCssFullscreen||"function"==typeof n.useCssFullscreen&&n.useCssFullscreen())&&(i=!0),i)t.fullscreen?(t.fullscreen=!1,t.exitCssFullscreen(),this.emit(T_,!1)):(t.fullscreen=!0,t.getCssFullscreen(),this.emit(T_,!0)),this.animate(t.fullscreen);else if(n.rotateFullscreen)t.fullscreen?this.exitRotateFullscreen():this.getRotateFullscreen(),this.animate(t.fullscreen);else{if(n.switchCallback&&"function"==typeof n.switchCallback)return void n.switchCallback(t.fullscreen);t.fullscreen?t.exitFullscreen():t.getFullscreen().catch((function(){}))}}}},{key:"animate",value:function(e){e?this.setAttr("data-state","full"):this.setAttr("data-state","normal"),this.topBackIcon&&(e?(this.topBackIcon.show(),this.hide()):(this.topBackIcon.hide(),this.show()))}},{key:"show",value:function(){uu(Vo(n.prototype),"show",this).call(this)}},{key:"hide",value:function(){uu(Vo(n.prototype),"hide",this).call(this)}},{key:"render",value:function(){var e="FULLSCREEN_TIPS";return'<xg-icon class="xgplayer-fullscreen">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys[e],'">').concat(this.i18n[e],"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"fullscreen"}},{key:"defaultConfig",get:function(){return{position:MC.CONTROLS_RIGHT,index:0,useCssFullscreen:!1,rotateFullscreen:!1,switchCallback:null,target:null,disable:!1,needBackIcon:!1}}}]),n}(IT);function WT(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var VT=function(e){Ho(n,e);var t=WT(n);function n(e){var i;return Bo(this,n),(i=t.call(this,e)).isActiving=!1,i.state={currentTime:0,duration:0},i}return Fo(n,[{key:"duration",get:function(){var e,t;return(null===(e=this.playerConfig)||void 0===e?void 0:e.customDuration)||(null===(t=this.player)||void 0===t?void 0:t.duration)||0}},{key:"timeOffset",get:function(){var e;return(null===(e=this.playerConfig)||void 0===e?void 0:e.timeOffset)||0}},{key:"afterCreate",value:function(){var e=this,t=this.player.controls.config.mode;this.mode="flex"===t?"flex":"normal",this.config.disable||("flex"===this.mode&&(this.createCenterTime(),this.hide()),this.durationDom=this.find(".time-duration"),this.timeDom=this.find(".time-current"),this.on([r_,e_,t_],(function(t){"durationchange"===t.eventName&&(e.isActiving=!1),e.onTimeUpdate()})),this.on($w,(function(){e.onTimeUpdate(!0)})),this.on(f_,(function(){e.onReset()})))}},{key:"afterPlayerInit",value:function(){var e,t=this.config;this.state={currentTime:0,duration:0},this.duration===1/0||null!==(e=this.playerConfig)&&void 0!==e&&e.isLive?(Ww.hide(this.durationDom),Ww.hide(this.timeDom),Ww.hide(this.find(".time-separator")),Ww.show(this.find(".time-live-tag"))):Ww.hide(this.find(".time-live-tag")),t.hide?this.hide():this.show()}},{key:"show",value:function(){"flex"!==this.mode&&uu(Vo(n.prototype),"show",this).call(this)}},{key:"onTimeUpdate",value:function(e){var t=this.player,n=this.config,i=this.duration;if(t&&t.hasStart&&!n.disable&&!this.isActiving){var r="flex"===this.mode?this.centerCurDom:this.timeDom,o="flex"===this.mode?this.centerDurDom:this.durationDom,a=!1,s=!1,c=t.currentTime+this.timeOffset;c=Ww.adjustTimeByDuration(c,i,e);var u=Ww.format(c);this.state.currentTime!==u&&(this.state.currentTime=u,a=!0),this.state.duration!==i&&(this.state.duration=i,s=!0),n.smartRender?(a&&(r.textContent=u),s&&i!==1/0&&i>0&&(o.textContent=Ww.format(i))):(r.innerHTML=u,i!==1/0&&i>0&&(o.innerHTML=Ww.format(i)))}}},{key:"onReset",value:function(){var e="flex"===this.mode?this.centerCurDom:this.timeDom,t="flex"===this.mode?this.centerDurDom:this.durationDom;this.config.smartRender?(this.state.currentTime=0,this.state.duration=0,e.textContent=Ww.format(0),t.textContent=Ww.format(0)):(e.innerHTML=Ww.format(0),t.innerHTML=Ww.format(0))}},{key:"createCenterTime",value:function(){var e=this.player;if(e.controls&&e.controls.center){var t=e.controls.center;this.centerCurDom=Ww.createDom("xg-icon","00:00",{},"xgplayer-time left"),this.centerDurDom=Ww.createDom("xg-icon","00:00",{},"xgplayer-time right"),t.children.length>0?t.insertBefore(this.centerCurDom,t.children[0]):t.appendChild(this.centerCurDom),t.appendChild(this.centerDurDom)}}},{key:"changeLiveState",value:function(e){e?(Ww.hide(this.durationDom),Ww.hide(this.timeDom),Ww.hide(this.find(".time-separator")),Ww.show(this.find(".time-live-tag"))):(Ww.hide(this.find(".time-live-tag")),Ww.show(this.find(".time-separator")),Ww.show(this.durationDom),Ww.show(this.timeDom))}},{key:"updateTime",value:function(e){if(this.isActiving=!0,!(!e&&0!==e||e>this.duration)){var t="flex"===this.mode?this.centerCurDom:this.timeDom;this.config.smartRender?(this.state.currentTime=e,t.textContent=Ww.format(e)):t.innerHTML=Ww.format(e)}}},{key:"resetActive",value:function(){var e=this,t=this.player,n=function(){e.isActiving=!1};this.off(e_,n),t.isSeeking&&t.video.seeking?this.once(e_,n):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:MC.CONTROLS_LEFT,index:2,disable:!1,smartRender:!1}}}]),n}(HC);function GT(){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 KT(){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 zT(){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}function YT(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var qT=function(e){Ho(n,e);var t=YT(n);function n(){var e;Bo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Uo(e=t.call.apply(t,[this].concat(r))),"onBarMousedown",(function(t){var n=Uo(e).player,i=e.find(".xgplayer-bar");Ww.event(t);var r=i.getBoundingClientRect(),o=Ww.getEventPos(t,n.zoom),a=r.height-(o.clientY-r.top);if(o.h=a,o.barH=r.height,e.pos=o,!(a<-2))return e.updateVolumePos(a,t),document.addEventListener("mouseup",e.onBarMouseUp),e._d.isStart=!0,!1})),Go(Uo(e),"onBarMouseMove",(function(t){var n=Uo(e)._d;if(n.isStart){var i=Uo(e),r=i.pos,o=i.player;t.preventDefault(),t.stopPropagation(),Ww.event(t);var a=Ww.getEventPos(t,o.zoom);n.isMoving=!0;var s=r.h-a.clientY+r.clientY;s>r.barH||e.updateVolumePos(s,t)}})),Go(Uo(e),"onBarMouseUp",(function(t){Ww.event(t),document.removeEventListener("mouseup",e.onBarMouseUp);var n=Uo(e)._d;n.isStart=!1,n.isMoving=!1})),Go(Uo(e),"onMouseenter",(function(t){e._d.isActive=!0,e.focus(),e.emit("icon_mouseenter",{pluginName:e.pluginName})})),Go(Uo(e),"onMouseleave",(function(t){e._d.isActive=!1,e.unFocus(100,!1,t),e.emit("icon_mouseleave",{pluginName:e.pluginName})})),Go(Uo(e),"onVolumeChange",(function(t){if(e.player){var n=e.player,i=n.muted,r=n.volume;e._d.isMoving||(e.find(".xgplayer-drag").style.height=i||0===r?"4px":"".concat(100*r,"%"),e.config.showValueLabel&&e.updateVolumeValue()),e.animate(i,r)}})),Go(Uo(e),"onIconHandle",(function(t){e.changeMutedHandler(t)})),e}return Fo(n,[{key:"registerIcons",value:function(){return{volumeSmall:{icon:KT,class:"xg-volume-small"},volumeLarge:{icon:GT,class:"xg-volume"},volumeMuted:{icon:zT,class:"xg-volume-mute"}}}},{key:"afterCreate",value:function(){var e=this;this._timerId=null,this._d={isStart:!1,isMoving:!1,isActive:!1},this.initIcons();var t=this.playerConfig,n=t.commonStyle,i=t.volume;n.volumeColor&&(this.find(".xgplayer-drag").style.backgroundColor=n.volumeColor),this.changeMutedHandler=this.hook("mutedChange",(function(t){e.changeMuted(t)}),{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this._onMouseenterHandler=this.hook("mouseenter",this.onMouseenter),this._onMouseleaveHandler=this.hook("mouseleave",this.onMouseleave),("mobile"!==$_.device&&"mobile"!==this.playerConfig.isMobileSimulateMode||"compatible"===this.domEventType)&&(this.bind("mouseenter",this._onMouseenterHandler),this.bind(["blur","mouseleave"],this._onMouseleaveHandler),this.bind(".xgplayer-slider",["mousedown","touchstart"],this.onBarMousedown),this.bind(".xgplayer-slider",["mousemove","touchmove"],this.onBarMouseMove),this.bind(".xgplayer-slider",["mouseup","touchend"],this.onBarMouseUp)),this.bind(".xgplayer-icon",["touchend","click"],this.onIconHandle),this.on(o_,this.onVolumeChange),this.once(a_,this.onVolumeChange),("Number"!==Ww.typeOf(i)||i<0||i>1)&&(this.player.volume=this.config.default),this.onVolumeChange(),this.config.disable&&this.disable()}},{key:"updateVolumePos",value:function(e,t){var n=this.player,i=this.find(".xgplayer-drag"),r=this.find(".xgplayer-bar");if(r&&i){var o=Math.max(Math.min(e/r.getBoundingClientRect().height,1),0),a=parseInt(1e3*o,10),s=a/1e3,c={volume:{from:n.volume,to:s}};i.style.height="".concat(100*o,"%"),n.muted&&(c.muted={from:!0,to:!1}),this.emitUserAction(t,"change_volume",{muted:n.muted,volume:n.volume,props:c}),n.volume=Math.max(Math.min(a/1e3,1),0),n.muted&&(n.muted=!1),this.config.showValueLabel&&this.updateVolumeValue()}}},{key:"updateVolumeValue",value:function(){var e=this.player,t=e.volume,n=e.muted,i=this.find(".xgplayer-value-label"),r=Math.max(Math.min(t,1),0);i.innerText=n?0:Math.round(100*r)}},{key:"focus",value:function(){var e=this.player;this.config.disable||(e.focus({autoHide:!1}),this._timerId&&(Ww.clearTimeout(this,this._timerId),this._timerId=null),Ww.addClass(this.root,"slide-show"))}},{key:"unFocus",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2?arguments[2]:void 0,r=this._d,o=this.player;r.isActive||(this._timerId&&(Ww.clearTimeout(this,this._timerId),this._timerId=null),this._timerId=Ww.setTimeout(this,(function(){r.isActive||(n?o.blur():o.focus(),Ww.removeClass(e.root,"slide-show"),r.isStart&&e.onBarMouseUp(i)),e._timerId=null}),t))}},{key:"changeMuted",value:function(e){if(!this.config.disable){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&&(Ww.clearTimeout(this,this._timerId),this._timerId=null),this.unbind("mouseenter",this.onMouseenter),this.unbind(["blur","mouseleave"],this.onMouseleave),this.unbind(".xgplayer-slider",["mousedown","touchstart"],this.onBarMousedown),this.unbind(".xgplayer-slider",["mousemove","touchmove"],this.onBarMouseMove),this.unbind(".xgplayer-slider",["mouseup","touchend"],this.onBarMouseUp),document.removeEventListener("mouseup",this.onBarMouseUp),this.unbind(".xgplayer-icon","mobile"===$_.device?"touchend":"click",this.onIconHandle)}},{key:"render",value:function(){var e=this.config.default||this.player.volume,t=this.config.showValueLabel;return'\n <xg-icon class="xgplayer-volume" data-state="normal">\n <div class="xgplayer-icon">\n </div>\n <xg-slider class="xgplayer-slider">\n '.concat(t?'<div class="xgplayer-value-label">'.concat(100*e,"</div>"):"",'\n <div class="xgplayer-bar">\n <xg-drag class="xgplayer-drag" style="height: ').concat(100*e,'%"></xg-drag>\n </div>\n </xg-slider>\n </xg-icon>')}}],[{key:"pluginName",get:function(){return"volume"}},{key:"defaultConfig",get:function(){return{position:MC.CONTROLS_RIGHT,index:1,disable:!1,showValueLabel:!1,default:.6,miniVolume:.2}}}]),n}(HC),XT=qT;function $T(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="-4 -6 40 40" fill="none">\n <g clip-path="url(#clip0)">\n <path transform="scale(1.5 1.5)" d="M11.6665 9.16663H4.1665C2.78579 9.16663 1.6665 10.2859 1.6665 11.6666V15.8333C1.6665 17.214 2.78579 18.3333 4.1665 18.3333H11.6665C13.0472 18.3333 14.1665 17.214 14.1665 15.8333V11.6666C14.1665 10.2859 13.0472 9.16663 11.6665 9.16663Z" fill="white"/>\n <path transform="scale(1.5 1.5)" fill-rule="evenodd" clip-rule="evenodd" d="M3.88148 4.06298C3.75371 4.21005 3.67667 4.40231 3.67749 4.61242C3.67847 4.87253 3.79852 5.10435 3.98581 5.25646L6.99111 8.05895C7.32771 8.37283 7.85502 8.35443 8.16891 8.01782C8.48279 7.68122 8.46437 7.15391 8.12778 6.84003L6.62061 5.43457L9.8198 5.4224C9.82848 5.42239 9.8372 5.42221 9.84591 5.4219C10.9714 5.38233 12.0885 5.6285 13.0931 6.13744C14.0976 6.64635 14.957 7.40148 15.5908 8.33234C16.2246 9.2632 16.6122 10.3394 16.7177 11.4606C16.823 12.5819 16.6427 13.7115 16.1934 14.7442C16.0098 15.1661 16.203 15.6571 16.6251 15.8408C17.0471 16.0243 17.5381 15.8311 17.7216 15.4091C18.2833 14.1183 18.5087 12.7063 18.3771 11.3047C18.2453 9.90318 17.7607 8.55792 16.9684 7.39433C16.1761 6.23073 15.1021 5.28683 13.8463 4.65065C12.5946 4.01651 11.203 3.70872 9.80072 3.75583L6.43415 3.76862L7.96326 2.12885C8.27715 1.79225 8.25872 1.26494 7.92213 0.951061C7.58553 0.63718 7.05822 0.655585 6.74433 0.99219L3.90268 4.0395C3.89545 4.04724 3.88841 4.05509 3.88154 4.06303L3.88148 4.06298Z" fill="white"/>\n </g>\n <defs>\n <clipPath id="clip0">\n <rect width="40" height="40" fill="white"/>\n </clipPath>\n </defs>\n</svg>\n',"image/svg+xml").firstChild}function JT(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var ZT=function(e){Ho(n,e);var t=JT(n);function n(e){var i;return Bo(this,n),Go(Uo(i=t.call(this,e)),"onBtnClick",(function(e){i.config.disable||(e.preventDefault(),e.stopPropagation(),i.emitUserAction(e,"rotate"),i.rotate(i.config.clockwise,i.config.innerRotate,1))})),i.rotateDeg=i.config.rotateDeg||0,i}return Fo(n,[{key:"afterCreate",value:function(){var e=this;if(!this.config.disable){uu(Vo(n.prototype),"afterCreate",this).call(this),this.appendChild(".xgplayer-icon",this.icons.rotate),this.bind(".xgplayer-icon",["click","touchend"],this.onBtnClick),this.on(I_,(function(){e.rotateDeg&&e.config.innerRotate&&Ww.setTimeout(e,(function(){e.updateRotateDeg(e.rotateDeg,e.config.innerRotate)}),100)}));var t=this.player.root;this.rootWidth=t.style.width||t.offsetWidth||t.clientWidth,this.rootHeight=t.style.height||t.offsetHeight||t.clientHeight,this.rotateDeg&&this.updateRotateDeg(this.rotateDeg,this.config.innerRotate)}}},{key:"destroy",value:function(){uu(Vo(n.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon",["click","touchend"],this.onBtnClick)}},{key:"updateRotateDeg",value:function(e,t){e||(e=0);var n=this.player,i=this.rootWidth,r=this.rootHeight;if(t)n.videoRotateDeg=e;else{var o=this.player,a=o.root,s=o.innerContainer,c=o.video,u=a.offsetWidth,l=s&&t?s.offsetHeight:a.offsetHeight,f=i,h=r,d=0,p=0;.75!==e&&.25!==e||(f="".concat(l,"px"),h="".concat(u,"px"),d=-(l-u)/2,p=-(u-l)/2);var v="translate(".concat(d,"px,").concat(p,"px) rotate(").concat(e,"turn)"),g={transformOrigin:"center center",transform:v,webKitTransform:v,height:h,width:f},y=t?c:a,m=t?n.getPlugin("poster"):null;Object.keys(g).map((function(e){y.style[e]=g[e],m&&m.root&&(m.root.style[e]=g[e])}))}}},{key:"rotate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=this.player;this.rotateDeg||(this.rotateDeg=0);var r=e?1:-1;this.rotateDeg=(this.rotateDeg+1+.25*r*n)%1,this.updateRotateDeg(this.rotateDeg,t),i.emit(A_,360*this.rotateDeg)}},{key:"registerIcons",value:function(){return{rotate:$T}}},{key:"render",value:function(){return'\n <xg-icon class="xgplayer-rotate">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys.ROTATE_TIPS,'">\n ').concat(this.i18n.ROTATE_TIPS,"\n </div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"rotate"}},{key:"defaultConfig",get:function(){return{position:MC.CONTROLS_RIGHT,index:6,innerRotate:!0,clockwise:!1,rotateDeg:0,disable:!1}}}]),n}(IT);function QT(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M16.5 4.3H3.5C3.38954 4.3 3.3 4.38954 3.3 4.5V15.5C3.3 15.6105 3.38954 15.7 3.5 15.7H8.50005L8.50006 17.5H3.5C2.39543 17.5 1.5 16.6046 1.5 15.5V4.5C1.5 3.39543 2.39543 2.5 3.5 2.5H16.5C17.6046 2.5 18.5 3.39543 18.5 4.5V8.5H16.7V4.5C16.7 4.38954 16.6105 4.3 16.5 4.3ZM12 11.5C11.4477 11.5 11 11.9477 11 12.5L11 16.5C11 17.0523 11.4478 17.5 12 17.5H17.5C18.0523 17.5 18.5 17.0523 18.5 16.5L18.5 12.5C18.5 11.9477 18.0523 11.5 17.5 11.5H12Z"\n fill="white" />\n</svg>',"image/svg+xml").firstChild}function eE(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M16.5 4.3H3.5C3.38954 4.3 3.3 4.38954 3.3 4.5V15.5C3.3 15.6105 3.38954 15.7 3.5 15.7H8.50005L8.50006 17.5H3.5C2.39543 17.5 1.5 16.6046 1.5 15.5V4.5C1.5 3.39543 2.39543 2.5 3.5 2.5H16.5C17.6046 2.5 18.5 3.39543 18.5 4.5V8.5H16.7V4.5C16.7 4.38954 16.6105 4.3 16.5 4.3ZM12 11.5C11.4477 11.5 11 11.9477 11 12.5L11 16.5C11 17.0523 11.4478 17.5 12 17.5H17.5C18.0523 17.5 18.5 17.0523 18.5 16.5L18.5 12.5C18.5 11.9477 18.0523 11.5 17.5 11.5H12Z"\n fill="white" />\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M9.4998 7.7C9.77595 7.7 9.9998 7.47614 9.9998 7.2V6.5C9.9998 6.22386 9.77595 6 9.4998 6H5.5402L5.52754 6.00016H5.5C5.22386 6.00016 5 6.22401 5 6.50016V10.4598C5 10.7359 5.22386 10.9598 5.5 10.9598H6.2C6.47614 10.9598 6.7 10.7359 6.7 10.4598V8.83005L8.76983 10.9386C8.96327 11.1357 9.27984 11.1386 9.47691 10.9451L9.97645 10.4548C10.1735 10.2613 10.1764 9.94476 9.983 9.7477L7.97289 7.7H9.4998Z"\n fill="white" />\n</svg>',"image/svg+xml").firstChild}var tE=fr,nE=fe,iE=k,rE=R,oE=ue,aE=Le,sE=Yo,cE=ha,uE=qi,lE=n.Symbol,fE=lE&&lE.prototype;if(nE&&oE(lE)&&(!("description"in fE)||void 0!==lE().description)){var hE={},dE=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:sE(arguments[0]),t=aE(fE,this)?new lE(e):void 0===e?lE():lE(e);return""===e&&(hE[t]=!0),t};uE(dE,lE),dE.prototype=fE,fE.constructor=dE;var pE="Symbol(test)"==String(lE("test")),vE=iE(fE.valueOf),gE=iE(fE.toString),yE=/^Symbol\((.*)\)[^)]+$/,mE=iE("".replace),kE=iE("".slice);cE(fE,"description",{configurable:!0,get:function(){var e=vE(this);if(rE(hE,e))return"";var t=gE(e),n=pE?kE(t,7,-1):mE(t,yE,"$1");return""===n?void 0:n}}),tE({global:!0,constructor:!0,forced:!0},{Symbol:dE})}function bE(e,t,n,i,r,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(i,r)}ba("iterator");var wE={exports:{}},_E={exports:{}};!function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(_E),function(e){var t=_E.exports.default;function n(){e.exports=n=function(){return i},e.exports.__esModule=!0,e.exports.default=e.exports;var i={},r=Object.prototype,o=r.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},c=s.iterator||"@@iterator",u=s.asyncIterator||"@@asyncIterator",l=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,i){var r=t&&t.prototype instanceof v?t:v,o=Object.create(r.prototype),s=new P(i||[]);return a(o,"_invoke",{value:x(e,n,s)}),o}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}i.wrap=h;var p={};function v(){}function g(){}function y(){}var m={};f(m,c,(function(){return this}));var k=Object.getPrototypeOf,b=k&&k(k(R([])));b&&b!==r&&o.call(b,c)&&(m=b);var w=y.prototype=v.prototype=Object.create(m);function _(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,n){function i(r,a,s,c){var u=d(e[r],e,a);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==t(f)&&o.call(f,"__await")?n.resolve(f.__await).then((function(e){i("next",e,s,c)}),(function(e){i("throw",e,s,c)})):n.resolve(f).then((function(e){l.value=e,s(l)}),(function(e){return i("throw",e,s,c)}))}c(u.arg)}var r;a(this,"_invoke",{value:function(e,t){function o(){return new n((function(n,r){i(e,t,n,r)}))}return r=r?r.then(o,o):o()}})}function x(e,t,n){var i="suspendedStart";return function(r,o){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===r)throw o;return O()}for(n.method=r,n.arg=o;;){var a=n.delegate;if(a){var s=S(a,n);if(s){if(s===p)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===i)throw i="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i="executing";var c=d(e,t,n);if("normal"===c.type){if(i=n.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i="completed",n.method="throw",n.arg=c.arg)}}}function S(e,t){var n=t.method,i=e.iterator[n];if(void 0===i)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var r=d(i,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,p;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function R(e){if(e){var t=e[c];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n<e.length;)if(o.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:O}}function O(){return{value:void 0,done:!0}}return g.prototype=y,a(w,"constructor",{value:y,configurable:!0}),a(y,"constructor",{value:g,configurable:!0}),g.displayName=f(y,l,"GeneratorFunction"),i.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},i.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,f(e,l,"GeneratorFunction")),e.prototype=Object.create(w),e},i.awrap=function(e){return{__await:e}},_(C.prototype),f(C.prototype,u,(function(){return this})),i.AsyncIterator=C,i.async=function(e,t,n,r,o){void 0===o&&(o=Promise);var a=new C(h(e,t,n,r),o);return i.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},_(w),f(w,l,"Generator"),f(w,c,(function(){return this})),f(w,"toString",(function(){return"[object Generator]"})),i.keys=function(e){var t=Object(e),n=[];for(var i in t)n.push(i);return n.reverse(),function e(){for(;n.length;){var i=n.pop();if(i in t)return e.value=i,e.done=!1,e}return e.done=!0,e}},i.values=R,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,i){return a.type="throw",a.arg=e,t.next=n,i&&(t.method="next",t.arg=void 0),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i],a=r.completion;if("root"===r.tryLoc)return n("end");if(r.tryLoc<=this.prev){var s=o.call(r,"catchLoc"),c=o.call(r,"finallyLoc");if(s&&c){if(this.prev<r.catchLoc)return n(r.catchLoc,!0);if(this.prev<r.finallyLoc)return n(r.finallyLoc)}else if(s){if(this.prev<r.catchLoc)return n(r.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return n(r.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&o.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var r=i;break}}r&&("break"===e||"continue"===e)&&r.tryLoc<=t&&t<=r.finallyLoc&&(r=null);var a=r?r.completion:{};return a.type=e,a.arg=t,r?(this.method="next",this.next=r.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 n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;E(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:R(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},i}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(wE);var CE=wE.exports(),xE=CE;try{regeneratorRuntime=CE}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=CE:Function("r","regeneratorRuntime = r")(CE)}var SE=Se,TE=$d,EE=Ma,PE=Pe,RE=T,OE=function(e,t,n,i){try{return i?t(SE(n)[0],n[1]):t(n)}catch(t){TE(e,"throw",t)}},IE=Ad,LE=Wr,AE=_i,DE=Zo,ME=zd,NE=jd,FE=Array,BE=function(e){var t=RE(e),n=LE(this),i=arguments.length,r=i>1?arguments[1]:void 0,o=void 0!==r;o&&(r=EE(r,i>2?arguments[2]:void 0));var a,s,c,u,l,f,h=NE(t),d=0;if(!h||this===FE&&IE(h))for(a=AE(t),s=n?new this(a):FE(a);a>d;d++)f=o?r(t[d],d):t[d],DE(s,d,f);else for(l=(u=ME(t,h)).next,s=n?new this:[];!(c=PE(l,u)).done;d++)f=o?OE(u,r,[c.value,d],!0):c.value,DE(s,d,f);return s.length=d,s},jE=BE;function HE(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return UE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return UE(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function UE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function WE(e){return new Promise((function(t){var n,i=document.createDocumentFragment(),r=[],o=[],a=0,s=HE(document.styleSheets);try{var c=function(){var e=n.value;try{var i=Array.from(e.cssRules);i.length>0&&r.push(i.map((function(e){return e.cssText})).join(""))}catch(n){if(e.href){var s=document.createElement("link");s.rel="stylesheet",s.type=e.type||"text/css",s.media=e.media.mediaText||"all",s.href=e.href,s.onload=function(){0===--a&&t()},s.onerror=function(){console.warn("Failed to load stylesheet: ".concat(s.href)),0===--a&&t()},o.push(s),a++}}};for(s.s();!(n=s.n()).done;)c()}catch(e){s.e(e)}finally{s.f()}if(o.forEach((function(e){return i.appendChild(e)})),r.length>0){var u=document.createElement("style");u.textContent=r.join("\n"),i.appendChild(u)}e.document.head.appendChild(i),0===a&&t()}))}fr({target:"Array",stat:!0,forced:!vp((function(e){Array.from(e)}))},{from:jE});var VE=function(){function e(){var t=this;Bo(this,e),Go(this,"_onLeave",(function(){var e,n;t.detachEl(),t.detachPlayer(),null===(e=t.currentOptions_)||void 0===e||null===(n=e.onLeave)||void 0===n||n.call(e),t.currentOptions_=null,t.window=null,t._isStandaloneWindow=!1})),Go(this,"_onBodyKeyDown",(function(e){var n,i,r,o,a=null===(n=t.currentOptions_)||void 0===n?void 0:n.player;null==a||null===(i=a.plugins)||void 0===i||null===(r=i.keyboard)||void 0===r||null===(o=r.onBodyKeyDown)||void 0===o||o.call(r,e)})),this.currentOptions_=null,this.currentElement_=null,this._window=null,this._isStandaloneWindow=!1}return Fo(e,[{key:"window",get:function(){return this._window},set:function(e){var t=this._window;t&&t===e||(t&&(t.removeEventListener("pagehide",this._onLeave),t.document.removeEventListener("keydown",this._onBodyKeyDown)),e&&(e.addEventListener("pagehide",this._onLeave),e.document.addEventListener("keydown",this._onBodyKeyDown)),this._window=e||null)}},{key:"isStandaloneWindow",get:function(){return this._isStandaloneWindow}},{key:"isSupported",value:function(){var e=/(metasr)/i.test(navigator.userAgent);return"documentPictureInPicture"in window&&/^(https|file)/.test(location.protocol)&&!e}},{key:"contains",value:function(e){var t;return!(null===(t=this.window)||void 0===t||!t.document.body.contains(e))}},{key:"requestWindow",value:function(e){var t=this,n=e.config,i=e.window,r=e.onEnter,o=e.onLeave,a=e.player;this.currentOptions_=e,this._isStandaloneWindow=!!n.alwaysKeepDocumentWindow;var s=new Promise((function(e){if(i)e(i);else{var t={};if(n.width&&n.height)t.width=n.width,t.height=n.height;else if(a){var r=a.root.getBoundingClientRect();t.width=r.width,t.height=r.height}"boolean"==typeof n.disallowReturnToOpener&&(t.disallowReturnToOpener=n.disallowReturnToOpener),"boolean"==typeof n.preferInitialWindowPlacement&&(t.preferInitialWindowPlacement=n.preferInitialWindowPlacement),n.docPiPTargetWindow?e(n.docPiPTargetWindow):documentPictureInPicture.requestWindow(t).then((function(t){e(t)}))}}));return s.then(function(){var e,i=(e=xE.mark((function e(i){var s,c,u,l,f,h;return xE.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=n.docPiPNode,c=n.docPiPStyle,u=s||(null==a?void 0:a.root)){e.next=4;break}return e.abrupt("return");case 4:return t.window=i,e.next=7,WE(i);case 7:l=document.createElement("style"),f=["body{padding:0; margin:0;}"],c?(h="","string"==typeof c?h=c:"function"==typeof c&&(h=c.call(n)),h&&f.push(h)):u===(null==a?void 0:a.root)&&f.push(".xgplayer{width: 100%!important; height: 100%!important;}"),l.textContent=f.join("\n"),i.document.head.append(l),t.attachPlayer(a,{element:u,window:i,onEnter:r,onLeave:o}),null==r||r({documentPictureInPictureWindow:i});case 14:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function a(e){bE(o,i,r,a,s,"next",e)}function s(e){bE(o,i,r,a,s,"throw",e)}a(void 0)}))});return function(e){return i.apply(this,arguments)}}()),s}},{key:"exit",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(e=this.window)||void 0===e||e.close(),t&&this._onLeave()}},{key:"attachEl",value:function(e){if(e&&this.window){var t=e.parentElement,n=e.nextSibling;this.window.document.body.append(e),this.currentElement_={element:e,parentNode:t,nextSibling:n}}}},{key:"detachEl",value:function(e){var t,n=this;if(this.currentElement_&&(!e||e===(null===(t=this.currentElement_)||void 0===t?void 0:t.element))){var i=this.currentElement_,r=i.element,o=i.parentNode,a=i.nextSibling;return o&&(o.isConnected?o.insertBefore(r,a):r.remove?r.remove():r.parentNode.removeChild(r)),Object.keys(this.currentElement_).forEach((function(e){n.currentElement_[e]=null})),this.currentElement_=null,r}}},{key:"attachPlayer",value:function(e,t){var n,i=t.element,r=t.window,o=t.onEnter,a=t.onLeave;this.window&&r!==this.window||(r&&(this.window=r),this.currentOptions_&&(o&&(this.currentOptions_.onEnter=o),a&&(this.currentOptions_.onLeave=a),e&&(this.currentOptions_.player=e)),i&&i!==(null===(n=this.currentElement_)||void 0===n?void 0:n.element)&&(this.detachEl(),this.attachEl(i)))}},{key:"detachPlayer",value:function(e){var t,n;if(e){(null===(t=this.currentOptions_)||void 0===t?void 0:t.player)===e&&(this.currentOptions_.player=null);var i=null===(n=this.currentElement_)||void 0===n?void 0:n.element;i&&(i===e.root||i.contains(e.root))&&this.detachEl()}}}]),e}(),GE=new VE;function KE(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var zE="picture-in-picture",YE="inline",qE="fullscreen",XE=function(e){Ho(n,e);var t=KE(n);function n(){var e;Bo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Uo(e=t.call.apply(t,[this].concat(r))),"switchPIP",(function(t){if(!e.isPIPAvailable()||e.config.disable)return!1;t&&t instanceof Event&&t.stopPropagation(),e.isPip?(e.exitPIP(),e.emitUserAction(t,"change_pip",{from:"pip",to:"normal"}),e.setAttr("data-state","normal")):4===e.player.video.readyState&&(e.requestPIP(),e.emitUserAction(t,"change_pip",{from:"normal",to:"pip"}),e.setAttr("data-state","pip"))})),e}return Fo(n,[{key:"setConfig",value:function(e){var t=this;e&&(Object.keys(e).map((function(n){t.config[n]=e[n]})),this.canShow()&&!this.root&&this.reInitialize(),this._initState())}},{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.pip&&(e.config.showIcon=e.player.config.pip)}},{key:"afterCreate",value:function(){this.isPIPAvailable()&&(uu(Vo(n.prototype),"afterCreate",this).call(this),this.pMode=YE,this.pipWindow=null,this._initPipEvents(),this._initState({checkStyle:!0}))}},{key:"canShow",value:function(){return this.config.showIcon&&this.isPIPAvailable()}},{key:"_initState",value:function(){var e,t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.config.showIcon?(this.initIcons(),n.checkStyle&&this.show("",!1),null!==(e=this.player)&&void 0!==e&&e.isComplete?this._checkIcon():this.once(m_,(function(){return t._checkIcon()})),this.config.docPiPTargetWindow&&this.isDocPIPAvailable()&&this.requestPIP(),this.isPip&&this.setAttr("data-state","pip")):n.checkStyle&&this.hide()}},{key:"_checkIcon",value:function(){this.config.showIcon&&(Ww.removeClass(this.find(".xgplayer-icon"),"xg-icon-disable"),this.bind("click",this.switchPIP))}},{key:"registerIcons",value:function(){return{pipIcon:{icon:QT,class:"xg-get-pip"},pipIconExit:{icon:eE,class:"xg-exit-pip"}}}},{key:"initIcons",value:function(){var e=this.icons;this._isInitIcons||(this.appendChild(".xgplayer-icon",e.pipIcon),this.appendChild(".xgplayer-icon",e.pipIconExit),this._isInitIcons=!0)}},{key:"_initPipEvents",value:function(){var e=this,t=this.player;this.onBeforeFullscreenRequest=function(n){GE.contains(t.root)&&GE.detachEl(),e.exitPIP()},this.leavePIPCallback=function(){var n=t.paused;Ww.setTimeout(e,(function(){!n&&t.videoPlay()}),0),!n&&t.videoPlay(),e.setAttr("data-state","normal"),e.pipWindow=null,t.emit(L_,!1)},this.enterPIPCallback=function(n){e.setAttr("data-state","pip"),null!=n&&n.pictureInPictureWindow&&(e.pipWindow=n.pictureInPictureWindow),t.emit(L_,!0)},this.onWebkitpresentationmodechanged=function(n){var i=t.video.webkitPresentationMode;e.pMode===qE&&i!==qE&&t.onFullscreenChange(null,!1),e.pMode=i,i===zE?e.enterPIPCallback(n):i===YE&&e.leavePIPCallback(n)},t.on(S_,this.onBeforeFullscreenRequest),t.video&&(t.video.addEventListener("enterpictureinpicture",this.enterPIPCallback),t.video.addEventListener("leavepictureinpicture",this.leavePIPCallback),n.checkWebkitSetPresentationMode(t.video)&&t.video.addEventListener("webkitpresentationmodechanged",this.onWebkitpresentationmodechanged))}},{key:"requestPIP",value:function(e){var t=this.player,i=this.playerConfig,r=this.config;if(this.isPIPAvailable()&&!this.isPip)try{var o=i.poster;return o&&(t.video.poster="String"===Ww.typeOf(o)?o:o.poster),r.preferDocument&&this.isDocPIPAvailable()?GE.requestWindow({config:r,window:e,player:t,onEnter:this.enterPIPCallback,onLeave:this.leavePIPCallback}):n.checkWebkitSetPresentationMode(t.video)?t.video.webkitSetPresentationMode("picture-in-picture"):t.video.requestPictureInPicture(),!0}catch(e){return console.error("requestPiP",e),!1}}},{key:"exitPIP",value:function(){var e=this.player;try{return this.isPIPAvailable()&&this.isPip&&(this.isDocPIPAvailable()&&this.getDocumentWindow()?GE.exit():n.checkWebkitSetPresentationMode(e.video)?e.video.webkitSetPresentationMode("inline"):document.exitPictureInPicture()),!0}catch(e){return console.error("exitPIP",e),!1}}},{key:"isPip",get:function(){var e=this.player;return!(!this.isDocPIPAvailable()||!this.getDocumentWindow())||document.pictureInPictureElement&&document.pictureInPictureElement===e.video||e.video.webkitPresentationMode===zE}},{key:"isPIPAvailable",value:function(){var e=this.player.video;return("Boolean"!==Ww.typeOf(document.pictureInPictureEnabled)||document.pictureInPictureEnabled)&&("Boolean"===Ww.typeOf(e.disablePictureInPicture)&&!e.disablePictureInPicture||e.webkitSupportsPresentationMode&&"Function"===Ww.typeOf(e.webkitSetPresentationMode))||this.isDocPIPAvailable()}},{key:"isDocPIPAvailable",value:function(){return GE.isSupported()}},{key:"getWindow",value:function(){return this.pipWindow}},{key:"getDocumentWindow",value:function(){return GE.window}},{key:"attachDocumentWindow",value:function(e){var t,n=this.config.docPiPNode||(null===(t=this.player)||void 0===t?void 0:t.root);GE.attachPlayer(this.player,{element:n,window:e,onEnter:this.enterPIPCallback,onLeave:this.leavePIPCallback})}},{key:"destroy",value:function(){uu(Vo(n.prototype),"destroy",this).call(this);var e=this.player,t=!(this.isPip&&this.getDocumentWindow()&&GE.isStandaloneWindow);this.unbind("click",this.btnClick),e.off(S_,this.onBeforeFullscreenRequest),e.video.removeEventListener("enterpictureinpicture",this.enterPIPCallback),e.video.removeEventListener("leavepictureinpicture",this.leavePIPCallback),n.checkWebkitSetPresentationMode(e.video)&&e.video.removeEventListener("webkitpresentationmodechanged",this.onWebkitpresentationmodechanged),this.isPip&&this.getDocumentWindow()&&GE.detachPlayer(e),t&&this.exitPIP(),this.pipWindow=null,GE.isStandaloneWindow||(GE.window=null)}},{key:"render",value:function(){if(this.canShow())return'<xg-icon class="xgplayer-pip">\n <div class="xgplayer-icon xg-icon-disable">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys.PIP,'">').concat(this.i18n.PIP,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"pip"}},{key:"defaultConfig",get:function(){return{position:MC.CONTROLS_RIGHT,index:6,showIcon:!1,preferDocument:!1,width:void 0,height:void 0,docPiPTargetWindow:void 0,docPiPNode:void 0,docPiPStyle:void 0,alwaysKeepDocumentWindow:!1}}},{key:"checkWebkitSetPresentationMode",value:function(e){return"function"==typeof e.webkitSetPresentationMode}}]),n}(IT),$E=XE;function JE(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="40" viewBox="10 0 24 40">\n <path transform="scale(0.038 0.028)" d="M800 380v768h-128v-352l-320 320v-704l320 320v-352z"></path>\n</svg>\n',"image/svg+xml").firstChild}function ZE(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var QE=function(e){Ho(n,e);var t=ZE(n);function n(e){var i;return Bo(this,n),Go(Uo(i=t.call(this,e)),"playNext",(function(e){var t=Uo(i).player;e.preventDefault(),e.stopPropagation(),i.idx+1<i.config.urlList.length?(i.idx++,t.emit(M_,i.idx+1),i.nextHandler(i.config.urlList[i.idx],i.idx)):(i.nextHandler(),t.emit(M_))})),i.idx=-1,i}return Fo(n,[{key:"afterCreate",value:function(){this.config.urlList&&0!==this.config.urlList.length&&(this.appendChild(".xgplayer-icon",this.icons.playNext),this.initEvents())}},{key:"registerIcons",value:function(){return{playNext:JE}}},{key:"initEvents",value:function(){this.nextHandler=this.hook("playNext",this.changeSrc);var e="mobile"===$_.device?"touchend":"click";this.bind(e,this.playNext),this.show()}},{key:"changeSrc",value:function(e){var t=this.player;e&&(t.pause(),t.currentTime=0,t.autoplay=!0,t.src=e)}},{key:"destroy",value:function(){this.unbind(["touchend","click"],this.playNext)}},{key:"render",value:function(){if(this.config.urlList&&0!==this.config.urlList.length)return'\n <xg-icon class="xgplayer-playnext">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="PLAYNEXT_TIPS">'.concat(this.i18n.PLAYNEXT_TIPS,"</div>\n </xg-icon>\n ")}}],[{key:"pluginName",get:function(){return"playNext"}},{key:"defaultConfig",get:function(){return{position:MC.CONTROLS_LEFT,index:1,url:null,urlList:[]}}}]),n}(HC),eP={exports:{}};!function(e,t){e.exports=function e(t,n,i){var r,o,a=window,s="application/octet-stream",c=i||s,u=t,l=!n&&!i&&u,f=document.createElement("a"),h=function(e){return String(e)},d=a.Blob||a.MozBlob||a.WebKitBlob||h,p=n||"download";if(d=d.call?d.bind(a):Blob,"true"===String(this)&&(c=(u=[u,c])[0],u=u[1]),l&&l.length<2048&&(p=l.split("/").pop().split("?")[0],f.href=l,-1!==f.href.indexOf(l))){var v=new XMLHttpRequest;return v.open("GET",l,!0),v.responseType="blob",v.onload=function(t){e(t.target.response,p,s)},setTimeout((function(){v.send()}),0),v}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(u)){if(!(u.length>2096103.424&&d!==h))return navigator.msSaveBlob?navigator.msSaveBlob(k(u),p):b(u);c=(u=k(u)).type||s}else if(/([\x80-\xff])/.test(u)){for(var g=0,y=new Uint8Array(u.length),m=y.length;g<m;++g)y[g]=u.charCodeAt(g);u=new d([y],{type:c})}function k(e){for(var t=e.split(/[:;,]/),n=t[1],i=("base64"==t[2]?atob:decodeURIComponent)(t.pop()),r=i.length,o=0,a=new Uint8Array(r);o<r;++o)a[o]=i.charCodeAt(o);return new d([a],{type:n})}function b(e,t){if("download"in f)return f.href=e,f.setAttribute("download",p),f.className="download-js-link",f.innerHTML="downloading...",f.style.display="none",document.body.appendChild(f),setTimeout((function(){f.click(),document.body.removeChild(f),!0===t&&setTimeout((function(){a.URL.revokeObjectURL(f.href)}),250)}),66),!0;if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent))return/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,s)),window.open(e)||confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")&&(location.href=e),!0;var n=document.createElement("iframe");document.body.appendChild(n),!t&&/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,s)),n.src=e,setTimeout((function(){document.body.removeChild(n)}),333)}if(r=u instanceof d?u:new d([u],{type:c}),navigator.msSaveBlob)return navigator.msSaveBlob(r,p);if(a.URL)b(a.URL.createObjectURL(r),!0);else{if("string"==typeof r||r.constructor===h)try{return b("data:"+c+";base64,"+a.btoa(r))}catch(e){return b("data:"+c+","+encodeURIComponent(r))}(o=new FileReader).onload=function(e){b(this.result)},o.readAsDataURL(r)}return!0}}(eP);var tP=eP.exports;function nP(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24">\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g transform="translate(-488.000000, -340.000000)" fill="#FFFFFF">\n <g id="Group-2">\n <g id="volme_big-copy" transform="translate(488.000000, 340.000000)">\n <rect id="Rectangle-18" x="11" y="4" width="2" height="12" rx="1"></rect>\n <rect id="Rectangle-2" x="3" y="18" width="18" height="2" rx="1"></rect>\n <rect id="Rectangle-2" transform="translate(4.000000, 17.500000) rotate(90.000000) translate(-4.000000, -17.500000) " x="1.5" y="16.5" width="5" height="2" rx="1"></rect><rect id="Rectangle-2-Copy-3" transform="translate(20.000000, 17.500000) rotate(90.000000) translate(-20.000000, -17.500000) " x="17.5" y="16.5" width="5" height="2" rx="1"></rect>\n <path d="M9.48791171,8.26502656 L9.48791171,14.2650266 C9.48791171,14.8173113 9.04019646,15.2650266 8.48791171,15.2650266 C7.93562696,15.2650266 7.48791171,14.8173113 7.48791171,14.2650266 L7.48791171,7.26502656 C7.48791171,6.71274181 7.93562696,6.26502656 8.48791171,6.26502656 L15.4879117,6.26502656 C16.0401965,6.26502656 16.4879117,6.71274181 16.4879117,7.26502656 C16.4879117,7.81731131 16.0401965,8.26502656 15.4879117,8.26502656 L9.48791171,8.26502656 Z" id="Combined-Shape" transform="translate(11.987912, 10.765027) scale(1, -1) rotate(45.000000) translate(-11.987912, -10.765027) "></path>\n </g>\n </g>\n </g>\n </g>\n</svg>\n',"image/svg+xml").firstChild}function iP(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var rP=function(e){Ho(n,e);var t=iP(n);function n(e){var i;return Bo(this,n),Go(Uo(i=t.call(this,e)),"download",(function(e){if(!i.isLock&&!i.config.disable){i.emitUserAction(e,"download");var t=i.getAbsoluteURL(i.player.src);tP(t),i.isLock=!0,i.timer=window.setTimeout((function(){i.isLock=!1,window.clearTimeout(i.timer),i.timer=null}),300)}})),i.timer=null,i.isLock=!1,i}return Fo(n,[{key:"afterCreate",value:function(){uu(Vo(n.prototype),"afterCreate",this).call(this),this.config.disable||(this.appendChild(".xgplayer-icon",this.icons.download),this.bind(["click","touchend"],this.download))}},{key:"registerIcons",value:function(){return{download:nP}}},{key:"getAbsoluteURL",value:function(e){if(!e.match(/^https?:\/\//)){var t=document.createElement("div");t.innerHTML='<a href="'.concat(e,'">x</a>'),e=t.firstChild.href}return e}},{key:"destroy",value:function(){uu(Vo(n.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.download),window.clearTimeout(this.timer),this.timer=null}},{key:"render",value:function(){return'<xg-icon class="xgplayer-download">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys.DOWNLOAD_TIPS,'">').concat(this.i18n.DOWNLOAD_TIPS,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"download"}},{key:"defaultConfig",get:function(){return{position:MC.CONTROLS_RIGHT,index:3,disable:!0}}}]),n}(IT);function oP(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var aP=function(e){Ho(n,e);var t=oP(n);function n(){return Bo(this,n),t.apply(this,arguments)}return Fo(n,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.screenShot&&(e.config.disable=!e.player.config.screenShot)}},{key:"afterCreate",value:function(){uu(Vo(n.prototype),"afterCreate",this).call(this),this.createCanvas(),this.appendChild(".xgplayer-icon",this.icons.screenshotIcon);var e=this.config;this.initSize=function(t){e.fitVideo&&(e.width=t.vWidth,e.height=t.vHeight)},this.once(I_,this.initSize)}},{key:"onPluginsReady",value:function(){this.show(),this.onClickBtn=this.onClickBtn.bind(this),this.bind(["click","touchend"],this.onClickBtn)}},{key:"saveScreenShot",value:function(e,t){var n=document.createElement("a");n.href=e,n.download=t;var i=document.createEvent("MouseEvents");i.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),n.dispatchEvent(i)}},{key:"createCanvas",value:function(e,t){var n=document.createElement("canvas");this.canvasCtx=n.getContext("2d"),this.canvas=n,n.width=e||this.config.width,n.height=t||this.config.height,this.config.canvasAdded&&this.player.root.appendChild(n)}},{key:"onClickBtn",value:function(e){var t=this;e.preventDefault(),e.stopPropagation(),this.emitUserAction(e,"shot"),this.shot().then((function(e){t.emit(D_,e),t.saveScreenShot(e,t.config.name+t.config.format)}))}},{key:"shotArea",value:function(e,t,n,i){var r=this,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{quality:.92,type:"image/png"},a=this.config,s=this.player,c=o.quality||a.quality,u=o.type||a.type,l=s.video||s.media,f=this.canvas;return new Promise((function(o){var a=r.canvasCtx;f.width=n,f.height=i;var s,h={isContain:"contain"===(s=getComputedStyle(l)["object-fit"]),isCover:"cover"===s},d=h.isCover;if(h.isContain){var p=l.videoHeight/l.videoWidth,v=p;v=l.clientHeight/l.clientWidth>p?l.videoWidth/l.clientWidth:l.videoHeight/l.clientHeight,f.width=n,f.height=i,a.drawImage(l,e*v,t*v,n*v,i*v,0,0,n,i),o(f.toDataURL(u,c))}else if(d){var g=function(e,t,n,i){var r,o,a,s,c=e/t;return n/i>c?(s=i,r=(n-(a=i*c))*(arguments.length>4&&void 0!==arguments[4]?arguments[4]:.5),o=0):(a=n,r=0,o=(i-(s=n/c))*(arguments.length>5&&void 0!==arguments[5]?arguments[5]:.5)),{source:{x:r,y:o,width:a,height:s},destination:{x:0,y:0,width:e,height:t}}}(l.clientWidth,l.clientHeight,l.videoWidth,l.videoHeight),y=g.source,m=g.destination;f.width=m.width,f.height=m.height,a.drawImage(l,y.x,y.y,y.width,y.height,m.x,m.y,m.width,m.height);var k=f.toDataURL("image/png"),b=new Image(m.width,m.height);b.src=k,b.onload=function(){a.clearRect(0,0,f.width,f.height),f.width=n,f.height=i,a.drawImage(b,e,t,n,i,0,0,n,i),b.onload=null},a.drawImage(l,e,t,n,i,0,0,n,i),o(f.toDataURL(u,c))}}))}},{key:"shot",value:function(e,t){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{quality:.92,type:"image/png"},r=this.config,o=this.player,a=i.quality||r.quality,s=i.type||r.type;return new Promise((function(i,c){n.canvas?(n.canvas.width=e||r.width,n.canvas.height=t||r.height):n.createCanvas(e,t),n.canvasCtx.drawImage(o.video,0,0,e||r.width,t||r.height);var u=n.canvas.toDataURL(s,a).replace(s,"image/octet-stream");i(u=u.replace(/^data:image\/[^;]+/,"data:application/octet-stream"))}))}},{key:"registerIcons",value:function(){return{screenshotIcon:null}}},{key:"destroy",value:function(){uu(Vo(n.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.onClickBtn),this.off(I_,this.initSize)}},{key:"render",value:function(){if(!this.config.disable&&this.config.showIcon){var e=this.icons.screenshotIcon?"xgplayer-icon":"xgplayer-icon btn-text",t="SCREENSHOT";return'\n <xg-icon class="xgplayer-shot">\n <div class="'.concat(e,'">\n ').concat(this.icons.screenshotIcon?"":'<span lang-key="'.concat(this.i18nKeys[t],'">').concat(this.i18n[t],"</span>")," \n </div>\n </xg-icon>")}}}],[{key:"pluginName",get:function(){return"screenShot"}},{key:"defaultConfig",get:function(){return{position:MC.CONTROLS_RIGHT,index:5,quality:.92,type:"image/png",format:".png",width:600,height:337,fitVideo:!0,disable:!1,name:"screenshot",showIcon:!0,canvasCreated:!1,canvasAdded:!1}}}]),n}(IT),sP=function(){function e(t){Bo(this,e),this.config=t.config,this.parent=t.root,this.root=Ww.createDom("ul","",{},"xg-options-list ".concat(this.config.className)),t.root.appendChild(this.root),this.onItemClick=this.onItemClick.bind(this),this.renderItemList();var n="touche"===this.config.domEventType?"touchend":"click";this._delegates=HC.delegate.call(this,this.root,"li",n,this.onItemClick)}return Fo(e,[{key:"renderItemList",value:function(e){var t=this,n=this.config,i=this.root;e?n.data=e:e=n.data,n.style&&Object.keys(n.style).map((function(e){i.style[e]=n[e]})),e.length>0&&(this.attrKeys=Object.keys(e[0])),this.root.innerHTML="",e.map((function(e,n){var i=e.selected?"option-item selected":"option-item";e["data-index"]=n,t.root.appendChild(Ww.createDom("li","<span>".concat(e.showText,"</span>"),e,i))}))}},{key:"onItemClick",value:function(e){e.delegateTarget||(e.delegateTarget=e.target);var t=e.delegateTarget;if(t&&Ww.hasClass(t,"selected"))return!1;var n="function"==typeof this.config.onItemClick?this.config.onItemClick:null,i=this.root.querySelector(".selected");Ww.addClass(t,"selected"),i&&Ww.removeClass(i,"selected"),n(e,{from:i?this.getAttrObj(i,this.attrKeys):null,to:this.getAttrObj(t,this.attrKeys)})}},{key:"getAttrObj",value:function(e,t){if(!e||!t)return{};var n={};t.map((function(t){n[t]=e.getAttribute(t)}));var i=e.getAttribute("data-index");return i&&(n.index=Number(i)),n}},{key:"show",value:function(){Ww.removeClass(this.root,"hide"),Ww.addClass(this.root,"active")}},{key:"hide",value:function(){Ww.removeClass(this.root,"active"),Ww.addClass(this.root,"hide")}},{key:"setStyle",value:function(e){var t=this;Object.keys(e).forEach((function(n){t.root.style[n]=e[n]}))}},{key:"destroy",value:function(){this._delegates&&(this._delegates.map((function(e){e.destroy&&e.destroy()})),this._delegates=null),this.root.innerHTML=null,this.parent.removeChild(this.root),this.root=null}}]),e}();function cP(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var uP="mobile"===$_.device,lP=function(e){Ho(n,e);var t=cP(n);function n(e){var i;return Bo(this,n),Go(Uo(i=t.call(this,e)),"onEnter",(function(e){e.preventDefault(),e.stopPropagation(),i.emit("icon_mouseenter",{pluginName:i.pluginName}),i.onToggle(!0)})),Go(Uo(i),"onLeave",(function(e){e.preventDefault(),e.stopPropagation(),i.emit("icon_mouseleave",{pluginName:i.pluginName}),i.isActive&&i.onToggle(!1)})),i.isIcons=!1,i.isActive=!1,i.curValue=null,i.curIndex=0,i}return Fo(n,[{key:"updateLang",value:function(e){this.renderItemList(this.config.list,this.curIndex)}},{key:"afterCreate",value:function(){var e=this,t=this.config;this.initIcons(),uP=uP||"touch"===this.domEventType,"mobile"===$_.device&&"middle"!==t.listType&&(t.listType="rightSide"),t.hidePortrait&&Ww.addClass(this.root,"portrait"),this.once(i_,(function(){t.list&&t.list.length>0&&(e.renderItemList(t.list),e.show())})),uP&&this.on(h_,(function(){e.isActive&&(e.optionsList&&e.optionsList.hide(),e.isActive=!1)})),this.activeEvent=uP?"touchend":"mouseenter",this.bind(this.activeEvent,this.onEnter),this.bind("mouseleave",this.onLeave),this.isIcons&&this.bind("click",this.onIconClick),this.config.disable&&this.disable()}},{key:"initIcons",value:function(){var e=this,t=this.icons,n=Object.keys(t),i=!1;n.length>0&&(n.forEach((function(n){e.appendChild(".xgplayer-icon",t[n]),!i&&(i=t[n])})),this.isIcons=i),i||(this.appendChild(".xgplayer-icon",Ww.createDom("span","",{},"icon-text")),Ww.addClass(this.find(".xgplayer-icon"),"btn-text"))}},{key:"show",value:function(){!this.config.list||this.config.list.length<1||Ww.addClass(this.root,"show")}},{key:"hide",value:function(){Ww.removeClass(this.root,"show")}},{key:"getTextByLang",value:function(e,t,n){if(void 0===e)return"";var i=this.config.list;!n&&(n=this.player.lang),t=!t||Ww.isUndefined(e[t])?"text":t,"number"==typeof e&&(e=i[e]);try{return"object"===Do(e[t])?e[t][n]||e[t].zh:e[t]}catch(e){return console.warn(e),""}}},{key:"onToggle",value:function(e){if(e!==this.isActive&&!this.config.disable){var t=this.player.controls,n=this.config.listType;e?("rightSide"===n?t.blur():t.focus(),this.optionsList&&this.optionsList.show()):("rightSide"===n?t.focus():t.unFocus(),this.optionsList&&this.optionsList.hide()),this.isActive=e}}},{key:"onItemClick",value:function(e,t){e.preventDefault(),e.stopPropagation();var n=this.config,i=n.listType,r=n.list;(uP||"rightSide"===i)&&this.onToggle(!1),this.curIndex=t.to.index,this.curItem=r[this.curIndex],this.changeCurrentText(),this.onToggle(!1)}},{key:"onIconClick",value:function(e){}},{key:"changeCurrentText",value:function(){if(!this.isIcons){var e=this.config.list,t=e[this.curIndex<e.length?this.curIndex:0];t&&(this.find(".icon-text").innerHTML=this.getTextByLang(t,"iconText"))}}},{key:"renderItemList",value:function(e,t){var n=this,i=this.config,r=this.optionsList,o=this.player;if("number"==typeof t&&(this.curIndex=t,this.curItem=i.list[t]),r)return r.renderItemList(e),void this.changeCurrentText();var a={config:{data:e||[],className:"rightSide"===i.listType?"right-side":"",onItemClick:function(e,t){n.onItemClick(e,t)},domEventType:uP?"touche":"mouse"},root:"rightSide"===i.listType?o.root:this.root};this.config.isShowIcon&&(this.optionsList=new sP(a),this.changeCurrentText(),this.show())}},{key:"destroy",value:function(){this.unbind(this.activeEvent,this.onToggle),this.unbind("mouseleave",this.onToggle),this.optionsList&&(this.optionsList.destroy(),this.optionsList=null)}},{key:"render",value:function(){if(this.config.isShowIcon)return'<xg-icon class="xg-options-icon '.concat(this.config.className||"",'">\n <div class="xgplayer-icon">\n </div>\n </xg-icon>')}}],[{key:"pluginName",get:function(){return"optionsIcon"}},{key:"defaultConfig",get:function(){return{position:MC.CONTROLS_RIGHT,index:100,list:[],listType:"middle",listStyle:{},hidePortrait:!0,isShowIcon:!1}}}]),n}(HC);function fP(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var hP=function(e){Ho(n,e);var t=fP(n);function n(e){var i;return Bo(this,n),(i=t.call(this,e)).curTime=0,i.isPaused=!0,i}return Fo(n,[{key:"beforeCreate",value:function(e){var t=e.config.list;Array.isArray(t)&&t.length>0&&(e.config.list=t.map((function(e){return!e.text&&e.name&&(e.text=e.name),e.text||(e.text=e.definition),e})))}},{key:"afterCreate",value:function(){var e=this;uu(Vo(n.prototype),"afterCreate",this).call(this);var t=this.config,i=t.list,r=t.defaultDefinition,o=this.playerConfig.defaultConfig;i.forEach((function(e){e.definition!==r&&e.definition!==o||(e.selected=!0)})),this.on("resourceReady",(function(t){e.changeDefinitionList(t)})),this.on(R_,(function(t){e.renderItemList(e.config.list,t.to)})),this.player.definitionList.length<2&&this.hide()}},{key:"initDefinition",value:function(){var e=this.config,t=e.list,n=e.defaultDefinition,i=this.playerConfig.defaultConfig;if(t.length>0){var r=null;t.map((function(e){e.definition!==n&&e.definition!==i||(r=e,e.selected=!0)})),r||(r=t[0]),this.changeDefinition(r)}}},{key:"renderItemList",value:function(e,t){var i=this,r=t&&t.definition?t.definition:"";t&&!Array.isArray(t)&&e.forEach((function(e){e.selected=!1}));var o=0,a=e.map((function(e,t){var n={url:e.url,definition:e.definition||"",showText:i.getTextByLang(e)||e.definition,selected:!1};return(e.selected||!Ww.isUndefined(e.definition)&&e.definition===r)&&(n.selected=!0,o=t),n}));uu(Vo(n.prototype),"renderItemList",this).call(this,a,o)}},{key:"changeDefinitionList",value:function(e){if(Array.isArray(e)){var t=this.playerConfig,n=t.definition,i=t.defaultDefinition,r=n||this.config.defaultDefinition||"";this.config.list=e.map((function(e){return!e.text&&e.name&&(e.text=e.name),e.text||(e.text=e.definition),e.definition!==r&&e.definition!==i||(e.selected=!0),e})),n.list=e,this.renderItemList(e),this.config.list.length<2?this.hide():this.show()}}},{key:"changeDefinition",value:function(e,t){var n=this.player;n.switchURL?n.switchUrl(e.url):n.changeDefinition(e,t)}},{key:"onItemClick",value:function(e,t){var i=this.player.definitionList;uu(Vo(n.prototype),"onItemClick",this).apply(this,arguments),this.emitUserAction(e,"change_definition",{from:t.from,to:t.to});for(var r=0;r<i.length;r++)t.to&&i[r].definition===t.to.definition&&(t.to.url=i[r].url),t.from&&i[r].definition===t.from.definition&&(t.from.url=i[r].url);this.player.changeDefinition(t.to,t.from)}}],[{key:"pluginName",get:function(){return"definition"}},{key:"defaultConfig",get:function(){return{position:MC.CONTROLS_RIGHT,index:3,list:[],defaultDefinition:"",disable:!1,hidePortrait:!1,className:"xgplayer-definition",isShowIcon:!0}}}]),n}(lP);function dP(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var pP=function(e){Ho(n,e);var t=dP(n);function n(e){var i;return Bo(this,n),(i=t.call(this,e)).curRate=1,i}return Fo(n,[{key:"beforeCreate",value:function(e){var t=e.player.config.playbackRate,n=t?Array.isArray(t)?t:e.config.list:[];Array.isArray(n)&&(e.config.list=n.map((function(e){return"number"==typeof e?e={rate:e,text:"".concat(e,"x")}:!e.text&&e.rate&&(e.text="".concat(e.rate,"x")),e})))}},{key:"afterCreate",value:function(){var e=this;uu(Vo(n.prototype),"afterCreate",this).call(this),this.on(c_,(function(){e.curValue!==e.player.playbackRate&&e.renderItemList()})),this.renderItemList()}},{key:"show",value:function(){this.config.list&&0!==this.config.list.length&&uu(Vo(n.prototype),"show",this).call(this)}},{key:"onItemClick",value:function(e,t){uu(Vo(n.prototype),"onItemClick",this).apply(this,arguments);var i=e.delegateTarget,r=Number(i.getAttribute("rate"));if(!r||r===this.curValue)return!1;var o={playbackRate:{from:this.player.playbackRate,to:r}};this.emitUserAction(e,"change_rate",{props:o}),this.curValue=r,this.player.playbackRate=r}},{key:"renderItemList",value:function(){var e=this,t=this.player.playbackRate||1;this.curValue=t;var i=0,r=this.config.list.map((function(n,r){var o={rate:n.rate};return o.rate===t&&(o.selected=!0,i=r),o.showText=e.getTextByLang(n),o}));uu(Vo(n.prototype),"renderItemList",this).call(this,r,i)}},{key:"destroy",value:function(){uu(Vo(n.prototype),"destroy",this).call(this)}}],[{key:"pluginName",get:function(){return"playbackRate"}},{key:"defaultConfig",get:function(){return{position:MC.CONTROLS_RIGHT,index:4,list:[2,1.5,1,.75,.5],className:"xgplayer-playbackrate",isShowIcon:!0,hidePortrait:!1}}}]),n}(lP);function vP(){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 gP(){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}function yP(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var mP=function(e){Ho(n,e);var t=yP(n);function n(){return Bo(this,n),t.apply(this,arguments)}return Fo(n,[{key:"afterCreate",value:function(){var e=this;uu(Vo(n.prototype),"afterCreate",this).call(this),this.config.target&&(this.playerConfig.fullscreenTarget=this.config.target),this.initIcons(),this.on(E_,(function(t){e.animate(t)})),this.btnClick=this.btnClick.bind(this),this.handleCssFullscreen=this.hook("cssFullscreen_change",this.btnClick,{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.bind(["click","touchend"],this.handleCssFullscreen)}},{key:"initIcons",value:function(){var e=this.icons,t=this.find(".xgplayer-icon");t.appendChild(e.cssFullscreen),t.appendChild(e.exitCssFullscreen)}},{key:"btnClick",value:function(e){if(!this.config.disable){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;this.changeLangTextKey(this.find(".xg-tips"),e?t.EXITCSSFULLSCREEN_TIPS:t.CSSFULLSCREEN_TIPS)}},{key:"registerIcons",value:function(){return{cssFullscreen:{icon:vP,class:"xg-get-cssfull"},exitCssFullscreen:{icon:gP,class:"xg-exit-cssfull"}}}},{key:"destroy",value:function(){uu(Vo(n.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.btnClick)}},{key:"render",value:function(){return'<xg-icon class=\'xgplayer-cssfullscreen\'>\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys.CSSFULLSCREEN_TIPS,'">').concat(this.i18n.CSSFULLSCREEN_TIPS,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"cssFullscreen"}},{key:"defaultConfig",get:function(){return{position:MC.CONTROLS_RIGHT,index:1,disable:!1,target:null}}}]),n}(IT);function kP(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var bP=function(e){Ho(n,e);var t=kP(n);function n(){return Bo(this,n),t.apply(this,arguments)}return Fo(n,[{key:"afterCreate",value:function(){var e=this;this.clickHandler=this.hook("errorRetry",this.errorRetry,{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.onError=this.hook("errorHandler",this.handleError),this.bind(".xgplayer-error-refresh","click",this.clickHandler),this.on(i_,(function(){e.handleCanPlay()})),this.on(Zw,(function(t){e.onError(t)}))}},{key:"errorRetry",value:function(e){this.emitUserAction(e,"error_retry",{}),this.player.retry()}},{key:"handleCanPlay",value:function(){Ww.removeClass(this.player.root,"xgplayer-is-error")}},{key:"handleError",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.player,n=e.errorType,i=t.error;if(!i)switch(n){case"decoder":i=this.i18n.MEDIA_ERR_DECODE;break;case"network":i=this.i18n.MEDIA_ERR_NETWORK;break;default:i=this.i18n.MEDIA_ERR_SRC_NOT_SUPPORTED}this.find(".xgplayer-error-text").innerHTML=i,this.find(".xgplayer-error-tips").innerHTML="".concat(this.i18n.REFRESH_TIPS,'<span class="xgplayer-error-refresh">').concat(this.i18n.REFRESH,"</span>")}},{key:"destroy",value:function(){this.unbind(".xgplayer-error-refresh","click",this.clickHandler)}},{key:"render",value:function(){return'<xg-error class="xgplayer-error">\n <div class="xgplayer-errornote">\n <span class="xgplayer-error-text"></span>\n <span class="xgplayer-error-tips"><em class="xgplayer-error-refresh"></em></span>\n </div>\n </xg-error>'}}],[{key:"pluginName",get:function(){return"error"}}]),n}(HC);function wP(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var _P=function(e){Ho(n,e);var t=wP(n);function n(){return Bo(this,n),t.apply(this,arguments)}return Fo(n,[{key:"afterCreate",value:function(){var e=this;this.intervalId=0,this.customConfig=null,this.bind(".highlight",["click","touchend"],(function(t){(e.config.onClick||e.customOnClick)&&(t.preventDefault(),t.stopPropagation(),e.customOnClick?e.customOnClick(t):e.config.onClick(t))})),this.player.showPrompt=function(){e.show.apply(e,arguments)},this.player.hidePrompt=function(){e.hide()}}},{key:"setStyle",value:function(e){var t=this;Object.keys(e).map((function(n){t.root.style[n]=e[n]}))}},{key:"show",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(e){this.customOnClick=i;var r=this.config.interval;if(this.intervalId&&(clearTimeout(this.intervalId),this.intervalId=null),n.style&&this.setStyle(n.style),this.find(".xgplayer-prompt-detail").innerHTML="string"==typeof e?e:"".concat(e.text||"")+"".concat(e.highlight?'<i class="highlight">'.concat(e.highlight,"</i>"):""),"arrow"===n.mode&&Ww.addClass(this.root,"arrow"),n.preventScreenOverflow){var o=this.root.getBoundingClientRect(),a=o.left,s=o.right,c=document.documentElement.clientWidth||document.body.clientWidth;if(a<0){var u=Number((Math.abs(a)/c*100).toFixed(2));if(n.style.left){var l=parseInt(n.style.left);this.setStyle({left:"".concat(l+u+.5,"%")})}}if(s>=c){var f=Number(((Math.abs(s)-c)/c*100).toFixed(2));if(n.style.left){var h=parseInt(n.style.left);this.setStyle({left:"".concat(h-f-.5,"%")})}}}if(Ww.addClass(this.root,"show"),"boolean"==typeof n.autoHide?n.autoHide:this.config.autoHide){var d=n.interval||r;this.intervalId=setTimeout((function(){t.hide()}),d)}}}},{key:"hide",value:function(){this.root&&(Ww.removeClass(this.root,"show"),Ww.removeClass(this.root,"arrow"),this.root.removeAttribute("style")),this.customOnClick=null}},{key:"render",value:function(){return'<xg-prompt class="xgplayer-prompt '.concat(QC.CONTROLS_FOLLOW,'">\n <span class="xgplayer-prompt-detail"></span>\n </xg-prompt>')}}],[{key:"pluginName",get:function(){return"prompt"}},{key:"defaultConfig",get:function(){return{interval:3e3,style:{},mode:"arrow",autoHide:!0,preventScreenOverflow:!1,detail:{text:"",highlight:""},onClick:function(){}}}}]),n}(HC),CP=_P,xP={time:0,text:"",id:1,duration:1,color:"#fff",style:{},width:6,height:6};function SP(e){Object.keys(xP).map((function(t){void 0===e[t]&&(e[t]=xP[t])}))}var TP={initDots:function(){this.createDots(this._ispots,!1),this._ispotsInit=!0},createDots:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Array.isArray(t)&&t.length){var i=this.player.plugins.progress;if(i&&i.outer){var r=document.createDocumentFragment();t.forEach((function(t){var i=e._createDotElement(t,n);i&&r.appendChild(i)})),i.outer.appendChild(r)}}},createDot:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this._createDotElement(e,t);if(n){var i=this.player.plugins.progress;i.outer&&i.outer.appendChild(n)}},_createDotElement:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!this.player.plugins.progress)return null;if(t&&(SP(e),this._ispots.push(e)),!this._ispotsInit&&t)return null;var n=this.calcuPosition(e.time,e.duration),i=e.style||{},r=e.stylePreferred;i.left=r&&void 0!==i.left?i.left:"".concat(n.left,"%"),i.width=r&&void 0!==i.width?i.width:"".concat(n.width,"%");var o="xgspot_".concat(e.id," xgplayer-spot");n.isMini&&(o+=" mini");var a=Ww.createDom("xg-spot",e.template||"",{"data-text":e.text,"data-time":e.time,"data-id":e.id},o);return Object.keys(i).forEach((function(e){a.style[e]=i[e]})),a},findDot:function(e){if(this.player.plugins.progress){var t=this._ispots.filter((function(t,n){return t.id===e}));return t.length>0?t[0]:null}},updateDot:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.player.plugins.progress;if(n){var i=this.findDot(e.id);if(i&&Object.keys(e).map((function(t){i[t]=e[t]})),this._ispotsInit){var r=n.find('xg-spot[data-id="'.concat(e.id,'"]'));if(r){var o=this.calcuPosition(e.time,e.duration),a=e.style||{};a.left="".concat(o.left,"%"),a.width="".concat(o.width,"%"),r.setAttribute("data-text",e.text),r.setAttribute("data-time",e.time),o.isMini?Ww.addClass(r,"mini"):Ww.removeClass(r,"mini"),Object.keys(a).map((function(e){r.style[e]=a[e]})),t&&this.showDot(e.id)}}}},deleteDot:function(e){var t=this._ispots,n=this.player.plugins.progress;if(n){for(var i=[],r=0;r<t.length;r++)t[r].id===e&&i.push(r);for(var o=i.length-1;o>=0;o--)if(t.splice(i[o],1),this._ispotsInit){var a=n.find('xg-spot[data-id="'.concat(e,'"]'));a&&a.parentElement.removeChild(a)}}},deleteAllDots:function(){var e=this.player.plugins.progress;if(e)if(this._ispotsInit){for(var t=e.root.getElementsByTagName("xg-spot"),n=t.length-1;n>=0;n--)e.outer.removeChild(t[n]);this._ispots=[]}else this._ispots=[]},updateAllDots:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=this.player.plugins.progress;if(n)if(this._ispotsInit){this._ispots=[];var i=n.root.getElementsByTagName("xg-spot"),r=i.length;if(r>t.length)for(var o=r-1;o>t.length-1;o--)n.outer.removeChild(i[o]);t.map((function(t,n){n<r?(i[n].setAttribute("data-id","".concat(t.id)),e._ispots.push(t),e.updateDot(t)):e.createDot(t)}))}else this._ispots=t},updateAllDotsStyles:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=this.player.plugins.progress;if(null!=n&&n.root)for(var i,r=n.root.getElementsByTagName("xg-spot"),o=function(n){var o=(n=r[a]).getAttribute("data-id"),s=e.findDot(o);if(s&&s.activeStyle&&s.style&&s.stylePreferred){var c=t?null==s?void 0:s.activeStyle:null==s?void 0:s.style;c&&Object.keys(c).map((function(e){n.style[e]=c[e]}))}i=n},a=0;a<r.length;a++)o(i)},getAllDotsDom:function(){var e=this.player.plugins.progress;return e?e.root.getElementsByTagName("xg-spot"):[]},getDotDom:function(e){var t=this.player.plugins.progress;if(t)return t.find('xg-spot[data-id="'.concat(e,'"]'))}};function EP(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var PP={dragmove:"onProgressDragMove",dragstart:"onProgressDragStart",dragend:"onProgressDragEnd",click:"onProgressClick",mouseover:"onProgressMouseOver",mouseenter:"onProgressMouseEnter",mouseleave:"onProgressMouseLeave"},RP=function(e){Ho(n,e);var t=EP(n);function n(e){var i;return Bo(this,n),Go(Uo(i=t.call(this,e)),"onMousemove",(function(e){i.config.disable||(Ww.hasClass(e.target,"xg-spot-content")&&i.config.isHideThumbnailHover?i.player.plugins.progress.onMouseLeave(e):(i._state.f||Ww.hasClass(e.target,"xg-spot-content"))&&(Ww.event(e),e.stopPropagation()))})),Go(Uo(i),"onMousedown",(function(e){i.config.disable||(i._state.f||Ww.hasClass(e.target,"xg-spot-content"))&&(Ww.event(e),e.stopPropagation())})),Go(Uo(i),"onMouseup",(function(e){if(i.isDrag){var t=i.player.plugins.progress;t&&t.pos&&(t.onMouseUp(e),!t.pos.isEnter&&t.onMouseLeave(e))}})),Go(Uo(i),"onDotMouseLeave",(function(e){if(!i.config.disable){i._curDot.removeEventListener("mouseleave",i.onDotMouseLeave),i.blurDot(e.target),i._curDot=null;var t=i.player.plugins.progress;t&&t.enableBlur(),i.show()}})),Go(Uo(i),"onProgressMouseLeave",(function(e,t){i.updateAllDotsStyles(!1)})),Go(Uo(i),"onProgressMouseOver",(function(e,t){var n;if(!i.config.disable&&i.player){var r=t.target,o=i.player.plugins.progress,a=!(null==o||null===(n=o.config)||void 0===n||!n.resetBlur);if(Ww.hasClass(r,"xgplayer-spot")&&(!i._curDot||a&&!i._curDot.contains(r)&&i._curDot!==r)){var s=i._curDot;i._curDot=r,null==s||s.removeEventListener("mouseleave",i.onDotMouseLeave),i._curDot.addEventListener("mouseleave",i.onDotMouseLeave),i.focusDot(r),i._curDot.children.length>0&&i.hide(),null==o||o.disableBlur()}else a&&(null==o||o.enableBlur())}})),i._ispots=[],i.videoPreview=null,i.videothumbnail=null,i.thumbnail=null,i._state={now:0,f:!1},i}return Fo(n,[{key:"beforeCreate",value:function(e){var t=e.player.plugins.progress;t&&(e.root=t.root)}},{key:"afterCreate",value:function(){var e=this;this._curDot=null,this.handlerSpotClick=this.hook("spotClick",(function(t,n){n.time&&e.player.seek(n.time)})),function(e){var t=e.config,n=e.player;Object.keys(TP).map((function(t){e[t]=TP[t].bind(e)}));var i=n.config.progressDot||t.ispots||[];e._ispots=i.map((function(e){return SP(e),e})),e._ispotsInit=!1,n.once(r_,(function(){e.initDots()}))}(this),this.config.disable&&this.disable(),this.extTextRoot=this.find(".xg-spot-ext-text")}},{key:"setConfig",value:function(e){var t=this;e&&Object.keys(e).map((function(n){t.config[n]=e[n]}))}},{key:"onPluginsReady",value:function(){this.player.plugins.progress&&(this.previewLine=this.find(".xg-spot-line"),this.timePoint=this.find(".xgplayer-progress-point"),this.timeText=this.find(".xg-spot-time"),this.tipText=this.find(".spot-inner-text"),this._hasThumnail=!1,this.registerThumbnail(),this.bindEvents())}},{key:"bindEvents",value:function(){var e=this,t=this.player.plugins.progress;if(t&&(Object.keys(PP).map((function(n){e[PP[n]]=e[PP[n]].bind(e),t.addCallBack(n,e[PP[n]])})),"mobile"!==$_.device)){this.bind(".xg-spot-info","mousemove",this.onMousemove),this.bind(".xg-spot-info","mousedown",this.onMousedown),this.bind(".xg-spot-info","mouseup",this.onMouseup);var n=this.hook("previewClick",(function(){}));this.handlerPreviewClick=function(t){t.stopPropagation(),n(parseInt(1e3*e._state.now,10)/1e3,t)},this.bind(".xg-spot-content","mouseup",this.handlerPreviewClick)}}},{key:"onProgressMouseEnter",value:function(e,t){this.onProgressMove(e,t),this.updateAllDotsStyles(!0)}},{key:"onProgressMove",value:function(e,t){!this.config.disable&&this.player.duration&&this.updatePosition(e.offset,e.width,e.currentTime,e.e)}},{key:"onProgressDragMove",value:function(e,t){!this.config.disable&&this.player.duration&&this.onProgressMove(e,t)}},{key:"onProgressDragStart",value:function(e){!this.config.disable&&this.player.duration&&(this.isDrag=!0,this.videoPreview&&Ww.addClass(this.videoPreview,"show"))}},{key:"onProgressDragEnd",value:function(e){!this.config.disable&&this.player.duration&&(this.isDrag=!1,this.videoPreview&&Ww.removeClass(this.videoPreview,"show"))}},{key:"onProgressClick",value:function(e,t){if(!this.config.disable&&Ww.hasClass(t.target,"xgplayer-spot")){t.stopPropagation(),t.preventDefault();var n={};["time","id","text"].map((function(e){n[e]=t.target.getAttribute("data-".concat(e))})),n.time&&(n.time=Number(n.time)),this.handlerSpotClick(t,n)}}},{key:"updateLinePos",value:function(e,t){var n=this.root,i=this.previewLine,r=this.timePoint,o=this.player,a=this.config,s="flex"===o.controls.mode,c=n.getBoundingClientRect().width;if(c||!this._hasThumnail){var u,l,f=r.getBoundingClientRect().width,h=e-(c=this._hasThumnail&&c<a.width?a.width:c)/2;h<0&&!s?(h=0,u=e-c/2,!this.thumbnail&&(l=e-c/2-f/2)):h>t-c&&!s?(u=h-(t-c),!this.thumbnail&&(l=h-(t-c)-f/2),h=t-c):(u=0,!this.thumbnail&&(l=-f/2)),void 0!==u&&(i.style.transform="translateX(".concat(u.toFixed(2),"px)")),void 0!==l&&(r.style.transform="translateX(".concat(l.toFixed(2),"px)")),n.style.transform="translateX(".concat(h.toFixed(2),"px) translateZ(0)")}}},{key:"updateTimeText",value:function(e){var t=this.timeText,n=this.timePoint;t.textContent=e,!this.thumbnail&&(n.textContent=e)}},{key:"updatePosition",value:function(e,t,n,i){var r=this.root,o=this.config,a=this._state;if(r){this.updateLinePos(e,t),a.now=n;var s=Ww.format(n);i&&i.target&&Ww.hasClass(i.target,"xgplayer-spot")?(this.showTips(i.target.getAttribute("data-text"),!1,s),this.focusDot(i.target),a.f=!0,o.isFocusDots&&a.f&&(a.now=parseInt(i.target.getAttribute("data-time"),10))):o.defaultText?(a.f=!1,this.showTips(o.defaultText,!0,s)):(a.f=!1,this.hideTips("")),this.updateTimeText(s),this.updateThumbnails(a.now)}}},{key:"updateThumbnails",value:function(e){var t=this.player,n=this.videoPreview,i=this.config,r=t.plugins.thumbnail;if(r&&r.usable){this.thumbnail&&r.update(this.thumbnail,e,i.width,i.height);var o=n&&n.getBoundingClientRect();this.videothumbnail&&r.update(this.videothumbnail,e,o.width,o.height)}}},{key:"registerThumbnail",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("mobile"!==$_.device){var t=this.player,n=this.config,i=t.getPlugin("thumbnail");if(i&&i.setConfig(e),i&&i.usable&&n.isShowThumbnail){Ww.removeClass(this.root,"short-line no-thumbnail"),"short"===n.mode&&Ww.addClass(this.root,"short-line"),this._hasThumnail=!0;var r=this.find(".xg-spot-thumbnail");this.thumbnail=i.createThumbnail(r,"progress-thumbnail"),n.isShowCoverPreview&&(this.videoPreview=Ww.createDom("xg-video-preview","",{},"xgvideo-preview"),t.root.appendChild(this.videoPreview),this.videothumbnail=i.createThumbnail(this.videoPreview,"xgvideo-thumbnail")),this.updateThumbnails(0)}else Ww.addClass(this.root,"short-line no-thumbnail")}}},{key:"calcuPosition",value:function(e,t){var n=this.player.plugins.progress,i=this.player;e+t>i.duration&&(t=i.duration-e);var r={left:e/i.duration*100,width:t/i.duration*100,isMini:!1};if(this.config.isDotAdaptWidth){var o=0;if(i.duration>0){var a=n.root.getBoundingClientRect().width;o=i.duration/a*6}r.isMini=o>t}else r.isMini=!0;return r}},{key:"showDot",value:function(e){var t=this.findDot(e);if(t){var n=this.root.getBoundingClientRect().width,i=t.time/this.player.duration*n;this.updatePosition(i,n,t.time)}}},{key:"focusDot",value:function(e,t){e&&(t||(t=e.getAttribute("data-id")),Ww.addClass(e,"active"),this._activeDotId=t)}},{key:"blurDot",value:function(e){if(!e){var t=this._activeDotId;e=this.getDotDom(t)}e&&(Ww.removeClass(e,"active"),this._activeDotId=null)}},{key:"showTips",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";Ww.addClass(this.root,"no-timepoint"),e&&(Ww.addClass(this.find(".xg-spot-content"),"show-text"),t&&"production"===this.config.mode?(Ww.addClass(this.root,"product"),this.tipText.textContent=e):(Ww.removeClass(this.root,"product"),this.tipText.textContent=this._hasThumnail?e:"".concat(n," ").concat(e)))}},{key:"hideTips",value:function(){Ww.removeClass(this.root,"no-timepoint"),this.tipText.textContent="",Ww.removeClass(this.find(".xg-spot-content"),"show-text"),Ww.removeClass(this.root,"product")}},{key:"hide",value:function(){Ww.addClass(this.root,"hide")}},{key:"show",value:function(){Ww.removeClass(this.root,"hide")}},{key:"enable",value:function(){var e=this.config,t=this.playerConfig;this.config.disable=!1,this.show(),!this.thumbnail&&e.isShowThumbnail&&this.registerThumbnail(t.thumbnail||{})}},{key:"disable",value:function(){this.config.disable=!0,this.hide()}},{key:"destroy",value:function(){var e=this,t=this.player.plugins.progress;t&&Object.keys(PP).map((function(n){t.removeCallBack(n,e[PP[n]])})),this.videothumbnail=null,this.thumbnail=null,this.videoPreview&&this.player.root.removeChild(this.videoPreview),this.unbind(".xg-spot-info","mousemove",this.onMousemove),this.unbind(".xg-spot-info","mousedown",this.onMousedown),this.unbind(".xg-spot-info","mouseup",this.onMouseup),this.unbind(".xg-spot-content","mouseup",this.handlerPreviewClick)}},{key:"render",value:function(){return"mobile"===$_.device||"mobile"===this.playerConfig.isMobileSimulateMode?"":'<div class="xg-spot-info '.concat("short"===this.config.mode?"short-line":"",'">\n <div class="xg-spot-content">\n <div class="xg-spot-thumbnail">\n <span class="xg-spot-time"></span>\n </div>\n <div class="xg-spot-text"><span class="spot-inner-text"></span></div>\n </div>\n <div class="xgplayer-progress-point">00:00</div>\n <div class="xg-spot-ext-text"></div>\n <div class="xg-spot-line"></div>\n </div>')}}],[{key:"pluginName",get:function(){return"progresspreview"}},{key:"defaultConfig",get:function(){return{index:1,miniWidth:6,ispots:[],defaultText:"",isFocusDots:!0,isHideThumbnailHover:!0,isShowThumbnail:!0,isShowCoverPreview:!1,mode:"",disable:!1,width:160,height:90,isDotAdaptWidth:!0}}}]),n}(HC);function OP(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var IP=function(e){Ho(n,e);var t=OP(n);function n(e){var i;return Bo(this,n),(i=t.call(this,e)).ratio=1,i.interval=null,i._preloadMark={},i}return Fo(n,[{key:"afterCreate",value:function(){var e=this;this.usable&&this.initThumbnail(),this.on([r_],(function(){var t=e.config,n=t.pic_num,i=t.interval;e.usable&&(e.interval=i>0?i:Math.round(1e3*e.player.duration/n)/1e3)}))}},{key:"setConfig",value:function(e){var t=this;if(e){var n=Object.keys(e);n.length<1||(n.forEach((function(n){t.config[n]=e[n]})),this.usable&&this.initThumbnail())}}},{key:"usable",get:function(){var e=this.config,t=e.urls,n=e.pic_num;return t&&t.length>0&&n>0}},{key:"initThumbnail",value:function(){var e=this.config,t=e.width,n=e.height,i=e.pic_num,r=e.interval;this.ratio=t/n*100,this.interval=r||Math.round(this.player.duration/i),this._preloadMark={}}},{key:"getUrlByIndex",value:function(e){return e>=0&&e<this.config.urls.length?this.config.urls[e]:""}},{key:"preload",value:function(e){var t=this;if(!this._preloadMark[e]){var n=this.config.urls,i=n.length,r=[];e>0&&r.push(e-1),r.push(e),e>0&&e<i-1&&r.push(e+1),r.map((function(e){!t._preloadMark[e]&&e>=0&&e<i&&(t._preloadMark[e]=1,Ww.preloadImg(n[e],(function(){t._preloadMark[e]=2})))}))}}},{key:"getPosition",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.config,r=i.pic_num,o=i.row,a=i.col,s=i.width,c=i.height;this.interval=Math.round(this.player.duration/r);var u=Math.ceil(e/this.interval),l=(u=u>r?r:u)<o*a?0:Math.ceil(u/(o*a))-1,f=u-l*(a*o),h=f>0?Math.ceil(f/a)-1:0,d=f>0?f-h*a-1:0,p=0,v=0;t&&n?t/n<s/c?p=(v=n)*(s/c):v=(p=t)/(s/c):n?t||(p=(v=n||c)*(s/c)):v=(p=t||s)/(s/c);var g=this.getUrlByIndex(l);return{urlIndex:l,rowIndex:h,colIndex:d,url:g,height:v,width:p,style:{backgroundImage:"url(".concat(g,")"),backgroundSize:"".concat(p*a,"px auto"),backgroundPosition:"-".concat(d*p,"px -").concat(h*v,"px"),width:"".concat(p,"px"),height:"".concat(v,"px")}}}},{key:"update",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",o=this.config,a=o.pic_num,s=o.urls;if(!(a<=0)&&s&&0!==s.length){var c=this.getPosition(t,n,i);this.preload(c.urlIndex),Object.keys(c.style).map((function(t){e.style[t]=c.style[t]})),Object.keys(r).map((function(t){e.style[t]=r[t]}))}}},{key:"changeConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.setConfig(e)}},{key:"createThumbnail",value:function(e,t){var n=Ww.createDom("xg-thumbnail","",{},"thumbnail ".concat(t));return e&&e.appendChild(n),n}}],[{key:"pluginName",get:function(){return"thumbnail"}},{key:"defaultConfig",get:function(){return{isShow:!1,urls:[],pic_num:0,col:0,row:0,height:90,width:160,scale:1,className:"",hidePortrait:!1}}}]),n}(HC);function LP(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var AP=function(e){Ho(n,e);var t=LP(n);function n(){return Bo(this,n),t.apply(this,arguments)}return Fo(n,[{key:"afterCreate",value:function(){}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{cached:0,played:0},t=arguments.length>1?arguments[1]:void 0;t&&this.root&&(e.cached&&(this.find("xg-mini-progress-cache").style.width="".concat(e.cached/t*100,"%")),e.played&&(this.find("xg-mini-progress-played").style.width="".concat(e.played/t*100,"%")))}},{key:"render",value:function(){if(this.playerConfig.progress&&this.playerConfig.miniprogress)return'<xg-mini-progress class="xg-mini-progress">\n <xg-mini-progress-cache class="xg-mini-progress-cache"></xg-mini-progress-cache>\n <xg-mini-progress-played class="xg-mini-progress-played"></xg-mini-progress-played>\n </xg-mini-progress>'}}],[{key:"pluginName",get:function(){return"MiniProgress"}},{key:"defaultConfig",get:function(){return{}}}]),n}(HC),DP=AP;function MP(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var NP="realtime",FP="firstframe",BP="poster";var jP=null,HP=function(e){Ho(n,e);var t=MP(n);function n(){var e;Bo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Uo(e=t.call.apply(t,[this].concat(r))),"onLoadedData",(function(t){e.player&&(e._frameCount=e.config.startFrameCount,e.stop(),e.renderOnTimeupdate(t),e.off(t_,e.renderOnTimeupdate),e.on(t_,e.renderOnTimeupdate))})),Go(Uo(e),"onVisibilitychange",(function(t){"visible"===document.visibilityState?e._checkIfCanStart()&&e.start():"hidden"===document.visibilityState&&e.stop()})),Go(Uo(e),"renderOnTimeupdate",(function(t){if(e._frameCount>0)e.renderOnce(),e._frameCount--;else{e._isLoaded=!0,e.off(t_,e.renderOnTimeupdate);var n=e.config.startInterval;!e.player.paused&&e._checkIfCanStart()&&e.start(0,n)}})),Go(Uo(e),"start",(function(t,n){var i=e.player.video,r=function(){try{return parseInt(window.performance.now(),10)}catch(e){return(new Date).getTime()}}(),o=e.checkVideoIsSupport(i);o&&e.canvasCtx&&(n||(n=e.interval),e.stop(),i.videoWidth&&i.videoHeight&&(e.videoPI=i.videoHeight>0?parseInt(i.videoWidth/i.videoHeight*100,10):0,(e.config.mode===NP||r-e.preTime>=n)&&(i&&i.videoWidth&&e.update(o,e.videoPI),e.preTime=r)),e.frameId="timer"===e._loopType?Ww.setTimeout(Uo(e),e.start,n):Ww.requestAnimationFrame(e.start))})),Go(Uo(e),"stop",(function(){e.frameId&&("timer"===e._loopType?Ww.clearTimeout(Uo(e),e.frameId):Ww.cancelAnimationFrame(e.frameId),e.frameId=null)})),e}return Fo(n,[{key:"afterCreate",value:function(){var e=this;!0===this.playerConfig.dynamicBg&&(this.config.disable=!1),n.isSupport||(this.config.disable=!0);var t=this.config,i=t.disable,r=t.mode,o=t.frameRate;if(!i){this._pos={width:0,height:0,rwidth:0,rheight:0,x:0,y:0,pi:0},this.isStart=!1,this._isLoaded=!1,this.videoPI=0,this.preTime=0,this.interval=parseInt(1e3/o,10),this.canvas=null,this.canvasCtx=null,this._frameCount=0,this._loopType=this.config.mode!==NP&&this.interval>=1e3?"timer":"animation";var a=function(){e.player&&(e.init(),e.renderByPoster(),e.player.paused||e.start())};this.player.hasStart?a():this.once(m_,a),r!==BP&&(r!==FP&&(this.on(f_,(function(){e.stop()})),this.on(qw,(function(){var t=e.config.startInterval;e._checkIfCanStart()&&e.start(0,t)})),this.on(Jw,(function(){e.stop()}))),this.on(a_,this.onLoadedData),this.on(l_,(function(){e._isLoaded=!1,e.stop()})),document.addEventListener("visibilitychange",this.onVisibilitychange))}}},{key:"setConfig",value:function(e){var t=this;Object.keys(e).forEach((function(n){"root"===n&&e[n]!==t.config[n]?t.reRender(e[n]):"frameRate"===n?t.interval=parseInt(1e3/e[n],10):"disable"===n&&e[n]&&t.stop(),t.config[n]=e[n]}))}},{key:"init",value:function(e){var t=this.player,i=this.config;this.canvasFilter=n.supportCanvasFilter();try{var r=e||i.root;r||(r=i.isInnerRender&&t.innerContainer||t.root),r.insertAdjacentHTML("afterbegin",'<div class="xgplayer-dynamic-bg" data-index="'.concat(i.index,'"><canvas>\n </canvas><xgmask></xgmask></div>')),this.root=r.children[0],this.canvas=this.find("canvas"),this.canvasFilter||(this.canvas.style.filter=i.filter,this.canvas.style.webkitFilter=i.filter),this.mask=this.find("xgmask"),i.addMask&&(this.mask.style.background=i.maskBg),this.canvasCtx=this.canvas.getContext("2d")}catch(e){Hw.logError("plugin:DynamicBg",e)}}},{key:"reRender",value:function(e){if(this.config.disable||this.root){this.stop();var t=this.root?this.root.parentElement:null;if(t!==e&&t.removeChild(this.root),e){this.init(e),this.renderOnce();var n=this.config.startInterval;this._checkIfCanStart()&&this.start(0,n)}else this.root=null}}},{key:"checkVideoIsSupport",value:function(e){if(!e)return null;var t=e&&e instanceof window.HTMLVideoElement?e:e.canvas?e.canvas:e.flyVideo?e.flyVideo:null;if(t&&("safari"!==$_.browser||!Ww.isMSE(t)))return t;var n=t?t.tagName.toLowerCase():"";return"canvas"===n||"img"===n?t:null}},{key:"renderByPoster",value:function(){var e=this.playerConfig.poster;if(e){var t="String"===Ww.typeOf(e)?e:"String"===Ww.typeOf(e.poster)?e.poster:null;this.updateImg(t)}}},{key:"_checkIfCanStart",value:function(){var e=this.config.mode;return this._isLoaded&&!this.player.paused&&e!==FP&&e!==BP}},{key:"renderOnce",value:function(){var e=this.player.video;if(e.videoWidth&&e.videoHeight){this.videoPI=parseInt(e.videoWidth/e.videoHeight*100,10);var t=this.checkVideoIsSupport(e);t&&this.update(t,this.videoPI)}}},{key:"updateImg",value:function(e){var t=this;if(e){var n=this.canvas.getBoundingClientRect(),i=n.width,r=n.height,o=new window.Image;o.onload=function(){if(t.canvas&&!t.frameId&&!t.isStart){t.canvas.height=r,t.canvas.width=i;var e=parseInt(i/r*100,10);t.update(o,e),o=null}},o.src=e}}},{key:"update",value:function(e,t){if(this.canvas&&this.canvasCtx&&t)try{var n=this._pos,i=this.config,r=this.canvas.getBoundingClientRect(),o=r.width,a=r.height;if(o!==n.width||a!==n.height||n.pi!==t){var s=parseInt(o/a*100,10);n.pi=t,n.width!==o&&(n.width=this.canvas.width=o),n.height!==a&&(n.height=this.canvas.height=a);var c=a,u=o;s<t?u=parseInt(a*t/100,10):s>t&&(c=parseInt(100*o/t,10)),n.rwidth=u*i.multiple,n.rheight=c*i.multiple,n.x=(o-n.rwidth)/2,n.y=(a-n.rheight)/2}this.canvasFilter&&(this.canvasCtx.filter=i.filter),this.canvasCtx.drawImage(e,n.x,n.y,n.rwidth,n.rheight)}catch(e){Hw.logError("plugin:DynamicBg",e)}}},{key:"destroy",value:function(){this.stop(),document.removeEventListener("visibilitychange",this.onVisibilitychange),this.canvasCtx=null,this.canvas=null}},{key:"render",value:function(){return""}}],[{key:"pluginName",get:function(){return"dynamicBg"}},{key:"defaultConfig",get:function(){return{isInnerRender:!1,disable:!0,index:-1,mode:"framerate",frameRate:10,filter:"blur(50px)",startFrameCount:2,startInterval:0,addMask:!0,multiple:1.2,maskBg:"rgba(0,0,0,0.7)"}}},{key:"isSupport",get:function(){return"boolean"==typeof jP?jP:jP=function(){try{return!!document.createElement("canvas").getContext}catch(e){return!1}}()}},{key:"supportCanvasFilter",value:function(){return!("safari"===$_.browser||"firefox"===$_.browser)}}]),n}(HC),UP=HP,WP=d,VP=fe,GP=ie("iterator"),KP=!WP((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,n="";return e.pathname="c%20d",t.forEach((function(e,i){t.delete("b"),n+=i+e})),!t.size&&!VP||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[GP]||"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"!==n||"x"!==new URL("http://x",void 0).host})),zP=k,YP=2147483647,qP=/[^\0-\u007E]/,XP=/[.\u3002\uFF0E\uFF61]/g,$P="Overflow: input needs wider integers to process",JP=RangeError,ZP=zP(XP.exec),QP=Math.floor,eR=String.fromCharCode,tR=zP("".charCodeAt),nR=zP([].join),iR=zP([].push),rR=zP("".replace),oR=zP("".split),aR=zP("".toLowerCase),sR=function(e){return e+22+75*(e<26)},cR=function(e,t,n){var i=0;for(e=n?QP(e/700):e>>1,e+=QP(e/t);e>455;)e=QP(e/35),i+=36;return QP(i+36*e/(e+38))},uR=function(e){var t=[];e=function(e){for(var t=[],n=0,i=e.length;n<i;){var r=tR(e,n++);if(r>=55296&&r<=56319&&n<i){var o=tR(e,n++);56320==(64512&o)?iR(t,((1023&r)<<10)+(1023&o)+65536):(iR(t,r),n--)}else iR(t,r)}return t}(e);var n,i,r=e.length,o=128,a=0,s=72;for(n=0;n<e.length;n++)(i=e[n])<128&&iR(t,eR(i));var c=t.length,u=c;for(c&&iR(t,"-");u<r;){var l=YP;for(n=0;n<e.length;n++)(i=e[n])>=o&&i<l&&(l=i);var f=u+1;if(l-o>QP((YP-a)/f))throw JP($P);for(a+=(l-o)*f,o=l,n=0;n<e.length;n++){if((i=e[n])<o&&++a>YP)throw JP($P);if(i==o){for(var h=a,d=36;;){var p=d<=s?1:d>=s+26?26:d-s;if(h<p)break;var v=h-p,g=36-p;iR(t,eR(sR(p+v%g))),h=QP(v/g),d+=36}iR(t,eR(sR(h))),s=cR(a,f,u==c),a=0,u++}}a++,o++}return nR(t,"")},lR=En,fR=fr,hR=n,dR=Pe,pR=k,vR=fe,gR=KP,yR=En,mR=ha,kR=function(e,t,n){for(var i in t)lR(e,i,t[i],n);return e},bR=Pa,wR=yg,_R=on,CR=tf,xR=ue,SR=R,TR=Ma,ER=Bn,PR=Se,RR=pe,OR=Yo,IR=ko,LR=Nt,AR=zd,DR=jd,MR=uf,NR=lw,FR=ie("iterator"),BR="URLSearchParams",jR=BR+"Iterator",HR=_R.set,UR=_R.getterFor(BR),WR=_R.getterFor(jR),VR=Object.getOwnPropertyDescriptor,GR=function(e){if(!vR)return hR[e];var t=VR(hR,e);return t&&t.value},KR=GR("fetch"),zR=GR("Request"),YR=GR("Headers"),qR=zR&&zR.prototype,XR=YR&&YR.prototype,$R=hR.RegExp,JR=hR.TypeError,ZR=hR.decodeURIComponent,QR=hR.encodeURIComponent,eO=pR("".charAt),tO=pR([].join),nO=pR([].push),iO=pR("".replace),rO=pR([].shift),oO=pR([].splice),aO=pR("".split),sO=pR("".slice),cO=/\+/g,uO=Array(4),lO=function(e){return uO[e-1]||(uO[e-1]=$R("((?:%[\\da-f]{2}){"+e+"})","gi"))},fO=function(e){try{return ZR(e)}catch(t){return e}},hO=function(e){var t=iO(e,cO," "),n=4;try{return ZR(t)}catch(e){for(;n;)t=iO(t,lO(n--),fO);return t}},dO=/[!'()~]|%20/g,pO={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},vO=function(e){return pO[e]},gO=function(e){return iO(QR(e),dO,vO)},yO=wR((function(e,t){HR(this,{type:jR,iterator:AR(UR(e).entries),kind:t})}),"Iterator",(function(){var e=WR(this),t=e.kind,n=e.iterator.next(),i=n.value;return n.done||(n.value="keys"===t?i.key:"values"===t?i.value:[i.key,i.value]),n}),!0),mO=function(e){this.entries=[],this.url=null,void 0!==e&&(RR(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===eO(e,0)?sO(e,1):e:OR(e)))};mO.prototype={type:BR,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,n,i,r,o,a,s,c=DR(e);if(c)for(n=(t=AR(e,c)).next;!(i=dR(n,t)).done;){if(o=(r=AR(PR(i.value))).next,(a=dR(o,r)).done||(s=dR(o,r)).done||!dR(o,r).done)throw JR("Expected sequence with length 2");nO(this.entries,{key:OR(a.value),value:OR(s.value)})}else for(var u in e)SR(e,u)&&nO(this.entries,{key:u,value:OR(e[u])})},parseQuery:function(e){if(e)for(var t,n,i=aO(e,"&"),r=0;r<i.length;)(t=i[r++]).length&&(n=aO(t,"="),nO(this.entries,{key:hO(rO(n)),value:hO(tO(n,"="))}))},serialize:function(){for(var e,t=this.entries,n=[],i=0;i<t.length;)e=t[i++],nO(n,gO(e.key)+"="+gO(e.value));return tO(n,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var kO=function(){CR(this,bO);var e=HR(this,new mO(arguments.length>0?arguments[0]:void 0));vR||(this.length=e.entries.length)},bO=kO.prototype;if(kR(bO,{append:function(e,t){MR(arguments.length,2);var n=UR(this);nO(n.entries,{key:OR(e),value:OR(t)}),vR||this.length++,n.updateURL()},delete:function(e){MR(arguments.length,1);for(var t=UR(this),n=t.entries,i=OR(e),r=0;r<n.length;)n[r].key===i?oO(n,r,1):r++;vR||(this.length=n.length),t.updateURL()},get:function(e){MR(arguments.length,1);for(var t=UR(this).entries,n=OR(e),i=0;i<t.length;i++)if(t[i].key===n)return t[i].value;return null},getAll:function(e){MR(arguments.length,1);for(var t=UR(this).entries,n=OR(e),i=[],r=0;r<t.length;r++)t[r].key===n&&nO(i,t[r].value);return i},has:function(e){MR(arguments.length,1);for(var t=UR(this).entries,n=OR(e),i=0;i<t.length;)if(t[i++].key===n)return!0;return!1},set:function(e,t){MR(arguments.length,1);for(var n,i=UR(this),r=i.entries,o=!1,a=OR(e),s=OR(t),c=0;c<r.length;c++)(n=r[c]).key===a&&(o?oO(r,c--,1):(o=!0,n.value=s));o||nO(r,{key:a,value:s}),vR||(this.length=r.length),i.updateURL()},sort:function(){var e=UR(this);NR(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,n=UR(this).entries,i=TR(e,arguments.length>1?arguments[1]:void 0),r=0;r<n.length;)i((t=n[r++]).value,t.key,this)},keys:function(){return new yO(this,"keys")},values:function(){return new yO(this,"values")},entries:function(){return new yO(this,"entries")}},{enumerable:!0}),yR(bO,FR,bO.entries,{name:"entries"}),yR(bO,"toString",(function(){return UR(this).serialize()}),{enumerable:!0}),vR&&mR(bO,"size",{get:function(){return UR(this).entries.length},configurable:!0,enumerable:!0}),bR(kO,BR),fR({global:!0,constructor:!0,forced:!gR},{URLSearchParams:kO}),!gR&&xR(YR)){var wO=pR(XR.has),_O=pR(XR.set),CO=function(e){if(RR(e)){var t,n=e.body;if(ER(n)===BR)return t=e.headers?new YR(e.headers):new YR,wO(t,"content-type")||_O(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),IR(e,{body:LR(0,OR(n)),headers:LR(0,t)})}return e};if(xR(KR)&&fR({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return KR(e,arguments.length>1?CO(arguments[1]):{})}}),xR(zR)){var xO=function(e){return CR(this,qR),new zR(e,arguments.length>1?CO(arguments[1]):{})};qR.constructor=xO,xO.prototype=qR,fR({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:xO})}}var SO,TO=fr,EO=fe,PO=KP,RO=n,OO=Ma,IO=k,LO=En,AO=ha,DO=tf,MO=R,NO=_y,FO=BE,BO=ra,jO=Tm.codeAt,HO=function(e){var t,n,i=[],r=oR(rR(aR(e),XP,"."),".");for(t=0;t<r.length;t++)n=r[t],iR(i,ZP(qP,n)?"xn--"+uR(n):n);return nR(i,".")},UO=Yo,WO=Pa,VO=uf,GO={URLSearchParams:kO,getState:UR},KO=on,zO=KO.set,YO=KO.getterFor("URL"),qO=GO.URLSearchParams,XO=GO.getState,$O=RO.URL,JO=RO.TypeError,ZO=RO.parseInt,QO=Math.floor,eI=Math.pow,tI=IO("".charAt),nI=IO(/./.exec),iI=IO([].join),rI=IO(1..toString),oI=IO([].pop),aI=IO([].push),sI=IO("".replace),cI=IO([].shift),uI=IO("".split),lI=IO("".slice),fI=IO("".toLowerCase),hI=IO([].unshift),dI="Invalid scheme",pI="Invalid host",vI="Invalid port",gI=/[a-z]/i,yI=/[\d+-.a-z]/i,mI=/\d/,kI=/^0x/i,bI=/^[0-7]+$/,wI=/^\d+$/,_I=/^[\da-f]+$/i,CI=/[\0\t\n\r #%/:<>?@[\\\]^|]/,xI=/[\0\t\n\r #/:<>?@[\\\]^|]/,SI=/^[\u0000-\u0020]+/,TI=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,EI=/[\t\n\r]/g,PI=function(e){var t,n,i,r;if("number"==typeof e){for(t=[],n=0;n<4;n++)hI(t,e%256),e=QO(e/256);return iI(t,".")}if("object"==typeof e){for(t="",i=function(e){for(var t=null,n=1,i=null,r=0,o=0;o<8;o++)0!==e[o]?(r>n&&(t=i,n=r),i=null,r=0):(null===i&&(i=o),++r);return r>n&&(t=i,n=r),t}(e),n=0;n<8;n++)r&&0===e[n]||(r&&(r=!1),i===n?(t+=n?":":"::",r=!0):(t+=rI(e[n],16),n<7&&(t+=":")));return"["+t+"]"}return e},RI={},OI=NO({},RI,{" ":1,'"':1,"<":1,">":1,"`":1}),II=NO({},OI,{"#":1,"?":1,"{":1,"}":1}),LI=NO({},II,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),AI=function(e,t){var n=jO(e,0);return n>32&&n<127&&!MO(t,e)?e:encodeURIComponent(e)},DI={ftp:21,file:null,http:80,https:443,ws:80,wss:443},MI=function(e,t){var n;return 2==e.length&&nI(gI,tI(e,0))&&(":"==(n=tI(e,1))||!t&&"|"==n)},NI=function(e){var t;return e.length>1&&MI(lI(e,0,2))&&(2==e.length||"/"===(t=tI(e,2))||"\\"===t||"?"===t||"#"===t)},FI=function(e){return"."===e||"%2e"===fI(e)},BI={},jI={},HI={},UI={},WI={},VI={},GI={},KI={},zI={},YI={},qI={},XI={},$I={},JI={},ZI={},QI={},eL={},tL={},nL={},iL={},rL={},oL=function(e,t,n){var i,r,o,a=UO(e);if(t){if(r=this.parse(a))throw JO(r);this.searchParams=null}else{if(void 0!==n&&(i=new oL(n,!0)),r=this.parse(a,null,i))throw JO(r);(o=XO(new qO)).bindURL(this),this.searchParams=o}};oL.prototype={type:"URL",parse:function(e,t,n){var i,r,o,a,s,c=this,u=t||BI,l=0,f="",h=!1,d=!1,p=!1;for(e=UO(e),t||(c.scheme="",c.username="",c.password="",c.host=null,c.port=null,c.path=[],c.query=null,c.fragment=null,c.cannotBeABaseURL=!1,e=sI(e,SI,""),e=sI(e,TI,"$1")),e=sI(e,EI,""),i=FO(e);l<=i.length;){switch(r=i[l],u){case BI:if(!r||!nI(gI,r)){if(t)return dI;u=HI;continue}f+=fI(r),u=jI;break;case jI:if(r&&(nI(yI,r)||"+"==r||"-"==r||"."==r))f+=fI(r);else{if(":"!=r){if(t)return dI;f="",u=HI,l=0;continue}if(t&&(c.isSpecial()!=MO(DI,f)||"file"==f&&(c.includesCredentials()||null!==c.port)||"file"==c.scheme&&!c.host))return;if(c.scheme=f,t)return void(c.isSpecial()&&DI[c.scheme]==c.port&&(c.port=null));f="","file"==c.scheme?u=JI:c.isSpecial()&&n&&n.scheme==c.scheme?u=UI:c.isSpecial()?u=KI:"/"==i[l+1]?(u=WI,l++):(c.cannotBeABaseURL=!0,aI(c.path,""),u=nL)}break;case HI:if(!n||n.cannotBeABaseURL&&"#"!=r)return dI;if(n.cannotBeABaseURL&&"#"==r){c.scheme=n.scheme,c.path=BO(n.path),c.query=n.query,c.fragment="",c.cannotBeABaseURL=!0,u=rL;break}u="file"==n.scheme?JI:VI;continue;case UI:if("/"!=r||"/"!=i[l+1]){u=VI;continue}u=zI,l++;break;case WI:if("/"==r){u=YI;break}u=tL;continue;case VI:if(c.scheme=n.scheme,r==SO)c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=BO(n.path),c.query=n.query;else if("/"==r||"\\"==r&&c.isSpecial())u=GI;else if("?"==r)c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=BO(n.path),c.query="",u=iL;else{if("#"!=r){c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=BO(n.path),c.path.length--,u=tL;continue}c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=BO(n.path),c.query=n.query,c.fragment="",u=rL}break;case GI:if(!c.isSpecial()||"/"!=r&&"\\"!=r){if("/"!=r){c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,u=tL;continue}u=YI}else u=zI;break;case KI:if(u=zI,"/"!=r||"/"!=tI(f,l+1))continue;l++;break;case zI:if("/"!=r&&"\\"!=r){u=YI;continue}break;case YI:if("@"==r){h&&(f="%40"+f),h=!0,o=FO(f);for(var v=0;v<o.length;v++){var g=o[v];if(":"!=g||p){var y=AI(g,LI);p?c.password+=y:c.username+=y}else p=!0}f=""}else if(r==SO||"/"==r||"?"==r||"#"==r||"\\"==r&&c.isSpecial()){if(h&&""==f)return"Invalid authority";l-=FO(f).length+1,f="",u=qI}else f+=r;break;case qI:case XI:if(t&&"file"==c.scheme){u=QI;continue}if(":"!=r||d){if(r==SO||"/"==r||"?"==r||"#"==r||"\\"==r&&c.isSpecial()){if(c.isSpecial()&&""==f)return pI;if(t&&""==f&&(c.includesCredentials()||null!==c.port))return;if(a=c.parseHost(f))return a;if(f="",u=eL,t)return;continue}"["==r?d=!0:"]"==r&&(d=!1),f+=r}else{if(""==f)return pI;if(a=c.parseHost(f))return a;if(f="",u=$I,t==XI)return}break;case $I:if(!nI(mI,r)){if(r==SO||"/"==r||"?"==r||"#"==r||"\\"==r&&c.isSpecial()||t){if(""!=f){var m=ZO(f,10);if(m>65535)return vI;c.port=c.isSpecial()&&m===DI[c.scheme]?null:m,f=""}if(t)return;u=eL;continue}return vI}f+=r;break;case JI:if(c.scheme="file","/"==r||"\\"==r)u=ZI;else{if(!n||"file"!=n.scheme){u=tL;continue}if(r==SO)c.host=n.host,c.path=BO(n.path),c.query=n.query;else if("?"==r)c.host=n.host,c.path=BO(n.path),c.query="",u=iL;else{if("#"!=r){NI(iI(BO(i,l),""))||(c.host=n.host,c.path=BO(n.path),c.shortenPath()),u=tL;continue}c.host=n.host,c.path=BO(n.path),c.query=n.query,c.fragment="",u=rL}}break;case ZI:if("/"==r||"\\"==r){u=QI;break}n&&"file"==n.scheme&&!NI(iI(BO(i,l),""))&&(MI(n.path[0],!0)?aI(c.path,n.path[0]):c.host=n.host),u=tL;continue;case QI:if(r==SO||"/"==r||"\\"==r||"?"==r||"#"==r){if(!t&&MI(f))u=tL;else if(""==f){if(c.host="",t)return;u=eL}else{if(a=c.parseHost(f))return a;if("localhost"==c.host&&(c.host=""),t)return;f="",u=eL}continue}f+=r;break;case eL:if(c.isSpecial()){if(u=tL,"/"!=r&&"\\"!=r)continue}else if(t||"?"!=r)if(t||"#"!=r){if(r!=SO&&(u=tL,"/"!=r))continue}else c.fragment="",u=rL;else c.query="",u=iL;break;case tL:if(r==SO||"/"==r||"\\"==r&&c.isSpecial()||!t&&("?"==r||"#"==r)){if(".."===(s=fI(s=f))||"%2e."===s||".%2e"===s||"%2e%2e"===s?(c.shortenPath(),"/"==r||"\\"==r&&c.isSpecial()||aI(c.path,"")):FI(f)?"/"==r||"\\"==r&&c.isSpecial()||aI(c.path,""):("file"==c.scheme&&!c.path.length&&MI(f)&&(c.host&&(c.host=""),f=tI(f,0)+":"),aI(c.path,f)),f="","file"==c.scheme&&(r==SO||"?"==r||"#"==r))for(;c.path.length>1&&""===c.path[0];)cI(c.path);"?"==r?(c.query="",u=iL):"#"==r&&(c.fragment="",u=rL)}else f+=AI(r,II);break;case nL:"?"==r?(c.query="",u=iL):"#"==r?(c.fragment="",u=rL):r!=SO&&(c.path[0]+=AI(r,RI));break;case iL:t||"#"!=r?r!=SO&&("'"==r&&c.isSpecial()?c.query+="%27":c.query+="#"==r?"%23":AI(r,RI)):(c.fragment="",u=rL);break;case rL:r!=SO&&(c.fragment+=AI(r,OI))}l++}},parseHost:function(e){var t,n,i;if("["==tI(e,0)){if("]"!=tI(e,e.length-1))return pI;if(t=function(e){var t,n,i,r,o,a,s,c=[0,0,0,0,0,0,0,0],u=0,l=null,f=0,h=function(){return tI(e,f)};if(":"==h()){if(":"!=tI(e,1))return;f+=2,l=++u}for(;h();){if(8==u)return;if(":"!=h()){for(t=n=0;n<4&&nI(_I,h());)t=16*t+ZO(h(),16),f++,n++;if("."==h()){if(0==n)return;if(f-=n,u>6)return;for(i=0;h();){if(r=null,i>0){if(!("."==h()&&i<4))return;f++}if(!nI(mI,h()))return;for(;nI(mI,h());){if(o=ZO(h(),10),null===r)r=o;else{if(0==r)return;r=10*r+o}if(r>255)return;f++}c[u]=256*c[u]+r,2!=++i&&4!=i||u++}if(4!=i)return;break}if(":"==h()){if(f++,!h())return}else if(h())return;c[u++]=t}else{if(null!==l)return;f++,l=++u}}if(null!==l)for(a=u-l,u=7;0!=u&&a>0;)s=c[u],c[u--]=c[l+a-1],c[l+--a]=s;else if(8!=u)return;return c}(lI(e,1,-1)),!t)return pI;this.host=t}else if(this.isSpecial()){if(e=HO(e),nI(CI,e))return pI;if(t=function(e){var t,n,i,r,o,a,s,c=uI(e,".");if(c.length&&""==c[c.length-1]&&c.length--,(t=c.length)>4)return e;for(n=[],i=0;i<t;i++){if(""==(r=c[i]))return e;if(o=10,r.length>1&&"0"==tI(r,0)&&(o=nI(kI,r)?16:8,r=lI(r,8==o?1:2)),""===r)a=0;else{if(!nI(10==o?wI:8==o?bI:_I,r))return e;a=ZO(r,o)}aI(n,a)}for(i=0;i<t;i++)if(a=n[i],i==t-1){if(a>=eI(256,5-t))return null}else if(a>255)return null;for(s=oI(n),i=0;i<n.length;i++)s+=n[i]*eI(256,3-i);return s}(e),null===t)return pI;this.host=t}else{if(nI(xI,e))return pI;for(t="",n=FO(e),i=0;i<n.length;i++)t+=AI(n[i],RI);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return MO(DI,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"==this.scheme&&1==t&&MI(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,n=e.username,i=e.password,r=e.host,o=e.port,a=e.path,s=e.query,c=e.fragment,u=t+":";return null!==r?(u+="//",e.includesCredentials()&&(u+=n+(i?":"+i:"")+"@"),u+=PI(r),null!==o&&(u+=":"+o)):"file"==t&&(u+="//"),u+=e.cannotBeABaseURL?a[0]:a.length?"/"+iI(a,"/"):"",null!==s&&(u+="?"+s),null!==c&&(u+="#"+c),u},setHref:function(e){var t=this.parse(e);if(t)throw JO(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"==e)try{return new aL(e.path[0]).origin}catch(e){return"null"}return"file"!=e&&this.isSpecial()?e+"://"+PI(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(UO(e)+":",BI)},getUsername:function(){return this.username},setUsername:function(e){var t=FO(UO(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var n=0;n<t.length;n++)this.username+=AI(t[n],LI)}},getPassword:function(){return this.password},setPassword:function(e){var t=FO(UO(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var n=0;n<t.length;n++)this.password+=AI(t[n],LI)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?PI(e):PI(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,qI)},getHostname:function(){var e=this.host;return null===e?"":PI(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,XI)},getPort:function(){var e=this.port;return null===e?"":UO(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""==(e=UO(e))?this.port=null:this.parse(e,$I))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+iI(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,eL))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""==(e=UO(e))?this.query=null:("?"==tI(e,0)&&(e=lI(e,1)),this.query="",this.parse(e,iL)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!=(e=UO(e))?("#"==tI(e,0)&&(e=lI(e,1)),this.fragment="",this.parse(e,rL)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var aL=function(e){var t=DO(this,sL),n=VO(arguments.length,1)>1?arguments[1]:void 0,i=zO(t,new oL(e,!1,n));EO||(t.href=i.serialize(),t.origin=i.getOrigin(),t.protocol=i.getProtocol(),t.username=i.getUsername(),t.password=i.getPassword(),t.host=i.getHost(),t.hostname=i.getHostname(),t.port=i.getPort(),t.pathname=i.getPathname(),t.search=i.getSearch(),t.searchParams=i.getSearchParams(),t.hash=i.getHash())},sL=aL.prototype,cL=function(e,t){return{get:function(){return YO(this)[e]()},set:t&&function(e){return YO(this)[t](e)},configurable:!0,enumerable:!0}};if(EO&&(AO(sL,"href",cL("serialize","setHref")),AO(sL,"origin",cL("getOrigin")),AO(sL,"protocol",cL("getProtocol","setProtocol")),AO(sL,"username",cL("getUsername","setUsername")),AO(sL,"password",cL("getPassword","setPassword")),AO(sL,"host",cL("getHost","setHost")),AO(sL,"hostname",cL("getHostname","setHostname")),AO(sL,"port",cL("getPort","setPort")),AO(sL,"pathname",cL("getPathname","setPathname")),AO(sL,"search",cL("getSearch","setSearch")),AO(sL,"searchParams",cL("getSearchParams")),AO(sL,"hash",cL("getHash","setHash"))),LO(sL,"toJSON",(function(){return YO(this).serialize()}),{enumerable:!0}),LO(sL,"toString",(function(){return YO(this).serialize()}),{enumerable:!0}),$O){var uL=$O.createObjectURL,lL=$O.revokeObjectURL;uL&&LO(aL,"createObjectURL",OO(uL,$O)),lL&&LO(aL,"revokeObjectURL",OO(lL,$O))}function fL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function hL(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fL(Object(n),!0).forEach((function(t){Go(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fL(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function dL(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}WO(aL,"URL"),TO({global:!0,constructor:!0,forced:!PO,sham:!EO},{URL:aL});var pL="info",vL=V_,gL=function(e){Ho(n,e);var t=dL(n);function n(){var e;Bo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Uo(e=t.call.apply(t,[this].concat(r))),"_recordUserActions",(function(t){var n=e._getTime(),i=Object.assign({},t,{msg:t.msg||t.action});e._stats[pL].push(hL(hL({type:"userAction"},n),{},{payload:i}))})),Go(Uo(e),"_onReset",(function(){e.reset()})),Go(Uo(e),"_recordInfo",(function(t){e.info(t)})),Go(Uo(e),"_downloadStats",(function(){var t=e.getStats(),n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=window.URL.createObjectURL(n),r=document.createElement("a");r.style.display="none",r.href=i,r.download="player.txt",r.disabled=!1,r.click()})),e}return Fo(n,[{key:"_getTime",value:function(){return{timestamp:Date.now(),timeFormat:(new Date).toISOString()}}},{key:"afterCreate",value:function(){this.reset(),this.on(B_,this._recordUserActions),this.on(vL.STATS_INFO,this._recordInfo),this.on(vL.STATS_DOWNLOAD,this._downloadStats),this.on(vL.STATS_RESET,this._onReset)}},{key:"destroy",value:function(){this.offAll()}},{key:"downloadStats",value:function(){this._downloadStats()}},{key:"info",value:function(e){e.profile?this._infoProfile(e):this._info(e)}},{key:"_info",value:function(e){var t=this._getTime();this._stats[pL].push(hL(hL({},t),{},{payload:e}))}},{key:"_infoProfile",value:function(e){if(e&&e.startMs){var t=hL({cat:"function",dur:Date.now()-e.startMs,name:e.name||e.msg,ph:"X",pid:0,tid:0,ts:e.startMs,profile:!0},e);this._info(t)}else console.warn("infoProfile need object data, include startMs")}},{key:"reset",value:function(){var e;this._stats=(Go(e={},pL,[]),Go(e,"media",{}),e)}},{key:"getStats",value:function(){for(var e=this.player.video,t=[],n=0;n<e.buffered.length;n++)t.push({start:e.buffered.start(n),end:e.buffered.end(n)});var i={currentTime:e.currentTime,readyState:e.readyState,buffered:t,paused:e.paused,ended:e.ended};return this._stats.media=i,{raw:this._stats,timestat:this._getTimeStats(),profile:this._getProfile()}}},{key:"_getTimeStats",value:function(){var e=this._stats[pL].map((function(e){var t=e.payload.data,n="";try{t instanceof Error?n=t.msg:void 0!==t&&(n=JSON.stringify(t))}catch(e){console.log("err",e)}return"[".concat(e.timeFormat,"] : ").concat(e.payload.msg," ").concat(n," ")}));return e}},{key:"_getProfile",value:function(){var e={traceEvents:[]};return this._stats[pL].forEach((function(t){t.payload.profile&&e.traceEvents.push(t.payload)})),e}}],[{key:"pluginName",get:function(){return"stats"}},{key:"defaultConfig",get:function(){return{}}}]),n}(EC);function yL(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var mL=function(e){Ho(n,e);var t=yL(n);function n(){var e;Bo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Uo(e=t.call.apply(t,[this].concat(r))),"onGapJump",(function(){var t=Uo(e),i=t.player,r=t.config;if(i.video.readyState!==HTMLMediaElement.HAVE_NOTHING){if(i.video.seeking){if(!e.seekingEventReceived)return}else e.seekingEventReceived=!1;if(!i.video.paused||0===i.video.currentTime||!e.hasPlayed){var o=i.video.buffered,a=r.smallGapLimit||.5,s=r.gapDetectionThreshold||.3,c=i.video.currentTime,u=e._getIndex(o,c,s);if(null!==u&&0!==u){console.log("GapJump bufferRange ",o.start(u),o.end(u));var l=o.start(u)+.1;if(!(l>i.video.duration)){var f=l-c,h=f<=a;f<n.BROWSER_GAP_TOLERANCE||h&&(!1!==r.useGapJump&&(i.video.currentTime=e.isSafari?l+.1:l),e.player&&e.player.emit("detectGap"),console.log("gapJump gapIndex",u," isGapSamll:",h," currentTime:",i.video.currentTime," jumpSize:",c-i.video.currentTime),.08!==l&&i&&i.emit("log",{type:"oneevent",end_type:"gap",vid:i.config.vid,ext:{video_postion:Math.floor(1e3*l)}}))}}}}})),e}return Fo(n,[{key:"afterCreate",value:function(){var e=this;!1!==this.config.useGapJump&&(this.hasPlayed=!1,this.seekingEventReceived=!1,this.isSafari=/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),this.on(n_,this.onGapJump),this.on(qw,(function(){e.hasPlayed=!0})),this.on(Qw,(function(){e.seekingEventReceived=!0})))}},{key:"_getIndex",value:function(e,t,n){if(!e||!e.length)return null;if(1===e.length&&e.end(0)-e.start(0)<1e-6)return null;for(var i=this._getBuffered(e),r=null,o=0;o<i.length;o++){if(i[o].start>t&&(0===o||i[o-1].end-t<=n)){r=o;break}}return r}},{key:"_getBuffered",value:function(e){if(!e)return[];for(var t=[],n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t}}],[{key:"pluginName",get:function(){return"gapJump"}},{key:"defaultConfig",get:function(){return{useGapJump:!1,smallGapLimit:.5,gapDetectionThreshold:.3}}}]),n}(HC);function kL(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}mL.BROWSER_GAP_TOLERANCE=.001;var bL=function(e){Ho(n,e);var t=kL(n);function n(){var e;Bo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Uo(e=t.call.apply(t,[this].concat(r))),"onWaiting",(function(){var t=Uo(e).config;e.jumpCnt>t.jumpCntMax||e.timer||!1===t.useWaitingTimeoutJump||(e.timer=setTimeout(e.onJump,1e3*t.waitingTime))})),Go(Uo(e),"onJump",(function(){var t=Uo(e),n=t.player,i=t.config;if(clearTimeout(e.timer),e.timer=null,!(e.jumpCnt>i.jumpCntMax||!1===i.useWaitingTimeoutJump||n.video.paused&&0!==n.video.currentTime&&e.hasPlayed)){e.jumpSize=i.jumpSize*(e.jumpCnt+1),e.jumpCnt===i.jumpSize&&e.jumpSize<6&&(e.jumpSize=6);var r=n.currentTime+e.jumpSize;r>n.video.duration||(e.jumpCnt++,n.currentTime=r)}})),e}return Fo(n,[{key:"afterCreate",value:function(){var e=this,t=this.config,n=t.useWaitingTimeoutJump,i=t.jumpSize;!1!==n&&(this.hasPlayed=!1,this.jumpCnt=0,this.timer=null,this.jumpSize=i,this.on(n_,this.onWaiting),this.on([Xw,i_],(function(){clearTimeout(e.timer),e.timer=null,e.jumpSize=e.config.jumpSize})),this.on(qw,(function(){e.hasPlayed=!0})))}}],[{key:"pluginName",get:function(){return"waitingTimeoutJump"}},{key:"defaultConfig",get:function(){return{useWaitingTimeoutJump:!1,waitingTime:15,jumpSize:2,jumpCntMax:4}}}]),n}(HC);function wL(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var _L="cdn",CL=["cdn"],xL=function(e){Ho(n,e);var t=wL(n);function n(){var e;Bo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Uo(e=t.call.apply(t,[this].concat(r))),"startTimer",(function(){Ww.isMSE(e.player.video)||(e.cnt=0,e.timer=setTimeout(e.testSpeed,e.config.testTimeStep))})),Go(Uo(e),"initSpeedList",(function(){CL.forEach((function(e){!n.speedListCache[e]&&(n.speedListCache[e]=[])}))})),Go(Uo(e),"_onRealSpeedChange",(function(t){t.speed&&e.appendList(t.speed,t.len,t.time,t.type||_L)})),Go(Uo(e),"testSpeed",(function(){if(clearTimeout(e.timer),e.timer=null,e.player&&e.config.openSpeed){var t=e.config,n=t.url,i=t.loadSize,r=t.testCnt,o=t.testTimeStep,a=n+(n.indexOf("?")<0?"?testst=":"&testst=")+Date.now();if(!(e.cnt>=r)){e.cnt++;try{var s=(new Date).getTime(),c=null,u=new XMLHttpRequest;e.xhr=u,u.open("GET",a);var l={},f=Math.floor(10*Math.random());l.Range="bytes="+f+"-"+(i+f),l&&Object.keys(l).forEach((function(e){u.setRequestHeader(e,l[e])})),u.onreadystatechange=function(){if(4===u.readyState){e.xhr=null,c=(new Date).getTime();var t=u.getResponseHeader("Content-Length")/1024*8,n=c-s,i=Math.round(1e3*t/n);e.appendList(i,t,n),e.timer=setTimeout(e.testSpeed,o)}},u.send()}catch(e){console.error(e)}}}})),Go(Uo(e),"appendList",(function(t,i,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:_L;if(n.speedListCache&&n.speedListCache[o]){var a=e.config.saveSpeedMax;n.speedListCache[o].length>=a&&n.speedListCache[o].shift(),n.speedListCache[o].push({speed:t,bytes:i,time:r});var s=Uo(e).player;s&&(o===_L?s.realTimeSpeed=t:s[e.getSpeedName("realTime",o)]=t),e.updateSpeed(o)}})),Go(Uo(e),"updateSpeed",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_L,i=n.getAvgSpeedKbs(t),r=Uo(e).player;if(r)if(t===_L)r.avgSpeed&&i===r.avgSpeed||(r.avgSpeed=i,r.emit(__,{speed:i,realTimeSpeed:r.realTimeSpeed}));else{var o=e.getSpeedName("avg",t);r[o]&&i===r[o]||(r[o]=i,r.emit(__,{speed:i,realTimeSpeed:r.realTimeSpeed}))}})),e}return Fo(n,[{key:"afterCreate",value:function(){var e=this.config,t=e.openSpeed,n=e.addSpeedTypeList,i=e.testCnt;(null==n?void 0:n.length)>0&&CL.push.apply(CL,Py(n)),this.initSpeedList(),t&&(this.on("real_time_speed",this._onRealSpeedChange),this.timer=null,this.cnt=0,this.xhr=null,i>0&&this.on([a_,k_],this.startTimer))}},{key:"getSpeedName",value:function(e,t){return e+"Speed"+t.toUpperCase()}},{key:"openSpeed",get:function(){return this.config.openSpeed},set:function(e){if(this.config.openSpeed=e,!e&&this.timer)return clearTimeout(this.timer),void(this.timer=null);if(this.config.openSpeed){if(this.timer)return;this.timer=setTimeout(this.testSpeed,this.config.testTimeStep)}}},{key:"destroy",value:function(){this.off("real_time_speed",this._onRealSpeedChange),this.off([a_,k_],this.startTimer),clearTimeout(this.timer),this.timer=null,this.xhr&&4!==this.xhr.readyState&&(this.xhr.cancel&&this.xhr.cancel(),this.xhr=null)}}],[{key:"pluginName",get:function(){return"testspeed"}},{key:"speedSampleList",get:function(){return n.speedListCache}},{key:"defaultConfig",get:function(){return{openSpeed:!1,testCnt:3,loadSize:204800,testTimeStep:3e3,url:"",saveSpeedMax:20,addSpeedTypeList:[]}}},{key:"getAvgSpeedKbs",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_L;if(!n.speedListCache||!n.speedListCache[e])return-1;if(n.speedListCache[e].length<=0)return-1;var t=0;return n.speedListCache[e].map((function(e){t+=e.speed})),Math.floor(t/n.speedListCache[e].length)}},{key:"getWeightedSpeedKbs",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_L,t=-1;if(!n.speedListCache||!n.speedListCache[e])return t;if(n.speedListCache[e].length<=0)return t;var i=[];n.speedListCache[e].forEach((function(e){i.push(e)})),i.sort((function(e,t){return e.speed-t.speed}));for(var r=i.length,o=0,a=0;a<r;a++)o+=i[a].bytes;o/=2;for(var s=0;s<r;s++)(o-=i[s].bytes)<=0&&(t=i[s].speed);return t<0?-1:t}}]),n}(HC);function SL(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}Go(xL,"speedListCache",{});var TL=function(e){Ho(n,e);var t=SL(n);function n(){return Bo(this,n),t.apply(this,arguments)}return Fo(n,[{key:"afterCreate",value:function(){var e=this,t=this.player,n=this.config,i=t.media||t.video;!n.disabled&&i.getVideoPlaybackQuality&&(this.timer=null,this._resetData(),this.on(l_,(function(){e._resetData(),e._stopTick()})),this.on(qw,(function(){e._startTick()})),this.on(Jw,(function(){e._stopTick()})),this.on($w,(function(){e._stopTick()})),this.on(f_,(function(){e._stopTick()})))}},{key:"_startTick",value:function(){var e=this;this._stopTick(),this._timer=setTimeout((function(){e._checkDecodeFPS(),e._startTick()}),this.config.tick)}},{key:"_stopTick",value:function(){clearTimeout(this._timer),this._timer=null}},{key:"_checkBuffer",value:function(e,t){for(var n=!1,i=[],r=0;r<t.length;r++){var o=t.start(r),a=t.end(r);if(i.push({start:o,end:a}),o<=e&&e<=a-1){n=!0;break}}return{enoughBuffer:n,buffers:i}}},{key:"_checkStuck",value:function(e,t,n,i){var r=this.player.media||this.player.video,o=document.hidden,a=r.paused,s=r.readyState,c=r.currentTime,u=r.buffered;if(!(o||a||s<4)){var l=this._checkBuffer(c,u),f=l.enoughBuffer,h=l.buffers;f&&(e<=this.config.reportFrame?(this._currentStuckCount++,this._payload.push({currentTime:c,buffers:h,curDecodedFrames:e,totalVideoFrames:t,droppedVideoFrames:n,checkInterval:i}),this._currentStuckCount>=this.config.stuckCount&&(this.emit(G_,this._payload),this._resetCheck())):this._resetCheck())}}},{key:"_resetCheck",value:function(){this._payload=[],this._currentStuckCount=0}},{key:"_resetData",value:function(){this._lastDecodedFrames=0,this._currentStuckCount=0,this._lastCheckPoint=null,this._payload=[]}},{key:"_checkDecodeFPS",value:function(){var e,t,n=(null===(e=this.player)||void 0===e?void 0:e.media)||(null===(t=this.player)||void 0===t?void 0:t.video);if(n){var i=n.getVideoPlaybackQuality(),r=i.totalVideoFrames,o=i.droppedVideoFrames,a=performance.now();if(r&&this._lastCheckPoint){var s=r-this._lastDecodedFrames,c=a-this._lastCheckPoint;this._checkStuck(s,r,o,c)}this._lastDecodedFrames=r,this._lastCheckPoint=a}else this._stopTick()}},{key:"destroy",value:function(){this._stopTick(),this._resetData()}}],[{key:"pluginName",get:function(){return"FpsDetect"}},{key:"defaultConfig",get:function(){return{disabled:!1,tick:1e3,stuckCount:3,reportFrame:0}}}]),n}(HC);ux.use({LANG:"zh-cn",TEXT:{ERROR_TYPES:{network:{code:1,msg:"视频下载错误"},mse:{code:2,msg:"流追加错误"},parse:{code:3,msg:"解析错误"},format:{code:4,msg:"格式错误"},decoder:{code:5,msg:"解码错误"},runtime:{code:6,msg:"语法错误"},timeout:{code:7,msg:"播放超时"},other:{code:8,msg:"其他错误"}},HAVE_NOTHING:"没有关于音频/视频是否就绪的信息",HAVE_METADATA:"音频/视频的元数据已就绪",HAVE_CURRENT_DATA:"关于当前播放位置的数据是可用的,但没有足够的数据来播放下一帧/毫秒",HAVE_FUTURE_DATA:"当前及至少下一帧的数据是可用的",HAVE_ENOUGH_DATA:"可用数据足以开始播放",NETWORK_EMPTY:"音频/视频尚未初始化",NETWORK_IDLE:"音频/视频是活动的且已选取资源,但并未使用网络",NETWORK_LOADING:"浏览器正在下载数据",NETWORK_NO_SOURCE:"未找到音频/视频来源",MEDIA_ERR_ABORTED:"取回过程被用户中止",MEDIA_ERR_NETWORK:"网络错误",MEDIA_ERR_DECODE:"解码错误",MEDIA_ERR_SRC_NOT_SUPPORTED:"不支持的音频/视频格式",REPLAY:"重播",ERROR:"网络连接似乎出现了问题",PLAY_TIPS:"播放",PAUSE_TIPS:"暂停",PLAYNEXT_TIPS:"下一集",DOWNLOAD_TIPS:"下载",ROTATE_TIPS:"旋转",RELOAD_TIPS:"重新载入",FULLSCREEN_TIPS:"进入全屏",EXITFULLSCREEN_TIPS:"退出全屏",CSSFULLSCREEN_TIPS:"进入样式全屏",EXITCSSFULLSCREEN_TIPS:"退出样式全屏",TEXTTRACK:"字幕",PIP:"画中画",SCREENSHOT:"截图",LIVE:"正在直播",OFF:"关闭",OPEN:"开启",MINI_DRAG:"点击按住可拖动视频",MINISCREEN:"小屏幕",REFRESH_TIPS:"请试试",REFRESH:"刷新",FORWARD:"快进中",LIVE_TIP:"直播"}});var EL=Fo((function e(t,n){var i,r,o;Bo(this,e);var a=n&&"mobile"===n.isMobileSimulateMode,s=n.isLive,c=[].concat(s?[]:[RT,DP,RP,VT],[DT,UT,ZT,QE,hP,pP,rP,aP,XT,$E]),u=[Hx,Vx,Xx,gT,Zx,bP,CP,IP,pS];this.plugins=[Nx,gL,bL,mL].concat(Py(c),u);var l=a?"mobile":$_.device;switch(l){case"pc":(i=this.plugins).push.apply(i,[hT,mS,mP,xL,TL]);break;case"mobile":(r=this.plugins).push.apply(r,[aT]);break;default:(o=this.plugins).push.apply(o,[hT,mS,mP])}($_.os.isIpad||"pc"===l)&&this.plugins.push(UP),$_.os.isIpad&&this.plugins.push(mS),this.ignores=[],this.i18n=[]}));function PL(e){var t=function(){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}}();return function(){var n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Wo(this,n)}}var RL=function(e){Ho(n,e);var t=PL(n);function n(){return Bo(this,n),t.apply(this,arguments)}return Fo(n)}(wx);return Go(RL,"defaultPreset",EL),Go(RL,"Util",Ww),Go(RL,"Sniffer",$_),Go(RL,"Errors",Yw),Go(RL,"Events",K_),Go(RL,"Plugin",HC),Go(RL,"BasePlugin",EC),Go(RL,"I18N",ux),Go(RL,"STATE_CLASS",QC),Go(RL,"PAUSE_TYPES",sC),Go(RL,"BUFFER_CONTROL_TYPES",cC),Go(RL,"InstManager",dx),Go(RL,"TestSpeed",xL),RL}));