xgplayer-transmuxer 3.0.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/index.min.js +2 -0
  2. package/dist/index.min.js.map +1 -0
  3. package/es/codec/aac.d.ts +34 -0
  4. package/es/codec/aac.js +242 -0
  5. package/es/codec/avc.d.ts +35 -0
  6. package/es/codec/avc.js +250 -0
  7. package/es/codec/hevc.d.ts +38 -0
  8. package/es/codec/hevc.js +202 -0
  9. package/es/codec/index.d.ts +4 -0
  10. package/es/codec/nalu.d.ts +11 -0
  11. package/es/codec/nalu.js +194 -0
  12. package/es/flv/amf.d.ts +16 -0
  13. package/es/flv/amf.js +247 -0
  14. package/es/flv/fixer.d.ts +31 -0
  15. package/es/flv/fixer.js +437 -0
  16. package/es/flv/index.d.ts +65 -0
  17. package/es/flv/index.js +441 -0
  18. package/es/index.d.ts +5 -0
  19. package/es/index.js +13 -0
  20. package/es/model/audio-sample.d.ts +18 -0
  21. package/es/model/audio-sample.js +26 -0
  22. package/es/model/audio-track.d.ts +38 -0
  23. package/es/model/audio-track.js +94 -0
  24. package/es/model/index.d.ts +6 -0
  25. package/es/model/metadata-track.d.ts +36 -0
  26. package/es/model/metadata-track.js +100 -0
  27. package/es/model/types.d.ts +26 -0
  28. package/es/model/types.js +31 -0
  29. package/es/model/video-sample.d.ts +44 -0
  30. package/es/model/video-sample.js +66 -0
  31. package/es/model/video-track.d.ts +45 -0
  32. package/es/model/video-track.js +99 -0
  33. package/es/mp4/fmp4-remuxer.d.ts +32 -0
  34. package/es/mp4/fmp4-remuxer.js +172 -0
  35. package/es/mp4/index.d.ts +4 -0
  36. package/es/mp4/logger.d.ts +13 -0
  37. package/es/mp4/logger.js +97 -0
  38. package/es/mp4/mp4-demuxer.d.ts +24 -0
  39. package/es/mp4/mp4-demuxer.js +268 -0
  40. package/es/mp4/mp4-parser.d.ts +161 -0
  41. package/es/mp4/mp4-parser.js +776 -0
  42. package/es/mp4/mp4-remuxer.d.ts +23 -0
  43. package/es/mp4/mp4-remuxer.js +273 -0
  44. package/es/mp4/mp4.d.ts +56 -0
  45. package/es/mp4/mp4.js +574 -0
  46. package/es/mpeg-ts/fixer.d.ts +23 -0
  47. package/es/mpeg-ts/fixer.js +383 -0
  48. package/es/mpeg-ts/index.d.ts +60 -0
  49. package/es/mpeg-ts/index.js +480 -0
  50. package/es/utils/env.d.ts +4 -0
  51. package/es/utils/env.js +10 -0
  52. package/es/utils/exp-golomb.d.ts +17 -0
  53. package/es/utils/exp-golomb.js +172 -0
  54. package/es/utils/index.d.ts +11 -0
  55. package/es/utils/index.js +77 -0
  56. package/es/utils/logger.d.ts +9 -0
  57. package/es/utils/logger.js +45 -0
  58. package/es/utils/utf8.d.ts +9 -0
  59. package/es/utils/utf8.js +91 -0
  60. package/package.json +25 -0
