@alirezahosseini/sibtorsh-player 0.2.10 → 0.2.13

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.
@@ -275,7 +275,7 @@ function print() { __p += __j.call(arguments, '') }
275
275
  }`;var $e=au(function(){return tt(V,De+"return "+ge).apply(i,W)});if($e.source=ge,wl($e))throw $e;return $e}function mp(l){return ot(l).toLowerCase()}function gp(l){return ot(l).toUpperCase()}function yp(l,p,_){if(l=ot(l),l&&(_||p===i))return Js(l);if(!l||!(p=ti(p)))return l;var P=Ut(l),M=Ut(p),V=Bn(P,M),W=Un(P,M)+1;return Er(P,V,W).join("")}function vp(l,p,_){if(l=ot(l),l&&(_||p===i))return l.slice(0,Gn(l)+1);if(!l||!(p=ti(p)))return l;var P=Ut(l),M=Un(P,Ut(p))+1;return Er(P,0,M).join("")}function Ep(l,p,_){if(l=ot(l),l&&(_||p===i))return l.replace(Fs,"");if(!l||!(p=ti(p)))return l;var P=Ut(l),M=Bn(P,Ut(p));return Er(P,M).join("")}function Sp(l,p){var _=$,P=X;if(Et(p)){var M="separator"in p?p.separator:M;_="length"in p?Ue(p.length):_,P="omission"in p?ti(p.omission):P}l=ot(l);var V=l.length;if(or(l)){var W=Ut(l);V=W.length}if(_>=V)return l;var j=_-xi(P);if(j<1)return P;var J=W?Er(W,0,j).join(""):l.slice(0,j);if(M===i)return J+P;if(W&&(j+=J.length-j),kl(M)){if(l.slice(j).search(M)){var fe,de=J;for(M.global||(M=cs(M.source,ot(yn.exec(M))+"g")),M.lastIndex=0;fe=M.exec(de);)var ge=fe.index;J=J.slice(0,ge===i?j:ge)}}else if(l.indexOf(ti(M),j)!=j){var Te=J.lastIndexOf(M);Te>-1&&(J=J.slice(0,Te))}return J+P}function Tp(l){return l=ot(l),l&&Xr.test(l)?l.replace(Vi,yo):l}var _p=Ls(function(l,p,_){return l+(_?" ":"")+p.toUpperCase()}),Nl=oh("toUpperCase");function nu(l,p,_){return l=ot(l),p=_?i:p,p===i?po(l)?So(l):ao(l):l.match(p)||[]}var au=Ge(function(l,p){try{return Nt(l,i,p)}catch(_){return wl(_)?_:new Fe(_)}}),Ap=Xi(function(l,p){return jt(p,function(_){_=Bi(_),ui(l,_,xl(l[_],l))}),l});function bp(l){var p=l==null?0:l.length,_=xe();return l=p?ct(l,function(P){if(typeof P[1]!="function")throw new Vt(o);return[_(P[0]),P[1]]}):[],Ge(function(P){for(var M=-1;++M<p;){var V=l[M];if(Nt(V[0],this,P))return Nt(V[1],this,P)}})}function Cp(l){return tl(Ot(l,g))}function Bl(l){return function(){return l}}function Ip(l,p){return l==null||l!==l?p:l}var Pp=hh(),Dp=hh(!0);function Zt(l){return l}function Ul(l){return R(typeof l=="function"?l:Ot(l,g))}function Rp(l){return Oe(Ot(l,g))}function Lp(l,p){return We(l,Ot(p,g))}var xp=Ge(function(l,p){return function(_){return Hr(_,l,p)}}),Mp=Ge(function(l,p){return function(_){return Hr(l,_,p)}});function Vl(l,p,_){var P=Mt(p),M=Ds(p,P);_==null&&!(Et(p)&&(M.length||!P.length))&&(_=p,p=l,l=this,M=Ds(p,Mt(p)));var V=!(Et(_)&&"chain"in _)||!!_.chain,W=Qi(l);return jt(M,function(j){var J=p[j];l[j]=J,W&&(l.prototype[j]=function(){var fe=this.__chain__;if(V||fe){var de=l(this.__wrapped__),ge=de.__actions__=zt(this.__actions__);return ge.push({func:J,args:arguments,thisArg:l}),de.__chain__=fe,de}return J.apply(l,Li([this.value()],arguments))})}),l}function wp(){return It._===this&&(It._=Io),this}function $l(){}function kp(l){return l=Ue(l),Ge(function(p){return bi(p,l)})}var Op=vl(ct),Fp=vl(On),Np=vl(as);function ou(l){return Cl(l)?Rr(Bi(l)):uu(l)}function Bp(l){return function(p){return l==null?i:zi(l,p)}}var Up=ch(),Vp=ch(!0);function Gl(){return[]}function Hl(){return!1}function $p(){return{}}function Gp(){return""}function Hp(){return!0}function Yp(l,p){if(l=Ue(l),l<1||l>z)return[];var _=he,P=Rt(l,he);p=xe(p),l-=he;for(var M=Qs(P,p);++_<l;)p(_);return M}function Wp(l){return Ne(l)?ct(l,Bi):ii(l)?[l]:zt(Ph(ot(l)))}function Kp(l){var p=++bo;return ot(l)+p}var jp=ma(function(l,p){return l+p},0),zp=El("ceil"),qp=ma(function(l,p){return l/p},1),Xp=El("floor");function Zp(l){return l&&l.length?Ps(l,Zt,un):i}function Qp(l,p){return l&&l.length?Ps(l,xe(p,2),un):i}function Jp(l){return Nn(l,Zt)}function em(l,p){return Nn(l,xe(p,2))}function tm(l){return l&&l.length?Ps(l,Zt,oe):i}function im(l,p){return l&&l.length?Ps(l,xe(p,2),oe):i}var rm=ma(function(l,p){return l*p},1),sm=El("round"),am=ma(function(l,p){return l-p},0);function om(l){return l&&l.length?Zs(l,Zt):0}function lm(l,p){return l&&l.length?Zs(l,xe(p,2)):0}return B.after=Pf,B.ary=Bh,B.assign=pd,B.assignIn=Qh,B.assignInWith=Da,B.assignWith=md,B.at=gd,B.before=Uh,B.bind=xl,B.bindAll=Ap,B.bindKey=Vh,B.castArray=Uf,B.chain=Oh,B.chunk=ju,B.compact=zu,B.concat=qu,B.cond=bp,B.conforms=Cp,B.constant=Bl,B.countBy=sf,B.create=yd,B.curry=$h,B.curryRight=Gh,B.debounce=Hh,B.defaults=vd,B.defaultsDeep=Ed,B.defer=Df,B.delay=Rf,B.difference=Xu,B.differenceBy=Zu,B.differenceWith=Qu,B.drop=Ju,B.dropRight=ec,B.dropRightWhile=tc,B.dropWhile=ic,B.fill=rc,B.filter=af,B.flatMap=hf,B.flatMapDeep=uf,B.flatMapDepth=cf,B.flatten=xh,B.flattenDeep=sc,B.flattenDepth=nc,B.flip=Lf,B.flow=Pp,B.flowRight=Dp,B.fromPairs=ac,B.functions=Id,B.functionsIn=Pd,B.groupBy=ff,B.initial=lc,B.intersection=hc,B.intersectionBy=uc,B.intersectionWith=cc,B.invert=Rd,B.invertBy=Ld,B.invokeMap=pf,B.iteratee=Ul,B.keyBy=mf,B.keys=Mt,B.keysIn=Xt,B.map=_a,B.mapKeys=Md,B.mapValues=wd,B.matches=Rp,B.matchesProperty=Lp,B.memoize=ba,B.merge=kd,B.mergeWith=Jh,B.method=xp,B.methodOf=Mp,B.mixin=Vl,B.negate=Ca,B.nthArg=kp,B.omit=Od,B.omitBy=Fd,B.once=xf,B.orderBy=gf,B.over=Op,B.overArgs=Mf,B.overEvery=Fp,B.overSome=Np,B.partial=Ml,B.partialRight=Yh,B.partition=yf,B.pick=Nd,B.pickBy=eu,B.property=ou,B.propertyOf=Bp,B.pull=mc,B.pullAll=wh,B.pullAllBy=gc,B.pullAllWith=yc,B.pullAt=vc,B.range=Up,B.rangeRight=Vp,B.rearg=wf,B.reject=Sf,B.remove=Ec,B.rest=kf,B.reverse=Rl,B.sampleSize=_f,B.set=Ud,B.setWith=Vd,B.shuffle=Af,B.slice=Sc,B.sortBy=If,B.sortedUniq=Pc,B.sortedUniqBy=Dc,B.split=cp,B.spread=Of,B.tail=Rc,B.take=Lc,B.takeRight=xc,B.takeRightWhile=Mc,B.takeWhile=wc,B.tap=zc,B.throttle=Ff,B.thru=Ta,B.toArray=qh,B.toPairs=tu,B.toPairsIn=iu,B.toPath=Wp,B.toPlainObject=Zh,B.transform=$d,B.unary=Nf,B.union=kc,B.unionBy=Oc,B.unionWith=Fc,B.uniq=Nc,B.uniqBy=Bc,B.uniqWith=Uc,B.unset=Gd,B.unzip=Ll,B.unzipWith=kh,B.update=Hd,B.updateWith=Yd,B.values=ws,B.valuesIn=Wd,B.without=Vc,B.words=nu,B.wrap=Bf,B.xor=$c,B.xorBy=Gc,B.xorWith=Hc,B.zip=Yc,B.zipObject=Wc,B.zipObjectDeep=Kc,B.zipWith=jc,B.entries=tu,B.entriesIn=iu,B.extend=Qh,B.extendWith=Da,Vl(B,B),B.add=jp,B.attempt=au,B.camelCase=qd,B.capitalize=ru,B.ceil=zp,B.clamp=Kd,B.clone=Vf,B.cloneDeep=Gf,B.cloneDeepWith=Hf,B.cloneWith=$f,B.conformsTo=Yf,B.deburr=su,B.defaultTo=Ip,B.divide=qp,B.endsWith=Xd,B.eq=Ci,B.escape=Zd,B.escapeRegExp=Qd,B.every=nf,B.find=of,B.findIndex=Rh,B.findKey=Sd,B.findLast=lf,B.findLastIndex=Lh,B.findLastKey=Td,B.floor=Xp,B.forEach=Fh,B.forEachRight=Nh,B.forIn=_d,B.forInRight=Ad,B.forOwn=bd,B.forOwnRight=Cd,B.get=Ol,B.gt=Wf,B.gte=Kf,B.has=Dd,B.hasIn=Fl,B.head=Mh,B.identity=Zt,B.includes=df,B.indexOf=oc,B.inRange=jd,B.invoke=xd,B.isArguments=jr,B.isArray=Ne,B.isArrayBuffer=jf,B.isArrayLike=qt,B.isArrayLikeObject=bt,B.isBoolean=zf,B.isBuffer=Sr,B.isDate=qf,B.isElement=Xf,B.isEmpty=Zf,B.isEqual=Qf,B.isEqualWith=Jf,B.isError=wl,B.isFinite=ed,B.isFunction=Qi,B.isInteger=Wh,B.isLength=Ia,B.isMap=Kh,B.isMatch=td,B.isMatchWith=id,B.isNaN=rd,B.isNative=sd,B.isNil=ad,B.isNull=nd,B.isNumber=jh,B.isObject=Et,B.isObjectLike=Tt,B.isPlainObject=gn,B.isRegExp=kl,B.isSafeInteger=od,B.isSet=zh,B.isString=Pa,B.isSymbol=ii,B.isTypedArray=Ms,B.isUndefined=ld,B.isWeakMap=hd,B.isWeakSet=ud,B.join=fc,B.kebabCase=Jd,B.last=pi,B.lastIndexOf=dc,B.lowerCase=ep,B.lowerFirst=tp,B.lt=cd,B.lte=fd,B.max=Zp,B.maxBy=Qp,B.mean=Jp,B.meanBy=em,B.min=tm,B.minBy=im,B.stubArray=Gl,B.stubFalse=Hl,B.stubObject=$p,B.stubString=Gp,B.stubTrue=Hp,B.multiply=rm,B.nth=pc,B.noConflict=wp,B.noop=$l,B.now=Aa,B.pad=rp,B.padEnd=sp,B.padStart=np,B.parseInt=ap,B.random=zd,B.reduce=vf,B.reduceRight=Ef,B.repeat=lp,B.replace=hp,B.result=Bd,B.round=sm,B.runInContext=Z,B.sample=Tf,B.size=bf,B.snakeCase=up,B.some=Cf,B.sortedIndex=Tc,B.sortedIndexBy=_c,B.sortedIndexOf=Ac,B.sortedLastIndex=bc,B.sortedLastIndexBy=Cc,B.sortedLastIndexOf=Ic,B.startCase=fp,B.startsWith=dp,B.subtract=am,B.sum=om,B.sumBy=lm,B.template=pp,B.times=Yp,B.toFinite=Ji,B.toInteger=Ue,B.toLength=Xh,B.toLower=mp,B.toNumber=mi,B.toSafeInteger=dd,B.toString=ot,B.toUpper=gp,B.trim=yp,B.trimEnd=vp,B.trimStart=Ep,B.truncate=Sp,B.unescape=Tp,B.uniqueId=Kp,B.upperCase=_p,B.upperFirst=Nl,B.each=Fh,B.eachRight=Nh,B.first=Mh,Vl(B,(function(){var l={};return fi(B,function(p,_){at.call(B.prototype,_)||(l[_]=p)}),l})(),{chain:!1}),B.VERSION=s,jt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(l){B[l].placeholder=B}),jt(["drop","take"],function(l,p){Ye.prototype[l]=function(_){_=_===i?1:mt(Ue(_),0);var P=this.__filtered__&&!p?new Ye(this):this.clone();return P.__filtered__?P.__takeCount__=Rt(_,P.__takeCount__):P.__views__.push({size:Rt(_,he),type:l+(P.__dir__<0?"Right":"")}),P},Ye.prototype[l+"Right"]=function(_){return this.reverse()[l](_).reverse()}}),jt(["filter","map","takeWhile"],function(l,p){var _=p+1,P=_==te||_==me;Ye.prototype[l]=function(M){var V=this.clone();return V.__iteratees__.push({iteratee:xe(M,3),type:_}),V.__filtered__=V.__filtered__||P,V}}),jt(["head","last"],function(l,p){var _="take"+(p?"Right":"");Ye.prototype[l]=function(){return this[_](1).value()[0]}}),jt(["initial","tail"],function(l,p){var _="drop"+(p?"":"Right");Ye.prototype[l]=function(){return this.__filtered__?new Ye(this):this[_](1)}}),Ye.prototype.compact=function(){return this.filter(Zt)},Ye.prototype.find=function(l){return this.filter(l).head()},Ye.prototype.findLast=function(l){return this.reverse().find(l)},Ye.prototype.invokeMap=Ge(function(l,p){return typeof l=="function"?new Ye(this):this.map(function(_){return Hr(_,l,p)})}),Ye.prototype.reject=function(l){return this.filter(Ca(xe(l)))},Ye.prototype.slice=function(l,p){l=Ue(l);var _=this;return _.__filtered__&&(l>0||p<0)?new Ye(_):(l<0?_=_.takeRight(-l):l&&(_=_.drop(l)),p!==i&&(p=Ue(p),_=p<0?_.dropRight(-p):_.take(p-l)),_)},Ye.prototype.takeRightWhile=function(l){return this.reverse().takeWhile(l).reverse()},Ye.prototype.toArray=function(){return this.take(he)},fi(Ye.prototype,function(l,p){var _=/^(?:filter|find|map|reject)|While$/.test(p),P=/^(?:head|last)$/.test(p),M=B[P?"take"+(p=="last"?"Right":""):p],V=P||/^find/.test(p);M&&(B.prototype[p]=function(){var W=this.__wrapped__,j=P?[1]:arguments,J=W instanceof Ye,fe=j[0],de=J||Ne(W),ge=function(je){var Ze=M.apply(B,Li([je],j));return P&&Te?Ze[0]:Ze};de&&_&&typeof fe=="function"&&fe.length!=1&&(J=de=!1);var Te=this.__chain__,De=!!this.__actions__.length,we=V&&!Te,$e=J&&!De;if(!V&&de){W=$e?W:new Ye(this);var ke=l.apply(W,j);return ke.__actions__.push({func:Ta,args:[ge],thisArg:i}),new kt(ke,Te)}return we&&$e?l.apply(this,j):(ke=this.thru(ge),we?P?ke.value()[0]:ke.value():ke)})}),jt(["pop","push","shift","sort","splice","unshift"],function(l){var p=Mr[l],_=/^(?:push|sort|unshift)$/.test(l)?"tap":"thru",P=/^(?:pop|shift)$/.test(l);B.prototype[l]=function(){var M=arguments;if(P&&!this.__chain__){var V=this.value();return p.apply(Ne(V)?V:[],M)}return this[_](function(W){return p.apply(Ne(W)?W:[],M)})}}),fi(Ye.prototype,function(l,p){var _=B[p];if(_){var P=_.name+"";at.call(cr,P)||(cr[P]=[]),cr[P].push({name:p,func:_})}}),cr[pa(i,C).name]=[{name:"wrapper",func:i}],Ye.prototype.clone=Bo,Ye.prototype.reverse=Uo,Ye.prototype.value=sn,B.prototype.at=qc,B.prototype.chain=Xc,B.prototype.commit=Zc,B.prototype.next=Qc,B.prototype.plant=ef,B.prototype.reverse=tf,B.prototype.toJSON=B.prototype.valueOf=B.prototype.value=rf,B.prototype.first=B.prototype.head,Or&&(B.prototype[Or]=Jc),B}),Mi=To();typeof t=="function"&&typeof t.amd=="object"&&t.amd?(It._=Mi,t(function(){return Mi})):rt?((rt.exports=Mi)._=Mi,rs._=Mi):It._=Mi}).call(lodash)})(lodash$1,lodash$1.exports)),lodash$1.exports}var lodashExports=requireLodash();function updateColor(r,e){const t=i=>{i&&typeof i=="object"&&(i.c&&Array.isArray(i.c.k)&&(i.c.k=hexToRgbArray(e)),Object.values(i).forEach(t))};return t(r),r}function hexToRgbArray(r){const e=parseInt(r.replace("#",""),16);return[(e>>16)/255,(e>>8&255)/255,(e&255)/255]}function Loading({classNames:r,color:e="#ffffff"}){const t=updateColor(lodashExports.cloneDeep(animationData),e);return jsxRuntime.jsx(Player,{className:r,autoplay:!0,loop:!0,src:t})}function MaximizeSvg({width:r=24}){return jsxRuntime.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{d:"M2 9.75C1.59 9.75 1.25 9.41 1.25 9V6.5C1.25 3.61 3.61 1.25 6.5 1.25H9C9.41 1.25 9.75 1.59 9.75 2C9.75 2.41 9.41 2.75 9 2.75H6.5C4.43 2.75 2.75 4.43 2.75 6.5V9C2.75 9.41 2.41 9.75 2 9.75Z",fill:"#fff"}),jsxRuntime.jsx("path",{d:"M22 9.75C21.59 9.75 21.25 9.41 21.25 9V6.5C21.25 4.43 19.57 2.75 17.5 2.75H15C14.59 2.75 14.25 2.41 14.25 2C14.25 1.59 14.59 1.25 15 1.25H17.5C20.39 1.25 22.75 3.61 22.75 6.5V9C22.75 9.41 22.41 9.75 22 9.75Z",fill:"#fff"}),jsxRuntime.jsx("path",{d:"M17.5 22.75H16C15.59 22.75 15.25 22.41 15.25 22C15.25 21.59 15.59 21.25 16 21.25H17.5C19.57 21.25 21.25 19.57 21.25 17.5V16C21.25 15.59 21.59 15.25 22 15.25C22.41 15.25 22.75 15.59 22.75 16V17.5C22.75 20.39 20.39 22.75 17.5 22.75Z",fill:"#fff"}),jsxRuntime.jsx("path",{d:"M9 22.75H6.5C3.61 22.75 1.25 20.39 1.25 17.5V15C1.25 14.59 1.59 14.25 2 14.25C2.41 14.25 2.75 14.59 2.75 15V17.5C2.75 19.57 4.43 21.25 6.5 21.25H9C9.41 21.25 9.75 21.59 9.75 22C9.75 22.41 9.41 22.75 9 22.75Z",fill:"#fff"})]})}function BackwardSvg({width:r=24}){return jsxRuntime.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{d:"M14.43 16.92H12.14C11.73 16.92 11.39 16.58 11.39 16.17C11.39 15.76 11.73 15.42 12.14 15.42H14.43C14.86 15.42 15.21 15.07 15.21 14.64C15.21 14.21 14.86 13.86 14.43 13.86H12.14C11.9 13.86 11.67 13.74 11.53 13.55C11.39 13.36 11.35 13.1 11.43 12.87L12.19 10.58C12.29 10.27 12.58 10.07 12.9 10.07H15.96C16.37 10.07 16.71 10.41 16.71 10.82C16.71 11.23 16.37 11.57 15.96 11.57H13.44L13.18 12.36H14.43C15.69 12.36 16.71 13.38 16.71 14.64C16.71 15.9 15.68 16.92 14.43 16.92Z",fill:"#fff"}),jsxRuntime.jsx("path",{d:"M9.53998 16.92C9.12998 16.92 8.78998 16.58 8.78998 16.17V12.78L8.59998 13C8.31998 13.31 7.84998 13.33 7.53998 13.06C7.23998 12.78 7.20998 12.31 7.48998 12L8.98998 10.33C9.19998 10.1 9.52998 10.02 9.81998 10.13C10.11 10.24 10.3 10.52 10.3 10.83V16.18C10.29 16.59 9.95998 16.92 9.53998 16.92Z",fill:"#fff"}),jsxRuntime.jsx("path",{d:"M12 3.48006C11.92 3.48006 11.84 3.49006 11.76 3.49006L12.58 2.47006C12.84 2.15006 12.79 1.67006 12.46 1.42006C12.13 1.17006 11.67 1.21006 11.41 1.54006L9.44001 4.00006C9.43001 4.01006 9.43001 4.02006 9.42001 4.04006C9.39001 4.08006 9.37001 4.13006 9.35001 4.17006C9.33001 4.22006 9.31001 4.26006 9.30001 4.30006C9.29001 4.35006 9.29001 4.39006 9.29001 4.44006C9.29001 4.49006 9.29001 4.54006 9.29001 4.59006C9.29001 4.61006 9.29001 4.62006 9.29001 4.64006C9.30001 4.67006 9.32001 4.69006 9.33001 4.72006C9.35001 4.77006 9.37001 4.81006 9.39001 4.86006C9.42001 4.90006 9.45001 4.94006 9.49001 4.97006C9.51001 5.00006 9.52001 5.03006 9.55001 5.05006C9.57001 5.06006 9.58001 5.07006 9.60001 5.08006C9.62001 5.10006 9.65001 5.11006 9.68001 5.12006C9.73001 5.15006 9.79001 5.17006 9.84001 5.18006C9.88001 5.20006 9.91001 5.20006 9.94001 5.20006C9.97001 5.20006 9.99001 5.21006 10.02 5.21006C10.05 5.21006 10.07 5.20006 10.09 5.19006C10.12 5.19006 10.15 5.20006 10.18 5.19006C10.82 5.04006 11.42 4.97006 11.99 4.97006C16.48 4.97006 20.13 8.62006 20.13 13.1101C20.13 17.6001 16.48 21.2501 11.99 21.2501C7.50001 21.2501 3.85001 17.6001 3.85001 13.1101C3.85001 11.3701 4.42001 9.69006 5.50001 8.25006C5.75001 7.92006 5.68001 7.45006 5.35001 7.20006C5.02001 6.95006 4.55001 7.02006 4.30001 7.35006C3.02001 9.05006 2.35001 11.0401 2.35001 13.1101C2.35001 18.4201 6.67001 22.7501 11.99 22.7501C17.31 22.7501 21.63 18.4301 21.63 13.1101C21.63 7.79006 17.31 3.48006 12 3.48006Z",fill:"#fff"})]})}function ForwardSvg({width:r=24}){return jsxRuntime.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{d:"M14.43 16.92H12.14C11.73 16.92 11.39 16.58 11.39 16.17C11.39 15.76 11.73 15.42 12.14 15.42H14.43C14.86 15.42 15.21 15.07 15.21 14.64C15.21 14.21 14.86 13.86 14.43 13.86H12.14C11.9 13.86 11.67 13.74 11.53 13.55C11.39 13.36 11.35 13.1 11.43 12.87L12.19 10.58C12.29 10.27 12.58 10.07 12.9 10.07H15.96C16.37 10.07 16.71 10.41 16.71 10.82C16.71 11.23 16.37 11.57 15.96 11.57H13.44L13.18 12.36H14.43C15.69 12.36 16.71 13.38 16.71 14.64C16.71 15.9 15.68 16.92 14.43 16.92Z",fill:"#fff"}),jsxRuntime.jsx("path",{d:"M9.53998 16.92C9.12998 16.92 8.78998 16.58 8.78998 16.17V12.78L8.59998 13C8.31998 13.31 7.84998 13.33 7.53998 13.06C7.23998 12.78 7.20998 12.31 7.48998 12L8.98998 10.33C9.19998 10.1 9.52998 10.02 9.81998 10.13C10.11 10.24 10.3 10.52 10.3 10.83V16.18C10.29 16.59 9.95998 16.92 9.53998 16.92Z",fill:"#fff"}),jsxRuntime.jsx("path",{d:"M19.69 7.35002C19.44 7.02002 18.97 6.95002 18.64 7.20002C18.31 7.45002 18.24 7.92002 18.49 8.25002C19.57 9.69002 20.14 11.37 20.14 13.11C20.14 17.6 16.49 21.25 12 21.25C7.51001 21.25 3.86001 17.6 3.86001 13.11C3.86001 8.62002 7.51001 4.98002 12 4.98002C12.58 4.98002 13.17 5.05002 13.81 5.20002C13.84 5.21002 13.87 5.20002 13.9 5.20002C13.93 5.20002 13.95 5.22002 13.97 5.22002C14 5.22002 14.02 5.21002 14.05 5.21002C14.08 5.21002 14.11 5.20002 14.15 5.19002C14.21 5.18002 14.26 5.15002 14.31 5.13002C14.34 5.11002 14.37 5.10002 14.4 5.08002C14.41 5.07002 14.43 5.07002 14.44 5.06002C14.47 5.04002 14.48 5.01002 14.5 4.99002C14.54 4.95002 14.57 4.92002 14.6 4.87002C14.63 4.83002 14.64 4.78002 14.66 4.73002C14.67 4.70002 14.69 4.67002 14.7 4.64002C14.7 4.62002 14.7 4.61002 14.7 4.59002C14.71 4.54002 14.71 4.49002 14.7 4.44002C14.7 4.39002 14.7 4.35002 14.69 4.30002C14.68 4.26002 14.66 4.22002 14.64 4.17002C14.62 4.12002 14.6 4.07002 14.57 4.03002C14.57 4.02002 14.57 4.01002 14.56 4.00002L12.58 1.53002C12.32 1.21002 11.85 1.15002 11.53 1.41002C11.21 1.67002 11.16 2.14002 11.41 2.46002L12.23 3.48002C12.15 3.48002 12.07 3.47002 11.99 3.47002C6.68001 3.47002 2.35001 7.79002 2.35001 13.11C2.35001 18.43 6.67001 22.75 11.99 22.75C17.31 22.75 21.63 18.43 21.63 13.11C21.64 11.04 20.96 9.05002 19.69 7.35002Z",fill:"#fff"})]})}function VolumeUnMuteSvg({width:r}){return jsxRuntime.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{d:"M18 16.75C17.84 16.75 17.69 16.7 17.55 16.6C17.22 16.35 17.15 15.88 17.4 15.55C18.97 13.46 18.97 10.54 17.4 8.45003C17.15 8.12003 17.22 7.65003 17.55 7.40003C17.88 7.15003 18.35 7.22003 18.6 7.55003C20.56 10.17 20.56 13.83 18.6 16.45C18.45 16.65 18.23 16.75 18 16.75Z",fill:"#fff"}),jsxRuntime.jsx("path",{d:"M19.83 19.25C19.67 19.25 19.52 19.2 19.38 19.1C19.05 18.85 18.98 18.38 19.23 18.05C21.9 14.49 21.9 9.51003 19.23 5.95003C18.98 5.62003 19.05 5.15003 19.38 4.90003C19.71 4.65003 20.18 4.72003 20.43 5.05003C23.5 9.14003 23.5 14.86 20.43 18.95C20.29 19.15 20.06 19.25 19.83 19.25Z",fill:"#fff"}),jsxRuntime.jsx("path",{d:"M14.02 3.78003C12.9 3.16003 11.47 3.32003 10.01 4.23003L7.09 6.06003C6.89 6.18003 6.66 6.25003 6.43 6.25003H5.5H5C2.58 6.25003 1.25 7.58003 1.25 10V14C1.25 16.42 2.58 17.75 5 17.75H5.5H6.43C6.66 17.75 6.89 17.82 7.09 17.94L10.01 19.77C10.89 20.32 11.75 20.59 12.55 20.59C13.07 20.59 13.57 20.47 14.02 20.22C15.13 19.6 15.75 18.31 15.75 16.59V7.41003C15.75 5.69003 15.13 4.40003 14.02 3.78003Z",fill:"#fff"})]})}function VolumeMuteSvg({width:r=24}){return jsxRuntime.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{d:"M7 17.75H5C2.58 17.75 1.25 16.42 1.25 14V9.99999C1.25 7.57999 2.58 6.24999 5 6.24999H6.43C6.66 6.24999 6.89 6.17999 7.09 6.05999L10.01 4.22999C11.47 3.31999 12.89 3.14999 14.01 3.76999C15.13 4.38999 15.74 5.67999 15.74 7.40999V8.36999C15.74 8.77999 15.4 9.11999 14.99 9.11999C14.58 9.11999 14.24 8.77999 14.24 8.36999V7.40999C14.24 6.26999 13.89 5.41999 13.28 5.08999C12.67 4.74999 11.77 4.89999 10.8 5.50999L7.88 7.32999C7.45 7.60999 6.94 7.74999 6.43 7.74999H5C3.42 7.74999 2.75 8.41999 2.75 9.99999V14C2.75 15.58 3.42 16.25 5 16.25H7C7.41 16.25 7.75 16.59 7.75 17C7.75 17.41 7.41 17.75 7 17.75Z",fill:"#fff"}),jsxRuntime.jsx("path",{d:"M12.55 20.59C11.76 20.59 10.89 20.31 10.02 19.76C9.67003 19.54 9.56003 19.08 9.78003 18.73C10 18.38 10.46 18.27 10.81 18.49C11.78 19.09 12.68 19.25 13.29 18.91C13.9 18.57 14.25 17.72 14.25 16.59V12.95C14.25 12.54 14.59 12.2 15 12.2C15.41 12.2 15.75 12.54 15.75 12.95V16.59C15.75 18.31 15.13 19.61 14.02 20.23C13.57 20.47 13.07 20.59 12.55 20.59Z",fill:"#fff"}),jsxRuntime.jsx("path",{d:"M18 16.75C17.84 16.75 17.69 16.7 17.55 16.6C17.22 16.35 17.15 15.88 17.4 15.55C18.66 13.87 18.93 11.64 18.12 9.71001C17.96 9.33001 18.14 8.89001 18.52 8.73001C18.9 8.57001 19.34 8.75001 19.5 9.13001C20.52 11.55 20.17 14.36 18.6 16.46C18.45 16.65 18.23 16.75 18 16.75Z",fill:"#fff"}),jsxRuntime.jsx("path",{d:"M19.83 19.25C19.67 19.25 19.52 19.2 19.38 19.1C19.05 18.85 18.98 18.38 19.23 18.05C21.37 15.2 21.84 11.38 20.46 8.09002C20.3 7.71002 20.48 7.27002 20.86 7.11002C21.25 6.95002 21.68 7.13002 21.84 7.51002C23.43 11.29 22.89 15.67 20.43 18.95C20.29 19.15 20.06 19.25 19.83 19.25Z",fill:"#fff"}),jsxRuntime.jsx("path",{d:"M2 22.75C1.81 22.75 1.62 22.68 1.47 22.53C1.18 22.24 1.18 21.76 1.47 21.47L21.47 1.47C21.76 1.18 22.24 1.18 22.53 1.47C22.82 1.76 22.82 2.24 22.53 2.53L2.53 22.53C2.38 22.68 2.19 22.75 2 22.75Z",fill:"#fff"})]})}function PauseSvg({width:r=24}){return jsxRuntime.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M11.97 2C6.45 2 1.97 6.48 1.97 12C1.97 17.52 6.45 22 11.97 22C17.49 22 21.97 17.52 21.97 12C21.97 6.48 17.5 2 11.97 2ZM10.72 15.03C10.72 15.51 10.52 15.7 10.01 15.7H8.71C8.2 15.7 8 15.51 8 15.03V8.97C8 8.49 8.2 8.3 8.71 8.3H10C10.51 8.3 10.71 8.49 10.71 8.97V15.03H10.72ZM16 15.03C16 15.51 15.8 15.7 15.29 15.7H14C13.49 15.7 13.29 15.51 13.29 15.03V8.97C13.29 8.49 13.49 8.3 14 8.3H15.29C15.8 8.3 16 8.49 16 8.97V15.03Z",fill:"#fff"})})}function commonjsRequire(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var moment$2={exports:{}},moment$1=moment$2.exports,hasRequiredMoment;function requireMoment(){return hasRequiredMoment||(hasRequiredMoment=1,(function(r,e){(function(t,i){r.exports=i()})(moment$1,(function(){var t;function i(){return t.apply(null,arguments)}function s(y){t=y}function n(y){return y instanceof Array||Object.prototype.toString.call(y)==="[object Array]"}function a(y){return y!=null&&Object.prototype.toString.call(y)==="[object Object]"}function o(y,A){return Object.prototype.hasOwnProperty.call(y,A)}function c(y){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(y).length===0;var A;for(A in y)if(o(y,A))return!1;return!0}function u(y){return y===void 0}function f(y){return typeof y=="number"||Object.prototype.toString.call(y)==="[object Number]"}function d(y){return y instanceof Date||Object.prototype.toString.call(y)==="[object Date]"}function g(y,A){var D=[],R,N=y.length;for(R=0;R<N;++R)D.push(A(y[R],R));return D}function E(y,A){for(var D in A)o(A,D)&&(y[D]=A[D]);return o(A,"toString")&&(y.toString=A.toString),o(A,"valueOf")&&(y.valueOf=A.valueOf),y}function m(y,A,D,R){return hs(y,A,D,R,!0).utc()}function T(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function S(y){return y._pf==null&&(y._pf=T()),y._pf}var b;Array.prototype.some?b=Array.prototype.some:b=function(y){var A=Object(this),D=A.length>>>0,R;for(R=0;R<D;R++)if(R in A&&y.call(this,A[R],R,A))return!0;return!1};function C(y){var A=null,D=!1,R=y._d&&!isNaN(y._d.getTime());if(R&&(A=S(y),D=b.call(A.parsedDateParts,function(N){return N!=null}),R=A.overflow<0&&!A.empty&&!A.invalidEra&&!A.invalidMonth&&!A.invalidWeekday&&!A.weekdayMismatch&&!A.nullInput&&!A.invalidFormat&&!A.userInvalidated&&(!A.meridiem||A.meridiem&&D),y._strict&&(R=R&&A.charsLeftOver===0&&A.unusedTokens.length===0&&A.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(y))y._isValid=R;else return R;return y._isValid}function I(y){var A=m(NaN);return y!=null?E(S(A),y):S(A).userInvalidated=!0,A}var L=i.momentProperties=[],k=!1;function U(y,A){var D,R,N,K=L.length;if(u(A._isAMomentObject)||(y._isAMomentObject=A._isAMomentObject),u(A._i)||(y._i=A._i),u(A._f)||(y._f=A._f),u(A._l)||(y._l=A._l),u(A._strict)||(y._strict=A._strict),u(A._tzm)||(y._tzm=A._tzm),u(A._isUTC)||(y._isUTC=A._isUTC),u(A._offset)||(y._offset=A._offset),u(A._pf)||(y._pf=S(A)),u(A._locale)||(y._locale=A._locale),K>0)for(D=0;D<K;D++)R=L[D],N=A[R],u(N)||(y[R]=N);return y}function O(y){U(this,y),this._d=new Date(y._d!=null?y._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),k===!1&&(k=!0,i.updateOffset(this),k=!1)}function F(y){return y instanceof O||y!=null&&y._isAMomentObject!=null}function G(y){i.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+y)}function x(y,A){var D=!0;return E(function(){if(i.deprecationHandler!=null&&i.deprecationHandler(null,y),D){var R=[],N,K,oe,_e=arguments.length;for(K=0;K<_e;K++){if(N="",typeof arguments[K]=="object"){N+=`
276
276
  [`+K+"] ";for(oe in arguments[0])o(arguments[0],oe)&&(N+=oe+": "+arguments[0][oe]+", ");N=N.slice(0,-2)}else N=arguments[K];R.push(N)}G(y+`
277
277
  Arguments: `+Array.prototype.slice.call(R).join("")+`
278
- `+new Error().stack),D=!1}return A.apply(this,arguments)},A)}var $={};function X(y,A){i.deprecationHandler!=null&&i.deprecationHandler(y,A),$[y]||(G(A),$[y]=!0)}i.suppressDeprecationWarnings=!1,i.deprecationHandler=null;function Q(y){return typeof Function<"u"&&y instanceof Function||Object.prototype.toString.call(y)==="[object Function]"}function ee(y){var A,D;for(D in y)o(y,D)&&(A=y[D],Q(A)?this[D]=A:this["_"+D]=A);this._config=y,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function te(y,A){var D=E({},y),R;for(R in A)o(A,R)&&(a(y[R])&&a(A[R])?(D[R]={},E(D[R],y[R]),E(D[R],A[R])):A[R]!=null?D[R]=A[R]:delete D[R]);for(R in y)o(y,R)&&!o(A,R)&&a(y[R])&&(D[R]=E({},D[R]));return D}function re(y){y!=null&&this.set(y)}var me;Object.keys?me=Object.keys:me=function(y){var A,D=[];for(A in y)o(y,A)&&D.push(A);return D};var H={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function z(y,A,D){var R=this._calendar[y]||this._calendar.sameElse;return Q(R)?R.call(A,D):R}function ie(y,A,D){var R=""+Math.abs(y),N=A-R.length,K=y>=0;return(K?D?"+":"":"-")+Math.pow(10,Math.max(0,N)).toString().substr(1)+R}var ne=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,he=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,pe={},Pe={};function ae(y,A,D,R){var N=R;typeof R=="string"&&(N=function(){return this[R]()}),y&&(Pe[y]=N),A&&(Pe[A[0]]=function(){return ie(N.apply(this,arguments),A[1],A[2])}),D&&(Pe[D]=function(){return this.localeData().ordinal(N.apply(this,arguments),y)})}function Ae(y){return y.match(/\[[\s\S]/)?y.replace(/^\[|\]$/g,""):y.replace(/\\/g,"")}function Re(y){var A=y.match(ne),D,R;for(D=0,R=A.length;D<R;D++)Pe[A[D]]?A[D]=Pe[A[D]]:A[D]=Ae(A[D]);return function(N){var K="",oe;for(oe=0;oe<R;oe++)K+=Q(A[oe])?A[oe].call(N,y):A[oe];return K}}function Le(y,A){return y.isValid()?(A=Y(A,y.localeData()),pe[A]=pe[A]||Re(A),pe[A](y)):y.localeData().invalidDate()}function Y(y,A){var D=5;function R(N){return A.longDateFormat(N)||N}for(he.lastIndex=0;D>=0&&he.test(y);)y=y.replace(he,R),he.lastIndex=0,D-=1;return y}var q={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function le(y){var A=this._longDateFormat[y],D=this._longDateFormat[y.toUpperCase()];return A||!D?A:(this._longDateFormat[y]=D.match(ne).map(function(R){return R==="MMMM"||R==="MM"||R==="DD"||R==="dddd"?R.slice(1):R}).join(""),this._longDateFormat[y])}var ce="Invalid date";function Ee(){return this._invalidDate}var ve="%d",Be=/\d{1,2}/;function Ie(y){return this._ordinal.replace("%d",y)}var Me={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Ve(y,A,D,R){var N=this._relativeTime[D];return Q(N)?N(y,A,D,R):N.replace(/%d/i,y)}function dt(y,A){var D=this._relativeTime[y>0?"future":"past"];return Q(D)?D(A):D.replace(/%s/i,A)}var Qe={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function ze(y){return typeof y=="string"?Qe[y]||Qe[y.toLowerCase()]:void 0}function Je(y){var A={},D,R;for(R in y)o(y,R)&&(D=ze(R),D&&(A[D]=y[R]));return A}var gt={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function yt(y){var A=[],D;for(D in y)o(y,D)&&A.push({unit:D,priority:gt[D]});return A.sort(function(R,N){return R.priority-N.priority}),A}var _t=/\d/,qe=/\d\d/,Yt=/\d{3}/,Dt=/\d{4}/,St=/[+-]?\d{6}/,Se=/\d\d?/,lt=/\d\d\d\d?/,ht=/\d\d\d\d\d\d?/,pt=/\d{1,3}/,Ui=/\d{1,4}/,Pi=/[+-]?\d{1,6}/,Di=/\d+/,tr=/[+-]?\d+/,ks=/Z|[+-]\d\d:?\d\d/gi,zr=/Z|[+-]\d\d(?::?\d\d)?/gi,Ra=/[+-]?\d+(\.\d{1,3})?/,Tr=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Vi=/^[1-9]\d?/,qr=/^([1-9]\d|\d)/,Xr;Xr={};function Ce(y,A,D){Xr[y]=Q(A)?A:function(R,N){return R&&D?D:A}}function La(y,A){return o(Xr,y)?Xr[y](A._strict,A._locale):new RegExp(xa(y))}function xa(y){return ni(y.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(A,D,R,N,K){return D||R||N||K}))}function ni(y){return y.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Wt(y){return y<0?Math.ceil(y)||0:Math.floor(y)}function He(y){var A=+y,D=0;return A!==0&&isFinite(A)&&(D=Wt(A)),D}var Os={};function it(y,A){var D,R=A,N;for(typeof y=="string"&&(y=[y]),f(A)&&(R=function(K,oe){oe[A]=He(K)}),N=y.length,D=0;D<N;D++)Os[y[D]]=R}function _r(y,A){it(y,function(D,R,N,K){N._w=N._w||{},A(D,N._w,N,K)})}function Fs(y,A,D){A!=null&&o(Os,y)&&Os[y](A,D._a,D,y)}function Zr(y){return y%4===0&&y%100!==0||y%400===0}var xt=0,gi=1,ai=2,At=3,Qt=4,yi=5,$i=6,yn=7,Ma=8;ae("Y",0,0,function(){var y=this.year();return y<=9999?ie(y,4):"+"+y}),ae(0,["YY",2],0,function(){return this.year()%100}),ae(0,["YYYY",4],0,"year"),ae(0,["YYYYY",5],0,"year"),ae(0,["YYYYYY",6,!0],0,"year"),Ce("Y",tr),Ce("YY",Se,qe),Ce("YYYY",Ui,Dt),Ce("YYYYY",Pi,St),Ce("YYYYYY",Pi,St),it(["YYYYY","YYYYYY"],xt),it("YYYY",function(y,A){A[xt]=y.length===2?i.parseTwoDigitYear(y):He(y)}),it("YY",function(y,A){A[xt]=i.parseTwoDigitYear(y)}),it("Y",function(y,A){A[xt]=parseInt(y,10)});function Ar(y){return Zr(y)?366:365}i.parseTwoDigitYear=function(y){return He(y)+(He(y)>68?1900:2e3)};var vn=ir("FullYear",!0);function wa(){return Zr(this.year())}function ir(y,A){return function(D){return D!=null?(Cr(this,y,D),i.updateOffset(this,A),this):br(this,y)}}function br(y,A){if(!y.isValid())return NaN;var D=y._d,R=y._isUTC;switch(A){case"Milliseconds":return R?D.getUTCMilliseconds():D.getMilliseconds();case"Seconds":return R?D.getUTCSeconds():D.getSeconds();case"Minutes":return R?D.getUTCMinutes():D.getMinutes();case"Hours":return R?D.getUTCHours():D.getHours();case"Date":return R?D.getUTCDate():D.getDate();case"Day":return R?D.getUTCDay():D.getDay();case"Month":return R?D.getUTCMonth():D.getMonth();case"FullYear":return R?D.getUTCFullYear():D.getFullYear();default:return NaN}}function Cr(y,A,D){var R,N,K,oe,_e;if(!(!y.isValid()||isNaN(D))){switch(R=y._d,N=y._isUTC,A){case"Milliseconds":return void(N?R.setUTCMilliseconds(D):R.setMilliseconds(D));case"Seconds":return void(N?R.setUTCSeconds(D):R.setSeconds(D));case"Minutes":return void(N?R.setUTCMinutes(D):R.setMinutes(D));case"Hours":return void(N?R.setUTCHours(D):R.setHours(D));case"Date":return void(N?R.setUTCDate(D):R.setDate(D));case"FullYear":break;default:return}K=D,oe=y.month(),_e=y.date(),_e=_e===29&&oe===1&&!Zr(K)?28:_e,N?R.setUTCFullYear(K,oe,_e):R.setFullYear(K,oe,_e)}}function ka(y){return y=ze(y),Q(this[y])?this[y]():this}function Qr(y,A){if(typeof y=="object"){y=Je(y);var D=yt(y),R,N=D.length;for(R=0;R<N;R++)this[D[R].unit](y[D[R].unit])}else if(y=ze(y),Q(this[y]))return this[y](A);return this}function Oa(y,A){return(y%A+A)%A}var vt;Array.prototype.indexOf?vt=Array.prototype.indexOf:vt=function(y){var A;for(A=0;A<this.length;++A)if(this[A]===y)return A;return-1};function Ns(y,A){if(isNaN(y)||isNaN(A))return NaN;var D=Oa(A,12);return y+=(A-D)/12,D===1?Zr(y)?29:28:31-D%7%2}ae("M",["MM",2],"Mo",function(){return this.month()+1}),ae("MMM",0,0,function(y){return this.localeData().monthsShort(this,y)}),ae("MMMM",0,0,function(y){return this.localeData().months(this,y)}),Ce("M",Se,Vi),Ce("MM",Se,qe),Ce("MMM",function(y,A){return A.monthsShortRegex(y)}),Ce("MMMM",function(y,A){return A.monthsRegex(y)}),it(["M","MM"],function(y,A){A[gi]=He(y)-1}),it(["MMM","MMMM"],function(y,A,D,R){var N=D._locale.monthsParse(y,R,D._strict);N!=null?A[gi]=N:S(D).invalidMonth=y});var En="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Bs="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Us=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Fa=Tr,Na=Tr;function Ba(y,A){return y?n(this._months)?this._months[y.month()]:this._months[(this._months.isFormat||Us).test(A)?"format":"standalone"][y.month()]:n(this._months)?this._months:this._months.standalone}function Ua(y,A){return y?n(this._monthsShort)?this._monthsShort[y.month()]:this._monthsShort[Us.test(A)?"format":"standalone"][y.month()]:n(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function Sn(y,A,D){var R,N,K,oe=y.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],R=0;R<12;++R)K=m([2e3,R]),this._shortMonthsParse[R]=this.monthsShort(K,"").toLocaleLowerCase(),this._longMonthsParse[R]=this.months(K,"").toLocaleLowerCase();return D?A==="MMM"?(N=vt.call(this._shortMonthsParse,oe),N!==-1?N:null):(N=vt.call(this._longMonthsParse,oe),N!==-1?N:null):A==="MMM"?(N=vt.call(this._shortMonthsParse,oe),N!==-1?N:(N=vt.call(this._longMonthsParse,oe),N!==-1?N:null)):(N=vt.call(this._longMonthsParse,oe),N!==-1?N:(N=vt.call(this._shortMonthsParse,oe),N!==-1?N:null))}function Tn(y,A,D){var R,N,K;if(this._monthsParseExact)return Sn.call(this,y,A,D);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),R=0;R<12;R++){if(N=m([2e3,R]),D&&!this._longMonthsParse[R]&&(this._longMonthsParse[R]=new RegExp("^"+this.months(N,"").replace(".","")+"$","i"),this._shortMonthsParse[R]=new RegExp("^"+this.monthsShort(N,"").replace(".","")+"$","i")),!D&&!this._monthsParse[R]&&(K="^"+this.months(N,"")+"|^"+this.monthsShort(N,""),this._monthsParse[R]=new RegExp(K.replace(".",""),"i")),D&&A==="MMMM"&&this._longMonthsParse[R].test(y))return R;if(D&&A==="MMM"&&this._shortMonthsParse[R].test(y))return R;if(!D&&this._monthsParse[R].test(y))return R}}function Vs(y,A){if(!y.isValid())return y;if(typeof A=="string"){if(/^\d+$/.test(A))A=He(A);else if(A=y.localeData().monthsParse(A),!f(A))return y}var D=A,R=y.date();return R=R<29?R:Math.min(R,Ns(y.year(),D)),y._isUTC?y._d.setUTCMonth(D,R):y._d.setMonth(D,R),y}function Jr(y){return y!=null?(Vs(this,y),i.updateOffset(this,!0),this):br(this,"Month")}function Va(){return Ns(this.year(),this.month())}function _n(y){return this._monthsParseExact?(o(this,"_monthsRegex")||$s.call(this),y?this._monthsShortStrictRegex:this._monthsShortRegex):(o(this,"_monthsShortRegex")||(this._monthsShortRegex=Fa),this._monthsShortStrictRegex&&y?this._monthsShortStrictRegex:this._monthsShortRegex)}function es(y){return this._monthsParseExact?(o(this,"_monthsRegex")||$s.call(this),y?this._monthsStrictRegex:this._monthsRegex):(o(this,"_monthsRegex")||(this._monthsRegex=Na),this._monthsStrictRegex&&y?this._monthsStrictRegex:this._monthsRegex)}function $s(){function y(Oe,We){return We.length-Oe.length}var A=[],D=[],R=[],N,K,oe,_e;for(N=0;N<12;N++)K=m([2e3,N]),oe=ni(this.monthsShort(K,"")),_e=ni(this.months(K,"")),A.push(oe),D.push(_e),R.push(_e),R.push(oe);A.sort(y),D.sort(y),R.sort(y),this._monthsRegex=new RegExp("^("+R.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+D.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+A.join("|")+")","i")}function $a(y,A,D,R,N,K,oe){var _e;return y<100&&y>=0?(_e=new Date(y+400,A,D,R,N,K,oe),isFinite(_e.getFullYear())&&_e.setFullYear(y)):_e=new Date(y,A,D,R,N,K,oe),_e}function rr(y){var A,D;return y<100&&y>=0?(D=Array.prototype.slice.call(arguments),D[0]=y+400,A=new Date(Date.UTC.apply(null,D)),isFinite(A.getUTCFullYear())&&A.setUTCFullYear(y)):A=new Date(Date.UTC.apply(null,arguments)),A}function Ir(y,A,D){var R=7+A-D,N=(7+rr(y,0,R).getUTCDay()-A)%7;return-N+R-1}function ts(y,A,D,R,N){var K=(7+D-R)%7,oe=Ir(y,R,N),_e=1+7*(A-1)+K+oe,Oe,We;return _e<=0?(Oe=y-1,We=Ar(Oe)+_e):_e>Ar(y)?(Oe=y+1,We=_e-Ar(y)):(Oe=y,We=_e),{year:Oe,dayOfYear:We}}function Pr(y,A,D){var R=Ir(y.year(),A,D),N=Math.floor((y.dayOfYear()-R-1)/7)+1,K,oe;return N<1?(oe=y.year()-1,K=N+oi(oe,A,D)):N>oi(y.year(),A,D)?(K=N-oi(y.year(),A,D),oe=y.year()+1):(oe=y.year(),K=N),{week:K,year:oe}}function oi(y,A,D){var R=Ir(y,A,D),N=Ir(y+1,A,D);return(Ar(y)-R+N)/7}ae("w",["ww",2],"wo","week"),ae("W",["WW",2],"Wo","isoWeek"),Ce("w",Se,Vi),Ce("ww",Se,qe),Ce("W",Se,Vi),Ce("WW",Se,qe),_r(["w","ww","W","WW"],function(y,A,D,R){A[R.substr(0,1)]=He(y)});function Gs(y){return Pr(y,this._week.dow,this._week.doy).week}var Hs={dow:0,doy:6};function sr(){return this._week.dow}function An(){return this._week.doy}function bn(y){var A=this.localeData().week(this);return y==null?A:this.add((y-A)*7,"d")}function Ga(y){var A=Pr(this,1,4).week;return y==null?A:this.add((y-A)*7,"d")}ae("d",0,"do","day"),ae("dd",0,0,function(y){return this.localeData().weekdaysMin(this,y)}),ae("ddd",0,0,function(y){return this.localeData().weekdaysShort(this,y)}),ae("dddd",0,0,function(y){return this.localeData().weekdays(this,y)}),ae("e",0,0,"weekday"),ae("E",0,0,"isoWeekday"),Ce("d",Se),Ce("e",Se),Ce("E",Se),Ce("dd",function(y,A){return A.weekdaysMinRegex(y)}),Ce("ddd",function(y,A){return A.weekdaysShortRegex(y)}),Ce("dddd",function(y,A){return A.weekdaysRegex(y)}),_r(["dd","ddd","dddd"],function(y,A,D,R){var N=D._locale.weekdaysParse(y,R,D._strict);N!=null?A.d=N:S(D).invalidWeekday=y}),_r(["d","e","E"],function(y,A,D,R){A[R]=He(y)});function Cn(y,A){return typeof y!="string"?y:isNaN(y)?(y=A.weekdaysParse(y),typeof y=="number"?y:null):parseInt(y,10)}function In(y,A){return typeof y=="string"?A.weekdaysParse(y)%7||7:isNaN(y)?null:y}function is(y,A){return y.slice(A,7).concat(y.slice(0,A))}var Pn="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Dn="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Ha="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Ya=Tr,Rn=Tr,Wa=Tr;function Ka(y,A){var D=n(this._weekdays)?this._weekdays:this._weekdays[y&&y!==!0&&this._weekdays.isFormat.test(A)?"format":"standalone"];return y===!0?is(D,this._week.dow):y?D[y.day()]:D}function ja(y){return y===!0?is(this._weekdaysShort,this._week.dow):y?this._weekdaysShort[y.day()]:this._weekdaysShort}function za(y){return y===!0?is(this._weekdaysMin,this._week.dow):y?this._weekdaysMin[y.day()]:this._weekdaysMin}function Ys(y,A,D){var R,N,K,oe=y.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],R=0;R<7;++R)K=m([2e3,1]).day(R),this._minWeekdaysParse[R]=this.weekdaysMin(K,"").toLocaleLowerCase(),this._shortWeekdaysParse[R]=this.weekdaysShort(K,"").toLocaleLowerCase(),this._weekdaysParse[R]=this.weekdays(K,"").toLocaleLowerCase();return D?A==="dddd"?(N=vt.call(this._weekdaysParse,oe),N!==-1?N:null):A==="ddd"?(N=vt.call(this._shortWeekdaysParse,oe),N!==-1?N:null):(N=vt.call(this._minWeekdaysParse,oe),N!==-1?N:null):A==="dddd"?(N=vt.call(this._weekdaysParse,oe),N!==-1||(N=vt.call(this._shortWeekdaysParse,oe),N!==-1)?N:(N=vt.call(this._minWeekdaysParse,oe),N!==-1?N:null)):A==="ddd"?(N=vt.call(this._shortWeekdaysParse,oe),N!==-1||(N=vt.call(this._weekdaysParse,oe),N!==-1)?N:(N=vt.call(this._minWeekdaysParse,oe),N!==-1?N:null)):(N=vt.call(this._minWeekdaysParse,oe),N!==-1||(N=vt.call(this._weekdaysParse,oe),N!==-1)?N:(N=vt.call(this._shortWeekdaysParse,oe),N!==-1?N:null))}function qa(y,A,D){var R,N,K;if(this._weekdaysParseExact)return Ys.call(this,y,A,D);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),R=0;R<7;R++){if(N=m([2e3,1]).day(R),D&&!this._fullWeekdaysParse[R]&&(this._fullWeekdaysParse[R]=new RegExp("^"+this.weekdays(N,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[R]=new RegExp("^"+this.weekdaysShort(N,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[R]=new RegExp("^"+this.weekdaysMin(N,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[R]||(K="^"+this.weekdays(N,"")+"|^"+this.weekdaysShort(N,"")+"|^"+this.weekdaysMin(N,""),this._weekdaysParse[R]=new RegExp(K.replace(".",""),"i")),D&&A==="dddd"&&this._fullWeekdaysParse[R].test(y))return R;if(D&&A==="ddd"&&this._shortWeekdaysParse[R].test(y))return R;if(D&&A==="dd"&&this._minWeekdaysParse[R].test(y))return R;if(!D&&this._weekdaysParse[R].test(y))return R}}function Xa(y){if(!this.isValid())return y!=null?this:NaN;var A=br(this,"Day");return y!=null?(y=Cn(y,this.localeData()),this.add(y-A,"d")):A}function Za(y){if(!this.isValid())return y!=null?this:NaN;var A=(this.day()+7-this.localeData()._week.dow)%7;return y==null?A:this.add(y-A,"d")}function Qa(y){if(!this.isValid())return y!=null?this:NaN;if(y!=null){var A=In(y,this.localeData());return this.day(this.day()%7?A:A-7)}else return this.day()||7}function Ja(y){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||Ws.call(this),y?this._weekdaysStrictRegex:this._weekdaysRegex):(o(this,"_weekdaysRegex")||(this._weekdaysRegex=Ya),this._weekdaysStrictRegex&&y?this._weekdaysStrictRegex:this._weekdaysRegex)}function ft(y){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||Ws.call(this),y?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(o(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Rn),this._weekdaysShortStrictRegex&&y?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function ut(y){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||Ws.call(this),y?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(o(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Wa),this._weekdaysMinStrictRegex&&y?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Ws(){function y(Pt,Ai){return Ai.length-Pt.length}var A=[],D=[],R=[],N=[],K,oe,_e,Oe,We;for(K=0;K<7;K++)oe=m([2e3,1]).day(K),_e=ni(this.weekdaysMin(oe,"")),Oe=ni(this.weekdaysShort(oe,"")),We=ni(this.weekdays(oe,"")),A.push(_e),D.push(Oe),R.push(We),N.push(_e),N.push(Oe),N.push(We);A.sort(y),D.sort(y),R.sort(y),N.sort(y),this._weekdaysRegex=new RegExp("^("+N.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+R.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+D.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+A.join("|")+")","i")}function Ks(){return this.hours()%12||12}function eo(){return this.hours()||24}ae("H",["HH",2],0,"hour"),ae("h",["hh",2],0,Ks),ae("k",["kk",2],0,eo),ae("hmm",0,0,function(){return""+Ks.apply(this)+ie(this.minutes(),2)}),ae("hmmss",0,0,function(){return""+Ks.apply(this)+ie(this.minutes(),2)+ie(this.seconds(),2)}),ae("Hmm",0,0,function(){return""+this.hours()+ie(this.minutes(),2)}),ae("Hmmss",0,0,function(){return""+this.hours()+ie(this.minutes(),2)+ie(this.seconds(),2)});function Ln(y,A){ae(y,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),A)})}Ln("a",!0),Ln("A",!1);function xn(y,A){return A._meridiemParse}Ce("a",xn),Ce("A",xn),Ce("H",Se,qr),Ce("h",Se,Vi),Ce("k",Se,Vi),Ce("HH",Se,qe),Ce("hh",Se,qe),Ce("kk",Se,qe),Ce("hmm",lt),Ce("hmmss",ht),Ce("Hmm",lt),Ce("Hmmss",ht),it(["H","HH"],At),it(["k","kk"],function(y,A,D){var R=He(y);A[At]=R===24?0:R}),it(["a","A"],function(y,A,D){D._isPm=D._locale.isPM(y),D._meridiem=y}),it(["h","hh"],function(y,A,D){A[At]=He(y),S(D).bigHour=!0}),it("hmm",function(y,A,D){var R=y.length-2;A[At]=He(y.substr(0,R)),A[Qt]=He(y.substr(R)),S(D).bigHour=!0}),it("hmmss",function(y,A,D){var R=y.length-4,N=y.length-2;A[At]=He(y.substr(0,R)),A[Qt]=He(y.substr(R,2)),A[yi]=He(y.substr(N)),S(D).bigHour=!0}),it("Hmm",function(y,A,D){var R=y.length-2;A[At]=He(y.substr(0,R)),A[Qt]=He(y.substr(R))}),it("Hmmss",function(y,A,D){var R=y.length-4,N=y.length-2;A[At]=He(y.substr(0,R)),A[Qt]=He(y.substr(R,2)),A[yi]=He(y.substr(N))});function to(y){return(y+"").toLowerCase().charAt(0)==="p"}var Mn=/[ap]\.?m?\.?/i,io=ir("Hours",!0);function It(y,A,D){return y>11?D?"pm":"PM":D?"am":"AM"}var rs={calendar:H,longDateFormat:q,invalidDate:ce,ordinal:ve,dayOfMonthOrdinalParse:Be,relativeTime:Me,months:En,monthsShort:Bs,week:Hs,weekdays:Pn,weekdaysMin:Ha,weekdaysShort:Dn,meridiemParse:Mn},rt={},nr={},Gi;function Kt(y,A){var D,R=Math.min(y.length,A.length);for(D=0;D<R;D+=1)if(y[D]!==A[D])return D;return R}function js(y){return y&&y.toLowerCase().replace("_","-")}function wn(y){for(var A=0,D,R,N,K;A<y.length;){for(K=js(y[A]).split("-"),D=K.length,R=js(y[A+1]),R=R?R.split("-"):null;D>0;){if(N=Dr(K.slice(0,D).join("-")),N)return N;if(R&&R.length>=D&&Kt(K,R)>=D-1)break;D--}A++}return Gi}function kn(y){return!!(y&&y.match("^[^/\\\\]*$"))}function Dr(y){var A=null,D;if(rt[y]===void 0&&r&&r.exports&&kn(y))try{A=Gi._abbr,D=commonjsRequire,D("./locale/"+y),vi(A)}catch{rt[y]=null}return rt[y]}function vi(y,A){var D;return y&&(u(A)?D=Ei(y):D=ss(y,A),D?Gi=D:typeof console<"u"&&console.warn&&console.warn("Locale "+y+" not found. Did you forget to load it?")),Gi._abbr}function ss(y,A){if(A!==null){var D,R=rs;if(A.abbr=y,rt[y]!=null)X("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),R=rt[y]._config;else if(A.parentLocale!=null)if(rt[A.parentLocale]!=null)R=rt[A.parentLocale]._config;else if(D=Dr(A.parentLocale),D!=null)R=D._config;else return nr[A.parentLocale]||(nr[A.parentLocale]=[]),nr[A.parentLocale].push({name:y,config:A}),null;return rt[y]=new re(te(R,A)),nr[y]&&nr[y].forEach(function(N){ss(N.name,N.config)}),vi(y),rt[y]}else return delete rt[y],null}function Nt(y,A){if(A!=null){var D,R,N=rs;rt[y]!=null&&rt[y].parentLocale!=null?rt[y].set(te(rt[y]._config,A)):(R=Dr(y),R!=null&&(N=R._config),A=te(N,A),R==null&&(A.abbr=y),D=new re(A),D.parentLocale=rt[y],rt[y]=D),vi(y)}else rt[y]!=null&&(rt[y].parentLocale!=null?(rt[y]=rt[y].parentLocale,y===vi()&&vi(y)):rt[y]!=null&&delete rt[y]);return rt[y]}function Ei(y){var A;if(y&&y._locale&&y._locale._abbr&&(y=y._locale._abbr),!y)return Gi;if(!n(y)){if(A=Dr(y),A)return A;y=[y]}return wn(y)}function jt(){return me(rt)}function zs(y){var A,D=y._a;return D&&S(y).overflow===-2&&(A=D[gi]<0||D[gi]>11?gi:D[ai]<1||D[ai]>Ns(D[xt],D[gi])?ai:D[At]<0||D[At]>24||D[At]===24&&(D[Qt]!==0||D[yi]!==0||D[$i]!==0)?At:D[Qt]<0||D[Qt]>59?Qt:D[yi]<0||D[yi]>59?yi:D[$i]<0||D[$i]>999?$i:-1,S(y)._overflowDayOfYear&&(A<xt||A>ai)&&(A=ai),S(y)._overflowWeeks&&A===-1&&(A=yn),S(y)._overflowWeekday&&A===-1&&(A=Ma),S(y).overflow=A),y}var On=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ri=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ns=/Z|[+-]\d\d(?::?\d\d)?/,ar=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],ct=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Li=/^\/?Date\((-?\d+)/i,qs=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,ro={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function as(y){var A,D,R=y._i,N=On.exec(R)||Ri.exec(R),K,oe,_e,Oe,We=ar.length,Pt=ct.length;if(N){for(S(y).iso=!0,A=0,D=We;A<D;A++)if(ar[A][1].exec(N[1])){oe=ar[A][0],K=ar[A][2]!==!1;break}if(oe==null){y._isValid=!1;return}if(N[3]){for(A=0,D=Pt;A<D;A++)if(ct[A][1].exec(N[3])){_e=(N[2]||" ")+ct[A][0];break}if(_e==null){y._isValid=!1;return}}if(!K&&_e!=null){y._isValid=!1;return}if(N[4])if(ns.exec(N[4]))Oe="Z";else{y._isValid=!1;return}y._f=oe+(_e||"")+(Oe||""),ls(y)}else y._isValid=!1}function so(y,A,D,R,N,K){var oe=[no(y),Bs.indexOf(A),parseInt(D,10),parseInt(R,10),parseInt(N,10)];return K&&oe.push(parseInt(K,10)),oe}function no(y){var A=parseInt(y,10);return A<=49?2e3+A:A<=999?1900+A:A}function ao(y){return y.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Fn(y,A,D){if(y){var R=Dn.indexOf(y),N=new Date(A[0],A[1],A[2]).getDay();if(R!==N)return S(D).weekdayMismatch=!0,D._isValid=!1,!1}return!0}function os(y,A,D){if(y)return ro[y];if(A)return 0;var R=parseInt(D,10),N=R%100,K=(R-N)/100;return K*60+N}function Hi(y){var A=qs.exec(ao(y._i)),D;if(A){if(D=so(A[4],A[3],A[2],A[5],A[6],A[7]),!Fn(A[1],D,y))return;y._a=D,y._tzm=os(A[8],A[9],A[10]),y._d=rr.apply(null,y._a),y._d.setUTCMinutes(y._d.getUTCMinutes()-y._tzm),S(y).rfc2822=!0}else y._isValid=!1}function oo(y){var A=Li.exec(y._i);if(A!==null){y._d=new Date(+A[1]);return}if(as(y),y._isValid===!1)delete y._isValid;else return;if(Hi(y),y._isValid===!1)delete y._isValid;else return;y._strict?y._isValid=!1:i.createFromInputFallback(y)}i.createFromInputFallback=x("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(y){y._d=new Date(y._i+(y._useUTC?" UTC":""))});function Yi(y,A,D){return y??A??D}function Nn(y){var A=new Date(i.now());return y._useUTC?[A.getUTCFullYear(),A.getUTCMonth(),A.getUTCDate()]:[A.getFullYear(),A.getMonth(),A.getDate()]}function Rr(y){var A,D,R=[],N,K,oe;if(!y._d){for(N=Nn(y),y._w&&y._a[ai]==null&&y._a[gi]==null&&Xs(y),y._dayOfYear!=null&&(oe=Yi(y._a[xt],N[xt]),(y._dayOfYear>Ar(oe)||y._dayOfYear===0)&&(S(y)._overflowDayOfYear=!0),D=rr(oe,0,y._dayOfYear),y._a[gi]=D.getUTCMonth(),y._a[ai]=D.getUTCDate()),A=0;A<3&&y._a[A]==null;++A)y._a[A]=R[A]=N[A];for(;A<7;A++)y._a[A]=R[A]=y._a[A]==null?A===2?1:0:y._a[A];y._a[At]===24&&y._a[Qt]===0&&y._a[yi]===0&&y._a[$i]===0&&(y._nextDay=!0,y._a[At]=0),y._d=(y._useUTC?rr:$a).apply(null,R),K=y._useUTC?y._d.getUTCDay():y._d.getDay(),y._tzm!=null&&y._d.setUTCMinutes(y._d.getUTCMinutes()-y._tzm),y._nextDay&&(y._a[At]=24),y._w&&typeof y._w.d<"u"&&y._w.d!==K&&(S(y).weekdayMismatch=!0)}}function Xs(y){var A,D,R,N,K,oe,_e,Oe,We;A=y._w,A.GG!=null||A.W!=null||A.E!=null?(K=1,oe=4,D=Yi(A.GG,y._a[xt],Pr(st(),1,4).year),R=Yi(A.W,1),N=Yi(A.E,1),(N<1||N>7)&&(Oe=!0)):(K=y._locale._week.dow,oe=y._locale._week.doy,We=Pr(st(),K,oe),D=Yi(A.gg,y._a[xt],We.year),R=Yi(A.w,We.week),A.d!=null?(N=A.d,(N<0||N>6)&&(Oe=!0)):A.e!=null?(N=A.e+K,(A.e<0||A.e>6)&&(Oe=!0)):N=K),R<1||R>oi(D,K,oe)?S(y)._overflowWeeks=!0:Oe!=null?S(y)._overflowWeekday=!0:(_e=ts(D,R,N,K,oe),y._a[xt]=_e.year,y._dayOfYear=_e.dayOfYear)}i.ISO_8601=function(){},i.RFC_2822=function(){};function ls(y){if(y._f===i.ISO_8601){as(y);return}if(y._f===i.RFC_2822){Hi(y);return}y._a=[],S(y).empty=!0;var A=""+y._i,D,R,N,K,oe,_e=A.length,Oe=0,We,Pt;for(N=Y(y._f,y._locale).match(ne)||[],Pt=N.length,D=0;D<Pt;D++)K=N[D],R=(A.match(La(K,y))||[])[0],R&&(oe=A.substr(0,A.indexOf(R)),oe.length>0&&S(y).unusedInput.push(oe),A=A.slice(A.indexOf(R)+R.length),Oe+=R.length),Pe[K]?(R?S(y).empty=!1:S(y).unusedTokens.push(K),Fs(K,R,y)):y._strict&&!R&&S(y).unusedTokens.push(K);S(y).charsLeftOver=_e-Oe,A.length>0&&S(y).unusedInput.push(A),y._a[At]<=12&&S(y).bigHour===!0&&y._a[At]>0&&(S(y).bigHour=void 0),S(y).parsedDateParts=y._a.slice(0),S(y).meridiem=y._meridiem,y._a[At]=lo(y._locale,y._a[At],y._meridiem),We=S(y).era,We!==null&&(y._a[xt]=y._locale.erasConvertYear(We,y._a[xt])),Rr(y),zs(y)}function lo(y,A,D){var R;return D==null?A:y.meridiemHour!=null?y.meridiemHour(A,D):(y.isPM!=null&&(R=y.isPM(D),R&&A<12&&(A+=12),!R&&A===12&&(A=0)),A)}function Zs(y){var A,D,R,N,K,oe,_e=!1,Oe=y._f.length;if(Oe===0){S(y).invalidFormat=!0,y._d=new Date(NaN);return}for(N=0;N<Oe;N++)K=0,oe=!1,A=U({},y),y._useUTC!=null&&(A._useUTC=y._useUTC),A._f=y._f[N],ls(A),C(A)&&(oe=!0),K+=S(A).charsLeftOver,K+=S(A).unusedTokens.length*10,S(A).score=K,_e?K<R&&(R=K,D=A):(R==null||K<R||oe)&&(R=K,D=A,oe&&(_e=!0));E(y,D||A)}function Qs(y){if(!y._d){var A=Je(y._i),D=A.day===void 0?A.date:A.day;y._a=g([A.year,A.month,D,A.hour,A.minute,A.second,A.millisecond],function(R){return R&&parseInt(R,10)}),Rr(y)}}function ho(y){var A=new O(zs(Js(y)));return A._nextDay&&(A.add(1,"d"),A._nextDay=void 0),A}function Js(y){var A=y._i,D=y._f;return y._locale=y._locale||Ei(y._l),A===null||D===void 0&&A===""?I({nullInput:!0}):(typeof A=="string"&&(y._i=A=y._locale.preparse(A)),F(A)?new O(zs(A)):(d(A)?y._d=A:n(D)?Zs(y):D?ls(y):Bt(y),C(y)||(y._d=null),y))}function Bt(y){var A=y._i;u(A)?y._d=new Date(i.now()):d(A)?y._d=new Date(A.valueOf()):typeof A=="string"?oo(y):n(A)?(y._a=g(A.slice(0),function(D){return parseInt(D,10)}),Rr(y)):a(A)?Qs(y):f(A)?y._d=new Date(A):i.createFromInputFallback(y)}function hs(y,A,D,R,N){var K={};return(A===!0||A===!1)&&(R=A,A=void 0),(D===!0||D===!1)&&(R=D,D=void 0),(a(y)&&c(y)||n(y)&&y.length===0)&&(y=void 0),K._isAMomentObject=!0,K._useUTC=K._isUTC=N,K._l=D,K._i=y,K._f=A,K._strict=R,ho(K)}function st(y,A,D,R){return hs(y,A,D,R,!1)}var Bn=x("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var y=st.apply(null,arguments);return this.isValid()&&y.isValid()?y<this?this:y:I()}),Un=x("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var y=st.apply(null,arguments);return this.isValid()&&y.isValid()?y>this?this:y:I()});function Vn(y,A){var D,R;if(A.length===1&&n(A[0])&&(A=A[0]),!A.length)return st();for(D=A[0],R=1;R<A.length;++R)(!A[R].isValid()||A[R][y](D))&&(D=A[R]);return D}function uo(){var y=[].slice.call(arguments,0);return Vn("isBefore",y)}function co(){var y=[].slice.call(arguments,0);return Vn("isAfter",y)}var fo=function(){return Date.now?Date.now():+new Date},Lr=["year","quarter","month","week","day","hour","minute","second","millisecond"];function or(y){var A,D=!1,R,N=Lr.length;for(A in y)if(o(y,A)&&!(vt.call(Lr,A)!==-1&&(y[A]==null||!isNaN(y[A]))))return!1;for(R=0;R<N;++R)if(y[Lr[R]]){if(D)return!1;parseFloat(y[Lr[R]])!==He(y[Lr[R]])&&(D=!0)}return!0}function po(){return this._isValid}function mo(){return nt(NaN)}function lr(y){var A=Je(y),D=A.year||0,R=A.quarter||0,N=A.month||0,K=A.week||A.isoWeek||0,oe=A.day||0,_e=A.hour||0,Oe=A.minute||0,We=A.second||0,Pt=A.millisecond||0;this._isValid=or(A),this._milliseconds=+Pt+We*1e3+Oe*6e4+_e*1e3*60*60,this._days=+oe+K*7,this._months=+N+R*3+D*12,this._data={},this._locale=Ei(),this._bubble()}function xr(y){return y instanceof lr}function li(y){return y<0?Math.round(-1*y)*-1:Math.round(y)}function us(y,A,D){var R=Math.min(y.length,A.length),N=Math.abs(y.length-A.length),K=0,oe;for(oe=0;oe<R;oe++)He(y[oe])!==He(A[oe])&&K++;return K+N}function $n(y,A){ae(y,0,0,function(){var D=this.utcOffset(),R="+";return D<0&&(D=-D,R="-"),R+ie(~~(D/60),2)+A+ie(~~D%60,2)})}$n("Z",":"),$n("ZZ",""),Ce("Z",zr),Ce("ZZ",zr),it(["Z","ZZ"],function(y,A,D){D._useUTC=!0,D._tzm=en(zr,y)});var go=/([\+\-]|\d\d)/gi;function en(y,A){var D=(A||"").match(y),R,N,K;return D===null?null:(R=D[D.length-1]||[],N=(R+"").match(go)||["-",0,0],K=+(N[1]*60)+He(N[2]),K===0?0:N[0]==="+"?K:-K)}function xi(y,A){var D,R;return A._isUTC?(D=A.clone(),R=(F(y)||d(y)?y.valueOf():st(y).valueOf())-D.valueOf(),D._d.setTime(D._d.valueOf()+R),i.updateOffset(D,!1),D):st(y).local()}function Ut(y){return-Math.round(y._d.getTimezoneOffset())}i.updateOffset=function(){};function Gn(y,A,D){var R=this._offset||0,N;if(!this.isValid())return y!=null?this:NaN;if(y!=null){if(typeof y=="string"){if(y=en(zr,y),y===null)return this}else Math.abs(y)<16&&!D&&(y=y*60);return!this._isUTC&&A&&(N=Ut(this)),this._offset=y,this._isUTC=!0,N!=null&&this.add(N,"m"),R!==y&&(!A||this._changeInProgress?Mr(this,nt(y-R,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,i.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?R:Ut(this)}function yo(y,A){return y!=null?(typeof y!="string"&&(y=-y),this.utcOffset(y,A),this):-this.utcOffset()}function vo(y){return this.utcOffset(0,y)}function Eo(y){return this._isUTC&&(this.utcOffset(0,y),this._isUTC=!1,y&&this.subtract(Ut(this),"m")),this}function So(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var y=en(ks,this._i);y!=null?this.utcOffset(y):this.utcOffset(0,!0)}return this}function To(y){return this.isValid()?(y=y?st(y).utcOffset():0,(this.utcOffset()-y)%60===0):!1}function Mi(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Z(){if(!u(this._isDSTShifted))return this._isDSTShifted;var y={},A;return U(y,this),y=Js(y),y._a?(A=y._isUTC?m(y._a):st(y._a),this._isDSTShifted=this.isValid()&&us(y._a,A.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function ue(){return this.isValid()?!this._isUTC:!1}function se(){return this.isValid()?this._isUTC:!1}function be(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Fe=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,tt=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function nt(y,A){var D=y,R=null,N,K,oe;return xr(y)?D={ms:y._milliseconds,d:y._days,M:y._months}:f(y)||!isNaN(+y)?(D={},A?D[A]=+y:D.milliseconds=+y):(R=Fe.exec(y))?(N=R[1]==="-"?-1:1,D={y:0,d:He(R[ai])*N,h:He(R[At])*N,m:He(R[Qt])*N,s:He(R[yi])*N,ms:He(li(R[$i]*1e3))*N}):(R=tt.exec(y))?(N=R[1]==="-"?-1:1,D={y:Xe(R[2],N),M:Xe(R[3],N),w:Xe(R[4],N),d:Xe(R[5],N),h:Xe(R[6],N),m:Xe(R[7],N),s:Xe(R[8],N)}):D==null?D={}:typeof D=="object"&&("from"in D||"to"in D)&&(oe=_o(st(D.from),st(D.to)),D={},D.ms=oe.milliseconds,D.M=oe.months),K=new lr(D),xr(y)&&o(y,"_locale")&&(K._locale=y._locale),xr(y)&&o(y,"_isValid")&&(K._isValid=y._isValid),K}nt.fn=lr.prototype,nt.invalid=mo;function Xe(y,A){var D=y&&parseFloat(y.replace(",","."));return(isNaN(D)?0:D)*A}function cs(y,A){var D={};return D.months=A.month()-y.month()+(A.year()-y.year())*12,y.clone().add(D.months,"M").isAfter(A)&&--D.months,D.milliseconds=+A-+y.clone().add(D.months,"M"),D}function _o(y,A){var D;return y.isValid()&&A.isValid()?(A=xi(A,y),y.isBefore(A)?D=cs(y,A):(D=cs(A,y),D.milliseconds=-D.milliseconds,D.months=-D.months),D):{milliseconds:0,months:0}}function Vt(y,A){return function(D,R){var N,K;return R!==null&&!isNaN(+R)&&(X(A,"moment()."+A+"(period, number) is deprecated. Please use moment()."+A+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),K=D,D=R,R=K),N=nt(D,R),Mr(this,N,y),this}}function Mr(y,A,D,R){var N=A._milliseconds,K=li(A._days),oe=li(A._months);y.isValid()&&(R=R??!0,oe&&Vs(y,br(y,"Month")+oe*D),K&&Cr(y,"Date",br(y,"Date")+K*D),N&&y._d.setTime(y._d.valueOf()+N*D),R&&i.updateOffset(y,K||oe))}var Ao=Vt(1,"add"),hr=Vt(-1,"subtract");function wr(y){return typeof y=="string"||y instanceof String}function fs(y){return F(y)||d(y)||wr(y)||f(y)||bo(y)||at(y)||y===null||y===void 0}function at(y){var A=a(y)&&!c(y),D=!1,R=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],N,K,oe=R.length;for(N=0;N<oe;N+=1)K=R[N],D=D||o(y,K);return A&&D}function bo(y){var A=n(y),D=!1;return A&&(D=y.filter(function(R){return!f(R)&&wr(y)}).length===0),A&&D}function Hn(y){var A=a(y)&&!c(y),D=!1,R=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],N,K;for(N=0;N<R.length;N+=1)K=R[N],D=D||o(y,K);return A&&D}function ds(y,A){var D=y.diff(A,"days",!0);return D<-6?"sameElse":D<-1?"lastWeek":D<0?"lastDay":D<1?"sameDay":D<2?"nextDay":D<7?"nextWeek":"sameElse"}function Co(y,A){arguments.length===1&&(arguments[0]?fs(arguments[0])?(y=arguments[0],A=void 0):Hn(arguments[0])&&(A=arguments[0],y=void 0):(y=void 0,A=void 0));var D=y||st(),R=xi(D,this).startOf("day"),N=i.calendarFormat(this,R)||"sameElse",K=A&&(Q(A[N])?A[N].call(this,D):A[N]);return this.format(K||this.localeData().calendar(N,this,st(D)))}function Io(){return new O(this)}function Po(y,A){var D=F(y)?y:st(y);return this.isValid()&&D.isValid()?(A=ze(A)||"millisecond",A==="millisecond"?this.valueOf()>D.valueOf():D.valueOf()<this.clone().startOf(A).valueOf()):!1}function ps(y,A){var D=F(y)?y:st(y);return this.isValid()&&D.isValid()?(A=ze(A)||"millisecond",A==="millisecond"?this.valueOf()<D.valueOf():this.clone().endOf(A).valueOf()<D.valueOf()):!1}function wi(y,A,D,R){var N=F(y)?y:st(y),K=F(A)?A:st(A);return this.isValid()&&N.isValid()&&K.isValid()?(R=R||"()",(R[0]==="("?this.isAfter(N,D):!this.isBefore(N,D))&&(R[1]===")"?this.isBefore(K,D):!this.isAfter(K,D))):!1}function ms(y,A){var D=F(y)?y:st(y),R;return this.isValid()&&D.isValid()?(A=ze(A)||"millisecond",A==="millisecond"?this.valueOf()===D.valueOf():(R=D.valueOf(),this.clone().startOf(A).valueOf()<=R&&R<=this.clone().endOf(A).valueOf())):!1}function Yn(y,A){return this.isSame(y,A)||this.isAfter(y,A)}function gs(y,A){return this.isSame(y,A)||this.isBefore(y,A)}function Wn(y,A,D){var R,N,K;if(!this.isValid())return NaN;if(R=xi(y,this),!R.isValid())return NaN;switch(N=(R.utcOffset()-this.utcOffset())*6e4,A=ze(A),A){case"year":K=kr(this,R)/12;break;case"month":K=kr(this,R);break;case"quarter":K=kr(this,R)/3;break;case"second":K=(this-R)/1e3;break;case"minute":K=(this-R)/6e4;break;case"hour":K=(this-R)/36e5;break;case"day":K=(this-R-N)/864e5;break;case"week":K=(this-R-N)/6048e5;break;default:K=this-R}return D?K:Wt(K)}function kr(y,A){if(y.date()<A.date())return-kr(A,y);var D=(A.year()-y.year())*12+(A.month()-y.month()),R=y.clone().add(D,"months"),N,K;return A-R<0?(N=y.clone().add(D-1,"months"),K=(A-R)/(R-N)):(N=y.clone().add(D+1,"months"),K=(A-R)/(N-R)),-(D+K)||0}i.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",i.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function ys(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Kn(y){if(!this.isValid())return null;var A=y!==!0,D=A?this.clone().utc():this;return D.year()<0||D.year()>9999?Le(D,A?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Q(Date.prototype.toISOString)?A?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Le(D,"Z")):Le(D,A?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Or(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var y="moment",A="",D,R,N,K;return this.isLocal()||(y=this.utcOffset()===0?"moment.utc":"moment.parseZone",A="Z"),D="["+y+'("]',R=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",N="-MM-DD[T]HH:mm:ss.SSS",K=A+'[")]',this.format(D+R+N+K)}function Wi(y){y||(y=this.isUtc()?i.defaultFormatUtc:i.defaultFormat);var A=Le(this,y);return this.localeData().postformat(A)}function vs(y,A){return this.isValid()&&(F(y)&&y.isValid()||st(y).isValid())?nt({to:this,from:y}).locale(this.locale()).humanize(!A):this.localeData().invalidDate()}function Do(y){return this.from(st(),y)}function Ro(y,A){return this.isValid()&&(F(y)&&y.isValid()||st(y).isValid())?nt({from:this,to:y}).locale(this.locale()).humanize(!A):this.localeData().invalidDate()}function Lo(y){return this.to(st(),y)}function Fr(y){var A;return y===void 0?this._locale._abbr:(A=Ei(y),A!=null&&(this._locale=A),this)}var Nr=x("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(y){return y===void 0?this.localeData():this.locale(y)});function Es(){return this._locale}var Ss=1e3,Ki=60*Ss,Ts=60*Ki,jn=(365*400+97)*24*Ts;function mt(y,A){return(y%A+A)%A}function Rt(y,A,D){return y<100&&y>=0?new Date(y+400,A,D)-jn:new Date(y,A,D).valueOf()}function zn(y,A,D){return y<100&&y>=0?Date.UTC(y+400,A,D)-jn:Date.UTC(y,A,D)}function xo(y){var A,D;if(y=ze(y),y===void 0||y==="millisecond"||!this.isValid())return this;switch(D=this._isUTC?zn:Rt,y){case"year":A=D(this.year(),0,1);break;case"quarter":A=D(this.year(),this.month()-this.month()%3,1);break;case"month":A=D(this.year(),this.month(),1);break;case"week":A=D(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":A=D(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":A=D(this.year(),this.month(),this.date());break;case"hour":A=this._d.valueOf(),A-=mt(A+(this._isUTC?0:this.utcOffset()*Ki),Ts);break;case"minute":A=this._d.valueOf(),A-=mt(A,Ki);break;case"second":A=this._d.valueOf(),A-=mt(A,Ss);break}return this._d.setTime(A),i.updateOffset(this,!0),this}function qn(y){var A,D;if(y=ze(y),y===void 0||y==="millisecond"||!this.isValid())return this;switch(D=this._isUTC?zn:Rt,y){case"year":A=D(this.year()+1,0,1)-1;break;case"quarter":A=D(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":A=D(this.year(),this.month()+1,1)-1;break;case"week":A=D(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":A=D(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":A=D(this.year(),this.month(),this.date()+1)-1;break;case"hour":A=this._d.valueOf(),A+=Ts-mt(A+(this._isUTC?0:this.utcOffset()*Ki),Ts)-1;break;case"minute":A=this._d.valueOf(),A+=Ki-mt(A,Ki)-1;break;case"second":A=this._d.valueOf(),A+=Ss-mt(A,Ss)-1;break}return this._d.setTime(A),i.updateOffset(this,!0),this}function Mo(){return this._d.valueOf()-(this._offset||0)*6e4}function tn(){return Math.floor(this.valueOf()/1e3)}function Br(){return new Date(this.valueOf())}function rn(){var y=this;return[y.year(),y.month(),y.date(),y.hour(),y.minute(),y.second(),y.millisecond()]}function ur(){var y=this;return{years:y.year(),months:y.month(),date:y.date(),hours:y.hours(),minutes:y.minutes(),seconds:y.seconds(),milliseconds:y.milliseconds()}}function Ur(){return this.isValid()?this.toISOString():null}function Vr(){return C(this)}function _s(){return E({},S(this))}function cr(){return S(this).overflow}function wo(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}ae("N",0,0,"eraAbbr"),ae("NN",0,0,"eraAbbr"),ae("NNN",0,0,"eraAbbr"),ae("NNNN",0,0,"eraName"),ae("NNNNN",0,0,"eraNarrow"),ae("y",["y",1],"yo","eraYear"),ae("y",["yy",2],0,"eraYear"),ae("y",["yyy",3],0,"eraYear"),ae("y",["yyyy",4],0,"eraYear"),Ce("N",kt),Ce("NN",kt),Ce("NNN",kt),Ce("NNNN",Ye),Ce("NNNNN",Bo),it(["N","NN","NNN","NNNN","NNNNN"],function(y,A,D,R){var N=D._locale.erasParse(y,R,D._strict);N?S(D).era=N:S(D).invalidEra=y}),Ce("y",Di),Ce("yy",Di),Ce("yyy",Di),Ce("yyyy",Di),Ce("yo",Uo),it(["y","yy","yyy","yyyy"],xt),it(["yo"],function(y,A,D,R){var N;D._locale._eraYearOrdinalRegex&&(N=y.match(D._locale._eraYearOrdinalRegex)),D._locale.eraYearOrdinalParse?A[xt]=D._locale.eraYearOrdinalParse(y,N):A[xt]=parseInt(y,10)});function ko(y,A){var D,R,N,K=this._eras||Ei("en")._eras;for(D=0,R=K.length;D<R;++D)switch(typeof K[D].since==="string"&&(N=i(K[D].since).startOf("day"),K[D].since=N.valueOf()),typeof K[D].until){case"undefined":K[D].until=1/0;break;case"string":N=i(K[D].until).startOf("day").valueOf(),K[D].until=N.valueOf();break}return K}function Oo(y,A,D){var R,N,K=this.eras(),oe,_e,Oe;for(y=y.toUpperCase(),R=0,N=K.length;R<N;++R)if(oe=K[R].name.toUpperCase(),_e=K[R].abbr.toUpperCase(),Oe=K[R].narrow.toUpperCase(),D)switch(A){case"N":case"NN":case"NNN":if(_e===y)return K[R];break;case"NNNN":if(oe===y)return K[R];break;case"NNNNN":if(Oe===y)return K[R];break}else if([oe,_e,Oe].indexOf(y)>=0)return K[R]}function Fo(y,A){var D=y.since<=y.until?1:-1;return A===void 0?i(y.since).year():i(y.since).year()+(A-y.offset)*D}function No(){var y,A,D,R=this.localeData().eras();for(y=0,A=R.length;y<A;++y)if(D=this.clone().startOf("day").valueOf(),R[y].since<=D&&D<=R[y].until||R[y].until<=D&&D<=R[y].since)return R[y].name;return""}function As(){var y,A,D,R=this.localeData().eras();for(y=0,A=R.length;y<A;++y)if(D=this.clone().startOf("day").valueOf(),R[y].since<=D&&D<=R[y].until||R[y].until<=D&&D<=R[y].since)return R[y].narrow;return""}function $r(){var y,A,D,R=this.localeData().eras();for(y=0,A=R.length;y<A;++y)if(D=this.clone().startOf("day").valueOf(),R[y].since<=D&&D<=R[y].until||R[y].until<=D&&D<=R[y].since)return R[y].abbr;return""}function Xn(){var y,A,D,R,N=this.localeData().eras();for(y=0,A=N.length;y<A;++y)if(D=N[y].since<=N[y].until?1:-1,R=this.clone().startOf("day").valueOf(),N[y].since<=R&&R<=N[y].until||N[y].until<=R&&R<=N[y].since)return(this.year()-i(N[y].since).year())*D+N[y].offset;return this.year()}function B(y){return o(this,"_erasNameRegex")||sn.call(this),y?this._erasNameRegex:this._erasRegex}function dr(y){return o(this,"_erasAbbrRegex")||sn.call(this),y?this._erasAbbrRegex:this._erasRegex}function bs(y){return o(this,"_erasNarrowRegex")||sn.call(this),y?this._erasNarrowRegex:this._erasRegex}function kt(y,A){return A.erasAbbrRegex(y)}function Ye(y,A){return A.erasNameRegex(y)}function Bo(y,A){return A.erasNarrowRegex(y)}function Uo(y,A){return A._eraYearOrdinalRegex||Di}function sn(){var y=[],A=[],D=[],R=[],N,K,oe,_e,Oe,We=this.eras();for(N=0,K=We.length;N<K;++N)oe=ni(We[N].name),_e=ni(We[N].abbr),Oe=ni(We[N].narrow),A.push(oe),y.push(_e),D.push(Oe),R.push(oe),R.push(_e),R.push(Oe);this._erasRegex=new RegExp("^("+R.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+A.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+y.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+D.join("|")+")","i")}ae(0,["gg",2],0,function(){return this.weekYear()%100}),ae(0,["GG",2],0,function(){return this.isoWeekYear()%100});function hi(y,A){ae(0,[y,y.length],0,A)}hi("gggg","weekYear"),hi("ggggg","weekYear"),hi("GGGG","isoWeekYear"),hi("GGGGG","isoWeekYear"),Ce("G",tr),Ce("g",tr),Ce("GG",Se,qe),Ce("gg",Se,qe),Ce("GGGG",Ui,Dt),Ce("gggg",Ui,Dt),Ce("GGGGG",Pi,St),Ce("ggggg",Pi,St),_r(["gggg","ggggg","GGGG","GGGGG"],function(y,A,D,R){A[R.substr(0,2)]=He(y)}),_r(["gg","GG"],function(y,A,D,R){A[R]=i.parseTwoDigitYear(y)});function Vo(y){return Zn.call(this,y,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function $o(y){return Zn.call(this,y,this.isoWeek(),this.isoWeekday(),1,4)}function Go(){return oi(this.year(),1,4)}function Ho(){return oi(this.isoWeekYear(),1,4)}function Yo(){var y=this.localeData()._week;return oi(this.year(),y.dow,y.doy)}function Si(){var y=this.localeData()._week;return oi(this.weekYear(),y.dow,y.doy)}function Zn(y,A,D,R,N){var K;return y==null?Pr(this,R,N).year:(K=oi(y,R,N),A>K&&(A=K),Wo.call(this,y,A,D,R,N))}function Wo(y,A,D,R,N){var K=ts(y,A,D,R,N),oe=rr(K.year,0,K.dayOfYear);return this.year(oe.getUTCFullYear()),this.month(oe.getUTCMonth()),this.date(oe.getUTCDate()),this}ae("Q",0,"Qo","quarter"),Ce("Q",_t),it("Q",function(y,A){A[gi]=(He(y)-1)*3});function Ko(y){return y==null?Math.ceil((this.month()+1)/3):this.month((y-1)*3+this.month()%3)}ae("D",["DD",2],"Do","date"),Ce("D",Se,Vi),Ce("DD",Se,qe),Ce("Do",function(y,A){return y?A._dayOfMonthOrdinalParse||A._ordinalParse:A._dayOfMonthOrdinalParseLenient}),it(["D","DD"],ai),it("Do",function(y,A){A[ai]=He(y.match(Se)[0])});var Qn=ir("Date",!0);ae("DDD",["DDDD",3],"DDDo","dayOfYear"),Ce("DDD",pt),Ce("DDDD",Yt),it(["DDD","DDDD"],function(y,A,D){D._dayOfYear=He(y)});function jo(y){var A=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return y==null?A:this.add(y-A,"d")}ae("m",["mm",2],0,"minute"),Ce("m",Se,qr),Ce("mm",Se,qe),it(["m","mm"],Qt);var Ti=ir("Minutes",!1);ae("s",["ss",2],0,"second"),Ce("s",Se,qr),Ce("ss",Se,qe),it(["s","ss"],yi);var zo=ir("Seconds",!1);ae("S",0,0,function(){return~~(this.millisecond()/100)}),ae(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),ae(0,["SSS",3],0,"millisecond"),ae(0,["SSSS",4],0,function(){return this.millisecond()*10}),ae(0,["SSSSS",5],0,function(){return this.millisecond()*100}),ae(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),ae(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),ae(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),ae(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),Ce("S",pt,_t),Ce("SS",pt,qe),Ce("SSS",pt,Yt);var ki,Jn;for(ki="SSSS";ki.length<=9;ki+="S")Ce(ki,Di);function qo(y,A){A[$i]=He(("0."+y)*1e3)}for(ki="S";ki.length<=9;ki+="S")it(ki,qo);Jn=ir("Milliseconds",!1),ae("z",0,0,"zoneAbbr"),ae("zz",0,0,"zoneName");function Xo(){return this._isUTC?"UTC":""}function ji(){return this._isUTC?"Coordinated Universal Time":""}var ye=O.prototype;ye.add=Ao,ye.calendar=Co,ye.clone=Io,ye.diff=Wn,ye.endOf=qn,ye.format=Wi,ye.from=vs,ye.fromNow=Do,ye.to=Ro,ye.toNow=Lo,ye.get=ka,ye.invalidAt=cr,ye.isAfter=Po,ye.isBefore=ps,ye.isBetween=wi,ye.isSame=ms,ye.isSameOrAfter=Yn,ye.isSameOrBefore=gs,ye.isValid=Vr,ye.lang=Nr,ye.locale=Fr,ye.localeData=Es,ye.max=Un,ye.min=Bn,ye.parsingFlags=_s,ye.set=Qr,ye.startOf=xo,ye.subtract=hr,ye.toArray=rn,ye.toObject=ur,ye.toDate=Br,ye.toISOString=Kn,ye.inspect=Or,typeof Symbol<"u"&&Symbol.for!=null&&(ye[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),ye.toJSON=Ur,ye.toString=ys,ye.unix=tn,ye.valueOf=Mo,ye.creationData=wo,ye.eraName=No,ye.eraNarrow=As,ye.eraAbbr=$r,ye.eraYear=Xn,ye.year=vn,ye.isLeapYear=wa,ye.weekYear=Vo,ye.isoWeekYear=$o,ye.quarter=ye.quarters=Ko,ye.month=Jr,ye.daysInMonth=Va,ye.week=ye.weeks=bn,ye.isoWeek=ye.isoWeeks=Ga,ye.weeksInYear=Yo,ye.weeksInWeekYear=Si,ye.isoWeeksInYear=Go,ye.isoWeeksInISOWeekYear=Ho,ye.date=Qn,ye.day=ye.days=Xa,ye.weekday=Za,ye.isoWeekday=Qa,ye.dayOfYear=jo,ye.hour=ye.hours=io,ye.minute=ye.minutes=Ti,ye.second=ye.seconds=zo,ye.millisecond=ye.milliseconds=Jn,ye.utcOffset=Gn,ye.utc=vo,ye.local=Eo,ye.parseZone=So,ye.hasAlignedHourOffset=To,ye.isDST=Mi,ye.isLocal=ue,ye.isUtcOffset=se,ye.isUtc=be,ye.isUTC=be,ye.zoneAbbr=Xo,ye.zoneName=ji,ye.dates=x("dates accessor is deprecated. Use date instead.",Qn),ye.months=x("months accessor is deprecated. Use month instead",Jr),ye.years=x("years accessor is deprecated. Use year instead",vn),ye.zone=x("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",yo),ye.isDSTShifted=x("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Z);function Zo(y){return st(y*1e3)}function Jt(){return st.apply(null,arguments).parseZone()}function ea(y){return y}var et=re.prototype;et.calendar=z,et.longDateFormat=le,et.invalidDate=Ee,et.ordinal=Ie,et.preparse=ea,et.postformat=ea,et.relativeTime=Ve,et.pastFuture=dt,et.set=ee,et.eras=ko,et.erasParse=Oo,et.erasConvertYear=Fo,et.erasAbbrRegex=dr,et.erasNameRegex=B,et.erasNarrowRegex=bs,et.months=Ba,et.monthsShort=Ua,et.monthsParse=Tn,et.monthsRegex=es,et.monthsShortRegex=_n,et.week=Gs,et.firstDayOfYear=An,et.firstDayOfWeek=sr,et.weekdays=Ka,et.weekdaysMin=za,et.weekdaysShort=ja,et.weekdaysParse=qa,et.weekdaysRegex=Ja,et.weekdaysShortRegex=ft,et.weekdaysMinRegex=ut,et.isPM=to,et.meridiem=It;function Cs(y,A,D,R){var N=Ei(),K=m().set(R,A);return N[D](K,y)}function ta(y,A,D){if(f(y)&&(A=y,y=void 0),y=y||"",A!=null)return Cs(y,A,D,"month");var R,N=[];for(R=0;R<12;R++)N[R]=Cs(y,R,D,"month");return N}function nn(y,A,D,R){typeof y=="boolean"?(f(A)&&(D=A,A=void 0),A=A||""):(A=y,D=A,y=!1,f(A)&&(D=A,A=void 0),A=A||"");var N=Ei(),K=y?N._week.dow:0,oe,_e=[];if(D!=null)return Cs(A,(D+K)%7,R,"day");for(oe=0;oe<7;oe++)_e[oe]=Cs(A,(oe+K)%7,R,"day");return _e}function ia(y,A){return ta(y,A,"months")}function ra(y,A){return ta(y,A,"monthsShort")}function Qo(y,A,D){return nn(y,A,D,"weekdays")}function Jo(y,A,D){return nn(y,A,D,"weekdaysShort")}function an(y,A,D){return nn(y,A,D,"weekdaysMin")}vi("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(y){var A=y%10,D=He(y%100/10)===1?"th":A===1?"st":A===2?"nd":A===3?"rd":"th";return y+D}}),i.lang=x("moment.lang is deprecated. Use moment.locale instead.",vi),i.langData=x("moment.langData is deprecated. Use moment.localeData instead.",Ei);var $t=Math.abs;function Is(){var y=this._data;return this._milliseconds=$t(this._milliseconds),this._days=$t(this._days),this._months=$t(this._months),y.milliseconds=$t(y.milliseconds),y.seconds=$t(y.seconds),y.minutes=$t(y.minutes),y.hours=$t(y.hours),y.months=$t(y.months),y.years=$t(y.years),this}function sa(y,A,D,R){var N=nt(A,D);return y._milliseconds+=R*N._milliseconds,y._days+=R*N._days,y._months+=R*N._months,y._bubble()}function na(y,A){return sa(this,y,A,1)}function el(y,A){return sa(this,y,A,-1)}function ui(y){return y<0?Math.floor(y):Math.ceil(y)}function on(){var y=this._milliseconds,A=this._days,D=this._months,R=this._data,N,K,oe,_e,Oe;return y>=0&&A>=0&&D>=0||y<=0&&A<=0&&D<=0||(y+=ui(Ot(D)+A)*864e5,A=0,D=0),R.milliseconds=y%1e3,N=Wt(y/1e3),R.seconds=N%60,K=Wt(N/60),R.minutes=K%60,oe=Wt(K/60),R.hours=oe%24,A+=Wt(oe/24),Oe=Wt(Oi(A)),D+=Oe,A-=ui(Ot(Oe)),_e=Wt(D/12),D%=12,R.days=A,R.months=D,R.years=_e,this}function Oi(y){return y*4800/146097}function Ot(y){return y*146097/4800}function tl(y){if(!this.isValid())return NaN;var A,D,R=this._milliseconds;if(y=ze(y),y==="month"||y==="quarter"||y==="year")switch(A=this._days+R/864e5,D=this._months+Oi(A),y){case"month":return D;case"quarter":return D/3;case"year":return D/12}else switch(A=this._days+Math.round(Ot(this._months)),y){case"week":return A/7+R/6048e5;case"day":return A+R/864e5;case"hour":return A*24+R/36e5;case"minute":return A*1440+R/6e4;case"second":return A*86400+R/1e3;case"millisecond":return Math.floor(A*864e5)+R;default:throw new Error("Unknown unit "+y)}}function ci(y){return function(){return this.as(y)}}var ln=ci("ms"),Gr=ci("s"),Fi=ci("m"),aa=ci("h"),il=ci("d"),Ps=ci("w"),rl=ci("M"),oa=ci("Q"),Lt=ci("y"),hn=ln;function la(){return nt(this)}function fi(y){return y=ze(y),this.isValid()?this[y+"s"]():NaN}function _i(y){return function(){return this.isValid()?this._data[y]:NaN}}var Ds=_i("milliseconds"),zi=_i("seconds"),ha=_i("minutes"),wt=_i("hours"),un=_i("days"),sl=_i("months"),nl=_i("years");function al(){return Wt(this.days()/7)}var ei=Math.round,pr={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Hr(y,A,D,R,N){return N.relativeTime(A||1,!!D,y,R)}function ua(y,A,D,R){var N=nt(y).abs(),K=ei(N.as("s")),oe=ei(N.as("m")),_e=ei(N.as("h")),Oe=ei(N.as("d")),We=ei(N.as("M")),Pt=ei(N.as("w")),Ai=ei(N.as("y")),bi=K<=D.ss&&["s",K]||K<D.s&&["ss",K]||oe<=1&&["m"]||oe<D.m&&["mm",oe]||_e<=1&&["h"]||_e<D.h&&["hh",_e]||Oe<=1&&["d"]||Oe<D.d&&["dd",Oe];return D.w!=null&&(bi=bi||Pt<=1&&["w"]||Pt<D.w&&["ww",Pt]),bi=bi||We<=1&&["M"]||We<D.M&&["MM",We]||Ai<=1&&["y"]||["yy",Ai],bi[2]=A,bi[3]=+y>0,bi[4]=R,Hr.apply(null,bi)}function ol(y){return y===void 0?ei:typeof y=="function"?(ei=y,!0):!1}function ll(y,A){return pr[y]===void 0?!1:A===void 0?pr[y]:(pr[y]=A,y==="s"&&(pr.ss=A-1),!0)}function Yr(y,A){if(!this.isValid())return this.localeData().invalidDate();var D=!1,R=pr,N,K;return typeof y=="object"&&(A=y,y=!1),typeof y=="boolean"&&(D=y),typeof A=="object"&&(R=Object.assign({},pr,A),A.s!=null&&A.ss==null&&(R.ss=A.s-1)),N=this.localeData(),K=ua(this,!D,R,N),D&&(K=N.pastFuture(+this,K)),N.postformat(K)}var cn=Math.abs;function mr(y){return(y>0)-(y<0)||+y}function gr(){if(!this.isValid())return this.localeData().invalidDate();var y=cn(this._milliseconds)/1e3,A=cn(this._days),D=cn(this._months),R,N,K,oe,_e=this.asSeconds(),Oe,We,Pt,Ai;return _e?(R=Wt(y/60),N=Wt(R/60),y%=60,R%=60,K=Wt(D/12),D%=12,oe=y?y.toFixed(3).replace(/\.?0+$/,""):"",Oe=_e<0?"-":"",We=mr(this._months)!==mr(_e)?"-":"",Pt=mr(this._days)!==mr(_e)?"-":"",Ai=mr(this._milliseconds)!==mr(_e)?"-":"",Oe+"P"+(K?We+K+"Y":"")+(D?We+D+"M":"")+(A?Pt+A+"D":"")+(N||R||y?"T":"")+(N?Ai+N+"H":"")+(R?Ai+R+"M":"")+(y?Ai+oe+"S":"")):"P0D"}var Ke=lr.prototype;Ke.isValid=po,Ke.abs=Is,Ke.add=na,Ke.subtract=el,Ke.as=tl,Ke.asMilliseconds=ln,Ke.asSeconds=Gr,Ke.asMinutes=Fi,Ke.asHours=aa,Ke.asDays=il,Ke.asWeeks=Ps,Ke.asMonths=rl,Ke.asQuarters=oa,Ke.asYears=Lt,Ke.valueOf=hn,Ke._bubble=on,Ke.clone=la,Ke.get=fi,Ke.milliseconds=Ds,Ke.seconds=zi,Ke.minutes=ha,Ke.hours=wt,Ke.days=un,Ke.weeks=al,Ke.months=sl,Ke.years=nl,Ke.humanize=Yr,Ke.toISOString=gr,Ke.toString=gr,Ke.toJSON=gr,Ke.locale=Fr,Ke.localeData=Es,Ke.toIsoString=x("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",gr),Ke.lang=Nr,ae("X",0,0,"unix"),ae("x",0,0,"valueOf"),Ce("x",tr),Ce("X",Ra),it("X",function(y,A,D){D._d=new Date(parseFloat(y)*1e3)}),it("x",function(y,A,D){D._d=new Date(He(y))});return i.version="2.30.1",s(st),i.fn=ye,i.min=uo,i.max=co,i.now=fo,i.utc=m,i.unix=Zo,i.months=ia,i.isDate=d,i.locale=vi,i.invalid=I,i.duration=nt,i.isMoment=F,i.weekdays=Qo,i.parseZone=Jt,i.localeData=Ei,i.isDuration=xr,i.monthsShort=ra,i.weekdaysMin=an,i.defineLocale=ss,i.updateLocale=Nt,i.locales=jt,i.weekdaysShort=Jo,i.normalizeUnits=ze,i.relativeTimeRounding=ol,i.relativeTimeThreshold=ll,i.calendarFormat=ds,i.prototype=ye,i.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},i}))})(moment$2)),moment$2.exports}var jalaaliJs,hasRequiredJalaaliJs;function requireJalaaliJs(){if(hasRequiredJalaaliJs)return jalaaliJs;hasRequiredJalaaliJs=1,jalaaliJs={toJalaali:e,toGregorian:t,isValidJalaaliDate:i,isLeapJalaaliYear:s,jalaaliMonthLength:n,jalCal:o,j2d:c,d2j:u,g2d:f,d2g:d,jalaaliToDateObject:E,jalaaliWeek:g};var r=[-61,9,38,199,426,686,756,818,1111,1181,1210,1635,2060,2097,2192,2262,2324,2394,2456,3178];function e(S,b,C){return Object.prototype.toString.call(S)==="[object Date]"&&(C=S.getDate(),b=S.getMonth()+1,S=S.getFullYear()),u(f(S,b,C))}function t(S,b,C){return d(c(S,b,C))}function i(S,b,C){return S>=-61&&S<=3177&&b>=1&&b<=12&&C>=1&&C<=n(S,b)}function s(S){return a(S)===0}function n(S,b){return b<=6?31:b<=11||s(S)?30:29}function a(S){var b=r.length,C=r[0],I,L,k,U,O;if(S<C||S>=r[b-1])throw new Error("Invalid Jalaali year "+S);for(O=1;O<b&&(I=r[O],L=I-C,!(S<I));O+=1)C=I;return U=S-C,L-U<6&&(U=U-L+m(L+4,33)*33),k=T(T(U+1,33)-1,4),k===-1&&(k=4),k}function o(S,b){var C=r.length,I=S+621,L=-14,k=r[0],U,O,F,G,x,$,X;if(S<k||S>=r[C-1])throw new Error("Invalid Jalaali year "+S);for(X=1;X<C&&(U=r[X],O=U-k,!(S<U));X+=1)L=L+m(O,33)*8+m(T(O,33),4),k=U;return $=S-k,L=L+m($,33)*8+m(T($,33)+3,4),T(O,33)===4&&O-$===4&&(L+=1),G=m(I,4)-m((m(I,100)+1)*3,4)-150,x=20+L-G,b?{gy:I,march:x}:(O-$<6&&($=$-O+m(O+4,33)*33),F=T(T($+1,33)-1,4),F===-1&&(F=4),{leap:F,gy:I,march:x})}function c(S,b,C){var I=o(S,!0);return f(I.gy,3,I.march)+(b-1)*31-m(b,7)*(b-7)+C-1}function u(S){var b=d(S).gy,C=b-621,I=o(C,!1),L=f(b,3,I.march),k,U,O;if(O=S-L,O>=0){if(O<=185)return U=1+m(O,31),k=T(O,31)+1,{jy:C,jm:U,jd:k};O-=186}else C-=1,O+=179,I.leap===1&&(O+=1);return U=7+m(O,30),k=T(O,30)+1,{jy:C,jm:U,jd:k}}function f(S,b,C){var I=m((S+m(b-8,6)+100100)*1461,4)+m(153*T(b+9,12)+2,5)+C-34840408;return I=I-m(m(S+100100+m(b-8,6),100)*3,4)+752,I}function d(S){var b,C,I,L,k;return b=4*S+139361631,b=b+m(m(4*S+183187720,146097)*3,4)*4-3908,C=m(T(b,1461),4)*5+308,I=m(T(C,153),5)+1,L=T(m(C,153),12)+1,k=m(b,1461)-100100+m(8-L,6),{gy:k,gm:L,gd:I}}function g(S,b,C){var I=E(S,b,C).getDay(),L=I==6?0:-(I+1),k=6+L;return{saturday:u(c(S,b,C+L)),friday:u(c(S,b,C+k))}}function E(S,b,C,I,L,k,U){var O=t(S,b,C);return new Date(O.gy,O.gm-1,O.gd,I||0,L||0,k||0,U||0)}function m(S,b){return~~(S/b)}function T(S,b){return S-~~(S/b)*b}return jalaaliJs}var momentJalaali,hasRequiredMomentJalaali;function requireMomentJalaali(){if(hasRequiredMomentJalaali)return momentJalaali;hasRequiredMomentJalaali=1,momentJalaali=pe;var r=requireMoment(),e=requireJalaaliJs(),t=/(\[[^\[]*\])|(\\)?j(Mo|MM?M?M?|Do|DDDo|DD?D?D?|w[o|w]?|YYYYY|YYYY|YY|gg(ggg?)?|)|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|SS?S?|X|zz?|ZZ?|.)/g,i=/(\[[^\[]*\])|(\\)?(LTS?|LL?L?L?|l{1,4})/g,s=/\d\d?/,n=/\d{1,3}/,a=/\d{3}/,o=/\d{1,4}/,c=/[+\-]?\d{1,6}/,u=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,f=/Z|[\+\-]\d\d:?\d\d/i,d=/T/i,g=/[\+\-]?\d+(\.\d{1,3})?/,E={1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"},m={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"},T={jm:"jmonth",jmonths:"jmonth",jy:"jyear",jyears:"jyear"},S={},b="DDD w M D".split(" "),C="M D w".split(" "),I={jM:function(){return this.jMonth()+1},jMMM:function(Y){return this.localeData().jMonthsShort(this,Y)},jMMMM:function(Y){return this.localeData().jMonths(this,Y)},jD:function(){return this.jDate()},jDDD:function(){return this.jDayOfYear()},jw:function(){return this.jWeek()},jYY:function(){return O(this.jYear()%100,2)},jYYYY:function(){return O(this.jYear(),4)},jYYYYY:function(){return O(this.jYear(),5)},jgg:function(){return O(this.jWeekYear()%100,2)},jgggg:function(){return this.jWeekYear()},jggggg:function(){return O(this.jWeekYear(),5)}};function L(Y,q){return function(le){return O(Y.call(this,le),q)}}function k(Y,q){return function(le){return this.localeData().ordinal(Y.call(this,le),q)}}(function(){for(var Y;b.length;)Y=b.pop(),I["j"+Y+"o"]=k(I["j"+Y],Y);for(;C.length;)Y=C.pop(),I["j"+Y+Y]=L(I["j"+Y],2);I.jDDDD=L(I.jDDD,3)})();function U(Y,q){var le;for(le in q)q.hasOwnProperty(le)&&(Y[le]=q[le]);return Y}function O(Y,q){for(var le=Y+"";le.length<q;)le="0"+le;return le}function F(Y){return Object.prototype.toString.call(Y)==="[object Array]"}function G(Y){if(Y){var q=Y.toLowerCase();Y=T[q]||q}return Y}function x(Y,q,le,ce){var Ee=Y._d;isNaN(q)&&(Y._isValid=!1),Y._isUTC?Y._d=new Date(Date.UTC(q,le,ce,Ee.getUTCHours(),Ee.getUTCMinutes(),Ee.getUTCSeconds(),Ee.getUTCMilliseconds())):Y._d=new Date(q,le,ce,Ee.getHours(),Ee.getMinutes(),Ee.getSeconds(),Ee.getMilliseconds())}function $(Y){function q(){}return q.prototype=Y,new q}function X(Y){return Object.getPrototypeOf?Object.getPrototypeOf(Y):"".__proto__?Y.__proto__:Y.constructor.prototype}U(X(r.localeData()),{_jMonths:["Farvardin","Ordibehesht","Khordaad","Tir","Amordaad","Shahrivar","Mehr","Aabaan","Aazar","Dey","Bahman","Esfand"],jMonths:function(Y){return this._jMonths[Y.jMonth()]},_jMonthsShort:["Far","Ord","Kho","Tir","Amo","Sha","Meh","Aab","Aaz","Dey","Bah","Esf"],jMonthsShort:function(Y){return this._jMonthsShort[Y.jMonth()]},jMonthsParse:function(Y){var q,le,ce;for(this._jMonthsParse||(this._jMonthsParse=[]),q=0;q<12;q+=1)if(this._jMonthsParse[q]||(le=pe([2e3,(2+q)%12,25]),ce="^"+this.jMonths(le,"")+"|^"+this.jMonthsShort(le,""),this._jMonthsParse[q]=new RegExp(ce.replace(".",""),"i")),this._jMonthsParse[q].test(Y))return q}});function Q(Y){var q=Y.match(t),le=q.length,ce;for(ce=0;ce<le;ce+=1)I[q[ce]]&&(q[ce]=I[q[ce]]);return function(Ee){var ve="";for(ce=0;ce<le;ce+=1)ve+=q[ce]instanceof Function?"["+q[ce].call(Ee,Y)+"]":q[ce];return ve}}function ee(Y,q){switch(Y){case"jDDDD":return a;case"jYYYY":return o;case"jYYYYY":return c;case"jDDD":return n;case"jMMM":case"jMMMM":return u;case"jMM":case"jDD":case"jYY":case"jM":case"jD":return s;case"DDDD":return a;case"YYYY":return o;case"YYYYY":return c;case"S":case"SS":case"SSS":case"DDD":return n;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":return u;case"a":case"A":return r.localeData(q._l)._meridiemParse;case"X":return g;case"Z":case"ZZ":return f;case"T":return d;case"MM":case"DD":case"YY":case"HH":case"hh":case"mm":case"ss":case"M":case"D":case"d":case"H":case"h":case"m":case"s":return s;default:return new RegExp(Y.replace("\\",""))}}function te(Y,q,le){var ce,Ee=le._a;switch(Y){case"jM":case"jMM":Ee[1]=q==null?0:~~q-1;break;case"jMMM":case"jMMMM":ce=r.localeData(le._l).jMonthsParse(q),ce!=null?Ee[1]=ce:le._isValid=!1;break;case"jD":case"jDD":case"jDDD":case"jDDDD":q!=null&&(Ee[2]=~~q);break;case"jYY":Ee[0]=~~q+(~~q>47?1300:1400);break;case"jYYYY":case"jYYYYY":Ee[0]=~~q}q==null&&(le._isValid=!1)}function re(Y){var q,le,ce=Y._a[0],Ee=Y._a[1],ve=Y._a[2];return ce==null&&Ee==null&&ve==null?[0,0,1]:(ce=ce??0,Ee=Ee??0,ve=ve??1,(ve<1||ve>pe.jDaysInMonth(ce,Ee)||Ee<0||Ee>11)&&(Y._isValid=!1),q=Ae(ce,Ee,ve),le=ae(q.gy,q.gm,q.gd),isNaN(q.gy)&&(Y._isValid=!1),Y._jDiff=0,~~le.jy!==ce&&(Y._jDiff+=1),~~le.jm!==Ee&&(Y._jDiff+=1),~~le.jd!==ve&&(Y._jDiff+=1),[q.gy,q.gm,q.gd])}function me(Y){var q=Y._f.match(t),le=Y._i+"",ce=q.length,Ee,ve,Be;for(Y._a=[],Ee=0;Ee<ce;Ee+=1)ve=q[Ee],Be=(ee(ve,Y).exec(le)||[])[0],Be&&(le=le.slice(le.indexOf(Be)+Be.length)),I[ve]&&te(ve,Be,Y);return le&&(Y._il=le),re(Y)}function H(Y,q){var le=Y._f.length,ce,Ee,ve,Be,Ie,Me;if(le===0)return he(new Date(NaN));for(ce=0;ce<le;ce+=1)Ee=Y._f[ce],Ie=0,ve=he(Y._i,Ee,Y._l,Y._strict,q),ve.isValid()&&(Ie+=ve._jDiff,ve._il&&(Ie+=ve._il.length),(Me==null||Ie<Me)&&(Me=Ie,Be=ve));return Be}function z(Y){var q=Y._i+"",le="",ce="",Ee=Y._f.match(t),ve=Ee.length,Be,Ie,Me;for(Be=0;Be<ve;Be+=1)Ie=Ee[Be],Me=(ee(Ie,Y).exec(q)||[])[0],Me&&(q=q.slice(q.indexOf(Me)+Me.length)),I[Ie]instanceof Function||(ce+=Ie,Me&&(le+=Me));Y._i=le,Y._f=ce}function ie(Y,q,le){var ce=le-q,Ee=le-Y.day(),ve;return Ee>ce&&(Ee-=7),Ee<ce-7&&(Ee+=7),ve=pe(Y).add(Ee,"d"),{week:Math.ceil(ve.jDayOfYear()/7),year:ve.jYear()}}var ne=57724432199999;function he(Y,q,le,ce,Ee){typeof le=="boolean"&&(ce=le,le=void 0),q&&typeof q=="string"&&(q=Pe(q,r));var ve={_i:Y,_f:q,_l:le,_strict:ce},Be,Ie,Me,Ve=Y,dt=q;if(q){if(F(q))return H(ve,Ee);Be=me(ve),z(ve),q="YYYY-MM-DD-"+ve._f,Y=O(Be[0],4)+"-"+O(Be[1]+1,2)+"-"+O(Be[2],2)+"-"+ve._i}return Ee?Ie=r.utc(Y,q,le,ce):Ie=r(Y,q,le,ce),ve._isValid===!1&&(Ie._isValid=!1),Ie._jDiff=ve._jDiff||0,Me=$(pe.fn),U(Me,Ie),ce&&q&&Me.isValid()&&(Me._isValid=Me.format(dt)===Ve),Ie._d.getTime()>ne&&(Me._isValid=!1),Me}function pe(Y,q,le,ce){return he(Y,q,le,ce,!1)}U(pe,r),pe.fn=$(r.fn),pe.utc=function(Y,q,le,ce){return he(Y,q,le,ce,!0)},pe.unix=function(Y){return he(Y*1e3)};function Pe(Y,q){for(var le=5,ce=function(Ee){return q.localeData().longDateFormat(Ee)||Ee};le>0&&i.test(Y);)le-=1,Y=Y.replace(i,ce);return Y}pe.fn.format=function(Y){return Y&&(Y=Pe(Y,this),S[Y]||(S[Y]=Q(Y)),Y=S[Y](this)),r.fn.format.call(this,Y)},pe.fn.jYear=function(Y){var q,le,ce;return typeof Y=="number"?(le=ae(this.year(),this.month(),this.date()),q=Math.min(le.jd,pe.jDaysInMonth(Y,le.jm)),ce=Ae(Y,le.jm,q),x(this,ce.gy,ce.gm,ce.gd),r.updateOffset(this),this):ae(this.year(),this.month(),this.date()).jy},pe.fn.jMonth=function(Y){var q,le,ce;return Y!=null?typeof Y=="string"&&(Y=this.localeData().jMonthsParse(Y),typeof Y!="number")?this:(le=ae(this.year(),this.month(),this.date()),q=Math.min(le.jd,pe.jDaysInMonth(le.jy,Y)),this.jYear(le.jy+Re(Y,12)),Y=Le(Y,12),Y<0&&(Y+=12,this.jYear(this.jYear()-1)),ce=Ae(this.jYear(),Y,q),x(this,ce.gy,ce.gm,ce.gd),r.updateOffset(this),this):ae(this.year(),this.month(),this.date()).jm},pe.fn.jDate=function(Y){var q,le;return typeof Y=="number"?(q=ae(this.year(),this.month(),this.date()),le=Ae(q.jy,q.jm,Y),x(this,le.gy,le.gm,le.gd),r.updateOffset(this),this):ae(this.year(),this.month(),this.date()).jd},pe.fn.jDayOfYear=function(Y){var q=Math.round((pe(this).startOf("day")-pe(this).startOf("jYear"))/864e5)+1;return Y==null?q:this.add(Y-q,"d")},pe.fn.jWeek=function(Y){var q=ie(this,this.localeData()._week.dow,this.localeData()._week.doy).week;return Y==null?q:this.add((Y-q)*7,"d")},pe.fn.jWeekYear=function(Y){var q=ie(this,this.localeData()._week.dow,this.localeData()._week.doy).year;return Y==null?q:this.add(Y-q,"y")},pe.fn.add=function(Y,q){var le;return q!==null&&!isNaN(+q)&&(le=Y,Y=q,q=le),q=G(q),q==="jyear"?this.jYear(this.jYear()+Y):q==="jmonth"?this.jMonth(this.jMonth()+Y):(r.fn.add.call(this,Y,q),isNaN(this.jYear())&&(this._isValid=!1)),this},pe.fn.subtract=function(Y,q){var le;return q!==null&&!isNaN(+q)&&(le=Y,Y=q,q=le),q=G(q),q==="jyear"?this.jYear(this.jYear()-Y):q==="jmonth"?this.jMonth(this.jMonth()-Y):r.fn.subtract.call(this,Y,q),this},pe.fn.startOf=function(Y){return Y=G(Y),Y==="jyear"||Y==="jmonth"?(Y==="jyear"&&this.jMonth(0),this.jDate(1),this.hours(0),this.minutes(0),this.seconds(0),this.milliseconds(0),this):r.fn.startOf.call(this,Y)},pe.fn.endOf=function(Y){return Y=G(Y),Y===void 0||Y==="milisecond"?this:this.startOf(Y).add(1,Y==="isoweek"?"week":Y).subtract(1,"ms")},pe.fn.isSame=function(Y,q){return q=G(q),q==="jyear"||q==="jmonth"?r.fn.isSame.call(this.startOf(q),Y.startOf(q)):r.fn.isSame.call(this,Y,q)},pe.fn.clone=function(){return pe(this)},pe.fn.jYears=pe.fn.jYear,pe.fn.jMonths=pe.fn.jMonth,pe.fn.jDates=pe.fn.jDate,pe.fn.jWeeks=pe.fn.jWeek,pe.jDaysInMonth=function(Y,q){return Y+=Re(q,12),q=Le(q,12),q<0&&(q+=12,Y-=1),q<6?31:q<11||pe.jIsLeapYear(Y)?30:29},pe.jIsLeapYear=e.isLeapJalaaliYear,pe.loadPersian=function(Y){var q=Y!==void 0&&Y.hasOwnProperty("usePersianDigits")?Y.usePersianDigits:!1,le=Y!==void 0&&Y.hasOwnProperty("dialect")?Y.dialect:"persian";r.locale("fa"),r.updateLocale("fa",{months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:{persian:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_آدینه_شنبه".split("_"),"persian-modern":"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_")}[le],weekdaysShort:{persian:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_آدینه_شنبه".split("_"),"persian-modern":"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_")}[le],weekdaysMin:{persian:"ی_د_س_چ_پ_آ_ش".split("_"),"persian-modern":"ی_د_س_چ_پ_ج_ش".split("_")}[le],longDateFormat:{LT:"HH:mm",L:"jYYYY/jMM/jDD",LL:"jD jMMMM jYYYY",LLL:"jD jMMMM jYYYY LT",LLLL:"dddd، jD jMMMM jYYYY LT"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [ی پیش ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",m:"1 دقیقه",mm:"%d دقیقه",h:"1 ساعت",hh:"%d ساعت",d:"1 روز",dd:"%d روز",M:"1 ماه",MM:"%d ماه",y:"1 سال",yy:"%d سال"},preparse:function(ce){return q?ce.replace(/[۰-۹]/g,function(Ee){return m[Ee]}).replace(/،/g,","):ce},postformat:function(ce){return q?ce.replace(/\d/g,function(Ee){return E[Ee]}).replace(/,/g,"،"):ce},ordinal:"%dم",week:{dow:6,doy:12},meridiem:function(ce){return ce<12?"ق.ظ":"ب.ظ"},jMonths:{persian:"فروردین_اردیبهشت_خرداد_تیر_امرداد_شهریور_مهر_آبان_آذر_دی_بهمن_اسفند".split("_"),"persian-modern":"فروردین_اردیبهشت_خرداد_تیر_مرداد_شهریور_مهر_آبان_آذر_دی_بهمن_اسفند".split("_")}[le],jMonthsShort:{persian:"فرو_ارد_خرد_تیر_امر_شهر_مهر_آبا_آذر_دی_بهم_اسف".split("_"),"persian-modern":"فرو_ارد_خرد_تیر_مرد_شهر_مهر_آبا_آذر_دی_بهم_اسف".split("_")}[le]})},pe.loadPersian_dari=function(Y){var q=Y!==void 0&&Y.hasOwnProperty("usePersianDigits")?Y.usePersianDigits:!1,le=Y!==void 0&&Y.hasOwnProperty("dialect")?Y.dialect:"persian-dari";r.locale("fa-af"),r.updateLocale("fa-af",{months:"جنوری_فبروری_مارچ_اپریل_می_جون_جولای_آگست_سپتمبر_اکتوبر_نومبر_دیسمبر".split("_"),monthsShort:"جنوری_فبروری_مارچ_اپریل_می_جون_جولای_آگست_سپتمبر_اکتوبر_نومبر_دیسمبر".split("_"),weekdays:{persian:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_آدینه_شنبه".split("_"),"persian-modern":"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_")}[le],weekdaysShort:{persian:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_آدینه_شنبه".split("_"),"persian-modern":"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_")}[le],weekdaysMin:{persian:"ی_د_س_چ_پ_آ_ش".split("_"),"persian-modern":"ی_د_س_چ_پ_ج_ش".split("_")}[le],longDateFormat:{LT:"HH:mm",L:"jYYYY/jMM/jDD",LL:"jD jMMMM jYYYY",LLL:"jD jMMMM jYYYY LT",LLLL:"dddd، jD jMMMM jYYYY LT"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [ی پیش ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",m:"1 دقیقه",mm:"%d دقیقه",h:"1 ساعت",hh:"%d ساعت",d:"1 روز",dd:"%d روز",M:"1 ماه",MM:"%d ماه",y:"1 سال",yy:"%d سال"},preparse:function(ce){return q?ce.replace(/[۰-۹]/g,function(Ee){return m[Ee]}).replace(/،/g,","):ce},postformat:function(ce){return q?ce.replace(/\d/g,function(Ee){return E[Ee]}).replace(/,/g,"،"):ce},ordinal:"%dم",week:{dow:6,doy:12},meridiem:function(ce){return ce<12?"ق.ظ":"ب.ظ"},jMonths:{"persian-dari":"حمل_ثور_جوزا_سرطان_اسد_سنبله_میزان_عقرب_قوس_جدی_دلو_حوت".split("_"),"persian-modern-dari":"حمل_ثور_جوزا_سرطان_اسد_سنبله_میزان_عقرب_قوس_جدی_دلو_حوت".split("_")}[le],jMonthsShort:{"persian-dari":"حمل_ثور_جوزا_سرط_اسد_سنب_میز_عقر_قوس_جدی_دلو_حوت".split("_"),"persian-modern-dari":"حمل_ثور_جوزا_سرط_اسد_سنب_میز_عقر_قوس_جدی_دلو_حوت".split("_")}[le]})},pe.loadPashto=function(Y){var q=Y!==void 0&&Y.hasOwnProperty("usePersianDigits")?Y.usePersianDigits:!1,le=Y!==void 0&&Y.hasOwnProperty("dialect")?Y.dialect:"pashto";r.locale("ps-af"),r.updateLocale("ps-af",{months:"جنوری_فبروری_مارچ_اپریل_می_جون_جولای_آگست_سپتمبر_اکتوبر_نومبر_دیسمبر".split("_"),monthsShort:"جنوری_فبروری_مارچ_اپریل_می_جون_جولای_آگست_سپتمبر_اکتوبر_نومبر_دیسمبر".split("_"),weekdays:{pashto:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_آدینه_شنبه".split("_"),"pashto-modern":"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_")}[le],weekdaysShort:{pashto:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_آدینه_شنبه".split("_"),"pashto-modern":"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_")}[le],weekdaysMin:{pashto:"ی_د_س_چ_پ_آ_ش".split("_"),"pashto-modern":"ی_د_س_چ_پ_ج_ش".split("_")}[le],longDateFormat:{LT:"HH:mm",L:"jYYYY/jMM/jDD",LL:"jD jMMMM jYYYY",LLL:"jD jMMMM jYYYY LT",LLLL:"dddd، jD jMMMM jYYYY LT"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [ی پیش ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",m:"1 دقیقه",mm:"%d دقیقه",h:"1 ساعت",hh:"%d ساعت",d:"1 روز",dd:"%d روز",M:"1 ماه",MM:"%d ماه",y:"1 سال",yy:"%d سال"},preparse:function(ce){return q?ce.replace(/[۰-۹]/g,function(Ee){return m[Ee]}).replace(/،/g,","):ce},postformat:function(ce){return q?ce.replace(/\d/g,function(Ee){return E[Ee]}).replace(/,/g,"،"):ce},ordinal:"%dم",week:{dow:6,doy:12},meridiem:function(ce){return ce<12?"ق.ظ":"ب.ظ"},jMonths:{pashto:"وری_غویی_غبرګولی_چنګاښ_زمری_وږی_تله_لړم_لیندی_مرغومی_سلواغه_کب".split("_"),"pashto-modern":"وری_غویی_غبرګولی_چنګاښ_زمری_وږی_تله_لړم_لیندی_مرغومی_سلواغه_کب".split("_")}[le],jMonthsShort:{pashto:"وری_غوی_غبر_چنګ_زمر_وږی_لړم_لین_مرغ_سلو_کب".split("_"),"pashto-modern":"وری_غوی_غبر_چنګ_زمر_وږی_لړم_لین_مرغ_سلو_کب".split("_")}[le]})},pe.jConvert={toJalaali:ae,toGregorian:Ae};function ae(Y,q,le){try{var ce=e.toJalaali(Y,q+1,le);return ce.jm-=1,ce}catch{return{jy:NaN,jm:NaN,jd:NaN}}}function Ae(Y,q,le){try{var ce=e.toGregorian(Y,q+1,le);return ce.gm-=1,ce}catch{return{gy:NaN,gm:NaN,gd:NaN}}}function Re(Y,q){return~~(Y/q)}function Le(Y,q){return Y-~~(Y/q)*q}return momentJalaali}var momentJalaaliExports=requireMomentJalaali();const moment=getDefaultExportFromCjs$1(momentJalaaliExports);moment.loadPersian({dialect:"persian-modern",usePersianDigits:!0});const formatTime=r=>{const e=Math.floor(r/3600),t=Math.floor(r%3600/60),i=Math.floor(r%60),s=String(t).padStart(2,"0"),n=String(i).padStart(2,"0");return e>0?`${e}:${s}:${n}`:`${s}:${n}`};function RetrySvg({width:r=24}){return jsxRuntime.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M16.19 2H7.81C4.17 2 2 4.17 2 7.81V16.18C2 19.83 4.17 22 7.81 22H16.18C19.82 22 21.99 19.83 21.99 16.19V7.81C22 4.17 19.83 2 16.19 2ZM12 18.01C8.83 18.01 6.25 15.43 6.25 12.26C6.25 11.12 6.58 10.01 7.22 9.07C7.45 8.72 7.92 8.63 8.26 8.86C8.6 9.09 8.7 9.56 8.46 9.9C8 10.6 7.75 11.42 7.75 12.26C7.75 14.6 9.66 16.51 12 16.51C14.34 16.51 16.25 14.6 16.25 12.26C16.25 9.92 14.34 8.01 12 8.01C11.81 8.01 11.63 8.03 11.44 8.05L12 8.46C12.33 8.7 12.41 9.17 12.16 9.51C12.01 9.71 11.78 9.82 11.55 9.82C11.4 9.82 11.24 9.77 11.11 9.68L9.17 8.25C9.17 8.25 9.16 8.24 9.15 8.23C9.14 8.22 9.13 8.22 9.12 8.21C9.09 8.19 9.08 8.15 9.05 8.12C9.02 8.08 8.99 8.05 8.96 8C8.94 7.96 8.93 7.91 8.91 7.87C8.9 7.82 8.88 7.78 8.88 7.73C8.88 7.68 8.88 7.64 8.89 7.59C8.89 7.54 8.89 7.5 8.91 7.45C8.91 7.4 8.94 7.36 8.96 7.31C8.98 7.28 8.98 7.24 9.01 7.2C9.02 7.2 9.03 7.19 9.04 7.18C9.05 7.17 9.05 7.16 9.06 7.15L10.73 5.24C11 4.93 11.48 4.89 11.79 5.17C12.1 5.44 12.13 5.92 11.86 6.23L11.58 6.55C11.72 6.54 11.86 6.52 12.01 6.52C15.18 6.52 17.76 9.1 17.76 12.27C17.76 15.44 15.17 18.01 12 18.01Z",fill:"#fff"})})}var DeviceTypeEnum=(r=>(r.DESKTOP="desktop",r.MOBILE="mobile",r))(DeviceTypeEnum||{});function useDeviceType(){const[r,e]=React.useState(DeviceTypeEnum.MOBILE);React.useEffect(()=>(t(),window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}));const t=()=>{window.innerWidth>1024?e(DeviceTypeEnum.DESKTOP):e(DeviceTypeEnum.MOBILE)};return r}function MainControl({children:r}){return jsxRuntime.jsx("section",{children:jsxRuntime.jsx("div",{className:"w-24 h-24 flex justify-center items-center bg-black/40 backdrop-blur-xs rounded-full",children:r})})}function MinimizeSvg({width:r=24}){return jsxRuntime.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M16.19 2H7.81C4.17 2 2 4.17 2 7.81V16.18C2 19.83 4.17 22 7.81 22H16.18C19.82 22 21.99 19.83 21.99 16.19V7.81C22 4.17 19.83 2 16.19 2ZM10.22 21H7.91C5.2 21 3 18.8 3 16.09V13.78C3 13.37 3.34 13.03 3.75 13.03C4.16 13.03 4.5 13.37 4.5 13.78V16.09C4.5 17.97 6.03 19.5 7.91 19.5H10.22C10.63 19.5 10.97 19.84 10.97 20.25C10.97 20.66 10.64 21 10.22 21ZM10.22 4.5H7.91C6.03 4.5 4.5 6.03 4.5 7.91V10.22C4.5 10.63 4.16 10.97 3.75 10.97C3.34 10.97 3 10.64 3 10.22V7.91C3 5.2 5.2 3 7.91 3H10.22C10.63 3 10.97 3.34 10.97 3.75C10.97 4.16 10.64 4.5 10.22 4.5ZM21 16.09C21 18.8 18.8 21 16.09 21H14.7C14.29 21 13.95 20.66 13.95 20.25C13.95 19.84 14.29 19.5 14.7 19.5H16.09C17.97 19.5 19.5 17.97 19.5 16.09V14.7C19.5 14.29 19.84 13.95 20.25 13.95C20.66 13.95 21 14.29 21 14.7V16.09ZM21 10.22C21 10.63 20.66 10.97 20.25 10.97C19.84 10.97 19.5 10.63 19.5 10.22V7.91C19.5 6.03 17.97 4.5 16.09 4.5H13.78C13.37 4.5 13.03 4.16 13.03 3.75C13.03 3.34 13.36 3 13.78 3H16.09C18.8 3 21 5.2 21 7.91V10.22Z",fill:"#fff"})})}function VideoPlayerControl({canPlay:r,isPlayed:e,isMuted:t,isShowControl:i,isError:s,currentTime:n,duration:a,bufferedRanges:o,rates:c,onMaximize:u,onBackwardCurrentTime:f,onForwardCurrentTime:d,onDoubleClickInRight:g,onDoubleClickInLeft:E,onToggleMute:m,onTogglePlay:T,onChangeRate:S,onSeek:b,onTryAgain:C,isFullScreen:I}){const[L,k]=React.useState(!1),[U,O]=React.useState(!1),F=useDeviceType(),G=()=>{if(!a)return"";const x=n/a*100,$=`linear-gradient(to right, rgba(255,255,255,0.2) 0%, rgba(255,255,255,1) ${x}%, transparent ${x}%)`,X="rgba(0, 0, 0, 0.6)",Q="rgba(255, 255, 255, 0.1)";let ee=[`transparent ${x}%`];o.length>0&&o.forEach(re=>{const me=re.start/a*100,H=re.end/a*100;if(H<=x)return;const z=Math.max(me,x);ee.push(`${X} ${z}%`,`${X} ${H}%`)}),ee.push(`${Q} ${x}%`,`${Q} 100%`);const te=`linear-gradient(to right, ${ee.join(", ")})`;return`${$}, ${te}`};return React.useEffect(()=>{k(!0);const x=setTimeout(()=>{k(!1)},100);return()=>{clearTimeout(x)}},[t]),React.useEffect(()=>{O(!0);const x=setTimeout(()=>{O(!1)},100);return()=>{clearTimeout(x)}},[c]),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Transition,{enterAnimateClass:"fadeIn",exitAnimateClass:"fadeOut",isVisible:r&&!e,children:jsxRuntime.jsx("div",{className:"absolute top-0 bottom-0 left-0 right-0 flex justify-center items-center cursor-pointer",children:jsxRuntime.jsx(MainControl,{children:jsxRuntime.jsx(PlayCircleSvg,{width:50})})})}),jsxRuntime.jsx(Transition,{enterAnimateClass:"fadeIn",exitAnimateClass:"fadeOut",isVisible:s,children:jsxRuntime.jsx("div",{onClick:()=>C?.(),className:"absolute top-0 bottom-0 left-0 right-0 flex justify-center items-center cursor-pointer bg-black/30 backdrop-blur-[1px]",children:jsxRuntime.jsx(MainControl,{children:jsxRuntime.jsx(RetrySvg,{width:50})})})}),jsxRuntime.jsx(Transition,{enterAnimateClass:"fadeIn",exitAnimateClass:"fadeOut",isVisible:!r&&!s,children:jsxRuntime.jsx("div",{className:"absolute top-0 bottom-0 left-0 right-0 flex justify-center items-center cursor-pointer bg-black/30 backdrop-blur-[1px]",children:jsxRuntime.jsx(MainControl,{children:jsxRuntime.jsx(Loading,{classNames:"w-[50px]"})})})}),r&&e?jsxRuntime.jsx("div",{onDoubleClick:()=>{g?.()},className:"absolute top-0 bottom-0 right-0 w-[50%] cursor-pointer"}):null,r&&e?jsxRuntime.jsx("div",{onDoubleClick:()=>{E?.()},className:"absolute top-0 bottom-0 left-0 w-[50%] cursor-pointer"}):null,jsxRuntime.jsx(Transition,{className:"absolute bottom-10 left-12 right-12 flex flex-col gap-5 items-center",enterAnimateClass:"fadeIn",exitAnimateClass:"fadeOut",speedAnimateClass:"faster",isVisible:r&&e&&i,children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"w-full px-5 flex items-center",onClick:x=>x.stopPropagation(),children:jsxRuntime.jsx("input",{type:"range",min:0,max:a,value:n,onChange:x=>b?.(parseFloat(x.target.value)),className:"w-full h-3 appearance-none cursor-pointer rounded-full backdrop-blur-xs transition duration-500 bg-black/60",style:{direction:"ltr",backgroundImage:G(),backgroundSize:"100% 100%",outline:"none"}})}),jsxRuntime.jsxs("div",{onClick:x=>x.stopPropagation(),className:`w-full flex justify-between items-center bg-black/40 rounded-full backdrop-blur-xs transition duration-500 px-5 py-3 ${F===DeviceTypeEnum.MOBILE?"landscape:px-12":""}`,children:[jsxRuntime.jsxs("div",{className:`flex gap-3 items-center ${F===DeviceTypeEnum.MOBILE?"landscape:gap-5":""}`,children:[jsxRuntime.jsx("div",{className:"cursor-pointer",onClick:x=>{x.stopPropagation(),u?.()},children:I?jsxRuntime.jsx(MinimizeSvg,{width:30}):jsxRuntime.jsx(MaximizeSvg,{width:30})}),jsxRuntime.jsx("div",{className:"min-w-5 flex items-center justify-center cursor-pointer",onMouseUp:x=>{x.stopPropagation()},onMouseDown:x=>{x.stopPropagation()},onTouchStart:x=>{x.stopPropagation()},onTouchEnd:x=>{x.stopPropagation()},onClick:x=>{x.stopPropagation(),S?.()},children:jsxRuntime.jsx(Transition,{enterAnimateClass:"heartBeat",exitAnimateClass:"heartBeat",speedAnimateClass:"faster",isVisible:!U,children:jsxRuntime.jsx("span",{className:"text-white font-bold text-lg",children:lodashExports.first(lodashExports.filter(c,x=>x.active))?.label})})}),jsxRuntime.jsx("div",{className:"cursor-pointer",onClick:x=>{x.stopPropagation(),m?.()},children:jsxRuntime.jsx(Transition,{enterAnimateClass:"heartBeat",exitAnimateClass:"heartBeat",speedAnimateClass:"faster",isVisible:!L,children:t?jsxRuntime.jsx(VolumeMuteSvg,{width:30}):jsxRuntime.jsx(VolumeUnMuteSvg,{width:30})})})]}),jsxRuntime.jsxs("div",{className:`flex gap-3 items-center ${F===DeviceTypeEnum.MOBILE?"landscape:gap-5":""}`,children:[jsxRuntime.jsxs("div",{className:"flex gap-1 items-center rounded-full border border-white px-3 py-1",children:[jsxRuntime.jsx("span",{className:"text-white text-sm tabular-nums",children:formatTime(a)}),jsxRuntime.jsx("span",{className:"text-white text-sm",children:"/"}),jsxRuntime.jsx("span",{className:"text-white text-sm tabular-nums",children:formatTime(n)})]}),jsxRuntime.jsx("div",{className:"cursor-pointer",onClick:x=>{x.stopPropagation(),d?.()},children:jsxRuntime.jsx(ForwardSvg,{width:30})}),jsxRuntime.jsx("div",{className:"cursor-pointer",onClick:x=>{x.stopPropagation(),f?.()},children:jsxRuntime.jsx(BackwardSvg,{width:30})}),jsxRuntime.jsx("div",{className:"cursor-pointer",onClick:x=>{x.stopPropagation(),T?.()},children:jsxRuntime.jsx(PauseSvg,{width:30})})]})]})]})})]})}var LIBVERSION="2.0.7",UA_MAX_LENGTH=500,USER_AGENT="user-agent",EMPTY="",UNKNOWN="?",TYPEOF={FUNCTION:"function",OBJECT:"object",STRING:"string",UNDEFINED:"undefined"},BROWSER="browser",CPU="cpu",DEVICE="device",ENGINE="engine",OS="os",RESULT="result",NAME="name",TYPE="type",VENDOR="vendor",VERSION="version",ARCHITECTURE="architecture",MAJOR="major",MODEL="model",CONSOLE="console",MOBILE="mobile",TABLET="tablet",SMARTTV="smarttv",WEARABLE="wearable",XR="xr",EMBEDDED="embedded",INAPP="inapp",BRANDS="brands",FORMFACTORS="formFactors",FULLVERLIST="fullVersionList",PLATFORM="platform",PLATFORMVER="platformVersion",BITNESS="bitness",CH="sec-ch-ua",CH_FULL_VER_LIST=CH+"-full-version-list",CH_ARCH=CH+"-arch",CH_BITNESS=CH+"-"+BITNESS,CH_FORM_FACTORS=CH+"-form-factors",CH_MOBILE=CH+"-"+MOBILE,CH_MODEL=CH+"-"+MODEL,CH_PLATFORM=CH+"-"+PLATFORM,CH_PLATFORM_VER=CH_PLATFORM+"-version",CH_ALL_VALUES=[BRANDS,FULLVERLIST,MOBILE,MODEL,PLATFORM,PLATFORMVER,ARCHITECTURE,FORMFACTORS,BITNESS],AMAZON="Amazon",APPLE="Apple",ASUS="ASUS",BLACKBERRY="BlackBerry",GOOGLE="Google",HUAWEI="Huawei",LENOVO="Lenovo",HONOR="Honor",LG="LG",MICROSOFT="Microsoft",MOTOROLA="Motorola",NVIDIA="Nvidia",ONEPLUS="OnePlus",OPPO="OPPO",SAMSUNG="Samsung",SHARP="Sharp",SONY="Sony",XIAOMI="Xiaomi",ZEBRA="Zebra",CHROME="Chrome",CHROMIUM="Chromium",CHROMECAST="Chromecast",EDGE="Edge",FIREFOX="Firefox",OPERA="Opera",FACEBOOK="Facebook",SOGOU="Sogou",PREFIX_MOBILE="Mobile ",SUFFIX_BROWSER=" Browser",WINDOWS="Windows",isWindow=typeof window!==TYPEOF.UNDEFINED,NAVIGATOR=isWindow&&window.navigator?window.navigator:void 0,NAVIGATOR_UADATA=NAVIGATOR&&NAVIGATOR.userAgentData?NAVIGATOR.userAgentData:void 0,extend=function(r,e){var t={},i=e;if(!isExtensions(e)){i={};for(var s in e)for(var n in e[s])i[n]=e[s][n].concat(i[n]?i[n]:[])}for(var a in r)t[a]=i[a]&&i[a].length%2===0?i[a].concat(r[a]):r[a];return t},enumerize=function(r){for(var e={},t=0;t<r.length;t++)e[r[t].toUpperCase()]=r[t];return e},has=function(r,e){if(typeof r===TYPEOF.OBJECT&&r.length>0){for(var t in r)if(lowerize(e)==lowerize(r[t]))return!0;return!1}return isString(r)?lowerize(e)==lowerize(r):!1},isExtensions=function(r,e){for(var t in r)return/^(browser|cpu|device|engine|os)$/.test(t)||(e?isExtensions(r[t]):!1)},isString=function(r){return typeof r===TYPEOF.STRING},itemListToArray=function(r){if(r){for(var e=[],t=strip(/\\?\"/g,r).split(","),i=0;i<t.length;i++)if(t[i].indexOf(";")>-1){var s=trim(t[i]).split(";v=");e[i]={brand:s[0],version:s[1]}}else e[i]=trim(t[i]);return e}},lowerize=function(r){return isString(r)?r.toLowerCase():r},majorize=function(r){return isString(r)?strip(/[^\d\.]/g,r).split(".")[0]:void 0},setProps=function(r){for(var e in r)if(r.hasOwnProperty(e)){var t=r[e];typeof t==TYPEOF.OBJECT&&t.length==2?this[t[0]]=t[1]:this[t]=void 0}return this},strip=function(r,e){return isString(e)?e.replace(r,EMPTY):e},stripQuotes=function(r){return strip(/\\?\"/g,r)},trim=function(r,e){return r=strip(/^\s\s*/,String(r)),typeof e===TYPEOF.UNDEFINED?r:r.substring(0,e)},rgxMapper=function(r,e){if(!(!r||!e))for(var t=0,i,s,n,a,o,c;t<e.length&&!o;){var u=e[t],f=e[t+1];for(i=s=0;i<u.length&&!o&&u[i];)if(o=u[i++].exec(r),o)for(n=0;n<f.length;n++)c=o[++s],a=f[n],typeof a===TYPEOF.OBJECT&&a.length>0?a.length===2?typeof a[1]==TYPEOF.FUNCTION?this[a[0]]=a[1].call(this,c):this[a[0]]=a[1]:a.length>=3&&(typeof a[1]===TYPEOF.FUNCTION&&!(a[1].exec&&a[1].test)?a.length>3?this[a[0]]=c?a[1].apply(this,a.slice(2)):void 0:this[a[0]]=c?a[1].call(this,c,a[2]):void 0:a.length==3?this[a[0]]=c?c.replace(a[1],a[2]):void 0:a.length==4?this[a[0]]=c?a[3].call(this,c.replace(a[1],a[2])):void 0:a.length>4&&(this[a[0]]=c?a[3].apply(this,[c.replace(a[1],a[2])].concat(a.slice(4))):void 0)):this[a]=c||void 0;t+=2}},strMapper=function(r,e){for(var t in e)if(typeof e[t]===TYPEOF.OBJECT&&e[t].length>0){for(var i=0;i<e[t].length;i++)if(has(e[t][i],r))return t===UNKNOWN?void 0:t}else if(has(e[t],r))return t===UNKNOWN?void 0:t;return e.hasOwnProperty("*")?e["*"]:r},windowsVersionMap={ME:"4.90","NT 3.51":"3.51","NT 4.0":"4.0",2e3:["5.0","5.01"],XP:["5.1","5.2"],Vista:"6.0",7:"6.1",8:"6.2","8.1":"6.3",10:["6.4","10.0"],NT:""},formFactorsMap={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":void 0},browserHintsMap={Chrome:"Google Chrome",Edge:"Microsoft Edge","Edge WebView2":"Microsoft Edge WebView2","Chrome WebView":"Android WebView","Chrome Headless":"HeadlessChrome","Huawei Browser":"HuaweiBrowser","MIUI Browser":"Miui Browser","Opera Mobi":"OperaMobile",Yandex:"YaBrowser"},defaultRegexes={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[VERSION,[NAME,PREFIX_MOBILE+"Chrome"]],[/webview.+edge\/([\w\.]+)/i],[VERSION,[NAME,EDGE+" WebView"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[VERSION,[NAME,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[NAME,VERSION],[/opios[\/ ]+([\w\.]+)/i],[VERSION,[NAME,OPERA+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[VERSION,[NAME,OPERA+" GX"]],[/\bopr\/([\w\.]+)/i],[VERSION,[NAME,OPERA]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[VERSION,[NAME,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[VERSION,[NAME,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(atlas|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:lg |qute)browser|palemoon)\/([-\w\.]+)/i,/(heytap|ovi|115|surf|qwant)browser\/([\d\.]+)/i,/(qwant)(?:ios|mobile)\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[NAME,VERSION],[/quark(?:pc)?\/([-\w\.]+)/i],[VERSION,[NAME,"Quark"]],[/\bddg\/([\w\.]+)/i],[VERSION,[NAME,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[VERSION,[NAME,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[VERSION,[NAME,"WeChat"]],[/konqueror\/([\w\.]+)/i],[VERSION,[NAME,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[VERSION,[NAME,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[VERSION,[NAME,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[VERSION,[NAME,"Smart "+LENOVO+SUFFIX_BROWSER]],[/(avast|avg)\/([\w\.]+)/i],[[NAME,/(.+)/,"$1 Secure"+SUFFIX_BROWSER],VERSION],[/\bfocus\/([\w\.]+)/i],[VERSION,[NAME,FIREFOX+" Focus"]],[/\bopt\/([\w\.]+)/i],[VERSION,[NAME,OPERA+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[VERSION,[NAME,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[VERSION,[NAME,"Dolphin"]],[/coast\/([\w\.]+)/i],[VERSION,[NAME,OPERA+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[VERSION,[NAME,"MIUI"+SUFFIX_BROWSER]],[/fxios\/([\w\.-]+)/i],[VERSION,[NAME,PREFIX_MOBILE+FIREFOX]],[/\bqihoobrowser\/?([\w\.]*)/i],[VERSION,[NAME,"360"]],[/\b(qq)\/([\w\.]+)/i],[[NAME,/(.+)/,"$1Browser"],VERSION],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[NAME,/(.+)/,"$1"+SUFFIX_BROWSER],VERSION],[/samsungbrowser\/([\w\.]+)/i],[VERSION,[NAME,SAMSUNG+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[VERSION,[NAME,SOGOU+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[NAME,SOGOU+" Mobile"],VERSION],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[NAME,VERSION],[/(lbbrowser|rekonq|steam(?= (clie|tenf|gameo)))/i],[NAME],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[VERSION,NAME],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[NAME,FACEBOOK],VERSION,[TYPE,INAPP]],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(bing)(?:web|sapphire)\/([\w\.]+)/i,/(instagram|snapchat|klarna)[\/ ]([-\w\.]+)/i],[NAME,VERSION,[TYPE,INAPP]],[/\bgsa\/([\w\.]+) .*safari\//i],[VERSION,[NAME,"GSA"],[TYPE,INAPP]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[VERSION,[NAME,"TikTok"],[TYPE,INAPP]],[/\[(linkedin)app\]/i],[NAME,[TYPE,INAPP]],[/(zalo(?:app)?)[\/\sa-z]*([\w\.-]+)/i],[[NAME,/(.+)/,"Zalo"],VERSION,[TYPE,INAPP]],[/(chromium)[\/ ]([-\w\.]+)/i],[NAME,VERSION],[/headlesschrome(?:\/([\w\.]+)| )/i],[VERSION,[NAME,CHROME+" Headless"]],[/wv\).+chrome\/([\w\.]+).+edgw\//i],[VERSION,[NAME,EDGE+" WebView2"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[NAME,CHROME+" WebView"],VERSION],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[VERSION,[NAME,"Android"+SUFFIX_BROWSER]],[/chrome\/([\w\.]+) mobile/i],[VERSION,[NAME,PREFIX_MOBILE+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[NAME,VERSION],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[VERSION,[NAME,PREFIX_MOBILE+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[NAME,PREFIX_MOBILE+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[VERSION,NAME],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[NAME,[VERSION,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[NAME,VERSION],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[NAME,PREFIX_MOBILE+FIREFOX],VERSION],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[NAME,"Netscape"],VERSION],[/(wolvic|librewolf)\/([\w\.]+)/i],[NAME,VERSION],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[VERSION,[NAME,FIREFOX+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+(?= .+rv\:.+gecko\/\d+)|[0-4][\w\.]+(?!.+compatible))/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[NAME,[VERSION,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[NAME,[VERSION,/[^\d\.]+./,EMPTY]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[ARCHITECTURE,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[ARCHITECTURE,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[ARCHITECTURE,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[ARCHITECTURE,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[ARCHITECTURE,"arm"]],[/ sun4\w[;\)]/i],[[ARCHITECTURE,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i,/((ppc|powerpc)(64)?)( mac|;|\))/i,/(?:osf1|[freopnt]{3,4}bsd) (alpha)/i],[[ARCHITECTURE,/ower/,EMPTY,lowerize]],[/mc680.0/i],[[ARCHITECTURE,"68k"]],[/winnt.+\[axp/i],[[ARCHITECTURE,"alpha"]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[MODEL,[VENDOR,SAMSUNG],[TYPE,TABLET]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr]|browser)[-\w]+)/i,/sec-(sgh\w+)/i],[MODEL,[VENDOR,SAMSUNG],[TYPE,MOBILE]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)[\/\);]/i],[MODEL,[VENDOR,APPLE],[TYPE,MOBILE]],[/\b(?:ios|apple\w+)\/.+[\(\/](ipad)/i,/\b(ipad)[\d,]*[;\] ].+(mac |i(pad)?)os/i],[MODEL,[VENDOR,APPLE],[TYPE,TABLET]],[/(macintosh);/i],[MODEL,[VENDOR,APPLE]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[MODEL,[VENDOR,SHARP],[TYPE,MOBILE]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[MODEL,[VENDOR,HONOR],[TYPE,TABLET]],[/honor([-\w ]+)[;\)]/i],[MODEL,[VENDOR,HONOR],[TYPE,MOBILE]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[MODEL,[VENDOR,HUAWEI],[TYPE,TABLET]],[/(?:huawei) ?([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][\dc][adnt]?)\b(?!.+d\/s)/i],[MODEL,[VENDOR,HUAWEI],[TYPE,MOBILE]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b(?:xiao)?((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[MODEL,/_/g," "],[VENDOR,XIAOMI],[TYPE,TABLET]],[/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/oid[^\)]+; (redmi[\-_ ]?(?:note|k)?[\w_ ]+|m?[12]\d[01]\d\w{3,6}|poco[\w ]+|(shark )?\w{3}-[ah]0|qin ?[1-3](s\+|ultra| pro)?)( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note|max|cc)?[_ ]?(?:\d{0,2}\w?)[_ ]?(?:plus|se|lite|pro)?( 5g|lte)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[MODEL,/_/g," "],[VENDOR,XIAOMI],[TYPE,MOBILE]],[/droid.+; (cph2[3-6]\d[13579]|((gm|hd)19|(ac|be|in|kb)20|(d[en]|eb|le|mt)21|ne22)[0-2]\d|p[g-k]\w[1m]10)\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[MODEL,[VENDOR,ONEPLUS],[TYPE,MOBILE]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[MODEL,[VENDOR,OPPO],[TYPE,MOBILE]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[MODEL,[VENDOR,strMapper,{OnePlus:["203","304","403","404","413","415"],"*":OPPO}],[TYPE,TABLET]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[MODEL,[VENDOR,"BLU"],[TYPE,MOBILE]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[MODEL,[VENDOR,"Vivo"],[TYPE,MOBILE]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[MODEL,[VENDOR,"Realme"],[TYPE,MOBILE]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[MODEL,[VENDOR,LENOVO],[TYPE,TABLET]],[/lenovo[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i],[MODEL,[VENDOR,LENOVO],[TYPE,MOBILE]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ]([\w\s]+)(\)| bui)/i,/((?:moto(?! 360)[-\w\(\) ]+|xt\d{3,4}[cgkosw\+]?[-\d]*|nexus 6)(?= bui|\)))/i],[MODEL,[VENDOR,MOTOROLA],[TYPE,MOBILE]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[MODEL,[VENDOR,MOTOROLA],[TYPE,TABLET]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[MODEL,[VENDOR,LG],[TYPE,TABLET]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch|webos))(\w+)/i,/\blg-?([\d\w]+) bui/i],[MODEL,[VENDOR,LG],[TYPE,MOBILE]],[/(nokia) (t[12][01])/i],[VENDOR,MODEL,[TYPE,TABLET]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*?))( bui|\)|;|\/)/i],[[MODEL,/_/g," "],[TYPE,MOBILE],[VENDOR,"Nokia"]],[/(pixel (c|tablet))\b/i],[MODEL,[VENDOR,GOOGLE],[TYPE,TABLET]],[/droid.+;(?: google)? (g(01[13]a|020[aem]|025[jn]|1b60|1f8f|2ybb|4s1m|576d|5nz6|8hhn|8vou|a02099|c15s|d1yq|e2ae|ec77|gh2x|kv4x|p4bc|pj41|r83y|tt9q|ur25|wvk6)|pixel[\d ]*a?( pro)?( xl)?( fold)?( \(5g\))?)( bui|\))/i],[MODEL,[VENDOR,GOOGLE],[TYPE,MOBILE]],[/(google) (pixelbook( go)?)/i],[VENDOR,MODEL],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-\w\w\d\d)(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[MODEL,[VENDOR,SONY],[TYPE,MOBILE]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[MODEL,"Xperia Tablet"],[VENDOR,SONY],[TYPE,TABLET]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[MODEL,[VENDOR,AMAZON],[TYPE,TABLET]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[MODEL,/(.+)/g,"Fire Phone $1"],[VENDOR,AMAZON],[TYPE,MOBILE]],[/(playbook);[-\w\),; ]+(rim)/i],[MODEL,VENDOR,[TYPE,TABLET]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/(?:blackberry|\(bb10;) (\w+)/i],[MODEL,[VENDOR,BLACKBERRY],[TYPE,MOBILE]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[MODEL,[VENDOR,ASUS],[TYPE,TABLET]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[MODEL,[VENDOR,ASUS],[TYPE,MOBILE]],[/(nexus 9)/i],[MODEL,[VENDOR,"HTC"],[TYPE,TABLET]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[VENDOR,[MODEL,/_/g," "],[TYPE,MOBILE]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[MODEL,[VENDOR,"TCL"],[TYPE,TABLET]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[MODEL,[VENDOR,"TCL"],[TYPE,MOBILE]],[/(itel) ((\w+))/i],[[VENDOR,lowerize],MODEL,[TYPE,strMapper,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[MODEL,[VENDOR,"Acer"],[TYPE,TABLET]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[MODEL,[VENDOR,"Meizu"],[TYPE,MOBILE]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[MODEL,[VENDOR,"Ulefone"],[TYPE,MOBILE]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[MODEL,[VENDOR,"Energizer"],[TYPE,MOBILE]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[MODEL,[VENDOR,"Cat"],[TYPE,MOBILE]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[MODEL,[VENDOR,"Smartfren"],[TYPE,MOBILE]],[/droid.+; (a(in)?(0(15|59|6[35])|142)p?)/i],[MODEL,[VENDOR,"Nothing"],[TYPE,MOBILE]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[MODEL,[VENDOR,"Archos"],[TYPE,TABLET]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[MODEL,[VENDOR,"Archos"],[TYPE,MOBILE]],[/; (n159v)/i],[MODEL,[VENDOR,"HMD"],[TYPE,MOBILE]],[/(imo) (tab \w+)/i,/(infinix|tecno) (x1101b?|p904|dp(7c|8d|10a)( pro)?|p70[1-3]a?|p904|t1101)/i],[VENDOR,MODEL,[TYPE,TABLET]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|hmd|imo|infinix|lava|oneplus|tcl|wiko)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(oppo) ?([\w ]+) bui/i,/(hisense) ([ehv][\w ]+)\)/i,/droid[^;]+; (philips)[_ ]([sv-x][\d]{3,4}[xz]?)/i],[VENDOR,MODEL,[TYPE,MOBILE]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[VENDOR,MODEL,[TYPE,TABLET]],[/(surface duo)/i],[MODEL,[VENDOR,MICROSOFT],[TYPE,TABLET]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[MODEL,[VENDOR,"Fairphone"],[TYPE,MOBILE]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[MODEL,[VENDOR,NVIDIA],[TYPE,TABLET]],[/(sprint) (\w+)/i],[VENDOR,MODEL,[TYPE,MOBILE]],[/(kin\.[onetw]{3})/i],[[MODEL,/\./g," "],[VENDOR,MICROSOFT],[TYPE,MOBILE]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[MODEL,[VENDOR,ZEBRA],[TYPE,TABLET]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[MODEL,[VENDOR,ZEBRA],[TYPE,MOBILE]],[/(philips)[\w ]+tv/i,/smart-tv.+(samsung)/i],[VENDOR,[TYPE,SMARTTV]],[/hbbtv.+maple;(\d+)/i],[[MODEL,/^/,"SmartTV"],[VENDOR,SAMSUNG],[TYPE,SMARTTV]],[/(vizio)(?: |.+model\/)(\w+-\w+)/i,/tcast.+(lg)e?. ([-\w]+)/i],[VENDOR,MODEL,[TYPE,SMARTTV]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[VENDOR,LG],[TYPE,SMARTTV]],[/(apple) ?tv/i],[VENDOR,[MODEL,APPLE+" TV"],[TYPE,SMARTTV]],[/crkey.*devicetype\/chromecast/i],[[MODEL,CHROMECAST+" Third Generation"],[VENDOR,GOOGLE],[TYPE,SMARTTV]],[/crkey.*devicetype\/([^/]*)/i],[[MODEL,/^/,"Chromecast "],[VENDOR,GOOGLE],[TYPE,SMARTTV]],[/fuchsia.*crkey/i],[[MODEL,CHROMECAST+" Nest Hub"],[VENDOR,GOOGLE],[TYPE,SMARTTV]],[/crkey/i],[[MODEL,CHROMECAST],[VENDOR,GOOGLE],[TYPE,SMARTTV]],[/(portaltv)/i],[MODEL,[VENDOR,FACEBOOK],[TYPE,SMARTTV]],[/droid.+aft(\w+)( bui|\))/i],[MODEL,[VENDOR,AMAZON],[TYPE,SMARTTV]],[/(shield \w+ tv)/i],[MODEL,[VENDOR,NVIDIA],[TYPE,SMARTTV]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[MODEL,[VENDOR,SHARP],[TYPE,SMARTTV]],[/(bravia[\w ]+)( bui|\))/i],[MODEL,[VENDOR,SONY],[TYPE,SMARTTV]],[/(mi(tv|box)-?\w+) bui/i],[MODEL,[VENDOR,XIAOMI],[TYPE,SMARTTV]],[/Hbbtv.*(technisat) (.*);/i],[VENDOR,MODEL,[TYPE,SMARTTV]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[VENDOR,/.+\/(\w+)/,"$1",strMapper,{LG:"lge"}],[MODEL,trim],[TYPE,SMARTTV]],[/(playstation \w+)/i],[MODEL,[VENDOR,SONY],[TYPE,CONSOLE]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[MODEL,[VENDOR,MICROSOFT],[TYPE,CONSOLE]],[/(ouya)/i,/(nintendo) (\w+)/i,/(retroid) (pocket ([^\)]+))/i,/(valve).+(steam deck)/i,/droid.+; ((shield|rgcube|gr0006))( bui|\))/i],[[VENDOR,strMapper,{Nvidia:"Shield",Anbernic:"RGCUBE",Logitech:"GR0006"}],MODEL,[TYPE,CONSOLE]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[MODEL,[VENDOR,SAMSUNG],[TYPE,WEARABLE]],[/((pebble))app/i,/(asus|google|lg|oppo|xiaomi) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[VENDOR,MODEL,[TYPE,WEARABLE]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[MODEL,[VENDOR,OPPO],[TYPE,WEARABLE]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[MODEL,[VENDOR,APPLE],[TYPE,WEARABLE]],[/(opwwe\d{3})/i],[MODEL,[VENDOR,ONEPLUS],[TYPE,WEARABLE]],[/(moto 360)/i],[MODEL,[VENDOR,MOTOROLA],[TYPE,WEARABLE]],[/(smartwatch 3)/i],[MODEL,[VENDOR,SONY],[TYPE,WEARABLE]],[/(g watch r)/i],[MODEL,[VENDOR,LG],[TYPE,WEARABLE]],[/droid.+; (wt63?0{2,3})\)/i],[MODEL,[VENDOR,ZEBRA],[TYPE,WEARABLE]],[/droid.+; (glass) \d/i],[MODEL,[VENDOR,GOOGLE],[TYPE,XR]],[/(pico) ([\w ]+) os\d/i],[VENDOR,MODEL,[TYPE,XR]],[/(quest( \d| pro)?s?).+vr/i],[MODEL,[VENDOR,FACEBOOK],[TYPE,XR]],[/mobile vr; rv.+firefox/i],[[TYPE,XR]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[VENDOR,[TYPE,EMBEDDED]],[/(aeobc)\b/i],[MODEL,[VENDOR,AMAZON],[TYPE,EMBEDDED]],[/(homepod).+mac os/i],[MODEL,[VENDOR,APPLE],[TYPE,EMBEDDED]],[/windows iot/i],[[TYPE,EMBEDDED]],[/droid.+; ([\w- ]+) (4k|android|smart|google)[- ]?tv/i],[MODEL,[TYPE,SMARTTV]],[/\b((4k|android|smart|opera)[- ]?tv|tv; rv:|large screen[\w ]+safari)\b/i],[[TYPE,SMARTTV]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew|; hmsc).+?(mobile|vr|\d) safari/i],[MODEL,[TYPE,strMapper,{mobile:"Mobile",xr:"VR","*":TABLET}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[TYPE,TABLET]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[TYPE,MOBILE]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[MODEL,[VENDOR,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[VERSION,[NAME,EDGE+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[NAME,VERSION],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[VERSION,[NAME,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[NAME,VERSION],[/ladybird\//i],[[NAME,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[VERSION,NAME]],os:[[/(windows nt) (6\.[23]); arm/i],[[NAME,/N/,"R"],[VERSION,strMapper,windowsVersionMap]],[/(windows (?:phone|mobile|iot))(?: os)?[\/ ]?([\d\.]*( se)?)/i,/(windows)[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i],[NAME,VERSION],[/windows nt ?([\d\.\)]*)(?!.+xbox)/i,/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d\.;]*)/i],[[VERSION,/(;|\))/g,"",strMapper,windowsVersionMap],[NAME,WINDOWS]],[/(windows ce)\/?([\d\.]*)/i],[NAME,VERSION],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv|ios(?=.+ip(?:ad|hone)|.+apple ?tv)|ip(?:ad|hone)(?: |.+i(?:pad)?)os|apple ?tv.+ios)[\/ ]([\w\.]+)/i,/\btvos ?([\w\.]+)/i,/cfnetwork\/.+darwin/i],[[VERSION,/_/g,"."],[NAME,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i],[[NAME,"macOS"],[VERSION,/_/g,"."]],[/android ([\d\.]+).*crkey/i],[VERSION,[NAME,CHROMECAST+" Android"]],[/fuchsia.*crkey\/([\d\.]+)/i],[VERSION,[NAME,CHROMECAST+" Fuchsia"]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[VERSION,[NAME,CHROMECAST+" SmartSpeaker"]],[/linux.*crkey\/([\d\.]+)/i],[VERSION,[NAME,CHROMECAST+" Linux"]],[/crkey\/([\d\.]+)/i],[VERSION,[NAME,CHROMECAST]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[VERSION,NAME],[/(ubuntu) ([\w\.]+) like android/i],[[NAME,/(.+)/,"$1 Touch"],VERSION],[/(harmonyos)[\/ ]?([\d\.]*)/i,/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen)\w*[-\/\.; ]?([\d\.]*)/i],[NAME,VERSION],[/\(bb(10);/i],[VERSION,[NAME,BLACKBERRY]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[VERSION,[NAME,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[VERSION,[NAME,FIREFOX+" OS"]],[/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i,/webos(?:[ \/]?|\.tv-20(?=2[2-9]))(\d[\d\.]*)/i],[VERSION,[NAME,"webOS"]],[/web0s;.+?(?:chr[o0]me|safari)\/(\d+)/i],[[VERSION,strMapper,{25:"120",24:"108",23:"94",22:"87",6:"79",5:"68",4:"53",3:"38",2:"538",1:"537","*":"TV"}],[NAME,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[VERSION,[NAME,"watchOS"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[NAME,"Chrome OS"],VERSION],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/linux.+(mint)[\/\(\) ]?([\w\.]*)/i,/(mageia|vectorlinux|fuchsia|arcaos|arch(?= ?linux))[;l ]([\d\.]*)/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire|knoppix)(?: gnu[\/ ]linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/\b(aix)[; ]([1-9\.]{0,4})/i,/(hurd|linux|morphos)(?: (?:arm|x86|ppc)\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) ?(r\d)?/i],[NAME,VERSION],[/(sunos) ?([\d\.]*)/i],[[NAME,"Solaris"],VERSION],[/\b(beos|os\/2|amigaos|openvms|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[NAME,VERSION]]},defaultProps=(function(){var r={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return setProps.call(r.init,[[BROWSER,[NAME,VERSION,MAJOR,TYPE]],[CPU,[ARCHITECTURE]],[DEVICE,[TYPE,MODEL,VENDOR]],[ENGINE,[NAME,VERSION]],[OS,[NAME,VERSION]]]),setProps.call(r.isIgnore,[[BROWSER,[VERSION,MAJOR]],[ENGINE,[VERSION]],[OS,[VERSION]]]),setProps.call(r.isIgnoreRgx,[[BROWSER,/ ?browser$/i],[OS,/ ?os$/i]]),setProps.call(r.toString,[[BROWSER,[NAME,VERSION]],[CPU,[ARCHITECTURE]],[DEVICE,[VENDOR,MODEL]],[ENGINE,[NAME,VERSION]],[OS,[NAME,VERSION]]]),r})(),createIData=function(r,e){var t=defaultProps.init[e],i=defaultProps.isIgnore[e]||0,s=defaultProps.isIgnoreRgx[e]||0,n=defaultProps.toString[e]||0;function a(){setProps.call(this,t)}return a.prototype.getItem=function(){return r},a.prototype.withClientHints=function(){return NAVIGATOR_UADATA?NAVIGATOR_UADATA.getHighEntropyValues(CH_ALL_VALUES).then(function(o){return r.setCH(new UACHData(o,!1)).parseCH().get()}):r.parseCH().get()},a.prototype.withFeatureCheck=function(){return r.detectFeature().get()},e!=RESULT&&(a.prototype.is=function(o){var c=!1;for(var u in this)if(this.hasOwnProperty(u)&&!has(i,u)&&lowerize(s?strip(s,this[u]):this[u])==lowerize(s?strip(s,o):o)){if(c=!0,o!=TYPEOF.UNDEFINED)break}else if(o==TYPEOF.UNDEFINED&&c){c=!c;break}return c},a.prototype.toString=function(){var o=EMPTY;for(var c in n)typeof this[n[c]]!==TYPEOF.UNDEFINED&&(o+=(o?" ":EMPTY)+this[n[c]]);return o||TYPEOF.UNDEFINED}),a.prototype.then=function(o){var c=this,u=function(){for(var d in c)c.hasOwnProperty(d)&&(this[d]=c[d])};u.prototype={is:a.prototype.is,toString:a.prototype.toString,withClientHints:a.prototype.withClientHints,withFeatureCheck:a.prototype.withFeatureCheck};var f=new u;return o(f),f},new a};function UACHData(r,e){if(r=r||{},setProps.call(this,CH_ALL_VALUES),e)setProps.call(this,[[BRANDS,itemListToArray(r[CH])],[FULLVERLIST,itemListToArray(r[CH_FULL_VER_LIST])],[MOBILE,/\?1/.test(r[CH_MOBILE])],[MODEL,stripQuotes(r[CH_MODEL])],[PLATFORM,stripQuotes(r[CH_PLATFORM])],[PLATFORMVER,stripQuotes(r[CH_PLATFORM_VER])],[ARCHITECTURE,stripQuotes(r[CH_ARCH])],[FORMFACTORS,itemListToArray(r[CH_FORM_FACTORS])],[BITNESS,stripQuotes(r[CH_BITNESS])]]);else for(var t in r)this.hasOwnProperty(t)&&typeof r[t]!==TYPEOF.UNDEFINED&&(this[t]=r[t])}function UAItem(r,e,t,i){return setProps.call(this,[["itemType",r],["ua",e],["uaCH",i],["rgxMap",t],["data",createIData(this,r)]]),this}UAItem.prototype.get=function(r){return r?this.data.hasOwnProperty(r)?this.data[r]:void 0:this.data},UAItem.prototype.set=function(r,e){return this.data[r]=e,this},UAItem.prototype.setCH=function(r){return this.uaCH=r,this},UAItem.prototype.detectFeature=function(){if(NAVIGATOR&&NAVIGATOR.userAgent==this.ua)switch(this.itemType){case BROWSER:NAVIGATOR.brave&&typeof NAVIGATOR.brave.isBrave==TYPEOF.FUNCTION&&this.set(NAME,"Brave");break;case DEVICE:!this.get(TYPE)&&NAVIGATOR_UADATA&&NAVIGATOR_UADATA[MOBILE]&&this.set(TYPE,MOBILE),this.get(MODEL)=="Macintosh"&&NAVIGATOR&&typeof NAVIGATOR.standalone!==TYPEOF.UNDEFINED&&NAVIGATOR.maxTouchPoints&&NAVIGATOR.maxTouchPoints>2&&this.set(MODEL,"iPad").set(TYPE,TABLET);break;case OS:!this.get(NAME)&&NAVIGATOR_UADATA&&NAVIGATOR_UADATA[PLATFORM]&&this.set(NAME,NAVIGATOR_UADATA[PLATFORM]);break;case RESULT:var r=this.data,e=function(t){return r[t].getItem().detectFeature().get()};this.set(BROWSER,e(BROWSER)).set(CPU,e(CPU)).set(DEVICE,e(DEVICE)).set(ENGINE,e(ENGINE)).set(OS,e(OS))}return this},UAItem.prototype.parseUA=function(){switch(this.itemType!=RESULT&&rgxMapper.call(this.data,this.ua,this.rgxMap),this.itemType){case BROWSER:this.set(MAJOR,majorize(this.get(VERSION)));break;case OS:if(this.get(NAME)=="iOS"&&this.get(VERSION)=="18.6"){var r=/\) Version\/([\d\.]+)/.exec(this.ua);r&&parseInt(r[1].substring(0,2),10)>=26&&this.set(VERSION,r[1])}break}return this},UAItem.prototype.parseCH=function(){var r=this.uaCH,e=this.rgxMap;switch(this.itemType){case BROWSER:case ENGINE:var t=r[FULLVERLIST]||r[BRANDS],i;if(t)for(var s=0;s<t.length;s++){var n=t[s].brand||t[s],a=t[s].version;this.itemType==BROWSER&&!/not.a.brand/i.test(n)&&(!i||/Chrom/.test(i)&&n!=CHROMIUM||i==EDGE&&/WebView2/.test(n))&&(n=strMapper(n,browserHintsMap),i=this.get(NAME),i&&!/Chrom/.test(i)&&/Chrom/.test(n)||this.set(NAME,n).set(VERSION,a).set(MAJOR,majorize(a)),i=n),this.itemType==ENGINE&&n==CHROMIUM&&this.set(VERSION,a)}break;case CPU:var o=r[ARCHITECTURE];o&&(o&&r[BITNESS]=="64"&&(o+="64"),rgxMapper.call(this.data,o+";",e));break;case DEVICE:if(r[MOBILE]&&this.set(TYPE,MOBILE),r[MODEL]&&(this.set(MODEL,r[MODEL]),!this.get(TYPE)||!this.get(VENDOR))){var c={};rgxMapper.call(c,"droid 9; "+r[MODEL]+")",e),!this.get(TYPE)&&c.type&&this.set(TYPE,c.type),!this.get(VENDOR)&&c.vendor&&this.set(VENDOR,c.vendor)}if(r[FORMFACTORS]){var u;if(typeof r[FORMFACTORS]!="string")for(var f=0;!u&&f<r[FORMFACTORS].length;)u=strMapper(r[FORMFACTORS][f++],formFactorsMap);else u=strMapper(r[FORMFACTORS],formFactorsMap);this.set(TYPE,u)}break;case OS:var d=r[PLATFORM];if(d){var g=r[PLATFORMVER];d==WINDOWS&&(g=parseInt(majorize(g),10)>=13?"11":"10"),this.set(NAME,d).set(VERSION,g)}this.get(NAME)==WINDOWS&&r[MODEL]=="Xbox"&&this.set(NAME,"Xbox").set(VERSION,void 0);break;case RESULT:var E=this.data,m=function(T){return E[T].getItem().setCH(r).parseCH().get()};this.set(BROWSER,m(BROWSER)).set(CPU,m(CPU)).set(DEVICE,m(DEVICE)).set(ENGINE,m(ENGINE)).set(OS,m(OS))}return this};function UAParser(r,e,t){if(typeof r===TYPEOF.OBJECT?(isExtensions(r,!0)?(typeof e===TYPEOF.OBJECT&&(t=e),e=r):(t=r,e=void 0),r=void 0):typeof r===TYPEOF.STRING&&!isExtensions(e,!0)&&(t=e,e=void 0),t)if(typeof t.append===TYPEOF.FUNCTION){var i={};t.forEach(function(f,d){i[String(d).toLowerCase()]=f}),t=i}else{var s={};for(var n in t)t.hasOwnProperty(n)&&(s[String(n).toLowerCase()]=t[n]);t=s}if(!(this instanceof UAParser))return new UAParser(r,e,t).getResult();var a=typeof r===TYPEOF.STRING?r:t&&t[USER_AGENT]?t[USER_AGENT]:NAVIGATOR&&NAVIGATOR.userAgent?NAVIGATOR.userAgent:EMPTY,o=new UACHData(t,!0),c=e?extend(defaultRegexes,e):defaultRegexes,u=function(f){return f==RESULT?function(){return new UAItem(f,a,c,o).set("ua",a).set(BROWSER,this.getBrowser()).set(CPU,this.getCPU()).set(DEVICE,this.getDevice()).set(ENGINE,this.getEngine()).set(OS,this.getOS()).get()}:function(){return new UAItem(f,a,c[f],o).parseUA().get()}};return setProps.call(this,[["getBrowser",u(BROWSER)],["getCPU",u(CPU)],["getDevice",u(DEVICE)],["getEngine",u(ENGINE)],["getOS",u(OS)],["getResult",u(RESULT)],["getUA",function(){return a}],["setUA",function(f){return isString(f)&&(a=trim(f,UA_MAX_LENGTH)),this}]]).setUA(a),this}UAParser.VERSION=LIBVERSION,UAParser.BROWSER=enumerize([NAME,VERSION,MAJOR,TYPE]),UAParser.CPU=enumerize([ARCHITECTURE]),UAParser.DEVICE=enumerize([MODEL,VENDOR,TYPE,CONSOLE,MOBILE,SMARTTV,TABLET,WEARABLE,EMBEDDED]),UAParser.ENGINE=UAParser.OS=enumerize([NAME,VERSION]);function useUserAgent(){const r=new UAParser().getResult().os.name,e=new UAParser().getResult().browser.name,t=new UAParser().getResult().device.type;return{os:{name:r},browser:{name:e},device:{type:t}}}const isFiniteNumber=Number.isFinite||function(r){return typeof r=="number"&&isFinite(r)},isSafeInteger=Number.isSafeInteger||function(r){return typeof r=="number"&&Math.abs(r)<=MAX_SAFE_INTEGER},MAX_SAFE_INTEGER=Number.MAX_SAFE_INTEGER||9007199254740991;let ErrorTypes=(function(r){return r.NETWORK_ERROR="networkError",r.MEDIA_ERROR="mediaError",r.KEY_SYSTEM_ERROR="keySystemError",r.MUX_ERROR="muxError",r.OTHER_ERROR="otherError",r})({}),ErrorDetails=(function(r){return r.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",r.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",r.KEY_SYSTEM_NO_SESSION="keySystemNoSession",r.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",r.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",r.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",r.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",r.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",r.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",r.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",r.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR="keySystemDestroyMediaKeysError",r.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR="keySystemDestroyCloseSessionError",r.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR="keySystemDestroyRemoveSessionError",r.MANIFEST_LOAD_ERROR="manifestLoadError",r.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",r.MANIFEST_PARSING_ERROR="manifestParsingError",r.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",r.LEVEL_EMPTY_ERROR="levelEmptyError",r.LEVEL_LOAD_ERROR="levelLoadError",r.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",r.LEVEL_PARSING_ERROR="levelParsingError",r.LEVEL_SWITCH_ERROR="levelSwitchError",r.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",r.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",r.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",r.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",r.FRAG_LOAD_ERROR="fragLoadError",r.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",r.FRAG_DECRYPT_ERROR="fragDecryptError",r.FRAG_PARSING_ERROR="fragParsingError",r.FRAG_GAP="fragGap",r.REMUX_ALLOC_ERROR="remuxAllocError",r.KEY_LOAD_ERROR="keyLoadError",r.KEY_LOAD_TIMEOUT="keyLoadTimeOut",r.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",r.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",r.BUFFER_APPEND_ERROR="bufferAppendError",r.BUFFER_APPENDING_ERROR="bufferAppendingError",r.BUFFER_STALLED_ERROR="bufferStalledError",r.BUFFER_FULL_ERROR="bufferFullError",r.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",r.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",r.ASSET_LIST_LOAD_ERROR="assetListLoadError",r.ASSET_LIST_LOAD_TIMEOUT="assetListLoadTimeout",r.ASSET_LIST_PARSING_ERROR="assetListParsingError",r.INTERSTITIAL_ASSET_ITEM_ERROR="interstitialAssetItemError",r.INTERNAL_EXCEPTION="internalException",r.INTERNAL_ABORTED="aborted",r.ATTACH_MEDIA_ERROR="attachMediaError",r.UNKNOWN="unknown",r})({}),Events=(function(r){return r.MEDIA_ATTACHING="hlsMediaAttaching",r.MEDIA_ATTACHED="hlsMediaAttached",r.MEDIA_DETACHING="hlsMediaDetaching",r.MEDIA_DETACHED="hlsMediaDetached",r.MEDIA_ENDED="hlsMediaEnded",r.STALL_RESOLVED="hlsStallResolved",r.BUFFER_RESET="hlsBufferReset",r.BUFFER_CODECS="hlsBufferCodecs",r.BUFFER_CREATED="hlsBufferCreated",r.BUFFER_APPENDING="hlsBufferAppending",r.BUFFER_APPENDED="hlsBufferAppended",r.BUFFER_EOS="hlsBufferEos",r.BUFFERED_TO_END="hlsBufferedToEnd",r.BUFFER_FLUSHING="hlsBufferFlushing",r.BUFFER_FLUSHED="hlsBufferFlushed",r.MANIFEST_LOADING="hlsManifestLoading",r.MANIFEST_LOADED="hlsManifestLoaded",r.MANIFEST_PARSED="hlsManifestParsed",r.LEVEL_SWITCHING="hlsLevelSwitching",r.LEVEL_SWITCHED="hlsLevelSwitched",r.LEVEL_LOADING="hlsLevelLoading",r.LEVEL_LOADED="hlsLevelLoaded",r.LEVEL_UPDATED="hlsLevelUpdated",r.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",r.LEVELS_UPDATED="hlsLevelsUpdated",r.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",r.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",r.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",r.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",r.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",r.AUDIO_TRACK_UPDATED="hlsAudioTrackUpdated",r.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",r.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",r.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",r.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",r.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",r.SUBTITLE_TRACK_UPDATED="hlsSubtitleTrackUpdated",r.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",r.CUES_PARSED="hlsCuesParsed",r.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",r.INIT_PTS_FOUND="hlsInitPtsFound",r.FRAG_LOADING="hlsFragLoading",r.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",r.FRAG_LOADED="hlsFragLoaded",r.FRAG_DECRYPTED="hlsFragDecrypted",r.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",r.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",r.FRAG_PARSING_METADATA="hlsFragParsingMetadata",r.FRAG_PARSED="hlsFragParsed",r.FRAG_BUFFERED="hlsFragBuffered",r.FRAG_CHANGED="hlsFragChanged",r.FPS_DROP="hlsFpsDrop",r.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",r.MAX_AUTO_LEVEL_UPDATED="hlsMaxAutoLevelUpdated",r.ERROR="hlsError",r.DESTROYING="hlsDestroying",r.KEY_LOADING="hlsKeyLoading",r.KEY_LOADED="hlsKeyLoaded",r.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",r.BACK_BUFFER_REACHED="hlsBackBufferReached",r.STEERING_MANIFEST_LOADED="hlsSteeringManifestLoaded",r.ASSET_LIST_LOADING="hlsAssetListLoading",r.ASSET_LIST_LOADED="hlsAssetListLoaded",r.INTERSTITIALS_UPDATED="hlsInterstitialsUpdated",r.INTERSTITIALS_BUFFERED_TO_BOUNDARY="hlsInterstitialsBufferedToBoundary",r.INTERSTITIAL_ASSET_PLAYER_CREATED="hlsInterstitialAssetPlayerCreated",r.INTERSTITIAL_STARTED="hlsInterstitialStarted",r.INTERSTITIAL_ASSET_STARTED="hlsInterstitialAssetStarted",r.INTERSTITIAL_ASSET_ENDED="hlsInterstitialAssetEnded",r.INTERSTITIAL_ASSET_ERROR="hlsInterstitialAssetError",r.INTERSTITIAL_ENDED="hlsInterstitialEnded",r.INTERSTITIALS_PRIMARY_RESUMED="hlsInterstitialsPrimaryResumed",r.PLAYOUT_LIMIT_REACHED="hlsPlayoutLimitReached",r.EVENT_CUE_ENTER="hlsEventCueEnter",r})({});var PlaylistContextType={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},PlaylistLevelType={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};class EWMA{constructor(e,t=0,i=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=i}sample(e,t){const i=Math.pow(this.alpha_,e);this.estimate_=t*(1-i)+i*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class EwmaBandWidthEstimator{constructor(e,t,i,s=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=i,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new EWMA(e),this.fast_=new EWMA(t),this.defaultTTFB_=s,this.ttfb_=new EWMA(e)}update(e,t){const{slow_:i,fast_:s,ttfb_:n}=this;i.halfLife!==e&&(this.slow_=new EWMA(e,i.getEstimate(),i.getTotalWeight())),s.halfLife!==t&&(this.fast_=new EWMA(t,s.getEstimate(),s.getTotalWeight())),n.halfLife!==e&&(this.ttfb_=new EWMA(e,n.getEstimate(),n.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);const i=8*t,s=e/1e3,n=i/s;this.fast_.sample(s,n),this.slow_.sample(s,n)}sampleTTFB(e){const t=e/1e3,i=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(i,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}get defaultEstimate(){return this.defaultEstimate_}destroy(){}}function _defineProperty(r,e,t){return(e=_toPropertyKey(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function _extends(){return _extends=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(r[i]=t[i])}return r},_extends.apply(null,arguments)}function ownKeys(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(r,s).enumerable})),t.push.apply(t,i)}return t}function _objectSpread2(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ownKeys(Object(t),!0).forEach(function(i){_defineProperty(r,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}return r}function _toPrimitive(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function _toPropertyKey(r){var e=_toPrimitive(r,"string");return typeof e=="symbol"?e:e+""}class Logger{constructor(e,t){this.trace=void 0,this.debug=void 0,this.log=void 0,this.warn=void 0,this.info=void 0,this.error=void 0;const i=`[${e}]:`;this.trace=noop,this.debug=t.debug.bind(null,i),this.log=t.log.bind(null,i),this.warn=t.warn.bind(null,i),this.info=t.info.bind(null,i),this.error=t.error.bind(null,i)}}const noop=function r(){},fakeLogger={trace:noop,debug:noop,log:noop,warn:noop,info:noop,error:noop};function createLogger(){return _extends({},fakeLogger)}function consolePrintFn(r,e){const t=self.console[r];return t?t.bind(self.console,`${e?"["+e+"] ":""}[${r}] >`):noop}function getLoggerFn(r,e,t){return e[r]?e[r].bind(e):consolePrintFn(r,t)}const exportedLogger=createLogger();function enableLogs(r,e,t){const i=createLogger();if(typeof console=="object"&&r===!0||typeof r=="object"){const s=["debug","log","info","warn","error"];s.forEach(n=>{i[n]=getLoggerFn(n,r,t)});try{i.log(`Debug logs enabled for "${e}" in hls.js version 1.6.15`)}catch{return createLogger()}s.forEach(n=>{exportedLogger[n]=getLoggerFn(n,r)})}else _extends(exportedLogger,i);return i}const logger=exportedLogger;function getMediaSource(r=!0){return typeof self>"u"?void 0:(r||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function isManagedMediaSource(r){return typeof self<"u"&&r===self.ManagedMediaSource}function isCompatibleTrackChange(r,e){const t=Object.keys(r),i=Object.keys(e),s=t.length,n=i.length;return!s||!n||s===n&&!t.some(a=>i.indexOf(a)===-1)}function utf8ArrayToStr(r,e=!1){if(typeof TextDecoder<"u"){const u=new TextDecoder("utf-8").decode(r);if(e){const f=u.indexOf("\0");return f!==-1?u.substring(0,f):u}return u.replace(/\0/g,"")}const t=r.length;let i,s,n,a="",o=0;for(;o<t;){if(i=r[o++],i===0&&e)return a;if(i===0||i===3)continue;switch(i>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:a+=String.fromCharCode(i);break;case 12:case 13:s=r[o++],a+=String.fromCharCode((i&31)<<6|s&63);break;case 14:s=r[o++],n=r[o++],a+=String.fromCharCode((i&15)<<12|(s&63)<<6|(n&63)<<0);break}}return a}function arrayToHex(r){let e="";for(let t=0;t<r.length;t++){let i=r[t].toString(16);i.length<2&&(i="0"+i),e+=i}return e}function hexToArrayBuffer(r){return Uint8Array.from(r.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}function getDefaultExportFromCjs(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var urlToolkit={exports:{}},hasRequiredUrlToolkit;function requireUrlToolkit(){return hasRequiredUrlToolkit||(hasRequiredUrlToolkit=1,(function(r,e){(function(t){var i=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,s=/^(?=([^\/?#]*))\1([^]*)$/,n=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(c,u,f){if(f=f||{},c=c.trim(),u=u.trim(),!u){if(!f.alwaysNormalize)return c;var d=o.parseURL(c);if(!d)throw new Error("Error trying to parse base URL.");return d.path=o.normalizePath(d.path),o.buildURLFromParts(d)}var g=o.parseURL(u);if(!g)throw new Error("Error trying to parse relative URL.");if(g.scheme)return f.alwaysNormalize?(g.path=o.normalizePath(g.path),o.buildURLFromParts(g)):u;var E=o.parseURL(c);if(!E)throw new Error("Error trying to parse base URL.");if(!E.netLoc&&E.path&&E.path[0]!=="/"){var m=s.exec(E.path);E.netLoc=m[1],E.path=m[2]}E.netLoc&&!E.path&&(E.path="/");var T={scheme:E.scheme,netLoc:g.netLoc,path:null,params:g.params,query:g.query,fragment:g.fragment};if(!g.netLoc&&(T.netLoc=E.netLoc,g.path[0]!=="/"))if(!g.path)T.path=E.path,g.params||(T.params=E.params,g.query||(T.query=E.query));else{var S=E.path,b=S.substring(0,S.lastIndexOf("/")+1)+g.path;T.path=o.normalizePath(b)}return T.path===null&&(T.path=f.alwaysNormalize?o.normalizePath(g.path):g.path),o.buildURLFromParts(T)},parseURL:function(c){var u=i.exec(c);return u?{scheme:u[1]||"",netLoc:u[2]||"",path:u[3]||"",params:u[4]||"",query:u[5]||"",fragment:u[6]||""}:null},normalizePath:function(c){for(c=c.split("").reverse().join("").replace(n,"");c.length!==(c=c.replace(a,"")).length;);return c.split("").reverse().join("")},buildURLFromParts:function(c){return c.scheme+c.netLoc+c.path+c.params+c.query+c.fragment}};r.exports=o})()})(urlToolkit)),urlToolkit.exports}var urlToolkitExports=requireUrlToolkit();class LoadStats{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var ElementaryStreamTypes={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class BaseSegment{constructor(e){this._byteRange=null,this._url=null,this._stats=null,this._streams=null,this.base=void 0,this.relurl=void 0,typeof e=="string"&&(e={url:e}),this.base=e,makeEnumerable(this,"stats")}setByteRange(e,t){const i=e.split("@",2);let s;i.length===1?s=t?.byteRangeEndOffset||0:s=parseInt(i[1]),this._byteRange=[s,parseInt(i[0])+s]}get baseurl(){return this.base.url}get byteRange(){return this._byteRange===null?[]:this._byteRange}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get elementaryStreams(){return this._streams===null&&(this._streams={[ElementaryStreamTypes.AUDIO]:null,[ElementaryStreamTypes.VIDEO]:null,[ElementaryStreamTypes.AUDIOVIDEO]:null}),this._streams}set elementaryStreams(e){this._streams=e}get hasStats(){return this._stats!==null}get hasStreams(){return this._streams!==null}get stats(){return this._stats===null&&(this._stats=new LoadStats),this._stats}set stats(e){this._stats=e}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=urlToolkitExports.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[ElementaryStreamTypes.AUDIO]=null,e[ElementaryStreamTypes.VIDEO]=null,e[ElementaryStreamTypes.AUDIOVIDEO]=null}}function isMediaFragment(r){return r.sn!=="initSegment"}class Fragment extends BaseSegment{constructor(e,t){super(t),this._decryptdata=null,this._programDateTime=null,this._ref=null,this._bitrate=void 0,this.rawProgramDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.playlistOffset=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=e}get byteLength(){if(this.hasStats){const e=this.stats.total;if(e)return e}if(this.byteRange.length){const e=this.byteRange[0],t=this.byteRange[1];if(isFiniteNumber(e)&&isFiniteNumber(t))return t-e}return null}get bitrate(){return this.byteLength?this.byteLength*8/this.duration:this._bitrate?this._bitrate:null}set bitrate(e){this._bitrate=e}get decryptdata(){var e;const{levelkeys:t}=this;if(!t||t.NONE)return null;if(t.identity)this._decryptdata||(this._decryptdata=t.identity.getDecryptData(this.sn));else if(!((e=this._decryptdata)!=null&&e.keyId)){const i=Object.keys(t);if(i.length===1){const s=this._decryptdata=t[i[0]]||null;s&&(this._decryptdata=s.getDecryptData(this.sn,t))}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null)return null;const e=isFiniteNumber(this.duration)?this.duration:0;return this.programDateTime+e*1e3}get encrypted(){var e;if((e=this._decryptdata)!=null&&e.encrypted)return!0;if(this.levelkeys){var t;const i=Object.keys(this.levelkeys),s=i.length;if(s>1||s===1&&(t=this.levelkeys[i[0]])!=null&&t.encrypted)return!0}return!1}get programDateTime(){return this._programDateTime===null&&this.rawProgramDateTime&&(this.programDateTime=Date.parse(this.rawProgramDateTime)),this._programDateTime}set programDateTime(e){if(!isFiniteNumber(e)){this._programDateTime=this.rawProgramDateTime=null;return}this._programDateTime=e}get ref(){return isMediaFragment(this)?(this._ref||(this._ref={base:this.base,start:this.start,duration:this.duration,sn:this.sn,programDateTime:this.programDateTime}),this._ref):null}addStart(e){this.setStart(this.start+e)}setStart(e){this.start=e,this._ref&&(this._ref.start=e)}setDuration(e){this.duration=e,this._ref&&(this._ref.duration=e)}setKeyFormat(e){const t=this.levelkeys;if(t){var i;const s=t[e];s&&!((i=this._decryptdata)!=null&&i.keyId)&&(this._decryptdata=s.getDecryptData(this.sn,t))}}abortRequests(){var e,t;(e=this.loader)==null||e.abort(),(t=this.keyLoader)==null||t.abort()}setElementaryStreamInfo(e,t,i,s,n,a=!1){const{elementaryStreams:o}=this,c=o[e];if(!c){o[e]={startPTS:t,endPTS:i,startDTS:s,endDTS:n,partial:a};return}c.startPTS=Math.min(c.startPTS,t),c.endPTS=Math.max(c.endPTS,i),c.startDTS=Math.min(c.startDTS,s),c.endDTS=Math.max(c.endDTS,n)}}class Part extends BaseSegment{constructor(e,t,i,s,n){super(i),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=s;const a=e.enumeratedString("BYTERANGE");a&&this.setByteRange(a,n),n&&(this.fragOffset=n.fragOffset+n.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}function getOwnPropertyDescriptorFromPrototypeChain(r,e){const t=Object.getPrototypeOf(r);if(t){const i=Object.getOwnPropertyDescriptor(t,e);return i||getOwnPropertyDescriptorFromPrototypeChain(t,e)}}function makeEnumerable(r,e){const t=getOwnPropertyDescriptorFromPrototypeChain(r,e);t&&(t.enumerable=!0,Object.defineProperty(r,e,t))}const UINT32_MAX$1=Math.pow(2,32)-1,push=[].push,RemuxerTrackIdConfig={video:1,audio:2,id3:3,text:4};function bin2str(r){return String.fromCharCode.apply(null,r)}function readUint16(r,e){const t=r[e]<<8|r[e+1];return t<0?65536+t:t}function readUint32(r,e){const t=readSint32(r,e);return t<0?4294967296+t:t}function readUint64(r,e){let t=readUint32(r,e);return t*=Math.pow(2,32),t+=readUint32(r,e+4),t}function readSint32(r,e){return r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3]}function hasMoofData(r){const e=r.byteLength;for(let t=0;t<e;){const i=readUint32(r,t);if(i>8&&r[t+4]===109&&r[t+5]===111&&r[t+6]===111&&r[t+7]===102)return!0;t=i>1?t+i:e}return!1}function findBox(r,e){const t=[];if(!e.length)return t;const i=r.byteLength;for(let s=0;s<i;){const n=readUint32(r,s),a=bin2str(r.subarray(s+4,s+8)),o=n>1?s+n:i;if(a===e[0])if(e.length===1)t.push(r.subarray(s+8,o));else{const c=findBox(r.subarray(s+8,o),e.slice(1));c.length&&push.apply(t,c)}s=o}return t}function parseSegmentIndex(r){const e=[],t=r[0];let i=8;const s=readUint32(r,i);i+=4;let n=0,a=0;t===0?(n=readUint32(r,i),a=readUint32(r,i+4),i+=8):(n=readUint64(r,i),a=readUint64(r,i+8),i+=16),i+=2;let o=r.length+a;const c=readUint16(r,i);i+=2;for(let u=0;u<c;u++){let f=i;const d=readUint32(r,f);f+=4;const g=d&2147483647;if((d&2147483648)>>>31===1)return logger.warn("SIDX has hierarchical references (not supported)"),null;const m=readUint32(r,f);f+=4,e.push({referenceSize:g,subsegmentDuration:m,info:{duration:m/s,start:o,end:o+g-1}}),o+=g,f+=4,i=f}return{earliestPresentationTime:n,timescale:s,version:t,referencesCount:c,references:e}}function parseInitSegment(r){const e=[],t=findBox(r,["moov","trak"]);for(let s=0;s<t.length;s++){const n=t[s],a=findBox(n,["tkhd"])[0];if(a){let o=a[0];const c=readUint32(a,o===0?12:20),u=findBox(n,["mdia","mdhd"])[0];if(u){o=u[0];const f=readUint32(u,o===0?12:20),d=findBox(n,["mdia","hdlr"])[0];if(d){const g=bin2str(d.subarray(8,12)),E={soun:ElementaryStreamTypes.AUDIO,vide:ElementaryStreamTypes.VIDEO}[g],m=findBox(n,["mdia","minf","stbl","stsd"])[0],T=parseStsd(m);E?(e[c]={timescale:f,type:E,stsd:T},e[E]=_objectSpread2({timescale:f,id:c},T)):e[c]={timescale:f,type:g,stsd:T}}}}}return findBox(r,["moov","mvex","trex"]).forEach(s=>{const n=readUint32(s,4),a=e[n];a&&(a.default={duration:readUint32(s,12),flags:readUint32(s,20)})}),e}function parseStsd(r){const e=r.subarray(8),t=e.subarray(86),i=bin2str(e.subarray(4,8));let s=i,n;const a=i==="enca"||i==="encv";if(a){const u=findBox(e,[i])[0].subarray(i==="enca"?28:78);findBox(u,["sinf"]).forEach(d=>{const g=findBox(d,["schm"])[0];if(g){const E=bin2str(g.subarray(4,8));if(E==="cbcs"||E==="cenc"){const m=findBox(d,["frma"])[0];m&&(s=bin2str(m))}}})}const o=s;switch(s){case"avc1":case"avc2":case"avc3":case"avc4":{const c=findBox(t,["avcC"])[0];c&&c.length>3&&(s+="."+toHex(c[1])+toHex(c[2])+toHex(c[3]),n=parseSupplementalDoViCodec(o==="avc1"?"dva1":"dvav",t));break}case"mp4a":{const c=findBox(e,[i])[0],u=findBox(c.subarray(28),["esds"])[0];if(u&&u.length>7){let f=4;if(u[f++]!==3)break;f=skipBERInteger(u,f),f+=2;const d=u[f++];if(d&128&&(f+=2),d&64&&(f+=u[f++]),u[f++]!==4)break;f=skipBERInteger(u,f);const g=u[f++];if(g===64)s+="."+toHex(g);else break;if(f+=12,u[f++]!==5)break;f=skipBERInteger(u,f);const E=u[f++];let m=(E&248)>>3;m===31&&(m+=1+((E&7)<<3)+((u[f]&224)>>5)),s+="."+m}break}case"hvc1":case"hev1":{const c=findBox(t,["hvcC"])[0];if(c&&c.length>12){const u=c[1],f=["","A","B","C"][u>>6],d=u&31,g=readUint32(c,2),E=(u&32)>>5?"H":"L",m=c[12],T=c.subarray(6,12);s+="."+f+d,s+="."+reverse32BitInt(g).toString(16).toUpperCase(),s+="."+E+m;let S="";for(let b=T.length;b--;){const C=T[b];(C||S)&&(S="."+C.toString(16).toUpperCase()+S)}s+=S}n=parseSupplementalDoViCodec(o=="hev1"?"dvhe":"dvh1",t);break}case"dvh1":case"dvhe":case"dvav":case"dva1":case"dav1":{s=parseSupplementalDoViCodec(s,t)||s;break}case"vp09":{const c=findBox(t,["vpcC"])[0];if(c&&c.length>6){const u=c[4],f=c[5],d=c[6]>>4&15;s+="."+addLeadingZero(u)+"."+addLeadingZero(f)+"."+addLeadingZero(d)}break}case"av01":{const c=findBox(t,["av1C"])[0];if(c&&c.length>2){const u=c[1]>>>5,f=c[1]&31,d=c[2]>>>7?"H":"M",g=(c[2]&64)>>6,E=(c[2]&32)>>5,m=u===2&&g?E?12:10:g?10:8,T=(c[2]&16)>>4,S=(c[2]&8)>>3,b=(c[2]&4)>>2,C=c[2]&3;s+="."+u+"."+addLeadingZero(f)+d+"."+addLeadingZero(m)+"."+T+"."+S+b+C+"."+addLeadingZero(1)+"."+addLeadingZero(1)+"."+addLeadingZero(1)+"."+0,n=parseSupplementalDoViCodec("dav1",t)}break}}return{codec:s,encrypted:a,supplemental:n}}function parseSupplementalDoViCodec(r,e){const t=findBox(e,["dvvC"]),i=t.length?t[0]:findBox(e,["dvcC"])[0];if(i){const s=i[2]>>1&127,n=i[2]<<5&32|i[3]>>3&31;return r+"."+addLeadingZero(s)+"."+addLeadingZero(n)}}function reverse32BitInt(r){let e=0;for(let t=0;t<32;t++)e|=(r>>t&1)<<31-t;return e>>>0}function skipBERInteger(r,e){const t=e+5;for(;r[e++]&128&&e<t;);return e}function toHex(r){return("0"+r.toString(16).toUpperCase()).slice(-2)}function addLeadingZero(r){return(r<10?"0":"")+r}function patchEncyptionData(r,e){if(!r||!e)return;const t=e.keyId;t&&e.isCommonEncryption&&applyToTencBoxes(r,(i,s)=>{const n=i.subarray(8,24);n.some(a=>a!==0)||(logger.log(`[eme] Patching keyId in 'enc${s?"a":"v"}>sinf>>tenc' box: ${arrayToHex(n)} -> ${arrayToHex(t)}`),i.set(t,8))})}function parseKeyIdsFromTenc(r){const e=[];return applyToTencBoxes(r,t=>e.push(t.subarray(8,24))),e}function applyToTencBoxes(r,e){findBox(r,["moov","trak"]).forEach(i=>{const s=findBox(i,["mdia","minf","stbl","stsd"])[0];if(!s)return;const n=s.subarray(8);let a=findBox(n,["enca"]);const o=a.length>0;o||(a=findBox(n,["encv"])),a.forEach(c=>{const u=o?c.subarray(28):c.subarray(78);findBox(u,["sinf"]).forEach(d=>{const g=parseSinf(d);g&&e(g,o)})})})}function parseSinf(r){const e=findBox(r,["schm"])[0];if(e){const t=bin2str(e.subarray(4,8));if(t==="cbcs"||t==="cenc"){const i=findBox(r,["schi","tenc"])[0];if(i)return i}}}function getSampleData(r,e,t){const i={},s=findBox(r,["moof","traf"]);for(let n=0;n<s.length;n++){const a=s[n],o=findBox(a,["tfhd"])[0],c=readUint32(o,4),u=e[c];if(!u)continue;i[c]||(i[c]={start:NaN,duration:0,sampleCount:0,timescale:u.timescale,type:u.type});const f=i[c],d=findBox(a,["tfdt"])[0];if(d){const I=d[0];let L=readUint32(d,4);I===1&&(L===UINT32_MAX$1?t.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"):(L*=UINT32_MAX$1+1,L+=readUint32(d,8))),isFiniteNumber(L)&&(!isFiniteNumber(f.start)||L<f.start)&&(f.start=L)}const g=u.default,E=readUint32(o,0)|g?.flags;let m=g?.duration||0;E&8&&(E&2?m=readUint32(o,12):m=readUint32(o,8));const T=findBox(a,["trun"]);let S=f.start||0,b=0,C=m;for(let I=0;I<T.length;I++){const L=T[I],k=readUint32(L,4),U=f.sampleCount;f.sampleCount+=k;const O=L[3]&1,F=L[3]&4,G=L[2]&1,x=L[2]&2,$=L[2]&4,X=L[2]&8;let Q=8,ee=k;for(O&&(Q+=4),F&&k&&(!(L[Q+1]&1)&&f.keyFrameIndex===void 0&&(f.keyFrameIndex=U),Q+=4,G?(C=readUint32(L,Q),Q+=4):C=m,x&&(Q+=4),X&&(Q+=4),S+=C,b+=C,ee--);ee--;)G?(C=readUint32(L,Q),Q+=4):C=m,x&&(Q+=4),$&&(L[Q+1]&1||f.keyFrameIndex===void 0&&(f.keyFrameIndex=f.sampleCount-(ee+1),f.keyFrameStart=S),Q+=4),X&&(Q+=4),S+=C,b+=C;!b&&m&&(b+=m*k)}f.duration+=b}if(!Object.keys(i).some(n=>i[n].duration)){let n=1/0,a=0;const o=findBox(r,["sidx"]);for(let c=0;c<o.length;c++){const u=parseSegmentIndex(o[c]);if(u!=null&&u.references){n=Math.min(n,u.earliestPresentationTime/u.timescale);const f=u.references.reduce((d,g)=>d+g.info.duration||0,0);a=Math.max(a,f+u.earliestPresentationTime/u.timescale)}}a&&isFiniteNumber(a)&&Object.keys(i).forEach(c=>{i[c].duration||(i[c].duration=a*i[c].timescale-i[c].start)})}return i}function segmentValidRange(r){const e={valid:null,remainder:null},t=findBox(r,["moof"]);if(t.length<2)return e.remainder=r,e;const i=t[t.length-1];return e.valid=r.slice(0,i.byteOffset-8),e.remainder=r.slice(i.byteOffset-8),e}function appendUint8Array(r,e){const t=new Uint8Array(r.length+e.length);return t.set(r),t.set(e,r.length),t}function parseSamples(r,e){const t=[],i=e.samples,s=e.timescale,n=e.id;let a=!1;return findBox(i,["moof"]).map(c=>{const u=c.byteOffset-8;findBox(c,["traf"]).map(d=>{const g=findBox(d,["tfdt"]).map(E=>{const m=E[0];let T=readUint32(E,4);return m===1&&(T*=Math.pow(2,32),T+=readUint32(E,8)),T/s})[0];return g!==void 0&&(r=g),findBox(d,["tfhd"]).map(E=>{const m=readUint32(E,4),T=readUint32(E,0)&16777215,S=(T&1)!==0,b=(T&2)!==0,C=(T&8)!==0;let I=0;const L=(T&16)!==0;let k=0;const U=(T&32)!==0;let O=8;m===n&&(S&&(O+=8),b&&(O+=4),C&&(I=readUint32(E,O),O+=4),L&&(k=readUint32(E,O),O+=4),U&&(O+=4),e.type==="video"&&(a=isHEVC(e.codec)),findBox(d,["trun"]).map(F=>{const G=F[0],x=readUint32(F,0)&16777215,$=(x&1)!==0;let X=0;const Q=(x&4)!==0,ee=(x&256)!==0;let te=0;const re=(x&512)!==0;let me=0;const H=(x&1024)!==0,z=(x&2048)!==0;let ie=0;const ne=readUint32(F,4);let he=8;$&&(X=readUint32(F,he),he+=4),Q&&(he+=4);let pe=X+u;for(let Pe=0;Pe<ne;Pe++){if(ee?(te=readUint32(F,he),he+=4):te=I,re?(me=readUint32(F,he),he+=4):me=k,H&&(he+=4),z&&(G===0?ie=readUint32(F,he):ie=readSint32(F,he),he+=4),e.type===ElementaryStreamTypes.VIDEO){let ae=0;for(;ae<me;){const Ae=readUint32(i,pe);if(pe+=4,isSEIMessage(a,i[pe])){const Re=i.subarray(pe,pe+Ae);parseSEIMessageFromNALu(Re,a?2:1,r+ie/s,t)}pe+=Ae,ae+=Ae+4}}r+=te/s}}))})})}),t}function isHEVC(r){if(!r)return!1;const e=r.substring(0,4);return e==="hvc1"||e==="hev1"||e==="dvh1"||e==="dvhe"}function isSEIMessage(r,e){if(r){const t=e>>1&63;return t===39||t===40}else return(e&31)===6}function parseSEIMessageFromNALu(r,e,t,i){const s=discardEPB(r);let n=0;n+=e;let a=0,o=0,c=0;for(;n<s.length;){a=0;do{if(n>=s.length)break;c=s[n++],a+=c}while(c===255);o=0;do{if(n>=s.length)break;c=s[n++],o+=c}while(c===255);const u=s.length-n;let f=n;if(o<u)n+=o;else if(o>u){logger.error(`Malformed SEI payload. ${o} is too small, only ${u} bytes left to parse.`);break}if(a===4){if(s[f++]===181){const g=readUint16(s,f);if(f+=2,g===49){const E=readUint32(s,f);if(f+=4,E===1195456820){const m=s[f++];if(m===3){const T=s[f++],S=31&T,b=64&T,C=b?2+S*3:0,I=new Uint8Array(C);if(b){I[0]=T;for(let L=1;L<C;L++)I[L]=s[f++]}i.push({type:m,payloadType:a,pts:t,bytes:I})}}}}}else if(a===5&&o>16){const d=[];for(let m=0;m<16;m++){const T=s[f++].toString(16);d.push(T.length==1?"0"+T:T),(m===3||m===5||m===7||m===9)&&d.push("-")}const g=o-16,E=new Uint8Array(g);for(let m=0;m<g;m++)E[m]=s[f++];i.push({payloadType:a,pts:t,uuid:d.join(""),userData:utf8ArrayToStr(E),userDataBytes:E})}}}function discardEPB(r){const e=r.byteLength,t=[];let i=1;for(;i<e-2;)r[i]===0&&r[i+1]===0&&r[i+2]===3?(t.push(i+2),i+=2):i++;if(t.length===0)return r;const s=e-t.length,n=new Uint8Array(s);let a=0;for(i=0;i<s;a++,i++)a===t[0]&&(a++,t.shift()),n[i]=r[a];return n}function parseEmsg(r){const e=r[0];let t="",i="",s=0,n=0,a=0,o=0,c=0,u=0;if(e===0){for(;bin2str(r.subarray(u,u+1))!=="\0";)t+=bin2str(r.subarray(u,u+1)),u+=1;for(t+=bin2str(r.subarray(u,u+1)),u+=1;bin2str(r.subarray(u,u+1))!=="\0";)i+=bin2str(r.subarray(u,u+1)),u+=1;i+=bin2str(r.subarray(u,u+1)),u+=1,s=readUint32(r,12),n=readUint32(r,16),o=readUint32(r,20),c=readUint32(r,24),u=28}else if(e===1){u+=4,s=readUint32(r,u),u+=4;const d=readUint32(r,u);u+=4;const g=readUint32(r,u);for(u+=4,a=2**32*d+g,isSafeInteger(a)||(a=Number.MAX_SAFE_INTEGER,logger.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),o=readUint32(r,u),u+=4,c=readUint32(r,u),u+=4;bin2str(r.subarray(u,u+1))!=="\0";)t+=bin2str(r.subarray(u,u+1)),u+=1;for(t+=bin2str(r.subarray(u,u+1)),u+=1;bin2str(r.subarray(u,u+1))!=="\0";)i+=bin2str(r.subarray(u,u+1)),u+=1;i+=bin2str(r.subarray(u,u+1)),u+=1}const f=r.subarray(u,r.byteLength);return{schemeIdUri:t,value:i,timeScale:s,presentationTime:a,presentationTimeDelta:n,eventDuration:o,id:c,payload:f}}function mp4Box(r,...e){const t=e.length;let i=8,s=t;for(;s--;)i+=e[s].byteLength;const n=new Uint8Array(i);for(n[0]=i>>24&255,n[1]=i>>16&255,n[2]=i>>8&255,n[3]=i&255,n.set(r,4),s=0,i=8;s<t;s++)n.set(e[s],i),i+=e[s].byteLength;return n}function mp4pssh(r,e,t){if(r.byteLength!==16)throw new RangeError("Invalid system id");let i,s;i=0,s=new Uint8Array;let n;i>0?(n=new Uint8Array(4),e.length>0&&new DataView(n.buffer).setUint32(0,e.length,!1)):n=new Uint8Array;const a=new Uint8Array(4);return t.byteLength>0&&new DataView(a.buffer).setUint32(0,t.byteLength,!1),mp4Box([112,115,115,104],new Uint8Array([i,0,0,0]),r,n,s,a,t)}function parseMultiPssh(r){const e=[];if(r instanceof ArrayBuffer){const t=r.byteLength;let i=0;for(;i+32<t;){const s=new DataView(r,i),n=parsePssh(s);e.push(n),i+=n.size}}return e}function parsePssh(r){const e=r.getUint32(0),t=r.byteOffset,i=r.byteLength;if(i<e)return{offset:t,size:i};if(r.getUint32(4)!==1886614376)return{offset:t,size:e};const n=r.getUint32(8)>>>24;if(n!==0&&n!==1)return{offset:t,size:e};const a=r.buffer,o=arrayToHex(new Uint8Array(a,t+12,16));let c=null,u=null,f=0;if(n===0)f=28;else{const g=r.getUint32(28);if(!g||i<32+g*16)return{offset:t,size:e};c=[];for(let E=0;E<g;E++)c.push(new Uint8Array(a,t+32+E*16,16));f=32+g*16}if(!f)return{offset:t,size:e};const d=r.getUint32(f);return e-32<d?{offset:t,size:e}:(u=new Uint8Array(a,t+f+4,d),{version:n,systemId:o,kids:c,data:u,offset:t,size:e})}const userAgentHevcSupportIsInaccurate=()=>/\(Windows.+Firefox\//i.test(navigator.userAgent),sampleEntryCodesISO={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,dav1:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}};function isCodecType(r,e){const t=sampleEntryCodesISO[e];return!!t&&!!t[r.slice(0,4)]}function areCodecsMediaSourceSupported(r,e,t=!0){return!r.split(",").some(i=>!isCodecMediaSourceSupported(i,e,t))}function isCodecMediaSourceSupported(r,e,t=!0){var i;const s=getMediaSource(t);return(i=s?.isTypeSupported(mimeTypeForCodec(r,e)))!=null?i:!1}function mimeTypeForCodec(r,e){return`${e}/mp4;codecs=${r}`}function videoCodecPreferenceValue(r){if(r){const e=r.substring(0,4);return sampleEntryCodesISO.video[e]}return 2}function codecsSetSelectionPreferenceValue(r){const e=userAgentHevcSupportIsInaccurate();return r.split(",").reduce((t,i)=>{const n=e&&isHEVC(i)?9:sampleEntryCodesISO.video[i];return n?(n*2+t)/(t?3:2):(sampleEntryCodesISO.audio[i]+t)/(t?2:1)},0)}const CODEC_COMPATIBLE_NAMES={};function getCodecCompatibleNameLower(r,e=!0){if(CODEC_COMPATIBLE_NAMES[r])return CODEC_COMPATIBLE_NAMES[r];const t={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"],"mp4a.40.34":["mp3"]}[r];for(let s=0;s<t.length;s++){var i;if(isCodecMediaSourceSupported(t[s],"audio",e))return CODEC_COMPATIBLE_NAMES[r]=t[s],t[s];if(t[s]==="mp3"&&(i=getMediaSource(e))!=null&&i.isTypeSupported("audio/mpeg"))return""}return r}const AUDIO_CODEC_REGEXP=/flac|opus|mp4a\.40\.34/i;function getCodecCompatibleName(r,e=!0){return r.replace(AUDIO_CODEC_REGEXP,t=>getCodecCompatibleNameLower(t.toLowerCase(),e))}function replaceVideoCodec(r,e){const t=[];if(r){const i=r.split(",");for(let s=0;s<i.length;s++)isCodecType(i[s],"video")||t.push(i[s])}return e&&t.push(e),t.join(",")}function pickMostCompleteCodecName(r,e){if(r&&(r.length>4||["ac-3","ec-3","alac","fLaC","Opus"].indexOf(r)!==-1)&&(isCodecSupportedAsType(r,"audio")||isCodecSupportedAsType(r,"video")))return r;if(e){const t=e.split(",");if(t.length>1){if(r){for(let i=t.length;i--;)if(t[i].substring(0,4)===r.substring(0,4))return t[i]}return t[0]}}return e||r}function isCodecSupportedAsType(r,e){return isCodecType(r,e)&&isCodecMediaSourceSupported(r,e)}function convertAVC1ToAVCOTI(r){const e=r.split(",");for(let t=0;t<e.length;t++){const i=e[t].split(".");i.length>2&&i[0]==="avc1"&&(e[t]=`avc1.${parseInt(i[1]).toString(16)}${("000"+parseInt(i[2]).toString(16)).slice(-4)}`)}return e.join(",")}function fillInMissingAV01Params(r){if(r.startsWith("av01.")){const e=r.split("."),t=["0","111","01","01","01","0"];for(let i=e.length;i>4&&i<10;i++)e[i]=t[i-4];return e.join(".")}return r}function getM2TSSupportedAudioTypes(r){const e=getMediaSource(r)||{isTypeSupported:()=>!1};return{mpeg:e.isTypeSupported("audio/mpeg"),mp3:e.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:e.isTypeSupported('audio/mp4; codecs="ac-3"')}}function getCodecsForMimeType(r){return r.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const supportedResult={supported:!0,powerEfficient:!0,smooth:!0},unsupportedResult={supported:!1,smooth:!1,powerEfficient:!1},SUPPORTED_INFO_DEFAULT={supported:!0,configurations:[],decodingInfoResults:[supportedResult]};function getUnsupportedResult(r,e){return{supported:!1,configurations:e,decodingInfoResults:[unsupportedResult],error:r}}function requiresMediaCapabilitiesDecodingInfo(r,e,t,i,s,n){const a=r.videoCodec,o=r.audioCodec?r.audioGroups:null,c=n?.audioCodec,u=n?.channels,f=u?parseInt(u):c?1/0:2;let d=null;if(o!=null&&o.length)try{o.length===1&&o[0]?d=e.groups[o[0]].channels:d=o.reduce((g,E)=>{if(E){const m=e.groups[E];if(!m)throw new Error(`Audio track group ${E} not found`);Object.keys(m.channels).forEach(T=>{g[T]=(g[T]||0)+m.channels[T]})}return g},{2:0})}catch{return!0}return a!==void 0&&(a.split(",").some(g=>isHEVC(g))||r.width>1920&&r.height>1088||r.height>1920&&r.width>1088||r.frameRate>Math.max(i,30)||r.videoRange!=="SDR"&&r.videoRange!==t||r.bitrate>Math.max(s,8e6))||!!d&&isFiniteNumber(f)&&Object.keys(d).some(g=>parseInt(g)>f)}function getMediaDecodingInfoPromise(r,e,t,i={}){const s=r.videoCodec;if(!s&&!r.audioCodec||!t)return Promise.resolve(SUPPORTED_INFO_DEFAULT);const n=[],a=makeVideoConfigurations(r),o=a.length,c=makeAudioConfigurations(r,e,o>0),u=c.length;for(let f=o||1*u||1;f--;){const d={type:"media-source"};if(o&&(d.video=a[f%o]),u){d.audio=c[f%u];const g=d.audio.bitrate;d.video&&g&&(d.video.bitrate-=g)}n.push(d)}if(s){const f=navigator.userAgent;if(s.split(",").some(d=>isHEVC(d))&&userAgentHevcSupportIsInaccurate())return Promise.resolve(getUnsupportedResult(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent string: (${f})`),n))}return Promise.all(n.map(f=>{const d=getMediaDecodingInfoKey(f);return i[d]||(i[d]=t.decodingInfo(f))})).then(f=>({supported:!f.some(d=>!d.supported),configurations:n,decodingInfoResults:f})).catch(f=>({supported:!1,configurations:n,decodingInfoResults:[],error:f}))}function makeVideoConfigurations(r){var e;const t=(e=r.videoCodec)==null?void 0:e.split(","),i=getVariantDecodingBitrate(r),s=r.width||640,n=r.height||480,a=r.frameRate||30,o=r.videoRange.toLowerCase();return t?t.map(c=>{const u={contentType:mimeTypeForCodec(fillInMissingAV01Params(c),"video"),width:s,height:n,bitrate:i,framerate:a};return o!=="sdr"&&(u.transferFunction=o),u}):[]}function makeAudioConfigurations(r,e,t){var i;const s=(i=r.audioCodec)==null?void 0:i.split(","),n=getVariantDecodingBitrate(r);return s&&r.audioGroups?r.audioGroups.reduce((a,o)=>{var c;const u=o?(c=e.groups[o])==null?void 0:c.tracks:null;return u?u.reduce((f,d)=>{if(d.groupId===o){const g=parseFloat(d.channels||"");s.forEach(E=>{const m={contentType:mimeTypeForCodec(E,"audio"),bitrate:t?estimatedAudioBitrate(E,n):n};g&&(m.channels=""+g),f.push(m)})}return f},a):a},[]):[]}function estimatedAudioBitrate(r,e){if(e<=1)return 1;let t=128e3;return r==="ec-3"?t=768e3:r==="ac-3"&&(t=64e4),Math.min(e/2,t)}function getVariantDecodingBitrate(r){return Math.ceil(Math.max(r.bitrate*.9,r.averageBitrate)/1e3)*1e3||1}function getMediaDecodingInfoKey(r){let e="";const{audio:t,video:i}=r;if(i){const s=getCodecsForMimeType(i.contentType);e+=`${s}_r${i.height}x${i.width}f${Math.ceil(i.framerate)}${i.transferFunction||"sd"}_${Math.ceil(i.bitrate/1e5)}`}if(t){const s=getCodecsForMimeType(t.contentType);e+=`${i?"_":""}${s}_c${t.channels}`}return e}const HdcpLevels=["NONE","TYPE-0","TYPE-1",null];function isHdcpLevel(r){return HdcpLevels.indexOf(r)>-1}const VideoRangeValues=["SDR","PQ","HLG"];function isVideoRange(r){return!!r&&VideoRangeValues.indexOf(r)>-1}var HlsSkip={No:"",Yes:"YES",v2:"v2"};function getSkipValue(r){const{canSkipUntil:e,canSkipDateRanges:t,age:i}=r,s=i<e/2;return e&&s?t?HlsSkip.v2:HlsSkip.Yes:HlsSkip.No}class HlsUrlParameters{constructor(e,t,i){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=i}addDirectives(e){const t=new self.URL(e);return this.msn!==void 0&&t.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&t.searchParams.set("_HLS_part",this.part.toString()),this.skip&&t.searchParams.set("_HLS_skip",this.skip),t.href}}class Level{constructor(e){if(this._attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.url=void 0,this.frameRate=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.supplemental=void 0,this.videoCodec=void 0,this.width=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.supportedPromise=void 0,this.supportedResult=void 0,this._avgBitrate=0,this._audioGroups=void 0,this._subtitleGroups=void 0,this._urlId=0,this.url=[e.url],this._attrs=[e.attrs],this.bitrate=e.bitrate,e.details&&(this.details=e.details),this.id=e.id||0,this.name=e.name,this.width=e.width||0,this.height=e.height||0,this.frameRate=e.attrs.optionalFloat("FRAME-RATE",0),this._avgBitrate=e.attrs.decimalInteger("AVERAGE-BANDWIDTH"),this.audioCodec=e.audioCodec,this.videoCodec=e.videoCodec,this.codecSet=[e.videoCodec,e.audioCodec].filter(i=>!!i).map(i=>i.substring(0,4)).join(","),"supplemental"in e){var t;this.supplemental=e.supplemental;const i=(t=e.supplemental)==null?void 0:t.videoCodec;i&&i!==e.videoCodec&&(this.codecSet+=`,${i.substring(0,4)}`)}this.addGroupId("audio",e.attrs.AUDIO),this.addGroupId("text",e.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||""}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get videoRange(){return this.attrs["VIDEO-RANGE"]||"SDR"}get score(){return this.attrs.optionalFloat("SCORE",0)}get uri(){return this.url[0]||""}hasAudioGroup(e){return hasGroup(this._audioGroups,e)}hasSubtitleGroup(e){return hasGroup(this._subtitleGroups,e)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(e,t){if(t){if(e==="audio"){let i=this._audioGroups;i||(i=this._audioGroups=[]),i.indexOf(t)===-1&&i.push(t)}else if(e==="text"){let i=this._subtitleGroups;i||(i=this._subtitleGroups=[]),i.indexOf(t)===-1&&i.push(t)}}}get urlId(){return 0}set urlId(e){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){var e;return(e=this.audioGroups)==null?void 0:e[0]}get textGroupId(){var e;return(e=this.subtitleGroups)==null?void 0:e[0]}addFallback(){}}function hasGroup(r,e){return!e||!r?!1:r.indexOf(e)!==-1}function isHdrSupported(){if(typeof matchMedia=="function"){const r=matchMedia("(dynamic-range: high)"),e=matchMedia("bad query");if(r.media!==e.media)return r.matches===!0}return!1}function getVideoSelectionOptions(r,e){let t=!1,i=[];if(r&&(t=r!=="SDR",i=[r]),e){i=e.allowedVideoRanges||VideoRangeValues.slice(0);const s=i.join("")!=="SDR"&&!e.videoCodec;t=e.preferHDR!==void 0?e.preferHDR:s&&isHdrSupported(),t||(i=["SDR"])}return{preferHDR:t,allowedVideoRanges:i}}const omitCircularRefsReplacer=r=>{const e=new WeakSet;return(t,i)=>{if(r&&(i=r(t,i)),typeof i=="object"&&i!==null){if(e.has(i))return;e.add(i)}return i}},stringify=(r,e)=>JSON.stringify(r,omitCircularRefsReplacer(e));function getStartCodecTier(r,e,t,i,s){const n=Object.keys(r),a=i?.channels,o=i?.audioCodec,c=s?.videoCodec,u=a&&parseInt(a)===2;let f=!1,d=!1,g=1/0,E=1/0,m=1/0,T=1/0,S=0,b=[];const{preferHDR:C,allowedVideoRanges:I}=getVideoSelectionOptions(e,s);for(let F=n.length;F--;){const G=r[n[F]];f||(f=G.channels[2]>0),g=Math.min(g,G.minHeight),E=Math.min(E,G.minFramerate),m=Math.min(m,G.minBitrate),I.filter($=>G.videoRanges[$]>0).length>0&&(d=!0)}g=isFiniteNumber(g)?g:0,E=isFiniteNumber(E)?E:0;const L=Math.max(1080,g),k=Math.max(30,E);m=isFiniteNumber(m)?m:t,t=Math.max(m,t),d||(e=void 0);const U=n.length>1;return{codecSet:n.reduce((F,G)=>{const x=r[G];if(G===F)return F;if(b=d?I.filter($=>x.videoRanges[$]>0):[],U){if(x.minBitrate>t)return logStartCodecCandidateIgnored(G,`min bitrate of ${x.minBitrate} > current estimate of ${t}`),F;if(!x.hasDefaultAudio)return logStartCodecCandidateIgnored(G,"no renditions with default or auto-select sound found"),F;if(o&&G.indexOf(o.substring(0,4))%5!==0)return logStartCodecCandidateIgnored(G,`audio codec preference "${o}" not found`),F;if(a&&!u){if(!x.channels[a])return logStartCodecCandidateIgnored(G,`no renditions with ${a} channel sound found (channels options: ${Object.keys(x.channels)})`),F}else if((!o||u)&&f&&x.channels[2]===0)return logStartCodecCandidateIgnored(G,"no renditions with stereo sound found"),F;if(x.minHeight>L)return logStartCodecCandidateIgnored(G,`min resolution of ${x.minHeight} > maximum of ${L}`),F;if(x.minFramerate>k)return logStartCodecCandidateIgnored(G,`min framerate of ${x.minFramerate} > maximum of ${k}`),F;if(!b.some($=>x.videoRanges[$]>0))return logStartCodecCandidateIgnored(G,`no variants with VIDEO-RANGE of ${stringify(b)} found`),F;if(c&&G.indexOf(c.substring(0,4))%5!==0)return logStartCodecCandidateIgnored(G,`video codec preference "${c}" not found`),F;if(x.maxScore<S)return logStartCodecCandidateIgnored(G,`max score of ${x.maxScore} < selected max of ${S}`),F}return F&&(codecsSetSelectionPreferenceValue(G)>=codecsSetSelectionPreferenceValue(F)||x.fragmentError>r[F].fragmentError)?F:(T=x.minIndex,S=x.maxScore,G)},void 0),videoRanges:b,preferHDR:C,minFramerate:E,minBitrate:m,minIndex:T}}function logStartCodecCandidateIgnored(r,e){logger.log(`[abr] start candidates with "${r}" ignored because ${e}`)}function getAudioTracksByGroup(r){return r.reduce((e,t)=>{let i=e.groups[t.groupId];i||(i=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),i.tracks.push(t);const s=t.channels||"2";return i.channels[s]=(i.channels[s]||0)+1,i.hasDefault=i.hasDefault||t.default,i.hasAutoSelect=i.hasAutoSelect||t.autoselect,i.hasDefault&&(e.hasDefaultAudio=!0),i.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function getCodecTiers(r,e,t,i){return r.slice(t,i+1).reduce((s,n,a)=>{if(!n.codecSet)return s;const o=n.audioGroups;let c=s[n.codecSet];c||(s[n.codecSet]=c={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,minIndex:a,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!o,fragmentError:0}),c.minBitrate=Math.min(c.minBitrate,n.bitrate);const u=Math.min(n.height,n.width);return c.minHeight=Math.min(c.minHeight,u),c.minFramerate=Math.min(c.minFramerate,n.frameRate),c.minIndex=Math.min(c.minIndex,a),c.maxScore=Math.max(c.maxScore,n.score),c.fragmentError+=n.fragmentError,c.videoRanges[n.videoRange]=(c.videoRanges[n.videoRange]||0)+1,o&&o.forEach(f=>{if(!f)return;const d=e.groups[f];d&&(c.hasDefaultAudio=c.hasDefaultAudio||e.hasDefaultAudio?d.hasDefault:d.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(d.channels).forEach(g=>{c.channels[g]=(c.channels[g]||0)+d.channels[g]}))}),s},{})}function getBasicSelectionOption(r){if(!r)return r;const{lang:e,assocLang:t,characteristics:i,channels:s,audioCodec:n}=r;return{lang:e,assocLang:t,characteristics:i,channels:s,audioCodec:n}}function findMatchingOption(r,e,t){if("attrs"in r){const i=e.indexOf(r);if(i!==-1)return i}for(let i=0;i<e.length;i++){const s=e[i];if(matchesOption(r,s,t))return i}return-1}function matchesOption(r,e,t){const{groupId:i,name:s,lang:n,assocLang:a,default:o}=r,c=r.forced;return(i===void 0||e.groupId===i)&&(s===void 0||e.name===s)&&(n===void 0||languagesMatch(n,e.lang))&&(n===void 0||e.assocLang===a)&&(o===void 0||e.default===o)&&(c===void 0||e.forced===c)&&(!("characteristics"in r)||characteristicsMatch(r.characteristics||"",e.characteristics))&&(t===void 0||t(r,e))}function languagesMatch(r,e="--"){return r.length===e.length?r===e:r.startsWith(e)||e.startsWith(r)}function characteristicsMatch(r,e=""){const t=r.split(","),i=e.split(",");return t.length===i.length&&!t.some(s=>i.indexOf(s)===-1)}function audioMatchPredicate(r,e){const{audioCodec:t,channels:i}=r;return(t===void 0||(e.audioCodec||"").substring(0,4)===t.substring(0,4))&&(i===void 0||i===(e.channels||"2"))}function findClosestLevelWithAudioGroup(r,e,t,i,s){const n=e[i],o=e.reduce((g,E,m)=>{const T=E.uri;return(g[T]||(g[T]=[])).push(m),g},{})[n.uri];o.length>1&&(i=Math.max.apply(Math,o));const c=n.videoRange,u=n.frameRate,f=n.codecSet.substring(0,4),d=searchDownAndUpList(e,i,g=>{if(g.videoRange!==c||g.frameRate!==u||g.codecSet.substring(0,4)!==f)return!1;const E=g.audioGroups,m=t.filter(T=>!E||E.indexOf(T.groupId)!==-1);return findMatchingOption(r,m,s)>-1});return d>-1?d:searchDownAndUpList(e,i,g=>{const E=g.audioGroups,m=t.filter(T=>!E||E.indexOf(T.groupId)!==-1);return findMatchingOption(r,m,s)>-1})}function searchDownAndUpList(r,e,t){for(let i=e;i>-1;i--)if(t(r[i]))return i;for(let i=e+1;i<r.length;i++)if(t(r[i]))return i;return-1}function useAlternateAudio(r,e){var t;return!!r&&r!==((t=e.loadLevelObj)==null?void 0:t.uri)}class AbrController extends Logger{constructor(e){super("abr",e.logger),this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.rebufferNotice=-1,this.supportedCache={},this.bwEstimator=void 0,this._abandonRulesCheck=t=>{var i;const{fragCurrent:s,partCurrent:n,hls:a}=this,{autoLevelEnabled:o,media:c}=a;if(!s||!c)return;const u=performance.now(),f=n?n.stats:s.stats,d=n?n.duration:s.duration,g=u-f.loading.start,E=a.minAutoLevel,m=s.level,T=this._nextAutoLevel;if(f.aborted||f.loaded&&f.loaded===f.total||m<=E){this.clearTimer(),this._nextAutoLevel=-1;return}if(!o)return;const S=T>-1&&T!==m,b=!!t||S;if(!b&&(c.paused||!c.playbackRate||!c.readyState))return;const C=a.mainForwardBufferInfo;if(!b&&C===null)return;const I=this.bwEstimator.getEstimateTTFB(),L=Math.abs(c.playbackRate);if(g<=Math.max(I,1e3*(d/(L*2))))return;const k=C?C.len/L:0,U=f.loading.first?f.loading.first-f.loading.start:-1,O=f.loaded&&U>-1,F=this.getBwEstimate(),G=a.levels,x=G[m],$=Math.max(f.loaded,Math.round(d*(s.bitrate||x.averageBitrate)/8));let X=O?g-U:g;X<1&&O&&(X=Math.min(g,f.loaded*8/F));const Q=O?f.loaded*1e3/X:0,ee=I/1e3,te=Q?($-f.loaded)/Q:$*8/F+ee;if(te<=k)return;const re=Q?Q*8:F,me=((i=t?.details||this.hls.latestLevelDetails)==null?void 0:i.live)===!0,H=this.hls.config.abrBandWidthUpFactor;let z=Number.POSITIVE_INFINITY,ie;for(ie=m-1;ie>E;ie--){const Pe=G[ie].maxBitrate,ae=!G[ie].details||me;if(z=this.getTimeToLoadFrag(ee,re,d*Pe,ae),z<Math.min(k,d+ee))break}if(z>=te||z>d*10)return;O?this.bwEstimator.sample(g-Math.min(I,U),f.loaded):this.bwEstimator.sampleTTFB(g);const ne=G[ie].maxBitrate;this.getBwEstimate()*H>ne&&this.resetEstimator(ne);const he=this.findBestLevel(ne,E,ie,0,k,1,1);he>-1&&(ie=he),this.warn(`Fragment ${s.sn}${n?" part "+n.index:""} of level ${m} is loading too slowly;
278
+ `+new Error().stack),D=!1}return A.apply(this,arguments)},A)}var $={};function X(y,A){i.deprecationHandler!=null&&i.deprecationHandler(y,A),$[y]||(G(A),$[y]=!0)}i.suppressDeprecationWarnings=!1,i.deprecationHandler=null;function Q(y){return typeof Function<"u"&&y instanceof Function||Object.prototype.toString.call(y)==="[object Function]"}function ee(y){var A,D;for(D in y)o(y,D)&&(A=y[D],Q(A)?this[D]=A:this["_"+D]=A);this._config=y,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function te(y,A){var D=E({},y),R;for(R in A)o(A,R)&&(a(y[R])&&a(A[R])?(D[R]={},E(D[R],y[R]),E(D[R],A[R])):A[R]!=null?D[R]=A[R]:delete D[R]);for(R in y)o(y,R)&&!o(A,R)&&a(y[R])&&(D[R]=E({},D[R]));return D}function re(y){y!=null&&this.set(y)}var me;Object.keys?me=Object.keys:me=function(y){var A,D=[];for(A in y)o(y,A)&&D.push(A);return D};var H={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function z(y,A,D){var R=this._calendar[y]||this._calendar.sameElse;return Q(R)?R.call(A,D):R}function ie(y,A,D){var R=""+Math.abs(y),N=A-R.length,K=y>=0;return(K?D?"+":"":"-")+Math.pow(10,Math.max(0,N)).toString().substr(1)+R}var ne=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,he=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,pe={},Pe={};function ae(y,A,D,R){var N=R;typeof R=="string"&&(N=function(){return this[R]()}),y&&(Pe[y]=N),A&&(Pe[A[0]]=function(){return ie(N.apply(this,arguments),A[1],A[2])}),D&&(Pe[D]=function(){return this.localeData().ordinal(N.apply(this,arguments),y)})}function Ae(y){return y.match(/\[[\s\S]/)?y.replace(/^\[|\]$/g,""):y.replace(/\\/g,"")}function Re(y){var A=y.match(ne),D,R;for(D=0,R=A.length;D<R;D++)Pe[A[D]]?A[D]=Pe[A[D]]:A[D]=Ae(A[D]);return function(N){var K="",oe;for(oe=0;oe<R;oe++)K+=Q(A[oe])?A[oe].call(N,y):A[oe];return K}}function Le(y,A){return y.isValid()?(A=Y(A,y.localeData()),pe[A]=pe[A]||Re(A),pe[A](y)):y.localeData().invalidDate()}function Y(y,A){var D=5;function R(N){return A.longDateFormat(N)||N}for(he.lastIndex=0;D>=0&&he.test(y);)y=y.replace(he,R),he.lastIndex=0,D-=1;return y}var q={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function le(y){var A=this._longDateFormat[y],D=this._longDateFormat[y.toUpperCase()];return A||!D?A:(this._longDateFormat[y]=D.match(ne).map(function(R){return R==="MMMM"||R==="MM"||R==="DD"||R==="dddd"?R.slice(1):R}).join(""),this._longDateFormat[y])}var ce="Invalid date";function Ee(){return this._invalidDate}var ve="%d",Be=/\d{1,2}/;function Ie(y){return this._ordinal.replace("%d",y)}var Me={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Ve(y,A,D,R){var N=this._relativeTime[D];return Q(N)?N(y,A,D,R):N.replace(/%d/i,y)}function dt(y,A){var D=this._relativeTime[y>0?"future":"past"];return Q(D)?D(A):D.replace(/%s/i,A)}var Qe={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function ze(y){return typeof y=="string"?Qe[y]||Qe[y.toLowerCase()]:void 0}function Je(y){var A={},D,R;for(R in y)o(y,R)&&(D=ze(R),D&&(A[D]=y[R]));return A}var gt={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function yt(y){var A=[],D;for(D in y)o(y,D)&&A.push({unit:D,priority:gt[D]});return A.sort(function(R,N){return R.priority-N.priority}),A}var _t=/\d/,qe=/\d\d/,Yt=/\d{3}/,Dt=/\d{4}/,St=/[+-]?\d{6}/,Se=/\d\d?/,lt=/\d\d\d\d?/,ht=/\d\d\d\d\d\d?/,pt=/\d{1,3}/,Ui=/\d{1,4}/,Pi=/[+-]?\d{1,6}/,Di=/\d+/,tr=/[+-]?\d+/,ks=/Z|[+-]\d\d:?\d\d/gi,zr=/Z|[+-]\d\d(?::?\d\d)?/gi,Ra=/[+-]?\d+(\.\d{1,3})?/,Tr=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Vi=/^[1-9]\d?/,qr=/^([1-9]\d|\d)/,Xr;Xr={};function Ce(y,A,D){Xr[y]=Q(A)?A:function(R,N){return R&&D?D:A}}function La(y,A){return o(Xr,y)?Xr[y](A._strict,A._locale):new RegExp(xa(y))}function xa(y){return ni(y.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(A,D,R,N,K){return D||R||N||K}))}function ni(y){return y.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Wt(y){return y<0?Math.ceil(y)||0:Math.floor(y)}function He(y){var A=+y,D=0;return A!==0&&isFinite(A)&&(D=Wt(A)),D}var Os={};function it(y,A){var D,R=A,N;for(typeof y=="string"&&(y=[y]),f(A)&&(R=function(K,oe){oe[A]=He(K)}),N=y.length,D=0;D<N;D++)Os[y[D]]=R}function _r(y,A){it(y,function(D,R,N,K){N._w=N._w||{},A(D,N._w,N,K)})}function Fs(y,A,D){A!=null&&o(Os,y)&&Os[y](A,D._a,D,y)}function Zr(y){return y%4===0&&y%100!==0||y%400===0}var xt=0,gi=1,ai=2,At=3,Qt=4,yi=5,$i=6,yn=7,Ma=8;ae("Y",0,0,function(){var y=this.year();return y<=9999?ie(y,4):"+"+y}),ae(0,["YY",2],0,function(){return this.year()%100}),ae(0,["YYYY",4],0,"year"),ae(0,["YYYYY",5],0,"year"),ae(0,["YYYYYY",6,!0],0,"year"),Ce("Y",tr),Ce("YY",Se,qe),Ce("YYYY",Ui,Dt),Ce("YYYYY",Pi,St),Ce("YYYYYY",Pi,St),it(["YYYYY","YYYYYY"],xt),it("YYYY",function(y,A){A[xt]=y.length===2?i.parseTwoDigitYear(y):He(y)}),it("YY",function(y,A){A[xt]=i.parseTwoDigitYear(y)}),it("Y",function(y,A){A[xt]=parseInt(y,10)});function Ar(y){return Zr(y)?366:365}i.parseTwoDigitYear=function(y){return He(y)+(He(y)>68?1900:2e3)};var vn=ir("FullYear",!0);function wa(){return Zr(this.year())}function ir(y,A){return function(D){return D!=null?(Cr(this,y,D),i.updateOffset(this,A),this):br(this,y)}}function br(y,A){if(!y.isValid())return NaN;var D=y._d,R=y._isUTC;switch(A){case"Milliseconds":return R?D.getUTCMilliseconds():D.getMilliseconds();case"Seconds":return R?D.getUTCSeconds():D.getSeconds();case"Minutes":return R?D.getUTCMinutes():D.getMinutes();case"Hours":return R?D.getUTCHours():D.getHours();case"Date":return R?D.getUTCDate():D.getDate();case"Day":return R?D.getUTCDay():D.getDay();case"Month":return R?D.getUTCMonth():D.getMonth();case"FullYear":return R?D.getUTCFullYear():D.getFullYear();default:return NaN}}function Cr(y,A,D){var R,N,K,oe,_e;if(!(!y.isValid()||isNaN(D))){switch(R=y._d,N=y._isUTC,A){case"Milliseconds":return void(N?R.setUTCMilliseconds(D):R.setMilliseconds(D));case"Seconds":return void(N?R.setUTCSeconds(D):R.setSeconds(D));case"Minutes":return void(N?R.setUTCMinutes(D):R.setMinutes(D));case"Hours":return void(N?R.setUTCHours(D):R.setHours(D));case"Date":return void(N?R.setUTCDate(D):R.setDate(D));case"FullYear":break;default:return}K=D,oe=y.month(),_e=y.date(),_e=_e===29&&oe===1&&!Zr(K)?28:_e,N?R.setUTCFullYear(K,oe,_e):R.setFullYear(K,oe,_e)}}function ka(y){return y=ze(y),Q(this[y])?this[y]():this}function Qr(y,A){if(typeof y=="object"){y=Je(y);var D=yt(y),R,N=D.length;for(R=0;R<N;R++)this[D[R].unit](y[D[R].unit])}else if(y=ze(y),Q(this[y]))return this[y](A);return this}function Oa(y,A){return(y%A+A)%A}var vt;Array.prototype.indexOf?vt=Array.prototype.indexOf:vt=function(y){var A;for(A=0;A<this.length;++A)if(this[A]===y)return A;return-1};function Ns(y,A){if(isNaN(y)||isNaN(A))return NaN;var D=Oa(A,12);return y+=(A-D)/12,D===1?Zr(y)?29:28:31-D%7%2}ae("M",["MM",2],"Mo",function(){return this.month()+1}),ae("MMM",0,0,function(y){return this.localeData().monthsShort(this,y)}),ae("MMMM",0,0,function(y){return this.localeData().months(this,y)}),Ce("M",Se,Vi),Ce("MM",Se,qe),Ce("MMM",function(y,A){return A.monthsShortRegex(y)}),Ce("MMMM",function(y,A){return A.monthsRegex(y)}),it(["M","MM"],function(y,A){A[gi]=He(y)-1}),it(["MMM","MMMM"],function(y,A,D,R){var N=D._locale.monthsParse(y,R,D._strict);N!=null?A[gi]=N:S(D).invalidMonth=y});var En="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Bs="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Us=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Fa=Tr,Na=Tr;function Ba(y,A){return y?n(this._months)?this._months[y.month()]:this._months[(this._months.isFormat||Us).test(A)?"format":"standalone"][y.month()]:n(this._months)?this._months:this._months.standalone}function Ua(y,A){return y?n(this._monthsShort)?this._monthsShort[y.month()]:this._monthsShort[Us.test(A)?"format":"standalone"][y.month()]:n(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function Sn(y,A,D){var R,N,K,oe=y.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],R=0;R<12;++R)K=m([2e3,R]),this._shortMonthsParse[R]=this.monthsShort(K,"").toLocaleLowerCase(),this._longMonthsParse[R]=this.months(K,"").toLocaleLowerCase();return D?A==="MMM"?(N=vt.call(this._shortMonthsParse,oe),N!==-1?N:null):(N=vt.call(this._longMonthsParse,oe),N!==-1?N:null):A==="MMM"?(N=vt.call(this._shortMonthsParse,oe),N!==-1?N:(N=vt.call(this._longMonthsParse,oe),N!==-1?N:null)):(N=vt.call(this._longMonthsParse,oe),N!==-1?N:(N=vt.call(this._shortMonthsParse,oe),N!==-1?N:null))}function Tn(y,A,D){var R,N,K;if(this._monthsParseExact)return Sn.call(this,y,A,D);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),R=0;R<12;R++){if(N=m([2e3,R]),D&&!this._longMonthsParse[R]&&(this._longMonthsParse[R]=new RegExp("^"+this.months(N,"").replace(".","")+"$","i"),this._shortMonthsParse[R]=new RegExp("^"+this.monthsShort(N,"").replace(".","")+"$","i")),!D&&!this._monthsParse[R]&&(K="^"+this.months(N,"")+"|^"+this.monthsShort(N,""),this._monthsParse[R]=new RegExp(K.replace(".",""),"i")),D&&A==="MMMM"&&this._longMonthsParse[R].test(y))return R;if(D&&A==="MMM"&&this._shortMonthsParse[R].test(y))return R;if(!D&&this._monthsParse[R].test(y))return R}}function Vs(y,A){if(!y.isValid())return y;if(typeof A=="string"){if(/^\d+$/.test(A))A=He(A);else if(A=y.localeData().monthsParse(A),!f(A))return y}var D=A,R=y.date();return R=R<29?R:Math.min(R,Ns(y.year(),D)),y._isUTC?y._d.setUTCMonth(D,R):y._d.setMonth(D,R),y}function Jr(y){return y!=null?(Vs(this,y),i.updateOffset(this,!0),this):br(this,"Month")}function Va(){return Ns(this.year(),this.month())}function _n(y){return this._monthsParseExact?(o(this,"_monthsRegex")||$s.call(this),y?this._monthsShortStrictRegex:this._monthsShortRegex):(o(this,"_monthsShortRegex")||(this._monthsShortRegex=Fa),this._monthsShortStrictRegex&&y?this._monthsShortStrictRegex:this._monthsShortRegex)}function es(y){return this._monthsParseExact?(o(this,"_monthsRegex")||$s.call(this),y?this._monthsStrictRegex:this._monthsRegex):(o(this,"_monthsRegex")||(this._monthsRegex=Na),this._monthsStrictRegex&&y?this._monthsStrictRegex:this._monthsRegex)}function $s(){function y(Oe,We){return We.length-Oe.length}var A=[],D=[],R=[],N,K,oe,_e;for(N=0;N<12;N++)K=m([2e3,N]),oe=ni(this.monthsShort(K,"")),_e=ni(this.months(K,"")),A.push(oe),D.push(_e),R.push(_e),R.push(oe);A.sort(y),D.sort(y),R.sort(y),this._monthsRegex=new RegExp("^("+R.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+D.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+A.join("|")+")","i")}function $a(y,A,D,R,N,K,oe){var _e;return y<100&&y>=0?(_e=new Date(y+400,A,D,R,N,K,oe),isFinite(_e.getFullYear())&&_e.setFullYear(y)):_e=new Date(y,A,D,R,N,K,oe),_e}function rr(y){var A,D;return y<100&&y>=0?(D=Array.prototype.slice.call(arguments),D[0]=y+400,A=new Date(Date.UTC.apply(null,D)),isFinite(A.getUTCFullYear())&&A.setUTCFullYear(y)):A=new Date(Date.UTC.apply(null,arguments)),A}function Ir(y,A,D){var R=7+A-D,N=(7+rr(y,0,R).getUTCDay()-A)%7;return-N+R-1}function ts(y,A,D,R,N){var K=(7+D-R)%7,oe=Ir(y,R,N),_e=1+7*(A-1)+K+oe,Oe,We;return _e<=0?(Oe=y-1,We=Ar(Oe)+_e):_e>Ar(y)?(Oe=y+1,We=_e-Ar(y)):(Oe=y,We=_e),{year:Oe,dayOfYear:We}}function Pr(y,A,D){var R=Ir(y.year(),A,D),N=Math.floor((y.dayOfYear()-R-1)/7)+1,K,oe;return N<1?(oe=y.year()-1,K=N+oi(oe,A,D)):N>oi(y.year(),A,D)?(K=N-oi(y.year(),A,D),oe=y.year()+1):(oe=y.year(),K=N),{week:K,year:oe}}function oi(y,A,D){var R=Ir(y,A,D),N=Ir(y+1,A,D);return(Ar(y)-R+N)/7}ae("w",["ww",2],"wo","week"),ae("W",["WW",2],"Wo","isoWeek"),Ce("w",Se,Vi),Ce("ww",Se,qe),Ce("W",Se,Vi),Ce("WW",Se,qe),_r(["w","ww","W","WW"],function(y,A,D,R){A[R.substr(0,1)]=He(y)});function Gs(y){return Pr(y,this._week.dow,this._week.doy).week}var Hs={dow:0,doy:6};function sr(){return this._week.dow}function An(){return this._week.doy}function bn(y){var A=this.localeData().week(this);return y==null?A:this.add((y-A)*7,"d")}function Ga(y){var A=Pr(this,1,4).week;return y==null?A:this.add((y-A)*7,"d")}ae("d",0,"do","day"),ae("dd",0,0,function(y){return this.localeData().weekdaysMin(this,y)}),ae("ddd",0,0,function(y){return this.localeData().weekdaysShort(this,y)}),ae("dddd",0,0,function(y){return this.localeData().weekdays(this,y)}),ae("e",0,0,"weekday"),ae("E",0,0,"isoWeekday"),Ce("d",Se),Ce("e",Se),Ce("E",Se),Ce("dd",function(y,A){return A.weekdaysMinRegex(y)}),Ce("ddd",function(y,A){return A.weekdaysShortRegex(y)}),Ce("dddd",function(y,A){return A.weekdaysRegex(y)}),_r(["dd","ddd","dddd"],function(y,A,D,R){var N=D._locale.weekdaysParse(y,R,D._strict);N!=null?A.d=N:S(D).invalidWeekday=y}),_r(["d","e","E"],function(y,A,D,R){A[R]=He(y)});function Cn(y,A){return typeof y!="string"?y:isNaN(y)?(y=A.weekdaysParse(y),typeof y=="number"?y:null):parseInt(y,10)}function In(y,A){return typeof y=="string"?A.weekdaysParse(y)%7||7:isNaN(y)?null:y}function is(y,A){return y.slice(A,7).concat(y.slice(0,A))}var Pn="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Dn="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Ha="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Ya=Tr,Rn=Tr,Wa=Tr;function Ka(y,A){var D=n(this._weekdays)?this._weekdays:this._weekdays[y&&y!==!0&&this._weekdays.isFormat.test(A)?"format":"standalone"];return y===!0?is(D,this._week.dow):y?D[y.day()]:D}function ja(y){return y===!0?is(this._weekdaysShort,this._week.dow):y?this._weekdaysShort[y.day()]:this._weekdaysShort}function za(y){return y===!0?is(this._weekdaysMin,this._week.dow):y?this._weekdaysMin[y.day()]:this._weekdaysMin}function Ys(y,A,D){var R,N,K,oe=y.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],R=0;R<7;++R)K=m([2e3,1]).day(R),this._minWeekdaysParse[R]=this.weekdaysMin(K,"").toLocaleLowerCase(),this._shortWeekdaysParse[R]=this.weekdaysShort(K,"").toLocaleLowerCase(),this._weekdaysParse[R]=this.weekdays(K,"").toLocaleLowerCase();return D?A==="dddd"?(N=vt.call(this._weekdaysParse,oe),N!==-1?N:null):A==="ddd"?(N=vt.call(this._shortWeekdaysParse,oe),N!==-1?N:null):(N=vt.call(this._minWeekdaysParse,oe),N!==-1?N:null):A==="dddd"?(N=vt.call(this._weekdaysParse,oe),N!==-1||(N=vt.call(this._shortWeekdaysParse,oe),N!==-1)?N:(N=vt.call(this._minWeekdaysParse,oe),N!==-1?N:null)):A==="ddd"?(N=vt.call(this._shortWeekdaysParse,oe),N!==-1||(N=vt.call(this._weekdaysParse,oe),N!==-1)?N:(N=vt.call(this._minWeekdaysParse,oe),N!==-1?N:null)):(N=vt.call(this._minWeekdaysParse,oe),N!==-1||(N=vt.call(this._weekdaysParse,oe),N!==-1)?N:(N=vt.call(this._shortWeekdaysParse,oe),N!==-1?N:null))}function qa(y,A,D){var R,N,K;if(this._weekdaysParseExact)return Ys.call(this,y,A,D);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),R=0;R<7;R++){if(N=m([2e3,1]).day(R),D&&!this._fullWeekdaysParse[R]&&(this._fullWeekdaysParse[R]=new RegExp("^"+this.weekdays(N,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[R]=new RegExp("^"+this.weekdaysShort(N,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[R]=new RegExp("^"+this.weekdaysMin(N,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[R]||(K="^"+this.weekdays(N,"")+"|^"+this.weekdaysShort(N,"")+"|^"+this.weekdaysMin(N,""),this._weekdaysParse[R]=new RegExp(K.replace(".",""),"i")),D&&A==="dddd"&&this._fullWeekdaysParse[R].test(y))return R;if(D&&A==="ddd"&&this._shortWeekdaysParse[R].test(y))return R;if(D&&A==="dd"&&this._minWeekdaysParse[R].test(y))return R;if(!D&&this._weekdaysParse[R].test(y))return R}}function Xa(y){if(!this.isValid())return y!=null?this:NaN;var A=br(this,"Day");return y!=null?(y=Cn(y,this.localeData()),this.add(y-A,"d")):A}function Za(y){if(!this.isValid())return y!=null?this:NaN;var A=(this.day()+7-this.localeData()._week.dow)%7;return y==null?A:this.add(y-A,"d")}function Qa(y){if(!this.isValid())return y!=null?this:NaN;if(y!=null){var A=In(y,this.localeData());return this.day(this.day()%7?A:A-7)}else return this.day()||7}function Ja(y){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||Ws.call(this),y?this._weekdaysStrictRegex:this._weekdaysRegex):(o(this,"_weekdaysRegex")||(this._weekdaysRegex=Ya),this._weekdaysStrictRegex&&y?this._weekdaysStrictRegex:this._weekdaysRegex)}function ft(y){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||Ws.call(this),y?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(o(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Rn),this._weekdaysShortStrictRegex&&y?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function ut(y){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||Ws.call(this),y?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(o(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Wa),this._weekdaysMinStrictRegex&&y?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Ws(){function y(Pt,Ai){return Ai.length-Pt.length}var A=[],D=[],R=[],N=[],K,oe,_e,Oe,We;for(K=0;K<7;K++)oe=m([2e3,1]).day(K),_e=ni(this.weekdaysMin(oe,"")),Oe=ni(this.weekdaysShort(oe,"")),We=ni(this.weekdays(oe,"")),A.push(_e),D.push(Oe),R.push(We),N.push(_e),N.push(Oe),N.push(We);A.sort(y),D.sort(y),R.sort(y),N.sort(y),this._weekdaysRegex=new RegExp("^("+N.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+R.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+D.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+A.join("|")+")","i")}function Ks(){return this.hours()%12||12}function eo(){return this.hours()||24}ae("H",["HH",2],0,"hour"),ae("h",["hh",2],0,Ks),ae("k",["kk",2],0,eo),ae("hmm",0,0,function(){return""+Ks.apply(this)+ie(this.minutes(),2)}),ae("hmmss",0,0,function(){return""+Ks.apply(this)+ie(this.minutes(),2)+ie(this.seconds(),2)}),ae("Hmm",0,0,function(){return""+this.hours()+ie(this.minutes(),2)}),ae("Hmmss",0,0,function(){return""+this.hours()+ie(this.minutes(),2)+ie(this.seconds(),2)});function Ln(y,A){ae(y,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),A)})}Ln("a",!0),Ln("A",!1);function xn(y,A){return A._meridiemParse}Ce("a",xn),Ce("A",xn),Ce("H",Se,qr),Ce("h",Se,Vi),Ce("k",Se,Vi),Ce("HH",Se,qe),Ce("hh",Se,qe),Ce("kk",Se,qe),Ce("hmm",lt),Ce("hmmss",ht),Ce("Hmm",lt),Ce("Hmmss",ht),it(["H","HH"],At),it(["k","kk"],function(y,A,D){var R=He(y);A[At]=R===24?0:R}),it(["a","A"],function(y,A,D){D._isPm=D._locale.isPM(y),D._meridiem=y}),it(["h","hh"],function(y,A,D){A[At]=He(y),S(D).bigHour=!0}),it("hmm",function(y,A,D){var R=y.length-2;A[At]=He(y.substr(0,R)),A[Qt]=He(y.substr(R)),S(D).bigHour=!0}),it("hmmss",function(y,A,D){var R=y.length-4,N=y.length-2;A[At]=He(y.substr(0,R)),A[Qt]=He(y.substr(R,2)),A[yi]=He(y.substr(N)),S(D).bigHour=!0}),it("Hmm",function(y,A,D){var R=y.length-2;A[At]=He(y.substr(0,R)),A[Qt]=He(y.substr(R))}),it("Hmmss",function(y,A,D){var R=y.length-4,N=y.length-2;A[At]=He(y.substr(0,R)),A[Qt]=He(y.substr(R,2)),A[yi]=He(y.substr(N))});function to(y){return(y+"").toLowerCase().charAt(0)==="p"}var Mn=/[ap]\.?m?\.?/i,io=ir("Hours",!0);function It(y,A,D){return y>11?D?"pm":"PM":D?"am":"AM"}var rs={calendar:H,longDateFormat:q,invalidDate:ce,ordinal:ve,dayOfMonthOrdinalParse:Be,relativeTime:Me,months:En,monthsShort:Bs,week:Hs,weekdays:Pn,weekdaysMin:Ha,weekdaysShort:Dn,meridiemParse:Mn},rt={},nr={},Gi;function Kt(y,A){var D,R=Math.min(y.length,A.length);for(D=0;D<R;D+=1)if(y[D]!==A[D])return D;return R}function js(y){return y&&y.toLowerCase().replace("_","-")}function wn(y){for(var A=0,D,R,N,K;A<y.length;){for(K=js(y[A]).split("-"),D=K.length,R=js(y[A+1]),R=R?R.split("-"):null;D>0;){if(N=Dr(K.slice(0,D).join("-")),N)return N;if(R&&R.length>=D&&Kt(K,R)>=D-1)break;D--}A++}return Gi}function kn(y){return!!(y&&y.match("^[^/\\\\]*$"))}function Dr(y){var A=null,D;if(rt[y]===void 0&&r&&r.exports&&kn(y))try{A=Gi._abbr,D=commonjsRequire,D("./locale/"+y),vi(A)}catch{rt[y]=null}return rt[y]}function vi(y,A){var D;return y&&(u(A)?D=Ei(y):D=ss(y,A),D?Gi=D:typeof console<"u"&&console.warn&&console.warn("Locale "+y+" not found. Did you forget to load it?")),Gi._abbr}function ss(y,A){if(A!==null){var D,R=rs;if(A.abbr=y,rt[y]!=null)X("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),R=rt[y]._config;else if(A.parentLocale!=null)if(rt[A.parentLocale]!=null)R=rt[A.parentLocale]._config;else if(D=Dr(A.parentLocale),D!=null)R=D._config;else return nr[A.parentLocale]||(nr[A.parentLocale]=[]),nr[A.parentLocale].push({name:y,config:A}),null;return rt[y]=new re(te(R,A)),nr[y]&&nr[y].forEach(function(N){ss(N.name,N.config)}),vi(y),rt[y]}else return delete rt[y],null}function Nt(y,A){if(A!=null){var D,R,N=rs;rt[y]!=null&&rt[y].parentLocale!=null?rt[y].set(te(rt[y]._config,A)):(R=Dr(y),R!=null&&(N=R._config),A=te(N,A),R==null&&(A.abbr=y),D=new re(A),D.parentLocale=rt[y],rt[y]=D),vi(y)}else rt[y]!=null&&(rt[y].parentLocale!=null?(rt[y]=rt[y].parentLocale,y===vi()&&vi(y)):rt[y]!=null&&delete rt[y]);return rt[y]}function Ei(y){var A;if(y&&y._locale&&y._locale._abbr&&(y=y._locale._abbr),!y)return Gi;if(!n(y)){if(A=Dr(y),A)return A;y=[y]}return wn(y)}function jt(){return me(rt)}function zs(y){var A,D=y._a;return D&&S(y).overflow===-2&&(A=D[gi]<0||D[gi]>11?gi:D[ai]<1||D[ai]>Ns(D[xt],D[gi])?ai:D[At]<0||D[At]>24||D[At]===24&&(D[Qt]!==0||D[yi]!==0||D[$i]!==0)?At:D[Qt]<0||D[Qt]>59?Qt:D[yi]<0||D[yi]>59?yi:D[$i]<0||D[$i]>999?$i:-1,S(y)._overflowDayOfYear&&(A<xt||A>ai)&&(A=ai),S(y)._overflowWeeks&&A===-1&&(A=yn),S(y)._overflowWeekday&&A===-1&&(A=Ma),S(y).overflow=A),y}var On=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ri=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ns=/Z|[+-]\d\d(?::?\d\d)?/,ar=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],ct=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Li=/^\/?Date\((-?\d+)/i,qs=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,ro={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function as(y){var A,D,R=y._i,N=On.exec(R)||Ri.exec(R),K,oe,_e,Oe,We=ar.length,Pt=ct.length;if(N){for(S(y).iso=!0,A=0,D=We;A<D;A++)if(ar[A][1].exec(N[1])){oe=ar[A][0],K=ar[A][2]!==!1;break}if(oe==null){y._isValid=!1;return}if(N[3]){for(A=0,D=Pt;A<D;A++)if(ct[A][1].exec(N[3])){_e=(N[2]||" ")+ct[A][0];break}if(_e==null){y._isValid=!1;return}}if(!K&&_e!=null){y._isValid=!1;return}if(N[4])if(ns.exec(N[4]))Oe="Z";else{y._isValid=!1;return}y._f=oe+(_e||"")+(Oe||""),ls(y)}else y._isValid=!1}function so(y,A,D,R,N,K){var oe=[no(y),Bs.indexOf(A),parseInt(D,10),parseInt(R,10),parseInt(N,10)];return K&&oe.push(parseInt(K,10)),oe}function no(y){var A=parseInt(y,10);return A<=49?2e3+A:A<=999?1900+A:A}function ao(y){return y.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Fn(y,A,D){if(y){var R=Dn.indexOf(y),N=new Date(A[0],A[1],A[2]).getDay();if(R!==N)return S(D).weekdayMismatch=!0,D._isValid=!1,!1}return!0}function os(y,A,D){if(y)return ro[y];if(A)return 0;var R=parseInt(D,10),N=R%100,K=(R-N)/100;return K*60+N}function Hi(y){var A=qs.exec(ao(y._i)),D;if(A){if(D=so(A[4],A[3],A[2],A[5],A[6],A[7]),!Fn(A[1],D,y))return;y._a=D,y._tzm=os(A[8],A[9],A[10]),y._d=rr.apply(null,y._a),y._d.setUTCMinutes(y._d.getUTCMinutes()-y._tzm),S(y).rfc2822=!0}else y._isValid=!1}function oo(y){var A=Li.exec(y._i);if(A!==null){y._d=new Date(+A[1]);return}if(as(y),y._isValid===!1)delete y._isValid;else return;if(Hi(y),y._isValid===!1)delete y._isValid;else return;y._strict?y._isValid=!1:i.createFromInputFallback(y)}i.createFromInputFallback=x("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(y){y._d=new Date(y._i+(y._useUTC?" UTC":""))});function Yi(y,A,D){return y??A??D}function Nn(y){var A=new Date(i.now());return y._useUTC?[A.getUTCFullYear(),A.getUTCMonth(),A.getUTCDate()]:[A.getFullYear(),A.getMonth(),A.getDate()]}function Rr(y){var A,D,R=[],N,K,oe;if(!y._d){for(N=Nn(y),y._w&&y._a[ai]==null&&y._a[gi]==null&&Xs(y),y._dayOfYear!=null&&(oe=Yi(y._a[xt],N[xt]),(y._dayOfYear>Ar(oe)||y._dayOfYear===0)&&(S(y)._overflowDayOfYear=!0),D=rr(oe,0,y._dayOfYear),y._a[gi]=D.getUTCMonth(),y._a[ai]=D.getUTCDate()),A=0;A<3&&y._a[A]==null;++A)y._a[A]=R[A]=N[A];for(;A<7;A++)y._a[A]=R[A]=y._a[A]==null?A===2?1:0:y._a[A];y._a[At]===24&&y._a[Qt]===0&&y._a[yi]===0&&y._a[$i]===0&&(y._nextDay=!0,y._a[At]=0),y._d=(y._useUTC?rr:$a).apply(null,R),K=y._useUTC?y._d.getUTCDay():y._d.getDay(),y._tzm!=null&&y._d.setUTCMinutes(y._d.getUTCMinutes()-y._tzm),y._nextDay&&(y._a[At]=24),y._w&&typeof y._w.d<"u"&&y._w.d!==K&&(S(y).weekdayMismatch=!0)}}function Xs(y){var A,D,R,N,K,oe,_e,Oe,We;A=y._w,A.GG!=null||A.W!=null||A.E!=null?(K=1,oe=4,D=Yi(A.GG,y._a[xt],Pr(st(),1,4).year),R=Yi(A.W,1),N=Yi(A.E,1),(N<1||N>7)&&(Oe=!0)):(K=y._locale._week.dow,oe=y._locale._week.doy,We=Pr(st(),K,oe),D=Yi(A.gg,y._a[xt],We.year),R=Yi(A.w,We.week),A.d!=null?(N=A.d,(N<0||N>6)&&(Oe=!0)):A.e!=null?(N=A.e+K,(A.e<0||A.e>6)&&(Oe=!0)):N=K),R<1||R>oi(D,K,oe)?S(y)._overflowWeeks=!0:Oe!=null?S(y)._overflowWeekday=!0:(_e=ts(D,R,N,K,oe),y._a[xt]=_e.year,y._dayOfYear=_e.dayOfYear)}i.ISO_8601=function(){},i.RFC_2822=function(){};function ls(y){if(y._f===i.ISO_8601){as(y);return}if(y._f===i.RFC_2822){Hi(y);return}y._a=[],S(y).empty=!0;var A=""+y._i,D,R,N,K,oe,_e=A.length,Oe=0,We,Pt;for(N=Y(y._f,y._locale).match(ne)||[],Pt=N.length,D=0;D<Pt;D++)K=N[D],R=(A.match(La(K,y))||[])[0],R&&(oe=A.substr(0,A.indexOf(R)),oe.length>0&&S(y).unusedInput.push(oe),A=A.slice(A.indexOf(R)+R.length),Oe+=R.length),Pe[K]?(R?S(y).empty=!1:S(y).unusedTokens.push(K),Fs(K,R,y)):y._strict&&!R&&S(y).unusedTokens.push(K);S(y).charsLeftOver=_e-Oe,A.length>0&&S(y).unusedInput.push(A),y._a[At]<=12&&S(y).bigHour===!0&&y._a[At]>0&&(S(y).bigHour=void 0),S(y).parsedDateParts=y._a.slice(0),S(y).meridiem=y._meridiem,y._a[At]=lo(y._locale,y._a[At],y._meridiem),We=S(y).era,We!==null&&(y._a[xt]=y._locale.erasConvertYear(We,y._a[xt])),Rr(y),zs(y)}function lo(y,A,D){var R;return D==null?A:y.meridiemHour!=null?y.meridiemHour(A,D):(y.isPM!=null&&(R=y.isPM(D),R&&A<12&&(A+=12),!R&&A===12&&(A=0)),A)}function Zs(y){var A,D,R,N,K,oe,_e=!1,Oe=y._f.length;if(Oe===0){S(y).invalidFormat=!0,y._d=new Date(NaN);return}for(N=0;N<Oe;N++)K=0,oe=!1,A=U({},y),y._useUTC!=null&&(A._useUTC=y._useUTC),A._f=y._f[N],ls(A),C(A)&&(oe=!0),K+=S(A).charsLeftOver,K+=S(A).unusedTokens.length*10,S(A).score=K,_e?K<R&&(R=K,D=A):(R==null||K<R||oe)&&(R=K,D=A,oe&&(_e=!0));E(y,D||A)}function Qs(y){if(!y._d){var A=Je(y._i),D=A.day===void 0?A.date:A.day;y._a=g([A.year,A.month,D,A.hour,A.minute,A.second,A.millisecond],function(R){return R&&parseInt(R,10)}),Rr(y)}}function ho(y){var A=new O(zs(Js(y)));return A._nextDay&&(A.add(1,"d"),A._nextDay=void 0),A}function Js(y){var A=y._i,D=y._f;return y._locale=y._locale||Ei(y._l),A===null||D===void 0&&A===""?I({nullInput:!0}):(typeof A=="string"&&(y._i=A=y._locale.preparse(A)),F(A)?new O(zs(A)):(d(A)?y._d=A:n(D)?Zs(y):D?ls(y):Bt(y),C(y)||(y._d=null),y))}function Bt(y){var A=y._i;u(A)?y._d=new Date(i.now()):d(A)?y._d=new Date(A.valueOf()):typeof A=="string"?oo(y):n(A)?(y._a=g(A.slice(0),function(D){return parseInt(D,10)}),Rr(y)):a(A)?Qs(y):f(A)?y._d=new Date(A):i.createFromInputFallback(y)}function hs(y,A,D,R,N){var K={};return(A===!0||A===!1)&&(R=A,A=void 0),(D===!0||D===!1)&&(R=D,D=void 0),(a(y)&&c(y)||n(y)&&y.length===0)&&(y=void 0),K._isAMomentObject=!0,K._useUTC=K._isUTC=N,K._l=D,K._i=y,K._f=A,K._strict=R,ho(K)}function st(y,A,D,R){return hs(y,A,D,R,!1)}var Bn=x("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var y=st.apply(null,arguments);return this.isValid()&&y.isValid()?y<this?this:y:I()}),Un=x("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var y=st.apply(null,arguments);return this.isValid()&&y.isValid()?y>this?this:y:I()});function Vn(y,A){var D,R;if(A.length===1&&n(A[0])&&(A=A[0]),!A.length)return st();for(D=A[0],R=1;R<A.length;++R)(!A[R].isValid()||A[R][y](D))&&(D=A[R]);return D}function uo(){var y=[].slice.call(arguments,0);return Vn("isBefore",y)}function co(){var y=[].slice.call(arguments,0);return Vn("isAfter",y)}var fo=function(){return Date.now?Date.now():+new Date},Lr=["year","quarter","month","week","day","hour","minute","second","millisecond"];function or(y){var A,D=!1,R,N=Lr.length;for(A in y)if(o(y,A)&&!(vt.call(Lr,A)!==-1&&(y[A]==null||!isNaN(y[A]))))return!1;for(R=0;R<N;++R)if(y[Lr[R]]){if(D)return!1;parseFloat(y[Lr[R]])!==He(y[Lr[R]])&&(D=!0)}return!0}function po(){return this._isValid}function mo(){return nt(NaN)}function lr(y){var A=Je(y),D=A.year||0,R=A.quarter||0,N=A.month||0,K=A.week||A.isoWeek||0,oe=A.day||0,_e=A.hour||0,Oe=A.minute||0,We=A.second||0,Pt=A.millisecond||0;this._isValid=or(A),this._milliseconds=+Pt+We*1e3+Oe*6e4+_e*1e3*60*60,this._days=+oe+K*7,this._months=+N+R*3+D*12,this._data={},this._locale=Ei(),this._bubble()}function xr(y){return y instanceof lr}function li(y){return y<0?Math.round(-1*y)*-1:Math.round(y)}function us(y,A,D){var R=Math.min(y.length,A.length),N=Math.abs(y.length-A.length),K=0,oe;for(oe=0;oe<R;oe++)He(y[oe])!==He(A[oe])&&K++;return K+N}function $n(y,A){ae(y,0,0,function(){var D=this.utcOffset(),R="+";return D<0&&(D=-D,R="-"),R+ie(~~(D/60),2)+A+ie(~~D%60,2)})}$n("Z",":"),$n("ZZ",""),Ce("Z",zr),Ce("ZZ",zr),it(["Z","ZZ"],function(y,A,D){D._useUTC=!0,D._tzm=en(zr,y)});var go=/([\+\-]|\d\d)/gi;function en(y,A){var D=(A||"").match(y),R,N,K;return D===null?null:(R=D[D.length-1]||[],N=(R+"").match(go)||["-",0,0],K=+(N[1]*60)+He(N[2]),K===0?0:N[0]==="+"?K:-K)}function xi(y,A){var D,R;return A._isUTC?(D=A.clone(),R=(F(y)||d(y)?y.valueOf():st(y).valueOf())-D.valueOf(),D._d.setTime(D._d.valueOf()+R),i.updateOffset(D,!1),D):st(y).local()}function Ut(y){return-Math.round(y._d.getTimezoneOffset())}i.updateOffset=function(){};function Gn(y,A,D){var R=this._offset||0,N;if(!this.isValid())return y!=null?this:NaN;if(y!=null){if(typeof y=="string"){if(y=en(zr,y),y===null)return this}else Math.abs(y)<16&&!D&&(y=y*60);return!this._isUTC&&A&&(N=Ut(this)),this._offset=y,this._isUTC=!0,N!=null&&this.add(N,"m"),R!==y&&(!A||this._changeInProgress?Mr(this,nt(y-R,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,i.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?R:Ut(this)}function yo(y,A){return y!=null?(typeof y!="string"&&(y=-y),this.utcOffset(y,A),this):-this.utcOffset()}function vo(y){return this.utcOffset(0,y)}function Eo(y){return this._isUTC&&(this.utcOffset(0,y),this._isUTC=!1,y&&this.subtract(Ut(this),"m")),this}function So(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var y=en(ks,this._i);y!=null?this.utcOffset(y):this.utcOffset(0,!0)}return this}function To(y){return this.isValid()?(y=y?st(y).utcOffset():0,(this.utcOffset()-y)%60===0):!1}function Mi(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Z(){if(!u(this._isDSTShifted))return this._isDSTShifted;var y={},A;return U(y,this),y=Js(y),y._a?(A=y._isUTC?m(y._a):st(y._a),this._isDSTShifted=this.isValid()&&us(y._a,A.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function ue(){return this.isValid()?!this._isUTC:!1}function se(){return this.isValid()?this._isUTC:!1}function be(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Fe=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,tt=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function nt(y,A){var D=y,R=null,N,K,oe;return xr(y)?D={ms:y._milliseconds,d:y._days,M:y._months}:f(y)||!isNaN(+y)?(D={},A?D[A]=+y:D.milliseconds=+y):(R=Fe.exec(y))?(N=R[1]==="-"?-1:1,D={y:0,d:He(R[ai])*N,h:He(R[At])*N,m:He(R[Qt])*N,s:He(R[yi])*N,ms:He(li(R[$i]*1e3))*N}):(R=tt.exec(y))?(N=R[1]==="-"?-1:1,D={y:Xe(R[2],N),M:Xe(R[3],N),w:Xe(R[4],N),d:Xe(R[5],N),h:Xe(R[6],N),m:Xe(R[7],N),s:Xe(R[8],N)}):D==null?D={}:typeof D=="object"&&("from"in D||"to"in D)&&(oe=_o(st(D.from),st(D.to)),D={},D.ms=oe.milliseconds,D.M=oe.months),K=new lr(D),xr(y)&&o(y,"_locale")&&(K._locale=y._locale),xr(y)&&o(y,"_isValid")&&(K._isValid=y._isValid),K}nt.fn=lr.prototype,nt.invalid=mo;function Xe(y,A){var D=y&&parseFloat(y.replace(",","."));return(isNaN(D)?0:D)*A}function cs(y,A){var D={};return D.months=A.month()-y.month()+(A.year()-y.year())*12,y.clone().add(D.months,"M").isAfter(A)&&--D.months,D.milliseconds=+A-+y.clone().add(D.months,"M"),D}function _o(y,A){var D;return y.isValid()&&A.isValid()?(A=xi(A,y),y.isBefore(A)?D=cs(y,A):(D=cs(A,y),D.milliseconds=-D.milliseconds,D.months=-D.months),D):{milliseconds:0,months:0}}function Vt(y,A){return function(D,R){var N,K;return R!==null&&!isNaN(+R)&&(X(A,"moment()."+A+"(period, number) is deprecated. Please use moment()."+A+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),K=D,D=R,R=K),N=nt(D,R),Mr(this,N,y),this}}function Mr(y,A,D,R){var N=A._milliseconds,K=li(A._days),oe=li(A._months);y.isValid()&&(R=R??!0,oe&&Vs(y,br(y,"Month")+oe*D),K&&Cr(y,"Date",br(y,"Date")+K*D),N&&y._d.setTime(y._d.valueOf()+N*D),R&&i.updateOffset(y,K||oe))}var Ao=Vt(1,"add"),hr=Vt(-1,"subtract");function wr(y){return typeof y=="string"||y instanceof String}function fs(y){return F(y)||d(y)||wr(y)||f(y)||bo(y)||at(y)||y===null||y===void 0}function at(y){var A=a(y)&&!c(y),D=!1,R=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],N,K,oe=R.length;for(N=0;N<oe;N+=1)K=R[N],D=D||o(y,K);return A&&D}function bo(y){var A=n(y),D=!1;return A&&(D=y.filter(function(R){return!f(R)&&wr(y)}).length===0),A&&D}function Hn(y){var A=a(y)&&!c(y),D=!1,R=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],N,K;for(N=0;N<R.length;N+=1)K=R[N],D=D||o(y,K);return A&&D}function ds(y,A){var D=y.diff(A,"days",!0);return D<-6?"sameElse":D<-1?"lastWeek":D<0?"lastDay":D<1?"sameDay":D<2?"nextDay":D<7?"nextWeek":"sameElse"}function Co(y,A){arguments.length===1&&(arguments[0]?fs(arguments[0])?(y=arguments[0],A=void 0):Hn(arguments[0])&&(A=arguments[0],y=void 0):(y=void 0,A=void 0));var D=y||st(),R=xi(D,this).startOf("day"),N=i.calendarFormat(this,R)||"sameElse",K=A&&(Q(A[N])?A[N].call(this,D):A[N]);return this.format(K||this.localeData().calendar(N,this,st(D)))}function Io(){return new O(this)}function Po(y,A){var D=F(y)?y:st(y);return this.isValid()&&D.isValid()?(A=ze(A)||"millisecond",A==="millisecond"?this.valueOf()>D.valueOf():D.valueOf()<this.clone().startOf(A).valueOf()):!1}function ps(y,A){var D=F(y)?y:st(y);return this.isValid()&&D.isValid()?(A=ze(A)||"millisecond",A==="millisecond"?this.valueOf()<D.valueOf():this.clone().endOf(A).valueOf()<D.valueOf()):!1}function wi(y,A,D,R){var N=F(y)?y:st(y),K=F(A)?A:st(A);return this.isValid()&&N.isValid()&&K.isValid()?(R=R||"()",(R[0]==="("?this.isAfter(N,D):!this.isBefore(N,D))&&(R[1]===")"?this.isBefore(K,D):!this.isAfter(K,D))):!1}function ms(y,A){var D=F(y)?y:st(y),R;return this.isValid()&&D.isValid()?(A=ze(A)||"millisecond",A==="millisecond"?this.valueOf()===D.valueOf():(R=D.valueOf(),this.clone().startOf(A).valueOf()<=R&&R<=this.clone().endOf(A).valueOf())):!1}function Yn(y,A){return this.isSame(y,A)||this.isAfter(y,A)}function gs(y,A){return this.isSame(y,A)||this.isBefore(y,A)}function Wn(y,A,D){var R,N,K;if(!this.isValid())return NaN;if(R=xi(y,this),!R.isValid())return NaN;switch(N=(R.utcOffset()-this.utcOffset())*6e4,A=ze(A),A){case"year":K=kr(this,R)/12;break;case"month":K=kr(this,R);break;case"quarter":K=kr(this,R)/3;break;case"second":K=(this-R)/1e3;break;case"minute":K=(this-R)/6e4;break;case"hour":K=(this-R)/36e5;break;case"day":K=(this-R-N)/864e5;break;case"week":K=(this-R-N)/6048e5;break;default:K=this-R}return D?K:Wt(K)}function kr(y,A){if(y.date()<A.date())return-kr(A,y);var D=(A.year()-y.year())*12+(A.month()-y.month()),R=y.clone().add(D,"months"),N,K;return A-R<0?(N=y.clone().add(D-1,"months"),K=(A-R)/(R-N)):(N=y.clone().add(D+1,"months"),K=(A-R)/(N-R)),-(D+K)||0}i.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",i.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function ys(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Kn(y){if(!this.isValid())return null;var A=y!==!0,D=A?this.clone().utc():this;return D.year()<0||D.year()>9999?Le(D,A?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Q(Date.prototype.toISOString)?A?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Le(D,"Z")):Le(D,A?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Or(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var y="moment",A="",D,R,N,K;return this.isLocal()||(y=this.utcOffset()===0?"moment.utc":"moment.parseZone",A="Z"),D="["+y+'("]',R=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",N="-MM-DD[T]HH:mm:ss.SSS",K=A+'[")]',this.format(D+R+N+K)}function Wi(y){y||(y=this.isUtc()?i.defaultFormatUtc:i.defaultFormat);var A=Le(this,y);return this.localeData().postformat(A)}function vs(y,A){return this.isValid()&&(F(y)&&y.isValid()||st(y).isValid())?nt({to:this,from:y}).locale(this.locale()).humanize(!A):this.localeData().invalidDate()}function Do(y){return this.from(st(),y)}function Ro(y,A){return this.isValid()&&(F(y)&&y.isValid()||st(y).isValid())?nt({from:this,to:y}).locale(this.locale()).humanize(!A):this.localeData().invalidDate()}function Lo(y){return this.to(st(),y)}function Fr(y){var A;return y===void 0?this._locale._abbr:(A=Ei(y),A!=null&&(this._locale=A),this)}var Nr=x("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(y){return y===void 0?this.localeData():this.locale(y)});function Es(){return this._locale}var Ss=1e3,Ki=60*Ss,Ts=60*Ki,jn=(365*400+97)*24*Ts;function mt(y,A){return(y%A+A)%A}function Rt(y,A,D){return y<100&&y>=0?new Date(y+400,A,D)-jn:new Date(y,A,D).valueOf()}function zn(y,A,D){return y<100&&y>=0?Date.UTC(y+400,A,D)-jn:Date.UTC(y,A,D)}function xo(y){var A,D;if(y=ze(y),y===void 0||y==="millisecond"||!this.isValid())return this;switch(D=this._isUTC?zn:Rt,y){case"year":A=D(this.year(),0,1);break;case"quarter":A=D(this.year(),this.month()-this.month()%3,1);break;case"month":A=D(this.year(),this.month(),1);break;case"week":A=D(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":A=D(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":A=D(this.year(),this.month(),this.date());break;case"hour":A=this._d.valueOf(),A-=mt(A+(this._isUTC?0:this.utcOffset()*Ki),Ts);break;case"minute":A=this._d.valueOf(),A-=mt(A,Ki);break;case"second":A=this._d.valueOf(),A-=mt(A,Ss);break}return this._d.setTime(A),i.updateOffset(this,!0),this}function qn(y){var A,D;if(y=ze(y),y===void 0||y==="millisecond"||!this.isValid())return this;switch(D=this._isUTC?zn:Rt,y){case"year":A=D(this.year()+1,0,1)-1;break;case"quarter":A=D(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":A=D(this.year(),this.month()+1,1)-1;break;case"week":A=D(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":A=D(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":A=D(this.year(),this.month(),this.date()+1)-1;break;case"hour":A=this._d.valueOf(),A+=Ts-mt(A+(this._isUTC?0:this.utcOffset()*Ki),Ts)-1;break;case"minute":A=this._d.valueOf(),A+=Ki-mt(A,Ki)-1;break;case"second":A=this._d.valueOf(),A+=Ss-mt(A,Ss)-1;break}return this._d.setTime(A),i.updateOffset(this,!0),this}function Mo(){return this._d.valueOf()-(this._offset||0)*6e4}function tn(){return Math.floor(this.valueOf()/1e3)}function Br(){return new Date(this.valueOf())}function rn(){var y=this;return[y.year(),y.month(),y.date(),y.hour(),y.minute(),y.second(),y.millisecond()]}function ur(){var y=this;return{years:y.year(),months:y.month(),date:y.date(),hours:y.hours(),minutes:y.minutes(),seconds:y.seconds(),milliseconds:y.milliseconds()}}function Ur(){return this.isValid()?this.toISOString():null}function Vr(){return C(this)}function _s(){return E({},S(this))}function cr(){return S(this).overflow}function wo(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}ae("N",0,0,"eraAbbr"),ae("NN",0,0,"eraAbbr"),ae("NNN",0,0,"eraAbbr"),ae("NNNN",0,0,"eraName"),ae("NNNNN",0,0,"eraNarrow"),ae("y",["y",1],"yo","eraYear"),ae("y",["yy",2],0,"eraYear"),ae("y",["yyy",3],0,"eraYear"),ae("y",["yyyy",4],0,"eraYear"),Ce("N",kt),Ce("NN",kt),Ce("NNN",kt),Ce("NNNN",Ye),Ce("NNNNN",Bo),it(["N","NN","NNN","NNNN","NNNNN"],function(y,A,D,R){var N=D._locale.erasParse(y,R,D._strict);N?S(D).era=N:S(D).invalidEra=y}),Ce("y",Di),Ce("yy",Di),Ce("yyy",Di),Ce("yyyy",Di),Ce("yo",Uo),it(["y","yy","yyy","yyyy"],xt),it(["yo"],function(y,A,D,R){var N;D._locale._eraYearOrdinalRegex&&(N=y.match(D._locale._eraYearOrdinalRegex)),D._locale.eraYearOrdinalParse?A[xt]=D._locale.eraYearOrdinalParse(y,N):A[xt]=parseInt(y,10)});function ko(y,A){var D,R,N,K=this._eras||Ei("en")._eras;for(D=0,R=K.length;D<R;++D)switch(typeof K[D].since==="string"&&(N=i(K[D].since).startOf("day"),K[D].since=N.valueOf()),typeof K[D].until){case"undefined":K[D].until=1/0;break;case"string":N=i(K[D].until).startOf("day").valueOf(),K[D].until=N.valueOf();break}return K}function Oo(y,A,D){var R,N,K=this.eras(),oe,_e,Oe;for(y=y.toUpperCase(),R=0,N=K.length;R<N;++R)if(oe=K[R].name.toUpperCase(),_e=K[R].abbr.toUpperCase(),Oe=K[R].narrow.toUpperCase(),D)switch(A){case"N":case"NN":case"NNN":if(_e===y)return K[R];break;case"NNNN":if(oe===y)return K[R];break;case"NNNNN":if(Oe===y)return K[R];break}else if([oe,_e,Oe].indexOf(y)>=0)return K[R]}function Fo(y,A){var D=y.since<=y.until?1:-1;return A===void 0?i(y.since).year():i(y.since).year()+(A-y.offset)*D}function No(){var y,A,D,R=this.localeData().eras();for(y=0,A=R.length;y<A;++y)if(D=this.clone().startOf("day").valueOf(),R[y].since<=D&&D<=R[y].until||R[y].until<=D&&D<=R[y].since)return R[y].name;return""}function As(){var y,A,D,R=this.localeData().eras();for(y=0,A=R.length;y<A;++y)if(D=this.clone().startOf("day").valueOf(),R[y].since<=D&&D<=R[y].until||R[y].until<=D&&D<=R[y].since)return R[y].narrow;return""}function $r(){var y,A,D,R=this.localeData().eras();for(y=0,A=R.length;y<A;++y)if(D=this.clone().startOf("day").valueOf(),R[y].since<=D&&D<=R[y].until||R[y].until<=D&&D<=R[y].since)return R[y].abbr;return""}function Xn(){var y,A,D,R,N=this.localeData().eras();for(y=0,A=N.length;y<A;++y)if(D=N[y].since<=N[y].until?1:-1,R=this.clone().startOf("day").valueOf(),N[y].since<=R&&R<=N[y].until||N[y].until<=R&&R<=N[y].since)return(this.year()-i(N[y].since).year())*D+N[y].offset;return this.year()}function B(y){return o(this,"_erasNameRegex")||sn.call(this),y?this._erasNameRegex:this._erasRegex}function dr(y){return o(this,"_erasAbbrRegex")||sn.call(this),y?this._erasAbbrRegex:this._erasRegex}function bs(y){return o(this,"_erasNarrowRegex")||sn.call(this),y?this._erasNarrowRegex:this._erasRegex}function kt(y,A){return A.erasAbbrRegex(y)}function Ye(y,A){return A.erasNameRegex(y)}function Bo(y,A){return A.erasNarrowRegex(y)}function Uo(y,A){return A._eraYearOrdinalRegex||Di}function sn(){var y=[],A=[],D=[],R=[],N,K,oe,_e,Oe,We=this.eras();for(N=0,K=We.length;N<K;++N)oe=ni(We[N].name),_e=ni(We[N].abbr),Oe=ni(We[N].narrow),A.push(oe),y.push(_e),D.push(Oe),R.push(oe),R.push(_e),R.push(Oe);this._erasRegex=new RegExp("^("+R.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+A.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+y.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+D.join("|")+")","i")}ae(0,["gg",2],0,function(){return this.weekYear()%100}),ae(0,["GG",2],0,function(){return this.isoWeekYear()%100});function hi(y,A){ae(0,[y,y.length],0,A)}hi("gggg","weekYear"),hi("ggggg","weekYear"),hi("GGGG","isoWeekYear"),hi("GGGGG","isoWeekYear"),Ce("G",tr),Ce("g",tr),Ce("GG",Se,qe),Ce("gg",Se,qe),Ce("GGGG",Ui,Dt),Ce("gggg",Ui,Dt),Ce("GGGGG",Pi,St),Ce("ggggg",Pi,St),_r(["gggg","ggggg","GGGG","GGGGG"],function(y,A,D,R){A[R.substr(0,2)]=He(y)}),_r(["gg","GG"],function(y,A,D,R){A[R]=i.parseTwoDigitYear(y)});function Vo(y){return Zn.call(this,y,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function $o(y){return Zn.call(this,y,this.isoWeek(),this.isoWeekday(),1,4)}function Go(){return oi(this.year(),1,4)}function Ho(){return oi(this.isoWeekYear(),1,4)}function Yo(){var y=this.localeData()._week;return oi(this.year(),y.dow,y.doy)}function Si(){var y=this.localeData()._week;return oi(this.weekYear(),y.dow,y.doy)}function Zn(y,A,D,R,N){var K;return y==null?Pr(this,R,N).year:(K=oi(y,R,N),A>K&&(A=K),Wo.call(this,y,A,D,R,N))}function Wo(y,A,D,R,N){var K=ts(y,A,D,R,N),oe=rr(K.year,0,K.dayOfYear);return this.year(oe.getUTCFullYear()),this.month(oe.getUTCMonth()),this.date(oe.getUTCDate()),this}ae("Q",0,"Qo","quarter"),Ce("Q",_t),it("Q",function(y,A){A[gi]=(He(y)-1)*3});function Ko(y){return y==null?Math.ceil((this.month()+1)/3):this.month((y-1)*3+this.month()%3)}ae("D",["DD",2],"Do","date"),Ce("D",Se,Vi),Ce("DD",Se,qe),Ce("Do",function(y,A){return y?A._dayOfMonthOrdinalParse||A._ordinalParse:A._dayOfMonthOrdinalParseLenient}),it(["D","DD"],ai),it("Do",function(y,A){A[ai]=He(y.match(Se)[0])});var Qn=ir("Date",!0);ae("DDD",["DDDD",3],"DDDo","dayOfYear"),Ce("DDD",pt),Ce("DDDD",Yt),it(["DDD","DDDD"],function(y,A,D){D._dayOfYear=He(y)});function jo(y){var A=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return y==null?A:this.add(y-A,"d")}ae("m",["mm",2],0,"minute"),Ce("m",Se,qr),Ce("mm",Se,qe),it(["m","mm"],Qt);var Ti=ir("Minutes",!1);ae("s",["ss",2],0,"second"),Ce("s",Se,qr),Ce("ss",Se,qe),it(["s","ss"],yi);var zo=ir("Seconds",!1);ae("S",0,0,function(){return~~(this.millisecond()/100)}),ae(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),ae(0,["SSS",3],0,"millisecond"),ae(0,["SSSS",4],0,function(){return this.millisecond()*10}),ae(0,["SSSSS",5],0,function(){return this.millisecond()*100}),ae(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),ae(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),ae(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),ae(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),Ce("S",pt,_t),Ce("SS",pt,qe),Ce("SSS",pt,Yt);var ki,Jn;for(ki="SSSS";ki.length<=9;ki+="S")Ce(ki,Di);function qo(y,A){A[$i]=He(("0."+y)*1e3)}for(ki="S";ki.length<=9;ki+="S")it(ki,qo);Jn=ir("Milliseconds",!1),ae("z",0,0,"zoneAbbr"),ae("zz",0,0,"zoneName");function Xo(){return this._isUTC?"UTC":""}function ji(){return this._isUTC?"Coordinated Universal Time":""}var ye=O.prototype;ye.add=Ao,ye.calendar=Co,ye.clone=Io,ye.diff=Wn,ye.endOf=qn,ye.format=Wi,ye.from=vs,ye.fromNow=Do,ye.to=Ro,ye.toNow=Lo,ye.get=ka,ye.invalidAt=cr,ye.isAfter=Po,ye.isBefore=ps,ye.isBetween=wi,ye.isSame=ms,ye.isSameOrAfter=Yn,ye.isSameOrBefore=gs,ye.isValid=Vr,ye.lang=Nr,ye.locale=Fr,ye.localeData=Es,ye.max=Un,ye.min=Bn,ye.parsingFlags=_s,ye.set=Qr,ye.startOf=xo,ye.subtract=hr,ye.toArray=rn,ye.toObject=ur,ye.toDate=Br,ye.toISOString=Kn,ye.inspect=Or,typeof Symbol<"u"&&Symbol.for!=null&&(ye[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),ye.toJSON=Ur,ye.toString=ys,ye.unix=tn,ye.valueOf=Mo,ye.creationData=wo,ye.eraName=No,ye.eraNarrow=As,ye.eraAbbr=$r,ye.eraYear=Xn,ye.year=vn,ye.isLeapYear=wa,ye.weekYear=Vo,ye.isoWeekYear=$o,ye.quarter=ye.quarters=Ko,ye.month=Jr,ye.daysInMonth=Va,ye.week=ye.weeks=bn,ye.isoWeek=ye.isoWeeks=Ga,ye.weeksInYear=Yo,ye.weeksInWeekYear=Si,ye.isoWeeksInYear=Go,ye.isoWeeksInISOWeekYear=Ho,ye.date=Qn,ye.day=ye.days=Xa,ye.weekday=Za,ye.isoWeekday=Qa,ye.dayOfYear=jo,ye.hour=ye.hours=io,ye.minute=ye.minutes=Ti,ye.second=ye.seconds=zo,ye.millisecond=ye.milliseconds=Jn,ye.utcOffset=Gn,ye.utc=vo,ye.local=Eo,ye.parseZone=So,ye.hasAlignedHourOffset=To,ye.isDST=Mi,ye.isLocal=ue,ye.isUtcOffset=se,ye.isUtc=be,ye.isUTC=be,ye.zoneAbbr=Xo,ye.zoneName=ji,ye.dates=x("dates accessor is deprecated. Use date instead.",Qn),ye.months=x("months accessor is deprecated. Use month instead",Jr),ye.years=x("years accessor is deprecated. Use year instead",vn),ye.zone=x("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",yo),ye.isDSTShifted=x("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Z);function Zo(y){return st(y*1e3)}function Jt(){return st.apply(null,arguments).parseZone()}function ea(y){return y}var et=re.prototype;et.calendar=z,et.longDateFormat=le,et.invalidDate=Ee,et.ordinal=Ie,et.preparse=ea,et.postformat=ea,et.relativeTime=Ve,et.pastFuture=dt,et.set=ee,et.eras=ko,et.erasParse=Oo,et.erasConvertYear=Fo,et.erasAbbrRegex=dr,et.erasNameRegex=B,et.erasNarrowRegex=bs,et.months=Ba,et.monthsShort=Ua,et.monthsParse=Tn,et.monthsRegex=es,et.monthsShortRegex=_n,et.week=Gs,et.firstDayOfYear=An,et.firstDayOfWeek=sr,et.weekdays=Ka,et.weekdaysMin=za,et.weekdaysShort=ja,et.weekdaysParse=qa,et.weekdaysRegex=Ja,et.weekdaysShortRegex=ft,et.weekdaysMinRegex=ut,et.isPM=to,et.meridiem=It;function Cs(y,A,D,R){var N=Ei(),K=m().set(R,A);return N[D](K,y)}function ta(y,A,D){if(f(y)&&(A=y,y=void 0),y=y||"",A!=null)return Cs(y,A,D,"month");var R,N=[];for(R=0;R<12;R++)N[R]=Cs(y,R,D,"month");return N}function nn(y,A,D,R){typeof y=="boolean"?(f(A)&&(D=A,A=void 0),A=A||""):(A=y,D=A,y=!1,f(A)&&(D=A,A=void 0),A=A||"");var N=Ei(),K=y?N._week.dow:0,oe,_e=[];if(D!=null)return Cs(A,(D+K)%7,R,"day");for(oe=0;oe<7;oe++)_e[oe]=Cs(A,(oe+K)%7,R,"day");return _e}function ia(y,A){return ta(y,A,"months")}function ra(y,A){return ta(y,A,"monthsShort")}function Qo(y,A,D){return nn(y,A,D,"weekdays")}function Jo(y,A,D){return nn(y,A,D,"weekdaysShort")}function an(y,A,D){return nn(y,A,D,"weekdaysMin")}vi("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(y){var A=y%10,D=He(y%100/10)===1?"th":A===1?"st":A===2?"nd":A===3?"rd":"th";return y+D}}),i.lang=x("moment.lang is deprecated. Use moment.locale instead.",vi),i.langData=x("moment.langData is deprecated. Use moment.localeData instead.",Ei);var $t=Math.abs;function Is(){var y=this._data;return this._milliseconds=$t(this._milliseconds),this._days=$t(this._days),this._months=$t(this._months),y.milliseconds=$t(y.milliseconds),y.seconds=$t(y.seconds),y.minutes=$t(y.minutes),y.hours=$t(y.hours),y.months=$t(y.months),y.years=$t(y.years),this}function sa(y,A,D,R){var N=nt(A,D);return y._milliseconds+=R*N._milliseconds,y._days+=R*N._days,y._months+=R*N._months,y._bubble()}function na(y,A){return sa(this,y,A,1)}function el(y,A){return sa(this,y,A,-1)}function ui(y){return y<0?Math.floor(y):Math.ceil(y)}function on(){var y=this._milliseconds,A=this._days,D=this._months,R=this._data,N,K,oe,_e,Oe;return y>=0&&A>=0&&D>=0||y<=0&&A<=0&&D<=0||(y+=ui(Ot(D)+A)*864e5,A=0,D=0),R.milliseconds=y%1e3,N=Wt(y/1e3),R.seconds=N%60,K=Wt(N/60),R.minutes=K%60,oe=Wt(K/60),R.hours=oe%24,A+=Wt(oe/24),Oe=Wt(Oi(A)),D+=Oe,A-=ui(Ot(Oe)),_e=Wt(D/12),D%=12,R.days=A,R.months=D,R.years=_e,this}function Oi(y){return y*4800/146097}function Ot(y){return y*146097/4800}function tl(y){if(!this.isValid())return NaN;var A,D,R=this._milliseconds;if(y=ze(y),y==="month"||y==="quarter"||y==="year")switch(A=this._days+R/864e5,D=this._months+Oi(A),y){case"month":return D;case"quarter":return D/3;case"year":return D/12}else switch(A=this._days+Math.round(Ot(this._months)),y){case"week":return A/7+R/6048e5;case"day":return A+R/864e5;case"hour":return A*24+R/36e5;case"minute":return A*1440+R/6e4;case"second":return A*86400+R/1e3;case"millisecond":return Math.floor(A*864e5)+R;default:throw new Error("Unknown unit "+y)}}function ci(y){return function(){return this.as(y)}}var ln=ci("ms"),Gr=ci("s"),Fi=ci("m"),aa=ci("h"),il=ci("d"),Ps=ci("w"),rl=ci("M"),oa=ci("Q"),Lt=ci("y"),hn=ln;function la(){return nt(this)}function fi(y){return y=ze(y),this.isValid()?this[y+"s"]():NaN}function _i(y){return function(){return this.isValid()?this._data[y]:NaN}}var Ds=_i("milliseconds"),zi=_i("seconds"),ha=_i("minutes"),wt=_i("hours"),un=_i("days"),sl=_i("months"),nl=_i("years");function al(){return Wt(this.days()/7)}var ei=Math.round,pr={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Hr(y,A,D,R,N){return N.relativeTime(A||1,!!D,y,R)}function ua(y,A,D,R){var N=nt(y).abs(),K=ei(N.as("s")),oe=ei(N.as("m")),_e=ei(N.as("h")),Oe=ei(N.as("d")),We=ei(N.as("M")),Pt=ei(N.as("w")),Ai=ei(N.as("y")),bi=K<=D.ss&&["s",K]||K<D.s&&["ss",K]||oe<=1&&["m"]||oe<D.m&&["mm",oe]||_e<=1&&["h"]||_e<D.h&&["hh",_e]||Oe<=1&&["d"]||Oe<D.d&&["dd",Oe];return D.w!=null&&(bi=bi||Pt<=1&&["w"]||Pt<D.w&&["ww",Pt]),bi=bi||We<=1&&["M"]||We<D.M&&["MM",We]||Ai<=1&&["y"]||["yy",Ai],bi[2]=A,bi[3]=+y>0,bi[4]=R,Hr.apply(null,bi)}function ol(y){return y===void 0?ei:typeof y=="function"?(ei=y,!0):!1}function ll(y,A){return pr[y]===void 0?!1:A===void 0?pr[y]:(pr[y]=A,y==="s"&&(pr.ss=A-1),!0)}function Yr(y,A){if(!this.isValid())return this.localeData().invalidDate();var D=!1,R=pr,N,K;return typeof y=="object"&&(A=y,y=!1),typeof y=="boolean"&&(D=y),typeof A=="object"&&(R=Object.assign({},pr,A),A.s!=null&&A.ss==null&&(R.ss=A.s-1)),N=this.localeData(),K=ua(this,!D,R,N),D&&(K=N.pastFuture(+this,K)),N.postformat(K)}var cn=Math.abs;function mr(y){return(y>0)-(y<0)||+y}function gr(){if(!this.isValid())return this.localeData().invalidDate();var y=cn(this._milliseconds)/1e3,A=cn(this._days),D=cn(this._months),R,N,K,oe,_e=this.asSeconds(),Oe,We,Pt,Ai;return _e?(R=Wt(y/60),N=Wt(R/60),y%=60,R%=60,K=Wt(D/12),D%=12,oe=y?y.toFixed(3).replace(/\.?0+$/,""):"",Oe=_e<0?"-":"",We=mr(this._months)!==mr(_e)?"-":"",Pt=mr(this._days)!==mr(_e)?"-":"",Ai=mr(this._milliseconds)!==mr(_e)?"-":"",Oe+"P"+(K?We+K+"Y":"")+(D?We+D+"M":"")+(A?Pt+A+"D":"")+(N||R||y?"T":"")+(N?Ai+N+"H":"")+(R?Ai+R+"M":"")+(y?Ai+oe+"S":"")):"P0D"}var Ke=lr.prototype;Ke.isValid=po,Ke.abs=Is,Ke.add=na,Ke.subtract=el,Ke.as=tl,Ke.asMilliseconds=ln,Ke.asSeconds=Gr,Ke.asMinutes=Fi,Ke.asHours=aa,Ke.asDays=il,Ke.asWeeks=Ps,Ke.asMonths=rl,Ke.asQuarters=oa,Ke.asYears=Lt,Ke.valueOf=hn,Ke._bubble=on,Ke.clone=la,Ke.get=fi,Ke.milliseconds=Ds,Ke.seconds=zi,Ke.minutes=ha,Ke.hours=wt,Ke.days=un,Ke.weeks=al,Ke.months=sl,Ke.years=nl,Ke.humanize=Yr,Ke.toISOString=gr,Ke.toString=gr,Ke.toJSON=gr,Ke.locale=Fr,Ke.localeData=Es,Ke.toIsoString=x("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",gr),Ke.lang=Nr,ae("X",0,0,"unix"),ae("x",0,0,"valueOf"),Ce("x",tr),Ce("X",Ra),it("X",function(y,A,D){D._d=new Date(parseFloat(y)*1e3)}),it("x",function(y,A,D){D._d=new Date(He(y))});return i.version="2.30.1",s(st),i.fn=ye,i.min=uo,i.max=co,i.now=fo,i.utc=m,i.unix=Zo,i.months=ia,i.isDate=d,i.locale=vi,i.invalid=I,i.duration=nt,i.isMoment=F,i.weekdays=Qo,i.parseZone=Jt,i.localeData=Ei,i.isDuration=xr,i.monthsShort=ra,i.weekdaysMin=an,i.defineLocale=ss,i.updateLocale=Nt,i.locales=jt,i.weekdaysShort=Jo,i.normalizeUnits=ze,i.relativeTimeRounding=ol,i.relativeTimeThreshold=ll,i.calendarFormat=ds,i.prototype=ye,i.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},i}))})(moment$2)),moment$2.exports}var jalaaliJs,hasRequiredJalaaliJs;function requireJalaaliJs(){if(hasRequiredJalaaliJs)return jalaaliJs;hasRequiredJalaaliJs=1,jalaaliJs={toJalaali:e,toGregorian:t,isValidJalaaliDate:i,isLeapJalaaliYear:s,jalaaliMonthLength:n,jalCal:o,j2d:c,d2j:u,g2d:f,d2g:d,jalaaliToDateObject:E,jalaaliWeek:g};var r=[-61,9,38,199,426,686,756,818,1111,1181,1210,1635,2060,2097,2192,2262,2324,2394,2456,3178];function e(S,b,C){return Object.prototype.toString.call(S)==="[object Date]"&&(C=S.getDate(),b=S.getMonth()+1,S=S.getFullYear()),u(f(S,b,C))}function t(S,b,C){return d(c(S,b,C))}function i(S,b,C){return S>=-61&&S<=3177&&b>=1&&b<=12&&C>=1&&C<=n(S,b)}function s(S){return a(S)===0}function n(S,b){return b<=6?31:b<=11||s(S)?30:29}function a(S){var b=r.length,C=r[0],I,L,k,U,O;if(S<C||S>=r[b-1])throw new Error("Invalid Jalaali year "+S);for(O=1;O<b&&(I=r[O],L=I-C,!(S<I));O+=1)C=I;return U=S-C,L-U<6&&(U=U-L+m(L+4,33)*33),k=T(T(U+1,33)-1,4),k===-1&&(k=4),k}function o(S,b){var C=r.length,I=S+621,L=-14,k=r[0],U,O,F,G,x,$,X;if(S<k||S>=r[C-1])throw new Error("Invalid Jalaali year "+S);for(X=1;X<C&&(U=r[X],O=U-k,!(S<U));X+=1)L=L+m(O,33)*8+m(T(O,33),4),k=U;return $=S-k,L=L+m($,33)*8+m(T($,33)+3,4),T(O,33)===4&&O-$===4&&(L+=1),G=m(I,4)-m((m(I,100)+1)*3,4)-150,x=20+L-G,b?{gy:I,march:x}:(O-$<6&&($=$-O+m(O+4,33)*33),F=T(T($+1,33)-1,4),F===-1&&(F=4),{leap:F,gy:I,march:x})}function c(S,b,C){var I=o(S,!0);return f(I.gy,3,I.march)+(b-1)*31-m(b,7)*(b-7)+C-1}function u(S){var b=d(S).gy,C=b-621,I=o(C,!1),L=f(b,3,I.march),k,U,O;if(O=S-L,O>=0){if(O<=185)return U=1+m(O,31),k=T(O,31)+1,{jy:C,jm:U,jd:k};O-=186}else C-=1,O+=179,I.leap===1&&(O+=1);return U=7+m(O,30),k=T(O,30)+1,{jy:C,jm:U,jd:k}}function f(S,b,C){var I=m((S+m(b-8,6)+100100)*1461,4)+m(153*T(b+9,12)+2,5)+C-34840408;return I=I-m(m(S+100100+m(b-8,6),100)*3,4)+752,I}function d(S){var b,C,I,L,k;return b=4*S+139361631,b=b+m(m(4*S+183187720,146097)*3,4)*4-3908,C=m(T(b,1461),4)*5+308,I=m(T(C,153),5)+1,L=T(m(C,153),12)+1,k=m(b,1461)-100100+m(8-L,6),{gy:k,gm:L,gd:I}}function g(S,b,C){var I=E(S,b,C).getDay(),L=I==6?0:-(I+1),k=6+L;return{saturday:u(c(S,b,C+L)),friday:u(c(S,b,C+k))}}function E(S,b,C,I,L,k,U){var O=t(S,b,C);return new Date(O.gy,O.gm-1,O.gd,I||0,L||0,k||0,U||0)}function m(S,b){return~~(S/b)}function T(S,b){return S-~~(S/b)*b}return jalaaliJs}var momentJalaali,hasRequiredMomentJalaali;function requireMomentJalaali(){if(hasRequiredMomentJalaali)return momentJalaali;hasRequiredMomentJalaali=1,momentJalaali=pe;var r=requireMoment(),e=requireJalaaliJs(),t=/(\[[^\[]*\])|(\\)?j(Mo|MM?M?M?|Do|DDDo|DD?D?D?|w[o|w]?|YYYYY|YYYY|YY|gg(ggg?)?|)|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|SS?S?|X|zz?|ZZ?|.)/g,i=/(\[[^\[]*\])|(\\)?(LTS?|LL?L?L?|l{1,4})/g,s=/\d\d?/,n=/\d{1,3}/,a=/\d{3}/,o=/\d{1,4}/,c=/[+\-]?\d{1,6}/,u=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,f=/Z|[\+\-]\d\d:?\d\d/i,d=/T/i,g=/[\+\-]?\d+(\.\d{1,3})?/,E={1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"},m={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"},T={jm:"jmonth",jmonths:"jmonth",jy:"jyear",jyears:"jyear"},S={},b="DDD w M D".split(" "),C="M D w".split(" "),I={jM:function(){return this.jMonth()+1},jMMM:function(Y){return this.localeData().jMonthsShort(this,Y)},jMMMM:function(Y){return this.localeData().jMonths(this,Y)},jD:function(){return this.jDate()},jDDD:function(){return this.jDayOfYear()},jw:function(){return this.jWeek()},jYY:function(){return O(this.jYear()%100,2)},jYYYY:function(){return O(this.jYear(),4)},jYYYYY:function(){return O(this.jYear(),5)},jgg:function(){return O(this.jWeekYear()%100,2)},jgggg:function(){return this.jWeekYear()},jggggg:function(){return O(this.jWeekYear(),5)}};function L(Y,q){return function(le){return O(Y.call(this,le),q)}}function k(Y,q){return function(le){return this.localeData().ordinal(Y.call(this,le),q)}}(function(){for(var Y;b.length;)Y=b.pop(),I["j"+Y+"o"]=k(I["j"+Y],Y);for(;C.length;)Y=C.pop(),I["j"+Y+Y]=L(I["j"+Y],2);I.jDDDD=L(I.jDDD,3)})();function U(Y,q){var le;for(le in q)q.hasOwnProperty(le)&&(Y[le]=q[le]);return Y}function O(Y,q){for(var le=Y+"";le.length<q;)le="0"+le;return le}function F(Y){return Object.prototype.toString.call(Y)==="[object Array]"}function G(Y){if(Y){var q=Y.toLowerCase();Y=T[q]||q}return Y}function x(Y,q,le,ce){var Ee=Y._d;isNaN(q)&&(Y._isValid=!1),Y._isUTC?Y._d=new Date(Date.UTC(q,le,ce,Ee.getUTCHours(),Ee.getUTCMinutes(),Ee.getUTCSeconds(),Ee.getUTCMilliseconds())):Y._d=new Date(q,le,ce,Ee.getHours(),Ee.getMinutes(),Ee.getSeconds(),Ee.getMilliseconds())}function $(Y){function q(){}return q.prototype=Y,new q}function X(Y){return Object.getPrototypeOf?Object.getPrototypeOf(Y):"".__proto__?Y.__proto__:Y.constructor.prototype}U(X(r.localeData()),{_jMonths:["Farvardin","Ordibehesht","Khordaad","Tir","Amordaad","Shahrivar","Mehr","Aabaan","Aazar","Dey","Bahman","Esfand"],jMonths:function(Y){return this._jMonths[Y.jMonth()]},_jMonthsShort:["Far","Ord","Kho","Tir","Amo","Sha","Meh","Aab","Aaz","Dey","Bah","Esf"],jMonthsShort:function(Y){return this._jMonthsShort[Y.jMonth()]},jMonthsParse:function(Y){var q,le,ce;for(this._jMonthsParse||(this._jMonthsParse=[]),q=0;q<12;q+=1)if(this._jMonthsParse[q]||(le=pe([2e3,(2+q)%12,25]),ce="^"+this.jMonths(le,"")+"|^"+this.jMonthsShort(le,""),this._jMonthsParse[q]=new RegExp(ce.replace(".",""),"i")),this._jMonthsParse[q].test(Y))return q}});function Q(Y){var q=Y.match(t),le=q.length,ce;for(ce=0;ce<le;ce+=1)I[q[ce]]&&(q[ce]=I[q[ce]]);return function(Ee){var ve="";for(ce=0;ce<le;ce+=1)ve+=q[ce]instanceof Function?"["+q[ce].call(Ee,Y)+"]":q[ce];return ve}}function ee(Y,q){switch(Y){case"jDDDD":return a;case"jYYYY":return o;case"jYYYYY":return c;case"jDDD":return n;case"jMMM":case"jMMMM":return u;case"jMM":case"jDD":case"jYY":case"jM":case"jD":return s;case"DDDD":return a;case"YYYY":return o;case"YYYYY":return c;case"S":case"SS":case"SSS":case"DDD":return n;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":return u;case"a":case"A":return r.localeData(q._l)._meridiemParse;case"X":return g;case"Z":case"ZZ":return f;case"T":return d;case"MM":case"DD":case"YY":case"HH":case"hh":case"mm":case"ss":case"M":case"D":case"d":case"H":case"h":case"m":case"s":return s;default:return new RegExp(Y.replace("\\",""))}}function te(Y,q,le){var ce,Ee=le._a;switch(Y){case"jM":case"jMM":Ee[1]=q==null?0:~~q-1;break;case"jMMM":case"jMMMM":ce=r.localeData(le._l).jMonthsParse(q),ce!=null?Ee[1]=ce:le._isValid=!1;break;case"jD":case"jDD":case"jDDD":case"jDDDD":q!=null&&(Ee[2]=~~q);break;case"jYY":Ee[0]=~~q+(~~q>47?1300:1400);break;case"jYYYY":case"jYYYYY":Ee[0]=~~q}q==null&&(le._isValid=!1)}function re(Y){var q,le,ce=Y._a[0],Ee=Y._a[1],ve=Y._a[2];return ce==null&&Ee==null&&ve==null?[0,0,1]:(ce=ce??0,Ee=Ee??0,ve=ve??1,(ve<1||ve>pe.jDaysInMonth(ce,Ee)||Ee<0||Ee>11)&&(Y._isValid=!1),q=Ae(ce,Ee,ve),le=ae(q.gy,q.gm,q.gd),isNaN(q.gy)&&(Y._isValid=!1),Y._jDiff=0,~~le.jy!==ce&&(Y._jDiff+=1),~~le.jm!==Ee&&(Y._jDiff+=1),~~le.jd!==ve&&(Y._jDiff+=1),[q.gy,q.gm,q.gd])}function me(Y){var q=Y._f.match(t),le=Y._i+"",ce=q.length,Ee,ve,Be;for(Y._a=[],Ee=0;Ee<ce;Ee+=1)ve=q[Ee],Be=(ee(ve,Y).exec(le)||[])[0],Be&&(le=le.slice(le.indexOf(Be)+Be.length)),I[ve]&&te(ve,Be,Y);return le&&(Y._il=le),re(Y)}function H(Y,q){var le=Y._f.length,ce,Ee,ve,Be,Ie,Me;if(le===0)return he(new Date(NaN));for(ce=0;ce<le;ce+=1)Ee=Y._f[ce],Ie=0,ve=he(Y._i,Ee,Y._l,Y._strict,q),ve.isValid()&&(Ie+=ve._jDiff,ve._il&&(Ie+=ve._il.length),(Me==null||Ie<Me)&&(Me=Ie,Be=ve));return Be}function z(Y){var q=Y._i+"",le="",ce="",Ee=Y._f.match(t),ve=Ee.length,Be,Ie,Me;for(Be=0;Be<ve;Be+=1)Ie=Ee[Be],Me=(ee(Ie,Y).exec(q)||[])[0],Me&&(q=q.slice(q.indexOf(Me)+Me.length)),I[Ie]instanceof Function||(ce+=Ie,Me&&(le+=Me));Y._i=le,Y._f=ce}function ie(Y,q,le){var ce=le-q,Ee=le-Y.day(),ve;return Ee>ce&&(Ee-=7),Ee<ce-7&&(Ee+=7),ve=pe(Y).add(Ee,"d"),{week:Math.ceil(ve.jDayOfYear()/7),year:ve.jYear()}}var ne=57724432199999;function he(Y,q,le,ce,Ee){typeof le=="boolean"&&(ce=le,le=void 0),q&&typeof q=="string"&&(q=Pe(q,r));var ve={_i:Y,_f:q,_l:le,_strict:ce},Be,Ie,Me,Ve=Y,dt=q;if(q){if(F(q))return H(ve,Ee);Be=me(ve),z(ve),q="YYYY-MM-DD-"+ve._f,Y=O(Be[0],4)+"-"+O(Be[1]+1,2)+"-"+O(Be[2],2)+"-"+ve._i}return Ee?Ie=r.utc(Y,q,le,ce):Ie=r(Y,q,le,ce),ve._isValid===!1&&(Ie._isValid=!1),Ie._jDiff=ve._jDiff||0,Me=$(pe.fn),U(Me,Ie),ce&&q&&Me.isValid()&&(Me._isValid=Me.format(dt)===Ve),Ie._d.getTime()>ne&&(Me._isValid=!1),Me}function pe(Y,q,le,ce){return he(Y,q,le,ce,!1)}U(pe,r),pe.fn=$(r.fn),pe.utc=function(Y,q,le,ce){return he(Y,q,le,ce,!0)},pe.unix=function(Y){return he(Y*1e3)};function Pe(Y,q){for(var le=5,ce=function(Ee){return q.localeData().longDateFormat(Ee)||Ee};le>0&&i.test(Y);)le-=1,Y=Y.replace(i,ce);return Y}pe.fn.format=function(Y){return Y&&(Y=Pe(Y,this),S[Y]||(S[Y]=Q(Y)),Y=S[Y](this)),r.fn.format.call(this,Y)},pe.fn.jYear=function(Y){var q,le,ce;return typeof Y=="number"?(le=ae(this.year(),this.month(),this.date()),q=Math.min(le.jd,pe.jDaysInMonth(Y,le.jm)),ce=Ae(Y,le.jm,q),x(this,ce.gy,ce.gm,ce.gd),r.updateOffset(this),this):ae(this.year(),this.month(),this.date()).jy},pe.fn.jMonth=function(Y){var q,le,ce;return Y!=null?typeof Y=="string"&&(Y=this.localeData().jMonthsParse(Y),typeof Y!="number")?this:(le=ae(this.year(),this.month(),this.date()),q=Math.min(le.jd,pe.jDaysInMonth(le.jy,Y)),this.jYear(le.jy+Re(Y,12)),Y=Le(Y,12),Y<0&&(Y+=12,this.jYear(this.jYear()-1)),ce=Ae(this.jYear(),Y,q),x(this,ce.gy,ce.gm,ce.gd),r.updateOffset(this),this):ae(this.year(),this.month(),this.date()).jm},pe.fn.jDate=function(Y){var q,le;return typeof Y=="number"?(q=ae(this.year(),this.month(),this.date()),le=Ae(q.jy,q.jm,Y),x(this,le.gy,le.gm,le.gd),r.updateOffset(this),this):ae(this.year(),this.month(),this.date()).jd},pe.fn.jDayOfYear=function(Y){var q=Math.round((pe(this).startOf("day")-pe(this).startOf("jYear"))/864e5)+1;return Y==null?q:this.add(Y-q,"d")},pe.fn.jWeek=function(Y){var q=ie(this,this.localeData()._week.dow,this.localeData()._week.doy).week;return Y==null?q:this.add((Y-q)*7,"d")},pe.fn.jWeekYear=function(Y){var q=ie(this,this.localeData()._week.dow,this.localeData()._week.doy).year;return Y==null?q:this.add(Y-q,"y")},pe.fn.add=function(Y,q){var le;return q!==null&&!isNaN(+q)&&(le=Y,Y=q,q=le),q=G(q),q==="jyear"?this.jYear(this.jYear()+Y):q==="jmonth"?this.jMonth(this.jMonth()+Y):(r.fn.add.call(this,Y,q),isNaN(this.jYear())&&(this._isValid=!1)),this},pe.fn.subtract=function(Y,q){var le;return q!==null&&!isNaN(+q)&&(le=Y,Y=q,q=le),q=G(q),q==="jyear"?this.jYear(this.jYear()-Y):q==="jmonth"?this.jMonth(this.jMonth()-Y):r.fn.subtract.call(this,Y,q),this},pe.fn.startOf=function(Y){return Y=G(Y),Y==="jyear"||Y==="jmonth"?(Y==="jyear"&&this.jMonth(0),this.jDate(1),this.hours(0),this.minutes(0),this.seconds(0),this.milliseconds(0),this):r.fn.startOf.call(this,Y)},pe.fn.endOf=function(Y){return Y=G(Y),Y===void 0||Y==="milisecond"?this:this.startOf(Y).add(1,Y==="isoweek"?"week":Y).subtract(1,"ms")},pe.fn.isSame=function(Y,q){return q=G(q),q==="jyear"||q==="jmonth"?r.fn.isSame.call(this.startOf(q),Y.startOf(q)):r.fn.isSame.call(this,Y,q)},pe.fn.clone=function(){return pe(this)},pe.fn.jYears=pe.fn.jYear,pe.fn.jMonths=pe.fn.jMonth,pe.fn.jDates=pe.fn.jDate,pe.fn.jWeeks=pe.fn.jWeek,pe.jDaysInMonth=function(Y,q){return Y+=Re(q,12),q=Le(q,12),q<0&&(q+=12,Y-=1),q<6?31:q<11||pe.jIsLeapYear(Y)?30:29},pe.jIsLeapYear=e.isLeapJalaaliYear,pe.loadPersian=function(Y){var q=Y!==void 0&&Y.hasOwnProperty("usePersianDigits")?Y.usePersianDigits:!1,le=Y!==void 0&&Y.hasOwnProperty("dialect")?Y.dialect:"persian";r.locale("fa"),r.updateLocale("fa",{months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:{persian:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_آدینه_شنبه".split("_"),"persian-modern":"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_")}[le],weekdaysShort:{persian:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_آدینه_شنبه".split("_"),"persian-modern":"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_")}[le],weekdaysMin:{persian:"ی_د_س_چ_پ_آ_ش".split("_"),"persian-modern":"ی_د_س_چ_پ_ج_ش".split("_")}[le],longDateFormat:{LT:"HH:mm",L:"jYYYY/jMM/jDD",LL:"jD jMMMM jYYYY",LLL:"jD jMMMM jYYYY LT",LLLL:"dddd، jD jMMMM jYYYY LT"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [ی پیش ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",m:"1 دقیقه",mm:"%d دقیقه",h:"1 ساعت",hh:"%d ساعت",d:"1 روز",dd:"%d روز",M:"1 ماه",MM:"%d ماه",y:"1 سال",yy:"%d سال"},preparse:function(ce){return q?ce.replace(/[۰-۹]/g,function(Ee){return m[Ee]}).replace(/،/g,","):ce},postformat:function(ce){return q?ce.replace(/\d/g,function(Ee){return E[Ee]}).replace(/,/g,"،"):ce},ordinal:"%dم",week:{dow:6,doy:12},meridiem:function(ce){return ce<12?"ق.ظ":"ب.ظ"},jMonths:{persian:"فروردین_اردیبهشت_خرداد_تیر_امرداد_شهریور_مهر_آبان_آذر_دی_بهمن_اسفند".split("_"),"persian-modern":"فروردین_اردیبهشت_خرداد_تیر_مرداد_شهریور_مهر_آبان_آذر_دی_بهمن_اسفند".split("_")}[le],jMonthsShort:{persian:"فرو_ارد_خرد_تیر_امر_شهر_مهر_آبا_آذر_دی_بهم_اسف".split("_"),"persian-modern":"فرو_ارد_خرد_تیر_مرد_شهر_مهر_آبا_آذر_دی_بهم_اسف".split("_")}[le]})},pe.loadPersian_dari=function(Y){var q=Y!==void 0&&Y.hasOwnProperty("usePersianDigits")?Y.usePersianDigits:!1,le=Y!==void 0&&Y.hasOwnProperty("dialect")?Y.dialect:"persian-dari";r.locale("fa-af"),r.updateLocale("fa-af",{months:"جنوری_فبروری_مارچ_اپریل_می_جون_جولای_آگست_سپتمبر_اکتوبر_نومبر_دیسمبر".split("_"),monthsShort:"جنوری_فبروری_مارچ_اپریل_می_جون_جولای_آگست_سپتمبر_اکتوبر_نومبر_دیسمبر".split("_"),weekdays:{persian:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_آدینه_شنبه".split("_"),"persian-modern":"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_")}[le],weekdaysShort:{persian:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_آدینه_شنبه".split("_"),"persian-modern":"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_")}[le],weekdaysMin:{persian:"ی_د_س_چ_پ_آ_ش".split("_"),"persian-modern":"ی_د_س_چ_پ_ج_ش".split("_")}[le],longDateFormat:{LT:"HH:mm",L:"jYYYY/jMM/jDD",LL:"jD jMMMM jYYYY",LLL:"jD jMMMM jYYYY LT",LLLL:"dddd، jD jMMMM jYYYY LT"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [ی پیش ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",m:"1 دقیقه",mm:"%d دقیقه",h:"1 ساعت",hh:"%d ساعت",d:"1 روز",dd:"%d روز",M:"1 ماه",MM:"%d ماه",y:"1 سال",yy:"%d سال"},preparse:function(ce){return q?ce.replace(/[۰-۹]/g,function(Ee){return m[Ee]}).replace(/،/g,","):ce},postformat:function(ce){return q?ce.replace(/\d/g,function(Ee){return E[Ee]}).replace(/,/g,"،"):ce},ordinal:"%dم",week:{dow:6,doy:12},meridiem:function(ce){return ce<12?"ق.ظ":"ب.ظ"},jMonths:{"persian-dari":"حمل_ثور_جوزا_سرطان_اسد_سنبله_میزان_عقرب_قوس_جدی_دلو_حوت".split("_"),"persian-modern-dari":"حمل_ثور_جوزا_سرطان_اسد_سنبله_میزان_عقرب_قوس_جدی_دلو_حوت".split("_")}[le],jMonthsShort:{"persian-dari":"حمل_ثور_جوزا_سرط_اسد_سنب_میز_عقر_قوس_جدی_دلو_حوت".split("_"),"persian-modern-dari":"حمل_ثور_جوزا_سرط_اسد_سنب_میز_عقر_قوس_جدی_دلو_حوت".split("_")}[le]})},pe.loadPashto=function(Y){var q=Y!==void 0&&Y.hasOwnProperty("usePersianDigits")?Y.usePersianDigits:!1,le=Y!==void 0&&Y.hasOwnProperty("dialect")?Y.dialect:"pashto";r.locale("ps-af"),r.updateLocale("ps-af",{months:"جنوری_فبروری_مارچ_اپریل_می_جون_جولای_آگست_سپتمبر_اکتوبر_نومبر_دیسمبر".split("_"),monthsShort:"جنوری_فبروری_مارچ_اپریل_می_جون_جولای_آگست_سپتمبر_اکتوبر_نومبر_دیسمبر".split("_"),weekdays:{pashto:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_آدینه_شنبه".split("_"),"pashto-modern":"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_")}[le],weekdaysShort:{pashto:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_آدینه_شنبه".split("_"),"pashto-modern":"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_")}[le],weekdaysMin:{pashto:"ی_د_س_چ_پ_آ_ش".split("_"),"pashto-modern":"ی_د_س_چ_پ_ج_ش".split("_")}[le],longDateFormat:{LT:"HH:mm",L:"jYYYY/jMM/jDD",LL:"jD jMMMM jYYYY",LLL:"jD jMMMM jYYYY LT",LLLL:"dddd، jD jMMMM jYYYY LT"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [ی پیش ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",m:"1 دقیقه",mm:"%d دقیقه",h:"1 ساعت",hh:"%d ساعت",d:"1 روز",dd:"%d روز",M:"1 ماه",MM:"%d ماه",y:"1 سال",yy:"%d سال"},preparse:function(ce){return q?ce.replace(/[۰-۹]/g,function(Ee){return m[Ee]}).replace(/،/g,","):ce},postformat:function(ce){return q?ce.replace(/\d/g,function(Ee){return E[Ee]}).replace(/,/g,"،"):ce},ordinal:"%dم",week:{dow:6,doy:12},meridiem:function(ce){return ce<12?"ق.ظ":"ب.ظ"},jMonths:{pashto:"وری_غویی_غبرګولی_چنګاښ_زمری_وږی_تله_لړم_لیندی_مرغومی_سلواغه_کب".split("_"),"pashto-modern":"وری_غویی_غبرګولی_چنګاښ_زمری_وږی_تله_لړم_لیندی_مرغومی_سلواغه_کب".split("_")}[le],jMonthsShort:{pashto:"وری_غوی_غبر_چنګ_زمر_وږی_لړم_لین_مرغ_سلو_کب".split("_"),"pashto-modern":"وری_غوی_غبر_چنګ_زمر_وږی_لړم_لین_مرغ_سلو_کب".split("_")}[le]})},pe.jConvert={toJalaali:ae,toGregorian:Ae};function ae(Y,q,le){try{var ce=e.toJalaali(Y,q+1,le);return ce.jm-=1,ce}catch{return{jy:NaN,jm:NaN,jd:NaN}}}function Ae(Y,q,le){try{var ce=e.toGregorian(Y,q+1,le);return ce.gm-=1,ce}catch{return{gy:NaN,gm:NaN,gd:NaN}}}function Re(Y,q){return~~(Y/q)}function Le(Y,q){return Y-~~(Y/q)*q}return momentJalaali}var momentJalaaliExports=requireMomentJalaali();const moment=getDefaultExportFromCjs$1(momentJalaaliExports);moment.loadPersian({dialect:"persian-modern",usePersianDigits:!0});const formatTime=r=>{const e=Math.floor(r/3600),t=Math.floor(r%3600/60),i=Math.floor(r%60),s=String(t).padStart(2,"0"),n=String(i).padStart(2,"0");return e>0?`${e}:${s}:${n}`:`${s}:${n}`};function RetrySvg({width:r=24}){return jsxRuntime.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M16.19 2H7.81C4.17 2 2 4.17 2 7.81V16.18C2 19.83 4.17 22 7.81 22H16.18C19.82 22 21.99 19.83 21.99 16.19V7.81C22 4.17 19.83 2 16.19 2ZM12 18.01C8.83 18.01 6.25 15.43 6.25 12.26C6.25 11.12 6.58 10.01 7.22 9.07C7.45 8.72 7.92 8.63 8.26 8.86C8.6 9.09 8.7 9.56 8.46 9.9C8 10.6 7.75 11.42 7.75 12.26C7.75 14.6 9.66 16.51 12 16.51C14.34 16.51 16.25 14.6 16.25 12.26C16.25 9.92 14.34 8.01 12 8.01C11.81 8.01 11.63 8.03 11.44 8.05L12 8.46C12.33 8.7 12.41 9.17 12.16 9.51C12.01 9.71 11.78 9.82 11.55 9.82C11.4 9.82 11.24 9.77 11.11 9.68L9.17 8.25C9.17 8.25 9.16 8.24 9.15 8.23C9.14 8.22 9.13 8.22 9.12 8.21C9.09 8.19 9.08 8.15 9.05 8.12C9.02 8.08 8.99 8.05 8.96 8C8.94 7.96 8.93 7.91 8.91 7.87C8.9 7.82 8.88 7.78 8.88 7.73C8.88 7.68 8.88 7.64 8.89 7.59C8.89 7.54 8.89 7.5 8.91 7.45C8.91 7.4 8.94 7.36 8.96 7.31C8.98 7.28 8.98 7.24 9.01 7.2C9.02 7.2 9.03 7.19 9.04 7.18C9.05 7.17 9.05 7.16 9.06 7.15L10.73 5.24C11 4.93 11.48 4.89 11.79 5.17C12.1 5.44 12.13 5.92 11.86 6.23L11.58 6.55C11.72 6.54 11.86 6.52 12.01 6.52C15.18 6.52 17.76 9.1 17.76 12.27C17.76 15.44 15.17 18.01 12 18.01Z",fill:"#fff"})})}var DeviceTypeEnum=(r=>(r.DESKTOP="desktop",r.MOBILE="mobile",r))(DeviceTypeEnum||{});function useDeviceType(){const[r,e]=React.useState(DeviceTypeEnum.MOBILE);React.useEffect(()=>(t(),window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}));const t=()=>{window.innerWidth>1024?e(DeviceTypeEnum.DESKTOP):e(DeviceTypeEnum.MOBILE)};return r}function MainControl({children:r}){return jsxRuntime.jsx("section",{children:jsxRuntime.jsx("div",{className:"sp:w-[5em] sp:h-[5em] sp:flex sp:justify-center sp:items-center sp:bg-black/40 sp:backdrop-blur-xs sp:rounded-full",children:r})})}function MinimizeSvg({width:r=24}){return jsxRuntime.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M16.19 2H7.81C4.17 2 2 4.17 2 7.81V16.18C2 19.83 4.17 22 7.81 22H16.18C19.82 22 21.99 19.83 21.99 16.19V7.81C22 4.17 19.83 2 16.19 2ZM10.22 21H7.91C5.2 21 3 18.8 3 16.09V13.78C3 13.37 3.34 13.03 3.75 13.03C4.16 13.03 4.5 13.37 4.5 13.78V16.09C4.5 17.97 6.03 19.5 7.91 19.5H10.22C10.63 19.5 10.97 19.84 10.97 20.25C10.97 20.66 10.64 21 10.22 21ZM10.22 4.5H7.91C6.03 4.5 4.5 6.03 4.5 7.91V10.22C4.5 10.63 4.16 10.97 3.75 10.97C3.34 10.97 3 10.64 3 10.22V7.91C3 5.2 5.2 3 7.91 3H10.22C10.63 3 10.97 3.34 10.97 3.75C10.97 4.16 10.64 4.5 10.22 4.5ZM21 16.09C21 18.8 18.8 21 16.09 21H14.7C14.29 21 13.95 20.66 13.95 20.25C13.95 19.84 14.29 19.5 14.7 19.5H16.09C17.97 19.5 19.5 17.97 19.5 16.09V14.7C19.5 14.29 19.84 13.95 20.25 13.95C20.66 13.95 21 14.29 21 14.7V16.09ZM21 10.22C21 10.63 20.66 10.97 20.25 10.97C19.84 10.97 19.5 10.63 19.5 10.22V7.91C19.5 6.03 17.97 4.5 16.09 4.5H13.78C13.37 4.5 13.03 4.16 13.03 3.75C13.03 3.34 13.36 3 13.78 3H16.09C18.8 3 21 5.2 21 7.91V10.22Z",fill:"#fff"})})}function VideoPlayerControl({canPlay:r,isPlayed:e,isMuted:t,isShowControl:i,isError:s,currentTime:n,duration:a,bufferedRanges:o,rates:c,onMaximize:u,onBackwardCurrentTime:f,onForwardCurrentTime:d,onDoubleClickInRight:g,onDoubleClickInLeft:E,onToggleMute:m,onTogglePlay:T,onChangeRate:S,onSeek:b,onTryAgain:C,isFullScreen:I}){const[L,k]=React.useState(!1),[U,O]=React.useState(!1),F=useDeviceType(),G=()=>{if(!a)return"";const x=n/a*100,$=`linear-gradient(to right, rgba(255,255,255,0.2) 0%, rgba(255,255,255,1) ${x}%, transparent ${x}%)`,X="rgba(0, 0, 0, 0.6)",Q="rgba(255, 255, 255, 0.1)";let ee=[`transparent ${x}%`];o.length>0&&o.forEach(re=>{const me=re.start/a*100,H=re.end/a*100;if(H<=x)return;const z=Math.max(me,x);ee.push(`${X} ${z}%`,`${X} ${H}%`)}),ee.push(`${Q} ${x}%`,`${Q} 100%`);const te=`linear-gradient(to right, ${ee.join(", ")})`;return`${$}, ${te}`};return React.useEffect(()=>{k(!0);const x=setTimeout(()=>{k(!1)},100);return()=>{clearTimeout(x)}},[t]),React.useEffect(()=>{O(!0);const x=setTimeout(()=>{O(!1)},100);return()=>{clearTimeout(x)}},[c]),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Transition,{enterAnimateClass:"fadeIn",exitAnimateClass:"fadeOut",isVisible:r&&!e,children:jsxRuntime.jsx("div",{className:"sp:absolute sp:top-0 sp:bottom-0 sp:left-0 sp:right-0 sp:flex sp:justify-center sp:items-center sp:cursor-pointer",children:jsxRuntime.jsx(MainControl,{children:jsxRuntime.jsx(PlayCircleSvg,{width:50})})})}),jsxRuntime.jsx(Transition,{enterAnimateClass:"fadeIn",exitAnimateClass:"fadeOut",isVisible:s,children:jsxRuntime.jsx("div",{onClick:()=>C?.(),className:"sp:absolute sp:top-0 sp:sp:bottom-0 sp:left-0 sp:right-0 sp:flex sp:justify-center sp:items-center sp:cursor-pointer sp:bg-black/30 sp:backdrop-blur-[1px]",children:jsxRuntime.jsx(MainControl,{children:jsxRuntime.jsx(RetrySvg,{width:50})})})}),jsxRuntime.jsx(Transition,{enterAnimateClass:"fadeIn",exitAnimateClass:"fadeOut",isVisible:!r&&!s,children:jsxRuntime.jsx("div",{className:"sp:absolute sp:top-0 sp:bottom-0 sp:left-0 sp:right-0 sp:flex sp:justify-center sp:items-center sp:cursor-pointer sp:bg-black/30 sp:backdrop-blur-[1px]",children:jsxRuntime.jsx(MainControl,{children:jsxRuntime.jsx(Loading,{classNames:"sp:w-[50px]"})})})}),r&&e?jsxRuntime.jsx("div",{onDoubleClick:()=>{g?.()},className:"sp:absolute sp:top-0 sp:bottom-0 sp:right-0 sp:w-[50%] sp:cursor-pointer"}):null,r&&e?jsxRuntime.jsx("div",{onDoubleClick:()=>{E?.()},className:"sp:absolute sp:top-0 sp:bottom-0 sp:left-0 sp:w-[50%] sp:cursor-pointer"}):null,jsxRuntime.jsx(Transition,{className:"sp:absolute sp:bottom-[1.5em] sp:left-[2em] sp:right-[2em] sp:flex sp:flex-col sp:gap-5 sp:items-center",enterAnimateClass:"fadeIn",exitAnimateClass:"fadeOut",speedAnimateClass:"faster",isVisible:r&&e&&i,children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"sp:w-full sp:px-[1em] sp:flex sp:items-center",onClick:x=>x.stopPropagation(),children:jsxRuntime.jsx("input",{type:"range",min:0,max:a,value:n,onChange:x=>b?.(parseFloat(x.target.value)),className:"sp:w-full sp:h-3 sp:appearance-none sp:cursor-pointer sp:rounded-full sp:backdrop-blur-xs sp:transition sp:duration-500 sp:bg-black/60",style:{direction:"ltr",backgroundImage:G(),backgroundSize:"100% 100%",outline:"none"}})}),jsxRuntime.jsxs("div",{onClick:x=>x.stopPropagation(),className:`sp:w-full sp:flex sp:justify-between sp:items-center sp:bg-black/40 sp:rounded-full sp:backdrop-blur-xs sp:transition sp:duration-500 sp:px-[1em] sp:py-[1em] ${F===DeviceTypeEnum.MOBILE?"sp:landscape:px-[1.2em]":""}`,children:[jsxRuntime.jsxs("div",{className:`sp:flex sp:gap-[1em] sp:items-center ${F===DeviceTypeEnum.MOBILE?"sp:landscape:gap-5":""}`,children:[jsxRuntime.jsx("div",{className:"sp:cursor-pointer",onClick:x=>{x.stopPropagation(),u?.()},children:I?jsxRuntime.jsx(MinimizeSvg,{width:30}):jsxRuntime.jsx(MaximizeSvg,{width:30})}),jsxRuntime.jsx("div",{className:"sp:min-w-5 sp:flex sp:items-center sp:justify-center sp:cursor-pointer",onMouseUp:x=>{x.stopPropagation()},onMouseDown:x=>{x.stopPropagation()},onTouchStart:x=>{x.stopPropagation()},onTouchEnd:x=>{x.stopPropagation()},onClick:x=>{x.stopPropagation(),S?.()},children:jsxRuntime.jsx(Transition,{enterAnimateClass:"heartBeat",exitAnimateClass:"heartBeat",speedAnimateClass:"faster",isVisible:!U,children:jsxRuntime.jsx("span",{className:"sp:text-white sp:font-bold sp:text-lg",children:lodashExports.first(lodashExports.filter(c,x=>x.active))?.label})})}),jsxRuntime.jsx("div",{className:"sp:cursor-pointer",onClick:x=>{x.stopPropagation(),m?.()},children:jsxRuntime.jsx(Transition,{enterAnimateClass:"heartBeat",exitAnimateClass:"heartBeat",speedAnimateClass:"faster",isVisible:!L,children:t?jsxRuntime.jsx(VolumeMuteSvg,{width:30}):jsxRuntime.jsx(VolumeUnMuteSvg,{width:30})})})]}),jsxRuntime.jsxs("div",{className:`sp:flex sp:gap-[1em] sp:items-center ${F===DeviceTypeEnum.MOBILE?"sp:landscape:gap-[1em]":""}`,children:[jsxRuntime.jsxs("div",{className:"sp:flex sp:gap-[0.3em] sp:items-center sp:rounded-full sp:border sp:border-white sp:px-3 sp:py-1",children:[jsxRuntime.jsx("span",{className:"sp:text-white sp:text-sm sp:tabular-nums",children:formatTime(a)}),jsxRuntime.jsx("span",{className:"sp:text-white sp:text-sm",children:"/"}),jsxRuntime.jsx("span",{className:"sp:text-white sp:text-sm sp:tabular-nums",children:formatTime(n)})]}),jsxRuntime.jsx("div",{className:"sp:cursor-pointer",onClick:x=>{x.stopPropagation(),d?.()},children:jsxRuntime.jsx(ForwardSvg,{width:30})}),jsxRuntime.jsx("div",{className:"sp:cursor-pointer",onClick:x=>{x.stopPropagation(),f?.()},children:jsxRuntime.jsx(BackwardSvg,{width:30})}),jsxRuntime.jsx("div",{className:"sp:cursor-pointer",onClick:x=>{x.stopPropagation(),T?.()},children:jsxRuntime.jsx(PauseSvg,{width:30})})]})]})]})})]})}var LIBVERSION="2.0.7",UA_MAX_LENGTH=500,USER_AGENT="user-agent",EMPTY="",UNKNOWN="?",TYPEOF={FUNCTION:"function",OBJECT:"object",STRING:"string",UNDEFINED:"undefined"},BROWSER="browser",CPU="cpu",DEVICE="device",ENGINE="engine",OS="os",RESULT="result",NAME="name",TYPE="type",VENDOR="vendor",VERSION="version",ARCHITECTURE="architecture",MAJOR="major",MODEL="model",CONSOLE="console",MOBILE="mobile",TABLET="tablet",SMARTTV="smarttv",WEARABLE="wearable",XR="xr",EMBEDDED="embedded",INAPP="inapp",BRANDS="brands",FORMFACTORS="formFactors",FULLVERLIST="fullVersionList",PLATFORM="platform",PLATFORMVER="platformVersion",BITNESS="bitness",CH="sec-ch-ua",CH_FULL_VER_LIST=CH+"-full-version-list",CH_ARCH=CH+"-arch",CH_BITNESS=CH+"-"+BITNESS,CH_FORM_FACTORS=CH+"-form-factors",CH_MOBILE=CH+"-"+MOBILE,CH_MODEL=CH+"-"+MODEL,CH_PLATFORM=CH+"-"+PLATFORM,CH_PLATFORM_VER=CH_PLATFORM+"-version",CH_ALL_VALUES=[BRANDS,FULLVERLIST,MOBILE,MODEL,PLATFORM,PLATFORMVER,ARCHITECTURE,FORMFACTORS,BITNESS],AMAZON="Amazon",APPLE="Apple",ASUS="ASUS",BLACKBERRY="BlackBerry",GOOGLE="Google",HUAWEI="Huawei",LENOVO="Lenovo",HONOR="Honor",LG="LG",MICROSOFT="Microsoft",MOTOROLA="Motorola",NVIDIA="Nvidia",ONEPLUS="OnePlus",OPPO="OPPO",SAMSUNG="Samsung",SHARP="Sharp",SONY="Sony",XIAOMI="Xiaomi",ZEBRA="Zebra",CHROME="Chrome",CHROMIUM="Chromium",CHROMECAST="Chromecast",EDGE="Edge",FIREFOX="Firefox",OPERA="Opera",FACEBOOK="Facebook",SOGOU="Sogou",PREFIX_MOBILE="Mobile ",SUFFIX_BROWSER=" Browser",WINDOWS="Windows",isWindow=typeof window!==TYPEOF.UNDEFINED,NAVIGATOR=isWindow&&window.navigator?window.navigator:void 0,NAVIGATOR_UADATA=NAVIGATOR&&NAVIGATOR.userAgentData?NAVIGATOR.userAgentData:void 0,extend=function(r,e){var t={},i=e;if(!isExtensions(e)){i={};for(var s in e)for(var n in e[s])i[n]=e[s][n].concat(i[n]?i[n]:[])}for(var a in r)t[a]=i[a]&&i[a].length%2===0?i[a].concat(r[a]):r[a];return t},enumerize=function(r){for(var e={},t=0;t<r.length;t++)e[r[t].toUpperCase()]=r[t];return e},has=function(r,e){if(typeof r===TYPEOF.OBJECT&&r.length>0){for(var t in r)if(lowerize(e)==lowerize(r[t]))return!0;return!1}return isString(r)?lowerize(e)==lowerize(r):!1},isExtensions=function(r,e){for(var t in r)return/^(browser|cpu|device|engine|os)$/.test(t)||(e?isExtensions(r[t]):!1)},isString=function(r){return typeof r===TYPEOF.STRING},itemListToArray=function(r){if(r){for(var e=[],t=strip(/\\?\"/g,r).split(","),i=0;i<t.length;i++)if(t[i].indexOf(";")>-1){var s=trim(t[i]).split(";v=");e[i]={brand:s[0],version:s[1]}}else e[i]=trim(t[i]);return e}},lowerize=function(r){return isString(r)?r.toLowerCase():r},majorize=function(r){return isString(r)?strip(/[^\d\.]/g,r).split(".")[0]:void 0},setProps=function(r){for(var e in r)if(r.hasOwnProperty(e)){var t=r[e];typeof t==TYPEOF.OBJECT&&t.length==2?this[t[0]]=t[1]:this[t]=void 0}return this},strip=function(r,e){return isString(e)?e.replace(r,EMPTY):e},stripQuotes=function(r){return strip(/\\?\"/g,r)},trim=function(r,e){return r=strip(/^\s\s*/,String(r)),typeof e===TYPEOF.UNDEFINED?r:r.substring(0,e)},rgxMapper=function(r,e){if(!(!r||!e))for(var t=0,i,s,n,a,o,c;t<e.length&&!o;){var u=e[t],f=e[t+1];for(i=s=0;i<u.length&&!o&&u[i];)if(o=u[i++].exec(r),o)for(n=0;n<f.length;n++)c=o[++s],a=f[n],typeof a===TYPEOF.OBJECT&&a.length>0?a.length===2?typeof a[1]==TYPEOF.FUNCTION?this[a[0]]=a[1].call(this,c):this[a[0]]=a[1]:a.length>=3&&(typeof a[1]===TYPEOF.FUNCTION&&!(a[1].exec&&a[1].test)?a.length>3?this[a[0]]=c?a[1].apply(this,a.slice(2)):void 0:this[a[0]]=c?a[1].call(this,c,a[2]):void 0:a.length==3?this[a[0]]=c?c.replace(a[1],a[2]):void 0:a.length==4?this[a[0]]=c?a[3].call(this,c.replace(a[1],a[2])):void 0:a.length>4&&(this[a[0]]=c?a[3].apply(this,[c.replace(a[1],a[2])].concat(a.slice(4))):void 0)):this[a]=c||void 0;t+=2}},strMapper=function(r,e){for(var t in e)if(typeof e[t]===TYPEOF.OBJECT&&e[t].length>0){for(var i=0;i<e[t].length;i++)if(has(e[t][i],r))return t===UNKNOWN?void 0:t}else if(has(e[t],r))return t===UNKNOWN?void 0:t;return e.hasOwnProperty("*")?e["*"]:r},windowsVersionMap={ME:"4.90","NT 3.51":"3.51","NT 4.0":"4.0",2e3:["5.0","5.01"],XP:["5.1","5.2"],Vista:"6.0",7:"6.1",8:"6.2","8.1":"6.3",10:["6.4","10.0"],NT:""},formFactorsMap={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":void 0},browserHintsMap={Chrome:"Google Chrome",Edge:"Microsoft Edge","Edge WebView2":"Microsoft Edge WebView2","Chrome WebView":"Android WebView","Chrome Headless":"HeadlessChrome","Huawei Browser":"HuaweiBrowser","MIUI Browser":"Miui Browser","Opera Mobi":"OperaMobile",Yandex:"YaBrowser"},defaultRegexes={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[VERSION,[NAME,PREFIX_MOBILE+"Chrome"]],[/webview.+edge\/([\w\.]+)/i],[VERSION,[NAME,EDGE+" WebView"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[VERSION,[NAME,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[NAME,VERSION],[/opios[\/ ]+([\w\.]+)/i],[VERSION,[NAME,OPERA+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[VERSION,[NAME,OPERA+" GX"]],[/\bopr\/([\w\.]+)/i],[VERSION,[NAME,OPERA]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[VERSION,[NAME,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[VERSION,[NAME,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(atlas|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:lg |qute)browser|palemoon)\/([-\w\.]+)/i,/(heytap|ovi|115|surf|qwant)browser\/([\d\.]+)/i,/(qwant)(?:ios|mobile)\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[NAME,VERSION],[/quark(?:pc)?\/([-\w\.]+)/i],[VERSION,[NAME,"Quark"]],[/\bddg\/([\w\.]+)/i],[VERSION,[NAME,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[VERSION,[NAME,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[VERSION,[NAME,"WeChat"]],[/konqueror\/([\w\.]+)/i],[VERSION,[NAME,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[VERSION,[NAME,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[VERSION,[NAME,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[VERSION,[NAME,"Smart "+LENOVO+SUFFIX_BROWSER]],[/(avast|avg)\/([\w\.]+)/i],[[NAME,/(.+)/,"$1 Secure"+SUFFIX_BROWSER],VERSION],[/\bfocus\/([\w\.]+)/i],[VERSION,[NAME,FIREFOX+" Focus"]],[/\bopt\/([\w\.]+)/i],[VERSION,[NAME,OPERA+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[VERSION,[NAME,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[VERSION,[NAME,"Dolphin"]],[/coast\/([\w\.]+)/i],[VERSION,[NAME,OPERA+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[VERSION,[NAME,"MIUI"+SUFFIX_BROWSER]],[/fxios\/([\w\.-]+)/i],[VERSION,[NAME,PREFIX_MOBILE+FIREFOX]],[/\bqihoobrowser\/?([\w\.]*)/i],[VERSION,[NAME,"360"]],[/\b(qq)\/([\w\.]+)/i],[[NAME,/(.+)/,"$1Browser"],VERSION],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[NAME,/(.+)/,"$1"+SUFFIX_BROWSER],VERSION],[/samsungbrowser\/([\w\.]+)/i],[VERSION,[NAME,SAMSUNG+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[VERSION,[NAME,SOGOU+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[NAME,SOGOU+" Mobile"],VERSION],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[NAME,VERSION],[/(lbbrowser|rekonq|steam(?= (clie|tenf|gameo)))/i],[NAME],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[VERSION,NAME],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[NAME,FACEBOOK],VERSION,[TYPE,INAPP]],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(bing)(?:web|sapphire)\/([\w\.]+)/i,/(instagram|snapchat|klarna)[\/ ]([-\w\.]+)/i],[NAME,VERSION,[TYPE,INAPP]],[/\bgsa\/([\w\.]+) .*safari\//i],[VERSION,[NAME,"GSA"],[TYPE,INAPP]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[VERSION,[NAME,"TikTok"],[TYPE,INAPP]],[/\[(linkedin)app\]/i],[NAME,[TYPE,INAPP]],[/(zalo(?:app)?)[\/\sa-z]*([\w\.-]+)/i],[[NAME,/(.+)/,"Zalo"],VERSION,[TYPE,INAPP]],[/(chromium)[\/ ]([-\w\.]+)/i],[NAME,VERSION],[/headlesschrome(?:\/([\w\.]+)| )/i],[VERSION,[NAME,CHROME+" Headless"]],[/wv\).+chrome\/([\w\.]+).+edgw\//i],[VERSION,[NAME,EDGE+" WebView2"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[NAME,CHROME+" WebView"],VERSION],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[VERSION,[NAME,"Android"+SUFFIX_BROWSER]],[/chrome\/([\w\.]+) mobile/i],[VERSION,[NAME,PREFIX_MOBILE+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[NAME,VERSION],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[VERSION,[NAME,PREFIX_MOBILE+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[NAME,PREFIX_MOBILE+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[VERSION,NAME],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[NAME,[VERSION,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[NAME,VERSION],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[NAME,PREFIX_MOBILE+FIREFOX],VERSION],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[NAME,"Netscape"],VERSION],[/(wolvic|librewolf)\/([\w\.]+)/i],[NAME,VERSION],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[VERSION,[NAME,FIREFOX+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+(?= .+rv\:.+gecko\/\d+)|[0-4][\w\.]+(?!.+compatible))/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[NAME,[VERSION,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[NAME,[VERSION,/[^\d\.]+./,EMPTY]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[ARCHITECTURE,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[ARCHITECTURE,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[ARCHITECTURE,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[ARCHITECTURE,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[ARCHITECTURE,"arm"]],[/ sun4\w[;\)]/i],[[ARCHITECTURE,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i,/((ppc|powerpc)(64)?)( mac|;|\))/i,/(?:osf1|[freopnt]{3,4}bsd) (alpha)/i],[[ARCHITECTURE,/ower/,EMPTY,lowerize]],[/mc680.0/i],[[ARCHITECTURE,"68k"]],[/winnt.+\[axp/i],[[ARCHITECTURE,"alpha"]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[MODEL,[VENDOR,SAMSUNG],[TYPE,TABLET]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr]|browser)[-\w]+)/i,/sec-(sgh\w+)/i],[MODEL,[VENDOR,SAMSUNG],[TYPE,MOBILE]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)[\/\);]/i],[MODEL,[VENDOR,APPLE],[TYPE,MOBILE]],[/\b(?:ios|apple\w+)\/.+[\(\/](ipad)/i,/\b(ipad)[\d,]*[;\] ].+(mac |i(pad)?)os/i],[MODEL,[VENDOR,APPLE],[TYPE,TABLET]],[/(macintosh);/i],[MODEL,[VENDOR,APPLE]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[MODEL,[VENDOR,SHARP],[TYPE,MOBILE]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[MODEL,[VENDOR,HONOR],[TYPE,TABLET]],[/honor([-\w ]+)[;\)]/i],[MODEL,[VENDOR,HONOR],[TYPE,MOBILE]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[MODEL,[VENDOR,HUAWEI],[TYPE,TABLET]],[/(?:huawei) ?([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][\dc][adnt]?)\b(?!.+d\/s)/i],[MODEL,[VENDOR,HUAWEI],[TYPE,MOBILE]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b(?:xiao)?((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[MODEL,/_/g," "],[VENDOR,XIAOMI],[TYPE,TABLET]],[/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/oid[^\)]+; (redmi[\-_ ]?(?:note|k)?[\w_ ]+|m?[12]\d[01]\d\w{3,6}|poco[\w ]+|(shark )?\w{3}-[ah]0|qin ?[1-3](s\+|ultra| pro)?)( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note|max|cc)?[_ ]?(?:\d{0,2}\w?)[_ ]?(?:plus|se|lite|pro)?( 5g|lte)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[MODEL,/_/g," "],[VENDOR,XIAOMI],[TYPE,MOBILE]],[/droid.+; (cph2[3-6]\d[13579]|((gm|hd)19|(ac|be|in|kb)20|(d[en]|eb|le|mt)21|ne22)[0-2]\d|p[g-k]\w[1m]10)\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[MODEL,[VENDOR,ONEPLUS],[TYPE,MOBILE]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[MODEL,[VENDOR,OPPO],[TYPE,MOBILE]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[MODEL,[VENDOR,strMapper,{OnePlus:["203","304","403","404","413","415"],"*":OPPO}],[TYPE,TABLET]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[MODEL,[VENDOR,"BLU"],[TYPE,MOBILE]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[MODEL,[VENDOR,"Vivo"],[TYPE,MOBILE]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[MODEL,[VENDOR,"Realme"],[TYPE,MOBILE]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[MODEL,[VENDOR,LENOVO],[TYPE,TABLET]],[/lenovo[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i],[MODEL,[VENDOR,LENOVO],[TYPE,MOBILE]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ]([\w\s]+)(\)| bui)/i,/((?:moto(?! 360)[-\w\(\) ]+|xt\d{3,4}[cgkosw\+]?[-\d]*|nexus 6)(?= bui|\)))/i],[MODEL,[VENDOR,MOTOROLA],[TYPE,MOBILE]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[MODEL,[VENDOR,MOTOROLA],[TYPE,TABLET]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[MODEL,[VENDOR,LG],[TYPE,TABLET]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch|webos))(\w+)/i,/\blg-?([\d\w]+) bui/i],[MODEL,[VENDOR,LG],[TYPE,MOBILE]],[/(nokia) (t[12][01])/i],[VENDOR,MODEL,[TYPE,TABLET]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*?))( bui|\)|;|\/)/i],[[MODEL,/_/g," "],[TYPE,MOBILE],[VENDOR,"Nokia"]],[/(pixel (c|tablet))\b/i],[MODEL,[VENDOR,GOOGLE],[TYPE,TABLET]],[/droid.+;(?: google)? (g(01[13]a|020[aem]|025[jn]|1b60|1f8f|2ybb|4s1m|576d|5nz6|8hhn|8vou|a02099|c15s|d1yq|e2ae|ec77|gh2x|kv4x|p4bc|pj41|r83y|tt9q|ur25|wvk6)|pixel[\d ]*a?( pro)?( xl)?( fold)?( \(5g\))?)( bui|\))/i],[MODEL,[VENDOR,GOOGLE],[TYPE,MOBILE]],[/(google) (pixelbook( go)?)/i],[VENDOR,MODEL],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-\w\w\d\d)(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[MODEL,[VENDOR,SONY],[TYPE,MOBILE]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[MODEL,"Xperia Tablet"],[VENDOR,SONY],[TYPE,TABLET]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[MODEL,[VENDOR,AMAZON],[TYPE,TABLET]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[MODEL,/(.+)/g,"Fire Phone $1"],[VENDOR,AMAZON],[TYPE,MOBILE]],[/(playbook);[-\w\),; ]+(rim)/i],[MODEL,VENDOR,[TYPE,TABLET]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/(?:blackberry|\(bb10;) (\w+)/i],[MODEL,[VENDOR,BLACKBERRY],[TYPE,MOBILE]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[MODEL,[VENDOR,ASUS],[TYPE,TABLET]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[MODEL,[VENDOR,ASUS],[TYPE,MOBILE]],[/(nexus 9)/i],[MODEL,[VENDOR,"HTC"],[TYPE,TABLET]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[VENDOR,[MODEL,/_/g," "],[TYPE,MOBILE]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[MODEL,[VENDOR,"TCL"],[TYPE,TABLET]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[MODEL,[VENDOR,"TCL"],[TYPE,MOBILE]],[/(itel) ((\w+))/i],[[VENDOR,lowerize],MODEL,[TYPE,strMapper,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[MODEL,[VENDOR,"Acer"],[TYPE,TABLET]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[MODEL,[VENDOR,"Meizu"],[TYPE,MOBILE]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[MODEL,[VENDOR,"Ulefone"],[TYPE,MOBILE]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[MODEL,[VENDOR,"Energizer"],[TYPE,MOBILE]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[MODEL,[VENDOR,"Cat"],[TYPE,MOBILE]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[MODEL,[VENDOR,"Smartfren"],[TYPE,MOBILE]],[/droid.+; (a(in)?(0(15|59|6[35])|142)p?)/i],[MODEL,[VENDOR,"Nothing"],[TYPE,MOBILE]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[MODEL,[VENDOR,"Archos"],[TYPE,TABLET]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[MODEL,[VENDOR,"Archos"],[TYPE,MOBILE]],[/; (n159v)/i],[MODEL,[VENDOR,"HMD"],[TYPE,MOBILE]],[/(imo) (tab \w+)/i,/(infinix|tecno) (x1101b?|p904|dp(7c|8d|10a)( pro)?|p70[1-3]a?|p904|t1101)/i],[VENDOR,MODEL,[TYPE,TABLET]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|hmd|imo|infinix|lava|oneplus|tcl|wiko)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(oppo) ?([\w ]+) bui/i,/(hisense) ([ehv][\w ]+)\)/i,/droid[^;]+; (philips)[_ ]([sv-x][\d]{3,4}[xz]?)/i],[VENDOR,MODEL,[TYPE,MOBILE]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[VENDOR,MODEL,[TYPE,TABLET]],[/(surface duo)/i],[MODEL,[VENDOR,MICROSOFT],[TYPE,TABLET]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[MODEL,[VENDOR,"Fairphone"],[TYPE,MOBILE]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[MODEL,[VENDOR,NVIDIA],[TYPE,TABLET]],[/(sprint) (\w+)/i],[VENDOR,MODEL,[TYPE,MOBILE]],[/(kin\.[onetw]{3})/i],[[MODEL,/\./g," "],[VENDOR,MICROSOFT],[TYPE,MOBILE]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[MODEL,[VENDOR,ZEBRA],[TYPE,TABLET]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[MODEL,[VENDOR,ZEBRA],[TYPE,MOBILE]],[/(philips)[\w ]+tv/i,/smart-tv.+(samsung)/i],[VENDOR,[TYPE,SMARTTV]],[/hbbtv.+maple;(\d+)/i],[[MODEL,/^/,"SmartTV"],[VENDOR,SAMSUNG],[TYPE,SMARTTV]],[/(vizio)(?: |.+model\/)(\w+-\w+)/i,/tcast.+(lg)e?. ([-\w]+)/i],[VENDOR,MODEL,[TYPE,SMARTTV]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[VENDOR,LG],[TYPE,SMARTTV]],[/(apple) ?tv/i],[VENDOR,[MODEL,APPLE+" TV"],[TYPE,SMARTTV]],[/crkey.*devicetype\/chromecast/i],[[MODEL,CHROMECAST+" Third Generation"],[VENDOR,GOOGLE],[TYPE,SMARTTV]],[/crkey.*devicetype\/([^/]*)/i],[[MODEL,/^/,"Chromecast "],[VENDOR,GOOGLE],[TYPE,SMARTTV]],[/fuchsia.*crkey/i],[[MODEL,CHROMECAST+" Nest Hub"],[VENDOR,GOOGLE],[TYPE,SMARTTV]],[/crkey/i],[[MODEL,CHROMECAST],[VENDOR,GOOGLE],[TYPE,SMARTTV]],[/(portaltv)/i],[MODEL,[VENDOR,FACEBOOK],[TYPE,SMARTTV]],[/droid.+aft(\w+)( bui|\))/i],[MODEL,[VENDOR,AMAZON],[TYPE,SMARTTV]],[/(shield \w+ tv)/i],[MODEL,[VENDOR,NVIDIA],[TYPE,SMARTTV]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[MODEL,[VENDOR,SHARP],[TYPE,SMARTTV]],[/(bravia[\w ]+)( bui|\))/i],[MODEL,[VENDOR,SONY],[TYPE,SMARTTV]],[/(mi(tv|box)-?\w+) bui/i],[MODEL,[VENDOR,XIAOMI],[TYPE,SMARTTV]],[/Hbbtv.*(technisat) (.*);/i],[VENDOR,MODEL,[TYPE,SMARTTV]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[VENDOR,/.+\/(\w+)/,"$1",strMapper,{LG:"lge"}],[MODEL,trim],[TYPE,SMARTTV]],[/(playstation \w+)/i],[MODEL,[VENDOR,SONY],[TYPE,CONSOLE]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[MODEL,[VENDOR,MICROSOFT],[TYPE,CONSOLE]],[/(ouya)/i,/(nintendo) (\w+)/i,/(retroid) (pocket ([^\)]+))/i,/(valve).+(steam deck)/i,/droid.+; ((shield|rgcube|gr0006))( bui|\))/i],[[VENDOR,strMapper,{Nvidia:"Shield",Anbernic:"RGCUBE",Logitech:"GR0006"}],MODEL,[TYPE,CONSOLE]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[MODEL,[VENDOR,SAMSUNG],[TYPE,WEARABLE]],[/((pebble))app/i,/(asus|google|lg|oppo|xiaomi) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[VENDOR,MODEL,[TYPE,WEARABLE]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[MODEL,[VENDOR,OPPO],[TYPE,WEARABLE]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[MODEL,[VENDOR,APPLE],[TYPE,WEARABLE]],[/(opwwe\d{3})/i],[MODEL,[VENDOR,ONEPLUS],[TYPE,WEARABLE]],[/(moto 360)/i],[MODEL,[VENDOR,MOTOROLA],[TYPE,WEARABLE]],[/(smartwatch 3)/i],[MODEL,[VENDOR,SONY],[TYPE,WEARABLE]],[/(g watch r)/i],[MODEL,[VENDOR,LG],[TYPE,WEARABLE]],[/droid.+; (wt63?0{2,3})\)/i],[MODEL,[VENDOR,ZEBRA],[TYPE,WEARABLE]],[/droid.+; (glass) \d/i],[MODEL,[VENDOR,GOOGLE],[TYPE,XR]],[/(pico) ([\w ]+) os\d/i],[VENDOR,MODEL,[TYPE,XR]],[/(quest( \d| pro)?s?).+vr/i],[MODEL,[VENDOR,FACEBOOK],[TYPE,XR]],[/mobile vr; rv.+firefox/i],[[TYPE,XR]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[VENDOR,[TYPE,EMBEDDED]],[/(aeobc)\b/i],[MODEL,[VENDOR,AMAZON],[TYPE,EMBEDDED]],[/(homepod).+mac os/i],[MODEL,[VENDOR,APPLE],[TYPE,EMBEDDED]],[/windows iot/i],[[TYPE,EMBEDDED]],[/droid.+; ([\w- ]+) (4k|android|smart|google)[- ]?tv/i],[MODEL,[TYPE,SMARTTV]],[/\b((4k|android|smart|opera)[- ]?tv|tv; rv:|large screen[\w ]+safari)\b/i],[[TYPE,SMARTTV]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew|; hmsc).+?(mobile|vr|\d) safari/i],[MODEL,[TYPE,strMapper,{mobile:"Mobile",xr:"VR","*":TABLET}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[TYPE,TABLET]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[TYPE,MOBILE]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[MODEL,[VENDOR,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[VERSION,[NAME,EDGE+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[NAME,VERSION],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[VERSION,[NAME,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[NAME,VERSION],[/ladybird\//i],[[NAME,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[VERSION,NAME]],os:[[/(windows nt) (6\.[23]); arm/i],[[NAME,/N/,"R"],[VERSION,strMapper,windowsVersionMap]],[/(windows (?:phone|mobile|iot))(?: os)?[\/ ]?([\d\.]*( se)?)/i,/(windows)[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i],[NAME,VERSION],[/windows nt ?([\d\.\)]*)(?!.+xbox)/i,/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d\.;]*)/i],[[VERSION,/(;|\))/g,"",strMapper,windowsVersionMap],[NAME,WINDOWS]],[/(windows ce)\/?([\d\.]*)/i],[NAME,VERSION],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv|ios(?=.+ip(?:ad|hone)|.+apple ?tv)|ip(?:ad|hone)(?: |.+i(?:pad)?)os|apple ?tv.+ios)[\/ ]([\w\.]+)/i,/\btvos ?([\w\.]+)/i,/cfnetwork\/.+darwin/i],[[VERSION,/_/g,"."],[NAME,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i],[[NAME,"macOS"],[VERSION,/_/g,"."]],[/android ([\d\.]+).*crkey/i],[VERSION,[NAME,CHROMECAST+" Android"]],[/fuchsia.*crkey\/([\d\.]+)/i],[VERSION,[NAME,CHROMECAST+" Fuchsia"]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[VERSION,[NAME,CHROMECAST+" SmartSpeaker"]],[/linux.*crkey\/([\d\.]+)/i],[VERSION,[NAME,CHROMECAST+" Linux"]],[/crkey\/([\d\.]+)/i],[VERSION,[NAME,CHROMECAST]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[VERSION,NAME],[/(ubuntu) ([\w\.]+) like android/i],[[NAME,/(.+)/,"$1 Touch"],VERSION],[/(harmonyos)[\/ ]?([\d\.]*)/i,/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen)\w*[-\/\.; ]?([\d\.]*)/i],[NAME,VERSION],[/\(bb(10);/i],[VERSION,[NAME,BLACKBERRY]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[VERSION,[NAME,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[VERSION,[NAME,FIREFOX+" OS"]],[/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i,/webos(?:[ \/]?|\.tv-20(?=2[2-9]))(\d[\d\.]*)/i],[VERSION,[NAME,"webOS"]],[/web0s;.+?(?:chr[o0]me|safari)\/(\d+)/i],[[VERSION,strMapper,{25:"120",24:"108",23:"94",22:"87",6:"79",5:"68",4:"53",3:"38",2:"538",1:"537","*":"TV"}],[NAME,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[VERSION,[NAME,"watchOS"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[NAME,"Chrome OS"],VERSION],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/linux.+(mint)[\/\(\) ]?([\w\.]*)/i,/(mageia|vectorlinux|fuchsia|arcaos|arch(?= ?linux))[;l ]([\d\.]*)/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire|knoppix)(?: gnu[\/ ]linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/\b(aix)[; ]([1-9\.]{0,4})/i,/(hurd|linux|morphos)(?: (?:arm|x86|ppc)\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) ?(r\d)?/i],[NAME,VERSION],[/(sunos) ?([\d\.]*)/i],[[NAME,"Solaris"],VERSION],[/\b(beos|os\/2|amigaos|openvms|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[NAME,VERSION]]},defaultProps=(function(){var r={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return setProps.call(r.init,[[BROWSER,[NAME,VERSION,MAJOR,TYPE]],[CPU,[ARCHITECTURE]],[DEVICE,[TYPE,MODEL,VENDOR]],[ENGINE,[NAME,VERSION]],[OS,[NAME,VERSION]]]),setProps.call(r.isIgnore,[[BROWSER,[VERSION,MAJOR]],[ENGINE,[VERSION]],[OS,[VERSION]]]),setProps.call(r.isIgnoreRgx,[[BROWSER,/ ?browser$/i],[OS,/ ?os$/i]]),setProps.call(r.toString,[[BROWSER,[NAME,VERSION]],[CPU,[ARCHITECTURE]],[DEVICE,[VENDOR,MODEL]],[ENGINE,[NAME,VERSION]],[OS,[NAME,VERSION]]]),r})(),createIData=function(r,e){var t=defaultProps.init[e],i=defaultProps.isIgnore[e]||0,s=defaultProps.isIgnoreRgx[e]||0,n=defaultProps.toString[e]||0;function a(){setProps.call(this,t)}return a.prototype.getItem=function(){return r},a.prototype.withClientHints=function(){return NAVIGATOR_UADATA?NAVIGATOR_UADATA.getHighEntropyValues(CH_ALL_VALUES).then(function(o){return r.setCH(new UACHData(o,!1)).parseCH().get()}):r.parseCH().get()},a.prototype.withFeatureCheck=function(){return r.detectFeature().get()},e!=RESULT&&(a.prototype.is=function(o){var c=!1;for(var u in this)if(this.hasOwnProperty(u)&&!has(i,u)&&lowerize(s?strip(s,this[u]):this[u])==lowerize(s?strip(s,o):o)){if(c=!0,o!=TYPEOF.UNDEFINED)break}else if(o==TYPEOF.UNDEFINED&&c){c=!c;break}return c},a.prototype.toString=function(){var o=EMPTY;for(var c in n)typeof this[n[c]]!==TYPEOF.UNDEFINED&&(o+=(o?" ":EMPTY)+this[n[c]]);return o||TYPEOF.UNDEFINED}),a.prototype.then=function(o){var c=this,u=function(){for(var d in c)c.hasOwnProperty(d)&&(this[d]=c[d])};u.prototype={is:a.prototype.is,toString:a.prototype.toString,withClientHints:a.prototype.withClientHints,withFeatureCheck:a.prototype.withFeatureCheck};var f=new u;return o(f),f},new a};function UACHData(r,e){if(r=r||{},setProps.call(this,CH_ALL_VALUES),e)setProps.call(this,[[BRANDS,itemListToArray(r[CH])],[FULLVERLIST,itemListToArray(r[CH_FULL_VER_LIST])],[MOBILE,/\?1/.test(r[CH_MOBILE])],[MODEL,stripQuotes(r[CH_MODEL])],[PLATFORM,stripQuotes(r[CH_PLATFORM])],[PLATFORMVER,stripQuotes(r[CH_PLATFORM_VER])],[ARCHITECTURE,stripQuotes(r[CH_ARCH])],[FORMFACTORS,itemListToArray(r[CH_FORM_FACTORS])],[BITNESS,stripQuotes(r[CH_BITNESS])]]);else for(var t in r)this.hasOwnProperty(t)&&typeof r[t]!==TYPEOF.UNDEFINED&&(this[t]=r[t])}function UAItem(r,e,t,i){return setProps.call(this,[["itemType",r],["ua",e],["uaCH",i],["rgxMap",t],["data",createIData(this,r)]]),this}UAItem.prototype.get=function(r){return r?this.data.hasOwnProperty(r)?this.data[r]:void 0:this.data},UAItem.prototype.set=function(r,e){return this.data[r]=e,this},UAItem.prototype.setCH=function(r){return this.uaCH=r,this},UAItem.prototype.detectFeature=function(){if(NAVIGATOR&&NAVIGATOR.userAgent==this.ua)switch(this.itemType){case BROWSER:NAVIGATOR.brave&&typeof NAVIGATOR.brave.isBrave==TYPEOF.FUNCTION&&this.set(NAME,"Brave");break;case DEVICE:!this.get(TYPE)&&NAVIGATOR_UADATA&&NAVIGATOR_UADATA[MOBILE]&&this.set(TYPE,MOBILE),this.get(MODEL)=="Macintosh"&&NAVIGATOR&&typeof NAVIGATOR.standalone!==TYPEOF.UNDEFINED&&NAVIGATOR.maxTouchPoints&&NAVIGATOR.maxTouchPoints>2&&this.set(MODEL,"iPad").set(TYPE,TABLET);break;case OS:!this.get(NAME)&&NAVIGATOR_UADATA&&NAVIGATOR_UADATA[PLATFORM]&&this.set(NAME,NAVIGATOR_UADATA[PLATFORM]);break;case RESULT:var r=this.data,e=function(t){return r[t].getItem().detectFeature().get()};this.set(BROWSER,e(BROWSER)).set(CPU,e(CPU)).set(DEVICE,e(DEVICE)).set(ENGINE,e(ENGINE)).set(OS,e(OS))}return this},UAItem.prototype.parseUA=function(){switch(this.itemType!=RESULT&&rgxMapper.call(this.data,this.ua,this.rgxMap),this.itemType){case BROWSER:this.set(MAJOR,majorize(this.get(VERSION)));break;case OS:if(this.get(NAME)=="iOS"&&this.get(VERSION)=="18.6"){var r=/\) Version\/([\d\.]+)/.exec(this.ua);r&&parseInt(r[1].substring(0,2),10)>=26&&this.set(VERSION,r[1])}break}return this},UAItem.prototype.parseCH=function(){var r=this.uaCH,e=this.rgxMap;switch(this.itemType){case BROWSER:case ENGINE:var t=r[FULLVERLIST]||r[BRANDS],i;if(t)for(var s=0;s<t.length;s++){var n=t[s].brand||t[s],a=t[s].version;this.itemType==BROWSER&&!/not.a.brand/i.test(n)&&(!i||/Chrom/.test(i)&&n!=CHROMIUM||i==EDGE&&/WebView2/.test(n))&&(n=strMapper(n,browserHintsMap),i=this.get(NAME),i&&!/Chrom/.test(i)&&/Chrom/.test(n)||this.set(NAME,n).set(VERSION,a).set(MAJOR,majorize(a)),i=n),this.itemType==ENGINE&&n==CHROMIUM&&this.set(VERSION,a)}break;case CPU:var o=r[ARCHITECTURE];o&&(o&&r[BITNESS]=="64"&&(o+="64"),rgxMapper.call(this.data,o+";",e));break;case DEVICE:if(r[MOBILE]&&this.set(TYPE,MOBILE),r[MODEL]&&(this.set(MODEL,r[MODEL]),!this.get(TYPE)||!this.get(VENDOR))){var c={};rgxMapper.call(c,"droid 9; "+r[MODEL]+")",e),!this.get(TYPE)&&c.type&&this.set(TYPE,c.type),!this.get(VENDOR)&&c.vendor&&this.set(VENDOR,c.vendor)}if(r[FORMFACTORS]){var u;if(typeof r[FORMFACTORS]!="string")for(var f=0;!u&&f<r[FORMFACTORS].length;)u=strMapper(r[FORMFACTORS][f++],formFactorsMap);else u=strMapper(r[FORMFACTORS],formFactorsMap);this.set(TYPE,u)}break;case OS:var d=r[PLATFORM];if(d){var g=r[PLATFORMVER];d==WINDOWS&&(g=parseInt(majorize(g),10)>=13?"11":"10"),this.set(NAME,d).set(VERSION,g)}this.get(NAME)==WINDOWS&&r[MODEL]=="Xbox"&&this.set(NAME,"Xbox").set(VERSION,void 0);break;case RESULT:var E=this.data,m=function(T){return E[T].getItem().setCH(r).parseCH().get()};this.set(BROWSER,m(BROWSER)).set(CPU,m(CPU)).set(DEVICE,m(DEVICE)).set(ENGINE,m(ENGINE)).set(OS,m(OS))}return this};function UAParser(r,e,t){if(typeof r===TYPEOF.OBJECT?(isExtensions(r,!0)?(typeof e===TYPEOF.OBJECT&&(t=e),e=r):(t=r,e=void 0),r=void 0):typeof r===TYPEOF.STRING&&!isExtensions(e,!0)&&(t=e,e=void 0),t)if(typeof t.append===TYPEOF.FUNCTION){var i={};t.forEach(function(f,d){i[String(d).toLowerCase()]=f}),t=i}else{var s={};for(var n in t)t.hasOwnProperty(n)&&(s[String(n).toLowerCase()]=t[n]);t=s}if(!(this instanceof UAParser))return new UAParser(r,e,t).getResult();var a=typeof r===TYPEOF.STRING?r:t&&t[USER_AGENT]?t[USER_AGENT]:NAVIGATOR&&NAVIGATOR.userAgent?NAVIGATOR.userAgent:EMPTY,o=new UACHData(t,!0),c=e?extend(defaultRegexes,e):defaultRegexes,u=function(f){return f==RESULT?function(){return new UAItem(f,a,c,o).set("ua",a).set(BROWSER,this.getBrowser()).set(CPU,this.getCPU()).set(DEVICE,this.getDevice()).set(ENGINE,this.getEngine()).set(OS,this.getOS()).get()}:function(){return new UAItem(f,a,c[f],o).parseUA().get()}};return setProps.call(this,[["getBrowser",u(BROWSER)],["getCPU",u(CPU)],["getDevice",u(DEVICE)],["getEngine",u(ENGINE)],["getOS",u(OS)],["getResult",u(RESULT)],["getUA",function(){return a}],["setUA",function(f){return isString(f)&&(a=trim(f,UA_MAX_LENGTH)),this}]]).setUA(a),this}UAParser.VERSION=LIBVERSION,UAParser.BROWSER=enumerize([NAME,VERSION,MAJOR,TYPE]),UAParser.CPU=enumerize([ARCHITECTURE]),UAParser.DEVICE=enumerize([MODEL,VENDOR,TYPE,CONSOLE,MOBILE,SMARTTV,TABLET,WEARABLE,EMBEDDED]),UAParser.ENGINE=UAParser.OS=enumerize([NAME,VERSION]);function useUserAgent(){const r=new UAParser().getResult().os.name,e=new UAParser().getResult().browser.name,t=new UAParser().getResult().device.type;return{os:{name:r},browser:{name:e},device:{type:t}}}const isFiniteNumber=Number.isFinite||function(r){return typeof r=="number"&&isFinite(r)},isSafeInteger=Number.isSafeInteger||function(r){return typeof r=="number"&&Math.abs(r)<=MAX_SAFE_INTEGER},MAX_SAFE_INTEGER=Number.MAX_SAFE_INTEGER||9007199254740991;let ErrorTypes=(function(r){return r.NETWORK_ERROR="networkError",r.MEDIA_ERROR="mediaError",r.KEY_SYSTEM_ERROR="keySystemError",r.MUX_ERROR="muxError",r.OTHER_ERROR="otherError",r})({}),ErrorDetails=(function(r){return r.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",r.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",r.KEY_SYSTEM_NO_SESSION="keySystemNoSession",r.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",r.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",r.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",r.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",r.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",r.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",r.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",r.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR="keySystemDestroyMediaKeysError",r.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR="keySystemDestroyCloseSessionError",r.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR="keySystemDestroyRemoveSessionError",r.MANIFEST_LOAD_ERROR="manifestLoadError",r.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",r.MANIFEST_PARSING_ERROR="manifestParsingError",r.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",r.LEVEL_EMPTY_ERROR="levelEmptyError",r.LEVEL_LOAD_ERROR="levelLoadError",r.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",r.LEVEL_PARSING_ERROR="levelParsingError",r.LEVEL_SWITCH_ERROR="levelSwitchError",r.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",r.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",r.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",r.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",r.FRAG_LOAD_ERROR="fragLoadError",r.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",r.FRAG_DECRYPT_ERROR="fragDecryptError",r.FRAG_PARSING_ERROR="fragParsingError",r.FRAG_GAP="fragGap",r.REMUX_ALLOC_ERROR="remuxAllocError",r.KEY_LOAD_ERROR="keyLoadError",r.KEY_LOAD_TIMEOUT="keyLoadTimeOut",r.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",r.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",r.BUFFER_APPEND_ERROR="bufferAppendError",r.BUFFER_APPENDING_ERROR="bufferAppendingError",r.BUFFER_STALLED_ERROR="bufferStalledError",r.BUFFER_FULL_ERROR="bufferFullError",r.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",r.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",r.ASSET_LIST_LOAD_ERROR="assetListLoadError",r.ASSET_LIST_LOAD_TIMEOUT="assetListLoadTimeout",r.ASSET_LIST_PARSING_ERROR="assetListParsingError",r.INTERSTITIAL_ASSET_ITEM_ERROR="interstitialAssetItemError",r.INTERNAL_EXCEPTION="internalException",r.INTERNAL_ABORTED="aborted",r.ATTACH_MEDIA_ERROR="attachMediaError",r.UNKNOWN="unknown",r})({}),Events=(function(r){return r.MEDIA_ATTACHING="hlsMediaAttaching",r.MEDIA_ATTACHED="hlsMediaAttached",r.MEDIA_DETACHING="hlsMediaDetaching",r.MEDIA_DETACHED="hlsMediaDetached",r.MEDIA_ENDED="hlsMediaEnded",r.STALL_RESOLVED="hlsStallResolved",r.BUFFER_RESET="hlsBufferReset",r.BUFFER_CODECS="hlsBufferCodecs",r.BUFFER_CREATED="hlsBufferCreated",r.BUFFER_APPENDING="hlsBufferAppending",r.BUFFER_APPENDED="hlsBufferAppended",r.BUFFER_EOS="hlsBufferEos",r.BUFFERED_TO_END="hlsBufferedToEnd",r.BUFFER_FLUSHING="hlsBufferFlushing",r.BUFFER_FLUSHED="hlsBufferFlushed",r.MANIFEST_LOADING="hlsManifestLoading",r.MANIFEST_LOADED="hlsManifestLoaded",r.MANIFEST_PARSED="hlsManifestParsed",r.LEVEL_SWITCHING="hlsLevelSwitching",r.LEVEL_SWITCHED="hlsLevelSwitched",r.LEVEL_LOADING="hlsLevelLoading",r.LEVEL_LOADED="hlsLevelLoaded",r.LEVEL_UPDATED="hlsLevelUpdated",r.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",r.LEVELS_UPDATED="hlsLevelsUpdated",r.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",r.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",r.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",r.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",r.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",r.AUDIO_TRACK_UPDATED="hlsAudioTrackUpdated",r.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",r.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",r.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",r.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",r.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",r.SUBTITLE_TRACK_UPDATED="hlsSubtitleTrackUpdated",r.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",r.CUES_PARSED="hlsCuesParsed",r.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",r.INIT_PTS_FOUND="hlsInitPtsFound",r.FRAG_LOADING="hlsFragLoading",r.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",r.FRAG_LOADED="hlsFragLoaded",r.FRAG_DECRYPTED="hlsFragDecrypted",r.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",r.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",r.FRAG_PARSING_METADATA="hlsFragParsingMetadata",r.FRAG_PARSED="hlsFragParsed",r.FRAG_BUFFERED="hlsFragBuffered",r.FRAG_CHANGED="hlsFragChanged",r.FPS_DROP="hlsFpsDrop",r.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",r.MAX_AUTO_LEVEL_UPDATED="hlsMaxAutoLevelUpdated",r.ERROR="hlsError",r.DESTROYING="hlsDestroying",r.KEY_LOADING="hlsKeyLoading",r.KEY_LOADED="hlsKeyLoaded",r.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",r.BACK_BUFFER_REACHED="hlsBackBufferReached",r.STEERING_MANIFEST_LOADED="hlsSteeringManifestLoaded",r.ASSET_LIST_LOADING="hlsAssetListLoading",r.ASSET_LIST_LOADED="hlsAssetListLoaded",r.INTERSTITIALS_UPDATED="hlsInterstitialsUpdated",r.INTERSTITIALS_BUFFERED_TO_BOUNDARY="hlsInterstitialsBufferedToBoundary",r.INTERSTITIAL_ASSET_PLAYER_CREATED="hlsInterstitialAssetPlayerCreated",r.INTERSTITIAL_STARTED="hlsInterstitialStarted",r.INTERSTITIAL_ASSET_STARTED="hlsInterstitialAssetStarted",r.INTERSTITIAL_ASSET_ENDED="hlsInterstitialAssetEnded",r.INTERSTITIAL_ASSET_ERROR="hlsInterstitialAssetError",r.INTERSTITIAL_ENDED="hlsInterstitialEnded",r.INTERSTITIALS_PRIMARY_RESUMED="hlsInterstitialsPrimaryResumed",r.PLAYOUT_LIMIT_REACHED="hlsPlayoutLimitReached",r.EVENT_CUE_ENTER="hlsEventCueEnter",r})({});var PlaylistContextType={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},PlaylistLevelType={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};class EWMA{constructor(e,t=0,i=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=i}sample(e,t){const i=Math.pow(this.alpha_,e);this.estimate_=t*(1-i)+i*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class EwmaBandWidthEstimator{constructor(e,t,i,s=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=i,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new EWMA(e),this.fast_=new EWMA(t),this.defaultTTFB_=s,this.ttfb_=new EWMA(e)}update(e,t){const{slow_:i,fast_:s,ttfb_:n}=this;i.halfLife!==e&&(this.slow_=new EWMA(e,i.getEstimate(),i.getTotalWeight())),s.halfLife!==t&&(this.fast_=new EWMA(t,s.getEstimate(),s.getTotalWeight())),n.halfLife!==e&&(this.ttfb_=new EWMA(e,n.getEstimate(),n.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);const i=8*t,s=e/1e3,n=i/s;this.fast_.sample(s,n),this.slow_.sample(s,n)}sampleTTFB(e){const t=e/1e3,i=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(i,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}get defaultEstimate(){return this.defaultEstimate_}destroy(){}}function _defineProperty(r,e,t){return(e=_toPropertyKey(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function _extends(){return _extends=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(r[i]=t[i])}return r},_extends.apply(null,arguments)}function ownKeys(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(r,s).enumerable})),t.push.apply(t,i)}return t}function _objectSpread2(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ownKeys(Object(t),!0).forEach(function(i){_defineProperty(r,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}return r}function _toPrimitive(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function _toPropertyKey(r){var e=_toPrimitive(r,"string");return typeof e=="symbol"?e:e+""}class Logger{constructor(e,t){this.trace=void 0,this.debug=void 0,this.log=void 0,this.warn=void 0,this.info=void 0,this.error=void 0;const i=`[${e}]:`;this.trace=noop,this.debug=t.debug.bind(null,i),this.log=t.log.bind(null,i),this.warn=t.warn.bind(null,i),this.info=t.info.bind(null,i),this.error=t.error.bind(null,i)}}const noop=function r(){},fakeLogger={trace:noop,debug:noop,log:noop,warn:noop,info:noop,error:noop};function createLogger(){return _extends({},fakeLogger)}function consolePrintFn(r,e){const t=self.console[r];return t?t.bind(self.console,`${e?"["+e+"] ":""}[${r}] >`):noop}function getLoggerFn(r,e,t){return e[r]?e[r].bind(e):consolePrintFn(r,t)}const exportedLogger=createLogger();function enableLogs(r,e,t){const i=createLogger();if(typeof console=="object"&&r===!0||typeof r=="object"){const s=["debug","log","info","warn","error"];s.forEach(n=>{i[n]=getLoggerFn(n,r,t)});try{i.log(`Debug logs enabled for "${e}" in hls.js version 1.6.15`)}catch{return createLogger()}s.forEach(n=>{exportedLogger[n]=getLoggerFn(n,r)})}else _extends(exportedLogger,i);return i}const logger=exportedLogger;function getMediaSource(r=!0){return typeof self>"u"?void 0:(r||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function isManagedMediaSource(r){return typeof self<"u"&&r===self.ManagedMediaSource}function isCompatibleTrackChange(r,e){const t=Object.keys(r),i=Object.keys(e),s=t.length,n=i.length;return!s||!n||s===n&&!t.some(a=>i.indexOf(a)===-1)}function utf8ArrayToStr(r,e=!1){if(typeof TextDecoder<"u"){const u=new TextDecoder("utf-8").decode(r);if(e){const f=u.indexOf("\0");return f!==-1?u.substring(0,f):u}return u.replace(/\0/g,"")}const t=r.length;let i,s,n,a="",o=0;for(;o<t;){if(i=r[o++],i===0&&e)return a;if(i===0||i===3)continue;switch(i>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:a+=String.fromCharCode(i);break;case 12:case 13:s=r[o++],a+=String.fromCharCode((i&31)<<6|s&63);break;case 14:s=r[o++],n=r[o++],a+=String.fromCharCode((i&15)<<12|(s&63)<<6|(n&63)<<0);break}}return a}function arrayToHex(r){let e="";for(let t=0;t<r.length;t++){let i=r[t].toString(16);i.length<2&&(i="0"+i),e+=i}return e}function hexToArrayBuffer(r){return Uint8Array.from(r.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}function getDefaultExportFromCjs(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var urlToolkit={exports:{}},hasRequiredUrlToolkit;function requireUrlToolkit(){return hasRequiredUrlToolkit||(hasRequiredUrlToolkit=1,(function(r,e){(function(t){var i=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,s=/^(?=([^\/?#]*))\1([^]*)$/,n=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(c,u,f){if(f=f||{},c=c.trim(),u=u.trim(),!u){if(!f.alwaysNormalize)return c;var d=o.parseURL(c);if(!d)throw new Error("Error trying to parse base URL.");return d.path=o.normalizePath(d.path),o.buildURLFromParts(d)}var g=o.parseURL(u);if(!g)throw new Error("Error trying to parse relative URL.");if(g.scheme)return f.alwaysNormalize?(g.path=o.normalizePath(g.path),o.buildURLFromParts(g)):u;var E=o.parseURL(c);if(!E)throw new Error("Error trying to parse base URL.");if(!E.netLoc&&E.path&&E.path[0]!=="/"){var m=s.exec(E.path);E.netLoc=m[1],E.path=m[2]}E.netLoc&&!E.path&&(E.path="/");var T={scheme:E.scheme,netLoc:g.netLoc,path:null,params:g.params,query:g.query,fragment:g.fragment};if(!g.netLoc&&(T.netLoc=E.netLoc,g.path[0]!=="/"))if(!g.path)T.path=E.path,g.params||(T.params=E.params,g.query||(T.query=E.query));else{var S=E.path,b=S.substring(0,S.lastIndexOf("/")+1)+g.path;T.path=o.normalizePath(b)}return T.path===null&&(T.path=f.alwaysNormalize?o.normalizePath(g.path):g.path),o.buildURLFromParts(T)},parseURL:function(c){var u=i.exec(c);return u?{scheme:u[1]||"",netLoc:u[2]||"",path:u[3]||"",params:u[4]||"",query:u[5]||"",fragment:u[6]||""}:null},normalizePath:function(c){for(c=c.split("").reverse().join("").replace(n,"");c.length!==(c=c.replace(a,"")).length;);return c.split("").reverse().join("")},buildURLFromParts:function(c){return c.scheme+c.netLoc+c.path+c.params+c.query+c.fragment}};r.exports=o})()})(urlToolkit)),urlToolkit.exports}var urlToolkitExports=requireUrlToolkit();class LoadStats{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var ElementaryStreamTypes={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class BaseSegment{constructor(e){this._byteRange=null,this._url=null,this._stats=null,this._streams=null,this.base=void 0,this.relurl=void 0,typeof e=="string"&&(e={url:e}),this.base=e,makeEnumerable(this,"stats")}setByteRange(e,t){const i=e.split("@",2);let s;i.length===1?s=t?.byteRangeEndOffset||0:s=parseInt(i[1]),this._byteRange=[s,parseInt(i[0])+s]}get baseurl(){return this.base.url}get byteRange(){return this._byteRange===null?[]:this._byteRange}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get elementaryStreams(){return this._streams===null&&(this._streams={[ElementaryStreamTypes.AUDIO]:null,[ElementaryStreamTypes.VIDEO]:null,[ElementaryStreamTypes.AUDIOVIDEO]:null}),this._streams}set elementaryStreams(e){this._streams=e}get hasStats(){return this._stats!==null}get hasStreams(){return this._streams!==null}get stats(){return this._stats===null&&(this._stats=new LoadStats),this._stats}set stats(e){this._stats=e}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=urlToolkitExports.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[ElementaryStreamTypes.AUDIO]=null,e[ElementaryStreamTypes.VIDEO]=null,e[ElementaryStreamTypes.AUDIOVIDEO]=null}}function isMediaFragment(r){return r.sn!=="initSegment"}class Fragment extends BaseSegment{constructor(e,t){super(t),this._decryptdata=null,this._programDateTime=null,this._ref=null,this._bitrate=void 0,this.rawProgramDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.playlistOffset=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=e}get byteLength(){if(this.hasStats){const e=this.stats.total;if(e)return e}if(this.byteRange.length){const e=this.byteRange[0],t=this.byteRange[1];if(isFiniteNumber(e)&&isFiniteNumber(t))return t-e}return null}get bitrate(){return this.byteLength?this.byteLength*8/this.duration:this._bitrate?this._bitrate:null}set bitrate(e){this._bitrate=e}get decryptdata(){var e;const{levelkeys:t}=this;if(!t||t.NONE)return null;if(t.identity)this._decryptdata||(this._decryptdata=t.identity.getDecryptData(this.sn));else if(!((e=this._decryptdata)!=null&&e.keyId)){const i=Object.keys(t);if(i.length===1){const s=this._decryptdata=t[i[0]]||null;s&&(this._decryptdata=s.getDecryptData(this.sn,t))}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null)return null;const e=isFiniteNumber(this.duration)?this.duration:0;return this.programDateTime+e*1e3}get encrypted(){var e;if((e=this._decryptdata)!=null&&e.encrypted)return!0;if(this.levelkeys){var t;const i=Object.keys(this.levelkeys),s=i.length;if(s>1||s===1&&(t=this.levelkeys[i[0]])!=null&&t.encrypted)return!0}return!1}get programDateTime(){return this._programDateTime===null&&this.rawProgramDateTime&&(this.programDateTime=Date.parse(this.rawProgramDateTime)),this._programDateTime}set programDateTime(e){if(!isFiniteNumber(e)){this._programDateTime=this.rawProgramDateTime=null;return}this._programDateTime=e}get ref(){return isMediaFragment(this)?(this._ref||(this._ref={base:this.base,start:this.start,duration:this.duration,sn:this.sn,programDateTime:this.programDateTime}),this._ref):null}addStart(e){this.setStart(this.start+e)}setStart(e){this.start=e,this._ref&&(this._ref.start=e)}setDuration(e){this.duration=e,this._ref&&(this._ref.duration=e)}setKeyFormat(e){const t=this.levelkeys;if(t){var i;const s=t[e];s&&!((i=this._decryptdata)!=null&&i.keyId)&&(this._decryptdata=s.getDecryptData(this.sn,t))}}abortRequests(){var e,t;(e=this.loader)==null||e.abort(),(t=this.keyLoader)==null||t.abort()}setElementaryStreamInfo(e,t,i,s,n,a=!1){const{elementaryStreams:o}=this,c=o[e];if(!c){o[e]={startPTS:t,endPTS:i,startDTS:s,endDTS:n,partial:a};return}c.startPTS=Math.min(c.startPTS,t),c.endPTS=Math.max(c.endPTS,i),c.startDTS=Math.min(c.startDTS,s),c.endDTS=Math.max(c.endDTS,n)}}class Part extends BaseSegment{constructor(e,t,i,s,n){super(i),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=s;const a=e.enumeratedString("BYTERANGE");a&&this.setByteRange(a,n),n&&(this.fragOffset=n.fragOffset+n.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}function getOwnPropertyDescriptorFromPrototypeChain(r,e){const t=Object.getPrototypeOf(r);if(t){const i=Object.getOwnPropertyDescriptor(t,e);return i||getOwnPropertyDescriptorFromPrototypeChain(t,e)}}function makeEnumerable(r,e){const t=getOwnPropertyDescriptorFromPrototypeChain(r,e);t&&(t.enumerable=!0,Object.defineProperty(r,e,t))}const UINT32_MAX$1=Math.pow(2,32)-1,push=[].push,RemuxerTrackIdConfig={video:1,audio:2,id3:3,text:4};function bin2str(r){return String.fromCharCode.apply(null,r)}function readUint16(r,e){const t=r[e]<<8|r[e+1];return t<0?65536+t:t}function readUint32(r,e){const t=readSint32(r,e);return t<0?4294967296+t:t}function readUint64(r,e){let t=readUint32(r,e);return t*=Math.pow(2,32),t+=readUint32(r,e+4),t}function readSint32(r,e){return r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3]}function hasMoofData(r){const e=r.byteLength;for(let t=0;t<e;){const i=readUint32(r,t);if(i>8&&r[t+4]===109&&r[t+5]===111&&r[t+6]===111&&r[t+7]===102)return!0;t=i>1?t+i:e}return!1}function findBox(r,e){const t=[];if(!e.length)return t;const i=r.byteLength;for(let s=0;s<i;){const n=readUint32(r,s),a=bin2str(r.subarray(s+4,s+8)),o=n>1?s+n:i;if(a===e[0])if(e.length===1)t.push(r.subarray(s+8,o));else{const c=findBox(r.subarray(s+8,o),e.slice(1));c.length&&push.apply(t,c)}s=o}return t}function parseSegmentIndex(r){const e=[],t=r[0];let i=8;const s=readUint32(r,i);i+=4;let n=0,a=0;t===0?(n=readUint32(r,i),a=readUint32(r,i+4),i+=8):(n=readUint64(r,i),a=readUint64(r,i+8),i+=16),i+=2;let o=r.length+a;const c=readUint16(r,i);i+=2;for(let u=0;u<c;u++){let f=i;const d=readUint32(r,f);f+=4;const g=d&2147483647;if((d&2147483648)>>>31===1)return logger.warn("SIDX has hierarchical references (not supported)"),null;const m=readUint32(r,f);f+=4,e.push({referenceSize:g,subsegmentDuration:m,info:{duration:m/s,start:o,end:o+g-1}}),o+=g,f+=4,i=f}return{earliestPresentationTime:n,timescale:s,version:t,referencesCount:c,references:e}}function parseInitSegment(r){const e=[],t=findBox(r,["moov","trak"]);for(let s=0;s<t.length;s++){const n=t[s],a=findBox(n,["tkhd"])[0];if(a){let o=a[0];const c=readUint32(a,o===0?12:20),u=findBox(n,["mdia","mdhd"])[0];if(u){o=u[0];const f=readUint32(u,o===0?12:20),d=findBox(n,["mdia","hdlr"])[0];if(d){const g=bin2str(d.subarray(8,12)),E={soun:ElementaryStreamTypes.AUDIO,vide:ElementaryStreamTypes.VIDEO}[g],m=findBox(n,["mdia","minf","stbl","stsd"])[0],T=parseStsd(m);E?(e[c]={timescale:f,type:E,stsd:T},e[E]=_objectSpread2({timescale:f,id:c},T)):e[c]={timescale:f,type:g,stsd:T}}}}}return findBox(r,["moov","mvex","trex"]).forEach(s=>{const n=readUint32(s,4),a=e[n];a&&(a.default={duration:readUint32(s,12),flags:readUint32(s,20)})}),e}function parseStsd(r){const e=r.subarray(8),t=e.subarray(86),i=bin2str(e.subarray(4,8));let s=i,n;const a=i==="enca"||i==="encv";if(a){const u=findBox(e,[i])[0].subarray(i==="enca"?28:78);findBox(u,["sinf"]).forEach(d=>{const g=findBox(d,["schm"])[0];if(g){const E=bin2str(g.subarray(4,8));if(E==="cbcs"||E==="cenc"){const m=findBox(d,["frma"])[0];m&&(s=bin2str(m))}}})}const o=s;switch(s){case"avc1":case"avc2":case"avc3":case"avc4":{const c=findBox(t,["avcC"])[0];c&&c.length>3&&(s+="."+toHex(c[1])+toHex(c[2])+toHex(c[3]),n=parseSupplementalDoViCodec(o==="avc1"?"dva1":"dvav",t));break}case"mp4a":{const c=findBox(e,[i])[0],u=findBox(c.subarray(28),["esds"])[0];if(u&&u.length>7){let f=4;if(u[f++]!==3)break;f=skipBERInteger(u,f),f+=2;const d=u[f++];if(d&128&&(f+=2),d&64&&(f+=u[f++]),u[f++]!==4)break;f=skipBERInteger(u,f);const g=u[f++];if(g===64)s+="."+toHex(g);else break;if(f+=12,u[f++]!==5)break;f=skipBERInteger(u,f);const E=u[f++];let m=(E&248)>>3;m===31&&(m+=1+((E&7)<<3)+((u[f]&224)>>5)),s+="."+m}break}case"hvc1":case"hev1":{const c=findBox(t,["hvcC"])[0];if(c&&c.length>12){const u=c[1],f=["","A","B","C"][u>>6],d=u&31,g=readUint32(c,2),E=(u&32)>>5?"H":"L",m=c[12],T=c.subarray(6,12);s+="."+f+d,s+="."+reverse32BitInt(g).toString(16).toUpperCase(),s+="."+E+m;let S="";for(let b=T.length;b--;){const C=T[b];(C||S)&&(S="."+C.toString(16).toUpperCase()+S)}s+=S}n=parseSupplementalDoViCodec(o=="hev1"?"dvhe":"dvh1",t);break}case"dvh1":case"dvhe":case"dvav":case"dva1":case"dav1":{s=parseSupplementalDoViCodec(s,t)||s;break}case"vp09":{const c=findBox(t,["vpcC"])[0];if(c&&c.length>6){const u=c[4],f=c[5],d=c[6]>>4&15;s+="."+addLeadingZero(u)+"."+addLeadingZero(f)+"."+addLeadingZero(d)}break}case"av01":{const c=findBox(t,["av1C"])[0];if(c&&c.length>2){const u=c[1]>>>5,f=c[1]&31,d=c[2]>>>7?"H":"M",g=(c[2]&64)>>6,E=(c[2]&32)>>5,m=u===2&&g?E?12:10:g?10:8,T=(c[2]&16)>>4,S=(c[2]&8)>>3,b=(c[2]&4)>>2,C=c[2]&3;s+="."+u+"."+addLeadingZero(f)+d+"."+addLeadingZero(m)+"."+T+"."+S+b+C+"."+addLeadingZero(1)+"."+addLeadingZero(1)+"."+addLeadingZero(1)+"."+0,n=parseSupplementalDoViCodec("dav1",t)}break}}return{codec:s,encrypted:a,supplemental:n}}function parseSupplementalDoViCodec(r,e){const t=findBox(e,["dvvC"]),i=t.length?t[0]:findBox(e,["dvcC"])[0];if(i){const s=i[2]>>1&127,n=i[2]<<5&32|i[3]>>3&31;return r+"."+addLeadingZero(s)+"."+addLeadingZero(n)}}function reverse32BitInt(r){let e=0;for(let t=0;t<32;t++)e|=(r>>t&1)<<31-t;return e>>>0}function skipBERInteger(r,e){const t=e+5;for(;r[e++]&128&&e<t;);return e}function toHex(r){return("0"+r.toString(16).toUpperCase()).slice(-2)}function addLeadingZero(r){return(r<10?"0":"")+r}function patchEncyptionData(r,e){if(!r||!e)return;const t=e.keyId;t&&e.isCommonEncryption&&applyToTencBoxes(r,(i,s)=>{const n=i.subarray(8,24);n.some(a=>a!==0)||(logger.log(`[eme] Patching keyId in 'enc${s?"a":"v"}>sinf>>tenc' box: ${arrayToHex(n)} -> ${arrayToHex(t)}`),i.set(t,8))})}function parseKeyIdsFromTenc(r){const e=[];return applyToTencBoxes(r,t=>e.push(t.subarray(8,24))),e}function applyToTencBoxes(r,e){findBox(r,["moov","trak"]).forEach(i=>{const s=findBox(i,["mdia","minf","stbl","stsd"])[0];if(!s)return;const n=s.subarray(8);let a=findBox(n,["enca"]);const o=a.length>0;o||(a=findBox(n,["encv"])),a.forEach(c=>{const u=o?c.subarray(28):c.subarray(78);findBox(u,["sinf"]).forEach(d=>{const g=parseSinf(d);g&&e(g,o)})})})}function parseSinf(r){const e=findBox(r,["schm"])[0];if(e){const t=bin2str(e.subarray(4,8));if(t==="cbcs"||t==="cenc"){const i=findBox(r,["schi","tenc"])[0];if(i)return i}}}function getSampleData(r,e,t){const i={},s=findBox(r,["moof","traf"]);for(let n=0;n<s.length;n++){const a=s[n],o=findBox(a,["tfhd"])[0],c=readUint32(o,4),u=e[c];if(!u)continue;i[c]||(i[c]={start:NaN,duration:0,sampleCount:0,timescale:u.timescale,type:u.type});const f=i[c],d=findBox(a,["tfdt"])[0];if(d){const I=d[0];let L=readUint32(d,4);I===1&&(L===UINT32_MAX$1?t.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"):(L*=UINT32_MAX$1+1,L+=readUint32(d,8))),isFiniteNumber(L)&&(!isFiniteNumber(f.start)||L<f.start)&&(f.start=L)}const g=u.default,E=readUint32(o,0)|g?.flags;let m=g?.duration||0;E&8&&(E&2?m=readUint32(o,12):m=readUint32(o,8));const T=findBox(a,["trun"]);let S=f.start||0,b=0,C=m;for(let I=0;I<T.length;I++){const L=T[I],k=readUint32(L,4),U=f.sampleCount;f.sampleCount+=k;const O=L[3]&1,F=L[3]&4,G=L[2]&1,x=L[2]&2,$=L[2]&4,X=L[2]&8;let Q=8,ee=k;for(O&&(Q+=4),F&&k&&(!(L[Q+1]&1)&&f.keyFrameIndex===void 0&&(f.keyFrameIndex=U),Q+=4,G?(C=readUint32(L,Q),Q+=4):C=m,x&&(Q+=4),X&&(Q+=4),S+=C,b+=C,ee--);ee--;)G?(C=readUint32(L,Q),Q+=4):C=m,x&&(Q+=4),$&&(L[Q+1]&1||f.keyFrameIndex===void 0&&(f.keyFrameIndex=f.sampleCount-(ee+1),f.keyFrameStart=S),Q+=4),X&&(Q+=4),S+=C,b+=C;!b&&m&&(b+=m*k)}f.duration+=b}if(!Object.keys(i).some(n=>i[n].duration)){let n=1/0,a=0;const o=findBox(r,["sidx"]);for(let c=0;c<o.length;c++){const u=parseSegmentIndex(o[c]);if(u!=null&&u.references){n=Math.min(n,u.earliestPresentationTime/u.timescale);const f=u.references.reduce((d,g)=>d+g.info.duration||0,0);a=Math.max(a,f+u.earliestPresentationTime/u.timescale)}}a&&isFiniteNumber(a)&&Object.keys(i).forEach(c=>{i[c].duration||(i[c].duration=a*i[c].timescale-i[c].start)})}return i}function segmentValidRange(r){const e={valid:null,remainder:null},t=findBox(r,["moof"]);if(t.length<2)return e.remainder=r,e;const i=t[t.length-1];return e.valid=r.slice(0,i.byteOffset-8),e.remainder=r.slice(i.byteOffset-8),e}function appendUint8Array(r,e){const t=new Uint8Array(r.length+e.length);return t.set(r),t.set(e,r.length),t}function parseSamples(r,e){const t=[],i=e.samples,s=e.timescale,n=e.id;let a=!1;return findBox(i,["moof"]).map(c=>{const u=c.byteOffset-8;findBox(c,["traf"]).map(d=>{const g=findBox(d,["tfdt"]).map(E=>{const m=E[0];let T=readUint32(E,4);return m===1&&(T*=Math.pow(2,32),T+=readUint32(E,8)),T/s})[0];return g!==void 0&&(r=g),findBox(d,["tfhd"]).map(E=>{const m=readUint32(E,4),T=readUint32(E,0)&16777215,S=(T&1)!==0,b=(T&2)!==0,C=(T&8)!==0;let I=0;const L=(T&16)!==0;let k=0;const U=(T&32)!==0;let O=8;m===n&&(S&&(O+=8),b&&(O+=4),C&&(I=readUint32(E,O),O+=4),L&&(k=readUint32(E,O),O+=4),U&&(O+=4),e.type==="video"&&(a=isHEVC(e.codec)),findBox(d,["trun"]).map(F=>{const G=F[0],x=readUint32(F,0)&16777215,$=(x&1)!==0;let X=0;const Q=(x&4)!==0,ee=(x&256)!==0;let te=0;const re=(x&512)!==0;let me=0;const H=(x&1024)!==0,z=(x&2048)!==0;let ie=0;const ne=readUint32(F,4);let he=8;$&&(X=readUint32(F,he),he+=4),Q&&(he+=4);let pe=X+u;for(let Pe=0;Pe<ne;Pe++){if(ee?(te=readUint32(F,he),he+=4):te=I,re?(me=readUint32(F,he),he+=4):me=k,H&&(he+=4),z&&(G===0?ie=readUint32(F,he):ie=readSint32(F,he),he+=4),e.type===ElementaryStreamTypes.VIDEO){let ae=0;for(;ae<me;){const Ae=readUint32(i,pe);if(pe+=4,isSEIMessage(a,i[pe])){const Re=i.subarray(pe,pe+Ae);parseSEIMessageFromNALu(Re,a?2:1,r+ie/s,t)}pe+=Ae,ae+=Ae+4}}r+=te/s}}))})})}),t}function isHEVC(r){if(!r)return!1;const e=r.substring(0,4);return e==="hvc1"||e==="hev1"||e==="dvh1"||e==="dvhe"}function isSEIMessage(r,e){if(r){const t=e>>1&63;return t===39||t===40}else return(e&31)===6}function parseSEIMessageFromNALu(r,e,t,i){const s=discardEPB(r);let n=0;n+=e;let a=0,o=0,c=0;for(;n<s.length;){a=0;do{if(n>=s.length)break;c=s[n++],a+=c}while(c===255);o=0;do{if(n>=s.length)break;c=s[n++],o+=c}while(c===255);const u=s.length-n;let f=n;if(o<u)n+=o;else if(o>u){logger.error(`Malformed SEI payload. ${o} is too small, only ${u} bytes left to parse.`);break}if(a===4){if(s[f++]===181){const g=readUint16(s,f);if(f+=2,g===49){const E=readUint32(s,f);if(f+=4,E===1195456820){const m=s[f++];if(m===3){const T=s[f++],S=31&T,b=64&T,C=b?2+S*3:0,I=new Uint8Array(C);if(b){I[0]=T;for(let L=1;L<C;L++)I[L]=s[f++]}i.push({type:m,payloadType:a,pts:t,bytes:I})}}}}}else if(a===5&&o>16){const d=[];for(let m=0;m<16;m++){const T=s[f++].toString(16);d.push(T.length==1?"0"+T:T),(m===3||m===5||m===7||m===9)&&d.push("-")}const g=o-16,E=new Uint8Array(g);for(let m=0;m<g;m++)E[m]=s[f++];i.push({payloadType:a,pts:t,uuid:d.join(""),userData:utf8ArrayToStr(E),userDataBytes:E})}}}function discardEPB(r){const e=r.byteLength,t=[];let i=1;for(;i<e-2;)r[i]===0&&r[i+1]===0&&r[i+2]===3?(t.push(i+2),i+=2):i++;if(t.length===0)return r;const s=e-t.length,n=new Uint8Array(s);let a=0;for(i=0;i<s;a++,i++)a===t[0]&&(a++,t.shift()),n[i]=r[a];return n}function parseEmsg(r){const e=r[0];let t="",i="",s=0,n=0,a=0,o=0,c=0,u=0;if(e===0){for(;bin2str(r.subarray(u,u+1))!=="\0";)t+=bin2str(r.subarray(u,u+1)),u+=1;for(t+=bin2str(r.subarray(u,u+1)),u+=1;bin2str(r.subarray(u,u+1))!=="\0";)i+=bin2str(r.subarray(u,u+1)),u+=1;i+=bin2str(r.subarray(u,u+1)),u+=1,s=readUint32(r,12),n=readUint32(r,16),o=readUint32(r,20),c=readUint32(r,24),u=28}else if(e===1){u+=4,s=readUint32(r,u),u+=4;const d=readUint32(r,u);u+=4;const g=readUint32(r,u);for(u+=4,a=2**32*d+g,isSafeInteger(a)||(a=Number.MAX_SAFE_INTEGER,logger.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),o=readUint32(r,u),u+=4,c=readUint32(r,u),u+=4;bin2str(r.subarray(u,u+1))!=="\0";)t+=bin2str(r.subarray(u,u+1)),u+=1;for(t+=bin2str(r.subarray(u,u+1)),u+=1;bin2str(r.subarray(u,u+1))!=="\0";)i+=bin2str(r.subarray(u,u+1)),u+=1;i+=bin2str(r.subarray(u,u+1)),u+=1}const f=r.subarray(u,r.byteLength);return{schemeIdUri:t,value:i,timeScale:s,presentationTime:a,presentationTimeDelta:n,eventDuration:o,id:c,payload:f}}function mp4Box(r,...e){const t=e.length;let i=8,s=t;for(;s--;)i+=e[s].byteLength;const n=new Uint8Array(i);for(n[0]=i>>24&255,n[1]=i>>16&255,n[2]=i>>8&255,n[3]=i&255,n.set(r,4),s=0,i=8;s<t;s++)n.set(e[s],i),i+=e[s].byteLength;return n}function mp4pssh(r,e,t){if(r.byteLength!==16)throw new RangeError("Invalid system id");let i,s;i=0,s=new Uint8Array;let n;i>0?(n=new Uint8Array(4),e.length>0&&new DataView(n.buffer).setUint32(0,e.length,!1)):n=new Uint8Array;const a=new Uint8Array(4);return t.byteLength>0&&new DataView(a.buffer).setUint32(0,t.byteLength,!1),mp4Box([112,115,115,104],new Uint8Array([i,0,0,0]),r,n,s,a,t)}function parseMultiPssh(r){const e=[];if(r instanceof ArrayBuffer){const t=r.byteLength;let i=0;for(;i+32<t;){const s=new DataView(r,i),n=parsePssh(s);e.push(n),i+=n.size}}return e}function parsePssh(r){const e=r.getUint32(0),t=r.byteOffset,i=r.byteLength;if(i<e)return{offset:t,size:i};if(r.getUint32(4)!==1886614376)return{offset:t,size:e};const n=r.getUint32(8)>>>24;if(n!==0&&n!==1)return{offset:t,size:e};const a=r.buffer,o=arrayToHex(new Uint8Array(a,t+12,16));let c=null,u=null,f=0;if(n===0)f=28;else{const g=r.getUint32(28);if(!g||i<32+g*16)return{offset:t,size:e};c=[];for(let E=0;E<g;E++)c.push(new Uint8Array(a,t+32+E*16,16));f=32+g*16}if(!f)return{offset:t,size:e};const d=r.getUint32(f);return e-32<d?{offset:t,size:e}:(u=new Uint8Array(a,t+f+4,d),{version:n,systemId:o,kids:c,data:u,offset:t,size:e})}const userAgentHevcSupportIsInaccurate=()=>/\(Windows.+Firefox\//i.test(navigator.userAgent),sampleEntryCodesISO={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,dav1:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}};function isCodecType(r,e){const t=sampleEntryCodesISO[e];return!!t&&!!t[r.slice(0,4)]}function areCodecsMediaSourceSupported(r,e,t=!0){return!r.split(",").some(i=>!isCodecMediaSourceSupported(i,e,t))}function isCodecMediaSourceSupported(r,e,t=!0){var i;const s=getMediaSource(t);return(i=s?.isTypeSupported(mimeTypeForCodec(r,e)))!=null?i:!1}function mimeTypeForCodec(r,e){return`${e}/mp4;codecs=${r}`}function videoCodecPreferenceValue(r){if(r){const e=r.substring(0,4);return sampleEntryCodesISO.video[e]}return 2}function codecsSetSelectionPreferenceValue(r){const e=userAgentHevcSupportIsInaccurate();return r.split(",").reduce((t,i)=>{const n=e&&isHEVC(i)?9:sampleEntryCodesISO.video[i];return n?(n*2+t)/(t?3:2):(sampleEntryCodesISO.audio[i]+t)/(t?2:1)},0)}const CODEC_COMPATIBLE_NAMES={};function getCodecCompatibleNameLower(r,e=!0){if(CODEC_COMPATIBLE_NAMES[r])return CODEC_COMPATIBLE_NAMES[r];const t={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"],"mp4a.40.34":["mp3"]}[r];for(let s=0;s<t.length;s++){var i;if(isCodecMediaSourceSupported(t[s],"audio",e))return CODEC_COMPATIBLE_NAMES[r]=t[s],t[s];if(t[s]==="mp3"&&(i=getMediaSource(e))!=null&&i.isTypeSupported("audio/mpeg"))return""}return r}const AUDIO_CODEC_REGEXP=/flac|opus|mp4a\.40\.34/i;function getCodecCompatibleName(r,e=!0){return r.replace(AUDIO_CODEC_REGEXP,t=>getCodecCompatibleNameLower(t.toLowerCase(),e))}function replaceVideoCodec(r,e){const t=[];if(r){const i=r.split(",");for(let s=0;s<i.length;s++)isCodecType(i[s],"video")||t.push(i[s])}return e&&t.push(e),t.join(",")}function pickMostCompleteCodecName(r,e){if(r&&(r.length>4||["ac-3","ec-3","alac","fLaC","Opus"].indexOf(r)!==-1)&&(isCodecSupportedAsType(r,"audio")||isCodecSupportedAsType(r,"video")))return r;if(e){const t=e.split(",");if(t.length>1){if(r){for(let i=t.length;i--;)if(t[i].substring(0,4)===r.substring(0,4))return t[i]}return t[0]}}return e||r}function isCodecSupportedAsType(r,e){return isCodecType(r,e)&&isCodecMediaSourceSupported(r,e)}function convertAVC1ToAVCOTI(r){const e=r.split(",");for(let t=0;t<e.length;t++){const i=e[t].split(".");i.length>2&&i[0]==="avc1"&&(e[t]=`avc1.${parseInt(i[1]).toString(16)}${("000"+parseInt(i[2]).toString(16)).slice(-4)}`)}return e.join(",")}function fillInMissingAV01Params(r){if(r.startsWith("av01.")){const e=r.split("."),t=["0","111","01","01","01","0"];for(let i=e.length;i>4&&i<10;i++)e[i]=t[i-4];return e.join(".")}return r}function getM2TSSupportedAudioTypes(r){const e=getMediaSource(r)||{isTypeSupported:()=>!1};return{mpeg:e.isTypeSupported("audio/mpeg"),mp3:e.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:e.isTypeSupported('audio/mp4; codecs="ac-3"')}}function getCodecsForMimeType(r){return r.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const supportedResult={supported:!0,powerEfficient:!0,smooth:!0},unsupportedResult={supported:!1,smooth:!1,powerEfficient:!1},SUPPORTED_INFO_DEFAULT={supported:!0,configurations:[],decodingInfoResults:[supportedResult]};function getUnsupportedResult(r,e){return{supported:!1,configurations:e,decodingInfoResults:[unsupportedResult],error:r}}function requiresMediaCapabilitiesDecodingInfo(r,e,t,i,s,n){const a=r.videoCodec,o=r.audioCodec?r.audioGroups:null,c=n?.audioCodec,u=n?.channels,f=u?parseInt(u):c?1/0:2;let d=null;if(o!=null&&o.length)try{o.length===1&&o[0]?d=e.groups[o[0]].channels:d=o.reduce((g,E)=>{if(E){const m=e.groups[E];if(!m)throw new Error(`Audio track group ${E} not found`);Object.keys(m.channels).forEach(T=>{g[T]=(g[T]||0)+m.channels[T]})}return g},{2:0})}catch{return!0}return a!==void 0&&(a.split(",").some(g=>isHEVC(g))||r.width>1920&&r.height>1088||r.height>1920&&r.width>1088||r.frameRate>Math.max(i,30)||r.videoRange!=="SDR"&&r.videoRange!==t||r.bitrate>Math.max(s,8e6))||!!d&&isFiniteNumber(f)&&Object.keys(d).some(g=>parseInt(g)>f)}function getMediaDecodingInfoPromise(r,e,t,i={}){const s=r.videoCodec;if(!s&&!r.audioCodec||!t)return Promise.resolve(SUPPORTED_INFO_DEFAULT);const n=[],a=makeVideoConfigurations(r),o=a.length,c=makeAudioConfigurations(r,e,o>0),u=c.length;for(let f=o||1*u||1;f--;){const d={type:"media-source"};if(o&&(d.video=a[f%o]),u){d.audio=c[f%u];const g=d.audio.bitrate;d.video&&g&&(d.video.bitrate-=g)}n.push(d)}if(s){const f=navigator.userAgent;if(s.split(",").some(d=>isHEVC(d))&&userAgentHevcSupportIsInaccurate())return Promise.resolve(getUnsupportedResult(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent string: (${f})`),n))}return Promise.all(n.map(f=>{const d=getMediaDecodingInfoKey(f);return i[d]||(i[d]=t.decodingInfo(f))})).then(f=>({supported:!f.some(d=>!d.supported),configurations:n,decodingInfoResults:f})).catch(f=>({supported:!1,configurations:n,decodingInfoResults:[],error:f}))}function makeVideoConfigurations(r){var e;const t=(e=r.videoCodec)==null?void 0:e.split(","),i=getVariantDecodingBitrate(r),s=r.width||640,n=r.height||480,a=r.frameRate||30,o=r.videoRange.toLowerCase();return t?t.map(c=>{const u={contentType:mimeTypeForCodec(fillInMissingAV01Params(c),"video"),width:s,height:n,bitrate:i,framerate:a};return o!=="sdr"&&(u.transferFunction=o),u}):[]}function makeAudioConfigurations(r,e,t){var i;const s=(i=r.audioCodec)==null?void 0:i.split(","),n=getVariantDecodingBitrate(r);return s&&r.audioGroups?r.audioGroups.reduce((a,o)=>{var c;const u=o?(c=e.groups[o])==null?void 0:c.tracks:null;return u?u.reduce((f,d)=>{if(d.groupId===o){const g=parseFloat(d.channels||"");s.forEach(E=>{const m={contentType:mimeTypeForCodec(E,"audio"),bitrate:t?estimatedAudioBitrate(E,n):n};g&&(m.channels=""+g),f.push(m)})}return f},a):a},[]):[]}function estimatedAudioBitrate(r,e){if(e<=1)return 1;let t=128e3;return r==="ec-3"?t=768e3:r==="ac-3"&&(t=64e4),Math.min(e/2,t)}function getVariantDecodingBitrate(r){return Math.ceil(Math.max(r.bitrate*.9,r.averageBitrate)/1e3)*1e3||1}function getMediaDecodingInfoKey(r){let e="";const{audio:t,video:i}=r;if(i){const s=getCodecsForMimeType(i.contentType);e+=`${s}_r${i.height}x${i.width}f${Math.ceil(i.framerate)}${i.transferFunction||"sd"}_${Math.ceil(i.bitrate/1e5)}`}if(t){const s=getCodecsForMimeType(t.contentType);e+=`${i?"_":""}${s}_c${t.channels}`}return e}const HdcpLevels=["NONE","TYPE-0","TYPE-1",null];function isHdcpLevel(r){return HdcpLevels.indexOf(r)>-1}const VideoRangeValues=["SDR","PQ","HLG"];function isVideoRange(r){return!!r&&VideoRangeValues.indexOf(r)>-1}var HlsSkip={No:"",Yes:"YES",v2:"v2"};function getSkipValue(r){const{canSkipUntil:e,canSkipDateRanges:t,age:i}=r,s=i<e/2;return e&&s?t?HlsSkip.v2:HlsSkip.Yes:HlsSkip.No}class HlsUrlParameters{constructor(e,t,i){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=i}addDirectives(e){const t=new self.URL(e);return this.msn!==void 0&&t.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&t.searchParams.set("_HLS_part",this.part.toString()),this.skip&&t.searchParams.set("_HLS_skip",this.skip),t.href}}class Level{constructor(e){if(this._attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.url=void 0,this.frameRate=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.supplemental=void 0,this.videoCodec=void 0,this.width=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.supportedPromise=void 0,this.supportedResult=void 0,this._avgBitrate=0,this._audioGroups=void 0,this._subtitleGroups=void 0,this._urlId=0,this.url=[e.url],this._attrs=[e.attrs],this.bitrate=e.bitrate,e.details&&(this.details=e.details),this.id=e.id||0,this.name=e.name,this.width=e.width||0,this.height=e.height||0,this.frameRate=e.attrs.optionalFloat("FRAME-RATE",0),this._avgBitrate=e.attrs.decimalInteger("AVERAGE-BANDWIDTH"),this.audioCodec=e.audioCodec,this.videoCodec=e.videoCodec,this.codecSet=[e.videoCodec,e.audioCodec].filter(i=>!!i).map(i=>i.substring(0,4)).join(","),"supplemental"in e){var t;this.supplemental=e.supplemental;const i=(t=e.supplemental)==null?void 0:t.videoCodec;i&&i!==e.videoCodec&&(this.codecSet+=`,${i.substring(0,4)}`)}this.addGroupId("audio",e.attrs.AUDIO),this.addGroupId("text",e.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||""}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get videoRange(){return this.attrs["VIDEO-RANGE"]||"SDR"}get score(){return this.attrs.optionalFloat("SCORE",0)}get uri(){return this.url[0]||""}hasAudioGroup(e){return hasGroup(this._audioGroups,e)}hasSubtitleGroup(e){return hasGroup(this._subtitleGroups,e)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(e,t){if(t){if(e==="audio"){let i=this._audioGroups;i||(i=this._audioGroups=[]),i.indexOf(t)===-1&&i.push(t)}else if(e==="text"){let i=this._subtitleGroups;i||(i=this._subtitleGroups=[]),i.indexOf(t)===-1&&i.push(t)}}}get urlId(){return 0}set urlId(e){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){var e;return(e=this.audioGroups)==null?void 0:e[0]}get textGroupId(){var e;return(e=this.subtitleGroups)==null?void 0:e[0]}addFallback(){}}function hasGroup(r,e){return!e||!r?!1:r.indexOf(e)!==-1}function isHdrSupported(){if(typeof matchMedia=="function"){const r=matchMedia("(dynamic-range: high)"),e=matchMedia("bad query");if(r.media!==e.media)return r.matches===!0}return!1}function getVideoSelectionOptions(r,e){let t=!1,i=[];if(r&&(t=r!=="SDR",i=[r]),e){i=e.allowedVideoRanges||VideoRangeValues.slice(0);const s=i.join("")!=="SDR"&&!e.videoCodec;t=e.preferHDR!==void 0?e.preferHDR:s&&isHdrSupported(),t||(i=["SDR"])}return{preferHDR:t,allowedVideoRanges:i}}const omitCircularRefsReplacer=r=>{const e=new WeakSet;return(t,i)=>{if(r&&(i=r(t,i)),typeof i=="object"&&i!==null){if(e.has(i))return;e.add(i)}return i}},stringify=(r,e)=>JSON.stringify(r,omitCircularRefsReplacer(e));function getStartCodecTier(r,e,t,i,s){const n=Object.keys(r),a=i?.channels,o=i?.audioCodec,c=s?.videoCodec,u=a&&parseInt(a)===2;let f=!1,d=!1,g=1/0,E=1/0,m=1/0,T=1/0,S=0,b=[];const{preferHDR:C,allowedVideoRanges:I}=getVideoSelectionOptions(e,s);for(let F=n.length;F--;){const G=r[n[F]];f||(f=G.channels[2]>0),g=Math.min(g,G.minHeight),E=Math.min(E,G.minFramerate),m=Math.min(m,G.minBitrate),I.filter($=>G.videoRanges[$]>0).length>0&&(d=!0)}g=isFiniteNumber(g)?g:0,E=isFiniteNumber(E)?E:0;const L=Math.max(1080,g),k=Math.max(30,E);m=isFiniteNumber(m)?m:t,t=Math.max(m,t),d||(e=void 0);const U=n.length>1;return{codecSet:n.reduce((F,G)=>{const x=r[G];if(G===F)return F;if(b=d?I.filter($=>x.videoRanges[$]>0):[],U){if(x.minBitrate>t)return logStartCodecCandidateIgnored(G,`min bitrate of ${x.minBitrate} > current estimate of ${t}`),F;if(!x.hasDefaultAudio)return logStartCodecCandidateIgnored(G,"no renditions with default or auto-select sound found"),F;if(o&&G.indexOf(o.substring(0,4))%5!==0)return logStartCodecCandidateIgnored(G,`audio codec preference "${o}" not found`),F;if(a&&!u){if(!x.channels[a])return logStartCodecCandidateIgnored(G,`no renditions with ${a} channel sound found (channels options: ${Object.keys(x.channels)})`),F}else if((!o||u)&&f&&x.channels[2]===0)return logStartCodecCandidateIgnored(G,"no renditions with stereo sound found"),F;if(x.minHeight>L)return logStartCodecCandidateIgnored(G,`min resolution of ${x.minHeight} > maximum of ${L}`),F;if(x.minFramerate>k)return logStartCodecCandidateIgnored(G,`min framerate of ${x.minFramerate} > maximum of ${k}`),F;if(!b.some($=>x.videoRanges[$]>0))return logStartCodecCandidateIgnored(G,`no variants with VIDEO-RANGE of ${stringify(b)} found`),F;if(c&&G.indexOf(c.substring(0,4))%5!==0)return logStartCodecCandidateIgnored(G,`video codec preference "${c}" not found`),F;if(x.maxScore<S)return logStartCodecCandidateIgnored(G,`max score of ${x.maxScore} < selected max of ${S}`),F}return F&&(codecsSetSelectionPreferenceValue(G)>=codecsSetSelectionPreferenceValue(F)||x.fragmentError>r[F].fragmentError)?F:(T=x.minIndex,S=x.maxScore,G)},void 0),videoRanges:b,preferHDR:C,minFramerate:E,minBitrate:m,minIndex:T}}function logStartCodecCandidateIgnored(r,e){logger.log(`[abr] start candidates with "${r}" ignored because ${e}`)}function getAudioTracksByGroup(r){return r.reduce((e,t)=>{let i=e.groups[t.groupId];i||(i=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),i.tracks.push(t);const s=t.channels||"2";return i.channels[s]=(i.channels[s]||0)+1,i.hasDefault=i.hasDefault||t.default,i.hasAutoSelect=i.hasAutoSelect||t.autoselect,i.hasDefault&&(e.hasDefaultAudio=!0),i.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function getCodecTiers(r,e,t,i){return r.slice(t,i+1).reduce((s,n,a)=>{if(!n.codecSet)return s;const o=n.audioGroups;let c=s[n.codecSet];c||(s[n.codecSet]=c={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,minIndex:a,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!o,fragmentError:0}),c.minBitrate=Math.min(c.minBitrate,n.bitrate);const u=Math.min(n.height,n.width);return c.minHeight=Math.min(c.minHeight,u),c.minFramerate=Math.min(c.minFramerate,n.frameRate),c.minIndex=Math.min(c.minIndex,a),c.maxScore=Math.max(c.maxScore,n.score),c.fragmentError+=n.fragmentError,c.videoRanges[n.videoRange]=(c.videoRanges[n.videoRange]||0)+1,o&&o.forEach(f=>{if(!f)return;const d=e.groups[f];d&&(c.hasDefaultAudio=c.hasDefaultAudio||e.hasDefaultAudio?d.hasDefault:d.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(d.channels).forEach(g=>{c.channels[g]=(c.channels[g]||0)+d.channels[g]}))}),s},{})}function getBasicSelectionOption(r){if(!r)return r;const{lang:e,assocLang:t,characteristics:i,channels:s,audioCodec:n}=r;return{lang:e,assocLang:t,characteristics:i,channels:s,audioCodec:n}}function findMatchingOption(r,e,t){if("attrs"in r){const i=e.indexOf(r);if(i!==-1)return i}for(let i=0;i<e.length;i++){const s=e[i];if(matchesOption(r,s,t))return i}return-1}function matchesOption(r,e,t){const{groupId:i,name:s,lang:n,assocLang:a,default:o}=r,c=r.forced;return(i===void 0||e.groupId===i)&&(s===void 0||e.name===s)&&(n===void 0||languagesMatch(n,e.lang))&&(n===void 0||e.assocLang===a)&&(o===void 0||e.default===o)&&(c===void 0||e.forced===c)&&(!("characteristics"in r)||characteristicsMatch(r.characteristics||"",e.characteristics))&&(t===void 0||t(r,e))}function languagesMatch(r,e="--"){return r.length===e.length?r===e:r.startsWith(e)||e.startsWith(r)}function characteristicsMatch(r,e=""){const t=r.split(","),i=e.split(",");return t.length===i.length&&!t.some(s=>i.indexOf(s)===-1)}function audioMatchPredicate(r,e){const{audioCodec:t,channels:i}=r;return(t===void 0||(e.audioCodec||"").substring(0,4)===t.substring(0,4))&&(i===void 0||i===(e.channels||"2"))}function findClosestLevelWithAudioGroup(r,e,t,i,s){const n=e[i],o=e.reduce((g,E,m)=>{const T=E.uri;return(g[T]||(g[T]=[])).push(m),g},{})[n.uri];o.length>1&&(i=Math.max.apply(Math,o));const c=n.videoRange,u=n.frameRate,f=n.codecSet.substring(0,4),d=searchDownAndUpList(e,i,g=>{if(g.videoRange!==c||g.frameRate!==u||g.codecSet.substring(0,4)!==f)return!1;const E=g.audioGroups,m=t.filter(T=>!E||E.indexOf(T.groupId)!==-1);return findMatchingOption(r,m,s)>-1});return d>-1?d:searchDownAndUpList(e,i,g=>{const E=g.audioGroups,m=t.filter(T=>!E||E.indexOf(T.groupId)!==-1);return findMatchingOption(r,m,s)>-1})}function searchDownAndUpList(r,e,t){for(let i=e;i>-1;i--)if(t(r[i]))return i;for(let i=e+1;i<r.length;i++)if(t(r[i]))return i;return-1}function useAlternateAudio(r,e){var t;return!!r&&r!==((t=e.loadLevelObj)==null?void 0:t.uri)}class AbrController extends Logger{constructor(e){super("abr",e.logger),this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.rebufferNotice=-1,this.supportedCache={},this.bwEstimator=void 0,this._abandonRulesCheck=t=>{var i;const{fragCurrent:s,partCurrent:n,hls:a}=this,{autoLevelEnabled:o,media:c}=a;if(!s||!c)return;const u=performance.now(),f=n?n.stats:s.stats,d=n?n.duration:s.duration,g=u-f.loading.start,E=a.minAutoLevel,m=s.level,T=this._nextAutoLevel;if(f.aborted||f.loaded&&f.loaded===f.total||m<=E){this.clearTimer(),this._nextAutoLevel=-1;return}if(!o)return;const S=T>-1&&T!==m,b=!!t||S;if(!b&&(c.paused||!c.playbackRate||!c.readyState))return;const C=a.mainForwardBufferInfo;if(!b&&C===null)return;const I=this.bwEstimator.getEstimateTTFB(),L=Math.abs(c.playbackRate);if(g<=Math.max(I,1e3*(d/(L*2))))return;const k=C?C.len/L:0,U=f.loading.first?f.loading.first-f.loading.start:-1,O=f.loaded&&U>-1,F=this.getBwEstimate(),G=a.levels,x=G[m],$=Math.max(f.loaded,Math.round(d*(s.bitrate||x.averageBitrate)/8));let X=O?g-U:g;X<1&&O&&(X=Math.min(g,f.loaded*8/F));const Q=O?f.loaded*1e3/X:0,ee=I/1e3,te=Q?($-f.loaded)/Q:$*8/F+ee;if(te<=k)return;const re=Q?Q*8:F,me=((i=t?.details||this.hls.latestLevelDetails)==null?void 0:i.live)===!0,H=this.hls.config.abrBandWidthUpFactor;let z=Number.POSITIVE_INFINITY,ie;for(ie=m-1;ie>E;ie--){const Pe=G[ie].maxBitrate,ae=!G[ie].details||me;if(z=this.getTimeToLoadFrag(ee,re,d*Pe,ae),z<Math.min(k,d+ee))break}if(z>=te||z>d*10)return;O?this.bwEstimator.sample(g-Math.min(I,U),f.loaded):this.bwEstimator.sampleTTFB(g);const ne=G[ie].maxBitrate;this.getBwEstimate()*H>ne&&this.resetEstimator(ne);const he=this.findBestLevel(ne,E,ie,0,k,1,1);he>-1&&(ie=he),this.warn(`Fragment ${s.sn}${n?" part "+n.index:""} of level ${m} is loading too slowly;
279
279
  Fragment duration: ${s.duration.toFixed(3)}
280
280
  Time to underbuffer: ${k.toFixed(3)} s
281
281
  Estimated load time for current fragment: ${te.toFixed(3)} s
@@ -314,4 +314,4 @@ Schedule: ${c.map(T=>segmentToString(T))} pos: ${this.timelinePos}`),f.length&&t
314
314
  `).split(`
315
315
  `),u=[],f=e?toMpegTsClockFromTimescale(e.baseTime,e.timescale):0;let d="00:00.000",g=0,E=0,m,T=!0;o.oncue=function(S){const b=t[i];let C=t.ccOffset;const I=(g-f)/9e4;if(b!=null&&b.new&&(E!==void 0?C=t.ccOffset=b.start:calculateOffset(t,i,I)),I){if(!e){m=new Error("Missing initPTS for VTT MPEGTS");return}C=I-t.presentationOffset}const L=S.endTime-S.startTime,k=normalizePts((S.startTime+C-E)*9e4,s*9e4)/9e4;S.startTime=Math.max(k,0),S.endTime=Math.max(k+L,0);const U=S.text.trim();S.text=decodeURIComponent(encodeURIComponent(U)),S.id||(S.id=generateCueId(S.startTime,S.endTime,U)),S.endTime>0&&u.push(S)},o.onparsingerror=function(S){m=S},o.onflush=function(){if(m){a(m);return}n(u)},c.forEach(S=>{if(T)if(startsWith(S,"X-TIMESTAMP-MAP=")){T=!1,S.slice(16).split(",").forEach(b=>{startsWith(b,"LOCAL:")?d=b.slice(6):startsWith(b,"MPEGTS:")&&(g=parseInt(b.slice(7)))});try{E=cueString2millis(d)/1e3}catch(b){m=b}return}else S===""&&(T=!1);o.parse(S+`
316
316
  `)}),o.flush()}const IMSC1_CODEC="stpp.ttml.im1t",HMSF_REGEX=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,TIME_UNIT_REGEX=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,textAlignToLineAlign={left:"start",center:"center",right:"end",start:"start",end:"end"};function parseIMSC1(r,e,t,i){const s=findBox(new Uint8Array(r),["mdat"]);if(s.length===0){i(new Error("Could not parse IMSC1 mdat"));return}const n=s.map(o=>utf8ArrayToStr(o)),a=toTimescaleFromScale(e.baseTime,1,e.timescale);try{n.forEach(o=>t(parseTTML(o,a)))}catch(o){i(o)}}function parseTTML(r,e){const s=new DOMParser().parseFromString(r,"text/xml").getElementsByTagName("tt")[0];if(!s)throw new Error("Invalid ttml");const n={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},a=Object.keys(n).reduce((d,g)=>(d[g]=s.getAttribute(`ttp:${g}`)||n[g],d),{}),o=s.getAttribute("xml:space")!=="preserve",c=collectionToDictionary(getElementCollection(s,"styling","style")),u=collectionToDictionary(getElementCollection(s,"layout","region")),f=getElementCollection(s,"body","[begin]");return[].map.call(f,d=>{const g=getTextContent(d,o);if(!g||!d.hasAttribute("begin"))return null;const E=parseTtmlTime(d.getAttribute("begin"),a),m=parseTtmlTime(d.getAttribute("dur"),a);let T=parseTtmlTime(d.getAttribute("end"),a);if(E===null)throw timestampParsingError(d);if(T===null){if(m===null)throw timestampParsingError(d);T=E+m}const S=new VTTCue(E-e,T-e,g);S.id=generateCueId(S.startTime,S.endTime,S.text);const b=u[d.getAttribute("region")],C=c[d.getAttribute("style")],I=getTtmlStyles(b,C,c),{textAlign:L}=I;if(L){const k=textAlignToLineAlign[L];k&&(S.lineAlign=k),S.align=L}return _extends(S,I),S}).filter(d=>d!==null)}function getElementCollection(r,e,t){const i=r.getElementsByTagName(e)[0];return i?[].slice.call(i.querySelectorAll(t)):[]}function collectionToDictionary(r){return r.reduce((e,t)=>{const i=t.getAttribute("xml:id");return i&&(e[i]=t),e},{})}function getTextContent(r,e){return[].slice.call(r.childNodes).reduce((t,i,s)=>{var n;return i.nodeName==="br"&&s?t+`
317
- `:(n=i.childNodes)!=null&&n.length?getTextContent(i,e):e?t+i.textContent.trim().replace(/\s+/g," "):t+i.textContent},"")}function getTtmlStyles(r,e,t){const i="http://www.w3.org/ns/ttml#styling";let s=null;const n=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],a=r!=null&&r.hasAttribute("style")?r.getAttribute("style"):null;return a&&t.hasOwnProperty(a)&&(s=t[a]),n.reduce((o,c)=>{const u=getAttributeNS(e,i,c)||getAttributeNS(r,i,c)||getAttributeNS(s,i,c);return u&&(o[c]=u),o},{})}function getAttributeNS(r,e,t){return r&&r.hasAttributeNS(e,t)?r.getAttributeNS(e,t):null}function timestampParsingError(r){return new Error(`Could not parse ttml timestamp ${r}`)}function parseTtmlTime(r,e){if(!r)return null;let t=parseTimeStamp(r);return t===null&&(HMSF_REGEX.test(r)?t=parseHoursMinutesSecondsFrames(r,e):TIME_UNIT_REGEX.test(r)&&(t=parseTimeUnits(r,e))),t}function parseHoursMinutesSecondsFrames(r,e){const t=HMSF_REGEX.exec(r),i=(t[4]|0)+(t[5]|0)/e.subFrameRate;return(t[1]|0)*3600+(t[2]|0)*60+(t[3]|0)+i/e.frameRate}function parseTimeUnits(r,e){const t=TIME_UNIT_REGEX.exec(r),i=Number(t[1]);switch(t[2]){case"h":return i*3600;case"m":return i*60;case"ms":return i*1e3;case"f":return i/e.frameRate;case"t":return i/e.tickRate}return i}class OutputFilter{constructor(e,t){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=e,this.trackName=t}dispatchCue(){this.startTime!==null&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)}newCue(e,t,i){(this.startTime===null||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=i,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}class TimelineController{constructor(e){this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=newVTTCCs(),this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},e.on(Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Events.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(Events.FRAG_LOADING,this.onFragLoading,this),e.on(Events.FRAG_LOADED,this.onFragLoaded,this),e.on(Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(Events.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(Events.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Events.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(Events.FRAG_LOADING,this.onFragLoading,this),e.off(Events.FRAG_LOADED,this.onFragLoaded,this),e.off(Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(Events.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(Events.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.media=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){const e=new OutputFilter(this,"textTrack1"),t=new OutputFilter(this,"textTrack2"),i=new OutputFilter(this,"textTrack3"),s=new OutputFilter(this,"textTrack4");this.cea608Parser1=new Cea608Parser(1,e,t),this.cea608Parser2=new Cea608Parser(3,i,s)}addCues(e,t,i,s,n){let a=!1;for(let o=n.length;o--;){const c=n[o],u=intersection(c[0],c[1],t,i);if(u>=0&&(c[0]=Math.min(c[0],t),c[1]=Math.max(c[1],i),a=!0,u/(i-t)>.5))return}if(a||n.push([t,i]),this.config.renderTextTracksNatively){const o=this.captionsTracks[e];this.Cues.newCue(o,t,i,s)}else{const o=this.Cues.newCue(null,t,i,s);this.hls.trigger(Events.CUES_PARSED,{type:"captions",cues:o,track:e})}}onInitPtsFound(e,{frag:t,id:i,initPTS:s,timescale:n,trackId:a}){const{unparsedVttFrags:o}=this;i===PlaylistLevelType.MAIN&&(this.initPTS[t.cc]={baseTime:s,timescale:n,trackId:a}),o.length&&(this.unparsedVttFrags=[],o.forEach(c=>{this.initPTS[c.frag.cc]?this.onFragLoaded(Events.FRAG_LOADED,c):this.hls.trigger(Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:c.frag,error:new Error("Subtitle discontinuity domain does not match main")})}))}getExistingTrack(e,t){const{media:i}=this;if(i)for(let s=0;s<i.textTracks.length;s++){const n=i.textTracks[s];if(canReuseVttTextTrack(n,{name:e,lang:t,characteristics:"transcribes-spoken-dialog,describes-music-and-sound"}))return n}return null}createCaptionsTrack(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)}createNativeTrack(e){if(this.captionsTracks[e])return;const{captionsProperties:t,captionsTracks:i,media:s}=this,{label:n,languageCode:a}=t[e],o=this.getExistingTrack(n,a);if(o)i[e]=o,clearCurrentCues(i[e]),sendAddTrackEvent(i[e],s);else{const c=this.createTextTrack("captions",n,a);c&&(c[e]=!0,i[e]=c)}}createNonNativeTrack(e){if(this.nonNativeCaptionsTracks[e])return;const t=this.captionsProperties[e];if(!t)return;const i=t.label,s={_id:e,label:i,kind:"captions",default:t.media?!!t.media.default:!1,closedCaptions:t.media};this.nonNativeCaptionsTracks[e]=s,this.hls.trigger(Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[s]})}createTextTrack(e,t,i){const s=this.media;if(s)return s.addTextTrack(e,t,i)}onMediaAttaching(e,t){this.media=t.media,t.mediaSource||this._cleanTracks()}onMediaDetaching(e,t){const i=!!t.transferMedia;if(this.media=null,i)return;const{captionsTracks:s}=this;Object.keys(s).forEach(n=>{clearCurrentCues(s[n]),delete s[n]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=newVTTCCs(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:e}=this;if(!e)return;const t=e.textTracks;if(t)for(let i=0;i<t.length;i++)clearCurrentCues(t[i])}onSubtitleTracksUpdated(e,t){const i=t.subtitleTracks||[],s=i.some(n=>n.textCodec===IMSC1_CODEC);if(this.config.enableWebVTT||s&&this.config.enableIMSC1){if(subtitleOptionsIdentical(this.tracks,i)){this.tracks=i;return}if(this.textTracks=[],this.tracks=i,this.config.renderTextTracksNatively){const a=this.media,o=a?filterSubtitleTracks(a.textTracks):null;if(this.tracks.forEach((c,u)=>{let f;if(o){let d=null;for(let g=0;g<o.length;g++)if(o[g]&&canReuseVttTextTrack(o[g],c)){d=o[g],o[g]=null;break}d&&(f=d)}if(f)clearCurrentCues(f);else{const d=captionsOrSubtitlesFromCharacteristics(c);f=this.createTextTrack(d,c.name,c.lang),f&&(f.mode="disabled")}f&&this.textTracks.push(f)}),o!=null&&o.length){const c=o.filter(u=>u!==null).map(u=>u.label);c.length&&this.hls.logger.warn(`Media element contains unused subtitle tracks: ${c.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const a=this.tracks.map(o=>({label:o.name,kind:o.type.toLowerCase(),default:o.default,subtitleTrack:o}));this.hls.trigger(Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:a})}}}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach(i=>{const s=/(?:CC|SERVICE)([1-4])/.exec(i.instreamId);if(!s)return;const n=`textTrack${s[1]}`,a=this.captionsProperties[n];a&&(a.label=i.name,i.lang&&(a.languageCode=i.lang),a.media=i)})}closedCaptionsForLevel(e){const t=this.hls.levels[e.level];return t?.attrs["CLOSED-CAPTIONS"]}onFragLoading(e,t){if(this.enabled&&t.frag.type===PlaylistLevelType.MAIN){var i,s;const{cea608Parser1:n,cea608Parser2:a,lastSn:o}=this,{cc:c,sn:u}=t.frag,f=(i=(s=t.part)==null?void 0:s.index)!=null?i:-1;n&&a&&(u!==o+1||u===o&&f!==this.lastPartIndex+1||c!==this.lastCc)&&(n.reset(),a.reset()),this.lastCc=c,this.lastSn=u,this.lastPartIndex=f}}onFragLoaded(e,t){const{frag:i,payload:s}=t;if(i.type===PlaylistLevelType.SUBTITLE)if(s.byteLength){const n=i.decryptdata,a="stats"in t;if(n==null||!n.encrypted||a){const o=this.tracks[i.level],c=this.vttCCs;c[i.cc]||(c[i.cc]={start:i.start,prevCC:this.prevCC,new:!0},this.prevCC=i.cc),o&&o.textCodec===IMSC1_CODEC?this._parseIMSC1(i,s):this._parseVTTs(t)}}else this.hls.trigger(Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const i=this.hls;parseIMSC1(t,this.initPTS[e.cc],s=>{this._appendCues(s,e.level),i.trigger(Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},s=>{i.logger.log(`Failed to parse IMSC1: ${s}`),i.trigger(Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:s})})}_parseVTTs(e){var t;const{frag:i,payload:s}=e,{initPTS:n,unparsedVttFrags:a}=this,o=n.length-1;if(!n[i.cc]&&o===-1){a.push(e);return}const c=this.hls,u=(t=i.initSegment)!=null&&t.data?appendUint8Array(i.initSegment.data,new Uint8Array(s)).buffer:s;parseWebVTT(u,this.initPTS[i.cc],this.vttCCs,i.cc,i.start,f=>{this._appendCues(f,i.level),c.trigger(Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:i})},f=>{const d=f.message==="Missing initPTS for VTT MPEGTS";d?a.push(e):this._fallbackToIMSC1(i,s),c.logger.log(`Failed to parse VTT cue: ${f}`),!(d&&o>i.cc)&&c.trigger(Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:f})})}_fallbackToIMSC1(e,t){const i=this.tracks[e.level];i.textCodec||parseIMSC1(t,this.initPTS[e.cc],()=>{i.textCodec=IMSC1_CODEC,this._parseIMSC1(e,t)},()=>{i.textCodec="wvtt"})}_appendCues(e,t){const i=this.hls;if(this.config.renderTextTracksNatively){const s=this.textTracks[t];if(!s||s.mode==="disabled")return;e.forEach(n=>addCueToTrack(s,n))}else{const s=this.tracks[t];if(!s)return;const n=s.default?"default":"subtitles"+t;i.trigger(Events.CUES_PARSED,{type:"subtitles",cues:e,track:n})}}onFragDecrypted(e,t){const{frag:i}=t;i.type===PlaylistLevelType.SUBTITLE&&this.onFragLoaded(Events.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){if(!this.enabled||!this.config.enableCEA708Captions)return;const{frag:i,samples:s}=t;if(!(i.type===PlaylistLevelType.MAIN&&this.closedCaptionsForLevel(i)==="NONE"))for(let n=0;n<s.length;n++){const a=s[n].bytes;if(a){this.cea608Parser1||this.initCea608Parsers();const o=this.extractCea608Data(a);this.cea608Parser1.addData(s[n].pts,o[0]),this.cea608Parser2.addData(s[n].pts,o[1])}}}onBufferFlushing(e,{startOffset:t,endOffset:i,endOffsetSubtitles:s,type:n}){const{media:a}=this;if(!(!a||a.currentTime<i)){if(!n||n==="video"){const{captionsTracks:o}=this;Object.keys(o).forEach(c=>removeCuesInRange(o[c],t,i))}if(this.config.renderTextTracksNatively&&t===0&&s!==void 0){const{textTracks:o}=this;Object.keys(o).forEach(c=>removeCuesInRange(o[c],t,s))}}}extractCea608Data(e){const t=[[],[]],i=e[0]&31;let s=2;for(let n=0;n<i;n++){const a=e[s++],o=127&e[s++],c=127&e[s++];if(o===0&&c===0)continue;if((4&a)!==0){const f=3&a;(f===0||f===1)&&(t[f].push(o),t[f].push(c))}}return t}}function captionsOrSubtitlesFromCharacteristics(r){return r.characteristics&&/transcribes-spoken-dialog/gi.test(r.characteristics)&&/describes-music-and-sound/gi.test(r.characteristics)?"captions":"subtitles"}function canReuseVttTextTrack(r,e){return!!r&&r.kind===captionsOrSubtitlesFromCharacteristics(e)&&subtitleTrackMatchesTextTrack(e,r)}function intersection(r,e,t,i){return Math.min(e,i)-Math.max(r,t)}function newVTTCCs(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}const WHITESPACE_CHAR=/\s/,Cues={newCue(r,e,t,i){const s=[];let n,a,o,c,u;const f=self.VTTCue||self.TextTrackCue;for(let g=0;g<i.rows.length;g++)if(n=i.rows[g],o=!0,c=0,u="",!n.isEmpty()){var d;for(let T=0;T<n.chars.length;T++)WHITESPACE_CHAR.test(n.chars[T].uchar)&&o?c++:(u+=n.chars[T].uchar,o=!1);n.cueStartTime=e,e===t&&(t+=1e-4),c>=16?c--:c++;const E=fixLineBreaks(u.trim()),m=generateCueId(e,t,E);r!=null&&(d=r.cues)!=null&&d.getCueById(m)||(a=new f(e,t,E),a.id=m,a.line=g+1,a.align="left",a.position=10+Math.min(80,Math.floor(c*8/32)*10),s.push(a))}return r&&s.length&&(s.sort((g,E)=>g.line==="auto"||E.line==="auto"?0:g.line>8&&E.line>8?E.line-g.line:g.line-E.line),s.forEach(g=>addCueToTrack(r,g))),s}};function fetchSupported(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch{}return!1}const BYTERANGE=/(\d+)-(\d+)\/(\d+)/;class FetchLoader{constructor(e){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=null,this.response=null,this.controller=void 0,this.context=null,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=e.fetchSetup||getRequest,this.controller=new self.AbortController,this.stats=new LoadStats}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}abortInternal(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,t,i){const s=this.stats;if(s.loading.start)throw new Error("Loader can only be used once.");s.loading.start=self.performance.now();const n=getRequestParameters(e,this.controller.signal),a=e.responseType==="arraybuffer",o=a?"byteLength":"length",{maxTimeToFirstByteMs:c,maxLoadTimeMs:u}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=i,this.request=this.fetchSetup(e,n),self.clearTimeout(this.requestTimeout),t.timeout=c&&isFiniteNumber(c)?c:u,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(s,e,this.response))},t.timeout),(isPromise(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then(d=>{var g;this.response=this.loader=d;const E=Math.max(self.performance.now(),s.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=u,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(s,e,this.response))},u-(E-s.loading.start)),!d.ok){const{status:T,statusText:S}=d;throw new FetchError(S||"fetch, bad network response",T,d)}s.loading.first=E,s.total=getContentLength(d.headers)||s.total;const m=(g=this.callbacks)==null?void 0:g.onProgress;return m&&isFiniteNumber(t.highWaterMark)?this.loadProgressively(d,s,e,t.highWaterMark,m):a?d.arrayBuffer():e.responseType==="json"?d.json():d.text()}).then(d=>{var g,E;const m=this.response;if(!m)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),s.loading.end=Math.max(self.performance.now(),s.loading.first);const T=d[o];T&&(s.loaded=s.total=T);const S={url:m.url,data:d,code:m.status},b=(g=this.callbacks)==null?void 0:g.onProgress;b&&!isFiniteNumber(t.highWaterMark)&&b(s,e,d,m),(E=this.callbacks)==null||E.onSuccess(S,s,e,m)}).catch(d=>{var g;if(self.clearTimeout(this.requestTimeout),s.aborted)return;const E=d&&d.code||0,m=d?d.message:null;(g=this.callbacks)==null||g.onError({code:E,text:m},e,d?d.details:null,s)})}getCacheAge(){let e=null;if(this.response){const t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,i,s=0,n){const a=new ChunkCache,o=e.body.getReader(),c=()=>o.read().then(u=>{if(u.done)return a.dataLength&&n(t,i,a.flush().buffer,e),Promise.resolve(new ArrayBuffer(0));const f=u.value,d=f.length;return t.loaded+=d,d<s||a.dataLength?(a.push(f),a.dataLength>=s&&n(t,i,a.flush().buffer,e)):n(t,i,f.buffer,e),c()}).catch(()=>Promise.reject());return c()}}function getRequestParameters(r,e){const t={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(_extends({},r.headers))};return r.rangeEnd&&t.headers.set("Range","bytes="+r.rangeStart+"-"+String(r.rangeEnd-1)),t}function getByteRangeLength(r){const e=BYTERANGE.exec(r);if(e)return parseInt(e[2])-parseInt(e[1])+1}function getContentLength(r){const e=r.get("Content-Range");if(e){const i=getByteRangeLength(e);if(isFiniteNumber(i))return i}const t=r.get("Content-Length");if(t)return parseInt(t)}function getRequest(r,e){return new self.Request(r.url,e)}class FetchError extends Error{constructor(e,t,i){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=i}}const AGE_HEADER_LINE_REGEX=/^age:\s*[\d.]+\s*$/im;class XhrLoader{constructor(e){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=null,this.loader=null,this.stats=void 0,this.xhrSetup=e&&e.xhrSetup||null,this.stats=new LoadStats,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null}abortInternal(){const e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,e.readyState!==4&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,t,i){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=i,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e||!t)return;const i=this.loader=new self.XMLHttpRequest,s=this.stats;s.loading.first=0,s.loaded=0,s.aborted=!1;const n=this.xhrSetup;n?Promise.resolve().then(()=>{if(!(this.loader!==i||this.stats.aborted))return n(i,t.url)}).catch(a=>{if(!(this.loader!==i||this.stats.aborted))return i.open("GET",t.url,!0),n(i,t.url)}).then(()=>{this.loader!==i||this.stats.aborted||this.openAndSendXhr(i,t,e)}).catch(a=>{var o;(o=this.callbacks)==null||o.onError({code:i.status,text:a.message},t,i,s)}):this.openAndSendXhr(i,t,e)}openAndSendXhr(e,t,i){e.readyState||e.open("GET",t.url,!0);const s=t.headers,{maxTimeToFirstByteMs:n,maxLoadTimeMs:a}=i.loadPolicy;if(s)for(const o in s)e.setRequestHeader(o,s[o]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),i.timeout=n&&isFiniteNumber(n)?n:a,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),i.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:i}=this;if(!e||!t)return;const s=t.readyState,n=this.config;if(!i.aborted&&s>=2&&(i.loading.first===0&&(i.loading.first=Math.max(self.performance.now(),i.loading.start),n.timeout!==n.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),n.timeout=n.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.loadPolicy.maxLoadTimeMs-(i.loading.first-i.loading.start)))),s===4)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const u=t.status,f=t.responseType==="text"?t.responseText:null;if(u>=200&&u<300){const m=f??t.response;if(m!=null){var a,o;i.loading.end=Math.max(self.performance.now(),i.loading.first);const T=t.responseType==="arraybuffer"?m.byteLength:m.length;i.loaded=i.total=T,i.bwEstimate=i.total*8e3/(i.loading.end-i.loading.first);const S=(a=this.callbacks)==null?void 0:a.onProgress;S&&S(i,e,m,t);const b={url:t.responseURL,data:m,code:u};(o=this.callbacks)==null||o.onSuccess(b,i,e,t);return}}const d=n.loadPolicy.errorRetry,g=i.retry,E={url:e.url,data:void 0,code:u};if(shouldRetry(d,g,!1,E))this.retry(d);else{var c;logger.error(`${u} while loading ${e.url}`),(c=this.callbacks)==null||c.onError({code:u,text:t.statusText},e,t,i)}}}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry,t=this.stats.retry;if(shouldRetry(e,t,!0))this.retry(e);else{var i;logger.warn(`timeout while loading ${(i=this.context)==null?void 0:i.url}`);const s=this.callbacks;s&&(this.abortInternal(),s.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:i}=this;this.retryDelay=getRetryDelay(e,i.retry),i.retry++,logger.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${t?.url}, retrying ${i.retry}/${e.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(e){const t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)}getCacheAge(){let e=null;if(this.loader&&AGE_HEADER_LINE_REGEX.test(this.loader.getAllResponseHeaders())){const t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.loader&&new RegExp(`^${e}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}}const defaultLoadPolicy={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},hlsDefaultConfig=_objectSpread2(_objectSpread2({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,maxDevicePixelRatio:Number.POSITIVE_INFINITY,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,startOnSegmentBoundary:!1,maxBufferSize:60*1e3*1e3,maxFragLookUpTolerance:.25,maxBufferHole:.1,detectStallWithCurrentTimeMs:1250,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,nudgeOnVideoHole:!0,liveSyncMode:"edge",liveSyncDurationCount:3,liveSyncOnStallIncrease:1,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,ignorePlaylistParsingErrors:!1,loader:XhrLoader,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:AbrController,bufferController:BufferController,capLevelController:CapLevelController,errorController:ErrorController,fpsController:FPSController,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrEwmaDefaultEstimateMax:5e6,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:requestMediaKeySystemAccess,requireKeySystemAccessOnStart:!1,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableEmsgKLVMetadata:!1,enableID3MetadataCues:!0,enableInterstitialPlayback:!0,interstitialAppendInPlace:!0,interstitialLiveLookAhead:10,useMediaCapabilities:!0,preserveManualLevelOnError:!1,certLoadPolicy:{default:defaultLoadPolicy},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},interstitialAssetListLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:3e4,timeoutRetry:{maxNumRetry:0,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:0,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},timelineConfig()),{},{subtitleStreamController:SubtitleStreamController,subtitleTrackController:SubtitleTrackController,timelineController:TimelineController,audioStreamController:AudioStreamController,audioTrackController:AudioTrackController,emeController:EMEController,cmcdController:CMCDController,contentSteeringController:ContentSteeringController,interstitialsController:InterstitialsController});function timelineConfig(){return{cueHandler:Cues,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function mergeConfig(r,e,t){if((e.liveSyncDurationCount||e.liveMaxLatencyDurationCount)&&(e.liveSyncDuration||e.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(e.liveMaxLatencyDurationCount!==void 0&&(e.liveSyncDurationCount===void 0||e.liveMaxLatencyDurationCount<=e.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(e.liveMaxLatencyDuration!==void 0&&(e.liveSyncDuration===void 0||e.liveMaxLatencyDuration<=e.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const i=deepCpy(r),s=["manifest","level","frag"],n=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return s.forEach(a=>{const o=`${a==="level"?"playlist":a}LoadPolicy`,c=e[o]===void 0,u=[];n.forEach(f=>{const d=`${a}Loading${f}`,g=e[d];if(g!==void 0&&c){u.push(d);const E=i[o].default;switch(e[o]={default:E},f){case"TimeOut":E.maxLoadTimeMs=g,E.maxTimeToFirstByteMs=g;break;case"MaxRetry":E.errorRetry.maxNumRetry=g,E.timeoutRetry.maxNumRetry=g;break;case"RetryDelay":E.errorRetry.retryDelayMs=g,E.timeoutRetry.retryDelayMs=g;break;case"MaxRetryTimeout":E.errorRetry.maxRetryDelayMs=g,E.timeoutRetry.maxRetryDelayMs=g;break}}}),u.length&&t.warn(`hls.js config: "${u.join('", "')}" setting(s) are deprecated, use "${o}": ${stringify(e[o])}`)}),_objectSpread2(_objectSpread2({},i),e)}function deepCpy(r){return r&&typeof r=="object"?Array.isArray(r)?r.map(deepCpy):Object.keys(r).reduce((e,t)=>(e[t]=deepCpy(r[t]),e),{}):r}function enableStreamingMode(r,e){const t=r.loader;t!==FetchLoader&&t!==XhrLoader?(e.log("[config]: Custom loader detected, cannot enable progressive streaming"),r.progressive=!1):fetchSupported()&&(r.loader=FetchLoader,r.progressive=!0,r.enableSoftwareAES=!0,e.log("[config]: Progressive streaming enabled, using FetchLoader"))}const MAX_START_GAP_JUMP=2,SKIP_BUFFER_HOLE_STEP_SECONDS=.1,SKIP_BUFFER_RANGE_START=.05,TICK_INTERVAL$1=100;class GapController extends TaskLoop{constructor(e,t){super("gap-controller",e.logger),this.hls=void 0,this.fragmentTracker=void 0,this.media=null,this.mediaSource=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.buffered={},this.lastCurrentTime=0,this.ended=0,this.waiting=0,this.onMediaPlaying=()=>{this.ended=0,this.waiting=0},this.onMediaWaiting=()=>{var i;(i=this.media)!=null&&i.seeking||(this.waiting=self.performance.now(),this.tick())},this.onMediaEnded=()=>{if(this.hls){var i;this.ended=((i=this.media)==null?void 0:i.currentTime)||1,this.hls.trigger(Events.MEDIA_ENDED,{stalled:!1})}},this.hls=e,this.fragmentTracker=t,this.registerListeners()}registerListeners(){const{hls:e}=this;e&&(e.on(Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(Events.BUFFER_APPENDED,this.onBufferAppended,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(Events.BUFFER_APPENDED,this.onBufferAppended,this))}destroy(){super.destroy(),this.unregisterListeners(),this.media=this.hls=this.fragmentTracker=null,this.mediaSource=void 0}onMediaAttached(e,t){this.setInterval(TICK_INTERVAL$1),this.mediaSource=t.mediaSource;const i=this.media=t.media;addEventListener(i,"playing",this.onMediaPlaying),addEventListener(i,"waiting",this.onMediaWaiting),addEventListener(i,"ended",this.onMediaEnded)}onMediaDetaching(e,t){this.clearInterval();const{media:i}=this;i&&(removeEventListener(i,"playing",this.onMediaPlaying),removeEventListener(i,"waiting",this.onMediaWaiting),removeEventListener(i,"ended",this.onMediaEnded),this.media=null),this.mediaSource=void 0}onBufferAppended(e,t){this.buffered=t.timeRanges}get hasBuffered(){return Object.keys(this.buffered).length>0}tick(){var e;if(!((e=this.media)!=null&&e.readyState)||!this.hasBuffered)return;const t=this.media.currentTime;this.poll(t,this.lastCurrentTime),this.lastCurrentTime=t}poll(e,t){var i,s;const n=(i=this.hls)==null?void 0:i.config;if(!n)return;const a=this.media;if(!a)return;const{seeking:o}=a,c=this.seeking&&!o,u=!this.seeking&&o,f=a.paused&&!o||a.ended||a.playbackRate===0;if(this.seeking=o,e!==t){t&&(this.ended=0),this.moved=!0,o||(this.nudgeRetry=0,n.nudgeOnVideoHole&&!f&&e>t&&this.nudgeOnVideoHole(e,t)),this.waiting===0&&this.stallResolved(e);return}if(u||c){c&&this.stallResolved(e);return}if(f){this.nudgeRetry=0,this.stallResolved(e),!this.ended&&a.ended&&this.hls&&(this.ended=e||1,this.hls.trigger(Events.MEDIA_ENDED,{stalled:!1}));return}if(!BufferHelper.getBuffered(a).length){this.nudgeRetry=0;return}const d=BufferHelper.bufferInfo(a,e,0),g=d.nextStart||0,E=this.fragmentTracker;if(o&&E&&this.hls){const U=getInFlightDependency(this.hls.inFlightFragments,e),O=d.len>MAX_START_GAP_JUMP,F=!g||U||g-e>MAX_START_GAP_JUMP&&!E.getPartialFragment(e);if(O||F)return;this.moved=!1}const m=(s=this.hls)==null?void 0:s.latestLevelDetails;if(!this.moved&&this.stalled!==null&&E){if(!(d.len>0)&&!g)return;const O=Math.max(g,d.start||0)-e,G=!!(m!=null&&m.live)?m.targetduration*2:MAX_START_GAP_JUMP,x=appendedFragAtPosition(e,E);if(O>0&&(O<=G||x)){a.paused||this._trySkipBufferHole(x);return}}const T=n.detectStallWithCurrentTimeMs,S=self.performance.now(),b=this.waiting;let C=this.stalled;if(C===null)if(b>0&&S-b<T)C=this.stalled=b;else{this.stalled=S;return}const I=S-C;if(!o&&(I>=T||b)&&this.hls){var L;if(((L=this.mediaSource)==null?void 0:L.readyState)==="ended"&&!(m!=null&&m.live)&&Math.abs(e-(m?.edge||0))<1){if(this.ended)return;this.ended=e||1,this.hls.trigger(Events.MEDIA_ENDED,{stalled:!0});return}if(this._reportStall(d),!this.media||!this.hls)return}const k=BufferHelper.bufferInfo(a,e,n.maxBufferHole);this._tryFixBufferStall(k,I,e)}stallResolved(e){const t=this.stalled;if(t&&this.hls&&(this.stalled=null,this.stallReported)){const i=self.performance.now()-t;this.log(`playback not stuck anymore @${e}, after ${Math.round(i)}ms`),this.stallReported=!1,this.waiting=0,this.hls.trigger(Events.STALL_RESOLVED,{})}}nudgeOnVideoHole(e,t){var i;const s=this.buffered.video;if(this.hls&&this.media&&this.fragmentTracker&&(i=this.buffered.audio)!=null&&i.length&&s&&s.length>1&&e>s.end(0)){const n=BufferHelper.bufferedInfo(BufferHelper.timeRangesToArray(this.buffered.audio),e,0);if(n.len>1&&t>=n.start){const a=BufferHelper.timeRangesToArray(s),o=BufferHelper.bufferedInfo(a,t,0).bufferedIndex;if(o>-1&&o<a.length-1){const c=BufferHelper.bufferedInfo(a,e,0).bufferedIndex,u=a[o].end,f=a[o+1].start;if((c===-1||c>o)&&f-u<1&&e-u<2){const d=new Error(`nudging playhead to flush pipeline after video hole. currentTime: ${e} hole: ${u} -> ${f} buffered index: ${c}`);this.warn(d.message),this.media.currentTime+=1e-6;let g=appendedFragAtPosition(e,this.fragmentTracker);g&&"fragment"in g?g=g.fragment:g||(g=void 0);const E=BufferHelper.bufferInfo(this.media,e,0);this.hls.trigger(Events.ERROR,{type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:d,reason:d.message,frag:g,buffer:E.len,bufferInfo:E})}}}}}_tryFixBufferStall(e,t,i){var s,n;const{fragmentTracker:a,media:o}=this,c=(s=this.hls)==null?void 0:s.config;if(!o||!a||!c)return;const u=(n=this.hls)==null?void 0:n.latestLevelDetails,f=appendedFragAtPosition(i,a);if((f||u!=null&&u.live&&i<u.fragmentStart)&&(this._trySkipBufferHole(f)||!this.media))return;const d=e.buffered,g=this.adjacentTraversal(e,i);(d&&d.length>1&&e.len>c.maxBufferHole||e.nextStart&&(e.nextStart-i<c.maxBufferHole||g))&&(t>c.highBufferWatchdogPeriod*1e3||this.waiting)&&(this.warn("Trying to nudge playhead over buffer-hole"),this._tryNudgeBuffer(e))}adjacentTraversal(e,t){const i=this.fragmentTracker,s=e.nextStart;if(i&&s){const n=i.getFragAtPos(t,PlaylistLevelType.MAIN),a=i.getFragAtPos(s,PlaylistLevelType.MAIN);if(n&&a)return a.sn-n.sn<2}return!1}_reportStall(e){const{hls:t,media:i,stallReported:s,stalled:n}=this;if(!s&&n!==null&&i&&t){this.stallReported=!0;const a=new Error(`Playback stalling at @${i.currentTime} due to low buffer (${stringify(e)})`);this.warn(a.message),t.trigger(Events.ERROR,{type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,error:a,buffer:e.len,bufferInfo:e,stalled:{start:n}})}}_trySkipBufferHole(e){var t;const{fragmentTracker:i,media:s}=this,n=(t=this.hls)==null?void 0:t.config;if(!s||!i||!n)return 0;const a=s.currentTime,o=BufferHelper.bufferInfo(s,a,0),c=a<o.start?o.start:o.nextStart;if(c&&this.hls){const f=o.len<=n.maxBufferHole,d=o.len>0&&o.len<1&&s.readyState<3,g=c-a;if(g>0&&(f||d)){if(g>n.maxBufferHole){let m=!1;if(a===0){const T=i.getAppendedFrag(0,PlaylistLevelType.MAIN);T&&c<T.end&&(m=!0)}if(!m&&e){var u;if(!((u=this.hls.loadLevelObj)!=null&&u.details)||getInFlightDependency(this.hls.inFlightFragments,c))return 0;let S=!1,b=e.end;for(;b<c;){const C=appendedFragAtPosition(b,i);if(C)b+=C.duration;else{S=!0;break}}if(S)return 0}}const E=Math.max(c+SKIP_BUFFER_RANGE_START,a+SKIP_BUFFER_HOLE_STEP_SECONDS);if(this.warn(`skipping hole, adjusting currentTime from ${a} to ${E}`),this.moved=!0,s.currentTime=E,!(e!=null&&e.gap)){const m=new Error(`fragment loaded with buffer holes, seeking from ${a} to ${E}`),T={type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:m,reason:m.message,buffer:o.len,bufferInfo:o};e&&("fragment"in e?T.part=e:T.frag=e),this.hls.trigger(Events.ERROR,T)}return E}}return 0}_tryNudgeBuffer(e){const{hls:t,media:i,nudgeRetry:s}=this,n=t?.config;if(!i||!n)return 0;const a=i.currentTime;if(this.nudgeRetry++,s<n.nudgeMaxRetry){const o=a+(s+1)*n.nudgeOffset,c=new Error(`Nudging 'currentTime' from ${a} to ${o}`);this.warn(c.message),i.currentTime=o,t.trigger(Events.ERROR,{type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.BUFFER_NUDGE_ON_STALL,error:c,fatal:!1,buffer:e.len,bufferInfo:e})}else{const o=new Error(`Playhead still not moving while enough data buffered @${a} after ${n.nudgeMaxRetry} nudges`);this.error(o.message),t.trigger(Events.ERROR,{type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.BUFFER_STALLED_ERROR,error:o,fatal:!0,buffer:e.len,bufferInfo:e})}}}function getInFlightDependency(r,e){const t=inFlight(r.main);if(t&&t.start<=e)return t;const i=inFlight(r.audio);return i&&i.start<=e?i:null}function inFlight(r){if(!r)return null;switch(r.state){case State.IDLE:case State.STOPPED:case State.ENDED:case State.ERROR:return null}return r.frag}function appendedFragAtPosition(r,e){return e.getAppendedFrag(r,PlaylistLevelType.MAIN)||e.getPartialFragment(r)}const MIN_CUE_DURATION=.25;function getCueClass(){if(!(typeof self>"u"))return self.VTTCue||self.TextTrackCue}function createCueWithDataFields(r,e,t,i,s){let n=new r(e,t,"");try{n.value=i,s&&(n.type=s)}catch{n=new r(e,t,stringify(s?_objectSpread2({type:s},i):i))}return n}const MAX_CUE_ENDTIME=(()=>{const r=getCueClass();try{r&&new r(0,Number.POSITIVE_INFINITY,"")}catch{return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();class ID3TrackController{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.removeCues=!0,this.assetCue=void 0,this.onEventCueEnter=()=>{this.hls&&this.hls.trigger(Events.EVENT_CUE_ENTER,{})},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=this.onEventCueEnter=null}_registerListeners(){const{hls:e}=this;e&&(e.on(Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(Events.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(Events.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(Events.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}_unregisterListeners(){const{hls:e}=this;e&&(e.off(Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(Events.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(Events.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(Events.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}onMediaAttaching(e,t){var i;this.media=t.media,((i=t.overrides)==null?void 0:i.cueRemoval)===!1&&(this.removeCues=!1)}onMediaAttached(){var e;const t=(e=this.hls)==null?void 0:e.latestLevelDetails;t&&this.updateDateRangeCues(t)}onMediaDetaching(e,t){this.media=null,!t.transferMedia&&(this.id3Track&&(this.removeCues&&clearCurrentCues(this.id3Track,this.onEventCueEnter),this.id3Track=null),this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){const t=this.getID3Track(e.textTracks);return t.mode="hidden",t}getID3Track(e){if(this.media){for(let t=0;t<e.length;t++){const i=e[t];if(i.kind==="metadata"&&i.label==="id3")return sendAddTrackEvent(i,this.media),i}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(e,t){if(!this.media||!this.hls)return;const{enableEmsgMetadataCues:i,enableID3MetadataCues:s}=this.hls.config;if(!i&&!s)return;const{samples:n}=t;this.id3Track||(this.id3Track=this.createTrack(this.media));const a=getCueClass();if(a)for(let o=0;o<n.length;o++){const c=n[o].type;if(c===MetadataSchema.emsg&&!i||!s)continue;const u=getId3Frames(n[o].data),f=n[o].pts;let d=f+n[o].duration;d>MAX_CUE_ENDTIME&&(d=MAX_CUE_ENDTIME),d-f<=0&&(d=f+MIN_CUE_DURATION);for(let E=0;E<u.length;E++){const m=u[E];if(!isId3TimestampFrame(m)){this.updateId3CueEnds(f,c);const T=createCueWithDataFields(a,f,d,m,c);T&&this.id3Track.addCue(T)}}}}updateId3CueEnds(e,t){var i;const s=(i=this.id3Track)==null?void 0:i.cues;if(s)for(let n=s.length;n--;){const a=s[n];a.type===t&&a.startTime<e&&a.endTime===MAX_CUE_ENDTIME&&(a.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:i,type:s}){const{id3Track:n,hls:a}=this;if(!a)return;const{config:{enableEmsgMetadataCues:o,enableID3MetadataCues:c}}=a;if(n&&(o||c)){let u;s==="audio"?u=f=>f.type===MetadataSchema.audioId3&&c:s==="video"?u=f=>f.type===MetadataSchema.emsg&&o:u=f=>f.type===MetadataSchema.audioId3&&c||f.type===MetadataSchema.emsg&&o,removeCuesInRange(n,t,i,u)}}onLevelUpdated(e,{details:t}){this.updateDateRangeCues(t,!0)}onLevelPtsUpdated(e,t){Math.abs(t.drift)>.01&&this.updateDateRangeCues(t.details)}updateDateRangeCues(e,t){if(!this.hls||!this.media)return;const{assetPlayerId:i,timelineOffset:s,enableDateRangeMetadataCues:n,interstitialsController:a}=this.hls.config;if(!n)return;const o=getCueClass();if(i&&s&&!a){const{fragmentStart:T,fragmentEnd:S}=e;let b=this.assetCue;b?(b.startTime=T,b.endTime=S):o&&(b=this.assetCue=createCueWithDataFields(o,T,S,{assetPlayerId:this.hls.config.assetPlayerId},"hlsjs.interstitial.asset"),b&&(b.id=i,this.id3Track||(this.id3Track=this.createTrack(this.media)),this.id3Track.addCue(b),b.addEventListener("enter",this.onEventCueEnter)))}if(!e.hasProgramDateTime)return;const{id3Track:c}=this,{dateRanges:u}=e,f=Object.keys(u);let d=this.dateRangeCuesAppended;if(c&&t){var g;if((g=c.cues)!=null&&g.length){const T=Object.keys(d).filter(S=>!f.includes(S));for(let S=T.length;S--;){var E;const b=T[S],C=(E=d[b])==null?void 0:E.cues;delete d[b],C&&Object.keys(C).forEach(I=>{const L=C[I];if(L){L.removeEventListener("enter",this.onEventCueEnter);try{c.removeCue(L)}catch{}}})}}else d=this.dateRangeCuesAppended={}}const m=e.fragments[e.fragments.length-1];if(!(f.length===0||!isFiniteNumber(m?.programDateTime))){this.id3Track||(this.id3Track=this.createTrack(this.media));for(let T=0;T<f.length;T++){const S=f[T],b=u[S],C=b.startTime,I=d[S],L=I?.cues||{};let k=I?.durationKnown||!1,U=MAX_CUE_ENDTIME;const{duration:O,endDate:F}=b;if(F&&O!==null)U=C+O,k=!0;else if(b.endOnNext&&!k){const x=f.reduce(($,X)=>{if(X!==b.id){const Q=u[X];if(Q.class===b.class&&Q.startDate>b.startDate&&(!$||b.startDate<$.startDate))return Q}return $},null);x&&(U=x.startTime,k=!0)}const G=Object.keys(b.attr);for(let x=0;x<G.length;x++){const $=G[x];if(!isDateRangeCueAttribute($))continue;const X=L[$];if(X)k&&!(I!=null&&I.durationKnown)?X.endTime=U:Math.abs(X.startTime-C)>.01&&(X.startTime=C,X.endTime=U);else if(o){let Q=b.attr[$];isSCTE35Attribute($)&&(Q=hexToArrayBuffer(Q));const te=createCueWithDataFields(o,C,U,{key:$,data:Q},MetadataSchema.dateRange);te&&(te.id=S,this.id3Track.addCue(te),L[$]=te,a&&($==="X-ASSET-LIST"||$==="X-ASSET-URL")&&te.addEventListener("enter",this.onEventCueEnter))}}d[S]={cues:L,dateRange:b,durationKnown:k}}}}}class LatencyController{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.currentTime=0,this.stallCount=0,this._latency=null,this._targetLatencyUpdated=!1,this.onTimeupdate=()=>{const{media:t}=this,i=this.levelDetails;if(!t||!i)return;this.currentTime=t.currentTime;const s=this.computeLatency();if(s===null)return;this._latency=s;const{lowLatencyMode:n,maxLiveSyncPlaybackRate:a}=this.config;if(!n||a===1||!i.live)return;const o=this.targetLatency;if(o===null)return;const c=s-o,u=Math.min(this.maxLatency,o+i.targetduration);if(c<u&&c>.05&&this.forwardBufferLength>1){const d=Math.min(2,Math.max(1,a)),g=Math.round(2/(1+Math.exp(-.75*c-this.edgeStalled))*20)/20,E=Math.min(d,Math.max(1,g));this.changeMediaPlaybackRate(t,E)}else t.playbackRate!==1&&t.playbackRate!==0&&this.changeMediaPlaybackRate(t,1)},this.hls=e,this.config=e.config,this.registerListeners()}get levelDetails(){var e;return((e=this.hls)==null?void 0:e.latestLevelDetails)||null}get latency(){return this._latency||0}get maxLatency(){const{config:e}=this;if(e.liveMaxLatencyDuration!==void 0)return e.liveMaxLatencyDuration;const t=this.levelDetails;return t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){const e=this.levelDetails;if(e===null||this.hls===null)return null;const{holdBack:t,partHoldBack:i,targetduration:s}=e,{liveSyncDuration:n,liveSyncDurationCount:a,lowLatencyMode:o}=this.config,c=this.hls.userConfig;let u=o&&i||t;(this._targetLatencyUpdated||c.liveSyncDuration||c.liveSyncDurationCount||u===0)&&(u=n!==void 0?n:a*s);const f=s;return u+Math.min(this.stallCount*this.config.liveSyncOnStallIncrease,f)}set targetLatency(e){this.stallCount=0,this.config.liveSyncDuration=e,this._targetLatencyUpdated=!0}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency;if(e===null||t===null)return null;const i=this.levelDetails;if(i===null)return null;const s=i.edge,n=e-t-this.edgeStalled,a=s-i.totalduration,o=s-(this.config.lowLatencyMode&&i.partTarget||i.targetduration);return Math.min(Math.max(a,n),o)}get drift(){const e=this.levelDetails;return e===null?1:e.drift}get edgeStalled(){const e=this.levelDetails;if(e===null)return 0;const t=(this.config.lowLatencyMode&&e.partTarget||e.targetduration)*3;return Math.max(e.age-t,0)}get forwardBufferLength(){const{media:e}=this,t=this.levelDetails;if(!e||!t)return 0;const i=e.buffered.length;return(i?e.buffered.end(i-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.hls=null}registerListeners(){const{hls:e}=this;e&&(e.on(Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Events.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(Events.ERROR,this.onError,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Events.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(Events.ERROR,this.onError,this))}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.onTimeupdate)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.onTimeupdate),this.media=null)}onManifestLoading(){this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:t}){t.advanced&&this.onTimeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.onTimeupdate)}onError(e,t){var i;t.details===ErrorDetails.BUFFER_STALLED_ERROR&&(this.stallCount++,this.hls&&(i=this.levelDetails)!=null&&i.live&&this.hls.logger.warn("[latency-controller]: Stall detected, adjusting target latency"))}changeMediaPlaybackRate(e,t){var i,s;e.playbackRate!==t&&((i=this.hls)==null||i.logger.debug(`[latency-controller]: latency=${this.latency.toFixed(3)}, targetLatency=${(s=this.targetLatency)==null?void 0:s.toFixed(3)}, forwardBufferLength=${this.forwardBufferLength.toFixed(3)}: adjusting playback rate from ${e.playbackRate} to ${t}`),e.playbackRate=t)}estimateLiveEdge(){const e=this.levelDetails;return e===null?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return e===null?null:e-this.currentTime}}class LevelController extends BasePlaylistController{constructor(e,t){super(e,"level-controller"),this._levels=[],this._firstLevel=-1,this._maxAutoLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=t,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Events.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(Events.LEVEL_LOADED,this.onLevelLoaded,this),e.on(Events.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(Events.FRAG_BUFFERED,this.onFragBuffered,this),e.on(Events.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Events.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(Events.LEVEL_LOADED,this.onLevelLoaded,this),e.off(Events.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(Events.FRAG_BUFFERED,this.onFragBuffered,this),e.off(Events.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach(t=>{t.loadError=0,t.fragmentError=0}),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(e,t){this.resetLevels()}onManifestLoaded(e,t){const i=this.hls.config.preferManagedMediaSource,s=[],n={},a={};let o=!1,c=!1,u=!1;t.levels.forEach(f=>{const d=f.attrs;let{audioCodec:g,videoCodec:E}=f;g&&(f.audioCodec=g=getCodecCompatibleName(g,i)||void 0),E&&(E=f.videoCodec=convertAVC1ToAVCOTI(E));const{width:m,height:T,unknownCodecs:S}=f,b=S?.length||0;if(o||(o=!!(m&&T)),c||(c=!!E),u||(u=!!g),b||g&&!this.isAudioSupported(g)||E&&!this.isVideoSupported(E)){this.log(`Some or all CODECS not supported "${d.CODECS}"`);return}const{CODECS:C,"FRAME-RATE":I,"HDCP-LEVEL":L,"PATHWAY-ID":k,RESOLUTION:U,"VIDEO-RANGE":O}=d,G=`${`${k||"."}-`}${f.bitrate}-${U}-${I}-${C}-${O}-${L}`;if(n[G])if(n[G].uri!==f.url&&!f.attrs["PATHWAY-ID"]){const x=a[G]+=1;f.attrs["PATHWAY-ID"]=new Array(x+1).join(".");const $=this.createLevel(f);n[G]=$,s.push($)}else n[G].addGroupId("audio",d.AUDIO),n[G].addGroupId("text",d.SUBTITLES);else{const x=this.createLevel(f);n[G]=x,a[G]=1,s.push(x)}}),this.filterAndSortMediaOptions(s,t,o,c,u)}createLevel(e){const t=new Level(e),i=e.supplemental;if(i!=null&&i.videoCodec&&!this.isVideoSupported(i.videoCodec)){const s=new Error(`SUPPLEMENTAL-CODECS not supported "${i.videoCodec}"`);this.log(s.message),t.supportedResult=getUnsupportedResult(s,[])}return t}isAudioSupported(e){return areCodecsMediaSourceSupported(e,"audio",this.hls.config.preferManagedMediaSource)}isVideoSupported(e){return areCodecsMediaSourceSupported(e,"video",this.hls.config.preferManagedMediaSource)}filterAndSortMediaOptions(e,t,i,s,n){var a;let o=[],c=[],u=e;const f=((a=t.stats)==null?void 0:a.parsing)||{};if((i||s)&&n&&(u=u.filter(({videoCodec:C,videoRange:I,width:L,height:k})=>(!!C||!!(L&&k))&&isVideoRange(I))),u.length===0){Promise.resolve().then(()=>{if(this.hls){let C="no level with compatible codecs found in manifest",I=C;t.levels.length&&(I=`one or more CODECS in variant not supported: ${stringify(t.levels.map(k=>k.attrs.CODECS).filter((k,U,O)=>O.indexOf(k)===U))}`,this.warn(I),C+=` (${I})`);const L=new Error(C);this.hls.trigger(Events.ERROR,{type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:L,reason:I})}}),f.end=performance.now();return}t.audioTracks&&(o=t.audioTracks.filter(C=>!C.audioCodec||this.isAudioSupported(C.audioCodec)),assignTrackIdsByGroup(o)),t.subtitles&&(c=t.subtitles,assignTrackIdsByGroup(c));const d=u.slice(0);u.sort((C,I)=>{if(C.attrs["HDCP-LEVEL"]!==I.attrs["HDCP-LEVEL"])return(C.attrs["HDCP-LEVEL"]||"")>(I.attrs["HDCP-LEVEL"]||"")?1:-1;if(i&&C.height!==I.height)return C.height-I.height;if(C.frameRate!==I.frameRate)return C.frameRate-I.frameRate;if(C.videoRange!==I.videoRange)return VideoRangeValues.indexOf(C.videoRange)-VideoRangeValues.indexOf(I.videoRange);if(C.videoCodec!==I.videoCodec){const L=videoCodecPreferenceValue(C.videoCodec),k=videoCodecPreferenceValue(I.videoCodec);if(L!==k)return k-L}if(C.uri===I.uri&&C.codecSet!==I.codecSet){const L=codecsSetSelectionPreferenceValue(C.codecSet),k=codecsSetSelectionPreferenceValue(I.codecSet);if(L!==k)return k-L}return C.averageBitrate!==I.averageBitrate?C.averageBitrate-I.averageBitrate:0});let g=d[0];if(this.steering&&(u=this.steering.filterParsedLevels(u),u.length!==d.length)){for(let C=0;C<d.length;C++)if(d[C].pathwayId===u[0].pathwayId){g=d[C];break}}this._levels=u;for(let C=0;C<u.length;C++)if(u[C]===g){var E;this._firstLevel=C;const I=g.bitrate,L=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${u.length} level(s) found, first bitrate: ${I}`),((E=this.hls.userConfig)==null?void 0:E.abrEwmaDefaultEstimate)===void 0){const k=Math.min(I,this.hls.config.abrEwmaDefaultEstimateMax);k>L&&L===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=k)}break}const m=n&&!s,T=this.hls.config,S=!!(T.audioStreamController&&T.audioTrackController),b={levels:u,audioTracks:o,subtitleTracks:c,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:n,video:s,altAudio:S&&!m&&o.some(C=>!!C.url)};f.end=performance.now(),this.hls.trigger(Events.MANIFEST_PARSED,b)}get levels(){return this._levels.length===0?null:this._levels}get loadLevelObj(){return this.currentLevel}get level(){return this.currentLevelIndex}set level(e){const t=this._levels;if(t.length===0)return;if(e<0||e>=t.length){const f=new Error("invalid level idx"),d=e<0;if(this.hls.trigger(Events.ERROR,{type:ErrorTypes.OTHER_ERROR,details:ErrorDetails.LEVEL_SWITCH_ERROR,level:e,fatal:d,error:f,reason:f.message}),d)return;e=Math.min(e,t.length-1)}const i=this.currentLevelIndex,s=this.currentLevel,n=s?s.attrs["PATHWAY-ID"]:void 0,a=t[e],o=a.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=a,i===e&&s&&n===o)return;this.log(`Switching to level ${e} (${a.height?a.height+"p ":""}${a.videoRange?a.videoRange+" ":""}${a.codecSet?a.codecSet+" ":""}@${a.bitrate})${o?" with Pathway "+o:""} from level ${i}${n?" with Pathway "+n:""}`);const c={level:e,attrs:a.attrs,details:a.details,bitrate:a.bitrate,averageBitrate:a.averageBitrate,maxBitrate:a.maxBitrate,realBitrate:a.realBitrate,width:a.width,height:a.height,codecSet:a.codecSet,audioCodec:a.audioCodec,videoCodec:a.videoCodec,audioGroups:a.audioGroups,subtitleGroups:a.subtitleGroups,loaded:a.loaded,loadError:a.loadError,fragmentError:a.fragmentError,name:a.name,id:a.id,uri:a.uri,url:a.url,urlId:0,audioGroupIds:a.audioGroupIds,textGroupIds:a.textGroupIds};this.hls.trigger(Events.LEVEL_SWITCHING,c);const u=a.details;if(!u||u.live){const f=this.switchParams(a.uri,s?.details,u);this.loadPlaylist(f)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,this._startLevel===void 0&&(this._startLevel=e),e!==-1&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(this._startLevel===void 0){const e=this.hls.config.startLevel;return e!==void 0?e:this.hls.firstAutoLevel}return this._startLevel}set startLevel(e){this._startLevel=e}get pathways(){return this.steering?this.steering.pathways():[]}get pathwayPriority(){return this.steering?this.steering.pathwayPriority:null}set pathwayPriority(e){if(this.steering){const t=this.steering.pathways(),i=e.filter(s=>t.indexOf(s)!==-1);if(e.length<1){this.warn(`pathwayPriority ${e} should contain at least one pathway from list: ${t}`);return}this.steering.pathwayPriority=i}}onError(e,t){t.fatal||!t.context||t.context.type===PlaylistContextType.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t!==void 0&&t.type===PlaylistLevelType.MAIN){const i=t.elementaryStreams;if(!Object.keys(i).some(n=>!!i[n]))return;const s=this._levels[t.level];s!=null&&s.loadError&&(this.log(`Resetting level error count of ${s.loadError} on frag buffered`),s.loadError=0)}}onLevelLoaded(e,t){var i;const{level:s,details:n}=t,a=t.levelInfo;if(!a){var o;this.warn(`Invalid level index ${s}`),(o=t.deliveryDirectives)!=null&&o.skip&&(n.deltaUpdateFailed=!0);return}if(a===this.currentLevel||t.withoutMultiVariant){a.fragmentError===0&&(a.loadError=0);let c=a.details;c===t.details&&c.advanced&&(c=void 0),this.playlistLoaded(s,t,c)}else(i=t.deliveryDirectives)!=null&&i.skip&&(n.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentLevel)&&this.scheduleLoading(this.currentLevel,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const i=this.getUrlWithDirectives(e.uri,t),s=this.currentLevelIndex,n=e.attrs["PATHWAY-ID"],a=e.details,o=a?.age;this.log(`Loading level index ${s}${t?.msn!==void 0?" at sn "+t.msn+" part "+t.part:""}${n?" Pathway "+n:""}${o&&a.live?" age "+o.toFixed(1)+(a.type&&" "+a.type||""):""} ${i}`),this.hls.trigger(Events.LEVEL_LOADING,{url:i,level:s,levelInfo:e,pathwayId:e.attrs["PATHWAY-ID"],id:0,deliveryDirectives:t||null})}get nextLoadLevel(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(e){this.level=e,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=e)}removeLevel(e){var t;if(this._levels.length===1)return;const i=this._levels.filter((n,a)=>a!==e?!0:(this.steering&&this.steering.removeLevel(n),n===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,n.details&&n.details.fragments.forEach(o=>o.level=-1)),!1));reassignFragmentLevelIndexes(i),this._levels=i,this.currentLevelIndex>-1&&(t=this.currentLevel)!=null&&t.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.manualLevelIndex>-1&&(this.manualLevelIndex=this.currentLevelIndex);const s=i.length-1;this._firstLevel=Math.min(this._firstLevel,s),this._startLevel&&(this._startLevel=Math.min(this._startLevel,s)),this.hls.trigger(Events.LEVELS_UPDATED,{levels:i})}onLevelsUpdated(e,{levels:t}){this._levels=t}checkMaxAutoUpdated(){const{autoLevelCapping:e,maxAutoLevel:t,maxHdcpLevel:i}=this.hls;this._maxAutoLevel!==t&&(this._maxAutoLevel=t,this.hls.trigger(Events.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:i}))}}function assignTrackIdsByGroup(r){const e={};r.forEach(t=>{const i=t.groupId||"";t.id=e[i]=e[i]||0,e[i]++})}function getSourceBuffer(){return self.SourceBuffer||self.WebKitSourceBuffer}function isMSESupported(){if(!getMediaSource())return!1;const e=getSourceBuffer();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function isSupported(){if(!isMSESupported())return!1;const r=getMediaSource();return typeof r?.isTypeSupported=="function"&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some(e=>r.isTypeSupported(mimeTypeForCodec(e,"video")))||["mp4a.40.2","fLaC"].some(e=>r.isTypeSupported(mimeTypeForCodec(e,"audio"))))}function changeTypeSupported(){var r;const e=getSourceBuffer();return typeof(e==null||(r=e.prototype)==null?void 0:r.changeType)=="function"}const TICK_INTERVAL=100;class StreamController extends BaseStreamController{constructor(e,t,i){super(e,t,i,"stream-controller",PlaylistLevelType.MAIN),this.audioCodecSwap=!1,this.level=-1,this._forceStartLoad=!1,this._hasEnoughToStart=!1,this.altAudio=0,this.audioOnly=!1,this.fragPlaying=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this.onMediaPlaying=()=>{this.tick()},this.onMediaSeeked=()=>{const s=this.media,n=s?s.currentTime:null;if(n===null||!isFiniteNumber(n)||(this.log(`Media seeked to ${n.toFixed(3)}`),!this.getBufferedFrag(n)))return;const a=this.getFwdBufferInfoAtPos(s,n,PlaylistLevelType.MAIN,0);if(a===null||a.len===0){this.warn(`Main forward buffer length at ${n} on "seeked" event ${a?a.len:"empty"})`);return}this.tick()},this.registerListeners()}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(Events.MANIFEST_PARSED,this.onManifestParsed,this),e.on(Events.LEVEL_LOADING,this.onLevelLoading,this),e.on(Events.LEVEL_LOADED,this.onLevelLoaded,this),e.on(Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(Events.BUFFER_CREATED,this.onBufferCreated,this),e.on(Events.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(Events.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(Events.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(Events.MANIFEST_PARSED,this.onManifestParsed,this),e.off(Events.LEVEL_LOADED,this.onLevelLoaded,this),e.off(Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(Events.BUFFER_CREATED,this.onBufferCreated,this),e.off(Events.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(Events.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(Events.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this.onMediaPlaying=this.onMediaSeeked=null,this.unregisterListeners(),super.onHandlerDestroying()}startLoad(e,t){if(this.levels){const{lastCurrentTime:i,hls:s}=this;if(this.stopLoad(),this.setInterval(TICK_INTERVAL),this.level=-1,!this.startFragRequested){let n=s.startLevel;n===-1&&(s.config.testBandwidth&&this.levels.length>1?(n=0,this.bitrateTest=!0):n=s.firstAutoLevel),s.nextLoadLevel=n,this.level=s.loadLevel,this._hasEnoughToStart=!!t}i>0&&e===-1&&!t&&(this.log(`Override startPosition with lastCurrentTime @${i.toFixed(3)}`),e=i),this.state=State.IDLE,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}else this._forceStartLoad=!0,this.state=State.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case State.WAITING_LEVEL:{const{levels:e,level:t}=this,i=e?.[t],s=i?.details;if(s&&(!s.live||this.levelLastLoaded===i&&!this.waitForLive(i))){if(this.waitForCdnTuneIn(s))break;this.state=State.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=State.IDLE;break}break}case State.FRAG_LOADING_WAITING_RETRY:this.checkRetryDate();break}this.state===State.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){var e;super.onTickEnd(),(e=this.media)!=null&&e.readyState&&this.media.seeking===!1&&(this.lastCurrentTime=this.media.currentTime),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:t,levels:i,media:s}=this;if(t===null||!s&&!this.primaryPrefetch&&(this.startFragRequested||!e.config.startFragPrefetch)||this.altAudio&&this.audioOnly)return;const n=this.buffering?e.nextLoadLevel:e.loadLevel;if(!(i!=null&&i[n]))return;const a=i[n],o=this.getMainFwdBufferInfo();if(o===null)return;const c=this.getLevelDetails();if(c&&this._streamEnded(o,c)){const T={};this.altAudio===2&&(T.type="video"),this.hls.trigger(Events.BUFFER_EOS,T),this.state=State.ENDED;return}if(!this.buffering)return;e.loadLevel!==n&&e.manualLevel===-1&&this.log(`Adapting to level ${n} from level ${this.level}`),this.level=e.nextLoadLevel=n;const u=a.details;if(!u||this.state===State.WAITING_LEVEL||this.waitForLive(a)){this.level=n,this.state=State.WAITING_LEVEL,this.startFragRequested=!1;return}const f=o.len,d=this.getMaxBufferLength(a.maxBitrate);if(f>=d)return;this.backtrackFragment&&this.backtrackFragment.start>o.end&&(this.backtrackFragment=null);const g=this.backtrackFragment?this.backtrackFragment.start:o.end;let E=this.getNextFragment(g,u);if(this.couldBacktrack&&!this.fragPrevious&&E&&isMediaFragment(E)&&this.fragmentTracker.getState(E)!==FragmentState.OK){var m;const S=((m=this.backtrackFragment)!=null?m:E).sn-u.startSN,b=u.fragments[S-1];b&&E.cc===b.cc&&(E=b,this.fragmentTracker.removeFragment(b))}else this.backtrackFragment&&o.len&&(this.backtrackFragment=null);if(E&&this.isLoopLoading(E,g)){if(!E.gap){const S=this.audioOnly&&!this.altAudio?ElementaryStreamTypes.AUDIO:ElementaryStreamTypes.VIDEO,b=(S===ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;b&&this.afterBufferFlushed(b,S,PlaylistLevelType.MAIN)}E=this.getNextFragmentLoopLoading(E,u,o,PlaylistLevelType.MAIN,d)}E&&(E.initSegment&&!E.initSegment.data&&!this.bitrateTest&&(E=E.initSegment),this.loadFragment(E,a,g))}loadFragment(e,t,i){const s=this.fragmentTracker.getState(e);s===FragmentState.NOT_LOADED||s===FragmentState.PARTIAL?isMediaFragment(e)?this.bitrateTest?(this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(e,t)):super.loadFragment(e,t,i):this._loadInitSegment(e,t):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,PlaylistLevelType.MAIN)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:e,media:t}=this;if(t!=null&&t.readyState){let i;const s=this.getAppendedFrag(t.currentTime);s&&s.start>1&&this.flushMainBuffer(0,s.start-1);const n=this.getLevelDetails();if(n!=null&&n.live){const o=this.getMainFwdBufferInfo();if(!o||o.len<n.targetduration*2)return}if(!t.paused&&e){const o=this.hls.nextLoadLevel,c=e[o],u=this.fragLastKbps;u&&this.fragCurrent?i=this.fragCurrent.duration*c.maxBitrate/(1e3*u)+1:i=0}else i=0;const a=this.getBufferedFrag(t.currentTime+i);if(a){const o=this.followingBufferedFrag(a);if(o){this.abortCurrentFrag();const c=o.maxStartPTS?o.maxStartPTS:o.start,u=o.duration,f=Math.max(a.end,c+Math.min(Math.max(u-this.config.maxFragLookUpTolerance,u*(this.couldBacktrack?.5:.125)),u*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(f,Number.POSITIVE_INFINITY)}}}}abortCurrentFrag(){const e=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,e&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.state){case State.KEY_LOADING:case State.FRAG_LOADING:case State.FRAG_LOADING_WAITING_RETRY:case State.PARSING:case State.PARSED:this.state=State.IDLE;break}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(e,t){super.flushMainBuffer(e,t,this.altAudio===2?"video":null)}onMediaAttached(e,t){super.onMediaAttached(e,t);const i=t.media;addEventListener(i,"playing",this.onMediaPlaying),addEventListener(i,"seeked",this.onMediaSeeked)}onMediaDetaching(e,t){const{media:i}=this;i&&(removeEventListener(i,"playing",this.onMediaPlaying),removeEventListener(i,"seeked",this.onMediaSeeked)),this.videoBuffer=null,this.fragPlaying=null,super.onMediaDetaching(e,t),!t.transferMedia&&(this._hasEnoughToStart=!1)}onManifestLoading(){super.onManifestLoading(),this.log("Trigger BUFFER_RESET"),this.hls.trigger(Events.BUFFER_RESET,void 0),this.couldBacktrack=!1,this.fragLastKbps=0,this.fragPlaying=this.backtrackFragment=null,this.altAudio=0,this.audioOnly=!1}onManifestParsed(e,t){let i=!1,s=!1;for(let n=0;n<t.levels.length;n++){const a=t.levels[n].audioCodec;a&&(i=i||a.indexOf("mp4a.40.2")!==-1,s=s||a.indexOf("mp4a.40.5")!==-1)}this.audioCodecSwitch=i&&s&&!changeTypeSupported(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1}onLevelLoading(e,t){const{levels:i}=this;if(!i||this.state!==State.IDLE)return;const s=t.levelInfo;(!s.details||s.details.live&&(this.levelLastLoaded!==s||s.details.expired)||this.waitForCdnTuneIn(s.details))&&(this.state=State.WAITING_LEVEL)}onLevelLoaded(e,t){var i;const{levels:s,startFragRequested:n}=this,a=t.level,o=t.details,c=o.totalduration;if(!s){this.warn(`Levels were reset while loading level ${a}`);return}this.log(`Level ${a} loaded [${o.startSN},${o.endSN}]${o.lastPartSn?`[part-${o.lastPartSn}-${o.lastPartIndex}]`:""}, cc [${o.startCC}, ${o.endCC}] duration:${c}`);const u=t.levelInfo,f=this.fragCurrent;f&&(this.state===State.FRAG_LOADING||this.state===State.FRAG_LOADING_WAITING_RETRY)&&f.level!==t.level&&f.loader&&this.abortCurrentFrag();let d=0;if(o.live||(i=u.details)!=null&&i.live){var g;if(this.checkLiveUpdate(o),o.deltaUpdateFailed)return;d=this.alignPlaylists(o,u.details,(g=this.levelLastLoaded)==null?void 0:g.details)}if(u.details=o,this.levelLastLoaded=u,n||this.setStartPosition(o,d),this.hls.trigger(Events.LEVEL_UPDATED,{details:o,level:a}),this.state===State.WAITING_LEVEL){if(this.waitForCdnTuneIn(o))return;this.state=State.IDLE}n&&o.live&&this.synchronizeToLiveEdge(o),this.tick()}synchronizeToLiveEdge(e){const{config:t,media:i}=this;if(!i)return;const s=this.hls.liveSyncPosition,n=this.getLoadPosition(),a=e.fragmentStart,o=e.edge,c=n>=a-t.maxFragLookUpTolerance&&n<=o;if(s!==null&&i.duration>s&&(n<s||!c)){const f=t.liveMaxLatencyDuration!==void 0?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;if((!c&&i.readyState<4||n<o-f)&&(this._hasEnoughToStart||(this.nextLoadPosition=s),i.readyState))if(this.warn(`Playback: ${n.toFixed(3)} is located too far from the end of live sliding playlist: ${o}, reset currentTime to : ${s.toFixed(3)}`),this.config.liveSyncMode==="buffered"){var u;const d=BufferHelper.bufferInfo(i,s,0);if(!((u=d.buffered)!=null&&u.length)){i.currentTime=s;return}if(d.start<=n){i.currentTime=s;return}const{nextStart:E}=BufferHelper.bufferedInfo(d.buffered,n,0);E&&(i.currentTime=E)}else i.currentTime=s}}_handleFragmentLoadProgress(e){var t;const i=e.frag,{part:s,payload:n}=e,{levels:a}=this;if(!a){this.warn(`Levels were reset while fragment load was in progress. Fragment ${i.sn} of level ${i.level} will not be buffered`);return}const o=a[i.level];if(!o){this.warn(`Level ${i.level} not found on progress`);return}const c=o.details;if(!c){this.warn(`Dropping fragment ${i.sn} of level ${i.level} after level details were reset`),this.fragmentTracker.removeFragment(i);return}const u=o.videoCodec,f=c.PTSKnown||!c.live,d=(t=i.initSegment)==null?void 0:t.data,g=this._getAudioCodec(o),E=this.transmuxer=this.transmuxer||new TransmuxerInterface(this.hls,PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),m=s?s.index:-1,T=m!==-1,S=new ChunkMetadata(i.level,i.sn,i.stats.chunkCount,n.byteLength,m,T),b=this.initPTS[i.cc];E.push(n,d,g,u,i,s,c.totalduration,f,S,b)}onAudioTrackSwitching(e,t){const i=this.hls,s=this.altAudio!==0;if(useAlternateAudio(t.url,i))this.altAudio=1;else{if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const a=this.fragCurrent;a&&(this.log("Switching to main audio track, cancel main fragment load"),a.abortRequests(),this.fragmentTracker.removeFragment(a)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();if(s){this.altAudio=0,this.fragmentTracker.removeAllFragments(),i.once(Events.BUFFER_FLUSHED,()=>{this.hls&&this.hls.trigger(Events.AUDIO_TRACK_SWITCHED,t)}),i.trigger(Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null});return}i.trigger(Events.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const i=useAlternateAudio(t.url,this.hls);if(i){const s=this.videoBuffer;s&&this.mediaBuffer!==s&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=s)}this.altAudio=i?2:0,this.tick()}onBufferCreated(e,t){const i=t.tracks;let s,n,a=!1;for(const o in i){const c=i[o];if(c.id==="main"){if(n=o,s=c,o==="video"){const u=i[o];u&&(this.videoBuffer=u.buffer)}}else a=!0}a&&s?(this.log(`Alternate track found, use ${n}.buffered to schedule main fragment loading`),this.mediaBuffer=s.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:i,part:s}=t,n=i.type===PlaylistLevelType.MAIN;if(n){if(this.fragContextChanged(i)){this.warn(`Fragment ${i.sn}${s?" p: "+s.index:""} of level ${i.level} finished buffering, but was aborted. state: ${this.state}`),this.state===State.PARSED&&(this.state=State.IDLE);return}const o=s?s.stats:i.stats;this.fragLastKbps=Math.round(8*o.total/(o.buffering.end-o.loading.first)),isMediaFragment(i)&&(this.fragPrevious=i),this.fragBufferedComplete(i,s)}const a=this.media;a&&(!this._hasEnoughToStart&&BufferHelper.getBuffered(a).length&&(this._hasEnoughToStart=!0,this.seekToStartPos()),n&&this.tick())}get hasEnoughToStart(){return this._hasEnoughToStart}onError(e,t){var i;if(t.fatal){this.state=State.ERROR;return}switch(t.details){case ErrorDetails.FRAG_GAP:case ErrorDetails.FRAG_PARSING_ERROR:case ErrorDetails.FRAG_DECRYPT_ERROR:case ErrorDetails.FRAG_LOAD_ERROR:case ErrorDetails.FRAG_LOAD_TIMEOUT:case ErrorDetails.KEY_LOAD_ERROR:case ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(PlaylistLevelType.MAIN,t);break;case ErrorDetails.LEVEL_LOAD_ERROR:case ErrorDetails.LEVEL_LOAD_TIMEOUT:case ErrorDetails.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===State.WAITING_LEVEL&&((i=t.context)==null?void 0:i.type)===PlaylistContextType.LEVEL&&(this.state=State.IDLE);break;case ErrorDetails.BUFFER_ADD_CODEC_ERROR:case ErrorDetails.BUFFER_APPEND_ERROR:if(t.parent!=="main")return;this.reduceLengthAndFlushBuffer(t)&&this.resetLoadingState();break;case ErrorDetails.BUFFER_FULL_ERROR:if(t.parent!=="main")return;this.reduceLengthAndFlushBuffer(t)&&(!this.config.interstitialsController&&this.config.assetPlayerId?this._hasEnoughToStart=!0:this.flushMainBuffer(0,Number.POSITIVE_INFINITY));break;case ErrorDetails.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onFragLoadEmergencyAborted(){this.state=State.IDLE,this._hasEnoughToStart||(this.startFragRequested=!1,this.nextLoadPosition=this.lastCurrentTime),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==ElementaryStreamTypes.AUDIO||!this.altAudio){const i=(t===ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;i&&(this.afterBufferFlushed(i,t,PlaylistLevelType.MAIN),this.tick())}}onLevelsUpdated(e,t){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level,this.level===-1&&this.resetWhenMissingContext(this.fragCurrent)),this.levels=t.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const t=e.currentTime;let i=this.startPosition;if(i>=0&&t<i){if(e.seeking){this.log(`could not seek to ${i}, already seeking at ${t}`);return}const s=this.timelineOffset;s&&i&&(i+=s);const n=this.getLevelDetails(),a=BufferHelper.getBuffered(e),o=a.length?a.start(0):0,c=o-i,u=Math.max(this.config.maxBufferHole,this.config.maxFragLookUpTolerance);(this.config.startOnSegmentBoundary||c>0&&(c<u||this.loadingParts&&c<2*(n?.partTarget||0)))&&(this.log(`adjusting start position by ${c} to match buffer start`),i+=c,this.startPosition=i),t<i&&(this.log(`seek to target start position ${i} from current time ${t} buffer start ${o}`),e.currentTime=i)}}_getAudioCodec(e){let t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&t&&(this.log("Swapping audio codec"),t.indexOf("mp4a.40.5")!==-1?t="mp4a.40.2":t="mp4a.40.5"),t}_loadBitrateTestFrag(e,t){e.bitrateTest=!0,this._doFragLoad(e,t).then(i=>{const{hls:s}=this,n=i?.frag;if(!n||this.fragContextChanged(n))return;t.fragmentError=0,this.state=State.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const a=n.stats;a.parsing.start=a.parsing.end=a.buffering.start=a.buffering.end=self.performance.now(),s.trigger(Events.FRAG_LOADED,i),n.bitrateTest=!1}).catch(i=>{this.state===State.STOPPED||this.state===State.ERROR||(this.warn(i),this.resetFragmentLoading(e))})}_handleTransmuxComplete(e){const t=this.playlistType,{hls:i}=this,{remuxResult:s,chunkMeta:n}=e,a=this.getCurrentContext(n);if(!a){this.resetWhenMissingContext(n);return}const{frag:o,part:c,level:u}=a,{video:f,text:d,id3:g,initSegment:E}=s,{details:m}=u,T=this.altAudio?void 0:s.audio;if(this.fragContextChanged(o)){this.fragmentTracker.removeFragment(o);return}if(this.state=State.PARSING,E){const S=E.tracks;if(S){const L=o.initSegment||o;if(this.unhandledEncryptionError(E,o))return;this._bufferInitSegment(u,S,L,n),i.trigger(Events.FRAG_PARSING_INIT_SEGMENT,{frag:L,id:t,tracks:S})}const b=E.initPTS,C=E.timescale,I=this.initPTS[o.cc];if(isFiniteNumber(b)&&(!I||I.baseTime!==b||I.timescale!==C)){const L=E.trackId;this.initPTS[o.cc]={baseTime:b,timescale:C,trackId:L},i.trigger(Events.INIT_PTS_FOUND,{frag:o,id:t,initPTS:b,timescale:C,trackId:L})}}if(f&&m){T&&f.type==="audiovideo"&&this.logMuxedErr(o);const S=m.fragments[o.sn-1-m.startSN],b=o.sn===m.startSN,C=!S||o.cc>S.cc;if(s.independent!==!1){const{startPTS:I,endPTS:L,startDTS:k,endDTS:U}=f;if(c)c.elementaryStreams[f.type]={startPTS:I,endPTS:L,startDTS:k,endDTS:U};else if(f.firstKeyFrame&&f.independent&&n.id===1&&!C&&(this.couldBacktrack=!0),f.dropped&&f.independent){const O=this.getMainFwdBufferInfo(),F=(O?O.end:this.getLoadPosition())+this.config.maxBufferHole,G=f.firstKeyFramePTS?f.firstKeyFramePTS:I;if(!b&&F<G-this.config.maxBufferHole&&!C){this.backtrack(o);return}else C&&(o.gap=!0);o.setElementaryStreamInfo(f.type,o.start,L,o.start,U,!0)}else b&&I-(m.appliedTimelineOffset||0)>MAX_START_GAP_JUMP&&(o.gap=!0);o.setElementaryStreamInfo(f.type,I,L,k,U),this.backtrackFragment&&(this.backtrackFragment=o),this.bufferFragmentData(f,o,c,n,b||C)}else if(b||C)o.gap=!0;else{this.backtrack(o);return}}if(T){const{startPTS:S,endPTS:b,startDTS:C,endDTS:I}=T;c&&(c.elementaryStreams[ElementaryStreamTypes.AUDIO]={startPTS:S,endPTS:b,startDTS:C,endDTS:I}),o.setElementaryStreamInfo(ElementaryStreamTypes.AUDIO,S,b,C,I),this.bufferFragmentData(T,o,c,n)}if(m&&g!=null&&g.samples.length){const S={id:t,frag:o,details:m,samples:g.samples};i.trigger(Events.FRAG_PARSING_METADATA,S)}if(m&&d){const S={id:t,frag:o,details:m,samples:d.samples};i.trigger(Events.FRAG_PARSING_USERDATA,S)}}logMuxedErr(e){this.warn(`${isMediaFragment(e)?"Media":"Init"} segment with muxed audiovideo where only video expected: ${e.url}`)}_bufferInitSegment(e,t,i,s){if(this.state!==State.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&(delete t.audio,t.audiovideo&&this.logMuxedErr(i));const{audio:n,video:a,audiovideo:o}=t;if(n){const u=e.audioCodec;let f=pickMostCompleteCodecName(n.codec,u);f==="mp4a"&&(f="mp4a.40.5");const d=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){f&&(f.indexOf("mp4a.40.5")!==-1?f="mp4a.40.2":f="mp4a.40.5");const g=n.metadata;g&&"channelCount"in g&&(g.channelCount||1)!==1&&d.indexOf("firefox")===-1&&(f="mp4a.40.5")}f&&f.indexOf("mp4a.40.5")!==-1&&d.indexOf("android")!==-1&&n.container!=="audio/mpeg"&&(f="mp4a.40.2",this.log(`Android: force audio codec to ${f}`)),u&&u!==f&&this.log(`Swapping manifest audio codec "${u}" for "${f}"`),n.levelCodec=f,n.id=PlaylistLevelType.MAIN,this.log(`Init audio buffer, container:${n.container}, codecs[selected/level/parsed]=[${f||""}/${u||""}/${n.codec}]`),delete t.audiovideo}if(a){a.levelCodec=e.videoCodec,a.id=PlaylistLevelType.MAIN;const u=a.codec;if(u?.length===4)switch(u){case"hvc1":case"hev1":a.codec="hvc1.1.6.L120.90";break;case"av01":a.codec="av01.0.04M.08";break;case"avc1":a.codec="avc1.42e01e";break}this.log(`Init video buffer, container:${a.container}, codecs[level/parsed]=[${e.videoCodec||""}/${u}]${a.codec!==u?" parsed-corrected="+a.codec:""}${a.supplemental?" supplemental="+a.supplemental:""}`),delete t.audiovideo}o&&(this.log(`Init audiovideo buffer, container:${o.container}, codecs[level/parsed]=[${e.codecs}/${o.codec}]`),delete t.video,delete t.audio);const c=Object.keys(t);if(c.length){if(this.hls.trigger(Events.BUFFER_CODECS,t),!this.hls)return;c.forEach(u=>{const d=t[u].initSegment;d!=null&&d.byteLength&&this.hls.trigger(Events.BUFFER_APPENDING,{type:u,data:d,frag:i,part:null,chunkMeta:s,parent:i.type})})}this.tickImmediate()}getMainFwdBufferInfo(){const e=this.mediaBuffer&&this.altAudio===2?this.mediaBuffer:this.media;return this.getFwdBufferInfo(e,PlaylistLevelType.MAIN)}get maxBufferLength(){const{levels:e,level:t}=this,i=e?.[t];return i?this.getMaxBufferLength(i.maxBitrate):this.config.maxBufferLength}backtrack(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=State.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&e.seeking===!1){const i=e.currentTime;if(BufferHelper.isBuffered(e,i)?t=this.getAppendedFrag(i):BufferHelper.isBuffered(e,i+.1)&&(t=this.getAppendedFrag(i+.1)),t){this.backtrackFragment=null;const s=this.fragPlaying,n=t.level;(!s||t.sn!==s.sn||s.level!==n)&&(this.fragPlaying=t,this.hls.trigger(Events.FRAG_CHANGED,{frag:t}),(!s||s.level!==n)&&this.hls.trigger(Events.LEVEL_SWITCHED,{level:n}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){var e;if(this.fragPlaying)return this.fragPlaying;const t=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;return isFiniteNumber(t)?this.getAppendedFrag(t):null}get currentProgramDateTime(){var e;const t=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;if(isFiniteNumber(t)){const i=this.getLevelDetails(),s=this.currentFrag||(i?findFragmentByPTS(null,i.fragments,t):null);if(s){const n=s.programDateTime;if(n!==null){const a=n+(t-s.start)*1e3;return new Date(a)}}}return null}get currentLevel(){const e=this.currentFrag;return e?e.level:-1}get nextBufferedFrag(){const e=this.currentFrag;return e?this.followingBufferedFrag(e):null}get forceStartLoad(){return this._forceStartLoad}}class KeyLoader extends Logger{constructor(e,t){super("key-loader",t),this.config=void 0,this.keyIdToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const i in this.keyIdToKeyInfo){const s=this.keyIdToKeyInfo[i].loader;if(s){var t;if(e&&e!==((t=s.context)==null?void 0:t.frag.type))return;s.abort()}}}detach(){for(const e in this.keyIdToKeyInfo){const t=this.keyIdToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyIdToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyIdToKeyInfo){const t=this.keyIdToKeyInfo[e].loader;t&&t.destroy()}this.keyIdToKeyInfo={}}createKeyLoadError(e,t=ErrorDetails.KEY_LOAD_ERROR,i,s,n){return new LoadError({type:ErrorTypes.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:n,error:i,networkDetails:s})}loadClear(e,t,i){if(this.emeController&&this.config.emeEnabled&&!this.emeController.getSelectedKeySystemFormats().length){if(t.length)for(let s=0,n=t.length;s<n;s++){const a=t[s];if(e.cc<=a.cc&&(!isMediaFragment(e)||!isMediaFragment(a)||e.sn<a.sn)||!i&&s==n-1)return this.emeController.selectKeySystemFormat(a).then(o=>{if(!this.emeController)return;a.setKeyFormat(o);const c=keySystemFormatToKeySystemDomain(o);if(c)return this.emeController.getKeySystemAccess([c])})}if(this.config.requireKeySystemAccessOnStart){const s=getKeySystemsForConfig(this.config);if(s.length)return this.emeController.getKeySystemAccess(s)}}return null}load(e){return!e.decryptdata&&e.encrypted&&this.emeController&&this.config.emeEnabled?this.emeController.selectKeySystemFormat(e).then(t=>this.loadInternal(e,t)):this.loadInternal(e)}loadInternal(e,t){var i,s;t&&e.setKeyFormat(t);const n=e.decryptdata;if(!n){const u=new Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:`Missing decryption data on fragment in onKeyLoading (emeEnabled with controller: ${this.emeController&&this.config.emeEnabled})`);return Promise.reject(this.createKeyLoadError(e,ErrorDetails.KEY_LOAD_ERROR,u))}const a=n.uri;if(!a)return Promise.reject(this.createKeyLoadError(e,ErrorDetails.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${a}"`)));const o=getKeyId(n);let c=this.keyIdToKeyInfo[o];if((i=c)!=null&&i.decryptdata.key)return n.key=c.decryptdata.key,Promise.resolve({frag:e,keyInfo:c});if(this.emeController&&(s=c)!=null&&s.keyLoadPromise)switch(this.emeController.getKeyStatus(c.decryptdata)){case"usable":case"usable-in-future":return c.keyLoadPromise.then(f=>{const{keyInfo:d}=f;return n.key=d.decryptdata.key,{frag:e,keyInfo:d}})}switch(this.log(`${this.keyIdToKeyInfo[o]?"Rel":"L"}oading${n.keyId?" keyId: "+arrayToHex(n.keyId):""} URI: ${n.uri} from ${e.type} ${e.level}`),c=this.keyIdToKeyInfo[o]={decryptdata:n,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},n.method){case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return n.keyFormat==="identity"?this.loadKeyHTTP(c,e):this.loadKeyEME(c,e);case"AES-128":case"AES-256":case"AES-256-CTR":return this.loadKeyHTTP(c,e);default:return Promise.reject(this.createKeyLoadError(e,ErrorDetails.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${n.method}"`)))}}loadKeyEME(e,t){const i={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){var s;if(!e.decryptdata.keyId&&(s=t.initSegment)!=null&&s.data){const a=parseKeyIdsFromTenc(t.initSegment.data);if(a.length){let o=a[0];o.some(c=>c!==0)?(this.log(`Using keyId found in init segment ${arrayToHex(o)}`),LevelKey.setKeyIdForUri(e.decryptdata.uri,o)):(o=LevelKey.addKeyIdForUri(e.decryptdata.uri),this.log(`Generating keyId to patch media ${arrayToHex(o)}`)),e.decryptdata.keyId=o}}if(!e.decryptdata.keyId&&!isMediaFragment(t))return Promise.resolve(i);const n=this.emeController.loadKey(i);return(e.keyLoadPromise=n.then(a=>(e.mediaKeySessionContext=a,i))).catch(a=>{throw e.keyLoadPromise=null,"data"in a&&(a.data.frag=t),a})}return Promise.resolve(i)}loadKeyHTTP(e,t){const i=this.config,s=i.loader,n=new s(i);return t.keyLoader=e.loader=n,e.keyLoadPromise=new Promise((a,o)=>{const c={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},u=i.keyLoadPolicy.default,f={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},d={onSuccess:(g,E,m,T)=>{const{frag:S,keyInfo:b}=m,C=getKeyId(b.decryptdata);if(!S.decryptdata||b!==this.keyIdToKeyInfo[C])return o(this.createKeyLoadError(S,ErrorDetails.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),T));b.decryptdata.key=S.decryptdata.key=new Uint8Array(g.data),S.keyLoader=null,b.loader=null,a({frag:S,keyInfo:b})},onError:(g,E,m,T)=>{this.resetLoader(E),o(this.createKeyLoadError(t,ErrorDetails.KEY_LOAD_ERROR,new Error(`HTTP Error ${g.code} loading key ${g.text}`),m,_objectSpread2({url:c.url,data:void 0},g)))},onTimeout:(g,E,m)=>{this.resetLoader(E),o(this.createKeyLoadError(t,ErrorDetails.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),m))},onAbort:(g,E,m)=>{this.resetLoader(E),o(this.createKeyLoadError(t,ErrorDetails.INTERNAL_ABORTED,new Error("key loading aborted"),m))}};n.load(c,f,d)})}resetLoader(e){const{frag:t,keyInfo:i,url:s}=e,n=i.loader;t.keyLoader===n&&(t.keyLoader=null,i.loader=null);const a=getKeyId(i.decryptdata)||s;delete this.keyIdToKeyInfo[a],n&&n.destroy()}}function getKeyId(r){if(r.keyFormat!==KeySystemFormats.FAIRPLAY){const e=r.keyId;if(e)return arrayToHex(e)}return r.uri}function mapContextToLevelType(r){const{type:e}=r;switch(e){case PlaylistContextType.AUDIO_TRACK:return PlaylistLevelType.AUDIO;case PlaylistContextType.SUBTITLE_TRACK:return PlaylistLevelType.SUBTITLE;default:return PlaylistLevelType.MAIN}}function getResponseUrl(r,e){let t=r.url;return(t===void 0||t.indexOf("data:")===0)&&(t=e.url),t}class PlaylistLoader{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.onManifestLoaded=this.checkAutostartLoad,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on(Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Events.LEVEL_LOADING,this.onLevelLoading,this),e.on(Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.on(Events.LEVELS_UPDATED,this.onLevelsUpdated,this)}unregisterListeners(){const{hls:e}=this;e.off(Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Events.LEVEL_LOADING,this.onLevelLoading,this),e.off(Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.off(Events.LEVELS_UPDATED,this.onLevelsUpdated,this)}createInternalLoader(e){const t=this.hls.config,i=t.pLoader,s=t.loader,n=i||s,a=new n(t);return this.loaders[e.type]=a,a}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){const{url:i}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:PlaylistContextType.MANIFEST,url:i,deliveryDirectives:null,levelOrTrack:null})}onLevelLoading(e,t){const{id:i,level:s,pathwayId:n,url:a,deliveryDirectives:o,levelInfo:c}=t;this.load({id:i,level:s,pathwayId:n,responseType:"text",type:PlaylistContextType.LEVEL,url:a,deliveryDirectives:o,levelOrTrack:c})}onAudioTrackLoading(e,t){const{id:i,groupId:s,url:n,deliveryDirectives:a,track:o}=t;this.load({id:i,groupId:s,level:null,responseType:"text",type:PlaylistContextType.AUDIO_TRACK,url:n,deliveryDirectives:a,levelOrTrack:o})}onSubtitleTrackLoading(e,t){const{id:i,groupId:s,url:n,deliveryDirectives:a,track:o}=t;this.load({id:i,groupId:s,level:null,responseType:"text",type:PlaylistContextType.SUBTITLE_TRACK,url:n,deliveryDirectives:a,levelOrTrack:o})}onLevelsUpdated(e,t){const i=this.loaders[PlaylistContextType.LEVEL];if(i){const s=i.context;s&&!t.levels.some(n=>n===s.levelOrTrack)&&(i.abort(),delete this.loaders[PlaylistContextType.LEVEL])}}load(e){var t;const i=this.hls.config;let s=this.getInternalLoader(e);if(s){const u=this.hls.logger,f=s.context;if(f&&f.levelOrTrack===e.levelOrTrack&&(f.url===e.url||f.deliveryDirectives&&!e.deliveryDirectives)){f.url===e.url?u.log(`[playlist-loader]: ignore ${e.url} ongoing request`):u.log(`[playlist-loader]: ignore ${e.url} in favor of ${f.url}`);return}u.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),s.abort()}let n;if(e.type===PlaylistContextType.MANIFEST?n=i.manifestLoadPolicy.default:n=_extends({},i.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),s=this.createInternalLoader(e),isFiniteNumber((t=e.deliveryDirectives)==null?void 0:t.part)){let u;if(e.type===PlaylistContextType.LEVEL&&e.level!==null?u=this.hls.levels[e.level].details:e.type===PlaylistContextType.AUDIO_TRACK&&e.id!==null?u=this.hls.audioTracks[e.id].details:e.type===PlaylistContextType.SUBTITLE_TRACK&&e.id!==null&&(u=this.hls.subtitleTracks[e.id].details),u){const f=u.partTarget,d=u.targetduration;if(f&&d){const g=Math.max(f*3,d*.8)*1e3;n=_extends({},n,{maxTimeToFirstByteMs:Math.min(g,n.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(g,n.maxTimeToFirstByteMs)})}}}const a=n.errorRetry||n.timeoutRetry||{},o={loadPolicy:n,timeout:n.maxLoadTimeMs,maxRetry:a.maxNumRetry||0,retryDelay:a.retryDelayMs||0,maxRetryDelay:a.maxRetryDelayMs||0},c={onSuccess:(u,f,d,g)=>{const E=this.getInternalLoader(d);this.resetInternalLoader(d.type);const m=u.data;f.parsing.start=performance.now(),M3U8Parser.isMediaPlaylist(m)||d.type!==PlaylistContextType.MANIFEST?this.handleTrackOrLevelPlaylist(u,f,d,g||null,E):this.handleMasterPlaylist(u,f,d,g)},onError:(u,f,d,g)=>{this.handleNetworkError(f,d,!1,u,g)},onTimeout:(u,f,d)=>{this.handleNetworkError(f,d,!0,void 0,u)}};s.load(e,o,c)}checkAutostartLoad(){if(!this.hls)return;const{config:{autoStartLoad:e,startPosition:t},forceStartLoad:i}=this.hls;(e||i)&&(this.hls.logger.log(`${e?"auto":"force"} startLoad with configured startPosition ${t}`),this.hls.startLoad(t))}handleMasterPlaylist(e,t,i,s){const n=this.hls,a=e.data,o=getResponseUrl(e,i),c=M3U8Parser.parseMasterPlaylist(a,o);if(c.playlistParsingError){t.parsing.end=performance.now(),this.handleManifestParsingError(e,i,c.playlistParsingError,s,t);return}const{contentSteering:u,levels:f,sessionData:d,sessionKeys:g,startTimeOffset:E,variableList:m}=c;this.variableList=m,f.forEach(C=>{const{unknownCodecs:I}=C;if(I){const{preferManagedMediaSource:L}=this.hls.config;let{audioCodec:k,videoCodec:U}=C;for(let O=I.length;O--;){const F=I[O];areCodecsMediaSourceSupported(F,"audio",L)?(C.audioCodec=k=k?`${k},${F}`:F,sampleEntryCodesISO.audio[k.substring(0,4)]=2,I.splice(O,1)):areCodecsMediaSourceSupported(F,"video",L)&&(C.videoCodec=U=U?`${U},${F}`:F,sampleEntryCodesISO.video[U.substring(0,4)]=2,I.splice(O,1))}}});const{AUDIO:T=[],SUBTITLES:S,"CLOSED-CAPTIONS":b}=M3U8Parser.parseMasterPlaylistMedia(a,o,c);T.length&&!T.some(I=>!I.url)&&f[0].audioCodec&&!f[0].attrs.AUDIO&&(this.hls.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),T.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new AttrList({}),bitrate:0,url:""})),n.trigger(Events.MANIFEST_LOADED,{levels:f,audioTracks:T,subtitles:S,captions:b,contentSteering:u,url:o,stats:t,networkDetails:s,sessionData:d,sessionKeys:g,startTimeOffset:E,variableList:m})}handleTrackOrLevelPlaylist(e,t,i,s,n){const a=this.hls,{id:o,level:c,type:u}=i,f=getResponseUrl(e,i),d=isFiniteNumber(c)?c:isFiniteNumber(o)?o:0,g=mapContextToLevelType(i),E=M3U8Parser.parseLevelPlaylist(e.data,f,d,g,0,this.variableList);if(u===PlaylistContextType.MANIFEST){const m={attrs:new AttrList({}),bitrate:0,details:E,name:"",url:f};E.requestScheduled=t.loading.start+computeReloadInterval(E,0),a.trigger(Events.MANIFEST_LOADED,{levels:[m],audioTracks:[],url:f,stats:t,networkDetails:s,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),i.levelDetails=E,this.handlePlaylistLoaded(E,e,t,i,s,n)}handleManifestParsingError(e,t,i,s,n){this.hls.trigger(Events.ERROR,{type:ErrorTypes.NETWORK_ERROR,details:ErrorDetails.MANIFEST_PARSING_ERROR,fatal:t.type===PlaylistContextType.MANIFEST,url:e.url,err:i,error:i,reason:i.message,response:e,context:t,networkDetails:s,stats:n})}handleNetworkError(e,t,i=!1,s,n){let a=`A network ${i?"timeout":"error"+(s?" (status "+s.code+")":"")} occurred while loading ${e.type}`;e.type===PlaylistContextType.LEVEL?a+=`: ${e.level} id: ${e.id}`:(e.type===PlaylistContextType.AUDIO_TRACK||e.type===PlaylistContextType.SUBTITLE_TRACK)&&(a+=` id: ${e.id} group-id: "${e.groupId}"`);const o=new Error(a);this.hls.logger.warn(`[playlist-loader]: ${a}`);let c=ErrorDetails.UNKNOWN,u=!1;const f=this.getInternalLoader(e);switch(e.type){case PlaylistContextType.MANIFEST:c=i?ErrorDetails.MANIFEST_LOAD_TIMEOUT:ErrorDetails.MANIFEST_LOAD_ERROR,u=!0;break;case PlaylistContextType.LEVEL:c=i?ErrorDetails.LEVEL_LOAD_TIMEOUT:ErrorDetails.LEVEL_LOAD_ERROR,u=!1;break;case PlaylistContextType.AUDIO_TRACK:c=i?ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:ErrorDetails.AUDIO_TRACK_LOAD_ERROR,u=!1;break;case PlaylistContextType.SUBTITLE_TRACK:c=i?ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:ErrorDetails.SUBTITLE_LOAD_ERROR,u=!1;break}f&&this.resetInternalLoader(e.type);const d={type:ErrorTypes.NETWORK_ERROR,details:c,fatal:u,url:e.url,loader:f,context:e,error:o,networkDetails:t,stats:n};if(s){const g=t?.url||e.url;d.response=_objectSpread2({url:g,data:void 0},s)}this.hls.trigger(Events.ERROR,d)}handlePlaylistLoaded(e,t,i,s,n,a){const o=this.hls,{type:c,level:u,levelOrTrack:f,id:d,groupId:g,deliveryDirectives:E}=s,m=getResponseUrl(t,s),T=mapContextToLevelType(s);let S=typeof s.level=="number"&&T===PlaylistLevelType.MAIN?u:void 0;const b=e.playlistParsingError;if(b){if(this.hls.logger.warn(`${b} ${e.url}`),!o.config.ignorePlaylistParsingErrors){o.trigger(Events.ERROR,{type:ErrorTypes.NETWORK_ERROR,details:ErrorDetails.LEVEL_PARSING_ERROR,fatal:!1,url:m,error:b,reason:b.message,response:t,context:s,level:S,parent:T,networkDetails:n,stats:i});return}e.playlistParsingError=null}if(!e.fragments.length){const C=e.playlistParsingError=new Error("No Segments found in Playlist");o.trigger(Events.ERROR,{type:ErrorTypes.NETWORK_ERROR,details:ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:m,error:C,reason:C.message,response:t,context:s,level:S,parent:T,networkDetails:n,stats:i});return}switch(e.live&&a&&(a.getCacheAge&&(e.ageHeader=a.getCacheAge()||0),(!a.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),c){case PlaylistContextType.MANIFEST:case PlaylistContextType.LEVEL:if(S){if(!f)S=0;else if(f!==o.levels[S]){const C=o.levels.indexOf(f);C>-1&&(S=C)}}o.trigger(Events.LEVEL_LOADED,{details:e,levelInfo:f||o.levels[0],level:S||0,id:d||0,stats:i,networkDetails:n,deliveryDirectives:E,withoutMultiVariant:c===PlaylistContextType.MANIFEST});break;case PlaylistContextType.AUDIO_TRACK:o.trigger(Events.AUDIO_TRACK_LOADED,{details:e,track:f,id:d||0,groupId:g||"",stats:i,networkDetails:n,deliveryDirectives:E});break;case PlaylistContextType.SUBTITLE_TRACK:o.trigger(Events.SUBTITLE_TRACK_LOADED,{details:e,track:f,id:d||0,groupId:g||"",stats:i,networkDetails:n,deliveryDirectives:E});break}}}class Hls{static get version(){return version}static isMSESupported(){return isMSESupported()}static isSupported(){return isSupported()}static getMediaSource(){return getMediaSource()}static get Events(){return Events}static get MetadataSchema(){return MetadataSchema}static get ErrorTypes(){return ErrorTypes}static get ErrorDetails(){return ErrorDetails}static get DefaultConfig(){return Hls.defaultConfig?Hls.defaultConfig:hlsDefaultConfig}static set DefaultConfig(e){Hls.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.logger=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new EventEmitter,this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioStreamController=void 0,this.subtititleStreamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.interstitialsController=void 0,this.gapController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this._url=null,this._sessionId=void 0,this.triggeringException=void 0,this.started=!1;const t=this.logger=enableLogs(e.debug||!1,"Hls instance",e.assetPlayerId),i=this.config=mergeConfig(Hls.DefaultConfig,e,t);this.userConfig=e,i.progressive&&enableStreamingMode(i,t);const{abrController:s,bufferController:n,capLevelController:a,errorController:o,fpsController:c}=i,u=new o(this),f=this.abrController=new s(this),d=new FragmentTracker(this),g=i.interstitialsController,E=g?this.interstitialsController=new g(this,Hls):null,m=this.bufferController=new n(this,d),T=this.capLevelController=new a(this),S=new c(this),b=new PlaylistLoader(this),C=i.contentSteeringController,I=C?new C(this):null,L=this.levelController=new LevelController(this,I),k=new ID3TrackController(this),U=new KeyLoader(this.config,this.logger),O=this.streamController=new StreamController(this,d,U),F=this.gapController=new GapController(this,d);T.setStreamController(O),S.setStreamController(O);const G=[b,L,O];E&&G.splice(1,0,E),I&&G.splice(1,0,I),this.networkControllers=G;const x=[f,m,F,T,S,k,d];this.audioTrackController=this.createController(i.audioTrackController,G);const $=i.audioStreamController;$&&G.push(this.audioStreamController=new $(this,d,U)),this.subtitleTrackController=this.createController(i.subtitleTrackController,G);const X=i.subtitleStreamController;X&&G.push(this.subtititleStreamController=new X(this,d,U)),this.createController(i.timelineController,x),U.emeController=this.emeController=this.createController(i.emeController,x),this.cmcdController=this.createController(i.cmcdController,x),this.latencyController=this.createController(LatencyController,x),this.coreComponents=x,G.push(u);const Q=u.onErrorOut;typeof Q=="function"&&this.on(Events.ERROR,Q,u),this.on(Events.MANIFEST_LOADED,b.onManifestLoaded,b)}createController(e,t){if(e){const i=new e(this);return t&&t.push(i),i}return null}on(e,t,i=this){this._emitter.on(e,t,i)}once(e,t,i=this){this._emitter.once(e,t,i)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,i=this,s){this._emitter.off(e,t,i,s)}listeners(e){return this._emitter.listeners(e)}emit(e,t,i){return this._emitter.emit(e,t,i)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(i){if(this.logger.error("An internal error happened while handling event "+e+'. Error message: "'+i.message+'". Here is a stacktrace:',i),!this.triggeringException){this.triggeringException=!0;const s=e===Events.ERROR;this.trigger(Events.ERROR,{type:ErrorTypes.OTHER_ERROR,details:ErrorDetails.INTERNAL_EXCEPTION,fatal:s,event:e,error:i}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){this.logger.log("destroy"),this.trigger(Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this._url=null,this.networkControllers.forEach(t=>t.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(t=>t.destroy()),this.coreComponents.length=0;const e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){if(!e||"media"in e&&!e.media){const n=new Error(`attachMedia failed: invalid argument (${e})`);this.trigger(Events.ERROR,{type:ErrorTypes.OTHER_ERROR,details:ErrorDetails.ATTACH_MEDIA_ERROR,fatal:!0,error:n});return}this.logger.log("attachMedia"),this._media&&(this.logger.warn("media must be detached before attaching"),this.detachMedia());const t="media"in e,i=t?e.media:e,s=t?e:{media:i};this._media=i,this.trigger(Events.MEDIA_ATTACHING,s)}detachMedia(){this.logger.log("detachMedia"),this.trigger(Events.MEDIA_DETACHING,{}),this._media=null}transferMedia(){this._media=null;const e=this.bufferController.transferMedia();return this.trigger(Events.MEDIA_DETACHING,{transferMedia:e}),e}loadSource(e){this.stopLoad();const t=this.media,i=this._url,s=this._url=urlToolkitExports.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.logger.log(`loadSource:${s}`),t&&i&&(i!==s||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(Events.MANIFEST_LOADING,{url:e})}get url(){return this._url}get hasEnoughToStart(){return this.streamController.hasEnoughToStart}get startPosition(){return this.streamController.startPositionValue}startLoad(e=-1,t){this.logger.log(`startLoad(${e+(t?", <skip seek to start>":"")})`),this.started=!0,this.resumeBuffering();for(let i=0;i<this.networkControllers.length&&(this.networkControllers[i].startLoad(e,t),!(!this.started||!this.networkControllers));i++);}stopLoad(){this.logger.log("stopLoad"),this.started=!1;for(let e=0;e<this.networkControllers.length&&(this.networkControllers[e].stopLoad(),!(this.started||!this.networkControllers));e++);}get loadingEnabled(){return this.started}get bufferingEnabled(){return this.streamController.bufferingEnabled}resumeBuffering(){this.bufferingEnabled||(this.logger.log("resume buffering"),this.networkControllers.forEach(e=>{e.resumeBuffering&&e.resumeBuffering()}))}pauseBuffering(){this.bufferingEnabled&&(this.logger.log("pause buffering"),this.networkControllers.forEach(e=>{e.pauseBuffering&&e.pauseBuffering()}))}get inFlightFragments(){const e={[PlaylistLevelType.MAIN]:this.streamController.inFlightFrag};return this.audioStreamController&&(e[PlaylistLevelType.AUDIO]=this.audioStreamController.inFlightFrag),this.subtititleStreamController&&(e[PlaylistLevelType.SUBTITLE]=this.subtititleStreamController.inFlightFrag),e}swapAudioCodec(){this.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){this.logger.log("recoverMediaError");const e=this._media,t=e?.currentTime;this.detachMedia(),e&&(this.attachMedia(e),t&&this.startLoad(t))}removeLevel(e){this.levelController.removeLevel(e)}get sessionId(){let e=this._sessionId;return e||(e=this._sessionId=uuid()),e}get levels(){const e=this.levelController.levels;return e||[]}get latestLevelDetails(){return this.streamController.getLevelDetails()||null}get loadLevelObj(){return this.levelController.loadLevelObj}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){this.logger.log(`set currentLevel:${e}`),this.levelController.manualLevel=e,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){this.logger.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){this.logger.log(`set loadLevel:${e}`),this.levelController.manualLevel=e}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(e){this.levelController.nextLoadLevel=e}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(e){this.logger.log(`set firstLevel:${e}`),this.levelController.firstLevel=e}get startLevel(){const e=this.levelController.startLevel;return e===-1&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:e}set startLevel(e){this.logger.log(`set startLevel:${e}`),e!==-1&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(e){const t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimate():NaN}set bandwidthEstimate(e){this.abrController.resetEstimator(e)}get abrEwmaDefaultEstimate(){const{bwEstimator:e}=this.abrController;return e?e.defaultEstimate:NaN}get ttfbEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(this.logger.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){isHdcpLevel(e)&&this._maxHdcpLevel!==e&&(this._maxHdcpLevel=e,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return this.levelController.manualLevel===-1}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:t}}=this;if(!e)return 0;const i=e.length;for(let s=0;s<i;s++)if(e[s].maxBitrate>=t)return s;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:i}=this;let s;if(t===-1&&e!=null&&e.length?s=e.length-1:s=t,i)for(let n=s;n--;){const a=e[n].attrs["HDCP-LEVEL"];if(a&&a<=i)return n}return s}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(e){this.abrController.nextAutoLevel=e}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}get maxBufferLength(){return this.streamController.maxBufferLength}setAudioOption(e){var t;return((t=this.audioTrackController)==null?void 0:t.setAudioOption(e))||null}setSubtitleOption(e){var t;return((t=this.subtitleTrackController)==null?void 0:t.setSubtitleOption(e))||null}get allAudioTracks(){const e=this.audioTrackController;return e?e.allAudioTracks:[]}get audioTracks(){const e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){const e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){const t=this.audioTrackController;t&&(t.audioTrack=e)}get allSubtitleTracks(){const e=this.subtitleTrackController;return e?e.allSubtitleTracks:[]}get subtitleTracks(){const e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){const e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){const t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return e?e.subtitleDisplay:!1}set subtitleDisplay(e){const t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}set targetLatency(e){this.latencyController.targetLatency=e}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}get pathways(){return this.levelController.pathways}get pathwayPriority(){return this.levelController.pathwayPriority}set pathwayPriority(e){this.levelController.pathwayPriority=e}get bufferedToEnd(){var e;return!!((e=this.bufferController)!=null&&e.bufferedToEnd)}get interstitialsManager(){var e;return((e=this.interstitialsController)==null?void 0:e.interstitialsManager)||null}getMediaDecodingInfo(e,t=this.allAudioTracks){const i=getAudioTracksByGroup(t);return getMediaDecodingInfoPromise(e,i,navigator.mediaCapabilities)}}Hls.defaultConfig=void 0;const checkPwaInstalled=()=>{const r=window.matchMedia("(display-mode: standalone)").matches,e=/iphone|ipad|ipod/i.test(window.navigator.userAgent),t=window.navigator.standalone===!0;return r||e&&t},usePWAInstalled=()=>{const[r,e]=React.useState(checkPwaInstalled());return React.useEffect(()=>{const t=()=>{e(checkPwaInstalled())};return window.addEventListener("DOMContentLoaded",t),window.addEventListener("appinstalled",t),()=>{window.removeEventListener("DOMContentLoaded",t),window.removeEventListener("appinstalled",t)}},[]),r};function VideoPlayer({src:r,reverseSrc:e,poster:t,keySrc:i,onPlay:s,onPause:n}){const[a,o]=React.useState(!1),[c,u]=React.useState(!1),f=React.useRef(null),{os:d,browser:g}=useUserAgent(),E=useDeviceType(),[m,T]=React.useState(!1),[S,b]=React.useState(!1),[C,I]=React.useState(0),[L,k]=React.useState(0),[U,O]=React.useState([]),[F,G]=React.useState(!1),[x,$]=React.useState(!1),X=usePWAInstalled(),[Q,ee]=React.useState(!1),[te,re]=React.useState([{value:.5,label:"0.5x",active:!1},{value:1,label:"1x",active:!0},{value:1.25,label:"1.25x",active:!1},{value:1.5,label:"1.5x",active:!1},{value:1.75,label:"1.75x",active:!1},{value:2,label:"2x",active:!1},{value:2.5,label:"2.5x",active:!1},{value:3,label:"3x",active:!1}]),me=React.useRef(null),H=React.useRef(null),[z,ie]=React.useState(!1),ne=React.useRef(null),he=React.useRef(!1);React.useEffect(()=>(Pe(),document.addEventListener("keypress",pe),()=>{ne.current?.destroy(),ne.current=null,document.removeEventListener("keypress",pe)}),[r,i]);function pe(Se){Se.preventDefault(),Se.code.toUpperCase()==="SPACE"&&Qe()}async function Pe(){if(!f.current||!r)return;const Se=r.endsWith(".m3u8");if(Hls.isSupported()&&Se)try{const lt=new Hls({xhrSetup:function(ht,pt){pt.includes(".key")&&i&&ht.open("GET",i,!0)},maxBufferLength:30,maxMaxBufferLength:60,maxBufferSize:3e7,maxBufferHole:1,startPosition:-1,autoStartLoad:!0});lt.on(Hls.Events.ERROR,function(ht,pt){console.error("Hls error:",pt)}),ne.current=lt,lt.loadSource(r),lt.attachMedia(f.current)}catch{$(!0)}else f.current.canPlayType("application/vnd.apple.mpegurl")&&Se?e&&(f.current.src=e):f.current.src=r;f.current.poster=t??"",f.current.addEventListener("canplay",ae),f.current.addEventListener("loadedmetadata",Le),f.current.addEventListener("play",ce),f.current.addEventListener("pause",Ee),f.current.addEventListener("timeupdate",Y),f.current.addEventListener("progress",Re),f.current.addEventListener("error",Ae),f.current.addEventListener("playing",ve),f.current.addEventListener("waiting",Be),document.addEventListener("visibilitychange",q),le()}React.useEffect(()=>{a&&c&&G(!0)},[a,c]),React.useEffect(()=>{const Se=setTimeout(()=>{G(!1)},1e4);return()=>{clearTimeout(Se)}},[F]);function ae(){o(!0),$(!1)}function Ae(){$(!0),o(!1),u(!1);const Se=f.current?.error;if(Se)switch(Se.code){case MediaError.MEDIA_ERR_ABORTED:console.log("خطا: بارگذاری ویدیو قطع شد.");break;case MediaError.MEDIA_ERR_NETWORK:console.log("خطا: مشکل شبکه هنگام بارگذاری ویدیو.");break;case MediaError.MEDIA_ERR_DECODE:console.log("خطا: مشکل در رمزگشایی فایل ویدیو.");break;case MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:console.log("خطا: فرمت یا سورس ویدیو پشتیبانی نمی‌شود.");break;default:console.log("خطای نامشخص در ویدیو.");break}else console.log("خطای ناشناخته در پخش ویدیو")}function Re(){const Se=f.current;if(!Se)return;const lt=[],ht=Se.buffered;for(let pt=0;pt<ht.length;pt++){const Ui=ht.start(pt),Pi=ht.end(pt);lt.push({start:Ui,end:Pi})}O(lt)}function Le(){o(!0),$(!1),k(f.current?.duration??0)}function Y(){I(f.current?.currentTime??0)}function q(){f.current?.pause()}function le(){new IntersectionObserver(lt=>{for(const ht of lt){const pt=ht.target;ht.intersectionRatio<.5?!pt.paused&&!pt.ended&&(pt.pause(),he.current=!0):ht.isIntersecting&&(he.current&&pt.play().catch(()=>{}),he.current=!1)}},{threshold:[0,.5,1]}).observe(f.current)}function ce(){u(!0),s?.()}function Ee(){u(!1),n?.()}function ve(){o(!0),u(!0)}function Be(){o(!1),u(!1),$(!1)}async function Ie(){if(ee(Se=>!Se),d.name?.toUpperCase().includes("IOS")||g.name?.toUpperCase().includes("SAFARI")&&d.name?.toUpperCase().includes("MAC")&&(E===DeviceTypeEnum.MOBILE||X))S?(f.current?.classList.remove("!object-contain"),f.current?.parentElement?.classList.remove("!z-[999]")):(f.current?.classList.add("!object-contain"),f.current?.parentElement?.classList.add("!z-[999]")),b(!S);else{if(document.fullscreenElement)await document.exitFullscreen(),f.current?.classList.remove("!object-contain"),f.current?.parentElement?.classList.remove("!z-[9999999]");else{const Se=f.current?.parentElement;if(Se){const lt=Se.requestFullscreen||Se.webkitRequestFullscreen||Se.mozRequestFullScreen||Se.msRequestFullscreen;if(lt){const ht=lt.call(Se);ht&&ht.catch(pt=>{console.error("Error attempting to enable full-screen mode:",pt)})}else console.warn("Fullscreen API is not supported by this browser.")}f.current?.classList.add("!object-contain"),f.current?.parentElement?.classList.add("!z-[9999999]")}gt()}}React.useEffect(()=>{gt()},[S]);function Me(){f.current&&(f.current.currentTime+=15)}function Ve(){f.current&&(f.current.currentTime-=15)}function dt(){f.current&&(m?f.current.muted=!1:f.current.muted=!0,T(!m))}function Qe(){c?f.current?.pause():f.current?.play()}function ze(){let Se=lodashExports.findIndex(te,ht=>ht.active),lt=te[Se].value;Se+1==te.length?Se=0:Se+=1,re(te.map((ht,pt)=>pt==Se?(lt=ht.value,{value:ht.value,label:ht.label,active:!0}):{value:ht.value,label:ht.label,active:!1})),f.current&&(f.current.playbackRate=lt)}function Je(Se){f.current&&(f.current.currentTime=Se)}function gt(){document.fullscreenElement||S?document.body.classList.add("landscape-allowed"):document.body.classList.remove("landscape-allowed")}const yt=React.useRef(lodashExports.debounce(()=>{G(!0)})).current;function _t(){$(!1),Pe()}function qe(){me.current&&(clearTimeout(me.current),me.current=null),Me()}function Yt(){me.current&&(clearTimeout(me.current),me.current=null),Ve()}function Dt(){ie(!1),H.current=setTimeout(()=>{ie(!0),re(te.map(Se=>Se.value==2?{value:Se.value,label:Se.label,active:!0}:{value:Se.value,label:Se.label,active:!1})),f.current&&(f.current.playbackRate=2)},1e3)}function St(){z&&(re(te.map(Se=>Se.value==1?{value:Se.value,label:Se.label,active:!0}:{value:Se.value,label:Se.label,active:!1})),f.current&&(f.current.playbackRate=1)),H.current&&(clearTimeout(H.current),H.current=null)}return jsxRuntime.jsxs("section",{onMouseMove:yt,onTouchMove:yt,onMouseDown:Dt,onMouseUp:St,onTouchStart:Dt,onTouchEnd:St,onClick:()=>{if(z){ie(!1);return}me.current!==null&&(clearTimeout(me.current),me.current=null),c?me.current=setTimeout(()=>{f.current?.pause()},300):f.current?.play()},style:{direction:"rtl"},className:S?"sp__fullscreen__safari":"w-full h-full relative",children:[jsxRuntime.jsx("video",{width:"100%",height:"100%",className:"w-full h-full object-cover",ref:f,playsInline:!0,"webkit-playsinline":"true",controls:!1}),jsxRuntime.jsx(VideoPlayerControl,{isError:x,isShowControl:F,onSeek:Je,bufferedRanges:U,rates:te,currentTime:C,duration:L,onTogglePlay:Qe,isMuted:m,onToggleMute:dt,onBackwardCurrentTime:Ve,onForwardCurrentTime:Me,onDoubleClickInRight:qe,onDoubleClickInLeft:Yt,onMaximize:Ie,canPlay:a,isPlayed:c,onChangeRate:ze,isFullScreen:Q,onTryAgain:_t})]})}exports.VideoPlayer=VideoPlayer,exports.VideoPlayerControl=VideoPlayerControl,exports.default=VideoPlayer,Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
317
+ `:(n=i.childNodes)!=null&&n.length?getTextContent(i,e):e?t+i.textContent.trim().replace(/\s+/g," "):t+i.textContent},"")}function getTtmlStyles(r,e,t){const i="http://www.w3.org/ns/ttml#styling";let s=null;const n=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],a=r!=null&&r.hasAttribute("style")?r.getAttribute("style"):null;return a&&t.hasOwnProperty(a)&&(s=t[a]),n.reduce((o,c)=>{const u=getAttributeNS(e,i,c)||getAttributeNS(r,i,c)||getAttributeNS(s,i,c);return u&&(o[c]=u),o},{})}function getAttributeNS(r,e,t){return r&&r.hasAttributeNS(e,t)?r.getAttributeNS(e,t):null}function timestampParsingError(r){return new Error(`Could not parse ttml timestamp ${r}`)}function parseTtmlTime(r,e){if(!r)return null;let t=parseTimeStamp(r);return t===null&&(HMSF_REGEX.test(r)?t=parseHoursMinutesSecondsFrames(r,e):TIME_UNIT_REGEX.test(r)&&(t=parseTimeUnits(r,e))),t}function parseHoursMinutesSecondsFrames(r,e){const t=HMSF_REGEX.exec(r),i=(t[4]|0)+(t[5]|0)/e.subFrameRate;return(t[1]|0)*3600+(t[2]|0)*60+(t[3]|0)+i/e.frameRate}function parseTimeUnits(r,e){const t=TIME_UNIT_REGEX.exec(r),i=Number(t[1]);switch(t[2]){case"h":return i*3600;case"m":return i*60;case"ms":return i*1e3;case"f":return i/e.frameRate;case"t":return i/e.tickRate}return i}class OutputFilter{constructor(e,t){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=e,this.trackName=t}dispatchCue(){this.startTime!==null&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)}newCue(e,t,i){(this.startTime===null||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=i,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}class TimelineController{constructor(e){this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=newVTTCCs(),this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},e.on(Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Events.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(Events.FRAG_LOADING,this.onFragLoading,this),e.on(Events.FRAG_LOADED,this.onFragLoaded,this),e.on(Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(Events.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(Events.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Events.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(Events.FRAG_LOADING,this.onFragLoading,this),e.off(Events.FRAG_LOADED,this.onFragLoaded,this),e.off(Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(Events.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(Events.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.media=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){const e=new OutputFilter(this,"textTrack1"),t=new OutputFilter(this,"textTrack2"),i=new OutputFilter(this,"textTrack3"),s=new OutputFilter(this,"textTrack4");this.cea608Parser1=new Cea608Parser(1,e,t),this.cea608Parser2=new Cea608Parser(3,i,s)}addCues(e,t,i,s,n){let a=!1;for(let o=n.length;o--;){const c=n[o],u=intersection(c[0],c[1],t,i);if(u>=0&&(c[0]=Math.min(c[0],t),c[1]=Math.max(c[1],i),a=!0,u/(i-t)>.5))return}if(a||n.push([t,i]),this.config.renderTextTracksNatively){const o=this.captionsTracks[e];this.Cues.newCue(o,t,i,s)}else{const o=this.Cues.newCue(null,t,i,s);this.hls.trigger(Events.CUES_PARSED,{type:"captions",cues:o,track:e})}}onInitPtsFound(e,{frag:t,id:i,initPTS:s,timescale:n,trackId:a}){const{unparsedVttFrags:o}=this;i===PlaylistLevelType.MAIN&&(this.initPTS[t.cc]={baseTime:s,timescale:n,trackId:a}),o.length&&(this.unparsedVttFrags=[],o.forEach(c=>{this.initPTS[c.frag.cc]?this.onFragLoaded(Events.FRAG_LOADED,c):this.hls.trigger(Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:c.frag,error:new Error("Subtitle discontinuity domain does not match main")})}))}getExistingTrack(e,t){const{media:i}=this;if(i)for(let s=0;s<i.textTracks.length;s++){const n=i.textTracks[s];if(canReuseVttTextTrack(n,{name:e,lang:t,characteristics:"transcribes-spoken-dialog,describes-music-and-sound"}))return n}return null}createCaptionsTrack(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)}createNativeTrack(e){if(this.captionsTracks[e])return;const{captionsProperties:t,captionsTracks:i,media:s}=this,{label:n,languageCode:a}=t[e],o=this.getExistingTrack(n,a);if(o)i[e]=o,clearCurrentCues(i[e]),sendAddTrackEvent(i[e],s);else{const c=this.createTextTrack("captions",n,a);c&&(c[e]=!0,i[e]=c)}}createNonNativeTrack(e){if(this.nonNativeCaptionsTracks[e])return;const t=this.captionsProperties[e];if(!t)return;const i=t.label,s={_id:e,label:i,kind:"captions",default:t.media?!!t.media.default:!1,closedCaptions:t.media};this.nonNativeCaptionsTracks[e]=s,this.hls.trigger(Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[s]})}createTextTrack(e,t,i){const s=this.media;if(s)return s.addTextTrack(e,t,i)}onMediaAttaching(e,t){this.media=t.media,t.mediaSource||this._cleanTracks()}onMediaDetaching(e,t){const i=!!t.transferMedia;if(this.media=null,i)return;const{captionsTracks:s}=this;Object.keys(s).forEach(n=>{clearCurrentCues(s[n]),delete s[n]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=newVTTCCs(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:e}=this;if(!e)return;const t=e.textTracks;if(t)for(let i=0;i<t.length;i++)clearCurrentCues(t[i])}onSubtitleTracksUpdated(e,t){const i=t.subtitleTracks||[],s=i.some(n=>n.textCodec===IMSC1_CODEC);if(this.config.enableWebVTT||s&&this.config.enableIMSC1){if(subtitleOptionsIdentical(this.tracks,i)){this.tracks=i;return}if(this.textTracks=[],this.tracks=i,this.config.renderTextTracksNatively){const a=this.media,o=a?filterSubtitleTracks(a.textTracks):null;if(this.tracks.forEach((c,u)=>{let f;if(o){let d=null;for(let g=0;g<o.length;g++)if(o[g]&&canReuseVttTextTrack(o[g],c)){d=o[g],o[g]=null;break}d&&(f=d)}if(f)clearCurrentCues(f);else{const d=captionsOrSubtitlesFromCharacteristics(c);f=this.createTextTrack(d,c.name,c.lang),f&&(f.mode="disabled")}f&&this.textTracks.push(f)}),o!=null&&o.length){const c=o.filter(u=>u!==null).map(u=>u.label);c.length&&this.hls.logger.warn(`Media element contains unused subtitle tracks: ${c.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const a=this.tracks.map(o=>({label:o.name,kind:o.type.toLowerCase(),default:o.default,subtitleTrack:o}));this.hls.trigger(Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:a})}}}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach(i=>{const s=/(?:CC|SERVICE)([1-4])/.exec(i.instreamId);if(!s)return;const n=`textTrack${s[1]}`,a=this.captionsProperties[n];a&&(a.label=i.name,i.lang&&(a.languageCode=i.lang),a.media=i)})}closedCaptionsForLevel(e){const t=this.hls.levels[e.level];return t?.attrs["CLOSED-CAPTIONS"]}onFragLoading(e,t){if(this.enabled&&t.frag.type===PlaylistLevelType.MAIN){var i,s;const{cea608Parser1:n,cea608Parser2:a,lastSn:o}=this,{cc:c,sn:u}=t.frag,f=(i=(s=t.part)==null?void 0:s.index)!=null?i:-1;n&&a&&(u!==o+1||u===o&&f!==this.lastPartIndex+1||c!==this.lastCc)&&(n.reset(),a.reset()),this.lastCc=c,this.lastSn=u,this.lastPartIndex=f}}onFragLoaded(e,t){const{frag:i,payload:s}=t;if(i.type===PlaylistLevelType.SUBTITLE)if(s.byteLength){const n=i.decryptdata,a="stats"in t;if(n==null||!n.encrypted||a){const o=this.tracks[i.level],c=this.vttCCs;c[i.cc]||(c[i.cc]={start:i.start,prevCC:this.prevCC,new:!0},this.prevCC=i.cc),o&&o.textCodec===IMSC1_CODEC?this._parseIMSC1(i,s):this._parseVTTs(t)}}else this.hls.trigger(Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const i=this.hls;parseIMSC1(t,this.initPTS[e.cc],s=>{this._appendCues(s,e.level),i.trigger(Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},s=>{i.logger.log(`Failed to parse IMSC1: ${s}`),i.trigger(Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:s})})}_parseVTTs(e){var t;const{frag:i,payload:s}=e,{initPTS:n,unparsedVttFrags:a}=this,o=n.length-1;if(!n[i.cc]&&o===-1){a.push(e);return}const c=this.hls,u=(t=i.initSegment)!=null&&t.data?appendUint8Array(i.initSegment.data,new Uint8Array(s)).buffer:s;parseWebVTT(u,this.initPTS[i.cc],this.vttCCs,i.cc,i.start,f=>{this._appendCues(f,i.level),c.trigger(Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:i})},f=>{const d=f.message==="Missing initPTS for VTT MPEGTS";d?a.push(e):this._fallbackToIMSC1(i,s),c.logger.log(`Failed to parse VTT cue: ${f}`),!(d&&o>i.cc)&&c.trigger(Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:f})})}_fallbackToIMSC1(e,t){const i=this.tracks[e.level];i.textCodec||parseIMSC1(t,this.initPTS[e.cc],()=>{i.textCodec=IMSC1_CODEC,this._parseIMSC1(e,t)},()=>{i.textCodec="wvtt"})}_appendCues(e,t){const i=this.hls;if(this.config.renderTextTracksNatively){const s=this.textTracks[t];if(!s||s.mode==="disabled")return;e.forEach(n=>addCueToTrack(s,n))}else{const s=this.tracks[t];if(!s)return;const n=s.default?"default":"subtitles"+t;i.trigger(Events.CUES_PARSED,{type:"subtitles",cues:e,track:n})}}onFragDecrypted(e,t){const{frag:i}=t;i.type===PlaylistLevelType.SUBTITLE&&this.onFragLoaded(Events.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){if(!this.enabled||!this.config.enableCEA708Captions)return;const{frag:i,samples:s}=t;if(!(i.type===PlaylistLevelType.MAIN&&this.closedCaptionsForLevel(i)==="NONE"))for(let n=0;n<s.length;n++){const a=s[n].bytes;if(a){this.cea608Parser1||this.initCea608Parsers();const o=this.extractCea608Data(a);this.cea608Parser1.addData(s[n].pts,o[0]),this.cea608Parser2.addData(s[n].pts,o[1])}}}onBufferFlushing(e,{startOffset:t,endOffset:i,endOffsetSubtitles:s,type:n}){const{media:a}=this;if(!(!a||a.currentTime<i)){if(!n||n==="video"){const{captionsTracks:o}=this;Object.keys(o).forEach(c=>removeCuesInRange(o[c],t,i))}if(this.config.renderTextTracksNatively&&t===0&&s!==void 0){const{textTracks:o}=this;Object.keys(o).forEach(c=>removeCuesInRange(o[c],t,s))}}}extractCea608Data(e){const t=[[],[]],i=e[0]&31;let s=2;for(let n=0;n<i;n++){const a=e[s++],o=127&e[s++],c=127&e[s++];if(o===0&&c===0)continue;if((4&a)!==0){const f=3&a;(f===0||f===1)&&(t[f].push(o),t[f].push(c))}}return t}}function captionsOrSubtitlesFromCharacteristics(r){return r.characteristics&&/transcribes-spoken-dialog/gi.test(r.characteristics)&&/describes-music-and-sound/gi.test(r.characteristics)?"captions":"subtitles"}function canReuseVttTextTrack(r,e){return!!r&&r.kind===captionsOrSubtitlesFromCharacteristics(e)&&subtitleTrackMatchesTextTrack(e,r)}function intersection(r,e,t,i){return Math.min(e,i)-Math.max(r,t)}function newVTTCCs(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}const WHITESPACE_CHAR=/\s/,Cues={newCue(r,e,t,i){const s=[];let n,a,o,c,u;const f=self.VTTCue||self.TextTrackCue;for(let g=0;g<i.rows.length;g++)if(n=i.rows[g],o=!0,c=0,u="",!n.isEmpty()){var d;for(let T=0;T<n.chars.length;T++)WHITESPACE_CHAR.test(n.chars[T].uchar)&&o?c++:(u+=n.chars[T].uchar,o=!1);n.cueStartTime=e,e===t&&(t+=1e-4),c>=16?c--:c++;const E=fixLineBreaks(u.trim()),m=generateCueId(e,t,E);r!=null&&(d=r.cues)!=null&&d.getCueById(m)||(a=new f(e,t,E),a.id=m,a.line=g+1,a.align="left",a.position=10+Math.min(80,Math.floor(c*8/32)*10),s.push(a))}return r&&s.length&&(s.sort((g,E)=>g.line==="auto"||E.line==="auto"?0:g.line>8&&E.line>8?E.line-g.line:g.line-E.line),s.forEach(g=>addCueToTrack(r,g))),s}};function fetchSupported(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch{}return!1}const BYTERANGE=/(\d+)-(\d+)\/(\d+)/;class FetchLoader{constructor(e){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=null,this.response=null,this.controller=void 0,this.context=null,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=e.fetchSetup||getRequest,this.controller=new self.AbortController,this.stats=new LoadStats}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}abortInternal(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,t,i){const s=this.stats;if(s.loading.start)throw new Error("Loader can only be used once.");s.loading.start=self.performance.now();const n=getRequestParameters(e,this.controller.signal),a=e.responseType==="arraybuffer",o=a?"byteLength":"length",{maxTimeToFirstByteMs:c,maxLoadTimeMs:u}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=i,this.request=this.fetchSetup(e,n),self.clearTimeout(this.requestTimeout),t.timeout=c&&isFiniteNumber(c)?c:u,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(s,e,this.response))},t.timeout),(isPromise(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then(d=>{var g;this.response=this.loader=d;const E=Math.max(self.performance.now(),s.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=u,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(s,e,this.response))},u-(E-s.loading.start)),!d.ok){const{status:T,statusText:S}=d;throw new FetchError(S||"fetch, bad network response",T,d)}s.loading.first=E,s.total=getContentLength(d.headers)||s.total;const m=(g=this.callbacks)==null?void 0:g.onProgress;return m&&isFiniteNumber(t.highWaterMark)?this.loadProgressively(d,s,e,t.highWaterMark,m):a?d.arrayBuffer():e.responseType==="json"?d.json():d.text()}).then(d=>{var g,E;const m=this.response;if(!m)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),s.loading.end=Math.max(self.performance.now(),s.loading.first);const T=d[o];T&&(s.loaded=s.total=T);const S={url:m.url,data:d,code:m.status},b=(g=this.callbacks)==null?void 0:g.onProgress;b&&!isFiniteNumber(t.highWaterMark)&&b(s,e,d,m),(E=this.callbacks)==null||E.onSuccess(S,s,e,m)}).catch(d=>{var g;if(self.clearTimeout(this.requestTimeout),s.aborted)return;const E=d&&d.code||0,m=d?d.message:null;(g=this.callbacks)==null||g.onError({code:E,text:m},e,d?d.details:null,s)})}getCacheAge(){let e=null;if(this.response){const t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,i,s=0,n){const a=new ChunkCache,o=e.body.getReader(),c=()=>o.read().then(u=>{if(u.done)return a.dataLength&&n(t,i,a.flush().buffer,e),Promise.resolve(new ArrayBuffer(0));const f=u.value,d=f.length;return t.loaded+=d,d<s||a.dataLength?(a.push(f),a.dataLength>=s&&n(t,i,a.flush().buffer,e)):n(t,i,f.buffer,e),c()}).catch(()=>Promise.reject());return c()}}function getRequestParameters(r,e){const t={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(_extends({},r.headers))};return r.rangeEnd&&t.headers.set("Range","bytes="+r.rangeStart+"-"+String(r.rangeEnd-1)),t}function getByteRangeLength(r){const e=BYTERANGE.exec(r);if(e)return parseInt(e[2])-parseInt(e[1])+1}function getContentLength(r){const e=r.get("Content-Range");if(e){const i=getByteRangeLength(e);if(isFiniteNumber(i))return i}const t=r.get("Content-Length");if(t)return parseInt(t)}function getRequest(r,e){return new self.Request(r.url,e)}class FetchError extends Error{constructor(e,t,i){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=i}}const AGE_HEADER_LINE_REGEX=/^age:\s*[\d.]+\s*$/im;class XhrLoader{constructor(e){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=null,this.loader=null,this.stats=void 0,this.xhrSetup=e&&e.xhrSetup||null,this.stats=new LoadStats,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null}abortInternal(){const e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,e.readyState!==4&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,t,i){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=i,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e||!t)return;const i=this.loader=new self.XMLHttpRequest,s=this.stats;s.loading.first=0,s.loaded=0,s.aborted=!1;const n=this.xhrSetup;n?Promise.resolve().then(()=>{if(!(this.loader!==i||this.stats.aborted))return n(i,t.url)}).catch(a=>{if(!(this.loader!==i||this.stats.aborted))return i.open("GET",t.url,!0),n(i,t.url)}).then(()=>{this.loader!==i||this.stats.aborted||this.openAndSendXhr(i,t,e)}).catch(a=>{var o;(o=this.callbacks)==null||o.onError({code:i.status,text:a.message},t,i,s)}):this.openAndSendXhr(i,t,e)}openAndSendXhr(e,t,i){e.readyState||e.open("GET",t.url,!0);const s=t.headers,{maxTimeToFirstByteMs:n,maxLoadTimeMs:a}=i.loadPolicy;if(s)for(const o in s)e.setRequestHeader(o,s[o]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),i.timeout=n&&isFiniteNumber(n)?n:a,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),i.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:i}=this;if(!e||!t)return;const s=t.readyState,n=this.config;if(!i.aborted&&s>=2&&(i.loading.first===0&&(i.loading.first=Math.max(self.performance.now(),i.loading.start),n.timeout!==n.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),n.timeout=n.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.loadPolicy.maxLoadTimeMs-(i.loading.first-i.loading.start)))),s===4)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const u=t.status,f=t.responseType==="text"?t.responseText:null;if(u>=200&&u<300){const m=f??t.response;if(m!=null){var a,o;i.loading.end=Math.max(self.performance.now(),i.loading.first);const T=t.responseType==="arraybuffer"?m.byteLength:m.length;i.loaded=i.total=T,i.bwEstimate=i.total*8e3/(i.loading.end-i.loading.first);const S=(a=this.callbacks)==null?void 0:a.onProgress;S&&S(i,e,m,t);const b={url:t.responseURL,data:m,code:u};(o=this.callbacks)==null||o.onSuccess(b,i,e,t);return}}const d=n.loadPolicy.errorRetry,g=i.retry,E={url:e.url,data:void 0,code:u};if(shouldRetry(d,g,!1,E))this.retry(d);else{var c;logger.error(`${u} while loading ${e.url}`),(c=this.callbacks)==null||c.onError({code:u,text:t.statusText},e,t,i)}}}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry,t=this.stats.retry;if(shouldRetry(e,t,!0))this.retry(e);else{var i;logger.warn(`timeout while loading ${(i=this.context)==null?void 0:i.url}`);const s=this.callbacks;s&&(this.abortInternal(),s.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:i}=this;this.retryDelay=getRetryDelay(e,i.retry),i.retry++,logger.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${t?.url}, retrying ${i.retry}/${e.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(e){const t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)}getCacheAge(){let e=null;if(this.loader&&AGE_HEADER_LINE_REGEX.test(this.loader.getAllResponseHeaders())){const t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.loader&&new RegExp(`^${e}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}}const defaultLoadPolicy={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},hlsDefaultConfig=_objectSpread2(_objectSpread2({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,maxDevicePixelRatio:Number.POSITIVE_INFINITY,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,startOnSegmentBoundary:!1,maxBufferSize:60*1e3*1e3,maxFragLookUpTolerance:.25,maxBufferHole:.1,detectStallWithCurrentTimeMs:1250,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,nudgeOnVideoHole:!0,liveSyncMode:"edge",liveSyncDurationCount:3,liveSyncOnStallIncrease:1,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,ignorePlaylistParsingErrors:!1,loader:XhrLoader,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:AbrController,bufferController:BufferController,capLevelController:CapLevelController,errorController:ErrorController,fpsController:FPSController,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrEwmaDefaultEstimateMax:5e6,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:requestMediaKeySystemAccess,requireKeySystemAccessOnStart:!1,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableEmsgKLVMetadata:!1,enableID3MetadataCues:!0,enableInterstitialPlayback:!0,interstitialAppendInPlace:!0,interstitialLiveLookAhead:10,useMediaCapabilities:!0,preserveManualLevelOnError:!1,certLoadPolicy:{default:defaultLoadPolicy},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},interstitialAssetListLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:3e4,timeoutRetry:{maxNumRetry:0,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:0,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},timelineConfig()),{},{subtitleStreamController:SubtitleStreamController,subtitleTrackController:SubtitleTrackController,timelineController:TimelineController,audioStreamController:AudioStreamController,audioTrackController:AudioTrackController,emeController:EMEController,cmcdController:CMCDController,contentSteeringController:ContentSteeringController,interstitialsController:InterstitialsController});function timelineConfig(){return{cueHandler:Cues,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function mergeConfig(r,e,t){if((e.liveSyncDurationCount||e.liveMaxLatencyDurationCount)&&(e.liveSyncDuration||e.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(e.liveMaxLatencyDurationCount!==void 0&&(e.liveSyncDurationCount===void 0||e.liveMaxLatencyDurationCount<=e.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(e.liveMaxLatencyDuration!==void 0&&(e.liveSyncDuration===void 0||e.liveMaxLatencyDuration<=e.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const i=deepCpy(r),s=["manifest","level","frag"],n=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return s.forEach(a=>{const o=`${a==="level"?"playlist":a}LoadPolicy`,c=e[o]===void 0,u=[];n.forEach(f=>{const d=`${a}Loading${f}`,g=e[d];if(g!==void 0&&c){u.push(d);const E=i[o].default;switch(e[o]={default:E},f){case"TimeOut":E.maxLoadTimeMs=g,E.maxTimeToFirstByteMs=g;break;case"MaxRetry":E.errorRetry.maxNumRetry=g,E.timeoutRetry.maxNumRetry=g;break;case"RetryDelay":E.errorRetry.retryDelayMs=g,E.timeoutRetry.retryDelayMs=g;break;case"MaxRetryTimeout":E.errorRetry.maxRetryDelayMs=g,E.timeoutRetry.maxRetryDelayMs=g;break}}}),u.length&&t.warn(`hls.js config: "${u.join('", "')}" setting(s) are deprecated, use "${o}": ${stringify(e[o])}`)}),_objectSpread2(_objectSpread2({},i),e)}function deepCpy(r){return r&&typeof r=="object"?Array.isArray(r)?r.map(deepCpy):Object.keys(r).reduce((e,t)=>(e[t]=deepCpy(r[t]),e),{}):r}function enableStreamingMode(r,e){const t=r.loader;t!==FetchLoader&&t!==XhrLoader?(e.log("[config]: Custom loader detected, cannot enable progressive streaming"),r.progressive=!1):fetchSupported()&&(r.loader=FetchLoader,r.progressive=!0,r.enableSoftwareAES=!0,e.log("[config]: Progressive streaming enabled, using FetchLoader"))}const MAX_START_GAP_JUMP=2,SKIP_BUFFER_HOLE_STEP_SECONDS=.1,SKIP_BUFFER_RANGE_START=.05,TICK_INTERVAL$1=100;class GapController extends TaskLoop{constructor(e,t){super("gap-controller",e.logger),this.hls=void 0,this.fragmentTracker=void 0,this.media=null,this.mediaSource=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.buffered={},this.lastCurrentTime=0,this.ended=0,this.waiting=0,this.onMediaPlaying=()=>{this.ended=0,this.waiting=0},this.onMediaWaiting=()=>{var i;(i=this.media)!=null&&i.seeking||(this.waiting=self.performance.now(),this.tick())},this.onMediaEnded=()=>{if(this.hls){var i;this.ended=((i=this.media)==null?void 0:i.currentTime)||1,this.hls.trigger(Events.MEDIA_ENDED,{stalled:!1})}},this.hls=e,this.fragmentTracker=t,this.registerListeners()}registerListeners(){const{hls:e}=this;e&&(e.on(Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(Events.BUFFER_APPENDED,this.onBufferAppended,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(Events.BUFFER_APPENDED,this.onBufferAppended,this))}destroy(){super.destroy(),this.unregisterListeners(),this.media=this.hls=this.fragmentTracker=null,this.mediaSource=void 0}onMediaAttached(e,t){this.setInterval(TICK_INTERVAL$1),this.mediaSource=t.mediaSource;const i=this.media=t.media;addEventListener(i,"playing",this.onMediaPlaying),addEventListener(i,"waiting",this.onMediaWaiting),addEventListener(i,"ended",this.onMediaEnded)}onMediaDetaching(e,t){this.clearInterval();const{media:i}=this;i&&(removeEventListener(i,"playing",this.onMediaPlaying),removeEventListener(i,"waiting",this.onMediaWaiting),removeEventListener(i,"ended",this.onMediaEnded),this.media=null),this.mediaSource=void 0}onBufferAppended(e,t){this.buffered=t.timeRanges}get hasBuffered(){return Object.keys(this.buffered).length>0}tick(){var e;if(!((e=this.media)!=null&&e.readyState)||!this.hasBuffered)return;const t=this.media.currentTime;this.poll(t,this.lastCurrentTime),this.lastCurrentTime=t}poll(e,t){var i,s;const n=(i=this.hls)==null?void 0:i.config;if(!n)return;const a=this.media;if(!a)return;const{seeking:o}=a,c=this.seeking&&!o,u=!this.seeking&&o,f=a.paused&&!o||a.ended||a.playbackRate===0;if(this.seeking=o,e!==t){t&&(this.ended=0),this.moved=!0,o||(this.nudgeRetry=0,n.nudgeOnVideoHole&&!f&&e>t&&this.nudgeOnVideoHole(e,t)),this.waiting===0&&this.stallResolved(e);return}if(u||c){c&&this.stallResolved(e);return}if(f){this.nudgeRetry=0,this.stallResolved(e),!this.ended&&a.ended&&this.hls&&(this.ended=e||1,this.hls.trigger(Events.MEDIA_ENDED,{stalled:!1}));return}if(!BufferHelper.getBuffered(a).length){this.nudgeRetry=0;return}const d=BufferHelper.bufferInfo(a,e,0),g=d.nextStart||0,E=this.fragmentTracker;if(o&&E&&this.hls){const U=getInFlightDependency(this.hls.inFlightFragments,e),O=d.len>MAX_START_GAP_JUMP,F=!g||U||g-e>MAX_START_GAP_JUMP&&!E.getPartialFragment(e);if(O||F)return;this.moved=!1}const m=(s=this.hls)==null?void 0:s.latestLevelDetails;if(!this.moved&&this.stalled!==null&&E){if(!(d.len>0)&&!g)return;const O=Math.max(g,d.start||0)-e,G=!!(m!=null&&m.live)?m.targetduration*2:MAX_START_GAP_JUMP,x=appendedFragAtPosition(e,E);if(O>0&&(O<=G||x)){a.paused||this._trySkipBufferHole(x);return}}const T=n.detectStallWithCurrentTimeMs,S=self.performance.now(),b=this.waiting;let C=this.stalled;if(C===null)if(b>0&&S-b<T)C=this.stalled=b;else{this.stalled=S;return}const I=S-C;if(!o&&(I>=T||b)&&this.hls){var L;if(((L=this.mediaSource)==null?void 0:L.readyState)==="ended"&&!(m!=null&&m.live)&&Math.abs(e-(m?.edge||0))<1){if(this.ended)return;this.ended=e||1,this.hls.trigger(Events.MEDIA_ENDED,{stalled:!0});return}if(this._reportStall(d),!this.media||!this.hls)return}const k=BufferHelper.bufferInfo(a,e,n.maxBufferHole);this._tryFixBufferStall(k,I,e)}stallResolved(e){const t=this.stalled;if(t&&this.hls&&(this.stalled=null,this.stallReported)){const i=self.performance.now()-t;this.log(`playback not stuck anymore @${e}, after ${Math.round(i)}ms`),this.stallReported=!1,this.waiting=0,this.hls.trigger(Events.STALL_RESOLVED,{})}}nudgeOnVideoHole(e,t){var i;const s=this.buffered.video;if(this.hls&&this.media&&this.fragmentTracker&&(i=this.buffered.audio)!=null&&i.length&&s&&s.length>1&&e>s.end(0)){const n=BufferHelper.bufferedInfo(BufferHelper.timeRangesToArray(this.buffered.audio),e,0);if(n.len>1&&t>=n.start){const a=BufferHelper.timeRangesToArray(s),o=BufferHelper.bufferedInfo(a,t,0).bufferedIndex;if(o>-1&&o<a.length-1){const c=BufferHelper.bufferedInfo(a,e,0).bufferedIndex,u=a[o].end,f=a[o+1].start;if((c===-1||c>o)&&f-u<1&&e-u<2){const d=new Error(`nudging playhead to flush pipeline after video hole. currentTime: ${e} hole: ${u} -> ${f} buffered index: ${c}`);this.warn(d.message),this.media.currentTime+=1e-6;let g=appendedFragAtPosition(e,this.fragmentTracker);g&&"fragment"in g?g=g.fragment:g||(g=void 0);const E=BufferHelper.bufferInfo(this.media,e,0);this.hls.trigger(Events.ERROR,{type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:d,reason:d.message,frag:g,buffer:E.len,bufferInfo:E})}}}}}_tryFixBufferStall(e,t,i){var s,n;const{fragmentTracker:a,media:o}=this,c=(s=this.hls)==null?void 0:s.config;if(!o||!a||!c)return;const u=(n=this.hls)==null?void 0:n.latestLevelDetails,f=appendedFragAtPosition(i,a);if((f||u!=null&&u.live&&i<u.fragmentStart)&&(this._trySkipBufferHole(f)||!this.media))return;const d=e.buffered,g=this.adjacentTraversal(e,i);(d&&d.length>1&&e.len>c.maxBufferHole||e.nextStart&&(e.nextStart-i<c.maxBufferHole||g))&&(t>c.highBufferWatchdogPeriod*1e3||this.waiting)&&(this.warn("Trying to nudge playhead over buffer-hole"),this._tryNudgeBuffer(e))}adjacentTraversal(e,t){const i=this.fragmentTracker,s=e.nextStart;if(i&&s){const n=i.getFragAtPos(t,PlaylistLevelType.MAIN),a=i.getFragAtPos(s,PlaylistLevelType.MAIN);if(n&&a)return a.sn-n.sn<2}return!1}_reportStall(e){const{hls:t,media:i,stallReported:s,stalled:n}=this;if(!s&&n!==null&&i&&t){this.stallReported=!0;const a=new Error(`Playback stalling at @${i.currentTime} due to low buffer (${stringify(e)})`);this.warn(a.message),t.trigger(Events.ERROR,{type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,error:a,buffer:e.len,bufferInfo:e,stalled:{start:n}})}}_trySkipBufferHole(e){var t;const{fragmentTracker:i,media:s}=this,n=(t=this.hls)==null?void 0:t.config;if(!s||!i||!n)return 0;const a=s.currentTime,o=BufferHelper.bufferInfo(s,a,0),c=a<o.start?o.start:o.nextStart;if(c&&this.hls){const f=o.len<=n.maxBufferHole,d=o.len>0&&o.len<1&&s.readyState<3,g=c-a;if(g>0&&(f||d)){if(g>n.maxBufferHole){let m=!1;if(a===0){const T=i.getAppendedFrag(0,PlaylistLevelType.MAIN);T&&c<T.end&&(m=!0)}if(!m&&e){var u;if(!((u=this.hls.loadLevelObj)!=null&&u.details)||getInFlightDependency(this.hls.inFlightFragments,c))return 0;let S=!1,b=e.end;for(;b<c;){const C=appendedFragAtPosition(b,i);if(C)b+=C.duration;else{S=!0;break}}if(S)return 0}}const E=Math.max(c+SKIP_BUFFER_RANGE_START,a+SKIP_BUFFER_HOLE_STEP_SECONDS);if(this.warn(`skipping hole, adjusting currentTime from ${a} to ${E}`),this.moved=!0,s.currentTime=E,!(e!=null&&e.gap)){const m=new Error(`fragment loaded with buffer holes, seeking from ${a} to ${E}`),T={type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:m,reason:m.message,buffer:o.len,bufferInfo:o};e&&("fragment"in e?T.part=e:T.frag=e),this.hls.trigger(Events.ERROR,T)}return E}}return 0}_tryNudgeBuffer(e){const{hls:t,media:i,nudgeRetry:s}=this,n=t?.config;if(!i||!n)return 0;const a=i.currentTime;if(this.nudgeRetry++,s<n.nudgeMaxRetry){const o=a+(s+1)*n.nudgeOffset,c=new Error(`Nudging 'currentTime' from ${a} to ${o}`);this.warn(c.message),i.currentTime=o,t.trigger(Events.ERROR,{type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.BUFFER_NUDGE_ON_STALL,error:c,fatal:!1,buffer:e.len,bufferInfo:e})}else{const o=new Error(`Playhead still not moving while enough data buffered @${a} after ${n.nudgeMaxRetry} nudges`);this.error(o.message),t.trigger(Events.ERROR,{type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.BUFFER_STALLED_ERROR,error:o,fatal:!0,buffer:e.len,bufferInfo:e})}}}function getInFlightDependency(r,e){const t=inFlight(r.main);if(t&&t.start<=e)return t;const i=inFlight(r.audio);return i&&i.start<=e?i:null}function inFlight(r){if(!r)return null;switch(r.state){case State.IDLE:case State.STOPPED:case State.ENDED:case State.ERROR:return null}return r.frag}function appendedFragAtPosition(r,e){return e.getAppendedFrag(r,PlaylistLevelType.MAIN)||e.getPartialFragment(r)}const MIN_CUE_DURATION=.25;function getCueClass(){if(!(typeof self>"u"))return self.VTTCue||self.TextTrackCue}function createCueWithDataFields(r,e,t,i,s){let n=new r(e,t,"");try{n.value=i,s&&(n.type=s)}catch{n=new r(e,t,stringify(s?_objectSpread2({type:s},i):i))}return n}const MAX_CUE_ENDTIME=(()=>{const r=getCueClass();try{r&&new r(0,Number.POSITIVE_INFINITY,"")}catch{return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();class ID3TrackController{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.removeCues=!0,this.assetCue=void 0,this.onEventCueEnter=()=>{this.hls&&this.hls.trigger(Events.EVENT_CUE_ENTER,{})},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=this.onEventCueEnter=null}_registerListeners(){const{hls:e}=this;e&&(e.on(Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(Events.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(Events.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(Events.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}_unregisterListeners(){const{hls:e}=this;e&&(e.off(Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(Events.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(Events.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(Events.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}onMediaAttaching(e,t){var i;this.media=t.media,((i=t.overrides)==null?void 0:i.cueRemoval)===!1&&(this.removeCues=!1)}onMediaAttached(){var e;const t=(e=this.hls)==null?void 0:e.latestLevelDetails;t&&this.updateDateRangeCues(t)}onMediaDetaching(e,t){this.media=null,!t.transferMedia&&(this.id3Track&&(this.removeCues&&clearCurrentCues(this.id3Track,this.onEventCueEnter),this.id3Track=null),this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){const t=this.getID3Track(e.textTracks);return t.mode="hidden",t}getID3Track(e){if(this.media){for(let t=0;t<e.length;t++){const i=e[t];if(i.kind==="metadata"&&i.label==="id3")return sendAddTrackEvent(i,this.media),i}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(e,t){if(!this.media||!this.hls)return;const{enableEmsgMetadataCues:i,enableID3MetadataCues:s}=this.hls.config;if(!i&&!s)return;const{samples:n}=t;this.id3Track||(this.id3Track=this.createTrack(this.media));const a=getCueClass();if(a)for(let o=0;o<n.length;o++){const c=n[o].type;if(c===MetadataSchema.emsg&&!i||!s)continue;const u=getId3Frames(n[o].data),f=n[o].pts;let d=f+n[o].duration;d>MAX_CUE_ENDTIME&&(d=MAX_CUE_ENDTIME),d-f<=0&&(d=f+MIN_CUE_DURATION);for(let E=0;E<u.length;E++){const m=u[E];if(!isId3TimestampFrame(m)){this.updateId3CueEnds(f,c);const T=createCueWithDataFields(a,f,d,m,c);T&&this.id3Track.addCue(T)}}}}updateId3CueEnds(e,t){var i;const s=(i=this.id3Track)==null?void 0:i.cues;if(s)for(let n=s.length;n--;){const a=s[n];a.type===t&&a.startTime<e&&a.endTime===MAX_CUE_ENDTIME&&(a.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:i,type:s}){const{id3Track:n,hls:a}=this;if(!a)return;const{config:{enableEmsgMetadataCues:o,enableID3MetadataCues:c}}=a;if(n&&(o||c)){let u;s==="audio"?u=f=>f.type===MetadataSchema.audioId3&&c:s==="video"?u=f=>f.type===MetadataSchema.emsg&&o:u=f=>f.type===MetadataSchema.audioId3&&c||f.type===MetadataSchema.emsg&&o,removeCuesInRange(n,t,i,u)}}onLevelUpdated(e,{details:t}){this.updateDateRangeCues(t,!0)}onLevelPtsUpdated(e,t){Math.abs(t.drift)>.01&&this.updateDateRangeCues(t.details)}updateDateRangeCues(e,t){if(!this.hls||!this.media)return;const{assetPlayerId:i,timelineOffset:s,enableDateRangeMetadataCues:n,interstitialsController:a}=this.hls.config;if(!n)return;const o=getCueClass();if(i&&s&&!a){const{fragmentStart:T,fragmentEnd:S}=e;let b=this.assetCue;b?(b.startTime=T,b.endTime=S):o&&(b=this.assetCue=createCueWithDataFields(o,T,S,{assetPlayerId:this.hls.config.assetPlayerId},"hlsjs.interstitial.asset"),b&&(b.id=i,this.id3Track||(this.id3Track=this.createTrack(this.media)),this.id3Track.addCue(b),b.addEventListener("enter",this.onEventCueEnter)))}if(!e.hasProgramDateTime)return;const{id3Track:c}=this,{dateRanges:u}=e,f=Object.keys(u);let d=this.dateRangeCuesAppended;if(c&&t){var g;if((g=c.cues)!=null&&g.length){const T=Object.keys(d).filter(S=>!f.includes(S));for(let S=T.length;S--;){var E;const b=T[S],C=(E=d[b])==null?void 0:E.cues;delete d[b],C&&Object.keys(C).forEach(I=>{const L=C[I];if(L){L.removeEventListener("enter",this.onEventCueEnter);try{c.removeCue(L)}catch{}}})}}else d=this.dateRangeCuesAppended={}}const m=e.fragments[e.fragments.length-1];if(!(f.length===0||!isFiniteNumber(m?.programDateTime))){this.id3Track||(this.id3Track=this.createTrack(this.media));for(let T=0;T<f.length;T++){const S=f[T],b=u[S],C=b.startTime,I=d[S],L=I?.cues||{};let k=I?.durationKnown||!1,U=MAX_CUE_ENDTIME;const{duration:O,endDate:F}=b;if(F&&O!==null)U=C+O,k=!0;else if(b.endOnNext&&!k){const x=f.reduce(($,X)=>{if(X!==b.id){const Q=u[X];if(Q.class===b.class&&Q.startDate>b.startDate&&(!$||b.startDate<$.startDate))return Q}return $},null);x&&(U=x.startTime,k=!0)}const G=Object.keys(b.attr);for(let x=0;x<G.length;x++){const $=G[x];if(!isDateRangeCueAttribute($))continue;const X=L[$];if(X)k&&!(I!=null&&I.durationKnown)?X.endTime=U:Math.abs(X.startTime-C)>.01&&(X.startTime=C,X.endTime=U);else if(o){let Q=b.attr[$];isSCTE35Attribute($)&&(Q=hexToArrayBuffer(Q));const te=createCueWithDataFields(o,C,U,{key:$,data:Q},MetadataSchema.dateRange);te&&(te.id=S,this.id3Track.addCue(te),L[$]=te,a&&($==="X-ASSET-LIST"||$==="X-ASSET-URL")&&te.addEventListener("enter",this.onEventCueEnter))}}d[S]={cues:L,dateRange:b,durationKnown:k}}}}}class LatencyController{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.currentTime=0,this.stallCount=0,this._latency=null,this._targetLatencyUpdated=!1,this.onTimeupdate=()=>{const{media:t}=this,i=this.levelDetails;if(!t||!i)return;this.currentTime=t.currentTime;const s=this.computeLatency();if(s===null)return;this._latency=s;const{lowLatencyMode:n,maxLiveSyncPlaybackRate:a}=this.config;if(!n||a===1||!i.live)return;const o=this.targetLatency;if(o===null)return;const c=s-o,u=Math.min(this.maxLatency,o+i.targetduration);if(c<u&&c>.05&&this.forwardBufferLength>1){const d=Math.min(2,Math.max(1,a)),g=Math.round(2/(1+Math.exp(-.75*c-this.edgeStalled))*20)/20,E=Math.min(d,Math.max(1,g));this.changeMediaPlaybackRate(t,E)}else t.playbackRate!==1&&t.playbackRate!==0&&this.changeMediaPlaybackRate(t,1)},this.hls=e,this.config=e.config,this.registerListeners()}get levelDetails(){var e;return((e=this.hls)==null?void 0:e.latestLevelDetails)||null}get latency(){return this._latency||0}get maxLatency(){const{config:e}=this;if(e.liveMaxLatencyDuration!==void 0)return e.liveMaxLatencyDuration;const t=this.levelDetails;return t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){const e=this.levelDetails;if(e===null||this.hls===null)return null;const{holdBack:t,partHoldBack:i,targetduration:s}=e,{liveSyncDuration:n,liveSyncDurationCount:a,lowLatencyMode:o}=this.config,c=this.hls.userConfig;let u=o&&i||t;(this._targetLatencyUpdated||c.liveSyncDuration||c.liveSyncDurationCount||u===0)&&(u=n!==void 0?n:a*s);const f=s;return u+Math.min(this.stallCount*this.config.liveSyncOnStallIncrease,f)}set targetLatency(e){this.stallCount=0,this.config.liveSyncDuration=e,this._targetLatencyUpdated=!0}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency;if(e===null||t===null)return null;const i=this.levelDetails;if(i===null)return null;const s=i.edge,n=e-t-this.edgeStalled,a=s-i.totalduration,o=s-(this.config.lowLatencyMode&&i.partTarget||i.targetduration);return Math.min(Math.max(a,n),o)}get drift(){const e=this.levelDetails;return e===null?1:e.drift}get edgeStalled(){const e=this.levelDetails;if(e===null)return 0;const t=(this.config.lowLatencyMode&&e.partTarget||e.targetduration)*3;return Math.max(e.age-t,0)}get forwardBufferLength(){const{media:e}=this,t=this.levelDetails;if(!e||!t)return 0;const i=e.buffered.length;return(i?e.buffered.end(i-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.hls=null}registerListeners(){const{hls:e}=this;e&&(e.on(Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Events.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(Events.ERROR,this.onError,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Events.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(Events.ERROR,this.onError,this))}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.onTimeupdate)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.onTimeupdate),this.media=null)}onManifestLoading(){this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:t}){t.advanced&&this.onTimeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.onTimeupdate)}onError(e,t){var i;t.details===ErrorDetails.BUFFER_STALLED_ERROR&&(this.stallCount++,this.hls&&(i=this.levelDetails)!=null&&i.live&&this.hls.logger.warn("[latency-controller]: Stall detected, adjusting target latency"))}changeMediaPlaybackRate(e,t){var i,s;e.playbackRate!==t&&((i=this.hls)==null||i.logger.debug(`[latency-controller]: latency=${this.latency.toFixed(3)}, targetLatency=${(s=this.targetLatency)==null?void 0:s.toFixed(3)}, forwardBufferLength=${this.forwardBufferLength.toFixed(3)}: adjusting playback rate from ${e.playbackRate} to ${t}`),e.playbackRate=t)}estimateLiveEdge(){const e=this.levelDetails;return e===null?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return e===null?null:e-this.currentTime}}class LevelController extends BasePlaylistController{constructor(e,t){super(e,"level-controller"),this._levels=[],this._firstLevel=-1,this._maxAutoLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=t,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Events.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(Events.LEVEL_LOADED,this.onLevelLoaded,this),e.on(Events.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(Events.FRAG_BUFFERED,this.onFragBuffered,this),e.on(Events.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Events.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(Events.LEVEL_LOADED,this.onLevelLoaded,this),e.off(Events.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(Events.FRAG_BUFFERED,this.onFragBuffered,this),e.off(Events.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach(t=>{t.loadError=0,t.fragmentError=0}),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(e,t){this.resetLevels()}onManifestLoaded(e,t){const i=this.hls.config.preferManagedMediaSource,s=[],n={},a={};let o=!1,c=!1,u=!1;t.levels.forEach(f=>{const d=f.attrs;let{audioCodec:g,videoCodec:E}=f;g&&(f.audioCodec=g=getCodecCompatibleName(g,i)||void 0),E&&(E=f.videoCodec=convertAVC1ToAVCOTI(E));const{width:m,height:T,unknownCodecs:S}=f,b=S?.length||0;if(o||(o=!!(m&&T)),c||(c=!!E),u||(u=!!g),b||g&&!this.isAudioSupported(g)||E&&!this.isVideoSupported(E)){this.log(`Some or all CODECS not supported "${d.CODECS}"`);return}const{CODECS:C,"FRAME-RATE":I,"HDCP-LEVEL":L,"PATHWAY-ID":k,RESOLUTION:U,"VIDEO-RANGE":O}=d,G=`${`${k||"."}-`}${f.bitrate}-${U}-${I}-${C}-${O}-${L}`;if(n[G])if(n[G].uri!==f.url&&!f.attrs["PATHWAY-ID"]){const x=a[G]+=1;f.attrs["PATHWAY-ID"]=new Array(x+1).join(".");const $=this.createLevel(f);n[G]=$,s.push($)}else n[G].addGroupId("audio",d.AUDIO),n[G].addGroupId("text",d.SUBTITLES);else{const x=this.createLevel(f);n[G]=x,a[G]=1,s.push(x)}}),this.filterAndSortMediaOptions(s,t,o,c,u)}createLevel(e){const t=new Level(e),i=e.supplemental;if(i!=null&&i.videoCodec&&!this.isVideoSupported(i.videoCodec)){const s=new Error(`SUPPLEMENTAL-CODECS not supported "${i.videoCodec}"`);this.log(s.message),t.supportedResult=getUnsupportedResult(s,[])}return t}isAudioSupported(e){return areCodecsMediaSourceSupported(e,"audio",this.hls.config.preferManagedMediaSource)}isVideoSupported(e){return areCodecsMediaSourceSupported(e,"video",this.hls.config.preferManagedMediaSource)}filterAndSortMediaOptions(e,t,i,s,n){var a;let o=[],c=[],u=e;const f=((a=t.stats)==null?void 0:a.parsing)||{};if((i||s)&&n&&(u=u.filter(({videoCodec:C,videoRange:I,width:L,height:k})=>(!!C||!!(L&&k))&&isVideoRange(I))),u.length===0){Promise.resolve().then(()=>{if(this.hls){let C="no level with compatible codecs found in manifest",I=C;t.levels.length&&(I=`one or more CODECS in variant not supported: ${stringify(t.levels.map(k=>k.attrs.CODECS).filter((k,U,O)=>O.indexOf(k)===U))}`,this.warn(I),C+=` (${I})`);const L=new Error(C);this.hls.trigger(Events.ERROR,{type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:L,reason:I})}}),f.end=performance.now();return}t.audioTracks&&(o=t.audioTracks.filter(C=>!C.audioCodec||this.isAudioSupported(C.audioCodec)),assignTrackIdsByGroup(o)),t.subtitles&&(c=t.subtitles,assignTrackIdsByGroup(c));const d=u.slice(0);u.sort((C,I)=>{if(C.attrs["HDCP-LEVEL"]!==I.attrs["HDCP-LEVEL"])return(C.attrs["HDCP-LEVEL"]||"")>(I.attrs["HDCP-LEVEL"]||"")?1:-1;if(i&&C.height!==I.height)return C.height-I.height;if(C.frameRate!==I.frameRate)return C.frameRate-I.frameRate;if(C.videoRange!==I.videoRange)return VideoRangeValues.indexOf(C.videoRange)-VideoRangeValues.indexOf(I.videoRange);if(C.videoCodec!==I.videoCodec){const L=videoCodecPreferenceValue(C.videoCodec),k=videoCodecPreferenceValue(I.videoCodec);if(L!==k)return k-L}if(C.uri===I.uri&&C.codecSet!==I.codecSet){const L=codecsSetSelectionPreferenceValue(C.codecSet),k=codecsSetSelectionPreferenceValue(I.codecSet);if(L!==k)return k-L}return C.averageBitrate!==I.averageBitrate?C.averageBitrate-I.averageBitrate:0});let g=d[0];if(this.steering&&(u=this.steering.filterParsedLevels(u),u.length!==d.length)){for(let C=0;C<d.length;C++)if(d[C].pathwayId===u[0].pathwayId){g=d[C];break}}this._levels=u;for(let C=0;C<u.length;C++)if(u[C]===g){var E;this._firstLevel=C;const I=g.bitrate,L=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${u.length} level(s) found, first bitrate: ${I}`),((E=this.hls.userConfig)==null?void 0:E.abrEwmaDefaultEstimate)===void 0){const k=Math.min(I,this.hls.config.abrEwmaDefaultEstimateMax);k>L&&L===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=k)}break}const m=n&&!s,T=this.hls.config,S=!!(T.audioStreamController&&T.audioTrackController),b={levels:u,audioTracks:o,subtitleTracks:c,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:n,video:s,altAudio:S&&!m&&o.some(C=>!!C.url)};f.end=performance.now(),this.hls.trigger(Events.MANIFEST_PARSED,b)}get levels(){return this._levels.length===0?null:this._levels}get loadLevelObj(){return this.currentLevel}get level(){return this.currentLevelIndex}set level(e){const t=this._levels;if(t.length===0)return;if(e<0||e>=t.length){const f=new Error("invalid level idx"),d=e<0;if(this.hls.trigger(Events.ERROR,{type:ErrorTypes.OTHER_ERROR,details:ErrorDetails.LEVEL_SWITCH_ERROR,level:e,fatal:d,error:f,reason:f.message}),d)return;e=Math.min(e,t.length-1)}const i=this.currentLevelIndex,s=this.currentLevel,n=s?s.attrs["PATHWAY-ID"]:void 0,a=t[e],o=a.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=a,i===e&&s&&n===o)return;this.log(`Switching to level ${e} (${a.height?a.height+"p ":""}${a.videoRange?a.videoRange+" ":""}${a.codecSet?a.codecSet+" ":""}@${a.bitrate})${o?" with Pathway "+o:""} from level ${i}${n?" with Pathway "+n:""}`);const c={level:e,attrs:a.attrs,details:a.details,bitrate:a.bitrate,averageBitrate:a.averageBitrate,maxBitrate:a.maxBitrate,realBitrate:a.realBitrate,width:a.width,height:a.height,codecSet:a.codecSet,audioCodec:a.audioCodec,videoCodec:a.videoCodec,audioGroups:a.audioGroups,subtitleGroups:a.subtitleGroups,loaded:a.loaded,loadError:a.loadError,fragmentError:a.fragmentError,name:a.name,id:a.id,uri:a.uri,url:a.url,urlId:0,audioGroupIds:a.audioGroupIds,textGroupIds:a.textGroupIds};this.hls.trigger(Events.LEVEL_SWITCHING,c);const u=a.details;if(!u||u.live){const f=this.switchParams(a.uri,s?.details,u);this.loadPlaylist(f)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,this._startLevel===void 0&&(this._startLevel=e),e!==-1&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(this._startLevel===void 0){const e=this.hls.config.startLevel;return e!==void 0?e:this.hls.firstAutoLevel}return this._startLevel}set startLevel(e){this._startLevel=e}get pathways(){return this.steering?this.steering.pathways():[]}get pathwayPriority(){return this.steering?this.steering.pathwayPriority:null}set pathwayPriority(e){if(this.steering){const t=this.steering.pathways(),i=e.filter(s=>t.indexOf(s)!==-1);if(e.length<1){this.warn(`pathwayPriority ${e} should contain at least one pathway from list: ${t}`);return}this.steering.pathwayPriority=i}}onError(e,t){t.fatal||!t.context||t.context.type===PlaylistContextType.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t!==void 0&&t.type===PlaylistLevelType.MAIN){const i=t.elementaryStreams;if(!Object.keys(i).some(n=>!!i[n]))return;const s=this._levels[t.level];s!=null&&s.loadError&&(this.log(`Resetting level error count of ${s.loadError} on frag buffered`),s.loadError=0)}}onLevelLoaded(e,t){var i;const{level:s,details:n}=t,a=t.levelInfo;if(!a){var o;this.warn(`Invalid level index ${s}`),(o=t.deliveryDirectives)!=null&&o.skip&&(n.deltaUpdateFailed=!0);return}if(a===this.currentLevel||t.withoutMultiVariant){a.fragmentError===0&&(a.loadError=0);let c=a.details;c===t.details&&c.advanced&&(c=void 0),this.playlistLoaded(s,t,c)}else(i=t.deliveryDirectives)!=null&&i.skip&&(n.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentLevel)&&this.scheduleLoading(this.currentLevel,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const i=this.getUrlWithDirectives(e.uri,t),s=this.currentLevelIndex,n=e.attrs["PATHWAY-ID"],a=e.details,o=a?.age;this.log(`Loading level index ${s}${t?.msn!==void 0?" at sn "+t.msn+" part "+t.part:""}${n?" Pathway "+n:""}${o&&a.live?" age "+o.toFixed(1)+(a.type&&" "+a.type||""):""} ${i}`),this.hls.trigger(Events.LEVEL_LOADING,{url:i,level:s,levelInfo:e,pathwayId:e.attrs["PATHWAY-ID"],id:0,deliveryDirectives:t||null})}get nextLoadLevel(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(e){this.level=e,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=e)}removeLevel(e){var t;if(this._levels.length===1)return;const i=this._levels.filter((n,a)=>a!==e?!0:(this.steering&&this.steering.removeLevel(n),n===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,n.details&&n.details.fragments.forEach(o=>o.level=-1)),!1));reassignFragmentLevelIndexes(i),this._levels=i,this.currentLevelIndex>-1&&(t=this.currentLevel)!=null&&t.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.manualLevelIndex>-1&&(this.manualLevelIndex=this.currentLevelIndex);const s=i.length-1;this._firstLevel=Math.min(this._firstLevel,s),this._startLevel&&(this._startLevel=Math.min(this._startLevel,s)),this.hls.trigger(Events.LEVELS_UPDATED,{levels:i})}onLevelsUpdated(e,{levels:t}){this._levels=t}checkMaxAutoUpdated(){const{autoLevelCapping:e,maxAutoLevel:t,maxHdcpLevel:i}=this.hls;this._maxAutoLevel!==t&&(this._maxAutoLevel=t,this.hls.trigger(Events.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:i}))}}function assignTrackIdsByGroup(r){const e={};r.forEach(t=>{const i=t.groupId||"";t.id=e[i]=e[i]||0,e[i]++})}function getSourceBuffer(){return self.SourceBuffer||self.WebKitSourceBuffer}function isMSESupported(){if(!getMediaSource())return!1;const e=getSourceBuffer();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function isSupported(){if(!isMSESupported())return!1;const r=getMediaSource();return typeof r?.isTypeSupported=="function"&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some(e=>r.isTypeSupported(mimeTypeForCodec(e,"video")))||["mp4a.40.2","fLaC"].some(e=>r.isTypeSupported(mimeTypeForCodec(e,"audio"))))}function changeTypeSupported(){var r;const e=getSourceBuffer();return typeof(e==null||(r=e.prototype)==null?void 0:r.changeType)=="function"}const TICK_INTERVAL=100;class StreamController extends BaseStreamController{constructor(e,t,i){super(e,t,i,"stream-controller",PlaylistLevelType.MAIN),this.audioCodecSwap=!1,this.level=-1,this._forceStartLoad=!1,this._hasEnoughToStart=!1,this.altAudio=0,this.audioOnly=!1,this.fragPlaying=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this.onMediaPlaying=()=>{this.tick()},this.onMediaSeeked=()=>{const s=this.media,n=s?s.currentTime:null;if(n===null||!isFiniteNumber(n)||(this.log(`Media seeked to ${n.toFixed(3)}`),!this.getBufferedFrag(n)))return;const a=this.getFwdBufferInfoAtPos(s,n,PlaylistLevelType.MAIN,0);if(a===null||a.len===0){this.warn(`Main forward buffer length at ${n} on "seeked" event ${a?a.len:"empty"})`);return}this.tick()},this.registerListeners()}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(Events.MANIFEST_PARSED,this.onManifestParsed,this),e.on(Events.LEVEL_LOADING,this.onLevelLoading,this),e.on(Events.LEVEL_LOADED,this.onLevelLoaded,this),e.on(Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(Events.BUFFER_CREATED,this.onBufferCreated,this),e.on(Events.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(Events.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(Events.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(Events.MANIFEST_PARSED,this.onManifestParsed,this),e.off(Events.LEVEL_LOADED,this.onLevelLoaded,this),e.off(Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(Events.BUFFER_CREATED,this.onBufferCreated,this),e.off(Events.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(Events.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(Events.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this.onMediaPlaying=this.onMediaSeeked=null,this.unregisterListeners(),super.onHandlerDestroying()}startLoad(e,t){if(this.levels){const{lastCurrentTime:i,hls:s}=this;if(this.stopLoad(),this.setInterval(TICK_INTERVAL),this.level=-1,!this.startFragRequested){let n=s.startLevel;n===-1&&(s.config.testBandwidth&&this.levels.length>1?(n=0,this.bitrateTest=!0):n=s.firstAutoLevel),s.nextLoadLevel=n,this.level=s.loadLevel,this._hasEnoughToStart=!!t}i>0&&e===-1&&!t&&(this.log(`Override startPosition with lastCurrentTime @${i.toFixed(3)}`),e=i),this.state=State.IDLE,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}else this._forceStartLoad=!0,this.state=State.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case State.WAITING_LEVEL:{const{levels:e,level:t}=this,i=e?.[t],s=i?.details;if(s&&(!s.live||this.levelLastLoaded===i&&!this.waitForLive(i))){if(this.waitForCdnTuneIn(s))break;this.state=State.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=State.IDLE;break}break}case State.FRAG_LOADING_WAITING_RETRY:this.checkRetryDate();break}this.state===State.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){var e;super.onTickEnd(),(e=this.media)!=null&&e.readyState&&this.media.seeking===!1&&(this.lastCurrentTime=this.media.currentTime),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:t,levels:i,media:s}=this;if(t===null||!s&&!this.primaryPrefetch&&(this.startFragRequested||!e.config.startFragPrefetch)||this.altAudio&&this.audioOnly)return;const n=this.buffering?e.nextLoadLevel:e.loadLevel;if(!(i!=null&&i[n]))return;const a=i[n],o=this.getMainFwdBufferInfo();if(o===null)return;const c=this.getLevelDetails();if(c&&this._streamEnded(o,c)){const T={};this.altAudio===2&&(T.type="video"),this.hls.trigger(Events.BUFFER_EOS,T),this.state=State.ENDED;return}if(!this.buffering)return;e.loadLevel!==n&&e.manualLevel===-1&&this.log(`Adapting to level ${n} from level ${this.level}`),this.level=e.nextLoadLevel=n;const u=a.details;if(!u||this.state===State.WAITING_LEVEL||this.waitForLive(a)){this.level=n,this.state=State.WAITING_LEVEL,this.startFragRequested=!1;return}const f=o.len,d=this.getMaxBufferLength(a.maxBitrate);if(f>=d)return;this.backtrackFragment&&this.backtrackFragment.start>o.end&&(this.backtrackFragment=null);const g=this.backtrackFragment?this.backtrackFragment.start:o.end;let E=this.getNextFragment(g,u);if(this.couldBacktrack&&!this.fragPrevious&&E&&isMediaFragment(E)&&this.fragmentTracker.getState(E)!==FragmentState.OK){var m;const S=((m=this.backtrackFragment)!=null?m:E).sn-u.startSN,b=u.fragments[S-1];b&&E.cc===b.cc&&(E=b,this.fragmentTracker.removeFragment(b))}else this.backtrackFragment&&o.len&&(this.backtrackFragment=null);if(E&&this.isLoopLoading(E,g)){if(!E.gap){const S=this.audioOnly&&!this.altAudio?ElementaryStreamTypes.AUDIO:ElementaryStreamTypes.VIDEO,b=(S===ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;b&&this.afterBufferFlushed(b,S,PlaylistLevelType.MAIN)}E=this.getNextFragmentLoopLoading(E,u,o,PlaylistLevelType.MAIN,d)}E&&(E.initSegment&&!E.initSegment.data&&!this.bitrateTest&&(E=E.initSegment),this.loadFragment(E,a,g))}loadFragment(e,t,i){const s=this.fragmentTracker.getState(e);s===FragmentState.NOT_LOADED||s===FragmentState.PARTIAL?isMediaFragment(e)?this.bitrateTest?(this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(e,t)):super.loadFragment(e,t,i):this._loadInitSegment(e,t):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,PlaylistLevelType.MAIN)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:e,media:t}=this;if(t!=null&&t.readyState){let i;const s=this.getAppendedFrag(t.currentTime);s&&s.start>1&&this.flushMainBuffer(0,s.start-1);const n=this.getLevelDetails();if(n!=null&&n.live){const o=this.getMainFwdBufferInfo();if(!o||o.len<n.targetduration*2)return}if(!t.paused&&e){const o=this.hls.nextLoadLevel,c=e[o],u=this.fragLastKbps;u&&this.fragCurrent?i=this.fragCurrent.duration*c.maxBitrate/(1e3*u)+1:i=0}else i=0;const a=this.getBufferedFrag(t.currentTime+i);if(a){const o=this.followingBufferedFrag(a);if(o){this.abortCurrentFrag();const c=o.maxStartPTS?o.maxStartPTS:o.start,u=o.duration,f=Math.max(a.end,c+Math.min(Math.max(u-this.config.maxFragLookUpTolerance,u*(this.couldBacktrack?.5:.125)),u*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(f,Number.POSITIVE_INFINITY)}}}}abortCurrentFrag(){const e=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,e&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.state){case State.KEY_LOADING:case State.FRAG_LOADING:case State.FRAG_LOADING_WAITING_RETRY:case State.PARSING:case State.PARSED:this.state=State.IDLE;break}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(e,t){super.flushMainBuffer(e,t,this.altAudio===2?"video":null)}onMediaAttached(e,t){super.onMediaAttached(e,t);const i=t.media;addEventListener(i,"playing",this.onMediaPlaying),addEventListener(i,"seeked",this.onMediaSeeked)}onMediaDetaching(e,t){const{media:i}=this;i&&(removeEventListener(i,"playing",this.onMediaPlaying),removeEventListener(i,"seeked",this.onMediaSeeked)),this.videoBuffer=null,this.fragPlaying=null,super.onMediaDetaching(e,t),!t.transferMedia&&(this._hasEnoughToStart=!1)}onManifestLoading(){super.onManifestLoading(),this.log("Trigger BUFFER_RESET"),this.hls.trigger(Events.BUFFER_RESET,void 0),this.couldBacktrack=!1,this.fragLastKbps=0,this.fragPlaying=this.backtrackFragment=null,this.altAudio=0,this.audioOnly=!1}onManifestParsed(e,t){let i=!1,s=!1;for(let n=0;n<t.levels.length;n++){const a=t.levels[n].audioCodec;a&&(i=i||a.indexOf("mp4a.40.2")!==-1,s=s||a.indexOf("mp4a.40.5")!==-1)}this.audioCodecSwitch=i&&s&&!changeTypeSupported(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1}onLevelLoading(e,t){const{levels:i}=this;if(!i||this.state!==State.IDLE)return;const s=t.levelInfo;(!s.details||s.details.live&&(this.levelLastLoaded!==s||s.details.expired)||this.waitForCdnTuneIn(s.details))&&(this.state=State.WAITING_LEVEL)}onLevelLoaded(e,t){var i;const{levels:s,startFragRequested:n}=this,a=t.level,o=t.details,c=o.totalduration;if(!s){this.warn(`Levels were reset while loading level ${a}`);return}this.log(`Level ${a} loaded [${o.startSN},${o.endSN}]${o.lastPartSn?`[part-${o.lastPartSn}-${o.lastPartIndex}]`:""}, cc [${o.startCC}, ${o.endCC}] duration:${c}`);const u=t.levelInfo,f=this.fragCurrent;f&&(this.state===State.FRAG_LOADING||this.state===State.FRAG_LOADING_WAITING_RETRY)&&f.level!==t.level&&f.loader&&this.abortCurrentFrag();let d=0;if(o.live||(i=u.details)!=null&&i.live){var g;if(this.checkLiveUpdate(o),o.deltaUpdateFailed)return;d=this.alignPlaylists(o,u.details,(g=this.levelLastLoaded)==null?void 0:g.details)}if(u.details=o,this.levelLastLoaded=u,n||this.setStartPosition(o,d),this.hls.trigger(Events.LEVEL_UPDATED,{details:o,level:a}),this.state===State.WAITING_LEVEL){if(this.waitForCdnTuneIn(o))return;this.state=State.IDLE}n&&o.live&&this.synchronizeToLiveEdge(o),this.tick()}synchronizeToLiveEdge(e){const{config:t,media:i}=this;if(!i)return;const s=this.hls.liveSyncPosition,n=this.getLoadPosition(),a=e.fragmentStart,o=e.edge,c=n>=a-t.maxFragLookUpTolerance&&n<=o;if(s!==null&&i.duration>s&&(n<s||!c)){const f=t.liveMaxLatencyDuration!==void 0?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;if((!c&&i.readyState<4||n<o-f)&&(this._hasEnoughToStart||(this.nextLoadPosition=s),i.readyState))if(this.warn(`Playback: ${n.toFixed(3)} is located too far from the end of live sliding playlist: ${o}, reset currentTime to : ${s.toFixed(3)}`),this.config.liveSyncMode==="buffered"){var u;const d=BufferHelper.bufferInfo(i,s,0);if(!((u=d.buffered)!=null&&u.length)){i.currentTime=s;return}if(d.start<=n){i.currentTime=s;return}const{nextStart:E}=BufferHelper.bufferedInfo(d.buffered,n,0);E&&(i.currentTime=E)}else i.currentTime=s}}_handleFragmentLoadProgress(e){var t;const i=e.frag,{part:s,payload:n}=e,{levels:a}=this;if(!a){this.warn(`Levels were reset while fragment load was in progress. Fragment ${i.sn} of level ${i.level} will not be buffered`);return}const o=a[i.level];if(!o){this.warn(`Level ${i.level} not found on progress`);return}const c=o.details;if(!c){this.warn(`Dropping fragment ${i.sn} of level ${i.level} after level details were reset`),this.fragmentTracker.removeFragment(i);return}const u=o.videoCodec,f=c.PTSKnown||!c.live,d=(t=i.initSegment)==null?void 0:t.data,g=this._getAudioCodec(o),E=this.transmuxer=this.transmuxer||new TransmuxerInterface(this.hls,PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),m=s?s.index:-1,T=m!==-1,S=new ChunkMetadata(i.level,i.sn,i.stats.chunkCount,n.byteLength,m,T),b=this.initPTS[i.cc];E.push(n,d,g,u,i,s,c.totalduration,f,S,b)}onAudioTrackSwitching(e,t){const i=this.hls,s=this.altAudio!==0;if(useAlternateAudio(t.url,i))this.altAudio=1;else{if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const a=this.fragCurrent;a&&(this.log("Switching to main audio track, cancel main fragment load"),a.abortRequests(),this.fragmentTracker.removeFragment(a)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();if(s){this.altAudio=0,this.fragmentTracker.removeAllFragments(),i.once(Events.BUFFER_FLUSHED,()=>{this.hls&&this.hls.trigger(Events.AUDIO_TRACK_SWITCHED,t)}),i.trigger(Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null});return}i.trigger(Events.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const i=useAlternateAudio(t.url,this.hls);if(i){const s=this.videoBuffer;s&&this.mediaBuffer!==s&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=s)}this.altAudio=i?2:0,this.tick()}onBufferCreated(e,t){const i=t.tracks;let s,n,a=!1;for(const o in i){const c=i[o];if(c.id==="main"){if(n=o,s=c,o==="video"){const u=i[o];u&&(this.videoBuffer=u.buffer)}}else a=!0}a&&s?(this.log(`Alternate track found, use ${n}.buffered to schedule main fragment loading`),this.mediaBuffer=s.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:i,part:s}=t,n=i.type===PlaylistLevelType.MAIN;if(n){if(this.fragContextChanged(i)){this.warn(`Fragment ${i.sn}${s?" p: "+s.index:""} of level ${i.level} finished buffering, but was aborted. state: ${this.state}`),this.state===State.PARSED&&(this.state=State.IDLE);return}const o=s?s.stats:i.stats;this.fragLastKbps=Math.round(8*o.total/(o.buffering.end-o.loading.first)),isMediaFragment(i)&&(this.fragPrevious=i),this.fragBufferedComplete(i,s)}const a=this.media;a&&(!this._hasEnoughToStart&&BufferHelper.getBuffered(a).length&&(this._hasEnoughToStart=!0,this.seekToStartPos()),n&&this.tick())}get hasEnoughToStart(){return this._hasEnoughToStart}onError(e,t){var i;if(t.fatal){this.state=State.ERROR;return}switch(t.details){case ErrorDetails.FRAG_GAP:case ErrorDetails.FRAG_PARSING_ERROR:case ErrorDetails.FRAG_DECRYPT_ERROR:case ErrorDetails.FRAG_LOAD_ERROR:case ErrorDetails.FRAG_LOAD_TIMEOUT:case ErrorDetails.KEY_LOAD_ERROR:case ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(PlaylistLevelType.MAIN,t);break;case ErrorDetails.LEVEL_LOAD_ERROR:case ErrorDetails.LEVEL_LOAD_TIMEOUT:case ErrorDetails.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===State.WAITING_LEVEL&&((i=t.context)==null?void 0:i.type)===PlaylistContextType.LEVEL&&(this.state=State.IDLE);break;case ErrorDetails.BUFFER_ADD_CODEC_ERROR:case ErrorDetails.BUFFER_APPEND_ERROR:if(t.parent!=="main")return;this.reduceLengthAndFlushBuffer(t)&&this.resetLoadingState();break;case ErrorDetails.BUFFER_FULL_ERROR:if(t.parent!=="main")return;this.reduceLengthAndFlushBuffer(t)&&(!this.config.interstitialsController&&this.config.assetPlayerId?this._hasEnoughToStart=!0:this.flushMainBuffer(0,Number.POSITIVE_INFINITY));break;case ErrorDetails.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onFragLoadEmergencyAborted(){this.state=State.IDLE,this._hasEnoughToStart||(this.startFragRequested=!1,this.nextLoadPosition=this.lastCurrentTime),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==ElementaryStreamTypes.AUDIO||!this.altAudio){const i=(t===ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;i&&(this.afterBufferFlushed(i,t,PlaylistLevelType.MAIN),this.tick())}}onLevelsUpdated(e,t){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level,this.level===-1&&this.resetWhenMissingContext(this.fragCurrent)),this.levels=t.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const t=e.currentTime;let i=this.startPosition;if(i>=0&&t<i){if(e.seeking){this.log(`could not seek to ${i}, already seeking at ${t}`);return}const s=this.timelineOffset;s&&i&&(i+=s);const n=this.getLevelDetails(),a=BufferHelper.getBuffered(e),o=a.length?a.start(0):0,c=o-i,u=Math.max(this.config.maxBufferHole,this.config.maxFragLookUpTolerance);(this.config.startOnSegmentBoundary||c>0&&(c<u||this.loadingParts&&c<2*(n?.partTarget||0)))&&(this.log(`adjusting start position by ${c} to match buffer start`),i+=c,this.startPosition=i),t<i&&(this.log(`seek to target start position ${i} from current time ${t} buffer start ${o}`),e.currentTime=i)}}_getAudioCodec(e){let t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&t&&(this.log("Swapping audio codec"),t.indexOf("mp4a.40.5")!==-1?t="mp4a.40.2":t="mp4a.40.5"),t}_loadBitrateTestFrag(e,t){e.bitrateTest=!0,this._doFragLoad(e,t).then(i=>{const{hls:s}=this,n=i?.frag;if(!n||this.fragContextChanged(n))return;t.fragmentError=0,this.state=State.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const a=n.stats;a.parsing.start=a.parsing.end=a.buffering.start=a.buffering.end=self.performance.now(),s.trigger(Events.FRAG_LOADED,i),n.bitrateTest=!1}).catch(i=>{this.state===State.STOPPED||this.state===State.ERROR||(this.warn(i),this.resetFragmentLoading(e))})}_handleTransmuxComplete(e){const t=this.playlistType,{hls:i}=this,{remuxResult:s,chunkMeta:n}=e,a=this.getCurrentContext(n);if(!a){this.resetWhenMissingContext(n);return}const{frag:o,part:c,level:u}=a,{video:f,text:d,id3:g,initSegment:E}=s,{details:m}=u,T=this.altAudio?void 0:s.audio;if(this.fragContextChanged(o)){this.fragmentTracker.removeFragment(o);return}if(this.state=State.PARSING,E){const S=E.tracks;if(S){const L=o.initSegment||o;if(this.unhandledEncryptionError(E,o))return;this._bufferInitSegment(u,S,L,n),i.trigger(Events.FRAG_PARSING_INIT_SEGMENT,{frag:L,id:t,tracks:S})}const b=E.initPTS,C=E.timescale,I=this.initPTS[o.cc];if(isFiniteNumber(b)&&(!I||I.baseTime!==b||I.timescale!==C)){const L=E.trackId;this.initPTS[o.cc]={baseTime:b,timescale:C,trackId:L},i.trigger(Events.INIT_PTS_FOUND,{frag:o,id:t,initPTS:b,timescale:C,trackId:L})}}if(f&&m){T&&f.type==="audiovideo"&&this.logMuxedErr(o);const S=m.fragments[o.sn-1-m.startSN],b=o.sn===m.startSN,C=!S||o.cc>S.cc;if(s.independent!==!1){const{startPTS:I,endPTS:L,startDTS:k,endDTS:U}=f;if(c)c.elementaryStreams[f.type]={startPTS:I,endPTS:L,startDTS:k,endDTS:U};else if(f.firstKeyFrame&&f.independent&&n.id===1&&!C&&(this.couldBacktrack=!0),f.dropped&&f.independent){const O=this.getMainFwdBufferInfo(),F=(O?O.end:this.getLoadPosition())+this.config.maxBufferHole,G=f.firstKeyFramePTS?f.firstKeyFramePTS:I;if(!b&&F<G-this.config.maxBufferHole&&!C){this.backtrack(o);return}else C&&(o.gap=!0);o.setElementaryStreamInfo(f.type,o.start,L,o.start,U,!0)}else b&&I-(m.appliedTimelineOffset||0)>MAX_START_GAP_JUMP&&(o.gap=!0);o.setElementaryStreamInfo(f.type,I,L,k,U),this.backtrackFragment&&(this.backtrackFragment=o),this.bufferFragmentData(f,o,c,n,b||C)}else if(b||C)o.gap=!0;else{this.backtrack(o);return}}if(T){const{startPTS:S,endPTS:b,startDTS:C,endDTS:I}=T;c&&(c.elementaryStreams[ElementaryStreamTypes.AUDIO]={startPTS:S,endPTS:b,startDTS:C,endDTS:I}),o.setElementaryStreamInfo(ElementaryStreamTypes.AUDIO,S,b,C,I),this.bufferFragmentData(T,o,c,n)}if(m&&g!=null&&g.samples.length){const S={id:t,frag:o,details:m,samples:g.samples};i.trigger(Events.FRAG_PARSING_METADATA,S)}if(m&&d){const S={id:t,frag:o,details:m,samples:d.samples};i.trigger(Events.FRAG_PARSING_USERDATA,S)}}logMuxedErr(e){this.warn(`${isMediaFragment(e)?"Media":"Init"} segment with muxed audiovideo where only video expected: ${e.url}`)}_bufferInitSegment(e,t,i,s){if(this.state!==State.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&(delete t.audio,t.audiovideo&&this.logMuxedErr(i));const{audio:n,video:a,audiovideo:o}=t;if(n){const u=e.audioCodec;let f=pickMostCompleteCodecName(n.codec,u);f==="mp4a"&&(f="mp4a.40.5");const d=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){f&&(f.indexOf("mp4a.40.5")!==-1?f="mp4a.40.2":f="mp4a.40.5");const g=n.metadata;g&&"channelCount"in g&&(g.channelCount||1)!==1&&d.indexOf("firefox")===-1&&(f="mp4a.40.5")}f&&f.indexOf("mp4a.40.5")!==-1&&d.indexOf("android")!==-1&&n.container!=="audio/mpeg"&&(f="mp4a.40.2",this.log(`Android: force audio codec to ${f}`)),u&&u!==f&&this.log(`Swapping manifest audio codec "${u}" for "${f}"`),n.levelCodec=f,n.id=PlaylistLevelType.MAIN,this.log(`Init audio buffer, container:${n.container}, codecs[selected/level/parsed]=[${f||""}/${u||""}/${n.codec}]`),delete t.audiovideo}if(a){a.levelCodec=e.videoCodec,a.id=PlaylistLevelType.MAIN;const u=a.codec;if(u?.length===4)switch(u){case"hvc1":case"hev1":a.codec="hvc1.1.6.L120.90";break;case"av01":a.codec="av01.0.04M.08";break;case"avc1":a.codec="avc1.42e01e";break}this.log(`Init video buffer, container:${a.container}, codecs[level/parsed]=[${e.videoCodec||""}/${u}]${a.codec!==u?" parsed-corrected="+a.codec:""}${a.supplemental?" supplemental="+a.supplemental:""}`),delete t.audiovideo}o&&(this.log(`Init audiovideo buffer, container:${o.container}, codecs[level/parsed]=[${e.codecs}/${o.codec}]`),delete t.video,delete t.audio);const c=Object.keys(t);if(c.length){if(this.hls.trigger(Events.BUFFER_CODECS,t),!this.hls)return;c.forEach(u=>{const d=t[u].initSegment;d!=null&&d.byteLength&&this.hls.trigger(Events.BUFFER_APPENDING,{type:u,data:d,frag:i,part:null,chunkMeta:s,parent:i.type})})}this.tickImmediate()}getMainFwdBufferInfo(){const e=this.mediaBuffer&&this.altAudio===2?this.mediaBuffer:this.media;return this.getFwdBufferInfo(e,PlaylistLevelType.MAIN)}get maxBufferLength(){const{levels:e,level:t}=this,i=e?.[t];return i?this.getMaxBufferLength(i.maxBitrate):this.config.maxBufferLength}backtrack(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=State.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&e.seeking===!1){const i=e.currentTime;if(BufferHelper.isBuffered(e,i)?t=this.getAppendedFrag(i):BufferHelper.isBuffered(e,i+.1)&&(t=this.getAppendedFrag(i+.1)),t){this.backtrackFragment=null;const s=this.fragPlaying,n=t.level;(!s||t.sn!==s.sn||s.level!==n)&&(this.fragPlaying=t,this.hls.trigger(Events.FRAG_CHANGED,{frag:t}),(!s||s.level!==n)&&this.hls.trigger(Events.LEVEL_SWITCHED,{level:n}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){var e;if(this.fragPlaying)return this.fragPlaying;const t=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;return isFiniteNumber(t)?this.getAppendedFrag(t):null}get currentProgramDateTime(){var e;const t=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;if(isFiniteNumber(t)){const i=this.getLevelDetails(),s=this.currentFrag||(i?findFragmentByPTS(null,i.fragments,t):null);if(s){const n=s.programDateTime;if(n!==null){const a=n+(t-s.start)*1e3;return new Date(a)}}}return null}get currentLevel(){const e=this.currentFrag;return e?e.level:-1}get nextBufferedFrag(){const e=this.currentFrag;return e?this.followingBufferedFrag(e):null}get forceStartLoad(){return this._forceStartLoad}}class KeyLoader extends Logger{constructor(e,t){super("key-loader",t),this.config=void 0,this.keyIdToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const i in this.keyIdToKeyInfo){const s=this.keyIdToKeyInfo[i].loader;if(s){var t;if(e&&e!==((t=s.context)==null?void 0:t.frag.type))return;s.abort()}}}detach(){for(const e in this.keyIdToKeyInfo){const t=this.keyIdToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyIdToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyIdToKeyInfo){const t=this.keyIdToKeyInfo[e].loader;t&&t.destroy()}this.keyIdToKeyInfo={}}createKeyLoadError(e,t=ErrorDetails.KEY_LOAD_ERROR,i,s,n){return new LoadError({type:ErrorTypes.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:n,error:i,networkDetails:s})}loadClear(e,t,i){if(this.emeController&&this.config.emeEnabled&&!this.emeController.getSelectedKeySystemFormats().length){if(t.length)for(let s=0,n=t.length;s<n;s++){const a=t[s];if(e.cc<=a.cc&&(!isMediaFragment(e)||!isMediaFragment(a)||e.sn<a.sn)||!i&&s==n-1)return this.emeController.selectKeySystemFormat(a).then(o=>{if(!this.emeController)return;a.setKeyFormat(o);const c=keySystemFormatToKeySystemDomain(o);if(c)return this.emeController.getKeySystemAccess([c])})}if(this.config.requireKeySystemAccessOnStart){const s=getKeySystemsForConfig(this.config);if(s.length)return this.emeController.getKeySystemAccess(s)}}return null}load(e){return!e.decryptdata&&e.encrypted&&this.emeController&&this.config.emeEnabled?this.emeController.selectKeySystemFormat(e).then(t=>this.loadInternal(e,t)):this.loadInternal(e)}loadInternal(e,t){var i,s;t&&e.setKeyFormat(t);const n=e.decryptdata;if(!n){const u=new Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:`Missing decryption data on fragment in onKeyLoading (emeEnabled with controller: ${this.emeController&&this.config.emeEnabled})`);return Promise.reject(this.createKeyLoadError(e,ErrorDetails.KEY_LOAD_ERROR,u))}const a=n.uri;if(!a)return Promise.reject(this.createKeyLoadError(e,ErrorDetails.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${a}"`)));const o=getKeyId(n);let c=this.keyIdToKeyInfo[o];if((i=c)!=null&&i.decryptdata.key)return n.key=c.decryptdata.key,Promise.resolve({frag:e,keyInfo:c});if(this.emeController&&(s=c)!=null&&s.keyLoadPromise)switch(this.emeController.getKeyStatus(c.decryptdata)){case"usable":case"usable-in-future":return c.keyLoadPromise.then(f=>{const{keyInfo:d}=f;return n.key=d.decryptdata.key,{frag:e,keyInfo:d}})}switch(this.log(`${this.keyIdToKeyInfo[o]?"Rel":"L"}oading${n.keyId?" keyId: "+arrayToHex(n.keyId):""} URI: ${n.uri} from ${e.type} ${e.level}`),c=this.keyIdToKeyInfo[o]={decryptdata:n,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},n.method){case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return n.keyFormat==="identity"?this.loadKeyHTTP(c,e):this.loadKeyEME(c,e);case"AES-128":case"AES-256":case"AES-256-CTR":return this.loadKeyHTTP(c,e);default:return Promise.reject(this.createKeyLoadError(e,ErrorDetails.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${n.method}"`)))}}loadKeyEME(e,t){const i={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){var s;if(!e.decryptdata.keyId&&(s=t.initSegment)!=null&&s.data){const a=parseKeyIdsFromTenc(t.initSegment.data);if(a.length){let o=a[0];o.some(c=>c!==0)?(this.log(`Using keyId found in init segment ${arrayToHex(o)}`),LevelKey.setKeyIdForUri(e.decryptdata.uri,o)):(o=LevelKey.addKeyIdForUri(e.decryptdata.uri),this.log(`Generating keyId to patch media ${arrayToHex(o)}`)),e.decryptdata.keyId=o}}if(!e.decryptdata.keyId&&!isMediaFragment(t))return Promise.resolve(i);const n=this.emeController.loadKey(i);return(e.keyLoadPromise=n.then(a=>(e.mediaKeySessionContext=a,i))).catch(a=>{throw e.keyLoadPromise=null,"data"in a&&(a.data.frag=t),a})}return Promise.resolve(i)}loadKeyHTTP(e,t){const i=this.config,s=i.loader,n=new s(i);return t.keyLoader=e.loader=n,e.keyLoadPromise=new Promise((a,o)=>{const c={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},u=i.keyLoadPolicy.default,f={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},d={onSuccess:(g,E,m,T)=>{const{frag:S,keyInfo:b}=m,C=getKeyId(b.decryptdata);if(!S.decryptdata||b!==this.keyIdToKeyInfo[C])return o(this.createKeyLoadError(S,ErrorDetails.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),T));b.decryptdata.key=S.decryptdata.key=new Uint8Array(g.data),S.keyLoader=null,b.loader=null,a({frag:S,keyInfo:b})},onError:(g,E,m,T)=>{this.resetLoader(E),o(this.createKeyLoadError(t,ErrorDetails.KEY_LOAD_ERROR,new Error(`HTTP Error ${g.code} loading key ${g.text}`),m,_objectSpread2({url:c.url,data:void 0},g)))},onTimeout:(g,E,m)=>{this.resetLoader(E),o(this.createKeyLoadError(t,ErrorDetails.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),m))},onAbort:(g,E,m)=>{this.resetLoader(E),o(this.createKeyLoadError(t,ErrorDetails.INTERNAL_ABORTED,new Error("key loading aborted"),m))}};n.load(c,f,d)})}resetLoader(e){const{frag:t,keyInfo:i,url:s}=e,n=i.loader;t.keyLoader===n&&(t.keyLoader=null,i.loader=null);const a=getKeyId(i.decryptdata)||s;delete this.keyIdToKeyInfo[a],n&&n.destroy()}}function getKeyId(r){if(r.keyFormat!==KeySystemFormats.FAIRPLAY){const e=r.keyId;if(e)return arrayToHex(e)}return r.uri}function mapContextToLevelType(r){const{type:e}=r;switch(e){case PlaylistContextType.AUDIO_TRACK:return PlaylistLevelType.AUDIO;case PlaylistContextType.SUBTITLE_TRACK:return PlaylistLevelType.SUBTITLE;default:return PlaylistLevelType.MAIN}}function getResponseUrl(r,e){let t=r.url;return(t===void 0||t.indexOf("data:")===0)&&(t=e.url),t}class PlaylistLoader{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.onManifestLoaded=this.checkAutostartLoad,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on(Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Events.LEVEL_LOADING,this.onLevelLoading,this),e.on(Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.on(Events.LEVELS_UPDATED,this.onLevelsUpdated,this)}unregisterListeners(){const{hls:e}=this;e.off(Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Events.LEVEL_LOADING,this.onLevelLoading,this),e.off(Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.off(Events.LEVELS_UPDATED,this.onLevelsUpdated,this)}createInternalLoader(e){const t=this.hls.config,i=t.pLoader,s=t.loader,n=i||s,a=new n(t);return this.loaders[e.type]=a,a}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){const{url:i}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:PlaylistContextType.MANIFEST,url:i,deliveryDirectives:null,levelOrTrack:null})}onLevelLoading(e,t){const{id:i,level:s,pathwayId:n,url:a,deliveryDirectives:o,levelInfo:c}=t;this.load({id:i,level:s,pathwayId:n,responseType:"text",type:PlaylistContextType.LEVEL,url:a,deliveryDirectives:o,levelOrTrack:c})}onAudioTrackLoading(e,t){const{id:i,groupId:s,url:n,deliveryDirectives:a,track:o}=t;this.load({id:i,groupId:s,level:null,responseType:"text",type:PlaylistContextType.AUDIO_TRACK,url:n,deliveryDirectives:a,levelOrTrack:o})}onSubtitleTrackLoading(e,t){const{id:i,groupId:s,url:n,deliveryDirectives:a,track:o}=t;this.load({id:i,groupId:s,level:null,responseType:"text",type:PlaylistContextType.SUBTITLE_TRACK,url:n,deliveryDirectives:a,levelOrTrack:o})}onLevelsUpdated(e,t){const i=this.loaders[PlaylistContextType.LEVEL];if(i){const s=i.context;s&&!t.levels.some(n=>n===s.levelOrTrack)&&(i.abort(),delete this.loaders[PlaylistContextType.LEVEL])}}load(e){var t;const i=this.hls.config;let s=this.getInternalLoader(e);if(s){const u=this.hls.logger,f=s.context;if(f&&f.levelOrTrack===e.levelOrTrack&&(f.url===e.url||f.deliveryDirectives&&!e.deliveryDirectives)){f.url===e.url?u.log(`[playlist-loader]: ignore ${e.url} ongoing request`):u.log(`[playlist-loader]: ignore ${e.url} in favor of ${f.url}`);return}u.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),s.abort()}let n;if(e.type===PlaylistContextType.MANIFEST?n=i.manifestLoadPolicy.default:n=_extends({},i.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),s=this.createInternalLoader(e),isFiniteNumber((t=e.deliveryDirectives)==null?void 0:t.part)){let u;if(e.type===PlaylistContextType.LEVEL&&e.level!==null?u=this.hls.levels[e.level].details:e.type===PlaylistContextType.AUDIO_TRACK&&e.id!==null?u=this.hls.audioTracks[e.id].details:e.type===PlaylistContextType.SUBTITLE_TRACK&&e.id!==null&&(u=this.hls.subtitleTracks[e.id].details),u){const f=u.partTarget,d=u.targetduration;if(f&&d){const g=Math.max(f*3,d*.8)*1e3;n=_extends({},n,{maxTimeToFirstByteMs:Math.min(g,n.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(g,n.maxTimeToFirstByteMs)})}}}const a=n.errorRetry||n.timeoutRetry||{},o={loadPolicy:n,timeout:n.maxLoadTimeMs,maxRetry:a.maxNumRetry||0,retryDelay:a.retryDelayMs||0,maxRetryDelay:a.maxRetryDelayMs||0},c={onSuccess:(u,f,d,g)=>{const E=this.getInternalLoader(d);this.resetInternalLoader(d.type);const m=u.data;f.parsing.start=performance.now(),M3U8Parser.isMediaPlaylist(m)||d.type!==PlaylistContextType.MANIFEST?this.handleTrackOrLevelPlaylist(u,f,d,g||null,E):this.handleMasterPlaylist(u,f,d,g)},onError:(u,f,d,g)=>{this.handleNetworkError(f,d,!1,u,g)},onTimeout:(u,f,d)=>{this.handleNetworkError(f,d,!0,void 0,u)}};s.load(e,o,c)}checkAutostartLoad(){if(!this.hls)return;const{config:{autoStartLoad:e,startPosition:t},forceStartLoad:i}=this.hls;(e||i)&&(this.hls.logger.log(`${e?"auto":"force"} startLoad with configured startPosition ${t}`),this.hls.startLoad(t))}handleMasterPlaylist(e,t,i,s){const n=this.hls,a=e.data,o=getResponseUrl(e,i),c=M3U8Parser.parseMasterPlaylist(a,o);if(c.playlistParsingError){t.parsing.end=performance.now(),this.handleManifestParsingError(e,i,c.playlistParsingError,s,t);return}const{contentSteering:u,levels:f,sessionData:d,sessionKeys:g,startTimeOffset:E,variableList:m}=c;this.variableList=m,f.forEach(C=>{const{unknownCodecs:I}=C;if(I){const{preferManagedMediaSource:L}=this.hls.config;let{audioCodec:k,videoCodec:U}=C;for(let O=I.length;O--;){const F=I[O];areCodecsMediaSourceSupported(F,"audio",L)?(C.audioCodec=k=k?`${k},${F}`:F,sampleEntryCodesISO.audio[k.substring(0,4)]=2,I.splice(O,1)):areCodecsMediaSourceSupported(F,"video",L)&&(C.videoCodec=U=U?`${U},${F}`:F,sampleEntryCodesISO.video[U.substring(0,4)]=2,I.splice(O,1))}}});const{AUDIO:T=[],SUBTITLES:S,"CLOSED-CAPTIONS":b}=M3U8Parser.parseMasterPlaylistMedia(a,o,c);T.length&&!T.some(I=>!I.url)&&f[0].audioCodec&&!f[0].attrs.AUDIO&&(this.hls.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),T.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new AttrList({}),bitrate:0,url:""})),n.trigger(Events.MANIFEST_LOADED,{levels:f,audioTracks:T,subtitles:S,captions:b,contentSteering:u,url:o,stats:t,networkDetails:s,sessionData:d,sessionKeys:g,startTimeOffset:E,variableList:m})}handleTrackOrLevelPlaylist(e,t,i,s,n){const a=this.hls,{id:o,level:c,type:u}=i,f=getResponseUrl(e,i),d=isFiniteNumber(c)?c:isFiniteNumber(o)?o:0,g=mapContextToLevelType(i),E=M3U8Parser.parseLevelPlaylist(e.data,f,d,g,0,this.variableList);if(u===PlaylistContextType.MANIFEST){const m={attrs:new AttrList({}),bitrate:0,details:E,name:"",url:f};E.requestScheduled=t.loading.start+computeReloadInterval(E,0),a.trigger(Events.MANIFEST_LOADED,{levels:[m],audioTracks:[],url:f,stats:t,networkDetails:s,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),i.levelDetails=E,this.handlePlaylistLoaded(E,e,t,i,s,n)}handleManifestParsingError(e,t,i,s,n){this.hls.trigger(Events.ERROR,{type:ErrorTypes.NETWORK_ERROR,details:ErrorDetails.MANIFEST_PARSING_ERROR,fatal:t.type===PlaylistContextType.MANIFEST,url:e.url,err:i,error:i,reason:i.message,response:e,context:t,networkDetails:s,stats:n})}handleNetworkError(e,t,i=!1,s,n){let a=`A network ${i?"timeout":"error"+(s?" (status "+s.code+")":"")} occurred while loading ${e.type}`;e.type===PlaylistContextType.LEVEL?a+=`: ${e.level} id: ${e.id}`:(e.type===PlaylistContextType.AUDIO_TRACK||e.type===PlaylistContextType.SUBTITLE_TRACK)&&(a+=` id: ${e.id} group-id: "${e.groupId}"`);const o=new Error(a);this.hls.logger.warn(`[playlist-loader]: ${a}`);let c=ErrorDetails.UNKNOWN,u=!1;const f=this.getInternalLoader(e);switch(e.type){case PlaylistContextType.MANIFEST:c=i?ErrorDetails.MANIFEST_LOAD_TIMEOUT:ErrorDetails.MANIFEST_LOAD_ERROR,u=!0;break;case PlaylistContextType.LEVEL:c=i?ErrorDetails.LEVEL_LOAD_TIMEOUT:ErrorDetails.LEVEL_LOAD_ERROR,u=!1;break;case PlaylistContextType.AUDIO_TRACK:c=i?ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:ErrorDetails.AUDIO_TRACK_LOAD_ERROR,u=!1;break;case PlaylistContextType.SUBTITLE_TRACK:c=i?ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:ErrorDetails.SUBTITLE_LOAD_ERROR,u=!1;break}f&&this.resetInternalLoader(e.type);const d={type:ErrorTypes.NETWORK_ERROR,details:c,fatal:u,url:e.url,loader:f,context:e,error:o,networkDetails:t,stats:n};if(s){const g=t?.url||e.url;d.response=_objectSpread2({url:g,data:void 0},s)}this.hls.trigger(Events.ERROR,d)}handlePlaylistLoaded(e,t,i,s,n,a){const o=this.hls,{type:c,level:u,levelOrTrack:f,id:d,groupId:g,deliveryDirectives:E}=s,m=getResponseUrl(t,s),T=mapContextToLevelType(s);let S=typeof s.level=="number"&&T===PlaylistLevelType.MAIN?u:void 0;const b=e.playlistParsingError;if(b){if(this.hls.logger.warn(`${b} ${e.url}`),!o.config.ignorePlaylistParsingErrors){o.trigger(Events.ERROR,{type:ErrorTypes.NETWORK_ERROR,details:ErrorDetails.LEVEL_PARSING_ERROR,fatal:!1,url:m,error:b,reason:b.message,response:t,context:s,level:S,parent:T,networkDetails:n,stats:i});return}e.playlistParsingError=null}if(!e.fragments.length){const C=e.playlistParsingError=new Error("No Segments found in Playlist");o.trigger(Events.ERROR,{type:ErrorTypes.NETWORK_ERROR,details:ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:m,error:C,reason:C.message,response:t,context:s,level:S,parent:T,networkDetails:n,stats:i});return}switch(e.live&&a&&(a.getCacheAge&&(e.ageHeader=a.getCacheAge()||0),(!a.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),c){case PlaylistContextType.MANIFEST:case PlaylistContextType.LEVEL:if(S){if(!f)S=0;else if(f!==o.levels[S]){const C=o.levels.indexOf(f);C>-1&&(S=C)}}o.trigger(Events.LEVEL_LOADED,{details:e,levelInfo:f||o.levels[0],level:S||0,id:d||0,stats:i,networkDetails:n,deliveryDirectives:E,withoutMultiVariant:c===PlaylistContextType.MANIFEST});break;case PlaylistContextType.AUDIO_TRACK:o.trigger(Events.AUDIO_TRACK_LOADED,{details:e,track:f,id:d||0,groupId:g||"",stats:i,networkDetails:n,deliveryDirectives:E});break;case PlaylistContextType.SUBTITLE_TRACK:o.trigger(Events.SUBTITLE_TRACK_LOADED,{details:e,track:f,id:d||0,groupId:g||"",stats:i,networkDetails:n,deliveryDirectives:E});break}}}class Hls{static get version(){return version}static isMSESupported(){return isMSESupported()}static isSupported(){return isSupported()}static getMediaSource(){return getMediaSource()}static get Events(){return Events}static get MetadataSchema(){return MetadataSchema}static get ErrorTypes(){return ErrorTypes}static get ErrorDetails(){return ErrorDetails}static get DefaultConfig(){return Hls.defaultConfig?Hls.defaultConfig:hlsDefaultConfig}static set DefaultConfig(e){Hls.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.logger=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new EventEmitter,this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioStreamController=void 0,this.subtititleStreamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.interstitialsController=void 0,this.gapController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this._url=null,this._sessionId=void 0,this.triggeringException=void 0,this.started=!1;const t=this.logger=enableLogs(e.debug||!1,"Hls instance",e.assetPlayerId),i=this.config=mergeConfig(Hls.DefaultConfig,e,t);this.userConfig=e,i.progressive&&enableStreamingMode(i,t);const{abrController:s,bufferController:n,capLevelController:a,errorController:o,fpsController:c}=i,u=new o(this),f=this.abrController=new s(this),d=new FragmentTracker(this),g=i.interstitialsController,E=g?this.interstitialsController=new g(this,Hls):null,m=this.bufferController=new n(this,d),T=this.capLevelController=new a(this),S=new c(this),b=new PlaylistLoader(this),C=i.contentSteeringController,I=C?new C(this):null,L=this.levelController=new LevelController(this,I),k=new ID3TrackController(this),U=new KeyLoader(this.config,this.logger),O=this.streamController=new StreamController(this,d,U),F=this.gapController=new GapController(this,d);T.setStreamController(O),S.setStreamController(O);const G=[b,L,O];E&&G.splice(1,0,E),I&&G.splice(1,0,I),this.networkControllers=G;const x=[f,m,F,T,S,k,d];this.audioTrackController=this.createController(i.audioTrackController,G);const $=i.audioStreamController;$&&G.push(this.audioStreamController=new $(this,d,U)),this.subtitleTrackController=this.createController(i.subtitleTrackController,G);const X=i.subtitleStreamController;X&&G.push(this.subtititleStreamController=new X(this,d,U)),this.createController(i.timelineController,x),U.emeController=this.emeController=this.createController(i.emeController,x),this.cmcdController=this.createController(i.cmcdController,x),this.latencyController=this.createController(LatencyController,x),this.coreComponents=x,G.push(u);const Q=u.onErrorOut;typeof Q=="function"&&this.on(Events.ERROR,Q,u),this.on(Events.MANIFEST_LOADED,b.onManifestLoaded,b)}createController(e,t){if(e){const i=new e(this);return t&&t.push(i),i}return null}on(e,t,i=this){this._emitter.on(e,t,i)}once(e,t,i=this){this._emitter.once(e,t,i)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,i=this,s){this._emitter.off(e,t,i,s)}listeners(e){return this._emitter.listeners(e)}emit(e,t,i){return this._emitter.emit(e,t,i)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(i){if(this.logger.error("An internal error happened while handling event "+e+'. Error message: "'+i.message+'". Here is a stacktrace:',i),!this.triggeringException){this.triggeringException=!0;const s=e===Events.ERROR;this.trigger(Events.ERROR,{type:ErrorTypes.OTHER_ERROR,details:ErrorDetails.INTERNAL_EXCEPTION,fatal:s,event:e,error:i}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){this.logger.log("destroy"),this.trigger(Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this._url=null,this.networkControllers.forEach(t=>t.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(t=>t.destroy()),this.coreComponents.length=0;const e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){if(!e||"media"in e&&!e.media){const n=new Error(`attachMedia failed: invalid argument (${e})`);this.trigger(Events.ERROR,{type:ErrorTypes.OTHER_ERROR,details:ErrorDetails.ATTACH_MEDIA_ERROR,fatal:!0,error:n});return}this.logger.log("attachMedia"),this._media&&(this.logger.warn("media must be detached before attaching"),this.detachMedia());const t="media"in e,i=t?e.media:e,s=t?e:{media:i};this._media=i,this.trigger(Events.MEDIA_ATTACHING,s)}detachMedia(){this.logger.log("detachMedia"),this.trigger(Events.MEDIA_DETACHING,{}),this._media=null}transferMedia(){this._media=null;const e=this.bufferController.transferMedia();return this.trigger(Events.MEDIA_DETACHING,{transferMedia:e}),e}loadSource(e){this.stopLoad();const t=this.media,i=this._url,s=this._url=urlToolkitExports.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.logger.log(`loadSource:${s}`),t&&i&&(i!==s||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(Events.MANIFEST_LOADING,{url:e})}get url(){return this._url}get hasEnoughToStart(){return this.streamController.hasEnoughToStart}get startPosition(){return this.streamController.startPositionValue}startLoad(e=-1,t){this.logger.log(`startLoad(${e+(t?", <skip seek to start>":"")})`),this.started=!0,this.resumeBuffering();for(let i=0;i<this.networkControllers.length&&(this.networkControllers[i].startLoad(e,t),!(!this.started||!this.networkControllers));i++);}stopLoad(){this.logger.log("stopLoad"),this.started=!1;for(let e=0;e<this.networkControllers.length&&(this.networkControllers[e].stopLoad(),!(this.started||!this.networkControllers));e++);}get loadingEnabled(){return this.started}get bufferingEnabled(){return this.streamController.bufferingEnabled}resumeBuffering(){this.bufferingEnabled||(this.logger.log("resume buffering"),this.networkControllers.forEach(e=>{e.resumeBuffering&&e.resumeBuffering()}))}pauseBuffering(){this.bufferingEnabled&&(this.logger.log("pause buffering"),this.networkControllers.forEach(e=>{e.pauseBuffering&&e.pauseBuffering()}))}get inFlightFragments(){const e={[PlaylistLevelType.MAIN]:this.streamController.inFlightFrag};return this.audioStreamController&&(e[PlaylistLevelType.AUDIO]=this.audioStreamController.inFlightFrag),this.subtititleStreamController&&(e[PlaylistLevelType.SUBTITLE]=this.subtititleStreamController.inFlightFrag),e}swapAudioCodec(){this.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){this.logger.log("recoverMediaError");const e=this._media,t=e?.currentTime;this.detachMedia(),e&&(this.attachMedia(e),t&&this.startLoad(t))}removeLevel(e){this.levelController.removeLevel(e)}get sessionId(){let e=this._sessionId;return e||(e=this._sessionId=uuid()),e}get levels(){const e=this.levelController.levels;return e||[]}get latestLevelDetails(){return this.streamController.getLevelDetails()||null}get loadLevelObj(){return this.levelController.loadLevelObj}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){this.logger.log(`set currentLevel:${e}`),this.levelController.manualLevel=e,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){this.logger.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){this.logger.log(`set loadLevel:${e}`),this.levelController.manualLevel=e}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(e){this.levelController.nextLoadLevel=e}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(e){this.logger.log(`set firstLevel:${e}`),this.levelController.firstLevel=e}get startLevel(){const e=this.levelController.startLevel;return e===-1&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:e}set startLevel(e){this.logger.log(`set startLevel:${e}`),e!==-1&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(e){const t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimate():NaN}set bandwidthEstimate(e){this.abrController.resetEstimator(e)}get abrEwmaDefaultEstimate(){const{bwEstimator:e}=this.abrController;return e?e.defaultEstimate:NaN}get ttfbEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(this.logger.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){isHdcpLevel(e)&&this._maxHdcpLevel!==e&&(this._maxHdcpLevel=e,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return this.levelController.manualLevel===-1}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:t}}=this;if(!e)return 0;const i=e.length;for(let s=0;s<i;s++)if(e[s].maxBitrate>=t)return s;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:i}=this;let s;if(t===-1&&e!=null&&e.length?s=e.length-1:s=t,i)for(let n=s;n--;){const a=e[n].attrs["HDCP-LEVEL"];if(a&&a<=i)return n}return s}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(e){this.abrController.nextAutoLevel=e}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}get maxBufferLength(){return this.streamController.maxBufferLength}setAudioOption(e){var t;return((t=this.audioTrackController)==null?void 0:t.setAudioOption(e))||null}setSubtitleOption(e){var t;return((t=this.subtitleTrackController)==null?void 0:t.setSubtitleOption(e))||null}get allAudioTracks(){const e=this.audioTrackController;return e?e.allAudioTracks:[]}get audioTracks(){const e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){const e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){const t=this.audioTrackController;t&&(t.audioTrack=e)}get allSubtitleTracks(){const e=this.subtitleTrackController;return e?e.allSubtitleTracks:[]}get subtitleTracks(){const e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){const e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){const t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return e?e.subtitleDisplay:!1}set subtitleDisplay(e){const t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}set targetLatency(e){this.latencyController.targetLatency=e}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}get pathways(){return this.levelController.pathways}get pathwayPriority(){return this.levelController.pathwayPriority}set pathwayPriority(e){this.levelController.pathwayPriority=e}get bufferedToEnd(){var e;return!!((e=this.bufferController)!=null&&e.bufferedToEnd)}get interstitialsManager(){var e;return((e=this.interstitialsController)==null?void 0:e.interstitialsManager)||null}getMediaDecodingInfo(e,t=this.allAudioTracks){const i=getAudioTracksByGroup(t);return getMediaDecodingInfoPromise(e,i,navigator.mediaCapabilities)}}Hls.defaultConfig=void 0;const checkPwaInstalled=()=>{const r=window.matchMedia("(display-mode: standalone)").matches,e=/iphone|ipad|ipod/i.test(window.navigator.userAgent),t=window.navigator.standalone===!0;return r||e&&t},usePWAInstalled=()=>{const[r,e]=React.useState(checkPwaInstalled());return React.useEffect(()=>{const t=()=>{e(checkPwaInstalled())};return window.addEventListener("DOMContentLoaded",t),window.addEventListener("appinstalled",t),()=>{window.removeEventListener("DOMContentLoaded",t),window.removeEventListener("appinstalled",t)}},[]),r};function VideoPlayer({src:r,reverseSrc:e,poster:t,keySrc:i,onPlay:s,onPause:n}){const[a,o]=React.useState(!1),[c,u]=React.useState(!1),f=React.useRef(null),{os:d,browser:g}=useUserAgent(),E=useDeviceType(),[m,T]=React.useState(!1),[S,b]=React.useState(!1),[C,I]=React.useState(0),[L,k]=React.useState(0),[U,O]=React.useState([]),[F,G]=React.useState(!1),[x,$]=React.useState(!1),X=usePWAInstalled(),[Q,ee]=React.useState(!1),[te,re]=React.useState([{value:.5,label:"0.5x",active:!1},{value:1,label:"1x",active:!0},{value:1.25,label:"1.25x",active:!1},{value:1.5,label:"1.5x",active:!1},{value:1.75,label:"1.75x",active:!1},{value:2,label:"2x",active:!1},{value:2.5,label:"2.5x",active:!1},{value:3,label:"3x",active:!1}]),me=React.useRef(null),H=React.useRef(null),[z,ie]=React.useState(!1),ne=React.useRef(null),he=React.useRef(!1);React.useEffect(()=>(Pe(),document.addEventListener("keypress",pe),()=>{ne.current?.destroy(),ne.current=null,document.removeEventListener("keypress",pe)}),[r,i]);function pe(Se){Se.preventDefault(),Se.code.toUpperCase()==="SPACE"&&Qe()}async function Pe(){if(!f.current||!r)return;const Se=r.endsWith(".m3u8");if(Hls.isSupported()&&Se)try{const lt=new Hls({xhrSetup:function(ht,pt){pt.includes(".key")&&i&&ht.open("GET",i,!0)},maxBufferLength:30,maxMaxBufferLength:60,maxBufferSize:3e7,maxBufferHole:1,startPosition:-1,autoStartLoad:!0});lt.on(Hls.Events.ERROR,function(ht,pt){console.error("Hls error:",pt)}),ne.current=lt,lt.loadSource(r),lt.attachMedia(f.current)}catch{$(!0)}else f.current.canPlayType("application/vnd.apple.mpegurl")&&Se?e&&(f.current.src=e):f.current.src=r;f.current.poster=t??"",f.current.addEventListener("canplay",ae),f.current.addEventListener("loadedmetadata",Le),f.current.addEventListener("play",ce),f.current.addEventListener("pause",Ee),f.current.addEventListener("timeupdate",Y),f.current.addEventListener("progress",Re),f.current.addEventListener("error",Ae),f.current.addEventListener("playing",ve),f.current.addEventListener("waiting",Be),document.addEventListener("visibilitychange",q),le()}React.useEffect(()=>{a&&c&&G(!0)},[a,c]),React.useEffect(()=>{const Se=setTimeout(()=>{G(!1)},1e4);return()=>{clearTimeout(Se)}},[F]);function ae(){o(!0),$(!1)}function Ae(){$(!0),o(!1),u(!1);const Se=f.current?.error;if(Se)switch(Se.code){case MediaError.MEDIA_ERR_ABORTED:console.log("خطا: بارگذاری ویدیو قطع شد.");break;case MediaError.MEDIA_ERR_NETWORK:console.log("خطا: مشکل شبکه هنگام بارگذاری ویدیو.");break;case MediaError.MEDIA_ERR_DECODE:console.log("خطا: مشکل در رمزگشایی فایل ویدیو.");break;case MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:console.log("خطا: فرمت یا سورس ویدیو پشتیبانی نمی‌شود.");break;default:console.log("خطای نامشخص در ویدیو.");break}else console.log("خطای ناشناخته در پخش ویدیو")}function Re(){const Se=f.current;if(!Se)return;const lt=[],ht=Se.buffered;for(let pt=0;pt<ht.length;pt++){const Ui=ht.start(pt),Pi=ht.end(pt);lt.push({start:Ui,end:Pi})}O(lt)}function Le(){o(!0),$(!1),k(f.current?.duration??0)}function Y(){I(f.current?.currentTime??0)}function q(){f.current?.pause()}function le(){new IntersectionObserver(lt=>{for(const ht of lt){const pt=ht.target;ht.intersectionRatio<.5?!pt.paused&&!pt.ended&&(pt.pause(),he.current=!0):ht.isIntersecting&&(he.current&&pt.play().catch(()=>{}),he.current=!1)}},{threshold:[0,.5,1]}).observe(f.current)}function ce(){u(!0),s?.()}function Ee(){u(!1),n?.()}function ve(){o(!0),u(!0)}function Be(){o(!1),u(!1),$(!1)}async function Ie(){if(ee(Se=>!Se),d.name?.toUpperCase().includes("IOS")||g.name?.toUpperCase().includes("SAFARI")&&d.name?.toUpperCase().includes("MAC")&&(E===DeviceTypeEnum.MOBILE||X))S?(f.current?.classList.remove("sp:!object-contain"),f.current?.parentElement?.classList.remove("sp:!z-[999]")):(f.current?.classList.add("sp:!object-contain"),f.current?.parentElement?.classList.add("sp:!z-[999]")),b(!S);else{if(document.fullscreenElement)await document.exitFullscreen(),f.current?.classList.remove("sp:!object-contain"),f.current?.parentElement?.classList.remove("sp:!z-[9999999]");else{const Se=f.current?.parentElement;if(Se){const lt=Se.requestFullscreen||Se.webkitRequestFullscreen||Se.mozRequestFullScreen||Se.msRequestFullscreen;if(lt){const ht=lt.call(Se);ht&&ht.catch(pt=>{console.error("Error attempting to enable full-screen mode:",pt)})}else console.warn("Fullscreen API is not supported by this browser.")}f.current?.classList.add("sp:!object-contain"),f.current?.parentElement?.classList.add("sp:!z-[9999999]")}gt()}}React.useEffect(()=>{gt()},[S]);function Me(){f.current&&(f.current.currentTime+=15)}function Ve(){f.current&&(f.current.currentTime-=15)}function dt(){f.current&&(m?f.current.muted=!1:f.current.muted=!0,T(!m))}function Qe(){c?f.current?.pause():f.current?.play()}function ze(){let Se=lodashExports.findIndex(te,ht=>ht.active),lt=te[Se].value;Se+1==te.length?Se=0:Se+=1,re(te.map((ht,pt)=>pt==Se?(lt=ht.value,{value:ht.value,label:ht.label,active:!0}):{value:ht.value,label:ht.label,active:!1})),f.current&&(f.current.playbackRate=lt)}function Je(Se){f.current&&(f.current.currentTime=Se)}function gt(){document.fullscreenElement||S?document.body.classList.add("landscape-allowed"):document.body.classList.remove("landscape-allowed")}const yt=React.useRef(lodashExports.debounce(()=>{G(!0)})).current;function _t(){$(!1),Pe()}function qe(){me.current&&(clearTimeout(me.current),me.current=null),Me()}function Yt(){me.current&&(clearTimeout(me.current),me.current=null),Ve()}function Dt(){ie(!1),H.current=setTimeout(()=>{ie(!0),re(te.map(Se=>Se.value==2?{value:Se.value,label:Se.label,active:!0}:{value:Se.value,label:Se.label,active:!1})),f.current&&(f.current.playbackRate=2)},1e3)}function St(){z&&(re(te.map(Se=>Se.value==1?{value:Se.value,label:Se.label,active:!0}:{value:Se.value,label:Se.label,active:!1})),f.current&&(f.current.playbackRate=1)),H.current&&(clearTimeout(H.current),H.current=null)}return jsxRuntime.jsxs("section",{onMouseMove:yt,onTouchMove:yt,onMouseDown:Dt,onMouseUp:St,onTouchStart:Dt,onTouchEnd:St,onClick:()=>{if(z){ie(!1);return}me.current!==null&&(clearTimeout(me.current),me.current=null),c?me.current=setTimeout(()=>{f.current?.pause()},300):f.current?.play()},style:{direction:"rtl"},className:S?"sp__fullscreen__safari":"sp:w-full sp:h-full sp:relative",children:[jsxRuntime.jsx("video",{width:"100%",height:"100%",className:"sp:w-full sp:h-full sp:object-cover",ref:f,playsInline:!0,"webkit-playsinline":"true",controls:!1}),jsxRuntime.jsx(VideoPlayerControl,{isError:x,isShowControl:F,onSeek:Je,bufferedRanges:U,rates:te,currentTime:C,duration:L,onTogglePlay:Qe,isMuted:m,onToggleMute:dt,onBackwardCurrentTime:Ve,onForwardCurrentTime:Me,onDoubleClickInRight:qe,onDoubleClickInLeft:Yt,onMaximize:Ie,canPlay:a,isPlayed:c,onChangeRate:ze,isFullScreen:Q,onTryAgain:_t})]})}exports.VideoPlayer=VideoPlayer,exports.VideoPlayerControl=VideoPlayerControl,exports.default=VideoPlayer,Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));