xgplayer-mp4 3.0.0-next.1 → 3.0.0-next.3

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 (165) hide show
  1. package/dist/index.min.js +1 -1
  2. package/dist/index.min.js.map +1 -1
  3. package/es/_virtual/_rollupPluginBabelHelpers.js +14 -0
  4. package/es/error.d.ts +5 -0
  5. package/es/error.js +9 -0
  6. package/es/fmp4/buffer.d.ts +6 -0
  7. package/es/fmp4/buffer.js +23 -0
  8. package/es/fmp4/m4a.d.ts +42 -0
  9. package/es/fmp4/m4a.js +928 -0
  10. package/es/fmp4/mp4.d.ts +42 -0
  11. package/es/fmp4/mp4.js +948 -0
  12. package/es/index.d.ts +3 -5
  13. package/es/index.js +2 -9
  14. package/es/index.umd.d.ts +2 -0
  15. package/es/index_backup.d.ts +1 -0
  16. package/es/m4a.d.ts +61 -0
  17. package/es/m4a.js +583 -0
  18. package/es/m4aPlugin.d.ts +48 -0
  19. package/es/m4aPlugin.js +385 -0
  20. package/es/media/mse.d.ts +17 -0
  21. package/es/media/mse.js +75 -0
  22. package/es/media/task.d.ts +19 -0
  23. package/es/media/task.js +103 -0
  24. package/es/mp4.d.ts +77 -0
  25. package/es/mp4.js +567 -0
  26. package/es/mp4Plugin.d.ts +49 -0
  27. package/es/mp4Plugin.js +332 -0
  28. package/es/parse/box.d.ts +17 -0
  29. package/es/parse/box.js +69 -0
  30. package/es/parse/boxParse/MP4DecConfigDescrTag.d.ts +2 -0
  31. package/es/parse/boxParse/MP4DecConfigDescrTag.js +25 -0
  32. package/es/parse/boxParse/MP4DecSpecificDescrTag.d.ts +2 -0
  33. package/es/parse/boxParse/MP4DecSpecificDescrTag.js +25 -0
  34. package/es/parse/boxParse/MP4ESDescrTag.d.ts +2 -0
  35. package/es/parse/boxParse/MP4ESDescrTag.js +23 -0
  36. package/es/parse/boxParse/SLConfigDescriptor.d.ts +2 -0
  37. package/es/parse/boxParse/SLConfigDescriptor.js +19 -0
  38. package/es/parse/boxParse/avc1.d.ts +10 -0
  39. package/es/parse/boxParse/avc1.js +30 -0
  40. package/es/parse/boxParse/avcC.d.ts +15 -0
  41. package/es/parse/boxParse/avcC.js +35 -0
  42. package/es/parse/boxParse/btrt.d.ts +6 -0
  43. package/es/parse/boxParse/btrt.js +11 -0
  44. package/es/parse/boxParse/co64.d.ts +7 -0
  45. package/es/parse/boxParse/co64.js +16 -0
  46. package/es/parse/boxParse/ctts.d.ts +7 -0
  47. package/es/parse/boxParse/ctts.js +19 -0
  48. package/es/parse/boxParse/dref.d.ts +6 -0
  49. package/es/parse/boxParse/dref.js +18 -0
  50. package/es/parse/boxParse/elst.d.ts +8 -0
  51. package/es/parse/boxParse/elst.js +35 -0
  52. package/es/parse/boxParse/esds.d.ts +5 -0
  53. package/es/parse/boxParse/esds.js +12 -0
  54. package/es/parse/boxParse/ftyp.d.ts +6 -0
  55. package/es/parse/boxParse/ftyp.js +15 -0
  56. package/es/parse/boxParse/hdlr.d.ts +7 -0
  57. package/es/parse/boxParse/hdlr.js +18 -0
  58. package/es/parse/boxParse/hmhd.d.ts +0 -0
  59. package/es/parse/boxParse/index.d.ts +32 -0
  60. package/es/parse/boxParse/index.js +31 -0
  61. package/es/parse/boxParse/iods.d.ts +6 -0
  62. package/es/parse/boxParse/iods.js +16 -0
  63. package/es/parse/boxParse/mdat.d.ts +1 -0
  64. package/es/parse/boxParse/mdat.js +4 -0
  65. package/es/parse/boxParse/mdhd.d.ts +12 -0
  66. package/es/parse/boxParse/mdhd.js +28 -0
  67. package/es/parse/boxParse/mfhd.d.ts +0 -0
  68. package/es/parse/boxParse/mp4a.d.ts +7 -0
  69. package/es/parse/boxParse/mp4a.js +19 -0
  70. package/es/parse/boxParse/mvhd.d.ts +15 -0
  71. package/es/parse/boxParse/mvhd.js +27 -0
  72. package/es/parse/boxParse/nmhd.d.ts +0 -0
  73. package/es/parse/boxParse/pasp.d.ts +4 -0
  74. package/es/parse/boxParse/pasp.js +9 -0
  75. package/es/parse/boxParse/sbgp.d.ts +0 -0
  76. package/es/parse/boxParse/sdtp.d.ts +0 -0
  77. package/es/parse/boxParse/smhd.d.ts +6 -0
  78. package/es/parse/boxParse/smhd.js +11 -0
  79. package/es/parse/boxParse/stco.d.ts +7 -0
  80. package/es/parse/boxParse/stco.js +16 -0
  81. package/es/parse/boxParse/stsc.d.ts +7 -0
  82. package/es/parse/boxParse/stsc.js +36 -0
  83. package/es/parse/boxParse/stsd.d.ts +6 -0
  84. package/es/parse/boxParse/stsd.js +15 -0
  85. package/es/parse/boxParse/stsh.d.ts +0 -0
  86. package/es/parse/boxParse/stss.d.ts +7 -0
  87. package/es/parse/boxParse/stss.js +16 -0
  88. package/es/parse/boxParse/stsz.d.ts +8 -0
  89. package/es/parse/boxParse/stsz.js +17 -0
  90. package/es/parse/boxParse/stts.d.ts +10 -0
  91. package/es/parse/boxParse/stts.js +19 -0
  92. package/es/parse/boxParse/stz2.d.ts +0 -0
  93. package/es/parse/boxParse/tfhd.d.ts +0 -0
  94. package/es/parse/boxParse/tkhd.d.ts +18 -0
  95. package/es/parse/boxParse/tkhd.js +40 -0
  96. package/es/parse/boxParse/traf.d.ts +0 -0
  97. package/es/parse/boxParse/trun.d.ts +0 -0
  98. package/es/parse/boxParse/udta.d.ts +1 -0
  99. package/es/parse/boxParse/udta.js +4 -0
  100. package/es/parse/boxParse/url.d.ts +6 -0
  101. package/es/parse/boxParse/url.js +16 -0
  102. package/es/parse/boxParse/vmhd.d.ts +7 -0
  103. package/es/parse/boxParse/vmhd.js +12 -0
  104. package/es/parse/date.d.ts +5 -0
  105. package/es/parse/date.js +17 -0
  106. package/es/parse/index.d.ts +8 -0
  107. package/es/parse/index.js +44 -0
  108. package/es/parse/stream.d.ts +23 -0
  109. package/es/parse/stream.js +106 -0
  110. package/es/util/download.d.ts +4 -0
  111. package/es/util/index.d.ts +46 -0
  112. package/es/util/index.js +174 -0
  113. package/es/write/box/MP4DecConfigDescrTag.d.ts +1 -0
  114. package/es/write/box/MP4DecSpecificDescrTag.d.ts +1 -0
  115. package/es/write/box/MP4ESDescrTag.d.ts +1 -0
  116. package/es/write/box/SLConfigDescriptor.d.ts +1 -0
  117. package/es/write/box/avc1.d.ts +1 -0
  118. package/es/write/box/avcC.d.ts +1 -0
  119. package/es/write/box/btrt.d.ts +1 -0
  120. package/es/write/box/co64.d.ts +1 -0
  121. package/es/write/box/ctts.d.ts +1 -0
  122. package/es/write/box/dref.d.ts +1 -0
  123. package/es/write/box/elst.d.ts +1 -0
  124. package/es/write/box/esds.d.ts +1 -0
  125. package/es/write/box/ftyp.d.ts +1 -0
  126. package/es/write/box/hdlr.d.ts +1 -0
  127. package/es/write/box/iods.d.ts +1 -0
  128. package/es/write/box/mdat.d.ts +1 -0
  129. package/es/write/box/mdhd.d.ts +1 -0
  130. package/es/write/box/mehd.d.ts +1 -0
  131. package/es/write/box/mfhd.d.ts +1 -0
  132. package/es/write/box/mfro.d.ts +1 -0
  133. package/es/write/box/mp4a.d.ts +1 -0
  134. package/es/write/box/mvhd.d.ts +1 -0
  135. package/es/write/box/pasp.d.ts +1 -0
  136. package/es/write/box/smhd.d.ts +1 -0
  137. package/es/write/box/stco.d.ts +1 -0
  138. package/es/write/box/stsc.d.ts +1 -0
  139. package/es/write/box/stsd.d.ts +1 -0
  140. package/es/write/box/stss.d.ts +1 -0
  141. package/es/write/box/stsz.d.ts +1 -0
  142. package/es/write/box/stts.d.ts +1 -0
  143. package/es/write/box/tfdt.d.ts +1 -0
  144. package/es/write/box/tfhd.d.ts +1 -0
  145. package/es/write/box/tfra.d.ts +1 -0
  146. package/es/write/box/tkhd.d.ts +1 -0
  147. package/es/write/box/trex.d.ts +1 -0
  148. package/es/write/box/trun.d.ts +1 -0
  149. package/es/write/box/udta.d.ts +1 -0
  150. package/es/write/box/url.d.ts +1 -0
  151. package/es/write/box/vmhd.d.ts +1 -0
  152. package/es/write/box/wide.d.ts +1 -0
  153. package/es/write/box.d.ts +15 -0
  154. package/es/write/buffer.d.ts +5 -0
  155. package/es/write/index.d.ts +5 -0
  156. package/es/write/stream.d.ts +20 -0
  157. package/package.json +28 -13
  158. package/es/mp4/buffer-service.d.ts +0 -17
  159. package/es/mp4/buffer-service.js +0 -350
  160. package/es/mp4/config.d.ts +0 -1
  161. package/es/mp4/config.js +0 -29
  162. package/es/mp4/index.d.ts +0 -23
  163. package/es/mp4/index.js +0 -412
  164. package/es/plugin.d.ts +0 -16
  165. package/es/plugin.js +0 -180
package/dist/index.min.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("xgplayer")):"function"==typeof define&&define.amd?define(["xgplayer"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).MP4Player=t(e.Player)}(this,(function(e){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},r=function(e){return e&&e.Math==Math&&e},n=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof t&&t)||function(){return this}()||Function("return this")(),i={},o=function(e){try{return!!e()}catch(e){return!0}},a=!o((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),u={},s={}.propertyIsEnumerable,c=Object.getOwnPropertyDescriptor,f=c&&!s.call({1:2},1);u.f=f?function(e){var t=c(this,e);return!!t&&t.enumerable}:s;var l,h,d=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},p={}.toString,v=function(e){return p.call(e).slice(8,-1)},y=v,m="".split,g=o((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==y(e)?m.call(e,""):Object(e)}:Object,b=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},w=g,x=b,k=function(e){return w(x(e))},S=function(e){return"object"==typeof e?null!==e:"function"==typeof e},_=n,T=function(e){return"function"==typeof e?e:void 0},O=function(e,t){return arguments.length<2?T(_[e]):_[e]&&_[e][t]},A=O("navigator","userAgent")||"",E=n,R=A,P=E.process,j=E.Deno,I=P&&P.versions||j&&j.version,L=I&&I.v8;L?h=(l=L.split("."))[0]<4?1:l[0]+l[1]:R&&(!(l=R.match(/Edge\/(\d+)/))||l[1]>=74)&&(l=R.match(/Chrome\/(\d+)/))&&(h=l[1]);var C=h&&+h,M=C,D=o,U=!!Object.getOwnPropertySymbols&&!D((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&M&&M<41})),B=U&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,N=O,F=B?function(e){return"symbol"==typeof e}:function(e){var t=N("Symbol");return"function"==typeof t&&Object(e)instanceof t},q=S,z={exports:{}},V=n,H=function(e,t){try{Object.defineProperty(V,e,{value:t,configurable:!0,writable:!0})}catch(r){V[e]=t}return t},Y=H,G="__core-js_shared__",$=n[G]||Y(G,{}),W=$;(z.exports=function(e,t){return W[e]||(W[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.16.2",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"});var Q=b,K=function(e){return Object(Q(e))},X=K,J={}.hasOwnProperty,Z=Object.hasOwn||function(e,t){return J.call(X(e),t)},ee=0,te=Math.random(),re=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++ee+te).toString(36)},ne=n,ie=z.exports,oe=Z,ae=re,ue=U,se=B,ce=ie("wks"),fe=ne.Symbol,le=se?fe:fe&&fe.withoutSetter||ae,he=function(e){return oe(ce,e)&&(ue||"string"==typeof ce[e])||(ue&&oe(fe,e)?ce[e]=fe[e]:ce[e]=le("Symbol."+e)),ce[e]},de=S,pe=F,ve=function(e,t){var r,n;if("string"===t&&"function"==typeof(r=e.toString)&&!q(n=r.call(e)))return n;if("function"==typeof(r=e.valueOf)&&!q(n=r.call(e)))return n;if("string"!==t&&"function"==typeof(r=e.toString)&&!q(n=r.call(e)))return n;throw TypeError("Can't convert object to primitive value")},ye=he("toPrimitive"),me=function(e,t){if(!de(e)||pe(e))return e;var r,n=e[ye];if(void 0!==n){if(void 0===t&&(t="default"),r=n.call(e,t),!de(r)||pe(r))return r;throw TypeError("Can't convert object to primitive value")}return void 0===t&&(t="number"),ve(e,t)},ge=me,be=F,we=function(e){var t=ge(e,"string");return be(t)?t:String(t)},xe=S,ke=n.document,Se=xe(ke)&&xe(ke.createElement),_e=function(e){return Se?ke.createElement(e):{}},Te=_e,Oe=!a&&!o((function(){return 7!=Object.defineProperty(Te("div"),"a",{get:function(){return 7}}).a})),Ae=a,Ee=u,Re=d,Pe=k,je=we,Ie=Z,Le=Oe,Ce=Object.getOwnPropertyDescriptor;i.f=Ae?Ce:function(e,t){if(e=Pe(e),t=je(t),Le)try{return Ce(e,t)}catch(e){}if(Ie(e,t))return Re(!Ee.f.call(e,t),e[t])};var Me={},De=S,Ue=function(e){if(!De(e))throw TypeError(String(e)+" is not an object");return e},Be=a,Ne=Oe,Fe=Ue,qe=we,ze=Object.defineProperty;Me.f=Be?ze:function(e,t,r){if(Fe(e),t=qe(t),Fe(r),Ne)try{return ze(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var Ve=Me,He=d,Ye=a?function(e,t,r){return Ve.f(e,t,He(1,r))}:function(e,t,r){return e[t]=r,e},Ge={exports:{}},$e=$,We=Function.toString;"function"!=typeof $e.inspectSource&&($e.inspectSource=function(e){return We.call(e)});var Qe,Ke,Xe,Je=$e.inspectSource,Ze=Je,et=n.WeakMap,tt="function"==typeof et&&/native code/.test(Ze(et)),rt=z.exports,nt=re,it=rt("keys"),ot=function(e){return it[e]||(it[e]=nt(e))},at={},ut=tt,st=S,ct=Ye,ft=Z,lt=$,ht=ot,dt=at,pt="Object already initialized",vt=n.WeakMap;if(ut||lt.state){var yt=lt.state||(lt.state=new vt),mt=yt.get,gt=yt.has,bt=yt.set;Qe=function(e,t){if(gt.call(yt,e))throw new TypeError(pt);return t.facade=e,bt.call(yt,e,t),t},Ke=function(e){return mt.call(yt,e)||{}},Xe=function(e){return gt.call(yt,e)}}else{var wt=ht("state");dt[wt]=!0,Qe=function(e,t){if(ft(e,wt))throw new TypeError(pt);return t.facade=e,ct(e,wt,t),t},Ke=function(e){return ft(e,wt)?e[wt]:{}},Xe=function(e){return ft(e,wt)}}var xt={set:Qe,get:Ke,has:Xe,enforce:function(e){return Xe(e)?Ke(e):Qe(e,{})},getterFor:function(e){return function(t){var r;if(!st(t)||(r=Ke(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return r}}},kt=n,St=Ye,_t=Z,Tt=H,Ot=Je,At=xt.get,Et=xt.enforce,Rt=String(String).split("String");(Ge.exports=function(e,t,r,n){var i,o=!!n&&!!n.unsafe,a=!!n&&!!n.enumerable,u=!!n&&!!n.noTargetGet;"function"==typeof r&&("string"!=typeof t||_t(r,"name")||St(r,"name",t),(i=Et(r)).source||(i.source=Rt.join("string"==typeof t?t:""))),e!==kt?(o?!u&&e[t]&&(a=!0):delete e[t],a?e[t]=r:St(e,t,r)):a?e[t]=r:Tt(t,r)})(Function.prototype,"toString",(function(){return"function"==typeof this&&At(this).source||Ot(this)}));var Pt={},jt=Math.ceil,It=Math.floor,Lt=function(e){return isNaN(e=+e)?0:(e>0?It:jt)(e)},Ct=Lt,Mt=Math.min,Dt=function(e){return e>0?Mt(Ct(e),9007199254740991):0},Ut=Lt,Bt=Math.max,Nt=Math.min,Ft=function(e,t){var r=Ut(e);return r<0?Bt(r+t,0):Nt(r,t)},qt=k,zt=Dt,Vt=Ft,Ht=function(e){return function(t,r,n){var i,o=qt(t),a=zt(o.length),u=Vt(n,a);if(e&&r!=r){for(;a>u;)if((i=o[u++])!=i)return!0}else for(;a>u;u++)if((e||u in o)&&o[u]===r)return e||u||0;return!e&&-1}},Yt={includes:Ht(!0),indexOf:Ht(!1)},Gt=Z,$t=k,Wt=Yt.indexOf,Qt=at,Kt=function(e,t){var r,n=$t(e),i=0,o=[];for(r in n)!Gt(Qt,r)&&Gt(n,r)&&o.push(r);for(;t.length>i;)Gt(n,r=t[i++])&&(~Wt(o,r)||o.push(r));return o},Xt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Jt=Kt,Zt=Xt.concat("length","prototype");Pt.f=Object.getOwnPropertyNames||function(e){return Jt(e,Zt)};var er={};er.f=Object.getOwnPropertySymbols;var tr,rr=Pt,nr=er,ir=Ue,or=O("Reflect","ownKeys")||function(e){var t=rr.f(ir(e)),r=nr.f;return r?t.concat(r(e)):t},ar=Z,ur=or,sr=i,cr=Me,fr=function(e,t){for(var r=ur(t),n=cr.f,i=sr.f,o=0;o<r.length;o++){var a=r[o];ar(e,a)||n(e,a,i(t,a))}},lr=o,hr=/#|\.prototype\./,dr=function(e,t){var r=vr[pr(e)];return r==mr||r!=yr&&("function"==typeof t?lr(t):!!t)},pr=dr.normalize=function(e){return String(e).replace(hr,".").toLowerCase()},vr=dr.data={},yr=dr.NATIVE="N",mr=dr.POLYFILL="P",gr=dr,br=n,wr=i.f,xr=Ye,kr=Ge.exports,Sr=H,_r=fr,Tr=gr,Or=function(e,t){var r,n,i,o,a,u=e.target,s=e.global,c=e.stat;if(r=s?br:c?br[u]||Sr(u,{}):(br[u]||{}).prototype)for(n in t){if(o=t[n],i=e.noTargetGet?(a=wr(r,n))&&a.value:r[n],!Tr(s?n:u+(c?".":"#")+n,e.forced)&&void 0!==i){if(typeof o==typeof i)continue;_r(o,i)}(e.sham||i&&i.sham)&&xr(o,"sham",!0),kr(r,n,o,e)}},Ar=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},Er=Kt,Rr=Xt,Pr=Object.keys||function(e){return Er(e,Rr)},jr=Me,Ir=Ue,Lr=Pr,Cr=a?Object.defineProperties:function(e,t){Ir(e);for(var r,n=Lr(t),i=n.length,o=0;i>o;)jr.f(e,r=n[o++],t[r]);return e},Mr=O("document","documentElement"),Dr=Ue,Ur=Cr,Br=Xt,Nr=at,Fr=Mr,qr=_e,zr=ot("IE_PROTO"),Vr=function(){},Hr=function(e){return"<script>"+e+"</"+"script>"},Yr=function(e){e.write(Hr("")),e.close();var t=e.parentWindow.Object;return e=null,t},Gr=function(){try{tr=new ActiveXObject("htmlfile")}catch(e){}var e,t;Gr="undefined"!=typeof document?document.domain&&tr?Yr(tr):((t=qr("iframe")).style.display="none",Fr.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(Hr("document.F=Object")),e.close(),e.F):Yr(tr);for(var r=Br.length;r--;)delete Gr.prototype[Br[r]];return Gr()};Nr[zr]=!0;var $r=Object.create||function(e,t){var r;return null!==e?(Vr.prototype=Dr(e),r=new Vr,Vr.prototype=null,r[zr]=e):r=Gr(),void 0===t?r:Ur(r,t)},Wr=Ar,Qr=S,Kr=[].slice,Xr={},Jr=function(e,t,r){if(!(t in Xr)){for(var n=[],i=0;i<t;i++)n[i]="a["+i+"]";Xr[t]=Function("C,a","return new C("+n.join(",")+")")}return Xr[t](e,r)},Zr=Function.bind||function(e){var t=Wr(this),r=Kr.call(arguments,1),n=function(){var i=r.concat(Kr.call(arguments));return this instanceof n?Jr(t,i.length,i):t.apply(e,i)};return Qr(t.prototype)&&(n.prototype=t.prototype),n},en=Or,tn=Ar,rn=Ue,nn=S,on=$r,an=Zr,un=o,sn=O("Reflect","construct"),cn=un((function(){function e(){}return!(sn((function(){}),[],e)instanceof e)})),fn=!un((function(){sn((function(){}))})),ln=cn||fn;en({target:"Reflect",stat:!0,forced:ln,sham:ln},{construct:function(e,t){tn(e),rn(t);var r=arguments.length<3?e:tn(arguments[2]);if(fn&&!cn)return sn(e,t,r);if(e==r){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var n=[null];return n.push.apply(n,t),new(an.apply(e,n))}var i=r.prototype,o=on(nn(i)?i:Object.prototype),a=Function.apply.call(e,o,t);return nn(a)?a:o}});var hn=K,dn=Pr;Or({target:"Object",stat:!0,forced:o((function(){dn(1)}))},{keys:function(e){return dn(hn(e))}});var pn=v,vn=Array.isArray||function(e){return"Array"==pn(e)},yn=F,mn=function(e){if(yn(e))throw TypeError("Cannot convert a Symbol value to a string");return String(e)},gn={},bn=k,wn=Pt.f,xn={}.toString,kn="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];gn.f=function(e){return kn&&"[object Window]"==xn.call(e)?function(e){try{return wn(e)}catch(e){return kn.slice()}}(e):wn(bn(e))};var Sn={},_n=he;Sn.f=_n;var Tn=n,On=Z,An=Sn,En=Me.f,Rn=function(e){var t=Tn.Symbol||(Tn.Symbol={});On(t,e)||En(t,e,{value:An.f(e)})},Pn=Me.f,jn=Z,In=he("toStringTag"),Ln=function(e,t,r){e&&!jn(e=r?e:e.prototype,In)&&Pn(e,In,{configurable:!0,value:t})},Cn=Ar,Mn=function(e,t,r){if(Cn(e),void 0===t)return e;switch(r){case 0:return function(){return e.call(t)};case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,i){return e.call(t,r,n,i)}}return function(){return e.apply(t,arguments)}},Dn=S,Un=vn,Bn=he("species"),Nn=function(e){var t;return Un(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!Un(t.prototype)?Dn(t)&&null===(t=t[Bn])&&(t=void 0):t=void 0),void 0===t?Array:t},Fn=function(e,t){return new(Nn(e))(0===t?0:t)},qn=Mn,zn=g,Vn=K,Hn=Dt,Yn=Fn,Gn=[].push,$n=function(e){var t=1==e,r=2==e,n=3==e,i=4==e,o=6==e,a=7==e,u=5==e||o;return function(s,c,f,l){for(var h,d,p=Vn(s),v=zn(p),y=qn(c,f,3),m=Hn(v.length),g=0,b=l||Yn,w=t?b(s,m):r||a?b(s,0):void 0;m>g;g++)if((u||g in v)&&(d=y(h=v[g],g,p),e))if(t)w[g]=d;else if(d)switch(e){case 3:return!0;case 5:return h;case 6:return g;case 2:Gn.call(w,h)}else switch(e){case 4:return!1;case 7:Gn.call(w,h)}return o?-1:n||i?i:w}},Wn={forEach:$n(0),map:$n(1),filter:$n(2),some:$n(3),every:$n(4),find:$n(5),findIndex:$n(6),filterReject:$n(7)},Qn=Or,Kn=n,Xn=O,Jn=a,Zn=U,ei=o,ti=Z,ri=vn,ni=S,ii=F,oi=Ue,ai=K,ui=k,si=we,ci=mn,fi=d,li=$r,hi=Pr,di=Pt,pi=gn,vi=er,yi=i,mi=Me,gi=u,bi=Ye,wi=Ge.exports,xi=z.exports,ki=at,Si=re,_i=he,Ti=Sn,Oi=Rn,Ai=Ln,Ei=xt,Ri=Wn.forEach,Pi=ot("hidden"),ji="Symbol",Ii=_i("toPrimitive"),Li=Ei.set,Ci=Ei.getterFor(ji),Mi=Object.prototype,Di=Kn.Symbol,Ui=Xn("JSON","stringify"),Bi=yi.f,Ni=mi.f,Fi=pi.f,qi=gi.f,zi=xi("symbols"),Vi=xi("op-symbols"),Hi=xi("string-to-symbol-registry"),Yi=xi("symbol-to-string-registry"),Gi=xi("wks"),$i=Kn.QObject,Wi=!$i||!$i.prototype||!$i.prototype.findChild,Qi=Jn&&ei((function(){return 7!=li(Ni({},"a",{get:function(){return Ni(this,"a",{value:7}).a}})).a}))?function(e,t,r){var n=Bi(Mi,t);n&&delete Mi[t],Ni(e,t,r),n&&e!==Mi&&Ni(Mi,t,n)}:Ni,Ki=function(e,t){var r=zi[e]=li(Di.prototype);return Li(r,{type:ji,tag:e,description:t}),Jn||(r.description=t),r},Xi=function(e,t,r){e===Mi&&Xi(Vi,t,r),oi(e);var n=si(t);return oi(r),ti(zi,n)?(r.enumerable?(ti(e,Pi)&&e[Pi][n]&&(e[Pi][n]=!1),r=li(r,{enumerable:fi(0,!1)})):(ti(e,Pi)||Ni(e,Pi,fi(1,{})),e[Pi][n]=!0),Qi(e,n,r)):Ni(e,n,r)},Ji=function(e,t){oi(e);var r=ui(t),n=hi(r).concat(ro(r));return Ri(n,(function(t){Jn&&!Zi.call(r,t)||Xi(e,t,r[t])})),e},Zi=function(e){var t=si(e),r=qi.call(this,t);return!(this===Mi&&ti(zi,t)&&!ti(Vi,t))&&(!(r||!ti(this,t)||!ti(zi,t)||ti(this,Pi)&&this[Pi][t])||r)},eo=function(e,t){var r=ui(e),n=si(t);if(r!==Mi||!ti(zi,n)||ti(Vi,n)){var i=Bi(r,n);return!i||!ti(zi,n)||ti(r,Pi)&&r[Pi][n]||(i.enumerable=!0),i}},to=function(e){var t=Fi(ui(e)),r=[];return Ri(t,(function(e){ti(zi,e)||ti(ki,e)||r.push(e)})),r},ro=function(e){var t=e===Mi,r=Fi(t?Vi:ui(e)),n=[];return Ri(r,(function(e){!ti(zi,e)||t&&!ti(Mi,e)||n.push(zi[e])})),n};(Zn||(wi((Di=function(){if(this instanceof Di)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?ci(arguments[0]):void 0,t=Si(e),r=function(e){this===Mi&&r.call(Vi,e),ti(this,Pi)&&ti(this[Pi],t)&&(this[Pi][t]=!1),Qi(this,t,fi(1,e))};return Jn&&Wi&&Qi(Mi,t,{configurable:!0,set:r}),Ki(t,e)}).prototype,"toString",(function(){return Ci(this).tag})),wi(Di,"withoutSetter",(function(e){return Ki(Si(e),e)})),gi.f=Zi,mi.f=Xi,yi.f=eo,di.f=pi.f=to,vi.f=ro,Ti.f=function(e){return Ki(_i(e),e)},Jn&&(Ni(Di.prototype,"description",{configurable:!0,get:function(){return Ci(this).description}}),wi(Mi,"propertyIsEnumerable",Zi,{unsafe:!0}))),Qn({global:!0,wrap:!0,forced:!Zn,sham:!Zn},{Symbol:Di}),Ri(hi(Gi),(function(e){Oi(e)})),Qn({target:ji,stat:!0,forced:!Zn},{for:function(e){var t=ci(e);if(ti(Hi,t))return Hi[t];var r=Di(t);return Hi[t]=r,Yi[r]=t,r},keyFor:function(e){if(!ii(e))throw TypeError(e+" is not a symbol");if(ti(Yi,e))return Yi[e]},useSetter:function(){Wi=!0},useSimple:function(){Wi=!1}}),Qn({target:"Object",stat:!0,forced:!Zn,sham:!Jn},{create:function(e,t){return void 0===t?li(e):Ji(li(e),t)},defineProperty:Xi,defineProperties:Ji,getOwnPropertyDescriptor:eo}),Qn({target:"Object",stat:!0,forced:!Zn},{getOwnPropertyNames:to,getOwnPropertySymbols:ro}),Qn({target:"Object",stat:!0,forced:ei((function(){vi.f(1)}))},{getOwnPropertySymbols:function(e){return vi.f(ai(e))}}),Ui)&&Qn({target:"JSON",stat:!0,forced:!Zn||ei((function(){var e=Di();return"[null]"!=Ui([e])||"{}"!=Ui({a:e})||"{}"!=Ui(Object(e))}))},{stringify:function(e,t,r){for(var n,i=[e],o=1;arguments.length>o;)i.push(arguments[o++]);if(n=t,(ni(t)||void 0!==e)&&!ii(e))return ri(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!ii(t))return t}),i[1]=t,Ui.apply(null,i)}});Di.prototype[Ii]||bi(Di.prototype,Ii,Di.prototype.valueOf),Ai(Di,ji),ki[Pi]=!0;var no=o,io=C,oo=he("species"),ao=function(e){return io>=51||!no((function(){var t=[];return(t.constructor={})[oo]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},uo=Wn.filter;Or({target:"Array",proto:!0,forced:!ao("filter")},{filter:function(e){return uo(this,e,arguments.length>1?arguments[1]:void 0)}});var so=Or,co=o,fo=k,lo=i.f,ho=a,po=co((function(){lo(1)}));so({target:"Object",stat:!0,forced:!ho||po,sham:!ho},{getOwnPropertyDescriptor:function(e,t){return lo(fo(e),t)}});var vo={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},yo=o,mo=function(e,t){var r=[][e];return!!r&&yo((function(){r.call(null,t||function(){throw 1},1)}))},go=Wn.forEach,bo=n,wo=vo,xo=mo("forEach")?[].forEach:function(e){return go(this,e,arguments.length>1?arguments[1]:void 0)},ko=Ye;for(var So in wo){var _o=bo[So],To=_o&&_o.prototype;if(To&&To.forEach!==xo)try{ko(To,"forEach",xo)}catch(e){To.forEach=xo}}var Oo=we,Ao=Me,Eo=d,Ro=function(e,t,r){var n=Oo(t);n in e?Ao.f(e,n,Eo(0,r)):e[n]=r},Po=or,jo=k,Io=i,Lo=Ro;function Co(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Do(e,t,r){return t&&Mo(e.prototype,t),r&&Mo(e,r),e}function Uo(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Bo(e,t){return(Bo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function No(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Bo(e,t)}function Fo(e){return(Fo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function qo(e,t){if(t&&("object"===Fo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Uo(e)}function zo(e){return(zo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Vo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Or({target:"Object",stat:!0,sham:!a},{getOwnPropertyDescriptors:function(e){for(var t,r,n=jo(e),i=Io.f,o=Po(n),a={},u=0;o.length>u;)void 0!==(r=i(n,t=o[u++]))&&Lo(a,t,r);return a}});var Ho=Or,Yo=o,Go=vn,$o=S,Wo=K,Qo=Dt,Ko=Ro,Xo=Fn,Jo=ao,Zo=C,ea=he("isConcatSpreadable"),ta=9007199254740991,ra="Maximum allowed index exceeded",na=Zo>=51||!Yo((function(){var e=[];return e[ea]=!1,e.concat()[0]!==e})),ia=Jo("concat"),oa=function(e){if(!$o(e))return!1;var t=e[ea];return void 0!==t?!!t:Go(e)};function aa(e,t,r,n,i,o,a){try{var u=e[o](a),s=u.value}catch(e){return void r(e)}u.done?t(s):Promise.resolve(s).then(n,i)}function ua(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){aa(o,n,i,a,u,"next",e)}function u(e){aa(o,n,i,a,u,"throw",e)}a(void 0)}))}}function sa(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function ca(e,t,r){return(ca=sa()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&Bo(i,r.prototype),i}).apply(null,arguments)}function fa(e){var t="function"==typeof Map?new Map:void 0;return(fa=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return ca(e,arguments,zo(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Bo(n,e)})(e)}Ho({target:"Array",proto:!0,forced:!na||!ia},{concat:function(e){var t,r,n,i,o,a=Wo(this),u=Xo(a,0),s=0;for(t=-1,n=arguments.length;t<n;t++)if(oa(o=-1===t?a:arguments[t])){if(s+(i=Qo(o.length))>ta)throw TypeError(ra);for(r=0;r<i;r++,s++)r in o&&Ko(u,s,o[r])}else{if(s>=ta)throw TypeError(ra);Ko(u,s++,o)}return u.length=s,u}});var la={exports:{}};!function(e){var t=function(e){var t,r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof y?t:y,o=Object.create(i.prototype),a=new E(n||[]);return o._invoke=function(e,t,r){var n=l;return function(i,o){if(n===d)throw new Error("Generator is already running");if(n===p){if("throw"===i)throw o;return P()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var u=T(a,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===l)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=d;var s=f(e,t,r);if("normal"===s.type){if(n=r.done?p:h,s.arg===v)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n=p,r.method="throw",r.arg=s.arg)}}}(e,r,a),o}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var l="suspendedStart",h="suspendedYield",d="executing",p="completed",v={};function y(){}function m(){}function g(){}var b={};b[o]=function(){return this};var w=Object.getPrototypeOf,x=w&&w(w(R([])));x&&x!==r&&n.call(x,o)&&(b=x);var k=g.prototype=y.prototype=Object.create(b);function S(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function _(e,t){function r(i,o,a,u){var s=f(e[i],e,o);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==typeof l&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,a,u)}),(function(e){r("throw",e,a,u)})):t.resolve(l).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,u)}))}u(s.arg)}var i;this._invoke=function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}}function T(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,T(e,r),"throw"===r.method))return v;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var i=f(n,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var o=i.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function R(e){if(e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}return{next:P}}function P(){return{value:t,done:!0}}return m.prototype=k.constructor=g,g.constructor=m,m.displayName=s(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,s(e,u,"GeneratorFunction")),e.prototype=Object.create(k),e},e.awrap=function(e){return{__await:e}},S(_.prototype),_.prototype[a]=function(){return this},e.AsyncIterator=_,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new _(c(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(k),s(k,u,"Generator"),k[o]=function(){return this},k.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=R,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return u.type="throw",u.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;A(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}}(la);var ha=la.exports,da=$r,pa=Me,va=he("unscopables"),ya=Array.prototype;null==ya[va]&&pa.f(ya,va,{configurable:!0,value:da(null)});var ma,ga,ba,wa=function(e){ya[va][e]=!0},xa={},ka=!o((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Sa=Z,_a=K,Ta=ka,Oa=ot("IE_PROTO"),Aa=Object.prototype,Ea=Ta?Object.getPrototypeOf:function(e){return e=_a(e),Sa(e,Oa)?e[Oa]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?Aa:null},Ra=o,Pa=Ea,ja=Ye,Ia=Z,La=he("iterator"),Ca=!1;[].keys&&("next"in(ba=[].keys())?(ga=Pa(Pa(ba)))!==Object.prototype&&(ma=ga):Ca=!0),(null==ma||Ra((function(){var e={};return ma[La].call(e)!==e})))&&(ma={}),Ia(ma,La)||ja(ma,La,(function(){return this}));var Ma={IteratorPrototype:ma,BUGGY_SAFARI_ITERATORS:Ca},Da=Ma.IteratorPrototype,Ua=$r,Ba=d,Na=Ln,Fa=xa,qa=function(){return this},za=function(e,t,r){var n=t+" Iterator";return e.prototype=Ua(Da,{next:Ba(1,r)}),Na(e,n,!1),Fa[n]=qa,e},Va=S,Ha=Ue,Ya=function(e){if(!Va(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e},Ga=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return Ha(r),Ya(n),t?e.call(r,n):r.__proto__=n,r}}():void 0),$a=Or,Wa=za,Qa=Ea,Ka=Ga,Xa=Ln,Ja=Ye,Za=Ge.exports,eu=xa,tu=Ma.IteratorPrototype,ru=Ma.BUGGY_SAFARI_ITERATORS,nu=he("iterator"),iu="keys",ou="values",au="entries",uu=function(){return this},su=function(e,t,r,n,i,o,a){Wa(r,t,n);var u,s,c,f=function(e){if(e===i&&v)return v;if(!ru&&e in d)return d[e];switch(e){case iu:case ou:case au:return function(){return new r(this,e)}}return function(){return new r(this)}},l=t+" Iterator",h=!1,d=e.prototype,p=d[nu]||d["@@iterator"]||i&&d[i],v=!ru&&p||f(i),y="Array"==t&&d.entries||p;if(y&&(u=Qa(y.call(new e)),tu!==Object.prototype&&u.next&&(Qa(u)!==tu&&(Ka?Ka(u,tu):"function"!=typeof u[nu]&&Ja(u,nu,uu)),Xa(u,l,!0))),i==ou&&p&&p.name!==ou&&(h=!0,v=function(){return p.call(this)}),d[nu]!==v&&Ja(d,nu,v),eu[t]=v,i)if(s={values:f(ou),keys:o?v:f(iu),entries:f(au)},a)for(c in s)(ru||h||!(c in d))&&Za(d,c,s[c]);else $a({target:t,proto:!0,forced:ru||h},s);return s},cu=k,fu=wa,lu=xa,hu=xt,du=su,pu="Array Iterator",vu=hu.set,yu=hu.getterFor(pu),mu=du(Array,"Array",(function(e,t){vu(this,{type:pu,target:cu(e),index:0,kind:t})}),(function(){var e=yu(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}}),"values");lu.Arguments=lu.Array,fu("keys"),fu("values"),fu("entries");var gu={};gu[he("toStringTag")]="z";var bu="[object z]"===String(gu),wu=bu,xu=v,ku=he("toStringTag"),Su="Arguments"==xu(function(){return arguments}()),_u=wu?xu:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),ku))?r:Su?xu(t):"Object"==(n=xu(t))&&"function"==typeof t.callee?"Arguments":n},Tu=_u,Ou=bu?{}.toString:function(){return"[object "+Tu(this)+"]"},Au=bu,Eu=Ge.exports,Ru=Ou;Au||Eu(Object.prototype,"toString",Ru,{unsafe:!0});var Pu=Lt,ju=mn,Iu=b,Lu=function(e){return function(t,r){var n,i,o=ju(Iu(t)),a=Pu(r),u=o.length;return a<0||a>=u?e?"":void 0:(n=o.charCodeAt(a))<55296||n>56319||a+1===u||(i=o.charCodeAt(a+1))<56320||i>57343?e?o.charAt(a):n:e?o.slice(a,a+2):i-56320+(n-55296<<10)+65536}},Cu={codeAt:Lu(!1),charAt:Lu(!0)},Mu=Cu.charAt,Du=mn,Uu=xt,Bu=su,Nu="String Iterator",Fu=Uu.set,qu=Uu.getterFor(Nu);Bu(String,"String",(function(e){Fu(this,{type:Nu,string:Du(e),index:0})}),(function(){var e,t=qu(this),r=t.string,n=t.index;return n>=r.length?{value:void 0,done:!0}:(e=Mu(r,n),t.index+=e.length,{value:e,done:!1})}));var zu=n,Vu=vo,Hu=mu,Yu=Ye,Gu=he,$u=Gu("iterator"),Wu=Gu("toStringTag"),Qu=Hu.values;for(var Ku in Vu){var Xu=zu[Ku],Ju=Xu&&Xu.prototype;if(Ju){if(Ju[$u]!==Qu)try{Yu(Ju,$u,Qu)}catch(e){Ju[$u]=Qu}if(Ju[Wu]||Yu(Ju,Wu,Ku),Vu[Ku])for(var Zu in Hu)if(Ju[Zu]!==Hu[Zu])try{Yu(Ju,Zu,Hu[Zu])}catch(e){Ju[Zu]=Hu[Zu]}}}var es=o,ts=he("iterator"),rs=!es((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,r="";return e.pathname="c%20d",t.forEach((function(e,n){t.delete("b"),r+=n+e})),!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[ts]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==r||"x"!==new URL("http://x",void 0).host})),ns=function(e,t,r){if(!(e instanceof t))throw TypeError("Incorrect "+(r?r+" ":"")+"invocation");return e},is=a,os=o,as=Pr,us=er,ss=u,cs=K,fs=g,ls=Object.assign,hs=Object.defineProperty,ds=!ls||os((function(){if(is&&1!==ls({b:1},ls(hs({},"a",{enumerable:!0,get:function(){hs(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach((function(e){t[e]=e})),7!=ls({},e)[r]||as(ls({},t)).join("")!=n}))?function(e,t){for(var r=cs(e),n=arguments.length,i=1,o=us.f,a=ss.f;n>i;)for(var u,s=fs(arguments[i++]),c=o?as(s).concat(o(s)):as(s),f=c.length,l=0;f>l;)u=c[l++],is&&!a.call(s,u)||(r[u]=s[u]);return r}:ls,ps=Ue,vs=function(e){var t=e.return;if(void 0!==t)return ps(t.call(e)).value},ys=Ue,ms=vs,gs=xa,bs=he("iterator"),ws=Array.prototype,xs=function(e){return void 0!==e&&(gs.Array===e||ws[bs]===e)},ks=_u,Ss=xa,_s=he("iterator"),Ts=function(e){if(null!=e)return e[_s]||e["@@iterator"]||Ss[ks(e)]},Os=Mn,As=K,Es=function(e,t,r,n){try{return n?t(ys(r)[0],r[1]):t(r)}catch(t){throw ms(e),t}},Rs=xs,Ps=Dt,js=Ro,Is=Ts,Ls=function(e){var t,r,n,i,o,a,u=As(e),s="function"==typeof this?this:Array,c=arguments.length,f=c>1?arguments[1]:void 0,l=void 0!==f,h=Is(u),d=0;if(l&&(f=Os(f,c>2?arguments[2]:void 0,2)),null==h||s==Array&&Rs(h))for(r=new s(t=Ps(u.length));t>d;d++)a=l?f(u[d],d):u[d],js(r,d,a);else for(o=(i=h.call(u)).next,r=new s;!(n=o.call(i)).done;d++)a=l?Es(i,f,[n.value,d],!0):n.value,js(r,d,a);return r.length=d,r},Cs=2147483647,Ms=/[^\0-\u007E]/,Ds=/[.\u3002\uFF0E\uFF61]/g,Us="Overflow: input needs wider integers to process",Bs=Math.floor,Ns=String.fromCharCode,Fs=function(e){return e+22+75*(e<26)},qs=function(e,t,r){var n=0;for(e=r?Bs(e/700):e>>1,e+=Bs(e/t);e>455;n+=36)e=Bs(e/35);return Bs(n+36*e/(e+38))},zs=function(e){var t,r,n=[],i=(e=function(e){for(var t=[],r=0,n=e.length;r<n;){var i=e.charCodeAt(r++);if(i>=55296&&i<=56319&&r<n){var o=e.charCodeAt(r++);56320==(64512&o)?t.push(((1023&i)<<10)+(1023&o)+65536):(t.push(i),r--)}else t.push(i)}return t}(e)).length,o=128,a=0,u=72;for(t=0;t<e.length;t++)(r=e[t])<128&&n.push(Ns(r));var s=n.length,c=s;for(s&&n.push("-");c<i;){var f=Cs;for(t=0;t<e.length;t++)(r=e[t])>=o&&r<f&&(f=r);var l=c+1;if(f-o>Bs((Cs-a)/l))throw RangeError(Us);for(a+=(f-o)*l,o=f,t=0;t<e.length;t++){if((r=e[t])<o&&++a>Cs)throw RangeError(Us);if(r==o){for(var h=a,d=36;;d+=36){var p=d<=u?1:d>=u+26?26:d-u;if(h<p)break;var v=h-p,y=36-p;n.push(Ns(Fs(p+v%y))),h=Bs(v/y)}n.push(Ns(Fs(h))),u=qs(a,l,c==s),a=0,++c}}++a,++o}return n.join("")},Vs=Ge.exports,Hs=function(e,t,r){for(var n in t)Vs(e,n,t[n],r);return e},Ys=Ue,Gs=Ts,$s=Or,Ws=O,Qs=rs,Ks=Ge.exports,Xs=Hs,Js=Ln,Zs=za,ec=xt,tc=ns,rc=Z,nc=Mn,ic=_u,oc=Ue,ac=S,uc=mn,sc=$r,cc=d,fc=function(e){var t=Gs(e);if("function"!=typeof t)throw TypeError(String(e)+" is not iterable");return Ys(t.call(e))},lc=Ts,hc=he,dc=Ws("fetch"),pc=Ws("Request"),vc=pc&&pc.prototype,yc=Ws("Headers"),mc=hc("iterator"),gc="URLSearchParams",bc="URLSearchParamsIterator",wc=ec.set,xc=ec.getterFor(gc),kc=ec.getterFor(bc),Sc=/\+/g,_c=Array(4),Tc=function(e){return _c[e-1]||(_c[e-1]=RegExp("((?:%[\\da-f]{2}){"+e+"})","gi"))},Oc=function(e){try{return decodeURIComponent(e)}catch(t){return e}},Ac=function(e){var t=e.replace(Sc," "),r=4;try{return decodeURIComponent(t)}catch(e){for(;r;)t=t.replace(Tc(r--),Oc);return t}},Ec=/[!'()~]|%20/g,Rc={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Pc=function(e){return Rc[e]},jc=function(e){return encodeURIComponent(e).replace(Ec,Pc)},Ic=function(e,t){if(t)for(var r,n,i=t.split("&"),o=0;o<i.length;)(r=i[o++]).length&&(n=r.split("="),e.push({key:Ac(n.shift()),value:Ac(n.join("="))}))},Lc=function(e){this.entries.length=0,Ic(this.entries,e)},Cc=function(e,t){if(e<t)throw TypeError("Not enough arguments")},Mc=Zs((function(e,t){wc(this,{type:bc,iterator:fc(xc(e).entries),kind:t})}),"Iterator",(function(){var e=kc(this),t=e.kind,r=e.iterator.next(),n=r.value;return r.done||(r.value="keys"===t?n.key:"values"===t?n.value:[n.key,n.value]),r})),Dc=function(){tc(this,Dc,gc);var e,t,r,n,i,o,a,u,s,c=arguments.length>0?arguments[0]:void 0,f=this,l=[];if(wc(f,{type:gc,entries:l,updateURL:function(){},updateSearchParams:Lc}),void 0!==c)if(ac(c))if("function"==typeof(e=lc(c)))for(r=(t=e.call(c)).next;!(n=r.call(t)).done;){if((a=(o=(i=fc(oc(n.value))).next).call(i)).done||(u=o.call(i)).done||!o.call(i).done)throw TypeError("Expected sequence with length 2");l.push({key:uc(a.value),value:uc(u.value)})}else for(s in c)rc(c,s)&&l.push({key:s,value:uc(c[s])});else Ic(l,"string"==typeof c?"?"===c.charAt(0)?c.slice(1):c:uc(c))},Uc=Dc.prototype;if(Xs(Uc,{append:function(e,t){Cc(arguments.length,2);var r=xc(this);r.entries.push({key:uc(e),value:uc(t)}),r.updateURL()},delete:function(e){Cc(arguments.length,1);for(var t=xc(this),r=t.entries,n=uc(e),i=0;i<r.length;)r[i].key===n?r.splice(i,1):i++;t.updateURL()},get:function(e){Cc(arguments.length,1);for(var t=xc(this).entries,r=uc(e),n=0;n<t.length;n++)if(t[n].key===r)return t[n].value;return null},getAll:function(e){Cc(arguments.length,1);for(var t=xc(this).entries,r=uc(e),n=[],i=0;i<t.length;i++)t[i].key===r&&n.push(t[i].value);return n},has:function(e){Cc(arguments.length,1);for(var t=xc(this).entries,r=uc(e),n=0;n<t.length;)if(t[n++].key===r)return!0;return!1},set:function(e,t){Cc(arguments.length,1);for(var r,n=xc(this),i=n.entries,o=!1,a=uc(e),u=uc(t),s=0;s<i.length;s++)(r=i[s]).key===a&&(o?i.splice(s--,1):(o=!0,r.value=u));o||i.push({key:a,value:u}),n.updateURL()},sort:function(){var e,t,r,n=xc(this),i=n.entries,o=i.slice();for(i.length=0,r=0;r<o.length;r++){for(e=o[r],t=0;t<r;t++)if(i[t].key>e.key){i.splice(t,0,e);break}t===r&&i.push(e)}n.updateURL()},forEach:function(e){for(var t,r=xc(this).entries,n=nc(e,arguments.length>1?arguments[1]:void 0,3),i=0;i<r.length;)n((t=r[i++]).value,t.key,this)},keys:function(){return new Mc(this,"keys")},values:function(){return new Mc(this,"values")},entries:function(){return new Mc(this,"entries")}},{enumerable:!0}),Ks(Uc,mc,Uc.entries),Ks(Uc,"toString",(function(){for(var e,t=xc(this).entries,r=[],n=0;n<t.length;)e=t[n++],r.push(jc(e.key)+"="+jc(e.value));return r.join("&")}),{enumerable:!0}),Js(Dc,gc),$s({global:!0,forced:!Qs},{URLSearchParams:Dc}),!Qs&&"function"==typeof yc){var Bc=function(e){if(ac(e)){var t,r=e.body;if(ic(r)===gc)return(t=e.headers?new yc(e.headers):new yc).has("content-type")||t.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),sc(e,{body:cc(0,String(r)),headers:cc(0,t)})}return e};if("function"==typeof dc&&$s({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return dc(e,arguments.length>1?Bc(arguments[1]):{})}}),"function"==typeof pc){var Nc=function(e){return tc(this,Nc,"Request"),new pc(e,arguments.length>1?Bc(arguments[1]):{})};vc.constructor=Nc,Nc.prototype=vc,$s({global:!0,forced:!0},{Request:Nc})}}var Fc,qc={URLSearchParams:Dc,getState:xc},zc=Or,Vc=a,Hc=rs,Yc=n,Gc=Cr,$c=Ge.exports,Wc=ns,Qc=Z,Kc=ds,Xc=Ls,Jc=Cu.codeAt,Zc=function(e){var t,r,n=[],i=e.toLowerCase().replace(Ds,".").split(".");for(t=0;t<i.length;t++)r=i[t],n.push(Ms.test(r)?"xn--"+zs(r):r);return n.join(".")},ef=mn,tf=Ln,rf=qc,nf=xt,of=Yc.URL,af=rf.URLSearchParams,uf=rf.getState,sf=nf.set,cf=nf.getterFor("URL"),ff=Math.floor,lf=Math.pow,hf="Invalid scheme",df="Invalid host",pf="Invalid port",vf=/[A-Za-z]/,yf=/[\d+-.A-Za-z]/,mf=/\d/,gf=/^0x/i,bf=/^[0-7]+$/,wf=/^\d+$/,xf=/^[\dA-Fa-f]+$/,kf=/[\0\t\n\r #%/:<>?@[\\\]^|]/,Sf=/[\0\t\n\r #/:<>?@[\\\]^|]/,_f=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,Tf=/[\t\n\r]/g,Of=function(e,t){var r,n,i;if("["==t.charAt(0)){if("]"!=t.charAt(t.length-1))return df;if(!(r=Ef(t.slice(1,-1))))return df;e.host=r}else if(Df(e)){if(t=Zc(t),kf.test(t))return df;if(null===(r=Af(t)))return df;e.host=r}else{if(Sf.test(t))return df;for(r="",n=Xc(t),i=0;i<n.length;i++)r+=Cf(n[i],Pf);e.host=r}},Af=function(e){var t,r,n,i,o,a,u,s=e.split(".");if(s.length&&""==s[s.length-1]&&s.pop(),(t=s.length)>4)return e;for(r=[],n=0;n<t;n++){if(""==(i=s[n]))return e;if(o=10,i.length>1&&"0"==i.charAt(0)&&(o=gf.test(i)?16:8,i=i.slice(8==o?1:2)),""===i)a=0;else{if(!(10==o?wf:8==o?bf:xf).test(i))return e;a=parseInt(i,o)}r.push(a)}for(n=0;n<t;n++)if(a=r[n],n==t-1){if(a>=lf(256,5-t))return null}else if(a>255)return null;for(u=r.pop(),n=0;n<r.length;n++)u+=r[n]*lf(256,3-n);return u},Ef=function(e){var t,r,n,i,o,a,u,s=[0,0,0,0,0,0,0,0],c=0,f=null,l=0,h=function(){return e.charAt(l)};if(":"==h()){if(":"!=e.charAt(1))return;l+=2,f=++c}for(;h();){if(8==c)return;if(":"!=h()){for(t=r=0;r<4&&xf.test(h());)t=16*t+parseInt(h(),16),l++,r++;if("."==h()){if(0==r)return;if(l-=r,c>6)return;for(n=0;h();){if(i=null,n>0){if(!("."==h()&&n<4))return;l++}if(!mf.test(h()))return;for(;mf.test(h());){if(o=parseInt(h(),10),null===i)i=o;else{if(0==i)return;i=10*i+o}if(i>255)return;l++}s[c]=256*s[c]+i,2!=++n&&4!=n||c++}if(4!=n)return;break}if(":"==h()){if(l++,!h())return}else if(h())return;s[c++]=t}else{if(null!==f)return;l++,f=++c}}if(null!==f)for(a=c-f,c=7;0!=c&&a>0;)u=s[c],s[c--]=s[f+a-1],s[f+--a]=u;else if(8!=c)return;return s},Rf=function(e){var t,r,n,i;if("number"==typeof e){for(t=[],r=0;r<4;r++)t.unshift(e%256),e=ff(e/256);return t.join(".")}if("object"==typeof e){for(t="",n=function(e){for(var t=null,r=1,n=null,i=0,o=0;o<8;o++)0!==e[o]?(i>r&&(t=n,r=i),n=null,i=0):(null===n&&(n=o),++i);return i>r&&(t=n,r=i),t}(e),r=0;r<8;r++)i&&0===e[r]||(i&&(i=!1),n===r?(t+=r?":":"::",i=!0):(t+=e[r].toString(16),r<7&&(t+=":")));return"["+t+"]"}return e},Pf={},jf=Kc({},Pf,{" ":1,'"':1,"<":1,">":1,"`":1}),If=Kc({},jf,{"#":1,"?":1,"{":1,"}":1}),Lf=Kc({},If,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Cf=function(e,t){var r=Jc(e,0);return r>32&&r<127&&!Qc(t,e)?e:encodeURIComponent(e)},Mf={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Df=function(e){return Qc(Mf,e.scheme)},Uf=function(e){return""!=e.username||""!=e.password},Bf=function(e){return!e.host||e.cannotBeABaseURL||"file"==e.scheme},Nf=function(e,t){var r;return 2==e.length&&vf.test(e.charAt(0))&&(":"==(r=e.charAt(1))||!t&&"|"==r)},Ff=function(e){var t;return e.length>1&&Nf(e.slice(0,2))&&(2==e.length||"/"===(t=e.charAt(2))||"\\"===t||"?"===t||"#"===t)},qf=function(e){var t=e.path,r=t.length;!r||"file"==e.scheme&&1==r&&Nf(t[0],!0)||t.pop()},zf=function(e){return"."===e||"%2e"===e.toLowerCase()},Vf={},Hf={},Yf={},Gf={},$f={},Wf={},Qf={},Kf={},Xf={},Jf={},Zf={},el={},tl={},rl={},nl={},il={},ol={},al={},ul={},sl={},cl={},fl=function(e,t,r,n){var i,o,a,u,s,c=r||Vf,f=0,l="",h=!1,d=!1,p=!1;for(r||(e.scheme="",e.username="",e.password="",e.host=null,e.port=null,e.path=[],e.query=null,e.fragment=null,e.cannotBeABaseURL=!1,t=t.replace(_f,"")),t=t.replace(Tf,""),i=Xc(t);f<=i.length;){switch(o=i[f],c){case Vf:if(!o||!vf.test(o)){if(r)return hf;c=Yf;continue}l+=o.toLowerCase(),c=Hf;break;case Hf:if(o&&(yf.test(o)||"+"==o||"-"==o||"."==o))l+=o.toLowerCase();else{if(":"!=o){if(r)return hf;l="",c=Yf,f=0;continue}if(r&&(Df(e)!=Qc(Mf,l)||"file"==l&&(Uf(e)||null!==e.port)||"file"==e.scheme&&!e.host))return;if(e.scheme=l,r)return void(Df(e)&&Mf[e.scheme]==e.port&&(e.port=null));l="","file"==e.scheme?c=rl:Df(e)&&n&&n.scheme==e.scheme?c=Gf:Df(e)?c=Kf:"/"==i[f+1]?(c=$f,f++):(e.cannotBeABaseURL=!0,e.path.push(""),c=ul)}break;case Yf:if(!n||n.cannotBeABaseURL&&"#"!=o)return hf;if(n.cannotBeABaseURL&&"#"==o){e.scheme=n.scheme,e.path=n.path.slice(),e.query=n.query,e.fragment="",e.cannotBeABaseURL=!0,c=cl;break}c="file"==n.scheme?rl:Wf;continue;case Gf:if("/"!=o||"/"!=i[f+1]){c=Wf;continue}c=Xf,f++;break;case $f:if("/"==o){c=Jf;break}c=al;continue;case Wf:if(e.scheme=n.scheme,o==Fc)e.username=n.username,e.password=n.password,e.host=n.host,e.port=n.port,e.path=n.path.slice(),e.query=n.query;else if("/"==o||"\\"==o&&Df(e))c=Qf;else if("?"==o)e.username=n.username,e.password=n.password,e.host=n.host,e.port=n.port,e.path=n.path.slice(),e.query="",c=sl;else{if("#"!=o){e.username=n.username,e.password=n.password,e.host=n.host,e.port=n.port,e.path=n.path.slice(),e.path.pop(),c=al;continue}e.username=n.username,e.password=n.password,e.host=n.host,e.port=n.port,e.path=n.path.slice(),e.query=n.query,e.fragment="",c=cl}break;case Qf:if(!Df(e)||"/"!=o&&"\\"!=o){if("/"!=o){e.username=n.username,e.password=n.password,e.host=n.host,e.port=n.port,c=al;continue}c=Jf}else c=Xf;break;case Kf:if(c=Xf,"/"!=o||"/"!=l.charAt(f+1))continue;f++;break;case Xf:if("/"!=o&&"\\"!=o){c=Jf;continue}break;case Jf:if("@"==o){h&&(l="%40"+l),h=!0,a=Xc(l);for(var v=0;v<a.length;v++){var y=a[v];if(":"!=y||p){var m=Cf(y,Lf);p?e.password+=m:e.username+=m}else p=!0}l=""}else if(o==Fc||"/"==o||"?"==o||"#"==o||"\\"==o&&Df(e)){if(h&&""==l)return"Invalid authority";f-=Xc(l).length+1,l="",c=Zf}else l+=o;break;case Zf:case el:if(r&&"file"==e.scheme){c=il;continue}if(":"!=o||d){if(o==Fc||"/"==o||"?"==o||"#"==o||"\\"==o&&Df(e)){if(Df(e)&&""==l)return df;if(r&&""==l&&(Uf(e)||null!==e.port))return;if(u=Of(e,l))return u;if(l="",c=ol,r)return;continue}"["==o?d=!0:"]"==o&&(d=!1),l+=o}else{if(""==l)return df;if(u=Of(e,l))return u;if(l="",c=tl,r==el)return}break;case tl:if(!mf.test(o)){if(o==Fc||"/"==o||"?"==o||"#"==o||"\\"==o&&Df(e)||r){if(""!=l){var g=parseInt(l,10);if(g>65535)return pf;e.port=Df(e)&&g===Mf[e.scheme]?null:g,l=""}if(r)return;c=ol;continue}return pf}l+=o;break;case rl:if(e.scheme="file","/"==o||"\\"==o)c=nl;else{if(!n||"file"!=n.scheme){c=al;continue}if(o==Fc)e.host=n.host,e.path=n.path.slice(),e.query=n.query;else if("?"==o)e.host=n.host,e.path=n.path.slice(),e.query="",c=sl;else{if("#"!=o){Ff(i.slice(f).join(""))||(e.host=n.host,e.path=n.path.slice(),qf(e)),c=al;continue}e.host=n.host,e.path=n.path.slice(),e.query=n.query,e.fragment="",c=cl}}break;case nl:if("/"==o||"\\"==o){c=il;break}n&&"file"==n.scheme&&!Ff(i.slice(f).join(""))&&(Nf(n.path[0],!0)?e.path.push(n.path[0]):e.host=n.host),c=al;continue;case il:if(o==Fc||"/"==o||"\\"==o||"?"==o||"#"==o){if(!r&&Nf(l))c=al;else if(""==l){if(e.host="",r)return;c=ol}else{if(u=Of(e,l))return u;if("localhost"==e.host&&(e.host=""),r)return;l="",c=ol}continue}l+=o;break;case ol:if(Df(e)){if(c=al,"/"!=o&&"\\"!=o)continue}else if(r||"?"!=o)if(r||"#"!=o){if(o!=Fc&&(c=al,"/"!=o))continue}else e.fragment="",c=cl;else e.query="",c=sl;break;case al:if(o==Fc||"/"==o||"\\"==o&&Df(e)||!r&&("?"==o||"#"==o)){if(".."===(s=(s=l).toLowerCase())||"%2e."===s||".%2e"===s||"%2e%2e"===s?(qf(e),"/"==o||"\\"==o&&Df(e)||e.path.push("")):zf(l)?"/"==o||"\\"==o&&Df(e)||e.path.push(""):("file"==e.scheme&&!e.path.length&&Nf(l)&&(e.host&&(e.host=""),l=l.charAt(0)+":"),e.path.push(l)),l="","file"==e.scheme&&(o==Fc||"?"==o||"#"==o))for(;e.path.length>1&&""===e.path[0];)e.path.shift();"?"==o?(e.query="",c=sl):"#"==o&&(e.fragment="",c=cl)}else l+=Cf(o,If);break;case ul:"?"==o?(e.query="",c=sl):"#"==o?(e.fragment="",c=cl):o!=Fc&&(e.path[0]+=Cf(o,Pf));break;case sl:r||"#"!=o?o!=Fc&&("'"==o&&Df(e)?e.query+="%27":e.query+="#"==o?"%23":Cf(o,Pf)):(e.fragment="",c=cl);break;case cl:o!=Fc&&(e.fragment+=Cf(o,jf))}f++}},ll=function(e){var t,r,n=Wc(this,ll,"URL"),i=arguments.length>1?arguments[1]:void 0,o=ef(e),a=sf(n,{type:"URL"});if(void 0!==i)if(i instanceof ll)t=cf(i);else if(r=fl(t={},ef(i)))throw TypeError(r);if(r=fl(a,o,null,t))throw TypeError(r);var u=a.searchParams=new af,s=uf(u);s.updateSearchParams(a.query),s.updateURL=function(){a.query=String(u)||null},Vc||(n.href=dl.call(n),n.origin=pl.call(n),n.protocol=vl.call(n),n.username=yl.call(n),n.password=ml.call(n),n.host=gl.call(n),n.hostname=bl.call(n),n.port=wl.call(n),n.pathname=xl.call(n),n.search=kl.call(n),n.searchParams=Sl.call(n),n.hash=_l.call(n))},hl=ll.prototype,dl=function(){var e=cf(this),t=e.scheme,r=e.username,n=e.password,i=e.host,o=e.port,a=e.path,u=e.query,s=e.fragment,c=t+":";return null!==i?(c+="//",Uf(e)&&(c+=r+(n?":"+n:"")+"@"),c+=Rf(i),null!==o&&(c+=":"+o)):"file"==t&&(c+="//"),c+=e.cannotBeABaseURL?a[0]:a.length?"/"+a.join("/"):"",null!==u&&(c+="?"+u),null!==s&&(c+="#"+s),c},pl=function(){var e=cf(this),t=e.scheme,r=e.port;if("blob"==t)try{return new ll(t.path[0]).origin}catch(e){return"null"}return"file"!=t&&Df(e)?t+"://"+Rf(e.host)+(null!==r?":"+r:""):"null"},vl=function(){return cf(this).scheme+":"},yl=function(){return cf(this).username},ml=function(){return cf(this).password},gl=function(){var e=cf(this),t=e.host,r=e.port;return null===t?"":null===r?Rf(t):Rf(t)+":"+r},bl=function(){var e=cf(this).host;return null===e?"":Rf(e)},wl=function(){var e=cf(this).port;return null===e?"":String(e)},xl=function(){var e=cf(this),t=e.path;return e.cannotBeABaseURL?t[0]:t.length?"/"+t.join("/"):""},kl=function(){var e=cf(this).query;return e?"?"+e:""},Sl=function(){return cf(this).searchParams},_l=function(){var e=cf(this).fragment;return e?"#"+e:""},Tl=function(e,t){return{get:e,set:t,configurable:!0,enumerable:!0}};if(Vc&&Gc(hl,{href:Tl(dl,(function(e){var t=cf(this),r=ef(e),n=fl(t,r);if(n)throw TypeError(n);uf(t.searchParams).updateSearchParams(t.query)})),origin:Tl(pl),protocol:Tl(vl,(function(e){var t=cf(this);fl(t,ef(e)+":",Vf)})),username:Tl(yl,(function(e){var t=cf(this),r=Xc(ef(e));if(!Bf(t)){t.username="";for(var n=0;n<r.length;n++)t.username+=Cf(r[n],Lf)}})),password:Tl(ml,(function(e){var t=cf(this),r=Xc(ef(e));if(!Bf(t)){t.password="";for(var n=0;n<r.length;n++)t.password+=Cf(r[n],Lf)}})),host:Tl(gl,(function(e){var t=cf(this);t.cannotBeABaseURL||fl(t,ef(e),Zf)})),hostname:Tl(bl,(function(e){var t=cf(this);t.cannotBeABaseURL||fl(t,ef(e),el)})),port:Tl(wl,(function(e){var t=cf(this);Bf(t)||(""==(e=ef(e))?t.port=null:fl(t,e,tl))})),pathname:Tl(xl,(function(e){var t=cf(this);t.cannotBeABaseURL||(t.path=[],fl(t,ef(e),ol))})),search:Tl(kl,(function(e){var t=cf(this);""==(e=ef(e))?t.query=null:("?"==e.charAt(0)&&(e=e.slice(1)),t.query="",fl(t,e,sl)),uf(t.searchParams).updateSearchParams(t.query)})),searchParams:Tl(Sl),hash:Tl(_l,(function(e){var t=cf(this);""!=(e=ef(e))?("#"==e.charAt(0)&&(e=e.slice(1)),t.fragment="",fl(t,e,cl)):t.fragment=null}))}),$c(hl,"toJSON",(function(){return dl.call(this)}),{enumerable:!0}),$c(hl,"toString",(function(){return dl.call(this)}),{enumerable:!0}),of){var Ol=of.createObjectURL,Al=of.revokeObjectURL;Ol&&$c(ll,"createObjectURL",(function(e){return Ol.apply(of,arguments)})),Al&&$c(ll,"revokeObjectURL",(function(e){return Al.apply(of,arguments)}))}tf(ll,"URL"),zc({global:!0,forced:!Hc,sham:!Vc},{URL:ll});var El=n.Promise,Rl=O,Pl=Me,jl=a,Il=he("species"),Ll=function(e){var t=Rl(e),r=Pl.f;jl&&t&&!t[Il]&&r(t,Il,{configurable:!0,get:function(){return this}})},Cl=Ue,Ml=xs,Dl=Dt,Ul=Mn,Bl=Ts,Nl=vs,Fl=function(e,t){this.stopped=e,this.result=t},ql=he("iterator"),zl=!1;try{var Vl=0,Hl={next:function(){return{done:!!Vl++}},return:function(){zl=!0}};Hl[ql]=function(){return this},Array.from(Hl,(function(){throw 2}))}catch(e){}var Yl,Gl,$l,Wl,Ql=function(e,t){if(!t&&!zl)return!1;var r=!1;try{var n={};n[ql]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(e){}return r},Kl=Ue,Xl=Ar,Jl=he("species"),Zl=function(e,t){var r,n=Kl(e).constructor;return void 0===n||null==(r=Kl(n)[Jl])?t:Xl(r)},eh=/(?:ipad|iphone|ipod).*applewebkit/i.test(A),th="process"==v(n.process),rh=n,nh=o,ih=Mn,oh=Mr,ah=_e,uh=eh,sh=th,ch=rh.setImmediate,fh=rh.clearImmediate,lh=rh.process,hh=rh.MessageChannel,dh=rh.Dispatch,ph=0,vh={},yh="onreadystatechange";try{Yl=rh.location}catch(e){}var mh=function(e){if(vh.hasOwnProperty(e)){var t=vh[e];delete vh[e],t()}},gh=function(e){return function(){mh(e)}},bh=function(e){mh(e.data)},wh=function(e){rh.postMessage(String(e),Yl.protocol+"//"+Yl.host)};ch&&fh||(ch=function(e){for(var t=[],r=arguments.length,n=1;r>n;)t.push(arguments[n++]);return vh[++ph]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},Gl(ph),ph},fh=function(e){delete vh[e]},sh?Gl=function(e){lh.nextTick(gh(e))}:dh&&dh.now?Gl=function(e){dh.now(gh(e))}:hh&&!uh?(Wl=($l=new hh).port2,$l.port1.onmessage=bh,Gl=ih(Wl.postMessage,Wl,1)):rh.addEventListener&&"function"==typeof postMessage&&!rh.importScripts&&Yl&&"file:"!==Yl.protocol&&!nh(wh)?(Gl=wh,rh.addEventListener("message",bh,!1)):Gl=yh in ah("script")?function(e){oh.appendChild(ah("script")).onreadystatechange=function(){oh.removeChild(this),mh(e)}}:function(e){setTimeout(gh(e),0)});var xh,kh,Sh,_h,Th,Oh,Ah,Eh,Rh={set:ch,clear:fh},Ph=n,jh=/ipad|iphone|ipod/i.test(A)&&void 0!==Ph.Pebble,Ih=/web0s(?!.*chrome)/i.test(A),Lh=n,Ch=i.f,Mh=Rh.set,Dh=eh,Uh=jh,Bh=Ih,Nh=th,Fh=Lh.MutationObserver||Lh.WebKitMutationObserver,qh=Lh.document,zh=Lh.process,Vh=Lh.Promise,Hh=Ch(Lh,"queueMicrotask"),Yh=Hh&&Hh.value;Yh||(xh=function(){var e,t;for(Nh&&(e=zh.domain)&&e.exit();kh;){t=kh.fn,kh=kh.next;try{t()}catch(e){throw kh?_h():Sh=void 0,e}}Sh=void 0,e&&e.enter()},Dh||Nh||Bh||!Fh||!qh?!Uh&&Vh&&Vh.resolve?((Ah=Vh.resolve(void 0)).constructor=Vh,Eh=Ah.then,_h=function(){Eh.call(Ah,xh)}):_h=Nh?function(){zh.nextTick(xh)}:function(){Mh.call(Lh,xh)}:(Th=!0,Oh=qh.createTextNode(""),new Fh(xh).observe(Oh,{characterData:!0}),_h=function(){Oh.data=Th=!Th}));var Gh=Yh||function(e){var t={fn:e,next:void 0};Sh&&(Sh.next=t),kh||(kh=t,_h()),Sh=t},$h={},Wh=Ar,Qh=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n})),this.resolve=Wh(t),this.reject=Wh(r)};$h.f=function(e){return new Qh(e)};var Kh,Xh,Jh,Zh,ed=Ue,td=S,rd=$h,nd=function(e,t){if(ed(e),td(t)&&t.constructor===e)return t;var r=rd.f(e);return(0,r.resolve)(t),r.promise},id=n,od="object"==typeof window,ad=Or,ud=n,sd=O,cd=El,fd=Ge.exports,ld=Hs,hd=Ga,dd=Ln,pd=Ll,vd=S,yd=Ar,md=ns,gd=Je,bd=function(e,t,r){var n,i,o,a,u,s,c,f=r&&r.that,l=!(!r||!r.AS_ENTRIES),h=!(!r||!r.IS_ITERATOR),d=!(!r||!r.INTERRUPTED),p=Ul(t,f,1+l+d),v=function(e){return n&&Nl(n),new Fl(!0,e)},y=function(e){return l?(Cl(e),d?p(e[0],e[1],v):p(e[0],e[1])):d?p(e,v):p(e)};if(h)n=e;else{if("function"!=typeof(i=Bl(e)))throw TypeError("Target is not iterable");if(Ml(i)){for(o=0,a=Dl(e.length);a>o;o++)if((u=y(e[o]))&&u instanceof Fl)return u;return new Fl(!1)}n=i.call(e)}for(s=n.next;!(c=s.call(n)).done;){try{u=y(c.value)}catch(e){throw Nl(n),e}if("object"==typeof u&&u&&u instanceof Fl)return u}return new Fl(!1)},wd=Ql,xd=Zl,kd=Rh.set,Sd=Gh,_d=nd,Td=function(e,t){var r=id.console;r&&r.error&&(1===arguments.length?r.error(e):r.error(e,t))},Od=$h,Ad=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},Ed=xt,Rd=gr,Pd=od,jd=th,Id=C,Ld=he("species"),Cd="Promise",Md=Ed.get,Dd=Ed.set,Ud=Ed.getterFor(Cd),Bd=cd&&cd.prototype,Nd=cd,Fd=Bd,qd=ud.TypeError,zd=ud.document,Vd=ud.process,Hd=Od.f,Yd=Hd,Gd=!!(zd&&zd.createEvent&&ud.dispatchEvent),$d="function"==typeof PromiseRejectionEvent,Wd="unhandledrejection",Qd=!1,Kd=Rd(Cd,(function(){var e=gd(Nd),t=e!==String(Nd);if(!t&&66===Id)return!0;if(Id>=51&&/native code/.test(e))return!1;var r=new Nd((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};return(r.constructor={})[Ld]=n,!(Qd=r.then((function(){}))instanceof n)||!t&&Pd&&!$d})),Xd=Kd||!wd((function(e){Nd.all(e).catch((function(){}))})),Jd=function(e){var t;return!(!vd(e)||"function"!=typeof(t=e.then))&&t},Zd=function(e,t){if(!e.notified){e.notified=!0;var r=e.reactions;Sd((function(){for(var n=e.value,i=1==e.state,o=0;r.length>o;){var a,u,s,c=r[o++],f=i?c.ok:c.fail,l=c.resolve,h=c.reject,d=c.domain;try{f?(i||(2===e.rejection&&np(e),e.rejection=1),!0===f?a=n:(d&&d.enter(),a=f(n),d&&(d.exit(),s=!0)),a===c.promise?h(qd("Promise-chain cycle")):(u=Jd(a))?u.call(a,l,h):l(a)):h(n)}catch(e){d&&!s&&d.exit(),h(e)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&tp(e)}))}},ep=function(e,t,r){var n,i;Gd?((n=zd.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),ud.dispatchEvent(n)):n={promise:t,reason:r},!$d&&(i=ud["on"+e])?i(n):e===Wd&&Td("Unhandled promise rejection",r)},tp=function(e){kd.call(ud,(function(){var t,r=e.facade,n=e.value;if(rp(e)&&(t=Ad((function(){jd?Vd.emit("unhandledRejection",n,r):ep(Wd,r,n)})),e.rejection=jd||rp(e)?2:1,t.error))throw t.value}))},rp=function(e){return 1!==e.rejection&&!e.parent},np=function(e){kd.call(ud,(function(){var t=e.facade;jd?Vd.emit("rejectionHandled",t):ep("rejectionhandled",t,e.value)}))},ip=function(e,t,r){return function(n){e(t,n,r)}},op=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,Zd(e,!0))},ap=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw qd("Promise can't be resolved itself");var n=Jd(t);n?Sd((function(){var r={done:!1};try{n.call(t,ip(ap,r,e),ip(op,r,e))}catch(t){op(r,t,e)}})):(e.value=t,e.state=1,Zd(e,!1))}catch(t){op({done:!1},t,e)}}};if(Kd&&(Fd=(Nd=function(e){md(this,Nd,Cd),yd(e),Kh.call(this);var t=Md(this);try{e(ip(ap,t),ip(op,t))}catch(e){op(t,e)}}).prototype,(Kh=function(e){Dd(this,{type:Cd,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=ld(Fd,{then:function(e,t){var r=Ud(this),n=Hd(xd(this,Nd));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=jd?Vd.domain:void 0,r.parent=!0,r.reactions.push(n),0!=r.state&&Zd(r,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),Xh=function(){var e=new Kh,t=Md(e);this.promise=e,this.resolve=ip(ap,t),this.reject=ip(op,t)},Od.f=Hd=function(e){return e===Nd||e===Jh?new Xh(e):Yd(e)},"function"==typeof cd&&Bd!==Object.prototype)){Zh=Bd.then,Qd||(fd(Bd,"then",(function(e,t){var r=this;return new Nd((function(e,t){Zh.call(r,e,t)})).then(e,t)}),{unsafe:!0}),fd(Bd,"catch",Fd.catch,{unsafe:!0}));try{delete Bd.constructor}catch(e){}hd&&hd(Bd,Fd)}ad({global:!0,wrap:!0,forced:Kd},{Promise:Nd}),dd(Nd,Cd,!1),pd(Cd),Jh=sd(Cd),ad({target:Cd,stat:!0,forced:Kd},{reject:function(e){var t=Hd(this);return t.reject.call(void 0,e),t.promise}}),ad({target:Cd,stat:!0,forced:Kd},{resolve:function(e){return _d(this,e)}}),ad({target:Cd,stat:!0,forced:Xd},{all:function(e){var t=this,r=Hd(t),n=r.resolve,i=r.reject,o=Ad((function(){var r=yd(t.resolve),o=[],a=0,u=1;bd(e,(function(e){var s=a++,c=!1;o.push(void 0),u++,r.call(t,e).then((function(e){c||(c=!0,o[s]=e,--u||n(o))}),i)})),--u||n(o)}));return o.error&&i(o.value),r.promise},race:function(e){var t=this,r=Hd(t),n=r.reject,i=Ad((function(){var i=yd(t.resolve);bd(e,(function(e){i.call(t,e).then(r.resolve,n)}))}));return i.error&&n(i.value),r.promise}});var up=Ue,sp=function(){var e=up(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},cp={},fp=o,lp=n.RegExp;cp.UNSUPPORTED_Y=fp((function(){var e=lp("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),cp.BROKEN_CARET=fp((function(){var e=lp("^r","gy");return e.lastIndex=2,null!=e.exec("str")}));var hp,dp,pp=o,vp=n.RegExp,yp=pp((function(){var e=vp(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),mp=o,gp=n.RegExp,bp=mp((function(){var e=gp("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),wp=mn,xp=sp,kp=cp,Sp=z.exports,_p=$r,Tp=xt.get,Op=yp,Ap=bp,Ep=RegExp.prototype.exec,Rp=Sp("native-string-replace",String.prototype.replace),Pp=Ep,jp=(hp=/a/,dp=/b*/g,Ep.call(hp,"a"),Ep.call(dp,"a"),0!==hp.lastIndex||0!==dp.lastIndex),Ip=kp.UNSUPPORTED_Y||kp.BROKEN_CARET,Lp=void 0!==/()??/.exec("")[1];(jp||Lp||Ip||Op||Ap)&&(Pp=function(e){var t,r,n,i,o,a,u,s=this,c=Tp(s),f=wp(e),l=c.raw;if(l)return l.lastIndex=s.lastIndex,t=Pp.call(l,f),s.lastIndex=l.lastIndex,t;var h=c.groups,d=Ip&&s.sticky,p=xp.call(s),v=s.source,y=0,m=f;if(d&&(-1===(p=p.replace("y","")).indexOf("g")&&(p+="g"),m=f.slice(s.lastIndex),s.lastIndex>0&&(!s.multiline||s.multiline&&"\n"!==f.charAt(s.lastIndex-1))&&(v="(?: "+v+")",m=" "+m,y++),r=new RegExp("^(?:"+v+")",p)),Lp&&(r=new RegExp("^"+v+"$(?!\\s)",p)),jp&&(n=s.lastIndex),i=Ep.call(d?r:s,m),d?i?(i.input=i.input.slice(y),i[0]=i[0].slice(y),i.index=s.lastIndex,s.lastIndex+=i[0].length):s.lastIndex=0:jp&&i&&(s.lastIndex=s.global?i.index+i[0].length:n),Lp&&i&&i.length>1&&Rp.call(i[0],r,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(i[o]=void 0)})),i&&h)for(i.groups=a=_p(null),o=0;o<h.length;o++)a[(u=h[o])[0]]=i[u[1]];return i});var Cp=Pp;function Mp(){var e,t,r=new Promise((function(r,n){e=r,t=n}));return r.used=!1,r.resolve=function(){return r.used=!0,e.apply(void 0,arguments)},r.reject=function(){return r.used=!0,t.apply(void 0,arguments)},r}Or({target:"RegExp",proto:!0,forced:/./.exec!==Cp},{exec:Cp});var Dp,Up=function(){function e(){Co(this,e)}return Do(e,null,[{key:"start",value:function(e){return e&&e.length?1===e.length&&e.end(0)-e.start(0)<1e-6||1===e.length&&e.start(0)<0?0:e.start(0):0}},{key:"end",value:function(e){return e&&e.length?1===e.length&&e.end(0)-e.start(0)<1e-6?0:e.end(e.length-1):0}},{key:"get",value:function(e){if(e)try{return e.buffered}catch(e){}}},{key:"buffers",value:function(e,t){if(!e||!e.length)return[];for(var r=[],n=0,i=e.length;n<i;n++){var o=r.length;if(o&&t){var a=r[o-1],u=a[1];if(e.start(n)-u<=t){var s=e.end(n);s>u&&(a[1]=s)}else r.push([e.start(n),e.end(n)])}else r.push([e.start(n),e.end(n)])}return r}},{key:"length",value:function(e){return e&&e.length?e.reduce((function(e,t){return e+(t[1]-t[0])}),0):0}},{key:"info",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!t||!t.length)return{start:0,end:0,buffers:[]};for(var i=0,o=0,a=0,u=0,s=0,c=0,f=0,l=e.buffers(t,n),h=0,d=l.length;h<d;h++){var p=l[h];if(r+n>=p[0]&&r<p[1])i=p[0],o=p[1],a=h;else{if(r+n<p[0]){u=p[0],s=p[1];break}r+n>p[1]&&(c=p[0],f=p[1])}}return{start:i,end:o,index:a,buffers:l,nextStart:u,nextEnd:s,prevStart:c,prevEnd:f,currentTime:r,behind:r-i,remaining:o?o-r:0,length:e.length&&e.length(l)}}}]),e}();function Bp(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=zo(e);if(t){var i=zo(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return qo(this,r)}}var Np="network",Fp="network_timeout",qp="demux",zp="remux",Vp="media",Hp="other",Yp={FLV:"FLV",HLS:"HLS",MP4:"MP4",FMP4:"FMP4",MSE_ADD_SB:"MSE_ADD_SB",MSE_APPEND_BUFFER:"MSE_APPEND_BUFFER",MSE_OTHER:"MSE_OTHER",OPTION:"OPTION"},Gp=(Vo(Dp={},"manifest",{HLS:1100}),Vo(Dp,Np,2100),Vo(Dp,Fp,2101),Vo(Dp,qp,{FLV:3100,HLS:3200,MP4:3300,FMP4:3400}),Vo(Dp,zp,{FMP4:4100,MP4:4200}),Vo(Dp,Vp,{MSE_ADD_SB:5200,MSE_APPEND_BUFFER:5201,MSE_OTHER:5202}),Vo(Dp,Hp,8e3),Dp),$p=function(e){No(r,e);var t=Bp(r);function r(e,n,i,o,a){var u;return Co(this,r),(u=t.call(this,a||(null==i?void 0:i.message))).errorType=e===Fp?Np:e,u.originError=i,u.ext=o,u.errorCode=Gp[e][n]||Gp[e],u.errorMessage=u.message,u.errorCode||(u.errorType=Hp,u.errorCode=Gp[u.errorType]),u}return Do(r,null,[{key:"create",value:function(e,t,n,i,o){return e instanceof r?e:(e instanceof Error&&(n=e,e=""),e||(e=Hp),new r(e,t,n,i,o))}},{key:"network",value:function(e){var t;return new r(null!=e&&e.isTimeout?Fp:Np,e,null,{url:null==e?void 0:e.url,response:null==e?void 0:e.response,httpCode:null==e||null===(t=e.response)||void 0===t?void 0:t.status})}}]),r}(fa(Error)),Wp="undefined"!=typeof window?window.MediaSource||window.WebKitMediaSource:null,Qp={UPDATE_ERROR:"updateError"},Kp=function(){function e(t){var r=this;Co(this,e),Vo(this,"media",null),Vo(this,"mediaSource",null),Vo(this,"_openPromise",Mp()),Vo(this,"_queue",Object.create(null)),Vo(this,"_sourceBuffer",Object.create(null)),Vo(this,"_onSBUpdateEnd",(function(e){var t=r._queue[e];if(t){var n=t.shift();n&&(n.promise.resolve(),r._startQueue(e))}})),Vo(this,"_onSBUpdateError",(function(e,t){var n=r._queue[e];if(n){var i=n[0];i&&i.promise.reject(new $p(Vp,Yp.MSE_APPEND_BUFFER,t))}})),t&&this.bindMedia(t)}var t,r,n;return Do(e,[{key:"isOpened",get:function(){var e;return"open"===(null===(e=this.mediaSource)||void 0===e?void 0:e.readyState)}},{key:"duration",get:function(){var e;return(null===(e=this.mediaSource)||void 0===e?void 0:e.duration)||-1}},{key:"updateDuration",value:function(e){var t=this;return this._enqueueBlockingOp((function(){t.mediaSource&&(t.mediaSource.duration=e)}))}},{key:"open",value:function(){var e=this;if(this._openPromise.used&&!this.isOpened&&this.mediaSource){var t=this.mediaSource;t.addEventListener("sourceopen",(function r(){t.removeEventListener("sourceopen",r),e._openPromise.resolve()})),this._openPromise=Mp()}return this._openPromise}},{key:"bindMedia",value:(n=ua(ha.mark((function e(t){var r,n,i=this;return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.mediaSource&&!this.media){e.next=3;break}return e.next=3,this.unbindMedia();case 3:if(t&&Wp){e.next=5;break}throw new Error("Param media or MediaSource does not exist");case 5:return this.media=t,r=this.mediaSource=new Wp,t.src=URL.createObjectURL(r),n=function e(){r.removeEventListener("sourceopen",e),URL.revokeObjectURL(t.src),i._openPromise.resolve()},r.addEventListener("sourceopen",n),e.abrupt("return",this._openPromise);case 11:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"unbindMedia",value:(r=ua(ha.mark((function e(){var t,r=this;return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._openPromise.used||this._openPromise.resolve(),t=this.mediaSource){if(Object.keys(this._queue).forEach((function(e){var t=r._queue[e];t&&t.forEach((function(e){return e.promise.resolve}))})),"open"===t.readyState)try{t.endOfStream()}catch(e){}Object.keys(this._sourceBuffer).forEach((function(e){try{t.removeSourceBuffer(r._sourceBuffer[e])}catch(e){}}))}if(this.media){this.media.removeAttribute("src");try{this.media.load()}catch(e){}this.media=null}this.mediaSource=null,this._openPromise=Mp(),this._queue=Object.create(null),this._sourceBuffer=Object.create(null);case 8:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"createSource",value:function(e,t){if(!this._sourceBuffer[e]&&this.mediaSource){var r;try{r=this._sourceBuffer[e]=this.mediaSource.addSourceBuffer(t)}catch(e){throw new $p(Vp,Yp.MSE_ADD_SB,e)}r.mimeType=t,r.addEventListener("updateend",this._onSBUpdateEnd.bind(this,e)),r.addEventListener("error",this._onSBUpdateError.bind(this,e))}}},{key:"changeType",value:function(e,t){var r=this._sourceBuffer[e];return this.mediaSource&&r&&r.mimeType!==t&&"function"==typeof r.changeType?this._enqueueOp((function(){r.changeType(t)})):Promise.resolve()}},{key:"createOrChangeSource",value:function(e,t){return this.createSource(e,t),this.changeType(e,t)}},{key:"append",value:function(e,t){var r=this;return t&&t.byteLength&&this._sourceBuffer[e]?this._enqueueOp(e,(function(){r.mediaSource&&r._sourceBuffer[e].appendBuffer(t)})):Promise.resolve()}},{key:"remove",value:function(e,t,r){var n=this;if(1!==Object.keys(this._sourceBuffer).length)return this._enqueueOp(e,(function(){if(n.mediaSource){var i=n._sourceBuffer[e];t>=r||!i?n._onSBUpdateEnd(e):i.remove(t,r)}}))}},{key:"clearBuffer",value:function(e,t){var r,n=this;return Object.keys(this._sourceBuffer).forEach((function(i){r=n._enqueueOp(i,(function(){n.mediaSource&&n._sourceBuffer[i].remove(e,t)}))})),r}},{key:"clearAllBuffer",value:function(){var e,t=this;return Object.keys(this._sourceBuffer).forEach((function(r){e=t._enqueueOp(r,(function(){if(t.mediaSource){var e=t._sourceBuffer[r];e.remove(0,Up.end(Up.get(e)))}}))})),e}},{key:"endOfStream",value:function(e){var t=this;return this.mediaSource&&"open"===this.mediaSource.readyState?this._enqueueBlockingOp((function(){var r=t.mediaSource;r&&"open"===r.readyState&&(e?r.endOfStream(e):r.endOfStream())})):Promise.resolve()}},{key:"setLiveSeekableRange",value:function(e,t){var r=this.mediaSource;e<0||t<e||null==r||!r.setLiveSeekableRange||"open"!==r.readyState||r.setLiveSeekableRange(e,t)}},{key:"buffered",value:function(e){return Up.get(this._sourceBuffer[e])}},{key:"bufferStart",value:function(e){return Up.start(this.buffered(e))}},{key:"bufferEnd",value:function(e){return Up.end(this.buffered(e))}},{key:"_enqueueOp",value:function(e,t){if(!this.mediaSource)return Promise.resolve();var r=this._queue[e]=this._queue[e]||[],n={exec:t,promise:Mp()};return r.push(n),1===r.length&&this._startQueue(e),n.promise}},{key:"_enqueueBlockingOp",value:(t=ua(ha.mark((function e(t){var r,n,i=this;return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.mediaSource){e.next=2;break}return e.abrupt("return",Promise.resolve());case 2:if((r=Object.keys(this._sourceBuffer)).length){e.next=5;break}return e.abrupt("return",t());case 5:return n=[],r.forEach((function(e){var t=i._queue[e],r=Mp();n.push(r),t.push({exec:function(){return r.resolve()},promise:r}),1===t.length&&i._startQueue(e)})),e.abrupt("return",Promise.all(n).then((function(){try{return t()}finally{r.forEach((function(e){var t=i._queue[e],r=i._sourceBuffer[e];null==t||t.shift(),r&&r.updating||i._startQueue(e)}))}})));case 8:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"_startQueue",value:function(e){var t=this._queue[e];if(t){var r=t[0];if(r)try{r.exec()}catch(n){r.promise.reject(new $p(Vp,Yp.MSE_OTHER,n)),t.shift(),this._startQueue(e)}}}}],[{key:"isSupported",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'video/mp4; codecs="avc1.42E01E,mp4a.40.2"';if(!Wp)return!1;try{return Wp.isTypeSupported(e)}catch(e){return!1}}}]),e}();Vo(Kp,"VIDEO","video"),Vo(Kp,"AUDIO","audio");var Xp=ds;Or({target:"Object",stat:!0,forced:Object.assign!==Xp},{assign:Xp});var Jp=Wn.map;Or({target:"Array",proto:!0,forced:!ao("map")},{map:function(e){return Jp(this,e,arguments.length>1?arguments[1]:void 0)}});var Zp=Or,ev=El,tv=o,rv=O,nv=Zl,iv=nd,ov=Ge.exports;if(Zp({target:"Promise",proto:!0,real:!0,forced:!!ev&&tv((function(){ev.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=nv(this,rv("Promise")),r="function"==typeof e;return this.then(r?function(r){return iv(t,e()).then((function(){return r}))}:e,r?function(r){return iv(t,e()).then((function(){throw r}))}:e)}}),"function"==typeof ev){var av=rv("Promise").prototype.finally;ev.prototype.finally!==av&&ov(ev.prototype,"finally",av,{unsafe:!0})}var uv,sv,cv,fv={exports:{}},lv="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,hv=lv,dv=a,pv=n,vv=S,yv=Z,mv=_u,gv=Ye,bv=Ge.exports,wv=Me.f,xv=Ea,kv=Ga,Sv=he,_v=re,Tv=pv.Int8Array,Ov=Tv&&Tv.prototype,Av=pv.Uint8ClampedArray,Ev=Av&&Av.prototype,Rv=Tv&&xv(Tv),Pv=Ov&&xv(Ov),jv=Object.prototype,Iv=jv.isPrototypeOf,Lv=Sv("toStringTag"),Cv=_v("TYPED_ARRAY_TAG"),Mv=_v("TYPED_ARRAY_CONSTRUCTOR"),Dv=hv&&!!kv&&"Opera"!==mv(pv.opera),Uv=!1,Bv={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},Nv={BigInt64Array:8,BigUint64Array:8},Fv=function(e){if(!vv(e))return!1;var t=mv(e);return yv(Bv,t)||yv(Nv,t)};for(uv in Bv)(cv=(sv=pv[uv])&&sv.prototype)?gv(cv,Mv,sv):Dv=!1;for(uv in Nv)(cv=(sv=pv[uv])&&sv.prototype)&&gv(cv,Mv,sv);if((!Dv||"function"!=typeof Rv||Rv===Function.prototype)&&(Rv=function(){throw TypeError("Incorrect invocation")},Dv))for(uv in Bv)pv[uv]&&kv(pv[uv],Rv);if((!Dv||!Pv||Pv===jv)&&(Pv=Rv.prototype,Dv))for(uv in Bv)pv[uv]&&kv(pv[uv].prototype,Pv);if(Dv&&xv(Ev)!==Pv&&kv(Ev,Pv),dv&&!yv(Pv,Lv))for(uv in Uv=!0,wv(Pv,Lv,{get:function(){return vv(this)?this[Cv]:void 0}}),Bv)pv[uv]&&gv(pv[uv],Cv,uv);var qv={NATIVE_ARRAY_BUFFER_VIEWS:Dv,TYPED_ARRAY_CONSTRUCTOR:Mv,TYPED_ARRAY_TAG:Uv&&Cv,aTypedArray:function(e){if(Fv(e))return e;throw TypeError("Target is not a typed array")},aTypedArrayConstructor:function(e){if(kv&&!Iv.call(Rv,e))throw TypeError("Target is not a typed array constructor");return e},exportTypedArrayMethod:function(e,t,r){if(dv){if(r)for(var n in Bv){var i=pv[n];if(i&&yv(i.prototype,e))try{delete i.prototype[e]}catch(e){}}Pv[e]&&!r||bv(Pv,e,r?t:Dv&&Ov[e]||t)}},exportTypedArrayStaticMethod:function(e,t,r){var n,i;if(dv){if(kv){if(r)for(n in Bv)if((i=pv[n])&&yv(i,e))try{delete i[e]}catch(e){}if(Rv[e]&&!r)return;try{return bv(Rv,e,r?t:Dv&&Rv[e]||t)}catch(e){}}for(n in Bv)!(i=pv[n])||i[e]&&!r||bv(i,e,t)}},isView:function(e){if(!vv(e))return!1;var t=mv(e);return"DataView"===t||yv(Bv,t)||yv(Nv,t)},isTypedArray:Fv,TypedArray:Rv,TypedArrayPrototype:Pv},zv=n,Vv=o,Hv=Ql,Yv=qv.NATIVE_ARRAY_BUFFER_VIEWS,Gv=zv.ArrayBuffer,$v=zv.Int8Array,Wv=!Yv||!Vv((function(){$v(1)}))||!Vv((function(){new $v(-1)}))||!Hv((function(e){new $v,new $v(null),new $v(1.5),new $v(e)}),!0)||Vv((function(){return 1!==new $v(new Gv(2),1,void 0).length})),Qv=Lt,Kv=Dt,Xv=function(e){if(void 0===e)return 0;var t=Qv(e),r=Kv(t);if(t!==r)throw RangeError("Wrong length or index");return r},Jv=Math.abs,Zv=Math.pow,ey=Math.floor,ty=Math.log,ry=Math.LN2,ny=K,iy=Ft,oy=Dt,ay=function(e){for(var t=ny(this),r=oy(t.length),n=arguments.length,i=iy(n>1?arguments[1]:void 0,r),o=n>2?arguments[2]:void 0,a=void 0===o?r:iy(o,r);a>i;)t[i++]=e;return t},uy=n,sy=a,cy=lv,fy=Ye,ly=Hs,hy=o,dy=ns,py=Lt,vy=Dt,yy=Xv,my={pack:function(e,t,r){var n,i,o,a=new Array(r),u=8*r-t-1,s=(1<<u)-1,c=s>>1,f=23===t?Zv(2,-24)-Zv(2,-77):0,l=e<0||0===e&&1/e<0?1:0,h=0;for((e=Jv(e))!=e||e===1/0?(i=e!=e?1:0,n=s):(n=ey(ty(e)/ry),e*(o=Zv(2,-n))<1&&(n--,o*=2),(e+=n+c>=1?f/o:f*Zv(2,1-c))*o>=2&&(n++,o/=2),n+c>=s?(i=0,n=s):n+c>=1?(i=(e*o-1)*Zv(2,t),n+=c):(i=e*Zv(2,c-1)*Zv(2,t),n=0));t>=8;a[h++]=255&i,i/=256,t-=8);for(n=n<<t|i,u+=t;u>0;a[h++]=255&n,n/=256,u-=8);return a[--h]|=128*l,a},unpack:function(e,t){var r,n=e.length,i=8*n-t-1,o=(1<<i)-1,a=o>>1,u=i-7,s=n-1,c=e[s--],f=127&c;for(c>>=7;u>0;f=256*f+e[s],s--,u-=8);for(r=f&(1<<-u)-1,f>>=-u,u+=t;u>0;r=256*r+e[s],s--,u-=8);if(0===f)f=1-a;else{if(f===o)return r?NaN:c?-1/0:1/0;r+=Zv(2,t),f-=a}return(c?-1:1)*r*Zv(2,f-t)}},gy=Ea,by=Ga,wy=Pt.f,xy=Me.f,ky=ay,Sy=Ln,_y=xt.get,Ty=xt.set,Oy="ArrayBuffer",Ay="DataView",Ey="Wrong index",Ry=uy.ArrayBuffer,Py=Ry,jy=uy.DataView,Iy=jy&&jy.prototype,Ly=Object.prototype,Cy=uy.RangeError,My=my.pack,Dy=my.unpack,Uy=function(e){return[255&e]},By=function(e){return[255&e,e>>8&255]},Ny=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},Fy=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},qy=function(e){return My(e,23,4)},zy=function(e){return My(e,52,8)},Vy=function(e,t){xy(e.prototype,t,{get:function(){return _y(this)[t]}})},Hy=function(e,t,r,n){var i=yy(r),o=_y(e);if(i+t>o.byteLength)throw Cy(Ey);var a=_y(o.buffer).bytes,u=i+o.byteOffset,s=a.slice(u,u+t);return n?s:s.reverse()},Yy=function(e,t,r,n,i,o){var a=yy(r),u=_y(e);if(a+t>u.byteLength)throw Cy(Ey);for(var s=_y(u.buffer).bytes,c=a+u.byteOffset,f=n(+i),l=0;l<t;l++)s[c+l]=f[o?l:t-l-1]};if(cy){if(!hy((function(){Ry(1)}))||!hy((function(){new Ry(-1)}))||hy((function(){return new Ry,new Ry(1.5),new Ry(NaN),Ry.name!=Oy}))){for(var Gy,$y=(Py=function(e){return dy(this,Py),new Ry(yy(e))}).prototype=Ry.prototype,Wy=wy(Ry),Qy=0;Wy.length>Qy;)(Gy=Wy[Qy++])in Py||fy(Py,Gy,Ry[Gy]);$y.constructor=Py}by&&gy(Iy)!==Ly&&by(Iy,Ly);var Ky=new jy(new Py(2)),Xy=Iy.setInt8;Ky.setInt8(0,2147483648),Ky.setInt8(1,2147483649),!Ky.getInt8(0)&&Ky.getInt8(1)||ly(Iy,{setInt8:function(e,t){Xy.call(this,e,t<<24>>24)},setUint8:function(e,t){Xy.call(this,e,t<<24>>24)}},{unsafe:!0})}else Py=function(e){dy(this,Py,Oy);var t=yy(e);Ty(this,{bytes:ky.call(new Array(t),0),byteLength:t}),sy||(this.byteLength=t)},jy=function(e,t,r){dy(this,jy,Ay),dy(e,Py,Ay);var n=_y(e).byteLength,i=py(t);if(i<0||i>n)throw Cy("Wrong offset");if(i+(r=void 0===r?n-i:vy(r))>n)throw Cy("Wrong length");Ty(this,{buffer:e,byteLength:r,byteOffset:i}),sy||(this.buffer=e,this.byteLength=r,this.byteOffset=i)},sy&&(Vy(Py,"byteLength"),Vy(jy,"buffer"),Vy(jy,"byteLength"),Vy(jy,"byteOffset")),ly(jy.prototype,{getInt8:function(e){return Hy(this,1,e)[0]<<24>>24},getUint8:function(e){return Hy(this,1,e)[0]},getInt16:function(e){var t=Hy(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=Hy(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return Fy(Hy(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return Fy(Hy(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return Dy(Hy(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return Dy(Hy(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){Yy(this,1,e,Uy,t)},setUint8:function(e,t){Yy(this,1,e,Uy,t)},setInt16:function(e,t){Yy(this,2,e,By,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){Yy(this,2,e,By,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){Yy(this,4,e,Ny,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){Yy(this,4,e,Ny,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){Yy(this,4,e,qy,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){Yy(this,8,e,zy,t,arguments.length>2?arguments[2]:void 0)}});Sy(Py,Oy),Sy(jy,Ay);var Jy={ArrayBuffer:Py,DataView:jy},Zy=S,em=Math.floor,tm=Lt,rm=function(e){var t=tm(e);if(t<0)throw RangeError("The argument can't be less than 0");return t},nm=function(e,t){var r=rm(e);if(r%t)throw RangeError("Wrong offset");return r},im=K,om=Dt,am=Ts,um=xs,sm=Mn,cm=qv.aTypedArrayConstructor,fm=S,lm=Ga,hm=function(e,t,r){var n,i;return lm&&"function"==typeof(n=t.constructor)&&n!==r&&fm(i=n.prototype)&&i!==r.prototype&&lm(e,i),e},dm=Or,pm=n,vm=a,ym=Wv,mm=qv,gm=Jy,bm=ns,wm=d,xm=Ye,km=function(e){return!Zy(e)&&isFinite(e)&&em(e)===e},Sm=Dt,_m=Xv,Tm=nm,Om=we,Am=Z,Em=_u,Rm=S,Pm=F,jm=$r,Im=Ga,Lm=Pt.f,Cm=function(e){var t,r,n,i,o,a,u=im(e),s=arguments.length,c=s>1?arguments[1]:void 0,f=void 0!==c,l=am(u);if(null!=l&&!um(l))for(a=(o=l.call(u)).next,u=[];!(i=a.call(o)).done;)u.push(i.value);for(f&&s>2&&(c=sm(c,arguments[2],2)),r=om(u.length),n=new(cm(this))(r),t=0;r>t;t++)n[t]=f?c(u[t],t):u[t];return n},Mm=Wn.forEach,Dm=Ll,Um=Me,Bm=i,Nm=hm,Fm=xt.get,qm=xt.set,zm=Um.f,Vm=Bm.f,Hm=Math.round,Ym=pm.RangeError,Gm=gm.ArrayBuffer,$m=gm.DataView,Wm=mm.NATIVE_ARRAY_BUFFER_VIEWS,Qm=mm.TYPED_ARRAY_CONSTRUCTOR,Km=mm.TYPED_ARRAY_TAG,Xm=mm.TypedArray,Jm=mm.TypedArrayPrototype,Zm=mm.aTypedArrayConstructor,eg=mm.isTypedArray,tg="BYTES_PER_ELEMENT",rg="Wrong length",ng=function(e,t){for(var r=0,n=t.length,i=new(Zm(e))(n);n>r;)i[r]=t[r++];return i},ig=function(e,t){zm(e,t,{get:function(){return Fm(this)[t]}})},og=function(e){var t;return e instanceof Gm||"ArrayBuffer"==(t=Em(e))||"SharedArrayBuffer"==t},ag=function(e,t){return eg(e)&&!Pm(t)&&t in e&&km(+t)&&t>=0},ug=function(e,t){return t=Om(t),ag(e,t)?wm(2,e[t]):Vm(e,t)},sg=function(e,t,r){return t=Om(t),!(ag(e,t)&&Rm(r)&&Am(r,"value"))||Am(r,"get")||Am(r,"set")||r.configurable||Am(r,"writable")&&!r.writable||Am(r,"enumerable")&&!r.enumerable?zm(e,t,r):(e[t]=r.value,e)};vm?(Wm||(Bm.f=ug,Um.f=sg,ig(Jm,"buffer"),ig(Jm,"byteOffset"),ig(Jm,"byteLength"),ig(Jm,"length")),dm({target:"Object",stat:!0,forced:!Wm},{getOwnPropertyDescriptor:ug,defineProperty:sg}),fv.exports=function(e,t,r){var n=e.match(/\d+$/)[0]/8,i=e+(r?"Clamped":"")+"Array",o="get"+e,a="set"+e,u=pm[i],s=u,c=s&&s.prototype,f={},l=function(e,t){zm(e,t,{get:function(){return function(e,t){var r=Fm(e);return r.view[o](t*n+r.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,i){var o=Fm(e);r&&(i=(i=Hm(i))<0?0:i>255?255:255&i),o.view[a](t*n+o.byteOffset,i,!0)}(this,t,e)},enumerable:!0})};Wm?ym&&(s=t((function(e,t,r,o){return bm(e,s,i),Nm(Rm(t)?og(t)?void 0!==o?new u(t,Tm(r,n),o):void 0!==r?new u(t,Tm(r,n)):new u(t):eg(t)?ng(s,t):Cm.call(s,t):new u(_m(t)),e,s)})),Im&&Im(s,Xm),Mm(Lm(u),(function(e){e in s||xm(s,e,u[e])})),s.prototype=c):(s=t((function(e,t,r,o){bm(e,s,i);var a,u,c,f=0,h=0;if(Rm(t)){if(!og(t))return eg(t)?ng(s,t):Cm.call(s,t);a=t,h=Tm(r,n);var d=t.byteLength;if(void 0===o){if(d%n)throw Ym(rg);if((u=d-h)<0)throw Ym(rg)}else if((u=Sm(o)*n)+h>d)throw Ym(rg);c=u/n}else c=_m(t),a=new Gm(u=c*n);for(qm(e,{buffer:a,byteOffset:h,byteLength:u,length:c,view:new $m(a)});f<c;)l(e,f++)})),Im&&Im(s,Xm),c=s.prototype=jm(Jm)),c.constructor!==s&&xm(c,"constructor",s),xm(c,Qm,s),Km&&xm(c,Km,i),f[i]=s,dm({global:!0,forced:s!=u,sham:!Wm},f),tg in s||xm(s,tg,n),tg in c||xm(c,tg,n),Dm(i)}):fv.exports=function(){},(0,fv.exports)("Uint8",(function(e){return function(t,r,n){return e(this,t,r,n)}}));var cg=K,fg=Ft,lg=Dt,hg=Math.min,dg=[].copyWithin||function(e,t){var r=cg(this),n=lg(r.length),i=fg(e,n),o=fg(t,n),a=arguments.length>2?arguments[2]:void 0,u=hg((void 0===a?n:fg(a,n))-o,n-i),s=1;for(o<i&&i<o+u&&(s=-1,o+=u-1,i+=u-1);u-- >0;)o in r?r[i]=r[o]:delete r[i],i+=s,o+=s;return r},pg=qv.aTypedArray;(0,qv.exportTypedArrayMethod)("copyWithin",(function(e,t){return dg.call(pg(this),e,t,arguments.length>2?arguments[2]:void 0)}));var vg=Wn.every,yg=qv.aTypedArray;(0,qv.exportTypedArrayMethod)("every",(function(e){return vg(yg(this),e,arguments.length>1?arguments[1]:void 0)}));var mg=ay,gg=qv.aTypedArray;(0,qv.exportTypedArrayMethod)("fill",(function(e){return mg.apply(gg(this),arguments)}));var bg=Zl,wg=qv.TYPED_ARRAY_CONSTRUCTOR,xg=qv.aTypedArrayConstructor,kg=function(e){return xg(bg(e,e[wg]))},Sg=function(e,t){for(var r=0,n=t.length,i=new e(n);n>r;)i[r]=t[r++];return i},_g=kg,Tg=Wn.filter,Og=function(e,t){return Sg(_g(e),t)},Ag=qv.aTypedArray;(0,qv.exportTypedArrayMethod)("filter",(function(e){var t=Tg(Ag(this),e,arguments.length>1?arguments[1]:void 0);return Og(this,t)}));var Eg=Wn.find,Rg=qv.aTypedArray;(0,qv.exportTypedArrayMethod)("find",(function(e){return Eg(Rg(this),e,arguments.length>1?arguments[1]:void 0)}));var Pg=Wn.findIndex,jg=qv.aTypedArray;(0,qv.exportTypedArrayMethod)("findIndex",(function(e){return Pg(jg(this),e,arguments.length>1?arguments[1]:void 0)}));var Ig=Wn.forEach,Lg=qv.aTypedArray;(0,qv.exportTypedArrayMethod)("forEach",(function(e){Ig(Lg(this),e,arguments.length>1?arguments[1]:void 0)}));var Cg=Yt.includes,Mg=qv.aTypedArray;(0,qv.exportTypedArrayMethod)("includes",(function(e){return Cg(Mg(this),e,arguments.length>1?arguments[1]:void 0)}));var Dg=Yt.indexOf,Ug=qv.aTypedArray;(0,qv.exportTypedArrayMethod)("indexOf",(function(e){return Dg(Ug(this),e,arguments.length>1?arguments[1]:void 0)}));var Bg=n,Ng=qv,Fg=mu,qg=he("iterator"),zg=Bg.Uint8Array,Vg=Fg.values,Hg=Fg.keys,Yg=Fg.entries,Gg=Ng.aTypedArray,$g=Ng.exportTypedArrayMethod,Wg=zg&&zg.prototype[qg],Qg=!!Wg&&("values"==Wg.name||null==Wg.name),Kg=function(){return Vg.call(Gg(this))};$g("entries",(function(){return Yg.call(Gg(this))})),$g("keys",(function(){return Hg.call(Gg(this))})),$g("values",Kg,!Qg),$g(qg,Kg,!Qg);var Xg=qv.aTypedArray,Jg=[].join;(0,qv.exportTypedArrayMethod)("join",(function(e){return Jg.apply(Xg(this),arguments)}));var Zg=k,eb=Lt,tb=Dt,rb=mo,nb=Math.min,ib=[].lastIndexOf,ob=!!ib&&1/[1].lastIndexOf(1,-0)<0,ab=rb("lastIndexOf"),ub=ob||!ab?function(e){if(ob)return ib.apply(this,arguments)||0;var t=Zg(this),r=tb(t.length),n=r-1;for(arguments.length>1&&(n=nb(n,eb(arguments[1]))),n<0&&(n=r+n);n>=0;n--)if(n in t&&t[n]===e)return n||0;return-1}:ib,sb=qv.aTypedArray;(0,qv.exportTypedArrayMethod)("lastIndexOf",(function(e){return ub.apply(sb(this),arguments)}));var cb=Wn.map,fb=kg,lb=qv.aTypedArray;(0,qv.exportTypedArrayMethod)("map",(function(e){return cb(lb(this),e,arguments.length>1?arguments[1]:void 0,(function(e,t){return new(fb(e))(t)}))}));var hb=Ar,db=K,pb=g,vb=Dt,yb=function(e){return function(t,r,n,i){hb(r);var o=db(t),a=pb(o),u=vb(o.length),s=e?u-1:0,c=e?-1:1;if(n<2)for(;;){if(s in a){i=a[s],s+=c;break}if(s+=c,e?s<0:u<=s)throw TypeError("Reduce of empty array with no initial value")}for(;e?s>=0:u>s;s+=c)s in a&&(i=r(i,a[s],s,o));return i}},mb={left:yb(!1),right:yb(!0)},gb=mb.left,bb=qv.aTypedArray;(0,qv.exportTypedArrayMethod)("reduce",(function(e){return gb(bb(this),e,arguments.length,arguments.length>1?arguments[1]:void 0)}));var wb=mb.right,xb=qv.aTypedArray;(0,qv.exportTypedArrayMethod)("reduceRight",(function(e){return wb(xb(this),e,arguments.length,arguments.length>1?arguments[1]:void 0)}));var kb=qv.aTypedArray,Sb=qv.exportTypedArrayMethod,_b=Math.floor;Sb("reverse",(function(){for(var e,t=this,r=kb(t).length,n=_b(r/2),i=0;i<n;)e=t[i],t[i++]=t[--r],t[r]=e;return t}));var Tb=Dt,Ob=nm,Ab=K,Eb=qv.aTypedArray;(0,qv.exportTypedArrayMethod)("set",(function(e){Eb(this);var t=Ob(arguments.length>1?arguments[1]:void 0,1),r=this.length,n=Ab(e),i=Tb(n.length),o=0;if(i+t>r)throw RangeError("Wrong length");for(;o<i;)this[t+o]=n[o++]}),o((function(){new Int8Array(1).set({})})));var Rb=kg,Pb=qv.aTypedArray,jb=[].slice;(0,qv.exportTypedArrayMethod)("slice",(function(e,t){for(var r=jb.call(Pb(this),e,t),n=Rb(this),i=0,o=r.length,a=new n(o);o>i;)a[i]=r[i++];return a}),o((function(){new Int8Array(1).slice()})));var Ib=Wn.some,Lb=qv.aTypedArray;(0,qv.exportTypedArrayMethod)("some",(function(e){return Ib(Lb(this),e,arguments.length>1?arguments[1]:void 0)}));var Cb=Math.floor,Mb=function(e,t){var r=e.length,n=Cb(r/2);return r<8?Db(e,t):Ub(Mb(e.slice(0,n),t),Mb(e.slice(n),t),t)},Db=function(e,t){for(var r,n,i=e.length,o=1;o<i;){for(n=o,r=e[o];n&&t(e[n-1],r)>0;)e[n]=e[--n];n!==o++&&(e[n]=r)}return e},Ub=function(e,t,r){for(var n=e.length,i=t.length,o=0,a=0,u=[];o<n||a<i;)o<n&&a<i?u.push(r(e[o],t[a])<=0?e[o++]:t[a++]):u.push(o<n?e[o++]:t[a++]);return u},Bb=Mb,Nb=A.match(/firefox\/(\d+)/i),Fb=!!Nb&&+Nb[1],qb=/MSIE|Trident/.test(A),zb=A.match(/AppleWebKit\/(\d+)\./),Vb=!!zb&&+zb[1],Hb=o,Yb=Ar,Gb=Dt,$b=Bb,Wb=Fb,Qb=qb,Kb=C,Xb=Vb,Jb=qv.aTypedArray,Zb=qv.exportTypedArrayMethod,ew=n.Uint16Array,tw=ew&&ew.prototype.sort,rw=!!tw&&!Hb((function(){var e=new ew(2);e.sort(null),e.sort({})})),nw=!!tw&&!Hb((function(){if(Kb)return Kb<74;if(Wb)return Wb<67;if(Qb)return!0;if(Xb)return Xb<602;var e,t,r=new ew(516),n=Array(516);for(e=0;e<516;e++)t=e%4,r[e]=515-e,n[e]=e-2*t+3;for(r.sort((function(e,t){return(e/4|0)-(t/4|0)})),e=0;e<516;e++)if(r[e]!==n[e])return!0}));Zb("sort",(function(e){var t=this;if(void 0!==e&&Yb(e),nw)return tw.call(t,e);Jb(t);var r,n=Gb(t.length),i=Array(n);for(r=0;r<n;r++)i[r]=t[r];for(i=$b(t,function(e){return function(t,r){return void 0!==e?+e(t,r)||0:r!=r?-1:t!=t?1:0===t&&0===r?1/t>0&&1/r<0?1:-1:t>r}}(e)),r=0;r<n;r++)t[r]=i[r];return t}),!nw||rw);var iw=Dt,ow=Ft,aw=kg,uw=qv.aTypedArray;(0,qv.exportTypedArrayMethod)("subarray",(function(e,t){var r=uw(this),n=r.length,i=ow(e,n);return new(aw(r))(r.buffer,r.byteOffset+i*r.BYTES_PER_ELEMENT,iw((void 0===t?n:ow(t,n))-i))}));var sw=qv,cw=o,fw=n.Int8Array,lw=sw.aTypedArray,hw=sw.exportTypedArrayMethod,dw=[].toLocaleString,pw=[].slice,vw=!!fw&&cw((function(){dw.call(new fw(1))}));hw("toLocaleString",(function(){return dw.apply(vw?pw.call(lw(this)):lw(this),arguments)}),cw((function(){return[1,2].toLocaleString()!=new fw([1,2]).toLocaleString()}))||!cw((function(){fw.prototype.toLocaleString.call([1,2])})));var yw=qv.exportTypedArrayMethod,mw=o,gw=n.Uint8Array,bw=gw&&gw.prototype||{},ww=[].toString,xw=[].join;mw((function(){ww.call({})}))&&(ww=function(){return xw.call(this)});var kw=bw.toString!=ww;yw("toString",ww,kw);var Sw="fetch",_w="xhr",Tw="arraybuffer",Ow="text",Aw="json";function Ew(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=zo(e);if(t){var i=zo(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return qo(this,r)}}var Rw=function(e){No(r,e);var t=Ew(r);function r(e,n,i,o){var a;return Co(this,r),Vo(Uo(a=t.call(this,o)),"retryCount",0),Vo(Uo(a),"isTimeout",!1),Vo(Uo(a),"loaderType",Sw),Vo(Uo(a),"startTime",0),Vo(Uo(a),"endTime",0),a.url=e,a.request=n,a.response=i,a}return r}(fa(Error)),Pw=Ge.exports,jw=Cp,Iw=o,Lw=he,Cw=Ye,Mw=Lw("species"),Dw=RegExp.prototype,Uw=function(e,t,r,n){var i=Lw(e),o=!Iw((function(){var t={};return t[i]=function(){return 7},7!=""[e](t)})),a=o&&!Iw((function(){var t=!1,r=/a/;return"split"===e&&((r={}).constructor={},r.constructor[Mw]=function(){return r},r.flags="",r[i]=/./[i]),r.exec=function(){return t=!0,null},r[i](""),!t}));if(!o||!a||r){var u=/./[i],s=t(i,""[e],(function(e,t,r,n,i){var a=t.exec;return a===jw||a===Dw.exec?o&&!i?{done:!0,value:u.call(t,r,n)}:{done:!0,value:e.call(r,t,n)}:{done:!1}}));Pw(String.prototype,e,s[0]),Pw(Dw,i,s[1])}n&&Cw(Dw[i],"sham",!0)},Bw=Cu.charAt,Nw=function(e,t,r){return t+(r?Bw(e,t).length:1)},Fw=K,qw=Math.floor,zw="".replace,Vw=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,Hw=/\$([$&'`]|\d{1,2})/g,Yw=v,Gw=Cp,$w=function(e,t){var r=e.exec;if("function"==typeof r){var n=r.call(e,t);if("object"!=typeof n)throw TypeError("RegExp exec method returned something other than an Object or null");return n}if("RegExp"!==Yw(e))throw TypeError("RegExp#exec called on incompatible receiver");return Gw.call(e,t)},Ww=Uw,Qw=o,Kw=Ue,Xw=Lt,Jw=Dt,Zw=mn,ex=b,tx=Nw,rx=function(e,t,r,n,i,o){var a=r+e.length,u=n.length,s=Hw;return void 0!==i&&(i=Fw(i),s=Vw),zw.call(o,s,(function(o,s){var c;switch(s.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,r);case"'":return t.slice(a);case"<":c=i[s.slice(1,-1)];break;default:var f=+s;if(0===f)return o;if(f>u){var l=qw(f/10);return 0===l?o:l<=u?void 0===n[l-1]?s.charAt(1):n[l-1]+s.charAt(1):o}c=n[f-1]}return void 0===c?"":c}))},nx=$w,ix=he("replace"),ox=Math.max,ax=Math.min,ux="$0"==="a".replace(/./,"$0"),sx=!!/./[ix]&&""===/./[ix]("a","$0");Ww("replace",(function(e,t,r){var n=sx?"$":"$0";return[function(e,r){var n=ex(this),i=null==e?void 0:e[ix];return void 0!==i?i.call(e,n,r):t.call(Zw(n),e,r)},function(e,i){var o=Kw(this),a=Zw(e);if("string"==typeof i&&-1===i.indexOf(n)&&-1===i.indexOf("$<")){var u=r(t,o,a,i);if(u.done)return u.value}var s="function"==typeof i;s||(i=Zw(i));var c=o.global;if(c){var f=o.unicode;o.lastIndex=0}for(var l=[];;){var h=nx(o,a);if(null===h)break;if(l.push(h),!c)break;""===Zw(h[0])&&(o.lastIndex=tx(a,Jw(o.lastIndex),f))}for(var d,p="",v=0,y=0;y<l.length;y++){h=l[y];for(var m=Zw(h[0]),g=ox(ax(Xw(h.index),a.length),0),b=[],w=1;w<h.length;w++)b.push(void 0===(d=h[w])?d:String(d));var x=h.groups;if(s){var k=[m].concat(b,g,a);void 0!==x&&k.push(x);var S=Zw(i.apply(void 0,k))}else S=rx(m,a,g,b,x,i);g>=v&&(p+=a.slice(v,g)+S,v=g+m.length)}return p+a.slice(v)}]}),!!Qw((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!ux||sx);var cx=Or,fx=k,lx=[].join,hx=g!=Object,dx=mo("join",",");cx({target:"Array",proto:!0,forced:hx||!dx},{join:function(e){return lx.call(fx(this),void 0===e?",":e)}});var px=Or,vx=S,yx=vn,mx=Ft,gx=Dt,bx=k,wx=Ro,xx=he,kx=ao("slice"),Sx=xx("species"),_x=[].slice,Tx=Math.max;px({target:"Array",proto:!0,forced:!kx},{slice:function(e,t){var r,n,i,o=bx(this),a=gx(o.length),u=mx(e,a),s=mx(void 0===t?a:t,a);if(yx(o)&&("function"!=typeof(r=o.constructor)||r!==Array&&!yx(r.prototype)?vx(r)&&null===(r=r[Sx])&&(r=void 0):r=void 0,r===Array||void 0===r))return _x.call(o,u,s);for(n=new(void 0===r?Array:r)(Tx(s-u,0)),i=0;u<s;u++,i++)u in o&&wx(n,i,o[u]);return n.length=i,n}});var Ox=K,Ax=Ea,Ex=ka;Or({target:"Object",stat:!0,forced:o((function(){Ax(1)})),sham:!Ex},{getPrototypeOf:function(e){return Ax(Ox(e))}});var Rx=Object.prototype.toString;function Px(e){if("[object Object]"!==Rx.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function jx(e){if(e&&null!=e[0]&&(0!==e[0]||null!=e[1])){var t="bytes="+e[0]+"-";return e[1]&&(t+=e[1]),t}}function Ix(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Lx(e,t){if(e){if(!t)return e;var r,n=Object.keys(t).map((function(e){if(null!=(r=t[e]))return Array.isArray(r)?e+="[]":r=[r],r.map((function(t){var r;return r=t,"[object Date]"===Rx.call(r)?t=t.toISOString():function(e){return null!==e&&"object"===Fo(e)}(t)&&(t=JSON.stringify(t)),"".concat(Ix(e),"=").concat(Ix(t))})).join("&")})).filter(Boolean).join("&");if(n){var i=e.indexOf("#");-1!==i&&(e=e.slice(0,i)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e}}function Cx(e,t,r,n,i,o){return n=null!=n?parseFloat(n):null,r=parseInt(r||"0",10),isNaN(r)&&(r=0),{data:e,response:t,contentLength:r,age:n,startTime:i,firstByteTime:o,endTime:Date.now()}}var Mx=function(){function e(){Co(this,e),Vo(this,"_abortController",null),Vo(this,"_timeoutTimer",null),Vo(this,"_reader",null),Vo(this,"_response",null),Vo(this,"_aborted",!1)}var t;return Do(e,[{key:"load",value:function(e){var t,r=this,n=e.url,i=e.timeout,o=e.responseType,a=e.onProgress,u=e.onTimeout,s=e.range,c=e.transformResponse,f=e.request,l=e.params,h=e.method,d=e.headers,p=e.body,v=e.mode,y=e.credentials,m=e.cache,g=e.redirect,b=e.referrer,w=e.referrerPolicy;this._aborted=!1,this._abortController="undefined"!=typeof AbortController&&new AbortController;var x={method:h,headers:d,body:p,mode:v,credentials:y,cache:m,redirect:g,referrer:b,referrerPolicy:w,signal:null===(t=this._abortController)||void 0===t?void 0:t.signal},k=!1;clearTimeout(this._timeoutTimer),n=Lx(n,l);var S=jx(s);S&&((d=f?f.headers:x.headers=x.headers||new Headers)instanceof Headers?d.append("Range",S):d.Range=S),i&&(this._timeoutTimer=setTimeout((function(){if(k=!0,r.cancel(),u){var e=new Rw(n,x);e.isTimeout=!0,u(e)}}),i));var _=Date.now();return fetch(f||n,f?void 0:x).then(function(){var e=ua(ha.mark((function e(t){var i,u;return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(clearTimeout(r._timeoutTimer),r._response=t,!r._aborted){e.next=4;break}return e.abrupt("return");case 4:if(c&&(t=c(t,n)||t),t.ok){e.next=7;break}throw new Rw(n,x,t,"bad network response");case 7:if(i=Date.now(),o!==Ow){e.next=14;break}return e.next=11,t.text();case 11:u=e.sent,e.next=28;break;case 14:if(o!==Aw){e.next=20;break}return e.next=17,t.json();case 17:u=e.sent,e.next=28;break;case 20:if(!a){e.next=24;break}r._loadChunk(t,a),e.next=28;break;case 24:return e.next=26,t.arrayBuffer();case 26:u=e.sent,u=new Uint8Array(u);case 28:return e.abrupt("return",Cx(u,t,t.headers.get("Content-Length"),t.headers.get("age"),_,i));case 29:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){if(clearTimeout(r._timeoutTimer),!r._aborted||k)throw(e=e instanceof Rw?e:new Rw(n,x)).startTime=_,e.endTime=Date.now(),e.isTimeout=k,e}))}},{key:"cancel",value:(t=ua(ha.mark((function e(){return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._aborted){e.next=2;break}return e.abrupt("return");case 2:if(this._aborted=!0,!this._response){e.next=13;break}if(e.prev=4,!this._reader){e.next=8;break}return e.next=8,this._reader.cancel();case 8:e.next=12;break;case 10:e.prev=10,e.t0=e.catch(4);case 12:this._response=this._reader=null;case 13:if(this._abortController){try{this._abortController.abort()}catch(e){}this._abortController=null}case 14:case"end":return e.stop()}}),e,this,[[4,10]])}))),function(){return t.apply(this,arguments)})},{key:"_loadChunk",value:function(e,t){var r,n,i,o=this,a=this._reader=e.body.getReader(),u=function(){var s=ua(ha.mark((function s(){return ha.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return n=Date.now(),s.prev=1,s.next=4,a.read();case 4:r=s.sent,i=Date.now(),s.next=13;break;case 8:return s.prev=8,s.t0=s.catch(1),i=Date.now(),t(void 0,!0,{startTime:n,endTime:i},e),s.abrupt("return");case 13:if(!o._aborted){s.next=16;break}return t(void 0,!0,{startTime:n,endTime:i},e),s.abrupt("return");case 16:t(r.value,r.done,{startTime:n,endTime:i},e),r.done||u();case 18:case"end":return s.stop()}}),s,null,[[1,8]])})));return function(){return s.apply(this,arguments)}}();u()}}],[{key:"isSupported",value:function(){return!("undefined"==typeof fetch)}}]),e}();function Dx(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ux(e){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Dx(Object(r),!0).forEach((function(t){Vo(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Dx(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({loaderType:Sw,retry:0,retryDelay:0,timeout:0,request:null,onTimeout:void 0,onProgress:void 0,onRetryError:void 0,transformRequest:void 0,transformResponse:void 0,transformError:void 0,responseType:Ow,range:void 0,url:"",params:void 0,method:"GET",headers:{},body:void 0,mode:void 0,credentials:void 0,cache:void 0,redirect:void 0,referrer:void 0,referrerPolicy:void 0,integrity:void 0},e)}function Bx(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var Nx=a,Fx=Me.f,qx=Function.prototype,zx=qx.toString,Vx=/^\s*function ([^ (]*)/,Hx="name";Nx&&!(Hx in qx)&&Fx(qx,Hx,{configurable:!0,get:function(){try{return zx.call(this).match(Vx)[1]}catch(e){return""}}});var Yx=Ls;Or({target:"Array",stat:!0,forced:!Ql((function(e){Array.from(e)}))},{from:Yx});var Gx=Or,$x=a,Wx=n,Qx=Z,Kx=S,Xx=Me.f,Jx=fr,Zx=Wx.Symbol;if($x&&"function"==typeof Zx&&(!("description"in Zx.prototype)||void 0!==Zx().description)){var ek={},tk=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof tk?new Zx(e):void 0===e?Zx():Zx(e);return""===e&&(ek[t]=!0),t};Jx(tk,Zx);var rk=tk.prototype=Zx.prototype;rk.constructor=tk;var nk=rk.toString,ik="Symbol(test)"==String(Zx("test")),ok=/^Symbol\((.*)\)[^)]+$/;Xx(rk,"description",{configurable:!0,get:function(){var e=Kx(this)?this.valueOf():this,t=nk.call(e);if(Qx(ek,e))return"";var r=ik?t.slice(7,-1):t.replace(ok,"$1");return""===r?void 0:r}}),Gx({global:!0,forced:!0},{Symbol:tk})}Rn("iterator");var ak=S,uk=v,sk=he("match"),ck=function(e){var t;return ak(e)&&(void 0!==(t=e[sk])?!!t:"RegExp"==uk(e))},fk=Uw,lk=ck,hk=Ue,dk=b,pk=Zl,vk=Nw,yk=Dt,mk=mn,gk=$w,bk=Cp,wk=o,xk=cp.UNSUPPORTED_Y,kk=[].push,Sk=Math.min,_k=4294967295;fk("split",(function(e,t,r){var n;return n="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,r){var n=mk(dk(this)),i=void 0===r?_k:r>>>0;if(0===i)return[];if(void 0===e)return[n];if(!lk(e))return t.call(n,e,i);for(var o,a,u,s=[],c=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),f=0,l=new RegExp(e.source,c+"g");(o=bk.call(l,n))&&!((a=l.lastIndex)>f&&(s.push(n.slice(f,o.index)),o.length>1&&o.index<n.length&&kk.apply(s,o.slice(1)),u=o[0].length,f=a,s.length>=i));)l.lastIndex===o.index&&l.lastIndex++;return f===n.length?!u&&l.test("")||s.push(""):s.push(n.slice(f)),s.length>i?s.slice(0,i):s}:"0".split(void 0,0).length?function(e,r){return void 0===e&&0===r?[]:t.call(this,e,r)}:t,[function(t,r){var i=dk(this),o=null==t?void 0:t[e];return void 0!==o?o.call(t,i,r):n.call(mk(i),t,r)},function(e,i){var o=hk(this),a=mk(e),u=r(n,o,a,i,n!==t);if(u.done)return u.value;var s=pk(o,RegExp),c=o.unicode,f=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(xk?"g":"y"),l=new s(xk?"^(?:"+o.source+")":o,f),h=void 0===i?_k:i>>>0;if(0===h)return[];if(0===a.length)return null===gk(l,a)?[a]:[];for(var d=0,p=0,v=[];p<a.length;){l.lastIndex=xk?0:p;var y,m=gk(l,xk?a.slice(p):a);if(null===m||(y=Sk(yk(l.lastIndex+(xk?p:0)),a.length))===d)p=vk(a,p,c);else{if(v.push(a.slice(d,p)),v.length===h)return v;for(var g=1;g<=m.length-1;g++)if(v.push(m[g]),v.length===h)return v;p=d=y}}return v.push(a.slice(d)),v}]}),!!wk((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var r="ab".split(e);return 2!==r.length||"a"!==r[0]||"b"!==r[1]})),xk);var Tk="\t\n\v\f\r                 \u2028\u2029\ufeff",Ok=b,Ak=mn,Ek="[\t\n\v\f\r                 \u2028\u2029\ufeff]",Rk=RegExp("^"+Ek+Ek+"*"),Pk=RegExp(Ek+Ek+"*$"),jk=function(e){return function(t){var r=Ak(Ok(t));return 1&e&&(r=r.replace(Rk,"")),2&e&&(r=r.replace(Pk,"")),r}},Ik={start:jk(1),end:jk(2),trim:jk(3)},Lk=o,Ck=Tk,Mk=Ik.trim;function Dk(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Uk(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Uk(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw o}}}}function Uk(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}Or({target:"String",proto:!0,forced:function(e){return Lk((function(){return!!Ck[e]()||"​…᠎"!="​…᠎"[e]()||Ck[e].name!==e}))}("trim")},{trim:function(){return Mk(this)}});var Bk=function(){function e(){Co(this,e),Vo(this,"_xhr",null),Vo(this,"_aborted",!1),Vo(this,"_timeoutTimer",null)}return Do(e,[{key:"load",value:function(e){var t=this;clearTimeout(this._timeoutTimer);var r=e.url,n=e.params,i=e.timeout,o=e.responseType,a=e.onTimeout,u=e.transformResponse,s=e.onProgress,c=e.method,f=e.credentials,l=e.body,h=e.headers,d=e.range,p=e.request,v=!1;r=Lx(r,n);var y=Date.now();return new Promise((function(e,n){var m=t._xhr=new XMLHttpRequest;m.open(c||"GET",r,!0),m.responseType=o,m.withCredentials="include"===f||"same-origin"===f;var g=jx(d);g&&((h=h||{}).Range=g),h&&Object.keys(h).forEach((function(e){m.setRequestHeader(e,h[e])})),i&&(t._timeoutTimer=setTimeout((function(){if(v=!0,t.cancel(),a){var e=new Rw(r,p);e.isTimeout=!0,a(e)}}),i)),m.onerror=function(e){return n(e)},m.onreadystatechange=function(){if(m.readyState>=2){clearTimeout(t._timeoutTimer);var i=Date.now();if(4===m.readyState){if(m.onreadystatechange=null,t._aborted)return;var o=m.status,a={ok:o>=200&&o<300,status:o,statusText:m.statusText,url:m.responseURL,headers:t._getHeaders(m),body:m.response};if(u&&(a=u(a,r)||a),!a.ok)return n(new Rw(r,p,a,"bad network response"));var c=m.responseType===Tw,f=c?new Uint8Array(m.response):m.response;s&&s(c?f:void 0,!0,{startTime:y,endTime:Date.now()},a),e(Cx(f,a,a.headers["content-length"],a.headers.age,y,i))}}},m.send(l)})).catch((function(e){if(clearTimeout(t._timeoutTimer),!t._aborted||v)throw(e=e instanceof Rw?e:new Rw(r,p)).startTime=y,e.endTime=Date.now(),e.isTimeout=v,e}))}},{key:"cancel",value:function(){if(!this._aborted)return this._aborted=!0,this._xhr?this._xhr.cancel():void 0}},{key:"_getHeaders",value:function(e){var t,r={},n=Dk(e.getAllResponseHeaders().trim().split("\r\n"));try{for(n.s();!(t=n.n()).done;){var i=t.value.split(": ");r[i[0].toLowerCase()]=i.slice(1).join(": ")}}catch(e){n.e(e)}finally{n.f()}return r}}],[{key:"isSupported",value:function(){return"undefined"!=typeof XMLHttpRequest}}]),e}(),Nk=["retry","retryDelay","onRetryError","transformError"],Fk=function(){function e(t,r){Co(this,e),this.promise=Mp(),this.alive=!!r.onProgress,this._loaderType=t,this._loader=t===Sw?new Mx:new Bk,this._config=r,this._retryCount=0,this._retryTimer=null,this._canceled=!1}var t;return Do(e,[{key:"exec",value:function(){var e=this,t=this._config,r=t.retry,n=t.retryDelay,i=t.onRetryError,o=t.transformError,a=Bx(t,Nk),u=function(){var t=ua(ha.mark((function t(){var s,c;return ha.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e._loader.load(a);case 3:s=t.sent,e.promise.resolve(s),t.next=22;break;case 7:if(t.prev=7,t.t0=t.catch(0),!e._canceled){t.next=11;break}return t.abrupt("return");case 11:if(t.t0.loaderType=e._loaderType,t.t0.retryCount=e._retryCount,c=t.t0,o&&(c=o(c)||c),i&&e._retryCount>0&&i(c,e._retryCount,r),e._retryCount++,!(e._retryCount<=r)){t.next=21;break}return clearTimeout(e._retryTimer),e._retryTimer=setTimeout(u,n),t.abrupt("return");case 21:e.promise.reject(c);case 22:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(){return t.apply(this,arguments)}}();return u(),this.promise}},{key:"cancel",value:(t=ua(ha.mark((function e(){return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return clearTimeout(this._retryTimer),this._canceled=!0,e.abrupt("return",this._loader.cancel());case 3:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}();function qk(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if((t=t.filter(Boolean)).length<2)return t[0];var n=new Uint8Array(t.reduce((function(e,t){return e+t.byteLength}),0)),i=0;return t.forEach((function(e){n.set(e,i),i+=e.byteLength})),n}function zk(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(t){return setTimeout(t,e)}))}var Vk=function(){function e(t){Co(this,e),Vo(this,"type",Sw),Vo(this,"_queue",[]),Vo(this,"_alive",[]),Vo(this,"_currentTask",null),this._config=Ux(t),this._config.loaderType!==_w&&Mx.isSupported()||(this.type=_w)}var t;return Do(e,[{key:"isFetch",value:function(){return this.type===Sw}},{key:"load",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"string"!=typeof e&&e?t=e:t.url=e||t.url||this._config.url,(t=Object.assign({},this._config,t)).params&&(t.params=Object.assign({},t.params)),t.headers&&Px(t.headers)&&(t.headers=Object.assign({},t.headers)),t.body&&Px(t.body)&&(t.body=Object.assign({},t.body)),t.transformRequest&&(t=t.transformRequest(t)||t);var r=new Fk(this.type,t);return this._queue.push(r),1===this._queue.length&&this._processTask(),r.promise}},{key:"cancel",value:(t=ua(ha.mark((function e(){var t;return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this._queue.map((function(e){return e.cancel()})).concat(this._alive.map((function(e){return e.cancel()}))),this._currentTask&&t.push(this._currentTask.cancel()),this._queue=[],this._alive=[],e.next=6,Promise.all(t);case 6:return e.next=8,zk();case 8:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"_processTask",value:function(){var e=this;this._currentTask=this._queue.shift(),this._currentTask&&(this._currentTask.alive&&this._alive.push(this._currentTask),this._currentTask.exec().catch((function(){})).finally((function(){e._processTask()})))}}],[{key:"isFetchSupport",value:function(){return Mx.isSupported()}}]),e}(),Hk="error",Yk="core.lowdecode",Gk={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}function i(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function o(e,t,n,o,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var u=new i(n,o||e,a),s=r?r+t:t;return e._events[s]?e._events[s].fn?e._events[s]=[e._events[s],u]:e._events[s].push(u):(e._events[s]=u,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function u(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),u.prototype.eventNames=function(){var e,n,i=[];if(0===this._eventsCount)return i;for(n in e=this._events)t.call(e,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},u.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,a=new Array(o);i<o;i++)a[i]=n[i].fn;return a},u.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},u.prototype.emit=function(e,t,n,i,o,a){var u=r?r+e:e;if(!this._events[u])return!1;var s,c,f=this._events[u],l=arguments.length;if(f.fn){switch(f.once&&this.removeListener(e,f.fn,void 0,!0),l){case 1:return f.fn.call(f.context),!0;case 2:return f.fn.call(f.context,t),!0;case 3:return f.fn.call(f.context,t,n),!0;case 4:return f.fn.call(f.context,t,n,i),!0;case 5:return f.fn.call(f.context,t,n,i,o),!0;case 6:return f.fn.call(f.context,t,n,i,o,a),!0}for(c=1,s=new Array(l-1);c<l;c++)s[c-1]=arguments[c];f.fn.apply(f.context,s)}else{var h,d=f.length;for(c=0;c<d;c++)switch(f[c].once&&this.removeListener(e,f[c].fn,void 0,!0),l){case 1:f[c].fn.call(f[c].context);break;case 2:f[c].fn.call(f[c].context,t);break;case 3:f[c].fn.call(f[c].context,t,n);break;case 4:f[c].fn.call(f[c].context,t,n,i);break;default:if(!s)for(h=1,s=new Array(l-1);h<l;h++)s[h-1]=arguments[h];f[c].fn.apply(f[c].context,s)}}return!0},u.prototype.on=function(e,t,r){return o(this,e,t,r,!1)},u.prototype.once=function(e,t,r){return o(this,e,t,r,!0)},u.prototype.removeListener=function(e,t,n,i){var o=r?r+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var u=this._events[o];if(u.fn)u.fn!==t||i&&!u.once||n&&u.context!==n||a(this,o);else{for(var s=0,c=[],f=u.length;s<f;s++)(u[s].fn!==t||i&&!u[s].once||n&&u[s].context!==n)&&c.push(u[s]);c.length?this._events[o]=1===c.length?c[0]:c:a(this,o)}return this},u.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&a(this,t)):(this._events=new n,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=r,u.EventEmitter=u,e.exports=u}(Gk);var $k=Gk.exports,Wk=Or,Qk=Wn.find,Kk=wa,Xk="find",Jk=!0;Xk in[]&&Array(1).find((function(){Jk=!1})),Wk({target:"Array",proto:!0,forced:Jk},{find:function(e){return Qk(this,e,arguments.length>1?arguments[1]:void 0)}}),Kk(Xk);var Zk=Yt.includes,eS=wa;Or({target:"Array",proto:!0},{includes:function(e){return Zk(this,e,arguments.length>1?arguments[1]:void 0)}}),eS("includes");var tS=ck,rS=he("match"),nS=function(e){if(tS(e))throw TypeError("The method doesn't accept regular expressions");return e},iS=b,oS=mn;Or({target:"String",proto:!0,forced:!function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[rS]=!1,"/./"[e](t)}catch(e){}}return!1}("includes")},{includes:function(e){return!!~oS(iS(this)).indexOf(oS(nS(e)),arguments.length>1?arguments[1]:void 0)}});var aS="video",uS="audio",sS="metadata",cS="avc",fS="hevc",lS="aac",hS="g7110a",dS="g7110m",pS=function(){function e(){Co(this,e),Vo(this,"id",1),Vo(this,"type",aS),Vo(this,"codecType",cS),Vo(this,"pid",-1),Vo(this,"hvcC",void 0),Vo(this,"codec",""),Vo(this,"timescale",0),Vo(this,"formatTimescale",0),Vo(this,"sequenceNumber",0),Vo(this,"baseMediaDecodeTime",0),Vo(this,"baseDts",0),Vo(this,"duration",0),Vo(this,"warnings",[]),Vo(this,"samples",[]),Vo(this,"pps",[]),Vo(this,"sps",[]),Vo(this,"vps",[]),Vo(this,"fpsNum",0),Vo(this,"fpsDen",0),Vo(this,"sarRatio",[]),Vo(this,"width",0),Vo(this,"height",0),Vo(this,"nalUnitSize",4),Vo(this,"present",!1),Vo(this,"ext",void 0)}return Do(e,[{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}}]),e}(),vS=function(){function e(){Co(this,e),Vo(this,"id",2),Vo(this,"type",uS),Vo(this,"codecType",lS),Vo(this,"pid",-1),Vo(this,"codec",""),Vo(this,"sequenceNumber",0),Vo(this,"sampleDuration",0),Vo(this,"timescale",0),Vo(this,"formatTimescale",0),Vo(this,"baseMediaDecodeTime",0),Vo(this,"duration",0),Vo(this,"warnings",[]),Vo(this,"samples",[]),Vo(this,"baseDts",0),Vo(this,"sampleSize",16),Vo(this,"sampleRate",0),Vo(this,"channelCount",0),Vo(this,"objectType",0),Vo(this,"sampleRateIndex",0),Vo(this,"config",[]),Vo(this,"present",!1),Vo(this,"ext",void 0)}return Do(e,[{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&&this.codecType===lS)}},{key:"hasSample",value:function(){return!!this.samples.length}}]),e}(),yS=function(){function e(t,r,n){Co(this,e),Vo(this,"flag",{}),Vo(this,"keyframe",!1),Vo(this,"gopId",0),Vo(this,"duration",0),Vo(this,"size",0),Vo(this,"units",[]),Vo(this,"chromaFormat",420),this.originPts=this.pts=t,this.originDts=this.dts=r,n&&(this.units=n)}return Do(e,[{key:"cts",get:function(){return this.pts-this.dts}},{key:"setToKeyframe",value:function(){this.keyframe=!0,this.flag.dependsOn=2,this.flag.isNonSyncSample=0}}]),e}(),mS=function e(t,r,n){Co(this,e),Vo(this,"duration",1024),Vo(this,"flag",{dependsOn:2,isNonSyncSample:0}),this.originPts=this.pts=this.dts=t,this.data=r,this.size=r.byteLength,n&&(this.duration=n)},gS=function(){function e(){Co(this,e),Vo(this,"id",3),Vo(this,"type",sS),Vo(this,"timescale",0),Vo(this,"flvScriptSamples",[]),Vo(this,"seiSamples",[])}return Do(e,[{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)}}]),e}(),bS=a,wS=n,xS=gr,kS=Ge.exports,SS=Z,_S=v,TS=hm,OS=F,AS=me,ES=o,RS=$r,PS=Pt.f,jS=i.f,IS=Me.f,LS=Ik.trim,CS="Number",MS=wS.Number,DS=MS.prototype,US=_S(RS(DS))==CS,BS=function(e){if(OS(e))throw TypeError("Cannot convert a Symbol value to a number");var t,r,n,i,o,a,u,s,c=AS(e,"number");if("string"==typeof c&&c.length>2)if(43===(t=(c=LS(c)).charCodeAt(0))||45===t){if(88===(r=c.charCodeAt(2))||120===r)return NaN}else if(48===t){switch(c.charCodeAt(1)){case 66:case 98:n=2,i=49;break;case 79:case 111:n=8,i=55;break;default:return+c}for(a=(o=c.slice(2)).length,u=0;u<a;u++)if((s=o.charCodeAt(u))<48||s>i)return NaN;return parseInt(o,n)}return+c};if(xS(CS,!MS(" 0o1")||!MS("0b1")||MS("+0x1"))){for(var NS,FS=function(e){var t=arguments.length<1?0:e,r=this;return r instanceof FS&&(US?ES((function(){DS.valueOf.call(r)})):_S(r)!=CS)?TS(new MS(BS(t)),r,FS):BS(t)},qS=bS?PS(MS):"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(","),zS=0;qS.length>zS;zS++)SS(MS,NS=qS[zS])&&!SS(FS,NS)&&IS(FS,NS,jS(MS,NS));FS.prototype=DS,DS.constructor=FS,kS(wS,CS,FS)}var VS=Ge.exports,HS=Ue,YS=mn,GS=o,$S=sp,WS="toString",QS=RegExp.prototype,KS=QS.toString,XS=GS((function(){return"/a/b"!=KS.call({source:"a",flags:"b"})})),JS=KS.name!=WS;(XS||JS)&&VS(RegExp.prototype,WS,(function(){var e=HS(this),t=YS(e.source),r=e.flags;return"/"+t+"/"+YS(void 0===r&&e instanceof RegExp&&!("flags"in QS)?$S.call(e):r)}),{unsafe:!0});var ZS="undefined"!=typeof window,e_=ZS&&navigator.userAgent.toLocaleLowerCase();ZS&&/^((?!chrome|android).)*safari/.test(e_);var t_=ZS&&e_.includes("firefox"),r_=ZS&&e_.includes("android");function n_(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];t=t.filter(Boolean);var n=new Uint8Array(t.reduce((function(e,t){return e+t.byteLength}),0)),i=0;return t.forEach((function(e){n.set(e,i),i+=e.byteLength})),n}var i_=Math.pow(2,32);function o_(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(e[t]<<8)+(e[t+1]||0)}function a_(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(e[t]<<24>>>0)+(e[t+1]<<16)+(e[t+2]<<8)+(e[t+3]||0)}function u_(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return a_(e,t)*i_+a_(e,t+4)}var s_=function(){function e(){Co(this,e)}return Do(e,null,[{key:"getRateIndexByRate",value:function(t){return e.FREQ.indexOf(t)}},{key:"parseADTS",value:function(t,r){for(var n=t.length,i=0;i+2<n&&(255!==t[i]||240!=(246&t[i+1]));)i++;if(!(i>=n)){var o=i,a=[],u=(60&t[i+2])>>>2,s=e.FREQ[u];if(!s)throw new Error("Invalid sampling index: ".concat(u));for(var c,f,l=1+((192&t[i+2])>>>6),h=(1&t[i+2])<<2|(192&t[i+3])>>>6,d=e._getConfig(u,h,l),p=d.config,v=d.codec,y=0,m=e.getFrameDuration(s);i+7<n;)if(255===t[i]&&240==(246&t[i+1])){if(n-i<(f=(3&t[i+3])<<11|t[i+4]<<3|(224&t[i+5])>>5))break;c=2*(1&~t[i+1]),a.push({pts:r+y*m,data:t.subarray(i+7+c,i+f)}),y++,i+=f}else i++;return{skip:o,remaining:i>=n?void 0:t.subarray(i),frames:a,samplingFrequencyIndex:u,sampleRate:s,objectType:l,channelCount:h,codec:v,config:p,originCodec:"mp4a.40.".concat(l)}}}},{key:"parseAudioSpecificConfig",value:function(t){if(t.length){var r=t[0]>>>3,n=(7&t[0])<<1|t[1]>>>7,i=(120&t[1])>>>3,o=e.FREQ[n];if(!o)throw new Error("Invalid sampling index: ".concat(n));var a=e._getConfig(n,i,r);return{samplingFrequencyIndex:n,sampleRate:o,objectType:r,channelCount:i,config:a.config,codec:a.codec,originCodec:"mp4a.40.".concat(r)}}}},{key:"getFrameDuration",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9e4;return 1024*t/e}},{key:"_getConfig",value:function(e,t,r){var n,i,o=[];return t_?e>=6?(n=5,i=e-3):(n=2,i=e):r_?(n=2,i=e):(n=2===r||5===r?r:5,i=e,e>=6?i=e-3:1===t&&(n=2,i=e)),o[0]=n<<3,o[0]|=(14&e)>>1,o[1]=(1&e)<<7,o[1]|=t<<3,5===n&&(o[1]|=(14&i)>>1,o[2]=(1&i)<<7,o[2]|=8,o[3]=0),{config:o,codec:"mp4a.40.".concat(n)}}},{key:"getSilentFrame",value:function(e,t){switch(e){case"mp4a.40.2":if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)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===t)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===t)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===t)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===t)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])}}}]),e}();function c_(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function f_(e,t){if(e){if("string"==typeof e)return c_(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c_(e,t):void 0}}function l_(e){return function(e){if(Array.isArray(e))return c_(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||f_(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}Vo(s_,"FREQ",[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350]);var h_=Lt,d_=mn,p_=b,v_=Dt,y_=mn,m_=function(e){var t=d_(p_(this)),r="",n=h_(e);if(n<0||n==1/0)throw RangeError("Wrong number of repetitions");for(;n>0;(n>>>=1)&&(t+=t))1&n&&(r+=t);return r},g_=b,b_=Math.ceil,w_=function(e){return function(t,r,n){var i,o,a=y_(g_(t)),u=a.length,s=void 0===n?" ":y_(n),c=v_(r);return c<=u||""==s?a:(i=c-u,(o=m_.call(s,b_(i/s.length))).length>i&&(o=o.slice(0,i)),e?a+o:o+a)}},x_={start:w_(!1),end:w_(!0)},k_=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(A),S_=x_.start;Or({target:"String",proto:!0,forced:k_},{padStart:function(e){return S_(this,e,arguments.length>1?arguments[1]:void 0)}});var __=Me,T_=sp;a&&o((function(){return"sy"!==Object.getOwnPropertyDescriptor(RegExp.prototype,"flags").get.call({dotAll:!0,sticky:!0})}))&&__.f(RegExp.prototype,"flags",{configurable:!0,get:T_});var O_=function(){function e(){Co(this,e)}return Do(e,null,[{key:"findBox",value:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=[];if(!t)return i;for(var o=0,a="",u=0;t.length>7;){if(o=a_(t),a=String.fromCharCode.apply(null,t.subarray(4,8)),u=8,1===o?(o=u_(t,8),u+=8):o||(o=t.length),!r[0]||a===r[0]){var s=t.subarray(0,o);if(!(r.length<2))return e.findBox(s.subarray(u),r.slice(1),n+u);i.push({start:n,size:o,headerSize:u,type:a,data:s})}n+=o,t=t.subarray(o)}return i}},{key:"moov",value:function(t){return P_(t,!1,(function(t,r,n){t.mvhd=e.mvhd(e.findBox(r,["mvhd"],n)[0]),t.trak=e.findBox(r,["trak"],n).map((function(t){return e.trak(t)}))}))}},{key:"mvhd",value:function(e){return P_(e,!0,(function(e,t){var r=0;1===e.version?(e.timescale=a_(t,16),e.duration=u_(t,20),r+=28):(e.timescale=a_(t,8),e.duration=a_(t,12),r+=16),e.nextTrackId=a_(t,r+76)}))}},{key:"trak",value:function(t){return P_(t,!1,(function(t,r,n){t.tkhd=e.tkhd(e.findBox(r,["tkhd"],n)[0]),t.mdia=e.mdia(e.findBox(r,["mdia"],n)[0])}))}},{key:"tkhd",value:function(e){return P_(e,!0,(function(e,t){var r=0;1===e.version?(e.trackId=a_(t,16),e.duration=u_(t,24),r+=32):(e.trackId=a_(t,8),e.duration=a_(t,16),r+=20),e.width=a_(t,r+52),e.height=a_(t,r+56)}))}},{key:"mdia",value:function(t){return P_(t,!1,(function(t,r,n){t.mdhd=e.mdhd(e.findBox(r,["mdhd"],n)[0]),t.hdlr=e.hdlr(e.findBox(r,["hdlr"],n)[0]),t.minf=e.minf(e.findBox(r,["minf"],n)[0])}))}},{key:"mdhd",value:function(e){return P_(e,!0,(function(e,t){var r=0;1===e.version?(e.timescale=a_(t,16),e.duration=u_(t,20),r+=28):(e.timescale=a_(t,8),e.duration=a_(t,12),r+=16);var n=o_(t,r);e.language=String.fromCharCode(96+(n>>10&31),96+(n>>5&31),96+(31&n))}))}},{key:"hdlr",value:function(e){return P_(e,!0,(function(e,t){0===e.version&&(e.handlerType=String.fromCharCode.apply(null,t.subarray(4,8)))}))}},{key:"minf",value:function(t){return P_(t,!1,(function(t,r,n){t.vmhd=e.vmhd(e.findBox(r,["vmhd"],n)[0]),t.smhd=e.smhd(e.findBox(r,["smhd"],n)[0]),t.stbl=e.stbl(e.findBox(r,["stbl"],n)[0])}))}},{key:"vmhd",value:function(e){return P_(e,!0,(function(e,t){e.graphicsmode=o_(t),e.opcolor=[o_(t,2),o_(t,4),o_(t,6)]}))}},{key:"smhd",value:function(e){return P_(e,!0,(function(e,t){e.balance=o_(t)}))}},{key:"stbl",value:function(t){return P_(t,!1,(function(t,r,n){t.stsd=e.stsd(e.findBox(r,["stsd"],n)[0]),t.stts=e.stts(e.findBox(r,["stts"],n)[0]),t.ctts=e.ctts(e.findBox(r,["ctts"],n)[0]),t.stsc=e.stsc(e.findBox(r,["stsc"],n)[0]),t.stsz=e.stsz(e.findBox(r,["stsz"],n)[0]),t.stco=e.stco(e.findBox(r,["stco"],n)[0]),t.stss=e.stss(e.findBox(r,["stss"],n)[0])}))}},{key:"stsd",value:function(t){return P_(t,!0,(function(t,r,n){t.entryCount=a_(r),t.entries=e.findBox(r.subarray(4),[],n+4).map((function(t){switch(t.type){case"avc1":case"avc2":case"avc3":case"avc4":return e.avc1(t);case"hvc1":case"hev1":return e.hvc1(t);case"mp4a":return e.mp4a(t);case"alaw":case"ulaw":return e.alaw(t)}})).filter(Boolean)}))}},{key:"avc1",value:function(t){return P_(t,!1,(function(t,r,n){var i=E_(t,r),o=r.subarray(i);n+=i,t.avcC=e.avcC(e.findBox(o,["avcC"],n)[0]),t.pasp=e.pasp(e.findBox(o,["pasp"],n)[0])}))}},{key:"avcC",value:function(e){return P_(e,!1,(function(e,t){e.configurationVersion=t[0],e.AVCProfileIndication=t[1],e.profileCompatibility=t[2],e.AVCLevelIndication=t[3],e.codec=function(e){for(var t,r="avc1.",n=0;n<3;n++)(t=e[n].toString(16)).length<2&&(t="0".concat(t)),r+=t;return r}([t[1],t[2],t[3]]),e.lengthSizeMinusOne=3&t[4],e.spsLength=31&t[5],e.sps=[];for(var r=6,n=0;n<e.spsLength;n++){var i=o_(t,r);r+=2,e.sps.push(t.subarray(r,r+i)),r+=i}e.ppsLength=t[r],r+=1,e.pps=[];for(var o=0;o<e.ppsLength;o++){var a=o_(t,r);r+=2,e.pps.push(t.subarray(r,r+=a)),r+=a}}))}},{key:"hvc1",value:function(t){return P_(t,!1,(function(t,r,n){var i=E_(t,r),o=r.subarray(i);n+=i,t.hvcC=e.hvcC(e.findBox(o,["hvcC"],n)[0]),t.pasp=e.pasp(e.findBox(o,["pasp"],n)[0])}))}},{key:"hvcC",value:function(e){return P_(e,!1,(function(t,r){t.data=e.data,t.codec="hev1.1.6.L93.B0",t.configurationVersion=r[0];var n=r[1];t.generalProfileSpace=n>>6,t.generalTierFlag=(32&n)>>5,t.generalProfileIdc=31&n,t.generalProfileCompatibility=a_(r,2),t.generalConstraintIndicatorFlags=r.subarray(6,12),t.generalLevelIdc=r[12],t.avgFrameRate=o_(r,19),t.numOfArrays=r[22],t.vps=[],t.sps=[],t.pps=[];for(var i=23,o=0,a=0,u=0,s=0;s<t.numOfArrays;s++){o=63&r[i],a=o_(r,i+1),i+=3;for(var c,f=[],l=0;l<a;l++)u=o_(r,i),i+=2,f.push(r.subarray(i,i+u)),i+=u;if(32===o)(c=t.vps).push.apply(c,f);else if(33===o){var h;(h=t.sps).push.apply(h,f)}else if(34===o){var d;(d=t.pps).push.apply(d,f)}}}))}},{key:"pasp",value:function(e){return P_(e,!1,(function(e,t){e.hSpacing=a_(t),e.vSpacing=a_(t,4)}))}},{key:"mp4a",value:function(t){return P_(t,!1,(function(t,r,n){var i=R_(t,r);t.esds=e.esds(e.findBox(r.subarray(i),["esds"],n+i)[0])}))}},{key:"esds",value:function(e){return P_(e,!0,(function(e,t){e.codec="mp4a.";for(var r=0,n=0,i=0,o=0;t.length;){for(o=t[r=0],n=t[r+1],r+=2;128&n;)i=(127&n)<<7,n=t[r],r+=1;if(i+=127&n,3===o)t=t.subarray(r+3);else{if(4!==o){if(5===o){var a=e.config=t.subarray(r,r+i),u=(248&a[0])>>3;return 31===u&&a.length>=2&&(u=32+((7&a[0])<<3)+((224&a[1])>>5)),e.objectType=u,void(e.codec+=u.toString(16))}return}e.codec+=(t[r].toString(16)+".").padStart(3,"0"),t=t.subarray(r+13)}}}))}},{key:"alaw",value:function(e){return P_(e,!1,(function(e,t){R_(e,t)}))}},{key:"stts",value:function(e){return P_(e,!0,(function(e,t){for(var r=a_(t),n=[],i=4,o=0;o<r;o++)n.push({count:a_(t,i),delta:a_(t,i+4)}),i+=8;e.entryCount=r,e.entries=n}))}},{key:"ctts",value:function(e){return P_(e,!0,(function(e,t){var r=a_(t),n=[],i=4;if(1===e.version)for(var o=0;o<r;o++)n.push({count:a_(t,i),offset:a_(t,i+4)}),i+=8;else for(var a=0;a<r;a++)n.push({count:a_(t,i),offset:-(1+~a_(t,i+4))}),i+=8;e.entryCount=r,e.entries=n}))}},{key:"stsc",value:function(e){return P_(e,!0,(function(e,t){for(var r=a_(t),n=[],i=4,o=0;o<r;o++)n.push({firstChunk:a_(t,i),samplesPerChunk:a_(t,i+4),sampleDescriptionIndex:a_(t,i+8)}),i+=12;e.entryCount=r,e.entries=n}))}},{key:"stsz",value:function(e){return P_(e,!0,(function(e,t){var r=a_(t),n=a_(t,4),i=[];if(!r)for(var o=8,a=0;a<n;a++)i.push(a_(t,o)),o+=4;e.sampleSize=r,e.sampleCount=n,e.entrySizes=i}))}},{key:"stco",value:function(e){return P_(e,!0,(function(e,t){for(var r=a_(t),n=[],i=4,o=0;o<r;o++)n.push(a_(t,i)),i+=4;e.entryCount=r,e.entries=n}))}},{key:"stss",value:function(e){return P_(e,!0,(function(e,t){for(var r=a_(t),n=[],i=4,o=0;o<r;o++)n.push(a_(t,i)),i+=4;e.entryCount=r,e.entries=n}))}},{key:"moof",value:function(t){return P_(t,!1,(function(t,r,n){t.mfhd=e.mfhd(e.findBox(r,["mfhd"],n)[0]),t.traf=e.findBox(r,["traf"],n).map((function(t){return e.traf(t)}))}))}},{key:"mfhd",value:function(e){return P_(e,!0,(function(e,t){e.sequenceNumber=a_(t)}))}},{key:"traf",value:function(t){return P_(t,!1,(function(t,r,n){t.tfhd=e.tfhd(e.findBox(r,["tfhd"],n)[0]),t.tfdt=e.tfdt(e.findBox(r,["tfdt"],n)[0]),t.trun=e.trun(e.findBox(r,["trun"],n)[0])}))}},{key:"tfhd",value:function(e){return P_(e,!0,(function(e,t){var r=e.flags,n=t.length;e.trackId=a_(t);var i=4;n>i&&1&r&&(e.baseDataOffset=u_(t,i),i+=8),n>i&&2&r&&(e.sampleDescriptionIndex=a_(t,i),i+=4),n>i&&8&r&&(e.defaultSampleDuration=a_(t,i),i+=4),n>i&&10&r&&(e.defaultSampleSize=a_(t,i),i+=4),n>i&&32&r&&(e.defaultSampleFlags=a_(t,i),i+=4)}))}},{key:"trun",value:function(e){return P_(e,!0,(function(e,t){var r=e.version,n=e.flags,i=t.length,o=e.sampleCount=a_(t),a=4;if(i>a&&1&n&&(e.dataOffset=-(1+~a_(t,a)),a+=4),i>a&&4&n&&(e.firstSampleFlags=a_(t,a),a+=4),e.samples=[],i>a)for(var u,s=0;s<o;s++)u={},256&n&&(u.duration=a_(t,a),a+=4),512&n&&(u.size=a_(t,a),a+=4),1024&n&&(u.flags=a_(t,a),a+=4),2048&n&&(u.cts=r?-(1+~a_(t,a+4)):a_(t,a),a+=4),e.samples.push(u)}))}},{key:"tfdt",value:function(e){return P_(e,!0,(function(e,t){1===e.version?e.baseMediaDecodeTime=u_(t):e.baseMediaDecodeTime=a_(t)}))}},{key:"probe",value:function(t){return!!e.findBox(t,["ftyp"])}},{key:"moovToTrack",value:function(e,t,r){var n,i,o=e.trak;if(o&&o.length){var a=o.find((function(e){var t,r;return"vide"===(null===(t=e.mdia)||void 0===t||null===(r=t.hdlr)||void 0===r?void 0:r.handlerType)})),u=o.find((function(e){var t,r;return"soun"===(null===(t=e.mdia)||void 0===t||null===(r=t.hdlr)||void 0===r?void 0:r.handlerType)}));if(a&&t){var s,c=t;null!=(null===(s=a.tkhd)||void 0===s?void 0:s.trackId)&&(c.id=a.tkhd.trackId),c.timescale=c.formatTimescale=a.mdia.mdhd.timescale,c.duration=a.mdia.mdhd.duration;var f=a.mdia.minf.stbl.stsd.entries[0];if(c.width=f.width,c.height=f.height,f.pasp&&(c.sarRatio=[f.pasp.hSpacing,f.pasp.vSpacing]),f.hvcC)c.codecType=fS,c.codec=f.hvcC.codec,c.vps=f.hvcC.vps,c.sps=f.hvcC.sps,c.pps=f.hvcC.pps,c.hvcC=f.hvcC.data;else{if(!f.avcC)throw new Error("unknown video stsd entry");c.codec=f.avcC.codec,c.sps=f.avcC.sps,c.pps=f.avcC.pps}c.present=!0}if(u&&r){var l,h=r;null!=(null===(l=u.tkhd)||void 0===l?void 0:l.trackId)&&(h.id=u.tkhd.trackId),h.timescale=h.formatTimescale=u.mdia.mdhd.timescale,h.duration=u.mdia.mdhd.duration;var d=u.mdia.minf.stbl.stsd.entries[0];switch(h.sampleSize=d.sampleSize,h.sampleRate=d.sampleRate,h.channelCount=d.channelCount,h.present=!0,d.type){case"alaw":h.codecType=h.codec=hS,h.sampleRate=8e3;break;case"ulaw":h.codecType=h.codec=dS,h.sampleRate=8e3;break;default:h.sampleDuration=s_.getFrameDuration(h.sampleRate,h.timescale),h.sampleRateIndex=s_.getRateIndexByRate(h.sampleRate),h.objectType=(null===(n=d.esds)||void 0===n?void 0:n.objectType)||2,d.esds&&(h.config=Array.from(d.esds.config)),h.codec=(null===(i=d.esds)||void 0===i?void 0:i.codec)||"mp4a.40.2"}}return{videoTrack:t,audioTrack:r}}}},{key:"evaluateDefaultDuration",value:function(e,t,r){var n,i=null==t||null===(n=t.samples)||void 0===n?void 0:n.length;return i?1024*i/t.timescale*e.timescale/r:1024}},{key:"moofToSamples",value:function(t,r,n){var i={};return t.mfhd&&(r&&(r.sequenceNumber=t.mfhd.sequenceNumber),n&&(n.sequenceNumber=t.mfhd.sequenceNumber)),t.traf.forEach((function(t){var o=t.tfhd,a=t.tfdt,u=t.trun;if(o&&u){a&&(r&&r.id===o.trackId&&(r.baseMediaDecodeTime=a.baseMediaDecodeTime),n&&n.id===o.trackId&&(n.baseMediaDecodeTime=a.baseMediaDecodeTime));var s=o.defaultSampleSize||0,c=o.defaultSampleDuration||e.evaluateDefaultDuration(r,n,u.samples.length||u.sampleCount),f=u.dataOffset||0,l=0,h=-1;if(!u.samples.length&&u.sampleCount){i[o.trackId]=[];for(var d=0;d<u.sampleCount;d++)i[o.trackId].push({offset:f,dts:l,duration:c,size:s}),l+=c,f+=s}else i[o.trackId]=u.samples.map((function(e,t){return(e={offset:f,dts:l,pts:l+(e.cts||0),duration:e.duration||c,size:e.size||s,gopId:h,keyframe:0===t||null!=e.flags&&(65536&e.flags)>>>0!=65536}).keyframe&&(h++,e.gopId=h),l+=e.duration,f+=e.size,e}))}})),i}},{key:"moovToSamples",value:function(e){var t=e.trak;if(t&&t.length){var r=t.find((function(e){var t,r;return"vide"===(null===(t=e.mdia)||void 0===t||null===(r=t.hdlr)||void 0===r?void 0:r.handlerType)})),n=t.find((function(e){var t,r;return"soun"===(null===(t=e.mdia)||void 0===t||null===(r=t.hdlr)||void 0===r?void 0:r.handlerType)}));if(r||n){var i,o;if(r){var a,u,s=null===(a=r.mdia)||void 0===a||null===(u=a.minf)||void 0===u?void 0:u.stbl;if(!s)return;var c=s.stts,f=s.stsc,l=s.stsz,h=s.stco,d=s.stss,p=s.ctts;if(!(c&&f&&l&&h&&d))return;i=A_(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,w=g.stts,x=g.stsc,k=g.stsz,S=g.stco;if(!(b&&w&&x&&k&&S))return;o=A_(w,x,k,S)}return{videoSamples:i,audioSamples:o}}}}}]),e}();function A_(e,t,r,n,i,o){var a,u,s,c=[],f=null==i?void 0:i.entries,l=t.entries,h=n.entries,d=r.entrySizes,p=null==o?void 0:o.entries;p&&(a={},p.forEach((function(e){a[e-1]=!0}))),f&&(u=[],f.forEach((function(e){for(var t=e.count,r=e.offset,n=0;n<t;n++)u.push(r)})));var v=-1,y=0,m=0,g=0,b=0,w=0,x=l[0].samplesPerChunk,k=l[1]?l[1].firstChunk-1:1/0;return e.entries.forEach((function(e){for(var t=e.count,n=e.delta,i=0;i<t;i++)s={dts:y,duration:n,size:d[m]||r.sampleSize,offset:h[g]+w,index:m},p&&(s.keyframe=a[m],s.keyframe&&v++,s.gopId=v),u&&u[m]&&(s.pts=s.dts+u[m]),c.push(s),y+=n,++m<x?w+=s.size:(g++,w=0,g>=k&&(b++,k=l[b+1]?l[b+1].firstChunk-1:1/0),x+=l[b].samplesPerChunk)})),c}function E_(e,t){return e.dataReferenceIndex=o_(t,6),e.width=o_(t,24),e.height=o_(t,26),e.horizresolution=a_(t,28),e.vertresolution=a_(t,32),e.frameCount=o_(t,40),e.depth=o_(t,74),78}function R_(e,t){return e.dataReferenceIndex=o_(t,6),e.channelCount=o_(t,16),e.sampleSize=o_(t,18),e.sampleRate=a_(t,24)/65536,28}function P_(e,t,r){if(e){if(e.size!==e.data.length)throw new Error("box ".concat(e.type," size !== data.length"));var n={start:e.start,size:e.size,headerSize:e.headerSize,type:e.type};return t&&(n.version=e.data[e.headerSize],n.flags=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(e[t]<<16)+(e[t+1]<<8)+(e[t+2]||0)}(e.data,e.headerSize+1),n.headerSize+=4),r(n,e.data.subarray(n.headerSize),n.start+n.headerSize),n}}function j_(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o=[],a=!0,u=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){u=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(u)throw i}}return o}}(e,t)||f_(e,t)||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 I_=Ll,L_="ArrayBuffer",C_=Jy.ArrayBuffer;Or({global:!0,forced:n.ArrayBuffer!==C_},{ArrayBuffer:C_}),I_(L_);var M_=Math.pow(2,32)-1,D_=function(){function e(){Co(this,e)}return Do(e,null,[{key:"box",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var i=8+(r=r.filter(Boolean)).reduce((function(e,t){return e+t.byteLength}),0),o=new Uint8Array(i);o[0]=i>>24&255,o[1]=i>>16&255,o[2]=i>>8&255,o[3]=255&i,o.set(e,4);var a=8;return r.forEach((function(e){o.set(e,a),a+=e.byteLength})),o}},{key:"ftyp",value:function(t){return t.find((function(e){return e.type===aS&&e.codecType===fS}))?e.FTYPHEV1:e.FTYPAVC1}},{key:"initSegment",value:function(t){return n_(e.ftyp(t),e.moov(t))}},{key:"moov",value:function(t){return e.box.apply(e,[e.types.moov,e.mvhd(t[0].duration,t[0].timescale)].concat(l_(t.map((function(t){return e.trak(t)}))),[e.mvex(t)]))}},{key:"mvhd",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9e4;return e.box(e.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,t>>24&255,t>>16&255,t>>8&255,255&t,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(t){return e.box(e.types.trak,e.tkhd(t.id,t.duration,t.width,t.height),e.mdia(t))}},{key:"tkhd",value:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return e.box(e.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,t>>24&255,t>>16&255,t>>8&255,255&t,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,i>>8&255,255&i,0,0]))}},{key:"mdia",value:function(t){return e.box(e.types.mdia,e.mdhd(t.duration,t.timescale),e.hdlr(t.type),e.minf(t))}},{key:"mdhd",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9e4;return e.box(e.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,t>>24&255,t>>16&255,t>>8&255,255&t,85,196,0,0]))}},{key:"hdlr",value:function(t){return e.box(e.types.hdlr,e.HDLR_TYPES[t])}},{key:"minf",value:function(t){return e.box(e.types.minf,t.type===aS?e.VMHD:e.SMHD,e.DINF,e.stbl(t))}},{key:"stbl",value:function(t){return e.box(e.types.stbl,e.stsd(t),e.STTS,e.STSC,e.STSZ,e.STCO)}},{key:"stsd",value:function(t){return e.box(e.types.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),t.type===aS?e.avc1hev1(t):e.mp4a(t))}},{key:"avc1hev1",value:function(t){var r=t.codecType===fS,n=r?e.types.hvc1:e.types.avc1,i=r?e.hvcC(t):e.avcC(t),o=[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,t.width>>8&255,255&t.width,t.height>>8&255,255&t.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]),i];return t.sarRatio&&t.sarRatio.length>1&&o.push(e.pasp(t.sarRatio)),e.box.apply(e,[n].concat(o))}},{key:"avcC",value:function(t){var r,n=[],i=[];return t.sps.forEach((function(e){r=e.byteLength,n.push(r>>>8&255),n.push(255&r),n.push.apply(n,l_(e))})),t.pps.forEach((function(e){r=e.byteLength,i.push(r>>>8&255),i.push(255&r),i.push.apply(i,l_(e))})),e.box(e.types.avcC,new Uint8Array([1,n[3],n[4],n[5],255,224|t.sps.length].concat(n).concat([t.pps.length]).concat(i)))}},{key:"hvcC",value:function(t){var r=t.hvcC;if(r instanceof ArrayBuffer)return r;var n,i=t.vps,o=t.sps,a=t.pps;if(r){var u=r.generalProfileCompatibilityFlags,s=r.generalConstraintIndicatorFlags,c=(i.length&&1)+(o.length&&1)+(a.length&&1);n=[1,r.generalProfileSpace<<6|r.generalTierFlag<<5|r.generalProfileIdc,u>>>24,u>>>16,u>>>8,u,s[0],s[1],s[2],s[3],s[4],s[5],r.generalLevelIdc,240,0,252,252|r.chromaFormatIdc,248|r.bitDepthLumaMinus8,248|r.bitDepthChromaMinus8,0,0,r.numTemporalLayers<<3|r.temporalIdNested<<2|3,c];var f=function(e){var t;n.push(e.length>>8,e.length),(t=n).push.apply(t,l_(e))};i.length&&(n.push(160,0,i.length),i.forEach(f)),o.length&&(n.push(161,0,o.length),o.forEach(f)),a.length&&(n.push(162,0,a.length),a.forEach(f))}else n=[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];return e.box(e.types.hvcC,new Uint8Array(n))}},{key:"pasp",value:function(t){var r=j_(t,2),n=r[0],i=r[1];return e.box(e.types.pasp,new Uint8Array([n>>24,n>>16&255,n>>8&255,255&n,i>>24,i>>16&255,i>>8&255,255&i]))}},{key:"mp4a",value:function(t){return e.box(e.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,t.sampleRate>>8&255,255&t.sampleRate,0,0]),t.config.length?e.esds(t.config):void 0)}},{key:"esds",value:function(t){var r=t.length;return e.box(e.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(t).concat([6,1,2])))}},{key:"mvex",value:function(t){return e.box.apply(e,[e.types.mvex].concat(l_(t.map((function(t){return e.trex(t.id)})))))}},{key:"trex",value:function(t){return e.box(e.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}},{key:"moof",value:function(t,r){return e.box.apply(e,[e.types.moof,e.mfhd(t)].concat(l_(r.map((function(t){return e.traf(t)})))))}},{key:"mfhd",value:function(t){return e.box(e.types.mfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))}},{key:"traf",value:function(t){return e.box(e.types.traf,e.tfhd(t.id),e.tfdt(t.baseMediaDecodeTime),e.trun(t.samples,76))}},{key:"tfhd",value:function(t){return e.box(e.types.tfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))}},{key:"tfdt",value:function(t){var r=Math.floor(t/(M_+1)),n=Math.floor(t%(M_+1));return e.box(e.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(t,r){var n=t.length,i=12+16*n;r+=8+i;var o=new Uint8Array(i);o.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 a=0;a<n;a++){var u=t[a],s=u.duration,c=u.size,f=u.flag,l=void 0===f?{}:f,h=u.cts,d=void 0===h?0:h;o.set([s>>>24&255,s>>>16&255,s>>>8&255,255&s,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*a)}return e.box(e.types.trun,o)}},{key:"mdat",value:function(t){return e.box(e.types.mdat,t)}},{key:"moovMP4",value:function(t){return e.box.apply(e,[e.types.moov,e.mvhd(t[0].duration,t[0].timescale)].concat(l_(t.map((function(t){return e.trackMP4(t)})))))}},{key:"trackMP4",value:function(t){return e.box(e.types.trak,e.tkhd(t.id,t.duration,t.width,t.height),e.mdiaMP4(t))}},{key:"mdiaMP4",value:function(t){return e.box(e.types.mdia,e.mdhd(t.duration,t.timescale),e.hdlr(t.type),e.minfMP4(t))}},{key:"minfMP4",value:function(t){return e.box(e.types.minf,t.type===aS?e.VMHD:e.SMHD,e.DINF,e.stblMP4(t))}},{key:"stblMP4",value:function(t){var r=t.ext,n=[e.stsd(t),e.stts(r.stts),e.stsc(r.stsc),e.stsz(r.stsz),e.stco(r.stco)];return r.stss.length&&n.push(e.stss(r.stss)),r.ctts.length&&n.push(e.ctts(r.ctts)),e.box.apply(e,[e.types.stbl].concat(n))}},{key:"stts",value:function(t){var r=t.length,n=new Uint8Array(8*r),i=0;return t.forEach((function(e){var t=e.value,r=e.count;n.set([r>>24,r>>16&255,r>>8&255,255&r,t>>24,t>>16&255,t>>8&255,255&t],i),i+=8})),e.box(e.types.stts,n_(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"stsc",value:function(t){var r=t.length,n=new Uint8Array(12*r),i=0;return t.forEach((function(e){var t=e.firstChunk,r=e.samplesPerChunk,o=e.sampleDescIndex;n.set([t>>24,t>>16&255,t>>8&255,255&t,r>>24,r>>16&255,r>>8&255,255&r,o>>24,o>>16&255,o>>8&255,255&o],i),i+=12})),e.box(e.types.stsc,n_(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"stsz",value:function(t){var r=t.length,n=new Uint8Array(4*r),i=0;return t.forEach((function(e){n.set([e>>24,e>>16&255,e>>8&255,255&e],i),i+=4})),e.box(e.types.stsz,n_(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(t){var r=t.length,n=new Uint8Array(4*r),i=0;return t.forEach((function(e){n.set([e>>24,e>>16&255,e>>8&255,255&e],i),i+=4})),e.box(e.types.stco,n_(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"stss",value:function(t){var r=t.length,n=new Uint8Array(4*r),i=0;return t.forEach((function(e){n.set([e>>24,e>>16&255,e>>8&255,255&e],i),i+=4})),e.box(e.types.stss,n_(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}},{key:"ctts",value:function(t){var r=t.length,n=new Uint8Array(8*r),i=0;return t.forEach((function(e){var t=e.value,r=e.count;n.set([r>>24,r>>16&255,r>>8&255,255&r,t>>24,t>>16&255,t>>8&255,255&t],i),i+=8})),e.box(e.types.ctts,n_(new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r]),n))}}]),e}();Vo(D_,"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(e,t){return e[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)],e}),Object.create(null))),Vo(D_,"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])}),Vo(D_,"FTYPAVC1",D_.box(D_.types.ftyp,new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]))),Vo(D_,"FTYPHEV1",D_.box(D_.types.ftyp,new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,104,101,118,49]))),Vo(D_,"DINF",D_.box(D_.types.dinf,D_.box(D_.types.dref,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1])))),Vo(D_,"VMHD",D_.box(D_.types.vmhd,new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]))),Vo(D_,"SMHD",D_.box(D_.types.smhd,new Uint8Array([0,0,0,0,0,0,0,0]))),Vo(D_,"StblTable",new Uint8Array([0,0,0,0,0,0,0,0])),Vo(D_,"STTS",D_.box(D_.types.stts,D_.StblTable)),Vo(D_,"STSC",D_.box(D_.types.stsc,D_.StblTable)),Vo(D_,"STSZ",D_.box(D_.types.stsz,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]))),Vo(D_,"STCO",D_.box(D_.types.stco,D_.StblTable));var U_=/Chrome\/([^.]+)/.exec(navigator.userAgent),B_=U_&&Number(U_[1])<50,N_=function(){function e(t,r){Co(this,e),this.videoTrack=t,this.audioTrack=r}return Do(e,[{key:"remux",value:function(){var e,t,r,n,i=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=this.videoTrack,a=this.audioTrack,u=o.exist(),s=a.exist();return i&&(u&&(e=D_.initSegment([this.videoTrack])),s&&(t=D_.initSegment([this.audioTrack]))),u&&o.hasSample()&&(r=this._remuxVideo()),s&&a.hasSample()&&(n=this._remuxAudio()),o.samples=[],a.samples=[],{videoInitSegment:e,audioInitSegment:t,videoSegment:r,audioSegment:n}}},{key:"_remuxVideo",value:function(){var e=this.videoTrack,t=e.samples;B_&&(t[0].flag={dependsOn:2,isNonSyncSample:0});var r=0;t.forEach((function(e){r+=e.units.reduce((function(e,t){return e+t.byteLength}),0),r+=4*e.units.length}));for(var n,i=new Uint8Array(r),o=new DataView(i.buffer),a=function(e,r,a,u){u=t[e];var s=0;u.units.forEach((function(e){o.setUint32(a,e.byteLength),a+=4,i.set(e,a),a+=e.byteLength,s+=4+e.byteLength})),u.size=s,c=a,n=u},u=0,s=t.length,c=0;u<s;u++)a(u,0,c,n);return n_(D_.moof(this.videoTrack.sequenceNumber++,[e]),D_.mdat(i))}},{key:"_remuxAudio",value:function(){var e=this.audioTrack,t=D_.moof(this.audioTrack.sequenceNumber++,[e]),r=new Uint8Array(e.samples.reduce((function(e,t){return e+t.size}),0));return e.samples.reduce((function(e,t){return r.set(t.data,e),e+t.size}),0),n_(t,D_.mdat(r))}}]),e}(),F_=function(){function e(t,r,n){Co(this,e),Vo(this,"_videoSamples",[]),Vo(this,"_audioSamples",[]),this.videoTrack=t||new pS,this.audioTrack=r||new vS,this.metadataTrack=n||new gS}return Do(e,[{key:"demux",value:function(e,t,r,n,i){if(!this._audioSamples.length&&!this._videoSamples.length){if(!i)throw new Error("moov is required");O_.moovToTrack(i,this.videoTrack,this.audioTrack);var o=O_.moovToSamples(i);if(!o)throw new Error("cannot parse samples from moov box");this._videoSamples=o.videoSamples||[],this._audioSamples=o.audioSamples||[]}var a,u,s,c=this.videoTrack,f=this.audioTrack;if(c.samples=[],f.samples=[],r){for(var l,h=0,d=r[0],p=r[1];d<=p;d++){if(!(a=this._videoSamples[d]))throw new Error("cannot found video frame #".concat(d));s=a.offset-t,u=e.subarray(s,s+a.size),(l=new yS(a.pts||a.dts,a.dts)).duration=a.duration,l.gopId=a.gopId,a.keyframe&&l.setToKeyframe();for(var v=0,y=u.length-1;v<y;)h=a_(u,v),v+=4,l.units.push(u.subarray(v,v+h)),v+=h;c.samples.push(l)}c.baseMediaDecodeTime=c.samples[0].dts}if(n){for(var m=n[0],g=n[1];m<=g;m++){if(!(a=this._audioSamples[m]))throw new Error("cannot found video frame #".concat(m));s=a.offset-t,u=e.subarray(s,s+a.size),f.samples.push(new mS(a.dts,u,a.duration))}f.baseMediaDecodeTime=f.samples[0].dts}return{videoTrack:c,audioTrack:f,metadataTrack:this.metadataTrack}}},{key:"reset",value:function(){this._videoSamples=[],this._audioSamples=[],this.videoTrack.reset(),this.audioTrack.reset(),this.metadataTrack.reset()}}],[{key:"probe",value:function(e){return O_.probe(e)}}]),e}();function q_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function z_(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?q_(Object(r),!0).forEach((function(t){Vo(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):q_(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var V_=function e(t,r){Co(this,e),this.type="file",this.message=t,this.data=r},H_=function(){function e(){Co(this,e),Vo(this,"_data",Object.create(null))}return Do(e,[{key:"set",value:function(e,t){this._data[e]=t}},{key:"get",value:function(e){return this._data[e]}},{key:"clear",value:function(){this._data=Object.create(null)}}]),e}();function Y_(e,t){var r=e.trak;if(r&&r.length){var n=r.find((function(e){var t,r;return"vide"===(null===(t=e.mdia)||void 0===t||null===(r=t.hdlr)||void 0===r?void 0:r.handlerType)})),i=r.find((function(e){var t,r;return"soun"===(null===(t=e.mdia)||void 0===t||null===(r=t.hdlr)||void 0===r?void 0:r.handlerType)}));if(n||i){var o,a=[],u=[];if(n){var s,c,f,l=null===(s=n.mdia)||void 0===s||null===(c=s.minf)||void 0===c?void 0:c.stbl;if(!l)return;var h=null===(f=n.mdia.mdhd)||void 0===f?void 0:f.timescale,d=l.stts,p=l.stsc,v=l.stsz,y=l.stco,m=l.stss;if(!(h&&d&&p&&v&&y&&m))return;o=(a=G_(t,h,d,p,v,y,m)).map((function(e){return e.endTime-e.startTime}))}if(i){var g,b,w,x=null===(g=i.mdia)||void 0===g||null===(b=g.minf)||void 0===b?void 0:b.stbl;if(!x)return;var k=null===(w=i.mdia.mdhd)||void 0===w?void 0:w.timescale,S=x.stts,_=x.stsc,T=x.stsz,O=x.stco;if(!(k&&S&&_&&T&&O))return;u=G_(t,k,S,_,T,O,null,o)}return{videoSegments:a,audioSegments:u}}}}function G_(e,t,r,n,i,o,a,u){var s,c,f,l=[],h=[],d=[],p=n.entries,v=o.entries,y=i.entrySizes,m=null==a?void 0:a.entries;m&&(s={},m.forEach((function(e){s[e-1]=!0})));var g=0,b=0,w=0,x=0,k=0,S=p[0].samplesPerChunk,_=p[1]?p[1].firstChunk-1:1/0;r.entries.forEach((function(e){var r=e.count,n=e.delta;f=n/t;for(var o=0;o<r;o++)c={startTime:g,duration:f,size:y[b]||i.sampleSize,offset:v[w]+k,index:b},m&&(c.keyframe=s[b],c.keyframe?(h.push([c]),d.push(c.duration)):(h[h.length-1].push(c),d[h.length-1]+=c.duration)),l.push(c),g+=f,++b<S?k+=c.size:(w++,k=0,w>=_&&(x++,_=p[x+1]?p[x+1].firstChunk-1:1/0),S+=p[x].samplesPerChunk)}));var T=l.length;if(T&&(!a||l[0].keyframe)){var O,A=[],E=[],R=0,P=function(){var e;O=E[E.length-1],A.push({index:A.length,startTime:(null===(e=A[A.length-1])||void 0===e?void 0:e.endTime)||E[0].startTime,endTime:O.startTime+O.duration,range:[E[0].offset,O.offset+O.size],frames:E}),R=0,E=[]};if(a)for(var j=0,I=0,L=h.length;I<L;I++){var C,M;if(R+=d[I],(C=E).push.apply(C,l_(h[I])),I+1<L){if((j=R+d[I+1])>=e)if(j-e<Math.abs(e-R))(M=E).push.apply(M,l_(h[I+1])),P(),I++;else P()}else P()}else for(var D=(u=u||[])[0]||e,U=0;U<T;U++)E.push(l[U]),R+=l[U].duration,(U+1>=T||R>=D)&&(P(),D=u[A.length]||e);return A}}function $_(e){var t="",r="",n=0,i=0,o=0,a=0,u=0;e.mvhd&&(u=e.mvhd.duration/e.mvhd.timescale);var s=e.trak;if(s){var c,f,l,h,d,p,v,y,m,g=s.find((function(e){var t,r;return"vide"===(null===(t=e.mdia)||void 0===t||null===(r=t.hdlr)||void 0===r?void 0:r.handlerType)})),b=s.find((function(e){var t,r;return"soun"===(null===(t=e.mdia)||void 0===t||null===(r=t.hdlr)||void 0===r?void 0:r.handlerType)}));if(g)if(c=null===(f=g.mdia)||void 0===f||null===(l=f.minf)||void 0===l||null===(h=l.stbl)||void 0===h?void 0:h.stsd.entries[0])n=c.width,i=c.height,t=null===(d=c.avcC||c.hvcC)||void 0===d?void 0:d.codec;if(b)if(c=null===(p=b.mdia)||void 0===p||null===(v=p.minf)||void 0===v||null===(y=v.stbl)||void 0===y?void 0:y.stsd.entries[0])o=c.channelCount,a=c.sampleRate,r=null===(m=c.esds)||void 0===m?void 0:m.codec}return{videoCodec:t,audioCodec:r,width:n,height:i,audioChannelCount:o,audioSampleRate:a,duration:u,moov:e}}function W_(e){return"number"==typeof e&&!isNaN(e)}var Q_=["vid","moovEnd","segmentDuration","cache","maxDownloadInfoSize"],K_=function(){function e(t){Co(this,e),Vo(this,"vid",""),Vo(this,"url",""),Vo(this,"meta",{}),Vo(this,"downloadInfo",[]),Vo(this,"videoSegments",[]),Vo(this,"audioSegments",[]),Vo(this,"cache",null),Vo(this,"_currentSegmentIndex",-1),Vo(this,"_currentLoadingSegmentIndex",-1),Vo(this,"_transformError",(function(e){return e.type="network",e})),this._config=z_(z_({vid:"",moovEnd:8e3,segmentDuration:5,maxDownloadInfoSize:30,cache:null},t),{},{responseType:"arraybuffer"});var r=this._config,n=r.vid;r.moovEnd,r.segmentDuration;var i=r.cache;r.maxDownloadInfoSize;var o=Bx(r,Q_);this.cache=i||new H_,this.vid=n||o.url,this.url=o.url,o.transformError=this._transformError,this._loader=new Vk(o)}var t,r,n,i,o,a,u,s,c,f;return Do(e,[{key:"isMetaLoaded",get:function(){return this.videoSegments.length||this.audioSegments.length}},{key:"setCurrentSegment",value:function(e){W_(e)&&(this._currentSegmentIndex=e)}},{key:"isLastSegment",value:function(e){var t,r;return!!W_(e)&&e===((null===(t=this.videoSegments[this.videoSegments.length-1])||void 0===t?void 0:t.index)||(null===(r=this.audioSegments[this.audioSegments.length-1])||void 0===r?void 0:r.index)||0)}},{key:"isSegmentLoading",value:function(e){return e===this._currentLoadingSegmentIndex}},{key:"changeUrl",value:(f=ua(ha.mark((function e(t){var r,n,i=arguments;return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=i.length>1&&void 0!==i[1]?i[1]:t,n=i.length>2?i[2]:void 0,e.next=4,this.reset();case 4:t&&(this.url=t),r&&(this.vid=r),n&&(this._config.moovEnd=n);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return f.apply(this,arguments)})},{key:"getOrLoadMeta",value:(c=ua(ha.mark((function e(t){return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isMetaLoaded){e.next=3;break}return e.next=3,this.loadMeta(t);case 3:return e.abrupt("return",this.meta);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"loadMeta",value:(s=ua(ha.mark((function e(t,r){var n,i,o,a,u,s,c,f,l;return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=[],e.next=3,this._loadData([0,r||this._config.moovEnd],t);case 3:if(i=e.sent){e.next=6;break}return e.abrupt("return");case 6:if(n.push(i),o=O_.findBox(i.data,["moov"])[0]){e.next=22;break}if(a=O_.findBox(i.data,["mdat"])[0]){e.next=12;break}throw new V_("cannot find moov or mdat box",i.data);case 12:return u=a.start+a.size,e.next=15,this._loadData([u],t);case 15:if(i=e.sent){e.next=18;break}return e.abrupt("return");case 18:if(n.push(i),o=O_.findBox(i.data,["moov"],u)[0]){e.next=22;break}throw new V_("cannot find moov box",i.data);case 22:if(!(o.size>o.data.length)){e.next=30;break}return e.next=25,this._loadData([i.data.length,o.start+o.size-1],t);case 25:if(i=e.sent){e.next=28;break}return e.abrupt("return");case 28:n.push(i),o.data=qk(o.data,i.data);case 30:if(s=O_.moov(o)){e.next=33;break}throw new V_("cannot parse moov box",o.data);case 33:if(c=Y_(s,this._config.segmentDuration)){e.next=36;break}throw new V_("cannot parse segments",o.data);case 36:return this.meta=$_(s),f=c.videoSegments,l=c.audioSegments,this.videoSegments=f,this.audioSegments=l,e.abrupt("return",{meta:this.meta,videoSegments:f,audioSegments:l,responses:n});case 41:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"getSegmentByTime",value:function(e){var t,r;return this.videoSegments.length?(t=this.videoSegments.find((function(t){return t.startTime<=e&&t.endTime>e})))&&(r=this.audioSegments[t.index]):r=this.audioSegments.find((function(t){return t.startTime<=e&&t.endTime>e})),{video:t,audio:r}}},{key:"loadSegmentByTime",value:(u=ua(ha.mark((function e(t,r){var n,i,o,a,u=arguments;return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=!(u.length>2&&void 0!==u[2])||u[2],this.isMetaLoaded){e.next=4;break}return e.next=4,this.loadMeta(r);case 4:return i=this.getSegmentByTime(t),o=i.video,a=i.audio,e.abrupt("return",this._loadSegment(o,a,r,n));case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"loadNextSegment",value:(a=ua(ha.mark((function e(t){var r,n,i,o=arguments;return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=!(o.length>1&&void 0!==o[1])||o[1],this.isMetaLoaded){e.next=4;break}return e.next=4,this.loadMeta();case 4:return n=this.videoSegments[this._currentSegmentIndex+1],i=this.audioSegments[this._currentSegmentIndex+1],e.abrupt("return",this._loadSegment(n,i,t,r));case 7:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"preload",value:(o=ua(ha.mark((function e(t){var r,n,i,o,a,u,s,c=this;return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isMetaLoaded){e.next=3;break}return e.next=3,this.loadMeta(!0);case 3:if(t&&!(t<0)){e.next=5;break}return e.abrupt("return");case 5:if(r=this.getSegmentByTime(t),n=r.video,i=r.audio,o=Math.max((null==n?void 0:n.index)||0,(null==i?void 0:i.index)||0)){e.next=9;break}return e.abrupt("return");case 9:return a=this.videoSegments.slice(0,o),u=this.audioSegments.slice(0,o),s=function(){var e=ua(ha.mark((function e(t){return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t>o)){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,c._loadSegment(a[t],u[t],!0,!1);case 4:return e.next=6,s(t+1);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.next=14,s(0);case 14:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"cancel",value:function(){return this._loader.cancel()}},{key:"reset",value:(i=ua(ha.mark((function e(){return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._loader.cancel();case 2:this.vid=this.url="",this.meta={},this.downloadInfo=[],this.videoSegments=[],this.audioSegments=[],this._currentSegmentIndex=-1,this._currentLoadingSegmentIndex=-1;case 9:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"destroy",value:(n=ua(ha.mark((function e(){return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.cancel();case 2:this.cache.clear();case 3:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"_loadSegment",value:(r=ua(ha.mark((function e(t,r,n,i){var o,a;return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t||r){e.next=2;break}return e.abrupt("return");case 2:return o=(null==t?void 0:t.index)||(null==r?void 0:r.index)||0,this._currentLoadingSegmentIndex=o,e.prev=4,e.next=7,this._loadData([Math.min((null==t?void 0:t.range[0])||1/0,(null==r?void 0:r.range[0])||1/0),Math.max((null==t?void 0:t.range[1])||0,(null==r?void 0:r.range[1])||0)],n);case 7:a=e.sent;case 8:return e.prev=8,this._currentLoadingSegmentIndex=-1,e.finish(8);case 11:if(a){e.next=13;break}return e.abrupt("return");case 13:return i&&(this._currentSegmentIndex=o),a.video=t,a.audio=r,e.abrupt("return",a);case 17:case"end":return e.stop()}}),e,this,[[4,,8,11]])}))),function(e,t,n,i){return r.apply(this,arguments)})},{key:"_loadData",value:(t=ua(ha.mark((function e(t,r){var n,i,o;return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this._getCacheKey(t),e.next=3,this.cache.get(n);case 3:if(i=e.sent){e.next=10;break}return e.next=7,this._loader.load(this.url,{range:t});case 7:o=e.sent,e.next=11;break;case 10:o={data:i,fromCache:!0};case 11:if(o){e.next=13;break}return e.abrupt("return");case 13:return i||(this.downloadInfo.push({startTime:o.startTime,endTime:o.endTime,size:o.data.byteLength,range:t}),this._addDownloadInfo>this._config.maxDownloadInfoSize&&(this._downloadInfos=this.downloadInfo.slice(-this._config.maxDownloadInfoSize))),!i&&r&&this.cache.set(n,o.data),o.range=t,e.abrupt("return",o);case 17:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})},{key:"_getCacheKey",value:function(e){return(this.vid||this.url)+":"+e}}]),e}(),X_=function(){function e(t,r){Co(this,e),Vo(this,"_demuxer",new F_),Vo(this,"_remuxer",null),Vo(this,"_mse",null),Vo(this,"_softVideo",null),Vo(this,"_needInitSegment",!0),Vo(this,"_sourceCreated",!1),this.mp4=t,r?this._softVideo=t.media:(this._remuxer=new N_(this._demuxer.videoTrack,this._demuxer.audioTrack),this._mse=new Kp,this._mse.bindMedia(t.media))}var t,r,n,i,o;return Do(e,[{key:"appendBuffer",value:(o=ua(ha.mark((function e(t,r,n,i,o){var a,u,s,c,f,l,h,d,p,v;return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&t.length){e.next=2;break}return e.abrupt("return");case 2:if(n&&(a=[n[0].index,n[n.length-1].index]),i&&(u=[i[0].index,i[i.length-1].index]),a||u){e.next=6;break}return e.abrupt("return");case 6:if(s=this._demuxer.demux(t,r,a,u,o),c=s.videoTrack,f=s.audioTrack,l=c.type,h=f.type,!(d=this._mse)){e.next=28;break}this._sourceCreated||(c.exist()&&(d.createSource(l,"video/mp4;codecs=".concat(c.codec)),this._sourceCreated=!0),f.exist()&&(d.createSource(h,"audio/mp4;codecs=".concat(f.codec)),this._sourceCreated=!0)),e.prev=12,p=this._remuxer.remux(this._needInitSegment),e.next=19;break;case 16:throw e.prev=16,e.t0=e.catch(12),new $p(zp,Yp.FMP4,e.t0);case 19:return this._needInitSegment=!1,v=[],p.videoInitSegment&&v.push(d.append(l,p.videoInitSegment)),p.audioInitSegment&&v.push(d.append(h,p.audioInitSegment)),p.videoSegment&&v.push(d.append(l,p.videoSegment)),p.audioSegment&&v.push(d.append(h,p.audioSegment)),e.abrupt("return",Promise.all(v).catch((function(e){if(e.type!==Qp.CANCELLED)throw new $p(Vp,Yp.MSE_APPEND_BUFFER,e)})));case 28:this._softVideo&&this._softVideo.appendBuffer(c,f);case 29:case"end":return e.stop()}}),e,this,[[12,16]])}))),function(e,t,r,n,i){return o.apply(this,arguments)})},{key:"evictBuffer",value:(i=ua(ha.mark((function e(t){var r,n,i,o,a,u=this;return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this.mp4.media,this._mse&&this._demuxer&&r&&t&&!(t<0)){e.next=3;break}return e.abrupt("return");case 3:if(n=r.currentTime,!((i=n-t)<=0)){e.next=7;break}return e.abrupt("return");case 7:if(!(Up.start(Up.get(r))+1>=i)){e.next=10;break}return e.abrupt("return");case 10:return o=this._demuxer,a=[],[o.videoTrack,o.audioTrack].forEach((function(e){e.exist()&&a.push(u._mse.remove(e.type,0,i))})),e.abrupt("return",Promise.all(a).catch((function(e){if(e.type!==Qp.CANCELLED)throw new $p(Vp,Yp.MSE_OTHER,e)})));case 14:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"reset",value:(n=ua(ha.mark((function e(){return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._mse){e.next=6;break}return e.next=3,this._mse.unbindMedia();case 3:return e.next=5,this._mse.bindMedia(this.mp4.media);case 5:this._mseOpened=!1;case 6:this._sourceCreated=!1,this._needInitSegment=!0;case 8:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"endOfStream",value:(r=ua(ha.mark((function e(){return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._mse){e.next=12;break}if(!this._sourceCreated){e.next=12;break}return e.prev=2,e.next=5,this._mse.endOfStream();case 5:e.next=12;break;case 7:if(e.prev=7,e.t0=e.catch(2),e.t0.type!==Qp.CANCELLED){e.next=11;break}return e.abrupt("return");case 11:throw new $p(Vp,Yp.MSE_OTHER,e.t0);case 12:this._softVideo&&this._softVideo.endOfStream();case 13:case"end":return e.stop()}}),e,this,[[2,7]])}))),function(){return r.apply(this,arguments)})},{key:"destroy",value:(t=ua(ha.mark((function e(){var t;return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this._mse,this._mse=null,this._softVideo=null,this._demuxer=null,this._remuxer=null,!t){e.next=8;break}return e.next=8,t.unbindMedia();case 8:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}();function J_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Z_(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?J_(Object(r),!0).forEach((function(t){Vo(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):J_(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function eT(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=zo(e);if(t){var i=zo(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return qo(this,r)}}var tT=function(e){No(a,e);var t,r,n,i,o=eT(a);function a(e){var t,r,n;return Co(this,a),Vo(Uo(t=o.call(this)),"_prevSegmentEndTime",0),Vo(Uo(t),"_tickTimer",null),Vo(Uo(t),"_loading",!1),Vo(Uo(t),"_onSeeking",ua(ha.mark((function e(){var r,n,i,o,a,u,s;return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.media){e.next=2;break}return e.abrupt("return");case 2:if(r=t.media.currentTime,n=t._loader,i=n.getSegmentByTime(r),o=i.video,a=i.audio,u=o||a){e.next=8;break}return e.abrupt("return");case 8:if(!n.isSegmentLoading(u.index)){e.next=10;break}return e.abrupt("return");case 10:if(!(s=Up.info(Up.get(t.media),r,.1)).end||!(s.end>=u.endTime||s.end>=t.media.duration)){e.next=13;break}return e.abrupt("return");case 13:return e.next=15,n.cancel();case 15:t._loading=!1,t._prevSegmentEndTime=0,t._loadSegment(r),t._startTick();case 19:case"end":return e.stop()}}),e)})))),Vo(Uo(t),"_tick",(function(){t._stopTick();var e=t.media;e&&(t._startTick(t._config.tickInterval),Up.end(Up.get(e))<.1||!e.readyState||function(e){return e&&!e.paused&&!e.ended&&0!==e.playbackRate&&0!==e.readyState}(e)&&t._loadSegment())})),e=t._config=(n=(null==(r=e)?void 0:r.media)||document.createElement("video"),Z_(Z_({softDecode:!1,tickInterval:500,preloadTime:10,bufferBehind:10,segmentDuration:void 0,url:"",retry:3,retryDelay:100},r),{},{media:n})),t.media=t._config.media,e.softDecode&&t.media.setPlayMode&&t.media.setPlayMode("VOD"),t._bufferService=new X_(Uo(t),e.softDecode),t._loader=new K_({url:e.url,retry:e.retry,retryDelay:e.retryDelay}),t.media.addEventListener("seeking",t._onSeeking),t}return Do(a,[{key:"load",value:(i=ua(ha.mark((function e(t){return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._reset();case 2:if(!t){e.next=5;break}return e.next=5,this._loader.changeUrl(t);case 5:return this._startTick(this._config.tickInterval),e.next=8,this._loadSegment(0);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"destroy",value:(n=ua(ha.mark((function e(){return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.media.removeEventListener("seeking",this._onSeeking),e.next=3,this._reset();case 3:return e.next=5,this._bufferService.destroy();case 5:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"_reset",value:(r=ua(ha.mark((function e(){return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._stopTick(),e.next=3,this._loader.reset();case 3:return e.next=5,this._bufferService.reset();case 5:this._prevSegmentEndTime=0,this._loading=!1;case 7:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"_loadSegment",value:(t=ua(ha.mark((function e(t){var r,n,i,o,a,u,s,c;return ha.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._loading){e.next=2;break}return e.abrupt("return");case 2:if(a=this.media.currentTime,!(this._prevSegmentEndTime>a+this._config.preloadTime)){e.next=5;break}return e.abrupt("return");case 5:if(this._loading=!0,e.prev=6,null==t){e.next=13;break}return e.next=10,this._loader.loadSegmentByTime(t);case 10:u=e.sent,e.next=16;break;case 13:return e.next=15,this._loader.loadNextSegment();case 15:u=e.sent;case 16:e.next=21;break;case 18:e.prev=18,e.t0=e.catch(6),this._emitError($p.network(e.t0));case 21:if(u){e.next=24;break}return this._loading=!1,e.abrupt("return");case 24:return this._prevSegmentEndTime=Math.min((null===(r=u.video)||void 0===r?void 0:r.endTime)||1/0,(null===(n=u.audio)||void 0===n?void 0:n.endTime)||1/0),e.prev=25,e.next=28,this._bufferService.appendBuffer(u.data,u.range[0],null===(s=u.video)||void 0===s?void 0:s.frames,null===(c=u.audio)||void 0===c?void 0:c.frames,this._loader.meta.moov);case 28:return e.next=30,this._bufferService.evictBuffer(this._config.bufferBehind);case 30:e.next=35;break;case 32:return e.prev=32,e.t1=e.catch(25),e.abrupt("return",this._emitError($p.create(e.t1)));case 35:return e.prev=35,this._loading=!1,e.finish(35);case 38:this._loader.isLastSegment((null===(i=u.video)||void 0===i?void 0:i.index)||(null===(o=u.audio)||void 0===o?void 0:o.index)||0)?this._end():this._loadSegment();case 39:case"end":return e.stop()}}),e,this,[[6,18],[25,32,35,38]])}))),function(e){return t.apply(this,arguments)})},{key:"_end",value:function(){this._bufferService.endOfStream(),this._stopTick()}},{key:"_startTick",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this._stopTick(),this._tickTimer=setTimeout(this._tick,e)}},{key:"_stopTick",value:function(){clearTimeout(this._tickTimer)}},{key:"_emitError",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];console.error(e),console.table(e),this.emit(Hk,e),t&&this._end()}}],[{key:"isSupported",value:function(){return Kp.isSupported()||!!WebAssembly}}]),a}($k);function rT(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function nT(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?rT(Object(r),!0).forEach((function(t){Vo(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rT(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function iT(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=zo(e);if(t){var i=zo(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return qo(this,r)}}Vo(tT,"version","3.0.0-next.1");var oT=function(t){No(n,t);var r=iT(n);function n(){var e;Co(this,n);for(var t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];return Vo(Uo(e=r.call.apply(r,[this].concat(i))),"mp4",null),Vo(Uo(e),"destroy",(function(){var t,r;e.mp4&&(e.mp4.destroy(),e.mp4=null,null===(t=e.player)||void 0===t||null===(r=t.video)||void 0===r||r.removeEventListener("lowdecode",e._onLowDecode))})),Vo(Uo(e),"_onLowDecode",(function(){var t=e.player.video;t&&(e.player.emit("lowdecode",t.degradeInfo),e.player.emit("core_event",nT(nT({},t.degradeInfo),{},{eventName:Yk})))})),Vo(Uo(e),"_onSwitchURL",(function(t){e.mp4&&(e.player.config.url=t,e.mp4.load(t))})),Vo(Uo(e),"_onLowDecode",(function(){var t=e.player.video;t&&(e.player.emit("lowdecode",t.degradeInfo),e.player.emit("core_event",nT(nT({},t.degradeInfo),{},{eventName:Yk})))})),Vo(Uo(e),"_onDefinitionChange",(function(t){var r=t.to;e.mp4&&e.mp4.load(r)})),e}return Do(n,[{key:"core",get:function(){return this.mp4}},{key:"version",get:function(){return tT.version}},{key:"softDecode",get:function(){var e,t,r=null===(e=this.player)||void 0===e||null===(t=e.config)||void 0===t?void 0:t.mediaType;return!!r&&"video"!==r}},{key:"beforePlayerInit",value:function(){var t=this,r=this.player.config;this.mp4&&this.mp4.destroy(),this.player.switchURL=this._onSwitchURL;var n=r.mp4||{};this.mp4=new tT(nT({softDecode:this.softDecode,media:this.player.video,url:r.url},n)),this.softDecode?(this.player.forceDegradeToVideo=function(){},this.player.video.addEventListener("lowdecode",this._onLowDecode)):e.BasePlugin.defineGetterOrSetter(this.player,{__url:{get:function(){var e,r;return null===(e=t.mp4)||void 0===e||null===(r=e.media)||void 0===r?void 0:r.src},configurable:!0}}),this.on(e.Events.URL_CHANGE,this._onSwitchURL),this.on(e.Events.DEFINITION_CHANGE,this._onDefinitionChange),this.on(e.Events.DESTROY,this.destroy),this._transError(),this.mp4.load()}},{key:"_transError",value:function(){var t=this;this.mp4.on(Hk,(function(r){t.player&&t.player.emit(e.Events.ERROR,new e.Errors(t.player,r))}))}}],[{key:"pluginName",get:function(){return"mp4"}},{key:"isSupported",value:function(e){return tT.isSupported(e)}}]),n}(e.BasePlugin);return Vo(oT,"MP4",tT),oT}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("xgplayer")):"function"==typeof define&&define.amd?define(["xgplayer"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).Mp4Player=t(e.Player)}(this,(function(e){"use strict";function t(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},i="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,n=function(e){try{return!!e()}catch(t){return!0}},s=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),o=function(e){return e&&e.Math==Math&&e},a=o("object"==typeof globalThis&&globalThis)||o("object"==typeof window&&window)||o("object"==typeof self&&self)||o("object"==typeof r&&r)||function(){return this}()||Function("return this")(),u=function(e){return"function"==typeof e},c=u,d="object"==typeof document&&document.all,h=void 0===d&&void 0!==d?function(e){return"object"==typeof e?null!==e:c(e)||e===d}:function(e){return"object"==typeof e?null!==e:c(e)},f=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),l=f,m=Function.prototype,p=m.bind,y=m.call,g=l&&p.bind(y,y),w=l?function(e){return e&&g(e)}:function(e){return e&&function(){return y.apply(e,arguments)}},b=function(e){return null==e},v=b,x=TypeError,U=function(e){if(v(e))throw x("Can't call method on "+e);return e},B=U,S=Object,T=function(e){return S(B(e))},_=T,k=w({}.hasOwnProperty),z=Object.hasOwn||function(e,t){return k(_(e),t)},A={exports:{}},E=a,C=Object.defineProperty,O=function(e,t){try{C(E,e,{value:t,configurable:!0,writable:!0})}catch(r){E[e]=t}return t},M=O,L="__core-js_shared__",P=a[L]||M(L,{}),D=P;(A.exports=function(e,t){return D[e]||(D[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.25.1",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.25.1/LICENSE",source:"https://github.com/zloirock/core-js"});var F,j,R=w,I=0,N=Math.random(),q=R(1..toString),K=function(e){return"Symbol("+(void 0===e?"":e)+")_"+q(++I+N,36)},H=a,$=u,G=function(e){return $(e)?e:void 0},W=function(e,t){return arguments.length<2?G(H[e]):H[e]&&H[e][t]},Y=a,V=W("navigator","userAgent")||"",X=Y.process,Z=Y.Deno,J=X&&X.versions||Z&&Z.version,Q=J&&J.v8;Q&&(j=(F=Q.split("."))[0]>0&&F[0]<4?1:+(F[0]+F[1])),!j&&V&&(!(F=V.match(/Edge\/(\d+)/))||F[1]>=74)&&(F=V.match(/Chrome\/(\d+)/))&&(j=+F[1]);var ee=j,te=n,re=!!Object.getOwnPropertySymbols&&!te((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&ee&&ee<41})),ie=re&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,ne=a,se=A.exports,oe=z,ae=K,ue=re,ce=ie,de=se("wks"),he=ne.Symbol,fe=he&&he.for,le=ce?he:he&&he.withoutSetter||ae,me=function(e){if(!oe(de,e)||!ue&&"string"!=typeof de[e]){var t="Symbol."+e;ue&&oe(he,e)?de[e]=he[e]:de[e]=ce&&fe?fe(t):le(t)}return de[e]},pe={};pe[me("toStringTag")]="z";var ye="[object z]"===String(pe),ge=w,we=ge({}.toString),be=ge("".slice),ve=function(e){return be(we(e),8,-1)},xe=ye,Ue=u,Be=ve,Se=me("toStringTag"),Te=Object,_e="Arguments"==Be(function(){return arguments}()),ke=xe?Be:function(e){var t,r,i;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(r){}}(t=Te(e),Se))?r:_e?Be(t):"Object"==(i=Be(t))&&Ue(t.callee)?"Arguments":i},ze=String,Ae=function(e){try{return ze(e)}catch(t){return"Object"}},Ee={},Ce=h,Oe=a.document,Me=Ce(Oe)&&Ce(Oe.createElement),Le=function(e){return Me?Oe.createElement(e):{}},Pe=!s&&!n((function(){return 7!=Object.defineProperty(Le("div"),"a",{get:function(){return 7}}).a})),De=s&&n((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Fe=h,je=String,Re=TypeError,Ie=function(e){if(Fe(e))return e;throw Re(je(e)+" is not an object")},Ne=f,qe=Function.prototype.call,Ke=Ne?qe.bind(qe):function(){return qe.apply(qe,arguments)},He=w({}.isPrototypeOf),$e=W,Ge=u,We=He,Ye=Object,Ve=ie?function(e){return"symbol"==typeof e}:function(e){var t=$e("Symbol");return Ge(t)&&We(t.prototype,Ye(e))},Xe=u,Ze=Ae,Je=TypeError,Qe=function(e){if(Xe(e))return e;throw Je(Ze(e)+" is not a function")},et=Qe,tt=b,rt=Ke,it=u,nt=h,st=TypeError,ot=Ke,at=h,ut=Ve,ct=function(e,t){var r=e[t];return tt(r)?void 0:et(r)},dt=function(e,t){var r,i;if("string"===t&&it(r=e.toString)&&!nt(i=rt(r,e)))return i;if(it(r=e.valueOf)&&!nt(i=rt(r,e)))return i;if("string"!==t&&it(r=e.toString)&&!nt(i=rt(r,e)))return i;throw st("Can't convert object to primitive value")},ht=TypeError,ft=me("toPrimitive"),lt=function(e,t){if(!at(e)||ut(e))return e;var r,i=ct(e,ft);if(i){if(void 0===t&&(t="default"),r=ot(i,e,t),!at(r)||ut(r))return r;throw ht("Can't convert object to primitive value")}return void 0===t&&(t="number"),dt(e,t)},mt=Ve,pt=function(e){var t=lt(e,"string");return mt(t)?t:t+""},yt=s,gt=Pe,wt=De,bt=Ie,vt=pt,xt=TypeError,Ut=Object.defineProperty,Bt=Object.getOwnPropertyDescriptor,St="enumerable",Tt="configurable",_t="writable";Ee.f=yt?wt?function(e,t,r){if(bt(e),t=vt(t),bt(r),"function"==typeof e&&"prototype"===t&&"value"in r&&_t in r&&!r.writable){var i=Bt(e,t);i&&i.writable&&(e[t]=r.value,r={configurable:Tt in r?r.configurable:i.configurable,enumerable:St in r?r.enumerable:i.enumerable,writable:!1})}return Ut(e,t,r)}:Ut:function(e,t,r){if(bt(e),t=vt(t),bt(r),gt)try{return Ut(e,t,r)}catch(i){}if("get"in r||"set"in r)throw xt("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var kt=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},zt=Ee,At=kt,Et=s?function(e,t,r){return zt.f(e,t,At(1,r))}:function(e,t,r){return e[t]=r,e},Ct={exports:{}},Ot=s,Mt=z,Lt=Function.prototype,Pt=Ot&&Object.getOwnPropertyDescriptor,Dt=Mt(Lt,"name"),Ft={EXISTS:Dt,PROPER:Dt&&"something"===function(){}.name,CONFIGURABLE:Dt&&(!Ot||Ot&&Pt(Lt,"name").configurable)},jt=u,Rt=P,It=w(Function.toString);jt(Rt.inspectSource)||(Rt.inspectSource=function(e){return It(e)});var Nt,qt,Kt,Ht=Rt.inspectSource,$t=u,Gt=a.WeakMap,Wt=$t(Gt)&&/native code/.test(String(Gt)),Yt=A.exports,Vt=K,Xt=Yt("keys"),Zt=function(e){return Xt[e]||(Xt[e]=Vt(e))},Jt={},Qt=Wt,er=a,tr=w,rr=h,ir=Et,nr=z,sr=P,or=Zt,ar=Jt,ur="Object already initialized",cr=er.TypeError,dr=er.WeakMap;if(Qt||sr.state){var hr=sr.state||(sr.state=new dr),fr=tr(hr.get),lr=tr(hr.has),mr=tr(hr.set);Nt=function(e,t){if(lr(hr,e))throw cr(ur);return t.facade=e,mr(hr,e,t),t},qt=function(e){return fr(hr,e)||{}},Kt=function(e){return lr(hr,e)}}else{var pr=or("state");ar[pr]=!0,Nt=function(e,t){if(nr(e,pr))throw cr(ur);return t.facade=e,ir(e,pr,t),t},qt=function(e){return nr(e,pr)?e[pr]:{}},Kt=function(e){return nr(e,pr)}}var yr={set:Nt,get:qt,has:Kt,enforce:function(e){return Kt(e)?qt(e):Nt(e,{})},getterFor:function(e){return function(t){var r;if(!rr(t)||(r=qt(t)).type!==e)throw cr("Incompatible receiver, "+e+" required");return r}}},gr=n,wr=u,br=z,vr=s,xr=Ft.CONFIGURABLE,Ur=Ht,Br=yr.enforce,Sr=yr.get,Tr=Object.defineProperty,_r=vr&&!gr((function(){return 8!==Tr((function(){}),"length",{value:8}).length})),kr=String(String).split("String"),zr=Ct.exports=function(e,t,r){"Symbol("===String(t).slice(0,7)&&(t="["+String(t).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!br(e,"name")||xr&&e.name!==t)&&(vr?Tr(e,"name",{value:t,configurable:!0}):e.name=t),_r&&r&&br(r,"arity")&&e.length!==r.arity&&Tr(e,"length",{value:r.arity});try{r&&br(r,"constructor")&&r.constructor?vr&&Tr(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(n){}var i=Br(e);return br(i,"source")||(i.source=kr.join("string"==typeof t?t:"")),e};Function.prototype.toString=zr((function(){return wr(this)&&Sr(this).source||Ur(this)}),"toString");var Ar,Er,Cr,Or=u,Mr=Ee,Lr=Ct.exports,Pr=O,Dr=function(e,t,r,i){i||(i={});var n=i.enumerable,s=void 0!==i.name?i.name:t;if(Or(r)&&Lr(r,s,i),i.global)n?e[t]=r:Pr(t,r);else{try{i.unsafe?e[t]&&(n=!0):delete e[t]}catch(o){}n?e[t]=r:Mr.f(e,t,{value:r,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return e},Fr=!n((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),jr=z,Rr=u,Ir=T,Nr=Fr,qr=Zt("IE_PROTO"),Kr=Object,Hr=Kr.prototype,$r=Nr?Kr.getPrototypeOf:function(e){var t=Ir(e);if(jr(t,qr))return t[qr];var r=t.constructor;return Rr(r)&&t instanceof r?r.prototype:t instanceof Kr?Hr:null},Gr=u,Wr=String,Yr=TypeError,Vr=w,Xr=Ie,Zr=function(e){if("object"==typeof e||Gr(e))return e;throw Yr("Can't set "+Wr(e)+" as a prototype")},Jr=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=Vr(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),t=r instanceof Array}catch(i){}return function(r,i){return Xr(r),Zr(i),t?e(r,i):r.__proto__=i,r}}():void 0),Qr=i,ei=s,ti=a,ri=u,ii=h,ni=z,si=ke,oi=Ae,ai=Et,ui=Dr,ci=Ee.f,di=He,hi=$r,fi=Jr,li=me,mi=K,pi=yr.enforce,yi=yr.get,gi=ti.Int8Array,wi=gi&&gi.prototype,bi=ti.Uint8ClampedArray,vi=bi&&bi.prototype,xi=gi&&hi(gi),Ui=wi&&hi(wi),Bi=Object.prototype,Si=ti.TypeError,Ti=li("toStringTag"),_i=mi("TYPED_ARRAY_TAG"),ki="TypedArrayConstructor",zi=Qr&&!!fi&&"Opera"!==si(ti.opera),Ai=!1,Ei={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},Ci={BigInt64Array:8,BigUint64Array:8},Oi=function(e){var t=hi(e);if(ii(t)){var r=yi(t);return r&&ni(r,ki)?r.TypedArrayConstructor:Oi(t)}},Mi=function(e){if(!ii(e))return!1;var t=si(e);return ni(Ei,t)||ni(Ci,t)};for(Ar in Ei)(Cr=(Er=ti[Ar])&&Er.prototype)?pi(Cr).TypedArrayConstructor=Er:zi=!1;for(Ar in Ci)(Cr=(Er=ti[Ar])&&Er.prototype)&&(pi(Cr).TypedArrayConstructor=Er);if((!zi||!ri(xi)||xi===Function.prototype)&&(xi=function(){throw Si("Incorrect invocation")},zi))for(Ar in Ei)ti[Ar]&&fi(ti[Ar],xi);if((!zi||!Ui||Ui===Bi)&&(Ui=xi.prototype,zi))for(Ar in Ei)ti[Ar]&&fi(ti[Ar].prototype,Ui);if(zi&&hi(vi)!==Ui&&fi(vi,Ui),ei&&!ni(Ui,Ti))for(Ar in Ai=!0,ci(Ui,Ti,{get:function(){return ii(this)?this[_i]:void 0}}),Ei)ti[Ar]&&ai(ti[Ar],_i,Ar);var Li={NATIVE_ARRAY_BUFFER_VIEWS:zi,TYPED_ARRAY_TAG:Ai&&_i,aTypedArray:function(e){if(Mi(e))return e;throw Si("Target is not a typed array")},aTypedArrayConstructor:function(e){if(ri(e)&&(!fi||di(xi,e)))return e;throw Si(oi(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,r,i){if(ei){if(r)for(var n in Ei){var s=ti[n];if(s&&ni(s.prototype,e))try{delete s.prototype[e]}catch(o){try{s.prototype[e]=t}catch(a){}}}Ui[e]&&!r||ui(Ui,e,r?t:zi&&wi[e]||t,i)}},exportTypedArrayStaticMethod:function(e,t,r){var i,n;if(ei){if(fi){if(r)for(i in Ei)if((n=ti[i])&&ni(n,e))try{delete n[e]}catch(s){}if(xi[e]&&!r)return;try{return ui(xi,e,r?t:zi&&xi[e]||t)}catch(s){}}for(i in Ei)!(n=ti[i])||n[e]&&!r||ui(n,e,t)}},getTypedArrayConstructor:Oi,isView:function(e){if(!ii(e))return!1;var t=si(e);return"DataView"===t||ni(Ei,t)||ni(Ci,t)},isTypedArray:Mi,TypedArray:xi,TypedArrayPrototype:Ui},Pi=Math.ceil,Di=Math.floor,Fi=Math.trunc||function(e){var t=+e;return(t>0?Di:Pi)(t)},ji=function(e){var t=+e;return t!=t||0===t?0:Fi(t)},Ri=ji,Ii=Math.min,Ni=function(e){return e>0?Ii(Ri(e),9007199254740991):0},qi=function(e){return Ni(e.length)},Ki=qi,Hi=ji,$i=Li.aTypedArray;(0,Li.exportTypedArrayMethod)("at",(function(e){var t=$i(this),r=Ki(t),i=Hi(e),n=i>=0?i:r+i;return n<0||n>=r?void 0:t[n]}));var Gi=Qe,Wi=f,Yi=w(w.bind),Vi=n,Xi=ve,Zi=Object,Ji=w("".split),Qi=Vi((function(){return!Zi("z").propertyIsEnumerable(0)}))?function(e){return"String"==Xi(e)?Ji(e,""):Zi(e)}:Zi,en=function(e,t){return Gi(e),void 0===t?e:Wi?Yi(e,t):function(){return e.apply(t,arguments)}},tn=Qi,rn=T,nn=qi,sn=function(e){var t=1==e;return function(r,i,n){for(var s,o=rn(r),a=tn(o),u=en(i,n),c=nn(a);c-- >0;)if(u(s=a[c],c,o))switch(e){case 0:return s;case 1:return c}return t?-1:void 0}},on={findLast:sn(0),findLastIndex:sn(1)},an=on.findLast,un=Li.aTypedArray;(0,Li.exportTypedArrayMethod)("findLast",(function(e){return an(un(this),e,arguments.length>1?arguments[1]:void 0)}));var cn=on.findLastIndex,dn=Li.aTypedArray;(0,Li.exportTypedArrayMethod)("findLastIndex",(function(e){return cn(dn(this),e,arguments.length>1?arguments[1]:void 0)}));var hn={exports:{}},fn={exports:{}},ln=function(e){return null!=e},mn=ln,pn={object:!0,function:!0,undefined:!0},yn=function(e){return!!mn(e)&&hasOwnProperty.call(pn,typeof e)},gn=function(e){if(!yn(e))return!1;try{return!!e.constructor&&e.constructor.prototype===e}catch(t){return!1}},wn=function(e){if("function"!=typeof e)return!1;if(!hasOwnProperty.call(e,"length"))return!1;try{if("number"!=typeof e.length)return!1;if("function"!=typeof e.call)return!1;if("function"!=typeof e.apply)return!1}catch(t){return!1}return!gn(e)},bn=/^\s*class[\s{/}]/,vn=Function.prototype.toString,xn=function(e){return null!=e},Un=xn,Bn=Object.keys,Sn=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}()?Object.keys:function(e){return Bn(Un(e)?Object(e):e)},Tn={},_n={},kn={}.propertyIsEnumerable,zn=Object.getOwnPropertyDescriptor,An=zn&&!kn.call({1:2},1);_n.f=An?function(e){var t=zn(this,e);return!!t&&t.enumerable}:kn;var En=Qi,Cn=U,On=function(e){return En(Cn(e))},Mn=s,Ln=Ke,Pn=_n,Dn=kt,Fn=On,jn=pt,Rn=z,In=Pe,Nn=Object.getOwnPropertyDescriptor;Tn.f=Mn?Nn:function(e,t){if(e=Fn(e),t=jn(t),In)try{return Nn(e,t)}catch(r){}if(Rn(e,t))return Dn(!Ln(Pn.f,e,t),e[t])};var qn={},Kn=ji,Hn=Math.max,$n=Math.min,Gn=On,Wn=function(e,t){var r=Kn(e);return r<0?Hn(r+t,0):$n(r,t)},Yn=qi,Vn=function(e){return function(t,r,i){var n,s=Gn(t),o=Yn(s),a=Wn(i,o);if(e&&r!=r){for(;o>a;)if((n=s[a++])!=n)return!0}else for(;o>a;a++)if((e||a in s)&&s[a]===r)return e||a||0;return!e&&-1}},Xn={includes:Vn(!0),indexOf:Vn(!1)},Zn=z,Jn=On,Qn=Xn.indexOf,es=Jt,ts=w([].push),rs=function(e,t){var r,i=Jn(e),n=0,s=[];for(r in i)!Zn(es,r)&&Zn(i,r)&&ts(s,r);for(;t.length>n;)Zn(i,r=t[n++])&&(~Qn(s,r)||ts(s,r));return s},is=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype");qn.f=Object.getOwnPropertyNames||function(e){return rs(e,is)};var ns={};ns.f=Object.getOwnPropertySymbols;var ss=W,os=qn,as=ns,us=Ie,cs=w([].concat),ds=ss("Reflect","ownKeys")||function(e){var t=os.f(us(e)),r=as.f;return r?cs(t,r(e)):t},hs=z,fs=ds,ls=Tn,ms=Ee,ps=function(e,t,r){for(var i=fs(t),n=ms.f,s=ls.f,o=0;o<i.length;o++){var a=i[o];hs(e,a)||r&&hs(r,a)||n(e,a,s(t,a))}},ys=n,gs=u,ws=/#|\.prototype\./,bs=function(e,t){var r=xs[vs(e)];return r==Bs||r!=Us&&(gs(t)?ys(t):!!t)},vs=bs.normalize=function(e){return String(e).replace(ws,".").toLowerCase()},xs=bs.data={},Us=bs.NATIVE="N",Bs=bs.POLYFILL="P",Ss=bs,Ts=a,_s=Tn.f,ks=Et,zs=Dr,As=O,Es=ps,Cs=Ss,Os=f,Ms=Function.prototype,Ls=Ms.apply,Ps=Ms.call,Ds="object"==typeof Reflect&&Reflect.apply||(Os?Ps.bind(Ls):function(){return Ps.apply(Ls,arguments)}),Fs=Ee.f,js=u,Rs=h,Is=Jr,Ns=ke,qs=String,Ks=function(e){if("Symbol"===Ns(e))throw TypeError("Cannot convert a Symbol value to a string");return qs(e)},Hs=h,$s=Et,Gs=Error,Ws=w("".replace),Ys=String(Gs("zxcasd").stack),Vs=/\n\s*at [^:]*:[^\n]*/,Xs=Vs.test(Ys),Zs=kt,Js=!n((function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",Zs(1,7)),7!==e.stack)})),Qs=W,eo=z,to=Et,ro=He,io=Jr,no=ps,so=function(e,t,r){r in e||Fs(e,r,{configurable:!0,get:function(){return t[r]},set:function(e){t[r]=e}})},oo=function(e,t,r){var i,n;return Is&&js(i=t.constructor)&&i!==r&&Rs(n=i.prototype)&&n!==r.prototype&&Is(e,n),e},ao=function(e,t){return void 0===e?arguments.length<2?"":t:Ks(e)},uo=function(e,t){Hs(t)&&"cause"in t&&$s(e,"cause",t.cause)},co=function(e,t){if(Xs&&"string"==typeof e&&!Gs.prepareStackTrace)for(;t--;)e=Ws(e,Vs,"");return e},ho=Js,fo=s,lo=function(e,t){var r,i,n,s,o,a=e.target,u=e.global,c=e.stat;if(r=u?Ts:c?Ts[a]||As(a,{}):(Ts[a]||{}).prototype)for(i in t){if(s=t[i],n=e.dontCallGetSet?(o=_s(r,i))&&o.value:r[i],!Cs(u?i:a+(c?".":"#")+i,e.forced)&&void 0!==n){if(typeof s==typeof n)continue;Es(s,n)}(e.sham||n&&n.sham)&&ks(s,"sham",!0),zs(r,i,s,e)}},mo=Ds,po=function(e,t,r,i){var n="stackTraceLimit",s=i?2:1,o=e.split("."),a=o[o.length-1],u=Qs.apply(null,o);if(u){var c=u.prototype;if(eo(c,"cause")&&delete c.cause,!r)return u;var d=Qs("Error"),h=t((function(e,t){var r=ao(i?t:e,void 0),n=i?new u(e):new u;return void 0!==r&&to(n,"message",r),ho&&to(n,"stack",co(n.stack,2)),this&&ro(c,this)&&oo(n,this,h),arguments.length>s&&uo(n,arguments[s]),n}));h.prototype=c,"Error"!==a?io?io(h,d):no(h,d,{name:!0}):fo&&n in u&&(so(h,u,n),so(h,u,"prepareStackTrace")),no(h,u);try{c.name!==a&&to(c,"name",a),c.constructor=h}catch(f){}return h}},yo="WebAssembly",go=a.WebAssembly,wo=7!==Error("e",{cause:7}).cause,bo=function(e,t){var r={};r[e]=po(e,t,wo),lo({global:!0,constructor:!0,arity:1,forced:wo},r)},vo=function(e,t){if(go&&go[e]){var r={};r[e]=po("WebAssembly."+e,t,wo),lo({target:yo,stat:!0,constructor:!0,arity:1,forced:wo},r)}};bo("Error",(function(e){return function(t){return mo(e,this,arguments)}})),bo("EvalError",(function(e){return function(t){return mo(e,this,arguments)}})),bo("RangeError",(function(e){return function(t){return mo(e,this,arguments)}})),bo("ReferenceError",(function(e){return function(t){return mo(e,this,arguments)}})),bo("SyntaxError",(function(e){return function(t){return mo(e,this,arguments)}})),bo("TypeError",(function(e){return function(t){return mo(e,this,arguments)}})),bo("URIError",(function(e){return function(t){return mo(e,this,arguments)}})),vo("CompileError",(function(e){return function(t){return mo(e,this,arguments)}})),vo("LinkError",(function(e){return function(t){return mo(e,this,arguments)}})),vo("RuntimeError",(function(e){return function(t){return mo(e,this,arguments)}}));var xo,Uo,Bo=xn,So=Sn,To=function(e){if(!Bo(e))throw new TypeError("Cannot use null or undefined");return e},_o=Math.max,ko="function"==typeof(Uo=Object.assign)&&(Uo(xo={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),xo.foo+xo.bar+xo.trzy==="razdwatrzy")?Object.assign:function(e,t){var r,i,n,s=_o(arguments.length,2);for(e=Object(To(e)),n=function(i){try{e[i]=t[i]}catch(n){r||(r=n)}},i=1;i<s;++i)So(t=arguments[i]).forEach(n);if(void 0!==r)throw r;return e},zo=xn,Ao=Array.prototype.forEach,Eo=Object.create,Co=function(e,t){var r;for(r in e)t[r]=e[r]},Oo="razdwatrzy",Mo=String.prototype.indexOf,Lo="function"==typeof Oo.contains&&!0===Oo.contains("dwa")&&!1===Oo.contains("foo")?String.prototype.contains:function(e){return Mo.call(this,e,arguments[1])>-1},Po=ln,Do=function(e){return!!wn(e)&&!bn.test(vn.call(e))},Fo=ko,jo=function(e){var t=Eo(null);return Ao.call(arguments,(function(e){zo(e)&&Co(Object(e),t)})),t},Ro=Lo,Io=fn.exports=function(e,t){var r,i,n,s,o;return arguments.length<2||"string"!=typeof e?(s=t,t=e,e=null):s=arguments[2],Po(e)?(r=Ro.call(e,"c"),i=Ro.call(e,"e"),n=Ro.call(e,"w")):(r=n=!0,i=!1),o={value:t,configurable:r,enumerable:i,writable:n},s?Fo(jo(s),o):o};Io.gs=function(e,t,r){var i,n,s,o;return"string"!=typeof e?(s=r,r=t,t=e,e=null):s=arguments[3],Po(t)?Do(t)?Po(r)?Do(r)||(s=r,r=void 0):r=void 0:(s=t,t=r=void 0):t=void 0,Po(e)?(i=Ro.call(e,"c"),n=Ro.call(e,"e")):(i=!0,n=!1),o={get:t,set:r,configurable:i,enumerable:n},s?Fo(jo(s),o):o};var No,qo,Ko,Ho,$o,Go,Wo,Yo,Vo,Xo,Zo,Jo,Qo,ea,ta,ra,ia,na,sa=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e};No=hn,qo=hn.exports,Xo=fn.exports,Zo=sa,Jo=Function.prototype.apply,Qo=Function.prototype.call,ea=Object.create,ta=Object.defineProperty,ra=Object.defineProperties,ia=Object.prototype.hasOwnProperty,na={configurable:!0,enumerable:!1,writable:!0},Ho=function(e,t){var r,i;return Zo(t),i=this,Ko.call(this,e,r=function(){$o.call(i,e,r),Jo.call(t,this,arguments)}),r.__eeOnceListener__=t,this},Go=function(e){var t,r,i,n,s;if(ia.call(this,"__ee__")&&(n=this.__ee__[e]))if("object"==typeof n){for(r=arguments.length,s=new Array(r-1),t=1;t<r;++t)s[t-1]=arguments[t];for(n=n.slice(),t=0;i=n[t];++t)Jo.call(i,this,s)}else switch(arguments.length){case 1:Qo.call(n,this);break;case 2:Qo.call(n,this,arguments[1]);break;case 3:Qo.call(n,this,arguments[1],arguments[2]);break;default:for(r=arguments.length,s=new Array(r-1),t=1;t<r;++t)s[t-1]=arguments[t];Jo.call(n,this,s)}},Wo={on:Ko=function(e,t){var r;return Zo(t),ia.call(this,"__ee__")?r=this.__ee__:(r=na.value=ea(null),ta(this,"__ee__",na),na.value=null),r[e]?"object"==typeof r[e]?r[e].push(t):r[e]=[r[e],t]:r[e]=t,this},once:Ho,off:$o=function(e,t){var r,i,n,s;if(Zo(t),!ia.call(this,"__ee__"))return this;if(!(r=this.__ee__)[e])return this;if("object"==typeof(i=r[e]))for(s=0;n=i[s];++s)n!==t&&n.__eeOnceListener__!==t||(2===i.length?r[e]=i[s?0:1]:i.splice(s,1));else i!==t&&i.__eeOnceListener__!==t||delete r[e];return this},emit:Go},Yo={on:Xo(Ko),once:Xo(Ho),off:Xo($o),emit:Xo(Go)},Vo=ra({},Yo),No.exports=qo=function(e){return null==e?ea(Vo):ra(Object(e),Yo)},qo.methods=Wo;var oa=hn.exports,aa=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===ua}(e)}(e)};var ua="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function ca(e,t){return!1!==t.clone&&t.isMergeableObject(e)?ha((r=e,Array.isArray(r)?[]:{}),e,t):e;var r}function da(e,t,r){return e.concat(t).map((function(e){return ca(e,r)}))}function ha(e,t,r){(r=r||{}).arrayMerge=r.arrayMerge||da,r.isMergeableObject=r.isMergeableObject||aa;var i=Array.isArray(t);return i===Array.isArray(e)?i?r.arrayMerge(e,t,r):function(e,t,r){var i={};return r.isMergeableObject(e)&&Object.keys(e).forEach((function(t){i[t]=ca(e[t],r)})),Object.keys(t).forEach((function(n){r.isMergeableObject(t[n])&&e[n]?i[n]=ha(e[n],t[n],r):i[n]=ca(t[n],r)})),i}(e,t,r):ca(t,r)}ha.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,r){return ha(e,r,t)}),{})};var fa=ha;class la extends e.Errors{constructor(e,t,r={},i=""){r.version="3.0.0-next.3",super(e,t,r),this.url=i}}class ma{constructor(e){if(!(e instanceof ArrayBuffer))throw new la("parse","",{line:9,handle:"[Stream] constructor",msg:"data is valid"});this.buffer=e,this.dataview=new DataView(e),this.dataview.position=0}set position(e){this.dataview.position=e}get position(){return this.dataview.position}skip(e){const t=Math.floor(e/4),r=e%4;for(let i=0;i<t;i++)ma.readByte(this.dataview,4);r>0&&ma.readByte(this.dataview,r)}static readByte(e,t,r){let i;switch(t){case 1:i=r?e.getInt8(e.position):e.getUint8(e.position);break;case 2:i=r?e.getInt16(e.position):e.getUint16(e.position);break;case 3:if(r)throw new Error("not supported for readByte 3");i=e.getUint8(e.position)<<16,i|=e.getUint8(e.position+1)<<8,i|=e.getUint8(e.position+2);break;case 4:i=r?e.getInt32(e.position):e.getUint32(e.position);break;case 8:if(r)throw new la("parse","",{line:73,handle:"[Stream] readByte",msg:"not supported for readBody 8"});i=e.getUint32(e.position)<<32,i|=e.getUint32(e.position+4);break;default:i=""}return e.position+=t,i}readUint8(){return ma.readByte(this.dataview,1)}readUint16(){return ma.readByte(this.dataview,2)}readUint32(){return ma.readByte(this.dataview,4)}readUint64(){return ma.readByte(this.dataview,8)}readInt8(){return ma.readByte(this.dataview,1,!0)}readInt16(){return ma.readByte(this.dataview,2,!0)}readInt32(){return ma.readByte(this.dataview,4,!0)}}class pa{constructor(){this.headSize=8,this.size=0,this.type="",this.subBox=[],this.start=-1}readHeader(e){if(this.start=e.position,this.size=e.readUint32(),this.type=String.fromCharCode(e.readUint8(),e.readUint8(),e.readUint8(),e.readUint8()),1===this.size)this.size=e.readUint64();else if(0===this.size&&"mdat"!==this.type)throw new la("parse","",{line:19,handle:"[Box] readHeader",msg:"parse mp4 mdat box failed"});if("uuid"===this.type){const t=[];for(let r=0;r<16;r++)t.push(e.readUint8())}}readBody(e){const t=this.size-e.position+this.start,r=this.type;let i;this.data=e.buffer.slice(e.position,e.position+t),e.position+=this.data.byteLength,i=pa.containerBox.find((e=>e===r))?pa.containerParser:pa.boxParse[r],i&&i instanceof Function&&i.call(this)}read(e){this.readHeader(e),this.readBody(e)}static containerParser(){let e=new ma(this.data);const t=e.buffer.byteLength,r=this;for(;e.position<t;){const t=new pa;t.readHeader(e),r.subBox.push(t),t.readBody(e)}delete r.data,e=null}}t(pa,"boxParse",{}),pa.containerBox=["moov","trak","edts","mdia","minf","dinf","stbl","mvex","moof","traf","mfra"];var ya={};Object.defineProperty(ya,"__esModule",{value:!0}),ya.default=function(e){for(var t=0,r=arguments.length,i=Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];var s=!0,o=!1,a=void 0;try{for(var u,c=i[Symbol.iterator]();!(s=(u=c.next()).done);s=!0){var d=u.value;t+=d.length}}catch(b){o=!0,a=b}finally{try{!s&&c.return&&c.return()}finally{if(o)throw a}}var h=new e(t),f=0,l=!0,m=!1,p=void 0;try{for(var y,g=i[Symbol.iterator]();!(l=(y=g.next()).done);l=!0){var w=y.value;h.set(w,f),f+=w.length}}catch(b){m=!0,p=b}finally{try{!l&&g.return&&g.return()}finally{if(m)throw p}}return h};var ga=function(e){return e&&e.__esModule?e:{default:e}}(ya);var wa=ga.default;function ba(e){const t=new pa;let r,i;t.type=e.readUint8(),r=e.readUint8(),128===r?(t.extend=!0,e.skip(2),r=e.readUint8()+5,i=r-5):(i=r,r+=2),t.size=r;const n=[];for(let s=0;s<i;s++)n.push(Number(e.readUint8()).toString(16).padStart(2,"0"));return t.EScode=n,delete t.subBox,t}function va(e){const t=new pa;let r;return t.type=e.readUint8(),r=e.readUint8(),128===r?(t.extend=!0,e.skip(2),r=e.readUint8()+5):r+=2,t.size=r,t.typeID=e.readUint8(),t.streamUint=e.readUint8(),t.bufferSize=ma.readByte(e.dataview,3),t.maximum=e.readUint32(),t.average=e.readUint32(),t.subBox.push(ba(e)),t}function xa(e){const t=new pa;let r;return t.type=e.readUint8(),r=e.readUint8(),128===r?(t.extend=!0,e.skip(2),r=e.readUint8()+5):r+=2,t.size=r,t.SL=e.readUint8(),delete t.subBox,t}function Ua(e){const t=new pa;let r;return t.type=e.readUint8(),r=e.readUint8(),128===r?(t.extend=!0,e.skip(2),r=e.readUint8()+5):r+=2,t.size=r,t.esID=e.readUint16(),t.priority=e.readUint8(),t.subBox.push(va(e)),t.subBox.push(xa(e)),t}class Ba{constructor(){const e=new Date;e.setFullYear(1904),e.setMonth(0),e.setDate(1),e.setHours(0),e.setMinutes(0),e.setSeconds(0),this.time=e}setTime(e){return this.time.setTime(this.time.getTime()+1*e),this.time.toLocaleString()}}var Sa=Object.freeze(Object.defineProperty({__proto__:null,avc1:function(){let e=new ma(this.data);const t=this;e.skip(6),this.dataReferenceIndex=e.readUint16(),e.skip(16),this.width=e.readUint16(),this.height=e.readUint16(),this.horizresolution=e.readUint32(),this.vertresolution=e.readUint32(),e.skip(4),this.frameCount=e.readUint16(),e.skip(1);for(let r=0;r<31;r++)String.fromCharCode(e.readUint8());for(this.depth=e.readUint16(),e.skip(2);e.buffer.byteLength-e.position>=8;){const r=new pa;r.readHeader(e),t.subBox.push(r),r.readBody(e)}delete this.data,e=null},avcC:function(){let e=new ma(this.data);this.configVersion=e.readUint8(),this.profile=e.readUint8(),this.profileCompatibility=e.readUint8(),this.AVCLevelIndication=e.readUint8(),this.lengthSizeMinusOne=1+(3&e.readUint8()),this.numOfSequenceParameterSets=31&e.readUint8();const t=e.readUint16();this.sequenceLength=t;const r=[];for(let a=0;a<t;a++)r.push(Number(e.readUint8()).toString(16));this.ppsCount=e.readUint8();const i=e.readUint16();this.ppsLength=i;const n=[];for(let a=0;a<i;a++)n.push(Number(e.readUint8()).toString(16));this.pps=n,this.sequence=r;const s=[],o=e.dataview.byteLength;for(;e.position<o;)s.push(e.readUint8());this.last=s,delete this.subBox,delete this.data,e=null},btrt:function(){let e=new ma(this.data);this.bufferSizeDB=e.readUint32(),this.maxBitrate=e.readUint32(),this.avgBitrate=e.readUint32(),delete this.subBox,delete this.data,e=null},co64:function(){let e=new ma(this.data);this.version=e.readUint8(),this.flag=ma.readByte(e.dataview,3),this.count=e.readUint32();const t=[];this.entries=t;for(let r=0,i=this.count;r<i;r++)t.push(e.readUint64());delete this.subBox,delete this.data,e=null},ctts:function(){let e=new ma(this.data);this.version=e.readUint8(),this.flag=ma.readByte(e.dataview,3),this.entryCount=e.readUint32();const t=[];this.entry=t;for(let r=0,i=this.entryCount;r<i;r++)t.push({count:e.readUint32(),offset:e.readUint32()});delete this.subBox,delete this.data,e=null},dref:function(){let e=new ma(this.data);this.version=e.readUint8(),this.flag=ma.readByte(e.dataview,3);const t=e.readUint32();this.entryCount=t;const r=this;for(let i=0;i<t;i++){const t=new pa;r.subBox.push(t),t.read(e)}delete this.data,e=null},elst:function(){let e=new ma(this.data);this.version=e.readUint8(),this.flag=ma.readByte(e.dataview,3);const t=[],r=e.readUint32();this.empty_duration=0,this.start_time=0;let i=0;this.entries=t;for(let n=0;n<r;n++){const r={};t.push(r),1===this.version?(r.segment_duration=e.readUint64(),r.media_time=e.readUint64()):(r.segment_duration=e.readUint32(),r.media_time=e.readInt32()),r.media_rate_integer=e.readInt16(),r.media_rate_fraction=e.readInt16(),0===n&&-1===r.media_time?(this.empty_duration=r.segment_duration,i=1):n===i&&r.media_time>=0&&(this.start_time=r.media_time)}delete this.subBox,delete this.data,e=null},esds:function(){let e=new ma(this.data);this.version=e.readUint8(),this.flag=ma.readByte(e.dataview,3);const t=Ua(e);this.subBox.push(t),delete this.data,e=null},ftyp:function(){let e=new ma(this.data);this.major_brand=String.fromCharCode(e.readUint8(),e.readUint8(),e.readUint8(),e.readUint8()),this.minor_version=e.readUint32();const t=[];for(let r=0,i=Math.floor((e.buffer.byteLength-8)/4);r<i;r++)t.push(String.fromCharCode(e.readUint8(),e.readUint8(),e.readUint8(),e.readUint8()));this.compatible_brands=t,e=null,delete this.subBox,delete this.data},hdlr:function(){let e=new ma(this.data);this.version=e.readUint8(),this.flag=ma.readByte(e.dataview,3),e.skip(4),this.handleType=`${String.fromCharCode(e.readUint8())}${String.fromCharCode(e.readUint8())}${String.fromCharCode(e.readUint8())}${String.fromCharCode(e.readUint8())}`,e.skip(12);const t=[];for(;e.position<this.size-8;)t.push(String.fromCharCode(e.readUint8()));this.name=t.join(""),delete this.subBox,delete this.data,e=null},iods:function(){let e=new ma(this.data);this.version=e.readUint8(),this.flag=ma.readByte(e.dataview,3);const t=[],r=e.buffer.byteLength;for(;e.position<r;)t.push(e.readUint8());this.content=t,delete this.subBox,delete this.data,e=null},mdat:function(){delete this.subBox},mdhd:function(){let e=new ma(this.data);this.version=e.readUint8(),this.flag=ma.readByte(e.dataview,3),1===this.version?(this.create=e.readUint64(),this.modify=e.readUint64(),this.createTime=(new Ba).setTime(1e3*this.create),this.modifyTime=(new Ba).setTime(1e3*this.modify),this.timescale=e.readUint32(),this.duration=e.readUint64()):(this.create=e.readUint32(),this.modify=e.readUint32(),this.createTime=(new Ba).setTime(1e3*this.create),this.modifyTime=(new Ba).setTime(1e3*this.modify),this.timescale=e.readUint32(),this.duration=e.readUint32()),this.language=e.readUint16(),e.readUint16(),delete this.subBox,delete this.data,e=null},mp4a:function(){let e=new ma(this.data);e.skip(6),this.dataReferenceIndex=e.readUint16(),e.skip(8),this.channelCount=e.readUint16(),this.sampleSize=e.readUint16(),e.skip(4),this.sampleRate=e.readUint32()>>16;const t=new pa;t.readHeader(e),this.subBox.push(t),t.readBody(e),delete this.data,e=null},MP4DecConfigDescrTag:va,MP4DecSpecificDescrTag:ba,MP4ESDescrTag:Ua,mvhd:function(){const e=new ma(this.data);this.version=e.readUint8(),this.flag=ma.readByte(e.dataview,3),this.create=e.readUint32(),this.modify=e.readUint32(),this.createTime=(new Ba).setTime(1e3*this.create),this.modifyTime=(new Ba).setTime(1e3*this.modify),this.timeScale=e.readUint32(),this.duration=e.readUint32(),this.rate=e.readUint16()+"."+e.readUint16(),this.volume=e.readUint8()+"."+e.readUint8(),ma.readByte(e.dataview,8),ma.readByte(e.dataview,2);const t=[];for(let r=0;r<9;r++)t.push(e.readUint16()+"."+e.readUint16());this.matrix=t,ma.readByte(e.dataview,24),this.nextTrackID=e.readUint32(),delete this.subBox,delete this.data},pasp:function(){let e=new ma(this.data);this.content=e.buffer.slice(0,this.size-8),delete this.subBox,delete this.data,e=null},SLConfigDescriptor:xa,smhd:function(){let e=new ma(this.data);this.version=e.readUint8(),this.flag=ma.readByte(e.dataview,3),this.balance=e.readInt8()+"."+e.readInt8(),delete this.subBox,delete this.data,e=null},stco:function(){let e=new ma(this.data);this.version=e.readUint8(),this.flag=ma.readByte(e.dataview,3),this.count=e.readUint32();const t=[];this.entries=t;for(let r=0,i=this.count;r<i;r++)t.push(e.readUint32());delete this.subBox,delete this.data,e=null},stsc:function(){let e=new ma(this.data);this.version=e.readUint8(),this.flag=ma.readByte(e.dataview,3),this.count=e.readUint32();const t=[];this.entries=t;for(let r=0,i=this.count;r<i;r++)t.push({first_chunk:e.readUint32(),samples_per_chunk:e.readUint32(),sample_desc_index:e.readUint32()});for(let r,i,n=0,s=this.count;n<s-1;n++)r=t[n],i=t[n-1],r.chunk_count=t[n+1].first_chunk-r.first_chunk,r.first_sample=0===n?1:i.first_sample+i.chunk_count*i.samples_per_chunk;if(1===this.count){const e=t[0];e.first_sample=1,e.chunk_count=0}else if(this.count>1){const e=t[this.count-1],r=t[this.count-2];e.first_sample=r.first_sample+r.chunk_count*r.samples_per_chunk,e.chunk_count=0}delete this.subBox,delete this.data,e=null},stsd:function(){let e=new ma(this.data);this.version=e.readUint8(),this.flag=ma.readByte(e.dataview,3),this.entryCount=e.readUint32();const t=new pa;t.readHeader(e),this.subBox.push(t),t.readBody(e),delete this.data,e=null},stss:function(){let e=new ma(this.data);this.version=e.readUint8(),this.flag=ma.readByte(e.dataview,3),this.count=e.readUint32();const t=[];this.entries=t;for(let r=0,i=this.count;r<i;r++)t.push(e.readUint32());delete this.subBox,delete this.data,e=null},stsz:function(){let e=new ma(this.data);this.version=e.readUint8(),this.flag=ma.readByte(e.dataview,3),this.sampleSize=e.readUint32(),this.count=e.readUint32();const t=[];this.entries=t;for(let r=0,i=this.count;r<i;r++)t.push(e.readUint32());delete this.subBox,delete this.data,e=null},stts:function(){let e=new ma(this.data);this.version=e.readUint8(),this.flag=ma.readByte(e.dataview,3),this.count=e.readUint32();const t=[];for(let r=0,i=this.count;r<i;r++)t.push({sampleCount:e.readUint32(),sampleDuration:e.readUint32()});this.entry=t,delete this.subBox,delete this.data,e=null},tkhd:function(){let e=new ma(this.data);this.version=e.readUint8(),this.flag=ma.readByte(e.dataview,3,0),1===this.version?(this.create=e.readUint64(),this.modify=e.readUint64(),this.createTime=(new Ba).setTime(1e3*this.create),this.modifyTime=(new Ba).setTime(1e3*this.modify),this.trackID=e.readUint32(),this.reserverd=e.readUint32(),this.duration=e.readUint64()):(this.create=e.readUint32(),this.modify=e.readUint32(),this.createTime=(new Ba).setTime(1e3*this.create),this.modifyTime=(new Ba).setTime(1e3*this.modify),this.trackID=e.readUint32(),this.reserverd=e.readUint32(),this.duration=e.readUint32()),e.readUint64(),this.layer=e.readInt16(),this.alternate_group=e.readInt16(),this.volume=e.readInt16()>>8,e.readUint16();const t=[];for(let r=0;r<9;r++)t.push(e.readUint16()+"."+e.readUint16());this.matrix=t,this.width=e.readUint16()+"."+e.readUint16(),this.height=e.readUint16()+"."+e.readUint16(),delete this.data,delete this.subBox,e=null},udta:function(){delete this.subBox},url:function(){let e=new ma(this.data);this.version=e.readUint8(),this.flag=[e.readUint8(),e.readUint8(),e.readUint8()];const t=[],r=e.buffer.byteLength;for(;e.position<r;)t.push(e.readUint8());this.location=t,delete this.subBox,delete this.data,e=null},vmhd:function(){let e=new ma(this.data);this.version=e.readUint8(),this.flag=[e.readUint8(),e.readUint8(),e.readUint8()],this.graphicsmode=e.readUint16(),this.opcolor=[e.readUint16(),e.readUint16(),e.readUint16()],delete this.subBox,delete this.data,e=null}},Symbol.toStringTag,{value:"Module"}));pa.boxParse=Sa;class Ta{constructor(e){this.buffer=null,this.boxes=[],this.nextBox=null,this.start=0;const t=this;t.buffer?wa(Uint8Array,t.buffer,e):t.buffer=e;const r=e.byteLength;e.position=0;const i=new ma(e);for(;r-i.position>=8;){const e=new pa;if(e.readHeader(i),e.size-8<=r-i.position)e.readBody(i),t.boxes.push(e);else{if("mdat"!==e.type){t.nextBox=e,i.position-=8;break}e.readBody(i),t.boxes.push(e)}}t.buffer=new Uint8Array(t.buffer.slice(i.position))}}class _a{constructor(){this.buffer=new Uint8Array(0)}write(...e){const t=this;e.forEach((e=>{e?t.buffer=wa(Uint8Array,t.buffer,e):window.console.error(e)}))}static writeUint32(e){return new Uint8Array([e>>24,e>>16&255,e>>8&255,255&e])}}var ka=Ct.exports,za=Ee,Aa=Ie,Ea=s,Ca=function(e,t,r){return r.get&&ka(r.get,t,{getter:!0}),r.set&&ka(r.set,t,{setter:!0}),za.f(e,t,r)},Oa=function(){var e=Aa(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},Ma=n,La=a.RegExp,Pa=La.prototype;Ea&&Ma((function(){var e=!0;try{La(".","d")}catch(a){e=!1}var t={},r="",i=e?"dgimsy":"gimsy",n=function(e,i){Object.defineProperty(t,e,{get:function(){return r+=i,!0}})},s={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var o in e&&(s.hasIndices="d"),s)n(o,s[o]);return Object.getOwnPropertyDescriptor(Pa,"flags").get.call(t)!==i||r!==i}))&&Ca(Pa,"flags",{configurable:!0,get:Oa});const Da=Math.pow(2,32)-1;class Fa{static type(e){return new Uint8Array([e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)])}static size(e){return _a.writeUint32(e)}static extension(e,t){return new Uint8Array([e,t>>16&255,t>>8&255,255&t])}static ftyp(){const e=new _a;return e.write(Fa.size(24),Fa.type("ftyp"),new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49])),e.buffer}static moov(e){const t=new _a;let r=8;const i=Fa.mvhd(e.duration,e.timeScale),n=Fa.videoTrak(e);let s;const o=Fa.videoOnly||!e.audioConfig;o||(s=Fa.audioTrak(e));const a=Fa.mvex(e.duration,e.timeScale);return(o?[i,n,a]:[i,n,s,a]).forEach((e=>{r+=e.byteLength})),o?t.write(Fa.size(r),Fa.type("moov"),i,n,a):t.write(Fa.size(r),Fa.type("moov"),i,n,s,a),t.buffer}static mvhd(e,t){const r=new _a;e*=t;const i=Math.floor(e/(Da+1)),n=Math.floor(e%(Da+1)),s=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,i>>24,i>>16&255,i>>8&255,255&i,n>>24,n>>16&255,n>>8&255,255&n,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]);return r.write(Fa.size(8+s.length),Fa.type("mvhd"),new Uint8Array(s)),r.buffer}static videoTrak(e){const t=new _a;let r=8;const i=Fa.tkhd({id:1,duration:e.videoDuration,timescale:e.videoTimeScale,width:e.width,height:e.height,type:"video"}),n=Fa.mdia({type:"video",timescale:e.videoTimeScale,duration:e.videoDuration,sps:e.sps,pps:e.pps,pixelRatio:e.pixelRatio,width:e.width,height:e.height});return[i,n].forEach((e=>{r+=e.byteLength})),t.write(Fa.size(r),Fa.type("trak"),i,n),t.buffer}static audioTrak(e){const t=new _a;let r=8;const i=Fa.tkhd({id:2,duration:e.audioDuration,timescale:e.audioTimeScale,width:0,height:0,type:"audio"}),n=Fa.mdia({type:"audio",timescale:e.audioTimeScale,duration:e.audioDuration,channelCount:e.channelCount,samplerate:e.sampleRate,audioConfig:e.audioConfig});return[i,n].forEach((e=>{r+=e.byteLength})),t.write(Fa.size(r),Fa.type("trak"),i,n),t.buffer}static tkhd(e){const t=new _a,r=e.id,i=e.duration*e.timeScale,n=e.width,s=e.height,o=e.type,a=Math.floor(i/(Da+1)),u=Math.floor(i%(Da+1)),c=new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,r>>24&255,r>>16&255,r>>8&255,255&r,0,0,0,0,a>>24,a>>16&255,a>>8&255,255&a,u>>24,u>>16&255,u>>8&255,255&u,0,0,0,0,0,0,0,0,0,0,0,"video"===o?1:0,"audio"===o?1: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,n>>8&255,255&n,0,0,s>>8&255,255&s,0,0]);return t.write(Fa.size(8+c.byteLength),Fa.type("tkhd"),c),t.buffer}static edts(e){const t=new _a,r=e.duration,i=e.mediaTime;return t.write(Fa.size(36),Fa.type("edts")),t.write(Fa.size(28),Fa.type("elst")),t.write(new Uint8Array([0,0,0,1,r>>24&255,r>>16&255,r>>8&255,255&r,i>>24&255,i>>16&255,i>>8&255,255&i,0,0,0,1])),t.buffer}static mdia(e){const t=new _a;let r=8;const i=Fa.mdhd(e.timescale,e.duration),n=Fa.hdlr(e.type),s=Fa.minf(e);return[i,n,s].forEach((e=>{r+=e.byteLength})),t.write(Fa.size(r),Fa.type("mdia"),i,n,s),t.buffer}static mdhd(e,t=0){const r=new _a;t*=e;const i=Math.floor(t/(Da+1)),n=Math.floor(t%(Da+1)),s=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,i>>24,i>>16&255,i>>8&255,255&i,n>>24,n>>16&255,n>>8&255,255&n,85,196,0,0]);return r.write(Fa.size(12+s.byteLength),Fa.type("mdhd"),Fa.extension(1,0),s),r.buffer}static hdlr(e){const t=new _a,r=[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];return"audio"===e&&(r.splice(8,4,115,111,117,110),r.splice(24,13,83,111,117,110,100,72,97,110,100,108,101,114,0)),t.write(Fa.size(8+r.length),Fa.type("hdlr"),new Uint8Array(r)),t.buffer}static minf(e){const t=new _a;let r=8;const i="video"===e.type?Fa.vmhd():Fa.smhd(),n=Fa.dinf(),s=Fa.stbl(e);return[i,n,s].forEach((e=>{r+=e.byteLength})),t.write(Fa.size(r),Fa.type("minf"),i,n,s),t.buffer}static vmhd(){const e=new _a;return e.write(Fa.size(20),Fa.type("vmhd"),new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])),e.buffer}static smhd(){const e=new _a;return e.write(Fa.size(16),Fa.type("smhd"),new Uint8Array([0,0,0,0,0,0,0,0])),e.buffer}static dinf(){const e=new _a;return e.write(Fa.size(36),Fa.type("dinf"),Fa.size(28),Fa.type("dref"),new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1])),e.buffer}static stbl(e){const t=new _a;let r=8;const i=Fa.stsd(e),n=Fa.stts(),s=Fa.stsc(),o=Fa.stsz(),a=Fa.stco();return[i,n,s,o,a].forEach((e=>{r+=e.byteLength})),t.write(Fa.size(r),Fa.type("stbl"),i,n,s,o,a),t.buffer}static stsd(e){const t=new _a;let r;return r="audio"===e.type?Fa.mp4a(e):Fa.avc1(e),t.write(Fa.size(16+r.byteLength),Fa.type("stsd"),Fa.extension(0,0),new Uint8Array([0,0,0,1]),r),t.buffer}static mp4a(e){const t=new _a,r=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]),i=Fa.esds(e.audioConfig);return t.write(Fa.size(8+r.byteLength+i.byteLength),Fa.type("mp4a"),r,i),t.buffer}static esds(e=[43,146,8,0]){const t=e.length,r=new _a,i=new Uint8Array([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(e).concat([6,1,2]));return r.write(Fa.size(8+i.byteLength),Fa.type("esds"),i),r.buffer}static avc1(e){const t=new _a,r=e.sps,i=e.pps,n=e.width,s=e.height,o=e.pixelRatio[0],a=e.pixelRatio[1],u=new Uint8Array([1,r[1],r[2],r[3],255,225].concat([r.length>>>8&255,255&r.length]).concat(r).concat(1).concat([i.length>>>8&255,255&i.length]).concat(i)),c=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,n>>8&255,255&n,s>>8&255,255&s,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),d=new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]),h=new Uint8Array([o>>24,o>>16&255,o>>8&255,255&o,a>>24,a>>16&255,a>>8&255,255&a]);return t.write(Fa.size(40+c.byteLength+u.byteLength+d.byteLength),Fa.type("avc1"),c,Fa.size(8+u.byteLength),Fa.type("avcC"),u,Fa.size(20),Fa.type("btrt"),d,Fa.size(16),Fa.type("pasp"),h),t.buffer}static stts(){const e=new _a,t=new Uint8Array([0,0,0,0,0,0,0,0]);return e.write(Fa.size(16),Fa.type("stts"),t),e.buffer}static stsc(){const e=new _a,t=new Uint8Array([0,0,0,0,0,0,0,0]);return e.write(Fa.size(16),Fa.type("stsc"),t),e.buffer}static stco(){const e=new _a,t=new Uint8Array([0,0,0,0,0,0,0,0]);return e.write(Fa.size(16),Fa.type("stco"),t),e.buffer}static stsz(){const e=new _a,t=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]);return e.write(Fa.size(20),Fa.type("stsz"),t),e.buffer}static mvex(e,t){const r=new _a,i=_a.writeUint32(e*t);return r.write(Fa.size(88),Fa.type("mvex"),Fa.size(16),Fa.type("mehd"),Fa.extension(0,0),i,Fa.trex(1),Fa.trex(2)),r.buffer}static trex(e){const t=new _a,r=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]);return t.write(Fa.size(8+r.byteLength),Fa.type("trex"),r),t.buffer}static moof(e){const t=new _a;let r=8;const i=Fa.mfhd(),n=Fa.traf(e);return[i,n].forEach((e=>{r+=e.byteLength})),t.write(Fa.size(r),Fa.type("moof"),i,n),t.buffer}static mfhd(){const e=new _a,t=_a.writeUint32(Fa.sequence);return Fa.sequence+=1,e.write(Fa.size(16),Fa.type("mfhd"),Fa.extension(0,0),t),e.buffer}static traf(e){const t=new _a;let r=8;const i=Fa.tfhd(e.id),n=Fa.tfdt(e.time),s=Fa.sdtp(e),o=Fa.trun(e,s.byteLength);return[i,n,s,o].forEach((e=>{r+=e.byteLength})),t.write(Fa.size(r),Fa.type("traf"),i,n,s,o),t.buffer}static tfhd(e){const t=new _a,r=_a.writeUint32(e);return t.write(Fa.size(16),Fa.type("tfhd"),Fa.extension(0,0),r),t.buffer}static tfdt(e){const t=new _a,r=Math.floor(e/(Da+1)),i=Math.floor(e%(Da+1));return t.write(Fa.size(20),Fa.type("tfdt"),Fa.extension(1,0),_a.writeUint32(r),_a.writeUint32(i)),t.buffer}static trun(e,t){const r=e.id,i=1===r?16:12,n=new _a,s=_a.writeUint32(e.samples.length),o=_a.writeUint32(96+i*e.samples.length+t);return n.write(Fa.size(20+i*e.samples.length),Fa.type("trun"),Fa.extension(0,e.flags),s,o),e.samples.forEach(((e,t)=>{n.write(_a.writeUint32(e.duration)),n.write(_a.writeUint32(e.size)),1===r?(n.write(_a.writeUint32(e.key?33554432:16842752)),n.write(_a.writeUint32(e.offset))):n.write(_a.writeUint32(16777216))})),n.buffer}static sdtp(e){const t=new _a;return t.write(Fa.size(12+e.samples.length),Fa.type("sdtp"),Fa.extension(0,0)),e.samples.forEach((r=>{t.write(new Uint8Array(1===e.id?[r.key?32:16]:[16]))})),t.buffer}static mdat(e){const t=new _a;let r=8;return e.samples.forEach((e=>{r+=e.size})),t.write(Fa.size(r),Fa.type("mdat")),e.samples.forEach((e=>{t.write(e.buffer)})),t.buffer}}Fa.sequence=1;const ja={};ja.findBox=function(e,t,r=[]){if(e.type!==t){if(e&&e.subBox){const i=e.subBox.filter((e=>e.type===t));i.length?i.forEach((e=>r.push(e))):e.subBox.forEach((e=>ja.findBox(e,t,r)))}}else r.push(e);return(r=[].concat(r)).length>1?r:r[0]},ja.padStart=function(e,t,r){const i=String(r),n=t>>0;let s=Math.ceil(n/i.length);const o=[],a=String(e);for(;s--;)o.push(i);return o.join("").substring(0,n-a.length)+a},ja.toHex=function(...e){const t=[];return e.forEach((e=>{t.push(ja.padStart(Number(e).toString(16),2,0))})),t},ja.sum=function(...e){let t=0;return e.forEach((e=>{t+=e})),t},ja.stscOffset=function(e,t){let r,i="";const n=e.entries.filter((e=>e.first_sample<=t&&t<e.first_sample+e.chunk_count*e.samples_per_chunk))[0];if(n){const e=Math.floor((t-n.first_sample)/n.samples_per_chunk),s=n.first_sample+e*n.samples_per_chunk;return r=n.first_chunk+e,i=[s,t],{chunk_index:r,samples_offset:i}}{const r=e.entries.pop();e.entries.push(r);const i=Math.floor((t-r.first_sample)/r.samples_per_chunk);return{chunk_index:r.first_chunk+i,samples_offset:[r.first_sample+r.samples_per_chunk*i,t]}}},ja.seekSampleOffset=function(e,t,r,i,n){const s=ja.stscOffset(e,i+1),o=t.entries[s.chunk_index-1]+ja.sum.apply(null,r.entries.slice(s.samples_offset[0]-1,s.samples_offset[1]-1))-n;if(void 0===o)throw new Error(`result=${o},stco.length=${t.entries.length},sum=${ja.sum.apply(null,r.entries.slice(0,i))}`);if(o<0)throw new Error(`result=${o},stco.length=${t.entries.length},sum=${ja.sum.apply(null,r.entries.slice(0,i))}`);return o},ja.seekSampleTime=function(e,t,r,i=0){let n,s,o=0,a=0,u=0;if(e.entry.every((e=>(s=e.sampleDuration,r<o+e.sampleCount?(n=a+(r-o)*e.sampleDuration,!1):(o+=e.sampleCount,a+=e.sampleCount*s,!0)))),t){let e=0;t.entry.every((t=>(e+=t.count,!(r<e)||(u=t.offset,!1))))}return n||(n=a+(r-o)*s),n-=i,{time:n,duration:s,offset:u}},ja.seekOrderSampleByTime=function(e,t,r){let i,n=0,s=0,o=0;return e.every(((e,a)=>(i=e.sampleCount*e.sampleDuration/t,r<=n+i?(s=o+Math.ceil((r-n)*t/e.sampleDuration),n+=Math.ceil((r-n)*t/e.sampleDuration)*e.sampleDuration/t,!1):(n+=i,o+=e.sampleCount,!0)))),{order:s,startTime:n}},ja.sampleCount=function(e){let t=0;return e.forEach(((e,r)=>{t+=e.sampleCount})),t},ja.seekTrakDuration=function(e,t){const r=ja.findBox(e,"stts");let i=0;return r.entry.forEach((e=>{i+=e.sampleCount*e.sampleDuration})),Number(i/t).toFixed(4)};class Ra{constructor(e,t,r={},i,n){oa(this),this.url=e,this.range=t,this.withCredentials=i,this.id=t.join("-"),this.on=!1;const s=new window.XMLHttpRequest;s.target=this,s.responseType="arraybuffer",s.withCredentials=this.withCredentials||!1,s.open("get",e),s.setRequestHeader("Range",`bytes=${t[0]}-${t[1]}`),Object.keys(r).map((e=>{s.setRequestHeader(e,r[e])})),s.onload=function(){const t=function(e){const t={};if(e instanceof window.XMLHttpRequest)try{e.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((function(e){const r=e.split(": "),i=r.shift(),n=r.join(": ");t[i]=n}))}catch(r){}return t}(s);s.target.remove(),200===s.status||206===s.status?n&&n instanceof Function&&n({response:s.response,headers:t,status:s.status}):s.target.emit("error",new la("network","",{status:s.status,headers:t,line:25,handle:"[Task] constructor",msg:s.status,url:e}))},s.onerror=function(t){s.target.emit("error",new la("network","",{line:25,handle:"[Task] constructor",msg:t.message,url:e})),s.target.remove()},s.onabort=function(){s.target.remove()},this.xhr=s,Ra.queue.push(this),this.update()}cancel(){this.xhr.abort()}remove(){Ra.queue.filter(((e,t)=>e.url===this.url&&e.id===this.id&&(Ra.queue.splice(t,1),!0))),this.update()}update(){const e=Ra.queue,t=e.filter((e=>e.on)),r=e.filter((e=>!e.on)),i=Ra.limit-t.length;r.forEach(((e,t)=>{t<i&&e.run()}))}run(){1===this.xhr.readyState?(this.on=!0,this.xhr.send()):this.remove()}static clear(){Ra.queue.forEach((e=>{e.on&&e.cancel()})),Ra.queue.length=0}}Ra.queue=[],Ra.limit=2;class Ia{constructor(e,t,r=Math.pow(25,4)){oa(this),this.url=e,this.options=t,this.withCredentials=t.withCredentials,Fa.videoOnly=this.videoOnly=t.videoOnly||!1,this.CHUNK_SIZE=r,this.init(e),this.once("moovReady",this.moovParse.bind(this)),this.cache=new _a,this.bufferCache=new Set,this.timeRage=[],this.canDownload=!0,this.bufferLoaded=new Uint8Array(0),this._boxes=[],this.count=0}getData(e=0,t=e+this.CHUNK_SIZE){const r=this;return new Promise(((i,n)=>{new Ra(this.url,[e,t],this.options.headers||{},this.withCredentials,i,n).once("error",(e=>{r.emit("error",e)}))}))}moovParse(){const e=this,t=this.moovBox,r=ja.findBox(t,"mvhd");let i,n,s,o,a,u,c,d,h,f,l,m,p,y,g=ja.findBox(t,"trak");g=[].concat(g),g.forEach((t=>{const g=ja.findBox(t,"hdlr"),w=ja.findBox(t,"mdhd");if(!g||!w)return void e.emit("error",new la("parse","",{line:72,handle:"[MP4] moovParse",url:e.url}));if("vide"===g.handleType&&e.videoOnly){const e=ja.findBox(t,"elst");t.empty_duration=0,e.empty_duration&&(t.empty_duration=e.empty_duration*w.timescale/r.timeScale),t.time_offset=e.start_time-t.empty_duration}const b=ja.findBox(t,"stsd").subBox[0];if("vide"===g.handleType){const e=ja.findBox(t,"avcC"),r=ja.findBox(t,"tkhd");i=t,a=w.timescale,e?(s=`${b.type}.`+ja.toHex(e.profile,e.profileCompatibility,e.AVCLevelIndication).join(""),c=e.sequence&&e.sequence.map((e=>Number(`0x${e}`))),d=e.pps&&e.pps.map((e=>Number(`0x${e}`))),h=e.profile):s=`${b.type}`,r&&(f=r.width,l=r.height)}if("soun"===g.handleType){n=t;const e=ja.findBox(t,"esds"),r=ja.findBox(t,"mp4a"),i=ja.findBox(t,5);u=w.timescale,o=e?`${b.type}.`+ja.toHex(e.subBox[0].subBox[0].typeID)+`.${e.subBox[0].subBox[0].subBox[0].type}`:`${b.type}`,i&&i.EScode&&(y=i.EScode.map((e=>Number(`0x${e}`)))),r&&(m=r.channelCount,p=r.sampleRate)}})),this.videoTrak=fa({},i),n||(this.videoOnly=!0),this.videoOnly||(this.audioTrak=fa({},n));const w=this._boxes.find((e=>"mdat"===e.type)),b=ja.seekTrakDuration(i,a);let v;this.videoOnly||(v=ja.seekTrakDuration(n,u)),this.mdatStart=w.start;const x=this.videoKeyFrames,U=x.length-1;x.forEach(((e,t)=>{t<U?this.timeRage.push([e.time.time/a,x[t+1].time.time/a]):this.timeRage.push([e.time.time/a,-1])})),this.meta={videoCodec:s,createTime:r.createTime,modifyTime:r.modifyTime,duration:b,timeScale:r.timeScale,videoDuration:b,videoTimeScale:a,endTime:b,sps:c,pps:d,width:f,height:l,profile:h,pixelRatio:[1,1],channelCount:m,sampleRate:p,audioConfig:y},this.videoOnly||(this.meta.audioCodec=o,this.meta.audioDuration=v,this.meta.audioTimeScale=u,this.meta.duration=r.duration/r.timeScale,this.meta.endTime=Math.min(b,v))}init(){this.getMetaInfo()}checkMoovReady(){const e=this._boxes.filter((e=>"moov"===e.type));e.length?(this.moovBox=e[0],this.emit("moovReady",e)):this.emit("error",new la("parse","",{line:203,handle:"[MP4] init",msg:"not find moov box"}))}getMetaInfo(e=0,t=0+this.CHUNK_SIZE){let r=e;this.getData(e,t).then((e=>{const i=e.response;r+=i.byteLength;let n=null;this.bufferLoaded=wa(Uint8Array,this.bufferLoaded,new Uint8Array(i));try{let e=0;this._boxes.length>0&&(e=this._boxes[this._boxes.length-1].size+this._boxes[this._boxes.length-1].start),n=new Ta(this.bufferLoaded.buffer.slice(e,t)),this._boxes=this._boxes.concat(n.boxes);let i=!1,s=!1,o=null;if(this._boxes.map((e=>{"moov"===e.type&&(i=!0),"mdat"===e.type&&(o=e,s=!0)})),i&&s)this.checkMoovReady();else{const e=n.nextBox;e&&"moov"===e.type?this.getMetaInfo(r,r+e.size+28):s&&!e?(r=o.start+o.size,this.getData(r,"").then((e=>{n=new Ta(e.response),this._boxes=this._boxes.concat(n.boxes),this.checkMoovReady()}))):this.getMetaInfo(r,r+this.CHUNK_SIZE)}}catch(s){throw this.emit("error",s.type?s:new la("parse","",{line:176,handle:"[MP4] init",msg:s.message})),s}})).catch((e=>{throw this.emit("error",new la("network","",{line:231,handle:"[MP4] getData",msg:"getData failed"})),e}))}getSamplesByOrders(e="video",t,r){const i="video"===e?this.videoTrak:this.audioTrak,n=ja.findBox(i,"stsc"),s=ja.findBox(i,"stsz"),o=ja.findBox(i,"stts"),a=ja.findBox(i,"stco"),u=ja.findBox(i,"ctts"),c=this.mdatStart;let d=[];if(r=void 0!==r?r:s.entries.length,t instanceof Array)t.forEach(((e,t)=>{d.push({idx:e,size:s.entries[e],time:ja.seekSampleTime(o,u,e,i.time_offset),offset:ja.seekSampleOffset(n,a,s,e,c)})}));else if(0!==r)for(let h=t;h<r;h++)d.push({idx:h,size:s.entries[h],time:ja.seekSampleTime(o,u,h,i.time_offset),offset:ja.seekSampleOffset(n,a,s,h,c)});else d={idx:t,size:s.entries[t],time:ja.seekSampleTime(o,u,t,i.time_offset),offset:ja.seekSampleOffset(n,a,s,t,c)};return d}get videoKeyFrames(){if(this._videoFrames)return this._videoFrames;const e=this.videoTrak,t=ja.findBox(e,"stss"),r=this.getSamplesByOrders("video",t.entries.map((e=>e-1)));return this._videoFrames=r,r}get audioKeyFrames(){if(this._audioFrames)return this._audioFrames;const e=ja.findBox(this.videoTrak,"mdhd").timescale,t=ja.findBox(this.audioTrak,"mdhd").timescale,r=ja.findBox(this.audioTrak,"stts").entry;let i=[];return i=this.videoKeyFrames.map((i=>ja.seekOrderSampleByTime(r,t,i.time.time/e))),this._audioFrames=i,this._audioFrames}packMeta(){if(!this.meta)return;const e=new _a;return e.write(Fa.ftyp()),e.write(Fa.moov(this.meta)),e.buffer}seek(e){const t=e*this.meta.videoTimeScale;let r;const i=this.videoKeyFrames;let n;return this.videoOnly||(n=this.audioKeyFrames),i.every(((e,n)=>{const s=e.time.time,o=i[n+1]?i[n+1].time.time:Number.MAX_SAFE_INTEGER;return!(s<=t&&t<o)||(r=n,!1)})),this.videoOnly||n.every(((e,i)=>{const s=e.startTime,o=n[i+1]?n[i+1].startTime:Number.MAX_SAFE_INTEGER;return!(s<=t&&t<o)||(r=Math.min(i,r),!1)})),this.bufferCache.has(r)?Promise.resolve(null):this.loadFragment(r)}loadFragment(e){let t,r;const i=this.videoKeyFrames[e];let n;if(t=i.offset,this.videoOnly||(n=this.getSamplesByOrders("audio",this.audioKeyFrames[e].order,0),t=Math.min(i.offset,n.offset)),e<this.videoKeyFrames.length-1){const t=this.videoKeyFrames[e+1];let i;r=t.offset,this.videoOnly||(i=this.getSamplesByOrders("audio",this.audioKeyFrames[e+1].order,0),r=Math.max(t.offset,i.offset))}const s=this;if(window.isNaN(t)||void 0!==r&&window.isNaN(r))return s.emit("error",new la("parse","",{line:366,handle:"[MP4] loadFragment",url:s.url})),!1;const o=t+s.mdatStart;return r=r?s.mdatStart+r:"",this.bufferCache.has(e)?Promise.resolve(null):r&&r<=this.bufferLoaded.byteLength?this.createFragment(new Uint8Array(this.bufferLoaded.buffer.slice(o,r)),t,e):this.getData(o,r).then((r=>this.createFragment(new Uint8Array(r.response),t,e)))}addFragment(e){const t=new _a;return t.write(Fa.moof(e)),t.write(Fa.mdat(e)),t.buffer}createFragment(e,t,r){const i=this,n=[];this.bufferCache.add(r);{const s=i.videoKeyFrames.map((e=>e.idx)),o=i.getSamplesByOrders("video",s[r],s[r+1]),a=o.map(((r,i)=>({size:r.size,duration:r.time.duration,offset:r.time.offset,buffer:new Uint8Array(e.slice(r.offset-t,r.offset-t+r.size)),key:0===i})));n.push(this.addFragment({id:1,time:o[0].time.time,firstFlags:33554432,flags:3841,samples:a}))}if(!this.videoOnly){const i=this.getSamplesByOrders("audio",this.audioKeyFrames[r].order,this.audioKeyFrames[r+1]?this.audioKeyFrames[r+1].order:void 0),s=i.map(((r,i)=>({size:r.size,duration:r.time.duration,offset:r.time.offset,buffer:new Uint8Array(e.slice(r.offset-t,r.offset-t+r.size)),key:0===i})));n.push(this.addFragment({id:2,time:i[0].time.time,firstFlags:0,flags:1793,samples:s}))}let s=0;n.every((e=>(s+=e.byteLength,!0)));const o=new Uint8Array(s);let a=0;return n.every((e=>(o.set(e,a),a+=e.byteLength,!0))),Promise.resolve(o)}download(){}cut(e,t){this.bufferCache.clear();const r=e*this.meta.videoTimeScale,i=t*this.meta.videoTimeScale;let n,s;const o=this.videoKeyFrames,a=this.audioKeyFrames;return o.every(((e,t)=>{const a=e.time.time,u=o[t+1]?o[t+1].time.time:Number.MAX_SAFE_INTEGER;return a<=r&&r<u?(n=t,!0):!(a<=i&&i<u)||(s=t,!1)})),a.every(((e,t)=>{const o=e.startTime,u=a[t+1]?a[t+1].startTime:Number.MAX_SAFE_INTEGER;return o<=r&&r<u?(n=Math.min(t,n),!0):!(o<=i&&i<u)||(s=Math.min(t,s),!1)})),s||(s=o.length),this.loadFragmentForCut(n,s)}loadFragmentForCut(e,t){const r=this.videoKeyFrames[e],i=this.getSamplesByOrders("audio",this.audioKeyFrames[e].order,0),n=Math.min(r.offset,i.offset),s=this.videoKeyFrames[t],o=this.getSamplesByOrders("audio",this.audioKeyFrames[t].order,0),a=Math.max(s.offset,o.offset),u=this;return window.isNaN(n)||void 0!==a&&window.isNaN(a)?(u.emit("error",new la("parse","",{line:366,handle:"[MP4] loadFragment",url:u.url})),!1):this.getData(n+u.mdatStart,a?u.mdatStart+a:"").then((r=>u.createFragmentForCut(new Uint8Array(r.response),n,e,a,t)))}createFragmentForCut(e,t,r,i,n){const s=this,o=[];{const i=s.videoKeyFrames.map((e=>e.idx)),a=s.getSamplesByOrders("video",i[r],i[n]).map(((r,i)=>({size:r.size,duration:r.time.duration,offset:r.time.offset,buffer:new Uint8Array(e.slice(r.offset-t,r.offset-t+r.size)),key:0===i})));o.push(this.addFragment({id:1,time:0,firstFlags:33554432,flags:3841,samples:a}))}const a=this.getSamplesByOrders("audio",this.audioKeyFrames[r].order,this.audioKeyFrames[n]?this.audioKeyFrames[n].order:void 0).map(((r,i)=>({size:r.size,duration:r.time.duration,offset:r.time.offset,buffer:new Uint8Array(e.slice(r.offset-t,r.offset-t+r.size)),key:0===i})));o.push(this.addFragment({id:2,time:0,firstFlags:0,flags:1793,samples:a}));let u=0;o.every((e=>(u+=e.byteLength,!0)));const c=new Uint8Array(u);let d=0;return o.every((e=>(c.set(e,d),d+=e.byteLength,!0))),Promise.resolve(c)}clear(){this.cache=new _a,this.bufferCache.clear()}}class Na{constructor(e='video/mp4; codecs="avc1.64001E, mp4a.40.5"'){const t=this;oa(this),this.codecs=e,this.mediaSource=new window.MediaSource,this.url=window.URL.createObjectURL(this.mediaSource),this.queue=[],this.updating=!1,this.mediaSource.addEventListener("sourceopen",(function(){0===t.mediaSource.sourceBuffers.length&&(t.sourceBuffer=t.mediaSource.addSourceBuffer(t.codecs),t.sourceBuffer.addEventListener("error",(function(e){t.emit("error",new la("mse","",{line:16,handle:"[MSE] constructor sourceopen",msg:e.message}))})),t.sourceBuffer.addEventListener("updateend",(function(e){t.emit("updateend");const r=t.queue.shift();r&&t.sourceBuffer&&!t.sourceBuffer.updating&&"open"===t.state&&t.sourceBuffer.appendBuffer(r)})),t.emit("sourceopen"))})),this.mediaSource.addEventListener("sourceclose",(function(){t.emit("sourceclose")}))}get state(){return this.mediaSource.readyState}get duration(){return this.mediaSource.duration}set duration(e){this.mediaSource.duration=e}appendBuffer(e){const t=this.sourceBuffer;return t&&!t.updating&&"open"===this.state?(t.appendBuffer(e),!0):(this.queue.push(e),!1)}removeBuffer(e,t){this.sourceBuffer.remove(e,t)}clearBuffer(){if(this.sourceBuffer){const e=this.sourceBuffer.buffered;for(let t=0;t<e.length;t++)this.sourceBuffer.remove(e.start(t),e.end(t))}}endOfStream(){"open"===this.state&&this.mediaSource.endOfStream()}static isSupported(e){return window.MediaSource&&window.MediaSource.isTypeSupported(e)}}class qa extends e.BasePlugin{static get pluginName(){return"mp4Plugin"}static get defaultConfig(){return{withCredentials:!0,videoOnly:!1,headers:{},reqTimeLength:5,preloadTime:60,maxCache:180,chunkSize:Math.pow(25,3),mp4ProgressTimer:500}}static get version(){return"3.0.0-next.3"}constructor(r){super(r),t(this,"onUrlChange",(e=>{const{player:t}=this;this.stopBuffer(),this.initMp4(e).then((e=>{t.video.src=this.mse.url,t.play()})).catch((e=>{console.error(e)}))})),t(this,"onWaiting",(()=>{})),t(this,"onOnceCanplay",(()=>{const{player:t}=this;if("safari"===e.Sniffer.browser&&t.buffered.length){const e=t.buffered.start(0);t.currentTime=e+.1}})),t(this,"onSeeking",(()=>{const{player:e}=this,t=e.buffered;let r=!1;const i=e.video.currentTime;if(Ra.clear(),e.ended&&this.mp4.clear(),this.progressTimer||this.startBuffer(),t.length){for(let e=0,n=t.length;e<n;e++)if(i>=t.start(e)&&i<=t.end(e)){r=!0;break}r||this.loadData(0,i)}else this.loadData(0,i)})),t(this,"onEnded",(e=>{this.stopBuffer(),this.mse.clearBuffer(),this.mp4.clear()})),this.loadData=this.loadData.bind(this),this.destroy=this.destroy.bind(this),this.waiterTimer=null,this.progressTimer=null,this.timer=null,this.timer1=null,this.mp4=null,this.mse=null,this.rmbFlag=0}afterCreate(){window.__mp4player=this;try{e.BasePlugin.defineGetterOrSetter(this.player,{__url:{get:()=>{try{return this.mse?this.mse.url:this.config.url}catch(e){return null}}}})}catch(t){}this.attachEvents()}beforePlayerInit(){return this.initMp4()}attachEvents(){this.on(e.Events.SEEKING,this.onSeeking),this.on(e.Events.WAITING,this.onWaiting),this.on(e.Events.ENDED,this.onEnded),this.on(e.Events.URL_CHANGE,this.onUrlChange)}detachEvents(){this.off(e.Events.SEEKING,this.onSeeking),this.off(e.Events.WAITING,this.onWaiting),this.off(e.Events.URL_CHANGE,this.onUrlChange),this.stopBuffer()}initMp4(t){const{player:r,config:i}=this,n=new Ia(t||r.config.url,this.config,this.config.chunkSize);return n.reqTimeLength=i.reqTimeLength,new Promise(((t,r)=>{n.once("moovReady",(()=>{const r=!n.meta.audioConfig||this.config.videoOnly?'video/mp4; codecs="avc1.64001E"':'video/mp4; codecs="avc1.64001E, mp4a.40.5"',i=new Na(r);i.on("sourceopen",(()=>{i.appendBuffer(n.packMeta()),i.once("updateend",this.loadData)})),this.mse=i,this.mp4=n,this.once(e.Events.CANPLAY,this.onOnceCanplay),this.startBuffer(),t(n)})),n.on("error",(r=>{console.log("mp4 error",r),this.emit(e.Events.ERROR,r),t()}))})).catch((e=>{throw console.error("[initMp4]error",e),e}))}cut(t=0,r){const{player:i}=this,n=new _a,s=new Ia(i.config.url,this.config,i.config.withCredentials);return new Promise(((i,o)=>{s.once("moovReady",(()=>{(!r||r<=t)&&(r=t+15),r>s.meta.duration&&(t=s.meta.duration-(r-t),r=s.meta.duration),s.cut(t,r).then((o=>{if(o){const a=e.Util.deepCopy({duration:r-t,audioDuration:r-t,endTime:r-t},s.meta);a.duration=r-t,a.videoDuration=r-t,a.audioDuration=r-t,a.endTime=r-t,n.write(s.packMeta(a),o),i(new window.Blob([n.buffer],{type:'video/mp4; codecs="avc1.64001E, mp4a.40.5"'}))}}))})),s.on("error",(e=>{o(e)}))}))}startBuffer(){this.progressTimer&&this.stopBuffer(),this.progressTimer=setInterval((()=>{this.onLoadBufferupdate(),this.rmbFlag>4&&(this.rmbFlag=0),0===this.rmbFlag&&this.onRemoveBuffer()}),this.config.mp4ProgressTimer)}stopBuffer(){clearInterval(this.progressTimer),this.progressTimer=null}loadData(e=0,t=this.player.currentTime){this.timer&&clearTimeout(this.timer),this.mp4.seek(t+.1*e).then((e=>{if(e){const{mse:t}=this;t.updating=!0,t.appendBuffer(e),t.once("updateend",(()=>{t.updating=!1}))}}),(t=>{console.error(t),e<10&&(this.timer1=setTimeout((()=>{this.loadData(e+1)}),2e3))}))}onRemoveBuffer(){const{player:e,config:t,mse:r}=this;if(r.updating)return;const i=this.player.buffered,n=e.currentTime-t.maxCache,s=e.currentTime+t.maxCache;for(let o=0;o<i.length;o++)i.end(o)<n||i.start>s?r.removeBuffer(i.start(o),i.end(o)):i.start(o)<n?r.removeBuffer(i.start(o),n):i.end(o)>s&&r.removeBuffer(s,i.end(o))}onLoadBufferupdate(){const{player:e,config:t}=this,r=this.mse,i=this.mp4;if(r&&!r.updating&&i.canDownload){const r=i.timeRage,n=e.getBufferedRange(),s=e.currentTime+t.preloadTime/2;if(n[1]-s>0)return;r.every(((t,r)=>{const s=(t[0]+(-1!==t[1]?t[1]:e.duration))/2;return 0!==n[1]&&(!(s>n[1]&&!i.bufferCache.has(r))||void this.loadData(0,s))})),this.isEnded(e,i)}}errorHandle(e){const{player:t}=this;e.url=t.src,e.errd&&"object"==typeof e.errd&&this.mp4&&(e.errd.url=this.mp4.url,e.url=this.mp4.url,this.mp4.canDownload=!1),Ra.clear(),this.mp4&&this.mp4.bufferCache&&this.mp4.bufferCache.clear(),this.stopBuffer()}isEnded(){const{player:e,mp4:t,mse:r}=this;if(t.meta.endTime-e.currentTime<2){const t=e.getBufferedRange();e.currentTime-t[1]<.1&&r.endOfStream()}}destroy(){Ra.clear(),this.timer&&clearTimeout(this.timer),clearTimeout(this.waiterTimer),clearTimeout(this.timer1),this.detachEvents()}}const Ka=Math.pow(2,32)-1;class Ha{static type(e){return new Uint8Array([e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)])}static size(e){return _a.writeUint32(e)}static extension(e,t){return new Uint8Array([e,t>>16&255,t>>8&255,255&t])}static ftyp(){const e=new _a;return e.write(Ha.size(28),Ha.type("ftyp"),new Uint8Array([105,115,111,53,0,0,0,1,77,52,65,32,105,115,111,53,100,97,115,104])),e.buffer}static moov(e){const t=new _a;let r=8;const i=Ha.mvhd(e.duration,e.timeScale),n=Ha.audioTrak(e),s=Ha.mvex(e.duration,e.timeScale),o=new _a,a=new Uint8Array([0,0,0,85,117,100,116,97,0,0,0,77,109,101,116,97,0,0,0,0,0,0,0,33,104,100,108,114,0,0,0,0,0,0,0,0,109,100,105,114,97,112,112,108,0,0,0,0,0,0,0,0,0,0,0,0,32,105,108,115,116,0,0,0,12,45,45,45,45,0,0,0,0,0,0,0,12,45,45,45,45,0,0,0,0]);o.write(new Uint8Array(a));const u=o.buffer;return[i,n,s,u].forEach((e=>{r+=e.byteLength})),t.write(Ha.size(r),Ha.type("moov"),i,s,n,u),t.buffer}static mvhd(e,t){const r=new _a;e*=t,e=0;const i=Math.floor(e/(Ka+1)),n=Math.floor(e%(Ka+1)),s=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,i>>24,i>>16&255,i>>8&255,255&i,n>>24,n>>16&255,n>>8&255,255&n,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]);return r.write(Ha.size(8+s.length),Ha.type("mvhd"),new Uint8Array(s)),r.buffer}static audioTrak(e){const t=new _a;let r=8;const i=Ha.tkhd({id:1,duration:e.audioDuration,timeScale:e.audioTimeScale,width:0,height:0,type:"audio"}),n=Ha.mdia({type:"audio",timeScale:e.audioTimeScale,duration:e.audioDuration,channelCount:e.channelCount,sampleRate:e.sampleRate,audioConfig:e.audioConfig}),s=new _a,o=new Uint8Array([0,0,0,44,108,117,100,116,0,0,0,36,116,108,111,117,1,0,0,0,1,0,0,0,72,84,132,35,5,1,114,35,3,114,19,4,125,19,5,115,19,6,4,19]);s.write(Ha.size(52),Ha.type("udta"),new Uint8Array(o));const a=s.buffer;return[i,n,a].forEach((e=>{r+=e.byteLength})),t.write(Ha.size(r),Ha.type("trak"),i,n,a),t.buffer}static tkhd(e){const t=new _a,r=e.id;let i=e.duration*e.timeScale;i=0;const n=e.type,s=Math.floor(0/(Ka+1)),o=Math.floor(0%(Ka+1)),a=new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,r>>24&255,r>>16&255,r>>8&255,255&r,0,0,0,0,s>>24,s>>16&255,s>>8&255,255&s,o>>24,o>>16&255,o>>8&255,255&o,0,0,0,0,0,0,0,0,0,0,0,"video"===n?1:0,"audio"===n?1: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]);return t.write(Ha.size(8+a.byteLength),Ha.type("tkhd"),a),t.buffer}static edts(e){const t=new _a,r=e.duration,i=e.mediaTime;return t.write(Ha.size(36),Ha.type("edts")),t.write(Ha.size(28),Ha.type("elst")),t.write(new Uint8Array([0,0,0,1,r>>24&255,r>>16&255,r>>8&255,255&r,i>>24&255,i>>16&255,i>>8&255,255&i,0,0,0,1])),t.buffer}static mdia(e){const t=new _a;let r=8;const i=Ha.mdhd(e.timeScale),n=Ha.hdlr(e.type),s=Ha.minf(e);return[i,n,s].forEach((e=>{r+=e.byteLength})),t.write(Ha.size(r),Ha.type("mdia"),i,n,s),t.buffer}static mdhd(e,t=0){const r=new _a;t*=e;const i=Math.floor(t/(Ka+1)),n=Math.floor(t%(Ka+1)),s=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,i>>24,i>>16&255,i>>8&255,255&i,n>>24,n>>16&255,n>>8&255,255&n,85,196,0,0]);return r.write(Ha.size(12+s.byteLength),Ha.type("mdhd"),Ha.extension(1,0),s),r.buffer}static hdlr(e){const t=new _a,r=[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];return"audio"===e&&(r.splice(8,4,115,111,117,110),r.splice(24,13,83,111,117,110,100,72,97,110,100,108,101,114,0)),t.write(Ha.size(8+r.length),Ha.type("hdlr"),new Uint8Array(r)),t.buffer}static minf(e){const t=new _a;let r=8;const i="video"===e.type?Ha.vmhd():Ha.smhd(),n=Ha.dinf(),s=Ha.stbl(e);return[i,n,s].forEach((e=>{r+=e.byteLength})),t.write(Ha.size(r),Ha.type("minf"),i,n,s),t.buffer}static vmhd(){const e=new _a;return e.write(Ha.size(20),Ha.type("vmhd"),new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])),e.buffer}static smhd(){const e=new _a;return e.write(Ha.size(16),Ha.type("smhd"),new Uint8Array([0,0,0,0,0,0,0,0])),e.buffer}static dinf(){const e=new _a;return e.write(Ha.size(36),Ha.type("dinf"),Ha.size(28),Ha.type("dref"),new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1])),e.buffer}static stbl(e){const t=new _a;let r=8;const i=Ha.stsd(e),n=Ha.stts(),s=Ha.stsc(),o=Ha.stsz(),a=Ha.stco();return[i,n,s,o,a].forEach((e=>{r+=e.byteLength})),t.write(Ha.size(r),Ha.type("stbl"),i,n,s,o,a),t.buffer}static stsd(e){const t=new _a;let r;return r="audio"===e.type?Ha.mp4a(e):Ha.avc1(e),t.write(Ha.size(16+r.byteLength),Ha.type("stsd"),Ha.extension(0,0),new Uint8Array([0,0,0,1]),r),t.buffer}static mp4a(e){const t=new _a,r=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]),i=Ha.esds(e.audioConfig);return t.write(Ha.size(8+r.byteLength+i.byteLength),Ha.type("mp4a"),r,i),t.buffer}static esds(e=[43,146,8,0]){const t=e.length,r=new _a,i=new Uint8Array([0,0,0,0,3,23+t,0,0,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(e).concat([6,1,2]));return r.write(Ha.size(8+i.byteLength),Ha.type("esds"),i),r.buffer}static avc1(e){const t=new _a,r=e.sps,i=e.pps,n=e.width,s=e.height,o=e.pixelRatio[0],a=e.pixelRatio[1],u=new Uint8Array([1,r[1],r[2],r[3],255,225].concat([r.length>>>8&255,255&r.length]).concat(r).concat(1).concat([i.length>>>8&255,255&i.length]).concat(i)),c=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,n>>8&255,255&n,s>>8&255,255&s,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),d=new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]),h=new Uint8Array([o>>24,o>>16&255,o>>8&255,255&o,a>>24,a>>16&255,a>>8&255,255&a]);return t.write(Ha.size(40+c.byteLength+u.byteLength+d.byteLength),Ha.type("avc1"),c,Ha.size(8+u.byteLength),Ha.type("avcC"),u,Ha.size(20),Ha.type("btrt"),d,Ha.size(16),Ha.type("pasp"),h),t.buffer}static stts(){const e=new _a,t=new Uint8Array([0,0,0,0,0,0,0,0]);return e.write(Ha.size(16),Ha.type("stts"),t),e.buffer}static stsc(){const e=new _a,t=new Uint8Array([0,0,0,0,0,0,0,0]);return e.write(Ha.size(16),Ha.type("stsc"),t),e.buffer}static stco(){const e=new _a,t=new Uint8Array([0,0,0,0,0,0,0,0]);return e.write(Ha.size(16),Ha.type("stco"),t),e.buffer}static stsz(){const e=new _a,t=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]);return e.write(Ha.size(20),Ha.type("stsz"),t),e.buffer}static mvex(e,t){const r=new _a;let i=8;const n=Ha.mehd(e*t),s=Ha.trex(1),o=Ha.trep(1);return[n,s,o].forEach((e=>{i+=e.byteLength})),r.write(Ha.size(i),Ha.type("mvex"),n,s,o),r.buffer}static mehd(e){const t=new _a,r=new Uint8Array([e>>24,e>>16&255,e>>8&255,255&e]);return t.write(Ha.size(16),Ha.type("mehd"),Ha.extension(0,0),r),t.buffer}static trex(e){const t=new _a,r=new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e,0,0,0,1,0,0,4,0,0,0,0,0,0,30,132,128]);return t.write(Ha.size(8+r.byteLength),Ha.type("trex"),r),t.buffer}static trep(e){const t=new _a,r=new Uint8Array([e>>24,e>>16&255,e>>8&255,255&e]);return t.write(Ha.size(16),Ha.type("trep"),Ha.extension(0,0),r),t.buffer}static moof(e){const t=new _a;let r=8;const i=Ha.mfhd(),n=Ha.traf(e);return[i,n].forEach((e=>{r+=e.byteLength})),t.write(Ha.size(r),Ha.type("moof"),i,n),t.buffer}static mfhd(){const e=new _a,t=_a.writeUint32(Ha.sequence);return Ha.sequence+=1,e.write(Ha.size(16),Ha.type("mfhd"),Ha.extension(0,0),t),e.buffer}static traf(e){const t=new _a;let r=8;const i=Ha.tfhd(1),n=Ha.tfdt(e.time),s=Ha.trun(e);return[i,n,s].forEach((e=>{r+=e.byteLength})),t.write(Ha.size(r),Ha.type("traf"),i,n,s),t.buffer}static tfhd(e){const t=new _a,r=_a.writeUint32(e);return t.write(Ha.size(16),Ha.type("tfhd"),Ha.extension(0,131072),r),t.buffer}static tfdt(e){const t=new _a,r=new Uint8Array([e>>24,e>>16&255,e>>8&255,255&e]);return t.write(Ha.size(16),Ha.type("tfdt"),Ha.extension(0,0),r),t.buffer}static trun(e){const t=new _a,r=_a.writeUint32(e.samples.length),i=_a.writeUint32(92+4*e.samples.length);return t.write(Ha.size(20+4*e.samples.length),Ha.type("trun"),Ha.extension(0,513),r,i),e.samples.forEach(((e,r)=>{t.write(_a.writeUint32(e.size))})),t.buffer}static mdat(e){const t=new _a;let r=8;return e.samples.forEach((e=>{r+=e.size})),t.write(Ha.size(r),Ha.type("mdat")),e.samples.forEach((e=>{t.write(e.buffer)})),t.buffer}}Ha.sequence=1;class $a{constructor(e,t,r=1024){oa(this),this.url=e,this.options=t,this.withCredentials=t.withCredentials,this.CHUNK_SIZE=r,this.reqTimeLength=5,this.init(e),this.once("moovReady",this.moovParse.bind(this)),this.cache=new _a,this.bufferCache=new Set,this.mdatCache=[],this.timeRage=[],this.canDownload=!0,this.cut=!1}getData(e=0,t=e+this.CHUNK_SIZE){const r=this;return new Promise(((i,n)=>{new Ra(this.url,[e,t],this.options.headers||{},this.withCredentials,i).once("error",(e=>{r.emit("error",e)}))}))}moovParse(){const t=this,r=this.moovBox,i=ja.findBox(r,"mvhd");let n,s,o,a,u,c,d=ja.findBox(r,"trak");"Array"!==e.Util.typeOf(d)&&(d=[d]),d.forEach((e=>{const r=ja.findBox(e,"hdlr"),i=ja.findBox(e,"mdhd");if(!r||!i)return console.error("!hdlr || !mdhd"),void t.emit("error",new la("parse","",{line:72,handle:"[MP4] moovParse",url:t.url}));const d=ja.findBox(e,"stsd").subBox[0];if("soun"===r.handleType){n=e;const t=ja.findBox(e,"esds"),r=ja.findBox(e,"mp4a"),h=ja.findBox(e,5);o=i.timescale,s=t?`${d.type}.`+ja.toHex(t.subBox[0].subBox[0].typeID)+`.${t.subBox[0].subBox[0].subBox[0].type}`:`${d.type}`,h&&h.EScode&&(c=h.EScode.map((e=>Number(`0x${e}`)))),r&&(a=r.channelCount,u=r.sampleRate)}})),this.audioTrak=fa({},n);const h=this._boxes.find((e=>"mdat"===e.type)),f=parseFloat(ja.seekTrakDuration(n,o));let l,m;this.mdatStart=h.start,this.sampleCount=ja.sampleCount(ja.findBox(this.audioTrak,"stts").entry);const p=ja.findBox(this.audioTrak,"stts").entry;for(let e=0;e<f;e+=this.reqTimeLength)l=ja.seekOrderSampleByTime(p,o,e),e+this.reqTimeLength<f?(m=ja.seekOrderSampleByTime(p,o,e+this.reqTimeLength),this.timeRage.push([{time:l.startTime,order:l.order},{time:m.startTime,order:m.order}])):this.timeRage.push([{time:l.startTime,order:l.order},{time:f,order:this.sampleCount-1}]);this.meta={audioCodec:s,createTime:i.createTime,modifyTime:i.modifyTime,duration:i.duration/i.timeScale,timeScale:i.timeScale,audioDuration:f,audioTimeScale:o,endTime:f,channelCount:a,sampleRate:u,audioConfig:c}}init1(){const e=this;e.getData().then((t=>{let r,i,n,s,o,a=0;try{r=new Ta(t)}catch(u){return console.error(u),e.emit("error",u.type?u:new la("parse","",{line:176,handle:"[MP4] init",msg:u.message})),!1}if(e._boxes=o=r.boxes,o.every((r=>("ftyp"===r.type?(a+=r.size,s=r,e.ftypBox=s,e.ftypBuffer=t.slice(0,s.size)):"mdat"===r.type&&(i=r,i.start=a,a+=r.size,e.mdatBox=i),!0))),i){r.nextBox?e.emit("error",new la("parse","",{line:223,handle:"[MP4] init",msg:"not find moov box"})):e.getData(a,a+1024).then((t=>{const r=new Ta(t);if(e._boxes=e._boxes.concat(r.boxes),r.boxes.every((r=>"moov"===r.type?(a+=r.size,n=r,e.moovBox=n,e.moovBuffer=t.slice(0,n.size),e.emit("moovReady",n),!1):(a+=r.size,!0))),!n){const i=r.nextBox;i?"moov"===i.type?e.getData(a,a+i.size-1).then((r=>{const i=new Ta(r);e._boxes=e._boxes.concat(i.boxes),i.boxes.every((r=>"moov"===r.type?(a+=r.size,n=r,e.moovBox=n,e.moovBuffer=t.slice(0,n.size),e.emit("moovReady",n),!1):(a+=r.size,!0))),n||e.emit("error",new la("parse","",{line:207,handle:"[MP4] init",msg:"not find moov box"}))})).catch((()=>{e.emit("error",new la("network","",{line:210,handle:"[MP4] getData",msg:"getData failed"}))})):e.emit("error",new la("parse","",{line:213,handle:"[MP4] init",msg:"not find moov box"})):e.emit("error",new la("parse","",{line:216,handle:"[MP4] init",msg:"not find moov box"}))}})).catch((()=>{e.emit("error",new la("network","",{line:220,handle:"[MP4] getData",msg:"getData failed"}))}))}else{const t=r.nextBox;t?"moov"===t.type||"free"===t.type?e.getData(a,a+t.size+1024).then((t=>{const r=new Ta(t);if(e._boxes=e._boxes.concat(r.boxes),r.boxes.every((r=>"moov"===r.type?(a+=r.size,n=r,e.moovBox=n,e.moovBuffer=t.slice(0,n.size),!0):"mdat"===r.type?(i=r,i.start=a,a+=r.size,e.mdatBox=i,e.emit("moovReady",n),!1):(a+=r.size,!0))),!i){const t=r.nextBox;t?"free"===t.type?e.getData(a,a+t.size+1024).then((t=>{const r=new Ta(t);e._boxes=e._boxes.concat(r.boxes),r.boxes.every((r=>"mdat"===r.type?(i=r,i.start=a,e.mdatBox=i,e.emit("moovReady",n),!1):"free"===r.type?(e.freeBuffer=t.slice(0,r.size),a+=r.size,!0):(a+=r.size,!0))),i||e.emit("error",new la("parse","",{line:207,handle:"[MP4] init",msg:"not find mdat box"}))})).catch((()=>{e.emit("error",new la("network","",{line:210,handle:"[MP4] getData",msg:"getData failed"}))})):e.emit("error",new la("parse","",{line:213,handle:"[MP4] init",msg:"not find mdat box"})):e.emit("error",new la("parse","",{line:216,handle:"[MP4] init",msg:"not find mdat box"}))}})).catch((t=>{e.emit("error",new la("network","",{line:220,handle:"[MP4] getData",msg:"getData failed"}))})):e.emit("error",new la("parse","",{line:223,handle:"[MP4] init",msg:"not find mdat box"})):e.emit("error",new la("parse","",{line:226,handle:"[MP4] init",msg:"not find mdat box"}))}})).catch((()=>{e.emit("error",new la("network","",{line:230,handle:"[MP4] getData",msg:"getData failed"}))}))}init(){const e=this;e.getData().then((t=>{let r,i,n,s=0;try{r=new Ta(t)}catch(o){return e.emit("error",o.type?o:new la("parse","",{line:176,handle:"[MP4] init",msg:o.message})),!1}if(e._boxes=n=r.boxes,n.every((t=>(s+=t.size,"moov"!==t.type||(i=t,e.moovBox=i,e.emit("moovReady",i),!1)))),!i){const t=r.nextBox;t?"moov"===t.type?e.getData(s,s+t.size+28).then((t=>{const r=new Ta(t);e._boxes=e._boxes.concat(r.boxes),i=r.boxes.filter((e=>"moov"===e.type)),i.length?(e.moovBox=i[0],e.emit("moovReady",i)):e.emit("error",new la("parse","",{line:203,handle:"[MP4] init",msg:"not find moov box"}))})):e.emit("error",new la("parse","",{line:207,handle:"[MP4] init",msg:"not find moov box"})):e.getData(s,"").then((t=>{const r=new Ta(t);r?(e._boxes=e._boxes.concat(r.boxes),r.boxes.every((t=>"moov"!==t.type||(i=t,e.moovBox=i,e.emit("moovReady",i),!1)))):e.emit("error",new la("parse","",{line:225,handle:"[MP4] init",msg:"not find moov box"}))}))}})).catch((t=>{throw e.emit("error",new la("network","",{line:231,handle:"[MP4] getData",msg:"getData failed"})),t}))}getSamplesByOrders(e="audio",t,r){const i=this.audioTrak,n=ja.findBox(i,"stsc"),s=ja.findBox(i,"stsz"),o=ja.findBox(i,"stts"),a=ja.findBox(i,"stco"),u=ja.findBox(i,"ctts"),c=this.mdatStart;let d=[];if(r=void 0!==r?r:s.entries.length,t instanceof Array)t.forEach(((e,t)=>{d.push({idx:e,size:s.entries[e],time:ja.seekSampleTime(o,u,e),offset:ja.seekSampleOffset(n,a,s,e,c)})}));else if(0!==r)for(let h=t;h<r;h++)d.push({idx:h,size:s.entries[h],time:ja.seekSampleTime(o,u,h),offset:ja.seekSampleOffset(n,a,s,h,c)});else d={idx:t,size:s.entries[t],time:ja.seekSampleTime(o,u,t),offset:ja.seekSampleOffset(n,a,s,t,c)};return d}packMeta(){if(!this.meta)return;const e=new _a;return e.write(Ha.ftyp()),e.write(Ha.moov(this.meta)),this.cache.write(e.buffer),e.buffer}seek(e,t=null,r=null){const i=ja.findBox(this.audioTrak,"stts").entry;return t||(t=ja.seekOrderSampleByTime(i,this.meta.audioTimeScale,e).order),r||e+this.reqTimeLength<this.meta.audioDuration&&(r=ja.seekOrderSampleByTime(i,this.meta.audioTimeScale,e+this.reqTimeLength).order),this.bufferCache.has(t)?Promise.resolve(null):this.loadFragment(t,r)}loadFragment(e,t){let r;const i=this,n=this.getSamplesByOrders("audio",e,0).offset;let s;return t?(s=this.getSamplesByOrders("audio",t,0),r=s.offset-1):(s=this.getSamplesByOrders("audio",this.sampleCount-1,0),r=s.offset+s.size-1),window.isNaN(n)||void 0!==r&&window.isNaN(r)?(i.emit("error",new la("parse","",{line:366,handle:"[MP4] loadFragment",url:i.url})),!1):this.getData(n+i.mdatStart,r?i.mdatStart+r:"").then((s=>(r&&this.mdatCache.push({start:n+i.mdatStart,end:i.mdatStart+r,buffer:new Uint8Array(s)}),i.createFragment(new Uint8Array(s),n,e,t))))}addFragment(e){const t=new _a;return t.write(Ha.moof(e)),t.write(Ha.mdat(e)),this.cache.write(t.buffer),t.buffer}createFragment(e,t,r,i){const n=[];this.bufferCache.add(r);const s=this.getSamplesByOrders("audio",r,i),o=s.map(((r,i)=>({size:r.size,duration:r.time.duration,offset:r.time.offset,buffer:new Uint8Array(e.slice(r.offset-t,r.offset-t+r.size)),key:0===i})));n.push(this.addFragment({id:2,time:this.cut?0:s[0].time.time,firstFlags:0,flags:1793,samples:o}));let a=0;n.every((e=>(a+=e.byteLength,!0)));const u=new Uint8Array(a);let c=0;return n.every((e=>(u.set(e,c),c+=e.byteLength,!0))),Promise.resolve(u)}download(){}clear(){this.cache=new _a,this.bufferCache.clear()}}const Ga='audio/mp4; codecs="mp4a.40.5"';class Wa extends e.BasePlugin{static get pluginName(){return"m4aPlugin"}static get defaultConfig(){return{withCredentials:!0,videoOnly:!1,headers:{},reqTimeLength:5,preloadTime:30,maxCache:35,chunkSize:Math.pow(25,5),mp4ProgressTimer:300,segPlay:!1,offline:!1}}static isSupported(){return["chrome","firfox","safari"].some((t=>t===e.Sniffer.browser))&&Na.isSupported(Ga)}constructor(r){super(r),t(this,"onLoadBufferupdate",(()=>{const{config:e,player:t,mse:r,mp4:i}=this;if(r&&!r.updating&&i.canDownload){const r=i.timeRage,n=t.getBufferedRange(),s=t.currentTime+e.preloadTime;if(n[1]-s>0)return;r.every(((e,t)=>0===n[1]?(this.loadData(0,0,0),!1):!(e[0].time>=n[1]&&!i.bufferCache.has(t))||void this.loadData(0,e[0].time,e[0].order,e[1].order))),this.isEnded()}})),t(this,"onOnceCanplay",(()=>{const{player:t}=this;if("safari"===e.Sniffer.browser&&t.buffered.length){const e=t.buffered.start(0);t.currentTime=e+.1}})),t(this,"onSeeking",(e=>{const{player:t}=this,r=t.buffered;let i=!1;const n=t.video.currentTime;console.log("onSeeking",t.ended,n),Ra.clear();const s=t.mp4.timeRage;if(this.progressTimer||this.startBuffer(),r.length){for(let e=0,t=r.length;e<t;e++)if(n>=r.start(e)&&n<=r.end(e)){i=!0;break}i||s.every(((e,t)=>!(e[0].time<=n&&e[1].time>n)||(this.loadData(0,e[0].time,e[0].order,e[1].order),!1)))}else s.every(((e,t)=>!(e[0].time<=n&&e[1].time>n)||(this.loadData(0,e[0].time,e[0].order,e[1].order),!1)))})),t(this,"onPause",(e=>{Ra.clear()})),t(this,"onPlay",(e=>{console.log("onPlay",this.player.ended),this.player.duration-this.player.currentTime<.1&&(this.onEnded(),console.log("ended clearBuffer",this.player.getBufferedRange()),this.player.currentTime=0,this.player.play()),this.waiterTimer&&(clearTimeout(this.waiterTimer),this.waiterTimer=null)})),t(this,"onWaiting",(e=>{const{player:t}=this,r=t.buffered;let i=!1;const n=t.currentTime;Ra.clear();const s=this.mp4.timeRage;if(r.length){for(let e=0,t=r.length;e<t;e++)if(n>=r.start(e)&&n<=r.end(e)){i=!0;break}i||s.every(((e,t)=>!(e[0].time<=n&&e[1].time>n)||(this.loadData(0,e[0].time,e[0].order,e[1].order),!1)))}else s.every(((e,t)=>!(e[0].time<=n&&e[1].time>n)||(this.loadData(0,e[0].time,e[0].order,e[1].order),!1)))})),t(this,"onEnded",(e=>{this.stopBuffer(),this.mp4.clear(),this.mse.clearBuffer()})),t(this,"replay",(()=>{})),this.mp4=null,this.mse=null,this.waiterTimer=null,this.name="",this.vid=""}afterCreate(){if(Wa.isSupported()){try{e.BasePlugin.defineGetterOrSetter(this.player,{__url:{get:()=>{try{return this.mse?this.mse.url:this.config.url}catch(e){return null}}}})}catch(t){}this.attachEvents()}}beforePlayerInit(){if(!Wa.isSupported())return;const{playerConfig:t,player:r}=this;let i={};if(i="Array"===e.Util.typeOf(t.url)?t.url:[{src:t.url,name:t.name,vid:t.vid,poster:t.poster}],i[0].src)return this.urlInfo=i,this.url=i[0].src,this.initM4a(this.url).then((e=>{const t=e[0],i=e[1];r.mp4=t,r.mse=i,t.on("error",(e=>{this.errorHandle(e)}))}));r.emit("error",new e.Errors("other",r.config.vid))}attachEvents(){this.once(e.Events.CANPLAY,this.onOnceCanplay),this.on(e.Events.SEEKING,this.onSeeking),this.on(e.Events.WAITING,this.onWaiting),this.on(e.Events.ENDED,this.onEnded),this.on(e.Events.PLAY,this.onPlay)}detachEvents(){this.off(e.Events.CANPLAY,this.onOnceCanplay),this.off(e.Events.SEEKING,this.onSeeking),this.off(e.Events.WAITING,this.onWaiting),this.stopBuffer()}startBuffer(){this.progressTimer&&this.stopBuffer(),this.progressTimer=setInterval((()=>{this.onLoadBufferupdate()}),this.config.mp4ProgressTimer)}stopBuffer(){clearInterval(this.progressTimer),this.progressTimer=null}loadData(e=0,t=0,r=null,i=null){const{player:n}=this;this.timer&&clearTimeout(n.timer),t=Math.max(t,n.currentTime),this.timer=setTimeout((()=>{n.mp4.seek(t,r,i).then((e=>{if(e){const t=n.mse;t.updating=!0,t.appendBuffer(e),t.once("updateend",(()=>{t.updating=!1}))}}),(e=>{console.error(e)}))}),50)}initM4a(e,t=!1){const{config:r}=this;return this.mp4=new $a(e,this.config,this.config.chunkSize),this.mp4.reqTimeLength=r.reqTimeLength,new Promise(((e,r)=>{this.mp4.once("moovReady",(()=>{this.mse=new Na(Ga),t&&(this.mse.replaying=!0),this.startBuffer(),this.mse.on("sourceopen",(()=>{this.mse.appendBuffer(this.mp4.packMeta()),this.mse.once("updateend",(()=>{this.loadData()}))})),this.mse.on("error",(function(e){r(e)})),e([this.mp4,this.mse])})),this.mp4.on("error",(e=>{r(e)}))}))}cut(t,r=0,i){const n=new _a;return new Promise(((s,o)=>{const a=new $a(t,this.config,this.config.chunkSize);a.once("moovReady",(()=>{(!i||i<=r)&&(i=r+15),i>a.meta.audioDuration&&(r=a.meta.audioDuration-(i-r),i=a.meta.audioDuration),a.reqTimeLength=i-r,a.cut=!0,a.seek(r).then((t=>{if(t){const r=e.Util.deepCopy({duration:a.reqTimeLength,audioDuration:a.reqTimeLength,endTime:a.reqTimeLength},a.meta);r.duration=a.reqTimeLength,r.audioDuration=a.reqTimeLength,r.endTime=a.reqTimeLength,n.write(a.packMeta(r),t),s(new window.Blob([n.buffer],{type:Ga}))}}))})),a.on("error",(e=>{o(e)}))}))}errorHandle(e){const{player:t}=this;e.url=t.src,e.errd&&"object"==typeof e.errd&&this.mp4&&(e.errd.url=this.mp4.url,e.url=this.mp4.url,this.mp4.canDownload=!1),Ra.clear(),this.mp4&&this.mp4.bufferCache&&this.mp4.bufferCache.clear(),this.detachEvents()}isEnded(){const{player:e,mp4:t,mse:r}=this;if(t.meta.endTime-e.currentTime<2){const t=e.getBufferedRange();e.currentTime-t[1]<.1&&r.endOfStream()}}destroy(){const{player:e}=this;Ra.clear(),e.timer&&clearTimeout(e.timer)}}return qa.M4aPlugin=Wa,qa}));
2
2
  //# sourceMappingURL=index.min.js.map