@@ -0,0 +1,2 @@
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).XGPlayerTransmuxer=e()}(this,(function(){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},e=function(t){return t&&t.Math==Math&&t},r=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof t&&t)||function(){return this}()||Function("return this")(),n={},a=function(t){try{return!!t()}catch(t){return!0}},i=!a((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),o={},s={}.propertyIsEnumerable,u=Object.getOwnPropertyDescriptor,c=u&&!s.call({1:2},1);o.f=c?function(t){var e=u(this,t);return!!e&&e.enumerable}:s;var f,l,h=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},d={}.toString,p=function(t){return d.call(t).slice(8,-1)},v=p,y="".split,m=a((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==v(t)?y.call(t,""):Object(t)}:Object,g=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},b=m,k=g,_=function(t){return b(k(t))},A=function(t){return"object"==typeof t?null!==t:"function"==typeof t},w=r,T=function(t){return"function"==typeof t?t:void 0},x=function(t,e){return arguments.length<2?T(w[t]):w[t]&&w[t][e]},S=x("navigator","userAgent")||"",D=r,E=S,P=D.process,O=D.Deno,C=P&&P.versions||O&&O.version,B=C&&C.v8;B?l=(f=B.split("."))[0]<4?1:f[0]+f[1]:E&&(!(f=E.match(/Edge\/(\d+)/))||f[1]>=74)&&(f=E.match(/Chrome\/(\d+)/))&&(l=f[1]);var I=l&&+l,U=I,L=a,R=!!Object.getOwnPropertySymbols&&!L((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&U&&U<41})),M=R&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,N=x,j=M?function(t){return"symbol"==typeof t}:function(t){var e=N("Symbol");return"function"==typeof e&&Object(t)instanceof e},V=A,F={exports:{}},G=r,z=function(t,e){try{Object.defineProperty(G,t,{value:e,configurable:!0,writable:!0})}catch(r){G[t]=e}return e},W=z,H="__core-js_shared__",Y=r[H]||W(H,{}),K=Y;(F.exports=function(t,e){return K[t]||(K[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.16.2",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"});var q=g,Z=function(t){return Object(q(t))},Q=Z,X={}.hasOwnProperty,$=Object.hasOwn||function(t,e){return X.call(Q(t),e)},J=0,tt=Math.random(),et=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++J+tt).toString(36)},rt=r,nt=F.exports,at=$,it=et,ot=R,st=M,ut=nt("wks"),ct=rt.Symbol,ft=st?ct:ct&&ct.withoutSetter||it,lt=function(t){return at(ut,t)&&(ot||"string"==typeof ut[t])||(ot&&at(ct,t)?ut[t]=ct[t]:ut[t]=ft("Symbol."+t)),ut[t]},ht=A,dt=j,pt=function(t,e){var r,n;if("string"===e&&"function"==typeof(r=t.toString)&&!V(n=r.call(t)))return n;if("function"==typeof(r=t.valueOf)&&!V(n=r.call(t)))return n;if("string"!==e&&"function"==typeof(r=t.toString)&&!V(n=r.call(t)))return n;throw TypeError("Can't convert object to primitive value")},vt=lt("toPrimitive"),yt=function(t,e){if(!ht(t)||dt(t))return t;var r,n=t[vt];if(void 0!==n){if(void 0===e&&(e="default"),r=n.call(t,e),!ht(r)||dt(r))return r;throw TypeError("Can't convert object to primitive value")}return void 0===e&&(e="number"),pt(t,e)},mt=yt,gt=j,bt=function(t){var e=mt(t,"string");return gt(e)?e:String(e)},kt=A,_t=r.document,At=kt(_t)&&kt(_t.createElement),wt=function(t){return At?_t.createElement(t):{}},Tt=wt,xt=!i&&!a((function(){return 7!=Object.defineProperty(Tt("div"),"a",{get:function(){return 7}}).a})),St=i,Dt=o,Et=h,Pt=_,Ot=bt,Ct=$,Bt=xt,It=Object.getOwnPropertyDescriptor;n.f=St?It:function(t,e){if(t=Pt(t),e=Ot(e),Bt)try{return It(t,e)}catch(t){}if(Ct(t,e))return Et(!Dt.f.call(t,e),t[e])};var Ut={},Lt=A,Rt=function(t){if(!Lt(t))throw TypeError(String(t)+" is not an object");return t},Mt=i,Nt=xt,jt=Rt,Vt=bt,Ft=Object.defineProperty;Ut.f=Mt?Ft:function(t,e,r){if(jt(t),e=Vt(e),jt(r),Nt)try{return Ft(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(t[e]=r.value),t};var Gt=Ut,zt=h,Wt=i?function(t,e,r){return Gt.f(t,e,zt(1,r))}:function(t,e,r){return t[e]=r,t},Ht={exports:{}},Yt=Y,Kt=Function.toString;"function"!=typeof Yt.inspectSource&&(Yt.inspectSource=function(t){return Kt.call(t)});var qt,Zt,Qt,Xt=Yt.inspectSource,$t=Xt,Jt=r.WeakMap,te="function"==typeof Jt&&/native code/.test($t(Jt)),ee=F.exports,re=et,ne=ee("keys"),ae=function(t){return ne[t]||(ne[t]=re(t))},ie={},oe=te,se=A,ue=Wt,ce=$,fe=Y,le=ae,he=ie,de="Object already initialized",pe=r.WeakMap;if(oe||fe.state){var ve=fe.state||(fe.state=new pe),ye=ve.get,me=ve.has,ge=ve.set;qt=function(t,e){if(me.call(ve,t))throw new TypeError(de);return e.facade=t,ge.call(ve,t,e),e},Zt=function(t){return ye.call(ve,t)||{}},Qt=function(t){return me.call(ve,t)}}else{var be=le("state");he[be]=!0,qt=function(t,e){if(ce(t,be))throw new TypeError(de);return e.facade=t,ue(t,be,e),e},Zt=function(t){return ce(t,be)?t[be]:{}},Qt=function(t){return ce(t,be)}}var ke={set:qt,get:Zt,has:Qt,enforce:function(t){return Qt(t)?Zt(t):qt(t,{})},getterFor:function(t){return function(e){var r;if(!se(e)||(r=Zt(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return r}}},_e=r,Ae=Wt,we=$,Te=z,xe=Xt,Se=ke.get,De=ke.enforce,Ee=String(String).split("String");(Ht.exports=function(t,e,r,n){var a,i=!!n&&!!n.unsafe,o=!!n&&!!n.enumerable,s=!!n&&!!n.noTargetGet;"function"==typeof r&&("string"!=typeof e||we(r,"name")||Ae(r,"name",e),(a=De(r)).source||(a.source=Ee.join("string"==typeof e?e:""))),t!==_e?(i?!s&&t[e]&&(o=!0):delete t[e],o?t[e]=r:Ae(t,e,r)):o?t[e]=r:Te(e,r)})(Function.prototype,"toString",(function(){return"function"==typeof this&&Se(this).source||xe(this)}));var Pe={},Oe=Math.ceil,Ce=Math.floor,Be=function(t){return isNaN(t=+t)?0:(t>0?Ce:Oe)(t)},Ie=Be,Ue=Math.min,Le=function(t){return t>0?Ue(Ie(t),9007199254740991):0},Re=Be,Me=Math.max,Ne=Math.min,je=function(t,e){var r=Re(t);return r<0?Me(r+e,0):Ne(r,e)},Ve=_,Fe=Le,Ge=je,ze=function(t){return function(e,r,n){var a,i=Ve(e),o=Fe(i.length),s=Ge(n,o);if(t&&r!=r){for(;o>s;)if((a=i[s++])!=a)return!0}else for(;o>s;s++)if((t||s in i)&&i[s]===r)return t||s||0;return!t&&-1}},We={includes:ze(!0),indexOf:ze(!1)},He=$,Ye=_,Ke=We.indexOf,qe=ie,Ze=function(t,e){var r,n=Ye(t),a=0,i=[];for(r in n)!He(qe,r)&&He(n,r)&&i.push(r);for(;e.length>a;)He(n,r=e[a++])&&(~Ke(i,r)||i.push(r));return i},Qe=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Xe=Ze,$e=Qe.concat("length","prototype");Pe.f=Object.getOwnPropertyNames||function(t){return Xe(t,$e)};var Je={};Je.f=Object.getOwnPropertySymbols;var tr=Pe,er=Je,rr=Rt,nr=x("Reflect","ownKeys")||function(t){var e=tr.f(rr(t)),r=er.f;return r?e.concat(r(t)):e},ar=$,ir=nr,or=n,sr=Ut,ur=a,cr=/#|\.prototype\./,fr=function(t,e){var r=hr[lr(t)];return r==pr||r!=dr&&("function"==typeof e?ur(e):!!e)},lr=fr.normalize=function(t){return String(t).replace(cr,".").toLowerCase()},hr=fr.data={},dr=fr.NATIVE="N",pr=fr.POLYFILL="P",vr=fr,yr=r,mr=n.f,gr=Wt,br=Ht.exports,kr=z,_r=function(t,e){for(var r=ir(e),n=sr.f,a=or.f,i=0;i<r.length;i++){var o=r[i];ar(t,o)||n(t,o,a(e,o))}},Ar=vr,wr=function(t,e){var r,n,a,i,o,s=t.target,u=t.global,c=t.stat;if(r=u?yr:c?yr[s]||kr(s,{}):(yr[s]||{}).prototype)for(n in e){if(i=e[n],a=t.noTargetGet?(o=mr(r,n))&&o.value:r[n],!Ar(u?n:s+(c?".":"#")+n,t.forced)&&void 0!==a){if(typeof i==typeof a)continue;_r(i,a)}(t.sham||a&&a.sham)&&gr(i,"sham",!0),br(r,n,i,t)}},Tr=Ze,xr=Qe,Sr=Object.keys||function(t){return Tr(t,xr)},Dr=Z,Er=Sr;wr({target:"Object",stat:!0,forced:a((function(){Er(1)}))},{keys:function(t){return Er(Dr(t))}});var Pr,Or=p,Cr=Array.isArray||function(t){return"Array"==Or(t)},Br=j,Ir=function(t){if(Br(t))throw TypeError("Cannot convert a Symbol value to a string");return String(t)},Ur=Ut,Lr=Rt,Rr=Sr,Mr=i?Object.defineProperties:function(t,e){Lr(t);for(var r,n=Rr(e),a=n.length,i=0;a>i;)Ur.f(t,r=n[i++],e[r]);return t},Nr=x("document","documentElement"),jr=Rt,Vr=Mr,Fr=Qe,Gr=ie,zr=Nr,Wr=wt,Hr=ae("IE_PROTO"),Yr=function(){},Kr=function(t){return"<script>"+t+"</"+"script>"},qr=function(t){t.write(Kr("")),t.close();var e=t.parentWindow.Object;return t=null,e},Zr=function(){try{Pr=new ActiveXObject("htmlfile")}catch(t){}var t,e;Zr="undefined"!=typeof document?document.domain&&Pr?qr(Pr):((e=Wr("iframe")).style.display="none",zr.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(Kr("document.F=Object")),t.close(),t.F):qr(Pr);for(var r=Fr.length;r--;)delete Zr.prototype[Fr[r]];return Zr()};Gr[Hr]=!0;var Qr=Object.create||function(t,e){var r;return null!==t?(Yr.prototype=jr(t),r=new Yr,Yr.prototype=null,r[Hr]=t):r=Zr(),void 0===e?r:Vr(r,e)},Xr={},$r=_,Jr=Pe.f,tn={}.toString,en="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];Xr.f=function(t){return en&&"[object Window]"==tn.call(t)?function(t){try{return Jr(t)}catch(t){return en.slice()}}(t):Jr($r(t))};var rn={},nn=lt;rn.f=nn;var an=r,on=$,sn=rn,un=Ut.f,cn=Ut.f,fn=$,ln=lt("toStringTag"),hn=function(t,e,r){t&&!fn(t=r?t:t.prototype,ln)&&cn(t,ln,{configurable:!0,value:e})},dn=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t},pn=dn,vn=function(t,e,r){if(pn(t),void 0===e)return t;switch(r){case 0:return function(){return t.call(e)};case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,a){return t.call(e,r,n,a)}}return function(){return t.apply(e,arguments)}},yn=A,mn=Cr,gn=lt("species"),bn=function(t){var e;return mn(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!mn(e.prototype)?yn(e)&&null===(e=e[gn])&&(e=void 0):e=void 0),void 0===e?Array:e},kn=function(t,e){return new(bn(t))(0===e?0:e)},_n=vn,An=m,wn=Z,Tn=Le,xn=kn,Sn=[].push,Dn=function(t){var e=1==t,r=2==t,n=3==t,a=4==t,i=6==t,o=7==t,s=5==t||i;return function(u,c,f,l){for(var h,d,p=wn(u),v=An(p),y=_n(c,f,3),m=Tn(v.length),g=0,b=l||xn,k=e?b(u,m):r||o?b(u,0):void 0;m>g;g++)if((s||g in v)&&(d=y(h=v[g],g,p),t))if(e)k[g]=d;else if(d)switch(t){case 3:return!0;case 5:return h;case 6:return g;case 2:Sn.call(k,h)}else switch(t){case 4:return!1;case 7:Sn.call(k,h)}return i?-1:n||a?a:k}},En={forEach:Dn(0),map:Dn(1),filter:Dn(2),some:Dn(3),every:Dn(4),find:Dn(5),findIndex:Dn(6),filterReject:Dn(7)},Pn=wr,On=r,Cn=x,Bn=i,In=R,Un=a,Ln=$,Rn=Cr,Mn=A,Nn=j,jn=Rt,Vn=Z,Fn=_,Gn=bt,zn=Ir,Wn=h,Hn=Qr,Yn=Sr,Kn=Pe,qn=Xr,Zn=Je,Qn=n,Xn=Ut,$n=o,Jn=Wt,ta=Ht.exports,ea=F.exports,ra=ie,na=et,aa=lt,ia=rn,oa=function(t){var e=an.Symbol||(an.Symbol={});on(e,t)||un(e,t,{value:sn.f(t)})},sa=hn,ua=ke,ca=En.forEach,fa=ae("hidden"),la="Symbol",ha=aa("toPrimitive"),da=ua.set,pa=ua.getterFor(la),va=Object.prototype,ya=On.Symbol,ma=Cn("JSON","stringify"),ga=Qn.f,ba=Xn.f,ka=qn.f,_a=$n.f,Aa=ea("symbols"),wa=ea("op-symbols"),Ta=ea("string-to-symbol-registry"),xa=ea("symbol-to-string-registry"),Sa=ea("wks"),Da=On.QObject,Ea=!Da||!Da.prototype||!Da.prototype.findChild,Pa=Bn&&Un((function(){return 7!=Hn(ba({},"a",{get:function(){return ba(this,"a",{value:7}).a}})).a}))?function(t,e,r){var n=ga(va,e);n&&delete va[e],ba(t,e,r),n&&t!==va&&ba(va,e,n)}:ba,Oa=function(t,e){var r=Aa[t]=Hn(ya.prototype);return da(r,{type:la,tag:t,description:e}),Bn||(r.description=e),r},Ca=function(t,e,r){t===va&&Ca(wa,e,r),jn(t);var n=Gn(e);return jn(r),Ln(Aa,n)?(r.enumerable?(Ln(t,fa)&&t[fa][n]&&(t[fa][n]=!1),r=Hn(r,{enumerable:Wn(0,!1)})):(Ln(t,fa)||ba(t,fa,Wn(1,{})),t[fa][n]=!0),Pa(t,n,r)):ba(t,n,r)},Ba=function(t,e){jn(t);var r=Fn(e),n=Yn(r).concat(Ra(r));return ca(n,(function(e){Bn&&!Ia.call(r,e)||Ca(t,e,r[e])})),t},Ia=function(t){var e=Gn(t),r=_a.call(this,e);return!(this===va&&Ln(Aa,e)&&!Ln(wa,e))&&(!(r||!Ln(this,e)||!Ln(Aa,e)||Ln(this,fa)&&this[fa][e])||r)},Ua=function(t,e){var r=Fn(t),n=Gn(e);if(r!==va||!Ln(Aa,n)||Ln(wa,n)){var a=ga(r,n);return!a||!Ln(Aa,n)||Ln(r,fa)&&r[fa][n]||(a.enumerable=!0),a}},La=function(t){var e=ka(Fn(t)),r=[];return ca(e,(function(t){Ln(Aa,t)||Ln(ra,t)||r.push(t)})),r},Ra=function(t){var e=t===va,r=ka(e?wa:Fn(t)),n=[];return ca(r,(function(t){!Ln(Aa,t)||e&&!Ln(va,t)||n.push(Aa[t])})),n};(In||(ta((ya=function(){if(this instanceof ya)throw TypeError("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?zn(arguments[0]):void 0,e=na(t),r=function(t){this===va&&r.call(wa,t),Ln(this,fa)&&Ln(this[fa],e)&&(this[fa][e]=!1),Pa(this,e,Wn(1,t))};return Bn&&Ea&&Pa(va,e,{configurable:!0,set:r}),Oa(e,t)}).prototype,"toString",(function(){return pa(this).tag})),ta(ya,"withoutSetter",(function(t){return Oa(na(t),t)})),$n.f=Ia,Xn.f=Ca,Qn.f=Ua,Kn.f=qn.f=La,Zn.f=Ra,ia.f=function(t){return Oa(aa(t),t)},Bn&&(ba(ya.prototype,"description",{configurable:!0,get:function(){return pa(this).description}}),ta(va,"propertyIsEnumerable",Ia,{unsafe:!0}))),Pn({global:!0,wrap:!0,forced:!In,sham:!In},{Symbol:ya}),ca(Yn(Sa),(function(t){oa(t)})),Pn({target:la,stat:!0,forced:!In},{for:function(t){var e=zn(t);if(Ln(Ta,e))return Ta[e];var r=ya(e);return Ta[e]=r,xa[r]=e,r},keyFor:function(t){if(!Nn(t))throw TypeError(t+" is not a symbol");if(Ln(xa,t))return xa[t]},useSetter:function(){Ea=!0},useSimple:function(){Ea=!1}}),Pn({target:"Object",stat:!0,forced:!In,sham:!Bn},{create:function(t,e){return void 0===e?Hn(t):Ba(Hn(t),e)},defineProperty:Ca,defineProperties:Ba,getOwnPropertyDescriptor:Ua}),Pn({target:"Object",stat:!0,forced:!In},{getOwnPropertyNames:La,getOwnPropertySymbols:Ra}),Pn({target:"Object",stat:!0,forced:Un((function(){Zn.f(1)}))},{getOwnPropertySymbols:function(t){return Zn.f(Vn(t))}}),ma)&&Pn({target:"JSON",stat:!0,forced:!In||Un((function(){var t=ya();return"[null]"!=ma([t])||"{}"!=ma({a:t})||"{}"!=ma(Object(t))}))},{stringify:function(t,e,r){for(var n,a=[t],i=1;arguments.length>i;)a.push(arguments[i++]);if(n=e,(Mn(e)||void 0!==t)&&!Nn(t))return Rn(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!Nn(e))return e}),a[1]=e,ma.apply(null,a)}});ya.prototype[ha]||Jn(ya.prototype,ha,ya.prototype.valueOf),sa(ya,la),ra[fa]=!0;var Ma=a,Na=I,ja=lt("species"),Va=function(t){return Na>=51||!Ma((function(){var e=[];return(e.constructor={})[ja]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},Fa=En.filter;wr({target:"Array",proto:!0,forced:!Va("filter")},{filter:function(t){return Fa(this,t,arguments.length>1?arguments[1]:void 0)}});var Ga=wr,za=a,Wa=_,Ha=n.f,Ya=i,Ka=za((function(){Ha(1)}));Ga({target:"Object",stat:!0,forced:!Ya||Ka,sham:!Ya},{getOwnPropertyDescriptor:function(t,e){return Ha(Wa(t),e)}});var qa={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Za=a,Qa=function(t,e){var r=[][t];return!!r&&Za((function(){r.call(null,e||function(){throw 1},1)}))},Xa=En.forEach,$a=r,Ja=qa,ti=Qa("forEach")?[].forEach:function(t){return Xa(this,t,arguments.length>1?arguments[1]:void 0)},ei=Wt;for(var ri in Ja){var ni=$a[ri],ai=ni&&ni.prototype;if(ai&&ai.forEach!==ti)try{ei(ai,"forEach",ti)}catch(t){ai.forEach=ti}}var ii=bt,oi=Ut,si=h,ui=function(t,e,r){var n=ii(e);n in t?oi.f(t,n,si(0,r)):t[n]=r},ci=nr,fi=_,li=n,hi=ui;function di(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function pi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function vi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function yi(t,e,r){return e&&vi(t.prototype,e),r&&vi(t,r),t}wr({target:"Object",stat:!0,sham:!i},{getOwnPropertyDescriptors:function(t){for(var e,r,n=fi(t),a=li.f,i=ci(n),o={},s=0;i.length>s;)void 0!==(r=a(n,e=i[s++]))&&hi(o,e,r);return o}});var mi=wr,gi=a,bi=Cr,ki=A,_i=Z,Ai=Le,wi=ui,Ti=kn,xi=Va,Si=I,Di=lt("isConcatSpreadable"),Ei=9007199254740991,Pi="Maximum allowed index exceeded",Oi=Si>=51||!gi((function(){var t=[];return t[Di]=!1,t.concat()[0]!==t})),Ci=xi("concat"),Bi=function(t){if(!ki(t))return!1;var e=t[Di];return void 0!==e?!!e:bi(t)};mi({target:"Array",proto:!0,forced:!Oi||!Ci},{concat:function(t){var e,r,n,a,i,o=_i(this),s=Ti(o,0),u=0;for(e=-1,n=arguments.length;e<n;e++)if(Bi(i=-1===e?o:arguments[e])){if(u+(a=Ai(i.length))>Ei)throw TypeError(Pi);for(r=0;r<a;r++,u++)r in i&&wi(s,u,i[r])}else{if(u>=Ei)throw TypeError(Pi);wi(s,u++,i)}return s.length=u,s}});var Ii=En.map;wr({target:"Array",proto:!0,forced:!Va("map")},{map:function(t){return Ii(this,t,arguments.length>1?arguments[1]:void 0)}});var Ui=Qr,Li=Ut,Ri=lt("unscopables"),Mi=Array.prototype;null==Mi[Ri]&&Li.f(Mi,Ri,{configurable:!0,value:Ui(null)});var Ni=function(t){Mi[Ri][t]=!0},ji=We.includes,Vi=Ni;wr({target:"Array",proto:!0},{includes:function(t){return ji(this,t,arguments.length>1?arguments[1]:void 0)}}),Vi("includes");var Fi=A,Gi=p,zi=lt("match"),Wi=function(t){var e;return Fi(t)&&(void 0!==(e=t[zi])?!!e:"RegExp"==Gi(t))},Hi=lt("match"),Yi=function(t){if(Wi(t))throw TypeError("The method doesn't accept regular expressions");return t},Ki=g,qi=Ir;wr({target:"String",proto:!0,forced:!function(t){var e=/./;try{"/./"[t](e)}catch(r){try{return e[Hi]=!1,"/./"[t](e)}catch(t){}}return!1}("includes")},{includes:function(t){return!!~qi(Ki(this)).indexOf(qi(Yi(t)),arguments.length>1?arguments[1]:void 0)}});var Zi={VIDEO:"video",AUDIO:"audio",METADATA:"metadata"},Qi={AVC:"avc",HEVC:"hevc"},Xi={AAC:"aac",G711PCMA:"g7110a",G711PCMU:"g7110m"},$i={LARGE_AV_SHIFT:"LARGE_AV_SHIFT",LARGE_VIDEO_GAP:"LARGE_VIDEO_GAP",LARGE_VIDEO_GAP_BETWEEN_CHUNK:"LARGE_VIDEO_GAP_BETWEEN_CHUNK",LARGE_AUDIO_GAP:"LARGE_AUDIO_GAP",AUDIO_FILLED:"AUDIO_FILLED",AUDIO_DROPPED:"AUDIO_DROPPED"},Ji=function(){function t(){pi(this,t),di(this,"id",1),di(this,"type",Zi.VIDEO),di(this,"codecType",Qi.AVC),di(this,"pid",-1),di(this,"hvcC",null),di(this,"codec",""),di(this,"timescale",0),di(this,"formatTimescale",0),di(this,"sequenceNumber",0),di(this,"baseMediaDecodeTime",0),di(this,"baseDts",0),di(this,"duration",0),di(this,"warnings",[]),di(this,"samples",[]),di(this,"pps",[]),di(this,"sps",[]),di(this,"vps",[]),di(this,"fpsNum",0),di(this,"fpsDen",0),di(this,"sarRatio",[]),di(this,"width",0),di(this,"height",0),di(this,"nalUnitSize",4),di(this,"present",!1),di(this,"ext",void 0)}return yi(t,[{key:"reset",value:function(){this.sequenceNumber=this.width=this.height=this.fpsDen=this.fpsNum=this.duration=this.baseMediaDecodeTime=this.timescale=0,this.codec="",this.present=!1,this.pid=-1,this.pps=[],this.sps=[],this.vps=[],this.sarRatio=[],this.samples=[],this.warnings=[],this.hvcC=null}},{key:"exist",value:function(){return!!(this.pps.length&&this.sps.length&&this.codec)}},{key:"hasSample",value:function(){return!!this.samples.length}}]),t}(),to=function(){function t(){pi(this,t),di(this,"id",2),di(this,"type",Zi.AUDIO),di(this,"codecType",Xi.AAC),di(this,"pid",-1),di(this,"codec",""),di(this,"sequenceNumber",0),di(this,"sampleDuration",0),di(this,"timescale",0),di(this,"formatTimescale",0),di(this,"baseMediaDecodeTime",0),di(this,"duration",0),di(this,"warnings",[]),di(this,"samples",[]),di(this,"baseDts",0),di(this,"sampleSize",16),di(this,"sampleRate",0),di(this,"channelCount",0),di(this,"objectType",0),di(this,"sampleRateIndex",0),di(this,"config",[]),di(this,"present",!1),di(this,"ext",void 0)}return yi(t,[{key:"reset",value:function(){this.sequenceNumber=0,this.timescale=0,this.sampleDuration=0,this.sampleRate=0,this.channelCount=0,this.baseMediaDecodeTime=0,this.present=!1,this.pid=-1,this.codec="",this.samples=[],this.config=[],this.warnings=[]}},{key:"exist",value:function(){return!!(this.sampleRate&&this.channelCount&&this.codec)}},{key:"hasSample",value:function(){return!!this.samples.length}}]),t}(),eo=function(){function t(e,r,n){pi(this,t),di(this,"flag",{}),di(this,"keyframe",!1),di(this,"gopId",0),di(this,"duration",0),di(this,"size",0),di(this,"units",[]),di(this,"chromaFormat",420),this.originPts=this.pts=e,this.originDts=this.dts=r,n&&(this.units=n)}return yi(t,[{key:"cts",get:function(){return this.pts-this.dts}},{key:"setToKeyframe",value:function(){this.keyframe=!0,this.flag.dependsOn=2,this.flag.isNonSyncSample=0}}]),t}(),ro=function t(e,r,n){pi(this,t),di(this,"duration",1024),di(this,"flag",{dependsOn:2,isNonSyncSample:0}),this.originPts=this.pts=this.dts=e,this.data=r,this.size=r.byteLength,n&&(this.duration=n)},no=dn,ao=A,io=[].slice,oo={},so=function(t,e,r){if(!(e in oo)){for(var n=[],a=0;a<e;a++)n[a]="a["+a+"]";oo[e]=Function("C,a","return new C("+n.join(",")+")")}return oo[e](t,r)},uo=Function.bind||function(t){var e=no(this),r=io.call(arguments,1),n=function(){var a=r.concat(io.call(arguments));return this instanceof n?so(e,a.length,a):e.apply(t,a)};return ao(e.prototype)&&(n.prototype=e.prototype),n},co=wr,fo=dn,lo=Rt,ho=A,po=Qr,vo=uo,yo=a,mo=x("Reflect","construct"),go=yo((function(){function t(){}return!(mo((function(){}),[],t)instanceof t)})),bo=!yo((function(){mo((function(){}))})),ko=go||bo;function _o(t,e){return(_o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ao(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&_o(t,e)}function wo(t){return(wo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function To(t,e){if(e&&("object"===wo(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function xo(t){return(xo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function So(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=xo(t);if(e){var a=xo(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return To(this,r)}}co({target:"Reflect",stat:!0,forced:ko,sham:ko},{construct:function(t,e){fo(t),lo(e);var r=arguments.length<3?t:fo(arguments[2]);if(bo&&!go)return mo(t,e,r);if(t==r){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var n=[null];return n.push.apply(n,e),new(vo.apply(t,n))}var a=r.prototype,i=po(ho(a)?a:Object.prototype),o=Function.apply.call(t,i,e);return ho(o)?o:i}});var Do=function t(e,r){pi(this,t),di(this,"time",0),this.data=e,this.originPts=this.pts=r},Eo=function(t){Ao(r,t);var e=So(r);function r(){return pi(this,r),e.apply(this,arguments)}return r}(Do),Po=function(t){Ao(r,t);var e=So(r);function r(){return pi(this,r),e.apply(this,arguments)}return r}(Do),Oo=function(){function t(){pi(this,t),di(this,"id",3),di(this,"type",Zi.METADATA),di(this,"timescale",0),di(this,"flvScriptSamples",[]),di(this,"seiSamples",[])}return yi(t,[{key:"exist",value:function(){return!(!this.flvScriptSamples.length&&!this.seiSamples.length||!this.timescale)}},{key:"reset",value:function(){this.timescale=0,this.flvScriptSamples=[],this.seiSamples=[]}},{key:"hasSample",value:function(){return!(!this.flvScriptSamples.length&&!this.seiSamples.length)}}]),t}(),Co=Object.freeze({__proto__:null,VideoTrack:Ji,AudioTrack:to,VideoSample:eo,AudioSample:ro,FlvScriptSample:Eo,SeiSample:Po,MetadataTrack:Oo,TrackType:Zi,VideoCodecType:Qi,AudioCodecType:Xi,WarningType:$i}),Bo=r.isFinite;wr({target:"Number",stat:!0},{isFinite:Number.isFinite||function(t){return"number"==typeof t&&Bo(t)}});var Io=A,Uo=Rt,Lo=function(t){if(!Io(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t},Ro=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(r,[]),e=r instanceof Array}catch(t){}return function(r,n){return Uo(r),Lo(n),e?t.call(r,n):r.__proto__=n,r}}():void 0),Mo=A,No=Ro,jo=function(t,e,r){var n,a;return No&&"function"==typeof(n=e.constructor)&&n!==r&&Mo(a=n.prototype)&&a!==r.prototype&&No(t,a),t},Vo=g,Fo=Ir,Go="[\t\n\v\f\r                 \u2028\u2029\ufeff]",zo=RegExp("^"+Go+Go+"*"),Wo=RegExp(Go+Go+"*$"),Ho=function(t){return function(e){var r=Fo(Vo(e));return 1&t&&(r=r.replace(zo,"")),2&t&&(r=r.replace(Wo,"")),r}},Yo={start:Ho(1),end:Ho(2),trim:Ho(3)},Ko=i,qo=r,Zo=vr,Qo=Ht.exports,Xo=$,$o=p,Jo=jo,ts=j,es=yt,rs=a,ns=Qr,as=Pe.f,is=n.f,os=Ut.f,ss=Yo.trim,us="Number",cs=qo.Number,fs=cs.prototype,ls=$o(ns(fs))==us,hs=function(t){if(ts(t))throw TypeError("Cannot convert a Symbol value to a number");var e,r,n,a,i,o,s,u,c=es(t,"number");if("string"==typeof c&&c.length>2)if(43===(e=(c=ss(c)).charCodeAt(0))||45===e){if(88===(r=c.charCodeAt(2))||120===r)return NaN}else if(48===e){switch(c.charCodeAt(1)){case 66:case 98:n=2,a=49;break;case 79:case 111:n=8,a=55;break;default:return+c}for(o=(i=c.slice(2)).length,s=0;s<o;s++)if((u=i.charCodeAt(s))<48||u>a)return NaN;return parseInt(i,n)}return+c};if(Zo(us,!cs(" 0o1")||!cs("0b1")||cs("+0x1"))){for(var ds,ps=function(t){var e=arguments.length<1?0:t,r=this;return r instanceof ps&&(ls?rs((function(){fs.valueOf.call(r)})):$o(r)!=us)?Jo(new cs(hs(e)),r,ps):hs(e)},vs=Ko?as(cs):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger,fromString,range".split(","),ys=0;vs.length>ys;ys++)Xo(cs,ds=vs[ys])&&!Xo(ps,ds)&&os(ps,ds,is(cs,ds));ps.prototype=fs,fs.constructor=ps,Qo(qo,us,ps)}var ms=wr,gs=je,bs=Be,ks=Le,_s=Z,As=kn,ws=ui,Ts=Va("splice"),xs=Math.max,Ss=Math.min,Ds=9007199254740991,Es="Maximum allowed length exceeded";ms({target:"Array",proto:!0,forced:!Ts},{splice:function(t,e){var r,n,a,i,o,s,u=_s(this),c=ks(u.length),f=gs(t,c),l=arguments.length;if(0===l?r=n=0:1===l?(r=0,n=c-f):(r=l-2,n=Ss(xs(bs(e),0),c-f)),c+r-n>Ds)throw TypeError(Es);for(a=As(u,n),i=0;i<n;i++)(o=f+i)in u&&ws(a,i,u[o]);if(a.length=n,r<n){for(i=f;i<c-n;i++)s=i+r,(o=i+n)in u?u[s]=u[o]:delete u[s];for(i=c;i>c-n+r;i--)delete u[i-1]}else if(r>n)for(i=c-n;i>f;i--)s=i+r-1,(o=i+n-1)in u?u[s]=u[o]:delete u[s];for(i=0;i<r;i++)u[i+f]=arguments[i+2];return u.length=c-n+r,a}});var Ps,Os,Cs,Bs={},Is=!a((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),Us=$,Ls=Z,Rs=Is,Ms=ae("IE_PROTO"),Ns=Object.prototype,js=Rs?Object.getPrototypeOf:function(t){return t=Ls(t),Us(t,Ms)?t[Ms]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?Ns:null},Vs=a,Fs=js,Gs=Wt,zs=$,Ws=lt("iterator"),Hs=!1;[].keys&&("next"in(Cs=[].keys())?(Os=Fs(Fs(Cs)))!==Object.prototype&&(Ps=Os):Hs=!0),(null==Ps||Vs((function(){var t={};return Ps[Ws].call(t)!==t})))&&(Ps={}),zs(Ps,Ws)||Gs(Ps,Ws,(function(){return this}));var Ys={IteratorPrototype:Ps,BUGGY_SAFARI_ITERATORS:Hs},Ks=Ys.IteratorPrototype,qs=Qr,Zs=h,Qs=hn,Xs=Bs,$s=function(){return this},Js=wr,tu=function(t,e,r){var n=e+" Iterator";return t.prototype=qs(Ks,{next:Zs(1,r)}),Qs(t,n,!1),Xs[n]=$s,t},eu=js,ru=Ro,nu=hn,au=Wt,iu=Ht.exports,ou=Bs,su=Ys.IteratorPrototype,uu=Ys.BUGGY_SAFARI_ITERATORS,cu=lt("iterator"),fu="keys",lu="values",hu="entries",du=function(){return this},pu=function(t,e,r,n,a,i,o){tu(r,e,n);var s,u,c,f=function(t){if(t===a&&v)return v;if(!uu&&t in d)return d[t];switch(t){case fu:case lu:case hu:return function(){return new r(this,t)}}return function(){return new r(this)}},l=e+" Iterator",h=!1,d=t.prototype,p=d[cu]||d["@@iterator"]||a&&d[a],v=!uu&&p||f(a),y="Array"==e&&d.entries||p;if(y&&(s=eu(y.call(new t)),su!==Object.prototype&&s.next&&(eu(s)!==su&&(ru?ru(s,su):"function"!=typeof s[cu]&&au(s,cu,du)),nu(s,l,!0))),a==lu&&p&&p.name!==lu&&(h=!0,v=function(){return p.call(this)}),d[cu]!==v&&au(d,cu,v),ou[e]=v,a)if(u={values:f(lu),keys:i?v:f(fu),entries:f(hu)},o)for(c in u)(uu||h||!(c in d))&&iu(d,c,u[c]);else Js({target:e,proto:!0,forced:uu||h},u);return u},vu=_,yu=Ni,mu=Bs,gu=ke,bu=pu,ku="Array Iterator",_u=gu.set,Au=gu.getterFor(ku),wu=bu(Array,"Array",(function(t,e){_u(this,{type:ku,target:vu(t),index:0,kind:e})}),(function(){var t=Au(this),e=t.target,r=t.kind,n=t.index++;return!e||n>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:e[n],done:!1}:{value:[n,e[n]],done:!1}}),"values");mu.Arguments=mu.Array,yu("keys"),yu("values"),yu("entries");var Tu={};Tu[lt("toStringTag")]="z";var xu="[object z]"===String(Tu),Su=xu,Du=p,Eu=lt("toStringTag"),Pu="Arguments"==Du(function(){return arguments}()),Ou=Su?Du:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),Eu))?r:Pu?Du(e):"Object"==(n=Du(e))&&"function"==typeof e.callee?"Arguments":n},Cu=Ou,Bu=xu?{}.toString:function(){return"[object "+Cu(this)+"]"},Iu=xu,Uu=Ht.exports,Lu=Bu;Iu||Uu(Object.prototype,"toString",Lu,{unsafe:!0});var Ru={exports:{}},Mu=lt("iterator"),Nu=!1;try{var ju=0,Vu={next:function(){return{done:!!ju++}},return:function(){Nu=!0}};Vu[Mu]=function(){return this},Array.from(Vu,(function(){throw 2}))}catch(t){}var Fu,Gu,zu,Wu=function(t,e){if(!e&&!Nu)return!1;var r=!1;try{var n={};n[Mu]=function(){return{next:function(){return{done:r=!0}}}},t(n)}catch(t){}return r},Hu="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,Yu=Hu,Ku=i,qu=r,Zu=A,Qu=$,Xu=Ou,$u=Wt,Ju=Ht.exports,tc=Ut.f,ec=js,rc=Ro,nc=lt,ac=et,ic=qu.Int8Array,oc=ic&&ic.prototype,sc=qu.Uint8ClampedArray,uc=sc&&sc.prototype,cc=ic&&ec(ic),fc=oc&&ec(oc),lc=Object.prototype,hc=lc.isPrototypeOf,dc=nc("toStringTag"),pc=ac("TYPED_ARRAY_TAG"),vc=ac("TYPED_ARRAY_CONSTRUCTOR"),yc=Yu&&!!rc&&"Opera"!==Xu(qu.opera),mc=!1,gc={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},bc={BigInt64Array:8,BigUint64Array:8},kc=function(t){if(!Zu(t))return!1;var e=Xu(t);return Qu(gc,e)||Qu(bc,e)};for(Fu in gc)(zu=(Gu=qu[Fu])&&Gu.prototype)?$u(zu,vc,Gu):yc=!1;for(Fu in bc)(zu=(Gu=qu[Fu])&&Gu.prototype)&&$u(zu,vc,Gu);if((!yc||"function"!=typeof cc||cc===Function.prototype)&&(cc=function(){throw TypeError("Incorrect invocation")},yc))for(Fu in gc)qu[Fu]&&rc(qu[Fu],cc);if((!yc||!fc||fc===lc)&&(fc=cc.prototype,yc))for(Fu in gc)qu[Fu]&&rc(qu[Fu].prototype,fc);if(yc&&ec(uc)!==fc&&rc(uc,fc),Ku&&!Qu(fc,dc))for(Fu in mc=!0,tc(fc,dc,{get:function(){return Zu(this)?this[pc]:void 0}}),gc)qu[Fu]&&$u(qu[Fu],pc,Fu);var _c={NATIVE_ARRAY_BUFFER_VIEWS:yc,TYPED_ARRAY_CONSTRUCTOR:vc,TYPED_ARRAY_TAG:mc&&pc,aTypedArray:function(t){if(kc(t))return t;throw TypeError("Target is not a typed array")},aTypedArrayConstructor:function(t){if(rc&&!hc.call(cc,t))throw TypeError("Target is not a typed array constructor");return t},exportTypedArrayMethod:function(t,e,r){if(Ku){if(r)for(var n in gc){var a=qu[n];if(a&&Qu(a.prototype,t))try{delete a.prototype[t]}catch(t){}}fc[t]&&!r||Ju(fc,t,r?e:yc&&oc[t]||e)}},exportTypedArrayStaticMethod:function(t,e,r){var n,a;if(Ku){if(rc){if(r)for(n in gc)if((a=qu[n])&&Qu(a,t))try{delete a[t]}catch(t){}if(cc[t]&&!r)return;try{return Ju(cc,t,r?e:yc&&cc[t]||e)}catch(t){}}for(n in gc)!(a=qu[n])||a[t]&&!r||Ju(a,t,e)}},isView:function(t){if(!Zu(t))return!1;var e=Xu(t);return"DataView"===e||Qu(gc,e)||Qu(bc,e)},isTypedArray:kc,TypedArray:cc,TypedArrayPrototype:fc},Ac=r,wc=a,Tc=Wu,xc=_c.NATIVE_ARRAY_BUFFER_VIEWS,Sc=Ac.ArrayBuffer,Dc=Ac.Int8Array,Ec=!xc||!wc((function(){Dc(1)}))||!wc((function(){new Dc(-1)}))||!Tc((function(t){new Dc,new Dc(null),new Dc(1.5),new Dc(t)}),!0)||wc((function(){return 1!==new Dc(new Sc(2),1,void 0).length})),Pc=Ht.exports,Oc=function(t,e,r){if(!(t instanceof e))throw TypeError("Incorrect "+(r?r+" ":"")+"invocation");return t},Cc=Be,Bc=Le,Ic=function(t){if(void 0===t)return 0;var e=Cc(t),r=Bc(e);if(e!==r)throw RangeError("Wrong length or index");return r},Uc=Math.abs,Lc=Math.pow,Rc=Math.floor,Mc=Math.log,Nc=Math.LN2,jc=Z,Vc=je,Fc=Le,Gc=function(t){for(var e=jc(this),r=Fc(e.length),n=arguments.length,a=Vc(n>1?arguments[1]:void 0,r),i=n>2?arguments[2]:void 0,o=void 0===i?r:Vc(i,r);o>a;)e[a++]=t;return e},zc=r,Wc=i,Hc=Hu,Yc=Wt,Kc=function(t,e,r){for(var n in e)Pc(t,n,e[n],r);return t},qc=a,Zc=Oc,Qc=Be,Xc=Le,$c=Ic,Jc={pack:function(t,e,r){var n,a,i,o=new Array(r),s=8*r-e-1,u=(1<<s)-1,c=u>>1,f=23===e?Lc(2,-24)-Lc(2,-77):0,l=t<0||0===t&&1/t<0?1:0,h=0;for((t=Uc(t))!=t||t===1/0?(a=t!=t?1:0,n=u):(n=Rc(Mc(t)/Nc),t*(i=Lc(2,-n))<1&&(n--,i*=2),(t+=n+c>=1?f/i:f*Lc(2,1-c))*i>=2&&(n++,i/=2),n+c>=u?(a=0,n=u):n+c>=1?(a=(t*i-1)*Lc(2,e),n+=c):(a=t*Lc(2,c-1)*Lc(2,e),n=0));e>=8;o[h++]=255&a,a/=256,e-=8);for(n=n<<e|a,s+=e;s>0;o[h++]=255&n,n/=256,s-=8);return o[--h]|=128*l,o},unpack:function(t,e){var r,n=t.length,a=8*n-e-1,i=(1<<a)-1,o=i>>1,s=a-7,u=n-1,c=t[u--],f=127&c;for(c>>=7;s>0;f=256*f+t[u],u--,s-=8);for(r=f&(1<<-s)-1,f>>=-s,s+=e;s>0;r=256*r+t[u],u--,s-=8);if(0===f)f=1-o;else{if(f===i)return r?NaN:c?-1/0:1/0;r+=Lc(2,e),f-=o}return(c?-1:1)*r*Lc(2,f-e)}},tf=js,ef=Ro,rf=Pe.f,nf=Ut.f,af=Gc,of=hn,sf=ke.get,uf=ke.set,cf="ArrayBuffer",ff="DataView",lf="Wrong index",hf=zc.ArrayBuffer,df=hf,pf=zc.DataView,vf=pf&&pf.prototype,yf=Object.prototype,mf=zc.RangeError,gf=Jc.pack,bf=Jc.unpack,kf=function(t){return[255&t]},_f=function(t){return[255&t,t>>8&255]},Af=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},wf=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},Tf=function(t){return gf(t,23,4)},xf=function(t){return gf(t,52,8)},Sf=function(t,e){nf(t.prototype,e,{get:function(){return sf(this)[e]}})},Df=function(t,e,r,n){var a=$c(r),i=sf(t);if(a+e>i.byteLength)throw mf(lf);var o=sf(i.buffer).bytes,s=a+i.byteOffset,u=o.slice(s,s+e);return n?u:u.reverse()},Ef=function(t,e,r,n,a,i){var o=$c(r),s=sf(t);if(o+e>s.byteLength)throw mf(lf);for(var u=sf(s.buffer).bytes,c=o+s.byteOffset,f=n(+a),l=0;l<e;l++)u[c+l]=f[i?l:e-l-1]};if(Hc){if(!qc((function(){hf(1)}))||!qc((function(){new hf(-1)}))||qc((function(){return new hf,new hf(1.5),new hf(NaN),hf.name!=cf}))){for(var Pf,Of=(df=function(t){return Zc(this,df),new hf($c(t))}).prototype=hf.prototype,Cf=rf(hf),Bf=0;Cf.length>Bf;)(Pf=Cf[Bf++])in df||Yc(df,Pf,hf[Pf]);Of.constructor=df}ef&&tf(vf)!==yf&&ef(vf,yf);var If=new pf(new df(2)),Uf=vf.setInt8;If.setInt8(0,2147483648),If.setInt8(1,2147483649),!If.getInt8(0)&&If.getInt8(1)||Kc(vf,{setInt8:function(t,e){Uf.call(this,t,e<<24>>24)},setUint8:function(t,e){Uf.call(this,t,e<<24>>24)}},{unsafe:!0})}else df=function(t){Zc(this,df,cf);var e=$c(t);uf(this,{bytes:af.call(new Array(e),0),byteLength:e}),Wc||(this.byteLength=e)},pf=function(t,e,r){Zc(this,pf,ff),Zc(t,df,ff);var n=sf(t).byteLength,a=Qc(e);if(a<0||a>n)throw mf("Wrong offset");if(a+(r=void 0===r?n-a:Xc(r))>n)throw mf("Wrong length");uf(this,{buffer:t,byteLength:r,byteOffset:a}),Wc||(this.buffer=t,this.byteLength=r,this.byteOffset=a)},Wc&&(Sf(df,"byteLength"),Sf(pf,"buffer"),Sf(pf,"byteLength"),Sf(pf,"byteOffset")),Kc(pf.prototype,{getInt8:function(t){return Df(this,1,t)[0]<<24>>24},getUint8:function(t){return Df(this,1,t)[0]},getInt16:function(t){var e=Df(this,2,t,arguments.length>1?arguments[1]:void 0);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=Df(this,2,t,arguments.length>1?arguments[1]:void 0);return e[1]<<8|e[0]},getInt32:function(t){return wf(Df(this,4,t,arguments.length>1?arguments[1]:void 0))},getUint32:function(t){return wf(Df(this,4,t,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(t){return bf(Df(this,4,t,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(t){return bf(Df(this,8,t,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(t,e){Ef(this,1,t,kf,e)},setUint8:function(t,e){Ef(this,1,t,kf,e)},setInt16:function(t,e){Ef(this,2,t,_f,e,arguments.length>2?arguments[2]:void 0)},setUint16:function(t,e){Ef(this,2,t,_f,e,arguments.length>2?arguments[2]:void 0)},setInt32:function(t,e){Ef(this,4,t,Af,e,arguments.length>2?arguments[2]:void 0)},setUint32:function(t,e){Ef(this,4,t,Af,e,arguments.length>2?arguments[2]:void 0)},setFloat32:function(t,e){Ef(this,4,t,Tf,e,arguments.length>2?arguments[2]:void 0)},setFloat64:function(t,e){Ef(this,8,t,xf,e,arguments.length>2?arguments[2]:void 0)}});of(df,cf),of(pf,ff);var Lf={ArrayBuffer:df,DataView:pf},Rf=A,Mf=Math.floor,Nf=Be,jf=function(t){var e=Nf(t);if(e<0)throw RangeError("The argument can't be less than 0");return e},Vf=function(t,e){var r=jf(t);if(r%e)throw RangeError("Wrong offset");return r},Ff=Ou,Gf=Bs,zf=lt("iterator"),Wf=function(t){if(null!=t)return t[zf]||t["@@iterator"]||Gf[Ff(t)]},Hf=Bs,Yf=lt("iterator"),Kf=Array.prototype,qf=function(t){return void 0!==t&&(Hf.Array===t||Kf[Yf]===t)},Zf=Z,Qf=Le,Xf=Wf,$f=qf,Jf=vn,tl=_c.aTypedArrayConstructor,el=x,rl=Ut,nl=i,al=lt("species"),il=wr,ol=r,sl=i,ul=Ec,cl=_c,fl=Lf,ll=Oc,hl=h,dl=Wt,pl=function(t){return!Rf(t)&&isFinite(t)&&Mf(t)===t},vl=Le,yl=Ic,ml=Vf,gl=bt,bl=$,kl=Ou,_l=A,Al=j,wl=Qr,Tl=Ro,xl=Pe.f,Sl=function(t){var e,r,n,a,i,o,s=Zf(t),u=arguments.length,c=u>1?arguments[1]:void 0,f=void 0!==c,l=Xf(s);if(null!=l&&!$f(l))for(o=(i=l.call(s)).next,s=[];!(a=o.call(i)).done;)s.push(a.value);for(f&&u>2&&(c=Jf(c,arguments[2],2)),r=Qf(s.length),n=new(tl(this))(r),e=0;r>e;e++)n[e]=f?c(s[e],e):s[e];return n},Dl=En.forEach,El=function(t){var e=el(t),r=rl.f;nl&&e&&!e[al]&&r(e,al,{configurable:!0,get:function(){return this}})},Pl=Ut,Ol=n,Cl=jo,Bl=ke.get,Il=ke.set,Ul=Pl.f,Ll=Ol.f,Rl=Math.round,Ml=ol.RangeError,Nl=fl.ArrayBuffer,jl=fl.DataView,Vl=cl.NATIVE_ARRAY_BUFFER_VIEWS,Fl=cl.TYPED_ARRAY_CONSTRUCTOR,Gl=cl.TYPED_ARRAY_TAG,zl=cl.TypedArray,Wl=cl.TypedArrayPrototype,Hl=cl.aTypedArrayConstructor,Yl=cl.isTypedArray,Kl="BYTES_PER_ELEMENT",ql="Wrong length",Zl=function(t,e){for(var r=0,n=e.length,a=new(Hl(t))(n);n>r;)a[r]=e[r++];return a},Ql=function(t,e){Ul(t,e,{get:function(){return Bl(this)[e]}})},Xl=function(t){var e;return t instanceof Nl||"ArrayBuffer"==(e=kl(t))||"SharedArrayBuffer"==e},$l=function(t,e){return Yl(t)&&!Al(e)&&e in t&&pl(+e)&&e>=0},Jl=function(t,e){return e=gl(e),$l(t,e)?hl(2,t[e]):Ll(t,e)},th=function(t,e,r){return e=gl(e),!($l(t,e)&&_l(r)&&bl(r,"value"))||bl(r,"get")||bl(r,"set")||r.configurable||bl(r,"writable")&&!r.writable||bl(r,"enumerable")&&!r.enumerable?Ul(t,e,r):(t[e]=r.value,t)};sl?(Vl||(Ol.f=Jl,Pl.f=th,Ql(Wl,"buffer"),Ql(Wl,"byteOffset"),Ql(Wl,"byteLength"),Ql(Wl,"length")),il({target:"Object",stat:!0,forced:!Vl},{getOwnPropertyDescriptor:Jl,defineProperty:th}),Ru.exports=function(t,e,r){var n=t.match(/\d+$/)[0]/8,a=t+(r?"Clamped":"")+"Array",i="get"+t,o="set"+t,s=ol[a],u=s,c=u&&u.prototype,f={},l=function(t,e){Ul(t,e,{get:function(){return function(t,e){var r=Bl(t);return r.view[i](e*n+r.byteOffset,!0)}(this,e)},set:function(t){return function(t,e,a){var i=Bl(t);r&&(a=(a=Rl(a))<0?0:a>255?255:255&a),i.view[o](e*n+i.byteOffset,a,!0)}(this,e,t)},enumerable:!0})};Vl?ul&&(u=e((function(t,e,r,i){return ll(t,u,a),Cl(_l(e)?Xl(e)?void 0!==i?new s(e,ml(r,n),i):void 0!==r?new s(e,ml(r,n)):new s(e):Yl(e)?Zl(u,e):Sl.call(u,e):new s(yl(e)),t,u)})),Tl&&Tl(u,zl),Dl(xl(s),(function(t){t in u||dl(u,t,s[t])})),u.prototype=c):(u=e((function(t,e,r,i){ll(t,u,a);var o,s,c,f=0,h=0;if(_l(e)){if(!Xl(e))return Yl(e)?Zl(u,e):Sl.call(u,e);o=e,h=ml(r,n);var d=e.byteLength;if(void 0===i){if(d%n)throw Ml(ql);if((s=d-h)<0)throw Ml(ql)}else if((s=vl(i)*n)+h>d)throw Ml(ql);c=s/n}else c=yl(e),o=new Nl(s=c*n);for(Il(t,{buffer:o,byteOffset:h,byteLength:s,length:c,view:new jl(o)});f<c;)l(t,f++)})),Tl&&Tl(u,zl),c=u.prototype=wl(Wl)),c.constructor!==u&&dl(c,"constructor",u),dl(c,Fl,u),Gl&&dl(c,Gl,a),f[a]=u,il({global:!0,forced:u!=s,sham:!Vl},f),Kl in u||dl(u,Kl,n),Kl in c||dl(c,Kl,n),El(a)}):Ru.exports=function(){},(0,Ru.exports)("Uint8",(function(t){return function(e,r,n){return t(this,e,r,n)}}));var eh=Z,rh=je,nh=Le,ah=Math.min,ih=[].copyWithin||function(t,e){var r=eh(this),n=nh(r.length),a=rh(t,n),i=rh(e,n),o=arguments.length>2?arguments[2]:void 0,s=ah((void 0===o?n:rh(o,n))-i,n-a),u=1;for(i<a&&a<i+s&&(u=-1,i+=s-1,a+=s-1);s-- >0;)i in r?r[a]=r[i]:delete r[a],a+=u,i+=u;return r},oh=_c.aTypedArray;(0,_c.exportTypedArrayMethod)("copyWithin",(function(t,e){return ih.call(oh(this),t,e,arguments.length>2?arguments[2]:void 0)}));var sh=En.every,uh=_c.aTypedArray;(0,_c.exportTypedArrayMethod)("every",(function(t){return sh(uh(this),t,arguments.length>1?arguments[1]:void 0)}));var ch=Gc,fh=_c.aTypedArray;(0,_c.exportTypedArrayMethod)("fill",(function(t){return ch.apply(fh(this),arguments)}));var lh=Rt,hh=dn,dh=lt("species"),ph=function(t,e){var r,n=lh(t).constructor;return void 0===n||null==(r=lh(n)[dh])?e:hh(r)},vh=_c.TYPED_ARRAY_CONSTRUCTOR,yh=_c.aTypedArrayConstructor,mh=function(t){return yh(ph(t,t[vh]))},gh=function(t,e){for(var r=0,n=e.length,a=new t(n);n>r;)a[r]=e[r++];return a},bh=mh,kh=En.filter,_h=function(t,e){return gh(bh(t),e)},Ah=_c.aTypedArray;(0,_c.exportTypedArrayMethod)("filter",(function(t){var e=kh(Ah(this),t,arguments.length>1?arguments[1]:void 0);return _h(this,e)}));var wh=En.find,Th=_c.aTypedArray;(0,_c.exportTypedArrayMethod)("find",(function(t){return wh(Th(this),t,arguments.length>1?arguments[1]:void 0)}));var xh=En.findIndex,Sh=_c.aTypedArray;(0,_c.exportTypedArrayMethod)("findIndex",(function(t){return xh(Sh(this),t,arguments.length>1?arguments[1]:void 0)}));var Dh=En.forEach,Eh=_c.aTypedArray;(0,_c.exportTypedArrayMethod)("forEach",(function(t){Dh(Eh(this),t,arguments.length>1?arguments[1]:void 0)}));var Ph=We.includes,Oh=_c.aTypedArray;(0,_c.exportTypedArrayMethod)("includes",(function(t){return Ph(Oh(this),t,arguments.length>1?arguments[1]:void 0)}));var Ch=We.indexOf,Bh=_c.aTypedArray;(0,_c.exportTypedArrayMethod)("indexOf",(function(t){return Ch(Bh(this),t,arguments.length>1?arguments[1]:void 0)}));var Ih=r,Uh=_c,Lh=wu,Rh=lt("iterator"),Mh=Ih.Uint8Array,Nh=Lh.values,jh=Lh.keys,Vh=Lh.entries,Fh=Uh.aTypedArray,Gh=Uh.exportTypedArrayMethod,zh=Mh&&Mh.prototype[Rh],Wh=!!zh&&("values"==zh.name||null==zh.name),Hh=function(){return Nh.call(Fh(this))};Gh("entries",(function(){return Vh.call(Fh(this))})),Gh("keys",(function(){return jh.call(Fh(this))})),Gh("values",Hh,!Wh),Gh(Rh,Hh,!Wh);var Yh=_c.aTypedArray,Kh=[].join;(0,_c.exportTypedArrayMethod)("join",(function(t){return Kh.apply(Yh(this),arguments)}));var qh=_,Zh=Be,Qh=Le,Xh=Qa,$h=Math.min,Jh=[].lastIndexOf,td=!!Jh&&1/[1].lastIndexOf(1,-0)<0,ed=Xh("lastIndexOf"),rd=td||!ed?function(t){if(td)return Jh.apply(this,arguments)||0;var e=qh(this),r=Qh(e.length),n=r-1;for(arguments.length>1&&(n=$h(n,Zh(arguments[1]))),n<0&&(n=r+n);n>=0;n--)if(n in e&&e[n]===t)return n||0;return-1}:Jh,nd=_c.aTypedArray;(0,_c.exportTypedArrayMethod)("lastIndexOf",(function(t){return rd.apply(nd(this),arguments)}));var ad=En.map,id=mh,od=_c.aTypedArray;(0,_c.exportTypedArrayMethod)("map",(function(t){return ad(od(this),t,arguments.length>1?arguments[1]:void 0,(function(t,e){return new(id(t))(e)}))}));var sd=dn,ud=Z,cd=m,fd=Le,ld=function(t){return function(e,r,n,a){sd(r);var i=ud(e),o=cd(i),s=fd(i.length),u=t?s-1:0,c=t?-1:1;if(n<2)for(;;){if(u in o){a=o[u],u+=c;break}if(u+=c,t?u<0:s<=u)throw TypeError("Reduce of empty array with no initial value")}for(;t?u>=0:s>u;u+=c)u in o&&(a=r(a,o[u],u,i));return a}},hd={left:ld(!1),right:ld(!0)},dd=hd.left,pd=_c.aTypedArray;(0,_c.exportTypedArrayMethod)("reduce",(function(t){return dd(pd(this),t,arguments.length,arguments.length>1?arguments[1]:void 0)}));var vd=hd.right,yd=_c.aTypedArray;(0,_c.exportTypedArrayMethod)("reduceRight",(function(t){return vd(yd(this),t,arguments.length,arguments.length>1?arguments[1]:void 0)}));var md=_c.aTypedArray,gd=_c.exportTypedArrayMethod,bd=Math.floor;gd("reverse",(function(){for(var t,e=this,r=md(e).length,n=bd(r/2),a=0;a<n;)t=e[a],e[a++]=e[--r],e[r]=t;return e}));var kd=Le,_d=Vf,Ad=Z,wd=_c.aTypedArray;(0,_c.exportTypedArrayMethod)("set",(function(t){wd(this);var e=_d(arguments.length>1?arguments[1]:void 0,1),r=this.length,n=Ad(t),a=kd(n.length),i=0;if(a+e>r)throw RangeError("Wrong length");for(;i<a;)this[e+i]=n[i++]}),a((function(){new Int8Array(1).set({})})));var Td=mh,xd=_c.aTypedArray,Sd=[].slice;(0,_c.exportTypedArrayMethod)("slice",(function(t,e){for(var r=Sd.call(xd(this),t,e),n=Td(this),a=0,i=r.length,o=new n(i);i>a;)o[a]=r[a++];return o}),a((function(){new Int8Array(1).slice()})));var Dd=En.some,Ed=_c.aTypedArray;(0,_c.exportTypedArrayMethod)("some",(function(t){return Dd(Ed(this),t,arguments.length>1?arguments[1]:void 0)}));var Pd=Math.floor,Od=function(t,e){var r=t.length,n=Pd(r/2);return r<8?Cd(t,e):Bd(Od(t.slice(0,n),e),Od(t.slice(n),e),e)},Cd=function(t,e){for(var r,n,a=t.length,i=1;i<a;){for(n=i,r=t[i];n&&e(t[n-1],r)>0;)t[n]=t[--n];n!==i++&&(t[n]=r)}return t},Bd=function(t,e,r){for(var n=t.length,a=e.length,i=0,o=0,s=[];i<n||o<a;)i<n&&o<a?s.push(r(t[i],e[o])<=0?t[i++]:e[o++]):s.push(i<n?t[i++]:e[o++]);return s},Id=Od,Ud=S.match(/firefox\/(\d+)/i),Ld=!!Ud&&+Ud[1],Rd=/MSIE|Trident/.test(S),Md=S.match(/AppleWebKit\/(\d+)\./),Nd=!!Md&&+Md[1],jd=a,Vd=dn,Fd=Le,Gd=Id,zd=Ld,Wd=Rd,Hd=I,Yd=Nd,Kd=_c.aTypedArray,qd=_c.exportTypedArrayMethod,Zd=r.Uint16Array,Qd=Zd&&Zd.prototype.sort,Xd=!!Qd&&!jd((function(){var t=new Zd(2);t.sort(null),t.sort({})})),$d=!!Qd&&!jd((function(){if(Hd)return Hd<74;if(zd)return zd<67;if(Wd)return!0;if(Yd)return Yd<602;var t,e,r=new Zd(516),n=Array(516);for(t=0;t<516;t++)e=t%4,r[t]=515-t,n[t]=t-2*e+3;for(r.sort((function(t,e){return(t/4|0)-(e/4|0)})),t=0;t<516;t++)if(r[t]!==n[t])return!0}));qd("sort",(function(t){var e=this;if(void 0!==t&&Vd(t),$d)return Qd.call(e,t);Kd(e);var r,n=Fd(e.length),a=Array(n);for(r=0;r<n;r++)a[r]=e[r];for(a=Gd(e,function(t){return function(e,r){return void 0!==t?+t(e,r)||0:r!=r?-1:e!=e?1:0===e&&0===r?1/e>0&&1/r<0?1:-1:e>r}}(t)),r=0;r<n;r++)e[r]=a[r];return e}),!$d||Xd);var Jd=Le,tp=je,ep=mh,rp=_c.aTypedArray;(0,_c.exportTypedArrayMethod)("subarray",(function(t,e){var r=rp(this),n=r.length,a=tp(t,n);return new(ep(r))(r.buffer,r.byteOffset+a*r.BYTES_PER_ELEMENT,Jd((void 0===e?n:tp(e,n))-a))}));var np=_c,ap=a,ip=r.Int8Array,op=np.aTypedArray,sp=np.exportTypedArrayMethod,up=[].toLocaleString,cp=[].slice,fp=!!ip&&ap((function(){up.call(new ip(1))}));sp("toLocaleString",(function(){return up.apply(fp?cp.call(op(this)):op(this),arguments)}),ap((function(){return[1,2].toLocaleString()!=new ip([1,2]).toLocaleString()}))||!ap((function(){ip.prototype.toLocaleString.call([1,2])})));var lp=_c.exportTypedArrayMethod,hp=a,dp=r.Uint8Array,pp=dp&&dp.prototype||{},vp=[].toString,yp=[].join;hp((function(){vp.call({})}))&&(vp=function(){return yp.call(this)});var mp=pp.toString!=vp;lp("toString",vp,mp);var gp=Rt,bp=function(){var t=gp(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e},kp=Ht.exports,_p=Rt,Ap=Ir,wp=a,Tp=bp,xp="toString",Sp=RegExp.prototype,Dp=Sp.toString,Ep=wp((function(){return"/a/b"!=Dp.call({source:"a",flags:"b"})})),Pp=Dp.name!=xp;(Ep||Pp)&&kp(RegExp.prototype,xp,(function(){var t=_p(this),e=Ap(t.source),r=t.flags;return"/"+e+"/"+Ap(void 0===r&&t instanceof RegExp&&!("flags"in Sp)?Tp.call(t):r)}),{unsafe:!0});var Op=function(){function t(e){if(pi(this,t),di(this,"_bytesAvailable",void 0),di(this,"_bitsAvailable",0),di(this,"_word",0),!e)throw new Error("ExpGolomb data params is required");this._data=e,this._bytesAvailable=e.byteLength,this._bytesAvailable&&this._loadWord()}return yi(t,[{key:"_loadWord",value:function(){var t=this._data.byteLength-this._bytesAvailable,e=Math.min(4,this._bytesAvailable);if(0===e)throw new Error("No bytes available");var r=new Uint8Array(4);r.set(this._data.subarray(t,t+e)),this._word=new DataView(r.buffer).getUint32(0),this._bitsAvailable=8*e,this._bytesAvailable-=e}},{key:"skipBits",value:function(t){if(this._bitsAvailable>t)this._word<<=t,this._bitsAvailable-=t;else{t-=this._bitsAvailable;var e=Math.floor(t/8);t-=8*e,this._bytesAvailable-=e,this._loadWord(),this._word<<=t,this._bitsAvailable-=t}}},{key:"readBits",value:function(t){if(t>32)throw new Error("Cannot read more than 32 bits");var e=Math.min(this._bitsAvailable,t),r=this._word>>>32-e;return this._bitsAvailable-=e,this._bitsAvailable>0?this._word<<=e:this._bytesAvailable>0&&this._loadWord(),(e=t-e)>0&&this._bitsAvailable?r<<e|this.readBits(e):r}},{key:"skipLZ",value:function(){var t;for(t=0;t<this._bitsAvailable;++t)if(0!=(this._word&2147483648>>>t))return this._word<<=t,this._bitsAvailable-=t,t;return this._loadWord(),t+this.skipLZ()}},{key:"skipUEG",value:function(){this.skipBits(1+this.skipLZ())}},{key:"readUEG",value:function(){var t=this.skipLZ();return this.readBits(t+1)-1}},{key:"readEG",value:function(){var t=this.readUEG();return 1&t?1+t>>>1:-1*(t>>>1)}},{key:"readBool",value:function(){return 1===this.readBits(1)}},{key:"readUByte",value:function(){return this.readBits(8)}},{key:"skipScalingList",value:function(t){for(var e=8,r=8,n=0;n<t;n++)0!==r&&(r=(e+this.readEG()+256)%256),e=0===r?e:r}}]),t}(),Cp=i,Bp=Ut.f,Ip=Function.prototype,Up=Ip.toString,Lp=/^\s*function ([^ (]*)/,Rp="name";Cp&&!(Rp in Ip)&&Bp(Ip,Rp,{configurable:!0,get:function(){try{return Up.call(this).match(Lp)[1]}catch(t){return""}}});var Mp=function(){function t(e){pi(this,t),this.name=e||"",this._prefix="[".concat(this.name,"]")}return yi(t,[{key:"warn",value:function(){var e;if(!t.disabled){for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];(e=console).warn.apply(e,[this._prefix].concat(n))}}}],[{key:"enable",value:function(){t.disabled=!1}},{key:"disable",value:function(){t.disabled=!0}}]),t}();di(Mp,"disabled",!0);var Np=wr,jp=_,Vp=[].join,Fp=m!=Object,Gp=Qa("join",",");Np({target:"Array",proto:!0,forced:Fp||!Gp},{join:function(t){return Vp.call(jp(this),void 0===t?",":t)}});var zp=function(){function t(){pi(this,t)}return yi(t,null,[{key:"decode",value:function(e){for(var r=[],n=e,a=0,i=e.length;a<i;)if(n[a]<128)r.push(String.fromCharCode(n[a])),++a;else{if(n[a]<192);else if(n[a]<224){if(t._checkContinuation(n,a,1)){var o=(31&n[a])<<6|63&n[a+1];if(o>=128){r.push(String.fromCharCode(65535&o)),a+=2;continue}}}else if(n[a]<240){if(t._checkContinuation(n,a,2)){var s=(15&n[a])<<12|(63&n[a+1])<<6|63&n[a+2];if(s>=2048&&55296!=(63488&s)){r.push(String.fromCharCode(65535&s)),a+=3;continue}}}else if(n[a]<248&&t._checkContinuation(n,a,3)){var u=(7&n[a])<<18|(63&n[a+1])<<12|(63&n[a+2])<<6|63&n[a+3];if(u>65536&&u<1114112){u-=65536,r.push(String.fromCharCode(u>>>10|55296)),r.push(String.fromCharCode(1023&u|56320)),a+=4;continue}}r.push(String.fromCharCode(65533)),++a}return r.join("")}},{key:"_checkContinuation",value:function(t,e,r){var n=t;if(e+r<n.length){for(;r--;)if(128!=(192&n[++e]))return!1;return!0}return!1}}]),t}(),Wp="undefined"!=typeof window,Hp=Wp&&navigator.userAgent.toLocaleLowerCase(),Yp=Wp&&/^((?!chrome|android).)*safari/.test(Hp),Kp=Wp&&Hp.includes("firefox"),qp=Wp&&Hp.includes("android");function Zp(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];e=e.filter(Boolean);var n=new Uint8Array(e.reduce((function(t,e){return t+e.byteLength}),0)),a=0;return e.forEach((function(t){n.set(t,a),a+=t.byteLength})),n}var Qp=Math.pow(2,32);function Xp(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(t[e]<<8)+(t[e+1]||0)}function $p(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(t[e]<<24>>>0)+(t[e+1]<<16)+(t[e+2]<<8)+(t[e+3]||0)}function Jp(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return $p(t,e)*Qp+$p(t,e+4)}function tv(t){for(var e,r="avc1.",n=0;n<3;n++)(e=t[n].toString(16)).length<2&&(e="0".concat(e)),r+=e;return r}var ev=function(){function t(){pi(this,t)}return yi(t,null,[{key:"parseAnnexB",value:function(t){for(var e=t.length,r=2,n=0;null!=t[r]&&1!==t[r];)r++;if((n=++r+2)>=e)return[];for(var a=[];n<e;)switch(t[n]){case 0:if(0!==t[n-1]){n+=2;break}if(0!==t[n-2]){n++;break}r!==n-2&&a.push(t.subarray(r,n-2));do{n++}while(1!==t[n]&&n<e);n=(r=n+1)+2;break;case 1:if(0!==t[n-1]||0!==t[n-2]){n+=3;break}r!==n-2&&a.push(t.subarray(r,n-2)),n=(r=n+1)+2;break;default:n+=3}return r<e&&a.push(t.subarray(r)),a}},{key:"parseAvcC",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4;if(!(t.length<4)){for(var r,n=t.length,a=[],i=0;i+e<n;)if(r=$p(t,i),3===e&&(r>>>=8),i+=e,r){if(i+r>n)break;a.push(t.subarray(i,i+r)),i+=r}return a}}},{key:"parseSEI",value:function(t){for(var e=t.length,r=1,n=0,a=0,i="";255===t[r];)n+=255,r++;for(n+=t[r++];255===t[r];)a+=255,r++;if(a+=t[r++],5===n&&e>r+16)for(var o=0;o<16;o++)i+=t[r].toString(16),r++;return{payload:t.subarray(r),type:n,size:a,uuid:i}}},{key:"removeEPB",value:function(t){for(var e=t.byteLength,r=[],n=1;n<e-2;)0===t[n]&&0===t[n+1]&&3===t[n+2]?(r.push(n+2),n+=2):n++;if(!r.length)return t;var a=e-r.length,i=new Uint8Array(a),o=0;for(n=0;n<a;o++,n++)o===r[0]&&(o++,r.shift()),i[n]=t[o];return i}}]),t}(),rv=function(){function t(){pi(this,t)}return yi(t,null,[{key:"parseAVCDecoderConfigurationRecord",value:function(e){if(!(e.length<7)){for(var r,n,a=1+(3&e[4]),i=[],o=[],s=6,u=31&e[5],c=0;c<u;c++)if(n=e[s]<<8|e[s+1],s+=2,n){var f=e.subarray(s,s+n);s+=n,i.push(f),r||(r=t.parseSPS(ev.removeEPB(f)))}var l,h=e[s];s++;for(var d=0;d<h;d++)l=e[s]<<8|e[s+1],s+=2,l&&(o.push(e.subarray(s,s+l)),s+=l);return{sps:r,spsArr:i,ppsArr:o,nalUnitSize:a}}}},{key:"parseSPS",value:function(t){var e=new Op(t);e.readUByte();var r=e.readUByte(),n=e.readUByte(),a=e.readUByte();e.skipUEG();var i=420;if(100===r||110===r||122===r||244===r||44===r||83===r||86===r||118===r||128===r||138===r||144===r){var o=e.readUEG();if(o<=3&&(i=[0,420,422,444][o]),3===o&&e.skipBits(1),e.skipUEG(),e.skipUEG(),e.skipBits(1),e.readBool())for(var s=3!==o?8:12,u=0;u<s;u++)e.readBool()&&(u<6?e.skipScalingList(16):e.skipScalingList(64))}e.skipUEG();var c=e.readUEG();if(0===c)e.readUEG();else if(1===c){e.skipBits(1),e.skipUEG(),e.skipUEG();for(var f=e.readUEG(),l=0;l<f;l++)e.skipUEG()}e.skipUEG(),e.skipBits(1);var h=e.readUEG(),d=e.readUEG(),p=e.readBits(1);0===p&&e.skipBits(1),e.skipBits(1);var v,y,m,g,b,k=0,_=0,A=0,w=0;if(e.readBool()&&(k=e.readUEG(),_=e.readUEG(),A=e.readUEG(),w=e.readUEG()),e.readBool()){if(e.readBool())switch(e.readUByte()){case 1:v=[1,1];break;case 2:v=[12,11];break;case 3:v=[10,11];break;case 4:v=[16,11];break;case 5:v=[40,33];break;case 6:v=[24,11];break;case 7:v=[20,11];break;case 8:v=[32,11];break;case 9:v=[80,33];break;case 10:v=[18,11];break;case 11:v=[15,11];break;case 12:v=[64,33];break;case 13:v=[160,99];break;case 14:v=[4,3];break;case 15:v=[3,2];break;case 16:v=[2,1];break;case 255:v=[e.readUByte()<<8|e.readUByte(),e.readUByte()<<8|e.readUByte()]}if(e.readBool()&&e.readBool(),e.readBool()&&(e.readBits(4),e.readBool()&&e.readBits(24)),e.readBool()&&(e.readUEG(),e.readUEG()),e.readBool()){var T=e.readBits(32),x=e.readBits(32);y=e.readBool(),b=(m=x)/(g=2*T)}}return{codec:tv(t.subarray(1,4)),profileIdc:r,profileCompatibility:n,levelIdc:a,chromaFormat:i,width:Math.ceil(16*(h+1)-2*(k+_)),height:(2-p)*(d+1)*16-(p?2:4)*(A+w),sarRatio:v,fpsNum:m,fpsDen:g,fps:b,fixedFrame:y}}}]),t}(),nv=function(){function t(){pi(this,t)}return yi(t,null,[{key:"getRateIndexByRate",value:function(e){return t.FREQ.indexOf(e)}},{key:"parseADTS",value:function(e,r){for(var n=e.length,a=0;a+2<n&&(255!==e[a]||240!=(246&e[a+1]));)a++;if(!(a>=n)){var i=a,o=[],s=(60&e[a+2])>>>2,u=t.FREQ[s];if(!u)throw new Error("Invalid sampling index: ".concat(s));for(var c,f,l=1+((192&e[a+2])>>>6),h=(1&e[a+2])<<2|(192&e[a+3])>>>6,d=t._getConfig(s,h,l),p=d.config,v=d.codec,y=0,m=t.getFrameDuration(u);a+7<n;)if(255===e[a]&&240==(246&e[a+1])){if(n-a<(f=(3&e[a+3])<<11|e[a+4]<<3|(224&e[a+5])>>5))break;c=2*(1&~e[a+1]),o.push({pts:r+y*m,data:e.subarray(a+7+c,a+f)}),y++,a+=f}else a++;return{skip:i,remaining:a>=n?void 0:e.subarray(a),frames:o,samplingFrequencyIndex:s,sampleRate:u,objectType:l,channelCount:h,codec:v,config:p,originCodec:"mp4a.40.".concat(l)}}}},{key:"parseAudioSpecificConfig",value:function(e){if(e.length){var r=e[0]>>>3,n=(7&e[0])<<1|e[1]>>>7,a=(120&e[1])>>>3,i=t.FREQ[n];if(!i)throw new Error("Invalid sampling index: ".concat(n));var o=t._getConfig(n,a,r);return{samplingFrequencyIndex:n,sampleRate:i,objectType:r,channelCount:a,config:o.config,codec:o.codec,originCodec:"mp4a.40.".concat(r)}}}},{key:"getFrameDuration",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9e4;return 1024*e/t}},{key:"_getConfig",value:function(t,e,r){var n,a,i=[];return Kp?t>=6?(n=5,a=t-3):(n=2,a=t):qp?(n=2,a=t):(n=r,a=t,t>=6?a=t-3:1===e&&(n=2,a=t)),i[0]=n<<3,i[0]|=(14&t)>>1,i[1]=(1&t)<<7,i[1]|=e<<3,5===n&&(i[1]|=(14&a)>>1,i[2]=(1&a)<<7,i[2]|=8,i[3]=0),{config:i,codec:"mp4a.40.".concat(n)}}},{key:"getSilentFrame",value:function(t,e){switch(t){case"mp4a.40.2":if(1===e)return new Uint8Array([0,200,0,128,35,128]);if(2===e)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(1===e)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===e)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===e)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}}}]),t}();di(nv,"FREQ",[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350]);var av=function(){function t(){pi(this,t)}return yi(t,null,[{key:"parseHEVCDecoderConfigurationRecord",value:function(e){if(!(e.length<23)){for(var r,n,a,i,o=1+(3&e[21]),s=[],u=[],c=[],f=23,l=e[22],h=0;h<l;h++){n=63&e[f],a=e[f+1]<<8|e[f+2],f+=3;for(var d=0;d<a;d++)if(i=e[f]<<8|e[f+1],f+=2,i){switch(n){case 32:c.push(e.subarray(f,f+i));break;case 33:var p=e.subarray(f,f+i);r||(r=t.parseSPS(ev.removeEPB(p))),s.push(p);break;case 34:u.push(e.subarray(f,f+i))}f+=i}}return{sps:r,spsArr:s,ppsArr:u,vpsArr:c,nalUnitSize:o}}}},{key:"parseSPS",value:function(t){var e=new Op(t);e.readUByte(),e.readUByte(),e.readBits(4);var r=e.readBits(3);e.readBits(1);var n=this._parseProfileTierLevel(e,r);e.readUEG();var a=e.readUEG(),i=420;a<=3&&(i=[0,420,422,444][a]);var o=0;3===a&&(o=e.readBits(1));var s,u,c,f,l=e.readUEG(),h=e.readUEG(),d=e.readBits(1);(1===d&&(s=e.readUEG(),u=e.readUEG(),c=e.readUEG(),f=e.readUEG()),1===d)&&(l-=(1!==a&&2!==a||0!==o?1:2)*(u+s),h-=(1===a&&0===o?2:1)*(f+c));return{codec:"hev1.1.6.L93.B0",width:l,height:h,chromaFormat:i,bitDepthLumaMinus8:e.readUEG(),bitDepthChromaMinus8:e.readUEG(),generalProfileSpace:n.generalProfileSpace,generalTierFlag:n.generalTierFlag,generalProfileIdc:n.generalProfileIdc,generalLevelIdc:n.generalLevelIdc}}},{key:"_parseProfileTierLevel",value:function(t,e){var r,n,a,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;i&&(r=t.readBits(2),n=t.readBits(1),a=t.readBits(5)),t.readBits(32),t.readBits(1),t.readBits(1),t.readBits(1),t.readBits(1),t.readBits(16),t.readBits(16),t.readBits(12);for(var o=t.readUByte(),s=[],u=[],c=0;c<e;c++)s[c]=t.readBits(1),u[c]=t.readBits(1);e>0&&t.readBits(2*(8-e));for(var f=0;f<e;f++)0!==s[f]&&(t.readBits(2),t.readBits(1),t.readBits(5),t.readBits(16),t.readBits(16),t.readBits(4),t.readBits(16),t.readBits(16),t.readBits(12)),0!==u[f]&&t.readBits(8);return{generalProfileSpace:r,generalTierFlag:n,generalProfileIdc:a,generalLevelIdc:o}}}]),t}(),iv=1e3,ov=5e3,sv=function(){function t(e,r,n){pi(this,t),this.videoTrack=e,this.audioTrack=r,this.metadataTrack=n,this._baseDts=-1,this._baseDtsInited=!1,this._audioNextPts=void 0,this._videoNextDts=void 0,this._audioTimestampBreak=0,this._videoTimestampBreak=0,this._lastAudioExceptionGapDot=-1/0,this._lastAudioExceptionOverlapDot=-1/0,this._lastAudioExceptionLargeGapDot=-1/0,this._lastVideoExceptionLargeGapDot=-1/0,this._lastVideoExceptionChunkFirstDtsDot=-1/0}return yi(t,[{key:"fix",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];e=Math.round(1e3*e);var a=this.videoTrack,i=this.audioTrack;if(!r&&n||(this._videoLastSample=null,this._audioNextPts=void 0,this._videoNextDts=void 0,this._audioTimestampBreak=0,this._videoTimestampBreak=0,this._lastAudioExceptionGapDot=-1/0,this._lastAudioExceptionOverlapDot=-1/0,this._lastAudioExceptionLargeGapDot=-1/0,this._lastVideoExceptionLargeGapDot=-1/0,this._lastVideoExceptionChunkFirstDtsDot=-1/0),r&&!n&&(this._baseDtsInited=!1),this._baseDtsInited||this._calculateBaseDts(i,a),this._baseDtsInited){if(!n&&e&&(this._audioNextPts=this._videoNextDts=e),this._resetBaseDtsWhenStreamBreaked(),this._fixAudio(i),this._fixVideo(a),this.metadataTrack.exist()){var o=this.metadataTrack.timescale;this.metadataTrack.seiSamples.forEach((function(e){e.pts=e.originPts-t._baseDts,e.time=Math.max(0,e.pts)/o})),this.metadataTrack.flvScriptSamples.forEach((function(e){e.pts=e.originPts-t._baseDts,e.time=Math.max(0,e.pts)/o}))}a.samples.length&&(a.baseMediaDecodeTime=a.samples[0].dts),i.samples.length&&(i.baseMediaDecodeTime=i.samples[0].pts*i.timescale/1e3)}}},{key:"_fixVideo",value:function(t){var e=this,r=t.samples;if(r.length){var n;if(r.forEach((function(t){t.dts-=e._baseDts,t.pts-=e._baseDts})),t.fpsNum&&t.fpsDen)n=t.timescale*(t.fpsDen/t.fpsNum);else{var a=t.samples[0],i=t.samples[r.length-1];n=Math.floor((i.dts-a.dts)/(r.length-1))}var o=r.pop();if(this._videoLastSample&&r.unshift(this._videoLastSample),this._videoLastSample=o,r.length){if(void 0===this._videoNextDts){var s=r[0];this._videoNextDts=s.dts}var u=r.length,c=0,f=r[0],l=this._videoNextDts-f.dts;if(Math.abs(l)>200){var h;if(Math.abs(f.dts-this._lastVideoExceptionChunkFirstDtsDot)>5e3)this._lastVideoExceptionChunkFirstDtsDot=f.dts,t.warnings.push({type:$i.LARGE_VIDEO_GAP_BETWEEN_CHUNK,nextDts:this._videoNextDts,firstSampleDts:f.dts,nextSampleDts:null===(h=r[1])||void 0===h?void 0:h.dts,sampleDuration:l});this._videoTimestampBreak>=5?(this._videoNextDts=f.dts,this._videoTimestampBreak=0):(f.dts+=l,f.pts+=l)}for(var d=0;d<u;d++){var p=r[d].dts,v=r[d+1];((c=d<u-1?v.dts-p:o?o.dts-p:n)>1e3||c<0)&&(this._videoTimestampBreak++,Math.abs(p-this._lastVideoExceptionLargeGapDot)>5e3&&(this._lastVideoExceptionLargeGapDot=p,t.warnings.push({type:$i.LARGE_VIDEO_GAP,time:p/t.timescale,dts:p,originDts:r[d].originDts,nextDts:this._videoNextDts,sampleDuration:c,refSampleDuration:n})),c=n),r[d].duration=c,this._videoNextDts+=c}}}}},{key:"_fixAudio",value:function(t){var e=this,r=t.samples;r.length&&(r.forEach((function(t){t.dts=t.pts-=e._baseDts})),this._doFixAudioInternal(t,r,1e3))}},{key:"_calculateBaseDts",value:function(t,e){var r=t.samples,n=e.samples;if(!r.length&&!n.length)return!1;var a=1/0,i=1/0;r.length&&(t.baseDts=a=r[0].pts),n.length&&(e.baseDts=i=n[0].dts),this._baseDts=Math.min(a,i);var o=i-a;return Number.isFinite(o)&&Math.abs(o)>500&&e.warnings.push({type:$i.LARGE_AV_SHIFT,videoBaseDts:i,audioBasePts:a,baseDts:this._baseDts,delta:o}),this._baseDtsInited=!0,!0}},{key:"_resetBaseDtsWhenStreamBreaked",value:function(){if(this._baseDtsInited&&this._videoTimestampBreak&&this._audioTimestampBreak){if(!this._calculateBaseDts(this.audioTrack,this.videoTrack))return;this._baseDts-=Math.min(this._audioNextPts,this._videoNextDts),this._videoLastSample=null,this._videoTimestampBreak=0,this._audioTimestampBreak=0}}},{key:"_doFixAudioInternal",value:function(t,e,r){t.sampleDuration||(t.sampleDuration=t.codecType===Xi.AAC?nv.getFrameDuration(t.timescale,r):this._getG711Duration(t));var n=t.sampleDuration,a=t.codecType===Xi.AAC?1024:n*t.timescale/1e3;if(void 0===this._audioNextPts){var i=e[0];this._audioNextPts=i.pts}for(var o=0;o<e.length;o++){var s=this._audioNextPts,u=e[o],c=u.pts-s;if(0===o&&this._audioTimestampBreak>=5&&(s=this._audioNextPts=u.dts,c=0,this._audioTimestampBreak=0),!this._audioTimestampBreak&&c>=3*n&&c<=iv&&!Yp){var f=this._getSilentFrame(t)||e[0].data.subarray(),l=Math.floor(c/n);Math.abs(u.pts-this._lastAudioExceptionGapDot)>ov&&(this._lastAudioExceptionGapDot=u.pts,t.warnings.push({type:$i.AUDIO_FILLED,pts:u.pts,originPts:u.originPts,count:l,nextPts:s,refSampleDuration:n}));for(var h=0;h<l;h++){var d=new ro(Math.floor(this._audioNextPts+n)-Math.floor(this._audioNextPts),f,a);d.originPts=Math.floor(this._baseDts+s),e.splice(o,0,d),this._audioNextPts+=n,o++}o--}else c<=-3*n&&c>=-1e3?(Math.abs(u.pts-this._lastAudioExceptionOverlapDot)>ov&&(this._lastAudioExceptionOverlapDot=u.pts,t.warnings.push({type:$i.AUDIO_DROPPED,pts:u.pts,originPts:u.originPts,nextPts:s,refSampleDuration:n})),e.splice(o,1),o--):(Math.abs(c)>iv&&(this._audioTimestampBreak++,Math.abs(u.pts-this._lastAudioExceptionLargeGapDot)>ov&&(this._lastAudioExceptionLargeGapDot=u.pts,t.warnings.push({type:$i.LARGE_AUDIO_GAP,time:u.pts/1e3,pts:u.pts,originPts:u.originPts,nextPts:s,sampleDuration:c,refSampleDuration:n}))),u.dts=u.pts=s,u.duration=a,this._audioNextPts+=n)}}},{key:"_getG711Duration",value:function(t){var e=t.sampleSize,r=t.channelCount,n=t.sampleRate,a=t.samples[0];if(a)return 2*a.data.byteLength/r/(e/8)/n*1e3}},{key:"_getSilentFrame",value:function(t){return t.codecType===Xi.AAC?nv.getSilentFrame(t.codec,t.channelCount):new Uint8Array(8*t.sampleDuration*t.channelCount)}}]),t}(),uv=function(){function t(){pi(this,t)}return yi(t,null,[{key:"parse",value:function(e){if(!(e.length<3)){var r={},n=t._parseValue(new DataView(e.buffer,e.byteOffset,e.byteLength)),a=t._parseValue(new DataView(e.buffer,e.byteOffset+n.size,e.byteLength-n.size));return r[n.data]=a.data,r}}},{key:"_parseValue",value:function(e){var r,n=e.byteLength,a=1,i=!1;switch(e.getUint8(0)){case 0:r=e.getFloat64(1),a+=8;break;case 1:r=!!e.getUint8(1),a+=1;break;case 2:var o=t._parseString(new DataView(e.buffer,e.byteOffset+a,e.byteLength-a));r=o.data,a+=o.size;break;case 3:r={};var s=0;for(9==(16777215&e.getUint32(n-4))&&(s=3);a<n-4;){var u=t._parseObject(new DataView(e.buffer,e.byteOffset+a,e.byteLength-a-s)),c=u.size,f=u.data;if(u.isEnd)break;r[f.name]=f.value,a+=c}if(a<=n-3)9===(16777215&e.getUint32(a-1))&&(a+=3);break;case 8:r={},a+=4;var l=0;for(9==(16777215&e.getUint32(n-4))&&(l=3);a<n-8;){var h=t._parseObject(new DataView(e.buffer,e.byteOffset+a,e.byteLength-a-l)),d=h.size,p=h.data;if(h.isEnd)break;r[p.name]=p.value,a+=d}if(a<=n-3)9===(16777215&e.getUint32(a-1))&&(a+=3);break;case 9:r=void 0,a=1,i=!0;break;case 10:r=[];var v=e.getUint32(1);a+=4;for(var y=0;y<v;y++){var m=t._parseValue(new DataView(e.buffer,e.byteOffset+a,e.byteLength-a)),g=m.data,b=m.size;r.push(g),a+=b}break;case 11:var k=e.getFloat64(a)+6e4*e.getInt16(a+8);r=new Date(k),a+=10;break;case 12:var _=e.getUint32(1);a+=4,r="",_>0&&(r=zp.decode(new Uint8Array(e.buffer,e.byteOffset+a,_))),a+=_;break;default:a=n}return{data:r,size:a,isEnd:i}}},{key:"_parseString",value:function(t){var e=t.getUint16(0),r="";return e>0&&(r=zp.decode(new Uint8Array(t.buffer,t.byteOffset+2,e))),{data:r,size:2+e}}},{key:"_parseObject",value:function(e){if(!(e.byteLength<3)){var r=t._parseString(e),n=t._parseValue(new DataView(e.buffer,e.byteOffset+r.size,e.byteLength-r.size));return{data:{name:r.data,value:n.data},size:r.size+n.size,isEnd:n.isEnd}}}}]),t}(),cv=new Mp("FlvDemuxer"),fv=function(){function t(e,r,n){pi(this,t),di(this,"_headerParsed",!1),di(this,"_remainingData",null),di(this,"_gopId",0),di(this,"_needAddMetaBeforeKeyFrameNal",!0),this.videoTrack=e||new Ji,this.audioTrack=r||new to,this.metadataTrack=n||new Oo,this._fixer=new sv(this.videoTrack,this.audioTrack,this.metadataTrack)}return yi(t,[{key:"demux",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=this.audioTrack,i=this.videoTrack,o=this.metadataTrack;if(!r&&n||(this._remainingData=null,this._headerParsed=!1),r?(i.reset(),a.reset(),o.reset()):(i.samples=[],a.samples=[],o.seiSamples=[],o.flvScriptSamples=[],i.warnings=[],a.warnings=[],this._remainingData&&(e=Zp(this._remainingData,e),this._remainingData=null)),!e.length)return{videoTrack:i,audioTrack:a,metadataTrack:o};var s=0;if(!this._headerParsed){if(!t.probe(e))throw new Error("Invalid flv file");a.present=(4&e[4])>>>2!=0,i.present=0!=(1&e[4]),this._headerParsed=!0,s=$p(e,5)+4}for(var u,c,f,l,h,d=e.length;s+15<d&&(u=e[s],!(s+15+(c=e[s+1]<<16|e[s+2]<<8|e[s+3])>d));)f=(e[s+7]<<24>>>0)+(e[s+4]<<16)+(e[s+5]<<8)+e[s+6],s+=11,l=e.subarray(s,s+c),8===u?this._parseAudio(l,f):9===u?this._parseVideo(l,f):18===u?this._parseScript(l,f):cv.warn("Invalid tag type: ".concat(u)),(h=$p(e,s+=c))!==11+c&&cv.warn("Invalid PrevTagSize ".concat(h," (").concat(11+c,")")),s+=4;return s<d&&(this._remainingData=e.subarray(s)),a.formatTimescale=i.formatTimescale=i.timescale=o.timescale=1e3,a.timescale=a.sampleRate||0,!a.exist()&&a.hasSample()&&a.reset(),!i.exist()&&i.hasSample()&&i.reset(),{videoTrack:i,audioTrack:a,metadataTrack:o}}},{key:"fix",value:function(t,e,r){return this._fixer.fix(t,e,r),{videoTrack:this.videoTrack,audioTrack:this.audioTrack,metadataTrack:this.metadataTrack}}},{key:"demuxAndFix",value:function(t,e,r,n){return this.demux(t,e,r),this.fix(n,e,r)}},{key:"_parseAudio",value:function(e,r){if(e.length){var n=(240&e[0])>>>4,a=this.audioTrack;if(10!==n&&7!==n&&8!==n)return cv.warn("Unsupported sound format: ".concat(n)),void a.reset();if(10!==n){var i=(12&e[0])>>2,o=(2&e[0])>>1,s=1&e[0];a.sampleRate=t.AUDIO_RATE[i],a.sampleSize=o?16:8,a.channelCount=s+1}10===n?this._parseAac(e,r):this._parseG711(e,r,n)}}},{key:"_parseG711",value:function(t,e,r){var n=this.audioTrack;n.codecType=7===r?Xi.G711PCMA:Xi.G711PCMU,n.sampleRate=8e3,n.codec=n.codecType,n.samples.push(new ro(e,t.subarray(1)))}},{key:"_parseAac",value:function(t,e){var r=this.audioTrack;if(r.codecType=Xi.AAC,0===t[1]){var n=nv.parseAudioSpecificConfig(t.subarray(2));n?(r.codec=n.codec,r.channelCount=n.channelCount,r.sampleRate=n.sampleRate,r.config=n.config,r.objectType=n.objectType,r.sampleRateIndex=n.samplingFrequencyIndex):(r.reset(),cv.warn("Cannot parse AudioSpecificConfig",t))}else if(1===t[1]){if(null==e)return;r.samples.push(new ro(e,t.subarray(2)))}else cv.warn("Unknown AACPacketType: ".concat(t[1]))}},{key:"_parseVideo",value:function(t,e){var r=this;if(!(t.length<6)){var n=(240&t[0])>>>4,a=15&t[0],i=this.videoTrack;if(7!==a&&12!==a)return i.reset(),void cv.warn("Unsupported codecId: ".concat(a));var o=12===a;i.codecType=o?Qi.HEVC:Qi.AVC;var s=t[1],u=(t[2]<<16|t[3]<<8|t[4])<<8>>8;if(0===s){var c=t.subarray(5),f=o?av.parseHEVCDecoderConfigurationRecord(c):rv.parseAVCDecoderConfigurationRecord(c);if(f){var l=f.sps,h=f.ppsArr,d=f.spsArr,p=f.vpsArr,v=f.nalUnitSize;l&&(i.codec=l.codec,i.width=l.width,i.height=l.height,i.sarRatio=l.sarRatio,i.fpsNum=l.fpsNum,i.fpsDen=l.fpsDen,i.chromaFormat=l.chromaFormat),d.length&&(i.sps=d),h.length&&(i.pps=h),p&&p.length&&(i.vps=p),v&&(i.nalUnitSize=v)}else cv.warn("Cannot parse ".concat(o?"HEVC":"AVC","DecoderConfigurationRecord"),t)}else if(1===s){var y=ev.parseAvcC(t.subarray(5),i.nalUnitSize);if((y=this._checkAddMetaNalToUnits(o,y,i))&&y.length){var m=new eo(e+u,e,y);1===n&&m.setToKeyframe(),i.samples.push(m),y.forEach((function(t){var n=o?t[0]>>>1&63:31&t[0];switch(n){case 5:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:if(!o&&5!==n||o&&5===n)break;m.setToKeyframe();break;case 6:case 39:case 40:if(!o&&6!==n||o&&6===n)break;r.metadataTrack.seiSamples.push(new Po(ev.parseSEI(ev.removeEPB(t)),e+u))}})),m.keyframe&&this._gopId++,m.gopId=this._gopId}else cv.warn("Cannot parse NALUs",t)}else 2===s||cv.warn("Unknown AVCPacketType: ".concat(s))}}},{key:"_checkAddMetaNalToUnits",value:function(t,e,r){return t&&this._needAddMetaBeforeKeyFrameNal?e.map((function(t){return t[0]>>>1&63})).includes(32)?(this._needAddMetaBeforeKeyFrameNal=!1,e):(e.unshift(r.pps[0]),e.unshift(r.sps[0]),e.unshift(r.vps[0]),e.filter(Boolean)):(this._needAddMetaBeforeKeyFrameNal=!1,e)}},{key:"_parseScript",value:function(t,e){this.metadataTrack.flvScriptSamples.push(new Eo(uv.parse(t),e))}}],[{key:"probe",value:function(t){return 70===t[0]&&76===t[1]&&86===t[2]&&1===t[3]&&$p(t,5)>=9}}]),t}();di(fv,"AUDIO_RATE",[5500,11e3,22e3,44e3]);var lv=Object.freeze({__proto__:null,FlvDemuxer:fv});function hv(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function dv(t,e){if(t){if("string"==typeof t)return hv(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?hv(t,e):void 0}}function pv(t){return function(t){if(Array.isArray(t))return hv(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||dv(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var vv=9e4,yv=45e4,mv=9e4,gv=function(){function t(e,r,n){pi(this,t),this.videoTrack=e,this.audioTrack=r,this.metadataTrack=n,this._baseDts=-1,this._baseDtsInited=!1,this._audioNextPts=void 0,this._videoNextDts=void 0,this._audioTimestampBreak=!1,this._videoTimestampBreak=!1,this._lastAudioExceptionGapDot=0,this._lastAudioExceptionOverlapDot=0,this._lastAudioExceptionLargeGapDot=0}return yi(t,[{key:"fix",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];e=Math.round(9e4*e);var a=this.videoTrack,i=this.audioTrack,o=a.samples,s=i.samples;if(o.length||s.length){var u=o[0],c=s[0],f=0;if(o.length&&s.length&&(f=u.dts-c.pts),this._baseDtsInited||this._calculateBaseDts(this.audioTrack,this.videoTrack),r&&(this._calculateBaseDts(this.audioTrack,this.videoTrack),this._baseDts-=e),!n){this._videoNextDts=f>0?e+f:e,this._audioNextPts=f>0?e:e-f;var l=u?u.dts-this._baseDts-this._videoNextDts:0,h=c?c.pts-this._baseDts-this._audioNextPts:0;Math.abs(l||h)>mv&&(this._calculateBaseDts(this.audioTrack,this.videoTrack),this._baseDts-=e)}if(this._resetBaseDtsWhenStreamBreaked(),this._fixAudio(i),this._fixVideo(a),this.metadataTrack.exist()){var d=this.metadataTrack.timescale;this.metadataTrack.seiSamples.forEach((function(e){e.pts=e.originPts-t._baseDts,e.time=Math.max(0,e.pts)/d}))}a.samples.length&&(a.baseMediaDecodeTime=a.samples[0].dts),i.samples.length&&(i.baseMediaDecodeTime=i.samples[0].pts*i.timescale/9e4)}}},{key:"_fixVideo",value:function(t){var e=this,r=t.samples;if(r.length){if(r.forEach((function(t){t.dts-=e._baseDts,t.pts-=e._baseDts})),void 0===this._videoNextDts){var n=r[0];this._videoNextDts=n.dts}var a,i,o=r.length,s=0,u=r[0],c=r[1],f=this._videoNextDts-u.dts;if(Math.abs(f)>45e3)u.dts+=f,u.pts+=f,t.warnings.push({type:$i.LARGE_VIDEO_GAP_BETWEEN_CHUNK,nextDts:this._videoNextDts,firstSampleDts:u.dts,nextSampleDts:null===(a=r[1])||void 0===a?void 0:a.dts,sampleDuration:f}),c&&Math.abs(c.dts-u.dts)>mv&&(this._videoTimestampBreak=!0,r.forEach((function(t,e){0!==e&&(t.dts+=f,t.pts+=f)})));if(t.fpsNum&&t.fpsDen)i=t.timescale*(t.fpsDen/t.fpsNum);else{var l=t.samples[0],h=t.samples[o-1];i=Math.floor((h.dts-l.dts)/(o-1))}for(var d=0;d<o;d++){var p=r[d].dts,v=r[d+1];if((s=d<o-1?v.dts-p:r[d-1]?p-r[d-1].dts:i)>mv||s<0){this._videoTimestampBreak=!0,s=this._audioTimestampBreak?i:s;var y=(this._audioNextDts||0)/1e3;Math.abs(p/1e3+s)>y&&(s=i),t.warnings.push({type:$i.LARGE_VIDEO_GAP,time:p/t.timescale,dts:p,originDts:r[d].originDts,nextDts:this._videoNextDts,sampleDuration:s,refSampleDuration:i})}r[d].duration=s,this._videoNextDts+=s}}}},{key:"_fixAudio",value:function(t){var e=this,r=t.samples;r.length&&(r.forEach((function(t){t.pts-=e._baseDts,t.dts=t.pts})),this._doFixAudioInternal(t,r,9e4))}},{key:"_calculateBaseDts",value:function(t,e){var r=t.samples,n=e.samples;if(!r.length&&!n.length)return!1;var a=1/0,i=1/0;r.length&&(t.baseDts=a=r[0].pts),n.length&&(e.baseDts=i=n[0].dts),this._baseDts=Math.min(a,i);var o=i-a;return Number.isFinite(o)&&Math.abs(o)>45e3&&e.warnings.push({type:$i.LARGE_AV_SHIFT,videoBaseDts:i,audioBasePts:a,baseDts:this._baseDts,delta:o}),this._baseDtsInited=!0,!0}},{key:"_resetBaseDtsWhenStreamBreaked",value:function(){if(this._baseDtsInited&&this._videoTimestampBreak&&this._audioTimestampBreak){if(!this._calculateBaseDts(this.audioTrack,this.videoTrack))return;this._baseDts-=Math.min(this._audioNextPts,this._videoNextDts),this._audioLastSample=null,this._videoLastSample=null,this._videoTimestampBreak=!1,this._audioTimestampBreak=!1}}},{key:"_doFixAudioInternal",value:function(t,e,r){t.sampleDuration||(t.sampleDuration=nv.getFrameDuration(t.timescale,r));var n=t.sampleDuration;if(void 0===this._audioNextPts){var a=e[0];this._audioNextPts=a.pts}for(var i=0;i<e.length;i++){var o=this._audioNextPts,s=e[i],u=s.pts-o;if(!this._audioTimestampBreak&&u>=3*n&&u<=vv&&!Yp){var c=nv.getSilentFrame(t.codec,t.channelCount)||e[0].data.subarray(),f=Math.floor(u/n);Math.abs(s.pts-this._lastAudioExceptionGapDot)>yv&&(this._lastAudioExceptionGapDot=s.pts),t.warnings.push({type:$i.AUDIO_FILLED,pts:s.pts,originPts:s.originPts,count:f,nextPts:o,refSampleDuration:n});for(var l=0;l<f;l++){var h=new ro(Math.floor(o),c);h.originPts=Math.floor(this._baseDts+o),e.splice(i,0,h),this._audioNextPts+=n,i++}i--}else u<=-3*n&&u>=-9e4?(Math.abs(s.pts-this._lastAudioExceptionOverlapDot)>yv&&(this._lastAudioExceptionOverlapDot=s.pts,t.warnings.push({type:$i.AUDIO_DROPPED,pts:s.pts,originPts:s.originPts,nextPts:o,refSampleDuration:n})),e.splice(i,1),i--):(Math.abs(u)>=vv&&(this._audioTimestampBreak=!0,Math.abs(s.pts-this._lastAudioExceptionLargeGapDot)>yv&&(this._lastAudioExceptionLargeGapDot=s.pts,t.warnings.push({type:$i.LARGE_AUDIO_GAP,time:s.pts/1e3,pts:s.pts,originPts:s.originPts,nextPts:o,sampleDuration:u,refSampleDuration:n}))),s.dts=s.pts=o,this._audioNextPts+=n)}}}]),t}(),bv=new Mp("TsDemuxer"),kv=function(){function t(e,r,n){pi(this,t),di(this,"_pmtId",-1),di(this,"_remainingPacketData",null),di(this,"_videoPesData",[]),di(this,"_audioPesData",[]),di(this,"_gopId",0),this.videoTrack=e||new Ji,this.audioTrack=r||new to,this.metadataTrack=n||new Oo,this._fixer=new gv(this.videoTrack,this.audioTrack,this.metadataTrack)}return yi(t,[{key:"demux",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=this.audioTrack,a=this.videoTrack,i=this.metadataTrack;e&&(this._pmtId=-1,a.reset(),n.reset(),i.reset()),!r||e?(this._remainingPacketData=null,this._videoPesData=[],this._audioPesData=[]):(a.samples=[],n.samples=[],i.seiSamples=[],a.warnings=[],n.warnings=[],this._remainingPacketData&&(t=Zp(this._remainingPacketData,t),this._remainingPacketData=null));var o=t.length,s=o%188;s&&(this._remainingPacketData=t.subarray(o-s),o-=s);for(var u=a.pid,c=n.pid,f=0;f<o;f+=188){if(71!==t[f])throw new Error("TS packet did not start with 0x47");var l=!!(64&t[f+1]),h=((31&t[f+1])<<8)+t[f+2],d=(48&t[f+3])>>4,p=void 0;if(d>1){if((p=f+5+t[f+4])===f+188)continue}else p=f+4;switch(h){case 0:l&&(p+=t[p]+1),this._pmtId=(31&t[p+10])<<8|t[p+11];break;case this._pmtId:l&&(p+=t[p]+1);var v=p+3+((15&t[p+1])<<8|t[p+2])-4,y=(15&t[p+10])<<8|t[p+11];for(p+=12+y;p<v;){var m=(31&t[p+1])<<8|t[p+2];switch(t[p]){case 15:n.pid=c=m;break;case 27:if(-1!==u)break;a.codecType=Qi.AVC,a.pid=u=m;break;case 36:if(-1!==u)break;a.codecType=Qi.HEVC,a.pid=u=m;break;default:bv.warn("Unsupported stream. type: ".concat(t[p],", pid: ").concat(m))}p+=5+((15&t[p+3])<<8|t[p+4])}break;case u:l&&this._videoPesData.length&&this._parseVideoData(),this._videoPesData.push(t.subarray(p,f+188));break;case c:l&&this._audioPesData.length&&this._parseAudioData(),this._audioPesData.push(t.subarray(p,f+188));break;case 17:case 8191:break;default:bv.warn("Unknown pid: ".concat(h))}}return this._parseVideoData(),this._parseAudioData(),n.formatTimescale=a.formatTimescale=a.timescale=i.timescale=9e4,n.timescale=n.sampleRate||0,{videoTrack:a,audioTrack:n,metadataTrack:i}}},{key:"fix",value:function(t,e,r){return this._fixer.fix(t,e,r),{videoTrack:this.videoTrack,audioTrack:this.audioTrack,metadataTrack:this.metadataTrack}}},{key:"demuxAndFix",value:function(t,e,r,n){return this.demux(t,e,r),this.fix(n,e,r)}},{key:"_parseVideoData",value:function(){if(this._videoPesData.length){var e=t._parsePES(Zp.apply(void 0,pv(this._videoPesData)));if(e){var r=ev.parseAnnexB(e.data);r?this._createVideoSample(r,e.pts,e.dts):bv.warn("Cannot parse avc units",e),this._videoPesData=[]}else bv.warn("Cannot parse video pes",this._videoPesData)}}},{key:"_createVideoSample",value:function(t,e,r){var n=this;if(t.length){var a=this.videoTrack,i=a.codecType===Qi.HEVC,o=new eo(e,r);t.forEach((function(t){var s=i?t[0]>>>1&63:31&t[0];switch(s){case 5:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:if(!i&&5!==s||i&&5===s)break;o.setToKeyframe(),n._gopId++;break;case 6:case 39:case 40:if(!i&&6!==s||i&&6===s)break;n.metadataTrack.seiSamples.push(new Po(ev.parseSEI(ev.removeEPB(t)),e));break;case 32:if(!i)break;a.vps=[t];break;case 7:case 33:if(!i&&7!==s||i&&7===s)break;if(!a.sps.length){var u=ev.removeEPB(t),c=i?av.parseSPS(u):rv.parseSPS(u);a.sps=[t],a.codec=c.codec,a.width=c.width,a.height=c.height,a.sarRatio=c.sarRatio,a.fpsNum=c.fpsNum,a.fpsDen=c.fpsDen}break;case 8:case 34:if(!i&&8!==s||i&&8===s)break;a.pps.length||(a.pps=[t]);break;case 9:case 35:if(!i&&9!==s||i&&9===s)break;o.gopId=n._gopId,o.units.length&&(n._pushVideoSample(a,o),o=n.prevAvcSample=new eo(e,r))}o.units.push(t)})),o.gopId=this._gopId,this._pushVideoSample(a,o)}}},{key:"_pushVideoSample",value:function(t,e){if(e.units.length){if(null==e.pts){bv.warn("Video sample no pts",e);var r=t.samples[t.samples.length-1];r?(e.pts=r.pts,e.dts=r.dts):bv.warn("Drop video sample",e)}null!=e.pts&&t.samples.push(e)}}},{key:"_parseAudioData",value:function(){if(this._audioPesData.length){var e=t._parsePES(Zp.apply(void 0,pv(this._audioPesData)));e?(this._parseAacData(e),this._audioPesData=[]):bv.warn("Cannot parse audio pes",this._audioPesData)}}},{key:"_parseAacData",value:function(t){var e=this.audioTrack,r=t.pts;if(null==r){if(bv.warn("AAC pes not pts",e),!e.samples.length||!e.sampleRate)return;r=e.samples[e.samples.length-1].pts+nv.getFrameDuration(e.sampleRate)}var n,a=nv.parseADTS(t.data,r);a?(e.codec=a.codec,e.channelCount=a.channelCount,e.sampleRate=a.sampleRate,e.objectType=a.objectType,e.sampleRateIndex=a.samplingFrequencyIndex,e.config=a.config,(n=e.samples).push.apply(n,pv(a.frames.map((function(t){return new ro(t.pts,t.data)})))),a.skip&&bv.warn("Skip aac adts ".concat(a.skip," bits")),a.remaining&&bv.warn("Remaining aac adts ".concat(a.remaining," bits"))):bv.warn("Cannot parse aac adts",t)}}],[{key:"probe",value:function(t){return!!t.length&&(71===t[0]&&71===t[188]&&71===t[376])}},{key:"_parsePES",value:function(t){var e=t[8];if(!(null==e||t.length<e+9)&&1===(t[0]<<16|t[1]<<8|t[2])){var r=(t[4]<<8)+t[5];if(!(r&&r>t.length-6)){var n,a,i=t[7];return 192&i&&(n=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2,64&i?n-(a=536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[18])/2)>54e5&&(n=a):a=n),{data:t.subarray(9+e),pts:n,dts:a}}}}}]),t}(),_v=Object.freeze({__proto__:null,TsDemuxer:kv});function Av(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,a,i=[],o=!0,s=!1;try{for(r=r.call(t);!(o=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);o=!0);}catch(t){s=!0,a=t}finally{try{o||null==r.return||r.return()}finally{if(s)throw a}}return i}}(t,e)||dv(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var wv=wr,Tv=En.find,xv=Ni,Sv="find",Dv=!0;Sv in[]&&Array(1).find((function(){Dv=!1})),wv({target:"Array",proto:!0,forced:Dv},{find:function(t){return Tv(this,t,arguments.length>1?arguments[1]:void 0)}}),xv(Sv);var Ev=Math.pow(2,32)-1,Pv=function(){function t(){pi(this,t)}return yi(t,null,[{key:"box",value:function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];var a=8+(r=r.filter(Boolean)).reduce((function(t,e){return t+e.byteLength}),0),i=new Uint8Array(a);i[0]=a>>24&255,i[1]=a>>16&255,i[2]=a>>8&255,i[3]=255&a,i.set(t,4);var o=8;return r.forEach((function(t){i.set(t,o),o+=t.byteLength})),i}},{key:"ftyp",value:function(e){return e.find((function(t){return t.type===Zi.VIDEO&&t.codecType===Qi.HEVC}))?t.FTYPHEV1:t.FTYPAVC1}},{key:"initSegment",value:function(e){return Zp(t.ftyp(e),t.moov(e))}},{key:"moov",value:function(e){return t.box.apply(t,[t.types.moov,t.mvhd(e[0].duration,e[0].timescale)].concat(pv(e.map((function(e){return t.trak(e)}))),[t.mvex(e)]))}},{key:"mvhd",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9e4;return t.box(t.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,r>>24&255,r>>16&255,r>>8&255,255&r,e>>24&255,e>>16&255,e>>8&255,255&e,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]))}},{key:"trak",value:function(e){return t.box(t.types.trak,t.tkhd(e.id,e.duration,e.width,e.height),t.mdia(e))}},{key:"tkhd",value:function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return t.box(t.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e,0,0,0,0,r>>24&255,r>>16&255,r>>8&255,255&r,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,n>>8&255,255&n,0,0,a>>8&255,255&a,0,0]))}},{key:"mdia",value:function(e){return t.box(t.types.mdia,t.mdhd(e.duration,e.timescale),t.hdlr(e.type),t.minf(e))}},{key:"mdhd",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9e4;return t.box(t.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,r>>24&255,r>>16&255,r>>8&255,255&r,e>>24&255,e>>16&255,e>>8&255,255&e,85,196,0,0]))}},{key:"hdlr",value:function(e){return t.box(t.types.hdlr,t.HDLR_TYPES[e])}},{key:"minf",value:function(e){return t.box(t.types.minf,e.type===Zi.VIDEO?t.VMHD:t.SMHD,t.DINF,t.stbl(e))}},{key:"stbl",value:function(e){return t.box(t.types.stbl,t.stsd(e),t.STTS,t.STSC,t.STSZ,t.STCO)}},{key:"stsd",value:function(e){return t.box(t.types.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),e.type===Zi.VIDEO?t.avc1hev1(e):t.mp4a(e))}},{key:"avc1hev1",value:function(e){var r=e.codecType===Qi.HEVC,n=r?t.types.hvc1:t.types.avc1,a=r?e.hvcC?e.hvcC:t.hvcC():t.avcC(e),i=[new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,e.width>>8&255,255&e.width,e.height>>8&255,255&e.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),a];return e.sarRatio&&e.sarRatio.length>1&&i.push(t.pasp(e.sarRatio)),t.box.apply(t,[n].concat(i))}},{key:"avcC",value:function(e){var r,n=[],a=[];return e.sps.forEach((function(t){r=t.byteLength,n.push(r>>>8&255),n.push(255&r),n.push.apply(n,pv(t))})),e.pps.forEach((function(t){r=t.byteLength,a.push(r>>>8&255),a.push(255&r),a.push.apply(a,pv(t))})),t.box(t.types.avcC,new Uint8Array([1,n[3],n[4],n[5],255,224|e.sps.length].concat(n).concat([e.pps.length]).concat(a)))}},{key:"hvcC",value:function(){return t.box(t.types.hvcC,new Uint8Array([1,1,96,0,0,0,144,0,0,0,0,0,93,240,0,252,253,248,248,0,0,15,3,160,0,1,0,24,64,1,12,1,255,255,1,96,0,0,3,0,144,0,0,3,0,0,3,0,93,153,152,9,161,0,1,0,45,66,1,1,1,96,0,0,3,0,144,0,0,3,0,0,3,0,93,160,2,128,128,45,22,89,153,164,147,43,154,128,128,128,130,0,0,3,0,2,0,0,3,0,50,16,162,0,1,0,7,68,1,193,114,180,98,64]))}},{key:"pasp",value:function(e){var r=Av(e,2),n=r[0],a=r[1];return t.box(t.types.pasp,new Uint8Array([n>>24,n>>16&255,n>>8&255,255&n,a>>24,a>>16&255,a>>8&255,255&a]))}},{key:"mp4a",value:function(e){return t.box(t.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,e.sampleRate>>8&255,255&e.sampleRate,0,0]),e.config.length?t.esds(e.config):void 0)}},{key:"esds",value:function(e){var r=e.length;return t.box(t.types.esds,new Uint8Array([0,0,0,0,3,23+r,0,0,0,4,15+r,64,21,0,6,0,0,0,218,192,0,0,218,192,5].concat([r]).concat(e).concat([6,1,2])))}},{key:"mvex",value:function(e){return t.box.apply(t,[t.types.mvex].concat(pv(e.map((function(e){return t.trex(e.id)})))))}},{key:"trex",value:function(e){return t.box(t.types.trex,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}},{key:"moof",value:function(e,r){return t.box.apply(t,[t.types.moof,t.mfhd(e)].concat(pv(r.map((function(e){return t.traf(e)})))))}},{key:"mfhd",value:function(e){return t.box(t.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e]))}},{key:"traf",value:function(e){return t.box(t.types.traf,t.tfhd(e.id),t.tfdt(e.baseMediaDecodeTime),t.trun(e.samples,76))}},{key:"tfhd",value:function(e){return t.box(t.types.tfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e]))}},{key:"tfdt",value:function(e){var r=Math.floor(e/(Ev+1)),n=Math.floor(e%(Ev+1));return t.box(t.types.tfdt,new Uint8Array([1,0,0,0,r>>24,r>>16&255,r>>8&255,255&r,n>>24,n>>16&255,n>>8&255,255&n]))}},{key:"trun",value:function(e,r){var n=e.length,a=12+16*n;r+=8+a;var i=new Uint8Array(a);i.set([0,0,15,1,n>>>24&255,n>>>16&255,n>>>8&255,255&n,r>>>24&255,r>>>16&255,r>>>8&255,255&r],0);for(var o=0;o<n;o++){var s=e[o],u=s.duration,c=s.size,f=s.flag,l=void 0===f?{}:f,h=s.cts,d=void 0===h?0:h;i.set([u>>>24&255,u>>>16&255,u>>>8&255,255&u,c>>>24&255,c>>>16&255,c>>>8&255,255&c,l.isLeading<<2|(null==l.dependsOn?1:l.dependsOn),l.isDependedOn<<6|l.hasRedundancy<<4|l.paddingValue<<1|(null==l.isNonSyncSample?1:l.isNonSyncSample),61440&l.degradationPriority,15&l.degradationPriority,d>>>24&255,d>>>16&255,d>>>8&255,255&d],12+16*o)}return t.box(t.types.trun,i)}},{key:"mdat",value:function(e){return t.box(t.types.mdat,e)}},{key:"moovMP4",value:function(e){return t.box.apply(t,[t.types.moov,t.mvhd(e[0].duration,e[0].timescale)].concat(pv(e.map((function(e){return t.trackMP4(e)})))))}},{key:"trackMP4",value:function(e){return t.box(t.types.trak,t.tkhd(e.id,e.duration,e.width,e.height),t.mdiaMP4(e))}},{key:"mdiaMP4",value:function(e){return t.box(t.types.mdia,t.mdhd(e.duration,e.timescale),t.hdlr(e.type),t.minfMP4(e))}},{key:"minfMP4",value:function(e){return t.box(t.types.minf,e.type===Zi.VIDEO?t.VMHD:t.SMHD,t.DINF,t.stblMP4(e))}},{key:"stblMP4",value:function(e){var r=e.ext,n=[t.stsd(e),t.stts(r.stts),t.stsc(r.stsc),t.stsz(r.stsz),t.stco(r.stco)];return r.stss.length&&n.push(t.stss(r.stss)),r.ctts.length&&n.push(t.ctts(r.ctts)),t.box.apply(t,[t.types.stbl].concat(n))}},{key:"stts",value:function(e){var r=e.length,n=new Uint8Array(8*r),a=0;return e.forEach((function(t){var e=t.value,r=t.count;n.set([r>>24,r>>16&255,r>>8&255,255&r,e>>24,e>>16&255,e>>8&255,255&e],a),a+=8})),t.box(t.types.stts,Zp(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"stsc",value:function(e){var r=e.length,n=new Uint8Array(12*r),a=0;return e.forEach((function(t){var e=t.firstChunk,r=t.samplesPerChunk,i=t.sampleDescIndex;n.set([e>>24,e>>16&255,e>>8&255,255&e,r>>24,r>>16&255,r>>8&255,255&r,i>>24,i>>16&255,i>>8&255,255&i],a),a+=12})),t.box(t.types.stsc,Zp(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"stsz",value:function(e){var r=e.length,n=new Uint8Array(4*r),a=0;return e.forEach((function(t){n.set([t>>24,t>>16&255,t>>8&255,255&t],a),a+=4})),t.box(t.types.stsz,Zp(new Uint8Array([0,0,0,0,0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"stco",value:function(e){var r=e.length,n=new Uint8Array(4*r),a=0;return e.forEach((function(t){n.set([t>>24,t>>16&255,t>>8&255,255&t],a),a+=4})),t.box(t.types.stco,Zp(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"stss",value:function(e){var r=e.length,n=new Uint8Array(4*r),a=0;return e.forEach((function(t){n.set([t>>24,t>>16&255,t>>8&255,255&t],a),a+=4})),t.box(t.types.stss,Zp(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"ctts",value:function(e){var r=e.length,n=new Uint8Array(8*r),a=0;return e.forEach((function(t){var e=t.value,r=t.count;n.set([r>>24,r>>16&255,r>>8&255,255&r,e>>24,e>>16&255,e>>8&255,255&e],a),a+=8})),t.box(t.types.ctts,Zp(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}}]),t}();di(Pv,"types",["avc1","avcC","hvc1","hvcC","dinf","dref","esds","ftyp","hdlr","mdat","mdhd","mdia","mfhd","minf","moof","moov","mp4a","mvex","mvhd","pasp","stbl","stco","stsc","stsd","stsz","stts","tfdt","tfhd","traf","trak","trun","trex","tkhd","vmhd","smhd","ctts","stss"].reduce((function(t,e){return t[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)],t}),Object.create(null))),di(Pv,"HDLR_TYPES",{video:new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),audio:new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0])}),di(Pv,"FTYPAVC1",Pv.box(Pv.types.ftyp,new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]))),di(Pv,"FTYPHEV1",Pv.box(Pv.types.ftyp,new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,104,101,118,49]))),di(Pv,"DINF",Pv.box(Pv.types.dinf,Pv.box(Pv.types.dref,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1])))),di(Pv,"VMHD",Pv.box(Pv.types.vmhd,new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]))),di(Pv,"SMHD",Pv.box(Pv.types.smhd,new Uint8Array([0,0,0,0,0,0,0,0]))),di(Pv,"StblTable",new Uint8Array([0,0,0,0,0,0,0,0])),di(Pv,"STTS",Pv.box(Pv.types.stts,Pv.StblTable)),di(Pv,"STSC",Pv.box(Pv.types.stsc,Pv.StblTable)),di(Pv,"STSZ",Pv.box(Pv.types.stsz,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]))),di(Pv,"STCO",Pv.box(Pv.types.stco,Pv.StblTable));var Ov=function(){function t(e,r){pi(this,t),this.name=e||"",this._prefix="[".concat(this.name,"]"),t.disabled=r}return yi(t,[{key:"debug",value:function(){var e;if(!t.disabled){for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];(e=console).debug.apply(e,[this._prefix].concat(n))}}},{key:"log",value:function(){var e;if(!t.disabled){for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];(e=console).log.apply(e,[this._prefix].concat(n))}}},{key:"warn",value:function(){var e;if(!t.disabled){for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];(e=console).warn.apply(e,[this._prefix].concat(n))}}},{key:"error",value:function(){var e;if(!t.disabled){for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];(e=console).error.apply(e,[this._prefix].concat(n))}}},{key:"table",value:function(){var e;t.disabled||(console.group(this._prefix),(e=console).table.apply(e,arguments),console.groupEnd())}}],[{key:"enable",value:function(){t.disabled=!1}},{key:"disable",value:function(){t.disabled=!0}}]),t}();di(Ov,"disabled",!0);var Cv=function(){function t(e,r,n){pi(this,t),this.videoTrack=e,this.audioTrack=r,this.log=new Ov("FMP4Remuxer",!n||!n.openLog||!n.openLog)}return yi(t,[{key:"remux",value:function(){var t,e,r,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],a=this.videoTrack,i=this.audioTrack,o=a.exist(),s=i.exist();a.duration=a.duration||4294967295,i.duration=i.duration||4294967295;var u,c,f=[];return n&&(o&&(t=Pv.initSegment([this.videoTrack])),s&&(e=Pv.initSegment([this.audioTrack])),o&&f.push(this.videoTrack),s&&f.push(this.audioTrack),r=Pv.initSegment(f)),o&&a.hasSample()&&(u=this._remuxVideo()),this.log.debug("[remuxVideo],len,",u?u.byteLength:0),s&&i.hasSample()&&(c=this._remuxAudio()),this.log.debug("[remuxAudio],len,",c?c.byteLength:0),a.samples=[],i.samples=[],{initSegment:r,videoInitSegment:t,audioInitSegment:e,videoSegment:u,audioSegment:c}}},{key:"_remuxVideo",value:function(){var t=this.videoTrack,e=t.samples,r=0;e.forEach((function(t){r+=t.units.reduce((function(t,e){return t+e.byteLength}),0),r+=4*t.units.length}));for(var n,a=new Uint8Array(r),i=new DataView(a.buffer),o=function(t,r,o,s){s=e[t];var u=0;s.units.forEach((function(t){i.setUint32(o,t.byteLength),o+=4,a.set(t,o),o+=t.byteLength,u+=4+t.byteLength})),s.size=u,c=o,n=s},s=0,u=e.length,c=0;s<u;s++)o(s,0,c,n);return Zp(Pv.moof(this.videoTrack.sequenceNumber++,[t]),Pv.mdat(a))}},{key:"_remuxAudio",value:function(){var t=this.audioTrack,e=Pv.moof(this.audioTrack.sequenceNumber++,[t]),r=new Uint8Array(t.samples.reduce((function(t,e){return t+e.size}),0));return t.samples.reduce((function(t,e){return r.set(e.data,t),t+e.size}),0),Zp(e,Pv.mdat(r))}},{key:"reset",value:function(){this.videoTrack.reset(),this.audioTrack.reset()}}]),t}(),Bv=function(){function t(e,r){pi(this,t),this.videoTrack=e,this.audioTrack=r}return yi(t,[{key:"remux",value:function(t,e){this.videoTrack=t||this.videoTrack,this.audioTrack=e||this.audioTrack;var r,n,a=(null==t?void 0:t.exist())&&(null==t?void 0:t.hasSample()),i=(null==e?void 0:e.exist())&&(null==e?void 0:e.hasSample());return a&&i?r=this._remuxMix(t,e):a?r=this._remuxTrack(t):i&&(n=this._remuxTrack(e)),t&&(t.samples=[]),e&&(e.samples=[]),{videoSegment:r,audioSegment:n}}},{key:"_remuxMix",value:function(t,e){var r=Pv.ftyp([t,e]),n=this._remuxData(t,r.byteLength+8),a=n.mdatData,i=n.chunkOffset,o=this._remuxData(e,i).mdatData,s=Pv.mdat(Zp(a,o)),u=Pv.moovMP4([t,e]);return t.ext=void 0,e.ext=void 0,t.samples=[],e.samples=[],Zp(r,s,u)}},{key:"_remuxTrack",value:function(t){var e=Pv.ftyp([t]),r=this._remuxData(t,e.byteLength+8).mdatData,n=Pv.mdat(r),a=Pv.moovMP4([t]);return t.ext=void 0,t.samples=[],Zp(e,n,a)}},{key:"_remuxData",value:function(t,e){var r=t.type===Zi.VIDEO,n=t.samples,a=0;r?n.forEach((function(t){a+=t.units.reduce((function(t,e){return t+e.byteLength}),0),a+=4*t.units.length})):a=n.reduce((function(t,e){return t+e.size}),0);for(var i,o=new Uint8Array(a),s=new DataView(o.buffer),u=t.ext={stts:[],stsc:[],stsz:[],stco:[],stss:[],ctts:[]},c=0,f=0,l=n.length,h=0;h<l;h++){f+=(i=n[h]).duration;var d=r?0:i.size;r?i.units.forEach((function(t){s.setUint32(c,t.byteLength),c+=4,o.set(t,c),c+=t.byteLength,d+=4+t.byteLength})):(o.set(i.data,c),c+=d),i.size=d,u.stsz.push(d),r&&this._fillCttsSamples(u.ctts,i.cts),this._fillSttsSamples(u.stts,i,n[h+1]),this._fillStcoSamples(u.stco,h,1,e),e+=d,r&&i.keyframe&&u.stss.push(h+1)}return t.duration=f,this._fillStscSamples(u.stsc,l,1),{mdatData:o,chunkOffset:e}}},{key:"_fillSttsSamples",value:function(t,e,r){var n=t[t.length-1];r?n&&n.value===e.duration?n.count++:t.push({value:e.duration,count:1}):n?n.count++:t.push({value:40,count:1})}},{key:"_fillCttsSamples",value:function(t,e){var r=t[t.length-1];r&&r.value===e?r.count++:t.push({value:e,count:1})}},{key:"_fillStcoSamples",value:function(t,e,r,n){e%r||t.push(n)}},{key:"_fillStscSamples",value:function(t,e,r){if(e<=r)t.push({firstChunk:1,samplesPerChunk:e,sampleDescIndex:1});else{var n=Math.floor(e/r),a=e%r;t.push({firstChunk:1,samplesPerChunk:r,sampleDescIndex:1}),a&&t.push({firstChunk:n+1,samplesPerChunk:a,sampleDescIndex:1})}}}]),t}(),Iv=wr,Uv=A,Lv=Cr,Rv=je,Mv=Le,Nv=_,jv=ui,Vv=lt,Fv=Va("slice"),Gv=Vv("species"),zv=[].slice,Wv=Math.max;Iv({target:"Array",proto:!0,forced:!Fv},{slice:function(t,e){var r,n,a,i=Nv(this),o=Mv(i.length),s=Rv(t,o),u=Rv(void 0===e?o:e,o);if(Lv(i)&&("function"!=typeof(r=i.constructor)||r!==Array&&!Lv(r.prototype)?Uv(r)&&null===(r=r[Gv])&&(r=void 0):r=void 0,r===Array||void 0===r))return zv.call(i,s,u);for(n=new(void 0===r?Array:r)(Wv(u-s,0)),a=0;s<u;s++,a++)s in i&&jv(n,a,i[s]);return n.length=a,n}});var Hv=r,Yv=qa,Kv=wu,qv=Wt,Zv=lt,Qv=Zv("iterator"),Xv=Zv("toStringTag"),$v=Kv.values;for(var Jv in Yv){var ty=Hv[Jv],ey=ty&&ty.prototype;if(ey){if(ey[Qv]!==$v)try{qv(ey,Qv,$v)}catch(t){ey[Qv]=$v}if(ey[Xv]||qv(ey,Xv,Jv),Yv[Jv])for(var ry in Kv)if(ey[ry]!==Kv[ry])try{qv(ey,ry,Kv[ry])}catch(t){ey[ry]=Kv[ry]}}}var ny=Be,ay=Ir,iy=g,oy=Le,sy=Ir,uy=function(t){var e=ay(iy(this)),r="",n=ny(t);if(n<0||n==1/0)throw RangeError("Wrong number of repetitions");for(;n>0;(n>>>=1)&&(e+=e))1&n&&(r+=e);return r},cy=g,fy=Math.ceil,ly=function(t){return function(e,r,n){var a,i,o=sy(cy(e)),s=o.length,u=void 0===n?" ":sy(n),c=oy(r);return c<=s||""==u?o:(a=c-s,(i=uy.call(u,fy(a/u.length))).length>a&&(i=i.slice(0,a)),t?o+i:i+o)}},hy={start:ly(!1),end:ly(!0)},dy=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(S),py=hy.start;wr({target:"String",proto:!0,forced:dy},{padStart:function(t){return py(this,t,arguments.length>1?arguments[1]:void 0)}});var vy=Rt,yy=Rt,my=function(t){var e=t.return;if(void 0!==e)return vy(e.call(t)).value},gy=vn,by=Z,ky=function(t,e,r,n){try{return n?e(yy(r)[0],r[1]):e(r)}catch(e){throw my(t),e}},_y=qf,Ay=Le,wy=ui,Ty=Wf,xy=function(t){var e,r,n,a,i,o,s=by(t),u="function"==typeof this?this:Array,c=arguments.length,f=c>1?arguments[1]:void 0,l=void 0!==f,h=Ty(s),d=0;if(l&&(f=gy(f,c>2?arguments[2]:void 0,2)),null==h||u==Array&&_y(h))for(r=new u(e=Ay(s.length));e>d;d++)o=l?f(s[d],d):s[d],wy(r,d,o);else for(i=(a=h.call(s)).next,r=new u;!(n=i.call(a)).done;d++)o=l?ky(a,f,[n.value,d],!0):n.value,wy(r,d,o);return r.length=d,r};wr({target:"Array",stat:!0,forced:!Wu((function(t){Array.from(t)}))},{from:xy});var Sy=Be,Dy=Ir,Ey=g,Py=function(t){return function(e,r){var n,a,i=Dy(Ey(e)),o=Sy(r),s=i.length;return o<0||o>=s?t?"":void 0:(n=i.charCodeAt(o))<55296||n>56319||o+1===s||(a=i.charCodeAt(o+1))<56320||a>57343?t?i.charAt(o):n:t?i.slice(o,o+2):a-56320+(n-55296<<10)+65536}},Oy={codeAt:Py(!1),charAt:Py(!0)}.charAt,Cy=Ir,By=ke,Iy=pu,Uy="String Iterator",Ly=By.set,Ry=By.getterFor(Uy);Iy(String,"String",(function(t){Ly(this,{type:Uy,string:Cy(t),index:0})}),(function(){var t,e=Ry(this),r=e.string,n=e.index;return n>=r.length?{value:void 0,done:!0}:(t=Oy(r,n),e.index+=t.length,{value:t,done:!1})}));var My=Ut,Ny=bp;i&&a((function(){return"sy"!==Object.getOwnPropertyDescriptor(RegExp.prototype,"flags").get.call({dotAll:!0,sticky:!0})}))&&My.f(RegExp.prototype,"flags",{configurable:!0,get:Ny});var jy=function(){function t(){pi(this,t)}return yi(t,null,[{key:"findBox",value:function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=[];if(!e)return a;for(var i=0,o="",s=0;e.length>7;){if(i=$p(e),o=String.fromCharCode.apply(null,e.subarray(4,8)),s=8,1===i?(i=Jp(e,8),s+=8):i||(i=e.length),!r[0]||o===r[0]){var u=e.subarray(0,i);if(!(r.length<2))return t.findBox(u.subarray(s),r.slice(1),n+s);a.push({start:n,size:i,headerSize:s,type:o,data:u})}n+=i,e=e.subarray(i)}return a}},{key:"moov",value:function(e){return Gy(e,!1,(function(e,r,n){e.mvhd=t.mvhd(t.findBox(r,["mvhd"],n)[0]),e.trak=t.findBox(r,["trak"],n).map((function(e){return t.trak(e)}))}))}},{key:"mvhd",value:function(t){return Gy(t,!0,(function(t,e){var r=0;1===t.version?(t.timescale=$p(e,16),t.duration=Jp(e,20),r+=28):(t.timescale=$p(e,8),t.duration=$p(e,12),r+=16),t.nextTrackId=$p(e,r+76)}))}},{key:"trak",value:function(e){return Gy(e,!1,(function(e,r,n){e.tkhd=t.tkhd(t.findBox(r,["tkhd"],n)[0]),e.mdia=t.mdia(t.findBox(r,["mdia"],n)[0])}))}},{key:"tkhd",value:function(t){return Gy(t,!0,(function(t,e){var r=0;1===t.version?(t.trackId=$p(e,16),t.duration=Jp(e,24),r+=32):(t.trackId=$p(e,8),t.duration=$p(e,16),r+=20),t.width=$p(e,r+52),t.height=$p(e,r+56)}))}},{key:"mdia",value:function(e){return Gy(e,!1,(function(e,r,n){e.mdhd=t.mdhd(t.findBox(r,["mdhd"],n)[0]),e.hdlr=t.hdlr(t.findBox(r,["hdlr"],n)[0]),e.minf=t.minf(t.findBox(r,["minf"],n)[0])}))}},{key:"mdhd",value:function(t){return Gy(t,!0,(function(t,e){var r=0;1===t.version?(t.timescale=$p(e,16),t.duration=Jp(e,20),r+=28):(t.timescale=$p(e,8),t.duration=$p(e,12),r+=16);var n=Xp(e,r);t.language=String.fromCharCode(96+(n>>10&31),96+(n>>5&31),96+(31&n))}))}},{key:"hdlr",value:function(t){return Gy(t,!0,(function(t,e){0===t.version&&(t.handlerType=String.fromCharCode.apply(null,e.subarray(4,8)))}))}},{key:"minf",value:function(e){return Gy(e,!1,(function(e,r,n){e.vmhd=t.vmhd(t.findBox(r,["vmhd"],n)[0]),e.smhd=t.smhd(t.findBox(r,["smhd"],n)[0]),e.stbl=t.stbl(t.findBox(r,["stbl"],n)[0])}))}},{key:"vmhd",value:function(t){return Gy(t,!0,(function(t,e){t.graphicsmode=Xp(e),t.opcolor=[Xp(e,2),Xp(e,4),Xp(e,6)]}))}},{key:"smhd",value:function(t){return Gy(t,!0,(function(t,e){t.balance=Xp(e)}))}},{key:"stbl",value:function(e){return Gy(e,!1,(function(e,r,n){e.stsd=t.stsd(t.findBox(r,["stsd"],n)[0]),e.stts=t.stts(t.findBox(r,["stts"],n)[0]),e.ctts=t.ctts(t.findBox(r,["ctts"],n)[0]),e.stsc=t.stsc(t.findBox(r,["stsc"],n)[0]),e.stsz=t.stsz(t.findBox(r,["stsz"],n)[0]),e.stco=t.stco(t.findBox(r,["stco"],n)[0]),e.stss=t.stss(t.findBox(r,["stss"],n)[0])}))}},{key:"stsd",value:function(e){return Gy(e,!0,(function(e,r,n){e.entryCount=$p(r),e.entries=t.findBox(r.subarray(4),[],n+4).map((function(e){switch(e.type){case"avc1":case"avc2":case"avc3":case"avc4":return t.avc1(e);case"hvc1":case"hev1":return t.hvc1(e);case"mp4a":return t.mp4a(e)}})).filter(Boolean)}))}},{key:"avc1",value:function(e){return Gy(e,!1,(function(e,r,n){var a=Fy(e,r),i=r.subarray(a);n+=a,e.avcC=t.avcC(t.findBox(i,["avcC"],n)[0]),e.pasp=t.pasp(t.findBox(i,["pasp"],n)[0])}))}},{key:"avcC",value:function(t){return Gy(t,!1,(function(t,e){t.configurationVersion=e[0],t.AVCProfileIndication=e[1],t.profileCompatibility=e[2],t.AVCLevelIndication=e[3],t.codec=tv([e[1],e[2],e[3]]),t.lengthSizeMinusOne=3&e[4],t.spsLength=31&e[5],t.sps=[];for(var r=6,n=0;n<t.spsLength;n++){var a=Xp(e,r);r+=2,t.sps.push(e.subarray(r,r+a)),r+=a}t.ppsLength=e[r],r+=1,t.pps=[];for(var i=0;i<t.ppsLength;i++){var o=Xp(e,r);r+=2,t.pps.push(e.subarray(r,r+=o)),r+=o}}))}},{key:"hvc1",value:function(e){return Gy(e,!1,(function(e,r,n){var a=Fy(e,r),i=r.subarray(a);n+=a,e.hvcC=t.hvcC(t.findBox(i,["hvcC"],n)[0]),e.pasp=t.pasp(t.findBox(i,["pasp"],n)[0])}))}},{key:"hvcC",value:function(t){return Gy(t,!1,(function(e,r){e.data=t.data,e.codec="hev1.1.6.L93.B0",e.configurationVersion=r[0];var n=r[1];e.generalProfileSpace=n>>6,e.generalTierFlag=(32&n)>>5,e.generalProfileIdc=31&n,e.generalProfileCompatibility=$p(r,2),e.generalConstraintIndicatorFlags=r.subarray(6,12),e.generalLevelIdc=r[12],e.avgFrameRate=Xp(r,19),e.numOfArrays=r[22],e.vps=[],e.sps=[],e.pps=[];for(var a=23,i=0,o=0,s=0,u=0;u<e.numOfArrays;u++){i=63&r[a],o=Xp(r,a+1),a+=3;for(var c,f=[],l=0;l<o;l++)s=Xp(r,a),a+=2,f.push(r.subarray(a,a+s)),a+=s;if(32===i)(c=e.vps).push.apply(c,f);else if(33===i){var h;(h=e.sps).push.apply(h,f)}else if(34===i){var d;(d=e.pps).push.apply(d,f)}}}))}},{key:"pasp",value:function(t){return Gy(t,!1,(function(t,e){t.hSpacing=$p(e),t.vSpacing=$p(e,4)}))}},{key:"mp4a",value:function(e){return Gy(e,!1,(function(e,r,n){var a=function(t,e){return t.dataReferenceIndex=Xp(e,6),t.channelCount=Xp(e,16),t.sampleSize=Xp(e,18),t.sampleRate=$p(e,24)/65536,28}(e,r);e.esds=t.esds(t.findBox(r.subarray(a),["esds"],n+a)[0])}))}},{key:"esds",value:function(t){return Gy(t,!0,(function(t,e){t.codec="mp4a.";for(var r=0,n=0,a=0,i=0;e.length;){for(i=e[r=0],n=e[r+1],r+=2;128&n;)a=(127&n)<<7,n=e[r],r+=1;if(a+=127&n,3===i)e=e.subarray(r+3);else{if(4!==i){if(5===i){var o=t.config=e.subarray(r,r+a),s=(248&o[0])>>3;return 31===s&&o.length>=2&&(s=32+((7&o[0])<<3)+((224&o[1])>>5)),t.objectType=s,void(t.codec+=s.toString(16))}return}t.codec+=(e[r].toString(16)+".").padStart(3,"0"),e=e.subarray(r+13)}}}))}},{key:"stts",value:function(t){return Gy(t,!0,(function(t,e){for(var r=$p(e),n=[],a=4,i=0;i<r;i++)n.push({count:$p(e,a),delta:$p(e,a+4)}),a+=8;t.entryCount=r,t.entries=n}))}},{key:"ctts",value:function(t){return Gy(t,!0,(function(t,e){var r=$p(e),n=[],a=4;if(1===t.version)for(var i=0;i<r;i++)n.push({count:$p(e,a),offset:$p(e,a+4)}),a+=8;else for(var o=0;o<r;o++)n.push({count:$p(e,a),offset:-(1+~$p(e,a+4))}),a+=8;t.entryCount=r,t.entries=n}))}},{key:"stsc",value:function(t){return Gy(t,!0,(function(t,e){for(var r=$p(e),n=[],a=4,i=0;i<r;i++)n.push({firstChunk:$p(e,a),samplesPerChunk:$p(e,a+4),sampleDescriptionIndex:$p(e,a+8)}),a+=12;t.entryCount=r,t.entries=n}))}},{key:"stsz",value:function(t){return Gy(t,!0,(function(t,e){var r=$p(e),n=$p(e,4),a=[];if(!r)for(var i=8,o=0;o<n;o++)a.push($p(e,i)),i+=4;t.sampleSize=r,t.sampleCount=n,t.entrySizes=a}))}},{key:"stco",value:function(t){return Gy(t,!0,(function(t,e){for(var r=$p(e),n=[],a=4,i=0;i<r;i++)n.push($p(e,a)),a+=4;t.entryCount=r,t.entries=n}))}},{key:"stss",value:function(t){return Gy(t,!0,(function(t,e){for(var r=$p(e),n=[],a=4,i=0;i<r;i++)n.push($p(e,a)),a+=4;t.entryCount=r,t.entries=n}))}},{key:"moovToTrack",value:function(t,e,r){var n=t.trak;if(n&&n.length){var a=n.find((function(t){var e,r;return"vide"===(null===(e=t.mdia)||void 0===e||null===(r=e.hdlr)||void 0===r?void 0:r.handlerType)})),i=n.find((function(t){var e,r;return"soun"===(null===(e=t.mdia)||void 0===e||null===(r=e.hdlr)||void 0===r?void 0:r.handlerType)}));if(a&&e){var o=e;o.timescale=o.formatTimescale=a.mdia.mdhd.timescale,o.duration=a.mdia.mdhd.duration;var s=a.mdia.minf.stbl.stsd.entries[0];if(o.width=s.width,o.height=s.height,s.pasp&&(o.sarRatio=[s.pasp.hSpacing,s.pasp.vSpacing]),s.hvcC)o.codecType=Qi.HEVC,o.codec=s.hvcC.codec,o.vps=s.hvcC.vps,o.sps=s.hvcC.sps,o.pps=s.hvcC.pps,o.hvcC=s.hvcC.data;else{if(!s.avcC)throw new Error("unknown video stsd entry");o.codec=s.avcC.codec,o.sps=s.avcC.sps,o.pps=s.avcC.pps}o.present=!0}if(i&&r){var u,c,f=r;f.timescale=f.formatTimescale=i.mdia.mdhd.timescale,f.duration=i.mdia.mdhd.duration;var l=i.mdia.minf.stbl.stsd.entries[0];f.sampleSize=l.sampleSize,f.sampleRate=l.sampleRate,f.channelCount=l.channelCount,f.sampleDuration=nv.getFrameDuration(f.sampleRate,f.timescale),f.objectType=(null===(u=l.esds)||void 0===u?void 0:u.objectType)||2,l.esds&&(f.config=Array.from(l.esds.config)),f.codec=(null===(c=l.esds)||void 0===c?void 0:c.codec)||"mp4a.40.2",f.sampleRateIndex=nv.getRateIndexByRate(f.sampleRate),f.present=!0}return{videoTrack:e,audioTrack:r}}}},{key:"moovToSamples",value:function(t){var e=t.trak;if(e&&e.length){var r=e.find((function(t){var e,r;return"vide"===(null===(e=t.mdia)||void 0===e||null===(r=e.hdlr)||void 0===r?void 0:r.handlerType)})),n=e.find((function(t){var e,r;return"soun"===(null===(e=t.mdia)||void 0===e||null===(r=e.hdlr)||void 0===r?void 0:r.handlerType)}));if(r||n){var a,i;if(r){var o,s,u=null===(o=r.mdia)||void 0===o||null===(s=o.minf)||void 0===s?void 0:s.stbl;if(!u)return;var c=u.stts,f=u.stsc,l=u.stsz,h=u.stco,d=u.stss,p=u.ctts;if(!(c&&f&&l&&h&&d))return;a=Vy(c,f,l,h,p,d)}if(n){var v,y,m,g=null===(v=n.mdia)||void 0===v||null===(y=v.minf)||void 0===y?void 0:y.stbl;if(!g)return;var b=null===(m=n.mdia.mdhd)||void 0===m?void 0:m.timescale,k=g.stts,_=g.stsc,A=g.stsz,w=g.stco;if(!(b&&k&&_&&A&&w))return;i=Vy(k,_,A,w)}return{videoSamples:a,audioSamples:i}}}}}]),t}();function Vy(t,e,r,n,a,i){var o,s,u,c=[],f=null==a?void 0:a.entries,l=e.entries,h=n.entries,d=r.entrySizes,p=null==i?void 0:i.entries;p&&(o={},p.forEach((function(t){o[t-1]=!0}))),f&&(s=[],f.forEach((function(t){for(var e=t.count,r=t.offset,n=0;n<e;n++)s.push(r)})));var v=-1,y=0,m=0,g=0,b=0,k=0,_=l[0].samplesPerChunk,A=l[1]?l[1].firstChunk-1:1/0;return t.entries.forEach((function(t){for(var e=t.count,n=t.delta,a=0;a<e;a++)u={dts:y,duration:n,size:d[m]||r.sampleSize,offset:h[g]+k,index:m},p&&(u.keyframe=o[m],u.keyframe&&v++,u.gopId=v),s&&s[m]&&(u.pts=u.dts+s[m]),c.push(u),y+=n,++m<_?k+=u.size:(g++,k=0,g>=A&&(b++,A=l[b+1]?l[b+1].firstChunk-1:1/0),_+=l[b].samplesPerChunk)})),c}function Fy(t,e){return t.dataReferenceIndex=Xp(e,6),t.width=Xp(e,24),t.height=Xp(e,26),t.horizresolution=$p(e,28),t.vertresolution=$p(e,32),t.frameCount=Xp(e,40),t.depth=Xp(e,74),78}function Gy(t,e,r){if(t){if(t.size!==t.data.length)throw new Error("box ".concat(t.type," size !== data.length"));var n={start:t.start,size:t.size,headerSize:t.headerSize,type:t.type};return e&&(n.version=t.data[t.headerSize],n.flags=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(t[e]<<16)+(t[e+1]<<8)+(t[e+2]||0)}(t.data,t.headerSize+1),n.headerSize+=4),r(n,t.data.subarray(n.headerSize),n.start+n.headerSize),n}}var zy=function(){function t(e,r,n,a){pi(this,t),di(this,"_videoSamples",[]),di(this,"_audioSamples",[]),di(this,"_lastRemainBuffer",[]),this.videoTrack=e||new Ji,this.audioTrack=r||new to,this.metadataTrack=n||new Oo,this.log=new Ov("MP4Demuxer",!a||!a.openLog||!a.openLog)}return yi(t,[{key:"parseSamples",value:function(t){if(!this._audioSamples.length&&!this._videoSamples.length){if(!t)throw new Error("moov is required");jy.moovToTrack(t,this.videoTrack,this.audioTrack);var e=jy.moovToSamples(t);if(!e)throw new Error("cannot parse samples from moov box");this._videoSamples=e.videoSamples||[],this._audioSamples=e.audioSamples||[]}}},{key:"demux",value:function(t,e,r,n,a){this._audioSamples.length||this._videoSamples.length||this.parseSamples(a);var i,o,s,u=this.videoTrack,c=this.audioTrack;if(u.samples=[],c.samples=[],r){for(var f,l=0,h=r[0],d=r[1];h<=d;h++){if(!(i=this._videoSamples[h]))throw new Error("cannot found video frame #".concat(h));s=i.offset-e,o=t.subarray(s,s+i.size),(f=new eo(i.pts||i.dts,i.dts)).duration=i.duration,f.gopId=i.gopId,i.keyframe&&f.setToKeyframe();for(var p=0,v=o.length-1;p<v;)l=$p(o,p),p+=4,f.units.push(o.subarray(p,p+l)),p+=l;u.samples.push(f)}u.baseMediaDecodeTime=u.samples[0].dts}if(n){for(var y=n[0],m=n[1];y<=m;y++){if(!(i=this._audioSamples[y]))throw new Error("cannot found video frame #".concat(y));s=i.offset-e,o=t.subarray(s,s+i.size),c.samples.push(new ro(i.dts,o,i.duration))}c.baseMediaDecodeTime=c.samples[0].dts}return{videoTrack:u,audioTrack:c,metadataTrack:this.metadataTrack}}},{key:"demuxPart",value:function(t,e,r){if(this._audioSamples.length||this._videoSamples.length||this.parseSamples(r),this.log.debug("[demuxPart start],dataStart,",e,",dataLen,",t.byteLength,", lastRemain,",this._lastRemainBuffer?this._lastRemainBuffer.byteLength:0),this._lastRemainBuffer&&this._lastRemainBuffer.byteLength>0)for(var n=0;n<20;)try{var a=new Uint8Array(t.byteLength+this._lastRemainBuffer.byteLength);a.set(this._lastRemainBuffer,0),a.set(new Uint8Array(t),this._lastRemainBuffer.byteLength),t=a,e-=this._lastRemainBuffer.byteLength,this._lastRemainBuffer=null,this.log.debug("[demuxPart add lastRemain],dataStart,",e,",dataLen,",t.byteLength);break}catch(t){if(!(n<20))throw new Error("new Uint8Array error:,"+t.errorMessage);n++}var i,o,s,u=this.videoTrack,c=this.audioTrack;u.samples=[],c.samples=[];var f=0,l=0;if(this._videoSamples){for(var h,d=0,p=0;p<this._videoSamples.length;p++){if(!(i=this._videoSamples[p]))throw new Error("cannot found video frame #".concat(p));if(i.offset>=e&&i.offset+i.size<=t.byteLength+e){f=(s=i.offset-e)+i.size,o=t.subarray(s,f),(h=new eo(i.pts||i.dts,i.dts)).duration=i.duration,h.gopId=i.gopId,i.keyframe&&h.setToKeyframe();for(var v=0,y=o.length-1;v<y;)d=$p(o,v),v+=4,h.units.push(o.subarray(v,v+d)),v+=d;this.log.debug("[demuxPart frame],sample,",i),u.samples.push(h)}}u.baseMediaDecodeTime=u.samples.length>0?u.samples[0].dts:0}if(this._audioSamples){for(var m=0;m<this._audioSamples.length;m++){if(!(i=this._audioSamples[m]))throw new Error("cannot found video frame #".concat(m));i.offset>=e&&i.offset+i.size<=t.byteLength+e&&(l=(s=i.offset-e)+i.size,o=t.subarray(s,l),this.log.debug("[demuxPart frame],sample,",i),c.samples.push(new ro(i.dts,o,i.duration)))}c.baseMediaDecodeTime=c.samples.length>0?c.samples[0].dts:-1}return this._lastRemainBuffer=t.subarray(Math.max(f,l)),this.log.debug("[demuxPart end ,lastRemain],dataStart,",this._lastRemainBuffer.byteLength),{videoTrack:u,audioTrack:c,metadataTrack:this.metadataTrack}}},{key:"reset",value:function(){this._videoSamples=[],this._audioSamples=[],this._lastRemainBuffer=null,this.videoTrack.reset(),this.audioTrack.reset(),this.metadataTrack.reset()}}],[{key:"probe",value:function(t){return!!jy.findBox(t,["ftyp"])}}]),t}(),Wy=Object.freeze({__proto__:null,FMP4Remuxer:Cv,MP4Remuxer:Bv,MP4Parser:jy,MP4Demuxer:zy});function Hy(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Yy(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Hy(Object(r),!0).forEach((function(e){di(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Hy(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}return Yy(Yy(Yy(Yy(Yy({},lv),_v),Wy),Co),{},{Logger:Mp})}));
2
+ //# sourceMappingURL=index.min.js.map